platform/kernel/u-boot.git
15 months agoarm: mach-k3: *: dev-data: Update to use ARRAY_SIZE
Nishanth Menon [Thu, 13 Jul 2023 19:36:34 +0000 (14:36 -0500)]
arm: mach-k3: *: dev-data: Update to use ARRAY_SIZE

Instead of hard-coding the count of entries manually, use ARRAY_SIZE
to keep the count updates appropriately.

Cc: Bryan Brattlof <bb@ti.com>
Suggested-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
15 months agoarm: mach-k3: am62a7_init: Open up FSS_DAT_REG3 firewall
Vignesh Raghavendra [Sun, 2 Jul 2023 09:16:54 +0000 (14:46 +0530)]
arm: mach-k3: am62a7_init: Open up FSS_DAT_REG3 firewall

On security enforced (HS-SE) devices ROM firewalls OSPI data region3 that
is present in above 64bit region. Open this up in bootloader to allow
Linux to access OSPI flashes in mmap mode.

Without this kernel will crash when accessing this region due to
firewall violations on HS-SE devices.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
15 months agocommon: splash_source: Fix type casting errors
Nikhil M Jain [Wed, 21 Jun 2023 10:59:53 +0000 (16:29 +0530)]
common: splash_source: Fix type casting errors

During compilation splash_source puts out below warning for type
conversion in splash_load_fit for bmp_load_addr and fit_header.
Change their type to uintptr_t to fix the warnings.

common/splash_source.c: In function ‘splash_load_fit’:
common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  366 |         img_header = (struct legacy_img_hdr *)bmp_load_addr;
      |                      ^
common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  376 |         res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
      |                                                 ^
common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  401 |                 memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size);

The above warnings are generated if CONFIG_FIT is enabled.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
15 months agoboard: ti: am62x: evm: Include necessary header files
Nikhil M Jain [Wed, 21 Jun 2023 10:59:52 +0000 (16:29 +0530)]
board: ti: am62x: evm: Include necessary header files

At the time of compilation evm.c gives below warning for implicit
declaration of enable_caches, to mitigate this include cpu_func.h.

board/ti/am62x/evm.c: In function ‘spl_board_init’:
board/ti/am62x/evm.c:90:9: warning: implicit declaration of function ‘enable_caches’ [-Wimplicit-function-declaration]
90 |         enable_caches();

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
15 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Fri, 21 Jul 2023 14:01:11 +0000 (10:01 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

For once this adds USB support for two SoCs: the H616 and the F1C100s
series. The rest is support for LPDDR3 DRAM chips on H616 boards.

Gitlab CI passed, and I booted that briefly on an H616 and an F1C200s
board. I don't have an H616 board with LPDDR3 DRAM, but reportedly that
works for Mikhail, and doesn't regress on my DDR3 boards.

15 months agoMerge tag 'xilinx-for-v2023.10-rc1-v2' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 21 Jul 2023 13:57:59 +0000 (09:57 -0400)]
Merge tag 'xilinx-for-v2023.10-rc1-v2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2023.10-rc1 v2

axi_emac:
- Change return value if RX packet is not ready

cadence_qspi:
- Enable flash reset for Versal NET

dt:
- Various DT syncups with Linux kernel
- SOM - reserved pmufw memory location

fpga:
- Add load event

mtd:
- Add missing dependency for FLASH_CFI_MTD

spi/nand:
- Minor cleanup in Xilinx drivers

versal-net:
- Prioritize boot device in boot_targets
- Wire mini ospi/qspi/emmc configurations

watchdog:
- Use new versal-wwdt property

xilinx:
- fix sparse warnings in various places ps7_init*
- add missing headers
- consolidate code around zynqmp_mmio_read/write
- switch to amd.com email

zynqmp_clk:
- Add handling for gem rx/tsu clocks

zynq_gem:
- Configure mdio clock at run time

zynq:
- Enable fdt overlay support

zynq_sdhci:
- Call dll reset only for ZynqMP SOCs

15 months agoevent: Add fpga load event
Christian Taedcke [Thu, 20 Jul 2023 07:27:24 +0000 (09:27 +0200)]
event: Add fpga load event

This enables implementing custom logic after a bitstream was loaded
into the fpga.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Link: https://lore.kernel.org/r/20230720072724.11516-1-christian.taedcke-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
15 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>
15 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>
15 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>
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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
15 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
15 months agoMerge tag 'dm-pull-20jul23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Fri, 21 Jul 2023 01:31:31 +0000 (21:31 -0400)]
Merge tag 'dm-pull-20jul23' of https://source.denx.de/u-boot/custodians/u-boot-dm

binman mkimage and template enhancements
misc fixes

15 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.

15 months agosunxi: H616: add LPDDR3 DRAM support
Mikhail Kalashnikov [Wed, 7 Jun 2023 00:07:45 +0000 (01:07 +0100)]
sunxi: H616: add LPDDR3 DRAM support

The H616 SoC has support for several types of DRAM: DDR3, LPDDR3,
DDR4 and LPDDR4.
At the moment, the driver only supports DDR3 memory.
Let's extend the driver to support the LPDDR3 memory. All "magic"
values obtained from the boot0.

Signed-off-by: Mikhail Kalashnikov <iuncuim@gmail.com>
Acked-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
15 months agosunxi: H616: add DRAM type selection
Mikhail Kalashnikov [Wed, 7 Jun 2023 00:07:44 +0000 (01:07 +0100)]
sunxi: H616: add DRAM type selection

Allwinner H616 SoC supports several types of DRAM memory. To further
integrate other types of memory, we need to add this delimitation.

Signed-off-by: Mikhail Kalashnikov <iuncuim@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
15 months agosunxi: H616: dram: split struct dram_para
Andre Przywara [Wed, 7 Jun 2023 00:07:43 +0000 (01:07 +0100)]
sunxi: H616: dram: split struct dram_para

Currently there is one DRAM parameter struct for the Allwinner H616 DRAM
"driver". It contains many fields that are compile time constants
(set by Kconfig variables), though there are also some fields that are
probed and changed over the runtime of the DRAM initialisation.

Because of this mixture, the compiler cannot properly optimise the code
for size, as it does not consider constant propagation in its full
potential.

Help the compiler out by splitting that structure into two: one that only
contains values known at compile time, and another one where the values
will actually change. The former can then be declared "const", which will
let the compiler fold its values directly into the code using it.

We also add "const" tags for some new "struct dram_config" pointers, to
further increase code optimisation.
To help the compiler optimise the code further, the definition of the
now "const struct dram_para" has to happen at a file-global level, so
move that part out of sunxi_dram_init().

That results in quite some code savings (almost 2KB), and helps to keep
the code small with the LPDDR3 support added later.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agosunxi: H616: dram: const-ify DRAM function parameters
Andre Przywara [Wed, 7 Jun 2023 00:07:42 +0000 (01:07 +0100)]
sunxi: H616: dram: const-ify DRAM function parameters

There are quite some functions in the Allwinner H616 DRAM "driver", some
of them actually change the parameters in the structure passed to them,
but many are actually not.
To increase the optimisation potential for the code, mark those functions
that just read members of the passed dram_para struct as "const".
This in itself does not decrease the code size, but lays the groundwork
for future changes doing so.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agosunxi: dram: make MBUS configuration functions static
Andre Przywara [Wed, 7 Jun 2023 00:07:41 +0000 (01:07 +0100)]
sunxi: dram: make MBUS configuration functions static

The usage of the C keyword "inline" seems to be a common
misunderstanding: it's a *hint* only, and modern compilers will inline
(or not) functions based on their own judgement and provided compiler
options.
So while marking functions as "inline" does not do much, missing the
"static" keyword will force to compiler to spell out a version of the
function for potential external callers, which actually increases the
code size (though hopefully the linker will drop the function).

Change the "inline" attribute for the mbus_configure_port() functions in
some Allwinner DRAM drivers to "static", so that the explicit version
can actually be dropped from the object file, reducing the code size.

"static inline" has a use case in header files, where it avoids a warning
if a .c file including this header does not use the particular function.
In a .c file itself "static inline" is not useful otherwise, so just use
static here as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agosunxi: H616: enable USB support for H616 boards
Andre Przywara [Sun, 11 Jun 2023 23:32:41 +0000 (00:32 +0100)]
sunxi: H616: enable USB support for H616 boards

Now that the PHY driver supports the H616 USB PHY, we can enable USB
support for the two H616 boards.
As the OrangePi Zero2 has a USB-C port hard-wired to peripheral mode,
let's enable USB gadget mode for port 0, so people can use fastboot,
ethernet or mass storage functionality.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agophy: sun4i: Add H616 USB PHY support
Andre Przywara [Sun, 11 Jun 2023 23:32:40 +0000 (00:32 +0100)]
phy: sun4i: Add H616 USB PHY support

Now that the Allwinner USB PHY driver supports the H616 quirk, let's
enable support for USB ports on that SoC.

We connect the compatible string to a new struct describing the SoCs USB
PHY properties, and unblock the PHY driver selection in Kconfig.

A later patch will enable USB support in the H616 boards' defconfigs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agophy: sun4i-usb: Add H616 USB PHY quirk support
Andre Przywara [Sun, 11 Jun 2023 23:32:39 +0000 (00:32 +0100)]
phy: sun4i-usb: Add H616 USB PHY quirk support

The H616 USB PHY is some kind of special snowflake: Only port2 works out
of the box, but all other ports need some help from this port2 to work
correctly: The CLK_BUS_PHY2 and RST_USB_PHY2 clock and reset need to be
enabled, and the SIDDQ bit in the PMU PHY control register needs to be
cleared. For this register to be accessible, CLK_BUS_ECHI2 needs to be
ungated. Don't ask ....

Follow the respective Linux patch (b45c6d80325b) and add a quirk bit,
triggering the special sequence as outlined above, for PHYs other than
PHY2: ungate this one special clock, and clear the SIDDQ bit. We also
pick the clock and reset from PHY2 and enable them as well.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agophy: sun4i-usb: Replace types with explicit quirk flags
Andre Przywara [Sun, 11 Jun 2023 23:32:38 +0000 (00:32 +0100)]
phy: sun4i-usb: Replace types with explicit quirk flags

So far we were assigning some crude "type" (SoC name, really) to each
Allwinner USB PHY model, then guarding certain quirks based on this.
This does not only look weird, but gets more or more cumbersome to
maintain.

Remove the bogus type names altogether, instead introduce flags for each
quirk, and explicitly check for them.
This improves readability, and simplifies future extensions.

Port of Linux patch 8dd256bae653.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agosunxi: Kconfig: rework PHY_USB_SUN4I selection
Andre Przywara [Sun, 11 Jun 2023 23:32:37 +0000 (00:32 +0100)]
sunxi: Kconfig: rework PHY_USB_SUN4I selection

At the moment we use "select" in each Allwinner SoC's Kconfig section to
include the USB PHY driver in the build. This means it cannot be disabled
via Kconfig, although USB is not really a strictly required core
functionality, and a particular board might not even include USB ports.

Rework the Kconfig part by removing the "select" lines for each SoC's
section, and instead letting it default to "y" in the PHY driver section
itself. We use "depends on !" to exclude the few SoCs we don't support
(yet). The Allwinner V3s does not enable USB (PHY) support at the moment,
even though it should work: let the PHY default to "n" to keep the
current behaviour.

Also the MUSB USB driver directly calls some functions from the PHY
driver, so let the former depend on the PHY driver.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Sam Edwards <CFSworks@gmail.com>
15 months agophy: sun4i-usb: add Allwinner F1C100s support
Andre Przywara [Sun, 11 Jun 2023 23:32:36 +0000 (00:32 +0100)]
phy: sun4i-usb: add Allwinner F1C100s support

The Allwinner F1C100s implements a single USB PHY, connected to its MUSB
OTG controller. The USB PHY is of the simpler, older type (like the A10),
the only real difference is that it's indeed only one PHY.

Add a struct describing those F1C100s USB PHY properties, and connect it
to the new compatible string.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agophy: sun4i-usb: Fix of_xlate() argument check
Andre Przywara [Sun, 11 Jun 2023 23:32:35 +0000 (00:32 +0100)]
phy: sun4i-usb: Fix of_xlate() argument check

In its of_xlate() function, the Allwinner USB PHY driver compares the
args_count variable against the number of implemented USB PHYs, although
this is the *number of arguments* to the DT phandle property. Per the DT
binding for this PHY device, this number is always one, so this check
will always fail if the particular SoC implements exactly one USB PHY.
So far this affected only the V3s (which has USB support disabled), but
the F1C100s also sports one PHY only.

Fix that check to compare args_count against exactly 1, and the args[0]
content (requested PHY number) against the number of implemented PHYs.

This fixes USB operation on the Allwinner V3s and allows to enable USB
on the Allwinner F1C100s SoC.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
15 months agobinman: Reduce state.SetInt and bintool cmd to debug level
Simon Glass [Tue, 18 Jul 2023 13:24:09 +0000 (07:24 -0600)]
binman: Reduce state.SetInt and bintool cmd to debug level

These are not very important message. Change them to use the 'debug' level
instead of 'detail'.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Support writing symbols inside a mkimage image
Simon Glass [Tue, 18 Jul 2023 13:24:08 +0000 (07:24 -0600)]
binman: Support writing symbols inside a mkimage image

Add support for writing symbols and determining the assumed position of
binaries inside a mkimage image. This is useful as an example for other
entry types which might want to do the same thing.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Support templates at any level
Simon Glass [Tue, 18 Jul 2023 13:24:07 +0000 (07:24 -0600)]
binman: Support templates at any level

Allow templates to be used inside a section, not just in the top-level
/binman node.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Add a test for templating in a FIT
Simon Glass [Tue, 18 Jul 2023 13:24:06 +0000 (07:24 -0600)]
binman: Add a test for templating in a FIT

Add this as a separate test case.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Support templating with multiple images
Simon Glass [Tue, 18 Jul 2023 13:24:05 +0000 (07:24 -0600)]
binman: Support templating with multiple images

Allow a template to appear in the top level description when using
multiple images.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Support simple templates
Simon Glass [Tue, 18 Jul 2023 13:24:04 +0000 (07:24 -0600)]
binman: Support simple templates

Collections can used to collect the contents of other entries into a
single entry, but they result in a single entry, with the original entries
'left behind' in their old place.

It is useful to be able to specific a set of entries ones and have it used
in multiple images, or parts of an image.

Implement this mechanism.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agodtoc: Allow inserting a list of nodes into another
Simon Glass [Tue, 18 Jul 2023 13:24:03 +0000 (07:24 -0600)]
dtoc: Allow inserting a list of nodes into another

Provide a way to specify a phandle list of nodes which are to be inserted
into an existing node.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agodtoc: Support copying the contents of a node into another
Simon Glass [Tue, 18 Jul 2023 13:24:02 +0000 (07:24 -0600)]
dtoc: Support copying the contents of a node into another

This permits implementation of a simple templating system, where a node
can be reused as a base for others.

For now this adds new subnodes after any existing ones.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Correct handling of zero bss size
Simon Glass [Tue, 18 Jul 2023 13:24:01 +0000 (07:24 -0600)]
binman: Correct handling of zero bss size

Fix the check for the __bss_size symbol, since it may be 0. Unfortunately
there was no test coverage for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Drop __bss_size variable in bss_data.c
Simon Glass [Tue, 18 Jul 2023 13:24:00 +0000 (07:24 -0600)]
binman: Drop __bss_size variable in bss_data.c

This is not needed since the linker script sets it up. Drop the variable
to avoid confusion.

Fix the prototype for main() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Provide a way to specify the fdt-list directly
Simon Glass [Tue, 18 Jul 2023 13:23:59 +0000 (07:23 -0600)]
binman: Provide a way to specify the fdt-list directly

Sometimes multiple boards are built with binman and it is useful to
specify a different FDT list for each. At present this is not possible
without providing multiple values of the of-list entryarg (which is not
supported in the U-Boot build system).

Allow a fit,fdt-list-val string-list property to be used instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Convert mkimage to Entry_section
Marek Vasut [Tue, 18 Jul 2023 13:23:58 +0000 (07:23 -0600)]
binman: Convert mkimage to Entry_section

This is needed to handle mkimage with inner section located itself in a
section.

Signed-off-by: Marek Vasut <marex@denx.de>
Use BuildSectionData() instead of ObtainContents(), add tests and a few
other minor fixes:
Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Add more detail on how ObtainContents() works
Simon Glass [Tue, 18 Jul 2023 13:23:57 +0000 (07:23 -0600)]
binman: Add more detail on how ObtainContents() works

This area of binman can be a bit confusing. Add some more comments to
help.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Update elf to return number of written symbols
Simon Glass [Tue, 18 Jul 2023 13:23:56 +0000 (07:23 -0600)]
binman: Update elf to return number of written symbols

Update the LookupAndWriteSymbols() function to return the number of
symbols written. Also add some logging for when debugging is not
enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agostm32mp15: Avoid writing symbols in SPL
Simon Glass [Tue, 18 Jul 2023 13:23:55 +0000 (07:23 -0600)]
stm32mp15: Avoid writing symbols in SPL

These boards use SPL in a mkimage entry and apparently access the symbol
containing the image position of U-Boot, but put U-Boot in another
image. This means that binman is unable to fill in the symbol correctly
in the SPL binary.

This doesn't matter at present since mkimage doesn't support symbol
writing. But with the upcoming conversion to a section, it will. So add
a property to disable symbol writing.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Allow disabling symbol writing
Simon Glass [Tue, 18 Jul 2023 13:23:54 +0000 (07:23 -0600)]
binman: Allow disabling symbol writing

Some boards don't use symbol writing but do access the symbols in SPL.
Provide an option to work around this.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Read _multiple_data_files in the correct place
Simon Glass [Tue, 18 Jul 2023 13:23:53 +0000 (07:23 -0600)]
binman: Read _multiple_data_files in the correct place

Move this to the ReadEntries() function where it belongs.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Use GetEntries() to obtain section contents
Simon Glass [Tue, 18 Jul 2023 13:23:52 +0000 (07:23 -0600)]
binman: Use GetEntries() to obtain section contents

Some section types don't have a simple _entries list. Use the GetEntries()
method in GetEntryContents() and other places to handle this.

This makes the behaviour more consistent.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agobinman: Init align_default in entry_Section
Simon Glass [Tue, 18 Jul 2023 13:23:51 +0000 (07:23 -0600)]
binman: Init align_default in entry_Section

This should be set up in the init function, to avoid a warning about a
property not set up there. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agotools: Fix package discovery in pyproject.toml of u_boot_pylib.
Maxim Cournoyer [Fri, 7 Jul 2023 21:15:32 +0000 (17:15 -0400)]
tools: Fix package discovery in pyproject.toml of u_boot_pylib.

When building from source, setuptools would complain about not finding
package via its auto-discovery mechanism.  Manually specify how to
locate the files, relative to the package's directory.

* tools/u_boot_pylib/pyproject.toml: New tool.setuptools.packages.find
section.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agotools: Fix README file in pyproject.toml of u_boot_pylib.
Maxim Cournoyer [Fri, 7 Jul 2023 21:15:31 +0000 (17:15 -0400)]
tools: Fix README file in pyproject.toml of u_boot_pylib.

* tools/u_boot_pylib/pyproject.toml (readme): Replace README.md with
README.rst.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agobootstd: USB devtype detection for script boot
John Clark [Fri, 30 Jun 2023 17:12:14 +0000 (13:12 -0400)]
bootstd: USB devtype detection for script boot

Change the device type from "usb_mass_storage" to "usb" when
booting a script.

Before this change:
   => printenv devtype
   devtype=usb_mass_storage

After this change:
   => printenv devtype
   devtype=usb

Signed-off-by: John Clark <inindev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocmd: fix loads, saves on sandbox
Heinrich Schuchardt [Sun, 25 Jun 2023 09:54:23 +0000 (11:54 +0200)]
cmd: fix loads, saves on sandbox

The loads and saves commands crash on the sandbox due to illegal memory
access.

For command line arguments the sandbox uses a virtual address space which
does not equal the addresses of the memory allocated with memmap(). Add the
missing address translations for the loads and saves commands.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agosandbox: fix a compilation error
Sergei Antonov [Mon, 12 Jun 2023 21:19:04 +0000 (00:19 +0300)]
sandbox: fix a compilation error

With sandbox and sandbox64 configurations:

In file included from .../u-boot/include/test/test.h:156,
                 from .../u-boot/include/test/lib.h:9,
                 from .../u-boot/test/lib/test_crc8.c:8:
.../u-boot/arch/sandbox/include/asm/test.h: In function ‘sandbox_sdl_set_bpp’:
.../u-boot/arch/sandbox/include/asm/test.h:323:17: error: ‘ENOSYS’ undeclared (first use in this function)
  323 |         return -ENOSYS;
      |                 ^~~~~~

Per Tom Rini's suggestion:
move that function prototype over to arch/sandbox/include/asm/sdl.h
and make test/dm/video.c include <asm/sdl.h>

Cc: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocore: read: fix dev_read_addr_size()
John Keeping [Thu, 1 Jun 2023 14:11:19 +0000 (15:11 +0100)]
core: read: fix dev_read_addr_size()

The behaviour of dev_read_addr_size() is surprising as it does not
handle #address-cells and #size-cells but instead hardcodes the values
based on sizeof(fdt_addr_t).

This is different from dev_read_addr_size_index() and
dev_read_addr_size_name() both of which do read the cell sizes from the
device tree.

Since dev_read_addr_size() is only used by a single driver and this
driver is broken when CONFIG_FDT_64BIT does not match the address size
in the device tree, fix the function to behave like all of the other
similarly named functions.  Drop the property name argument as the only
caller passes "reg" and this is the expected property name matching the
other similarly named functions.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # chromebook_jerry
Tested-by: Simon Glass <sjg@chromium.org> # chromebook_bob
15 months agodm: core: of_access: fix return value in of_property_match_string
Eugen Hristev [Thu, 4 May 2023 12:22:21 +0000 (15:22 +0300)]
dm: core: of_access: fix return value in of_property_match_string

of_property_match_string calls of_find_property to search for the
string property.
If the device node does not exist, of_find_property returns NULL, and
of_property_match_string returns -EINVAL, which is correct.
However, if the device node exists, but the property is not found,
of_find_property still returns NULL, but it will place -FDT_ERR_NOTFOUND
in the *lenp variable.
of_property_match_string does not use the lenp parameter, thus this error
case is being lost, and treated as if the node is NULL, and returns
-EINVAL, which is incorrect.

The callers of of_property_match_string treat the error differently if
the return value is -EINVAL or -ENOENT, e.g. in dwc3 driver:

ret = generic_phy_get_by_name(dev, "usb3-phy", &phy);
if (!ret) {
ret = generic_phy_init(&phy);
if (ret)
return ret;
} else if (ret != -ENOENT && ret != -ENODATA) {
debug("could not get phy (err %d)\n", ret);
return ret;
} else {
phy.dev = NULL;
}

So the caller drivers will just consider the property missing if -ENOENT
is returned, versus the case of -EINVAL, which means something else.

To fix this situation, changed the code to call the of_find_property
with the right third argument to catch this error code and treat it
accordingly.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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

15 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>
15 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>