Config for building u-boot and SPL from source

I couldn’t find a defconfig for u-boot on the gameshell, but was able to get it figured out based on the device tree and schematics.

Known issues:
The DRAM clock is set to the first timing I got working. It’s probably possible to clock the RAM faster. The datasheet for the chip on my board says that it’s DDR3L-1600, but I have no idea what that translates to in terms of A33 DRAM clock settings.

I don’t think I’ve got the LCD mode quite right, as the display backlight just flashes on startup and using the bmp command to load an image appears to do nothing.

The AXP_DLDO settings turn on power to the wifi chip, which is probably unnecessary as the Linux kernel does this later in the boot, but it seemed like a good idea to include it to avoid issues with MMC1 timeouts. The rest of the AXP settings appear to match the defaults for all sun8i boards and are the same as those listed on the GameShell schematic.

I’ve tested this patch against HEAD of the upstream u-boot master branch as well as 2019.07.

Patch:

Git branch:

4 Likes

Are the patch and the uboot bin from here of some help?

The work I’ve done is based on that. Mostly just posting it here for reference, in case others need to rebuild u-boot from source.

1 Like

Using binwalk I found that there is a dtb in the u-boot loader from https://github.com/clockworkpi/Kernel/tree/master/v0.4

I decompiled it and I have something like this https://gist.github.com/aplanas/9dd0b65b0049a430eb802e3492a6bec8

I moved it into the u-boot tree, but this cannot be recompiled back:

arch/arm/dts/sun8i-r16-clockworkpi-cpi3.dtb: ERROR (path_references): /aliases: Reference to non-existent node or label “mmc2”

2 Likes

According to the schematic [1], SDC2 (aka mmc2) is not connected to anything on the CPI3 board, so the device and pinctrl don’t need to be defined in the dtb. If there is a new revision of the CPI board that has this connected, then you’d need to add a new definition for mmc2 along with your mmc2_8bit pinctrl.

&mmc2 {
    pinctrl-names = "default";
    pinctrl-0 = <&mmc2_8bit>;
    vmmc-supply = <&reg_dcdc1>;
    bus-width = <8>;
    non-removable;
    cap-mmc-hw-reset;
    status = "okay";
};

The patch I posted originally includes a working dts, so I’m not really sure what you’re trying to accomplish here.

[1] https://github.com/clockworkpi/GameShellDocs

1 Like

Indeed, the original patch is working properly. Extracting the original dtb from the uboot did not produced any good result.

I did a diff -u from your dts and the one form the kernel patch, now I am trying to figure out the reason of those changes.

My final goal would be to test if I can use UEFI and Grub. IIUC uboot can provide an UEFI command line for non-UEFI devices.