aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r--arch/powerpc/kernel/rtas.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 77f1e06d208d..6ef80d4e38d3 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -177,10 +177,12 @@ void __init udbg_init_rtas_console(void)
177void rtas_progress(char *s, unsigned short hex) 177void rtas_progress(char *s, unsigned short hex)
178{ 178{
179 struct device_node *root; 179 struct device_node *root;
180 int width, *p; 180 int width;
181 const int *p;
181 char *os; 182 char *os;
182 static int display_character, set_indicator; 183 static int display_character, set_indicator;
183 static int display_width, display_lines, *row_width, form_feed; 184 static int display_width, display_lines, form_feed;
185 const static int *row_width;
184 static DEFINE_SPINLOCK(progress_lock); 186 static DEFINE_SPINLOCK(progress_lock);
185 static int current_line; 187 static int current_line;
186 static int pending_newline = 0; /* did last write end with unprinted newline? */ 188 static int pending_newline = 0; /* did last write end with unprinted newline? */
@@ -191,16 +193,16 @@ void rtas_progress(char *s, unsigned short hex)
191 if (display_width == 0) { 193 if (display_width == 0) {
192 display_width = 0x10; 194 display_width = 0x10;
193 if ((root = find_path_device("/rtas"))) { 195 if ((root = find_path_device("/rtas"))) {
194 if ((p = (unsigned int *)get_property(root, 196 if ((p = get_property(root,
195 "ibm,display-line-length", NULL))) 197 "ibm,display-line-length", NULL)))
196 display_width = *p; 198 display_width = *p;
197 if ((p = (unsigned int *)get_property(root, 199 if ((p = get_property(root,
198 "ibm,form-feed", NULL))) 200 "ibm,form-feed", NULL)))
199 form_feed = *p; 201 form_feed = *p;
200 if ((p = (unsigned int *)get_property(root, 202 if ((p = get_property(root,
201 "ibm,display-number-of-lines", NULL))) 203 "ibm,display-number-of-lines", NULL)))
202 display_lines = *p; 204 display_lines = *p;
203 row_width = (unsigned int *)get_property(root, 205 row_width = get_property(root,
204 "ibm,display-truncation-length", NULL); 206 "ibm,display-truncation-length", NULL);
205 } 207 }
206 display_character = rtas_token("display-character"); 208 display_character = rtas_token("display-character");
@@ -293,10 +295,10 @@ EXPORT_SYMBOL(rtas_progress); /* needed by rtas_flash module */
293 295
294int rtas_token(const char *service) 296int rtas_token(const char *service)
295{ 297{
296 int *tokp; 298 const int *tokp;
297 if (rtas.dev == NULL) 299 if (rtas.dev == NULL)
298 return RTAS_UNKNOWN_SERVICE; 300 return RTAS_UNKNOWN_SERVICE;
299 tokp = (int *) get_property(rtas.dev, service, NULL); 301 tokp = get_property(rtas.dev, service, NULL);
300 return tokp ? *tokp : RTAS_UNKNOWN_SERVICE; 302 return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
301} 303}
302EXPORT_SYMBOL(rtas_token); 304EXPORT_SYMBOL(rtas_token);
@@ -626,6 +628,9 @@ void rtas_os_term(char *str)
626{ 628{
627 int status; 629 int status;
628 630
631 if (panic_timeout)
632 return;
633
629 if (RTAS_UNKNOWN_SERVICE == rtas_token("ibm,os-term")) 634 if (RTAS_UNKNOWN_SERVICE == rtas_token("ibm,os-term"))
630 return; 635 return;
631 636
@@ -687,15 +692,14 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
687 int i; 692 int i;
688 long state; 693 long state;
689 long rc; 694 long rc;
690 unsigned long dummy; 695 unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
691
692 struct rtas_suspend_me_data data; 696 struct rtas_suspend_me_data data;
693 697
694 /* Make sure the state is valid */ 698 /* Make sure the state is valid */
695 rc = plpar_hcall(H_VASI_STATE, 699 rc = plpar_hcall(H_VASI_STATE, retbuf,
696 ((u64)args->args[0] << 32) | args->args[1], 700 ((u64)args->args[0] << 32) | args->args[1]);
697 0, 0, 0, 701
698 &state, &dummy, &dummy); 702 state = retbuf[0];
699 703
700 if (rc) { 704 if (rc) {
701 printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc); 705 printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc);
@@ -845,15 +849,15 @@ void __init rtas_initialize(void)
845 */ 849 */
846 rtas.dev = of_find_node_by_name(NULL, "rtas"); 850 rtas.dev = of_find_node_by_name(NULL, "rtas");
847 if (rtas.dev) { 851 if (rtas.dev) {
848 u32 *basep, *entryp; 852 const u32 *basep, *entryp, *sizep;
849 u32 *sizep;
850 853
851 basep = (u32 *)get_property(rtas.dev, "linux,rtas-base", NULL); 854 basep = get_property(rtas.dev, "linux,rtas-base", NULL);
852 sizep = (u32 *)get_property(rtas.dev, "rtas-size", NULL); 855 sizep = get_property(rtas.dev, "rtas-size", NULL);
853 if (basep != NULL && sizep != NULL) { 856 if (basep != NULL && sizep != NULL) {
854 rtas.base = *basep; 857 rtas.base = *basep;
855 rtas.size = *sizep; 858 rtas.size = *sizep;
856 entryp = (u32 *)get_property(rtas.dev, "linux,rtas-entry", NULL); 859 entryp = get_property(rtas.dev,
860 "linux,rtas-entry", NULL);
857 if (entryp == NULL) /* Ugh */ 861 if (entryp == NULL) /* Ugh */
858 rtas.entry = rtas.base; 862 rtas.entry = rtas.base;
859 else 863 else
@@ -909,6 +913,11 @@ int __init early_init_dt_scan_rtas(unsigned long node,
909 basep = of_get_flat_dt_prop(node, "get-term-char", NULL); 913 basep = of_get_flat_dt_prop(node, "get-term-char", NULL);
910 if (basep) 914 if (basep)
911 rtas_getchar_token = *basep; 915 rtas_getchar_token = *basep;
916
917 if (rtas_putchar_token != RTAS_UNKNOWN_SERVICE &&
918 rtas_getchar_token != RTAS_UNKNOWN_SERVICE)
919 udbg_init_rtas_console();
920
912#endif 921#endif
913 922
914 /* break now */ 923 /* break now */