1. 02 5月, 2013 15 次提交
    • E
      disk/gpt: Fix GPT partition handling for blocksize != 512 · ae1768a7
      Egbert Eich 提交于
      Disks beyond 2T in size use blocksizes of 4096 bytes. However a lot of
      code in u-boot  still assumes a 512 byte blocksize.
      This patch fixes the handling of GPTs.
      Signed-off-by: NEgbert Eich <eich@suse.com>
      ae1768a7
    • E
      disk/part_dos: check harder for partition table · 9d956e0f
      Egbert Eich 提交于
      Devices that used to have a whole disk FAT filesystem but got then
      partitioned will most likely still have a FAT or FAT32 signature
      in the first sector as this sector does not get overwritten by
      a partitioning tool (otherwise the tool would risk to kill the mbr).
      
      The current partition search algorithm will erronously detects such
      a device as a raw FAT device.
      
      Instead of looking for the FAT or FAT32 signatures immediately we
      use the same algorithm as used by the Linux kernel and first check
      for a valid boot indicator flag on each of the 4 partitions.
      If the value of this flag is invalid for the first entry we then
      do the raw partition check.
      If the flag for any higher partition is wrong we assume the device
      is neiter a MBR nor PBR device.
      Signed-off-by: NEgbert Eich <eich@suse.com>
      9d956e0f
    • S
      mmc: Define a constant for the maximum block size · 8bfa195e
      Simon Glass 提交于
      The number 512 appears quite a bit in the mmc code. Add a constant for this
      so that it can be used here and in other parts of the code (e.g. SPL code
      which loads from mmc).
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NVadim Bendebury <vbendeb@google.com>
      8bfa195e
    • W
      3f9315c0
    • W
      amcc-common.h: minor white space cleanup · c88840af
      Wolfgang Denk 提交于
      Align some comments.
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      Acked-by: NStefan Roese <sr@denx.de>
      c88840af
    • W
      m28evk: enable "env grep" and regexp support · ee747a21
      Wolfgang Denk 提交于
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      
      Conflicts:
      	include/configs/m28evk.h
      ee747a21
    • W
      m28evk: white space cleanup · 5f71bca7
      Wolfgang Denk 提交于
      Change all "#define<TAB>" sequences into "#define<SPACE>"
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      Acked-by: NMarek Vasut <marex@denx.de>
      5f71bca7
    • W
      setexpr: add regex substring matching and substitution · 855f18ea
      Wolfgang Denk 提交于
      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: NWolfgang Denk <wd@denx.de>
      855f18ea
    • W
      setexpr: simplify code, improve help message · 103c94b1
      Wolfgang Denk 提交于
      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: NWolfgang Denk <wd@denx.de>
      103c94b1
    • W
      "env grep" - add support for regular expression matches · be29df6a
      Wolfgang Denk 提交于
      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: NWolfgang Denk <wd@denx.de>
      be29df6a
    • W
      Add SLRE - Super Light Regular Expression library · a5ecbe62
      Wolfgang Denk 提交于
      Downloaded from http://slre.sourceforge.net/
      and adapted for U-Boot environment.
      
      Used to implement regex operations on environment variables.
      Code size is ~ 3.5 KiB on PPC.
      
      To enable this code, define the  CONFIG_REGEX  option in your board
      config file.
      
      Note:  There are more recent versions of the SLRE library available at
      http://slre.googlecode.com ; unfortunately, the new code has a heavily
      reorked API which makes it less usable for our purposes:
      - the return code is strings, which are more difficult to process
      - we don't get any information any more which sub-string of the data
        was matched by the given regex
      - it is much more cumbersome to work with arbitrary expressions, where
        for example the number of substrings for capturing are not known at
        compile time
      Also, there does not seem to be any real changes or improvements of
      the functionality.
      
      Because of this, we deliberately stick with the older code.
      
      Note 2: the test code (built when SLRE_TEST is defined) was modified
      to allow for more extensive testing; now we can test the regexp
      matching on all lines on a text file (instead of the whole data in the
      file as a single block).
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      a5ecbe62
    • W
      "env grep" - add options to grep in name, value, or both. · d87244d5
      Wolfgang Denk 提交于
      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: NWolfgang Denk <wd@denx.de>
      d87244d5
    • W
      "env grep" - reimplement command using hexport_r() · 5a31ea04
      Wolfgang Denk 提交于
      Also drop hstrstr_r() which is not needed any more.
      The new code is way more flexible.
      Signed-off-by: NWolfgang Denk <wd@denx.de>
      5a31ea04
    • W
      hashtable: preparations to use hexport_r() for "env grep" · ea009d47
      Wolfgang Denk 提交于
      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: NWolfgang Denk <wd@denx.de>
      ea009d47
    • P
      spl_mmc: cleanup variable types · 2e222105
      Peter Korsgaard 提交于
      block_read returns unsigned long, so it doesn't make sense to check for
      < 0. and neither does marking the header structure as const and then
      casting away the constness to load data into it.
      
      Also cleanup some unneeded pointer casting while we're at it.
      Signed-off-by: NPeter Korsgaard <peter.korsgaard@barco.com>
      Reviewed-by: NTom Rini <trini@ti.com>
      2e222105
  2. 01 5月, 2013 18 次提交
  3. 30 4月, 2013 5 次提交
  4. 22 4月, 2013 2 次提交