From 886b9fa49900b055e20cd98f379fda49835d1ee6 Mon Sep 17 00:00:00 2001 From: Matt Porter Date: Sat, 3 Sep 2005 15:55:32 -0700 Subject: [PATCH] [PATCH] ppc32: Add usb support to IBM stb04xxx platforms Support ochi-ppc-soc.c on IBM stb04xxx platforms Signed-off-by: Dale Farnsworth Signed-off-by: Matt Porter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/ppc/platforms/4xx/ibmstb4.c | 52 +++++++++++++++++++++++++++---- arch/ppc/platforms/4xx/ibmstb4.h | 4 +-- arch/ppc/platforms/4xx/redwood5.c | 13 ++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/arch/ppc/platforms/4xx/ibmstb4.c b/arch/ppc/platforms/4xx/ibmstb4.c index 874d16bab73..d90627b68fa 100644 --- a/arch/ppc/platforms/4xx/ibmstb4.c +++ b/arch/ppc/platforms/4xx/ibmstb4.c @@ -11,6 +11,7 @@ #include #include +#include #include static struct ocp_func_iic_data ibmstb4_iic0_def = { @@ -72,12 +73,51 @@ struct ocp_def core_ocp[] __initdata = { .irq = IDE0_IRQ, .pm = OCP_CPM_NA, }, - { .vendor = OCP_VENDOR_IBM, - .function = OCP_FUNC_USB, - .paddr = USB0_BASE, - .irq = USB0_IRQ, - .pm = OCP_CPM_NA, - }, { .vendor = OCP_VENDOR_INVALID, } }; + +/* Polarity and triggering settings for internal interrupt sources */ +struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { + { .polarity = 0x7fffff01, + .triggering = 0x00000000, + .ext_irq_mask = 0x0000007e, /* IRQ0 - IRQ5 */ + } +}; + +static struct resource ohci_usb_resources[] = { + [0] = { + .start = USB0_BASE, + .end = USB0_BASE + USB0_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = USB0_IRQ, + .end = USB0_IRQ, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 dma_mask = 0xffffffffULL; + +static struct platform_device ohci_usb_device = { + .name = "ppc-soc-ohci", + .id = 0, + .num_resources = ARRAY_SIZE(ohci_usb_resources), + .resource = ohci_usb_resources, + .dev = { + .dma_mask = &dma_mask, + .coherent_dma_mask = 0xffffffffULL, + } +}; + +static struct platform_device *ibmstb4_devs[] __initdata = { + &ohci_usb_device, +}; + +static int __init +ibmstb4_platform_add_devices(void) +{ + return platform_add_devices(ibmstb4_devs, ARRAY_SIZE(ibmstb4_devs)); +} +arch_initcall(ibmstb4_platform_add_devices); diff --git a/arch/ppc/platforms/4xx/ibmstb4.h b/arch/ppc/platforms/4xx/ibmstb4.h index bcb4b1ee71f..9f21d4c88a3 100644 --- a/arch/ppc/platforms/4xx/ibmstb4.h +++ b/arch/ppc/platforms/4xx/ibmstb4.h @@ -73,9 +73,9 @@ #define OPB0_BASE 0x40000000 #define GPIO0_BASE 0x40060000 +#define USB0_BASE 0x40010000 +#define USB0_SIZE 0xA0 #define USB0_IRQ 18 -#define USB0_BASE STB04xxx_MAP_IO_ADDR(0x40010000) -#define USB0_EXTENT 4096 #define IIC_NUMS 2 #define UART_NUMS 3 diff --git a/arch/ppc/platforms/4xx/redwood5.c b/arch/ppc/platforms/4xx/redwood5.c index 2f5e410afbc..bee8b4ac8af 100644 --- a/arch/ppc/platforms/4xx/redwood5.c +++ b/arch/ppc/platforms/4xx/redwood5.c @@ -18,6 +18,19 @@ #include #include #include +#include + +/* + * Define external IRQ senses and polarities. + */ +unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = { + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */ +}; static struct resource smc91x_resources[] = { [0] = { -- 2.41.0