17 May, 2016

5 commits

  • In some cases, drivers may not want to bind to a device. Allow bind() to
    return -ENODEV in this case, and don't treat this as an error. This can
    be useful in situations where some information source other than the DT
    node's main status property indicates whether the device should be
    enabled, for example other DT properties might indicate this, or the
    driver might query non-DT sources such as system fuses or a version number
    register.

    Signed-off-by: Stephen Warren
    Reviewed-by: Simon Glass

    Stephen Warren
     
  • One use-case for buildman is to continually run it interactively after
    each small step in a large refactoring operation. This gives more
    immediate feedback than making a number of commits and then going back and
    testing them. For this to work well, buildman needs to be extremely fast.
    At present, a couple issues prevent it being as fast as it could be:

    1) Each time buildman runs "make %_defconfig", it runs "make mrproper"
    first. This throws away all previous build results, requiring a
    from-scratch build. Optionally avoiding this would speed up the build, at
    the cost of potentially causing or missing some build issues.

    2) A build tree is created per thread rather than per board. When a thread
    switches between building different boards, this often causes many files
    to be rebuilt due to changing config options. Using a separate build tree
    for each board would avoid this. This does put more strain on the system's
    disk cache, but it is worth it on my system at least.

    This commit adds two command-line options to implement the changes
    described above; -I ("--incremental") turns of "make mrproper" and -P
    ("--per-board-out-dir") creats a build directory per board rather than per
    thread.

    Tested:

    ./tools/buildman/buildman.py tegra
    ./tools/buildman/buildman.py -I -P tegra
    ./tools/buildman/buildman.py -b tegra_dev tegra
    ./tools/buildman/buildman.py -b tegra_dev -I -P tegra

    ... each once after deleting the buildman result/work directory, and once
    "incrementally" after a previous identical invocation.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini
    Acked-by: Simon Glass # v1
    Tested-by: Simon Glass # v1
    Acked-by: Simon Glass

    Stephen Warren
     
  • Boards can now use DM serial driver, or still legacy mcf uart
    driver version.

    Signed-off-by: Angelo Dureghello
    Acked-by: Simon Glass

    angelo@sysam.it
     
  • To use serial uclass and DM, CONFIG_SYS_MALLOC_F must be used.
    So CONFIG_SYS_GENERIC_GLOBAL_DATA has been undefined and
    call to board_init_f_mem() is added for all cpu's.

    Signed-off-by: Angelo Dureghello
    Acked-by: Simon Glass

    angelo@sysam.it
     
  • Introduce a new driver that supports driver model for pca953x.
    The pca953x chips are used as I2C I/O expanders.
    This driver is designed to support the following chips:
    "
    4 bits: pca9536, pca9537
    8 bits: max7310, max7315, pca6107, pca9534, pca9538, pca9554,
    pca9556, pca9557, pca9574, tca6408, xra1202
    16 bits: max7312, max7313, pca9535, pca9539, pca9555, pca9575,
    tca6416
    24 bits: tca6424
    40 bits: pca9505, pca9698
    "
    But for now this driver only supports max 24 bits and pca953x compatible
    chips. pca957x compatible chips are not supported now.
    These can be addressed when we need to add such support for the different
    chips.
    This driver has been tested on i.MX6 SoloX Sabreauto board with max7310
    i2c expander using gpio command as following:

    =>gpio status -a
    Bank gpio@30_:
    gpio@30_0: input: 1 [ ]

    => dm tree:
    i2c [ ] | | `-- i2c@021a8000
    gpio [ ] | | |-- gpio@30
    gpio [ ] | | `-- gpio@32

    Signed-off-by: Peng Fan
    Cc: Simon Glass
    Cc: Masahiro Yamada
    Cc: Wenyou Yang
    Cc: Daniel Schwierzeck
    Cc: Purna Chandra Mandal
    Cc: Thomas Chou
    Cc: Bhuvanchandra DV
    Cc: Andrea Scian
    Cc: Michal Simek
    Cc: Stefano Babic
    Cc: Fabio Estevam
    Acked-by: Simon Glass
    Tested-by: Michal Simek #on ZynqMP zcu102

    Peng Fan
     

16 May, 2016

1 commit


15 May, 2016

1 commit


13 May, 2016

2 commits


12 May, 2016

1 commit

  • Commit bfb33f0bc45b ("sunxi: mctl_mem_matches: Add missing memory
    barrier") broke compilation for the Pine64, as dram_helper.c now
    includes , which does not compile on arm64.

    Fix this by moving all barrier instructions into a separate header
    file, which can easily be shared between arm and arm64.
    Also extend the inline assembly to take the "sy" argument, which is
    optional for ARMv7, but mandatory for v8.

    This fixes compilation for 64-bit sunxi boards (Pine64).

    Acked-by: Ian Campbell
    Signed-off-by: Andre Przywara

    Andre Przywara
     

11 May, 2016

2 commits


07 May, 2016

15 commits

  • Tom Rini
     
  • Tom Rini
     
  • Reported by Coverity:
    Logically dead code (DEADCODE)
    dead_error_line: Execution cannot reach this statement:
    (f_dfu->strings + --i).s = ....

    If calloc failed, i is still 0 and no need to call free,
    so discard the dead code.

    Signed-off-by: Peng Fan
    Cc: "Łukasz Majewski"
    Cc: Marek Vasut

    Peng Fan
     
  • When dfu_fill_entity fail, need to free dfu to avoid memory leak.

    Reported by Coverity:
    "
    Resource leak (RESOURCE_LEAK)
    leaked_storage: Variable dfu going out of scope leaks the storage
    it points to.
    "

    Signed-off-by: Peng Fan
    Cc: "Łukasz Majewski"
    Cc: Marek Vasut

    Peng Fan
     
  • With patch c998da0d (usb: Change power-on / scanning timeout handling),
    the USB scanning is started earlier and with a smaller timeout. This
    resulted on SoCFPGA (using the DWC2 driver) in some USB sticks not
    getting detected any more. This patch now adds a 1 second delay (in
    the host mode only) to the DWC2 driver before the scanning is started.
    With this delay, now all problematic USB keys are detected successfully
    again. And there is no need any more to change the delay / timeout
    in the common USB code (usb_hub.c).

    Signed-off-by: Stefan Roese
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stephen Warren
    Cc: Marek Vasut

    Stefan Roese
     
  • The code shouldn't continue probing the port if get_port_status() failed.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stefan Roese
    Cc: Stephen Warren

    Marek Vasut
     
  • The Kingston DT Ultimate USB 3.0 stick is sensitive to this first
    Get Descriptor request and if the request is not in a separate
    microframe, the stick refuses to operate. Add slight delay, which
    is enough for one microframe to pass on any USB spec revision.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stefan Roese
    Cc: Stephen Warren

    Marek Vasut
     
  • Some devices, like the SanDisk Cruzer Pop need some time to process
    the Set Configuration request, so wait a little until they are ready.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stefan Roese
    Cc: Stephen Warren

    Marek Vasut
     
  • Building without ethernet driver doesn't work. Fix it.

    Signed-off-by: Anatolij Gustschin
    Cc: Marek Vasut

    Anatolij Gustschin
     
  • The indirect read code is a pile of nastiness. This patch replaces
    the whole unmaintainable indirect read implementation with the one
    from upcoming Linux CQSPI driver, which went through multiple rounds
    of thorough review and testing. All the patch does is it plucks out
    duplicate ad-hoc code distributed across the driver and replaces it
    with more compact code doing exactly the same thing. There is no
    speed change of the read operation.

    Signed-off-by: Marek Vasut
    Cc: Anatolij Gustschin
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Jagan Teki
    Cc: Pavel Machek
    Cc: Stefan Roese
    Cc: Vignesh R

    Marek Vasut
     
  • The indirect write code is buggy pile of nastiness which fails horribly
    when the system runs fast enough to saturate the controller. The failure
    results in some pages (256B) not being written to the flash. This can be
    observed on systems which run with Dcache enabled and L2 cache enabled,
    like the Altera SoCFPGA.

    This patch replaces the whole unmaintainable indirect write implementation
    with the one from upcoming Linux CQSPI driver, which went through multiple
    rounds of thorough review and testing. While this makes the patch look
    terrifying and violates all best-practices of software development, all
    the patch does is it plucks out duplicate ad-hoc code distributed across
    the driver and replaces it with more compact code doing exactly the same
    thing.

    Signed-off-by: Marek Vasut
    Cc: Anatolij Gustschin
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Jagan Teki
    Cc: Pavel Machek
    Cc: Stefan Roese
    Cc: Vignesh R

    Marek Vasut
     
  • The time command is very helpful for performance and regressions tests.
    So lets enable it on SoCrates.

    Signed-off-by: Stefan Roese
    Cc: Marek Vasut

    Stefan Roese
     
  • This is mandatory, otherwise the USB does not work.

    Signed-off-by: Marek Vasut
    Cc: Stefan Roese
    Cc: Dinh Nguyen

    Marek Vasut
     
  • The pointer should always be inited to NULL, not zero (0). These are
    two different things and not necessarily equal.

    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Hans de Goede
    Cc: Stefan Roese
    Cc: Stephen Warren

    Marek Vasut
     
  • There could be runtime determined board specific reason why a EHCI
    initialization fails (e.g. ENODEV if a Port is not available). In
    this case, properly return the error code.
    While at it, that function (board_ehci_hcd_init) has actually two
    documentation blocks... Use the correct function name for the
    documentation block of board_usb_phy_mode.

    Signed-off-by: Stefan Agner

    Stefan Agner
     

06 May, 2016

8 commits

  • According PL310 TRM, Auxiliary Control Register
    "
    The register must be written to using a secure access, and it can be
    read using either a secure or a NS access. If you write to this register
    with a NS access, it results in a write response with a DECERR response,
    and the register is not updated. Writing to this register with the L2
    cache enabled, that is, bit[0] of L2 Control Register set to 1,
    results in a SLVERR.
    "

    So If L2 cache is already enabled by ROM, chaning value of ACR
    will cause SLVERR and uboot hang.

    Signed-off-by: Peng Fan
    Cc: Stefano Babic
    Cc: Fabio Estevam

    Peng Fan
     
  • It can take a while for a host machine to notice that a USB device has
    disconnected, and process the change. At the end of the DFU test, we wait
    up to 10 seconds for this to happen. This change makes the test wait the
    same (up to) 10 seconds at the start of the test for any previously active
    USB device-mode session to be cleaned up. Such as session might have been
    used to download U-Boot into memory for example; this is certainly true
    on my Tegra test systems. This changes should solve the DFU test
    intermittency issues I've been seeing on some Tegra devices.

    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • The current delays in the DDR initialization routines for am33xx
    architectures are sometimes not running long enough leading to DDR
    init errors. On am437x, this shows up as an L3 NOC error after the
    kernel boots. This is due to the timer not being initialized
    properly, but instead still containing the timer init values from
    the boot ROM which cause timers to expire in 1/4th the time
    required.

    timer_init is typically not called until board_init_r, however on
    am33xx/am43xx udelay is required in sdram_init which is called
    from board_init_f, so a call to timer_init is required earlier.

    Note that this issue introduced in v2015.01 by:

    b352dde "am33xx: Drop timer_init call from s_init".

    Although this could instead fixed by reverting said commit, it
    would cause timer_init to be called twice in both SPL and non-SPL
    cases. This gives a little more fine grained control and also
    matches what is being done on omap-command and fsl-layerscape.

    Signed-off-by: Russ Dill

    Russ Dill
     
  • Commit 724219a65f55 "ARM: always perform per-CPU GIC init" removed some
    ifdefs to unify the MULTIENTRY-vs-non-MULTIENTRY paths. However, the
    wrong endif was removed. This patch adds back that missing endif, and
    adds a new ifdef to match the endif the now-correctly-terminated block
    used to match against. Use "git show -U25 724219a65f55" to see enough
    context to make the original issue clear.

    In practical terms, this makes no difference to runtime behaviour. The
    code that was incorrectly compiled into the binary when ifndef MULTIENTRY
    is a no-op for other cases, since branch_if_master evaluates to a hard-
    coded jump. The only issues were:

    - A few extra instructions were added to the binary.
    - The comment on the endif at the very end of the function, indicating
    which ifdef it matched, were wrong.

    An alternative might be to simply fix the comment on that trailing ifdef,
    but that only addresses the second point above, not the first.

    Fixes: 724219a65f55 ("ARM: always perform per-CPU GIC init")
    Cc: Masahiro Yamada
    Signed-off-by: Stephen Warren
    Reviewed-by: Masahiro Yamada

    Stephen Warren
     
  • Spelling corrections for (among other things):

    * environment
    * override
    * variable
    * ftd (should be "fdt", for flattened device tree)
    * embedded
    * FTDI
    * emulation
    * controller

    Robert P. J. Day
     
  • Since we do not build any board with CONFIG_SUPPORT_EMMC_RPMB , this
    piece of code evaded conversion. Fix the following compiler error:

    cmd/mmc.c: In function 'do_mmcrpmb':
    cmd/mmc.c:316:32: error: 'struct blk_desc' has no member named 'part_num'
    original_part = mmc->block_dev.part_num;
    ^

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

    Marek Vasut
     
  • The DuoVero board fails to compile with EFI enabled as the generated
    binaries are too large. As this platform doesn't currently need EFI,
    disable this feature.

    Signed-off-by: Ash Charles

    Ash Charles
     
  • Be sure to load the zImage and fdtfile prior to actually booting in
    case we are doing a legacy boot.

    Signed-off-by: Ash Charles

    Ash Charles
     

05 May, 2016

3 commits

  • This imports v11 of "Jetson TK1 Development Platform Pin Mux" from
    https://developer.nvidia.com/embedded/downloads.

    The new version defines the mux option for the MIPI pad ctrl selection.
    The OWR pin no longer has an entry in the configuration table because
    the only mux option it support is OWR, that feature isn't supported, and
    hence can't conflict with any other pin. This pin can only usefully be
    used as a GPIO.

    Signed-off-by: Stephen Warren
    Reviewed-by: Simon Glass
    Signed-off-by: Tom Warren

    Stephen Warren
     
  • Tegra20's PCIe controller has a couple of quirks. There are workarounds in
    the driver for these, but they don't work after the DM conversion:

    1) The PCI_CLASS value is wrong in HW.

    This is worked around in pci_tegra_read_config() by patching up the value
    read from that register. Pre-DM, the PCIe core always read this via a
    16-bit access to the 16-bit offset 0xa. With DM, 32-bit accesses are used,
    so we need to check for offset 0x8 instead. Mask the offset value back to
    32-bit alignment to make this work in all cases.

    2) Accessing devices other than dev 1 causes a data abort.

    Pre-DM, this was worked around in pci_skip_dev(), which the PCIe core code
    called during enumeration while iterating over a bus. The DM PCIe core
    doesn't use this function. Instead, enhance tegra_pcie_conf_address() to
    validate the bdf being accessed, and refuse to access invalid devices.
    Since pci_skip_dev() isn't used, delete it.

    I've also validated that both these WARs are only needed for Tegra20, by
    testing on Tegra30/Cardhu and Tegra124/Jetson TKx. So, compile them in
    conditionally.

    Fixes: e81ca88451cf ("dm: tegra: pci: Convert tegra boards to driver model for PCI")
    Signed-off-by: Stephen Warren
    Reviewed-by: Thierry Reding
    Reviewed-by: Simon Glass
    Signed-off-by: Tom Warren

    Stephen Warren
     
  • In current Linux kernel Tegra DT files, 64-bit addresses are represented
    in unit addresses as a pair of comma-separated 32-bit values. Apparently
    this is no longer the correct representation for simple busses, and the
    unit address should be represented as a single 64-bit value. If this is
    changed in the DTs, arm/arm/mach-tegra/board2.c:ft_system_setup() will no
    longer be able to find and enable the GPU node, since it looks up the node
    by name.

    Fix that function to enable nodes based on their compatible value rather
    than their node name. This will work no matter what the node name is, i.e
    for DTs both before and after any rename operation.

    Cc: Thierry Reding
    Cc: Alexandre Courbot
    Signed-off-by: Stephen Warren
    Signed-off-by: Tom Warren

    Stephen Warren
     

04 May, 2016

2 commits