rockchip: add support for allwinner h616 & orangepi-zero2
This commit is contained in:
parent
c3b882d3c5
commit
3ae9d1f1aa
@ -95,8 +95,18 @@ POST_BOARD_OVERLAY() {
|
||||
- rockchip: rk3399, rk3566, rk3568, rk3588
|
||||
|
||||
- phytium: e2000q
|
||||
|
||||
5. POST_BOARD_OVERLAY()
|
||||
|
||||
- allwinner: h616
|
||||
|
||||
5. part_table
|
||||
|
||||
开发板所使用的分区表 ,目前使用的有:
|
||||
|
||||
- gpt: rockchip, phytium
|
||||
|
||||
- msdos: allwinner
|
||||
|
||||
6. POST_BOARD_OVERLAY()
|
||||
|
||||
`POST_BOARD_OVERLAY()` 是执行复制 firmware 文件到根目录以及对目标开发板根目录执行特定操作的函数,其使用的变量与 [build_rootfs.sh](../../scripts/rockchip/build_rootfs.sh) 相同,通常包含以下两个变量:
|
||||
|
||||
@ -110,4 +120,4 @@ POST_BOARD_OVERLAY() {
|
||||
|
||||
## 运行测试
|
||||
|
||||
通过运行脚本[一次构建](../瑞芯微等开发板.md#一次构建),将 `--board` 参数设置为新增开发板的版型文件来运行测试。
|
||||
通过运行脚本[一次构建](../瑞芯微等开发板.md#一次构建),将 `--board` 参数设置为新增开发板的版型文件来运行测试。
|
||||
|
||||
@ -272,6 +272,18 @@
|
||||
|
||||
`sudo bash build.sh --board phytium-4gb -n openEuler-24.03-LTS-PhytiumPi-4GB-aarch64-alpha1 -k https://gitee.com/openeuler/phytium-kernel.git -b openEuler-24.03-LTS-Phytium -c phytium_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo -s headless`
|
||||
|
||||
适用的 Allwinner 开发板:
|
||||
|
||||
已经测试的开发板如下,其他类型 Allwinner 开发板适用情况待测试。
|
||||
|
||||
1. Orange Pi Zero 2
|
||||
|
||||
已测试的版本如下:
|
||||
|
||||
- openEuler-24.03-LTS,构建命令如下:
|
||||
|
||||
`sudo bash build.sh --board orangepi-zero2 -n openEuler-24.03-LTS-OrangePi-Zero2-aarch64-alpha1 -k https://gitee.com/openeuler/allwinner-kernel.git -b openEuler-24.03-LTS -c openeuler_allwinner_defconfig -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo -s headless`
|
||||
|
||||
### Docker 容器内构建
|
||||
|
||||
#### 使用脚本构建镜像需执行命令:
|
||||
|
||||
BIN
scripts/rockchip/bin/linux-firmware/uwe5622/wcnmodem-38222.bin
Normal file
BIN
scripts/rockchip/bin/linux-firmware/uwe5622/wcnmodem-38222.bin
Normal file
Binary file not shown.
BIN
scripts/rockchip/bin/linux-firmware/uwe5622/wcnmodem.bin
Normal file
BIN
scripts/rockchip/bin/linux-firmware/uwe5622/wcnmodem.bin
Normal file
Binary file not shown.
@ -0,0 +1,177 @@
|
||||
[Section 1: Version]
|
||||
Major = 2
|
||||
Minor = 2
|
||||
|
||||
[Section 2: Board Config]
|
||||
Calib_Bypass = 11758
|
||||
TxChain_Mask = 2
|
||||
RxChain_Mask = 2
|
||||
|
||||
[Section 3: Board Config TPC]
|
||||
DPD_LUT_idx = 0x33,0x33,0x0,0x11,0x22,0x33,0x33,0x33
|
||||
TPC_Goal_Chain0 = 0,0,0,0,0,0,0,0
|
||||
TPC_Goal_Chain1 = 159,167,162,152,159,167,162,152
|
||||
|
||||
[Section 4: TPC-LUT]
|
||||
Chain0_LUT_0 = 6,0,40,0
|
||||
Chain0_LUT_1 = 6,1,24,0
|
||||
Chain0_LUT_2 = 6,2,8,0
|
||||
Chain0_LUT_3 = 10,2,0,0
|
||||
Chain0_LUT_4 = 14,2,0,0
|
||||
Chain0_LUT_5 = 18,2,0,0
|
||||
Chain0_LUT_6 = 22,2,0,0
|
||||
Chain0_LUT_7 = 26,2,0,0
|
||||
Chain1_LUT_0 = 6,0,40,0
|
||||
Chain1_LUT_1 = 6,1,24,0
|
||||
Chain1_LUT_2 = 6,2,8,0
|
||||
Chain1_LUT_3 = 10,2,0,0
|
||||
Chain1_LUT_4 = 14,2,0,0
|
||||
Chain1_LUT_5 = 18,2,0,0
|
||||
Chain1_LUT_6 = 22,2,0,0
|
||||
Chain1_LUT_7 = 26,2,0,0
|
||||
|
||||
[Section 5: Board Config Frequency Compensation]
|
||||
2G_Channel_Chain0 = 6,6,6,6,7,7,7,7,7,7,7,7,7,7
|
||||
2G_Channel_Chain1 = 6,6,6,6,7,7,7,7,7,7,7,7,7,7
|
||||
5G_Channel_Chain0 = 11,11,11,11,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9
|
||||
5G_Channel_Chain1 = 11,11,11,11,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9
|
||||
|
||||
[Section 6: Rate To Power with BW 20M]
|
||||
11b_Power = 20,20,20,20
|
||||
11ag_Power = 28,32,36,44,28,32,36,48
|
||||
11n_Power = 34,38,38,40,40,44,44,48,32,36,36,40,40,44,44,54,48
|
||||
11ac_Power = 32,36,36,40,40,44,44,48,50,66,32,36,36,40,40,44,44,48,50,66
|
||||
|
||||
[Section 7: Power Backoff]
|
||||
Green_WIFI_offset = 0
|
||||
HT40_Power_offset = 0
|
||||
VHT40_Power_offset = 0
|
||||
VHT80_Power_offset = 0
|
||||
SAR_Power_offset = 0
|
||||
Mean_Power_offset = 36
|
||||
|
||||
[Section 8: Reg Domain]
|
||||
reg_domain1 = 0x00000001
|
||||
reg_domain2 = 0x00000002
|
||||
|
||||
[Section 9: Band Edge Power offset (MKK, FCC, ETSI)]
|
||||
BW20M = 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41
|
||||
BW40M = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21
|
||||
BW80M = 6,5,4,3,2,1
|
||||
|
||||
[Section 10: TX Scale]
|
||||
Chain0_1 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
|
||||
Chain1_1 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
|
||||
Chain0_2 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17
|
||||
Chain1_2 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17
|
||||
Chain0_3 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18
|
||||
Chain1_3 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18
|
||||
Chain0_4 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,19
|
||||
Chain1_4 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,19
|
||||
Chain0_5 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20
|
||||
Chain1_5 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20
|
||||
Chain0_6 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,21
|
||||
Chain1_6 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,21
|
||||
Chain0_7 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,22
|
||||
Chain1_7 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,22
|
||||
Chain0_8 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,23
|
||||
Chain1_8 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,23
|
||||
Chain0_9 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,24
|
||||
Chain1_9 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,24
|
||||
Chain0_10 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,25
|
||||
Chain1_10 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,25
|
||||
Chain0_11 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,26
|
||||
Chain1_11 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,26
|
||||
Chain0_12 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,27
|
||||
Chain1_12 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,27
|
||||
Chain0_13 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,28
|
||||
Chain1_13 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,28
|
||||
Chain0_14 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,29
|
||||
Chain1_14 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,29
|
||||
Chain0_36 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,30
|
||||
Chain1_36 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,30
|
||||
Chain0_40 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,31
|
||||
Chain1_40 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,31
|
||||
Chain0_44 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,32
|
||||
Chain1_44 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,32
|
||||
Chain0_48 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,33
|
||||
Chain1_48 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,33
|
||||
Chain0_52 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,34
|
||||
Chain1_52 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,34
|
||||
Chain0_56 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,35
|
||||
Chain1_56 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,35
|
||||
Chain0_60 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,36
|
||||
Chain1_60 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,36
|
||||
Chain0_64 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37
|
||||
Chain1_64 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37
|
||||
Chain0_100 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,38
|
||||
Chain1_100 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,38
|
||||
Chain0_104 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,39
|
||||
Chain1_104 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,39
|
||||
Chain0_108 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,40
|
||||
Chain1_108 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,40
|
||||
Chain0_112 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,41
|
||||
Chain1_112 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,41
|
||||
Chain0_116 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,42
|
||||
Chain1_116 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,42
|
||||
Chain0_120 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,43
|
||||
Chain1_120 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,43
|
||||
Chain0_124 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,44
|
||||
Chain1_124 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,44
|
||||
Chain0_128 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,45
|
||||
Chain1_128 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,45
|
||||
Chain0_132 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,46
|
||||
Chain1_132 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,46
|
||||
Chain0_136 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,47
|
||||
Chain1_136 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,47
|
||||
Chain0_140 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,48
|
||||
Chain1_140 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,48
|
||||
Chain0_144 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,49
|
||||
Chain1_144 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,49
|
||||
Chain0_149 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,50
|
||||
Chain1_149 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,50
|
||||
Chain0_153 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,51
|
||||
Chain1_153 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,51
|
||||
Chain0_157 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,52
|
||||
Chain1_157 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,52
|
||||
Chain0_161 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,53
|
||||
Chain1_161 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,53
|
||||
Chain0_165 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,54
|
||||
Chain1_165 = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,54
|
||||
|
||||
[Section 11: misc]
|
||||
DFS_switch = 1
|
||||
power_save_switch = 2
|
||||
ex-Fem_and_ex-LNA_param_setup = 3
|
||||
rssi_report_diff = 4
|
||||
|
||||
[Section 12: debug reg]
|
||||
address = 0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0x10,0x11,0x12,0x13,0x14,0x15,0x16
|
||||
value = 0x16,0x17,0x18,0x19,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x30,0x31
|
||||
|
||||
[Section 13: coex_config]
|
||||
bt_performance_cfg0 = 0x01010101
|
||||
bt_performance_cfg1 = 0x01000000
|
||||
wifi_performance_cfg0 = 0x01050A01
|
||||
wifi_performance_cfg2 = 0x00000000
|
||||
strategy_cfg0 = 0x01010100
|
||||
strategy_cfg1 = 0x03000000
|
||||
strategy_cfg2 = 0x08020000
|
||||
compatibility_cfg0 = 0x04040000
|
||||
compatibility_cfg1 = 0x0
|
||||
ant_cfg0 = 0x0
|
||||
ant_cfg1 = 0x0
|
||||
isolation_cfg0 = 0x0505
|
||||
isolation_cfg1 = 0x0
|
||||
reserved_cfg0 = 0x0
|
||||
reserved_cfg1 = 0x0
|
||||
reserved_cfg2 = 0x0
|
||||
reserved_cfg3 = 0x0
|
||||
reserved_cfg4 = 0x0
|
||||
reserved_cfg5 = 0x0
|
||||
reserved_cfg6 = 0x0
|
||||
reserved_cfg7 = 0x0
|
||||
|
||||
[Section 14: rf_tlv_config]
|
||||
rf_config = 0xAA,0x55,0x00,0xFF,0x8,0xA,0x0,0x5,0x0,0x0,0x0,0x0,0x0,0x0
|
||||
|
||||
Binary file not shown.
@ -4,10 +4,11 @@ dtb_name=rk3588-firefly-itx-3588j
|
||||
platform=rockchip
|
||||
soc_name=rk3588
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
|
||||
mkdir -p ${rootfs_dir}/etc/modules-load.d/
|
||||
echo "8821cu" >> ${rootfs_dir}/etc/modules-load.d/8821cu.conf
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ dtb_name=rk3399-firefly
|
||||
platform=rockchip
|
||||
soc_name=rk3399
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
|
||||
@ -4,6 +4,7 @@ dtb_name=rk3566-roc-pc
|
||||
platform=rockchip
|
||||
soc_name=rk3566
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
@ -12,4 +13,4 @@ POST_BOARD_OVERLAY() {
|
||||
cp ${nonfree_bin_dir}/linux-firmware/ap6255/brcmfmac43455-sdio.bin ${rootfs_dir}/usr/lib/firmware/brcm/brcmfmac43455-sdio.firefly,rk3566-roc-pc.bin
|
||||
cp ${nonfree_bin_dir}/linux-firmware/ap6255/brcmfmac43455-sdio.txt ${rootfs_dir}/usr/lib/firmware/brcm/brcmfmac43455-sdio.firefly,rk3566-roc-pc.txt
|
||||
cp ${nonfree_bin_dir}/linux-firmware/ap6255/BCM4345C0.hcd ${rootfs_dir}/usr/lib/firmware/brcm
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ dtb_name=rk3568-roc-pc-se
|
||||
platform=rockchip
|
||||
soc_name=rk3568
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
|
||||
@ -3,6 +3,8 @@ local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568
|
||||
dtb_name=rk3568-roc-pc
|
||||
platform=rockchip
|
||||
soc_name=rk3568
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
|
||||
@ -4,8 +4,9 @@ dtb_name=rk3588s-roc-pc
|
||||
platform=rockchip
|
||||
soc_name=rk3588
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
echo "Nothing to do..."
|
||||
}
|
||||
}
|
||||
|
||||
22
scripts/rockchip/boards/orangepi-zero2.conf
Normal file
22
scripts/rockchip/boards/orangepi-zero2.conf
Normal file
@ -0,0 +1,22 @@
|
||||
ubootconfig=none
|
||||
local_uboot_dir=${nonfree_bin_dir}/u-boot/orangepi-zero2
|
||||
dtb_name=sun50i-h616-orangepi-zero2
|
||||
platform=allwinner
|
||||
soc_name=h616
|
||||
arch=arm64
|
||||
part_table=msdos
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
|
||||
# uwe5622 firmware
|
||||
mkdir -p ${rootfs_dir}/usr/lib/firmware/uwe5622
|
||||
cp ${nonfree_bin_dir}/linux-firmware/uwe5622/wcnmodem-38222.bin ${rootfs_dir}/usr/lib/firmware/uwe5622
|
||||
cp ${nonfree_bin_dir}/linux-firmware/uwe5622/wcnmodem.bin ${rootfs_dir}/usr/lib/firmware/uwe5622
|
||||
cp ${nonfree_bin_dir}/linux-firmware/uwe5622/wifi_2355b001_1ant.ini ${rootfs_dir}/usr/lib/firmware/uwe5622
|
||||
|
||||
pushd ${rootfs_dir}/usr/lib/firmware
|
||||
ln -s uwe5622/wcnmodem.bin wcnmodem.bin
|
||||
ln -s uwe5622/wifi_2355b001_1ant.ini wifi_2355b001_1ant.ini
|
||||
popd
|
||||
}
|
||||
@ -4,6 +4,7 @@ dtb_name=phytiumpi_firefly
|
||||
platform=phytium
|
||||
soc_name=e2000q
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
@ -14,4 +15,4 @@ POST_BOARD_OVERLAY() {
|
||||
cp ${nonfree_bin_dir}/linux-firmware/rtl8821c/rtl8821c_config ${rootfs_dir}/lib/firmware/rtlbt/rtl8821c_config
|
||||
cp ${nonfree_bin_dir}/linux-firmware/rtl8821c/rtl8821c_fw ${rootfs_dir}/lib/firmware/rtlbt/rtl8821c_fw
|
||||
chmod +x ${rootfs_dir}/usr/bin/rtk_hciattach
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,8 +4,9 @@ dtb_name=rk3588-rock-5b
|
||||
platform=rockchip
|
||||
soc_name=rk3588
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
echo "Nothing to do..."
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,8 +3,9 @@ dtb_name=rk3399-rock-pi-4a
|
||||
platform=rockchip
|
||||
soc_name=rk3399
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
echo "Nothing to do..."
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,8 +3,9 @@ dtb_name=rk3399-firefly #Required! The device tree name of target board, which
|
||||
platform=rockchip #Required! The platform of target board, which defaults to rockchip.
|
||||
soc_name=rk3399
|
||||
arch=arm64
|
||||
part_table=gpt
|
||||
|
||||
POST_BOARD_OVERLAY() {
|
||||
echo "Put ${board} firmware into rootfs..."
|
||||
echo "This is a sample..."
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,6 +216,8 @@ mk_boot() {
|
||||
bootargs=${rockchip_bootargs}
|
||||
elif [ "${platform}" == "phytium" ];then
|
||||
bootargs=${phytium_bootargs}
|
||||
elif [ "${platform}" == "allwinner" ];then
|
||||
bootargs=${allwinner_bootargs}
|
||||
else
|
||||
echo "Unsupported platform"
|
||||
exit 2
|
||||
@ -259,6 +261,7 @@ set -e
|
||||
|
||||
rockchip_bootargs="earlyprintk console=ttyS2,1500000 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 init=/sbin/init rootwait"
|
||||
phytium_bootargs="console=ttyAMA1,115200 earlycon=pl011,0x2800d000 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 rootwait cma=256m"
|
||||
allwinner_bootargs="console=tty0 console=ttyS0,115200 rw root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootfstype=ext4 rootwait earlycon clk_gnore_unused"
|
||||
|
||||
if [ ! -f $default_defconfig ] ; then
|
||||
LOG "kernel defconfig is : ${default_defconfig}"
|
||||
|
||||
@ -309,8 +309,9 @@ EOF
|
||||
mk_rootfsimg() {
|
||||
trap 'LOSETUP_D_IMG' EXIT
|
||||
cd $workdir
|
||||
size=`du -sh --block-size=1MiB ${rootfs_dir} | cut -f 1 | xargs`
|
||||
size=$(($size+500))
|
||||
rootfs_size=`du -sh --block-size=1MiB ${rootfs_dir} | cut -f 1 | xargs`
|
||||
mod_size=`du -sh --block-size=1MiB ${workdir}/kernel/kernel-modules/lib/modules | cut -f 1 | xargs`
|
||||
size=$(($rootfs_size+$mod_size+100))
|
||||
rootfs_img=${workdir}/rootfs.img
|
||||
dd if=/dev/zero of=${rootfs_img} bs=1MiB count=$size status=progress && sync
|
||||
mkfs.ext4 -L rootfs ${workdir}/rootfs.img
|
||||
|
||||
@ -131,6 +131,8 @@ use_prebuild_u-boot() {
|
||||
cp ${local_uboot_dir}/fip-all-sd-boot.bin $workdir/u-boot
|
||||
mkenvimage -s 0x1000 -o $workdir/u-boot/env.bin ${local_uboot_dir}/env.txt
|
||||
dd if=$workdir/u-boot/env.bin of=$workdir/u-boot/fip-all-sd-boot.bin bs=1k seek=1472 conv=notrunc
|
||||
elif [[ "x${platform}" == "xallwinner" ]]; then
|
||||
cp ${local_uboot_dir}/* $workdir/u-boot
|
||||
else
|
||||
echo "target u-boot can not found!"
|
||||
exit 2
|
||||
|
||||
@ -139,13 +139,15 @@ make_img(){
|
||||
|
||||
device=""
|
||||
LOSETUP_D_IMG
|
||||
size=`du -sh --block-size=1MiB ${workdir}/rootfs.img | cut -f 1 | xargs`
|
||||
size=`ls -l --block-size=1MiB ${workdir}/rootfs.img | awk '{ print $5 }'`
|
||||
size=$(($size+1100))
|
||||
losetup -D
|
||||
img_file=${workdir}/${name}.img
|
||||
dd if=/dev/zero of=${img_file} bs=1MiB count=$size status=progress && sync
|
||||
|
||||
parted ${img_file} mklabel gpt mkpart primary fat32 32768s 524287s
|
||||
LOG "create ${part_table} partition table."
|
||||
parted ${img_file} mklabel ${part_table} mkpart primary fat32 32768s 524287s
|
||||
|
||||
parted ${img_file} -s set 1 boot on
|
||||
parted ${img_file} mkpart primary ext4 524288s 100%
|
||||
|
||||
@ -220,6 +222,14 @@ make_img(){
|
||||
ERROR "phytium fip-all-sd-boot file can not be found!"
|
||||
exit 2
|
||||
fi
|
||||
elif [ "${platform}" == "allwinner" ];then
|
||||
echo "Installing Allwinner U-Boot..."
|
||||
if [ -f ${uboot_dir}/u-boot-sunxi-with-spl.bin ]; then
|
||||
dd if=${uboot_dir}/u-boot-sunxi-with-spl.bin of=/dev/${loopX} seek=8k
|
||||
else
|
||||
ERROR "allwinner u-boot file can not be found!"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
echo "Unsupported platform"
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user