forked from armbian/build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add community support for LonganPi 3H
- Loading branch information
Showing
6 changed files
with
605 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Allwinner H618 quad core 1GB/2GB/4GB RAM | ||
BOARD_NAME="Longan Pi 3H" | ||
BOARDFAMILY="sun50iw9" | ||
BOARD_MAINTAINER="" | ||
BOOTCONFIG="longanpi_3h_defconfig" | ||
BOOTBRANCH="tag:v2024.10" | ||
BOOTPATCHDIR="v2024.10" | ||
BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory | ||
BOOT_LOGO="desktop" | ||
OVERLAY_PREFIX="sun50i-h616" | ||
KERNEL_TARGET="current,edge" | ||
KERNEL_TEST_TARGET="current" | ||
FORCE_BOOTSCRIPT_UPDATE="yes" | ||
enable_extension "radxa-aic8800" # compatible with radxa-aic8800 | ||
AIC8800_TYPE="usb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
272 changes: 272 additions & 0 deletions
272
patch/kernel/archive/sunxi-6.6/patches.armbian/Add-board-LonganPi-3H.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,272 @@ | ||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h618-longan-module-3h.dtsi | ||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-longan-module-3h.dtsi | ||
@@ -0,0 +1,87 @@ | ||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) | ||
+/* | ||
+ * Copyright (C) Jisheng Zhang <[email protected]> | ||
+ */ | ||
+ | ||
+/dts-v1/; | ||
+ | ||
+#include "sun50i-h616.dtsi" | ||
+#include "sun50i-h616-cpu-opp.dtsi" | ||
+ | ||
+/ { | ||
+ model = "Sipeed Longan Module 3H"; | ||
+ compatible = "sipeed,longan-module-3h", "allwinner,sun50i-h618"; | ||
+}; | ||
+ | ||
+&cpu0 { | ||
+ cpu-supply = <®_dcdc2>; | ||
+}; | ||
+ | ||
+&mmc2 { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&mmc2_pins>; | ||
+ vmmc-supply = <®_dldo1>; | ||
+ vqmmc-supply = <®_aldo1>; | ||
+ bus-width = <8>; | ||
+ non-removable; | ||
+ cap-mmc-hw-reset; | ||
+ mmc-ddr-1_8v; | ||
+ mmc-hs200-1_8v; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&r_i2c { | ||
+ status = "okay"; | ||
+ | ||
+ axp313: pmic@36 { | ||
+ compatible = "x-powers,axp313a"; | ||
+ reg = <0x36>; | ||
+ | ||
+ regulators { | ||
+ /* Supplies VCC-PLL, so needs to be always on. */ | ||
+ reg_aldo1: aldo1 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <1800000>; | ||
+ regulator-max-microvolt = <1800000>; | ||
+ regulator-name = "vcc1v8"; | ||
+ }; | ||
+ | ||
+ /* Supplies VCC-IO, so needs to be always on. */ | ||
+ reg_dldo1: dldo1 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ regulator-name = "vcc3v3"; | ||
+ }; | ||
+ | ||
+ reg_dcdc1: dcdc1 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <810000>; | ||
+ regulator-max-microvolt = <990000>; | ||
+ regulator-name = "vdd-gpu-sys"; | ||
+ }; | ||
+ | ||
+ reg_dcdc2: dcdc2 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <810000>; | ||
+ regulator-max-microvolt = <1100000>; | ||
+ regulator-name = "vdd-cpu"; | ||
+ }; | ||
+ | ||
+ reg_dcdc3: dcdc3 { | ||
+ regulator-always-on; | ||
+ regulator-min-microvolt = <1100000>; | ||
+ regulator-max-microvolt = <1100000>; | ||
+ regulator-name = "vdd-dram"; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+}; | ||
+ | ||
+&pio { | ||
+ vcc-pc-supply = <®_dldo1>; | ||
+ vcc-pf-supply = <®_dldo1>; | ||
+ vcc-pg-supply = <®_aldo1>; | ||
+ vcc-ph-supply = <®_dldo1>; | ||
+ vcc-pi-supply = <®_dldo1>; | ||
+}; | ||
|
||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h618-longanpi-3h.dts | ||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-longanpi-3h.dts | ||
@@ -0,0 +1,168 @@ | ||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) | ||
+/* | ||
+ * Copyright (C) Jisheng Zhang <[email protected]> | ||
+ */ | ||
+ | ||
+/dts-v1/; | ||
+ | ||
+#include "sun50i-h618-longan-module-3h.dtsi" | ||
+ | ||
+#include <dt-bindings/gpio/gpio.h> | ||
+#include <dt-bindings/interrupt-controller/arm-gic.h> | ||
+#include <dt-bindings/leds/common.h> | ||
+ | ||
+/ { | ||
+ model = "Sipeed Longan Pi 3H"; | ||
+ compatible = "sipeed,longan-pi-3h", "sipeed,longan-module-3h", "allwinner,sun50i-h618"; | ||
+ | ||
+ aliases { | ||
+ ethernet0 = &emac0; | ||
+ serial0 = &uart0; | ||
+ }; | ||
+ | ||
+ chosen { | ||
+ stdout-path = "serial0:115200n8"; | ||
+ }; | ||
+ | ||
+ reserved-memory { | ||
+ linux,cma { | ||
+ compatible = "shared-dma-pool"; | ||
+ reusable; | ||
+ alloc-ranges = <0x0 0x40000000 0x0 0xffffffff>; | ||
+ size = <0x0 0x8000000>; | ||
+ linux,cma-default; | ||
+ }; | ||
+ }; | ||
+ | ||
+ hdmi_connector: connector { | ||
+ compatible = "hdmi-connector"; | ||
+ type = "a"; | ||
+ | ||
+ port { | ||
+ hdmi_con_in: endpoint { | ||
+ remote-endpoint = <&hdmi_out_con>; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+ | ||
+ leds { | ||
+ compatible = "gpio-leds"; | ||
+ | ||
+ led-0 { | ||
+ color = <LED_COLOR_ID_ORANGE>; | ||
+ function = LED_FUNCTION_INDICATOR; | ||
+ function-enumerator = <0>; | ||
+ gpios = <&pio 6 2 GPIO_ACTIVE_LOW>; /* PG2 */ | ||
+ }; | ||
+ | ||
+ led-1 { | ||
+ color = <LED_COLOR_ID_ORANGE>; | ||
+ function = LED_FUNCTION_INDICATOR; | ||
+ function-enumerator = <1>; | ||
+ gpios = <&pio 6 4 GPIO_ACTIVE_LOW>; /* PG4 */ | ||
+ }; | ||
+ }; | ||
+ | ||
+ reg_vcc5v: vcc5v { | ||
+ /* board wide 5V supply directly from the USB-C socket */ | ||
+ compatible = "regulator-fixed"; | ||
+ regulator-name = "vcc-5v"; | ||
+ regulator-min-microvolt = <5000000>; | ||
+ regulator-max-microvolt = <5000000>; | ||
+ regulator-always-on; | ||
+ }; | ||
+}; | ||
+ | ||
+&axp313 { | ||
+ vin1-supply = <®_vcc5v>; | ||
+ vin2-supply = <®_vcc5v>; | ||
+ vin3-supply = <®_vcc5v>; | ||
+}; | ||
+ | ||
+&de { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&ehci1 { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&ohci1 { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&ehci2 { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&ohci2 { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&ehci3 { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&ohci3 { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&emac0 { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&ext_rgmii_pins>; | ||
+ phy-mode = "rgmii"; | ||
+ phy-handle = <&ext_rgmii_phy>; | ||
+ allwinner,rx-delay-ps = <3100>; | ||
+ allwinner,tx-delay-ps = <700>; | ||
+ phy-supply = <®_dldo1>; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&hdmi { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&hdmi_out { | ||
+ hdmi_out_con: endpoint { | ||
+ remote-endpoint = <&hdmi_con_in>; | ||
+ }; | ||
+}; | ||
+ | ||
+&mdio0 { | ||
+ ext_rgmii_phy: ethernet-phy@1 { | ||
+ compatible = "ethernet-phy-ieee802.3-c22"; | ||
+ reg = <1>; | ||
+ }; | ||
+}; | ||
+ | ||
+&mmc0 { | ||
+ bus-width = <4>; | ||
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ | ||
+ vmmc-supply = <®_dldo1>; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&uart0 { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&usbotg { | ||
+ /* | ||
+ * PHY0 pins are connected to a USB-C socket, but a role switch | ||
+ * is not implemented: both CC pins are pulled to GND. | ||
+ * The VBUS pins power the device, so a fixed peripheral mode | ||
+ * is the best choice. | ||
+ * The board can be powered via GPIOs, in this case port0 *can* | ||
+ * act as a host (with a cable/adapter ignoring CC), as VBUS is | ||
+ * then provided by the GPIOs. Any user of this setup would | ||
+ * need to adjust the DT accordingly: dr_mode set to "host", | ||
+ * enabling OHCI0 and EHCI0. | ||
+ */ | ||
+ dr_mode = "peripheral"; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&usbphy { | ||
+ usb1_vbus-supply = <®_vcc5v>; | ||
+ status = "okay"; | ||
+}; | ||
|
||
--- a/arch/arm64/boot/dts/allwinner/Makefile | ||
+++ b/arch/arm64/boot/dts/allwinner/Makefile | ||
@@ -57,6 +57,7 @@ | ||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-sd.dtb | ||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-emmc.dtb | ||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-bananapi-m4-zero.dtb | ||
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-longanpi-3h.dtb | ||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero3.dtb | ||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w.dtb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.