17 #include <linux/serial.h>
27 #include <asm/suspend.h>
28 #include <asm/clock.h>
29 #include <asm/mmzone.h>
31 #include <cpu/dma-register.h>
187 static const unsigned int ts_shift[] =
TS_SHIFT;
190 .slave = sh7724_dmae_slaves,
192 .channel = sh7724_dmae_channels,
193 .channel_num =
ARRAY_SIZE(sh7724_dmae_channels),
204 static struct resource sh7724_dmae0_resources[] = {
238 static struct resource sh7724_dmae1_resources[] = {
272 .name =
"sh-dma-engine",
274 .resource = sh7724_dmae0_resources,
275 .num_resources =
ARRAY_SIZE(sh7724_dmae0_resources),
277 .platform_data = &dma_platform_data,
282 .name =
"sh-dma-engine",
284 .resource = sh7724_dmae1_resources,
285 .num_resources =
ARRAY_SIZE(sh7724_dmae1_resources),
287 .platform_data = &dma_platform_data,
293 .mapbase = 0xffe00000,
307 .platform_data = &scif0_platform_data,
312 .mapbase = 0xffe10000,
326 .platform_data = &scif1_platform_data,
331 .mapbase = 0xffe20000,
345 .platform_data = &scif2_platform_data,
350 .mapbase = 0xa4e30000,
363 .platform_data = &scif3_platform_data,
368 .mapbase = 0xa4e40000,
381 .platform_data = &scif4_platform_data,
386 .mapbase = 0xa4e50000,
399 .platform_data = &scif5_platform_data,
404 static struct resource rtc_resources[] = {
407 .end = 0xa465fec0 + 0x58 - 1,
431 .resource = rtc_resources,
435 static struct resource iic0_resources[] = {
439 .end = 0x04470018 - 1,
450 .name =
"i2c-sh_mobile",
453 .resource = iic0_resources,
457 static struct resource iic1_resources[] = {
461 .end = 0x04750018 - 1,
472 .name =
"i2c-sh_mobile",
475 .resource = iic1_resources,
479 static struct uio_info vpu_platform_data = {
485 static struct resource vpu_resources[] = {
498 .name =
"uio_pdrv_genirq",
501 .platform_data = &vpu_platform_data,
503 .resource = vpu_resources,
508 static struct uio_info veu0_platform_data = {
514 static struct resource veu0_resources[] = {
527 .name =
"uio_pdrv_genirq",
530 .platform_data = &veu0_platform_data,
532 .resource = veu0_resources,
537 static struct uio_info veu1_platform_data = {
543 static struct resource veu1_resources[] = {
556 .name =
"uio_pdrv_genirq",
559 .platform_data = &veu1_platform_data,
561 .resource = veu1_resources,
566 static struct uio_info beu0_platform_data = {
572 static struct resource beu0_resources[] = {
585 .name =
"uio_pdrv_genirq",
588 .platform_data = &beu0_platform_data,
590 .resource = beu0_resources,
595 static struct uio_info beu1_platform_data = {
601 static struct resource beu1_resources[] = {
614 .name =
"uio_pdrv_genirq",
617 .platform_data = &beu1_platform_data,
619 .resource = beu1_resources,
624 .channel_offset = 0x60,
626 .clockevent_rating = 125,
627 .clocksource_rating = 200,
630 static struct resource cmt_resources[] = {
646 .platform_data = &cmt_platform_data,
648 .resource = cmt_resources,
653 .channel_offset = 0x04,
655 .clockevent_rating = 200,
658 static struct resource tmu0_resources[] = {
674 .platform_data = &tmu0_platform_data,
676 .resource = tmu0_resources,
681 .channel_offset = 0x10,
683 .clocksource_rating = 200,
686 static struct resource tmu1_resources[] = {
702 .platform_data = &tmu1_platform_data,
704 .resource = tmu1_resources,
709 .channel_offset = 0x1c,
713 static struct resource tmu2_resources[] = {
729 .platform_data = &tmu2_platform_data,
731 .resource = tmu2_resources,
737 .channel_offset = 0x04,
741 static struct resource tmu3_resources[] = {
757 .platform_data = &tmu3_platform_data,
759 .resource = tmu3_resources,
764 .channel_offset = 0x10,
768 static struct resource tmu4_resources[] = {
784 .platform_data = &tmu4_platform_data,
786 .resource = tmu4_resources,
791 .channel_offset = 0x1c,
795 static struct resource tmu5_resources[] = {
811 .platform_data = &tmu5_platform_data,
813 .resource = tmu5_resources,
818 static struct uio_info jpu_platform_data = {
824 static struct resource jpu_resources[] = {
837 .name =
"uio_pdrv_genirq",
840 .platform_data = &jpu_platform_data,
842 .resource = jpu_resources,
847 static struct uio_info spu0_platform_data = {
853 static struct resource spu0_resources[] = {
866 .name =
"uio_pdrv_genirq",
869 .platform_data = &spu0_platform_data,
871 .resource = spu0_resources,
876 static struct uio_info spu1_platform_data = {
882 static struct resource spu1_resources[] = {
895 .name =
"uio_pdrv_genirq",
898 .platform_data = &spu1_platform_data,
900 .resource = spu1_resources,
933 static int __init sh7724_devices_setup(
void)
969 #define RAMCR_CACHE_L2FC 0x0002
970 #define RAMCR_CACHE_L2E 0x0001
971 #define L2_CACHE_ENABLE (RAMCR_CACHE_L2E|RAMCR_CACHE_L2FC)
1131 static struct intc_group groups[] __initdata = {
1147 { 0xa4080080, 0xa40800c0, 8,
1150 { 0xa4080084, 0xa40800c4, 8,
1153 { 0xa4080088, 0xa40800c8, 8,
1155 { 0xa408008c, 0xa40800cc, 8,
1158 { 0xa4080090, 0xa40800d0, 8,
1161 { 0xa4080094, 0xa40800d4, 8,
1164 { 0xa4080098, 0xa40800d8, 8,
1167 { 0xa408009c, 0xa40800dc, 8,
1170 { 0xa40800a0, 0xa40800e0, 8,
1173 { 0xa40800a4, 0xa40800e4, 8,
1175 { 0xa40800a8, 0xa40800e8, 8,
1178 { 0xa40800ac, 0xa40800ec, 8,
1181 { 0xa40800b0, 0xa40800f0, 8,
1183 { 0xa4140044, 0xa4140064, 8,
1193 { 0xa408000c, 0, 16, 4, { 0,
MMCIF, 0,
ATAPI } },
1204 { 0xa4140010, 0, 32, 4,
1209 { 0xa414001c, 16, 2,
1223 prio_registers, sense_registers, ack_registers),
1277 } sh7724_rstandby_state;
1279 static int sh7724_pre_sleep_notifier_call(
struct notifier_block *nb,
1286 sh7724_rstandby_state.mmselr =
__raw_readl(0xff800020);
1287 sh7724_rstandby_state.mmselr |= 0xa5a50000;
1288 sh7724_rstandby_state.cs0bcr =
__raw_readl(0xfec10004);
1289 sh7724_rstandby_state.cs4bcr =
__raw_readl(0xfec10010);
1290 sh7724_rstandby_state.cs5abcr =
__raw_readl(0xfec10014);
1291 sh7724_rstandby_state.cs5bbcr =
__raw_readl(0xfec10018);
1292 sh7724_rstandby_state.cs6abcr =
__raw_readl(0xfec1001c);
1293 sh7724_rstandby_state.cs6bbcr =
__raw_readl(0xfec10020);
1294 sh7724_rstandby_state.cs4wcr =
__raw_readl(0xfec10030);
1295 sh7724_rstandby_state.cs5awcr =
__raw_readl(0xfec10034);
1296 sh7724_rstandby_state.cs5bwcr =
__raw_readl(0xfec10038);
1297 sh7724_rstandby_state.cs6awcr =
__raw_readl(0xfec1003c);
1298 sh7724_rstandby_state.cs6bwcr =
__raw_readl(0xfec10040);
1301 sh7724_rstandby_state.ipra =
__raw_readw(0xa4080000);
1302 sh7724_rstandby_state.iprb =
__raw_readw(0xa4080004);
1303 sh7724_rstandby_state.iprc =
__raw_readw(0xa4080008);
1304 sh7724_rstandby_state.iprd =
__raw_readw(0xa408000c);
1305 sh7724_rstandby_state.ipre =
__raw_readw(0xa4080010);
1306 sh7724_rstandby_state.iprf =
__raw_readw(0xa4080014);
1307 sh7724_rstandby_state.iprg =
__raw_readw(0xa4080018);
1308 sh7724_rstandby_state.iprh =
__raw_readw(0xa408001c);
1309 sh7724_rstandby_state.ipri =
__raw_readw(0xa4080020);
1310 sh7724_rstandby_state.iprj =
__raw_readw(0xa4080024);
1311 sh7724_rstandby_state.iprk =
__raw_readw(0xa4080028);
1312 sh7724_rstandby_state.iprl =
__raw_readw(0xa408002c);
1313 sh7724_rstandby_state.imr0 =
__raw_readb(0xa4080080);
1314 sh7724_rstandby_state.imr1 =
__raw_readb(0xa4080084);
1315 sh7724_rstandby_state.imr2 =
__raw_readb(0xa4080088);
1316 sh7724_rstandby_state.imr3 =
__raw_readb(0xa408008c);
1317 sh7724_rstandby_state.imr4 =
__raw_readb(0xa4080090);
1318 sh7724_rstandby_state.imr5 =
__raw_readb(0xa4080094);
1319 sh7724_rstandby_state.imr6 =
__raw_readb(0xa4080098);
1320 sh7724_rstandby_state.imr7 =
__raw_readb(0xa408009c);
1321 sh7724_rstandby_state.imr8 =
__raw_readb(0xa40800a0);
1322 sh7724_rstandby_state.imr9 =
__raw_readb(0xa40800a4);
1323 sh7724_rstandby_state.imr10 =
__raw_readb(0xa40800a8);
1324 sh7724_rstandby_state.imr11 =
__raw_readb(0xa40800ac);
1325 sh7724_rstandby_state.imr12 =
__raw_readb(0xa40800b0);
1328 sh7724_rstandby_state.rwtcnt =
__raw_readb(0xa4520000);
1329 sh7724_rstandby_state.rwtcnt |= 0x5a00;
1330 sh7724_rstandby_state.rwtcsr =
__raw_readb(0xa4520004);
1331 sh7724_rstandby_state.rwtcsr |= 0xa500;
1332 __raw_writew(sh7724_rstandby_state.rwtcsr & 0x07, 0xa4520004);
1335 sh7724_rstandby_state.irdaclk =
__raw_readl(0xa4150018);
1336 sh7724_rstandby_state.spuclk =
__raw_readl(0xa415003c);
1341 static int sh7724_post_sleep_notifier_call(
struct notifier_block *nb,
1348 __raw_writel(sh7724_rstandby_state.mmselr, 0xff800020);
1349 __raw_writel(sh7724_rstandby_state.cs0bcr, 0xfec10004);
1350 __raw_writel(sh7724_rstandby_state.cs4bcr, 0xfec10010);
1351 __raw_writel(sh7724_rstandby_state.cs5abcr, 0xfec10014);
1352 __raw_writel(sh7724_rstandby_state.cs5bbcr, 0xfec10018);
1353 __raw_writel(sh7724_rstandby_state.cs6abcr, 0xfec1001c);
1354 __raw_writel(sh7724_rstandby_state.cs6bbcr, 0xfec10020);
1355 __raw_writel(sh7724_rstandby_state.cs4wcr, 0xfec10030);
1356 __raw_writel(sh7724_rstandby_state.cs5awcr, 0xfec10034);
1357 __raw_writel(sh7724_rstandby_state.cs5bwcr, 0xfec10038);
1358 __raw_writel(sh7724_rstandby_state.cs6awcr, 0xfec1003c);
1359 __raw_writel(sh7724_rstandby_state.cs6bwcr, 0xfec10040);
1389 __raw_writew(sh7724_rstandby_state.rwtcnt, 0xa4520000);
1390 __raw_writew(sh7724_rstandby_state.rwtcsr, 0xa4520004);
1393 __raw_writel(sh7724_rstandby_state.irdaclk, 0xa4150018);
1394 __raw_writel(sh7724_rstandby_state.spuclk, 0xa415003c);
1400 .notifier_call = sh7724_pre_sleep_notifier_call,
1405 .notifier_call = sh7724_post_sleep_notifier_call,
1409 static int __init sh7724_sleep_setup(
void)
1412 &sh7724_pre_sleep_notifier);
1415 &sh7724_post_sleep_notifier);