Skip to contentSkip to conversation

MIPS: BCM63XX: Create platform_device for USBD

PATCH In review Kevin Cernekee 2 participants 2 messages Jul 14, 2012 – Aug 28, 2012 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH v3 7/7 MIPS: BCM63XX: Create platform_device for USBD

---
 arch/mips/bcm63xx/Makefile                         |  2 +-
 arch/mips/bcm63xx/boards/board_bcm963xx.c          | 10 ++++
 arch/mips/bcm63xx/dev-usb-usbd.c                   | 65 ++++++++++++++++++++++
 .../asm/mach-bcm63xx/bcm63xx_dev_usb_usbd.h        | 17 ++++++
 .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h |  5 ++
 5 files changed, 98 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/bcm63xx/dev-usb-usbd.c
 create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_usbd.h

V3:

Jonas pointed out that one of the newer platforms does not use consecutive IRQ numbers for the IUDMA interrupts. So we will have to eventually pass in individual IRQ resources, instead of a range. Might as well do this up front to avoid hassles later.

I will roll this into a new bundle:

http://patchwork.linux-mips.org/bundle/cernekee/bcm63xx-udc-prereq-v3/

arch/mips/bcm63xx/Makefile +1 -1
index 833af72..9bbb30a 100644
@@ -1,6 +1,6 @@
 obj-y		+= clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
 		   dev-dsp.o dev-enet.o dev-flash.o dev-pcmcia.o dev-rng.o \
-		   dev-spi.o dev-uart.o dev-wdt.o
+		   dev-spi.o dev-uart.o dev-wdt.o dev-usb-usbd.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 obj-y		+= boards/
arch/mips/bcm63xx/boards/board_bcm963xx.c +10 -0
index feb0525..ea4ea77 100644
@@ -24,6 +24,7 @@
 #include <bcm63xx_dev_flash.h>
 #include <bcm63xx_dev_pcmcia.h>
 #include <bcm63xx_dev_spi.h>
+#include <bcm63xx_dev_usb_usbd.h>
 #include <board_bcm963xx.h>
 
 #define PFX	"board_bcm963xx: "
@@ -42,6 +43,12 @@ static struct board_info __initdata board_96328avng = {
 
 	.has_uart0			= 1,
 	.has_pci			= 1,
+	.has_usbd			= 0,
+
+	.usbd = {
+		.use_fullspeed		= 0,
+		.port_no		= 0,
+	},
 
 	.leds = {
 		{
@@ -888,6 +895,9 @@ int __init board_register_devices(void)
 	    !board_get_mac_address(board.enet1.mac_addr))
 		bcm63xx_enet_register(1, &board.enet1);
 
+	if (board.has_usbd)
+		bcm63xx_usbd_register(&board.usbd);
+
 	if (board.has_dsp)
 		bcm63xx_dsp_register(&board.dsp);
 
arch/mips/bcm63xx/dev-usb-usbd.c new file +65 -0

65 lines not on this page · raw message

arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_usbd.h new file +17 -0
new file mode 100644
index 0000000..5d6d698
@@ -0,0 +1,17 @@
+#ifndef BCM63XX_DEV_USB_USBD_H_
+#define BCM63XX_DEV_USB_USBD_H_
+
+/*
+ * usb device platform data
+ */
+struct bcm63xx_usbd_platform_data {
+	/* board can only support full speed (USB 1.1) */
+	int use_fullspeed;
+
+	/* 0-based port index, for chips with >1 USB PHY */
+	int port_no;
+};
+
+int bcm63xx_usbd_register(const struct bcm63xx_usbd_platform_data *pd);
+
+#endif /* BCM63XX_DEV_USB_USBD_H_ */
arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h +5 -0
index 474daaa..b0dd4bb 100644
@@ -5,6 +5,7 @@
 #include <linux/gpio.h>
 #include <linux/leds.h>
 #include <bcm63xx_dev_enet.h>
+#include <bcm63xx_dev_usb_usbd.h>
 #include <bcm63xx_dev_dsp.h>
 
 /*
@@ -44,6 +45,7 @@ struct board_info {
 	unsigned int	has_pccard:1;
 	unsigned int	has_ohci0:1;
 	unsigned int	has_ehci0:1;
+	unsigned int	has_usbd:1;
 	unsigned int	has_dsp:1;
 	unsigned int	has_uart0:1;
 	unsigned int	has_uart1:1;
@@ -52,6 +54,9 @@ struct board_info {
 	struct bcm63xx_enet_platform_data enet0;
 	struct bcm63xx_enet_platform_data enet1;
 
+	/* USB config */
+	struct bcm63xx_usbd_platform_data usbd;
+
 	/* DSP config */
 	struct bcm63xx_dsp_platform_data dsp;
 
Signature · 1 line
1.7.11.1