4 ms·
The fact that the RPi has writable onboard state/storage of any kind whatsoever (save for the fuses which are WORM) comes as news to me. The SoC firmware is lo
by sneak 7y ago
The fact that the RPi has writable onboard state/storage of any kind whatsoever (save for the fuses which are WORM) comes as news to me.
The SoC firmware is loaded from the FAT partition on the SD card, so there is no “flashing” (in the traditional EEPROM sense) of the system firmware. Apparently the USB chip has its own EEPROM?
- cesarb 7y agoTo make things worse, AFAIK the USB chip is connected through PCIe, so unless the RPi has an IOMMU, it could in theory DMA to anywhere in the host memory.
- gjsman-1000 7y agoI don't know the details, but the memory controller is twice as fast for the SD card than the old Pi's are, and SOMETHING (I'm not sure for certain what, don't quote me) did change with the memory subsystem. This change is what allowed a workaround which allowed for 4GB of RAM for the first time (whereas before, the 1GB of RAM was a limitation throughout the SoC). So, it _may_ have a lite-IOMMU, but I'd open a forum posting for more info. Edit: This could also be why the SoC uses an EEPROM. The RPF said that booting the Pi4 with this new memory system is _much_ more complicated than booting a Pi3, and that permanently burning the boot code into the SoC (like on the Pi3 and earlier) was not an option for the Pi4. Extremely high risk of backfiring.
- makomk 7y agoAs far as I know, the SoC supported higher SD card speeds all the way back to the first Pi and the original drivers even tried to use them. The trouble is, the older Pis couldn't switch to the lower IO voltages required to actually operate at those speeds. Early adopters actually had to track down older, slower SD cards in order to use their Pis because otherwise SD card access would fail due to the driver erroneously switching speeds.
- gjsman-1000 7y agoYou're talking about the early problems using Class 10 cards which has been solved for a long time now. The Pi 4 upgrades the SD controller system (almost entirely) and is SD50 compliant, which means the SD card bus is roughly twice as fast as older models.
- gjsman-1000 7y agoAccording to the RPF: "The ARM cores are capable of running at up to 1.5 GHz, making the Pi 4 about 50% faster than the Raspberry Pi 3B+. The new VideoCore VI 3D unit now runs at up to 500 MHz. The ARM cores are 64-bit, and while the VideoCore is 32-bit, there is a new Memory Management Unit, which means it can access more memory than previous versions." https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/README.md https://www.raspberrypi.org/documentation/hardware/raspberry... So, MAYBE?
- paxswill 7y agoAn IOMMU serves a slightly different purpose than a normal MMU. The graphic on Wikipedia [0] sums it up pretty well. The lack of an IOMMU would mean that if the firmware on the USB controller was malicious in some way, it could access memory it would otherwise not have access to. 0: https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_ma...
- phh 7y agoI'm not seeing any iommu referenced in the device-tree, so I'd say you're right, at least in the current software.
- gjsman-1000 7y agoOn older Pi's, the Raspberry Pi had it's boot code completely burned into the SoC itself, permanently installed and unable to be tweaked post-launch. With the Pi 4, this was no longer possible. The Pi 4 uses a much more complicated way of booting up as well as some RAM tricks inside the SoC to allow for more than 1GB of RAM to mostly work without redoing all of the SoC (e.g. the VPU and Hardware Codec Blocks still only sees 1GB of RAM, but they will never need more than 1GB of RAM, as far as I know). This Pi no longer uses the `bootcode.bin` file older Pis used for this reason. Because of this, the Boot ROM is now a 500K EEPROM, which can be updated to allow things like USB boot, PXE boot, and similar to be added after launch. The USB Controller also has it's own EEPROM, which handles different things (I think).
- cesarb 7y ago> Because of this, the Boot ROM is now a 500K EEPROM [...] The USB Controller also has it's own EEPROM Can these two EEPROMs at least be flashed through test points, so they can be recovered without de-soldering if they're corrupted? (The RPi4 schematics on the site are next to useless.) That would also allow dumping both EEPROMs to compare them with a "known good" copy, in case there's any suspicion they've been maliciously modified.
- gjsman-1000 7y agohttps://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md https://www.raspberrypi.org/documentation/hardware/raspberry... This is all documentation on the SoC EEPROM available. (I don't believe there is any USB EEPROM information publicly available at the moment.) The good news: You don't need de-soldering to fix them. If you should corrupt the EEPROM, you can plug in an SD card with a special 'recovery.bin' file on it and it will re-flash the EEPROM itself. (This does mean that the Pi _technically_ has an extremely tiny boot ROM permanently installed in it still, but all it does is repair the boot EEPROM if it is damaged and start that boot EEPROM if it isn't damaged). You can also write-protect the EEPROMs with a special soldiered-on resistor on the board. As for dumping, no public info yet.
- Maxious 7y ago"it is possible to physically write-protect both EEPROMs [the boot EEPROM and the VLI EEPROM (USB controller)] via a simple resistor change on the board." https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md https://www.raspberrypi.org/documentation/hardware/raspberry...
- LeonM 7y ago> Apparently the USB chip has its own EEPROM? It is very common for a controller chip (USB, ethernet, bluetooth, wifi, SATA, etc) to contain a firmware EEPROM. Whether you can flash this firmware without an hardware programmer depends on the implementation. For embedded systems like the rPi, it is common for the engineers to implement peripheral programming capabilities from the main processor. Most laptops have that capability too, on both my Apple and Lenovo laptops i've seen firmware updates happening. On generic PC motherboards, this is less common. It comes down to the board designer connecting the programming pins of the peripheral device to the main CPU I/O.