From 792bf0c73dd92b38f850df974492aaf5213f3266 Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 15 Mar 2024 16:55:29 +0800 Subject: [PATCH] daily update --- README.md | 31 +++++++--- board/phytium/common/debian-package-installer | 1 - board/phytium/dd_and_checkMD5.sh | 17 ++++-- board/phytium/genimage-efi.cfg | 33 ---------- configs/openamp_free_rtos.config | 10 ++++ configs/openamp_standalone.config | 10 ++++ configs/phytiumpi_defconfig | 4 +- configs/phytiumpi_desktop_defconfig | 4 +- ...ts-of-phytiumpi-to-enable-homo_rproc.patch | 60 +++++++++++++++++++ package/Config.in | 11 ++-- .../aarch64-none-elf-toolchain.hash | 2 + .../aarch64-none-elf-toolchain.mk | 26 ++++++++ package/phytium-free-rtos/Config.in | 16 +++++ .../phytium-free-rtos/phytium-free-rtos.mk | 31 ++++++++++ .../phytium-iot-environment.mk | 19 ++++++ .../phytium-iot-environment/phytium_dev.sh | 7 +++ package/phytium-standalone/Config.in | 16 +++++ .../phytium-standalone/phytium-standalone.mk | 26 ++++++++ package/phytium-tools/phytium-tools.mk | 1 + package/phytium-tools/src/rc.local | 16 +++++ package/phytium-tools/src/resize.sh | 3 +- package/rpmsg-demo/Config.in | 6 ++ package/rpmsg-demo/rpmsg-demo.hash | 2 + package/rpmsg-demo/rpmsg-demo.mk | 22 +++++++ 24 files changed, 315 insertions(+), 59 deletions(-) delete mode 100644 board/phytium/genimage-efi.cfg create mode 100644 configs/openamp_free_rtos.config create mode 100644 configs/openamp_standalone.config create mode 100644 linux/kernel-patches/openamp/0001-modify-the-dts-of-phytiumpi-to-enable-homo_rproc.patch create mode 100644 package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.hash create mode 100644 package/aarch64-none-elf-toolchain/aarch64-none-elf-toolchain.mk create mode 100644 package/phytium-free-rtos/Config.in create mode 100644 package/phytium-free-rtos/phytium-free-rtos.mk create mode 100644 package/phytium-iot-environment/phytium-iot-environment.mk create mode 100644 package/phytium-iot-environment/phytium_dev.sh create mode 100644 package/phytium-standalone/Config.in create mode 100644 package/phytium-standalone/phytium-standalone.mk create mode 100644 package/phytium-tools/src/rc.local create mode 100644 package/rpmsg-demo/Config.in create mode 100644 package/rpmsg-demo/rpmsg-demo.hash create mode 100644 package/rpmsg-demo/rpmsg-demo.mk diff --git a/README.md b/README.md index e2639a5d..928def1b 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,22 @@ ethercat用户态的库、工具被安装到根文件系统: 配置文件安装到/etc,其它内容分别被安装到/usr目录下的bin,include,lib,sbin,share。 关于ethercat的使用方法等更多信息,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/ethercat` +### 支持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 4.19,linux 5.10内核。如果需要编译openamp请执行: +(1)使用phytiumpi_xxx_defconfig作为基础配置项,合并支持openamp的配置: +`./support/kconfig/merge_config.sh configs/phytiumpi_xxx_defconfig configs/openamp_xxx.config` +其中,`phytiumpi_xxx_defconfig`为`phytiumpi_defconfig`或`phytiumpi_desktop_defconfig`; +`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` + ### 支持5G 飞腾派适配了移远通信 RG200U-CN MINIPCIE 5G模块。使用默认配置文件phytiumpi_xxx_defconfig,编译的SD卡镜像不支持5G上网功能。如果需要使用 RG200U-CN MINIPCIE 5G模块上网,需要重新编译生成SD卡镜像。 @@ -196,15 +212,14 @@ LINUX_OVERRIDE_SRCDIR指定了一个本地的内核源码目录,这样就不 (1)将phytiumpi img 镜像(sdcard.img)写入sd卡: `$ sudo dd if=xxx/phytium-pi-os/output/images/sdcard.img of=/dev/sdb bs=1M` -本项目还提供了将img镜像烧录进sd卡并进行md5值校验的脚本,确保烧录正确。该脚本需在顶层目录下执行,用法如下: -`$ sudo ./board/phytium/dd_and_checkMD5.sh /dev/sdx` -其中,/dev/sdx表示sd卡对应的设备节点名称。 +本项目还提供了将img镜像烧录进sd卡并进行md5值校验的脚本,确保烧录正确。该脚本需在顶层目录下执行,用法为以下其中之一: +`$ sudo ./board/phytium/dd_and_checkMD5.sh /dev/sdx desktop` +`$ sudo ./board/phytium/dd_and_checkMD5.sh /dev/sdx no_desktop` +其中,/dev/sdx表示sd卡对应的设备节点名称; +如果编译的是phytiumpi_desktop_defconfig,使用第一条命令; +如果编译的是phytiumpi_defconfig,使用第二条命令。 (2)SD卡接到开发板,启动开发板电源,启动文件系统 -(3)登陆开发板,执行lsblk 命令查看磁盘分区信息,SD 卡对应盘符为 /dev/mmcblk0. - 需要将根目录分区 /dev/mmcblk0p1 进行扩容: - `$ source /usr/bin/resize.sh` - 需重启生效 -(4)开发板运行时,如果需要更换uboot、Image和dtb,本项目提供了对应脚本,用法如下: +(3)开发板运行时,如果需要更换uboot、Image和dtb,本项目提供了对应脚本,用法如下: `$ sudo runtime_replace_bootloader.sh all` `$ sudo runtime_replace_bootloader.sh uboot` `$ sudo runtime_replace_bootloader.sh image` diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index a284e69b..333151c0 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -91,7 +91,6 @@ do_distrorfs_second_stage() { if [ $5 = 'phytiumpi' ]; then echo 'defaults.pcm.!card phytiumpe220xi2' >> /etc/asound.conf echo 'defaults.ctl.!card phytiumpe220xi2' >> /etc/asound.conf - echo 'default-sink = alsa_output.platform-sound.stereo-fallback' >> /etc/pulse/client.conf fi # clean cached packages diff --git a/board/phytium/dd_and_checkMD5.sh b/board/phytium/dd_and_checkMD5.sh index 35035e2f..060e4012 100755 --- a/board/phytium/dd_and_checkMD5.sh +++ b/board/phytium/dd_and_checkMD5.sh @@ -5,9 +5,12 @@ # Phytium-Pi-OS Repository address: https://gitee.com/phytium_embedded/phytium-pi-os.git. usage() { - echo "Usage: sudo ./board/phytium/dd_and_checkMD5.sh [Disk_name]" - echo " Disk_name: the disk you want to dd to. Such as /dev/sdb" - echo " For examples:sudo $0 /dev/sdb" + echo "Usage: sudo ./board/phytium/dd_and_checkMD5.sh [Disk_name ] [Type_of_file_system ]" + echo " Disk_name: the disk you want to dd to. Such as /dev/sdb" + echo " Type_of_file_system:" + echo " desktop: phytium_xxx_desktop_defconfig from phytium-linux-buildroot or Phytium-Pi-OS" + echo " no_desktop: phytium_defconfig from Phytium-Pi-OS" + echo " For examples: $0 /dev/sdb desktop" } while true; do @@ -71,11 +74,15 @@ check_disk_device() } # The size of phytiumpi file system with or without a desktop may vary. - count=15424 +if [ "$2" == "desktop" ]; then + count=5184 +elif [ "$2" == "no_desktop" ]; then + count=2112 +fi main() { - check_args $1 + check_args $1 $2 check_disk_device $1 echo "----------------------------$(date)-----------------------" >> dd.log dd if=./output/images/sdcard.img of=$1 bs=1M count=$count >> dd.log 2>&1 diff --git a/board/phytium/genimage-efi.cfg b/board/phytium/genimage-efi.cfg deleted file mode 100644 index 88cd5c47..00000000 --- a/board/phytium/genimage-efi.cfg +++ /dev/null @@ -1,33 +0,0 @@ -image efi-part.vfat { - vfat { - file EFI { - image = "efi-part/EFI" - } - file Image { - image = "Image" - } - file initrd { - image = "rootfs.cpio" - } - } - - size = 400M -} - -image disk.img { - hdimage { - partition-table-type = "gpt" - } - - partition boot { - image = "efi-part.vfat" - partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b - offset = 32K - bootable = true - } - - partition root { - partition-type-uuid = b921b045-1df0-41c3-af44-4c6f280d3fae - image = "rootfs.ext2" - } -} diff --git a/configs/openamp_free_rtos.config b/configs/openamp_free_rtos.config new file mode 100644 index 00000000..36ac39a8 --- /dev/null +++ b/configs/openamp_free_rtos.config @@ -0,0 +1,10 @@ +# kernel patch for phytiumpi, kernel version of 4.19 and 5.10 +BR2_LINUX_KERNEL_PATCH="$(LINUX_PKGDIR)/kernel-patches/openamp/0001-modify-the-dts-of-phytiumpi-to-enable-homo_rproc.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" + diff --git a/configs/openamp_standalone.config b/configs/openamp_standalone.config new file mode 100644 index 00000000..a57cfe73 --- /dev/null +++ b/configs/openamp_standalone.config @@ -0,0 +1,10 @@ +# kernel patch for phytiumpi, kernel version of 4.19 and 5.10 +BR2_LINUX_KERNEL_PATCH="$(LINUX_PKGDIR)/kernel-patches/openamp/0001-modify-the-dts-of-phytiumpi-to-enable-homo_rproc.patch" + +# rpmsg-demo +BR2_PACKAGE_RPMSG_DEMO=y + +# standalone openamp +BR2_PACKAGE_PHYTIUM_STANDALONE=y +BR2_PACKAGE_PHYTIUM_STANDALONE_CPU_NAME="phytiumpi" + diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index 8dab967e..bf330c5d 100644 --- a/configs/phytiumpi_defconfig +++ b/configs/phytiumpi_defconfig @@ -6,7 +6,7 @@ BR2_cortex_a53=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y BR2_TARGET_ROOTFS_TAR_XZ=y -BR2_TARGET_ROOTFS_EXT2_SIZE="15G" +BR2_TARGET_ROOTFS_EXT2_SIZE="2G" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-phytiumpi.cfg" @@ -56,9 +56,7 @@ BR2_TARGET_GENERIC_GETTY=y BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" # required tools to create the microSD image -BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y -BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_BUSYBOX=n BR2_PACKAGE_PHYUBOOT=y diff --git a/configs/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index 52f7597a..1c1c7753 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -6,7 +6,7 @@ BR2_cortex_a53=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y BR2_TARGET_ROOTFS_TAR_XZ=y -BR2_TARGET_ROOTFS_EXT2_SIZE="15G" +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-phytiumpi.cfg" @@ -56,9 +56,7 @@ BR2_TARGET_GENERIC_GETTY=y BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" # required tools to create the microSD image -BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y -BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_ROOTFS_CHOWN=y # Bluetooth config tools diff --git a/linux/kernel-patches/openamp/0001-modify-the-dts-of-phytiumpi-to-enable-homo_rproc.patch b/linux/kernel-patches/openamp/0001-modify-the-dts-of-phytiumpi-to-enable-homo_rproc.patch new file mode 100644 index 00000000..8a04af88 --- /dev/null +++ b/linux/kernel-patches/openamp/0001-modify-the-dts-of-phytiumpi-to-enable-homo_rproc.patch @@ -0,0 +1,60 @@ +From f1d8c50668be3bff4bc2038477d75e67e4b0846d Mon Sep 17 00:00:00 2001 +From: lindongping +Date: Thu, 7 Mar 2024 15:06:48 +0800 +Subject: [PATCH] modify the dts of phytiumpi to enable homo_rproc + +--- + arch/arm64/boot/dts/phytium/pe2204.dtsi | 21 +++++++++++++++++++ + .../boot/dts/phytium/phytiumpi_firefly.dts | 4 ++++ + 2 files changed, 25 insertions(+) + +diff --git a/arch/arm64/boot/dts/phytium/pe2204.dtsi b/arch/arm64/boot/dts/phytium/pe2204.dtsi +index 4d5d7b295..eeb3873de 100644 +--- a/arch/arm64/boot/dts/phytium/pe2204.dtsi ++++ b/arch/arm64/boot/dts/phytium/pe2204.dtsi +@@ -16,6 +16,27 @@ aliases { + ethernet2 = &macb2; + ethernet3 = &macb3; + }; ++ ++ reserved-memory { ++ #address-cells = <0x2>; ++ #size-cells = <0x2>; ++ ranges; ++ ++ rproc: rproc@b0100000 { ++ /*下面的保留物理地址可以根据机器实际指定地址范围 */ ++ no-map; ++ reg = <0x0 0xb0100000 0x0 0x19900000>; ++ }; ++ }; ++ ++ homo_rproc: homo_rproc@0 { ++ compatible = "homo,rproc"; ++ remote-processor = <3>; ++ inter-processor-interrupt = <9>; ++ memory-region = <&rproc>; ++ firmware-name = "openamp_core0.elf"; ++ status = "disabled"; ++ }; + }; + + &cpu { +diff --git a/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts b/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts +index 82ff32a36..a6f6e3dc7 100644 +--- a/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts ++++ b/arch/arm64/boot/dts/phytium/phytiumpi_firefly.dts +@@ -311,6 +311,10 @@ &pmdk_dp { + status = "okay"; + }; + ++&homo_rproc { ++ status = "okay"; ++}; ++ + &rng0 { + status = "okay"; + }; +-- +2.34.1 + diff --git a/package/Config.in b/package/Config.in index 155f840f..cae039cb 100644 --- a/package/Config.in +++ b/package/Config.in @@ -437,10 +437,13 @@ menu "Firmware" source "package/wilc1000-firmware/Config.in" source "package/wilink-bt-firmware/Config.in" source "package/zd1211-firmware/Config.in" - source "package/xorg-rogue-umlibs/Config.in" - source "package/vpu-lib/Config.in" - source "package/phyuboot/Config.in" - source "package/phytium-tools/Config.in" + source "package/xorg-rogue-umlibs/Config.in" + source "package/vpu-lib/Config.in" + source "package/phyuboot/Config.in" + source "package/phytium-tools/Config.in" + source "package/phytium-standalone/Config.in" + source "package/phytium-free-rtos/Config.in" + source "package/rpmsg-demo/Config.in" endmenu source "package/18xx-ti-utils/Config.in" source "package/a10disp/Config.in" 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 00000000..24d7cc54 --- /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 00000000..012b474b --- /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_LICENCE = 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/phytium-free-rtos/Config.in b/package/phytium-free-rtos/Config.in new file mode 100644 index 00000000..5239095b --- /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 00000000..cf6ab261 --- /dev/null +++ b/package/phytium-free-rtos/phytium-free-rtos.mk @@ -0,0 +1,31 @@ +################################################################################ +# +# phytium-free-rtos +# +################################################################################ + +PHYTIUM_FREE_RTOS_VERSION = 696ae90ea57126797a5fb2c0d111959f9bf4455c +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) = 5.10* ]]; then \ + PHYTIUM_FREE_RTOS_ARCH=aarch64; \ + else \ + PHYTIUM_FREE_RTOS_ARCH=aarch32; \ + fi && \ + . $(HOST_DIR)/etc/profile.d/phytium_dev.sh && \ + cd $(@D)/example/system/amp/openamp_for_linux && \ + $(TARGET_MAKE_ENV) $(MAKE1) config_$(PHYTIUM_FREE_RTOS_CPU)_$${PHYTIUM_FREE_RTOS_ARCH} && \ + 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 00000000..9450e365 --- /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-a-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 100644 index 00000000..f51e936d --- /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-standalone/Config.in b/package/phytium-standalone/Config.in new file mode 100644 index 00000000..0d392d4e --- /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 00000000..c3afc524 --- /dev/null +++ b/package/phytium-standalone/phytium-standalone.mk @@ -0,0 +1,26 @@ +################################################################################ +# +# phytium-standalone +# +################################################################################ + +PHYTIUM_STANDALONE_VERSION = v1.2.3 +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) = 5.10* ]]; then \ + PHYTIUM_STANDALONE_ARCH=aarch64; \ + else \ + PHYTIUM_STANDALONE_ARCH=aarch32; \ + fi && \ + . $(HOST_DIR)/etc/profile.d/phytium_dev.sh && \ + cd $(@D)/example/system/amp/openamp_for_linux && \ + $(TARGET_MAKE_ENV) $(MAKE1) config_$(PHYTIUM_STANDALONE_CPU)_$${PHYTIUM_STANDALONE_ARCH} && \ + 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 e92a1c79..ce506f21 100644 --- a/package/phytium-tools/phytium-tools.mk +++ b/package/phytium-tools/phytium-tools.mk @@ -26,6 +26,7 @@ define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS $(INSTALL) -m 644 -D $(@D)/systemd-hciattach.service $(TARGET_DIR)/lib/systemd/system/ $(INSTALL) -m 755 -D $(@D)/runtime_replace_bootloader.sh $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 444 -D $(@D)/rtw8821c_fw.bin $(TARGET_DIR)/lib/firmware/rtw88/ + $(INSTALL) -m 755 -D $(@D)/rc.local $(TARGET_DIR)/etc/ endef $(eval $(generic-package)) diff --git a/package/phytium-tools/src/rc.local b/package/phytium-tools/src/rc.local new file mode 100644 index 00000000..82fb394a --- /dev/null +++ b/package/phytium-tools/src/rc.local @@ -0,0 +1,16 @@ +#!/bin/bash + +lock_file="/var/tmp/resize.lock" + +if [ -f "$lock_file" ]; then + echo "Partition expansion script has already been executed." + exit 0 +fi + +# if the scripts has not been executed yet, create a lock file +touch "$lock_file" + +# execute the partition expansion script +nohup /usr/bin/resize.sh & + +exit 0 diff --git a/package/phytium-tools/src/resize.sh b/package/phytium-tools/src/resize.sh index 2b27e3e4..b9a69305 100755 --- a/package/phytium-tools/src/resize.sh +++ b/package/phytium-tools/src/resize.sh @@ -28,5 +28,4 @@ $PART_NUM p w EOF -resize2fs "$ROOT_PART" && -printf "Please reboot\n" +resize2fs "$ROOT_PART" diff --git a/package/rpmsg-demo/Config.in b/package/rpmsg-demo/Config.in new file mode 100644 index 00000000..9b2308f9 --- /dev/null +++ b/package/rpmsg-demo/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_RPMSG_DEMO + bool "rpmsg-demo" + help + Phytium openamp remsg-demo + + https://gitee.com/phytium_embedded/phytium-embedded-docs/blob/master/open-amp/rpmsg-demo.c diff --git a/package/rpmsg-demo/rpmsg-demo.hash b/package/rpmsg-demo/rpmsg-demo.hash new file mode 100644 index 00000000..265bb772 --- /dev/null +++ b/package/rpmsg-demo/rpmsg-demo.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 c5fb688bbe06eabebf2a1f3cb37d352e5bf3834e2f5116ecce51cda27dff4ac3 rpmsg-demo.c diff --git a/package/rpmsg-demo/rpmsg-demo.mk b/package/rpmsg-demo/rpmsg-demo.mk new file mode 100644 index 00000000..68e7bcb6 --- /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.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 $(@D)/$(RPMSG_DEMO_SOURCE) +endef + +define RPMSG_DEMO_INSTALL_TARGET_CMDS + $(INSTALL) -m 0755 -D $(@D)/rpmsg-demo $(TARGET_DIR)/usr/bin/ +endef + +$(eval $(generic-package)) -- Gitee