[PATCH 03/25] core, configs: Replace JAILHOUSE_CON1_TYPE_UART_X86 with ...TYPE_8250

6 views
Skip to first unread message

Jan Kiszka

unread,
Apr 19, 2017, 7:09:21 AM4/19/17
to jailho...@googlegroups.com
Since aac89b193d32, x86 uses the same 8250 driver as ARM. So it also
makes sense to use the same type constant in the config.

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
Documentation/debug-output.md | 11 +++++------
configs/f2a88xm-hd3.c | 2 +-
configs/imb-a180.c | 2 +-
configs/qemu-vm.c | 2 +-
hypervisor/arch/x86/dbg-write.c | 2 +-
hypervisor/include/jailhouse/cell-config.h | 9 ++++-----
tools/root-cell-config.c.tmpl | 2 +-
7 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/Documentation/debug-output.md b/Documentation/debug-output.md
index 5d0610a1..041efc9c 100644
--- a/Documentation/debug-output.md
+++ b/Documentation/debug-output.md
@@ -15,20 +15,19 @@ default if nothing else is chosen:
- JAILHOUSE_CON1_TYPE_NONE

Possible debug outputs for x86:
- - JAILHOUSE_CON1_TYPE_UART_X86 /* generic X86 PIO/MMIO UART driver */
+ - JAILHOUSE_CON1_TYPE_8250 /* 8250-compatible UART (PIO or MMIO) */
- JAILHOUSE_CON1_TYPE_VGA /* VGA console */

VGA output is only available for x86. For further documentation on VGA output
see [vga-console.txt](vga-console.txt).

Possible debug outputs for arm and arm64:
- - JAILHOUSE_CON1_TYPE_8250 /* 8250 compatible UART */
+ - JAILHOUSE_CON1_TYPE_8250 /* 8250 compatible UART*/
- JAILHOUSE_CON1_TYPE_PL011 /* AMBA PL011 UART */

Additional flags that can be or'ed:
- JAILHOUSE_CON1_FLAG_PIO /* x86 only */
- - JAILHOUSE_CON1_FLAG_MMIO /* x86 and ARM. Should always be selected for
- * ARM. */
+ - JAILHOUSE_CON1_FLAG_MMIO /* x86 and ARM. Should always be set on ARM. */

### .address and .size
The address member denotes the base address of the Debug console (PIO or MMIO
@@ -36,7 +35,7 @@ base address). The .size parameter is only required for MMIO.

### .divider
An optional UART divider parameter that can be passed to the driver. This is
-supported by the generic X86 UART driver and the 8250 driver.
+supported by the 8250 driver.

A zero value means that the hypervisor will skip the initialisation of the UART
console. This is the case in most scenarios, as the hypervisor's UART console
@@ -59,7 +58,7 @@ Example configuration for PIO based debug output on x86:
.debug_console = {
.address = 0x3f8, /* PIO address */
.divider = 0x1, /* 115200 Baud */
- .flags = JAILHOUSE_CON1_TYPE_UART_X86 | /* generic x86 UART driver */
+ .flags = JAILHOUSE_CON1_TYPE_8250 | /* choose the 8250 driver */
JAILHOUSE_CON1_FLAG_PIO, /* use PIO instead of MMIO */
},
```
diff --git a/configs/f2a88xm-hd3.c b/configs/f2a88xm-hd3.c
index 33973bcf..6abfe6e6 100644
--- a/configs/f2a88xm-hd3.c
+++ b/configs/f2a88xm-hd3.c
@@ -41,7 +41,7 @@ struct {
.debug_console = {
.address = 0x3f8,
/* .divider = 0x1, */
- .flags = JAILHOUSE_CON1_TYPE_UART_X86 |
+ .flags = JAILHOUSE_CON1_TYPE_8250 |
JAILHOUSE_CON1_FLAG_PIO |
JAILHOUSE_CON2_TYPE_ROOTPAGE,
},
diff --git a/configs/imb-a180.c b/configs/imb-a180.c
index a6b9012c..2ed5e373 100644
--- a/configs/imb-a180.c
+++ b/configs/imb-a180.c
@@ -40,7 +40,7 @@ struct {
.debug_console = {
.address = 0x3f8,
/* .divider = 0x1, */
- .flags = JAILHOUSE_CON1_TYPE_UART_X86 |
+ .flags = JAILHOUSE_CON1_TYPE_8250 |
JAILHOUSE_CON1_FLAG_PIO |
JAILHOUSE_CON2_TYPE_ROOTPAGE,
},
diff --git a/configs/qemu-vm.c b/configs/qemu-vm.c
index f091834e..ca537b3b 100644
--- a/configs/qemu-vm.c
+++ b/configs/qemu-vm.c
@@ -40,7 +40,7 @@ struct {
.debug_console = {
.address = 0x3f8,
/* .divider = 0x1, */
- .flags = JAILHOUSE_CON1_TYPE_UART_X86 |
+ .flags = JAILHOUSE_CON1_TYPE_8250 |
JAILHOUSE_CON1_FLAG_PIO |
JAILHOUSE_CON2_TYPE_ROOTPAGE,
},
diff --git a/hypervisor/arch/x86/dbg-write.c b/hypervisor/arch/x86/dbg-write.c
index d8549c53..7b586313 100644
--- a/hypervisor/arch/x86/dbg-write.c
+++ b/hypervisor/arch/x86/dbg-write.c
@@ -33,7 +33,7 @@ void arch_dbg_write_init(void)
const u32 flags = system_config->debug_console.flags;
unsigned char dbg_type = CON1_TYPE(flags);

- if (dbg_type == JAILHOUSE_CON1_TYPE_UART_X86) {
+ if (dbg_type == JAILHOUSE_CON1_TYPE_8250) {
uart = &uart_8250_ops;

uart->debug_console = &system_config->debug_console;
diff --git a/hypervisor/include/jailhouse/cell-config.h b/hypervisor/include/jailhouse/cell-config.h
index 67b3319e..6b1cb286 100644
--- a/hypervisor/include/jailhouse/cell-config.h
+++ b/hypervisor/include/jailhouse/cell-config.h
@@ -177,11 +177,10 @@ struct jailhouse_iommu {

/* Bits 0..3 are used to select the particular driver */
#define JAILHOUSE_CON1_TYPE_NONE 0x0000
-#define JAILHOUSE_CON1_TYPE_UART_X86 0x0001
-#define JAILHOUSE_CON1_TYPE_VGA 0x0002
-#define JAILHOUSE_CON1_TYPE_8250 0x0003
-#define JAILHOUSE_CON1_TYPE_PL011 0x0004
-#define JAILHOUSE_CON1_TYPE_XUARTPS 0x0005
+#define JAILHOUSE_CON1_TYPE_VGA 0x0001
+#define JAILHOUSE_CON1_TYPE_8250 0x0002
+#define JAILHOUSE_CON1_TYPE_PL011 0x0003
+#define JAILHOUSE_CON1_TYPE_XUARTPS 0x0004
#define JAILHOUSE_CON1_TYPE_MASK 0x000f

#define CON1_TYPE(flags) ((flags) & JAILHOUSE_CON1_TYPE_MASK)
diff --git a/tools/root-cell-config.c.tmpl b/tools/root-cell-config.c.tmpl
index 11956b74..14a9cbef 100644
--- a/tools/root-cell-config.c.tmpl
+++ b/tools/root-cell-config.c.tmpl
@@ -62,7 +62,7 @@ struct {
},
.debug_console = {
.address = 0x3f8,
- .flags = JAILHOUSE_CON1_TYPE_UART_X86 |
+ .flags = JAILHOUSE_CON1_TYPE_8250 |
JAILHOUSE_CON1_FLAG_PIO |
JAILHOUSE_CON2_TYPE_ROOTPAGE,
},
--
2.12.0

Reply all
Reply to author
Forward
0 new messages