Просмотр исходного кода

fix compile/bootup for rockpi4-plus, add new bl31.elf

Waldemar Brodkorb 2 месяцев назад
Родитель
Сommit
c716d59394

+ 33 - 0
package/python3-pyelftools/Makefile

@@ -0,0 +1,33 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:=		python3-pyelftools
+PKG_VERSION:=		0.32
+PKG_RELEASE:=		1
+PKG_HASH:=		6de90ee7b8263e740c8715a925382d4099b354f29ac48ea40d840cf7aa14ace5
+PKG_DESCR:=		fast, expressive, extensible templating engine
+PKG_SECTION:=		dev/tools
+PKG_BUILDDEP:=		python3-host
+PKG_SITES:=		https://files.pythonhosted.org/packages/b9/ab/33968940b2deb3d92f5b146bc6d4009a5f95d1d06c148ea2f9ee965071af/
+
+DISTFILES:=             pyelftools-$(PKG_VERSION).tar.gz
+
+WRKDIST=		$(WRKDIR)/pyelftools-$(PKG_VERSION)
+
+include ${ADK_TOPDIR}/mk/host.mk
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call HOST_template,PYTHON3_YAML,python3-pyelftools,${PKG_VERSION}-${PKG_RELEASE}))
+
+include $(ADK_TOPDIR)/mk/python3.mk
+
+HOST_STYLE:=		manual
+
+python3-pyelftools-hostinstall:
+	(cd $(WRKBUILD); PATH='$(HOST_PATH)' python3 ./setup.py install \
+		--prefix=$(STAGING_HOST_DIR)/usr)
+
+include ${ADK_TOPDIR}/mk/host-bottom.mk
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 2 - 1
package/u-boot/Makefile

@@ -10,7 +10,7 @@ PKG_HASH:=		b60d5865cefdbc75da8da4156c56c458e00de75a49b80c1a2e58a96e30ad0d54
 PKG_DESCR:=		portable bootloader
 PKG_SECTION:=		base/boot
 HOST_BUILDDEP:=		gnutls-host openssl-host dtc-host swig-host python3-host python3-setuptools-host
-PKG_BUILDDEP:=		python3-host python3-setuptools-host swig-host u-boot-host
+PKG_BUILDDEP:=		python3-host python3-setuptools-host python3-pyelftools-host swig-host u-boot-host
 PKG_URL:=		http://www.denx.de/wiki/U-Boot	
 PKG_SITES:=		ftp://ftp.denx.de/pub/u-boot/
 
@@ -131,6 +131,7 @@ do-build:
 		PATH='$(HOST_PATH)' \
 		CROSS_COMPILE='$(TARGET_CROSS)' \
 		OPENSBI="$(FW_DIR)/fw_dynamic.bin" \
+		BL31="$(WRKBUILD)/bl31.elf" \
 		$(MAKE))
 	(cd $(WRKBUILD) && env \
 		PATH='$(HOST_PATH)' \

+ 11 - 0
package/u-boot/patches/patch-configs_rock-pi-4-rk3399_defconfig

@@ -0,0 +1,11 @@
+--- u-boot-2026.01.orig/configs/rock-pi-4-rk3399_defconfig	2026-01-05 21:49:22.000000000 +0100
++++ u-boot-2026.01/configs/rock-pi-4-rk3399_defconfig	2026-02-20 22:19:46.405180702 +0100
+@@ -76,7 +76,7 @@ CONFIG_REGULATOR_RK8XX=y
+ CONFIG_PWM_ROCKCHIP=y
+ CONFIG_RAM_ROCKCHIP_LPDDR4=y
+ CONFIG_SCSI=y
+-CONFIG_BAUDRATE=1500000
++CONFIG_BAUDRATE=115200
+ CONFIG_DEBUG_UART_SHIFT=2
+ CONFIG_SYS_NS16550_MEM32=y
+ CONFIG_ROCKCHIP_SPI=y

BIN
package/u-boot/src/bl31.elf


+ 1 - 1
target/aarch64/rockpi4-plus/extlinux.conf

@@ -1,4 +1,4 @@
 label rockpi4-plus-openadk
   kernel /kernel
   devicetree /rk3399-rock-pi-4b-plus.dtb
-  append console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootwait
+  append console=ttyS2,115200n8 root=/dev/mmcblk1p2 rootwait

+ 0 - 23
target/linux/patches/stable-4.4-rockpi4/serial-baudrate.patch

@@ -1,23 +0,0 @@
-diff -Nur linux-stable-4.4-rockpi4.orig/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi linux-stable-4.4-rockpi4/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
---- linux-stable-4.4-rockpi4.orig/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi	2022-12-09 18:12:00.000000000 +0100
-+++ linux-stable-4.4-rockpi4/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi	2022-12-09 22:12:59.489123950 +0100
-@@ -58,7 +58,7 @@
- 		rockchip,signal-irq = <182>;
- 		rockchip,wake-irq = <0>;
- 		rockchip,irq-mode-enable = <1>;  /* If enable uart uses irq instead of fiq */
--		rockchip,baudrate = <1500000>;  /* Only 115200 and 1500000 */
-+		rockchip,baudrate = <115200>;  /* Only 115200 and 1500000 */
- 		pinctrl-names = "default";
- 		pinctrl-0 = <&uart2c_xfer>;
- 	};
-diff -Nur linux-stable-4.4-rockpi4.orig/scripts/dtc/dtc-lexer.lex.c_shipped linux-stable-4.4-rockpi4/scripts/dtc/dtc-lexer.lex.c_shipped
---- linux-stable-4.4-rockpi4.orig/scripts/dtc/dtc-lexer.lex.c_shipped	2022-12-09 18:12:07.000000000 +0100
-+++ linux-stable-4.4-rockpi4/scripts/dtc/dtc-lexer.lex.c_shipped	2022-12-09 22:11:26.298627242 +0100
-@@ -631,7 +631,6 @@
- #include "srcpos.h"
- #include "dtc-parser.tab.h"
- 
--YYLTYPE yylloc;
- extern bool treesource_error;
- 
- /* CAUTION: this will stop working if we ever use yyless() or yyunput() */