platform/kernel/u-boot.git
2 years agonet: fec_mxc: Drop CONFIG_FEC_XCV_TYPE
Tom Rini [Fri, 11 Mar 2022 14:12:10 +0000 (09:12 -0500)]
net: fec_mxc: Drop CONFIG_FEC_XCV_TYPE

With all boards now using DM_ETH we determine the value for
CONFIG_FEC_XCV_TYPE at run time, except in the case of the default
fall-back.  Set the fallback directly now.

Cc: Fabio Estevam <festevam@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: fec_mxc: Remove non-DM_ETH code
Tom Rini [Fri, 11 Mar 2022 14:12:09 +0000 (09:12 -0500)]
net: fec_mxc: Remove non-DM_ETH code

Now that all boards have been converted, remove the non-DM_ETH code.

Cc: Fabio Estevam <festevam@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoimx: Convert some boards to DM_ETH
Tom Rini [Fri, 11 Mar 2022 14:12:08 +0000 (09:12 -0500)]
imx: Convert some boards to DM_ETH

A small number of i.MX6/7 and vf610 boards have not enabled DM_ETH yet.
Given the state of the rest of the platform, enable DM_ETH.

Cc: Alison Wang <alison.wang@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Richard Hu <richard.hu@technexion.com>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Uri Mashiach <uri.mashiach@compulab.co.il>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_ETHPRIME to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:12:07 +0000 (09:12 -0500)]
Convert CONFIG_ETHPRIME to Kconfig

This converts the following to Kconfig:
   CONFIG_ETHPRIME

This is also done by adding a gating Kconfig option, CONFIG_USE_ETHPRIME
similar to other options that are not always set and control environment
variables.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoRemove CONFIG_HAS_ETH0 et al symbols
Tom Rini [Fri, 11 Mar 2022 14:12:06 +0000 (09:12 -0500)]
Remove CONFIG_HAS_ETH0 et al symbols

This converts removes the following symbols:
   CONFIG_HAS_ETH0
   CONFIG_HAS_ETH1
   CONFIG_HAS_ETH2
   CONFIG_HAS_ETH3

This is because at this point, only the ids8313 platform was using the
code which was controlled by these symbols.  In turn, this code already
performs error checking on being able to perform the device tree fixup.
Rather than convert these to Kconfig for a single platform, update the
code to not need these checks and remove them from all the platforms
they were unused on.

Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_NFS_TIMEOUT to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:12:05 +0000 (09:12 -0500)]
Convert CONFIG_NFS_TIMEOUT to Kconfig

This converts the following to Kconfig:
   CONFIG_NFS_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_BOOT_RETRY_TIME et al to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:12:04 +0000 (09:12 -0500)]
Convert CONFIG_BOOT_RETRY_TIME et al to Kconfig

This converts the following to Kconfig:
   CONFIG_BOOT_RETRY_TIME
   CONFIG_BOOT_RETRY_MIN
   CONFIG_RESET_TO_RETRY

We also introduce CONFIG_BOOT_RETRY to gate these options, and clean up
the associated Makefile entry and C code for picking default values of
CONFIG_BOOT_RETRY_MIN.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agopowerpc: Move CONFIG_BPTR_VIRT_ADDR out of CONFIG namespace
Tom Rini [Fri, 11 Mar 2022 14:12:03 +0000 (09:12 -0500)]
powerpc: Move CONFIG_BPTR_VIRT_ADDR out of CONFIG namespace

This is only used in one file, and is never overridden.  Move this out
of CONFIG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_NET_RETRY_COUNT to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:12:02 +0000 (09:12 -0500)]
Convert CONFIG_NET_RETRY_COUNT to Kconfig

This converts the following to Kconfig:
   CONFIG_NET_RETRY_COUNT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_ARP_TIMEOUT to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:12:01 +0000 (09:12 -0500)]
Convert CONFIG_ARP_TIMEOUT to Kconfig

This converts the following to Kconfig:
   CONFIG_ARP_TIMEOUT

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_A008044_WORKAROUND to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:12:00 +0000 (09:12 -0500)]
Convert CONFIG_A008044_WORKAROUND to Kconfig

This converts the following to Kconfig:
   CONFIG_A008044_WORKAROUND

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_A003399_NOR_WORKAROUND to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:11:59 +0000 (09:11 -0500)]
Convert CONFIG_A003399_NOR_WORKAROUND to Kconfig

This converts the following to Kconfig:
   CONFIG_A003399_NOR_WORKAROUND

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_ARMV8_SWITCH_TO_EL1 to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:11:58 +0000 (09:11 -0500)]
Convert CONFIG_ARMV8_SWITCH_TO_EL1 to Kconfig

This converts the following to Kconfig:
   CONFIG_ARMV8_SWITCH_TO_EL1

Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
2 years agoConvert CONFIG_ARMV7_SECURE_BASE et al to Kconfig
Tom Rini [Fri, 11 Mar 2022 14:11:56 +0000 (09:11 -0500)]
Convert CONFIG_ARMV7_SECURE_BASE et al to Kconfig

This converts the following to Kconfig:
   CONFIG_ARMV7_SECURE_BASE
   CONFIG_ARMV7_SECURE_MAX_SIZE
   CONFIG_ARMV7_SECURE_RESERVE_SIZE

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Re-run migrations
Tom Rini [Fri, 11 Mar 2022 12:12:48 +0000 (07:12 -0500)]
configs: Re-run migrations

As the CI test for stopping platforms from being merged that were
defining symbols that had Kconfig entries, a small number of symbols
needed to be migrated again.  Do so, and catch two cases the README
should also have been updated but was not.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoRevert "efi: Allow easy selection of serial-only operation"
Tom Rini [Fri, 11 Mar 2022 12:12:47 +0000 (07:12 -0500)]
Revert "efi: Allow easy selection of serial-only operation"

This commit re-introduced a migrated CONFIG symbol to the board header
file.  These changes should likely be handled via documentation instead,
as well.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosunxi: Do not define CONFIG_SPL_STACK_ADDR_R
Tom Rini [Fri, 11 Mar 2022 12:12:46 +0000 (07:12 -0500)]
sunxi: Do not define CONFIG_SPL_STACK_ADDR_R

We cannot define a CONFIG value here to ensure that the Kconfig value
isn't set wrong.

Fixes: 2c699fe0d34d ("configs: sunxi: Add common SUNIV header")
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoCI: Fix unmigrated symbol test
Tom Rini [Fri, 11 Mar 2022 12:12:45 +0000 (07:12 -0500)]
CI: Fix unmigrated symbol test

When calling comm to compare the CONFIG symbols a defconfig uses with
the symbols that have been migrated, we need to suppress all output as
the summary line will have everything we need.  Failure to do this leads
to the test blowing up, but in non-fatal ways.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'xilinx-for-v2022.07-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 16 Mar 2022 16:52:02 +0000 (12:52 -0400)]
Merge tag 'xilinx-for-v2022.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2022.07-rc1

microblaze:
- Add support for reserved memory

xilinx:
- Update FRU code with MAC reading

zynqmp:
- Remove double AMS setting
- DT updates (mostly for SOMs)
- Add support for zcu106 rev 1.0

zynq:
- Update nand binding

nand:
- Aligned zynq_nand to upstream DT binding

net:
- Add support for ethernet-phy-id

mmc:
- Workaround CD in zynq_sdhci driver also for ZynqMP
- Add support for dynamic/run-time SD config for SOMs

gpio:
- Add driver for slg7xl45106

firmware:
- Add support for dynamic SD config

power-domain:
- Update zynqmp driver with the latest firmware

video:
- Add skeleton driver for DP and DPDMA

i2c:
- Fix i2c to work with QEMU

pinctrl:
- Add driver for zynqmp pinctrl driver

2 years agoarm64: zynqmp: Add pinctrl emmc description to SM-K26
Michal Simek [Mon, 14 Mar 2022 14:26:11 +0000 (15:26 +0100)]
arm64: zynqmp: Add pinctrl emmc description to SM-K26

Production SOM has emmc on it and make sense to describe pin description to
be able use EMMC if it is not configured via psu_init.
(Still some regs are not handled but this is one step in that direction)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/3545a0f08d342de98efc82b78f5725eda091555a.1647267969.git.michal.simek@xilinx.com
2 years agoMerge branch '2022-03-15-add-erofs-support' into next
Tom Rini [Wed, 16 Mar 2022 12:09:12 +0000 (08:09 -0400)]
Merge branch '2022-03-15-add-erofs-support' into next

- Add erofs support

2 years agotest/py: Add tests for the erofs
Huang Jianan [Sat, 26 Feb 2022 07:05:51 +0000 (15:05 +0800)]
test/py: Add tests for the erofs

Add Python scripts to test 'ls' and 'load' commands, as well as
test related filesystem functions.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>
2 years agofs/erofs: add filesystem commands
Huang Jianan [Sat, 26 Feb 2022 07:05:50 +0000 (15:05 +0800)]
fs/erofs: add filesystem commands

Add 'ls' and 'load' commands.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>
2 years agofs/erofs: add lz4 decompression support
Huang Jianan [Sat, 26 Feb 2022 07:05:49 +0000 (15:05 +0800)]
fs/erofs: add lz4 decompression support

Support EROFS lz4 compressed files.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>
2 years agolib/lz4: update LZ4 decompressor module
Huang Jianan [Sat, 26 Feb 2022 07:05:48 +0000 (15:05 +0800)]
lib/lz4: update LZ4 decompressor module

Update the LZ4 compression module based on LZ4 v1.8.3 in order to
use the newest LZ4_decompress_safe_partial() which can now decode
exactly the nb of bytes requested.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>
2 years agofs/erofs: add erofs filesystem support
Huang Jianan [Sat, 26 Feb 2022 07:05:47 +0000 (15:05 +0800)]
fs/erofs: add erofs filesystem support

This patch mainly deals with uncompressed files.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>
2 years agoCI, Docker: Update to latest focal tag
Tom Rini [Tue, 15 Mar 2022 20:18:16 +0000 (16:18 -0400)]
CI, Docker: Update to latest focal tag

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'v2022.04-rc4' into next
Tom Rini [Mon, 14 Mar 2022 21:40:36 +0000 (17:40 -0400)]
Merge tag 'v2022.04-rc4' into next

Prepare v2022.04-rc4

2 years agoPrepare v2022.04-rc4
Tom Rini [Mon, 14 Mar 2022 20:39:08 +0000 (16:39 -0400)]
Prepare v2022.04-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-03-14-regression-fixes'
Tom Rini [Mon, 14 Mar 2022 18:04:55 +0000 (14:04 -0400)]
Merge branch '2022-03-14-regression-fixes'

- Regression fixes for RK3399 eMMC, j721e Sierra SerDes driver,
  vexpress64 autoboot and tbs2910 image size

2 years agoboard: tbs2910: Enable Link Time Optimizations in defconfig
Soeren Moch [Mon, 14 Mar 2022 08:26:25 +0000 (09:26 +0100)]
board: tbs2910: Enable Link Time Optimizations in defconfig

This saves about 12 kBytes image size and helps to stay within the
size limit.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Soeren Moch <smoch@web.de>
2 years agovexpress64: fvp: Fix automatic boot
Andre Przywara [Fri, 4 Mar 2022 16:30:08 +0000 (16:30 +0000)]
vexpress64: fvp: Fix automatic boot

Commit 90f262a6951f ("vexpress64: Clean up BASE_FVP boot configuration")
cleaned up the usage of default address variables, but missed to update
the address for the kernel in the FVP's bootcmd definition.

Change ${kernel_addr} to read ${kernel_addr_r} to bring back the
automated boot for the fastmodel.
Also use "setenv" instead of the potentially ambiguous "set" on the way.

Fixes: 90f262a6951f ("vexpress64: Clean up BASE_FVP boot configuration")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoboard: ti: j721e: evm.c: Fix the probing of in Sierra SerDes0
Aswath Govindraju [Fri, 4 Mar 2022 12:15:26 +0000 (17:45 +0530)]
board: ti: j721e: evm.c: Fix the probing of in Sierra SerDes0

Initialization and power on operations of links have been moved under the
link device in the Sierra SerDes driver. Also, the UCLASS of
sierra_phy_provider has been changed to UCLASS_MISC.

Therefore, fix the probing of SerDes0 instance accordingly.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
2 years agophy: cadence: Sierra: Move the link operations from serdes phy to link device
Aswath Govindraju [Fri, 4 Mar 2022 12:15:25 +0000 (17:45 +0530)]
phy: cadence: Sierra: Move the link operations from serdes phy to link device

In commit 6f46c7441a9f ("phy: cadence: Sierra: Add a UCLASS_PHY device for
links"), a separate udevice of type UCLASS_PHY was created for each link.
Therefore, move the corresponding link operations under the link device.

Also, change the uclass of sierra phy to UCLASS_MISC as it is no longer the
phy device.

Fixes: 6f46c7441a9f ("phy: cadence: Sierra: Add a UCLASS_PHY device for links")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
2 years agorockchip: sdhci: Fix RK3399 eMMC PHY power cycling
Alper Nebi Yasak [Fri, 28 Jan 2022 22:42:37 +0000 (01:42 +0300)]
rockchip: sdhci: Fix RK3399 eMMC PHY power cycling

The Rockchip RK3399 eMMC PHY has to be power-cycled while changing its
clock speed to some higher speeds. This is dependent on the desired
SDHCI clock speed, and it looks like the PHY should be powered off while
setting the SDHCI clock in these cases.

Commit ac804143cfd1 ("mmc: rockchip_sdhci: add phy and clock config for
rk3399") attempts to do this in the set_ios_post() hook by setting the
SDHCI clock once more while the PHY is turned off/on as necessary, as
the SDHCI framework does not provide a way to override how it sets its
clock. However, the commit breaks reinitializing the eMMC on a few
boards including chromebook_kevin and reportedly ROCKPro64.

This patch reworks the power cycling to utilize the SDHCI framework
slightly better (using the set_control_reg() hook to power off the PHY
and set_ios_post() hook to power it back on) which happens to fix the
issue, at least on a chromebook_kevin.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 14 Mar 2022 15:24:20 +0000 (11:24 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- kwboot: Misc minor improvement and fixes, e.g. mix of arguments (Pali)
- PCI: a37xx: Remap IO space to bus address 0x0 (Pali)

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Mon, 14 Mar 2022 14:57:15 +0000 (10:57 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- Trivial fixes for x86

2 years agoarm64: zynqmp: Fix i2c addresses for zynqmp-p-a2197
Michal Simek [Mon, 7 Mar 2022 07:53:38 +0000 (08:53 +0100)]
arm64: zynqmp: Fix i2c addresses for zynqmp-p-a2197

After double checking some i2c addresses are not correct. It is visible
from i2c dump

ZynqMP> i2c bus
Bus 3: i2c@ff020000
   74: i2c-mux@74, offset len 1, flags 0
Bus 5: i2c@ff020000->i2c-mux@74->i2c@0
Bus 6: i2c@ff020000->i2c-mux@74->i2c@2
Bus 7: i2c@ff020000->i2c-mux@74->i2c@1
Bus 8: i2c@ff020000->i2c-mux@74->i2c@3
Bus 4: i2c@ff030000  (active 4)
   74: i2c-mux@74, offset len 1, flags 0
Bus 9: i2c@ff030000->i2c-mux@74->i2c@0
Bus 10: i2c@ff030000->i2c-mux@74->i2c@3
Bus 11: i2c@ff030000->i2c-mux@74->i2c@4
Bus 12: i2c@ff030000->i2c-mux@74->i2c@5  (active 12)
   51: generic_51, offset len 1, flags 0
   60: generic_60, offset len 1, flags 0
   74: generic_74, offset len 1, flags 0
Bus 13: i2c@ff030000->i2c-mux@74->i2c@6  (active 13)
   51: generic_51, offset len 1, flags 0
   5d: generic_5d, offset len 1, flags 0
   74: generic_74, offset len 1, flags 0
ZynqMP> i2c dev 4
Setting bus to 4
ZynqMP> i2c mw 74 0 18
ZynqMP> i2c probe
Valid chip addresses: 18 36 37 50 51 60 74
ZynqMP> i2c mw 74 0 20
ZynqMP> i2c probe
Valid chip addresses: 51 60 74

where it is clear that si570 (u5) is at 0x60 address and 8t49n240 (u39) is
also at address 0x60 based on log above.
i2c address 0x74 is i2c mux and 0x51 is eeprom.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/0a198e9d993411e41473d130d5a5c20b6dc83458.1646639616.git.michal.simek@xilinx.com
2 years agopinctrl: zynqmp: Add pinctrl driver
Ashok Reddy Soma [Wed, 23 Feb 2022 14:23:05 +0000 (15:23 +0100)]
pinctrl: zynqmp: Add pinctrl driver

Add pinctrl driver for Xilinx ZynqMP SOC. This driver is compatible with
linux device tree parameters for configuring pinmux and pinconf.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/2d7eefa83c8c0129f7243a25de56a289e948f6c6.1645626183.git.michal.simek@xilinx.com
2 years agopinctrl: Increase length of pinmux status buffer
Ashok Reddy Soma [Wed, 23 Feb 2022 14:23:04 +0000 (15:23 +0100)]
pinctrl: Increase length of pinmux status buffer

Xilinx ZynqMP SOC can set 6 parameters for its pins. pinmux status
command will print the status of these parameters for each pin. But
current print buffer length is only 40 characters long, increase it
to 80 to print all the parameters.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/3a6be84c8354f38754a9838670cc0319e84f29e8.1645626183.git.michal.simek@xilinx.com
2 years agocmd: test: pinmux: Do not check all empty spaces
Michal Simek [Mon, 7 Mar 2022 15:48:17 +0000 (16:48 +0100)]
cmd: test: pinmux: Do not check all empty spaces

There is really no value to check empty spaces. That's why use
ut_assert_nextlinen() instead of ut_assert_nextline().
This change ensures that PINMUX_SIZE can be increased without changing
tests.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/03aecf4c67ec8d72bf2a90baf1516fc5bd300fe0.1646668094.git.michal.simek@xilinx.com
2 years agoMerge branch '2022-03-10-platform-updates' into next
Tom Rini [Mon, 14 Mar 2022 13:05:06 +0000 (09:05 -0400)]
Merge branch '2022-03-10-platform-updates' into next

- Assorted TI omap3, j7 platform updates
- Phytium Pomelo board

2 years agoarm: a37xx: Remap IO space to bus address 0x0
Pali Rohár [Mon, 7 Mar 2022 18:12:59 +0000 (19:12 +0100)]
arm: a37xx: Remap IO space to bus address 0x0

Remap PCI I/O space to the bus address 0x0 in the Armada 37xx device-tree
in order to support legacy I/O port based cards which have hardcoded I/O
ports in low address space.

Some legacy PCI I/O based cards do not support 32-bit I/O addressing.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Allow to mix positional arguments with option -b
Pali Rohár [Mon, 7 Mar 2022 18:03:09 +0000 (19:03 +0100)]
tools: kwboot: Allow to mix positional arguments with option -b

Commit 9e6d71d2b55f ("tools: kwboot: Allow to use -b without image path as
the last getopt() option") broke usage of kwboot with following arguments:

  kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-spl.kwb

Fix parsing of option -b with optional argument again.

Fixes: 9e6d71d2b55f ("tools: kwboot: Allow to use -b without image path as the last getopt() option")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reported-by: Tony Dinh <mibodhi@gmail.com>
Tested-by: Tony Dinh <mibodhi at gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Check if baudrate value is supported before sending image
Pali Rohár [Mon, 7 Mar 2022 18:03:08 +0000 (19:03 +0100)]
tools: kwboot: Check if baudrate value is supported before sending image

Call kwboot_open_tty() which baudrate value which was specified at the
command line by option -B. This function returns error if baudrate is not
supported by selected tty device.

Initial baudrate for image transfer is always 115200, so call
kwboot_tty_change_baudrate() with value 115200 immediately after
kwboot_open_tty() if baudrate specified by option -B is different than
115200.

This makes kwboot fail immediately, informing that baudrate is unsupported,
instead of failing only after the first part of image is already sent.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotools: kwboot: Allow to specify custom baudrate only in supported operations
Pali Rohár [Mon, 7 Mar 2022 18:03:07 +0000 (19:03 +0100)]
tools: kwboot: Allow to specify custom baudrate only in supported operations

Custom baudrate different than 115200 may be specified only when kwboot is
not going to send boot/debug message pattern or when it is going to send
boot message pattern with image file (in which case baudrate change happens
after sending kwbimage header). BootROM detects boot/debug message pattern
only at baudrate 115200.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agox86: Correct the coreboot header file in MAINTAINERS
Simon Glass [Sun, 13 Mar 2022 06:03:28 +0000 (23:03 -0700)]
x86: Correct the coreboot header file in MAINTAINERS

This board has its own config header file. Correct it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agox86: Add an enum name for the GNVS firmware type
Simon Glass [Sun, 13 Mar 2022 06:03:27 +0000 (23:03 -0700)]
x86: Add an enum name for the GNVS firmware type

This enum is currently anonymous. Add a name so it can be used in the
code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoMerge tag 'efi-2022-04-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 13 Mar 2022 12:18:17 +0000 (08:18 -0400)]
Merge tag 'efi-2022-04-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc3-2

Documentation:
* Fix description for SiFive Unmatched
* Add libgnutls28-dev to build dependencies

UEFI
* Avoid possibly invalid GUID pointers for protocol interfaces

Other
* Serial console support for cls command

2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Sat, 12 Mar 2022 12:20:29 +0000 (07:20 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi

- sunXi SPI fixups (Andre)
- bcm iproc qspi (Rayagonda)

2 years agoefi_loader: copy GUID in InstallProtocolInterface()
Heinrich Schuchardt [Wed, 9 Mar 2022 18:56:23 +0000 (19:56 +0100)]
efi_loader: copy GUID in InstallProtocolInterface()

InstallProtocolInterface() is called with a pointer to the protocol GUID.
There is not guarantee that the memory used by the caller for the protocol
GUID stays allocated. To play it safe the GUID should be copied to U-Boot's
internal structures.

Reported-by: Joerie de Gram <j.de.gram@gmail.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: add libgnutls28-dev to build dependencies
Heinrich Schuchardt [Sat, 12 Mar 2022 10:56:23 +0000 (11:56 +0100)]
doc: add libgnutls28-dev to build dependencies

mkeficapsule requires package libgnutls28-dev for building

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: path to u-boot-spl.bin on SiFive Unmatched board
Heinrich Schuchardt [Thu, 10 Mar 2022 10:32:49 +0000 (11:32 +0100)]
doc: path to u-boot-spl.bin on SiFive Unmatched board

u-boot-spl.bin is built in spl/.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agocmd: add serial console support for the cls command
Heinrich Schuchardt [Fri, 11 Feb 2022 17:11:05 +0000 (18:11 +0100)]
cmd: add serial console support for the cls command

Currently the cls command does not support the serial console

The screen can be cleared in the video uclass, the colored frame buffer
console, and the serial console by sending the same escape sequence.
This reduces the cls command to a single printf() statement on most
boards.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agomtd: spi-nor-ids: Enable quad read for Gigadevice gd25lq128
Niklas Cassel [Thu, 3 Mar 2022 18:26:39 +0000 (18:26 +0000)]
mtd: spi-nor-ids: Enable quad read for Gigadevice gd25lq128

The Gigadevice gd25lq128 serial flash exists in different versions,
all which identify themselves using the same JEDEC id.

gd25lq128c:
https://www.gigadevice.com/datasheet/gd25lq128

gd25lq128d:
https://www.gigadevice.com/datasheet/gd25lq128d

However, all versions support quad read, so enable it.
Tested and verified on the Sipeed MAix BiT board.

Fixes: 30b9a28a3f2d ("mtd: spi-nor-ids: Add Gigadevice gd25lq128 ID")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agoarm: add initial support for the Phytium Pomelo Board
weichangzheng [Wed, 2 Mar 2022 07:09:05 +0000 (15:09 +0800)]
arm: add initial support for the Phytium Pomelo Board

This adds platform code and the device tree for the Phytium Pomelo Board.
The initial support comprises the UART and the PCIE.

Signed-off-by: weichangzheng <nicholas_zheng@outlook.com>
2 years agoARM: mach-omap2: omap3: Make clock functions static
Adam Ford [Sat, 5 Mar 2022 14:25:23 +0000 (08:25 -0600)]
ARM: mach-omap2: omap3: Make clock functions static

get_osc_clk_speed and get_sys_clkin_sel are only used in
one file.  Make them static.

Tested on OMAP3530, DM3730, AM3517.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoARM: am3517_evm: Remove hard-coded pin muxing
Adam Ford [Sat, 26 Feb 2022 21:17:24 +0000 (15:17 -0600)]
ARM: am3517_evm: Remove hard-coded pin muxing

With updated device trees now supporting pinmuxing for USB,
ethernet, MMC, and other peripherals necessary to start MLO
and U-Boot, the hard-coded pinmux options can be removed since
they are now handed by DM and only muxed when the respective
peripheral needs it.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
2 years agoARM: dts: am3517-evm: Sync DTS with Linux 5.17-rc5
Adam Ford [Sat, 26 Feb 2022 21:17:23 +0000 (15:17 -0600)]
ARM: dts: am3517-evm: Sync DTS with Linux 5.17-rc5

Sync the am3517-evm device tree files with those from Linux
5.17-rc5 with some additional fixes for pinmuxing Ethernet and
moving the pinmux references to the respective peripherals.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
2 years agoARM: dts: logicpd-torpedo: Resyc DTS files with Linux 5.17-rc5
Adam Ford [Sat, 26 Feb 2022 17:01:21 +0000 (11:01 -0600)]
ARM: dts: logicpd-torpedo: Resyc DTS files with Linux 5.17-rc5

Resyc DTS files with Linux 5.17-rc5.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoARM: omap3_logic: Remove hard-coded USB muxing
Adam Ford [Sat, 26 Feb 2022 16:49:48 +0000 (10:49 -0600)]
ARM: omap3_logic: Remove hard-coded USB muxing

With recent fixes to USB pinmuxing in the device trees, there
is no need to hard-code the pinmuxing in this table.  It is
all handled in DM now.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoARM: dts: logicpd-som-lv: Resync DTS files with Linux 5.17-rc5
Adam Ford [Sat, 26 Feb 2022 16:49:47 +0000 (10:49 -0600)]
ARM: dts: logicpd-som-lv: Resync DTS files with Linux 5.17-rc5

Resync the DTS files for the Logic PD SOM-LV with Linux 5.17-rc5
with some additional pending changes to address issues with
wrong pin-muxing on the OMAP35.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoARM: am3517-evm: Remove more non-DM legacy ethernet reset code
Adam Ford [Sat, 26 Feb 2022 16:13:09 +0000 (10:13 -0600)]
ARM: am3517-evm: Remove more non-DM legacy ethernet reset code

The ethernet controller is DM compliant, and the device tree
defines it.  There is no need to manually handle pulling
the ethernet out of reset.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
2 years agoconfigs: j721e_hs_evm_a72_defconfig: Add command for initializing QSGMII PHY
Aswath Govindraju [Tue, 22 Feb 2022 05:19:05 +0000 (10:49 +0530)]
configs: j721e_hs_evm_a72_defconfig: Add command for initializing QSGMII PHY

QSGMII PHY present on the j721e common processor board requires
to be initialized before the core boots up. Therefore, run the
corresponding command during boot to do the same.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2 years agoconfigs: j721e_evm_a72_defconfig: Fix the bootcmd
Aswath Govindraju [Tue, 22 Feb 2022 05:19:04 +0000 (10:49 +0530)]
configs: j721e_evm_a72_defconfig: Fix the bootcmd

Add the command "boot_rprocs" that is required for booting remote
processors in U-Boot.

Fixes: 5980925e2a5a ("include: configs: j721e_evm: Add support to boot ethfw core in j721e")
Reported-by: Jesse Villarreal <jesse.villarreal@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2 years agoinclude: configs: j721e_evm.h: Fix the env variable corresponding to QSGMII PHY init
Aswath Govindraju [Tue, 22 Feb 2022 05:19:03 +0000 (10:49 +0530)]
include: configs: j721e_evm.h: Fix the env variable corresponding to QSGMII PHY init

QSGMII PHY initialization should only be done for J721E EVMs and not for
J721E-SK boards. Therefore, fix the environment variables accordingly.

Also, by default remote processors should not be booted in U-Boot but
rather be left to the users to enable this by setting dorprocboot.
Therefore, remove dorprocboot that is being set by default.

Fixes: 5980925e2a5a ("include: configs: j721e_evm: Add support to boot ethfw core in j721e")
Reported-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
2 years agoram: aspeed: Rework kconfig options
Joel Stanley [Wed, 16 Feb 2022 07:53:22 +0000 (18:23 +1030)]
ram: aspeed: Rework kconfig options

Ensure the ASPEED related options are grouped together under the RAM
option when enabling support.

This also makes some minor grammar corrections and renames options so
they present cleanly in menuconfig.

There should be no functional change to the configuration or binary.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Dylan Hung <dylan_hung@aspeedtech.com>
2 years agoARM: omap3_beagle: Enable DM_PMIC and DM_REGULATOR
Romain Naour [Fri, 25 Feb 2022 11:18:34 +0000 (12:18 +0100)]
ARM: omap3_beagle: Enable DM_PMIC and DM_REGULATOR

Enabling DM_PMIC, DM_REGULATOR_FIXED, and DM_REGULATOR_GPIO
gives us the ability to better monitor voltages and enable
hardware through the device tree. The TL4030 (TPS65950) is
not yet migrated to DM, so this patch only enables the fixed
and GPIO controlled regulators.

Based on commit [1][2].

[1] a40d3cc845756e1e38af5ac31986539417e64abb
[2] 2448e42d73fb91e4b56bb41b2677e18ab99a6c83

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2 years agoARM: omap3_beagle: Enable Pinctrl
Romain Naour [Fri, 25 Feb 2022 11:18:33 +0000 (12:18 +0100)]
ARM: omap3_beagle: Enable Pinctrl

The simple pinctrl driver currently available works with the omap3.
Enabling this will use the device tree to automatically set the
pin-muxing for various drivers.

Based on commit: 57dbf754e37d3347cad441f3869bf72c0d726a71

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2 years agoARM: omap3_beagle: Power on MMC when setting up PMIC
Romain Naour [Fri, 25 Feb 2022 11:18:32 +0000 (12:18 +0100)]
ARM: omap3_beagle: Power on MMC when setting up PMIC

The PMIC enables power to the MMC card by default, but depending
on the state it was left when restarted, it's possible the MMC
may be powered down.

This patch patch explicitly tells the twl4030 to power the MMC.

Based on commits [1][2].

[1] 64fd2d26140aa72b43428d079974f7c0e7f88353
[2] 27b653449178e80b333e7bc5a81eed3bd1bd6861

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2 years agoARM: omap3_beagle: Remove non-DM initialization
Romain Naour [Fri, 25 Feb 2022 11:18:31 +0000 (12:18 +0100)]
ARM: omap3_beagle: Remove non-DM initialization

With DM_MMC working for both SPL and U-Boot, this patch removes
the legacy style of initializing the MMC driver.

Based on omap3_logic: 42140dd0962bc134c0aad27524d0f4cc3955f255.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2 years agoMerge branch '2022-03-09-events-subsystem' into next
Tom Rini [Thu, 10 Mar 2022 13:28:40 +0000 (08:28 -0500)]
Merge branch '2022-03-09-events-subsystem' into next

To quote the author:
It is a common need in U-Boot to have one subsystem notify another
when something happens. An example is reading a partition table when a
new block device is set up.

It is also common to add weak functions and 'hook' functions to modify
how U-Boot works. See for example ft_board_setup() and the like.

U-Boot would benefit from a generic mechanism to handle these cases,
with the ability to hook into various 'events' in a
subsystem-independent and transparent way.

This series provides a way to create and dispatch events, with a way of
registering a 'spy' which watches for events of different types. This
allows 'hook' functions to be created in a generic way.

It also includes a script to list the hooks in an image, which is a bit
easier to debug than weak functions, as well as an 'event' command to
do the same from within U-Boot.

These 'static' events can be used to replace hooks like misc_init_f(),
for example. Also included is basic support for 'dynamic' events, where
a spy can be registered at runtime. The need for this is still being
figured out.

2 years agoevent: Add documentation
Simon Glass [Fri, 4 Mar 2022 15:43:08 +0000 (08:43 -0700)]
event: Add documentation

Add documentation for events, including the event command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Add a script to decode the event-spy list
Simon Glass [Fri, 4 Mar 2022 15:43:07 +0000 (08:43 -0700)]
event: Add a script to decode the event-spy list

For debugging and dicoverability it is useful to be able to see a list of
each event spy in a U-Boot ELF file. Add a script which shows this, along
with the event type and the source location. This makes events a little
easier to use than weak functions, for example.

Add a basic sandbox test as well. We could provide a test for other
boards, but for now, few use events.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Add a command
Simon Glass [Fri, 4 Mar 2022 15:43:06 +0000 (08:43 -0700)]
event: Add a command

Add a command to show the available events.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Convert arch_cpu_init_dm() to use events
Simon Glass [Fri, 4 Mar 2022 15:43:05 +0000 (08:43 -0700)]
event: Convert arch_cpu_init_dm() to use events

Instead of a special function, send an event after driver model is inited
and adjust the boards which use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Convert misc_init_f() to use events
Simon Glass [Fri, 4 Mar 2022 15:43:04 +0000 (08:43 -0700)]
event: Convert misc_init_f() to use events

This hook can be implmented using events, for the three boards that
actually use it.

Add the event type and event handlers. Drop CONFIG_MISC_INIT_F since we
can just use CONFIG_EVENT to control this. Since sandbox always enables
CONFIG_EVENT, we can drop the defconfig lines there too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Add events for device probe/remove
Simon Glass [Fri, 4 Mar 2022 15:43:03 +0000 (08:43 -0700)]
event: Add events for device probe/remove

Generate events when devices are probed or removed, allowing hooks
to be added for these situations.

This is controlled by the DM_EVENT config option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Set up the event system on start-up
Simon Glass [Fri, 4 Mar 2022 15:43:02 +0000 (08:43 -0700)]
event: Set up the event system on start-up

Call event_init() before relocation to get the event system running.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Add a simple test
Simon Glass [Fri, 4 Mar 2022 15:43:01 +0000 (08:43 -0700)]
event: Add a simple test

Add a test for event registration and activation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoevent: Add basic support for events
Simon Glass [Fri, 4 Mar 2022 15:43:00 +0000 (08:43 -0700)]
event: Add basic support for events

Add a way to create and dispatch events without needing to allocate
memory. Also add a way to 'spy' on events, thus allowing 'hooks' to be
created.

Use a linker list for static events, which we can use to replace functions
like arch_cpu_init_f(). Allow an EVENT_DEBUG option which makes it
easier to see what is going on at runtime, but uses more code space.

Dynamic events allow the creation of a spy at runtime. This is not always
necessary, but can be enabled with EVENT_DYNAMIC if needed.

A 'test' event is the only option for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Expand elf support a little
Simon Glass [Fri, 4 Mar 2022 15:42:59 +0000 (08:42 -0700)]
binman: Expand elf support a little

Allow finding a symbol by its address. Also export the function to get
the file offset of a particular address, so it can be used by a script to
be added.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: start: Sort the header files
Simon Glass [Fri, 4 Mar 2022 15:42:58 +0000 (08:42 -0700)]
sandbox: start: Sort the header files

These header files don't follow the correct order. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agosunxi: boards: Enable SPI flash support in U-Boot proper
Andre Przywara [Tue, 11 Jan 2022 12:46:06 +0000 (12:46 +0000)]
sunxi: boards: Enable SPI flash support in U-Boot proper

Some sunxi boards ship with SPI flash, which allows booting through the
BootROM. We cover this functionality by a separate SPL "mini" driver.
Separately we have a proper DM_SPI driver for U-Boot proper, which
provides access to the SPI flash through the "sf" command. That allows
to update the firmware on the SPI flash, also to store the environment
there.

However only very few boards actually enable support for U-Boot proper,
even though that would work and the SPL part is configured.

Use the cleaned up configuration scheme to enable SPI flash on those
boards which mention a SPI flash in their .dts, or which use the SPL SPI
support.

Out of the box this would enable storing the environment on the SPI
flash, and allows people to read or write the flash from U-Boot, for
instance to update the SPI flash when booted via an SD card.

For this to actually work there must be a "spi0" alias in the DT, which
most boards are missing. But this should be addressed separately.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agoenv: sunxi: enable ENV_IS_IN_SPI_FLASH
Andre Przywara [Tue, 11 Jan 2022 12:46:05 +0000 (12:46 +0000)]
env: sunxi: enable ENV_IS_IN_SPI_FLASH

Now that sunxi uses CONFIG_SPI more sanely, and can also now properly
load the environment from SPI flash, let's enable the symbol that
actually considers the SPI flash when accessing the environment.

As this symbol depends on CONFIG_SPI, which we now only enable if the
board has a SPI flash, we can make if "default y" for all Allwinner
boards.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agosunxi: use boot source for determining environment location
Andre Przywara [Tue, 11 Jan 2022 12:46:04 +0000 (12:46 +0000)]
sunxi: use boot source for determining environment location

Currently we only support to load the environment from raw MMC or FAT
locations on Allwinner boards. With the advent of SPI flash we probably
also want to support using the environment there, so we need to become
a bit more flexible.

Change the environment priority function to take the boot source into
account. When booted from eMMC or SD card, we use FAT or MMC, if
configured, as before.
If we are booted from SPI flash, we try to use the environment from
there, if possible. The same is true for NAND flash booting, although
this is somewhat theoretical right now (as untested).

This way we can use the same image for SD and SPI flash booting, which
allows us to simply copy a booted image from SD card to the SPI flash,
for instance.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agoenv: sunxi: Define location in SPI flash
Andre Przywara [Tue, 11 Jan 2022 12:46:03 +0000 (12:46 +0000)]
env: sunxi: Define location in SPI flash

To allow loading and storing the environment from SPI flash, adjust the
raw offset variables for Allwinner boards to make sense there.

U-Boot (including SPL and other blobs) is loaded from the beginning of
SPI flash, so move the environment location as far back as possible, to
not create unnecessary limits. As those offsets are shared with (now
mostly unused) raw MMC environment, we should respect the common one
megabyte limit, which also makes sense on SPI flash.

So limit the environment for those raw locations to 64KB, and place it
just below 1MB (@960KB).

Those values are currently unused, unless someone forcibly enables the
raw MMC environment. In this case it would break as of now, as the
current offset of 544KB is far too low for the current (arm64) U-Boot
proper.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agosunxi: Kconfig: Fix up SPI configuration
Andre Przywara [Tue, 11 Jan 2022 12:46:02 +0000 (12:46 +0000)]
sunxi: Kconfig: Fix up SPI configuration

Commit 7945caf22c44 ("arm: sunxi: Enable SPI/SPI-FLASH support for A64")
selected CONFIG_SPI by default on all Allwinner A64 boards, even though
only 4 out of the 14 A64 boards have a SPI flash chip. All other SoCs
had to manually select DM_SPI and friends, even though they are a
platform property (the sunxi SPI driver is DM_SPI only).

Clean this up to allow easy selection of SPI flash support in U-Boot
proper, by selecting DM_SPI and DM_SPI_FLASH *if* CONFIG_SPI is
selected, for *all* Allwinner SoCs. This simplifies the defconfig for
two Libretech boards already.

Also remove the forced CONFIG_SPI from the A64 Kconfig, instead let the
four boards which allow SPI booting select this explicitly.

Any board wishing to support SPI flash in U-Boot proper now just defines
CONFIG_SPI and CONFIG_SPI_FLASH_<vendor> in its defconfig, Kconfig takes
care of the rest.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agonet: phy: Add support for ethernet-phy-id with gpio reset
Michal Simek [Wed, 23 Feb 2022 14:45:42 +0000 (15:45 +0100)]
net: phy: Add support for ethernet-phy-id with gpio reset

Ethernet phy like dp83867 is using strapping resistors to setup PHY
address. On Xilinx boards strapping is setup on wires which are connected
to SOC where internal pull ups/downs influnce phy address. That's why there
is a need to setup pins properly (via pinctrl driver for example) and then
perform phy reset. I can be workarounded by reset gpio done for mdio bus
but this is not working properly when multiply phys sitting on the same
bus. That's why it needs to be done via ethernet-phy-id driver where dt
binding has gpio reset per phy.

DT binding is available here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-phy.yaml

The driver is are reading the vendor and device id from valid phy node
using ofnode_read_eth_phy_id() and creating a phy device.
Kconfig PHY_ETHERNET_ID symbol is used because not every platform has gpio
support.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Link: https://lore.kernel.org/r/70ab7d71c812b2c972d48c129e416c921af0d7f5.1645627539.git.michal.simek@xilinx.com
2 years agonet: phy: Remove static return type for phy_device_create()
Michal Simek [Wed, 23 Feb 2022 14:45:41 +0000 (15:45 +0100)]
net: phy: Remove static return type for phy_device_create()

Remove static return type for phy_device_create() to avoid file scope for
this function. Also add required prototype in phy.h.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Link: https://lore.kernel.org/r/1517f4053403fbd53e899d500e7485d068a4f0b6.1645627539.git.michal.simek@xilinx.com
2 years agonet: phy: Add new read ethernet phy id function
Michal Simek [Wed, 23 Feb 2022 14:45:40 +0000 (15:45 +0100)]
net: phy: Add new read ethernet phy id function

Add new function to get ethernet phy id from compatible property
of the mdio phy node.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Link: https://lore.kernel.org/r/16019efb3820a50330935fdaae191cec1f101b5c.1645627539.git.michal.simek@xilinx.com
2 years agoMAINTAINERS: Remove duplicated entry for ehci-zynq.c
Michal Simek [Mon, 7 Mar 2022 07:43:49 +0000 (08:43 +0100)]
MAINTAINERS: Remove duplicated entry for ehci-zynq.c

ehci-zynq.c is assigned to Zynq and ZynqMP that's why remove one.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/d97779178fa56f1c6af40f5604b0bf349002cd36.1646639027.git.michal.simek@xilinx.com
2 years agoarm64: zynqmp: add support for zcu106 rev1.0
Neal Frager [Wed, 2 Mar 2022 14:12:02 +0000 (15:12 +0100)]
arm64: zynqmp: add support for zcu106 rev1.0

This patch adds psu_init for Xilinx ZCU106 rev1.0. Xilinx ZCU106 rev1.0 has
newer x16 DDR4 memories and it is SW compatible with revA.

Signed-off-by: Neal Frager <neal.frager@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/997b3e23457e4d24ce0e197d742382aaec36c2b2.1646230318.git.michal.simek@xilinx.com
2 years agoi2c: i2c-cdns: Prevent early termination of write
Sai Pavan Boddu [Tue, 1 Mar 2022 08:16:52 +0000 (09:16 +0100)]
i2c: i2c-cdns: Prevent early termination of write

During sequential loading of data, hold the bus to prevent controller
from sending stop signal in case no data is available in fifo.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/2407b39d305999cb42438c5423aebc3b514acabb.1646122610.git.michal.simek@xilinx.com
2 years agoi2c: i2c-cdns: Fix write transaction state
Sai Pavan Boddu [Tue, 1 Mar 2022 08:16:51 +0000 (09:16 +0100)]
i2c: i2c-cdns: Fix write transaction state

Start write transfer after loading data to FIFO.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/f0b3e443daa7758e00dfdcc245cf6b2120b0e907.1646122610.git.michal.simek@xilinx.com
2 years agoi2c: i2c-cdns: Start read transaction after write to transfer_size reg
Sai Pavan Boddu [Tue, 1 Mar 2022 08:16:50 +0000 (09:16 +0100)]
i2c: i2c-cdns: Start read transaction after write to transfer_size reg

Avoid a race condition where read transaction is started
keeping expected bytes as 0. Which sometimes would result in sending
STOP signal as no data is expected. Observed on QEMU platform.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/487c8026791bfd60719403a2df2c54bb0ae99232.1646122610.git.michal.simek@xilinx.com
2 years agodma: xilinx: Add Display Port DMA driver
Michal Simek [Wed, 23 Feb 2022 14:52:03 +0000 (15:52 +0100)]
dma: xilinx: Add Display Port DMA driver

Display Port (DP) has own dma driver that's why add this skeleton driver
only for handling power domain setting and send configuration object to
PMUFW to enable it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/fe8bc313bcd430b04e9fa6fb770d5799ef28b350.1645627920.git.michal.simek@xilinx.com
2 years agovideo: Add skeleton driver for ZynqMP Display port driver
Michal Simek [Wed, 23 Feb 2022 14:52:02 +0000 (15:52 +0100)]
video: Add skeleton driver for ZynqMP Display port driver

The reason for this driver is to use call power management driver to enable
it in PMUFW. There is missing functionality now but should be added in
near future.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/598cb9515bbabc803f72e287464e3d107cd106a3.1645627920.git.michal.simek@xilinx.com
2 years agommc: zynq_sdhci: Add support for dynamic configuration
Ashok Reddy Soma [Wed, 23 Feb 2022 14:36:05 +0000 (15:36 +0100)]
mmc: zynq_sdhci: Add support for dynamic configuration

Add support for dynamic configuration which will takes care of
configuring the SD secure space configuration registers using firmware
APIs, performing SD reset assert and deassert.

High level sequence:
  - Check for the PM dynamic configuration support, if no error proceed
    with SD dynamic configurations(next steps) otherwise skip the dynamic
    configuration.
  - Put the SD Controller in reset.
  - Configure SD Fixed configurations.
  - Configure the SD Slot Type.
  - Configure the BASE_CLOCK.
  - Configure the 8-bit support.
  - Bring the SD Controller out of reset.

In the above steps, apart from the Fixed configurations, remaining all
configurations are dynamic and they will be read from devicetree.

And also remove hardcoded secure register writes, as dynamic sd config
support is added.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/030a3ec041ff3efebd574b4d2b477ad85f12cbce.1645626962.git.michal.simek@xilinx.com
2 years agolib: div64: Add support for round up of div64_u64
Ashok Reddy Soma [Wed, 23 Feb 2022 14:36:04 +0000 (15:36 +0100)]
lib: div64: Add support for round up of div64_u64

Most of the frequencies are not rounded up to a proper number.
When we need to devide these frequencies to get a number for example
frequency in Mhz, we see it as one less than the actual intended value.
Ex: If we want to get Mhz from frequency 199999994hz, we will calculate
it using div64_u64(199999994, 1000000) and we will get 199Mhz in place
of 200Mhz.

Add a macro DIV64_U64_ROUND_UP for rounding up div64_u64. This is taken
from linux 'commit 68600f623d69("mm: don't miss the last page because of
round-off error")'.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/f9fdcba76cd692ae436b1d7883b490e3dc207231.1645626962.git.michal.simek@xilinx.com