/SPARTAN/trunk/arch/mips32/include/byteorder.h |
---|
26,8 → 26,8 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __mips32_BYTEORDER_H__ |
#define __mips32_BYTEORDER_H__ |
#ifndef __mips_BYTEORDER_H__ |
#define __mips_BYTEORDER_H__ |
#include <arch/types.h> |
#include <byteorder.h> |
40,7 → 40,7 |
static inline __native __native_le2host(__native n) |
{ |
return __u32_byteroder_swap(n); |
return __u32_byteorder_swap(n); |
} |
#else |
/SPARTAN/trunk/arch/mips32/include/drivers/arc.h |
---|
26,8 → 26,8 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
#ifndef __mips32_ARC_H_ |
#define __mips32_ARC_H_ |
#ifndef __mips_ARC_H_ |
#define __mips_ARC_H_ |
#include <arch/types.h> |
34,8 → 34,84 |
#define ARC_BASE_ADDR 0x1000; |
#define ARC_MAGIC 0x53435241 |
typedef enum { |
SystemClass = 0, |
ProcessorClass, |
CacheClass, |
AdapterClass, |
ControllerClass, |
PeripheralClass, |
MemoryClass |
} arc_component_class; |
typedef enum { |
ARC_type = 0, |
CPU_type, |
FPU_type, |
PrimaryICache, |
PrimaryDCache, |
SecondaryICache, |
SecondaryDCache, |
SecondaryCache, |
Memory, /* Not in NT PROM */ |
EISAAdapter, |
TCAdapter, |
SCSIAdapter, |
DTIAdapter, |
MultiFunctionAdapter, |
DiskController, |
TapeController, |
CDROMController, |
WORMController, |
SerialController, |
NetworkController, |
DisplayController, |
ParallelController, |
PointerController, |
KeyboardController, |
AudioController, |
OtherController, |
DiskPeripheral, |
FloppyDiskPeripheral, |
TapePeripheral, |
ModemPeripheral, |
MonitorPeripheral, |
PrinterPeripheral, |
PointerPeripheral, |
KeyboardPeripheral, |
TerminalPeripheral, |
LinePeripheral, |
NetworkPeripheral, |
OtherPeripheral, |
XTalkAdapter, |
PCIAdapter, |
GIOAdapter, |
TPUAdapter, |
Anonymous |
}arc_component_type; |
typedef enum { |
Failed = 1, |
ReadOnly = 2, |
Removable = 4, |
ConsoleIn = 8, |
ConsoleOut = 16, |
Input = 32, |
Output = 64 |
}arc_component_flags; |
typedef struct { |
} arc_component; |
arc_component_class class; |
arc_component_type type; |
arc_component_flags flags; |
__u16 revision; |
__u16 version; |
__u32 key; |
__u32 affinitymask; |
__u32 configdatasize; |
__u32 identifier_len; |
char *identifier; |
} __attribute__ ((packed)) arc_component; |
typedef struct { |
__u16 year; |
45,7 → 121,7 |
__u16 minutes; |
__u16 seconds; |
__u16 mseconds; |
} arc_timeinfo ; |
} __attribute__ ((packed)) arc_timeinfo; |
/* This is the SGI block structure, WinNT has it different */ |
typedef enum { |
135,5 → 211,6 |
extern void arc_print_memory_map(void); |
extern int arc_enabled(void); |
extern void arc_putchar(char ch); |
extern void arc_print_devices(void); |
#endif |
/SPARTAN/trunk/arch/mips32/src/drivers/arc.c |
---|
45,6 → 45,53 |
"FirmwarePermanent" |
}; |
static char *ctypes[] = { |
"ARC_type", |
"CPU_type", |
"FPU_type", |
"PrimaryICache", |
"PrimaryDCache", |
"SecondaryICache", |
"SecondaryDCache", |
"SecondaryCache", |
"Memory", |
"EISAAdapter", |
"TCAdapter", |
"SCSIAdapter", |
"DTIAdapter", |
"MultiFunctionAdapter", |
"DiskController", |
"TapeController", |
"CDROMController", |
"WORMController", |
"SerialController", |
"NetworkController", |
"DisplayController", |
"ParallelController", |
"PointerController", |
"KeyboardController", |
"AudioController", |
"OtherController", |
"DiskPeripheral", |
"FloppyDiskPeripheral", |
"TapePeripheral", |
"ModemPeripheral", |
"MonitorPeripheral", |
"PrinterPeripheral", |
"PointerPeripheral", |
"KeyboardPeripheral", |
"TerminalPeripheral", |
"OtherPeripheral", |
"LinePeripheral", |
"NetworkPeripheral" |
"OtherPeripheral", |
"XTalkAdapter", |
"PCIAdapter", |
"GIOAdapter", |
"TPUAdapter", |
"Anonymous" |
}; |
static arc_sbp *sbp = (arc_sbp *)PA2KA(0x1000); |
static arc_func_vector_t *arc_entry; |
74,11 → 121,43 |
return sbp != NULL; |
} |
static void arc_print_component(arc_component *c) |
{ |
int i; |
printf("%s: ",ctypes[c->type]); |
for (i=0;i < c->identifier_len;i++) |
putchar(c->identifier[i]); |
putchar('\n'); |
} |
void arc_print_devices(void) |
{ |
arc_component *c,*next; |
if (!arc_enabled()) |
return; |
c = arc_entry->getchild(NULL); |
while (c) { |
arc_print_component(c); |
next = arc_entry->getchild(c); |
while (!next) { |
next = arc_entry->getpeer(c); |
if (!next) |
c = arc_entry->getparent(c); |
if (!c) |
return; |
} |
c = next; |
} |
} |
void arc_print_memory_map(void) |
{ |
arc_memdescriptor_t *desc; |
if (!sbp) { |
if (!arc_enabled()) { |
printf("ARC not enabled.\n"); |
return; |
} |
/SPARTAN/trunk/arch/mips32/src/mips32.c |
---|
83,6 → 83,7 |
console_init(); |
arc_print_memory_map(); |
arc_print_devices(); |
} |
void arch_post_mm_init(void) |