Browse Source

package: add phytium-optee

kernel: update e2000 linux kernel version

Signed-off-by: liutianyu1250 <liutianyu1250@phytium.com.cn>
pull/6/MERGE
liutianyu1250 2 years ago
committed by weishanshan1084
parent
commit
e9afdafb61
  1. 8
      board/phytium/common/post-custom-skeleton-debian-base-11.sh
  2. 8
      board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh
  3. 2
      configs/phytium_e2000_4.19kernel.config
  4. 2
      configs/phytium_e2000_debian_defconfig
  5. 2
      configs/phytium_e2000_debian_desktop_defconfig
  6. 2
      configs/phytium_e2000_defconfig
  7. 8
      configs/phytium_e2000_optee.config
  8. 2
      configs/phytium_e2000_ubuntu_defconfig
  9. 2
      configs/phytium_e2000_ubuntu_desktop_defconfig
  10. 1
      package/Config.in
  11. 29
      package/phytium-optee/Config.in
  12. 48
      package/phytium-optee/S30phytium-optee
  13. 55
      package/phytium-optee/phytium-optee.mk
  14. 10
      package/phytium-optee/phytium-tee-supplicant.service

8
board/phytium/common/post-custom-skeleton-debian-base-11.sh

@ -327,6 +327,14 @@ main()
make ffmpeg-rebuild ${O:+O=$O}
fi
if grep -Eq "^BR2_PACKAGE_PHYTIUM_OPTEE=y$" ${BR2_CONFIG}; then
make phytium-optee-rebuild ${O:+O=$O}
# add tee-supplicant systemd service
cp -dpf package/phytium-optee/phytium-tee-supplicant.service $RFSDIR/lib/systemd/system/phytium-tee-supplicant.service
# default set start tee-supplicant
ln -sf /lib/systemd/system/phytium-tee-supplicant.service $RFSDIR/etc/systemd/system/sysinit.target.wants/phytium-tee-supplicant.service
fi
exit $?
}

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

@ -329,6 +329,14 @@ main()
make ffmpeg-rebuild ${O:+O=$O}
fi
if grep -Eq "^BR2_PACKAGE_PHYTIUM_OPTEE=y$" ${BR2_CONFIG}; then
make phytium-optee-rebuild ${O:+O=$O}
# add tee-supplicant systemd service
cp -dpf package/phytium-optee/phytium-tee-supplicant.service $RFSDIR/lib/systemd/system/phytium-tee-supplicant.service
# default set start tee-supplicant
ln -sf /lib/systemd/system/phytium-tee-supplicant.service $RFSDIR/etc/systemd/system/sysinit.target.wants/phytium-tee-supplicant.service
fi
exit $?
}

2
configs/phytium_e2000_4.19kernel.config

@ -1,2 +1,2 @@
# kernel 4.19
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="2bc82f364da6e5d815219b3d670071245770fbaf"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="a47ede16e33d2662535084f49e73945d572d4f38"

2
configs/phytium_e2000_debian_defconfig

@ -36,7 +36,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 5.10
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f0cc7d6de6976f4b2b88d425a91878d948106f80"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_DEFCONFIG="e2000"

2
configs/phytium_e2000_debian_desktop_defconfig

@ -36,7 +36,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 5.10
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f0cc7d6de6976f4b2b88d425a91878d948106f80"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_DEFCONFIG="e2000"

2
configs/phytium_e2000_defconfig

@ -11,7 +11,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 5.10
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f0cc7d6de6976f4b2b88d425a91878d948106f80"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081"
BR2_LINUX_KERNEL_DEFCONFIG="e2000"
BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image"

8
configs/phytium_e2000_optee.config

@ -0,0 +1,8 @@
# for linux kernel support optee
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/e2000_optee.config"
BR2_PACKAGE_PHYTIUM_OPTEE=y
BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_URL="git@gitee.com:phytium_embedded/phytium-optee.git"
BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="v1.1"
BR2_PACKAGE_PHYTIUM_OPTEE_BOARD="e2000ddemo"

2
configs/phytium_e2000_ubuntu_defconfig

@ -36,7 +36,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 5.10
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f0cc7d6de6976f4b2b88d425a91878d948106f80"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_DEFCONFIG="e2000"

2
configs/phytium_e2000_ubuntu_desktop_defconfig

@ -36,7 +36,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 5.10
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f0cc7d6de6976f4b2b88d425a91878d948106f80"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d734b714dcf61afd3a3d6fd5458895a944800081"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_DEFCONFIG="e2000"

1
package/Config.in

@ -2461,6 +2461,7 @@ menu "Security"
source "package/semodule-utils/Config.in"
source "package/setools/Config.in"
source "package/urandom-scripts/Config.in"
source "package/phytium-optee/Config.in"
endmenu
menu "Shell and utilities"

29
package/phytium-optee/Config.in

@ -0,0 +1,29 @@
config BR2_PACKAGE_PHYTIUM_OPTEE
bool "phytium_optee"
help
Phytium OPTEE provides OP-TEE OS, client, examples.
if BR2_PACKAGE_PHYTIUM_OPTEE
config BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_URL
string "URL of phytium optee custom repository"
help
Specific location of the reference source tree Git
repository.
config BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION
string "Custom repository version"
help
Revision to use in the typical format used by Git, i.e a
SHA1 or a tag.
config BR2_PACKAGE_PHYTIUM_OPTEE_BOARD
string "Target board"
help
Value for the target board directive provided to
Phytium OPTEE build script. Support:
"e2000demod", debug version;
"e2000demor", release version.
endif # BR2_PACKAGE_PHYTIUM_OPTEE

48
package/phytium-optee/S30phytium-optee

@ -0,0 +1,48 @@
#!/bin/sh
DAEMON="tee-supplicant"
DAEMON_ARGS="-d /dev/teepriv0"
start() {
printf 'Starting %s: ' "$DAEMON"
start-stop-daemon -S -q -x "/usr/bin/$DAEMON" \
-- $DAEMON_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf 'Stopping %s: ' "$DAEMON"
start-stop-daemon -K -q -x "/usr/bin/$DAEMON"
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
restart() {
stop
sleep 1
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature (does not
# reconfigure/restart on SIGHUP, just closes all open files).
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

55
package/phytium-optee/phytium-optee.mk

@ -0,0 +1,55 @@
################################################################################
#
# phytium-optee
#
################################################################################
PHYTIUM_OPTEE_SITE_METHOD = git
PHYTIUM_OPTEE_SITE = $(call qstrip,$(BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_URL))
PHYTIUM_OPTEE_VERSION = $(call qstrip,$(BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION))
PHTYIUM_OPTEE_TARGET_BOARD = $(call qstrip,$(BR2_PACKAGE_PHYTIUM_OPTEE_BOARD))
# install optee os/client sdk in staging
# if other package need build CA & TA, CA will use default staging path.
# TA need set TA_DEV_KIT_DIR=$(PHYTIUM_OPTEE_OS_SDK).
PHYTIUM_OPTEE_OS_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64
PHYTIUM_OPTEE_CLIENT_SDK = $(STAGING_DIR)/usr
# build optee os need this package in host
PHYTIUM_OPTEE_DEPENDENCIES = host-openssl host-python3 host-python-pycryptodomex host-python-pyelftools
PHYTIUM_OPTEE_INSTALL_IMAGES = YES
PHYTIUM_OPTEE_INSTALL_STAGING = YES
define PHYTIUM_OPTEE_BUILD_CMDS
cd $(@D); ./build_all clean; CROSS_COMPILE64=$(TARGET_CROSS) ./build_all $(PHTYIUM_OPTEE_TARGET_BOARD) d
endef
# install lib & ta & client into rootfs
define PHYTIUM_OPTEE_INSTALL_TARGET_CMDS
cp -dpf $(@D)/out/data/bin/* $(TARGET_DIR)/usr/bin
cp -dpf $(@D)/out/data/lib/* $(TARGET_DIR)/usr/lib
mkdir -p $(TARGET_DIR)/data/optee_armtz
cp $(@D)/out/data/optee_armtz/* $(TARGET_DIR)/data/optee_armtz
endef
# install tee.bin into BINARIES_DIR, so that can use tboot to load tee os.
define PHYTIUM_OPTEE_INSTALL_IMAGES_CMDS
cp -dpf $(@D)/out/*.bin $(BINARIES_DIR)
endef
# install sdk for build other package
define PHYTIUM_OPTEE_INSTALL_STAGING_CMDS
#echo $(STAGING_DIR)
mkdir -p $(PHYTIUM_OPTEE_OS_SDK)
cp -ardpf $(@D)/out/data/link/export/usr/* $(PHYTIUM_OPTEE_CLIENT_SDK)
endef
define PHYTIUM_OPTEE_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D $(PHYTIUM_OPTEE_PKGDIR)/S30phytium-optee \
$(TARGET_DIR)/etc/init.d/S30phytium-optee
endef
$(eval $(generic-package))

10
package/phytium-optee/phytium-tee-supplicant.service

@ -0,0 +1,10 @@
[Unit]
Description=phytium tee supplicant
[Service]
User=root
ExecStart=tee-supplicant /dev/teepriv0
Restart=always
[Install]
WantedBy=sysinit.target
Loading…
Cancel
Save