Revision b6b8bd18 hw/ppc_prep.c
b/hw/ppc_prep.c | ||
---|---|---|
26 | 26 |
//#define HARD_DEBUG_PPC_IO |
27 | 27 |
//#define DEBUG_PPC_IO |
28 | 28 |
|
29 |
#define KERNEL_LOAD_ADDR 0x01000000; |
|
30 |
#define INITRD_LOAD_ADDR 0x01800000; |
|
29 |
#define BIOS_FILENAME "ppc_rom.bin" |
|
30 |
#define KERNEL_LOAD_ADDR 0x01000000 |
|
31 |
#define INITRD_LOAD_ADDR 0x01800000 |
|
31 | 32 |
|
32 | 33 |
extern int loglevel; |
33 | 34 |
extern FILE *logfile; |
... | ... | |
39 | 40 |
#if defined (HARD_DEBUG_PPC_IO) |
40 | 41 |
#define PPC_IO_DPRINTF(fmt, args...) \ |
41 | 42 |
do { \ |
42 |
if (loglevel > 0) { \
|
|
43 |
if (loglevel & CPU_LOG_IOPORT) { \
|
|
43 | 44 |
fprintf(logfile, "%s: " fmt, __func__ , ##args); \ |
44 | 45 |
} else { \ |
45 | 46 |
printf("%s : " fmt, __func__ , ##args); \ |
... | ... | |
48 | 49 |
#elif defined (DEBUG_PPC_IO) |
49 | 50 |
#define PPC_IO_DPRINTF(fmt, args...) \ |
50 | 51 |
do { \ |
51 |
if (loglevel > 0) { \
|
|
52 |
if (loglevel & CPU_LOG_IOPORT) { \
|
|
52 | 53 |
fprintf(logfile, "%s: " fmt, __func__ , ##args); \ |
53 | 54 |
} \ |
54 | 55 |
} while (0) |
... | ... | |
56 | 57 |
#define PPC_IO_DPRINTF(fmt, args...) do { } while (0) |
57 | 58 |
#endif |
58 | 59 |
|
59 |
#define BIOS_FILENAME "ppc_rom.bin" |
|
60 | 60 |
/* Constants for devices init */ |
61 | 61 |
static const int ide_iobase[2] = { 0x1f0, 0x170 }; |
62 | 62 |
static const int ide_iobase2[2] = { 0x3f6, 0x376 }; |
... | ... | |
175 | 175 |
uint32_t eemck1; |
176 | 176 |
/* Error diagnostic */ |
177 | 177 |
} XCSR; |
178 |
#endif |
|
179 | 178 |
|
180 | 179 |
static void PPC_XCSR_writeb (void *opaque, target_phys_addr_t addr, uint32_t value) |
181 | 180 |
{ |
... | ... | |
242 | 241 |
&PPC_XCSR_readw, |
243 | 242 |
&PPC_XCSR_readl, |
244 | 243 |
}; |
244 |
#endif |
|
245 | 245 |
|
246 | 246 |
/* Fake super-io ports for PREP platform (Intel 82378ZB) */ |
247 | 247 |
typedef struct sysctrl_t { |
... | ... | |
413 | 413 |
const char *initrd_filename) |
414 | 414 |
{ |
415 | 415 |
char buf[1024]; |
416 |
// void *openpic; |
|
417 | 416 |
m48t59_t *nvram; |
418 | 417 |
int PPC_io_memory; |
419 | 418 |
int ret, linux_boot, i, nb_nics1, fd; |
... | ... | |
506 | 505 |
bs_table[2 * i], bs_table[2 * i + 1]); |
507 | 506 |
} |
508 | 507 |
kbd_init(); |
509 |
DMA_init(); |
|
508 |
DMA_init(1);
|
|
510 | 509 |
// AUD_init(); |
511 | 510 |
// SB16_init(); |
512 | 511 |
|
... | ... | |
528 | 527 |
PPC_intack_write, NULL); |
529 | 528 |
cpu_register_physical_memory(0xBFFFFFF0, 0x4, PPC_io_memory); |
530 | 529 |
/* PowerPC control and status register group */ |
530 |
#if 0 |
|
531 | 531 |
PPC_io_memory = cpu_register_io_memory(0, PPC_XCSR_read, PPC_XCSR_write, NULL); |
532 | 532 |
cpu_register_physical_memory(0xFEFF0000, 0x1000, PPC_io_memory); |
533 |
#endif |
|
533 | 534 |
|
534 |
nvram = m48t59_init(8, 0x0074, NVRAM_SIZE); |
|
535 |
nvram = m48t59_init(8, 0, 0x0074, NVRAM_SIZE);
|
|
535 | 536 |
if (nvram == NULL) |
536 | 537 |
return; |
537 | 538 |
sysctrl->nvram = nvram; |
... | ... | |
539 | 540 |
/* Initialise NVRAM */ |
540 | 541 |
PPC_NVRAM_set_params(nvram, NVRAM_SIZE, "PREP", ram_size, boot_device, |
541 | 542 |
kernel_base, kernel_size, |
542 |
(uint32_t)(long)kernel_cmdline, |
|
543 |
strlen(kernel_cmdline), |
|
543 |
kernel_cmdline, |
|
544 | 544 |
initrd_base, initrd_size, |
545 | 545 |
/* XXX: need an option to load a NVRAM image */ |
546 |
0 |
|
547 |
); |
|
548 |
|
|
549 |
/* Special port to get debug messages from Open-Firmware */ |
|
550 |
register_ioport_write(0xFF00, 0x04, 1, &PREP_debug_write, NULL); |
|
551 |
register_ioport_write(0xFF00, 0x04, 2, &PREP_debug_write, NULL); |
|
546 |
0, |
|
547 |
graphic_width, graphic_height, graphic_depth); |
|
552 | 548 |
|
553 | 549 |
pci_ppc_bios_init(); |
554 | 550 |
} |
Also available in: Unified diff