Difference between revisions of "Bering-uClibc 5.x - Developer Guide - Appendices - Hardware-Specific Guides"

From bering-uClibc
Jump to: navigation, search
m (Typo)
(Boot Disk Layout: Updated details of the boot-partition files)
Line 1: Line 1:
{| summary="Navigation header" width="100%"
+
===Boot Disk Layout===
! colspan="3" align="center" | [[Bering-uClibc 5.x - Developer Guide - Hardware-Specific Guides|Hardware-Specific Guides]]
+
The Raspberry Pi must boot from its SD card and some vital files must be present in the root directory of the boot partition.
|-
+
| width="20%" align="left"  | [[Bering-uClibc 5.x - Developer Guide - Adding a Hardware Architecture Variant|Prev]]
+
! width="60%" align="center" | [[Bering-uClibc 5.x - Developer Guide]]
+
| width="20%" align="right"  |
+
|}
+
----
+
  
=Introduction=
+
The latest versions of these files can be downloaded from [https://github.com/raspberrypi/firmware/tree/master/boot the raspberrypi/firmware page on GitHub].
This page provides guidelines for [[Bering-uClibc 5.x]] developers targeting specific hardware devices.
+
  
See also the equivalent page in the [[Bering-uClibc 5.x - User Guide - Appendices - Hardware-Specific Guides|User Guide]] for hardware-specific information relevant to Users as well as Developers.
+
The first disk partition on the SD card must be formatted as a VFAT filesystem.
 +
It works OK if the partition type is <tt>0xb</tt> (W95 FAT32)
 +
This partition does '''not''' ''have'' to to be marked as "bootable".
  
 
+
The critical files are:
=ARM CPU Architecture=
+
==[http://www.raspberrypi.org/ Raspberry Pi] Model B==
+
===Overview===
+
The Raspberry Pi Model B has a [http://www.broadcom.com/products/BCM2835 Broadcom BCM2835] "system on a chip" integrated circuit containing an [http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0301h/index.html ARM1176JZF-S] CPU which implements the [http://en.wikipedia.org/wiki/ARM11 ARMv6] CPU architecture standard.
+
* As described [http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/I1000175.html here], the ARM1176JZF-S is an ARM1176JZ-S with the addition of a Vector Floating-Point (VFP) coprocessor. This means it can execute floating-point arithmetic in hardware rather than (only) in software.
+
 
+
A PDF data sheet for the BCM2835 can be downloaded from [http://dmkenr5gtnd8f.cloudfront.net/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf here].
+
The BCM2835 contains a variety of devices and many of these seem to be identified with the string BCM2708 rather than BCM2835, judging by the example boot log from an Alpha board [http://www.raspberrypi.org/archives/78 here]
+
 
+
===Linux Kernel Source===
+
Many of the device drivers for the on-board peripherals are not currently (April 2012) included in the mainstream Linux source tree.
+
The Raspberry Pi foundation have forked the Linux 3.1.9 kernel source and added the necessary drivers and a specific <tt>bcm2708</tt> "platform".
+
See [http://github.com/raspberrypi/linux/tree/rpi-patches/arch/arm/mach-bcm2708 the Raspberry Pi Git Hub repository]
+
 
+
A consequence of this is that it is not possible to fully support the Raspberry Pi with the standard 3.2.x kernel proposed for [[Bering-uClibc 5.x]].
+
The main options are:
+
* Patch the 3.2.x kernel to add the additional drivers.
+
* Build a variant of [[Bering-uClibc 5.x]] specifically for the Raspberry Pi, using the 3.1.9 kernel.
+
 
+
===Linux Kernel Configuration===
+
TODO - Which configuration settings are required / desirable.
+
 
+
There does not seem to be any standard provision for loading an initramfs (initrd) file when booting the Raspberry Pi.
+
That means we need to embed the [[Bering-uClibc 5.x]] initrd into the kernel using the <tt>CONFIG_INITRAMFS_SOURCE</tt> configuration variable.
+
 
+
===Boot Disk Layout===
+
The Raspberry Pi must boot from its SD card and some vital files must be present in the right location.
+
 
+
Refer to the contents of the standard Raspberry Pi disk images from the [http://www.raspberrypi.org/downloads Raspberry Pi downloads page]
+
 
+
The first disk partition must be formatted as a bootable FAT32 filesystem which must contain:
+
 
* A file called <code class="filename">start.elf</code> which contains the GPU binary driver
 
* A file called <code class="filename">start.elf</code> which contains the GPU binary driver
 
* A file called <code class="filename">bootcode.bin</code> which contains the second stage bootloader
 
* A file called <code class="filename">bootcode.bin</code> which contains the second stage bootloader
 
* A file called <code class="filename">loader.bin</code> which contains the third stage bootloader
 
* A file called <code class="filename">loader.bin</code> which contains the third stage bootloader
 
* A file called <code class="filename">kernel.img</code> which contains the Linux kernel
 
* A file called <code class="filename">kernel.img</code> which contains the Linux kernel
** This seems to be a standard (uncompressed) Linux kernel <code class="filename">Image</code> file with a special 32KB prefix. See [http://www.cnx-software.com/2012/01/22/linux-kernel-3-1-9-for-raspberry-pi-released/ here]
+
** This is a standard (uncompressed) Linux kernel <code class="filename">Image</code> file
* A file called <code class="filename">cmdline.txt</code> containing the kernel command line
+
 
 +
Some additional files are optional but are referenced if present:
 +
* A text file called <code class="filename">config.txt</code>
 +
** This is comprehensively documented at [http://elinux.org/RPi_config.txt the eLinux Wiki] which states:
 +
<blockquote>The Raspberry Pi config.txt file is read by the GPU before the ARM core is initialised. It can be used to set various system configuration parameters.</blockquote>
 +
* A text file called <code class="filename">cmdline.txt</code> containing the kernel command line
  
It seems customary to put the files relating to a particular Linux distribution on a ''second'' disk partition. We therefore need a second FAT32 disk partition for <code class="filename">leaf.cfg</code>, all the <code class="filename">.lrp</code> Package files etc.
+
It seems customary to put the files relating to a particular Linux distribution on a ''second'' disk partition.
 +
We probably therefore need a second VFAT disk partition for <code class="filename">leaf.cfg</code>, all the <code class="filename">.lrp</code> Package files etc.
  
 
Note that the Raspberry Pi references the first disk partition as <code class="filename">/dev/mmcblk0p1</code> and the second disk partition as <code class="filename">/dev/mmcblk0p2</code>.
 
Note that the Raspberry Pi references the first disk partition as <code class="filename">/dev/mmcblk0p1</code> and the second disk partition as <code class="filename">/dev/mmcblk0p2</code>.

Revision as of 20:28, 30 June 2012

Boot Disk Layout

The Raspberry Pi must boot from its SD card and some vital files must be present in the root directory of the boot partition.

The latest versions of these files can be downloaded from the raspberrypi/firmware page on GitHub.

The first disk partition on the SD card must be formatted as a VFAT filesystem. It works OK if the partition type is 0xb (W95 FAT32) This partition does not have to to be marked as "bootable".

The critical files are:

  • A file called start.elf which contains the GPU binary driver
  • A file called bootcode.bin which contains the second stage bootloader
  • A file called loader.bin which contains the third stage bootloader
  • A file called kernel.img which contains the Linux kernel
    • This is a standard (uncompressed) Linux kernel Image file

Some additional files are optional but are referenced if present:

  • A text file called config.txt
The Raspberry Pi config.txt file is read by the GPU before the ARM core is initialised. It can be used to set various system configuration parameters.
  • A text file called cmdline.txt containing the kernel command line

It seems customary to put the files relating to a particular Linux distribution on a second disk partition. We probably therefore need a second VFAT disk partition for leaf.cfg, all the .lrp Package files etc.

Note that the Raspberry Pi references the first disk partition as /dev/mmcblk0p1 and the second disk partition as /dev/mmcblk0p2.



Prev Up