添加 Amlogic A311D (Khadas-VIM3) 的支持

This commit is contained in:
chainsx 2025-12-16 17:47:05 +08:00 committed by chainsx
parent 8c88dcebb2
commit 42b7c15e7c
17 changed files with 11062 additions and 5 deletions

View File

@ -2,7 +2,7 @@
English | [简体中文](./README.md)
This repository is the main repository of the openEuler SBC (Single-Board Computer) SIG. It provides information related to SBC SIG, build scripts and documentation for openEuler images suitable for development boards such as [Raspberry Pi](https://gitee.com/openeuler/raspberrypi-kernel), [Rockchip](https://gitee.com/openeuler/rockchip-kernel) and [Allwinner](https://gitee.com/openeuler/allwinner-kernel).
This repository is the main repository of the openEuler SBC (Single-Board Computer) SIG. It provides information related to SBC SIG, build scripts and documentation for openEuler images suitable for development boards such as [Raspberry Pi](https://www.raspberrypi.org/), [Rockchip](https://www.rock-chips.com/), [Allwinner](https://www.allwinnertech.com/) and [Amlogic](https://www.amlogic.cn/).
<!-- TOC -->

View File

@ -2,7 +2,7 @@
[English](./README.en.md) | 简体中文
本仓库是 openEuler 社区 SBC (Single-Board Computer) SIG 组的主仓库,提供 SIG 组相关信息以及适用于[树莓派](https://gitee.com/openeuler/raspberrypi-kernel)、[Rockchip](https://gitee.com/openeuler/rockchip-kernel)、[全志](https://gitee.com/openeuler/allwinner-kernel)等开发板的 openEuler 镜像的构建脚本和相关文档。
本仓库是 openEuler 社区 SBC (Single-Board Computer) SIG 组的主仓库,提供 SIG 组相关信息以及适用于[树莓派](https://www.raspberrypi.org/)、[Rockchip](https://www.rock-chips.com/)、[全志](https://www.allwinnertech.com/)、[晶晨](https://www.amlogic.cn/)等开发板的 openEuler 镜像的构建脚本和相关文档。
<!-- TOC -->
@ -331,7 +331,7 @@ SIG 组基本信息位于 [sig-SBC](https://gitee.com/openeuler/community/tree/m
- platform=PLATFORM
开发板所使用的平台目前支持的平台有broadcom、rockchip、phytium默认为 `rockchip`
开发板所使用的平台目前支持的平台有broadcom、rockchip、phytium、amlogic,默认为 `rockchip`
- device-tree=DTB_NAME
@ -355,7 +355,7 @@ SIG 组基本信息位于 [sig-SBC](https://gitee.com/openeuler/community/tree/m
5. -c, --config KERNEL_DEFCONFIG
内核编译使用的配置文件名称或路径,默认为 `openeuler_rockchip_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 `arch/arm64/configs` 下。
内核编译使用的配置文件名称或路径,默认为 `openeuler_rockchip_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 `arch/arm64/configs` 或构建框架的 [scripts/configs/rockchip](./scripts/configs/rockchip/) 下。
6. -r, --repo REPO_INFO

View File

@ -130,7 +130,7 @@
5. -c, --config KERNEL_DEFCONFIG
内核编译使用的配置文件名称或路径,默认为 `openeuler_rockchip_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 arch/arm64/configs 下。
内核编译使用的配置文件名称或路径,默认为 `openeuler_rockchip_defconfig`。如果该参数为配置文件名称,请确保该文件在内核源码的目录 `arch/arm64/configs` 或构建框架的 [scripts/configs/rockchip](../scripts/configs/rockchip/) 下。
6. -r, --repo REPO_INFO
@ -262,6 +262,12 @@
<td class="cellrowborder" valign="top" width="10%"><p>Allwinner H618</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 24.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#longan-pi-3h">构建完整镜像命令</a></td>
<tr>
<td class="cellrowborder" valign="top" width="10%"><ul><li>Khadas VIM3</li></ul></td>
<td class="cellrowborder" valign="top" width="10%"><a href="https://docs.khadas.com/products/sbc/vim3/start">Khadas Wiki</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Amlogic A311D</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 24.03 LTS</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#khadas-vim3">构建完整镜像命令</a></td>
</tr>
</tbody></table>
@ -380,3 +386,16 @@
-s headless
```
- Amlogic: Khadas VIM3
```
sudo bash build-image-docker.sh \
--board khadas-vim3 \
-d https://repo.openeuler.org/openEuler-24.03-LTS/docker_img/aarch64/openEuler-docker.aarch64.tar.xz \
-n openEuler-24.03-LTS-Khadas-VIM3-aarch64-alpha1 \
-k https://gitee.com/openeuler/kernel.git \
-b OLK-6.6 \
-c amlogic-kernel-OLK-6.6.config \
-r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo \
-s headless
```

View File

@ -143,5 +143,12 @@ English | [简体中文](./compatibility-list.md)
<td class="cellrowborder" valign="top" width="10%"><p style="color:yellow">Community Support</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#longan-pi-3h">Build a unified system image</a></td>
</tr>
<tr>
<td class="cellrowborder" valign="top" width="10%"><a href="https://docs.khadas.com/products/sbc/vim3/start">Khadas VIM3</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Amlogic A311D</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 24.03 LTS(<a href="https://gitee.com/openeuler/kernel/tree/OLK-6.6/">kernel version 6.6</a>)</p></td>
<td class="cellrowborder" valign="top" width="10%"><p style="color:yellow">Community Support</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#khadas-vim3">Build a unified system image</a></td>
</tr>
</tbody>
</table>

View File

@ -143,5 +143,12 @@
<td class="cellrowborder" valign="top" width="10%"><p style="color:yellow">社区支持</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#longan-pi-3h">构建完整镜像</a></td>
</tr>
<tr>
<td class="cellrowborder" valign="top" width="10%"><a href="https://docs.khadas.com/products/sbc/vim3/start">Khadas VIM3</a></td>
<td class="cellrowborder" valign="top" width="10%"><p>Amlogic A311D</p></td>
<td class="cellrowborder" valign="top" width="10%"><p>openEuler 24.03 LTS<a href="https://gitee.com/openeuler/kernel/tree/OLK-6.6/">内核版本 6.6</a></p></td>
<td class="cellrowborder" valign="top" width="10%"><p style="color:yellow">社区支持</p></td>
<td class="cellrowborder" valign="top" width="10%"><a href="./rockchip/构建完整镜像命令列举.md#khadas-vim3">构建完整镜像</a></td>
</tr>
</tbody>
</table>

View File

@ -187,3 +187,15 @@
- openEuler-24.03-LTS构建命令如下:
`sudo bash build.sh --board longanpi-3h -n openEuler-24.03-LTS-LonganPi-3H-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`
### 适用的 Amlogic 开发板:
已经测试的开发板如下,其他类型 Amlogic 开发板适用情况待测试。
#### Khadas VIM3
已测试的版本如下:
- openEuler-24.03-LTS构建命令如下:
`bash build.sh --board khadas-vim3 -n openEuler-24.03-LTS-Khadas-VIM3-aarch64-alpha1 -k https://gitee.com/openeuler/kernel.git -b OLK-6.6 -c amlogic-kernel-OLK-6.6.config -r https://gitee.com/src-openeuler/openEuler-repos/raw/openEuler-24.03-LTS/generic.repo -s headless`

Binary file not shown.

View File

@ -0,0 +1,226 @@
#AP6359SA_NVRAM_V1.1_20170328
# BCM4359 WLBGA iPA, iLNA board for bringup -AP6359SA_V1.0NVRAM
NVRAMRev=$Rev: 528206 $
cckdigfilttype=5
#cckdigfilttype=4 (default)
#valid ofdm filter types are 0 and 1
ofdmfilttype_2gbe=127
ofdmfilttype_5gbe=127
sromrev=11
boardrev=0x1301
boardtype=0x0812
# JIRA:SW4349-945 MANDATORY! Update makefile in case you touch bfl
#boardflags=0x10081201
boardflags=0x00080201
boardflags2=0x40800000
boardflags3=0x48700106
#boardnum=57410
macaddr=00:90:4c:27:80:01
ccode=0
regrev=0
antswitch=0
pdgain5g=0
pdgain2g=0
lowpowerrange2g=0
lowpowerrange5g=0
tworangetssi2g=0
tworangetssi5g=0
# Low Power Range start value: 0dBm
olpc_thresh2g=0
olpc_thresh5g=0
AvVmid_c0=2,130,2,130,2,130,2,130,2,130
AvVmid_c1=2,130,2,130,2,130,2,130,2,130
# JIRA:SW4349-945 MANDATORY! Update makefile in case you touch femctl
femctrl=14
vendid=0x14e4
devid=0x43ef
manfid=0x2d0
#prodid=0x052e
nocrc=1
#btc_mode=1
btc_params82=0x1a0
otpimagesize=502
xtalfreq=37400
rxgains2gelnagaina0=3
rxgains2gtrisoa0=7
rxgains2gtrelnabypa0=1
rxgains5gelnagaina0=3
rxgains5gtrisoa0=6
rxgains5gtrelnabypa0=1
rxgains5gmelnagaina0=3
rxgains5gmtrisoa0=6
rxgains5gmtrelnabypa0=1
rxgains5ghelnagaina0=3
rxgains5ghtrisoa0=6
rxgains5ghtrelnabypa0=1
rxgains2gelnagaina1=3
rxgains2gtrisoa1=7
rxgains2gtrelnabypa1=1
rxgains5gelnagaina1=3
rxgains5gtrisoa1=6
rxgains5gtrelnabypa1=1
rxgains5gmelnagaina1=3
rxgains5gmtrisoa1=6
rxgains5gmtrelnabypa1=1
rxgains5ghelnagaina1=3
rxgains5ghtrisoa1=6
rxgains5ghtrelnabypa1=1
rxchain=3
txchain=3
aa2g=3
aa5g=3
agbg0=2
agbg1=2
aga0=2
aga1=2
tssipos2g=1
extpagain2g=2
tssipos5g=1
extpagain5g=2
tempthresh=255
tempoffset=255
rawtempsense=0x1ff
fdss_interp_en=1
#fdss_level_2g=3,3
fdss_level_5g=4,4
#pa2gccka0=-186,8076,-976
#pa2gccka1=-217,7061,-881
#pa2gccka2=-67,9864,-1253
#pa2gccka3=-115,9164,-1225
#pa2ga0=-196,6950,-832
#pa2ga1=-204,6710,-809
#pa2ga2=-220,4557,-593
#pa2ga3=-218,4596,-601
pa2ga0=-178,6979,-820
pa2ga1=-169,7256,-837
pa2ga2=-220,4685,-607
pa2ga3=-218,4724,-615
#pa5ga0=-191,6865,-844,-169,7525,-907,-168,7768,-938,-192,7073,-871
#pa5ga1=-182,7580,-919,-188,7614,-931,-219,6536,-818,-202,7220,-895
#pa5ga2=-220,4437,-628,-183,5005,-678,-229,4048,-551,-223,4448,-611
#pa5ga3=-263,3914,-566,-224,4649,-640,-230,4385,-596,-154,6488,-866
pa5ga0=-201,6882,-843,-191,7173,-871,-193,7048,-861,-181,7214,-866
pa5ga1=-214,6467,-801,-210,6642,-821,-204,6742,-831,-204,6651,-819
pa5ga2=-220,4616,-647,-183,5184,-694,-229,4227,-571,-223,4627,-631
pa5ga3=-263,4170,-599,-224,4905,-668,-230,4641,-625,-154,6744,-885
#pa5gbw4080a0=-201,6883,-859,-198,7088,-881,-202,6968,-870,-210,6522,-820
#pa5gbw4080a1=-217,6626,-832,-201,7517,-932,-201,7251,-896,-184,7500,-917
#pa5gbw4080a2=-272,3585,-525,-193,5404,-740,-229,4201,-572,-230,4036,-550
#pa5gbw4080a3=-278,3361,-486,-230,4794,-662,-268,3605,-508,-276,3337,-478
maxp2ga0=70
maxp2ga1=72
maxp5ga0=61,61,62,62
maxp5ga1=61,61,62,60
subband5gver=0x4
paparambwver=3
pdoffset2g40mvalid=0
cckpwroffset0=0x3
cckpwroffset1=0x3
pdoffset2g40ma0=0x2
pdoffset2g40ma1=0x3
pdoffset40ma0=0x0022
pdoffset80ma0=0xceff
pdoffset40ma1=0x0123
pdoffset80ma1=0xdfff
cckbw202gpo=0
cckbw20ul2gpo=0
mcsbw202gpo=0x44444444
mcsbw402gpo=0x44444444
dot11agofdmhrbw202gpo=0x2222
ofdmlrbw202gpo=0x0000
mcsbw205glpo=0x33233333
mcsbw405glpo=0x33233333
mcsbw805glpo=0x88888888
mcsbw1605glpo=0
mcsbw205gmpo=0x22222223
mcsbw405gmpo=0x22444444
mcsbw805gmpo=0x8AAAAAAB
mcsbw1605gmpo=0
mcsbw205ghpo=0x44333333
mcsbw405ghpo=0x44444444
mcsbw805ghpo=0x98888888
mcsbw1605ghpo=0
mcslr5glpo=0x0000
mcslr5gmpo=0x0000
mcslr5ghpo=0x0000
sb20in40hrpo=0x0
sb20in80and160hr5glpo=0x0
sb40and80hr5glpo=0x0
sb20in80and160hr5gmpo=0x0
sb40and80hr5gmpo=0x0
sb20in80and160hr5ghpo=0x0
sb40and80hr5ghpo=0x0
sb20in40lrpo=0x0
sb20in80and160lr5glpo=0x0
sb40and80lr5glpo=0x0
sb20in80and160lr5gmpo=0x0
sb40and80lr5gmpo=0x0
sb20in80and160lr5ghpo=0x0
sb40and80lr5ghpo=0x0
dot11agduphrpo=0x0
dot11agduplrpo=0x0
phycal_tempdelta=255
temps_period=15
temps_hysteresis=15
ltecxmux=0
ltecxpadnum=0x0504
ltecxfnsel=0x44
ltecxgcigpio=0x04
#OOB params
#device_wake_opt=1
#host_wake_opt=0
#swctrlmap_2g=0x00000808,0x30300000,0x10100000,0x023010,0x1f8
#swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x003
#swctrlmap_5g=0x00004040,0x80800000,0x00000000,0x000000,0x1ff
#swctrlmapext_5g=0x00000000,0x01010000,0x01010000,0x000000,0x001
swctrlmap_2g=0x00000808,0x00001010,0x00001010,0x020010,0x1f8
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x003
swctrlmap_5g=0x00004040,0x00000000,0x00000000,0x000000,0x1ff
swctrlmapext_5g=0x00000000,0x00000101,0x00000101,0x000000,0x001
#fem_table_init_val=0x0c180000,0x00000000
rssi_delta_5gl_c0=3,3,2,2,5,5
rssi_delta_5gml_c0=0,2,0,2,3,5
rssi_delta_5gmu_c0=0,2,0,2,3,5
rssi_delta_5gh_c0=2,5,2,5,5,8
rssi_delta_5gl_c1=1,1,2,2,3,3
rssi_delta_5gml_c1=-1,1,0,2,1,3
rssi_delta_5gmu_c1=-1,1,0,2,1,3
rssi_delta_5gh_c1=0,3,2,5,3,6
rssi_delta_2g_c0=4,5,4,5
rssi_delta_2g_c1=2,3,2,3
#avs_enab=1
# ########### BTC Dynctl profile params ############
# flags:bit0 - dynctl enabled, bit1 dynamic desense, bit2 dynamic mode
btcdyn_flags=0x7
btcdyn_dflt_dsns_level=0
btcdyn_low_dsns_level=0
btcdyn_mid_dsns_level=7
btcdyn_high_dsns_level=2
btcdyn_default_btc_mode=5
btcdyn_btrssi_hyster=2
# --- number of rows in the array vars below ---
btcdyn_msw_rows=3
btcdyn_dsns_rows=2
# --- mode switch data rows (max is 4) ---
btcdyn_msw_row0=1,8,0,-50,-100
btcdyn_msw_row1=1,4,0,-55,-100
btcdyn_msw_row2=1,0,0,-70,-100
#btcdyn_msw_row3=1,-4,0,-70,-100
# --- desense switching data rows (max is 4) ---
#btcdyn_dsns_row0=5,8,0,-40,-40
btcdyn_dsns_row0=5,4,0,-60,-60
btcdyn_dsns_row1=5,0,0,0,-75
powoffs2gtna0=1,3,3,1,0,0,1,2,2,2,1,1,0,0
powoffs2gtna1=-1,1,1,1,0,0,1,2,3,2,2,0,0,0
#new Jan 4th
#eps_shift0=-1,-6,-1,-5
#eps_shift1=-4,-6,-1,-2
#eps_shift2=-1,9,-2,-6
muxenab=0x10
#bandedge
fdss_level_2g=4,4
fdss_level_5g=5,5
fdss_interp_en=1

Binary file not shown.

View File

@ -0,0 +1,16 @@
ubootconfig=
local_uboot_dir=${nonfree_bin_dir}/u-boot/khadas-vim3
dtb_name=meson-g12b-a311d-khadas-vim3
platform=amlogic
soc_name=a311d
arch=arm64
part_table=msdos
boot_size=512
POST_BOARD_OVERLAY() {
echo "Put ${board} firmware into rootfs..."
# brcmfmac firmware
mkdir -p ${rootfs_dir}/usr/lib/firmware/brcm
cp ${nonfree_bin_dir}/linux-firmware/ap6398s/brcmfmac4359-sdio.bin ${rootfs_dir}/usr/lib/firmware/brcm/brcmfmac4359-sdio.khadas,vim3.bin
cp ${nonfree_bin_dir}/linux-firmware/ap6398s/brcmfmac4359-sdio.txt ${rootfs_dir}/usr/lib/firmware/brcm/brcmfmac4359-sdio.khadas,vim3.txt
cp ${nonfree_bin_dir}/linux-firmware/ap6398s/BCM4359C0.hcd ${rootfs_dir}/usr/lib/firmware/brcm
}

View File

@ -162,6 +162,12 @@ make_kernel(){
LOG "make kernel(${default_defconfig}) begin..."
kernel_dir_tmp=$1
pushd "${kernel_dir_tmp}"
if [ -f ${cur_dir}/configs/rockchip/${kernel_defconfig} ];then
LOG "use local kernel defconfig: ${kernel_defconfig}"
cp ${cur_dir}/configs/rockchip/${kernel_defconfig} arch/arm64/configs
fi
if [ -n "${kernel_defconfig}" ]; then
if [ "x${kernel_defconfig:0:1}" != "x/" ]; then
if [ ! -f arch/arm64/configs/${kernel_defconfig} ]; then
@ -193,6 +199,7 @@ make_kernel(){
fi
fi
fi
cp ${kernel_defconfig} .config
make ARCH=arm64 olddefconfig
kernel_defconfig=${kernel_defconfig##*/}
@ -265,6 +272,8 @@ mk_boot() {
bootargs=${phytium_bootargs}
elif [ "${platform}" == "allwinner" ];then
bootargs=${allwinner_bootargs}
elif [ "${platform}" == "amlogic" ];then
bootargs=${amlogic_bootargs}
else
echo "Unsupported platform"
exit 2
@ -310,6 +319,7 @@ source ${cur_dir}/boards/${board}.conf
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"
amlogic_bootargs="console=ttyAML0,115200 console=tty1 consoleblank=0 root=UUID=614e0000-0000-4b53-8000-1d28000054a9 rootwait rootfstype=ext4 splash=verbose coherent_pool=2M loglevel=8"
if [ -n "${default_defconfig}" ]; then
if [ ! -f $default_defconfig ] ; then

View File

@ -134,6 +134,8 @@ use_prebuild_u-boot() {
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
elif [[ "x${platform}" == "xamlogic" ]]; then
cp ${local_uboot_dir}/* ${workdir}/u-boot
else
echo "target u-boot can not found!"
exit 2

File diff suppressed because it is too large Load Diff

0
scripts/configs/rockchip/chroot.sh Normal file → Executable file
View File

0
scripts/configs/rockchip/rcS.sh Normal file → Executable file
View File

View File

@ -259,6 +259,15 @@ make_img(){
ERROR "allwinner u-boot file can not be found!"
exit 2
fi
elif [ "${platform}" == "amlogic" ];then
echo "Installing Amlogic U-Boot..."
if [ -f ${uboot_dir}/u-boot.bin ]; then
dd if=${uboot_dir}/u-boot.bin of=/dev/${loopX} bs=1 count=442 conv=fsync
dd if=${uboot_dir}/u-boot.bin of=/dev/${loopX} bs=512 skip=1 seek=1 conv=fsync
else
ERROR "amlogic u-boot file can not be found!"
exit 2
fi
elif [ "${platform}" != "broadcom" ];then
echo "Unsupported platform"
fi