Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inmates: arm: Add support Marvell UART
Analogously to the hypervisor, add a UART driver for Marvel UARTs as found in the Armada 3720. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
- Loading branch information
1 parent
6be4509
commit 58c9c17
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Jailhouse, a Linux-based partitioning hypervisor | ||
* | ||
* Copyright (c) Siemens AG, 2017 | ||
* | ||
* Authors: | ||
* Jan Kiszka <jan.kiszka@siemens.com> | ||
* | ||
* This work is licensed under the terms of the GNU GPL, version 2. See | ||
* the COPYING file in the top-level directory. | ||
*/ | ||
|
||
#include <inmate.h> | ||
#include <uart.h> | ||
|
||
#define UART_TSH 0x4 | ||
#define UART_STAT 0xc | ||
#define UART_STAT_TX_FULL (1 << 11) | ||
|
||
static void uart_init(struct uart_chip *chip) | ||
{ | ||
} | ||
|
||
static bool uart_is_busy(struct uart_chip *chip) | ||
{ | ||
return !!(mmio_read32(chip->base + UART_STAT) & UART_STAT_TX_FULL); | ||
} | ||
|
||
static void uart_write(struct uart_chip *chip, char c) | ||
{ | ||
mmio_write32(chip->base + UART_TSH, c); | ||
} | ||
|
||
struct uart_chip uart_mvebu_ops = { | ||
.init = uart_init, | ||
.is_busy = uart_is_busy, | ||
.write = uart_write, | ||
}; |