25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_pmppc.c,v 1.8 2007/01/29 18:06:52 debug Exp $ |
* $Id: dev_pmppc.c,v 1.9 2007/06/15 19:57:33 debug Exp $ |
29 |
* |
* |
30 |
* PM/PPC devices. |
* COMMENT: Artesyn PM/PPC motherboard registers |
31 |
* |
* |
32 |
* TODO |
* NOTE/TODO: Only enough to boot NetBSD/pmppc has been implemented. |
33 |
*/ |
*/ |
34 |
|
|
35 |
#include <stdio.h> |
#include <stdio.h> |
64 |
relative_addr += PMPPC_CONFIG0; |
relative_addr += PMPPC_CONFIG0; |
65 |
|
|
66 |
switch (relative_addr) { |
switch (relative_addr) { |
67 |
|
|
68 |
case PMPPC_CONFIG0: |
case PMPPC_CONFIG0: |
69 |
if (writeflag==MEM_READ) { |
if (writeflag==MEM_READ) { |
70 |
odata = d->config0; |
odata = d->config0; |
73 |
" 0x%02x ]\n", (int)idata); |
" 0x%02x ]\n", (int)idata); |
74 |
} |
} |
75 |
break; |
break; |
76 |
|
|
77 |
case PMPPC_CONFIG1: |
case PMPPC_CONFIG1: |
78 |
if (writeflag==MEM_READ) { |
if (writeflag==MEM_READ) { |
79 |
odata = d->config1; |
odata = d->config1; |
82 |
" 0x%02x ]\n", (int)idata); |
" 0x%02x ]\n", (int)idata); |
83 |
} |
} |
84 |
break; |
break; |
85 |
|
|
86 |
case PMPPC_RESET: |
case PMPPC_RESET: |
87 |
if (writeflag==MEM_READ) { |
if (writeflag==MEM_READ) { |
88 |
odata = d->reset_reg; |
odata = d->reset_reg; |
96 |
d->reset_reg = idata; |
d->reset_reg = idata; |
97 |
} |
} |
98 |
break; |
break; |
99 |
|
|
100 |
default: |
default: |
101 |
if (writeflag==MEM_READ) { |
if (writeflag==MEM_READ) { |
102 |
debug("[ pmppc: UNIMPLEMENTED read from 0x%08lx ]\n", |
debug("[ pmppc: UNIMPLEMENTED read from 0x%08lx ]\n", |
119 |
struct pmppc_data *d; |
struct pmppc_data *d; |
120 |
struct memory *mem = devinit->machine->memory; |
struct memory *mem = devinit->machine->memory; |
121 |
|
|
122 |
d = malloc(sizeof(struct pmppc_data)); |
CHECK_ALLOCATION(d = malloc(sizeof(struct pmppc_data))); |
|
if (d == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
123 |
memset(d, 0, sizeof(struct pmppc_data)); |
memset(d, 0, sizeof(struct pmppc_data)); |
124 |
|
|
125 |
/* |
/* |