4. Linux Kernel¶
The kernel source code can be found under the sdk_source directory.
sdk_source/linux_5.10 // cv184x ARM 64bit/32bit Processor
4.1. Configure the Kernel DTS¶
If need toFor inkernelmoduleadd or removemodify, canthroughmodifyDTS(*1)methodtocomplete, eachsheetEVBwillhasdtsfiletodefinitionitsdevice tree, using cv1842hp_wevb_0014a_spinor as an example, itsDTSfiledefinitioninfilepathas follows :
$ cat build/boards/cv184x/cv1842hp_wevb_0014a_spinor/dts_arm/cv1842hp_wevb_0014a_spinor.dts
/dts-v1/;
#include "cv184x_base_arm.dtsi"
#include "cv184x_asic_bga.dtsi"
#include "cv184x_asic_spinor.dtsi"
#include "cv184x_default_memmap.dtsi"
/ {
sysdma_remap {
ch-remap = <CVI_I2S0_RX CVI_I2S2_TX CVI_I2S1_RX CVI_I2S1_TX
CVI_SPI_NOR_RX CVI_SPI_NOR_TX CVI_I2S2_RX CVI_I2S3_TX>;
};
};
The *.dtsi (device tree source include files) above contain processor defaults; direct modification is not recommended. To modify a default, use the /delete-node/ method.
Note: U-Boot and the kernel use the same DTS.
4.2. Configure the Kernel Configuration¶
If need toFor inkernelconfigurationmodify, candirectlyconnectmodifykernel configurationfile, using cv1842hp_wevb_0014a_spinor as an example, itsdefconfigfiledefinitioninfilepathas follows
$ cat build/boards/cv184x/cv1842hp_wevb_0014a_spinor/linux/cvitek_cv1842hp_wevb_0014a_spinor_defconfig
CONFIG_KERNEL_XZ=y
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT=y
CONFIG_LOG_BUF_SHIFT=15
CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
There are three ways to modify the defconfig file: directly edit the file (not recommended), use the setconfig_kernel command line, or use the graphical menu interface (recommended).
The latter two methods are described below:
Use the command-line setconfig_kernel method
$ setconfig_kernel SPI=y
$ setconfig_kernel SPI_MASTER=y
$ setconfig_kernel SPI_DESIGNWARE=y
Use the graphical menu menuconfig_kernel method
4.3. Build the Kernel Separately¶
Build the kernel as follows:
$ source build/envsetup_soc.sh
$ defconfig cv1842hp_wevb_0014a_spinor
$ clean_kernel && build_kernel
[TARGET] cvi_board_memmap.h
[TARGET] cvi_board_memmap.conf
[TARGET] cvi_board_memmap.ld
[TARGET] kernel-build
......
INFO: Packing boot.spinor done!
Obtain boot.spinor.
$ ls install/soc_cv1842hp_wevb_0014a_spinor/boot.spinor
install/soc_cv1842hp_wevb_0014a_spinor/boot.spinor