public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 00/18] m68k patches for 2.6.28
@ 2008-10-13 19:58 Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 01/18] m68k: use bcd2bin/bin2bcd Geert Uytterhoeven
                   ` (17 more replies)
  0 siblings, 18 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

        Hi Linus,

Here are the m68k patches I had queued up for the 2.6.28 merge window:
  [01] [PATCH] m68k: use bcd2bin/bin2bcd
  [02] [PATCH] m68k: Use new printk() extension %pS to print symbols
  [03] [PATCH] m68k: Put .bss at the end of the data section
  [04] [PATCH] m68k: Add NOTES to init data so it's discarded at boot
  [05] [PATCH] m68k: Reverse platform MMU logic so Sun 3 is last
  [06] [PATCH] m68k: Disable Amiga serial console support if modular
  [07] [PATCH] m68k: Modular Amiga keyboard needs key_maps
  [08] [PATCH] m68k: Remove unused atari_kbd_translate()
  [09] [PATCH] m68k: Define rtc_lock on Atari
  [10] [PATCH] m68k: Add missing dma_sync_single_range_for_{cpu,device}()
  [11] [PATCH] m68k: <asm/pci.h> needs <asm-generic/pci-dma-compat.h>
  [12] [PATCH] HP input: kill warnings due to suseconds_t differences
  [13] [PATCH] m68k: Remove the broken Hades support
  [14] [PATCH] m68k: remove the dead PCI code
  [15] [PATCH] m68k: init_irq_proc depends on CONFIG_PROC_FS
  [16] [PATCH] m68k: Atari SCSI needs NVRAM
  [17] [PATCH] net/rfkill/rfkill-input.c needs <linux/sched.h>
  [18] [PATCH] arch/m68k/mm/kmap.c: introduce missing kfree

All of them have been reviewed before.
All of them (except for the last one) have been braising in linux-next for
a while.

Thanks for applying!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 01/18] m68k: use bcd2bin/bin2bcd
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 02/18] m68k: Use new printk() extension %pS to print symbols Geert Uytterhoeven
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Adrian Bunk

[-- Attachment #1: m68k-use-bcd2bin-bin2bcd.diff --]
[-- Type: text/plain, Size: 9194 bytes --]

From: Adrian Bunk <bunk@kernel.org>

This patch changes m68k to use the new bcd2bin/bin2bcd functions instead 
of the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros.

It also remove local bcd2bin/bin2bcd implementations
in favor of the global ones.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---

 arch/m68k/atari/time.c      |   35 ++++++++++++++++++-----------------
 arch/m68k/bvme6000/config.c |   15 +--------------
 arch/m68k/bvme6000/rtc.c    |   30 +++++++++++++++---------------
 arch/m68k/mvme16x/rtc.c     |   26 +++++++++++++-------------
 arch/m68k/q40/config.c      |   12 +-----------
 arch/m68k/sun3x/time.c      |   28 ++++++++++++++--------------
 6 files changed, 62 insertions(+), 84 deletions(-)

7967e50519a24d3c87e55e7a5af8b71dd2dd618d 
--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -191,13 +191,14 @@ int atari_tt_hwclk( int op, struct rtc_t
         }
 
         if (!(ctrl & RTC_DM_BINARY)) {
-            BIN_TO_BCD(sec);
-            BIN_TO_BCD(min);
-            BIN_TO_BCD(hour);
-            BIN_TO_BCD(day);
-            BIN_TO_BCD(mon);
-            BIN_TO_BCD(year);
-            if (wday >= 0) BIN_TO_BCD(wday);
+	    sec = bin2bcd(sec);
+	    min = bin2bcd(min);
+	    hour = bin2bcd(hour);
+	    day = bin2bcd(day);
+	    mon = bin2bcd(mon);
+	    year = bin2bcd(year);
+	    if (wday >= 0)
+		wday = bin2bcd(wday);
         }
     }
 
@@ -252,13 +253,13 @@ int atari_tt_hwclk( int op, struct rtc_t
 	}
 
 	if (!(ctrl & RTC_DM_BINARY)) {
-            BCD_TO_BIN(sec);
-            BCD_TO_BIN(min);
-            BCD_TO_BIN(hour);
-            BCD_TO_BIN(day);
-            BCD_TO_BIN(mon);
-            BCD_TO_BIN(year);
-            BCD_TO_BIN(wday);
+	    sec = bcd2bin(sec);
+	    min = bcd2bin(min);
+	    hour = bcd2bin(hour);
+	    day = bcd2bin(day);
+	    mon = bcd2bin(mon);
+	    year = bcd2bin(year);
+	    wday = bcd2bin(wday);
         }
 
         if (!(ctrl & RTC_24H)) {
@@ -318,7 +319,7 @@ int atari_tt_set_clock_mmss (unsigned lo
 
     rtc_minutes = RTC_READ (RTC_MINUTES);
     if (!(save_control & RTC_DM_BINARY))
-        BCD_TO_BIN (rtc_minutes);
+	rtc_minutes = bcd2bin(rtc_minutes);
 
     /* Since we're only adjusting minutes and seconds, don't interfere
        with hour overflow.  This avoids messing with unknown time zones
@@ -329,8 +330,8 @@ int atari_tt_set_clock_mmss (unsigned lo
         {
             if (!(save_control & RTC_DM_BINARY))
                 {
-                    BIN_TO_BCD (real_seconds);
-                    BIN_TO_BCD (real_minutes);
+		    real_seconds = bin2bcd(real_seconds);
+		    real_minutes = bin2bcd(real_minutes);
                 }
             RTC_WRITE (RTC_SECONDS, real_seconds);
             RTC_WRITE (RTC_MINUTES, real_minutes);
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -25,6 +25,7 @@
 #include <linux/genhd.h>
 #include <linux/rtc.h>
 #include <linux/interrupt.h>
+#include <linux/bcd.h>
 
 #include <asm/bootinfo.h>
 #include <asm/system.h>
@@ -46,9 +47,6 @@ extern void bvme6000_reset (void);
 extern void bvme6000_waitbut(void);
 void bvme6000_set_vectors (void);
 
-static unsigned char bcd2bin (unsigned char b);
-static unsigned char bin2bcd (unsigned char b);
-
 /* Save tick handler routine pointer, will point to do_timer() in
  * kernel/sched.c, called via bvme6000_process_int() */
 
@@ -264,17 +262,6 @@ unsigned long bvme6000_gettimeoffset (vo
     return v;
 }
 
-static unsigned char bcd2bin (unsigned char b)
-{
-	return ((b>>4)*10 + (b&15));
-}
-
-static unsigned char bin2bcd (unsigned char b)
-{
-	return (((b/10)*16) + (b%10));
-}
-
-
 /*
  * Looks like op is non-zero for setting the clock, and zero for
  * reading the clock.
--- a/arch/m68k/bvme6000/rtc.c
+++ b/arch/m68k/bvme6000/rtc.c
@@ -57,16 +57,16 @@ static int rtc_ioctl(struct inode *inode
 		rtc->msr = 0x40;
 		memset(&wtime, 0, sizeof(struct rtc_time));
 		do {
-			wtime.tm_sec =  BCD2BIN(rtc->bcd_sec);
-			wtime.tm_min =  BCD2BIN(rtc->bcd_min);
-			wtime.tm_hour = BCD2BIN(rtc->bcd_hr);
-			wtime.tm_mday =  BCD2BIN(rtc->bcd_dom);
-			wtime.tm_mon =  BCD2BIN(rtc->bcd_mth)-1;
-			wtime.tm_year = BCD2BIN(rtc->bcd_year);
+			wtime.tm_sec =  bcd2bin(rtc->bcd_sec);
+			wtime.tm_min =  bcd2bin(rtc->bcd_min);
+			wtime.tm_hour = bcd2bin(rtc->bcd_hr);
+			wtime.tm_mday =  bcd2bin(rtc->bcd_dom);
+			wtime.tm_mon =  bcd2bin(rtc->bcd_mth)-1;
+			wtime.tm_year = bcd2bin(rtc->bcd_year);
 			if (wtime.tm_year < 70)
 				wtime.tm_year += 100;
-			wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1;
-		} while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec));
+			wtime.tm_wday = bcd2bin(rtc->bcd_dow)-1;
+		} while (wtime.tm_sec != bcd2bin(rtc->bcd_sec));
 		rtc->msr = msr;
 		local_irq_restore(flags);
 		return copy_to_user(argp, &wtime, sizeof wtime) ?
@@ -114,14 +114,14 @@ static int rtc_ioctl(struct inode *inode
 
 		rtc->t0cr_rtmr = yrs%4;
 		rtc->bcd_tenms = 0;
-		rtc->bcd_sec   = BIN2BCD(sec);
-		rtc->bcd_min   = BIN2BCD(min);
-		rtc->bcd_hr    = BIN2BCD(hrs);
-		rtc->bcd_dom   = BIN2BCD(day);
-		rtc->bcd_mth   = BIN2BCD(mon);
-		rtc->bcd_year  = BIN2BCD(yrs%100);
+		rtc->bcd_sec   = bin2bcd(sec);
+		rtc->bcd_min   = bin2bcd(min);
+		rtc->bcd_hr    = bin2bcd(hrs);
+		rtc->bcd_dom   = bin2bcd(day);
+		rtc->bcd_mth   = bin2bcd(mon);
+		rtc->bcd_year  = bin2bcd(yrs%100);
 		if (rtc_tm.tm_wday >= 0)
-			rtc->bcd_dow = BIN2BCD(rtc_tm.tm_wday+1);
+			rtc->bcd_dow = bin2bcd(rtc_tm.tm_wday+1);
 		rtc->t0cr_rtmr = yrs%4 | 0x08;
 
 		rtc->msr = msr;
--- a/arch/m68k/mvme16x/rtc.c
+++ b/arch/m68k/mvme16x/rtc.c
@@ -52,15 +52,15 @@ static int rtc_ioctl(struct inode *inode
 		/* Ensure clock and real-time-mode-register are accessible */
 		rtc->ctrl = RTC_READ;
 		memset(&wtime, 0, sizeof(struct rtc_time));
-		wtime.tm_sec =  BCD2BIN(rtc->bcd_sec);
-		wtime.tm_min =  BCD2BIN(rtc->bcd_min);
-		wtime.tm_hour = BCD2BIN(rtc->bcd_hr);
-		wtime.tm_mday =  BCD2BIN(rtc->bcd_dom);
-		wtime.tm_mon =  BCD2BIN(rtc->bcd_mth)-1;
-		wtime.tm_year = BCD2BIN(rtc->bcd_year);
+		wtime.tm_sec =  bcd2bin(rtc->bcd_sec);
+		wtime.tm_min =  bcd2bin(rtc->bcd_min);
+		wtime.tm_hour = bcd2bin(rtc->bcd_hr);
+		wtime.tm_mday =  bcd2bin(rtc->bcd_dom);
+		wtime.tm_mon =  bcd2bin(rtc->bcd_mth)-1;
+		wtime.tm_year = bcd2bin(rtc->bcd_year);
 		if (wtime.tm_year < 70)
 			wtime.tm_year += 100;
-		wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1;
+		wtime.tm_wday = bcd2bin(rtc->bcd_dow)-1;
 		rtc->ctrl = 0;
 		local_irq_restore(flags);
 		return copy_to_user(argp, &wtime, sizeof wtime) ?
@@ -104,12 +104,12 @@ static int rtc_ioctl(struct inode *inode
 		local_irq_save(flags);
 		rtc->ctrl     = RTC_WRITE;
 
-		rtc->bcd_sec  = BIN2BCD(sec);
-		rtc->bcd_min  = BIN2BCD(min);
-		rtc->bcd_hr   = BIN2BCD(hrs);
-		rtc->bcd_dom  = BIN2BCD(day);
-		rtc->bcd_mth  = BIN2BCD(mon);
-		rtc->bcd_year = BIN2BCD(yrs%100);
+		rtc->bcd_sec  = bin2bcd(sec);
+		rtc->bcd_min  = bin2bcd(min);
+		rtc->bcd_hr   = bin2bcd(hrs);
+		rtc->bcd_dom  = bin2bcd(day);
+		rtc->bcd_mth  = bin2bcd(mon);
+		rtc->bcd_year = bin2bcd(yrs%100);
 
 		rtc->ctrl     = 0;
 		local_irq_restore(flags);
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -23,6 +23,7 @@
 #include <linux/serial_reg.h>
 #include <linux/rtc.h>
 #include <linux/vt_kern.h>
+#include <linux/bcd.h>
 
 #include <asm/io.h>
 #include <asm/rtc.h>
@@ -216,17 +217,6 @@ int q40_parse_bootinfo(const struct bi_r
 }
 
 
-static inline unsigned char bcd2bin(unsigned char b)
-{
-	return (b >> 4) * 10 + (b & 15);
-}
-
-static inline unsigned char bin2bcd(unsigned char b)
-{
-	return (b / 10) * 16 + (b % 10);
-}
-
-
 static unsigned long q40_gettimeoffset(void)
 {
 	return 5000 * (ql_ticks != 0);
--- a/arch/m68k/sun3x/time.c
+++ b/arch/m68k/sun3x/time.c
@@ -47,23 +47,23 @@ int sun3x_hwclk(int set, struct rtc_time
 
 	if(set) {
 		h->csr |= C_WRITE;
-		h->sec = BIN2BCD(t->tm_sec);
-		h->min = BIN2BCD(t->tm_min);
-		h->hour = BIN2BCD(t->tm_hour);
-		h->wday = BIN2BCD(t->tm_wday);
-		h->mday = BIN2BCD(t->tm_mday);
-		h->month = BIN2BCD(t->tm_mon);
-		h->year = BIN2BCD(t->tm_year);
+		h->sec = bin2bcd(t->tm_sec);
+		h->min = bin2bcd(t->tm_min);
+		h->hour = bin2bcd(t->tm_hour);
+		h->wday = bin2bcd(t->tm_wday);
+		h->mday = bin2bcd(t->tm_mday);
+		h->month = bin2bcd(t->tm_mon);
+		h->year = bin2bcd(t->tm_year);
 		h->csr &= ~C_WRITE;
 	} else {
 		h->csr |= C_READ;
-		t->tm_sec = BCD2BIN(h->sec);
-		t->tm_min = BCD2BIN(h->min);
-		t->tm_hour = BCD2BIN(h->hour);
-		t->tm_wday = BCD2BIN(h->wday);
-		t->tm_mday = BCD2BIN(h->mday);
-		t->tm_mon = BCD2BIN(h->month);
-		t->tm_year = BCD2BIN(h->year);
+		t->tm_sec = bcd2bin(h->sec);
+		t->tm_min = bcd2bin(h->min);
+		t->tm_hour = bcd2bin(h->hour);
+		t->tm_wday = bcd2bin(h->wday);
+		t->tm_mday = bcd2bin(h->mday);
+		t->tm_mon = bcd2bin(h->month);
+		t->tm_year = bcd2bin(h->year);
 		h->csr &= ~C_READ;
 	}
 

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 02/18] m68k: Use new printk() extension %pS to print symbols
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 01/18] m68k: use bcd2bin/bin2bcd Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 03/18] m68k: Put .bss at the end of the data section Geert Uytterhoeven
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: m68k-use-percent-pS-infrastructure.diff --]
[-- Type: text/plain, Size: 1514 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

This changes the oops and backtrace code to use the new `%pS' printk()
extension to print out symbols rather than manually calling print_symbol.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/kernel/traps.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -883,8 +883,7 @@ void show_trace(unsigned long *stack)
 			if (i % 5 == 0)
 				printk("\n       ");
 #endif
-			printk(" [<%08lx>]", addr);
-			print_symbol(" %s\n", addr);
+			printk(" [<%08lx>] %pS\n", addr, (void *)addr);
 			i++;
 		}
 	}
@@ -900,10 +899,8 @@ void show_registers(struct pt_regs *regs
 	int i;
 
 	print_modules();
-	printk("PC: [<%08lx>]",regs->pc);
-	print_symbol(" %s", regs->pc);
-	printk("\nSR: %04x  SP: %p  a2: %08lx\n",
-	       regs->sr, regs, regs->a2);
+	printk("PC: [<%08lx>] %pS\n", regs->pc, (void *)regs->pc);
+	printk("SR: %04x  SP: %p  a2: %08lx\n", regs->sr, regs, regs->a2);
 	printk("d0: %08lx    d1: %08lx    d2: %08lx    d3: %08lx\n",
 	       regs->d0, regs->d1, regs->d2, regs->d3);
 	printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 03/18] m68k: Put .bss at the end of the data section
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 01/18] m68k: use bcd2bin/bin2bcd Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 02/18] m68k: Use new printk() extension %pS to print symbols Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 04/18] m68k: Add NOTES to init data so its discarded at boot Geert Uytterhoeven
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Roman Zippel

[-- Attachment #1: m68k-put-bss-at-end-of-data-section.diff --]
[-- Type: text/plain, Size: 1157 bytes --]

From: Roman Zippel <zippel@linux-m68k.org>

Put .bss at the end of the data section

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/kernel/vmlinux-std.lds |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -34,10 +34,10 @@ SECTIONS
 	CONSTRUCTORS
 	}
 
-  .bss : { *(.bss) }		/* BSS */
-
   . = ALIGN(16);
-  .data.cacheline_aligned : { *(.data.cacheline_aligned) } :data
+  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+
+  .bss : { *(.bss) }		/* BSS */
 
   _edata = .;			/* End of data section */
 
@@ -48,7 +48,7 @@ SECTIONS
 	_sinittext = .;
 	INIT_TEXT
 	_einittext = .;
-  }
+  } :data
   .init.data : { INIT_DATA }
   . = ALIGN(16);
   __setup_start = .;

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 04/18] m68k: Add NOTES to init data so its discarded at boot
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2008-10-13 19:58 ` [patch 03/18] m68k: Put .bss at the end of the data section Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 05/18] m68k: Reverse platform MMU logic so Sun 3 is last Geert Uytterhoeven
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Roman Zippel

[-- Attachment #1: m68k-add-notes-to-init-data.diff --]
[-- Type: text/plain, Size: 863 bytes --]

From: Roman Zippel <zippel@linux-m68k.org>

Add .note.gnu.build-id to init data so it's discarded at boot.

[Andreas Schwab] Use NOTES macro

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/kernel/vmlinux-std.lds |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -74,6 +74,7 @@ SECTIONS
   .init.ramfs : { *(.init.ramfs) }
   __initramfs_end = .;
 #endif
+  NOTES
   . = ALIGN(8192);
   __init_end = .;
 

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 05/18] m68k: Reverse platform MMU logic so Sun 3 is last
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2008-10-13 19:58 ` [patch 04/18] m68k: Add NOTES to init data so its discarded at boot Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 06/18] m68k: Disable Amiga serial console support if modular Geert Uytterhoeven
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: m68k-reverse-platform-mmu-logic-so-sun3-is-last.diff --]
[-- Type: text/plain, Size: 4455 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

Currently Sun 3 support is the first platform option, as the Sun 3 MMU is
incompatible with standard Motorola MMUs. However, this means that
`allmodconfig' enables support for Sun 3, and thus disables support for all
other platforms.

Reverse the logic and move Sun 3 last, so `allmodconfig' enables all
platforms except for Sun 3, increasing compile-coverage.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/Kconfig |   43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -105,21 +105,9 @@ config PCMCIA
 	  To compile this driver as modules, choose M here: the
 	  modules will be called pcmcia_core and ds.
 
-config SUN3
-	bool "Sun3 support"
-	select M68020
-	select MMU_SUN3 if MMU
-	help
-	  This option enables support for the Sun 3 series of workstations
-	  (3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
-	  that all other hardware types must be disabled, as Sun 3 kernels
-	  are incompatible with all other m68k targets (including Sun 3x!).
-
-	  If you don't want to compile a kernel exclusively for a Sun 3, say N.
-
 config AMIGA
 	bool "Amiga support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	help
 	  This option enables support for the Amiga series of computers. If
 	  you plan to use this kernel on an Amiga, say Y here and browse the
@@ -127,7 +115,7 @@ config AMIGA
 
 config ATARI
 	bool "Atari support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	help
 	  This option enables support for the 68000-based Atari series of
 	  computers (including the TT, Falcon and Medusa). If you plan to use
@@ -153,7 +141,7 @@ config PCI
 
 config MAC
 	bool "Macintosh support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	help
 	  This option enables support for the Apple Macintosh series of
 	  computers (yes, there is experimental support now, at least for part
@@ -174,14 +162,14 @@ config M68K_L2_CACHE
 
 config APOLLO
 	bool "Apollo support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	help
 	  Say Y here if you want to run Linux on an MC680x0-based Apollo
 	  Domain workstation such as the DN3500.
 
 config VME
 	bool "VME (Motorola and BVM) support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	help
 	  Say Y here if you want to build a kernel for a 680x0 based VME
 	  board.  Boards currently supported include Motorola boards MVME147,
@@ -218,7 +206,7 @@ config BVME6000
 
 config HP300
 	bool "HP9000/300 and HP9000/400 support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	help
 	  This option enables support for the HP9000/300 and HP9000/400 series
 	  of workstations. Support for these machines is still somewhat
@@ -237,7 +225,7 @@ config DIO
 
 config SUN3X
 	bool "Sun3x support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	select M68030
 	help
 	  This option enables support for the Sun 3x series of workstations.
@@ -250,7 +238,7 @@ config SUN3X
 
 config Q40
 	bool "Q40/Q60 support"
-	depends on !MMU_SUN3
+	select MMU_MOTOROLA if MMU
 	help
 	  The Q40 is a Motorola 68040-based successor to the Sinclair QL
 	  manufactured in Germany.  There is an official Q40 home page at
@@ -258,6 +246,19 @@ config Q40
 	  Q60. Select your CPU below.  For 68LC060 don't forget to enable FPU
 	  emulation.
 
+config SUN3
+	bool "Sun3 support"
+	depends on !MMU_MOTOROLA
+	select MMU_SUN3 if MMU
+	select M68020
+	help
+	  This option enables support for the Sun 3 series of workstations
+	  (3/50, 3/60, 3/1xx, 3/2xx systems). Enabling this option requires
+	  that all other hardware types must be disabled, as Sun 3 kernels
+	  are incompatible with all other m68k targets (including Sun 3x!).
+
+	  If you don't want to compile a kernel exclusively for a Sun 3, say N.
+
 comment "Processor type"
 
 config M68020
@@ -295,10 +296,10 @@ config M68060
 config MMU_MOTOROLA
 	bool
 	depends on MMU && !MMU_SUN3
-	default y
 
 config MMU_SUN3
 	bool
+	depends on MMU && !MMU_MOTOROLA
 
 config M68KFPU_EMU
 	bool "Math emulation support (EXPERIMENTAL)"

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 06/18] m68k: Disable Amiga serial console support if modular
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2008-10-13 19:58 ` [patch 05/18] m68k: Reverse platform MMU logic so Sun 3 is last Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 21:08   ` Paul Bolle
  2008-10-14 17:20   ` Linus Torvalds
  2008-10-13 19:58 ` [patch 07/18] m68k: Modular Amiga keyboard needs key_maps Geert Uytterhoeven
                   ` (11 subsequent siblings)
  17 siblings, 2 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: amiga-amiserial-no-serial-console-if-modular.diff --]
[-- Type: text/plain, Size: 1780 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

If CONFIG_AMIGA_BUILTIN_SERIAL=m, I get the following warnings:

| drivers/char/amiserial.c: At top level:
| drivers/char/amiserial.c:2138: warning: data definition has no type or storage class
| drivers/char/amiserial.c:2138: warning: type defaults to 'int' in declaration of 'console_initcall'
| drivers/char/amiserial.c:2138: warning: parameter names (without types) in function declaration
| drivers/char/amiserial.c:2134: warning: 'amiserial_console_init' defined but not used

Apparently console_initcall() is not defined in the modular case.

Disable serial console support if the driver is modular.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Any better alternative fix?

 drivers/char/amiserial.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -2071,12 +2071,13 @@ module_init(rs_init)
 module_exit(rs_exit)
 
 
+#if defined(CONFIG_SERIAL_CONSOLE) && !defined(MODULE)
+
 /*
  * ------------------------------------------------------------
  * Serial console driver
  * ------------------------------------------------------------
  */
-#ifdef CONFIG_SERIAL_CONSOLE
 
 static void amiga_serial_putc(char c)
 {
@@ -2130,6 +2131,7 @@ static int __init amiserial_console_init
 	return 0;
 }
 console_initcall(amiserial_console_init);
-#endif
+
+#endif /* CONFIG_SERIAL_CONSOLE && !MODULE */
 
 MODULE_LICENSE("GPL");

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 07/18] m68k: Modular Amiga keyboard needs key_maps
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (5 preceding siblings ...)
  2008-10-13 19:58 ` [patch 06/18] m68k: Disable Amiga serial console support if modular Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 08/18] m68k: Remove unused atari_kbd_translate() Geert Uytterhoeven
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: amiga-export-key_maps.diff --]
[-- Type: text/plain, Size: 1198 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

| ERROR: "key_maps" [drivers/input/keyboard/amikbd.ko] undefined!

Export key_maps in the Amiga core code, as its defined in an autogenerated
file (drivers/char/defkeymap.c)

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/amiga/config.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -24,6 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/zorro.h>
 #include <linux/module.h>
+#include <linux/keyboard.h>
 
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -984,3 +985,11 @@ static int amiga_get_hardware_list(char 
 
 	return len;
 }
+
+/*
+ * The Amiga keyboard driver needs key_maps, but we cannot export it in
+ * drivers/char/defkeymap.c, as it is autogenerated
+ */
+#ifdef CONFIG_HW_CONSOLE
+EXPORT_SYMBOL_GPL(key_maps);
+#endif

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 08/18] m68k: Remove unused atari_kbd_translate()
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (6 preceding siblings ...)
  2008-10-13 19:58 ` [patch 07/18] m68k: Modular Amiga keyboard needs key_maps Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 09/18] m68k: Define rtc_lock on Atari Geert Uytterhoeven
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Michael Schmitz

[-- Attachment #1: atari-kill-unused-atari_kbd_translate.diff --]
[-- Type: text/plain, Size: 1197 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

If CONFIG_VT=n, I get:

| arch/m68k/atari/built-in.o: In function `atari_kbd_translate':
| arch/m68k/atari/atakeyb.c:640: undefined reference to `shift_state'

Just remove atari_kbd_translate(), as it's unused.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Michael Schmitz <schmitz@debian.org>
---
 arch/m68k/atari/atakeyb.c |   12 ------------
 1 file changed, 12 deletions(-)

--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -635,15 +635,3 @@ int atari_keyb_init(void)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(atari_keyb_init);
-
-int atari_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
-{
-#ifdef CONFIG_MAGIC_SYSRQ
-	/* ALT+HELP pressed? */
-	if ((keycode == 98) && ((shift_state & 0xff) == 8))
-		*keycodep = 0xff;
-	else
-#endif
-		*keycodep = keycode;
-	return 1;
-}

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 09/18] m68k: Define rtc_lock on Atari
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (7 preceding siblings ...)
  2008-10-13 19:58 ` [patch 08/18] m68k: Remove unused atari_kbd_translate() Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 10/18] m68k: Add missing dma_sync_single_range_for_{cpu,device}() Geert Uytterhoeven
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Michael Schmitz

[-- Attachment #1: atari-define-rtc_lock.diff --]
[-- Type: text/plain, Size: 1203 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

The nvram and rtc-cmos drivers use the spinlock rtc_lock to protect against
concurrent accesses to the CMOS memory. As m68k doesn't support SMP or preempt
yet, the spinlock calls tend to get optimized away, but not for all
configurations, causing in some rare cases:

| ERROR: "rtc_lock" [drivers/rtc/rtc-cmos.ko] undefined!
| ERROR: "rtc_lock" [drivers/char/nvram.ko] undefined!

Add the spinlock to the Atari core code to avoid this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Michael Schmitz <schmitz@debian.org>
---
 arch/m68k/atari/time.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -20,6 +20,9 @@
 
 #include <asm/atariints.h>
 
+DEFINE_SPINLOCK(rtc_lock);
+EXPORT_SYMBOL_GPL(rtc_lock);
+
 void __init
 atari_sched_init(irq_handler_t timer_routine)
 {

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 10/18] m68k: Add missing dma_sync_single_range_for_{cpu,device}()
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (8 preceding siblings ...)
  2008-10-13 19:58 ` [patch 09/18] m68k: Define rtc_lock on Atari Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 11/18] m68k: <asm/pci.h> needs <asm-generic/pci-dma-compat.h> Geert Uytterhoeven
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: m68k-add-dma_sync_single_range_for_cpu-device.diff --]
[-- Type: text/plain, Size: 2648 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

| include/linux/ssb/ssb.h: In function 'ssb_dma_sync_single_range_for_cpu':
| include/linux/ssb/ssb.h:517: error: implicit declaration of function 'dma_sync_single_range_for_cpu'
| include/linux/ssb/ssb.h: In function 'ssb_dma_sync_single_range_for_device':
| include/linux/ssb/ssb.h:538: error: implicit declaration of function 'dma_sync_single_range_for_device'

Add the missing dma_sync_single_range_for_{cpu,device}(), and remove the
`inline' for the non-static function dma_sync_single_for_device().

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/kernel/dma.c         |    4 ++--
 include/asm-m68k/dma-mapping.h |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

--- a/arch/m68k/kernel/dma.c
+++ b/arch/m68k/kernel/dma.c
@@ -66,8 +66,8 @@ void dma_free_coherent(struct device *de
 }
 EXPORT_SYMBOL(dma_free_coherent);
 
-inline void dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
-				       enum dma_data_direction dir)
+void dma_sync_single_for_device(struct device *dev, dma_addr_t handle,
+				size_t size, enum dma_data_direction dir)
 {
 	switch (dir) {
 	case DMA_TO_DEVICE:
--- a/include/asm-m68k/dma-mapping.h
+++ b/include/asm-m68k/dma-mapping.h
@@ -74,6 +74,14 @@ extern void dma_sync_single_for_device(s
 extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
 				   enum dma_data_direction);
 
+static inline void dma_sync_single_range_for_device(struct device *dev,
+		dma_addr_t dma_handle, unsigned long offset, size_t size,
+		enum dma_data_direction direction)
+{
+	/* just sync everything for now */
+	dma_sync_single_for_device(dev, dma_handle, offset + size, direction);
+}
+
 static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
 					   size_t size, enum dma_data_direction dir)
 {
@@ -84,6 +92,14 @@ static inline void dma_sync_sg_for_cpu(s
 {
 }
 
+static inline void dma_sync_single_range_for_cpu(struct device *dev,
+		dma_addr_t dma_handle, unsigned long offset, size_t size,
+		enum dma_data_direction direction)
+{
+	/* just sync everything for now */
+	dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction);
+}
+
 static inline int dma_mapping_error(struct device *dev, dma_addr_t handle)
 {
 	return 0;

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 11/18] m68k: <asm/pci.h> needs <asm-generic/pci-dma-compat.h>
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (9 preceding siblings ...)
  2008-10-13 19:58 ` [patch 10/18] m68k: Add missing dma_sync_single_range_for_{cpu,device}() Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 12/18] HP input: kill warnings due to suseconds_t differences Geert Uytterhoeven
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: m68k-asm-pci-h-needs-asm-generic-pci-dma-compat.h.diff --]
[-- Type: text/plain, Size: 2797 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

Several multi-bus subsystems:

| include/linux/ssb/ssb.h: In function 'ssb_dma_mapping_error':
| include/linux/ssb/ssb.h:430: error: implicit declaration of function 'pci_dma_mapping_error'
| include/linux/ssb/ssb.h: In function 'ssb_dma_map_single':
| include/linux/ssb/ssb.h:444: error: implicit declaration of function 'pci_map_single'
| include/linux/ssb/ssb.h: In function 'ssb_dma_unmap_single':
| include/linux/ssb/ssb.h:458: error: implicit declaration of function 'pci_unmap_single'
| include/linux/ssb/ssb.h: In function 'ssb_dma_sync_single_for_cpu':
| include/linux/ssb/ssb.h:475: error: implicit declaration of function 'pci_dma_sync_single_for_cpu'
| include/linux/ssb/ssb.h: In function 'ssb_dma_sync_single_for_device':
| include/linux/ssb/ssb.h:493: error: implicit declaration of function 'pci_dma_sync_single_for_device'

or legacy drivers:

| drivers/net/hp100.c: In function 'pdl_map_data':
| drivers/net/hp100.c:291: error: implicit declaration of function 'pci_map_single'
| drivers/net/hp100.c: In function 'hp100_probe1':
| drivers/net/hp100.c:707: error: implicit declaration of function 'pci_alloc_consistent'
| drivers/net/hp100.c:782: error: implicit declaration of function 'pci_free_consistent'
| drivers/net/hp100.c: In function 'hp100_clean_txring':
| drivers/net/hp100.c:1614: error: implicit declaration of function 'pci_unmap_single'

and

| drivers/scsi/aic7xxx_old.c: In function 'aic7xxx_allocate_scb':
| drivers/scsi/aic7xxx_old.c:2573: error: implicit declaration of function 'pci_alloc_consistent'
| drivers/scsi/aic7xxx_old.c: In function 'aic7xxx_done':
| drivers/scsi/aic7xxx_old.c:2697: error: implicit declaration of function 'pci_unmap_single'
| drivers/scsi/aic7xxx_old.c: In function 'aic7xxx_handle_seqint':
| drivers/scsi/aic7xxx_old.c:4275: error: implicit declaration of function 'pci_map_single'
| drivers/scsi/aic7xxx_old.c: In function 'aic7xxx_free':
| drivers/scsi/aic7xxx_old.c:8460: error: implicit declaration of function 'pci_free_consistent'

rely on PCI DMA operations to be always available.

Add #include <asm-generic/pci-dma-compat.h> to <asm/pci.h> to make them happy.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 include/asm-m68k/pci.h |    1 +
 1 file changed, 1 insertion(+)

--- a/include/asm-m68k/pci.h
+++ b/include/asm-m68k/pci.h
@@ -8,6 +8,7 @@
  */
 
 #include <asm/scatterlist.h>
+#include <asm-generic/pci-dma-compat.h>
 
 struct pci_ops;
 

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 12/18] HP input: kill warnings due to suseconds_t differences
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (10 preceding siblings ...)
  2008-10-13 19:58 ` [patch 11/18] m68k: <asm/pci.h> needs <asm-generic/pci-dma-compat.h> Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:58 ` [patch 13/18] m68k: Remove the broken Hades support Geert Uytterhoeven
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Helge Deller

[-- Attachment #1: m68k+parisc-hp_sdc_rtc-printf-format-warnings.diff --]
[-- Type: text/plain, Size: 2586 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

Kill compiler warnings related to printf() formats in the input drivers for
various HP9000 machines, which are shared between PA-RISC (suseconds_t is int)
and m68k (suseconds_t is long). As both are 32-bit, it's safe to cast to int.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Helge Deller <deller@gmx.de>
---
 drivers/input/misc/hp_sdc_rtc.c |   10 +++++-----
 drivers/input/serio/hp_sdc.c    |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -458,35 +458,35 @@ static int hp_sdc_rtc_proc_output (char 
 		p += sprintf(p, "i8042 rtc\t: READ FAILED!\n");
 	} else {
 		p += sprintf(p, "i8042 rtc\t: %ld.%02d seconds\n", 
-			     tv.tv_sec, tv.tv_usec/1000);
+			     tv.tv_sec, (int)tv.tv_usec/1000);
 	}
 
 	if (hp_sdc_rtc_read_fhs(&tv)) {
 		p += sprintf(p, "handshake\t: READ FAILED!\n");
 	} else {
         	p += sprintf(p, "handshake\t: %ld.%02d seconds\n", 
-			     tv.tv_sec, tv.tv_usec/1000);
+			     tv.tv_sec, (int)tv.tv_usec/1000);
 	}
 
 	if (hp_sdc_rtc_read_mt(&tv)) {
 		p += sprintf(p, "alarm\t\t: READ FAILED!\n");
 	} else {
 		p += sprintf(p, "alarm\t\t: %ld.%02d seconds\n", 
-			     tv.tv_sec, tv.tv_usec/1000);
+			     tv.tv_sec, (int)tv.tv_usec/1000);
 	}
 
 	if (hp_sdc_rtc_read_dt(&tv)) {
 		p += sprintf(p, "delay\t\t: READ FAILED!\n");
 	} else {
 		p += sprintf(p, "delay\t\t: %ld.%02d seconds\n", 
-			     tv.tv_sec, tv.tv_usec/1000);
+			     tv.tv_sec, (int)tv.tv_usec/1000);
 	}
 
 	if (hp_sdc_rtc_read_ct(&tv)) {
 		p += sprintf(p, "periodic\t: READ FAILED!\n");
 	} else {
 		p += sprintf(p, "periodic\t: %ld.%02d seconds\n", 
-			     tv.tv_sec, tv.tv_usec/1000);
+			     tv.tv_sec, (int)tv.tv_usec/1000);
 	}
 
         p += sprintf(p,
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -323,7 +323,7 @@ static void hp_sdc_tasklet(unsigned long
 			 * it back to the application. and be less verbose.
 			 */
 			printk(KERN_WARNING PREFIX "read timeout (%ius)!\n",
-			       tv.tv_usec - hp_sdc.rtv.tv_usec);
+			       (int)(tv.tv_usec - hp_sdc.rtv.tv_usec));
 			curr->idx += hp_sdc.rqty;
 			hp_sdc.rqty = 0;
 			tmp = curr->seq[curr->actidx];

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 13/18] m68k: Remove the broken Hades support
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (11 preceding siblings ...)
  2008-10-13 19:58 ` [patch 12/18] HP input: kill warnings due to suseconds_t differences Geert Uytterhoeven
@ 2008-10-13 19:58 ` Geert Uytterhoeven
  2008-10-13 19:59 ` [patch 14/18] m68k: remove the dead PCI code Geert Uytterhoeven
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Adrian Bunk

[-- Attachment #1: atari-remove-the-broken-Hades-support.diff --]
[-- Type: text/plain, Size: 34632 bytes --]

From: Adrian Bunk <bunk@kernel.org>

This patch removes the Hades support that was marked as BROKEN 5 years ago.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---

 arch/m68k/Kconfig              |   13 -
 arch/m68k/atari/Makefile       |    3 
 arch/m68k/atari/ataints.c      |    6 
 arch/m68k/atari/config.c       |   37 +--
 arch/m68k/atari/hades-pci.c    |  440 --------------------------------------
 arch/m68k/kernel/bios32.c      |    6 
 arch/m68k/kernel/process.c     |    2 
 drivers/block/ataflop.c        |    4 
 drivers/scsi/Kconfig           |    8 
 drivers/scsi/atari_dma_emul.c  |  468 -----------------------------------------
 drivers/scsi/atari_scsi.c      |   27 --
 include/asm-m68k/atarihw.h     |    1 
 include/asm-m68k/entry.h       |    2 
 include/asm-m68k/virtconvert.h |    6 
 14 files changed, 23 insertions(+), 1000 deletions(-)

d9b251e93344e93aace1d7dadc235b4a4aa8c3b2 
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -122,22 +122,9 @@ config ATARI
 	  this kernel on an Atari, say Y here and browse the material
 	  available in <file:Documentation/m68k>; otherwise say N.
 
-config HADES
-	bool "Hades support"
-	depends on ATARI && BROKEN
-	help
-	  This option enables support for the Hades Atari clone. If you plan
-	  to use this kernel on a Hades, say Y here; otherwise say N.
-
 config PCI
 	bool
-	depends on HADES
-	default y
 	help
-	  Find out whether you have a PCI motherboard. PCI is the name of a
-	  bus system, i.e. the way the CPU talks to the other stuff inside
-	  your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
-	  VESA. If you have PCI, say Y, otherwise N.
 
 config MAC
 	bool "Macintosh support"
--- a/arch/m68k/atari/Makefile
+++ b/arch/m68k/atari/Makefile
@@ -5,7 +5,4 @@
 obj-y		:= config.o time.o debug.o ataints.o stdma.o \
 			atasound.o stram.o
 
-ifeq ($(CONFIG_PCI),y)
-obj-$(CONFIG_HADES)	+= hades-pci.o
-endif
 obj-$(CONFIG_ATARI_KBD_CORE)	+= atakeyb.o
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -407,10 +407,8 @@ void __init atari_init_IRQ(void)
 		 * gets overruns)
 		 */
 
-		if (!MACH_IS_HADES) {
-			vectors[VEC_INT2] = falcon_hblhandler;
-			vectors[VEC_INT4] = falcon_hblhandler;
-		}
+		vectors[VEC_INT2] = falcon_hblhandler;
+		vectors[VEC_INT4] = falcon_hblhandler;
 	}
 
 	if (ATARIHW_PRESENT(PCM_8BIT) && ATARIHW_PRESENT(MICROWIRE)) {
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -231,7 +231,7 @@ void __init config_atari(void)
 	 */
 
 	printk("Atari hardware found: ");
-	if (MACH_IS_MEDUSA || MACH_IS_HADES) {
+	if (MACH_IS_MEDUSA) {
 		/* There's no Atari video hardware on the Medusa, but all the
 		 * addresses below generate a DTACK so no bus error occurs! */
 	} else if (hwreg_present(f030_xreg)) {
@@ -269,10 +269,6 @@ void __init config_atari(void)
 		ATARIHW_SET(SCSI_DMA);
 		printk("TT_SCSI_DMA ");
 	}
-	if (!MACH_IS_HADES && hwreg_present(&st_dma.dma_hi)) {
-		ATARIHW_SET(STND_DMA);
-		printk("STND_DMA ");
-	}
 	/*
 	 * The ST-DMA address registers aren't readable
 	 * on all Medusas, so the test below may fail
@@ -294,12 +290,11 @@ void __init config_atari(void)
 		ATARIHW_SET(YM_2149);
 		printk("YM2149 ");
 	}
-	if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
-		hwreg_present(&tt_dmasnd.ctrl)) {
+	if (!MACH_IS_MEDUSA && hwreg_present(&tt_dmasnd.ctrl)) {
 		ATARIHW_SET(PCM_8BIT);
 		printk("PCM ");
 	}
-	if (!MACH_IS_HADES && hwreg_present(&falcon_codec.unused5)) {
+	if (hwreg_present(&falcon_codec.unused5)) {
 		ATARIHW_SET(CODEC);
 		printk("CODEC ");
 	}
@@ -313,7 +308,7 @@ void __init config_atari(void)
 	    (tt_scc_dma.dma_ctrl = 0x01, (tt_scc_dma.dma_ctrl & 1) == 1) &&
 	    (tt_scc_dma.dma_ctrl = 0x00, (tt_scc_dma.dma_ctrl & 1) == 0)
 #else
-	    !MACH_IS_MEDUSA && !MACH_IS_HADES
+	    !MACH_IS_MEDUSA
 #endif
 	    ) {
 		ATARIHW_SET(SCC_DMA);
@@ -327,10 +322,7 @@ void __init config_atari(void)
 		ATARIHW_SET(ST_ESCC);
 		printk("ST_ESCC ");
 	}
-	if (MACH_IS_HADES) {
-		ATARIHW_SET(VME);
-		printk("VME ");
-	} else if (hwreg_present(&tt_scu.sys_mask)) {
+	if (hwreg_present(&tt_scu.sys_mask)) {
 		ATARIHW_SET(SCU);
 		/* Assume a VME bus if there's a SCU */
 		ATARIHW_SET(VME);
@@ -340,7 +332,7 @@ void __init config_atari(void)
 		ATARIHW_SET(ANALOG_JOY);
 		printk("ANALOG_JOY ");
 	}
-	if (!MACH_IS_HADES && hwreg_present(blitter.halftone)) {
+	if (hwreg_present(blitter.halftone)) {
 		ATARIHW_SET(BLITTER);
 		printk("BLITTER ");
 	}
@@ -349,8 +341,7 @@ void __init config_atari(void)
 		printk("IDE ");
 	}
 #if 1 /* This maybe wrong */
-	if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
-	    hwreg_present(&tt_microwire.data) &&
+	if (!MACH_IS_MEDUSA && hwreg_present(&tt_microwire.data) &&
 	    hwreg_present(&tt_microwire.mask) &&
 	    (tt_microwire.mask = 0x7ff,
 	     udelay(1),
@@ -369,19 +360,18 @@ void __init config_atari(void)
 		mach_hwclk = atari_tt_hwclk;
 		mach_set_clock_mmss = atari_tt_set_clock_mmss;
 	}
-	if (!MACH_IS_HADES && hwreg_present(&mste_rtc.sec_ones)) {
+	if (hwreg_present(&mste_rtc.sec_ones)) {
 		ATARIHW_SET(MSTE_CLK);
 		printk("MSTE_CLK ");
 		mach_hwclk = atari_mste_hwclk;
 		mach_set_clock_mmss = atari_mste_set_clock_mmss;
 	}
-	if (!MACH_IS_MEDUSA && !MACH_IS_HADES &&
-	    hwreg_present(&dma_wd.fdc_speed) &&
+	if (!MACH_IS_MEDUSA && hwreg_present(&dma_wd.fdc_speed) &&
 	    hwreg_write(&dma_wd.fdc_speed, 0)) {
 		ATARIHW_SET(FDCSPEED);
 		printk("FDC_SPEED ");
 	}
-	if (!MACH_IS_HADES && !ATARIHW_PRESENT(ST_SCSI)) {
+	if (!ATARIHW_PRESENT(ST_SCSI)) {
 		ATARIHW_SET(ACSI);
 		printk("ACSI ");
 	}
@@ -449,7 +439,7 @@ void __init config_atari(void)
 	 * 0xFFxxxxxx -> 0x00xxxxxx, so that the first 16MB is accessible
 	 * in the last 16MB of the address space.
 	 */
-	tos_version = (MACH_IS_MEDUSA || MACH_IS_HADES) ?
+	tos_version = (MACH_IS_MEDUSA) ?
 			0xfff : *(unsigned short *)0xff000002;
 	atari_rtc_year_offset = (tos_version < 0x306) ? 70 : 68;
 }
@@ -511,8 +501,7 @@ static void atari_reset(void)
 	 * On the Medusa, phys. 0x4 may contain garbage because it's no
 	 * ROM.  See above for explanation why we cannot use PTOV(4).
 	 */
-	reset_addr = MACH_IS_HADES ? 0x7fe00030 :
-		     MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
+	reset_addr = MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
 		     *(unsigned long *) 0xff000004;
 
 	/* reset ACIA for switch off OverScan, if it's active */
@@ -606,8 +595,6 @@ static void atari_get_model(char *model)
 		if (MACH_IS_MEDUSA)
 			/* Medusa has TT _MCH cookie */
 			strcat(model, "Medusa");
-		else if (MACH_IS_HADES)
-			strcat(model, "Hades");
 		else
 			strcat(model, "TT");
 		break;
--- a/arch/m68k/atari/hades-pci.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * hades-pci.c - Hardware specific PCI BIOS functions the Hades Atari clone.
- *
- * Written by Wout Klaren.
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <asm/io.h>
-
-#if 0
-# define DBG_DEVS(args)		printk args
-#else
-# define DBG_DEVS(args)
-#endif
-
-#if defined(CONFIG_PCI) && defined(CONFIG_HADES)
-
-#include <linux/slab.h>
-#include <linux/mm.h>
-#include <linux/pci.h>
-
-#include <asm/atarihw.h>
-#include <asm/atariints.h>
-#include <asm/byteorder.h>
-#include <asm/pci.h>
-
-#define HADES_MEM_BASE		0x80000000
-#define HADES_MEM_SIZE		0x20000000
-#define HADES_CONFIG_BASE	0xA0000000
-#define HADES_CONFIG_SIZE	0x10000000
-#define HADES_IO_BASE		0xB0000000
-#define HADES_IO_SIZE		0x10000000
-#define HADES_VIRT_IO_SIZE	0x00010000	/* Only 64k is remapped and actually used. */
-
-#define N_SLOTS				4			/* Number of PCI slots. */
-
-static const char pci_mem_name[] = "PCI memory space";
-static const char pci_io_name[] = "PCI I/O space";
-static const char pci_config_name[] = "PCI config space";
-
-static struct resource config_space = {
-    .name = pci_config_name,
-    .start = HADES_CONFIG_BASE,
-    .end = HADES_CONFIG_BASE + HADES_CONFIG_SIZE - 1
-};
-static struct resource io_space = {
-    .name = pci_io_name,
-    .start = HADES_IO_BASE,
-    .end = HADES_IO_BASE + HADES_IO_SIZE - 1
-};
-
-static const unsigned long pci_conf_base_phys[] = {
-    0xA0080000, 0xA0040000, 0xA0020000, 0xA0010000
-};
-static unsigned long pci_conf_base_virt[N_SLOTS];
-static unsigned long pci_io_base_virt;
-
-/*
- * static void *mk_conf_addr(unsigned char bus, unsigned char device_fn,
- *			     unsigned char where)
- *
- * Calculate the address of the PCI configuration area of the given
- * device.
- *
- * BUG: boards with multiple functions are probably not correctly
- * supported.
- */
-
-static void *mk_conf_addr(struct pci_dev *dev, int where)
-{
-	int device = dev->devfn >> 3, function = dev->devfn & 7;
-	void *result;
-
-	DBG_DEVS(("mk_conf_addr(bus=%d ,device_fn=0x%x, where=0x%x, pci_addr=0x%p)\n",
-		  dev->bus->number, dev->devfn, where, pci_addr));
-
-	if (device > 3)
-	{
-		DBG_DEVS(("mk_conf_addr: device (%d) > 3, returning NULL\n", device));
-		return NULL;
-	}
-
-	if (dev->bus->number != 0)
-	{
-		DBG_DEVS(("mk_conf_addr: bus (%d) > 0, returning NULL\n", device));
-		return NULL;
-	}
-
-	result = (void *) (pci_conf_base_virt[device] | (function << 8) | (where));
-	DBG_DEVS(("mk_conf_addr: returning pci_addr 0x%lx\n", (unsigned long) result));
-	return result;
-}
-
-static int hades_read_config_byte(struct pci_dev *dev, int where, u8 *value)
-{
-	volatile unsigned char *pci_addr;
-
-	*value = 0xff;
-
-	if ((pci_addr = (unsigned char *) mk_conf_addr(dev, where)) == NULL)
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	*value = *pci_addr;
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int hades_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
-	volatile unsigned short *pci_addr;
-
-	*value = 0xffff;
-
-	if (where & 0x1)
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-
-	if ((pci_addr = (unsigned short *) mk_conf_addr(dev, where)) == NULL)
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	*value = le16_to_cpu(*pci_addr);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int hades_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
-	volatile unsigned int *pci_addr;
-	unsigned char header_type;
-	int result;
-
-	*value = 0xffffffff;
-
-	if (where & 0x3)
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-
-	if ((pci_addr = (unsigned int *) mk_conf_addr(dev, where)) == NULL)
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	*value = le32_to_cpu(*pci_addr);
-
-	/*
-	 * Check if the value is an address on the bus. If true, add the
-	 * base address of the PCI memory or PCI I/O area on the Hades.
-	 */
-
-	if ((result = hades_read_config_byte(dev, PCI_HEADER_TYPE,
-					     &header_type)) != PCIBIOS_SUCCESSFUL)
-		return result;
-
-	if (((where >= PCI_BASE_ADDRESS_0) && (where <= PCI_BASE_ADDRESS_1)) ||
-	    ((header_type != PCI_HEADER_TYPE_BRIDGE) && ((where >= PCI_BASE_ADDRESS_2) &&
-							 (where <= PCI_BASE_ADDRESS_5))))
-	{
-		if ((*value & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO)
-		{
-			/*
-			 * Base address register that contains an I/O address. If the
-			 * address is valid on the Hades (0 <= *value < HADES_VIRT_IO_SIZE),
-			 * add 'pci_io_base_virt' to the value.
-			 */
-
-			if (*value < HADES_VIRT_IO_SIZE)
-				*value += pci_io_base_virt;
-		}
-		else
-		{
-			/*
-			 * Base address register that contains an memory address. If the
-			 * address is valid on the Hades (0 <= *value < HADES_MEM_SIZE),
-			 * add HADES_MEM_BASE to the value.
-			 */
-
-			if (*value == 0)
-			{
-				/*
-				 * Base address is 0. Test if this base
-				 * address register is used.
-				 */
-
-				*pci_addr = 0xffffffff;
-				if (*pci_addr != 0)
-				{
-					*pci_addr = *value;
-					if (*value < HADES_MEM_SIZE)
-						*value += HADES_MEM_BASE;
-				}
-			}
-			else
-			{
-				if (*value < HADES_MEM_SIZE)
-					*value += HADES_MEM_BASE;
-			}
-		}
-	}
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int hades_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
-	volatile unsigned char *pci_addr;
-
-	if ((pci_addr = (unsigned char *) mk_conf_addr(dev, where)) == NULL)
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	*pci_addr = value;
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int hades_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
-	volatile unsigned short *pci_addr;
-
-	if ((pci_addr = (unsigned short *) mk_conf_addr(dev, where)) == NULL)
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	*pci_addr = cpu_to_le16(value);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int hades_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
-	volatile unsigned int *pci_addr;
-	unsigned char header_type;
-	int result;
-
-	if ((pci_addr = (unsigned int *) mk_conf_addr(dev, where)) == NULL)
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	/*
-	 * Check if the value is an address on the bus. If true, subtract the
-	 * base address of the PCI memory or PCI I/O area on the Hades.
-	 */
-
-	if ((result = hades_read_config_byte(dev, PCI_HEADER_TYPE,
-					     &header_type)) != PCIBIOS_SUCCESSFUL)
-		return result;
-
-	if (((where >= PCI_BASE_ADDRESS_0) && (where <= PCI_BASE_ADDRESS_1)) ||
-	    ((header_type != PCI_HEADER_TYPE_BRIDGE) && ((where >= PCI_BASE_ADDRESS_2) &&
-							 (where <= PCI_BASE_ADDRESS_5))))
-	{
-		if ((value & PCI_BASE_ADDRESS_SPACE) ==
-		    PCI_BASE_ADDRESS_SPACE_IO)
-		{
-			/*
-			 * I/O address. Check if the address is valid address on
-			 * the Hades (pci_io_base_virt <= value < pci_io_base_virt +
-			 * HADES_VIRT_IO_SIZE) or if the value is 0xffffffff. If not
-			 * true do not write the base address register. If it is a
-			 * valid base address subtract 'pci_io_base_virt' from the value.
-			 */
-
-			if ((value >= pci_io_base_virt) && (value < (pci_io_base_virt +
-														 HADES_VIRT_IO_SIZE)))
-				value -= pci_io_base_virt;
-			else
-			{
-				if (value != 0xffffffff)
-					return PCIBIOS_SET_FAILED;
-			}
-		}
-		else
-		{
-			/*
-			 * Memory address. Check if the address is valid address on
-			 * the Hades (HADES_MEM_BASE <= value < HADES_MEM_BASE + HADES_MEM_SIZE) or
-			 * if the value is 0xffffffff. If not true do not write
-			 * the base address register. If it is a valid base address
-			 * subtract HADES_MEM_BASE from the value.
-			 */
-
-			if ((value >= HADES_MEM_BASE) && (value < (HADES_MEM_BASE + HADES_MEM_SIZE)))
-				value -= HADES_MEM_BASE;
-			else
-			{
-				if (value != 0xffffffff)
-					return PCIBIOS_SET_FAILED;
-			}
-		}
-	}
-
-	*pci_addr = cpu_to_le32(value);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * static inline void hades_fixup(void)
- *
- * Assign IRQ numbers as used by Linux to the interrupt pins
- * of the PCI cards.
- */
-
-static void __init hades_fixup(int pci_modify)
-{
-	char irq_tab[4] = {
-		[0] = IRQ_TT_MFP_IO0,		/* Slot 0. */
-		[1] = IRQ_TT_MFP_IO1,		/* Slot 1. */
-		[2] = IRQ_TT_MFP_SCC,		/* Slot 2. */
-		[3] = IRQ_TT_MFP_SCSIDMA	/* Slot 3. */
-	};
-	struct pci_dev *dev = NULL;
-	unsigned char slot;
-
-	/*
-	 * Go through all devices, fixing up irqs as we see fit:
-	 */
-
-	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
-	{
-		if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE)
-		{
-			slot = PCI_SLOT(dev->devfn);	/* Determine slot number. */
-			dev->irq = irq_tab[slot];
-			if (pci_modify)
-				pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
-		}
-	}
-}
-
-/*
- * static void hades_conf_device(struct pci_dev *dev)
- *
- * Machine dependent Configure the given device.
- *
- * Parameters:
- *
- * dev		- the pci device.
- */
-
-static void __init hades_conf_device(struct pci_dev *dev)
-{
-	pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0);
-}
-
-static struct pci_ops hades_pci_ops = {
-	.read_byte =	hades_read_config_byte,
-	.read_word =	hades_read_config_word,
-	.read_dword =	hades_read_config_dword,
-	.write_byte =	hades_write_config_byte,
-	.write_word =	hades_write_config_word,
-	.write_dword =	hades_write_config_dword
-};
-
-/*
- * struct pci_bus_info *init_hades_pci(void)
- *
- * Machine specific initialisation:
- *
- * - Allocate and initialise a 'pci_bus_info' structure
- * - Initialise hardware
- *
- * Result: pointer to 'pci_bus_info' structure.
- */
-
-struct pci_bus_info * __init init_hades_pci(void)
-{
-	struct pci_bus_info *bus;
-	int i;
-
-	/*
-	 * Remap I/O and configuration space.
-	 */
-
-	pci_io_base_virt = (unsigned long) ioremap(HADES_IO_BASE, HADES_VIRT_IO_SIZE);
-
-	for (i = 0; i < N_SLOTS; i++)
-		pci_conf_base_virt[i] = (unsigned long) ioremap(pci_conf_base_phys[i], 0x10000);
-
-	/*
-	 * Allocate memory for bus info structure.
-	 */
-
-	bus = kzalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
-	if (unlikely(!bus))
-		goto iounmap_base_virt;
-
-	/*
-	 * Claim resources. The m68k has no separate I/O space, both
-	 * PCI memory space and PCI I/O space are in memory space. Therefore
-	 * the I/O resources are requested in memory space as well.
-	 */
-
-	if (unlikely(request_resource(&iomem_resource, &config_space) != 0))
-		goto free_bus;
-
-	if (unlikely(request_resource(&iomem_resource, &io_space) != 0))
-		goto release_config_space;
-
-	bus->mem_space.start = HADES_MEM_BASE;
-	bus->mem_space.end = HADES_MEM_BASE + HADES_MEM_SIZE - 1;
-	bus->mem_space.name = pci_mem_name;
-#if 1
-	if (unlikely(request_resource(&iomem_resource, &bus->mem_space) != 0))
-		goto release_io_space;
-#endif
-	bus->io_space.start = pci_io_base_virt;
-	bus->io_space.end = pci_io_base_virt + HADES_VIRT_IO_SIZE - 1;
-	bus->io_space.name = pci_io_name;
-#if 1
-	if (unlikely(request_resource(&ioport_resource, &bus->io_space) != 0))
-		goto release_bus_mem_space;
-#endif
-	/*
-	 * Set hardware dependent functions.
-	 */
-
-	bus->m68k_pci_ops = &hades_pci_ops;
-	bus->fixup = hades_fixup;
-	bus->conf_device = hades_conf_device;
-
-	/*
-	 * Select high to low edge for PCI interrupts.
-	 */
-
-	tt_mfp.active_edge &= ~0x27;
-
-	return bus;
-
-release_bus_mem_space:
-	release_resource(&bus->mem_space);
-release_io_space:
-	release_resource(&io_space);
-release_config_space:
-	release_resource(&config_space);
-free_bus:
-	kfree(bus);
-iounmap_base_virt:
-	iounmap((void *)pci_io_base_virt);
-
-	for (i = 0; i < N_SLOTS; i++)
-		iounmap((void *)pci_conf_base_virt[i]);
-
-	return NULL;
-}
-#endif
--- a/arch/m68k/kernel/bios32.c
+++ b/arch/m68k/kernel/bios32.c
@@ -476,10 +476,12 @@ void __init pcibios_init(void)
 	printk("Linux/m68k PCI BIOS32 revision %x.%02x\n", MAJOR_REV, MINOR_REV);
 
 	bus_info = NULL;
-#ifdef CONFIG_HADES
+
+/* Hades code was:
 	if (MACH_IS_HADES)
 		bus_info = init_hades_pci();
-#endif
+*/
+
 	if (bus_info != NULL)
 	{
 		printk("PCI: Probing PCI hardware\n");
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -78,7 +78,7 @@ unsigned long thread_saved_pc(struct tas
 static void default_idle(void)
 {
 	if (!need_resched())
-#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
+#if defined(MACH_ATARI_ONLY)
 		/* block out HSYNC on the atari (falcon) */
 		__asm__("stop #0x2200" : : : "cc");
 #else
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -1882,10 +1882,6 @@ static int __init atari_floppy_init (voi
 		/* Amiga, Mac, ... don't have Atari-compatible floppy :-) */
 		return -ENODEV;
 
-	if (MACH_IS_HADES)
-		/* Hades doesn't have Atari-compatible floppy */
-		return -ENODEV;
-
 	if (register_blkdev(FLOPPY_MAJOR,"fd"))
 		return -EBUSY;
 
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1670,14 +1670,6 @@ config ATARI_SCSI_RESET_BOOT
 	  boot process fractionally longer but may assist recovery from errors
 	  that leave the devices with SCSI operations partway completed.
 
-config TT_DMA_EMUL
-	bool "Hades SCSI DMA emulator"
-	depends on ATARI_SCSI && HADES
-	help
-	  This option enables code which emulates the TT SCSI DMA chip on the
-	  Hades. This increases the SCSI transfer rates at least ten times
-	  compared to PIO transfers.
-
 config MAC_SCSI
 	bool "Macintosh NCR5380 SCSI"
 	depends on MAC && SCSI=y
--- a/drivers/scsi/atari_dma_emul.c
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * atari_dma_emul.c -- TT SCSI DMA emulator for the Hades.
- *
- * Copyright 1997 Wout Klaren <W.Klaren@inter.nl.net>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive
- * for more details.
- *
- * This code was written using the Hades TOS source code as a
- * reference. This source code can be found on the home page
- * of Medusa Computer Systems.
- *
- * Version 0.1, 1997-09-24.
- * 
- * This code should be considered experimental. It has only been
- * tested on a Hades with a 68060. It might not work on a Hades
- * with a 68040. Make backups of your hard drives before using
- * this code.
- */
-
-#include <linux/compiler.h>
-#include <asm/thread_info.h>
-#include <asm/uaccess.h>
-
-#define hades_dma_ctrl		(*(unsigned char *) 0xffff8717)
-#define hades_psdm_reg		(*(unsigned char *) 0xffff8741)
-
-#define TRANSFER_SIZE		16
-
-struct m68040_frame {
-	unsigned long  effaddr;  /* effective address */
-	unsigned short ssw;      /* special status word */
-	unsigned short wb3s;     /* write back 3 status */
-	unsigned short wb2s;     /* write back 2 status */
-	unsigned short wb1s;     /* write back 1 status */
-	unsigned long  faddr;    /* fault address */
-	unsigned long  wb3a;     /* write back 3 address */
-	unsigned long  wb3d;     /* write back 3 data */
-	unsigned long  wb2a;     /* write back 2 address */
-	unsigned long  wb2d;     /* write back 2 data */
-	unsigned long  wb1a;     /* write back 1 address */
-	unsigned long  wb1dpd0;  /* write back 1 data/push data 0*/
-	unsigned long  pd1;      /* push data 1*/
-	unsigned long  pd2;      /* push data 2*/
-	unsigned long  pd3;      /* push data 3*/
-};
-
-static void writeback (unsigned short wbs, unsigned long wba,
-		       unsigned long wbd, void *old_buserr)
-{
-	mm_segment_t fs = get_fs();
-	static void *save_buserr;
-
-	__asm__ __volatile__ ("movec.l	%%vbr,%%a0\n\t"
-			      "move.l	%0,8(%%a0)\n\t"
-			      :
-			      : "r" (&&bus_error)
-			      : "a0" );
-
-	save_buserr = old_buserr;
-
-	set_fs (MAKE_MM_SEG(wbs & WBTM_040));
-
-	switch (wbs & WBSIZ_040) {
-	    case BA_SIZE_BYTE:
-		put_user (wbd & 0xff, (char *)wba);
-		break;
-	    case BA_SIZE_WORD:
-		put_user (wbd & 0xffff, (short *)wba);
-		break;
-	    case BA_SIZE_LONG:
-		put_user (wbd, (int *)wba);
-		break;
-	}
-
-	set_fs (fs);
-	return;
-
-bus_error:
-	__asm__ __volatile__ ("cmp.l	%0,2(%%sp)\n\t"
-			      "bcs.s	.jump_old\n\t"
-			      "cmp.l	%1,2(%%sp)\n\t"
-			      "bls.s	.restore_old\n"
-			".jump_old:\n\t"
-			      "move.l	%2,-(%%sp)\n\t"
-			      "rts\n"
-			".restore_old:\n\t"
-			      "move.l	%%a0,-(%%sp)\n\t"
-			      "movec.l	%%vbr,%%a0\n\t"
-			      "move.l	%2,8(%%a0)\n\t"
-			      "move.l	(%%sp)+,%%a0\n\t"
-			      "rte\n\t"
-			      :
-			      : "i" (writeback), "i" (&&bus_error),
-			        "m" (save_buserr) );
-}
-
-/*
- * static inline void set_restdata_reg(unsigned char *cur_addr)
- *
- * Set the rest data register if necessary.
- */
-
-static inline void set_restdata_reg(unsigned char *cur_addr)
-{
-	if (((long) cur_addr & ~3) != 0)
-		tt_scsi_dma.dma_restdata =
-			*((unsigned long *) ((long) cur_addr & ~3));
-}
-
-/*
- * void hades_dma_emulator(int irq, void *dummy)
- * 
- * This code emulates TT SCSI DMA on the Hades.
- * 
- * Note the following:
- * 
- * 1. When there is no byte available to read from the SCSI bus, or
- *    when a byte cannot yet bet written to the SCSI bus, a bus
- *    error occurs when reading or writing the pseudo DMA data
- *    register (hades_psdm_reg). We have to catch this bus error
- *    and try again to read or write the byte. If after several tries
- *    we still get a bus error, the interrupt handler is left. When
- *    the byte can be read or written, the interrupt handler is
- *    called again.
- * 
- * 2. The SCSI interrupt must be disabled in this interrupt handler.
- * 
- * 3. If we set the EOP signal, the SCSI controller still expects one
- *    byte to be read or written. Therefore the last byte is transferred
- *    separately, after setting the EOP signal.
- * 
- * 4. When this function is left, the address pointer (start_addr) is
- *    converted to a physical address. Because it points one byte
- *    further than the last transferred byte, it can point outside the
- *    current page. If virt_to_phys() is called with this address we
- *    might get an access error. Therefore virt_to_phys() is called with
- *    start_addr - 1 if the count has reached zero. The result is
- *    increased with one.
- */
-
-static irqreturn_t hades_dma_emulator(int irq, void *dummy)
-{
-	unsigned long dma_base;
-	register unsigned long dma_cnt asm ("d3");
-	static long save_buserr;
-	register unsigned long save_sp asm ("d4");
-	register int tries asm ("d5");
-	register unsigned char *start_addr asm ("a3"), *end_addr asm ("a4");
-	register unsigned char *eff_addr;
-	register unsigned char *psdm_reg;
-	unsigned long rem;
-
-	atari_disable_irq(IRQ_TT_MFP_SCSI);
-
-	/*
-	 * Read the dma address and count registers.
-	 */
-
-	dma_base = SCSI_DMA_READ_P(dma_addr);
-	dma_cnt = SCSI_DMA_READ_P(dma_cnt);
-
-	/*
-	 * Check if DMA is still enabled.
-	 */
-
-	if ((tt_scsi_dma.dma_ctrl & 2) == 0)
-	{
-		atari_enable_irq(IRQ_TT_MFP_SCSI);
-		return IRQ_HANDLED;
-	}
-
-	if (dma_cnt == 0)
-	{
-		printk(KERN_NOTICE "DMA emulation: count is zero.\n");
-		tt_scsi_dma.dma_ctrl &= 0xfd;	/* DMA ready. */
-		atari_enable_irq(IRQ_TT_MFP_SCSI);
-		return IRQ_HANDLED;
-	}
-
-	/*
-	 * Install new bus error routine.
-	 */
-
-	__asm__ __volatile__ ("movec.l	%%vbr,%%a0\n\t"
-			      "move.l	8(%%a0),%0\n\t"
-			      "move.l	%1,8(%%a0)\n\t"
-			      : "=&r" (save_buserr)
-			      : "r" (&&scsi_bus_error)
-			      : "a0" );
-
-	hades_dma_ctrl &= 0xfc;		/* Bus error and EOP off. */
-
-	/*
-	 * Save the stack pointer.
-	 */
-
-	__asm__ __volatile__ ("move.l	%%sp,%0\n\t"
-			      : "=&r" (save_sp) );
-
-	tries = 100;			/* Maximum number of bus errors. */
-	start_addr = phys_to_virt(dma_base);
-	end_addr = start_addr + dma_cnt;
-
-scsi_loop:
-	dma_cnt--;
-	rem = dma_cnt & (TRANSFER_SIZE - 1);
-	dma_cnt &= ~(TRANSFER_SIZE - 1);
-	psdm_reg = &hades_psdm_reg;
-
-	if (tt_scsi_dma.dma_ctrl & 1)	/* Read or write? */
-	{
-		/*
-		 * SCSI write. Abort when count is zero.
-		 */
-
-		switch (rem)
-		{
-		case 0:
-			while (dma_cnt > 0)
-			{
-				dma_cnt -= TRANSFER_SIZE;
-
-				*psdm_reg = *start_addr++;
-		case 15:
-				*psdm_reg = *start_addr++;
-		case 14:
-				*psdm_reg = *start_addr++;
-		case 13:
-				*psdm_reg = *start_addr++;
-		case 12:
-				*psdm_reg = *start_addr++;
-		case 11:
-				*psdm_reg = *start_addr++;
-		case 10:
-				*psdm_reg = *start_addr++;
-		case 9:
-				*psdm_reg = *start_addr++;
-		case 8:
-				*psdm_reg = *start_addr++;
-		case 7:
-				*psdm_reg = *start_addr++;
-		case 6:
-				*psdm_reg = *start_addr++;
-		case 5:
-				*psdm_reg = *start_addr++;
-		case 4:
-				*psdm_reg = *start_addr++;
-		case 3:
-				*psdm_reg = *start_addr++;
-		case 2:
-				*psdm_reg = *start_addr++;
-		case 1:
-				*psdm_reg = *start_addr++;
-			}
-		}
-
-		hades_dma_ctrl |= 1;	/* Set EOP. */
-		udelay(10);
-		*psdm_reg = *start_addr++;	/* Dummy byte. */
-		tt_scsi_dma.dma_ctrl &= 0xfd;	/* DMA ready. */
-	}
-	else
-	{
-		/*
-		 * SCSI read. Abort when count is zero.
-		 */
-
-		switch (rem)
-		{
-		case 0:
-			while (dma_cnt > 0)
-			{
-				dma_cnt -= TRANSFER_SIZE;
-
-				*start_addr++ = *psdm_reg;
-		case 15:
-				*start_addr++ = *psdm_reg;
-		case 14:
-				*start_addr++ = *psdm_reg;
-		case 13:
-				*start_addr++ = *psdm_reg;
-		case 12:
-				*start_addr++ = *psdm_reg;
-		case 11:
-				*start_addr++ = *psdm_reg;
-		case 10:
-				*start_addr++ = *psdm_reg;
-		case 9:
-				*start_addr++ = *psdm_reg;
-		case 8:
-				*start_addr++ = *psdm_reg;
-		case 7:
-				*start_addr++ = *psdm_reg;
-		case 6:
-				*start_addr++ = *psdm_reg;
-		case 5:
-				*start_addr++ = *psdm_reg;
-		case 4:
-				*start_addr++ = *psdm_reg;
-		case 3:
-				*start_addr++ = *psdm_reg;
-		case 2:
-				*start_addr++ = *psdm_reg;
-		case 1:
-				*start_addr++ = *psdm_reg;
-			}
-		}
-
-		hades_dma_ctrl |= 1;	/* Set EOP. */
-		udelay(10);
-		*start_addr++ = *psdm_reg;
-		tt_scsi_dma.dma_ctrl &= 0xfd;	/* DMA ready. */
-
-		set_restdata_reg(start_addr);
-	}
-
-	if (start_addr != end_addr)
-		printk(KERN_CRIT "DMA emulation: FATAL: Count is not zero at end of transfer.\n");
-
-	dma_cnt = end_addr - start_addr;
-
-scsi_end:
-	dma_base = (dma_cnt == 0) ? virt_to_phys(start_addr - 1) + 1 :  
-				    virt_to_phys(start_addr);
-
-	SCSI_DMA_WRITE_P(dma_addr, dma_base);
-	SCSI_DMA_WRITE_P(dma_cnt, dma_cnt);
-
-	/*
-	 * Restore old bus error routine.
-	 */
-
-	__asm__ __volatile__ ("movec.l	%%vbr,%%a0\n\t"
-			      "move.l	%0,8(%%a0)\n\t"
-			      :
-			      : "r" (save_buserr)
-			      : "a0" );
-
-	atari_enable_irq(IRQ_TT_MFP_SCSI);
-
-	return IRQ_HANDLED;
-
-scsi_bus_error:
-	/*
-	 * First check if the bus error is caused by our code.
-	 * If not, call the original handler.
-	 */
-
-	__asm__ __volatile__ ("cmp.l	%0,2(%%sp)\n\t"
-			      "bcs.s	.old_vector\n\t"
-			      "cmp.l	%1,2(%%sp)\n\t"
-			      "bls.s	.scsi_buserr\n"
-			".old_vector:\n\t"
-			      "move.l	%2,-(%%sp)\n\t"
-			      "rts\n"
-			".scsi_buserr:\n\t"
-			      :
-			      : "i" (&&scsi_loop), "i" (&&scsi_end),
-			        "m" (save_buserr) );
-
-	if (CPU_IS_060)
-	{
-		/*
-		 * Get effective address and restore the stack.
-		 */
-
-		__asm__ __volatile__ ("move.l	8(%%sp),%0\n\t"
-				      "move.l	%1,%%sp\n\t"
-				      : "=a&" (eff_addr)
-				      : "r" (save_sp) );
-	}
-	else
-	{
-		register struct m68040_frame *frame;
-
-		__asm__ __volatile__ ("lea	8(%%sp),%0\n\t"
-				      : "=a&" (frame) );
-
-		if (tt_scsi_dma.dma_ctrl & 1)
-		{
-			/*
-			 * Bus error while writing.
-			 */
-
-			if (frame->wb3s & WBV_040)
-			{
-				if (frame->wb3a == (long) &hades_psdm_reg)
-					start_addr--;
-				else
-					writeback(frame->wb3s, frame->wb3a,
-						  frame->wb3d, &&scsi_bus_error);
-			}
-
-			if (frame->wb2s & WBV_040)
-			{
-				if (frame->wb2a == (long) &hades_psdm_reg)
-					start_addr--;
-				else
-					writeback(frame->wb2s, frame->wb2a,
-						  frame->wb2d, &&scsi_bus_error);
-			}
-
-			if (frame->wb1s & WBV_040)
-			{
-				if (frame->wb1a == (long) &hades_psdm_reg)
-					start_addr--;
-			}
-		}
-		else
-		{
-			/*
-			 * Bus error while reading.
-			 */
-
-			if (frame->wb3s & WBV_040)
-				writeback(frame->wb3s, frame->wb3a,
-					  frame->wb3d, &&scsi_bus_error);
-		}
-
-		eff_addr = (unsigned char *) frame->faddr;
-
-		__asm__ __volatile__ ("move.l	%0,%%sp\n\t"
-				      :
-				      : "r" (save_sp) );
-	}
-
-	dma_cnt = end_addr - start_addr;
-
-	if (eff_addr == &hades_psdm_reg)
-	{
-		/*
-		 * Bus error occurred while reading the pseudo
-		 * DMA register. Time out.
-		 */
-
-		tries--;
-
-		if (tries <= 0)
-		{
-			if ((tt_scsi_dma.dma_ctrl & 1) == 0)	/* Read or write? */
-				set_restdata_reg(start_addr);
-
-			if (dma_cnt <= 1)
-				printk(KERN_CRIT "DMA emulation: Fatal "
-				       "error while %s the last byte.\n",
-				       (tt_scsi_dma.dma_ctrl & 1)
-				       ? "writing" : "reading");
-
-			goto scsi_end;
-		}
-		else
-			goto scsi_loop;
-	}
-	else
-	{
-		/*
-		 * Bus error during pseudo DMA transfer.
-		 * Terminate the DMA transfer.
-		 */
-
-		hades_dma_ctrl |= 3;	/* Set EOP and bus error. */
-		if ((tt_scsi_dma.dma_ctrl & 1) == 0)	/* Read or write? */
-			set_restdata_reg(start_addr);
-		goto scsi_end;
-	}
-}
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -249,10 +249,6 @@ static int setup_hostid = -1;
 module_param(setup_hostid, int, 0);
 
 
-#if defined(CONFIG_TT_DMA_EMUL)
-#include "atari_dma_emul.c"
-#endif
-
 #if defined(REAL_DMA)
 
 static int scsi_dma_is_ignored_buserr(unsigned char dma_stat)
@@ -695,21 +691,8 @@ int atari_scsi_detect(struct scsi_host_t
 #ifdef REAL_DMA
 		tt_scsi_dma.dma_ctrl = 0;
 		atari_dma_residual = 0;
-#ifdef CONFIG_TT_DMA_EMUL
-		if (MACH_IS_HADES) {
-			if (request_irq(IRQ_AUTO_2, hades_dma_emulator,
-					 IRQ_TYPE_PRIO, "Hades DMA emulator",
-					 hades_dma_emulator)) {
-				printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting (MACH_IS_HADES)",IRQ_AUTO_2);
-				free_irq(IRQ_TT_MFP_SCSI, instance);
-				scsi_unregister(atari_scsi_host);
-				atari_stram_free(atari_dma_buffer);
-				atari_dma_buffer = 0;
-				return 0;
-			}
-		}
-#endif
-		if (MACH_IS_MEDUSA || MACH_IS_HADES) {
+
+		if (MACH_IS_MEDUSA) {
 			/* While the read overruns (described by Drew Eckhardt in
 			 * NCR5380.c) never happened on TTs, they do in fact on the Medusa
 			 * (This was the cause why SCSI didn't work right for so long
@@ -1007,11 +990,7 @@ static unsigned long atari_dma_xfer_len(
 					Scsi_Cmnd *cmd, int write_flag)
 {
 	unsigned long	possible_len, limit;
-#ifndef CONFIG_TT_DMA_EMUL
-	if (MACH_IS_HADES)
-		/* Hades has no SCSI DMA at all :-( Always force use of PIO */
-		return 0;
-#endif
+
 	if (IS_A_TT())
 		/* TT SCSI DMA can transfer arbitrary #bytes */
 		return wanted_len;
--- a/include/asm-m68k/atarihw.h
+++ b/include/asm-m68k/atarihw.h
@@ -39,7 +39,6 @@ extern int atari_dont_touch_floppy_selec
 #define MACH_IS_TT	((atari_mch_cookie >> 16) == ATARI_MCH_TT)
 #define MACH_IS_FALCON	((atari_mch_cookie >> 16) == ATARI_MCH_FALCON)
 #define MACH_IS_MEDUSA	(atari_mch_type == ATARI_MACH_MEDUSA)
-#define MACH_IS_HADES	(atari_mch_type == ATARI_MACH_HADES)
 #define MACH_IS_AB40	(atari_mch_type == ATARI_MACH_AB40)
 
 /* values for atari_switches */
--- a/include/asm-m68k/entry.h
+++ b/include/asm-m68k/entry.h
@@ -31,7 +31,7 @@
  */
 
 /* the following macro is used when enabling interrupts */
-#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
+#if defined(MACH_ATARI_ONLY)
 	/* block out HSYNC on the atari */
 #define ALLOWINT	(~0x400)
 #define	MAX_NOINT_IPL	3
--- a/include/asm-m68k/virtconvert.h
+++ b/include/asm-m68k/virtconvert.h
@@ -40,15 +40,9 @@ static inline void *phys_to_virt(unsigne
 
 /*
  * IO bus memory addresses are 1:1 with the physical address,
- * except on the PCI bus of the Hades.
  */
-#ifdef CONFIG_HADES
-#define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0))
-#define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0)))
-#else
 #define virt_to_bus virt_to_phys
 #define bus_to_virt phys_to_virt
-#endif
 
 #endif
 #endif

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 14/18] m68k: remove the dead PCI code
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (12 preceding siblings ...)
  2008-10-13 19:58 ` [patch 13/18] m68k: Remove the broken Hades support Geert Uytterhoeven
@ 2008-10-13 19:59 ` Geert Uytterhoeven
  2008-10-13 19:59 ` [patch 15/18] m68k: init_irq_proc depends on CONFIG_PROC_FS Geert Uytterhoeven
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Adrian Bunk

[-- Attachment #1: m68k-remove-no-longer-used-pci-code.diff --]
[-- Type: text/plain, Size: 18787 bytes --]

From: Adrian Bunk <bunk@kernel.org>

This patch removes the no longer used m68k PCI code.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/Kconfig         |    4 
 arch/m68k/kernel/Makefile |    1 
 arch/m68k/kernel/bios32.c |  516 ----------------------------------------------
 include/asm-m68k/dma.h    |    4 
 include/asm-m68k/io.h     |   66 -----
 include/asm-m68k/pci.h    |   46 ----
 6 files changed, 7 insertions(+), 630 deletions(-)


--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -122,10 +122,6 @@ config ATARI
 	  this kernel on an Atari, say Y here and browse the material
 	  available in <file:Documentation/m68k>; otherwise say N.
 
-config PCI
-	bool
-	help
-
 config MAC
 	bool "Macintosh support"
 	select MMU_MOTOROLA if MMU
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -14,5 +14,4 @@ obj-y	:= entry.o process.o traps.o ints.
 
 devres-y = ../../../kernel/irq/devres.o
 
-obj-$(CONFIG_PCI)	+= bios32.o
 obj-y$(CONFIG_MMU_SUN3) += dma.o	# no, it's not a typo
--- a/arch/m68k/kernel/bios32.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * bios32.c - PCI BIOS functions for m68k systems.
- *
- * Written by Wout Klaren.
- *
- * Based on the DEC Alpha bios32.c by Dave Rusling and David Mosberger.
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-
-#if 0
-# define DBG_DEVS(args)		printk args
-#else
-# define DBG_DEVS(args)
-#endif
-
-#ifdef CONFIG_PCI
-
-/*
- * PCI support for Linux/m68k. Currently only the Hades is supported.
- *
- * The support for PCI bridges in the DEC Alpha version has
- * been removed in this version.
- */
-
-#include <linux/pci.h>
-#include <linux/slab.h>
-#include <linux/mm.h>
-
-#include <asm/io.h>
-#include <asm/pci.h>
-#include <asm/uaccess.h>
-
-#define KB		1024
-#define MB		(1024*KB)
-#define GB		(1024*MB)
-
-#define MAJOR_REV	0
-#define MINOR_REV	5
-
-/*
- * Align VAL to ALIGN, which must be a power of two.
- */
-
-#define ALIGN(val,align)	(((val) + ((align) - 1)) & ~((align) - 1))
-
-/*
- * Offsets relative to the I/O and memory base addresses from where resources
- * are allocated.
- */
-
-#define IO_ALLOC_OFFSET		0x00004000
-#define MEM_ALLOC_OFFSET	0x04000000
-
-/*
- * Declarations of hardware specific initialisation functions.
- */
-
-extern struct pci_bus_info *init_hades_pci(void);
-
-/*
- * Bus info structure of the PCI bus. A pointer to this structure is
- * put in the sysdata member of the pci_bus structure.
- */
-
-static struct pci_bus_info *bus_info;
-
-static int pci_modify = 1;		/* If set, layout the PCI bus ourself. */
-static int skip_vga;			/* If set do not modify base addresses
-					   of vga cards.*/
-static int disable_pci_burst;		/* If set do not allow PCI bursts. */
-
-static unsigned int io_base;
-static unsigned int mem_base;
-
-/*
- * static void disable_dev(struct pci_dev *dev)
- *
- * Disable PCI device DEV so that it does not respond to I/O or memory
- * accesses.
- *
- * Parameters:
- *
- * dev	- device to disable.
- */
-
-static void __init disable_dev(struct pci_dev *dev)
-{
-	unsigned short cmd;
-
-	if (((dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA) ||
-	     (dev->class >> 8 == PCI_CLASS_DISPLAY_VGA) ||
-	     (dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga)
-		return;
-
-	pci_read_config_word(dev, PCI_COMMAND, &cmd);
-
-	cmd &= (~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY & ~PCI_COMMAND_MASTER);
-	pci_write_config_word(dev, PCI_COMMAND, cmd);
-}
-
-/*
- * static void layout_dev(struct pci_dev *dev)
- *
- * Layout memory and I/O for a device.
- *
- * Parameters:
- *
- * device	- device to layout memory and I/O for.
- */
-
-static void __init layout_dev(struct pci_dev *dev)
-{
-	unsigned short cmd;
-	unsigned int base, mask, size, reg;
-	unsigned int alignto;
-	int i;
-
-	/*
-	 * Skip video cards if requested.
-	 */
-
-	if (((dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA) ||
-	     (dev->class >> 8 == PCI_CLASS_DISPLAY_VGA) ||
-	     (dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga)
-		return;
-
-	pci_read_config_word(dev, PCI_COMMAND, &cmd);
-
-	for (reg = PCI_BASE_ADDRESS_0, i = 0; reg <= PCI_BASE_ADDRESS_5; reg += 4, i++)
-	{
-		/*
-		 * Figure out how much space and of what type this
-		 * device wants.
-		 */
-
-		pci_write_config_dword(dev, reg, 0xffffffff);
-		pci_read_config_dword(dev, reg, &base);
-
-		if (!base)
-		{
-			/* this base-address register is unused */
-			dev->resource[i].start = 0;
-			dev->resource[i].end = 0;
-			dev->resource[i].flags = 0;
-			continue;
-		}
-
-		/*
-		 * We've read the base address register back after
-		 * writing all ones and so now we must decode it.
-		 */
-
-		if (base & PCI_BASE_ADDRESS_SPACE_IO)
-		{
-			/*
-			 * I/O space base address register.
-			 */
-
-			cmd |= PCI_COMMAND_IO;
-
-			base &= PCI_BASE_ADDRESS_IO_MASK;
-			mask = (~base << 1) | 0x1;
-			size = (mask & base) & 0xffffffff;
-
-			/*
-			 * Align to multiple of size of minimum base.
-			 */
-
-			alignto = max_t(unsigned int, 0x040, size);
-			base = ALIGN(io_base, alignto);
-			io_base = base + size;
-			pci_write_config_dword(dev, reg, base | PCI_BASE_ADDRESS_SPACE_IO);
-
-			dev->resource[i].start = base;
-			dev->resource[i].end = dev->resource[i].start + size - 1;
-			dev->resource[i].flags = IORESOURCE_IO | PCI_BASE_ADDRESS_SPACE_IO;
-
-			DBG_DEVS(("layout_dev: IO address: %lX\n", base));
-		}
-		else
-		{
-			unsigned int type;
-
-			/*
-			 * Memory space base address register.
-			 */
-
-			cmd |= PCI_COMMAND_MEMORY;
-			type = base & PCI_BASE_ADDRESS_MEM_TYPE_MASK;
-			base &= PCI_BASE_ADDRESS_MEM_MASK;
-			mask = (~base << 1) | 0x1;
-			size = (mask & base) & 0xffffffff;
-			switch (type)
-			{
-			case PCI_BASE_ADDRESS_MEM_TYPE_32:
-			case PCI_BASE_ADDRESS_MEM_TYPE_64:
-				break;
-
-			case PCI_BASE_ADDRESS_MEM_TYPE_1M:
-				printk("bios32 WARNING: slot %d, function %d "
-				       "requests memory below 1MB---don't "
-				       "know how to do that.\n",
-				       PCI_SLOT(dev->devfn),
-				       PCI_FUNC(dev->devfn));
-				continue;
-			}
-
-			/*
-			 * Align to multiple of size of minimum base.
-			 */
-
-			alignto = max_t(unsigned int, 0x1000, size);
-			base = ALIGN(mem_base, alignto);
-			mem_base = base + size;
-			pci_write_config_dword(dev, reg, base);
-
-			dev->resource[i].start = base;
-			dev->resource[i].end = dev->resource[i].start + size - 1;
-			dev->resource[i].flags = IORESOURCE_MEM;
-
-			if (type == PCI_BASE_ADDRESS_MEM_TYPE_64)
-			{
-				/*
-				 * 64-bit address, set the highest 32 bits
-				 * to zero.
-				 */
-
-				reg += 4;
-				pci_write_config_dword(dev, reg, 0);
-
-				i++;
-				dev->resource[i].start = 0;
-				dev->resource[i].end = 0;
-				dev->resource[i].flags = 0;
-			}
-		}
-	}
-
-	/*
-	 * Enable device:
-	 */
-
-	if (dev->class >> 8 == PCI_CLASS_NOT_DEFINED ||
-	    dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA ||
-	    dev->class >> 8 == PCI_CLASS_DISPLAY_VGA ||
-	    dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)
-	{
-		/*
-		 * All of these (may) have I/O scattered all around
-		 * and may not use i/o-base address registers at all.
-		 * So we just have to always enable I/O to these
-		 * devices.
-		 */
-		cmd |= PCI_COMMAND_IO;
-	}
-
-	pci_write_config_word(dev, PCI_COMMAND, cmd | PCI_COMMAND_MASTER);
-
-	pci_write_config_byte(dev, PCI_LATENCY_TIMER, (disable_pci_burst) ? 0 : 32);
-
-	if (bus_info != NULL)
-		bus_info->conf_device(dev);	/* Machine dependent configuration. */
-
-	DBG_DEVS(("layout_dev: bus %d  slot 0x%x  VID 0x%x  DID 0x%x  class 0x%x\n",
-		  dev->bus->number, PCI_SLOT(dev->devfn), dev->vendor, dev->device, dev->class));
-}
-
-/*
- * static void layout_bus(struct pci_bus *bus)
- *
- * Layout memory and I/O for all devices on the given bus.
- *
- * Parameters:
- *
- * bus	- bus.
- */
-
-static void __init layout_bus(struct pci_bus *bus)
-{
-	unsigned int bio, bmem;
-	struct pci_dev *dev;
-
-	DBG_DEVS(("layout_bus: starting bus %d\n", bus->number));
-
-	if (!bus->devices && !bus->children)
-		return;
-
-	/*
-	 * Align the current bases on appropriate boundaries (4K for
-	 * IO and 1MB for memory).
-	 */
-
-	bio = io_base = ALIGN(io_base, 4*KB);
-	bmem = mem_base = ALIGN(mem_base, 1*MB);
-
-	/*
-	 * PCI devices might have been setup by a PCI BIOS emulation
-	 * running under TOS. In these cases there is a
-	 * window during which two devices may have an overlapping
-	 * address range. To avoid this causing trouble, we first
-	 * turn off the I/O and memory address decoders for all PCI
-	 * devices.  They'll be re-enabled only once all address
-	 * decoders are programmed consistently.
-	 */
-
-	DBG_DEVS(("layout_bus: disable_dev for bus %d\n", bus->number));
-
-	for (dev = bus->devices; dev; dev = dev->sibling)
-	{
-		if ((dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) ||
-		    (dev->class >> 8 == PCI_CLASS_BRIDGE_PCMCIA))
-			disable_dev(dev);
-	}
-
-	/*
-	 * Allocate space to each device:
-	 */
-
-	DBG_DEVS(("layout_bus: starting bus %d devices\n", bus->number));
-
-	for (dev = bus->devices; dev; dev = dev->sibling)
-	{
-		if ((dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) ||
-		    (dev->class >> 8 == PCI_CLASS_BRIDGE_PCMCIA))
-			layout_dev(dev);
-	}
-
-	DBG_DEVS(("layout_bus: bus %d finished\n", bus->number));
-}
-
-/*
- * static void pcibios_fixup(void)
- *
- * Layout memory and I/O of all devices on the PCI bus if 'pci_modify' is
- * true. This might be necessary because not every m68k machine with a PCI
- * bus has a PCI BIOS. This function should be called right after
- * pci_scan_bus() in pcibios_init().
- */
-
-static void __init pcibios_fixup(void)
-{
-	if (pci_modify)
-	{
-		/*
-		 * Set base addresses for allocation of I/O and memory space.
-		 */
-
-		io_base = bus_info->io_space.start + IO_ALLOC_OFFSET;
-		mem_base = bus_info->mem_space.start + MEM_ALLOC_OFFSET;
-
-		/*
-		 * Scan the tree, allocating PCI memory and I/O space.
-		 */
-
-		layout_bus(pci_bus_b(pci_root.next));
-	}
-
-	/*
-	 * Fix interrupt assignments, etc.
-	 */
-
-	bus_info->fixup(pci_modify);
-}
-
-/*
- * static void pcibios_claim_resources(struct pci_bus *bus)
- *
- * Claim all resources that are assigned to devices on the given bus.
- *
- * Parameters:
- *
- * bus	- bus.
- */
-
-static void __init pcibios_claim_resources(struct pci_bus *bus)
-{
-	struct pci_dev *dev;
-	int i;
-
-	while (bus)
-	{
-		for (dev = bus->devices; (dev != NULL); dev = dev->sibling)
-		{
-			for (i = 0; i < PCI_NUM_RESOURCES; i++)
-			{
-				struct resource *r = &dev->resource[i];
-				struct resource *pr;
-				struct pci_bus_info *bus_info = (struct pci_bus_info *) dev->sysdata;
-
-				if ((r->start == 0) || (r->parent != NULL))
-					continue;
-#if 1
-				if (r->flags & IORESOURCE_IO)
-					pr = &bus_info->io_space;
-				else
-					pr = &bus_info->mem_space;
-#else
-				if (r->flags & IORESOURCE_IO)
-					pr = &ioport_resource;
-				else
-					pr = &iomem_resource;
-#endif
-				if (request_resource(pr, r) < 0)
-				{
-					printk(KERN_ERR "PCI: Address space collision on region %d of device %s\n", i, dev->name);
-				}
-			}
-		}
-
-		if (bus->children)
-			pcibios_claim_resources(bus->children);
-
-		bus = bus->next;
-	}
-}
-
-/*
- * int pcibios_assign_resource(struct pci_dev *dev, int i)
- *
- * Assign a new address to a PCI resource.
- *
- * Parameters:
- *
- * dev	- device.
- * i	- resource.
- *
- * Result: 0 if successful.
- */
-
-int __init pcibios_assign_resource(struct pci_dev *dev, int i)
-{
-	struct resource *r = &dev->resource[i];
-	struct resource *pr = pci_find_parent_resource(dev, r);
-	unsigned long size = r->end + 1;
-
-	if (!pr)
-		return -EINVAL;
-
-	if (r->flags & IORESOURCE_IO)
-	{
-		if (size > 0x100)
-			return -EFBIG;
-
-		if (allocate_resource(pr, r, size, bus_info->io_space.start +
-				      IO_ALLOC_OFFSET,  bus_info->io_space.end, 1024))
-			return -EBUSY;
-	}
-	else
-	{
-		if (allocate_resource(pr, r, size, bus_info->mem_space.start +
-				      MEM_ALLOC_OFFSET, bus_info->mem_space.end, size))
-			return -EBUSY;
-	}
-
-	if (i < 6)
-		pci_write_config_dword(dev, PCI_BASE_ADDRESS_0 + 4 * i, r->start);
-
-	return 0;
-}
-
-void __init pcibios_fixup_bus(struct pci_bus *bus)
-{
-	struct pci_dev *dev;
-	void *sysdata;
-
-	sysdata = (bus->parent) ? bus->parent->sysdata : bus->sysdata;
-
-	for (dev = bus->devices; (dev != NULL); dev = dev->sibling)
-		dev->sysdata = sysdata;
-}
-
-void __init pcibios_init(void)
-{
-	printk("Linux/m68k PCI BIOS32 revision %x.%02x\n", MAJOR_REV, MINOR_REV);
-
-	bus_info = NULL;
-
-/* Hades code was:
-	if (MACH_IS_HADES)
-		bus_info = init_hades_pci();
-*/
-
-	if (bus_info != NULL)
-	{
-		printk("PCI: Probing PCI hardware\n");
-		pci_scan_bus(0, bus_info->m68k_pci_ops, bus_info);
-		pcibios_fixup();
-		pcibios_claim_resources(pci_root);
-	}
-	else
-		printk("PCI: No PCI bus detected\n");
-}
-
-char * __init pcibios_setup(char *str)
-{
-	if (!strcmp(str, "nomodify"))
-	{
-		pci_modify = 0;
-		return NULL;
-	}
-	else if (!strcmp(str, "skipvga"))
-	{
-		skip_vga = 1;
-		return NULL;
-	}
-	else if (!strcmp(str, "noburst"))
-	{
-		disable_pci_burst = 1;
-		return NULL;
-	}
-
-	return str;
-}
-#endif /* CONFIG_PCI */
--- a/include/asm-m68k/dma.h
+++ b/include/asm-m68k/dma.h
@@ -11,10 +11,6 @@
 extern int request_dma(unsigned int dmanr, const char * device_id);	/* reserve a DMA channel */
 extern void free_dma(unsigned int dmanr);	/* release it again */
 
-#ifdef CONFIG_PCI
-extern int isa_dma_bridge_buggy;
-#else
 #define isa_dma_bridge_buggy    (0)
-#endif
 
 #endif /* _M68K_DMA_H */
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -7,15 +7,12 @@
  *            - added skeleton for GG-II and Amiga PCMCIA
  * 2/3/01 RZ: - moved a few more defs into raw_io.h
  *
- * inX/outX/readX/writeX should not be used by any driver unless it does
- * ISA or PCI access. Other drivers should use function defined in raw_io.h
+ * inX/outX should not be used by any driver unless it does
+ * ISA access. Other drivers should use function defined in raw_io.h
  * or define its own macros on top of these.
  *
- *    inX(),outX()              are for PCI and ISA I/O
- *    readX(),writeX()          are for PCI memory
+ *    inX(),outX()              are for ISA I/O
  *    isa_readX(),isa_writeX()  are for ISA memory
- *
- * moved mem{cpy,set}_*io inside CONFIG_PCI
  */
 
 #ifndef _IO_H
@@ -256,10 +253,7 @@ static inline void isa_delay(void)
        (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) :  \
                   raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
 
-#endif  /* CONFIG_ISA */
-
 
-#if defined(CONFIG_ISA) && !defined(CONFIG_PCI)
 #define inb     isa_inb
 #define inb_p   isa_inb_p
 #define outb    isa_outb
@@ -282,55 +276,9 @@ static inline void isa_delay(void)
 #define readw   isa_readw
 #define writeb  isa_writeb
 #define writew  isa_writew
-#endif /* CONFIG_ISA */
 
-#if defined(CONFIG_PCI)
+#else  /* CONFIG_ISA */
 
-#define readl(addr)      in_le32(addr)
-#define writel(val,addr) out_le32((addr),(val))
-
-/* those can be defined for both ISA and PCI - it won't work though */
-#define readb(addr)       in_8(addr)
-#define readw(addr)       in_le16(addr)
-#define writeb(val,addr)  out_8((addr),(val))
-#define writew(val,addr)  out_le16((addr),(val))
-
-#define readb_relaxed(addr) readb(addr)
-#define readw_relaxed(addr) readw(addr)
-#define readl_relaxed(addr) readl(addr)
-
-#ifndef CONFIG_ISA
-#define inb(port)      in_8(port)
-#define outb(val,port) out_8((port),(val))
-#define inw(port)      in_le16(port)
-#define outw(val,port) out_le16((port),(val))
-#define inl(port)      in_le32(port)
-#define outl(val,port) out_le32((port),(val))
-
-#else
-/*
- * kernel with both ISA and PCI compiled in, those have
- * conflicting defs for in/out. Simply consider port < 1024
- * ISA and everything else PCI. read,write not defined
- * in this case
- */
-#define inb(port) ((port)<1024 ? isa_inb(port) : in_8(port))
-#define inb_p(port) ((port)<1024 ? isa_inb_p(port) : in_8(port))
-#define inw(port) ((port)<1024 ? isa_inw(port) : in_le16(port))
-#define inw_p(port) ((port)<1024 ? isa_inw_p(port) : in_le16(port))
-#define inl(port) ((port)<1024 ? isa_inl(port) : in_le32(port))
-#define inl_p(port) ((port)<1024 ? isa_inl_p(port) : in_le32(port))
-
-#define outb(val,port) ((port)<1024 ? isa_outb((val),(port)) : out_8((port),(val)))
-#define outb_p(val,port) ((port)<1024 ? isa_outb_p((val),(port)) : out_8((port),(val)))
-#define outw(val,port) ((port)<1024 ? isa_outw((val),(port)) : out_le16((port),(val)))
-#define outw_p(val,port) ((port)<1024 ? isa_outw_p((val),(port)) : out_le16((port),(val)))
-#define outl(val,port) ((port)<1024 ? isa_outl((val),(port)) : out_le32((port),(val)))
-#define outl_p(val,port) ((port)<1024 ? isa_outl_p((val),(port)) : out_le32((port),(val)))
-#endif
-#endif /* CONFIG_PCI */
-
-#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI)
 /*
  * We need to define dummy functions for GENERIC_IOMAP support.
  */
@@ -357,11 +305,11 @@ static inline void isa_delay(void)
 #define writeb(val,addr) out_8((addr),(val))
 #define readw(addr)      in_le16(addr)
 #define writew(val,addr) out_le16((addr),(val))
-#endif
-#if !defined(CONFIG_PCI)
+
+#endif /* CONFIG_ISA */
+
 #define readl(addr)      in_le32(addr)
 #define writel(val,addr) out_le32((addr),(val))
-#endif
 
 #define mmiowb()
 
--- a/include/asm-m68k/pci.h
+++ b/include/asm-m68k/pci.h
@@ -1,54 +1,8 @@
 #ifndef _ASM_M68K_PCI_H
 #define _ASM_M68K_PCI_H
 
-/*
- * asm-m68k/pci_m68k.h - m68k specific PCI declarations.
- *
- * Written by Wout Klaren.
- */
-
-#include <asm/scatterlist.h>
 #include <asm-generic/pci-dma-compat.h>
 
-struct pci_ops;
-
-/*
- * Structure with hardware dependent information and functions of the
- * PCI bus.
- */
-
-struct pci_bus_info
-{
-	/*
-	 * Resources of the PCI bus.
-	 */
-
-	struct resource mem_space;
-	struct resource io_space;
-
-	/*
-	 * System dependent functions.
-	 */
-
-	struct pci_ops *m68k_pci_ops;
-
-	void (*fixup)(int pci_modify);
-	void (*conf_device)(struct pci_dev *dev);
-};
-
-#define pcibios_assign_all_busses()	0
-#define pcibios_scan_all_fns(a, b)	0
-
-static inline void pcibios_set_master(struct pci_dev *dev)
-{
-	/* No special bus mastering setup handling */
-}
-
-static inline void pcibios_penalize_isa_irq(int irq, int active)
-{
-	/* We don't do dynamic PCI IRQ allocation */
-}
-
 /* The PCI address space does equal the physical memory
  * address space.  The networking and block device layers use
  * this boolean for bounce buffer decisions.

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 15/18] m68k: init_irq_proc depends on CONFIG_PROC_FS
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (13 preceding siblings ...)
  2008-10-13 19:59 ` [patch 14/18] m68k: remove the dead PCI code Geert Uytterhoeven
@ 2008-10-13 19:59 ` Geert Uytterhoeven
  2008-10-13 19:59 ` [patch 16/18] m68k: Atari SCSI needs NVRAM Geert Uytterhoeven
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: m68k-init_irq_proc-depends-on-CONFIG_PROC_FS.diff --]
[-- Type: text/plain, Size: 1238 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

If CONFIG_PROC_FS is not set, I get:

| arch/m68k/kernel/ints.c:433: error: redefinition of 'init_irq_proc'
| include/linux/interrupt.h:438: error: previous definition of 'init_irq_proc' was here

This was introduced by commit 6168a702ab0be181e5e57a0b2d0e7376f7a47f0b
("Declare init_irq_proc before we use it."), which replaced the #ifdef
protection of the init_irq_proc() call by a static inline dummy if
CONFIG_PROC_FS is not set.

Make init_irq_proc() depend on CONFIG_PROC_FS to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/kernel/ints.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -429,8 +429,9 @@ int show_interrupts(struct seq_file *p, 
 	return 0;
 }
 
+#ifdef CONFIG_PROC_FS
 void init_irq_proc(void)
 {
 	/* Insert /proc/irq driver here */
 }
-
+#endif

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 16/18] m68k: Atari SCSI needs NVRAM
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (14 preceding siblings ...)
  2008-10-13 19:59 ` [patch 15/18] m68k: init_irq_proc depends on CONFIG_PROC_FS Geert Uytterhoeven
@ 2008-10-13 19:59 ` Geert Uytterhoeven
  2008-10-13 19:59 ` [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h> Geert Uytterhoeven
  2008-10-13 19:59 ` [patch 18/18] arch/m68k/mm/kmap.c: introduce missing kfree Geert Uytterhoeven
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, linux-scsi

[-- Attachment #1: atari-scsi-needs-nvram.diff --]
[-- Type: text/plain, Size: 971 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

ERROR: "nvram_read_byte" [drivers/scsi/atari_scsi.ko] undefined!
ERROR: "nvram_check_checksum" [drivers/scsi/atari_scsi.ko] undefined!

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/scsi/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1640,6 +1640,7 @@ config ATARI_SCSI
 	tristate "Atari native SCSI support"
 	depends on ATARI && SCSI
 	select SCSI_SPI_ATTRS
+	select NVRAM
 	---help---
 	  If you have an Atari with built-in NCR5380 SCSI controller (TT,
 	  Falcon, ...) say Y to get it supported. Of course also, if you have

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h>
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (15 preceding siblings ...)
  2008-10-13 19:59 ` [patch 16/18] m68k: Atari SCSI needs NVRAM Geert Uytterhoeven
@ 2008-10-13 19:59 ` Geert Uytterhoeven
  2008-10-13 20:45   ` Henrique de Moraes Holschuh
  2008-10-13 19:59 ` [patch 18/18] arch/m68k/mm/kmap.c: introduce missing kfree Geert Uytterhoeven
  17 siblings, 1 reply; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

[-- Attachment #1: net-rfkill-rfkill-input-c-needs-linux-sched-h.diff --]
[-- Type: text/plain, Size: 964 bytes --]

From: Geert Uytterhoeven <geert@linux-m68k.org>

For some m68k configs, I get:

| net/rfkill/rfkill-input.c: In function 'rfkill_start':
| net/rfkill/rfkill-input.c:208: error: dereferencing pointer to incomplete type

As the incomplete type is `struct task_struct', including <linux/sched.h> fixes
it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 net/rfkill/rfkill-input.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/rfkill/rfkill-input.c
+++ b/net/rfkill/rfkill-input.c
@@ -16,6 +16,7 @@
 #include <linux/workqueue.h>
 #include <linux/init.h>
 #include <linux/rfkill.h>
+#include <linux/sched.h>
 
 #include "rfkill-input.h"
 

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* [patch 18/18] arch/m68k/mm/kmap.c: introduce missing kfree
  2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
                   ` (16 preceding siblings ...)
  2008-10-13 19:59 ` [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h> Geert Uytterhoeven
@ 2008-10-13 19:59 ` Geert Uytterhoeven
  17 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-13 19:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel, Julia Lawall

[-- Attachment #1: m68k-arch-m68k-mm-kmap-c-introduce-missing-kfree.diff --]
[-- Type: text/plain, Size: 1617 bytes --]

From: Julia Lawall <julia@diku.dk>

Error handling code following a kmalloc should free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,l;
position p1,p2;
expression *ptr != NULL;
@@

(
if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S
|
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
..
if (x == NULL) S
)
<... when != x
     when != if (...) { <+...x...+> }
x->f = E
..>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/mm/kmap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -66,8 +66,10 @@ static struct vm_struct *get_io_area(uns
 	for (p = &iolist; (tmp = *p) ; p = &tmp->next) {
 		if (size + addr < (unsigned long)tmp->addr)
 			break;
-		if (addr > KMAP_END-size)
+		if (addr > KMAP_END-size) {
+			kfree(area);
 			return NULL;
+		}
 		addr = tmp->size + (unsigned long)tmp->addr;
 	}
 	area->addr = (void *)addr;

-- 
Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h>
  2008-10-13 19:59 ` [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h> Geert Uytterhoeven
@ 2008-10-13 20:45   ` Henrique de Moraes Holschuh
  2008-10-13 23:09     ` Henrique de Moraes Holschuh
  2008-10-14  7:23     ` Geert Uytterhoeven
  0 siblings, 2 replies; 29+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-10-13 20:45 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linus Torvalds, linux-m68k, linux-kernel

On Mon, 13 Oct 2008, Geert Uytterhoeven wrote:
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> 
> For some m68k configs, I get:
> 
> | net/rfkill/rfkill-input.c: In function 'rfkill_start':
> | net/rfkill/rfkill-input.c:208: error: dereferencing pointer to incomplete type
> 
> As the incomplete type is `struct task_struct', including <linux/sched.h> fixes
> it.

Line 208 is this (in latest Linus mainline and also v2.6.27):

spin_unlock_irq(&handle->dev->event_lock);

So we need to include sched.h to everything that uses spin_unlock_irq?  If
only some variants of m68k need that, shouldn't it have been added on the
header that defines spin_unlock_irq() on those arches, instead?

Or am I looking at a different version of rfkill-input.c than what you based
that error message on?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 06/18] m68k: Disable Amiga serial console support if modular
  2008-10-13 19:58 ` [patch 06/18] m68k: Disable Amiga serial console support if modular Geert Uytterhoeven
@ 2008-10-13 21:08   ` Paul Bolle
  2008-10-14  7:29     ` Geert Uytterhoeven
  2008-10-14 17:20   ` Linus Torvalds
  1 sibling, 1 reply; 29+ messages in thread
From: Paul Bolle @ 2008-10-13 21:08 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linus Torvalds, linux-m68k, linux-kernel

On Mon, 2008-10-13 at 21:58 +0200, Geert Uytterhoeven wrote:
> Apparently console_initcall() is not defined in the modular case.

Yes, see include/linux/init.h:
#ifndef MODULE
[...]
#define console_initcall(fn) \
        static initcall_t __initcall_##fn \
        __used __section(.con_initcall.init) = fn
[...]

> Any better alternative fix?

Well, (a number of) other serial consoles cannot be selected if the
corresponding serial driver is modular. Try:
grep -B 2 -E "depends on .*=y" drivers/serial/Kconfig | \
    grep -A 2 -E "^config .*CONSOLE"

For instance:
config SERIAL_8250_CONSOLE
	bool "Console on 8250/16550 and compatible serial port"
	depends on SERIAL_8250=y

Maybe this config entry (in arch/m68k/Kconfig) could be cleaned up (or
split into multiple entries):
config SERIAL_CONSOLE
        bool "Support for serial port console"
        depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME ||
APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y ||
AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y
|| MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
[...]

That "depends on" line seems likely to lead to problems like the one you
ran into. But your patch (which I didn't test) is probably simpler.


Paul Bolle


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h>
  2008-10-13 20:45   ` Henrique de Moraes Holschuh
@ 2008-10-13 23:09     ` Henrique de Moraes Holschuh
  2008-10-14  7:23     ` Geert Uytterhoeven
  1 sibling, 0 replies; 29+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-10-13 23:09 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linus Torvalds, linux-m68k, linux-kernel

On Mon, 13 Oct 2008, Henrique de Moraes Holschuh wrote:
> On Mon, 13 Oct 2008, Geert Uytterhoeven wrote:
> > | net/rfkill/rfkill-input.c: In function 'rfkill_start':
> > | net/rfkill/rfkill-input.c:208: error: dereferencing pointer to incomplete type
> > 
> > As the incomplete type is `struct task_struct', including <linux/sched.h> fixes
> > it.
> 
> Line 208 is this (in latest Linus mainline and also v2.6.27):
> 
> spin_unlock_irq(&handle->dev->event_lock);
> 
> So we need to include sched.h to everything that uses spin_unlock_irq?  If

Never mind, I didn't check if the problem is with the argument to
spin_unlock_irq(), but the question remains...

> only some variants of m68k need that, shouldn't it have been added on the
> header that defines spin_unlock_irq() on those arches, instead?
> 
> Or am I looking at a different version of rfkill-input.c than what you based
> that error message on?

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h>
  2008-10-13 20:45   ` Henrique de Moraes Holschuh
  2008-10-13 23:09     ` Henrique de Moraes Holschuh
@ 2008-10-14  7:23     ` Geert Uytterhoeven
  2008-10-15  3:10       ` Henrique de Moraes Holschuh
  1 sibling, 1 reply; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-14  7:23 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh; +Cc: Linus Torvalds, linux-m68k, linux-kernel

On Mon, 13 Oct 2008, Henrique de Moraes Holschuh wrote:
> On Mon, 13 Oct 2008, Geert Uytterhoeven wrote:
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > 
> > For some m68k configs, I get:
> > 
> > | net/rfkill/rfkill-input.c: In function 'rfkill_start':
> > | net/rfkill/rfkill-input.c:208: error: dereferencing pointer to incomplete type
> > 
> > As the incomplete type is `struct task_struct', including <linux/sched.h> fixes
> > it.
> 
> Line 208 is this (in latest Linus mainline and also v2.6.27):
> 
> spin_unlock_irq(&handle->dev->event_lock);
> 
> So we need to include sched.h to everything that uses spin_unlock_irq?  If
> only some variants of m68k need that, shouldn't it have been added on the
> header that defines spin_unlock_irq() on those arches, instead?

Unfortunately that's not possible, due to Include Hell(tm).
Therefore, including <linux/sched.h> is the way this has been fixed in
the past.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 06/18] m68k: Disable Amiga serial console support if modular
  2008-10-13 21:08   ` Paul Bolle
@ 2008-10-14  7:29     ` Geert Uytterhoeven
  0 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-14  7:29 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Linus Torvalds, linux-m68k, linux-kernel

On Mon, 13 Oct 2008, Paul Bolle wrote:
> On Mon, 2008-10-13 at 21:58 +0200, Geert Uytterhoeven wrote:
> > Apparently console_initcall() is not defined in the modular case.
> 
> Yes, see include/linux/init.h:
> #ifndef MODULE
> [...]
> #define console_initcall(fn) \
>         static initcall_t __initcall_##fn \
>         __used __section(.con_initcall.init) = fn
> [...]
> 
> > Any better alternative fix?
> 
> Well, (a number of) other serial consoles cannot be selected if the
> corresponding serial driver is modular. Try:
> grep -B 2 -E "depends on .*=y" drivers/serial/Kconfig | \
>     grep -A 2 -E "^config .*CONSOLE"
> 
> For instance:
> config SERIAL_8250_CONSOLE
> 	bool "Console on 8250/16550 and compatible serial port"
> 	depends on SERIAL_8250=y

Yes, I saw those.

> Maybe this config entry (in arch/m68k/Kconfig) could be cleaned up (or
> split into multiple entries):
> config SERIAL_CONSOLE
>         bool "Support for serial port console"
>         depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME ||
> APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y ||
> AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y
> || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
> [...]
> 
> That "depends on" line seems likely to lead to problems like the one you
> ran into. But your patch (which I didn't test) is probably simpler.

Adding all those extra config symbols seems like a bit overkill to me...

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 06/18] m68k: Disable Amiga serial console support if modular
  2008-10-13 19:58 ` [patch 06/18] m68k: Disable Amiga serial console support if modular Geert Uytterhoeven
  2008-10-13 21:08   ` Paul Bolle
@ 2008-10-14 17:20   ` Linus Torvalds
  2008-10-14 19:22     ` Geert Uytterhoeven
  1 sibling, 1 reply; 29+ messages in thread
From: Linus Torvalds @ 2008-10-14 17:20 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, linux-kernel



On Mon, 13 Oct 2008, Geert Uytterhoeven wrote:
>
> Apparently console_initcall() is not defined in the modular case.

We can certainly fix that. 

Does this make things work for you? If so, send it back with a sign-off 
(add you can add mine too - but I'm not going to add it until it's tested)

		Linus
---
 include/linux/init.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index 93538b6..d9625b5 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -273,6 +273,7 @@ void __init parse_early_param(void);
 #else /* MODULE */
 
 /* Don't use these in modules, but some people do... */
+#define console_initcall(fn)		module_init(fn)
 #define core_initcall(fn)		module_init(fn)
 #define postcore_initcall(fn)		module_init(fn)
 #define arch_initcall(fn)		module_init(fn)

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [patch 06/18] m68k: Disable Amiga serial console support if modular
  2008-10-14 17:20   ` Linus Torvalds
@ 2008-10-14 19:22     ` Geert Uytterhoeven
  0 siblings, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-14 19:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-m68k, linux-kernel

	Hi Linus,

On Tue, 14 Oct 2008, Linus Torvalds wrote:
> On Mon, 13 Oct 2008, Geert Uytterhoeven wrote:
> > Apparently console_initcall() is not defined in the modular case.
> 
> We can certainly fix that. 
> 
> Does this make things work for you? If so, send it back with a sign-off 
> (add you can add mine too - but I'm not going to add it until it's tested)
> 
> 		Linus
> ---
>  include/linux/init.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/init.h b/include/linux/init.h
> index 93538b6..d9625b5 100644
> --- a/include/linux/init.h
> +++ b/include/linux/init.h
> @@ -273,6 +273,7 @@ void __init parse_early_param(void);
>  #else /* MODULE */
>  
>  /* Don't use these in modules, but some people do... */
> +#define console_initcall(fn)		module_init(fn)
>  #define core_initcall(fn)		module_init(fn)
>  #define postcore_initcall(fn)		module_init(fn)
>  #define arch_initcall(fn)		module_init(fn)

That won't help amiserial.c, as there's already a module_init() in that
file for the normal serial driver part.

But even if it would work, does it really make sense to have a modular
serial console driver?

  - If you have only one console driver, it would be registered and become
    your console when you load the module; but you wouldn't have had any
    console before it got loaded.
  - If you have several console drivers, you need a `console=' parameter
    anyway to control which one is used.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h>
  2008-10-14  7:23     ` Geert Uytterhoeven
@ 2008-10-15  3:10       ` Henrique de Moraes Holschuh
  2008-10-15  7:50         ` Geert Uytterhoeven
  2008-10-15 13:12         ` Adrian Bunk
  0 siblings, 2 replies; 29+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-10-15  3:10 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linus Torvalds, linux-m68k, linux-kernel

On Tue, 14 Oct 2008, Geert Uytterhoeven wrote:
> Unfortunately that's not possible, due to Include Hell(tm).
> Therefore, including <linux/sched.h> is the way this has been fixed in
> the past.

I see.  Well, when doing this I'd suggest adding a comment, otherwise the
include could end up getting removed sooner or later without anyone asking
linux-m68k first (I seriously douby anyone will do git blame to find out why
an #include line exists before removing it).

Something like:
#include <sched.h> /* m68k needs task_struct for <whatever> */

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h>
  2008-10-15  3:10       ` Henrique de Moraes Holschuh
@ 2008-10-15  7:50         ` Geert Uytterhoeven
  2008-10-15 13:12         ` Adrian Bunk
  1 sibling, 0 replies; 29+ messages in thread
From: Geert Uytterhoeven @ 2008-10-15  7:50 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh; +Cc: Linus Torvalds, linux-m68k, linux-kernel

On Wed, 15 Oct 2008, Henrique de Moraes Holschuh wrote:
> On Tue, 14 Oct 2008, Geert Uytterhoeven wrote:
> > Unfortunately that's not possible, due to Include Hell(tm).
> > Therefore, including <linux/sched.h> is the way this has been fixed in
> > the past.
> 
> I see.  Well, when doing this I'd suggest adding a comment, otherwise the
> include could end up getting removed sooner or later without anyone asking
> linux-m68k first (I seriously douby anyone will do git blame to find out why
> an #include line exists before removing it).
> 
> Something like:
> #include <sched.h> /* m68k needs task_struct for <whatever> */

Probably we should start looking again into extracting struct
task_struct into its own header file, cfr. what Roman Zippel did a long
time ago...

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h>
  2008-10-15  3:10       ` Henrique de Moraes Holschuh
  2008-10-15  7:50         ` Geert Uytterhoeven
@ 2008-10-15 13:12         ` Adrian Bunk
  1 sibling, 0 replies; 29+ messages in thread
From: Adrian Bunk @ 2008-10-15 13:12 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh
  Cc: Geert Uytterhoeven, Linus Torvalds, linux-m68k, linux-kernel

On Wed, Oct 15, 2008 at 12:10:18AM -0300, Henrique de Moraes Holschuh wrote:
> On Tue, 14 Oct 2008, Geert Uytterhoeven wrote:
> > Unfortunately that's not possible, due to Include Hell(tm).
> > Therefore, including <linux/sched.h> is the way this has been fixed in
> > the past.
> 
> I see.  Well, when doing this I'd suggest adding a comment, otherwise the
> include could end up getting removed sooner or later without anyone asking
> linux-m68k first (I seriously douby anyone will do git blame to find out why
> an #include line exists before removing it).
> 
> Something like:
> #include <sched.h> /* m68k needs task_struct for <whatever> */

Such comments in the kernel tend to be old ones you cannot trust.

And #include removals are not really a common case - sometimes someone 
cleans up something specific, but I don't think anyone will remove 
#include's of sched.h from random .c files (considering how much 
sched.h pulls in the fallout of such #include removals would be many
build breakages) unless someone seriously reorganizes sched.h itself.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2008-10-15 13:12 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-13 19:58 [patch 00/18] m68k patches for 2.6.28 Geert Uytterhoeven
2008-10-13 19:58 ` [patch 01/18] m68k: use bcd2bin/bin2bcd Geert Uytterhoeven
2008-10-13 19:58 ` [patch 02/18] m68k: Use new printk() extension %pS to print symbols Geert Uytterhoeven
2008-10-13 19:58 ` [patch 03/18] m68k: Put .bss at the end of the data section Geert Uytterhoeven
2008-10-13 19:58 ` [patch 04/18] m68k: Add NOTES to init data so its discarded at boot Geert Uytterhoeven
2008-10-13 19:58 ` [patch 05/18] m68k: Reverse platform MMU logic so Sun 3 is last Geert Uytterhoeven
2008-10-13 19:58 ` [patch 06/18] m68k: Disable Amiga serial console support if modular Geert Uytterhoeven
2008-10-13 21:08   ` Paul Bolle
2008-10-14  7:29     ` Geert Uytterhoeven
2008-10-14 17:20   ` Linus Torvalds
2008-10-14 19:22     ` Geert Uytterhoeven
2008-10-13 19:58 ` [patch 07/18] m68k: Modular Amiga keyboard needs key_maps Geert Uytterhoeven
2008-10-13 19:58 ` [patch 08/18] m68k: Remove unused atari_kbd_translate() Geert Uytterhoeven
2008-10-13 19:58 ` [patch 09/18] m68k: Define rtc_lock on Atari Geert Uytterhoeven
2008-10-13 19:58 ` [patch 10/18] m68k: Add missing dma_sync_single_range_for_{cpu,device}() Geert Uytterhoeven
2008-10-13 19:58 ` [patch 11/18] m68k: <asm/pci.h> needs <asm-generic/pci-dma-compat.h> Geert Uytterhoeven
2008-10-13 19:58 ` [patch 12/18] HP input: kill warnings due to suseconds_t differences Geert Uytterhoeven
2008-10-13 19:58 ` [patch 13/18] m68k: Remove the broken Hades support Geert Uytterhoeven
2008-10-13 19:59 ` [patch 14/18] m68k: remove the dead PCI code Geert Uytterhoeven
2008-10-13 19:59 ` [patch 15/18] m68k: init_irq_proc depends on CONFIG_PROC_FS Geert Uytterhoeven
2008-10-13 19:59 ` [patch 16/18] m68k: Atari SCSI needs NVRAM Geert Uytterhoeven
2008-10-13 19:59 ` [patch 17/18] net/rfkill/rfkill-input.c needs <linux/sched.h> Geert Uytterhoeven
2008-10-13 20:45   ` Henrique de Moraes Holschuh
2008-10-13 23:09     ` Henrique de Moraes Holschuh
2008-10-14  7:23     ` Geert Uytterhoeven
2008-10-15  3:10       ` Henrique de Moraes Holschuh
2008-10-15  7:50         ` Geert Uytterhoeven
2008-10-15 13:12         ` Adrian Bunk
2008-10-13 19:59 ` [patch 18/18] arch/m68k/mm/kmap.c: introduce missing kfree Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox