1 |
/* |
/* |
2 |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: machine_netwinder.c,v 1.2 2006/01/08 11:05:03 debug Exp $ |
* $Id: machine_netwinder.c,v 1.13 2007/01/21 21:02:57 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
32 |
|
#include <stdlib.h> |
33 |
#include <string.h> |
#include <string.h> |
34 |
|
|
35 |
#include "bus_isa.h" |
#include "bus_isa.h" |
37 |
#include "device.h" |
#include "device.h" |
38 |
#include "devices.h" |
#include "devices.h" |
39 |
#include "machine.h" |
#include "machine.h" |
|
#include "machine_interrupts.h" |
|
40 |
#include "memory.h" |
#include "memory.h" |
41 |
#include "misc.h" |
#include "misc.h" |
42 |
|
|
43 |
|
|
44 |
MACHINE_SETUP(netwinder) |
MACHINE_SETUP(netwinder) |
45 |
{ |
{ |
46 |
|
char tmpstr[300]; |
47 |
|
struct pci_data *pci_bus; |
48 |
|
|
49 |
machine->machine_name = "NetWinder"; |
machine->machine_name = "NetWinder"; |
50 |
|
machine->stable = 1; |
51 |
|
|
52 |
if (machine->physical_ram_in_mb > 256) |
if (machine->physical_ram_in_mb > 256) |
53 |
fprintf(stderr, "WARNING! Real NetWinders cannot" |
fprintf(stderr, "WARNING! Real NetWinders cannot" |
54 |
" have more than 256 MB RAM. Continuing anyway.\n"); |
" have more than 256 MB RAM. Continuing anyway.\n"); |
55 |
|
|
56 |
machine->md_int.footbridge_data = |
/* CPU at 63.75 MHz, according to NetBSD's netwinder_machdep.c. */ |
57 |
device_add(machine, "footbridge addr=0x42000000"); |
machine->emulated_hz = 63750000; |
58 |
machine->md_interrupt = isa32_interrupt; |
|
59 |
machine->isa_pic_data.native_irq = 11; |
snprintf(tmpstr, sizeof(tmpstr), "footbridge irq=%s.cpu[%i].irq" |
60 |
|
" addr=0x42000000", machine->path, machine->bootstrap_cpu); |
61 |
bus_isa_init(machine, 0, 0x7c000000, 0x80000000, 32, 48); |
pci_bus = device_add(machine, tmpstr); |
|
|
|
|
#if 0 |
|
|
snprintf(tmpstr, sizeof(tmpstr), "8259 irq=64 addr=0x7c000020"); |
|
|
machine->isa_pic_data.pic1 = device_add(machine, tmpstr); |
|
|
snprintf(tmpstr, sizeof(tmpstr), "8259 irq=64 addr=0x7c0000a0"); |
|
|
machine->isa_pic_data.pic2 = device_add(machine, tmpstr); |
|
|
|
|
|
device_add(machine, "ns16550 irq=36 addr=0x7c0003f8 name2=com0"); |
|
|
device_add(machine, "ns16550 irq=35 addr=0x7c0002f8 name2=com1"); |
|
|
|
|
|
dev_vga_init(machine, machine->memory, 0x800a0000ULL, 0x7c0003c0, |
|
|
machine->machine_name); |
|
|
j = dev_pckbc_init(machine, machine->memory, 0x7c000060, PCKBC_8042, |
|
|
32 + 1, 32 + 12, machine->use_x11, 0); |
|
|
machine->main_console_handle = j; |
|
|
#endif |
|
62 |
|
|
63 |
if (machine->use_x11) { |
if (machine->use_x11) { |
64 |
bus_pci_add(machine, machine->md_int.footbridge_data->pcibus, |
bus_pci_add(machine, pci_bus, machine->memory, |
65 |
machine->memory, 0xc0, 8, 0, "igsfb"); |
0xc0, 8, 0, "igsfb"); |
66 |
} |
} |
67 |
|
|
68 |
if (!machine->prom_emulation) |
if (!machine->prom_emulation) |
86 |
|
|
87 |
MACHINE_REGISTER(netwinder) |
MACHINE_REGISTER(netwinder) |
88 |
{ |
{ |
89 |
MR_DEFAULT(netwinder, "NetWinder", ARCH_ARM, MACHINE_NETWINDER, 1, 0); |
MR_DEFAULT(netwinder, "NetWinder", ARCH_ARM, MACHINE_NETWINDER); |
90 |
me->aliases[0] = "netwinder"; |
|
91 |
|
machine_entry_add_alias(me, "netwinder"); |
92 |
|
|
93 |
me->set_default_ram = machine_default_ram_netwinder; |
me->set_default_ram = machine_default_ram_netwinder; |
|
machine_entry_add(me, ARCH_ARM); |
|
94 |
} |
} |
95 |
|
|