Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ppc32: Add usb support to IBM stb04xxx platforms

Support ochi-ppc-soc.c on IBM stb04xxx platforms

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Matt Porter and committed by
Linus Torvalds
886b9fa4 d27477c2

+61 -8
+46 -6
arch/ppc/platforms/4xx/ibmstb4.c
··· 11 11 12 12 #include <linux/init.h> 13 13 #include <asm/ocp.h> 14 + #include <asm/ppc4xx_pic.h> 14 15 #include <platforms/4xx/ibmstb4.h> 15 16 16 17 static struct ocp_func_iic_data ibmstb4_iic0_def = { ··· 73 72 .irq = IDE0_IRQ, 74 73 .pm = OCP_CPM_NA, 75 74 }, 76 - { .vendor = OCP_VENDOR_IBM, 77 - .function = OCP_FUNC_USB, 78 - .paddr = USB0_BASE, 79 - .irq = USB0_IRQ, 80 - .pm = OCP_CPM_NA, 81 - }, 82 75 { .vendor = OCP_VENDOR_INVALID, 83 76 } 84 77 }; 78 + 79 + /* Polarity and triggering settings for internal interrupt sources */ 80 + struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = { 81 + { .polarity = 0x7fffff01, 82 + .triggering = 0x00000000, 83 + .ext_irq_mask = 0x0000007e, /* IRQ0 - IRQ5 */ 84 + } 85 + }; 86 + 87 + static struct resource ohci_usb_resources[] = { 88 + [0] = { 89 + .start = USB0_BASE, 90 + .end = USB0_BASE + USB0_SIZE - 1, 91 + .flags = IORESOURCE_MEM, 92 + }, 93 + [1] = { 94 + .start = USB0_IRQ, 95 + .end = USB0_IRQ, 96 + .flags = IORESOURCE_IRQ, 97 + }, 98 + }; 99 + 100 + static u64 dma_mask = 0xffffffffULL; 101 + 102 + static struct platform_device ohci_usb_device = { 103 + .name = "ppc-soc-ohci", 104 + .id = 0, 105 + .num_resources = ARRAY_SIZE(ohci_usb_resources), 106 + .resource = ohci_usb_resources, 107 + .dev = { 108 + .dma_mask = &dma_mask, 109 + .coherent_dma_mask = 0xffffffffULL, 110 + } 111 + }; 112 + 113 + static struct platform_device *ibmstb4_devs[] __initdata = { 114 + &ohci_usb_device, 115 + }; 116 + 117 + static int __init 118 + ibmstb4_platform_add_devices(void) 119 + { 120 + return platform_add_devices(ibmstb4_devs, ARRAY_SIZE(ibmstb4_devs)); 121 + } 122 + arch_initcall(ibmstb4_platform_add_devices);
+2 -2
arch/ppc/platforms/4xx/ibmstb4.h
··· 73 73 #define OPB0_BASE 0x40000000 74 74 #define GPIO0_BASE 0x40060000 75 75 76 + #define USB0_BASE 0x40010000 77 + #define USB0_SIZE 0xA0 76 78 #define USB0_IRQ 18 77 - #define USB0_BASE STB04xxx_MAP_IO_ADDR(0x40010000) 78 - #define USB0_EXTENT 4096 79 79 80 80 #define IIC_NUMS 2 81 81 #define UART_NUMS 3
+13
arch/ppc/platforms/4xx/redwood5.c
··· 18 18 #include <linux/ioport.h> 19 19 #include <asm/io.h> 20 20 #include <asm/machdep.h> 21 + #include <asm/ppc4xx_pic.h> 22 + 23 + /* 24 + * Define external IRQ senses and polarities. 25 + */ 26 + unsigned char ppc4xx_uic_ext_irq_cfg[] __initdata = { 27 + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 0 */ 28 + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 1 */ 29 + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 2 */ 30 + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 3 */ 31 + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 4 */ 32 + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* Ext Int 5 */ 33 + }; 21 34 22 35 static struct resource smc91x_resources[] = { 23 36 [0] = {