2 * bcm2835 (e.g. original raspberry pi) architecture-specific stuff
6 #include "../port/lib.h"
10 #include "../port/error.h"
14 #define POWERREGS (VIRTIO+0x100000)
18 .busdram = 0x40000000,
24 .l1ptedramattrs = Cached | Buffered,
25 .l2ptedramattrs = Cached | Buffered,
30 Wdogtime = 10, /* seconds, ≤ 15 */
34 * Power management / watchdog registers
56 r = (u32int*)POWERREGS;
57 r[Wdog] = Password | 1;
58 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
69 r = (u32int*)POWERREGS;
70 r[Wdog] = Password | (Wdogtime * Wdogfreq);
71 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
79 r = (u32int*)POWERREGS;
80 r[Rstc] = Password | (r[Rstc] & ~CfgMask);
84 cputype2name(char *buf, int size)
86 seprint(buf, buf + size, "1176JZF-S");
95 cputype2name(name, sizeof name);
96 delay(50); /* let uart catch up */
97 print("cpu%d: %dMHz ARM %s\n", m->machno, m->cpumhz, name);
115 addclock0link(wdogfeed, HZ);
121 return (AP(3, (ap))|AP(2, (ap))|AP(1, (ap))|AP(0, (ap)));
125 cmpswap(long *addr, long old, long new)
127 return cas32(addr, old, new);