Skip to content

Document GPIO boot mode on its own page #1131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from Jul 3, 2019
Merged
Changes from 5 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
239be14
Document GPIO boot mode it its own page
Apr 30, 2019
3a7e16e
add content to new page
May 1, 2019
589ae4c
explain GPIO boot mode disables all boot modes by default
May 1, 2019
83ec883
add all docs from bootflow.md
May 1, 2019
c0015bb
address review comments
May 1, 2019
933626e
Update gpio.md
May 1, 2019
6c7366b
SD0 = Broadcom, SD1 = Arasan with SDIO
May 2, 2019
5502987
fix wording
May 2, 2019
ed9fe20
SD0 also does MMC, remove duplicate "permanently"
May 2, 2019
6d55871
fix wording
May 2, 2019
e3c7085
expand on boot order explanation
May 2, 2019
4ebaa7a
fix typo
May 2, 2019
e3323fe
Update gpio.md
May 2, 2019
8328e77
Update gpio.md
May 2, 2019
06b1354
add link to config.txt docs page
May 2, 2019
93c7989
fix relative links
May 2, 2019
18e6fa6
fix relative links (take 2)
May 2, 2019
5c7d7f3
Update gpio.md
May 3, 2019
0bd96d7
SPI and NAND - no Linux support at present
May 3, 2019
40cbc74
backout last change
May 3, 2019
d921755
SPI and NAND - no Linux support at present (take 2)
May 3, 2019
334f765
fix typo
May 3, 2019
ea88d4c
GPIO bank selection - revert to base of 1
May 3, 2019
95098b1
fix typo
May 3, 2019
f3c21b8
fix typo
May 3, 2019
906acbf
revert GPIO bank selection to base 1 (take 2)
May 3, 2019
f7ebd20
Cater for CM Lite - SD0 availability at boot to be confirmed
May 7, 2019
0687e99
Add details of SD0 on CM Lite per lurch
May 7, 2019
b012955
SD -> microSD
May 7, 2019
4b815b5
Update per Gordon's comments
May 10, 2019
783f32f
Add 3A+ and CM3 and 3+
May 10, 2019
d670aa6
Update gpio.md
May 10, 2019
27fc56a
Make sure all Pi models are covered by tables of GPIOs
Jun 17, 2019
cbd4ed3
GPIO lines -> GPIO pins, since they are not in the same order
Jun 17, 2019
c470484
remove unnecessary sentence
Jun 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions hardware/raspberrypi/bootmodes/gpio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# GPIO boot mode

The Raspberry Pi can be configured to allow the boot mode to be selected at power on using hardware attached to the GPIO connector: this is GPIO boot mode. This is done by setting bits in the OTP memory of the SoC. Once the bits are set, they permanently allocates 5 GPIOs to allow this selection to be made. Once the OTP bits are set they cannot be unset so you should think carefully about enabling this, since those 5 GPIO lines will then be permanently unavailable for any other use.

To enable GPIO boot mode, add the following line to the config.txt file:

```
program_gpio_bootmode=n
```

Where n is the bank of GPIOs which you wish to use. Then reboot the Pi once to program the OTP with this setting. Bank 1 is GPIOs 22-26, bank 2 is GPIOs 39-43. Unless you have a Compute Module, you must use bank 1: the GPIOs in bank 2 are only available on the Compute Module. Because of the way the OTP bits are arranged, if you first program GPIO boot mode for bank 1, you then have the option of selecting bank 2 later. The reverse is not true: once bank 2 has been selected for GPIO boot mode, you cannot select bank 1.

Once GPIO boot mode is enabled, the Raspberry Pi will no longer boot. You must pull up at least one boot mode GPIO pin in order for the Pi to boot.

Once enabled, the GPIOs are polled in numerical order as follows:

|Bank 1|Bank2|boot type|
|:----:|:---:|:-------:|
|22 |39 |SD1 |
|23 |40 |SD2 |
|24 |41 |NAND |
|25 |42 |SPI |
|26 |43 |USB |

SD1 is the <xxx> SD card interface. SD2 is the <yyy> SD card interface. USB enables both USB device mode and USB host mode boot.

The default pull resistance on the GPIO lines is 50K ohm, as documented on page 102 of the [BCM2835 ARM peripherals datasheet](hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf). A pull resistance of 5K ohm is recommended to pull a GPIO line up or down: this will allow the GPIO to function but not consume too much power.