Update patches from linux-m68k CVS

svn path=/dists/trunk/linux-2.6/; revision=10087
This commit is contained in:
Christian T. Steigies 2008-01-08 22:54:40 +00:00
parent 3665f53024
commit 867ef4c915
97 changed files with 1218 additions and 33933 deletions

5
debian/changelog vendored
View File

@ -59,7 +59,10 @@ linux-2.6 (2.6.24~rc7-1~experimental.1) UNRELEASED; urgency=low
* [mips/mipsel] Remove QEMU flavour, as the Malta platform is now correctly
emulated in QEMU.
-- maximilian attems <maks@debian.org> Mon, 07 Jan 2008 17:28:08 +0100
[ Christian T. Steigies ]
* [m68k]: Update patches from linux-m68k CVS
-- Christian T. Steigies <cts@debian.org> Tue, 8 Jan 2008 22:16:26 +0100
linux-2.6 (2.6.23-1~experimental.1) UNRELEASED; urgency=low

File diff suppressed because it is too large Load Diff

View File

@ -1,146 +0,0 @@
To: linus, alan
Cc: lkml
Subject: [PATCH] MC68681 DUART
From: Linux/m68k legacy
MC68681 DUART register definitions for the Amiga MultiFace III serial driver.
---
drivers/char/mc68681.h | 131 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 131 insertions(+)
--- /dev/null
+++ linux-m68k-2.6.21/drivers/char/mc68681.h
@@ -0,0 +1,131 @@
+#ifndef _MC68681_H_
+#define _MC68681_H_
+
+/*
+ * This describes an MC68681 DUART. It has almost only overlayed registers, which
+ * the structure very ugly.
+ * Note that the ri-register isn't really a register of the duart but a kludge of bsc
+ * to make the ring indicator available.
+ *
+ * The data came from the MFC-31-Developer Kit (from Ralph Seidel,
+ * zodiac@darkness.gun.de) and the data sheet of Phillip's clone device (SCN68681)
+ * (from Richard Hirst, srh@gpt.co.uk)
+ *
+ * 11.11.95 copyright Joerg Dorchain (dorchain@mpi-sb.mpg.de)
+ *
+ */
+
+struct duarthalf {
+union {
+volatile u_char mr1; /* rw */
+volatile u_char mr2; /* rw */
+} mr;
+volatile u_char ri; /* special, read */
+union {
+volatile u_char sr; /* read */
+volatile u_char csr; /* write */
+} sr_csr;
+u_char pad1;
+volatile u_char cr; /* write */
+u_char pad2;
+union {
+volatile u_char rhr; /* read */
+volatile u_char thr; /* write */
+} hr;
+u_char pad3;
+};
+
+struct duart {
+struct duarthalf pa;
+union {
+volatile u_char ipcr; /* read */
+volatile u_char acr; /* write */
+} ipcr_acr;
+u_char pad1;
+union {
+volatile u_char isr; /* read */
+volatile u_char imr; /* write */
+} ir;
+u_char pad2;
+volatile u_char ctu;
+u_char pad3;
+volatile u_char ctl;
+u_char pad4;
+struct duarthalf pb;
+volatile u_char ivr;
+u_char pad5;
+union {
+volatile u_char ipr; /* read */
+volatile u_char opcr; /* write */
+} ipr_opcr;
+u_char pad6;
+union {
+volatile u_char start; /* read */
+volatile u_char sopc; /* write */
+} start_sopc;
+u_char pad7;
+union {
+volatile u_char stop; /* read */
+volatile u_char ropc; /* write */
+} stop_ropc;
+u_char pad8;
+};
+
+#define MR1_BITS 3
+#define MR1_5BITS 0
+#define MR1_6BITS 1
+#define MR1_7BITS 2
+#define MR1_8BITS 3
+
+#define MR1_PARITY_ODD 4
+
+#define MR1_PARITY 24
+#define MR1_PARITY_WITH 0
+#define MR1_PARITY_FORCE 8
+#define MR1_PARITY_NO 16
+#define MR1_PARITY_MULTIDROP 24
+
+#define MR1_ERROR_BLOCK 32
+#define MR1_FFULL_IRQ 64
+#define MR1_RxRTS_ON 128
+
+#define MR2_STOPS 15
+#define MR2_1STOP 7
+#define MR2_2STOP 15
+
+#define MR2_CTS_ON 16
+#define MR2_TxRTS_ON 32
+
+#define MR2_MODE 192
+#define MR2_NORMAL 0
+#define MR2_ECHO 64
+#define MR2_LOCALLOOP 128
+#define MR2_REMOTELOOP 192
+
+#define CR_RXCOMMAND 3
+#define CR_NONE 0
+#define CR_RX_ON 1
+#define CR_RX_OFF 2
+#define CR_TXCOMMAND 12
+#define CR_TX_ON 4
+#define CR_TX_OFF 8
+#define CR_MISC 112
+#define CR_RESET_MR 16
+#define CR_RESET_RX 32
+#define CR_RESET_TX 48
+#define CR_RESET_ERR 64
+#define CR_RESET_BREAK 80
+#define CR_START_BREAK 96
+#define CR_STOP_BREAK 112
+
+#define SR_RXRDY 1
+#define SR_FFULL 2
+#define SR_TXRDY 4
+#define SR_TXEMPT 8
+#define SR_OVERRUN 16
+#define SR_PARITY 32
+#define SR_FRAMING 64
+#define SR_BREAK 128
+
+
+#endif

View File

@ -1,21 +0,0 @@
To: linus, alan
Cc: lkml
Subject: [PATCH] M68k PCI
First steps in making m68k PCI support compilable again
---
arch/m68k/kernel/bios32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/bios32.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/bios32.c
@@ -284,7 +284,7 @@ static void __init layout_bus(struct pci
DBG_DEVS(("layout_bus: starting bus %d\n", bus->number));
- if (!bus->devices && !bus->children)
+ if (list_empty(&bus->devices) && list_empty(&bus->children))
return;
/*

View File

@ -5,15 +5,14 @@ Subject: [PATCH] ADB raw packets
From: Linux/m68k legacy
ADB: add support for raw packets
---
drivers/macintosh/adb.c | 8 +++++---
drivers/macintosh/adb.c | 7 ++++---
include/linux/adb.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
2 files changed, 5 insertions(+), 3 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/macintosh/adb.c
+++ linux-m68k-2.6.21/drivers/macintosh/adb.c
@@ -478,13 +478,15 @@ adb_request(struct adb_request *req, voi
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -448,13 +448,14 @@ adb_request(struct adb_request *req, voi
use_sreq = 1;
} else
use_sreq = 0;
@ -26,14 +25,13 @@ ADB: add support for raw packets
va_start(list, nbytes);
- for (i = 0; i < nbytes; ++i)
- req->data[i+1] = va_arg(list, int);
+ while (i < req->nbytes) {
+ while (i < req->nbytes)
+ req->data[i++] = va_arg(list, int);
+ }
va_end(list);
if (flags & ADBREQ_NOSEND)
--- linux-m68k-2.6.21.orig/include/linux/adb.h
+++ linux-m68k-2.6.21/include/linux/adb.h
--- a/include/linux/adb.h
+++ b/include/linux/adb.h
@@ -76,6 +76,7 @@ struct adb_driver {
#define ADBREQ_REPLY 1 /* expect reply */
#define ADBREQ_SYNC 2 /* poll until done */

View File

@ -5,15 +5,14 @@ Local m68k changes, _NEVER_ to be submitted upstream:
- Append `-m68k' to EXTRAVERSION
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> for m68k CVS only
---
Makefile | 2 +-
localversion.m68k | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
--- linux-m68k-2.6.21.orig/Makefile
+++ linux-m68k-2.6.21/Makefile
@@ -182,7 +182,7 @@ SUBARCH := $(shell uname -m | sed -e s/i
--- a/Makefile
+++ b/Makefile
@@ -190,7 +190,7 @@ SUBARCH := $(shell uname -m | sed -e s/i
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
@ -22,7 +21,3 @@ Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> for m68k CVS only
CROSS_COMPILE ?=
# Architecture as present in compile.h
--- /dev/null
+++ linux-m68k-2.6.21/localversion.m68k
@@ -0,0 +1 @@
+-m68k

View File

@ -5,13 +5,12 @@ Subject: [PATCH] Atari FAT updates
From: Linux/m68k legacy
Add support for the Atari-variant of the FAT filesystem
---
fs/fat/inode.c | 46 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
--- linux-m68k-2.6.21.orig/fs/fat/inode.c
+++ linux-m68k-2.6.21/fs/fat/inode.c
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -17,6 +17,7 @@
#include <linux/smp_lock.h>
#include <linux/seq_file.h>
@ -20,16 +19,16 @@ Add support for the Atari-variant of the FAT filesystem
#include <linux/pagemap.h>
#include <linux/mpage.h>
#include <linux/buffer_head.h>
@@ -852,7 +853,7 @@ enum {
@@ -847,7 +848,7 @@ enum {
Opt_check_n, Opt_check_r, Opt_check_s, Opt_uid, Opt_gid,
Opt_umask, Opt_dmask, Opt_fmask, Opt_codepage, Opt_nocase,
Opt_umask, Opt_dmask, Opt_fmask, Opt_codepage, Opt_usefree, Opt_nocase,
Opt_quiet, Opt_showexec, Opt_debug, Opt_immutable,
- Opt_dots, Opt_nodots,
+ Opt_dots, Opt_nodots, Opt_atari_no, Opt_atari_yes,
Opt_charset, Opt_shortname_lower, Opt_shortname_win95,
Opt_shortname_winnt, Opt_shortname_mixed, Opt_utf8_no, Opt_utf8_yes,
Opt_uni_xl_no, Opt_uni_xl_yes, Opt_nonumtail_no, Opt_nonumtail_yes,
@@ -877,6 +878,9 @@ static match_table_t fat_tokens = {
@@ -873,6 +874,9 @@ static match_table_t fat_tokens = {
{Opt_showexec, "showexec"},
{Opt_debug, "debug"},
{Opt_immutable, "sys_immutable"},
@ -39,21 +38,21 @@ Add support for the Atari-variant of the FAT filesystem
{Opt_obsolate, "conv=binary"},
{Opt_obsolate, "conv=text"},
{Opt_obsolate, "conv=auto"},
@@ -952,6 +956,13 @@ static int parse_options(char *options,
@@ -948,6 +952,13 @@ static int parse_options(char *options,
opts->utf8 = opts->unicode_xlate = 0;
opts->numtail = 1;
opts->nocase = 0;
opts->usefree = opts->nocase = 0;
+ opts->atari = 0;
+
+#ifdef CONFIG_ATARI
+ if(MACH_IS_ATARI)
+ if (MACH_IS_ATARI)
+ /* make Atari GEMDOS format the default if machine is an Atari */
+ opts->atari = 1;
+#endif
*debug = 0;
if (!options)
@@ -1000,6 +1011,12 @@ static int parse_options(char *options,
@@ -999,6 +1010,12 @@ static int parse_options(char *options,
case Opt_immutable:
opts->sys_immutable = 1;
break;
@ -66,7 +65,7 @@ Add support for the Atari-variant of the FAT filesystem
case Opt_uid:
if (match_int(&args[0], &option))
return 0;
@@ -1336,8 +1353,31 @@ int fat_fill_super(struct super_block *s
@@ -1335,8 +1352,31 @@ int fat_fill_super(struct super_block *s
total_clusters = (total_sectors - sbi->data_start) / sbi->sec_per_clus;

View File

@ -5,13 +5,12 @@ Subject: [PATCH] M68k IDE updates
From: Linux/m68k legacy
M68k IDE updates: Add m68k-isms to the generic ide_fix_driveid()
---
drivers/ide/ide-iops.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- linux-m68k-2.6.21.orig/drivers/ide/ide-iops.c
+++ linux-m68k-2.6.21/drivers/ide/ide-iops.c
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -313,6 +313,23 @@ void ide_fix_driveid (struct hd_driveid
int i;
u16 *stringcast;

View File

@ -23,21 +23,21 @@ Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
drivers/char/atari_scc.c | 1701 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 1702 insertions(+)
--- linux-2.6-2.6.21.orig/drivers/char/Makefile 2007-05-17 17:59:28.000000000 +0200
+++ linux-2.6-2.6.21/drivers/char/Makefile 2007-05-17 18:00:10.000000000 +0200
@@ -30,6 +30,7 @@
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_DIGIEPCA) += epca.o
obj-$(CONFIG_SPECIALIX) += specialix.o
obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
obj-$(CONFIG_SIBYTE_SB1250_DUART) += sb1250_duart.o
obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o
+obj-$(CONFIG_ATARI_SCC) += atari_scc.o generic_serial.o
obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
obj-$(CONFIG_MOXA_SMARTIO_NEW) += mxser_new.o
--- /dev/null
+++ linux-m68k-2.6.21/drivers/char/atari_scc.c
+++ b/drivers/char/atari_scc.c
@@ -0,0 +1,1701 @@
+/*
+ * drivers/char/atari_scc.c: Atari TT/Falcon Am8530 SCC serial ports implementation.
+ * Atari TT/Falcon Am8530 SCC serial ports implementation.
+ *
+ * Copyright 2005 Michael Schmitz
+ *

View File

@ -0,0 +1,100 @@
Subject: m68k: Balance ioremap and iounmap in m68k/atari/hades-pci.c
From: Roel Kluin <12o3l@tiscali.nl>
m68k: Balance ioremap and iounmap in m68k/atari/hades-pci.c
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/atari/hades-pci.c | 56 +++++++++++++++++++++-----------------------
1 file changed, 27 insertions(+), 29 deletions(-)
--- a/arch/m68k/atari/hades-pci.c
+++ b/arch/m68k/atari/hades-pci.c
@@ -376,8 +376,8 @@ struct pci_bus_info * __init init_hades_
*/
bus = kzalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
- if (!bus)
- return NULL;
+ if (unlikely(!bus))
+ goto iounmap_base_virt;
/*
* Claim resources. The m68k has no separate I/O space, both
@@ -385,43 +385,25 @@ struct pci_bus_info * __init init_hades_
* the I/O resources are requested in memory space as well.
*/
- if (request_resource(&iomem_resource, &config_space) != 0)
- {
- kfree(bus);
- return NULL;
- }
-
- if (request_resource(&iomem_resource, &io_space) != 0)
- {
- release_resource(&config_space);
- kfree(bus);
- return NULL;
- }
+ 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 (request_resource(&iomem_resource, &bus->mem_space) != 0)
- {
- release_resource(&io_space);
- release_resource(&config_space);
- kfree(bus);
- return NULL;
- }
+ 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 (request_resource(&ioport_resource, &bus->io_space) != 0)
- {
- release_resource(&bus->mem_space);
- release_resource(&io_space);
- release_resource(&config_space);
- kfree(bus);
- return NULL;
- }
+ if (unlikely(request_resource(&ioport_resource, &bus->io_space) != 0))
+ goto release_bus_mem_space;
#endif
/*
* Set hardware dependent functions.
@@ -438,5 +420,21 @@ struct pci_bus_info * __init init_hades_
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

View File

@ -0,0 +1,34 @@
Subject: dio: ARRAY_SIZE() cleanup
From: Alejandro Martinez Ruiz <alex@flawedcode.org>
dio: ARRAY_SIZE() cleanup
[Geert: eliminate NUMNAMES, as suggested by Richard Knutsson ]
Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/dio/dio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/drivers/dio/dio.c
+++ b/drivers/dio/dio.c
@@ -88,8 +88,6 @@ static struct dioname names[] =
#undef DIONAME
#undef DIOFBNAME
-#define NUMNAMES (sizeof(names) / sizeof(struct dioname))
-
static const char *unknowndioname
= "unknown DIO board -- please email <linux-m68k@lists.linux-m68k.org>!";
@@ -97,7 +95,7 @@ static const char *dio_getname(int id)
{
/* return pointer to a constant string describing the board with given ID */
unsigned int i;
- for (i = 0; i < NUMNAMES; i++)
+ for (i = 0; i < ARRAY_SIZE(names); i++)
if (names[i].id == id)
return names[i].name;

View File

@ -0,0 +1,23 @@
Subject: m68k: ARRAY_SIZE() cleanup
From: Alejandro Martinez Ruiz <alex@flawedcode.org>
m68k: ARRAY_SIZE() cleanup
Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/amiga/amisound.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -21,7 +21,7 @@ static const signed char sine_data[] = {
0, 39, 75, 103, 121, 127, 121, 103, 75, 39,
0, -39, -75, -103, -121, -127, -121, -103, -75, -39
};
-#define DATA_SIZE (sizeof(sine_data)/sizeof(sine_data[0]))
+#define DATA_SIZE ARRAY_SIZE(sine_data)
#define custom amiga_custom

View File

@ -0,0 +1,35 @@
Subject: m68k: Use cc-cross-prefix
From: Geert Uytterhoeven <geert@linux-m68k.org>
m68k: Use cc-cross-prefix
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Makefile | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -13,16 +13,15 @@
# Copyright (C) 1994 by Hamish Macdonald
#
-# test for cross compiling
-COMPILE_ARCH = $(shell uname -m)
-
# override top level makefile
AS += -m68020
LDFLAGS := -m m68kelf
LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
-ifneq ($(COMPILE_ARCH),$(ARCH))
- # prefix for cross-compiling binaries
- CROSS_COMPILE = m68k-linux-gnu-
+ifneq ($(SUBARCH),$(ARCH))
+ ifeq ($(CROSS_COMPILE),)
+ CROSS_COMPILE := $(call cc-cross-prefix, \
+ m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
+ endif
endif
ifdef CONFIG_SUN3

View File

@ -0,0 +1,52 @@
Subject: initrd: Fix virtual/physical mix-up in overwrite test
From: Geert Uytterhoeven <geert@linux-m68k.org>
On recent kernels, I get the following error when using an initrd:
| initrd overwritten (0x00b78000 < 0x07668000) - disabling it.
My Amiga 4000 has 12 MiB of RAM at physical address 0x07400000 (virtual
0x00000000).
The initrd is located at the end of RAM: 0x00b78000 - 0x00c00000 (virtual).
The overwrite test compares the (virtual) initrd location to the (physical)
first available memory location, which fails.
This patch converts initrd_start to a page frame number, so it can be safely
compared with min_low_pfn.
Before the introduction of discontiguous memory support on m68k
(12d810c1b8c2b913d48e629e2b5c01d105029839), min_low_pfn was just left
untouched by the m68k-specific code (zero, I guess), and everything worked
fine.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
On several platforms, initrd_below_start_ok is set to 1:
| arch/mips/kernel/setup.c: initrd_below_start_ok = 1;
| arch/parisc/mm/init.c: initrd_below_start_ok = 1;
| arch/powerpc/kernel/prom.c: initrd_below_start_ok = 1;
| arch/ppc/platforms/hdpu.c: initrd_below_start_ok = 1;
| arch/xtensa/kernel/setup.c: initrd_below_start_ok = 1;
Some of these may be workarounds for this bug. Please check.
init/main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/init/main.c
+++ b/init/main.c
@@ -598,9 +598,10 @@ asmlinkage void __init start_kernel(void
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
- initrd_start < min_low_pfn << PAGE_SHIFT) {
+ page_to_pfn(virt_to_page(initrd_start)) < min_low_pfn) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
- "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
+ "disabling it.\n",
+ page_to_pfn(virt_to_page(initrd_start)), min_low_pfn);
initrd_start = 0;
}
#endif

View File

@ -0,0 +1,217 @@
Subject: m68k: kill arch/m68k/amiga/amiga_ksyms.c
From: Adrian Bunk <bunk@kernel.org>
m68k: kill arch/m68k/amiga/amiga_ksyms.c
EXPORT_SYMBOL's belong to the actual code.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/amiga/Makefile | 2 +-
arch/m68k/amiga/amiga_ksyms.c | 33 ---------------------------------
arch/m68k/amiga/amisound.c | 3 +++
arch/m68k/amiga/chipram.c | 7 +++++++
arch/m68k/amiga/config.c | 12 ++++++++++++
arch/m68k/amiga/pcmcia.c | 9 +++++++++
6 files changed, 32 insertions(+), 34 deletions(-)
--- a/arch/m68k/amiga/Makefile
+++ b/arch/m68k/amiga/Makefile
@@ -2,6 +2,6 @@
# Makefile for Linux arch/m68k/amiga source directory
#
-obj-y := config.o amiints.o cia.o chipram.o amisound.o amiga_ksyms.o
+obj-y := config.o amiints.o cia.o chipram.o amisound.o
obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
--- a/arch/m68k/amiga/amiga_ksyms.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <linux/module.h>
-#include <linux/types.h>
-#include <asm/ptrace.h>
-#include <asm/amigahw.h>
-#include <asm/amigaints.h>
-#include <asm/amipcmcia.h>
-
-extern volatile u_short amiga_audio_min_period;
-extern u_short amiga_audio_period;
-
-/*
- * Add things here when you find the need for it.
- */
-EXPORT_SYMBOL(amiga_model);
-EXPORT_SYMBOL(amiga_chipset);
-EXPORT_SYMBOL(amiga_hw_present);
-EXPORT_SYMBOL(amiga_eclock);
-EXPORT_SYMBOL(amiga_colorclock);
-EXPORT_SYMBOL(amiga_chip_alloc);
-EXPORT_SYMBOL(amiga_chip_free);
-EXPORT_SYMBOL(amiga_chip_avail);
-EXPORT_SYMBOL(amiga_chip_size);
-EXPORT_SYMBOL(amiga_audio_period);
-EXPORT_SYMBOL(amiga_audio_min_period);
-
-#ifdef CONFIG_AMIGA_PCMCIA
- EXPORT_SYMBOL(pcmcia_reset);
- EXPORT_SYMBOL(pcmcia_copy_tuple);
- EXPORT_SYMBOL(pcmcia_program_voltage);
- EXPORT_SYMBOL(pcmcia_access_speed);
- EXPORT_SYMBOL(pcmcia_write_enable);
- EXPORT_SYMBOL(pcmcia_write_disable);
-#endif
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -12,6 +12,7 @@
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/string.h>
+#include <linux/module.h>
#include <asm/system.h>
#include <asm/amigahw.h>
@@ -31,6 +32,7 @@ static const signed char sine_data[] = {
*/
volatile unsigned short amiga_audio_min_period = 124; /* Default for pre-OCS */
+EXPORT_SYMBOL(amiga_audio_min_period);
#define MAX_PERIOD (65535)
@@ -40,6 +42,7 @@ volatile unsigned short amiga_audio_min_
*/
unsigned short amiga_audio_period = MAX_PERIOD;
+EXPORT_SYMBOL(amiga_audio_period);
static unsigned long clock_constant;
--- a/arch/m68k/amiga/chipram.c
+++ b/arch/m68k/amiga/chipram.c
@@ -13,10 +13,13 @@
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/string.h>
+#include <linux/module.h>
+
#include <asm/page.h>
#include <asm/amigahw.h>
unsigned long amiga_chip_size;
+EXPORT_SYMBOL(amiga_chip_size);
static struct resource chipram_res = {
.name = "Chip RAM", .start = CHIP_PHYSADDR
@@ -67,6 +70,7 @@ void *amiga_chip_alloc(unsigned long siz
#endif
return (void *)ZTWO_VADDR(res->start);
}
+EXPORT_SYMBOL(amiga_chip_alloc);
/*
@@ -120,6 +124,7 @@ void amiga_chip_free(void *ptr)
}
printk("amiga_chip_free: trying to free nonexistent region at %p\n", ptr);
}
+EXPORT_SYMBOL(amiga_chip_free);
unsigned long amiga_chip_avail(void)
@@ -129,3 +134,5 @@ unsigned long amiga_chip_avail(void)
#endif
return chipavail;
}
+EXPORT_SYMBOL(amiga_chip_avail);
+
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -23,6 +23,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/zorro.h>
+#include <linux/module.h>
#include <asm/bootinfo.h>
#include <asm/setup.h>
@@ -36,13 +37,24 @@
#include <asm/io.h>
unsigned long amiga_model;
+EXPORT_SYMBOL(amiga_model);
+
unsigned long amiga_eclock;
+EXPORT_SYMBOL(amiga_eclock);
+
unsigned long amiga_masterclock;
+
unsigned long amiga_colorclock;
+EXPORT_SYMBOL(amiga_colorclock);
+
unsigned long amiga_chipset;
+EXPORT_SYMBOL(amiga_chipset);
+
unsigned char amiga_vblank;
unsigned char amiga_psfreq;
+
struct amiga_hw_present amiga_hw_present;
+EXPORT_SYMBOL(amiga_hw_present);
static char s_a500[] __initdata = "A500";
static char s_a500p[] __initdata = "A500+";
--- a/arch/m68k/amiga/pcmcia.c
+++ b/arch/m68k/amiga/pcmcia.c
@@ -15,6 +15,8 @@
#include <linux/types.h>
#include <linux/jiffies.h>
#include <linux/timer.h>
+#include <linux/module.h>
+
#include <asm/amigayle.h>
#include <asm/amipcmcia.h>
@@ -30,6 +32,7 @@ void pcmcia_reset(void)
while (time_before(jiffies, reset_start_time + 1*HZ/100));
b = gayle_reset;
}
+EXPORT_SYMBOL(pcmcia_reset);
/* copy a tuple, including tuple header. return nb bytes copied */
@@ -61,6 +64,7 @@ int pcmcia_copy_tuple(unsigned char tupl
return 0;
}
+EXPORT_SYMBOL(pcmcia_copy_tuple);
void pcmcia_program_voltage(int voltage)
{
@@ -84,6 +88,7 @@ void pcmcia_program_voltage(int voltage)
gayle.config = cfg_byte;
}
+EXPORT_SYMBOL(pcmcia_program_voltage);
void pcmcia_access_speed(int speed)
{
@@ -101,13 +106,17 @@ void pcmcia_access_speed(int speed)
cfg_byte = (cfg_byte & 0xf3) | s;
gayle.config = cfg_byte;
}
+EXPORT_SYMBOL(pcmcia_access_speed);
void pcmcia_write_enable(void)
{
gayle.cardstatus = GAYLE_CS_WR|GAYLE_CS_DA;
}
+EXPORT_SYMBOL(pcmcia_write_enable);
void pcmcia_write_disable(void)
{
gayle.cardstatus = 0;
}
+EXPORT_SYMBOL(pcmcia_write_disable);
+

View File

@ -0,0 +1,238 @@
Subject: m68k: kill arch/m68k/atari/atari_ksyms.c
From: Adrian Bunk <bunk@kernel.org>
m68k: kill arch/m68k/atari/atari_ksyms.c
EXPORT_SYMBOL's belong to the actual code.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/atari/Makefile | 2 +-
arch/m68k/atari/ataints.c | 3 +++
arch/m68k/atari/atari_ksyms.c | 35 -----------------------------------
arch/m68k/atari/atasound.c | 2 ++
arch/m68k/atari/config.c | 11 +++++++++++
arch/m68k/atari/debug.c | 6 ++++++
arch/m68k/atari/stdma.c | 5 +++++
arch/m68k/atari/stram.c | 3 +++
8 files changed, 31 insertions(+), 36 deletions(-)
--- a/arch/m68k/atari/Makefile
+++ b/arch/m68k/atari/Makefile
@@ -3,7 +3,7 @@
#
obj-y := config.o time.o debug.o ataints.o stdma.o \
- atasound.o stram.o atari_ksyms.o
+ atasound.o stram.o
ifeq ($(CONFIG_PCI),y)
obj-$(CONFIG_HADES) += hades-pci.o
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -40,6 +40,7 @@
#include <linux/kernel_stat.h>
#include <linux/init.h>
#include <linux/seq_file.h>
+#include <linux/module.h>
#include <asm/system.h>
#include <asm/traps.h>
@@ -446,6 +447,7 @@ unsigned long atari_register_vme_int(voi
free_vme_vec_bitmap |= 1 << i;
return VME_SOURCE_BASE + i;
}
+EXPORT_SYMBOL(atari_register_vme_int);
void atari_unregister_vme_int(unsigned long irq)
@@ -455,5 +457,6 @@ void atari_unregister_vme_int(unsigned l
free_vme_vec_bitmap &= ~(1 << irq);
}
}
+EXPORT_SYMBOL(atari_unregister_vme_int);
--- a/arch/m68k/atari/atari_ksyms.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <linux/module.h>
-
-#include <asm/ptrace.h>
-#include <asm/traps.h>
-#include <asm/atarihw.h>
-#include <asm/atariints.h>
-#include <asm/atarikb.h>
-#include <asm/atari_joystick.h>
-#include <asm/atari_stdma.h>
-#include <asm/atari_stram.h>
-
-extern void atari_microwire_cmd( int cmd );
-extern int atari_MFP_init_done;
-extern int atari_SCC_init_done;
-extern int atari_SCC_reset_done;
-
-EXPORT_SYMBOL(atari_mch_cookie);
-EXPORT_SYMBOL(atari_mch_type);
-EXPORT_SYMBOL(atari_hw_present);
-EXPORT_SYMBOL(atari_switches);
-EXPORT_SYMBOL(atari_dont_touch_floppy_select);
-EXPORT_SYMBOL(atari_register_vme_int);
-EXPORT_SYMBOL(atari_unregister_vme_int);
-EXPORT_SYMBOL(stdma_lock);
-EXPORT_SYMBOL(stdma_release);
-EXPORT_SYMBOL(stdma_others_waiting);
-EXPORT_SYMBOL(stdma_islocked);
-EXPORT_SYMBOL(atari_stram_alloc);
-EXPORT_SYMBOL(atari_stram_free);
-
-EXPORT_SYMBOL(atari_MFP_init_done);
-EXPORT_SYMBOL(atari_SCC_init_done);
-EXPORT_SYMBOL(atari_SCC_reset_done);
-
-EXPORT_SYMBOL(atari_microwire_cmd);
--- a/arch/m68k/atari/atasound.c
+++ b/arch/m68k/atari/atasound.c
@@ -22,6 +22,7 @@
#include <linux/fcntl.h>
#include <linux/errno.h>
#include <linux/mm.h>
+#include <linux/module.h>
#include <asm/atarihw.h>
#include <asm/system.h>
@@ -43,6 +44,7 @@ void atari_microwire_cmd (int cmd)
while( tt_microwire.mask != 0x7ff)
;
}
+EXPORT_SYMBOL(atari_microwire_cmd);
/* PSG base frequency */
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -31,6 +31,7 @@
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/vt_kern.h>
+#include <linux/module.h>
#include <asm/bootinfo.h>
#include <asm/setup.h>
@@ -43,10 +44,20 @@
#include <asm/io.h>
u_long atari_mch_cookie;
+EXPORT_SYMBOL(atari_mch_cookie);
+
u_long atari_mch_type;
+EXPORT_SYMBOL(atari_mch_type);
+
struct atari_hw_present atari_hw_present;
+EXPORT_SYMBOL(atari_hw_present);
+
u_long atari_switches;
+EXPORT_SYMBOL(atari_switches);
+
int atari_dont_touch_floppy_select;
+EXPORT_SYMBOL(atari_dont_touch_floppy_select);
+
int atari_rtc_year_offset;
/* local function prototypes */
--- a/arch/m68k/atari/debug.c
+++ b/arch/m68k/atari/debug.c
@@ -15,17 +15,23 @@
#include <linux/console.h>
#include <linux/init.h>
#include <linux/delay.h>
+#include <linux/module.h>
#include <asm/atarihw.h>
#include <asm/atariints.h>
/* Flag that Modem1 port is already initialized and used */
int atari_MFP_init_done;
+EXPORT_SYMBOL(atari_MFP_init_done);
+
/* Flag that Modem1 port is already initialized and used */
int atari_SCC_init_done;
+EXPORT_SYMBOL(atari_SCC_init_done);
+
/* Can be set somewhere, if a SCC master reset has already be done and should
* not be repeated; used by kgdb */
int atari_SCC_reset_done;
+EXPORT_SYMBOL(atari_SCC_reset_done);
static struct console atari_console_driver = {
.name = "debug",
--- a/arch/m68k/atari/stdma.c
+++ b/arch/m68k/atari/stdma.c
@@ -35,6 +35,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/wait.h>
+#include <linux/module.h>
#include <asm/atari_stdma.h>
#include <asm/atariints.h>
@@ -91,6 +92,7 @@ void stdma_lock(irq_handler_t handler, v
stdma_isr_data = data;
local_irq_restore(flags);
}
+EXPORT_SYMBOL(stdma_lock);
/*
@@ -117,6 +119,7 @@ void stdma_release(void)
local_irq_restore(flags);
}
+EXPORT_SYMBOL(stdma_release);
/*
@@ -134,6 +137,7 @@ int stdma_others_waiting(void)
{
return waitqueue_active(&stdma_wait);
}
+EXPORT_SYMBOL(stdma_others_waiting);
/*
@@ -155,6 +159,7 @@ int stdma_islocked(void)
{
return stdma_locked;
}
+EXPORT_SYMBOL(stdma_islocked);
/*
--- a/arch/m68k/atari/stram.c
+++ b/arch/m68k/atari/stram.c
@@ -20,6 +20,7 @@
#include <linux/bootmem.h>
#include <linux/mount.h>
#include <linux/blkdev.h>
+#include <linux/module.h>
#include <asm/setup.h>
#include <asm/machdep.h>
@@ -208,6 +209,7 @@ void *atari_stram_alloc(long size, const
}
return( addr );
}
+EXPORT_SYMBOL(atari_stram_alloc);
void atari_stram_free( void *addr )
@@ -237,6 +239,7 @@ void atari_stram_free( void *addr )
printk( KERN_ERR "atari_stram_free: cannot free block at %p "
"(called from %p)\n", addr, __builtin_return_address(0) );
}
+EXPORT_SYMBOL(atari_stram_free);
/* ------------------------------------------------------------------------ */

View File

@ -0,0 +1,35 @@
Subject: m68k: kill arch/m68k/hp300/ksyms.c
From: Adrian Bunk <bunk@kernel.org>
m68k: kill arch/m68k/hp300/ksyms.c
It was empty.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/hp300/Makefile | 2 +-
arch/m68k/hp300/ksyms.c | 9 ---------
2 files changed, 1 insertion(+), 10 deletions(-)
--- a/arch/m68k/hp300/Makefile
+++ b/arch/m68k/hp300/Makefile
@@ -2,4 +2,4 @@
# Makefile for Linux arch/m68k/hp300 source directory
#
-obj-y := ksyms.o config.o time.o reboot.o
+obj-y := config.o time.o reboot.o
--- a/arch/m68k/hp300/ksyms.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * linux/arch/m68k/hp300/ksyms.c
- *
- * Copyright (C) 1998 Philip Blundell <philb@gnu.org>
- *
- * This file contains the HP300-specific kernel symbols. None yet. :-)
- */
-
-#include <linux/module.h>

View File

@ -0,0 +1,56 @@
Subject: m68k: kill arch/m68k/mac/mac_ksyms.c
From: Adrian Bunk <bunk@kernel.org>
m68k: kill arch/m68k/mac/mac_ksyms.c
EXPORT_SYMBOL's belong to the actual code.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mac/Makefile | 2 +-
arch/m68k/mac/mac_ksyms.c | 8 --------
arch/m68k/mac/via.c | 5 ++++-
3 files changed, 5 insertions(+), 10 deletions(-)
--- a/arch/m68k/mac/Makefile
+++ b/arch/m68k/mac/Makefile
@@ -3,4 +3,4 @@
#
obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \
- baboon.o macboing.o debug.o misc.o mac_ksyms.o
+ baboon.o macboing.o debug.o misc.o
--- a/arch/m68k/mac/mac_ksyms.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <linux/module.h>
-#include <asm/ptrace.h>
-#include <asm/traps.h>
-
-/* Says whether we're using A/UX interrupts or not */
-extern int via_alt_mapping;
-
-EXPORT_SYMBOL(via_alt_mapping);
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -28,6 +28,7 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/ide.h>
+#include <linux/module.h>
#include <asm/bootinfo.h>
#include <asm/macintosh.h>
@@ -41,7 +42,9 @@ volatile __u8 *via1, *via2;
/* See note in mac_via.h about how this is possibly not useful */
volatile long *via_memory_bogon=(long *)&via_memory_bogon;
#endif
-int rbv_present, via_alt_mapping;
+int rbv_present;
+int via_alt_mapping;
+EXPORT_SYMBOL(via_alt_mapping);
__u8 rbv_clear;
/*

View File

@ -0,0 +1,51 @@
Subject: m68k: kill arch/m68k/mvme16x/mvme16x_ksyms.c
From: Adrian Bunk <bunk@kernel.org>
m68k: kill arch/m68k/mvme16x/mvme16x_ksyms.c
EXPORT_SYMBOL's belong to the actual code.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mvme16x/Makefile | 2 +-
arch/m68k/mvme16x/config.c | 2 ++
arch/m68k/mvme16x/mvme16x_ksyms.c | 6 ------
3 files changed, 3 insertions(+), 7 deletions(-)
--- a/arch/m68k/mvme16x/Makefile
+++ b/arch/m68k/mvme16x/Makefile
@@ -2,4 +2,4 @@
# Makefile for Linux arch/m68k/mvme16x source directory
#
-obj-y := config.o rtc.o mvme16x_ksyms.o
+obj-y := config.o rtc.o
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -25,6 +25,7 @@
#include <linux/genhd.h>
#include <linux/rtc.h>
#include <linux/interrupt.h>
+#include <linux/module.h>
#include <asm/bootinfo.h>
#include <asm/system.h>
@@ -58,6 +59,7 @@ static irq_handler_t tick_handler;
unsigned short mvme16x_config;
+EXPORT_SYMBOL(mvme16x_config);
int mvme16x_parse_bootinfo(const struct bi_record *bi)
--- a/arch/m68k/mvme16x/mvme16x_ksyms.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <linux/module.h>
-#include <linux/types.h>
-#include <asm/ptrace.h>
-#include <asm/mvme16xhw.h>
-
-EXPORT_SYMBOL(mvme16x_config);

View File

@ -0,0 +1,28 @@
Subject: mac68k: add nubus card definitions and a typo fix
From: Finn Thain <fthain@telegraphics.com.au>
Add some new card definitions and fix a typo (from Eugen Paiuc).
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/linux/nubus.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -132,10 +132,12 @@ enum nubus_drhw {
NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
- NUBUS_DRHW_RASTER_24LXI = 0x02A0, /* RasterOps 8/24 XLi */
+ NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */
NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
+ NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */
NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
+ NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */

View File

@ -0,0 +1,23 @@
Subject: mac68k: macii adb comment correction
From: Finn Thain <fthain@telegraphics.com.au>
Corrects a mistake I made in a comment.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/macintosh/via-macii.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/macintosh/via-macii.c
+++ b/drivers/macintosh/via-macii.c
@@ -111,7 +111,7 @@ static enum macii_state {
static struct adb_request *current_req; /* first request struct in the queue */
static struct adb_request *last_req; /* last request struct in the queue */
static unsigned char reply_buf[16]; /* storage for autopolled replies */
-static unsigned char *reply_ptr; /* next byte in req->data or reply_buf */
+static unsigned char *reply_ptr; /* next byte in reply_buf or req->reply */
static int reading_reply; /* store reply in reply_buf else req->reply */
static int data_index; /* index of the next byte to send from req->data */
static int reply_len; /* number of bytes received in reply_buf or req->reply */

View File

@ -0,0 +1,50 @@
Subject: mac68k: remove dead MAC_ADBKEYCODES
From: Stanislav Brabec <sbrabec@suse.cz>
It seems, that current kernel source code contains no traces of
MAC_ADBKEYCODES and no reference to keyboard_sends_linux_keycodes any
more.
Attached patch removes them from configuration files.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Kconfig | 14 --------------
arch/m68k/configs/mac_defconfig | 1 -
2 files changed, 15 deletions(-)
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -582,20 +582,6 @@ config MAC_HID
depends on INPUT_ADBHID
default y
-config MAC_ADBKEYCODES
- bool "Support for ADB raw keycodes"
- depends on INPUT_ADBHID
- help
- This provides support for sending raw ADB keycodes to console
- devices. This is the default up to 2.4.0, but in future this may be
- phased out in favor of generic Linux keycodes. If you say Y here,
- you can dynamically switch via the
- /proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes
- sysctl and with the "keyboard_sends_linux_keycodes=" kernel
- argument.
-
- If unsure, say Y here.
-
config ADB_KEYBOARD
bool "Support for ADB keyboard (old driver)"
depends on MAC && !INPUT_ADBHID
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -678,7 +678,6 @@ CONFIG_LOGO_MAC_CLUT224=y
#
CONFIG_MAC_SCC=y
CONFIG_MAC_HID=y
-CONFIG_MAC_ADBKEYCODES=y
CONFIG_SERIAL_CONSOLE=y
#

View File

@ -0,0 +1,35 @@
Subject: mac68k: remove dead code
From: Finn Thain <fthain@telegraphics.com.au>
Remove dead code.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mac/config.c | 2 --
include/asm-m68k/macintosh.h | 2 --
2 files changed, 4 deletions(-)
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -58,8 +58,6 @@ extern struct mem_info m68k_memory[NUM_M
extern struct mem_info m68k_ramdisk;
-extern char m68k_command_line[CL_SIZE];
-
void *mac_env; /* Loaded by the boot asm */
/* The phys. video addr. - might be bogus on some machines */
--- a/include/asm-m68k/macintosh.h
+++ b/include/asm-m68k/macintosh.h
@@ -14,8 +14,6 @@ extern void mac_init_IRQ(void);
extern int mac_irq_pending(unsigned int);
extern void mac_identify(void);
extern void mac_report_hardware(void);
-extern void mac_debugging_penguin(int);
-extern void mac_boom(int);
/*
* Floppy driver magic hook - probably shouldnt be here

View File

@ -0,0 +1,188 @@
Subject: nubus: kill drivers/nubus/nubus_syms.c
From: Adrian Bunk <bunk@kernel.org>
nubus: kill drivers/nubus/nubus_syms.c
EXPORT_SYMBOL's belong to the actual code.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/nubus/Makefile | 1 -
drivers/nubus/nubus.c | 13 +++++++++++++
drivers/nubus/nubus_syms.c | 28 ----------------------------
drivers/nubus/proc.c | 4 ++++
4 files changed, 17 insertions(+), 29 deletions(-)
--- a/drivers/nubus/Makefile
+++ b/drivers/nubus/Makefile
@@ -4,5 +4,4 @@
obj-y := nubus.o
-obj-$(CONFIG_MODULES) += nubus_syms.o
obj-$(CONFIG_PROC_FS) += proc.o
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -14,6 +14,7 @@
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/delay.h>
+#include <linux/module.h>
#include <asm/setup.h>
#include <asm/system.h>
#include <asm/page.h>
@@ -186,6 +187,7 @@ void nubus_get_rsrc_mem(void *dest, cons
len--;
}
}
+EXPORT_SYMBOL(nubus_get_rsrc_mem);
void nubus_get_rsrc_str(void *dest, const struct nubus_dirent* dirent,
int len)
@@ -200,6 +202,7 @@ void nubus_get_rsrc_str(void *dest, cons
len--;
}
}
+EXPORT_SYMBOL(nubus_get_rsrc_str);
int nubus_get_root_dir(const struct nubus_board* board,
struct nubus_dir* dir)
@@ -209,6 +212,7 @@ int nubus_get_root_dir(const struct nubu
dir->mask = board->lanes;
return 0;
}
+EXPORT_SYMBOL(nubus_get_root_dir);
/* This is a slyly renamed version of the above */
int nubus_get_func_dir(const struct nubus_dev* dev,
@@ -219,6 +223,7 @@ int nubus_get_func_dir(const struct nubu
dir->mask = dev->board->lanes;
return 0;
}
+EXPORT_SYMBOL(nubus_get_func_dir);
int nubus_get_board_dir(const struct nubus_board* board,
struct nubus_dir* dir)
@@ -237,6 +242,7 @@ int nubus_get_board_dir(const struct nub
return -1;
return 0;
}
+EXPORT_SYMBOL(nubus_get_board_dir);
int nubus_get_subdir(const struct nubus_dirent *ent,
struct nubus_dir *dir)
@@ -246,6 +252,7 @@ int nubus_get_subdir(const struct nubus_
dir->mask = ent->mask;
return 0;
}
+EXPORT_SYMBOL(nubus_get_subdir);
int nubus_readdir(struct nubus_dir *nd, struct nubus_dirent *ent)
{
@@ -274,12 +281,14 @@ int nubus_readdir(struct nubus_dir *nd,
ent->mask = nd->mask;
return 0;
}
+EXPORT_SYMBOL(nubus_readdir);
int nubus_rewinddir(struct nubus_dir* dir)
{
dir->ptr = dir->base;
return 0;
}
+EXPORT_SYMBOL(nubus_rewinddir);
/* Driver interface functions, more or less like in pci.c */
@@ -303,6 +312,7 @@ nubus_find_device(unsigned short categor
}
return NULL;
}
+EXPORT_SYMBOL(nubus_find_device);
struct nubus_dev*
nubus_find_type(unsigned short category,
@@ -320,6 +330,7 @@ nubus_find_type(unsigned short category,
}
return NULL;
}
+EXPORT_SYMBOL(nubus_find_type);
struct nubus_dev*
nubus_find_slot(unsigned int slot,
@@ -335,6 +346,7 @@ nubus_find_slot(unsigned int slot,
}
return NULL;
}
+EXPORT_SYMBOL(nubus_find_slot);
int
nubus_find_rsrc(struct nubus_dir* dir, unsigned char rsrc_type,
@@ -346,6 +358,7 @@ nubus_find_rsrc(struct nubus_dir* dir, u
}
return -1;
}
+EXPORT_SYMBOL(nubus_find_rsrc);
/* Initialization functions - decide which slots contain stuff worth
looking at, and print out lots and lots of information from the
--- a/drivers/nubus/nubus_syms.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Exported symbols for NuBus services
-
- (c) 1999 David Huggins-Daines <dhd@debian.org> */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/nubus.h>
-
-#ifdef CONFIG_PROC_FS
-EXPORT_SYMBOL(nubus_proc_attach_device);
-EXPORT_SYMBOL(nubus_proc_detach_device);
-#endif
-
-MODULE_LICENSE("GPL");
-
-EXPORT_SYMBOL(nubus_find_device);
-EXPORT_SYMBOL(nubus_find_type);
-EXPORT_SYMBOL(nubus_find_slot);
-EXPORT_SYMBOL(nubus_get_root_dir);
-EXPORT_SYMBOL(nubus_get_board_dir);
-EXPORT_SYMBOL(nubus_get_func_dir);
-EXPORT_SYMBOL(nubus_readdir);
-EXPORT_SYMBOL(nubus_find_rsrc);
-EXPORT_SYMBOL(nubus_rewinddir);
-EXPORT_SYMBOL(nubus_get_subdir);
-EXPORT_SYMBOL(nubus_get_rsrc_mem);
-EXPORT_SYMBOL(nubus_get_rsrc_str);
-
--- a/drivers/nubus/proc.c
+++ b/drivers/nubus/proc.c
@@ -22,6 +22,8 @@
#include <linux/nubus.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
+#include <linux/module.h>
+
#include <asm/uaccess.h>
#include <asm/byteorder.h>
@@ -140,6 +142,7 @@ int nubus_proc_attach_device(struct nubu
return 0;
}
+EXPORT_SYMBOL(nubus_proc_attach_device);
/* FIXME: this is certainly broken! */
int nubus_proc_detach_device(struct nubus_dev *dev)
@@ -154,6 +157,7 @@ int nubus_proc_detach_device(struct nubu
}
return 0;
}
+EXPORT_SYMBOL(nubus_proc_detach_device);
void __init proc_bus_nubus_add_devices(void)
{

View File

@ -1,177 +0,0 @@
Subject: [PATCH] m68k: Mac89x0 Ethernet netif updates
Cc: Jeff Garzik <jgarzik@pobox.com>, netdev@vger.kernel.org
From: Matthias Urlichs <smurf@smurf.noris.de>
Macintosh CS89x0 Ethernet: Netif updates
Addition of netif_stop_queue() before transmission by Michael Schmitz
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/Kconfig | 2 -
drivers/net/mac89x0.c | 90 +++++++++++++++++---------------------------------
2 files changed, 33 insertions(+), 59 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/Kconfig
+++ linux-m68k-2.6.21/drivers/net/Kconfig
@@ -311,7 +311,7 @@ config MAC8390
config MAC89x0
tristate "Macintosh CS89x0 based ethernet cards"
- depends on NET_ETHERNET && MAC && BROKEN
+ depends on NET_ETHERNET && MAC
---help---
Support for CS89x0 chipset based Ethernet cards. If you have a
Nubus or LC-PDS network (Ethernet) card of this type, say Y and
--- linux-m68k-2.6.21.orig/drivers/net/mac89x0.c
+++ linux-m68k-2.6.21/drivers/net/mac89x0.c
@@ -128,7 +128,7 @@ struct net_local {
extern void reset_chip(struct net_device *dev);
#endif
static int net_open(struct net_device *dev);
-static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
+static int net_send_packet(struct sk_buff *skb, struct net_device *dev);
static irqreturn_t net_interrupt(int irq, void *dev_id);
static void set_multicast_list(struct net_device *dev);
static void net_rx(struct net_device *dev);
@@ -374,56 +374,38 @@ net_open(struct net_device *dev)
static int
net_send_packet(struct sk_buff *skb, struct net_device *dev)
{
- if (dev->tbusy) {
- /* If we get here, some higher level has decided we are broken.
- There should really be a "kick me" function call instead. */
- int tickssofar = jiffies - dev->trans_start;
- if (tickssofar < 5)
- return 1;
- if (net_debug > 0) printk("%s: transmit timed out, %s?\n", dev->name,
- tx_done(dev) ? "IRQ conflict" : "network cable problem");
- /* Try to restart the adaptor. */
- dev->tbusy=0;
- dev->trans_start = jiffies;
- }
-
- /* Block a timer-based transmit from overlapping. This could better be
- done with atomic_swap(1, dev->tbusy), but set_bit() works as well. */
- if (test_and_set_bit(0, (void*)&dev->tbusy) != 0)
- printk("%s: Transmitter access conflict.\n", dev->name);
- else {
- struct net_local *lp = netdev_priv(dev);
- unsigned long flags;
-
- if (net_debug > 3)
- printk("%s: sent %d byte packet of type %x\n",
- dev->name, skb->len,
- (skb->data[ETH_ALEN+ETH_ALEN] << 8)
- | skb->data[ETH_ALEN+ETH_ALEN+1]);
-
- /* keep the upload from being interrupted, since we
- ask the chip to start transmitting before the
- whole packet has been completely uploaded. */
- local_irq_save(flags);
-
- /* initiate a transmit sequence */
- writereg(dev, PP_TxCMD, lp->send_cmd);
- writereg(dev, PP_TxLength, skb->len);
-
- /* Test to see if the chip has allocated memory for the packet */
- if ((readreg(dev, PP_BusST) & READY_FOR_TX_NOW) == 0) {
- /* Gasp! It hasn't. But that shouldn't happen since
- we're waiting for TxOk, so return 1 and requeue this packet. */
- local_irq_restore(flags);
- return 1;
- }
+ struct net_local *lp = netdev_priv(dev);
+ unsigned long flags;
- /* Write the contents of the packet */
- memcpy_toio(dev->mem_start + PP_TxFrame, skb->data, skb->len+1);
+ if (net_debug > 3)
+ printk("%s: sent %d byte packet of type %x\n",
+ dev->name, skb->len,
+ (skb->data[ETH_ALEN+ETH_ALEN] << 8)
+ | skb->data[ETH_ALEN+ETH_ALEN+1]);
+
+ /* keep the upload from being interrupted, since we
+ ask the chip to start transmitting before the
+ whole packet has been completely uploaded. */
+ local_irq_save(flags);
+ netif_stop_queue(dev);
+ /* initiate a transmit sequence */
+ writereg(dev, PP_TxCMD, lp->send_cmd);
+ writereg(dev, PP_TxLength, skb->len);
+
+ /* Test to see if the chip has allocated memory for the packet */
+ if ((readreg(dev, PP_BusST) & READY_FOR_TX_NOW) == 0) {
+ /* Gasp! It hasn't. But that shouldn't happen since
+ we're waiting for TxOk, so return 1 and requeue this packet. */
local_irq_restore(flags);
- dev->trans_start = jiffies;
+ return 1;
}
+
+ /* Write the contents of the packet */
+ memcpy((void *)(dev->mem_start + PP_TxFrame), skb->data, skb->len+1);
+
+ local_irq_restore(flags);
+ dev->trans_start = jiffies;
dev_kfree_skb (skb);
return 0;
@@ -441,9 +423,6 @@ static irqreturn_t net_interrupt(int irq
printk ("net_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
- if (dev->interrupt)
- printk("%s: Re-entering the interrupt handler.\n", dev->name);
- dev->interrupt = 1;
ioaddr = dev->base_addr;
lp = netdev_priv(dev);
@@ -464,8 +443,7 @@ static irqreturn_t net_interrupt(int irq
break;
case ISQ_TRANSMITTER_EVENT:
lp->stats.tx_packets++;
- dev->tbusy = 0;
- mark_bh(NET_BH); /* Inform upper layers. */
+ netif_wake_queue(dev);
if ((status & TX_OK) == 0) lp->stats.tx_errors++;
if (status & TX_LOST_CRS) lp->stats.tx_carrier_errors++;
if (status & TX_SQE_ERROR) lp->stats.tx_heartbeat_errors++;
@@ -479,8 +457,7 @@ static irqreturn_t net_interrupt(int irq
That shouldn't happen since we only ever
load one packet. Shrug. Do the right
thing anyway. */
- dev->tbusy = 0;
- mark_bh(NET_BH); /* Inform upper layers. */
+ netif_wake_queue(dev);
}
if (status & TX_UNDERRUN) {
if (net_debug > 0) printk("%s: transmit underrun\n", dev->name);
@@ -497,7 +474,6 @@ static irqreturn_t net_interrupt(int irq
break;
}
}
- dev->interrupt = 0;
return IRQ_HANDLED;
}
@@ -532,7 +508,7 @@ net_rx(struct net_device *dev)
skb_put(skb, length);
skb->dev = dev;
- memcpy_fromio(skb->data, dev->mem_start + PP_RxFrame, length);
+ memcpy(skb->data, (void *)(dev->mem_start + PP_RxFrame), length);
if (net_debug > 3)printk("%s: received %d byte packet of type %x\n",
dev->name, length,
@@ -611,8 +587,6 @@ static void set_multicast_list(struct ne
static int set_mac_address(struct net_device *dev, void *addr)
{
int i;
- if (dev->start)
- return -EBUSY;
printk("%s: Setting MAC address to ", dev->name);
for (i = 0; i < 6; i++)
printk(" %2.2x", dev->dev_addr[i] = ((unsigned char *)addr)[i]);

View File

@ -1,23 +0,0 @@
To: linus, akpm, B.Zolnierkiewicz@elka.pw.edu.pl
Cc: lkml
Subject: [PATCH] m68k IDE compiler bug
From: Roman Zippel <zippel@linux-m68k.org>
IDE: Avoid compiler bug in gcc 3.2 (from Roman Zippel)
---
include/linux/ide.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-m68k-2.6.21.orig/include/linux/ide.h
+++ linux-m68k-2.6.21/include/linux/ide.h
@@ -513,7 +513,7 @@ typedef union {
* sense_key : Sense key of the last failed packet command
*/
typedef union {
- unsigned all :8;
+ u8 all;
struct {
#if defined(__LITTLE_ENDIAN_BITFIELD)
unsigned ili :1;

View File

@ -1,30 +0,0 @@
To: linus, akpm
Cc: lkml
Subject: [PATCH] M68k SERIAL_PORT_DFNS only if CONFIG_ISA
From: Kars de Jong <jongk@linux-m68k.org>
M68k serial: Only define SERIAL_PORT_DFNS when CONFIG_ISA is defined. Otherwise
the first 4 slots in the 8250 driver are unavailable on non-ISA machines.
Signed-off-by: Kars de Jong <jongk@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/asm-m68k/serial.h | 2 ++
1 file changed, 2 insertions(+)
--- linux-m68k-2.6.21.orig/include/asm-m68k/serial.h
+++ linux-m68k-2.6.21/include/asm-m68k/serial.h
@@ -25,9 +25,11 @@
#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
#endif
+#ifdef CONFIG_ISA
#define SERIAL_PORT_DFNS \
/* UART CLK PORT IRQ FLAGS */ \
{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
+#endif

View File

@ -1,37 +0,0 @@
Subject: [PATCH] Allow arch to initialize arch field of the module structure
From: Roman Zippel <zippel@linux-m68k.org>
This will later allow an arch to add module specific information via
linker generated tables instead of poking directly in the module object
structure.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/linux/module.h | 3 +++
scripts/mod/modpost.c | 1 +
2 files changed, 4 insertions(+)
--- linux-m68k-2.6.21.orig/include/linux/module.h
+++ linux-m68k-2.6.21/include/linux/module.h
@@ -356,6 +356,9 @@ struct module
keeping pointers to this stuff */
char *args;
};
+#ifndef MODULE_ARCH_INIT
+#define MODULE_ARCH_INIT {}
+#endif
/* FIXME: It'd be nice to isolate modules during init, too, so they
aren't used before they (may) fail. But presently too much code
--- linux-m68k-2.6.21.orig/scripts/mod/modpost.c
+++ linux-m68k-2.6.21/scripts/mod/modpost.c
@@ -1249,6 +1249,7 @@ static void add_header(struct buffer *b,
buf_printf(b, "#ifdef CONFIG_MODULE_UNLOAD\n"
" .exit = cleanup_module,\n"
"#endif\n");
+ buf_printf(b, " .arch = MODULE_ARCH_INIT,\n");
buf_printf(b, "};\n");
}

View File

@ -1,43 +0,0 @@
Subject: [PATCH] Wrap access to thread_info
From: Roman Zippel <zippel@linux-m68k.org>
Wrap direct thread_info access
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
kernel/mutex.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- linux-m68k-2.6.21.orig/kernel/mutex.c
+++ linux-m68k-2.6.21/kernel/mutex.c
@@ -133,7 +133,7 @@ __mutex_lock_common(struct mutex *lock,
debug_mutex_lock_common(lock, &waiter);
mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
- debug_mutex_add_waiter(lock, &waiter, task->thread_info);
+ debug_mutex_add_waiter(lock, &waiter, task_thread_info(task));
/* add waiting tasks to the end of the waitqueue (FIFO): */
list_add_tail(&waiter.list, &lock->wait_list);
@@ -159,7 +159,7 @@ __mutex_lock_common(struct mutex *lock,
*/
if (unlikely(state == TASK_INTERRUPTIBLE &&
signal_pending(task))) {
- mutex_remove_waiter(lock, &waiter, task->thread_info);
+ mutex_remove_waiter(lock, &waiter, task_thread_info(task));
mutex_release(&lock->dep_map, 1, _RET_IP_);
spin_unlock_mutex(&lock->wait_lock, flags);
@@ -175,8 +175,8 @@ __mutex_lock_common(struct mutex *lock,
}
/* got the lock - rejoice! */
- mutex_remove_waiter(lock, &waiter, task->thread_info);
- debug_mutex_set_owner(lock, task->thread_info);
+ mutex_remove_waiter(lock, &waiter, task_thread_info(task));
+ debug_mutex_set_owner(lock, task_thread_info(task));
/* set it to 0 if there are no waiters left: */
if (likely(list_empty(&lock->wait_list)))

View File

@ -1,214 +0,0 @@
Subject: [PATCH] m68k: runtime patching infrastructure
From: Roman Zippel <zippel@linux-m68k.org>
Add the basic infrastructure to allow runtime patching of kernel and
modules to optimize a few functions with parameters, which are only
calculated once during bootup and are otherwise constant.
Use this for the conversion between virtual and physical addresses.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Makefile | 1 +
arch/m68k/kernel/module.c | 24 +++++++++++++++++++++++-
arch/m68k/kernel/module.lds | 7 +++++++
arch/m68k/kernel/vmlinux-std.lds | 5 +++++
arch/m68k/kernel/vmlinux-sun3.lds | 5 +++++
arch/m68k/mm/motorola.c | 3 +++
include/asm-m68k/module.h | 33 ++++++++++++++++++++++++++++++++-
include/asm-m68k/page.h | 29 ++++++++++++++++++++++++++---
8 files changed, 102 insertions(+), 5 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/Makefile
+++ linux-m68k-2.6.21/arch/m68k/Makefile
@@ -19,6 +19,7 @@ COMPILE_ARCH = $(shell uname -m)
# override top level makefile
AS += -m68020
LDFLAGS := -m m68kelf
+LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
ifneq ($(COMPILE_ARCH),$(ARCH))
# prefix for cross-compiling binaries
CROSS_COMPILE = m68k-linux-gnu-
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/module.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/module.c
@@ -1,3 +1,9 @@
+/*
+ * 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.
+ */
+
#include <linux/moduleloader.h>
#include <linux/elf.h>
#include <linux/vmalloc.h>
@@ -116,10 +122,26 @@ int apply_relocate_add(Elf32_Shdr *sechd
return 0;
}
+void module_fixup(struct module *mod, struct m68k_fixup_info *start,
+ struct m68k_fixup_info *end)
+{
+ struct m68k_fixup_info *fixup;
+
+ for (fixup = start; fixup < end; fixup++) {
+ switch (fixup->type) {
+ case m68k_fixup_memoffset:
+ *(u32 *)fixup->addr = m68k_memoffset;
+ break;
+ }
+ }
+}
+
int module_finalize(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
- struct module *me)
+ struct module *mod)
{
+ module_fixup(mod, mod->arch.fixup_start, mod->arch.fixup_end);
+
return 0;
}
--- /dev/null
+++ linux-m68k-2.6.21/arch/m68k/kernel/module.lds
@@ -0,0 +1,7 @@
+SECTIONS {
+ .m68k_fixup : {
+ __start_fixup = .;
+ *(.m68k_fixup)
+ __stop_fixup = .;
+ }
+}
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/vmlinux-std.lds
+++ linux-m68k-2.6.21/arch/m68k/kernel/vmlinux-std.lds
@@ -60,6 +60,11 @@ SECTIONS
__con_initcall_start = .;
.con_initcall.init : { *(.con_initcall.init) }
__con_initcall_end = .;
+ .m68k_fixup : {
+ __start_fixup = .;
+ *(.m68k_fixup)
+ __stop_fixup = .;
+ }
SECURITY_INIT
#ifdef CONFIG_BLK_DEV_INITRD
. = ALIGN(8192);
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/vmlinux-sun3.lds
+++ linux-m68k-2.6.21/arch/m68k/kernel/vmlinux-sun3.lds
@@ -54,6 +54,11 @@ __init_begin = .;
__con_initcall_start = .;
.con_initcall.init : { *(.con_initcall.init) }
__con_initcall_end = .;
+ .m68k_fixup : {
+ __start_fixup = .;
+ *(.m68k_fixup)
+ __stop_fixup = .;
+ }
SECURITY_INIT
#ifdef CONFIG_BLK_DEV_INITRD
. = ALIGN(8192);
--- linux-m68k-2.6.21.orig/arch/m68k/mm/motorola.c
+++ linux-m68k-2.6.21/arch/m68k/mm/motorola.c
@@ -222,6 +222,9 @@ void __init paging_init(void)
pgprot_val(protection_map[i]) |= _PAGE_CACHE040;
}
+ module_fixup(NULL, __start_fixup, __stop_fixup);
+ flush_icache();
+
/*
* Map the physical memory available into the kernel virtual
* address space. It may allocate some memory for page
--- linux-m68k-2.6.21.orig/include/asm-m68k/module.h
+++ linux-m68k-2.6.21/include/asm-m68k/module.h
@@ -1,7 +1,38 @@
#ifndef _ASM_M68K_MODULE_H
#define _ASM_M68K_MODULE_H
-struct mod_arch_specific { };
+
+struct mod_arch_specific {
+ struct m68k_fixup_info *fixup_start, *fixup_end;
+};
+
+#define MODULE_ARCH_INIT { \
+ .fixup_start = __start_fixup, \
+ .fixup_end = __stop_fixup, \
+}
+
#define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym
#define Elf_Ehdr Elf32_Ehdr
+
+
+enum m68k_fixup_type {
+ m68k_fixup_memoffset,
+};
+
+struct m68k_fixup_info {
+ enum m68k_fixup_type type;
+ void *addr;
+};
+
+#define m68k_fixup(type, addr) \
+ " .section \".m68k_fixup\",\"aw\"\n" \
+ " .long " #type "," #addr "\n" \
+ " .previous\n"
+
+extern struct m68k_fixup_info __start_fixup[], __stop_fixup[];
+
+struct module;
+extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
+ struct m68k_fixup_info *end);
+
#endif /* _ASM_M68K_MODULE_H */
--- linux-m68k-2.6.21.orig/include/asm-m68k/page.h
+++ linux-m68k-2.6.21/include/asm-m68k/page.h
@@ -27,6 +27,8 @@
#ifndef __ASSEMBLY__
+#include <asm/module.h>
+
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
#define free_user_page(page, addr) free_page(addr)
@@ -114,14 +116,35 @@ typedef struct { unsigned long pgprot; }
#ifndef __ASSEMBLY__
+extern unsigned long m68k_memoffset;
+
#ifndef CONFIG_SUN3
#define WANT_PAGE_VIRTUAL
#ifdef CONFIG_SINGLE_MEMORY_CHUNK
-extern unsigned long m68k_memoffset;
-#define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset)
-#define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset))
+static inline unsigned long ___pa(void *vaddr)
+{
+ unsigned long paddr;
+ asm (
+ "1: addl #0,%0\n"
+ m68k_fixup(%c2, 1b+2)
+ : "=r" (paddr)
+ : "0" (vaddr), "i" (m68k_fixup_memoffset));
+ return paddr;
+}
+#define __pa(vaddr) ___pa((void *)(vaddr))
+static inline void *__va(unsigned long paddr)
+{
+ void *vaddr;
+ asm (
+ "1: subl #0,%0\n"
+ m68k_fixup(%c2, 1b+2)
+ : "=r" (vaddr)
+ : "0" (paddr), "i" (m68k_fixup_memoffset));
+ return vaddr;
+}
+
#else
#define __pa(vaddr) virt_to_phys((void *)(vaddr))
#define __va(paddr) phys_to_virt((unsigned long)(paddr))

View File

@ -1,868 +0,0 @@
To: linus, akpm
Cc: lkml
Subject: [PATCH] m68k: Discontinuous memory support
From: Roman Zippel <zippel@linux-m68k.org>
Fix support for discontinuous memory
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Kconfig | 13 +++
arch/m68k/kernel/module.c | 3
arch/m68k/kernel/setup.c | 37 ++---------
arch/m68k/mm/init.c | 119 +++++++++++++++++++++++-------------
arch/m68k/mm/memory.c | 73 ----------------------
arch/m68k/mm/motorola.c | 102 +++++++++++++++++++++---------
arch/m68k/sun3/config.c | 2
include/asm-m68k/mmzone.h | 9 ++
include/asm-m68k/module.h | 1
include/asm-m68k/motorola_pgtable.h | 10 +--
include/asm-m68k/page.h | 52 ++++++++++++---
include/asm-m68k/pgalloc.h | 3
include/asm-m68k/pgtable.h | 17 -----
include/asm-m68k/sun3_pgtable.h | 4 -
include/asm-m68k/virtconvert.h | 48 +++-----------
mm/page_alloc.c | 2
16 files changed, 247 insertions(+), 248 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/Kconfig
+++ linux-m68k-2.6.21/arch/m68k/Kconfig
@@ -355,8 +355,9 @@ config RMW_INSNS
adventurous.
config SINGLE_MEMORY_CHUNK
- bool "Use one physical chunk of memory only"
- depends on ADVANCED && !SUN3
+ bool "Use one physical chunk of memory only" if ADVANCED && !SUN3
+ default y if SUN3
+ select NEED_MULTIPLE_NODES
help
Ignore all but the first contiguous chunk of physical memory for VM
purposes. This will save a few bytes kernel size and may speed up
@@ -377,6 +378,14 @@ config 060_WRITETHROUGH
is hardwired on. The 53c710 SCSI driver is known to suffer from
this problem.
+config ARCH_DISCONTIGMEM_ENABLE
+ def_bool !SINGLE_MEMORY_CHUNK
+
+config NODES_SHIFT
+ int
+ default "3"
+ depends on !SINGLE_MEMORY_CHUNK
+
source "mm/Kconfig"
endmenu
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/module.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/module.c
@@ -132,6 +132,9 @@ void module_fixup(struct module *mod, st
case m68k_fixup_memoffset:
*(u32 *)fixup->addr = m68k_memoffset;
break;
+ case m68k_fixup_vnode_shift:
+ *(u16 *)fixup->addr += m68k_virt_to_node_shift;
+ break;
}
}
}
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/setup.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/setup.c
@@ -60,14 +60,12 @@ extern unsigned long availmem;
int m68k_num_memory;
int m68k_realnum_memory;
EXPORT_SYMBOL(m68k_realnum_memory);
-#ifdef CONFIG_SINGLE_MEMORY_CHUNK
unsigned long m68k_memoffset;
EXPORT_SYMBOL(m68k_memoffset);
-#endif
struct mem_info m68k_memory[NUM_MEMINFO];
EXPORT_SYMBOL(m68k_memory);
-static struct mem_info m68k_ramdisk;
+struct mem_info m68k_ramdisk;
static char m68k_command_line[CL_SIZE];
@@ -208,9 +206,6 @@ static void __init m68k_parse_bootinfo(c
void __init setup_arch(char **cmdline_p)
{
extern int _etext, _edata, _end;
-#ifndef CONFIG_SUN3
- unsigned long endmem, startmem;
-#endif
int i;
/* The bootinfo is located right after the kernel bss */
@@ -320,30 +315,16 @@ void __init setup_arch(char **cmdline_p)
panic("No configuration setup");
}
-#ifndef CONFIG_SUN3
- startmem= m68k_memory[0].addr;
- endmem = startmem + m68k_memory[0].size;
- high_memory = (void *)PAGE_OFFSET;
- for (i = 0; i < m68k_num_memory; i++) {
- m68k_memory[i].size &= MASK_256K;
- if (m68k_memory[i].addr < startmem)
- startmem = m68k_memory[i].addr;
- if (m68k_memory[i].addr+m68k_memory[i].size > endmem)
- endmem = m68k_memory[i].addr+m68k_memory[i].size;
- high_memory += m68k_memory[i].size;
- }
-
- availmem += init_bootmem_node(NODE_DATA(0), availmem >> PAGE_SHIFT,
- startmem >> PAGE_SHIFT, endmem >> PAGE_SHIFT);
-
- for (i = 0; i < m68k_num_memory; i++)
- free_bootmem(m68k_memory[i].addr, m68k_memory[i].size);
-
- reserve_bootmem(m68k_memory[0].addr, availmem - m68k_memory[0].addr);
+ paging_init();
+#ifndef CONFIG_SUN3
+ for (i = 1; i < m68k_num_memory; i++)
+ free_bootmem_node(NODE_DATA(i), m68k_memory[i].addr,
+ m68k_memory[i].size);
#ifdef CONFIG_BLK_DEV_INITRD
if (m68k_ramdisk.size) {
- reserve_bootmem(m68k_ramdisk.addr, m68k_ramdisk.size);
+ reserve_bootmem_node(__virt_to_node(phys_to_virt(m68k_ramdisk.addr)),
+ m68k_ramdisk.addr, m68k_ramdisk.size);
initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
initrd_end = initrd_start + m68k_ramdisk.size;
printk("initrd: %08lx - %08lx\n", initrd_start, initrd_end);
@@ -362,8 +343,6 @@ void __init setup_arch(char **cmdline_p)
#endif /* !CONFIG_SUN3 */
- paging_init();
-
/* set ISA defs early as possible */
#if defined(CONFIG_ISA) && defined(MULTI_ISA)
#if defined(CONFIG_Q40)
--- linux-m68k-2.6.21.orig/arch/m68k/mm/init.c
+++ linux-m68k-2.6.21/arch/m68k/mm/init.c
@@ -7,6 +7,7 @@
* to motorola.c and sun3mmu.c
*/
+#include <linux/module.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/mm.h>
@@ -31,6 +32,37 @@
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
+static bootmem_data_t __initdata bootmem_data[MAX_NUMNODES];
+
+pg_data_t pg_data_map[MAX_NUMNODES];
+EXPORT_SYMBOL(pg_data_map);
+
+int m68k_virt_to_node_shift;
+
+#ifndef CONFIG_SINGLE_MEMORY_CHUNK
+pg_data_t *pg_data_table[65];
+EXPORT_SYMBOL(pg_data_table);
+#endif
+
+void m68k_setup_node(int node)
+{
+#ifndef CONFIG_SINGLE_MEMORY_CHUNK
+ struct mem_info *info = m68k_memory + node;
+ int i, end;
+
+ i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift();
+ end = (unsigned long)phys_to_virt(info->addr + info->size - 1) >> __virt_to_node_shift();
+ for (; i <= end; i++) {
+ if (pg_data_table[i])
+ printk("overlap at %u for chunk %u\n", i, node);
+ pg_data_table[i] = pg_data_map + node;
+ }
+#endif
+ pg_data_map[node].bdata = bootmem_data + node;
+ node_set_online(node);
+}
+
+
/*
* ZERO_PAGE is a special page that is used for zero-initialized
* data and COW.
@@ -40,52 +72,51 @@ void *empty_zero_page;
void show_mem(void)
{
- unsigned long i;
- int free = 0, total = 0, reserved = 0, shared = 0;
- int cached = 0;
-
- printk("\nMem-info:\n");
- show_free_areas();
- printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
- i = max_mapnr;
- while (i-- > 0) {
- total++;
- if (PageReserved(mem_map+i))
- reserved++;
- else if (PageSwapCache(mem_map+i))
- cached++;
- else if (!page_count(mem_map+i))
- free++;
- else
- shared += page_count(mem_map+i) - 1;
- }
- printk("%d pages of RAM\n",total);
- printk("%d free pages\n",free);
- printk("%d reserved pages\n",reserved);
- printk("%d pages shared\n",shared);
- printk("%d pages swap cached\n",cached);
+ pg_data_t *pgdat;
+ int free = 0, total = 0, reserved = 0, shared = 0;
+ int cached = 0;
+ int i;
+
+ printk("\nMem-info:\n");
+ show_free_areas();
+ printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
+ for_each_online_pgdat(pgdat) {
+ for (i = 0; i < pgdat->node_spanned_pages; i++) {
+ struct page *page = pgdat->node_mem_map + i;
+ total++;
+ if (PageReserved(page))
+ reserved++;
+ else if (PageSwapCache(page))
+ cached++;
+ else if (!page_count(page))
+ free++;
+ else
+ shared += page_count(page) - 1;
+ }
+ }
+ printk("%d pages of RAM\n",total);
+ printk("%d free pages\n",free);
+ printk("%d reserved pages\n",reserved);
+ printk("%d pages shared\n",shared);
+ printk("%d pages swap cached\n",cached);
}
extern void init_pointer_table(unsigned long ptable);
/* References to section boundaries */
-extern char _text, _etext, _edata, __bss_start, _end;
-extern char __init_begin, __init_end;
+extern char _text[], _etext[];
+extern char __init_begin[], __init_end[];
extern pmd_t *zero_pgtable;
void __init mem_init(void)
{
+ pg_data_t *pgdat;
int codepages = 0;
int datapages = 0;
int initpages = 0;
- unsigned long tmp;
-#ifndef CONFIG_SUN3
int i;
-#endif
-
- max_mapnr = num_physpages = (((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT);
#ifdef CONFIG_ATARI
if (MACH_IS_ATARI)
@@ -93,19 +124,25 @@ void __init mem_init(void)
#endif
/* this will put all memory onto the freelists */
- totalram_pages = free_all_bootmem();
-
- for (tmp = PAGE_OFFSET ; tmp < (unsigned long)high_memory; tmp += PAGE_SIZE) {
- if (PageReserved(virt_to_page(tmp))) {
- if (tmp >= (unsigned long)&_text
- && tmp < (unsigned long)&_etext)
+ totalram_pages = num_physpages = 0;
+ for_each_online_pgdat(pgdat) {
+ num_physpages += pgdat->node_present_pages;
+
+ totalram_pages += free_all_bootmem_node(pgdat);
+ for (i = 0; i < pgdat->node_spanned_pages; i++) {
+ struct page *page = pgdat->node_mem_map + i;
+ char *addr = page_to_virt(page);
+
+ if (!PageReserved(page))
+ continue;
+ if (addr >= _text &&
+ addr < _etext)
codepages++;
- else if (tmp >= (unsigned long) &__init_begin
- && tmp < (unsigned long) &__init_end)
+ else if (addr >= __init_begin &&
+ addr < __init_end)
initpages++;
else
datapages++;
- continue;
}
}
@@ -124,7 +161,7 @@ void __init mem_init(void)
printk("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n",
(unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
- max_mapnr << (PAGE_SHIFT-10),
+ totalram_pages << (PAGE_SHIFT-10),
codepages << (PAGE_SHIFT-10),
datapages << (PAGE_SHIFT-10),
initpages << (PAGE_SHIFT-10));
--- linux-m68k-2.6.21.orig/arch/m68k/mm/memory.c
+++ linux-m68k-2.6.21/arch/m68k/mm/memory.c
@@ -127,67 +127,6 @@ int free_pointer_table (pmd_t *ptable)
return 0;
}
-#ifdef DEBUG_INVALID_PTOV
-int mm_inv_cnt = 5;
-#endif
-
-#ifndef CONFIG_SINGLE_MEMORY_CHUNK
-/*
- * The following two routines map from a physical address to a kernel
- * virtual address and vice versa.
- */
-unsigned long mm_vtop(unsigned long vaddr)
-{
- int i=0;
- unsigned long voff = (unsigned long)vaddr - PAGE_OFFSET;
-
- do {
- if (voff < m68k_memory[i].size) {
-#ifdef DEBUGPV
- printk ("VTOP(%p)=%lx\n", vaddr,
- m68k_memory[i].addr + voff);
-#endif
- return m68k_memory[i].addr + voff;
- }
- voff -= m68k_memory[i].size;
- } while (++i < m68k_num_memory);
-
- /* As a special case allow `__pa(high_memory)'. */
- if (voff == 0)
- return m68k_memory[i-1].addr + m68k_memory[i-1].size;
-
- return -1;
-}
-EXPORT_SYMBOL(mm_vtop);
-
-unsigned long mm_ptov (unsigned long paddr)
-{
- int i = 0;
- unsigned long poff, voff = PAGE_OFFSET;
-
- do {
- poff = paddr - m68k_memory[i].addr;
- if (poff < m68k_memory[i].size) {
-#ifdef DEBUGPV
- printk ("PTOV(%lx)=%lx\n", paddr, poff + voff);
-#endif
- return poff + voff;
- }
- voff += m68k_memory[i].size;
- } while (++i < m68k_num_memory);
-
-#ifdef DEBUG_INVALID_PTOV
- if (mm_inv_cnt > 0) {
- mm_inv_cnt--;
- printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n",
- paddr, __builtin_return_address(0));
- }
-#endif
- return -1;
-}
-EXPORT_SYMBOL(mm_ptov);
-#endif
-
/* invalidate page in both caches */
static inline void clear040(unsigned long paddr)
{
@@ -354,15 +293,3 @@ void cache_push (unsigned long paddr, in
}
EXPORT_SYMBOL(cache_push);
-#ifndef CONFIG_SINGLE_MEMORY_CHUNK
-int mm_end_of_chunk (unsigned long addr, int len)
-{
- int i;
-
- for (i = 0; i < m68k_num_memory; i++)
- if (m68k_memory[i].addr + m68k_memory[i].size == addr + len)
- return 1;
- return 0;
-}
-EXPORT_SYMBOL(mm_end_of_chunk);
-#endif
--- linux-m68k-2.6.21.orig/arch/m68k/mm/motorola.c
+++ linux-m68k-2.6.21/arch/m68k/mm/motorola.c
@@ -43,6 +43,12 @@ unsigned long mm_cachebits;
EXPORT_SYMBOL(mm_cachebits);
#endif
+/* size of memory already mapped in head.S */
+#define INIT_MAPPED_SIZE (4UL<<20)
+
+extern unsigned long availmem;
+extern struct mem_info m68k_ramdisk;
+
static pte_t * __init kernel_page_table(void)
{
pte_t *ptablep;
@@ -98,19 +104,20 @@ static pmd_t * __init kernel_ptr_table(v
return last_pgtable;
}
-static unsigned long __init
-map_chunk (unsigned long addr, long size)
+static void __init map_node(int node)
{
#define PTRTREESIZE (256*1024)
#define ROOTTREESIZE (32*1024*1024)
- static unsigned long virtaddr = PAGE_OFFSET;
- unsigned long physaddr;
+ unsigned long physaddr, virtaddr, size;
pgd_t *pgd_dir;
pmd_t *pmd_dir;
pte_t *pte_dir;
- physaddr = (addr | m68k_supervisor_cachemode |
- _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY);
+ size = m68k_memory[node].size;
+ physaddr = m68k_memory[node].addr;
+ virtaddr = (unsigned long)phys_to_virt(physaddr);
+ physaddr |= m68k_supervisor_cachemode |
+ _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY;
if (CPU_IS_040_OR_060)
physaddr |= _PAGE_GLOBAL040;
@@ -190,8 +197,6 @@ map_chunk (unsigned long addr, long size
#ifdef DEBUG
printk("\n");
#endif
-
- return virtaddr;
}
/*
@@ -200,15 +205,16 @@ map_chunk (unsigned long addr, long size
*/
void __init paging_init(void)
{
- int chunk;
- unsigned long mem_avail = 0;
unsigned long zones_size[MAX_NR_ZONES] = { 0, };
+ unsigned long min_addr, max_addr;
+ unsigned long addr, size, end;
+ int i;
#ifdef DEBUG
{
extern unsigned long availmem;
- printk ("start of paging_init (%p, %lx, %lx, %lx)\n",
- kernel_pg_dir, availmem, start_mem, end_mem);
+ printk ("start of paging_init (%p, %lx)\n",
+ kernel_pg_dir, availmem);
}
#endif
@@ -222,27 +228,62 @@ void __init paging_init(void)
pgprot_val(protection_map[i]) |= _PAGE_CACHE040;
}
+ min_addr = m68k_memory[0].addr;
+ max_addr = min_addr + m68k_memory[0].size;
+ for (i = 1; i < m68k_num_memory;) {
+ if (m68k_memory[i].addr < min_addr) {
+ printk("Ignoring memory chunk at 0x%lx:0x%lx before the first chunk\n",
+ m68k_memory[i].addr, m68k_memory[i].size);
+ printk("Fix your bootloader or use a memfile to make use of this area!\n");
+ m68k_num_memory--;
+ memmove(m68k_memory + i, m68k_memory + i + 1,
+ (m68k_num_memory - i) * sizeof(struct mem_info));
+ continue;
+ }
+ addr = m68k_memory[i].addr + m68k_memory[i].size;
+ if (addr > max_addr)
+ max_addr = addr;
+ i++;
+ }
+ m68k_memoffset = min_addr - PAGE_OFFSET;
+ m68k_virt_to_node_shift = fls(max_addr - min_addr - 1) - 6;
+
module_fixup(NULL, __start_fixup, __stop_fixup);
flush_icache();
+ high_memory = phys_to_virt(max_addr);
+
+ min_low_pfn = availmem >> PAGE_SHIFT;
+ max_low_pfn = max_addr >> PAGE_SHIFT;
+
+ for (i = 0; i < m68k_num_memory; i++) {
+ addr = m68k_memory[i].addr;
+ end = addr + m68k_memory[i].size;
+ m68k_setup_node(i);
+ availmem = PAGE_ALIGN(availmem);
+ availmem += init_bootmem_node(NODE_DATA(i),
+ availmem >> PAGE_SHIFT,
+ addr >> PAGE_SHIFT,
+ end >> PAGE_SHIFT);
+ }
+
/*
* Map the physical memory available into the kernel virtual
- * address space. It may allocate some memory for page
- * tables and thus modify availmem.
+ * address space. First initialize the bootmem allocator with
+ * the memory we already mapped, so map_node() has something
+ * to allocate.
*/
+ addr = m68k_memory[0].addr;
+ size = m68k_memory[0].size;
+ free_bootmem_node(NODE_DATA(0), availmem, min(INIT_MAPPED_SIZE, size) - (availmem - addr));
+ map_node(0);
+ if (size > INIT_MAPPED_SIZE)
+ free_bootmem_node(NODE_DATA(0), addr + INIT_MAPPED_SIZE, size - INIT_MAPPED_SIZE);
- for (chunk = 0; chunk < m68k_num_memory; chunk++) {
- mem_avail = map_chunk (m68k_memory[chunk].addr,
- m68k_memory[chunk].size);
-
- }
+ for (i = 1; i < m68k_num_memory; i++)
+ map_node(i);
flush_tlb_all();
-#ifdef DEBUG
- printk ("memory available is %ldKB\n", mem_avail >> 10);
- printk ("start_mem is %#lx\nvirtual_end is %#lx\n",
- start_mem, end_mem);
-#endif
/*
* initialize the bad page table and bad page to point
@@ -259,14 +300,11 @@ void __init paging_init(void)
#ifdef DEBUG
printk ("before free_area_init\n");
#endif
- zones_size[ZONE_DMA] = (mach_max_dma_address < (unsigned long)high_memory ?
- (mach_max_dma_address+1) : (unsigned long)high_memory);
- zones_size[ZONE_NORMAL] = (unsigned long)high_memory - zones_size[0];
-
- zones_size[ZONE_DMA] = (zones_size[ZONE_DMA] - PAGE_OFFSET) >> PAGE_SHIFT;
- zones_size[ZONE_NORMAL] >>= PAGE_SHIFT;
-
- free_area_init(zones_size);
+ for (i = 0; i < m68k_num_memory; i++) {
+ zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
+ free_area_init_node(i, pg_data_map + i, zones_size,
+ m68k_memory[i].addr >> PAGE_SHIFT, NULL);
+ }
}
extern char __init_begin, __init_end;
--- linux-m68k-2.6.21.orig/arch/m68k/sun3/config.c
+++ linux-m68k-2.6.21/arch/m68k/sun3/config.c
@@ -21,6 +21,7 @@
#include <asm/contregs.h>
#include <asm/movs.h>
#include <asm/pgtable.h>
+#include <asm/pgalloc.h>
#include <asm/sun3-head.h>
#include <asm/sun3mmu.h>
#include <asm/rtc.h>
@@ -127,6 +128,7 @@ void __init sun3_bootmem_alloc(unsigned
high_memory = (void *)memory_end;
availmem = memory_start;
+ m68k_setup_node(0);
availmem += init_bootmem_node(NODE_DATA(0), start_page, 0, num_pages);
availmem = (availmem + (PAGE_SIZE-1)) & PAGE_MASK;
--- /dev/null
+++ linux-m68k-2.6.21/include/asm-m68k/mmzone.h
@@ -0,0 +1,9 @@
+#ifndef _ASM_M68K_MMZONE_H_
+#define _ASM_M68K_MMZONE_H_
+
+extern pg_data_t pg_data_map[];
+
+#define NODE_DATA(nid) (&pg_data_map[nid])
+#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
+
+#endif /* _ASM_M68K_MMZONE_H_ */
--- linux-m68k-2.6.21.orig/include/asm-m68k/module.h
+++ linux-m68k-2.6.21/include/asm-m68k/module.h
@@ -17,6 +17,7 @@ struct mod_arch_specific {
enum m68k_fixup_type {
m68k_fixup_memoffset,
+ m68k_fixup_vnode_shift,
};
struct m68k_fixup_info {
--- linux-m68k-2.6.21.orig/include/asm-m68k/motorola_pgtable.h
+++ linux-m68k-2.6.21/include/asm-m68k/motorola_pgtable.h
@@ -130,7 +130,7 @@ static inline void pgd_set(pgd_t *pgdp,
#define pte_present(pte) (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROTNONE))
#define pte_clear(mm,addr,ptep) ({ pte_val(*(ptep)) = 0; })
-#define pte_page(pte) (mem_map + ((unsigned long)(__va(pte_val(pte)) - PAGE_OFFSET) >> PAGE_SHIFT))
+#define pte_page(pte) virt_to_page(__va(pte_val(pte)))
#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
@@ -143,7 +143,7 @@ static inline void pgd_set(pgd_t *pgdp,
while (--__i >= 0) \
*__ptr++ = 0; \
})
-#define pmd_page(pmd) (mem_map + ((unsigned long)(__va(pmd_val(pmd)) - PAGE_OFFSET) >> PAGE_SHIFT))
+#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
#define pgd_none(pgd) (!pgd_val(pgd))
@@ -223,10 +223,10 @@ static inline pte_t *pte_offset_kernel(p
return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
}
-#define pte_offset_map(pmdp,address) ((pte_t *)kmap(pmd_page(*pmdp)) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
+#define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address)
-#define pte_unmap(pte) kunmap(pte)
-#define pte_unmap_nested(pte) kunmap(pte)
+#define pte_unmap(pte) ((void)0)
+#define pte_unmap_nested(pte) ((void)0)
/*
* Allocate and free page tables. The xxx_kernel() versions are
--- linux-m68k-2.6.21.orig/include/asm-m68k/page.h
+++ linux-m68k-2.6.21/include/asm-m68k/page.h
@@ -121,7 +121,6 @@ extern unsigned long m68k_memoffset;
#ifndef CONFIG_SUN3
#define WANT_PAGE_VIRTUAL
-#ifdef CONFIG_SINGLE_MEMORY_CHUNK
static inline unsigned long ___pa(void *vaddr)
{
@@ -133,7 +132,7 @@ static inline unsigned long ___pa(void *
: "0" (vaddr), "i" (m68k_fixup_memoffset));
return paddr;
}
-#define __pa(vaddr) ___pa((void *)(vaddr))
+#define __pa(vaddr) ___pa((void *)(vaddr))
static inline void *__va(unsigned long paddr)
{
void *vaddr;
@@ -145,11 +144,6 @@ static inline void *__va(unsigned long p
return vaddr;
}
-#else
-#define __pa(vaddr) virt_to_phys((void *)(vaddr))
-#define __va(paddr) phys_to_virt((unsigned long)(paddr))
-#endif
-
#else /* !CONFIG_SUN3 */
/* This #define is a horrible hack to suppress lots of warnings. --m */
#define __pa(x) ___pa((unsigned long)(x))
@@ -184,11 +178,47 @@ static inline void *__va(unsigned long x
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
-#define virt_to_page(kaddr) (mem_map + (((unsigned long)(kaddr)-PAGE_OFFSET) >> PAGE_SHIFT))
-#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
+extern int m68k_virt_to_node_shift;
+
+#ifdef CONFIG_SINGLE_MEMORY_CHUNK
+#define __virt_to_node(addr) (&pg_data_map[0])
+#else
+extern struct pglist_data *pg_data_table[];
+
+static inline __attribute_const__ int __virt_to_node_shift(void)
+{
+ int shift;
+
+ asm (
+ "1: moveq #0,%0\n"
+ m68k_fixup(%c1, 1b)
+ : "=d" (shift)
+ : "i" (m68k_fixup_vnode_shift));
+ return shift;
+}
+
+#define __virt_to_node(addr) (pg_data_table[(unsigned long)(addr) >> __virt_to_node_shift()])
+#endif
-#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
-#define page_to_pfn(page) virt_to_pfn(page_to_virt(page))
+#define virt_to_page(addr) ({ \
+ pfn_to_page(virt_to_pfn(addr)); \
+})
+#define page_to_virt(page) ({ \
+ pfn_to_virt(page_to_pfn(page)); \
+})
+
+#define pfn_to_page(pfn) ({ \
+ unsigned long __pfn = (pfn); \
+ struct pglist_data *pgdat; \
+ pgdat = __virt_to_node((unsigned long)pfn_to_virt(__pfn)); \
+ pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \
+})
+#define page_to_pfn(_page) ({ \
+ struct page *__p = (_page); \
+ struct pglist_data *pgdat; \
+ pgdat = &pg_data_map[page_to_nid(__p)]; \
+ ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \
+})
#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
#define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
--- linux-m68k-2.6.21.orig/include/asm-m68k/pgalloc.h
+++ linux-m68k-2.6.21/include/asm-m68k/pgalloc.h
@@ -8,11 +8,12 @@
#include <asm/virtconvert.h>
-
#ifdef CONFIG_SUN3
#include <asm/sun3_pgalloc.h>
#else
#include <asm/motorola_pgalloc.h>
#endif
+extern void m68k_setup_node(int node);
+
#endif /* M68K_PGALLOC_H */
--- linux-m68k-2.6.21.orig/include/asm-m68k/pgtable.h
+++ linux-m68k-2.6.21/include/asm-m68k/pgtable.h
@@ -107,22 +107,7 @@ extern void *empty_zero_page;
/* 64-bit machines, beware! SRB. */
#define SIZEOF_PTR_LOG2 2
-/*
- * Check if the addr/len goes up to the end of a physical
- * memory chunk. Used for DMA functions.
- */
-#ifdef CONFIG_SINGLE_MEMORY_CHUNK
-/*
- * It makes no sense to consider whether we cross a memory boundary if
- * we support just one physical chunk of memory.
- */
-static inline int mm_end_of_chunk(unsigned long addr, int len)
-{
- return 0;
-}
-#else
-int mm_end_of_chunk (unsigned long addr, int len);
-#endif
+#define mm_end_of_chunk(addr, len) 0
extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
--- linux-m68k-2.6.21.orig/include/asm-m68k/sun3_pgtable.h
+++ linux-m68k-2.6.21/include/asm-m68k/sun3_pgtable.h
@@ -132,8 +132,8 @@ static inline void pte_clear (struct mm_
#define pfn_pte(pfn, pgprot) \
({ pte_t __pte; pte_val(__pte) = pfn | pgprot_val(pgprot); __pte; })
-#define pte_page(pte) (mem_map+((__pte_page(pte) - PAGE_OFFSET) >> PAGE_SHIFT))
-#define pmd_page(pmd) (mem_map+((__pmd_page(pmd) - PAGE_OFFSET) >> PAGE_SHIFT))
+#define pte_page(pte) virt_to_page(__pte_page(pte))
+#define pmd_page(pmd) virt_to_page(__pmd_page(pmd))
static inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); }
--- linux-m68k-2.6.21.orig/include/asm-m68k/virtconvert.h
+++ linux-m68k-2.6.21/include/asm-m68k/virtconvert.h
@@ -8,56 +8,34 @@
#ifdef __KERNEL__
#include <linux/compiler.h>
+#include <linux/mmzone.h>
#include <asm/setup.h>
#include <asm/page.h>
-#ifdef CONFIG_AMIGA
-#include <asm/amigahw.h>
-#endif
-
/*
* Change virtual addresses to physical addresses and vv.
*/
-#ifndef CONFIG_SUN3
-extern unsigned long mm_vtop(unsigned long addr) __attribute_const__;
-extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
-#else
-static inline unsigned long mm_vtop(unsigned long vaddr)
-{
- return __pa(vaddr);
-}
-
-static inline unsigned long mm_ptov(unsigned long paddr)
-{
- return (unsigned long)__va(paddr);
-}
-#endif
-
-#ifdef CONFIG_SINGLE_MEMORY_CHUNK
-static inline unsigned long virt_to_phys(void *vaddr)
-{
- return (unsigned long)vaddr - PAGE_OFFSET + m68k_memory[0].addr;
-}
-
-static inline void * phys_to_virt(unsigned long paddr)
-{
- return (void *)(paddr - m68k_memory[0].addr + PAGE_OFFSET);
-}
-#else
static inline unsigned long virt_to_phys(void *address)
{
- return mm_vtop((unsigned long)address);
+ return __pa(address);
}
static inline void *phys_to_virt(unsigned long address)
{
- return (void *) mm_ptov(address);
+ return __va(address);
}
-#endif
/* Permanent address of a page. */
-#define __page_address(page) (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT))
-#define page_to_phys(page) virt_to_phys((void *)__page_address(page))
+#ifdef CONFIG_SINGLE_MEMORY_CHUNK
+#define page_to_phys(page) \
+ __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
+#else
+#define page_to_phys(page) ({ \
+ struct pglist_data *pgdat; \
+ pgdat = pg_data_table[page_to_nid(page)]; \
+ page_to_pfn(page) << PAGE_SHIFT; \
+})
+#endif
/*
* IO bus memory addresses are 1:1 with the physical address,
--- linux-m68k-2.6.21.orig/mm/page_alloc.c
+++ linux-m68k-2.6.21/mm/page_alloc.c
@@ -2713,7 +2713,7 @@ static void __init alloc_node_mem_map(st
map = alloc_bootmem_node(pgdat, size);
pgdat->node_mem_map = map + (pgdat->node_start_pfn - start);
}
-#ifdef CONFIG_FLATMEM
+#ifndef CONFIG_NEED_MULTIPLE_NODES
/*
* With no DISCONTIG, the global mem_map is just set as node 0's
*/

View File

@ -1,34 +0,0 @@
To: linus, akpm
Cc: lkml
Subject: [PATCH] m68k: Kill superfluous externs
Kill a few superfluous extern declarations.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mm/motorola.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/mm/motorola.c
+++ linux-m68k-2.6.21/arch/m68k/mm/motorola.c
@@ -47,7 +47,6 @@ EXPORT_SYMBOL(mm_cachebits);
#define INIT_MAPPED_SIZE (4UL<<20)
extern unsigned long availmem;
-extern struct mem_info m68k_ramdisk;
static pte_t * __init kernel_page_table(void)
{
@@ -211,11 +210,7 @@ void __init paging_init(void)
int i;
#ifdef DEBUG
- {
- extern unsigned long availmem;
- printk ("start of paging_init (%p, %lx)\n",
- kernel_pg_dir, availmem);
- }
+ printk ("start of paging_init (%p, %lx)\n", kernel_pg_dir, availmem);
#endif
/* Fix the cache mode in the page descriptors for the 680[46]0. */

View File

@ -1,26 +0,0 @@
To: linus, akpm
Cc: lkml
Subject: [PATCH] m68k: Kill superfluous externs
Kill a few superfluous extern declarations.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mm/motorola.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -210,11 +210,7 @@ void __init paging_init(void)
int i;
#ifdef DEBUG
- {
- extern unsigned long availmem;
- printk ("start of paging_init (%p, %lx)\n",
- kernel_pg_dir, availmem);
- }
+ printk ("start of paging_init (%p, %lx)\n", kernel_pg_dir, availmem);
#endif
/* Fix the cache mode in the page descriptors for the 680[46]0. */

View File

@ -1,117 +0,0 @@
To: linus, akpm
Cc: lkml
Subject: [PATCH] Thread stack abstractions
From: Roman Zippel <zippel@linux-m68k.org>
Thread stack abstractions:
- Move thread_info into task_struct
- Adapt thread_info initialization
- Abstract thread_info access
- Thread_info field becomes stack
- Change get_task_struct/put_task_struct into inline functions
- Move task_struct into <linux/task_struct.h>
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
include/asm-m68k/thread_info.h | 12 ++++++------
include/linux/init_task.h | 2 +-
include/linux/sched.h | 3 ++-
kernel/fork.c | 10 +++++-----
4 files changed, 14 insertions(+), 13 deletions(-)
--- linux-m68k-2.6.21.orig/include/asm-m68k/thread_info.h
+++ linux-m68k-2.6.21/include/asm-m68k/thread_info.h
@@ -26,24 +26,24 @@ struct thread_info {
/* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */
#if PAGE_SHIFT == 13 /* 8k machines */
-#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,0))
-#define free_thread_info(ti) free_pages((unsigned long)(ti),0)
+#define alloc_thread_stack(tsk) ((void *)__get_free_pages(GFP_KERNEL,0))
+#define free_thread_stack(ti) free_pages((unsigned long)(ti),0)
#else /* otherwise assume 4k pages */
-#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,1))
-#define free_thread_info(ti) free_pages((unsigned long)(ti),1)
+#define alloc_thread_stack(tsk) ((void *)__get_free_pages(GFP_KERNEL,1))
+#define free_thread_stack(ti) free_pages((unsigned long)(ti),1)
#endif /* PAGE_SHIFT == 13 */
#define init_thread_info (init_task.thread.info)
#define init_stack (init_thread_union.stack)
#define task_thread_info(tsk) (&(tsk)->thread.info)
-#define task_stack_page(tsk) ((void *)(tsk)->thread_info)
+#define task_stack_page(tsk) ((void *)(tsk)->stack)
#define current_thread_info() task_thread_info(current)
#define __HAVE_THREAD_FUNCTIONS
#define setup_thread_stack(p, org) ({ \
- *(struct task_struct **)(p)->thread_info = (p); \
+ *(struct task_struct **)(p)->stack = (p); \
task_thread_info(p)->task = (p); \
})
--- linux-m68k-2.6.21.orig/include/linux/init_task.h
+++ linux-m68k-2.6.21/include/linux/init_task.h
@@ -95,7 +95,7 @@ extern struct group_info init_groups;
#define INIT_TASK(tsk) \
{ \
.state = 0, \
- .thread_info = &init_thread_info, \
+ .stack = &init_stack, \
.usage = ATOMIC_INIT(2), \
.flags = 0, \
.lock_depth = -1, \
--- linux-m68k-2.6.21.orig/include/linux/sched.h
+++ linux-m68k-2.6.21/include/linux/sched.h
@@ -799,7 +799,8 @@ struct prio_array;
struct task_struct {
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
- struct thread_info *thread_info;
+ //struct thread_info *thread_info;
+ void *stack;
atomic_t usage;
unsigned long flags; /* per process flags, defined below */
unsigned long ptrace;
--- linux-m68k-2.6.21.orig/kernel/fork.c
+++ linux-m68k-2.6.21/kernel/fork.c
@@ -106,7 +106,7 @@ static struct kmem_cache *mm_cachep;
void free_task(struct task_struct *tsk)
{
- free_thread_info(tsk->thread_info);
+ free_thread_stack(tsk->stack);
rt_mutex_debug_task_free(tsk);
free_task_struct(tsk);
}
@@ -161,7 +161,7 @@ void __init fork_init(unsigned long memp
static struct task_struct *dup_task_struct(struct task_struct *orig)
{
struct task_struct *tsk;
- struct thread_info *ti;
+ void *stack;
prepare_to_copy(orig);
@@ -169,14 +169,14 @@ static struct task_struct *dup_task_stru
if (!tsk)
return NULL;
- ti = alloc_thread_info(tsk);
- if (!ti) {
+ stack = alloc_thread_stack(tsk);
+ if (!stack) {
free_task_struct(tsk);
return NULL;
}
*tsk = *orig;
- tsk->thread_info = ti;
+ tsk->stack = stack;
setup_thread_stack(tsk, orig);
#ifdef CONFIG_CC_STACKPROTECTOR

View File

@ -1,228 +0,0 @@
Cc: James E.J. Bottomley <James.Bottomley@SteelEye.com>,
linux-scsi@vger.kernel.org
Subject: [PATCH] m68k: Atari SCSI revival
From: Michael Schmitz <schmitz@opal.biophys.uni-duesseldorf.de>
SCSI should be working on a TT (but someone should really try!) but causes
trouble on a Falcon (as in: it ate a filesystem of mine) at least when
used concurrently with IDE. I have the notion it's because locking of the
ST-DMA interrupt by IDE is broken in 2.6 (the IDE driver always complains
about trying to release an already-released ST-DMA). Needs more work, but
that's on the IDE or m68k interrupt side rather than SCSI.
Signed-off-by: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/Kconfig | 2 -
drivers/scsi/atari_NCR5380.c | 52 ++++++++++++++++++++++++++++++++++++++-----
drivers/scsi/atari_scsi.c | 10 +++-----
drivers/scsi/atari_scsi.h | 30 +++++++++++++++++++++---
4 files changed, 77 insertions(+), 17 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/scsi/Kconfig
+++ linux-m68k-2.6.21/drivers/scsi/Kconfig
@@ -1649,7 +1649,7 @@ config OKTAGON_SCSI
config ATARI_SCSI
tristate "Atari native SCSI support"
- depends on ATARI && SCSI && BROKEN
+ depends on ATARI && SCSI
select SCSI_SPI_ATTRS
---help---
If you have an Atari with built-in NCR5380 SCSI controller (TT,
--- linux-m68k-2.6.21.orig/drivers/scsi/atari_NCR5380.c
+++ linux-m68k-2.6.21/drivers/scsi/atari_NCR5380.c
@@ -264,7 +264,7 @@ static struct scsi_host_template *the_te
(struct NCR5380_hostdata *)(in)->hostdata
#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
-#define NEXT(cmd) ((Scsi_Cmnd *)((cmd)->host_scribble))
+#define NEXT(cmd) ((cmd)->host_scribble)
#define NEXTADDR(cmd) ((Scsi_Cmnd **)&((cmd)->host_scribble))
#define HOSTNO instance->host_no
@@ -716,7 +716,7 @@ static void NCR5380_print_status (struct
printk("NCR5380_print_status: no memory for print buffer\n");
return;
}
- len = NCR5380_proc_info(pr_bfr, &start, 0, PAGE_SIZE, HOSTNO, 0);
+ len = NCR5380_proc_info(instance, pr_bfr, &start, 0, PAGE_SIZE, 0);
pr_bfr[len] = 0;
printk("\n%s\n", pr_bfr);
free_page((unsigned long) pr_bfr);
@@ -878,6 +878,46 @@ static int NCR5380_init (struct Scsi_Hos
}
/*
+ * our own old-style timeout update
+ */
+/*
+ * The strategy is to cause the timer code to call scsi_times_out()
+ * when the soonest timeout is pending.
+ * The arguments are used when we are queueing a new command, because
+ * we do not want to subtract the time used from this time, but when we
+ * set the timer, we want to take this value into account.
+ */
+
+int atari_scsi_update_timeout(Scsi_Cmnd * SCset, int timeout)
+{
+ int rtn;
+
+ /*
+ * We are using the new error handling code to actually register/deregister
+ * timers for timeout.
+ */
+
+ if (!timer_pending(&SCset->eh_timeout)) {
+ rtn = 0;
+ } else {
+ rtn = SCset->eh_timeout.expires - jiffies;
+ }
+
+ if (timeout == 0) {
+ del_timer(&SCset->eh_timeout);
+ SCset->eh_timeout.data = (unsigned long) NULL;
+ SCset->eh_timeout.expires = 0;
+ } else {
+ if (SCset->eh_timeout.data != (unsigned long) NULL)
+ del_timer(&SCset->eh_timeout);
+ SCset->eh_timeout.data = (unsigned long) SCset;
+ SCset->eh_timeout.expires = jiffies + timeout;
+ add_timer(&SCset->eh_timeout);
+ }
+ return rtn;
+}
+
+/*
* Function : int NCR5380_queue_command (Scsi_Cmnd *cmd,
* void (*done)(Scsi_Cmnd *))
*
@@ -902,7 +942,7 @@ int NCR5380_queue_command (Scsi_Cmnd *cm
Scsi_Cmnd *tmp;
int oldto;
unsigned long flags;
- extern int update_timeout(Scsi_Cmnd * SCset, int timeout);
+ // extern int update_timeout(Scsi_Cmnd * SCset, int timeout);
#if (NDEBUG & NDEBUG_NO_WRITE)
switch (cmd->cmnd[0]) {
@@ -978,9 +1018,9 @@ int NCR5380_queue_command (Scsi_Cmnd *cm
* alter queues and touch the lock.
*/
if (!IS_A_TT()) {
- oldto = update_timeout(cmd, 0);
+ oldto = atari_scsi_update_timeout(cmd, 0);
falcon_get_lock();
- update_timeout(cmd, oldto);
+ atari_scsi_update_timeout(cmd, oldto);
}
if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
LIST(cmd, hostdata->issue_queue);
@@ -1435,7 +1475,7 @@ static int NCR5380_select (struct Scsi_H
local_irq_restore(flags);
/* Wait for arbitration logic to complete */
-#if NCR_TIMEOUT
+#if defined(NCR_TIMEOUT)
{
unsigned long timeout = jiffies + 2*NCR_TIMEOUT;
--- linux-m68k-2.6.21.orig/drivers/scsi/atari_scsi.c
+++ linux-m68k-2.6.21/drivers/scsi/atari_scsi.c
@@ -395,7 +395,7 @@ static irqreturn_t scsi_tt_intr (int irq
#endif /* REAL_DMA */
- NCR5380_intr (0, 0, 0);
+ NCR5380_intr(0, 0);
#if 0
/* To be sure the int is not masked */
@@ -461,7 +461,7 @@ static irqreturn_t scsi_falcon_intr (int
#endif /* REAL_DMA */
- NCR5380_intr (0, 0, 0);
+ NCR5380_intr(0, 0);
return IRQ_HANDLED;
}
@@ -557,11 +557,11 @@ static void falcon_get_lock( void )
local_irq_save(flags);
- while( !in_interrupt() && falcon_got_lock && stdma_others_waiting() )
+ while (!in_irq() && falcon_got_lock && stdma_others_waiting())
sleep_on( &falcon_fairness_wait );
while (!falcon_got_lock) {
- if (in_interrupt())
+ if (in_irq())
panic( "Falcon SCSI hasn't ST-DMA lock in interrupt" );
if (!falcon_trying_lock) {
falcon_trying_lock = 1;
@@ -763,7 +763,6 @@ int atari_scsi_detect (struct scsi_host_
return( 1 );
}
-#ifdef MODULE
int atari_scsi_release (struct Scsi_Host *sh)
{
if (IS_A_TT())
@@ -772,7 +771,6 @@ int atari_scsi_release (struct Scsi_Host
atari_stram_free (atari_dma_buffer);
return 1;
}
-#endif
void __init atari_scsi_setup(char *str, int *ints)
{
--- linux-m68k-2.6.21.orig/drivers/scsi/atari_scsi.h
+++ linux-m68k-2.6.21/drivers/scsi/atari_scsi.h
@@ -21,11 +21,7 @@
int atari_scsi_detect (struct scsi_host_template *);
const char *atari_scsi_info (struct Scsi_Host *);
int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
-#ifdef MODULE
int atari_scsi_release (struct Scsi_Host *);
-#else
-#define atari_scsi_release NULL
-#endif
/* The values for CMD_PER_LUN and CAN_QUEUE are somehow arbitrary. Higher
* values should work, too; try it! (but cmd_per_lun costs memory!) */
@@ -63,6 +59,32 @@ int atari_scsi_release (struct Scsi_Host
#define NCR5380_dma_xfer_len(i,cmd,phase) \
atari_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
+/* former generic SCSI error handling stuff */
+
+#define SCSI_ABORT_SNOOZE 0
+#define SCSI_ABORT_SUCCESS 1
+#define SCSI_ABORT_PENDING 2
+#define SCSI_ABORT_BUSY 3
+#define SCSI_ABORT_NOT_RUNNING 4
+#define SCSI_ABORT_ERROR 5
+
+#define SCSI_RESET_SNOOZE 0
+#define SCSI_RESET_PUNT 1
+#define SCSI_RESET_SUCCESS 2
+#define SCSI_RESET_PENDING 3
+#define SCSI_RESET_WAKEUP 4
+#define SCSI_RESET_NOT_RUNNING 5
+#define SCSI_RESET_ERROR 6
+
+#define SCSI_RESET_SYNCHRONOUS 0x01
+#define SCSI_RESET_ASYNCHRONOUS 0x02
+#define SCSI_RESET_SUGGEST_BUS_RESET 0x04
+#define SCSI_RESET_SUGGEST_HOST_RESET 0x08
+
+#define SCSI_RESET_BUS_RESET 0x100
+#define SCSI_RESET_HOST_RESET 0x200
+#define SCSI_RESET_ACTION 0xff
+
/* Debugging printk definitions:
*
* ARB -> arbitration

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,374 +0,0 @@
From alan@lxorguk.ukuu.org.uk Wed May 23 21:55:17 2007
Date: Wed, 23 May 2007 20:56:45 +0100
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>, Linux Kernel Development <linux-kernel@vger.kernel.org>, akpm@osdl.org, rmk@arm.linux.kernel.org, spyro@f2s.com, starvik@axis.com, ysato@users.sourceforge.jp, "Luck, Tony" <tony.luck@intel.com>, takata@linux-m32r.org, chris@zankel.net, uclinux-v850@lsi.nec.co.jp, kyle@parisc-linux.org, linux-mips@linux-mips.org
Subject: Re: [PATCH] m68k: Enable arbitary speed tty support
> > +#define TCSETS2 _IOW('T',0x2B, struct termios2)
> > +#define TCSETSW2 _IOW('T',0x2C, struct termios2)
> > +#define TCSETSF2 _IOW('T',0x2D, struct termios2)
>
> Where is `struct termios2' defined? Right now it doesn't compile because
> of that.
>
Sorry, shortage of qualified gnomes: One of them forgot to post this diff first
Add the termios2 structure ready for enabling on most platforms. One or two like
Sparc are plain weird so have been left alone. Most can use the same structure as
ktermios for termios2 (ie the newer ioctl uses the structure matching the current
kernel structure)
(cc'd various maintainers who get stuff)
Signed-off-by: Alan Cox <alan@redhat.com>
ddiff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc1-mm1/include/asm-arm/termbits.h linux-2.6.22-rc1-mm1/include/asm-arm/termbits.h
---
include/asm-arm/termbits.h | 11 +++++++++++
include/asm-arm26/termbits.h | 12 +++++++++++-
include/asm-avr32/termbits.h | 11 +++++++++++
include/asm-blackfin/termbits.h | 11 +++++++++++
include/asm-cris/termbits.h | 11 +++++++++++
include/asm-frv/termbits.h | 11 +++++++++++
include/asm-h8300/termbits.h | 11 +++++++++++
include/asm-ia64/termbits.h | 11 +++++++++++
include/asm-m32r/termbits.h | 11 +++++++++++
include/asm-m68k/termbits.h | 11 +++++++++++
include/asm-mips/termbits.h | 11 +++++++++++
include/asm-parisc/termbits.h | 11 +++++++++++
include/asm-s390/termbits.h | 11 +++++++++++
include/asm-sh/termbits.h | 11 +++++++++++
include/asm-v850/termbits.h | 11 +++++++++++
include/asm-xtensa/termbits.h | 11 +++++++++++
16 files changed, 176 insertions(+), 1 deletion(-)
--- a/include/asm-arm/termbits.h
+++ b/include/asm-arm/termbits.h
@@ -26,6 +26,17 @@ struct termios2 {
speed_t c_ospeed; /* output speed */
};
+struct termios_2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-arm26/termbits.h
+++ b/include/asm-arm26/termbits.h
@@ -15,7 +15,7 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
-struct ktermios {
+struct termios2 {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
tcflag_t c_cflag; /* control mode flags */
@@ -26,6 +26,16 @@ struct ktermios {
speed_t c_ospeed; /* output speed */
};
+struct ktermios {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
/* c_cc characters */
#define VINTR 0
--- a/include/asm-avr32/termbits.h
+++ b/include/asm-avr32/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-blackfin/termbits.h
+++ b/include/asm-blackfin/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-cris/termbits.h
+++ b/include/asm-cris/termbits.h
@@ -19,6 +19,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-frv/termbits.h
+++ b/include/asm-frv/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-h8300/termbits.h
+++ b/include/asm-h8300/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-ia64/termbits.h
+++ b/include/asm-ia64/termbits.h
@@ -26,6 +26,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-m32r/termbits.h
+++ b/include/asm-m32r/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-m68k/termbits.h
+++ b/include/asm-m68k/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-mips/termbits.h
+++ b/include/asm-mips/termbits.h
@@ -30,6 +30,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-parisc/termbits.h
+++ b/include/asm-parisc/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-s390/termbits.h
+++ b/include/asm-s390/termbits.h
@@ -25,6 +25,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-sh/termbits.h
+++ b/include/asm-sh/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-v850/termbits.h
+++ b/include/asm-v850/termbits.h
@@ -17,6 +17,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
--- a/include/asm-xtensa/termbits.h
+++ b/include/asm-xtensa/termbits.h
@@ -30,6 +30,17 @@ struct termios {
cc_t c_cc[NCCS]; /* control characters */
};
+struct termios2 {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+};
+
struct ktermios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */

View File

@ -1,42 +0,0 @@
Subject: [PATCH] m68k: Amiga A2065 and Ariadne TX statistics
Cc: Jeff Garzik <jgarzik@pobox.com>, netdev@vger.kernel.org
Add missing code to the Amiga A2065 and Ariadne drivers to update
net_device_stats.tx_bytes.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/a2065.c | 4 +---
drivers/net/ariadne.c | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/a2065.c
+++ linux-m68k-2.6.21/drivers/net/a2065.c
@@ -563,7 +563,6 @@ static int lance_start_xmit (struct sk_b
volatile struct lance_init_block *ib = lp->init_block;
int entry, skblen, len;
int status = 0;
- static int outs;
unsigned long flags;
skblen = skb->len;
@@ -608,8 +607,7 @@ static int lance_start_xmit (struct sk_b
/* Now, give the packet to the lance */
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask;
-
- outs++;
+ lp->stats.tx_bytes += skblen;
if (TX_BUFFS_AVAIL <= 0)
netif_stop_queue(dev);
--- linux-m68k-2.6.21.orig/drivers/net/ariadne.c
+++ linux-m68k-2.6.21/drivers/net/ariadne.c
@@ -677,6 +677,7 @@ static int ariadne_start_xmit(struct sk_
priv->cur_tx -= TX_RING_SIZE;
priv->dirty_tx -= TX_RING_SIZE;
}
+ priv->stats.tx_bytes += len;
/* Trigger an immediate send poll. */
lance->RAP = CSR0; /* PCnet-ISA Controller Status */

View File

@ -1,57 +0,0 @@
--- build-m68k-none-atari/include/asm-m68k/io.h 2007-07-13 00:44:22.000000000 +0200
+++ build-m68k-none-atari/include/asm-m68k/io.h 2007-05-27 21:27:29.000000000 +0200
@@ -245,9 +245,16 @@
#if defined(CONFIG_ATARI_ROM_ISA)
#define isa_rom_inb(port) rom_in_8(isa_itb(port))
#define isa_rom_inw(port) (ISA_SEX ? rom_in_be16(isa_itw(port)) : rom_in_le16(isa_itw(port)))
+#define isa_rom_inl(port) (ISA_SEX ? rom_in_be32(isa_itw(port)) : rom_in_le32(isa_itw(port)))
#define isa_rom_outb(val,port) rom_out_8(isa_itb(port),(val))
#define isa_rom_outw(val,port) (ISA_SEX ? rom_out_be16(isa_itw(port),(val)) : rom_out_le16(isa_itw(port),(val)))
+#define isa_rom_outl(val,port) (ISA_SEX ? rom_out_be32(isa_itw(port),(val)) : rom_out_le32(isa_itw(port),(val)))
+
+#define isa_rom_readb(p) rom_in_8(isa_mtb((unsigned long)(p)))
+#define isa_rom_readw(p) \
+ (ISA_SEX ? rom_in_be16(isa_mtw((unsigned long)(p))) \
+ : rom_in_le16(isa_mtw((unsigned long)(p))))
#define isa_rom_writeb(val,p) rom_out_8(isa_mtb((unsigned long)(p)),(val))
#define isa_rom_writew(val,p) \
@@ -315,12 +322,20 @@
(ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \
raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+#define isa_rom_insl(port, buf, nr) \
+ (ISA_SEX ? raw_rom_insl(isa_itw(port), (u32 *)(buf), (nr)) : \
+ raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
#define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr))
#define isa_rom_outsw(port, buf, nr) \
(ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \
raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+#define isa_rom_outsl(port, buf, nr) \
+ (ISA_SEX ? raw_rom_outsl(isa_itw(port), (u32 *)(buf), (nr)) : \
+ raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
#endif
#endif /* CONFIG_ISA */
@@ -421,8 +436,16 @@
#define insb isa_rom_insb
#define insw isa_rom_insw
+#define insl isa_rom_insl
#define outsb isa_rom_outsb
#define outsw isa_rom_outsw
+#define outsl isa_rom_outsl
+
+#define readb isa_readb
+#define readw isa_readw
+#define writeb isa_writeb
+#define writew isa_writew
+
#endif
#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA)

View File

@ -1,542 +0,0 @@
Subject: [PATCH] m68k: Atari ARAnyM support
From: Michael Schmitz <schmitz@opal.biophys.uni-duesseldorf.de>
This isn't really my kettle of fish, but I post it anyway unless Petr
complains :-)
This is what makes it possible for me to test 2.6 builds on the
emulator...
Should be signed off by Petr, really.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Kconfig | 15 ++
arch/m68k/Makefile | 1
arch/m68k/emu/Makefile | 7 +
arch/m68k/emu/natfeat.c | 113 +++++++++++++++++
arch/m68k/emu/nfeth.c | 292 +++++++++++++++++++++++++++++++++++++++++++++
arch/m68k/kernel/setup.c | 5
drivers/net/Kconfig | 8 +
include/asm-m68k/natfeat.h | 22 +++
8 files changed, 463 insertions(+)
--- linux-m68k-2.6.21.orig/arch/m68k/Kconfig
+++ linux-m68k-2.6.21/arch/m68k/Kconfig
@@ -260,6 +260,21 @@ config Q40
Q60. Select your CPU below. For 68LC060 don't forget to enable FPU
emulation.
+config NATFEAT
+ bool "ARAnyM emulator support"
+ depends on ATARI
+ help
+ This option enables support for ARAnyM native features, such as
+ access to a disk image as /dev/hda. Useful with the ARANYM option.
+
+config NFETH
+ tristate "NatFeat Ethernet support"
+ depends on NET_ETHERNET && NATFEAT
+ help
+ Say Y to include support for the ARAnyM NatFeat network device
+ which will emulate a regular ethernet device while presenting an
+ ethertap device to the host system.
+
comment "Processor type"
config M68020
--- linux-m68k-2.6.21.orig/arch/m68k/Makefile
+++ linux-m68k-2.6.21/arch/m68k/Makefile
@@ -75,6 +75,7 @@ core-$(CONFIG_MVME16x) += arch/m68k/mvm
core-$(CONFIG_BVME6000) += arch/m68k/bvme6000/
core-$(CONFIG_SUN3X) += arch/m68k/sun3x/ arch/m68k/sun3/
core-$(CONFIG_SUN3) += arch/m68k/sun3/ arch/m68k/sun3/prom/
+core-$(CONFIG_NATFEAT) += arch/m68k/emu/
core-$(CONFIG_M68040) += arch/m68k/fpsp040/
core-$(CONFIG_M68060) += arch/m68k/ifpsp060/
core-$(CONFIG_M68KFPU_EMU) += arch/m68k/math-emu/
--- /dev/null
+++ linux-m68k-2.6.21/arch/m68k/emu/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for Linux arch/m68k/emu source directory
+#
+
+obj-y += natfeat.o
+
+obj-$(CONFIG_NFETH) += nfeth.o
--- /dev/null
+++ linux-m68k-2.6.21/arch/m68k/emu/natfeat.c
@@ -0,0 +1,113 @@
+/*
+ * natfeat.c - ARAnyM hardware support via Native Features (natfeats)
+ *
+ * Copyright (c) 2005 Petr Stehlik of ARAnyM dev team
+ *
+ * Reworked for Linux by Roman Zippel <zippel@linux-m68k.org>
+ *
+ * This software may be used and distributed according to the terms of
+ * the GNU General Public License (GPL), incorporated herein by reference.
+ */
+
+#include <linux/types.h>
+#include <linux/console.h>
+#include <linux/string.h>
+#include <linux/kernel.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/natfeat.h>
+
+asm ("\n"
+" .global nf_get_id,nf_call\n"
+"nf_get_id:\n"
+" .short 0x7300\n"
+" rts\n"
+"nf_call:\n"
+" .short 0x7301\n"
+" rts\n"
+"1: moveq.l #0,%d0\n"
+" rts\n"
+" .section __ex_table,\"a\"\n"
+" .long nf_get_id,1b\n"
+" .long nf_call,1b\n"
+" .previous");
+
+static int stderr_id;
+
+static void nf_write(struct console *co, const char *str, unsigned int count)
+{
+ char buf[68];
+
+ buf[64] = 0;
+ while (count > 64) {
+ memcpy(buf, str, 64);
+ nf_call(stderr_id, buf);
+ str += 64;
+ count -= 64;
+ }
+ memcpy(buf, str, count);
+ buf[count] = 0;
+ nf_call(stderr_id, buf);
+}
+
+void nfprint(const char *fmt, ...)
+{
+ static char buf[256];
+ va_list ap;
+ int n;
+
+ va_start(ap, fmt);
+ n = vsnprintf(buf, 256, fmt, ap);
+ nf_call(nf_get_id("NF_STDERR"), buf);
+ va_end(ap);
+}
+
+static struct console nf_console_driver = {
+ .name = "debug",
+ .write = nf_write,
+ .flags = CON_PRINTBUFFER,
+ .index = -1,
+};
+
+static int __init nf_debug_setup(char *arg)
+{
+ if (strcmp(arg, "emu"))
+ return 0;
+
+ stderr_id = nf_get_id("NF_STDERR");
+ if (stderr_id)
+ register_console(&nf_console_driver);
+ return 0;
+}
+
+early_param("debug", nf_debug_setup);
+
+static void nf_poweroff(void)
+{
+ long id = nf_get_id("NF_SHUTDOWN");
+
+ if (id)
+ nf_call(id);
+}
+
+void nf_init(void)
+{
+ unsigned long id, version;
+ char buf[256];
+
+ id = nf_get_id("NF_VERSION");
+ if (!id)
+ return;
+ version = nf_call(id);
+
+ id = nf_get_id("NF_NAME");
+ if (!id)
+ return;
+ nf_call(id, buf, 256);
+ buf[255] = 0;
+
+ printk("NatFeats found (%s, %lu.%lu)\n", buf,
+ version >> 16, version & 0xffff);
+
+ mach_power_off = nf_poweroff;
+}
--- /dev/null
+++ linux-m68k-2.6.21/arch/m68k/emu/nfeth.c
@@ -0,0 +1,292 @@
+/*
+ * atari_nfeth.c - ARAnyM ethernet card driver for GNU/Linux
+ *
+ * Copyright (c) 2005 Milan Jurik, Petr Stehlik of ARAnyM dev team
+ *
+ * Based on ARAnyM driver for FreeMiNT written by Standa Opichal
+ *
+ * This software may be used and distributed according to the terms of
+ * the GNU General Public License (GPL), incorporated herein by reference.
+ */
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/module.h>
+#include <net/ieee80211.h>
+#include <asm/natfeat.h>
+
+enum {
+ GET_VERSION = 0, /* no parameters, return NFAPI_VERSION in d0 */
+ XIF_INTLEVEL, /* no parameters, return Interrupt Level in d0 */
+ XIF_IRQ, /* acknowledge interrupt from host */
+ XIF_START, /* (ethX), called on 'ifup', start receiver thread */
+ XIF_STOP, /* (ethX), called on 'ifdown', stop the thread */
+ XIF_READLENGTH, /* (ethX), return size of network data block to read */
+ XIF_READBLOCK, /* (ethX, buffer, size), read block of network data */
+ XIF_WRITEBLOCK, /* (ethX, buffer, size), write block of network data */
+ XIF_GET_MAC, /* (ethX, buffer, size), return MAC HW addr in buffer */
+ XIF_GET_IPHOST, /* (ethX, buffer, size), return IP address of host */
+ XIF_GET_IPATARI, /* (ethX, buffer, size), return IP address of atari */
+ XIF_GET_NETMASK /* (ethX, buffer, size), return IP netmask */
+};
+
+#define DRV_NAME "nfeth"
+#define DRV_VERSION "0.3"
+#define DRV_RELDATE "10/12/2005"
+
+#define MAX_UNIT 8
+
+/* These identify the driver base version and may not be removed. */
+static char version[] __devinitdata =
+KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " S.Opichal, M.Jurik, P.Stehlik\n"
+KERN_INFO " http://aranym.atari.org/\n";
+
+MODULE_AUTHOR("Milan Jurik");
+MODULE_DESCRIPTION("Atari NFeth driver");
+MODULE_LICENSE("GPL");
+/*
+MODULE_PARM(nfeth_debug, "i");
+MODULE_PARM_DESC(nfeth_debug, "nfeth_debug level (1-2)");
+*/
+
+#undef DEBUG
+
+static long nfEtherID;
+static int nfEtherIRQ;
+
+struct nfeth_private {
+ int ethX;
+ struct net_device_stats stats;
+ spinlock_t lock;
+};
+
+static struct net_device *nfeth_dev[MAX_UNIT];
+
+int nfeth_open(struct net_device *dev);
+int nfeth_stop(struct net_device *dev);
+irqreturn_t nfeth_interrupt(int irq, void *dev_id);
+int nfeth_xmit(struct sk_buff *skb, struct net_device *dev);
+
+int nfeth_open(struct net_device *dev)
+{
+ struct nfeth_private *priv = netdev_priv(dev);
+ int res;
+
+ res = nf_call(nfEtherID + XIF_START, priv->ethX);
+
+ /* Clean statistics */
+ memset(&priv->stats, 0, sizeof(struct net_device_stats));
+ spin_lock_init(&priv->lock);
+
+#ifdef DEBUG
+ printk(DRV_NAME ": open %d\n", res);
+#endif
+
+ /* Ready for data */
+ netif_start_queue(dev);
+
+ return 0;
+}
+
+int nfeth_stop(struct net_device *dev)
+{
+ struct nfeth_private *priv = netdev_priv(dev);
+
+ /* No more data */
+ netif_stop_queue(dev);
+
+ nf_call(nfEtherID + XIF_STOP, priv->ethX);
+
+ return 0;
+}
+
+/*
+ * Read a packet out of the adapter and pass it to the upper layers
+ */
+static inline void recv_packet(struct net_device *dev)
+{
+ struct nfeth_private *priv = netdev_priv(dev);
+ int handled = 0;
+ unsigned short pktlen;
+ struct sk_buff *skb;
+
+ /* read packet length (excluding 32 bit crc) */
+ pktlen = nf_call(nfEtherID + XIF_READLENGTH, priv->ethX);
+
+#ifdef DEBUG
+ printk(DRV_NAME ": recv_packet: %i\n", pktlen);
+#endif
+
+ if (!pktlen) {
+#ifdef DEBUG
+ printk(DRV_NAME ": recv_packet: pktlen == 0\n");
+#endif
+ priv->stats.rx_errors++;
+ return;
+ }
+
+ skb = dev_alloc_skb(pktlen + 2);
+ if (!skb) {
+#ifdef DEBUG
+ printk(DRV_NAME ": recv_packet: out of mem (buf_alloc failed)\n");
+#endif
+ priv->stats.rx_dropped++;
+ return;
+ }
+
+ skb->dev = dev;
+ skb_reserve(skb, 2); /* 16 Byte align */
+ skb_put(skb, pktlen); /* make room */
+ nf_call(nfEtherID + XIF_READBLOCK, priv->ethX, virt_to_phys(skb->data), pktlen);
+
+ skb->protocol = eth_type_trans(skb, dev);
+ netif_rx(skb);
+ dev->last_rx = jiffies;
+ priv->stats.rx_packets++;
+ priv->stats.rx_bytes += pktlen;
+
+ /* and enqueue packet */
+ handled = 1;
+ return;
+}
+
+irqreturn_t nfeth_interrupt(int irq, void *dev_id)
+{
+ int i, m, mask;
+
+ mask = nf_call(nfEtherID + XIF_IRQ, 0);
+ for (i = 0, m = 1; i < MAX_UNIT; m <<= 1, i++) {
+ if (mask & m && nfeth_dev[i]) {
+ recv_packet(nfeth_dev[i]);
+ nf_call(nfEtherID + XIF_IRQ, m);
+ }
+ }
+ return IRQ_HANDLED;
+}
+
+int nfeth_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ int len;
+ char *data, shortpkt[ETH_ZLEN];
+ struct nfeth_private *priv = netdev_priv(dev);
+
+ data = skb->data;
+ len = skb->len;
+ if (len < ETH_ZLEN) {
+ memset(shortpkt, 0, ETH_ZLEN);
+ memcpy(shortpkt, data, len);
+ data = shortpkt;
+ len = ETH_ZLEN;
+ }
+
+ dev->trans_start = jiffies;
+
+#ifdef DEBUG
+ printk(DRV_NAME ": send %d bytes\n", len);
+#endif
+ nf_call(nfEtherID + XIF_WRITEBLOCK, priv->ethX, virt_to_phys(data), len);
+
+ priv->stats.tx_packets++;
+ priv->stats.tx_bytes += len;
+
+ dev_kfree_skb(skb);
+ return 0;
+}
+
+static void nfeth_tx_timeout(struct net_device *dev)
+{
+ struct nfeth_private *priv = netdev_priv(dev);
+ priv->stats.tx_errors++;
+ netif_wake_queue(dev);
+}
+
+static struct net_device_stats *nfeth_get_stats(struct net_device *dev)
+{
+ struct nfeth_private *priv = netdev_priv(dev);
+ return &priv->stats;
+}
+
+struct net_device * __init nfeth_probe(int unit)
+{
+ struct net_device *dev;
+ struct nfeth_private *priv;
+ char mac[ETH_ALEN], host_ip[32], local_ip[32];
+ int err;
+
+ if (!nf_call(nfEtherID + XIF_GET_MAC, unit, mac, ETH_ALEN))
+ return NULL;
+
+ dev = alloc_etherdev(sizeof(struct nfeth_private));
+ if (!dev)
+ return NULL;
+
+ SET_MODULE_OWNER(dev);
+ dev->irq = nfEtherIRQ;
+ dev->open = nfeth_open;
+ dev->stop = nfeth_stop;
+ dev->hard_start_xmit = nfeth_xmit;
+ dev->tx_timeout = nfeth_tx_timeout;
+ dev->get_stats = nfeth_get_stats;
+ dev->flags |= NETIF_F_NO_CSUM;
+ memcpy(dev->dev_addr, mac, ETH_ALEN);
+
+ priv = netdev_priv(dev);
+ priv->ethX = unit;
+
+ err = register_netdev(dev);
+ if (err) {
+ free_netdev(dev);
+ return NULL;
+ }
+
+ nf_call(nfEtherID + XIF_GET_IPHOST, unit,
+ host_ip, sizeof(host_ip));
+ nf_call(nfEtherID + XIF_GET_IPATARI, unit,
+ local_ip, sizeof(local_ip));
+
+ printk(KERN_INFO "%s: nfeth addr:%s (%s) HWaddr:" MAC_FMT "\n",
+ dev->name, host_ip, local_ip, MAC_ARG(mac));
+
+ return dev;
+}
+
+int __init nfeth_init(void)
+{
+ long ver;
+ int i;
+
+ nfEtherID = nf_get_id("ETHERNET");
+ if (!nfEtherID)
+ return -ENODEV;
+
+ ver = nf_call(nfEtherID + GET_VERSION);
+ printk("nfeth API %lu\n", ver);
+
+ nfEtherIRQ = nf_call(nfEtherID + XIF_INTLEVEL);
+ if (request_irq(nfEtherIRQ, nfeth_interrupt, IRQF_SHARED,
+ "eth emu", nfeth_interrupt)) {
+ printk("nfeth: request for irq %d failed", nfEtherIRQ);
+ return -ENODEV;
+ }
+
+ for (i = 0; i < MAX_UNIT; i++)
+ nfeth_dev[i] = nfeth_probe(i);
+
+ return 0;
+}
+
+void __exit nfeth_cleanup(void)
+{
+ int i;
+
+ for (i = 0; i < MAX_UNIT; i++) {
+ if (nfeth_dev[i]) {
+ unregister_netdev(nfeth_dev[0]);
+ free_netdev(nfeth_dev[0]);
+ }
+ }
+ free_irq(nfEtherIRQ, nfeth_interrupt);
+}
+
+module_init(nfeth_init);
+module_exit(nfeth_cleanup);
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/setup.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/setup.c
@@ -39,6 +39,7 @@
#ifdef CONFIG_SUN3X
#include <asm/dvma.h>
#endif
+#include <asm/natfeat.h>
unsigned long m68k_machtype;
unsigned long m68k_cputype;
@@ -313,6 +314,10 @@ void __init setup_arch(char **cmdline_p)
panic("No configuration setup");
}
+#ifdef CONFIG_NATFEAT
+ nf_init();
+#endif
+
paging_init();
#ifndef CONFIG_SUN3
--- linux-m68k-2.6.21.orig/drivers/net/Kconfig
+++ linux-m68k-2.6.21/drivers/net/Kconfig
@@ -398,6 +398,14 @@ config ATARI_PAMSNET
ACSI port ("ACSI node"). The driver works (has to work...) with a
polled I/O scheme, so it's rather slow :-(
+config ATARI_ETHERNEC
+ tristate "Atari EtherNEC Ethernet support"
+ depends on NET_ETHERNET && ATARI && ATARI_ROM_ISA
+ help
+ Say Y to include support for the EtherNEC network adapter for the
+ ROM port. The driver works by polling instead of interrupts, so it
+ is quite slow.
+
config SUN3LANCE
tristate "Sun3/Sun3x on-board LANCE support"
depends on NET_ETHERNET && (SUN3 || SUN3X)
--- /dev/null
+++ linux-m68k-2.6.21/include/asm-m68k/natfeat.h
@@ -0,0 +1,22 @@
+/*
+ * ARAnyM hardware support via Native Features (natfeats)
+ *
+ * Copyright (c) 2005 Petr Stehlik of ARAnyM dev team
+ *
+ * This software may be used and distributed according to the terms of
+ * the GNU General Public License (GPL), incorporated herein by reference.
+ */
+
+#ifndef _NATFEAT_H
+#define _NATFEAT_H
+
+long nf_get_id(const char *feature_name);
+long nf_call(long id, ...);
+
+void nf_init(void);
+void nf_shutdown(void);
+
+void nfprint(const char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
+
+# endif /* _NATFEAT_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,340 +0,0 @@
Subject: [PATCH] m68k: Atari ROM port ISA adapter support
From: Michael Schmitz <schmitz@opal.biophys.uni-duesseldorf.de>
Atari ROM port ISA adapter support
Signed-off-by: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Kconfig | 10 ++++
include/asm-m68k/io.h | 101 ++++++++++++++++++++++++++++++++++++++++++++--
include/asm-m68k/raw_io.h | 98 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 205 insertions(+), 4 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/Kconfig
+++ linux-m68k-2.6.21/arch/m68k/Kconfig
@@ -143,6 +143,16 @@ config PCI
information about which PCI hardware does work under Linux and which
doesn't.
+config ATARI_ROM_ISA
+ bool "Atari ROM port ISA adapter support"
+ depends on ATARI
+ help
+ This option enables support for the ROM port ISA adapter used to
+ operate ISA cards on Atari. Only 8 bit cards are supported, and
+ no interrupt lines are connected.
+ The only driver currently using this adapter is the EtherNEC
+ driver for RTL8019AS based NE2000 compatible network cards.
+
config MAC
bool "Macintosh support"
depends on !MMU_SUN3
--- linux-m68k-2.6.21.orig/include/asm-m68k/io.h
+++ linux-m68k-2.6.21/include/asm-m68k/io.h
@@ -82,9 +82,21 @@ extern unsigned long gg2_isa_base;
#endif
#endif /* AMIGA_PCMCIA */
+#ifdef CONFIG_ATARI_ROM_ISA
+#define enec_isa_read_base 0xfffa0000
+#define enec_isa_write_base 0xfffb0000
-#ifdef CONFIG_ISA
+#define ENEC_ISA_IO_B(ioaddr) (enec_isa_read_base+((((unsigned long)(ioaddr))&0x1F)<<9))
+#define ENEC_ISA_IO_W(ioaddr) (enec_isa_read_base+((((unsigned long)(ioaddr))&0x1F)<<9))
+#define ENEC_ISA_MEM_B(madr) (enec_isa_read_base+((((unsigned long)(madr))&0x1F)<<9))
+#define ENEC_ISA_MEM_W(madr) (enec_isa_read_base+((((unsigned long)(madr))&0x1F)<<9))
+
+#define MULTI_ISA 0
+#endif /* ATARI */
+
+
+#if defined(CONFIG_ISA) || defined(CONFIG_ATARI_ROM_ISA)
#if MULTI_ISA == 0
#undef MULTI_ISA
@@ -93,6 +105,7 @@ extern unsigned long gg2_isa_base;
#define Q40_ISA (1)
#define GG2_ISA (2)
#define AG_ISA (3)
+#define ENEC_ISA (4)
#if defined(CONFIG_Q40) && !defined(MULTI_ISA)
#define ISA_TYPE Q40_ISA
@@ -106,6 +119,10 @@ extern unsigned long gg2_isa_base;
#define ISA_TYPE GG2_ISA
#define ISA_SEX 0
#endif
+#if defined(CONFIG_ATARI_ROM_ISA) && !defined(MULTI_ISA)
+#define ISA_TYPE ENEC_ISA
+#define ISA_SEX 0
+#endif
#ifdef MULTI_ISA
extern int isa_type;
@@ -133,6 +150,9 @@ static inline u8 __iomem *isa_itb(unsign
#ifdef CONFIG_AMIGA_PCMCIA
case AG_ISA: return (u8 __iomem *)AG_ISA_IO_B(addr);
#endif
+#ifdef CONFIG_ATARI_ROM_ISA
+ case ENEC_ISA: return (u8 __iomem *)ENEC_ISA_IO_B(addr);
+#endif
default: return NULL; /* avoid warnings, just in case */
}
}
@@ -149,6 +169,9 @@ static inline u16 __iomem *isa_itw(unsig
#ifdef CONFIG_AMIGA_PCMCIA
case AG_ISA: return (u16 __iomem *)AG_ISA_IO_W(addr);
#endif
+#ifdef CONFIG_ATARI_ROM_ISA
+ case ENEC_ISA: return (u16 __iomem *)ENEC_ISA_IO_W(addr);
+#endif
default: return NULL; /* avoid warnings, just in case */
}
}
@@ -165,6 +188,9 @@ static inline u8 __iomem *isa_mtb(unsign
#ifdef CONFIG_AMIGA_PCMCIA
case AG_ISA: return (u8 __iomem *)addr;
#endif
+#ifdef CONFIG_ATARI_ROM_ISA
+ case ENEC_ISA: return (u8 __iomem *)ENEC_ISA_MEM_B(addr);
+#endif
default: return NULL; /* avoid warnings, just in case */
}
}
@@ -181,6 +207,9 @@ static inline u16 __iomem *isa_mtw(unsig
#ifdef CONFIG_AMIGA_PCMCIA
case AG_ISA: return (u16 __iomem *)addr;
#endif
+#ifdef CONFIG_ATARI_ROM_ISA
+ case ENEC_ISA: return (u16 __iomem *)ENEC_ISA_MEM_W(addr);
+#endif
default: return NULL; /* avoid warnings, just in case */
}
}
@@ -200,6 +229,19 @@ static inline u16 __iomem *isa_mtw(unsig
(ISA_SEX ? out_be16(isa_mtw((unsigned long)(p)),(val)) \
: out_le16(isa_mtw((unsigned long)(p)),(val)))
+#if defined(CONFIG_ATARI_ROM_ISA)
+#define isa_rom_inb(port) rom_in_8(isa_itb(port))
+#define isa_rom_inw(port) (ISA_SEX ? rom_in_be16(isa_itw(port)) : rom_in_le16(isa_itw(port)))
+
+#define isa_rom_outb(val,port) rom_out_8(isa_itb(port),(val))
+#define isa_rom_outw(val,port) (ISA_SEX ? rom_out_be16(isa_itw(port),(val)) : rom_out_le16(isa_itw(port),(val)))
+
+#define isa_rom_writeb(val,p) rom_out_8(isa_mtb((unsigned long)(p)),(val))
+#define isa_rom_writew(val,p) \
+ (ISA_SEX ? rom_out_be16(isa_mtw((unsigned long)(p)),(val)) \
+ : rom_out_le16(isa_mtw((unsigned long)(p)),(val)))
+#endif
+
static inline void isa_delay(void)
{
switch(ISA_TYPE)
@@ -213,6 +255,9 @@ static inline void isa_delay(void)
#ifdef CONFIG_AMIGA_PCMCIA
case AG_ISA: break;
#endif
+#ifdef CONFIG_ATARI_ROM_ISA
+ case ENEC_ISA: break;
+#endif
default: break; /* avoid warnings */
}
}
@@ -234,10 +279,33 @@ static inline void isa_delay(void)
#define isa_outsw(port, buf, nr) \
(ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \
raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+
+#if defined(CONFIG_ATARI_ROM_ISA)
+#define isa_rom_inb_p(p) ({ u8 _v = isa_rom_inb(p); isa_delay(); _v; })
+#define isa_rom_inw_p(p) ({ u16 _v = isa_rom_inw(p); isa_delay(); _v; })
+#define isa_rom_inl_p(p) ({ u32 _v = isa_rom_inl(p) ;isa_delay(); _v; })
+#define isa_rom_outb_p(v,p) ({ isa_rom_outb((v), (p)); isa_delay(); })
+#define isa_rom_outw_p(v,p) ({ isa_rom_outw((v), (p)); isa_delay(); })
+#define isa_rom_outl_p(v,p) ({ isa_rom_outl((v), (p)); isa_delay(); })
+
+#define isa_rom_insb(port, buf, nr) raw_rom_insb(isa_itb(port), (u8 *)(buf), (nr))
+
+#define isa_rom_insw(port, buf, nr) \
+ (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \
+ raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+
+#define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr))
+
+#define isa_rom_outsw(port, buf, nr) \
+ (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \
+ raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+
+#endif
+
#endif /* CONFIG_ISA */
-#if defined(CONFIG_ISA) && !defined(CONFIG_PCI)
+#if defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA)
#define inb isa_inb
#define inb_p isa_inb_p
#define outb isa_outb
@@ -306,7 +374,34 @@ static inline void isa_delay(void)
#endif
#endif /* CONFIG_PCI */
-#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && defined(CONFIG_HP300)
+#if defined(CONFIG_ATARI_ROM_ISA)
+/*
+ * kernel with both ROM port ISA and IDE compiled in, those have
+ * conflicting defs for in/out. Simply consider port < 1024
+ * ROM port ISA and everything else regular ISA for IDE. read,write not defined
+ * in this case
+ */
+#define inb(port) ((port) < 1024 ? isa_rom_inb(port) : in_8(port))
+#define inb_p(port) ((port) < 1024 ? isa_rom_inb_p(port) : in_8(port))
+#define inw(port) ((port) < 1024 ? isa_rom_inw(port) : in_le16(port))
+#define inw_p(port) ((port) < 1024 ? isa_rom_inw_p(port) : in_le16(port))
+#define inl(port) ((port) < 1024 ? isa_rom_inl(port) : in_le32(port))
+#define inl_p(port) ((port) < 1024 ? isa_rom_inl_p(port) : in_le32(port))
+
+#define outb(val,port) ((port) < 1024 ? isa_rom_outb((val), (port)) : out_8((port), (val)))
+#define outb_p(val,port) ((port) < 1024 ? isa_rom_outb_p((val), (port)) : out_8((port), (val)))
+#define outw(val,port) ((port) < 1024 ? isa_rom_outw((val), (port)) : out_le16((port), (val)))
+#define outw_p(val,port) ((port) < 1024 ? isa_rom_outw_p((val), (port)) : out_le16((port), (val)))
+#define outl(val,port) ((port) < 1024 ? isa_rom_outl((val), (port)) : out_le32((port), (val)))
+#define outl_p(val,port) ((port) < 1024 ? isa_rom_outl_p((val), (port)) : out_le32((port), (val)))
+
+#define insb isa_rom_insb
+#define insw isa_rom_insw
+#define outsb isa_rom_outsb
+#define outsw isa_rom_outsw
+#endif
+
+#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA) && defined(CONFIG_HP300)
/*
* We need to define dummy functions otherwise drivers/serial/8250.c doesn't link
*/
--- linux-m68k-2.6.21.orig/include/asm-m68k/raw_io.h
+++ linux-m68k-2.6.21/include/asm-m68k/raw_io.h
@@ -10,7 +10,7 @@
#ifdef __KERNEL__
-#include <asm/types.h>
+#include <asm/byteorder.h>
/* Values for nocacheflag and cmode */
@@ -54,6 +54,46 @@ extern void __iounmap(void *addr, unsign
#define raw_outw(val,port) out_be16((port),(val))
#define raw_outl(val,port) out_be32((port),(val))
+/*
+ * Atari ROM port (cartridge port) ISA adapter, used for the EtherNEC NE2000
+ * network card driver.
+ * The ISA adapter connects address lines A9-A13 to ISA address lines A0-A4,
+ * and hardwires the rest of the ISA addresses for a base address of 0x300.
+ *
+ * Data lines D8-D15 are connected to ISA data lines D0-D7 for reading.
+ * For writes, address lines A1-A8 are latched to ISA data lines D0-D7
+ * (meaning the bit pattern on A1-A8 can be read back as byte).
+ *
+ * Reads and writes are byte only.
+ */
+
+#if defined(CONFIG_ATARI_ROM_ISA)
+#define rom_in_8(addr) \
+ ({ u16 __v = (*(__force volatile u16 *) (addr)); __v >>= 8; __v; })
+#define rom_in_be16(addr) \
+ ({ u16 __v = (*(__force volatile u16 *) (addr)); __v >>= 8; __v; })
+#define rom_in_be32(addr) \
+ ({ u32 __v = (*(__force volatile u32 *) (addr)); __v >>= 8; __v; })
+#define rom_in_le16(addr) \
+ ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v >>= 8; __v; })
+#define rom_in_le32(addr) \
+ ({ u32 __v = le32_to_cpu(*(__force volatile u32 *) (addr)); __v >>= 8; __v; })
+
+#define rom_out_8(addr,b) ({u8 __w, __v = (b); __w = ((*(__force volatile u8 *) ((addr) + 0x10000 + (__v<<1)))); })
+#define rom_out_be16(addr,w) ({u16 __w, __v = (w); __w = ((*(__force volatile u16 *) ((addr) + 0x10000 + (__v<<1)))); })
+#define rom_out_be32(addr,l) ({u32 __w, __v = (l); __w = ((*(__force volatile u32 *) ((addr) + 0x10000 + (__v<<1)))); })
+#define rom_out_le16(addr,w) ({u16 __w, __v = cpu_to_le16(w); __w = ((*(__force volatile u16 *) ((addr) + 0x10000 + (__v<<1)))); })
+#define rom_out_le32(addr,l) ({u32 __w, __v = cpu_to_le32(l); __w = ((*(__force volatile u32 *) ((addr) + 0x10000 + (__v<<1)))); })
+
+#define raw_rom_inb rom_in_8
+#define raw_rom_inw rom_in_be16
+#define raw_rom_inl rom_in_be32
+
+#define raw_rom_outb(val,port) rom_out_8((port),(val))
+#define raw_rom_outw(val,port) rom_out_be16((port),(val))
+#define raw_rom_outl(val,port) rom_out_be32((port),(val))
+#endif /* CONFIG_ATARI_ROM_ISA */
+
static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len)
{
unsigned int i;
@@ -336,6 +376,62 @@ static inline void raw_outsw_swapw(volat
: "d0", "a0", "a1", "d6");
}
+
+#if defined(CONFIG_ATARI_ROM_ISA)
+static inline void raw_rom_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len)
+{
+ unsigned int i;
+
+ for (i = 0; i < len; i++)
+ *buf++ = rom_in_8(port);
+}
+
+static inline void raw_rom_outsb(volatile u8 __iomem *port, const u8 *buf,
+ unsigned int len)
+{
+ unsigned int i;
+
+ for (i = 0; i < len; i++)
+ rom_out_8(port, *buf++);
+}
+
+static inline void raw_rom_insw(volatile u16 __iomem *port, u16 *buf,
+ unsigned int nr)
+{
+ unsigned int i;
+
+ for (i = 0; i < nr; i++)
+ *buf++ = rom_in_be16(port);
+}
+
+static inline void raw_rom_outsw(volatile u16 __iomem *port, const u16 *buf,
+ unsigned int nr)
+{
+ unsigned int i;
+
+ for (i = 0; i < nr; i++)
+ rom_out_be16(port, *buf++);
+}
+
+static inline void raw_rom_insw_swapw(volatile u16 __iomem *port, u16 *buf,
+ unsigned int nr)
+{
+ unsigned int i;
+
+ for (i = 0; i < nr; i++)
+ *buf++ = rom_in_le16(port);
+}
+
+static inline void raw_rom_outsw_swapw(volatile u16 __iomem *port, const u16 *buf,
+ unsigned int nr)
+{
+ unsigned int i;
+
+ for (i = 0; i < nr; i++)
+ rom_out_le16(port, *buf++);
+}
+#endif /* CONFIG_ATARI_ROM_ISA */
+
#define __raw_writel raw_outl
#endif /* __KERNEL__ */

View File

@ -1,340 +0,0 @@
Cc: James E.J. Bottomley <James.Bottomley@SteelEye.com>,
linux-scsi@vger.kernel.org
Subject: [PATCH] m68k: Atari SCSI driver compile fixes
From: Roman Zippel <zippel@linux-m68k.org>
Atari SCSI driver compile fixes
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/atari_NCR5380.c | 33 +++++----
drivers/scsi/atari_scsi.c | 6 -
drivers/scsi/atari_scsi.h | 144 ++++++++-----------------------------------
3 files changed, 49 insertions(+), 134 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/scsi/atari_NCR5380.c
+++ linux-m68k-2.6.21/drivers/scsi/atari_NCR5380.c
@@ -272,8 +272,9 @@ static struct scsi_host_template *the_te
(struct NCR5380_hostdata *)(in)->hostdata
#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
-#define NEXT(cmd) ((cmd)->host_scribble)
-#define NEXTADDR(cmd) ((Scsi_Cmnd **)&((cmd)->host_scribble))
+#define NEXT(cmd) ((Scsi_Cmnd *)(cmd)->host_scribble)
+#define SET_NEXT(cmd,next) ((cmd)->host_scribble = (void *)(next))
+#define NEXTADDR(cmd) ((Scsi_Cmnd **)&(cmd)->host_scribble)
#define HOSTNO instance->host_no
#define H_NO(cmd) (cmd)->device->host->host_no
@@ -479,7 +480,7 @@ static void merge_contiguous_buffers(Scs
virt_to_phys(page_address(cmd->SCp.buffer[1].page) +
cmd->SCp.buffer[1].offset) == endaddr;) {
MER_PRINTK("VTOP(%p) == %08lx -> merging\n",
- cmd->SCp.buffer[1].address, endaddr);
+ page_address(cmd->SCp.buffer[1].page), endaddr);
#if (NDEBUG & NDEBUG_MERGING)
++cnt;
#endif
@@ -1002,7 +1003,7 @@ static int NCR5380_queue_command(Scsi_Cm
* in a queue
*/
- NEXT(cmd) = NULL;
+ SET_NEXT(cmd, NULL);
cmd->scsi_done = done;
cmd->result = 0;
@@ -1034,14 +1035,14 @@ static int NCR5380_queue_command(Scsi_Cm
}
if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
LIST(cmd, hostdata->issue_queue);
- NEXT(cmd) = hostdata->issue_queue;
+ SET_NEXT(cmd, hostdata->issue_queue);
hostdata->issue_queue = cmd;
} else {
for (tmp = (Scsi_Cmnd *)hostdata->issue_queue;
NEXT(tmp); tmp = NEXT(tmp))
;
LIST(cmd, tmp);
- NEXT(tmp) = cmd;
+ SET_NEXT(tmp, cmd);
}
local_irq_restore(flags);
@@ -1149,12 +1150,12 @@ static void NCR5380_main(void *bl)
local_irq_disable();
if (prev) {
REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
- NEXT(prev) = NEXT(tmp);
+ SET_NEXT(prev, NEXT(tmp));
} else {
REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp));
hostdata->issue_queue = NEXT(tmp);
}
- NEXT(tmp) = NULL;
+ SET_NEXT(tmp, NULL);
falcon_dont_release++;
/* reenable interrupts after finding one */
@@ -1192,7 +1193,7 @@ static void NCR5380_main(void *bl)
} else {
local_irq_disable();
LIST(tmp, hostdata->issue_queue);
- NEXT(tmp) = hostdata->issue_queue;
+ SET_NEXT(tmp, hostdata->issue_queue);
hostdata->issue_queue = tmp;
#ifdef SUPPORT_TAGS
cmd_free_tag(tmp);
@@ -2295,7 +2296,7 @@ static void NCR5380_information_transfer
local_irq_save(flags);
LIST(cmd,hostdata->issue_queue);
- NEXT(cmd) = hostdata->issue_queue;
+ SET_NEXT(cmd, hostdata->issue_queue);
hostdata->issue_queue = (Scsi_Cmnd *) cmd;
local_irq_restore(flags);
QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
@@ -2357,7 +2358,7 @@ static void NCR5380_information_transfer
local_irq_save(flags);
cmd->device->disconnect = 1;
LIST(cmd,hostdata->disconnected_queue);
- NEXT(cmd) = hostdata->disconnected_queue;
+ SET_NEXT(cmd, hostdata->disconnected_queue);
hostdata->connected = NULL;
hostdata->disconnected_queue = cmd;
local_irq_restore(flags);
@@ -2632,12 +2633,12 @@ static void NCR5380_reselect(struct Scsi
falcon_dont_release++;
if (prev) {
REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
- NEXT(prev) = NEXT(tmp);
+ SET_NEXT(prev, NEXT(tmp));
} else {
REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));
hostdata->disconnected_queue = NEXT(tmp);
}
- NEXT(tmp) = NULL;
+ SET_NEXT(tmp, NULL);
break;
}
}
@@ -2769,7 +2770,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
(*prev) = NEXT(tmp);
- NEXT(tmp) = NULL;
+ SET_NEXT(tmp, NULL);
tmp->result = DID_ABORT << 16;
local_irq_restore(flags);
ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n",
@@ -2844,7 +2845,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
*prev = NEXT(tmp);
- NEXT(tmp) = NULL;
+ SET_NEXT(tmp, NULL);
tmp->result = DID_ABORT << 16;
/* We must unlock the tag/LUN immediately here, since the
* target goes to BUS FREE and doesn't send us another
@@ -2965,7 +2966,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *
for (i = 0; (cmd = disconnected_queue); ++i) {
disconnected_queue = NEXT(cmd);
- NEXT(cmd) = NULL;
+ SET_NEXT(cmd, NULL);
cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
cmd->scsi_done(cmd);
}
--- linux-m68k-2.6.21.orig/drivers/scsi/atari_scsi.c
+++ linux-m68k-2.6.21/drivers/scsi/atari_scsi.c
@@ -69,9 +69,9 @@
#define NDEBUG (0)
-#define NDEBUG_ABORT 0x800000
-#define NDEBUG_TAGS 0x1000000
-#define NDEBUG_MERGING 0x2000000
+#define NDEBUG_ABORT 0x00100000
+#define NDEBUG_TAGS 0x00200000
+#define NDEBUG_MERGING 0x00400000
#define AUTOSENSE
/* For the Atari version, use only polled IO or REAL_DMA */
--- linux-m68k-2.6.21.orig/drivers/scsi/atari_scsi.h
+++ linux-m68k-2.6.21/drivers/scsi/atari_scsi.h
@@ -113,144 +113,58 @@ int atari_scsi_release (struct Scsi_Host
*
*/
-#if NDEBUG & NDEBUG_ARBITRATION
+#define dprint(flg, format...) \
+({ \
+ if (NDEBUG & (flg)) \
+ printk(KERN_DEBUG format); \
+})
+
#define ARB_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define ARB_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_AUTOSENSE
+ dprint(NDEBUG_ARBITRATION, format , ## args)
#define ASEN_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define ASEN_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_DMA
+ dprint(NDEBUG_AUTOSENSE, format , ## args)
#define DMA_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define DMA_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_HANDSHAKE
+ dprint(NDEBUG_DMA, format , ## args)
#define HSH_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define HSH_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_INFORMATION
+ dprint(NDEBUG_HANDSHAKE, format , ## args)
#define INF_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define INF_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_INIT
+ dprint(NDEBUG_INFORMATION, format , ## args)
#define INI_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define INI_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_INTR
+ dprint(NDEBUG_INIT, format , ## args)
#define INT_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define INT_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_LINKED
+ dprint(NDEBUG_INTR, format , ## args)
#define LNK_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define LNK_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_MAIN
+ dprint(NDEBUG_LINKED, format , ## args)
#define MAIN_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define MAIN_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_NO_DATAOUT
+ dprint(NDEBUG_MAIN, format , ## args)
#define NDAT_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define NDAT_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_NO_WRITE
+ dprint(NDEBUG_NO_DATAOUT, format , ## args)
#define NWR_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define NWR_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_PIO
+ dprint(NDEBUG_NO_WRITE, format , ## args)
#define PIO_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define PIO_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_PSEUDO_DMA
+ dprint(NDEBUG_PIO, format , ## args)
#define PDMA_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define PDMA_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_QUEUES
+ dprint(NDEBUG_PSEUDO_DMA, format , ## args)
#define QU_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define QU_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_RESELECTION
+ dprint(NDEBUG_QUEUES, format , ## args)
#define RSL_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define RSL_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_SELECTION
+ dprint(NDEBUG_RESELECTION, format , ## args)
#define SEL_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define SEL_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_USLEEP
+ dprint(NDEBUG_SELECTION, format , ## args)
#define USL_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define USL_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_LAST_BYTE_SENT
+ dprint(NDEBUG_USLEEP, format , ## args)
#define LBS_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define LBS_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_RESTART_SELECT
+ dprint(NDEBUG_LAST_BYTE_SENT, format , ## args)
#define RSS_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define RSS_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_EXTENDED
+ dprint(NDEBUG_RESTART_SELECT, format , ## args)
#define EXT_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define EXT_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_ABORT
+ dprint(NDEBUG_EXTENDED, format , ## args)
#define ABRT_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define ABRT_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_TAGS
+ dprint(NDEBUG_ABORT, format , ## args)
#define TAG_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define TAG_PRINTK(format, args...)
-#endif
-#if NDEBUG & NDEBUG_MERGING
+ dprint(NDEBUG_TAGS, format , ## args)
#define MER_PRINTK(format, args...) \
- printk(KERN_DEBUG format , ## args)
-#else
-#define MER_PRINTK(format, args...)
-#endif
+ dprint(NDEBUG_MERGING, format , ## args)
/* conditional macros for NCR5380_print_{,phase,status} */

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
Cc: James E.J. Bottomley <James.Bottomley@SteelEye.com>,
linux-scsi@vger.kernel.org
Subject: [PATCH] m68k: Atari SCSI workqueue updates
Workqueue updates for the Atari SCSI driver
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/atari_NCR5380.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/scsi/atari_NCR5380.c
+++ linux-m68k-2.6.21/drivers/scsi/atari_NCR5380.c
@@ -657,7 +657,7 @@ static inline void NCR5380_print_phase(s
#include <linux/interrupt.h>
static volatile int main_running;
-static DECLARE_WORK(NCR5380_tqueue, (void (*)(void *))NCR5380_main, NULL);
+static DECLARE_WORK(NCR5380_tqueue, NCR5380_main);
static inline void queue_main(void)
{
@@ -1075,7 +1075,7 @@ static int NCR5380_queue_command(Scsi_Cm
* reenable them. This prevents reentrancy and kernel stack overflow.
*/
-static void NCR5380_main(void *bl)
+static void NCR5380_main(struct work_struct *work)
{
Scsi_Cmnd *tmp, *prev;
struct Scsi_Host *instance = first_instance;

View File

@ -1,295 +0,0 @@
--- l/drivers/scsi/atari_scsi.c.org 2007-05-18 18:24:37.000000000 +0200
+++ l/drivers/scsi/atari_scsi.c 2007-05-20 21:31:46.000000000 +0200
@@ -186,17 +186,18 @@
/***************************** Prototypes *****************************/
#ifdef REAL_DMA
-static int scsi_dma_is_ignored_buserr(unsigned char dma_stat);
-static void atari_scsi_fetch_restbytes(void);
-static long atari_scsi_dma_residual(struct Scsi_Host *instance);
-static int falcon_classify_cmd(Scsi_Cmnd *cmd);
-static unsigned long atari_dma_xfer_len(unsigned long wanted_len,
- Scsi_Cmnd *cmd, int write_flag);
-#endif
-static irqreturn_t scsi_tt_intr(int irq, void *dummy);
-static irqreturn_t scsi_falcon_intr(int irq, void *dummy);
-static void falcon_release_lock_if_possible(struct NCR5380_hostdata *hostdata);
-static void falcon_get_lock(void);
+static int scsi_dma_is_ignored_buserr( unsigned char dma_stat );
+static void atari_scsi_fetch_restbytes( void );
+static long atari_scsi_dma_residual( struct Scsi_Host *instance );
+static int falcon_classify_cmd( Scsi_Cmnd *cmd );
+static unsigned long atari_dma_xfer_len( unsigned long wanted_len,
+ Scsi_Cmnd *cmd, int write_flag );
+#endif
+static irqreturn_t scsi_tt_intr( int irq, void *dummy);
+static irqreturn_t scsi_falcon_intr( int irq, void *dummy);
+static void falcon_release_lock_if_possible( struct NCR5380_hostdata *
+ hostdata );
+static int falcon_get_lock( void );
#ifdef CONFIG_ATARI_SCSI_RESET_BOOT
static void atari_scsi_reset_boot(void);
#endif
@@ -523,7 +524,9 @@
}
falcon_got_lock = 0;
stdma_release();
- wake_up(&falcon_fairness_wait);
+#if defined(FALCON_FAIRNESS_WAIT)
+ wake_up( &falcon_fairness_wait );
+#endif
}
local_irq_restore(flags);
@@ -544,21 +547,38 @@
* Complicated, complicated.... Sigh...
*/
-static void falcon_get_lock(void)
+/* MSch 20061229: atari_queue_command gets called from softirq context quite
+ * heavily in the 2.6 kernel series. Since atari_queue_command might need to
+ * sleep in order to grab the ST-DMA lock, I have modified falcon_get_lock to
+ * immediately return with error status if called in softirq context with the
+ * lock not currently held by the SCSI driver, and the ST-DMA locked by some
+ * other driver. atari_queue_command then returns SCSI_MLQUEUE_HOST_BUSY and
+ * prevents further commands from issueing.
+ */
+
+static int falcon_get_lock(void)
{
unsigned long flags;
if (IS_A_TT())
- return;
+ return 0;
local_irq_save(flags);
- while (!in_irq() && falcon_got_lock && stdma_others_waiting())
- sleep_on(&falcon_fairness_wait);
+#if defined (FALCON_FAIRNESS_WAIT)
+ while( !in_irq() && falcon_got_lock && stdma_others_waiting() )
+ sleep_on( &falcon_fairness_wait );
+#endif
while (!falcon_got_lock) {
if (in_irq())
panic("Falcon SCSI hasn't ST-DMA lock in interrupt");
+ /* we may not sleep in soft interrupts neither, so bail out */
+ if (in_softirq() && stdma_islocked()) {
+ printk(KERN_INFO "Falcon SCSI does not hold ST-DMA lock in softirq!\n" );
+ local_irq_restore(flags);
+ return 1;
+ }
if (!falcon_trying_lock) {
falcon_trying_lock = 1;
stdma_lock(scsi_falcon_intr, NULL);
@@ -573,6 +593,8 @@
local_irq_restore(flags);
if (!falcon_got_lock)
panic("Falcon SCSI: someone stole the lock :-(\n");
+
+ return 0;
}
@@ -845,7 +867,7 @@
} else {
atari_turnon_irq(IRQ_MFP_FSCSI);
}
- if ((rv & SCSI_RESET_ACTION) == SCSI_RESET_SUCCESS)
+ if (rv == SUCCESS)
falcon_release_lock_if_possible(hostdata);
return rv;
--- l/drivers/scsi/atari_NCR5380.c.org 2007-05-18 18:24:38.000000000 +0200
+++ l/drivers/scsi/atari_NCR5380.c 2007-05-20 21:29:39.000000000 +0200
@@ -475,12 +475,13 @@
int cnt = 1;
#endif
- for (endaddr = virt_to_phys(cmd->SCp.ptr + cmd->SCp.this_residual - 1) + 1;
- cmd->SCp.buffers_residual &&
- virt_to_phys(page_address(cmd->SCp.buffer[1].page) +
- cmd->SCp.buffer[1].offset) == endaddr;) {
- MER_PRINTK("VTOP(%p) == %08lx -> merging\n",
- page_address(cmd->SCp.buffer[1].page), endaddr);
+ for (endaddr = virt_to_phys(cmd->SCp.ptr + cmd->SCp.this_residual - 1) + 1;
+ cmd->SCp.buffers_residual &&
+ virt_to_phys(page_address(cmd->SCp.buffer[1].page)+
+ cmd->SCp.buffer[1].offset) == endaddr; ) {
+ MER_PRINTK("VTOP(%p) == %08lx -> merging\n",
+ page_address(cmd->SCp.buffer[1].page)+cmd->SCp.buffer[1].offset,
+ endaddr);
#if (NDEBUG & NDEBUG_MERGING)
++cnt;
#endif
@@ -998,6 +999,35 @@
}
#endif
+ local_irq_save(flags);
+ /* ++guenther: now that the issue queue is being set up, we can lock ST-DMA.
+ * Otherwise a running NCR5380_main may steal the lock.
+ * Lock before actually inserting due to fairness reasons explained in
+ * atari_scsi.c. If we insert first, then it's impossible for this driver
+ * to release the lock.
+ * Stop timer for this command while waiting for the lock, or timeouts
+ * may happen (and they really do), and it's no good if the command doesn't
+ * appear in any of the queues.
+ * ++roman: Just disabling the NCR interrupt isn't sufficient here,
+ * because also a timer int can trigger an abort or reset, which would
+ * alter queues and touch the lock.
+ */
+ if (!IS_A_TT()) {
+ int rv;
+ /* MSch: since we get called from softirq context here, and cannot
+ * sleep safely, the return status of falcon_get_lock is now used to
+ * figure out if we could successfully lock, or need to bail out.
+ * Signal the midlevel we're unable to queue the command in this case.
+ */
+ oldto = atari_scsi_update_timeout(cmd, 0);
+ rv = falcon_get_lock();
+ atari_scsi_update_timeout(cmd, oldto);
+ if (rv) {
+ local_irq_restore(flags);
+ return SCSI_MLQUEUE_HOST_BUSY;
+ }
+ }
+
/*
* We use the host_scribble field as a pointer to the next command
* in a queue
@@ -1015,24 +1045,6 @@
* sense data is only guaranteed to be valid while the condition exists.
*/
- local_irq_save(flags);
- /* ++guenther: now that the issue queue is being set up, we can lock ST-DMA.
- * Otherwise a running NCR5380_main may steal the lock.
- * Lock before actually inserting due to fairness reasons explained in
- * atari_scsi.c. If we insert first, then it's impossible for this driver
- * to release the lock.
- * Stop timer for this command while waiting for the lock, or timeouts
- * may happen (and they really do), and it's no good if the command doesn't
- * appear in any of the queues.
- * ++roman: Just disabling the NCR interrupt isn't sufficient here,
- * because also a timer int can trigger an abort or reset, which would
- * alter queues and touch the lock.
- */
- if (!IS_A_TT()) {
- oldto = atari_scsi_update_timeout(cmd, 0);
- falcon_get_lock();
- atari_scsi_update_timeout(cmd, oldto);
- }
if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
LIST(cmd, hostdata->issue_queue);
SET_NEXT(cmd, hostdata->issue_queue);
@@ -1056,10 +1068,9 @@
* If we're not in an interrupt, we can call NCR5380_main()
* unconditionally, because it cannot be already running.
*/
- if (in_interrupt() || ((flags >> 8) & 7) >= 6)
- queue_main();
- else
- NCR5380_main(NULL);
+
+ queue_main();
+
return 0;
}
@@ -2681,7 +2692,7 @@
* host byte of the result field to, if zero DID_ABORTED is
* used.
*
- * Returns : 0 - success, -1 on failure.
+ * Returns : SUCCESS - success, FAILED on failure.
*
* XXX - there is no way to abort the command that is currently
* connected, you have to wait for it to complete. If this is
@@ -2751,11 +2762,11 @@
local_irq_restore(flags);
cmd->scsi_done(cmd);
falcon_release_lock_if_possible(hostdata);
- return SCSI_ABORT_SUCCESS;
+ return SUCCESS;
} else {
/* local_irq_restore(flags); */
printk("scsi%d: abort of connected command failed!\n", HOSTNO);
- return SCSI_ABORT_ERROR;
+ return FAILED;
}
}
#endif
@@ -2779,7 +2790,7 @@
* yet... */
tmp->scsi_done(tmp);
falcon_release_lock_if_possible(hostdata);
- return SCSI_ABORT_SUCCESS;
+ return SUCCESS;
}
}
@@ -2797,7 +2808,7 @@
if (hostdata->connected) {
local_irq_restore(flags);
ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO);
- return SCSI_ABORT_SNOOZE;
+ return FAILED;
}
/*
@@ -2832,7 +2843,7 @@
ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO);
if (NCR5380_select(instance, cmd, (int)cmd->tag))
- return SCSI_ABORT_BUSY;
+ return FAILED;
ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO);
@@ -2859,7 +2870,7 @@
local_irq_restore(flags);
tmp->scsi_done(tmp);
falcon_release_lock_if_possible(hostdata);
- return SCSI_ABORT_SUCCESS;
+ return SUCCESS;
}
}
}
@@ -2885,7 +2896,7 @@
*/
falcon_release_lock_if_possible(hostdata);
- return SCSI_ABORT_NOT_RUNNING;
+ return SUCCESS;
}
@@ -2894,7 +2905,7 @@
*
* Purpose : reset the SCSI bus.
*
- * Returns : SCSI_RESET_WAKEUP
+ * Returns : SUCCESS
*
*/
@@ -2984,7 +2995,7 @@
* the midlevel code that the reset was SUCCESSFUL, and there is no
* need to 'wake up' the commands by a request_sense
*/
- return SCSI_RESET_SUCCESS | SCSI_RESET_BUS_RESET;
+ return SUCCESS;
#else /* 1 */
/* MSch: new-style reset handling: let the mid-level do what it can */
@@ -3032,6 +3043,6 @@
local_irq_restore(flags);
/* we did no complete reset of all commands, so a wakeup is required */
- return SCSI_RESET_WAKEUP | SCSI_RESET_BUS_RESET;
+ return SUCCESS;
#endif /* 1 */
}

View File

@ -1,84 +0,0 @@
--- l/include/asm-m68k/io.h.org 2007-05-18 18:24:41.000000000 +0200
+++ l/include/asm-m68k/io.h 2007-05-18 21:57:22.000000000 +0200
@@ -245,9 +245,16 @@
#if defined(CONFIG_ATARI_ROM_ISA)
#define isa_rom_inb(port) rom_in_8(isa_itb(port))
#define isa_rom_inw(port) (ISA_SEX ? rom_in_be16(isa_itw(port)) : rom_in_le16(isa_itw(port)))
+#define isa_rom_inl(port) (ISA_SEX ? rom_in_be32(isa_itw(port)) : rom_in_le32(isa_itw(port)))
#define isa_rom_outb(val,port) rom_out_8(isa_itb(port),(val))
#define isa_rom_outw(val,port) (ISA_SEX ? rom_out_be16(isa_itw(port),(val)) : rom_out_le16(isa_itw(port),(val)))
+#define isa_rom_outl(val,port) (ISA_SEX ? rom_out_be32(isa_itw(port),(val)) : rom_out_le32(isa_itw(port),(val)))
+
+#define isa_rom_readb(p) rom_in_8(isa_mtb((unsigned long)(p)))
+#define isa_rom_readw(p) \
+ (ISA_SEX ? rom_in_be16(isa_mtw((unsigned long)(p))) \
+ : rom_in_le16(isa_mtw((unsigned long)(p))))
#define isa_rom_writeb(val,p) rom_out_8(isa_mtb((unsigned long)(p)),(val))
#define isa_rom_writew(val,p) \
@@ -315,12 +322,20 @@
(ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \
raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+#define isa_rom_insl(port, buf, nr) \
+ (ISA_SEX ? raw_rom_insl(isa_itw(port), (u32 *)(buf), (nr)) : \
+ raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
#define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr))
#define isa_rom_outsw(port, buf, nr) \
(ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \
raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+#define isa_rom_outsl(port, buf, nr) \
+ (ISA_SEX ? raw_rom_outsl(isa_itw(port), (u32 *)(buf), (nr)) : \
+ raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
#endif
#endif /* CONFIG_ISA */
@@ -421,8 +436,16 @@
#define insb isa_rom_insb
#define insw isa_rom_insw
+#define insl isa_rom_insl
#define outsb isa_rom_outsb
#define outsw isa_rom_outsw
+#define outsl isa_rom_outsl
+
+#define readb isa_readb
+#define readw isa_readw
+#define writeb isa_writeb
+#define writew isa_writew
+
#endif
#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA)
--- l/include/asm-m68k/raw_io.h.org 2007-05-18 18:24:41.000000000 +0200
+++ l/include/asm-m68k/raw_io.h 2007-05-19 08:58:33.000000000 +0200
@@ -436,6 +436,24 @@
for (i = 0; i < nr; i++)
rom_out_le16(port, *buf++);
}
+
+static inline void raw_rom_insl(volatile u16 __iomem *port, u32 *buf,
+ unsigned int nr)
+{
+ unsigned int i;
+
+ for (i = 0; i < nr; i++)
+ *buf++ = rom_in_be32(port);
+}
+
+static inline void raw_rom_outsl(volatile u16 __iomem *port, const u32 *buf,
+ unsigned int nr)
+{
+ unsigned int i;
+
+ for (i = 0; i < nr; i++)
+ rom_out_be32(port, *buf++);
+}
#endif /* CONFIG_ATARI_ROM_ISA */
#endif /* __KERNEL__ */

View File

@ -1,21 +0,0 @@
Index: linux-2.6-2.6.21/drivers/parport/Kconfig
===================================================================
--- linux-2.6-2.6.21.orig/drivers/parport/Kconfig 2007-05-13 20:53:39.000000000 +0200
+++ linux-2.6-2.6.21/drivers/parport/Kconfig 2007-05-13 20:58:46.000000000 +0200
@@ -9,6 +9,7 @@
config PARPORT
tristate "Parallel port support"
+ depends on (!MAC || BROKEN)
---help---
If you want to use devices connected to your machine's parallel port
(the connector at the computer with 25 holes), e.g. printer, ZIP
@@ -34,7 +35,7 @@
config PARPORT_PC
tristate "PC-style hardware"
- depends on PARPORT && (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV
+ depends on PARPORT && (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && (!MAC || BROKEN)
---help---
You should say Y here if you have a PC-style parallel port. All
IBM PC compatible computers and some Alphas have PC-style

View File

@ -1,11 +0,0 @@
--- linux-2.6-2.6.21/sound/oss/dmasound/dmasound_paula.c 2007-05-13 19:12:09.000000000 +0200
+++ linux-2.6-2.6.21/sound/oss/dmasound/dmasound_paula.c 2007-05-13 19:12:19.000000000 +0200
@@ -607,7 +607,7 @@
* /dev/mixer abstraction
*/
-static void __init AmiMixerInit(void)
+static void AmiMixerInit(void)
{
dmasound.volume_left = 64;
dmasound.volume_right = 64;

View File

@ -1,468 +0,0 @@
Subject: [PATCH] m68k: early parameter support
From: Roman Zippel <zippel@linux-m68k.org>
Add early parameter support and convert current users to it.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/amiga/config.c | 41 ++++++++++++++++++++++-------------------
arch/m68k/atari/config.c | 17 +++++++++--------
arch/m68k/atari/debug.c | 24 ++++++++++++++----------
arch/m68k/kernel/setup.c | 39 +--------------------------------------
arch/m68k/mac/config.c | 8 --------
arch/m68k/mac/debug.c | 20 ++++++++++----------
arch/m68k/q40/config.c | 23 ++++++++++++++---------
arch/m68k/sun3x/prom.c | 11 +++++++----
8 files changed, 77 insertions(+), 106 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/amiga/config.c
+++ linux-m68k-2.6.21/arch/m68k/amiga/config.c
@@ -79,8 +79,6 @@ static char *amiga_models[] __initdata =
static char amiga_model_name[13] = "Amiga ";
-extern char m68k_debug_device[];
-
static void amiga_sched_init(irq_handler_t handler);
/* amiga specific irq functions */
extern void amiga_init_IRQ(void);
@@ -95,12 +93,10 @@ static unsigned int amiga_get_ss(void);
extern void amiga_mksound(unsigned int count, unsigned int ticks);
static void amiga_reset(void);
extern void amiga_init_sound(void);
-static void amiga_savekmsg_init(void);
static void amiga_mem_console_write(struct console *co, const char *b,
unsigned int count);
void amiga_serial_console_write(struct console *co, const char *s,
unsigned int count);
-static void amiga_debug_init(void);
#ifdef CONFIG_HEARTBEAT
static void amiga_heartbeat(int on);
#endif
@@ -370,7 +366,6 @@ void __init config_amiga(void)
{
int i;
- amiga_debug_init();
amiga_identify();
/* Yuk, we don't have PCI memory */
@@ -458,17 +453,6 @@ void __init config_amiga(void)
/* initialize chipram allocator */
amiga_chip_init();
- /* debugging using chipram */
- if (!strcmp(m68k_debug_device, "mem")) {
- if (!AMIGAHW_PRESENT(CHIP_RAM))
- printk("Warning: no chipram present for debugging\n");
- else {
- amiga_savekmsg_init();
- amiga_console_driver.write = amiga_mem_console_write;
- register_console(&amiga_console_driver);
- }
- }
-
/* our beloved beeper */
if (AMIGAHW_PRESENT(AMI_AUDIO))
amiga_init_sound();
@@ -787,17 +771,33 @@ static void amiga_mem_console_write(stru
}
}
-static void amiga_savekmsg_init(void)
+static int __init amiga_savekmsg_setup(char *arg)
{
static struct resource debug_res = { .name = "Debug" };
+ if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
+ goto done;
+
+ if (!AMIGAHW_PRESENT(CHIP_RAM)) {
+ printk("Warning: no chipram present for debugging\n");
+ goto done;
+ }
+
savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
savekmsg->magic1 = SAVEKMSG_MAGIC1;
savekmsg->magic2 = SAVEKMSG_MAGIC2;
savekmsg->magicptr = ZTWO_PADDR(savekmsg);
savekmsg->size = 0;
+
+ amiga_console_driver.write = amiga_mem_console_write;
+ register_console(&amiga_console_driver);
+
+done:
+ return 0;
}
+early_param("debug", amiga_savekmsg_setup);
+
static void amiga_serial_putc(char c)
{
amiga_custom.serdat = (unsigned char)c | 0x100;
@@ -872,15 +872,18 @@ void amiga_serial_gets(struct console *c
}
#endif
-static void __init amiga_debug_init(void)
+static int __init amiga_debug_setup(char *arg)
{
- if (!strcmp(m68k_debug_device, "ser" )) {
+ if (MACH_IS_AMIGA && !strcmp(arg, "ser")) {
/* no initialization required (?) */
amiga_console_driver.write = amiga_serial_console_write;
register_console(&amiga_console_driver);
}
+ return 0;
}
+early_param("debug", amiga_debug_setup);
+
#ifdef CONFIG_HEARTBEAT
static void amiga_heartbeat(int on)
{
--- linux-m68k-2.6.21.orig/arch/m68k/atari/config.c
+++ linux-m68k-2.6.21/arch/m68k/atari/config.c
@@ -69,9 +69,6 @@ extern int atari_tt_hwclk (int, struct r
extern int atari_mste_set_clock_mmss (unsigned long);
extern int atari_tt_set_clock_mmss (unsigned long);
-/* atari specific debug functions (in debug.c) */
-extern void atari_debug_init(void);
-
/* ++roman: This is a more elaborate test for an SCC chip, since the plain
* Medusa board generates DTACK at the SCC's standard addresses, but a SCC
@@ -137,15 +134,18 @@ int __init atari_parse_bootinfo(const st
/* Parse the Atari-specific switches= option. */
-void __init atari_switches_setup(const char *str, unsigned len)
+static int __init atari_switches_setup(char *str)
{
- char switches[len+1];
+ char switches[strlen(str) + 1];
char *p;
int ovsc_shift;
char *args = switches;
+ if (!MACH_IS_ATARI)
+ return 0;
+
/* copy string to local array, strsep works destructively... */
- strlcpy(switches, str, sizeof(switches));
+ strcpy(switches, str);
atari_switches = 0;
/* parse the options */
@@ -170,8 +170,11 @@ void __init atari_switches_setup(const c
atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
}
}
+ return 0;
}
+early_param("switches", atari_switches_setup);
+
/*
* Setup the Atari configuration info
@@ -183,8 +186,6 @@ void __init config_atari(void)
memset(&atari_hw_present, 0, sizeof(atari_hw_present));
- atari_debug_init();
-
/* Change size of I/O space from 64KB to 4GB. */
ioport_resource.end = 0xFFFFFFFF;
--- linux-m68k-2.6.21.orig/arch/m68k/atari/debug.c
+++ linux-m68k-2.6.21/arch/m68k/atari/debug.c
@@ -19,8 +19,6 @@
#include <asm/atarihw.h>
#include <asm/atariints.h>
-extern char m68k_debug_device[];
-
/* Flag that Modem1 port is already initialized and used */
int atari_MFP_init_done;
/* Flag that Modem1 port is already initialized and used */
@@ -305,26 +303,28 @@ void atari_init_midi_port(int cflag)
ACIA_RHTID : ACIA_RLTID);
}
-void __init atari_debug_init(void)
+static int __init atari_debug_setup(char *arg)
{
- if (!strcmp(m68k_debug_device, "ser")) {
+ if (!MACH_IS_ATARI)
+ return 0;
+
+ if (!strcmp(arg, "ser"))
/* defaults to ser2 for a Falcon and ser1 otherwise */
- strcpy(m68k_debug_device, MACH_IS_FALCON ? "ser2" : "ser1");
- }
+ arg = MACH_IS_FALCON ? "ser2" : "ser1";
- if (!strcmp(m68k_debug_device, "ser1")) {
+ if (!strcmp(arg, "ser1")) {
/* ST-MFP Modem1 serial port */
atari_init_mfp_port(B9600|CS8);
atari_console_driver.write = atari_mfp_console_write;
- } else if (!strcmp(m68k_debug_device, "ser2")) {
+ } else if (!strcmp(arg, "ser2")) {
/* SCC Modem2 serial port */
atari_init_scc_port(B9600|CS8);
atari_console_driver.write = atari_scc_console_write;
- } else if (!strcmp(m68k_debug_device, "midi")) {
+ } else if (!strcmp(arg, "midi")) {
/* MIDI port */
atari_init_midi_port(B9600|CS8);
atari_console_driver.write = atari_midi_console_write;
- } else if (!strcmp(m68k_debug_device, "par")) {
+ } else if (!strcmp(arg, "par")) {
/* parallel printer */
atari_turnoff_irq(IRQ_MFP_BUSY); /* avoid ints */
sound_ym.rd_data_reg_sel = 7; /* select mixer control */
@@ -337,4 +337,8 @@ void __init atari_debug_init(void)
}
if (atari_console_driver.write)
register_console(&atari_console_driver);
+
+ return 0;
}
+
+early_param("debug", atari_debug_setup);
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/setup.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/setup.c
@@ -71,9 +71,6 @@ static struct mem_info m68k_ramdisk;
static char m68k_command_line[CL_SIZE];
-char m68k_debug_device[6] = "";
-EXPORT_SYMBOL(m68k_debug_device);
-
void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL;
/* machine dependent irq functions */
void (*mach_init_IRQ) (void) __initdata = NULL;
@@ -215,7 +212,6 @@ void __init setup_arch(char **cmdline_p)
unsigned long endmem, startmem;
#endif
int i;
- char *p, *q;
/* The bootinfo is located right after the kernel bss */
m68k_parse_bootinfo((const struct bi_record *)&_end);
@@ -258,40 +254,7 @@ void __init setup_arch(char **cmdline_p)
*cmdline_p = m68k_command_line;
memcpy(boot_command_line, *cmdline_p, CL_SIZE);
- /* Parse the command line for arch-specific options.
- * For the m68k, this is currently only "debug=xxx" to enable printing
- * certain kernel messages to some machine-specific device.
- */
- for (p = *cmdline_p; p && *p;) {
- i = 0;
- if (!strncmp(p, "debug=", 6)) {
- strlcpy(m68k_debug_device, p+6, sizeof(m68k_debug_device));
- q = strchr(m68k_debug_device, ' ');
- if (q)
- *q = 0;
- i = 1;
- }
-#ifdef CONFIG_ATARI
- /* This option must be parsed very early */
- if (!strncmp(p, "switches=", 9)) {
- extern void atari_switches_setup(const char *, int);
- q = strchr(p + 9, ' ');
- atari_switches_setup(p + 9, q ? (q - (p + 9)) : strlen(p + 9));
- i = 1;
- }
-#endif
-
- if (i) {
- /* option processed, delete it */
- if ((q = strchr(p, ' ')))
- strcpy(p, q + 1);
- else
- *p = 0;
- } else {
- if ((p = strchr(p, ' ')))
- ++p;
- }
- }
+ parse_early_param();
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
--- linux-m68k-2.6.21.orig/arch/m68k/mac/config.c
+++ linux-m68k-2.6.21/arch/m68k/mac/config.c
@@ -82,10 +82,6 @@ extern void mac_mksound(unsigned int, un
extern void nubus_sweep_video(void);
-/* Mac specific debug functions (in debug.c) */
-extern void mac_debug_init(void);
-extern void mac_debugging_long(int, long);
-
static void mac_get_model(char *str);
static void mac_sched_init(irq_handler_t vector)
@@ -180,9 +176,6 @@ void __init config_mac(void)
mach_halt = mac_poweroff;
mach_power_off = mac_poweroff;
mach_max_dma_address = 0xffffffff;
-#if 0
- mach_debug_init = mac_debug_init;
-#endif
#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
mach_beep = mac_mksound;
#endif
@@ -802,7 +795,6 @@ void mac_identify(void)
/* the serial ports set to "Faster" mode in MacOS. */
iop_preinit();
- mac_debug_init();
printk(KERN_INFO "Detected Macintosh model: %d \n", model);
--- linux-m68k-2.6.21.orig/arch/m68k/mac/debug.c
+++ linux-m68k-2.6.21/arch/m68k/mac/debug.c
@@ -27,10 +27,6 @@
#include <asm/machw.h>
#include <asm/macints.h>
-extern char m68k_debug_device[];
-
-extern struct compat_bootinfo compat_boot_info;
-
extern unsigned long mac_videobase;
extern unsigned long mac_videodepth;
extern unsigned long mac_rowbytes;
@@ -360,16 +356,18 @@ void mac_init_sccb_port(int cflag)
mac_init_scc_port(cflag, 1);
}
-void __init mac_debug_init(void)
+static int __init mac_debug_setup(char *arg)
{
+ if (!MACH_IS_MAC)
+ return 0;
+
#ifdef DEBUG_SERIAL
- if (!strcmp(m68k_debug_device, "ser") ||
- !strcmp(m68k_debug_device, "ser1")) {
+ if (!strcmp(arg, "ser") || !strcmp(arg, "ser1")) {
/* Mac modem port */
mac_init_scc_port(B9600|CS8, 0);
mac_console_driver.write = mac_scca_console_write;
scc_port = 0;
- } else if (!strcmp(m68k_debug_device, "ser2")) {
+ } else if (!strcmp(arg, "ser2")) {
/* Mac printer port */
mac_init_scc_port(B9600|CS8, 1);
mac_console_driver.write = mac_sccb_console_write;
@@ -377,12 +375,14 @@ void __init mac_debug_init(void)
}
#endif
#ifdef DEBUG_HEADS
- if (!strcmp(m68k_debug_device, "scn") ||
- !strcmp(m68k_debug_device, "con")) {
+ if (!strcmp(arg, "scn") || !strcmp(arg, "con")) {
/* display, using head.S console routines */
mac_console_driver.write = mac_debug_console_write;
}
#endif
if (mac_console_driver.write)
register_console(&mac_console_driver);
+ return 0;
}
+
+early_param("debug", mac_debug_setup);
--- linux-m68k-2.6.21.orig/arch/m68k/q40/config.c
+++ linux-m68k-2.6.21/arch/m68k/q40/config.c
@@ -54,7 +54,6 @@ void q40_set_vectors(void);
extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/);
-extern char m68k_debug_device[];
static void q40_mem_console_write(struct console *co, const char *b,
unsigned int count);
@@ -62,6 +61,7 @@ extern int ql_ticks;
static struct console q40_console_driver = {
.name = "debug",
+ .write = q40_mem_console_write,
.flags = CON_PRINTBUFFER,
.index = -1,
};
@@ -85,6 +85,19 @@ static void q40_mem_console_write(struct
}
}
+static int __init q40_debug_setup(char *arg)
+{
+ /* useful for early debugging stages - writes kernel messages into SRAM */
+ if (MACH_IS_Q40 && !strncmp(arg, "mem", 3)) {
+ /*printk("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/
+ _cpleft = 2000 - ((long)q40_mem_cptr-0xff020000) / 4;
+ register_console(&q40_console_driver);
+ }
+ return 0;
+}
+
+early_param("debug", q40_debug_setup);
+
#if 0
void printq40(char *str)
{
@@ -194,14 +207,6 @@ void __init config_q40(void)
* all physical RAM fits into the boundary - otherwise
* allocator may play costly and useless tricks */
mach_max_dma_address = 1024*1024*1024;
-
- /* useful for early debugging stages - writes kernel messages into SRAM */
- if (!strncmp( m68k_debug_device,"mem", 3)) {
- /*printk("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/
- _cpleft = 2000 - ((long)q40_mem_cptr-0xff020000) / 4;
- q40_console_driver.write = q40_mem_console_write;
- register_console(&q40_console_driver);
- }
}
--- linux-m68k-2.6.21.orig/arch/m68k/sun3x/prom.c
+++ linux-m68k-2.6.21/arch/m68k/sun3x/prom.c
@@ -73,8 +73,6 @@ void sun3x_reboot(void)
(*romvec->pv_reboot)("vmlinux");
}
-extern char m68k_debug_device[];
-
static void sun3x_prom_write(struct console *co, const char *s,
unsigned int count)
{
@@ -119,13 +117,18 @@ void sun3x_prom_init(void)
* XXX this is futile since we restore the vbr first - oops
*/
vectors[VEC_TRAP14] = sun3x_prom_abort;
+}
+static int __init sun3x_debug_setup(char *arg)
+{
/* If debug=prom was specified, start the debug console */
-
- if (!strcmp(m68k_debug_device, "prom"))
+ if (MACH_IS_SUN3X && !strcmp(arg, "prom"))
register_console(&sun3x_debug);
+ return 0;
}
+early_param("debug", sun3x_debug_setup);
+
/* some prom functions to export */
int prom_getintdefault(int node, char *property, int deflt)
{

View File

@ -1,76 +0,0 @@
---
drivers/net/atari_ethernec.c | 42 ------------------------------------------
1 file changed, 42 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/atari_ethernec.c
+++ linux-m68k-2.6.21/drivers/net/atari_ethernec.c
@@ -225,14 +225,6 @@ static wait_queue_head_t WaitQ;
static struct delayed_work tqueue;
-#ifdef ETHERNEC_USE_POLL
-static struct {
- struct work_struct poll_queue;
- struct timer_list poll_timer;
- struct net_device *dev;
-} poll_ops;
-#endif
-
static struct net_device *poll_dev = NULL;
static void atari_ethernec_int(struct work_struct *work)
@@ -260,22 +252,6 @@ static void atari_ethernec_int(struct wo
schedule_delayed_work(&tqueue, 0); /* reduced delay from 1 */
}
-#ifdef ETHERNEC_USE_POLL
-static void atari_ethernec_poll_handler(unsigned long dev_addr)
-{
- struct net_device *dev = poll_dev;
-
- if (!dev || !dev->poll_controller)
- return;
-
- if (netif_running(dev))
- dev->poll_controller(dev);
-
- schedule_work(&poll_ops.poll_queue);
- mod_timer(&poll_ops.poll_timer, jiffies + HZ / 100);
-}
-#endif
-
static void atari_ethernec_start_poll(struct net_device *dev)
{
poll_dev = dev;
@@ -284,19 +260,6 @@ static void atari_ethernec_start_poll(st
INIT_DELAYED_WORK(&tqueue, atari_ethernec_int);
schedule_delayed_work(&tqueue, 1);
-#ifdef ETHERNEC_USE_POLL
- if (!poll_ops.poll_queue.func ||
- poll_ops.poll_queue.func == ei_interrupt) {
- if (!poll_ops.poll_queue.func)
- INIT_WORK(&poll_ops.poll_queue, ei_interrupt, dev);
-
- init_timer(&poll_ops.poll_timer);
- poll_ops.poll_timer.function = atari_ethernec_poll_handler;
- poll_ops.poll_timer.expires = jiffies + HZ / 5;
- poll_ops.poll_timer.data = (unsigned long)dev;
- add_timer(&poll_ops.poll_timer);
- }
-#endif
}
static void atari_ethernec_stop_poll(struct net_device *dev)
@@ -305,11 +268,6 @@ static void atari_ethernec_stop_poll(str
if (dev)
sleep_on(&WaitQ);
-
-#ifdef ETHERNEC_USE_POLL
- if (poll_ops.poll_queue.func == ei_interrupt)
- del_timer_sync(&poll_ops.poll_timer);
-#endif
}

View File

@ -1,46 +0,0 @@
Subject: [PATCH] m68k: Atari EtherNEC workqueue updates
Workqueue updates for the Atari EtherNEC driver
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/atari_ethernec.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/atari_ethernec.c
+++ linux-m68k-2.6.21/drivers/net/atari_ethernec.c
@@ -96,6 +96,7 @@ static const char version2[] =
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/jiffies.h>
+#include <linux/workqueue.h>
#include <asm/system.h>
#include <asm/atarihw.h>
@@ -222,7 +223,7 @@ static int use_poll;
*/
static wait_queue_head_t WaitQ;
-static struct work_struct tqueue;
+static struct delayed_work tqueue;
#ifdef ETHERNEC_USE_POLL
static struct {
@@ -234,7 +235,7 @@ static struct {
static struct net_device *poll_dev = NULL;
-static void atari_ethernec_int(unsigned long dev_addr)
+static void atari_ethernec_int(struct work_struct *work)
{
struct net_device *dev = poll_dev;
@@ -281,7 +282,7 @@ static void atari_ethernec_start_poll(st
init_waitqueue_head(&WaitQ);
- INIT_WORK(&tqueue, (void (*)(void *))atari_ethernec_int, dev);
+ INIT_DELAYED_WORK(&tqueue, atari_ethernec_int);
schedule_delayed_work(&tqueue, 1);
#ifdef ETHERNEC_USE_POLL
if (!poll_ops.poll_queue.func ||

View File

@ -1,22 +0,0 @@
Subject: [PATCH] m68k: Ratelimit ide_release_lock bug messages
Ratelimit the annoying ide_release_lock bug messages as attempting to release
the already released lock does not appear to cause any harm in practice.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/asm-m68k/ide.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -114,7 +114,8 @@ static __inline__ void ide_release_lock
{
if (MACH_IS_ATARI) {
if (falconide_intr_lock == 0) {
- printk("ide_release_lock: bug\n");
+ if (printk_ratelimit())
+ printk("ide_release_lock: bug\n");
return;
}
falconide_intr_lock = 0;

View File

@ -1,41 +0,0 @@
Subject: [PATCH] m68k: make Atari IDE lock reentrant
From Roman Zippel <zippel@linux-m68k.org>
Make the Atari IDE lock reentrant, as the new request is started in the
interrupt before the last one is completely released.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/asm-m68k/ide.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- linux-m68k-2.6.21.orig/include/asm-m68k/ide.h
+++ linux-m68k-2.6.21/include/asm-m68k/ide.h
@@ -117,8 +117,8 @@ static __inline__ void ide_release_lock
printk("ide_release_lock: bug\n");
return;
}
- falconide_intr_lock = 0;
- stdma_release();
+ if (!--falconide_intr_lock)
+ stdma_release();
}
}
@@ -126,12 +126,12 @@ static __inline__ void
ide_get_lock(irq_handler_t handler, void *data)
{
if (MACH_IS_ATARI) {
- if (falconide_intr_lock == 0) {
+ if (!falconide_intr_lock) {
if (in_interrupt() > 0)
panic( "Falcon IDE hasn't ST-DMA lock in interrupt" );
stdma_lock(handler, data);
- falconide_intr_lock = 1;
}
+ falconide_intr_lock++;
}
}
#endif /* CONFIG_BLK_DEV_FALCON_IDE */

View File

@ -1,21 +0,0 @@
Cc: parisc-linux@parisc-linux.org
Subject: [PATCH] hilkbd: Kill compiler warning and fix comment dyslexia
hilkbd: Kill compiler warning and fix comment dyslexia
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/input/keyboard/hilkbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-m68k-2.6.21.orig/drivers/input/keyboard/hilkbd.c
+++ linux-m68k-2.6.21/drivers/input/keyboard/hilkbd.c
@@ -52,7 +52,7 @@ MODULE_LICENSE("GPL v2");
#elif defined(CONFIG_HP300)
- #define HILBASE 0xf0428000 /* HP300 (m86k) port address */
+ #define HILBASE 0xf0428000UL /* HP300 (m68k) port address */
#define HIL_DATA 0x1
#define HIL_CMD 0x3
#define HIL_IRQ 2

View File

@ -1,30 +0,0 @@
Subject: [PATCH] lockdep: Add missing disable/enable irq variant
From: Roman Zippel <zippel@linux-m68k.org>
Add missing disable/enable irq variant
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/linux/interrupt.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- linux-m68k-2.6.21.orig/include/linux/interrupt.h
+++ linux-m68k-2.6.21/include/linux/interrupt.h
@@ -185,10 +185,14 @@ static inline int disable_irq_wake(unsig
* validator need to define the methods below in their asm/irq.h
* files, under an #ifdef CONFIG_LOCKDEP section.
*/
-# ifndef CONFIG_LOCKDEP
+#ifndef CONFIG_LOCKDEP
# define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
+# define disable_irq_nosync_lockdep_irqsave(irq, flags) \
+ disable_irq_nosync(irq)
# define disable_irq_lockdep(irq) disable_irq(irq)
# define enable_irq_lockdep(irq) enable_irq(irq)
+# define enable_irq_lockdep_irqrestore(irq, flags) \
+ enable_irq(irq)
# endif
#endif /* CONFIG_GENERIC_HARDIRQS */

View File

@ -1,30 +0,0 @@
Subject: [PATCH] Convert non-highmem kmap_atomic() to static inline function
Convert kmap_atomic() in the non-highmem case from a macro to a static
inline function, for better type-checking and the ability to pass void
pointers instead of struct page pointers.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/linux/highmem.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- linux-m68k-2.6.21.orig/include/linux/highmem.h
+++ linux-m68k-2.6.21/include/linux/highmem.h
@@ -42,8 +42,14 @@ static inline void *kmap(struct page *pa
#define kunmap(page) do { (void) (page); } while (0)
-#define kmap_atomic(page, idx) \
- ({ pagefault_disable(); page_address(page); })
+#include <asm/kmap_types.h>
+
+static inline void *kmap_atomic(struct page *page, enum km_type idx)
+{
+ pagefault_disable();
+ return page_address(page);
+}
+
#define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0)
#define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx))
#define kmap_atomic_to_page(ptr) virt_to_page(ptr)

View File

@ -1,186 +0,0 @@
Subject: [PATCH] scsi: m68k 53c7xx codingstyle cleanups
scsi: m68k 53c7xx codingstyle cleanups, as suggested by Christoph Hellwig
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/amiga7xx.c | 29 +++++++++++++++++------------
drivers/scsi/bvme6000_scsi.c | 20 ++++++++++++--------
drivers/scsi/mvme16x_scsi.c | 20 ++++++++++++--------
3 files changed, 41 insertions(+), 28 deletions(-)
--- a/drivers/scsi/amiga7xx.c
+++ b/drivers/scsi/amiga7xx.c
@@ -101,7 +101,6 @@ static int __devinit amiga7xx_init_one(s
}
hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
-
if (hostdata == NULL) {
printk(KERN_ERR "amiga7xx: Failed to allocate host data\n");
goto out_release;
@@ -124,9 +123,11 @@ static int __devinit amiga7xx_init_one(s
amiga7xx_scsi_driver_template.name = zdd->name;
/* and register the chip */
- if ((host = NCR_700_detect(&amiga7xx_scsi_driver_template, hostdata, &z->dev))
- == NULL) {
- printk(KERN_ERR "amiga7xx-scsi: No host detected; board configuration problem?\n");
+ host = NCR_700_detect(&amiga7xx_scsi_driver_template,
+ hostdata, &z->dev);
+ if (!host) {
+ printk(KERN_ERR "amiga7xx-scsi: No host detected; "
+ "board configuration problem?\n");
goto out_free;
}
@@ -134,7 +135,8 @@ static int __devinit amiga7xx_init_one(s
host->base = ioaddr;
host->irq = IRQ_AMIGA_PORTS;
- if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "amiga7xx-scsi", host)) {
+ if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED,
+ "amiga7xx-scsi", host)) {
printk(KERN_ERR "amiga7xx-scsi: request_irq failed\n");
goto out_put_host;
}
@@ -188,7 +190,8 @@ static int __devinit a4000t_probe(struct
if (!(MACH_IS_AMIGA && AMIGAHW_PRESENT(A4000_SCSI)))
goto out;
- if (!request_mem_region(A4000T_SCSI_ADDR, 0x1000, "A4000T builtin SCSI"))
+ if (!request_mem_region(A4000T_SCSI_ADDR, 0x1000,
+ "A4000T builtin SCSI"))
goto out;
hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
@@ -206,9 +209,10 @@ static int __devinit a4000t_probe(struct
hostdata->dcntl_extra = EA_710;
/* and register the chip */
- if ((host = NCR_700_detect(&amiga7xx_scsi_driver_template, hostdata, dev))
- == NULL) {
- printk(KERN_ERR "a4000t-scsi: No host detected; board configuration problem?\n");
+ host = NCR_700_detect(&amiga7xx_scsi_driver_template, hostdata, dev);
+ if (!host) {
+ printk(KERN_ERR "a4000t-scsi: No host detected; "
+ "board configuration problem?\n");
goto out_free;
}
@@ -262,11 +266,12 @@ static int __init amiga7xx_scsi_init(voi
{
int err;
- if ((err = driver_register(&a4000t_scsi_driver)))
+ err = driver_register(&a4000t_scsi_driver);
+ if (err)
return err;
- a4000t_scsi_device = platform_device_register_simple("a4000t-scsi", -1, NULL, 0);
-
+ a4000t_scsi_device = platform_device_register_simple("a4000t-scsi",
+ -1, NULL, 0);
if (IS_ERR(a4000t_scsi_device)) {
driver_unregister(&a4000t_scsi_driver);
return PTR_ERR(a4000t_scsi_device);
--- a/drivers/scsi/bvme6000_scsi.c
+++ b/drivers/scsi/bvme6000_scsi.c
@@ -44,7 +44,8 @@ bvme6000_probe(struct device *dev)
hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
if (hostdata == NULL) {
- printk(KERN_ERR "bvme6000-scsi: Failed to allocate host data\n");
+ printk(KERN_ERR "bvme6000-scsi: "
+ "Failed to allocate host data\n");
goto out;
}
memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
@@ -58,15 +59,17 @@ bvme6000_probe(struct device *dev)
hostdata->ctest7_extra = CTEST7_TT1;
/* and register the chip */
- if ((host = NCR_700_detect(&bvme6000_scsi_driver_template, hostdata, dev))
- == NULL) {
- printk(KERN_ERR "bvme6000-scsi: No host detected; board configuration problem?\n");
+ host = NCR_700_detect(&bvme6000_scsi_driver_template, hostdata, dev);
+ if (!host) {
+ printk(KERN_ERR "bvme6000-scsi: No host detected; "
+ "board configuration problem?\n");
goto out_free;
}
host->base = BVME_NCR53C710_BASE;
host->this_id = 7;
host->irq = BVME_IRQ_SCSI;
- if (request_irq(BVME_IRQ_SCSI, NCR_700_intr, 0, "bvme6000-scsi", host)) {
+ if (request_irq(BVME_IRQ_SCSI, NCR_700_intr, 0, "bvme6000-scsi",
+ host)) {
printk(KERN_ERR "bvme6000-scsi: request_irq failed\n");
goto out_put_host;
}
@@ -109,11 +112,12 @@ static int __init bvme6000_scsi_init(voi
{
int err;
- if ((err = driver_register(&bvme6000_scsi_driver)))
+ err = driver_register(&bvme6000_scsi_driver);
+ if (err)
return err;
- bvme6000_scsi_device = platform_device_register_simple("bvme6000-scsi", -1, NULL, 0);
-
+ bvme6000_scsi_device = platform_device_register_simple("bvme6000-scsi",
+ -1, NULL, 0);
if (IS_ERR(bvme6000_scsi_device)) {
driver_unregister(&bvme6000_scsi_driver);
return PTR_ERR(bvme6000_scsi_device);
--- a/drivers/scsi/mvme16x_scsi.c
+++ b/drivers/scsi/mvme16x_scsi.c
@@ -43,13 +43,15 @@ mvme16x_probe(struct device *dev)
goto out;
if (mvme16x_config & MVME16x_CONFIG_NO_SCSICHIP) {
- printk(KERN_INFO "mvme16x-scsi: detection disabled, SCSI chip not present\n");
+ printk(KERN_INFO "mvme16x-scsi: detection disabled, "
+ "SCSI chip not present\n");
goto out;
}
hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
if (hostdata == NULL) {
- printk(KERN_ERR "mvme16x-scsi: Failed to allocate host data\n");
+ printk(KERN_ERR "mvme16x-scsi: "
+ "Failed to allocate host data\n");
goto out;
}
memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
@@ -63,9 +65,10 @@ mvme16x_probe(struct device *dev)
hostdata->ctest7_extra = CTEST7_TT1;
/* and register the chip */
- if ((host = NCR_700_detect(&mvme16x_scsi_driver_template, hostdata, dev))
- == NULL) {
- printk(KERN_ERR "mvme16x-scsi: No host detected; board configuration problem?\n");
+ host = NCR_700_detect(&mvme16x_scsi_driver_template, hostdata, dev);
+ if (!host) {
+ printk(KERN_ERR "mvme16x-scsi: No host detected; "
+ "board configuration problem?\n");
goto out_free;
}
host->this_id = 7;
@@ -132,11 +135,12 @@ static int __init mvme16x_scsi_init(void
{
int err;
- if ((err = driver_register(&mvme16x_scsi_driver)))
+ err = driver_register(&mvme16x_scsi_driver);
+ if (err)
return err;
- mvme16x_scsi_device = platform_device_register_simple("mvme16x-scsi", -1, NULL, 0);
-
+ mvme16x_scsi_device = platform_device_register_simple("mvme16x-scsi",
+ -1, NULL, 0);
if (IS_ERR(mvme16x_scsi_device)) {
driver_unregister(&mvme16x_scsi_driver);
return PTR_ERR(mvme16x_scsi_device);

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
Subject: [PATCH] drivers/block/z2ram: Remove TRUE/FALSE defines
Cc: Jens Axboe <jens.axboe@oracle.com>
From: Richard Knutsson <ricknu-0@student.ltu.se>
Remove defines of TRUE and FALSE
* not used in the file
* the file is not included somewhere else
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/block/z2ram.c | 3 ---
1 file changed, 3 deletions(-)
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -44,9 +44,6 @@
extern int m68k_realnum_memory;
extern struct mem_info m68k_memory[NUM_MEMINFO];
-#define TRUE (1)
-#define FALSE (0)
-
#define Z2MINOR_COMBINED (0)
#define Z2MINOR_Z2ONLY (1)
#define Z2MINOR_CHIPONLY (2)

View File

@ -1,68 +0,0 @@
From alan@lxorguk.ukuu.org.uk Wed May 23 18:43:50 2007
Date: Wed, 23 May 2007 17:44:46 +0100
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: geert@linux-m68k.org, zippel@linux-m68k.org
Subject: [PATCH] m68k: Enable arbitary speed tty support
Add the needed constants and defines to activate the existing code.
Signed-off-by: Alan Cox <alan@redhat.com>
---
include/asm-m68k/ioctls.h | 4 ++++
include/asm-m68k/termbits.h | 5 ++++-
include/asm-m68k/termios.h | 6 ++++--
3 files changed, 12 insertions(+), 3 deletions(-)
--- a/include/asm-m68k/ioctls.h
+++ b/include/asm-m68k/ioctls.h
@@ -46,6 +46,10 @@
#define TIOCSBRK 0x5427 /* BSD compatibility */
#define TIOCCBRK 0x5428 /* BSD compatibility */
#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TCGETS2 _IOR('T',0x2A, struct termios2)
+#define TCSETS2 _IOW('T',0x2B, struct termios2)
+#define TCSETSW2 _IOW('T',0x2C, struct termios2)
+#define TCSETSF2 _IOW('T',0x2D, struct termios2)
#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
--- a/include/asm-m68k/termbits.h
+++ b/include/asm-m68k/termbits.h
@@ -141,6 +141,7 @@ struct ktermios {
#define HUPCL 0002000
#define CLOCAL 0004000
#define CBAUDEX 0010000
+#define BOTHER 0010000
#define B57600 0010001
#define B115200 0010002
#define B230400 0010003
@@ -156,10 +157,12 @@ struct ktermios {
#define B3000000 0010015
#define B3500000 0010016
#define B4000000 0010017
-#define CIBAUD 002003600000 /* input baud rate (not used) */
+#define CIBAUD 002003600000 /* input baud rate */
#define CMSPAR 010000000000 /* mark or space (stick) parity */
#define CRTSCTS 020000000000 /* flow control */
+#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
+
/* c_lflag bits */
#define ISIG 0000001
#define ICANON 0000002
--- a/include/asm-m68k/termios.h
+++ b/include/asm-m68k/termios.h
@@ -82,8 +82,10 @@ struct termio {
copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
})
-#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
-#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
+#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
+#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
#endif /* __KERNEL__ */

View File

@ -1,308 +0,0 @@
From: Al Viro <viro@zeniv.linux.org.uk>
Date: 1134413482 -0500
recent as(1) doesn't think that . terminates a macro name, so
getuser.l is _not_ treated as invoking getuser with .l as the
first argument.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
arch/m68k/math-emu/fp_cond.S | 2 +-
arch/m68k/math-emu/fp_decode.h | 4 ++--
arch/m68k/math-emu/fp_move.S | 14 +++++++-------
arch/m68k/math-emu/fp_movem.S | 16 ++++++++--------
arch/m68k/math-emu/fp_scan.S | 22 +++++++++++-----------
arch/m68k/math-emu/fp_util.S | 16 ++++++++--------
6 files changed, 37 insertions(+), 37 deletions(-)
3c4ab44571b5a46917ad28620995c326e386a909
diff --git a/arch/m68k/math-emu/fp_cond.S b/arch/m68k/math-emu/fp_cond.S
index ddae8b1..1cddeb0 100644
--- a/arch/m68k/math-emu/fp_cond.S
+++ b/arch/m68k/math-emu/fp_cond.S
@@ -163,7 +163,7 @@ fp_absolute_long:
fp_do_scc:
swap %d1
- putuser.b %d1,(%a0),fp_err_ua1,%a0
+ putuser .b,%d1,(%a0),fp_err_ua1,%a0
printf PDECODE,"\n"
jra fp_end
diff --git a/arch/m68k/math-emu/fp_decode.h b/arch/m68k/math-emu/fp_decode.h
index 759679d..a2595d9 100644
--- a/arch/m68k/math-emu/fp_decode.h
+++ b/arch/m68k/math-emu/fp_decode.h
@@ -311,7 +311,7 @@ debug move.l "(%sp)+,%d1"
btst #2,%d2
jne 1f
printf PDECODE,")@("
- getuser.l (%a1),%a1,fp_err_ua1,%a1
+ getuser .l,(%a1),%a1,fp_err_ua1,%a1
debug jra "2f"
1: printf PDECODE,","
2:
@@ -322,7 +322,7 @@ debug jra "2f"
btst #2,%d2
jeq 1f
printf PDECODE,")@("
- getuser.l (%a1),%a1,fp_err_ua1,%a1
+ getuser .l,(%a1),%a1,fp_err_ua1,%a1
debug jra "2f"
1: printf PDECODE,","
2:
diff --git a/arch/m68k/math-emu/fp_move.S b/arch/m68k/math-emu/fp_move.S
index 71bdf83..9bd0334 100644
--- a/arch/m68k/math-emu/fp_move.S
+++ b/arch/m68k/math-emu/fp_move.S
@@ -200,12 +200,12 @@ fp_putdest:
fp_format_long:
jsr fp_conv_ext2long
- putuser.l %d0,(%a1),fp_err_ua1,%a1
+ putuser .l,%d0,(%a1),fp_err_ua1,%a1
jra fp_finish_move
fp_format_single:
jsr fp_conv_ext2single
- putuser.l %d0,(%a1),fp_err_ua1,%a1
+ putuser .l,%d0,(%a1),fp_err_ua1,%a1
jra fp_finish_move
fp_format_extended:
@@ -213,11 +213,11 @@ fp_format_extended:
lsl.w #1,%d0
lsl.l #7,%d0
lsl.l #8,%d0
- putuser.l %d0,(%a1)+,fp_err_ua1,%a1
+ putuser .l,%d0,(%a1)+,fp_err_ua1,%a1
move.l (%a0)+,%d0
- putuser.l %d0,(%a1)+,fp_err_ua1,%a1
+ putuser .l,%d0,(%a1)+,fp_err_ua1,%a1
move.l (%a0),%d0
- putuser.l %d0,(%a1),fp_err_ua1,%a1
+ putuser .l,%d0,(%a1),fp_err_ua1,%a1
jra fp_finish_move
fp_format_packed:
@@ -227,7 +227,7 @@ fp_format_packed:
fp_format_word:
jsr fp_conv_ext2short
- putuser.w %d0,(%a1),fp_err_ua1,%a1
+ putuser .w,%d0,(%a1),fp_err_ua1,%a1
jra fp_finish_move
fp_format_double:
@@ -236,7 +236,7 @@ fp_format_double:
fp_format_byte:
jsr fp_conv_ext2byte
- putuser.b %d0,(%a1),fp_err_ua1,%a1
+ putuser .b,%d0,(%a1),fp_err_ua1,%a1
| jra fp_finish_move
fp_finish_move:
diff --git a/arch/m68k/math-emu/fp_movem.S b/arch/m68k/math-emu/fp_movem.S
index 8354d39..9c74134 100644
--- a/arch/m68k/math-emu/fp_movem.S
+++ b/arch/m68k/math-emu/fp_movem.S
@@ -141,14 +141,14 @@ fpr_do_movem:
| move register from memory into fpu
jra 3f
1: printf PMOVEM,"(%p>%p)",2,%a0,%a1
- getuser.l (%a0)+,%d2,fp_err_ua1,%a0
+ getuser .l,(%a0)+,%d2,fp_err_ua1,%a0
lsr.l #8,%d2
lsr.l #7,%d2
lsr.w #1,%d2
move.l %d2,(%a1)+
- getuser.l (%a0)+,%d2,fp_err_ua1,%a0
+ getuser .l,(%a0)+,%d2,fp_err_ua1,%a0
move.l %d2,(%a1)+
- getuser.l (%a0),%d2,fp_err_ua1,%a0
+ getuser .l,(%a0),%d2,fp_err_ua1,%a0
move.l %d2,(%a1)
subq.l #8,%a0
subq.l #8,%a1
@@ -164,11 +164,11 @@ fpr_do_movem:
lsl.w #1,%d2
lsl.l #7,%d2
lsl.l #8,%d2
- putuser.l %d2,(%a0)+,fp_err_ua1,%a0
+ putuser .l,%d2,(%a0)+,fp_err_ua1,%a0
move.l (%a1)+,%d2
- putuser.l %d2,(%a0)+,fp_err_ua1,%a0
+ putuser .l,%d2,(%a0)+,fp_err_ua1,%a0
move.l (%a1),%d2
- putuser.l %d2,(%a0),fp_err_ua1,%a0
+ putuser .l,%d2,(%a0),fp_err_ua1,%a0
subq.l #8,%a1
subq.l #8,%a0
add.l %d0,%a0
@@ -325,7 +325,7 @@ fpc_do_movem:
| move register from memory into fpu
jra 3f
1: printf PMOVEM,"(%p>%p)",2,%a0,%a1
- getuser.l (%a0)+,%d0,fp_err_ua1,%a0
+ getuser .l,(%a0)+,%d0,fp_err_ua1,%a0
move.l %d0,(%a1)
2: addq.l #4,%a1
3: lsl.b #1,%d1
@@ -336,7 +336,7 @@ fpc_do_movem:
| move register from fpu into memory
1: printf PMOVEM,"(%p>%p)",2,%a1,%a0
move.l (%a1),%d0
- putuser.l %d0,(%a0)+,fp_err_ua1,%a0
+ putuser .l,%d0,(%a0)+,fp_err_ua1,%a0
2: addq.l #4,%a1
4: lsl.b #1,%d1
jcs 1b
diff --git a/arch/m68k/math-emu/fp_scan.S b/arch/m68k/math-emu/fp_scan.S
index e4146ed..5f49b93 100644
--- a/arch/m68k/math-emu/fp_scan.S
+++ b/arch/m68k/math-emu/fp_scan.S
@@ -64,7 +64,7 @@ fp_scan:
| normal fpu instruction? (this excludes fsave/frestore)
fp_get_pc %a0
printf PDECODE,"%08x: ",1,%a0
- getuser.b (%a0),%d0,fp_err_ua1,%a0
+ getuser .b,(%a0),%d0,fp_err_ua1,%a0
#if 1
cmp.b #0xf2,%d0 | cpid = 1
#else
@@ -72,7 +72,7 @@ fp_scan:
#endif
jne fp_nonstd
| first two instruction words are kept in %d2
- getuser.l (%a0)+,%d2,fp_err_ua1,%a0
+ getuser .l,(%a0)+,%d2,fp_err_ua1,%a0
fp_put_pc %a0
fp_decode_cond: | separate conditional instr
fp_decode_cond_instr_type
@@ -230,7 +230,7 @@ fp_immediate:
movel %a0,%a1
clr.l %d1
jra 2f
-1: getuser.b (%a1)+,%d1,fp_err_ua1,%a1
+1: getuser .b,(%a1)+,%d1,fp_err_ua1,%a1
printf PDECODE,"%02x",1,%d1
2: dbra %d0,1b
movem.l (%sp)+,%d0/%d1
@@ -252,24 +252,24 @@ fp_fetchsource:
.long fp_byte, fp_ill
fp_long:
- getuser.l (%a1),%d0,fp_err_ua1,%a1
+ getuser .l,(%a1),%d0,fp_err_ua1,%a1
jsr fp_conv_long2ext
jra fp_getdest
fp_single:
- getuser.l (%a1),%d0,fp_err_ua1,%a1
+ getuser .l,(%a1),%d0,fp_err_ua1,%a1
jsr fp_conv_single2ext
jra fp_getdest
fp_ext:
- getuser.l (%a1)+,%d0,fp_err_ua1,%a1
+ getuser .l,(%a1)+,%d0,fp_err_ua1,%a1
lsr.l #8,%d0
lsr.l #7,%d0
lsr.w #1,%d0
move.l %d0,(%a0)+
- getuser.l (%a1)+,%d0,fp_err_ua1,%a1
+ getuser .l,(%a1)+,%d0,fp_err_ua1,%a1
move.l %d0,(%a0)+
- getuser.l (%a1),%d0,fp_err_ua1,%a1
+ getuser .l,(%a1),%d0,fp_err_ua1,%a1
move.l %d0,(%a0)
subq.l #8,%a0
jra fp_getdest
@@ -279,7 +279,7 @@ fp_pack:
jra fp_ill
fp_word:
- getuser.w (%a1),%d0,fp_err_ua1,%a1
+ getuser .w,(%a1),%d0,fp_err_ua1,%a1
ext.l %d0
jsr fp_conv_long2ext
jra fp_getdest
@@ -289,7 +289,7 @@ fp_double:
jra fp_getdest
fp_byte:
- getuser.b (%a1),%d0,fp_err_ua1,%a1
+ getuser .b,(%a1),%d0,fp_err_ua1,%a1
extb.l %d0
jsr fp_conv_long2ext
| jra fp_getdest
@@ -465,7 +465,7 @@ fp_fdsub:
fp_nonstd:
fp_get_pc %a0
- getuser.l (%a0),%d0,fp_err_ua1,%a0
+ getuser .l,(%a0),%d0,fp_err_ua1,%a0
printf ,"nonstd ((%08x)=%08x)\n",2,%a0,%d0
moveq #-1,%d0
rts
diff --git a/arch/m68k/math-emu/fp_util.S b/arch/m68k/math-emu/fp_util.S
index a9f7f01..f9f24d5 100644
--- a/arch/m68k/math-emu/fp_util.S
+++ b/arch/m68k/math-emu/fp_util.S
@@ -160,11 +160,11 @@ fp_s2e_large:
fp_conv_double2ext:
#ifdef FPU_EMU_DEBUG
- getuser.l %a1@(0),%d0,fp_err_ua2,%a1
- getuser.l %a1@(4),%d1,fp_err_ua2,%a1
+ getuser .l,%a1@(0),%d0,fp_err_ua2,%a1
+ getuser .l,%a1@(4),%d1,fp_err_ua2,%a1
printf PCONV,"d2e: %p%p -> %p(",3,%d0,%d1,%a0
#endif
- getuser.l (%a1)+,%d0,fp_err_ua2,%a1
+ getuser .l,(%a1)+,%d0,fp_err_ua2,%a1
move.l %d0,%d1
lsl.l #8,%d0 | shift high mantissa
lsl.l #3,%d0
@@ -178,7 +178,7 @@ fp_conv_double2ext:
add.w #0x3fff-0x3ff,%d1 | re-bias the exponent.
9: move.l %d1,(%a0)+ | fp_ext.sign, fp_ext.exp
move.l %d0,(%a0)+
- getuser.l (%a1)+,%d0,fp_err_ua2,%a1
+ getuser .l,(%a1)+,%d0,fp_err_ua2,%a1
move.l %d0,%d1
lsl.l #8,%d0
lsl.l #3,%d0
@@ -1287,17 +1287,17 @@ fp_conv_ext2double:
lsr.l #4,%d0
lsr.l #8,%d0
or.l %d2,%d0
- putuser.l %d0,(%a1)+,fp_err_ua2,%a1
+ putuser .l,%d0,(%a1)+,fp_err_ua2,%a1
moveq #21,%d0
lsl.l %d0,%d1
move.l (%a0),%d0
lsr.l #4,%d0
lsr.l #7,%d0
or.l %d1,%d0
- putuser.l %d0,(%a1),fp_err_ua2,%a1
+ putuser .l,%d0,(%a1),fp_err_ua2,%a1
#ifdef FPU_EMU_DEBUG
- getuser.l %a1@(-4),%d0,fp_err_ua2,%a1
- getuser.l %a1@(0),%d1,fp_err_ua2,%a1
+ getuser .l,%a1@(-4),%d0,fp_err_ua2,%a1
+ getuser .l,%a1@(0),%d1,fp_err_ua2,%a1
printf PCONV,"%p(%08x%08x)\n",3,%a1,%d0,%d1
#endif
rts
--
0.99.9.GIT
-
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

View File

@ -1,36 +0,0 @@
Subject: [PATCH] m68k: Don't include RODATA into text segment
From: Roman Zippel <zippel@linux-m68k.org>
Don't include RODATA into text segment as it includes the kallsyms data
and can cause spurious link failures (layout differences can change the
number of symbols in kallsym, i.e. when a symbol is equal to _etext it's
not included).
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/kernel/vmlinux-std.lds | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -18,6 +18,8 @@ SECTIONS
*(.gnu.warning)
} :text = 0x4e75
+ _etext = .; /* End of text section */
+
. = ALIGN(16); /* Exception table */
__start___ex_table = .;
__ex_table : { *(__ex_table) }
@@ -25,8 +27,6 @@ SECTIONS
RODATA
- _etext = .; /* End of text section */
-
.data : { /* Data */
DATA_DATA
CONSTRUCTORS

View File

@ -1,234 +0,0 @@
From jongk@linux-m68k.org Fri Nov 3 10:12:53 2006
Date: Fri, 03 Nov 2006 00:06:13 +0100
From: Kars de Jong <jongk@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@vger.kernel.org
Subject: [RFC PATCH] m68k: GENERIC_IOMAP support
On do, 2006-11-02 at 22:34 +0100, Geert Uytterhoeven wrote:
> > OK, here's the patch, without the m68k generic iomap changes.
>
> Ah, the missing io{read,write}*() stuff :-)
And here is the proposed patch to add iomap support. I think we need to
rethink our I/O support when we want to support all our I/O buses
properly, but that has been discussed before. I will commit my Amiga
PCMCIA support soon, I promise!
I'm personally in favour of dropping the "generic" m68k kernel support.
Even a specific 2.6.18 kernel with only MVME167 support and the bare
essentials is already 2.5 MBytes these days. I don't even dare to think
of the size of a generic m68k kernel these days.
Since Debian also builds "specific" kernels these days, I wonder if we
still need "generic" installation type kernels. Dropping that support
does make implementing some of the I/O stuff a lot easier, IMO, since it
can then be done at compile time.
On vr, 2006-11-03 at 00:06 +0100, Kars de Jong wrote:
> On do, 2006-11-02 at 22:34 +0100, Geert Uytterhoeven wrote:
> > > OK, here's the patch, without the m68k generic iomap changes.
> >
> > Ah, the missing io{read,write}*() stuff :-)
>
> And here is the proposed patch to add iomap support. I think we need to
> rethink our I/O support when we want to support all our I/O buses
> properly, but that has been discussed before. I will commit my Amiga
> PCMCIA support soon, I promise!
Here's the updated version of this patch. It should now work with Amiga
and Q40 defconfig.
I don't think the CONFIG_ATARI_ROM_ISA definitions are complete yet, the
32-bit variants are missing.
Kind regards,
Kars.
---
arch/m68k/Kconfig | 4 ++
include/asm-m68k/io.h | 63 +++++++++++++++++++++++++++++++++++++---------
include/asm-m68k/raw_io.h | 8 ++++-
3 files changed, 61 insertions(+), 14 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/Kconfig
+++ linux-m68k-2.6.21/arch/m68k/Kconfig
@@ -37,6 +37,10 @@ config TIME_LOW_RES
bool
default y
+config GENERIC_IOMAP
+ bool
+ default y
+
config ARCH_MAY_HAVE_PC_FDC
bool
depends on Q40 || (BROKEN && SUN3X)
--- linux-m68k-2.6.21.orig/include/asm-m68k/io.h
+++ linux-m68k-2.6.21/include/asm-m68k/io.h
@@ -27,6 +27,7 @@
#include <asm/raw_io.h>
#include <asm/virtconvert.h>
+#include <asm-generic/iomap.h>
#ifdef CONFIG_ATARI
#include <asm/atarihw.h>
@@ -175,6 +176,16 @@ static inline u16 __iomem *isa_itw(unsig
default: return NULL; /* avoid warnings, just in case */
}
}
+static inline u32 __iomem *isa_itl(unsigned long addr)
+{
+ switch(ISA_TYPE)
+ {
+#ifdef CONFIG_AMIGA_PCMCIA
+ case AG_ISA: return (u32 *)AG_ISA_IO_W(addr);
+#endif
+ default: return 0; /* avoid warnings, just in case */
+ }
+}
static inline u8 __iomem *isa_mtb(unsigned long addr)
{
switch(ISA_TYPE)
@@ -217,8 +228,10 @@ static inline u16 __iomem *isa_mtw(unsig
#define isa_inb(port) in_8(isa_itb(port))
#define isa_inw(port) (ISA_SEX ? in_be16(isa_itw(port)) : in_le16(isa_itw(port)))
+#define isa_inl(port) (ISA_SEX ? in_be32(isa_itl(port)) : in_le32(isa_itl(port)))
#define isa_outb(val,port) out_8(isa_itb(port),(val))
#define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_le16(isa_itw(port),(val)))
+#define isa_outl(val,port) (ISA_SEX ? out_be32(isa_itl(port),(val)) : out_le32(isa_itl(port),(val)))
#define isa_readb(p) in_8(isa_mtb((unsigned long)(p)))
#define isa_readw(p) \
@@ -280,6 +293,14 @@ static inline void isa_delay(void)
(ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \
raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
+#define isa_insl(port, buf, nr) \
+ (ISA_SEX ? raw_insl(isa_itl(port), (u32 *)(buf), (nr)) : \
+ raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
+#define isa_outsl(port, buf, nr) \
+ (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \
+ raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
#if defined(CONFIG_ATARI_ROM_ISA)
#define isa_rom_inb_p(p) ({ u8 _v = isa_rom_inb(p); isa_delay(); _v; })
#define isa_rom_inw_p(p) ({ u16 _v = isa_rom_inw(p); isa_delay(); _v; })
@@ -314,14 +335,16 @@ static inline void isa_delay(void)
#define inw_p isa_inw_p
#define outw isa_outw
#define outw_p isa_outw_p
-#define inl isa_inw
-#define inl_p isa_inw_p
-#define outl isa_outw
-#define outl_p isa_outw_p
+#define inl isa_inl
+#define inl_p isa_inl_p
+#define outl isa_outl
+#define outl_p isa_outl_p
#define insb isa_insb
#define insw isa_insw
+#define insl isa_insl
#define outsb isa_outsb
#define outsw isa_outsw
+#define outsl isa_outsl
#define readb isa_readb
#define readw isa_readw
#define writeb isa_writeb
@@ -330,8 +353,6 @@ static inline void isa_delay(void)
#if defined(CONFIG_PCI)
-#define inl(port) in_le32(port)
-#define outl(val,port) out_le32((port),(val))
#define readl(addr) in_le32(addr)
#define writel(val,addr) out_le32((addr),(val))
@@ -346,10 +367,13 @@ static inline void isa_delay(void)
#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
/*
@@ -401,20 +425,35 @@ static inline void isa_delay(void)
#define outsw isa_rom_outsw
#endif
-#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA) && defined(CONFIG_HP300)
+#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA)
/*
- * We need to define dummy functions otherwise drivers/serial/8250.c doesn't link
+ * We need to define dummy functions for GENERIC_IOMAP support.
*/
-#define inb(port) 0xff
-#define inb_p(port) 0xff
-#define outb(val,port) do { } while (0)
-#define outb_p(val,port) do { } while (0)
+#define inb(port) 0xff
+#define inb_p(port) 0xff
+#define outb(val,port) do { } while (0)
+#define outb_p(val,port) do { } while (0)
+#define inw(port) 0xffff
+#define outw(val,port) do { } while (0)
+#define inl(port) 0xffffffffUL
+#define outl(val,port) do { } while (0)
+
+#define insb(port,buf,nr) do { } while (0)
+#define outsb(port,buf,nr) do { } while (0)
+#define insw(port,buf,nr) do { } while (0)
+#define outsw(port,buf,nr) do { } while (0)
+#define insl(port,buf,nr) do { } while (0)
+#define outsl(port,buf,nr) do { } while (0)
/*
* These should be valid on any ioremap()ed region
*/
#define readb(addr) in_8(addr)
#define writeb(val,addr) out_8((addr),(val))
+#define readw(addr) in_le16(addr)
+#define writew(val,addr) out_le16((addr),(val))
+#endif /* !CONFIG_ISA && !CONFIG_PCI && !CONFIG_ATARI_ROM_ISA */
+#if !defined(CONFIG_PCI)
#define readl(addr) in_le32(addr)
#define writel(val,addr) out_le32((addr),(val))
#endif
--- linux-m68k-2.6.21.orig/include/asm-m68k/raw_io.h
+++ linux-m68k-2.6.21/include/asm-m68k/raw_io.h
@@ -49,10 +49,16 @@ extern void __iounmap(void *addr, unsign
#define raw_inb in_8
#define raw_inw in_be16
#define raw_inl in_be32
+#define __raw_readb in_8
+#define __raw_readw in_be16
+#define __raw_readl in_be32
#define raw_outb(val,port) out_8((port),(val))
#define raw_outw(val,port) out_be16((port),(val))
#define raw_outl(val,port) out_be32((port),(val))
+#define __raw_writeb(val,addr) out_8((addr),(val))
+#define __raw_writew(val,addr) out_be16((addr),(val))
+#define __raw_writel(val,addr) out_be32((addr),(val))
/*
* Atari ROM port (cartridge port) ISA adapter, used for the EtherNEC NE2000
@@ -432,8 +438,6 @@ static inline void raw_rom_outsw_swapw(v
}
#endif /* CONFIG_ATARI_ROM_ISA */
-#define __raw_writel raw_outl
-
#endif /* __KERNEL__ */
#endif /* _RAW_IO_H */

View File

@ -1,20 +0,0 @@
Subject: [PATCH] m68k: CROSS_COMPILE = m68k-linux-gnu-
Recent cross-compilers are called m68k-linux-gnu-gcc instead of m68k-linux-gcc
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-m68k-2.6.21.orig/arch/m68k/Makefile
+++ linux-m68k-2.6.21/arch/m68k/Makefile
@@ -21,7 +21,7 @@ AS += -m68020
LDFLAGS := -m m68kelf
ifneq ($(COMPILE_ARCH),$(ARCH))
# prefix for cross-compiling binaries
- CROSS_COMPILE = m68k-linux-
+ CROSS_COMPILE = m68k-linux-gnu-
endif
ifdef CONFIG_SUN3

View File

@ -1,348 +0,0 @@
Subject: [PATCH] m68k: BVME6000 and MVME16x SCSI driver rename
Rename the source files for the BVME6000 and MVME16x SCSI drivers from *.c to
*_scsi.c
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/Makefile | 4 +-
drivers/scsi/bvme6000.c | 76 -----------------------------------------
drivers/scsi/bvme6000_scsi.c | 76 +++++++++++++++++++++++++++++++++++++++++
drivers/scsi/mvme16x.c | 78 -------------------------------------------
drivers/scsi/mvme16x_scsi.c | 78 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 156 insertions(+), 156 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/scsi/Makefile
+++ linux-m68k-2.6.21/drivers/scsi/Makefile
@@ -53,8 +53,8 @@ obj-$(CONFIG_ATARI_SCSI) += atari_scsi.o
obj-$(CONFIG_MAC_SCSI) += mac_scsi.o
obj-$(CONFIG_SCSI_MAC_ESP) += mac_esp.o NCR53C9x.o
obj-$(CONFIG_SUN3_SCSI) += sun3_scsi.o sun3_scsi_vme.o
-obj-$(CONFIG_MVME16x_SCSI) += mvme16x.o 53c7xx.o
-obj-$(CONFIG_BVME6000_SCSI) += bvme6000.o 53c7xx.o
+obj-$(CONFIG_MVME16x_SCSI) += mvme16x_scsi.o 53c7xx.o
+obj-$(CONFIG_BVME6000_SCSI) += bvme6000_scsi.o 53c7xx.o
obj-$(CONFIG_SCSI_SIM710) += 53c700.o sim710.o
obj-$(CONFIG_SCSI_ADVANSYS) += advansys.o
obj-$(CONFIG_SCSI_PSI240I) += psi240i.o
--- linux-m68k-2.6.21.orig/drivers/scsi/bvme6000.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Detection routine for the NCR53c710 based BVME6000 SCSI Controllers for Linux.
- *
- * Based on work by Alan Hourihane
- */
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/blkdev.h>
-#include <linux/zorro.h>
-
-#include <asm/setup.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
-#include <asm/bvme6000hw.h>
-#include <asm/irq.h>
-
-#include "scsi.h"
-#include <scsi/scsi_host.h>
-#include "53c7xx.h"
-#include "bvme6000.h"
-
-#include<linux/stat.h>
-
-
-int bvme6000_scsi_detect(struct scsi_host_template *tpnt)
-{
- static unsigned char called = 0;
- int clock;
- long long options;
-
- if (called)
- return 0;
- if (!MACH_IS_BVME6000)
- return 0;
-
- tpnt->proc_name = "BVME6000";
-
- options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
-
- clock = 40000000; /* 66MHz SCSI Clock */
-
- ncr53c7xx_init(tpnt, 0, 710, (unsigned long)BVME_NCR53C710_BASE,
- 0, BVME_IRQ_SCSI, DMA_NONE,
- options, clock);
- called = 1;
- return 1;
-}
-
-static int bvme6000_scsi_release(struct Scsi_Host *shost)
-{
- if (shost->irq)
- free_irq(shost->irq, NULL);
- if (shost->dma_channel != 0xff)
- free_dma(shost->dma_channel);
- if (shost->io_port && shost->n_io_port)
- release_region(shost->io_port, shost->n_io_port);
- scsi_unregister(shost);
- return 0;
-}
-
-static struct scsi_host_template driver_template = {
- .name = "BVME6000 NCR53c710 SCSI",
- .detect = bvme6000_scsi_detect,
- .release = bvme6000_scsi_release,
- .queuecommand = NCR53c7xx_queue_command,
- .abort = NCR53c7xx_abort,
- .reset = NCR53c7xx_reset,
- .can_queue = 24,
- .this_id = 7,
- .sg_tablesize = 63,
- .cmd_per_lun = 3,
- .use_clustering = DISABLE_CLUSTERING
-};
-
-
-#include "scsi_module.c"
--- /dev/null
+++ linux-m68k-2.6.21/drivers/scsi/bvme6000_scsi.c
@@ -0,0 +1,76 @@
+/*
+ * Detection routine for the NCR53c710 based BVME6000 SCSI Controllers for Linux.
+ *
+ * Based on work by Alan Hourihane
+ */
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/blkdev.h>
+#include <linux/zorro.h>
+
+#include <asm/setup.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/bvme6000hw.h>
+#include <asm/irq.h>
+
+#include "scsi.h"
+#include <scsi/scsi_host.h>
+#include "53c7xx.h"
+#include "bvme6000.h"
+
+#include<linux/stat.h>
+
+
+int bvme6000_scsi_detect(struct scsi_host_template *tpnt)
+{
+ static unsigned char called = 0;
+ int clock;
+ long long options;
+
+ if (called)
+ return 0;
+ if (!MACH_IS_BVME6000)
+ return 0;
+
+ tpnt->proc_name = "BVME6000";
+
+ options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
+
+ clock = 40000000; /* 66MHz SCSI Clock */
+
+ ncr53c7xx_init(tpnt, 0, 710, (unsigned long)BVME_NCR53C710_BASE,
+ 0, BVME_IRQ_SCSI, DMA_NONE,
+ options, clock);
+ called = 1;
+ return 1;
+}
+
+static int bvme6000_scsi_release(struct Scsi_Host *shost)
+{
+ if (shost->irq)
+ free_irq(shost->irq, NULL);
+ if (shost->dma_channel != 0xff)
+ free_dma(shost->dma_channel);
+ if (shost->io_port && shost->n_io_port)
+ release_region(shost->io_port, shost->n_io_port);
+ scsi_unregister(shost);
+ return 0;
+}
+
+static struct scsi_host_template driver_template = {
+ .name = "BVME6000 NCR53c710 SCSI",
+ .detect = bvme6000_scsi_detect,
+ .release = bvme6000_scsi_release,
+ .queuecommand = NCR53c7xx_queue_command,
+ .abort = NCR53c7xx_abort,
+ .reset = NCR53c7xx_reset,
+ .can_queue = 24,
+ .this_id = 7,
+ .sg_tablesize = 63,
+ .cmd_per_lun = 3,
+ .use_clustering = DISABLE_CLUSTERING
+};
+
+
+#include "scsi_module.c"
--- linux-m68k-2.6.21.orig/drivers/scsi/mvme16x.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Detection routine for the NCR53c710 based MVME16x SCSI Controllers for Linux.
- *
- * Based on work by Alan Hourihane
- */
-#include <linux/types.h>
-#include <linux/mm.h>
-#include <linux/blkdev.h>
-
-#include <asm/page.h>
-#include <asm/pgtable.h>
-#include <asm/mvme16xhw.h>
-#include <asm/irq.h>
-
-#include "scsi.h"
-#include <scsi/scsi_host.h>
-#include "53c7xx.h"
-#include "mvme16x.h"
-
-#include<linux/stat.h>
-
-
-int mvme16x_scsi_detect(struct scsi_host_template *tpnt)
-{
- static unsigned char called = 0;
- int clock;
- long long options;
-
- if (!MACH_IS_MVME16x)
- return 0;
- if (mvme16x_config & MVME16x_CONFIG_NO_SCSICHIP) {
- printk ("SCSI detection disabled, SCSI chip not present\n");
- return 0;
- }
- if (called)
- return 0;
-
- tpnt->proc_name = "MVME16x";
-
- options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
-
- clock = 66000000; /* 66MHz SCSI Clock */
-
- ncr53c7xx_init(tpnt, 0, 710, (unsigned long)0xfff47000,
- 0, MVME16x_IRQ_SCSI, DMA_NONE,
- options, clock);
- called = 1;
- return 1;
-}
-
-static int mvme16x_scsi_release(struct Scsi_Host *shost)
-{
- if (shost->irq)
- free_irq(shost->irq, NULL);
- if (shost->dma_channel != 0xff)
- free_dma(shost->dma_channel);
- if (shost->io_port && shost->n_io_port)
- release_region(shost->io_port, shost->n_io_port);
- scsi_unregister(shost);
- return 0;
-}
-
-static struct scsi_host_template driver_template = {
- .name = "MVME16x NCR53c710 SCSI",
- .detect = mvme16x_scsi_detect,
- .release = mvme16x_scsi_release,
- .queuecommand = NCR53c7xx_queue_command,
- .abort = NCR53c7xx_abort,
- .reset = NCR53c7xx_reset,
- .can_queue = 24,
- .this_id = 7,
- .sg_tablesize = 63,
- .cmd_per_lun = 3,
- .use_clustering = DISABLE_CLUSTERING
-};
-
-
-#include "scsi_module.c"
--- /dev/null
+++ linux-m68k-2.6.21/drivers/scsi/mvme16x_scsi.c
@@ -0,0 +1,78 @@
+/*
+ * Detection routine for the NCR53c710 based MVME16x SCSI Controllers for Linux.
+ *
+ * Based on work by Alan Hourihane
+ */
+#include <linux/types.h>
+#include <linux/mm.h>
+#include <linux/blkdev.h>
+
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/mvme16xhw.h>
+#include <asm/irq.h>
+
+#include "scsi.h"
+#include <scsi/scsi_host.h>
+#include "53c7xx.h"
+#include "mvme16x.h"
+
+#include<linux/stat.h>
+
+
+int mvme16x_scsi_detect(struct scsi_host_template *tpnt)
+{
+ static unsigned char called = 0;
+ int clock;
+ long long options;
+
+ if (!MACH_IS_MVME16x)
+ return 0;
+ if (mvme16x_config & MVME16x_CONFIG_NO_SCSICHIP) {
+ printk ("SCSI detection disabled, SCSI chip not present\n");
+ return 0;
+ }
+ if (called)
+ return 0;
+
+ tpnt->proc_name = "MVME16x";
+
+ options = OPTION_MEMORY_MAPPED|OPTION_DEBUG_TEST1|OPTION_INTFLY|OPTION_SYNCHRONOUS|OPTION_ALWAYS_SYNCHRONOUS|OPTION_DISCONNECT;
+
+ clock = 66000000; /* 66MHz SCSI Clock */
+
+ ncr53c7xx_init(tpnt, 0, 710, (unsigned long)0xfff47000,
+ 0, MVME16x_IRQ_SCSI, DMA_NONE,
+ options, clock);
+ called = 1;
+ return 1;
+}
+
+static int mvme16x_scsi_release(struct Scsi_Host *shost)
+{
+ if (shost->irq)
+ free_irq(shost->irq, NULL);
+ if (shost->dma_channel != 0xff)
+ free_dma(shost->dma_channel);
+ if (shost->io_port && shost->n_io_port)
+ release_region(shost->io_port, shost->n_io_port);
+ scsi_unregister(shost);
+ return 0;
+}
+
+static struct scsi_host_template driver_template = {
+ .name = "MVME16x NCR53c710 SCSI",
+ .detect = mvme16x_scsi_detect,
+ .release = mvme16x_scsi_release,
+ .queuecommand = NCR53c7xx_queue_command,
+ .abort = NCR53c7xx_abort,
+ .reset = NCR53c7xx_reset,
+ .can_queue = 24,
+ .this_id = 7,
+ .sg_tablesize = 63,
+ .cmd_per_lun = 3,
+ .use_clustering = DISABLE_CLUSTERING
+};
+
+
+#include "scsi_module.c"

View File

@ -1,20 +0,0 @@
Subject: [PATCH] m68k: <asm/page.h> needs <linux/compiler.h>
m68k: <asm/page.h> needs <linux/compiler.h> because of __attribute_const__
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/asm-m68k/page.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -27,6 +27,8 @@
#ifndef __ASSEMBLY__
+#include <linux/compiler.h>
+
#include <asm/module.h>
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
Subject: m68k: Fix a few hickups in drivers/scsi/Kconfig
m68k: Fix a few hickups in drivers/scsi/Kconfig
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1551,7 +1551,7 @@ config A3000_SCSI
built-in SCSI controller, say Y. Otherwise, say N.
To compile this driver as a module, choose M here: the
- module will be called wd33c93.
+ module will be called a3000.
config A2091_SCSI
tristate "A2091/A590 WD33C93A support"
@@ -1561,7 +1561,7 @@ config A2091_SCSI
say N.
To compile this driver as a module, choose M here: the
- module will be called wd33c93.
+ module will be called a2091.
config GVP11_SCSI
tristate "GVP Series II WD33C93A support"

View File

@ -1,60 +0,0 @@
Subject: m68k: module_fixup() is needed by non-modular kernels, too
m68k: Fix linking of non-modular kernels by moving module_fixup() from
arch/m68k/kernel/module.c to arch/m68k/kernel/setup.c
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/kernel/module.c | 17 -----------------
arch/m68k/kernel/setup.c | 17 +++++++++++++++++
2 files changed, 17 insertions(+), 17 deletions(-)
--- a/arch/m68k/kernel/module.c
+++ b/arch/m68k/kernel/module.c
@@ -122,23 +122,6 @@ int apply_relocate_add(Elf32_Shdr *sechd
return 0;
}
-void module_fixup(struct module *mod, struct m68k_fixup_info *start,
- struct m68k_fixup_info *end)
-{
- struct m68k_fixup_info *fixup;
-
- for (fixup = start; fixup < end; fixup++) {
- switch (fixup->type) {
- case m68k_fixup_memoffset:
- *(u32 *)fixup->addr = m68k_memoffset;
- break;
- case m68k_fixup_vnode_shift:
- *(u16 *)fixup->addr += m68k_virt_to_node_shift;
- break;
- }
- }
-}
-
int module_finalize(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
struct module *mod)
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -505,3 +505,20 @@ static int __init adb_probe_sync_enable
__setup("adb_sync", adb_probe_sync_enable);
#endif /* CONFIG_ADB */
+
+void module_fixup(struct module *mod, struct m68k_fixup_info *start,
+ struct m68k_fixup_info *end)
+{
+ struct m68k_fixup_info *fixup;
+
+ for (fixup = start; fixup < end; fixup++) {
+ switch (fixup->type) {
+ case m68k_fixup_memoffset:
+ *(u32 *)fixup->addr = m68k_memoffset;
+ break;
+ case m68k_fixup_vnode_shift:
+ *(u16 *)fixup->addr += m68k_virt_to_node_shift;
+ break;
+ }
+ }
+}

View File

@ -1,43 +0,0 @@
Subject: m68k: Use _AC() instead of #ifdef __ASSEMBLY__
m68k: Use _AC() instead of #ifdef __ASSEMBLY__ hackery
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/asm-m68k/page.h | 8 +++-----
include/asm-m68k/processor.h | 1 +
2 files changed, 4 insertions(+), 5 deletions(-)
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -4,17 +4,15 @@
#ifdef __KERNEL__
+#include <linux/const.h>
+
/* PAGE_SHIFT determines the page size */
#ifndef CONFIG_SUN3
#define PAGE_SHIFT (12)
#else
#define PAGE_SHIFT (13)
#endif
-#ifdef __ASSEMBLY__
-#define PAGE_SIZE (1 << PAGE_SHIFT)
-#else
-#define PAGE_SIZE (1UL << PAGE_SHIFT)
-#endif
+#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
#include <asm/setup.h>
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -39,6 +39,7 @@ static inline void wrusp(unsigned long u
#define TASK_SIZE (0xF0000000UL)
#else
#ifdef __ASSEMBLY__
+#error This cannot happen
#define TASK_SIZE (0x0E000000)
#else
#define TASK_SIZE (0x0E000000UL)

View File

@ -1,176 +0,0 @@
Subject: [PATCH 10/13] CUDA ADB fixes
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linuxppc-dev@ozlabs.org
From: Finn Thain <fthain@telegraphics.com.au>
Fix the flakiness in the CUDA ADB driver on m68k macs (keypresses getting
wedged down or ADB just going AWOL altogether).
The only IRQ used by this driver is the VIA shift register IRQ. The PowerMac
conditional code disables the other VIA IRQ sources, so don't mess with the
other IRQ flags in the common code -- m68k macs need them.
When polling, don't disable local interrupts when we only need to disable the
CUDA interrupt.
Unless polling, don't clear the shift register IRQ flag. On m68k macs this
creates a race that often breaks CUDA ADB.
Tested on Quadra 840av and LC630 (both m68k); also Beige G3 (powerpc).
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/macintosh/via-cuda.c | 58 +++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 26 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/macintosh/via-cuda.c
+++ linux-m68k-2.6.21/drivers/macintosh/via-cuda.c
@@ -82,6 +82,7 @@ static unsigned char cuda_rbuf[16];
static unsigned char *reply_ptr;
static int reading_reply;
static int data_index;
+static int cuda_irq;
#ifdef CONFIG_PPC
static struct device_node *vias;
#endif
@@ -160,10 +161,8 @@ int __init find_via_cuda(void)
/* Clear and enable interrupts, but only on PPC. On 68K it's done */
/* for us by the main VIA driver in arch/m68k/mac/via.c */
-#ifndef CONFIG_MAC
out_8(&via[IFR], 0x7f); /* clear interrupts by writing 1s */
out_8(&via[IER], IER_SET|SR_INT); /* enable interrupt from SR */
-#endif
/* enable autopoll */
cuda_request(&req, NULL, 3, CUDA_PACKET, CUDA_AUTOPOLL, 1);
@@ -181,24 +180,22 @@ int __init find_via_cuda(void)
static int __init via_cuda_start(void)
{
- unsigned int irq;
-
if (via == NULL)
return -ENODEV;
#ifdef CONFIG_MAC
- irq = IRQ_MAC_ADB;
+ cuda_irq = IRQ_MAC_ADB;
#else /* CONFIG_MAC */
- irq = irq_of_parse_and_map(vias, 0);
- if (irq == NO_IRQ) {
+ cuda_irq = irq_of_parse_and_map(vias, 0);
+ if (cuda_irq == NO_IRQ) {
printk(KERN_ERR "via-cuda: can't map interrupts for %s\n",
vias->full_name);
return -ENODEV;
}
-#endif /* CONFIG_MAP */
+#endif /* CONFIG_MAC */
- if (request_irq(irq, cuda_interrupt, 0, "ADB", cuda_interrupt)) {
- printk(KERN_ERR "via-cuda: can't request irq %d\n", irq);
+ if (request_irq(cuda_irq, cuda_interrupt, 0, "ADB", cuda_interrupt)) {
+ printk(KERN_ERR "via-cuda: can't request irq %d\n", cuda_irq);
return -EAGAIN;
}
@@ -238,6 +235,7 @@ cuda_init(void)
printk(KERN_ERR "cuda_init_via() failed\n");
return -ENODEV;
}
+ out_8(&via[IER], IER_SET|SR_INT); /* enable interrupt from SR */
return via_cuda_start();
#endif
@@ -263,15 +261,17 @@ cuda_init_via(void)
out_8(&via[B], in_8(&via[B]) | TACK | TIP); /* negate them */
out_8(&via[ACR] ,(in_8(&via[ACR]) & ~SR_CTRL) | SR_EXT); /* SR data in */
(void)in_8(&via[SR]); /* clear any left-over data */
-#ifndef CONFIG_MAC
+#ifdef CONFIG_PPC
out_8(&via[IER], 0x7f); /* disable interrupts from VIA */
(void)in_8(&via[IER]);
+#else
+ out_8(&via[IER], SR_INT); /* disable SR interrupt from VIA */
#endif
/* delay 4ms and then clear any pending interrupt */
mdelay(4);
(void)in_8(&via[SR]);
- out_8(&via[IFR], in_8(&via[IFR]) & 0x7f);
+ out_8(&via[IFR], SR_INT);
/* sync with the CUDA - assert TACK without TIP */
out_8(&via[B], in_8(&via[B]) & ~TACK);
@@ -282,7 +282,7 @@ cuda_init_via(void)
/* wait for the interrupt and then clear it */
WAIT_FOR(in_8(&via[IFR]) & SR_INT, "CUDA response to sync (2)");
(void)in_8(&via[SR]);
- out_8(&via[IFR], in_8(&via[IFR]) & 0x7f);
+ out_8(&via[IFR], SR_INT);
/* finish the sync by negating TACK */
out_8(&via[B], in_8(&via[B]) | TACK);
@@ -291,7 +291,7 @@ cuda_init_via(void)
WAIT_FOR(in_8(&via[B]) & TREQ, "CUDA response to sync (3)");
WAIT_FOR(in_8(&via[IFR]) & SR_INT, "CUDA response to sync (4)");
(void)in_8(&via[SR]);
- out_8(&via[IFR], in_8(&via[IFR]) & 0x7f);
+ out_8(&via[IFR], SR_INT);
out_8(&via[B], in_8(&via[B]) | TIP); /* should be unnecessary */
return 0;
@@ -428,16 +428,12 @@ cuda_start(void)
void
cuda_poll(void)
{
- unsigned long flags;
-
/* cuda_interrupt only takes a normal lock, we disable
* interrupts here to avoid re-entering and thus deadlocking.
- * An option would be to disable only the IRQ source with
- * disable_irq(), would that work on m68k ? --BenH
*/
- local_irq_save(flags);
+ disable_irq(cuda_irq);
cuda_interrupt(0, NULL);
- local_irq_restore(flags);
+ enable_irq(cuda_irq);
}
static irqreturn_t
@@ -448,15 +444,25 @@ cuda_interrupt(int irq, void *arg)
unsigned char ibuf[16];
int ibuf_len = 0;
int complete = 0;
- unsigned char virq;
spin_lock(&cuda_lock);
- virq = in_8(&via[IFR]) & 0x7f;
- out_8(&via[IFR], virq);
- if ((virq & SR_INT) == 0) {
- spin_unlock(&cuda_lock);
- return IRQ_NONE;
+ /* On powermacs, this handler is registered for the VIA IRQ. But it uses
+ * just the shift register IRQ -- other VIA interrupt sources are disabled.
+ * On m68k macs, the VIA IRQ sources are dispatched individually. Unless
+ * we are polling, the shift register IRQ flag has already been cleared.
+ */
+
+#ifdef CONFIG_MAC
+ if (!arg)
+#endif
+ {
+ if ((in_8(&via[IFR]) & SR_INT) == 0) {
+ spin_unlock(&cuda_lock);
+ return IRQ_NONE;
+ } else {
+ out_8(&via[IFR], SR_INT);
+ }
}
status = (~in_8(&via[B]) & (TIP|TREQ)) | (in_8(&via[ACR]) & SR_OUT);

View File

@ -1,162 +0,0 @@
Subject: [PATCH 8/13] m68k: Mac IRQ cleanup
From: Finn Thain <fthain@telegraphics.com.au>
There are no slow IRQs on Macs since Roman Zippel's IRQ reorganisation that
went into 2.6.16 and removed mac_irq_list[] and the do_mac_irq_list()
dispatcher. (They were implemented in do_mac_irq_list() by lowering the IPL.)
Hence there's no more use for mutual exclusion in the Mac interrupt
dispatchers. Remove it.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mac/baboon.c | 20 +++++++-------------
arch/m68k/mac/oss.c | 4 ----
arch/m68k/mac/psc.c | 2 --
arch/m68k/mac/via.c | 10 ----------
4 files changed, 7 insertions(+), 29 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/mac/baboon.c
+++ linux-m68k-2.6.21/arch/m68k/mac/baboon.c
@@ -22,7 +22,7 @@
/* #define DEBUG_BABOON */
/* #define DEBUG_IRQS */
-int baboon_present,baboon_active;
+int baboon_present;
volatile struct baboon *baboon;
irqreturn_t baboon_irq(int, void *);
@@ -45,7 +45,6 @@ void __init baboon_init(void)
baboon = (struct baboon *) BABOON_BASE;
baboon_present = 1;
- baboon_active = 0;
printk("Baboon detected at %p\n", baboon);
}
@@ -70,9 +69,9 @@ irqreturn_t baboon_irq(int irq, void *de
unsigned char events;
#ifdef DEBUG_IRQS
- printk("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X active %02X\n",
+ printk("baboon_irq: mb_control %02X mb_ifr %02X mb_status %02X\n",
(uint) baboon->mb_control, (uint) baboon->mb_ifr,
- (uint) baboon->mb_status, baboon_active);
+ (uint) baboon->mb_status);
#endif
if (!(events = baboon->mb_ifr & 0x07))
@@ -81,11 +80,9 @@ irqreturn_t baboon_irq(int irq, void *de
irq_num = IRQ_BABOON_0;
irq_bit = 1;
do {
- if (events & irq_bit/* & baboon_active*/) {
- baboon_active &= ~irq_bit;
+ if (events & irq_bit) {
baboon->mb_ifr &= ~irq_bit;
m68k_handle_int(irq_num);
- baboon_active |= irq_bit;
}
irq_bit <<= 1;
irq_num++;
@@ -99,21 +96,18 @@ irqreturn_t baboon_irq(int irq, void *de
}
void baboon_irq_enable(int irq) {
- int irq_idx = IRQ_IDX(irq);
-
#ifdef DEBUG_IRQUSE
printk("baboon_irq_enable(%d)\n", irq);
#endif
- baboon_active |= (1 << irq_idx);
+ /* FIXME: figure out how to mask and unmask baboon interrupt sources */
+ enable_irq(IRQ_NUBUS_C);
}
void baboon_irq_disable(int irq) {
- int irq_idx = IRQ_IDX(irq);
-
#ifdef DEBUG_IRQUSE
printk("baboon_irq_disable(%d)\n", irq);
#endif
- baboon_active &= ~(1 << irq_idx);
+ disable_irq(IRQ_NUBUS_C);
}
void baboon_irq_clear(int irq) {
--- linux-m68k-2.6.21.orig/arch/m68k/mac/oss.c
+++ linux-m68k-2.6.21/arch/m68k/mac/oss.c
@@ -112,10 +112,8 @@ irqreturn_t oss_irq(int irq, void *dev_i
oss->irq_pending &= ~OSS_IP_SOUND;
/* FIXME: call sound handler */
} else if (events & OSS_IP_SCSI) {
- oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED;
oss->irq_pending &= ~OSS_IP_SCSI;
m68k_handle_int(IRQ_MAC_SCSI);
- oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI;
} else {
/* FIXME: error check here? */
}
@@ -149,10 +147,8 @@ irqreturn_t oss_nubus_irq(int irq, void
--i;
irq_bit >>= 1;
if (events & irq_bit) {
- oss->irq_level[i] = OSS_IRQLEV_DISABLED;
oss->irq_pending &= ~irq_bit;
m68k_handle_int(NUBUS_SOURCE_BASE + i);
- oss->irq_level[i] = OSS_IRQLEV_NUBUS;
}
} while(events & (irq_bit - 1));
return IRQ_HANDLED;
--- linux-m68k-2.6.21.orig/arch/m68k/mac/psc.c
+++ linux-m68k-2.6.21/arch/m68k/mac/psc.c
@@ -147,10 +147,8 @@ irqreturn_t psc_irq(int irq, void *dev_i
irq_bit = 1;
do {
if (events & irq_bit) {
- psc_write_byte(pIER, irq_bit);
psc_write_byte(pIFR, irq_bit);
m68k_handle_int(irq_num);
- psc_write_byte(pIER, irq_bit | 0x80);
}
irq_num++;
irq_bit <<= 1;
--- linux-m68k-2.6.21.orig/arch/m68k/mac/via.c
+++ linux-m68k-2.6.21/arch/m68k/mac/via.c
@@ -443,11 +443,6 @@ void __init via_nubus_init(void)
/*
* The generic VIA interrupt routines (shamelessly stolen from Alan Cox's
* via6522.c :-), disable/pending masks added.
- *
- * The new interrupt architecture in macints.c takes care of a lot of the
- * gruntwork for us, including tallying the interrupts and calling the
- * handlers on the linked list. All we need to do here is basically generate
- * the machspec interrupt number after clearing the interrupt.
*/
irqreturn_t via1_irq(int irq, void *dev_id)
@@ -463,10 +458,8 @@ irqreturn_t via1_irq(int irq, void *dev_
irq_bit = 1;
do {
if (events & irq_bit) {
- via1[vIER] = irq_bit;
via1[vIFR] = irq_bit;
m68k_handle_int(irq_num);
- via1[vIER] = irq_bit | 0x80;
}
++irq_num;
irq_bit <<= 1;
@@ -502,11 +495,8 @@ irqreturn_t via2_irq(int irq, void *dev_
irq_bit = 1;
do {
if (events & irq_bit) {
- via2[gIER] = irq_bit;
via2[gIFR] = irq_bit | rbv_clear;
m68k_handle_int(irq_num);
- if (irq_num != IRQ_MAC_NUBUS || nubus_disabled == 0)
- via2[gIER] = irq_bit | 0x80;
}
++irq_num;
irq_bit <<= 1;

View File

@ -1,270 +0,0 @@
Subject: [PATCH 7/13] m68k: Mac nubus IRQ fixes (plan E)
From: Finn Thain <fthain@telegraphics.com.au>
Some Macs lack a slot interrupt enable register. So the existing code makes
disabled and unregistered slot IRQ lines outputs set high. This seems to work
on quadras, but does not work on genuine VIAs (perhaps the card still succeeds
in pulling the line low, or perhaps because this increases the settle time on
the port A input, meaning that the CA1 IRQ could fire before the slot line
reads active).
Because of this, the nubus_active flags were used to mask IRQs, which is
actually worse than the problem it tries to solve. Any interrupt masked by
nubus_active will remain asserted and prevent further transitions on CA1. And
so the nubus gets wedged regardless of hardware (emulated VIA ASIC, real VIA
chip or RBV).
The best solution to this hardware limitation of genuine VIAs is to disable the
umbrella SLOTS IRQ when disabling a slot on those machines. Unfortunately, this
means all slot IRQs get disabled when any slot IRQ is disabled. But it is only
a problem when there's more than 1 device using nubus interrupts.
Another potential problem for genuine VIAs is an unregistered nubus IRQ.
Eventually it will be possible to enable the CA1 interrupt by installing its
handler only _after_ all nubus drivers have loaded but _before_ the kernel
needs them, at which time this last problem can be fixed. For now it can be
worked around:
- disable MacOS extensions
- don't boot MacOS (use the Emile bootloader instead)
- get the bootloaders to disable ROM drivers (Penguin does this for video
cards already, don't know about Emile)
- physically remove unsupported cards
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mac/via.c | 141 +++++++++++++++++++++++++++++-----------------------
1 file changed, 80 insertions(+), 61 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/mac/via.c
+++ linux-m68k-2.6.21/arch/m68k/mac/via.c
@@ -64,7 +64,19 @@ static int gIER,gIFR,gBufA,gBufB;
#define MAC_CLOCK_LOW (MAC_CLOCK_TICK&0xFF)
#define MAC_CLOCK_HIGH (MAC_CLOCK_TICK>>8)
-static int nubus_active;
+/* To disable a NuBus slot on Quadras we make the slot IRQ lines outputs, set
+ * high. On RBV we just use the slot interrupt enable register. On Macs with
+ * genuine VIA chips we must use nubus_disabled to keep track of disabled slot
+ * interrupts. When any slot IRQ is disabled we mask the (edge triggered) CA1
+ * or "SLOTS" interrupt. When no slot is disabled, we unmask the CA1 interrupt.
+ * So, on genuine VIAs, having more than one NuBus IRQ can mean trouble,
+ * because closing one of those drivers can mask all of the NuBus interrupts.
+ * Also, since we can't mask the unregistered slot IRQs on genuine VIAs, it's
+ * possible to get interrupts from cards that MacOS or the ROM has configured
+ * but we have not. FWIW, "Designing Cards and Drivers for Macintosh II and
+ * Macintosh SE", page 9-8, says, a slot IRQ with no driver would crash MacOS.
+ */
+static u8 nubus_disabled;
void via_debug_dump(void);
irqreturn_t via1_irq(int, void *);
@@ -383,9 +395,6 @@ int via_get_cache_disable(void)
void __init via_nubus_init(void)
{
- /* don't set nubus_active = 0 here, it kills the Baboon */
- /* interrupt that we've already registered. */
-
/* unlock nubus transactions */
if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
@@ -399,28 +408,35 @@ void __init via_nubus_init(void)
via2[gBufB] |= 0x02;
}
- /* disable nubus slot interrupts. */
- if (rbv_present) {
+ /* Disable all the slot interrupts (where possible). */
+
+ switch (macintosh_config->via_type) {
+ case MAC_VIA_II:
+ /* Just make the port A lines inputs. */
+ switch(macintosh_config->ident) {
+ case MAC_MODEL_II:
+ case MAC_MODEL_IIX:
+ case MAC_MODEL_IICX:
+ case MAC_MODEL_SE30:
+ /* The top two bits are RAM size outputs. */
+ via2[vDirA] &= 0xC0;
+ break;
+ default:
+ via2[vDirA] &= 0x80;
+ }
+ break;
+ case MAC_VIA_IIci:
+ /* RBV. Disable all the slot interrupts. SIER works like IER. */
via2[rSIER] = 0x7F;
- via2[rSIER] = nubus_active | 0x80;
- } else {
- /* These are ADB bits on PMU */
+ break;
+ case MAC_VIA_QUADRA:
+ /* Disable the inactive slot interrupts by making those lines outputs. */
if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
- (macintosh_config->adb_type != MAC_ADB_PB2)) {
- switch(macintosh_config->ident)
- {
- case MAC_MODEL_II:
- case MAC_MODEL_IIX:
- case MAC_MODEL_IICX:
- case MAC_MODEL_SE30:
- via2[vBufA] |= 0x3F;
- via2[vDirA] = ~nubus_active | 0xc0;
- break;
- default:
- via2[vBufA] = 0xFF;
- via2[vDirA] = ~nubus_active;
- }
+ (macintosh_config->adb_type != MAC_ADB_PB2)) {
+ via2[vBufA] |= 0x7F;
+ via2[vDirA] |= 0x7F;
}
+ break;
}
}
@@ -489,7 +505,8 @@ irqreturn_t via2_irq(int irq, void *dev_
via2[gIER] = irq_bit;
via2[gIFR] = irq_bit | rbv_clear;
m68k_handle_int(irq_num);
- via2[gIER] = irq_bit | 0x80;
+ if (irq_num != IRQ_MAC_NUBUS || nubus_disabled == 0)
+ via2[gIER] = irq_bit | 0x80;
}
++irq_num;
irq_bit <<= 1;
@@ -511,7 +528,7 @@ irqreturn_t via_nubus_irq(int irq, void
if (rbv_present)
events &= via2[rSIER];
else
- events &= nubus_active;
+ events &= ~via2[vDirA];
if (!events)
return IRQ_NONE;
@@ -533,7 +550,7 @@ irqreturn_t via_nubus_irq(int irq, void
if (rbv_present)
events &= via2[rSIER];
else
- events &= nubus_active;
+ events &= ~via2[vDirA];
} while (events);
return IRQ_HANDLED;
}
@@ -541,38 +558,38 @@ irqreturn_t via_nubus_irq(int irq, void
void via_irq_enable(int irq) {
int irq_src = IRQ_SRC(irq);
int irq_idx = IRQ_IDX(irq);
- int irq_bit = 1 << irq_idx;
#ifdef DEBUG_IRQUSE
printk(KERN_DEBUG "via_irq_enable(%d)\n", irq);
#endif
if (irq_src == 1) {
- via1[vIER] = irq_bit | 0x80;
+ via1[vIER] = IER_SET_BIT(irq_idx);
} else if (irq_src == 2) {
- via2[gIER] = irq_bit | 0x80;
+ if (irq != IRQ_MAC_NUBUS || nubus_disabled == 0)
+ via2[gIER] = IER_SET_BIT(irq_idx);
} else if (irq_src == 7) {
- nubus_active |= irq_bit;
- if (rbv_present) {
- /* enable the slot interrupt. SIER works like IER. */
+ switch (macintosh_config->via_type) {
+ case MAC_VIA_II:
+ nubus_disabled &= ~(1 << irq_idx);
+ /* Enable the CA1 interrupt when no slot is disabled. */
+ if (!nubus_disabled)
+ via2[gIER] = IER_SET_BIT(1);
+ break;
+ case MAC_VIA_IIci:
+ /* On RBV, enable the slot interrupt.
+ * SIER works like IER.
+ */
via2[rSIER] = IER_SET_BIT(irq_idx);
- } else {
- /* Make sure the bit is an input, to enable the irq */
- /* But not on PowerBooks, that's ADB... */
+ break;
+ case MAC_VIA_QUADRA:
+ /* Make the port A line an input to enable the slot irq.
+ * But not on PowerBooks, that's ADB.
+ */
if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
- (macintosh_config->adb_type != MAC_ADB_PB2)) {
- switch(macintosh_config->ident)
- {
- case MAC_MODEL_II:
- case MAC_MODEL_IIX:
- case MAC_MODEL_IICX:
- case MAC_MODEL_SE30:
- via2[vDirA] &= (~irq_bit | 0xc0);
- break;
- default:
- via2[vDirA] &= ~irq_bit;
- }
- }
+ (macintosh_config->adb_type != MAC_ADB_PB2))
+ via2[vDirA] &= ~(1 << irq_idx);
+ break;
}
}
}
@@ -580,29 +597,31 @@ void via_irq_enable(int irq) {
void via_irq_disable(int irq) {
int irq_src = IRQ_SRC(irq);
int irq_idx = IRQ_IDX(irq);
- int irq_bit = 1 << irq_idx;
#ifdef DEBUG_IRQUSE
printk(KERN_DEBUG "via_irq_disable(%d)\n", irq);
#endif
if (irq_src == 1) {
- via1[vIER] = irq_bit & 0x7F;
+ via1[vIER] = IER_CLR_BIT(irq_idx);
} else if (irq_src == 2) {
- via2[gIER] = irq_bit & 0x7F;
+ via2[gIER] = IER_CLR_BIT(irq_idx);
} else if (irq_src == 7) {
- if (rbv_present) {
- /* disable the slot interrupt. SIER works like IER. */
+ switch (macintosh_config->via_type) {
+ case MAC_VIA_II:
+ nubus_disabled |= 1 << irq_idx;
+ if (nubus_disabled)
+ via2[gIER] = IER_CLR_BIT(1);
+ break;
+ case MAC_VIA_IIci:
via2[rSIER] = IER_CLR_BIT(irq_idx);
- } else {
- /* disable the nubus irq by changing dir to output */
- /* except on PMU */
+ break;
+ case MAC_VIA_QUADRA:
if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
- (macintosh_config->adb_type != MAC_ADB_PB2)) {
- via2[vDirA] |= irq_bit;
- }
+ (macintosh_config->adb_type != MAC_ADB_PB2))
+ via2[vDirA] |= 1 << irq_idx;
+ break;
}
- nubus_active &= ~irq_bit;
}
}
@@ -638,7 +657,7 @@ int via_irq_pending(int irq)
} else if (irq_src == 2) {
return via2[gIFR] & irq_bit;
} else if (irq_src == 7) {
- /* FIXME: this can't work while a slot irq is disabled! */
+ /* Always 0 for MAC_VIA_QUADRA if the slot irq is disabled. */
return ~via2[gBufA] & irq_bit;
}
return 0;

View File

@ -1,375 +0,0 @@
Subject: [PATCH 6/13] m68k: Mac IRQ prep
From: Finn Thain <fthain@telegraphics.com.au>
Make sure that there are no slot IRQs asserted before leaving the nubus
handler. If there are and we don't then the nubus gets wedged because this
prevents a CA1 transition, which means no more nubus IRQs.
Make the interrupt dispatch loops terminate sooner.
Explicitly initialise the VIA latches to make the code more easily understood.
Also some cleanups.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mac/baboon.c | 12 ++--
arch/m68k/mac/oss.c | 8 ++
arch/m68k/mac/psc.c | 19 +++---
arch/m68k/mac/via.c | 139 ++++++++++++++++++++++++++++++-------------------
4 files changed, 110 insertions(+), 68 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/mac/baboon.c
+++ linux-m68k-2.6.21/arch/m68k/mac/baboon.c
@@ -66,7 +66,7 @@ void __init baboon_register_interrupts(v
irqreturn_t baboon_irq(int irq, void *dev_id)
{
- int irq_bit,i;
+ int irq_bit, irq_num;
unsigned char events;
#ifdef DEBUG_IRQS
@@ -78,14 +78,18 @@ irqreturn_t baboon_irq(int irq, void *de
if (!(events = baboon->mb_ifr & 0x07))
return IRQ_NONE;
- for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) {
+ irq_num = IRQ_BABOON_0;
+ irq_bit = 1;
+ do {
if (events & irq_bit/* & baboon_active*/) {
baboon_active &= ~irq_bit;
baboon->mb_ifr &= ~irq_bit;
- m68k_handle_int(IRQ_BABOON_0 + i);
+ m68k_handle_int(irq_num);
baboon_active |= irq_bit;
}
- }
+ irq_bit <<= 1;
+ irq_num++;
+ } while(events >= irq_bit);
#if 0
if (baboon->mb_ifr & 0x02) macide_ack_intr(NULL);
/* for now we need to smash all interrupts */
--- linux-m68k-2.6.21.orig/arch/m68k/mac/oss.c
+++ linux-m68k-2.6.21/arch/m68k/mac/oss.c
@@ -143,14 +143,18 @@ irqreturn_t oss_nubus_irq(int irq, void
#endif
/* There are only six slots on the OSS, not seven */
- for (i = 0, irq_bit = 1 ; i < 6 ; i++, irq_bit <<= 1) {
+ i = 6;
+ irq_bit = 0x40;
+ do {
+ --i;
+ irq_bit >>= 1;
if (events & irq_bit) {
oss->irq_level[i] = OSS_IRQLEV_DISABLED;
oss->irq_pending &= ~irq_bit;
m68k_handle_int(NUBUS_SOURCE_BASE + i);
oss->irq_level[i] = OSS_IRQLEV_NUBUS;
}
- }
+ } while(events & (irq_bit - 1));
return IRQ_HANDLED;
}
--- linux-m68k-2.6.21.orig/arch/m68k/mac/psc.c
+++ linux-m68k-2.6.21/arch/m68k/mac/psc.c
@@ -131,11 +131,8 @@ irqreturn_t psc_irq(int irq, void *dev_i
{
int pIFR = pIFRbase + ((int) dev_id);
int pIER = pIERbase + ((int) dev_id);
- int base_irq;
- int irq_bit,i;
- unsigned char events;
-
- base_irq = irq << 3;
+ int irq_num;
+ unsigned char irq_bit, events;
#ifdef DEBUG_IRQS
printk("psc_irq: irq %d pIFR = 0x%02X pIER = 0x%02X\n",
@@ -146,14 +143,18 @@ irqreturn_t psc_irq(int irq, void *dev_i
if (!events)
return IRQ_NONE;
- for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) {
- if (events & irq_bit) {
+ irq_num = irq << 3;
+ irq_bit = 1;
+ do {
+ if (events & irq_bit) {
psc_write_byte(pIER, irq_bit);
psc_write_byte(pIFR, irq_bit);
- m68k_handle_int(base_irq + i);
+ m68k_handle_int(irq_num);
psc_write_byte(pIER, irq_bit | 0x80);
}
- }
+ irq_num++;
+ irq_bit <<= 1;
+ } while (events >= irq_bit);
return IRQ_HANDLED;
}
--- linux-m68k-2.6.21.orig/arch/m68k/mac/via.c
+++ linux-m68k-2.6.21/arch/m68k/mac/via.c
@@ -13,6 +13,10 @@
* for info. A full-text web search on 6522 AND VIA will probably also
* net some usefulness. <cananian@alumni.princeton.edu> 20apr1999
*
+ * Additional data is here (the SY6522 was used in the Mac II etc):
+ * http://www.6502.org/documents/datasheets/synertek/synertek_sy6522.pdf
+ * http://www.6502.org/documents/datasheets/synertek/synertek_sy6522_programming_reference.pdf
+ *
* PRAM/RTC access algorithms are from the NetBSD RTC toolkit version 1.08b
* by Erik Vogan and adapted to Linux by Joshua M. Thompson (funaho@jurai.org)
*
@@ -37,7 +41,7 @@ volatile __u8 *via1, *via2;
/* See note in mac_via.h about how this is possibly not useful */
volatile long *via_memory_bogon=(long *)&via_memory_bogon;
#endif
-int rbv_present,via_alt_mapping;
+int rbv_present, via_alt_mapping;
__u8 rbv_clear;
/*
@@ -138,11 +142,11 @@ void __init via_init(void)
printk(KERN_INFO "VIA2 at %p is ", via2);
if (rbv_present) {
- printk(KERN_INFO "an RBV\n");
+ printk("an RBV\n");
} else if (oss_present) {
- printk(KERN_INFO "an OSS\n");
+ printk("an OSS\n");
} else {
- printk(KERN_INFO "a 6522 or clone\n");
+ printk("a 6522 or clone\n");
}
#ifdef DEBUG_VIA
@@ -163,6 +167,7 @@ void __init via_init(void)
via1[vT2CL] = 0;
via1[vT2CH] = 0;
via1[vACR] &= 0x3F;
+ via1[vACR] &= ~0x03; /* disable port A & B latches */
/*
* SE/30: disable video IRQ
@@ -234,6 +239,22 @@ void __init via_init(void)
via2[vT2CL] = 0;
via2[vT2CH] = 0;
via2[vACR] &= 0x3F;
+ via2[vACR] &= ~0x03; /* disable port A & B latches */
+ }
+
+ /*
+ * Set vPCR for SCSI interrupts (but not on RBV)
+ */
+ if (!rbv_present) {
+ if (macintosh_config->scsi_type == MAC_SCSI_OLD) {
+ /* CB2 (IRQ) indep. input, positive edge */
+ /* CA2 (DRQ) indep. input, positive edge */
+ via2[vPCR] = 0x66;
+ } else {
+ /* CB2 (IRQ) indep. input, negative edge */
+ /* CA2 (DRQ) indep. input, negative edge */
+ via2[vPCR] = 0x22;
+ }
}
}
@@ -367,19 +388,14 @@ void __init via_nubus_init(void)
/* unlock nubus transactions */
- if (!rbv_present) {
+ if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
+ (macintosh_config->adb_type != MAC_ADB_PB2)) {
/* set the line to be an output on non-RBV machines */
- if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
- (macintosh_config->adb_type != MAC_ADB_PB2)) {
+ if (!rbv_present)
via2[vDirB] |= 0x02;
- }
- }
-
- /* this seems to be an ADB bit on PMU machines */
- /* according to MkLinux. -- jmt */
- if ((macintosh_config->adb_type != MAC_ADB_PB1) &&
- (macintosh_config->adb_type != MAC_ADB_PB2)) {
+ /* this seems to be an ADB bit on PMU machines */
+ /* according to MkLinux. -- jmt */
via2[gBufB] |= 0x02;
}
@@ -420,20 +436,25 @@ void __init via_nubus_init(void)
irqreturn_t via1_irq(int irq, void *dev_id)
{
- int irq_bit, i;
- unsigned char events, mask;
+ int irq_num;
+ unsigned char irq_bit, events;
- mask = via1[vIER] & 0x7F;
- if (!(events = via1[vIFR] & mask))
+ events = via1[vIFR] & via1[vIER] & 0x7F;
+ if (!events)
return IRQ_NONE;
- for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
+ irq_num = VIA1_SOURCE_BASE;
+ irq_bit = 1;
+ do {
if (events & irq_bit) {
via1[vIER] = irq_bit;
via1[vIFR] = irq_bit;
- m68k_handle_int(VIA1_SOURCE_BASE + i);
+ m68k_handle_int(irq_num);
via1[vIER] = irq_bit | 0x80;
}
+ ++irq_num;
+ irq_bit <<= 1;
+ } while (events >= irq_bit);
#if 0 /* freakin' pmu is doing weird stuff */
if (!oss_present) {
@@ -454,20 +475,25 @@ irqreturn_t via1_irq(int irq, void *dev_
irqreturn_t via2_irq(int irq, void *dev_id)
{
- int irq_bit, i;
- unsigned char events, mask;
+ int irq_num;
+ unsigned char irq_bit, events;
- mask = via2[gIER] & 0x7F;
- if (!(events = via2[gIFR] & mask))
+ events = via2[gIFR] & via2[gIER] & 0x7F;
+ if (!events)
return IRQ_NONE;
- for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
+ irq_num = VIA2_SOURCE_BASE;
+ irq_bit = 1;
+ do {
if (events & irq_bit) {
via2[gIER] = irq_bit;
via2[gIFR] = irq_bit | rbv_clear;
- m68k_handle_int(VIA2_SOURCE_BASE + i);
+ m68k_handle_int(irq_num);
via2[gIER] = irq_bit | 0x80;
}
+ ++irq_num;
+ irq_bit <<= 1;
+ } while (events >= irq_bit);
return IRQ_HANDLED;
}
@@ -478,19 +504,37 @@ irqreturn_t via2_irq(int irq, void *dev_
irqreturn_t via_nubus_irq(int irq, void *dev_id)
{
- int irq_bit, i;
- unsigned char events;
+ int slot_irq;
+ unsigned char slot_bit, events;
- if (!(events = ~via2[gBufA] & nubus_active))
+ events = ~via2[gBufA] & 0x7F;
+ if (rbv_present)
+ events &= via2[rSIER];
+ else
+ events &= nubus_active;
+ if (!events)
return IRQ_NONE;
- for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1) {
- if (events & irq_bit) {
- via_irq_disable(NUBUS_SOURCE_BASE + i);
- m68k_handle_int(NUBUS_SOURCE_BASE + i);
- via_irq_enable(NUBUS_SOURCE_BASE + i);
- }
- }
+ do {
+ slot_irq = IRQ_NUBUS_F;
+ slot_bit = 0x40;
+ do {
+ if (events & slot_bit) {
+ events &= ~slot_bit;
+ m68k_handle_int(slot_irq);
+ }
+ --slot_irq;
+ slot_bit >>= 1;
+ } while (events);
+
+ /* clear the CA1 interrupt and make certain there's no more. */
+ via2[gIFR] = 0x02 | rbv_clear;
+ events = ~via2[gBufA] & 0x7F;
+ if (rbv_present)
+ events &= via2[rSIER];
+ else
+ events &= nubus_active;
+ } while (events);
return IRQ_HANDLED;
}
@@ -506,20 +550,6 @@ void via_irq_enable(int irq) {
if (irq_src == 1) {
via1[vIER] = irq_bit | 0x80;
} else if (irq_src == 2) {
- /*
- * Set vPCR for SCSI interrupts (but not on RBV)
- */
- if ((irq_idx == 0) && !rbv_present) {
- if (macintosh_config->scsi_type == MAC_SCSI_OLD) {
- /* CB2 (IRQ) indep. input, positive edge */
- /* CA2 (DRQ) indep. input, positive edge */
- via2[vPCR] = 0x66;
- } else {
- /* CB2 (IRQ) indep. input, negative edge */
- /* CA2 (DRQ) indep. input, negative edge */
- via2[vPCR] = 0x22;
- }
- }
via2[gIER] = irq_bit | 0x80;
} else if (irq_src == 7) {
nubus_active |= irq_bit;
@@ -557,9 +587,9 @@ void via_irq_disable(int irq) {
#endif
if (irq_src == 1) {
- via1[vIER] = irq_bit;
+ via1[vIER] = irq_bit & 0x7F;
} else if (irq_src == 2) {
- via2[gIER] = irq_bit;
+ via2[gIER] = irq_bit & 0x7F;
} else if (irq_src == 7) {
if (rbv_present) {
/* disable the slot interrupt. SIER works like IER. */
@@ -586,7 +616,9 @@ void via_irq_clear(int irq) {
} else if (irq_src == 2) {
via2[gIFR] = irq_bit | rbv_clear;
} else if (irq_src == 7) {
- /* FIXME: hmm.. */
+ /* FIXME: There is no way to clear an individual nubus slot
+ * IRQ flag, other than getting the device to do it.
+ */
}
}
@@ -606,6 +638,7 @@ int via_irq_pending(int irq)
} else if (irq_src == 2) {
return via2[gIFR] & irq_bit;
} else if (irq_src == 7) {
+ /* FIXME: this can't work while a slot irq is disabled! */
return ~via2[gBufA] & irq_bit;
}
return 0;

View File

@ -1,873 +0,0 @@
Subject: [PATCH 9/13] m68k: Mac II ADB fixes
From: Finn Thain <fthain@telegraphics.com.au>
Fix a crash caused by requests placed in the queue with the completed flag
already set. This lead to some ADB_SYNC requests returning early and their
request structs being popped off the stack while still queued. Stack corruption
ensued or an invalid request callback pointer was invoked or both. Eliminate
macii_retransmit() and its buggy implementation of macii_write(). Have
macii_queue_poll() fully initialise the request queues.
Fix a bug in macii_queue_poll() where the last_req pointer was not being set.
This caused some requests to leave the queue before being completed (and would
also corrupt the stack under certain conditions).
Fix a race in macii_start that could set the state machine to "reading" while
current_req was null.
No longer send poll commands with the ADBREQ_REPLY flag -- doing that caused
the replies to be stored in the request buffer where they were forgotten
about.
Don't autopoll by continuously sending new Talk commands. Get the controller to
do that for us. This reduces the ADB interrupt rate on an idle bus to about 5
per second. Only autopoll the devices that were probed.
Explicitly clear the interrupt flag when polling.
Use disable_irq rather than local_irq_save when polling.
Remove excess local_irq_save/restore pairs.
Improve bus timeout and service request detection.
Remove unused code (last_reply, adb_dir etc) and unneeded code (prefix_len,
first_byte etc).
Change TIP and TACK to their correct names on this ADB controller (ST_EVEN and
ST_ODD).
Add some commentry.
Add a generous quantity of sanity checks (BUG_ONs).
Let m68k macs use the adb_sync boot param too.
Tested on Mac II, Mac IIci, Quadra 650, Quadra 700 etc.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/kernel/setup.c | 10
drivers/macintosh/via-macii.c | 582 +++++++++++++++++-------------------------
2 files changed, 251 insertions(+), 341 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/setup.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/setup.c
@@ -513,3 +513,13 @@ void check_bugs(void)
}
#endif /* !CONFIG_M68KFPU_EMU */
}
+
+#ifdef CONFIG_ADB
+static int __init adb_probe_sync_enable (char *str) {
+ extern int __adb_probe_sync;
+ __adb_probe_sync = 1;
+ return 1;
+}
+
+__setup("adb_sync", adb_probe_sync_enable);
+#endif /* CONFIG_ADB */
--- linux-m68k-2.6.21.orig/drivers/macintosh/via-macii.c
+++ linux-m68k-2.6.21/drivers/macintosh/via-macii.c
@@ -12,6 +12,15 @@
* 1999-08-02 (jmt) - Initial rewrite for Unified ADB.
* 2000-03-29 Tony Mantler <tonym@mac.linux-m68k.org>
* - Big overhaul, should actually work now.
+ * 2006-12-31 Finn Thain <fthain@telegraphics.com.au> - Another overhaul.
+ *
+ * Suggested reading:
+ * Inside Macintosh, ch. 5 ADB Manager
+ * Guide to the Macinstosh Family Hardware, ch. 8 Apple Desktop Bus
+ * Rockwell R6522 VIA datasheet
+ *
+ * Apple's "ADB Analyzer" bus sniffer is invaluable:
+ * ftp://ftp.apple.com/developer/Tool_Chest/Devices_-_Hardware/Apple_Desktop_Bus/
*/
#include <stdarg.h>
@@ -26,7 +35,6 @@
#include <asm/macints.h>
#include <asm/machw.h>
#include <asm/mac_via.h>
-#include <asm/io.h>
#include <asm/system.h>
static volatile unsigned char *via;
@@ -51,9 +59,7 @@ static volatile unsigned char *via;
#define ANH (15*RS) /* A-side data, no handshake */
/* Bits in B data register: all active low */
-#define TREQ 0x08 /* Transfer request (input) */
-#define TACK 0x10 /* Transfer acknowledge (output) */
-#define TIP 0x20 /* Transfer in progress (output) */
+#define CTLR_IRQ 0x08 /* Controller rcv status (input) */
#define ST_MASK 0x30 /* mask for selecting ADB state bits */
/* Bits in ACR */
@@ -65,8 +71,6 @@ static volatile unsigned char *via;
#define IER_SET 0x80 /* set bits in IER */
#define IER_CLR 0 /* clear bits in IER */
#define SR_INT 0x04 /* Shift register full/empty */
-#define SR_DATA 0x08 /* Shift register data */
-#define SR_CLOCK 0x10 /* Shift register clock */
/* ADB transaction states according to GMHW */
#define ST_CMD 0x00 /* ADB state: command byte */
@@ -77,7 +81,6 @@ static volatile unsigned char *via;
static int macii_init_via(void);
static void macii_start(void);
static irqreturn_t macii_interrupt(int irq, void *arg);
-static void macii_retransmit(int);
static void macii_queue_poll(void);
static int macii_probe(void);
@@ -103,29 +106,37 @@ static enum macii_state {
sending,
reading,
read_done,
- awaiting_reply
} macii_state;
-static int need_poll;
-static int command_byte;
-static int last_reply;
-static int last_active;
-
-static struct adb_request *current_req;
-static struct adb_request *last_req;
-static struct adb_request *retry_req;
-static unsigned char reply_buf[16];
-static unsigned char *reply_ptr;
-static int reply_len;
-static int reading_reply;
-static int data_index;
-static int first_byte;
-static int prefix_len;
-static int status = ST_IDLE|TREQ;
-static int last_status;
-static int driver_running;
-
-/* debug level 10 required for ADB logging (should be && debug_adb, ideally) */
+static struct adb_request *current_req; /* first request struct in the queue */
+static struct adb_request *last_req; /* last request struct in the queue */
+static unsigned char reply_buf[16]; /* storage for autopolled replies */
+static unsigned char *reply_ptr; /* next byte in req->data or reply_buf */
+static int reading_reply; /* store reply in reply_buf else req->reply */
+static int data_index; /* index of the next byte to send from req->data */
+static int reply_len; /* number of bytes received in reply_buf or req->reply */
+static int status; /* VIA's ADB status bits captured upon interrupt */
+static int last_status; /* status bits as at previous interrupt */
+static int srq_asserted; /* have to poll for the device that asserted it */
+static int command_byte; /* the most recent command byte transmitted */
+static int autopoll_devs; /* bits set are device addresses to be polled */
+
+/* Sanity check for request queue. Doesn't check for cycles. */
+static int request_is_queued(struct adb_request *req) {
+ struct adb_request *cur;
+ unsigned long flags;
+ local_irq_save(flags);
+ cur = current_req;
+ while (cur) {
+ if (cur == req) {
+ local_irq_restore(flags);
+ return 1;
+ }
+ cur = cur->next;
+ }
+ local_irq_restore(flags);
+ return 0;
+}
/* Check for MacII style ADB */
static int macii_probe(void)
@@ -147,15 +158,16 @@ int macii_init(void)
local_irq_save(flags);
err = macii_init_via();
- if (err) return err;
+ if (err) goto out;
err = request_irq(IRQ_MAC_ADB, macii_interrupt, IRQ_FLG_LOCK, "ADB",
macii_interrupt);
- if (err) return err;
+ if (err) goto out;
macii_state = idle;
+out:
local_irq_restore(flags);
- return 0;
+ return err;
}
/* initialize the hardware */
@@ -163,12 +175,12 @@ static int macii_init_via(void)
{
unsigned char x;
- /* Set the lines up. We want TREQ as input TACK|TIP as output */
- via[DIRB] = (via[DIRB] | TACK | TIP) & ~TREQ;
+ /* We want CTLR_IRQ as input and ST_EVEN | ST_ODD as output lines. */
+ via[DIRB] = (via[DIRB] | ST_EVEN | ST_ODD) & ~CTLR_IRQ;
/* Set up state: idle */
via[B] |= ST_IDLE;
- last_status = via[B] & (ST_MASK|TREQ);
+ last_status = via[B] & (ST_MASK|CTLR_IRQ);
/* Shift register on input */
via[ACR] = (via[ACR] & ~SR_CTRL) | SR_EXT;
@@ -179,81 +191,72 @@ static int macii_init_via(void)
return 0;
}
-/* Send an ADB poll (Talk Register 0 command, tagged on the front of the request queue) */
+/* Send an ADB poll (Talk Register 0 command prepended to the request queue) */
static void macii_queue_poll(void)
{
- static int device = 0;
- static int in_poll=0;
+ /* No point polling the active device as it will never assert SRQ, so
+ * poll the next device in the autopoll list. This could leave us
+ * stuck in a polling loop if an unprobed device is asserting SRQ.
+ * In theory, that could only happen if a device was plugged in after
+ * probing started. Unplugging it again will break the cycle.
+ * (Simply polling the next higher device often ends up polling almost
+ * every device (after wrapping around), which takes too long.)
+ */
+ int device_mask;
+ int next_device;
static struct adb_request req;
- unsigned long flags;
-
- if (in_poll) printk("macii_queue_poll: double poll!\n");
- in_poll++;
- if (++device > 15) device = 1;
-
- adb_request(&req, NULL, ADBREQ_REPLY|ADBREQ_NOSEND, 1,
- ADB_READREG(device, 0));
-
- local_irq_save(flags);
+ if (!autopoll_devs) return;
+ device_mask = (1 << (((command_byte & 0xF0) >> 4) + 1)) - 1;
+ if (autopoll_devs & ~device_mask)
+ next_device = ffs(autopoll_devs & ~device_mask) - 1;
+ else
+ next_device = ffs(autopoll_devs) - 1;
+
+ BUG_ON(request_is_queued(&req));
+
+ adb_request(&req, NULL, ADBREQ_NOSEND, 1,
+ ADB_READREG(next_device, 0));
+
+ req.sent = 0;
+ req.complete = 0;
+ req.reply_len = 0;
req.next = current_req;
- current_req = &req;
-
- local_irq_restore(flags);
- macii_start();
- in_poll--;
-}
-
-/* Send an ADB retransmit (Talk, appended to the request queue) */
-static void macii_retransmit(int device)
-{
- static int in_retransmit = 0;
- static struct adb_request rt;
- unsigned long flags;
-
- if (in_retransmit) printk("macii_retransmit: double retransmit!\n");
-
- in_retransmit++;
-
- adb_request(&rt, NULL, ADBREQ_REPLY|ADBREQ_NOSEND, 1,
- ADB_READREG(device, 0));
-
- local_irq_save(flags);
if (current_req != NULL) {
- last_req->next = &rt;
- last_req = &rt;
+ current_req = &req;
} else {
- current_req = &rt;
- last_req = &rt;
+ current_req = &req;
+ last_req = &req;
}
-
- if (macii_state == idle) macii_start();
-
- local_irq_restore(flags);
- in_retransmit--;
}
/* Send an ADB request; if sync, poll out the reply 'till it's done */
static int macii_send_request(struct adb_request *req, int sync)
{
- int i;
+ int err;
+ unsigned long flags;
- i = macii_write(req);
- if (i) return i;
+ BUG_ON(request_is_queued(req));
- if (sync) {
- while (!req->complete) macii_poll();
+ local_irq_save(flags);
+ err = macii_write(req);
+ local_irq_restore(flags);
+
+ if (!err && sync) {
+ while (!req->complete) {
+ macii_poll();
+ }
+ BUG_ON(request_is_queued(req));
}
- return 0;
+
+ return err;
}
-/* Send an ADB request */
+/* Send an ADB request (append to request queue) */
static int macii_write(struct adb_request *req)
{
- unsigned long flags;
-
if (req->nbytes < 2 || req->data[0] != ADB_PACKET || req->nbytes > 15) {
req->complete = 1;
return -EINVAL;
@@ -264,8 +267,6 @@ static int macii_write(struct adb_reques
req->complete = 0;
req->reply_len = 0;
- local_irq_save(flags);
-
if (current_req != NULL) {
last_req->next = req;
last_req = req;
@@ -274,28 +275,52 @@ static int macii_write(struct adb_reques
last_req = req;
if (macii_state == idle) macii_start();
}
-
- local_irq_restore(flags);
return 0;
}
/* Start auto-polling */
static int macii_autopoll(int devs)
{
- /* Just ping a random default address */
- if (!(current_req || retry_req))
- macii_retransmit( (last_active < 16 && last_active > 0) ? last_active : 3);
- return 0;
+ static struct adb_request req;
+ unsigned long flags;
+ int err = 0;
+
+ /* bit 1 == device 1, and so on. */
+ autopoll_devs = devs & 0xFFFE;
+
+ if (!autopoll_devs) return 0;
+
+ local_irq_save(flags);
+
+ if (current_req == NULL) {
+ /* Send a Talk Reg 0. The controller will repeatedly transmit
+ * this as long as it is idle.
+ */
+ adb_request(&req, NULL, ADBREQ_NOSEND, 1,
+ ADB_READREG(ffs(autopoll_devs) - 1, 0));
+ err = macii_write(&req);
+ }
+
+ local_irq_restore(flags);
+ return err;
+}
+
+static inline int need_autopoll(void) {
+ /* Was the last command Talk Reg 0
+ * and is the target on the autopoll list?
+ */
+ if ((command_byte & 0x0F) == 0x0C &&
+ ((1 << ((command_byte & 0xF0) >> 4)) & autopoll_devs))
+ return 0;
+ return 1;
}
/* Prod the chip without interrupts */
static void macii_poll(void)
{
- unsigned long flags;
-
- local_irq_save(flags);
- if (via[IFR] & SR_INT) macii_interrupt(0, NULL);
- local_irq_restore(flags);
+ disable_irq(IRQ_MAC_ADB);
+ macii_interrupt(0, NULL);
+ enable_irq(IRQ_MAC_ADB);
}
/* Reset the bus */
@@ -303,73 +328,34 @@ static int macii_reset_bus(void)
{
static struct adb_request req;
+ if (request_is_queued(&req))
+ return 0;
+
/* Command = 0, Address = ignored */
adb_request(&req, NULL, 0, 1, ADB_BUSRESET);
+ /* Don't want any more requests during the Global Reset low time. */
+ udelay(3000);
+
return 0;
}
/* Start sending ADB packet */
static void macii_start(void)
{
- unsigned long flags;
struct adb_request *req;
req = current_req;
- if (!req) return;
-
- /* assert macii_state == idle */
- if (macii_state != idle) {
- printk("macii_start: called while driver busy (%p %x %x)!\n",
- req, macii_state, (uint) via1[B] & (ST_MASK|TREQ));
- return;
- }
- local_irq_save(flags);
-
- /*
- * IRQ signaled ?? (means ADB controller wants to send, or might
- * be end of packet if we were reading)
- */
-#if 0 /* FIXME: This is broke broke broke, for some reason */
- if ((via[B] & TREQ) == 0) {
- printk("macii_start: weird poll stuff. huh?\n");
- /*
- * FIXME - we need to restart this on a timer
- * or a collision at boot hangs us.
- * Never set macii_state to idle here, or macii_start
- * won't be called again from send_request!
- * (need to re-check other cases ...)
- */
- /*
- * if the interrupt handler set the need_poll
- * flag, it's hopefully a SRQ poll or re-Talk
- * so we try to send here anyway
- */
- if (!need_poll) {
- if (console_loglevel == 10)
- printk("macii_start: device busy - retry %p state %d status %x!\n",
- req, macii_state,
- (uint) via[B] & (ST_MASK|TREQ));
- retry_req = req;
- /* set ADB status here ? */
- local_irq_restore(flags);
- return;
- } else {
- need_poll = 0;
- }
- }
-#endif
- /*
- * Another retry pending? (sanity check)
+ BUG_ON(req == NULL);
+
+ BUG_ON(macii_state != idle);
+
+ /* Now send it. Be careful though, that first byte of the request
+ * is actually ADB_PACKET; the real data begins at index 1!
+ * And req->nbytes is the number of bytes of real data plus one.
*/
- if (retry_req) {
- retry_req = NULL;
- }
- /* Now send it. Be careful though, that first byte of the request */
- /* is actually ADB_PACKET; the real data begins at index 1! */
-
/* store command byte */
command_byte = req->data[1];
/* Output mode */
@@ -381,115 +367,97 @@ static void macii_start(void)
macii_state = sending;
data_index = 2;
-
- local_irq_restore(flags);
}
/*
- * The notorious ADB interrupt handler - does all of the protocol handling,
- * except for starting new send operations. Relies heavily on the ADB
- * controller sending and receiving data, thereby generating SR interrupts
- * for us. This means there has to be always activity on the ADB bus, otherwise
- * the whole process dies and has to be re-kicked by sending TALK requests ...
- * CUDA-based Macs seem to solve this with the autopoll option, for MacII-type
- * ADB the problem isn't solved yet (retransmit of the latest active TALK seems
- * a good choice; either on timeout or on a timer interrupt).
+ * The notorious ADB interrupt handler - does all of the protocol handling.
+ * Relies on the ADB controller sending and receiving data, thereby
+ * generating shift register interrupts (SR_INT) for us. This means there has
+ * to be activity on the ADB bus. The chip will poll to achieve this.
*
* The basic ADB state machine was left unchanged from the original MacII code
* by Alan Cox, which was based on the CUDA driver for PowerMac.
- * The syntax of the ADB status lines seems to be totally different on MacII,
- * though. MacII uses the states Command -> Even -> Odd -> Even ->...-> Idle for
- * sending, and Idle -> Even -> Odd -> Even ->...-> Idle for receiving. Start
- * and end of a receive packet are signaled by asserting /IRQ on the interrupt
- * line. Timeouts are signaled by a sequence of 4 0xFF, with /IRQ asserted on
- * every other byte. SRQ is probably signaled by 3 or more 0xFF tacked on the
- * end of a packet. (Thanks to Guido Koerber for eavesdropping on the ADB
- * protocol with a logic analyzer!!)
- *
- * Note: As of 21/10/97, the MacII ADB part works including timeout detection
- * and retransmit (Talk to the last active device).
+ * The syntax of the ADB status lines is totally different on MacII,
+ * though. MacII uses the states Command -> Even -> Odd -> Even ->...-> Idle
+ * for sending and Idle -> Even -> Odd -> Even ->...-> Idle for receiving.
+ * Start and end of a receive packet are signalled by asserting /IRQ on the
+ * interrupt line (/IRQ means the CTLR_IRQ bit in port B; not to be confused
+ * with the VIA shift register interrupt. /IRQ never actually interrupts the
+ * processor, it's just an ordinary input.)
*/
static irqreturn_t macii_interrupt(int irq, void *arg)
{
- int x, adbdir;
- unsigned long flags;
+ int x;
+ static int entered;
struct adb_request *req;
- last_status = status;
-
- /* prevent races due to SCSI enabling ints */
- local_irq_save(flags);
-
- if (driver_running) {
- local_irq_restore(flags);
- return IRQ_NONE;
+ if (!arg) {
+ /* Clear the SR IRQ flag when polling. */
+ if (via[IFR] & SR_INT)
+ via[IFR] = SR_INT;
+ else
+ return IRQ_NONE;
}
- driver_running = 1;
-
- status = via[B] & (ST_MASK|TREQ);
- adbdir = via[ACR] & SR_OUT;
+ BUG_ON(entered++);
+
+ last_status = status;
+ status = via[B] & (ST_MASK|CTLR_IRQ);
switch (macii_state) {
case idle:
+ if (reading_reply) {
+ reply_ptr = current_req->reply;
+ } else {
+ BUG_ON(current_req != NULL);
+ reply_ptr = reply_buf;
+ }
+
x = via[SR];
- first_byte = x;
- /* set ADB state = even for first data byte */
- via[B] = (via[B] & ~ST_MASK) | ST_EVEN;
- reply_buf[0] = first_byte; /* was command_byte?? */
- reply_ptr = reply_buf + 1;
- reply_len = 1;
- prefix_len = 1;
- reading_reply = 0;
-
- macii_state = reading;
- break;
+ if ((status & CTLR_IRQ) && (x == 0xFF)) {
+ /* Bus timeout without SRQ sequence:
+ * data is "FF" while CTLR_IRQ is "H"
+ */
+ reply_len = 0;
+ srq_asserted = 0;
+ macii_state = read_done;
+ } else {
+ macii_state = reading;
+ *reply_ptr = x;
+ reply_len = 1;
+ }
- case awaiting_reply:
- /* handshake etc. for II ?? */
- x = via[SR];
- first_byte = x;
/* set ADB state = even for first data byte */
via[B] = (via[B] & ~ST_MASK) | ST_EVEN;
-
- current_req->reply[0] = first_byte;
- reply_ptr = current_req->reply + 1;
- reply_len = 1;
- prefix_len = 1;
- reading_reply = 1;
-
- macii_state = reading;
break;
case sending:
req = current_req;
if (data_index >= req->nbytes) {
- /* print an error message if a listen command has no data */
- if (((command_byte & 0x0C) == 0x08)
- /* && (console_loglevel == 10) */
- && (data_index == 2))
- printk("MacII ADB: listen command with no data: %x!\n",
- command_byte);
- /* reset to shift in */
- via[ACR] &= ~SR_OUT;
- x = via[SR];
- /* set ADB state idle - might get SRQ */
- via[B] = (via[B] & ~ST_MASK) | ST_IDLE;
-
req->sent = 1;
+ macii_state = idle;
if (req->reply_expected) {
- macii_state = awaiting_reply;
+ reading_reply = 1;
} else {
req->complete = 1;
current_req = req->next;
if (req->done) (*req->done)(req);
- macii_state = idle;
- if (current_req || retry_req)
+
+ if (current_req)
macii_start();
else
- macii_retransmit((command_byte & 0xF0) >> 4);
+ if (need_autopoll())
+ macii_autopoll(autopoll_devs);
+ }
+
+ if (macii_state == idle) {
+ /* reset to shift in */
+ via[ACR] &= ~SR_OUT;
+ x = via[SR];
+ /* set ADB state idle - might get SRQ */
+ via[B] = (via[B] & ~ST_MASK) | ST_IDLE;
}
} else {
via[SR] = req->data[data_index++];
@@ -505,147 +473,79 @@ static irqreturn_t macii_interrupt(int i
break;
case reading:
+ x = via[SR];
+ BUG_ON((status & ST_MASK) == ST_CMD ||
+ (status & ST_MASK) == ST_IDLE);
- /* timeout / SRQ handling for II hw */
- if( (first_byte == 0xFF && (reply_len-prefix_len)==2
- && memcmp(reply_ptr-2,"\xFF\xFF",2)==0) ||
- ((reply_len-prefix_len)==3
- && memcmp(reply_ptr-3,"\xFF\xFF\xFF",3)==0))
- {
- /*
- * possible timeout (in fact, most probably a
- * timeout, since SRQ can't be signaled without
- * transfer on the bus).
- * The last three bytes seen were FF, together
- * with the starting byte (in case we started
- * on 'idle' or 'awaiting_reply') this probably
- * makes four. So this is mostl likely #5!
- * The timeout signal is a pattern 1 0 1 0 0..
- * on /INT, meaning we missed it :-(
- */
- x = via[SR];
- if (x != 0xFF) printk("MacII ADB: mistaken timeout/SRQ!\n");
+ /* Bus timeout with SRQ sequence:
+ * data is "XX FF" while CTLR_IRQ is "L L"
+ * End of packet without SRQ sequence:
+ * data is "XX...YY 00" while CTLR_IRQ is "L...H L"
+ * End of packet SRQ sequence:
+ * data is "XX...YY 00" while CTLR_IRQ is "L...L L"
+ * (where XX is the first response byte and
+ * YY is the last byte of valid response data.)
+ */
- if ((status & TREQ) == (last_status & TREQ)) {
- /* Not a timeout. Unsolicited SRQ? weird. */
- /* Terminate the SRQ packet and poll */
- need_poll = 1;
+ srq_asserted = 0;
+ if (!(status & CTLR_IRQ)) {
+ if (x == 0xFF) {
+ if (!(last_status & CTLR_IRQ)) {
+ macii_state = read_done;
+ reply_len = 0;
+ srq_asserted = 1;
+ }
+ } else if (x == 0x00) {
+ macii_state = read_done;
+ if (!(last_status & CTLR_IRQ))
+ srq_asserted = 1;
}
- /* There's no packet to get, so reply is blank */
- via[B] ^= ST_MASK;
- reply_ptr -= (reply_len-prefix_len);
- reply_len = prefix_len;
- macii_state = read_done;
- break;
- } /* end timeout / SRQ handling for II hw. */
+ }
- if((reply_len-prefix_len)>3
- && memcmp(reply_ptr-3,"\xFF\xFF\xFF",3)==0)
- {
- /* SRQ tacked on data packet */
- /* Terminate the packet (SRQ never ends) */
- x = via[SR];
- macii_state = read_done;
- reply_len -= 3;
- reply_ptr -= 3;
- need_poll = 1;
- /* need to continue; next byte not seen else */
- } else {
- /* Sanity check */
- if (reply_len > 15) reply_len = 0;
- /* read byte */
- x = via[SR];
- *reply_ptr = x;
+ if (macii_state == reading) {
+ BUG_ON(reply_len > 15);
reply_ptr++;
+ *reply_ptr = x;
reply_len++;
}
- /* The usual handshake ... */
- /*
- * NetBSD hints that the next to last byte
- * is sent with IRQ !!
- * Guido found out it's the last one (0x0),
- * but IRQ should be asserted already.
- * Problem with timeout detection: First
- * transition to /IRQ might be second
- * byte of timeout packet!
- * Timeouts are signaled by 4x FF.
- */
- if (((status & TREQ) == 0) && (x == 0x00)) { /* != 0xFF */
- /* invert state bits, toggle ODD/EVEN */
- via[B] ^= ST_MASK;
-
- /* adjust packet length */
- reply_len--;
- reply_ptr--;
- macii_state = read_done;
- } else {
- /* not caught: ST_CMD */
- /* required for re-entry 'reading'! */
- if ((status & ST_MASK) == ST_IDLE) {
- /* (in)sanity check - set even */
- via[B] = (via[B] & ~ST_MASK) | ST_EVEN;
- } else {
- /* invert state bits */
- via[B] ^= ST_MASK;
- }
- }
+ /* invert state bits, toggle ODD/EVEN */
+ via[B] ^= ST_MASK;
break;
case read_done:
x = via[SR];
+
if (reading_reply) {
+ reading_reply = 0;
req = current_req;
- req->reply_len = reply_ptr - req->reply;
+ req->reply_len = reply_len;
req->complete = 1;
current_req = req->next;
if (req->done) (*req->done)(req);
- } else {
- adb_input(reply_buf, reply_ptr - reply_buf, 0);
- }
+ } else if (reply_len && autopoll_devs)
+ adb_input(reply_buf, reply_len, 0);
- /*
- * remember this device ID; it's the latest we got a
- * reply from!
- */
- last_reply = command_byte;
- last_active = (command_byte & 0xF0) >> 4;
+ macii_state = idle;
/* SRQ seen before, initiate poll now */
- if (need_poll) {
- macii_state = idle;
+ if (srq_asserted)
macii_queue_poll();
- need_poll = 0;
- break;
- }
-
- /* set ADB state to idle */
- via[B] = (via[B] & ~ST_MASK) | ST_IDLE;
-
- /* /IRQ seen, so the ADB controller has data for us */
- if ((via[B] & TREQ) != 0) {
- macii_state = reading;
- reply_buf[0] = command_byte;
- reply_ptr = reply_buf + 1;
- reply_len = 1;
- prefix_len = 1;
- reading_reply = 0;
- } else {
- /* no IRQ, send next packet or wait */
- macii_state = idle;
- if (current_req)
- macii_start();
- else
- macii_retransmit(last_active);
- }
+ if (current_req)
+ macii_start();
+ else
+ if (need_autopoll())
+ macii_autopoll(autopoll_devs);
+
+ if (macii_state == idle)
+ via[B] = (via[B] & ~ST_MASK) | ST_IDLE;
break;
default:
break;
}
- /* reset mutex and interrupts */
- driver_running = 0;
- local_irq_restore(flags);
+
+ entered--;
return IRQ_HANDLED;
}

View File

@ -1,951 +0,0 @@
Subject: [PATCH 11/13] m68k: macmace fixes
Cc: Jeff Garzik <jgarzik@pobox.com>, netdev@vger.kernel.org
From: Finn Thain <fthain@telegraphics.com.au>
Fix a race condition in the transmit code, where the dma interrupt could update
the free tx buffer count concurrently and wedge the tx queue.
Fix the misuse of the rx frame status and rx frame length registers: no more
"fifo overrun" errors caused by the OFLOW bit being tested in the frame length
register (instead of the status register), and no more missed packets due to
incorrect length taken from status register (instead of the frame length
register).
Fix a panic (skb_over_panic BUG) caused by allocating and then copying an
incoming packet while the packet length register was changing.
Cut-and-paste the reset code from the powermac mace driver (mace.c), so the NIC
functions when MacOS does not initialise it (important for anyone wanting to
use the Emile boot loader).
Cut-and-paste the error counting and timeout recovery code from mace.c.
Fix over allocation of rx buffer memory (it's page order, not page count).
Converted to driver model.
Converted to DMA API.
Since I've run out of ways to make it fail, and since it performs well now,
promote the driver from EXPERIMENTAL status. Tested on both quadra 840av and
660av.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/Kconfig | 4
drivers/net/Space.c | 4
drivers/net/macmace.c | 591 ++++++++++++++++++++++++++++++--------------------
3 files changed, 364 insertions(+), 235 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/Kconfig
+++ linux-m68k-2.6.21/drivers/net/Kconfig
@@ -337,8 +337,8 @@ config MACSONIC
be called macsonic.
config MACMACE
- bool "Macintosh (AV) onboard MACE ethernet (EXPERIMENTAL)"
- depends on NET_ETHERNET && MAC && EXPERIMENTAL
+ bool "Macintosh (AV) onboard MACE ethernet"
+ depends on NET_ETHERNET && MAC
select CRC32
help
Support for the onboard AMD 79C940 MACE Ethernet controller used in
--- linux-m68k-2.6.21.orig/drivers/net/Space.c
+++ linux-m68k-2.6.21/drivers/net/Space.c
@@ -83,7 +83,6 @@ extern struct net_device *bagetlance_pro
extern struct net_device *mvme147lance_probe(int unit);
extern struct net_device *tc515_probe(int unit);
extern struct net_device *lance_probe(int unit);
-extern struct net_device *mace_probe(int unit);
extern struct net_device *mac8390_probe(int unit);
extern struct net_device *mac89x0_probe(int unit);
extern struct net_device *mc32_probe(int unit);
@@ -274,9 +273,6 @@ static struct devprobe2 m68k_probes[] __
#ifdef CONFIG_MVME147_NET /* MVME147 internal Ethernet */
{mvme147lance_probe, 0},
#endif
-#ifdef CONFIG_MACMACE /* Mac 68k Quadra AV builtin Ethernet */
- {mace_probe, 0},
-#endif
#ifdef CONFIG_MAC8390 /* NuBus NS8390-based cards */
{mac8390_probe, 0},
#endif
--- linux-m68k-2.6.21.orig/drivers/net/macmace.c
+++ linux-m68k-2.6.21/drivers/net/macmace.c
@@ -12,6 +12,11 @@
* Copyright (C) 1998 Alan Cox <alan@redhat.com>
*
* Modified heavily by Joshua M. Thompson based on Dave Huang's NetBSD driver
+ *
+ * Copyright (C) 2007 Finn Thain
+ *
+ * Converted to DMA API, converted to unified driver model,
+ * sync'd some routines with mace.c and fixed various bugs.
*/
@@ -23,8 +28,9 @@
#include <linux/string.h>
#include <linux/crc32.h>
#include <linux/bitrev.h>
+#include <linux/dma-mapping.h>
+#include <linux/platform_device.h>
#include <asm/io.h>
-#include <asm/pgtable.h>
#include <asm/irq.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
@@ -32,13 +38,20 @@
#include <asm/page.h>
#include "mace.h"
-#define N_TX_RING 1
-#define N_RX_RING 8
-#define N_RX_PAGES ((N_RX_RING * 0x0800 + PAGE_SIZE - 1) / PAGE_SIZE)
+static char mac_mace_string[] = "macmace";
+static struct platform_device *mac_mace_device;
+
+#define N_TX_BUFF_ORDER 0
+#define N_TX_RING (1 << N_TX_BUFF_ORDER)
+#define N_RX_BUFF_ORDER 3
+#define N_RX_RING (1 << N_RX_BUFF_ORDER)
+
#define TX_TIMEOUT HZ
-/* Bits in transmit DMA status */
-#define TX_DMA_ERR 0x80
+#define MACE_BUFF_SIZE 0x800
+
+/* Chip rev needs workaround on HW & multicast addr change */
+#define BROKEN_ADDRCHG_REV 0x0941
/* The MACE is simply wired down on a Mac68K box */
@@ -47,40 +60,46 @@
struct mace_data {
volatile struct mace *mace;
- volatile unsigned char *tx_ring;
- volatile unsigned char *tx_ring_phys;
- volatile unsigned char *rx_ring;
- volatile unsigned char *rx_ring_phys;
+ unsigned char *tx_ring;
+ dma_addr_t tx_ring_phys;
+ unsigned char *rx_ring;
+ dma_addr_t rx_ring_phys;
int dma_intr;
struct net_device_stats stats;
int rx_slot, rx_tail;
int tx_slot, tx_sloti, tx_count;
+ int chipid;
+ struct device *device;
};
struct mace_frame {
- u16 len;
- u16 status;
- u16 rntpc;
- u16 rcvcc;
- u32 pad1;
- u32 pad2;
+ u8 rcvcnt;
+ u8 pad1;
+ u8 rcvsts;
+ u8 pad2;
+ u8 rntpc;
+ u8 pad3;
+ u8 rcvcc;
+ u8 pad4;
+ u32 pad5;
+ u32 pad6;
u8 data[1];
/* And frame continues.. */
};
#define PRIV_BYTES sizeof(struct mace_data)
-extern void psc_debug_dump(void);
-
static int mace_open(struct net_device *dev);
static int mace_close(struct net_device *dev);
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev);
static struct net_device_stats *mace_stats(struct net_device *dev);
static void mace_set_multicast(struct net_device *dev);
static int mace_set_address(struct net_device *dev, void *addr);
+static void mace_reset(struct net_device *dev);
static irqreturn_t mace_interrupt(int irq, void *dev_id);
static irqreturn_t mace_dma_intr(int irq, void *dev_id);
static void mace_tx_timeout(struct net_device *dev);
+static void __mace_set_address(struct net_device *dev, void *addr);
/*
* Load a receive DMA channel with a base address and ring length
@@ -88,7 +107,7 @@ static void mace_tx_timeout(struct net_d
static void mace_load_rxdma_base(struct net_device *dev, int set)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
psc_write_word(PSC_ENETRD_CMD + set, 0x0100);
psc_write_long(PSC_ENETRD_ADDR + set, (u32) mp->rx_ring_phys);
@@ -103,7 +122,7 @@ static void mace_load_rxdma_base(struct
static void mace_rxdma_reset(struct net_device *dev)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mace = mp->mace;
u8 maccc = mace->maccc;
@@ -130,7 +149,7 @@ static void mace_rxdma_reset(struct net_
static void mace_txdma_reset(struct net_device *dev)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mace = mp->mace;
u8 maccc;
@@ -168,7 +187,7 @@ static void mace_dma_off(struct net_devi
* model of Macintrash has a MACE (AV macintoshes)
*/
-struct net_device *mace_probe(int unit)
+static int __devinit mace_probe(struct platform_device *pdev)
{
int j;
struct mace_data *mp;
@@ -179,24 +198,28 @@ struct net_device *mace_probe(int unit)
int err;
if (found || macintosh_config->ether_type != MAC_ETHER_MACE)
- return ERR_PTR(-ENODEV);
+ return -ENODEV;
found = 1; /* prevent 'finding' one on every device probe */
dev = alloc_etherdev(PRIV_BYTES);
if (!dev)
- return ERR_PTR(-ENOMEM);
+ return -ENOMEM;
- if (unit >= 0)
- sprintf(dev->name, "eth%d", unit);
+ mp = netdev_priv(dev);
+
+ mp->device = &pdev->dev;
+ SET_NETDEV_DEV(dev, &pdev->dev);
+ SET_MODULE_OWNER(dev);
- mp = (struct mace_data *) dev->priv;
dev->base_addr = (u32)MACE_BASE;
mp->mace = (volatile struct mace *) MACE_BASE;
dev->irq = IRQ_MAC_MACE;
mp->dma_intr = IRQ_MAC_MACE_DMA;
+ mp->chipid = mp->mace->chipid_hi << 8 | mp->mace->chipid_lo;
+
/*
* The PROM contains 8 bytes which total 0xFF when XOR'd
* together. Due to the usual peculiar apple brain damage
@@ -217,7 +240,7 @@ struct net_device *mace_probe(int unit)
if (checksum != 0xFF) {
free_netdev(dev);
- return ERR_PTR(-ENODEV);
+ return -ENODEV;
}
memset(&mp->stats, 0, sizeof(mp->stats));
@@ -237,22 +260,98 @@ struct net_device *mace_probe(int unit)
err = register_netdev(dev);
if (!err)
- return dev;
+ return 0;
free_netdev(dev);
- return ERR_PTR(err);
+ return err;
+}
+
+/*
+ * Reset the chip.
+ */
+
+static void mace_reset(struct net_device *dev)
+{
+ struct mace_data *mp = netdev_priv(dev);
+ volatile struct mace *mb = mp->mace;
+ int i;
+
+ /* soft-reset the chip */
+ i = 200;
+ while (--i) {
+ mb->biucc = SWRST;
+ if (mb->biucc & SWRST) {
+ udelay(10);
+ continue;
+ }
+ break;
+ }
+ if (!i) {
+ printk(KERN_ERR "macmace: cannot reset chip!\n");
+ return;
+ }
+
+ mb->maccc = 0; /* turn off tx, rx */
+ mb->imr = 0xFF; /* disable all intrs for now */
+ i = mb->ir;
+
+ mb->biucc = XMTSP_64;
+ mb->utr = RTRD;
+ mb->fifocc = XMTFW_8 | RCVFW_64 | XMTFWU | RCVFWU;
+
+ mb->xmtfc = AUTO_PAD_XMIT; /* auto-pad short frames */
+ mb->rcvfc = 0;
+
+ /* load up the hardware address */
+ __mace_set_address(dev, dev->dev_addr);
+
+ /* clear the multicast filter */
+ if (mp->chipid == BROKEN_ADDRCHG_REV)
+ mb->iac = LOGADDR;
+ else {
+ mb->iac = ADDRCHG | LOGADDR;
+ while ((mb->iac & ADDRCHG) != 0)
+ ;
+ }
+ for (i = 0; i < 8; ++i)
+ mb->ladrf = 0;
+
+ /* done changing address */
+ if (mp->chipid != BROKEN_ADDRCHG_REV)
+ mb->iac = 0;
+
+ mb->plscc = PORTSEL_AUI;
}
/*
* Load the address on a mace controller.
*/
-static int mace_set_address(struct net_device *dev, void *addr)
+static void __mace_set_address(struct net_device *dev, void *addr)
{
- unsigned char *p = addr;
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mb = mp->mace;
+ unsigned char *p = addr;
int i;
+
+ /* load up the hardware address */
+ if (mp->chipid == BROKEN_ADDRCHG_REV)
+ mb->iac = PHYADDR;
+ else {
+ mb->iac = ADDRCHG | PHYADDR;
+ while ((mb->iac & ADDRCHG) != 0)
+ ;
+ }
+ for (i = 0; i < 6; ++i)
+ mb->padr = dev->dev_addr[i] = p[i];
+ if (mp->chipid != BROKEN_ADDRCHG_REV)
+ mb->iac = 0;
+}
+
+static int mace_set_address(struct net_device *dev, void *addr)
+{
+ struct mace_data *mp = netdev_priv(dev);
+ volatile struct mace *mb = mp->mace;
unsigned long flags;
u8 maccc;
@@ -260,15 +359,10 @@ static int mace_set_address(struct net_d
maccc = mb->maccc;
- /* load up the hardware address */
- mb->iac = ADDRCHG | PHYADDR;
- while ((mb->iac & ADDRCHG) != 0);
-
- for (i = 0; i < 6; ++i) {
- mb->padr = dev->dev_addr[i] = p[i];
- }
+ __mace_set_address(dev, addr);
mb->maccc = maccc;
+
local_irq_restore(flags);
return 0;
@@ -281,31 +375,11 @@ static int mace_set_address(struct net_d
static int mace_open(struct net_device *dev)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mb = mp->mace;
-#if 0
- int i;
- i = 200;
- while (--i) {
- mb->biucc = SWRST;
- if (mb->biucc & SWRST) {
- udelay(10);
- continue;
- }
- break;
- }
- if (!i) {
- printk(KERN_ERR "%s: software reset failed!!\n", dev->name);
- return -EAGAIN;
- }
-#endif
-
- mb->biucc = XMTSP_64;
- mb->fifocc = XMTFW_16 | RCVFW_64 | XMTFWU | RCVFWU | XMTBRST | RCVBRST;
- mb->xmtfc = AUTO_PAD_XMIT;
- mb->plscc = PORTSEL_AUI;
- /* mb->utr = RTRD; */
+ /* reset the chip */
+ mace_reset(dev);
if (request_irq(dev->irq, mace_interrupt, 0, dev->name, dev)) {
printk(KERN_ERR "%s: can't get irq %d\n", dev->name, dev->irq);
@@ -319,25 +393,21 @@ static int mace_open(struct net_device *
/* Allocate the DMA ring buffers */
- mp->rx_ring = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, N_RX_PAGES);
- mp->tx_ring = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, 0);
-
- if (mp->tx_ring==NULL || mp->rx_ring==NULL) {
- if (mp->rx_ring) free_pages((u32) mp->rx_ring, N_RX_PAGES);
- if (mp->tx_ring) free_pages((u32) mp->tx_ring, 0);
- free_irq(dev->irq, dev);
- free_irq(mp->dma_intr, dev);
- printk(KERN_ERR "%s: unable to allocate DMA buffers\n", dev->name);
- return -ENOMEM;
+ mp->tx_ring = dma_alloc_coherent(mp->device,
+ N_TX_RING * MACE_BUFF_SIZE,
+ &mp->tx_ring_phys, GFP_KERNEL);
+ if (mp->tx_ring == NULL) {
+ printk(KERN_ERR "%s: unable to allocate DMA tx buffers\n", dev->name);
+ goto out1;
}
- mp->rx_ring_phys = (unsigned char *) virt_to_bus((void *)mp->rx_ring);
- mp->tx_ring_phys = (unsigned char *) virt_to_bus((void *)mp->tx_ring);
-
- /* We want the Rx buffer to be uncached and the Tx buffer to be writethrough */
-
- kernel_set_cachemode((void *)mp->rx_ring, N_RX_PAGES * PAGE_SIZE, IOMAP_NOCACHE_NONSER);
- kernel_set_cachemode((void *)mp->tx_ring, PAGE_SIZE, IOMAP_WRITETHROUGH);
+ mp->rx_ring = dma_alloc_coherent(mp->device,
+ N_RX_RING * MACE_BUFF_SIZE,
+ &mp->rx_ring_phys, GFP_KERNEL);
+ if (mp->rx_ring == NULL) {
+ printk(KERN_ERR "%s: unable to allocate DMA rx buffers\n", dev->name);
+ goto out2;
+ }
mace_dma_off(dev);
@@ -348,34 +418,22 @@ static int mace_open(struct net_device *
psc_write_word(PSC_ENETWR_CTL, 0x0400);
psc_write_word(PSC_ENETRD_CTL, 0x0400);
-#if 0
- /* load up the hardware address */
-
- mb->iac = ADDRCHG | PHYADDR;
-
- while ((mb->iac & ADDRCHG) != 0);
-
- for (i = 0; i < 6; ++i)
- mb->padr = dev->dev_addr[i];
-
- /* clear the multicast filter */
- mb->iac = ADDRCHG | LOGADDR;
-
- while ((mb->iac & ADDRCHG) != 0);
-
- for (i = 0; i < 8; ++i)
- mb->ladrf = 0;
-
- mb->plscc = PORTSEL_GPSI + ENPLSIO;
-
- mb->maccc = ENXMT | ENRCV;
- mb->imr = RCVINT;
-#endif
-
mace_rxdma_reset(dev);
mace_txdma_reset(dev);
+ /* turn it on! */
+ mb->maccc = ENXMT | ENRCV;
+ /* enable all interrupts except receive interrupts */
+ mb->imr = RCVINT;
return 0;
+
+out2:
+ dma_free_coherent(mp->device, N_TX_RING * MACE_BUFF_SIZE,
+ mp->tx_ring, mp->tx_ring_phys);
+out1:
+ free_irq(dev->irq, dev);
+ free_irq(mp->dma_intr, dev);
+ return -ENOMEM;
}
/*
@@ -384,19 +442,13 @@ static int mace_open(struct net_device *
static int mace_close(struct net_device *dev)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mb = mp->mace;
mb->maccc = 0; /* disable rx and tx */
mb->imr = 0xFF; /* disable all irqs */
mace_dma_off(dev); /* disable rx and tx dma */
- free_irq(dev->irq, dev);
- free_irq(IRQ_MAC_MACE_DMA, dev);
-
- free_pages((u32) mp->rx_ring, N_RX_PAGES);
- free_pages((u32) mp->tx_ring, 0);
-
return 0;
}
@@ -406,15 +458,20 @@ static int mace_close(struct net_device
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
+ unsigned long flags;
- /* Stop the queue if the buffer is full */
+ /* Stop the queue since there's only the one buffer */
+ local_irq_save(flags);
+ netif_stop_queue(dev);
if (!mp->tx_count) {
- netif_stop_queue(dev);
- return 1;
+ printk(KERN_ERR "macmace: tx queue running but no free buffers.\n");
+ local_irq_restore(flags);
+ return NETDEV_TX_BUSY;
}
mp->tx_count--;
+ local_irq_restore(flags);
mp->stats.tx_packets++;
mp->stats.tx_bytes += skb->len;
@@ -433,23 +490,26 @@ static int mace_xmit_start(struct sk_buf
dev_kfree_skb(skb);
- return 0;
+ dev->trans_start = jiffies;
+ return NETDEV_TX_OK;
}
static struct net_device_stats *mace_stats(struct net_device *dev)
{
- struct mace_data *p = (struct mace_data *) dev->priv;
- return &p->stats;
+ struct mace_data *mp = netdev_priv(dev);
+ return &mp->stats;
}
static void mace_set_multicast(struct net_device *dev)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mb = mp->mace;
int i, j;
u32 crc;
u8 maccc;
+ unsigned long flags;
+ local_irq_save(flags);
maccc = mb->maccc;
mb->maccc &= ~PROM;
@@ -474,116 +534,122 @@ static void mace_set_multicast(struct ne
}
}
- mb->iac = ADDRCHG | LOGADDR;
- while (mb->iac & ADDRCHG);
-
- for (i = 0; i < 8; ++i) {
- mb->ladrf = multicast_filter[i];
+ if (mp->chipid == BROKEN_ADDRCHG_REV)
+ mb->iac = LOGADDR;
+ else {
+ mb->iac = ADDRCHG | LOGADDR;
+ while ((mb->iac & ADDRCHG) != 0)
+ ;
}
+ for (i = 0; i < 8; ++i)
+ mb->ladrf = multicast_filter[i];
+ if (mp->chipid != BROKEN_ADDRCHG_REV)
+ mb->iac = 0;
}
mb->maccc = maccc;
+ local_irq_restore(flags);
}
-/*
- * Miscellaneous interrupts are handled here. We may end up
- * having to bash the chip on the head for bad errors
- */
-
static void mace_handle_misc_intrs(struct mace_data *mp, int intr)
{
volatile struct mace *mb = mp->mace;
static int mace_babbles, mace_jabbers;
- if (intr & MPCO) {
+ if (intr & MPCO)
mp->stats.rx_missed_errors += 256;
- }
- mp->stats.rx_missed_errors += mb->mpc; /* reading clears it */
-
- if (intr & RNTPCO) {
+ mp->stats.rx_missed_errors += mb->mpc; /* reading clears it */
+ if (intr & RNTPCO)
mp->stats.rx_length_errors += 256;
- }
- mp->stats.rx_length_errors += mb->rntpc; /* reading clears it */
-
- if (intr & CERR) {
+ mp->stats.rx_length_errors += mb->rntpc; /* reading clears it */
+ if (intr & CERR)
++mp->stats.tx_heartbeat_errors;
- }
- if (intr & BABBLE) {
- if (mace_babbles++ < 4) {
- printk(KERN_DEBUG "mace: babbling transmitter\n");
- }
- }
- if (intr & JABBER) {
- if (mace_jabbers++ < 4) {
- printk(KERN_DEBUG "mace: jabbering transceiver\n");
- }
- }
+ if (intr & BABBLE)
+ if (mace_babbles++ < 4)
+ printk(KERN_DEBUG "macmace: babbling transmitter\n");
+ if (intr & JABBER)
+ if (mace_jabbers++ < 4)
+ printk(KERN_DEBUG "macmace: jabbering transceiver\n");
}
-/*
- * A transmit error has occurred. (We kick the transmit side from
- * the DMA completion)
- */
-
-static void mace_xmit_error(struct net_device *dev)
+static irqreturn_t mace_interrupt(int irq, void *dev_id)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct net_device *dev = (struct net_device *) dev_id;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mb = mp->mace;
- u8 xmtfs, xmtrc;
+ int intr, fs;
+ unsigned int flags;
+
+ /* don't want the dma interrupt handler to fire */
+ local_irq_save(flags);
- xmtfs = mb->xmtfs;
- xmtrc = mb->xmtrc;
+ intr = mb->ir; /* read interrupt register */
+ mace_handle_misc_intrs(mp, intr);
- if (xmtfs & XMTSV) {
- if (xmtfs & UFLO) {
- printk("%s: DMA underrun.\n", dev->name);
- mp->stats.tx_errors++;
- mp->stats.tx_fifo_errors++;
- mace_txdma_reset(dev);
+ if (intr & XMTINT) {
+ fs = mb->xmtfs;
+ if ((fs & XMTSV) == 0) {
+ printk(KERN_ERR "macmace: xmtfs not valid! (fs=%x)\n", fs);
+ mace_reset(dev);
+ /*
+ * XXX mace likes to hang the machine after a xmtfs error.
+ * This is hard to reproduce, reseting *may* help
+ */
}
- if (xmtfs & RTRY) {
- mp->stats.collisions++;
+ /* dma should have finished */
+ if (!mp->tx_count) {
+ printk(KERN_DEBUG "macmace: tx ring ran out? (fs=%x)\n", fs);
+ }
+ /* Update stats */
+ if (fs & (UFLO|LCOL|LCAR|RTRY)) {
+ ++mp->stats.tx_errors;
+ if (fs & LCAR)
+ ++mp->stats.tx_carrier_errors;
+ else if (fs & (UFLO|LCOL|RTRY)) {
+ ++mp->stats.tx_aborted_errors;
+ if (mb->xmtfs & UFLO) {
+ printk(KERN_ERR "%s: DMA underrun.\n", dev->name);
+ mp->stats.tx_fifo_errors++;
+ mace_txdma_reset(dev);
+ }
+ }
}
}
-}
-/*
- * A receive interrupt occurred.
- */
+ if (mp->tx_count)
+ netif_wake_queue(dev);
-static void mace_recv_interrupt(struct net_device *dev)
-{
-/* struct mace_data *mp = (struct mace_data *) dev->priv; */
-// volatile struct mace *mb = mp->mace;
-}
+ local_irq_restore(flags);
-/*
- * Process the chip interrupt
- */
+ return IRQ_HANDLED;
+}
-static irqreturn_t mace_interrupt(int irq, void *dev_id)
+static void mace_tx_timeout(struct net_device *dev)
{
- struct net_device *dev = (struct net_device *) dev_id;
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
volatile struct mace *mb = mp->mace;
- u8 ir;
+ unsigned long flags;
- ir = mb->ir;
- mace_handle_misc_intrs(mp, ir);
+ local_irq_save(flags);
- if (ir & XMTINT) {
- mace_xmit_error(dev);
- }
- if (ir & RCVINT) {
- mace_recv_interrupt(dev);
- }
- return IRQ_HANDLED;
-}
+ /* turn off both tx and rx and reset the chip */
+ mb->maccc = 0;
+ printk(KERN_ERR "macmace: transmit timeout - resetting\n");
+ mace_txdma_reset(dev);
+ mace_reset(dev);
-static void mace_tx_timeout(struct net_device *dev)
-{
-/* struct mace_data *mp = (struct mace_data *) dev->priv; */
-// volatile struct mace *mb = mp->mace;
+ /* restart rx dma */
+ mace_rxdma_reset(dev);
+
+ mp->tx_count = N_TX_RING;
+ netif_wake_queue(dev);
+
+ /* turn it on! */
+ mb->maccc = ENXMT | ENRCV;
+ /* enable all interrupts except receive interrupts */
+ mb->imr = RCVINT;
+
+ local_irq_restore(flags);
}
/*
@@ -592,41 +658,40 @@ static void mace_tx_timeout(struct net_d
static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
{
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
struct sk_buff *skb;
+ unsigned int frame_status = mf->rcvsts;
- if (mf->status & RS_OFLO) {
- printk("%s: fifo overflow.\n", dev->name);
- mp->stats.rx_errors++;
- mp->stats.rx_fifo_errors++;
- }
- if (mf->status&(RS_CLSN|RS_FRAMERR|RS_FCSERR))
+ if (frame_status & (RS_OFLO | RS_CLSN | RS_FRAMERR | RS_FCSERR)) {
mp->stats.rx_errors++;
+ if (frame_status & RS_OFLO) {
+ printk(KERN_DEBUG "%s: fifo overflow.\n", dev->name);
+ mp->stats.rx_fifo_errors++;
+ }
+ if (frame_status & RS_CLSN)
+ mp->stats.collisions++;
+ if (frame_status & RS_FRAMERR)
+ mp->stats.rx_frame_errors++;
+ if (frame_status & RS_FCSERR)
+ mp->stats.rx_crc_errors++;
+ } else {
+ unsigned int frame_length = mf->rcvcnt + ((frame_status & 0x0F) << 8 );
- if (mf->status&RS_CLSN) {
- mp->stats.collisions++;
- }
- if (mf->status&RS_FRAMERR) {
- mp->stats.rx_frame_errors++;
- }
- if (mf->status&RS_FCSERR) {
- mp->stats.rx_crc_errors++;
- }
+ skb = dev_alloc_skb(frame_length + 2);
+ if (!skb) {
+ mp->stats.rx_dropped++;
+ return;
+ }
+ skb_reserve(skb, 2);
+ memcpy(skb_put(skb, frame_length), mf->data, frame_length);
- skb = dev_alloc_skb(mf->len+2);
- if (!skb) {
- mp->stats.rx_dropped++;
- return;
+ skb->dev = dev;
+ skb->protocol = eth_type_trans(skb, dev);
+ netif_rx(skb);
+ dev->last_rx = jiffies;
+ mp->stats.rx_packets++;
+ mp->stats.rx_bytes += frame_length;
}
- skb_reserve(skb,2);
- memcpy(skb_put(skb, mf->len), mf->data, mf->len);
-
- skb->dev = dev;
- skb->protocol = eth_type_trans(skb, dev);
- netif_rx(skb);
- dev->last_rx = jiffies;
- mp->stats.rx_packets++;
- mp->stats.rx_bytes += mf->len;
}
/*
@@ -636,7 +701,7 @@ static void mace_dma_rx_frame(struct net
static irqreturn_t mace_dma_intr(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *) dev_id;
- struct mace_data *mp = (struct mace_data *) dev->priv;
+ struct mace_data *mp = netdev_priv(dev);
int left, head;
u16 status;
u32 baka;
@@ -663,7 +728,8 @@ static irqreturn_t mace_dma_intr(int irq
/* Loop through the ring buffer and process new packages */
while (mp->rx_tail < head) {
- mace_dma_rx_frame(dev, (struct mace_frame *) (mp->rx_ring + (mp->rx_tail * 0x0800)));
+ mace_dma_rx_frame(dev, (struct mace_frame*) (mp->rx_ring
+ + (mp->rx_tail * MACE_BUFF_SIZE)));
mp->rx_tail++;
}
@@ -690,9 +756,76 @@ static irqreturn_t mace_dma_intr(int irq
psc_write_word(PSC_ENETWR_CMD + mp->tx_sloti, 0x0100);
mp->tx_sloti ^= 0x10;
mp->tx_count++;
- netif_wake_queue(dev);
}
return IRQ_HANDLED;
}
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Macintosh MACE ethernet driver");
+
+static int __devexit mac_mace_device_remove (struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+ struct mace_data *mp = netdev_priv(dev);
+
+ unregister_netdev(dev);
+
+ free_irq(dev->irq, dev);
+ free_irq(IRQ_MAC_MACE_DMA, dev);
+
+ dma_free_coherent(mp->device, N_RX_RING * MACE_BUFF_SIZE,
+ mp->rx_ring, mp->rx_ring_phys);
+ dma_free_coherent(mp->device, N_TX_RING * MACE_BUFF_SIZE,
+ mp->tx_ring, mp->tx_ring_phys);
+
+ free_netdev(dev);
+
+ return 0;
+}
+
+static struct platform_driver mac_mace_driver = {
+ .probe = mace_probe,
+ .remove = __devexit_p(mac_mace_device_remove),
+ .driver = {
+ .name = mac_mace_string,
+ },
+};
+
+static int __init mac_mace_init_module(void)
+{
+ int err;
+
+ if ((err = platform_driver_register(&mac_mace_driver))) {
+ printk(KERN_ERR "Driver registration failed\n");
+ return err;
+ }
+
+ mac_mace_device = platform_device_alloc(mac_mace_string, 0);
+ if (!mac_mace_device)
+ goto out_unregister;
+
+ if (platform_device_add(mac_mace_device)) {
+ platform_device_put(mac_mace_device);
+ mac_mace_device = NULL;
+ }
+
+ return 0;
+
+out_unregister:
+ platform_driver_unregister(&mac_mace_driver);
+
+ return -ENOMEM;
+}
+
+static void __exit mac_mace_cleanup_module(void)
+{
+ platform_driver_unregister(&mac_mace_driver);
+
+ if (mac_mace_device) {
+ platform_device_unregister(mac_mace_device);
+ mac_mace_device = NULL;
+ }
+}
+
+module_init(mac_mace_init_module);
+module_exit(mac_mace_cleanup_module);

View File

@ -1,194 +0,0 @@
Subject: [PATCH 13/13] SONIC interrupt handling
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Jeff Garzik <jgarzik@pobox.com>, netdev@vger.kernel.org,
linux-mips@linux-mips.org
From: Finn Thain <fthain@telegraphics.com.au>
Install the built-in macsonic interrupt handler on both IRQs when using
via_alt_mapping. Otherwise the rare interrupt that still comes from the
nubus slot will wedge the nubus.
$ cat /proc/interrupts
auto 2: 89176 via2
auto 3: 744367 sonic
auto 4: 0 scc
auto 6: 318363 via1
auto 7: 0 NMI
mac 9: 119413 framebuffer vbl
mac 10: 1971 ADB
mac 14: 198517 timer
mac 17: 89104 nubus
mac 19: 72 Mac ESP SCSI
mac 56: 629 sonic
mac 62: 1142593 ide0
Version 1 of this patch had a bug where a nubus sonic card would register
two interrupt handlers. Only a built-in sonic needs both.
Versions 2 and 3 needed some cleanups, as Raylynn Knight and Christoph
Hellwig pointed out (thanks).
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/net/jazzsonic.c | 23 +++++++++++++++++++----
drivers/net/macsonic.c | 46 ++++++++++++++++++++++++++++++++++++++++++----
drivers/net/sonic.c | 25 -------------------------
3 files changed, 61 insertions(+), 33 deletions(-)
--- linux-m68k-2.6.22-rc1.orig/drivers/net/jazzsonic.c
+++ linux-m68k-2.6.22-rc1/drivers/net/jazzsonic.c
@@ -88,6 +88,23 @@ static unsigned short known_revisions[]
0xffff /* end of list */
};
+static int jazzsonic_open(struct net_device* dev)
+{
+ if (request_irq(dev->irq, &sonic_interrupt, IRQF_DISABLED, "sonic", dev)) {
+ printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
+ return -EAGAIN;
+ }
+ return sonic_open(dev);
+}
+
+static int jazzsonic_close(struct net_device* dev)
+{
+ int err;
+ err = sonic_close(dev);
+ free_irq(dev->irq, dev);
+ return err;
+}
+
static int __init sonic_probe1(struct net_device *dev)
{
static unsigned version_printed;
@@ -169,8 +186,8 @@ static int __init sonic_probe1(struct ne
lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
* SONIC_BUS_SCALE(lp->dma_bitmode));
- dev->open = sonic_open;
- dev->stop = sonic_close;
+ dev->open = jazzsonic_open;
+ dev->stop = jazzsonic_close;
dev->hard_start_xmit = sonic_send_packet;
dev->get_stats = sonic_get_stats;
dev->set_multicast_list = &sonic_multicast_list;
@@ -260,8 +277,6 @@ MODULE_DESCRIPTION("Jazz SONIC ethernet
module_param(sonic_debug, int, 0);
MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)");
-#define SONIC_IRQ_FLAG IRQF_DISABLED
-
#include "sonic.c"
static int __devexit jazz_sonic_device_remove (struct platform_device *pdev)
--- linux-m68k-2.6.22-rc1.orig/drivers/net/macsonic.c
+++ linux-m68k-2.6.22-rc1/drivers/net/macsonic.c
@@ -130,6 +130,46 @@ static inline void bit_reverse_addr(unsi
addr[i] = bitrev8(addr[i]);
}
+static irqreturn_t macsonic_interrupt(int irq, void *dev_id)
+{
+ irqreturn_t result;
+ unsigned long flags;
+
+ local_irq_save(flags);
+ result = sonic_interrupt(irq, dev_id);
+ local_irq_restore(flags);
+ return result;
+}
+
+static int macsonic_open(struct net_device* dev)
+{
+ if (request_irq(dev->irq, &sonic_interrupt, IRQ_FLG_FAST, "sonic", dev)) {
+ printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
+ return -EAGAIN;
+ }
+ /* Under the A/UX interrupt scheme, the onboard SONIC interrupt comes
+ * in at priority level 3. However, we sometimes get the level 2 inter-
+ * rupt as well, which must prevent re-entrance of the sonic handler.
+ */
+ if (dev->irq == IRQ_AUTO_3)
+ if (request_irq(IRQ_NUBUS_9, &macsonic_interrupt, IRQ_FLG_FAST, "sonic", dev)) {
+ printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, IRQ_NUBUS_9);
+ free_irq(dev->irq, dev);
+ return -EAGAIN;
+ }
+ return sonic_open(dev);
+}
+
+static int macsonic_close(struct net_device* dev)
+{
+ int err;
+ err = sonic_close(dev);
+ free_irq(dev->irq, dev);
+ if (dev->irq == IRQ_AUTO_3)
+ free_irq(IRQ_NUBUS_9, dev);
+ return err;
+}
+
int __init macsonic_init(struct net_device* dev)
{
struct sonic_local* lp = netdev_priv(dev);
@@ -160,8 +200,8 @@ int __init macsonic_init(struct net_devi
lp->rra_laddr = lp->rda_laddr + (SIZEOF_SONIC_RD * SONIC_NUM_RDS
* SONIC_BUS_SCALE(lp->dma_bitmode));
- dev->open = sonic_open;
- dev->stop = sonic_close;
+ dev->open = macsonic_open;
+ dev->stop = macsonic_close;
dev->hard_start_xmit = sonic_send_packet;
dev->get_stats = sonic_get_stats;
dev->set_multicast_list = &sonic_multicast_list;
@@ -572,8 +612,6 @@ MODULE_DESCRIPTION("Macintosh SONIC ethe
module_param(sonic_debug, int, 0);
MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
-#define SONIC_IRQ_FLAG IRQ_FLG_FAST
-
#include "sonic.c"
static int __devexit mac_sonic_device_remove (struct platform_device *pdev)
--- linux-m68k-2.6.22-rc1.orig/drivers/net/sonic.c
+++ linux-m68k-2.6.22-rc1/drivers/net/sonic.c
@@ -50,29 +50,6 @@ static int sonic_open(struct net_device
if (sonic_debug > 2)
printk("sonic_open: initializing sonic driver.\n");
- /*
- * We don't need to deal with auto-irq stuff since we
- * hardwire the sonic interrupt.
- */
-/*
- * XXX Horrible work around: We install sonic_interrupt as fast interrupt.
- * This means that during execution of the handler interrupt are disabled
- * covering another bug otherwise corrupting data. This doesn't mean
- * this glue works ok under all situations.
- *
- * Note (dhd): this also appears to prevent lockups on the Macintrash
- * when more than one Ethernet card is installed (knock on wood)
- *
- * Note (fthain): whether the above is still true is anyones guess. Certainly
- * the buffer handling algorithms will not tolerate re-entrance without some
- * mutual exclusion added. Anyway, the memcpy has now been eliminated from the
- * rx code to make this a faster "fast interrupt".
- */
- if (request_irq(dev->irq, &sonic_interrupt, SONIC_IRQ_FLAG, "sonic", dev)) {
- printk(KERN_ERR "\n%s: unable to get IRQ %d .\n", dev->name, dev->irq);
- return -EAGAIN;
- }
-
for (i = 0; i < SONIC_NUM_RRS; i++) {
struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2);
if (skb == NULL) {
@@ -169,8 +146,6 @@ static int sonic_close(struct net_device
}
}
- free_irq(dev->irq, dev); /* release the IRQ */
-
return 0;
}

View File

@ -1,222 +0,0 @@
Subject: [PATCH 3/13] NuBus header update
Cc: nubus-pmac-users@lists.sourceforge.net
From: Finn Thain <fthain@telegraphics.com.au>
Sync the nubus defines with the latest code in the mac68k repo. Some of these
are needed for DP8390 driver update in the next patch.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/macsonic.c | 2
include/linux/nubus.h | 126 +++++++++++++++++++++++++++++--------------------
2 files changed, 76 insertions(+), 52 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/macsonic.c
+++ linux-m68k-2.6.21/drivers/net/macsonic.c
@@ -402,7 +402,7 @@ int __init macsonic_ident(struct nubus_d
ndev->dr_sw == NUBUS_DRSW_DAYNA)
return MACSONIC_DAYNA;
- if (ndev->dr_hw == NUBUS_DRHW_SONIC_LC &&
+ if (ndev->dr_hw == NUBUS_DRHW_APPLE_SONIC_LC &&
ndev->dr_sw == 0) { /* huh? */
return MACSONIC_APPLE16;
}
--- linux-m68k-2.6.21.orig/include/linux/nubus.h
+++ linux-m68k-2.6.21/include/linux/nubus.h
@@ -28,18 +28,18 @@ enum nubus_category {
};
enum nubus_type_network {
- NUBUS_TYPE_ETHERNET = 0x0001,
- NUBUS_TYPE_RS232 = 0x0002
+ NUBUS_TYPE_ETHERNET = 0x0001,
+ NUBUS_TYPE_RS232 = 0x0002
};
enum nubus_type_display {
- NUBUS_TYPE_VIDEO = 0x0001
+ NUBUS_TYPE_VIDEO = 0x0001
};
enum nubus_type_cpu {
- NUBUS_TYPE_68020 = 0x0003,
- NUBUS_TYPE_68030 = 0x0004,
- NUBUS_TYPE_68040 = 0x0005
+ NUBUS_TYPE_68020 = 0x0003,
+ NUBUS_TYPE_68030 = 0x0004,
+ NUBUS_TYPE_68040 = 0x0005
};
/* Known <Cat,Type,SW,HW> tuples: (according to TattleTech and Slots)
@@ -56,6 +56,7 @@ enum nubus_type_cpu {
*
* SONIC comm-slot/on-board and DuoDock Ethernet: <4,1,1,272>
* SONIC LC-PDS Ethernet (Dayna, but like Apple 16-bit, sort of): <4,1,1,271>
+ * Apple SONIC LC-PDS Ethernet ("Apple Ethernet LC Twisted-Pair Card"): <4,1,0,281>
* Sonic Systems Ethernet A-Series Card: <4,1,268,256>
* Asante MacCon NuBus-A: <4,1,260,256> (alpha-1.0,1.1 revision)
* ROM on the above card: <2,1,0,0>
@@ -80,24 +81,26 @@ enum nubus_type_cpu {
/* Add known DrSW values here */
enum nubus_drsw {
/* NUBUS_CAT_DISPLAY */
- NUBUS_DRSW_APPLE = 0x0001,
- NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */
+ NUBUS_DRSW_APPLE = 0x0001,
+ NUBUS_DRSW_APPLE_HIRES = 0x0013, /* MacII HiRes card driver */
/* NUBUS_CAT_NETWORK */
- NUBUS_DRSW_CABLETRON = 0x0001,
- NUBUS_DRSW_SONIC_LC = 0x0001,
- NUBUS_DRSW_KINETICS = 0x0103,
- NUBUS_DRSW_ASANTE = 0x0104,
- NUBUS_DRSW_DAYNA = 0x010b,
- NUBUS_DRSW_FARALLON = 0x010c,
- NUBUS_DRSW_APPLE_SN = 0x010f,
- NUBUS_DRSW_DAYNA2 = 0x0115,
+ NUBUS_DRSW_3COM = 0x0000,
+ NUBUS_DRSW_CABLETRON = 0x0001,
+ NUBUS_DRSW_SONIC_LC = 0x0001,
+ NUBUS_DRSW_KINETICS = 0x0103,
+ NUBUS_DRSW_ASANTE = 0x0104,
+ NUBUS_DRSW_TECHWORKS = 0x0109,
+ NUBUS_DRSW_DAYNA = 0x010b,
+ NUBUS_DRSW_FARALLON = 0x010c,
+ NUBUS_DRSW_APPLE_SN = 0x010f,
+ NUBUS_DRSW_DAYNA2 = 0x0115,
NUBUS_DRSW_FOCUS = 0x011a,
NUBUS_DRSW_ASANTE_CS = 0x011d, /* use asante SMC9194 driver */
- NUBUS_DRSW_DAYNA_LC = 0x011e,
+ NUBUS_DRSW_DAYNA_LC = 0x011e,
/* NUBUS_CAT_CPU */
- NUBUS_DRSW_NONE = 0x0000,
+ NUBUS_DRSW_NONE = 0x0000,
};
/* DrHW: Uniquely identifies the hardware interface to a board (or at
@@ -107,27 +110,48 @@ enum nubus_drsw {
/* Add known DrHW values here */
enum nubus_drhw {
/* NUBUS_CAT_DISPLAY */
- NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */
- NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High Res Video card */
- NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */
- NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */
- NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */
- NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */
+ NUBUS_DRHW_APPLE_TFB = 0x0001, /* Toby frame buffer card */
+ NUBUS_DRHW_APPLE_WVC = 0x0006, /* Apple Workstation Video Card */
+ NUBUS_DRHW_SIGMA_CLRMAX = 0x0007, /* Sigma Design ColorMax */
+ NUBUS_DRHW_APPLE_SE30 = 0x0009, /* Apple SE/30 video */
+ NUBUS_DRHW_APPLE_HRVC = 0x0013, /* Mac II High-Res Video Card */
+ NUBUS_DRHW_APPLE_PVC = 0x0017, /* Mac II Portrait Video Card */
+ NUBUS_DRHW_APPLE_RBV1 = 0x0018, /* IIci RBV video */
+ NUBUS_DRHW_APPLE_MDC = 0x0019, /* Macintosh Display Card */
+ NUBUS_DRHW_APPLE_SONORA = 0x0022, /* Sonora built-in video */
+ NUBUS_DRHW_APPLE_24AC = 0x002b, /* Mac 24AC Video Card */
NUBUS_DRHW_APPLE_VALKYRIE = 0x002e,
- NUBUS_DRHW_THUNDER24 = 0x02cb, /* SuperMac Thunder/24 */
+ NUBUS_DRHW_APPLE_JET = 0x0029, /* Jet framebuffer (DuoDock) */
+ NUBUS_DRHW_SMAC_GFX = 0x0105, /* SuperMac GFX */
+ NUBUS_DRHW_RASTER_CB264 = 0x013B, /* RasterOps ColorBoard 264 */
+ NUBUS_DRHW_MICRON_XCEED = 0x0146, /* Micron Exceed color */
+ NUBUS_DRHW_RDIUS_GSC = 0x0153, /* Radius GS/C */
+ NUBUS_DRHW_SMAC_SPEC8 = 0x017B, /* SuperMac Spectrum/8 */
+ NUBUS_DRHW_SMAC_SPEC24 = 0x017C, /* SuperMac Spectrum/24 */
+ NUBUS_DRHW_RASTER_CB364 = 0x026F, /* RasterOps ColorBoard 364 */
+ NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
+ NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
+ NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
+ NUBUS_DRHW_RASTER_24LXI = 0x02A0, /* RasterOps 8/24 XLi */
+ NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
+ NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
+ NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
+ NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
+ NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
+ NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */
/* NUBUS_CAT_NETWORK */
- NUBUS_DRHW_INTERLAN = 0x0100,
- NUBUS_DRHW_SMC9194 = 0x0101,
- NUBUS_DRHW_KINETICS = 0x0106,
- NUBUS_DRHW_CABLETRON = 0x0109,
- NUBUS_DRHW_ASANTE_LC = 0x010f,
- NUBUS_DRHW_SONIC = 0x0110,
- NUBUS_DRHW_SONIC_NB = 0x0118,
- NUBUS_DRHW_SONIC_LC = 0x0119,
-
- /* NUBUS_CAT_COMMUNICATIONS */
- NUBUS_DRHW_DOVEFAX = 0x0100,
+ NUBUS_DRHW_INTERLAN = 0x0100,
+ NUBUS_DRHW_SMC9194 = 0x0101,
+ NUBUS_DRHW_KINETICS = 0x0106,
+ NUBUS_DRHW_CABLETRON = 0x0109,
+ NUBUS_DRHW_ASANTE_LC = 0x010f,
+ NUBUS_DRHW_SONIC = 0x0110,
+ NUBUS_DRHW_TECHWORKS = 0x0112,
+ NUBUS_DRHW_APPLE_SONIC_NB = 0x0118,
+ NUBUS_DRHW_APPLE_SONIC_LC = 0x0119,
+ NUBUS_DRHW_FOCUS = 0x011c,
+ NUBUS_DRHW_SONNET = 0x011d,
};
/* Resource IDs: These are the identifiers for the various weird and
@@ -153,17 +177,17 @@ enum nubus_res_id {
/* Category-specific resources. */
enum nubus_board_res_id {
- NUBUS_RESID_BOARDID = 0x0020,
+ NUBUS_RESID_BOARDID = 0x0020,
NUBUS_RESID_PRAMINITDATA = 0x0021,
- NUBUS_RESID_PRIMARYINIT = 0x0022,
+ NUBUS_RESID_PRIMARYINIT = 0x0022,
NUBUS_RESID_TIMEOUTCONST = 0x0023,
- NUBUS_RESID_VENDORINFO = 0x0024,
- NUBUS_RESID_BOARDFLAGS = 0x0025,
- NUBUS_RESID_SECONDINIT = 0x0026,
+ NUBUS_RESID_VENDORINFO = 0x0024,
+ NUBUS_RESID_BOARDFLAGS = 0x0025,
+ NUBUS_RESID_SECONDINIT = 0x0026,
/* Not sure why Apple put these next two in here */
- NUBUS_RESID_VIDNAMES = 0x0041,
- NUBUS_RESID_VIDMODES = 0x007e
+ NUBUS_RESID_VIDNAMES = 0x0041,
+ NUBUS_RESID_VIDMODES = 0x007e
};
/* Fields within the vendor info directory */
@@ -185,13 +209,13 @@ enum nubus_cpu_res_id {
};
enum nubus_display_res_id {
- NUBUS_RESID_GAMMADIR = 0x0040,
- NUBUS_RESID_FIRSTMODE = 0x0080,
- NUBUS_RESID_SECONDMODE = 0x0081,
- NUBUS_RESID_THIRDMODE = 0x0082,
- NUBUS_RESID_FOURTHMODE = 0x0083,
- NUBUS_RESID_FIFTHMODE = 0x0084,
- NUBUS_RESID_SIXTHMODE = 0x0085
+ NUBUS_RESID_GAMMADIR = 0x0040,
+ NUBUS_RESID_FIRSTMODE = 0x0080,
+ NUBUS_RESID_SECONDMODE = 0x0081,
+ NUBUS_RESID_THIRDMODE = 0x0082,
+ NUBUS_RESID_FOURTHMODE = 0x0083,
+ NUBUS_RESID_FIFTHMODE = 0x0084,
+ NUBUS_RESID_SIXTHMODE = 0x0085
};
struct nubus_dir
@@ -214,7 +238,7 @@ struct nubus_board {
struct nubus_board* next;
struct nubus_dev* first_dev;
- /* Only 9-E actually exist, though 0-8 are also theoretically
+ /* Only 9-E actually exist, though 0-8 are also theoretically
possible, and 0 is a special case which represents the
motherboard and onboard peripherals (Ethernet, video) */
int slot;

View File

@ -1,398 +0,0 @@
Subject: [PATCH 4/13] m68k: Mac DP8390 update
Cc: Jeff Garzik <jgarzik@pobox.com>, netdev@vger.kernel.org
From: Finn Thain <fthain@telegraphics.com.au>
Fix the support for C/NET nubus ethernet cards etc. Sync up the DP8390 driver
with the latest code in the mac68k repo.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/mac8390.c | 245 +++++++++++++++++++++++++++++++++++---------------
1 file changed, 175 insertions(+), 70 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/mac8390.c
+++ linux-m68k-2.6.21/drivers/net/mac8390.c
@@ -14,6 +14,8 @@
/* 2001-05-15: support for Cabletron ported from old daynaport driver
* and fixed access to Sonic Sys card which masquerades as a Farallon
* by rayk@knightsmanor.org */
+/* 2002-12-30: Try to support more cards, some clues from NetBSD driver */
+/* 2003-12-26: Make sure Asante cards always work. */
#include <linux/module.h>
#include <linux/kernel.h>
@@ -61,25 +63,21 @@ static char version[] =
#define DAYNA_8390_BASE 0x80000
#define DAYNA_8390_MEM 0x00000
-#define KINETICS_8390_BASE 0x80000
-#define KINETICS_8390_MEM 0x00000
-
#define CABLETRON_8390_BASE 0x90000
#define CABLETRON_8390_MEM 0x00000
+#define INTERLAN_8390_BASE 0xE0000
+#define INTERLAN_8390_MEM 0xD0000
+
enum mac8390_type {
MAC8390_NONE = -1,
MAC8390_APPLE,
MAC8390_ASANTE,
- MAC8390_FARALLON, /* Apple, Asante, and Farallon are all compatible */
+ MAC8390_FARALLON,
MAC8390_CABLETRON,
MAC8390_DAYNA,
MAC8390_INTERLAN,
MAC8390_KINETICS,
- MAC8390_FOCUS,
- MAC8390_SONICSYS,
- MAC8390_DAYNA2,
- MAC8390_DAYNA3,
};
static const char * cardname[] = {
@@ -90,10 +88,6 @@ static const char * cardname[] = {
"dayna",
"interlan",
"kinetics",
- "focus",
- "sonic systems",
- "dayna2",
- "dayna_lc",
};
static int word16[] = {
@@ -104,10 +98,6 @@ static int word16[] = {
0, /* dayna */
1, /* interlan */
0, /* kinetics */
- 1, /* focus (??) */
- 1, /* sonic systems */
- 1, /* dayna2 */
- 1, /* dayna-lc */
};
/* on which cards do we use NuBus resources? */
@@ -119,10 +109,12 @@ static int useresources[] = {
0, /* dayna */
0, /* interlan */
0, /* kinetics */
- 0, /* focus (??) */
- 1, /* sonic systems */
- 1, /* dayna2 */
- 1, /* dayna-lc */
+};
+
+enum mac8390_access {
+ ACCESS_UNKNOWN = 0,
+ ACCESS_32,
+ ACCESS_16,
};
extern enum mac8390_type mac8390_ident(struct nubus_dev * dev);
@@ -134,8 +126,9 @@ static int mac8390_initdev(struct net_de
static int mac8390_open(struct net_device * dev);
static int mac8390_close(struct net_device * dev);
static void mac8390_no_reset(struct net_device *dev);
+static void interlan_reset(struct net_device *dev);
-/* Sane (32-bit chunk memory read/write) - Apple/Asante/Farallon do this*/
+/* Sane (32-bit chunk memory read/write) - Some Farallon and Apple do this*/
static void sane_get_8390_hdr(struct net_device *dev,
struct e8390_pkt_hdr *hdr, int ring_page);
static void sane_block_input(struct net_device * dev, int count,
@@ -172,23 +165,93 @@ static void word_memcpy_fromcard(void *t
enum mac8390_type __init mac8390_ident(struct nubus_dev * dev)
{
- if (dev->dr_sw == NUBUS_DRSW_ASANTE)
- return MAC8390_ASANTE;
- if (dev->dr_sw == NUBUS_DRSW_FARALLON)
- return MAC8390_FARALLON;
- if (dev->dr_sw == NUBUS_DRSW_KINETICS)
- return MAC8390_KINETICS;
- if (dev->dr_sw == NUBUS_DRSW_DAYNA)
- return MAC8390_DAYNA;
- if (dev->dr_sw == NUBUS_DRSW_DAYNA2)
- return MAC8390_DAYNA2;
- if (dev->dr_sw == NUBUS_DRSW_DAYNA_LC)
- return MAC8390_DAYNA3;
- if (dev->dr_hw == NUBUS_DRHW_CABLETRON)
- return MAC8390_CABLETRON;
+ switch (dev->dr_sw) {
+ case NUBUS_DRSW_3COM:
+ switch (dev->dr_hw) {
+ case NUBUS_DRHW_APPLE_SONIC_NB:
+ case NUBUS_DRHW_APPLE_SONIC_LC:
+ case NUBUS_DRHW_SONNET:
+ return MAC8390_NONE;
+ break;
+ default:
+ return MAC8390_APPLE;
+ break;
+ }
+ break;
+
+ case NUBUS_DRSW_APPLE:
+ switch (dev->dr_hw) {
+ case NUBUS_DRHW_ASANTE_LC:
+ return MAC8390_NONE;
+ break;
+ case NUBUS_DRHW_CABLETRON:
+ return MAC8390_CABLETRON;
+ break;
+ default:
+ return MAC8390_APPLE;
+ break;
+ }
+ break;
+
+ case NUBUS_DRSW_ASANTE:
+ return MAC8390_ASANTE;
+ break;
+
+ case NUBUS_DRSW_TECHWORKS:
+ case NUBUS_DRSW_DAYNA2:
+ case NUBUS_DRSW_DAYNA_LC:
+ if (dev->dr_hw == NUBUS_DRHW_CABLETRON)
+ return MAC8390_CABLETRON;
+ else
+ return MAC8390_APPLE;
+ break;
+
+ case NUBUS_DRSW_FARALLON:
+ return MAC8390_FARALLON;
+ break;
+
+ case NUBUS_DRSW_KINETICS:
+ switch (dev->dr_hw) {
+ case NUBUS_DRHW_INTERLAN:
+ return MAC8390_INTERLAN;
+ break;
+ default:
+ return MAC8390_KINETICS;
+ break;
+ }
+ break;
+
+ case NUBUS_DRSW_DAYNA:
+ // These correspond to Dayna Sonic cards
+ // which use the macsonic driver
+ if (dev->dr_hw == NUBUS_DRHW_SMC9194 ||
+ dev->dr_hw == NUBUS_DRHW_INTERLAN )
+ return MAC8390_NONE;
+ else
+ return MAC8390_DAYNA;
+ break;
+ }
return MAC8390_NONE;
}
+enum mac8390_access __init mac8390_testio(volatile unsigned long membase)
+{
+ unsigned long outdata = 0xA5A0B5B0;
+ unsigned long indata = 0x00000000;
+ /* Try writing 32 bits */
+ memcpy((char *)membase, (char *)&outdata, 4);
+ /* Now compare them */
+ if (memcmp((char *)&outdata, (char *)membase, 4) == 0)
+ return ACCESS_32;
+ /* Write 16 bit output */
+ word_memcpy_tocard((char *)membase, (char *)&outdata, 4);
+ /* Now read it back */
+ word_memcpy_fromcard((char *)&indata, (char *)membase, 4);
+ if (outdata == indata)
+ return ACCESS_16;
+ return ACCESS_UNKNOWN;
+}
+
int __init mac8390_memsize(unsigned long membase)
{
unsigned long flags;
@@ -287,14 +350,6 @@ struct net_device * __init mac8390_probe
continue;
} else {
nubus_get_rsrc_mem(dev->dev_addr, &ent, 6);
- /* Some Sonic Sys cards masquerade as Farallon */
- if (cardtype == MAC8390_FARALLON &&
- dev->dev_addr[0] == 0x0 &&
- dev->dev_addr[1] == 0x40 &&
- dev->dev_addr[2] == 0x10) {
- /* This is really Sonic Sys card */
- cardtype = MAC8390_SONICSYS;
- }
}
if (useresources[cardtype] == 1) {
@@ -334,6 +389,17 @@ struct net_device * __init mac8390_probe
dev->mem_start +
mac8390_memsize(dev->mem_start);
break;
+ case MAC8390_INTERLAN:
+ dev->base_addr =
+ (int)(ndev->board->slot_addr +
+ INTERLAN_8390_BASE);
+ dev->mem_start =
+ (int)(ndev->board->slot_addr +
+ INTERLAN_8390_MEM);
+ dev->mem_end =
+ dev->mem_start +
+ mac8390_memsize(dev->mem_start);
+ break;
case MAC8390_CABLETRON:
dev->base_addr =
(int)(ndev->board->slot_addr +
@@ -356,8 +422,8 @@ struct net_device * __init mac8390_probe
default:
printk(KERN_ERR "Card type %s is"
- " unsupported, sorry\n",
- cardname[cardtype]);
+ " unsupported, sorry\n",
+ ndev->board->name);
continue;
}
}
@@ -438,7 +504,7 @@ static int __init mac8390_initdev(struct
24, 26, 28, 30
};
- int access_bitmode;
+ int access_bitmode = 0;
/* Now fill in our stuff */
dev->open = &mac8390_open;
@@ -468,29 +534,47 @@ static int __init mac8390_initdev(struct
/* Fill in model-specific information and functions */
switch(type) {
- case MAC8390_SONICSYS:
- /* 16 bit card, register map is reversed */
- ei_status.reset_8390 = &mac8390_no_reset;
- ei_status.block_input = &slow_sane_block_input;
- ei_status.block_output = &slow_sane_block_output;
- ei_status.get_8390_hdr = &slow_sane_get_8390_hdr;
- ei_status.reg_offset = back4_offsets;
- access_bitmode = 0;
- break;
case MAC8390_FARALLON:
case MAC8390_APPLE:
+ switch(mac8390_testio(dev->mem_start)) {
+ case ACCESS_UNKNOWN:
+ printk("Don't know how to access card memory!\n");
+ return -ENODEV;
+ break;
+
+ case ACCESS_16:
+ /* 16 bit card, register map is reversed */
+ ei_status.reset_8390 = &mac8390_no_reset;
+ ei_status.block_input = &slow_sane_block_input;
+ ei_status.block_output = &slow_sane_block_output;
+ ei_status.get_8390_hdr = &slow_sane_get_8390_hdr;
+ ei_status.reg_offset = back4_offsets;
+ break;
+
+ case ACCESS_32:
+ /* 32 bit card, register map is reversed */
+ ei_status.reset_8390 = &mac8390_no_reset;
+ ei_status.block_input = &sane_block_input;
+ ei_status.block_output = &sane_block_output;
+ ei_status.get_8390_hdr = &sane_get_8390_hdr;
+ ei_status.reg_offset = back4_offsets;
+ access_bitmode = 1;
+ break;
+ }
+ break;
+
case MAC8390_ASANTE:
- case MAC8390_DAYNA2:
- case MAC8390_DAYNA3:
- /* 32 bit card, register map is reversed */
- /* sane */
+ /* Some Asante cards pass the 32 bit test
+ * but overwrite system memory when run at 32 bit.
+ * so we run them all at 16 bit.
+ */
ei_status.reset_8390 = &mac8390_no_reset;
- ei_status.block_input = &sane_block_input;
- ei_status.block_output = &sane_block_output;
- ei_status.get_8390_hdr = &sane_get_8390_hdr;
+ ei_status.block_input = &slow_sane_block_input;
+ ei_status.block_output = &slow_sane_block_output;
+ ei_status.get_8390_hdr = &slow_sane_get_8390_hdr;
ei_status.reg_offset = back4_offsets;
- access_bitmode = 1;
break;
+
case MAC8390_CABLETRON:
/* 16 bit card, register map is short forward */
ei_status.reset_8390 = &mac8390_no_reset;
@@ -498,21 +582,30 @@ static int __init mac8390_initdev(struct
ei_status.block_output = &slow_sane_block_output;
ei_status.get_8390_hdr = &slow_sane_get_8390_hdr;
ei_status.reg_offset = fwrd2_offsets;
- access_bitmode = 0;
break;
+
case MAC8390_DAYNA:
case MAC8390_KINETICS:
- /* 16 bit memory */
+ /* 16 bit memory, register map is forward */
/* dayna and similar */
ei_status.reset_8390 = &mac8390_no_reset;
ei_status.block_input = &dayna_block_input;
ei_status.block_output = &dayna_block_output;
ei_status.get_8390_hdr = &dayna_get_8390_hdr;
ei_status.reg_offset = fwrd4_offsets;
- access_bitmode = 0;
break;
+
+ case MAC8390_INTERLAN:
+ /* 16 bit memory, register map is forward */
+ ei_status.reset_8390 = &interlan_reset;
+ ei_status.block_input = &slow_sane_block_input;
+ ei_status.block_output = &slow_sane_block_output;
+ ei_status.get_8390_hdr = &slow_sane_get_8390_hdr;
+ ei_status.reg_offset = fwrd4_offsets;
+ break;
+
default:
- printk(KERN_ERR "Card type %s is unsupported, sorry\n", cardname[type]);
+ printk(KERN_ERR "Card type %s is unsupported, sorry\n", ndev->board->name);
return -ENODEV;
}
@@ -530,9 +623,9 @@ static int __init mac8390_initdev(struct
printk(":");
}
}
- printk(" IRQ %d, shared memory at %#lx-%#lx, %d-bit access.\n",
- dev->irq, dev->mem_start, dev->mem_end-1,
- access_bitmode?32:16);
+ printk(" IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n",
+ dev->irq, (int)((dev->mem_end - dev->mem_start)/0x1000) * 4,
+ dev->mem_start, access_bitmode?32:16);
return 0;
}
@@ -561,6 +654,18 @@ static void mac8390_no_reset(struct net_
return;
}
+static void interlan_reset(struct net_device *dev)
+{
+ unsigned char *target=nubus_slot_addr(IRQ2SLOT(dev->irq));
+ if (ei_debug > 1)
+ printk("Need to reset the NS8390 t=%lu...", jiffies);
+ ei_status.txing = 0;
+ target[0xC0000] = 0;
+ if (ei_debug > 1)
+ printk("reset complete\n");
+ return;
+}
+
/* dayna_memcpy_fromio/dayna_memcpy_toio */
/* directly from daynaport.c by Alan Cox */
static void dayna_memcpy_fromcard(struct net_device *dev, void *to, int from, int count)

View File

@ -1,30 +0,0 @@
Subject: [PATCH 2/13] m68k: Mac interrupt priorities
From: Finn Thain <fthain@telegraphics.com.au>
Add some more machines that support A/UX interrupt priorities. There are
probably others as well, but I've only tested these ones so far.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mac/via.c | 6 ++++++
1 file changed, 6 insertions(+)
--- linux-m68k-2.6.21.orig/arch/m68k/mac/via.c
+++ linux-m68k-2.6.21/arch/m68k/mac/via.c
@@ -193,8 +193,14 @@ void __init via_init(void)
/* that the IIfx emulates this alternate mapping using the OSS. */
switch(macintosh_config->ident) {
+ case MAC_MODEL_P475:
+ case MAC_MODEL_P475F:
+ case MAC_MODEL_P575:
+ case MAC_MODEL_Q605:
+ case MAC_MODEL_Q605_ACC:
case MAC_MODEL_C610:
case MAC_MODEL_Q610:
+ case MAC_MODEL_Q630:
case MAC_MODEL_C650:
case MAC_MODEL_Q650:
case MAC_MODEL_Q700:

View File

@ -1,92 +0,0 @@
Subject: [PATCH 1/13] m68k: remove unused adb.h
From: Finn Thain <fthain@telegraphics.com.au>
The asm-m68k/adb.h header is unused. Some definitions are wrong and the rest
are duplicated in linux/adb.h. Remove it.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
include/asm-m68k/adb.h | 75 -------------------------------------------------
1 file changed, 75 deletions(-)
--- linux-m68k-2.6.21.orig/include/asm-m68k/adb.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Definitions for talking to ADB and CUDA. The CUDA is a microcontroller
- * which controls the ADB, system power, RTC, and various other things on
- * later Macintoshes
- *
- * Copyright (C) 1996 Paul Mackerras.
- */
-
-/* First byte sent to or received from CUDA */
-#define ADB_PACKET 0
-#define CUDA_PACKET 1
-#define ERROR_PACKET 2
-#define TIMER_PACKET 3
-#define POWER_PACKET 4
-#define MACIIC_PACKET 5
-
-/* ADB commands (2nd byte) */
-#define ADB_BUSRESET 0
-#define ADB_FLUSH(id) (1 + ((id) << 4))
-#define ADB_WRITEREG(id, reg) (8 + (reg) + ((id) << 4))
-#define ADB_READREG(id, reg) (0xc + (reg) + ((id) << 4))
-
-/* ADB default device IDs (upper 4 bits of 2nd byte) */
-#define ADB_DONGLE 1 /* "software execution control" devices */
-#define ADB_KEYBOARD 2
-#define ADB_MOUSE 3
-#define ADB_TABLET 4
-#define ADB_MODEM 5
-#define ADB_MISC 7 /* maybe a monitor */
-
-/* CUDA commands (2nd byte) */
-#define CUDA_WARM_START 0
-#define CUDA_AUTOPOLL 1
-#define CUDA_GET_6805_ADDR 2
-#define CUDA_GET_TIME 3
-#define CUDA_GET_PRAM 7
-#define CUDA_SET_6805_ADDR 8
-#define CUDA_SET_TIME 9
-#define CUDA_POWERDOWN 0xa
-#define CUDA_POWERUP_TIME 0xb
-#define CUDA_SET_PRAM 0xc
-#define CUDA_MS_RESET 0xd
-#define CUDA_SEND_DFAC 0xe
-#define CUDA_RESET_SYSTEM 0x11
-#define CUDA_SET_IPL 0x12
-#define CUDA_SET_AUTO_RATE 0x14
-#define CUDA_GET_AUTO_RATE 0x16
-#define CUDA_SET_DEVICE_LIST 0x19
-#define CUDA_GET_DEVICE_LIST 0x1a
-#define CUDA_GET_SET_IIC 0x22
-
-#ifdef __KERNEL__
-
-struct adb_request {
- unsigned char data[16];
- int nbytes;
- unsigned char reply[16];
- int reply_len;
- unsigned char reply_expected;
- unsigned char sent;
- unsigned char got_reply;
- void (*done)(struct adb_request *);
- void *arg;
- struct adb_request *next;
-};
-
-void via_adb_init(void);
-int adb_request(struct adb_request *req,
- void (*done)(struct adb_request *), int nbytes, ...);
-int adb_send_request(struct adb_request *req);
-void adb_poll(void);
-int adb_register(int default_id,
- void (*handler)(unsigned char *, int, struct pt_regs *));
-
-#endif /* __KERNEL */

View File

@ -1,80 +0,0 @@
Subject: [PATCH 5/13] m68k: reverse Mac IRQ damage
From: Finn Thain <fthain@telegraphics.com.au>
Reverse the last of a monumental brown-paper-bag commit that went into the 2.3
kernel.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mac/baboon.c | 2 +-
arch/m68k/mac/oss.c | 6 +++---
arch/m68k/mac/psc.c | 2 +-
arch/m68k/mac/via.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/mac/baboon.c
+++ linux-m68k-2.6.21/arch/m68k/mac/baboon.c
@@ -81,9 +81,9 @@ irqreturn_t baboon_irq(int irq, void *de
for (i = 0, irq_bit = 1 ; i < 3 ; i++, irq_bit <<= 1) {
if (events & irq_bit/* & baboon_active*/) {
baboon_active &= ~irq_bit;
+ baboon->mb_ifr &= ~irq_bit;
m68k_handle_int(IRQ_BABOON_0 + i);
baboon_active |= irq_bit;
- baboon->mb_ifr &= ~irq_bit;
}
}
#if 0
--- linux-m68k-2.6.21.orig/arch/m68k/mac/oss.c
+++ linux-m68k-2.6.21/arch/m68k/mac/oss.c
@@ -109,12 +109,12 @@ irqreturn_t oss_irq(int irq, void *dev_i
/* FIXME: how do you clear a pending IRQ? */
if (events & OSS_IP_SOUND) {
- /* FIXME: call sound handler */
oss->irq_pending &= ~OSS_IP_SOUND;
+ /* FIXME: call sound handler */
} else if (events & OSS_IP_SCSI) {
oss->irq_level[OSS_SCSI] = OSS_IRQLEV_DISABLED;
- m68k_handle_int(IRQ_MAC_SCSI);
oss->irq_pending &= ~OSS_IP_SCSI;
+ m68k_handle_int(IRQ_MAC_SCSI);
oss->irq_level[OSS_SCSI] = OSS_IRQLEV_SCSI;
} else {
/* FIXME: error check here? */
@@ -146,8 +146,8 @@ irqreturn_t oss_nubus_irq(int irq, void
for (i = 0, irq_bit = 1 ; i < 6 ; i++, irq_bit <<= 1) {
if (events & irq_bit) {
oss->irq_level[i] = OSS_IRQLEV_DISABLED;
- m68k_handle_int(NUBUS_SOURCE_BASE + i);
oss->irq_pending &= ~irq_bit;
+ m68k_handle_int(NUBUS_SOURCE_BASE + i);
oss->irq_level[i] = OSS_IRQLEV_NUBUS;
}
}
--- linux-m68k-2.6.21.orig/arch/m68k/mac/psc.c
+++ linux-m68k-2.6.21/arch/m68k/mac/psc.c
@@ -149,8 +149,8 @@ irqreturn_t psc_irq(int irq, void *dev_i
for (i = 0, irq_bit = 1 ; i < 4 ; i++, irq_bit <<= 1) {
if (events & irq_bit) {
psc_write_byte(pIER, irq_bit);
- m68k_handle_int(base_irq + i);
psc_write_byte(pIFR, irq_bit);
+ m68k_handle_int(base_irq + i);
psc_write_byte(pIER, irq_bit | 0x80);
}
}
--- linux-m68k-2.6.21.orig/arch/m68k/mac/via.c
+++ linux-m68k-2.6.21/arch/m68k/mac/via.c
@@ -430,8 +430,8 @@ irqreturn_t via1_irq(int irq, void *dev_
for (i = 0, irq_bit = 1 ; i < 7 ; i++, irq_bit <<= 1)
if (events & irq_bit) {
via1[vIER] = irq_bit;
- m68k_handle_int(VIA1_SOURCE_BASE + i);
via1[vIFR] = irq_bit;
+ m68k_handle_int(VIA1_SOURCE_BASE + i);
via1[vIER] = irq_bit | 0x80;
}

View File

@ -1,106 +0,0 @@
Subject: [PATCH 12/13] SONIC: small fix and cleanup
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Jeff Garzik <jgarzik@pobox.com>, netdev@vger.kernel.org,
linux-mips@linux-mips.org
From: Finn Thain <fthain@telegraphics.com.au>
Fix a potential problem in the timeout handling: don't free the DMA buffers
before resetting the chip.
Also a trivial cleanup. Bring macsonic and jazzsonic into sync.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/jazzsonic.c | 4 ++--
drivers/net/macsonic.c | 17 ++++++++---------
drivers/net/sonic.c | 7 ++++++-
3 files changed, 16 insertions(+), 12 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/net/jazzsonic.c
+++ linux-m68k-2.6.21/drivers/net/jazzsonic.c
@@ -269,11 +269,11 @@ static int __devexit jazz_sonic_device_r
struct net_device *dev = platform_get_drvdata(pdev);
struct sonic_local* lp = netdev_priv(dev);
- unregister_netdev (dev);
+ unregister_netdev(dev);
dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
lp->descriptors, lp->descriptors_laddr);
release_region (dev->base_addr, SONIC_MEM_SIZE);
- free_netdev (dev);
+ free_netdev(dev);
return 0;
}
--- linux-m68k-2.6.21.orig/drivers/net/macsonic.c
+++ linux-m68k-2.6.21/drivers/net/macsonic.c
@@ -522,7 +522,7 @@ int __init mac_nubus_sonic_probe(struct
return macsonic_init(dev);
}
-static int __init mac_sonic_probe(struct platform_device *device)
+static int __init mac_sonic_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct sonic_local *lp;
@@ -534,8 +534,8 @@ static int __init mac_sonic_probe(struct
return -ENOMEM;
lp = netdev_priv(dev);
- lp->device = &device->dev;
- SET_NETDEV_DEV(dev, &device->dev);
+ lp->device = &pdev->dev;
+ SET_NETDEV_DEV(dev, &pdev->dev);
SET_MODULE_OWNER(dev);
/* This will catch fatal stuff like -ENOMEM as well as success */
@@ -576,15 +576,15 @@ MODULE_PARM_DESC(sonic_debug, "macsonic
#include "sonic.c"
-static int __devexit mac_sonic_device_remove (struct platform_device *device)
+static int __devexit mac_sonic_device_remove (struct platform_device *pdev)
{
- struct net_device *dev = platform_get_drvdata(device);
+ struct net_device *dev = platform_get_drvdata(pdev);
struct sonic_local* lp = netdev_priv(dev);
- unregister_netdev (dev);
+ unregister_netdev(dev);
dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
lp->descriptors, lp->descriptors_laddr);
- free_netdev (dev);
+ free_netdev(dev);
return 0;
}
@@ -607,9 +607,8 @@ static int __init mac_sonic_init_module(
}
mac_sonic_device = platform_device_alloc(mac_sonic_string, 0);
- if (!mac_sonic_device) {
+ if (!mac_sonic_device)
goto out_unregister;
- }
if (platform_device_add(mac_sonic_device)) {
platform_device_put(mac_sonic_device);
--- linux-m68k-2.6.21.orig/drivers/net/sonic.c
+++ linux-m68k-2.6.21/drivers/net/sonic.c
@@ -179,8 +179,13 @@ static void sonic_tx_timeout(struct net_
{
struct sonic_local *lp = netdev_priv(dev);
int i;
- /* Stop the interrupts for this */
+ /*
+ * put the Sonic into software-reset mode and
+ * disable all interrupts before releasing DMA buffers
+ */
SONIC_WRITE(SONIC_IMR, 0);
+ SONIC_WRITE(SONIC_ISR, 0x7fff);
+ SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
/* We could resend the original skbs. Easier to re-initialise. */
for (i = 0; i < SONIC_NUM_TDS; i++) {
if(lp->tx_laddr[i]) {

View File

@ -1,19 +0,0 @@
Subject: [PATCH] m68k: ARAnyM virtual Ethernet missing include
Add missing #include <asm/virtconvert.h> (needed for virt_to_phys())
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/emu/nfeth.c | 1 +
1 file changed, 1 insertion(+)
--- linux-m68k-2.6.21.orig/arch/m68k/emu/nfeth.c
+++ linux-m68k-2.6.21/arch/m68k/emu/nfeth.c
@@ -14,6 +14,7 @@
#include <linux/module.h>
#include <net/ieee80211.h>
#include <asm/natfeat.h>
+#include <asm/virtconvert.h>
enum {
GET_VERSION = 0, /* no parameters, return NFAPI_VERSION in d0 */

View File

@ -1,32 +0,0 @@
Subject: m68k: pmu_queue_request() declaration conflict
From: Finn Thain <fthain@telegraphics.com.au>
Fixes a "static qualifier follows non-static qualifier" error from gcc 4.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/macintosh/via-pmu68k.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/macintosh/via-pmu68k.c
+++ linux-m68k-2.6.21/drivers/macintosh/via-pmu68k.c
@@ -111,7 +111,6 @@ static int pmu_send_request(struct adb_r
static int pmu_autopoll(int devs);
void pmu_poll(void);
static int pmu_reset_bus(void);
-static int pmu_queue_request(struct adb_request *req);
static void pmu_start(void);
static void send_byte(int x);
@@ -475,7 +474,7 @@ pmu_request(struct adb_request *req, voi
return pmu_queue_request(req);
}
-static int
+int
pmu_queue_request(struct adb_request *req)
{
unsigned long flags;

View File

@ -1,709 +0,0 @@
Subject: [PATCH] m68k: split amiga7xx.c into a4000t.c and zorro7xx.c
Split drivers/scsi/amiga7xx.c into drivers/scsi/a4000t.c (A4000T built-in)
and drivers/scsi/zorro7xx.c (Zorro boards)
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/Kconfig | 25 ++--
drivers/scsi/Makefile | 3
drivers/scsi/a4000t.c | 144 +++++++++++++++++++++++
drivers/scsi/amiga7xx.c | 297 ------------------------------------------------
drivers/scsi/zorro7xx.c | 181 +++++++++++++++++++++++++++++
5 files changed, 343 insertions(+), 307 deletions(-)
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1008,7 +1008,7 @@ config SCSI_STEX
config 53C700_BE_BUS
bool
- depends on SCSI_AMIGA7XX || MVME16x_SCSI || BVME6000_SCSI
+ depends on SCSI_A4000T || SCSI_ZORRO7XX || MVME16x_SCSI || BVME6000_SCSI
default y
config SCSI_SYM53C8XX_2
@@ -1615,14 +1615,25 @@ config FASTLANE_SCSI
If you have the Phase5 Fastlane Z3 SCSI controller, or plan to use
one in the near future, say Y to this question. Otherwise, say N.
-config SCSI_AMIGA7XX
- tristate "Amiga NCR53c710 SCSI support (EXPERIMENTAL)"
+config SCSI_A4000T
+ tristate "A4000T NCR53c710 SCSI support (EXPERIMENTAL)"
depends on AMIGA && SCSI && EXPERIMENTAL
select SCSI_SPI_ATTRS
help
- Support for various NCR53c710-based SCSI controllers on the Amiga.
+ If you have an Amiga 4000T and have SCSI devices connected to the
+ built-in SCSI controller, say Y. Otherwise, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called a4000t.
+
+config SCSI_ZORRO7XX
+ tristate "Zorro NCR53c710 SCSI support (EXPERIMENTAL)"
+ depends on ZORRO && SCSI && EXPERIMENTAL
+ select SCSI_SPI_ATTRS
+ help
+ Support for various NCR53c710-based SCSI controllers on Zorro
+ expansion boards for the Amiga.
This includes:
- - the builtin SCSI controller on the Amiga 4000T,
- the Amiga 4091 Zorro III SCSI-2 controller,
- the MacroSystem Development's WarpEngine Amiga SCSI-2 controller
(info at
@@ -1630,10 +1641,6 @@ config SCSI_AMIGA7XX
- the SCSI controller on the Phase5 Blizzard PowerUP 603e+
accelerator card for the Amiga 1200,
- the SCSI controller on the GVP Turbo 040/060 accelerator.
- Note that all of the above SCSI controllers, except for the builtin
- SCSI controller on the Amiga 4000T, reside on the Zorro expansion
- bus, so you also have to enable Zorro bus support if you want to use
- them.
config OKTAGON_SCSI
tristate "BSC Oktagon SCSI support (EXPERIMENTAL)"
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -37,7 +37,8 @@ obj-$(CONFIG_SCSI_SAS_LIBSAS) += libsas/
obj-$(CONFIG_ISCSI_TCP) += libiscsi.o iscsi_tcp.o
obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o
-obj-$(CONFIG_SCSI_AMIGA7XX) += 53c700.o amiga7xx.o
+obj-$(CONFIG_SCSI_A4000T) += 53c700.o a4000t.o
+obj-$(CONFIG_SCSI_ZORRO7XX) += 53c700.o zorro7xx.o
obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o
obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o
obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o
--- /dev/null
+++ b/drivers/scsi/a4000t.c
@@ -0,0 +1,144 @@
+/*
+ * Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux.
+ * Amiga Technologies A4000T SCSI controller.
+ *
+ * Written 1997 by Alan Hourihane <alanh@fairlite.demon.co.uk>
+ * plus modifications of the 53c7xx.c driver to support the Amiga.
+ *
+ * Rewritten to use 53c700.c by Kars de Jong <jongk@linux-m68k.org>
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/amigahw.h>
+#include <asm/amigaints.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_transport_spi.h>
+
+#include "53c700.h"
+
+MODULE_AUTHOR("Alan Hourihane <alanh@fairlite.demon.co.uk> / Kars de Jong <jongk@linux-m68k.org>");
+MODULE_DESCRIPTION("Amiga A4000T NCR53C710 driver");
+MODULE_LICENSE("GPL");
+
+
+static struct scsi_host_template a4000t_scsi_driver_template = {
+ .name = "A4000T builtin SCSI",
+ .proc_name = "A4000t",
+ .this_id = 7,
+ .module = THIS_MODULE,
+};
+
+static struct platform_device *a4000t_scsi_device;
+
+#define A4000T_SCSI_ADDR 0xdd0040
+
+static int __devinit a4000t_probe(struct device *dev)
+{
+ struct Scsi_Host * host = NULL;
+ struct NCR_700_Host_Parameters *hostdata;
+
+ if (!(MACH_IS_AMIGA && AMIGAHW_PRESENT(A4000_SCSI)))
+ goto out;
+
+ if (!request_mem_region(A4000T_SCSI_ADDR, 0x1000,
+ "A4000T builtin SCSI"))
+ goto out;
+
+ hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
+ if (hostdata == NULL) {
+ printk(KERN_ERR "a4000t-scsi: Failed to allocate host data\n");
+ goto out_release;
+ }
+ memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
+
+ /* Fill in the required pieces of hostdata */
+ hostdata->base = (void __iomem *)ZTWO_VADDR(A4000T_SCSI_ADDR);
+ hostdata->clock = 50;
+ hostdata->chip710 = 1;
+ hostdata->dmode_extra = DMODE_FC2;
+ hostdata->dcntl_extra = EA_710;
+
+ /* and register the chip */
+ host = NCR_700_detect(&a4000t_scsi_driver_template, hostdata, dev);
+ if (!host) {
+ printk(KERN_ERR "a4000t-scsi: No host detected; "
+ "board configuration problem?\n");
+ goto out_free;
+ }
+
+ host->this_id = 7;
+ host->base = A4000T_SCSI_ADDR;
+ host->irq = IRQ_AMIGA_PORTS;
+
+ if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "a4000t-scsi",
+ host)) {
+ printk(KERN_ERR "a4000t-scsi: request_irq failed\n");
+ goto out_put_host;
+ }
+
+ scsi_scan_host(host);
+
+ return 0;
+
+ out_put_host:
+ scsi_host_put(host);
+ out_free:
+ kfree(hostdata);
+ out_release:
+ release_mem_region(A4000T_SCSI_ADDR, 0x1000);
+ out:
+ return -ENODEV;
+}
+
+static __devexit int a4000t_device_remove(struct device *dev)
+{
+ struct Scsi_Host *host = dev_to_shost(dev);
+ struct NCR_700_Host_Parameters *hostdata =
+ (struct NCR_700_Host_Parameters *)host->hostdata[0];
+
+ scsi_remove_host(host);
+
+ NCR_700_release(host);
+ kfree(hostdata);
+ free_irq(host->irq, host);
+ release_mem_region(A4000T_SCSI_ADDR, 0x1000);
+
+ return 0;
+}
+
+static struct device_driver a4000t_scsi_driver = {
+ .name = "a4000t-scsi",
+ .bus = &platform_bus_type,
+ .probe = a4000t_probe,
+ .remove = __devexit_p(a4000t_device_remove),
+};
+
+static int __init a4000t_scsi_init(void)
+{
+ int err;
+
+ err = driver_register(&a4000t_scsi_driver);
+ if (err)
+ return err;
+
+ a4000t_scsi_device = platform_device_register_simple("a4000t-scsi",
+ -1, NULL, 0);
+ if (IS_ERR(a4000t_scsi_device)) {
+ driver_unregister(&a4000t_scsi_driver);
+ return PTR_ERR(a4000t_scsi_device);
+ }
+
+ return err;
+}
+
+static void __exit a4000t_scsi_exit(void)
+{
+ platform_device_unregister(a4000t_scsi_device);
+ driver_unregister(&a4000t_scsi_driver);
+}
+
+module_init(a4000t_scsi_init);
+module_exit(a4000t_scsi_exit);
--- a/drivers/scsi/amiga7xx.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux.
- * Amiga MacroSystemUS WarpEngine SCSI controller.
- * Amiga Technologies A4000T SCSI controller.
- * Amiga Technologies/DKB A4091 SCSI controller.
- *
- * Written 1997 by Alan Hourihane <alanh@fairlite.demon.co.uk>
- * plus modifications of the 53c7xx.c driver to support the Amiga.
- *
- * Rewritten to use 53c700.c by Kars de Jong <jongk@linux-m68k.org>
- */
-
-#include <linux/module.h>
-#include <linux/blkdev.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/zorro.h>
-#include <asm/amigahw.h>
-#include <asm/amigaints.h>
-#include <scsi/scsi_host.h>
-#include <scsi/scsi_device.h>
-#include <scsi/scsi_transport.h>
-#include <scsi/scsi_transport_spi.h>
-
-#include "53c700.h"
-
-MODULE_AUTHOR("Alan Hourihane <alanh@fairlite.demon.co.uk> / Kars de Jong <jongk@linux-m68k.org>");
-MODULE_DESCRIPTION("Amiga NCR53C710 driver");
-MODULE_LICENSE("GPL");
-
-static struct scsi_host_template amiga7xx_scsi_driver_template = {
- .name = "A4000T builtin SCSI",
- .proc_name = "Amiga7xx",
- .this_id = 7,
- .module = THIS_MODULE,
-};
-
-static struct platform_device *a4000t_scsi_device;
-
-#ifdef CONFIG_ZORRO
-
-static struct zorro_driver_data {
- const char *name;
- unsigned long offset;
- int absolute; /* offset is absolute address */
-} amiga7xx_driver_data[] __devinitdata = {
- { .name = "PowerUP 603e+", .offset = 0xf40000, .absolute = 1 },
- { .name = "WarpEngine 40xx", .offset = 0x40000 },
- { .name = "A4091", .offset = 0x800000 },
- { .name = "GForce 040/060", .offset = 0x40000 },
- { 0 }
-};
-
-static struct zorro_device_id amiga7xx_zorro_tbl[] __devinitdata = {
- {
- .id = ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS,
- .driver_data = (unsigned long)&amiga7xx_driver_data[0],
- },
- {
- .id = ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx,
- .driver_data = (unsigned long)&amiga7xx_driver_data[1],
- },
- {
- .id = ZORRO_PROD_CBM_A4091_1,
- .driver_data = (unsigned long)&amiga7xx_driver_data[2],
- },
- {
- .id = ZORRO_PROD_CBM_A4091_2,
- .driver_data = (unsigned long)&amiga7xx_driver_data[2],
- },
- {
- .id = ZORRO_PROD_GVP_GFORCE_040_060,
- .driver_data = (unsigned long)&amiga7xx_driver_data[3],
- },
- { 0 }
-};
-
-static int __devinit amiga7xx_init_one(struct zorro_dev *z,
- const struct zorro_device_id *ent)
-{
- struct Scsi_Host * host = NULL;
- struct NCR_700_Host_Parameters *hostdata;
- struct zorro_driver_data *zdd;
- unsigned long board, ioaddr;
-
- board = zorro_resource_start(z);
- zdd = (struct zorro_driver_data *)ent->driver_data;
-
- if (zdd->absolute) {
- ioaddr = zdd->offset;
- } else {
- ioaddr = board + zdd->offset;
- }
-
- if (!zorro_request_device(z, zdd->name)) {
- printk(KERN_ERR "amiga7xx: cannot reserve region 0x%lx, abort\n",
- board);
- return -EBUSY;
- }
-
- hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
- if (hostdata == NULL) {
- printk(KERN_ERR "amiga7xx: Failed to allocate host data\n");
- goto out_release;
- }
-
- memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
-
- /* Fill in the required pieces of hostdata */
- if (ioaddr > 0x01000000)
- hostdata->base = ioremap(ioaddr, zorro_resource_len(z));
- else
- hostdata->base = (void __iomem *)ZTWO_VADDR(ioaddr);
-
- hostdata->clock = 50;
- hostdata->chip710 = 1;
-
- /* Settings for at least WarpEngine 40xx */
- hostdata->ctest7_extra = CTEST7_TT1;
-
- amiga7xx_scsi_driver_template.name = zdd->name;
-
- /* and register the chip */
- host = NCR_700_detect(&amiga7xx_scsi_driver_template,
- hostdata, &z->dev);
- if (!host) {
- printk(KERN_ERR "amiga7xx-scsi: No host detected; "
- "board configuration problem?\n");
- goto out_free;
- }
-
- host->this_id = 7;
- host->base = ioaddr;
- host->irq = IRQ_AMIGA_PORTS;
-
- if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED,
- "amiga7xx-scsi", host)) {
- printk(KERN_ERR "amiga7xx-scsi: request_irq failed\n");
- goto out_put_host;
- }
-
- scsi_scan_host(host);
-
- return 0;
-
- out_put_host:
- scsi_host_put(host);
- out_free:
- if (ioaddr > 0x01000000)
- iounmap(hostdata->base);
- kfree(hostdata);
- out_release:
- zorro_release_device(z);
-
- return -ENODEV;
-}
-
-static __devexit void amiga7xx_remove_one(struct zorro_dev *z)
-{
- struct Scsi_Host *host = dev_to_shost(&z->dev);
- struct NCR_700_Host_Parameters *hostdata =
- (struct NCR_700_Host_Parameters *)host->hostdata[0];
-
- scsi_remove_host(host);
-
- NCR_700_release(host);
- kfree(hostdata);
- free_irq(host->irq, host);
- zorro_release_device(z);
-}
-
-static struct zorro_driver amiga7xx_driver = {
- .name = "amiga7xx-scsi",
- .id_table = amiga7xx_zorro_tbl,
- .probe = amiga7xx_init_one,
- .remove = __devexit_p(amiga7xx_remove_one),
-};
-
-#endif /* CONFIG_ZORRO */
-
-#define A4000T_SCSI_ADDR 0xdd0040
-
-static int __devinit a4000t_probe(struct device *dev)
-{
- struct Scsi_Host * host = NULL;
- struct NCR_700_Host_Parameters *hostdata;
-
- if (!(MACH_IS_AMIGA && AMIGAHW_PRESENT(A4000_SCSI)))
- goto out;
-
- if (!request_mem_region(A4000T_SCSI_ADDR, 0x1000,
- "A4000T builtin SCSI"))
- goto out;
-
- hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
- if (hostdata == NULL) {
- printk(KERN_ERR "a4000t-scsi: Failed to allocate host data\n");
- goto out_release;
- }
- memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
-
- /* Fill in the required pieces of hostdata */
- hostdata->base = (void __iomem *)ZTWO_VADDR(A4000T_SCSI_ADDR);
- hostdata->clock = 50;
- hostdata->chip710 = 1;
- hostdata->dmode_extra = DMODE_FC2;
- hostdata->dcntl_extra = EA_710;
-
- /* and register the chip */
- host = NCR_700_detect(&amiga7xx_scsi_driver_template, hostdata, dev);
- if (!host) {
- printk(KERN_ERR "a4000t-scsi: No host detected; "
- "board configuration problem?\n");
- goto out_free;
- }
-
- host->this_id = 7;
- host->base = A4000T_SCSI_ADDR;
- host->irq = IRQ_AMIGA_PORTS;
-
- if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "a4000t-scsi", host)) {
- printk(KERN_ERR "a4000t-scsi: request_irq failed\n");
- goto out_put_host;
- }
-
- scsi_scan_host(host);
-
- return 0;
-
- out_put_host:
- scsi_host_put(host);
- out_free:
- kfree(hostdata);
- out_release:
- release_mem_region(A4000T_SCSI_ADDR, 0x1000);
- out:
- return -ENODEV;
-}
-
-static __devexit int a4000t_device_remove(struct device *dev)
-{
- struct Scsi_Host *host = dev_to_shost(dev);
- struct NCR_700_Host_Parameters *hostdata =
- (struct NCR_700_Host_Parameters *)host->hostdata[0];
-
- scsi_remove_host(host);
-
- NCR_700_release(host);
- kfree(hostdata);
- free_irq(host->irq, host);
- release_mem_region(A4000T_SCSI_ADDR, 0x1000);
-
- return 0;
-}
-
-static struct device_driver a4000t_scsi_driver = {
- .name = "a4000t-scsi",
- .bus = &platform_bus_type,
- .probe = a4000t_probe,
- .remove = __devexit_p(a4000t_device_remove),
-};
-
-static int __init amiga7xx_scsi_init(void)
-{
- int err;
-
- err = driver_register(&a4000t_scsi_driver);
- if (err)
- return err;
-
- a4000t_scsi_device = platform_device_register_simple("a4000t-scsi",
- -1, NULL, 0);
- if (IS_ERR(a4000t_scsi_device)) {
- driver_unregister(&a4000t_scsi_driver);
- return PTR_ERR(a4000t_scsi_device);
- }
-
-#ifdef CONFIG_ZORRO
- err = zorro_register_driver(&amiga7xx_driver);
-#endif
-
- return err;
-}
-
-static void __exit amiga7xx_scsi_exit(void)
-{
- platform_device_unregister(a4000t_scsi_device);
- driver_unregister(&a4000t_scsi_driver);
-#ifdef CONFIG_ZORRO
- zorro_unregister_driver(&amiga7xx_driver);
-#endif
-}
-
-module_init(amiga7xx_scsi_init);
-module_exit(amiga7xx_scsi_exit);
--- /dev/null
+++ b/drivers/scsi/zorro7xx.c
@@ -0,0 +1,181 @@
+/*
+ * Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux.
+ * Amiga MacroSystemUS WarpEngine SCSI controller.
+ * Amiga Technologies/DKB A4091 SCSI controller.
+ *
+ * Written 1997 by Alan Hourihane <alanh@fairlite.demon.co.uk>
+ * plus modifications of the 53c7xx.c driver to support the Amiga.
+ *
+ * Rewritten to use 53c700.c by Kars de Jong <jongk@linux-m68k.org>
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/zorro.h>
+#include <asm/amigaints.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_transport_spi.h>
+
+#include "53c700.h"
+
+MODULE_AUTHOR("Alan Hourihane <alanh@fairlite.demon.co.uk> / Kars de Jong <jongk@linux-m68k.org>");
+MODULE_DESCRIPTION("Amiga Zorro NCR53C710 driver");
+MODULE_LICENSE("GPL");
+
+
+static struct scsi_host_template zorro7xx_scsi_driver_template = {
+ .proc_name = "zorro7xx",
+ .this_id = 7,
+ .module = THIS_MODULE,
+};
+
+static struct zorro_driver_data {
+ const char *name;
+ unsigned long offset;
+ int absolute; /* offset is absolute address */
+} zorro7xx_driver_data[] __devinitdata = {
+ { .name = "PowerUP 603e+", .offset = 0xf40000, .absolute = 1 },
+ { .name = "WarpEngine 40xx", .offset = 0x40000 },
+ { .name = "A4091", .offset = 0x800000 },
+ { .name = "GForce 040/060", .offset = 0x40000 },
+ { 0 }
+};
+
+static struct zorro_device_id zorro7xx_zorro_tbl[] __devinitdata = {
+ {
+ .id = ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS,
+ .driver_data = (unsigned long)&zorro7xx_driver_data[0],
+ },
+ {
+ .id = ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx,
+ .driver_data = (unsigned long)&zorro7xx_driver_data[1],
+ },
+ {
+ .id = ZORRO_PROD_CBM_A4091_1,
+ .driver_data = (unsigned long)&zorro7xx_driver_data[2],
+ },
+ {
+ .id = ZORRO_PROD_CBM_A4091_2,
+ .driver_data = (unsigned long)&zorro7xx_driver_data[2],
+ },
+ {
+ .id = ZORRO_PROD_GVP_GFORCE_040_060,
+ .driver_data = (unsigned long)&zorro7xx_driver_data[3],
+ },
+ { 0 }
+};
+
+static int __devinit zorro7xx_init_one(struct zorro_dev *z,
+ const struct zorro_device_id *ent)
+{
+ struct Scsi_Host * host = NULL;
+ struct NCR_700_Host_Parameters *hostdata;
+ struct zorro_driver_data *zdd;
+ unsigned long board, ioaddr;
+
+ board = zorro_resource_start(z);
+ zdd = (struct zorro_driver_data *)ent->driver_data;
+
+ if (zdd->absolute) {
+ ioaddr = zdd->offset;
+ } else {
+ ioaddr = board + zdd->offset;
+ }
+
+ if (!zorro_request_device(z, zdd->name)) {
+ printk(KERN_ERR "zorro7xx: cannot reserve region 0x%lx, abort\n",
+ board);
+ return -EBUSY;
+ }
+
+ hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
+ if (hostdata == NULL) {
+ printk(KERN_ERR "zorro7xx: Failed to allocate host data\n");
+ goto out_release;
+ }
+
+ memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
+
+ /* Fill in the required pieces of hostdata */
+ if (ioaddr > 0x01000000)
+ hostdata->base = ioremap(ioaddr, zorro_resource_len(z));
+ else
+ hostdata->base = (void __iomem *)ZTWO_VADDR(ioaddr);
+
+ hostdata->clock = 50;
+ hostdata->chip710 = 1;
+
+ /* Settings for at least WarpEngine 40xx */
+ hostdata->ctest7_extra = CTEST7_TT1;
+
+ zorro7xx_scsi_driver_template.name = zdd->name;
+
+ /* and register the chip */
+ host = NCR_700_detect(&zorro7xx_scsi_driver_template, hostdata,
+ &z->dev);
+ if (!host) {
+ printk(KERN_ERR "zorro7xx: No host detected; "
+ "board configuration problem?\n");
+ goto out_free;
+ }
+
+ host->this_id = 7;
+ host->base = ioaddr;
+ host->irq = IRQ_AMIGA_PORTS;
+
+ if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "zorro7xx-scsi",
+ host)) {
+ printk(KERN_ERR "zorro7xx: request_irq failed\n");
+ goto out_put_host;
+ }
+
+ scsi_scan_host(host);
+
+ return 0;
+
+ out_put_host:
+ scsi_host_put(host);
+ out_free:
+ if (ioaddr > 0x01000000)
+ iounmap(hostdata->base);
+ kfree(hostdata);
+ out_release:
+ zorro_release_device(z);
+
+ return -ENODEV;
+}
+
+static __devexit void zorro7xx_remove_one(struct zorro_dev *z)
+{
+ struct Scsi_Host *host = dev_to_shost(&z->dev);
+ struct NCR_700_Host_Parameters *hostdata =
+ (struct NCR_700_Host_Parameters *)host->hostdata[0];
+
+ scsi_remove_host(host);
+
+ NCR_700_release(host);
+ kfree(hostdata);
+ free_irq(host->irq, host);
+ zorro_release_device(z);
+}
+
+static struct zorro_driver zorro7xx_driver = {
+ .name = "zorro7xx-scsi",
+ .id_table = zorro7xx_zorro_tbl,
+ .probe = zorro7xx_init_one,
+ .remove = __devexit_p(zorro7xx_remove_one),
+};
+
+static int __init zorro7xx_scsi_init(void)
+{
+ return zorro_register_driver(&zorro7xx_driver);
+}
+
+static void __exit zorro7xx_scsi_exit(void)
+{
+ zorro_unregister_driver(&zorro7xx_driver);
+}
+
+module_init(zorro7xx_scsi_init);
+module_exit(zorro7xx_scsi_exit);

View File

@ -1,887 +0,0 @@
From: David Miller <davem@davemloft.net>
To: sammy@sammy.net
Cc: linux-m68k@vger.kernel.org
Subject: Re: [PATCH] cg3/bw2: add Sun3/Sun3x support
From: Sam Creasey <sammy@sammy.net>
Date: Tue, 3 Apr 2007 10:32:35 -0400
> This patch (re) introduces support for the CG3 driver on Sun3, and for
> BW2 on Sun3x. It applies cleanly to both the m68k CVS tree and the
> vanilla tree.
>
> Signed-off-by: Sam Creasey <sammy@sammy.net>
If you guys want to share driver code with the Sparc port, please do
it properly.
I am not applying a pile of ifdef's that basically duplicate half of
the existing driver.
What you can do instead is to build a fake openprom device tree and
register those devices with the generic device subsystem, and then the
driver will mostly just work out of the box. It should be easy to
duplicate the arch/sparc64/kernel/prom.c and of_device.c code you
use as well as the driver interfaces in include/asm-sparc64/prom.h
and of_device.h
This way you don't need to shit all over the drivers adding hardcoded
register addresses and ad-hoc probing code. For special behaviors,
you can add openprom node properties that the driver can test for at
run time to guide behavior, again instead of ifdefs.
---------------------------------------------------------------------------
From sammy@sammy.net Tue Apr 3 16:47:32 2007
Date: Tue, 3 Apr 2007 10:32:35 -0400
From: Sam Creasey <sammy@sammy.net>
To: linux-m68k@vger.kernel.org, David S. Miller <davem@davemloft.net>
Subject: [PATCH] cg3/bw2: add Sun3/Sun3x support
This patch (re) introduces support for the CG3 driver on Sun3, and for
BW2 on Sun3x. It applies cleanly to both the m68k CVS tree and the
vanilla tree.
Signed-off-by: Sam Creasey <sammy@sammy.net>
---
drivers/video/Kconfig | 14 ++
drivers/video/Makefile | 1
drivers/video/bw2.c | 232 ++++++++++++++++++++++++++++++++++++++++++++++--
drivers/video/cg3.c | 212 ++++++++++++++++++++++++++++++++++++++++++-
drivers/video/p4lib.c | 107 ++++++++++++++++++++++
drivers/video/p4lib.h | 56 +++++++++++
drivers/video/sbuslib.c | 13 ++
7 files changed, 616 insertions(+), 19 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/video/Kconfig
+++ linux-m68k-2.6.21/drivers/video/Kconfig
@@ -600,6 +600,16 @@ config FB_GBE_MEM
This is the amount of memory reserved for the framebuffer,
which can be any value between 1MB and 8MB.
+config FB_SUN3
+ bool "Sun3 framebuffer support"
+ depends on (FB = y) && (SUN3 || SUN3X)
+ help
+ Support framebuffer devices on Sun3/3x. Note that if you say yes
+ here, any framebuffer drivers you select MUST be installed in the
+ target system, or be disabled on the command line. (e.g. if you
+ don't have a bw2, include video=bw2fb:off. If you don't have
+ a cg3, include video=cg3fb:off.)
+
config FB_SBUS
bool "SBUS and UPA framebuffers"
depends on (FB = y) && SPARC
@@ -608,7 +618,7 @@ config FB_SBUS
config FB_BW2
bool "BWtwo support"
- depends on (FB = y) && (SPARC && FB_SBUS)
+ depends on (FB = y) && ((SPARC && FB_SBUS) || (SUN3X && FB_SUN3))
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
@@ -617,7 +627,7 @@ config FB_BW2
config FB_CG3
bool "CGthree support"
- depends on (FB = y) && (SPARC && FB_SBUS)
+ depends on (FB = y) && ((SPARC && FB_SBUS) || (SUN3 && FB_SUN3))
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
--- linux-m68k-2.6.21.orig/drivers/video/Makefile
+++ linux-m68k-2.6.21/drivers/video/Makefile
@@ -106,6 +106,7 @@ obj-$(CONFIG_FB_VESA) += ves
obj-$(CONFIG_FB_IMAC) += imacfb.o
obj-$(CONFIG_FB_VGA16) += vga16fb.o vgastate.o
obj-$(CONFIG_FB_OF) += offb.o
+obj-$(CONFIG_FB_SUN3) += p4lib.o
# the test framebuffer is last
obj-$(CONFIG_FB_VIRTUAL) += vfb.o
--- linux-m68k-2.6.21.orig/drivers/video/bw2.c
+++ linux-m68k-2.6.21/drivers/video/bw2.c
@@ -20,18 +20,29 @@
#include <asm/io.h>
#include <asm/oplib.h>
+#ifndef CONFIG_FB_SUN3
#include <asm/prom.h>
#include <asm/of_device.h>
+#endif
#include <asm/fbio.h>
#include "sbuslib.h"
+#ifdef CONFIG_FB_SUN3
+#ifdef CONFIG_SUN3
+#include <asm/sun3mmu.h>
+#endif
+#include <asm/machines.h>
+#include <asm/idprom.h>
+#include <asm/sbus.h>
+#include "p4lib.h"
+#endif
/*
* Local functions.
*/
-
+#ifndef CONFIG_FB_SUN3
static int bw2_blank(int, struct fb_info *);
-
+#endif
static int bw2_mmap(struct fb_info *, struct vm_area_struct *);
static int bw2_ioctl(struct fb_info *, unsigned int, unsigned long);
@@ -41,7 +52,11 @@ static int bw2_ioctl(struct fb_info *, u
static struct fb_ops bw2_ops = {
.owner = THIS_MODULE,
+#ifdef CONFIG_FB_SUN3
+ .fb_blank = NULL,
+#else
.fb_blank = bw2_blank,
+#endif
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
@@ -53,7 +68,18 @@ static struct fb_ops bw2_ops = {
};
/* OBio addresses for the bwtwo registers */
+#ifdef CONFIG_FB_SUN3
+/* sun3 series */
+#define BWTWO_OBMEM_ADDR 0x1f000000
+#define BWTWO_OBMEM_ADDR_50 0x00100000
+#define BWTWO_OBMEM_ADDR_P4 0x1f300000
+#define BWTWO_OBMEM_ADDR_3X 0x50300000
+/* is this true for 3/50? */
+#define BWTWO_FB_OFFSET 0x100000
+#define BWTWO_OBMEM_HIGHRES_60 0x1f1c0000
+#else
#define BWTWO_REGISTER_OFFSET 0x400000
+#endif
struct bt_regs {
u32 addr;
@@ -108,8 +134,11 @@ struct bw2_regs {
struct bw2_par {
spinlock_t lock;
+#ifdef CONFIG_FB_SUN3
+ volatile u32 *regs;
+#else
struct bw2_regs __iomem *regs;
-
+#endif
u32 flags;
#define BW2_FLAG_BLANKED 0x00000001
@@ -118,6 +147,7 @@ struct bw2_par {
unsigned long fbsize;
};
+#ifndef CONFIG_FB_SUN3
/**
* bw2_blank - Optional function. Blanks the display.
* @blank_mode: the blank mode we want.
@@ -156,6 +186,7 @@ bw2_blank(int blank, struct fb_info *inf
return 0;
}
+#endif
static struct sbus_mmap_map bw2_mmap_map[] = {
{
@@ -198,6 +229,17 @@ static void __devinit bw2_init_fix(struc
info->fix.accel = FB_ACCEL_SUN_BWTWO;
}
+struct all_info {
+ struct fb_info info;
+ struct bw2_par par;
+};
+/* CONFIG_FB_SUN3 has a different implementation for the remaining
+ functions, since:
+ 1) No OpenProm
+ 2) Fixed frequency
+ 3) No support for multiple BWtwo's */
+#ifndef CONFIG_FB_SUN3
+
static u8 bw2regs_1600[] __devinitdata = {
0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13,
0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e,
@@ -279,11 +321,6 @@ static void __devinit bw2_do_default_mod
}
}
-struct all_info {
- struct fb_info info;
- struct bw2_par par;
-};
-
static int __devinit bw2_init_one(struct of_device *op)
{
struct device_node *dp = op->node;
@@ -397,6 +434,185 @@ static void __exit bw2_exit(void)
return of_unregister_driver(&bw2_driver);
}
+#else /* !CONFIG_FB_SUN3 */
+
+static struct all_info *bw2_all = NULL;
+
+static void bw2_do_default_mode(struct bw2_par *par, struct fb_info *info,
+ int *linebytes)
+{
+ int highres = 0;
+
+ if(idprom->id_machtype == (SM_SUN3|SM_3_260))
+ /* the 3/260 is allegedly always highres */
+ highres = 1;
+ if(idprom->id_machtype == (SM_SUN3|SM_3_60)) {
+#ifdef CONFIG_SUN3
+ /* we won't hit this unless running on a sun3 anyway */
+ volatile u32 *reg;
+ u32 il
+
+ reg = sun3_ioremap(BW2_OBMEM_HIGHRES_60, sizeof(u32),
+ SUN3_PAGE_TYPE_MEMORY);
+ i = *reg;
+ iounmap(reg);
+ if((i != -1) && (i& 0x80) == 0)
+ highres = 1;
+#endif
+ }
+
+ if(highres) {
+ info->var.xres = info->var.xres_virtual = 1600;
+ info->var.yres = info->var.yres_virtual = 1280;
+ *linebytes = 1600 / 8;
+ }
+}
+
+
+static int __devinit bw2_init_one(unsigned long phys_addr)
+{
+ struct all_info *all;
+ int linebytes, err, id;
+ all = kzalloc(sizeof(*all), GFP_KERNEL);
+ if (!all)
+ return -ENOMEM;
+
+ spin_lock_init(&all->par.lock);
+
+ all->par.physbase = phys_addr;
+
+#ifdef CONFIG_SUN3
+ all->par.regs = sun3_ioremap(phys_addr, sizeof(u32),
+ SUN3_PAGE_TYPE_MEMORY);
+#else
+ all->par.regs = ioremap_nocache(phys_addr, sizeof(u32));
+#endif
+ /* look for the p4 register, or assume we're OBIO if it's not found */
+ id = p4fb_get_id(all->par.regs);
+ printk("bwtwo: p4id %08x\n", id);
+
+ /* mutable memory address, probably save to say we've got an onboard fb */
+ if(id == -1) {
+ iounmap((void *)all->par.regs);
+ /* only currently supported on sun3. Perhaps someday sun4. */
+ if((idprom->id_machtype & SM_ARCH_MASK) != SM_SUN3) {
+ kfree(all);
+ return -ENODEV;
+ }
+
+ p4fb_fill_var(&all->info.var, NULL, 1);
+ bw2_do_default_mode(&all->par, &all->info, &linebytes);
+ } else {
+ if(id != P4_ID_BW2) {
+ kfree(all);
+ iounmap((void *)all->par.regs);
+ return -ENODEV;
+ }
+
+ p4fb_fill_var(&all->info.var, (volatile u32 *)all->par.regs, 1);
+ }
+
+ linebytes = all->info.var.xres / 8;
+
+ all->info.var.red.length = all->info.var.green.length =
+ all->info.var.blue.length = all->info.var.bits_per_pixel;
+ all->info.var.red.offset = all->info.var.green.offset =
+ all->info.var.blue.offset = 0;
+
+ all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres);
+
+ all->info.flags = FBINFO_DEFAULT;
+ all->info.fbops = &bw2_ops;
+
+ if(id == -1) {
+#ifdef CONFIG_SUN3
+ all->info.screen_base = sun3_ioremap(phys_addr,
+ all->par.fbsize,
+ SUN3_PAGE_TYPE_MEMORY);
+#else
+ all->info.screen_base = ioremap(phys_addr,
+ all->par.fbsize);
+#endif
+ } else {
+#ifdef CONFIG_SUN3
+ all->info.screen_base = sun3_ioremap(phys_addr + BWTWO_FB_OFFSET,
+ all->par.fbsize,
+ SUN3_PAGE_TYPE_MEMORY);
+#else
+ all->info.screen_base = ioremap(phys_addr + BWTWO_FB_OFFSET,
+ all->par.fbsize);
+#endif
+ }
+
+ p4fb_video_enable(all->par.regs);
+
+ all->info.par = &all->par;
+
+ bw2_init_fix(&all->info, linebytes);
+
+ err= register_framebuffer(&all->info);
+ if (err < 0) {
+ iounmap((void *)all->par.regs);
+ iounmap((void *)all->info.screen_base);
+ kfree(all);
+ return err;
+ }
+
+ bw2_all = all;
+
+ printk("%s: bwtwo at %lx\n",
+ all->info.fix.id, all->par.physbase);
+
+ return 0;
+}
+
+static int __init bw2_init(void)
+{
+ if(fb_get_options("bw2fb", NULL))
+ return -ENODEV;
+
+ if(bw2_all != NULL)
+ return -ENODEV;
+
+ /* currently only sun3/80 P4 is supported/tested */
+ switch(idprom->id_machtype) {
+ case SM_SUN3X|SM_3_80:
+ case SM_SUN3X|SM_3_460:
+ return bw2_init_one(BWTWO_OBMEM_ADDR_3X);
+
+ case SM_SUN3|SM_3_50:
+ return bw2_init_one(BWTWO_OBMEM_ADDR_50);
+
+ case SM_SUN3|SM_3_160:
+ case SM_SUN3|SM_3_260:
+ case SM_SUN3|SM_3_110:
+ case SM_SUN3|SM_3_60:
+ return bw2_init_one(BWTWO_OBMEM_ADDR);
+ default:
+ break;
+ }
+
+ return -ENODEV;
+}
+
+static void __exit bw2_exit(void)
+{
+ struct all_info *all = bw2_all;
+ if(bw2_all == NULL)
+ return;
+
+ unregister_framebuffer(&all->info);
+
+ iounmap((void *)all->par.regs);
+ iounmap((void *)all->info.screen_base);
+
+ kfree(all);
+
+ bw2_all = NULL;
+
+ return;
+}
+#endif /* CONFIG_FB_SUN3 */
module_init(bw2_init);
module_exit(bw2_exit);
--- linux-m68k-2.6.21.orig/drivers/video/cg3.c
+++ linux-m68k-2.6.21/drivers/video/cg3.c
@@ -20,12 +20,24 @@
#include <asm/io.h>
#include <asm/oplib.h>
+#ifndef CONFIG_FB_SUN3
#include <asm/prom.h>
#include <asm/of_device.h>
+#endif
#include <asm/fbio.h>
#include "sbuslib.h"
+#ifdef CONFIG_FB_SUN3
+#ifdef CONFIG_SUN3
+#include <asm/sun3mmu.h>
+#endif
+#include <asm/machines.h>
+#include <asm/idprom.h>
+#include <asm/sbus.h>
+#include "p4lib.h"
+#endif
+
/*
* Local functions.
*/
@@ -108,8 +120,16 @@ struct cg3_regs {
};
/* Offset of interesting structures in the OBIO space */
-#define CG3_REGS_OFFSET 0x400000UL
-#define CG3_RAM_OFFSET 0x800000UL
+#ifdef CONFIG_SUN3
+#define CGFOUR_OBMEM_ADDR_60 0x1f000000
+#define CGFOUR_OBMEM_ADDR_110 0x1f300000
+#define CG3_REGS_OFFSET (-0x100000)
+#define CG3_RAM_OFFSET 0x500000UL
+#else
+#define CG3_REGS_OFFSET 0x400000UL
+#define CG3_RAM_OFFSET 0x800000UL
+#endif
+
struct cg3_par {
spinlock_t lock;
@@ -250,6 +270,18 @@ static int cg3_ioctl(struct fb_info *inf
* Initialisation
*/
+struct all_info {
+ struct fb_info info;
+ struct cg3_par par;
+};
+
+
+/* CONFIG_FB_SUN3 has a different implementation for the remaining
+ functions, since:
+ 1) No OpenProm
+ 2) Fixed frequency
+ 3) No support for multiple CGthree's */
+#ifndef CONFIG_FB_SUN3
static void __devinit cg3_init_fix(struct fb_info *info, int linebytes,
struct device_node *dp)
{
@@ -351,12 +383,8 @@ static void __devinit cg3_do_default_mod
regp = (u8 __iomem *)&par->regs->cmap.control;
sbus_writeb(p[1], regp);
}
-}
-struct all_info {
- struct fb_info info;
- struct cg3_par par;
-};
+}
static int __devinit cg3_init_one(struct of_device *op)
{
@@ -426,8 +454,8 @@ static int __devinit cg3_init_one(struct
dev_set_drvdata(&op->dev, all);
- printk("%s: cg3 at %lx:%lx\n",
- dp->full_name, all->par.which_io, all->par.physbase);
+ printk("%s: cg3 at %lx\n",
+ dp->full_name, all->par.physbase);
return 0;
}
@@ -488,6 +516,172 @@ static void __exit cg3_exit(void)
of_unregister_driver(&cg3_driver);
}
+#else /* !CONFIG_FB_SUN3 */
+static void
+cg3_init_fix(struct fb_info *info, int linebytes)
+{
+
+ strcpy(info->fix.id, "SUN3 CG3");
+
+ info->fix.type = FB_TYPE_PACKED_PIXELS;
+ info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
+
+ info->fix.line_length = linebytes;
+
+ info->fix.accel = FB_ACCEL_SUN_CGTHREE;
+}
+static void cg3_do_default_mode(struct cg3_par *par)
+{
+ /* kick up the sun3 -- 66hz prom mode only */
+ /* this also turns off the overlay in case it's really a cg4 */
+
+ par->regs->cmap.addr = 4;
+ par->regs->cmap.control = 0xff;
+ par->regs->cmap.addr = 5;
+ par->regs->cmap.control = 0;
+ par->regs->cmap.addr = 6;
+ par->regs->cmap.control = 0x40;
+ par->regs->cmap.addr = 7;
+ par->regs->cmap.control = 0;
+
+}
+
+/* The Sun3 version of this driver only supports one cgthree.
+ This really isn't an issue, because it also only supports
+ the 3/60 OBIO cg3, and not vme cards (of which there could be more
+ than one) */
+static struct all_info *cg3_all = NULL;
+
+static int __devinit cg3_init_one(unsigned long phys_addr)
+{
+ struct all_info *all;
+ int linebytes, err;
+ volatile u32 *p4reg = NULL;
+
+ all = kzalloc(sizeof(*all), GFP_KERNEL);
+ if (!all)
+ return -ENOMEM;
+
+ spin_lock_init(&all->par.lock);
+
+ all->par.physbase = phys_addr;
+
+#if 0
+ /* it would be nice to use p4 registers here, but it appears
+ * some P4 framebuffers don't actually have useful data.
+ * So we just plod along regardless */
+ p4reg = sun3_ioremap(all->par.physbase, sizeof(u32),
+ SUN3_PAGE_TYPE_MEMORY);
+ id = p4fb_get_id(p4reg);
+ printk("cg3: p4id %08x\n", *p4reg);
+
+ if(id != P4_ID_CG4) {
+ iounmap((void *)p4reg);
+ kfree(all);
+ return -ENODEV;
+ }
+
+#endif
+ p4fb_fill_var(&all->info.var, p4reg, 8);
+ if(p4reg != NULL)
+ iounmap((void *)p4reg);
+
+ all->info.var.red.length = 8;
+ all->info.var.green.length = 8;
+ all->info.var.blue.length = 8;
+ linebytes = all->info.var.xres;
+
+ all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres);
+
+ all->par.regs = (struct cg3_regs *)
+ sun3_ioremap(all->par.physbase + CG3_REGS_OFFSET,
+ sizeof(struct cg3_regs), SUN3_PAGE_TYPE_MEMORY);
+
+
+ all->info.flags = FBINFO_DEFAULT;
+ all->info.fbops = &cg3_ops;
+ all->info.screen_base = (char *)
+ sun3_ioremap(all->par.physbase + CG3_RAM_OFFSET,
+ all->par.fbsize, SUN3_PAGE_TYPE_MEMORY);
+ all->info.par = &all->par;
+
+ cg3_blank(0, &all->info);
+
+ cg3_do_default_mode(&all->par);
+
+ if (fb_alloc_cmap(&all->info.cmap, 256, 0)) {
+ kfree(all);
+ return -ENOMEM;
+ }
+
+ fb_set_cmap(&all->info.cmap, &all->info);
+
+ cg3_init_fix(&all->info, linebytes);
+
+ err = register_framebuffer(&all->info);
+ if (err < 0) {
+ fb_dealloc_cmap(&all->info.cmap);
+ iounmap(all->par.regs);
+ iounmap(all->info.screen_base);
+ kfree(all);
+ return err;
+ }
+
+ cg3_all = all;
+
+ printk("%s: cg3 at %lx\n",
+ all->info.fix.id, all->par.physbase);
+
+ return 0;
+}
+
+static int __init cg3_init(void)
+{
+ if (fb_get_options("cg3fb", NULL))
+ return -ENODEV;
+
+ if(cg3_all != NULL)
+ return -ENODEV;
+
+ /* currently only sun3/60 P4 is supported/tested */
+ switch(idprom->id_machtype) {
+ case SM_SUN3|SM_3_60:
+ return cg3_init_one(CGFOUR_OBMEM_ADDR_60);
+
+ case SM_SUN3|SM_3_110:
+ /* 3/110 is a guess, no 3/110 to test on */
+ return cg3_init_one(CGFOUR_OBMEM_ADDR_110);
+
+ default:
+ break;
+ }
+
+ return -ENODEV;
+}
+
+static void __exit cg3_exit(void)
+{
+ struct all_info *all = cg3_all;
+
+ if(cg3_all == NULL)
+ return;
+
+ unregister_framebuffer(&all->info);
+ fb_dealloc_cmap(&all->info.cmap);
+
+ iounmap(all->par.regs);
+ iounmap(all->info.screen_base);
+
+ kfree(all);
+
+ cg3_all = NULL;
+
+ return;
+
+}
+
+#endif /* CONFIG_FB_SUN3 */
+
module_init(cg3_init);
module_exit(cg3_exit);
--- /dev/null
+++ linux-m68k-2.6.21/drivers/video/p4lib.c
@@ -0,0 +1,107 @@
+/* p4lib.c: Helper library for Sun P4 framebuffer drivers
+ *
+ * Copyright (C) 2007 Sam Creasey (sammy@sammy.net)
+ */
+
+#include <linux/compat.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+#include <linux/fb.h>
+
+#include "p4lib.h"
+
+int p4fb_get_id(volatile u32 *p4reg)
+{
+
+#ifdef CONFIG_SUN3
+ /* this code makes the 3x cry, and it can't have onboard fb anyway */
+ u32 x, old;
+
+ /* attempt to read the id bit back from the p4 register, if
+ * we're able to modify the value, conclude there's no p4
+ * device there. This should enable us to determine if we're
+ * dealing with, for example, a builtin bw2 or a p4 bw2. */
+
+ old = *p4reg;
+ x = old & ~P4_CTRL_RESET;
+
+ *p4reg = x ^ P4_ID_MASK;
+ if((*p4reg ^ x) & P4_ID_MASK) {
+ /* we managed to change the type bits, not a p4 port */
+ *p4reg = old;
+ return -1;
+ }
+#endif
+ return ((*p4reg) & P4_ID_MASK) >> P4_ID_SHIFT;
+}
+
+int p4fb_get_res(volatile u32 *p4reg)
+{
+ return ((*p4reg) & P4_RES_MASK) >> P4_RES_SHIFT;
+}
+
+void p4fb_video_enable(volatile u32 *p4reg)
+{
+ u32 x;
+
+ x = *p4reg;
+ x &= ~(P4_CTRL_VIDEO_EN | P4_CTRL_INT);
+ x |= P4_CTRL_VIDEO_EN;
+ *p4reg = x;
+
+}
+
+/* This function basically assumes that p4fb_get_id returns a sane
+ * value for this card/instance. If this was not true, calling with
+ * NULL for p4reg will return the defaults */
+void p4fb_fill_var(struct fb_var_screeninfo *var, volatile u32 *p4reg, int bpp)
+{
+ memset(var, 0, sizeof(*var));
+
+ if(p4reg == NULL) {
+ var->xres = 1152;
+ var->yres = 900;
+ } else {
+ switch(p4fb_get_res(p4reg)) {
+ case P4_RES_1600X1280:
+ var->xres = 1600;
+ var->yres = 1280;
+ break;
+ case P4_RES_1152X900:
+ var->xres = 1152;
+ var->yres = 900;
+ break;
+ case P4_RES_1024X1024:
+ var->xres = 1024;
+ var->yres = 1024;
+ break;
+ case P4_RES_1280X1024:
+ var->xres = 1280;
+ var->yres = 1024;
+ break;
+ case P4_RES_1440X1440:
+ var->xres = 1440;
+ var->yres = 1400;
+ break;
+ case P4_RES_640X480:
+ var->xres = 640;
+ var->yres = 480;
+ break;
+ default:
+ /* this may or may not be the right thing to
+ * do here, but plod on anyway */
+ var->xres = 1152;
+ var->yres = 900;
+ break;
+ }
+ }
+
+ var->xres_virtual = var->xres;
+ var->yres_virtual = var->yres;
+ var->bits_per_pixel = bpp;
+}
+
+EXPORT_SYMBOL(p4fb_get_id);
+EXPORT_SYMBOL(p4fb_get_res);
+EXPORT_SYMBOL(p4fb_fill_var);
--- /dev/null
+++ linux-m68k-2.6.21/drivers/video/p4lib.h
@@ -0,0 +1,56 @@
+/* p4lib.h: helper functions for p4 framebuffers */
+
+#ifndef _P4LIB_H
+#define _P4LIB_H
+
+/* register defintions applicable to p4 framebuffers found on some
+ Sun3/3x machines (and some Sun4 machines, though these are not
+ currently supported or tested). These machines have a single 32bit
+ register at the start of the p4 address space.
+
+ The format of this register is as follows:
+
+ bit 31 : unused
+ bits 30-28: type
+ bits 27-24: resolution
+ bits 23-8: unused
+ bits 7-0: status/control
+
+ The CG8 may break this format, if that turns out to be true, I'll
+ fix once I have a CG8 to test against...
+*/
+
+/* control register, lower 8bits */
+#define P4_CTRL_DIAG 0x80 /* ??? */
+#define P4_CTRL_RBCLR 0x40 /* ??? */
+#define P4_CTRL_VIDEO_EN 0x20 /* enable video */
+#define P4_CTRL_SYNC 0x10 /* ??? */
+#define P4_CTRL_VTRACE 0x08 /* ??? */
+#define P4_CTRL_INT 0x04 /* read: int pending, write: clear int */
+#define P4_CTRL_INT_EN 0x02 /* enable interrupts */
+#define P4_CTRL_RESET 0x01 /* reset */
+
+/* framebuffer identification -- bits 31-28 */
+#define P4_ID_MASK 0x70000000
+#define P4_ID_SHIFT 24
+#define P4_ID_BW2 0x00
+#define P4_ID_CG4 0x40 /* supported in linux as a cg3 */
+#define P4_ID_CG6 0x60
+
+/* framebuffer resolution - bits 27-24 */
+#define P4_RES_MASK 0x0f000000
+#define P4_RES_SHIFT 24
+#define P4_RES_1600X1280 0x00
+#define P4_RES_1152X900 0x01 /* only tested resolution */
+#define P4_RES_1024X1024 0x02
+#define P4_RES_1280X1024 0x03
+#define P4_RES_1440X1440 0x04
+#define P4_RES_640X480 0x05
+
+/* actual helper functions */
+extern int p4fb_get_id(volatile u32 *p4reg);
+extern int p4fb_get_res(volatile u32 *p4reg);
+extern void p4fb_video_enable(volatile u32 *p4reg);
+extern void p4fb_fill_var(struct fb_var_screeninfo *var, volatile u32 *p4reg, int bpp);
+
+#endif /* P4LIB_H */
--- linux-m68k-2.6.21.orig/drivers/video/sbuslib.c
+++ linux-m68k-2.6.21/drivers/video/sbuslib.c
@@ -13,6 +13,10 @@
#include <asm/oplib.h>
#include <asm/fbio.h>
+#if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
+#include <asm/uaccess.h>
+#endif
+
#include "sbuslib.h"
void sbusfb_fill_var(struct fb_var_screeninfo *var, int prom_node, int bpp)
@@ -21,6 +25,7 @@ void sbusfb_fill_var(struct fb_var_scree
var->xres = prom_getintdefault(prom_node, "width", 1152);
var->yres = prom_getintdefault(prom_node, "height", 900);
+
var->xres_virtual = var->xres;
var->yres_virtual = var->yres;
var->bits_per_pixel = bpp;
@@ -80,12 +85,20 @@ int sbusfb_mmap_helper(struct sbus_mmap_
}
if (page + map_size > size)
map_size = size - page;
+#if !defined(CONFIG_FB_SUN3)
r = io_remap_pfn_range(vma,
vma->vm_start + page,
MK_IOSPACE_PFN(iospace,
map_offset >> PAGE_SHIFT),
map_size,
vma->vm_page_prot);
+#else
+ r = io_remap_pfn_range(vma,
+ vma->vm_start + page,
+ map_offset, map_size,
+ vma->vm_page_prot);
+#endif
+
if (r)
return -EAGAIN;
page += map_size;

View File

@ -1,486 +0,0 @@
From: David Miller <davem@davemloft.net>
To: sammy@sammy.net
Cc: linux-m68k@vger.kernel.org
Subject: Re: [PATCH] Sun3/3x Serial driver support
From: Sam Creasey <sammy@sammy.net>
Date: Tue, 3 Apr 2007 10:43:42 -0400
> Adds serial support for sun3/3x machines. This patch has basically
> been around for years, but my own laziness has kept me from committing
> upstream.
>
> Signed-off-by: Sam Creasey <sammy@sammy.net>
Same thing here, please build a proper openprom device tree in
the sun3 port and then you'll need to make few, if any,
changes to the sparc drivers.
I've made these drivers as portable as possible, frankly, and
if you cook up proper in-kernel device objects, you'll need
to do no porting at all.
---------------------------------------------------------------------------
From sammy@sammy.net Tue Apr 3 16:47:31 2007
Date: Tue, 3 Apr 2007 10:43:42 -0400
From: Sam Creasey <sammy@sammy.net>
To: linux-m68k@vger.kernel.org, David S. Miller <davem@davemloft.net>
Subject: [PATCH] Sun3/3x Serial driver support
Adds serial support for sun3/3x machines. This patch has basically
been around for years, but my own laziness has kept me from committing
upstream.
Signed-off-by: Sam Creasey <sammy@sammy.net>
---
drivers/serial/Kconfig | 4
drivers/serial/suncore.c | 4
drivers/serial/sunzilog.c | 200 +++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 195 insertions(+), 13 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/serial/Kconfig
+++ linux-m68k-2.6.21/drivers/serial/Kconfig
@@ -543,14 +543,14 @@ config SERIAL_UARTLITE_CONSOLE
config SERIAL_SUNCORE
bool
- depends on SPARC
+ depends on SPARC || SUN3 || SUN3X
select SERIAL_CORE
select SERIAL_CORE_CONSOLE
default y
config SERIAL_SUNZILOG
tristate "Sun Zilog8530 serial support"
- depends on SPARC
+ depends on SPARC || SUN3 || SUN3X
help
This driver supports the Zilog8530 serial ports found on many Sparc
systems. Say Y or M if you want to be able to these serial ports.
--- linux-m68k-2.6.21.orig/drivers/serial/suncore.c
+++ linux-m68k-2.6.21/drivers/serial/suncore.c
@@ -29,6 +29,7 @@ EXPORT_SYMBOL(sunserial_current_minor);
void
sunserial_console_termios(struct console *con)
{
+#if !defined(CONFIG_SUN3) && !defined (CONFIG_SUN3X)
char mode[16], buf[16], *s;
char *mode_prop = "ttyX-mode";
char *cd_prop = "ttyX-ignore-cd";
@@ -162,6 +163,9 @@ no_options:
}
con->cflag = cflag;
+#else /* CONFIG_SUN3(X) */
+ con->cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8;
+#endif
}
EXPORT_SYMBOL(sunserial_console_termios);
--- linux-m68k-2.6.21.orig/drivers/serial/sunzilog.c
+++ linux-m68k-2.6.21/drivers/serial/sunzilog.c
@@ -35,13 +35,30 @@
#include <asm/io.h>
#include <asm/irq.h>
-#include <asm/prom.h>
-#include <asm/of_device.h>
#if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
#endif
+#if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
+#include <asm/oplib.h>
+#include <asm/sbus.h>
+#define readb sbus_readb
+#define writeb sbus_writeb
+
+#else
+#include <asm/prom.h>
+#include <asm/of_device.h>
+#endif
+
+#ifdef CONFIG_SUN3
+#include <asm/sun3mmu.h>
+#endif
+
+#ifdef CONFIG_SUN3X
+#include <asm/sun3xprom.h>
+#endif
+
#include <linux/serial_core.h>
#include "suncore.h"
@@ -415,7 +432,15 @@ static void sunzilog_status_handle(struc
if (!(status & BRK_ABRT))
break;
}
- sun_do_break();
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
+ sun_do_break();
+#else
+#ifdef CONFIG_SUN3
+ prom_reboot("");
+#else
+ sun3x_reboot();
+#endif
+#endif
return;
}
}
@@ -523,6 +548,13 @@ static irqreturn_t sunzilog_interrupt(in
struct tty_struct *tty;
unsigned char r3;
+#if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
+ if(!channel) {
+ up = up->next;
+ continue;
+ }
+#endif
+
spin_lock(&up->port.lock);
r3 = read_zsreg(channel, R3);
@@ -1193,6 +1225,7 @@ static struct console sunzilog_console_o
static inline struct console *SUNZILOG_CONSOLE(void)
{
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
int i;
if (con_is_present())
@@ -1209,6 +1242,10 @@ static inline struct console *SUNZILOG_C
sunzilog_console_ops.index = i;
sunzilog_port_table[i].flags |= SUNZILOG_FLAG_IS_CONS;
+#else
+ sunzilog_console_ops.index = 0;
+ sunzilog_port_table[0].flags |= SUNZILOG_FLAG_IS_CONS;
+#endif
return &sunzilog_console_ops;
}
@@ -1266,6 +1303,8 @@ static void __init sunzilog_register_ser
}
#endif
+static int zilog_irq = -1;
+
static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up)
{
struct zilog_channel __iomem *channel;
@@ -1276,9 +1315,16 @@ static void __devinit sunzilog_init_hw(s
spin_lock_irqsave(&up->port.lock, flags);
if (ZS_IS_CHANNEL_A(up)) {
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
write_zsreg(channel, R9, FHWRES);
ZSDELAY_LONG();
+#endif
(void) read_zsreg(channel, R0);
+#ifdef CONFIG_SUN3
+ /* should sun3x run here? */
+ /* program the int vector */
+ write_zsreg(channel, R2, 0x18+zilog_irq);
+#endif
}
if (up->flags & (SUNZILOG_FLAG_CONS_KEYB |
@@ -1293,7 +1339,11 @@ static void __devinit sunzilog_init_hw(s
up->curregs[R4] = PAR_EVEN | X16CLK | SB1;
up->curregs[R3] = RxENAB | Rx8;
up->curregs[R5] = TxENAB | Tx8;
+#ifdef CONFIG_SUN3
+ up->curregs[R9] = MIE;
+#else
up->curregs[R9] = NV | MIE;
+#endif
up->curregs[R10] = NRZ;
up->curregs[R11] = TCBR | RCBR;
baud = 9600;
@@ -1314,9 +1364,75 @@ static void __devinit sunzilog_init_hw(s
#endif
}
-static int zilog_irq = -1;
+#if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
+static struct zilog_layout * __init get_zs(int chip)
+{
+ unsigned int vaddr = 0;
+ if (chip < 0 || chip >= NUM_SUNZILOG) {
+ prom_printf("SunZilog: Illegal chip number %d in get_zs.\n", chip);
+ prom_halt();
+ }
+
+#ifndef CONFIG_SUN3X
+ /* sun3 OBIO version */
+ /* Grrr, these have to be hardcoded aieee */
+ switch(chip) {
+ case 0:
+ for(vaddr = 0xfe00000; vaddr < (0xfe00000 +
+ SUN3_PMEG_SIZE); vaddr += SUN3_PTE_SIZE) {
+ unsigned long iopte;
+
+ iopte = sun3_get_pte(vaddr);
+ if(!(iopte & SUN3_PAGE_TYPE_IO)) /* this an io page? */
+ continue;
+
+ if(((iopte & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT) ==
+ 0x20000) {
+ break;
+ }
+ }
+ break;
+ case 1:
+ for(vaddr = 0xfe00000; vaddr < (0xfe00000 +
+ SUN3_PMEG_SIZE); vaddr += SUN3_PTE_SIZE) {
+
+ unsigned long iopte;
+
+ iopte = sun3_get_pte(vaddr);
+ if(!(iopte & SUN3_PAGE_TYPE_IO)) /* this an io page? */
+ continue;
+
+ if(((iopte & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT) ==
+ 0) {
+ break;
+ }
+ }
+ break;
+ };
+#else
+ /* sun3x is a wee bit cleaner. :) */
+ switch(chip) {
+ case 0:
+ vaddr = SUN3X_ZS2;
+ break;
+
+ case 1:
+ vaddr = SUN3X_ZS1;
+ break;
+ }
+#endif
+
+ if(!vaddr)
+ panic("get_zs whee no serial chip mappable");
+
+ return (struct zilog_layout *)(unsigned long) vaddr;
+}
+
+static int __devinit zs_probe(void)
+#else
static int __devinit zs_probe(struct of_device *op, const struct of_device_id *match)
+#endif
{
static int inst;
struct uart_sunzilog_port *up;
@@ -1325,51 +1441,70 @@ static int __devinit zs_probe(struct of_
int err;
keyboard_mouse = 0;
+#if defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
+ sunzilog_chip_regs[inst] = get_zs(inst);
+ if(inst)
+ keyboard_mouse = 1;
+#else
if (of_find_property(op->node, "keyboard", NULL))
keyboard_mouse = 1;
sunzilog_chip_regs[inst] = of_ioremap(&op->resource[0], 0,
sizeof(struct zilog_layout),
"zs");
+#endif /* CONFIG_SUN3 || CONFIG_SUN3X */
+
if (!sunzilog_chip_regs[inst])
return -ENOMEM;
rp = sunzilog_chip_regs[inst];
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
if (zilog_irq == -1)
zilog_irq = op->irqs[0];
+#endif
up = &sunzilog_port_table[inst * 2];
/* Channel A */
- up[0].port.mapbase = op->resource[0].start + 0x00;
up[0].port.membase = (void __iomem *) &rp->channelA;
- up[0].port.iotype = UPIO_MEM;
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
+ up[0].port.mapbase = op->resource[0].start + 0x00;
up[0].port.irq = op->irqs[0];
+ up[0].port.dev = &op->dev;
+#else
+ up[0].port.mapbase = (unsigned long)up[0].port.membase;
+ up[0].port.irq = zilog_irq;
+#endif
+ up[0].port.iotype = UPIO_MEM;
up[0].port.uartclk = ZS_CLOCK;
up[0].port.fifosize = 1;
up[0].port.ops = &sunzilog_pops;
up[0].port.type = PORT_SUNZILOG;
up[0].port.flags = 0;
up[0].port.line = (inst * 2) + 0;
- up[0].port.dev = &op->dev;
up[0].flags |= SUNZILOG_FLAG_IS_CHANNEL_A;
if (keyboard_mouse)
up[0].flags |= SUNZILOG_FLAG_CONS_KEYB;
sunzilog_init_hw(&up[0]);
/* Channel B */
- up[1].port.mapbase = op->resource[0].start + 0x04;
up[1].port.membase = (void __iomem *) &rp->channelB;
- up[1].port.iotype = UPIO_MEM;
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
+ up[1].port.mapbase = op->resource[0].start + 0x04;
up[1].port.irq = op->irqs[0];
+ up[1].port.dev = &op->dev;
+#else
+ up[1].port.mapbase = (unsigned long)up[1].port.membase;
+ up[1].port.irq = zilog_irq;
+#endif
+ up[1].port.iotype = UPIO_MEM;
up[1].port.uartclk = ZS_CLOCK;
up[1].port.fifosize = 1;
up[1].port.ops = &sunzilog_pops;
up[1].port.type = PORT_SUNZILOG;
up[1].port.flags = 0;
up[1].port.line = (inst * 2) + 1;
- up[1].port.dev = &op->dev;
up[1].flags |= 0;
if (keyboard_mouse)
up[1].flags |= SUNZILOG_FLAG_CONS_MOUSE;
@@ -1378,33 +1513,50 @@ static int __devinit zs_probe(struct of_
if (!keyboard_mouse) {
err = uart_add_one_port(&sunzilog_reg, &up[0].port);
if (err) {
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
of_iounmap(&op->resource[0],
rp, sizeof(struct zilog_layout));
+#endif
return err;
}
err = uart_add_one_port(&sunzilog_reg, &up[1].port);
if (err) {
uart_remove_one_port(&sunzilog_reg, &up[0].port);
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
of_iounmap(&op->resource[0],
rp, sizeof(struct zilog_layout));
+#endif
return err;
}
} else {
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
printk(KERN_INFO "%s: Keyboard at MMIO %lx (irq = %d) "
"is a zs\n",
op->dev.bus_id, up[0].port.mapbase, op->irqs[0]);
printk(KERN_INFO "%s: Mouse at MMIO %lx (irq = %d) "
"is a zs\n",
op->dev.bus_id, up[1].port.mapbase, op->irqs[0]);
+#else
+ printk(KERN_INFO "zs%d: Keyboard at MMIO %lx (irq = %d) "
+ "is a zs\n",
+ inst, up[0].port.mapbase, zilog_irq);
+ printk(KERN_INFO "zs%d: Mouse at MMIO %lx (irq = %d) "
+ "is a zs\n",
+ inst, up[1].port.mapbase, zilog_irq);
+#endif
}
+
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
dev_set_drvdata(&op->dev, &up[0]);
+#endif
inst++;
return 0;
}
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
static void __devexit zs_remove_one(struct uart_sunzilog_port *up)
{
if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up)) {
@@ -1445,13 +1597,17 @@ static struct of_platform_driver zs_driv
.probe = zs_probe,
.remove = __devexit_p(zs_remove),
};
+#endif /* !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X) */
static int __init sunzilog_init(void)
{
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
struct device_node *dp;
+#endif
int err, uart_count;
int num_keybms;
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
NUM_SUNZILOG = 0;
num_keybms = 0;
for_each_node_by_name(dp, "zs") {
@@ -1459,6 +1615,10 @@ static int __init sunzilog_init(void)
if (of_find_property(dp, "keyboard", NULL))
num_keybms++;
}
+#else
+ NUM_SUNZILOG = 2;
+ num_keybms = 1;
+#endif
uart_count = 0;
if (NUM_SUNZILOG) {
@@ -1481,6 +1641,7 @@ static int __init sunzilog_init(void)
sunserial_current_minor += uart_count;
}
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
err = of_register_driver(&zs_driver, &of_bus_type);
if (err)
@@ -1492,12 +1653,28 @@ static int __init sunzilog_init(void)
if (err)
goto out_unregister_driver;
}
+#else
+
+ zilog_irq = 6;
+ err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_DISABLED,
+ "zs", sunzilog_irq_chain);
+ if (err)
+ goto out_unregister_uart;
+
+ /* probe for two zs instances on sun3/3x */
+ zs_probe();
+ zs_probe();
+
+
+#endif
out:
return err;
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
out_unregister_driver:
of_unregister_driver(&zs_driver);
+#endif
out_unregister_uart:
if (NUM_SUNZILOG) {
@@ -1512,8 +1689,9 @@ out_free_tables:
static void __exit sunzilog_exit(void)
{
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_SUN3X)
of_unregister_driver(&zs_driver);
-
+#endif
if (zilog_irq != -1) {
free_irq(zilog_irq, sunzilog_irq_chain);
zilog_irq = -1;

View File

@ -1,23 +0,0 @@
Subject: [PATCH] m68k: Correct number of interrupts for Sun3
From: Sam Creasey <sammy@sammy.net>
Only attempt to initialize the amount of interrupts a sun3 actually has...
Signed-off-by: Sam Creasey <sammy@sammy.net>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/sun3/sun3ints.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-m68k-2.6.21.orig/arch/m68k/sun3/sun3ints.c
+++ linux-m68k-2.6.21/arch/m68k/sun3/sun3ints.c
@@ -103,7 +103,7 @@ void sun3_init_IRQ(void)
m68k_setup_auto_interrupt(sun3_inthandle);
m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7);
- m68k_setup_user_interrupt(VEC_USER, 192, NULL);
+ m68k_setup_user_interrupt(VEC_USER, 128, NULL);
request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL);
request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL);

View File

@ -1,30 +0,0 @@
Subject: [PATCH] m68k: Remove unnecessary m68k_memoffset export and init
From: Roman Zippel <zippel@linux-m68k.org>
Remove an unnecessary m68k_memoffset export and initialization
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/kernel/setup.c | 2 --
1 file changed, 2 deletions(-)
--- linux-m68k-2.6.21.orig/arch/m68k/kernel/setup.c
+++ linux-m68k-2.6.21/arch/m68k/kernel/setup.c
@@ -61,7 +61,6 @@ int m68k_num_memory;
int m68k_realnum_memory;
EXPORT_SYMBOL(m68k_realnum_memory);
unsigned long m68k_memoffset;
-EXPORT_SYMBOL(m68k_memoffset);
struct mem_info m68k_memory[NUM_MEMINFO];
EXPORT_SYMBOL(m68k_memory);
@@ -199,7 +198,6 @@ static void __init m68k_parse_bootinfo(c
(m68k_num_memory - 1));
m68k_num_memory = 1;
}
- m68k_memoffset = m68k_memory[0].addr-PAGE_OFFSET;
#endif
}

View File

@ -1,263 +0,0 @@
Subject: [PATCH] remove dead code in via-pmu68k
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
From: Johannes Berg <johannes@sipsolutions.net>
When suspend is ever implemented for pmu68k it really should follow the
generic pm_ops concept and not mirror the platform-specific /dev/pmu
device with ioctls on it. Hence, this patch removes the unused code there;
should the implementers need it they can look at via-pmu.c and/or the
history of the file.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/macintosh/via-pmu68k.c | 240 -----------------------------------------
1 file changed, 240 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/macintosh/via-pmu68k.c
+++ linux-m68k-2.6.21/drivers/macintosh/via-pmu68k.c
@@ -818,243 +818,3 @@ pmu_present(void)
{
return (pmu_kind != PMU_UNKNOWN);
}
-
-#if 0 /* needs some work for 68K */
-
-/*
- * This struct is used to store config register values for
- * PCI devices which may get powered off when we sleep.
- */
-static struct pci_save {
- u16 command;
- u16 cache_lat;
- u16 intr;
-} *pbook_pci_saves;
-static int n_pbook_pci_saves;
-
-static inline void
-pbook_pci_save(void)
-{
- int npci;
- struct pci_dev *pd = NULL;
- struct pci_save *ps;
-
- npci = 0;
- while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL)
- ++npci;
- n_pbook_pci_saves = npci;
- if (npci == 0)
- return;
- ps = kmalloc(npci * sizeof(*ps), GFP_KERNEL);
- pbook_pci_saves = ps;
- if (ps == NULL)
- return;
-
- pd = NULL;
- while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
- pci_read_config_word(pd, PCI_COMMAND, &ps->command);
- pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
- pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
- ++ps;
- --npci;
- }
-}
-
-static inline void
-pbook_pci_restore(void)
-{
- u16 cmd;
- struct pci_save *ps = pbook_pci_saves;
- struct pci_dev *pd = NULL;
- int j;
-
- while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
- if (ps->command == 0)
- continue;
- pci_read_config_word(pd, PCI_COMMAND, &cmd);
- if ((ps->command & ~cmd) == 0)
- continue;
- switch (pd->hdr_type) {
- case PCI_HEADER_TYPE_NORMAL:
- for (j = 0; j < 6; ++j)
- pci_write_config_dword(pd,
- PCI_BASE_ADDRESS_0 + j*4,
- pd->resource[j].start);
- pci_write_config_dword(pd, PCI_ROM_ADDRESS,
- pd->resource[PCI_ROM_RESOURCE].start);
- pci_write_config_word(pd, PCI_CACHE_LINE_SIZE,
- ps->cache_lat);
- pci_write_config_word(pd, PCI_INTERRUPT_LINE,
- ps->intr);
- pci_write_config_word(pd, PCI_COMMAND, ps->command);
- break;
- /* other header types not restored at present */
- }
- }
-}
-
-/*
- * Put the powerbook to sleep.
- */
-#define IRQ_ENABLE ((unsigned int *)0xf3000024)
-#define MEM_CTRL ((unsigned int *)0xf8000070)
-
-int powerbook_sleep(void)
-{
- int ret, i, x;
- static int save_backlight;
- static unsigned int save_irqen;
- unsigned long msr;
- unsigned int hid0;
- unsigned long p, wait;
- struct adb_request sleep_req;
-
- /* Notify device drivers */
- ret = blocking_notifier_call_chain(&sleep_notifier_list,
- PBOOK_SLEEP, NULL);
- if (ret & NOTIFY_STOP_MASK)
- return -EBUSY;
-
- /* Sync the disks. */
- /* XXX It would be nice to have some way to ensure that
- * nobody is dirtying any new buffers while we wait. */
- sys_sync();
-
- /* Turn off the display backlight */
- save_backlight = backlight_enabled;
- if (save_backlight)
- pmu_enable_backlight(0);
-
- /* Give the disks a little time to actually finish writing */
- for (wait = jiffies + (HZ/4); time_before(jiffies, wait); )
- mb();
-
- /* Disable all interrupts except pmu */
- save_irqen = in_le32(IRQ_ENABLE);
- for (i = 0; i < 32; ++i)
- if (i != vias->intrs[0].line && (save_irqen & (1 << i)))
- disable_irq(i);
- asm volatile("mtdec %0" : : "r" (0x7fffffff));
-
- /* Save the state of PCI config space for some slots */
- pbook_pci_save();
-
- /* Set the memory controller to keep the memory refreshed
- while we're asleep */
- for (i = 0x403f; i >= 0x4000; --i) {
- out_be32(MEM_CTRL, i);
- do {
- x = (in_be32(MEM_CTRL) >> 16) & 0x3ff;
- } while (x == 0);
- if (x >= 0x100)
- break;
- }
-
- /* Ask the PMU to put us to sleep */
- pmu_request(&sleep_req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T');
- while (!sleep_req.complete)
- mb();
- /* displacement-flush the L2 cache - necessary? */
- for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000)
- i = *(volatile int *)p;
- asleep = 1;
-
- /* Put the CPU into sleep mode */
- asm volatile("mfspr %0,1008" : "=r" (hid0) :);
- hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP;
- asm volatile("mtspr 1008,%0" : : "r" (hid0));
- local_save_flags(msr);
- msr |= MSR_POW | MSR_EE;
- local_irq_restore(msr);
- udelay(10);
-
- /* OK, we're awake again, start restoring things */
- out_be32(MEM_CTRL, 0x3f);
- pbook_pci_restore();
-
- /* wait for the PMU interrupt sequence to complete */
- while (asleep)
- mb();
-
- /* reenable interrupts */
- for (i = 0; i < 32; ++i)
- if (i != vias->intrs[0].line && (save_irqen & (1 << i)))
- enable_irq(i);
-
- /* Notify drivers */
- blocking_notifier_call_chain(&sleep_notifier_list, PBOOK_WAKE, NULL);
-
- /* reenable ADB autopoll */
- pmu_adb_autopoll(adb_dev_map);
-
- /* Turn on the screen backlight, if it was on before */
- if (save_backlight)
- pmu_enable_backlight(1);
-
- /* Wait for the hard disk to spin up */
-
- return 0;
-}
-
-/*
- * Support for /dev/pmu device
- */
-static int pmu_open(struct inode *inode, struct file *file)
-{
- return 0;
-}
-
-static ssize_t pmu_read(struct file *file, char *buf,
- size_t count, loff_t *ppos)
-{
- return 0;
-}
-
-static ssize_t pmu_write(struct file *file, const char *buf,
- size_t count, loff_t *ppos)
-{
- return 0;
-}
-
-static int pmu_ioctl(struct inode * inode, struct file *filp,
- u_int cmd, u_long arg)
-{
- int error;
- __u32 value;
-
- switch (cmd) {
- case PMU_IOC_SLEEP:
- return -ENOSYS;
- case PMU_IOC_GET_BACKLIGHT:
- return put_user(backlight_level, (__u32 *)arg);
- case PMU_IOC_SET_BACKLIGHT:
- error = get_user(value, (__u32 *)arg);
- if (!error)
- pmu_set_brightness(value);
- return error;
- case PMU_IOC_GET_MODEL:
- return put_user(pmu_kind, (__u32 *)arg);
- }
- return -EINVAL;
-}
-
-static const struct file_operations pmu_device_fops = {
- .read = pmu_read,
- .write = pmu_write,
- .ioctl = pmu_ioctl,
- .open = pmu_open,
-};
-
-static struct miscdevice pmu_device = {
- PMU_MINOR, "pmu", &pmu_device_fops
-};
-
-void pmu_device_init(void)
-{
- if (!via)
- return;
- if (misc_register(&pmu_device) < 0)
- printk(KERN_ERR "via-pmu68k: cannot register misc device.\n");
-}
-#endif /* CONFIG_PMAC_PBOOK */
-

View File

@ -1,205 +0,0 @@
Subject: [PATCH] Add Amiga Zorro bus modalias support
Add Amiga Zorro bus modalias support
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/net/a2065.c | 1 +
drivers/net/ariadne.c | 1 +
drivers/net/hydra.c | 1 +
drivers/net/zorro8390.c | 1 +
drivers/scsi/zorro7xx.c | 1 +
drivers/video/cirrusfb.c | 1 +
drivers/video/fm2fb.c | 1 +
drivers/zorro/zorro-sysfs.c | 11 +++++++++++
include/linux/mod_devicetable.h | 8 ++++++++
include/linux/zorro.h | 13 +------------
scripts/mod/file2alias.c | 15 +++++++++++++++
11 files changed, 42 insertions(+), 12 deletions(-)
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -708,6 +708,7 @@ static struct zorro_device_id a2065_zorr
{ ZORRO_PROD_AMERISTAR_A2065 },
{ 0 }
};
+MODULE_DEVICE_TABLE(zorro, a2065_zorro_tbl);
static struct zorro_driver a2065_driver = {
.name = "a2065",
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -148,6 +148,7 @@ static struct zorro_device_id ariadne_zo
{ ZORRO_PROD_VILLAGE_TRONIC_ARIADNE },
{ 0 }
};
+MODULE_DEVICE_TABLE(zorro, ariadne_zorro_tbl);
static struct zorro_driver ariadne_driver = {
.name = "ariadne",
--- a/drivers/net/hydra.c
+++ b/drivers/net/hydra.c
@@ -72,6 +72,7 @@ static struct zorro_device_id hydra_zorr
{ ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET },
{ 0 }
};
+MODULE_DEVICE_TABLE(zorro, hydra_zorro_tbl);
static struct zorro_driver hydra_driver = {
.name = "hydra",
--- a/drivers/net/zorro8390.c
+++ b/drivers/net/zorro8390.c
@@ -102,6 +102,7 @@ static struct zorro_device_id zorro8390_
{ ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, },
{ 0 }
};
+MODULE_DEVICE_TABLE(zorro, zorro8390_zorro_tbl);
static struct zorro_driver zorro8390_driver = {
.name = "zorro8390",
--- a/drivers/scsi/zorro7xx.c
+++ b/drivers/scsi/zorro7xx.c
@@ -65,6 +65,7 @@ static struct zorro_device_id zorro7xx_z
},
{ 0 }
};
+MODULE_DEVICE_TABLE(zorro, zorro7xx_zorro_tbl);
static int __devinit zorro7xx_init_one(struct zorro_dev *z,
const struct zorro_device_id *ent)
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -305,6 +305,7 @@ static const struct zorro_device_id cirr
},
{ 0 }
};
+MODULE_DEVICE_TABLE(zorro, cirrusfb_zorro_table);
static const struct {
zorro_id id2;
--- a/drivers/video/fm2fb.c
+++ b/drivers/video/fm2fb.c
@@ -217,6 +217,7 @@ static struct zorro_device_id fm2fb_devi
{ ZORRO_PROD_HELFRICH_RAINBOW_II },
{ 0 }
};
+MODULE_DEVICE_TABLE(zorro, fm2fb_devices);
static struct zorro_driver fm2fb_driver = {
.name = "fm2fb",
--- a/drivers/zorro/zorro-sysfs.c
+++ b/drivers/zorro/zorro-sysfs.c
@@ -84,6 +84,16 @@ static struct bin_attribute zorro_config
.read = zorro_read_config,
};
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct zorro_dev *z = to_zorro_dev(dev);
+
+ return sprintf(buf, "zorro:i%08X\n", z->id);
+}
+
+static DEVICE_ATTR(modalias, S_IRUGO, modalias_show, NULL);
+
void zorro_create_sysfs_dev_files(struct zorro_dev *z)
{
struct device *dev = &z->dev;
@@ -95,6 +105,7 @@ void zorro_create_sysfs_dev_files(struct
device_create_file(dev, &dev_attr_slotaddr);
device_create_file(dev, &dev_attr_slotsize);
device_create_file(dev, &dev_attr_resource);
+ device_create_file(dev, &dev_attr_modalias);
sysfs_create_bin_file(&dev->kobj, &zorro_config_attr);
}
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -333,4 +333,12 @@ struct parisc_device_id {
#define PA_HVERSION_ANY_ID 0xffff
#define PA_SVERSION_ANY_ID 0xffffffff
+
+struct zorro_device_id {
+ __u32 id; /* Device ID or ZORRO_WILDCARD */
+ kernel_ulong_t driver_data; /* Data private to the driver */
+};
+
+#define ZORRO_WILDCARD (0xffffffff) /* not official */
+
#endif /* LINUX_MOD_DEVICETABLE_H */
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -38,8 +38,6 @@
typedef __u32 zorro_id;
-#define ZORRO_WILDCARD (0xffffffff) /* not official */
-
/* Include the ID list */
#include <linux/zorro_ids.h>
@@ -116,6 +114,7 @@ struct ConfigDev {
#include <linux/init.h>
#include <linux/ioport.h>
+#include <linux/mod_devicetable.h>
#include <asm/zorro.h>
@@ -155,16 +154,6 @@ extern struct bus_type zorro_bus_type;
/*
- * Zorro device IDs
- */
-
-struct zorro_device_id {
- zorro_id id; /* Device ID or ZORRO_WILDCARD */
- unsigned long driver_data; /* Data private to the driver */
-};
-
-
- /*
* Zorro device drivers
*/
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -390,6 +390,7 @@ static int do_vio_entry(const char *file
static int do_i2c_entry(const char *filename, struct i2c_device_id *i2c, char *alias)
{
+ i2c->id = TO_NATIVE(i2c->id);
strcpy(alias, "i2c:");
ADD(alias, "id", 1, i2c->id);
return 1;
@@ -476,6 +477,16 @@ static int do_parisc_entry(const char *f
return 1;
}
+/* Looks like: zorro:iN. */
+static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
+ char *alias)
+{
+ id->id = TO_NATIVE(id->id);
+ strcpy(alias, "zorro:");
+ ADD(alias, "i", id->id != ZORRO_WILDCARD, id->id);
+ return 1;
+}
+
/* Ignore any prefix, eg. v850 prepends _ */
static inline int sym_is(const char *symbol, const char *name)
{
@@ -587,6 +598,10 @@ void handle_moddevtable(struct module *m
do_table(symval, sym->st_size,
sizeof(struct parisc_device_id), "parisc",
do_parisc_entry, mod);
+ else if (sym_is(symname, "__mod_zorro_device_table"))
+ do_table(symval, sym->st_size,
+ sizeof(struct zorro_device_id), "zorro",
+ do_zorro_entry, mod);
}
/* Now add out buffered information to the generated C source */

View File

@ -1,50 +0,0 @@
Subject: [PATCH] Amiga Zorro bus: kill resource_size_t warnings
Kill resource_size_t warnings by casting resource_size_t to unsigned long when
formatting Zorro bus resources, as they are always 32-bit.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/zorro/proc.c | 5 +++--
drivers/zorro/zorro-sysfs.c | 3 ++-
drivers/zorro/zorro.c | 3 ++-
3 files changed, 7 insertions(+), 4 deletions(-)
--- linux-m68k-2.6.21.orig/drivers/zorro/proc.c
+++ linux-m68k-2.6.21/drivers/zorro/proc.c
@@ -90,8 +90,9 @@ get_zorro_dev_info(char *buf, char **sta
for (slot = cnt = 0; slot < zorro_num_autocon && count > cnt; slot++) {
struct zorro_dev *z = &zorro_autocon[slot];
len = sprintf(buf, "%02x\t%08x\t%08lx\t%08lx\t%02x\n", slot,
- z->id, zorro_resource_start(z),
- zorro_resource_len(z), z->rom.er_Type);
+ z->id, (unsigned long)zorro_resource_start(z),
+ (unsigned long)zorro_resource_len(z),
+ z->rom.er_Type);
at += len;
if (at >= pos) {
if (!*start) {
--- linux-m68k-2.6.21.orig/drivers/zorro/zorro-sysfs.c
+++ linux-m68k-2.6.21/drivers/zorro/zorro-sysfs.c
@@ -42,7 +42,8 @@ static ssize_t zorro_show_resource(struc
struct zorro_dev *z = to_zorro_dev(dev);
return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n",
- zorro_resource_start(z), zorro_resource_end(z),
+ (unsigned long)zorro_resource_start(z),
+ (unsigned long)zorro_resource_end(z),
zorro_resource_flags(z));
}
--- linux-m68k-2.6.21.orig/drivers/zorro/zorro.c
+++ linux-m68k-2.6.21/drivers/zorro/zorro.c
@@ -164,7 +164,8 @@ static int __init zorro_init(void)
if (request_resource(zorro_find_parent_resource(z), &z->resource))
printk(KERN_ERR "Zorro: Address space collision on device %s "
"[%lx:%lx]\n",
- z->name, zorro_resource_start(z), zorro_resource_end(z));
+ z->name, (unsigned long)zorro_resource_start(z),
+ (unsigned long)zorro_resource_end(z));
sprintf(z->dev.bus_id, "%02x", i);
z->dev.parent = &zorro_bus.dev;
z->dev.bus = &zorro_bus_type;

View File

@ -1,21 +0,0 @@
Subject: [PATCH] zorro: Make sysfs `config' attribute read-only
zorro: Make the sysfs `config' attribute read-only, as you cannot write to it
(there's no .write function neither).
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/zorro/zorro-sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/zorro/zorro-sysfs.c
+++ b/drivers/zorro/zorro-sysfs.c
@@ -77,7 +77,7 @@ static ssize_t zorro_read_config(struct
static struct bin_attribute zorro_config_attr = {
.attr = {
.name = "config",
- .mode = S_IRUGO | S_IWUSR,
+ .mode = S_IRUGO,
.owner = THIS_MODULE
},
.size = sizeof(struct ConfigDev),

View File

@ -1,2 +1,22 @@
+ features/all/vserver/vs2.2.0-rc5.patch *_vserver *_xen-vserver
+ features/all/vserver/bindmount-dev.patch *_vserver *_xen-vserver
+ bugfix/m68k/2.6.24/m68k-cc-cross-prefix.diff
+ bugfix/m68k/2.6.24/m68k-initrd-fix.diff
+ bugfix/m68k/2.6.24/m68k-ARRAY_SIZE-cleanup.diff
+ bugfix/m68k/2.6.24/dio-ARRAY_SIZE-cleanup.diff
+ bugfix/m68k/2.6.24/atari-hades-pci-balance-iomap-and-iounmap.diff
+ bugfix/m68k/2.6.24/nubus-kill-drivers-nubus-nubus_syms-c.diff
+ bugfix/m68k/2.6.24/m68k-kill-arch-m68k-mac-mac_ksyms-c.diff
+ bugfix/m68k/2.6.24/m68k-kill-arch-m68k-hp300-ksyms-c.diff
+ bugfix/m68k/2.6.24/m68k-kill-arch-m68k-amiga-amiga_ksyms-c.diff
+ bugfix/m68k/2.6.24/m68k-kill-arch-m68k-atari-atari_ksyms-c.diff
+ bugfix/m68k/2.6.24/m68k-kill-arch-m68k-mvme16x-mvme16x_ksyms-c.diff
+ bugfix/m68k/2.6.24/mac68k-macii-adb-comment-correction.diff
+ bugfix/m68k/2.6.24/mac68k-remove-dead-code.diff
+ bugfix/m68k/2.6.24/mac68k-add-nubus-card-definitions-and-a-typo-fix.diff
+ bugfix/m68k/2.6.24/mac68k-remove-dead-MAC_ADBKEYCODES.diff
+ bugfix/m68k/2.6.24/633-atari_scc.diff
+ bugfix/m68k/2.6.24/130-adbraw.diff
+ bugfix/m68k/2.6.24/133-arch.diff
+ bugfix/m68k/2.6.24/134-atari-fat.diff
+ bugfix/m68k/2.6.24/141-ide.diff