31 Aug, 2019

1 commit

  • The current code in reserve_noncached() has two issues:

    1) The first update of gd->start_addr_sp always rounds down to a section
    start. However, the equivalent calculation in cache.c:noncached_init()
    always first rounds up to a section start, then subtracts a section size.
    These two calculations differ if the initial value is already rounded to
    section alignment.

    2) The second update of gd->start_addr_sp subtracts exactly
    CONFIG_SYS_NONCACHED_MEMORY, whereas the equivalent calculation in
    cache.c:noncached_init() rounds the noncached size up to section
    alignment before subtracting it. The two calculations differ if the
    noncached region size is not a multiple of the MMU section size.

    In practice, one/both of those issues causes a practical problem on
    Jetson TX1; U-Boot triggers a synchronous abort during initialization,
    likely due to overlapping use of some memory region.

    This change fixes both these issues by duplicating the exact calculations
    from noncached_init() into reserve_noncached().

    However, this fix assumes that gd->start_addr_sp on entry to
    reserve_noncached() exactly matches mem_malloc_start on entry to
    noncached_init(). I haven't traced the code to see whether it absolutely
    guarantees this in all (or indeed any!) cases. Consequently, I added some
    comments in the hope that this condition will continue to be true.

    Fixes: 5f7adb5b1c02 ("board_f: reserve noncached space below malloc area")
    Cc: Vikas Manocha
    Signed-off-by: Stephen Warren

    Stephen Warren
     

12 Aug, 2019

4 commits


29 Jul, 2019

1 commit


20 Jul, 2019

1 commit

  • Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
    while the full U-Boot can use rich DM/DT WDT driver.

    Signed-off-by: Marek Vasut
    Cc: Peng Fan
    Cc: Stefano Babic
    Tested-by: Heiko Schocher
    Tested-by: Suniel Mahesh

    Marek Vasut
     

13 Jul, 2019

1 commit

  • add gpio-hog support. GPIO hogging is a mechanism
    providing automatic GPIO request and configuration
    as part of the gpio-controller's driver probe function.

    for more infos see:
    doc/device-tree-bindings/gpio/gpio.txt

    Signed-off-by: Heiko Schocher
    Tested-by: Michal Simek (zcu102)
    Tested-by: Patrick Delaunay

    Heiko Schocher
     

08 Jul, 2019

1 commit

  • The initr_watchdog is currently placed before initr_serial. The
    initr_watchdog calls printf and printf finally calls ops->putc of a serial
    driver.

    However, gd->cur_serial_dev points to a udevice allocated in board_f. The
    gd->cur_serial_dev->driver->ops->putc points the the code region before
    relocation.

    Some serial drivers call WATCHDOG_RESET() in ops->putc. When DM is enabled
    for watchdog, watchdog_reset() is called. watchdog_reset() calls get_timer
    to get current timer.

    On some platforms the timer driver is also a DM driver. initr_watchdog is
    placed right after initr_dm, which means the timer driver hasn't been
    initialized. So dm_timer_init() is called. To create a new udevice, calloc
    is called.

    However start from ops->putc, u-boot execution flow is redirected into the
    memory region before relocation (board_f). In board_f, dlmalloc hasn't
    been initialized. The call to calloc will fail, and this will cause DM to
    print out an error message, and it will call printf again, causing
    recursive error outputs.

    This patch places initr_watchdog after initr_serial to solve this issue.

    Cc: Stefan Roese
    Reviewed-by: Ryder Lee
    Signed-off-by: Weijie Gao
    Reviewed-by: Stefan Roese
    Tested-by: Frank Wunderlich
    Tested-by: Suniel Mahesh

    Weijie Gao
     

26 Apr, 2019

1 commit

  • This patch tries to implement a generic watchdog_reset() function that
    can be used by all boards that want to service the watchdog device in
    U-Boot. This watchdog servicing is enabled via CONFIG_WATCHDOG.

    Without this approach, new boards or platforms needed to implement a
    board specific version of this functionality, mostly copy'ing the same
    code over and over again into their board or platforms code base.

    With this new generic function, the scattered other functions are now
    removed to be replaced by the generic one. The new version also enables
    the configuration of the watchdog timeout via the DT "timeout-sec"
    property (if enabled via CONFIG_OF_CONTROL).

    This patch also adds a new flag to the GD flags, to flag that the
    watchdog is ready to use and adds the pointer to the watchdog device
    to the GD. This enables us to remove the global "watchdog_dev"
    variable, which was prone to cause problems because of its potentially
    very early use in watchdog_reset(), even before the BSS is cleared.

    Signed-off-by: Stefan Roese
    Cc: Heiko Schocher
    Cc: Tom Rini
    Cc: Michal Simek
    Cc: "Marek Behún"
    Cc: Daniel Schwierzeck
    Cc: Maxim Sloyko
    Cc: Erik van Luijk
    Cc: Ryder Lee
    Cc: Weijie Gao
    Cc: Simon Glass
    Cc: "Álvaro Fernández Rojas"
    Cc: Philippe Reynes
    Cc: Christophe Leroy
    Reviewed-by: Michal Simek
    Tested-by: Michal Simek (on zcu100)

    Stefan Roese
     

13 Apr, 2019

1 commit

  • The first functions of the UEFI sub-system are invoked before reaching the
    U-Boot shell, e.g. efi_set_bootdev(), efi_dp_from_name(),
    efi_dp_from_file(). We should be able to print out device paths for
    debugging purposes here.

    When printing device paths via printf("%pD\n", dp) this invokes functions
    defined as EFIAPI. So efi_save_gd() must be called beforehand.

    So let's move the efi_save_gd() call to function initr_reloc_global_data(()
    in board_r.c.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     

09 Feb, 2019

1 commit

  • The board_r init function was complaining that we are looping through
    an array, calling all our tiny init stubs sequentially via indirect
    function calls (which can't be speculated, so they are slow).

    The solution to that is pretty easy though. All we need to do is inline
    the function that loops through the functions and the compiler will
    automatically convert almost all indirect calls into direct inlined code.

    With this patch, the overall code size drops (by 40 bytes on riscv64)
    and boot time should become measurably faster for every target.

    Signed-off-by: Alexander Graf

    Alexander Graf
     

06 Dec, 2018

1 commit


04 Dec, 2018

1 commit

  • Patch queue for efi - 2018-12-03

    This release is fully packed with lots of glorious improvements in UEFI
    land again!

    - Make PE images more standards compliant
    - Improve sandbox support
    - Improve correctness
    - Fix RISC-V execution on virt model
    - Honor board defined top of ram (fixes a few boards)
    - Imply DM USB access when distro boot is available
    - Code cleanups

    Tom Rini
     

03 Dec, 2018

2 commits

  • CC common/board_r.o
    common/board_r.c:747:2: error: ‘initr_spi’ undeclared here (not in a function)
    initr_spi,
    ^
    make[1]: *** [common/board_r.o] Error 1

    Fixes: ebe76a2df9f6 ("dm: Remove spi_init() from board_r.c when using driver model")
    Signed-off-by: Christophe Leroy

    Christophe Leroy
     
  • The sandbox uses a virtual address space that is neither the physical nor
    the virtual address space of the operating system. All address used on the
    command line live in this address space. So also the environment variable
    ${fdtcontroladdr} has to be in this address space.

    Commands like bootefi and booti receive the fdt address as parameter.
    Without the patch ${fdtcontroladdr} cannot be used as parameter value on
    the sandbox.

    Signed-off-by: Heinrich Schuchardt
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

27 Nov, 2018

2 commits


06 Oct, 2018

1 commit

  • Instead of manually specifying CONFIG_SYS_EXTRA_ENV_RELOC
    for every board that needs it, it shouldn't hurt to let
    initr_reloc_global_data() always relocate gd->env_addr
    unless we know this pointer is outside the initial binary.

    To achieve this, the relocation is omitted if
    CONFIG_ENV_ADDR is defined (and ENV_IS_EMBEDDED is not).

    Signed-off-by: Simon Goldschmidt

    Simon Goldschmidt
     

10 Aug, 2018

1 commit


20 Jul, 2018

1 commit

  • The function set_default_env() sets the hashtable flags for import_r().
    Formally set_default_env() doesn't accept flags from its callers. In
    practice the caller can (un)set the H_INTERACTIVE flag, but it has to be
    done using the first character of the function's string argument. Other
    flags like H_FORCE can't be set by the caller.

    Change the function to accept flags argument. The benefits are:
    1. The caller will have to explicitly set the H_INTERACTIVE flag,
    instead of un-setting it using a special char in a string.
    2. Add the ability to propagate flags from the caller to himport(),
    especially the H_FORCE flag from do_env_default() in nvedit.c that
    currently gets ignored for "env default -a -f" commands.
    3. Flags and messages will not be coupled together. A caller will be
    able to set flags without passing a string and vice versa.

    Please note:
    The propagation of H_FORCE from do_env_default() does not introduce any
    functional changes, because currently himport_r() is set to destroy the
    old environment regardless if H_FORCE flag is set or not. More changes
    are needed to utilize the propagation of H_FORCE.

    Signed-off-by: Yaniv Levinsky
    Acked-by: Igor Grinberg

    Yaniv Levinsky
     

11 Jul, 2018

1 commit


24 Jun, 2018

1 commit


07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

28 Apr, 2018

1 commit

  • This converts the following to Kconfig:
    CONFIG_SPI

    This partly involves updating code that assumes that CONFIG_SPI implies
    things that are specific to the MPC8xx SPI driver. For now, just update
    the CONFIG tests. This also involves reworking the default for
    CONFIG_SYS_DEF_EEPROM_ADDR so that we don't set it when we cannot make a
    reasonable default, as it does not cause any compile failures.

    Signed-off-by: Adam Ford
    Signed-off-by: Tom Rini

    Adam Ford
     

07 Apr, 2018

1 commit


17 Mar, 2018

1 commit


14 Feb, 2018

1 commit


28 Jan, 2018

1 commit


20 Jan, 2018

1 commit


12 Jan, 2018

1 commit


08 Dec, 2017

2 commits


16 Oct, 2017

1 commit


16 Aug, 2017

4 commits


27 Jul, 2017

1 commit

  • Some platforms have very limited SRAM to run SPL code, so there may
    not be the same amount space for a malloc pool before relocation in
    the SPL stage as the normal U-Boot stage.

    Make SPL and (the full) U-Boot stage use independent SYS_MALLOC_F_LEN,
    so the size of pre-relocation malloc pool can be configured memory
    space independently.

    Signed-off-by: Andy Yan
    Reviewed-by: Tom Rini
    Acked-by: Philipp Tomsich
    Reviewed-by: Philipp Tomsich
    [fixed up commit-message:]
    Signed-off-by: Philipp Tomsich

    Andy Yan
     

12 Jul, 2017

1 commit

  • At present the U-Boot banner is only displayed on the serial console. If
    this is not visible to the user, the banner does not show. Some devices
    have a video display which can usefully display this information.

    Add a banner which is printed after relocation only on non-serial devices
    if CONFIG_DISPLAY_BOARDINFO_LATE is defined.

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

    Simon Glass