2005-04-17 05:20:36 +07:00
|
|
|
/*
|
2006-01-11 07:54:09 +07:00
|
|
|
* (c) 2001, 2006 IBM Corporation.
|
2005-04-17 05:20:36 +07:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version
|
|
|
|
* 2 of the License, or (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
2005-11-11 12:42:12 +07:00
|
|
|
#ifndef _ASM_POWERPC_UDBG_H
|
|
|
|
#define _ASM_POWERPC_UDBG_H
|
2005-12-17 04:43:46 +07:00
|
|
|
#ifdef __KERNEL__
|
2005-11-11 12:42:12 +07:00
|
|
|
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
2005-11-23 13:57:25 +07:00
|
|
|
extern void (*udbg_putc)(char c);
|
2009-03-09 14:52:41 +07:00
|
|
|
extern void (*udbg_flush)(void);
|
2005-11-30 12:54:12 +07:00
|
|
|
extern int (*udbg_getc)(void);
|
2005-09-06 08:56:42 +07:00
|
|
|
extern int (*udbg_getc_poll)(void);
|
|
|
|
|
|
|
|
extern void udbg_puts(const char *s);
|
|
|
|
extern int udbg_write(const char *s, int n);
|
|
|
|
extern int udbg_read(char *buf, int buflen);
|
|
|
|
|
2005-09-06 08:57:27 +07:00
|
|
|
extern void register_early_udbg_console(void);
|
2006-05-17 23:00:35 +07:00
|
|
|
extern void udbg_printf(const char *fmt, ...)
|
|
|
|
__attribute__ ((format (printf, 1, 2)));
|
2005-12-21 05:37:07 +07:00
|
|
|
extern void udbg_progress(char *s, unsigned short hex);
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-11-23 13:56:06 +07:00
|
|
|
extern void udbg_init_uart(void __iomem *comport, unsigned int speed,
|
|
|
|
unsigned int clock);
|
|
|
|
extern unsigned int udbg_probe_uart_speed(void __iomem *comport,
|
|
|
|
unsigned int clock);
|
2005-10-22 13:02:39 +07:00
|
|
|
|
|
|
|
struct device_node;
|
2005-11-23 13:57:25 +07:00
|
|
|
extern void udbg_scc_init(int force_scc);
|
|
|
|
extern int udbg_adb_init(int force_btext);
|
|
|
|
extern void udbg_adb_init_early(void);
|
|
|
|
|
2006-01-11 07:54:09 +07:00
|
|
|
extern void __init udbg_early_init(void);
|
|
|
|
extern void __init udbg_init_debug_lpar(void);
|
powerpc/pseries: Re-implement HVSI as part of hvc_vio
On pseries machines, consoles are provided by the hypervisor using
a low level get_chars/put_chars type interface. However, this is
really just a transport to the service processor which implements
them either as "raw" console (networked consoles, HMC, ...) or as
"hvsi" serial ports.
The later is a simple packet protocol on top of the raw character
interface that is supposed to convey additional "serial port" style
semantics. In practice however, all it does is provide a way to
read the CD line and set/clear our DTR line, that's it.
We currently implement the "raw" protocol as an hvc console backend
(/dev/hvcN) and the "hvsi" protocol using a separate tty driver
(/dev/hvsi0).
However this is quite impractical. The arbitrary difference between
the two type of devices has been a major source of user (and distro)
confusion. Additionally, there's an additional mini -hvsi implementation
in the pseries platform code for our low level debug console and early
boot kernel messages, which means code duplication, though that low
level variant is impractical as it's incapable of doing the initial
protocol negociation to establish the link to the FSP.
This essentially replaces the dedicated hvsi driver and the platform
udbg code completely by extending the existing hvc_vio backend used
in "raw" mode so that:
- It now supports HVSI as well
- We add support for hvc backend providing tiocm{get,set}
- It also provides a udbg interface for early debug and boot console
This is overall less code, though this will only be obvious once we
remove the old "hvsi" driver, which is still available for now. When
the old driver is enabled, the new code still kicks in for the low
level udbg console, replacing the old mini implementation in the platform
code, it just doesn't provide the higher level "hvc" interface.
In addition to producing generally simler code, this has several benefits
over our current situation:
- The user/distro only has to deal with /dev/hvcN for the hypervisor
console, avoiding all sort of confusion that has plagued us in the past
- The tty, kernel and low level debug console all use the same code
base which supports the full protocol establishment process, thus the
console is now available much earlier than it used to be with the
old HVSI driver. The kernel console works much earlier and udbg is
available much earlier too. Hackers can enable a hard coded very-early
debug console as well that works with HVSI (previously that was only
supported for the "raw" mode).
I've tried to keep the same semantics as hvsi relative to how I react
to things like CD changes, with some subtle differences though:
- I clear DTR on close if HUPCL is set
- Current hvsi triggers a hangup if it detects a up->down transition
on CD (you can still open a console with CD down). My new implementation
triggers a hangup if the link to the FSP is severed, and severs it upon
detecting a up->down transition on CD.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2011-05-12 10:46:38 +07:00
|
|
|
extern void __init udbg_init_debug_lpar_hvsi(void);
|
2006-01-11 07:54:09 +07:00
|
|
|
extern void __init udbg_init_pmac_realmode(void);
|
|
|
|
extern void __init udbg_init_maple_realmode(void);
|
2007-02-05 05:36:49 +07:00
|
|
|
extern void __init udbg_init_pas_realmode(void);
|
2006-01-11 07:54:09 +07:00
|
|
|
extern void __init udbg_init_iseries(void);
|
2006-06-23 15:20:16 +07:00
|
|
|
extern void __init udbg_init_rtas_panel(void);
|
|
|
|
extern void __init udbg_init_rtas_console(void);
|
2007-02-02 14:43:21 +07:00
|
|
|
extern void __init udbg_init_debug_beat(void);
|
2007-02-13 11:54:22 +07:00
|
|
|
extern void __init udbg_init_btext(void);
|
2007-05-08 09:59:31 +07:00
|
|
|
extern void __init udbg_init_44x_as1(void);
|
2007-12-21 11:39:26 +07:00
|
|
|
extern void __init udbg_init_40x_realmode(void);
|
2007-07-16 23:43:43 +07:00
|
|
|
extern void __init udbg_init_cpm(void);
|
2009-12-12 13:31:51 +07:00
|
|
|
extern void __init udbg_init_usbgecko(void);
|
2011-04-15 05:32:08 +07:00
|
|
|
extern void __init udbg_init_wsp(void);
|
2011-07-09 07:06:12 +07:00
|
|
|
extern void __init udbg_init_ehv_bc(void);
|
2011-08-31 13:32:26 +07:00
|
|
|
extern void __init udbg_init_ps3gelic(void);
|
2011-09-20 00:44:59 +07:00
|
|
|
extern void __init udbg_init_debug_opal_raw(void);
|
|
|
|
extern void __init udbg_init_debug_opal_hvsi(void);
|
2006-01-11 07:54:09 +07:00
|
|
|
|
2005-12-17 04:43:46 +07:00
|
|
|
#endif /* __KERNEL__ */
|
2005-11-11 12:42:12 +07:00
|
|
|
#endif /* _ASM_POWERPC_UDBG_H */
|