]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
17 months agoclk: zynqmp: Add gem rx and tsu clocks to return register
Ashok Reddy Soma [Thu, 20 Jul 2023 07:28:59 +0000 (01:28 -0600)]
clk: zynqmp: Add gem rx and tsu clocks to return register

Add gem_tsu and gem0_rx till gem3_rx to return proper register from
zynqmp_clk_get_register. Otherwise firmware won't be able to set clock
for these due to incorrect register address.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230720072859.3724-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoclk: zynqmp: Add set_rate support for gem rx and tsu clks
Ashok Reddy Soma [Wed, 19 Jul 2023 08:49:12 +0000 (02:49 -0600)]
clk: zynqmp: Add set_rate support for gem rx and tsu clks

gem0_rx till gem3_rx  and gem_tsu are missing from set rate function.
Add them, so that they can be set from pmu firmware via clock framework.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230719084912.30209-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agonet: axi_emac: Change return value to -EAGAIN if RX is not ready
Maksim Kiselev [Wed, 19 Jul 2023 06:53:37 +0000 (09:53 +0300)]
net: axi_emac: Change return value to -EAGAIN if RX is not ready

If there is no incoming package than axiemac_recv will return -1 which
in turn leads to printing `eth_rx: recv() returned error -1` error
message in eth_rx function. But missing a package is not an fatal error,
so return -EAGAIN in that case would be more suitable.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
Link: https://lore.kernel.org/r/20230719065337.69280-1-bigunclemax@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoarm64: zynqmp: Remove clock-names from pcap node
Michal Simek [Mon, 10 Jul 2023 12:37:43 +0000 (14:37 +0200)]
arm64: zynqmp: Remove clock-names from pcap node

Clock is not used in driver and also not described in binding.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0a0fa0ba197fa4051a2c8a24e1451cefadce7517.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Rename ams_ps/pl node names
Michal Simek [Mon, 10 Jul 2023 12:37:42 +0000 (14:37 +0200)]
arm64: zynqmp: Rename ams_ps/pl node names

Fix child node names to be aligned with dt-binding available in the Linux
kernel which requires names as ams-ps@ and ams-pl@.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/8f1451d614f654cb0d0da1e799e876c078fbf2c9.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Remove interrupt/reg-names for AMS
Michal Simek [Mon, 10 Jul 2023 12:37:41 +0000 (14:37 +0200)]
arm64: zynqmp: Remove interrupt/reg-names for AMS

These two properties are not described in DT binding and also not used by
driver that's why remove them.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b123c7e537dcf70802e828bbcd484a761a264186.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: remove snps, enable_guctl1_resume_quirk quirk for usb
Piyush Mehta [Mon, 10 Jul 2023 12:37:40 +0000 (14:37 +0200)]
arm64: zynqmp: remove snps, enable_guctl1_resume_quirk quirk for usb

To sync with the upstream code, removed 'snps,enable_guctl1_resume_quirk'
quirk for usb. This quirk is no more available in linux after the xilinx
release 2022.2.

This functionality is taken care of by the 'snps,resume-hs-terminations'
quirk.

Signed-off-by: Piyush Mehta <piyush.mehta@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4b7a132116bf0248cdb558e04de3b06b412c4a0f.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: add pmu interrupt-affinity
Radhey Shyam Pandey [Mon, 10 Jul 2023 12:37:39 +0000 (14:37 +0200)]
arm64: zynqmp: add pmu interrupt-affinity

Explicitly specify interrupt affinity to avoid HW perfevents
need to guess. This avoids the following error upon linux boot:
armv8-pmu pmu: hw perfevents: no interrupt-affinity property,
guessing.

Reported-by: John Toomey <john.toomey@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c2f55a10cf54c6004f5dfe2ea18bcb4cf04f5723.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Sync node name address with reg (mailbox)
Michal Simek [Mon, 10 Jul 2023 12:37:38 +0000 (14:37 +0200)]
arm64: zynqmp: Sync node name address with reg (mailbox)

Address in node name should match with the first reg property in DT.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/47bea10bbc3c88727c1fe839ff20e15a0c79c339.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Add L2 cache nodes
Radhey Shyam Pandey [Mon, 10 Jul 2023 12:37:37 +0000 (14:37 +0200)]
arm64: zynqmp: Add L2 cache nodes

Linux kernel throws "cacheinfo: Unable to detect cache hierarchy for
CPU 0" warning when booting on zu+ Soc. To fix it add the L2 cache
node and let each CPU point to it.

Reported-by: John Toomey <john.toomey@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c8dfabab12c97922aaad7fa91be0cbc7e4021528.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Fix usb reset over bootmode pins on zcu100
Michal Simek [Mon, 10 Jul 2023 12:37:36 +0000 (14:37 +0200)]
arm64: zynqmp: Fix usb reset over bootmode pins on zcu100

The commit a4180c369607 ("arm64: zynqmp: Add mode-pin GPIO controller DT
node") added usb phy reset over bootmode pins by default on usb0 only.
zcu100 is using usb0 as peripheral and usb1 as host. Unfortunately reset
line is shared for both usb ulpi phys but usb_rst_b is connected to usb5744
hub which is used only in host mode. Especially this chip requires reset to
operate properly that's why better assign gpio reset to usb1 instead of
usb0.
Without this change usb start crashed when runs.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1ca80ec5bf7a595c03822f3e4e3683298205067a.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Cover K24 revB/1 SOM
Michal Simek [Mon, 10 Jul 2023 12:37:35 +0000 (14:37 +0200)]
arm64: zynqmp: Cover K24 revB/1 SOM

Extend compatible versions for K24 SOM.
Changes are not affecting SW behavior that's why all versions are
compatible to each other.
Describing all revisions is done by purpose because user space SW is
reading compatible string for logic around DT overlays and bitstreams.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/92eba01ac316e58bd2d3508b0e63bbfafbedbb73.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Record compatible string for kv260 rev2
Michal Simek [Mon, 10 Jul 2023 12:37:34 +0000 (14:37 +0200)]
arm64: zynqmp: Record compatible string for kv260 rev2

PCB rev2 compare to rev1 has some changes in PL side (IAS sensor AR1335
autofocus feature). PS side is completely unchanged.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/42f78dee8429eeac016d73de5c73af46fdaf4a98.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Assign TSU clock frequency for KV and KD boards
Harini Katakam [Mon, 10 Jul 2023 12:37:33 +0000 (14:37 +0200)]
arm64: zynqmp: Assign TSU clock frequency for KV and KD boards

Set TSU clock frequency as 250MHz (minimum when running at 1G) on
KV and KD carrier cards to allow PTP functionality.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4b758d503ef545e4d25d3930b0eb0793f1c415d2.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Increase reset assert time for TI SGMII PHY
Harini Katakam [Mon, 10 Jul 2023 12:37:32 +0000 (14:37 +0200)]
arm64: zynqmp: Increase reset assert time for TI SGMII PHY

Increase reset assert time for TI SGMII PHY on KR260 CC starting
6.1 kernel. This PHY does not come out of reset with the existing
100us pulse width as per testing on multiple carrier cards. The reset
is driven via a PCA9570 I2C expander. The expander driver was updated
to an upstream version in 6.1 where gpio_chip _set was optimized.
Delays in earlier kernels may have masked this issue. This is a safe
workaround value for assert pulse width before the discussions are
resolved with TI.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/8fb9f17d43a43ef504c9f29006cd686cce8ac98b.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Fix gpio comment about No of gpios
Michal Simek [Mon, 10 Jul 2023 12:37:31 +0000 (14:37 +0200)]
arm64: zynqmp: Fix gpio comment about No of gpios

There are total 174 gpios but from 0 - 173 that's why fix comment to
reflect it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c7e94b334e7dd6297e0d3a36a6a3d04bd7e9e967.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Assign TSU clock frequency for KR260
Harini Katakam [Mon, 10 Jul 2023 12:37:30 +0000 (14:37 +0200)]
arm64: zynqmp: Assign TSU clock frequency for KR260

Set TSU clock frequency as 250MHz (minimum when running at 1G) on
KR260 CC to allow PTP functionality.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d065b5c2c6450910bf57d104d65946111493caaa.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Update MALI 400 interrupt and clock names
Parth Gajjar [Mon, 10 Jul 2023 12:37:29 +0000 (14:37 +0200)]
arm64: zynqmp: Update MALI 400 interrupt and clock names

Motivation for the commit is to utilize the upstream community
device tree so that the either modified ARM Mali 400 driver
or upstream lima driver can be used.

Signed-off-by: Parth Gajjar <parth.gajjar@amd.com>
Signed-off-by: Vishal Sagar <vishal.sagar@amd.com>
Link: https://lore.kernel.org/r/1678181001-2327-2-git-send-email-parth.gajjar@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/89d046a9da5638e8b4918f80f3245d73ea46f99f.1688992653.git.michal.simek@amd.com
17 months agoxilinx: dts: Fix open drain warning on Zynq, ZynqMP and Versal
Manikanta Guntupalli [Mon, 10 Jul 2023 12:37:28 +0000 (14:37 +0200)]
xilinx: dts: Fix open drain warning on Zynq, ZynqMP and Versal

Fix for below open drain warning on Zynq, ZynqMP and Versal reported by
Linux.
"enforced open drain please flag it properly in DT/ACPI DSDT/board
file."

Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/056b6f60f89fa2addb762669b80640cd5b31b001.1688992653.git.michal.simek@amd.com
17 months agoarm: xilinx: Setting default i2c clock frequency to 400kHz
Varalaxmi Bingi [Mon, 10 Jul 2023 12:37:27 +0000 (14:37 +0200)]
arm: xilinx: Setting default i2c clock frequency to 400kHz

Setting default i2c clock frequency for Zynq and ZynqMP to maximum rate of
400kHz. Current default value is 100kHz.

Signed-off-by: Varalaxmi Bingi <varalaxmi.bingi@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/fb46fe911a68b79c8e4d150ca90c4e94eb5fb9e1.1688992653.git.michal.simek@amd.com
17 months agomtd: Add missing MTD dependency for cfi_mtd
Michal Simek [Tue, 4 Jul 2023 12:04:04 +0000 (14:04 +0200)]
mtd: Add missing MTD dependency for cfi_mtd

cfi_mtd requires add_mtd_device() which is available only when MTD is
enabled that's why record this dependency.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/76ae01ce2b2c988758b69e0f0cdcc21bf301c01e.1688472227.git.michal.simek@amd.com
17 months agommc: zynq_sdhci: Dll reset only for ZynqMP platform
Ashok Reddy Soma [Mon, 10 Jul 2023 12:11:59 +0000 (14:11 +0200)]
mmc: zynq_sdhci: Dll reset only for ZynqMP platform

Dll reset is needed only for ZynqMP platforms, add condition in tuning
to call arasan_zynqmp_dll_reset() just for ZynqMP platforms.

On other platforms like Versal NET, If this condition is not added, we
see PLM error messages when dll reset smc is called.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d673ff3bdc5c236a7f0403c920e719684abd6059.1688991117.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Switch to amd.com emails
Michal Simek [Mon, 10 Jul 2023 12:35:49 +0000 (14:35 +0200)]
arm64: zynqmp: Switch to amd.com emails

Update my and DPs email address to match current setup.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/aba5b19b9c5a95608829e86ad5cc4671c940f1bb.1688992543.git.michal.simek@amd.com
17 months agoxilinx: zynq: Enable fdt apply utility for zynq
Raju Kumar Pothuraju [Mon, 10 Jul 2023 11:56:21 +0000 (13:56 +0200)]
xilinx: zynq: Enable fdt apply utility for zynq

Enables the FDT library (libfdt) overlay support for zynq platforms
to be able to use fdt apply command.

Signed-off-by: Raju Kumar Pothuraju <rajukumar.pothuraju@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ab26dd186fb752b3d607e6160ae5baf6661d5de7.1688990179.git.michal.simek@amd.com
17 months agoxilinx: Consolidate zynqmp_mmio_read/write in zynqmp_firmware.h
Michal Simek [Fri, 23 Jun 2023 12:51:57 +0000 (14:51 +0200)]
xilinx: Consolidate zynqmp_mmio_read/write in zynqmp_firmware.h

zynqmp_mmio_read/write() are firmware provided hooks that's why use only
zynqmp_firmware.h for function declaration.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e7489556f9e447c737a578c169d7e1e43586a273.1687524706.git.michal.simek@amd.com
17 months agoxilinx: versal-net: Add mini eMMC 5.1 configuration
Ashok Reddy Soma [Wed, 14 Jun 2023 12:13:51 +0000 (06:13 -0600)]
xilinx: versal-net: Add mini eMMC 5.1 configuration

Add support for Versal NET mini eMMC 5.1 configuration. Add device tree
and defconfig.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614121351.21521-4-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoxilinx: versal-net: Add mini ospi configuration
Ashok Reddy Soma [Wed, 14 Jun 2023 12:13:50 +0000 (06:13 -0600)]
xilinx: versal-net: Add mini ospi configuration

Add support for Versal NET mini Octal SPI flash configuration. This runs
from onchip memory, so it has to be compact. Hence only Octal SPI
related settings are enabled.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614121351.21521-3-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoxilinx: versal-net: Add mini qspi configuration
Ashok Reddy Soma [Wed, 14 Jun 2023 12:13:49 +0000 (06:13 -0600)]
xilinx: versal-net: Add mini qspi configuration

Add support for Versal NET mini Quad SPI flash configuration. This runs
from onchip memory, so it has to be compact. Hence only Quad SPI
related settings are enabled.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614121351.21521-2-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agocadence_qspi: Enable flash reset for Versal NET platform
Ashok Reddy Soma [Wed, 14 Jun 2023 12:04:52 +0000 (06:04 -0600)]
cadence_qspi: Enable flash reset for Versal NET platform

Enable flash reset functionality for Versal NET platform.
In cadence_qspi.c there is weak function defined for reset, hence remove
the check for config, so that it will work for Versal and Versal NET
platforms.

Add register defines in Versal NET hardware.h for mini U-Boot flash
reset.

Add read_delay initialization for Versal NET also.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614120452.21019-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agonet: zynq_gem: Don't hardcode the MDC clock divisor
Venkatesh Yadav Abbarapu [Mon, 19 Jun 2023 03:49:22 +0000 (09:19 +0530)]
net: zynq_gem: Don't hardcode the MDC clock divisor

As per spec MDC must not exceed 2.5MHz, read the pclk clock
from the device tree and update the MDC clock divisor.
GEM devices support larger clock divisors and have a different
range of divisors.  Program the MDIO clock divisors based on
the clock rate of the pclk clock.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230619034922.24019-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoarm64: versal-net: spi: Update boot sequence dynamically
Ashok Reddy Soma [Wed, 14 Jun 2023 09:30:58 +0000 (03:30 -0600)]
arm64: versal-net: spi: Update boot sequence dynamically

Currently xspi0 is used for all spi boot modes, it means it will use "sf
probe 0 0 0" for all spi's irrespective of which node it is wired.

Get boot sequence from dev_seq() and update boot command for xspi
dynamically.

As a result bootcmd for spi is updated as below when two instances of spi
are present in DT node.
bootcmd_xspi0=devnum_xspi=0; run xspi_boot
bootcmd_xspi1=devnum_xspi=1; run xspi_boot

xspi_boot=sf probe $devnum_xspi:0 0 0 && sf read $scriptaddr
$script_offset_f $script_size_f && echo XSPI: Trying to boot script at
${scriptaddr} && source ${scriptaddr}; echo XSPI: SCRIPT FAILED:
continuing...;

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614093058.30438-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoxilinx: zynq: Add the missing function prototypes
Algapally Santosh Sagar [Wed, 14 Jun 2023 09:03:59 +0000 (03:03 -0600)]
xilinx: zynq: Add the missing function prototypes

Add the missing prototypes for the functions pointed by the below
sparse warnings
warning: no previous prototype for 'set_dfu_alt_info'
[-Wmissing-prototypes]
warning: no previous prototype for 'board_debug_uart_init'
[-Wmissing-prototypes]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614090359.10809-7-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoarm: zynq: Pass the missing argument type in function definition
Algapally Santosh Sagar [Wed, 14 Jun 2023 09:03:58 +0000 (03:03 -0600)]
arm: zynq: Pass the missing argument type in function definition

Pass missing argument type in the function definition to fix the
sparse warning, warning: old-style function definition
[-Wold-style-definition]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614090359.10809-6-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agomtd: nand: zynq_nand: Change datatype of status and ecc_status to int
Algapally Santosh Sagar [Wed, 14 Jun 2023 09:03:57 +0000 (03:03 -0600)]
mtd: nand: zynq_nand: Change datatype of status and ecc_status to int

status and ecc_status are of unsigned type where they are compared for
negative value. This is pointed by below sparse warning. Change datatype
to int to fix this.
warning: comparison of unsigned expression in '< 0' is always false
[-Wtype-limits]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614090359.10809-5-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agospi: zynq_qspi: Add missing prototype for zynq_qspi_mem_exec_op
Algapally Santosh Sagar [Wed, 14 Jun 2023 09:03:56 +0000 (03:03 -0600)]
spi: zynq_qspi: Add missing prototype for zynq_qspi_mem_exec_op

Add missing prototype to fix the sparse warning, warning: no
previous prototype for 'zynq_qspi_mem_exec_op' [-Wmissing-prototypes].

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614090359.10809-4-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoxilinx: zynq: Add missing prototype for zynqmp_mmio_write
Algapally Santosh Sagar [Wed, 14 Jun 2023 09:03:55 +0000 (03:03 -0600)]
xilinx: zynq: Add missing prototype for zynqmp_mmio_write

Add missing prototype to fix the sparse warning, warning: no
previous prototype for 'zynqmp_mmio_write' [-Wmissing-prototypes].

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614090359.10809-3-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agospi: xilinx_spi: Add missing prototype for xilinx_qspi_mem_exec_op
Algapally Santosh Sagar [Wed, 14 Jun 2023 09:03:54 +0000 (03:03 -0600)]
spi: xilinx_spi: Add missing prototype for xilinx_qspi_mem_exec_op

Add missing prototype to fix the below sparse warning
warning: no previous prototype for 'xilinx_qspi_mem_exec_op'
[-Wmissing-prototypes]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230614090359.10809-2-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoarm64: zynqmp: Fix the memory node for k26/k24 kria som boards
Sharath Kumar Dasari [Mon, 5 Jun 2023 11:59:51 +0000 (13:59 +0200)]
arm64: zynqmp: Fix the memory node for k26/k24 kria som boards

PMUFW requires top 1MB of the lower DDR memory reserved for its operation,
this is missing in k26/k24 sm static dts files because of which U-Boot
throws warning messages "efi_free_pool: illegal free" as EFI puts
some code to that space which shouldn't happen.

Signed-off-by: Sharath Kumar Dasari <sharath.kumar.dasari@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/57452d16df2d48593de206bebf877d2c2cfe7bf1.1685966389.git.michal.simek@amd.com
17 months agowatchdog: versal: Use new compatible xlnx,versal-wwdt
Michal Simek [Tue, 13 Jun 2023 11:22:26 +0000 (13:22 +0200)]
watchdog: versal: Use new compatible xlnx,versal-wwdt

DT binding has been approved that's why use new compatible string.
The old one is mark as deprecated and should be removed after some
releases.

Link: https://lore.kernel.org/r/20230420104231.2243079-3-srinivas.neeli@amd.com/
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/6e78d0d2e21f2f9e7f8f448bb8e0d27ced4de7d3.1686655339.git.michal.simek@amd.com
17 months agoMerge branch '2023-07-20-assorted-CI-updates'
Tom Rini [Fri, 21 Jul 2023 01:28:59 +0000 (21:28 -0400)]
Merge branch '2023-07-20-assorted-CI-updates'

- Move to gcc-13.1 and QEMU 8.0.3 in CI.  This also lets us move to a
  kernel.org toolchain for arc as well.

17 months agoCI: Add automatic retry for test.py jobs
Tom Rini [Wed, 12 Jul 2023 02:33:03 +0000 (22:33 -0400)]
CI: Add automatic retry for test.py jobs

It is not uncommon for some of the QEMU-based jobs to fail not because
of a code issue but rather because of a timing issue or similar problem
that is out of our control. Make use of the keywords that Azure and
GitLab provide so that we will automatically re-run these when they fail
2 times. If they fail that often it is likely we have found a real issue
to investigate.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoAzure: Add excludes to the imx8_imx9 job
Tom Rini [Wed, 12 Jul 2023 20:22:22 +0000 (16:22 -0400)]
Azure: Add excludes to the imx8_imx9 job

The job to build all imx8 and imx9 platforms is currently close to, or
sometimes exceeding the allowed build time. Exclude some platforms that
are already being built under their vendor-specific job as well to
reduce the time.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoAzure: Rework our Rockchip jobs slightly
Tom Rini [Wed, 19 Jul 2023 19:09:12 +0000 (15:09 -0400)]
Azure: Rework our Rockchip jobs slightly

Currently the 64bit "rk" job is close to and sometimes goes over the job
time limit.  Let us rework this in to one job for "rk" and "rv" (which
are the SoC prefixes) jobs which include or exclude "rockchip" the board
vendor.  This gives us two jobs of similar numbers of platforms to build
now instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoCI: Update to the latest "Jammy" tag
Tom Rini [Fri, 14 Jul 2023 00:37:36 +0000 (20:37 -0400)]
CI: Update to the latest "Jammy" tag

Move to the latest "Jammy" tag from Ubuntu.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoCI: Update to gcc-13.1.0
Tom Rini [Fri, 14 Jul 2023 00:37:35 +0000 (20:37 -0400)]
CI: Update to gcc-13.1.0

As this is the current version of the public cross toolchains we use,
upgrade to this now.

Suggested-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agobuildman: Switch ARC toolchain to the upstream version
Alexey Brodkin [Fri, 7 Jul 2023 21:04:53 +0000 (22:04 +0100)]
buildman: Switch ARC toolchain to the upstream version

Back in the day we relied a lot on Synopsys own build of the GNU tools
for ARC processors, but since then we worked hard on getting all our changes
upstream and for a couple of years now we have ARCompact (AKA ARCv1)
and ARCv2 processors supported very well in upstream GCC, Binutils, GDB etc.

And so there's no need to use Synopsys forks any longer, thus we remove
all the references to that form and use upstream components as majority
of other architectures in U-Boot.

Thanks to Tom for pointing to that left-over!

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoCI: Update to QEMU 8.0.3
Tom Rini [Thu, 13 Jul 2023 14:16:28 +0000 (10:16 -0400)]
CI: Update to QEMU 8.0.3

Move up to the latest tagged release of QEMU

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agotools/docker: Dockerfile: Don't specify dtc submodule
Tom Rini [Fri, 7 Jul 2023 22:04:30 +0000 (18:04 -0400)]
tools/docker: Dockerfile: Don't specify dtc submodule

When building qemu, all required submodules (of which we need more than
just dtc) are handled automatically. Currently trying to init the
submodule the way we do results in a git failure.

Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agospl: Correct spl_board_boot_device function prototype
Tom Rini [Fri, 14 Jul 2023 00:37:34 +0000 (20:37 -0400)]
spl: Correct spl_board_boot_device function prototype

With gcc-13.1 we get a warning about enum vs int here, so correct the
declaration to match the implementation.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoarm: mx5: Correct mxc_set_clock function prototype
Tom Rini [Fri, 14 Jul 2023 00:37:33 +0000 (20:37 -0400)]
arm: mx5: Correct mxc_set_clock function prototype

With gcc-13.1 we get a warning about enum vs int here, so correct the
declaration to match the implementation.

Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agomips: octeon: Correct types in cvmx-pko3-queue
Tom Rini [Fri, 14 Jul 2023 00:37:32 +0000 (20:37 -0400)]
mips: octeon: Correct types in cvmx-pko3-queue

When building with gcc-13.1 we see that the prototype for
cvmx_pko3_sq_config_children does not match the declaration. Make these
match and correct a typo in the function's version of the docs that the
prototype did not have, as part of keeping those in-sync.

Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agoMerge tag 'efi-2023-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 20 Jul 2023 14:19:04 +0000 (10:19 -0400)]
Merge tag 'efi-2023-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-10-rc1-2

UEFI:

* test: avoid function name 'setup' in capsule tests to not treat it as
  a fixture
* ensure that device paths for USB block devices are unique
* enable having multiple EFI_LOADER block devices
* use InstallMultipleProtocolInterfaces() in TCG protocol implementation to
  increase UEFI compliance

17 months agoefi_loader: support all uclasses in device path
Heinrich Schuchardt [Wed, 19 Jul 2023 04:43:08 +0000 (06:43 +0200)]
efi_loader: support all uclasses in device path

On devices with multiple USB mass storage devices errors like

    Path /../USB(0x0,0x0)/USB(0x1,0x0)/Ctrl(0x0)
    already installed.

are seen. This is due to creating non-unique device paths. To uniquely
identify devices we must provide path nodes for all devices on the path
from the root device.

Add support for generating device path nodes for all uclasses.

Reported-by: Suniel Mahesh <sunil@amarulasolutions.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
17 months agoefi_loader: fix dp_fill() for BLKMAP, HOST, VIRTIO
Heinrich Schuchardt [Wed, 19 Jul 2023 14:49:46 +0000 (16:49 +0200)]
efi_loader: fix dp_fill() for BLKMAP, HOST, VIRTIO

Do not assume that the preceding device path contains a single VenHW node.
Instead use the return value of dp_fill() which provides the address of the
next node.

Fixes: 23ad52fff4da ("efi_loader: device_path: support Sandbox's "host" devices")
Fixes: 19ecced71cfb ("efi_loader: device path for virtio block devices")
Fixes: 272ec6b45304 ("efi_loader: device_path: support blkmap devices")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
17 months agotest: avoid function name 'setup'
Heinrich Schuchardt [Sat, 15 Jul 2023 08:48:39 +0000 (10:48 +0200)]
test: avoid function name 'setup'

pytest 7.3.2 treats the function name 'setup' as a fixture [1].

This leads to errors like:

    TypeError: setup() missing 2 required positional arguments:
    'disk_img' and 'osindications'

Rename setup() to capsule_setup().

[1] How to run tests written for nose
    https://docs.pytest.org/en/7.3.x/how-to/nose.html

Fixes: 482ef90aeb4c ("test: efi_capsule: refactor efi_capsule test")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoefi_driver: fix duplicate efiblk#0 issue
Masahisa Kojima [Mon, 3 Jul 2023 06:08:45 +0000 (15:08 +0900)]
efi_driver: fix duplicate efiblk#0 issue

The devnum value of the blk_desc structure starts from 0,
current efi_bl_create_block_device() function creates
two "efiblk#0" devices for the cases that blk_find_max_devnum()
returns -ENODEV and blk_find_max_devnum() returns 0(one device
found in this case).

This commit uses blk_next_free_devnum() instead of blk_find_max_devnum().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
17 months agoefi_loader: make efi_remove_protocol() static
Ilias Apalodimas [Mon, 19 Jun 2023 11:14:03 +0000 (14:14 +0300)]
efi_loader: make efi_remove_protocol() static

A previous patch is removing the last consumer of efi_remove_protocol().
Switch that to static and treat it as an internal API in order to force
users install and remove protocols with the appropriate EFI functions.

It's worth noting that we still have files using efi_add_protocol().  We
should convert all these to efi_install_multiple_protocol_interfaces()
and treat efi_add_protocol() in a similar manner

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agoefi_loader: use efi_install_multiple_protocol_interfaces()
Ilias Apalodimas [Mon, 19 Jun 2023 11:14:02 +0000 (14:14 +0300)]
efi_loader: use efi_install_multiple_protocol_interfaces()

The TCG2 protocol currently adds and removes protocols with
efi_(add/remove)_protocol().

Removing protocols with efi_remove_protocol() might prove
problematic since it doesn't call DisconnectController() when
uninstalling the protocol and does not comply with the UEFI specification.

It's also beneficial for readability to have protocol installations and
removals in pairs -- IOW when efi_install_multiple_protocol_interfaces()
is called,  efi_uninstall_multiple_protocol_interfaces() should be used to
remove it.  So let's swap the efi_add_protocol() as well.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agoefi_loader: simplify efi_uninstall_protocol()
Heinrich Schuchardt [Sun, 18 Jun 2023 07:00:45 +0000 (09:00 +0200)]
efi_loader: simplify efi_uninstall_protocol()

The call to efi_search_obj() is redundant as the function is called in
efi_search_protocol() too.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agoMerge tag 'fsl-qoriq-2023-7-13' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 19 Jul 2023 11:59:34 +0000 (07:59 -0400)]
Merge tag 'fsl-qoriq-2023-7-13' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

Enable DM_SERIAL for T2080RDB, T4240RDB, T1042D4RDB, T1024RDB

17 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Wed, 19 Jul 2023 00:42:16 +0000 (20:42 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-mmc

17 months agoMerge branch '2023-07-17-assorted-updates'
Tom Rini [Tue, 18 Jul 2023 13:55:32 +0000 (09:55 -0400)]
Merge branch '2023-07-17-assorted-updates'

- Merge in some Kconfig dependencies fixes, typo fixes, erofs update,
  shell portability fix, an env save fix, better mbr+gpt support, and
  some android A/B enhancements.

17 months agommc: Set clock when reverting to safe bus mode
Valentine Barshak [Sat, 10 Jun 2023 11:22:33 +0000 (13:22 +0200)]
mmc: Set clock when reverting to safe bus mode

Set MMC clock when reverting to safe bus mode and speed
in case current MMC mode fails. Otherwise, trying out
the other modes may fail as well.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
[hp: fallback to legacy_speed]
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
17 months agommc: renesas-sdhi: Send stop when MMC tuning command fails
Hai Pham [Mon, 19 Jun 2023 22:38:25 +0000 (00:38 +0200)]
mmc: renesas-sdhi: Send stop when MMC tuning command fails

When tuning command (CMD21) fails with command error, call
mmc_send_stop_transmission() to send stop command (CMD12).

Reviewed-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Add dev_dbg() message in case tuning abort fails
        Move tuning opcode check from mmc_abort_tuning()]
Reviewed-by: Peng Fan <peng.fan@nxp.com>
17 months agommc: Introduce mmc_send_stop_transmission()
Hai Pham [Mon, 19 Jun 2023 22:38:24 +0000 (00:38 +0200)]
mmc: Introduce mmc_send_stop_transmission()

If a tuning command times out, the card could still be processing it,
which will cause problems for recovery. The eMMC specification section
6.6 Data transfer mode (cont’d) claims that CMD12 can be used to stop
CMD21:
"
The relationship between the various data transfer modes is summarized (see Figure 27):
- All data read commands can be aborted any time by the stop command (CMD12).
  The data transfer will terminate and the Device will return to the Transfer State.
  The read commands are: ... send tuning block (CMD21) ....
"
Add a function that does that.

Based on Linux commit [1] and [2].

[1] e711f0309109 ("mmc: mmc: Introduce mmc_abort_tuning()")
[2] 21adc2e45f4e ("mmc: Improve function name when aborting a tuning
cmd")

Reviewed-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update commit message, quote relevant part of the specification.
        Rename to mmc_send_stop_transmission().
Remove tuning opcode check, this is controller driver specific.
Deduplicate part of mmc_read_blocks() using this function.]
Reviewed-by: Peng Fan <peng.fan@nxp.com>
17 months agommc: Fix MMC_CMD_STOP_TRANSMISSION response type and add comment
Marek Vasut [Mon, 19 Jun 2023 22:38:23 +0000 (00:38 +0200)]
mmc: Fix MMC_CMD_STOP_TRANSMISSION response type and add comment

For MMC/eMMC, the MMC_CMD_STOP_TRANSMISSION response is R1 for read
transfers and R1b for write transfers per JEDEC Standard No. 84-B51
Page 126 . The response is R1b unconditionally per Physical Layer
Simplified Specification Version 9.00.

Correct the response type and add a comment about it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
17 months agoenv: Fix default environment saving issue
Ashok Reddy Soma [Tue, 4 Jul 2023 06:16:07 +0000 (00:16 -0600)]
env: Fix default environment saving issue

When CONFIG_SYS_REDUNDAND_ENVIRONMENT is enabled, by default env is
getting saved to redundant environment irrespective of primary env is
present or not.

It means even if primary and redundant environment are not present, by
default, env is getting stored to redundant environment. Even if primary
env is present, it is choosing to store in redudndant env.

Ideally it should look for primary env and choose to store in primary env
if it is present. If both primary and redundant env are not present then
it should save in to primary env area.

Fix the issue by making env_valid = ENV_INVALID when both the
environments are not present.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoandroid_ab: Try backup booloader_message
Joshua Watt [Mon, 3 Jul 2023 15:07:13 +0000 (10:07 -0500)]
android_ab: Try backup booloader_message

Some devices keep 2 copies of the bootloader_message in the misc
partition and write each in sequence when updating. This ensures that
there is always one valid copy of the bootloader_message. Teach u-boot
to optionally try a backup bootloader_message from a specified offset if
the primary one fails its CRC check.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
17 months agocmd: mbr: Force DOS driver to be used for verify
Joshua Watt [Mon, 3 Jul 2023 13:39:56 +0000 (08:39 -0500)]
cmd: mbr: Force DOS driver to be used for verify

Forces the DOS partition type driver to be used when verifying the MBR.
This is particularly useful when using a hybrid MBR & GPT layout as
otherwise MBR verification would mostly likely fail since the GPT
partitions will be returned, even if the MBR is actually valid.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodm: test: Add test for part_get_info_by_type
Joshua Watt [Mon, 3 Jul 2023 13:39:55 +0000 (08:39 -0500)]
dm: test: Add test for part_get_info_by_type

Adds a test suite to ensure that part_get_info_by_type works correctly
by creating a hybrid GPT/MBR partition table and reading both.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
[trini: Add this on the other sandbox configs]
Signedd-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodisk: part: Add API to get partitions with specific driver
Joshua Watt [Mon, 3 Jul 2023 13:39:54 +0000 (08:39 -0500)]
disk: part: Add API to get partitions with specific driver

Adds part_driver_get_type() API which can be used to force a specific
driver to be used when getting partition information instead of relying
on auto detection.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodm: test: Improve partition test error output
Joshua Watt [Mon, 3 Jul 2023 13:39:53 +0000 (08:39 -0500)]
dm: test: Improve partition test error output

Improve the logging when the partition test fails so that it is clear
what went wrong, shown with actual values.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodm: test: Fix partition test to use mmc2
Joshua Watt [Mon, 3 Jul 2023 13:39:52 +0000 (08:39 -0500)]
dm: test: Fix partition test to use mmc2

d94d9844bc ("dm: part: Update test to use mmc2") attempted to make the
test use mmc2, but the change was incomplete in that it didn't also
change the strings that reference a specific partition. Fix these so
that the test passes again

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
17 months agotests: Fix exception when cleaning up skipped test
Joshua Watt [Mon, 3 Jul 2023 13:35:09 +0000 (08:35 -0500)]
tests: Fix exception when cleaning up skipped test

If test_cat and test_xxd cannot create the required file, the test will
be skipped, but this would result in an exception being raised in the
finally block because the file didn't exist to be cleaned up. This
caused the test to be marked as failed instead of skipped.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoandroid_ab: Add option to skip decrementing tries
Joshua Watt [Fri, 23 Jun 2023 22:05:48 +0000 (17:05 -0500)]
android_ab: Add option to skip decrementing tries

It is is sometimes desired to be able to skip decrementing the number of
tries remaining in an Android A/B boot, and instead just check which
slot will be tried later. This can commonly be be the case for platforms
that want to A/B u-boot itself, but are required to boot from a FAT MBR
partition. In these cases, u-boot must do an early check that the MBR
points to the correct A/B boot partition, and if not rewrite the MBR to
point to the correct one and reboot. Decrementing the try count in this
case is not desired because it means that each u-boot might constantly
ping-pong overwriting the MBR and rebooting until all the retries are
used up.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
17 months agodisk: Use BOOT_DEFAULTS instead of DISTRO_DEFAULTS
Jonas Karlman [Tue, 11 Jul 2023 22:37:30 +0000 (22:37 +0000)]
disk: Use BOOT_DEFAULTS instead of DISTRO_DEFAULTS

Set default y based on common BOOT_DEFAULTS instead of DISTRO_DEFAULTS.

No change is intended, affected options is already implied for DISTRO
and BOOTSTD due to BOOT_DEFAULTS imply DOS_PARTITION (USB_STORAGE),
EFI_PARTITION and ISO_PARTITION.

Fixes: a0c739c184ca ("boot: Create a common BOOT_DEFAULTS for distro and bootstd")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodfu: Add proper dependency for CONFIG_DFU_MMC
Ashok Reddy Soma [Fri, 7 Jul 2023 08:51:36 +0000 (02:51 -0600)]
dfu: Add proper dependency for CONFIG_DFU_MMC

When CONFIG_CMD_MMC and CONFIG_MMC are disabled, still some compilation
errors are seen as below due to unresolved symbols.

drivers/dfu/dfu_mmc.o: in function `mmc_block_op':
drivers/dfu/dfu_mmc.c:32: undefined reference to `find_mmc_device'
drivers/dfu/dfu_mmc.c:54: undefined reference to `mmc_get_blk_desc'
drivers/dfu/dfu_mmc.c:67: undefined reference to `mmc_get_blk_desc'
drivers/dfu/dfu_mmc.c:70: undefined reference to `mmc_get_blk_desc'
drivers/dfu/dfu_mmc.o: in function `dfu_fill_entity_mmc':
drivers/dfu/dfu_mmc.c:369: undefined reference to `find_mmc_device'
drivers/dfu/dfu_mmc.c:376: undefined reference to `mmc_init'
drivers/dfu/dfu_mmc.c:403: undefined reference to `mmc_get_blk_desc'
gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld.bfd: line 4:
31661 Segmentation fault      (core dumped) $CC --sysroot=$LIBC
--no-warn-rwx-segment "$@"
Makefile:1760: recipe for target 'u-boot' failed
make: *** [u-boot] Error 139
make: *** Deleting file 'u-boot'

Add dependency of CONFIG_MMC for CONFIG_DFU_MMC config to fix the errors.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
17 months agofs/erofs: Introduce new features including ztailpacking, fragments and dedupe
Yifan Zhao [Fri, 7 Jul 2023 15:52:12 +0000 (23:52 +0800)]
fs/erofs: Introduce new features including ztailpacking, fragments and dedupe

This patch updates erofs driver code to catch up with the latest code of
erofs_utils (commit e4939f9eaa177e05d697ace85d8dc283e25dc2ed).

LZMA will be supported in the separate patch later.

Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
Reviewed-by: Huang Jianan <jnhuang95@gmail.com>
17 months agoMakefile: Add missing quotes around sort --field-separator
Marek Vasut [Tue, 11 Jul 2023 12:15:53 +0000 (14:15 +0200)]
Makefile: Add missing quotes around sort --field-separator

Busybox sort does not handle --field-separator== , replace this
with --field-separator='=' for maximum compatibility.

Fixes: cc5a490cf465 ("Makefile: Sort u-boot-initial-env output")
Reported-by: Milan P. Stanić <mps@arvanta.net>
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agobootstd: Correct 'bpot' typo
Julien Delbergue [Thu, 13 Jul 2023 09:53:09 +0000 (11:53 +0200)]
bootstd: Correct 'bpot' typo

Fix it to 'boot' in the header, as it is in the source file.

Signed-off-by: Julien Delbergue <j.delbergue.foss@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Mon, 17 Jul 2023 14:38:28 +0000 (10:38 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- bootstd: Add a bootmeth for ChromiumOS on x86
- x86: Use qemu-x86_64 to boot EFI installers

17 months agox86: Switch QEMU over to use the bochs driver
Simon Glass [Sun, 16 Jul 2023 03:39:19 +0000 (21:39 -0600)]
x86: Switch QEMU over to use the bochs driver

This is more convenient since it does not require a video BIOS. Enable
it for QEMU.

Also drop use of video in SPL for the 64-bit QEMU, since it not needed
now.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: video: Add a driver for QEMU bochs emulation
Simon Glass [Sun, 16 Jul 2023 03:39:18 +0000 (21:39 -0600)]
x86: video: Add a driver for QEMU bochs emulation

Bochs is convenient with QEMU on x86 since it does not require a video
BIOS. Add a driver for it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agoefi: Use the installed ACPI tables
Simon Glass [Sun, 16 Jul 2023 03:39:17 +0000 (21:39 -0600)]
efi: Use the installed ACPI tables

U-Boot sets up the ACPI tables during startup. Rather than creating a
new set, install the existing ones. Create a memory-map record to cover
the tables.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agosandbox: Install ACPI tables on startup
Simon Glass [Sun, 16 Jul 2023 03:39:16 +0000 (21:39 -0600)]
sandbox: Install ACPI tables on startup

With x86 we set up the ACPI tables on startup so they can be examined. Do
the same with sandbox, so it is consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agosandbox: Correct header order in board file
Simon Glass [Sun, 16 Jul 2023 03:39:15 +0000 (21:39 -0600)]
sandbox: Correct header order in board file

Fix the header order in this file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agolog: Support outputing function names in SPL
Simon Glass [Sun, 16 Jul 2023 03:39:14 +0000 (21:39 -0600)]
log: Support outputing function names in SPL

The output is garbled when tiny printf() is used. Correct this by adding
a special case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Make sure that the LPC is active before SDRAM init
Simon Glass [Sun, 16 Jul 2023 03:39:13 +0000 (21:39 -0600)]
x86: Make sure that the LPC is active before SDRAM init

Some boards need to access GPIOs to determine which SDRAM is fitted to the
board, for example chromebook_link. Probe this device (if it exists) to
make sure that this works as expected.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: link: Support Micron memory
Simon Glass [Sun, 16 Jul 2023 03:39:12 +0000 (21:39 -0600)]
x86: link: Support Micron memory

Add the required tag so that micron memory can be set up correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Convert some debug statements to use logging
Simon Glass [Sun, 16 Jul 2023 03:39:11 +0000 (21:39 -0600)]
x86: Convert some debug statements to use logging

Move from using debug() to log_debug() so that we don't have to use the
__func__ parameter and can access other logging features.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Record the start and end of the tables
Simon Glass [Sun, 16 Jul 2023 03:39:10 +0000 (21:39 -0600)]
x86: Record the start and end of the tables

The ACPI tables are special in that they are passed to EFI as a separate
piece, independent of other tables.

Also they can be spread over two areas of memory, e.g. with QEMU we end
up with tables kept in high memory as well.

Add new global_data fields to hold this information and update the bdinfo
command to show the table areas.

Move the rom_table_end variable into the loop that uses it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Refactor table-writing code a little
Simon Glass [Sun, 16 Jul 2023 03:39:09 +0000 (21:39 -0600)]
x86: Refactor table-writing code a little

The implementation of write_tables() is confusing because it uses the
rom_table_start variable as the address pointer as it progresses.

Rename it to rom_addr to make the code clearer. Move the rom_table_end
variable into the block where it is used.

Also update logging to use the ACPI category, now that it is available.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Enable useful options for qemu-86_64
Simon Glass [Sun, 16 Jul 2023 03:39:08 +0000 (21:39 -0600)]
x86: Enable useful options for qemu-86_64

This build can be used to boot standard distro builds, since these are
mostly 64-bit these days. Enable some more options, so that all possible
EFI UUIDs are decoded, we get a proper printf() in SPL, can search
memory for tables, support the full set of standard-boot features, have
full logging and can boot from CDROM media.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agofs: fat: Shrink the size of a few strings
Simon Glass [Sun, 16 Jul 2023 03:39:06 +0000 (21:39 -0600)]
fs: fat: Shrink the size of a few strings

To save a few bytes, replace Error with ** and try to use the same string
for multiple messages where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Allow logging to be used in SPL reliably
Simon Glass [Sun, 16 Jul 2023 03:39:05 +0000 (21:39 -0600)]
x86: Allow logging to be used in SPL reliably

When global_data is relocated, log_head moves in memory, meaning that
the items in that list point to the wrong place.

Disable logging when making the change, then reenable it afterwards, so
that logging works normally.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Enable display for QEMU 64-bit
Simon Glass [Sun, 16 Jul 2023 03:39:04 +0000 (21:39 -0600)]
x86: Enable display for QEMU 64-bit

Enable the various options needed for display to work on the qemu-x86_64
board. This includes expanding the available malloc() memory in SPL,
since the PCI bus must be enumerated in order to find the video device.

It also includes enabling a bloblist, so that the video parameters can be
passed. This is placed at address 10000 but is not needed after U-Boot
proper reads the information there.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agopci: Mask the ROM address in case it is already enabled
Simon Glass [Sun, 16 Jul 2023 03:39:03 +0000 (21:39 -0600)]
pci: Mask the ROM address in case it is already enabled

In some cases the video ROM may have been enabled previously, such as by
a previous firmware stage. Use the correct address in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agopci: Adjust video BIOS debugging to be SPL-friendly
Simon Glass [Sun, 16 Jul 2023 03:39:02 +0000 (21:39 -0600)]
pci: Adjust video BIOS debugging to be SPL-friendly

A hex value is expected for the VGA mode. Add a 0x prefix, since the #
construct is not supported in SPL. We don't want to add it, due to
code-size constraints.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Init video in SPL if enabled
Simon Glass [Sun, 16 Jul 2023 03:39:01 +0000 (21:39 -0600)]
x86: Init video in SPL if enabled

When video is required in SPL, set this up ready for use. Ignore any
problems since it may be that video is not actually available and we
still want to continue on to U-Boot proper in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
17 months agox86: Ensure SPL banner is only shown once
Simon Glass [Sun, 16 Jul 2023 03:39:00 +0000 (21:39 -0600)]
x86: Ensure SPL banner is only shown once

Print the banner in SPL init only if the spl_board_init() function isn't
enabled. The spl_board_init() function is in the same file, but is called
later, by board_init_r().

This avoids printing two banners, which causes tests to fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>