summaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)Author
2024-10-11Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"Tom Rini
Simon Glass <sjg@chromium.org> says: When the SPL build-phase was first created it was designed to solve a particular problem (the need to init SDRAM so that U-Boot proper could be loaded). It has since expanded to become an important part of U-Boot, with three phases now present: TPL, VPL and SPL Due to this history, the term 'SPL' is used to mean both a particular phase (the one before U-Boot proper) and all the non-proper phases. This has become confusing. For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL' phases, not just SPL. So code which can only be compiled for actual SPL, for example, must use something like this: #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) In Makefiles we have similar issues. SPL_ has been used as a variable which expands to either SPL_ or nothing, to chose between options like CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was updated to support 'VPL_' as well. This series starts a change in terminology and usage to resolve the above issues: - The word 'xPL' is used instead of 'SPL' to mean a non-proper build - A new CONFIG_XPL_BUILD define indicates that the current build is an 'xPL' build - The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now defined for TPL and VPL phases - The existing SPL_ Makefile variable is renamed to SPL_ - The existing SPL_TPL Makefile variable is renamed to PHASE_ It should be noted that xpl_phase() can generally be used instead of the above CONFIGs without a code-space or run-time penalty. This series does not attempt to convert all of U-Boot to use this new terminology but it makes a start. In particular, renaming spl.h and common/spl seems like a bridge too far at this point. The series is fully bisectable. It has also been checked to ensure there are no code-size changes on any commit.
2024-10-11global: Rename SPL_TPL_ to PHASE_Simon Glass
Use PHASE_ as the symbol to select a particular XPL build. This means that SPL_TPL_ is no-longer set. Update the comment in bootstage to refer to this symbol, instead of SPL_ Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11global: Rename SPL_ to XPL_Simon Glass
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is no-longer set. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-05Merge tag 'u-boot-imx-next-20241005' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22526 - Add DA9063 watchdog support for the imx6q-lxr2 board. - Add support for DH electronics i.MX8M Plus DHCOM PicoITX - Add DH i.MX8MP DHCOM SoM on DRC02 carrier board - Several fsl_esdhc_imx improvements. - Pas no-mmc-hs400 to mmc2 on imx8mm-cl-iot-gate.
2024-10-04Revert "gpio: qcom_pmic: add a quirk to skip GPIO configuration"Caleb Connolly
This reverts commit 19f000b72b2fa7e4540f7cdb91287aff594239bd. The bug in writing was caused by a long-standing error in the SPMI driver which has since been fixed - c2de620d64d4 ("spmi: msm: fix version 5 support"). We can safely enable writing GPIO configuration now. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-10-04gpio: msm: add support for special pinsNeil Armstrong
Leverage the data introduced in the struct msm_special_pin_data to allow setting the gpio direction and value if supported by the pin data. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-10-04gpio: adp5585: Add SPL config for ADP5585 driverYe Li
So we can disable to build ADP5585 in SPL to save size Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2024-08-30gpio: mxc_gpio: fix reading state of GPIO pins in output modeTomas Paukrt
The PSR register works correctly for GPIO pins in input mode, but always returns 0 for GPIO pins in output mode unless the SION bit is set. The DR register should be used for GPIO pins in output mode to allow correct getting of previously set output value. Please note that the Linux gpio-mxc driver and the NXP U-Boot mxc_gpio driver already use the DR register for all GPIO pins in output mode: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=442b2494b17d1a4f0a14721580271eb23ebffd42 https://github.com/nxp-imx/uboot-imx/commit/4afc3f90943c6b117f79b66d2cd04e64f437b0c2 Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Fabio Estevam <festevam@gmail.com> Tested-by: Fabio Estevam <festevam@gmail.com>
2024-08-27gpio: Add G7 Aspeed gpio controller driverBilly Tsai
In the 7th generation of the SoC from Aspeed, the control logic of the GPIO controller has been updated to support per-pin control. Each pin now has its own 32-bit register, allowing for individual control of the pin’s value, direction, interrupt type, and other settings. Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
2024-08-27gpio: npcm: Add SGPIO support for Nuvoton NPCM SoCsJim Liu
Add Nuvoton BMC NPCM7xx/NPCM8xx sgpio driver. BMC can use this driver to increase 64 GPI pins and 64 GPO pins to use. Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2024-07-22drivers: gpio: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-06-17gpio: Add proper dependency on ZYNQMP_FIRMWAREMichal Simek
ZYNQMP_FIRMWARE can be disabled and driver depends on it that's why record this dependency via Kconfig. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c3ca38fbb2f4e6948a5ef95b369015de96259709.1717685091.git.michal.simek@amd.com
2024-06-17arm64: versal2: Add support for AMD Versal Gen 2Michal Simek
Add support for AMD Versal Gen 2. SoC is based on Cortex-a78ae 4 cluster/2 cpu core each. A lot of IPs are shared with previous families. There are couple of new IP blocks where the most interesting from user point of view is UFS. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/bc2b70831ce1031bd0fac32357bff84936e1310f.1716994063.git.michal.simek@amd.com
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07gpio: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-23gpio: qcom_pmic: add pm8150lCaleb Connolly
This is used for the volume keys on some SM8150/SM8250 devices. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-23gpio: qcom_pmic: add pm6125Caleb Connolly
As with some other modern PMICs, writing to the GPIOs seems to make the device reset. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-23gpio: qcom_pmic_gpio: add support for pm8550-gpioNeil Armstrong
Add support for PM8550 GPIO controller variant, keep read-only until the GPIO and Pinctrl setup is fixed for new PMICs. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-15gpio: imx_rgpio2p: support one addressPeng Fan
The i.MX8ULP/93 gpio dt-schema have been updated to only have one address entry, update the driver to support it. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-04-05Merge tag 'qcom-next-2024Apr04' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-snapdragon - Ethernet, i2c, and USB support are now enabled by default - The clock driver gets some bug fixes and cleanup - Invalid FDTs are now properly detected in board_fdt_blob_setup(). - The pinctrl driver gains preparatory support for per-pin function muxes. - Support is added for two generations of Qualcomm HighSpeed USB PHY - A power domain driver is added for the Globall Distributed Switch Controllers on the GCC hardware block. - SDM845 gains USB host mode support. - OF_LIVE is enabled by default for Qualcomm platforms - Some U-Boot devicetree compatibility fixups are added during init to improve compatbility with upstream DT.
2024-04-04gpio: msm_gpio: add .set_flags opCaleb Connolly
The .direction_input and .direction_output ops are deprecated, and don't seem to behave properly for us. Implement our own .set_flags op to handle this correctly. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04gpio: turris_omnia_mcu: Add support for system power off via sysresetMarek Behún
Add support for system power off via UCLASS_SYSRESET. Newer versions of Turris Omnia MCU firmware can power off the board (MCU will disable almost all voltage regulators and go into low power mode). Move the MCU driver into drivers/misc and register it under UCLASS_MISC. The sysreset and gpio device are bound as child devices of the MCU device. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-04-04gpio: turris_omnia_mcu: Update firmware features readingMarek Behún
Update firmware features reading to try reading 32 bits of features and fallback to reading 16 bits. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-04-04gpio: turris_omnia_mcu: Use byteorder conversion functionsMarek Behún
Use byteorder conversion function instead of manually assembling data from/to MCU. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-04-04arm: mvebu: turris_omnia: Add header containing MCU command interface and use itMarek Behún
Add header containing all MCU command definitions and use it in board code and in MCU driver. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-03-20gpio: mcp230xx: Add support for models with SPI interface.Piotr Wojtaszczyk
Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
2024-03-14gpio: rockchip: Use gpio alias id as gpio bank idJonas Karlman
The U-Boot driver try to base the gpio bank id on the gpio-ranges prop and fall back to base the bank id on the node name. However, the linux driver try to base the bank id on the gpio alias id and fall back on node order. This can cause issues when SoC DT is synced from linux and gpioX@ nodes has been renamed to gpio@ and gpio-ranges or a SoC specific alias has not been assigned. Try to use the gpio alias id as first fallback when a gpio-ranges prop is missing to ease sync of updated SoC DT. Keep the current fallback on node name as a third fallback to not affect any existing unsynced DT. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-03-13rockchip: include asm/io.h directly in asm/arch-rockchip/hardware.hQuentin Schulz
The different macros use writel which is defined in asm/io.h, so let's include the header so users of hardware.h do not need to include asm/io.h as well. While at it, remove asm/io.h includes wherever asm/arch-rockchip/hardware.h is included already. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-03-11Merge tag 'v2024.04-rc4' into nextTom Rini
Prepare v2024.04-rc4
2024-03-02ARM: renesas: Rename ARCH_RMOBILE to ARCH_RENESASMarek Vasut
Rename ARCH_RMOBILE to ARCH_RENESAS because all the chips are made by Renesas, while only a subset of them is from the R-Mobile line. Use the following command to perform the rename: " $ git grep -l 'ARCH_RMOBILE' | xargs -I {} sed -i 's@ARCH_RMOBILE@ARCH_RENESAS@g' {} " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2024-03-01Merge https://source.denx.de/u-boot/custodians/u-boot-snapdragon into nextTom Rini
- Reworks Qualcomm support to be more generic, dropping board specific build targets and relying on DT as the only source of truth - Switches all Qualcomm devices to use upstream devicetree
2024-03-01pinctrl: qcom: stub support for special GPIOsCaleb Connolly
Most platforms have a handful of "special" GPIOs, like the MMC clock/data lanes, UFS reset, etc. These don't follow the usual naming scheme of "gpioX" and also have unique capabilities and registers. We can get away without supporting them all for now, but DT compatibility is still an issue. Add support for allowing these to be specified after the other pins, and make all pinmux/pinconf calls for them nop. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> #qcs404 Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-03-01gpio: qcom_pmic: add pinctrl driverCaleb Connolly
Introduce a basic pinctrl driver for the SPMI PMIC GPIOs. This is necessary to make proper use of upstream DT bindings specifically on the dragonboard410c where they're used to switch between USB host and device modes. Only support for driving the pins as output low or high is enabled for now. To minimise duplicated code and allow for sharing common DT data, the pinctrl driver is initialised as a child of the existing GPIO driver. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> #qcs404 Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-03-01gpio: qcom_pmic: add a quirk to skip GPIO configurationCaleb Connolly
Some platforms hard reset when attempting to configure PMIC GPIOs. Add support for quirks specified in match data with a single quirk to skip this configuration. We rely on the GPIO already be configured correctly, which is always the case for volume up (the only current user of these GPIOs). This is not expected behaviour but appears to be due to a U-Boot specific bug. This quirk at least allows for the volume buttons to be used on platforms where this bug is apparent. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-03-01gpio: qcom_pmic: 1-based GPIOsCaleb Connolly
Qualcomm PMICs number their GPIOs starting from 1, implement a custom .xlate method to handle this. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> #qcs404 Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-29treewide: Remove clk_freeSean Anderson
This function is a no-op. Remove it. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20231216193843.2463779-3-seanga2@gmail.com
2024-01-16gpio: qcom_pmic: drop gpio-count propertyCaleb Connolly
This property is not part of the dt bindings and all boards use the new gpio-ranges property instead. Drop support for this. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-16gpio: qcom_pmic: support upstream DTCaleb Connolly
Upstream uses the gpio-ranges property to define the number of GPIOs, support for parsing this when gpio-count is unspecified Additionally, drop the bank-name property as it isn't used in upstream, and we can just hardcode the bank name instead. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-16gpio: qcom_pmic: drop pon GPIO driverCaleb Connolly
Remove the (now unused) GPIO driver for the power and resin buttons on the PMIC. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-16gpio: qcom_pmic: fix silent dev_read_addr downcastCaleb Connolly
priv->pid is uint32_t, but dev_read_addr() returns a uint64_t on arm64, with the upper bits being used for error codes. Do error checking before downcasting to u32 to prevent errors being silently ignored. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-16msm_gpio: use unsigned intCaleb Connolly
Replaces the uses of "unsigned" with "unsigned int". Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-01-16pinctrl: qcom: make compatible with linux DTsCaleb Connolly
The pinctrl and GPIO drivers are currently heavily incompatible with upstream. Most Qualcomm pinctrl blocks feature "tiles" of pins, each at it's own address. Introduce support for these by allowing the soc driver to specify per-pin register offsets similarly to the Linux driver. Adjust the GPIO driver to handle these too, and finally enable support for all pins with the same numbering as used in Linux. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2023-12-21global: Remove duplicate common.h inclusionsTom Rini
These files include <common.h> twice. Start by removing the second inclusion of the file. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-12-19drivers: gpio-uclass: support PMIC GPIO childrenSvyatoslav Ryhel
UCLASS_PMIC may have GPIO children without exposed fdt node, in this case if requesting fails, check if uclass is PMIC. Restrict build for supported devices only to save those precious bytes on devices with no spare memory. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-12-19drivers: gpio: implement PALMAS GPIO cellSvyatoslav Ryhel
Add gpio driver for TI Palmas series PMIC. This has 8 gpio which can work as input/output. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-12-19drivers: gpio: implement MAX77663 GPIO cellSvyatoslav Ryhel
MAXIM Semiconductor's PMIC, MAX77663 has 8 GPIO pins and 3 GPIO-like pins. It also supports interrupts from these pins. Add GPIO driver for these pins to control via GPIO APIs. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-12-19gpio: dw: Drop unused headersMaksim Kiselev
Drop headers which are not used or needed in this file. Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
2023-11-10tree-wide: Replace http:// link with https:// link for ti.comNishanth Menon
Replace instances of http://www.ti.com with https://www.ti.com Signed-off-by: Nishanth Menon <nm@ti.com>