25 Aug, 2018

17 commits

  • Tom Rini
     
  • Tom Rini
     
  • Copy missing Kernel patch to make SLEWCTRL_SLOW available in device tree
    and to correct the value of SLEWCTRL_FAST.
    After this patch, the Kernel and U-boot device tree settings for
    SLEWCTRL have the same effect.

    Original Kernel patch message:
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=424e0f039bfa8a51fb5c5178b6ece8baa4996469

    "
    According to AM335x TRM, Document spruh73l, Revised February 2015,
    Section 9.2.2 Pad Control Registers, setting bit 6 of the pad control
    registers actually sets the SLEWCTRL value to slow rather than fast as
    the current macro indicates. Introduce a new macro, SLEWCTRL_SLOW, that
    sets the bit, and modify SLEWCTRL_FAST to 0 but keep it for
    completeness. Current users of the macro (i2c and mdio) are left
    unmodified as SLEWCTRL_FAST was the macro used and actual desired state.
    Tested on am335x-gp-evm with no difference in software performance seen.
    Signed-off-by: Dave Gerlach
    Signed-off-by: Tony Lindgren
    "

    Signed-off-by: Christian Amann

    Christian Amann
     
  • Add missing environment name for UBI, to prevent this NULL in output:
    Loading Environment from ...
    and rather have a valid UBI there:
    Loading Environment from UBI...

    Signed-off-by: Marek Vasut

    Marek Vasut
     
  • Prevent cache warning messages when using the 'bootelf' command on an
    Arm target. Round down each section start address and round up the
    respective section end to the nearest cache line.

    Currently when using bootelf to load an image on Arm, several warnings
    such as the following appear in the console:
    CACHE: Misaligned operation at range [87800000, 8783c5e0]
    CACHE: Misaligned operation at range [8783c5e0, 8784b3e0]

    Signed-off-by: Neil Stainton
    [trini: Reword commit message to include the info after the --- which
    included the Signed-off-by line, and change ' at ' to '@']
    Signed-off-by: Tom Rini

    Neil Stainton
     
  • This code now is regarded as dead one and hence shall be removed.

    Signed-off-by: Lukasz Majewski

    Lukasz Majewski
     
  • Trivial fix.

    Signed-off-by: Michal Simek
    Reviewed-by: Simon Glass

    Michal Simek
     
  • malloc_simple() can return 0 if out of memory. Don't call memset
    from calloc() in this case but rely on the caller checking
    the return value.

    Signed-off-by: Simon Goldschmidt
    Reviewed-by: Marek Vasut

    Simon Goldschmidt
     
  • In an earlier proposed patch, bcmstb.c implemented timer_read_counter,
    but it was updated to implement get_ticks instead. This patch updates
    the declaration in timer.h accordingly.

    Signed-off-by: Thomas Fitzsimmons

    Thomas Fitzsimmons
     
  • The reset is already handled by the designware driver using
    information from device tree.

    Signed-off-by: Beniamino Galvani
    Acked-by: Neil Armstrong

    Beniamino Galvani
     
  • Compiling U-Boot with ubsan/asan libraries and running it in sandbox
    may lead to below backtrace:

    => avb init 0
    => avb verify
    ## Android Verified Boot 2.0 version 1.1.0
    read_is_device_unlocked not supported yet
    common/avb_verify.c:407:31: runtime error: division by zero
    AddressSanitizer:DEADLYSIGNAL
    Reviewed-by: Igor Opaniuk

    =================================================================
    ==9388==ERROR: AddressSanitizer: FPE on unknown address 0x0000004b467f \
    (pc 0x0000004b467f bp 0x000000000000 sp 0x7ffd899fe150 T0)
    #0 0x4b467e in mmc_byte_io common/avb_verify.c:407
    #1 0x4b4c47 in mmc_byte_io common/avb_verify.c:532
    #2 0x4b4c47 in read_from_partition common/avb_verify.c:533
    #3 0x69dc0d in load_and_verify_vbmeta lib/libavb/avb_slot_verify.c:560
    #4 0x6a1ee6 in avb_slot_verify lib/libavb/avb_slot_verify.c:1139
    #5 0x45dabd in do_avb_verify_part cmd/avb.c:245
    #6 0x4af77c in cmd_call common/command.c:499
    #7 0x4af77c in cmd_process common/command.c:538
    #8 0x46bafc in run_pipe_real common/cli_hush.c:1677
    #9 0x46bafc in run_list_real common/cli_hush.c:1875
    #10 0x46c780 in run_list common/cli_hush.c:2024
    #11 0x46c780 in parse_stream_outer common/cli_hush.c:3216
    #12 0x46d34b in parse_file_outer common/cli_hush.c:3299
    #13 0x4ad609 in cli_loop common/cli.c:217
    #14 0x4625ae in main_loop common/main.c:65
    #15 0x46f2d1 in run_main_loop common/board_r.c:648
    #16 0x640253 in initcall_run_list lib/initcall.c:30
    #17 0x46f9d0 in board_init_r common/board_r.c:879
    #18 0x40539b in main arch/sandbox/cpu/start.c:321
    #19 0x7fa94925f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #20 0x408908 in _start (/srv/R/u-boot-master/u-boot+0x408908)

    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: FPE common/avb_verify.c:407 in mmc_byte_io
    ==9388==ABORTING

    Signed-off-by: Eugeniu Rosca

    Eugeniu Rosca
     
  • Cppcheck (v1.85) reports w/o this patch:

    [common/avb_verify.c:738] -> [common/avb_verify.c:741]: (warning) \
    Either the condition 'ops' is redundant or there is possible null \
    pointer dereference: ops.

    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Igor Opaniuk

    Eugeniu Rosca
     
  • Cppcheck (v1.85) reports w/o this patch:

    [common/avb_verify.c:351]: (error) Memory leak: part
    [common/avb_verify.c:356]: (error) Memory leak: part
    [common/avb_verify.c:361]: (error) Memory leak: part
    [common/avb_verify.c:366]: (error) Memory leak: part

    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Igor Opaniuk

    Eugeniu Rosca
     
  • Fix sparse complaint:

    common/avb_verify.c:14:21: warning: \
    symbol 'avb_root_pub' was not declared. Should it be static?

    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Igor Opaniuk

    Eugeniu Rosca
     
  • Avoid below compiler [1] errors, reproduced with configuration [2]:

    common/avb_verify.c: In function ‘get_unique_guid_for_partition’:
    common/avb_verify.c:692:31: error: ‘disk_partition_t {aka struct disk_partition}’ has no member named ‘uuid’
    uuid_size = sizeof(part->info.uuid);
    ^
    common/avb_verify.c:696:29: error: ‘disk_partition_t {aka struct disk_partition}’ has no member named ‘uuid’
    memcpy(guid_buf, part->info.uuid, uuid_size);
    ^
    LD drivers/built-in.o
    make[2]: *** [scripts/Makefile.build:278: common/avb_verify.o] Error 1

    [1] aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11)
    [2] r8a7795_ulcb_defconfig, plus:
    CONFIG_AVB_VERIFY=y
    CONFIG_PARTITION_UUIDS=y
    CONFIG_UDP_FUNCTION_FASTBOOT=y
    CONFIG_LIBAVB=y

    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Igor Opaniuk

    Eugeniu Rosca
     
  • Fix below compiler [1] warning:

    common/avb_verify.c: In function ‘avb_find_dm_args’:
    common/avb_verify.c:179:30: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    for (i = 0; i < AVB_MAX_ARGS, args[i]; ++i) {

    [1] aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11)

    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Igor Opaniuk

    Eugeniu Rosca
     
  • Exit with AVB_SLOT_VERIFY_RESULT_ERROR_INVALID_ARGUMENT
    when hashtree_error_mode value passed to avb_append_options()
    is unknown (not from AvbHashtreeErrorMode enum).

    Otherwise, default value is not handled in the
    switch(hashtree_error_mode), which causes below compile warning:

    lib/libavb/avb_cmdline.c: In function ‘avb_append_options’:
    lib/libavb/avb_cmdline.c:354:13: warning: ‘dm_verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    new_ret = avb_replace(
    ~~~~~~~~^~~~~~~~~~~~~~
    slot_data->cmdline, "$(ANDROID_VERITY_MODE)", dm_verity_mode);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    lib/libavb/avb_cmdline.c:363:8: warning: ‘verity_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (!cmdline_append_option(
    ^~~~~~~~~~~~~~~~~~~~~~
    slot_data, "androidboot.veritymode", verity_mode)) {

    Signed-off-by: Ievgen Maliarenko
    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Igor Opaniuk

    Ievgen Maliarenko
     

24 Aug, 2018

2 commits


23 Aug, 2018

8 commits


22 Aug, 2018

1 commit


21 Aug, 2018

12 commits

  • A secure monitor that runs before U-Boot, and hence causes U-Boot to run
    in non-secure world, must implement a few operations that U-Boot
    otherwise implements when running in secure world. Fix U-Boot to skip
    these operations when running in non-secure world. In particular:

    - The secure monitor must provide the LP0 resume code and own LP0
    configuration in order to maintain security, so must initialize all
    the PMC scratch registers used by the boot ROM during LP0 resume.
    Consequently, U-Boot should not attempt to clear those registers,
    since the register accesses will fail or cause an error.

    - The secure monitor owns system security, and so is responsible for
    configuring security-related items such as the VPR.

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

    Stephen Warren
     
  • Since commit f2faffecb016, tegra: Convert to use binman
    the dm-pre-reloc properties are removed.

    This leads U-Boot not to enable the display on paz00

    This patch restore the dm-pre-reloc properties allowing
    the bootloader to output to the display panel

    v4: - Spell project name as appropriate
    v3: - Fix few typos
    v2: - Add more characters to commit hash

    Signed-off-by: Nicolas Chauvet
    Reviewed-by: Simon Glass
    Signed-off-by: Tom Warren

    Nicolas Chauvet
     
  • In some cases it can be useful to be able to bind a device to a driver from
    the command line.
    The obvious example is for versatile devices such as USB gadget.
    Another use case is when the devices are not yet ready at startup and
    require some setup before the drivers are bound (ex: FPGA which bitsream is
    fetched from a mass storage or ethernet)

    usage example:

    bind usb_dev_generic 0 usb_ether
    unbind usb_dev_generic 0 usb_ether
    or
    unbind eth 1

    bind /ocp/omap_dwc3@48380000/usb@48390000 usb_ether
    unbind /ocp/omap_dwc3@48380000/usb@48390000

    Signed-off-by: Jean-Jacques Hiblot

    Jean-Jacques Hiblot
     
  • Also add a 'drv' parameter to filter the children to remove/unbind.
    Exporting those functions is a preparatory work for the addition of the
    bind/unbind commands.

    Signed-off-by: Jean-Jacques Hiblot

    Jean-Jacques Hiblot
     
  • Also add device_find_global_by_ofnode() that also find a device based on
    the OF node, but doesn't probe the device.

    Signed-off-by: Jean-Jacques Hiblot

    Jean-Jacques Hiblot
     
  • Command "dm tree" dumps the devices with class, driver, name information.
    Add the index of the device in the class too, because the information is
    useful for the bind/unbind commands.

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

    Jean-Jacques Hiblot
     
  • This function is the reciprocal of uclass_find_device().
    It will be used to print the index information in dm tree dump.

    Signed-off-by: Jean-Jacques Hiblot

    Jean-Jacques Hiblot
     
  • When a USB ethernet device is halted, the device driver is removed. When
    this happens the uclass private memory is freed and uclass_priv is set to
    NULL. This causes a data abort when uclass_priv->state is then set to
    ETH_STATE_PASSIVE.

    Fix it by checking if uclass_priv is NULL before setting uclass_priv->state

    Signed-off-by: Jean-Jacques Hiblot
    Acked-by: Joe Hershberger

    Jean-Jacques Hiblot
     
  • Add an entry in usb_gadget_controller_number() for the DWC3 gadget
    controller. Without it, it is not possible to bind the USB Ethernet driver.

    Signed-off-by: Jean-Jacques Hiblot

    Jean-Jacques Hiblot
     
  • With upcoming changes that require CONFIG_BLK, this broke
    USB Mass Storage on the OMAP3 boards because if CONFIG_BLK is
    enabled, it assumes that DM_USB is enabled, but it wasn't yet
    available on omap3 and omap4 boards.

    This patch converts the OMAP2430 MUSB glue to support DM_USB and
    extracts the necessary information based on the device tree.

    It's based on the ti-musb driver, but there are enough significant
    differences in both the architecture and device tree entires between
    am33xx and OMAP3/OMAP4, that I think it makes sense to continue to
    keep the separate.

    Per doc/driver-model/usb-info.txt, the USB gadget stuff hasn't
    migrated to DM_USB yet, so this only supports USB Host for now.

    Users wanting USB Gadgets will need to disable DM_USB and leave
    it the old way for now.

    Signed-off-by: Adam Ford

    Adam Ford
     
  • A bunch of code was encapsulated in #ifdef's whether or not
    it is building or for U-Boot. Since this code is always building
    for U-Boot, this patch removes the dead code.

    Signed-off-by: Adam Ford

    Adam Ford
     
  • In case when user provides '-' as USB controller index, like this:

    => fastboot -

    data abort occurs in strcmp() function in do_fastboot(), here:

    if (!strcmp(argv[1], "udp"))

    (tested on BeagleBone Black).

    That's because argv[1] is NULL when user types in the '-', and null
    pointer dereference occurs in strcmp() (which is ok according to C
    standard specification). So we must validate user input to prevent such
    behavior.

    While at it, check also the result of strtoul() function and handle
    error cases properly.

    Signed-off-by: Sam Protsenko
    Reviewed-by: Simon Glass
    Reviewed-by: Lukasz Majewski

    Sam Protsenko