26 Feb, 2016

2 commits

  • In some cases the timer must be accessible before driver model is active.
    Examples include when using CONFIG_TRACE to trace U-Boot's execution before
    driver model is set up. Enable this option to use an early timer. These
    functions must be supported by your timer driver: timer_early_get_count()
    and timer_early_get_rate().

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This function can be called from the timer code on instrumented functions.
    Mark it as 'notrace' so that it doesn't cause infinite recursion.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     

17 Feb, 2016

1 commit

  • Adjust the driver to use driver model. The SOR becomes a bridge device. We
    use the normal simple_panel driver to handle the display itself. We also
    need to enable some options such as regulators, PWMs and DM_VIDEO itself.

    Signed-off-by: Simon Glass
    Acked-by: Anatolij Gustschin
    Signed-off-by: Tom Warren

    Simon Glass
     

16 Feb, 2016

1 commit

  • If BUILD_TAG is part of KBUILD_CFLAGS, then any time the value changes,
    all files get rebuilt. In a continuous integration environment, the value
    will change every build. This wastes time, assuming that incremental
    builds would otherwise occur.

    To solve this, remove BUILD_TAG from KBUILD_CFLAGS and add it to CFLAGS
    for just the one file that uses it. This does have the disadvantage that
    if any other files want to use the flag, we'll need to duplicate this
    custom CFLAGS setup logic. However, it seems unlikely we'll need this.

    An alternative would be to add BUILD_TAG to the "local version" and remove
    the special case code from display_options.c. However, that would affect
    the format of the U-Boot signon message, which may negatively affect
    people looking for specific data there. The approach of using
    file-specific CFLAGS was suggested by Masahiro Yamada.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini
    Reviewed-by: Masahiro Yamada
    Acked-by: Simon Glass

    Stephen Warren
     

10 Feb, 2016

1 commit

  • Current, the following passes:
    ./u-boot -d arch/sandbox/dts/test.dtb -c 'ut_image_decomp'
    but the following fails:
    ./u-boot -d arch/sandbox/dts/test.dtb -c 'ut dm; ut_image_decomp'

    This is because the gunzip code reads input data beyond the end of its
    input buffer. In the first case above, this data just happens to be 0,
    which just happens to trigger gzip to signal the error the decompression
    unit test expects. In the second case above, the "ut dm" test has written
    data to the accidentally-read memory, which causes the gzip code to take a
    different path and so return a different value, which triggers the test
    failure.

    The cause of gunzip reading past its input buffer is the re-calculation of
    s.avail_in in zunzip(), since it can underflow. Not only is the formula
    non-sensical (it uses the delta between two output buffer pointers to
    calculate available input buffer size), it also appears to be unnecessary,
    since the gunzip code already maintains this value itself. This patch
    removes this re-calculation to avoid the underflow and redundant work.

    The loop exit condition is also adjusted so that if inflate() has consumed
    the entire input buffer, without indicating returning Z_STREAM_END (i.e.
    decompression complete without error), an error is raised. There is still
    opportunity to simplify the code here by splitting up the loop exit
    condition into separate tests. However, this patch makes the minimum
    modifications required to solve the problem at hand, in order to keep the
    Acked-by: Kees Cook

    diff simple.

    I am not entirely convinced that the loop in zunzip() is necessary at all.
    It could only be useful if inflate() can return Z_BUF_ERROR (which
    typically means that it needs more data in the input buffer, or more space
    in the output buffer), even though Z_FINISH is set /and/ the full input is
    available in the input buffer /and/ there is enough space to store the
    decompressed output in the output buffer. The comment in zlib.h after the
    prototype of inflate() implies this is never the case. However, I assume
    there must have been some reason for introducing this loop in the first
    place, as part of commit "Fix gunzip to work for any gziped uImage size".

    This patch is similar to the earlier b75650d84d4b "gzip: correctly
    bounds-check output buffer", which corrected a similar issue for
    s.avail_out.

    Cc: Catalin Radu
    Cc: Kees Cook
    Fixes: f039ada5c109 ("Fix gunzip to work for any gziped uImage size")
    Signed-off-by: Stephen Warren

    Stephen Warren
     

06 Feb, 2016

3 commits


29 Jan, 2016

1 commit


24 Jan, 2016

1 commit


21 Jan, 2016

5 commits


19 Jan, 2016

3 commits

  • In a number of places we had wordings of the GPL (or LGPL in a few
    cases) license text that were split in such a way that it wasn't caught
    previously. Convert all of these to the correct SPDX-License-Identifier
    tag.

    Signed-off-by: Tom Rini

    Tom Rini
     
  • Only when we have CONFIG_CMD_UNZIP enabled do we have the 'gzwrite'
    command. While this command should be separated from CONFIG_CMD_UNZIP
    we should also only include the write portion of the gz code in that
    case as well.

    Signed-off-by: Tom Rini

    Tom Rini
     
  • Enabling this function always removes some class of string saftey issues.
    The size change here in general is about 400 bytes and this seems a reasonable
    trade-off.

    Cc: Peng Fan
    Cc: Peter Robinson
    Cc: Fabio Estevam
    Cc: Adrian Alonso
    Cc: Stefano Babic
    Cc: Hans de Goede
    Signed-off-by: Tom Rini

    Tom Rini
     

15 Jan, 2016

1 commit


14 Jan, 2016

1 commit

  • This will allow the implementation to make use of data in the block_dev
    structure beyond the base device number. This will be useful so that eMMC
    block devices can encompass the HW partition ID rather than treating this
    out-of-band. Equally, the existence of the priv field is crying out for
    this patch to exist.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini

    Stephen Warren
     

13 Jan, 2016

2 commits

  • Use "intel,ivybridge-fsp" for Intel IvyBridge FSP compatible string.

    Signed-off-by: Bin Meng
    Acked-by: Simon Glass
    Tested-by: Simon Glass

    Bin Meng
     
  • Use the driver model version of the function to find the BAR. This updates
    the fdtdec function, of which ns16550 is the only user.

    The fdtdec_get_pci_bdf() function is dropped for several reasons:
    - with driver model we should use 'struct udevice *' rather than passing the
    device tree offset explicitly
    - there are no other users in the tree
    - the function parses for information which is already available in the PCI
    device structure (specifically struct pci_child_platdata which is available
    at dev_get_parent_platdata(dev)

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng
    Tested-by: Bin Meng

    Simon Glass
     

20 Dec, 2015

1 commit


14 Dec, 2015

3 commits


01 Dec, 2015

2 commits

  • Adjust the Tegra PCI driver to support driver model and move all boards over
    at the same time. This can make use of some generic driver model code, such
    as the range-decoding logic.

    Signed-off-by: Simon Glass
    Tested-by: Stephen Warren

    Simon Glass
     
  • There are timers with a 64-bit counter value but current timer
    uclass driver assumes a 32-bit one. Modify timer_get_count()
    to ask timer driver to always return a 64-bit counter value,
    and provide an inline helper function timer_conv_64() to handle
    the 32-bit/64-bit conversion automatically.

    Signed-off-by: Bin Meng
    Acked-by: Simon Glass
    Signed-off-by: Simon Glass

    Bin Meng
     

23 Nov, 2015

2 commits

  • With this patch now, the tiny printf() function also supports numbers
    bigger than 0xffff. Additionally the code is simplified a bit and
    some static variables are moved to function parameters. Also the
    upper case hex variable output support is removed, as its not really
    needed in this simple printf version. And removing it reduces the
    complexity and the code size again a bit.

    Here the new numbers, again on the db-mv784mp-gp (Armada XP):

    Without this patch:
    56542 18536 1956 77034 12cea ./spl/u-boot-spl

    With this patch:
    56446 18536 1936 76918 12c76 ./spl/u-boot-spl

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Cc: Hans de Goede
    Cc: Tom Rini
    Cc: Albert Aribaud

    Stefan Roese
     
  • This patch adds a small printf() version that supports all basic formats.
    Its intented to be used in U-Boot SPL versions on platforms with very
    limited internal RAM sizes.

    To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This
    will result in the SPL using this tiny function and the main U-Boot
    still using the full-blown printf() function.

    This code was copied from:
    http://www.sparetimelabs.com/printfrevisited
    With mostly only coding style related changes so that its checkpatch
    clean.

    The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp
    (Marvell AXP) SPL:

    Without this patch:
    58963 18536 1928 79427 13643 ./spl/u-boot-spl

    With this patch:
    56542 18536 1956 77034 12cea ./spl/u-boot-spl

    Note:
    To make it possible to compile tiny-printf.c instead of vsprintf.c when
    CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are
    moved from common/console.c into vsprintf.c in this patch.

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Cc: Hans de Goede
    Cc: Tom Rini
    Cc: Albert Aribaud

    Stefan Roese
     

20 Nov, 2015

4 commits


19 Nov, 2015

1 commit

  • gcc 4.4.3 (which is the default native compiler on x86-64 Ubuntu 10.04)
    doesn't seem to like initializers for sub-fields of anonymous unions.
    Solve this by replacing the initialization with an assignment. This
    fixes:

    lib/lz4_wrapper.c: In function ‘ulz4fn’:
    lib/lz4_wrapper.c:97: error: unknown field ‘raw’ specified in initializer

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini
    Acked-by: Simon Glass

    Stephen Warren
     

13 Nov, 2015

3 commits

  • Tom Rini
     
  • short strings can be used in type parameter of gpt command
    to replace the guid string for the types known by u-boot

    partitions = name=boot,size=0x6bc00,type=data; \
    name=root,size=0x7538ba00,type=linux;
    gpt write mmc 0 $partitions

    and they are also used to display the type of partition
    in "part list" command

    Partition Map for MMC device 0 -- Partition Type: EFI

    Part Start LBA End LBA Name
    Attributes
    Type GUID
    Partition GUID
    1 0x00000022 0x0000037f "boot"
    attrs: 0x0000000000000000
    type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
    type: data
    guid: d117f98e-6f2c-d04b-a5b2-331a19f91cb2
    2 0x00000380 0x003a9fdc "root"
    attrs: 0x0000000000000000
    type: 0fc63daf-8483-4772-8e79-3d69d8477de4
    type: linux
    guid: 25718777-d0ad-7443-9e60-02cb591c9737

    Signed-off-by: Patrick Delaunay

    Patrick Delaunay
     
  • This needs a separate compatible value from Tegra124 since the new HW
    version has bugs that would prevent a driver for previous HW versions
    from operating at all.

    Signed-off-by: Stephen Warren
    Signed-off-by: Tom Warren

    Stephen Warren
     

10 Nov, 2015

1 commit

  • After consulting with some of the SPDX team, the conclusion is that
    Makefiles are worth adding SPDX-License-Identifier tags too, and most of
    ours have one. This adds tags to ones that lack them and converts a few
    that had full (or in one case, very partial) license blobs into the
    equivalent tag.

    Cc: Kate Stewart
    Signed-off-by: Tom Rini

    Tom Rini
     

05 Nov, 2015

1 commit