aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-08libfdt: Update to latest pylibfdt implementationSimon Glass
The enhanced pylibfdt support in U-Boot needed for binman was a placeholder while upstreaming of this work continued. This is now complete, so bring in the changes and update the tools as needed. There are quite a few changes since we decided to split the implementation into three fdt classes instead of two. The Fdt.del_node() method was unfortunately missed in this process and will be dealt with later. It exists in U-Boot but not upstream. Further syncing of libfdt probably needs to wait until we assess the code-size impact of all the new checking code on SPL and possibly provide a way to disable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Add cases for finding PCI capability APIsBin Meng
Add several PCI capability and extended capability ID registers in the swap_case driver, so that we can add test case for dm_pci_find_capability() and dm_pci_find_ext_capability(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Add APIs to find capability and extended capabilityBin Meng
This introduces two new APIs dm_pci_find_capability() and dm_pci_find_ext_capability() to get PCI capability address and PCI express extended capability address for a given PCI device. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: Add all known capability and extended capability idsBin Meng
Currently we don't have a complete list of capability and extended capability ids. This adds them. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Add tests for mixed static and dynamic devices on the same busBin Meng
In the Sandbox test configuration, PCI bus#0 only has static devices while bus#1 only has dynamic devices. Create a bus#2 that has both types of devices and test such. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: emul: Rename priv structureBin Meng
We have "struct sandbox_pci_priv" in pci_sandbox driver. To avoid confusion, rename the emul's priv to "struct sandbox_pci_emul_priv". Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Test driver binding with driver data providedBin Meng
With struct pci_device_id, it's possible to pass a driver data for bound driver to use. This adds a test case for this functionality. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08sandbox: Update test.dts for dynamic PCI device driver matchingBin Meng
At present we have two PCI buses in the test configuration. Both buses have static device-tree config devices. Now we switch the 2nd bus to use dynamic PCI devices for testing. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: swap_case: Declare dynamic driver matchingBin Meng
This adds a U_BOOT_PCI_DEVICE() declaration to the swap_case driver. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: Support dynamically binding device driverBin Meng
At present all emulated sandbox pci devices must be present in the device tree in order to be used. The real world pci uclass driver supports pci device driver matching, and we should add such support on sandbox too. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Assign correct driver data when binding a driverBin Meng
The correct driver data comes from the matching 'id' instead of 'find_id' in pci_find_and_bind_driver(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: emul: Fix the call to pci_bus_find_devfn()Bin Meng
With the newly added test cases for PCI configuration access, we get: => ut dm pci_busdev Test: dm_test_pci_busdev: pci.c test/dm/pci.c:49, dm_test_pci_busdev(): SANDBOX_PCI_VENDOR_ID == vendor: Expected 4660, got 65535 Test: dm_test_pci_busdev: pci.c (flat tree) test/dm/pci.c:49, dm_test_pci_busdev(): SANDBOX_PCI_VENDOR_ID == vendor: Expected 4660, got 65535 Failures: 2 The bug only shows up when bus number is not equal to zero. This is caused by the plain find_devfn parameter is passed to function call pci_bus_find_devfn(), inside which find_devfn is compared to devfn in the device's pplat structure. However pplat->devfn does not carry the bus number. Fix this by passing find_devfn with bus number masked. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Add tests for configuration space accessBin Meng
So far we missed the testing for PCI configuration space access. This adds tests for it, as well as removing some redundant asserts. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Test more than one PCI host controllerBin Meng
So far there is only one PCI host controller in the sandbox test configuration. This is normally the case for x86, but it can be common on other architectures like ARM/PPC to have more than one PCI host controller in the system. This updates the case to cover such scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: sandbox: swap_case: Preserve space indicator bit in BAR registersBin Meng
With the newly added testing of more than one device, we get: => ut dm pci_swapcase Test: dm_test_pci_swapcase: pci.c test/dm/pci.c:88, dm_test_pci_swapcase(): "tHIS IS A tESt" = ptr: Expected "tHIS IS A tESt", got "this is a test" Test: dm_test_pci_swapcase: pci.c (flat tree) test/dm/pci.c:88, dm_test_pci_swapcase(): "tHIS IS A tESt" = ptr: Expected "tHIS IS A tESt", got "this is a test" Failures: 2 The failure only happens on the 2nd swap_case device on the PCI bus. The case passes on the 1st device. It turns out the swap_case driver does not emulate bit#0 in BAR registers as a read-only bit. This corrects the implementation. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Test more than one device on the same busBin Meng
It's quite common to have more than one device on the same PCI bus. This updates the test case to test such scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08test: dm: pci: Remove unnecessary steps in dm_test_pci_swapcase()Bin Meng
The check on uclass_get_device() and device_active() is unnecessary as the follow-up test operations will implicitly probe the driver. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Fix scanning multi-function deviceBin Meng
The flag to control whether to scan multi-function device during enumeration should be cleared at the beginning of each iteration if the device's function number equals to zero. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: pci: Extract vendor/device id in child_post_bind()Bin Meng
Currently only devfn is extracted in child_post_bind(). Now that we have the live-tree version API to look up PCI vendor and device id from the compatible string, let's extract and save them too. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: core: Add ofnode function to read PCI vendor and device idBin Meng
We don't have the live-tree version of fdtdec_get_pci_vendev(). This adds the API. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08dm: Correct typos in uclass_first/next_device_check()Bin Meng
Correct typos in the comment block of uclass_first/next_device_check(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-08pci: Remove 440ep-specific macrosBin Meng
These macros should not be put in the generic pci.h header file. Since they are not referenced anywhere, remove them completely. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-07zynqmp: Add avnet_ultra96_rev1_defconfig to the lits of boardsTom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-08-07Merge tag 'xilinx-for-v2018.09-rc2' of git://git.denx.de/u-boot-microblazeTom Rini
Xilinx fixes for v2018.09-rc2 xilinx: - Add support for zybo z7 and ultra96 - Tune zynq and zynqmp mini configurations - Move SYS_MALLOC_LEN to Kconfig fdt - make static funcs gpio: - Fix soft gpio driver - Fix Zynq gpio driver by using platdata microblaze: - Fix Kconfig entry spi - Move ISSI to Kconfig
2018-08-07Merge git://git.denx.de/u-boot-marvellTom Rini
2018-08-07Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini
2018-08-07Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-stagingTom Rini
2018-08-07arm: zynq: dts: add spi flash node to zedboardLuis Araneda
Add a flash node to fix the detection of the memory IC. With the changes introduced with commit 8fee8845e754 ("enf_sf: reuse setup_flash_device instead of open coding it") the SPI speed is now read from device-tree or a default value is applied. This replaced the old behavior of setting the SPI speed to CONFIG_ENV_SPI_MAX_HZ. As this board didn't have a flash node, the default value was applied to the SPI speed, producing an error when probing the flash memory (speed too slow). Signed-off-by: Luis Araneda <luaraneda@gmail.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-08-07gpio: xilinx: Add support for using label propertyMichal Simek
Add support for reading label property from DT and set up bank name based on that. If label property is not present full device node name is used. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Return 0 from xilinx_gpio_set_valueMichal Simek
.set_value functions have no specified return value and gpio_uclass is not working with it too. But this patch is returning 0 to be in sync with others DM gpio drivers. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Not read output values via regsMichal Simek
Reading registers for finding out output value is not working because input value is read instead in case of tristate. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07common: fdt: Make fdt_del_subnodes/fdt_del_partition staticMichal Simek
These functions are only called in this file that's why make them static to keep static analysers happy. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-07gpio: xilinx: Simplify logic in xilinx_gpio_set_valueMichal Simek
There is no reason to do read/write for if/else separately. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Set value before changing directionMichal Simek
Set a value before changing gpio direction. This will ensure that the old value is not propagated when direction has changed but new value is not written yet. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Remove !DM driverMichal Simek
There is no user for !DM driver that's why remove it. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-08-07gpio: xilinx: Find out bank before use in xilinx_gpio_get_function()Michal Simek
Call xilinx_gpio_get_bank_pin() before use. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07arm64: a37xx: add CONFIG_MTD_DEVICE and CONFIG_MTD_PARTITIONSVladimir Vid
CONFIG_MTD_DEVICE is required for the mtdparts command and but it is missing from the mvebu_armada-37xx.h CONFIG_MTD_PARTITIONS is needed for the ubi support. Some of the Marvell based devices may require this as well. Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr> Signed-off-by: Luka Perkov <luka.perkov@sartura.hr> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07tools: kwboot: properly quit when read() returns 0Willy Tarreau
When kwboot is attached to a terminal which disappears such as one connected via an unplugged USB cable, read() returns 0, making kwboot loop until a key is pressed in the terminal. The only case where read() may return 0 here is when the terminal is closed anyway, so let's properly handle this one and report is similar to other errors. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07tools: kwboot: unbreak terminal-only modeWilly Tarreau
Commit 84899e2 ("tools/kwboot: Sync with latest barebox version to support Armada XP") accidently broke the terminal-only mode (-t) by removing the test on the bootmsg. Thus even when trying to use kwboot as a plain terminal, it asks to reboot the target. This commit simply reintroduces the lost test so that it is possible again to use kwboot to attach to the target system's console. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07ARM: kirkwood: add SBx81LIFXCAT boardChris Packham
This is a series of line cards for Allied Telesis's SBx8100 chassis switch. The CPU block is common to the SBx81GP24 and SBx81GT24 cards cards collectively referred to as SBx81LIFXCAT in u-boot. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07arm: mvebu: clearfog: add u-boot, dm-spl tag for spiJon Nettleton
This is required so SPL and u-boot can boot from spi flash devices that use the dm drivers. Signed-off-by: Jon Nettleton <jon@solid-run.com> [baruch: use -u-boot.dtsi] Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07arm: mvebu: helios4: remove duplicate sdhci pins nodeBaruch Siach
The same pinctrl node appears in the solidrun-microsom dtsi. Use that instead. Cc: Dennis Gilmore <dennis@ausil.us> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Dennis Gilmore <dennis@ausil.us> Tested-by: Dennis Gilmore <dennis@ausil.us> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07arm: mvebu: Better align Clearfog dts file with Linux kernelJon Nettleton
This makes changes so the u-boot dts file is structured more similar to the mainline linux dtsi file. It provides a minimal common dts that can work for most boards based on the ClearFog platform. Ethernet support is only supported for eth0 however all devices are left enabled so u-boot can generate and provide mac addresses for all of the network interfaces. Signed-off-by: Jon Nettleton <jon@solid-run.com> [baruch: rebase on recent changes] Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Dennis Gilmore <dennis@ausil.us> Tested-by: Dennis Gilmore <dennis@ausil.us> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07arm: mvebu: clearfog: use the microsom .dtsiBaruch Siach
Use hardware description from the recently introduced microsom .dtsi file to reduce duplication. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Dennis Gilmore <dennis@ausil.us> Tested-by: Dennis Gilmore <dennis@ausil.us> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07arm: mvebu: solidrun-microsom: update SPI flash compatibleBaruch Siach
Add the "spi-flash" compatible string so that the generic sf_probe driver can probe the SPI flash on the SolidRun SOM. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07configs: kirkwood: Move RTC_MV to DM and KconfigChris Packham
Now that there is DM support in the RTC_MV driver update board configs to use it. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07configs: move RTC_MV config from mv-plug-common.h to boardsChris Packham
To aid in migrating CONFIG_RTC_MV to Kconfig move the definition of it from mv-plug-common.h to the board config headers that nest it. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-07configs: kirkwood: ds109: switch to DM_I2CChris Packham
Enable DM_I2C and I2C_MVTSWI for the ds109 board. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2018-08-06i2c: imx_lpi2c: add uclass api supportPeng Fan
Use uclass clk api to get per clk when CONFIG_CLK enabled. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-08-06i2c-mux: pca954x: support pca9646 i2c switchPeng Fan
Add the PCA9646 support, which is 2-wire bus switch and buffered 4-channel. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>