424 | | The following details pertain to buildroot 2017.08 although newer versions will likely be similar if not the same. |
425 | | |
426 | | To configure buildroot for the i.MX6 SoC found on the Ventana product family: |
427 | | * Target options -> Target Architecture -> ARM (little endian) |
428 | | * Target options -> Target Architecture Variant -> cortex-A9 (BR2_GCC_TARGET_CPU) |
429 | | * Target options -> Enable NEON SIMD extension support (BR2_ARM_ENABLE_NEON=y) |
430 | | * Target options -> Enable VFP extension support (BR2_ARM_ENABLE_VFP=y) |
431 | | * Target options -> Floating point strategy (NEON) (BR2_ARM_FPU_NEON=y) |
432 | | * Filesystem images -> tar the root filesystem -> Compression method (xz) |
433 | | |
434 | | This builds a ~500KiB output/images/rootfs.tar.xz in less than 5 minutes on a typical Linux desktop. |
435 | | |
436 | | If you also want buildroot to build a kernel provided from buildroot using the buildroot rootfs embedded as an initramfs then enable the following to create a kernel suitable for imx_v6_v7 and booting via U-Boot {{{bootm}}}: |
437 | | * Kernel -> Linux Kernel (BR2_LINUX_KERNEL) |
438 | | * Kernel -> Defconfig name (imx_v6_v7) (BR2_LINUX_KERNEL_DEFCONFIG) |
439 | | * Kernel -> Kernel binary format (uImage) |
440 | | * Kernel -> load address (0x10008000) (BR2_LINUX_KERNEL_UIMAGE_LOADADDR) |
441 | | * Kernel -> Device Tree Source file names (imx6dl-gw54xx imx6q-gw54xx imx6dl-gw53xx imx6q-gw53xx imx6dl-gw52xx imx6q-gw52xx imx6dl-gw51xx imx6q-gw51xx imx6dl-gw551x imx6q-gw551x imx6dl-gw552x imx6q-gw552x imx6dl-gw553x imx6q-gw553x imx6dl-gw5913) (BR2_LINUX_KERNEL_INTREE_DTS_NAME) |
442 | | * Filesystem images -> initial RAM filesystem linked into linux kernel |
443 | | |
444 | | Adding the kernel build produces a ~6MB uImage in less than 10 minutes on a typical Linux desktop. |
445 | | |
446 | | To boot this on a Ventana bootloader: |
447 | | {{{#!bash |
448 | | tftpboot ${loadaddr} ventana/uImage && tftpboot ${fdt_addr} ventana/${fdt_file2} && bootm ${loadaddr} - ${fdt_addr} |
449 | | }}} |
450 | | |
451 | | Now you have a minimal Linux OS that booted in about 6 seconds. |
452 | | |
453 | | A prebuilt image of this can be found at: http://dev.gateworks.com/buildroot/ventana/minimal |
454 | | |
455 | | Additional tools: |
456 | | * resize2fs |
457 | | * screen |
| 425 | The following details pertain to buildroot 2020.08 although newer versions will likely be similar if not the same. |
| 426 | |
| 427 | The Ventana product family is based on the i.MX6 SoC which has ARM Cortex-A9 CPU cores. Therefore we will tune the compiler to build arm32 code with support for ARM NEON and VFP. |
| 428 | |
| 429 | To build a root filesystem only: |
| 430 | {{{#!bash |
| 431 | cat << EOF > configs/imx6_minimal_defconfig |
| 432 | # arm cortex-a9 cpu |
| 433 | BR2_arm=y |
| 434 | BR2_cortex_a9=y |
| 435 | BR2_ARM_ENABLE_NEON=y |
| 436 | BR2_ARM_ENABLE_VFP=y |
| 437 | BR2_ARM_FPU_VFPV3=y |
| 438 | # filesystem options |
| 439 | BR2_TARGET_ROOTFS_CPIO_XZ=y |
| 440 | EOF |
| 441 | make imx6_minimal_defconfig |
| 442 | make -j8 |
| 443 | }}} |
| 444 | |
| 445 | This builds output/images/root.tar.xz consisting of a ~1.7MiB root filesystem (when uncompressed) in 5 to 10 minutes of building on a typical Linux desktop. |
| 446 | |
| 447 | If you also want buildroot to build a Gateworks v5.4.45 kernel with a minimal kernel config and a self-contained minimal root filesystem you would add the following the your defconfig: |
| 448 | {{{#!bash |
| 449 | cat << EOF > configs/ventana_kernel_defconfig |
| 450 | # arm cortex-a9 cpu |
| 451 | BR2_arm=y |
| 452 | BR2_cortex_a9=y |
| 453 | BR2_ARM_ENABLE_NEON=y |
| 454 | BR2_ARM_ENABLE_VFP=y |
| 455 | BR2_ARM_FPU_VFPV3=y |
| 456 | # toolchain |
| 457 | BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y |
| 458 | # kernel |
| 459 | BR2_LINUX_KERNEL=y |
| 460 | BR2_LINUX_KERNEL_CUSTOM_GIT=y |
| 461 | BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Gateworks/linux-imx6.git" |
| 462 | BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="gateworks_5.4.45" |
| 463 | BR2_LINUX_KERNEL_DEFCONFIG="gwventana" |
| 464 | # filesystem options |
| 465 | BR2_TARGET_ROOTFS_TAR_XZ=y |
| 466 | EOF |
| 467 | # fetch minimal kernel config for ventana |
| 468 | wget http://dev.gateworks.com/buildroot/ventana/minimal/gwventana_minimal_kernel_defconfig |
| 469 | make ventana_kernel_defconfig |
| 470 | make -j8 |
| 471 | }}} |
| 472 | |
| 473 | This produces a ~7MiB compressed kernel image in output/images/uImage containing the ~1.7MiB root filesystem in 15 to 20 minutes of building on a typical Linux desktop. |
| 474 | |
| 475 | If you need add back or modify kernel features you can do so with: |
| 476 | {{{#!bash |
| 477 | make linux-menuconfig # make your changes |
| 478 | make -j8 |
| 479 | # save and update the defconfig once you are happy with it |
| 480 | make linux-savedefconfig linux-update-defconfig |
| 481 | }}} |
| 482 | |
| 483 | To boot a kernel+ramdisk on Ventana via the bootloader with a tftpserver copy output/images/uImage and output/images/*.dtb to your tftpserver and use: |
| 484 | * load from network tftpserver |
| 485 | {{{#!bash |
| 486 | setenv bootargs console=ttymxc1,115200 |
| 487 | setenv fsload tftpboot |
| 488 | setenv bootdir . # set this to the prefix of your tftp dir |
| 489 | run loadfdt && $fsload $kernel_addr_r $bootdir/uImage && bootm $loadaddr - $fdt_addr |
| 490 | }}} |
| 491 | * load from microSD with ext/fat filesystem |
| 492 | {{{#!bash |
| 493 | setenv bootargs console=ttymxc1,115200 |
| 494 | setenv fsload load mmc 0:1 |
| 495 | setenv bootdir . # set this to the prefix of your tftp dir |
| 496 | run loadfdt && $fsload $kernel_addr_r $bootdir/uImage && bootm $loadaddr - $fdt_addr |
| 497 | }}} |
| 498 | * load from USB with ext/fat filesystem |
| 499 | {{{#!bash |
| 500 | setenv bootargs console=ttymxc1,115200 |
| 501 | setenv fsload load usb 0:1 |
| 502 | usb start |
| 503 | setenv bootdir . # set this to the prefix of your tftp dir |
| 504 | run loadfdt && $fsload $kernel_addr_r $bootdir/uImage && bootm $loadaddr - $fdt_addr |
| 505 | }}} |
| 506 | |
| 507 | A prebuilt image can be found [http://dev.gateworks.com/buildroot/ventana/minimal here] which contains: |
| 508 | * Gateworks Linux 5.4.45 kernel (minimal kernel features) |
| 509 | * resize2fs (BR2_PACKAGE_E2FSPROGS_RESIZE2FS) |
| 510 | * uclibc |
| 511 | * screen (BR2_PACKAGE_SCREEN) |
| 512 | * pciutils (BR2_PACKAGE_PCIUTILS) |
| 513 | * libusb (BR2_PACKAGE_LIBUSB) |
| 514 | * eudev (BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV) (required for usbutils) |
| 515 | * usbutils (BR2_PACKAGE_USBUTILS) |
| 516 | * gdisk/sgdisk disk partitioning tools: |
| 517 | - gdisk/sgdisk (BR2_PACKAGE_GPTFDISK/BR2_PACKAGE_GPTFDISK_SGDISK) |
| 518 | * stress (BR2_PACKAGE_STRESS) |
| 519 | * evtest (BR2_PACKAGE_EVTEST) |