Raspberry pi CM3+ with u-boot

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Raspberry pi CM3+ with u-boot

Romain Crausaz-2
Dear all,

I am trying to understand how to change the default pin of the u-boot (2020.01) console for the Raspberry pi CM3+ board.

I am using yocto with meta-raspberrypi on the dunfell branch and how everything works between the first stage bootloader, u-boot, u-boot internal device tree and the kernel device tree is not really clear to me.

Here is what I would like to achieve:

 1.  Get UART0 or UART1 as the standard console for u-boot and the linux kernel on pins 32 and 33
 2.  Make u-boot pass my device tree (stored in the boot partition) to the kernel and not the device tree generated by the first stage bootloader

Regarding the first point, I already created a new device tree within u-boot and set it as the default bootloader in my default config (see attached files).
Here is the different things I tried:

 *   Use UART0 on pins 32 and 33
    *   In the u-boot device tree:

chosen {
    stdout-path = "serial0:115200n8";
}
...
&uart0 {
    pinctrl-names= "default";
    pinctrl-0 = <&uart0_gpio32>;
    status = "okay";
}

    *   In the config.txt:

enable_uart=1
dtoverlay=uart0,txd0_pin=32,rxd0_pin=33,pin_func=7

    *   This works but only for the kernel, I don't get any output from u-boot and can't stop the boot process.

 *   Use UART1 on pins 32 and 33: more or less the same modification but with different values

I would like to know if there is an other file I should modify to get this working. When I use the uart0 or uart1 on pin 14 and 15 everything works properly.

The second point seems pretty clear to me. I will change the bootscript and load the file with the fatload command and pass it to the kernel. However I wonder if it might create some problems if the first stage bootloader has already reserved the pins.

Finally when u-boot is starting correctly I have the following warning and I was not able to find any explanation on it:

U-Boot 2020.01 (Jan 06 2020 - 20:56:31 +0000)

DRAM:  948 MiB
RPI Compute Module 3+ (0xa02100)
MMC:   mmc@7e202000: 0
Loading Environment from FAT... WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
*** Warning - bad CRC, using default environment

In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
Bus usb@7e980000: scanning bus usb@7e980000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
WARNING at drivers/mmc/bcm2835_sdhost.c:410/bcm2835_send_command()!
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
Should I simply ignore it ?

Thank you in advance for your time.

Best regards
Romain
________________________________
Romain Crausaz

Development

DIGI SENS Switzerland AG
Freiburgstr. 65
CH-3280 Murten

Telefon: +41 26 672 9876
Email:     [hidden email]<mailto:[hidden email]>

[cid:digisens_34df8dfe-0639-4acb-9e8d-0efd75e7b3a8.png]
www.digisens.ch<http://www.digisens.ch>



digisens_34df8dfe-0639-4acb-9e8d-0efd75e7b3a8.png (5K) Download Attachment
0002-rpi_cm3_digisens_defconfig.patch (1K) Download Attachment
0004-digisens-dtb.patch (4K) Download Attachment