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 = 0xFC000000,
21 .busdram = 0xC0000000,
26 .armlocal = 0xFF800000,
27 .pciwin = 0x0600000000ULL,
33 Wdogtime = 10, /* seconds, ≤ 15 */
37 * Power management / watchdog registers
49 * Arm local regs for smp
76 r = (u32int*)POWERREGS;
77 r[Wdog] = Password | 1;
78 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
89 r = (u32int*)POWERREGS;
90 r[Wdog] = Password | (Wdogtime * Wdogfreq);
91 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
99 r = (u32int*)POWERREGS;
100 r[Rstc] = Password | (r[Rstc] & ~CfgMask);
105 cputype2name(char *buf, int size)
111 part = (r >> 4) & 0xFFF;
114 p = seprint(buf, buf + size, "Cortex-A7");
117 p = seprint(buf, buf + size, "Cortex-A53");
120 p = seprint(buf, buf + size, "Cortex-A72");
123 p = seprint(buf, buf + size, "Unknown-%#x", part);
126 seprint(p, buf + size, " r%udp%ud", (r >> 20) & 0xF, r & 0xF);
135 cputype2name(name, sizeof name);
136 iprint("cpu%d: %dMHz ARM %s\n", m->machno, m->cpumhz, name);
148 p = getconf("*ncpu");
149 if(p && (max = atoi(p)) > 0 && n > max)
159 mb = (Mboxes*)(ARMLOCAL + Mboxregs);
160 mb->clr[cpu].mbox1 = 1;
168 mb = (Mboxes*)(ARMLOCAL + Mboxregs);
169 mb->set[cpu].mbox1 = 1;
175 // addclock0link(wdogfeed, HZ);