Patchwork [2/2] configs: add RaspberryPi defconfig

login
register
mail settings
Submitter Maxime Hadjinlian
Date Jan. 13, 2013, 2:23 p.m.
Message ID <1358087034-2706-2-git-send-email-maxime.hadjinlian@gmail.com>
Download mbox | patch
Permalink /patch/211624/
State Superseded
Headers show

Comments

Maxime Hadjinlian - Jan. 13, 2013, 2:23 p.m.
This is a default configuration for the RaspberryPi, tested and functionnal.

The kernel used is the one developped by the RaspberryPi foundation as it's not
fully supported currently in mainline kernel.
The configuration used for the kernel is the default bcmrpi.

For more info, please find board/raspberrypi/README.txt

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
---
 board/raspberrypi/README.txt |  127 ++++++++++++++++++++++++++++++++++++++++++
 configs/rpi_defconfig        |   19 +++++++
 2 files changed, 146 insertions(+)
 create mode 100644 board/raspberrypi/README.txt
 create mode 100644 configs/rpi_defconfig
Samuel Martin - Jan. 13, 2013, 4:17 p.m.
Hi maxime, all,

2013/1/13 Maxime Hadjinlian <maxime.hadjinlian@gmail.com>:
> This is a default configuration for the RaspberryPi, tested and functionnal.
>
> The kernel used is the one developped by the RaspberryPi foundation as it's not
> fully supported currently in mainline kernel.
> The configuration used for the kernel is the default bcmrpi.
>
> For more info, please find board/raspberrypi/README.txt
>
> Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>

Regards,
Maxime Hadjinlian - March 22, 2013, 12:06 p.m.
ping ?

On Sun, Jan 13, 2013 at 5:17 PM, Samuel Martin <s.martin49@gmail.com> wrote:
> Hi maxime, all,
>
> 2013/1/13 Maxime Hadjinlian <maxime.hadjinlian@gmail.com>:
>> This is a default configuration for the RaspberryPi, tested and functionnal.
>>
>> The kernel used is the one developped by the RaspberryPi foundation as it's not
>> fully supported currently in mainline kernel.
>> The configuration used for the kernel is the default bcmrpi.
>>
>> For more info, please find board/raspberrypi/README.txt
>>
>> Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
> Acked-by: Samuel Martin <s.martin49@gmail.com>
>
> Regards,
>
> --
> Samuel
Thomas Petazzoni - March 22, 2013, 12:58 p.m.
Dear Maxime Hadjinlian,

On Sun, 13 Jan 2013 15:23:54 +0100, Maxime Hadjinlian wrote:
> diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
> new file mode 100644
> index 0000000..8c73d0e
> --- /dev/null
> +++ b/configs/rpi_defconfig
> @@ -0,0 +1,19 @@
> +BR2_arm=y
> +BR2_arm1176jzf_s=y
> +
> +BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
> +BR2_TOOLCHAIN_BUILDROOT_CXX=y

Please add:

# Lock to 3.8 headers to avoid breaking with newer kernels
BR2_KERNEL_HEADERS_3_8=y

Thanks,

Thomas
Vivien Didelot - March 25, 2013, 4:33 a.m.
Hi,

Minor comments below.

> For more info, please find board/raspberrypi/README.txt

If the defconfig filename is rpi_defconfig, shouldn't the board
directory be called board/rpi for consistency?


> +++ b/board/raspberrypi/README.txt

The patchs adds a whitespace error:

Applying: configs: add RaspberryPi defconfig
/home/vivien/projects/buildroot/.git/rebase-apply/patch:140: new blank line at EOF.
+
warning: 1 line adds whitespace errors


> +What is generated
> +-----------------
> +
> +After building, you should obtain this tree:
> +
> +    output/images/
> +    +-- rootfs.tar
> +    +-- rpi-firmware
> +    |   +-- bootcode.bin
> +    |   +-- config.txt
> +    |   +-- fixup_cd.dat
> +    |   +-- fixup.dat
> +    |   +-- start_cd.elf
> +    |   `-- start.elf
> +    `-- zImage
> +
> +Note : rootfs.tar will only be there if you kept "tar the root
> filesystem"
> +option selected in "Filesystem images".
> +
> +Where should the binaries be copied on the SDCard
> +-------------------------------------------------
> +
> +Your SDCard must have its first partition using fat32 and with
> bootable flags.
> +
> +At the root of the partition, the RaspberryPi must find the
> following files:
> +
> + * bootcode.bin
> + * config.txt
> + * fixup_cd.dat
> + * fixup.dat
> + * start_cd.elf
> + * start.elf
> + * zImage
> +
> +So you should, copy the entire content of output/images/rpi-firmware
> along with
> +zImage.
> +
> +Note : You can create any number of partitions you desire, the only
> requirement
> +is that the first partition must be using fat32.
> +
> +Persistent rootfs
> +==================
> +
> +How to build it
> +---------------
> +
> +You only need to use the rpi_defconfig, to do so:
> + * make rpi_defconfig
> +
> +What is generated
> +-----------------
> +
> +After building, you should obtain this tree:
> +
> +    output/images/
> +    +-- rootfs.tar
> +    +-- rpi-firmware
> +    |   +-- bootcode.bin
> +    |   +-- config.txt
> +    |   +-- fixup_cd.dat
> +    |   +-- fixup.dat
> +    |   +-- start_cd.elf
> +    |   `-- start.elf
> +    `-- zImage
> +
> +Where should the binaries be copied on the SDCard
> +-------------------------------------------------
> +
> +Your SDCard must have its first partition using fat32 and with
> bootable flags.
> +It should also have another partition which will contain your
> rootfs, it should
> +be partitioned as ext4.

I don't think ext4 is a requirement here, ext2 also works well.

> +
> +Boot partition
> +~~~~~~~~~~~~
> +
> +The first partition will contain everything used to boot the
> RaspberryPi.
> +You must copy theses files at the root of partition:
> +
> + * bootcode.bin
> + * config.txt
> + * fixup_cd.dat
> + * fixup.dat
> + * start_cd.elf
> + * start.elf
> + * zImage

The information in the README file is a bit redundant (especially
commands, output/images and 3rd party files listings). It could be
more concise, with just a note at the end for the non-persistent
config (with initramfs).


It may also be nice to have a simple script to create the sdcard
in the board directory, such as the one provided by OpenELEC:

https://github.com/OpenELEC/OpenELEC.tv/blob/master/packages/tools/bcm2835-bootloader/files/create_sdcard

What do you think?

Cheers,
Vivien

Patch

diff --git a/board/raspberrypi/README.txt b/board/raspberrypi/README.txt
new file mode 100644
index 0000000..9825d92
--- /dev/null
+++ b/board/raspberrypi/README.txt
@@ -0,0 +1,127 @@ 
+##RaspberryPi
+
+Intro
+=====
+
+To be able to use your RaspberryPi board with the images generated by
+Buildroot, you have a prior choice to make, will you use:
+    - Volatile rootfs in RAM (The rootfs is an initramfs)
+    - Persistent rootfs on the SDCard
+
+Also, a good source of information is http://elinux.org/R-Pi_Hub
+
+Volatile rootfs
+===============
+
+How to build it
+---------------
+
+You need to use the rpi_defconfig, to do so:
+ * make rpi_defconfig
+
+Then, you need to select the kind of images you want:
+ * make menuconfig
+ * Select "Filesystem images"
+ * Select "initial RAM filesystem linked into linux kernel"
+
+What is generated
+-----------------
+
+After building, you should obtain this tree:
+
+    output/images/
+    +-- rootfs.tar
+    +-- rpi-firmware
+    |   +-- bootcode.bin
+    |   +-- config.txt
+    |   +-- fixup_cd.dat
+    |   +-- fixup.dat
+    |   +-- start_cd.elf
+    |   `-- start.elf
+    `-- zImage
+
+Note : rootfs.tar will only be there if you kept "tar the root filesystem"
+option selected in "Filesystem images".
+
+Where should the binaries be copied on the SDCard
+-------------------------------------------------
+
+Your SDCard must have its first partition using fat32 and with bootable flags.
+
+At the root of the partition, the RaspberryPi must find the following files:
+
+ * bootcode.bin
+ * config.txt
+ * fixup_cd.dat
+ * fixup.dat
+ * start_cd.elf
+ * start.elf
+ * zImage
+
+So you should, copy the entire content of output/images/rpi-firmware along with
+zImage.
+
+Note : You can create any number of partitions you desire, the only requirement
+is that the first partition must be using fat32.
+
+Persistent rootfs
+==================
+
+How to build it
+---------------
+
+You only need to use the rpi_defconfig, to do so:
+ * make rpi_defconfig
+
+What is generated
+-----------------
+
+After building, you should obtain this tree:
+
+    output/images/
+    +-- rootfs.tar
+    +-- rpi-firmware
+    |   +-- bootcode.bin
+    |   +-- config.txt
+    |   +-- fixup_cd.dat
+    |   +-- fixup.dat
+    |   +-- start_cd.elf
+    |   `-- start.elf
+    `-- zImage
+
+Where should the binaries be copied on the SDCard
+-------------------------------------------------
+
+Your SDCard must have its first partition using fat32 and with bootable flags.
+It should also have another partition which will contain your rootfs, it should
+be partitioned as ext4.
+
+Boot partition
+~~~~~~~~~~~~
+
+The first partition will contain everything used to boot the RaspberryPi.
+You must copy theses files at the root of partition:
+
+ * bootcode.bin
+ * config.txt
+ * fixup_cd.dat
+ * fixup.dat
+ * start_cd.elf
+ * start.elf
+ * zImage
+
+So you should, copy the entire content of output/images/rpi-firmware along with
+zImage.
+
+Rootfs partition
+~~~~~~~~~~~~~~
+
+The second partition, will contain your rootfs.
+Simply extract (as root!) the contents of the rootfs.tar archive
+into this partition.
+
+For example: (Assuming mountpoint is a directory and exist)
+
+ $ sudo mount /dev/sdXY /mnt/mountpoint
+ $ sudo tar xf rootfs.tar -C /mnt/mountpoint
+
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
new file mode 100644
index 0000000..8c73d0e
--- /dev/null
+++ b/configs/rpi_defconfig
@@ -0,0 +1,19 @@ 
+BR2_arm=y
+BR2_arm1176jzf_s=y
+
+BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+
+BR2_TARGET_GENERIC_GETTY_PORT="tty1"
+
+BR2_PACKAGE_RPI_FIRMWARE=y
+BR2_PACKAGE_RPI_USERLAND=y
+BR2_PACKAGE_LIBCOFI=y
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL="git://github.com/raspberrypi/linux.git"
+BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION="31a951046155b27361127d9cf85a1f58719fe9b3"
+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
+BR2_LINUX_KERNEL_ZIMAGE=y