Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/mpc85xx/platform_mpc85xx.c
Context not available. | |||||
extern uint32_t *bootinfo; | extern uint32_t *bootinfo; | ||||
vm_offset_t ccsrbar_va; | vm_offset_t ccsrbar_va; | ||||
void mpc85xx_early_putc(int c); | |||||
int mpc85xx_early_getc(void); | |||||
jhibbits: These should probably be wrapped by #ifdef EARLY_PRINTF | |||||
static int cpu, maxcpu; | static int cpu, maxcpu; | ||||
static int mpc85xx_probe(platform_t); | static int mpc85xx_probe(platform_t); | ||||
Context not available. | |||||
uint64_t ccsrbar, ccsrsize; | uint64_t ccsrbar, ccsrsize; | ||||
int i, law_max, tgt; | int i, law_max, tgt; | ||||
jhibbitsUnsubmitted Not Done Inline ActionsSuperfluous blank line here. jhibbits: Superfluous blank line here. | |||||
if ((cpus = OF_finddevice("/cpus")) != -1) { | if ((cpus = OF_finddevice("/cpus")) != -1) { | ||||
for (maxcpu = 0, child = OF_child(cpus); child != 0; | for (maxcpu = 0, child = OF_child(cpus); child != 0; | ||||
child = OF_peer(child), maxcpu++) | child = OF_peer(child), maxcpu++) | ||||
Context not available. | |||||
return (0); | return (0); | ||||
} | } | ||||
#if defined(EARLY_PRINTF) | |||||
void | |||||
mpc85xx_early_putc(int c) | |||||
{ | |||||
int limit; | |||||
static vm_offset_t ccsr = 0xbffff000; | |||||
limit = 250000; | |||||
while ((*(volatile uint8_t*)(ccsr + 0x505)& 0x20) == 0 && --limit) | |||||
DELAY(4); | |||||
*(volatile uint8_t *)(ccsr + 0x500) = c; | |||||
limit = 250000; | |||||
while ((*(volatile uint8_t *)(ccsr + 0x505) & 0x40) == 0 && --limit) | |||||
DELAY(4); | |||||
} | |||||
int | |||||
mpc85xx_early_getc(void) | |||||
{ | |||||
static vm_offset_t ccsr = 0xbffff000; | |||||
while ((*(volatile uint8_t *)(ccsr + 0x505) & 0x1) == 0) | |||||
DELAY(100); | |||||
return *(volatile uint8_t *)(ccsr + 0x500); | |||||
} | |||||
early_putc = mpc85xx_early_putc; | |||||
early_getc = mpc85xx_early_getc; | |||||
jhibbitsUnsubmitted Not Done Inline ActionsThese aren't defined anywhere, only declared. These need to be: early_putc_t early_putc = ... Otherwise it doesn't compile. jhibbits: These aren't defined anywhere, only declared. These need to be:
early_putc_t early_putc = ... | |||||
#endif | |||||
Context not available. |
These should probably be wrapped by #ifdef EARLY_PRINTF