/* initialise once then preserve */
static volatile uint32_t piCores = 0;
+static volatile uint32_t pi_ispi = 0;
static volatile uint32_t pi_peri_phys = 0x20000000;
static volatile uint32_t pi_dram_bus = 0x40000000;
static volatile uint32_t pi_mem_flag = 0x0C;
{
DBG(DBG_STARTUP, "");
+ if (!pi_ispi)
+ {
+ DBG(DBG_ALWAYS,
+ "\n" \
+ "+---------------------------------------------------------+\n" \
+ "|Sorry, this system does not appear to be a raspberry pi. |\n" \
+ "|aborting. |\n" \
+ "+---------------------------------------------------------+\n\n");
+ return -1;
+ }
+
if ((fdMem = open("/dev/mem", O_RDWR | O_SYNC) ) < 0)
{
DBG(DBG_ALWAYS,
}
}
+ if (!strncasecmp("hardware\t: BCM", buf, 14)) {
+ int bcmno = atoi(buf+14);
+ if ((bcmno == 2708) || (bcmno == 2709) || (bcmno == 2710) || (bcmno == 2835) || (bcmno == 2836) || (bcmno == 2837)) {
+ pi_ispi = 1;
+ }
+ }
+
if (!strncasecmp("revision\t:", buf, 10))
{
if (sscanf(buf+10, "%x%c", &rev, &term) == 2)