13 Feb, 2015

2 commits


30 Jan, 2015

17 commits

  • Tom Rini
     
  • At present we go through various contortions to store the SPI slave's chip
    select in its private data. This only exists when the slave is active so
    must be set up when it is probed. Until the device is probed we don't
    actually know what chip select it will appear on.

    However, now that we can support per-child platform data, we can use that
    instead. This allows us to set up the chip select when the child is bound,
    and avoid the messy contortions.

    Unfortunately this is a fairly large change and it seems to be difficult to
    break it down further.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Some buses need to set up their devices before they can be used. This setup
    may well be common to all buses in a particular uclass. Support a common
    pre-probe method for the uclass, called before any bus devices are probed.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • For buses, after a child is bound, allow the uclass to perform some
    processing. This can be used to figure out the address of the child (e.g.
    the chip select for SPI slaves) so that it is ready to be probed.

    This avoids bus drivers having to repeat the same process, which really
    should be done by the uclass, since it is common.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • In many cases the per-child private data for a device's children is defined
    by the uclass rather than the individual driver. For example, a SPI bus
    needs to store information about each of its children, but all SPI drivers
    store the same information. It makes sense to allow the uclass to define
    this data.

    If the driver provides a size value for its per-child private data, then use
    it. Failng that, fall back to that provided by the uclass.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • At present we try to use the 'reg' property and device tree aliases to give
    devices a sequence number. The 'reg' property is often actually a memory
    address, so the sequence numbers thus-obtained are not useful. It would be
    better if the devices were just sequentially numbered in that case. In fact
    neither I2C nor SPI use this feature, so drop it.

    Some devices need us to look up an alias to number them within the uclass.
    Add a flag to control this, so it is not done unless it is needed.

    Adjust the tests to test this new behaviour.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • This is useful to check which uclass a device is in.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • Allow parent drivers to be called when a new child is bound to them. This
    allows a bus to set up information it needs for that child.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • In many cases the child platform data for a device's children is defined by
    the uclass rather than the individual devices. For example, a SPI bus needs
    to know the chip select and speed for each of its children. It makes sense
    to allow this information to be defined the SPI uclass rather than each
    individual driver.

    If the device provides a size value for its child platdata, then use it.
    Failng that, fall back to that provided by the uclass.

    Reviewed-by: Masahiro Yamada
    Signed-off-by: Simon Glass

    Simon Glass
     
  • For buses it is common for parents to need to know the address of the child
    on the bus, the bus speed to use for that child, and other information. This
    can be provided in platform data attached to each child.

    Add driver model support for this, including auto-allocation which can be
    requested using a new property to specify the size of the data.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • When using allocated platform data, allocate it when we bind the device.
    This makes it possible to fill in this information before the device is
    probed.

    This fits with the platform data model (when not using device tree),
    since platform data exists at bind-time.

    Signed-off-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Simon Glass
     
  • There is no point in running the tests if U-Boot cannot be built. Abort in
    this case.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Rather than assuming that the chip offset length is 1, allow it to be
    provided. This allows chips that don't use the default offset length to
    be used (at present they are only supported by the command line 'i2c'
    command which sets the offset length explicitly).

    Signed-off-by: Simon Glass
    Acked-by: Heiko Schocher

    Simon Glass
     
  • Add a dm_ prefix to driver model I2C functions so that we can keep the old
    ones around.

    This is a little unfortunate, but on reflection it is too difficult to
    change the API. We can undo this rename when most boards and drivers are
    converted to use driver model for I2C.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present U-Boot sort-of supports the standard way of reading GPIOs from
    device tree nodes, but the support is incomplete, a bit clunky and only
    works for GPIO bindings where #gpio-cells is 2.

    Add new functions to request GPIOs, taking full account of the device
    tree binding. These permit requesting a GPIO with a simple call like:

    gpio_request_by_name(dev, "cd-gpios", 0, &desc, GPIOD_IS_IN);

    This will request the GPIO, looking at the device's node which might be
    this, for example:

    cd-gpios = ;

    The GPIO will be set to input mode in this case and polarity will be
    honoured by the GPIO calls.

    It is also possible to request and free a list of GPIOs.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The dumpimage is able to extract components contained in a FIT image:

    $ ./dumpimage -T flat_dt -i CONTAINER.ITB -p INDEX FILE

    The CONTAINER.ITB is a regular FIT container file. The INDEX is the poisition
    of the sub-image to be retrieved, and FILE is the file (path+name) to save the
    extracted sub-image.

    For example, given the following kernel.its to build a kernel.itb:

    /dts-v1/;
    / {
    ...
    images {
    kernel@1 {
    description = "Kernel 2.6.32-34";
    data = /incbin/("/boot/vmlinuz-2.6.32-34-generic");
    type = "kernel";
    arch = "ppc";
    os = "linux";
    compression = "gzip";
    load = ;
    entry = ;
    hash@1 {
    algo = "md5";
    };
    };
    ...
    };
    ...
    };

    The dumpimage can extract the 'kernel@1' node through the following command:

    $ ./dumpimage -T flat_dt -i kernel.itb -p 0 kernel
    Extracted:
    Image 0 (kernel@1)
    Description: Kernel 2.6.32-34
    Created: Wed Oct 22 15:50:26 2014
    Type: Kernel Image
    Compression: gzip compressed
    Data Size: 4040128 Bytes = 3945.44 kB = 3.85 MB
    Architecture: PowerPC
    OS: Linux
    Load Address: 0x00000000
    Entry Point: 0x00000000
    Hash algo: md5
    Hash value: 22352ad39bdc03e2e50f9cc28c1c3652

    Which results in the file 'kernel' being exactly the same as '/boot/vmlinuz-2.6.32-34-generic'.

    Signed-off-by: Guilherme Maciel Ferreira

    Guilherme Maciel Ferreira
     
  • Some image types, like "KeyStone GP", do not have magic numbers to
    distinguish them from other image types. Thus, the automatic image
    type discovery does not work correctly.

    This patch also fix some integer type mismatches.

    Signed-off-by: Guilherme Maciel Ferreira

    Guilherme Maciel Ferreira
     

15 Jan, 2015

4 commits


12 Dec, 2014

4 commits


23 Nov, 2014

1 commit


15 Nov, 2014

1 commit

  • This change helps to run script on machines with quite long uptime.
    Without this the following error emerges:

    File: ./dat_14M.img
    umount: /mnt/tmp-ums-test: device is busy.
    (In some cases useful info about processes that use
    the device is found by lsof(8) or fuser(1))
    TX: md5sum:083d3d22b542d3ecba61b12d17e03f9f
    mount: /dev/sdd6 already mounted or /mnt/tmp-ums-test busy
    mount: according to mtab, /dev/sdd6 is already mounted on /mnt/tmp-ums-test

    Signed-off-by: Lukasz Majewski
    Reviewed-by: Stephen Warren

    Lukasz Majewski
     

08 Nov, 2014

2 commits


27 Oct, 2014

2 commits

  • These types are problematic because they are typically declared in a
    non-standard way in U-Boot. For example, U-Boot uses 'long long' for
    int64_t even on a 64-bit machine whereas stdint.h uses 'long'.
    Similarly, U-Boot always uses 'long' for intptr_t whereas stdint.h mostly
    uses 'int'.

    This simple test script runs a few toolchains on a few archs to check for
    warnings.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The run command treats each argument an an environment variable. It gets the
    value of each variable and executes it as a command. If an environment
    variable contains a newline and the hush cli is used, it is supposed to
    execute each line one after the other.

    Normally a newline signals to hush to exit - this is used in normal command
    line entry - after a command is entered we want to return to allow the user
    to enter the next one. But environment variables obviously need to execute
    to completion.

    Add a special case for the execution of environment variables which
    continues when a newline is seen, and add a few tests to check this
    behaviour.

    Note: it's not impossible that this may cause regressions in other areas.
    I can't think of a case but with any change of behaviour with limited test
    coverage there is always a risk. From what I can tell this behaviour has
    been around since at least U-Boot 2011.03, although this pre-dates sandbox
    and I have not tested it on real hardware.

    Reported-by: Wolfgang Denk
    Signed-off-by: Simon Glass

    Simon Glass
     

24 Oct, 2014

4 commits


23 Oct, 2014

3 commits