mirror of
https://review.haiku-os.org/haiku
synced 2025-01-27 00:34:50 +01:00
e9ec7a55dd
* introduce a DebugUART baseclass, * rework 8250 and PL011 implementations from kallisti5 to inherit DebutUART, * each arch should override the IO methods to access registers. * on ARM registers are 32bit-aligned. * U-Boot still works for the verdex target. * rPi still compiles, needs testing. * Still some more consolidation needed to allow runtime choice of the UART type (as read from FDT blobs for ex.). * serial.cpp should probably mostly be made generic as well. * didn't touch x86 or ppc yet.
43 lines
819 B
C++
43 lines
819 B
C++
/*
|
|
* Copyright 2011-2012 Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Alexander von Gluck, kallisti5@unixzen.com
|
|
*/
|
|
#ifndef __DEV_UART_PL011_H
|
|
#define __DEV_UART_PL011_H
|
|
|
|
|
|
#include <sys/types.h>
|
|
#include <SupportDefs.h>
|
|
#include <arch/generic/debug_uart.h>
|
|
|
|
class ArchUARTPL011 : public DebugUART {
|
|
public:
|
|
ArchUARTPL011(addr_t base, int64 clock);
|
|
~ArchUARTPL011();
|
|
|
|
void InitEarly();
|
|
void InitPort(uint32 baud);
|
|
|
|
void Enable();
|
|
void Disable();
|
|
|
|
int PutChar(char c);
|
|
int GetChar(bool wait);
|
|
|
|
void FlushTx();
|
|
void FlushRx();
|
|
|
|
private:
|
|
void Out32(int reg, uint32 value);
|
|
uint32 In32(int reg);
|
|
virtual void Barrier();
|
|
};
|
|
|
|
|
|
ArchUARTPL011 *arch_get_uart_pl011(addr_t base, int64 clock);
|
|
|
|
#endif
|