22124 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
5a45c8ded0 awboot hal 2022-11-27 23:26:30 -06:00
Samuel Holland
b56e30a513 Revert "ram: sunxi: Switch to the assembly version for D1s"
This reverts commit 7ef55045cf8a28c638115274030a40ca716b9248.
2022-11-27 13:33:25 -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
f3f69462eb [BROKEN] spi: sunxi: Add support for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:52 -06:00
Samuel Holland
9b375cf652 spi: sunxi: 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
7ef55045cf ram: sunxi: Switch to the assembly version for D1s
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:52 -06:00
Samuel Holland
a8e70b5006 ram: sunxi: Add Allwinner D1 DRAM driver
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:52 -06:00
Samuel Holland
15733d9073 pinctrl: sunxi: 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
88612316a6 squash! pinctrl: sunxi: Add support for the D1
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-25 19:07:49 -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
8bdf212419 clk: sunxi: d1: Set CPU frequency in SPL
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
cc25e4b200 video: sunxi: Probe DE2 bus via DT
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 15:19:31 -06:00
Samuel Holland
8dd7667662 fixup! power: regulator: Add a driver for AXP PMIC regulators 2022-11-19 14:29:23 -06:00
Samuel Holland
674a881ed2 clk: sunxi: Add DE2 clock driver
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:13:23 -06:00
Samuel Holland
1b4ba6d64f Merge branch 'patch/rsb-pinmux' into allwinner 2022-11-19 14:12:15 -06:00
Samuel Holland
5d37482b66 Merge branch 'patch/phy-supply' into allwinner 2022-11-19 14:12:06 -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
e046a16e0c Merge branch 'patch/nand-dm' into allwinner 2022-11-19 14:11:58 -06:00
Samuel Holland
cac270721a Merge branch 'patch/musb-charging' into allwinner
# Conflicts:
#	drivers/phy/allwinner/phy-sun4i-usb.c
2022-11-19 14:11:56 -06:00
Samuel Holland
a5cfaade60 Merge branch 'patch/h3-scp' into allwinner 2022-11-19 14:11:48 -06:00
Samuel Holland
481d60fb72 Merge branch 'patch/fdt-bounds-check' into allwinner 2022-11-19 14:11:38 -06:00
Samuel Holland
9de21aadde Merge branch 'patch/dm-video' into allwinner 2022-11-19 14:11:36 -06:00
Samuel Holland
989565c387 Merge branch 'patch/dm-fixes' into allwinner 2022-11-19 14:11:34 -06:00
Samuel Holland
a3c10a3f40 Merge branch 'patch/d1-serial' into allwinner 2022-11-19 14:11:32 -06:00
Samuel Holland
30f0e7ec94 Merge branch 'patch/d1-pinctrl' into allwinner 2022-11-19 14:11:29 -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
297bffd7a4 Merge branch 'patch/d1-emac' into allwinner 2022-11-19 14:10:52 -06:00
Samuel Holland
d2108bd250 Merge branch 'patch/d1-clk' into allwinner 2022-11-19 14:10:50 -06:00
Samuel Holland
ba4a5cea84 Merge branch 'patch/clk-prcm' into allwinner 2022-11-19 14:10:47 -06:00
Samuel Holland
29c3ea2af4 net: sun8i_emac: Enable PHY supply regulator
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:07:22 -06:00
Samuel Holland
5fb82d5259 net: sun8i_emac: Drop DM_GPIO checks
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:07:19 -06:00
Samuel Holland
7d4d7abf13 video: sunxi: dw-hdmi: Enable HVCC regulator
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:06:56 -06:00
Samuel Holland
1d46e7d857 video: sunxi: dw-hdmi: Probe via devicetree
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:06:53 -06:00
Samuel Holland
364ed57486 gpio: axp: Report the correct value for outputs
Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:04:16 -06:00
Samuel Holland
9c41280c77 gpio: axp: Add pull-down support for AXP22x/AXP8xx variant
The AXP221 and newer PMICs support a pull-down function on their GPIOs.
Add support for it.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:04:15 -06:00
Samuel Holland
3f7891e101 gpio: axp: Add support for getting the pin function
Implement the .get_function operation, so the gpio command can report
the current function. Since the GPIOF_FUNC (versus GPIOF_UNUSED) mux
values vary among the PMICs, report all non-GPIO mux values as UNKNOWN.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:04:15 -06:00
Samuel Holland
8fc95ae528 gpio: axp: Select variant from compatible at runtime
There are three major variants of the AXP PMIC GPIO functionality (plus
PMICs with no GPIOs at all). Except for GPIO3 on the AXP209, which uses
a different register layout, it is straightforward to support all three
variants with a single driver. Do this, and in the process remove the
GPIO-related definitions from the PMIC-specific headers, and therefore
the dependency on AXP_PMIC_BUS.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:04:15 -06:00
Samuel Holland
c9610b8811 gpio: axp: Use DM_PMIC functions for register access
Now that the PMIC driver implements the DM_PMIC uclass, those functions
can be used instead of the platform-specific "pmic_bus" functions.

Since the driver still uses the single set of register definitions from
axpXXX.h (as selected by AXPxxx_POWER), it still depends on one of those
choices, and therefore also AXP_PMIC_BUS.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:04:15 -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
fedd874229 gpio: axp: Consistently use the "axp_gpio" order
This is less confusing than half of the driver using "axp_gpio" and the
other half using "gpio_axp".

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
38a35bb561 phy: sun4i-usb: Control USB supplies via regulator uclass
The device tree binding for the PHY provides VBUS supplies as regulator
references. Now that all boards have the appropriate regulator uclass
drivers enabled, the PHY driver can switch to using them. This replaces
direct GPIO usage, which in some cases needed a special DM-incompatible
"virtual" GPIO from the PMIC.

The following boards provided a value for CONFIG_USB0_VBUS_PIN, but are
missing the "usb0_vbus-supply" property in their device tree. None of
them have the MUSB controller enabled in host or OTG mode, so they
should see no impact:
 - Ainol_AW1_defconfig / sun7i-a20-ainol-aw1
 - Ampe_A76_defconfig / sun5i-a13-ampe-a76
 - CHIP_pro_defconfig / sun5i-gr8-chip-pro
 - Cubieboard4_defconfig / sun9i-a80-cubieboard4
 - Merrii_A80_Optimus_defconfig / sun9i-a80-optimus
 - Sunchip_CX-A99_defconfig / sun9i-a80-cx-a99
 - Yones_Toptech_BD1078_defconfig / sun7i-a20-yones-toptech-bd1078
 - Yones_Toptech_BS1078_V2_defconfig /
   sun6i-a31s-yones-toptech-bs1078-v2
 - iNet_3F_defconfig / sun4i-a10-inet-3f
 - iNet_3W_defconfig / sun4i-a10-inet-3w
 - iNet_86VS_defconfig / sun5i-a13-inet-86vs
 - iNet_D978_rev2_defconfig / sun8i-a33-inet-d978-rev2
 - icnova-a20-swac_defconfig / sun7i-a20-icnova-swac
 - sun8i_a23_evb_defconfig / sun8i-a23-evb

Similarly, the following boards set CONFIG_USB1_VBUS_PIN, but do not
have "usb1_vbus-supply" in their device tree. Neither of them have USB
enabled at all, so again there should be no impact:
 - Cubieboard4_defconfig / sun9i-a80-cubieboard4 (also for USB3)
 - sun8i_a23_evb_defconfig / sun8i-a23-evb

The following boards use a different pin for USB1 VBUS between their
defconfig and their device tree. Depending on which is correct, they
may be broken:
 - Linksprite_pcDuino3_Nano_defconfig (PH11) /
   sun7i-a20-pcduino3-nano (PD2)
 - icnova-a20-swac_defconfig (PG10) / sun7i-a20-icnova-swac (PH6)

Finally, this board has conflicting pins given for its USB2 VBUS:
 - Lamobo_R1_defconfig (PH3) / sun7i-a20-lamobo-r1 (PH12)

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:04:01 -06:00
Samuel Holland
e4fd49ae30 power: regulator: Add a driver for the AXP PMIC drivevbus
The first AXP regulator converted to use the regulator uclass is the
drivevbus switch, since it is used by the USB PHY driver.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:03:50 -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
6a3f736b65 power: regulator: Add a driver for the AXP USB power supply
This driver reports the presence/absence of voltage on the PMIC's USB
VBUS pin. This information is used by the USB PHY driver. The
corresponding Linux driver uses the power supply class, which does not
exist in U-Boot. UCLASS_REGULATOR seems to be the closest match.

Signed-off-by: Samuel Holland <samuel@sholland.org>
2022-11-19 14:02:29 -06:00