summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-07-10mmc: sunxi: Cleanup and fix self-calibration codeAndre Przywara1-8/+19
Newer SoCs have a self calibration feature, which avoids us writing hard coded phase delay values into the controller. Consolidate the code by avoiding unnecessary #ifdefs, and also enabling the feature for all those newer SoCs. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10mmc: sunxi: Enable "new timing mode" on all new SoCsAndre Przywara1-0/+3
All SoCs since the Allwinner A64 (H5, H6, R40, H616) feature the so called "new timing mode", so enable this in Kconfig for those SoCs. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10mmc: sunxi: Cleanup "new timing mode" selectionAndre Przywara1-9/+6
Among the SoCs using the "new timing mode", only the A83T needs to explicitly switch to that mode. By just defining the symbol for that one odd A83T bit to 0 for any other SoCs, we can always OR that in, and save the confusing nested #ifdefs. Clean up the also confusing new_mode setting on the way. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-07-10mmc: sunxi: Fix MMC clock parent selectionAndre Przywara2-4/+8
Most Allwinner SoCs which use the so called "new timing mode" in their MMC controllers actually use the double-rate PLL6/PERIPH0 clock as their parent input clock. This is interestingly enough compensated by a hidden "by 2" post-divider in the mod clock, so the divider and actual output rate stay the same. Even though for the H6 and H616 (but only for them!) we use the doubled input clock for the divider computation, we never accounted for the implicit post-divider, so the clock was only half the speed on those SoCs. This didn't really matter so far, as our slow MMIO routine limits the transfer speed anyway, but we will fix this soon. Clean up the code around that selection, to always use the normal PLL6 (PERIPH0(1x)) clock as an input. As the rate and divider are the same, that makes no difference. Explain the hardware differences in a comment. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10mmc: sunxi: Fix warnings with CONFIG_PHYS_64BITAndre Przywara1-2/+2
When enabling PHYS_64BIT on 32-bit platforms, we get two warnings about pointer casts in sunxi_mmc.c. Those are related to MMIO addresses, which are always below 1GB on all Allwinner SoCs, so there is no problem with anything having more than 32 bits. Add the proper casts to make it compile cleanly. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-07-10mmc: sunxi: Avoid #ifdefs in delay and width setupAndre Przywara1-18/+15
The delay and bus-width setup are slightly different across the Allwinner SoC generations, and we covered this so far with some preprocessor conditionals. Use the more readable IS_ENABLE() instead. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-07-10sunxi: H616: Enable full 4GB of DRAMAndre Przywara2-3/+12
The H616 is our first supported Allwinner SoC which goes beyond the 4GB address space "barrier", by having more than 32 address bits. Lift the preliminary 3GB DRAM limit for the H616, and update the page table setup on the way, to actually map that last GB as well. As not all devices are actually capable of dealing with more than 32 bits (the DMA in the EMAC for instance), we also limit U-Boot's own DRAM usage to 4GB on the way. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10sunxi: board: Add H616 MMC2 pinsAndre Przywara1-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>
2021-07-10sunxi: h3: Add initial ZeroPi supportYu-Tung Chang4-1/+106
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>
2021-07-10configs: OrangePi PC2: Update defaultsJernej Skrabec1-1/+3
OrangePi PC2 board has DRAM with ODT, so enable it. H5 SoC is also connected to voltage regulator. It's default value is reasonable at reset, but might be too low when rebooting with a lower voltage programmed. In order to avoid instability, enable driver for it and set it to appropriate voltage. Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Tested-by: Andre Przywara <andre.przywara@arm.com> [Andre: remove original ZQ value change, adjust commit message] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10sunxi: clock: H6/H616: Fix PLL clock factor encodingsAndre Przywara4-5/+5
Most clock factors and dividers in the H6 PLLs use a "+1 encoding", which we were missing on two occasions. This fixes the MMC clock setup on the H6, which could be slightly off due to the wrong parent frequency: mmc 2 set mod-clk req 52000000 parent 1176000000 n 2 m 12 rate 49000000 Also the CPU frequency (PLL1) was a tad too high before. For PLL5 (DRAM) we already accounted for this +1, but in the DRAM code itself, not in the bit field macro. Move this there to be aligned with what the other SoCs and other PLLs do. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2021-07-10phy: sun4i-usb: Fix PHY0 routing and passby configuration for MUSBPaul Kocialkowski1-1/+13
Recent Allwinner platforms (starting with the H3) only use the MUSB controller for peripheral mode and use HCI for host mode. As a result, extra steps need to be taken to properly route USB signals to one or the other. More precisely, the following is required: * Routing the pins to either HCI/MUSB (controlled by PHY); * Enabling USB PHY passby in HCI mode (controlled by PMU). The current code will enable passby for each PHY and reroute PHY0 to MUSB, which is inconsistent and results in broken USB peripheral support. Passby on PHY0 must only be enabled when we want to use HCI. Since host/device mode detection is not available from the PHY code and because U-Boot does not support changing the mode dynamically anyway, we can just mux the controller to MUSB if it is enabled and mux it to HCI otherwise. This fixes USB peripheral support for platforms with PHY0 dual-route, especially H3/H5 and V3s. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10arm: dts: sunxi: h3: Update DT filesAndre Przywara8-15/+142
Update the H3 DT files from the Linux 5.12 release. The changes update some boards, and don't affect U-Boot, but fix Gigabit Ethernet when this DT is passed on to the Linux kernel. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10arm: dts: sunxi: h5: Update DT filesAndre Przywara13-24/+296
Update the H5 DT files from the Linux 5.12 release. The changes don't affect U-Boot at all, but fix Gigabit Ethernet when this DT is passed on to the Linux kernel. It also introduces DVFS. This also updates the shared sunxi-h3-h5.dtsi, but that only adds nodes that are of no concern to U-Boot. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10arm: dts: sunxi: h6: Update DT filesAndre Przywara6-22/+45
Update the H6 DT files from the Linux 5.12 release. The changes are minimal (many LED node renames), but also help to enable USB port 0 in U-Boot (later), enable the RSB device (not yet used in U-Boot), and also introduce an MMC frequency limit. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-09Merge branch '2021-07-09-arm-updates'Tom Rini4-14/+21
- Assorted ARM platform updates
2021-07-09Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini6-21/+198
- Support higher baudrates on Armada 3720 UART (Pali & Marek) - OcteonTX: do not require cavium BDK node to be present (Tim)
2021-07-09arm: armv8: Fix warning about redeclaring global functions as weakTom Rini1-6/+3
As seen with clang-12: warning: __asm_invalidate_l3_dcache changed binding to STB_WEAK As we indeed use ENTRY and then declare the function weak manually. Use the WEAK declarative from <linux/linkage.h> instead. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-09arm: bootm: Disable LMB reservation for command line and board info on arm64Marek Vasut1-0/+2
On arm64, board info is not applicable and kernel command line patched into the DT, so the LMB reservation here makes no sense anymore. On legacy arm32, this might still be necessary on systems which do not use DT or use legacy ATAGS. Disable this LMB reservation on arm64. This also permits Linux DT to specify reserved memory node at address close to the end of DRAM bank, i.e. overlaping with U-Boot location. Since after boot, U-Boot will be no more, this is OK. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Hai Pham <hai.pham.ud@renesas.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Tom Rini <trini@konsulko.com>
2021-07-09arch: cache: cp15: Add mmu_set_region_dcache_behaviour() when SYS_DCACHE_OFF ↵Patrice Chotard1-6/+12
is enable Fix following compilation issue when SYS_DCACHE_OFF is enable: drivers/misc/scmi_agent.c:128: undefined reference to `mmu_set_region_dcache_behaviour' when SYS_DCACHE_OFF is enable, mmu_set_region_dcache_behaviour() must be defined. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-09armv8: Handle EL2 Host modeMark Kettenis1-2/+4
On implementations that support VHE, the layout of the CPTR_EL2 register depends on whether HCR_EL2.E2H is set. If the bit is set, CPTR_EL2 uses the same layout as CPACR_EL1 and can in fact be accessed through that register. In that case, jump to the EL1 code to enable access to the FP/SIMD registers. This allows U-Boot to run on systems that pass control to U-Boot in EL2 with EL2 Host mode enabled such as machines using Apple's M1 SoC. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Acked-by: Marc Zyngier <maz@kernel.org>
2021-07-08octeontx: do not require cavium BDK node to be presentTim Harvey1-12/+8
The cavium,bdk node is a non-standard dt node used by the BDK and therefore it is removed from the dt before booting Linux. Do not require this node to exist as it won't for standard dt's. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-08arm: mvebu: a37xx: Enable more baudratesPali Rohár2-4/+14
Extend CONFIG_SYS_BAUDRATE_TABLE and include all standard baudrates and also nonstandard up to the 6 MBaud. U-Boot's A3720 UART driver can use baudrates from 300 Baud to 6 MBaud. This changes all A3720 boards, since all of them include either mvebu_armada-37xx.h or turris_mox.h config file. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-08serial: a37xx: Switch to XTAL clock when booting Linux kernelPali Rohár1-0/+67
Unfortunately the UART driver in current Linux for Armada 3700 expects UART's parent clock to be XTAL and calculats baudrate divisor according to XTAL clock. Therefore we must switch back to XTAL clock before booting kernel. Implement .remove method for this driver with DM_FLAG_OS_PREPARE flag set. If current baudrate is unsuitable for XTAL clock then we do not change anything. This can only happen if the user either configured unsupported settings or knows what they are doing and has kernel patches which allow usage of non-XTAL parent clock. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-08serial: a37xx: Use TBG as parent clockPali Rohár1-5/+101
Using TBG clock as parent clock for UART allows us using higher baudrates than 230400. Turris MOX with external FT232RL USB-UART works fine up to 3 MBaud (which is maximum for this USB-UART controller), while EspressoBIN with integrated pl2303 USB-UART also works fine up to 6 MBaud. Slower baudrates with TBG as a parent clock can be achieved by increasing TBG dividers and oversampling divider. When using the slowest TBG clock, minimal working baudrate is 300. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-08clk: armada-37xx: Set DM_FLAG_PRE_RELOCMarek Behún2-0/+2
Setting DM_FLAG_PRE_RELOC for Armada 3720 clock drivers (TBG and peripheral clocks) makes it possible for serial driver to retrieve clock rates via clk API. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-08serial: a37xx: Fix parent clock rate value and divider calculationPali Rohár1-4/+10
UART parent clock is by default the platform's xtal clock, which is 25 MHz. The value defined in the driver, though, is 25.8048 MHz. This is a hack for the suboptimal divisor calculation Divisor = UART clock / (16 * baudrate) which does not use rounding division, resulting in a suboptimal value for divisor if the correct parent clock rate was used. Change the code for divisor calculation to round to closest value, i.e. Divisor = Round(UART clock / (16 * baudrate)) and change the parent clock rate value to that returned by get_ref_clk(). This makes A3720 UART stable at standard UART baudrates between 1800 and 230400. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-08configs: Resync with savedefconfigTom Rini18-446/+58
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08Azure: Remove "spear" jobsTom Rini1-3/+1
With the spear family of platforms gone, remove references to them from the build jobs. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08Revert "arm: Remove nsa310s board"Tom Rini9-0/+364
While this platform has not yet been converted, there is active efforts to do so. Keep the platform for now. This reverts commit aa697e6904ba1b3144a46ec642d4695e7c0cdc3e. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08Merge branch '2021-07-07-remove-non-migrated-platforms'Tom Rini604-38143/+76
- Remove a large number of platforms that did not migrate to DM_PCI or DM_USB by 2 years past the migration deadline and do not have a migration imminent.
2021-07-08usb: Add correct depends for CMD_USB_MASS_STORAGETom Rini1-0/+1
We cannot build this without USB_GADGET_DOWNLOAD support enabled, add the appropriate depends line. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08sniper: Add build guards around MUSB support codeTom Rini1-1/+4
If MUSB support is disabled, these parts of the code will fail to build. Cc: Paul Kocialkowski <contact@paulk.fr> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove spear600 boards and the rest of SPEAr supportTom Rini51-3912/+0
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove them. As this is the last of the SPEAr platforms, so remove the rest of the remaining support as well. Cc: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove spear320 boardsTom Rini18-372/+5
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove them. As this is also the last SPEAR3XX platform, remove that symbol as well. Cc: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove spear310 boardsTom Rini16-372/+4
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove them. Cc: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove spear300 boardsTom Rini15-401/+3
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove them. Cc: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove nsa310s boardTom Rini9-364/+0
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove it Cc: Gerald Kerma <dreagle@doukki.net> Cc: Tony Dinh <mibodhi@gmail.com> Cc: Luka Perkov <luka.perkov@sartura.hr> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove gplugd boardTom Rini7-277/+0
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove it Cc: Ajay Bhargav <contact@8051projects.net> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove edb9315a boardTom Rini12-698/+2
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove it. This is also the last PL010_SERIAL using board, so remove those references. Cc: Sergey Kostanbaev <sergey.kostanbaev@fairwaves.ru> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08arm: Remove at91rm9200ek boardsTom Rini10-403/+1
These boards have not been converted to CONFIG_DM_USB by the deadline and is also missing conversion to CONFIG_DM. Remove them. Cc: Andreas Bießmann <andreas@biessmann.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08mx6memcal: Disable USB GADGET in SPLTom Rini1-9/+0
As this board does not use CONFIG_OF_CONTROL and the DM_USB migration deadline has passed, disable USB_GADGET support. Cc: Eric Nelson <eric@nelint.com> Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Eric Nelson <eric@nelint.com>
2021-07-08dockstar: Perform base CONFIG_DM enablementTom Rini1-0/+2
As these boards support CONFIG_OF_CONTROL today, perform a basic CONFIG_DM migration. Cc: Eric Cooper <ecc@cmu.edu> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08ib62x0: Perform base CONFIG_DM enablementTom Rini1-0/+2
As these boards support CONFIG_OF_CONTROL today, perform a basic CONFIG_DM migration. Cc: Luka Perkov <luka@openwrt.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08iconnect: Perform base CONFIG_DM enablementTom Rini1-0/+2
As these boards support CONFIG_OF_CONTROL today, perform a basic CONFIG_DM migration. Cc: Luka Perkov <luka@openwrt.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08pogo_e02: Perform base CONFIG_DM enablementTom Rini1-0/+2
As these boards support CONFIG_OF_CONTROL today, perform a basic CONFIG_DM migration. Cc: Dave Purdy <david.c.purdy@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08openrd: Perform base CONFIG_DM enablementTom Rini3-0/+6
As these boards support CONFIG_OF_CONTROL today, perform a basic CONFIG_DM migration. Cc: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08snapper9260/snapper9g20: Disable USBTom Rini2-6/+0
These boards have not converted to DM_USB by the deadline, disable USB support as they do not enable CONFIG_OF_CONTROL. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08configs: Remove unnecessary CONFIG_DM_PCI_COMPAT=yTom Rini139-139/+0
The following boards no longer need CONFIG_DM_PCI_COMPAT enabled, so remove that. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08ppc: Remove T4160RDB boardTom Rini16-316/+10
This board has not been converted to CONFIG_DM_PCI by the deadline and is also missing conversion to CONFIG_DM. Remove it. As this is the last ARCH_T4160 platform, remove that support as well. Signed-off-by: Tom Rini <trini@konsulko.com>