Browse Source

!9 support phytiumpi

Merge pull request !9 from weishanshan/master
pull/10/head
guochunrong2020 1 year ago
committed by Gitee
parent
commit
eb21ff9a51
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
  1. 53
      README.md
  2. 11
      board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh
  3. 2
      board/phytium/common/ubuntu-additional_packages_list
  4. 2
      board/phytium/common/ubuntu-package-installer
  5. 24
      board/phytium/genimage-phytiumpi.cfg
  6. 2
      configs/phytium_d2000_defconfig
  7. 1
      configs/phytium_d2000_jailhouse.config
  8. 5
      configs/phytium_d2000_ubuntu_defconfig
  9. 70
      configs/phytium_d2000_ubuntu_desktop_defconfig
  10. 1
      configs/phytium_e2000_jailhouse_4.19.config
  11. 1
      configs/phytium_e2000_jailhouse_5.10.config
  12. 82
      configs/phytiumpi_defconfig
  13. 70
      configs/phytiumpi_ubuntu_desktop_defconfig
  14. 2
      package/Config.in
  15. 33
      package/genimage/0001-image-hd-remove-MBR-space.patch
  16. 5
      package/jailhouse/jailhouse.mk
  17. 2
      package/phytium-tools/Config.in
  18. 21
      package/phytium-tools/phytium-tools.mk
  19. BIN
      package/phytium-tools/src/.01_debian.conf.swp
  20. BIN
      package/phytium-tools/src/dark.jpg
  21. BIN
      package/phytium-tools/src/rtk_hciattach
  22. BIN
      package/phytium-tools/src/rtlbt/rtl8821c_config
  23. BIN
      package/phytium-tools/src/rtlbt/rtl8821c_fw
  24. 11
      package/phytium-tools/src/systemd-hciattach.service
  25. 12
      package/phyuboot/Config.in
  26. 25
      package/phyuboot/phyuboot.mk
  27. BIN
      package/phyuboot/src/fip-all-2GB.bin
  28. BIN
      package/phyuboot/src/fip-all-4GB.bin
  29. 59
      package/phyuboot/src/kernel.its
  30. BIN
      package/phyuboot/src/mkimage

53
README.md

@ -50,12 +50,16 @@ phytium_d2000_debian_defconfig - Build for phytium_d2000_debian
phytium_d2000_debian_desktop_defconfig - Build for phytium_d2000_debian_desktop
phytium_d2000_defconfig - Build for phytium_d2000
phytium_d2000_ubuntu_defconfig - Build for phytium_d2000_ubuntu
phytium_d2000_ubuntu_desktop_defconfig - Build for phytium_d2000_ubuntu_desktop
phytium_d2000_ubuntu_qt5_defconfig - Build for phytium_d2000_ubuntu_qt5
phytium_e2000_debian_defconfig - Build for phytium_e2000_debian
phytium_e2000_debian_desktop_defconfig - Build for phytium_e2000_debian_desktop
phytium_e2000_defconfig - Build for phytium_e2000
phytium_e2000_ubuntu_defconfig - Build for phytium_e2000_ubuntu
phytium_e2000_ubuntu_desktop_defconfig - Build for phytium_e2000_ubuntu_desktop
phytium_initrd_defconfig - Build for phytium_initrd
phytiumpi_defconfig - Build for phytiumpi
phytiumpi_ubuntu_desktop_defconfig - Build for phytiumpi_ubuntu_desktop
```
# 编译文件系统
@ -178,7 +182,7 @@ linux-loader.bin安装到/usr/local/libexec/jailhouse;jailhouse和ivshmem-demo
python helper脚本安装到/usr/local/libexec/jailhouse;jailhouse-config-collect.tmpl和root-cell-config.c.tmpl
安装到/usr/local/share/jailhouse;jailhouse-completion.bash安装到/usr/share/bash-completion/completions/并改名为jailhouse;
另外,还将configs/*/*.cell安装到/etc/jailhouse;inmates/demos/*/*.bin安装到/usr/local/libexec/jailhouse/demos;
pyjailhouse安装到/usr/lib/python3.10/site-packages。
pyjailhouse安装到/usr/local/lib/python3.8/dist-packages。
```
关于jailhouse的使用方法等更多信息,请参考`https://gitee.com/phytium_embedded/phytium-jailhouse/blob/master/Readme.md`
@ -220,6 +224,7 @@ $ make
其中`phytium_d2000_xxx_defconfig`为以下文件系统之一:
```
phytium_d2000_ubuntu_defconfig
phytium_d2000_ubuntu_desktop_defconfig
phytium_d2000_defconfig
phytium_d2000_debian_defconfig
phytium_d2000_debian_desktop_defconfig
@ -249,6 +254,20 @@ qt5相关的文件被安装到根文件系统的/usr目录:
`./support/kconfig/merge_config.sh configs/phytium_d2000_ubuntu_defconfig configs/phytium_d2000_jailhouse.config`
其余步骤与为e2000编译jailhouse的步骤相同。
## 为phytiumpi编译SD卡镜像
(1)加载defconfig
`$ make phytiumpi_xxx_defconfig`
其中`phytiumpi_xxx_defconfig`为以下文件系统之一:
```
phytiumpi_defconfig
phytiumpi_ubuntu_desktop_defconfig
```
(2)编译
`$ make`
(3)镜像的输出位置
生成的根文件系统、内核位于 output/images 目录。 sdcard.img 就是 SD 的镜像文件。
后续部署及使用方法,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/phytiumpi/linux`
# 在开发板上启动文件系统
## 在e2000开发板上启动文件系统
### 使用U-Boot启动文件系统(手动分区)
@ -292,7 +311,8 @@ U盘:
### 使用U-Boot启动文件系统(使用e2000 img 镜像)
(1)将e2000 img 镜像(disk.img)写入SATA盘或U盘:
`$ sudo dd if=xxx/phytium-linux-buildroot/output/images/disk.img of=/dev/sdb bs=1M`
`$ sudo dd if=xxx/phytium-linux-buildroot/output/images/disk.img of=/dev/sdb bs=1M`
`$ sync`
(2)SATA盘或U盘接到开发板,启动开发板电源,串口输出U-Boot命令行,设置U-Boot环境变量,启动文件系统
SATA盘:
@ -355,30 +375,28 @@ U盘:
```
# ubuntu系统安装桌面
## e2000 ubuntu系统安装桌面
`phytium_e2000_ubuntu_desktop_defconfig`默认安装了xfce桌面,配置并编译它就可以获得带xfce桌面的
ubuntu系统。如果需要在开发板上安装其他桌面,重新配置并编译`phytium_e2000_ubuntu_defconfig`,
然后在开发板启动这个不带桌面的ubuntu系统:
### 登录
`phytium_e2000_ubuntu_desktop_defconfig`和`phytium_d2000_ubuntu_desktop_defconfig`默认安装了xfce桌面,配置并编译它就可以获得带
xfce桌面的ubuntu系统。如果需要在开发板上安装其他桌面,重新配置并编译`phytium_e2000_ubuntu_defconfig`或`phytium_d2000_ubuntu_defconfig`,
然后在开发板启动这个不带桌面的ubuntu系统。
## 登录
ubuntu系统包含了超级用户root,和一个普通用户user,密码和用户名相同。
### 动态获取 IP 地址
## 动态获取 IP 地址
```
$ sudo dhclient
$ ping www.baidu.com
```
### 安装桌面
#### 安装GNOME桌面
## 安装桌面
### 安装GNOME桌面
```
$ sudo apt update
$ sudo apt -y install ubuntu-gnome-desktop
```
#### 安装KDE桌面
### 安装KDE桌面
```
$ sudo apt update
$ sudo apt -y install kubuntu-desktop
```
#### 安装XFCE桌面
### 安装XFCE桌面
```
$ sudo apt update
$ sudo apt -y install xfce4 xfce4-terminal
@ -386,15 +404,6 @@ $ sudo apt -y install xfce4 xfce4-terminal
安装完成后重启系统,在图形登录界面点击用户名右边的ubuntu logo按钮,选择桌面环境为“Xfce Session”,输入密码登录。
```
## d2000 ubuntu系统安装桌面
`phytium_d2000_ubuntu_defconfig`默认不安装桌面,如果需要安装桌面:
(1)编辑`phytium_d2000_ubuntu_defconfig`,将`#BR2_PACKAGE_ROOTFS_DESKTOP=y`取消注释
(2)重新配置并编译`phytium_d2000_ubuntu_defconfig`
```
$ make phytium_d2000_ubuntu_defconfig
$ make
```
# ubuntu及debian系统支持linux-headers
linux-headers包含构建内核外部模块所需的头文件,编译ubuntu和debian的defconfig会生成linux-headers。
关于如何编译内核外部模块,可参考https://www.kernel.org/doc/html/latest/kbuild/modules.html

11
board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh

@ -170,6 +170,8 @@ plat_name()
echo "D2000"
elif grep -Eq "^BR2_TARGET_GENERIC_HOSTNAME=\"E2000\"$" ${BR2_CONFIG}; then
echo "E2000"
elif grep -Eq "^BR2_TARGET_GENERIC_HOSTNAME=\"phytiumpi\"$" ${BR2_CONFIG}; then
echo "phytiumpi"
fi
}
@ -317,6 +319,10 @@ main()
make vpu-lib-rebuild ${O:+O=$O}
fi
if grep -Eq "^BR2_PACKAGE_PHYTIUM_TOOLS=y$" ${BR2_CONFIG}; then
make phytium-tools-rebuild ${O:+O=$O}
fi
if grep -Eq "^BR2_PACKAGE_FFMPEG=y$" ${BR2_CONFIG}; then
make ffmpeg-rebuild ${O:+O=$O}
fi
@ -346,11 +352,6 @@ main()
make jailhouse-rebuild ${O:+O=$O}
fi
if grep -Eq "^BR2_PACKAGE_PYTHON3=y$" ${BR2_CONFIG}; then
make libffi-rebuild ${O:+O=$O}
make python3-rebuild ${O:+O=$O}
fi
# change the priority order of the shared library directories
sed -i '1 i /usr/local/lib' $1/etc/ld.so.conf
sudo chroot $1 ldconfig

2
board/phytium/common/ubuntu-additional_packages_list

@ -2,5 +2,5 @@
additional_full_packages_list=" "
# for Lite userland gathered from main repo
additional_base_packages_list="net-tools iputils-ping gcc g++ vim make autoconf automake libtool pkg-config bison bc flex libssl-dev openssh-server \
additional_base_packages_list="net-tools iputils-ping gcc g++ vim make autoconf automake libtool pkg-config bison bc flex libssl-dev openssh-server python-is-python3 \
libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-pulseaudio "

2
board/phytium/common/ubuntu-package-installer

@ -82,7 +82,7 @@ do_distrorfs_second_stage() {
echo 'user-session=xfce' >> /etc/lightdm/lightdm.conf
fi
if [ $5 = E2000 ]; then
if [ $5 = E2000 ] || [ $5 = phytiumpi ]; then
echo 'defaults.pcm.!card phytiumpe220xi2' >> /etc/asound.conf
echo 'defaults.ctl.!card phytiumpe220xi2' >> /etc/asound.conf
fi

24
board/phytium/genimage-phytiumpi.cfg

@ -0,0 +1,24 @@
image sdcard.img {
hdimage {
}
partition uboot {
in-partition-table = no
offset = 0
image = "fip-all.bin"
size = 3M
}
partition bootload {
in-partition-table = no
offset = 4M
image = "fitImage"
size = 60M
}
partition root {
partition-type = 0x83
image = "rootfs.ext2"
size = 16G
}
}

2
configs/phytium_d2000_defconfig

@ -5,7 +5,7 @@ BR2_cortex_a53=y
# Filesystem
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="200M"
BR2_TARGET_ROOTFS_EXT2_SIZE="1G"
# Hostname and issue
BR2_TARGET_GENERIC_HOSTNAME="D2000"

1
configs/phytium_d2000_jailhouse.config

@ -3,7 +3,6 @@ BR2_PACKAGE_JAILHOUSE=y
# jailhouse helper scripts
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_ZLIB=y
BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS=y
# kernel patch for d2000 and ft2004

5
configs/phytium_d2000_ubuntu_defconfig

@ -49,7 +49,6 @@ BR2_ROOTFS_LINUX_HEADERS=y
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_ARM64_EFI=y
# Serial port config
BR2_TARGET_GENERIC_GETTY=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
@ -59,13 +58,9 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
#BR2_PACKAGE_ROOTFS_DESKTOP=y
BR2_PACKAGE_XORG_ROGUE_UMLIBS=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000"
# FFmpeg
BR2_PACKAGE_FFMPEG=y

70
configs/phytium_d2000_ubuntu_desktop_defconfig

@ -0,0 +1,70 @@
# Architecture
BR2_aarch64=y
BR2_cortex_a53=y
# Filesystem
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="5G"
BR2_ROOTFS_CHOWN=y
# custom skeleton
BR2_ROOTFS_SKELETON_UBUNTU=y
BR2_ROOTFS_SKELETON_CUSTOM=y
BR2_ROOTFS_SKELETON_CUSTOM_SITE="http://cdimage.ubuntu.com/ubuntu-base/releases/20.04.4/release"
BR2_ROOTFS_SKELETON_CUSTOM_SOURCE="ubuntu-base-20.04.1-base-arm64.tar.gz"
BR2_ROOTFS_SKELETON_CUSTOM_SITE_METHOD="wget"
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT="tar zxvf"
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT_IGNORE_ERROR=y
BR2_ROOTFS_POST_BUILD_SCRIPT="board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh"
BR2_INIT_NONE=y
# Hostname and issue
BR2_TARGET_GENERIC_HOSTNAME="D2000"
BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium Buildroot"
# toolchain
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64=y
BR2_TOOLCHAIN_USES_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_GLIBC=y
# Linux headers same as kernel
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="file://$(TOPDIR)/files/linux-4.19.tar.gz"
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/sdk.config"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/d2000-devboard-dsk phytium/ft2004-devboard-d4-dsk"
BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_ROOTFS_LINUX_HEADERS=y
# Bootloader
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_ARM64_EFI=y
# Serial port config
BR2_TARGET_GENERIC_GETTY=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
# required tools to create the microSD image
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_ROOTFS_DESKTOP=y
BR2_PACKAGE_XORG_ROGUE_UMLIBS=y
BR2_PACKAGE_BUSYBOX=n
# Vpu-lib
BR2_PACKAGE_VPU_LIB=y
BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000"
# FFmpeg
BR2_PACKAGE_FFMPEG=y

1
configs/phytium_e2000_jailhouse_4.19.config

@ -3,7 +3,6 @@ BR2_PACKAGE_JAILHOUSE=y
# jailhouse helper scripts
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_ZLIB=y
BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS=y
# kernel 4.19

1
configs/phytium_e2000_jailhouse_5.10.config

@ -3,7 +3,6 @@ BR2_PACKAGE_JAILHOUSE=y
# jailhouse helper scripts
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON3_ZLIB=y
BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS=y
# kernel patch for e2000 linux-5.10

82
configs/phytiumpi_defconfig

@ -0,0 +1,82 @@
# Architecture
BR2_aarch64=y
# Toolchain
BR2_TOOLCHAIN_EXTERNAL=y
# Hostname and issue
BR2_TARGET_GENERIC_HOSTNAME="phytiumpi"
BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium PI"
# system configuration
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
BR2_ROOTFS_OVERLAY="board/phytium/common/busybox_init_overlay"
# Filesystem
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="2G"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-phytiumpi.cfg"
# Bootloader
BR2_TARGET_GRUB2=y
BR2_PACKAGE_PHYUBOOT=y
BR2_PACKAGE_PHYUBOOT_RAMSIZE="4GB"
# required tools to create the microSD image
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git"
# kernel 5.10
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_phytiumpios-v1.0"
BR2_LINUX_KERNEL_DEFCONFIG="phytiumpi_firefly"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly"
BR2_LINUX_KERNEL_IMAGEGZ=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
# Target packages
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_GZIP=y
BR2_PACKAGE_GDB=y
BR2_PACKAGE_NETPERF=y
BR2_PACKAGE_RT_TESTS=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_GREP=y
BR2_PACKAGE_CIFS_UTILS=y
BR2_PACKAGE_E2FSPROGS=y
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
BR2_PACKAGE_MTD=y
BR2_PACKAGE_I2C_TOOLS=y
BR2_PACKAGE_PCIUTILS=y
BR2_PACKAGE_SYSSTAT=y
BR2_PACKAGE_FLICKCURL=y
BR2_PACKAGE_FLICKCURL_UTILS=y
BR2_PACKAGE_LIBCURL_CURL=y
BR2_PACKAGE_LIBCURL_VERBOSE=y
BR2_PACKAGE_COLLECTD=y
BR2_PACKAGE_COLLECTD_CURL=y
BR2_PACKAGE_COLLECTD_CURL_JSON=y
BR2_PACKAGE_COLLECTD_CURL_XML=y
BR2_PACKAGE_DHCPCD=y
BR2_PACKAGE_ETHTOOL=y
BR2_PACKAGE_IPERF=y
BR2_PACKAGE_IPERF3=y
BR2_PACKAGE_IPROUTE2=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_TCPDUMP=y
BR2_PACKAGE_WGET=y
BR2_PACKAGE_WIRELESS_REGDB=y
BR2_PACKAGE_PROCPS_NG=y
BR2_PACKAGE_NANO=y
BR2_PACKAGE_VIM=y

70
configs/phytiumpi_ubuntu_desktop_defconfig

@ -0,0 +1,70 @@
# Architecture
BR2_aarch64=y
BR2_cortex_a53=y
# Filesystem
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="15G"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-phytiumpi.cfg"
# custom skeleton
BR2_ROOTFS_SKELETON_UBUNTU=y
BR2_ROOTFS_SKELETON_CUSTOM=y
BR2_ROOTFS_SKELETON_CUSTOM_SITE="http://cdimage.ubuntu.com/ubuntu-base/releases/20.04.4/release"
BR2_ROOTFS_SKELETON_CUSTOM_SOURCE="ubuntu-base-20.04.1-base-arm64.tar.gz"
BR2_ROOTFS_SKELETON_CUSTOM_SITE_METHOD="wget"
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT="tar zxvf"
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT_IGNORE_ERROR=y
BR2_ROOTFS_POST_BUILD_SCRIPT="board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh"
BR2_INIT_NONE=y
BR2_ROOTFS_CHOWN=y
# Hostname and issue
BR2_TARGET_GENERIC_HOSTNAME="phytiumpi"
BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium PI"
# toolchain
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64=y
BR2_TOOLCHAIN_USES_GLIBC=y
BR2_TOOLCHAIN_EXTERNAL_GLIBC=y
# Linux headers same as kernel
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git"
# kernel 5.10
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_phytiumpios-v1.0"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_DEFCONFIG="phytiumpi_firefly"
BR2_LINUX_KERNEL_IMAGEGZ=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_ROOTFS_LINUX_HEADERS=y
# Bootloader
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_ARM64_EFI=y
BR2_PACKAGE_PHYUBOOT=y
BR2_PACKAGE_PHYUBOOT_RAMSIZE="4GB"
# Serial port config
BR2_TARGET_GENERIC_GETTY=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
# required tools to create the microSD image
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_ROOTFS_DESKTOP=y
BR2_PACKAGE_BUSYBOX=n
# Bluetooth config tools
BR2_PACKAGE_PHYTIUM_TOOLS=y

2
package/Config.in

@ -438,6 +438,8 @@ menu "Firmware"
source "package/zd1211-firmware/Config.in"
source "package/xorg-rogue-umlibs/Config.in"
source "package/vpu-lib/Config.in"
source "package/phytium-tools/Config.in"
source "package/phyuboot/Config.in"
endmenu
source "package/18xx-ti-utils/Config.in"
source "package/a10disp/Config.in"

33
package/genimage/0001-image-hd-remove-MBR-space.patch

@ -0,0 +1,33 @@
From 0facda308510839f33c34b3416080d9e72e51440 Mon Sep 17 00:00:00 2001
From: Chunrong Guo <guochunrong@phytium.com.cn>
Date: Wed, 14 Jun 2023 13:55:16 +0800
Subject: [PATCH] image-hd: remove MBR space
Signed-off-by: Chunrong Guo <guochunrong@phytium.com.cn>
---
image-hd.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/image-hd.c b/image-hd.c
index 5e3a3b4..09affcd 100644
--- a/image-hd.c
+++ b/image-hd.c
@@ -859,15 +859,6 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
part->name);
return -EINVAL;
}
- if (!part->extended) {
- int ret = check_overlap(image, part);
- if (ret)
- return ret;
- } else if (now > part->offset) {
- image_error(image, "part %s overlaps with previous partition\n",
- part->name);
- return -EINVAL;
- }
if (part->in_partition_table && (part->size % 512)) {
image_error(image, "part %s size (%lld) must be a "
"multiple of 1 sector (512 bytes)\n",
--
2.25.1

5
package/jailhouse/jailhouse.mk

@ -51,7 +51,10 @@ define JAILHOUSE_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/src/jailhouse/inmates/demos/*/*.bin $(TARGET_DIR)/usr/local/libexec/jailhouse/demos
$(if $(BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS), \
cd $(@D)/src/jailhouse && $(PKG_PYTHON_SETUPTOOLS_ENV) $(HOST_DIR)/bin/python setup.py install --no-compile $(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS))
cd $(@D)/src/jailhouse && $(PKG_PYTHON_SETUPTOOLS_ENV) $(HOST_DIR)/bin/python setup.py install --no-compile $(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS) && \
mkdir -p $(TARGET_DIR)/usr/local/lib/python3.8/dist-packages && \
mv $(TARGET_DIR)/usr/lib/python3.10/site-packages/pyjailhouse $(TARGET_DIR)/usr/local/lib/python3.8/dist-packages && \
mv $(TARGET_DIR)/usr/lib/python3.10/site-packages/pyjailhouse-0.12-py3.10.egg-info $(TARGET_DIR)/usr/local/lib/python3.8/dist-packages/pyjailhouse-0.12-py3.8.egg-info)
endef
$(eval $(generic-package))

2
package/phytium-tools/Config.in

@ -0,0 +1,2 @@
config BR2_PACKAGE_PHYTIUM_TOOLS
bool "phytium_tools"

21
package/phytium-tools/phytium-tools.mk

@ -0,0 +1,21 @@
################################################################################
#
# phytium-tools
#
################################################################################
PHYTIUM_TOOLS_VERSION = 0.1
PHYTIUM_TOOLS_SITE = package/phytium-tools/src
PHYTIUM_TOOLS_SITE_METHOD = local
PHYTIUM_TOOLS_INSTALL_TARGET_CMDS = YES
define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/bin
mkdir -p $(TARGET_DIR)/lib/firmware/rtlbt
mkdir -p $(TARGET_DIR)/lib/systemd/system/
$(INSTALL) -m 755 -D $(@D)/rtlbt/* $(TARGET_DIR)/lib/firmware/rtlbt/
$(INSTALL) -m 755 -D $(@D)/rtk_hciattach $(TARGET_DIR)/usr/bin/
$(INSTALL) -m 644 -D $(@D)/systemd-hciattach.service $(TARGET_DIR)/lib/systemd/system/
endef
$(eval $(generic-package))

BIN
package/phytium-tools/src/.01_debian.conf.swp

Binary file not shown.

BIN
package/phytium-tools/src/dark.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

BIN
package/phytium-tools/src/rtk_hciattach

Binary file not shown.

BIN
package/phytium-tools/src/rtlbt/rtl8821c_config

Binary file not shown.

BIN
package/phytium-tools/src/rtlbt/rtl8821c_fw

Binary file not shown.

11
package/phytium-tools/src/systemd-hciattach.service

@ -0,0 +1,11 @@
[Unit]
Description=rtk_hciattach
DefaultDependencies=no
After=NetworkManager.service
[Service]
ExecStart=/usr/bin/rtk_hciattach -n -s 115200 ttyAMA0 rtk_h5
Restart=on-failure
[Install]
WantedBy=multi-user.target

12
package/phyuboot/Config.in

@ -0,0 +1,12 @@
config BR2_PACKAGE_PHYUBOOT
bool "phyuboot"
help
Phytium Pi uboot firmware
if BR2_PACKAGE_PHYUBOOT
config BR2_PACKAGE_PHYUBOOT_RAMSIZE
string "ram size"
help
This is a comment that defines ram size is, 2G or 4g
endif

25
package/phyuboot/phyuboot.mk

@ -0,0 +1,25 @@
################################################################################
#
# Phytium Pi uboot
#
################################################################################
PHYUBOOT_VERSION = 1.32
PHYUBOOT_SITE = package/phyuboot/src
PHYUBOOT_SITE_METHOD = local
PHYUBOOT_DEPENDENCIES = linux host-dtc
MKIMAGE_PI = $(HOST_DIR)/bin/mkimage_phypi
# The only available license files are in PDF and RTF formats, and we
# support only plain text.
PHYUBOOT_INSTALL_IMAGES = YES
PHYUBOOT_RAMSIZE = $(BR2_PACKAGE_PHYUBOOT_RAMSIZE)
define PHYUBOOT_INSTALL_IMAGES_CMDS
$(INSTALL) -D -m 0777 $(@D)/fip-all-$(BR2_PACKAGE_PHYUBOOT_RAMSIZE).bin $(BINARIES_DIR)/fip-all.bin
$(INSTALL) -D -m 0777 $(@D)/kernel.its $(BINARIES_DIR)/kernel.its
$(INSTALL) -D -m 755 $(@D)/mkimage $(HOST_DIR)/bin/mkimage_phypi
$(MKIMAGE_PI) -f $(BINARIES_DIR)/kernel.its $(BINARIES_DIR)/fitImage
endef
$(eval $(generic-package))

BIN
package/phyuboot/src/fip-all-2GB.bin

Binary file not shown.

BIN
package/phyuboot/src/fip-all-4GB.bin

Binary file not shown.

59
package/phyuboot/src/kernel.its

@ -0,0 +1,59 @@
/*
* Compilation:
* mkimage -f fit_kernel_dtb.its fit_kernel_dtb.itb
*
* Files in linux build dir:
* - arch/arm/boot/Image (zImage-old-ok)
* - arch/arm/boot/dts/ft.dtb
*
* fatload usb 0:1 0x90100000 fit_kernel_dtb.itb
* bootm 0x90100000#e2000
*
*/
/dts-v1/;
/ {
description = "U-Boot fitImage for Phytium Phytiumpi";
#address-cells = <1>;
images {
kernel {
description = "Linux kernel";
data = /incbin/("Image.gz");
type = "kernel";
arch = "arm64";
os = "linux";
compression = "gzip";
load = <0x80080000>;
entry = <0x80080000>;
hash-1 {
algo = "sha1";
};
};
fdt-phytium {
description = "FDT phytiumpi";
data = /incbin/("phytiumpi_firefly.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
hash-1 {
algo = "sha1";
};
};
};
configurations {
default = "phytium@cecport";
phytium {
description = "phytimpi";
kernel = "kernel";
fdt = "fdt-phytium";
hash-1 {
algo = "sha1";
};
};
};
};

BIN
package/phyuboot/src/mkimage

Binary file not shown.
Loading…
Cancel
Save