2011-12-22 15:19:25 +00:00
|
|
|
/*
|
|
|
|
* \brief PL011 UART definitions for the RealView platform
|
|
|
|
* \author Christian Helmuth
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2011-05-27
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2012-01-03 14:35:05 +00:00
|
|
|
* Copyright (C) 2011-2012 Genode Labs GmbH
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__PLATFORM__PBXA9__PL011_DEFS_H_
|
|
|
|
#define _INCLUDE__PLATFORM__PBXA9__PL011_DEFS_H_
|
|
|
|
|
|
|
|
#include <platform/vea9x4/bus.h>
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
|
|
|
/** Number of UARTs */
|
|
|
|
PL011_NUM = 4,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MMIO regions
|
|
|
|
*/
|
|
|
|
PL011_PHYS0 = SMB_CS7 + 0x9000, /* base for UART 0 */
|
|
|
|
PL011_PHYS1 = SMB_CS7 + 0xA000, /* base for UART 1 */
|
|
|
|
PL011_PHYS2 = SMB_CS7 + 0xB000, /* base for UART 2 */
|
|
|
|
PL011_PHYS3 = SMB_CS7 + 0xC000, /* base for UART 3 */
|
|
|
|
PL011_SIZE = 0x1000, /* size of each MMIO region */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interrupt lines
|
|
|
|
*/
|
|
|
|
PL011_IRQ0 = 32 + 5, /* UART 0 */
|
|
|
|
PL011_IRQ1 = 32 + 6, /* UART 1 */
|
|
|
|
PL011_IRQ2 = 32 + 7, /* UART 2 */
|
|
|
|
PL011_IRQ3 = 32 + 8, /* UART 3 */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* UART baud rate configuration (precalculated)
|
|
|
|
*
|
|
|
|
* div = 24000000 / 16 / baud rate
|
|
|
|
* IBRD = floor(div)
|
|
|
|
* FBRD = floor((div - IBRD) * 64 + 0.5)
|
|
|
|
*/
|
|
|
|
PL011_IBRD_115200 = 13, PL011_FBRD_115200 = 1,
|
|
|
|
PL011_IBRD_19200 = 78, PL011_FBRD_19200 = 8,
|
|
|
|
PL011_IBRD_9600 = 156, PL011_FBRD_9600 = 16,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static struct Pl011_uart {
|
|
|
|
Genode::addr_t mmio_base;
|
|
|
|
Genode::size_t mmio_size;
|
|
|
|
int irq_number;
|
|
|
|
} pl011_uart[PL011_NUM] = {
|
|
|
|
{ PL011_PHYS0, PL011_SIZE, PL011_IRQ0 },
|
|
|
|
{ PL011_PHYS1, PL011_SIZE, PL011_IRQ1 },
|
|
|
|
{ PL011_PHYS2, PL011_SIZE, PL011_IRQ2 },
|
|
|
|
{ PL011_PHYS3, PL011_SIZE, PL011_IRQ3 },
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__PLATFORM__PBXA9__PL011_DEFS_H_ */
|