2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
9 #include <arch/system_info.h>
10 #include <boot/kernel_args.h>
13 enum cpu_vendor sCPUVendor
;
16 static uint64 sCPUClockFrequency
;
17 static uint64 sBusClockFrequency
;
21 enum cpu_vendor vendor
;
24 // mapping of CPU versions to vendors
25 struct cpu_model kCPUModels
[] = {
26 { MPC601
, B_CPU_VENDOR_MOTOROLA
},
27 { MPC603
, B_CPU_VENDOR_MOTOROLA
},
28 { MPC604
, B_CPU_VENDOR_MOTOROLA
},
29 { MPC602
, B_CPU_VENDOR_MOTOROLA
},
30 { MPC603e
, B_CPU_VENDOR_MOTOROLA
},
31 { MPC603ev
, B_CPU_VENDOR_MOTOROLA
},
32 { MPC750
, B_CPU_VENDOR_MOTOROLA
},
33 { MPC604ev
, B_CPU_VENDOR_MOTOROLA
},
34 { MPC7400
, B_CPU_VENDOR_MOTOROLA
},
35 { MPC620
, B_CPU_VENDOR_MOTOROLA
},
36 { IBM403
, B_CPU_VENDOR_IBM
},
37 { IBM401A1
, B_CPU_VENDOR_IBM
},
38 { IBM401B2
, B_CPU_VENDOR_IBM
},
39 { IBM401C2
, B_CPU_VENDOR_IBM
},
40 { IBM401D2
, B_CPU_VENDOR_IBM
},
41 { IBM401E2
, B_CPU_VENDOR_IBM
},
42 { IBM401F2
, B_CPU_VENDOR_IBM
},
43 { IBM401G2
, B_CPU_VENDOR_IBM
},
44 { IBMPOWER3
, B_CPU_VENDOR_IBM
},
45 { MPC860
, B_CPU_VENDOR_MOTOROLA
},
46 { MPC8240
, B_CPU_VENDOR_MOTOROLA
},
47 { IBM405GP
, B_CPU_VENDOR_IBM
},
48 { IBM405L
, B_CPU_VENDOR_IBM
},
49 { IBM750FX
, B_CPU_VENDOR_IBM
},
50 { MPC7450
, B_CPU_VENDOR_MOTOROLA
},
51 { MPC7455
, B_CPU_VENDOR_MOTOROLA
},
52 { MPC7457
, B_CPU_VENDOR_MOTOROLA
},
53 { MPC7447A
, B_CPU_VENDOR_MOTOROLA
},
54 { MPC7448
, B_CPU_VENDOR_MOTOROLA
},
55 { MPC7410
, B_CPU_VENDOR_MOTOROLA
},
56 { MPC8245
, B_CPU_VENDOR_MOTOROLA
},
57 { 0, B_CPU_VENDOR_UNKNOWN
}
62 arch_fill_topology_node(cpu_topology_node_info
* node
, int32 cpu
)
67 node
->data
.root
.platform
= B_CPU_PPC_64
;
69 node
->data
.root
.platform
= B_CPU_PPC
;
73 case B_TOPOLOGY_PACKAGE
:
74 node
->data
.package
.vendor
= sCPUVendor
;
75 node
->data
.package
.cache_line_size
= CACHE_LINE_SIZE
;
79 node
->data
.core
.model
= sPVR
;
80 node
->data
.core
.default_frequency
= sCPUClockFrequency
;
90 arch_system_info_init(struct kernel_args
*args
)
94 sCPUClockFrequency
= args
->arch_args
.cpu_frequency
;
95 sBusClockFrequency
= args
->arch_args
.bus_frequency
;
97 // The PVR (processor version register) contains processor version and
100 uint16 model
= (uint16
)(sPVR
>> 16);
101 //sCPURevision = (uint16)(pvr & 0xffff);
104 for (i
= 0; kCPUModels
[i
].vendor
!= B_CPU_VENDOR_UNKNOWN
; i
++) {
105 if (model
== kCPUModels
[i
].version
) {
106 sCPUVendor
= kCPUModels
[i
].vendor
;