aboutsummaryrefslogtreecommitdiffstats
path: root/board/sunxi
Commit message (Collapse)AuthorAgeFilesLines
* Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"WIP/20May2024-nextTom Rini2024-05-205-5/+0
| | | | | | | | 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>
* Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini2024-05-195-0/+5
| | | | | | | | | | | | 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>
* arm: sunxi: Remove <common.h> and add needed includesTom Rini2024-05-065-5/+0
| | | | | | | | Remove <common.h> from all mach-sunxi and board/sunxi files and when needed add missing include files directly. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* sunxi: remove unneeded i2c_init_board() call for U-Boot properAndre Przywara2024-04-221-8/+1
| | | | | | | | | | | | | | | | | | | The driver used for the Allwinner I2C IP is using proper DT and DM enablement for a while: we enable the clock gate and de-assert the reset line in the driver's probe() routine, and the pinmux setup is taken care of by the DM framework. This means the explicit call to the i2c_init_board() routine is not needed for U-Boot proper. As the board_init() function in board.c is only called for U-Boot proper, we can remove the call, something that the comment there hinted at already. Fix the comment for the board_init() function on the way: we were not really doing board specific setup there. The fact that this function is called from U-Boot proper only is probably more helpful for reasoning about this code. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: H616: Add OrangePi Zero 2W board supportAndre Przywara2024-03-031-0/+5
| | | | | | | | | | | | | | | | | | | | The OrangePi Zero 2W is a tiny development board featuring the Allwinner H618 SoC, shipping with up to 4GB of LPDDR4 DRAM, a mini-HDMI connector, two USB Type-C sockets and a 16MB SPI NOR flash. There is an FPC connector to connect an expansion board, which sports two more USB Type-A sockets and a 100MBit Ethernet port. Support for the expansion board is not in the DT yet, probably a DT overlay would cover this in the future. Add a defconfig file selecting the right drivers and DRAM options. Since the .dts file was synced from the Linux kernel repo already, we just need to add one line to the Makefile to actually build the .dtb. The DRAM parameters were derived from the values found in the BSP DRAM drivers on the SPI NOR flash. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
* board/sunxi/MAINTAINERS: Add new defconfigsTom Rini2024-01-291-0/+10
| | | | | | | Add entries for the recently added defconfig files. I had thought I had committed these updates but lost them before pushing the branch. Signed-off-by: Tom Rini <trini@konsulko.com>
* sunxi: H616: Add OrangePi Zero 3 board supportAndre Przywara2023-12-061-0/+5
| | | | | | | | | | | | | | | | | | | | The OrangePi Zero 3 is a small development board featuring the Allwinner H618 SoC, shipping with up to 4GB of DRAM, Gigabit Ethernet, a micro-HDMI connector and two USB sockets. The board uses LPDDR4 DRAM and an X-Powers AXP313a PMIC, support for which was recently added to U-Boot. Add a defconfig file selecting the right drivers and DRAM options. Since the .dts file was synced from the Linux kernel repo already, we just need to add one line to the Makefile to actually build the .dtb. The DRAM parameters were derived from the values found in the BSP DRAM drivers on the SPI NOR flash. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Mikhail Kalashnikov <iuncuim@gmail.com> Tested-by: Bob McChesney <bob@electricworry.net> Tested-by: Stephen Graf <stephen.graf@gmail.com>
* power: pmic: sunxi: add AXP313 SPL driverAndre Przywara2023-11-121-1/+2
| | | | | | | | | | | | On boards using the AXP313 PMIC, the DRAM rail is often not setup correctly at reset time, so we have to program the PMIC very early in the SPL, before running the DRAM initialisation. Add a simple AXP313 PMIC driver that knows about DCDC2(CPU) and DCDC3(DRAM), so that we can bump up the voltage before the DRAM init. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
* arm: dts: icnova-a20-adb4006: Add board supportLudwig Kormann2023-11-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add board support for ICnova A20 SomPi compute module on ICnova ADB4006 development board. Specification: SoM - Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz - 512MB DDR3 RAM - Fast Ethernet (Phy: Realtek RTL8201CP) ADB4006 - I2C - 2x USB 2.0 - 1x Fast Ethernet port - 1x SATA - 2x buttons (PWRON, Boot) - 2x LEDS - serial console - HDMI - µSD-Card slot - Audio Line-In / Line-Out - GPIO pinheaders https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006 https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM devicetree upstreamed with linux 6.5 Signed-off-by: Ludwig Kormann <ludwig.kormann@ict42.de> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
* arm: sunxi: Correct warning in board_fit_config_name_matchTom Rini2023-11-121-1/+2
| | | | | | | | | | | When building this with clang, we get a warning about having excess parenthesis here, or that we're incorrectly using "==" when we want "=". Correct these by using the common size macro. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> [Andre: Use SZ_512M as per Simon's suggestion] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: board: simplify early PMIC setup conditionsAndre Przywara2023-11-121-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | So far we have a convoluted #ifdef mesh that guards the early AXP PMIC setup in board.c. That combination of &&, || and negations is very hard to read, maintain and especially to extend. Fortunately we have those same conditions already modelled in the Kconfig file, so they are actually redundant. On top of that the real reason we have those preprocessor guards in the first place is about the symbols that are *conditionally* defined: without #ifdefs the build would break because of them being undefined for many boards. To simplify this, just change the guards to actually look at the symbols needed, so CONFIG_AXP_xxx_VOLT instead of CONFIG_AXPyyy_POWER. This drastically improves the readability of this code, and makes adding PMIC support a pure Kconfig matter. Doing this revealed one bug in Kconfig: there is no axp_set_dcdc4() for the AXP818, even though CONFIG_AXP_DCDC4_VOLT includes that PMIC. Since the AXP818 wasn't included when calling axp_set_dcdc4() in board.c, this wasn't an issue, but becomes one now, so also remove the AXP818 from the DCDC4 Kconfig symbol. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiTom Rini2023-10-233-26/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly about support for the Allwinner R528/T113s SoC, which is reportedly the same die as the Allwinner D1, but with the two Arm Cortex-A7 cores activated instead of the RISC-V one. Using sunxi code outside of arch/arm proved to be difficult, so apart from enabling this Arm SoC, the patches also prepare for more refactoring to get the D1 nicely supported some day: - We get rid of some Kconfig (hard-)coded GPIO pins, responsible for enabling regulators. - The GPIO code is moved out of arch/arm, into drivers/gpio. - Some definitions are moved out of header files under asm/arch. - Some T113s/D1 specific definitions are guarded by a generic Kconfig symbol (CONFIG_SUNXI_GEN_NCAT2). - The DRAM controller initialisation code is located under drivers/ram. - The base SoC .dtsi files are shared (under arch/riscv, as in Linux). Of course there are also the usual new SoC specific patches, like clock and pinmux descriptions, alongside a rework of the pinctrl code, since Allwinner changed the GPIO register layout, for the first time since sunxi's inception. On top of this the PSCI code sees some update, to provide SMP services for R528/T113s boards. Many thanks to Sam for providing this code and staying strong through the review cycles. The final patch enables support for one popular board, I hope to see more DTs and defconfigs contributed in the future! Many thanks to all the various contributors, testers and reviewers, that series was a real team effort!
| * sunxi: R528: add SMHC2 pin pull ups supportOkhunjon Sobirjonov2023-10-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Add support for eMMC (SMHC2) pin pull ups for R528 boards. The D1 and T113s (and even R329) SoCs do not support 8-bit eMMC anymore, so it's just four data pins to cover here. Signed-off-by: Okhunjon Sobirjonov <Okhunjon.Sobirjonov@Mec-electronics.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> [Andre: adjust commit message] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
| * pinctrl: sunxi: remove GPIO_EXTRA_HEADERAndre Przywara2023-10-222-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot's generic GPIO_EXTRA_HEADER is a convenience symbol to allow code to more easily include platform specific GPIO headers. This should not be needed in a DM world anymore, since the generic GPIO framework handles that nicely. For Allwinner boards we still need to deal with non-DM GPIO in the SPL, but this should become the exception, not the rule. Make this more obvious by removing the definition of GPIO_EXTRA_HEADER, and just force every legacy user of platform specific GPIO to include the new sunxi_gpio.h header explicitly. Everyone doing so should feel ashamed and should find a way to avoid it from now on. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Samuel Holland <samuel@sholland.org>
| * sunxi: remove CONFIG_MACPWRAndre Przywara2023-10-221-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CONFIG_MACPWR Kconfig symbol is used to point to a GPIO that enables the power for the Ethernet "MAC" (mostly PHY, really). In the DT this is described with the phy-supply property in the MAC DT node, pointing to a (GPIO controlled) regulator. Since we need Ethernet only in U-Boot proper, and use a DM driver there, we should use the DT instead of hardcoding this. Add code to the sun8i_emac and sunxi_emac drivers to check the DT for that regulator and enable it, at probe time. Then drop the current code from board.c, which was doing that job before. This allows us to remove the MACPWR Kconfig definition and the respective values from the defconfigs. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Sam Edwards <CFSworks@gmail.com>
| * sunxi: remove CONFIG_SATAPWRAndre Przywara2023-10-221-15/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | The CONFIG_SATAPWR Kconfig symbol was used to point to a GPIO that enables the power for a SATA harddisk. In the DT this is described with the target-supply property in the AHCI DT node, pointing to a (GPIO controlled) regulator. Since we need SATA only in U-Boot proper, and use a DM driver for AHCI there, we should use the DT instead of hardcoding this. Add code to the sunxi AHCI driver to check the DT for that regulator and enable it, at probe time. Then drop the current code from board.c, which was doing that job before. This allows us to remove the SATAPWR Kconfig definition and the respective values from the defconfigs. We also select the generic fixed regulator driver, which handles those GPIO controlled regulators. Please note that the OrangePi Plus is a bit special here, it's a H3 board without native SATA, but with a USB-to-SATA bridge. The DT models the SATA power via a VBUS supply regulator, which we don't parse yet in the USB PHY driver. Use the hardcoded CONFIG_USB3_VBUS_PIN for that board meanwhile. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Samuel Holland <samuel@sholland.org>
* common: Drop linux/printk.h from common headerWIP/23Sep2023Simon Glass2023-09-241-0/+1
| | | | | | | | | This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* crc32: Drop duplicates crc header includesIlya Lukin2023-08-081-1/+0
| | | | | Fixes: 3db711085752 ("crc32: Use the crc.h header for crc functions") Signed-off-by: Ilya Lukin <4.shket@gmail.com>
* sunxi: Add MAINTAINERS entry for Lctech Pi F1C200sTom Rini2023-07-251-0/+5
| | | | | | | This defconfig was added without a MAINTAINERS entry, add one. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* mtd: nand: sunxi: Convert to the driver modelSamuel Holland2023-04-281-4/+1
| | | | | | | | | | | | Clocks, resets, and pinmuxes are now handled by the driver model, so the only thing the "board" code needs to do is load the driver. This matches the pattern used by other DM raw NAND drivers (there is no NAND uclass). The actual board code is now only needed in SPL. Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: board: annotate #endif linesAndre Przywara2022-12-141-6/+5
| | | | | | | | | | | | The legacy Allwinner code is cluttered with #ifdef's, some of them even nested, which makes the code hard to read and error prone. Eventually we will get rid of most of them, but for now let's at least annotate the #endif lines with the corresponding symbol the bracket started with. Reviewed-by: Samuel Holland <samuel@sholland.org> Tested-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: remove bogus mmc_pinmux_setup() prototypeAndre Przywara2022-12-141-4/+0
| | | | | | | | | | | Since all callers of mmc_pinmux_setup() are located after the definition of that function, there is no need for a forward declaration (anymore?). Remove the prototype along with its #ifdef guards. Reviewed-by: Samuel Holland <samuel@sholland.org> Tested-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: remove unused CONFIG_MMC_SUNXI_SLOTAndre Przywara2022-12-141-2/+7
| | | | | | | | | | | | | | | | | There is a CONFIG_MMC_SUNXI_SLOT definition in our sunxi_common.h config header, which was used to note the first MMC controller to initialise. The definition in that header was always set to 0, with no easy way of overriding this, and certainly none of the existing boards made any use of that (non-)feature. Remove that definition and replace it with a constant 0 in the only user, in board.c. It turns out that this is safe, as this is only used in the SPL, and the BROM also unconditionally initialises MMC0. This also removes the last legacy config symbol with SUN*I in it from the whitelist. Reviewed-by: Samuel Holland <samuel@sholland.org> Tested-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: defconfig: Add X96 Mate TV boxAndre Przywara2022-10-191-0/+5
| | | | | | | | | | | | | The X96 Mate TV box is a TV box with the Allwinner H616 SoC. It is available with up to 4GB of DRAM and 64GB eMMC. The DRAM chips require a different configuration when compared to the OrangePi Zero2, we must not use read/write training and write leveling. Add a defconfig for the box, so that we can easily build U-Boot for it. We synced the .dts file already from the kernel tree. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
* sunxi: fix initial environment loading without MMCSamuel Holland2022-06-261-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e42dad4168fe ("sunxi: use boot source for determining environment location") changed our implementation of env_get_location() and enabled it for every board, even those without MMC support (like the C.H.I.P. boards). However the default fallback location of ENVL_FAT requires MMC support compiled in, so the board hangs when trying to initially load the environment. Change the algorithm to only return configured environment locations, and improve the fallback algorithm on the way. The env_init() routine calling this function here does not behave well if the return value is ENVL_UNKNOWN on the very first call: it will make U-Boot proper silently hang very early. Work around this issue by making sure we return some configured (dummy) environment location when prio is 0. This for instance happens when booting via FEL. This fixes U-Boot loading on the C.H.I.P. boards. Fixes: e42dad4168fe ("sunxi: use boot source for determining environment location") Reported-by: Chris Morgan <macroalpha82@gmail.com> Signed-off-by: Samuel Holland <samuel@sholland.org> [Andre: fix FEL boot case by not returning ENVL_UNKNOWN when prio==0] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Skip MMC0 init when its pinmux conflicts with UART0Samuel Holland2022-05-241-12/+10
| | | | | | | | | | | | | | Currently, selecting UART0_PORT_F entirely disables MMC support on sunxi platforms. But this is a bigger hammer then needed. Muxing UART0 to the pins on port F only causes a conflict with MMC0, so minimize the impact by specifically skipping MMC0 init. We can continue to use MMC1/2 if those are enabled. Let's also remove the preprocessor check while refacting this function. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* arm: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is validWIP/2022-04-21-further-cleanupsPeng Fan2022-04-211-3/+3
| | | | | | | | Since COUNTER_FREQUENCY is obselete, so set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
* sunxi: Support building a SPL as a TOC0 imageSamuel Holland2022-04-041-0/+24
| | | | | | | | | | | Now that mkimage can generate TOC0 images, and the SPL can interpret them, hook up the build infrastructure so the user can choose which image type to build. Since the absolute load address is stored in the TOC0 header, that information must be passed to mkimage. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Remove non-DM MMC pin setupSamuel Holland2022-04-041-11/+0
| | | | | | | | This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Remove options and setup code for I2C2-I2C4Samuel Holland2022-04-041-48/+0
| | | | | | | | | These options are not currently enabled anywhere. Any new users should use DM clocks and pinctrl. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Remove non-DM GMAC pin setupSamuel Holland2022-04-041-55/+0
| | | | | | | | This is now handled automatically by the pinctrl driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Fix old GMAC pinmux setupAndre Przywara2022-03-261-0/+3
| | | | | | | | | | | | | | | | | | | Commit 5bc4cd05d7d4 ("sunxi: move non-essential code out of s_init()") moved the call to eth_init_board() from s_init() into board_init_f(). This means it's now only called from the SPL, which makes sense for most of the other moved low-level functions. However the GMAC pinmux and clock setup in eth_init_board() was not happy about that, so it broke the sun7i GMAC. Since Ethernet is of no use in the SPL anyway, just move the call into board_init(), which is only run in U-Boot proper. This fixes Ethernet operation for the A20 SoCs, which broke in v2022.04-rc1, with the above mentioned commit. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Tested-by: Petr Štetiar <ynezz@true.cz> [a20-olinuxino-lime2]
* sunxi: use boot source for determining environment locationAndre Przywara2022-03-101-8/+43
| | | | | | | | | | | | | | | | | | | | | Currently we only support to load the environment from raw MMC or FAT locations on Allwinner boards. With the advent of SPI flash we probably also want to support using the environment there, so we need to become a bit more flexible. Change the environment priority function to take the boot source into account. When booted from eMMC or SD card, we use FAT or MMC, if configured, as before. If we are booted from SPI flash, we try to use the environment from there, if possible. The same is true for NAND flash booting, although this is somewhat theoretical right now (as untested). This way we can use the same image for SD and SPI flash booting, which allows us to simply copy a booted image from SD card to the SPI flash, for instance. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
* Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiWIP/03Feb2022Tom Rini2022-02-032-2/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the promised second part of the sunxi PR for 2022.04, albeit technially outside of the merge window. We were working on this full steam since the beginning of the year, and it deserves to be merged, I think. The main attraction is support for the F1C100s SoC, which sports a venerable ARM926 core. Support for this SoC and the LicheePi Nano board has been in Linux for years, and U-Boot patches were posted mid last year already. The new SoC using ARMv5 also means that the bulk of the new code should not touch any existing boards, although we did some refactorings first, of course, which actually cleans up some existing sunxi code. Compile tested for all 160 sunxi boards, and briefly tested on BananaPi M1, OrangePi Zero, Pine64 and Pine-H64. Tested by others on their boards, including F1C100s and F1C200s devices.
| * sunxi: board: Add support for SUNIVIcenowy Zheng2022-02-041-2/+2
|/ | | | | | | | | Generic Timer Extension is not available on SUNIV. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Add option to prevent booting on power plug-inChris Morgan2022-01-301-0/+11
| | | | | | | | | | | | | | | | | | For sunxi boards with the AXP209, AXP221, AXP809, and AXP818 PMICs (plus possibly others, I only confirmed the datasheets for these), it is sometimes desirable to not boot whenever the device is plugged in. An example would be when using the NTC CHIP inside a PocketCHIP. This provides a configurable option to check if bit 0 of register 0 of the PMIC says it was powered because of a power button press (0) or a plug-in event (1). If the value is 1 and this option is selected, the device shuts down shortly after printing a message to console stating the reason why it's shutting down. Powering up the board with the power button is not affected. Signed-off-by: Chris Morgan <macromorgan@hotmail.com> [Andre: reword to speak of boot, remove #ifdefs] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: dram_sun4i/5i: use DRAM_MEMORY_TYPE_DDR3 instead of magic number 3Giulio Benetti2022-01-302-2/+2
| | | | | | | | Since DRAM_MEMORY_TYPE_DDR3 is defined let's use it instead of magic number 3. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: call fdt_fixup_ethernet again to set macaddr for more aliasesIcenowy Zheng2022-01-301-2/+4
| | | | | | | | | | | | | | | | | Sometimes some ethernet aliases do not exist in U-Boot DT but they exist in the DT used to boot the system (for example, modified via DT overlays). In this situation setup_environment is called again in ft_board_setup() to generate macaddr environment variable for them. However now the call to fdt_fixup_ethernet() is moved before the call of ft_board_setup(). Call fdt_fixup_ethernet() again to add MAC addresses for the extra ethernet aliases. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> [updated commit message] Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* Finish conversion of CONFIG_SYS_CLK_FREQ to KconfigTom Rini2021-12-271-1/+2
| | | | | | | | | | | | | | | | | In order to finish moving this symbol to Kconfig for all platforms, we need to do a few more things. First, for all platforms that define this to a function, introduce CONFIG_DYNAMIC_SYS_CLK_FREQ, similar to CONFIG_DYNAMIC_DDR_CLK_FREQ and populate clock_legacy.h. This entails also switching all users from CONFIG_SYS_CLK_FREQ to get_board_sys_clk() and updating a few preprocessor tests. With that done, all platforms that define a value here can be converted to Kconfig, and a fall-back of zero is sufficiently safe to use (and what is used today in cases where code may or may not have this available). Make sure that code which calls this function includes <clock_legacy.h> to get the prototype. Signed-off-by: Tom Rini <trini@konsulko.com>
* sunxi: Remove misleading USB-OTG charger messageAndre Przywara2021-12-081-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The sunxi MUSB glue driver has some code to check for external VBUS presence when it's going to use the MUSB host mode, and it warns if there is VBUS provided through the cable (in sunxi_musb_enable()). This code was apparently copied to the USB gadget detection code (g_dnl_board_usb_cable_connected()), but here we actually *expect* external VBUS power, so a warning is wrong and confusing. So far this message rarely triggered, but a recent patch (6fa41cdd19b9) changed this: =========================== => ums 0 mmc 2 UMS: LUN 0, dev mmc 2, hwpart 0, sector 0x0, count 0xe90000 A charger is plugged into the OTG /A charger is plugged into the OTG \A charger is plugged into the OTG |A charger is plugged into the OTG -A charger is plugged into the OTG .... =========================== Remove the message for the gadget cable detection call, and just return the status of the VBUS detection, as this is what the callers are after. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
* sunxi: video: Convert panel I2C to use DM_I2CSamuel Holland2021-10-121-43/+1
| | | | | | | | | | | | | | | | | | Two displays supported by the sunxi display driver (each one used by a single board) require initialization over I2C. Both previously used i2c_soft; replace this with the i2c-gpio instance that already exists in those boards' device trees (sun5i-a13-utoo-p66 and sun6i-a31-colombus). Since the i2c-gpio nodes are not referenced by any other node in the device trees (the device trees have no panel node), the I2C bus is selected by its node name. This panel initialization code was the only i2c_soft user, so the i2c_soft GPIO setup code can be removed now as well. Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Add support for FriendlyARM NanoPi R1S H5Chukun Pan2021-10-111-0/+5
| | | | | | | | | | | | | | | | | | | | This adds support for the NanoPi R1S H5 board. Allwinner H5 SoC 512MB DDR3 RAM 10/100/1000M Ethernet x 2 RTL8189ETV WiFi 802.11b/g/n USB 2.0 host port (A) MicroSD Slot Reset button Serial Debug Port WAN - LAN - SYS LED The dts file is taken from Linux 5.14 tag. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Clean up inclusions of asm/arch/gpio.hSamuel Holland2021-10-112-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | As part of migrating to DM_GPIO and DM_PINCTRL, eventually we will remove the asm/arch/gpio.h header. In preparation, clean up the various files that include it. Some files did not contain any GPIO code at all, so this header was completely unused. A few files contained only legacy platform-specific GPIO code for setting up pin muxes. They were left unchanged, as that code will be completely removed by the DM_PINCTRL migration. The remaining files contain some combination of DM_GPIO and legacy GPIO code. For those, switch to including asm/gpio.h (if it wasn't included already). Right now, this header provides both sets of functions, because ARCH_SUNXI selects GPIO_EXTRA_HEADER. This will still be the right header to include once the DM_GPIO migration is complete and GPIO_EXTRA_HEADER is no longer needed. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* board: sunxi: enable status LED earlyArnaud Ferraris2021-10-111-0/+6
| | | | | | | | | | | | | | For some systems, such as the PinePhone, there is no way for the end user to make sure the system is indeed booting before the boot script is executed, which takes several seconds. Therefore, it can be useful to provide early visual feedback as soon as possible. In order achieve this goal, this patch initializes the status LED (if configured) in the SPL. Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Reviewed-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: Simplify MMC pinmux selectionSamuel Holland2021-10-111-72/+29
| | | | | | | | | | | | | | | | Only one board, Yones Toptech BD1078, actually uses a non-default MMC pinmux. All other uses of these symbols select the default value or an invalid value. To simplify things, remove support for the unused pinmux options, and convert the remaining option to a Boolean. This allows the pinmux to be chosen by the preprocessor, instead of having the code parse a string at runtime (for a build-time option!). Not only does this reduce code size, but it also allows this Kconfig option to be used in a table-driven DM pinctrl driver. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* configs: add PineTab defconfigArnaud Ferraris2021-10-111-0/+5
| | | | | | | | The PineTab device-tree is already in u-boot, this commit adds the corresponding defconfig, based on pinephone_defconfig. Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* Convert CONFIG_SYS_I2C_SOFT et al to KconfigTom Rini2021-08-301-1/+1
| | | | | | | | | This converts the following to Kconfig: CONFIG_SYS_I2C_SOFT CONFIG_SYS_I2C_SOFT_SPEED CONFIG_SYS_I2C_SOFT_SLAVE Signed-off-by: Tom Rini <trini@konsulko.com>
* sunxi: Select environment MMC based on boot deviceSamuel Holland2021-08-011-0/+14
| | | | | | | | | | | | | | Currently, the environment is always stored in eMMC if eMMC is enabled in the config. This means images written to SD and eMMC will cross- contaminate their environments unless the configuration is changed. By dropping the device number from the environment location string and implementing mmc_get_env_dev, we will always use the environment from the boot device when booting from SD/eMMC. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* sunxi: board: Add H616 MMC2 pinsAndre Przywara2021-07-101-0/+13
| | | | | | | | | | | | | | We hardcode the pinctrl setting for the MMC controllers in boards.c, since we need them also in the SPL, where there is no DT yet. Add the respective setting for the H616 SoC, to enable eMMC on boards with this SoC as well. Also to make diagnosing this problem easier, print a warning if a board tries to setup MMC2 pins without a respective SoC setting being defined. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan at amarulasolutions.com> Reviewed-by: Jernej Skrabec <jernej.skrabec at siol.net>
* sunxi: h3: Add initial ZeroPi supportYu-Tung Chang2021-07-101-0/+6
| | | | | | | | | | | | | | | | | ZeroPi is a new board of high performance with low cost designed by FriendlyElec., using the Allwinner H3 SOC. ZeroPi features - Allwinner H3, Quad-core Cortex-A7@1.2GHz - 256MB/512MB DDR3 RAM - microsd slot - 10/100/1000Mbps Ethernet - Debug Serial Port - DC 5V/2A power-supply Signed-off-by: Yu-Tung Chang <mtwget@gmail.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>