22170 Commits

Author SHA1 Message Date
Samuel Holland
00db730a70 sunxi: Use sunxi-common.h for D1 port
This shows the changes needed to sunxi-common.h, so it makes upstreaming
a little bit easier.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Samuel Holland
72195d6519 sunxi: Add a U-Boot port for the Lichee RV 86 Panel
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Jisheng Zhang
66de75ee48 sunxi: Add a U-Boot port for the Lichee RV and its dock
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
[Samuel: licheepi -> lichee; drop DRAM size; other changes]
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Samuel Holland
b124274412 sunxi: Add a U-Boot port for the Allwinner D1 Nezha
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Samuel Holland
fe9ab6afca sunxi: Convert some Kconfig defaults to implies
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Samuel Holland
75f553177a board: riscv: Sort target configs alphabetically
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Samuel Holland
e7f9ea0a7d riscv: cpu: Add cache operations for T-HEAD CPUs
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Samuel Holland
e3541ca58e usb: musb-new: Hack up the driver for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:45 -05:00
Samuel Holland
ffaebb3e96 phy: sun4i-usb: Hack up the driver for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:44 -05:00
Samuel Holland
f14e84087a mmc: sunxi: Hack up the driver for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:44 -05:00
Samuel Holland
8432543a1e gpio: sunxi: Hack up the driver for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-18 00:02:44 -05:00
Samuel Holland
da3bea429b Merge branch 'patch/axp-gpio' into allwinner
# Conflicts:
#	arch/arm/mach-sunxi/Kconfig
2022-03-17 23:43:43 -05:00
Samuel Holland
92a3de0b52 Merge branch 'patch/axp-vbus' into allwinner
# Conflicts:
#	arch/arm/include/asm/arch-sunxi/gpio.h
2022-03-17 23:43:38 -05:00
Samuel Holland
b9cbe59bfc Merge branch 'patch/dm-pinctrl' into allwinner 2022-03-17 23:43:28 -05:00
Samuel Holland
46322617a6 Merge branch 'patch/h6-dts' into allwinner 2022-03-17 23:43:26 -05:00
Samuel Holland
eca24c30ef Merge branch 'patch/dt-sync' into allwinner 2022-03-17 23:43:23 -05:00
Samuel Holland
5001f243a1 Merge branch 'patch/h3-scp' into allwinner 2022-03-17 23:43:22 -05:00
Samuel Holland
9fd8cea961 Merge branch 'patch/h3-fit' into allwinner 2022-03-17 23:43:20 -05:00
Samuel Holland
a73b3739cb gpio: axp: Bind via device tree
Now that the PMIC has a DM driver and binds device tree subnodes, the
GPIO device can be bound that way, instead of from inside board code.

Since the driver still uses the single set of register definitions from
axpXXX.h (as selected by AXPxxx_POWER), it does not differentiate among
the supported compatibles.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:14 -05:00
Samuel Holland
e03e25e58c ARM: dts: sunxi: Add AXP221 and AXP809 GPIO nodes
These PMICs each have two GPIO pins, and are supported by the axp_gpio
driver. In order to convert the axp_gpio driver to probe using the
device tree, the corresponding device tree nodes must be present. Add
them, following the same binding as the AXP209 and AXP813.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:13 -05:00
Samuel Holland
469878ae11 phy: sun4i-usb: Use DM_GPIO for id/vbus_det GPIOs
Now that the sunxi_gpio driver handles pull-up/down via the driver
model, we can switch to DM_GPIO for these pins with no loss in
functionality. Since the driver now gets its pin configuration from
the device tree, we can remove the Kconfig symbols.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:10 -05:00
Samuel Holland
f6b9fbe0c2 gpio: axp/sunxi: Remove virtual VBUS enable GPIO
Now that this functionality is modeled using the device tree and
regulator uclass, the named GPIO is not referenced anywhere. Remove
it, along with the rest of the support for AXP virtual GPIOs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:10 -05:00
Samuel Holland
d699110da4 sunxi: Remove obsolete USBx_VBUS_PIN Kconfig symbols
Now that the USB PHY driver uses the device tree to get VBUS supply
regulators, these Kconfig symbols are unused. Remove them.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:10 -05:00
Samuel Holland
75a15cd899 gpio: axp/sunxi: Remove virtual VBUS detection GPIO
Now that this functionality is modeled using the device tree and
regulator uclass, the named GPIO is not referenced anywhere. Remove it.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:09 -05:00
Samuel Holland
94c5c73ed4 ARM: dts: sun6i: mixtile-loftq: Add USB1 VBUS regulator
This board is configured with CONFIG_USB1_VBUS_PIN="PH24", but no
regulator exists in its device tree. Add the regulator, so USB will
continue to work when the PHY driver switches to using the regulator
uclass instead of a GPIO.

Update the device tree here because it does not exist in Linux.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:09 -05:00
Samuel Holland
6e615ceb50 ARM: dts: sun50i: H6: Sync from Linux v5.15
Copy the devicetree source for the H6 SoC and all existing boards
verbatim from the Linux v5.15 tag.

This update should not impact any existing U-Boot functionality.

Series-to: sunxi
Cover-letter:
sunxi: Devicetree sync from Linux v5.15
This series brings all of our devicetrees up to date with the latest
stable Linux version.

<< something about ABI compat >>

Here is the list of new files which were not added by this sync:
 - sun4i-a10-topwise-a721.dts
 - sun50i-a100-allwinner-perf1.dts
 - sun50i-a100.dtsi
 - sun50i-h6-pine-h64-model-b.dts
 - sun5i-a13-licheepi-one.dts
 - sun5i-a13-pocketbook-touch-lux-3.dts
 - sun5i-gr8-evb.dts
 - sun7i-a20-linutronix-testbox-v2.dts
 - sun7i-a20-olinuxino-lime-emmc.dts
 - sun8i-a23-ippo-q8h-v1.2.dts
 - sun8i-a23-ippo-q8h-v5.dts
 - sun8i-a33-et-q8-v1.6.dts
 - sun8i-a33-ippo-q8h-v1.2.dts
 - sun8i-h3-nanopi-r1.dts
 - sun8i-r16-nintendo-nes-classic.dts
 - sun8i-r16-nintendo-super-nes-classic.dts
 - sun8i-r40-feta40i.dtsi
 - sun8i-r40-oka40i-c.dts
 - sun8i-s3-elimo-impetus.dtsi
 - sun8i-s3-elimo-initium.dts
 - sun8i-t3-cqa3t-bv3.dts
 - sun8i-v3-sl631-imx179.dts
 - sun8i-v3-sl631.dtsi
END

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:06 -05:00
Samuel Holland
e27605aaee ARM: dts: sun50i: H5: Sync from Linux v5.15
Copy the devicetree source for the H5 SoC and all existing boards
from the Linux v5.15 tag, with minor changes to account for the
different directory layout for 64-bit SoCs.

While there were some recent changes to the shared H3/H5 devicetree,
the only H5-specific change is fixing the EMAC phy-mode in one board.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:06 -05:00
Samuel Holland
d62bfaa236 ARM: dts: sun50i: A64: Sync from Linux v5.15
Copy the devicetree source for the A64 SoC and all existing boards
verbatim from the Linux v5.15 tag.

As with the other SoCs, updates of note are EMAC phy-mode changes to set
RGMII delays.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:06 -05:00
Samuel Holland
f9b6b21870 ARM: dts: sun8i: R40: Sync from Linux v5.15
Copy the devicetree for the R40 SoC verbatim from the Linux v5.15 tag.

None of the existing boards had any devicetree updates.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:06 -05:00
Samuel Holland
f335457f83 ARM: dts: sun8i: V3/V3s/S3: Sync from Linux v5.15
Copy the devicetree source for the V3(s)/S3 SoCs and all existing boards
verbatim from the Linux v5.15 tag.

This update should not impact any existing U-Boot functionality.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:06 -05:00
Samuel Holland
7a7b0e65ae ARM: dts: sun8i: H2+/H3: Sync from Linux v5.15
Copy the devicetree source for the H2+/H3 SoCs and all existing boards
verbatim from the Linux v5.15 tag.

As with the other SoCs, updates of note are EMAC phy-mode changes to set
RGMII delays.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:05 -05:00
Samuel Holland
70e70b18af ARM: dts: sun8i: A83T: Sync from Linux v5.15
Copy the devicetree source for the A83T SoC and all existing boards
verbatim from the Linux v5.15 tag.

As with the other SoCs, updates of note are EMAC phy-mode changes to set
RGMII delays, and adding detection GPIO properties in the USB PHY nodes.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:05 -05:00
Samuel Holland
eee2682d08 ARM: dts: sun9i: Sync from Linux v5.15
Copy the devicetree source for the A80 SoC and all existing boards
verbatim from the Linux v5.15 tag.

This update should not impact any existing U-Boot functionality.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:05 -05:00
Samuel Holland
3c5060128f ARM: dts: sunxi: A13/A31/A23/A33: Sync from Linux v5.15
Copy the devicetree source for the A10s/A13/GR8, A31(s), and A23/A33/R16
SoCs and all existing boards verbatim from the Linux v5.15 tag.

These SoCs are combined into one commit due to some interdependencies:
 - The unit addresses were removed from bitbanged I2C buses, which
   drives a Kconfig default change. This affects sun5i-a13-utoo-p66.dts
   and sun6i-a31-colombus.dts.
 - The pinctrl nodes were renamed, including some used by the shared
   sunxi-reference-design-tablet.dtsi.

This commit renames the file sun8i-r16-nintendo-nes-classic-edition.dts
to sun8i-r16-nintendo-nes-classic.dts to match the Linux tree.

As with the other SoCs, updates of note are EMAC phy-mode changes to set
RGMII delays, conversion of GPIO pull-up from pinconf to GPIO flags, and
renaming the detection GPIO properties in the USB PHY nodes.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:05 -05:00
Samuel Holland
c31beda11d ARM: dts: sun7i: Sync from Linux v5.15
Copy the devicetree source for the A20 SoC and all existing boards
verbatim from the Linux v5.15 tag.

An important change here is to the GMAC phy-mode property on several
boards; this needs to be set correctly once the rtl8211e driver starts
configuring the PHY RGMII delays from the devicetree.

This update also includes changes to the USB PHY detection GPIO
properties which are needed to convert that driver to use the DM GPIO
framework.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:05 -05:00
Samuel Holland
0e9e077368 ARM: dts: sun4i: Sync from Linux v5.15
Copy the devicetree source for the A10 SoC and all existing boards
verbatim from the Linux v5.15 tag.

While this update should not impact any existing U-Boot functionality,
the changes to the USB PHY detection GPIO properties are needed to
convert that driver to use the DM GPIO framework.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:05 -05:00
Samuel Holland
d306bcd4a7 [DO NOT MERGE] sunxi: psci: Delegate PSCI to SCPI
This adds a new PSCI implementation which communicates with SCP firmware
running on the AR100 using the SCPI protocol. This allows it to support
the full set of PSCI v1.1 features, including CPU idle states, system
suspend, and multiple reset methods.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:00 -05:00
Samuel Holland
d9e45f57c3 arm: psci: Add definitions for PSCI v1.1
Add the new option, function IDs, and prototypes for PSCI v1.1
implementations. In the process, fix some issues with the existing
definitions:
 - Fix the incorrectly-named ARM_PSCI_0_2_FN64_SYSTEM_RESET2.
 - Replace the deprecated "affinity_level" naming with "power_level".

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:00 -05:00
Samuel Holland
034ec99c5e sunxi: Enable support for SCP firmware on H3
Now that issues with the BROM have been sorted out, we can implement
PSCI system suspend on H3 by delegating to SCP firmware. Let's start by
including the firmware in the FIT image and starting the coprocessor if
valid firmware is loaded.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:41:00 -05:00
Samuel Holland
2d34b58467 arm: dts: sunxi: h3: Add nodes for AR100 remoteproc
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:40:59 -05:00
Samuel Holland
23f4c3ad21 sunxi: psci: Add support for H3 CPU 0 hotplug
Due to a bug in the H3 SoC, where the CPU 0 hotplug flag cannot be
written, resuming CPU 0 requires using the "Super Standby" code path in
the BROM instead of the hotplug path. This path requires jumping to an
eGON image in SRAM.

Add support to the build system to generate this eGON image and include
it in the FIT, and add code to direct the BROM to its location in SRAM.

Since the Super Standby code path in the BROM initializes the CPU and
AHB1 clocks to 24 MHz, those registers need to be restored after control
passes back to U-Boot. Furthermore, because the BROM lowers the AHB1
clock divider to /1 before switching to the lower-frequency parent,
PLL_PERIPH0 must be bypassed to prevent AHB1 from temporarily running at
600 MHz. Otherwise, this locks up the SoC.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:40:59 -05:00
Samuel Holland
14de263f01 sunxi: psci: Avoid hanging when CPU 0 is hot-unplugged
Do not try to send an SGI from CPU 0 to itself. Since FIQs are masked
when entering monitor mode, this will hang. Plus, CPU 0 cannot fully
power itself off anyway. Instead, have it turn FIQs back on and continue
servicing SGIs from other cores.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:40:59 -05:00
Samuel Holland
883e3ec5d6 sunxi: binman: Enable SPL FIT loading for 32-bit SoCs
Now that Crust (SCP firmware) has support for H3, we need a FIT image to
load it. H3 also needs to load a SoC-specific eGon blob to support CPU 0
hotplug. Let's first enable FIT support before adding extra firmware.

Update the binman description to work on either 32-bit or 64-bit SoCs:
 - Make BL31 optional, since it is not used on 32-bit SoCs (though BL32
   may be used in the future).
 - Explicitly set the minimum offset of the FIT to 32 KiB, since SPL on
   some boards is still only 24 KiB large even with FIT support enabled.
   CONFIG_SPL_PAD_TO cannot be used because it is not defined for H616.

FIT unlocks more features (signatures, multiple DTBs, etc.), so enable
it by default. A10 (sun4i) only has 24 KiB of SRAM A1, so it needs
SPL_FIT_IMAGE_TINY. For simplicity, enable that option everywhere.

Cover-letter:
sunxi: SPL FIT support for 32-bit sunxi SoCs
This series makes the necessary changes so 32-bit sunxi SoCs can load
additional device trees or firmware from SPL along with U-Boot proper.

There was no existing binman entry property that put the FIT at the
right offset. The minimum offset is 32k, but this matches neither the
SPL size (which is no more than 24k on some SoCs) nor the FIT alignment
(which is 512 bytes in practice due to SPL size constraints). So instead
of adding a new property, I fixed what is arguably a bug in the offset
property -- though this strategy will not work if someone is
intentionally creating overlapping entries.
END
Series-to: sunxi
Series-to: sjg
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:40:56 -05:00
Samuel Holland
1df68d855e sunxi: DT: H6: Add USB3 to Pine H64 DTS
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:40:48 -05:00
Samuel Holland
b0970fa866 sunxi: DT: H6: Add device tree for Pine H64 Model B
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:40:48 -05:00
Samuel Holland
30b63a325a sunxi: Support building a SPL as a TOC0 image
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.

Cover-letter:
sunxi: TOC0 image type support
This series adds support for the TOC0 image format used by the Allwinner
secure boot ROM (SBROM). This series has been tested on the following
SoCs/boards, with the eFuse burnt to enable secure mode:
 - A50: Ainol Q88 Tablet
 - A64: Pine A64 Plus
 - H5: Orange Pi Zero Plus
 - H6: Pine H64 Model B
 - H616: Orange Pi Zero 2

This time I also tested it on boards that are not switched to secure
mode (with A64, H3, and H5).

Due to both series changing Makefile.spl, the last patch depends on:
https://patchwork.ozlabs.org/project/uboot/list/?series=267136
I have seen no comments on that series, so I assume that it is ready to
merge along with this one.
END

Series-to: sunxi
Series-version: 5
Series-changes: 2
 - Rebase on top of Icenowy's RISC-V support series
 - Rename Kconfig symbols to include the full image type name

Cover-changes: 5
 - Dropped controversial Kconfig patch

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:37:54 -05:00
Samuel Holland
05b49d1dbf sunxi: Support SPL in both eGON and TOC0 images
SPL uses the image header to detect the boot device and to find the
offset of the next U-Boot stage. Since this information is stored
differently in the eGON and TOC0 image headers, add code to find the
correct value based on the image type currently in use.

Series-changes: 2
 - Moved SPL header signature checks out of sunxi_image.h
 - Refactored SPL header signature checks to use fewer casts

Series-changes: 3
 - Fixed offset of magic passed to memcmp
 - Refactored functions to not return pointers (fixes ambiguous NULL)

Series-changes: 5
 - Rebased on top of suniv platform additions
 - Took care of additional hardcoded offset in SPL SPI code

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 23:37:47 -05:00
Samuel Holland
bbcc2c8bd0 pwm: sunxi: Remove non-DM pin setup
This is now handled automatically by the pinctrl driver.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 22:44:53 -05:00
Samuel Holland
adf439e8f0 sunxi: Remove options and setup code for I2C2-I2C4
These options are not currently enabled anywhere. Any new users should
use DM clocks and pinctrl.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 22:44:53 -05:00
Samuel Holland
5ee5d5a220 sunxi: Remove non-DM GMAC pin setup
This is now handled automatically by the pinctrl driver.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-03-17 22:44:53 -05:00