26 Apr, 2018

1 commit

  • Commit 286ede6 ("drivers: core: Add translation in live tree case") made
    dev_get_addr always use proper bus translations for addresses read from
    the device tree. But this leads to problems with certain busses, e.g.
    I2C busses, which run into an error during translation, and hence stop
    working.

    It turns out that of_translate_address() and fdt_translate_address()
    stop the address translation with an error when they're asked to
    translate addresses for busses where #size-cells == 0 (comment from
    drivers/core/of_addr.c):

    * Note: We consider that crossing any level with #size-cells == 0 to mean
    * that translation is impossible (that is we are not dealing with a value
    * that can be mapped to a cpu physical address). This is not really specified
    * that way, but this is traditionally the way IBM at least do things

    To fix this case, we check in both the live-tree and non-live tree-case,
    whether the bus of the device whose address is about to be translated
    has size-cell size zero. If this is the case, we just read the address
    as a plain integer and return it, and only apply bus translations if the
    size-cell size if greater than zero.

    Signed-off-by: Mario Six
    Signed-off-by: Martin Fuzzey
    Reported-by: Martin Fuzzey
    Fixes: 286ede6 ("drivers: core: Add translation in live tree case")
    Reviewed-by: Simon Glass

    Mario Six
     

05 Mar, 2018

1 commit

  • Thomas reported U-Boot failed to build host tools if libfdt-devel
    package is installed because tools include libfdt headers from
    /usr/include/ instead of using internal ones.

    This commit moves the header code:
    include/libfdt.h -> include/linux/libfdt.h
    include/libfdt_env.h -> include/linux/libfdt_env.h

    and replaces include directives:
    #include -> #include
    #include -> #include

    Reported-by: Thomas Petazzoni
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

19 Feb, 2018

4 commits

  • To debug device tree issues involving 32- and 64-bit platforms, it is useful to
    have a generic 64-bit platform available.

    Add a version of the sandbox that uses 64-bit integers for its physical
    addresses as well as a modified device tree.

    Signed-off-by: Mario Six
    Added CONFIG_SYS_TEXT_BASE to configs/sandbox64_defconfig
    Signed-off-by: Simon Glass

    Mario Six
     
  • At present dtc produces these warnings when compiling sandbox:

    arch/sandbox/dts/test.dtb: Warning (gpios_property):
    Could not get phandle node for /base-gpios:num-gpios(cell 0)
    arch/sandbox/dts/test.dtb: Warning (gpios_property):
    Missing property '#gpio-cells' in node /reset-ctl or bad phandle
    (referred from /extra-gpios:num-gpios[0])

    Both are due to it assuming that the 'num-gpios' property holds a phandle
    pointing to a GPIO node.

    To avoid these warnings, rename the sandbox property so that it does not
    include the string 'gpios'.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present dtc produces these warnings when compiling sandbox:

    arch/sandbox/dts/test.dtb: Warning (reg_format): "reg" property in /chosen/chosen-test has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
    arch/sandbox/dts/test.dtb: Warning (avoid_default_addr_size): Relying on default #address-cells value for /chosen/chosen-test
    arch/sandbox/dts/test.dtb: Warning (avoid_default_addr_size): Relying on default #size-cells value for /chosen/chosen-test

    Add the missing properties to avoid this.

    Signed-off-by: Simon Glass
    Fixes: f200680 (dm: core: parse chosen node)

    Simon Glass
     
  • Only ARM and in some configs MIPS really implement arch_fixup_fdt().
    Others just use the same boilerplate which is not good by itself,
    but what's worse if we try to build with disabled CONFIG_CMD_BOOTM
    and enabled CONFIG_OF_LIBFDT we'll hit an unknown symbol which was
    apparently implemented in arch/xxx/lib/bootm.c.

    Now with weak arch_fixup_fdt() right in image-fdt.c where it is
    used we get both items highlighted above fixed.

    Signed-off-by: Alexey Brodkin
    Cc: Daniel Schwierzeck
    Cc: Simon Glass
    Cc: York Sun
    Cc: Stefan Roese
    Reviewed-by: Tom Rini
    Reviewed-by: Daniel Schwierzeck

    Alexey Brodkin
     

14 Feb, 2018

2 commits


16 Jan, 2018

1 commit


10 Jan, 2018

1 commit

  • Given gcc-6.1 and later we can now safely have strings discarded when
    the functions are unused. This lets us drop certain cases of not
    building something so that we don't have the strings brought in when the
    code was discarded. Simplify the code now by dropping guards we don't
    need now.

    Cc: Stefano Babic
    Cc: Fabio Estevam
    Cc: Chander Kashyap
    Cc: Thomas Abraham
    Cc: Vipin Kumar
    Cc: Wenyou Yang
    Signed-off-by: Tom Rini

    Tom Rini
     

13 Dec, 2017

1 commit

  • This patch extends pmic_bind_children prefix matching. In addition to
    the node name the property regulator-name is used while trying to match
    prefixes. This allows assigning different drivers to regulator nodes
    named regulator@1 and regulator@10 for example.
    I have discarded the idea of using other properties then regulator-name
    as I do not see any benefit in using property compatible or even
    regulator-compatible. Of course I am open to change this if there are
    good reasons to do so.

    Signed-off-by: Felix Brack
    Reviewed-by: Simon Glass

    Felix Brack
     

08 Dec, 2017

1 commit

  • While sandbox works OK without the special-case code, it does result in
    console output being stored in the pre-console buffer while sandbox starts
    up. If there is a crash or a problem then there is no indication of what
    is going on.

    For ease of debugging it seems better to revert this change.

    This reverts commit 47b98ad0f6779485d0f0c14f337c3eece273eb54.

    Signed-off-by: Simon Glass

    Simon Glass
     

17 Nov, 2017

1 commit


09 Oct, 2017

1 commit


04 Oct, 2017

1 commit


03 Oct, 2017

1 commit

  • Convert the sandbox architecture to make use of the new asm-generic/io.h
    to provide address mapping functions. As sandbox actually performs
    non-identity mapping between physical & virtual addresses we can't
    simply make use of the generic mapping functions, but are able to
    implement phys_to_virt() & make use of it from map_physmem().

    Signed-off-by: Paul Burton
    Cc: Simon Glass
    Acked-by: Simon Glass

    Paul Burton
     

12 Sep, 2017

3 commits


28 Aug, 2017

1 commit


29 Jul, 2017

1 commit


27 Jul, 2017

1 commit


12 Jul, 2017

3 commits


09 Jun, 2017

1 commit

  • In os_dirent_get_typename() we are checking that type falls within the
    known values of the enum os_dirent_t. With clang-3.8 testing this value
    as being >= 0 results in a warning as it will always be true. This
    assumes of course that we are only given valid data. Given that we want
    to sanity check the input, we change this to check that it falls within
    the range of the first to the last entry in the given enum.

    Cc: Simon Glass
    Signed-off-by: Tom Rini
    Reviewed-by: Simon Glass

    Tom Rini
     

06 Jun, 2017

1 commit

  • At present we provide a default version of this function for use by
    bootstage. However it uses the system timer and therefore likely requires
    driver model. This makes it impossible to time driver-model init.

    Drop the function and require boards to provide their own. Add a sandbox
    version also. There is a default implememtation in lib/time.c for boards
    which use CONFIG_SYS_TIMER_COUNTER.

    Signed-off-by: Simon Glass

    Simon Glass
     

05 Jun, 2017

1 commit


01 Jun, 2017

3 commits

  • Running a new test should reset the sandbox state to avoid tests
    interferring with each other. Move the existing state-reset code into a
    function so it can be used from tests.

    Also update the code to reset the SPI devices and adjust the test code to
    call it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The intention with block devices is that the device number (devnum field
    in its descriptor) matches the alias of its parent device. For example,
    with:

    aliases {
    mmc0 = "/sdhci@700b0600";
    mmc1 = "/sdhci@700b0400";
    }

    we expect that the block devices for mmc0 and mmc1 would have device
    numbers of 0 and 1 respectively.

    Unfortunately this does not currently always happen. If there is another
    MMC device earlier in the driver model data structures its block device
    will be created first. It will therefore get device number 0 and mmc0
    will therefore miss out. In this case the MMC device will have sequence
    number 0 but its block device will not.

    To avoid this, allow a device to request a device number and bump any
    existing device number that is using it. This all happens during the
    binding phase so it is safe to change these numbers around. This allows
    device numbers to match the aliases in all circumstances.

    Add a test to verify the behaviour.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This header includes things that are needed to make driver build. Adjust
    existing users to include that always, even if other dm/ includes are
    present

    Signed-off-by: Simon Glass

    Simon Glass
     

10 May, 2017

1 commit

  • Those tests check:
    - the ability for a phy-user to get a phy based on its name or its index
    - the ability of a phy device (provider) to manage multiple ports
    - the ability to perform operations on the phy (init,deinit,on,off)
    - the behavior of the uclass when optional operations are not implemented

    Signed-off-by: Jean-Jacques Hiblot
    Reviewed-by: Simon Glass

    Jean-Jacques Hiblot
     

08 May, 2017

1 commit

  • This is a simple uclass for Watchdog Timers. It has four operations:
    start, restart, reset, stop. Drivers must implement start, restart and
    stop operations, while implementing reset is optional: It's default
    implementation expires watchdog timer in one clock tick.

    Signed-off-by: Maxim Sloyko
    Reviewed-by: Simon Glass

    maxims@google.com
     

28 Apr, 2017

1 commit

  • Unfortunately a test for the PWM uclass was not included when it was
    submitted. This was noticed when trying to add more functionality:

    http://patchwork.ozlabs.org/patch/748172/

    Add a simple test to get us started.

    Signed-off-by: Simon Glass

    Simon Glass
     

15 Apr, 2017

1 commit


13 Apr, 2017

1 commit


06 Apr, 2017

2 commits


08 Feb, 2017

1 commit


09 Dec, 2016

1 commit