-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Orange Pi Zero2 / Zero3 1G_2G_4G
- Loading branch information
1 parent
39bc61b
commit d094c3f
Showing
15 changed files
with
18,159 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,55 @@ | ||
# | ||
# Copyright (C) 2013-2016 OpenWrt.org | ||
# Copyright (C) 2017 Yousong Zhou | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
include $(INCLUDE_DIR)/kernel.mk | ||
|
||
PKG_SOURCE_PROTO:=git | ||
PKG_SOURCE_URL=https://github.com/orangepi-xunlong/u-boot-orangepi | ||
PKG_SOURCE_DATE:=2017-09 | ||
PKG_SOURCE_VERSION:=6fe17fac388aad17490cf386578b7532975e567f | ||
PKG_MIRROR_HASH:=4345d99b0772eba496f24ede9e973d34b72b8239309a75f28acca4fd428bd59e | ||
|
||
include $(INCLUDE_DIR)/u-boot.mk | ||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define U-Boot/Default | ||
BUILD_TARGET:=sunxi | ||
UBOOT_IMAGE:=u-boot-sunxi-with-spl.bin | ||
UENV:=default | ||
HIDDEN:=1 | ||
endef | ||
|
||
define U-Boot/orangepi_zero3 | ||
BUILD_SUBTARGET:=cortexa53 | ||
NAME:=Xunlong Orange Pi Zero3 | ||
BUILD_DEVICES:=xunlong_orangepi-zero3 | ||
DEPENDS:=+PACKAGE_u-boot-orangepi_zero3:trusted-firmware-a-sunxi-h616 | ||
UENV:=h616 | ||
ATF:=h616 | ||
endef | ||
|
||
UBOOT_TARGETS := \ | ||
orangepi_zero3 | ||
|
||
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes | ||
|
||
UBOOT_MAKE_FLAGS += \ | ||
BL31=$(STAGING_DIR_IMAGE)/bl31_sunxi-$(ATF).bin SCP=/dev/null | ||
|
||
define Build/InstallDev | ||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE) | ||
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin | ||
mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \ | ||
$(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr | ||
endef | ||
|
||
define Package/u-boot/install/default | ||
endef | ||
|
||
$(eval $(call BuildPackage/U-Boot)) |
25 changes: 25 additions & 0 deletions
25
package/boot/uboot-sunxi-h618/patches/301-Support-Zero3-1G_2G_4G.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,25 @@ | ||
From 74c81e04d876199cdd283012ffbed0914285b09c Mon Sep 17 00:00:00 2001 | ||
From: liuyang <2665982620@qq.com> | ||
Date: Fri, 8 Dec 2023 11:47:35 +0800 | ||
Subject: [PATCH] Support Zero3 1G_2G_4G | ||
|
||
--- | ||
arch/arm/mach-sunxi/dram_timings/h616_lpddr4.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/arch/arm/mach-sunxi/dram_timings/h616_lpddr4.c b/arch/arm/mach-sunxi/dram_timings/h616_lpddr4.c | ||
index ca36899f..46daed86 100644 | ||
--- a/arch/arm/mach-sunxi/dram_timings/h616_lpddr4.c | ||
+++ b/arch/arm/mach-sunxi/dram_timings/h616_lpddr4.c | ||
@@ -30,7 +30,7 @@ void mctl_set_timing_params(struct dram_para *para) | ||
u8 trp = ns_to_t(21); /* JEDEC: >= 13.75 ns */ | ||
u8 tras = ns_to_t(42); /* JEDEC >= 36 ns, <= 9*trefi */ | ||
u16 trefi = ns_to_t(3904) / 32; /* JEDEC: 7.8us@Tcase <= 85C */ | ||
- u16 trfc = ns_to_t(180); /* JEDEC: 160 ns for 2Gb */ | ||
+ u16 trfc = ns_to_t(280); /* JEDEC: 160 ns for 2Gb */ | ||
u16 txsr = ns_to_t(190); /* ? */ | ||
|
||
u8 tmrw = max(ns_to_t(14), 5); /* ? */ | ||
-- | ||
2.34.1 | ||
|
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,8 @@ | ||
setenv fdt_high ffffffff | ||
setenv mmc_rootpart 2 | ||
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid | ||
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage | ||
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb | ||
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait | ||
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r | ||
run uenvcmd |
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,7 @@ | ||
setenv mmc_rootpart 2 | ||
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid | ||
setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage | ||
setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb | ||
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait | ||
setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r | ||
run uenvcmd |
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,9 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
START=22 | ||
start() { | ||
rm -rf /etc/rc.d/S22resize-rootfs | ||
#service resize-rootfs disable | ||
/usr/bin/resize-rootfs.sh | ||
} | ||
|
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 @@ | ||
../init.d/resize-rootfs |
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,56 @@ | ||
#!/bin/bash | ||
|
||
FDISK=$(which fdisk) || { echo "E: You must have fdisk" && exit 1; } | ||
LOSETUP=$(which losetup) || { echo "E: You must have losetup" && exit 1; } | ||
roottype=$(findmnt -n -o SOURCE / -o FSTYPE) | ||
case ${roottype} in | ||
overlay) | ||
FSCKEXT4=$(which fsck.ext4) || { echo "E: You must have fsck.ext4" && exit 1; } | ||
RESIZE2FS=$(which resize2fs) || { echo "E: You must have resize2fs" && exit 1; } | ||
rootsource=$(findmnt -n -o SOURCE /rom) # i.e. /dev/mmcblk0p2 | ||
rootdevice=${rootsource%p*} # i.e. /dev/mmcblk0 | ||
partitions=${rootsource##*p} | ||
|
||
# Resizing partitions | ||
lastsector=$(${FDISK} -l ${rootdevice} |grep "Disk ${rootdevice}" |awk '{print $7}') | ||
lastsector=$(( $lastsector - 1 )) | ||
startfrom=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $2}') | ||
partend=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $3}') | ||
[[ $lastsector -eq $partend ]] && exit 0 | ||
(echo d; echo $partitions; echo n; echo p; echo ; echo $startfrom; echo $lastsector ; echo w;) | fdisk $rootdevice | ||
# Start resizing filesystem | ||
LOOP="$(losetup -n -O NAME | sort | sed -n -e "1p")" | ||
ROOT="$(losetup -n -O BACK-FILE ${LOOP} | sed -e "s|^|/dev|")" | ||
OFFS="$(losetup -n -O OFFSET ${LOOP})" | ||
LOOP="$(losetup -f)" | ||
${LOSETUP} -o ${OFFS} ${LOOP} ${ROOT} | ||
${FSCKEXT4} -y ${LOOP} | ||
${RESIZE2FS} ${LOOP} | ||
reboot | ||
;; | ||
ext4) | ||
FSCKEXT4=$(which fsck.ext4) || { echo "E: You must have fsck.ext4" && exit 1; } | ||
RESIZE2FS=$(which resize2fs) || { echo "E: You must have resize2fs" && exit 1; } | ||
rootsource=$(findmnt -n -o SOURCE / | sed 's~\[.*\]~~') # i.e. /dev/mmcblk0p2 | ||
rootdevice=${rootsource%p*} # i.e. /dev/mmcblk0 | ||
partitions=${rootsource##*p} | ||
|
||
# Resizing partitions | ||
lastsector=$(${FDISK} -l ${rootdevice} |grep "Disk ${rootdevice}" |awk '{print $7}') | ||
lastsector=$(( $lastsector - 1 )) | ||
startfrom=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $2}') | ||
partend=$(${FDISK} -l ${rootdevice} |grep ${rootsource} |awk '{print $3}') | ||
[[ $lastsector -eq $partend ]] && exit 0 | ||
(echo d; echo $partitions; echo n; echo p; echo ; echo $startfrom; echo $lastsector ; echo w;) | fdisk $rootdevice | ||
|
||
# Start resizing filesystem | ||
LOOP="$(losetup -f)" | ||
${LOSETUP} ${LOOP} ${rootsource} | ||
${FSCKEXT4} -y ${LOOP} | ||
${RESIZE2FS} ${LOOP} | ||
reboot | ||
;; | ||
esac | ||
|
||
exit 0 | ||
|
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 |
---|---|---|
|
@@ -522,3 +522,4 @@ CONFIG_XZ_DEC_ARM=y | |
CONFIG_XZ_DEC_BCJ=y | ||
CONFIG_ZBOOT_ROM_BSS=0 | ||
CONFIG_ZBOOT_ROM_TEXT=0 | ||
CONFIG_MOTORCOMM_PHY=y |
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.