2 * bcm2711 (e.g.raspberry pi 4) architecture-specific stuff
6 #include "../port/lib.h"
10 #include "../port/error.h"
14 typedef struct Mbox Mbox;
15 typedef struct Mboxes Mboxes;
17 #define POWERREGS (VIRTIO+0x100000)
20 .dramsize = 0x40000000,
21 .busdram = 0xC0000000,
26 .armlocal = 0xFF800000,
27 .pciwin = 0x0600000000ULL,
32 Wdogtime = 10, /* seconds, ≤ 15 */
36 * Power management / watchdog registers
48 * Arm local regs for smp
75 r = (u32int*)POWERREGS;
76 r[Wdog] = Password | 1;
77 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
88 r = (u32int*)POWERREGS;
89 r[Wdog] = Password | (Wdogtime * Wdogfreq);
90 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
98 r = (u32int*)POWERREGS;
99 r[Rstc] = Password | (r[Rstc] & ~CfgMask);
104 cputype2name(char *buf, int size)
110 part = (r >> 4) & 0xFFF;
113 p = seprint(buf, buf + size, "Cortex-A7");
116 p = seprint(buf, buf + size, "Cortex-A53");
119 p = seprint(buf, buf + size, "Cortex-A72");
122 p = seprint(buf, buf + size, "Unknown-%#x", part);
125 seprint(p, buf + size, " r%udp%ud", (r >> 20) & 0xF, r & 0xF);
134 cputype2name(name, sizeof name);
135 iprint("cpu%d: %dMHz ARM %s\n", m->machno, m->cpumhz, name);
147 p = getconf("*ncpu");
148 if(p && (max = atoi(p)) > 0 && n > max)
158 mb = (Mboxes*)(ARMLOCAL + Mboxregs);
159 mb->clr[cpu].mbox1 = 1;
167 mb = (Mboxes*)(ARMLOCAL + Mboxregs);
168 mb->set[cpu].mbox1 = 1;
174 // addclock0link(wdogfeed, HZ);