The initialization script provided by the tinyinit package is the same
as the one contained in board/canaan/k210-soc/rootfs_overlay/sbin/init
except for the Linux logo, which has been removed. The patch reworks
the configurations that use this overlay directory by replacing the
initialization process contained within it with the one provided by
the tinyinit package.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Add a buildroot configuration file to build a minimal Linux environment
for the Canaan KD233 board.
The configuration file is canaan_kd233_defconfig. It builds a bootable
kernel image with an embedded initramfs root file system. The image
built can be flashed to the board as is and does not require a boot
loader. This configuration uses the tiny busybox configuration defined
in board/canaan/k210-soc/busybox-tiny.config.
U-Boot currently does not support this board, making it impossible to
boot the kernel after loading it from the SD card. However, the SD card
is usable from Linux once booted using the canaan_kd233_defconfig
configuration.
The configuration also enable the kflash and pyserial-miniterm host
tools for flashing image files to the board and opening a terminal
console.
The readme.txt file documents how to build and boot the Canaan KD233
board with this configuration.
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
The Linux environment for all boards using the Canaan Kendryte K210 SoC
can be built with the same process, using configurations that differ
only by the device tree used for the build. This patch add the
shared configurations, rootfs overlay and scripts used for all
K210-based boards.
Since the K210 SoC only has 8 MB of SRAM, a special busybox
configuration and rootfs overlay are added to save memory at runtime:
* For configurations using direct kernel boot (no boot loader), the
default busybox configuration busybox-minimal.config is modified
using the fragment file board/canaan/k210-soc/busybox-tiny.config.
This reduces the size of the busybox executable to save memory when
executing shell commands.
* Busybox init system is not used and a special init scripts is provided
using the rootfs_overlay root file system overlay. This init script
simply mounts devtmpfs, /proc and /sys, and exec an interactive shell
after printing a logo. This avoids (1) boot failures due to large
memory allocations by the regular busybox init system (these
allocations fail on the K210 for lack of enough memory) and avoids
(2) keeping the init process sleeping in the background (wasted
memory).
The board/canaan/k210-soc/busybox-tiny.config and the rootfs overlay
files in board/canaan/k210-soc/rootfs_overlay are used for all Canaan
K210 SoC based boards.
For board configurations booting using the U-Boot boot loader, a common
set of linux kernel configuration parameters is provided by the file
board/canaan/k210-soc/linux-sdcard.config. In addition, the post build
script board/canaan/k210-soc/post-build.sh file and U-Boot image
generation configuration file board/canaan/k210-soc/genimage.cfg are
provided. The post-build script creates a generic "k210.dtb" symlink to
the compiled device tree file for the target board. This symlink is used
by the genimage.cfg configuration, making this file common for all
boards.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>