85 lines
5.7 KiB
Plaintext
85 lines
5.7 KiB
Plaintext
1. Instructions of Makefile in the Top Directory of OSDRV
|
|
The compilation scripts in this directory support the arm-mix410-linux toolchains. arm-mix410-linux corresponds to the glibc library.
|
|
The command is as follows (ss524v100 is used as an example):
|
|
|
|
(1) Compile the entire OSDRV directory:
|
|
make all
|
|
You can transfer the following parameters:
|
|
a. BOOT_MEDIA: spi (default) or emmc
|
|
b. CHIP: ss524v100 (default) or ss522v100 or ss615v100
|
|
c. TARGET_XLSM=*.xlsm (used to specify the U-Boot table file)
|
|
|
|
(2) Clear all compilation files in the osdrv directory.
|
|
make clean
|
|
|
|
(3) Thoroughly clear all compilation files in the osdrv directory and delete the compiled images:
|
|
make distclean
|
|
|
|
(4) Compile the kernel independently:
|
|
|
|
After entering the kernel source code directory, run the following commands:
|
|
cp arch/arm/configs/ss524v100_defconfig .config
|
|
(When the eMMC is started, run the following command: cp arch/arm/configs/ss524v100_emmc_defconfig .config)
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- menuconfig
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- uImage
|
|
|
|
(5) Compile the modules independently:
|
|
After entering the kernel source code directory, run the following commands:
|
|
cp arch/arm/configs/ss524v100_defconfig .config
|
|
(When the eMMC is started, run the following command: cp arch/arm/configs/ss524v100_emmc_defconfig .config)
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- menuconfig
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- modules
|
|
|
|
(6) Compile U-Boot independently.
|
|
Note: By default, the release package is released according to the configuration of the DMEB board. If the customer board is different from the DEMB board, modify the U-Boot table based on your board environment. Otherwise, U-Boot fails or other problems may occur.
|
|
|
|
After the boot source code directory is entered, run the following commands:
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- ss524v100_defconfig
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- menuconfig
|
|
(When the eMMC is started, run the following command: make ARCH=arm CROSS_COMPILE=arm-mix410-linux-ss524v100_emmc_defconfig)
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- -j 20
|
|
|
|
Go to the osdrv/tools/pc/uboot_tools/ directory on Windows, open the Excel file of the board, and click Generate reg bin file on the main tab page. The reg_info.bin file is generated, which is the table file of the corresponding platform.
|
|
Copy reg_info.bin from the osdrv/tools/pc/uboot_tools directory to the boot source code directory and change its file name extension to .reg as follows:
|
|
cp ../../../osdrv/tools/pc/uboot_tools/reg_info.bin .reg
|
|
|
|
make ARCH=arm CROSS_COMPILE=arm-mix410-linux- u-boot-z.bin
|
|
|
|
The u-boot-ss524v100.bin file generated in the root directory of the U-boot is the available U-boot image.
|
|
|
|
(7) Create the file system image.
|
|
Compiled file systems already exist in the osdrv/pub/ directory. You only need to create file system images according to the specifications of the flash memories on the board.
|
|
|
|
The SPI NOR flash requires the JFFS2 image. The block size information of the SPI NOR flash is used. The information will be displayed during U-Boot.
|
|
You are advised to directly run the mkfs.jffs2 tool and fill the parameters based on the displayed information.
|
|
The following uses the 64 KB block as an example:
|
|
osdrv/pub/bin/pc/mkfs.jffs2 -d osdrv/pub/rootfs_glibc -l -e 0x10000 -o osdrv/pub/rootfs_glibc_64k.jffs2
|
|
|
|
The NAND flash uses the UBI file system. You can use the mkubiimg.sh tool in osdrv/tools/pc/ubi_sh to make the UBI file system.
|
|
The page size, block size, and UBIFS partition size of the NAND flash are used.
|
|
The following uses the NAND flash with a 2 KB page, a 128 KB block, and a 32 MB UBI partition as an example:
|
|
mkubiimg.sh ss524v100 2k 128k osdrv/pub/rootfs 32M osdrv/pub/bin/pc
|
|
|
|
osdrv/pub/rootfs is the directory of the root file system.
|
|
osdrv/pub/bin/pc is the tool directory for making the image of the UBI file system.
|
|
The generated file rootfs_ss524v100_2k_128k_32M.ubifs is the UBI file system's image to be burnt.
|
|
|
|
Emmc uses ext4 image format, taking 96MB image as an example:
|
|
dd if=/dev/zero of=osdrv/pub/rootfs_ss524v100_96M.ext4 bs=512 count=196608
|
|
note:(196608 = 96 * 1024 * 1024 / 512)
|
|
./osdrv/pub/bin/pc/mkfs.ext4 osdrv/pub/rootfs_ss524v100_96M.ext4
|
|
cd open_source/e2fsprogs/out/pc/contrib
|
|
./populate-extfs.sh ../../../../../osdrv/pub/rootfs_glibc ../../../../../osdrv/pub/rootfs_ss524v100_96M.ext4
|
|
|
|
2. Precautions
|
|
|
|
(1) When the source code package is copied on Windows, executable files on Linux may become non-executable. As a result, compilation cannot be performed. After U-Boot or the kernel is compiled, there are many symbolic link files. Duplicating these source code packages on Windows will increase the sizes of the source code packages because the symbolic link files on Linux become real files on Windows, therefore, the size of the source code package increases. Do not copy a source code package on Windows.
|
|
(2) Compile the board software
|
|
This chip provides the floating-point operation unit and NEON. The libraries in the file system are compiled with hard floating point and neon compatible with the soft floating point call interface. Therefore, you need to add the -mcpu=cortex-a7, -mfloat-abi=softfp, and -mfpu=neon-vfpv4 options to Makefile during compilation of all board codes.
|
|
The following uses A7 as an example:
|
|
|
|
CFLAGS += -mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -fno-aggressive-loop-optimizations
|
|
CXXFlAGS +=-mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -fno-aggressive-loop-optimizations
|
|
|
|
XX in CXXFlAGS is determined according to the specific name of the macro used in Makefile, for example, CPPFLAGS.
|