Commit caef95d4 authored by Deepak Saxena's avatar Deepak Saxena Committed by Russell King

[ARM PATCH] 2358/1: Add IXP46x I2C platform device

Patch from Deepak Saxena

The IXP46x chips from Intel include the same I2C controller as found
on the IOP3xx.  This patch adds a hook to the platform-level init code
to add that device to the device tree if running on a 46x CPU. A
separate patch has been sent upstream via Greg KH for the changes to the
I2C driver to support both IOP and IXP systems.

While at it, we fix a minor issue with the code where we were sending 
the wrong ptr to platform_add_devices(). I am not sure how it ever 
worked...

Signed-off-by: Deepak Saxena
Signed-off-by: Russell King
parent eb25b5b2
......@@ -279,3 +279,40 @@ struct sys_timer ixp4xx_timer = {
.init = ixp4xx_timer_init,
.offset = ixp4xx_gettimeoffset,
};
static struct resource ixp46x_i2c_resources[] = {
[0] = {
.start = 0xc8011000,
.end = 0xc801101c,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_IXP4XX_I2C,
.end = IRQ_IXP4XX_I2C,
.flags = IORESOURCE_IRQ
}
};
/*
* I2C controller. The IXP46x uses the same block as the IOP3xx, so
* we just use the same device name.
*/
static struct platform_device ixp46x_i2c_controller = {
.name = "IOP3xx-I2C",
.id = 0,
.num_resources = 2,
.resource = &ixp46x_i2c_resources
};
static struct platform_device *ixp46x_devices[] __initdata = {
&ixp46x_i2c_controller
};
void __init ixp4xx_sys_init(void)
{
if (cpu_is_ixp46x()) {
platform_add_devices(ixp46x_devices,
ARRAY_SIZE(ixp46x_devices));
}
}
......@@ -89,7 +89,8 @@ static void __init coyote_init(void)
*IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
*IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
platform_add_devices(&coyote_devices, ARRAY_SIZE(coyote_devices));
ixp4xx_sys_init();
platform_add_devices(coyote_devices, ARRAY_SIZE(coyote_devices));
}
#ifdef CONFIG_ARCH_ADI_COYOTE
......
......@@ -108,6 +108,8 @@ static struct platform_device *ixdp425_devices[] __initdata = {
static void __init ixdp425_init(void)
{
ixp4xx_sys_init();
/*
* IXP465 has 32MB window
*/
......@@ -115,7 +117,7 @@ static void __init ixdp425_init(void)
ixdp425_flash_resource.end += IXDP425_FLASH_SIZE;
}
platform_add_devices(&ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
}
MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
......
......@@ -79,7 +79,9 @@ static struct platform_device *prpmc1100_devices[] __initdata = {
static void __init prpmc1100_init(void)
{
platform_add_devices(&prpmc1100_devices, ARRAY_SIZE(prpmc1100_devices));
ixp4xx_sys_init();
platform_add_devices(prpmc1100_devices, ARRAY_SIZE(prpmc1100_devices));
}
MACHINE_START(PRPMC1100, "Motorola PrPMC1100")
......
......@@ -48,14 +48,6 @@
#define IRQ_IXP4XX_GPIO12 29
#define IRQ_IXP4XX_SW_INT1 30
#define IRQ_IXP4XX_SW_INT2 31
#ifndef CONFIG_CPU_IXP46X
#define NR_IRQS 32
#else
/*
* IXP465 adds new sources
*/
#define IRQ_IXP4XX_USB_HOST 32
#define IRQ_IXP4XX_I2C 33
#define IRQ_IXP4XX_SSP 34
......@@ -67,6 +59,12 @@
#define IRQ_IXP4XX_MCU_ECC 61
#define IRQ_IXP4XX_EXP_PE 62
/*
* Only first 32 sources are valid if running on IXP42x systems
*/
#ifndef CONFIG_CPU_IXP46X
#define NR_IRQS 32
#else
#define NR_IRQS 64
#endif
......
......@@ -60,6 +60,7 @@ struct sys_timer;
*/
extern void ixp4xx_map_io(void);
extern void ixp4xx_init_irq(void);
extern void ixp4xx_sys_init(void);
extern struct sys_timer ixp4xx_timer;
extern void ixp4xx_pci_preinit(void);
struct pci_sys_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment