diff options
Diffstat (limited to 'arch/sh/kernel')
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 190 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 186 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 134 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 134 | ||||
| -rw-r--r-- | arch/sh/kernel/hw_breakpoint.c | 30 | ||||
| -rw-r--r-- | arch/sh/kernel/setup.c | 3 | ||||
| -rw-r--r-- | arch/sh/kernel/time.c | 6 |
7 files changed, 619 insertions, 64 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index ef3f9782780..fd7e3639e84 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
| @@ -7,19 +7,167 @@ | |||
| 7 | * License. See the file "COPYING" in the main directory of this archive | 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. | 8 | * for more details. |
| 9 | */ | 9 | */ |
| 10 | #include <linux/platform_device.h> | ||
| 11 | #include <linux/init.h> | 10 | #include <linux/init.h> |
| 11 | #include <linux/mm.h> | ||
| 12 | #include <linux/platform_device.h> | ||
| 12 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
| 13 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
| 14 | #include <linux/mm.h> | 15 | #include <linux/sh_timer.h> |
| 15 | #include <linux/uio_driver.h> | 16 | #include <linux/uio_driver.h> |
| 16 | #include <linux/usb/m66592.h> | 17 | #include <linux/usb/m66592.h> |
| 17 | #include <linux/sh_timer.h> | 18 | |
| 18 | #include <asm/clock.h> | 19 | #include <asm/clock.h> |
| 20 | #include <asm/dmaengine.h> | ||
| 19 | #include <asm/mmzone.h> | 21 | #include <asm/mmzone.h> |
| 20 | #include <asm/dma-sh.h> | 22 | #include <asm/siu.h> |
| 23 | |||
| 24 | #include <cpu/dma-register.h> | ||
| 21 | #include <cpu/sh7722.h> | 25 | #include <cpu/sh7722.h> |
| 22 | 26 | ||
| 27 | static struct sh_dmae_slave_config sh7722_dmae_slaves[] = { | ||
| 28 | { | ||
| 29 | .slave_id = SHDMA_SLAVE_SCIF0_TX, | ||
| 30 | .addr = 0xffe0000c, | ||
| 31 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
| 32 | .mid_rid = 0x21, | ||
| 33 | }, { | ||
| 34 | .slave_id = SHDMA_SLAVE_SCIF0_RX, | ||
| 35 | .addr = 0xffe00014, | ||
| 36 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
| 37 | .mid_rid = 0x22, | ||
| 38 | }, { | ||
| 39 | .slave_id = SHDMA_SLAVE_SCIF1_TX, | ||
| 40 | .addr = 0xffe1000c, | ||
| 41 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
| 42 | .mid_rid = 0x25, | ||
| 43 | }, { | ||
| 44 | .slave_id = SHDMA_SLAVE_SCIF1_RX, | ||
| 45 | .addr = 0xffe10014, | ||
| 46 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
| 47 | .mid_rid = 0x26, | ||
| 48 | }, { | ||
| 49 | .slave_id = SHDMA_SLAVE_SCIF2_TX, | ||
| 50 | .addr = 0xffe2000c, | ||
| 51 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
| 52 | .mid_rid = 0x29, | ||
| 53 | }, { | ||
| 54 | .slave_id = SHDMA_SLAVE_SCIF2_RX, | ||
| 55 | .addr = 0xffe20014, | ||
| 56 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT), | ||
| 57 | .mid_rid = 0x2a, | ||
| 58 | }, { | ||
| 59 | .slave_id = SHDMA_SLAVE_SIUA_TX, | ||
| 60 | .addr = 0xa454c098, | ||
| 61 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
| 62 | .mid_rid = 0xb1, | ||
| 63 | }, { | ||
| 64 | .slave_id = SHDMA_SLAVE_SIUA_RX, | ||
| 65 | .addr = 0xa454c090, | ||
| 66 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
| 67 | .mid_rid = 0xb2, | ||
| 68 | }, { | ||
| 69 | .slave_id = SHDMA_SLAVE_SIUB_TX, | ||
| 70 | .addr = 0xa454c09c, | ||
| 71 | .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
| 72 | .mid_rid = 0xb5, | ||
| 73 | }, { | ||
| 74 | .slave_id = SHDMA_SLAVE_SIUB_RX, | ||
| 75 | .addr = 0xa454c094, | ||
| 76 | .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), | ||
| 77 | .mid_rid = 0xb6, | ||
| 78 | }, | ||
| 79 | }; | ||
| 80 | |||
| 81 | static struct sh_dmae_channel sh7722_dmae_channels[] = { | ||
| 82 | { | ||
| 83 | .offset = 0, | ||
| 84 | .dmars = 0, | ||
| 85 | .dmars_bit = 0, | ||
| 86 | }, { | ||
| 87 | .offset = 0x10, | ||
| 88 | .dmars = 0, | ||
| 89 | .dmars_bit = 8, | ||
| 90 | }, { | ||
| 91 | .offset = 0x20, | ||
| 92 | .dmars = 4, | ||
| 93 | .dmars_bit = 0, | ||
| 94 | }, { | ||
| 95 | .offset = 0x30, | ||
| 96 | .dmars = 4, | ||
| 97 | .dmars_bit = 8, | ||
| 98 | }, { | ||
| 99 | .offset = 0x50, | ||
| 100 | .dmars = 8, | ||
| 101 | .dmars_bit = 0, | ||
| 102 | }, { | ||
| 103 | .offset = 0x60, | ||
| 104 | .dmars = 8, | ||
| 105 | .dmars_bit = 8, | ||
| 106 | } | ||
| 107 | }; | ||
| 108 | |||
| 109 | static unsigned int ts_shift[] = TS_SHIFT; | ||
| 110 | |||
| 111 | static struct sh_dmae_pdata dma_platform_data = { | ||
| 112 | .slave = sh7722_dmae_slaves, | ||
| 113 | .slave_num = ARRAY_SIZE(sh7722_dmae_slaves), | ||
| 114 | .channel = sh7722_dmae_channels, | ||
| 115 | .channel_num = ARRAY_SIZE(sh7722_dmae_channels), | ||
| 116 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
| 117 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
| 118 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
| 119 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
| 120 | .ts_shift = ts_shift, | ||
| 121 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
| 122 | .dmaor_init = DMAOR_INIT, | ||
| 123 | }; | ||
| 124 | |||
| 125 | static struct resource sh7722_dmae_resources[] = { | ||
| 126 | [0] = { | ||
| 127 | /* Channel registers and DMAOR */ | ||
| 128 | .start = 0xfe008020, | ||
| 129 | .end = 0xfe00808f, | ||
| 130 | .flags = IORESOURCE_MEM, | ||
| 131 | }, | ||
| 132 | [1] = { | ||
| 133 | /* DMARSx */ | ||
| 134 | .start = 0xfe009000, | ||
| 135 | .end = 0xfe00900b, | ||
| 136 | .flags = IORESOURCE_MEM, | ||
| 137 | }, | ||
| 138 | { | ||
| 139 | /* DMA error IRQ */ | ||
| 140 | .start = 78, | ||
| 141 | .end = 78, | ||
| 142 | .flags = IORESOURCE_IRQ, | ||
| 143 | }, | ||
| 144 | { | ||
| 145 | /* IRQ for channels 0-3 */ | ||
| 146 | .start = 48, | ||
| 147 | .end = 51, | ||
| 148 | .flags = IORESOURCE_IRQ, | ||
| 149 | }, | ||
| 150 | { | ||
| 151 | /* IRQ for channels 4-5 */ | ||
| 152 | .start = 76, | ||
| 153 | .end = 77, | ||
| 154 | .flags = IORESOURCE_IRQ, | ||
| 155 | }, | ||
| 156 | }; | ||
| 157 | |||
| 158 | struct platform_device dma_device = { | ||
| 159 | .name = "sh-dma-engine", | ||
| 160 | .id = -1, | ||
| 161 | .resource = sh7722_dmae_resources, | ||
| 162 | .num_resources = ARRAY_SIZE(sh7722_dmae_resources), | ||
| 163 | .dev = { | ||
| 164 | .platform_data = &dma_platform_data, | ||
| 165 | }, | ||
| 166 | .archdata = { | ||
| 167 | .hwblk_id = HWBLK_DMAC, | ||
| 168 | }, | ||
| 169 | }; | ||
| 170 | |||
| 23 | /* Serial */ | 171 | /* Serial */ |
| 24 | static struct plat_sci_port scif0_platform_data = { | 172 | static struct plat_sci_port scif0_platform_data = { |
| 25 | .mapbase = 0xffe00000, | 173 | .mapbase = 0xffe00000, |
| @@ -388,15 +536,36 @@ static struct platform_device tmu2_device = { | |||
| 388 | }, | 536 | }, |
| 389 | }; | 537 | }; |
| 390 | 538 | ||
| 391 | static struct sh_dmae_pdata dma_platform_data = { | 539 | static struct siu_platform siu_platform_data = { |
| 392 | .mode = 0, | 540 | .dma_dev = &dma_device.dev, |
| 541 | .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX, | ||
| 542 | .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX, | ||
| 543 | .dma_slave_tx_b = SHDMA_SLAVE_SIUB_TX, | ||
| 544 | .dma_slave_rx_b = SHDMA_SLAVE_SIUB_RX, | ||
| 393 | }; | 545 | }; |
| 394 | 546 | ||
| 395 | static struct platform_device dma_device = { | 547 | static struct resource siu_resources[] = { |
| 396 | .name = "sh-dma-engine", | 548 | [0] = { |
| 549 | .start = 0xa4540000, | ||
| 550 | .end = 0xa454c10f, | ||
| 551 | .flags = IORESOURCE_MEM, | ||
| 552 | }, | ||
| 553 | [1] = { | ||
| 554 | .start = 108, | ||
| 555 | .flags = IORESOURCE_IRQ, | ||
| 556 | }, | ||
| 557 | }; | ||
| 558 | |||
| 559 | static struct platform_device siu_device = { | ||
| 560 | .name = "sh_siu", | ||
| 397 | .id = -1, | 561 | .id = -1, |
| 398 | .dev = { | 562 | .dev = { |
| 399 | .platform_data = &dma_platform_data, | 563 | .platform_data = &siu_platform_data, |
| 564 | }, | ||
| 565 | .resource = siu_resources, | ||
| 566 | .num_resources = ARRAY_SIZE(siu_resources), | ||
| 567 | .archdata = { | ||
| 568 | .hwblk_id = HWBLK_SIU, | ||
| 400 | }, | 569 | }, |
| 401 | }; | 570 | }; |
| 402 | 571 | ||
| @@ -414,6 +583,7 @@ static struct platform_device *sh7722_devices[] __initdata = { | |||
| 414 | &vpu_device, | 583 | &vpu_device, |
| 415 | &veu_device, | 584 | &veu_device, |
| 416 | &jpu_device, | 585 | &jpu_device, |
| 586 | &siu_device, | ||
| 417 | &dma_device, | 587 | &dma_device, |
| 418 | }; | 588 | }; |
| 419 | 589 | ||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 31e3451f7e3..e7fa2a92fc1 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c | |||
| @@ -21,22 +21,189 @@ | |||
| 21 | #include <linux/sh_timer.h> | 21 | #include <linux/sh_timer.h> |
| 22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
| 23 | #include <linux/notifier.h> | 23 | #include <linux/notifier.h> |
| 24 | |||
| 24 | #include <asm/suspend.h> | 25 | #include <asm/suspend.h> |
| 25 | #include <asm/clock.h> | 26 | #include <asm/clock.h> |
| 26 | #include <asm/dma-sh.h> | 27 | #include <asm/dmaengine.h> |
| 27 | #include <asm/mmzone.h> | 28 | #include <asm/mmzone.h> |
| 29 | |||
| 30 | #include <cpu/dma-register.h> | ||
| 28 | #include <cpu/sh7724.h> | 31 | #include <cpu/sh7724.h> |
| 29 | 32 | ||
| 30 | /* DMA */ | 33 | /* DMA */ |
| 31 | static struct sh_dmae_pdata dma_platform_data = { | 34 | static struct sh_dmae_channel sh7724_dmae0_channels[] = { |
| 32 | .mode = SHDMA_DMAOR1, | 35 | { |
| 36 | .offset = 0, | ||
| 37 | .dmars = 0, | ||
| 38 | .dmars_bit = 0, | ||
| 39 | }, { | ||
| 40 | .offset = 0x10, | ||
| 41 | .dmars = 0, | ||
| 42 | .dmars_bit = 8, | ||
| 43 | }, { | ||
| 44 | .offset = 0x20, | ||
| 45 | .dmars = 4, | ||
| 46 | .dmars_bit = 0, | ||
| 47 | }, { | ||
| 48 | .offset = 0x30, | ||
| 49 | .dmars = 4, | ||
| 50 | .dmars_bit = 8, | ||
| 51 | }, { | ||
| 52 | .offset = 0x50, | ||
| 53 | .dmars = 8, | ||
| 54 | .dmars_bit = 0, | ||
| 55 | }, { | ||
| 56 | .offset = 0x60, | ||
| 57 | .dmars = 8, | ||
| 58 | .dmars_bit = 8, | ||
| 59 | } | ||
| 60 | }; | ||
| 61 | |||
| 62 | static struct sh_dmae_channel sh7724_dmae1_channels[] = { | ||
| 63 | { | ||
| 64 | .offset = 0, | ||
| 65 | .dmars = 0, | ||
| 66 | .dmars_bit = 0, | ||
| 67 | }, { | ||
| 68 | .offset = 0x10, | ||
| 69 | .dmars = 0, | ||
| 70 | .dmars_bit = 8, | ||
| 71 | }, { | ||
| 72 | .offset = 0x20, | ||
| 73 | .dmars = 4, | ||
| 74 | .dmars_bit = 0, | ||
| 75 | }, { | ||
| 76 | .offset = 0x30, | ||
| 77 | .dmars = 4, | ||
| 78 | .dmars_bit = 8, | ||
| 79 | }, { | ||
| 80 | .offset = 0x50, | ||
| 81 | .dmars = 8, | ||
| 82 | .dmars_bit = 0, | ||
| 83 | }, { | ||
| 84 | .offset = 0x60, | ||
| 85 | .dmars = 8, | ||
| 86 | .dmars_bit = 8, | ||
| 87 | } | ||
| 88 | }; | ||
| 89 | |||
| 90 | static unsigned int ts_shift[] = TS_SHIFT; | ||
| 91 | |||
| 92 | static struct sh_dmae_pdata dma0_platform_data = { | ||
| 93 | .channel = sh7724_dmae0_channels, | ||
| 94 | .channel_num = ARRAY_SIZE(sh7724_dmae0_channels), | ||
| 95 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
| 96 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
| 97 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
| 98 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
| 99 | .ts_shift = ts_shift, | ||
| 100 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
| 101 | .dmaor_init = DMAOR_INIT, | ||
| 102 | }; | ||
| 103 | |||
| 104 | static struct sh_dmae_pdata dma1_platform_data = { | ||
| 105 | .channel = sh7724_dmae1_channels, | ||
| 106 | .channel_num = ARRAY_SIZE(sh7724_dmae1_channels), | ||
| 107 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
| 108 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
| 109 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
| 110 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
| 111 | .ts_shift = ts_shift, | ||
| 112 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
| 113 | .dmaor_init = DMAOR_INIT, | ||
| 114 | }; | ||
| 115 | |||
| 116 | /* Resource order important! */ | ||
| 117 | static struct resource sh7724_dmae0_resources[] = { | ||
| 118 | { | ||
| 119 | /* Channel registers and DMAOR */ | ||
| 120 | .start = 0xfe008020, | ||
| 121 | .end = 0xfe00808f, | ||
| 122 | .flags = IORESOURCE_MEM, | ||
| 123 | }, | ||
| 124 | { | ||
| 125 | /* DMARSx */ | ||
| 126 | .start = 0xfe009000, | ||
| 127 | .end = 0xfe00900b, | ||
| 128 | .flags = IORESOURCE_MEM, | ||
| 129 | }, | ||
| 130 | { | ||
| 131 | /* DMA error IRQ */ | ||
| 132 | .start = 78, | ||
| 133 | .end = 78, | ||
| 134 | .flags = IORESOURCE_IRQ, | ||
| 135 | }, | ||
| 136 | { | ||
| 137 | /* IRQ for channels 0-3 */ | ||
| 138 | .start = 48, | ||
| 139 | .end = 51, | ||
| 140 | .flags = IORESOURCE_IRQ, | ||
| 141 | }, | ||
| 142 | { | ||
| 143 | /* IRQ for channels 4-5 */ | ||
| 144 | .start = 76, | ||
| 145 | .end = 77, | ||
| 146 | .flags = IORESOURCE_IRQ, | ||
| 147 | }, | ||
| 33 | }; | 148 | }; |
| 34 | 149 | ||
| 35 | static struct platform_device dma_device = { | 150 | /* Resource order important! */ |
| 36 | .name = "sh-dma-engine", | 151 | static struct resource sh7724_dmae1_resources[] = { |
| 37 | .id = -1, | 152 | { |
| 38 | .dev = { | 153 | /* Channel registers and DMAOR */ |
| 39 | .platform_data = &dma_platform_data, | 154 | .start = 0xfdc08020, |
| 155 | .end = 0xfdc0808f, | ||
| 156 | .flags = IORESOURCE_MEM, | ||
| 157 | }, | ||
| 158 | { | ||
| 159 | /* DMARSx */ | ||
| 160 | .start = 0xfdc09000, | ||
| 161 | .end = 0xfdc0900b, | ||
| 162 | .flags = IORESOURCE_MEM, | ||
| 163 | }, | ||
| 164 | { | ||
| 165 | /* DMA error IRQ */ | ||
| 166 | .start = 74, | ||
| 167 | .end = 74, | ||
| 168 | .flags = IORESOURCE_IRQ, | ||
| 169 | }, | ||
| 170 | { | ||
| 171 | /* IRQ for channels 0-3 */ | ||
| 172 | .start = 40, | ||
| 173 | .end = 43, | ||
| 174 | .flags = IORESOURCE_IRQ, | ||
| 175 | }, | ||
| 176 | { | ||
| 177 | /* IRQ for channels 4-5 */ | ||
| 178 | .start = 72, | ||
| 179 | .end = 73, | ||
| 180 | .flags = IORESOURCE_IRQ, | ||
| 181 | }, | ||
| 182 | }; | ||
| 183 | |||
| 184 | static struct platform_device dma0_device = { | ||
| 185 | .name = "sh-dma-engine", | ||
| 186 | .id = 0, | ||
| 187 | .resource = sh7724_dmae0_resources, | ||
| 188 | .num_resources = ARRAY_SIZE(sh7724_dmae0_resources), | ||
| 189 | .dev = { | ||
| 190 | .platform_data = &dma0_platform_data, | ||
| 191 | }, | ||
| 192 | .archdata = { | ||
| 193 | .hwblk_id = HWBLK_DMAC0, | ||
| 194 | }, | ||
| 195 | }; | ||
| 196 | |||
| 197 | static struct platform_device dma1_device = { | ||
| 198 | .name = "sh-dma-engine", | ||
| 199 | .id = 1, | ||
| 200 | .resource = sh7724_dmae1_resources, | ||
| 201 | .num_resources = ARRAY_SIZE(sh7724_dmae1_resources), | ||
| 202 | .dev = { | ||
| 203 | .platform_data = &dma1_platform_data, | ||
| 204 | }, | ||
| 205 | .archdata = { | ||
| 206 | .hwblk_id = HWBLK_DMAC1, | ||
| 40 | }, | 207 | }, |
| 41 | }; | 208 | }; |
| 42 | 209 | ||
| @@ -663,7 +830,8 @@ static struct platform_device *sh7724_devices[] __initdata = { | |||
| 663 | &tmu3_device, | 830 | &tmu3_device, |
| 664 | &tmu4_device, | 831 | &tmu4_device, |
| 665 | &tmu5_device, | 832 | &tmu5_device, |
| 666 | &dma_device, | 833 | &dma0_device, |
| 834 | &dma1_device, | ||
| 667 | &rtc_device, | 835 | &rtc_device, |
| 668 | &iic0_device, | 836 | &iic0_device, |
| 669 | &iic1_device, | 837 | &iic1_device, |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c index f8f21618d78..02e792c90de 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c | |||
| @@ -13,7 +13,10 @@ | |||
| 13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
| 14 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
| 15 | #include <linux/sh_timer.h> | 15 | #include <linux/sh_timer.h> |
| 16 | #include <asm/dma-sh.h> | 16 | |
| 17 | #include <asm/dmaengine.h> | ||
| 18 | |||
| 19 | #include <cpu/dma-register.h> | ||
| 17 | 20 | ||
| 18 | static struct plat_sci_port scif0_platform_data = { | 21 | static struct plat_sci_port scif0_platform_data = { |
| 19 | .mapbase = 0xffe00000, | 22 | .mapbase = 0xffe00000, |
| @@ -247,15 +250,131 @@ static struct platform_device rtc_device = { | |||
| 247 | .resource = rtc_resources, | 250 | .resource = rtc_resources, |
| 248 | }; | 251 | }; |
| 249 | 252 | ||
| 250 | static struct sh_dmae_pdata dma_platform_data = { | 253 | /* DMA */ |
| 251 | .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1), | 254 | static struct sh_dmae_channel sh7780_dmae0_channels[] = { |
| 255 | { | ||
| 256 | .offset = 0, | ||
| 257 | .dmars = 0, | ||
| 258 | .dmars_bit = 0, | ||
| 259 | }, { | ||
| 260 | .offset = 0x10, | ||
| 261 | .dmars = 0, | ||
| 262 | .dmars_bit = 8, | ||
| 263 | }, { | ||
| 264 | .offset = 0x20, | ||
| 265 | .dmars = 4, | ||
| 266 | .dmars_bit = 0, | ||
| 267 | }, { | ||
| 268 | .offset = 0x30, | ||
| 269 | .dmars = 4, | ||
| 270 | .dmars_bit = 8, | ||
| 271 | }, { | ||
| 272 | .offset = 0x50, | ||
| 273 | .dmars = 8, | ||
| 274 | .dmars_bit = 0, | ||
| 275 | }, { | ||
| 276 | .offset = 0x60, | ||
| 277 | .dmars = 8, | ||
| 278 | .dmars_bit = 8, | ||
| 279 | } | ||
| 280 | }; | ||
| 281 | |||
| 282 | static struct sh_dmae_channel sh7780_dmae1_channels[] = { | ||
| 283 | { | ||
| 284 | .offset = 0, | ||
| 285 | }, { | ||
| 286 | .offset = 0x10, | ||
| 287 | }, { | ||
| 288 | .offset = 0x20, | ||
| 289 | }, { | ||
| 290 | .offset = 0x30, | ||
| 291 | }, { | ||
| 292 | .offset = 0x50, | ||
| 293 | }, { | ||
| 294 | .offset = 0x60, | ||
| 295 | } | ||
| 296 | }; | ||
| 297 | |||
| 298 | static unsigned int ts_shift[] = TS_SHIFT; | ||
| 299 | |||
| 300 | static struct sh_dmae_pdata dma0_platform_data = { | ||
| 301 | .channel = sh7780_dmae0_channels, | ||
| 302 | .channel_num = ARRAY_SIZE(sh7780_dmae0_channels), | ||
| 303 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
| 304 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
| 305 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
| 306 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
| 307 | .ts_shift = ts_shift, | ||
| 308 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
| 309 | .dmaor_init = DMAOR_INIT, | ||
| 310 | }; | ||
| 311 | |||
| 312 | static struct sh_dmae_pdata dma1_platform_data = { | ||
| 313 | .channel = sh7780_dmae1_channels, | ||
| 314 | .channel_num = ARRAY_SIZE(sh7780_dmae1_channels), | ||
| 315 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
| 316 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
| 317 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
| 318 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
| 319 | .ts_shift = ts_shift, | ||
| 320 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
| 321 | .dmaor_init = DMAOR_INIT, | ||
| 252 | }; | 322 | }; |
| 253 | 323 | ||
| 254 | static struct platform_device dma_device = { | 324 | static struct resource sh7780_dmae0_resources[] = { |
| 325 | [0] = { | ||
| 326 | /* Channel registers and DMAOR */ | ||
| 327 | .start = 0xfc808020, | ||
| 328 | .end = 0xfc80808f, | ||
| 329 | .flags = IORESOURCE_MEM, | ||
| 330 | }, | ||
| 331 | [1] = { | ||
| 332 | /* DMARSx */ | ||
| 333 | .start = 0xfc809000, | ||
| 334 | .end = 0xfc80900b, | ||
| 335 | .flags = IORESOURCE_MEM, | ||
| 336 | }, | ||
| 337 | { | ||
| 338 | /* Real DMA error IRQ is 38, and channel IRQs are 34-37, 44-45 */ | ||
| 339 | .start = 34, | ||
| 340 | .end = 34, | ||
| 341 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
| 342 | }, | ||
| 343 | }; | ||
| 344 | |||
| 345 | static struct resource sh7780_dmae1_resources[] = { | ||
| 346 | [0] = { | ||
| 347 | /* Channel registers and DMAOR */ | ||
| 348 | .start = 0xfc818020, | ||
| 349 | .end = 0xfc81808f, | ||
| 350 | .flags = IORESOURCE_MEM, | ||
| 351 | }, | ||
| 352 | /* DMAC1 has no DMARS */ | ||
| 353 | { | ||
| 354 | /* Real DMA error IRQ is 38, and channel IRQs are 46-47, 92-95 */ | ||
| 355 | .start = 46, | ||
| 356 | .end = 46, | ||
| 357 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
| 358 | }, | ||
| 359 | }; | ||
| 360 | |||
| 361 | static struct platform_device dma0_device = { | ||
| 255 | .name = "sh-dma-engine", | 362 | .name = "sh-dma-engine", |
| 256 | .id = -1, | 363 | .id = 0, |
| 364 | .resource = sh7780_dmae0_resources, | ||
| 365 | .num_resources = ARRAY_SIZE(sh7780_dmae0_resources), | ||
| 257 | .dev = { | 366 | .dev = { |
| 258 | .platform_data = &dma_platform_data, | 367 | .platform_data = &dma0_platform_data, |
| 368 | }, | ||
| 369 | }; | ||
| 370 | |||
| 371 | static struct platform_device dma1_device = { | ||
| 372 | .name = "sh-dma-engine", | ||
| 373 | .id = 1, | ||
| 374 | .resource = sh7780_dmae1_resources, | ||
| 375 | .num_resources = ARRAY_SIZE(sh7780_dmae1_resources), | ||
| 376 | .dev = { | ||
| 377 | .platform_data = &dma1_platform_data, | ||
| 259 | }, | 378 | }, |
| 260 | }; | 379 | }; |
| 261 | 380 | ||
| @@ -269,7 +388,8 @@ static struct platform_device *sh7780_devices[] __initdata = { | |||
| 269 | &tmu4_device, | 388 | &tmu4_device, |
| 270 | &tmu5_device, | 389 | &tmu5_device, |
| 271 | &rtc_device, | 390 | &rtc_device, |
| 272 | &dma_device, | 391 | &dma0_device, |
| 392 | &dma1_device, | ||
| 273 | }; | 393 | }; |
| 274 | 394 | ||
| 275 | static int __init sh7780_devices_setup(void) | 395 | static int __init sh7780_devices_setup(void) |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 23448d8c671..1fcd88b1671 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c | |||
| @@ -14,9 +14,12 @@ | |||
| 14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
| 16 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
| 17 | #include <asm/dma-sh.h> | 17 | |
| 18 | #include <asm/dmaengine.h> | ||
| 18 | #include <asm/mmzone.h> | 19 | #include <asm/mmzone.h> |
| 19 | 20 | ||
| 21 | #include <cpu/dma-register.h> | ||
| 22 | |||
| 20 | static struct plat_sci_port scif0_platform_data = { | 23 | static struct plat_sci_port scif0_platform_data = { |
| 21 | .mapbase = 0xffea0000, | 24 | .mapbase = 0xffea0000, |
| 22 | .flags = UPF_BOOT_AUTOCONF, | 25 | .flags = UPF_BOOT_AUTOCONF, |
| @@ -295,15 +298,131 @@ static struct platform_device tmu5_device = { | |||
| 295 | .num_resources = ARRAY_SIZE(tmu5_resources), | 298 | .num_resources = ARRAY_SIZE(tmu5_resources), |
| 296 | }; | 299 | }; |
| 297 | 300 | ||
| 298 | static struct sh_dmae_pdata dma_platform_data = { | 301 | /* DMA */ |
| 299 | .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1), | 302 | static struct sh_dmae_channel sh7785_dmae0_channels[] = { |
| 303 | { | ||
| 304 | .offset = 0, | ||
| 305 | .dmars = 0, | ||
| 306 | .dmars_bit = 0, | ||
| 307 | }, { | ||
| 308 | .offset = 0x10, | ||
| 309 | .dmars = 0, | ||
| 310 | .dmars_bit = 8, | ||
| 311 | }, { | ||
| 312 | .offset = 0x20, | ||
| 313 | .dmars = 4, | ||
| 314 | .dmars_bit = 0, | ||
| 315 | }, { | ||
| 316 | .offset = 0x30, | ||
| 317 | .dmars = 4, | ||
| 318 | .dmars_bit = 8, | ||
| 319 | }, { | ||
| 320 | .offset = 0x50, | ||
| 321 | .dmars = 8, | ||
| 322 | .dmars_bit = 0, | ||
| 323 | }, { | ||
| 324 | .offset = 0x60, | ||
| 325 | .dmars = 8, | ||
| 326 | .dmars_bit = 8, | ||
| 327 | } | ||
| 328 | }; | ||
| 329 | |||
| 330 | static struct sh_dmae_channel sh7785_dmae1_channels[] = { | ||
| 331 | { | ||
| 332 | .offset = 0, | ||
| 333 | }, { | ||
| 334 | .offset = 0x10, | ||
| 335 | }, { | ||
| 336 | .offset = 0x20, | ||
| 337 | }, { | ||
| 338 | .offset = 0x30, | ||
| 339 | }, { | ||
| 340 | .offset = 0x50, | ||
| 341 | }, { | ||
| 342 | .offset = 0x60, | ||
| 343 | } | ||
| 344 | }; | ||
| 345 | |||
| 346 | static unsigned int ts_shift[] = TS_SHIFT; | ||
| 347 | |||
| 348 | static struct sh_dmae_pdata dma0_platform_data = { | ||
| 349 | .channel = sh7785_dmae0_channels, | ||
| 350 | .channel_num = ARRAY_SIZE(sh7785_dmae0_channels), | ||
| 351 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
| 352 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
| 353 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
| 354 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
| 355 | .ts_shift = ts_shift, | ||
| 356 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
| 357 | .dmaor_init = DMAOR_INIT, | ||
| 358 | }; | ||
| 359 | |||
| 360 | static struct sh_dmae_pdata dma1_platform_data = { | ||
| 361 | .channel = sh7785_dmae1_channels, | ||
| 362 | .channel_num = ARRAY_SIZE(sh7785_dmae1_channels), | ||
| 363 | .ts_low_shift = CHCR_TS_LOW_SHIFT, | ||
| 364 | .ts_low_mask = CHCR_TS_LOW_MASK, | ||
| 365 | .ts_high_shift = CHCR_TS_HIGH_SHIFT, | ||
| 366 | .ts_high_mask = CHCR_TS_HIGH_MASK, | ||
| 367 | .ts_shift = ts_shift, | ||
| 368 | .ts_shift_num = ARRAY_SIZE(ts_shift), | ||
| 369 | .dmaor_init = DMAOR_INIT, | ||
| 300 | }; | 370 | }; |
| 301 | 371 | ||
| 302 | static struct platform_device dma_device = { | 372 | static struct resource sh7785_dmae0_resources[] = { |
| 373 | [0] = { | ||
| 374 | /* Channel registers and DMAOR */ | ||
| 375 | .start = 0xfc808020, | ||
| 376 | .end = 0xfc80808f, | ||
| 377 | .flags = IORESOURCE_MEM, | ||
| 378 | }, | ||
| 379 | [1] = { | ||
| 380 | /* DMARSx */ | ||
| 381 | .start = 0xfc809000, | ||
| 382 | .end = 0xfc80900b, | ||
| 383 | .flags = IORESOURCE_MEM, | ||
| 384 | }, | ||
| 385 | { | ||
| 386 | /* Real DMA error IRQ is 39, and channel IRQs are 33-38 */ | ||
| 387 | .start = 33, | ||
| 388 | .end = 33, | ||
| 389 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
| 390 | }, | ||
| 391 | }; | ||
| 392 | |||
| 393 | static struct resource sh7785_dmae1_resources[] = { | ||
| 394 | [0] = { | ||
| 395 | /* Channel registers and DMAOR */ | ||
| 396 | .start = 0xfcc08020, | ||
| 397 | .end = 0xfcc0808f, | ||
| 398 | .flags = IORESOURCE_MEM, | ||
| 399 | }, | ||
| 400 | /* DMAC1 has no DMARS */ | ||
| 401 | { | ||
| 402 | /* Real DMA error IRQ is 58, and channel IRQs are 52-57 */ | ||
| 403 | .start = 52, | ||
| 404 | .end = 52, | ||
| 405 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE, | ||
| 406 | }, | ||
| 407 | }; | ||
| 408 | |||
| 409 | static struct platform_device dma0_device = { | ||
| 303 | .name = "sh-dma-engine", | 410 | .name = "sh-dma-engine", |
| 304 | .id = -1, | 411 | .id = 0, |
| 412 | .resource = sh7785_dmae0_resources, | ||
| 413 | .num_resources = ARRAY_SIZE(sh7785_dmae0_resources), | ||
| 305 | .dev = { | 414 | .dev = { |
| 306 | .platform_data = &dma_platform_data, | 415 | .platform_data = &dma0_platform_data, |
| 416 | }, | ||
| 417 | }; | ||
| 418 | |||
| 419 | static struct platform_device dma1_device = { | ||
| 420 | .name = "sh-dma-engine", | ||
| 421 | .id = 1, | ||
| 422 | .resource = sh7785_dmae1_resources, | ||
| 423 | .num_resources = ARRAY_SIZE(sh7785_dmae1_resources), | ||
| 424 | .dev = { | ||
| 425 | .platform_data = &dma1_platform_data, | ||
| 307 | }, | 426 | }, |
| 308 | }; | 427 | }; |
| 309 | 428 | ||
| @@ -320,7 +439,8 @@ static struct platform_device *sh7785_devices[] __initdata = { | |||
| 320 | &tmu3_device, | 439 | &tmu3_device, |
| 321 | &tmu4_device, | 440 | &tmu4_device, |
| 322 | &tmu5_device, | 441 | &tmu5_device, |
| 323 | &dma_device, | 442 | &dma0_device, |
| 443 | &dma1_device, | ||
| 324 | }; | 444 | }; |
| 325 | 445 | ||
| 326 | static int __init sh7785_devices_setup(void) | 446 | static int __init sh7785_devices_setup(void) |
diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c index e2f1753d275..675eea7785d 100644 --- a/arch/sh/kernel/hw_breakpoint.c +++ b/arch/sh/kernel/hw_breakpoint.c | |||
| @@ -143,26 +143,6 @@ static int arch_check_va_in_kernelspace(unsigned long va, u8 hbp_len) | |||
| 143 | return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); | 143 | return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | /* | ||
| 147 | * Store a breakpoint's encoded address, length, and type. | ||
| 148 | */ | ||
| 149 | static int arch_store_info(struct perf_event *bp) | ||
| 150 | { | ||
| 151 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); | ||
| 152 | |||
| 153 | /* | ||
| 154 | * User-space requests will always have the address field populated | ||
| 155 | * For kernel-addresses, either the address or symbol name can be | ||
| 156 | * specified. | ||
| 157 | */ | ||
| 158 | if (info->name) | ||
| 159 | info->address = (unsigned long)kallsyms_lookup_name(info->name); | ||
| 160 | if (info->address) | ||
| 161 | return 0; | ||
| 162 | |||
| 163 | return -EINVAL; | ||
| 164 | } | ||
| 165 | |||
| 166 | int arch_bp_generic_fields(int sh_len, int sh_type, | 146 | int arch_bp_generic_fields(int sh_len, int sh_type, |
| 167 | int *gen_len, int *gen_type) | 147 | int *gen_len, int *gen_type) |
| 168 | { | 148 | { |
| @@ -276,10 +256,12 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp, | |||
| 276 | return ret; | 256 | return ret; |
| 277 | } | 257 | } |
| 278 | 258 | ||
| 279 | ret = arch_store_info(bp); | 259 | /* |
| 280 | 260 | * For kernel-addresses, either the address or symbol name can be | |
| 281 | if (ret < 0) | 261 | * specified. |
| 282 | return ret; | 262 | */ |
| 263 | if (info->name) | ||
| 264 | info->address = (unsigned long)kallsyms_lookup_name(info->name); | ||
| 283 | 265 | ||
| 284 | /* | 266 | /* |
| 285 | * Check that the low-order bits of the address are appropriate | 267 | * Check that the low-order bits of the address are appropriate |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 3459e70eed7..8870d6ba64b 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
| @@ -443,7 +443,7 @@ void __init setup_arch(char **cmdline_p) | |||
| 443 | 443 | ||
| 444 | nodes_clear(node_online_map); | 444 | nodes_clear(node_online_map); |
| 445 | 445 | ||
| 446 | /* Setup bootmem with available RAM */ | 446 | pmb_init(); |
| 447 | lmb_init(); | 447 | lmb_init(); |
| 448 | setup_memory(); | 448 | setup_memory(); |
| 449 | sparse_init(); | 449 | sparse_init(); |
| @@ -452,7 +452,6 @@ void __init setup_arch(char **cmdline_p) | |||
| 452 | conswitchp = &dummy_con; | 452 | conswitchp = &dummy_con; |
| 453 | #endif | 453 | #endif |
| 454 | paging_init(); | 454 | paging_init(); |
| 455 | pmb_init(); | ||
| 456 | 455 | ||
| 457 | ioremap_fixed_init(); | 456 | ioremap_fixed_init(); |
| 458 | 457 | ||
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 953fa161331..8a0072de2bc 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
| @@ -39,12 +39,12 @@ static int null_rtc_set_time(const time_t secs) | |||
| 39 | void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; | 39 | void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; |
| 40 | int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; | 40 | int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; |
| 41 | 41 | ||
| 42 | #ifdef CONFIG_GENERIC_CMOS_UPDATE | ||
| 43 | void read_persistent_clock(struct timespec *ts) | 42 | void read_persistent_clock(struct timespec *ts) |
| 44 | { | 43 | { |
| 45 | rtc_sh_get_time(ts); | 44 | rtc_sh_get_time(ts); |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 47 | #ifdef CONFIG_GENERIC_CMOS_UPDATE | ||
| 48 | int update_persistent_clock(struct timespec now) | 48 | int update_persistent_clock(struct timespec now) |
| 49 | { | 49 | { |
| 50 | return rtc_sh_set_time(now.tv_sec); | 50 | return rtc_sh_set_time(now.tv_sec); |
| @@ -113,9 +113,5 @@ void __init time_init(void) | |||
| 113 | hwblk_init(); | 113 | hwblk_init(); |
| 114 | clk_init(); | 114 | clk_init(); |
| 115 | 115 | ||
| 116 | rtc_sh_get_time(&xtime); | ||
| 117 | set_normalized_timespec(&wall_to_monotonic, | ||
| 118 | -xtime.tv_sec, -xtime.tv_nsec); | ||
| 119 | |||
| 120 | late_time_init = sh_late_time_init; | 116 | late_time_init = sh_late_time_init; |
| 121 | } | 117 | } |
