Difference between revisions of "Bering-uClibc 5.x - Developer Guide - Appendices - Hardware-Specific Guides"
(→Considerations about initrd) |
(→Boot Disk Layout) |
||
Line 96: | Line 96: | ||
#* The syntax for <code class="filename">config.txt</code> is comprehensively documented at [http://elinux.org/RPi_config.txt the eLinux Wiki]. | #* The syntax for <code class="filename">config.txt</code> is comprehensively documented at [http://elinux.org/RPi_config.txt the eLinux Wiki]. | ||
#* By default <code class="filename">start.elf</code> loads a file called <code class="filename">kernel.img</code>, passing it the command line specified in file <code class="filename">cmdline.txt</code> | #* By default <code class="filename">start.elf</code> loads a file called <code class="filename">kernel.img</code>, passing it the command line specified in file <code class="filename">cmdline.txt</code> | ||
− | #* The default name <code class="filename">kernel.img</code> can be overriden by an entry like the following in <code class="filename">config.txt</code><pre>kernel= | + | #* The default name <code class="filename">kernel.img</code> can be overriden by an entry like the following in <code class="filename">config.txt</code><pre>kernel=linux.img</pre> where <code class="filename">linux.img</code> is the (renamed) kernel build with the Bering-uClibc toolchain. |
#* Rather than having a separate <code class="filename">cmdline.txt</code> the kernel command line can also be specified by an entry like the following in <code class="filename">config.txt</code><pre>cmdline=LEAFCFG=/dev/mmcblk0p1:vfat</pre> | #* Rather than having a separate <code class="filename">cmdline.txt</code> the kernel command line can also be specified by an entry like the following in <code class="filename">config.txt</code><pre>cmdline=LEAFCFG=/dev/mmcblk0p1:vfat</pre> | ||
− | # The file <code class="filename">kernel.img</code> is typically a standard uncompressed Linux kernel <code class="filename">Image</code> file | + | # The file <code class="filename">kernel.img</code> is typically a standard uncompressed Linux kernel <code class="filename">Image</code> file. The kernel <code class="filename">linux-3.6.11-bcmrpi</code>, as it has been build within the Bering-uClibc toolchain, is an uncompressed Linux kernel and shall be renamed to <code class="filename">linux.img</code> while copying to your Raspberry Pi. |
− | + | ||
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 17:11, 8 April 2013
Hardware-Specific Guides | ||
---|---|---|
Prev | Bering-uClibc 5.x - Developer Guide | Next |
Contents
Introduction
This page provides guidelines for Bering-uClibc 5.x developers targeting specific hardware devices.
See also the equivalent page in the User Guide for hardware-specific information relevant to Users as well as Developers.
ARM CPU Architecture
Raspberry Pi Model B
There is now (April 2013) a new repository tracking the work on raspberry pi support. To access it first clone the LEAF repository and then add the rpi branch:
git clone git://git.code.sf.net/p/leaf/bering-uclibc leaf-bering-uclibc cd leaf-bering-uclibc git branch --track rpi origin/rpi git checkout rpi
Overview
The Raspberry Pi Model B has a Broadcom BCM2835 "system on a chip" integrated circuit containing an ARM1176JZF-S CPU which implements the ARMv6 CPU architecture standard.
- As described 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 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 here
There is no Real-Time Clock so it is necessary to use an NTP or similar time source for accurate time keeping.
There is a USB interface (with 2 Type-A sockets) and also a 10/100 Ethernet interface, connected internally via the USB bus.
While there is no standard physical connector for an RS-232 serial interface, the GPIO header does support serial communications using 3.3V TTL signals. Something like a PL2303 adaptor can be used to convert these to USB for connection to a host computer running a terminal emulator.
Linux Kernel Source
Many of the device drivers for the on-board peripherals are not currently (April 2013) included in the mainstream Linux source tree.
Developers of buildroot provides one big patch with all changes for Raspberry Pi, based on the work of the Raspberry Pi foundation, for the Linux Kernel 3.6.11. See Lightweight Raspberry Pi Distribution Git Hub based on Buildroot
We've started our work towards a LEAF image for Raspberry Pi on this repository. Note that the kernel version differs from our mainline version currently in development (3.4.x).
Linux Kernel Configuration
SD Card Driver
Based on this post the relevant device drivers for the SD card interface are:
CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_BCM2708=y CONFIG_MMC_SDHCI_BCM2708_DMA=y # CONFIG_MMC_BCM2708 is not set
USB Driver
The USB interface driver is the DWC OTG Controller:
CONFIG_USB_DWCOTG=y
Ethernet Driver
The Ethernet interface chip is an SMC 91X-compatible device:
CONFIG_NET_VENDOR_SMSC=y CONFIG_SMC91X=y
Considerations about initrd
We use two files during boot, initrd.lrp, providing the basic stuff to boot, and initmod.lrp with architecture specific modules.
While the bootloader of Raspberry Pi supports loading an initramfs (initrd) file to boot, it fails to load more than one file (initrd.lrp and initmod.lrp), as other hardware does.
So we first have to concatenate the two files into one. This is done with the following commands:
mv initrd.lrp initrd.gz mv initmod.lrp initmod.gz cat initrd.gz initmod.gz > initrd-rpi.gz mv initrd-rpi.gz initrd-rpi.lrp
The file initrd-rpi.lrp
then needs to declared in config.txt
as described at the eLinux Wiki.
initramfs initrd-rpi.lrp 0x00800000
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 boot sequence is as follows (based on content here):
- The first-stage bootloader, built into the very small on-chip ROM runs, and loads...
- A file called
bootcode.bin
which contains the second-stage bootloader. This runs, and loads... - A file called
loader.bin
which contains the third-stage bootloader. This understands the ELF file format and loads... - A file called
start.elf
which contains the GPU binary driver code. If the optional configuration fileconfig.txt
is present this is read and processed.- The syntax for
config.txt
is comprehensively documented at the eLinux Wiki. - By default
start.elf
loads a file calledkernel.img
, passing it the command line specified in filecmdline.txt
- The default name
kernel.img
can be overriden by an entry like the following inconfig.txt
kernel=linux.img
wherelinux.img
is the (renamed) kernel build with the Bering-uClibc toolchain. - Rather than having a separate
cmdline.txt
the kernel command line can also be specified by an entry like the following inconfig.txt
cmdline=LEAFCFG=/dev/mmcblk0p1:vfat
- The syntax for
- The file
kernel.img
is typically a standard uncompressed Linux kernelImage
file. The kernellinux-3.6.11-bcmrpi
, as it has been build within the Bering-uClibc toolchain, is an uncompressed Linux kernel and shall be renamed tolinux.img
while copying to your Raspberry Pi.
Note that the Raspberry Pi references the first disk partition as /dev/mmcblk0p1
and the second disk partition as /dev/mmcblk0p2
.
Prev | Up | Next |