summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Brandt <Michael.Brandt@stericsson.com>2009-10-30 13:48:17 +0100
committerMichael Brandt <Michael.Brandt@stericsson.com>2009-10-30 13:48:17 +0100
commitebabdb43046d5ac115b6b53c8e606e3035c32371 (patch)
treec164663fff7492fdd4bd519c0af0f996310eaf17 /include
parentdd037f7a4f779bdfa9984b0db74a1bcdf7170fe9 (diff)
use beagleboard musb gadget driver
merged and adapted beagleboard musb gadget driver to mop500. See also http://elinux.org/U-boot_musb_gadget_support. It was tested with the original Windows 2000 usbser.sys
Diffstat (limited to 'include')
-rwxr-xr-xinclude/configs/u8500.h33
-rwxr-xr-xinclude/usb/musb_udc.h119
2 files changed, 144 insertions, 8 deletions
diff --git a/include/configs/u8500.h b/include/configs/u8500.h
index 1a7b44945..b9aa3c835 100755
--- a/include/configs/u8500.h
+++ b/include/configs/u8500.h
@@ -32,9 +32,10 @@
#define CONFIG_U8500_ED 1
#define CONFIG_L2_OFF 1
-#define PCI_IO_VADDR 0xee000000
+// XXX: nomadik left over?
+// #define PCI_IO_VADDR 0xee000000
-#define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a)))
+// #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a)))
#define CONFIG_SYS_MEMTEST_START 0x00000000
#define CONFIG_SYS_MEMTEST_END 0x1FFFFFFF
@@ -49,7 +50,7 @@
#define CONFIG_MISC_INIT_R 1 /* call misc_init_r during start up */
#define BOARD_LATE_INIT 1
-#define LITTLEENDIAN
+#define LITTLEENDIAN /* XXX: obsoleted */
/*-----------------------------------------------------------------------
* Size of malloc() pool
@@ -100,6 +101,19 @@
#define CONFIG_BOOTARGS "cachepolicy=writealloc root=/dev/ram0 initrd=0x800000,20M init=linuxrc rw console=ttyAMA2,115200n8 mem=256M board_id=0"
#define CONFIG_BOOTCOMMAND "emmc_read 0x100000 0x280000 0x200000; bootm 0x100000"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "loadaddr=0x00100000\0" \
+ "console=ttyAMA2,115200n8\0" \
+ "loadbootscript=fatload mmc 0 ${loadaddr} boot.scr\0" \
+ "bootscript=echo Running bootscript from mmc ...; " \
+ "source ${loadaddr}\0" \
+ "loaduimage=fatload mmc 0 ${loadaddr} uImage\0" \
+ "usbtty=cdc_acm\0"\
+ "stdout=serial,usbtty\0" \
+ "stdin=serial,usbtty\0" \
+ "stderr=serial,usbtty\0"
+
+#define CONFIG_USB_TTY 1
#ifndef CONFIG_USB_TTY
#define CONFIG_PREBOOT "mmc init;mmc_read_cmd_file"
#endif
@@ -171,13 +185,16 @@
* USB related configs
*/
#define CONFIG_USB_BASE 0xA03E0000
+#define UDC_BASE 0xA03E0000
+#define CONFIG_USB_DEVICE 1
+#define CONFIG_MUSB 1 /* Enable USB driver */
#ifdef CONFIG_USB_TTY
-#define CONFIG_ARM
-#define CONFIG_USBTTY "cdc_acm"
-#define CONFIG_USB_DEVICE
-#define CONFIG_SYS_CONSOLE_IS_IN_ENV
-#define __LITTLE_ENDIAN 1
+#define CONFIG_USBTTY "cdc_acm" /* XXX: obsoleted */
+/* Allow console in serial and USB at the same time */
+#define CONFIG_CONSOLE_MUX 1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1
+#define __LITTLE_ENDIAN 1 /* XXX: not necessary, handled by buildsystem */
#define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
#endif
/*-----------------------------------------------------------------------
diff --git a/include/usb/musb_udc.h b/include/usb/musb_udc.h
new file mode 100755
index 000000000..c1cb99601
--- /dev/null
+++ b/include/usb/musb_udc.h
@@ -0,0 +1,119 @@
+/*
+ * (C) Copyright 2009 Texas Instruments Incorporated.
+ *
+ * Based on
+ * u-boot OMAP1510 USB drivers (include/usbdcore_omap1510.h)
+ *
+ * Author: Diego Dompe (diego.dompe@ridgerun.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __MUSB_UDC_H__
+#define __MUSB_UDC_H__
+
+/* USB Function Module Registers */
+
+/*
+ * UDC_BASE is defined for the specific silicon under soc
+ * specific cpu.h or related header.
+ */
+
+#define UDC_OFFSET(offset) (UDC_BASE+(offset))
+
+#define UDC_INTSRCR UDC_OFFSET(0x0A) /* USB Interrupt src reg */
+#define UDC_INTCLRR UDC_OFFSET(0x0A) /* USB Interrupt src clr reg */
+
+#define UDC_FADDR UDC_OFFSET(0x00)
+#define UDC_POWER UDC_OFFSET(0x01)
+#define UDC_INTRTX UDC_OFFSET(0x02)
+#define UDC_INTRRX UDC_OFFSET(0x04)
+#define UDC_INTRTXE UDC_OFFSET(0x06) /* Enable reg for INTRTX */
+#define UDC_INTRRXE UDC_OFFSET(0x08) /* Enable reg for INTRRX */
+#define UDC_INTRUSB UDC_OFFSET(0x0A)
+#define UDC_INTRUSBE UDC_OFFSET(0x0B)
+#define UDC_INDEX UDC_OFFSET(0x0E)
+#define UDC_TESTMODE UDC_OFFSET(0x0F)
+#define UDC_TXMAXP UDC_OFFSET(0x10)
+#define UDC_CSR0 UDC_OFFSET(0x12)
+#define UDC_TXCSR UDC_OFFSET(0x12)
+#define UDC_RXMAXP UDC_OFFSET(0x14)
+#define UDC_RXCSR UDC_OFFSET(0x16)
+#define UDC_COUNT0 UDC_OFFSET(0x18)
+#define UDC_RXCOUNT UDC_OFFSET(0x18)
+#define UDC_FIFO0 UDC_OFFSET(0x20)
+#define UDC_FIFO1 UDC_OFFSET(0x24)
+#define UDC_FIFO2 UDC_OFFSET(0x28)
+#define UDC_FIFO3 UDC_OFFSET(0x2C)
+#define UDC_FIFO4 UDC_OFFSET(0x30)
+#define UDC_FIFO5 UDC_OFFSET(0x34)
+#define UDC_FIFO6 UDC_OFFSET(0x38)
+#define UDC_FIFO7 UDC_OFFSET(0x3C)
+#define UDC_FIFO8 UDC_OFFSET(0x40)
+#define UDC_FIFO9 UDC_OFFSET(0x44)
+#define UDC_FIFO10 UDC_OFFSET(0x48)
+#define UDC_FIFO11 UDC_OFFSET(0x4C)
+#define UDC_FIFO12 UDC_OFFSET(0x50)
+#define UDC_FIFO13 UDC_OFFSET(0x54)
+#define UDC_FIFO14 UDC_OFFSET(0x58)
+#define UDC_FIFO15 UDC_OFFSET(0x5C)
+#define UDC_DEVCTL UDC_OFFSET(0x60)
+#define UDC_TXFIFOSZ UDC_OFFSET(0x62)
+#define UDC_RXFIFOSZ UDC_OFFSET(0x63)
+#define UDC_TXFIFOADDR UDC_OFFSET(0x64)
+#define UDC_RXFIFOADDR UDC_OFFSET(0x66)
+
+#define UDC_SYSCONFIG UDC_OFFSET(0x404)
+#define UDC_INTERFSEL UDC_OFFSET(0x40C)
+#define UDC_FORCESTDBY UDC_OFFSET(0x414)
+
+/* MUSB Endpoint parameters */
+#define EP0_MAX_PACKET_SIZE 64
+#define UDC_OUT_ENDPOINT 2 /* Device RX endpoint */
+#define UDC_OUT_PACKET_SIZE 512
+#define UDC_IN_ENDPOINT 3 /* Device TX endpoint */
+#define UDC_IN_PACKET_SIZE 512
+#define UDC_INT_ENDPOINT 1 /* Device Interrupt/Status endpoint */
+#define UDC_INT_PACKET_SIZE 16
+#define UDC_BULK_PACKET_SIZE 512
+
+#define UDC_MAX_FIFO_SIZE 16384
+
+#define DEV_CONFIG_VALUE 1 /* Only one i.e. CDC */
+
+void udc_irq(void);
+/* Flow control */
+void udc_set_nak(int epid);
+void udc_unset_nak(int epid);
+
+/* Higher level functions for abstracting away from specific device */
+int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
+
+int udc_init(void);
+
+void udc_enable(struct usb_device_instance *device);
+void udc_disable(void);
+
+void udc_connect(void);
+void udc_disconnect(void);
+
+void udc_startup_events(struct usb_device_instance *device);
+void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
+ struct usb_endpoint_instance *endpoint);
+
+/* platform specific initialization */
+int udc_musb_platform_init(void);
+
+#endif /* __MUSB_UDC_H__ */