Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d51fe0

Browse files
author
christinaa
committed
2 parents20817c9 +2245d38 commit4d51fe0

File tree

2 files changed

+21
-46
lines changed

2 files changed

+21
-46
lines changed

‎CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
So you'd like to contribute to`rpi-open-firmware`?
2+
3+
First things first, please come on IRC before starting anything. While not strictly a rule, this prevents duplicate work. When you are ready after that, we accept pull requests over Github, or if you prefer you can email a patch or link to one over IRC.
4+
5+
A few notes on style:
6+
7+
* Contributors should use hard tabs.
8+
* C++ is the preferred language for high-level code.
9+
* Generally follow conventions of similar code in the project.

‎README.md

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,35 @@
11
#Minimal Raspberry Pi VPU firmware
2-
This is a small firmware for RPi VPU (VideoCore4) versions 1/2/3 that is capable of initializing UART, VPU PLL (PLLC) and ARM itself. It's intended to be used instead of stock`bootcode.bin` on RPi's SD card. You**need** to have UART to see anything meaningful as far as output goes. The project additionally maintains a second-stage chainloader running on ARM capable of initializing eMMC, FAT, and the Linux kernel, as well as a shrinking set of patches to the Linux kernel.
32

4-
This has been tested on RPi1 Model B (Hynix PoP DDR),RPi 2 Model B and RPi 3 Model B (both Elpida DDR), but it should work with minimal modifications on all ofthemodels. Development primarily targets the RPi 2 Model B.
3+
`rpi-open-firmware` is a small firmware for the[RPi VPU](https://en.wikipedia.org/wiki/VideoCore), capable of initializing UART, VPU PLL (PLLC),and ARM itself. It's intended as a libre replacement for the stock`bootcode.bin` normally loaded from the SD card. A UART cable is highly recommended forthetime being, though not strictly necessary. Additionally, there is a second-stage chainloader running on ARM capable of initializing eMMC, FAT, and the Linux kernel.
54

6-
If you want to contact us because you're interested in contributing, development discussion occurs in`#raspberrypi-internals` on Freenode. Please come on IRC before randomly hacking on the codebase :-)
5+
See[issue#31](https://github.com/christinaa/rpi-open-firmware/issues/31) for a compatibility table and related discourse.
76

8-
All Broadcom headers are licensed under 3-Clause BSD License while our code is under GPLv2+. See`LICENSE` for more information.
7+
Technical discussion occurs in`#raspberrypi-internals` on[Freenode](http://webchat.freenode.net/?channels=#raspberrypi-internals). Please come on IRC before randomly hacking on the codebase :-)
98

10-
##Building
11-
12-
You need Julian Brown's VC4 toolchain to build this (https://github.com/puppeh/vc4-toolchain) as well as a arm-none-eabi-toolchain. You can tweak the paths to it in CROSS_COMPILE in`Makefile` (for VC4) and for ARM in`arm_chainloader/Makefile`, although by default it assumes they are currently in your path. Contributors should not commit their personal paths. Contributors should also use tabs for indentation. After you've done it, run`buildall.sh` and you should have a blob in`build/bootcode.bin`.
13-
14-
###Building on OSX
15-
16-
####Dependencies:
17-
18-
+ vc4-toolchain (https://github.com/puppeh/vc4-toolchain)
19-
20-
+ arm-none-abi-toolchain (https://launchpad.net/gcc-arm-embedded/+download)
21-
+ compilation instructions for OSX in the[pdf](https://launchpadlibrarian.net/287100910/How-to-build-toolchain.pdf)
22-
23-
####Build instructions:
24-
Compiling for osx is similar, but be careful with OSX's built-in "gcc" (LLVM-based) and the default version of guile (2.x), which is incompatible.
25-
26-
Install dependencies:
27-
28-
brew install gcc-6 guile18
9+
All Broadcom headers are licensed under 3-Clause BSD License while our code is under GPLv2+. See`LICENSE` for more information. Various external projects are mirrored under a mix of GPL-compatible licenses.
2910

30-
Install the arm toolchain.
31-
32-
# follow the instructions in the pdf linked above
33-
34-
Download the source and dependencies together for vc4-toolchain:
35-
36-
git clone --recursive https://github.com/puppeh/vc4-toolchain.git
37-
38-
Once it’s done, you’ll need to add file paths to your $PATH variable:
39-
40-
export PATH=$PATH:/path/to/gcc-arm-none-eabi-5_4-2016q3/bin:/path/to/vc4-toolchain/prefix/bin
41-
42-
From the main instructions ("After you've done it, run buildall.sh and you should have a blob in build/bootcode.bin"):
11+
##Building
4312

44-
git clone https://github.com/christinaa/rpi-open-firmware; cd rpi-open-firmware
45-
CC=gcc-6 LIBRARY_PATH=/lib:/lib64 ./build-all.sh
13+
As a prerequisite, Julian Brown's[VC4 toolchain](https://github.com/puppeh/vc4-toolchain) is necessary as well as the`arm-none-eabi-` toolchain (Debian package`gcc-arm-none-eabi`). You can tweak the VC4 toolchain path in`CROSS_COMPILE` in`Makefile` and the ARM path in`arm_chainloader/Makefile` if necessary. Contributors should not commit their personal paths. After configuration, run`buildall.sh`. The binary is at`build/bootcode.bin`, ready to be copied to an SD card.
4614

47-
Note:onthe last step, the library path is set as it initially had a trailing ":" which broke the build.`CC=gcc-6` is just to ensure it's using the gcc install from the first step.
15+
###BuildingonmacOS
4816

49-
That's it! Your shiny new binary is sitting at rpi-open-firmware/build/bootcode.bin.
17+
macOS compilation is similar to GNU/Linux, save platform errata described here. Instructions to build the ARM toolchain are[here](https://launchpadlibrarian.net/287100910/How-to-build-toolchain.pdf). Due to symlinking by default, GCC must be installed manually, and, an older version of guile is necessary (homebrew packages`gcc-6` and`guile18`, respectively). Finally, set the environment variable`LIBRARY_PATH` to`/lib:/lib64` when running `buildall.sh.
5018

5119
##Technical Details
52-
The firmware is split into two parts, a VC4 part and and ARM part. The VC4 part initializes PLLC and moves VPU over to it, and then brings up UART. It then performs SDRAM initialization, making SDRAM available at`0xC0000000` (uncached alias). The ARM loader will do ARM initialization and then copy the ARM bootloader that's embedded in it to the alias. It will then map it to`0x0` in ARM's memory space and start ARM. The code under`arm_chainloader` is what will run on the ARM.
53-
54-
The ARM chainloader then initializes the eMMC controller and access the boot partition with a FAT driver. From here, it chainloads the Linux kernel (other payloads are not tested and are not likely to work due to dependence on the firmware).
20+
The firmware is split into two parts, one running on the VC4 and the other on ARM. The VC4 part initializes PLLC and moves VPU over to it, and then brings up UART. It performs SDRAM initialization, mapping it to`0xC0000000` (uncached alias). Next, ARM is initialized, and the embedded bootloader is mapped to ARM address`0x0`.`arm_chainloader` is then executed.
5521

56-
Thecurrent makefiles in theARM part of it aim at**RPi1** (ie. ARMv6) but they can be changed to ARMv7 if you want to build it for a newer model. It was tested on all RPi modelsandit seems to work without any issues (ARM can access peripherals and memory just fine as AXI supervisor). However, itcannot access any secure peripherals (OTP/SDRAM/etc) since they appear to be on a separate bus accessible onlytoVC4.
22+
TheARM chainloader initializes theeMMC controllerandaccesses the FAT boot partition. From here, itchainloads the Linux kernel (other payloads likely do not work duetomailbox usage).
5723

5824
##Does it boot Linux?
5925

60-
Yes, with some conditions. You can boot a very minimal version of Linux without the firmware and get it to work with UART. Support foreMMC, some USB devices, and Ethernet are in the works, which will be sufficient for certain headless systems. Still,you can expect half of the things to be broken (most importantly, video and DMA). Additionally,since`start.elf` is responsibleforclock andpower managementin the original firmware (all registers in the`cpr` block), these drivers will havetobe rewritten on ARM or our VC4 firmware to have most of the peripherals working properly (HDMI, for example).
26+
Yes, with some conditions. You can boot a very minimal version of Linux without the firmware and get it to work with UART and eMMC. Support forUSB, DMA, and Ethernet are in the works, which will be sufficient for certain headless systems. Still,many other peripherals require bringup, such as video. Additionally,driversfor power managementneedtowritten.
6127

6228
##Thanks To
6329
***[Herman Hermitage](https://github.com/hermanhermitage)** for his VC4 documentation and for helping determine suitable ARM PLL configurations.
6430
***[Julian Brown](https://github.com/puppeh)** for reviewing the code and for his awesome VC4 toolchain.
6531
***[Alyssa Rosenzweig](https://github.com/bobbybee)** for her contributions to the firmware especially in areas of Linux bringup and early ARM side initialization, as well as fixing mailbox support.
6632
***[David Given](https://github.com/davidgiven)** for his initial LLVM project used as the base for the initial LLVM toolchain before moving to GCC.
67-
***[phire](https://github.com/phire)** for reviewing the code.
33+
***[Scott Mansell](https://github.com/phire)** for reviewing the code.
6834
***[Broadcom](https://github.com/broadcom)** for their header release.
6935
* Various other people not mentioned here.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp