xref: /haiku/src/system/boot/platform/u-boot/cpu.cpp (revision 9760dcae2038d47442f4658c2575844c6cf92c40)
1 /*
2  * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * calculate_cpu_conversion_factor() was written by Travis Geiselbrecht and
6  * licensed under the NewOS license.
7  */
8 
9 
10 #include "cpu.h"
11 
12 #include <OS.h>
13 #include <boot/platform.h>
14 #include <boot/stdio.h>
15 #include <boot/kernel_args.h>
16 #include <boot/stage2.h>
17 #include <arch/cpu.h>
18 #include <arch_kernel.h>
19 #include <arch_system_info.h>
20 
21 #include <string.h>
22 
23 
24 //#define TRACE_CPU
25 #ifdef TRACE_CPU
26 #	define TRACE(x) dprintf x
27 #else
28 #	define TRACE(x) ;
29 #endif
30 
31 //uint32 gTimeConversionFactor;
32 
33 
34 static void
35 calculate_cpu_conversion_factor()
36 {
37          #warning ARM:TODO!
38 }
39 
40 
41 static status_t
42 check_cpu_features()
43 {
44 
45         #warning ARM:TODO!
46 	return B_OK;
47 }
48 
49 
50 //	#pragma mark -
51 
52 
53 extern "C" void
54 spin(bigtime_t microseconds)
55 {
56 	for(bigtime_t i=0;i<microseconds;i=i+1)
57 	{
58 		asm volatile ("mov r0,r0");
59 		asm volatile ("mov r0,r0");
60 	}
61 	#warning ARM/UBOOT:TODO!!
62 }
63 
64 
65 extern "C" void
66 cpu_init()
67 {
68 	if (check_cpu_features() != B_OK)
69 		panic("You need a Pentium or higher in order to boot!\n");
70 
71 	calculate_cpu_conversion_factor();
72 
73 	gKernelArgs.num_cpus = 1;
74 		// this will eventually be corrected later on
75 }
76 
77