2 * Copyright 2011-2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * François Revol, revol@free.fr
10 #include <arch/arm/reg.h>
11 #include <arch/generic/debug_uart_8250.h>
16 class ArchUART8250
: public DebugUART8250
{
18 ArchUART8250(addr_t base
, int64 clock
);
22 // ARM MMIO: on ARM the UART regs are aligned on 32bit
23 virtual void Out8(int reg
, uint8 value
);
24 virtual uint8
In8(int reg
);
28 ArchUART8250::ArchUART8250(addr_t base
, int64 clock
)
30 DebugUART8250(base
, clock
)
35 ArchUART8250::~ArchUART8250()
41 ArchUART8250::InitEarly()
43 // Perform special hardware UART configuration
44 #warning TODO: Detect OMAP3 from fdt!
47 RMWREG32(CM_FCLKEN1_CORE
, 13, 1, 1);
48 RMWREG32(CM_ICLKEN1_CORE
, 13, 1, 1);
51 RMWREG32(CM_FCLKEN1_CORE
, 14, 1, 1);
52 RMWREG32(CM_ICLKEN1_CORE
, 14, 1, 1);
55 RMWREG32(CM_FCLKEN_PER
, 11, 1, 1);
56 RMWREG32(CM_ICLKEN_PER
, 11, 1, 1);
58 #warning INTITIALIZE UART!!!!!
64 ArchUART8250::Out8(int reg
, uint8 value
)
66 *((uint8
*)Base() + reg
* sizeof(uint32
)) = value
;
71 ArchUART8250::In8(int reg
)
73 return *((uint8
*)Base() + reg
* sizeof(uint32
));
77 DebugUART8250
*arch_get_uart_8250(addr_t base
, int64 clock
)
79 static char buffer
[sizeof(ArchUART8250
)];
80 ArchUART8250
*uart
= new(buffer
) ArchUART8250(base
, clock
);