Skip to content
Snippets Groups Projects
  1. Oct 27, 2011
    • Simon Glass's avatar
      zlib: Fix integer cast of pointer · 41d68b32
      Simon Glass authored
      
      Fix to cast an integer to a pointer using uintptr_t.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      41d68b32
    • Marek Vasut's avatar
      GCC4.6: Squash warnings in LzmaTools.c · dd059842
      Marek Vasut authored
      
      LzmaTools.c: In function 'lzmaBuffToBuffDecompress':
      LzmaTools.c:70:5: warning: format '%lx' expects type 'long unsigned int', but
      argument 2 has type 'unsigned char *'
      LzmaTools.c:71:5: warning: format '%lx' expects type 'long unsigned int', but
      argument 2 has type 'unsigned char *'
      LzmaTools.c:72:5: warning: format '%lx' expects type 'long unsigned int', but
      argument 2 has type 'unsigned char *'
      LzmaTools.c:73:5: warning: format '%lx' expects type 'long unsigned int', but
      argument 2 has type 'unsigned char *'
      LzmaTools.c:74:5: warning: format '%lx' expects type 'long unsigned int', but
      argument 2 has type 'unsigned char *'
      LzmaTools.c:110:5: warning: format '%lx' expects type 'long unsigned int', but
      argument 2 has type 'SizeT'
      LzmaTools.c:111:5: warning: format '%lx' expects type 'long unsigned int', but
      argument 2 has type 'SizeT'
      
      Signed-off-by: default avatarMarek Vasut <marek.vasut@gmail.com>
      Cc: Wolfgang Denk <wd@denx.de>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Mike Frysinger <vapier@gentoo.org>
      dd059842
  2. Oct 26, 2011
    • Simon Glass's avatar
      fdt: add decode helper library · b5220bc6
      Simon Glass authored
      
      This library provides useful functions to drivers which want to use
      the fdt to control their operation. Functions are provided to:
      
      - look up and enumerate a device type (for example assigning i2c bus 0,
           i2c bus 1, etc.)
      - decode basic types from the fdt, like addresses and integers
      
      While this library is not strictly necessary, it helps to minimise the
      changes to a driver, in order to make it work under fdt control. Less
      code is required, and so the barrier to switch drivers over is lower.
      
      Additional functions to read arrays and GPIOs could be made available
      here also.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      b5220bc6
    • Simon Glass's avatar
      Move simple_itoa to vsprintf · 3cce8a54
      Simon Glass authored
      
      This function is generally useful and shouldn't hide away in hush. It
      has been moved as is.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      3cce8a54
  3. Oct 21, 2011
  4. Oct 17, 2011
  5. Oct 01, 2011
  6. Sep 09, 2011
    • Simon Glass's avatar
      Add assert() for debug assertions · 21726a7a
      Simon Glass authored
      
      assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
      This is useful when a condition is an error but a board reset is unlikely
      to fix it, so it is better to soldier on in hope. Assertion failures should
      be caught during development/test.
      
      It turns out that assert() is defined separately in a few places in U-Boot
      with various meanings. This patch cleans up some of these.
      
      Build errors exposed by this change (and defining DEBUG) are also fixed in
      this patch.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      21726a7a
  7. Aug 04, 2011
  8. Jul 29, 2011
  9. Jul 28, 2011
  10. Jul 26, 2011
  11. Jul 25, 2011
  12. Jul 15, 2011
    • David Gibson's avatar
      libfdt: Implement property iteration functions · d1c63148
      David Gibson authored
      
      For ages, we've been talking about adding functions to libfdt to allow
      iteration through properties.  So, finally, here are some.
      
      I got bogged down on this for a long time because I didn't want to
      expose offsets directly to properties to the callers.  But without
      that, attempting to make reasonable iteration functions just became
      horrible.  So eventually, I settled on an interface which does now
      expose property offsets.  fdt_first_property_offset() and
      fdt_next_property_offset() are used to step through the offsets of the
      properties starting from a particularly node offset.  The details of
      the property at each offset can then be retrieved with either
      fdt_get_property_by_offset() or fdt_getprop_by_offset() which have
      interfaces similar to fdt_get_property() and fdt_getprop()
      respectively.
      
      No explicit testcases are included, but we do use the new functions to
      reimplement the existing fdt_get_property() function.
      
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      
      This was extracted from the DTC commit:
      73dca9ae0b9abe6924ba640164ecce9f8df69c5a Mon Sep 17 00:00:00 2001
      
      Signed-off-by: default avatarGerald Van Baren <vanbaren@cideas.com>
      d1c63148
    • David Gibson's avatar
      Support ePAPR compliant phandle properties · 05a22ba0
      David Gibson authored
      
      Currently, the Linux kernel, libfdt and dtc, when using flattened
      device trees encode a node's phandle into a property named
      "linux,phandle".  The ePAPR specification, however - aiming as it is
      to not be a Linux specific spec - requires that phandles be encoded in
      a property named simply "phandle".
      
      This patch adds support for this newer approach to dtc and libfdt.
      Specifically:
      
      	- fdt_get_phandle() will now return the correct phandle if it
                is supplied in either of these properties
      
      	- fdt_node_offset_by_phandle() will correctly find a node with
                the given phandle encoded in either property.
      
      	- By default, when auto-generating phandles, dtc will encode
                it into both properties for maximum compatibility.  A new -H
                option allows either only old-style or only new-style
                properties to be generated.
      
      	- If phandle properties are explicitly supplied in the dts
      	  file, dtc will not auto-generate ones in the alternate format.
      
      	- If both properties are supplied, dtc will check that they
                have the same value.
      
      	- Some existing testcases are updated to use a mix of old and
                new-style phandles, partially testing the changes.
      
      	- A new phandle_format test further tests the libfdt support,
                and the -H option.
      
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      
      This was extracted from the DTC commit:
      d75b33af676d0beac8398651a7f09037555a550b Mon Sep 17 00:00:00 2001
      
      Signed-off-by: default avatarGerald Van Baren <vanbaren@cideas.com>
      05a22ba0
  13. May 12, 2011
  14. Apr 30, 2011
    • Mike Frysinger's avatar
      zlib: split up to match original source tree · e89516f0
      Mike Frysinger authored
      
      While looking to upgrade to zlib-1.2.5, the current mondo merge of
      multiple files into a single was making things way more difficult
      than it should have been.  Hard to pick out what has been changed
      to port it to U-Boot, been removed as useless, and bug fixes added
      after the fact.
      
      So split the single file up into the original file names, and merge
      non-essential changes back from the original tree (for some reason,
      style in code in a bunch of places was changed to U-Boot style even
      though this isn't "U-Boot" code).
      
      The original build style is retained -- we have a single zlib.c that
      includes all the other files, and that is the only file we compile.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      e89516f0
  15. Apr 27, 2011
    • Kim Phillips's avatar
      common: add a grepenv command · a000b795
      Kim Phillips authored
      
      u-boot environments, esp. when boards are shared across multiple
      users, can get pretty large and time consuming to visually parse.
      The grepenv command this patch adds can be used in lieu of printenv
      to facilitate searching.  grepenv works like printenv but limits
      its output only to environment strings (variable name and value
      pairs) that match the user specified substring.
      
      the following examples are on a board with a 5313 byte environment
      that spans multiple screen pages:
      
      Example 1:  summarize ethernet configuration:
      
      => grepenv eth TSEC
      etact=FM1@DTSEC2
      eth=FM1@DTSEC4
      ethact=FM1@DTSEC2
      eth1addr=00:E0:0C:00:8b:01
      eth2addr=00:E0:0C:00:8b:02
      eth3addr=00:E0:0C:00:8b:03
      eth4addr=00:E0:0C:00:8b:04
      eth5addr=00:E0:0C:00:8b:05
      eth6addr=00:E0:0C:00:8b:06
      eth7addr=00:E0:0C:00:8b:07
      eth8addr=00:E0:0C:00:8b:08
      eth9addr=00:E0:0C:00:8b:09
      ethaddr=00:E0:0C:00:8b:00
      netdev=eth0
      uprcw=setenv ethact $eth;setenv filename p4080ds/R_PPSXX_0xe/rcw_0xe_2sgmii_rev2_high.bin;setenv start 0xe8000000;protect off all;run upimage;protect on all
      upuboot=setenv ethact $eth;setenv filename u-boot.bin;setenv start eff80000;protect off all;run upimage;protect on all
      upucode=setenv ethact $eth;setenv filename fsl_fman_ucode_P4080_101_6.bin;setenv start 0xef000000;protect off all;run upimage;protect on all
      usdboot=setenv ethact $eth;tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/initramfs.cpio.gz.uboot;tftp c00000 $dir/p4080ds-usdpaa.dtb;setenv bootargs root=/dev/ram rw console=ttyS0,115200 $othbootargs;bootm 1000000 2000000 c00000;
      =>
      
      Example 2: detect unused env vars:
      
      => grepenv etact
      etact=FM1@DTSEC2
      =>
      
      Example 3: reveal hardcoded variables; e.g., for fdtaddr:
      
      => grepenv fdtaddr
      fdtaddr=c00000
      nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
      ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr
      => grep $fdtaddr
      fdtaddr=c00000
      my_boot=bootm 0x40000000 0x41000000 0x00c00000
      my_dtb=tftp 0x00c00000 $prefix/p4080ds.dtb
      nohvboot=tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/$ramdiskfile;tftp c00000 $dir/$fdtfile;setenv bootargs root=/dev/ram rw ramdisk_size=0x10000000 console=ttyS0,115200;bootm 1000000 2000000 c00000;
      =>
      
      This patch also enables the grepenv command by default on
      corenet_ds based boards (and repositions the DHCP command
      entry to keep the list sorted).
      
      Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
      Cc: Kumar Gala <kumar.gala@freescale.com>
      Cc: Andy Fleming <afleming@freescale.com>
      a000b795
    • Kim Phillips's avatar
      env: fix env var autocompletion · af4d9074
      Kim Phillips authored
      
      commit 560d424b "env: re-add
      support for auto-completion" fell short of its description -
      the 'used' logic in hmatch_r was reversed - 'used' is 0 if
      the hash table entry is not used, or -1 if deleted.  This
      patch makes hmatch_r actually match on valid ('used') entries,
      instead of skipping them and failing to match anything.
      
      typing 'printenv tft' and hitting 'tab' now displays valid
      choices for variable names.
      
      Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Tested-by: default avatarMike Frysinger <vapier@gentoo.org>
      af4d9074
  16. Apr 12, 2011
  17. Mar 22, 2011
  18. Jan 18, 2011
  19. Jan 17, 2011
  20. Jan 09, 2011
  21. Dec 17, 2010
    • Mike Frysinger's avatar
      hashtable: drop all non-reentrant versions · 2eb1573f
      Mike Frysinger authored
      
      The non-reentrant versions of the hashtable functions operate on a single
      shared hashtable.  So if two different people try using these funcs for
      two different purposes, they'll cause problems for the other.
      
      Avoid this by converting all existing hashtable consumers over to the
      reentrant versions and then punting the non-reentrant ones.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      2eb1573f
  22. Nov 28, 2010
  23. Nov 17, 2010
    • Sebastien Carlier's avatar
      Switch from archive libraries to partial linking · 6d8962e8
      Sebastien Carlier authored
      
      Before this commit, weak symbols were not overridden by non-weak symbols
      found in archive libraries when linking with recent versions of
      binutils.  As stated in the System V ABI, "the link editor does not
      extract archive members to resolve undefined weak symbols".
      
      This commit changes all Makefiles to use partial linking (ld -r) instead
      of creating library archives, which forces all symbols to participate in
      linking, allowing non-weak symbols to override weak symbols as intended.
      This approach is also used by Linux, from which the gmake function
      cmd_link_o_target (defined in config.mk and used in all Makefiles) is
      inspired.
      
      The name of each former library archive is preserved except for
      extensions which change from ".a" to ".o".  This commit updates
      references accordingly where needed, in particular in some linker
      scripts.
      
      This commit reveals board configurations that exclude some features but
      include source files that depend these disabled features in the build,
      resulting in undefined symbols.  Known such cases include:
      - disabling CMD_NET but not CMD_NFS;
      - enabling CONFIG_OF_LIBFDT but not CONFIG_QE.
      
      Signed-off-by: default avatarSebastien Carlier <sebastien.carlier@gmail.com>
      6d8962e8
  24. Oct 27, 2010
  25. Oct 26, 2010
    • Wolfgang Denk's avatar
      Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value · 25ddd1fb
      Wolfgang Denk authored
      
      CONFIG_SYS_GBL_DATA_SIZE has always been just a bad workarond for not
      being able to use "sizeof(struct global_data)" in assembler files.
      Recent experience has shown that manual synchronization is not
      reliable enough.  This patch renames CONFIG_SYS_GBL_DATA_SIZE into
      GENERATED_GBL_DATA_SIZE which gets automatically generated by the
      asm-offsets tool.  In the result, all definitions of this value can be
      deleted from the board config files.  We have to make sure that all
      files that reference such data include the new <asm-offsets.h> file.
      
      No other changes have been done yet, but it is obvious that similar
      changes / simplifications can be done for other, related macro
      definitions as well.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Acked-by: default avatarKumar Gala <galak@kernel.crashing.org>
      25ddd1fb
    • Wolfgang Denk's avatar
      include/asm-offsets.h: automatically generate assembler constants · 16a354f9
      Wolfgang Denk authored
      
      A recurrent issue is that certain C level constructs like sizeof() or
      offsetof() cannot be used in assembler files, which is inconvenient
      when such constructs are used in the definition of macro names etc.
      
      To avoid duplication of such definitions (and thus another cause of
      problems), we adapt the Linux way to automatically generate the
      respective definitions from the respective C header files.
      
      In Linux, this is implemented in include/linux/kbuild.h, Kbuild, and
      arch/*/kernel/asm-offsets.c; we adapt the code from the Linux v2.6.36
      kernel tree.
      
      We also copy the concept of the include/generated/ directory which can
      be used to hold other automatically generated files as well.
      
      We start with an architecture-independent lib/asm-offsets.c which
      generates include/generated/generic-asm-offsets.h (included by
      include/asm-offsets.h, which is what will be referred to in the actual
      source code).  Later this may be extended by architecture-specific
      arch/*/lib/asm-offsets.c files that will generate a
      include/generated/asm-offsets.h.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Acked-by: default avatarKumar Gala <galak@kernel.crashing.org>
      16a354f9
  26. Oct 12, 2010
    • Stefan Roese's avatar
      zlib: Add further watchdog reset calls · be4424c7
      Stefan Roese authored
      
      Patch 253cb831 [zlib: add watchdog reset call] added already a few
      watchdog reset calls to the new zlib U-Boot port. But on some boards
      this is not enough. Additional calls are needed on boards with
      short watchdog timeouts.
      
      This was detected and tested on the lwmon5 board with a very short
      watchdog timeout. Without this patch, the board resets during Linux
      kernel decompression. With it, the decompression succeeds.
      
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: Detlev Zundel <dzu@denx.de>
      Acked-by: default avatarDetlev Zundel <dzu@denx.de>
      be4424c7
    • Stefan Roese's avatar
      zlib/gunzip: Use WATCHDOG_RESET macro · f8526286
      Stefan Roese authored
      
      As usually done in U-Boot, the watchdog_reset code is called via a
      macro (WATCHDOG_RESET). In zlib.c this was done differently, by using
      a function pointer which is initialized with WATCHDOG_RESET upon watchdog
      usage or with NULL otherwise. This patch now uses the plain
      WATCHDOG_RESET macros to call the function resulting in slightly smaller
      U-Boot images and simpler code.
      
      U-Boot code size reduction:
      
      PowerPC board with watchdog support (lwmon5):
      -> 80 bytes smaller image size
      
      PowerPC board without watchdog support (sequoia):
      -> 112 bytes smaller image size
      
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Cc: Detlev Zundel <dzu@denx.de>
      Cc: Wolfgang Denk <wd@denx.de>
      Acked-by: default avatarDetlev Zundel <dzu@denx.de>
      f8526286
Loading