Add PINE H64 Model B.

ok kn@
This commit is contained in:
kevlo 2022-01-15 11:56:50 +00:00
parent 8f51967414
commit 8e4c428f50
5 changed files with 128 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.89 2021/12/17 23:00:41 jsg Exp $
# $OpenBSD: Makefile,v 1.90 2022/01/15 11:56:50 kevlo Exp $
BROKEN-sparc64= Error: the specified option is not accepted in ISB at operand 1 -- isb sy
BROKEN-arm= lib/time.c:187:1: internal compiler error: Bus error
@ -8,7 +8,7 @@ FLAVOR?= arm
COMMENT= U-Boot firmware
VERSION= 2021.10
REVISION= 2
REVISION= 3
DISTNAME= u-boot-${VERSION}
PKGNAME= u-boot-${FLAVOR}-${VERSION:S/-//}
FULLPKGNAME= ${PKGNAME}
@ -39,11 +39,12 @@ MAKE_ENV= KBUILD_VERBOSE=1 \
.if "${FLAVOR}" == "aarch64"
BUILD_DEPENDS+= devel/arm-none-eabi/gcc-linaro,aarch64 \
devel/py-elftools \
sysutils/arm-trusted-firmware>=2.2v0
sysutils/arm-trusted-firmware>=2.2p0v0
MAKE_ENV+= CROSS_COMPILE="aarch64-none-elf-"
RK3328_BL31= "${LOCALBASE}/share/arm-trusted-firmware/rk3328-bl31.elf"
RK3399_BL31= "${LOCALBASE}/share/arm-trusted-firmware/rk3399-bl31.elf"
SUNXI_BL31= "${LOCALBASE}/share/arm-trusted-firmware/sun50i_a64-bl31.bin"
SUNXI_H6_BL31= "${LOCALBASE}/share/arm-trusted-firmware/sun50i_h6-bl31.bin"
.elif "${FLAVOR}" == "arm"
BUILD_DEPENDS+= devel/arm-none-eabi/gcc-linaro>=7.4.2019.02
MAKE_ENV+= CROSS_COMPILE="arm-none-eabi-"
@ -69,6 +70,7 @@ SUNXI64=\
orangepi_zero_plus \
pine64-lts \
pine64_plus \
pine_h64-model-b \
pinebook \
sopine_baseboard
BOARDS=\
@ -203,6 +205,16 @@ do-build:
.endif
.endfor
.for BOARD in ${SUNXI64}
.if "${BOARD:M*_h64*}"
cd ${WRKSRC} && \
mkdir -p build/${BOARD} && \
${SETENV} ${MAKE_ENV} BL31=${SUNXI_H6_BL31} ${MAKE_PROGRAM} \
${MAKE_FLAGS} O="build/${BOARD}" \
-f ${MAKE_FILE} "${BOARD}"_defconfig && \
${SETENV} ${MAKE_ENV} BL31=${SUNXI_H6_BL31} ${MAKE_PROGRAM} \
${MAKE_FLAGS} O="build/${BOARD}" \
-f ${MAKE_FILE} ${ALL_TARGET}
.else
cd ${WRKSRC} && \
mkdir -p build/${BOARD} && \
${SETENV} ${MAKE_ENV} BL31=${SUNXI_BL31} ${MAKE_PROGRAM} \
@ -211,6 +223,7 @@ do-build:
${SETENV} ${MAKE_ENV} BL31=${SUNXI_BL31} ${MAKE_PROGRAM} \
${MAKE_FLAGS} O="build/${BOARD}" \
-f ${MAKE_FILE} ${ALL_TARGET}
.endif
if [[ -f ${WRKSRC}/build/${BOARD}/spl/sunxi-spl.bin && \
-f ${WRKSRC}/build/${BOARD}/u-boot.itb ]]; then \
cd ${WRKSRC}/build/${BOARD} && \

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-arch_arm_dts_Makefile,v 1.1 2022/01/15 11:56:50 kevlo Exp $
Hook up the dtb to the build for PINE H64 model B.
Index: arch/arm/dts/Makefile
--- arch/arm/dts/Makefile.orig
+++ arch/arm/dts/Makefile
@@ -642,6 +642,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \
sun50i-h6-orangepi-lite2.dtb \
sun50i-h6-orangepi-one-plus.dtb \
sun50i-h6-pine-h64.dtb \
+ sun50i-h6-pine-h64-model-b.dtb \
sun50i-h6-tanix-tx6.dtb
dtb-$(CONFIG_MACH_SUN50I_H616) += \
sun50i-h616-orangepi-zero2.dtb

View File

@ -0,0 +1,60 @@
$OpenBSD: patch-arch_arm_dts_sun50i-h6-pine-h64-model-b_dts,v 1.1 2022/01/15 11:56:50 kevlo Exp $
Copy the device tree file for PINE H64 model B from Linux kernel:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64-model-b.dts?h=v5.14
Index: arch/arm/dts/sun50i-h6-pine-h64-model-b.dts
--- arch/arm/dts/sun50i-h6-pine-h64-model-b.dts.orig
+++ arch/arm/dts/sun50i-h6-pine-h64-model-b.dts
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Copyright (C) 2019 Corentin LABBE <clabbe@baylibre.com>
+ */
+
+#include "sun50i-h6-pine-h64.dts"
+
+/ {
+ model = "Pine H64 model B";
+ compatible = "pine64,pine-h64-model-b", "allwinner,sun50i-h6";
+
+ /delete-node/ reg_gmac_3v3;
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */
+ post-power-on-delay-ms = <200>;
+ };
+};
+
+&hdmi_connector {
+ /delete-property/ ddc-en-gpios;
+};
+
+&emac {
+ phy-supply = <&reg_aldo2>;
+};
+
+&mmc1 {
+ vmmc-supply = <&reg_cldo3>;
+ vqmmc-supply = <&reg_aldo1>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+ uart-has-rtscts;
+ status = "okay";
+
+ bluetooth {
+ compatible = "realtek,rtl8723bs-bt";
+ device-wake-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */
+ host-wake-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */
+ enable-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */
+ max-speed = <1500000>;
+ };
+};

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-configs_pine_h64-model-b_defconfig,v 1.1 2022/01/15 11:56:50 kevlo Exp $
Add defconfig for PINE H64 model B.
Index: configs/pine_h64-model-b_defconfig
--- configs/pine_h64-model-b_defconfig.orig
+++ configs/pine_h64-model-b_defconfig
@@ -0,0 +1,21 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h6-pine-h64-model-b"
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I_H6=y
+CONFIG_SUNXI_DRAM_H6_LPDDR3=y
+CONFIG_MACPWR="PC16"
+CONFIG_MMC0_CD_PIN="PF6"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB3_VBUS_PIN="PL5"
+CONFIG_SPL_SPI_SUNXI=y
+# CONFIG_PSCI_RESET is not set
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SUN8I_EMAC=y
+CONFIG_PHY_SUN50I_USB3=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_DWC3=y
+# CONFIG_USB_DWC3_GADGET is not set

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PFRAG.aarch64,v 1.26 2021/10/29 11:14:46 patrick Exp $
@comment $OpenBSD: PFRAG.aarch64,v 1.27 2022/01/15 11:56:50 kevlo Exp $
@pkgpath sysutils/u-boot-pinebook
share/u-boot/
share/u-boot/a64-olinuxino/
@ -117,6 +117,13 @@ share/u-boot/pine64_plus/sunxi-spl.bin
share/u-boot/pine64_plus/u-boot-sunxi-with-spl.bin
@comment share/u-boot/pine64_plus/u-boot.bin
@comment share/u-boot/pine64_plus/u-boot.img
share/u-boot/pine_h64-model-b/
share/u-boot/pine_h64-model-b/sunxi-spl.bin
@comment share/u-boot/pine_h64-model-b/u-boot
@comment share/u-boot/pine_h64-model-b/u-boot-spl.bin
share/u-boot/pine_h64-model-b/u-boot-sunxi-with-spl.bin
@comment share/u-boot/pine_h64-model-b/u-boot.bin
@comment share/u-boot/pine_h64-model-b/u-boot.img
share/u-boot/pinebook-pro-rk3399/
share/u-boot/pinebook-pro-rk3399/idbloader.img
@comment share/u-boot/pinebook-pro-rk3399/u-boot