2006-01-03 19:26:39 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
|
|
|
|
* All rights reserved. Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _KERNEL_PPC_ARCH_PLATFORM_H
|
|
|
|
#define _KERNEL_PPC_ARCH_PLATFORM_H
|
|
|
|
|
|
|
|
#include <arch/platform.h>
|
|
|
|
|
2006-01-04 07:55:04 +03:00
|
|
|
struct real_time_data;
|
|
|
|
|
2006-01-26 17:59:16 +03:00
|
|
|
enum ppc_platform_type {
|
|
|
|
PPC_PLATFORM_OPEN_FIRMWARE = 0,
|
2012-09-22 21:55:02 +04:00
|
|
|
PPC_PLATFORM_U_BOOT
|
2006-01-26 17:59:16 +03:00
|
|
|
};
|
|
|
|
|
2006-01-03 19:26:39 +03:00
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
class PPCPlatform {
|
|
|
|
public:
|
2006-01-26 17:59:16 +03:00
|
|
|
PPCPlatform(ppc_platform_type platformType);
|
2006-01-03 19:26:39 +03:00
|
|
|
virtual ~PPCPlatform();
|
|
|
|
|
|
|
|
static PPCPlatform *Default();
|
|
|
|
|
2006-01-26 17:59:16 +03:00
|
|
|
inline ppc_platform_type PlatformType() const { return fPlatformType; }
|
|
|
|
|
2006-01-03 19:26:39 +03:00
|
|
|
virtual status_t Init(struct kernel_args *kernelArgs) = 0;
|
|
|
|
virtual status_t InitSerialDebug(struct kernel_args *kernelArgs) = 0;
|
|
|
|
virtual status_t InitPostVM(struct kernel_args *kernelArgs) = 0;
|
2006-01-04 07:55:04 +03:00
|
|
|
virtual status_t InitRTC(struct kernel_args *kernelArgs,
|
|
|
|
struct real_time_data *data) = 0;
|
2006-01-03 19:26:39 +03:00
|
|
|
|
|
|
|
virtual char SerialDebugGetChar() = 0;
|
|
|
|
virtual void SerialDebugPutChar(char c) = 0;
|
2006-01-04 07:55:04 +03:00
|
|
|
|
|
|
|
virtual void SetHardwareRTC(uint32 seconds) = 0;
|
|
|
|
virtual uint32 GetHardwareRTC() = 0;
|
2006-01-08 01:49:43 +03:00
|
|
|
|
|
|
|
virtual void ShutDown(bool reboot) = 0;
|
2006-01-26 17:59:16 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
ppc_platform_type fPlatformType;
|
2006-01-03 19:26:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
using BPrivate::PPCPlatform;
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _KERNEL_PPC_ARCH_PLATFORM_H
|