aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle McMartin <kyle@shortfin.cabal.ca>2007-12-06 12:32:15 -0500
committerKyle McMartin <kyle@shortfin.cabal.ca>2007-12-06 12:32:15 -0500
commit721fdf34167580ff98263c74cead8871d76936e6 (patch)
treee3ab5c95cea22135d5205a8f2438a79222cd6ff2
parentac6aecbf0541ca277e6492fdf7c91e46e1fc4171 (diff)
[PARISC] print more than one character at a time for pdc console
There's really no reason not to print more than one character at a time to the PDC console... Booting is measurably speedier, and now I don't have to watch individual characters get drawn. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
-rw-r--r--arch/parisc/kernel/firmware.c88
-rw-r--r--arch/parisc/kernel/pdc_cons.c11
-rw-r--r--include/asm-parisc/pdc.h3
3 files changed, 37 insertions, 65 deletions
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index fd6552c4c08c..4ab83d56974d 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -1082,76 +1082,56 @@ void pdc_io_reset_devices(void)
1082 1082
1083 1083
1084/** 1084/**
1085 * pdc_iodc_putc - Console character print using IODC. 1085 * pdc_iodc_print - Console print using IODC.
1086 * @c: the character to output. 1086 * @str: the string to output.
1087 * @count: length of str
1087 * 1088 *
1088 * Note that only these special chars are architected for console IODC io: 1089 * Note that only these special chars are architected for console IODC io:
1089 * BEL, BS, CR, and LF. Others are passed through. 1090 * BEL, BS, CR, and LF. Others are passed through.
1090 * Since the HP console requires CR+LF to perform a 'newline', we translate 1091 * Since the HP console requires CR+LF to perform a 'newline', we translate
1091 * "\n" to "\r\n". 1092 * "\n" to "\r\n".
1092 */ 1093 */
1093void pdc_iodc_putc(unsigned char c) 1094int pdc_iodc_print(unsigned char *str, unsigned count)
1094{ 1095{
1095 /* XXX Should we spinlock posx usage */ 1096 /* XXX Should we spinlock posx usage */
1096 static int posx; /* for simple TAB-Simulation... */ 1097 static int posx; /* for simple TAB-Simulation... */
1097 static int __attribute__((aligned(8))) iodc_retbuf[32]; 1098 int __attribute__((aligned(8))) iodc_retbuf[32];
1098 static char __attribute__((aligned(64))) iodc_dbuf[4096]; 1099 char __attribute__((aligned(64))) iodc_dbuf[4096];
1099 unsigned int n; 1100 unsigned int i;
1100 unsigned long flags; 1101 unsigned long flags;
1101 1102
1102 switch (c) { 1103 memset(iodc_dbuf, 0, 4096);
1103 case '\n': 1104 for (i = 0; i < count && i < 2048;) {
1104 iodc_dbuf[0] = '\r'; 1105 switch(str[i]) {
1105 iodc_dbuf[1] = '\n'; 1106 case '\n':
1106 n = 2; 1107 iodc_dbuf[i+0] = '\r';
1107 posx = 0; 1108 iodc_dbuf[i+1] = '\n';
1108 break; 1109 i += 2;
1109 case '\t': 1110 posx = 0;
1110 pdc_iodc_putc(' '); 1111 break;
1111 while (posx & 7) /* expand TAB */ 1112 case '\t':
1112 pdc_iodc_putc(' '); 1113 while (posx & 7) {
1113 return; /* return since IODC can't handle this */ 1114 iodc_dbuf[i] = ' ';
1114 case '\b': 1115 i++, posx++;
1115 posx-=2; /* BS */ 1116 }
1116 default: 1117 break;
1117 iodc_dbuf[0] = c; 1118 case '\b': /* BS */
1118 n = 1; 1119 posx -= 2;
1119 posx++; 1120 default:
1120 break; 1121 iodc_dbuf[i] = str[i];
1121 } 1122 i++, posx++;
1123 break;
1124 }
1125 }
1122 1126
1123 spin_lock_irqsave(&pdc_lock, flags); 1127 spin_lock_irqsave(&pdc_lock, flags);
1124 real32_call(PAGE0->mem_cons.iodc_io, 1128 real32_call(PAGE0->mem_cons.iodc_io,
1125 (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT, 1129 (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT,
1126 PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers), 1130 PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers),
1127 __pa(iodc_retbuf), 0, __pa(iodc_dbuf), n, 0); 1131 __pa(iodc_retbuf), 0, __pa(iodc_dbuf), i, 0);
1128 spin_unlock_irqrestore(&pdc_lock, flags); 1132 spin_unlock_irqrestore(&pdc_lock, flags);
1129}
1130 1133
1131/** 1134 return i;
1132 * pdc_iodc_outc - Console character print using IODC (without conversions).
1133 * @c: the character to output.
1134 *
1135 * Write the character directly to the IODC console.
1136 */
1137void pdc_iodc_outc(unsigned char c)
1138{
1139 unsigned int n;
1140 unsigned long flags;
1141
1142 /* fill buffer with one caracter and print it */
1143 static int __attribute__((aligned(8))) iodc_retbuf[32];
1144 static char __attribute__((aligned(64))) iodc_dbuf[4096];
1145
1146 n = 1;
1147 iodc_dbuf[0] = c;
1148
1149 spin_lock_irqsave(&pdc_lock, flags);
1150 real32_call(PAGE0->mem_cons.iodc_io,
1151 (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT,
1152 PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers),
1153 __pa(iodc_retbuf), 0, __pa(iodc_dbuf), n, 0);
1154 spin_unlock_irqrestore(&pdc_lock, flags);
1155} 1135}
1156 1136
1157/** 1137/**
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index aab05767427c..33b1f84441b1 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -55,13 +55,7 @@
55 55
56static void pdc_console_write(struct console *co, const char *s, unsigned count) 56static void pdc_console_write(struct console *co, const char *s, unsigned count)
57{ 57{
58 while(count--) 58 pdc_iodc_print(s, count);
59 pdc_iodc_putc(*s++);
60}
61
62void pdc_outc(unsigned char c)
63{
64 pdc_iodc_outc(c);
65} 59}
66 60
67void pdc_printf(const char *fmt, ...) 61void pdc_printf(const char *fmt, ...)
@@ -74,8 +68,7 @@ void pdc_printf(const char *fmt, ...)
74 len = vscnprintf(buf, sizeof(buf), fmt, args); 68 len = vscnprintf(buf, sizeof(buf), fmt, args);
75 va_end(args); 69 va_end(args);
76 70
77 for (i = 0; i < len; i++) 71 pdc_iodc_print(buf, len);
78 pdc_iodc_outc(buf[i]);
79} 72}
80 73
81int pdc_console_poll_key(struct console *co) 74int pdc_console_poll_key(struct console *co)
diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h
index 5e0c3ca5450b..deda8c311373 100644
--- a/include/asm-parisc/pdc.h
+++ b/include/asm-parisc/pdc.h
@@ -645,8 +645,7 @@ int pdc_soft_power_button(int sw_control);
645void pdc_io_reset(void); 645void pdc_io_reset(void);
646void pdc_io_reset_devices(void); 646void pdc_io_reset_devices(void);
647int pdc_iodc_getc(void); 647int pdc_iodc_getc(void);
648void pdc_iodc_putc(unsigned char c); 648int pdc_iodc_print(unsigned char *str, unsigned count);
649void pdc_iodc_outc(unsigned char c);
650void pdc_printf(const char *fmt, ...); 649void pdc_printf(const char *fmt, ...);
651 650
652void pdc_emergency_unlock(void); 651void pdc_emergency_unlock(void);