The main intention of this manual is to provide build scripts that are easy to handle compared to Marvell's build environment and self build for CN913x based products.
git clone https://github.com/SolidRun/cn913x_build.git |
The sources are pulled from:
arm-trusted firmware: GitHub - ARM-software/arm-trusted-firmware
mv-ddr-marvell: GitHub - MarvellEmbeddedProcessors/mv-ddr-marvell
u-boot: currently from marvell SDK
patches are supplied by Solid-Run in the patches/ directory
binaries are supplied by Solid-Run in the binaries/ directory
The build script builds the u-boot, atf and linux components, integrate it with Ubuntu rootfs bootstrapped with multistrap. Buildroot is also built aside for future use.
The CN913x u-boot is not public yet, and was taken from Marvell's SDK10
In order to use use the script with the SDK's 1186 patches, create a directory in ROOTDIR:
mkdir $ROOTDIR/patches-sdk-u-boot/ |
Extract the git-u-boot--.tar.bz2 under the destination folder git-u-boot-- and copy the patches
cp <sdk patch directory>/Base_SDK/base-patches-SDK-10.3.3.0-PR8/uboot/git-uboot-2019.10-SDK-10.3.3.0-PR8/*.patch patches-sdk-u-boot/ $ROOTDIR/patches-sdk-u-boot/The script will apply the u-boot patches onto the mainline u-boot. |
If the SDK patches directory doesn't exist, the script will take by default the u-boot.bin provided in the binaries directory.
The board can be configured based on the amount of CP# devices and to which carrier board it will fit. There are a few parameters that must be taken to account:
CP_NUM:
CP_NUM=1 - CN9130
CP_NUM=2 - CN9131
CP_NUM=3 - CN9132
BOARD_CONFIG - defines the device tree based on the platform
BOARD_CONFIG=0 - CN9132 CEx7 based on Clearfog Eval Board
BOARD_CONFIG=1 - CN9130 SOM based on Clearfog Base
BOARD_CONFIG=2 - CN9130 SOM based on Clearfog Pro
BOARD_CONFIG=<#> CP_NUM=<#> ./runme |
The script will generate a ready to use images at ROOTDIR/images:
flash_image.bin for SPI
cn9132_cex7_config_0_ubuntu.img for eMMC or SD card
For SD card bootable images:
Plug in a micro SD into your machine and run the following, where sdX is the location of the SD card got probed into your machine -
sudo dd if=images/cn9132-cex7_config_0_ubuntu.img of=/dev/sdX status=progress |
for burning u-boot image only:
sudo dd if=images/flash-image.bin of=/dev/sdX bs=512 seek=4096 status=progress |
Before powering up the board for the first time it is recommended to select the boot media. In order to configure the boot media:
CN9130 SOM base on ClearFog Base / Pro:
| SW1 #1 | SW1 #2 | SW1 #3 | SW1 #4 | SW1 #5 |
---|---|---|---|---|---|
SPI | ON | X | OFF | ON | X |
SD | OFF | X | ON | OFF | X |
eMMC | OFF | X | OFF | ON | X |
2.2GHz Core Freq | X | OFF | X | X | X |
2GHz Core Freq | X | ON | X | X | X |
In Clearfog Pro , the frequency can be reduced to 1.6GHz using SW2
| SW1 #2 | SW2 #5 |
---|---|---|
1.6GHz | OFF | ON |
CN9132 COM Express Type 7
BOOT MODE | SW1 #1 | SW1 #2 | SW1 #3 | SW1 #4 | SW1 #5 | SW1 #6 |
---|---|---|---|---|---|---|
SPI | OFF | ON | ON | OFF | ON | X |
SD | ON | OFF | ON | ON | OFF | X |
eMMC | ON | OFF | ON | OFF | ON | X |
Frequency | SW2 #1 | SW2 #1 |
---|---|---|
2.2GHz | ON | OFF |
2GHz | OFF | OFF |
1.6GHz | OFF | ON |
The atf dram_port.c supports both CN9132 CEx7 SO-DIMM with SPD and CN9130 SOM with DDRs soldered on board which might have various configurations and are set according to boot straps MPPs[11:10]. In order to differentiate, it checks the first 196 Bytes of the EEPROM. If programming data on the EEPROM (address 0x53) is requiered, and is not related to the DDR configuration, it must be after the first 196 Bytes. Otherwise, the boot sequence will be corrupted.
In u-boot prompt, to continue booting from SD card:
CN9130 SOM
setenv get_images "load mmc 1:1 $kernel_addr_r boot/Image; load mmc 1:1 $fdt_addr_r boot/cn9130-cf-pro.dtb; setenv root 'root=/dev/mmcblk1p1 rootwait rw'; setenv ramdisk_addr_r -" |
2. CN9132 CEx7
setenv get_images "load mmc 1:1 $kernel_addr_r boot/Image; load mmc 1:1 $fdt_addr_r boot/cn9132-cex7.dtb; setenv root 'root=/dev/mmcblk1p1 rootwait rw'; setenv ramdisk_addr_r -" boot |
To active the fan on CN9132 CEx7 run;
setenv get_images "load mmc 1:1 $kernel_addr_r boot/Image; load mmc 1:1 $fdt_addr_r boot/cn9132-cex7.dtb; setenv root 'root=/dev/mmcblk1p1 rootwait rw'; mw 0xf2440144 0xffefffff; mw 0xf2440140 0x00100000; setenv ramdisk_addr_r -" boot |