Skip to content
Snippets Groups Projects
  1. May 01, 2013
    • Wolfgang Denk's avatar
      setexpr: add regex substring matching and substitution · 855f18ea
      Wolfgang Denk authored
      
      Add "setexpr name gsub r s [t]" and "setexpr name sub r s [t]"
      commands which implement substring matching for the regular
      expression <r> in the string <t>, and substitution of the string <s>.
      The result is assigned to the environment variable <name>.  If <t> is
      not supplied, the previous value of <name> is used instead.  "gsub"
      performs global substitution, while "sub" will replace only the first
      substring.
      
      Both commands are closely modeled after the gawk functions with the
      same names.
      
      Examples:
      
      - Generate broadcast address by substituting the last two numbers of
        the IP address by "255.255":
      
        	=> print ipaddr
      	ipaddr=192.168.1.104
      	=> setexpr broadcast sub "(.*\\.).*\\..*" "\\1255.255" $ipaddr
      	broadcast=192.168.255.255
      
      - Depending on keyboard configuration (German vs. US keyboard) a
        barcode scanner may initialize the MAC address as C0:E5:4E:02:06:DC
        or as C0>E5>4E>02>06>DC.  Make sure we always have a correct value:
      
      	=> print ethaddr
      	ethaddr=C0>E5>4E>02>06>DC
      	=> setexpr ethaddr gsub > :
      	ethaddr=C0:E5:4E:02:06:DC
      
      - Do the same, but substitute one step at a time in a loop until no
        futher matches:
      
      	=> setenv ethaddr C0>E5>4E>02>06>DC
      	=> while setexpr ethaddr sub > :
      	> do
      	> echo -----
      	> done
      	ethaddr=C0:E5>4E>02>06>DC
      	-----
      	ethaddr=C0:E5:4E>02>06>DC
      	-----
      	ethaddr=C0:E5:4E:02>06>DC
      	-----
      	ethaddr=C0:E5:4E:02:06>DC
      	-----
      	ethaddr=C0:E5:4E:02:06:DC
      	-----
      	C0:E5:4E:02:06:DC: No match
      	=> print ethaddr
      	ethaddr=C0:E5:4E:02:06:DC
      
      etc.
      
      To enable this feature, the CONFIG_REGEX option has to be defined in
      the board config file.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      855f18ea
    • Wolfgang Denk's avatar
      setexpr: simplify code, improve help message · 103c94b1
      Wolfgang Denk authored
      
      Simplify the argument checking for the "setexpr" command.  This is
      done mainly to make future extensions easier.
      
      Also improve the help message for the one argument version of the
      command - this does not "load an address", but a value, which in
      this context may be a plain number or a pointer dereference.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      103c94b1
    • Wolfgang Denk's avatar
      "env grep" - add support for regular expression matches · be29df6a
      Wolfgang Denk authored
      
      When CONFIG_REGEX is enabled, the new option "-e" becomes available
      which causes regular expression matches to be used.  This allows for
      example things like these:
      
      - print all MAC addresses:
      
      	=> env grep -e eth.*addr
      	eth1addr=00:10:ec:80:c5:15
      	ethaddr=00:10:ec:00:c5:15
      
      - print all variables that have at least 2 colons in their value:
      
      	=> env grep -v -e :.*:
      	addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
      	panic=1
      	eth1addr=00:10:ec:80:c5:15
      	ethaddr=00:10:ec:00:c5:15
      	ver=U-Boot 2013.04-rc1-00289-g497746b-dirty (Mar 22 2013 - 12:50:25)
      
      etc.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      be29df6a
    • Wolfgang Denk's avatar
      "env grep" - add options to grep in name, value, or both. · d87244d5
      Wolfgang Denk authored
      
      Add options to "env grep" command:
      
      -n : search only the envrironment variable names
      -v : search only their values
      -b : search both names and values (= default)
      
      An option "--" will stop parsing options, so to print variables that
      contain the striing "- " please use:
      
      	env grep -- "- "
      
      Or to print all environment varioables which have a '-' in their name,
      use:
      
      	env grep -n -- -
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      d87244d5
    • Wolfgang Denk's avatar
      "env grep" - reimplement command using hexport_r() · 5a31ea04
      Wolfgang Denk authored
      
      Also drop hstrstr_r() which is not needed any more.
      The new code is way more flexible.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      5a31ea04
    • Wolfgang Denk's avatar
      hashtable: preparations to use hexport_r() for "env grep" · ea009d47
      Wolfgang Denk authored
      
      The output of "env grep" is unsorted, and printing is done by a
      private implementation to parse the hash table.  We have all the
      needed code in place in hexport_r() alsready, so let's use this
      instead.  Here we prepare the code for this, without any functional
      changes yet.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      ea009d47
    • Simon Glass's avatar
      sandbox: fs: Add support for saving files to host filesystem · 7eb2c8d5
      Simon Glass authored
      
      This allows write of files from the host filesystem in sandbox. There is
      currently no concept of overwriting the file and removing its existing
      contents - all writing is done on top of what is there. This means that
      writing 10 bytes to the start of a 1KB file will only update those 10
      bytes, not truncate the file to 10 byte slong.
      
      If the file does not exist it is created.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      7eb2c8d5
    • Simon Glass's avatar
      sandbox: Support 'source' command · 4ca30d60
      Simon Glass authored
      
      Enhance the source command to work with sandbox, by using map_sysmem() to
      convert a ulong address into a pointer.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      4ca30d60
    • Simon Glass's avatar
      Revert "fdt- Tell the FDT library where the device tree is" · 095686d3
      Simon Glass authored
      
      This reverts commit 3b73459e.
      
      In practice it doesn't seem like a good idea to make the the working
      FDT point to the control FDT. Now that we can access the control FDT
      using the 'fdt' command, there is no need for this feature. Remove it.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      095686d3
    • Simon Glass's avatar
      sandbox: fdt: Support fdt command for sandbox · a92fd657
      Simon Glass authored
      
      By using map_sysmem() we can get the fdt command to work correctly with
      sandbox.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      a92fd657
    • Simon Glass's avatar
      fdt: Allow fdt command to check and update control FDT · 4b578655
      Simon Glass authored
      
      There is an existing fdt command to deal with the working FDT. Enhance this
      to support the control FDT also (CONFIG_OF_CONTROL).
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      4b578655
    • Simon Glass's avatar
      Add getenv_hex() to return an environment variable as hex · 76b8f79c
      Simon Glass authored
      
      This conversion is required in a number of places in U-Boot. Add a
      standard function to provide this feature, so we avoid all the different
      variations in the way it is coded.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      76b8f79c
    • Simon Glass's avatar
      fdt: Add a parameter to fdt_valid() · d14da913
      Simon Glass authored
      
      At present this only checks working_fdt, but we want to check other FDTs
      also. So add the FDT to check as a parameter to fdt_valid().
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      d14da913
    • Simon Glass's avatar
      sandbox: Add CONFIG_OF_HOSTFILE to read FDT from host file · f828bf25
      Simon Glass authored
      
      With sandbox it is tricky to add an FDT to the image at build time (or
      later) since we build an ELF file, not a plain binary, and the address
      space of the whole U-Boot is not accessible in the emulated memory map
      of sandbox.
      
      Sandbox can read files directly from the host, though, so add an option
      to read an FDT from a host file on start-up.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      f828bf25
    • Simon Glass's avatar
      sandbox: Switch over to generic board · a733b06b
      Simon Glass authored
      
      Add generic board support for sandbox. and remove the old board init code.
      
      Select CONFIG_SYS_GENERIC_BOARD for sandbox now that this is supported.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      Reviewed-by: default avatarTom Rini <trini@ti.com>
      a733b06b
  2. Apr 22, 2013
    • Stefan Roese's avatar
      flash: Add optional verify-after-write feature · 352ef3f1
      Stefan Roese authored
      
      Sometimes it might make sense to verify the written data to NOR flash.
      This patch adds this feature. To enable this verify-after-write, you
      need to define CONFIG_FLASH_VERIFY in your board config header.
      
      Please note that this option is useless in nearly all cases,
      since such flash programming errors usually are detected earlier
      while unprotecting/erasing/programming. Please only enable
      this option if you really know what you are doing.
      
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      352ef3f1
  3. Apr 17, 2013
  4. Apr 15, 2013
    • Simon Glass's avatar
      x86: Allow setup code to manage its own global data · 7525c2da
      Simon Glass authored
      
      Currently x86 has its own means of managing the global data and board data
      (bd_t), and this code resides in start.S. With generic board, we need to
      ensure that we leave this alone - i.e. don't clear it as we do on other
      archs.
      
      This fixes a problem where the memory init data is cleared which causes
      the video driver to operate very slowly.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      7525c2da
    • Simon Glass's avatar
      x86: Fix DRAM bank size init with generic board · 8b42dfc3
      Simon Glass authored
      
      The intention of the memory init code is that it should work the same with
      CONFIG_SYS_GENERIC_BOARD and without. This is tricky because dram_init()
      is called prior to relocation with generic board (matching other archs)
      and after relocation without generic board.
      
      Adjust the init sequence so that dram_init() is not called in the generic
      board case, which seems like the easiest fix for now. Also ensure that
      relocation addresses are still calculated.
      
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      8b42dfc3
  5. Apr 12, 2013
    • Che-liang Chiou's avatar
      tpm: Add TPM command library · 8732b070
      Che-liang Chiou authored
      
      TPM command library implements a subset of TPM commands defined in TCG
      Main Specification 1.2 that are useful for implementing secure boot.
      More TPM commands could be added out of necessity.
      
      You may exercise these commands through the 'tpm' command.  However, the
      raw TPM commands are too primitive for writing secure boot in command
      interpreter scripts; so the 'tpm' command also provides helper functions
      to make scripting easier.
      
      For example, to define a counter in TPM non-volatile storage and
      initialize it to zero:
      
      $ tpm init
      $ tpm startup TPM_ST_CLEAR
      $ tpm nv_define d 0x1001 0x1
      $ tpm nv_write d 0x1001 0
      
      And then increment the counter by one:
      
      $ tpm nv_read d 0x1001 i
      $ setexpr.l i $i + 1
      $ tpm nv_write d 0x1001 $i
      
      Signed-off-by: default avatarChe-Liang Chiou <clchiou@chromium.org>
      8732b070
  6. Apr 11, 2013
  7. Apr 10, 2013
  8. Apr 08, 2013
  9. Apr 05, 2013
  10. Apr 02, 2013
    • Stephen Warren's avatar
      mmc: don't allow extra cmdline arguments · 9fd38372
      Stephen Warren authored
      
      The "mmc rescan" command takes no arguments. However, executing
      "mmc rescan 1" succeeds, leading the user to believe that MMC device 1
      has been rescanned. In fact, the "current" MMC device has been
      rescanned, and the current device may well not be 1. Add error-checking
      to the "mmc" command to explicitly reject any extra command-line
      arguments so that it's more obvious when U-Boot isn't doing what the
      user thought they asked it to.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      9fd38372
    • Rob Herring's avatar
      env: fix potential stack overflow in environment functions · 60d7d5a6
      Rob Herring authored
      
      Most of the various environment functions create CONFIG_ENV_SIZE buffers on
      the stack. At least on ARM and PPC which have 4KB stacks, this can overflow
      the stack if we have large environment sizes. So move all the buffers off
      the stack to static buffers.
      
      Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
      60d7d5a6
  11. Apr 01, 2013
    • York Sun's avatar
      Consolidate bool type · 472d5460
      York Sun authored
      
      'bool' is defined in random places. This patch consolidates them into a
      single header file include/linux/types.h, using stdbool.h introduced in C99.
      
      All other #define, typedef and enum are removed. They are all consistent with
      true = 1, false = 0.
      
      Replace FALSE, False with false. Replace TRUE, True with true.
      Skip *.py, *.php, lib/* files.
      
      Signed-off-by: default avatarYork Sun <yorksun@freescale.com>
      472d5460
  12. Mar 29, 2013
Loading