X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=arch%2Farm%2Fmach-realview%2Fcore.c;h=5a5e1f72461e8bf16b49704884b4ef0fd90122a7;hb=4321532cec25e1747961d83fb4f78ec24ea92966;hp=27b48be73676077e57f1e57433917331a4dcccfc;hpb=533ad5e60c0a5ff3cef7583b5b1b0eee84c2bda6;p=safe%2Fjmp%2Flinux-2.6 diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 27b48be..5a5e1f7 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c @@ -28,7 +28,8 @@ #include #include #include -#include +#include +#include #include #include @@ -47,6 +48,9 @@ #include +#include +#include + #include "core.h" #include "clock.h" @@ -127,14 +131,15 @@ int realview_flash_register(struct resource *res, u32 num) return platform_device_register(&realview_flash_device); } -static struct smc911x_platdata realview_smc911x_platdata = { - .flags = SMC911X_USE_32BIT, - .irq_flags = IRQF_SHARED, - .irq_polarity = 1, +static struct smsc911x_platform_config smsc911x_config = { + .flags = SMSC911X_USE_32BIT, + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, + .phy_interface = PHY_INTERFACE_MODE_MII, }; static struct platform_device realview_eth_device = { - .name = "smc911x", + .name = "smsc911x", .id = 0, .num_resources = 2, }; @@ -144,12 +149,50 @@ int realview_eth_register(const char *name, struct resource *res) if (name) realview_eth_device.name = name; realview_eth_device.resource = res; - if (strcmp(realview_eth_device.name, "smc911x") == 0) - realview_eth_device.dev.platform_data = &realview_smc911x_platdata; + if (strcmp(realview_eth_device.name, "smsc911x") == 0) + realview_eth_device.dev.platform_data = &smsc911x_config; return platform_device_register(&realview_eth_device); } +struct platform_device realview_usb_device = { + .name = "isp1760", + .num_resources = 2, +}; + +int realview_usb_register(struct resource *res) +{ + realview_usb_device.resource = res; + return platform_device_register(&realview_usb_device); +} + +static struct pata_platform_info pata_platform_data = { + .ioport_shift = 1, +}; + +static struct resource pata_resources[] = { + [0] = { + .start = REALVIEW_CF_BASE, + .end = REALVIEW_CF_BASE + 0xff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = REALVIEW_CF_BASE + 0x100, + .end = REALVIEW_CF_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +struct platform_device realview_cf_device = { + .name = "pata_platform", + .id = -1, + .num_resources = ARRAY_SIZE(pata_resources), + .resource = pata_resources, + .dev = { + .platform_data = &pata_platform_data, + }, +}; + static struct resource realview_i2c_resource = { .start = REALVIEW_I2C_BASE, .end = REALVIEW_I2C_BASE + SZ_4K - 1, @@ -165,8 +208,7 @@ struct platform_device realview_i2c_device = { static struct i2c_board_info realview_i2c_board_info[] = { { - I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), - .type = "ds1338", + I2C_BOARD_INFO("ds1338", 0xd0 >> 1), }, }; @@ -179,6 +221,9 @@ arch_initcall(realview_i2c_init); #define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET) +/* + * This is only used if GPIOLIB support is disabled + */ static unsigned int realview_mmc_status(struct device *dev) { struct amba_device *adev = container_of(dev, struct amba_device, dev); @@ -195,11 +240,15 @@ static unsigned int realview_mmc_status(struct device *dev) struct mmc_platform_data realview_mmc0_plat_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .status = realview_mmc_status, + .gpio_wp = 17, + .gpio_cd = 16, }; struct mmc_platform_data realview_mmc1_plat_data = { .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .status = realview_mmc_status, + .gpio_wp = 19, + .gpio_cd = 18, }; /* @@ -247,31 +296,31 @@ static struct clk ref24_clk = { static struct clk_lookup lookups[] = { { /* UART0 */ - .dev_id = "dev:f1", + .dev_id = "dev:uart0", .clk = &ref24_clk, }, { /* UART1 */ - .dev_id = "dev:f2", + .dev_id = "dev:uart1", .clk = &ref24_clk, }, { /* UART2 */ - .dev_id = "dev:f3", + .dev_id = "dev:uart2", .clk = &ref24_clk, }, { /* UART3 */ - .dev_id = "fpga:09", + .dev_id = "fpga:uart3", .clk = &ref24_clk, }, { /* KMI0 */ - .dev_id = "fpga:06", + .dev_id = "fpga:kmi0", .clk = &ref24_clk, }, { /* KMI1 */ - .dev_id = "fpga:07", + .dev_id = "fpga:kmi1", .clk = &ref24_clk, }, { /* MMC0 */ - .dev_id = "fpga:05", + .dev_id = "fpga:mmc0", .clk = &ref24_clk, }, { /* EB:CLCD */ - .dev_id = "dev:20", + .dev_id = "dev:clcd", .clk = &oscvco_clk, }, { /* PB:CLCD */ - .dev_id = "issp:20", + .dev_id = "issp:clcd", .clk = &oscvco_clk, } }; @@ -538,21 +587,22 @@ void realview_leds_event(led_event_t ledevt) { unsigned long flags; u32 val; + u32 led = 1 << smp_processor_id(); local_irq_save(flags); val = readl(VA_LEDS_BASE); switch (ledevt) { case led_idle_start: - val = val & ~REALVIEW_SYS_LED0; + val = val & ~led; break; case led_idle_end: - val = val | REALVIEW_SYS_LED0; + val = val | led; break; case led_timer: - val = val ^ REALVIEW_SYS_LED1; + val = val ^ REALVIEW_SYS_LED7; break; case led_halted: @@ -675,7 +725,7 @@ static struct irqaction realview_timer_irq = { .handler = realview_timer_interrupt, }; -static cycle_t realview_get_cycles(void) +static cycle_t realview_get_cycles(struct clocksource *cs) { return ~readl(timer3_va_base + TIMER_VALUE); } @@ -710,14 +760,6 @@ void __init realview_timer_init(unsigned int timer_irq) { u32 val; -#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST - /* - * The dummy clock device has to be registered before the main device - * so that the latter will broadcast the clock events - */ - local_timer_setup(); -#endif - /* * set clock frequency: * REALVIEW_REFCLK is 32KHz