public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] RK3399 NanoPI-M4 boot issues
@ 2019-10-25  9:02 robert
  2019-10-26 10:25 ` Jagan Teki
  0 siblings, 1 reply; 2+ messages in thread
From: robert @ 2019-10-25  9:02 UTC (permalink / raw)
  To: u-boot

I'm trying to build a linux from source on a RK3399 nanopi-m4. I did the
below steps:
 
*###  Download and compile ARM-TF ###
*$ git clone https://github.com/ARM-software/arm-trusted-firmware.git
$ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
 
*### Download and complie U-Boot ###
*$ cd ..
$ git clone https://gitlab.denx.de/u-boot/u-boot.git
$ cd u-boot/
$ git checkout v2019.10
$ make CROSS_COMPILE=arm-linux-gnueabi- nanopi-m4-rk3399_defconfig
$ cp ../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf .
$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-
$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- u-boot.itb
$ ./tools/mkimage -n rk3399 -T rksd -d ./tpl/u-boot-tpl-dtb.bin
idbloader.img
Image Type:   Rockchip RK33 (SD/MMC) boot image
Data Size:    47104 bytes
$ cat spl/u-boot-spl-dtb.bin >> idbloader.img
 
*### Build kernel ###
*$ git
clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ cd linux
$ git checkout v5.1

**I've used the arm64 defconfig ***
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
$ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64
 
*### Create boot.img ###
*$ cd ..
$ mkdir boot
$ cp linux/arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4.dtb boot/
$ cp arch/arm64/boot/Image boot/
$ cp linux/arch/arm64/boot/Image boot/
$ mkdir boot/extlinux
$ nano boot/extlinux/extlinux.conf
 
label NanoPi M4 5.1
  kernel /boot/Image
  devicetree /boot/rk3399-nanopi-m4.dtb
  append earlycon=uart8250,mmio32,0xff1a0000 root=/dev/mmcblk1p1 rootwait
 
$ dd if=/dev/zero of=boot.img bs=1M count=32
$ sudo mkfs.fat boot.img
$ mkdir tmp
$ sudo mount boot.img tmp/
$ cp -r boot/* tmp/
$ umount tmp
 
*** copy the images to a folder ***
$ mkdir images
$ cp boot.img images/ 
$ cp u-boot/idbloader.img images/
$ cp u-boot/u-boot.itb images/
 
*### Create sd card image ###
*$ cd images/

*** I'm using a VM so it was easier to use a loop device to create the image
***
$ dd if=/dev/zero of=sdcard.img bs=1024 count=0 seek=400000 || exit 1
$ sudo losetup -f
/dev/loop18
$ sudo losetup /dev/loop18 sdcard.img 
$ sudo dd if=idbloader.img of=/dev/loop18 seek=64
$ sudo dd if=u-boot.itb of=/dev/loop18 seek=16384
$ sudo dd if=boot.img of=/dev/loop18 seek=32768
$ sync

Flush the image(sdcard.img) with etcher to a card and place the card in the
board.
Plug the UART cable and power on the board. I receive the below message:
*/U-Boot TPL board init
sdram_init: data training failed
rk3399_dmc_init DRAM init failed -5/*
 
I'm not sure what am I doing wrong.
Can someone help me with this?




--
Sent from: http://u-boot.10912.n7.nabble.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] RK3399 NanoPI-M4 boot issues
  2019-10-25  9:02 [U-Boot] RK3399 NanoPI-M4 boot issues robert
@ 2019-10-26 10:25 ` Jagan Teki
  0 siblings, 0 replies; 2+ messages in thread
From: Jagan Teki @ 2019-10-26 10:25 UTC (permalink / raw)
  To: u-boot

On Fri, Oct 25, 2019 at 5:02 PM robert <c.robert.gabriel@gmail.com> wrote:
>
> I'm trying to build a linux from source on a RK3399 nanopi-m4. I did the
> below steps:
>
> *###  Download and compile ARM-TF ###
> *$ git clone https://github.com/ARM-software/arm-trusted-firmware.git
> $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
>
> *### Download and complie U-Boot ###
> *$ cd ..
> $ git clone https://gitlab.denx.de/u-boot/u-boot.git
> $ cd u-boot/
> $ git checkout v2019.10
> $ make CROSS_COMPILE=arm-linux-gnueabi- nanopi-m4-rk3399_defconfig
> $ cp ../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf .
> $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-
> $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- u-boot.itb
> $ ./tools/mkimage -n rk3399 -T rksd -d ./tpl/u-boot-tpl-dtb.bin
> idbloader.img
> Image Type:   Rockchip RK33 (SD/MMC) boot image
> Data Size:    47104 bytes
> $ cat spl/u-boot-spl-dtb.bin >> idbloader.img

You missed to set BL31 for bl31.elf and toolchain would be arm64 for u-boot.

Flashing:
./tools/mkimage -n rk3399 -T rksd -d ./tpl/u-boot-tpl-dtb.bin out
cat ./spl/u-boot-spl-dtb.bin >> out
sudo dd if=out of=/dev/sda seek=64;
sudo dd if=u-boot.itb  of=/dev/sda seek=16384

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-26 10:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-25  9:02 [U-Boot] RK3399 NanoPI-M4 boot issues robert
2019-10-26 10:25 ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox