This weekend I spent some more time looking at u-boot. I know that there have been discussions of using other bootloaders in the future, and I do not want to distract the core developers from GTA02 tasks, but I hope that the information and patches here will be of some use to the community.

Right now the default bitbake recipe is "u-boot-openmoko_1.3.1+git+svn.bb", which uses the upstream "v1.3.2-rc2" tag. This recipe also appears to lack the "fix-data-abort-from-sd-ombug799.patch" workaround that is required to boot from SD.

The first attachment to this email is a patch to create a "u-boot-openmoko_1.3.2+git+svn.bb" recipe that uses the upstream "1.3.2" version, with the ombug799 patch. I have tested this briefly and it looks OK, so if other testers can confirm this I would suggest adding this recipe to OE for now (until upstream 1.3.3 comes out).

The second attachment is a patch to create a bitbake recipe that tracks the upstream git HEAD (currently v1.3.3-rc3, with a 1.3.3 final release scheduled for May 12). Here the situation is not as clean, and additional changes are required:

The Openmoko patches do not apply to this tree. The third attachment is a set of patches to the Openmoko patches that are enough for the do_quilt() stage to succeed, although there are still lots of "offset" and "fuzz" warnings that could be cleaned up.

The fourth attachment is for a change for the rtc_get() function from a 'void' to an 'int' return value. This probably belongs in the "quilt" patch series rather than in its current form as an OpenEmbedded patch.

The fifth attachment reverses the upstream commit de109d909707e2dfe806be5efc3cdb103b47c8ad, "Makefile: fix parallel builds", which was applied after 1.3.3-rc2. I don't know why but this change results in a bricked device (at least on my gta01bv4) - on power-up, there is no splash-screen and nothing is written to the serial console. I do not know whether this is something that should be reported to the u-boot development list or whether it is just that some of the Openmoko-specific code needs to be updated to deal with the change.

Comments are welcome.

--- u-boot-openmoko_1.3.1+git+svn.bb    2008-05-04 17:52:48.000000000 -0700
+++ u-boot-openmoko_1.3.2+git+svn.bb    2008-05-04 17:57:48.000000000 -0700
@@ -4,12 +4,13 @@
 SECTION = "bootloader"
 PRIORITY = "optional"
 
-UBOOT_UPSTREAM_REV = "b29661fc1151077776454288051bc9a488351ce8"
+UBOOT_UPSTREAM_REV = "30f1806f60978d707b0cff2d7bf89d141fc24290"
 UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4 gta02v2 gta02v3 gta02v4 gta02v5"
 SRCREV_FORMAT = "patchset"
 
-PV = "1.3.1+svnr${SRCREV}+git${UBOOT_UPSTREAM_REV}"
-PR = "r3"
+LOCALVERSION = "+svnr${SRCREV}+git${UBOOT_UPSTREAM_REV}"
+PV = "1.3.2${LOCALVERSION}"
+PR = "r1"
 
 PROVIDES = "virtual/bootloader"
 S = "${WORKDIR}/git"
@@ -18,6 +19,7 @@
   
git://www.denx.de/git/u-boot.git;protocol=git;tag=${UBOOT_UPSTREAM_REV};name=upstream
 \
   
svn://svn.openmoko.org/trunk/src/target/u-boot;module=patches;proto=http;name=patchset
 \
   file://uboot-20070311-tools_makefile_ln_sf.patch;patch=1 \
+  file://fix-data-abort-from-sd-ombug799.patch;patch=1 \
 "
 
 EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}"
--- u-boot-openmoko_1.3.1+git+svn.bb    2008-05-04 17:52:48.000000000 -0700
+++ u-boot-openmoko_head.bb     2008-05-04 18:37:20.000000000 -0700
@@ -3,21 +3,24 @@
 LICENSE = "GPL"
 SECTION = "bootloader"
 PRIORITY = "optional"
+DEFAULT_PREFERENCE = "-1"
 
-UBOOT_UPSTREAM_REV = "b29661fc1151077776454288051bc9a488351ce8"
 UBOOT_MACHINES = "gta01bv2 gta01bv3 gta01bv4 gta02v2 gta02v3 gta02v4 gta02v5"
 SRCREV_FORMAT = "patchset"
 
-PV = "1.3.1+svnr${SRCREV}+git${UBOOT_UPSTREAM_REV}"
-PR = "r3"
+LOCALVERSION = "+svnr${SRCREV}+git${SRCDATE}"
+PV = "1.3.3pre${LOCALVERSION}"
+PR = "r0"
 
 PROVIDES = "virtual/bootloader"
 S = "${WORKDIR}/git"
 
 SRC_URI = "\
-  
git://www.denx.de/git/u-boot.git;protocol=git;tag=${UBOOT_UPSTREAM_REV};name=upstream
 \
+  git://www.denx.de/git/u-boot.git;protocol=git;name=upstream \
   
svn://svn.openmoko.org/trunk/src/target/u-boot;module=patches;proto=http;name=patchset
 \
-  file://uboot-20070311-tools_makefile_ln_sf.patch;patch=1 \
+  file://fix-data-abort-from-sd-ombug799.patch;patch=1 \
+  file://int_rtc_get.patch;patch=1 \
+  file://revert_git_de109d90.patch;patch=1 \
 "
 
 EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX}"
diff -u git.old/patches/dynenv-harden.patch git/patches/dynenv-harden.patch
--- git.old/patches/dynenv-harden.patch 2007-09-17 16:38:00.000000000 -0700
+++ git/patches/dynenv-harden.patch     2008-05-03 16:34:40.000000000 -0700
@@ -19,7 +19,7 @@
  
 -static int
 +int
- arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong 
*size)
+ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t 
*size)
  {
        int idx = nand_curr_device;
 Index: u-boot/include/util.h
diff -u git.old/patches/nand-dynamic_partitions.patch 
git/patches/nand-dynamic_partitions.patch
--- git.old/patches/nand-dynamic_partitions.patch       2008-02-14 
03:00:56.000000000 -0800
+++ git/patches/nand-dynamic_partitions.patch   2008-05-03 16:36:35.000000000 
-0700
@@ -234,8 +234,8 @@
  }
  
  int
--arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong 
*size)
-+arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, ulong 
*size, int net)
+-arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t 
*size)
++arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t 
*size, int net)
  {
        int idx = nand_curr_device;
  #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
Common subdirectories: git.old/patches/.svn and git/patches/.svn
diff -u git.old/patches/uboot-dfu.patch git/patches/uboot-dfu.patch
--- git.old/patches/uboot-dfu.patch     2008-02-14 03:00:56.000000000 -0800
+++ git/patches/uboot-dfu.patch 2008-05-03 16:39:13.000000000 -0700
@@ -1593,7 +1593,7 @@
 -BIN_FILES     = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) ubsha1$(SFX) 
gen_eth_addr$(SFX) bmp_logo$(SFX)
 +BIN_FILES     = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) ubsha1$(SFX) 
gen_eth_addr$(SFX) bmp_logo$(SFX) mkudfu$(SFX)
  
- OBJ_LINKS     = environment.o crc32.o sha1.o
+ OBJ_LINKS     = environment.o crc32.o md5.o sha1.o image.o
 -OBJ_FILES     = img2srec.o mkimage.o envcrc.o ubsha1.o gen_eth_addr.o 
bmp_logo.o
 +OBJ_FILES     = img2srec.o mkimage.o envcrc.o ubsha1.o gen_eth_addr.o 
bmp_logo.o mkudfu.o
  
diff -u git.old/patches/uboot-gta02.patch git/patches/uboot-gta02.patch
--- git.old/patches/uboot-gta02.patch   2008-04-02 17:07:54.000000000 -0700
+++ git/patches/uboot-gta02.patch       2008-05-03 16:42:26.000000000 -0700
@@ -2153,19 +2153,6 @@
                                        nand_info[i].erasesize >> 10);
                }
                return 0;
-Index: u-boot/drivers/mtd/nand/nand_ids.c
-===================================================================
---- u-boot.orig/drivers/mtd/nand/nand_ids.c
-+++ u-boot/drivers/mtd/nand/nand_ids.c
-@@ -67,7 +67,7 @@
- 
-       {"NAND 256MiB 3,3V 8-bit",      0x71, 512, 256, 0x4000, 0},
- 
--      {"NAND 512MiB 3,3V 8-bit",      0xDC, 512, 512, 0x4000, 0},
-+      //{"NAND 512MiB 3,3V 8-bit",    0xDC, 512, 512, 0x4000, 0},
- 
-       /* These are the new chips with large page size. The pagesize
-       * and the erasesize is determined from the extended id bytes
 Index: u-boot/board/neo1973/common/udc.c
 ===================================================================
 --- u-boot.orig/board/neo1973/common/udc.c
diff -u git.old/patches/uboot-mokoversion.patch 
git/patches/uboot-mokoversion.patch
--- git.old/patches/uboot-mokoversion.patch     2008-01-23 02:32:07.000000000 
-0800
+++ git/patches/uboot-mokoversion.patch 2008-05-03 16:25:16.000000000 -0700
@@ -1,10 +1,10 @@
-Index: u-boot/tools/setlocalversion
-===================================================================
---- u-boot.orig/tools/setlocalversion
-+++ u-boot/tools/setlocalversion
-@@ -20,3 +20,5 @@
-               printf '%s' -dirty
-       fi
+--- git/tools/setlocalversion  2008-05-03 16:22:20.000000000 -0700
++++ git.new/tools/setlocalversion      2008-05-03 16:24:52.000000000 -0700
+@@ -35,5 +35,7 @@
+       printf -- '-svn%s' $rev
  fi
-+
+ 
 +printf '%s' -moko12
++
+ # Check for any localversion-* files
+ printf '%s' "`cat localversion-* 2>/dev/null`"
diff -u git.old/patches/uboot-s3c24xx-nand-boot.patch 
git/patches/uboot-s3c24xx-nand-boot.patch
--- git.old/patches/uboot-s3c24xx-nand-boot.patch       2008-01-23 
02:32:07.000000000 -0800
+++ git/patches/uboot-s3c24xx-nand-boot.patch   2008-05-03 16:32:55.000000000 
-0700
@@ -142,7 +142,7 @@
        bl      cpu_init_crit
  #endif
  
--#ifdef        CONFIG_AT91RM9200
+-#ifndef       CONFIG_AT91RM9200
 +#if defined(CONFIG_AT91RM9200) || defined(CONFIG_S3C2410)
  
  #ifndef CONFIG_SKIP_RELOCATE_UBOOT
diff -u git.orig/drivers/misc/pcf50606.c git/drivers/misc/pcf50606.c
--- git.orig/drivers/misc/pcf50606.c    2008-05-03 17:05:02.000000000 -0700
+++ git/drivers/misc/pcf50606.c 2008-05-03 17:07:13.000000000 -0700
@@ -124,8 +124,10 @@
 }
 
 
-void rtc_get(struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
+       
        tmp->tm_sec = bcd2bin(pcf50606_reg_read(PCF50606_REG_RTCSC));
        tmp->tm_min = bcd2bin(pcf50606_reg_read(PCF50606_REG_RTCMN));
        tmp->tm_hour = bcd2bin(pcf50606_reg_read(PCF50606_REG_RTCHR));
@@ -139,6 +141,8 @@
                tmp->tm_year += 1900;
        tmp->tm_yday = 0;
        tmp->tm_isdst = 0;
+
+       return rel;
 }
 
 void rtc_set(struct rtc_time *tmp)
diff -u git.orig/drivers/misc/pcf50633.c git/drivers/misc/pcf50633.c
--- git.orig/drivers/misc/pcf50633.c    2008-05-03 17:05:02.000000000 -0700
+++ git/drivers/misc/pcf50633.c 2008-05-03 17:05:28.000000000 -0700
@@ -254,8 +254,10 @@
 }
 
 
-void rtc_get(struct rtc_time *tmp)
+int rtc_get(struct rtc_time *tmp)
 {
+       int rel = 0;
+       
        tmp->tm_sec = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCSC));
        tmp->tm_min = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCMN));
        tmp->tm_hour = bcd2bin(pcf50633_reg_read(PCF50633_REG_RTCHR));
@@ -269,6 +271,8 @@
                tmp->tm_year += 1900;
        tmp->tm_yday = 0;
        tmp->tm_isdst = 0;
+       
+       return rel;
 }
 
 void rtc_set(struct rtc_time *tmp)
diff --git a/Makefile b/Makefile
index ac0a17f..10324d2 100644
--- a/Makefile
+++ b/Makefile
@@ -201,6 +201,7 @@ OBJS := $(addprefix $(obj),$(OBJS))
 LIBS  = lib_generic/libgeneric.a
 LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
        "board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
+LIBS += board/$(BOARDDIR)/lib$(BOARD).a
 LIBS += cpu/$(CPU)/lib$(CPU).a
 ifdef SOC
 LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
@@ -247,9 +248,6 @@ LIBS += post/libpost.a
 LIBS := $(addprefix $(obj),$(LIBS))
 .PHONY : $(LIBS) $(VERSION_FILE)
 
-LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).a
-LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
-
 # Add GCC lib
 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) 
-lgcc
 
@@ -272,7 +270,7 @@ U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
 endif
 
 __OBJS := $(subst $(obj),,$(OBJS))
-__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
+__LIBS := $(subst $(obj),,$(LIBS))
 
 #########################################################################
 #########################################################################
@@ -315,9 +313,8 @@ $(obj)u-boot.sha1:  $(obj)u-boot.bin
 $(obj)u-boot.dis:      $(obj)u-boot
                $(OBJDUMP) -d $< > $@
 
-$(obj)u-boot:          depend $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) 
$(LDSCRIPT)
-               UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
-               sed  -n -e 
's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+$(obj)u-boot:          depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
+               UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 
's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
                cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
                        --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
                        -Map u-boot.map -o u-boot
@@ -328,9 +325,6 @@ $(OBJS):    depend $(obj)include/autoconf.mk
 $(LIBS):       depend $(obj)include/autoconf.mk
                $(MAKE) -C $(dir $(subst $(obj),,$@))
 
-$(LIBBOARD):   depend $(LIBS) $(obj)include/autoconf.mk
-               $(MAKE) -C $(dir $(subst $(obj),,$@))
-
 $(SUBDIRS):    depend $(obj)include/autoconf.mk
                $(MAKE) -C $@ all
 

Reply via email to