06 Feb, 2020

2 commits

  • At present dm/device.h includes the linux-compatible features. This
    requires including linux/compat.h which in turn includes a lot of headers.
    One of these is malloc.h which we thus end up including in every file in
    U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
    which needs to use the system malloc() in some files.

    Move the compatibility features into a separate header file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present devres.h is included in all files that include dm.h but few
    make use of it. Also this pulls in linux/compat which adds several more
    headers. Drop the automatic inclusion and require files to include devres
    themselves. This provides a good indication of which files use devres.

    Signed-off-by: Simon Glass
    Reviewed-by: Anatolij Gustschin

    Simon Glass
     

15 Nov, 2018

1 commit

  • When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
    bound before relocation. However due to a bug in the DM core,
    the flag only takes effect when devices are statically declared
    via U_BOOT_DEVICE(). This bug has been fixed recently by commit
    "dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
    lists_bind_fdt()", but with the fix, it has a side effect that
    all existing drivers that declared DM_FLAG_PRE_RELOC flag will
    be bound before relocation now. This may expose potential boot
    failure on some boards due to insufficient memory during the
    pre-relocation stage.

    To mitigate this potential impact, the following changes are
    implemented:

    - Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
    only supports configuration from device tree (OF_CONTROL)
    - Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
    is statically declared via U_BOOT_DEVICE()
    - Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
    drivers that support both statically declared devices and
    configuration from device tree

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

    Bin Meng
     

19 Jul, 2018

1 commit

  • Explanation from Simon Glass
    "Private data is created when the device is probed and freed when the
    device is removed.

    Platform data is created when the device is bound, and survives
    probe/remove cycles.

    Strictly speaking, platform data should be used to hold the decoded
    device tree properties. Private data should be used for run-time
    things the device needs to keep track of."

    Based on description the driver needs to be switch to use platdata
    instead of priv.

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

    Michal Simek
     

15 Jun, 2018

4 commits

  • This function is used only inside this driver that's why should be
    static.

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

    Michal Simek
     
  • This issue was found when OF_LIVE was enabled that there are scrambled
    chars on the console like this:
    Chip ID: zu3eg
    Watchdog: Started��j� sdhci@ff160000: 0, sdhci@ff170000: 1
    In: serial@ff010000

    I found a solution for this problem exactly the same as I found later in
    serial_msm fixed by:
    "serial: serial_msm: initialize uart only before relocation"
    (sha1: 7e5ad796bcd65772a87da236ae21cd536ae3a4d2)

    What it is happening is that output TX fifo still contains chars to be
    sent and _uart_zynq_serial_init() resets TX fifo even in the middle of
    transfer.

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

    Michal Simek
     
  • Change logic and put char to fifo till there is a space in output fifo.
    Origin logic was that output fifo needs to be empty. It means only one
    char was in output queue.
    Also remove unused ZYNQ_UART_SR_TXEMPTY macro.

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

    Michal Simek
     
  • Coding style is checking to use BIT macros instead of shifts.
    The patch is also fixing the rest of macros which should be BITs instead
    of hex numbers.

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

    Michal Simek
     

31 May, 2018

1 commit


11 May, 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


01 Jun, 2017

1 commit

  • These support the flat device tree. We want to use the dev_read_..()
    prefix for functions that support both flat tree and live tree. So rename
    the existing functions to avoid confusion.

    In the end we will have:

    1. dev_read_addr...() - works on devices, supports flat/live tree
    2. devfdt_get_addr...() - current functions, flat tree only
    3. of_get_address() etc. - new functions, live tree only

    All drivers will be written to use 1. That function will in turn call
    either 2 or 3 depending on whether the flat or live tree is in use.

    Note this involves changing some dead code - the imx_lpi2c.c file.

    Signed-off-by: Simon Glass

    Simon Glass
     

17 Feb, 2017

1 commit


22 Jul, 2016

1 commit


22 Feb, 2016

1 commit

  • Sync logic with Linux kernel where TX empty flag is checked before char
    is sent.
    This logic is fixing problem with console on zynqmp platform.

    For example:
    DRAM: 2 GiB
    Enabling Caches...
    EL Level: �� sdhci@ff170000: 0
    Using default environment

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

    Michal Simek
     

27 Jan, 2016

2 commits


08 Jan, 2016

1 commit


07 Dec, 2015

2 commits


04 Nov, 2015

3 commits


19 Aug, 2015

1 commit

  • We have flipped CONFIG_SPL_DISABLE_OF_CONTROL. We have cleansing
    devices, $(SPL_) and CONFIG_IS_ENABLED(), so we are ready to clear
    away the ugly logic in include/fdtdec.h:

    #ifdef CONFIG_OF_CONTROL
    # if defined(CONFIG_SPL_BUILD) && !defined(SPL_OF_CONTROL)
    # define OF_CONTROL 0
    # else
    # define OF_CONTROL 1
    # endif
    #else
    # define OF_CONTROL 0
    #endif

    Now CONFIG_IS_ENABLED(OF_CONTROL) is the substitute. It refers to
    CONFIG_OF_CONTROL for U-boot proper and CONFIG_SPL_OF_CONTROL for
    SPL.

    Also, we no longer have to cancel CONFIG_OF_CONTROL in
    include/config_uncmd_spl.h and scripts/Makefile.spl.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Tom Rini
    Reviewed-by: Simon Glass
    Acked-by: Linus Walleij

    Masahiro Yamada
     

29 Apr, 2015

1 commit


26 Jan, 2015

2 commits


06 May, 2014

2 commits

  • 's/zynq_serial_initalize/zynq_serial_initialize/g'
    serial_initialize is used by all serial drivers.

    Signed-off-by: Michal Simek

    Michal Simek
     
  • Warnings:
    drivers/serial/serial_zynq.c:181:1: warning: symbol 'uart_zynq0_init' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:181:1: warning: symbol 'uart_zynq0_setbrg' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:181:1: warning: symbol 'uart_zynq0_getc' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:181:1: warning: symbol 'uart_zynq0_tstc' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:181:1: warning: symbol 'uart_zynq0_putc' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:181:1: warning: symbol 'uart_zynq0_puts' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:182:22: warning: symbol 'uart_zynq_serial0_device' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:184:1: warning: symbol 'uart_zynq1_init' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:184:1: warning: symbol 'uart_zynq1_setbrg' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:184:1: warning: symbol 'uart_zynq1_getc' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:184:1: warning: symbol 'uart_zynq1_tstc' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:184:1: warning: symbol 'uart_zynq1_putc' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:184:1: warning: symbol 'uart_zynq1_puts' was not declared. Should it be static?
    drivers/serial/serial_zynq.c:185:22: warning: symbol 'uart_zynq_serial1_device' was not declared. Should it be static?

    Signed-off-by: Michal Simek

    Michal Simek
     

04 Mar, 2014

1 commit


19 Feb, 2014

2 commits


02 Dec, 2013

1 commit


24 Jul, 2013

1 commit


16 Oct, 2012

3 commits

  • Remove the support for not-CONFIG_SERIAL_MULTI part from serial
    port drivers and some board files. Since CONFIG_SERIAL_MULTI is
    now enabled by default, that part is a dead code. Remove it.

    Signed-off-by: Marek Vasut
    Cc: Marek Vasut
    Cc: Anatolij Gustschin
    Cc: Stefan Roese
    Signed-off-by: Tom Rini

    Marek Vasut
     
  • Move the registration of zynq_serialN_device ports from default
    serial_initialize() into driver specific function called from
    serial_initialize(). This slims down the serial_initialize() call
    to a bare tracker of all possible serial port registration routines
    in U-Boot.

    The newly implemented zynq_serial_initialize() function, which is
    implemented inside of the serial_zynq driver allows encapsulation
    of zynq_serialN_device within the serial_zynq driver itself.

    Also, remove the exports of zynq_serialN_device from include/serial.h
    as they are no longer needed. This is simply because the implementation of
    default_serial_console() is wrapped into the serial_zynq driver and
    the default console is picked by CONFIG_SERIAL macro in config file.

    Signed-off-by: Tom Rini

    Tom Rini
     
  • Rename .init() to .start() and .uninit() to .stop() in struct
    serial_device. This allows aligning struct serial_device with
    closer to struct stdio_dev. The real goal here is to allow
    these two structures to converge together and eventually make
    one to be a superset of the other.

    Signed-off-by: Marek Vasut
    Cc: Marek Vasut
    Signed-off-by: Tom Rini

    Marek Vasut
     

04 Oct, 2012

1 commit