Raspberry Pi hardware differentiation
Bill Antonia (2466) 130 posts |
I’ve seen a call somewhere to differentiate between different platforms, where at present I cannot recall at the moment, but is there a method to identify between the different versions of Raspberry Pi hardware, including the most recent B, version 2 running RiscOS RC14? |
GavinWraith (26) 1563 posts |
Terje Slettebo wrote a BASIC program called SysInfo, in 2010. It only works with ARMv7 CPUs. It gives masses of very detailed information – in particular about the instruction set of the CPU. So it will certainly distinguish between the two versions of the Rpi. I am not sure whether you can download it from somewhere. I will email Terje and ask him if it is OK for me to make it available. |
Bill Antonia (2466) 130 posts |
Thank you. What I’m trying to achieve is to modify my PiSPI module so it can identify between the earlier and most recent version of the hardware so I can choose between memory maps accordingly. |
Rick Murray (539) 13840 posts |
https://www.riscosopen.org/forum/forums/1/topics/3106#posts-39626 |
Bill Antonia (2466) 130 posts |
Thank you Rick, that code is useful as my module will only run on a Pi, so I’ll add this check to the initialisation code. You say offset 64 or 68 within the block provides more detail, I’ll experiment to see what values I can discover. |
Tank (53) 375 posts |
The GPIO module uses Rick’s method (obviously) so you could look here to see how that detects different versions of the Pi. |
GavinWraith (26) 1563 posts |
Terje replied saying that SysInfo was in the public domain. So if anybody wants a copy let them get in touch with me. |
David Feugey (2125) 2709 posts |
I do :) |
GavinWraith (26) 1563 posts |
OK. You can download it from here . |
David Feugey (2125) 2709 posts |
Yes! :) |
Bill Antonia (2466) 130 posts |
Just downloaded sysinfo, thank you. I’ll also use the code linked to by Rick and Tank, thank you. |
Bill Antonia (2466) 130 posts |
Wrote some code to look at offsets 64 and 68 from the returned OS_Hardware descriptor block, 64 has the board type and 68 contains the revision. The table HALDeviceComms_GPIO doesn’t show what I found but I assume the table needs updating. In addition to those listed, for the Raspberry Pi there should be Board Type 0, Revision 6. This is for the Raspberry Pi 2 Model B, I assume Revision 5 has been reserved for the Raspberry Pi 2 Model A. |
Steve Pampling (1551) 8170 posts |
Just log in and amend it as appropriate. |