* [Buildroot] PATCH Working config for Raspberry PI 3 in aarch64 mode
[not found] <a17fc93a-ff61-1093-b28e-45043a696a83@t-online.de>
@ 2016-10-27 19:48 ` Maik Scholz
2016-10-27 20:01 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Maik Scholz @ 2016-10-27 19:48 UTC (permalink / raw)
To: buildroot
Test with:
patch -p1 <
../../buildroot_aarch64/outgoing/0001-rpi3-aarch64-defconfig.patch
make raspberrypi3_aarch64_defconfig
make
dd if=output/images/sdcard.img of=/dev/sdc bs=1024
From 361ad2e2087c0a4675d8222604cb20b648611e2b Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Thu, 27 Oct 2016 20:27:12 +0200
Subject: [PATCH 1/1] -
Signed-off-by: Your Name <you@example.com>
---
.../raspberrypi/genimage-raspberrypi3-aarch64.cfg | 31
++++++++++++++++++++++
board/raspberrypi/post-image-aarch64.sh | 23 ++++++++++++++++
configs/raspberrypi3_aarch64_defconfig | 20 ++++++++++++++
package/rpi-firmware/Config.in | 2 +-
package/rpi-firmware/rpi-firmware.hash | 1 +
package/rpi-firmware/rpi-firmware.mk | 3 ++-
6 files changed, 78 insertions(+), 2 deletions(-)
create mode 100644 board/raspberrypi/genimage-raspberrypi3-aarch64.cfg
create mode 100755 board/raspberrypi/post-image-aarch64.sh
create mode 100644 configs/raspberrypi3_aarch64_defconfig
diff --git a/board/raspberrypi/genimage-raspberrypi3-aarch64.cfg
b/board/raspberrypi/genimage-raspberrypi3-aarch64.cfg
new file mode 100644
index 0000000..4168eb4
--- /dev/null
+++ b/board/raspberrypi/genimage-raspberrypi3-aarch64.cfg
@@ -0,0 +1,31 @@
+image boot.vfat {
+ vfat {
+ files = {
+ "bcm2710-rpi-3-b.dtb",
+ "rpi-firmware/bootcode.bin",
+ "rpi-firmware/cmdline.txt",
+ "rpi-firmware/config.txt",
+ "rpi-firmware/fixup.dat",
+ "rpi-firmware/start.elf",
+ "rpi-firmware/overlays",
+ "kernel8.img"
+ }
+ }
+ size = 32M
+}
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition boot {
+ partition-type = 0xC
+ bootable = "true"
+ image = "boot.vfat"
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ }
+}
diff --git a/board/raspberrypi/post-image-aarch64.sh
b/board/raspberrypi/post-image-aarch64.sh
new file mode 100755
index 0000000..efb6723
--- /dev/null
+++ b/board/raspberrypi/post-image-aarch64.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+BOARD_NAME="$(basename ${BOARD_DIR})"
+GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}-aarch64.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+# copy Image to kernel8.img
+cp ${BINARIES_DIR}/Image ${BINARIES_DIR}/kernel8.img
+
+echo "add arm_64bit=1 in ${BINARIES_DIR}/rpi-firmware/config.txt"
+grep -v '^kernel=' output/images/rpi-firmware/config.txt | grep -v
'^arm_64bit=' | cat > ${BINARIES_DIR}/rpi-firmware/config.txt
+echo "arm_64bit=1" >> ${BINARIES_DIR}/rpi-firmware/config.txt
+
+genimage \
+ --rootpath "${TARGET_DIR}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
+
+exit $?
diff --git a/configs/raspberrypi3_aarch64_defconfig
b/configs/raspberrypi3_aarch64_defconfig
new file mode 100644
index 0000000..af273fe
--- /dev/null
+++ b/configs/raspberrypi3_aarch64_defconfig
@@ -0,0 +1,20 @@
+BR2_aarch64=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_SYSTEM_DHCP="eth0"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image-aarch64.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="4bed59909b28ded144d99a6aaa165ac7b89d3eb7"
+BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi3"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2710-rpi-3-b"
+BR2_PACKAGE_RPI_FIRMWARE=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/package/rpi-firmware/Config.in b/package/rpi-firmware/Config.in
index c2983aa..7b37a30 100644
--- a/package/rpi-firmware/Config.in
+++ b/package/rpi-firmware/Config.in
@@ -1,6 +1,6 @@
config BR2_PACKAGE_RPI_FIRMWARE
bool "rpi-firmware"
- depends on BR2_arm
+ depends on BR2_arm || BR2_aarch64
help
RaspberryPi Firmware
Pre-compiled binaries of the current bootloader and GPU firmware
diff --git a/package/rpi-firmware/rpi-firmware.hash
b/package/rpi-firmware/rpi-firmware.hash
index 6dd2163..5758b28 100644
--- a/package/rpi-firmware/rpi-firmware.hash
+++ b/package/rpi-firmware/rpi-firmware.hash
@@ -1,2 +1,3 @@
# Locally computed
sha256
f7b649ac837a4a9c12a8f96962da310ca4efd6658621d89286b421b8784a4980
rpi-firmware-ad8608c08b122b2c228dba0ff5070d6e9519faf5.tar.gz
+sha256 ca5f11da6cbf677a871c0282f3a0dddf2f2d9f22216c9660bcf4d7ce4d2a5376
rpi-firmware-ec5a517ed6051974a5a09f7b7811d21c443a7c74.tar.gz
diff --git a/package/rpi-firmware/rpi-firmware.mk
b/package/rpi-firmware/rpi-firmware.mk
index bf5c9dd..b460f75 100644
--- a/package/rpi-firmware/rpi-firmware.mk
+++ b/package/rpi-firmware/rpi-firmware.mk
@@ -4,7 +4,8 @@
#
################################################################################
-RPI_FIRMWARE_VERSION = ad8608c08b122b2c228dba0ff5070d6e9519faf5
+#RPI_FIRMWARE_VERSION = ad8608c08b122b2c228dba0ff5070d6e9519faf5
+RPI_FIRMWARE_VERSION = ec5a517ed6051974a5a09f7b7811d21c443a7c74
RPI_FIRMWARE_SITE = $(call
github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION))
RPI_FIRMWARE_LICENSE = BSD-3c
RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] PATCH Working config for Raspberry PI 3 in aarch64 mode
2016-10-27 19:48 ` [Buildroot] PATCH Working config for Raspberry PI 3 in aarch64 mode Maik Scholz
@ 2016-10-27 20:01 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-10-27 20:01 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 27 Oct 2016 21:48:51 +0200, Maik Scholz wrote:
> patch -p1 <
> ../../buildroot_aarch64/outgoing/0001-rpi3-aarch64-defconfig.patch
> make raspberrypi3_aarch64_defconfig
> make
> dd if=output/images/sdcard.img of=/dev/sdc bs=1024
Thanks for your patch, but please send your patches with "git
send-email", as explained in the Buildroot documentation. Your patch
has been badly rewrapped by your mail client, and therefore it cannot
be applied.
>
> From 361ad2e2087c0a4675d8222604cb20b648611e2b Mon Sep 17 00:00:00 2001
> From: Your Name <you@example.com>
Please make sure to use a real name here.
> Date: Thu, 27 Oct 2016 20:27:12 +0200
> Subject: [PATCH 1/1] -
Please include a proper commit title and commit log.
>
> Signed-off-by: Your Name <you@example.com>
And your real name here as well.
> diff --git a/board/raspberrypi/genimage-raspberrypi3-aarch64.cfg
> b/board/raspberrypi/genimage-raspberrypi3-aarch64.cfg
> new file mode 100644
> index 0000000..4168eb4
> --- /dev/null
> +++ b/board/raspberrypi/genimage-raspberrypi3-aarch64.cfg
> @@ -0,0 +1,31 @@
> +image boot.vfat {
> + vfat {
> + files = {
> + "bcm2710-rpi-3-b.dtb",
> + "rpi-firmware/bootcode.bin",
> + "rpi-firmware/cmdline.txt",
> + "rpi-firmware/config.txt",
> + "rpi-firmware/fixup.dat",
> + "rpi-firmware/start.elf",
> + "rpi-firmware/overlays",
> + "kernel8.img"
> + }
> + }
> + size = 32M
> +}
> +
> +image sdcard.img {
> + hdimage {
> + }
> +
> + partition boot {
> + partition-type = 0xC
> + bootable = "true"
> + image = "boot.vfat"
> + }
> +
> + partition rootfs {
> + partition-type = 0x83
> + image = "rootfs.ext4"
> + }
> +}
Can we re-use board/raspberrypi/genimage-raspberrypi3.cfg somehow? Or
does the kernel image absolutely needs to be called kernel8.img in the
FAT partition ?
Generally speaking, do we need to keep the 32 bit support for the
RaspberryPi 3 ?
> +rm -rf "${GENIMAGE_TMP}"
> +# copy Image to kernel8.img
This comment is useless, as it just says what the following command is
doing. Instead replace it with a comment that says *why* you are doing
this.
> +cp ${BINARIES_DIR}/Image ${BINARIES_DIR}/kernel8.img
> +
> +echo "add arm_64bit=1 in ${BINARIES_DIR}/rpi-firmware/config.txt"
Useless echo.
> +grep -v '^kernel=' output/images/rpi-firmware/config.txt | grep -v
> '^arm_64bit=' | cat > ${BINARIES_DIR}/rpi-firmware/config.txt
You're hardcoding output/images/ here, that's not good. If I understand
correctly, you are removing the kernel= and arm_64bit= lines, correct?
What is re-adding the kernel= line?
> diff --git a/configs/raspberrypi3_aarch64_defconfig
> b/configs/raspberrypi3_aarch64_defconfig
> new file mode 100644
> index 0000000..af273fe
> --- /dev/null
> +++ b/configs/raspberrypi3_aarch64_defconfig
> @@ -0,0 +1,20 @@
> +BR2_aarch64=y
> +BR2_TOOLCHAIN_BUILDROOT_CXX=y
Please leave it as the default, i.e don't enable C++ support.
> diff --git a/package/rpi-firmware/Config.in b/package/rpi-firmware/Config.in
> index c2983aa..7b37a30 100644
> --- a/package/rpi-firmware/Config.in
> +++ b/package/rpi-firmware/Config.in
The change to the rpi-firmware package should be in a separate patch.
> -RPI_FIRMWARE_VERSION = ad8608c08b122b2c228dba0ff5070d6e9519faf5
> +#RPI_FIRMWARE_VERSION = ad8608c08b122b2c228dba0ff5070d6e9519faf5
Please don't keep commented code.
Could you fix the above issues and submit an updated version?
Thanks a lot!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-27 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <a17fc93a-ff61-1093-b28e-45043a696a83@t-online.de>
2016-10-27 19:48 ` [Buildroot] PATCH Working config for Raspberry PI 3 in aarch64 mode Maik Scholz
2016-10-27 20:01 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox