diff options
| author | Brian Swetland <swetland@google.com> | 2008-09-10 17:00:53 -0400 |
|---|---|---|
| committer | Brian Swetland <swetland@google.com> | 2008-10-22 05:40:59 -0400 |
| commit | bcc0f6af0798e60e7527485f7125ed26632ce698 (patch) | |
| tree | ac45678ea4131d7423f64025e8021106937dbf77 | |
| parent | b8a16e1fdfe9caed734df0e157ad74ae2b13e3bd (diff) | |
[ARM] msm: clean up iomap and devices
- Add some more peripherals (sdcc, etc) to the iomap.
- Remove virtual base addresses for devices that we should be passing
physical addresses to drivers via resources and ioremap()ing.
- don't try to use uarts for ll debug once the mmu is enabled due to
problems with the peripheral window
- make base addresses void __iomem * and fixup irq.c and timer.c
- Remove common.c and bring in devices.c/devices.h similar to
the PXA architecture.
Signed-off-by: Brian Swetland <swetland@google.com>
| -rw-r--r-- | arch/arm/mach-msm/Makefile | 4 | ||||
| -rw-r--r-- | arch/arm/mach-msm/board-halibut.c | 37 | ||||
| -rw-r--r-- | arch/arm/mach-msm/common.c | 116 | ||||
| -rw-r--r-- | arch/arm/mach-msm/devices.c | 267 | ||||
| -rw-r--r-- | arch/arm/mach-msm/devices.h | 36 | ||||
| -rw-r--r-- | arch/arm/mach-msm/include/mach/debug-macro.S | 8 | ||||
| -rw-r--r-- | arch/arm/mach-msm/include/mach/msm_iomap.h | 69 | ||||
| -rw-r--r-- | arch/arm/mach-msm/io.c | 12 | ||||
| -rw-r--r-- | arch/arm/mach-msm/irq.c | 10 | ||||
| -rw-r--r-- | arch/arm/mach-msm/timer.c | 2 |
10 files changed, 368 insertions, 193 deletions
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile index ae96ffff494..d4d1deabce4 100644 --- a/arch/arm/mach-msm/Makefile +++ b/arch/arm/mach-msm/Makefile | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | obj-y += io.o idle.o irq.o timer.o dma.o | 1 | obj-y += io.o idle.o irq.o timer.o dma.o |
| 2 | obj-y += devices.o | ||
| 2 | obj-y += proc_comm.o | 3 | obj-y += proc_comm.o |
| 3 | 4 | ||
| 4 | # Common code for board init | ||
| 5 | obj-y += common.o | ||
| 6 | |||
| 7 | obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o | 5 | obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o |
| 8 | 6 | ||
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c index a24259133e0..b263783dadb 100644 --- a/arch/arm/mach-msm/board-halibut.c +++ b/arch/arm/mach-msm/board-halibut.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <linux/mtd/nand.h> | 33 | #include <linux/mtd/nand.h> |
| 34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
| 35 | 35 | ||
| 36 | #include "devices.h" | ||
| 37 | |||
| 36 | static struct resource smc91x_resources[] = { | 38 | static struct resource smc91x_resources[] = { |
| 37 | [0] = { | 39 | [0] = { |
| 38 | .start = 0x9C004300, | 40 | .start = 0x9C004300, |
| @@ -53,31 +55,12 @@ static struct platform_device smc91x_device = { | |||
| 53 | .resource = smc91x_resources, | 55 | .resource = smc91x_resources, |
| 54 | }; | 56 | }; |
| 55 | 57 | ||
| 56 | static void mddi0_panel_power(int on) | ||
| 57 | { | ||
| 58 | } | ||
| 59 | |||
| 60 | static struct msm_mddi_platform_data msm_mddi0_pdata = { | ||
| 61 | .panel_power = mddi0_panel_power, | ||
| 62 | .has_vsync_irq = 0, | ||
| 63 | }; | ||
| 64 | |||
| 65 | static struct platform_device msm_mddi0_device = { | ||
| 66 | .name = "msm_mddi", | ||
| 67 | .id = 0, | ||
| 68 | .dev = { | ||
| 69 | .platform_data = &msm_mddi0_pdata | ||
| 70 | }, | ||
| 71 | }; | ||
| 72 | |||
| 73 | static struct platform_device msm_serial0_device = { | ||
| 74 | .name = "msm_serial", | ||
| 75 | .id = 0, | ||
| 76 | }; | ||
| 77 | |||
| 78 | static struct platform_device *devices[] __initdata = { | 58 | static struct platform_device *devices[] __initdata = { |
| 79 | &msm_serial0_device, | 59 | &msm_device_uart3, |
| 80 | &msm_mddi0_device, | 60 | &msm_device_smd, |
| 61 | &msm_device_nand, | ||
| 62 | &msm_device_hsusb, | ||
| 63 | &msm_device_i2c, | ||
| 81 | &smc91x_device, | 64 | &smc91x_device, |
| 82 | }; | 65 | }; |
| 83 | 66 | ||
| @@ -91,7 +74,6 @@ static void __init halibut_init_irq(void) | |||
| 91 | static void __init halibut_init(void) | 74 | static void __init halibut_init(void) |
| 92 | { | 75 | { |
| 93 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 76 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 94 | msm_add_devices(); | ||
| 95 | } | 77 | } |
| 96 | 78 | ||
| 97 | static void __init halibut_map_io(void) | 79 | static void __init halibut_map_io(void) |
| @@ -100,11 +82,6 @@ static void __init halibut_map_io(void) | |||
| 100 | } | 82 | } |
| 101 | 83 | ||
| 102 | MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)") | 84 | MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)") |
| 103 | |||
| 104 | /* UART for LL DEBUG */ | ||
| 105 | .phys_io = MSM_UART1_PHYS, | ||
| 106 | .io_pg_offst = ((MSM_UART1_BASE) >> 18) & 0xfffc, | ||
| 107 | |||
| 108 | .boot_params = 0x10000100, | 85 | .boot_params = 0x10000100, |
| 109 | .map_io = halibut_map_io, | 86 | .map_io = halibut_map_io, |
| 110 | .init_irq = halibut_init_irq, | 87 | .init_irq = halibut_init_irq, |
diff --git a/arch/arm/mach-msm/common.c b/arch/arm/mach-msm/common.c deleted file mode 100644 index 604f8ade958..00000000000 --- a/arch/arm/mach-msm/common.c +++ /dev/null | |||
| @@ -1,116 +0,0 @@ | |||
| 1 | /* linux/arch/arm/mach-msm/common.c | ||
| 2 | * | ||
| 3 | * Common setup code for MSM7K Boards | ||
| 4 | * | ||
| 5 | * Copyright (C) 2007 Google, Inc. | ||
| 6 | * Author: Brian Swetland <swetland@google.com> | ||
| 7 | * | ||
| 8 | * This software is licensed under the terms of the GNU General Public | ||
| 9 | * License version 2, as published by the Free Software Foundation, and | ||
| 10 | * may be copied, distributed, and modified under those terms. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <linux/kernel.h> | ||
| 20 | #include <linux/init.h> | ||
| 21 | #include <linux/platform_device.h> | ||
| 22 | #include <linux/io.h> | ||
| 23 | |||
| 24 | #include <asm/mach/flash.h> | ||
| 25 | |||
| 26 | #include <asm/setup.h> | ||
| 27 | |||
| 28 | #include <linux/mtd/nand.h> | ||
| 29 | #include <linux/mtd/partitions.h> | ||
| 30 | |||
| 31 | #include <mach/msm_iomap.h> | ||
| 32 | |||
| 33 | #include <mach/board.h> | ||
| 34 | |||
| 35 | struct flash_platform_data msm_nand_data = { | ||
| 36 | .parts = 0, | ||
| 37 | .nr_parts = 0, | ||
| 38 | }; | ||
| 39 | |||
| 40 | static struct resource msm_nand_resources[] = { | ||
| 41 | [0] = { | ||
| 42 | .start = 7, | ||
| 43 | .end = 7, | ||
| 44 | .flags = IORESOURCE_DMA, | ||
| 45 | }, | ||
| 46 | }; | ||
| 47 | |||
| 48 | static struct platform_device msm_nand_device = { | ||
| 49 | .name = "msm_nand", | ||
| 50 | .id = -1, | ||
| 51 | .num_resources = ARRAY_SIZE(msm_nand_resources), | ||
| 52 | .resource = msm_nand_resources, | ||
| 53 | .dev = { | ||
| 54 | .platform_data = &msm_nand_data, | ||
| 55 | }, | ||
| 56 | }; | ||
| 57 | |||
| 58 | static struct platform_device msm_smd_device = { | ||
| 59 | .name = "msm_smd", | ||
| 60 | .id = -1, | ||
| 61 | }; | ||
| 62 | |||
| 63 | static struct resource msm_i2c_resources[] = { | ||
| 64 | { | ||
| 65 | .start = MSM_I2C_BASE, | ||
| 66 | .end = MSM_I2C_BASE + MSM_I2C_SIZE - 1, | ||
| 67 | .flags = IORESOURCE_MEM, | ||
| 68 | }, | ||
| 69 | { | ||
| 70 | .start = INT_PWB_I2C, | ||
| 71 | .end = INT_PWB_I2C, | ||
| 72 | .flags = IORESOURCE_IRQ, | ||
| 73 | }, | ||
| 74 | }; | ||
| 75 | |||
| 76 | static struct platform_device msm_i2c_device = { | ||
| 77 | .name = "msm_i2c", | ||
| 78 | .id = 0, | ||
| 79 | .num_resources = ARRAY_SIZE(msm_i2c_resources), | ||
| 80 | .resource = msm_i2c_resources, | ||
| 81 | }; | ||
| 82 | |||
| 83 | static struct resource usb_resources[] = { | ||
| 84 | { | ||
| 85 | .start = MSM_HSUSB_PHYS, | ||
| 86 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
| 87 | .flags = IORESOURCE_MEM, | ||
| 88 | }, | ||
| 89 | { | ||
| 90 | .start = INT_USB_HS, | ||
| 91 | .end = INT_USB_HS, | ||
| 92 | .flags = IORESOURCE_IRQ, | ||
| 93 | }, | ||
| 94 | }; | ||
| 95 | |||
| 96 | static struct platform_device msm_hsusb_device = { | ||
| 97 | .name = "msm_hsusb", | ||
| 98 | .id = -1, | ||
| 99 | .num_resources = ARRAY_SIZE(usb_resources), | ||
| 100 | .resource = usb_resources, | ||
| 101 | .dev = { | ||
| 102 | .coherent_dma_mask = 0xffffffff, | ||
| 103 | }, | ||
| 104 | }; | ||
| 105 | |||
| 106 | static struct platform_device *devices[] __initdata = { | ||
| 107 | &msm_nand_device, | ||
| 108 | &msm_smd_device, | ||
| 109 | &msm_i2c_device, | ||
| 110 | &msm_hsusb_device, | ||
| 111 | }; | ||
| 112 | |||
| 113 | void __init msm_add_devices(void) | ||
| 114 | { | ||
| 115 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
| 116 | } | ||
diff --git a/arch/arm/mach-msm/devices.c b/arch/arm/mach-msm/devices.c new file mode 100644 index 00000000000..f2a74b92a97 --- /dev/null +++ b/arch/arm/mach-msm/devices.c | |||
| @@ -0,0 +1,267 @@ | |||
| 1 | /* linux/arch/arm/mach-msm/devices.c | ||
| 2 | * | ||
| 3 | * Copyright (C) 2008 Google, Inc. | ||
| 4 | * | ||
| 5 | * This software is licensed under the terms of the GNU General Public | ||
| 6 | * License version 2, as published by the Free Software Foundation, and | ||
| 7 | * may be copied, distributed, and modified under those terms. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include <linux/kernel.h> | ||
| 17 | #include <linux/platform_device.h> | ||
| 18 | |||
| 19 | #include <mach/msm_iomap.h> | ||
| 20 | #include "devices.h" | ||
| 21 | |||
| 22 | #include <asm/mach/flash.h> | ||
| 23 | #include <linux/mtd/nand.h> | ||
| 24 | #include <linux/mtd/partitions.h> | ||
| 25 | |||
| 26 | static struct resource resources_uart1[] = { | ||
| 27 | { | ||
| 28 | .start = INT_UART1, | ||
| 29 | .end = INT_UART1, | ||
| 30 | .flags = IORESOURCE_IRQ, | ||
| 31 | }, | ||
| 32 | { | ||
| 33 | .start = MSM_UART1_PHYS, | ||
| 34 | .end = MSM_UART1_PHYS + MSM_UART1_SIZE - 1, | ||
| 35 | .flags = IORESOURCE_MEM, | ||
| 36 | }, | ||
| 37 | }; | ||
| 38 | |||
| 39 | static struct resource resources_uart2[] = { | ||
| 40 | { | ||
| 41 | .start = INT_UART2, | ||
| 42 | .end = INT_UART2, | ||
| 43 | .flags = IORESOURCE_IRQ, | ||
| 44 | }, | ||
| 45 | { | ||
| 46 | .start = MSM_UART2_PHYS, | ||
| 47 | .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1, | ||
| 48 | .flags = IORESOURCE_MEM, | ||
| 49 | }, | ||
| 50 | }; | ||
| 51 | |||
| 52 | static struct resource resources_uart3[] = { | ||
| 53 | { | ||
| 54 | .start = INT_UART3, | ||
| 55 | .end = INT_UART3, | ||
| 56 | .flags = IORESOURCE_IRQ, | ||
| 57 | }, | ||
| 58 | { | ||
| 59 | .start = MSM_UART3_PHYS, | ||
| 60 | .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, | ||
| 61 | .flags = IORESOURCE_MEM, | ||
| 62 | }, | ||
| 63 | }; | ||
| 64 | |||
| 65 | struct platform_device msm_device_uart1 = { | ||
| 66 | .name = "msm_serial", | ||
| 67 | .id = 0, | ||
| 68 | .num_resources = ARRAY_SIZE(resources_uart1), | ||
| 69 | .resource = resources_uart1, | ||
| 70 | }; | ||
| 71 | |||
| 72 | struct platform_device msm_device_uart2 = { | ||
| 73 | .name = "msm_serial", | ||
| 74 | .id = 1, | ||
| 75 | .num_resources = ARRAY_SIZE(resources_uart2), | ||
| 76 | .resource = resources_uart2, | ||
| 77 | }; | ||
| 78 | |||
| 79 | struct platform_device msm_device_uart3 = { | ||
| 80 | .name = "msm_serial", | ||
| 81 | .id = 2, | ||
| 82 | .num_resources = ARRAY_SIZE(resources_uart3), | ||
| 83 | .resource = resources_uart3, | ||
| 84 | }; | ||
| 85 | |||
| 86 | static struct resource resources_i2c[] = { | ||
| 87 | { | ||
| 88 | .start = MSM_I2C_PHYS, | ||
| 89 | .end = MSM_I2C_PHYS + MSM_I2C_SIZE - 1, | ||
| 90 | .flags = IORESOURCE_MEM, | ||
| 91 | }, | ||
| 92 | { | ||
| 93 | .start = INT_PWB_I2C, | ||
| 94 | .end = INT_PWB_I2C, | ||
| 95 | .flags = IORESOURCE_IRQ, | ||
| 96 | }, | ||
| 97 | }; | ||
| 98 | |||
| 99 | struct platform_device msm_device_i2c = { | ||
| 100 | .name = "msm_i2c", | ||
| 101 | .id = 0, | ||
| 102 | .num_resources = ARRAY_SIZE(resources_i2c), | ||
| 103 | .resource = resources_i2c, | ||
| 104 | }; | ||
| 105 | |||
| 106 | static struct resource resources_hsusb[] = { | ||
| 107 | { | ||
| 108 | .start = MSM_HSUSB_PHYS, | ||
| 109 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
| 110 | .flags = IORESOURCE_MEM, | ||
| 111 | }, | ||
| 112 | { | ||
| 113 | .start = INT_USB_HS, | ||
| 114 | .end = INT_USB_HS, | ||
| 115 | .flags = IORESOURCE_IRQ, | ||
| 116 | }, | ||
| 117 | }; | ||
| 118 | |||
| 119 | struct platform_device msm_device_hsusb = { | ||
| 120 | .name = "msm_hsusb", | ||
| 121 | .id = -1, | ||
| 122 | .num_resources = ARRAY_SIZE(resources_hsusb), | ||
| 123 | .resource = resources_hsusb, | ||
| 124 | .dev = { | ||
| 125 | .coherent_dma_mask = 0xffffffff, | ||
| 126 | }, | ||
| 127 | }; | ||
| 128 | |||
| 129 | struct flash_platform_data msm_nand_data = { | ||
| 130 | .parts = NULL, | ||
| 131 | .nr_parts = 0, | ||
| 132 | }; | ||
| 133 | |||
| 134 | static struct resource resources_nand[] = { | ||
| 135 | [0] = { | ||
| 136 | .start = 7, | ||
| 137 | .end = 7, | ||
| 138 | .flags = IORESOURCE_DMA, | ||
| 139 | }, | ||
| 140 | }; | ||
| 141 | |||
| 142 | struct platform_device msm_device_nand = { | ||
| 143 | .name = "msm_nand", | ||
| 144 | .id = -1, | ||
| 145 | .num_resources = ARRAY_SIZE(resources_nand), | ||
| 146 | .resource = resources_nand, | ||
| 147 | .dev = { | ||
| 148 | .platform_data = &msm_nand_data, | ||
| 149 | }, | ||
| 150 | }; | ||
| 151 | |||
| 152 | struct platform_device msm_device_smd = { | ||
| 153 | .name = "msm_smd", | ||
| 154 | .id = -1, | ||
| 155 | }; | ||
| 156 | |||
| 157 | static struct resource resources_sdc1[] = { | ||
| 158 | { | ||
| 159 | .start = MSM_SDC1_PHYS, | ||
| 160 | .end = MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1, | ||
| 161 | .flags = IORESOURCE_MEM, | ||
| 162 | }, | ||
| 163 | { | ||
| 164 | .start = INT_SDC1_0, | ||
| 165 | .end = INT_SDC1_1, | ||
| 166 | .flags = IORESOURCE_IRQ, | ||
| 167 | }, | ||
| 168 | { | ||
| 169 | .start = 8, | ||
| 170 | .end = 8, | ||
| 171 | .flags = IORESOURCE_DMA, | ||
| 172 | }, | ||
| 173 | }; | ||
| 174 | |||
| 175 | static struct resource resources_sdc2[] = { | ||
| 176 | { | ||
| 177 | .start = MSM_SDC2_PHYS, | ||
| 178 | .end = MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1, | ||
| 179 | .flags = IORESOURCE_MEM, | ||
| 180 | }, | ||
| 181 | { | ||
| 182 | .start = INT_SDC2_0, | ||
| 183 | .end = INT_SDC2_1, | ||
| 184 | .flags = IORESOURCE_IRQ, | ||
| 185 | }, | ||
| 186 | { | ||
| 187 | .start = 8, | ||
| 188 | .end = 8, | ||
| 189 | .flags = IORESOURCE_DMA, | ||
| 190 | }, | ||
| 191 | }; | ||
| 192 | |||
| 193 | static struct resource resources_sdc3[] = { | ||
| 194 | { | ||
| 195 | .start = MSM_SDC3_PHYS, | ||
| 196 | .end = MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1, | ||
| 197 | .flags = IORESOURCE_MEM, | ||
| 198 | }, | ||
| 199 | { | ||
| 200 | .start = INT_SDC3_0, | ||
| 201 | .end = INT_SDC3_1, | ||
| 202 | .flags = IORESOURCE_IRQ, | ||
| 203 | }, | ||
| 204 | { | ||
| 205 | .start = 8, | ||
| 206 | .end = 8, | ||
| 207 | .flags = IORESOURCE_DMA, | ||
| 208 | }, | ||
| 209 | }; | ||
| 210 | |||
| 211 | static struct resource resources_sdc4[] = { | ||
| 212 | { | ||
| 213 | .start = MSM_SDC4_PHYS, | ||
| 214 | .end = MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1, | ||
| 215 | .flags = IORESOURCE_MEM, | ||
| 216 | }, | ||
| 217 | { | ||
| 218 | .start = INT_SDC4_0, | ||
| 219 | .end = INT_SDC4_1, | ||
| 220 | .flags = IORESOURCE_IRQ, | ||
| 221 | }, | ||
| 222 | { | ||
| 223 | .start = 8, | ||
| 224 | .end = 8, | ||
| 225 | .flags = IORESOURCE_DMA, | ||
| 226 | }, | ||
| 227 | }; | ||
| 228 | |||
| 229 | struct platform_device msm_device_sdc1 = { | ||
| 230 | .name = "msm_sdcc", | ||
| 231 | .id = 1, | ||
| 232 | .num_resources = ARRAY_SIZE(resources_sdc1), | ||
| 233 | .resource = resources_sdc1, | ||
| 234 | .dev = { | ||
| 235 | .coherent_dma_mask = 0xffffffff, | ||
| 236 | }, | ||
| 237 | }; | ||
| 238 | |||
| 239 | struct platform_device msm_device_sdc2 = { | ||
| 240 | .name = "msm_sdcc", | ||
| 241 | .id = 2, | ||
| 242 | .num_resources = ARRAY_SIZE(resources_sdc2), | ||
| 243 | .resource = resources_sdc2, | ||
| 244 | .dev = { | ||
| 245 | .coherent_dma_mask = 0xffffffff, | ||
| 246 | }, | ||
| 247 | }; | ||
| 248 | |||
| 249 | struct platform_device msm_device_sdc3 = { | ||
| 250 | .name = "msm_sdcc", | ||
| 251 | .id = 3, | ||
| 252 | .num_resources = ARRAY_SIZE(resources_sdc3), | ||
| 253 | .resource = resources_sdc3, | ||
| 254 | .dev = { | ||
| 255 | .coherent_dma_mask = 0xffffffff, | ||
| 256 | }, | ||
| 257 | }; | ||
| 258 | |||
| 259 | struct platform_device msm_device_sdc4 = { | ||
| 260 | .name = "msm_sdcc", | ||
| 261 | .id = 4, | ||
| 262 | .num_resources = ARRAY_SIZE(resources_sdc4), | ||
| 263 | .resource = resources_sdc4, | ||
| 264 | .dev = { | ||
| 265 | .coherent_dma_mask = 0xffffffff, | ||
| 266 | }, | ||
| 267 | }; | ||
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h new file mode 100644 index 00000000000..0744c4a27d6 --- /dev/null +++ b/arch/arm/mach-msm/devices.h | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | /* linux/arch/arm/mach-msm/devices.h | ||
| 2 | * | ||
| 3 | * Copyright (C) 2008 Google, Inc. | ||
| 4 | * | ||
| 5 | * This software is licensed under the terms of the GNU General Public | ||
| 6 | * License version 2, as published by the Free Software Foundation, and | ||
| 7 | * may be copied, distributed, and modified under those terms. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef __ARCH_ARM_MACH_MSM_DEVICES_H | ||
| 17 | #define __ARCH_ARM_MACH_MSM_DEVICES_H | ||
| 18 | |||
| 19 | extern struct platform_device msm_device_uart1; | ||
| 20 | extern struct platform_device msm_device_uart2; | ||
| 21 | extern struct platform_device msm_device_uart3; | ||
| 22 | |||
| 23 | extern struct platform_device msm_device_sdc1; | ||
| 24 | extern struct platform_device msm_device_sdc2; | ||
| 25 | extern struct platform_device msm_device_sdc3; | ||
| 26 | extern struct platform_device msm_device_sdc4; | ||
| 27 | |||
| 28 | extern struct platform_device msm_device_hsusb; | ||
| 29 | |||
| 30 | extern struct platform_device msm_device_i2c; | ||
| 31 | |||
| 32 | extern struct platform_device msm_device_smd; | ||
| 33 | |||
| 34 | extern struct platform_device msm_device_nand; | ||
| 35 | |||
| 36 | #endif | ||
diff --git a/arch/arm/mach-msm/include/mach/debug-macro.S b/arch/arm/mach-msm/include/mach/debug-macro.S index 528eef4b605..1db3c97dbc4 100644 --- a/arch/arm/mach-msm/include/mach/debug-macro.S +++ b/arch/arm/mach-msm/include/mach/debug-macro.S | |||
| @@ -22,18 +22,22 @@ | |||
| 22 | mrc p15, 0, \rx, c1, c0 | 22 | mrc p15, 0, \rx, c1, c0 |
| 23 | tst \rx, #1 | 23 | tst \rx, #1 |
| 24 | ldreq \rx, =MSM_UART1_PHYS | 24 | ldreq \rx, =MSM_UART1_PHYS |
| 25 | ldrne \rx, =MSM_UART1_BASE | 25 | movne \rx, #0 |
| 26 | .endm | 26 | .endm |
| 27 | 27 | ||
| 28 | .macro senduart,rd,rx | 28 | .macro senduart,rd,rx |
| 29 | str \rd, [\rx, #0x0C] | 29 | teq \rx, #0 |
| 30 | strne \rd, [\rx, #0x0C] | ||
| 30 | .endm | 31 | .endm |
| 31 | 32 | ||
| 32 | .macro waituart,rd,rx | 33 | .macro waituart,rd,rx |
| 33 | @ wait for TX_READY | 34 | @ wait for TX_READY |
| 35 | teq \rx, #0 | ||
| 36 | bne 2f | ||
| 34 | 1: ldr \rd, [\rx, #0x08] | 37 | 1: ldr \rd, [\rx, #0x08] |
| 35 | tst \rd, #0x04 | 38 | tst \rd, #0x04 |
| 36 | beq 1b | 39 | beq 1b |
| 40 | 2: | ||
| 37 | .endm | 41 | .endm |
| 38 | 42 | ||
| 39 | .macro busyuart,rd,rx | 43 | .macro busyuart,rd,rx |
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap.h b/arch/arm/mach-msm/include/mach/msm_iomap.h index e221f58ceea..2f7b4c8620d 100644 --- a/arch/arm/mach-msm/include/mach/msm_iomap.h +++ b/arch/arm/mach-msm/include/mach/msm_iomap.h | |||
| @@ -37,11 +37,17 @@ | |||
| 37 | * | 37 | * |
| 38 | */ | 38 | */ |
| 39 | 39 | ||
| 40 | #define MSM_VIC_BASE 0xE0000000 | 40 | #ifdef __ASSEMBLY__ |
| 41 | #define IOMEM(x) x | ||
| 42 | #else | ||
| 43 | #define IOMEM(x) ((void __force __iomem *)(x)) | ||
| 44 | #endif | ||
| 45 | |||
| 46 | #define MSM_VIC_BASE IOMEM(0xE0000000) | ||
| 41 | #define MSM_VIC_PHYS 0xC0000000 | 47 | #define MSM_VIC_PHYS 0xC0000000 |
| 42 | #define MSM_VIC_SIZE SZ_4K | 48 | #define MSM_VIC_SIZE SZ_4K |
| 43 | 49 | ||
| 44 | #define MSM_CSR_BASE 0xE0001000 | 50 | #define MSM_CSR_BASE IOMEM(0xE0001000) |
| 45 | #define MSM_CSR_PHYS 0xC0100000 | 51 | #define MSM_CSR_PHYS 0xC0100000 |
| 46 | #define MSM_CSR_SIZE SZ_4K | 52 | #define MSM_CSR_SIZE SZ_4K |
| 47 | 53 | ||
| @@ -49,56 +55,67 @@ | |||
| 49 | #define MSM_GPT_BASE MSM_CSR_BASE | 55 | #define MSM_GPT_BASE MSM_CSR_BASE |
| 50 | #define MSM_GPT_SIZE SZ_4K | 56 | #define MSM_GPT_SIZE SZ_4K |
| 51 | 57 | ||
| 52 | #define MSM_DMOV_BASE 0xE0002000 | 58 | #define MSM_DMOV_BASE IOMEM(0xE0002000) |
| 53 | #define MSM_DMOV_PHYS 0xA9700000 | 59 | #define MSM_DMOV_PHYS 0xA9700000 |
| 54 | #define MSM_DMOV_SIZE SZ_4K | 60 | #define MSM_DMOV_SIZE SZ_4K |
| 55 | 61 | ||
| 56 | #define MSM_UART1_BASE 0xE0003000 | 62 | #define MSM_GPIO1_BASE IOMEM(0xE0003000) |
| 63 | #define MSM_GPIO1_PHYS 0xA9200000 | ||
| 64 | #define MSM_GPIO1_SIZE SZ_4K | ||
| 65 | |||
| 66 | #define MSM_GPIO2_BASE IOMEM(0xE0004000) | ||
| 67 | #define MSM_GPIO2_PHYS 0xA9300000 | ||
| 68 | #define MSM_GPIO2_SIZE SZ_4K | ||
| 69 | |||
| 70 | #define MSM_CLK_CTL_BASE IOMEM(0xE0005000) | ||
| 71 | #define MSM_CLK_CTL_PHYS 0xA8600000 | ||
| 72 | #define MSM_CLK_CTL_SIZE SZ_4K | ||
| 73 | |||
| 74 | #define MSM_SHARED_RAM_BASE IOMEM(0xE0100000) | ||
| 75 | #define MSM_SHARED_RAM_PHYS 0x01F00000 | ||
| 76 | #define MSM_SHARED_RAM_SIZE SZ_1M | ||
| 77 | |||
| 57 | #define MSM_UART1_PHYS 0xA9A00000 | 78 | #define MSM_UART1_PHYS 0xA9A00000 |
| 58 | #define MSM_UART1_SIZE SZ_4K | 79 | #define MSM_UART1_SIZE SZ_4K |
| 59 | 80 | ||
| 60 | #define MSM_UART2_BASE 0xE0004000 | ||
| 61 | #define MSM_UART2_PHYS 0xA9B00000 | 81 | #define MSM_UART2_PHYS 0xA9B00000 |
| 62 | #define MSM_UART2_SIZE SZ_4K | 82 | #define MSM_UART2_SIZE SZ_4K |
| 63 | 83 | ||
| 64 | #define MSM_UART3_BASE 0xE0005000 | ||
| 65 | #define MSM_UART3_PHYS 0xA9C00000 | 84 | #define MSM_UART3_PHYS 0xA9C00000 |
| 66 | #define MSM_UART3_SIZE SZ_4K | 85 | #define MSM_UART3_SIZE SZ_4K |
| 67 | 86 | ||
| 68 | #define MSM_I2C_BASE 0xE0006000 | 87 | #define MSM_SDC1_PHYS 0xA0400000 |
| 69 | #define MSM_I2C_PHYS 0xA9900000 | 88 | #define MSM_SDC1_SIZE SZ_4K |
| 70 | #define MSM_I2C_SIZE SZ_4K | ||
| 71 | 89 | ||
| 72 | #define MSM_GPIO1_BASE 0xE0007000 | 90 | #define MSM_SDC2_PHYS 0xA0500000 |
| 73 | #define MSM_GPIO1_PHYS 0xA9200000 | 91 | #define MSM_SDC2_SIZE SZ_4K |
| 74 | #define MSM_GPIO1_SIZE SZ_4K | ||
| 75 | 92 | ||
| 76 | #define MSM_GPIO2_BASE 0xE0008000 | 93 | #define MSM_SDC3_PHYS 0xA0600000 |
| 77 | #define MSM_GPIO2_PHYS 0xA9300000 | 94 | #define MSM_SDC3_SIZE SZ_4K |
| 78 | #define MSM_GPIO2_SIZE SZ_4K | 95 | |
| 96 | #define MSM_SDC4_PHYS 0xA0700000 | ||
| 97 | #define MSM_SDC4_SIZE SZ_4K | ||
| 98 | |||
| 99 | #define MSM_I2C_PHYS 0xA9900000 | ||
| 100 | #define MSM_I2C_SIZE SZ_4K | ||
| 79 | 101 | ||
| 80 | #define MSM_HSUSB_BASE 0xE0009000 | ||
| 81 | #define MSM_HSUSB_PHYS 0xA0800000 | 102 | #define MSM_HSUSB_PHYS 0xA0800000 |
| 82 | #define MSM_HSUSB_SIZE SZ_4K | 103 | #define MSM_HSUSB_SIZE SZ_4K |
| 83 | 104 | ||
| 84 | #define MSM_CLK_CTL_BASE 0xE000A000 | ||
| 85 | #define MSM_CLK_CTL_PHYS 0xA8600000 | ||
| 86 | #define MSM_CLK_CTL_SIZE SZ_4K | ||
| 87 | |||
| 88 | #define MSM_PMDH_BASE 0xE000B000 | ||
| 89 | #define MSM_PMDH_PHYS 0xAA600000 | 105 | #define MSM_PMDH_PHYS 0xAA600000 |
| 90 | #define MSM_PMDH_SIZE SZ_4K | 106 | #define MSM_PMDH_SIZE SZ_4K |
| 91 | 107 | ||
| 92 | #define MSM_EMDH_BASE 0xE000C000 | ||
| 93 | #define MSM_EMDH_PHYS 0xAA700000 | 108 | #define MSM_EMDH_PHYS 0xAA700000 |
| 94 | #define MSM_EMDH_SIZE SZ_4K | 109 | #define MSM_EMDH_SIZE SZ_4K |
| 95 | 110 | ||
| 96 | #define MSM_MDP_BASE 0xE0010000 | ||
| 97 | #define MSM_MDP_PHYS 0xAA200000 | 111 | #define MSM_MDP_PHYS 0xAA200000 |
| 98 | #define MSM_MDP_SIZE 0x000F0000 | 112 | #define MSM_MDP_SIZE 0x000F0000 |
| 99 | 113 | ||
| 100 | #define MSM_SHARED_RAM_BASE 0xE0100000 | 114 | #define MSM_MDC_PHYS 0xAA500000 |
| 101 | #define MSM_SHARED_RAM_PHYS 0x01F00000 | 115 | #define MSM_MDC_SIZE SZ_1M |
| 102 | #define MSM_SHARED_RAM_SIZE SZ_1M | 116 | |
| 117 | #define MSM_AD5_PHYS 0xAC000000 | ||
| 118 | #define MSM_AD5_SIZE (SZ_1M*13) | ||
| 119 | |||
| 103 | 120 | ||
| 104 | #endif | 121 | #endif |
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c index 7999e4ba8e2..6e7692ff6f2 100644 --- a/arch/arm/mach-msm/io.c +++ b/arch/arm/mach-msm/io.c | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | #include <mach/board.h> | 28 | #include <mach/board.h> |
| 29 | 29 | ||
| 30 | #define MSM_DEVICE(name) { \ | 30 | #define MSM_DEVICE(name) { \ |
| 31 | .virtual = MSM_##name##_BASE, \ | 31 | .virtual = (unsigned long) MSM_##name##_BASE, \ |
| 32 | .pfn = __phys_to_pfn(MSM_##name##_PHYS), \ | 32 | .pfn = __phys_to_pfn(MSM_##name##_PHYS), \ |
| 33 | .length = MSM_##name##_SIZE, \ | 33 | .length = MSM_##name##_SIZE, \ |
| 34 | .type = MT_DEVICE_NONSHARED, \ | 34 | .type = MT_DEVICE_NONSHARED, \ |
| @@ -39,19 +39,11 @@ static struct map_desc msm_io_desc[] __initdata = { | |||
| 39 | MSM_DEVICE(CSR), | 39 | MSM_DEVICE(CSR), |
| 40 | MSM_DEVICE(GPT), | 40 | MSM_DEVICE(GPT), |
| 41 | MSM_DEVICE(DMOV), | 41 | MSM_DEVICE(DMOV), |
| 42 | MSM_DEVICE(UART1), | ||
| 43 | MSM_DEVICE(UART2), | ||
| 44 | MSM_DEVICE(UART3), | ||
| 45 | MSM_DEVICE(I2C), | ||
| 46 | MSM_DEVICE(GPIO1), | 42 | MSM_DEVICE(GPIO1), |
| 47 | MSM_DEVICE(GPIO2), | 43 | MSM_DEVICE(GPIO2), |
| 48 | MSM_DEVICE(HSUSB), | ||
| 49 | MSM_DEVICE(CLK_CTL), | 44 | MSM_DEVICE(CLK_CTL), |
| 50 | MSM_DEVICE(PMDH), | ||
| 51 | MSM_DEVICE(EMDH), | ||
| 52 | MSM_DEVICE(MDP), | ||
| 53 | { | 45 | { |
| 54 | .virtual = MSM_SHARED_RAM_BASE, | 46 | .virtual = (unsigned long) MSM_SHARED_RAM_BASE, |
| 55 | .pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS), | 47 | .pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS), |
| 56 | .length = MSM_SHARED_RAM_SIZE, | 48 | .length = MSM_SHARED_RAM_SIZE, |
| 57 | .type = MT_DEVICE, | 49 | .type = MT_DEVICE, |
diff --git a/arch/arm/mach-msm/irq.c b/arch/arm/mach-msm/irq.c index 04b8d182ff8..69ca0dd79bd 100644 --- a/arch/arm/mach-msm/irq.c +++ b/arch/arm/mach-msm/irq.c | |||
| @@ -66,20 +66,20 @@ | |||
| 66 | 66 | ||
| 67 | static void msm_irq_ack(unsigned int irq) | 67 | static void msm_irq_ack(unsigned int irq) |
| 68 | { | 68 | { |
| 69 | unsigned reg = VIC_INT_CLEAR0 + ((irq & 32) ? 4 : 0); | 69 | void __iomem *reg = VIC_INT_CLEAR0 + ((irq & 32) ? 4 : 0); |
| 70 | irq = 1 << (irq & 31); | 70 | irq = 1 << (irq & 31); |
| 71 | writel(irq, reg); | 71 | writel(irq, reg); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | static void msm_irq_mask(unsigned int irq) | 74 | static void msm_irq_mask(unsigned int irq) |
| 75 | { | 75 | { |
| 76 | unsigned reg = VIC_INT_ENCLEAR0 + ((irq & 32) ? 4 : 0); | 76 | void __iomem *reg = VIC_INT_ENCLEAR0 + ((irq & 32) ? 4 : 0); |
| 77 | writel(1 << (irq & 31), reg); | 77 | writel(1 << (irq & 31), reg); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | static void msm_irq_unmask(unsigned int irq) | 80 | static void msm_irq_unmask(unsigned int irq) |
| 81 | { | 81 | { |
| 82 | unsigned reg = VIC_INT_ENSET0 + ((irq & 32) ? 4 : 0); | 82 | void __iomem *reg = VIC_INT_ENSET0 + ((irq & 32) ? 4 : 0); |
| 83 | writel(1 << (irq & 31), reg); | 83 | writel(1 << (irq & 31), reg); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| @@ -90,8 +90,8 @@ static int msm_irq_set_wake(unsigned int irq, unsigned int on) | |||
| 90 | 90 | ||
| 91 | static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) | 91 | static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) |
| 92 | { | 92 | { |
| 93 | unsigned treg = VIC_INT_TYPE0 + ((irq & 32) ? 4 : 0); | 93 | void __iomem *treg = VIC_INT_TYPE0 + ((irq & 32) ? 4 : 0); |
| 94 | unsigned preg = VIC_INT_POLARITY0 + ((irq & 32) ? 4 : 0); | 94 | void __iomem *preg = VIC_INT_POLARITY0 + ((irq & 32) ? 4 : 0); |
| 95 | int b = 1 << (irq & 31); | 95 | int b = 1 << (irq & 31); |
| 96 | 96 | ||
| 97 | if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) | 97 | if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) |
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c index 2bffe9b7e9f..345a14cb73c 100644 --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c | |||
| @@ -45,7 +45,7 @@ struct msm_clock { | |||
| 45 | struct clock_event_device clockevent; | 45 | struct clock_event_device clockevent; |
| 46 | struct clocksource clocksource; | 46 | struct clocksource clocksource; |
| 47 | struct irqaction irq; | 47 | struct irqaction irq; |
| 48 | uint32_t regbase; | 48 | void __iomem *regbase; |
| 49 | uint32_t freq; | 49 | uint32_t freq; |
| 50 | uint32_t shift; | 50 | uint32_t shift; |
| 51 | }; | 51 | }; |
