Skip to contentSkip to conversation

rpi-firmware: Fixup config.txt

PATCH New Maxime Hadjinlian 6 participants 12 messages Jan 13, 2013 – Apr 29, 2013 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rpi-firmware: Fixup config.txt

The default name of the kernel binary for the RaspberryPi is kernel.img, it's a only a zImage kernel renamed.
Since Buildroot will build a zImage, the default config uses that should use it instead of forcing the user to rename a file.

Also, remove the cmdline argument rootfstype, as ext4 is a builtin driver, there is no need to specify it on the cmdline.

---
 package/rpi-firmware/config.txt |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/rpi-firmware/config.txt +2 -1
index 2cabd68..a818762 100644
@@ -6,9 +6,10 @@
 
 arm_freq=700
 core_freq=250
+kernel=zImage
 disable_overscan=1
 gpu_mem_256=100
 gpu_mem_512=100
 sdram_freq=400
 over_voltage=0
-cmdline="dwc_otg.fiq_fix_enable=1 sdhci-bcm2708.sync_after_dma=0 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
+cmdline="dwc_otg.fiq_fix_enable=1 sdhci-bcm2708.sync_after_dma=0 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootwait"
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 rpi-firmware: Fixup config.txt

ping ?

Quoted 32 lines · Maxime Hadjinlian

The default name of the kernel binary for the RaspberryPi is kernel.img, it's a only a zImage kernel renamed.
Since Buildroot will build a zImage, the default config uses that should use it instead of forcing the user to rename a file.

Also, remove the cmdline argument rootfstype, as ext4 is a builtin driver, there is no need to specify it on the cmdline.

---
 package/rpi-firmware/config.txt |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/rpi-firmware/config.txt +2 -2
index 2cabd68..a818762 100644
@@ -6,9 +6,10 @@
 
 arm_freq=700
 core_freq=250
+kernel=zImage
 disable_overscan=1
 gpu_mem_256=100
 gpu_mem_512=100
 sdram_freq=400
 over_voltage=0
-cmdline="dwc_otg.fiq_fix_enable=1 sdhci-bcm2708.sync_after_dma=0 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
+cmdline="dwc_otg.fiq_fix_enable=1 sdhci-bcm2708.sync_after_dma=0 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootwait"
--

1.7.10.4

#2 lore raw

PATCH 1/2 rpi-firmware: Fixup config.txt

Quoted 1 line · Maxime Hadjinlian

ping ?

Seems like this patch has never been even reviewed since last January. Even though it helps to use buildroot-built projects on RPi.

Is there a chance to get it reviewed/accepted?

Or is it supposed to be re-sent together with modifications in "[PATCH 2/2] configs: add RaspberryPi defconfig"?

-Alexey

Quoted 34 lines
Quoted 32 lines · Maxime Hadjinlian

The default name of the kernel binary for the RaspberryPi is kernel.img, it's a only a zImage kernel renamed.
Since Buildroot will build a zImage, the default config uses that should use it instead of forcing the user to rename a file.

Also, remove the cmdline argument rootfstype, as ext4 is a builtin driver, there is no need to specify it on the cmdline.

---
  package/rpi-firmware/config.txt |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
package/rpi-firmware/config.txt +2 -2
index 2cabd68..a818762 100644
@@ -6,9 +6,10 @@
 
  arm_freq=700
  core_freq=250
+kernel=zImage
  disable_overscan=1
  gpu_mem_256=100
  gpu_mem_512=100
  sdram_freq=400
  over_voltage=0
-cmdline="dwc_otg.fiq_fix_enable=1 sdhci-bcm2708.sync_after_dma=0 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
+cmdline="dwc_otg.fiq_fix_enable=1 sdhci-bcm2708.sync_after_dma=0 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootwait"
--

1.7.10.4

#3 lore raw

PATCH 1/2 rpi-firmware: Fixup config.txt

Quoted 7 lines · Alexey Brodkin

Seems like this patch has never been even reviewed since last January. Even though it helps to use buildroot-built projects on RPi.

Is there a chance to get it reviewed/accepted?

Or is it supposed to be re-sent together with modifications in "[PATCH 2/2] configs: add RaspberryPi defconfig"?

Hi Alexey,

Feel free to test these patches and add your
Tested-by: ...
tag. Or to review them and add an Acked-by.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH 2/2 configs: add RaspberryPi defconfig

In reply to Maxime Hadjinlian

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

---
 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
board/raspberrypi/README.txt new file +127 -0
new file mode 100644
index 0000000..9825d92
@@ -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
+
configs/rpi_defconfig new file +19 -0
new file mode 100644
index 0000000..8c73d0e
@@ -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
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 2/2 configs: add RaspberryPi defconfig

Hi maxime, all,

2013/1/13 Maxime Hadjinlian <[email protected]>:

Quoted 9 lines

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

Regards,

Signature · 1 line
Samuel
#6 lore raw

PATCH 2/2 configs: add RaspberryPi defconfig

ping ?

Quoted 18 lines · Samuel Martin

Hi maxime, all,

2013/1/13 Maxime Hadjinlian <[email protected]>:

Quoted 9 lines

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

Regards,

--
Samuel

#7 lore raw

PATCH 2/2 configs: add RaspberryPi defconfig

In reply to Maxime Hadjinlian

Dear Maxime Hadjinlian,

configs/rpi_defconfig line 5

Quoted 11 lines · Maxime Hadjinlian
configs/rpi_defconfig new file +5 -0
new file mode 100644
index 0000000..8c73d0e
@@ -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

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#8 lore raw

PATCH 1/1 configs: add RaspberryPi defconfig

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

---
 board/raspberrypi/README.txt |  127 ++++++++++++++++++++++++++++++++++++++++++
 configs/rpi_defconfig        |   21 +++++++
 2 files changed, 148 insertions(+)
 create mode 100644 board/raspberrypi/README.txt
 create mode 100644 configs/rpi_defconfig
board/raspberrypi/README.txt new file +127 -0
new file mode 100644
index 0000000..9825d92
@@ -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
+
configs/rpi_defconfig new file +21 -0
new file mode 100644
index 0000000..69c7b74
@@ -0,0 +1,21 @@
+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
+# Lock to 3.8 headers to avoid breaking with newer kernels
+BR2_KERNEL_HEADERS_3_8=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
Signature · 1 line
1.7.10.4
#9 lore raw

PATCH 2/2 configs: add RaspberryPi defconfig

In reply to Maxime Hadjinlian

Hi,

Minor comments below.

Quoted 1 line

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?

Quoted 1 line

+++ 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

Quoted 74 lines
board/raspberrypi/README.txt new file +17 -0
+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"

board/raspberrypi/README.txt new file +6 -0
+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.

(quoted diff) +2 -0
+
+At the root of the partition, the RaspberryPi must find the

following files:

board/raspberrypi/README.txt new file +10 -0
+
+ * 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

board/raspberrypi/README.txt new file +3 -0
+zImage.
+
+Note : You can create any number of partitions you desire, the only

requirement

board/raspberrypi/README.txt new file +31 -0
+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
Quoted 4 lines

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.

Quoted 6 lines
board/raspberrypi/README.txt new file +5 -0
+
+Boot partition
+~~~~~~~~~~~~
+
+The first partition will contain everything used to boot the

RaspberryPi.

board/raspberrypi/README.txt line 111

Quoted 9 lines
board/raspberrypi/README.txt new file +9 -0
+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

#10 lore raw

PATCH 1/2 rpi-firmware: Fixup config.txt

In reply to Maxime Hadjinlian

Dear Maxime Hadjinlian,

Quoted 7 lines · Maxime Hadjinlian

The default name of the kernel binary for the RaspberryPi is kernel.img, it's a only a zImage kernel renamed.
Since Buildroot will build a zImage, the default config uses that should use it instead of forcing the user to rename a file.

Also, remove the cmdline argument rootfstype, as ext4 is a builtin driver, there is no need to specify it on the cmdline.

I don't think this justification is correct. If ext4 is a module, then rootfstype=ext4 doesn't make it work better. Specifying rootfstype= tells the kernel what is the root filesystem, so that it doesn't have to test the different available filesystem drivers.

I'm ok with the change, but I think the commit log is not correct.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#11 lore raw

PATCH 1/2 rpi-firmware: Fixup config.txt

Hi all,

Quoted 11 lines · Thomas Petazzoni

Dear Maxime Hadjinlian,

Quoted 7 lines · Maxime Hadjinlian

The default name of the kernel binary for the RaspberryPi is kernel.img, it's a only a zImage kernel renamed.
Since Buildroot will build a zImage, the default config uses that should use it instead of forcing the user to rename a file.

Also, remove the cmdline argument rootfstype, as ext4 is a builtin driver, there is no need to specify it on the cmdline.

Quoted 7 lines

I don't think this justification is correct. If ext4 is a module, then rootfstype=ext4 doesn't make it work better. Specifying rootfstype= tells the kernel what is the root filesystem, so that it doesn't have to test the different available filesystem drivers.

I'm ok with the change, but I think the commit log is not correct.

You're right, the commit log is not accurate. I will rewrite it and resend the patch.

Quoted 8 lines

Thanks,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com