Adapting BSP for an own product

we suggest to read the following pages before you proceed with this page

The BSP was developed for the starterkit . To use it in a product with special needs or a different basebord we suggest to define an own platform. To start with it make a copy of the platform definition and select the new platform definition

$ cd <BSPROOT>
$ cp -r <BSPROOT>/configs/platform-tq-mba6x to <BSPROOT>/configs/<your-cool-platform>
$ ptxdist platform <BSPROOT>/configs/<your-cool-platform>/platformconfig

To start configuring your new platform type

$ ptxdist platformconfig

The first thing to change should be the platform name. Adapt things like kernel configuration, image creation etc. to your needs.

The new system will be built under <BSPROOT>/platform-<platformname_from_platformconfig>

Please read the build system documentation howto go further. Keep in mind that custom mainboards may need changes in bootloader and device tree. Give the new bootloader config and device tree a new name to cleanly distinguish them from the starterkit mainboard configuration.

If creating BSP for a new motherboard, make sure to create new configurations for bootloaders and device tree.

Changing packages

PTXdist uses release tar balls for software it loads from the net. You have to work with patches, if you need to make changes to the source code. Follow the instructions of the developers section in the PTXdist manual.

Changes that are made in the build directories will be deleted, when PTXdist needs to redo a buildstep.

Adding own packages

PTXdist needs a package for every bit you need in your root FS to guarantee reproducible builds. To add your software, files etc. you have to provide local packages. Follow the instructions of the developers section in the PTXdist manual. PTXdist provides templates as starting point for own packages. Type

$ ptxdist newpackage

to see what package templates exist.

Partition scheme

Changing the partition scheme may affect the boot loader update capability and / or the kernel command line parameters!

SD / eMMC images

Unpartitioned area [sector size = 512 byte, total size = 0x2000 sectors (4 MiB)]

Sector numbers are in hexadecimal (as expected by U-Boot's mmc command), size is given in hex (=number of sectors) and dezimal (= size in byte).

Sectors Size
First Last Sectors Byte Contents
0x0000 0x0000 0x0001 (512 B) MBR
0x0001 0x0001 0x0001 (512 B) reserved 1)
0x0002 0x07ff 0x07fe (1023 KiB) u-boot
0x0800 0x080f 0x0010 (8 KiB primary u-boot environment 2)
0x0810 0x081f 0x0010 (8 KiB secondary u-boot environment 2)
0x0820 0x0fff 0x07e0 (1008 KiB unused
0x1000 0x17ff 0x0800 (1 MiB device tree blob
0x1800 0x1fff 0x0800 (1 MiB unused
1) for redundant Boot Support, for details see CPU reference Manual
2) redundant environment, cf. CONFIG_ENV_*_REDUND in U-Boot README
Start … End Size (sectors / byte) Contents
0x0000 … 0x0000 0x0001 sector / 512 B MBR
0x0001 … 0x0001 0x0001 sector / 512 B reserved 1)
0x0002 … 0x07ff 0x07fe sectors / 1023 KiB u-boot
0x0800 … 0x080f 0x0010 sectors / 8 KiB primary u-boot environment 2)
0x0810 … 0x081f 0x0010 sectors / 8 KiB secondary u-boot environment 2)
0x0820 … 0x0fff 0x07e0 sectors / 1008 KiB unused
0x1000 … 0x17ff 0x0800 sectors / 1 MiB device tree blob
0x1800 … 0x1fff 0x0800 sectors / 1 MiB unused
1) for redundant Boot Support, for details see CPU reference Manual
2) redundant environment, cf. CONFIG_ENV_*_REDUND in U-Boot README
Partitioned area: 0x106000 sectors / 520+ MiB
Partition Size Contents
1 4 MiB Kernel image 1)
2 256 MiB root FS
3 256 MiB Spare, not formatted
4 —- —-
1) raw partition

The partition scheme is defined using the config file config/platform-tq-mba6x/config/uboot-hd.config. The creation of the image is controlled using the PTXdist packages image-uboot-tqma6<q|s>-hd.

To create the image the genimage host tool is used. This tool is automatically selected and built. You can find the build directory under <BSPROOT>/platform-MBa6x/build-host/genimage. There is also a README file documenting how to use this tool.

SPI NOR

Sector size = 64 KiB

First sector Last sector Size (sectors) Size (byte) Contents
0x00 0x07 0x08 sectors 512 KiB U-Boot 1)
0x08 0x08 0x01 sector 64 KiB environment0
0x09 0x09 0x01 sector 64 KiB environment1
0x0a 0x0a 0x01 sector 64 KiB environment1
0x0b 0x0f 0x05 sectors 372 KiB devicetree
0x10 0x70 0x60 sectors 6 MiB Kernel
1) U-Boot image has to be written at address 0x400, cf. CPU Reference Manual for details
First Last Size (sectors) Size (byte) Contents
0 7 8 sectors 512 KiB U-Boot 1)
8 8 1 sector 64 KiB environment0
9 9 1 sector 64 KiB environment1
10 14 5 sectors 320 KiB devicetree
15 110 96 sectors 6 MiB Kernel
1) U-Boot image has to be written at address 0x400, cf. CPU Reference Manual for details
— Template partitions not found.