diff --git a/README.md b/README.md index 4cf68a954dbca95695f36937a6ed50c5aca4300a..7c1e29414e98477a5d37088776bd5eeebb6af189 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,85 @@ defconfig默认不编译Phytium-optee,如果需要编译Phytium-optee请执行 生成的根文件系统、内核、TEE OS位于output/images目录。 后续部署及使用方法,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/optee` +### 支持xenomai +本项目还支持编译xenomai,关于xenomai的信息请参考:`https://gitee.com/phytium_embedded/linux-kernel-xenomai` +支持将xenomai内核及用户态的库、工具编译安装到debian系统上。如果需要编译xenomai请执行: +(1)使用phytiumpi_defconfig或者phytiumpi_desktop_defconfig作为基础配置项,合并支持xenomai的配置: +`$ ./support/kconfig/merge_config.sh configs/phytiumpi_xxx_defconfig configs/phytiumpi_xenomai_xxx.config` +`phytiumpi_xenomai_xxx.config`为以下配置片段文件之一: +``` +phytiumpi_xenomai_cobalt_6.6.config (xenomai cobalt 6.6内核+xenomai-v3.3.tar.gz") +phytiumpi_xenomai_mercury_6.6.config (linux 6.6 rt内核+xenomai-v3.3.tar.gz) +``` +(2)编译 +`$ make` +(3)镜像的输出位置 +生成的根文件系统、内核、sdcard.img 镜像位于output/images目录。 +(4)文件的安装路径 +xenomai用户态的库、工具被安装到根文件系统的/usr/xenomai目录。 +关于xenomai的启动及测试工具等更多信息,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/linux/xenomai` + +### 支持ethercat +本项目还支持编译ethercat,关于ethercat的信息请参考:`https://gitee.com/phytium_embedded/ether-cat` +支持将ethercat驱动及用户态的库、工具编译安装到debian系统上,ethercat支持linux 6.6 rt和xenomai cobalt 6.6内核。如果需要编译ethercat请执行: +(1)使用phytiumpi_defconfig或者phytiumpi_desktop_defconfig作为基础配置项,合并支持rt内核,及ethercat的配置: +`./support/kconfig/merge_config.sh configs/phytiumpi_xxx_defconfig configs/phytiumpi_linux_6.6_rt.config configs/phytiumpi_ethercat.config` +或者合并支持xenomai内核: +`./support/kconfig/merge_config.sh configs/phytiumpi_xxx_defconfig configs/phytiumpi_xenomai_cobalt_6.6.config configs/phytiumpi_ethercat.config` +(2)编译 +`$ make` +(3)镜像的输出位置 +生成的根文件系统、内核、img 镜像位于output/images目录。 +(4)文件的安装路径 +将ethercat的驱动模块安装到根文件系统的/lib/modules/version/ethercat/目录,并且通过将ec_macb加入/etc/modprobe.d/blacklist.conf +黑名单的方式,使得开机时不自动加载ec_macb模块,而是让用户手动加载。 +ethercat用户态的库、工具被安装到根文件系统: +配置文件安装到/etc,其它内容分别被安装到/usr目录下的bin,include,lib,sbin,share。 +关于ethercat的使用方法等更多信息,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/linux/ethercat` + +### 支持jailhouse +本项目还支持编译jailhouse,关于jailhouse的信息请参考:`https://gitee.com/phytium_embedded/phytium-jailhouse` +支持将jailhouse编译安装到debian系统上,如果需要编译jailhouse请执行: +(1)使用phytiumpi_defconfig或者phytiumpi_desktop_defconfig作为基础配置项,合并支持jailhouse的配置: +`./support/kconfig/merge_config.sh configs/phytiumpi_xxx_defconfig configs/phytiumpi_jailhouse.config` +(2)编译 +`$ make` +(3)镜像的输出位置 +生成的根文件系统、内核、img 镜像位于output/images目录。 +(4)文件的安装路径 +jailhouse相关的文件被安装到根文件系统: +``` +按照Makefile中的规则, +将jailhouse的驱动jailhouse.ko安装到/lib/modules/version/jailhouse/driver; +jailhouse.bin安装到/lib/firmware; +linux-loader.bin安装到/usr/libexec/jailhouse; +jailhouse和ivshmem-demo安装到/usr/sbin; +python helper脚本安装到/usr/libexec/jailhouse; +jailhouse-config-collect.tmpl和root-cell-config.c.tmpl安装到/usr/share/jailhouse; +jailhouse-completion.bash安装到/usr/share/bash-completion/completions/并改名为jailhouse; +另外,还将configs/*/*.cell安装到/etc/jailhouse; +inmates/demos/*/*.bin安装到/usr/libexec/jailhouse/demos; +configs/arm64/dts/*.dtb安装到/usr/libexec/jailhouse/dtb; +pyjailhouse安装到/usr/lib/python3.11/site-packages, +通过/usr/lib/python3/dist-packages/pyjailhouse.pth文件,将pyjailhouse模块添加到python模块的搜索路径。 +``` +关于jailhouse的使用方法等更多信息,请参考`https://gitee.com/phytium_embedded/phytium-jailhouse/blob/master/Readme.md` + +### 支持openamp +本项目还支持编译openamp,编译OpenAMP裸跑二进制镜像请参考:`https://gitee.com/phytium_embedded/phytium-standalone-sdk`,编译OpenAMP FreeRTOS二进制镜像请参考:`https://gitee.com/phytium_embedded/phytium-free-rtos-sdk` +支持将openamp二进制镜像、用户空间测试程序安装到debian系统上,openamp只支持linux 6.6内核。如果需要编译openamp请执行: +(1)使用phytiumpi_defconfig或者phytiumpi_desktop_defconfig作为基础配置项,合并支持openamp的配置: +`./support/kconfig/merge_config.sh configs/phytiumpi_xxx_defconfig configs/openamp_xxx.config` +其中,`openamp_xxx.config`为`openamp_standalone.config`或`openamp_free_rtos.config`。 +(2)编译 +`$ make` +(3)镜像的输出位置 +生成的根文件系统、内核、sdcard.img 镜像位于output/images目录。 +(4)文件的安装路径 +将openamp二进制镜像、用户空间测试程序安装到根文件系统: +openamp_core0.elf安装到/lib/firmware,用户空间测试程序安装到/usr/bin。 +关于openamp的使用方法等更多信息,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/open-amp` + ## 清理编译结果 (1)`$ make clean` 删除所有编译结果,包括output目录下的所有内容。当编译完一个文件系统后,编译另一个文件系统前,需要执行此命令。 @@ -150,18 +229,24 @@ LINUX_OVERRIDE_SRCDIR指定了一个本地的内核源码目录,这样就不 如果编译的是phytiumpi_desktop_defconfig,使用第一条命令; 如果编译的是phytiumpi_defconfig,使用第二条命令。 (2)SD卡接到开发板,启动开发板电源,启动文件系统 - (3)开发板第一次启动时,系统首先运行phytium-firstlogin程序。该程序的主要功能包括设置root用户密码、创建普通用户、连接网络、设置区域和设置语言环境等。详细见[phytium-firstlogin介绍与使用 -](https://gitee.com/phytium_embedded/phytium-pi-os/wikis/phytium-firstlogin%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8) + (3)开发板第一次启动时,系统首先运行phytium-firstlogin程序。该程序的主要功能包括设置root用户密码、创建普通用户、连接网络、设置区域和设置语言环境、配置固件等。详细见[phytium-firstlogin介绍与使用](https://gitee.com/phytium_embedded/phytium-pi-os/wikis/phytium-firstlogin%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8) (4)开发板运行时,如果需要更换uboot、Image和dtb,可以在飞腾派上执行对应脚本,用法如下: `$ sudo runtime_replace_bootloader.sh all` `$ sudo runtime_replace_bootloader.sh uboot` `$ sudo runtime_replace_bootloader.sh fitImage` 以上三条命令分别实现了更换uboot+Image+dtb、更换uboot和更换Image+dtb的功能,要求当前目录下有fip-all.bin和fitImage文件。 -(5)开发板运行时,如果需要远程升级uboot、Image和dtb,可以在飞腾派上执行对应脚本,用法如下: -`$ sudo phytium_ota all latest` -`$ sudo phytium_ota uboot latest` -`$ sudo phytium_ota fitImage latest` -以上三条命令通过远程分别将uboot+Image+dtb、uboot和Image+dtb升级到最新版本。 +(5)开发板运行时,如果需要远程升级uboot、Image和dtb、rootfs,可以在飞腾派上执行对应脚本,用法如下: +`$ sudo get_phytium_ota all` +`$ sudo get_phytium_ota uboot` +`$ sudo get_phytium_ota fitImage` +`$ sudo get_phytium_ota rootfs` +以上四条命令通过远程分别将整个系统、uboot、Image+dtb和根文件系统升级到最新版本。关于phytium_ota更多信息,可以参考[phytium_ota介绍与使用](https://gitee.com/phytium_embedded/phytium-pi-os/wikis/phytium_ota%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8) +(6)由于不同的开发板的硬件配置有所不同,对应的固件也有变化。开发板运行时,如果需要更新固件uboot的配置,可以在飞腾派上执行ft-config脚本,用法和示例如下: +`$ sudo ft-config {hw|mem|pcie} {type}` +`$ sudo ft-config hw v3` +`$ sudo ft-config mem 8g` +`$ sudo ft-config pcie usb3` +上面三个例子,分别是配置固件支持硬件v3版本、设置内存为8g和设置pcie为usb3。关于ft-config更多信息,可以参考[飞腾派固件配置工具ft-config的介绍与使用](https://gitee.com/phytium_embedded/phytium-pi-os/wikis/%E9%A3%9E%E8%85%BE%E6%B4%BE%E5%9B%BA%E4%BB%B6%E9%85%8D%E7%BD%AE%E5%B7%A5%E5%85%B7ft-config%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8) # 编译内核模块 关于如何编译内核外部模块,可参考https://www.kernel.org/doc/html/latest/kbuild/modules.html diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 7dda5305ca4b350141031bad18b270d014a6f597..67e718647cf95fbf111d4cab51a59c8dd29674c1 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -53,17 +53,11 @@ do_distrorfs_second_stage() { echo installed additional packages. if [ $6 = desktop ]; then - for pkg in task-xfce-desktop arctica-greeter; do + for pkg in task-xfce-desktop; do DEBIAN_FRONTEND=noninteractive apt -y install $pkg || true - rm -rf /usr/share/arctica-greeter/backgrounds/arctica-greeter.png || true - rm -rf /usr/share/arctica-greeter/logo.png || true done rm -f /etc/systemd/system/display-manager.service - sed -i "s/gdm3/lightdm/" /etc/X11/default-display-manager - echo '[SeatDefaults]' >> /etc/lightdm/lightdm.conf - echo 'greeter-session=arctica-greeter' >> /etc/lightdm/lightdm.conf - echo 'user-session=xfce' >> /etc/lightdm/lightdm.conf echo installing desktop packages list packages: $pkglist for pkg in $additional_desktop_packages_list; do @@ -87,6 +81,10 @@ do_distrorfs_second_stage() { if [ -f /etc/cups/cupsd.conf ]; then echo "SSLOptions MinTLS1.2" >> /etc/cups/cupsd.conf fi + + # set the configuration of vim + echo 'set mouse-=a' >> /root/.vimrc + echo 'syntax on' >> /root/.vimrc echo remove packages. DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge parole || exit 1 diff --git a/board/phytium/common/gcc-support-multiarch.specs b/board/phytium/common/gcc-support-multiarch.specs new file mode 100644 index 0000000000000000000000000000000000000000..73a74b264c62ea89fa8d74296a77dfffb5917312 --- /dev/null +++ b/board/phytium/common/gcc-support-multiarch.specs @@ -0,0 +1,2 @@ +*multilib: +. !mabi=lp64;.:../lib64:aarch64-linux-gnu mabi=lp64; diff --git a/board/phytium/common/linux-6.6/scripts/asn1_compiler b/board/phytium/common/linux-6.6/scripts/asn1_compiler index 2a7ae6f4da51739e7a0acf1c07bf8b938c6119ec..b8281252c4516aa44dbcb15af8ffd62bcdf2e351 100755 Binary files a/board/phytium/common/linux-6.6/scripts/asn1_compiler and b/board/phytium/common/linux-6.6/scripts/asn1_compiler differ diff --git a/board/phytium/common/linux-6.6/scripts/basic/fixdep b/board/phytium/common/linux-6.6/scripts/basic/fixdep index 9188a1655a6ef56f38aa7ed396f101a4a1438e7e..286c7e99ba3e994eea3de91f2765ef7d16e93e41 100755 Binary files a/board/phytium/common/linux-6.6/scripts/basic/fixdep and b/board/phytium/common/linux-6.6/scripts/basic/fixdep differ diff --git a/board/phytium/common/linux-6.6/scripts/dtc/dtc b/board/phytium/common/linux-6.6/scripts/dtc/dtc index f16c5b069860543584071f6a100a5994655e0f1e..879c528bbdee5a6641d393e5afef4d559883f05f 100755 Binary files a/board/phytium/common/linux-6.6/scripts/dtc/dtc and b/board/phytium/common/linux-6.6/scripts/dtc/dtc differ diff --git a/board/phytium/common/linux-6.6/scripts/dtc/fdtoverlay b/board/phytium/common/linux-6.6/scripts/dtc/fdtoverlay index a2c4c8a775b14d72353a40994c55002193626cf2..1b0f803a8c4b4ef2ca067a4fc8d4832277ebfbda 100755 Binary files a/board/phytium/common/linux-6.6/scripts/dtc/fdtoverlay and b/board/phytium/common/linux-6.6/scripts/dtc/fdtoverlay differ diff --git a/board/phytium/common/linux-6.6/scripts/kallsyms b/board/phytium/common/linux-6.6/scripts/kallsyms index e7021c5c9aea035acdff4fdd0ddf8396a24cac5e..9964d34519324b2a7c1501af9190e7395a2074d7 100755 Binary files a/board/phytium/common/linux-6.6/scripts/kallsyms and b/board/phytium/common/linux-6.6/scripts/kallsyms differ diff --git a/board/phytium/common/linux-6.6/scripts/kconfig/conf b/board/phytium/common/linux-6.6/scripts/kconfig/conf index 8e21f559431ec926cfa0a75766ab54a2fd46af07..921824b85fb4ec35f8f49f4cd7cee999bffb307e 100755 Binary files a/board/phytium/common/linux-6.6/scripts/kconfig/conf and b/board/phytium/common/linux-6.6/scripts/kconfig/conf differ diff --git a/board/phytium/common/linux-6.6/scripts/mod/mk_elfconfig b/board/phytium/common/linux-6.6/scripts/mod/mk_elfconfig index f992efcdd16af9ef04786719353e06eb59b08e86..50cff4b886e98d5481976ad25ba889bbb5c0b738 100755 Binary files a/board/phytium/common/linux-6.6/scripts/mod/mk_elfconfig and b/board/phytium/common/linux-6.6/scripts/mod/mk_elfconfig differ diff --git a/board/phytium/common/linux-6.6/scripts/mod/modpost b/board/phytium/common/linux-6.6/scripts/mod/modpost index aca799ff9a590306ec1b69c0c66ef3a7345b7986..57509ab65038d3383111b3b72c23b640695054c2 100755 Binary files a/board/phytium/common/linux-6.6/scripts/mod/modpost and b/board/phytium/common/linux-6.6/scripts/mod/modpost differ diff --git a/board/phytium/common/linux-6.6/scripts/sorttable b/board/phytium/common/linux-6.6/scripts/sorttable index bc39e3ade8972f5d289be32b5ba6e92586c7ddd6..9adb29c346b461c2cea06c61c1e5bd4105259fc7 100755 Binary files a/board/phytium/common/linux-6.6/scripts/sorttable and b/board/phytium/common/linux-6.6/scripts/sorttable differ diff --git a/board/phytium/common/post-build.sh b/board/phytium/common/post-build.sh index e49ee3e425b13ae0daa736d7e32bdc58fd43406b..6b6db45bbce0690ada77f014ec9f0032b6653013 100755 --- a/board/phytium/common/post-build.sh +++ b/board/phytium/common/post-build.sh @@ -20,6 +20,8 @@ main() if grep -Eq "^BR2_PACKAGE_PHYTIUM_ZRAM=y$" ${BR2_CONFIG}; then sudo chroot ${1} systemctl enable phytium-zram-config.service fi + # pwm-fan.service + sudo chroot ${1} systemctl enable pwm-fan.service exit $? } diff --git a/board/phytium/common/post-custom-skeleton-debian.sh b/board/phytium/common/post-custom-skeleton-debian.sh index 04e71caf6acde0d690a1762340fb29b64fbbe5bd..2ab25c0d1473c7db8db6f0cb7a2ed3650e877d5d 100755 --- a/board/phytium/common/post-custom-skeleton-debian.sh +++ b/board/phytium/common/post-custom-skeleton-debian.sh @@ -136,7 +136,7 @@ setup_distribution_info () { echo DISTRIB_ID=Phytium > $tgtfile echo DISTRIB_RELEASE=1.0 >> $tgtfile echo DISTRIB_CODENAME=1.0 >> $tgtfile - echo 'DISTRIB_DESCRIPTION="Phytium Pi OS V2.0"' >> $tgtfile + echo 'DISTRIB_DESCRIPTION="Phytium Pi OS V2.1"' >> $tgtfile tgtfile=$RFSDIR/etc/update-motd.d/00-header echo '#!/bin/sh' > $tgtfile @@ -202,7 +202,7 @@ debian_distro() main() { # $1 - the current rootfs directory, skeleton-custom or target - rm -rf $1/* + sudo rm -rf $1/* # run first stage do_distrorfs_first_stage arm64 ${1} ubuntu-additional_packages_list focal ubuntu do_distrorfs_first_stage $(arch_type) ${1} debian-additional_packages_list $(debian_distro) debian $(plat_name) $(full_rtf) diff --git a/configs/openamp_free_rtos.config b/configs/openamp_free_rtos.config new file mode 100644 index 0000000000000000000000000000000000000000..ff7e870e97abffdac9b33b66058d7e8d2fc3b245 --- /dev/null +++ b/configs/openamp_free_rtos.config @@ -0,0 +1,11 @@ +# kernel patch for phytiumpi, kernel version of 6.6 +BR2_LINUX_KERNEL_PATCH="$(LINUX_PKGDIR)/kernel-patches/openamp/0001-modify-the-dts-of-e2000q-and-phytiumpi-to-enable-hom.patch" + +# rpmsg-demo +BR2_PACKAGE_RPMSG_DEMO=y + +# free-rtos openamp +BR2_PACKAGE_PHYTIUM_FREE_RTOS=y +BR2_PACKAGE_PHYTIUM_FREE_RTOS_CPU_NAME="phytiumpi" +BR2_PACKAGE_HOST_PYTHON3=y +BR2_PACKAGE_HOST_PYTHON3_CURSES=y diff --git a/configs/openamp_standalone.config b/configs/openamp_standalone.config new file mode 100644 index 0000000000000000000000000000000000000000..e4434956ab716f4a1a86691dbb847025ced9b3ad --- /dev/null +++ b/configs/openamp_standalone.config @@ -0,0 +1,11 @@ +# kernel patch for phytiumpi, kernel version of 6.6 +BR2_LINUX_KERNEL_PATCH="$(LINUX_PKGDIR)/kernel-patches/openamp/0001-modify-the-dts-of-e2000q-and-phytiumpi-to-enable-hom.patch" + +# rpmsg-demo +BR2_PACKAGE_RPMSG_DEMO=y + +# standalone openamp +BR2_PACKAGE_PHYTIUM_STANDALONE=y +BR2_PACKAGE_PHYTIUM_STANDALONE_CPU_NAME="phytiumpi" +BR2_PACKAGE_HOST_PYTHON3=y +BR2_PACKAGE_HOST_PYTHON3_CURSES=y diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index 7012aa0608f92316644a6366bdd1ed2e8a692f78..06eff6765aaf188f4b0776ec8356292b58348f1e 100644 --- a/configs/phytiumpi_defconfig +++ b/configs/phytiumpi_defconfig @@ -25,7 +25,7 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium Pi" # toolchain BR2_TOOLCHAIN_EXTERNAL=y -BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y +BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64=y BR2_TOOLCHAIN_USES_GLIBC=y BR2_TOOLCHAIN_EXTERNAL_GLIBC=y @@ -34,7 +34,7 @@ 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 6.6 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="662bfb88959757471794bd9a6089d373903898f3" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="4850d0096546d55b0bf9014e572598fd62523f5b" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" @@ -68,6 +68,9 @@ BR2_PACKAGE_PHYTIUM_FIRSTLOGIN=y # Phytium_zram BR2_PACKAGE_PHYTIUM_ZRAM=y +# Phytium_ota +BR2_PACKAGE_PHYTIUM_OTA=y + # util-linux BR2_PACKAGE_UTIL_LINUX=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y diff --git a/configs/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index ec39ff68eef65642a6b1ef049a466be6d6557d8c..9e34d7fc4d7c58c8d86eb60f36789c85edbebbc0 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -25,7 +25,7 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium Pi" # toolchain BR2_TOOLCHAIN_EXTERNAL=y -BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y +BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64=y BR2_TOOLCHAIN_USES_GLIBC=y BR2_TOOLCHAIN_EXTERNAL_GLIBC=y @@ -34,7 +34,7 @@ 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 6.6 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="662bfb88959757471794bd9a6089d373903898f3" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="4850d0096546d55b0bf9014e572598fd62523f5b" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" @@ -66,6 +66,9 @@ BR2_PACKAGE_PHYTIUM_FIRSTLOGIN=y # Phytium_zram BR2_PACKAGE_PHYTIUM_ZRAM=y +# Phytium_ota +BR2_PACKAGE_PHYTIUM_OTA=y + BR2_PACKAGE_ROOTFS_DESKTOP=y BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt board/phytium/common/desktop_device_table.txt" BR2_PACKAGE_BUSYBOX=n diff --git a/configs/phytiumpi_ethercat.config b/configs/phytiumpi_ethercat.config new file mode 100644 index 0000000000000000000000000000000000000000..4a46095a2433cb01d92f4ceacd6c232cb45b7a3b --- /dev/null +++ b/configs/phytiumpi_ethercat.config @@ -0,0 +1,5 @@ +# ethercat +BR2_PACKAGE_IGH_ETHERCAT=y + +# open62541 +BR2_PACKAGE_OPEN62541=y diff --git a/configs/phytiumpi_jailhouse.config b/configs/phytiumpi_jailhouse.config new file mode 100644 index 0000000000000000000000000000000000000000..fe60ac33aa7f5eecb2fcfc07927aed77e21be511 --- /dev/null +++ b/configs/phytiumpi_jailhouse.config @@ -0,0 +1,10 @@ +# jailhouse +BR2_PACKAGE_JAILHOUSE=y + +# jailhouse helper scripts +BR2_PACKAGE_PYTHON3=y +BR2_PACKAGE_PYTHON3_PY_ONLY=y +BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS=y + +# kernel patch for phytiumpi,kernel version of 6.6 +BR2_LINUX_KERNEL_PATCH="$(LINUX_PKGDIR)/kernel-patches/jailhouse/0001-modify-the-dts-of-phytiumpi-linux-kernel-to-reserve-memo.patch $(LINUX_PKGDIR)/kernel-patches/0001-disable-smmu-in-dts.patch" diff --git a/configs/phytiumpi_linux_6.6_rt.config b/configs/phytiumpi_linux_6.6_rt.config index 81b8c4d9ac7e41f403bc65dcf2695b9967c20e2c..13ad9a03a09b8874d67a7a5420436169a2a5f75a 100644 --- a/configs/phytiumpi_linux_6.6_rt.config +++ b/configs/phytiumpi_linux_6.6_rt.config @@ -1,2 +1,2 @@ # kernel 6.6-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="20635251686c50c94eeea2e8a71a99fb59ee80df" diff --git a/configs/phytiumpi_optee.config b/configs/phytiumpi_optee.config index b4ec28e401037a633d5fb31ec1507af4e908f356..5edcfcbc2df9c8b1d956b03d259ae1a36bb9f1b6 100644 --- a/configs/phytiumpi_optee.config +++ b/configs/phytiumpi_optee.config @@ -3,5 +3,5 @@ BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/phytium_ BR2_PACKAGE_PHYTIUM_OPTEE=y BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-optee.git" -BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="v3.2" +BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="v4.5.2" BR2_PACKAGE_PHYTIUM_OPTEE_BOARD="phytiumpi" diff --git a/configs/phytiumpi_xenomai_cobalt_6.6.config b/configs/phytiumpi_xenomai_cobalt_6.6.config new file mode 100644 index 0000000000000000000000000000000000000000..d070ac097322efb854af4e08d5f974c90d671dd3 --- /dev/null +++ b/configs/phytiumpi_xenomai_cobalt_6.6.config @@ -0,0 +1,14 @@ +# cobalt kernel 6.6.y-dovetail +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/linux-kernel-xenomai.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="c096fe6eee82d7c2035b8ae03567eead94f63149" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/cobalt.config" +# xenomai libraries and tools +BR2_PACKAGE_XENOMAI=y +BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y +BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL="https://source.denx.de/Xenomai/xenomai/-/archive/v3.3/xenomai-v3.3.tar.gz" +BR2_PACKAGE_XENOMAI_COBALT=y +BR2_PACKAGE_XENOMAI_ENABLE_SMP=y +BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared --enable-dlopen-libs" +BR2_PACKAGE_XENOMAI_TESTSUITE=y +BR2_PACKAGE_XENOMAI_RTCAN=y +BR2_PACKAGE_XENOMAI_ANALOGY=y diff --git a/configs/phytiumpi_xenomai_mercury_6.6.config b/configs/phytiumpi_xenomai_mercury_6.6.config new file mode 100644 index 0000000000000000000000000000000000000000..7458595d5908fc86d16d49f34c3d42769c06e09b --- /dev/null +++ b/configs/phytiumpi_xenomai_mercury_6.6.config @@ -0,0 +1,12 @@ +# kernel 6.6-rt +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="20635251686c50c94eeea2e8a71a99fb59ee80df" +# xenomai libraries and tools +BR2_PACKAGE_XENOMAI=y +BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y +BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL="https://source.denx.de/Xenomai/xenomai/-/archive/v3.3/xenomai-v3.3.tar.gz" +BR2_PACKAGE_XENOMAI_MERCURY=y +BR2_PACKAGE_XENOMAI_ENABLE_SMP=y +BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared --enable-dlopen-libs" +BR2_PACKAGE_XENOMAI_TESTSUITE=y +BR2_PACKAGE_XENOMAI_RTCAN=y +BR2_PACKAGE_XENOMAI_ANALOGY=y diff --git a/linux/kernel-patches/0001-disable-smmu-in-dts.patch b/linux/kernel-patches/0001-disable-smmu-in-dts.patch new file mode 100644 index 0000000000000000000000000000000000000000..c84b90176dcdf2e60617bec4bf48965df6f67d0b --- /dev/null +++ b/linux/kernel-patches/0001-disable-smmu-in-dts.patch @@ -0,0 +1,34 @@ +From 3e75cd0d84d86f395d945c244c43bb0d3f5e7bbd Mon Sep 17 00:00:00 2001 +From: weishanshan1084 +Date: Tue, 2 Jan 2024 10:56:39 +0800 +Subject: [PATCH] disable smmu in dts + +Signed-off-by: weishanshan1084 +--- + arch/arm64/boot/dts/phytium/pe220x.dtsi | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/phytium/pe220x.dtsi b/arch/arm64/boot/dts/phytium/pe220x.dtsi +index ef2dc3190..874b6fc8e 100644 +--- a/arch/arm64/boot/dts/phytium/pe220x.dtsi ++++ b/arch/arm64/boot/dts/phytium/pe220x.dtsi +@@ -173,6 +173,7 @@ smmu: iommu@30000000 { + interrupt-names = "eventq", "priq", "cmdq-sync", "gerror"; + dma-coherent; + #iommu-cells = <1>; ++ status = "disabled"; + }; + + soc: soc { +@@ -1001,7 +1002,7 @@ pcie: pcie@40000000 { + ranges = <0x01000000 0x00 0x00000000 0x0 0x50000000 0x0 0x00f00000>, + <0x02000000 0x00 0x58000000 0x0 0x58000000 0x0 0x28000000>, + <0x03000000 0x10 0x00000000 0x10 0x00000000 0x10 0x00000000>; +- iommu-map = <0x0 &smmu 0x0 0x10000>; ++ //iommu-map = <0x0 &smmu 0x0 0x10000>; + status = "disabled"; + }; + +-- +2.25.1 + diff --git a/linux/kernel-patches/jailhouse/0001-modify-the-dts-of-phytiumpi-linux-kernel-to-reserve-memo.patch b/linux/kernel-patches/jailhouse/0001-modify-the-dts-of-phytiumpi-linux-kernel-to-reserve-memo.patch new file mode 100644 index 0000000000000000000000000000000000000000..5064a247e54cf62c31e80dcf984f81cd9d2222a3 --- /dev/null +++ b/linux/kernel-patches/jailhouse/0001-modify-the-dts-of-phytiumpi-linux-kernel-to-reserve-memo.patch @@ -0,0 +1,34 @@ +From 01bcd5347ace6a71bad5e71cf8ab8d165e34eec0 Mon Sep 17 00:00:00 2001 +From: lindongping +Date: Fri, 1 Dec 2023 16:37:18 +0800 +Subject: [PATCH] modify the dts of e2000 linux kernel to reserve memory for + jailhouse. + +--- + arch/arm64/boot/dts/phytium/pe2204.dtsi | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/arch/arm64/boot/dts/phytium/pe2204.dtsi b/arch/arm64/boot/dts/phytium/pe2204.dtsi +index 201a01e75..54cd6f0a4 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204.dtsi ++++ b/arch/arm64/boot/dts/phytium/pe2204.dtsi +@@ -10,6 +10,16 @@ + / { + compatible = "phytium,pe2204"; + ++ reserved-memory { ++ #address-cells = <0x00000002>; ++ #size-cells = <0x00000002>; ++ ranges; ++ reserved@b0000000 { ++ reg = <0x00000000 0xb0000000 0x00000000 0x10000000>; ++ no-map; ++ }; ++ }; ++ + aliases { + ethernet0 = &macb0; + ethernet1 = &macb1; +-- +2.34.1 + diff --git a/linux/kernel-patches/openamp/0001-modify-the-dts-of-e2000q-and-phytiumpi-to-enable-hom.patch b/linux/kernel-patches/openamp/0001-modify-the-dts-of-e2000q-and-phytiumpi-to-enable-hom.patch new file mode 100644 index 0000000000000000000000000000000000000000..fd633fb2e2867a7086d1a6bac75061369f52a574 --- /dev/null +++ b/linux/kernel-patches/openamp/0001-modify-the-dts-of-e2000q-and-phytiumpi-to-enable-hom.patch @@ -0,0 +1,156 @@ +From fe8617114dbc507141e956ca75b606d07bdb3376 Mon Sep 17 00:00:00 2001 +From: weishanshan1084 +Date: Thu, 20 Mar 2025 15:06:08 +0800 +Subject: [PATCH] modify the dts of e2000q and phytiumpi to enable homo_rproc + +Signed-off-by: weishanshan1084 +--- + .../boot/dts/phytium/pe2204-come-board.dts | 4 ++++ + .../dts/phytium/pe2204-demo-ddr4-local.dts | 4 ++++ + .../boot/dts/phytium/pe2204-demo-ddr4.dts | 4 ++++ + .../boot/dts/phytium/pe2204-edu-board.dts | 4 ++++ + .../boot/dts/phytium/pe2204-hanwei-board.dts | 4 ++++ + .../boot/dts/phytium/pe2204-miniitx-board.dts | 4 ++++ + .../boot/dts/phytium/pe2204-vpx-board.dts | 4 ++++ + arch/arm64/boot/dts/phytium/pe220x.dtsi | 22 +++++++++++++++++++ + .../boot/dts/phytium/phytiumpi_firefly.dts | 4 ++++ + 9 files changed, 54 insertions(+) + +diff --git a/arch/arm64/boot/dts/phytium/pe2204-come-board.dts b/arch/arm64/boot/dts/phytium/pe2204-come-board.dts +index e87b26078224..b74613824b39 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204-come-board.dts ++++ b/arch/arm64/boot/dts/phytium/pe2204-come-board.dts +@@ -266,3 +266,7 @@ &pwm1 { + &vpu0 { + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4-local.dts b/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4-local.dts +index 402d07735b86..57cbeea3163d 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4-local.dts ++++ b/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4-local.dts +@@ -164,3 +164,7 @@ &dc0 { + &vpu0 { + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4.dts b/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4.dts +index c12eb5810524..cd3c6474d184 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4.dts ++++ b/arch/arm64/boot/dts/phytium/pe2204-demo-ddr4.dts +@@ -234,3 +234,7 @@ &pmdk_dp { + &vpu0 { + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/phytium/pe2204-edu-board.dts b/arch/arm64/boot/dts/phytium/pe2204-edu-board.dts +index 7a47cbc375a2..f92ea3337abd 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204-edu-board.dts ++++ b/arch/arm64/boot/dts/phytium/pe2204-edu-board.dts +@@ -345,3 +345,7 @@ &keypad { + 0x03030044 /*KEY_44*/>; + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/phytium/pe2204-hanwei-board.dts b/arch/arm64/boot/dts/phytium/pe2204-hanwei-board.dts +index d9e1eae59d98..ebe40f6d7b6f 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204-hanwei-board.dts ++++ b/arch/arm64/boot/dts/phytium/pe2204-hanwei-board.dts +@@ -216,3 +216,7 @@ &gpio5 { + &vpu0 { + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/phytium/pe2204-miniitx-board.dts b/arch/arm64/boot/dts/phytium/pe2204-miniitx-board.dts +index 2513b7b5e21a..12a73cc24984 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204-miniitx-board.dts ++++ b/arch/arm64/boot/dts/phytium/pe2204-miniitx-board.dts +@@ -341,3 +341,7 @@ &rng0 { + &vpu0 { + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/phytium/pe2204-vpx-board.dts b/arch/arm64/boot/dts/phytium/pe2204-vpx-board.dts +index 22c3c4395b9b..4396a6d3d9f1 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204-vpx-board.dts ++++ b/arch/arm64/boot/dts/phytium/pe2204-vpx-board.dts +@@ -323,3 +323,7 @@ &rng0 { + &vpu0 { + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +diff --git a/arch/arm64/boot/dts/phytium/pe220x.dtsi b/arch/arm64/boot/dts/phytium/pe220x.dtsi +index 40d952a1a49b..83cfc31d3c6c 100644 +--- a/arch/arm64/boot/dts/phytium/pe220x.dtsi ++++ b/arch/arm64/boot/dts/phytium/pe220x.dtsi +@@ -20,6 +20,16 @@ aliases { + serial3 = &uart3; + }; + ++ reserved-memory { ++ #address-cells = <0x2>; ++ #size-cells = <0x2>; ++ ranges; ++ rproc0: rproc0@b0100000 { ++ no-map; ++ reg = <0x0 0xb0100000 0x0 0x19900000>; ++ }; ++ }; ++ + psci { + compatible = "arm,psci-1.0"; + method = "smc"; +@@ -1015,5 +1025,17 @@ pcie: pcie@40000000 { + iommu-map = <0x0 &smmu 0x0 0x10000>; + status = "disabled"; + }; ++ ++ homo_rproc: homo_rproc@0 { ++ compatible = "homo,rproc"; ++ status = "disabled"; ++ homo_core0: homo_core0@b0100000 { ++ compatible = "homo,rproc-core"; ++ remote-processor = <3>; ++ inter-processor-interrupt = <9>; ++ memory-region = <&rproc0>; ++ firmware-name = "openamp_core0.elf"; ++ }; ++ }; + }; + }; +diff --git a/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts b/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts +index e16a4759c40b..cec1a69816c7 100644 +--- a/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts ++++ b/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts +@@ -321,3 +321,7 @@ &rng0 { + &vpu0 { + status = "okay"; + }; ++ ++&homo_rproc { ++ status = "okay"; ++}; +-- +2.25.1 + diff --git a/package/Config.in b/package/Config.in index 4786aeb3766bb86bcf287ffc82a461f5b61b9772..04d5bd7c3ad36581a9d387d3fbfb9a30450a5648 100644 --- a/package/Config.in +++ b/package/Config.in @@ -260,6 +260,7 @@ menu "Filesystem and flash utilities" source "package/kernel-headers/Config.in" source "package/phytium-firstlogin/Config.in" source "package/phytium-zram/Config.in" + source "package/phytium-ota/Config.in" endmenu menu "Fonts, cursors, icons, sounds and themes" @@ -470,6 +471,9 @@ menu "Firmware" source "package/zd1211-firmware/Config.in" source "package/phyuboot/Config.in" source "package/phytium-tools/Config.in" + source "package/rpmsg-demo/Config.in" + source "package/phytium-standalone/Config.in" + source "package/phytium-free-rtos/Config.in" endmenu source "package/18xx-ti-utils/Config.in" source "package/a10disp/Config.in" diff --git a/package/Makefile.in b/package/Makefile.in index 658b79ae4122dcbac808cb67f00c647d927630cc..eea2dae1af0e5cb270732ad3ce1c95f273e3b553 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -149,8 +149,8 @@ endif TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS)) -ifeq ($(BR2_ROOTFS_SKELETON_DEBIAN),y) -TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/aarch64-linux-gnu +ifeq ($(BR2_ROOTFS_SKELETON_UBUNTU)$(BR2_ROOTFS_SKELETON_DEBIAN),y) +TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/aarch64-linux-gnu,--copy-dt-needed-entries endif # By design, _FORTIFY_SOURCE requires gcc optimization to be enabled. diff --git a/package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.hash b/package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.hash new file mode 100644 index 0000000000000000000000000000000000000000..3ae7bb3ea922795b9a92739cb270ff6daff2e6f8 --- /dev/null +++ b/package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 6f74b1ee370caeb716688d2e467e5b44727fdc0ed56023fe5c72c0620019ecef gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz diff --git a/package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.mk b/package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.mk new file mode 100644 index 0000000000000000000000000000000000000000..229e53ba6c7c87bcef1718a8a2895d44152f26de --- /dev/null +++ b/package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.mk @@ -0,0 +1,26 @@ +################################################################################ +# +# aarch64-none-elf-toolchain +# +################################################################################ + +AARCH64_NONE_ELF_TOOLCHAIN_VERSION = 10.3-2021.07 +AARCH64_NONE_ELF_TOOLCHAIN_SITE = https://developer.arm.com/-/media/Files/downloads/gnu-a/$(AARCH64_NONE_ELF_TOOLCHAIN_VERSION)/binrel +AARCH64_NONE_ELF_TOOLCHAIN_SOURCE = gcc-arm-$(AARCH64_NONE_ELF_TOOLCHAIN_VERSION)-x86_64-aarch64-none-elf.tar.xz +AARCH64_NONE_ELF_TOOLCHAIN_LICENSE = GPL-3.0+ + +HOST_AARCH64_NONE_ELF_TOOLCHAIN_INSTALL_DIR = $(HOST_DIR)/opt/aarch64-none-elf + +define HOST_AARCH64_NONE_ELF_TOOLCHAIN_INSTALL_CMDS + rm -rf $(HOST_AARCH64_NONE_ELF_TOOLCHAIN_INSTALL_DIR) + mkdir -p $(HOST_AARCH64_NONE_ELF_TOOLCHAIN_INSTALL_DIR) + cp -rf $(@D)/* $(HOST_AARCH64_NONE_ELF_TOOLCHAIN_INSTALL_DIR)/ + + mkdir -p $(HOST_DIR)/bin + cd $(HOST_DIR)/bin && \ + for i in ../opt/aarch64-none-elf/bin/*; do \ + ln -sf $$i; \ + done +endef + +$(eval $(host-generic-package)) diff --git a/package/igh-ethercat/igh-ethercat.hash b/package/igh-ethercat/igh-ethercat.hash deleted file mode 100644 index 67a152c6ae833661fddf089ed3ab6ef1885c74f6..0000000000000000000000000000000000000000 --- a/package/igh-ethercat/igh-ethercat.hash +++ /dev/null @@ -1,4 +0,0 @@ -# Locally computed -sha256 7e4d8f3497c0bc0b64a151c0d074349fe7614767563642d6fedb19567eafa1e1 igh-ethercat-f5dc109176400f540a8682a2c9ee20d411d14d61.tar.gz -sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c COPYING -sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LESSER diff --git a/package/igh-ethercat/igh-ethercat.mk b/package/igh-ethercat/igh-ethercat.mk index 5b618ab54a6a40fc9d40c0e9360591fd26f4ec71..07052b26c7302a0639195206a809125e15b54189 100644 --- a/package/igh-ethercat/igh-ethercat.mk +++ b/package/igh-ethercat/igh-ethercat.mk @@ -4,8 +4,9 @@ # ################################################################################ -IGH_ETHERCAT_VERSION = f5dc109176400f540a8682a2c9ee20d411d14d61 -IGH_ETHERCAT_SITE = $(call gitlab,etherlab.org,ethercat,$(IGH_ETHERCAT_VERSION)) +IGH_ETHERCAT_VERSION = dbbd80fa4bf93d2cc3a9ffc6623f678b1092a1fa +IGH_ETHERCAT_SITE = https://gitee.com/phytium_embedded/ether-cat.git +IGH_ETHERCAT_SITE_METHOD = git IGH_ETHERCAT_LICENSE = GPL-2.0 (IgH EtherCAT master), LGPL-2.1 (libraries) IGH_ETHERCAT_LICENSE_FILES = COPYING COPYING.LESSER # Fetching from Git @@ -22,5 +23,37 @@ IGH_ETHERCAT_CONF_OPTS = \ $(if $(BR2_PACKAGE_IGH_ETHERCAT_E1000E),--enable-e1000e,--disable-e1000e) \ $(if $(BR2_PACKAGE_IGH_ETHERCAT_R8169),--enable-r8169,--disable-r8169) +ifeq ($(BR2_PACKAGE_XENOMAI_COBALT),y) +IGH_ETHERCAT_DEPENDENCIES += xenomai +IGH_ETHERCAT_CONF_OPTS += \ + --enable-generic \ + --enable-cadence \ + --enable-rtdm \ + --disable-rt-syslog \ + --with-xenomai-dir=$(STAGING_DIR)/usr/xenomai +else +IGH_ETHERCAT_CONF_OPTS += \ + --enable-generic \ + --enable-cadence \ + --disable-rt-syslog +endif + +define IGH_ETHERCAT_CREATE_CHANGELOG + touch $(@D)/ChangeLog + mkdir -p $(@D)/m4 + $(if $(BR2_PACKAGE_XENOMAI_COBALT),sed -i '3 i DESTDIR=$(STAGING_DIR)' $(STAGING_DIR)/usr/xenomai/bin/xeno-config) +endef +IGH_ETHERCAT_POST_PATCH_HOOKS += IGH_ETHERCAT_CREATE_CHANGELOG + +IGH_ETHERCAT_MODULE_MAKE_OPTS = INSTALL_MOD_DIR="ethercat" + $(eval $(kernel-module)) + +define IGH_ETHERCAT_DO_NOT_LOAD_ON_BOOT + mkdir -p $(TARGET_DIR)/etc/modprobe.d + echo "# Do not load the 'ec_macb' module on boot." >> $(TARGET_DIR)/etc/modprobe.d/blacklist.conf + echo "blacklist ec_macb" >> $(TARGET_DIR)/etc/modprobe.d/blacklist.conf +endef +IGH_ETHERCAT_POST_INSTALL_TARGET_HOOKS += IGH_ETHERCAT_DO_NOT_LOAD_ON_BOOT + $(eval $(autotools-package)) diff --git a/package/jailhouse/jailhouse.hash b/package/jailhouse/jailhouse.hash deleted file mode 100644 index 96d58198474b341778f5f03318d2ab5334cfdd51..0000000000000000000000000000000000000000 --- a/package/jailhouse/jailhouse.hash +++ /dev/null @@ -1,3 +0,0 @@ -# Locally computed: -sha256 38ea5d2d9672ce7f76fd0c163edaa8968711aca58f245aec3c8934f140e828b6 jailhouse-e57d1eff6d55aeed5f977fe4e2acfb6ccbdd7560.tar.gz -sha256 3aafb31a2436178323663e00511f16d58fc36ea654b1457532e79d017205efd8 COPYING diff --git a/package/jailhouse/jailhouse.mk b/package/jailhouse/jailhouse.mk index b5a8b40fddbfaf6d938affc1bc3f7539370b7aa4..1793438adda74ce1cd82dfa6496d2da1c437ba7f 100644 --- a/package/jailhouse/jailhouse.mk +++ b/package/jailhouse/jailhouse.mk @@ -4,8 +4,9 @@ # ################################################################################ -JAILHOUSE_VERSION = e57d1eff6d55aeed5f977fe4e2acfb6ccbdd7560 -JAILHOUSE_SITE = $(call github,siemens,jailhouse,$(JAILHOUSE_VERSION)) +JAILHOUSE_VERSION = 1581a8ceaaa1f0a4ec6ea95b6dca3ba5f4e62ba5 +JAILHOUSE_SITE = https://gitee.com/phytium_embedded/phytium-jailhouse.git +JAILHOUSE_SITE_METHOD = git JAILHOUSE_LICENSE = GPL-2.0 JAILHOUSE_LICENSE_FILES = COPYING JAILHOUSE_DEPENDENCIES = \ @@ -16,7 +17,8 @@ JAILHOUSE_MAKE_OPTS = \ ARCH="$(KERNEL_ARCH)" \ KDIR="$(LINUX_DIR)" \ DESTDIR="$(TARGET_DIR)" \ - prefix=/usr + prefix=/usr \ + INSTALL_MOD_DIR="jailhouse" ifeq ($(BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS),y) JAILHOUSE_DEPENDENCIES += \ @@ -33,36 +35,42 @@ endif ifeq ($(BR2_PACKAGE_JAILHOUSE_HELPER_SCRIPTS),y) define JAILHOUSE_BUILD_HELPER_SCRIPTS - cd $(@D) && \ + cd $(@D)/src/jailhouse && \ $(PKG_PYTHON_SETUPTOOLS_ENV) \ $(HOST_DIR)/bin/python setup.py \ build endef define JAILHOUSE_INSTALL_HELPER_SCRIPTS - cd $(@D) && \ + cd $(@D)/src/jailhouse && \ $(PKG_PYTHON_SETUPTOOLS_ENV) \ $(HOST_DIR)/bin/python setup.py \ install --no-compile \ $(PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) \ - --root=$(TARGET_DIR)) + --root=$(TARGET_DIR) + $(if $(BR2_ROOTFS_SKELETON_CUSTOM), \ + mkdir -p $(TARGET_DIR)/usr/lib/python3/dist-packages && \ + echo "/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages" > $(TARGET_DIR)/usr/lib/python3/dist-packages/pyjailhouse.pth) endef endif define JAILHOUSE_BUILD_CMDS - $(TARGET_MAKE_ENV) $(MAKE) $(JAILHOUSE_MAKE_OPTS) -C $(@D) + $(TARGET_MAKE_ENV) $(MAKE) $(JAILHOUSE_MAKE_OPTS) -C $(@D)/src/jailhouse $(JAILHOUSE_BUILD_HELPER_SCRIPTS) endef define JAILHOUSE_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) $(JAILHOUSE_MAKE_OPTS) -C $(@D) modules_install firmware_install tool_inmates_install - $(TARGET_MAKE_ENV) $(MAKE) $(JAILHOUSE_MAKE_OPTS) -C $(@D)/tools src=$(@D)/tools install + $(TARGET_MAKE_ENV) $(MAKE) $(JAILHOUSE_MAKE_OPTS) -C $(@D)/src/jailhouse modules_install firmware_install tool_inmates_install + $(TARGET_MAKE_ENV) $(MAKE) $(JAILHOUSE_MAKE_OPTS) -C $(@D)/src/jailhouse/tools src=$(@D)/src/jailhouse/tools install $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/jailhouse - $(INSTALL) -D -m 0644 $(@D)/configs/*/*.cell $(TARGET_DIR)/etc/jailhouse + $(INSTALL) -D -m 0644 $(@D)/src/jailhouse/configs/*/*.cell $(TARGET_DIR)/etc/jailhouse $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/libexec/jailhouse/demos - $(INSTALL) -D -m 0755 $(@D)/inmates/demos/*/*.bin $(TARGET_DIR)/usr/libexec/jailhouse/demos + $(INSTALL) -D -m 0755 $(@D)/src/jailhouse/inmates/demos/*/*.bin $(TARGET_DIR)/usr/libexec/jailhouse/demos + + $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/libexec/jailhouse/dtb + $(INSTALL) -D -m 0644 $(@D)/src/jailhouse/configs/arm64/dts/*.dtb $(TARGET_DIR)/usr/libexec/jailhouse/dtb $(JAILHOUSE_INSTALL_HELPER_SCRIPTS) endef diff --git a/package/libffi/libffi.mk b/package/libffi/libffi.mk index 6249023eaedee41d5ff7dba6b3a66bc69492976b..1f9bec2751d1901ead6d8ab8ddba15e6a994fe3d 100644 --- a/package/libffi/libffi.mk +++ b/package/libffi/libffi.mk @@ -11,6 +11,9 @@ LIBFFI_LICENSE = MIT LIBFFI_LICENSE_FILES = LICENSE LIBFFI_CPE_ID_VALID = YES LIBFFI_INSTALL_STAGING = YES +ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) +LIBFFI_INSTALL_TARGET = NO +endif # We're patching Makefile.am LIBFFI_AUTORECONF = YES diff --git a/package/phytium-desktop-tools/phytium-desktop-tools.mk b/package/phytium-desktop-tools/phytium-desktop-tools.mk index 89541c1b74b44a8a8a1bb84f3ffbc05f5da28190..20d994e1bdb4484a0a8c2abed5591bc6bae5dd69 100644 --- a/package/phytium-desktop-tools/phytium-desktop-tools.mk +++ b/package/phytium-desktop-tools/phytium-desktop-tools.mk @@ -18,6 +18,8 @@ define PHYTIUM_DESKTOP_TOOLS_INSTALL_TARGET_CMDS mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/ mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/simple-card/ mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/PMDK-I2S/ + mkdir -p $(TARGET_DIR)/usr/local/bin/ + mkdir -p $(TARGET_DIR)/etc/udev/rules.d/ $(INSTALL) -m 777 -D $(@D)/dark.jpg $(TARGET_DIR)/usr/share/images/desktop-base/ $(INSTALL) -m 755 -D $(@D)/01_debian.conf $(TARGET_DIR)/usr/share/lightdm/lightdm-gtk-greeter.conf.d/ $(INSTALL) -m 755 -D $(@D)/xfce4-desktop.xml $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ @@ -25,6 +27,8 @@ define PHYTIUM_DESKTOP_TOOLS_INSTALL_TARGET_CMDS cp -rf $(@D)/Phytium/ $(TARGET_DIR)/usr/share/alsa/ucm2/ $(INSTALL) -m 755 -D $(@D)/switch_to_headphone.sh $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 644 -D $(@D)/sound_output_device_switching.desktop $(TARGET_DIR)/usr/share/alsa/ucm2/ + $(INSTALL) -m 755 -D $(@D)/auto_resolution.sh $(TARGET_DIR)/usr/local/bin/ + $(INSTALL) -m 644 -D $(@D)/99-monitor-hotplug.rules $(TARGET_DIR)/etc/udev/rules.d/ endef $(eval $(generic-package)) diff --git a/package/phytium-desktop-tools/src/99-monitor-hotplug.rules b/package/phytium-desktop-tools/src/99-monitor-hotplug.rules new file mode 100644 index 0000000000000000000000000000000000000000..bdfa70d3ee9b2d8008e5e10a29fb94a1243e670c --- /dev/null +++ b/package/phytium-desktop-tools/src/99-monitor-hotplug.rules @@ -0,0 +1 @@ +SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/auto_resolution.sh" diff --git a/package/phytium-desktop-tools/src/auto_resolution.sh b/package/phytium-desktop-tools/src/auto_resolution.sh new file mode 100755 index 0000000000000000000000000000000000000000..38dd6ef9a99a8dcd64671fa93c46e46ac9433c65 --- /dev/null +++ b/package/phytium-desktop-tools/src/auto_resolution.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# check if on the greeter interface +IS_GREETER=$(loginctl show-session $(loginctl | grep 'lightdm' | awk '{print $1}') --property=State | grep -q "active" && echo "yes" || echo "no") +if [[ "$IS_GREETER" != "yes" ]]; then + exit 0 +fi + +export DISPLAY=:0 +export XAUTHORITY=$HOME/.Xauthority + +if [[ ! -e "$XAUTHORITY" ]]; then + touch "$XAUTHORITY" +fi + +xauth add $(xauth -f /var/run/lightdm/root/:0 list) + +# check the connection status of the screen +connected_output=$(xrandr --query | grep " connected" | awk '{print $1}') +for output in $connected_output; do + # set the optimal resolution + preferred_mode=$(xrandr --query | grep -A 1 "^$output" | tail -n 1 | awk '{print $1}') + if [ -n "$preferred_mode" ]; then + echo "Setting $output to $preferred_mode" + xrandr --output "$output" --mode "$preferred_mode" + fi +done + diff --git a/package/phytium-firstlogin/src/phytium-firstlogin b/package/phytium-firstlogin/src/phytium-firstlogin index 1e7ea4717b9f965112b48676faaf41c9257b92c5..a78ad79cb846c3c3217762ffdda01b5d7a5bc070 100755 --- a/package/phytium-firstlogin/src/phytium-firstlogin +++ b/package/phytium-firstlogin/src/phytium-firstlogin @@ -475,6 +475,59 @@ add_user() { } +fm_patch_dir="/lib/firmware/uboot-patch" +fm_patch_hash_dir="/lib/firmware/uboot-patch-hash" +fm_patch_check_dd_dir="/lib/firmware/uboot-patch-check-dd" +# check if the dd command was successful. +# $1: the file to be checked. +# $2: the starting position of the file to be checked in the firmware. +# $3: the size of the file to be checked. +check-if-dd-success() { + mkdir -p $fm_patch_check_dd_dir + file=$(basename $1 .bin) + dd if=/dev/mmcblk0 of=$fm_patch_check_dd_dir/recovered_$file.bin bs=$2 skip=1 count=1 + dd if=$fm_patch_check_dd_dir/recovered_$file.bin of=$fm_patch_check_dd_dir/final_$file.bin bs=1 count=$3 + _hash=$(sha256sum $fm_patch_check_dd_dir/final_$file.bin | cut -d ' ' -f 1 ) + _known=$(cat $fm_patch_hash_dir/$1.hash | cut -d ' ' -f 3 ) + # Do the hashes match? + if [ "${_hash}" = "${_known}" ]; then + echo -e "\033[1;32mHash verification succeeded, configuration has been updated.\033[0m" + else + echo -e "\033[1;31mHash verification failed, configuration update encountered an error. You may need to manually update the firmware. See https://gitee.com/phytium_embedded/phytium-pi-os/wikis/%E9%A3%9E%E8%85%BE%E6%B4%BE%E5%9B%BA%E4%BB%B6%E9%85%8D%E7%BD%AE%E5%B7%A5%E5%85%B7ft-config%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8的启动异常补救措施小节\033[0m" + exit 1 + fi +} +firmware_configure(){ + echo "" + echo -e "Configure firmware." + flag=0 + unset response + while [[ ! "${response}" =~ ^(Y|y|N|n)$ ]]; do + read -r -p "Is the phytiumpi hardware version v2? [Y/n] " response + echo "$response" + done + if [[ "${response}" =~ ^(Y|y)$ ]]; then + check-hash $fm_patch_hash_dir/pad_set_v2.x.bin.hash $fm_patch_dir/pad_set_v2.x.bin pad_set_v2.x.bin + dd if=$fm_patch_dir/pad_set_v2.x.bin of=/dev/mmcblk0 bs=1000k seek=1 && sync + check-if-dd-success pad_set_v2.x.bin 1000k 1088 + flag=1 + systemctl disable pwm-fan.service + fi + echo "" + unset response + while [[ ! "${response}" =~ ^(Y|y|N|n)$ ]]; do + read -r -p "Is the memory size 8GB? [Y/n] " response + echo "$response" + done + if [[ "${response}" =~ ^(Y|y)$ ]]; then + printf "\x11" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 && sync + flag=1 + fi + if [[ "$flag" == 1 ]]; then + echo "the firmware has change, please power reset after desktop started." + fi + echo "" +} if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then do_firstrun_automated_network_configuration @@ -502,7 +555,7 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then systemctl is-system-running --wait > /dev/null # enable hiDPI support - if [[ "$(cut -d, -f1 < /sys/class/graphics/fb0/virtual_size 2> /dev/null)" -gt 1920 ]]; then + if [[ "$( (cut -d, -f1 < /sys/class/graphics/fb0/virtual_size) 2> /dev/null)" -gt 1920 ]]; then # lightdm [[ -f /etc/lightdm/slick-greeter.conf ]] && echo "enable-hidpi = on" >> /etc/lightdm/slick-greeter.conf # xfce @@ -609,6 +662,11 @@ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then rm /root/.desktop_firstlogin fi + # ask user to configure firmware + trap '' 2 + firmware_configure + trap - INT TERM EXIT + if [[ ${USER_SHELL} == zsh ]]; then printf "\nYou selected \e[0;91mZSH\x1B[0m as your default shell. If you want to use it right away, please logout and login! \n\n" fi diff --git a/package/phytium-free-rtos/Config.in b/package/phytium-free-rtos/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..69c9146fba8ead69fc138d0f3755603f4e162e20 --- /dev/null +++ b/package/phytium-free-rtos/Config.in @@ -0,0 +1,16 @@ +config BR2_PACKAGE_PHYTIUM_FREE_RTOS + bool "phytium-free-rtos" + help + Phytium-FreeRTOS-SDK for OpenAMP + + https://gitee.com/phytium_embedded/phytium-free-rtos-sdk + +if BR2_PACKAGE_PHYTIUM_FREE_RTOS + +config BR2_PACKAGE_PHYTIUM_FREE_RTOS_CPU_NAME + string "CPU name" + help + Supported CPU: + "e2000q", "phytiumpi", "d2000", "ft2004". + +endif diff --git a/package/phytium-free-rtos/phytium-free-rtos.mk b/package/phytium-free-rtos/phytium-free-rtos.mk new file mode 100644 index 0000000000000000000000000000000000000000..9929dbe25807eddec70133a5fa66656d47920831 --- /dev/null +++ b/package/phytium-free-rtos/phytium-free-rtos.mk @@ -0,0 +1,29 @@ +################################################################################ +# +# phytium-free-rtos +# +################################################################################ + +PHYTIUM_FREE_RTOS_VERSION = openamp-v1.0 +PHYTIUM_FREE_RTOS_SITE = https://gitee.com/phytium_embedded/phytium-free-rtos-sdk.git +PHYTIUM_FREE_RTOS_SITE_METHOD = git +PHYTIUM_FREE_RTOS_DEPENDENCIES = host-phytium-iot-environment host-python3 linux +PHYTIUM_FREE_RTOS_CPU = $(call qstrip,$(BR2_PACKAGE_PHYTIUM_FREE_RTOS_CPU_NAME)) + +define PHYTIUM_FREE_RTOS_CONFIGURE_CMDS + cd $(@D) && \ + $(TARGET_MAKE_ENV) ./install.py +endef + +define PHYTIUM_FREE_RTOS_BUILD_CMDS + if [[ $(LINUX_VERSION_PROBED) = 6.6* ]]; then \ + PHYTIUM_FREE_RTOS_ARCH=aarch64; \ + fi && \ + . $(HOST_DIR)/etc/profile.d/phytium_dev.sh && \ + cd $(@D)/example/system/amp/openamp_for_linux && \ + script -q -c "$(TARGET_MAKE_ENV) $(MAKE1) config_$(PHYTIUM_FREE_RTOS_CPU)_$${PHYTIUM_FREE_RTOS_ARCH}" /dev/null && \ + mkdir -p $(TARGET_DIR)/lib/firmware && \ + $(TARGET_MAKE_ENV) $(MAKE1) image USR_BOOT_DIR=$(TARGET_DIR)/lib/firmware +endef + +$(eval $(generic-package)) diff --git a/package/phytium-iot-environment/phytium-iot-environment.mk b/package/phytium-iot-environment/phytium-iot-environment.mk new file mode 100644 index 0000000000000000000000000000000000000000..64025743639263927481fe7bb2c34dc096f372ff --- /dev/null +++ b/package/phytium-iot-environment/phytium-iot-environment.mk @@ -0,0 +1,19 @@ +################################################################################ +# +# phytium-iot-environment +# +################################################################################ + +# source included in the package +HOST_PHYTIUM_IOT_ENVIRONMENT_DEPENDENCIES = host-arm-gnu-toolchain host-aarch64-none-elf-toolchain + +define HOST_PHYTIUM_IOT_ENVIRONMENT_EXTRACT_CMDS + cp $(HOST_PHYTIUM_IOT_ENVIRONMENT_PKGDIR)/phytium_dev.sh $(@D) +endef + +define HOST_PHYTIUM_IOT_ENVIRONMENT_INSTALL_CMDS + mkdir -p $(HOST_DIR)/etc/profile.d + $(INSTALL) -D -m 0755 $(@D)/phytium_dev.sh $(HOST_DIR)/etc/profile.d +endef + +$(eval $(host-generic-package)) diff --git a/package/phytium-iot-environment/phytium_dev.sh b/package/phytium-iot-environment/phytium_dev.sh new file mode 100755 index 0000000000000000000000000000000000000000..f51e936dbf477d2547ba72219911f71f3aa8349f --- /dev/null +++ b/package/phytium-iot-environment/phytium_dev.sh @@ -0,0 +1,7 @@ +### PHYTIUM DEV SETTING START +export AARCH32_CROSS_PATH=${HOST_DIR}/opt/gcc-arm-none-eabi +export PATH=$PATH:${AARCH32_CROSS_PATH}/bin +export AARCH64_CROSS_PATH=${HOST_DIR}/opt/aarch64-none-elf +export PATH=$PATH:${AARCH64_CROSS_PATH}/bin +export PHYTIUM_DEV_PATH=${HOST_DIR} +### PHYTIUM DEV SETTING END diff --git a/package/phytium-ota/Config.in b/package/phytium-ota/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..85c7dabdf45d6181f14824ec997f7076b3fe2328 --- /dev/null +++ b/package/phytium-ota/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_PHYTIUM_OTA + bool "phytium_ota" diff --git a/package/phytium-ota/phytium-ota.mk b/package/phytium-ota/phytium-ota.mk new file mode 100644 index 0000000000000000000000000000000000000000..30ecb39e874adeea92b0f0c244a6800e94a00603 --- /dev/null +++ b/package/phytium-ota/phytium-ota.mk @@ -0,0 +1,20 @@ +################################################################################ +# +# phytium-ota +# +################################################################################ + +PHYTIUM_OTA_VERSION = 0.1 +PHYTIUM_OTA_SITE = package/phytium-ota/src +PHYTIUM_OTA_SITE_METHOD = local +PHYTIUM_OTA_INSTALL_TARGET = YES + +define PHYTIUM_OTA_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/usr/bin + mkdir -p $(TARGET_DIR)/usr/lib/phytium/ + $(INSTALL) -m 755 -D $(@D)/check-hash $(TARGET_DIR)/usr/bin/ + $(INSTALL) -m 755 -D $(@D)/get_phytium_ota $(TARGET_DIR)/usr/bin/ + cp -rf $(@D)/phytium-ota-latest/ $(TARGET_DIR)/usr/lib/phytium/ +endef + +$(eval $(generic-package)) diff --git a/package/phytium-tools/src/check-hash b/package/phytium-ota/src/check-hash similarity index 100% rename from package/phytium-tools/src/check-hash rename to package/phytium-ota/src/check-hash diff --git a/package/phytium-ota/src/get_phytium_ota b/package/phytium-ota/src/get_phytium_ota new file mode 100755 index 0000000000000000000000000000000000000000..42d14bf01318bd86d8b6bb0e2d84d774703ca8a0 --- /dev/null +++ b/package/phytium-ota/src/get_phytium_ota @@ -0,0 +1,138 @@ +#!/bin/bash + +# Get remote update files. +# +# Copyright (c) 2024-2025 Phytium Technology Co., Ltd. +# +# # This file is licensed under the terms of the GNU General Public +# License version 2. +# +# For the specific function 'detect_and_set_network', the following copyright applies: +# Copyright (c) Authors: https://www.armbian.com/authors +# +# get_phytium_ota - To get remote update files through the network. +# + +download_dir="/usr/local/phytium-libs" +download_site="https://gitee.com/phytium_embedded/phytium-rogue-umlibs.git" +dest_dir="/usr/local/phytium-ota" + +usage() { + echo "Usage: sudo $0 {all|rootfs|fitImage|uboot}" + echo " Example 1: sudo $0 uboot + --update uboot to the latest version" + echo " Example 2: sudo $0 fitImage + --update fitImage to the latest version" + echo " Example 3: sudo $0 rootfs + --update rootfs to the latest version" + echo " Example 4: sudo $0 all + --update uboot,fitImage and rootfs to the latest version" +} + +# check if parameters are provided. +if [ $# -eq 0 ]; then + usage + exit 1 +fi + +check_args() +{ + if [ "$#" -ne 1 ]; then + echo -e "\033[1;31mArgs number error! usage: sudo $0 {all|fitImage|uboot} {latest|v1.x}\033[0m" + exit 1 + fi + if [[ "$1" != "all" ]] && [[ "$1" != "uboot" ]] && [[ "$1" != "fitImage" ]] && [[ "$1" != "rootfs" ]]; then + echo -e "\033[1;31mError: First argument must be 'all', 'uboot', 'fitImage', or 'rootfs'.\033[0m" + exit 1 + fi +} + +while true; do + case $1 in + "-h" | "-help") + usage + exit + ;; + *) + check_args $1 $2 + break + ;; + esac +done + +# get kernel version +kernel_version=$(uname -r) + +# unsupport rt kernel and 4.19 +if [[ $kernel_version =~ ^((5\.10\.[0-9]+))-phytium.* ]]; then + kernel_version="5.10" +elif [[ $kernel_version =~ ^((6\.6\.[0-9]+))-phytium.* ]]; then + kernel_version="6.6" +else + echo -e "\033[31munsupport kernel version: $kernel_version\033[0m" + exit 1 +fi + +detect_and_set_network() { + # Grab this machine's public IP address + PUBLIC_IP=$(curl --max-time 5 -s https://ipinfo.io/ip) + + # Check if we have wireless adaptor + WIFI_DEVICE=$(LC_ALL=C nmcli dev status | grep " wifi " 2> /dev/null) + + if [ -z "$PUBLIC_IP" ]; then + # ask for connecting to wireless if wifi device is found + if [[ -n "$WIFI_DEVICE" ]]; then + echo -e "Internet connection was \x1B[91mnot detected\x1B[0m." + echo "" + unset response + while [[ ! "${response}" =~ ^(Y|y|N|n)$ ]]; do + if [ -z $PRESET_CONNECT_WIRELESS ];then + read -r -p "Connect via wireless? [Y/n] " response + response=${response:-Y} + else + response=n + fi + echo "$response" + done + if [[ "${response}" =~ ^(Y|y)$ ]]; then + nmtui-connect + fi + echo "" + fi + fi + # Grab IP once again if not found + [[ -z "$PUBLIC_IP" && -n "$WIFI_DEVICE" ]] && PUBLIC_IP=$(curl --max-time 5 -s https://ipinfo.io/ip) + + if [ -z "$PUBLIC_IP" ]; then + echo -e "Internet connection was \x1B[91mnot detected\x1B[0m." + echo "exit" + exit 1; + fi +} # detect_and_set_network + +# get remote update files from gitee. +get_update_files() { + rm -rf $download_dir + mkdir -p $download_dir + + apt install -y git + + git clone -b develop --depth 1 $download_site $download_dir + if [ "$?" != "0" ]; then + echo -e "\033[1;31mget remote update files failed\033[0m" + exit 1 + fi + echo -e "\033[1;32mget remote update files success\033[0m" + rm -rf $dest_dir + cp -rf $download_dir/phytium-ota /usr/local +} # get_update_files + +main() { + detect_and_set_network + get_update_files + $dest_dir/scripts/run_phytium_ota $1 +} + +main $@ + diff --git a/package/phytium-ota/src/phytium-ota-latest/fitImage/fitImage_latest.hash b/package/phytium-ota/src/phytium-ota-latest/fitImage/fitImage_latest.hash new file mode 100644 index 0000000000000000000000000000000000000000..c0de9b99b4b17e0572e69e5539c56581ddf5a32a --- /dev/null +++ b/package/phytium-ota/src/phytium-ota-latest/fitImage/fitImage_latest.hash @@ -0,0 +1 @@ +sha256 50dd902cc552590a034492af40a2c360aab833a1b810c332dfe0564b17a24247 fitImage.tar diff --git a/package/phytium-ota/src/phytium-ota-latest/rootfs/rootfs_latest.hash b/package/phytium-ota/src/phytium-ota-latest/rootfs/rootfs_latest.hash new file mode 100644 index 0000000000000000000000000000000000000000..68f096fd849e569f22ddf5990fa54eac4bf99cd7 --- /dev/null +++ b/package/phytium-ota/src/phytium-ota-latest/rootfs/rootfs_latest.hash @@ -0,0 +1 @@ +sha256 242f324ed0078126c99d8fb6b5b43b4fd4573a543a14f1f1687603a1e39afab9 rootfs.tar diff --git a/package/phytium-ota/src/phytium-ota-latest/uboot/uboot_latest.hash b/package/phytium-ota/src/phytium-ota-latest/uboot/uboot_latest.hash new file mode 100644 index 0000000000000000000000000000000000000000..ac33463378c52f8c5543258ab3939b167fb75a78 --- /dev/null +++ b/package/phytium-ota/src/phytium-ota-latest/uboot/uboot_latest.hash @@ -0,0 +1,2 @@ +sha256 cc16f989a2d1fe94f103aa50ae70a03b1dad5b7a5523924ecfc2fa555f9adea9 fip-all-optee-4GB.bin + diff --git a/package/phytium-standalone/Config.in b/package/phytium-standalone/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..0d392d4ef91c381fbad59e542dcfac9298950618 --- /dev/null +++ b/package/phytium-standalone/Config.in @@ -0,0 +1,16 @@ +config BR2_PACKAGE_PHYTIUM_STANDALONE + bool "phytium-standalone" + help + Phytium-Standalone-SDK for OpenAMP + + https://gitee.com/phytium_embedded/phytium-standalone-sdk + +if BR2_PACKAGE_PHYTIUM_STANDALONE + +config BR2_PACKAGE_PHYTIUM_STANDALONE_CPU_NAME + string "CPU name" + help + Supported CPU: + "e2000q", "phytiumpi", "d2000", "ft2004". + +endif diff --git a/package/phytium-standalone/phytium-standalone.mk b/package/phytium-standalone/phytium-standalone.mk new file mode 100644 index 0000000000000000000000000000000000000000..bbcb26802431bf6c11d4f642f7a877031dc23218 --- /dev/null +++ b/package/phytium-standalone/phytium-standalone.mk @@ -0,0 +1,24 @@ +################################################################################ +# +# phytium-standalone +# +################################################################################ + +PHYTIUM_STANDALONE_VERSION = openamp-v1.0 +PHYTIUM_STANDALONE_SITE = https://gitee.com/phytium_embedded/phytium-standalone-sdk.git +PHYTIUM_STANDALONE_SITE_METHOD = git +PHYTIUM_STANDALONE_DEPENDENCIES = host-phytium-iot-environment host-python3 linux +PHYTIUM_STANDALONE_CPU = $(call qstrip,$(BR2_PACKAGE_PHYTIUM_STANDALONE_CPU_NAME)) + +define PHYTIUM_STANDALONE_BUILD_CMDS + if [[ $(LINUX_VERSION_PROBED) = 6.6* ]]; then \ + PHYTIUM_STANDALONE_ARCH=aarch64; \ + fi && \ + . $(HOST_DIR)/etc/profile.d/phytium_dev.sh && \ + cd $(@D)/example/system/amp/openamp_for_linux && \ + script -q -c "$(TARGET_MAKE_ENV) $(MAKE1) config_$(PHYTIUM_STANDALONE_CPU)_$${PHYTIUM_STANDALONE_ARCH}" /dev/null && \ + mkdir -p $(TARGET_DIR)/lib/firmware && \ + $(TARGET_MAKE_ENV) $(MAKE1) image USR_BOOT_DIR=$(TARGET_DIR)/lib/firmware +endef + +$(eval $(generic-package)) diff --git a/package/phytium-tools/phytium-tools.mk b/package/phytium-tools/phytium-tools.mk index 08b527b5ddae341d081ff37e0bec6689e5f7d667..e65446a9af17ee07f3166b83b2f7d60b42655bd5 100644 --- a/package/phytium-tools/phytium-tools.mk +++ b/package/phytium-tools/phytium-tools.mk @@ -16,7 +16,8 @@ define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS mkdir -p $(TARGET_DIR)/lib/firmware/rtw88/ mkdir -p $(TARGET_DIR)/lib/firmware/rtl_bt/ mkdir -p $(TARGET_DIR)/etc/modprobe.d/ - mkdir -p $(TARGET_DIR)/usr/lib/phytium/ + mkdir -p $(TARGET_DIR)/lib/firmware/uboot-patch + mkdir -p $(TARGET_DIR)/lib/firmware/uboot-patch-hash $(INSTALL) -m 755 -D $(@D)/rtlbt/* $(TARGET_DIR)/lib/firmware/rtlbt/ $(INSTALL) -m 755 -D $(@D)/rtk_hciattach $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 755 -D $(@D)/resize.sh $(TARGET_DIR)/usr/bin/ @@ -27,10 +28,13 @@ define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -D $(@D)/rtlbt/rtl8821c_config $(TARGET_DIR)/lib/firmware/rtl_bt/rtl8821c_config.bin $(INSTALL) -m 755 -D $(@D)/rtlbt/rtl8821c_fw $(TARGET_DIR)/lib/firmware/rtl_bt/rtl8821c_fw.bin $(INSTALL) -m 755 -D $(@D)/rtw88.conf $(TARGET_DIR)/etc/modprobe.d/ - $(INSTALL) -m 755 -D $(@D)/phytium_ota $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 755 -D $(@D)/quectel-CM $(TARGET_DIR)/usr/bin/ - $(INSTALL) -m 755 -D $(@D)/check-hash $(TARGET_DIR)/usr/bin/ - cp -rf $(@D)/phytium-ota-hash/ $(TARGET_DIR)/usr/lib/phytium/ + $(INSTALL) -D -m 644 $(@D)/firmware-configure/* $(TARGET_DIR)/lib/firmware/uboot-patch/ + $(INSTALL) -D -m 644 $(@D)/firmware-configure-hash/* $(TARGET_DIR)/lib/firmware/uboot-patch-hash/ + $(INSTALL) -D -m 755 $(@D)/ft-config $(TARGET_DIR)/usr/bin + $(INSTALL) -m 644 -D $(@D)/pwm-fan.service $(TARGET_DIR)/lib/systemd/system/ + $(INSTALL) -m 755 -D $(@D)/init_pwm_fan.sh $(TARGET_DIR)/usr/bin + $(INSTALL) -m 755 -D $(@D)/pwm_fan.sh $(TARGET_DIR)/usr/bin endef $(eval $(generic-package)) diff --git a/package/phytium-tools/src/firmware-configure-hash/pad_set_v2.x.bin.hash b/package/phytium-tools/src/firmware-configure-hash/pad_set_v2.x.bin.hash new file mode 100644 index 0000000000000000000000000000000000000000..1f5bae731494cb45fc9fc0b992d44612b8f6f1b0 --- /dev/null +++ b/package/phytium-tools/src/firmware-configure-hash/pad_set_v2.x.bin.hash @@ -0,0 +1 @@ +sha256 63201c49e7197a7501af239965be221a161ea89634039a76d76e1cee787da23f pad_set_v2.x.bin diff --git a/package/phytium-tools/src/firmware-configure-hash/pad_set_v3.bin.hash b/package/phytium-tools/src/firmware-configure-hash/pad_set_v3.bin.hash new file mode 100644 index 0000000000000000000000000000000000000000..2ea5f1a05d0a63015ec8b8c72b36115e8a9951e0 --- /dev/null +++ b/package/phytium-tools/src/firmware-configure-hash/pad_set_v3.bin.hash @@ -0,0 +1 @@ +sha256 1165c42d19fe8d9dfcb8836ddbacbbd5e6da1b488bd6c024a9701c8ae0ed7737 pad_set_v3.bin diff --git a/package/phytium-tools/src/firmware-configure-hash/para_5g_usb3.bin.hash b/package/phytium-tools/src/firmware-configure-hash/para_5g_usb3.bin.hash new file mode 100644 index 0000000000000000000000000000000000000000..57f4c8763f708eeb7ead970ffef3d361e250a054 --- /dev/null +++ b/package/phytium-tools/src/firmware-configure-hash/para_5g_usb3.bin.hash @@ -0,0 +1 @@ +sha256 912b81b648134348999087da1cf45a5c482d8f7f3f1107598eef5cfec40b82e7 para_5g_usb3.bin diff --git a/package/phytium-tools/src/firmware-configure-hash/para_msata.bin.hash b/package/phytium-tools/src/firmware-configure-hash/para_msata.bin.hash new file mode 100644 index 0000000000000000000000000000000000000000..f56c587881420c81839ee34d176383bbed70a46f --- /dev/null +++ b/package/phytium-tools/src/firmware-configure-hash/para_msata.bin.hash @@ -0,0 +1 @@ +sha256 9a0ef620ae19a0d4ccff0e23442939e81c52130a81b16eb0306c7ff639511953 para_msata.bin diff --git a/package/phytium-tools/src/firmware-configure-hash/para_nvme_usb2.bin.hash b/package/phytium-tools/src/firmware-configure-hash/para_nvme_usb2.bin.hash new file mode 100644 index 0000000000000000000000000000000000000000..c15fbad4808ada14652ddca50fbd169e951e0dee --- /dev/null +++ b/package/phytium-tools/src/firmware-configure-hash/para_nvme_usb2.bin.hash @@ -0,0 +1 @@ +sha256 1e5e9a5b9f900343cd5d8242d90fc949e231f68e6c939fa0e6f133a5824664d7 para_nvme_usb2.bin diff --git a/package/phytium-tools/src/firmware-configure/pad_set_v2.x.bin b/package/phytium-tools/src/firmware-configure/pad_set_v2.x.bin new file mode 100644 index 0000000000000000000000000000000000000000..caf33a75f98557fadde5da396a965fe0188a625b Binary files /dev/null and b/package/phytium-tools/src/firmware-configure/pad_set_v2.x.bin differ diff --git a/package/phytium-tools/src/firmware-configure/pad_set_v3.bin b/package/phytium-tools/src/firmware-configure/pad_set_v3.bin new file mode 100644 index 0000000000000000000000000000000000000000..831422ce0b043daf68059c1ba9dc9ea9b9fc80e4 Binary files /dev/null and b/package/phytium-tools/src/firmware-configure/pad_set_v3.bin differ diff --git a/package/phytium-tools/src/firmware-configure/para_5g_usb3.bin b/package/phytium-tools/src/firmware-configure/para_5g_usb3.bin new file mode 100644 index 0000000000000000000000000000000000000000..1876b998ba0e6656a75e3711c01189baedabc71c Binary files /dev/null and b/package/phytium-tools/src/firmware-configure/para_5g_usb3.bin differ diff --git a/package/phytium-tools/src/firmware-configure/para_msata.bin b/package/phytium-tools/src/firmware-configure/para_msata.bin new file mode 100644 index 0000000000000000000000000000000000000000..d4c61bafd67ac4358d9b44c85b185adad0f9f241 Binary files /dev/null and b/package/phytium-tools/src/firmware-configure/para_msata.bin differ diff --git a/package/phytium-tools/src/firmware-configure/para_nvme_usb2.bin b/package/phytium-tools/src/firmware-configure/para_nvme_usb2.bin new file mode 100644 index 0000000000000000000000000000000000000000..55cc73c441e7d42ec3d4210a2322feee3ab6716c Binary files /dev/null and b/package/phytium-tools/src/firmware-configure/para_nvme_usb2.bin differ diff --git a/package/phytium-tools/src/ft-config b/package/phytium-tools/src/ft-config new file mode 100755 index 0000000000000000000000000000000000000000..e967d43110d8bccb13c802ab96ea765aa10b4deb --- /dev/null +++ b/package/phytium-tools/src/ft-config @@ -0,0 +1,161 @@ +#!/bin/bash + +# Phytium phytiumpi firmware config script +# +# Copyright (c) 2025 Phytium Technology Co., Ltd. +# +# ft-config - configure the firmware to adapt to different +# hardware configurations on the phytiumpi development board. +# + +fm_patch_dir="/lib/firmware/uboot-patch" +fm_patch_hash_dir="/lib/firmware/uboot-patch-hash" +fm_patch_check_dd_dir="/lib/firmware/uboot-patch-check-dd" + +usage() { + echo -e "Usage: \033[32msudo $0 {hw|mem|pcie} {type}\033[0m" + echo -e " for \033[32mhw\033[0m, {type} can be v2 or v3. + --the phytiumpi development board has v2 and v3 two hardware versions." + echo -e " for \033[32mmem\033[0m, {type} can be 4g or 8g. + --different phytiumpi develpment board has different memory sizes." + echo -e " for \033[32mpcie\033[0m, {type} can be usb2, usb3 or msata. + --pcie can be multiplexed for use as usb2, usb3 or msata." + echo " Example 1: sudo $0 hw v3 + --configure firmware to adapt to v3 phytiumpi hardware." + echo " Example 2: sudo $0 mem 8g + --configure firmware to adapt to 8g mem." + echo " Example 3: sudo $0 pcie usb3 + --configure firmware to repurpose pcie for use as usb3" +} + +# check if parameters are provided. +if [ $# -eq 0 ]; then + usage + exit 1 +fi + +check_args() { + if [ "$#" -ne 2 ]; then + echo -e "\033[1;31mArgs number error! usage: sudo $0 {hw|mem|pcie} {type}\033[0m" + exit 1 + fi + + case "$1" in + "hw") + if [[ "$2" != "v2" && "$2" != "v3" ]]; then + echo -e "\033[1;31mArgs error: when first argument is hw, second argument must be v2 or v3.\033[0m" + exit 1 + fi + ;; + "mem") + if [[ "$2" != "4g" && "$2" != "8g" ]]; then + echo -e "\033[1;31mArgs error: when first argument is mem, second argument must be 4g or 8g.\033[0m" + exit 1 + fi + ;; + "pcie") + if [[ "$2" != "usb2" && "$2" != "usb3" && "$2" != "msata" ]]; then + echo -e "\033[1;31mArgs error: when first argument is pcie, second argument must be usb2, usb3 or msata.\033[0m" + exit 1 + fi + ;; + *) + echo -e "\033[1;31mArgs error: first argument must be 'hw', 'mem', or 'pcie'.\033[0m" + exit 1 + ;; + esac +} + +while true; do + case $1 in + "-h" | "-help") + usage + exit + ;; + *) + check_args $1 $2 $3 + break + ;; + esac +done + +# check if the dd command was successful. +# $1: the file to be checked. +# $2: the starting position of the file to be checked in the firmware. +# $3: the size of the file to be checked. +check-if-dd-success() { + mkdir -p $fm_patch_check_dd_dir + file=$(basename $1 .bin) + dd if=/dev/mmcblk0 of=$fm_patch_check_dd_dir/recovered_$file.bin bs=$2 skip=1 count=1 + dd if=$fm_patch_check_dd_dir/recovered_$file.bin of=$fm_patch_check_dd_dir/final_$file.bin bs=1 count=$3 + _hash=$(sha256sum $fm_patch_check_dd_dir/final_$file.bin | cut -d ' ' -f 1 ) + _known=$(cat $fm_patch_hash_dir/$1.hash | cut -d ' ' -f 3 ) + # Do the hashes match? + if [ "${_hash}" = "${_known}" ]; then + echo -e "\033[1;32mHash verification succeeded, configuration has been updated.\033[0m" + else + echo -e "\033[1;31mHash verification failed, configuration update encountered an error. You may need to manually update the firmware. See https://gitee.com/phytium_embedded/phytium-pi-os/wikis/%E9%A3%9E%E8%85%BE%E6%B4%BE%E5%9B%BA%E4%BB%B6%E9%85%8D%E7%BD%AE%E5%B7%A5%E5%85%B7ft-config%E7%9A%84%E4%BB%8B%E7%BB%8D%E4%B8%8E%E4%BD%BF%E7%94%A8的启动异常补救措施小节\033[0m" + exit 1 + fi +} + +# configure_phytiumpi_firmware +# $1: +# hw, mem or pcie +# $2: +# v2 or v3 when $1 is hw +# 2g, 4g or 8g when $1 is mem +# usb2, usb3 or msata when $1 is pcie +configure_phytiumpi_firmware() { + if [[ "$1" == "hw" ]]; then + if [[ "$2" == "v2" ]]; then + check-hash $fm_patch_hash_dir/pad_set_v2.x.bin.hash $fm_patch_dir/pad_set_v2.x.bin pad_set_v2.x.bin + dd if=$fm_patch_dir/pad_set_v2.x.bin of=/dev/mmcblk0 bs=1000k seek=1 && sync + check-if-dd-success pad_set_v2.x.bin 1000k 1088 + systemctl disable pwm-fan.service + elif [[ "$2" == "v3" ]]; then + check-hash $fm_patch_hash_dir/pad_set_v3.bin.hash $fm_patch_dir/pad_set_v3.bin pad_set_v3.bin + dd if=$fm_patch_dir/pad_set_v3.bin of=/dev/mmcblk0 bs=1000k seek=1 && sync + check-if-dd-success pad_set_v3.bin 1000k 1088 + systemctl enable pwm-fan.service + fi + elif [[ "$1" == "mem" ]]; then + if [[ "$2" == "4g" ]]; then + printf "\x10" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 && sync + elif [[ "$2" == "8g" ]]; then + printf "\x11" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 && sync + fi + if [ "$?" != "0" ]; then + echo "\033[1;31mconfigure mem failed\033[0m" + exit 1 + fi + elif [[ "$1" == "pcie" ]]; then + # preserve memory information. + pre_mem=$(dd if=/dev/mmcblk0 bs=1 count=1 skip=1004390 status=none | xxd -p) + if [[ "$2" == "usb2" ]]; then + check-hash $fm_patch_hash_dir/para_nvme_usb2.bin.hash $fm_patch_dir/para_nvme_usb2.bin para_nvme_usb2.bin + dd if=$fm_patch_dir/para_nvme_usb2.bin of=/dev/mmcblk0 bs=980k seek=1 && sync + check-if-dd-success para_nvme_usb2.bin 980k 1568 + elif [[ "$2" == "usb3" ]]; then + check-hash $fm_patch_hash_dir/para_5g_usb3.bin.hash $fm_patch_dir/para_5g_usb3.bin para_5g_usb3.bin + dd if=$fm_patch_dir/para_5g_usb3.bin of=/dev/mmcblk0 bs=980k seek=1 && sync + check-if-dd-success para_5g_usb3.bin 980k 1568 + elif [[ "$2" == "msata" ]]; then + check-hash $fm_patch_hash_dir/para_msata.bin.hash $fm_patch_dir/para_msata.bin para_msata.bin + dd if=$fm_patch_dir/para_msata.bin of=/dev/mmcblk0 bs=980k seek=1 && sync + check-if-dd-success para_msata.bin 980k 1568 + fi + # restore memory information. + printf "\\x$pre_mem" | dd of=/dev/mmcblk0 bs=1 count=1 conv=notrunc seek=1004390 + fi + + echo -e "\033[1;32mConfigure phytiumpi firmware success, please power reset now\033[0m" +} + +main() { + configure_phytiumpi_firmware $1 $2 +} + +main $@ + + diff --git a/package/phytium-tools/src/init_pwm_fan.sh b/package/phytium-tools/src/init_pwm_fan.sh new file mode 100755 index 0000000000000000000000000000000000000000..cfda1b941bde0781e403b812ec76782fd08a38bf --- /dev/null +++ b/package/phytium-tools/src/init_pwm_fan.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#fan +echo 1 > /sys/class/pwm/pwmchip0/export +cd /sys/class/pwm/pwmchip0/pwm1/ +echo 25000 > period +# echo 15000 > duty_cycle #fan slow +echo 24000 > duty_cycle #fan fast +echo normal > polarity +echo 1 > enable +. /usr/bin/pwm_fan.sh & diff --git a/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/fitImage.hash b/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/fitImage.hash deleted file mode 100644 index fcd7f715891d3f62141f6f001009f3a5f65343d3..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/fitImage.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 7227f5d936e30ada647381b6b07010bc837d2167399c35abdf02c24255743fa9 fitImage diff --git a/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/linux-headers-6.6.deb.hash b/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/linux-headers-6.6.deb.hash deleted file mode 100644 index 54f25259dc01880dcf40db51265edbb4cedfafe2..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/linux-headers-6.6.deb.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 a2e62b56a15589ef3952e70b96d9d64056bf0fc16170f92bd22c5fc6f54b0d56 linux-headers-6.6.deb diff --git a/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/linux-image-6.6.deb.hash b/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/linux-image-6.6.deb.hash deleted file mode 100644 index 4e034910bd3f2d80f8d60de7b491127aec0660da..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/fitImage/latest/6.6/linux-image-6.6.deb.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 daaa543f0e58eb7886dc1585874828d5734b5b6e913f870134f53dc0e02e846d linux-image-6.6.deb diff --git a/package/phytium-tools/src/phytium-ota-hash/uboot/5g/fip-all-5g-4GB.bin.hash b/package/phytium-tools/src/phytium-ota-hash/uboot/5g/fip-all-5g-4GB.bin.hash deleted file mode 100644 index 824c2b11ed598c463dd6e219d12e93802f9db76f..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/uboot/5g/fip-all-5g-4GB.bin.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 1ebc3dc344886ffb2029a33fd3fa4a9f22ff981255cb69835e84f247cfe60f11 fip-all-5g-4GB.bin diff --git a/package/phytium-tools/src/phytium-ota-hash/uboot/latest/fip-all-optee-2GB.bin.hash b/package/phytium-tools/src/phytium-ota-hash/uboot/latest/fip-all-optee-2GB.bin.hash deleted file mode 100644 index 8702bafcd8d95b2f97e06bbe68deb961105d3dfd..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/uboot/latest/fip-all-optee-2GB.bin.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 5ea39ddf7bcfd8ff1b3448fa0c71847a9c1e653f2cdd2cfc2451f813d8c946e4 fip-all-optee-2GB.bin diff --git a/package/phytium-tools/src/phytium-ota-hash/uboot/latest/fip-all-optee-4GB.bin.hash b/package/phytium-tools/src/phytium-ota-hash/uboot/latest/fip-all-optee-4GB.bin.hash deleted file mode 100644 index d2e913ab7f230c3dde1c797b6c1ebe0c010cfe77..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/uboot/latest/fip-all-optee-4GB.bin.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 7cc1bed898467814362553ace772ece3031819d1f62616ea6a66981014e72567 fip-all-optee-4GB.bin diff --git a/package/phytium-tools/src/phytium-ota-hash/uboot/msata/fip-all-msata-4GB.bin.hash b/package/phytium-tools/src/phytium-ota-hash/uboot/msata/fip-all-msata-4GB.bin.hash deleted file mode 100644 index e5519f6a6017c3f1671bb574eb85ca19c5c3561e..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/uboot/msata/fip-all-msata-4GB.bin.hash +++ /dev/null @@ -1 +0,0 @@ -sha256 991d1cacff5a732a153eafb28c8c35d58e4455a82512c70c92e94a489bf02ac8 fip-all-msata-4GB.bin diff --git a/package/phytium-tools/src/phytium-ota-hash/uboot/v1.5/fip-all-optee-2GB.bin.hash b/package/phytium-tools/src/phytium-ota-hash/uboot/v1.5/fip-all-optee-2GB.bin.hash deleted file mode 100644 index 6da303bac958dbee7e37de728f6659d4f6761f4e..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/uboot/v1.5/fip-all-optee-2GB.bin.hash +++ /dev/null @@ -1,2 +0,0 @@ -sha256 5ea39ddf7bcfd8ff1b3448fa0c71847a9c1e653f2cdd2cfc2451f813d8c946e4 fip-all-optee-2GB.bin - diff --git a/package/phytium-tools/src/phytium-ota-hash/uboot/v1.5/fip-all-optee-4GB.bin.hash b/package/phytium-tools/src/phytium-ota-hash/uboot/v1.5/fip-all-optee-4GB.bin.hash deleted file mode 100644 index 80d83247074010c5b5f41faa53d0919289b5180f..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium-ota-hash/uboot/v1.5/fip-all-optee-4GB.bin.hash +++ /dev/null @@ -1,2 +0,0 @@ -sha256 7cc1bed898467814362553ace772ece3031819d1f62616ea6a66981014e72567 fip-all-optee-4GB.bin - diff --git a/package/phytium-tools/src/phytium_ota b/package/phytium-tools/src/phytium_ota deleted file mode 100755 index 98d392dfadc9a1b5876f59548d37cc32c3870363..0000000000000000000000000000000000000000 --- a/package/phytium-tools/src/phytium_ota +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/bash - -# Phytium phytiumpi ota script -# -# Copyright (c) 2024 Phytium Technology Co., Ltd. -# -# phytium_ota.sh - To replace fip-all.bin and fitImage through the -# network on the phytiumpi development board. -# - -download_dir="/usr/local/phytium-libs" -download_site="https://gitee.com/phytium_embedded/phytium-rogue-umlibs.git" -dest_dir="/usr/local/phytium-ota" -hash_dir="/usr/lib/phytium/phytium-ota-hash" - -usage() { - echo "Usage: sudo $0 {all|fitImage|uboot} {version}" - echo -e " for \033[32muboot\033[0m, {version} can be v1.x or latest, etc - for \033[32mfitImage\033[0m and \033[32mall\033[0m, {version} only be latest" - echo " Example 1: sudo $0 uboot v1.x - --update uboot to version v1.x - Example 2: sudo $0 fitImage latest - --update fitImage to the latest - Example 3: sudo $0 all latest - --update uboot and fit Image to the latest" -} - -while true; do - case $1 in - "-h" | "-help") - usage - exit - ;; - *) - break - ;; - esac -done - -check_args() -{ - if [ "$#" -ne 2 ]; then - echo -e "\033[1;31mUsage: sudo $0 {all|fitImage|uboot} {latest|v1.x}\033[0m" - exit 1 - fi - if [ "$1" != "all" ] && [ "$1" != "fitImage" ] && [ "$1" != "uboot" ]; then - echo -e "\033[1;31mError: First argument must be 'all', 'fitImage', or 'uboot'.\033[0m" - exit 1 - fi - - if [[ "$2" != "latest" && "$2" != "msata" && "$2" != "5g" && ! "$2" =~ ^v1\.[0-9]+$ ]]; then - echo -e "\033[1;31mError: Second argument must be 'latest', "msata", "5g" or 'v1.x'.\033[0m" - exit 1 - fi -} - -mem_info=$(LC_ALL=C free -w 2>/dev/null | grep "^Mem" || LC_ALL=C free | grep "^Mem") -mem_info=$(echo $mem_info | awk '{print $2}') -memory_total=$(( mem_info * 1024 )) -# compare to 3GB -if [ $memory_total -ge 3221225472 ]; then - mem=4GB -else - mem=2GB -fi - -# uboot -uboot_type=optee -if [ "$2" == "msata" ]; then - uboot_type=msata -elif [ "$2" == "5g" ]; then - uboot_type=5g -fi -uboot_bin="fip-all-$uboot_type-$mem.bin" - -uboot_hash="$uboot_bin.hash" - -# get kernel version -kernel_version=$(uname -r) - -# unsupport rt kernel and 4.19 -if [[ $kernel_version =~ ^((5\.10\.[0-9]+))-phytium.* ]]; then - kernel_version="5.10" -elif [[ $kernel_version =~ ^((6\.6\.[0-9]+))-phytium.* ]]; then - kernel_version="6.6" -else - echo -e "\033[31munsupport kernel version: $kernel_version\033[0m" - exit 1 -fi - -detect_and_set_network() { - # Grab this machine's public IP address - PUBLIC_IP=$(curl --max-time 5 -s https://ipinfo.io/ip) - - # Check if we have wireless adaptor - WIFI_DEVICE=$(LC_ALL=C nmcli dev status | grep " wifi " 2> /dev/null) - - if [ -z "$PUBLIC_IP" ]; then - - # ask for connecting to wireless if wifi device is found - if [[ -n "$WIFI_DEVICE" ]]; then - echo -e "Internet connection was \x1B[91mnot detected\x1B[0m." - echo "" - unset response - while [[ ! "${response}" =~ ^(Y|y|N|n)$ ]]; do - if [ -z $PRESET_CONNECT_WIRELESS ];then - read -r -p "Connect via wireless? [Y/n] " response - response=${response:-Y} - else - response=n - fi - echo "$response" - done - if [[ "${response}" =~ ^(Y|y)$ ]]; then - nmtui-connect - fi - echo "" - fi - fi - # Grab IP once again if not found - [[ -z "$PUBLIC_IP" && -n "$WIFI_DEVICE" ]] && PUBLIC_IP=$(curl --max-time 5 -s https://ipinfo.io/ip) - - if [ -z "$PUBLIC_IP" ]; then - echo -e "Internet connection was \x1B[91mnot detected\x1B[0m." - echo "exit" - exit 1; - fi -} # detect_and_set_network - -# get fip-all.bin and fitImage from gitee. -get_uboot_and_fitImage() { - - rm -rf $download_dir - mkdir -p $download_dir - - git clone -b develop --depth 1 $download_site $download_dir - if [ "$?" != "0" ]; then - echo -e "\033[1;31mget uboot and fitImage failed\033[0m" - exit 1 - fi - echo -e "\033[1;32mget uboot and fitImage success\033[0m" - rm -rf $dest_dir - cp -rf $download_dir/phytium-ota /usr/local - -} # get_uboot_and_fitImage - -# replace_uboot_and_fitImage -# $1: can be all\uboot\fitImage -# $2: can be latest\v1.5\msata, etc -replace_uboot_and_fitImage() { - - if [ "$1" == "all" ]; then - echo -e "\033[1;32mcheck hash...\033[0m" - check-hash $hash_dir/uboot/$2/$uboot_hash $dest_dir/uboot/$2/$uboot_bin $uboot_bin - check-hash $hash_dir/fitImage/$2/$kernel_version/fitImage.hash $dest_dir/fitImage/$2/$kernel_version/fitImage fitImage - check-hash $hash_dir/fitImage/$2/$kernel_version/linux-headers-$kernel_version.deb.hash $dest_dir/fitImage/$2/$kernel_version/linux-headers-$kernel_version.deb linux-headers-$kernel_version.deb - check-hash $hash_dir/fitImage/$2/$kernel_version/linux-image-$kernel_version.deb.hash $dest_dir/fitImage/$2/$kernel_version/linux-image-$kernel_version.deb linux-image-$kernel_version.deb - - echo -e "\033[1;32mupdate uboot...\033[0m" - # to preserve the partition table. - dd if=/dev/mmcblk0 of=start.img bs=512 count=1 >> $dest_dir/uboot/$2/replace.log 2>&1 - dd if=$dest_dir/uboot/$2/$uboot_bin of=/dev/mmcblk0 bs=1M count=4 >> $dest_dir/uboot/$2/replace.log 2>&1 - dd if=start.img of=/dev/mmcblk0 bs=512 count=1 >> $dest_dir/uboot/$2/replace.log 2>&1 - rm -f start.img - echo -e "\033[1;32mupdate fitImage...\033[0m" - dd if=$dest_dir/fitImage/$2/$kernel_version/fitImage of=/dev/mmcblk0 bs=1M seek=4 count=60 >> $dest_dir/fitImage/$2/$kernel_version/replace.log 2>&1 - dpkg -i $dest_dir/fitImage/$2/$kernel_version/linux-headers-$kernel_version.deb - dpkg -i $dest_dir/fitImage/$2/$kernel_version/linux-image-$kernel_version.deb - elif [ "$1" == "uboot" ]; then - echo -e "\033[1;32mcheck hash...\033[0m" - check-hash $hash_dir/uboot/$2/$uboot_hash $dest_dir/uboot/$2/$uboot_bin $uboot_bin - - echo -e "\033[1;32mupdate uboot...\033[0m" - # to preserve the partition table. - dd if=/dev/mmcblk0 of=start.img bs=512 count=1 >> $dest_dir/$1/$2/replace.log 2>&1 - dd if=$dest_dir/$1/$2/$uboot_bin of=/dev/mmcblk0 bs=1M count=4 >> $dest_dir/$1/$2/replace.log 2>&1 - dd if=start.img of=/dev/mmcblk0 bs=512 count=1 >> $dest_dir/$1/$2/replace.log 2>&1 - rm -f start.img - elif [ "$1" == "fitImage" ]; then - echo -e "\033[1;32mcheck hash...\033[0m" - check-hash $hash_dir/fitImage/$2/$kernel_version/fitImage.hash $dest_dir/fitImage/$2/$kernel_version/fitImage fitImage - check-hash $hash_dir/fitImage/$2/$kernel_version/linux-headers-$kernel_version.deb.hash $dest_dir/fitImage/$2/$kernel_version/linux-headers-$kernel_version.deb linux-headers-$kernel_version.deb - check-hash $hash_dir/fitImage/$2/$kernel_version/linux-image-$kernel_version.deb.hash $dest_dir/fitImage/$2/$kernel_version/linux-image-$kernel_version.deb linux-image-$kernel_version.deb - - echo -e "\033[1;32mupdate fitImage...\033[0m" - dd if=$dest_dir/$1/$2/$kernel_version/fitImage of=/dev/mmcblk0 bs=1M seek=4 count=60 >> $dest_dir/$1/$2/$kernel_version/replace.log 2>&1 - dpkg -i $dest_dir/$1/$2/$kernel_version/linux-headers-$kernel_version.deb - dpkg -i $dest_dir/$1/$2/$kernel_version/linux-image-$kernel_version.deb - else - echo -e "\033[1;31margs error, exit\033[0m" - fi - - if [ "$?" != "0" ]; then - echo -e "\033[1;31mreplace_uboot_and_fitImage failed\033[0m" - exit 1 - fi - - echo -e "\033[1;32mupdate success, please reboot now\033[0m" -} # replace_uboot_and_fitImage - - -main() { - check_args $1 $2 - detect_and_set_network - get_uboot_and_fitImage $1 $2 - replace_uboot_and_fitImage $1 $2 -} - -main $@ diff --git a/package/phytium-tools/src/pwm-fan.service b/package/phytium-tools/src/pwm-fan.service new file mode 100644 index 0000000000000000000000000000000000000000..d5c0f79d22ff6093e8d25ec57fc43afb0a63cf8c --- /dev/null +++ b/package/phytium-tools/src/pwm-fan.service @@ -0,0 +1,9 @@ +[Unit] +Description=pwm fan process +After=network.target +[Service] +Type=forking +ExecStart=/usr/bin/init_pwm_fan.sh +User=root +[Install] +WantedBy=multi-user.target diff --git a/package/phytium-tools/src/pwm_fan.sh b/package/phytium-tools/src/pwm_fan.sh new file mode 100755 index 0000000000000000000000000000000000000000..cb1886290c3a237c8df6f1843ed91d2944153c40 --- /dev/null +++ b/package/phytium-tools/src/pwm_fan.sh @@ -0,0 +1,16 @@ +#!/bin/bash +THRESHOLD_TEMP=50 +while true; +do + sleep 30s + CPU_TEMP=$(cat /sys/class/thermal/thermal_zone0/temp) + CPU_TEMP_C=$((CPU_TEMP / 1000)) + #echo "$CPU_TEMP_C" + if [ "$CPU_TEMP_C" -gt "$THRESHOLD_TEMP" ]; then + #echo "pwm fast" + echo 24000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle + else + #echo "pwm slow" + echo 12000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle + fi +done diff --git a/package/phyuboot/phyuboot.mk b/package/phyuboot/phyuboot.mk index e38219c6551203703ccef13a402f4d8daa2c2c12..3fadf3abaf63774b078ebb7410ed2f70cacef763 100644 --- a/package/phyuboot/phyuboot.mk +++ b/package/phyuboot/phyuboot.mk @@ -4,7 +4,7 @@ # ################################################################################ -PHYUBOOT_VERSION = 450cf1800670422e9a39b1589f2d1257ccb6ad24 +PHYUBOOT_VERSION = 52881fd67e2453e173c0e6f608d3887598efd0ef PHYUBOOT_SITE = https://gitee.com/phytium_embedded/phytium-rogue-umlibs.git PHYUBOOT_SITE_METHOD = git diff --git a/package/python3/python3.mk b/package/python3/python3.mk index 5d9d77af50ee290553e5c11874769fae439ae23b..744c77c4571537e517e19393bb1eeb65ca986394 100644 --- a/package/python3/python3.mk +++ b/package/python3/python3.mk @@ -67,6 +67,9 @@ HOST_PYTHON3_CONF_OPTS += --disable-openssl endif PYTHON3_INSTALL_STAGING = YES +ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) +PYTHON3_INSTALL_TARGET = NO +endif ifeq ($(BR2_PACKAGE_PYTHON3_2TO3),y) PYTHON3_CONF_OPTS += --enable-lib2to3 diff --git a/package/rpmsg-demo/Config.in b/package/rpmsg-demo/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..34050ae0b587176fed0b409a69e4e0447f8fa5ca --- /dev/null +++ b/package/rpmsg-demo/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_RPMSG_DEMO + bool "rpmsg-demo" + help + Phytium openamp rpmsg-demo. + + https://gitee.com/phytium_embedded/phytium-embedded-docs/blob/master/open-amp/rpmsg-demo-single.c diff --git a/package/rpmsg-demo/rpmsg-demo.hash b/package/rpmsg-demo/rpmsg-demo.hash new file mode 100644 index 0000000000000000000000000000000000000000..88a0daa7a99677b1f944e05556310576411fe17b --- /dev/null +++ b/package/rpmsg-demo/rpmsg-demo.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 0a5047784bf29880b8ed8fa3dbeef5e21a16854788cf96b12efae163212b02fd rpmsg-demo-single.c diff --git a/package/rpmsg-demo/rpmsg-demo.mk b/package/rpmsg-demo/rpmsg-demo.mk new file mode 100644 index 0000000000000000000000000000000000000000..5cdedc7ef3998d4b070630d6563f85399f0effc4 --- /dev/null +++ b/package/rpmsg-demo/rpmsg-demo.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# rpmsg-demo +# +################################################################################ + +RPMSG_DEMO_SITE = https://gitee.com/phytium_embedded/phytium-embedded-docs/raw/master/open-amp +RPMSG_DEMO_SOURCE = rpmsg-demo-single.c + +define RPMSG_DEMO_EXTRACT_CMDS + cp $(RPMSG_DEMO_DL_DIR)/$(RPMSG_DEMO_SOURCE) $(@D) +endef + +define RPMSG_DEMO_BUILD_CMDS + $(TARGET_CC) -o $(@D)/rpmsg-demo-single $(@D)/$(RPMSG_DEMO_SOURCE) +endef + +define RPMSG_DEMO_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(@D)/rpmsg-demo-single $(TARGET_DIR)/usr/bin/ +endef + +$(eval $(generic-package)) diff --git a/package/xenomai/0001-mercury.patch b/package/xenomai/0001-mercury.patch new file mode 100644 index 0000000000000000000000000000000000000000..4cb1cc94ca9cc390a0a19e5b5b1ea578340e85c3 --- /dev/null +++ b/package/xenomai/0001-mercury.patch @@ -0,0 +1,107 @@ +diff -Nur xenomai-v3.3/lib/boilerplate/setup.c xenomai-v3.3-mercury/lib/boilerplate/setup.c +--- xenomai-v3.3/lib/boilerplate/setup.c 2024-10-22 00:27:33.000000000 +0800 ++++ xenomai-v3.3-mercury/lib/boilerplate/setup.c 2025-03-14 11:15:23.058291260 +0800 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + + struct base_setup_data __base_setup_data = { +diff -Nur xenomai-v3.3/lib/copperplate/internal.c xenomai-v3.3-mercury/lib/copperplate/internal.c +--- xenomai-v3.3/lib/copperplate/internal.c 2024-10-22 00:27:33.000000000 +0800 ++++ xenomai-v3.3-mercury/lib/copperplate/internal.c 2025-03-14 11:16:15.375803540 +0800 +@@ -25,7 +25,7 @@ + #include + #include + #include +- ++#include + #include + #include + #include +diff -Nur xenomai-v3.3/testsuite/gpiobench/gpiobench.c xenomai-v3.3-mercury/testsuite/gpiobench/gpiobench.c +--- xenomai-v3.3/testsuite/gpiobench/gpiobench.c 2024-10-22 00:27:33.000000000 +0800 ++++ xenomai-v3.3-mercury/testsuite/gpiobench/gpiobench.c 2025-03-14 11:10:41.586603280 +0800 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + #include + + #define NS_PER_MS (1000000) +diff -Nur xenomai-v3.3/testsuite/smokey/alchemytests/Makefile.am xenomai-v3.3-mercury/testsuite/smokey/alchemytests/Makefile.am +--- xenomai-v3.3/testsuite/smokey/alchemytests/Makefile.am 2024-10-22 00:27:33.000000000 +0800 ++++ xenomai-v3.3-mercury/testsuite/smokey/alchemytests/Makefile.am 2025-03-14 11:11:16.205539420 +0800 +@@ -21,7 +21,6 @@ + alchemytests_mq3 \ + alchemytests_mutex1 \ + alchemytests_mutex2 \ +- alchemytests_pipe1 \ + alchemytests_sem1 \ + alchemytests_sem2 \ + alchemytests_task1 \ +@@ -35,6 +34,10 @@ + alchemytests_task9 \ + alchemytests_task10 \ + alchemytests_task11 ++if XENO_COBALT ++test_PROGRAMS += \ ++ alchemytests_pipe1 ++endif + + alchemycppflags = \ + $(XENO_USER_CFLAGS) \ +@@ -75,10 +78,6 @@ + alchemytests_mutex2_CPPFLAGS = $(alchemycppflags) + alchemytests_mutex2_LDADD = $(alchemyldadd) + alchemytests_mutex2_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ +-alchemytests_pipe1_SOURCES = pipe-1.c +-alchemytests_pipe1_CPPFLAGS = $(alchemycppflags) +-alchemytests_pipe1_LDADD = $(alchemyldadd) +-alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ + alchemytests_mq1_SOURCES = mq-1.c + alchemytests_mq1_CPPFLAGS = $(alchemycppflags) + alchemytests_mq1_LDADD = $(alchemyldadd) +@@ -143,3 +142,9 @@ + alchemytests_task11_CPPFLAGS = $(alchemycppflags) + alchemytests_task11_LDADD = $(alchemyldadd) + alchemytests_task11_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ ++if XENO_COBALT ++alchemytests_pipe1_SOURCES = pipe-1.c ++alchemytests_pipe1_CPPFLAGS = $(alchemycppflags) ++alchemytests_pipe1_LDADD = $(alchemyldadd) ++alchemytests_pipe1_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ ++endif +diff -Nur xenomai-v3.3/testsuite/smokey/alchemytests/alchemytests.c xenomai-v3.3-mercury/testsuite/smokey/alchemytests/alchemytests.c +--- xenomai-v3.3/testsuite/smokey/alchemytests/alchemytests.c 2024-10-22 00:27:33.000000000 +0800 ++++ xenomai-v3.3-mercury/testsuite/smokey/alchemytests/alchemytests.c 2025-03-14 11:11:22.755236760 +0800 +@@ -1,4 +1,5 @@ + // SPDX-License-Identifier: GPL-2.0 ++#include + #include + #include + #include +diff -Nur xenomai-v3.3/testsuite/smokey/alchemytests/task-11.c xenomai-v3.3-mercury/testsuite/smokey/alchemytests/task-11.c +--- xenomai-v3.3/testsuite/smokey/alchemytests/task-11.c 2024-10-22 00:27:33.000000000 +0800 ++++ xenomai-v3.3-mercury/testsuite/smokey/alchemytests/task-11.c 2025-03-14 11:11:30.892819240 +0800 +@@ -1,5 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0 + #include ++#include + #include + #include + #include +diff -Nur xenomai-v3.3/testsuite/smokey/alchemytests/task-2.c xenomai-v3.3-mercury/testsuite/smokey/alchemytests/task-2.c +--- xenomai-v3.3/testsuite/smokey/alchemytests/task-2.c 2024-10-22 00:27:33.000000000 +0800 ++++ xenomai-v3.3-mercury/testsuite/smokey/alchemytests/task-2.c 2025-03-14 11:11:38.029262840 +0800 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/package/xenomai/Config.in b/package/xenomai/Config.in index d4983b084d15e3e50ab51847d9035eab1642db4a..ae476e337710e40e92dd8ce597ca2bfcb8ebae86 100644 --- a/package/xenomai/Config.in +++ b/package/xenomai/Config.in @@ -4,6 +4,7 @@ config BR2_PACKAGE_XENOMAI_COBALT_ARCH_SUPPORTS default y if BR2_x86_64 default y if BR2_powerpc default y if BR2_arm && !BR2_ARM_CPU_ARMV7M && !BR2_ARM_CPU_ARMV8A + default y if BR2_aarch64 comment "xenomai needs a glibc or uClibc toolchain w/ threads" depends on BR2_USE_MMU diff --git a/package/xenomai/xenomai.mk b/package/xenomai/xenomai.mk index 9356919259bab986fdfcba7859c7ac2f628d9d0e..f0ac235a0a1822d95443ba32f009d6509fc9650e 100644 --- a/package/xenomai/xenomai.mk +++ b/package/xenomai/xenomai.mk @@ -39,10 +39,6 @@ XENOMAI_INSTALL_STAGING = YES XENOMAI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install-user XENOMAI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-user -XENOMAI_CONF_OPTS += \ - --disable-demo \ - --includedir=/usr/include/xenomai/ - ifeq ($(BR2_PACKAGE_XENOMAI_MERCURY),y) XENOMAI_CONF_OPTS += --with-core=mercury else @@ -69,22 +65,38 @@ endif XENOMAI_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS)) +XENOMAI_PREFIX = /usr/xenomai +define XENOMAI_CONFIGURE_CMDS + (cd $(@D) && rm -rf config.cache && \ + $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_ARGS) \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=$(XENOMAI_PREFIX) \ + --exec-prefix=$(XENOMAI_PREFIX) \ + --program-prefix="" \ + $(XENOMAI_CONF_OPTS) \ + ) +endef + # Some of these files may be desired by some users -- at that point specific # config options need to be added to keep a particular set. define XENOMAI_REMOVE_UNNEEDED_FILES for i in xeno xeno-config xeno-info wrap-link.sh ; do \ - rm -f $(TARGET_DIR)/usr/bin/$$i ; \ + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/bin/$$i ; \ done for i in cobalt modechk ; do \ - rm -f $(TARGET_DIR)/usr/lib/$$i.wrappers ; \ + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/lib/$$i.wrappers ; \ done for i in autotune corectl hdb rtnet nomaccfg rtcfg rtifconfig \ rtiwconfig rtping rtroute tdmacfg rtps slackspot version; do \ - rm -f $(TARGET_DIR)/usr/sbin/$$i ; \ + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/sbin/$$i ; \ done endef -XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_UNNEEDED_FILES +# XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_UNNEEDED_FILES ifeq ($(BR2_PACKAGE_XENOMAI_TESTSUITE),y) XENOMAI_CONF_OPTS += --enable-testsuite @@ -95,9 +107,9 @@ endif ifeq ($(BR2_PACKAGE_XENOMAI_RTCAN),) define XENOMAI_REMOVE_RTCAN_PROGS for i in rtcanrecv rtcansend ; do \ - rm -f $(TARGET_DIR)/usr/bin/$$i ; \ + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/bin/$$i ; \ done - rm -f $(TARGET_DIR)/usr/sbin/rtcanconfig + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/sbin/rtcanconfig endef XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_RTCAN_PROGS @@ -107,12 +119,12 @@ ifeq ($(BR2_PACKAGE_XENOMAI_ANALOGY),) define XENOMAI_REMOVE_ANALOGY for i in cmd_read cmd_write cmd_bits insn_read insn_write insn_bits \ wf_generate ; do \ - rm -f $(TARGET_DIR)/usr/bin/$$i ; \ + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/bin/$$i ; \ done for i in analogy_config analogy_calibrate ; do \ - rm -f $(TARGET_DIR)/usr/sbin/$$i ; \ + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/sbin/$$i ; \ done - rm -f $(TARGET_DIR)/usr/lib/libanalogy.* + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/lib/libanalogy.* endef XENOMAI_POST_INSTALL_TARGET_HOOKS += XENOMAI_REMOVE_ANALOGY @@ -129,7 +141,7 @@ XENOMAI_REMOVE_LIBS_LIST += $(if $(BR2_PACKAGE_XENOMAI_VRTX_SKIN),,vrtx) define XENOMAI_REMOVE_LIBS for i in $(XENOMAI_REMOVE_LIBS_LIST) ; do \ - rm -f $(TARGET_DIR)/usr/lib/lib$$i.* ; \ + rm -f $(TARGET_DIR)/$(XENOMAI_PREFIX)/lib/lib$$i.* ; \ done endef diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index a7ceccd66ffa865e087a89f74d0c852b79a50446..c5ad43f0ac174e9c367abeaa3ba48c8850713a99 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -354,6 +354,11 @@ define toolchain_find_libc_a $$(readlink -f $$(LANG=C $(1) -print-file-name=libc.a)) endef +# Returns the directory of the libgcc.a file +define toolchain_find_libgcc_dir +$$(dirname $$(readlink -f $$(LANG=C $(1) -print-libgcc-file-name))) +endef + # Integration of the toolchain into Buildroot: find the main sysroot # and the variant-specific sysroot, then copy the needed libraries to # the $(TARGET_DIR) and copy the whole sysroot (libraries and headers) @@ -601,6 +606,8 @@ define $(2)_CONFIGURE_CMDS $$(call check_glibc,$$$${SYSROOT_DIR}) ; \ fi $$(Q)$$(call check_toolchain_ssp,$$(TOOLCHAIN_EXTERNAL_CC),$(BR2_SSP_OPTION)) + SPECS_DIR=$$(call toolchain_find_libgcc_dir, $$(TOOLCHAIN_EXTERNAL_CC)) ; \ + cp $(TOPDIR)/board/phytium/common/gcc-support-multiarch.specs $$$${SPECS_DIR}/specs endef $(2)_TOOLCHAIN_WRAPPER_ARGS += $$(TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS) diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in index 2565707def9cd3fb6cb6b622ebfe3b87c52a4e71..4c7e1d76a52216dcc50cb66f34c8f152bdce2e9d 100644 --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in @@ -1,19 +1,13 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64 - bool "Arm AArch64 13.2.rel1" + bool "Arm AArch64 12.2.rel1" depends on BR2_aarch64 depends on BR2_HOSTARCH = "x86_64" - depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_13 select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20 - select BR2_TOOLCHAIN_GCC_AT_LEAST_13 + select BR2_TOOLCHAIN_GCC_AT_LEAST_12 select BR2_TOOLCHAIN_HAS_FORTRAN select BR2_TOOLCHAIN_HAS_OPENMP help - Arm toolchain for the AArch64 architecture. - - This is the same toolchain that was previously distributed by - Linaro. - - https://developer.arm.com/open-source/gnu-toolchain + Official toolchain (x86 cross-compile for AArch64) from ARM web site, version 12.2.rel1. diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash index 9de90d4b06efe030aee381e90df9459fb6d8f05e..6c4847831ebf6c8772fa0f6564fc3043d53d54fd 100644 --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash @@ -1,2 +1,2 @@ -# From https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz.sha256asc -sha256 12fcdf13a7430655229b20438a49e8566e26551ba08759922cdaf4695b0d4e23 arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz +# From https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz.sha256asc +sha256 6e8112dce0d4334d93bd3193815f16abe6a2dd5e7872697987a0b12308f876a4 arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk index f9adda89214f38b6a62b3f39d9dfc84c006a1d8f..9cdf58305b90466ac06ab6a04cc040d44de5ba3b 100644 --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk @@ -4,7 +4,7 @@ # ################################################################################ -TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION = 13.2.rel1 +TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION = 12.2.rel1 TOOLCHAIN_EXTERNAL_ARM_AARCH64_SITE = https://developer.arm.com/-/media/Files/downloads/gnu/$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)/binrel TOOLCHAIN_EXTERNAL_ARM_AARCH64_SOURCE = arm-gnu-toolchain-$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)-x86_64-aarch64-none-linux-gnu.tar.xz