07 Mar, 2012

1 commit


02 Jun, 2011

1 commit


25 Jul, 2010

1 commit

  • Lots of code use this construct:

    cmd_usage(cmdtp);
    return 1;

    Change cmd_usage() let it return 1 - then we can replace all these
    ocurrances by

    return cmd_usage(cmdtp);

    This fixes a few places with incorrect return code handling, too.

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

05 Jul, 2010

1 commit

  • The hush shell dynamically allocates (and re-allocates) memory for the
    argument strings in the "char *argv[]" argument vector passed to
    commands. Any code that modifies these pointers will cause serious
    corruption of the malloc data structures and crash U-Boot, so make
    sure the compiler can check that no such modifications are being done
    by changing the code into "char * const argv[]".

    This modification is the result of debugging a strange crash caused
    after adding a new command, which used the following argument
    processing code which has been working perfectly fine in all Unix
    systems since version 6 - but not so in U-Boot:

    int main (int argc, char **argv)
    {
    while (--argc > 0 && **++argv == '-') {
    /* ====> */ while (*++*argv) {
    switch (**argv) {
    case 'd':
    debug++;
    break;
    ...
    default:
    usage ();
    }
    }
    }
    ...
    }

    The line marked "====>" will corrupt the malloc data structures and
    usually cause U-Boot to crash when the next command gets executed by
    the shell. With the modification, the compiler will prevent this with
    an
    error: increment of read-only location '*argv'

    N.B.: The code above can be trivially rewritten like this:

    while (--argc > 0 && **++argv == '-') {
    char *arg = *argv;
    while (*++arg) {
    switch (*arg) {
    ...

    Signed-off-by: Wolfgang Denk
    Acked-by: Mike Frysinger

    Wolfgang Denk
     

09 Dec, 2009

1 commit


25 Sep, 2009

1 commit

  • Commit 4abd844d8e extended the fdt command parser to handle property
    strings which are split across multiple arguments but it was broken for
    byte streams and strings.

    Byte stream parsing:

    * Fixes where it would terminate early or go into an endless loop.

    * Fixes a 0x00 being inserted into the data if there is a space after
    '[' or a separate argument.

    * Fixes dereferencing the argument pointer after the last argument.

    * Checks for bad characters.

    String parsing:

    * Treat multiple arguments as a string list. This fixes an issue where
    only the last argument was stored.

    Signed-off-by: Ken MacLeod

    Ken MacLeod
     

13 Jun, 2009

1 commit

  • Many of the help messages were not really helpful; for example, many
    commands that take no arguments would not print a correct synopsis
    line, but "No additional help available." which is not exactly wrong,
    but not helpful either.

    Commit ``Make "usage" messages more helpful.'' changed this
    partially. But it also became clear that lots of "Usage" and "Help"
    messages (fields "usage" and "help" in struct cmd_tbl_s respective)
    were actually redundant.

    This patch cleans this up - for example:

    Before:
    => help dtt
    dtt - Digital Thermometer and Thermostat

    Usage:
    dtt - Read temperature from digital thermometer and thermostat.

    After:
    => help dtt
    dtt - Read temperature from Digital Thermometer and Thermostat

    Usage:
    dtt

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

28 Jan, 2009

2 commits


19 Oct, 2008

1 commit


13 Sep, 2008

1 commit

  • Commit 2a1a2cb6 didnt remove the dummy mem reservation in fdt_chosen,
    and this stopped Linux from booting with a Ramdisk. This patch fixes
    this, by deleting the useless dummy mem reservation.

    When booting with a Ramdisk, a fix offset FDT_RAMDISK_OVERHEAD is now
    added to of_size, so we dont need anymore a dummy mem reservation.

    I measured the value of FDT_RAMDISK_OVERHEAD on a MPC8270 based
    system (=0x44 bytes) and rounded it up to 0x80).

    Signed-off-by: Heiko Schocher
    Acked-by: Kumar Gala

    Heiko Schocher
     

27 Aug, 2008

2 commits


25 Aug, 2008

1 commit

  • Replace the "must quote special characters" note with a hint on
    how to dereference /aliases pointers by omitting the leading "/".
    This feature was introduced by Kumar Gala as a libfdt enhancement
    in commit ed035708235332c3c117ee3bb1a426063f03cfcb.

    Example:

    => fdt print /aliases
    aliases {
    ethernet0 = "/qe@e0100000/ucc@2000";
    ethernet1 = "/qe@e0100000/ucc@3000";
    serial0 = "/soc8360@e0000000/serial@4500";
    serial1 = "/soc8360@e0000000/serial@4600";
    pci0 = "/pci@e0008500";
    };
    => fdt print ethernet0
    ucc@2000 {
    device_type = "network";
    compatible = "ucc_geth";
    cell-index = ;
    reg = ;
    interrupts = ;
    interrupt-parent = ;
    local-mac-address = [00 00 00 00 00 00];
    rx-clock-name = "none";
    tx-clock-name = "clk9";
    phy-handle = ;
    phy-connection-type = "rgmii-id";
    pio-handle = ;
    };

    Signed-off-by: Gerald Van Baren

    Gerald Van Baren
     

21 Aug, 2008

2 commits


10 Jul, 2008

1 commit

  • The compiler will help find mismatches between printf formats and
    arguments if you let it. This patch adds the necessary attributes to
    declarations in include/common.h, then begins to correct the resulting
    compiler warnings. Some of these were bugs, e.g., "$d" instead of
    "%d" and incorrect arguments. Others were just annoying, like
    int-long mismatches on a system where both are 32 bits. It's worth
    fixing the annoying errors to catch the real ones.

    Signed-off-by: Andrew Klossner

    Andrew Klossner
     

11 Jun, 2008

2 commits


10 Jun, 2008

2 commits


21 May, 2008

1 commit

  • This commit gets rid of a huge amount of silly white-space issues.
    Especially, all sequences of SPACEs followed by TAB characters get
    removed (unless they appear in print statements).

    Also remove all embedded "vim:" and "vi:" statements which hide
    indentation problems.

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

02 Apr, 2008

1 commit

  • The fdt set command was treating properties specified as and
    as byte streams, rather than as an array of cells. As we already have
    syntax for expressing the desire for a stream of bytes ([ xx xx ...]),
    we should use the <> syntax to describe arrays of cells, which are always
    32-bits per element. If we imagine this likely (IMHO) scenario:

    > fdt set /ethernet-phy@1 reg

    With the old code, this would create a bad fdt, since the reg cell would be
    made to be one byte in length. But the cell must be 4 bytes, so this would
    break mysteriously.

    Also, the dts spec calls for constants inside the angle brackets (<>)
    to conform to C constant standards as they pertain to base.
    Take this scenario:

    > fdt set /ethernet@f00 reg

    The old fdt command would complain that it couldn't parse that. Or, if you
    wanted to specify that a certain clock ran at 33 MHz, you'd be required to
    do this:

    > fdt set /mydev clock

    Whereas the new code will accept decimal numbers.

    While I was in there, I extended the fdt command parser to handle property
    strings which are split across multiple arguments:

    > fdt set /ethernet@f00 interrupts < 33 2 34 2 36 2 >
    > fdt p /ethernet@f00
    ethernet@f00 {
    interrupts = ;
    };

    Lastly, the fdt print code was rearranged slightly to print arrays of cells
    if the length of the property is a multiple of 4 bytes, and to not print
    leading zeros.

    Signed-off-by: Andy Fleming

    Andy Fleming
     

26 Mar, 2008

1 commit

  • These defines embedded the u-boot env variables and/or the bd_t structure
    in the fdt blob. The conclusion of discussion on the u-boot email list
    was that embedding these in the fdt blob is not useful: there are better
    ways of passing the data (in fact, the fdt blob itself replaces the
    bd_t struct).

    The only board that enables these is the stxxtc and they don't appear
    to be used by linux.

    Signed-off-by: Gerald Van Baren
    Acked-by: Kim Phillips

    Jerry Van Baren
     

19 Mar, 2008

2 commits


09 Jan, 2008

2 commits


08 Dec, 2007

1 commit


23 Nov, 2007

1 commit


22 Nov, 2007

3 commits


21 Nov, 2007

1 commit


11 Aug, 2007

6 commits