From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Francois Dugast <francois.dugast.foss@gmail.com>
Cc: Michel Stempin <michel.stempin@wanadoo.fr>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/2] board/licheepi/licheepi_nano: new board
Date: Sun, 29 Oct 2023 19:49:44 +0100 [thread overview]
Message-ID: <20231029184944.GZ687180@scaer> (raw)
In-Reply-To: <20231027114700.1904-2-francois.dugast.foss@gmail.com>
François. All,
On 2023-10-27 13:47 +0200, Francois Dugast spake thusly:
> Add support for the LicheePi Nano with:
> - U-Boot 2023.04
> - Linux current latest version
We do not leave the kernel version to the l;atest one, because we want
to have known-working defconfigs, and so bumping the kernel (and
bootloader) version should be explicit (and tested) rather than follow
whatever the latest kernel version is.
So I pinned the version to kernel 6.5.9, which is the current latest
known to Biuldroot (so, presumably what you tested with).
> Board homepage: https://linux-sunxi.org/LicheePi_Nano
I added the true home page on the manufacturer website, and kept the
linux-sunxi wiki URL too.
> linux.fragment is required to disable some features in order
> to keep the kernel size small, otherwise the board does not
> boot due to limited memory. See note in readme.txt.
>
> Signed-off-by: Francois Dugast <francois.dugast.foss@gmail.com>
> ---
> board/licheepi/licheepi_nano/genimage.cfg | 33 ++++++++
> board/licheepi/licheepi_nano/linux.fragment | 11 +++
> board/licheepi/licheepi_nano/readme.txt | 84 +++++++++++++++++++++
> board/licheepi/licheepi_nano/uboot.fragment | 3 +
> configs/licheepi_nano_defconfig | 43 +++++++++++
> 5 files changed, 174 insertions(+)
> create mode 100644 board/licheepi/licheepi_nano/genimage.cfg
> create mode 100644 board/licheepi/licheepi_nano/linux.fragment
> create mode 100644 board/licheepi/licheepi_nano/readme.txt
> create mode 100644 board/licheepi/licheepi_nano/uboot.fragment
> create mode 100644 configs/licheepi_nano_defconfig
Of course, like for licheepi_zero, I moved that to the sipeed sub-dir.
And as for licheepi_zero, I renamed the defconfig to start with sipeed,
like all the other sipeed boards.
Oops, I forgot to rename licheepi_zero, so I've pushed a fixup commit...
Applied to master with the above changes, thanks.
Regards,
Yann E. MORIN.
> diff --git a/board/licheepi/licheepi_nano/genimage.cfg b/board/licheepi/licheepi_nano/genimage.cfg
> new file mode 100644
> index 0000000000..5e398eeb21
> --- /dev/null
> +++ b/board/licheepi/licheepi_nano/genimage.cfg
> @@ -0,0 +1,33 @@
> +flash w25q128 {
> + pebsize = 65536
> + numpebs = 256
> + minimum-io-unit-size = 1
> + sub-page-size = 1
> + vid-header-offset = 64
> +}
> +
> +image flash.bin {
> + flash {}
> + flashtype = w25q128
> +
> + partition uboot {
> + image = "u-boot-sunxi-with-spl.bin"
> + size = 512K
> + }
> +
> + partition dtb {
> + image = "suniv-f1c100s-licheepi-nano.dtb"
> + size = 64K
> + }
> +
> + partition zimage {
> + image = "zImage"
> + size = 5M
> + }
> +
> + partition rootfs {
> + image = "rootfs.jffs2"
> + size = 0
> + }
> +}
> +
> diff --git a/board/licheepi/licheepi_nano/linux.fragment b/board/licheepi/licheepi_nano/linux.fragment
> new file mode 100644
> index 0000000000..af68f28167
> --- /dev/null
> +++ b/board/licheepi/licheepi_nano/linux.fragment
> @@ -0,0 +1,11 @@
> +# CONFIG_NET is not set
> +# CONFIG_DRM is not set
> +# CONFIG_CMA is not set
> +# CONFIG_ARCH_MULTI_V7 is not set
> +CONFIG_UEVENT_HELPER=y
> +CONFIG_MTD=y
> +CONFIG_MTD_BLOCK=y
> +CONFIG_MTD_SPI_NOR=y
> +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
> +CONFIG_MTD_CMDLINE_PARTS=y
> +CONFIG_JFFS2_FS=y
> diff --git a/board/licheepi/licheepi_nano/readme.txt b/board/licheepi/licheepi_nano/readme.txt
> new file mode 100644
> index 0000000000..55aa602777
> --- /dev/null
> +++ b/board/licheepi/licheepi_nano/readme.txt
> @@ -0,0 +1,84 @@
> +Intro
> +=====
> +
> +This directory contains a buildroot configuration for building a
> +LicheePi Nano image which can be flashed into the board.
> +
> +This frees the MMC port which can be used for an additional SD
> +card of for a WiFi adapter.
> +
> +How to build it
> +===============
> +
> +Configure Buildroot
> +-------------------
> +
> + $ make licheepi_nano_defconfig
> +
> +Build the rootfs
> +----------------
> +
> +Note: you will need to have access to the network, since Buildroot
> +will download the packages' sources.
> +
> +You may now build your rootfs with:
> +
> + $ make
> +
> +(This may take a while, consider getting yourself a coffee ;-) )
> +
> +Result of the build
> +-------------------
> +
> +After building, you should obtain this tree:
> +
> + output/images/
> + +-- flash.bin
> + +-- rootfs.jffs2
> + +-- rootfs.tar
> + +-- suniv-f1c100s-licheepi-nano.dtb
> + +-- u-boot.bin
> + +-- u-boot-sunxi-with-spl.bin
> + `-- zImage
> +
> +How to flash
> +============
> +
> +Once the build process is finished you will have an image called
> +"flash.bin" in the output/images/ directory. It contains the
> +bootloader, the device tree, the kernel and the root file system.
> +
> +The device can be flashed when it is in special mode called "FEL
> +mode". There are multiple ways to enter this mode described here:
> +https://linux-sunxi.org/FEL#Entering_FEL_mode
> +
> +One way is to write one file from sunxi-tools to a SD card with:
> +
> + $ sudo dd if=./output/build/host-sunxi-tools-*/bin/fel-sdboot.sunxi of=/dev/sdX bs=1024 seek=8
> +
> +Once the SD card is burned, insert it into your LicheePi Nano board,
> +and plug the USB cable. A new USB device should be visible with
> +lsusb:
> +
> + 1f3a:efe8 Allwinner Technology sunxi SoC OTG connector in FEL/flashing mode
> +
> +The image can be flashed with:
> +
> + $ sudo ./output/host/bin/sunxi-fel -p spiflash-write 0 output/images/flash.bin
> +
> +Once this completes, remove the SD card and power the board. Your
> +new system should come up now and start a console on the UART0
> +serial port.
> +
> +Note
> +====
> +
> +Some standard kernel features are disabled using the fragment in
> +order to reduce the size. They can be enabled again if other
> +features are disabled instead.
> +
> +For U-Boot, the upstream repository is preferred and the system
> +boots, but loading the image from the flash takes a long time. It
> +is much faster when using the branch "licheepi-nano-v2020.01" of
> +this fork:
> +https://github.com/florpor/u-boot
> diff --git a/board/licheepi/licheepi_nano/uboot.fragment b/board/licheepi/licheepi_nano/uboot.fragment
> new file mode 100644
> index 0000000000..39f2bfe742
> --- /dev/null
> +++ b/board/licheepi/licheepi_nano/uboot.fragment
> @@ -0,0 +1,3 @@
> +CONFIG_USE_BOOTARGS=y
> +CONFIG_BOOTARGS="console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2 mtdparts=spi0.0:512k(uboot)ro,64k(dtb),5M(kernel)ro,-(rootfs)"
> +CONFIG_BOOTCOMMAND="sf probe 0 50000000; sf read 0x80C00000 0x80000 0x4000; sf read 0x80008000 0x90000 0x500000; bootz 0x80008000 - 0x80C00000"
> diff --git a/configs/licheepi_nano_defconfig b/configs/licheepi_nano_defconfig
> new file mode 100644
> index 0000000000..3dbd29241f
> --- /dev/null
> +++ b/configs/licheepi_nano_defconfig
> @@ -0,0 +1,43 @@
> +# Target options
> +BR2_arm=y
> +
> +# System configuration
> +BR2_TARGET_GENERIC_HOSTNAME="licheepi-nano"
> +BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the LicheePi Nano"
> +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
> +BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/licheepi/licheepi_nano/genimage.cfg"
> +
> +# Kernel
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
> +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/licheepi/licheepi_nano/linux.fragment"
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/suniv-f1c100s-licheepi-nano"
> +
> +# Filesystem images
> +BR2_TARGET_ROOTFS_JFFS2=y
> +BR2_TARGET_ROOTFS_JFFS2_FLASH_64=y
> +BR2_TARGET_ROOTFS_JFFS2_NOCLEANMARKER=y
> +BR2_TARGET_ROOTFS_JFFS2_PAD=y
> +
> +# Bootloaders
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2023.04"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="licheepi_nano"
> +BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/licheepi/licheepi_nano/uboot.fragment"
> +BR2_TARGET_UBOOT_SPL=y
> +BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
> +
> +# Required host utilities
> +BR2_PACKAGE_HOST_DOSFSTOOLS=y
> +BR2_PACKAGE_HOST_E2FSPROGS=y
> +BR2_PACKAGE_HOST_GENIMAGE=y
> +BR2_PACKAGE_HOST_MTOOLS=y
> +BR2_PACKAGE_HOST_SUNXI_TOOLS=y
> --
> 2.30.2
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-10-29 18:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-27 11:46 [Buildroot] [PATCH 1/2] board/licheepi_zero: move board files to their own directory Francois Dugast
2023-10-27 11:47 ` [Buildroot] [PATCH 2/2] board/licheepi/licheepi_nano: new board Francois Dugast
2023-10-29 18:49 ` Yann E. MORIN [this message]
2023-10-29 18:45 ` [Buildroot] [PATCH 1/2] board/licheepi_zero: move board files to their own directory Yann E. MORIN
2023-11-04 18:38 ` Thomas Petazzoni via buildroot
2023-11-04 18:46 ` Thomas Petazzoni via buildroot
-- strict thread matches above, loose matches on Subject: below --
2023-10-04 20:07 Francois Dugast
2023-10-04 20:07 ` [Buildroot] [PATCH 2/2] board/licheepi/licheepi_nano: new board Francois Dugast
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231029184944.GZ687180@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=francois.dugast.foss@gmail.com \
--cc=michel.stempin@wanadoo.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.