diff options
Diffstat (limited to 'arch/arm/mach-realview/core.c')
| -rw-r--r-- | arch/arm/mach-realview/core.c | 72 |
1 files changed, 63 insertions, 9 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index bd2aa4f16141..9ab947c14f26 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
| @@ -28,7 +28,8 @@ | |||
| 28 | #include <linux/clocksource.h> | 28 | #include <linux/clocksource.h> |
| 29 | #include <linux/clockchips.h> | 29 | #include <linux/clockchips.h> |
| 30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
| 31 | #include <linux/smc911x.h> | 31 | #include <linux/smsc911x.h> |
| 32 | #include <linux/ata_platform.h> | ||
| 32 | 33 | ||
| 33 | #include <asm/clkdev.h> | 34 | #include <asm/clkdev.h> |
| 34 | #include <asm/system.h> | 35 | #include <asm/system.h> |
| @@ -127,14 +128,15 @@ int realview_flash_register(struct resource *res, u32 num) | |||
| 127 | return platform_device_register(&realview_flash_device); | 128 | return platform_device_register(&realview_flash_device); |
| 128 | } | 129 | } |
| 129 | 130 | ||
| 130 | static struct smc911x_platdata realview_smc911x_platdata = { | 131 | static struct smsc911x_platform_config smsc911x_config = { |
| 131 | .flags = SMC911X_USE_32BIT, | 132 | .flags = SMSC911X_USE_32BIT, |
| 132 | .irq_flags = IRQF_SHARED, | 133 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, |
| 133 | .irq_polarity = 1, | 134 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 135 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
| 134 | }; | 136 | }; |
| 135 | 137 | ||
| 136 | static struct platform_device realview_eth_device = { | 138 | static struct platform_device realview_eth_device = { |
| 137 | .name = "smc911x", | 139 | .name = "smsc911x", |
| 138 | .id = 0, | 140 | .id = 0, |
| 139 | .num_resources = 2, | 141 | .num_resources = 2, |
| 140 | }; | 142 | }; |
| @@ -144,12 +146,50 @@ int realview_eth_register(const char *name, struct resource *res) | |||
| 144 | if (name) | 146 | if (name) |
| 145 | realview_eth_device.name = name; | 147 | realview_eth_device.name = name; |
| 146 | realview_eth_device.resource = res; | 148 | realview_eth_device.resource = res; |
| 147 | if (strcmp(realview_eth_device.name, "smc911x") == 0) | 149 | if (strcmp(realview_eth_device.name, "smsc911x") == 0) |
| 148 | realview_eth_device.dev.platform_data = &realview_smc911x_platdata; | 150 | realview_eth_device.dev.platform_data = &smsc911x_config; |
| 149 | 151 | ||
| 150 | return platform_device_register(&realview_eth_device); | 152 | return platform_device_register(&realview_eth_device); |
| 151 | } | 153 | } |
| 152 | 154 | ||
| 155 | struct platform_device realview_usb_device = { | ||
| 156 | .name = "isp1760", | ||
| 157 | .num_resources = 2, | ||
| 158 | }; | ||
| 159 | |||
| 160 | int realview_usb_register(struct resource *res) | ||
| 161 | { | ||
| 162 | realview_usb_device.resource = res; | ||
| 163 | return platform_device_register(&realview_usb_device); | ||
| 164 | } | ||
| 165 | |||
| 166 | static struct pata_platform_info pata_platform_data = { | ||
| 167 | .ioport_shift = 1, | ||
| 168 | }; | ||
| 169 | |||
| 170 | static struct resource pata_resources[] = { | ||
| 171 | [0] = { | ||
| 172 | .start = REALVIEW_CF_BASE, | ||
| 173 | .end = REALVIEW_CF_BASE + 0xff, | ||
| 174 | .flags = IORESOURCE_MEM, | ||
| 175 | }, | ||
| 176 | [1] = { | ||
| 177 | .start = REALVIEW_CF_BASE + 0x100, | ||
| 178 | .end = REALVIEW_CF_BASE + SZ_4K - 1, | ||
| 179 | .flags = IORESOURCE_MEM, | ||
| 180 | }, | ||
| 181 | }; | ||
| 182 | |||
| 183 | struct platform_device realview_cf_device = { | ||
| 184 | .name = "pata_platform", | ||
| 185 | .id = -1, | ||
| 186 | .num_resources = ARRAY_SIZE(pata_resources), | ||
| 187 | .resource = pata_resources, | ||
| 188 | .dev = { | ||
| 189 | .platform_data = &pata_platform_data, | ||
| 190 | }, | ||
| 191 | }; | ||
| 192 | |||
| 153 | static struct resource realview_i2c_resource = { | 193 | static struct resource realview_i2c_resource = { |
| 154 | .start = REALVIEW_I2C_BASE, | 194 | .start = REALVIEW_I2C_BASE, |
| 155 | .end = REALVIEW_I2C_BASE + SZ_4K - 1, | 195 | .end = REALVIEW_I2C_BASE + SZ_4K - 1, |
| @@ -158,11 +198,25 @@ static struct resource realview_i2c_resource = { | |||
| 158 | 198 | ||
| 159 | struct platform_device realview_i2c_device = { | 199 | struct platform_device realview_i2c_device = { |
| 160 | .name = "versatile-i2c", | 200 | .name = "versatile-i2c", |
| 161 | .id = -1, | 201 | .id = 0, |
| 162 | .num_resources = 1, | 202 | .num_resources = 1, |
| 163 | .resource = &realview_i2c_resource, | 203 | .resource = &realview_i2c_resource, |
| 164 | }; | 204 | }; |
| 165 | 205 | ||
| 206 | static struct i2c_board_info realview_i2c_board_info[] = { | ||
| 207 | { | ||
| 208 | I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), | ||
| 209 | .type = "ds1338", | ||
| 210 | }, | ||
| 211 | }; | ||
| 212 | |||
| 213 | static int __init realview_i2c_init(void) | ||
| 214 | { | ||
| 215 | return i2c_register_board_info(0, realview_i2c_board_info, | ||
| 216 | ARRAY_SIZE(realview_i2c_board_info)); | ||
| 217 | } | ||
| 218 | arch_initcall(realview_i2c_init); | ||
| 219 | |||
| 166 | #define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET) | 220 | #define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET) |
| 167 | 221 | ||
| 168 | static unsigned int realview_mmc_status(struct device *dev) | 222 | static unsigned int realview_mmc_status(struct device *dev) |
