xref: /haiku/src/system/kernel/arch/m68k/arch_system_info.cpp (revision 8a6724a0ee3803f1e9f487d8111bb3f6cb8d16db)
1 /*
2  * Copyright 2007, Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  * 		François Revol <revol@free.fr>
7  *
8  * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
9  * All rights reserved. Distributed under the terms of the MIT License.
10  */
11 
12 #include <OS.h>
13 
14 #include <arch_cpu.h>
15 #include <arch_platform.h>
16 #include <arch/system_info.h>
17 #include <boot/kernel_args.h>
18 
19 
20 static uint64 sCPUClockFrequency;
21 static uint64 sBusClockFrequency;
22 static uint16 sCPURevision;
23 
24 
25 void
26 arch_fill_topology_node(cpu_topology_node_info* node, int32 cpu)
27 {
28 	switch (node->type) {
29 		case B_TOPOLOGY_ROOT:
30 			node->data.root.platform = B_CPU_M68K;
31 			break;
32 
33 		case B_TOPOLOGY_PACKAGE:
34 			node->data.package.vendor = B_CPU_VENDOR_MOTOROLA;
35 			node->data.package.cache_line_size = CACHE_LINE_SIZE;
36 			break;
37 
38 		case B_TOPOLOGY_CORE:
39 			node->data.core.model = sCPURevision;
40 			node->data.core.default_frequency = sCPUClockFrequency;
41 			break;
42 
43 		default:
44 			break;
45 	}
46 }
47 
48 
49 status_t
50 arch_system_info_init(struct kernel_args *args)
51 {
52 	sCPUClockFrequency = args->arch_args.cpu_frequency;
53 	sBusClockFrequency = args->arch_args.bus_frequency; // not reported anymore?
54 
55 	sCPURevision = args->arch_args.cpu_type; //TODO:is it what we want?
56 #warning M68K: use 060 PCR[15:8]
57 
58 	return B_OK;
59 }
60