r3978 - trunk/src/target/u-boot/patches
werner at sita.openmoko.org
werner at sita.openmoko.org
Tue Jan 29 16:53:03 CET 2008
Author: werner
Date: 2008-01-29 16:52:54 +0100 (Tue, 29 Jan 2008)
New Revision: 3978
Modified:
trunk/src/target/u-boot/patches/gta02-nor.patch
trunk/src/target/u-boot/patches/neo1973-gsmver.patch
trunk/src/target/u-boot/patches/series
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-neo1973_defaultconsole_usbtty.patch
Log:
Implement new partition layout and enable patches that
- change the vendor ID,
- make "mtdparts" work smoothly, and
- that make NOR boot use the default environment
Details:
uboot-gta02.patch:
- board/neo1973/gta02/gta02.c (dynpart_size): increased kernel size from 2MB to
8MB
- board/neo1973/gta02/gta02.c (dynpart_size): corrected NAND size in comment
(was 64MB), and removed obsolete comment about an "initrd" partition
- board/neo1973/gta02/gta02.c (dynpart_size, dynpart_names): added new
"factory" partition of 256kB between "splash" and "rootfs"
- board/neo1973/gta02/gta02.c (dynpart_size): recalculated the balance
- include/configs/neo1973_gta02.h (MTPARTS_DEFAULT): duplicated above partition
layout changes
- include/configs/neo1973_gta02.h (MTPARTS_DEFAULT): commented it out since
it's not used anyway
- include/configs/neo1973_gta02.h (CONFIG_EXTRA_ENV_SETTINGS): changed root
from /dev/mtdblock4 to /dev/mtdblock5
- include/configs/neo1973_gta02.h (DFU_NUM_ALTERNATES): define as 7
- include/configs/neo1973_gta02.h (CFG_CBSIZE): raised console buffer from 256
to 1024 characters, to have room for long boot parameter lines
uboot-dfu.patch:
- drivers/usb/usbdfu.c (dfu_cfg_descriptor): initialize table dynamically in
dfu_init_instance
- include/usb_dfu.h (DFU_NUM_ALTERNATES): only define this if config.h doesn't
provide a better value
- include/usb_dfu.h (DFU_STR_ALTn): replaced list of constants with DFU_STR_ALT
macro
- include/usb_dfu.h (DFU_STR_COUNT): made variable, depending on
DFU_NUM_ALTERNATES
- include/usb_dfu.h (DFU_NUM_STRINGS): deleted unused macro
gta02-nor.patch:
- include/configs/neo1973_gta02.h (CONFIG_EXTRA_ENV_SETTINGS): changed root
from /dev/mtdblock5 to /dev/mtdblock6
neo1973-gsmver.patch: updated to match context for gta02-nor.patch
(board/neo1973/gta02/Makefile)
uboot-neo1973_defaultconsole_usbtty.patch: updated to match context for
partition changes (include/configs/neo1973_gta02.h)
Modified: trunk/src/target/u-boot/patches/gta02-nor.patch
===================================================================
--- trunk/src/target/u-boot/patches/gta02-nor.patch 2008-01-29 14:02:00 UTC (rev 3977)
+++ trunk/src/target/u-boot/patches/gta02-nor.patch 2008-01-29 15:52:54 UTC (rev 3978)
@@ -62,8 +62,8 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
"usbtty=cdc_acm\0" \
-- "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
-+ "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock5 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
+- "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock5 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
++ "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
""
/*-----------------------------------------------------------------------
@@ -83,7 +83,7 @@
-#define MTDIDS_DEFAULT "nand0=neo1973-nand"
+#define MTDIDS_DEFAULT "nor0=physmap-flash,nand0=neo1973-nand"
- #define MTPARTS_DEFAULT "neo1973-nand:256k(u-boot),128k(u-boot_env),2M(kernel),640k(splash),-(rootfs)"
+ //#define MTPARTS_DEFAULT "neo1973-nand:256k(u-boot),128k(u-boot_env),8M(kernel),640k(splash),256k(factory),-(rootfs)"
+#define CFG_MTDPARTS_PREFIX "physmap-flash:-(nor);"
#define CFG_NAND_DYNPART_MTD_KERNEL_NAME "neo1973-nand"
#define CONFIG_NAND_DYNPART
@@ -91,7 +91,7 @@
+#define CFG_MAX_FLASH_BANKS 1
+#define CFG_MAX_FLASH_SECT 1
+
- #endif /* __CONFIG_H */
+ #define DFU_NUM_ALTERNATES 7
Index: u-boot/drivers/mtd/nand/nand_bbt.c
===================================================================
--- u-boot.orig/drivers/mtd/nand/nand_bbt.c
Modified: trunk/src/target/u-boot/patches/neo1973-gsmver.patch
===================================================================
--- trunk/src/target/u-boot/patches/neo1973-gsmver.patch 2008-01-29 14:02:00 UTC (rev 3977)
+++ trunk/src/target/u-boot/patches/neo1973-gsmver.patch 2008-01-29 15:52:54 UTC (rev 3978)
@@ -136,7 +136,7 @@
@@ -26,6 +26,7 @@
LIB = lib$(BOARD).a
- OBJS := gta02.o pcf50633.o nand.o ../common/cmd_neo1973.o \
+ OBJS := gta02.o pcf50633.o nand.o nor.o ../common/cmd_neo1973.o \
+ ../common/gsmver.o \
../common/jbt6k74.o ../common/udc.o ../common/bootmenu.o
SOBJS := ../common/lowlevel_init.o
Modified: trunk/src/target/u-boot/patches/series
===================================================================
--- trunk/src/target/u-boot/patches/series 2008-01-29 14:02:00 UTC (rev 3977)
+++ trunk/src/target/u-boot/patches/series 2008-01-29 15:52:54 UTC (rev 3978)
@@ -71,8 +71,11 @@
uboot-s3c2443.patch
uboot-smdk2443.patch
+usb-vendor.patch
+gta02-splash.patch
+gta02-nor.patch
+
# need to find out how upstream feels about this one
-gta02-splash.patch
eabi-toolchain.patch
# for review, merge soon
@@ -81,4 +84,9 @@
neo1973-gsmver.patch
uboot-nand_write_yaffs.patch
uboot-neo1973_defaultconsole_usbtty.patch
+
+# keep this here until we have time to bubble it into the stack
+nor-default-env.patch
+
+# remove soonish
build-kludge.patch
Modified: trunk/src/target/u-boot/patches/uboot-dfu.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-dfu.patch 2008-01-29 14:02:00 UTC (rev 3977)
+++ trunk/src/target/u-boot/patches/uboot-dfu.patch 2008-01-29 15:52:54 UTC (rev 3978)
@@ -90,7 +90,7 @@
===================================================================
--- /dev/null
+++ u-boot/drivers/usb/usbdfu.c
-@@ -0,0 +1,1069 @@
+@@ -0,0 +1,1018 @@
+/*
+ * (C) 2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -714,7 +714,7 @@
+ .bNumConfigurations = 0x01,
+};
+
-+static const struct _dfu_desc dfu_cfg_descriptor = {
++static struct _dfu_desc dfu_cfg_descriptor = {
+ .ucfg = {
+ .bLength = USB_DT_CONFIG_SIZE,
+ .bDescriptorType = USB_DT_CONFIG,
@@ -727,72 +727,6 @@
+ .bmAttributes = BMATTRIBUTE_RESERVED,
+ .bMaxPower = 50,
+ },
-+ .uif[0] = {
-+ .bLength = USB_DT_INTERFACE_SIZE,
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0x00,
-+ .bAlternateSetting = 0x00,
-+ .bNumEndpoints = 0x00,
-+ .bInterfaceClass = 0xfe,
-+ .bInterfaceSubClass = 0x01,
-+ .bInterfaceProtocol = 0x02,
-+ .iInterface = DFU_STR_ALT0,
-+ },
-+ .uif[1] = {
-+ .bLength = USB_DT_INTERFACE_SIZE,
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0x00,
-+ .bAlternateSetting = 0x01,
-+ .bNumEndpoints = 0x00,
-+ .bInterfaceClass = 0xfe,
-+ .bInterfaceSubClass = 0x01,
-+ .bInterfaceProtocol = 0x02,
-+ .iInterface = DFU_STR_ALT1,
-+ },
-+ .uif[2] = {
-+ .bLength = USB_DT_INTERFACE_SIZE,
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0x00,
-+ .bAlternateSetting = 0x02,
-+ .bNumEndpoints = 0x00,
-+ .bInterfaceClass = 0xfe,
-+ .bInterfaceSubClass = 0x01,
-+ .bInterfaceProtocol = 0x02,
-+ .iInterface = DFU_STR_ALT2,
-+ },
-+ .uif[3] = {
-+ .bLength = USB_DT_INTERFACE_SIZE,
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0x00,
-+ .bAlternateSetting = 0x03,
-+ .bNumEndpoints = 0x00,
-+ .bInterfaceClass = 0xfe,
-+ .bInterfaceSubClass = 0x01,
-+ .bInterfaceProtocol = 0x02,
-+ .iInterface = DFU_STR_ALT3,
-+ },
-+ .uif[4] = {
-+ .bLength = USB_DT_INTERFACE_SIZE,
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0x00,
-+ .bAlternateSetting = 0x04,
-+ .bNumEndpoints = 0x00,
-+ .bInterfaceClass = 0xfe,
-+ .bInterfaceSubClass = 0x01,
-+ .bInterfaceProtocol = 0x02,
-+ .iInterface = DFU_STR_ALT4,
-+ },
-+ .uif[5] = {
-+ .bLength = USB_DT_INTERFACE_SIZE,
-+ .bDescriptorType = USB_DT_INTERFACE,
-+ .bInterfaceNumber = 0x00,
-+ .bAlternateSetting = 0x05,
-+ .bNumEndpoints = 0x00,
-+ .bInterfaceClass = 0xfe,
-+ .bInterfaceSubClass = 0x01,
-+ .bInterfaceProtocol = 0x02,
-+ .iInterface = DFU_STR_ALT5,
-+ },
+ .func_dfu = DFU_FUNC_DESC,
+};
+
@@ -1075,6 +1009,21 @@
+
+int dfu_init_instance(struct usb_device_instance *dev)
+{
++ int i;
++
++ for (i = 0; i != DFU_NUM_ALTERNATES; i++) {
++ struct usb_interface_descriptor *uif =
++ dfu_cfg_descriptor.uif+i;
++
++ uif->bLength = USB_DT_INTERFACE_SIZE;
++ uif->bDescriptorType = USB_DT_INTERFACE;
++ uif->bAlternateSetting = i;
++ uif->bInterfaceClass = 0xfe;
++ uif->bInterfaceSubClass = 1;
++ uif->bInterfaceProtocol = 2;
++ uif->iInterface = DFU_STR_ALT(i);
++ }
++
+ dev->dfu_dev_desc = &dfu_dev_descriptor;
+ dev->dfu_cfg_desc = &dfu_cfg_descriptor;
+ dev->dfu_state = DFU_STATE_appIDLE;
@@ -1294,7 +1243,7 @@
{
int i;
for (i = 0; i < strlen (str) && str[i]; i++){
-@@ -648,6 +663,9 @@
+@@ -654,6 +669,9 @@
device_instance->bus = bus_instance;
device_instance->configurations = NUM_CONFIGS;
device_instance->configuration_instance_array = config_instance;
@@ -1332,7 +1281,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/usb_dfu.h
-@@ -0,0 +1,99 @@
+@@ -0,0 +1,94 @@
+#ifndef _DFU_H
+#define _DFU_H
+
@@ -1391,22 +1340,17 @@
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
++#ifndef DFU_NUM_ALTERNATES
+#define DFU_NUM_ALTERNATES 6
++#endif
+
+#define DFU_STR_MANUFACTURER STR_MANUFACTURER
+#define DFU_STR_PRODUCT STR_PRODUCT
+#define DFU_STR_SERIAL STR_SERIAL
+#define DFU_STR_CONFIG (STR_COUNT)
-+#define DFU_STR_ALT0 (STR_COUNT+1)
-+#define DFU_STR_ALT1 (STR_COUNT+2)
-+#define DFU_STR_ALT2 (STR_COUNT+3)
-+#define DFU_STR_ALT3 (STR_COUNT+4)
-+#define DFU_STR_ALT4 (STR_COUNT+5)
-+#define DFU_STR_ALT5 (STR_COUNT+6)
-+#define DFU_STR_COUNT (STR_COUNT+7)
++#define DFU_STR_ALT(n) (STR_COUNT+(n)+1)
++#define DFU_STR_COUNT DFU_STR_ALT(DFU_NUM_ALTERNATES)
+
-+#define DFU_NUM_STRINGS (STR_COUNT+8)
-+
+#define CONFIG_DFU_CFG_STR "USB Device Firmware Upgrade"
+#define CONFIG_DFU_ALT0_STR "RAM 0x32000000"
+
@@ -1623,7 +1567,7 @@
ifeq ($(ARCH),mips)
BIN_FILES += inca-swap-bytes$(SFX)
-@@ -140,6 +140,10 @@
+@@ -141,6 +141,10 @@
$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
$(STRIP) $@
@@ -1993,7 +1937,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -278,6 +278,12 @@
+@@ -298,6 +298,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 2008-01-29 14:02:00 UTC (rev 3977)
+++ trunk/src/target/u-boot/patches/uboot-gta02.patch 2008-01-29 15:52:54 UTC (rev 3978)
@@ -4,7 +4,7 @@
===================================================================
--- u-boot.orig/Makefile
+++ u-boot/Makefile
-@@ -2334,6 +2334,14 @@
+@@ -2423,6 +2423,14 @@
sbc2410x_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
@@ -93,7 +93,7 @@
===================================================================
--- /dev/null
+++ u-boot/board/neo1973/gta02/gta02.c
-@@ -0,0 +1,449 @@
+@@ -0,0 +1,448 @@
+/*
+ * (C) 2006-2007 by OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -507,14 +507,13 @@
+ return 1;
+}
+
-+/* The sum of all part_size[]s must equal to the NAND size, i.e., 0x4000000.
-+ "initrd" is sized such that it can hold two uncompressed 16 bit 640*480
-+ images: 640*480*2*2 = 1228800 < 1245184. */
++/* The sum of all part_size[]s must equal to the NAND size, i.e., 0x8000000. */
+
+unsigned int dynpart_size[] = {
-+ CFG_UBOOT_SIZE, CFG_ENV_SIZE, 0x200000, 0xa0000, 0x1fce0000, 0 };
++ CFG_UBOOT_SIZE, CFG_ENV_SIZE, 0x800000, 0xa0000, 0x40000,
++ 0x8000000-CFG_UBOOT_SIZE-CFG_ENV_SIZE-0x800000-0xa0000-0x40000, 0 };
+char *dynpart_names[] = {
-+ "u-boot", "u-boot_env", "kernel", "splash", "rootfs", NULL };
++ "u-boot", "u-boot_env", "kernel", "splash", "factory", "rootfs", NULL };
+
+
+const char *neo1973_get_charge_status(void)
@@ -610,7 +609,7 @@
===================================================================
--- /dev/null
+++ u-boot/include/configs/neo1973_gta02.h
-@@ -0,0 +1,282 @@
+@@ -0,0 +1,284 @@
+/*
+ * (C) Copyright 2007 OpenMoko, Inc.
+ * Author: Harald Welte <laforge at openmoko.org>
@@ -747,7 +746,7 @@
+#define CONFIG_S3C2442 1 /* SAMSUNG S3C2442 SoC */
+#endif
+
-+#define CFG_CBSIZE 256 /* Console I/O Buffer Size */
++#define CFG_CBSIZE 1024 /* Console I/O Buffer Size */
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
+#define CFG_MAXARGS 64 /* max number of command args */
+#define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
@@ -801,7 +800,7 @@
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "usbtty=cdc_acm\0" \
-+ "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
++ "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock5 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
+ ""
+
+/*-----------------------------------------------------------------------
@@ -888,10 +887,12 @@
+#define CONFIG_RTC_PCF50633 1
+
+#define MTDIDS_DEFAULT "nand0=neo1973-nand"
-+#define MTPARTS_DEFAULT "neo1973-nand:256k(u-boot),128k(u-boot_env),2M(kernel),640k(splash),-(rootfs)"
++//#define MTPARTS_DEFAULT "neo1973-nand:256k(u-boot),128k(u-boot_env),8M(kernel),640k(splash),256k(factory),-(rootfs)"
+#define CFG_NAND_DYNPART_MTD_KERNEL_NAME "neo1973-nand"
+#define CONFIG_NAND_DYNPART
+
++#define DFU_NUM_ALTERNATES 7
++
+#endif /* __CONFIG_H */
Index: u-boot/board/neo1973/gta02/split_by_variant.sh
===================================================================
@@ -1891,8 +1892,8 @@
COBJS-y += pcf50606.o
+COBJS-y += pcf50633.o
COBJS-y += status_led.o
+ COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
- COBJS := $(COBJS-y)
Index: u-boot/common/cmd_nand.c
===================================================================
--- u-boot.orig/common/cmd_nand.c
Modified: trunk/src/target/u-boot/patches/uboot-neo1973_defaultconsole_usbtty.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-neo1973_defaultconsole_usbtty.patch 2008-01-29 14:02:00 UTC (rev 3977)
+++ trunk/src/target/u-boot/patches/uboot-neo1973_defaultconsole_usbtty.patch 2008-01-29 15:52:54 UTC (rev 3978)
@@ -23,11 +23,11 @@
===================================================================
--- u-boot.orig/include/configs/neo1973_gta02.h
+++ u-boot/include/configs/neo1973_gta02.h
-@@ -190,6 +190,7 @@
+@@ -189,6 +189,7 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
"usbtty=cdc_acm\0" \
+ "stderr=usbtty\0stdout=usbtty\0stdin=usbtty\0" \
- "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
+ "bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8\0" \
""
More information about the commitlog
mailing list