X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fmach-iop3xx%2Fiop331-setup.c;h=622e7914819a49d9b365d9bffe14bfc171a1db5a;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=681e1ce78442ecd500d0e900ad61b6a02f771eb8;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/arch/arm/mach-iop3xx/iop331-setup.c b/arch/arm/mach-iop3xx/iop331-setup.c index 681e1ce78..622e79148 100644 --- a/arch/arm/mach-iop3xx/iop331-setup.c +++ b/arch/arm/mach-iop3xx/iop331-setup.c @@ -43,13 +43,13 @@ static struct map_desc iop331_std_desc[] __initdata = { { IOP331_VIRT_MEM_BASE, IOP331_PHYS_MEM_BASE, 0x00002000, MT_DEVICE }, /* PCI IO space */ - { 0xfe000000, 0x90000000, 0x00020000, MT_DEVICE } + { IOP331_PCI_LOWER_IO_VA, IOP331_PCI_LOWER_IO_PA, IOP331_PCI_IO_WINDOW_SIZE, MT_DEVICE } }; static struct uart_port iop331_serial_ports[] = { { - .membase = (char*)(IQ80331_UART0_VIRT), - .mapbase = (IQ80331_UART0_PHYS), + .membase = (char*)(IOP331_UART0_VIRT), + .mapbase = (IOP331_UART0_PHYS), .irq = IRQ_IOP331_UART0, .flags = UPF_SKIP_TEST, .iotype = UPIO_MEM, @@ -59,8 +59,8 @@ static struct uart_port iop331_serial_ports[] = { .type = PORT_XSCALE, .fifosize = 32 } , { - .membase = (char*)(IQ80331_UART1_VIRT), - .mapbase = (IQ80331_UART1_PHYS), + .membase = (char*)(IOP331_UART1_VIRT), + .mapbase = (IOP331_UART1_PHYS), .irq = IRQ_IOP331_UART1, .flags = UPF_SKIP_TEST, .iotype = UPIO_MEM, @@ -72,6 +72,60 @@ static struct uart_port iop331_serial_ports[] = { } }; +static struct resource iop33x_i2c_0_resources[] = { + [0] = { + .start = 0xfffff680, + .end = 0xfffff698, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IOP331_I2C_0, + .end = IRQ_IOP331_I2C_0, + .flags = IORESOURCE_IRQ + } +}; + +static struct resource iop33x_i2c_1_resources[] = { + [0] = { + .start = 0xfffff6a0, + .end = 0xfffff6b8, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IOP331_I2C_1, + .end = IRQ_IOP331_I2C_1, + .flags = IORESOURCE_IRQ + } +}; + +static struct platform_device iop33x_i2c_0_controller = { + .name = "IOP3xx-I2C", + .id = 0, + .num_resources = 2, + .resource = iop33x_i2c_0_resources +}; + +static struct platform_device iop33x_i2c_1_controller = { + .name = "IOP3xx-I2C", + .id = 1, + .num_resources = 2, + .resource = iop33x_i2c_1_resources +}; + +static struct platform_device *iop33x_devices[] __initdata = { + &iop33x_i2c_0_controller, + &iop33x_i2c_1_controller +}; + +void __init iop33x_init(void) +{ + if(iop_is_331()) + { + platform_add_devices(iop33x_devices, + ARRAY_SIZE(iop33x_devices)); + } +} + void __init iop331_map_io(void) { iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc)); @@ -79,22 +133,43 @@ void __init iop331_map_io(void) early_serial_setup(&iop331_serial_ports[1]); } -#ifdef CONFIG_ARCH_IQ80331 +#ifdef CONFIG_ARCH_IOP331 extern void iop331_init_irq(void); -extern void iop331_init_time(void); +extern struct sys_timer iop331_timer; +#endif + +#ifdef CONFIG_ARCH_IQ80331 extern void iq80331_map_io(void); #endif +#ifdef CONFIG_MACH_IQ80332 +extern void iq80332_map_io(void); +#endif + #if defined(CONFIG_ARCH_IQ80331) MACHINE_START(IQ80331, "Intel IQ80331") MAINTAINER("Intel Corp.") BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical - //BOOT_MEM(PHYS_OFFSET, IQ80331_UART0_VIRT, IQ80331_UART0_PHYS) + //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) MAPIO(iq80331_map_io) INITIRQ(iop331_init_irq) - INITTIME(iop331_init_time) + .timer = &iop331_timer, BOOT_PARAMS(0x0100) + INIT_MACHINE(iop33x_init) MACHINE_END + +#elif defined(CONFIG_MACH_IQ80332) +MACHINE_START(IQ80332, "Intel IQ80332") + MAINTAINER("Intel Corp.") + BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical + //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) + MAPIO(iq80332_map_io) + INITIRQ(iop331_init_irq) + .timer = &iop331_timer, + BOOT_PARAMS(0x0100) + INIT_MACHINE(iop33x_init) +MACHINE_END + #else #error No machine descriptor defined for this IOP3XX implementation #endif