--- linux-2.0.29/arch/m68k/console/fbcon.c.291197 Tue Dec 2 04:46:18 1997
+++ linux-2.0.29/arch/m68k/console/fbcon.c Tue Dec 2 06:27:05 1997
@@ -44,6 +44,9 @@
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/kernel.h>
+#ifdef CONFIG_MAC
+#include <linux/delay.h>
+#endif
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
@@ -187,21 +190,15 @@
/* ++Geert: Sorry, no hardware cursor support at the moment;
use Atari alike software cursor */
-/* Michael: Mac needs timer-based cursor, possibly */
-#define MAC_VBL_CURSOR
-
static int cursor_drawn = 0;
#define CURSOR_DRAW_DELAY (2)
/* # VBL ints between cursor state changes */
-#define AMIGA_CURSOR_BLINK_RATE (20)
-#define ATARI_CURSOR_BLINK_RATE (42)
-#ifdef MAC_VBL_CURSOR
-#define MAC_CURSOR_BLINK_RATE (32)
-#else
-#define MAC_CURSOR_BLINK_RATE (2)
-#endif
+#define AMIGA_CURSOR_BLINK_RATE (20)
+#define ATARI_CURSOR_BLINK_RATE (42)
+#define MAC_CURSOR_VBL_BLINK_RATE (32)
+#define MAC_CURSOR_TIMER_BLINK_RATE (2)
static int vbl_cursor_cnt = 0;
static int cursor_on = 0;
@@ -562,15 +559,26 @@
#ifdef CONFIG_MAC
-extern int console_loglevel;
+/*
+ * On the Macintoy, there may or may not be a working VBL int. We need to probe
+ */
+static int vbl_detected = 0;
+static void mac_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
+{
+ vbl_detected++;
+}
+
+/*
+ * Just in case no VBL int. can be detected, we need a timer-based cursor :-(.
+ */
static void mac_cursor_blink(unsigned long);
static struct timer_list mac_cursor_timer = { NULL, NULL, 0, 0, mac_cursor_blink };
static void mac_cursor_blink(unsigned long xxx)
{
fbcon_vbl_handler(0, NULL, NULL);
- mac_cursor_timer.expires = jiffies + HZ/4;
+ mac_cursor_timer.expires = jiffies + HZ/6;
mac_cursor_timer.data = 0;
mac_cursor_timer.next = NULL;
add_timer(&mac_cursor_timer);
@@ -602,23 +610,38 @@
#endif /* CONFIG_ATARI */
#ifdef CONFIG_MAC
if (MACH_IS_MAC) {
- cursor_blink_rate = MAC_CURSOR_BLINK_RATE;
+ int ct = 0;
/*
- * Won't work yet ...
+ * Probe for VBL: set temp. handler ...
*/
-#ifdef MAC_VBL_CURSOR
- irqres = request_irq(IRQ_MAC_VBL, fbcon_vbl_handler, 0,
+ irqres = request_irq(IRQ_MAC_VBL, mac_vbl_detect, 0,
"console/cursor", fbcon_vbl_handler);
-
-#else
/*
- * timer based cursor init
+ * ... and spin for 20 ms ...
*/
- mac_cursor_timer.expires = jiffies + HZ/2;
- mac_cursor_timer.data = 0;
- mac_cursor_timer.next = NULL;
- add_timer(&mac_cursor_timer);
-#endif
+ while (!vbl_detected && ++ct<1000)
+ udelay(20);
+
+ if(ct==1000)
+ printk("fbcon_startup: No VBL detected, using timer based cursor.\n");
+
+ if (vbl_detected) {
+ /*
+ * interrupt based cursor ok
+ */
+ cursor_blink_rate = MAC_CURSOR_VBL_BLINK_RATE;
+ irqres = request_irq(IRQ_MAC_VBL, fbcon_vbl_handler, 0,
+ "console/cursor", fbcon_vbl_handler);
+ } else {
+ /*
+ * VBL not detected: use timer based cursor
+ */
+ cursor_blink_rate = MAC_CURSOR_TIMER_BLINK_RATE;
+ mac_cursor_timer.expires = jiffies + HZ/2;
+ mac_cursor_timer.data = 0;
+ mac_cursor_timer.next = NULL;
+ add_timer(&mac_cursor_timer);
+ }
}
#endif /* CONFIG_MAC */
--- linux-2.0.29/arch/m68k/mac/macfb.c.291197 Tue Dec 2 04:20:57 1997
+++ linux-2.0.29/arch/m68k/mac/macfb.c Tue Dec 2 04:20:57 1997
@@ -131,7 +131,7 @@
fix->smem_len=PAGE_ALIGN(mac_videosize);
} else {
/*
- * Needs fixes in mm/filemap.c (bogus)
+ * Needs fixes in fbmem.c
*/
fix->smem_start=mac_videobase;
if (console_loglevel >= 7)
--- linux-2.0.29/arch/m68k/mac/mackeyb.c.291197 Thu Dec 4 05:10:54 1997
+++ linux-2.0.29/arch/m68k/mac/mackeyb.c Thu Dec 4 07:11:47 1997
@@ -67,7 +67,7 @@
0xf200, 0xf310, 0xf200, 0xf30c, 0xf200, 0xf30a, 0xf200, 0xf208,
0xf200, 0xf200, 0xf200, 0xf30d, 0xf30e, 0xf200, 0xf30b, 0xf200,
0xf200, 0xf200, 0xf300, 0xf301, 0xf302, 0xf303, 0xf304, 0xf305,
- 0xf306, 0xf307, 0xf200, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
+ 0xf306, 0xf307, 0xfb61, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
0xf104, 0xf105, 0xf106, 0xf102, 0xf107, 0xf108, 0xf200, 0xf10a,
0xf200, 0xf10c, 0xf200, 0xf209, 0xf200, 0xf109, 0xf200, 0xf10b,
0xf200, 0xf11d, 0xf115, 0xf114, 0xf118, 0xf116, 0xf103, 0xf117,
@@ -86,7 +86,7 @@
0xf200, 0xf310, 0xf200, 0xf30c, 0xf200, 0xf30a, 0xf200, 0xf208,
0xf200, 0xf200, 0xf200, 0xf30d, 0xf30e, 0xf200, 0xf30b, 0xf200,
0xf200, 0xf200, 0xf300, 0xf301, 0xf302, 0xf303, 0xf304, 0xf305,
- 0xf306, 0xf307, 0xf200, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
+ 0xf306, 0xf307, 0xfb41, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
0xf10e, 0xf10f, 0xf110, 0xf10c, 0xf111, 0xf112, 0xf200, 0xf10a,
0xf200, 0xf10c, 0xf200, 0xf203, 0xf200, 0xf113, 0xf200, 0xf10b,
0xf200, 0xf11d, 0xf115, 0xf114, 0xf20b, 0xf116, 0xf10d, 0xf117,
@@ -105,7 +105,7 @@
0xf200, 0xf310, 0xf200, 0xf30c, 0xf200, 0xf30a, 0xf200, 0xf208,
0xf200, 0xf200, 0xf200, 0xf30d, 0xf30e, 0xf200, 0xf30b, 0xf200,
0xf200, 0xf200, 0xf90a, 0xf90b, 0xf90c, 0xf90d, 0xf90e, 0xf90f,
- 0xf910, 0xf911, 0xf200, 0xf912, 0xf913, 0xf200, 0xf200, 0xf200,
+ 0xf910, 0xf911, 0xf914, 0xf912, 0xf913, 0xf200, 0xf200, 0xf200,
0xf510, 0xf511, 0xf512, 0xf50e, 0xf513, 0xf514, 0xf200, 0xf516,
0xf200, 0xf10c, 0xf200, 0xf202, 0xf200, 0xf515, 0xf200, 0xf517,
0xf200, 0xf11d, 0xf115, 0xf114, 0xf118, 0xf116, 0xf50f, 0xf117,
@@ -124,7 +124,7 @@
0xf200, 0xf310, 0xf200, 0xf30c, 0xf200, 0xf30a, 0xf200, 0xf208,
0xf200, 0xf200, 0xf200, 0xf30d, 0xf30e, 0xf200, 0xf30b, 0xf200,
0xf200, 0xf200, 0xf300, 0xf301, 0xf302, 0xf303, 0xf304, 0xf305,
- 0xf306, 0xf307, 0xf200, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
+ 0xf306, 0xf307, 0xf001, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
0xf104, 0xf105, 0xf106, 0xf102, 0xf107, 0xf108, 0xf200, 0xf10a,
0xf200, 0xf10c, 0xf200, 0xf204, 0xf200, 0xf109, 0xf200, 0xf10b,
0xf200, 0xf11d, 0xf115, 0xf114, 0xf118, 0xf116, 0xf103, 0xf117,
@@ -143,7 +143,7 @@
0xf200, 0xf310, 0xf200, 0xf30c, 0xf200, 0xf30a, 0xf200, 0xf208,
0xf200, 0xf200, 0xf200, 0xf30d, 0xf30e, 0xf200, 0xf30b, 0xf200,
0xf200, 0xf200, 0xf300, 0xf301, 0xf302, 0xf303, 0xf304, 0xf305,
- 0xf306, 0xf307, 0xf200, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
+ 0xf306, 0xf307, 0xf001, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
0xf200, 0xf10c, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
0xf200, 0xf11d, 0xf115, 0xf114, 0xf118, 0xf116, 0xf200, 0xf117,
@@ -162,7 +162,7 @@
0xf200, 0xf310, 0xf200, 0xf30c, 0xf200, 0xf30a, 0xf200, 0xf208,
0xf200, 0xf200, 0xf200, 0xf30d, 0xf30e, 0xf200, 0xf30b, 0xf200,
0xf200, 0xf200, 0xf900, 0xf901, 0xf902, 0xf903, 0xf904, 0xf905,
- 0xf906, 0xf907, 0xf200, 0xf908, 0xf909, 0xf200, 0xf200, 0xf200,
+ 0xf906, 0xf907, 0xf861, 0xf908, 0xf909, 0xf200, 0xf200, 0xf200,
0xf504, 0xf505, 0xf506, 0xf502, 0xf507, 0xf508, 0xf200, 0xf50a,
0xf200, 0xf10c, 0xf200, 0xf209, 0xf200, 0xf509, 0xf200, 0xf50b,
0xf200, 0xf11d, 0xf115, 0xf114, 0xf118, 0xf116, 0xf503, 0xf117,
@@ -181,7 +181,7 @@
0xf200, 0xf310, 0xf200, 0xf30c, 0xf200, 0xf30a, 0xf200, 0xf208,
0xf200, 0xf200, 0xf200, 0xf30d, 0xf30e, 0xf200, 0xf30b, 0xf200,
0xf200, 0xf200, 0xf300, 0xf301, 0xf302, 0xf303, 0xf304, 0xf305,
- 0xf306, 0xf307, 0xf200, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
+ 0xf306, 0xf307, 0xf801, 0xf308, 0xf309, 0xf200, 0xf200, 0xf200,
0xf504, 0xf505, 0xf506, 0xf502, 0xf507, 0xf508, 0xf200, 0xf50a,
0xf200, 0xf10c, 0xf200, 0xf200, 0xf200, 0xf509, 0xf200, 0xf50b,
0xf200, 0xf11d, 0xf115, 0xf114, 0xf118, 0xf116, 0xf503, 0xf117,
--- linux-2.0.29/drivers/char/fbmem.c.291197 Thu Dec 4 04:56:40 1997
+++ linux-2.0.29/drivers/char/fbmem.c Thu Dec 4 04:56:40 1997
@@ -212,7 +212,11 @@
fb->fb_get_fix(&fix, PROC_CONSOLE());
if ((vma->vm_end - vma->vm_start + vma->vm_offset) > fix.smem_len)
return -EINVAL;
+#if 0
vma->vm_offset += fix.smem_start;
+#else
+ vma->vm_offset += (fix.smem_start & PAGE_MASK);
+#endif
if (vma->vm_offset & ~PAGE_MASK)
return -ENXIO;
if (CPU_IS_040_OR_060) {
--- linux-2.0.29/drivers/char/keyb_m68k.c.291197 Thu Dec 4 05:03:19 1997
+++ linux-2.0.29/drivers/char/keyb_m68k.c Thu Dec 4 05:03:19 1997
@@ -747,6 +747,7 @@
case 0x7b: keycode = 0x38; break; /* R-shift */
case 0x7c: keycode = 0x3a; break; /* R-option */
case 0x7d: keycode = 0x36; break; /* R-control */
+ case 0x0: if (!raw_mode) keycode = 0x5a; break; /* A */
}
/*
--- linux-2.0.29/drivers/nubus/nubus.c.291197 Wed Dec 3 07:07:57 1997
+++ linux-2.0.29/drivers/nubus/nubus.c Wed Dec 3 07:08:18 1997
@@ -356,6 +356,12 @@
void nubus_probe_slot(int slot, int mode)
{
+#define C030_DISABLE_D (0xfffffeff)
+#define C030_ENABLE_D (0x00000100)
+#define C030_DISABLE_I (0xfffffffe)
+#define C030_ENABLE_I (0x00000001)
+#define C030_DISABLE_A (0xfffffefe)
+#define C030_ENABLE_A (0x00000101)
unsigned char *rp;
unsigned char dp;
int lanes;
@@ -365,6 +371,15 @@
struct nubus_dirent *nd;
struct nubus_type type_info;
+ if (!m68k_is040or060) {
+ /* disable data cache */
+ asm volatile ("movec %/cacr,%/d0\n\t"
+ "andil %0,%/d0\n\t"
+ "movec %/d0,%/cacr"
+ : : "i" (C030_DISABLE_A)
+ : "d0");
+ }
+
/*
* Ok see whats cooking in the bytelanes
*/
@@ -514,7 +529,24 @@
}
if (mode==1)
nubus_video_shutup(slot, &type_info);
+
+ if (!m68k_is040or060) {
+ /* re-enable data cache */
+ asm volatile ("movec %/cacr,%/d0\n\t"
+ "oril %0,%/d0\n\t"
+ "movec %/d0,%/cacr"
+ : : "i" (C030_ENABLE_A)
+ : "d0");
+ }
return;
+ }
+ if (!m68k_is040or060) {
+ /* re-enable data cache */
+ asm volatile ("movec %/cacr,%/d0\n\t"
+ "oril %0,%/d0\n\t"
+ "movec %/d0,%/cacr"
+ : : "i" (C030_ENABLE_A)
+ : "d0");
}
}