08 Jan, 2020

3 commits

  • log.h references cmd_tbl_t but command.h was not included

    Signed-off-by: Sean Anderson
    Reviewed-by: Simon Glass

    Sean Anderson
     
  • At present when CONFIG_DEBUG_DEVRES is enabled, U-Boot prints log messages
    to the console with every devres allocation/free event. This causes most
    tests to fail since the console output is not as expected.

    In particular this prevents us from adding a device to sandbox which uses
    devres in its bind method.

    Move devres over to use U-Boot's logging feature instead, and add a new
    category for devres.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Some U-Boot code uses BUG_ON() and WARN_ON() macros. These use __FILE__
    which can include quite a large path, depending on how U-Boot is built.

    The existing assert() is only checked if DEBUG is enabled. Add a new one
    which is always checked, and prints a (smaller) error in that case.

    Signed-off-by: Simon Glass

    Simon Glass
     

08 Oct, 2019

1 commit


08 Aug, 2019

1 commit


20 Feb, 2019

2 commits


15 Jan, 2019

1 commit


30 Nov, 2018

1 commit


26 Nov, 2018

2 commits

  • At present there is no standard way in U-Boot to pass information from SPL
    to U-Boot proper. But sometimes SPL wants to convey information to U-Boot
    that U-Boot cannot easily figure out. For example, if SPL sets up SDRAM
    then it might want to pass the size of SDRAM, or the location of each
    bank, to U-Boot proper.

    Add a new 'bloblist' feature which provides this. A bloblist is set up in
    the first phase of U-Boot that runs (i.e. TPL or SPL). The location of
    this info may be in SRAM or CAR (x86 cache-as-RAM) or somewhere else.

    Information placed in this region is preserved (with a checksum) through
    TPL and SPL and ends up in U-Boot. At this point it is copied into SDRAM
    so it can be used after relocation.

    Reviewed-by: Tom Rini
    Signed-off-by: Simon Glass
    Acked-by: Andreas Dannenberg

    Simon Glass
     
  • It is sometimes useful to log information in SPL and TPL. Add support for
    this.

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

    Simon Glass
     

21 Nov, 2018

1 commit


09 Oct, 2018

3 commits

  • At present some of the log categories are missing comments. Add them.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add logging to aid debugging features in these drivers. Also drop some
    code in sandbox_spi_xfer() which is not used.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present to output a log message you need something like:

    log(UCLASS_SPI, LOCL_INFO, "message1");
    log(UCLASS_SPI, LOCL_INFO, "message2");

    but many files use the same category throughout. Also it is helpful to
    shorten the length of log names, providing helpers for common logging
    levels. Add some macros so that it is possible to do:

    (top of file, before #includes)
    #define LOG_CATEGORY UCLASS_SPI

    (later in the file)
    log_info("message1");
    log_debug("message2");
    log_err("message3");

    Signed-off-by: Simon Glass

    Simon Glass
     

08 Oct, 2018

1 commit


09 Jul, 2018

1 commit


19 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
     

24 Apr, 2018

1 commit

  • According to the documentation the EFI log category is called LOGC_EFI.
    All other categories start with LOGC_. So let's fix it.

    Fixes: 1973b381a1b3 ("log: add category LOGC_EFI")
    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

04 Feb, 2018

4 commits

  • The EFI implementation does not fit into any of the existing categories.

    Provide LOGC_EFI so that EFI related message can be filtered.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Simon Glass

    Heinrich Schuchardt
     
  • When functions return an error it propagates up the stack to the point
    where it is reported. Often the error code provides enough information
    about the root cause of the error that this is obvious what went wrong.

    However in some cases the error may be hard to trace. For example if a
    driver uses several devices to perform an operation, it may not be
    obvious which one failed.

    Add a log_ret() macro to help with this. This can be used to wrap any
    error-return value. The logging system will then output a log record when
    the original error is generated, making it easy to trace the call stack
    of the error.

    This macro can significantly impact code size, so its use is controlled
    by a Kconfig option, which is enabled for sandbox.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • It is useful to be able to control the output format of log records on the
    console. As a starting point, add definitions for controlling which
    elements of the log record are displayed. Use function and message as the
    default, since these are the most useful fields.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Category and level both use an enum for their ID values. Add functions to
    convert these IDs to strings and vice versa. This will allow the log to
    output the strings instead of the (inscrutable) values.

    At the same time, add a new 'driver-model' category, to cover core
    driver-model functions and fix an incorrect value for LOGL_MAX.

    Tests will be added with the new 'log' subcommands.

    Signed-off-by: Simon Glass
    (Updated to correct clang warnings)

    Simon Glass
     

08 Dec, 2017

3 commits