23484 Commits

Author SHA1 Message Date
Samuel Holland
6514cdce83 t113
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-27 23:43:24 -06:00
Samuel Holland
3f3b76b374 debugging for timers and cpuidle
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:09:44 -06:00
Samuel Holland
d9e3a074d4 usb: musb-new: Hack up the driver for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:52 -06:00
Samuel Holland
18136f0549 mmc: sunxi: Hack up the driver for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:25 -06:00
Samuel Holland
cab12cb662 gpio: sunxi: Hack up the driver for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:25 -06:00
Samuel Holland
5ca9b18e80 riscv: Add CONFIG_TARGET_SUN20I_D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:25 -06:00
Samuel Holland
f831098f4b riscv: Add Allwinner D1 devicetrees
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:25 -06:00
Samuel Holland
5eb1b51d44 riscv: Sort target configs alphabetically
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-23 22:30:26 -06:00
Samuel Holland
97e7958624 riscv: cpu: Add cache operations for T-HEAD CPUs
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-23 22:30:26 -06:00
Samuel Holland
a0f647f3ec Merge branch 'patch/phy-default' into allwinner
# Conflicts:
#	drivers/phy/allwinner/Kconfig
2022-11-19 14:12:02 -06:00
Samuel Holland
9100108086 Merge branch 'patch/h6-dts' into allwinner 2022-11-19 14:11:50 -06:00
Samuel Holland
a5cfaade60 Merge branch 'patch/h3-scp' into allwinner 2022-11-19 14:11:48 -06:00
Samuel Holland
74121abfcf Merge branch 'patch/h3-fit' into allwinner
# Conflicts:
#	arch/arm/Kconfig
2022-11-19 14:11:45 -06:00
Samuel Holland
9de21aadde Merge branch 'patch/dm-video' into allwinner 2022-11-19 14:11:36 -06:00
Samuel Holland
80f0078f1d Merge branch 'patch/d1-mmc' into allwinner
# Conflicts:
#	arch/arm/mach-sunxi/Kconfig
#	configs/A13-OLinuXinoM_defconfig
#	configs/A13-OLinuXino_defconfig
#	configs/A20-OLinuXino-Lime2_defconfig
#	configs/A20-Olimex-SOM204-EVB_defconfig
#	configs/A33-OLinuXino_defconfig
#	configs/Ainol_AW1_defconfig
#	configs/Ampe_A76_defconfig
#	configs/Cubietruck_defconfig
#	configs/Empire_electronix_d709_defconfig
#	configs/Empire_electronix_m712_defconfig
#	configs/Wobo_i5_defconfig
#	configs/Yones_Toptech_BS1078_V2_defconfig
#	configs/bananapi_m2_berry_defconfig
#	configs/colorfly_e708_q1_defconfig
#	configs/difrnce_dit4350_defconfig
#	configs/dserve_dsrv9703c_defconfig
#	configs/gt90h_v4_defconfig
#	configs/iNet_3F_defconfig
#	configs/iNet_3W_defconfig
#	configs/iNet_D978_rev2_defconfig
#	configs/icnova-a20-swac_defconfig
#	configs/inet86dz_defconfig
#	configs/inet98v_rev2_defconfig
#	configs/inet_q972_defconfig
#	configs/polaroid_mid2407pxe03_defconfig
#	configs/polaroid_mid2809pxe04_defconfig
#	configs/q8_a13_tablet_defconfig
#	configs/q8_a23_tablet_800x480_defconfig
#	configs/q8_a33_tablet_1024x600_defconfig
#	configs/q8_a33_tablet_800x480_defconfig
2022-11-19 14:11:24 -06:00
Samuel Holland
0c0b21f4c3 Merge branch 'patch/d1-kconfig' into allwinner
# Conflicts:
#	arch/arm/mach-sunxi/Kconfig
2022-11-19 14:11:06 -06:00
Samuel Holland
a90eae8771 Merge branch 'patch/a33-tablet-dts' into allwinner 2022-11-19 14:10:45 -06:00
Samuel Holland
c155d403bd 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-11-19 14:04:15 -06:00
Samuel Holland
f0f00889ba 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-11-19 14:04:15 -06:00
Samuel Holland
f8d161afe1 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-11-19 14:04:01 -06:00
Samuel Holland
7558426f0a gpio: axp: 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-11-19 14:04:01 -06:00
Samuel Holland
c0980c4085 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-11-19 14:04:01 -06:00
Samuel Holland
5872a5833a 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-11-19 14:02:30 -06:00
Samuel Holland
b2de8987c4 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-11-19 14:01:35 -06:00
Samuel Holland
83f74385e7 sunxi: Enable PHY_SUN4I_USB by default for new SoCs
With one exception (sun9i), all sunxi SoCs released to date use variants
of the same USB PHY. Instead of requiring each new SoC to duplicate the
PHY driver selection, enable it by default.

Series-to: Andre Przywara <andre.przywara@arm.com>
Series-to: Jagan Teki <jagan@amarulasolutions.com>

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:54:23 -06:00
Samuel Holland
c85ce9dd15 sunxi: DT: H6: Add USB3 to Pine H64 DTS
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:54:22 -06:00
Samuel Holland
bd49d84c5c [DO NOT MERGE] sunxi: Enable SCP/SCPI on A33 as well
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:54:22 -06:00
Samuel Holland
5d099ad0d8 [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-11-16 22:54:22 -06:00
Samuel Holland
d00443fe3b 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-11-16 22:54:22 -06:00
Samuel Holland
de71a3426b 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-11-16 22:54:22 -06:00
Samuel Holland
a7c5427fe5 arm: dts: sunxi: h3: Add nodes for AR100 remoteproc
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:54:22 -06:00
Samuel Holland
df8623e2a3 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-11-16 22:54:22 -06:00
Samuel Holland
018c08769b 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-11-16 22:54:22 -06:00
Samuel Holland
2909ab0638 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-11-16 22:54:16 -06:00
Samuel Holland
532699da95 video: sunxi: Move headers out of asm/arch
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:26 -06:00
Samuel Holland
ab4bddadb6 sunxi: mmc: Move header to the driver directory
The MMC controller driver is (and ought to be) the only user of these
register definitions. Put them in a header next to the driver to remove
the dependency on a specific ARM platform's headers.

Due to the sunxi_mmc_init() prototype, the file was not renamed. None of
the register definitions were changed.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:25 -06:00
Andre Przywara
80f0c82768 sunxi: remove CONFIG_MMC?_CD_PIN
For legacy reasons we were defining the card detect GPIO for all sunxi
boards in each board's defconfig.
There is actually no need for a card-detect check in the SPL code (which
consequently has been removed already), and also in U-Boot proper we
have DM code to query the CD GPIO name from the device tree.

That means we don't have any user of that information left, so can
remove the definitions from the defconfigs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-11-16 22:53:25 -06:00
Samuel Holland
6738a902c4 sunxi: Move most board options to the board Kconfig
This excludes options that are inherently ARM-specific or are specific
to legacy non-DM drivers.

Some help text is cleaned up along the way.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:25 -06:00
Samuel Holland
ba6af60953 sunxi: Move default values to the board Kconfig
This keeps all of the defaults for sunxi platforms in one place. Most of
these only depend on architecture-independent features of the SoC (clock
tree or SRAM layout) anyway.

No functional change; just some minor help text cleanup.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:25 -06:00
Samuel Holland
4eb8b45587 sunxi: Globally enable SUPPORT_SPL
This was already supported by every machine type. It is unlikely that
any new SoC support will be added without SPL support.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:24 -06:00
Samuel Holland
3a8d574ec8 sunxi: Move most Kconfig selections to the board Kconfig
To maintain consistent behavior across architectures, most of the
options selected by ARCH_SUNXI should be selected for the D1 SoC as
well. To accomplish this, select them from BOARD_SUNXI instead.

No functional change here. Lines are only moved and alphabetized.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:24 -06:00
Samuel Holland
087fb52914 sunxi: Share the board Kconfig across architectures
With the introduction of the Allwinner D1, the sunxi board family now
spans multiple architectures (ARM and RISC-V). Since ARCH_SUNXI depends
on ARM, it cannot be used to gate architecture-independent options.
Specifically, this means the board Kconfig file cannot be sourced from
inside the "if ARCH_SUNXI" block.

Introduce a new BOARD_SUNXI symbol that can be selected by both
ARCH_SUNXI now and the new RISC-V SoC symbols when they are added, and
use it to gate the architecture-independent board options.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:24 -06:00
Samuel Holland
a085dfa27e sunxi: Add missing dependencies to Kconfig selections
Some of the selected symbols have a user-visible dependency. Make the
selections conditional on that dependency to avoid creating invalid
configurations.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:24 -06:00
Samuel Holland
69391b0b49 sunxi: Remove unnecessary Kconfig selections
Two of these selections are redundant and have no effect:
 - DM_KEYBOARD is selected by USB_KEYBOARD
 - DM_MMC is selected by MMC

This selection has no effect by default and is unnecessarily strong:
 - USB_STORAGE is implied by DISTRO_DEFAULTS

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:24 -06:00
Samuel Holland
b9d74ac18f sunxi: Fix default-enablement of USB host drivers
We tried to enable USB_EHCI_GENERIC and USB_OHCI_GENERIC by default.
This did not work because those symbols depend on USB_EHCI_HCD and
USB_OHCI_HCD, which were not enabled. Fix this by implying all four.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:53:24 -06:00
Samuel Holland
7b9c9d6a2d Adapt iNet U70B REV01 for development (FEL + serial)
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:46:02 -06:00
Samuel Holland
d6141e5904 ARM: dts: sun8i: A33: Add iNet U70B REV01
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-16 22:46:02 -06:00
Heinrich Schuchardt
5c89467262 riscv: clarify meaning of CONFIG_SBI_V02
Describe that CONFIG_SBI_V02=y does not mean SBI specification v0.2
but v0.2 or later.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2022-11-15 15:37:17 +08:00
Yu Chien Peter Lin
c277c787a0 riscv: Fix detecting FPU support in standard extension
We should check the string until it hits underscore, in case it
searches multi-letter extensions. For example, "rv64imac_xandes"
will be treated as D extension support since there is a "d" in
"andes", resulting illegal instruction caused by initializing FCSR.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Reviewed-by: Samuel Holland <samuel@sholland.org>
2022-11-15 15:37:17 +08:00
Conor Dooley
3f3527044d riscv: dts: fix the mpfs's reference clock frequency
The initial devicetree for PolarFire SoC incorrectly created a fixed
frequency clock in the devicetree to represent the msspll, but the
msspll is not a fixed frequency clock. The actual reference clock on a
board is either 125 or 100 MHz, 125 MHz in the case of the icicle kit.
Swap the incorrect representation of the msspll out for the actual
reference clock.

Fixes: dd4ee416a6 ("riscv: dts: Add device tree for Microchip Icicle Kit")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
2022-11-15 15:37:17 +08:00