initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
echo "Root File Sytem on MMC${devnum}"
|
||||
setenv rootfs /dev/mmcblk${devnum}p1
|
||||
setenv bootargs root=${rootfs} rootwait rw ${extrabootargs}
|
||||
|
||||
load ${devtype} ${devnum} ${kernel_addr_r} boot/Image
|
||||
load ${devtype} ${devnum} ${fdt_addr_r} boot/imx8mq-kontron-pitx-imx8m.dtb
|
||||
|
||||
booti ${kernel_addr_r} - ${fdt_addr_r}
|
||||
@@ -0,0 +1,16 @@
|
||||
image sdcard.img {
|
||||
hdimage {
|
||||
}
|
||||
|
||||
partition imx-boot {
|
||||
in-partition-table = "no"
|
||||
image = "imx8-boot-sd.bin"
|
||||
offset = 33k
|
||||
}
|
||||
|
||||
partition rootfs {
|
||||
partition-type = 0x83
|
||||
image = "rootfs.ext4"
|
||||
offset = 8M
|
||||
}
|
||||
}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir -p $TARGET_DIR/boot/
|
||||
cp $BINARIES_DIR/boot.scr $TARGET_DIR/boot/boot.scr
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
support/scripts/genimage.sh -c $(dirname $0)/genimage.cfg
|
||||
@@ -0,0 +1,74 @@
|
||||
Kontron pitx-imx8m
|
||||
==================
|
||||
|
||||
https://www.kontron.com/produkte/pitx-imx8m/p155258
|
||||
|
||||
|
||||
How to build it
|
||||
===============
|
||||
|
||||
Configure buildroot:
|
||||
|
||||
$ make kontron_pitx_imx8m_defconfig
|
||||
|
||||
Change settings to fit your needs (optional):
|
||||
|
||||
$ make menuconfig
|
||||
|
||||
Compile everything and buildr the rootfs image:
|
||||
|
||||
$ make
|
||||
|
||||
|
||||
Result of the build
|
||||
===================
|
||||
|
||||
After building, the output/images directory contains:
|
||||
|
||||
output/images/
|
||||
├── bl31.bin
|
||||
├── boot.scr
|
||||
├── ddr_fw.bin
|
||||
├── Image
|
||||
├── imx8-boot-sd.bin
|
||||
├── imx8mq-kontron-pitx-imx8m.dtb
|
||||
├── lpddr4_pmu_train_fw.bin
|
||||
├── rootfs.ext2
|
||||
├── rootfs.ext4 -> rootfs.ext2
|
||||
├── rootfs.tar
|
||||
├── sdcard.img
|
||||
├── signed_hdmi_imx8m.bin
|
||||
├── u-boot.bin
|
||||
├── u-boot.itb
|
||||
├── u-boot-nodtb.bin
|
||||
├── u-boot-spl.bin
|
||||
└── u-boot-spl-ddr.bin
|
||||
|
||||
|
||||
Flashing the SD card image
|
||||
==========================
|
||||
|
||||
To install the image on a SDCard simply copy sdcard.img to the storage (e.g. SD, eMMC)
|
||||
|
||||
$ sudo dd if=output/images/sdcard.img of=<your-sd-device>
|
||||
|
||||
|
||||
Preparing the board
|
||||
===================
|
||||
|
||||
* Connect a serial line to the board
|
||||
* Insert the SD card
|
||||
* Make sure the boot source selection DIP switches are set correctly
|
||||
* SW1 1-4 OFF
|
||||
* SW1 2-3 OFF
|
||||
* Power-up the board
|
||||
|
||||
|
||||
Booting the board
|
||||
=================
|
||||
|
||||
By default the bootloader will search for the first valid image, starting
|
||||
with the internal eMMC. To make sure the bootloader loads bootscript from
|
||||
the correct location (SD card) set the boot_targets environment variable:
|
||||
|
||||
$ setenv boot_targets mmc1
|
||||
@@ -0,0 +1,4 @@
|
||||
label buildroot
|
||||
kernel /boot/Image
|
||||
devicetreedir /boot
|
||||
append root=PARTUUID=%PARTUUID% rootwait
|
||||
@@ -0,0 +1,23 @@
|
||||
image sdcard-emmc.img {
|
||||
hdimage {
|
||||
gpt = true
|
||||
}
|
||||
|
||||
partition rcw {
|
||||
offset = 4k
|
||||
in-partition-table = "no"
|
||||
image = "rcw.bin"
|
||||
}
|
||||
|
||||
partition u-boot {
|
||||
offset = 1M
|
||||
in-partition-table = "no"
|
||||
image = "u-boot.rom"
|
||||
}
|
||||
|
||||
partition rootfs {
|
||||
offset = 2M
|
||||
image = rootfs.ext4
|
||||
partition-uuid = %PARTUUID%
|
||||
}
|
||||
}
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
BOARD_DIR="$(dirname $0)"
|
||||
PARTUUID="$($HOST_DIR/bin/uuidgen)"
|
||||
|
||||
install -d "$TARGET_DIR/boot/extlinux/"
|
||||
sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
|
||||
sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
|
||||
@@ -0,0 +1,88 @@
|
||||
Kontron SMARC-sAL28
|
||||
===================
|
||||
|
||||
How to build it
|
||||
===============
|
||||
|
||||
Configure Buildroot:
|
||||
|
||||
$ make kontron_smarc_sal28_defconfig
|
||||
|
||||
Change settings to fit your needs (optional):
|
||||
|
||||
$ make menuconfig
|
||||
|
||||
Compile everything and build the rootfs image:
|
||||
|
||||
$ make
|
||||
|
||||
Copying the image to a storage device
|
||||
=====================================
|
||||
|
||||
Buildroot builds an image which can be written to the internal eMMC
|
||||
storage, a SD card or an USB thumb drive. You can use the following
|
||||
command on your host:
|
||||
|
||||
$ sudo dd if=output/images/sdcard-emmc.img of=/dev/sdx bs=1M
|
||||
|
||||
Where /dev/sdx is the corresponding block device of your SD card or USB
|
||||
thumb drive. To flash it on your internal eMMC use the following command on
|
||||
the board:
|
||||
|
||||
# dd if=sdcard-emmc.img of=/dev/mmcblk1 bs=1M
|
||||
|
||||
Be sure you have not booted from the internal eMMC in this case!
|
||||
|
||||
Booting the board
|
||||
=================
|
||||
|
||||
By default the bootloader will search for the first valid image, starting
|
||||
with the internal eMMC. Consult the vendor documentation on how to use the
|
||||
DIP switches to select specific boot devices. To use the bootloader
|
||||
environment set the boot_targets correspondingly. E.g.:
|
||||
|
||||
# setenv boot_targets usb0
|
||||
|
||||
To boot from an USB thumb drive.
|
||||
|
||||
The device tree is loaded according to the filename in fdtfile. The
|
||||
following command will set the default device tree, which works on almost
|
||||
all variants (with less features of course):
|
||||
|
||||
# setenv fdtfile freescale/fsl-ls1028a-kontron-sl28.dtb
|
||||
|
||||
Set this to a device tree which fits your board variant.
|
||||
|
||||
Connect your serial cable to SER1 and open your favorite terminal emulation
|
||||
program (baudrate 115200, 8n1). E.g.:
|
||||
|
||||
$ picocom -b 115200 /dev/ttyUSB0
|
||||
|
||||
You will get a warning reported by fdisk when you examine the SD card.
|
||||
This is because the genimage.cfg file doesn't specify the SD card size
|
||||
(as people will naturally have different sized cards), so the
|
||||
secondary GPT header is placed after the rootfs rather than at the end
|
||||
of the disk where it is expected to be.
|
||||
|
||||
You will see something like this at boot time:
|
||||
|
||||
[ 4.552797] GPT:Primary header thinks Alt. header is not at the end of the disk.
|
||||
[ 4.560237] GPT:266272 != 7864319
|
||||
[ 4.563565] GPT:Alternate GPT header not at the end of the disk.
|
||||
[ 4.569596] GPT:266272 != 7864319
|
||||
[ 4.572925] GPT: Use GNU Parted to correct GPT errors.
|
||||
|
||||
Updating the bootloader
|
||||
=======================
|
||||
|
||||
Buildroot will automatically build the u-boot bootloader. The resulting
|
||||
image is called u-boot.rom and you can find it in the images/ directory.
|
||||
|
||||
To update the bootloader on the board you could either copy it to an
|
||||
USB thumb drive or you could put it on a TFTP server. The following
|
||||
example assumes you have the bootloader image copied to the root of
|
||||
a thumb drive:
|
||||
|
||||
# usb start
|
||||
# load usb 0:1 $loadaddr u-boot.rom
|
||||
# sf probe 0 && sf update $fileaddr 0x210000 $filesize
|
||||
@@ -0,0 +1,8 @@
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0", DRIVERS=="fsl_enetc", NAME="eno0"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", NAME="eno1"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.2", DRIVERS=="fsl_enetc", NAME="eno2"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.6", DRIVERS=="fsl_enetc", NAME="eno3"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.0", DRIVERS=="fsl_enetc_vf", NAME="eno0vf0"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.1", DRIVERS=="fsl_enetc_vf", NAME="eno0vf1"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.2", DRIVERS=="fsl_enetc_vf", NAME="eno1vf0"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:01.3", DRIVERS=="fsl_enetc_vf", NAME="eno1vf1"
|
||||
@@ -0,0 +1,6 @@
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p0", NAME="swp0"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p1", NAME="swp1"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p2", NAME="swp2"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p3", NAME="swp3"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p4", NAME="swp4"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p5", NAME="swp5"
|
||||
@@ -0,0 +1,19 @@
|
||||
# Map the GBE0 and GBE1 names from the SMARC standard to the network
|
||||
# interfaces. This depends on the variant of the board.
|
||||
|
||||
# get the variant compatible string
|
||||
PROGRAM=="/bin/grep '^kontron,sl28-var[1-4]$' /sys/firmware/devicetree/base/compatible", ENV{sl28_compatible}="%c"
|
||||
|
||||
# variant 1
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", ENV{sl28_compatible}=="kontron,sl28-var1", NAME="gbe0"
|
||||
|
||||
# variant 2
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p0", ENV{sl28_compatible}=="kontron,sl28-var2", NAME="gbe0"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.5", DRIVERS=="mscc_felix", ATTR{phys_port_name}=="p1", ENV{sl28_compatible}=="kontron,sl28-var2", NAME="gbe1"
|
||||
|
||||
# variant 3
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0", DRIVERS=="fsl_enetc", ENV{sl28_compatible}=="kontron,sl28-var3", NAME="gbe0"
|
||||
|
||||
# variant 4
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.0", DRIVERS=="fsl_enetc", ENV{sl28_compatible}=="kontron,sl28-var4", NAME="gbe0"
|
||||
ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:00:00.1", DRIVERS=="fsl_enetc", ENV{sl28_compatible}=="kontron,sl28-var4", NAME="gbe1"
|
||||
Reference in New Issue
Block a user