From: Ubaldo Porcheddu <ubaldo@eja.it>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Preliminary support for Raspberry Pi 3.
Date: Wed, 20 Apr 2016 11:04:00 +0000 [thread overview]
Message-ID: <1461150240-23107-1-git-send-email-ubaldo@eja.it> (raw)
Signed-off-by: Ubaldo Porcheddu <ubaldo@eja.it>
---
board/raspberrypi3/genimage-raspberrypi3.cfg | 30 +++++++++++++
board/raspberrypi3/post-build.sh | 9 ++++
board/raspberrypi3/post-image.sh | 22 ++++++++++
board/raspberrypi3/readme.txt | 64 ++++++++++++++++++++++++++++
configs/raspberrypi3_defconfig | 36 ++++++++++++++++
5 files changed, 161 insertions(+)
create mode 100644 board/raspberrypi3/genimage-raspberrypi3.cfg
create mode 100755 board/raspberrypi3/post-build.sh
create mode 100755 board/raspberrypi3/post-image.sh
create mode 100644 board/raspberrypi3/readme.txt
create mode 100644 configs/raspberrypi3_defconfig
diff --git a/board/raspberrypi3/genimage-raspberrypi3.cfg b/board/raspberrypi3/genimage-raspberrypi3.cfg
new file mode 100644
index 0000000..7ba89c5
--- /dev/null
+++ b/board/raspberrypi3/genimage-raspberrypi3.cfg
@@ -0,0 +1,30 @@
+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",
+ "kernel-marked/zImage"
+ }
+ }
+ 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/raspberrypi3/post-build.sh b/board/raspberrypi3/post-build.sh
new file mode 100755
index 0000000..7eae14a
--- /dev/null
+++ b/board/raspberrypi3/post-build.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -u
+set -e
+
+# Add a console on tty1
+grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
+sed -i '/GENERIC_SERIAL/a\
+tty1::respawn:/sbin/getty -L tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
diff --git a/board/raspberrypi3/post-image.sh b/board/raspberrypi3/post-image.sh
new file mode 100755
index 0000000..73ffd65
--- /dev/null
+++ b/board/raspberrypi3/post-image.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+BOARD_NAME="$(basename ${BOARD_DIR})"
+GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+# Mark the kernel as DT-enabled
+mkdir -p "${BINARIES_DIR}/kernel-marked"
+${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \
+ "${BINARIES_DIR}/kernel-marked/zImage"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+ --rootpath "${TARGET_DIR}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
+
+exit $?
diff --git a/board/raspberrypi3/readme.txt b/board/raspberrypi3/readme.txt
new file mode 100644
index 0000000..dcbcffd
--- /dev/null
+++ b/board/raspberrypi3/readme.txt
@@ -0,0 +1,64 @@
+Raspberry Pi
+
+Intro
+=====
+
+These instructions apply to Raspberry Pi 3 version B.
+
+How to build it
+===============
+
+Configure Buildroot
+-------------------
+
+
+ $ make raspberrypi3_defconfig
+
+
+Build the rootfs
+----------------
+
+Note: you will need to have access to the network, since Buildroot will
+download the packages' sources.
+
+You may now build your rootfs with:
+
+ $ make
+
+(This may take a while, consider getting yourself a coffee ;-) )
+
+Result of the build
+-------------------
+
+After building, you should obtain this tree:
+
+ output/images/
+ +-- bcm2710-rpi-3-b.dtb
+ +-- boot.vfat
+ +-- kernel-marked/zImage [1]
+ +-- rootfs.ext4
+ +-- rpi-firmware/
+ | +-- bootcode.bin
+ | +-- cmdline.txt
+ | +-- config.txt
+ | +-- fixup.dat
+ | `-- start.elf
+ +-- sdcard.img
+ `-- zImage
+
+[1] This is the mkknlimg DT-marked kernel.
+
+How to write the SD card
+========================
+
+Once the build process is finished you will have an image called "sdcard.img"
+in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card with "dd":
+
+ $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Insert the SDcard into your Raspberry Pi, and power it up. Your new system
+should come up now and start two consoles: one on the serial port on
+the P1 header, one on the HDMI output where you can login using a USB
+keyboard.
diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig
new file mode 100644
index 0000000..80ce908
--- /dev/null
+++ b/configs/raspberrypi3_defconfig
@@ -0,0 +1,36 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_ARM_EABIHF=y
+BR2_ARM_FPU_NEON_VFPV4=y
+
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+
+BR2_SYSTEM_DHCP="eth0"
+
+# Linux headers same as kernel, a 4.1 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_1=y
+
+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="20fe468af4bb40fec0f81753da4b20a8bfc259c9"
+BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
+
+# Build the DTB from the kernel sources
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b"
+
+BR2_PACKAGE_RPI_FIRMWARE=y
+# BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
+# Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh"
--
1.9.1
next reply other threads:[~2016-04-20 11:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 11:04 Ubaldo Porcheddu [this message]
2016-04-22 15:01 ` [Buildroot] [PATCH 1/1] Preliminary support for Raspberry Pi 3 Benoît Allard
2016-04-22 20:25 ` Peter Korsgaard
2016-04-22 20:18 ` Peter Korsgaard
2016-04-22 20:25 ` Thomas Petazzoni
2016-04-22 20:38 ` Peter Korsgaard
2016-04-22 20:41 ` Thomas Petazzoni
2016-04-22 21:22 ` Peter Korsgaard
-- strict thread matches above, loose matches on Subject: below --
2016-04-23 17:02 ubaldo porcheddu
[not found] <571baa9a.a6dec20a.5b3db.ffffd33eSMTPIN_ADDED_MISSING@mx.google.com>
2016-04-23 17:19 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461150240-23107-1-git-send-email-ubaldo@eja.it \
--to=ubaldo@eja.it \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox