Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: bmarkus on June 10, 2016, 08:30:35 AM

Title: RPi model ID
Post by: bmarkus on June 10, 2016, 08:30:35 AM
I need your help. In the current 7.x/8.x piCore version /proc/device-tree/model contains the board type and version. If you can report this for your card, it would help to develop piCore 8.0 as I do not have all the available cards in hand. You can share it here. Please report not only the file content but the commercial name of the board and piCore version too.

Thanks!
Title: Re: RPi model ID
Post by: patrikg on June 10, 2016, 10:42:45 AM
I have the B model with 256M Memory
Booting up with uboot and device tree and nfs.

Here are the family picture of all pi's.
http://raspi.tv/2016/raspberry-pi-family-photo-updated-to-include-pi3b-29-feb-2016

Running the latest.
piCore-8.0beta1.img

Having this from the command added echo command for line feed.

Code: (bash) [Select]
tc@box:/sys/firmware/devicetree/base$ cat model ; echo
Raspberry Pi Model B
tc@box:/sys/firmware/devicetree/base$ uname -a
Linux box 4.4.11-piCore+ #1 Sat May 21 18:06:04 CEST 2016 armv6l GNU/Linux
tc@box:/sys/firmware/devicetree/base$ free -m
             total       used       free     shared    buffers     cached
Mem:           228        113        115          9          5         39
-/+ buffers/cache:         67        160
Swap:           50          0         50
tc@box:/sys/firmware/devicetree/base$ mount /mnt/mmcblk0p1/
tc@box:/sys/firmware/devicetree/base$ cat /mnt/mmcblk0p1/config.txt
gpu_mem=16
kernel=u-boot.bin
enable_uart=1

Title: Re: RPi model ID
Post by: jncl on June 10, 2016, 10:52:39 AM
Hi Béla,

Output of ''cat /proc/device-tree/model'' command:
Code: [Select]
Raspberry Pi B  : Raspberry Pi Model B Rev 1
Raspberry Pi A  : Raspberry Pi Model A Rev 2
Raspberry Pi B+ : Raspberry Pi Model B Plus Rev 1.2
Raspberry Pi 2B : Raspberry Pi 2 Model B Rev 1.1
Raspberry Pi 0  : Raspberry Pi ? Rev 1.2
Raspberry Pi 3B : Raspberry Pi 3 Model B Rev 1.2

HTH
  Jon
Title: Re: RPi model ID
Post by: Gerrelt on June 10, 2016, 10:55:40 AM
The order is:
1. Commercial model name
2. OS
3. output of cat /proc/device-tree/model

I am running two Pi's with Raspbian, so I've included them too.

1. Raspberry Pi 2 B
2. Raspbian Jessie
Raspberry Pi 2 Model B Rev 1.1

1. Raspberry Pi B
2. Raspbian Jessie
3. Raspberry Pi Model B Rev 2

1. Raspberry Pi B
2. piCore 7.1beta4
3. Raspberry Pi Model B Rev 2

1. Raspberry Pi B
2. piCore 7.0
3. Raspberry Pi Model B Rev 2

1. Raspberry Pi B (early 256Mb memory model)
2. piCore 7.0
3. Raspberry Pi Model B Rev 1
Title: Re: RPi model ID
Post by: patrikg on June 10, 2016, 11:34:13 AM
And what i can see..is the rev and serial gets from cmdline
Code: (bash) [Select]
tc@box:~$ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 0002
Serial          : 000000001234560b
tc@box:~$ cat /proc/cmdline
console=ttyAMA0,115200 root=/dev/ram0 elevator=deadline rootwait nortc loglevel=3 noembed tz=CET-1CEST,M3.5.0,M10.5.0/3 kmap=qwerty/sv-latin1 lang=sv_SE showapps bcm2708.boardrev=0x2 bcm2708.serial=0x1234560b nfsmount=10.42.0.1:/home/patrik/picore/ tce=nfs/tce8
Title: Re: RPi model ID
Post by: Greg Erskine on June 10, 2016, 04:29:20 PM
4.1.20-piCore+:  Raspberry Pi Zero:  Raspberry Pi Zero Rev 1.2
4.1.20-piCore+:  Raspberry Pi A+:    Raspberry Pi Model A Plus Rev 1.1
Slice 4.4.6:         Raspberry Pi CM:    Raspberry Pi Compute Module Rev 1.0
Title: Re: RPi model ID
Post by: tatemono on June 10, 2016, 08:15:00 PM
[1] HARDWARE: Its commercial name is "Raspberry Pi 3 Model B"
      (By the way, "Raspberry Pi 3 Model B V1.2" was printed on PCB.)

[2] O.S. versoin: TinyCoreLinux piCore 7.1 beta 4

[3] Information of /proc/device-tree/model
Code: [Select]
tc@box:~$ uname -a
Linux box 4.1.20-piCore_v7+ #1 SMP PREEMPT Sun Mar 20 11:51:29 CET 2016 armv7l GNU/Linux
tc@box:~$ cat /proc/device-tree/model ; echo
Raspberry Pi 3 Model B Rev 1.2
tc@box:~$
Title: Re: RPi model ID
Post by: Gerrelt on June 11, 2016, 03:56:47 AM
I'v upgraded a Model B to 8.0 beta1, the new information is now:


  uname info:      Linux 4-Gooseberry-PortableStereo 4.4.11-piCore+ #1 Sat May 21 18:06:04 CEST 2016 armv6l GNU/Linux
  os release:      8.0beta1
  pi model:        Raspberry Pi Model B Rev 2


BTW, os release can be obtained from  /usr/share/doc/tc/release.txt .
Title: Re: RPi model ID
Post by: Paul_123 on June 12, 2016, 07:48:06 AM
Just curious what you are planning with this info?   I have some other boards, that have not been reported,  but they are still running piCore 5.x
Title: Re: RPi model ID
Post by: bmarkus on June 12, 2016, 10:18:36 PM
Thank you everyone for the feedback  ;)
Title: Re: RPi model ID
Post by: bmarkus on June 12, 2016, 10:22:10 PM
Just curious what you are planning with this info?   I have some other boards, that have not been reported,  but they are still running piCore 5.x

In 7.x/8.x there is a tc Micropython module with some TC specific function. I want to add a a module (machine) to detect exact board type. It is needed to setup RPi serial console which is using different serial line than others due to onboard BT/WiFi
Title: Re: RPi model ID
Post by: sbp on June 13, 2016, 04:49:07 AM
Hi Bela

I don't know if you can use some of this, but in piCorePlayer Greg made this function to determine which RPi it is running on.

You probably don't need it all, but you should be able to get the RPI hardware.
 
Code: [Select]
#!/bin/sh
# pcp-rpi-functions
# These are the common Raspberry Pi functions used by piCorePlayer

# Version: 0.12 2016-05-08 GE
# Added Raspberry Pi TYPE.

# Version: 0.11 2016-04-22 GE
# Updated pcp_rpi_shortname.

# Version: 0.10 2016-03-01 GE
# Added support for Raspberry Pi 3B (not tested).

# Version: 0.09 2016-02-14 GE
# Updated temperature function.
# Updated for Raspberry Pi Zero.

# Version: 0.08 2015-11-27 GE
# Added Raspberry Pi Zero (not tested).

# Version: 0.07 2015-09-19 GE
# Added pcp_rpi_shortname.

# Version: 0.06 2015-05-30 GE
# Added pcp_rpi_warranty.

# Version: 0.05 2015-03-13 GE
# Added pcp_rpi_model_unknown, *0013 B+ and *0014 CM.

# Version: 0.05 2015-02-27 SBP
# Fixed support for Raspberry Pi 2 Model B.

# Version: 0.04 2015-02-05 GE
# Added support for Raspberry Pi 2 Model B.

# Version: 0.03 2014-12-08 SBP
# Added support for Raspberry Pi Model A+.

# Version: 0.02 2014-10-26 GE
# Added pcp_rpi_thermal and pcp_rpi_thermal_temp.

# Version: 0.01 2014-10-22 GE
# Original.

#=========================================================================================
# Determine revisions and features of Raspberry Pi
#-----------------------------------------------------------------------------------------
# References:
#   http://elinux.org/RPi_HardwareHistory#Board_Revision_History
#   http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=32733&p=301930&hilit=revision+identification&sid=e70960c27964330d9677de2eff077b80#p301930
#   http://raspberryalphaomega.org.uk/2013/02/06/automatic-raspberry-pi-board-revision-detection-model-a-b1-and-b2/
#   git://git.drogon.net/wiringPi

# For RPi1:
#    100000e
#    |  ---- Revision
#    Warranty bit

# For RPi2:
#    [USER:8] [NEW:1] [MEMSIZE:3] [MANUFACTURER:4] [PROCESSOR:4] [TYPE:8] [REV:4]
#    NEW            23: will be 1 for the new scheme, 0 for the old scheme
#    MEMSIZE        20: 0=256M    1=512M    2=1G
#    MANUFACTURER   16: 0=SONY    1=EGOMAN  2=EMBEST
#    PROCESSOR      12: 0=2835    1=2836   
#    TYPE           04: 0=MODELA  1=MODELB  2=MODELA+   3=MODELB+  4=MODEL 2B  5=ALPHA???
#                       6=CM      7=???     8=MODEL 3B  9=ZERO
#    REV            00: 0=REV0    1=REV1    2=REV2

#    *a21041
#    ||||||1=REV1
#    |||||4=Pi2 MODEL B
#    ||||0=2835
#    |||1=EGOMAN
#    ||2=1G
#    |USER
#    Warranty bit
#-----------------------------------------------------------------------------------------
pcp_rpi_revision() {
awk -F: '/^Revision/ { print $2 }' /proc/cpuinfo | sed 's/ //g'
}

pcp_rpi_details() {
case $(pcp_rpi_revision) in
*Beta)  TYPE=1;  MODEL=B;    PCBREV=Beta; MEMORY=256;;
*0002)  TYPE=1;  MODEL=B;    PCBREV=1;    MEMORY=256;;
*0003)  TYPE=1;  MODEL=B;    PCBREV=1+;   MEMORY=256;;
*0004)  TYPE=1;  MODEL=B;    PCBREV=2;    MEMORY=256;;
*0005)  TYPE=1;  MODEL=B;    PCBREV=2;    MEMORY=256;;
*0006)  TYPE=1;  MODEL=B;    PCBREV=2;    MEMORY=256;;
*0007)  TYPE=1;  MODEL=A;    PCBREV=2;    MEMORY=256;;
*0008)  TYPE=1;  MODEL=A;    PCBREV=2;    MEMORY=256;;
*0009)  TYPE=1;  MODEL=A;    PCBREV=2;    MEMORY=256;;
*000d)  TYPE=1;  MODEL=B;    PCBREV=2;    MEMORY=512;;
*000e)  TYPE=1;  MODEL=B;    PCBREV=2;    MEMORY=512;;
*000f)  TYPE=1;  MODEL=B;    PCBREV=2;    MEMORY=512;;
*0010)  TYPE=1;  MODEL=B+;   PCBREV=1.2;  MEMORY=512;;
*0011)  TYPE=1;  MODEL=CM;   PCBREV=1.0;  MEMORY=512;;
*0012)  TYPE=1;  MODEL=A+;   PCBREV=1;    MEMORY=256;;
*0013)  TYPE=1;  MODEL=B+;   PCBREV=1.2;  MEMORY=512;;
*0014)  TYPE=1;  MODEL=CM;   PCBREV=1.1;  MEMORY=512;; # Check PCBREV
*0015)  TYPE=1;  MODEL=A+;   PCBREV=1.1;  MEMORY=256;;
*041)   TYPE=2;  MODEL=2B;   PCBREV=1;    MEMORY=1024;;
*092)   TYPE=0;  MODEL=ZERO; PCBREV=1.2;  MEMORY=512;;
*082)   TYPE=3;  MODEL=3B;   PCBREV=1.2;  MEMORY=1024;; # a22082
*)      TYPE=99; MODEL=?;    PCBREV=?;    MEMORY=?;;
esac

case "${MODEL}${PCBREV}" in
B1)    HARDWARE=BCM2708; ETHER=1; USB=2; LED=5; P2PINS=1; HOLES=0; PIN3=0; PIN5=1; PIN13=21; I2C=0; P5=0; P6=0;;
B1+)   HARDWARE=BCM2708; ETHER=1; USB=2; LED=5; P2PINS=0; HOLES=0; PIN3=0; PIN5=1; PIN13=21; I2C=0; P5=0; P6=0;;
B2)    HARDWARE=BCM2708; ETHER=1; USB=2; LED=5; P2PINS=0; HOLES=2; PIN3=1; PIN5=2; PIN13=27; I2C=1; P5=8; P6=2;;
A2)    HARDWARE=BCM2708; ETHER=0; USB=1; LED=2; P2PINS=0; HOLES=2; PIN3=1; PIN5=2; PIN13=27; I2C=1; P5=8; P6=2;;
B+*)   HARDWARE=BCM2708; ETHER=1; USB=4; LED=2; P2PINS=0; HOLES=4; PIN3=X; PIN5=X; PIN13=X;  I2C=X; P5=X; P6=X;;
CM*)   HARDWARE=BCM2708; ETHER=0; USB=0; LED=X; P2PINS=0; HOLES=0; PIN3=X; PIN5=X; PIN13=X;  I2C=X; P5=X; P6=X;;
A+*)   HARDWARE=BCM2708; ETHER=0; USB=1; LED=2; P2PINS=0; HOLES=4; PIN3=1; PIN5=2; PIN13=X;  I2C=X; P5=X; P6=X;;
2B*)   HARDWARE=BCM2709; ETHER=1; USB=4; LED=2; P2PINS=0; HOLES=4; PIN3=X; PIN5=X; PIN13=X;  I2C=X; P5=X; P6=X;;
ZERO*) HARDWARE=BCM2708; ETHER=0; USB=1; LED=2; P2PINS=0; HOLES=4; PIN3=X; PIN5=X; PIN13=X;  I2C=X; P5=X; P6=X;;
3B*)   HARDWARE=BCM2710; ETHER=1; USB=4; LED=2; P2PINS=0; HOLES=4; PIN3=X; PIN5=X; PIN13=X;  I2C=X; P5=X; P6=X;;
*)     HARDWARE=X;       ETHER=X; USB=X; LED=X; P2PINS=X; HOLES=X; PIN3=X; PIN5=X; PIN13=X;  I2C=X; P5=X; P6=X;;
esac
}

pcp_pb_get() {
echo $1 | tr a-zA-Z n-za-mN-ZA-M
}

#=========================================================================================
# Type
#-----------------------------------------------------------------------------------------
pcp_rpi_is_rpi0() {
pcp_rpi_details
[ $TYPE -eq 0 ] && echo 0 || echo 1
}

pcp_rpi_is_rpi1() {
pcp_rpi_details
[ $TYPE -eq 1 ] && echo 0 || echo 1
}

pcp_rpi_is_rpi2() {
pcp_rpi_details
[ $TYPE -eq 2 ] && echo 0 || echo 1
}

pcp_rpi_is_rpi3() {
pcp_rpi_details
[ $TYPE -eq 3 ] && echo 0 || echo 1
}

pcp_rpi_type() {
pcp_rpi_details
echo $TYPE
}

#=========================================================================================
# Model
#-----------------------------------------------------------------------------------------
pcp_rpi_model() {
pcp_rpi_details
echo $MODEL
}

pcp_rpi_model_unknown() {
pcp_rpi_details
[ "$MODEL" = "?" ] && echo 0 || echo 1
}

# The shortname is a unique identifier intended to be used with pastebin uploading
pcp_rpi_shortname() {
pcp_rpi_details
if [ "$MODEL" = "A" ] || [ "$MODEL" = "A+" ] || [ "$MODEL" = "ZERO" ]; then
SHORTMAC=$(pcp_wlan0_mac_address)
else
SHORTMAC=$(pcp_eth0_mac_address)
fi
SHORTMAC=$(echo $SHORTMAC | sed 's/://g')
echo "pCP-$(pcp_rpi_model)-${SHORTMAC:6}"
}

pcp_rpi_is_model_A() {
pcp_rpi_details
[ "$MODEL" = "A" ] && echo 0 || echo 1
}

pcp_rpi_is_model_B() {
pcp_rpi_details
[ "$MODEL" = "B" ] && echo 0 || echo 1
}

pcp_rpi_is_model_B_rev_1() {
pcp_rpi_details
([ "$MODEL" = "B" ] && [ "$PCBREV" = "1" ]) && echo 0 || echo 1
}

pcp_rpi_is_model_B_rev_2() {
pcp_rpi_details
([ "$MODEL" = "B" ] && [ "$PCBREV" = "2" ]) && echo 0 || echo 1
}

pcp_rpi_is_model_Bplus() {
pcp_rpi_details
[ "$MODEL" = "B+" ] && echo 0 || echo 1
}

pcp_rpi_is_model_CM() {
pcp_rpi_details
[ "$MODEL" = "CM" ] && echo 0 || echo 1
}

pcp_rpi_is_model_Aplus() {
pcp_rpi_details
[ "$MODEL" = "A+" ] && echo 0 || echo 1
}

pcp_rpi_is_model_2B() {
pcp_rpi_details
[ "$MODEL" = "2B" ] && echo 0 || echo 1
}

pcp_rpi_is_model_zero() {
pcp_rpi_details
[ "$MODEL" = "ZERO" ] && echo 0 || echo 1
}

pcp_rpi_is_model_3B() {
pcp_rpi_details
[ "$MODEL" = "3B" ] && echo 0 || echo 1
}

PB101=$(cat $PB100)
set -- $PB101
PB102=$(pcp_pb_get $1)
PB103=$(pcp_pb_get $2)
PB104=$(pcp_pb_get $3)

#=========================================================================================
# Revision
#-----------------------------------------------------------------------------------------
pcp_rpi_pcb_revision() {
pcp_rpi_details
echo $PCBREV
}

pcp_rpi_is_hat() {
pcp_rpi_details
[ "$HOLES" = "4" ] && echo 0 || echo 1
}

pcp_rpi_warranty() {
case $(pcp_rpi_revision) in
100* | 2*)
echo 0
;;
*)
echo 1
;;
esac
}

#=========================================================================================
# Memory
#-----------------------------------------------------------------------------------------
pcp_rpi_memory() {
pcp_rpi_details
echo $MEMORY
}

pcp_rpi_is_memory_256() {
pcp_rpi_details
[ "$MEMORY" = "256" ] && echo 0 || echo 1
}

pcp_rpi_is_memory_512() {
pcp_rpi_details
[ "$MEMORY" = "512" ] && echo 0 || echo 1
}

pcp_rpi_is_memory_1024() {
pcp_rpi_details
[ "$MEMORY" = "1024" ] && echo 0 || echo 1
}

API_DEV_KEY=$PB102
API_USER_NAME=$PB103
API_USER_PASSWORD=$PB104

#=========================================================================================
# Temperature
#
# Options:
# mode
# policy
# passive
# temp
# trip_point_0_temp
# trip_point_0_type
# type
# uevent
#-----------------------------------------------------------------------------------------
pcp_rpi_thermal() {
cat /sys/devices/virtual/thermal/thermal_zone0/$1
}

pcp_rpi_thermal_temp() {
TEMP_IN_DEGRESS=$(pcp_rpi_thermal "temp")
if [ "$1" = "degrees" ]; then
printf "%.f" $((($TEMP_IN_DEGRESS+500)/1000))
else
printf "%s" $TEMP_IN_DEGRESS
fi
}

Title: Re: RPi model ID
Post by: patrikg on June 14, 2016, 07:49:44 AM
Thiking of this thread.
http://forum.tinycorelinux.net/index.php/topic,19801.msg122872.html#msg122872
If initrd could detect witch version of rasp. or maybe could add two lines with serial console.
Title: Re: RPi model ID
Post by: jncl on June 17, 2016, 10:38:20 AM
Hi Béla,

    Latest version of Pi Zero, with Camera connector, reports: Raspberry Pi Zero Rev 1.3

HTH

  Jon
Title: Re: RPi model ID
Post by: josep on June 20, 2016, 03:12:25 AM
Hi,

   RPI 3 Model B Rev 1.2
Title: Re: RPi model ID
Post by: bmarkus on June 20, 2016, 06:38:01 AM
   RPI 3 Model B Rev 1.2

Thanks