Skip to content

Instantly share code, notes, and snippets.

@kazcw
Last active November 8, 2021 18:11
Show Gist options
  • Save kazcw/b3ce0fc4095484d645a0414eaf097ded to your computer and use it in GitHub Desktop.
Save kazcw/b3ce0fc4095484d645a0414eaf097ded to your computer and use it in GitHub Desktop.
distinguish Raspberry Pi 4 steppings
#!/bin/sh
# Distinguishes B0 from C0. Likely won't distinguish C0 from whatever comes next.
SD=$(od -An -tx1 -w24 /proc/device-tree/emmc2bus/dma-ranges | tr -d ' ')
if [ $SD = 00000000c0000000000000000000000040000000 ]; then echo B0; exit; fi
if [ $SD = 00000000000000000000000000000000fc000000 ]; then echo C0; exit; fi
echo '??'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment