Skip to content

Commit

Permalink
tty/powerpc: introduce the ePAPR embedded hypervisor byte channel driver
Browse files Browse the repository at this point in the history
The ePAPR embedded hypervisor specification provides an API for "byte
channels", which are serial-like virtual devices for sending and receiving
streams of bytes.  This driver provides Linux kernel support for byte
channels via three distinct interfaces:

1) An early-console (udbg) driver.  This provides early console output
through a byte channel.  The byte channel handle must be specified in a
Kconfig option.

2) A normal console driver.  Output is sent to the byte channel designated
for stdout in the device tree.  The console driver is for handling kernel
printk calls.

3) A tty driver, which is used to handle user-space input and output.  The
byte channel used for the console is designated as the default tty.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Timur Tabi authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent fcb8ce5 commit dcd83aa
Show file tree
Hide file tree
Showing 5 changed files with 926 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/udbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ extern void __init udbg_init_40x_realmode(void);
extern void __init udbg_init_cpm(void);
extern void __init udbg_init_usbgecko(void);
extern void __init udbg_init_wsp(void);
extern void __init udbg_init_ehv_bc(void);

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_UDBG_H */
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/udbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ void __init udbg_early_init(void)
udbg_init_usbgecko();
#elif defined(CONFIG_PPC_EARLY_DEBUG_WSP)
udbg_init_wsp();
#elif defined(CONFIG_PPC_EARLY_DEBUG_EHV_BC)
udbg_init_ehv_bc();
#endif

#ifdef CONFIG_PPC_EARLY_DEBUG
Expand Down
34 changes: 34 additions & 0 deletions drivers/tty/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,37 @@ config TRACE_SINK

If you select this option, you need to select
"Trace data router for MIPI P1149.7 cJTAG standard".

config PPC_EPAPR_HV_BYTECHAN
tristate "ePAPR hypervisor byte channel driver"
depends on PPC
help
This driver creates /dev entries for each ePAPR hypervisor byte
channel, thereby allowing applications to communicate with byte
channels as if they were serial ports.

config PPC_EARLY_DEBUG_EHV_BC
bool "Early console (udbg) support for ePAPR hypervisors"
depends on PPC_EPAPR_HV_BYTECHAN
help
Select this option to enable early console (a.k.a. "udbg") support
via an ePAPR byte channel. You also need to choose the byte channel
handle below.

config PPC_EARLY_DEBUG_EHV_BC_HANDLE
int "Byte channel handle for early console (udbg)"
depends on PPC_EARLY_DEBUG_EHV_BC
default 0
help
If you want early console (udbg) output through a byte channel,
specify the handle of the byte channel to use.

For this to work, the byte channel driver must be compiled
in-kernel, not as a module.

Note that only one early console driver can be enabled, so don't
enable any others if you enable this one.

If the number you specify is not a valid byte channel handle, then
there simply will be no early console output. This is true also
if you don't boot under a hypervisor at all.
1 change: 1 addition & 0 deletions drivers/tty/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ obj-$(CONFIG_ROCKETPORT) += rocket.o
obj-$(CONFIG_SYNCLINK_GT) += synclink_gt.o
obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o
obj-$(CONFIG_SYNCLINK) += synclink.o
obj-$(CONFIG_PPC_EPAPR_HV_BYTECHAN) += ehv_bytechan.o

obj-y += ipwireless/
Loading

0 comments on commit dcd83aa

Please sign in to comment.