Customizing the BSP for a custom carrier board
U-Boot
Platform code
You can access Digi's U-Boot source code in Github.
The BSP is inside folder board/digi/ where there are two subfolders:
- ccimx6: contains common code for the ConnectCore 6 System-On-Chip (DDR3 initialization, eMMC, PMIC, Ethernet, and so on).
- ccimx6sbc: contains code for the ConnectCore 6 SBC carrier board (Ethernet PHY, power regulators, and so on).
Normally you only need to modify the code inside ccimx6sbc to adapt it to your carrier board-specific hardware. You may want to adapt, for example:
- Ethernet PHY, if a different PHY is used on your board.
- PMIC voltages, if different LDOs are used to power interfaces that must be enabled during the boot process.
- GPIOs, IOMUX of pads, per your board's requirements.
Note The USDHC2 controller (microSD card on the SBC) is initialized together with USDHC4 (eMMC on the System-On-Chip) in the ConnectCore 6 System-On-Chip common code, despite technically being part of the SBC carrier board.
Platform include files
Platform include files on include/configs/ are:
ccimx6sbc.h: defines variables that determine things like the board name, the UART to use as console, the Ethernet PHY address, or the default environment.
ccimx6_common.h: contains common configuration for the ConnectCore 6 System-On-Chip, like the location of U-Boot and its environment on the eMMC, or the supported interfaces and commands.
digi_common.h: contains common configuration for Digi embedded products.
You can configure most settings for your carrier board on the ccimx6sbc.h header file.
Linux kernel
Hardware specifics are handled in the kernel via device tree files. Device tree files are text files that describe a platform's hardware. They are part of the kernel source tree but are compiled as separate binary files. The bootloader loads the device tree on RAM memory and passes it to the kernel, which in turn loads the necessary drivers according to the device tree description.
For details on how the ConnectCore 6 device tree files are organized for different available SOM variants and SBC board variants, see Device tree files.
Creating the device tree for your custom carrier board
After evaluating the ConnectCore 6 on the SBC, you will likely design your own custom carrier board with the specific hardware that fits your needs.
Skeleton device tree based on the ConnectCore 6
Start by creating a new .dts file at arch/arm/boot/dts/ (for example, mycc6board.dts) that contains:
- an include line to the .dtsi file that matches your i.MX6 CPU.
- imx6q.dtsi for Dual/Quad CPU.
- imx6dl.dtsi for Solo/DualLite CPU.
- an include line to the .dtsi file that matches your ConnectCore 6 System-On-Module variant (the following example uses a Dual/Quad variant with wireless and Bluetooth).
- your platform model name under the model property.
- a compatible property set to "digi,ccimx6", "fsl,imx6q".
Enabling ConnectCore 6 interfaces
Most of the ConnectCore 6 interfaces are disabled (their status property is set to disabled) in the ConnectCore 6 .dtsi include file. For each ConnectCore 6 interface you want to use, you must:
- enable it by setting its status property to okay.
- configure its IOMUX to the pins used on your carrier board, as applicable.
- configure additional parameters to match your hardware, as applicable.
Note You can reference ConnectCore 6 SBC device tree files and schematics to enable and configure the IOMUX of ConnectCore 6 System-On-Module interfaces and pins.
Copying hardware components from the ConnectCore 6 SBC
If your carrier board design is based on the ConnectCore 6 SBC, you can copy interfaces and IOMUX settings from the ConnectCore6 SBC device tree include files and adapt the settings or lines as applicable for your hardware.
Adding custom hardware
Your carrier board may include additional hardware components. If a driver exists in the Linux kernel, check its device tree bindings in the Linux kernel documentation at Documentation/devicetree/bindings/.
Compiling your platform device tree
If you want the kernel to build your newly created device tree file, you must add it to the device tree's Makefile:
arch/arm/boot/dts/Makefile
imx6q-ccimx6sbc-w.dtb \ imx6q-ccimx6sbc-wb.dtb \ imx6q-ccimx6sbc-wb-ldo-bypass.dtb \ + mycc6board.dtb \ imx6q-sabreauto.dtb \ imx6q-sabreauto-flexcan1.dtb \ imx6q-sabreauto-ecspi.dtb \