<div dir="ltr"><div dir="ltr">Hi Thomas,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2020 at 4:05 AM <<a href="mailto:sunil@amarulasolutions.com">sunil@amarulasolutions.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Suniel Mahesh <<a href="mailto:sunil@amarulasolutions.com" target="_blank">sunil@amarulasolutions.com</a>><br>
<br>
A defconfig for the rockpro64 was added in<br>
59e1077b4ebe79622a454b0a8a840e4349a0440d, but then removed<br>
in 10f49213b7e2837ae6ed63fc16fbdaa954ecd87f because an ARM32<br>
compiler was needed to build ATF, and this was not supported<br>
back then.<br>
<br>
Now, since package/arm-gnu-a-toolchain/ has been added, this<br>
defconfig can be re-introduced.<br>
<br>
Following new changes are introduced in comparision with the<br>
older changeset:<br>
<br>
    - renamed defconfig from pine64_rockpro64 to rockpro64<br>
    - updated readme<br>
    - using a GPT partition layout<br>
    - update defconfig to build ATF<br>
    - bump u-boot to 2020.04<br>
    - bump linux to 5.4.35<br>
<br>
Signed-off-by: Suniel Mahesh <<a href="mailto:sunil@amarulasolutions.com" target="_blank">sunil@amarulasolutions.com</a>><br>
---<br>
 .gitlab-ci.yml                       |  1 +<br>
 DEVELOPERS                           |  2 ++<br>
 board/pine64/rockpro64/extlinux.conf |  4 +++<br>
 board/pine64/rockpro64/genimage.cfg  | 39 ++++++++++++++++++++++++<br>
 board/pine64/rockpro64/post-build.sh |  5 ++++<br>
 board/pine64/rockpro64/readme.txt    | 58 ++++++++++++++++++++++++++++++++++++<br>
 configs/rockpro64_defconfig          | 56 ++++++++++++++++++++++++++++++++++<br>
 7 files changed, 165 insertions(+)<br>
 create mode 100644 board/pine64/rockpro64/extlinux.conf<br>
 create mode 100644 board/pine64/rockpro64/genimage.cfg<br>
 create mode 100755 board/pine64/rockpro64/post-build.sh<br>
 create mode 100644 board/pine64/rockpro64/readme.txt<br>
 create mode 100644 configs/rockpro64_defconfig<br>
<br>
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml<br>
index fa8e077..32c3247 100644<br>
--- a/.gitlab-ci.yml<br>
+++ b/.gitlab-ci.yml<br>
@@ -318,6 +318,7 @@ raspberrypi_defconfig: { extends: .defconfig }<br>
 riotboard_defconfig: { extends: .defconfig }<br>
 roc_pc_rk3399_defconfig: { extends: .defconfig }<br>
 rock64_defconfig: { extends: .defconfig }<br>
+rockpro64_defconfig: { extends: .defconfig }<br>
 roseapplepi_defconfig: { extends: .defconfig }<br>
 s6lx9_microboard_defconfig: { extends: .defconfig }<br>
 sheevaplug_defconfig: { extends: .defconfig }<br>
diff --git a/DEVELOPERS b/DEVELOPERS<br>
index cc72b28..8e58053 100644<br>
--- a/DEVELOPERS<br>
+++ b/DEVELOPERS<br>
@@ -2425,7 +2425,9 @@ F:        package/powertop/<br>
<br>
 N:     Suniel Mahesh <<a href="mailto:sunil@amarulasolutions.com" target="_blank">sunil@amarulasolutions.com</a>><br>
 F:     board/firefly/<br>
+F:     board/pine64/<br>
 F:     configs/roc_pc_rk3399_defconfig<br>
+F:     configs/rockpro64_defconfig<br>
 F:     package/arm-gnu-a-toolchain/<br>
<br>
 N:     Sven Haardiek <<a href="mailto:sven.haardiek@iotec-gmbh.de" target="_blank">sven.haardiek@iotec-gmbh.de</a>><br>
diff --git a/board/pine64/rockpro64/extlinux.conf b/board/pine64/rockpro64/extlinux.conf<br>
new file mode 100644<br>
index 0000000..ea081a1<br>
--- /dev/null<br>
+++ b/board/pine64/rockpro64/extlinux.conf<br>
@@ -0,0 +1,4 @@<br>
+label RK3399_ROCKPRO64 linux<br>
+  kernel /Image<br>
+  devicetree /rk3399-rockpro64.dtb<br>
+  append earlycon=uart8250,mmio32,0xff1a0000 root=/dev/mmcblk0p4 rw rootwait<br>
diff --git a/board/pine64/rockpro64/genimage.cfg b/board/pine64/rockpro64/genimage.cfg<br>
new file mode 100644<br>
index 0000000..41358ed<br>
--- /dev/null<br>
+++ b/board/pine64/rockpro64/genimage.cfg<br>
@@ -0,0 +1,39 @@<br>
+image boot.vfat {<br>
+       vfat {<br>
+               files = {<br>
+                       "Image",<br>
+                       "rk3399-rockpro64.dtb",<br>
+                       "extlinux"<br>
+               }<br>
+       }<br>
+       size = 112M<br>
+}<br>
+<br>
+image sdcard.img {<br>
+<br>
+       hdimage {<br>
+               gpt = true<br>
+       }<br>
+<br>
+       partition loader1 {<br>
+               image = "idbloader.img"<br>
+               offset = 32K<br>
+       }<br>
+<br>
+       partition loader2 {<br>
+               image = "u-boot.itb"<br>
+               offset = 8M<br>
+       }<br>
+<br>
+       partition boot {<br>
+               partition-type = 0xC<br>
+               bootable = "true"<br>
+               image = "boot.vfat"<br>
+               offset = 16M<br>
+       }<br>
+<br>
+       partition rootfs {<br>
+               partition-type = 0x83<br>
+               image = "rootfs.ext4"<br>
+       }<br>
+}<br>
diff --git a/board/pine64/rockpro64/post-build.sh b/board/pine64/rockpro64/post-build.sh<br>
new file mode 100755<br>
index 0000000..ba29375<br>
--- /dev/null<br>
+++ b/board/pine64/rockpro64/post-build.sh<br>
@@ -0,0 +1,5 @@<br>
+#!/bin/sh<br>
+<br>
+BOARD_DIR="$(dirname $0)"<br>
+<br>
+install -m 0644 -D $BOARD_DIR/extlinux.conf $BINARIES_DIR/extlinux/extlinux.conf<br>
diff --git a/board/pine64/rockpro64/readme.txt b/board/pine64/rockpro64/readme.txt<br>
new file mode 100644<br>
index 0000000..bfb7dbf<br>
--- /dev/null<br>
+++ b/board/pine64/rockpro64/readme.txt<br>
@@ -0,0 +1,58 @@<br>
+PINE64 ROCKPro64<br>
+================<br>
+<a href="https://www.pine64.org/rockpro64/" rel="noreferrer" target="_blank">https://www.pine64.org/rockpro64/</a><br>
+<br>
+Build:<br>
+======<br>
+  $ make rockpro64_defconfig<br>
+  $ make<br>
+<br>
+Files created in output directory<br>
+=================================<br>
+<br>
+output/images<br>
+<br>
+├── bl31.elf<br>
+├── boot.vfat<br>
+├── extlinux<br>
+├── idbloader.img<br>
+├── Image<br>
+├── rk3399-rockpro64.dtb<br>
+├── rootfs.ext2<br>
+├── rootfs.ext4 -> rootfs.ext2<br>
+├── rootfs.tar<br>
+├── sdcard.img<br>
+├── u-boot.bin<br>
+└── u-boot.itb<br>
+<br>
+Creating bootable SD card:<br>
+==========================<br>
+<br>
+Simply invoke (as root)<br>
+<br>
+sudo dd if=output/images/sdcard.img of=/dev/sdX && sync<br>
+<br>
+Where X is your SD card device.<br>
+<br>
+Booting:<br>
+========<br>
+RockPro64 has a 40-pin PI-2 GPIO Bus.<br>
+<br>
+Connect a jumper between pin 23 and pin 25 for SD card boot.<br>
+<br>
+Serial console:<br>
+---------------<br>
+The pin layout for serial console on PI-2 GPIO Bus is as follows:<br>
+<br>
+pin 6:  gnd<br>
+pin 8:  tx<br>
+pin 10: rx<br>
+<br>
+Initially connect pin 6 and pin 8(transmit). Apply power to RockPro64, once the <br>
+power is on then connect pin 10(receive).<br>
+<br>
+Baudrate for this board is 1500000.<br>
+<br>
+Login:<br>
+------<br>
+Enter 'root' as login user, and the prompt is ready.<br>
diff --git a/configs/rockpro64_defconfig b/configs/rockpro64_defconfig<br>
new file mode 100644<br>
index 0000000..9dd3b7c<br>
--- /dev/null<br>
+++ b/configs/rockpro64_defconfig<br>
@@ -0,0 +1,56 @@<br>
+# Architecture<br>
+BR2_aarch64=y<br>
+BR2_cortex_a72_a53=y<br>
+<br>
+# Linux headers same as kernel, a 5.4 series<br>
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_4=y<br>
+<br>
+# Firmware<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="<a href="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git" rel="noreferrer" target="_blank">https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git</a>"<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="11a0a46a899fcc3b1fdb214b382f3d7495d88eca"<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3399"<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN=y<br>
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES=""<br>
+<br>
+# Bootloader<br>
+BR2_TARGET_UBOOT=y<br>
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y<br>
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y<br>
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.04"<br>
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="rockpro64-rk3399"<br>
+BR2_TARGET_UBOOT_NEEDS_DTC=y<br>
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y<br>
+BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y<br></blockquote><div><br></div><div>I will test this as well based on your comments:</div><div><a href="http://patchwork.ozlabs.org/project/buildroot/patch/1588444408-20285-1-git-send-email-sunil@amarulasolutions.com/">http://patchwork.ozlabs.org/project/buildroot/patch/1588444408-20285-1-git-send-email-sunil@amarulasolutions.com/</a></div><div><br></div><div>Thanks</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y<br>
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y<br>
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y<br>
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"<br>
+BR2_TARGET_UBOOT_SPL=y<br>
+BR2_TARGET_UBOOT_SPL_NAME="idbloader.img"<br>
+<br>
+# Kernel<br>
+BR2_LINUX_KERNEL=y<br>
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y<br>
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.4.35"<br>
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y<br>
+BR2_LINUX_KERNEL_DTS_SUPPORT=y<br>
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3399-rockpro64"<br>
+BR2_LINUX_KERNEL_INSTALL_TARGET=y<br>
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y<br>
+<br>
+# Filesystem<br>
+BR2_TARGET_GENERIC_HOSTNAME="rockpro64"<br>
+BR2_TARGET_GENERIC_ISSUE="Welcome to ROCKPRO64"<br>
+BR2_TARGET_ROOTFS_EXT2=y<br>
+BR2_TARGET_ROOTFS_EXT2_4=y<br>
+BR2_TARGET_ROOTFS_EXT2_SIZE="64M"<br>
+BR2_PACKAGE_HOST_DOSFSTOOLS=y<br>
+BR2_PACKAGE_HOST_GENIMAGE=y<br>
+BR2_PACKAGE_HOST_MTOOLS=y<br>
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y<br>
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"<br>
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/pine64/rockpro64/genimage.cfg"<br>
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/pine64/rockpro64/post-build.sh"<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div></div>