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)
19 .busdram = 0x40000000,
22 .l1ptedramattrs = Cached | Buffered,
23 .l2ptedramattrs = Cached | Buffered,
28 Wdogtime = 10, /* seconds, ≤ 15 */
32 * Power management / watchdog registers
54 r = (u32int*)POWERREGS;
55 r[Wdog] = Password | 1;
56 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
67 r = (u32int*)POWERREGS;
68 r[Wdog] = Password | (Wdogtime * Wdogfreq);
69 r[Rstc] = Password | (r[Rstc] & ~CfgMask) | CfgReset;
77 r = (u32int*)POWERREGS;
78 r[Rstc] = Password | (r[Rstc] & ~CfgMask);
82 cputype2name(char *buf, int size)
84 seprint(buf, buf + size, "1176JZF-S");
93 cputype2name(name, sizeof name);
94 delay(50); /* let uart catch up */
95 print("cpu%d: %dMHz ARM %s\n", m->machno, m->cpumhz, name);
113 addclock0link(wdogfeed, HZ);
119 return (AP(3, (ap))|AP(2, (ap))|AP(1, (ap))|AP(0, (ap)));
123 cmpswap(long *addr, long old, long new)
125 return cas32(addr, old, new);