1/*
2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5#ifndef _KERNEL_PPC_ARCH_PLATFORM_H
6#define _KERNEL_PPC_ARCH_PLATFORM_H
7
8#include <arch/platform.h>
9
10struct real_time_data;
11
12enum ppc_platform_type {
13	PPC_PLATFORM_OPEN_FIRMWARE = 0,
14	PPC_PLATFORM_U_BOOT
15};
16
17namespace BPrivate {
18
19class PPCPlatform {
20public:
21	PPCPlatform(ppc_platform_type platformType);
22	virtual ~PPCPlatform();
23
24	static PPCPlatform *Default();
25
26	inline ppc_platform_type PlatformType() const	{ return fPlatformType; }
27
28	virtual status_t Init(struct kernel_args *kernelArgs) = 0;
29	virtual status_t InitSerialDebug(struct kernel_args *kernelArgs) = 0;
30	virtual status_t InitPostVM(struct kernel_args *kernelArgs) = 0;
31	virtual status_t InitRTC(struct kernel_args *kernelArgs,
32		struct real_time_data *data) = 0;
33
34	virtual char SerialDebugGetChar() = 0;
35	virtual void SerialDebugPutChar(char c) = 0;
36
37	virtual	void SetHardwareRTC(uint32 seconds) = 0;
38	virtual	uint32 GetHardwareRTC() = 0;
39
40	virtual	void ShutDown(bool reboot) = 0;
41
42private:
43	ppc_platform_type	fPlatformType;
44};
45
46}	// namespace BPrivate
47
48using BPrivate::PPCPlatform;
49
50
51#endif	// _KERNEL_PPC_ARCH_PLATFORM_H
52