[parisc-linux-cvs] STIcon/sercon patch, removal of pdc_console_die()

Helge Deller deller@gmx.de
Thu, 14 Jun 2001 14:14:12 +0200


EXTRAVERSION = -pa24
- applied the sticon/sercon patch,
- removed calls to pdc_console_die()
- applied patch as suggested by Geert Uytterhoeven <geert@linux-m68k.org>
- minor STI cleanups/changes

Index: Makefile
===================================================================
RCS file: /home/cvs/parisc/linux/Makefile,v
retrieving revision 1.56
diff -u -r1.56 Makefile
--- Makefile	2001/06/14 10:48:21	1.56
+++ Makefile	2001/06/14 12:04:06
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 0
-EXTRAVERSION = -pa23
+EXTRAVERSION = -pa24
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: arch/parisc/kernel/pdc_cons.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/pdc_cons.c,v
retrieving revision 1.25
diff -u -r1.25 pdc_cons.c
--- pdc_cons.c	2001/04/06 05:10:54	1.25
+++ pdc_cons.c	2001/06/14 12:04:12
@@ -11,6 +11,10 @@
 #include <asm/system.h>
 #include <asm/pdc.h>	/* for iodc_call() proto and friends */
 
+
+/* Enable to use this simple PDC console (for debugging purposes only!): */
+#undef EARLY_BOOTUP_DEBUG
+
 static void pdc_console_write(struct console *co, const char *s, unsigned 
count)
 {
 	while(count--)
@@ -46,9 +50,11 @@
 	if (PAGE0->mem_cons.cl_class == CL_DUPLEX)
 		memcpy(&PAGE0->mem_kbd, &PAGE0->mem_cons, sizeof(PAGE0->mem_cons));
 
+#ifdef EARLY_BOOTUP_DEBUG
 	pdc_console_write(0, "PDC Console Initialized\n", 24);
 	/* register the pdc console */
 	register_console(&pdc_cons);
+#endif /* EARLY_BOOTUP_DEBUG */
 }
 
 
@@ -57,23 +63,18 @@
 {
 	extern unsigned long log_size; /* kernel/printk.c */
 
-	printk("Switching from PDC console\n");
 	if (!pdc_console_initialized)
 		return;
 	--pdc_console_initialized;
 
+#ifdef EARLY_BOOTUP_DEBUG
+	printk("Switching from PDC console\n");
+
 	/* Don't repeat what we've already printed */
 	log_size = 0;
 
-#ifdef CONFIG_VT_CONSOLE
-	{
-	    /* fixme (needed?): Wait for console-tasklet to finish !*/
-	    extern struct tasklet_struct console_tasklet;
-    	    tasklet_schedule(&console_tasklet);
-	}
-#endif
-
 	unregister_console(&pdc_cons);
+#endif /* EARLY_BOOTUP_DEBUG */
 }
 
 
@@ -98,6 +99,11 @@
 
 	log_size = 0;
 	pdc_console_init();
+
+#ifndef EARLY_BOOTUP_DEBUG
+	register_console(&pdc_cons);
+#endif /* EARLY_BOOTUP_DEBUG */
+
 	printk("Switched to PDC console\n");
 	return;
 }
Index: arch/parisc/kernel/setup.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/setup.c,v
retrieving revision 1.81
diff -u -r1.81 setup.c
--- setup.c	2001/04/06 05:10:54	1.81
+++ setup.c	2001/06/14 12:04:13
@@ -425,14 +425,10 @@
 			boot_cpu_data.cpu_hz / 1000000,
 			boot_cpu_data.cpu_hz % 1000000	);
 
-#ifdef CONFIG_SERIAL_CONSOLE
-	/* nothing */
-#elif CONFIG_VT
-#if   defined(CONFIG_STI_CONSOLE)
-	conswitchp = &dummy_con;	/* we use take_over_console() later ! */
-#elif defined(CONFIG_DUMMY_CONSOLE)
-	conswitchp = &dummy_con;
-#endif
+#ifdef CONFIG_VT
+# if defined(CONFIG_STI_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
+        conswitchp = &dummy_con;        /* we use take_over_console() later 
! */
+# endif
 #endif
 
 }
Index: drivers/video/dummycon.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/dummycon.c,v
retrieving revision 1.5
diff -u -r1.5 dummycon.c
--- dummycon.c	2000/11/10 21:43:46	1.5
+++ dummycon.c	2001/06/14 12:04:21
@@ -21,8 +21,14 @@
 #define DUMMY_COLUMNS	ORIG_VIDEO_COLS
 #define DUMMY_ROWS	ORIG_VIDEO_LINES
 #elif defined(__hppa__)
-#define DUMMY_COLUMNS	80	/* fixme ! (mine uses 160x64 at 1280x1024) */
-#define DUMMY_ROWS	25
+#warning "FIXME: vc_resize() in console.c seems to have problems 
downsampling a console"
+/* until this is fixed or I have more clue about it you may enter here the 
columns/rows 
+ * for your screen or you will loose most of the bootup-messages on a STI 
console 
+ * (which isn't really a serious problem).
+ * Values: 160x64 for a 1280x1024, 200x150 for a 1600x1200 screen.
+ */
+#define DUMMY_COLUMNS	160	/* Maximum initial screensize */
+#define DUMMY_ROWS      64	/* FIXME: 1280x1024 -> 160x64, 1600x1200 -> 
200x150,  */
 #else
 #define DUMMY_COLUMNS	80
 #define DUMMY_ROWS	25
Index: drivers/video/sti/sticon.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticon.c,v
retrieving revision 1.9
diff -u -r1.9 sticon.c
--- sticon.c	2001/06/12 06:21:57	1.9
+++ sticon.c	2001/06/14 12:04:21
@@ -2,6 +2,7 @@
  *  linux/drivers/video/sti/sticon.c - console driver using HP's STI firmware
  *
  *	Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
+ *	Copyright (C) 2001 Helge Deller <deller@gmx.de>
  *
  *  Based on linux/drivers/video/vgacon.c and linux/drivers/video/fbcon.c,
  *  which were
@@ -125,7 +126,7 @@
 
     if (vt_cons[unit]->vc_mode != KD_TEXT)
     	    return;
-
+    
 #if 0
     if ((p->cursor_y == ypos) && (xpos <= p->cursor_x) &&
 	(p->cursor_x < (xpos + count))) {
@@ -215,11 +216,18 @@
     int vc_cols, vc_rows;
 
     sti_set(sti, 0, 0, sti_onscreen_y(sti), sti_onscreen_x(sti), 0);
-    c->vc_can_do_color = 1;
     vc_cols = sti_onscreen_x(sti) / sti->font_width;
     vc_rows = sti_onscreen_y(sti) / sti->font_height;
-
-    vc_resize_con(vc_rows, vc_cols, c->vc_num);
+    c->vc_can_do_color = 1;
+    
+    if (init) {
+	c->vc_cols = vc_cols;
+	c->vc_rows = vc_rows;
+    } else {
+	/* vc_rows = (c->vc_rows > vc_rows) ? vc_rows : c->vc_rows; */
+	/* vc_cols = (c->vc_cols > vc_cols) ? vc_cols : c->vc_cols; */
+	vc_resize_con(vc_rows, vc_cols, c->vc_num);
+    }
 }
 
 static void sticon_deinit(struct vc_data *c)
@@ -237,7 +245,7 @@
 
 static int sticon_switch(struct vc_data *conp)
 {
-    return 0;
+    return 1;	/* needs refreshing */
 }
 
 static int sticon_blank(struct vc_data *conp, int blank)
@@ -386,9 +394,8 @@
 
 int __init sticonsole_init(void)
 {
-    printk("\nsticon: searching for STI ROMs\n");
+    printk(KERN_INFO "\nsticon: searching for STI ROMs\n");
     if (sti_init_roms()) {
-	pdc_console_die();
 	take_over_console(&sti_con, 0, MAX_NR_CONSOLES - 1, 1);
 	return 0;
     } else
Index: drivers/video/sti/sticore.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticore.c,v
retrieving revision 1.12
diff -u -r1.12 sticore.c
--- sticore.c	2001/06/12 01:21:37	1.12
+++ sticore.c	2001/06/14 12:04:22
@@ -576,7 +576,7 @@
 	    	rom = flash_sti_rom;
 		
 	    if (rom) {
-		printk("Trying STI ROM at %08lx, hpa at %08lx\n",
+		printk(KERN_INFO "Trying STI ROM at %08lx, hpa at %08lx\n",
 		    rom, hpa);
 		sti = sti_try_rom_generic(rom, hpa);
 		if (sti)
Index: drivers/video/sti/stifb.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/stifb.c,v
retrieving revision 1.12
diff -u -r1.12 stifb.c
--- stifb.c	2001/05/30 00:29:22	1.12
+++ stifb.c	2001/06/14 12:04:22
@@ -672,8 +672,6 @@
 	fbgen_set_disp(-1, &fb_info.gen);
 	fbgen_install_cmap(0, &fb_info.gen);
 
-	pdc_console_die();	/* XXX */
-
 	if (register_framebuffer(&fb_info.gen.info) < 0)
 		return -EINVAL;