aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-10-17spl: Allow enabling SPL_OF_REAL and SPL_OF_PLATDATA at the same timeSean Anderson
Sandbox unit tests in U-Boot proper load a test device tree to have some devices to work with. In order to do the same in SPL, we must enable SPL_OF_REAL. However, we already have SPL_OF_PLATDATA enabled. When generating platdata from a devicetree, it is expected that we will not need devicetree access functions (even though SPL_OF_CONTROL is enabled). This expectation does not hold for sandbox, so allow user control of SPL_OF_REAL. There are several places in the tree where conditions involving OF_PLATDATA or OF_REAL no longer function correctly when both of these options can be selected at the same time. Adjust these conditions accordingly. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-17Move i.MX8 container image loading support to common/splSean Anderson
To facilitate testing loading i.MX8 container images, move the parse-container code to common/spl. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Check header before calling spl_load_imx_containerSean Anderson
Make sure we have an IMX header before calling spl_load_imx_container, since if we don't it will fail with -ENOENT. This allows us to fall back to legacy/raw images if they are also enabled. This is a functional change, one which likely should have been in place from the start, but a functional change nonetheless. Previously, all non-IMX8 images (except FITs without FIT_FULL) would be optimized out if the only image load method enabled supported IMX8 images. With this change, support for other image types now has an effect. There are seven boards with SPL_LOAD_IMX_CONTAINER enabled: three with SPL_BOOTROM_SUPPORT: imx93_11x11_evk_ld imx93_11x11_evk imx8ulp_evk and four with SPL_MMC: deneb imx8qxp_mek giedi imx8qm_mek All of these boards also have SPL_RAW_IMAGE_SUPPORT and SPL_LEGACY_IMAGE_FORMAT enabled as well. However, none have FIT support enabled. Of the six load methods affected by this patch, only SPL_MMC and SPL_BOOTROM_SUPPORT are enabled with SPL_LOAD_IMX_CONTAINER. spl_romapi_load_image_seekable does not support legacy or raw images, so there is no growth. However, mmc_load_image_raw_sector does support loading legacy/raw images. Since these images could not have been booted before, I have disabled support for legacy/raw images on these four boards. This reduces bloat from around 800 bytes to around 200. There are no in-tree boards with SPL_LOAD_IMX_CONTAINER and AHAB_BOOT both enabled, so we do not need to worry about potentially falling back to legacy images in a secure boot scenario. Future work could include merging imx_container.h with imx8image.h, since they appear to define mostly the same structures. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Add function to validate i.MX8 containersSean Anderson
Add a function to abstract the common task of validating i.MX8 container image headers. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Use log_err for errors in read_auth_containerSean Anderson
To allow for more flexible handling of errors, use log_err instead of printf. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Add newlines after error messagesSean Anderson
These error messages are missing newlines. Add them. Fixes: 6e81ca220e0 ("imx: parse-container: Use malloc for container processing") Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17arm: imx: Fix i.MX8 container load addressSean Anderson
We should load images to their destination, not their entry point. Fixes: 7b86cd4274e ("imx8: support parsing i.MX8 Container file") Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17spl: fit: Fix entry point for SPL_LOAD_FIT_FULLSean Anderson
The entry point is not always the same as the load address. Use the value of the entry property if it exists. Fixes: 8a9dc16e4d0 ("spl: Add full fitImage support") Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-17spl: nor: Don't allocate header on stackSean Anderson
spl_image_info.name contains a reference to legacy_img_hdr. If we allocate the latter on the stack, it will be clobbered after we return. This was addressed for NAND back in 06377c5a1fc ("spl: spl_legacy: Fix NAND boot on OMAP3 BeagleBoard"), but that commit didn't fix NOR. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
2023-10-17spl: legacy: Fix referencing _image_binary_endSean Anderson
On non-arm architectures, _image_binary_end is defined as a ulong and not a char[]. Take the address of it when accessing it, which is correct for both. Fixes: 1b8a1be1a1f ("spl: spl_legacy: Fix spl_end address") Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-17Revert "fs: ext4: check the minimal partition size to mount"Sean Anderson
This check breaks small partitions (under 1024 blocks) because part_length is in units of part.blksz and not bytes. Given the purpose of this function, we really want to make sure the partition is SUPERBLOCK_START + SUPERBLOCK_SIZE (2048) bytes so we can call ext4_read_superblock without error. The obvious solution is to convert callers from things like ext4fs_mount(part_info.size) to ext4fs_mount(part_info.size * part_info.blksz); However, I'm not really a fan of the bloat that would cause, especially since the error is now suppressed. I think the best course of action here is to just revert the patch. This reverts commit 9905cae65e03335aefcb1ebfab5b7ee62d89f64e. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-10-17spl: mmc: Fix subsequent calls to spl_mmc_load with CONFIG_BLKSean Anderson
MMC devices do not have uclass platdata containing blk_descs, only their child block devices do. Fortunately, we have a function just for this purpose. This fixes subsequent calls to spl_mmc_load. Fixes: bf28d9a6599 ("spl: mmc: Use correct MMC device when loading image") Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-17Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-shTom Rini
- RZ/G2L part 1, except for two serial port patches which I had to drop as they broke R2Dplus, they will come later via subsequent PR.
2023-10-17board: rzg2l: Add RZ/G2L SMARC EVK boardPaul Barker
The Renesas RZ/G2L SMARC Evaluation Board Kit consists of the RZ/G2L System-on-Module (SOM) based on the R9A07G044L2 SoC, and a common SMARC carrier board. The ARM TrustedFirmware code for the Renesas RZ/G2L SoC family passes a devicetree blob to the bootloader as an argument in the same was previous R-Car gen3/gen4 SoCs. This blob contains a compatible string which can be used to identify the particular SoC we are running on and this is used to select the appropriate device tree to load. The configuration renesas_rzg2l_smarc_defconfig is added to support building for this target. In the future this defconfig will be extended to support other SoCs and evaluation boards from the RZ/G2L family. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17arm: dts: Import RZ/G2L SMARC EVK device treePaul Barker
The Renesas RZ/G2L SMARC Evaluation Board Kit consists of the RZ/G2L System-on-Module (SOM) based on the R9A07G044L2 SoC, and a common SMARC carrier board. This patch is based on the corresponding Linux v6.5 device tree (commit 52e12027d50affbf60c6c9c64db8017391b0c22e). Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17arm: rmobile: Support RZ/G2L memory mapPaul Barker
The memory map for the RZ/G2L family differs from that of previous R-Car Gen3/Gen4 SoCs. A high level memory map can be seen in figure 5.2 (section 5.2.1) of the RZ/G2L data sheet rev 1.30 published May 12, 2023. A summary is included here (note that this is a 34-bit address space): * 0x0_0000_0000 - 0x0_0002_FFFF SRAM area * 0x0_0003_0000 - 0x0_0FFF_FFFF Reserved area * 0x0_1000_0000 - 0x0_1FFF_FFFF I/O register area * 0x0_2000_0000 - 0x0_2FFF_FFFF SPI Multi area * 0x0_3000_0000 - 0x0_3FFF_FFFF Reserved area * 0x0_4000_0000 - 0x1_3FFF_FFFF DDR area (4 GiB) * 0x1_4000_0000 - 0x3_FFFF_FFFF Reserved area Within the DDR area, the first 128 MiB are reserved by TrustedFirmware. The region from 0x43F00000 to 0x47DFFFFF inclusive is protected for use in TrustedFirmware/OP-TEE, but all other memory is included in the memory map. This reservation is the same as used in R-Car Gen3/Gen4 and RZ/G2{H,M,N,E} SoCs. DRAM information is initialised based on the data in the fdt. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17arm: rmobile: Add CPU detection for RZ/G2LPaul Barker
The ARM TrustedFirmware code for the Renesas RZ/G2L SoC family passes a devicetree blob to the bootloader as an argument in the same was previous R-Car Gen3/Gen4 SoCs. This blob contains a compatible string which can be used to identify the particular SoC we are running on. We do this as reading the DEVID & PRR registers from u-boot is not sufficient to differentiate between the R9A07G044L (RZ/G2L) and R9A07G044C (RZ/G2LC) SoCs. An additional read from offset 0x11861178 is needed but this address is in the OTP region which can only be read from the secure world (i.e. TrustedFirmware). So we have to rely on TrustedFirmware to determine the SoC and pass this information to u-boot via an fdt blob. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17arm: rmobile: Include <asm/types.h> in headerPaul Barker
We don't want to rely on source files including <asm/types.h> before <asm/arch/rmobile.h>. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17mmc: renesas-sdhi: Initialize module on RZ/G2LPaul Barker
On the Renesas RZ/G2L SoC family, we must ensure that the required clock signals are enabled and the reset signal is de-asserted before we try to communicate with the SDHI module. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17mmc: renesas-sdhi: Refactor probe functionPaul Barker
Move the assignment of priv->quirks earlier in the function. This allows us to drop the quirks local variable and makes it easier to maintain clean error handling when we add RZ/G2L support in the next patch. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-17serial: sh: Sort includesPaul Barker
Tidy up the existing include list before we add more includes in the following patch. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-16Merge tag 'u-boot-imx-20231016' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20231016 ------------------- CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/18168 - Imrovement MX93 - Toradex: fixes - Convert to DM (serial, watchdog) for some boards - HAB improvements for Secure Boot - DTO overlay for DHCOM - USB fixes, Mass storage for MX28 - Cleanup some code - Phytec MX8M : EEProm detection, fixes - Gateworks Boards improvements
2023-10-16Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini
- dns325: Enable 2nd harddrive (Peter & Stefan) - marvell: cn9310-crb: Misc fixes to SPI / pincntrl in DTS (Chris) - kirkwood: Add support for ZyXEL NSA325 board (Tony) - sata_mv: Add bootstd hook to enable sata_bootdev (Tony) - x240/AC5/AC5X: Disable SMBIOS (Chris) - Revert "arm: mvebu: x240: Use i2c-gpio instead of built in controller" (Chris) - DS116/N2350: Enable bootstd (Tony) - clearfog: Support multiple DDR sizes (Josua)
2023-10-16Merge branch '2023-10-16-assorted-cmd-updates'Tom Rini
- Update the mac command a bit, to be more widely useful and add a helper macro to declare CONFIG_SYS_LONGHELP text
2023-10-16imx8mp-evk: Add USB0 OTG supportFabio Estevam
Add USB0 OTG support. Currently, the USB0 OTG nodes are not enabled in the Linux kernel devicetree. For this reason, enable the USB0 OTG nodes inside imx8mp-evk-u-boot.dtsi for now. Also select several useful options such as USB gadget and fastboot. Tested by running "ums 0 mmc 2". Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
2023-10-16arm64: dts: imx8mp: Make GPIO3 available early in U-Boot proper on i.MX8MP DHCOMMarek Vasut
The GPIO3 has to be available early during U-Boot proper start up for DRAM size detect to work correctly. The GPIO3 is currently available in SPL and late in U-Boot proper, which is insufficient. Add the missing bootph-all to make the GPIO3 available also early in U-Boot proper. Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-16pico-pi-imx7d: Unselect CONFIG_CONSOLE_MUXFabio Estevam
Unselect CONFIG_CONSOLE_MUX to fix the following error for the input, output and error interfaces: U-Boot 2023.10 (Oct 03 2023 - 21:23:18 -0300) ... In: No input devices available! Out: No output devices available! Err: No error devices available! Net: eth0: ethernet@30be0000 Hit any key to stop autoboot: 0 Signed-off-by: Fabio Estevam <festevam@denx.de>
2023-10-16mxs: Kconfig: Remove TARGET_XFI3 symbolFabio Estevam
The xfi3 target has been removed by commit 539fba2c10e7 ("arm: Remove xfi3 board"), but it missed to remove an entry from the mxs Kconfig. Remove it. Signed-off-by: Fabio Estevam <festevam@denx.de>
2023-10-16smegw01: Convert to watchdog driver modelFabio Estevam
Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset. Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset. Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
2023-10-16mx7dsabresd: Convert to watchdog driver modelFabio Estevam
Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset. Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset. Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
2023-10-16imx7d-sdb-u-boot: Pass SPDX-License tagFabio Estevam
SPDX-License tag is missing and checkpatch complains about it. Add the SPDX-License tag using the same one from imx7d-sdb.dts. Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
2023-10-16imx93_evk: defconfig: enable clock driverSébastien Szymanski
Add clocks nodes in u-boot.dtsi file. Remove init_uart_clk() call. Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
2023-10-16arm64: dts: imx8mp: Add DT overlay describing i.MX8MP DHCOM SoM rev.100Marek Vasut
The current imx8mp-dhcom-som.dtsi describes production rev.200 SoM, add DT overlay which reinstates rev.100 SoM description to permit prototype rev.100 SoMs to be used until they get phased out. Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-16arm64: dts: imx8mp: Drop i.MX8MP DHCOM rev.100 PHY address workaround from ↵Marek Vasut
PDK3 DT In case the i.MX8MP DHCOM rev.100 has been populated on the PDK3 carrier board, the on-SoM PHY PHYAD1 signal has been pulled high by the carrier board and changed the PHY MDIO address from 5 to 7. This has been fixed on production rev.200 SoM by additional buffer on the SoM PHYAD/LED signals, remove the workaround. Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-16arm64: dts: imx8mp: Update i.MX8MP DHCOM SoM DT to production rev.200Marek Vasut
The current imx8mp-dhcom-som.dtsi describes prototype rev.100 SoM, update the DT to describe production rev.200 SoM which brings the following changes: - Fast SoC GPIOs exposed on the SoM edge connector - Slow GPIOs like component resets moved to I2C GPIO expander - ADC upgraded from TLA2024 to ADS1015 with conversion interrupt - EEPROM size increased from 256 B to 4 kiB Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-16arm64: dts: imx8mp: Switch to DT overlays for i.MX8MP DHCOM SoMMarek Vasut
Add DT overlays to support additional DH i.MX8MP DHCOM SoM 660-100 population options with 1x or 2x RMII PHY mounted on PDK2 or PDK3 carrier boards. Use SPL DTO support to apply matching SoM specific DTO to cater for the SoM differences. Remove ad-hoc patching of control DT from fdtdec_board_setup(). Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-16spl: fit: Add board level function to decide application of DTOMarek Vasut
Add board-specific function used to indicate whether a DTO from fitImage configuration node 'fdt' property DT and DTO list should be applied onto the base DT or not applied. This is useful in case of DTOs which implement e.g. different board revision details, where such DTO should be applied on one board revision, and should not be applied on another board revision. Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-16imx: hab: Use size parameterMarek Vasut
The current code works by sheer coincidence, because (see HABv4 API documentation, section 3.4) the RVT authenticate_image call updates the size that is passed in with the actual size ROM code pulls from IVT/CSF . So if the input size is larger, that is "fine" . Pass in size instead to make this really correct. Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-16cmd/ti: Update Kconfig logic and Makefile recursion logicTom Rini
- Add some dependencies to CMD_DDR3 as this is only valid on some platforms (which tend to select it as well). - The proper gate for going in to cmd/ti is not CONFIG_TI_COMMON_CMD_OPTIONS as nothing under there is controlled by that symbol but the general TI architecture options. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-16cmd: Convert existing long help messages to the new macroTom Rini
- Generally we just drop the #ifdef CONFIG_SYS_LONGHELP and endif lines and use U_BOOT_LONGHELP to declare the same variable name as before - In a few places, either rename the variable to follow convention or introduce the variable as it was being done inline before. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-16command.h: Add a U_BOOT_LONGHELP macroTom Rini
In order to be able to discard unused long help texts without further linker lists, add a macro for defining the long help messages which uses __maybe_unused. This allows us to discard them as unreferenced as part of the link. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-16eeprom: starfive: add 'mac raw' commandHeinrich Schuchardt
Add a sub-command to print a hexdump of the EEPROM content. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-10-16eeprom: starfive: raw dump if unsupported data versionHeinrich Schuchardt
If the data version field of the EEPROM is not supported, provide a hexdump of the data. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-10-16eeprom: starfive: re-implement mac commandHeinrich Schuchardt
The different implementations of the mac command have board or vendor specific sub-commands. Add the command definition specific to the VisionFive 2 board. Don't call cmd_usage() directly but return CMD_RET_USAGE instead. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-10-16eeprom: SiFive Unmatched: re-implement mac commandHeinrich Schuchardt
The different implementations of the mac command have board or vendor specific sub-commands. Add the command definition specific to the SiFive HiFive Unmatched board. Don't call cmd_usage() directly but return CMD_RET_USAGE instead. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-10-16freescale: fix long help handling in mac commandHeinrich Schuchardt
CONFIG_SYS_LONGHELP=n we want to reduce the size of the U-Boot binary. The long text should be reduced to and empty string in this case. There is not need to call cmd_usage() directly. It is sufficient to return CMD_RET_USAGE. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-10-16cmd: move mac commandHeinrich Schuchardt
Board specific implementations of the 'mac' command differ concerning the supported sub-commands. Move the Freescale specific mac command definition to the board code. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-10-16gpio: Add RZ/G2L GPIO driverPaul Barker
This driver adds support for the gpio features of the GPIO/PFC module in the Renesas RZ/G2L (R9A07G044) SoC. The new `rzg2l-pfc-gpio` driver is bound to the same device tree node as the `rzg2l-pfc-pinctrl` driver as the same hardware block provides both GPIO and pin multiplexing features. This patch is based on the corresponding Linux v6.5 driver (commit 52e12027d50affbf60c6c9c64db8017391b0c22e). Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-16pinctrl: renesas: Add RZ/G2L PFC driverPaul Barker
This driver adds support for the pinctrl features of the GPIO/PFC module in the Renesas RZ/G2L (R9A07G044) SoC. A multi-function `rzg2l-pfc` driver is defined for UCLASS_NOP, which binds the `rzg2l-pfc-pinctrl` UCLASS_PINCTRL driver dynamically. We also define common macros and functions for the PFC in <renesas/rzg2l-pfc.h>. This makes it easy to add an additional UCLASS_GPIO driver for the GPIO functionality of this module in a follow-up patch. This patch is based on the corresponding Linux v6.5 driver (commit 52e12027d50affbf60c6c9c64db8017391b0c22e). Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-10-16cmd: gpio: Skip output on -ENOENTPaul Barker
On the Renesas RZ/G2L SoC family, valid GPIO numbers are not contiguous. This is determined by the device tree, where a fixed number of bits are used for the 'pin' number within a 'port', even though not all ports have the same number of pins. The device tree can't be changed here without breaking backwards compatibility in Linux, which we don't want to do. To avoid printing a status for each of these invalid GPIO numbers when a user executes `gpio status -a`, we allow gpio_get_function() to return -ENOENT when the given offset does not refer to a valid GPIO pin and we skip printing anything if this occurs. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>