mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen/riscv: add basic UART support
Update Kconfig to select GENERIC_UART_INIT for basic UART init ( find a dt node
and call device specific device_init() ).
Drop `default n if RISCV` statement for config HAS_NS16550 as now ns16550 is
ready to be compiled and used by RISC-V. Also, make the config user selectable
for everyone except X86.
Initialize a minimal amount of stuff to have UART and Xen console:
- Initialize uart by calling uart_init().
- Initialize Xen console by calling console_init_{pre,post}irq().
- Initialize timer and its internal lists which are used by
init_timer() which is called by ns16550_init_postirq(); otherwise
"Unhandled exception: Store/AMO Page Fault" occurs.
- Enable local interrupt to recieve an input from UART
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
0aa91c3cd5
commit
c428538c1a
3 files changed
+14
-2
No files matched your search
@@ -2,6 +2,7 @@ config RISCV
|
||||
def_bool y
|
||||
select FUNCTION_ALIGNMENT_16B
|
||||
select GENERIC_BUG_FRAME
|
||||
select GENERIC_UART_INIT
|
||||
select HAS_DEVICE_TREE
|
||||
select HAS_PMAP
|
||||
select HAS_UBSAN
|
||||
|
||||
@@ -4,12 +4,15 @@
|
||||
#include <xen/bug.h>
|
||||
#include <xen/bootfdt.h>
|
||||
#include <xen/compile.h>
|
||||
#include <xen/console.h>
|
||||
#include <xen/device_tree.h>
|
||||
#include <xen/init.h>
|
||||
#include <xen/irq.h>
|
||||
#include <xen/mm.h>
|
||||
#include <xen/serial.h>
|
||||
#include <xen/shutdown.h>
|
||||
#include <xen/smp.h>
|
||||
#include <xen/timer.h>
|
||||
#include <xen/vmap.h>
|
||||
#include <xen/xvmalloc.h>
|
||||
|
||||
@@ -134,8 +137,17 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
|
||||
|
||||
intc_preinit();
|
||||
|
||||
uart_init();
|
||||
console_init_preirq();
|
||||
|
||||
intc_init();
|
||||
|
||||
timer_init();
|
||||
|
||||
local_irq_enable();
|
||||
|
||||
console_init_postirq();
|
||||
|
||||
printk("All set up\n");
|
||||
|
||||
machine_halt();
|
||||
|
||||
@@ -2,8 +2,7 @@ config GENERIC_UART_INIT
|
||||
bool
|
||||
|
||||
config HAS_NS16550
|
||||
bool "NS16550 UART driver" if ARM
|
||||
default n if RISCV
|
||||
bool "NS16550 UART driver" if !X86
|
||||
default y
|
||||
help
|
||||
This selects the 16550-series UART support. For most systems, say Y.
|
||||
|
||||