GithubHelp home page GithubHelp logo

larsth / c_raspberry_pi_revision Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andrewfrommelbourne/raspberry_pi_revision

0.0 2.0 0.0 20 KB

C code to decode the Revision: field of /proc/cpuinfo on the Raspberry Pi

License: MIT License

Makefile 0.98% C 99.02%

c_raspberry_pi_revision's Introduction

raspberry_pi_revision

C function to decode the Revision: field of /proc/cpuinfo on the Raspberry Pi.

Known revisions

The file /proc/cpuinfo contains a line such as:-

Revision : 0003

Prior to Raspberry Pi 2

that holds the revision number of the Raspberry Pi. Known revisions (prior to the Raspberry Pi 2) are:

Revision Model PCB Rev Memory Manufacture
0000
0001
0002 B 1 256 MB
0003 B 1 256 MB
0004 B 2 256 MB Sony
0005 B 2 256 MB Qisda
0006 B 2 256 MB Egoman
0007 A 2 256 MB Egoman
0008 A 2 256 MB Sony
0009 A 2 256 MB Qisda
000a
000b
000c
000d B 2 512 MB Egoman
000e B 2 512 MB Sony
000f B 2 512 MB Qisda
0010 B+ 1 512 MB Sony
0011 compute 1 512 MB Sony
0012 A+ 1 256 MB Sony
0013 B+ 1 512 MB Embest
0014 compute 1 512 MB Sony
0015 A+ 1 256 MB Sony

If the Raspberry Pi has been over-volted (voiding the warranty) the revision number will have 100 at the front. e.g. 1000002.

Raspberry Pi 2 / Model Zero

With the release of the Raspberry Pi 2, there is a new encoding of the Revision field in /proc/cpuinfo. The bit fields are as follows

FEDC BA98 7654 3210 FEDC BA98 7654 3210
HG FEEE DDDD CCCC BBBB BBBB AAAA
1098 7654 3210 9876 5432 1098 7654 3210
# bits contains values
A 00-03 PCB Revision (the pcb revision number)
B 04-11 Model name A, B, A+, B+, B Pi2, Alpha, Compute Module, unknown, Pi3, Zero
C 12-15 Processor BCM2835, BCM2836, BCM2837
D 16-19 Manufacturer Sony, Egoman, Embest, unknown, Embest
E 20-22 Memory size 256 MB, 512 MB, 1024 MB
F 23-23 encoded flag (if set, revision is a bit field)
G 24-24 waranty bit (if set, warranty void - Pre Pi2)
H 25-25 waranty bit (if set, warranty void - Post Pi2)

Also, due to some early issues the warranty bit has been move from bit 24 to bit 25 of the revision number (i.e. 0x2000000).

e.g.

Revision : A01041

A - PCB Revision - 1 (first revision)
B - Model Name - 4 (Model B Pi 2)
C - Processor - 1 (BCM2836)
D - Manufacturer - 0 (Sony)
E - Memory - 2 (1024 MB)
F - Endcoded flag - 1 (encoded cpu info)

Revision : A21041

A - PCB Revision - 1 (first revision)
B - Model Name - 4 (Model B Pi 2)
C - Processor - 1 (BCM2836)
D - Manufacturer - 2 (Embest)
E - Memory - 2 (1024 MB)
F - Endcoded flag - 1 (encoded cpu info)

Revision : 900092

A - PCB Revision - 2 (second revision)
B - Model Name - 9 (Model Zero)
C - Processor - 0 (BCM2835)
D - Manufacturer - 0 (Sony)
E - Memory - 1 (512 MB)
F - Endcoded flag - 1 (encoded cpu info)

Revision : A02082

A - PCB Revision - 2 (second revision)
B - Model Name - 8 (Model B Pi 3)
C - Processor - 2 (BCM2837)
D - Manufacturer - 0 (Sony)
E - Memory - 2 (1024 MB)
F - Endcoded flag - 1 (encoded cpu info)

c_raspberry_pi_revision's People

Contributors

andrewfrommelbourne avatar

Watchers

Lars Tørnes Hansen avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.