r2763 - trunk/src/target/u-boot/patches
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Tue Aug 21 20:27:48 CEST 2007
Author: laforge
Date: 2007-08-21 20:27:23 +0200 (Tue, 21 Aug 2007)
New Revision: 2763
Modified:
trunk/src/target/u-boot/patches/cmd-unzip.patch
trunk/src/target/u-boot/patches/console-ansi.patch
trunk/src/target/u-boot/patches/enable-splash-bmp.patch
trunk/src/target/u-boot/patches/nand-dynamic_partitions.patch
trunk/src/target/u-boot/patches/neo1973-chargefast.patch
trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
trunk/src/target/u-boot/patches/uboot-20061030-qt2410.patch
trunk/src/target/u-boot/patches/uboot-cmd_s3c2410.patch
trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch
trunk/src/target/u-boot/patches/uboot-dfu.patch
trunk/src/target/u-boot/patches/uboot-gta02.patch
trunk/src/target/u-boot/patches/uboot-hxd8.patch
trunk/src/target/u-boot/patches/uboot-license.patch
trunk/src/target/u-boot/patches/uboot-mokoversion.patch
trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch
trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch
trunk/src/target/u-boot/patches/uboot-s3c2410_fb.patch
trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch
trunk/src/target/u-boot/patches/uboot-s3c2440.patch
trunk/src/target/u-boot/patches/uboot-s3c2443.patch
trunk/src/target/u-boot/patches/uboot-smdk2440.patch
trunk/src/target/u-boot/patches/uboot-smdk2443.patch
trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch
trunk/src/target/u-boot/patches/usbdcore-multiple_configs.patch
Log:
bring u-boot patches in sync with upstream git rev 99c2fdab91bc633e46fb41dbaa629f87ccf6e00f:
* use new CONFIG_CMD system (deprecate CFG_CMD)
* use new OHCI driver, where apropriate
* merge with mainline usbtty ACM code
Modified: trunk/src/target/u-boot/patches/cmd-unzip.patch
===================================================================
--- trunk/src/target/u-boot/patches/cmd-unzip.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/cmd-unzip.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -1,5 +1,5 @@
common/cmd_mem.c: new command "unzip srcaddr dstaddr [dstsize]" to unzip from
- memory to memory, and option CONFIG_UNZIP to enable it
+ memory to memory, and option CONFIG_CMD_UNZIP to enable it
- Werner Almesberger <werner at openmoko.org>
@@ -12,7 +12,7 @@
#endif /* CONFIG_CRC32_VERIFY */
+
-+#ifdef CONFIG_UNZIP
++#ifdef CONFIG_CMD_UNZIP
+int gunzip (void *, int, unsigned char *, unsigned long *);
+
+int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -36,23 +36,23 @@
+
+ return !!gunzip((void *) dst, dst_len, (void *) src, &src_len);
+}
-+#endif /* CONFIG_UNZIP */
++#endif /* CONFIG_CMD_UNZIP */
+
+
/**************************************************/
- #if (CONFIG_COMMANDS & CFG_CMD_MEMORY)
+ #if defined(CONFIG_CMD_MEMORY)
U_BOOT_CMD(
@@ -1251,5 +1279,13 @@ U_BOOT_CMD(
);
#endif /* CONFIG_MX_CYCLIC */
-+#ifdef CONFIG_UNZIP
++#ifdef CONFIG_CMD_UNZIP
+U_BOOT_CMD(
+ unzip, 4, 1, do_unzip,
+ "unzip - unzip a memory region\n",
+ "srcaddr dstaddr [dstsize]\n"
+);
-+#endif /* CONFIG_UNZIP */
++#endif /* CONFIG_CMD_UNZIP */
+
#endif
- #endif /* CFG_CMD_MEMORY */
+ #endif
Modified: trunk/src/target/u-boot/patches/console-ansi.patch
===================================================================
--- trunk/src/target/u-boot/patches/console-ansi.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/console-ansi.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -15,7 +15,7 @@
+#include <linux/ctype.h>
#include <devices.h>
#include <video_font.h>
- #ifdef CFG_CMD_DATE
+
@@ -676,10 +677,96 @@ static void console_newline (void)
/*****************************************************************************/
Modified: trunk/src/target/u-boot/patches/enable-splash-bmp.patch
===================================================================
--- trunk/src/target/u-boot/patches/enable-splash-bmp.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/enable-splash-bmp.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -11,11 +11,11 @@
--- u-boot.orig/drivers/cfb_console.c
+++ u-boot/drivers/cfb_console.c
@@ -191,6 +191,7 @@ CONFIG_VIDEO_HW_CURSOR: - Uses the
- #if (CONFIG_COMMANDS & CFG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
+ #if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
#include <watchdog.h>
#include <bmp_layout.h>
+#include <asm/byteorder.h>
- #endif /* (CONFIG_COMMANDS & CFG_CMD_BMP) || CONFIG_SPLASH_SCREEN */
+ #endif
/*****************************************************************************/
Index: u-boot/include/configs/neo1973_gta01.h
@@ -23,13 +23,13 @@
--- u-boot.orig/include/configs/neo1973_gta01.h
+++ u-boot/include/configs/neo1973_gta01.h
@@ -86,6 +86,7 @@
- /* CFG_CMD_IRQ | */ \
- CFG_CMD_BOOTD | \
- CFG_CMD_CONSOLE | \
-+ CFG_CMD_BMP | \
- CFG_CMD_ASKENV | \
- CFG_CMD_RUN | \
- CFG_CMD_ECHO | \
+ #define CONFIG_CMD_IRQ
+ #define CONFIG_CMD_BOOTD
+ #define CONFIG_CMD_CONSOLE
++#define CONFIG_CMD_BMP
+ #define CONFIG_CMD_ASKENV
+ #define CONFIG_CMD_RUN
+ #define CONFIG_CMD_ECHO
@@ -244,19 +245,21 @@
/* we have a board_late_init() function */
#define BOARD_LATE_INIT 1
Modified: trunk/src/target/u-boot/patches/nand-dynamic_partitions.patch
===================================================================
--- trunk/src/target/u-boot/patches/nand-dynamic_partitions.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/nand-dynamic_partitions.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -110,16 +110,15 @@
===================================================================
--- u-boot.orig/include/configs/neo1973_gta01.h
+++ u-boot/include/configs/neo1973_gta01.h
-@@ -99,7 +99,7 @@
- CFG_CMD_ELF | \
- CFG_CMD_MISC | \
- /* CFG_CMD_USB | */ \
-- /* CFG_CMD_JFFS2 | */ \
-+ CFG_CMD_JFFS2 | \
- CFG_CMD_DIAG | \
- /* CFG_CMD_HWFLOW | */ \
- CFG_CMD_SAVES | \
-@@ -212,13 +212,13 @@
+@@ -91,6 +91,7 @@
+ #define CONFIG_CMD_BSP
+ #define CONFIG_CMD_ELF
+ #define CONFIG_CMD_MISC
++#define CONFIG_CMD_JFFS2
+ #define CONFIG_CMD_DIAG
+ #define CONFIG_CMD_SAVES
+ #define CONFIG_CMD_NAND
+@@ -202,13 +203,13 @@
#define CONFIG_FAT 1
#define CONFIG_SUPPORT_VFAT
@@ -136,9 +135,9 @@
#endif
/* ATAG configuration */
-@@ -257,4 +257,9 @@
-
+@@ -248,4 +249,9 @@
#define CONFIG_DRIVER_PCF50606 1
+ #define CONFIG_RTC_PCF50606 1
+#define MTDIDS_DEFAULT "nand0=neo1973-nand"
+#define MTPARTS_DEFAULT "neo1973-nand:256k(u-boot),16k(u-boot_env),2M(kernel),640k(splash),-(jffs2)"
@@ -225,7 +224,7 @@
===================================================================
--- u-boot.orig/common/cmd_nand.c
+++ u-boot/common/cmd_nand.c
-@@ -101,7 +101,7 @@
+@@ -93,7 +93,7 @@
}
int
@@ -233,8 +232,8 @@
+arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong *size, int net)
{
int idx = nand_curr_device;
- #if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
-@@ -122,10 +122,17 @@
+ #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+@@ -114,10 +114,17 @@
printf("'%s' is not a number\n", argv[1]);
return -1;
}
@@ -255,7 +254,7 @@
}
idx = dev->id->num;
*nand = nand_info[idx];
-@@ -261,7 +268,7 @@
+@@ -253,7 +260,7 @@
printf("\nNAND %s: ", scrub ? "scrub" : "erase");
/* skip first two or three arguments, look for offset and size */
@@ -264,7 +263,7 @@
return 1;
memset(&opts, 0, sizeof(opts));
-@@ -323,7 +330,7 @@
+@@ -315,7 +322,7 @@
read = strncmp(cmd, "read", 4) == 0; /* 1 = read, 0 = write */
printf("\nNAND %s: ", read ? "read" : "write");
@@ -273,7 +272,7 @@
return 1;
s = strchr(cmd, '.');
-@@ -445,7 +452,7 @@
+@@ -437,7 +444,7 @@
}
if (strcmp(cmd, "unlock") == 0) {
@@ -311,7 +310,7 @@
===================================================================
--- u-boot.orig/board/qt2410/qt2410.c
+++ u-boot/board/qt2410/qt2410.c
-@@ -126,3 +126,9 @@
+@@ -150,3 +150,9 @@
return 0;
}
@@ -325,7 +324,7 @@
===================================================================
--- u-boot.orig/board/neo1973/gta01/gta01.c
+++ u-boot/board/neo1973/gta01/gta01.c
-@@ -429,3 +434,14 @@
+@@ -425,3 +425,14 @@
return 0;
}
@@ -344,7 +343,7 @@
===================================================================
--- u-boot.orig/include/configs/qt2410.h
+++ u-boot/include/configs/qt2410.h
-@@ -283,5 +283,7 @@
+@@ -278,5 +278,7 @@
#define MTDIDS_DEFAULT "nand0=qt2410-nand"
#define MTPARTS_DEFAULT "qt2410-nand:192k(u-boot),8k(u-boot_env),2M(kernel),2M(splash),-(jffs2)"
Modified: trunk/src/target/u-boot/patches/neo1973-chargefast.patch
===================================================================
--- trunk/src/target/u-boot/patches/neo1973-chargefast.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/neo1973-chargefast.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -2,7 +2,7 @@
===================================================================
--- u-boot.orig/drivers/usbtty.c
+++ u-boot/drivers/usbtty.c
-@@ -66,7 +66,7 @@
+@@ -53,7 +53,7 @@
/*
* Defines
*/
@@ -11,17 +11,17 @@
#define MAX_INTERFACES 2
#define NUM_ENDPOINTS 3
#define ACM_TX_ENDPOINT 3
-@@ -192,8 +192,7 @@
+@@ -179,8 +179,7 @@
#endif
.bConfigurationValue = 1,
.iConfiguration = STR_CONFIG,
-- .bmAttributes =
+- .bmAttributes =
- BMATTRIBUTE_SELF_POWERED|BMATTRIBUTE_RESERVED,
+ .bmAttributes = BMATTRIBUTE_RESERVED,
.bMaxPower = USBTTY_MAXPOWER
},
/* Interface 1 */
-@@ -294,6 +293,120 @@
+@@ -281,6 +280,120 @@
.func_dfu = DFU_FUNC_DESC,
#endif
},
@@ -139,20 +139,20 @@
+ * want to do DFU in the high-current charging mode for safety reasons */
+ },
+
- };
+ };
static struct rs232_emu rs232_desc={
-@@ -330,8 +443,7 @@
+@@ -317,8 +430,7 @@
.bNumInterfaces = NUM_GSERIAL_INTERFACES,
.bConfigurationValue = 1,
.iConfiguration = STR_CONFIG,
-- .bmAttributes =
+- .bmAttributes =
- BMATTRIBUTE_SELF_POWERED|BMATTRIBUTE_RESERVED,
+ .bmAttributes = BMATTRIBUTE_RESERVED,
.bMaxPower = USBTTY_MAXPOWER
},
.interface_desc = {
-@@ -384,6 +496,68 @@
+@@ -371,6 +483,68 @@
},
},
},
@@ -221,7 +221,7 @@
};
/*
-@@ -679,12 +853,14 @@
+@@ -674,12 +848,14 @@
bus_instance->maxpacketsize = 64;
bus_instance->serial_number_str = serial_number;
@@ -242,7 +242,7 @@
/* interface instance */
memset (interface_instance, 0,
-@@ -1043,9 +1219,17 @@
+@@ -962,9 +1138,17 @@
usbtty_configured_flag = 0;
break;
case DEVICE_CONFIGURED:
@@ -265,12 +265,12 @@
===================================================================
--- u-boot.orig/drivers/usbtty.h
+++ u-boot/drivers/usbtty.h
-@@ -60,7 +60,7 @@
+@@ -58,7 +58,7 @@
#define USBTTY_DEVICE_CLASS COMMUNICATIONS_DEVICE_CLASS
- #define USBTTY_BCD_DEVICE 0x00
--#define USBTTY_MAXPOWER 0x00
-+#define USBTTY_MAXPOWER 250 /* 500mA */
+ #define USBTTY_BCD_DEVICE 0x00
+-#define USBTTY_MAXPOWER 0x00
++#define USBTTY_MAXPOWER 250 /* 500mA */
#define STR_LANG 0x00
#define STR_MANUFACTURER 0x01
Modified: trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -8,7 +8,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -2032,6 +2032,14 @@
+@@ -2056,6 +2056,14 @@
sbc2410x_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
@@ -27,7 +27,7 @@
===================================================================
--- u-boot.orig/common/main.c
+++ u-boot/common/main.c
-@@ -61,6 +61,7 @@
+@@ -67,6 +67,7 @@
#undef DEBUG_PARSER
char console_buffer[CFG_CBSIZE]; /* console I/O buffer */
@@ -35,7 +35,7 @@
#ifndef CONFIG_CMDLINE_EDITING
static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen);
-@@ -376,7 +377,7 @@
+@@ -382,7 +383,7 @@
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
@@ -55,7 +55,7 @@
+ pcf50606.o \
pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \
rpx_pcmcia.o \
- fsl_i2c.o s3c2410_fb.o
+ fsl_i2c.o fsl_pci_init.o ati_radeon_fb.o s3c2410_fb.o
Index: u-boot/drivers/pcf50606.c
===================================================================
--- /dev/null
@@ -172,7 +172,7 @@
+ }
+}
+
-+#if defined(CONFIG_RTC_PCF50606) && (CONFIG_COMMANDS & CFG_CMD_DATE)
++#if defined(CONFIG_RTC_PCF50606) && defined(CONFIG_CMD_DATE)
+
+#include <rtc.h>
+
@@ -219,7 +219,7 @@
+{
+ /* FIXME */
+}
-+#endif /* CONFIG_RTC_PCF50606 && CFG_CMD_DATE */
++#endif /* CONFIG_RTC_PCF50606 && CONFIG_CMD_DATE */
+
+#endif /* CONFIG DRIVER_PCF50606 */
Index: u-boot/include/pcf50606.h
@@ -540,7 +540,7 @@
+
+DECLARE_GLOBAL_DATA_PTR;
+
-+#if (CONFIG_COMMANDS & CFG_CMD_BDI)
++#if defined(CONFIG_CMD_BDI)
+
+int do_neo1973 ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
@@ -603,7 +603,7 @@
+ "neo1973 backlight (on|off) - switch backlight on or off\n"
+ "neo1973 vibrator (on|off) - switch vibrator on or off\n"
+);
-+#endif /* CFG_CMD_BDI */
++#endif /* CONFIG_CMD_BDI */
Index: u-boot/board/neo1973/common/jbt6k74.c
===================================================================
--- /dev/null
@@ -1992,7 +1992,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/configs/neo1973_gta01.h
-@@ -0,0 +1,261 @@
+@@ -0,0 +1,253 @@
+/*
+ * (C) Copyright 2006 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -2071,41 +2071,33 @@
+/***********************************************************
+ * Command definition
+ ***********************************************************/
-+#define CONFIG_COMMANDS (\
-+ CFG_CMD_BDI | \
-+ CFG_CMD_LOADS | \
-+ CFG_CMD_LAODB | \
-+ CFG_CMD_IMI | \
-+ CFG_CMD_CACHE | \
-+ CFG_CMD_MEMORY | \
-+ CFG_CMD_ENV | \
-+ /* CFG_CMD_IRQ | */ \
-+ CFG_CMD_BOOTD | \
-+ CFG_CMD_CONSOLE | \
-+ CFG_CMD_ASKENV | \
-+ CFG_CMD_RUN | \
-+ CFG_CMD_ECHO | \
-+ CFG_CMD_I2C | \
-+ CFG_CMD_REGINFO | \
-+ CFG_CMD_IMMAP | \
-+ CFG_CMD_DATE | \
-+ CFG_CMD_AUTOSCRIPT | \
-+ CFG_CMD_BSP | \
-+ CFG_CMD_ELF | \
-+ CFG_CMD_MISC | \
-+ /* CFG_CMD_USB | */ \
-+ /* CFG_CMD_JFFS2 | */ \
-+ CFG_CMD_DIAG | \
-+ /* CFG_CMD_HWFLOW | */ \
-+ CFG_CMD_SAVES | \
-+ CFG_CMD_NAND | \
-+ CFG_CMD_PORTIO | \
-+ CFG_CMD_MMC | \
-+ CFG_CMD_FAT | \
-+ CFG_CMD_EXT2 | \
-+ 0)
-+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-+#include <cmd_confdefs.h>
++#define CONFIG_CMD_BDI
++#define CONFIG_CMD_LOADS
++#define CONFIG_CMD_LOADB
++#define CONFIG_CMD_IMI
++#define CONFIG_CMD_CACHE
++#define CONFIG_CMD_MEMORY
++#define CONFIG_CMD_ENV
++#define CONFIG_CMD_BOOTD
++#define CONFIG_CMD_CONSOLE
++#define CONFIG_CMD_ASKENV
++#define CONFIG_CMD_RUN
++#define CONFIG_CMD_ECHO
++#define CONFIG_CMD_I2C
++#define CONFIG_CMD_REGINFO
++#define CONFIG_CMD_IMMAP
++#define CONFIG_CMD_DATE
++#define CONFIG_CMD_AUTOSCRIPT
++#define CONFIG_CMD_BSP
++#define CONFIG_CMD_ELF
++#define CONFIG_CMD_MISC
++#define CONFIG_CMD_DIAG
++#define CONFIG_CMD_SAVES
++#define CONFIG_CMD_NAND
++#define CONFIG_CMD_PORTIO
++#define CONFIG_CMD_MMC
++#define CONFIG_CMD_FAT
++#define CONFIG_CMD_EXT2
+
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTARGS "rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8"
@@ -2113,7 +2105,7 @@
+
+#define CONFIG_DOS_PARTITION 1
+
-+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
+/* what's this ? it's not used anywhere */
+#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
Modified: trunk/src/target/u-boot/patches/uboot-20061030-qt2410.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-20061030-qt2410.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-20061030-qt2410.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -7,7 +7,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -2009,6 +2009,9 @@
+@@ -2056,6 +2056,9 @@
sbc2410x_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
@@ -943,7 +943,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/configs/qt2410.h
-@@ -0,0 +1,287 @@
+@@ -0,0 +1,279 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
@@ -1036,40 +1036,35 @@
+/***********************************************************
+ * Command definition
+ ***********************************************************/
-+#define CONFIG_COMMANDS (\
-+ CFG_CMD_BDI | \
-+ CFG_CMD_LOADS | \
-+ CFG_CMD_LOADB | \
-+ CFG_CMD_IMI | \
-+ CFG_CMD_CACHE | \
-+ CFG_CMD_MEMORY | \
-+ CFG_CMD_ENV | \
-+ /* CFG_CMD_IRQ | */ \
-+ CFG_CMD_BOOTD | \
-+ CFG_CMD_CONSOLE | \
-+ CFG_CMD_BMP | \
-+ CFG_CMD_ASKENV | \
-+ CFG_CMD_RUN | \
-+ CFG_CMD_ECHO | \
-+ CFG_CMD_I2C | \
-+ CFG_CMD_REGINFO | \
-+ CFG_CMD_IMMAP | \
-+ CFG_CMD_DATE | \
-+ CFG_CMD_AUTOSCRIPT | \
-+ CFG_CMD_BSP | \
-+ CFG_CMD_ELF | \
-+ CFG_CMD_MISC | \
-+ /* CFG_CMD_USB | */ \
-+ CFG_CMD_JFFS2 | \
-+ CFG_CMD_DIAG | \
-+ CFG_CMD_HWFLOW | \
-+ CFG_CMD_SAVES | \
-+ CFG_CMD_NAND | \
-+ CFG_CMD_PORTIO | \
-+ CFG_CMD_MMC | \
-+ CFG_CMD_FAT | \
-+ CFG_CMD_EXT2 | \
-+ 0)
++#define CONFIG_CMD_BDI
++#define CONFIG_CMD_LOADS
++#define CONFIG_CMD_LOADB
++#define CONFIG_CMD_IMI
++#define CONFIG_CMD_CACHE
++#define CONFIG_CMD_ENV
++#define CONFIG_CMD_BOOTD
++#define CONFIG_CMD_CONSOLE
++#define CONFIG_CMD_BPM
++#define CONFIG_CMD_ASKENV
++#define CONFIG_CMD_RUN
++#define CONFIG_CMD_ECHO
++#define CONFIG_CMD_I2C
++#define CONFIG_CMD_REGINFO
++#define CONFIG_CMD_IMMAP
++#define CONFIG_CMD_DATE
++#define CONFIG_CMD_AUTOSCRIPT
++#define CONFIG_CMD_BSP
++#define CONFIG_CMD_ELF
++#define CONFIG_CMD_MISC
++#define CONFIG_CMD_JFFS2
++#define CONFIG_CMD_DIAG
++#define CONFIG_CMD_HWFLOW
++#define CONFIG_CMD_SAVES
++#define CONFIG_CMD_NAND
++#define CONFIG_CMD_PORTIO
++#define CONFIG_CMD_MMC
++#define CONFIG_CMD_FAT
++#define CONFIG_CMD_EXT2
+
+#if 0
+ CFG_CMD_DHCP | \
@@ -1078,9 +1073,6 @@
+
+#endif
+
-+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-+#include <cmd_confdefs.h>
-+
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTARGS "rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8"
+#define CONFIG_ETHADDR 01:ab:cd:ef:fe:dc
@@ -1092,7 +1084,7 @@
+
+#define CONFIG_DOS_PARTITION 1
+
-+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
+/* what's this ? it's not used anywhere */
+#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
Modified: trunk/src/target/u-boot/patches/uboot-cmd_s3c2410.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-cmd_s3c2410.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-cmd_s3c2410.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -5,21 +5,21 @@
Index: u-boot/cpu/arm920t/s3c24x0/Makefile
===================================================================
---- u-boot.orig/cpu/arm920t/s3c24x0/Makefile 2007-02-24 15:14:00.000000000 +0100
-+++ u-boot/cpu/arm920t/s3c24x0/Makefile 2007-02-24 15:21:02.000000000 +0100
+--- u-boot.orig/cpu/arm920t/s3c24x0/Makefile
++++ u-boot/cpu/arm920t/s3c24x0/Makefile
@@ -26,7 +26,7 @@
LIB = $(obj)lib$(SOC).a
COBJS = i2c.o interrupts.o serial.o speed.o \
-- usb_ohci.o nand_read.o nand.o
-+ usb_ohci.o nand_read.o nand.o cmd_s3c2410.o
+- usb.o nand_read.o nand.o
++ usb.o nand_read.o nand.o cmd_s3c2410.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
Index: u-boot/cpu/arm920t/s3c24x0/cmd_s3c2410.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/cpu/arm920t/s3c24x0/cmd_s3c2410.c 2007-02-24 15:22:17.000000000 +0100
+--- /dev/null
++++ u-boot/cpu/arm920t/s3c24x0/cmd_s3c2410.c
@@ -0,0 +1,152 @@
+/*
+ * (C) Copyright 2006 by OpenMoko, Inc.
@@ -54,7 +54,7 @@
+
+DECLARE_GLOBAL_DATA_PTR;
+
-+#if (CONFIG_COMMANDS & CFG_CMD_BDI)
++#if defined(CONFIG_CMD_BDI)
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define MHZ 1000000
Modified: trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-cramfs_but_no_jffs2.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -10,8 +10,8 @@
#include <common.h>
#include <malloc.h>
--#if (CONFIG_COMMANDS & CFG_CMD_JFFS2)
-+#if (CONFIG_COMMANDS & CFG_CMD_CRAMFS)
+-#if defined(CONFIG_CMD_JFFS2)
++#if defined(CONFIG_CMD_CRAMFS)
#include <asm/byteorder.h>
#include <linux/stat.h>
@@ -23,7 +23,7 @@
static struct mtd_device *current_dev = NULL;
static u8 current_partnum = 0;
-+#ifdef CFG_CMD_CRAMFS
++#if defined(CONFIG_CMD_CRAMFS)
extern int cramfs_check (struct part_info *info);
extern int cramfs_load (char *loadoffset, struct part_info *info, char *filename);
extern int cramfs_ls (struct part_info *info, char *filename);
Modified: trunk/src/target/u-boot/patches/uboot-dfu.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-dfu.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-dfu.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -2,7 +2,7 @@
===================================================================
--- u-boot.orig/drivers/usbdcore_ep0.c
+++ u-boot/drivers/usbdcore_ep0.c
-@@ -42,10 +42,15 @@
+@@ -51,10 +51,15 @@
*/
#include <common.h>
@@ -18,18 +18,9 @@
#if 0
#define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: "fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args)
#else
-@@ -213,7 +218,7 @@
- urb->buffer = device_descriptor;
- urb->actual_length = MIN(sizeof(*device_descriptor), max);
- }
-- /*dbg_ep0(3, "copied device configuration, actual_length: %x", urb->actual_length); */
-+ dbg_ep0(3, "using device configuration, actual_length: %x", urb->actual_length);
- break;
-
- case USB_DESCRIPTOR_TYPE_CONFIGURATION:
-@@ -267,7 +272,24 @@
- return -1;
+@@ -273,7 +278,24 @@
case USB_DESCRIPTOR_TYPE_ENDPOINT:
+ serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
return -1;
+ /* This really means "Class Specific Descriptor #1 == USB_DT_DFU */
case USB_DESCRIPTOR_TYPE_HID:
@@ -50,9 +41,9 @@
+ }
+#else /* CONFIG_USBD_DFU */
{
+ serial_printf("USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
return -1; /* unsupported at this time */
- #if 0
-@@ -294,6 +316,7 @@
+@@ -301,6 +323,7 @@
max);
#endif
}
@@ -60,7 +51,7 @@
break;
case USB_DESCRIPTOR_TYPE_REPORT:
{
-@@ -388,6 +411,24 @@
+@@ -403,6 +426,24 @@
le16_to_cpu (request->wLength),
USBD_DEVICE_REQUESTS (request->bRequest));
@@ -84,8 +75,8 @@
+
/* handle USB Standard Request (c.f. USB Spec table 9-2) */
if ((request->bmRequestType & USB_REQ_TYPE_MASK) != 0) {
- if (device->device_state <= STATE_CONFIGURED)
-@@ -570,7 +611,8 @@
+ if(device->device_state <= STATE_CONFIGURED){
+@@ -590,7 +631,8 @@
device->interface = le16_to_cpu (request->wIndex);
device->alternate = le16_to_cpu (request->wValue);
/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
@@ -1173,15 +1164,15 @@
===================================================================
--- u-boot.orig/drivers/Makefile
+++ u-boot/drivers/Makefile
-@@ -47,7 +47,7 @@
- status_led.o sym53c8xx.o systemace.o ahci.o \
+@@ -48,7 +48,7 @@
ti_pci1410a.o tigon3.o tsec.o \
tsi108_eth.o tsi108_i2c.o tsi108_pci.o \
-- usbdcore.o usbdcore_ep0.o usbdcore_omap1510.o usbdcore_s3c2410.o usbtty.o \
-+ usbdcore.o usbdfu.o usbdcore_ep0.o usbdcore_omap1510.o usbdcore_s3c2410.o usbtty.o \
+ usb_ohci.o \
+- usbdcore.o usbdcore_ep0.o usbdcore_mpc8xx.o usbdcore_omap1510.o usbdcore_s3c2410.o \
++ usbdcore.o usbdfu.o usbdcore_ep0.o usbdcore_mpc8xx.o usbdcore_omap1510.o usbdcore_s3c2410.o \
+ usbtty.o \
videomodes.o w83c553f.o \
ks8695eth.o \
- pcf50606.o \
Index: u-boot/drivers/usbdcore.c
===================================================================
--- u-boot.orig/drivers/usbdcore.c
@@ -1242,7 +1233,7 @@
===================================================================
--- u-boot.orig/drivers/usbtty.c
+++ u-boot/drivers/usbtty.c
-@@ -31,6 +31,8 @@
+@@ -30,6 +30,8 @@
#include "usbtty.h"
#include "usb_cdc_acm.h"
#include "usbdescriptors.h"
@@ -1251,7 +1242,7 @@
#include <config.h> /* If defined, override Linux identifiers with
* vendor specific ones */
-@@ -118,7 +120,7 @@
+@@ -105,7 +107,7 @@
static unsigned short rx_endpoint = 0;
static unsigned short tx_endpoint = 0;
static unsigned short interface_count = 0;
@@ -1260,9 +1251,9 @@
/* USB Descriptor Strings */
static u8 wstrLang[4] = {4,USB_DT_STRING,0x9,0x4};
-@@ -169,6 +171,10 @@
+@@ -156,6 +158,10 @@
struct usb_interface_descriptor data_class_interface;
- struct usb_endpoint_descriptor
+ struct usb_endpoint_descriptor
data_endpoints[NUM_ENDPOINTS-1] __attribute__((packed));
+#ifdef CONFIG_USBD_DFU
+ struct usb_interface_descriptor uif_dfu;
@@ -1271,9 +1262,9 @@
} __attribute__((packed));
static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
-@@ -179,7 +185,11 @@
+@@ -166,7 +172,11 @@
.bDescriptorType = USB_DT_CONFIG,
- .wTotalLength =
+ .wTotalLength =
cpu_to_le16(sizeof(struct acm_config_desc)),
+#ifdef CONFIG_USBD_DFU
+ .bNumInterfaces = NUM_ACM_INTERFACES +1,
@@ -1282,8 +1273,8 @@
+#endif
.bConfigurationValue = 1,
.iConfiguration = STR_CONFIG,
- .bmAttributes =
-@@ -278,6 +288,11 @@
+ .bmAttributes =
+@@ -265,6 +275,11 @@
.bInterval = 0xFF,
},
},
@@ -1293,9 +1284,9 @@
+ .func_dfu = DFU_FUNC_DESC,
+#endif
},
- };
+ };
-@@ -390,7 +405,7 @@
+@@ -377,7 +392,7 @@
void usbtty_poll (void);
/* utility function for converting char* to wide string used by USB */
@@ -1304,7 +1295,7 @@
{
int i;
for (i = 0; i < strlen (str) && str[i]; i++){
-@@ -652,6 +667,9 @@
+@@ -647,6 +662,9 @@
device_instance->bus = bus_instance;
device_instance->configurations = NUM_CONFIGS;
device_instance->configuration_instance_array = config_instance;
@@ -1318,7 +1309,7 @@
===================================================================
--- u-boot.orig/include/configs/neo1973_gta01.h
+++ u-boot/include/configs/neo1973_gta01.h
-@@ -164,7 +164,7 @@
+@@ -157,7 +157,7 @@
*/
#define CONFIG_STACKSIZE (128*1024) /* regular stack */
#ifdef CONFIG_USE_IRQ
@@ -1327,7 +1318,7 @@
#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
#endif
-@@ -181,6 +181,10 @@
+@@ -174,6 +174,10 @@
#define CONFIG_USBD_MANUFACTURER "OpenMoko, Inc"
#define CONFIG_USBD_PRODUCT_NAME "Neo1973 Bootloader " U_BOOT_VERSION
#define CONFIG_EXTRA_ENV_SETTINGS "usbtty=cdc_acm\0"
@@ -1591,7 +1582,7 @@
===================================================================
--- u-boot.orig/drivers/usbtty.h
+++ u-boot/drivers/usbtty.h
-@@ -71,4 +71,10 @@
+@@ -69,4 +69,10 @@
#define STR_CTRL_INTERFACE 0x06
#define STR_COUNT 0x07
@@ -1606,7 +1597,7 @@
===================================================================
--- u-boot.orig/include/configs/qt2410.h
+++ u-boot/include/configs/qt2410.h
-@@ -199,7 +199,8 @@
+@@ -191,7 +191,8 @@
#define CONFIG_USBD_PRODUCT_NAME "QT2410 Bootloader " U_BOOT_VERSION
#define CONFIG_EXTRA_ENV_SETTINGS "usbtty=cdc_acm\0"
#define CONFIG_USBD_DFU 1
@@ -2003,7 +1994,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -260,6 +260,12 @@
+@@ -262,6 +262,12 @@
$(obj)u-boot.bin: $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
Modified: trunk/src/target/u-boot/patches/uboot-gta02.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-gta02.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-gta02.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -4,7 +4,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -2038,6 +2038,10 @@
+@@ -2064,6 +2064,10 @@
sbc2410x_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
@@ -557,42 +557,38 @@
+/***********************************************************
+ * Command definition
+ ***********************************************************/
-+#define CONFIG_COMMANDS (\
-+ CFG_CMD_BDI | \
-+ CFG_CMD_LOADS | \
-+ CFG_CMD_LAODB | \
-+ CFG_CMD_IMI | \
-+ CFG_CMD_CACHE | \
-+ CFG_CMD_MEMORY | \
-+ CFG_CMD_ENV | \
++#define CONFIG_CMD_BDI
++#define CONFIG_CMD_LOADS
++#define CONFIG_CMD_LOADB
++#define CONFIG_CMD_IMI
++#define CONFIG_CMD_CACHE
++#define CONFIG_CMD_MEMORY
++#define CONFIG_CMD_ENV
+ /* CFG_CMD_IRQ | */ \
-+ CFG_CMD_BOOTD | \
-+ CFG_CMD_CONSOLE | \
++#define CONFIG_CMD_BOOTD
++#define CONFIG_CMD_CONSOLE
+ /* CFG_CMD_BMP | */ \
-+ CFG_CMD_ASKENV | \
-+ CFG_CMD_RUN | \
-+ CFG_CMD_ECHO | \
-+ CFG_CMD_I2C | \
-+ CFG_CMD_REGINFO | \
-+ CFG_CMD_IMMAP | \
-+ CFG_CMD_DATE | \
-+ CFG_CMD_AUTOSCRIPT | \
-+ CFG_CMD_BSP | \
-+ CFG_CMD_ELF | \
-+ CFG_CMD_MISC | \
++#define CONFIG_CMD_ASKENV
++#define CONFIG_CMD_RUN
++#define CONFIG_CMD_ECHO
++#define CONFIG_CMD_I2C
++#define CONFIG_CMD_REGINFO
++#define CONFIG_CMD_IMMAP
++#define CONFIG_CMD_DATE
++#define CONFIG_CMD_AUTOSCRIPT
++#define CONFIG_CMD_BSP
++#define CONFIG_CMD_ELF
++#define CONFIG_CMD_MISC
+ /* CFG_CMD_USB | */ \
-+ CFG_CMD_JFFS2 | \
-+ CFG_CMD_DIAG | \
++#define CONFIG_CMD_JFFS2
++#define CONFIG_CMD_DIAG
+ /* CFG_CMD_HWFLOW | */ \
-+ CFG_CMD_SAVES | \
-+ CFG_CMD_NAND | \
-+ CFG_CMD_PORTIO | \
-+ CFG_CMD_MMC | \
-+ CFG_CMD_FAT | \
-+ CFG_CMD_EXT2 | \
-+ 0)
-+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-+#include <cmd_confdefs.h>
++#define CONFIG_CMD_SAVES
++#define CONFIG_CMD_NAND
++#define CONFIG_CMD_PORTIO
++#define CONFIG_CMD_MMC
++#define CONFIG_CMD_FAT
++#define CONFIG_CMD_EXT2
+
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTARGS ""
@@ -600,7 +596,7 @@
+
+#define CONFIG_DOS_PARTITION 1
+
-+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
+/* what's this ? it's not used anywhere */
+#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
@@ -646,7 +642,11 @@
+#endif
+
+#if 0
-+#define CONFIG_USB_OHCI 1
++#define CONFIG_USB_OHCI_NEW 1
++#define CFG_USB_OHCI_CPU_INIT 1
++#define CFG_USB_OHCI_REGS_BASE 0x49000000 /* S3C24X0_USB_HOST_BASE */
++#define CFG_USB_OHCI_SLOT_NAME "s3c2440"
++#define CFG_USB_OHCI_MAX_ROOT_PORTS 2
+#endif
+
+#define CONFIG_USB_DEVICE 1
@@ -1183,7 +1183,7 @@
+ return pcf50633_reg_set_bit_mask(PCF50633_REG_MBCC7, 0x03, val);
+}
+
-+#if defined(CONFIG_RTC_PCF50633) && (CONFIG_COMMANDS & CFG_CMD_DATE)
++#if defined(CONFIG_RTC_PCF50633) && defined(CONFIG_CMD_DATE)
+
+#include <rtc.h>
+
@@ -1230,7 +1230,7 @@
+{
+ /* FIXME */
+}
-+#endif /* CONFIG_RTC_PCF50633 && CFG_CMD_DATE */
++#endif /* CONFIG_RTC_PCF50633 && CONFIG_CMD_DATE */
+
+
+#endif /* CONFIG DRIVER_PCF50633 */
@@ -1618,16 +1618,16 @@
===================================================================
--- u-boot.orig/drivers/Makefile
+++ u-boot/drivers/Makefile
-@@ -50,10 +50,10 @@
- usbdcore.o usbdfu.o usbdcore_ep0.o usbdcore_omap1510.o usbdcore_s3c2410.o usbtty.o \
+@@ -52,10 +52,10 @@
+ usbtty.o \
videomodes.o w83c553f.o \
ks8695eth.o \
- pcf50606.o \
+ pcf50606.o pcf50633.o \
pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \
rpx_pcmcia.o \
-- fsl_i2c.o s3c2410_fb.o
-+ fsl_i2c.o s3c2410_fb.o smedia3362.o
+- fsl_i2c.o fsl_pci_init.o ati_radeon_fb.o s3c2410_fb.o
++ fsl_i2c.o fsl_pci_init.o ati_radeon_fb.o s3c2410_fb.o smedia3362.o
SRCS := $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
@@ -1635,7 +1635,7 @@
===================================================================
--- u-boot.orig/common/cmd_nand.c
+++ u-boot/common/cmd_nand.c
-@@ -208,8 +208,10 @@
+@@ -200,8 +200,10 @@
putc('\n');
for (i = 0; i < CFG_MAX_NAND_DEVICE; i++) {
if (nand_info[i].name)
Modified: trunk/src/target/u-boot/patches/uboot-hxd8.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-hxd8.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-hxd8.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -4,7 +4,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -2049,6 +2049,9 @@
+@@ -2075,6 +2075,9 @@
qt2410_config : unconfig
@./mkconfig $(@:_config=) arm arm920t qt2410 NULL s3c24x0
@@ -458,7 +458,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/configs/hxd8.h
-@@ -0,0 +1,277 @@
+@@ -0,0 +1,278 @@
+/*
+ * (C) Copyright 2007 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -539,50 +539,47 @@
+/***********************************************************
+ * Command definition
+ ***********************************************************/
-+#define CONFIG_COMMANDS (\
-+ CFG_CMD_BDI | \
-+ CFG_CMD_LOADS | \
-+ CFG_CMD_LAODB | \
-+ CFG_CMD_IMI | \
-+ CFG_CMD_CACHE | \
-+ CFG_CMD_MEMORY | \
-+ CFG_CMD_ENV | \
-+ /* CFG_CMD_IRQ | */ \
-+ CFG_CMD_BOOTD | \
-+ CFG_CMD_CONSOLE | \
-+ /* CFG_CMD_BMP | */ \
-+ CFG_CMD_ASKENV | \
-+ CFG_CMD_RUN | \
-+ CFG_CMD_ECHO | \
-+ CFG_CMD_I2C | \
-+ CFG_CMD_REGINFO | \
-+ CFG_CMD_IMMAP | \
-+ CFG_CMD_DATE | \
-+ CFG_CMD_AUTOSCRIPT | \
-+ CFG_CMD_BSP | \
-+ CFG_CMD_ELF | \
-+ CFG_CMD_MISC | \
-+ /* CFG_CMD_USB | */ \
-+ CFG_CMD_JFFS2 | \
-+ CFG_CMD_DIAG | \
-+ /* CFG_CMD_HWFLOW | */ \
-+ CFG_CMD_SAVES | \
-+ CFG_CMD_NAND | \
-+ CFG_CMD_PORTIO | \
-+ CFG_CMD_MMC | \
-+ CFG_CMD_FAT | \
-+ CFG_CMD_EXT2 | \
-+ 0)
-+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-+#include <cmd_confdefs.h>
+
++#define CONFIG_CMD_BDI
++#define CONFIG_CMD_LOADS
++#define CONFIG_CMD_LOADB
++#define CONFIG_CMD_IMI
++#define CONFIG_CMD_CACHE
++#define CONFIG_CMD_MEMORY
++#define CONFIG_CMD_ENV
++ /* CFG_CMD_IRQ | */
++#define CONFIG_CMD_BOOTD
++#define CONFIG_CMD_CONSOLE
++ /* CFG_CMD_BMP | */
++#define CONFIG_CMD_ASKENV
++#define CONFIG_CMD_RUN
++#define CONFIG_CMD_ECHO
++#define CONFIG_CMD_I2C
++#define CONFIG_CMD_REGINFO
++#define CONFIG_CMD_IMMAP
++#define CONFIG_CMD_DATE
++#define CONFIG_CMD_AUTOSCRIPT
++#define CONFIG_CMD_BSP
++#define CONFIG_CMD_ELF
++#define CONFIG_CMD_MISC
++ /* CFG_CMD_USB | */
++#define CONFIG_CMD_JFFS2
++#define CONFIG_CMD_DIAG
++ /* CFG_CMD_HWFLOW | */
++#define CONFIG_CMD_SAVES
++#define CONFIG_CMD_NAND
++#define CONFIG_CMD_PORTIO
++#define CONFIG_CMD_MMC
++#define CONFIG_CMD_FAT
++#define CONFIG_CMD_EXT2
++
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTARGS ""
+#define CONFIG_BOOTCOMMAND "setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000"
+
+#define CONFIG_DOS_PARTITION 1
+
-+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
+/* what's this ? it's not used anywhere */
+#define CONFIG_KGDB_SER_INDEX 3 /* which serial port to use */
@@ -624,7 +621,11 @@
+#endif
+
+#if 0
-+#define CONFIG_USB_OHCI 1
++#define CONFIG_USB_OHCI_NEW 1
++#define CFG_USB_OHCI_CPU_INIT 1
++#define CFG_USB_OHCI_REGS_BASE 0x49000000 /* S3C24X0_USB_HOST_BASE */
++#define CFG_USB_OHCI_SLOT_NAME "s3c2440"
++#define CFG_USB_OHCI_MAX_ROOT_PORTS 2
+#endif
+
+#if 1
Modified: trunk/src/target/u-boot/patches/uboot-license.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-license.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-license.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -41,7 +41,7 @@
+
+#include <common.h>
+
-+#if (CONFIG_COMMANDS & CFG_CMD_LICENSE)
++#if defined(CONFIG_CMD_LICENSE)
+
+#define LICENSE_MAX 20480
+#include <command.h>
@@ -72,24 +72,12 @@
+ "license - print GPL license text\n",
+ NULL);
+
-+#endif /* CFG_CMD_LICENSE */
-Index: u-boot/include/cmd_confdefs.h
-===================================================================
---- u-boot.orig/include/cmd_confdefs.h
-+++ u-boot/include/cmd_confdefs.h
-@@ -75,6 +75,7 @@
- #define CFG_CMD_FPGA 0x0000010000000000ULL /* FPGA configuration Support */
- #define CFG_CMD_HWFLOW 0x0000020000000000ULL /* RTS/CTS hw flow control */
- #define CFG_CMD_SAVES 0x0000040000000000ULL /* save S record dump */
-+#define CFG_CMD_LICENSE 0x0000080000000000ULL /* Display GPL License */
- #define CFG_CMD_SPI 0x0000100000000000ULL /* SPI utility */
- #define CFG_CMD_FDOS 0x0000200000000000ULL /* Floppy DOS support */
- #define CFG_CMD_VFD 0x0000400000000000ULL /* VFD support (TRAB) */
++#endif /* CONFIG_CMD_LICENSE */
Index: u-boot/include/license.h
===================================================================
--- /dev/null
+++ u-boot/include/license.h
-@@ -0,0 +1,584 @@
+@@ -0,0 +1,583 @@
+/* bin2header converting 'gpl.gz' */
+unsigned char gpl_gz[] = {
+ 0x1f, 0x8b, 0x08, 0x08, 0xb2, 0x10, 0x0d, 0x46, 0x00, 0x03,
@@ -672,41 +660,52 @@
+ 0xb1, 0x30, 0x9f, 0x78, 0x9d, 0xdc, 0x7b, 0x0a, 0x5e, 0x8f,
+ 0xed, 0x4e, 0x3f, 0xa2, 0x44, 0x9f, 0x3f, 0xb3, 0xbd, 0x6f,
+ 0xfe, 0x17, 0x84, 0xf3, 0x1b, 0xef, 0x12, 0x3b, 0x00, 0x00,
-+
+};
Index: u-boot/include/configs/neo1973_gta01.h
===================================================================
--- u-boot.orig/include/configs/neo1973_gta01.h
+++ u-boot/include/configs/neo1973_gta01.h
-@@ -110,6 +110,7 @@
- CFG_CMD_MMC | \
- CFG_CMD_FAT | \
- CFG_CMD_EXT2 | \
-+ CFG_CMD_LICENSE | \
- 0)
- /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
- #include <cmd_confdefs.h>
+@@ -101,6 +101,7 @@
+ #define CONFIG_CMD_MMC
+ #define CONFIG_CMD_FAT
+ #define CONFIG_CMD_EXT2
++#define CONFIG_CMD_LICENSE
+
+ #define CONFIG_BOOTDELAY 3
+ #define CONFIG_BOOTARGS ""
Index: u-boot/include/configs/hxd8.h
===================================================================
--- u-boot.orig/include/configs/hxd8.h
+++ u-boot/include/configs/hxd8.h
-@@ -110,6 +110,7 @@
- CFG_CMD_MMC | \
- CFG_CMD_FAT | \
- CFG_CMD_EXT2 | \
-+ CFG_CMD_LICENSE | \
- 0)
- /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
- #include <cmd_confdefs.h>
+@@ -111,6 +111,7 @@
+ #define CONFIG_CMD_MMC
+ #define CONFIG_CMD_FAT
+ #define CONFIG_CMD_EXT2
++#define CONFIG_CMD_LICENSE
+
+ #define CONFIG_BOOTDELAY 3
+ #define CONFIG_BOOTARGS ""
Index: u-boot/include/configs/smdk2440.h
===================================================================
--- u-boot.orig/include/configs/smdk2440.h
+++ u-boot/include/configs/smdk2440.h
-@@ -110,6 +110,7 @@
- CFG_CMD_PORTIO | \
- CFG_CMD_REGINFO | \
- CFG_CMD_SAVES | \
-+ CFG_CMD_LICENSE | \
- CFG_CMD_USB)
+@@ -106,6 +106,7 @@
+ #define CONFIG_CMD_REGINFO
+ #define CONFIG_CMD_SAVES
+ #define CONFIG_CMD_USB
++#define CONFIG_CMD_LICENSE
- /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
+ #define CONFIG_BOOTDELAY 3
+ #define CONFIG_BOOTARGS "root=/dev/mtdblock4 rootfstype=jffs2 console=ttySAC2,115200 loglevel=8"
+Index: u-boot/include/config_cmd_all.h
+===================================================================
+--- u-boot.orig/include/config_cmd_all.h
++++ u-boot/include/config_cmd_all.h
+@@ -49,6 +49,7 @@
+ #define CONFIG_CMD_ITEST /* Integer (and string) test */
+ #define CONFIG_CMD_JFFS2 /* JFFS2 Support */
+ #define CONFIG_CMD_KGDB /* kgdb */
++#define CONFIG_CMD_LICENSE /* console license display */
+ #define CONFIG_CMD_LOADB /* loadb */
+ #define CONFIG_CMD_LOADS /* loads */
+ #define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */
Modified: trunk/src/target/u-boot/patches/uboot-mokoversion.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-mokoversion.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-mokoversion.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -7,4 +7,4 @@
fi
fi
+
-+printf '%s' -moko9
++printf '%s' -moko10
Modified: trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410-mmc.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -11,8 +11,8 @@
LIB = $(obj)lib$(SOC).a
COBJS = i2c.o interrupts.o serial.o speed.o \
-- usb_ohci.o nand_read.o nand.o cmd_s3c2410.o
-+ usb_ohci.o nand_read.o nand.o mmc.o cmd_s3c2410.o
+- usb.o nand_read.o nand.o cmd_s3c2410.o
++ usb.o nand_read.o nand.o mmc.o cmd_s3c2410.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
Modified: trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410-nand.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -5,21 +5,21 @@
Index: u-boot/cpu/arm920t/s3c24x0/Makefile
===================================================================
---- u-boot.orig/cpu/arm920t/s3c24x0/Makefile 2007-02-28 03:47:44.000000000 +0100
-+++ u-boot/cpu/arm920t/s3c24x0/Makefile 2007-03-01 14:29:32.000000000 +0100
+--- u-boot.orig/cpu/arm920t/s3c24x0/Makefile
++++ u-boot/cpu/arm920t/s3c24x0/Makefile
@@ -26,7 +26,7 @@
LIB = $(obj)lib$(SOC).a
COBJS = i2c.o interrupts.o serial.o speed.o \
-- usb_ohci.o
-+ usb_ohci.o nand_read.o nand.o
+- usb.o
++ usb.o nand_read.o nand.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
Index: u-boot/cpu/arm920t/s3c24x0/nand.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/cpu/arm920t/s3c24x0/nand.c 2007-03-01 14:30:27.000000000 +0100
+--- /dev/null
++++ u-boot/cpu/arm920t/s3c24x0/nand.c
@@ -0,0 +1,225 @@
+/*
+ * (C) Copyright 2006 OpenMoko, Inc.
@@ -49,7 +49,7 @@
+#define DEBUGN(x, args ...) {}
+#endif
+
-+#if (CONFIG_COMMANDS & CFG_CMD_NAND)
++#if defined(CONFIG_CMD_NAND)
+#if !defined(CFG_NAND_LEGACY)
+
+#include <nand.h>
@@ -248,8 +248,8 @@
+#endif
Index: u-boot/cpu/arm920t/s3c24x0/nand_read.c
===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/cpu/arm920t/s3c24x0/nand_read.c 2007-02-28 03:51:24.000000000 +0100
+--- /dev/null
++++ u-boot/cpu/arm920t/s3c24x0/nand_read.c
@@ -0,0 +1,98 @@
+/*
+ * nand_read.c: Simple NAND read functions for booting from NAND
@@ -351,8 +351,8 @@
+#endif /* CONFIG_S3C2410_NAND_BOOT */
Index: u-boot/cpu/arm920t/start.S
===================================================================
---- u-boot.orig/cpu/arm920t/start.S 2007-02-28 03:47:44.000000000 +0100
-+++ u-boot/cpu/arm920t/start.S 2007-03-01 14:29:22.000000000 +0100
+--- u-boot.orig/cpu/arm920t/start.S
++++ u-boot/cpu/arm920t/start.S
@@ -5,6 +5,10 @@
* Copyright (c) 2002 Alex Züpke <azu at sysgo.de>
* Copyright (c) 2002 Gary Jennejohn <gj at denx.de>
@@ -476,8 +476,8 @@
/* Set up the stack */
Index: u-boot/include/s3c2410.h
===================================================================
---- u-boot.orig/include/s3c2410.h 2007-02-28 03:51:24.000000000 +0100
-+++ u-boot/include/s3c2410.h 2007-03-01 14:29:22.000000000 +0100
+--- u-boot.orig/include/s3c2410.h
++++ u-boot/include/s3c2410.h
@@ -38,12 +38,6 @@
#define S3C2410_ECCSIZE 512
#define S3C2410_ECCBYTES 3
Modified: trunk/src/target/u-boot/patches/uboot-s3c2410_fb.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410_fb.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410_fb.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -6,8 +6,8 @@
ks8695eth.o \
pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \
rpx_pcmcia.o \
-- fsl_i2c.o
-+ fsl_i2c.o s3c2410_fb.o
+- fsl_i2c.o fsl_pci_init.o ati_radeon_fb.o
++ fsl_i2c.o fsl_pci_init.o ati_radeon_fb.o s3c2410_fb.o
SRCS := $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
Modified: trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-s3c2410_udc.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -4,15 +4,15 @@
===================================================================
--- u-boot.orig/drivers/Makefile
+++ u-boot/drivers/Makefile
-@@ -47,7 +47,7 @@
- status_led.o sym53c8xx.o systemace.o ahci.o \
+@@ -48,7 +48,7 @@
ti_pci1410a.o tigon3.o tsec.o \
tsi108_eth.o tsi108_i2c.o tsi108_pci.o \
-- usbdcore.o usbdcore_ep0.o usbdcore_omap1510.o usbtty.o \
-+ usbdcore.o usbdcore_ep0.o usbdcore_omap1510.o usbdcore_s3c2410.o usbtty.o \
+ usb_ohci.o \
+- usbdcore.o usbdcore_ep0.o usbdcore_mpc8xx.o usbdcore_omap1510.o \
++ usbdcore.o usbdcore_ep0.o usbdcore_mpc8xx.o usbdcore_omap1510.o usbdcore_s3c2410.o \
+ usbtty.o \
videomodes.o w83c553f.o \
ks8695eth.o \
- pcf50606.o \
Index: u-boot/drivers/usbdcore_s3c2410.c
===================================================================
--- /dev/null
@@ -1030,16 +1030,7 @@
===================================================================
--- u-boot.orig/drivers/usbdcore_ep0.c
+++ u-boot/drivers/usbdcore_ep0.c
-@@ -43,7 +43,7 @@
-
- #include <common.h>
-
--#if defined(CONFIG_OMAP1510) && defined(CONFIG_USB_DEVICE)
-+#if defined(CONFIG_USB_DEVICE)
- #include "usbdcore.h"
-
- #if 0
-@@ -187,9 +187,13 @@
+@@ -193,9 +193,13 @@
if (!urb || !urb->buffer || !urb->buffer_length
|| (urb->buffer_length < 255)) {
dbg_ep0 (2, "invalid urb %p", urb);
@@ -1052,8 +1043,8 @@
+
/* setup tx urb */
urb->actual_length = 0;
- cp = urb->buffer;
-@@ -206,17 +210,8 @@
+ cp = (char*)urb->buffer;
+@@ -211,15 +215,8 @@
usbd_device_device_descriptor (device, port))) {
return -1;
}
@@ -1065,30 +1056,28 @@
- /* correct the correct control endpoint 0 max packet size into the descriptor */
- device_descriptor =
- (struct usb_device_descriptor *) urb->buffer;
-- device_descriptor->bMaxPacketSize0 =
-- urb->device->bus->maxpacketsize;
-
+ urb->buffer = device_descriptor;
+ urb->actual_length = MIN(sizeof(*device_descriptor), max);
}
- /*dbg_ep0(3, "copied device configuration, actual_length: %x", urb->actual_length); */
+ dbg_ep0(3, "copied device configuration, actual_length: 0x%x", urb->actual_length);
break;
-@@ -250,11 +245,9 @@
+@@ -252,11 +249,9 @@
index);
return -1;
}
+- dbg_ep0(0, "attempt to copy %d bytes to urb\n",cpu_to_le16(configuration_descriptor->wTotalLength));
- copy_config (urb, configuration_descriptor,
-- sizeof (struct
-- usb_configuration_descriptor),
-- max);
-
+- cpu_to_le16(configuration_descriptor->wTotalLength),
+- max);
+ urb->buffer = configuration_descriptor;
+ urb->actual_length =
+ MIN(le16_to_cpu(configuration_descriptor->wTotalLength), max);
}
- break;
-@@ -376,6 +369,7 @@
+ break;
+@@ -389,6 +384,7 @@
dbg_ep0 (0, "entering ep0_recv_setup()");
if (!urb || !urb->device) {
dbg_ep0 (3, "invalid URB %p", urb);
@@ -1096,15 +1085,15 @@
return -1;
}
-@@ -400,6 +394,7 @@
- return device->cdc_recv_setup(request, urb);
+@@ -417,6 +413,7 @@
+ }
dbg_ep0 (1, "non standard request: %x",
request->bmRequestType & USB_REQ_TYPE_MASK);
+ serial_printf("non standard request: %x", request->bmRequestType & USB_REQ_TYPE_MASK);
return -1; /* Stall here */
}
-@@ -448,6 +443,8 @@
+@@ -465,6 +462,8 @@
dbg_ep0 (1, "request %s not allowed in UNKNOWN state: %s",
USBD_DEVICE_REQUESTS (request->bRequest),
usbd_device_states[device->device_state]);
@@ -1113,12 +1102,10 @@
return -1;
}
-@@ -545,7 +542,8 @@
+@@ -563,6 +562,7 @@
/*dbg_ep0(2, "address: %d %d %d", */
/* request->wValue, le16_to_cpu(request->wValue), device->address); */
-- serial_printf ("DEVICE_ADDRESS_ASSIGNED.. event?\n");
-+ //serial_printf ("DEVICE_ADDRESS_ASSIGNED.. event?\n");
+ //udc_set_address(device->address);
return 0;
@@ -1127,7 +1114,7 @@
===================================================================
--- u-boot.orig/include/configs/neo1973_gta01.h
+++ u-boot/include/configs/neo1973_gta01.h
-@@ -173,6 +173,16 @@
+@@ -161,6 +161,16 @@
#define CONFIG_USB_OHCI 1
#endif
@@ -1174,7 +1161,7 @@
+#include "usbdcore_s3c2410.h"
#endif
- #include <config.h>
+ #include <version_autogenerated.h>
Index: u-boot/board/neo1973/common/cmd_neo1973.c
===================================================================
--- u-boot.orig/board/neo1973/common/cmd_neo1973.c
@@ -1204,7 +1191,7 @@
"neo1973 vibrator (on|off) - switch vibrator on or off\n"
+ "neo1973 udc pullup (on|off) - switch pull-up on or off\n"
);
- #endif /* CFG_CMD_BDI */
+ #endif /* CONFIG_CMD_BDI */
Index: u-boot/board/neo1973/gta01/Makefile
===================================================================
--- u-boot.orig/board/neo1973/gta01/Makefile
Modified: trunk/src/target/u-boot/patches/uboot-s3c2440.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2440.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-s3c2440.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -483,7 +483,7 @@
===================================================================
--- u-boot.orig/include/common.h
+++ u-boot/include/common.h
-@@ -454,7 +454,7 @@
+@@ -469,7 +469,7 @@
ulong get_OPB_freq (void);
ulong get_PCI_freq (void);
#endif
@@ -1299,3 +1299,42 @@
udelay(125000); /* FIXME: 74 SDCLK cycles */
mmc_csd.c_size = 0;
+Index: u-boot/cpu/arm920t/s3c24x0/usb.c
+===================================================================
+--- u-boot.orig/cpu/arm920t/s3c24x0/usb.c
++++ u-boot/cpu/arm920t/s3c24x0/usb.c
+@@ -24,12 +24,14 @@
+ #include <common.h>
+
+ #if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT)
+-# if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)
++# if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
+
+ #if defined(CONFIG_S3C2400)
+ # include <s3c2400.h>
+ #elif defined(CONFIG_S3C2410)
+ # include <s3c2410.h>
++#elif defined(CONFIG_S3C2440)
++# include <s3c2440.h>
+ #endif
+
+ int usb_cpu_init (void)
+@@ -68,5 +70,5 @@
+ return 0;
+ }
+
+-# endif /* defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) */
++# endif /* defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440) */
+ #endif /* defined(CONFIG_USB_OHCI) && defined(CFG_USB_OHCI_CPU_INIT) */
+Index: u-boot/drivers/usb_ohci.c
+===================================================================
+--- u-boot.orig/drivers/usb_ohci.c
++++ u-boot/drivers/usb_ohci.c
+@@ -62,6 +62,7 @@
+ #if defined(CONFIG_ARM920T) || \
+ defined(CONFIG_S3C2400) || \
+ defined(CONFIG_S3C2410) || \
++ defined(CONFIG_S3C2440) || \
+ defined(CONFIG_440EP) || \
+ defined(CONFIG_PCI_OHCI) || \
+ defined(CONFIG_MPC5200)
Modified: trunk/src/target/u-boot/patches/uboot-s3c2443.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-s3c2443.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-s3c2443.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -11,8 +11,8 @@
#endif
-@@ -164,9 +166,15 @@
- # define UPLLCON_val ((0x3c << 12) + (0x4 << 4) + 0x2)
+@@ -169,9 +171,15 @@
+ #endif
# define CLKDIVN_val 7 /* FCLK:HCLK:PCLK = 1:3:6 */
# define CAMDIVN 0x4C000018
+#elif defined(CONFIG_S3C2443)
@@ -28,7 +28,7 @@
ldr r0, =pWTCON
mov r1, #0x0
str r1, [r0]
-@@ -177,7 +185,7 @@
+@@ -182,7 +190,7 @@
mov r1, #0xffffffff
ldr r0, =INTMSK
str r1, [r0]
@@ -37,7 +37,7 @@
ldr r1, =INTSUBMSK_val
ldr r0, =INTSUBMSK
str r1, [r0]
-@@ -196,6 +204,43 @@
+@@ -201,6 +209,43 @@
mcr p15, 0, r1, c1, c0, 0
@@ -81,7 +81,7 @@
#define LOCKTIME 0x4c000000
#define UPLLCON 0x4c000008
-@@ -223,6 +268,7 @@
+@@ -228,6 +273,7 @@
ldr r0, =CLKDIVN
mov r1, #CLKDIVN_val
str r1, [r0]
@@ -89,7 +89,7 @@
#if 1
/* enable uart */
-@@ -249,7 +295,7 @@
+@@ -254,7 +300,7 @@
str r1, [r0, #0x28]
#endif
@@ -147,7 +147,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/s3c2443.h
-@@ -0,0 +1,106 @@
+@@ -0,0 +1,130 @@
+/*
+ * (C) Copyright 2007 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -174,6 +174,30 @@
+#ifndef __S3C2443_H
+#define __S3C2443_H
+
++/* S3C2443 device base addresses */
++#define S3C24X0_MEMCTL_BASE 0x48000000
++#define S3C24X0_USB_HOST_BASE 0x49000000
++#define S3C24X0_INTERRUPT_BASE 0x4A000000
++#define S3C24X0_DMA_BASE 0x4B000000
++#define S3C24X0_CLOCK_POWER_BASE 0x4C000000
++#define S3C24X0_LCD_BASE 0x4D000000
++#define S3C2440_NAND_BASE 0x4E000000
++#define S3C24X0_UART_BASE 0x50000000
++#define S3C24X0_TIMER_BASE 0x51000000
++#define S3C24X0_USB_DEVICE_BASE 0x49800000
++//#define USB_DEVICE_PHYS_ADR 0x49800000
++#define S3C24X3_HSMMC_BASE 0x4A800000
++#define S3C24X3_HSSPI_BASE 0x52000000
++#define S3C24X0_WATCHDOG_BASE 0x53000000
++#define S3C24X0_I2C_BASE 0x54000000
++#define S3C24X0_I2S_BASE 0x55000000
++#define S3C24X0_GPIO_BASE 0x56000000
++#define S3C24X0_RTC_BASE 0x57000000
++#define S3C2440_ADC_BASE 0x58000000
++#define S3C24X0_SPI_BASE 0x59000000
++#define S3C2440_SDI_BASE 0x5A000000
++#define S3C2443_AC97_BASE 0x5A000000
++
+#include <s3c24x0.h>
+
+/* CLOCK & POWER MANAGEMENT (see S3C2443 manual chapter 2) */
Modified: trunk/src/target/u-boot/patches/uboot-smdk2440.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-smdk2440.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-smdk2440.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -4,7 +4,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -2035,6 +2035,9 @@
+@@ -2084,6 +2084,9 @@
smdk2410_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 NULL s3c24x0
@@ -18,7 +18,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/configs/smdk2440.h
-@@ -0,0 +1,296 @@
+@@ -0,0 +1,292 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
@@ -111,34 +111,26 @@
+/***********************************************************
+ * Command definition
+ ***********************************************************/
-+#define CONFIG_COMMANDS \
-+ (CONFIG_CMD_DFL | \
-+ /*CFG_CMD_BSP | */ \
-+ CFG_CMD_CACHE | \
-+ CFG_CMD_DATE | \
-+ /*CFG_CMD_DHCP | */ \
-+ CFG_CMD_DIAG | \
-+ CFG_CMD_ELF | \
-+ CFG_CMD_EXT2 | \
-+ CFG_CMD_FAT | \
-+ /*CFG_CMD_HWFLOW | */ \
-+ /* CFG_CMD_IDE | */ \
-+ /* CFG_CMD_IRQ | */ \
-+ CFG_CMD_JFFS2 | \
-+ CFG_CMD_MMC | \
-+ CFG_CMD_NAND | \
-+ CFG_CMD_PING | \
-+ CFG_CMD_PORTIO | \
-+ CFG_CMD_REGINFO | \
-+ CFG_CMD_SAVES | \
-+ CFG_CMD_USB)
++#include <config_cmd_default.h>
+
-+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-+#include <cmd_confdefs.h>
++#define CONFIG_CMD_CACHE
++#define CONFIG_CMD_DATE
++#define CONFIG_CMD_DIAG
++#define CONFIG_CMD_ELF
++#define CONFIG_CMD_EXT2
++#define CONFIG_CMD_FAT
++#define CONFIG_CMD_JFFS2
++#define CONFIG_CMD_MMC
++#define CONFIG_CMD_NAND
++#define CONFIG_CMD_PING
++#define CONFIG_CMD_PORTIO
++#define CONFIG_CMD_REGINFO
++#define CONFIG_CMD_SAVES
++#define CONFIG_CMD_USB
+
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTARGS "root=/dev/mtdblock4 rootfstype=jffs2 console=ttySAC2,115200 loglevel=8"
-+#define CONFIG_ETHADDR 00:0c:20:02:0a:5b
++#define CONFIG_ETHADDR 00:0c:20:02:0a:5b
+#define CONFIG_NETMASK 255.255.255.0
+#define CONFIG_IPADDR 192.168.1.100
+#define CONFIG_SERVERIP 192.168.1.21
@@ -147,8 +139,8 @@
+#define CONFIG_BOOTCOMMAND "nand read.e 0x32000000 0x100000 0x200000; bootm"
+
+#define CONFIG_DOS_PARTITION 1
-+
-+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++
++#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
+/* what's this ? it's not used anywhere */
+#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
@@ -196,10 +188,14 @@
+#define CFG_IDE_MAXDEVICE 2
+#define CFG_IDE_PREINIT 0
+
-+#define CFG_ATA_BASE_ADDR
++#define CFG_ATA_BASE_ADDR
+#endif
+
-+#define CONFIG_USB_OHCI 1
++#define CONFIG_USB_OHCI_NEW 1
++#define CFG_USB_OHCI_CPU_INIT 1
++#define CFG_USB_OHCI_REGS_BASE 0x49000000 /* S3C24X0_USB_HOST_BASE */
++#define CFG_USB_OHCI_SLOT_NAME "s3c2440"
++#define CFG_USB_OHCI_MAX_ROOT_PORTS 2
+
+#define CONFIG_USB_DEVICE 1
+#define CONFIG_USB_TTY 1
Modified: trunk/src/target/u-boot/patches/uboot-smdk2443.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-smdk2443.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-smdk2443.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -2,7 +2,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -2045,6 +2045,9 @@
+@@ -2094,6 +2094,9 @@
smdk2440_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t smdk2440 NULL s3c24x0
@@ -303,7 +303,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/configs/smdk2443.h
-@@ -0,0 +1,289 @@
+@@ -0,0 +1,290 @@
+/*
+ * (C) Copyright 2007 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -392,31 +392,28 @@
+/***********************************************************
+ * Command definition
+ ***********************************************************/
-+#define CONFIG_COMMANDS \
-+ (CONFIG_CMD_DFL | \
-+ /*CFG_CMD_BSP | */ \
-+ CFG_CMD_CACHE | \
-+ CFG_CMD_DATE | \
-+ /*CFG_CMD_DHCP | */ \
-+ CFG_CMD_DIAG | \
-+ CFG_CMD_ELF | \
-+ CFG_CMD_EXT2 | \
-+ CFG_CMD_FAT | \
-+ /*CFG_CMD_HWFLOW | */ \
-+ /* CFG_CMD_IDE | */ \
-+ /* CFG_CMD_IRQ | */ \
-+ CFG_CMD_JFFS2 | \
-+ CFG_CMD_MMC | \
-+ CFG_CMD_NAND | \
-+ CFG_CMD_PING | \
-+ CFG_CMD_PORTIO | \
-+ CFG_CMD_REGINFO | \
-+ CFG_CMD_SAVES | \
-+ CFG_CMD_LICENSE | \
-+ CFG_CMD_USB)
++#include <config_cmd_default.h>
+
-+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-+#include <cmd_confdefs.h>
++ /*CFG_CMD_BSP | */
++#define CONFIG_CMD_CACHE
++#define CONFIG_CMD_DATE
++ /*CFG_CMD_DHCP | */
++#define CONFIG_CMD_DIAG
++#define CONFIG_CMD_ELF
++#define CONFIG_CMD_EXT2
++#define CONFIG_CMD_FAT
++ /*CFG_CMD_HWFLOW | */
++ /* CFG_CMD_IDE | */
++ /* CFG_CMD_IRQ | */
++#define CONFIG_CMD_JFFS2
++#define CONFIG_CMD_MMC
++#define CONFIG_CMD_NAND
++#define CONFIG_CMD_PING
++#define CONFIG_CMD_PORTIO
++#define CONFIG_CMD_REGINFO
++#define CONFIG_CMD_SAVES
++#define CONFIG_CMD_LICENSE
++#define CONFIG_CMD_USB
+
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_BOOTARGS "root=/dev/mtdblock4 rootfstype=jffs2 console=ttySAC2,115200 loglevel=8"
@@ -428,7 +425,7 @@
+
+#define CONFIG_DOS_PARTITION 1
+
-+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
++#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
+/* what's this ? it's not used anywhere */
+#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
@@ -479,7 +476,11 @@
+#define CFG_ATA_BASE_ADDR
+#endif
+
-+#define CONFIG_USB_OHCI 1
++#define CONFIG_USB_OHCI_NEW 1
++#define CFG_USB_OHCI_CPU_INIT 1
++#define CFG_USB_OHCI_REGS_BASE 0x49000000 /* S3C24X0_USB_HOST_BASE */
++#define CFG_USB_OHCI_SLOT_NAME "s3c2443"
++#define CFG_USB_OHCI_MAX_ROOT_PORTS 2
+
+#define CONFIG_USB_DEVICE 1
+#define CONFIG_USB_TTY 1
@@ -1409,3 +1410,15 @@
+ break;
+ }
+}
+Index: u-boot/drivers/usb_ohci.c
+===================================================================
+--- u-boot.orig/drivers/usb_ohci.c
++++ u-boot/drivers/usb_ohci.c
+@@ -63,6 +63,7 @@
+ defined(CONFIG_S3C2400) || \
+ defined(CONFIG_S3C2410) || \
+ defined(CONFIG_S3C2440) || \
++ defined(CONFIG_S3C2443) || \
+ defined(CONFIG_440EP) || \
+ defined(CONFIG_PCI_OHCI) || \
+ defined(CONFIG_MPC5200)
Modified: trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/uboot-usbtty-acm.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -6,19 +6,18 @@
Index: u-boot/drivers/usbtty.c
===================================================================
---- u-boot.orig/drivers/usbtty.c 2007-02-08 21:11:27.000000000 +0100
-+++ u-boot/drivers/usbtty.c 2007-02-08 21:11:55.000000000 +0100
-@@ -1,6 +1,9 @@
+--- u-boot.orig/drivers/usbtty.c
++++ u-boot/drivers/usbtty.c
+@@ -1,7 +1,7 @@
/*
* (C) Copyright 2003
* Gerry Hamel, geh at ti.com, Texas Instruments
+- *
+ *
-+ * (C) Copyright 2006
-+ * Bryan O'Donoghue, bodonoghue <at> codehermit.ie
+ * (C) Copyright 2006
+ * Bryan O'Donoghue, bodonoghue at codehermit.ie
*
- * 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
-@@ -22,26 +25,61 @@
+@@ -25,6 +25,7 @@
#ifdef CONFIG_USB_TTY
@@ -26,595 +25,10 @@
#include <circbuf.h>
#include <devices.h>
#include "usbtty.h"
-+#include "usb_cdc_acm.h"
-+#include "usbdescriptors.h"
-+#include <config.h> /* If defined, override Linux identifiers with
-+ * vendor specific ones */
-
- #if 0
--#define TTYDBG(fmt,args...) serial_printf("[%s] %s %d: "fmt, __FILE__,__FUNCTION__,__LINE__,##args)
-+//+++ debug print into memory buffer,like kernel log
-+static char* log_buf = 0x10e00000; // somewhere in RAM
-+static char log_str[512];
-+#define TTYDBG(fmt,args...)\
-+ sprintf(log_str,"\n[%s] %s %d: "fmt, __FILE__,__FUNCTION__,__LINE__,##args);\
-+ memcpy(log_buf, log_str, strlen(log_str));\
-+ log_buf+=strlen(log_str);\
-+ strcpy(log_buf,"\n---------------------------------------------------")\
-+//---
- #else
- #define TTYDBG(fmt,args...) do{}while(0)
- #endif
-
- #if 0
--#define TTYERR(fmt,args...) serial_printf("ERROR![%s] %s %d: "fmt, __FILE__,__FUNCTION__,__LINE__,##args)
-+#define TTYDBG(fmt,args...)\
-+ serial_printf("[%s] %s %d: "fmt"\n", __FILE__,__FUNCTION__,__LINE__,##args)
-+#endif
-+
-+#if 0
-+#define TTYERR(fmt,args...)\
-+ serial_printf("ERROR![%s] %s %d: "fmt"\n", __FILE__,__FUNCTION__,\
-+ __LINE__,##args)
- #else
- #define TTYERR(fmt,args...) do{}while(0)
- #endif
-
- /*
-+ * Defines
-+ */
-+#define NUM_CONFIGS 1
-+#define MAX_INTERFACES 2
-+#define NUM_ENDPOINTS 3
-+#define ACM_TX_ENDPOINT 3
-+#define ACM_RX_ENDPOINT 2
-+#define GSERIAL_TX_ENDPOINT 2
-+#define GSERIAL_RX_ENDPOINT 1
-+#define NUM_ACM_INTERFACES 2
-+#define NUM_GSERIAL_INTERFACES 1
-+#define CONFIG_USBD_DATA_INTERFACE_STR "Bulk Data Interface"
-+#define CONFIG_USBD_CTRL_INTERFACE_STR "Control Interface"
-+
-+/*
- * Buffers to hold input and output data
- */
--#define USBTTY_BUFFER_SIZE 256
-+#define USBTTY_BUFFER_SIZE 2048
- static circbuf_t usbtty_input;
- static circbuf_t usbtty_output;
-
-@@ -50,157 +88,336 @@
- * Instance variables
- */
- static device_t usbttydev;
--static struct usb_device_instance device_instance[1];
--static struct usb_bus_instance bus_instance[1];
-+static struct usb_device_instance device_instance[1];
-+static struct usb_bus_instance bus_instance[1];
- static struct usb_configuration_instance config_instance[NUM_CONFIGS];
--static struct usb_interface_instance interface_instance[NUM_INTERFACES];
--static struct usb_alternate_instance alternate_instance[NUM_INTERFACES];
--static struct usb_endpoint_instance endpoint_instance[NUM_ENDPOINTS+1]; /* one extra for control endpoint */
--
--/*
-- * Static allocation of urbs
-- */
--#define RECV_ENDPOINT 1
--#define TX_ENDPOINT 2
-+static struct usb_interface_instance interface_instance[MAX_INTERFACES];
-+static struct usb_alternate_instance alternate_instance[MAX_INTERFACES];
-+/* one extra for control endpoint */
-+static struct usb_endpoint_instance endpoint_instance[NUM_ENDPOINTS+1];
-
- /*
- * Global flag
- */
- int usbtty_configured_flag = 0;
-
--
- /*
- * Serial number
- */
- static char serial_number[16];
-
-+
- /*
-- * Descriptors
-+ * Descriptors, Strings, Local variables.
- */
-+
-+/* defined and used by usbdcore_ep0.c */
-+extern struct usb_string_descriptor **usb_strings;
-+
-+/* Indicies, References */
-+static unsigned short rx_endpoint = 0;
-+static unsigned short tx_endpoint = 0;
-+static unsigned short interface_count = 0;
-+static struct usb_string_descriptor *usbtty_string_table[STR_COUNT];
-+
-+/* USB Descriptor Strings */
- static u8 wstrLang[4] = {4,USB_DT_STRING,0x9,0x4};
- static u8 wstrManufacturer[2 + 2*(sizeof(CONFIG_USBD_MANUFACTURER)-1)];
- static u8 wstrProduct[2 + 2*(sizeof(CONFIG_USBD_PRODUCT_NAME)-1)];
- static u8 wstrSerial[2 + 2*(sizeof(serial_number) - 1)];
- static u8 wstrConfiguration[2 + 2*(sizeof(CONFIG_USBD_CONFIGURATION_STR)-1)];
--static u8 wstrInterface[2 + 2*(sizeof(CONFIG_USBD_INTERFACE_STR)-1)];
--
--static struct usb_string_descriptor *usbtty_string_table[] = {
-- (struct usb_string_descriptor*)wstrLang,
-- (struct usb_string_descriptor*)wstrManufacturer,
-- (struct usb_string_descriptor*)wstrProduct,
-- (struct usb_string_descriptor*)wstrSerial,
-- (struct usb_string_descriptor*)wstrConfiguration,
-- (struct usb_string_descriptor*)wstrInterface
--};
--extern struct usb_string_descriptor **usb_strings; /* defined and used by omap1510_ep0.c */
-+static u8 wstrDataInterface[2 + 2*(sizeof(CONFIG_USBD_DATA_INTERFACE_STR)-1)];
-+static u8 wstrCtrlInterface[2 + 2*(sizeof(CONFIG_USBD_DATA_INTERFACE_STR)-1)];
-
-+/* Standard USB Data Structures */
-+static struct usb_interface_descriptor interface_descriptors[MAX_INTERFACES];
-+static struct usb_endpoint_descriptor *ep_descriptor_ptrs[NUM_ENDPOINTS];
-+static struct usb_configuration_descriptor *configuration_descriptor = 0;
- static struct usb_device_descriptor device_descriptor = {
-- bLength: sizeof(struct usb_device_descriptor),
-- bDescriptorType: USB_DT_DEVICE,
-- bcdUSB: USB_BCD_VERSION,
-- bDeviceClass: USBTTY_DEVICE_CLASS,
-- bDeviceSubClass: USBTTY_DEVICE_SUBCLASS,
-- bDeviceProtocol: USBTTY_DEVICE_PROTOCOL,
-- bMaxPacketSize0: EP0_MAX_PACKET_SIZE,
-- idVendor: CONFIG_USBD_VENDORID,
-- idProduct: CONFIG_USBD_PRODUCTID,
-- bcdDevice: USBTTY_BCD_DEVICE,
-- iManufacturer: STR_MANUFACTURER,
-- iProduct: STR_PRODUCT,
-- iSerialNumber: STR_SERIAL,
-- bNumConfigurations: NUM_CONFIGS
-- };
--static struct usb_configuration_descriptor config_descriptors[NUM_CONFIGS] = {
-- {
-- bLength: sizeof(struct usb_configuration_descriptor),
-- bDescriptorType: USB_DT_CONFIG,
-- wTotalLength: (sizeof(struct usb_configuration_descriptor)*NUM_CONFIGS) +
-- (sizeof(struct usb_interface_descriptor)*NUM_INTERFACES) +
-- (sizeof(struct usb_endpoint_descriptor)*NUM_ENDPOINTS),
-- bNumInterfaces: NUM_INTERFACES,
-- bConfigurationValue: 1,
-- iConfiguration: STR_CONFIG,
-- bmAttributes: BMATTRIBUTE_SELF_POWERED | BMATTRIBUTE_RESERVED,
-- bMaxPower: USBTTY_MAXPOWER
-- },
--};
--static struct usb_interface_descriptor interface_descriptors[NUM_INTERFACES] = {
-- {
-- bLength: sizeof(struct usb_interface_descriptor),
-- bDescriptorType: USB_DT_INTERFACE,
-- bInterfaceNumber: 0,
-- bAlternateSetting: 0,
-- bNumEndpoints: NUM_ENDPOINTS,
-- bInterfaceClass: USBTTY_INTERFACE_CLASS,
-- bInterfaceSubClass: USBTTY_INTERFACE_SUBCLASS,
-- bInterfaceProtocol: USBTTY_INTERFACE_PROTOCOL,
-- iInterface: STR_INTERFACE
-- },
-+ .bLength = sizeof(struct usb_device_descriptor),
-+ .bDescriptorType = USB_DT_DEVICE,
-+ .bcdUSB = cpu_to_le16(USB_BCD_VERSION),
-+ .bDeviceSubClass = 0x00,
-+ .bDeviceProtocol = 0x00,
-+ .bMaxPacketSize0 = EP0_MAX_PACKET_SIZE,
-+ .idVendor = cpu_to_le16(CONFIG_USBD_VENDORID),
-+ .bcdDevice = cpu_to_le16(USBTTY_BCD_DEVICE),
-+ .iManufacturer = STR_MANUFACTURER,
-+ .iProduct = STR_PRODUCT,
-+ .iSerialNumber = STR_SERIAL,
-+ .bNumConfigurations = NUM_CONFIGS
- };
--static struct usb_endpoint_descriptor ep_descriptors[NUM_ENDPOINTS] = {
-- {
-- bLength: sizeof(struct usb_endpoint_descriptor),
-- bDescriptorType: USB_DT_ENDPOINT,
-- bEndpointAddress: CONFIG_USBD_SERIAL_OUT_ENDPOINT | USB_DIR_OUT,
-- bmAttributes: USB_ENDPOINT_XFER_BULK,
-- wMaxPacketSize: CONFIG_USBD_SERIAL_OUT_PKTSIZE,
-- bInterval: 0
-- },
-- {
-- bLength: sizeof(struct usb_endpoint_descriptor),
-- bDescriptorType: USB_DT_ENDPOINT,
-- bEndpointAddress: CONFIG_USBD_SERIAL_IN_ENDPOINT | USB_DIR_IN,
-- bmAttributes: USB_ENDPOINT_XFER_BULK,
-- wMaxPacketSize: CONFIG_USBD_SERIAL_IN_PKTSIZE,
-- bInterval: 0
-- },
-- {
-- bLength: sizeof(struct usb_endpoint_descriptor),
-- bDescriptorType: USB_DT_ENDPOINT,
-- bEndpointAddress: CONFIG_USBD_SERIAL_INT_ENDPOINT | USB_DIR_IN,
-- bmAttributes: USB_ENDPOINT_XFER_INT,
-- wMaxPacketSize: CONFIG_USBD_SERIAL_INT_PKTSIZE,
-- bInterval: 0
-- },
--};
--static struct usb_endpoint_descriptor *ep_descriptor_ptrs[NUM_ENDPOINTS] = {
-- &(ep_descriptors[0]),
-- &(ep_descriptors[1]),
-- &(ep_descriptors[2]),
-+
-+
-+/*
-+ * Static CDC ACM specific descriptors
-+ */
-+
-+struct acm_config_desc {
-+ struct usb_configuration_descriptor configuration_desc;
-+
-+ /* Master Interface */
-+ struct usb_interface_descriptor interface_desc;
-+
-+ struct usb_class_header_function_descriptor usb_class_header;
-+ struct usb_class_call_management_descriptor usb_class_call_mgt;
-+ struct usb_class_abstract_control_descriptor usb_class_acm;
-+ struct usb_class_union_function_descriptor usb_class_union;
-+ struct usb_endpoint_descriptor notification_endpoint;
-+
-+ /* Slave Interface */
-+ struct usb_interface_descriptor data_class_interface;
-+ struct usb_endpoint_descriptor
-+ data_endpoints[NUM_ENDPOINTS-1] __attribute__((packed));
-+} __attribute__((packed));
-+
-+static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
-+ {
-+ .configuration_desc ={
-+ .bLength =
-+ sizeof(struct usb_configuration_descriptor),
-+ .bDescriptorType = USB_DT_CONFIG,
-+ .wTotalLength =
-+ cpu_to_le16(sizeof(struct acm_config_desc)),
-+ .bNumInterfaces = NUM_ACM_INTERFACES,
-+ .bConfigurationValue = 1,
-+ .iConfiguration = STR_CONFIG,
-+ .bmAttributes =
-+ BMATTRIBUTE_SELF_POWERED|BMATTRIBUTE_RESERVED,
-+ .bMaxPower = USBTTY_MAXPOWER
-+ },
-+ /* Interface 1 */
-+ .interface_desc = {
-+ .bLength = sizeof(struct usb_interface_descriptor),
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0,
-+ .bAlternateSetting = 0,
-+ .bNumEndpoints = 0x01,
-+ .bInterfaceClass =
-+ COMMUNICATIONS_INTERFACE_CLASS_CONTROL,
-+ .bInterfaceSubClass = COMMUNICATIONS_ACM_SUBCLASS,
-+ .bInterfaceProtocol = COMMUNICATIONS_V25TER_PROTOCOL,
-+ .iInterface = STR_CTRL_INTERFACE,
-+ },
-+ .usb_class_header = {
-+ .bFunctionLength =
-+ sizeof(struct usb_class_header_function_descriptor),
-+ .bDescriptorType = CS_INTERFACE,
-+ .bDescriptorSubtype = USB_ST_HEADER,
-+ .bcdCDC = cpu_to_le16(110),
-+ },
-+ .usb_class_call_mgt = {
-+ .bFunctionLength =
-+ sizeof(struct usb_class_call_management_descriptor),
-+ .bDescriptorType = CS_INTERFACE,
-+ .bDescriptorSubtype = USB_ST_CMF,
-+ .bmCapabilities = 0x00,
-+ .bDataInterface = 0x01,
-+ },
-+ .usb_class_acm = {
-+ .bFunctionLength =
-+ sizeof(struct usb_class_abstract_control_descriptor),
-+ .bDescriptorType = CS_INTERFACE,
-+ .bDescriptorSubtype = USB_ST_ACMF,
-+ .bmCapabilities = 0x00,
-+ },
-+ .usb_class_union = {
-+ .bFunctionLength =
-+ sizeof(struct usb_class_union_function_descriptor),
-+ .bDescriptorType = CS_INTERFACE,
-+ .bDescriptorSubtype = USB_ST_UF,
-+ .bMasterInterface = 0x00,
-+ .bSlaveInterface0 = 0x01,
-+ },
-+ .notification_endpoint = {
-+ .bLength =
-+ sizeof(struct usb_endpoint_descriptor),
-+ .bDescriptorType = USB_DT_ENDPOINT,
-+ .bEndpointAddress = 0x01 | USB_DIR_IN,
-+ .bmAttributes = USB_ENDPOINT_XFER_INT,
-+ .wMaxPacketSize
-+ = cpu_to_le16(CONFIG_USBD_SERIAL_INT_PKTSIZE),
-+ .bInterval = 0xFF,
-+ },
-+
-+ /* Interface 2 */
-+ .data_class_interface = {
-+ .bLength =
-+ sizeof(struct usb_interface_descriptor),
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0x01,
-+ .bAlternateSetting = 0x00,
-+ .bNumEndpoints = 0x02,
-+ .bInterfaceClass =
-+ COMMUNICATIONS_INTERFACE_CLASS_DATA,
-+ .bInterfaceSubClass = DATA_INTERFACE_SUBCLASS_NONE,
-+ .bInterfaceProtocol = DATA_INTERFACE_PROTOCOL_NONE,
-+ .iInterface = STR_DATA_INTERFACE,
-+ },
-+ .data_endpoints = {
-+ {
-+ .bLength =
-+ sizeof(struct usb_endpoint_descriptor),
-+ .bDescriptorType = USB_DT_ENDPOINT,
-+ .bEndpointAddress = 0x02 | USB_DIR_OUT,
-+ .bmAttributes =
-+ USB_ENDPOINT_XFER_BULK,
-+ .wMaxPacketSize =
-+ cpu_to_le16(CONFIG_USBD_SERIAL_BULK_PKTSIZE),
-+ .bInterval = 0xFF,
-+ },
-+ {
-+ .bLength =
-+ sizeof(struct usb_endpoint_descriptor),
-+ .bDescriptorType = USB_DT_ENDPOINT,
-+ .bEndpointAddress = 0x03 | USB_DIR_IN,
-+ .bmAttributes =
-+ USB_ENDPOINT_XFER_BULK,
-+ .wMaxPacketSize =
-+ cpu_to_le16(CONFIG_USBD_SERIAL_BULK_PKTSIZE),
-+ .bInterval = 0xFF,
-+ },
-+ },
-+ },
-+};
-+
-+static struct rs232_emu rs232_desc={
-+ .dter = 115200,
-+ .stop_bits = 0x00,
-+ .parity = 0x00,
-+ .data_bits = 0x08
- };
-
--/* utility function for converting char* to wide string used by USB */
--static void str2wide (char *str, u16 * wide)
--{
-- int i;
-
-- for (i = 0; i < strlen (str) && str[i]; i++)
-- wide[i] = (u16) str[i];
--}
-+/*
-+ * Static Generic Serial specific data
-+ */
-+
-+
-+struct gserial_config_desc {
-+
-+ struct usb_configuration_descriptor configuration_desc;
-+ struct usb_interface_descriptor
-+ interface_desc[NUM_GSERIAL_INTERFACES] __attribute__((packed));
-+ struct usb_endpoint_descriptor
-+ data_endpoints[NUM_ENDPOINTS] __attribute__((packed));
-+
-+} __attribute__((packed));
-+
-+static struct gserial_config_desc
-+gserial_configuration_descriptors[NUM_CONFIGS] ={
-+ {
-+ .configuration_desc ={
-+ .bLength = sizeof(struct usb_configuration_descriptor),
-+ .bDescriptorType = USB_DT_CONFIG,
-+ .wTotalLength =
-+ cpu_to_le16(sizeof(struct gserial_config_desc)),
-+ .bNumInterfaces = NUM_GSERIAL_INTERFACES,
-+ .bConfigurationValue = 1,
-+ .iConfiguration = STR_CONFIG,
-+ .bmAttributes =
-+ BMATTRIBUTE_SELF_POWERED|BMATTRIBUTE_RESERVED,
-+ .bMaxPower = USBTTY_MAXPOWER
-+ },
-+ .interface_desc = {
-+ {
-+ .bLength =
-+ sizeof(struct usb_interface_descriptor),
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0,
-+ .bAlternateSetting = 0,
-+ .bNumEndpoints = NUM_ENDPOINTS,
-+ .bInterfaceClass =
-+ COMMUNICATIONS_INTERFACE_CLASS_VENDOR,
-+ .bInterfaceSubClass =
-+ COMMUNICATIONS_NO_SUBCLASS,
-+ .bInterfaceProtocol =
-+ COMMUNICATIONS_NO_PROTOCOL,
-+ .iInterface = STR_DATA_INTERFACE
-+ },
-+ },
-+ .data_endpoints = {
-+ {
-+ .bLength =
-+ sizeof(struct usb_endpoint_descriptor),
-+ .bDescriptorType = USB_DT_ENDPOINT,
-+ .bEndpointAddress = 0x01 | USB_DIR_OUT,
-+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
-+ .wMaxPacketSize =
-+ cpu_to_le16(CONFIG_USBD_SERIAL_OUT_PKTSIZE),
-+ .bInterval= 0xFF,
-+ },
-+ {
-+ .bLength =
-+ sizeof(struct usb_endpoint_descriptor),
-+ .bDescriptorType = USB_DT_ENDPOINT,
-+ .bEndpointAddress = 0x02 | USB_DIR_IN,
-+ .bmAttributes = USB_ENDPOINT_XFER_BULK,
-+ .wMaxPacketSize =
-+ cpu_to_le16(CONFIG_USBD_SERIAL_IN_PKTSIZE),
-+ .bInterval = 0xFF,
-+ },
-+ {
-+ .bLength =
-+ sizeof(struct usb_endpoint_descriptor),
-+ .bDescriptorType = USB_DT_ENDPOINT,
-+ .bEndpointAddress = 0x03 | USB_DIR_IN,
-+ .bmAttributes = USB_ENDPOINT_XFER_INT,
-+ .wMaxPacketSize =
-+ cpu_to_le16(CONFIG_USBD_SERIAL_INT_PKTSIZE),
-+ .bInterval = 0xFF,
-+ },
-+ },
-+ },
-+};
-
- /*
-- * Prototypes
-+ * Static Function Prototypes
- */
-+
- static void usbtty_init_strings (void);
- static void usbtty_init_instances (void);
- static void usbtty_init_endpoints (void);
--
-+static void usbtty_init_terminal_type(short type);
- static void usbtty_event_handler (struct usb_device_instance *device,
-- usb_device_event_t event, int data);
-+ usb_device_event_t event, int data);
-+static int usbtty_cdc_setup(struct usb_device_request *request,
-+ struct urb *urb);
- static int usbtty_configured (void);
--
- static int write_buffer (circbuf_t * buf);
- static int fill_buffer (circbuf_t * buf);
-
- void usbtty_poll (void);
--static void pretend_interrupts (void);
-
-+/* utility function for converting char* to wide string used by USB */
-+static void str2wide (char *str, u16 * wide)
-+{
-+ int i;
-+ for (i = 0; i < strlen (str) && str[i]; i++){
-+ #if defined(__LITTLE_ENDIAN)
-+ wide[i] = (u16) str[i];
-+ #elif defined(__BIG_ENDIAN)
-+ wide[i] = ((u16)(str[i])<<8);
-+ #else
-+ #error "__LITTLE_ENDIAN or __BIG_ENDIAN undefined"
-+ #endif
-+ }
-+}
-
- /*
- * Test whether a character is in the RX buffer
- */
-+
- int usbtty_tstc (void)
- {
-+ struct usb_endpoint_instance *endpoint =
-+ &endpoint_instance[rx_endpoint];
-+
-+ /* If no input data exists, allow more RX to be accepted */
-+ if(usbtty_input.size <= 0){
-+ udc_unset_nak(endpoint->endpoint_address&0x03);
-+ }
-+
- usbtty_poll ();
- return (usbtty_input.size > 0);
- }
-@@ -210,15 +427,21 @@
- * otherwise. When the function is succesfull, the character read is
- * written into its argument c.
- */
-+
- int usbtty_getc (void)
- {
- char c;
-+ struct usb_endpoint_instance *endpoint =
-+ &endpoint_instance[rx_endpoint];
-
- while (usbtty_input.size <= 0) {
-+ udc_unset_nak(endpoint->endpoint_address&0x03);
- usbtty_poll ();
+@@ -544,6 +545,14 @@
}
+ usbtty_init_terminal_type(strcmp(tt,"cdc_acm"));
- buf_pop (&usbtty_input, &c, 1);
-+ udc_set_nak(endpoint->endpoint_address&0x03);
-+
- return c;
- }
-
-@@ -238,7 +461,6 @@
- }
- }
-
--
- /* usbtty_puts() helper function for finding the next '\n' in a string */
- static int next_nl_pos (const char *s)
- {
-@@ -252,8 +474,9 @@
- }
-
- /*
-- * Output a string to the usb client port.
-+ * Output a string to the usb client port - implementing flow control
- */
-+
- static void __usbtty_puts (const char *str, int len)
- {
- int maxlen = usbtty_output.totalsize;
-@@ -261,22 +484,19 @@
-
- /* break str into chunks < buffer size, if needed */
- while (len > 0) {
-- space = maxlen - usbtty_output.size;
-+ usbtty_poll ();
-
-+ space = maxlen - usbtty_output.size;
- /* Empty buffer here, if needed, to ensure space... */
-- if (space <= 0) {
-+ if (space) {
- write_buffer (&usbtty_output);
-- space = maxlen - usbtty_output.size;
-- if (space <= 0) {
-- space = len; /* allow old data to be overwritten. */
-- }
-- }
--
-- n = MIN (space, MIN (len, maxlen));
-- buf_push (&usbtty_output, str, n);
-+
-+ n = MIN (space, MIN (len, maxlen));
-+ buf_push (&usbtty_output, str, n);
-
-- str += n;
-- len -= n;
-+ str += n;
-+ len -= n;
-+ }
- }
- }
-
-@@ -313,8 +533,10 @@
- {
- int rc;
- char * sn;
-+ char * tt;
- int snlen;
-
-+ /* Get serial number */
- if (!(sn = getenv("serial#"))) {
- sn = "000000000000";
- }
-@@ -327,6 +549,14 @@
- memcpy (serial_number, sn, snlen);
- serial_number[snlen] = '\0';
-
+ /* Decide on which type of UDC device to be.
+ */
+
@@ -626,622 +40,38 @@
/* prepare buffers... */
buf_init (&usbtty_input, USBTTY_BUFFER_SIZE);
buf_init (&usbtty_output, USBTTY_BUFFER_SIZE);
-@@ -337,7 +567,7 @@
- usbtty_init_strings ();
- usbtty_init_instances ();
-
-- udc_startup_events (device_instance); /* Enable our device, initialize udc pointers */
-+ udc_startup_events (device_instance);/* Enable dev, init udc pointers */
- udc_connect (); /* Enable pullup for host detection */
-
- usbtty_init_endpoints ();
-@@ -362,34 +592,52 @@
- {
- struct usb_string_descriptor *string;
-
-+ usbtty_string_table[STR_LANG] =
-+ (struct usb_string_descriptor*)wstrLang;
-+
- string = (struct usb_string_descriptor *) wstrManufacturer;
-- string->bLength = sizeof (wstrManufacturer);
-+ string->bLength = sizeof(wstrManufacturer);
- string->bDescriptorType = USB_DT_STRING;
- str2wide (CONFIG_USBD_MANUFACTURER, string->wData);
-+ usbtty_string_table[STR_MANUFACTURER]=string;
-+
-
- string = (struct usb_string_descriptor *) wstrProduct;
-- string->bLength = sizeof (wstrProduct);
-+ string->bLength = sizeof(wstrProduct);
- string->bDescriptorType = USB_DT_STRING;
- str2wide (CONFIG_USBD_PRODUCT_NAME, string->wData);
-+ usbtty_string_table[STR_PRODUCT]=string;
-+
-
- string = (struct usb_string_descriptor *) wstrSerial;
-- string->bLength = 2 + 2*strlen(serial_number);
-+ string->bLength = sizeof(serial_number);
- string->bDescriptorType = USB_DT_STRING;
- str2wide (serial_number, string->wData);
-+ usbtty_string_table[STR_SERIAL]=string;
-+
-
- string = (struct usb_string_descriptor *) wstrConfiguration;
-- string->bLength = sizeof (wstrConfiguration);
-+ string->bLength = sizeof(wstrConfiguration);
- string->bDescriptorType = USB_DT_STRING;
- str2wide (CONFIG_USBD_CONFIGURATION_STR, string->wData);
-+ usbtty_string_table[STR_CONFIG]=string;
-+
-+
-+ string = (struct usb_string_descriptor *) wstrDataInterface;
-+ string->bLength = sizeof(wstrDataInterface);
-+ string->bDescriptorType = USB_DT_STRING;
-+ str2wide (CONFIG_USBD_DATA_INTERFACE_STR, string->wData);
-+ usbtty_string_table[STR_DATA_INTERFACE]=string;
-
-- string = (struct usb_string_descriptor *) wstrInterface;
-- string->bLength = sizeof (wstrInterface);
-+ string = (struct usb_string_descriptor *) wstrCtrlInterface;
-+ string->bLength = sizeof(wstrCtrlInterface);
- string->bDescriptorType = USB_DT_STRING;
-- str2wide (CONFIG_USBD_INTERFACE_STR, string->wData);
-+ str2wide (CONFIG_USBD_CTRL_INTERFACE_STR, string->wData);
-+ usbtty_string_table[STR_CTRL_INTERFACE]=string;
-
- /* Now, initialize the string table for ep0 handling */
- usb_strings = usbtty_string_table;
--}
-+}
-
- static void usbtty_init_instances (void)
- {
-@@ -400,6 +648,7 @@
- device_instance->device_state = STATE_INIT;
- device_instance->device_descriptor = &device_descriptor;
- device_instance->event = usbtty_event_handler;
-+ device_instance->cdc_recv_setup = usbtty_cdc_setup;
- device_instance->bus = bus_instance;
- device_instance->configurations = NUM_CONFIGS;
- device_instance->configuration_instance_array = config_instance;
-@@ -415,8 +664,8 @@
- /* configuration instance */
- memset (config_instance, 0,
- sizeof (struct usb_configuration_instance));
-- config_instance->interfaces = NUM_INTERFACES;
-- config_instance->configuration_descriptor = config_descriptors;
-+ config_instance->interfaces = interface_count;
-+ config_instance->configuration_descriptor = configuration_descriptor;
- config_instance->interface_instance_array = interface_instance;
-
- /* interface instance */
-@@ -447,17 +696,22 @@
- sizeof (struct usb_endpoint_instance));
-
- endpoint_instance[i].endpoint_address =
-- ep_descriptors[i - 1].bEndpointAddress;
-+ ep_descriptor_ptrs[i - 1]->bEndpointAddress;
-
-- endpoint_instance[i].rcv_packetSize =
-- ep_descriptors[i - 1].wMaxPacketSize;
- endpoint_instance[i].rcv_attributes =
-- ep_descriptors[i - 1].bmAttributes;
-+ ep_descriptor_ptrs[i - 1]->bmAttributes;
-+
-+ endpoint_instance[i].rcv_packetSize =
-+ le16_to_cpu(ep_descriptor_ptrs[i - 1]->wMaxPacketSize);
-+
-+ endpoint_instance[i].tx_attributes =
-+ ep_descriptor_ptrs[i - 1]->bmAttributes;
-
- endpoint_instance[i].tx_packetSize =
-- ep_descriptors[i - 1].wMaxPacketSize;
-+ le16_to_cpu(ep_descriptor_ptrs[i - 1]->wMaxPacketSize);
-+
- endpoint_instance[i].tx_attributes =
-- ep_descriptors[i - 1].bmAttributes;
-+ ep_descriptor_ptrs[i - 1]->bmAttributes;
-
- urb_link_init (&endpoint_instance[i].rcv);
- urb_link_init (&endpoint_instance[i].rdy);
-@@ -480,13 +734,79 @@
- int i;
-
- bus_instance->max_endpoints = NUM_ENDPOINTS + 1;
-- for (i = 0; i <= NUM_ENDPOINTS; i++) {
-+ for (i = 1; i <= NUM_ENDPOINTS; i++) {
- udc_setup_ep (device_instance, i, &endpoint_instance[i]);
- }
- }
-
-+/* usbtty_init_terminal_type
-+ *
-+ * Do some late binding for our device type.
-+ */
-+static void usbtty_init_terminal_type(short type)
-+{
-+ switch(type){
-+ /* CDC ACM */
-+ case 0:
-+ /* Assign endpoint descriptors */
-+ ep_descriptor_ptrs[0] =
-+ &acm_configuration_descriptors[0].notification_endpoint;
-+ ep_descriptor_ptrs[1] =
-+ &acm_configuration_descriptors[0].data_endpoints[0];
-+ ep_descriptor_ptrs[2] =
-+ &acm_configuration_descriptors[0].data_endpoints[1];
-+
-+ /* Enumerate Device Descriptor */
-+ device_descriptor.bDeviceClass =
-+ COMMUNICATIONS_DEVICE_CLASS;
-+ device_descriptor.idProduct =
-+ cpu_to_le16(CONFIG_USBD_PRODUCTID_CDCACM);
-+
-+ /* Assign endpoint indices */
-+ tx_endpoint = ACM_TX_ENDPOINT;
-+ rx_endpoint = ACM_RX_ENDPOINT;
-+
-+ /* Configuration Descriptor */
-+ configuration_descriptor =
-+ (struct usb_configuration_descriptor*)
-+ &acm_configuration_descriptors;
-+
-+ /* Interface count */
-+ interface_count = NUM_ACM_INTERFACES;
-+ break;
-+
-+ /* BULK IN/OUT & Default */
-+ case 1:
-+ default:
-+ /* Assign endpoint descriptors */
-+ ep_descriptor_ptrs[0] =
-+ &gserial_configuration_descriptors[0].data_endpoints[0];
-+ ep_descriptor_ptrs[1] =
-+ &gserial_configuration_descriptors[0].data_endpoints[1];
-+ ep_descriptor_ptrs[2] =
-+ &gserial_configuration_descriptors[0].data_endpoints[2];
-+
-+ /* Enumerate Device Descriptor */
-+ device_descriptor.bDeviceClass = 0xFF;
-+ device_descriptor.idProduct =
-+ cpu_to_le16(CONFIG_USBD_PRODUCTID_GSERIAL);
-+
-+ /* Assign endpoint indices */
-+ tx_endpoint = GSERIAL_TX_ENDPOINT;
-+ rx_endpoint = GSERIAL_RX_ENDPOINT;
-+
-+ /* Configuration Descriptor */
-+ configuration_descriptor =
-+ (struct usb_configuration_descriptor*)
-+ &gserial_configuration_descriptors;
-+
-+ /* Interface count */
-+ interface_count = NUM_GSERIAL_INTERFACES;
-+ break;
-+ }
-+}
-
--/*********************************************************************************/
-+/******************************************************************************/
-
- static struct urb *next_urb (struct usb_device_instance *device,
- struct usb_endpoint_instance *endpoint)
-@@ -522,82 +842,179 @@
-
- static int write_buffer (circbuf_t * buf)
- {
-- if (!usbtty_configured ()) {
-- return 0;
-- }
-+ if (!usbtty_configured ()) {
-+ return 0;
-+ }
-+
-+ if (buf->size) {
-+
-+ struct usb_endpoint_instance *endpoint =
-+ &endpoint_instance[tx_endpoint];
-+ struct urb *current_urb = NULL;
-+ char *dest;
-+
-+ int space_avail;
-+ int popnum, popped;
-+ int total = 0;
-+
-+ /* Break buffer into urb sized pieces, and link each to the endpoint */
-+ while (buf->size > 0) {
-+ TTYDBG ("buf->size= %d",buf->size);
-+ current_urb = next_urb (device_instance, endpoint);
-+ if (!current_urb) {
-+ TTYDBG ("current_urb is NULL, buf->size %d\n",
-+ buf->size);
-+ return total;
-+ }
-+
-+ dest = current_urb->buffer +
-+ current_urb->actual_length;
-+
-+ space_avail =
-+ current_urb->buffer_length -
-+ current_urb->actual_length;
-+ TTYDBG ("space_avail= %d",space_avail);
-+ popnum = MIN (space_avail, buf->size);
-+ if (popnum == 0)
-+ break;
-+
-+ popped = buf_pop (buf, dest, popnum);
-+ TTYDBG ("popped= %d, %s",popped, dest);
-+ if (popped == 0)
-+ break;
-+ current_urb->actual_length += popped;
-+ total += popped;
-+
-+ /* If endpoint->last == 0, then transfers have not started on this endpoint */
-+ if (endpoint->last == 0) {
-+ udc_endpoint_write (endpoint);
-+ }
-+
-+ } /* end while */
-+ TTYDBG (" total= %d",total);
-+ return total;
-+ } /* end if tx_urb */
-
-- if (buf->size) {
-+ return 0;
-+}
-+// static int write_buffer (circbuf_t * buf)
-+// {
-+// if (!usbtty_configured ()) {
-+// return 0;
-+// }
-+//
-+// struct usb_endpoint_instance *endpoint =
-+// &endpoint_instance[tx_endpoint];
-+// struct urb *current_urb = NULL;
-+//
-+// current_urb = next_urb (device_instance, endpoint);
-+// /* TX data still exists - send it now
-+// */
-+// if(endpoint->sent < current_urb->actual_length){
-+// if(udc_endpoint_write (endpoint)){
-+// /* Write pre-empted by RX */
-+// return -1;
-+// }
-+// }
-+//
-+// if (buf->size) {
-+// char *dest;
-+//
-+// int space_avail;
-+// int popnum, popped;
-+// int total = 0;
-+//
-+// /* Break buffer into urb sized pieces,
-+// * and link each to the endpoint
-+// */
-+// while (buf->size > 0) {
-+//
-+// if (!current_urb) {
-+// TTYERR ("current_urb is NULL, buf->size %d\n",
-+// buf->size);
-+// return total;
-+// }
-+//
-+// dest = (char*)current_urb->buffer +
-+// current_urb->actual_length;
-+//
-+// space_avail =
-+// current_urb->buffer_length -
-+// current_urb->actual_length;
-+// popnum = MIN (space_avail, buf->size);
-+// if (popnum == 0)
-+// break;
-+//
-+// popped = buf_pop (buf, dest, popnum);
-+// if (popped == 0)
-+// break;
-+// current_urb->actual_length += popped;
-+// total += popped;
-+//
-+// /* If endpoint->last == 0, then transfers have
-+// * not started on this endpoint
-+// */
-+// if (endpoint->last == 0) {
-+// if(udc_endpoint_write (endpoint)){
-+// /* Write pre-empted by RX */
-+// return -1;
-+// }
-+// }
-+//
-+// }/* end while */
-+// return total;
-+// }
-+//
-+// return 0;
-+// }
-
-- struct usb_endpoint_instance *endpoint =
-- &endpoint_instance[TX_ENDPOINT];
-- struct urb *current_urb = NULL;
-- char *dest;
--
-- int space_avail;
-- int popnum, popped;
-- int total = 0;
--
-- /* Break buffer into urb sized pieces, and link each to the endpoint */
-- while (buf->size > 0) {
-- current_urb = next_urb (device_instance, endpoint);
-- if (!current_urb) {
-- TTYERR ("current_urb is NULL, buf->size %d\n",
-- buf->size);
-- return total;
-- }
--
-- dest = current_urb->buffer +
-- current_urb->actual_length;
--
-- space_avail =
-- current_urb->buffer_length -
-- current_urb->actual_length;
-- popnum = MIN (space_avail, buf->size);
-- if (popnum == 0)
-- break;
--
-- popped = buf_pop (buf, dest, popnum);
-- if (popped == 0)
-- break;
-- current_urb->actual_length += popped;
-- total += popped;
--
-- /* If endpoint->last == 0, then transfers have not started on this endpoint */
-- if (endpoint->last == 0) {
-- udc_endpoint_write (endpoint);
-- }
--
-- } /* end while */
-- return total;
-- } /* end if tx_urb */
-+static int fill_buffer (circbuf_t * buf)
-+{
-+ struct usb_endpoint_instance *endpoint =
-+ &endpoint_instance[rx_endpoint];
-
-- return 0;
--}
-+ if (endpoint->rcv_urb && endpoint->rcv_urb->actual_length) {
-+ unsigned int nb = endpoint->rcv_urb->actual_length;
-+ char *src = (char *) endpoint->rcv_urb->buffer;
-
-+ buf_push (buf, src, nb);
-+ endpoint->rcv_urb->actual_length = 0;
-+
-+ TTYDBG ("nb= %d",nb);
-+ return nb;
-+ }
-+
-+ return 0;
-+}
-+/*
- static int fill_buffer (circbuf_t * buf)
- {
- struct usb_endpoint_instance *endpoint =
-- &endpoint_instance[RECV_ENDPOINT];
-+ &endpoint_instance[rx_endpoint];
-
- if (endpoint->rcv_urb && endpoint->rcv_urb->actual_length) {
-- unsigned int nb = endpoint->rcv_urb->actual_length;
-+ unsigned int nb = 0;
- char *src = (char *) endpoint->rcv_urb->buffer;
-+ unsigned int rx_avail = buf->totalsize - buf->size;
-
-- buf_push (buf, src, nb);
-- endpoint->rcv_urb->actual_length = 0;
-+ if(rx_avail >= endpoint->rcv_urb->actual_length){
-
-+ nb = endpoint->rcv_urb->actual_length;
-+ buf_push (buf, src, nb);
-+ endpoint->rcv_urb->actual_length = 0;
-+
-+ }
- return nb;
- }
--
- return 0;
- }
--
-+*/
- static int usbtty_configured (void)
- {
- return usbtty_configured_flag;
- }
-
--/*********************************************************************************/
-+/******************************************************************************/
-
- static void usbtty_event_handler (struct usb_device_instance *device,
- usb_device_event_t event, int data)
-@@ -619,8 +1036,34 @@
- }
- }
-
--/*********************************************************************************/
-+/******************************************************************************/
-
-+int usbtty_cdc_setup(struct usb_device_request *request, struct urb *urb)
-+{
-+ switch (request->bRequest){
-+
-+ case ACM_SET_CONTROL_LINE_STATE: /* Implies DTE ready */
-+ break;
-+ case ACM_SEND_ENCAPSULATED_COMMAND : /* Required */
-+ break;
-+ case ACM_SET_LINE_ENCODING : /* DTE stop/parity bits
-+ * per character */
-+ break;
-+ case ACM_GET_ENCAPSULATED_RESPONSE : /* request response */
-+ break;
-+ case ACM_GET_LINE_ENCODING : /* request DTE rate,
-+ * stop/parity bits */
-+ memcpy (urb->buffer , &rs232_desc, sizeof(rs232_desc));
-+ urb->actual_length = sizeof(rs232_desc);
-+
-+ break;
-+ default:
-+ return 1;
-+ }
-+ return 0;
-+}
-+
-+/******************************************************************************/
-
- /*
- * Since interrupt handling has not yet been implemented, we use this function
-@@ -630,36 +1073,29 @@
- void usbtty_poll (void)
- {
- /* New interrupts? */
-- pretend_interrupts ();
-+ udc_irq();
-
-- /* Write any output data to host buffer (do this before checking interrupts to avoid missing one) */
-+ /* Write any output data to host buffer
-+ * (do this before checking interrupts to avoid missing one)
-+ */
- if (usbtty_configured ()) {
- write_buffer (&usbtty_output);
- }
-
- /* New interrupts? */
-- pretend_interrupts ();
--
-- /* Check for new data from host.. (do this after checking interrupts to get latest data) */
-+ udc_irq();
-+
-+ /* Check for new data from host..
-+ * (do this after checking interrupts to get latest data)
-+ */
- if (usbtty_configured ()) {
- fill_buffer (&usbtty_input);
- }
-
- /* New interrupts? */
-- pretend_interrupts ();
--}
-+ udc_irq();
-
--static void pretend_interrupts (void)
--{
-- /* Loop while we have interrupts.
-- * If we don't do this, the input chain
-- * polling delay is likely to miss
-- * host requests.
-- */
-- while (inw (UDC_IRQ_SRC) & ~UDC_SOF_Flg) {
-- /* Handle any new IRQs */
-- omap1510_udc_irq ();
-- omap1510_udc_noniso_irq ();
-- }
- }
-+
-+
- #endif
Index: u-boot/drivers/usbtty.h
===================================================================
---- u-boot.orig/drivers/usbtty.h 2007-02-08 21:11:27.000000000 +0100
-+++ u-boot/drivers/usbtty.h 2007-02-08 21:11:55.000000000 +0100
-@@ -2,6 +2,9 @@
- * (C) Copyright 2003
- * Gerry Hamel, geh at ti.com, Texas Instruments
- *
-+ * (C) Copyright 2006
-+ * Bryan O'Donoghue, bodonoghue <at> codehermit.ie, CodeHermit
-+ *
- * 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
-@@ -21,44 +24,49 @@
- #ifndef __USB_TTY_H__
- #define __USB_TTY_H__
-
--
+--- u-boot.orig/drivers/usbtty.h
++++ u-boot/drivers/usbtty.h
+@@ -27,7 +27,7 @@
#include "usbdcore.h"
-+#if defined(CONFIG_PPC)
-+#include "usbdcore_mpc8xx.h"
+ #if defined(CONFIG_PPC)
+ #include "usbdcore_mpc8xx.h"
+-#elif defined(CONFIG_ARM)
+#elif defined(CONFIG_OMAP1510)
#include "usbdcore_omap1510.h"
-+#endif
+ #endif
-+#include <config.h>
-+#include <version.h>
+@@ -36,12 +36,13 @@
+ /* If no VendorID/ProductID is defined in config.h, pretend to be Linux
+ * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */
--#define NUM_CONFIGS 1
--#define NUM_INTERFACES 1
--#define NUM_ENDPOINTS 3
-+/* If no VendorID/ProductID is defined in config.h, pretend to be Linux
-+ * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */
-
--#define EP0_MAX_PACKET_SIZE 64
+#ifndef CONFIG_USBD_VENDORID
-+#define CONFIG_USBD_VENDORID 0x0525 /* Linux/NetChip */
-+#define CONFIG_USBD_PRODUCTID_GSERIAL 0xa4a6 /* gserial */
-+#define CONFIG_USBD_PRODUCTID_CDCACM 0xa4a7 /* CDC ACM */
-+#define CONFIG_USBD_MANUFACTURER "Das U-Boot"
-+#define CONFIG_USBD_PRODUCT_NAME U_BOOT_VERSION
+ #define CONFIG_USBD_VENDORID 0x0525 /* Linux/NetChip */
+ #define CONFIG_USBD_PRODUCTID_GSERIAL 0xa4a6 /* gserial */
+ #define CONFIG_USBD_PRODUCTID_CDCACM 0xa4a7 /* CDC ACM */
+ #define CONFIG_USBD_MANUFACTURER "Das U-Boot"
+ #define CONFIG_USBD_PRODUCT_NAME U_BOOT_VERSION
+-
+#endif /* CONFIG_USBD_VENDORID */
#define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
--#define CONFIG_USBD_INTERFACE_STR "Simple Serial Data Interface - Bulk Mode"
--
--
--#define CONFIG_USBD_SERIAL_OUT_ENDPOINT 2
--#define CONFIG_USBD_SERIAL_OUT_PKTSIZE 64
--#define CONFIG_USBD_SERIAL_IN_ENDPOINT 1
--#define CONFIG_USBD_SERIAL_IN_PKTSIZE 64
--#define CONFIG_USBD_SERIAL_INT_ENDPOINT 5
--#define CONFIG_USBD_SERIAL_INT_PKTSIZE 16
-+#define CONFIG_USBD_SERIAL_OUT_ENDPOINT UDC_OUT_ENDPOINT
-+#define CONFIG_USBD_SERIAL_OUT_PKTSIZE UDC_OUT_PACKET_SIZE
-+#define CONFIG_USBD_SERIAL_IN_ENDPOINT UDC_IN_ENDPOINT
-+#define CONFIG_USBD_SERIAL_IN_PKTSIZE UDC_IN_PACKET_SIZE
-+#define CONFIG_USBD_SERIAL_INT_ENDPOINT UDC_INT_ENDPOINT
-+#define CONFIG_USBD_SERIAL_INT_PKTSIZE UDC_INT_PACKET_SIZE
-+#define CONFIG_USBD_SERIAL_BULK_PKTSIZE UDC_BULK_PACKET_SIZE
-
- #define USBTTY_DEVICE_CLASS COMMUNICATIONS_DEVICE_CLASS
--#define USBTTY_DEVICE_SUBCLASS COMMUNICATIONS_NO_SUBCLASS
--#define USBTTY_DEVICE_PROTOCOL COMMUNICATIONS_NO_PROTOCOL
-
--#define USBTTY_INTERFACE_CLASS 0xFF /* Vendor Specific */
--#define USBTTY_INTERFACE_SUBCLASS 0x02
--#define USBTTY_INTERFACE_PROTOCOL 0x01
--
--#define USBTTY_BCD_DEVICE 0x0
--#define USBTTY_MAXPOWER 0x0
--
--#define STR_MANUFACTURER 1
--#define STR_PRODUCT 2
--#define STR_SERIAL 3
--#define STR_CONFIG 4
--#define STR_INTERFACE 5
-+#define USBTTY_BCD_DEVICE 0x00
-+#define USBTTY_MAXPOWER 0x00
-+
-+#define STR_LANG 0x00
-+#define STR_MANUFACTURER 0x01
-+#define STR_PRODUCT 0x02
-+#define STR_SERIAL 0x03
-+#define STR_CONFIG 0x04
-+#define STR_DATA_INTERFACE 0x05
-+#define STR_CTRL_INTERFACE 0x06
-+#define STR_COUNT 0x07
-
- #endif
Index: u-boot/drivers/usbdcore_omap1510.c
===================================================================
---- u-boot.orig/drivers/usbdcore_omap1510.c 2007-02-08 21:11:27.000000000 +0100
-+++ u-boot/drivers/usbdcore_omap1510.c 2007-02-08 21:11:55.000000000 +0100
+--- u-boot.orig/drivers/usbdcore_omap1510.c
++++ u-boot/drivers/usbdcore_omap1510.c
@@ -960,7 +960,7 @@
/* Handle general USB interrupts and dispatch according to type.
* This function implements TRM Figure 14-13.
@@ -1281,327 +111,3 @@
/*
-------------------------------------------------------------------------------
*/
-Index: u-boot/include/usb_cdc_acm.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ u-boot/include/usb_cdc_acm.h 2007-02-08 21:11:55.000000000 +0100
-@@ -0,0 +1,43 @@
-+/*
-+ * (C) Copyright 2006
-+ * Bryan O'Donoghue, deckard <at> codehermit.ie, CodeHermit
-+ *
-+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ *
-+ */
-+
-+/* ACM Control Requests */
-+#define ACM_SEND_ENCAPSULATED_COMMAND 0x00
-+#define ACM_GET_ENCAPSULATED_RESPONSE 0x01
-+#define ACM_SET_COMM_FEATURE 0x02
-+#define ACM_GET_COMM_FEATRUE 0x03
-+#define ACM_CLEAR_COMM_FEATURE 0x04
-+#define ACM_SET_LINE_ENCODING 0x20
-+#define ACM_GET_LINE_ENCODING 0x21
-+#define ACM_SET_CONTROL_LINE_STATE 0x22
-+#define ACM_SEND_BREAK 0x23
-+
-+/* ACM Notification Codes */
-+#define ACM_NETWORK_CONNECTION 0x00
-+#define ACM_RESPONSE_AVAILABLE 0x01
-+#define ACM_SERIAL_STATE 0x20
-+
-+/* Format of response expected by a ACM_GET_LINE_ENCODING request */
-+struct rs232_emu{
-+ unsigned long dter;
-+ unsigned char stop_bits;
-+ unsigned char parity;
-+ unsigned char data_bits;
-+}__attribute__((packed));
-Index: u-boot/include/usbdcore_omap1510.h
-===================================================================
---- u-boot.orig/include/usbdcore_omap1510.h 2007-02-08 21:11:27.000000000 +0100
-+++ u-boot/include/usbdcore_omap1510.h 2007-02-08 21:11:55.000000000 +0100
-@@ -161,13 +161,23 @@
- #define UDC_VBUS_CTRL (1 << 19)
- #define UDC_VBUS_MODE (1 << 18)
-
--
--void omap1510_udc_irq(void);
--void omap1510_udc_noniso_irq(void);
--
-+/* OMAP Endpoint parameters */
-+#define EP0_MAX_PACKET_SIZE 64
-+#define UDC_OUT_ENDPOINT 2
-+#define UDC_OUT_PACKET_SIZE 64
-+#define UDC_IN_ENDPOINT 1
-+#define UDC_IN_PACKET_SIZE 64
-+#define UDC_INT_ENDPOINT 5
-+#define UDC_INT_PACKET_SIZE 16
-+#define UDC_BULK_PACKET_SIZE 16
-+
-+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 */
--void udc_endpoint_write(struct usb_endpoint_instance *endpoint);
-+int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
-
- int udc_init (void);
-
-Index: u-boot/include/usbdescriptors.h
-===================================================================
---- u-boot.orig/include/usbdescriptors.h 2007-02-08 21:11:27.000000000 +0100
-+++ u-boot/include/usbdescriptors.h 2007-02-08 21:11:55.000000000 +0100
-@@ -92,15 +92,17 @@
- #define COMMUNICATIONS_DEVICE_CLASS 0x02
-
- /* c.f. CDC 4.2 Table 15 */
--#define COMMUNICATIONS_INTERFACE_CLASS 0x02
-+#define COMMUNICATIONS_INTERFACE_CLASS_CONTROL 0x02
-+#define COMMUNICATIONS_INTERFACE_CLASS_DATA 0x0A
-+#define COMMUNICATIONS_INTERFACE_CLASS_VENDOR 0x0FF
-
- /* c.f. CDC 4.3 Table 16 */
--#define COMMUNICATIONS_NO_SUBCLASS 0x00
-+#define COMMUNICATIONS_NO_SUBCLASS 0x00
- #define COMMUNICATIONS_DLCM_SUBCLASS 0x01
--#define COMMUNICATIONS_ACM_SUBCLASS 0x02
--#define COMMUNICATIONS_TCM_SUBCLASS 0x03
-+#define COMMUNICATIONS_ACM_SUBCLASS 0x02
-+#define COMMUNICATIONS_TCM_SUBCLASS 0x03
- #define COMMUNICATIONS_MCCM_SUBCLASS 0x04
--#define COMMUNICATIONS_CCM_SUBCLASS 0x05
-+#define COMMUNICATIONS_CCM_SUBCLASS 0x05
- #define COMMUNICATIONS_ENCM_SUBCLASS 0x06
- #define COMMUNICATIONS_ANCM_SUBCLASS 0x07
-
-@@ -110,15 +112,22 @@
- #define COMMUNICATIONS_MDLM_SUBCLASS 0x0a
- #define COMMUNICATIONS_OBEX_SUBCLASS 0x0b
-
--/* c.f. CDC 4.6 Table 18 */
-+/* c.f. CDC 4.4 Table 17 */
-+#define COMMUNICATIONS_NO_PROTOCOL 0x00
-+#define COMMUNICATIONS_V25TER_PROTOCOL 0x01 /*Common AT Hayes compatible*/
-+
-+/* c.f. CDC 4.5 Table 18 */
- #define DATA_INTERFACE_CLASS 0x0a
-
-+/* c.f. CDC 4.6 No Table */
-+#define DATA_INTERFACE_SUBCLASS_NONE 0x00 /* No subclass pertinent */
-+
- /* c.f. CDC 4.7 Table 19 */
--#define COMMUNICATIONS_NO_PROTOCOL 0x00
-+#define DATA_INTERFACE_PROTOCOL_NONE 0x00 /* No class protcol required */
-
-
- /* c.f. CDC 5.2.3 Table 24 */
--#define CS_INTERFACE 0x24
-+#define CS_INTERFACE 0x24
- #define CS_ENDPOINT 0x25
-
- /*
-@@ -128,7 +137,7 @@
- * c.f. WMCD 5.3 Table 5.3
- */
-
--#define USB_ST_HEADER 0x00
-+#define USB_ST_HEADER 0x00
- #define USB_ST_CMF 0x01
- #define USB_ST_ACMF 0x02
- #define USB_ST_DLMF 0x03
-@@ -137,18 +146,18 @@
- #define USB_ST_UF 0x06
- #define USB_ST_CSF 0x07
- #define USB_ST_TOMF 0x08
--#define USB_ST_USBTF 0x09
-+#define USB_ST_USBTF 0x09
- #define USB_ST_NCT 0x0a
- #define USB_ST_PUF 0x0b
- #define USB_ST_EUF 0x0c
- #define USB_ST_MCMF 0x0d
- #define USB_ST_CCMF 0x0e
- #define USB_ST_ENF 0x0f
--#define USB_ST_ATMNF 0x10
-+#define USB_ST_ATMNF 0x10
-
- #define USB_ST_WHCM 0x11
- #define USB_ST_MDLM 0x12
--#define USB_ST_MDLMD 0x13
-+#define USB_ST_MDLMD 0x13
- #define USB_ST_DMM 0x14
- #define USB_ST_OBEX 0x15
- #define USB_ST_CS 0x16
-@@ -312,7 +321,8 @@
- u8 bDescriptorType;
- u8 bDescriptorSubtype; /* 0x06 */
- u8 bMasterInterface;
-- u8 bSlaveInterface0[0];
-+ //u8 bSlaveInterface0[0];
-+ u8 bSlaveInterface0;
- } __attribute__ ((packed));
-
- struct usb_class_country_selection_descriptor {
-Index: u-boot/include/usbdcore.h
-===================================================================
---- u-boot.orig/include/usbdcore.h 2007-02-08 21:11:27.000000000 +0100
-+++ u-boot/include/usbdcore.h 2007-02-08 21:11:55.000000000 +0100
-@@ -576,6 +576,9 @@
-
- void (*event) (struct usb_device_instance *device, usb_device_event_t event, int data);
-
-+ /* Do cdc device specific control requests */
-+ int (*cdc_recv_setup)(struct usb_device_request *request, struct urb *urb);
-+
- /* bus interface */
- struct usb_bus_instance *bus; /* which bus interface driver */
-
-Index: u-boot/drivers/usbdcore_ep0.c
-===================================================================
---- u-boot.orig/drivers/usbdcore_ep0.c 2007-02-08 21:12:05.000000000 +0100
-+++ u-boot/drivers/usbdcore_ep0.c 2007-02-08 21:12:08.000000000 +0100
-@@ -223,7 +223,6 @@
-
- case USB_DESCRIPTOR_TYPE_CONFIGURATION:
- {
-- int bNumInterface;
- struct usb_configuration_descriptor
- *configuration_descriptor;
- struct usb_device_descriptor *device_descriptor;
-@@ -256,105 +255,6 @@
- usb_configuration_descriptor),
- max);
-
--
-- /* iterate across interfaces for specified configuration */
-- dbg_ep0 (0, "bNumInterfaces: %d",
-- configuration_descriptor->bNumInterfaces);
-- for (bNumInterface = 0;
-- bNumInterface <
-- configuration_descriptor->bNumInterfaces;
-- bNumInterface++) {
--
-- int bAlternateSetting;
-- struct usb_interface_instance
-- *interface_instance;
--
-- dbg_ep0 (3, "[%d] bNumInterfaces: %d",
-- bNumInterface,
-- configuration_descriptor->bNumInterfaces);
--
-- if (! (interface_instance = usbd_device_interface_instance (device,
-- port, index, bNumInterface)))
-- {
-- dbg_ep0 (3, "[%d] interface_instance NULL",
-- bNumInterface);
-- return -1;
-- }
-- /* iterate across interface alternates */
-- for (bAlternateSetting = 0;
-- bAlternateSetting < interface_instance->alternates;
-- bAlternateSetting++) {
-- /*int class; */
-- int bNumEndpoint;
-- struct usb_interface_descriptor *interface_descriptor;
--
-- struct usb_alternate_instance *alternate_instance;
--
-- dbg_ep0 (3, "[%d:%d] alternates: %d",
-- bNumInterface,
-- bAlternateSetting,
-- interface_instance->alternates);
--
-- if (! (alternate_instance = usbd_device_alternate_instance (device, port, index, bNumInterface, bAlternateSetting))) {
-- dbg_ep0 (3, "[%d] alternate_instance NULL",
-- bNumInterface);
-- return -1;
-- }
-- /* copy descriptor for this interface */
-- copy_config (urb, alternate_instance->interface_descriptor,
-- sizeof (struct usb_interface_descriptor),
-- max);
--
-- /*dbg_ep0(3, "[%d:%d] classes: %d endpoints: %d", bNumInterface, bAlternateSetting, */
-- /* alternate_instance->classes, alternate_instance->endpoints); */
--
-- /* iterate across classes for this alternate interface */
--#if 0
-- for (class = 0;
-- class < alternate_instance->classes;
-- class++) {
-- struct usb_class_descriptor *class_descriptor;
-- /*dbg_ep0(3, "[%d:%d:%d] classes: %d", bNumInterface, bAlternateSetting, */
-- /* class, alternate_instance->classes); */
-- if (!(class_descriptor = usbd_device_class_descriptor_index (device, port, index, bNumInterface, bAlternateSetting, class))) {
-- dbg_ep0 (3, "[%d] class NULL",
-- class);
-- return -1;
-- }
-- /* copy descriptor for this class */
-- copy_config (urb, class_descriptor,
-- sizeof (struct usb_class_descriptor),
-- max);
-- }
--#endif
--
-- /* iterate across endpoints for this alternate interface */
-- interface_descriptor = alternate_instance->interface_descriptor;
-- for (bNumEndpoint = 0;
-- bNumEndpoint < alternate_instance->endpoints;
-- bNumEndpoint++) {
-- struct usb_endpoint_descriptor *endpoint_descriptor;
-- dbg_ep0 (3, "[%d:%d:%d] endpoint: %d",
-- bNumInterface,
-- bAlternateSetting,
-- bNumEndpoint,
-- interface_descriptor->
-- bNumEndpoints);
-- if (!(endpoint_descriptor = usbd_device_endpoint_descriptor_index (device, port, index, bNumInterface, bAlternateSetting, bNumEndpoint))) {
-- dbg_ep0 (3, "[%d] endpoint NULL",
-- bNumEndpoint);
-- return -1;
-- }
-- /* copy descriptor for this endpoint */
-- copy_config (urb, endpoint_descriptor,
-- sizeof (struct usb_endpoint_descriptor),
-- max);
-- }
-- }
-- }
-- dbg_ep0 (3, "lengths: %d %d",
-- le16_to_cpu (configuration_descriptor->wTotalLength),
-- urb->actual_length);
- }
- break;
-
-@@ -363,6 +263,7 @@
- struct usb_string_descriptor *string_descriptor;
-
- if (!(string_descriptor = usbd_get_string (index))) {
-+ dbg_ep0(0, "Invalid string index %u\n", index);
- return -1;
- }
- /*dbg_ep0(3, "string_descriptor: %p", string_descriptor); */
-@@ -495,6 +396,8 @@
-
- /* handle USB Standard Request (c.f. USB Spec table 9-2) */
- if ((request->bmRequestType & USB_REQ_TYPE_MASK) != 0) {
-+ if (device->device_state <= STATE_CONFIGURED)
-+ return device->cdc_recv_setup(request, urb);
- dbg_ep0 (1, "non standard request: %x",
- request->bmRequestType & USB_REQ_TYPE_MASK);
- return -1; /* Stall here */
Modified: trunk/src/target/u-boot/patches/usbdcore-multiple_configs.patch
===================================================================
--- trunk/src/target/u-boot/patches/usbdcore-multiple_configs.patch 2007-08-21 18:25:01 UTC (rev 2762)
+++ trunk/src/target/u-boot/patches/usbdcore-multiple_configs.patch 2007-08-21 18:27:23 UTC (rev 2763)
@@ -13,9 +13,9 @@
Index: u-boot/drivers/usbdcore_ep0.c
===================================================================
---- u-boot.orig/drivers/usbdcore_ep0.c 2007-03-14 20:29:05.000000000 +0100
-+++ u-boot/drivers/usbdcore_ep0.c 2007-03-14 20:29:06.000000000 +0100
-@@ -233,8 +233,8 @@
+--- u-boot.orig/drivers/usbdcore_ep0.c
++++ u-boot/drivers/usbdcore_ep0.c
+@@ -237,8 +237,8 @@
return -1;
}
/*dbg_ep0(2, "%d %d", index, device_descriptor->bNumConfigurations); */
@@ -26,15 +26,16 @@
device_descriptor->
bNumConfigurations);
return -1;
-@@ -593,13 +593,8 @@
+@@ -612,14 +612,8 @@
case USB_REQ_SET_CONFIGURATION:
/* c.f. 9.4.7 - the top half of wValue is reserved */
- /* */
- if ((device->configuration =
-- le16_to_cpu (request->wValue) & 0x7f) != 0) {
+- le16_to_cpu (request->wValue) & 0xFF80) != 0) {
- /* c.f. 9.4.7 - zero is the default or addressed state, in our case this */
- /* is the same is configuration zero */
+- serial_printf("error setting dev->config to zero!\n");
- device->configuration = 0; /* TBR - ?????? */
- }
+ device->configuration = le16_to_cpu(request->wValue) & 0xff;
@@ -44,8 +45,8 @@
Index: u-boot/drivers/usbdcore.c
===================================================================
---- u-boot.orig/drivers/usbdcore.c 2007-03-14 20:29:05.000000000 +0100
-+++ u-boot/drivers/usbdcore.c 2007-03-14 20:37:37.000000000 +0100
+--- u-boot.orig/drivers/usbdcore.c
++++ u-boot/drivers/usbdcore.c
@@ -147,12 +147,9 @@
static struct usb_configuration_instance *usbd_device_configuration_instance (struct usb_device_instance *device,
unsigned int port, unsigned int configuration)
More information about the commitlog
mailing list