Skip to content

Commit

Permalink
k230 sdk release v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Jan 12, 2024
1 parent 3ade2d0 commit 2ec0dd4
Show file tree
Hide file tree
Showing 2,912 changed files with 2,661,346 additions and 4,297 deletions.
12 changes: 6 additions & 6 deletions Kconfig.board
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ config GEN_SECURITY_IMG
config UBOOT_DEFCONFIG
string "uboot defconfig "
help
uboot defconfig ;
default "k230_evb"
uboot defconfig ;
default BOARD_NAME

config LINUX_DEFCONFIG
string "linux defconfig "
help
linux defconfig ;
default "k230_evb"
linux defconfig ;
default BOARD_NAME

config LINUX_DTB
string "linux dtb name"
help
linux dtb name ;
default "k230_evb"
linux dtb name ;
default BOARD_NAME

config REMOTE_TEST_PLATFORM
bool "config REMOTE_TEST_PLATFORM"
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ prepare_sourcecode:prepare_toolchain
#ai
@echo "download nncase sdk"
@rm -rf src/big/utils/; rm -rf src/big/ai;
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.5.1.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.5.1.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.7.0.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.7.0.tgz -O - | tar -xzC src/big/

#big utils
@echo "download big utils"
Expand All @@ -131,7 +131,7 @@ prepare_sourcecode:prepare_toolchain
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/tunning_server/tuning-server-package_v0.1.1.tar.bz2 -O ${BUILDROOT_EXT_SRC_PATH}/package/tuning-server/tuning-server-package_v0.1.1.tar.bz2
@tar -jxf ${BUILDROOT_EXT_SRC_PATH}/package/tuning-server/tuning-server-package_v0.1.1.tar.bz2 -C ${POST_COPY_ROOTFS_PATH}/
@mkdir -p tools/tuning-tool-client/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/tunning_tools/tunning_client/Kendyte_ISP_Tool_TuningClient_RC22.5_Pre_596062-20221116.7z -P tools/tuning-tool-client/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/tunning_tools/tunning_client/Kendyte_ISP_Tool_TuningClient-6.2.23.5-Win32-x86_64-10-26-2023-09.28.16.7z -P tools/tuning-tool-client/

#buildroot
@echo "download buildroot dl"
Expand All @@ -142,8 +142,8 @@ prepare_sourcecode:prepare_toolchain
#dictionary_pen
@if [ "k230_evb_usiplpddr4_dictionary_pen_defconfig" == "$${CONF}" ] ; then \
echo "download dictionary_pen" ; \
wget -q --show-progress $(DOWNLOAD_URL)/downloads/dictionary_pen/cidianbi_kmodel_v2.5.1.tar.gz -O - | tar -xzC src/reference/business_poc/dictionary_pen_poc/ ; \
cp src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.5.1/include src/reference/business_poc/dictionary_pen_poc/ -rf ; \
wget -q --show-progress $(DOWNLOAD_URL)/downloads/dictionary_pen/cidianbi_kmodel_v2.7.0.tar.gz -O - | tar -xzC src/reference/business_poc/dictionary_pen_poc/ ; \
cp src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.7.0/include src/reference/business_poc/dictionary_pen_poc/ -rf ; \
fi;


Expand Down Expand Up @@ -512,7 +512,9 @@ uboot-clean: defconfig

.PHONY: build-image
build-image: defconfig prepare_memory check_src
$(K230_SDK_ROOT)/$(CONFIG_GEN_IMG_SCRIPT) ;cd $(K230_SDK_ROOT);
set -e; \
$(K230_SDK_ROOT)/$(CONFIG_GEN_IMG_SCRIPT); \
cd $(K230_SDK_ROOT);

.PHONY: clean
clean:
Expand Down
1 change: 1 addition & 0 deletions board/common/env/default.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
arch=riscv
autoload=0
baudrate=115200
board=k230_evb
board_name=k230_evb
Expand Down
1 change: 1 addition & 0 deletions board/common/env/spinand.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
arch=riscv
autoload=0
baudrate=115200
board=k230_evb
board_name=k230_evb
Expand Down
1 change: 1 addition & 0 deletions board/common/env/spinor.jffs2.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
arch=riscv
autoload=0
baudrate=115200
board=k230_evb
board_name=k230_evb
Expand Down
34 changes: 12 additions & 22 deletions board/common/gen_image_script/gen_image_comm_func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ gz_file_add_ver()
local sdk_ver_file="${K230_SDK_ROOT}/board/common/post_copy_rootfs/etc/version/release_version"
local nncase_ver_file="${K230_SDK_ROOT}/src/big/nncase/riscv64/nncase/include/nncase/version.h"



local storage="$(echo "$f" | sed -nE "s#[^-]*-([^\.]*).*#\1#p")"
local conf_name="${CONF%%_defconfig}"

cat ${sdk_ver_file} | grep v | cut -d- -f 1 > /dev/null && \
sdk_ver=$(cat ${sdk_ver_file} | grep v | cut -d- -f 1)

cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2 > /dev/null && \
nncase_ver=$(cat ${nncase_ver_file} | grep NNCASE_VERSION -w | cut -d\" -f 2)

cp $f ${CONFIG_BOARD_NAME}_$(echo "$f" | sed -nE "s#[^-]*-([^\.]*).*#\1#p")_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
rm -rf ${conf_name}_${storage}_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
ln -s $f ${conf_name}_${storage}_${sdk_ver}_nncase_v${nncase_ver}.img.gz;
}


Expand Down Expand Up @@ -62,6 +62,10 @@ copye_file_to_images()
fakeroot -- cpio -idm < ../rootfs.cpio ;

cp -rf ${K230_SDK_ROOT}/tools/ota/ota_public.pem ${BUILD_DIR}/images/little-core/rootfs/etc/
cp -rf ${K230_SDK_ROOT}/tools/ota/fw_env.config ${BUILD_DIR}/images/little-core/rootfs/etc/
cp -rf ${K230_SDK_ROOT}/tools/ota/ota_aes_key_iv ${BUILD_DIR}/images/little-core/rootfs/etc/
cp -rf ${K230_SDK_ROOT}/tools/ota/hwrevision ${BUILD_DIR}/images/little-core/rootfs/etc/

cp -rf ${K230_SDK_ROOT}/board/common/post_copy_rootfs/* ${BUILD_DIR}/images/little-core/rootfs/
fakeroot -- cp -rf ${BUILD_DIR}/images/little-core/ko-apps/* ${BUILD_DIR}/images/little-core/rootfs/
cd ${BUILD_DIR}/images/little-core/rootfs/; \
Expand Down Expand Up @@ -417,12 +421,13 @@ shrink_rootfs_common()
rm -rf mnt/*;
rm -rf app/;
rm -rf lib/tuning-server;
rm -rf usr/sbin/wpa_supplicant usr/sbin/hostapd;
rm -rf usr/bin/stress-ng bin/bash usr/sbin/sshd usr/bin/trace-cmd usr/bin/lvgl_demo_widgets;
rm -rf usr/bin/ssh etc/ssh/moduli usr/lib/libssl.so.1.1 usr/bin/ssh-keygen \
usr/libexec/ssh-keysign usr/bin/ssh-keyscan usr/bin/ssh-add usr/bin/ssh-agent usr/libexec/ssh-pkcs11-helper\
usr/lib/libncurses.so.6.1 usr/lib/libvg_lite_util.so usr/bin/par_ops usr/bin/sftp usr/libexec/lzo/examples/lzotest;
#find . -name *.ko | xargs rm -rf ;

rm -rf usr/bin/wdt_test_demo;
rm -rf usr/bin/swupdate
#裁剪大核rootfs;
cd ${BUILD_DIR}/images/big-core/root/bin/;
find . -type f -not -name init.sh -not -name fastboot_app.elf -not -name test.kmodel | xargs rm -rf ;
Expand All @@ -439,24 +444,9 @@ gen_image_spinand()
{
cd ${BUILD_DIR}/;rm -rf images_bak;cp images images_bak -r;

shrink_rootfs_common;
#裁剪小核rootfs
cd ${BUILD_DIR}/images/little-core/rootfs/;
rm -rf lib/modules/;
rm -rf lib/libstdc++*;
rm -rf usr/bin/fio;
rm -rf usr/bin/usb_test;
rm -rf usr/bin/hid_gadget_test;
rm -rf usr/bin/gadget*;
rm -rf usr/bin/otp_test_demo;
rm -rf usr/bin/iotwifi*;
rm -rf usr/bin/i2c-tools.sh;
rm -rf mnt/*;
rm -rf app/;
rm -rf lib/tuning-server;
rm -rf usr/bin/stress-ng bin/bash usr/sbin/sshd usr/bin/trace-cmd;
#find . -name *.ko | xargs rm -rf ;
fakeroot -- ${K230_SDK_ROOT}/tools/mkcpio-rootfs.sh;


#裁剪大核romfs;
#$(RT-SMART_SRC_PATH)/userapps/root
Expand Down
117 changes: 117 additions & 0 deletions board/common/post_copy_rootfs/etc/ssh/sshd_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/bin:/sbin:/usr/bin:/usr/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin yes
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
PermitEmptyPasswords yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ gen_dictionary_pen_device_app()
cd ${K230_SDK_ROOT}; make dictionary_pen;
#creat dictionary_pen dir
mkdir -p ${BUILD_DIR}/images/big-core/app/dictionary_pen/
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.5.1/* ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.7.0/* ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/include ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf
cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/build/dictionary_pen.elf ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf

Expand Down
1 change: 1 addition & 0 deletions board/k230_evb_only_linux/fw_env.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dev/mmcblk1 0x1e0000 0x10000
1 change: 1 addition & 0 deletions board/k230_evb_only_linux/gen_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ rtapp_data_file="${BUILD_DIR}/images/big-core/fastboot_app.elf"

copye_file_to_images;
cp ${K230_SDK_ROOT}/board/k230_evb_only_linux/rcS ${BUILD_DIR}/images/little-core/rootfs/etc/init.d/rcS;
cp ${K230_SDK_ROOT}/board/k230_evb_only_linux/fw_env.config ${BUILD_DIR}/images/little-core/rootfs/etc/fw_env.config;

if [ "${CONFIG_SUPPORT_LINUX}" = "y" ]; then
gen_version;
Expand Down
2 changes: 1 addition & 1 deletion configs/k230_canmv_only_linux_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CONFIG_SDCAED=y
#
# wifi configurations
#
# CONFIG_AP6212A is not set
CONFIG_AP6212A=y
# CONFIG_AP6256 is not set
# CONFIG_SUPPORT_RTSMART is not set
CONFIG_SUPPORT_LINUX=y
Expand Down
11 changes: 6 additions & 5 deletions configs/k230_evb_doorlock_ov9286_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CONFIG_BOARD_NAME="k230_evb_doorlock"
CONFIG_QUICK_BOOT=y
# CONFIG_GEN_SECURITY_IMG is not set
CONFIG_UBOOT_DEFCONFIG="k230_evb_doorlock_ov9286"
CONFIG_LINUX_DEFCONFIG="k230_evb_doorlock"
CONFIG_LINUX_DTB="k230_evb_doorlock"
# CONFIG_REMOTE_TEST_PLATFORM is not set
CONFIG_GEN_IMG_SCRIPT="board/k230_evb_doorlock/gen_image_script/gen_doorlock_ov9286_image.sh"
Expand Down Expand Up @@ -75,13 +76,13 @@ CONFIG_SPI_NOR_FACE_DB_CFG_SIZE=0x80000
CONFIG_SPI_NOR_SENSOR_CFG_CFG_BASE=0x300000
CONFIG_SPI_NOR_SENSOR_CFG_CFG_SIZE=0x30000
CONFIG_SPI_NOR_AI_MODE_CFG_BASE=0x330000
CONFIG_SPI_NOR_AI_MODE_CFG_SIZE=0x740000
CONFIG_SPI_NOR_SPECKLE_CFG_BASE=0xa70000
CONFIG_SPI_NOR_AI_MODE_CFG_SIZE=0x730000
CONFIG_SPI_NOR_SPECKLE_CFG_BASE=0xa60000
CONFIG_SPI_NOR_SPECKLE_CFG_SIZE=0x010000
CONFIG_SPI_NOR_RTTK_BASE=0xa80000
CONFIG_SPI_NOR_RTTK_BASE=0xa70000
CONFIG_SPI_NOR_RTTK_SIZE=0x270000
CONFIG_SPI_NOR_RTT_APP_BASE=0xcf0000
CONFIG_SPI_NOR_RTT_APP_SIZE=0x3f0000
CONFIG_SPI_NOR_RTT_APP_BASE=0xce0000
CONFIG_SPI_NOR_RTT_APP_SIZE=0x400000
CONFIG_SPI_NOR_LK_BASE=0x10E0000
CONFIG_SPI_NOR_LK_SIZE=0x420000
CONFIG_SPI_NOR_LR_BASE=0x1500000
Expand Down
Loading

0 comments on commit 2ec0dd4

Please sign in to comment.