aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-07-20 19:59:26 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-20 19:59:26 -0400
commitc73fcc846c91f53fd2c67fd9c6c04888a9e5892e (patch)
tree31faa68b4176636756926535a0f50ff780973275 /include/asm-sparc64
parentede13d81b4dda409a6d271b34b8e2ec9383e255d (diff)
[SPARC]: Fix serial console device detection.
The current scheme works on static interpretation of text names, which is wrong. The output-device setting, for example, must be resolved via an alias or similar to a full path name to the console device. Paths also contain an optional set of 'options', which starts with a colon at the end of the path. The option area is used to specify which of two serial ports ('a' or 'b') the path refers to when a device node drives multiple ports. 'a' is assumed if the option specification is missing. This was caught by the UltraSPARC-T1 simulator. The 'output-device' property was set to 'ttya' and we didn't pick upon the fact that this is an OBP alias set to '/virtual-devices/console'. Instead we saw it as the first serial console device, instead of the hypervisor console. The infrastructure is now there to take advantage of this to resolve the console correctly even in multi-head situations in fbcon too. Thanks to Greg Onufer for the bug report. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/oplib.h28
-rw-r--r--include/asm-sparc64/prom.h4
-rw-r--r--include/asm-sparc64/system.h6
3 files changed, 6 insertions, 32 deletions
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h
index 992f9f7a476c..3f23c5dc5f21 100644
--- a/include/asm-sparc64/oplib.h
+++ b/include/asm-sparc64/oplib.h
@@ -140,32 +140,6 @@ extern void prom_putchar(char character);
140extern void prom_printf(const char *fmt, ...); 140extern void prom_printf(const char *fmt, ...);
141extern void prom_write(const char *buf, unsigned int len); 141extern void prom_write(const char *buf, unsigned int len);
142 142
143/* Query for input device type */
144
145enum prom_input_device {
146 PROMDEV_IKBD, /* input from keyboard */
147 PROMDEV_ITTYA, /* input from ttya */
148 PROMDEV_ITTYB, /* input from ttyb */
149 PROMDEV_IRSC, /* input from rsc */
150 PROMDEV_IVCONS, /* input from virtual-console */
151 PROMDEV_I_UNK,
152};
153
154extern enum prom_input_device prom_query_input_device(void);
155
156/* Query for output device type */
157
158enum prom_output_device {
159 PROMDEV_OSCREEN, /* to screen */
160 PROMDEV_OTTYA, /* to ttya */
161 PROMDEV_OTTYB, /* to ttyb */
162 PROMDEV_ORSC, /* to rsc */
163 PROMDEV_OVCONS, /* to virtual-console */
164 PROMDEV_O_UNK,
165};
166
167extern enum prom_output_device prom_query_output_device(void);
168
169/* Multiprocessor operations... */ 143/* Multiprocessor operations... */
170#ifdef CONFIG_SMP 144#ifdef CONFIG_SMP
171/* Start the CPU with the given device tree node at the passed program 145/* Start the CPU with the given device tree node at the passed program
@@ -319,6 +293,8 @@ extern int prom_inst2pkg(int);
319extern int prom_service_exists(const char *service_name); 293extern int prom_service_exists(const char *service_name);
320extern void prom_sun4v_guest_soft_state(void); 294extern void prom_sun4v_guest_soft_state(void);
321 295
296extern int prom_ihandle2path(int handle, char *buffer, int bufsize);
297
322/* Client interface level routines. */ 298/* Client interface level routines. */
323extern void prom_set_trap_table(unsigned long tba); 299extern void prom_set_trap_table(unsigned long tba);
324extern void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa); 300extern void prom_set_trap_table_sun4v(unsigned long tba, unsigned long mmfsa);
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 2b9e0d795faf..31dcb92fbae0 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -94,5 +94,9 @@ static inline void of_node_put(struct device_node *node)
94 */ 94 */
95#include <linux/of.h> 95#include <linux/of.h>
96 96
97extern struct device_node *of_console_device;
98extern char *of_console_path;
99extern char *of_console_options;
100
97#endif /* __KERNEL__ */ 101#endif /* __KERNEL__ */
98#endif /* _SPARC64_PROM_H */ 102#endif /* _SPARC64_PROM_H */
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 409067408eec..64891cb10f05 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -115,14 +115,8 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
115#ifndef __ASSEMBLY__ 115#ifndef __ASSEMBLY__
116 116
117extern void sun_do_break(void); 117extern void sun_do_break(void);
118extern int serial_console;
119extern int stop_a_enabled; 118extern int stop_a_enabled;
120 119
121static __inline__ int con_is_present(void)
122{
123 return serial_console ? 0 : 1;
124}
125
126extern void synchronize_user_stack(void); 120extern void synchronize_user_stack(void);
127 121
128extern void __flushw_user(void); 122extern void __flushw_user(void);