User avatar
adun
Posts: 103
Joined: Fri Mar 20, 2015 9:25 am
Location: Switzerland

BCM2835 boot modes and BIOS chip

Mon Apr 27, 2015 2:23 am

I would like to pick up an idea that mahjongg postet in this thread about a possible BIOS chip implementation:
mahjongg wrote:actually, but this is an educated guess, as I don't know exactly how the SD-card is addressed during booting, but IF it happens to use the simple SPI mode (which all SD-Cards support, as a baseline communications mode), then there could be a way to provide a PI with an extended boot mechanism. Its an idea which I have mentioned before to moderators and staffers but which was never picked up.

IF the GPU uses the SPI (single-bit serial) protocol, then it may be possible to add some digital multiplex logic, so that after a reset the PI boots through SPI not from the SD-Card but from a standard SPI EEPROM.
The code in the EEPROM could contain slightly smarter software than what is now used, and offer some extra's in line with PCBIOS chips, initializing the GPU for a default video mode (VGA 640x480), then on a keypress offer a BIOS menu, which gives the ability to direct the rest of the boot process to something other than the SD-Card, and perhaps a few important "BIOS settings", now handled by config.txt, which can be stored in the same EEPROM.
When the "BIOS code" is exited the digital multiplexers are reset so the SD-Card interface is reset to the SD_card instead of a serial EEPROM.

This would give a situation almost identical to modern PC's.

it does rely however on the ability of the hardcoded bootcode to boot from SPI EEPROM instead of the card, it also requires a tiny amount of extra hardware.
My first thought was that if we could use the second sd port (SD1) for a "bios chip" EEPROM a SPI multiplexer wouldn't be necessary.
But after a little research I stumbled across this thread where gsh posted a list of possible boot modes:
gsh wrote:Flash
I2C slave
SPI
Host
SD (broadcom or SDHCI interface)

The flash interface isn't much cop because it is a little limited to which devices it will support, It could be enabled for compute module rather than the eMMC but would be difficult to do!

I2C / SPI slave interfaces, currently undocumented (will happen at some time) but quite slow to push the bootcode through that interface. Note this is slave only not I2C to an external eeprom or anything...

Host is not accessible on CM or Pi (the pins don't get out)

So actually USB and SD are currently the only ones that make sense

Gordon
So the 5 possible boot modes of the BCM2835 are:
  • Flash
  • I2C/SPI Slave
  • Host
  • SD / eMMC
  • USB (Slave)
The alternative boot modes would give another possibility to use something like a "BIOS" chip to select a boot device (including USB) without the need of a flashed SD-Card/eMMC
But first I have some basic questions which I hope somebody will be able to anserwer ;)
  • Does the "Flash"-mode use the SMI (Secondary Memory Interface) with GPIO mode ALT1 and is this meant to talk to NAND chips ?
  • SPI Slave is obviously on GPIO 18-21 with mode ALT3 but which pins can be used for I2C Slave ?
  • are there more informations about the "host"-pins/-interface and is there a reason why they are not accessible on the CM ?
  • Does the SD boot mode also include boot from SD1(Second SD Interface) on GPIO 22-27 (ALT3) or only from SD0 (GPIO 47-53) ? This would also be interesting for a HAT with a second SD slot
  • How are the boot modes selected ?
The next step would be to check the Linux driver availability for those interfaces
Last edited by adun on Mon Apr 27, 2015 5:04 pm, edited 1 time in total.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: BCM2835 boot modes and BIOS chip

Mon Apr 27, 2015 3:34 am

Check out Berryboot:

http://www.berryterminal.com/doku.php/berryboot

cheers,
marcus
;)
marcus
:ugeek:

User avatar
rpdom
Posts: 18002
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: BCM2835 boot modes and BIOS chip

Mon Apr 27, 2015 5:17 am

adun wrote:SPI Slave is obviously on GPIO 18-21 with mode ALT3 but which pins can be used for I2C Slave ?
The I2C (BSC) Slave connections also seem to be on GPIO 18 and 19 in mode ALT3,

See page 160 in the BCM2385 ARM Peripherals document:
The BSC interface can be used as either a Broadcom Serial Controller (BSC) or a Serial
Peripheral Interface (SPI) controller.
(BSC is Broadcom's version of I2C)

User avatar
adun
Posts: 103
Joined: Fri Mar 20, 2015 9:25 am
Location: Switzerland

Re: BCM2835 boot modes and BIOS chip

Wed Apr 29, 2015 10:50 am

Thanks for the replies.
I already know berrryboot. But berryboot is like noobs. It needs a pre flashed SD card.

I think I will try to play around with the I2C/SPI Slave Interface.
My thought was to send bootcode (bootcode.bin etc) from a ATmega328P to the BCM2835.
Are there more informations about this especially how to enable I2C/SPI as boot mode ?

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: BCM2835 boot modes and BIOS chip

Mon May 18, 2015 4:48 pm

adun wrote:Thanks for the replies.
I already know berrryboot. But berryboot is like noobs. It needs a pre flashed SD card.

I think I will try to play around with the I2C/SPI Slave Interface.
My thought was to send bootcode (bootcode.bin etc) from a ATmega328P to the BCM2835.
Are there more informations about this especially how to enable I2C/SPI as boot mode ?
you can dump the OTP and disasm it

hippy
Posts: 8926
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: BCM2835 boot modes and BIOS chip

Mon May 18, 2015 5:10 pm

adun wrote:I already know berrryboot. But berryboot is like noobs. It needs a pre flashed SD card.
Where as this needs extra hardware which itself has to be programmed or purchased pre-programmed.

I can appreciate the idea behind adding a BIOS but I don't believe it is that practical nor useful for most people or use cases, and I very much doubt the Foundation are likely to seize on the idea of adding that capability themselves. In practice it would be much easier for anyone who wanted such a BIOS capability to add an I2C EEPROM and simply drop the BIOS software in the root directory of their card. Even easier if there's a utility to add the BIOS settings on a card as it is created.

That said; figuring out how to boot without an SD card is a worthwhile venture because it may open up possibilities which may not seem immediately obvious or worthwhile. Being able to boot a Pi or cluster of Pi's from a PC or a single Pi would have use for some people so please do keep exploring the possibilities even though I'm not convinced of the BIOS idea.

MADSAM
Posts: 3
Joined: Sun Jul 24, 2016 4:55 pm

Re: BCM2835 boot modes and BIOS chip

Thu Jan 05, 2017 5:55 pm

There already is a bios on the pi, how else would it know to read the sd card first. also the sd card has a micro controller similar to the 8051 which could be hiding something, still figuring it out. It would be a good idea to find the processor (BCM) on the PI then find out what processor company was bought out to make the BCM and find the programing language that it used, which was, I am no sure, but, MIPS maybe. after that, you would need to create a compiler in c that compiles the MIPS code into a .BIN file and slowly work your way around all the bull @#$%. before any of that you need to wipe the sd card so that it shows all zeroes, which requires some old OS like windows 98 to wipe it with some program that doesn't fake wipe it.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 10298
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: BCM2835 boot modes and BIOS chip

Thu Jan 05, 2017 6:58 pm

This again?
What processor company? Alphamosaic. No, it's not mips.
Yes there is a boot rom - that was what was updated on the Pi3 to support network and usb booting.
Rom should be the key thing to note - you aren't going to be changing it.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Compute Module”