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

Document GPIO boot mode on its own page #1131

merged 35 commits into from Jul 3, 2019

Conversation

ghost
Copy link

@ghost ghost commented Apr 30, 2019

Currently, there is no specific page which documents GPIO boot mode. This PR proposes to add one. This will clarify that this is a specific boot mode, enabled by a specific GPIO. It will also document exactly which GPIO activates which type of boot (SD, MSD, Ethernet etc) - the current docs are not ideal in this regard.

@ghost
Copy link
Author

ghost commented Apr 30, 2019

This is a follow on from #1126

@ghost ghost changed the title Document GPIO boot mode it its own page Document GPIO boot mode on its own page Apr 30, 2019
@lurch
Copy link
Contributor

lurch commented Apr 30, 2019

GPIO activates which type of boot (SD, MSD, Ethernet etc)

Nitpick: the GPIOs allow you to select to enable "SD1, SD2, NAND, SPI, USB" and USB covers both MSD and Ethernet, so you can't use GPIO to select between them 😜

And since SD2, NAND and SPI boot aren't supported, I guess it effectively only allows you to select between SD and USB boot.

@ghost
Copy link
Author

ghost commented Apr 30, 2019

I would have discovered that when I read Gordon's existing docs. Which I will do tomorrow.

@ghollingworth
Copy link
Contributor

Depends if you have control over the OTG_ID pin on the Pi compute module, if you do then you can choose between host and device mode.

@ghost
Copy link
Author

ghost commented May 1, 2019

@ghollingworth Do you mean OTG_ID is exposed on the compute module's edge connector?

@ghollingworth
Copy link
Contributor

Yes it is... For device mode it should be left open circuit, for host mode it should be pulled / driven low. On the CMIO board there is a resistor R12 which pulls this low permanently, I would suggest removing this and then using a jumper on the GPIO connector (the USB_ID pin comes out on pin 168 on the edge connector which is J6 pin 55 on the CMIO3 board)

@lurch
Copy link
Contributor

lurch commented May 1, 2019

@ghollingworth Out of curiosity: if OTG_ID is permanently pulled low on the CMIO board, how does the usbboot flashing mode work? Doesn't that require the CM to be in device mode?

@ghost
Copy link
Author

ghost commented May 1, 2019

Thanks for the extra information @ghollingworth - I will add that to the new page. I pinged you on a couple of other documentation PRs - don't know if you saw those 😉

@ghost
Copy link
Author

ghost commented May 1, 2019

@ghollingworth Can you confirm 3 things:

  1. What is the current state of SPI and NAND boot?

  2. Currently bootflow.md says this: "The primary SD card boot mode is, as standard, set to be GPIOs 49-53". Does this mean that by default the primary SD card interface is on GPIOs 49-53?

  3. Which SD card interface block is SD1, and which is SD2?

@lurch
Copy link
Contributor

lurch commented May 1, 2019

https://elinux.org/RPi_BCM2835_GPIOs

I suspect 'SD1' being discussed in bootflow.md is 'SD0' in that GPIOs table, and 'SD2' in bootflow.md is 'SD1' in that table.

@ghost
Copy link
Author

ghost commented May 1, 2019

https://elinux.org/RPi_BCM2835_GPIOs

I suspect 'SD1' being discussed in bootflow.md is 'SD0' in that GPIOs table, and 'SD2' in bootflow.md is 'SD1' in that table.

That still doesn't explain which hardware block they are.

@lurch
Copy link
Contributor

lurch commented May 1, 2019

That still doesn't explain which hardware block they are.

I'm not sure what you mean?

@ghost
Copy link
Author

ghost commented May 1, 2019

That still doesn't explain which hardware block they are.

I'm not sure what you mean?

There are two different implementations of an SD card interface present in the chip, and they come from two different vendors. It would be useful to know which one is SD1 and which is SD2. (Also, they should probably be called SD0 and SD1 if that's how the rest of the docs refer to them).

@lurch
Copy link
Contributor

lurch commented May 2, 2019

There are two different implementations of an SD card interface present in the chip, and they come from two different vendors.

Hmmm, I wasn't aware of that! I did a bit of googling and eventually found raspberrypi/linux#1536 where @pelwell says "The alt3 function on pins 22-27 is SD1 a.k.a. MMC. You want SD0 a.k.a. SDHOST which is alt0"

@pelwell
Copy link
Contributor

pelwell commented May 2, 2019

SD0 is the Broadcom in-house SD/MMC interface - known as SDHOST - which is now used by default on current images to drive the SD card or (on the Compute Module) eMMC. SD1 is the standard Arasan MMC block, but without ADMA/bus mastering support. This block is SDIO-capable, which is why it is used to connect the WiFi module. (SDHOST can almost do SDIO, but some over-aggressive clock gating prevents it from working.)

@ghost
Copy link
Author

ghost commented May 8, 2019

@pelwell @ghollingworth This PR just needs confirmation of the GPIO assignments, and which Pis have different GPIO enables as it seems from what has been said that newer Pis have more of them.

@lurch
Copy link
Contributor

lurch commented May 8, 2019

@andrum99 The documentation you've got now seems to imply that it's possible to boot from either SD0 or SD1, but from what I understand it's only possible to boot from SD0? Gordon earlier said "currently the only enableable modes are SDHOST boot, USB device, USB mass storage and USB ethernet".

@ghost
Copy link
Author

ghost commented May 8, 2019

@andrum99 The documentation you've got now seems to imply that it's possible to boot from either SD0 or SD1, but from what I understand it's only possible to boot from SD0? Gordon earlier said "currently the only enableable modes are SDHOST boot, USB device, USB mass storage and USB ethernet".

As does the existing documentation. It's not entirely clear in what way these modes are "enabled" and the ones which aren't available are "disabled". It could be that the boot ROM will try all of the modes listed (or else, why bother documenting them?), but that there is currently no support in Linux.

@lurch
Copy link
Contributor

lurch commented May 14, 2019

@andrum99 I don't think it adds anything that you've not already covered, but I've just noticed there's some documentation about SD0 and SD1 in section 9.1.4 of https://www.raspberrypi.org/documentation/hardware/computemodule/datasheets/rpi_DATA_CM3plus_1p0.pdf

@lurch
Copy link
Contributor

lurch commented Jun 8, 2019

I guess this would also fix #793

@ghost
Copy link
Author

ghost commented Jun 8, 2019

I guess this would also fix #793

I guess it would to. Pinging @JamesH65 as this one is ready to go, but I hadn't pinged him before to tell him - my bad 😮

@JamesH65
Copy link
Contributor

Pushed to copy edit.

@ghost
Copy link
Author

ghost commented Jun 17, 2019

Just to clarify - I've changed GPIO pins TO lines, since the GPIO pins are not necessarily in the same order as the GPIO lines on the chip. The GPIO lines on the chip are tested in numerical order to select the desired boot modes. This order is not necessarily the same as the order of those GPIOs on the connector.

@pelwell
Copy link
Contributor

pelwell commented Jul 3, 2019

Can we get this merged ASAP?

@JamesH65 JamesH65 merged commit 603a7bd into raspberrypi:master Jul 3, 2019
@JamesH65
Copy link
Contributor

JamesH65 commented Jul 3, 2019

Cannot wait for CE, so merging.

@ghost
Copy link
Author

ghost commented Jul 3, 2019

Note that this PR on its own does not create ANY links to the new page documenting GPIO boot mode. I have created a new PR, #1194, to add a suitable link from the main bootmodes documentation page. Pinging @JamesH65.

@ghost ghost deleted the patch-3 branch July 3, 2019 18:53
JamesH65 pushed a commit that referenced this pull request Jul 4, 2019
* hardware/raspberrypi/bootmodes/README.md: add link to gpio.md

#1131 created gpio.md, but didn't create any links to it from other pages. This adds a link in the appropriate place in the bootmodes docs.

* Fix capitalisation so it matches other links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants