[kernel] r11848 - dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26
Stephen Marenka
smarenka at alioth.debian.org
Wed Jul 16 20:58:16 UTC 2008
Author: smarenka
Date: Wed Jul 16 20:58:15 2008
New Revision: 11848
Log:
add linux-m68k patches
Added:
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amifb-add-ami_modedb-to-modelist.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-debug=mem.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-platform-device.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-platform-device2.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/apollo-missing-bootinfo.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-add-atafb_modedb-to-modelist.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-cfb16.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-line_length.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-aranym.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernat-is-broken.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernat.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernec.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-platform-device.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-rom-isa.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-scc-readd-CONFIG_ATARI_SCC.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-scc-readd-atari_SCC_init_done.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/blinux-list-is-subscribers-only.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/drivers-macintosh-possible-cleanups.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/drivers-video-c2p.c-add-MODULE_LICENSE.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/falconide-fix-ide_release_lock-imbalance.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-add-notes-to-init-data.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-add-support-for-ARAnyM-block-and-console-access.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-allnoconfig.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-allow-all-kernel-traps-to-be-handled-via-exception-fixups-all.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-amiga-possible-cleanups.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-apollo-remove-the-unused-APOLLO_ELPLUS-option.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-ariadne-use-netstats-in-net_device-structure.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-debug.c-possible-cleanups.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-remove-the-dead-ATARI_SCC-options.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-scc-checkpatch.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-scc.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-export-amiga_vblank.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-export-c2p.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-initcalls-should-return-ENODEV-if-device-not-found2.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-initrd-fix.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-mac-possible-cleanups.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-mac-remove-the-unused-ADB_KEYBOARD-option.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-make-multi_defconfig-the-default-defconfig.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-motorola-eliminate-NULL-test-and-memset-after-alloc_bootmem.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-noswap-linux-swap-h-needs-linux-pagemap-h.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-put-bss-at-end-of-data-section.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-q40-config.c-make-functions-static.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-AP1000-code.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-CVS-keywords.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-stale-ARCH_SUN4-define.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-traditional.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-replace-linux-68k-by-linux-m68k.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-scsi-HOST_C-cleanup.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-sun3-eliminate-NULL-test-and-memset-after-alloc_bootmem.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-sun3-possible-cleanups.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-update-defconfig-latest.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-vmlinux-std_sun3.lds.S_cleanup_use_PAGE_SIZE_macro.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/mac-platform-device.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/net-b44-no-pci.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-module-device-table.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-replace-deprecated-__initcall-with-equivalent-device_initcall.diff
dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-use-memory_read_from_buffer.diff
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amifb-add-ami_modedb-to-modelist.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amifb-add-ami_modedb-to-modelist.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,23 @@
+Subject: [PATCH] amifb: Register Amiga-specific video modes with sysfs
+
+Register the Amiga-specific video modes with sysfs, so you can see them in
+/sys/class/graphics/fb0/modes and change the video mode by writing to
+/sys/class/graphics/fb0/mode.
+
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/video/amifb.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/video/amifb.c
++++ b/drivers/video/amifb.c
+@@ -2383,6 +2383,9 @@ default_chipset:
+ goto amifb_error;
+ }
+
++ fb_videomode_to_modelist(ami_modedb, NUM_TOTAL_MODES,
++ &fb_info.modelist);
++
+ round_down_bpp = 0;
+ chipptr = chipalloc(fb_info.fix.smem_len+
+ SPRITEMEMSIZE+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-debug=mem.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-debug=mem.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,74 @@
+---
+ arch/m68k/amiga/config.c | 30 +++++++++++++++++++++---------
+ 1 file changed, 21 insertions(+), 9 deletions(-)
+
+--- a/arch/m68k/amiga/config.c
++++ b/arch/m68k/amiga/config.c
+@@ -104,6 +104,7 @@ static void amiga_reset(void);
+ extern void amiga_init_sound(void);
+ static void amiga_mem_console_write(struct console *co, const char *b,
+ unsigned int count);
++static void __init amiga_savekmsg_init(void);
+ #ifdef CONFIG_HEARTBEAT
+ static void amiga_heartbeat(int on);
+ #endif
+@@ -114,6 +115,8 @@ static struct console amiga_console_driv
+ .index = -1,
+ };
+
++static int __initdata amiga_enable_debug_mem;
++
+
+ /*
+ * Motherboard Resources present in all Amiga models
+@@ -459,6 +462,9 @@ void __init config_amiga(void)
+ /* initialize chipram allocator */
+ amiga_chip_init();
+
++ if (amiga_enable_debug_mem && AMIGAHW_PRESENT(CHIP_RAM))
++ amiga_savekmsg_init();
++
+ /* our beloved beeper */
+ if (AMIGAHW_PRESENT(AMI_AUDIO))
+ amiga_init_sound();
+@@ -777,18 +783,10 @@ static void amiga_mem_console_write(stru
+ }
+ }
+
+-static int __init amiga_savekmsg_setup(char *arg)
++static void __init amiga_savekmsg_init(void)
+ {
+ 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;
+@@ -797,6 +795,20 @@ static int __init amiga_savekmsg_setup(c
+
+ amiga_console_driver.write = amiga_mem_console_write;
+ register_console(&amiga_console_driver);
++}
++
++static int __init amiga_savekmsg_setup(char *arg)
++{
++ if (!MACH_IS_AMIGA || strcmp(arg, "mem"))
++ goto done;
++
++ if (!AMIGAHW_PRESENT(CHIP_RAM)) {
++ printk("Warning: no chipram present for debugging\n");
++ amiga_enable_debug_mem = 1;
++ goto done;
++ }
++
++ amiga_savekmsg_init();
+
+ done:
+ return 0;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-platform-device.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-platform-device.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,191 @@
+
+static int __init xxx_probe(struct platform_device *pdev)
+{
+ regs = platform_get_resource(pdev, IORESOURCE_MEM, CTRL_IOMEM_ID);
+ fifo = platform_get_resource(pdev, IORESOURCE_MEM, FIFO_IOMEM_ID);
+ if (!regs || !fifo)
+ return -ENXIO;
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
+
+
+
+
+ platform_set_drvdata(pdev, xxx);
+
+
+
+
+
+
+
+
+}
+
+static int __exit xxx_remove(struct platform_device *pdev)
+{
+ xxx = platform_get_drvdata(pdev);
+
+ platform_set_drvdata(pdev, NULL);
+
+
+ return 0;
+}
+
+static struct platform_driver xxx_driver = {
+ .remove = __exit_p(xxx_remove),
+ .driver = {
+ .name = "xxx",
+ },
+};
+
+static int __init xxx_init(void)
+{
+ return platform_driver_probe(&xxx_driver, xxx_probe);
+}
+module_init(xxx_init);
+
+static void __exit xxx_exit(void)
+{
+ platform_driver_unregister(&xxx_driver);
+}
+module_exit(xxx_exit);
+
+arch/m68k/amiga/amiints.c: if (AMIGAHW_PRESENT(PCMCIA))
+arch/m68k/amiga/chipram.c: if (!AMIGAHW_PRESENT(CHIP_RAM))
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(name)) \
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(ZORRO))
+arch/m68k/amiga/config.c: printk("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : "");
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(A3000_CLK)) {
+arch/m68k/amiga/config.c: } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(ZORRO3)) {
+arch/m68k/amiga/config.c: if (amiga_enable_debug_mem && AMIGAHW_PRESENT(CHIP_RAM))
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(AMI_AUDIO))
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(MAGIC_REKICK))
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(A3000_CLK)) {
+arch/m68k/amiga/config.c: } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(A3000_CLK)) {
+arch/m68k/amiga/config.c: } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
+arch/m68k/amiga/config.c: if (!AMIGAHW_PRESENT(CHIP_RAM)) {
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(CHIP_RAM))
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(AMI_VIDEO)) {
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(name)) \
+arch/m68k/amiga/config.c: if (AMIGAHW_PRESENT(ZORRO))
+arch/m68k/amiga/config.c: AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
+arch/m68k/kernel/setup.c: if (MACH_IS_AMIGA && AMIGAHW_PRESENT(GG2_ISA)) {
+arch/m68k/kernel/setup.c: if (MACH_IS_AMIGA && AMIGAHW_PRESENT(PCMCIA)) {
+drivers/block/amiflop.c: if (!AMIGAHW_PRESENT(AMI_FLOPPY))
+drivers/char/amiserial.c: if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL))
+drivers/ide/legacy/gayle.c: if ((a4000 = AMIGAHW_PRESENT(A4000_IDE)) || AMIGAHW_PRESENT(A1200_IDE))
+drivers/input/keyboard/amikbd.c: if (!AMIGAHW_PRESENT(AMI_KEYBOARD))
+drivers/input/mouse/amimouse.c: if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_MOUSE))
+drivers/net/apne.c: if ( !(AMIGAHW_PRESENT(PCMCIA)) )
+drivers/parport/parport_amiga.c: if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_PARALLEL))
+drivers/scsi/a3000.c: if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(A3000_SCSI))
+drivers/scsi/a4000t.c: if (!(MACH_IS_AMIGA && AMIGAHW_PRESENT(A4000_SCSI)))
+drivers/video/amifb.c: if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_VIDEO))
+drivers/video/amifb.c: if (AMIGAHW_PRESENT(AMBER_FF))
+drivers/video/amifb.c: } else if (AMIGAHW_PRESENT(AGNUS_HR_PAL) ||
+drivers/video/amifb.c: AMIGAHW_PRESENT(AGNUS_HR_NTSC)) {
+drivers/video/amifb.c: } else if (AMIGAHW_PRESENT(AGNUS_HR_PAL) ||
+drivers/video/amifb.c: AMIGAHW_PRESENT(AGNUS_HR_NTSC)) {
+drivers/zorro/proc.c: if (MACH_IS_AMIGA && AMIGAHW_PRESENT(ZORRO)) {
+drivers/zorro/zorro.c: if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
+drivers/zorro/zorro.c: if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
+drivers/zorro/zorro.c: zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
+include/asm-m68k/amigahw.h:#define AMIGAHW_PRESENT(name) (amiga_hw_present.name)
+sound/oss/dmasound/dmasound_paula.c: if (MACH_IS_AMIGA && AMIGAHW_PRESENT(AMI_AUDIO)) {
+---
+ arch/m68k/amiga/Makefile | 2 -
+ arch/m68k/amiga/platform.c | 73 +++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 74 insertions(+), 1 deletion(-)
+
+--- 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
++obj-y := config.o amiints.o cia.o chipram.o amisound.o platform.o
+
+ obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
+--- /dev/null
++++ b/arch/m68k/amiga/platform.c
+@@ -0,0 +1,73 @@
++/*
++ * Copyright (C) 2007 Geert Uytterhoeven
++ *
++ * 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/platform_device.h>
++#include <linux/mm.h> // FIXME show_mem()
++
++#include <asm/amigahw.h>
++
++
++static struct platform_device amiga_serial = {
++ .name = "amiga-serial",
++ .id = -1,
++};
++
++static int __init amiga_init_devices(void)
++{
++ if (AMIGAHW_PRESENT(AMI_FLOPPY))
++ platform_device_register_simple("amiga-floppy", -1, NULL, 0);
++
++ if (AMIGAHW_PRESENT(AMI_SERIAL))
++ platform_device_register(&amiga_serial);
++
++#if 0
++ /* video hardware */
++[ ] AMIGAHW_PRESENT(AMI_VIDEO); /* Amiga Video */
++[ ] AMIGAHW_PRESENT(AMI_BLITTER); /* Amiga Blitter */
++[ ] AMIGAHW_PRESENT(AMBER_FF); /* Amber Flicker Fixer */
++ /* sound hardware */
++[ ] AMIGAHW_PRESENT(AMI_AUDIO); /* Amiga Audio */
++ /* disk storage interfaces */
++[ ] AMIGAHW_PRESENT(AMI_FLOPPY); /* Amiga Floppy */
++[ ] AMIGAHW_PRESENT(A3000_SCSI); /* SCSI (wd33c93, A3000 alike) */
++[ ] AMIGAHW_PRESENT(A4000_SCSI); /* SCSI (ncr53c710, A4000T alike) */
++[ ] AMIGAHW_PRESENT(A1200_IDE); /* IDE (A1200 alike) */
++[ ] AMIGAHW_PRESENT(A4000_IDE); /* IDE (A4000 alike) */
++[ ] AMIGAHW_PRESENT(CD_ROM); /* CD ROM drive */
++ /* other I/O hardware */
++[ ] AMIGAHW_PRESENT(AMI_KEYBOARD); /* Amiga Keyboard */
++[ ] AMIGAHW_PRESENT(AMI_MOUSE); /* Amiga Mouse */
++[ ] AMIGAHW_PRESENT(AMI_SERIAL); /* Amiga Serial */
++[ ] AMIGAHW_PRESENT(AMI_PARALLEL); /* Amiga Parallel */
++ /* real time clocks */
++[ ] AMIGAHW_PRESENT(A2000_CLK); /* Hardware Clock (A2000 alike) */
++[ ] AMIGAHW_PRESENT(A3000_CLK); /* Hardware Clock (A3000 alike) */
++ /* supporting hardware */
++[ ] AMIGAHW_PRESENT(CHIP_RAM); /* Chip RAM */
++[ ] AMIGAHW_PRESENT(PAULA); /* Paula (8364) */
++[ ] AMIGAHW_PRESENT(DENISE); /* Denise (8362) */
++[ ] AMIGAHW_PRESENT(DENISE_HR); /* Denise (8373) */
++[ ] AMIGAHW_PRESENT(LISA); /* Lisa (8375) */
++[ ] AMIGAHW_PRESENT(AGNUS_PAL); /* Normal/Fat PAL Agnus (8367/8371) */
++[ ] AMIGAHW_PRESENT(AGNUS_NTSC); /* Normal/Fat NTSC Agnus (8361/8370) */
++[ ] AMIGAHW_PRESENT(AGNUS_HR_PAL); /* Fat Hires PAL Agnus (8372) */
++[ ] AMIGAHW_PRESENT(AGNUS_HR_NTSC); /* Fat Hires NTSC Agnus (8372) */
++[ ] AMIGAHW_PRESENT(ALICE_PAL); /* PAL Alice (8374) */
++[ ] AMIGAHW_PRESENT(ALICE_NTSC); /* NTSC Alice (8374) */
++[ ] AMIGAHW_PRESENT(MAGIC_REKICK); /* A3000 Magic Hard Rekick */
++[ ] AMIGAHW_PRESENT(PCMCIA); /* PCMCIA Slot */
++[ ] AMIGAHW_PRESENT(GG2_ISA); /* GG2 Zorro2ISA Bridge */
++[ ] AMIGAHW_PRESENT(ZORRO); /* Zorro AutoConfig */
++[ ] AMIGAHW_PRESENT(ZORRO3); /* Zorro III */
++#endif
++
++ return 0;
++}
++
++device_initcall(amiga_init_devices);
++
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-platform-device2.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/amiga-platform-device2.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,32 @@
+---
+ arch/m68k/amiga/platform.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+--- a/arch/m68k/amiga/platform.c
++++ b/arch/m68k/amiga/platform.c
+@@ -12,9 +12,23 @@
+ #include <asm/amigahw.h>
+
+
++static struct resource amiga_serial_resources[] = {
++ {
++ /*
++ * We request SERDAT and SERPER only, because the serial
++ * registers are too spread over the custom register space
++ */
++ .start = CUSTOM_PHYSADDR+0x30,
++ .end = CUSTOM_PHYSADDR+0x33,
++ .flags = IORESOURCE_MEM,
++ }
++};
++
+ static struct platform_device amiga_serial = {
+- .name = "amiga-serial",
+- .id = -1,
++ .name = "amiga-serial",
++ .id = -1,
++ .num_resources = ARRAY_SIZE(amiga_serial_resources),
++ .resource = amiga_serial_resources,
+ };
+
+ static int __init amiga_init_devices(void)
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/apollo-missing-bootinfo.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/apollo-missing-bootinfo.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,31 @@
+Subject: [PATCH] m68k/apollo: Add missing call to apollo_parse_bootinfo()
+
+Add the missing call to apollo_parse_bootinfo(), which had been lost from a
+big Apollo support patch by Peter De Schrijver in 1999.
+
+Thanks to Adrian Bunk for noticing!
+
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/kernel/setup.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/m68k/kernel/setup.c
++++ b/arch/m68k/kernel/setup.c
+@@ -122,6 +122,7 @@ extern int bvme6000_parse_bootinfo(const
+ extern int mvme16x_parse_bootinfo(const struct bi_record *);
+ extern int mvme147_parse_bootinfo(const struct bi_record *);
+ extern int hp300_parse_bootinfo(const struct bi_record *);
++extern int apollo_parse_bootinfo(const struct bi_record *);
+
+ extern void config_amiga(void);
+ extern void config_atari(void);
+@@ -189,6 +190,8 @@ static void __init m68k_parse_bootinfo(c
+ unknown = mvme147_parse_bootinfo(record);
+ else if (MACH_IS_HP300)
+ unknown = hp300_parse_bootinfo(record);
++ else if (MACH_IS_APOLLO)
++ unknown = apollo_parse_bootinfo(record);
+ else
+ unknown = 1;
+ }
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-add-atafb_modedb-to-modelist.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-add-atafb_modedb-to-modelist.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,23 @@
+Subject: [PATCH] atafb: Register Atari-specific video modes with sysfs
+
+Register the Atari-specific video modes with sysfs, so you can see them in
+/sys/class/graphics/fb0/modes and change the video mode by writing to
+/sys/class/graphics/fb0/mode.
+
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/video/atafb.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/video/atafb.c
++++ b/drivers/video/atafb.c
+@@ -3230,6 +3230,9 @@ int __init atafb_init(void)
+ return -EINVAL;
+ }
+
++ fb_videomode_to_modelist(atafb_modedb, NUM_TOTAL_MODES,
++ &fb_info.modelist);
++
+ atafb_set_disp(&fb_info);
+
+ fb_alloc_cmap(&(fb_info.cmap), 1 << fb_info.var.bits_per_pixel, 0);
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-cfb16.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-cfb16.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,48 @@
+---
+ drivers/video/atafb.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+--- a/drivers/video/atafb.c
++++ b/drivers/video/atafb.c
+@@ -2549,6 +2549,13 @@ static void atafb_fillrect(struct fb_inf
+ if (!rect->width || !rect->height)
+ return;
+
++#ifdef ATAFB_FALCON
++ if (info->var.bits_per_pixel == 16) {
++ cfb_fillrect(info, rect);
++ return;
++ }
++#endif
++
+ /*
+ * We could use hardware clipping but on many cards you get around
+ * hardware clipping by writing to framebuffer directly.
+@@ -2583,6 +2590,13 @@ static void atafb_copyarea(struct fb_inf
+ u32 dx, dy, sx, sy, width, height;
+ int rev_copy = 0;
+
++#ifdef ATAFB_FALCON
++ if (info->var.bits_per_pixel == 16) {
++ cfb_copyarea(info, area);
++ return;
++ }
++#endif
++
+ /* clip the destination */
+ x2 = area->dx + area->width;
+ y2 = area->dy + area->height;
+@@ -2629,6 +2643,13 @@ static void atafb_imageblit(struct fb_in
+ const char *src;
+ u32 dx, dy, width, height, pitch;
+
++#ifdef ATAFB_FALCON
++ if (info->var.bits_per_pixel == 16) {
++ cfb_imageblit(info, image);
++ return;
++ }
++#endif
++
+ /*
+ * We could use hardware clipping but on many cards you get around
+ * hardware clipping by writing to framebuffer directly like we are
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-line_length.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atafb-line_length.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,69 @@
+---
+ drivers/video/atafb.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+--- a/drivers/video/atafb.c
++++ b/drivers/video/atafb.c
+@@ -614,7 +614,7 @@ static int tt_encode_fix(struct fb_fix_s
+ fix->xpanstep = 0;
+ fix->ypanstep = 1;
+ fix->ywrapstep = 0;
+- fix->line_length = 0;
++ fix->line_length = par->next_line;
+ fix->accel = FB_ACCEL_ATARIBLITT;
+ return 0;
+ }
+@@ -917,8 +917,10 @@ static int falcon_encode_fix(struct fb_f
+ /* Is this ok or should it be DIRECTCOLOR? */
+ fix->visual = FB_VISUAL_TRUECOLOR;
+ fix->xpanstep = 2;
++ /* FIXME: cfb driver needs line_length */
++ fix->line_length = (par->hw.falcon.line_width + par->hw.falcon.line_offset) * par->hw.falcon.bpp / 8;
++ printk(KERN_INFO "atafb: falcon_encode_fix -- line_length = %d\n", fix->line_length);
+ }
+- fix->line_length = 0;
+ fix->accel = FB_ACCEL_ATARIBLITT;
+ return 0;
+ }
+@@ -1852,7 +1854,7 @@ static int stste_encode_fix(struct fb_fi
+ fix->ypanstep = 0;
+ }
+ fix->ywrapstep = 0;
+- fix->line_length = 0;
++ fix->line_length = par->next_line;
+ fix->accel = FB_ACCEL_ATARIBLITT;
+ return 0;
+ }
+@@ -2169,7 +2171,7 @@ static int ext_encode_fix(struct fb_fix_
+ fix->xpanstep = 0;
+ fix->ypanstep = 0;
+ fix->ywrapstep = 0;
+- fix->line_length = 0;
++ fix->line_length = par->next_line;
+ return 0;
+ }
+
+@@ -2551,6 +2553,7 @@ static void atafb_fillrect(struct fb_inf
+
+ #ifdef ATAFB_FALCON
+ if (info->var.bits_per_pixel == 16) {
++printk("fix->line_length = %u, cfb_fillrect\n", info->fix.line_length);
+ cfb_fillrect(info, rect);
+ return;
+ }
+@@ -2592,6 +2595,7 @@ static void atafb_copyarea(struct fb_inf
+
+ #ifdef ATAFB_FALCON
+ if (info->var.bits_per_pixel == 16) {
++printk("fix->line_length = %u, cfb_copyarea\n", info->fix.line_length);
+ cfb_copyarea(info, area);
+ return;
+ }
+@@ -2645,6 +2649,7 @@ static void atafb_imageblit(struct fb_in
+
+ #ifdef ATAFB_FALCON
+ if (info->var.bits_per_pixel == 16) {
++printk("fix->line_length = %u, cfb_imageblit\n", info->fix.line_length);
+ cfb_imageblit(info, image);
+ return;
+ }
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-aranym.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-aranym.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,534 @@
+Subject: [PATCH] m68k: Atari ARAnyM support
+
+From: Michael Schmitz <schmitz at 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 at 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 | 284 +++++++++++++++++++++++++++++++++++++++++++++
+ arch/m68k/kernel/setup.c | 5
+ drivers/net/Kconfig | 8 +
+ include/asm-m68k/natfeat.h | 22 +++
+ 8 files changed, 455 insertions(+)
+
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -270,6 +270,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
+--- a/arch/m68k/Makefile
++++ b/arch/m68k/Makefile
+@@ -76,6 +76,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
++++ b/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
++++ b/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 at 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 <linux/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;
++
++ pr_info("NatFeats found (%s, %lu.%lu)\n", buf, version >> 16,
++ version & 0xffff);
++
++ mach_power_off = nf_poweroff;
++}
+--- /dev/null
++++ b/arch/m68k/emu/nfeth.c
+@@ -0,0 +1,284 @@
++/*
++ * 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>
++#include <asm/virtconvert.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)");
++*/
++
++
++static long nfEtherID;
++static int nfEtherIRQ;
++
++struct nfeth_private {
++ int ethX;
++ struct net_device_stats stats;
++};
++
++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));
++
++ pr_debug(DRV_NAME ": open %d\n", res);
++
++ /* 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);
++
++ pr_debug(DRV_NAME ": recv_packet: %i\n", pktlen);
++
++ if (!pktlen) {
++ pr_debug(DRV_NAME ": recv_packet: pktlen == 0\n");
++ priv->stats.rx_errors++;
++ return;
++ }
++
++ skb = dev_alloc_skb(pktlen + 2);
++ if (!skb) {
++ pr_debug(DRV_NAME
++ ": recv_packet: out of mem (buf_alloc failed)\n");
++ 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;
++
++ pr_debug(DRV_NAME ": send %d bytes\n", len);
++ 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];
++ DECLARE_MAC_BUF(macfmt);
++ 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;
++
++ 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));
++
++ pr_info("%s: nfeth addr:%s (%s) HWaddr:%s\n", dev->name, host_ip,
++ local_ip, print_mac(macfmt, 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);
++ pr_info("nfeth API %lu\n", ver);
++
++ nfEtherIRQ = nf_call(nfEtherID + XIF_INTLEVEL);
++ if (request_irq(nfEtherIRQ, nfeth_interrupt, IRQF_SHARED,
++ "eth emu", nfeth_interrupt)) {
++ printk(KERN_ERR "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);
+--- a/arch/m68k/kernel/setup.c
++++ b/arch/m68k/kernel/setup.c
+@@ -40,6 +40,7 @@
+ #ifdef CONFIG_SUN3X
+ #include <asm/dvma.h>
+ #endif
++#include <asm/natfeat.h>
+
+ #if !FPSTATESIZE || !NR_IRQS
+ #warning No CPU/platform type selected, your kernel will not work!
+@@ -324,6 +325,10 @@ void __init setup_arch(char **cmdline_p)
+ panic("No configuration setup");
+ }
+
++#ifdef CONFIG_NATFEAT
++ nf_init();
++#endif
++
+ paging_init();
+
+ #ifndef CONFIG_SUN3
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -414,6 +414,14 @@ config ATARILANCE
+ on the AMD Lance chipset: RieblCard (with or without battery), or
+ PAMCard VME (also the version by Rhotron, with different addresses).
+
++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 SUN3 || SUN3X
+--- /dev/null
++++ b/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 */
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernat-is-broken.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernat-is-broken.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,623 @@
+
+FIXME marked it broken for now, until the remaining issues are fixed.
+
+---
+ drivers/net/Kconfig | 2
+ drivers/net/atari_91C111.c | 208 ++++++++++++++++++++++-----------------------
+ 2 files changed, 105 insertions(+), 105 deletions(-)
+
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -426,7 +426,7 @@ config ATARI_ETHERNAT
+ tristate "Atari EtherNAT Ethernet support"
+ select CRC32
+ select MII
+- depends on NET_ETHERNET && ATARI
++ depends on NET_ETHERNET && ATARI && BROKEN
+ help
+ Say Y to include support for the EtherNAT network adapter for the
+ CT/60 extension port. The driver works by polling instead of
+--- a/drivers/net/atari_91C111.c
++++ b/drivers/net/atari_91C111.c
+@@ -231,7 +231,7 @@ static void PRINT_PKT(u_char *buf, int l
+ spin_lock_irq(&lp->lock); \
+ mask = SMC_GET_INT_MASK(); \
+ mask |= (x); \
+- SMC_SET_INT_MASK(mask); \
++ SMC_SET_INT_MASK(lp, mask); \
+ spin_unlock_irq(&lp->lock); \
+ } while (0)
+
+@@ -241,7 +241,7 @@ static void PRINT_PKT(u_char *buf, int l
+ spin_lock_irq(&lp->lock); \
+ mask = SMC_GET_INT_MASK(); \
+ mask &= ~(x); \
+- SMC_SET_INT_MASK(mask); \
++ SMC_SET_INT_MASK(lp, mask); \
+ spin_unlock_irq(&lp->lock); \
+ } while (0)
+
+@@ -345,8 +345,8 @@ static void smc_reset(struct net_device
+
+ /* Disable all interrupts, block TX tasklet */
+ spin_lock_irq(&lp->lock);
+- SMC_SELECT_BANK(2);
+- SMC_SET_INT_MASK(0);
++ SMC_SELECT_BANK(lp, 2);
++ SMC_SET_INT_MASK(lp, 0);
+ pending_skb = lp->pending_tx_skb;
+ lp->pending_tx_skb = NULL;
+ spin_unlock_irq(&lp->lock);
+@@ -362,15 +362,15 @@ static void smc_reset(struct net_device
+ * This resets the registers mostly to defaults, but doesn't
+ * affect EEPROM. That seems unnecessary
+ */
+- SMC_SELECT_BANK(0);
+- SMC_SET_RCR(RCR_SOFTRST);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_RCR(lp, RCR_SOFTRST);
+
+ /*
+ * Setup the Configuration Register
+ * This is necessary because the CONFIG_REG is not affected
+ * by a soft reset
+ */
+- SMC_SELECT_BANK(1);
++ SMC_SELECT_BANK(lp, 1);
+
+ cfg = CONFIG_DEFAULT;
+
+@@ -388,7 +388,7 @@ static void smc_reset(struct net_device
+ */
+ cfg |= CONFIG_EPH_POWER_EN;
+
+- SMC_SET_CONFIG(cfg);
++ SMC_SET_CONFIG(lp, cfg);
+
+ /* this should pause enough for the chip to be happy */
+ /*
+@@ -401,11 +401,11 @@ static void smc_reset(struct net_device
+ udelay(1);
+
+ /* Disable transmit and receive functionality */
+- SMC_SELECT_BANK(0);
+- SMC_SET_RCR(RCR_CLEAR);
+- SMC_SET_TCR(TCR_CLEAR);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_RCR(lp, RCR_CLEAR);
++ SMC_SET_TCR(lp, TCR_CLEAR);
+
+- SMC_SELECT_BANK(1);
++ SMC_SELECT_BANK(lp, 1);
+ ctl = SMC_GET_CTL() | CTL_LE_ENABLE;
+
+ /*
+@@ -417,11 +417,11 @@ static void smc_reset(struct net_device
+ ctl |= CTL_AUTO_RELEASE;
+ else
+ ctl &= ~CTL_AUTO_RELEASE;
+- SMC_SET_CTL(ctl);
++ SMC_SET_CTL(lp, ctl);
+
+ /* Reset the MMU */
+- SMC_SELECT_BANK(2);
+- SMC_SET_MMU_CMD(MC_RESET);
++ SMC_SELECT_BANK(lp, 2);
++ SMC_SET_MMU_CMD(lp, MC_RESET);
+ SMC_WAIT_MMU_BUSY();
+ }
+
+@@ -437,19 +437,19 @@ static void smc_enable(struct net_device
+ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
+
+ /* see the header file for options in TCR/RCR DEFAULT */
+- SMC_SELECT_BANK(0);
+- SMC_SET_TCR(lp->tcr_cur_mode);
+- SMC_SET_RCR(lp->rcr_cur_mode);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_TCR(lp, lp->tcr_cur_mode);
++ SMC_SET_RCR(lp, lp->rcr_cur_mode);
+
+- SMC_SELECT_BANK(1);
+- SMC_SET_MAC_ADDR(dev->dev_addr);
++ SMC_SELECT_BANK(lp, 1);
++ SMC_SET_MAC_ADDR(lp, dev->dev_addr);
+
+ /* now, enable interrupts */
+ mask = IM_EPH_INT|IM_RX_OVRN_INT|IM_RCV_INT;
+ if (lp->version >= (CHIP_91100 << 4))
+ mask |= IM_MDINT;
+- SMC_SELECT_BANK(2);
+- SMC_SET_INT_MASK(mask);
++ SMC_SELECT_BANK(lp, 2);
++ SMC_SET_INT_MASK(lp, mask);
+
+ /*
+ * From this point the register bank must _NOT_ be switched away
+@@ -472,8 +472,8 @@ static void smc_shutdown(struct net_devi
+
+ /* no more interrupts for me */
+ spin_lock_irq(&lp->lock);
+- SMC_SELECT_BANK(2);
+- SMC_SET_INT_MASK(0);
++ SMC_SELECT_BANK(lp, 2);
++ SMC_SET_INT_MASK(lp, 0);
+ pending_skb = lp->pending_tx_skb;
+ lp->pending_tx_skb = NULL;
+ spin_unlock_irq(&lp->lock);
+@@ -481,14 +481,14 @@ static void smc_shutdown(struct net_devi
+ dev_kfree_skb(pending_skb);
+
+ /* and tell the card to stay away from that nasty outside world */
+- SMC_SELECT_BANK(0);
+- SMC_SET_RCR(RCR_CLEAR);
+- SMC_SET_TCR(TCR_CLEAR);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_RCR(lp, RCR_CLEAR);
++ SMC_SET_TCR(lp, TCR_CLEAR);
+
+ #ifdef POWER_DOWN
+ /* finally, shut the chip down */
+- SMC_SELECT_BANK(1);
+- SMC_SET_CONFIG(SMC_GET_CONFIG() & ~CONFIG_EPH_POWER_EN);
++ SMC_SELECT_BANK(lp, 1);
++ SMC_SET_CONFIG(lp, SMC_GET_CONFIG() & ~CONFIG_EPH_POWER_EN);
+ #endif
+ }
+
+@@ -510,10 +510,10 @@ static inline void smc_rcv(struct net_d
+ }
+
+ /* read from start of packet */
+- SMC_SET_PTR(PTR_READ | PTR_RCV | PTR_AUTOINC);
++ SMC_SET_PTR(lp, PTR_READ | PTR_RCV | PTR_AUTOINC);
+
+ /* First two words are status and packet length */
+- SMC_GET_PKT_HDR(status, packet_len);
++ SMC_GET_PKT_HDR(lp, status, packet_len);
+ packet_len &= 0x07ff; /* mask off top bits */
+ DBG(2, "%s: RX PNR 0x%x STATUS 0x%04x LENGTH 0x%04x (%d)\n",
+ dev->name, packet_number, status,
+@@ -533,7 +533,7 @@ static inline void smc_rcv(struct net_d
+ status |= RS_TOOSHORT;
+ }
+ SMC_WAIT_MMU_BUSY();
+- SMC_SET_MMU_CMD(MC_RELEASE);
++ SMC_SET_MMU_CMD(lp, MC_RELEASE);
+ dev->stats.rx_errors++;
+ if (status & RS_ALGNERR)
+ dev->stats.rx_frame_errors++;
+@@ -563,7 +563,7 @@ static inline void smc_rcv(struct net_d
+ printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
+ dev->name);
+ SMC_WAIT_MMU_BUSY();
+- SMC_SET_MMU_CMD(MC_RELEASE);
++ SMC_SET_MMU_CMD(lp, MC_RELEASE);
+ dev->stats.rx_dropped++;
+ return;
+ }
+@@ -582,10 +582,10 @@ static inline void smc_rcv(struct net_d
+ */
+ data_len = packet_len - ((status & RS_ODDFRAME) ? 5 : 6);
+ data = skb_put(skb, data_len);
+- SMC_PULL_DATA(data, packet_len - 4);
++ SMC_PULL_DATA(lp, data, packet_len - 4);
+
+ SMC_WAIT_MMU_BUSY();
+- SMC_SET_MMU_CMD(MC_RELEASE);
++ SMC_SET_MMU_CMD(lp, MC_RELEASE);
+
+ PRINT_PKT(data, packet_len - 4);
+
+@@ -673,8 +673,8 @@ static void smc_hardware_send_pkt(unsign
+ }
+
+ /* point to the beginning of the packet */
+- SMC_SET_PN(packet_no);
+- SMC_SET_PTR(PTR_AUTOINC);
++ SMC_SET_PN(lp, packet_no);
++ SMC_SET_PTR(lp, PTR_AUTOINC);
+
+ buf = skb->data;
+ len = skb->len;
+@@ -686,10 +686,10 @@ static void smc_hardware_send_pkt(unsign
+ * Send the packet length (+6 for status words, length, and ctl.
+ * The card will pad to 64 bytes with zeroes if packet is too small.
+ */
+- SMC_PUT_PKT_HDR(0, len + 6);
++ SMC_PUT_PKT_HDR(lp, 0, len + 6);
+
+ /* send the actual data */
+- SMC_PUSH_DATA(buf, len & ~1);
++ SMC_PUSH_DATA(lp, buf, len & ~1);
+
+ /* Send final ctl word with the last byte if there is one */
+ SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG);
+@@ -706,7 +706,7 @@ static void smc_hardware_send_pkt(unsign
+ netif_stop_queue(dev);
+
+ /* queue the packet for TX */
+- SMC_SET_MMU_CMD(MC_ENQUEUE);
++ SMC_SET_MMU_CMD(lp, MC_ENQUEUE);
+ smc_special_unlock(&lp->lock);
+
+ dev->trans_start = jiffies;
+@@ -760,7 +760,7 @@ static int smc_hard_start_xmit(struct sk
+ smc_special_lock(&lp->lock);
+
+ /* now, try to allocate the memory */
+- SMC_SET_MMU_CMD(MC_ALLOC | numPages);
++ SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages);
+
+ /*
+ * Poll the chip for a short amount of time in case the
+@@ -770,7 +770,7 @@ static int smc_hard_start_xmit(struct sk
+ do {
+ status = SMC_GET_INT();
+ if (status & IM_ALLOC_INT) {
+- SMC_ACK_INT(IM_ALLOC_INT);
++ SMC_ACK_INT(lp, IM_ALLOC_INT);
+ break;
+ }
+ } while (--poll_count);
+@@ -816,11 +816,11 @@ static void smc_tx(struct net_device *de
+
+ /* select packet to read from */
+ saved_packet = SMC_GET_PN();
+- SMC_SET_PN(packet_no);
++ SMC_SET_PN(lp, packet_no);
+
+ /* read the first word (status word) from this packet */
+- SMC_SET_PTR(PTR_AUTOINC | PTR_READ);
+- SMC_GET_PKT_HDR(tx_status, pkt_len);
++ SMC_SET_PTR(lp, PTR_AUTOINC | PTR_READ);
++ SMC_GET_PKT_HDR(lp, tx_status, pkt_len);
+ DBG(2, "%s: TX STATUS 0x%04x PNR 0x%02x\n",
+ dev->name, tx_status, packet_no);
+
+@@ -844,16 +844,16 @@ static void smc_tx(struct net_device *de
+
+ /* kill the packet */
+ SMC_WAIT_MMU_BUSY();
+- SMC_SET_MMU_CMD(MC_FREEPKT);
++ SMC_SET_MMU_CMD(lp, MC_FREEPKT);
+
+ /* Don't restore Packet Number Reg until busy bit is cleared */
+ SMC_WAIT_MMU_BUSY();
+- SMC_SET_PN(saved_packet);
++ SMC_SET_PN(lp, saved_packet);
+
+ /* re-enable transmit */
+- SMC_SELECT_BANK(0);
+- SMC_SET_TCR(lp->tcr_cur_mode);
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_TCR(lp, lp->tcr_cur_mode);
++ SMC_SELECT_BANK(lp, 2);
+ }
+
+
+@@ -874,9 +874,9 @@ static void smc_mii_out(struct net_devic
+ else
+ mii_reg &= ~MII_MDO;
+
+- SMC_SET_MII(mii_reg);
++ SMC_SET_MII(lp, mii_reg);
+ udelay(MII_DELAY);
+- SMC_SET_MII(mii_reg | MII_MCLK);
++ SMC_SET_MII(lp, mii_reg | MII_MCLK);
+ udelay(MII_DELAY);
+ }
+ }
+@@ -888,15 +888,15 @@ static unsigned int smc_mii_in(struct ne
+ unsigned int mii_reg, mask, val;
+
+ mii_reg = SMC_GET_MII() & ~(MII_MCLK | MII_MDOE | MII_MDO);
+- SMC_SET_MII(mii_reg);
++ SMC_SET_MII(lp, mii_reg);
+
+ for (mask = 1 << (bits - 1), val = 0; mask; mask >>= 1) {
+ if (SMC_GET_MII() & MII_MDI)
+ val |= mask;
+
+- SMC_SET_MII(mii_reg);
++ SMC_SET_MII(lp, mii_reg);
+ udelay(MII_DELAY);
+- SMC_SET_MII(mii_reg | MII_MCLK);
++ SMC_SET_MII(lp, mii_reg | MII_MCLK);
+ udelay(MII_DELAY);
+ }
+
+@@ -912,7 +912,7 @@ static int smc_phy_read(struct net_devic
+ void __iomem *ioaddr = lp->base;
+ unsigned int phydata;
+
+- SMC_SELECT_BANK(3);
++ SMC_SELECT_BANK(lp, 3);
+
+ /* Idle - 32 ones */
+ smc_mii_out(dev, 0xffffffff, 32);
+@@ -924,12 +924,12 @@ static int smc_phy_read(struct net_devic
+ phydata = smc_mii_in(dev, 18);
+
+ /* Return to idle state */
+- SMC_SET_MII(SMC_GET_MII() & ~(MII_MCLK|MII_MDOE|MII_MDO));
++ SMC_SET_MII(lp, SMC_GET_MII() & ~(MII_MCLK|MII_MDOE|MII_MDO));
+
+ DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n",
+ __FUNCTION__, phyaddr, phyreg, phydata);
+
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 2);
+ return phydata;
+ }
+
+@@ -942,7 +942,7 @@ static void smc_phy_write(struct net_dev
+ struct smc_local *lp = netdev_priv(dev);
+ void __iomem *ioaddr = lp->base;
+
+- SMC_SELECT_BANK(3);
++ SMC_SELECT_BANK(lp, 3);
+
+ /* Idle - 32 ones */
+ smc_mii_out(dev, 0xffffffff, 32);
+@@ -951,12 +951,12 @@ static void smc_phy_write(struct net_dev
+ smc_mii_out(dev, 5 << 28 | phyaddr << 23 | phyreg << 18 | 2 << 16 | phydata, 32);
+
+ /* Return to idle state */
+- SMC_SET_MII(SMC_GET_MII() & ~(MII_MCLK|MII_MDOE|MII_MDO));
++ SMC_SET_MII(lp, SMC_GET_MII() & ~(MII_MCLK|MII_MDOE|MII_MDO));
+
+ DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n",
+ __FUNCTION__, phyaddr, phyreg, phydata);
+
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 2);
+ }
+
+ /*
+@@ -1029,9 +1029,9 @@ static int smc_phy_fixed(struct net_devi
+ smc_phy_write(dev, phyaddr, MII_BMCR, bmcr);
+
+ /* Re-Configure the Receive/Phy Control register */
+- SMC_SELECT_BANK(0);
+- SMC_SET_RPC(lp->rpc_cur_mode);
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_RPC(lp, lp->rpc_cur_mode);
++ SMC_SELECT_BANK(lp, 2);
+
+ return 1;
+ }
+@@ -1122,8 +1122,8 @@ static void smc_phy_check_media(struct n
+ lp->tcr_cur_mode &= ~TCR_SWFDUP;
+ }
+
+- SMC_SELECT_BANK(0);
+- SMC_SET_TCR(lp->tcr_cur_mode);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_TCR(lp, lp->tcr_cur_mode);
+ }
+ }
+
+@@ -1172,8 +1172,8 @@ static void smc_phy_configure(struct wor
+ PHY_INT_SPDDET | PHY_INT_DPLXDET);
+
+ /* Configure the Receive/Phy Control register */
+- SMC_SELECT_BANK(0);
+- SMC_SET_RPC(lp->rpc_cur_mode);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_RPC(lp, lp->rpc_cur_mode);
+
+ /* If the user requested no auto neg, then go set his request */
+ if (lp->mii.force_media) {
+@@ -1230,7 +1230,7 @@ static void smc_phy_configure(struct wor
+ smc_phy_check_media(dev, 1);
+
+ smc_phy_configure_exit:
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 2);
+ spin_unlock_irq(&lp->lock);
+ lp->work_pending = 0;
+ }
+@@ -1272,9 +1272,9 @@ static void smc_10bt_check_media(struct
+
+ old_carrier = netif_carrier_ok(dev) ? 1 : 0;
+
+- SMC_SELECT_BANK(0);
++ SMC_SELECT_BANK(lp, 0);
+ new_carrier = (SMC_GET_EPH_STATUS() & ES_LINK_OK) ? 1 : 0;
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 2);
+
+ if (init || (old_carrier != new_carrier)) {
+ if (!new_carrier) {
+@@ -1296,11 +1296,11 @@ static void smc_eph_interrupt(struct net
+
+ smc_10bt_check_media(dev, 0);
+
+- SMC_SELECT_BANK(1);
++ SMC_SELECT_BANK(lp, 1);
+ ctl = SMC_GET_CTL();
+- SMC_SET_CTL(ctl & ~CTL_LE_ENABLE);
+- SMC_SET_CTL(ctl);
+- SMC_SELECT_BANK(2);
++ SMC_SET_CTL(lp, ctl & ~CTL_LE_ENABLE);
++ SMC_SET_CTL(lp, ctl);
++ SMC_SELECT_BANK(lp, 2);
+ }
+
+ /*
+@@ -1326,7 +1326,7 @@ static irqreturn_t smc_interrupt(int irq
+
+ saved_pointer = SMC_GET_PTR();
+ mask = SMC_GET_INT_MASK();
+- SMC_SET_INT_MASK(0);
++ SMC_SET_INT_MASK(lp, 0);
+
+ /* set a timeout value, so I don't stay here forever */
+ timeout = MAX_IRQ_LOOPS;
+@@ -1336,9 +1336,9 @@ static irqreturn_t smc_interrupt(int irq
+
+ DBG(2, "%s: INT 0x%02x MASK 0x%02x MEM 0x%04x FIFO 0x%04x\n",
+ dev->name, status, mask,
+- ({ int meminfo; SMC_SELECT_BANK(0);
++ ({ int meminfo; SMC_SELECT_BANK(lp, 0);
+ meminfo = SMC_GET_MIR();
+- SMC_SELECT_BANK(2); meminfo; }),
++ SMC_SELECT_BANK(lp, 2); meminfo; }),
+ SMC_GET_FIFO());
+
+ status &= mask;
+@@ -1349,7 +1349,7 @@ static irqreturn_t smc_interrupt(int irq
+ /* do this before RX as it will free memory quickly */
+ DBG(3, "%s: TX int\n", dev->name);
+ smc_tx(dev);
+- SMC_ACK_INT(IM_TX_INT);
++ SMC_ACK_INT(lp, IM_TX_INT);
+ if (THROTTLE_TX_PKTS)
+ netif_wake_queue(dev);
+ } else if (status & IM_RCV_INT) {
+@@ -1364,9 +1364,9 @@ static irqreturn_t smc_interrupt(int irq
+ mask &= ~IM_TX_EMPTY_INT;
+
+ /* update stats */
+- SMC_SELECT_BANK(0);
++ SMC_SELECT_BANK(lp, 0);
+ card_stats = SMC_GET_COUNTER();
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 2);
+
+ /* single collisions */
+ dev->stats.collisions += card_stats & 0xF;
+@@ -1376,26 +1376,26 @@ static irqreturn_t smc_interrupt(int irq
+ dev->stats.collisions += card_stats & 0xF;
+ } else if (status & IM_RX_OVRN_INT) {
+ DBG(1, "%s: RX overrun (EPH_ST 0x%04x)\n", dev->name,
+- ({ int eph_st; SMC_SELECT_BANK(0);
++ ({ int eph_st; SMC_SELECT_BANK(lp, 0);
+ eph_st = SMC_GET_EPH_STATUS();
+- SMC_SELECT_BANK(2); eph_st; }) );
+- SMC_ACK_INT(IM_RX_OVRN_INT);
++ SMC_SELECT_BANK(lp, 2); eph_st; }) );
++ SMC_ACK_INT(lp, IM_RX_OVRN_INT);
+ dev->stats.rx_errors++;
+ dev->stats.rx_fifo_errors++;
+ } else if (status & IM_EPH_INT) {
+ smc_eph_interrupt(dev);
+ } else if (status & IM_MDINT) {
+- SMC_ACK_INT(IM_MDINT);
++ SMC_ACK_INT(lp, IM_MDINT);
+ smc_phy_interrupt(dev);
+ } else if (status & IM_ERCV_INT) {
+- SMC_ACK_INT(IM_ERCV_INT);
++ SMC_ACK_INT(lp, IM_ERCV_INT);
+ PRINTK("%s: UNSUPPORTED: ERCV INTERRUPT \n", dev->name);
+ }
+ } while (--timeout);
+
+ /* restore register states */
+- SMC_SET_PTR(saved_pointer);
+- SMC_SET_INT_MASK(mask);
++ SMC_SET_PTR(lp, saved_pointer);
++ SMC_SET_INT_MASK(lp, mask);
+ spin_unlock(&lp->lock);
+
+ if (timeout == MAX_IRQ_LOOPS)
+@@ -1441,10 +1441,10 @@ static void smc_timeout(struct net_devic
+ status = SMC_GET_INT();
+ mask = SMC_GET_INT_MASK();
+ fifo = SMC_GET_FIFO();
+- SMC_SELECT_BANK(0);
++ SMC_SELECT_BANK(lp, 0);
+ eph_st = SMC_GET_EPH_STATUS();
+ meminfo = SMC_GET_MIR();
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 2);
+ spin_unlock_irq(&lp->lock);
+ PRINTK( "%s: TX timeout (INT 0x%02x INTMASK 0x%02x "
+ "MEM 0x%04x FIFO 0x%04x EPH_ST 0x%04x)\n",
+@@ -1564,13 +1564,13 @@ static void smc_set_multicast_list(struc
+ }
+
+ spin_lock_irq(&lp->lock);
+- SMC_SELECT_BANK(0);
+- SMC_SET_RCR(lp->rcr_cur_mode);
++ SMC_SELECT_BANK(lp, 0);
++ SMC_SET_RCR(lp, lp->rcr_cur_mode);
+ if (update_multicast) {
+- SMC_SELECT_BANK(3);
+- SMC_SET_MCAST(multicast_table);
++ SMC_SELECT_BANK(lp, 3);
++ SMC_SET_MCAST(lp, multicast_table);
+ }
+- SMC_SELECT_BANK(2);
++ SMC_SELECT_BANK(lp, 2);
+ spin_unlock_irq(&lp->lock);
+ }
+
+@@ -1789,14 +1789,14 @@ static int __init smc_findirq(void __iom
+ * when done.
+ */
+ /* enable ALLOCation interrupts ONLY */
+- SMC_SELECT_BANK(2);
+- SMC_SET_INT_MASK(IM_ALLOC_INT);
++ SMC_SELECT_BANK(lp, 2);
++ SMC_SET_INT_MASK(lp, IM_ALLOC_INT);
+
+ /*
+ * Allocate 512 bytes of memory. Note that the chip was just
+ * reset so all the memory is available
+ */
+- SMC_SET_MMU_CMD(MC_ALLOC | 1);
++ SMC_SET_MMU_CMD(lp, MC_ALLOC | 1);
+
+ /*
+ * Wait until positive that the interrupt has been generated
+@@ -1817,7 +1817,7 @@ static int __init smc_findirq(void __iom
+ */
+
+ /* and disable all interrupts again */
+- SMC_SET_INT_MASK(0);
++ SMC_SET_INT_MASK(lp, 0);
+
+ /* and return what I found */
+ return probe_irq_off(cookie);
+@@ -1880,7 +1880,7 @@ static int __init smc_probe(struct net_d
+ * The above MIGHT indicate a device, but I need to write to
+ * further test this.
+ */
+- SMC_SELECT_BANK(0);
++ SMC_SELECT_BANK(lp, 0);
+ val = SMC_CURRENT_BANK();
+ if ((val & 0xFF00) != 0x3300) {
+ retval = -ENODEV;
+@@ -1893,7 +1893,7 @@ static int __init smc_probe(struct net_d
+ * register to bank 1, so I can access the base address
+ * register
+ */
+- SMC_SELECT_BANK(1);
++ SMC_SELECT_BANK(lp, 1);
+ val = SMC_GET_BASE();
+ val = ((val & 0x1F00) >> 3) << SMC_IO_SHIFT;
+ if (((unsigned int)ioaddr & (0x3e0 << SMC_IO_SHIFT)) != val) {
+@@ -1906,7 +1906,7 @@ static int __init smc_probe(struct net_d
+ * recognize. These might need to be added to later,
+ * as future revisions could be added.
+ */
+- SMC_SELECT_BANK(3);
++ SMC_SELECT_BANK(lp, 3);
+ revision_register = SMC_GET_REV();
+ DBG(2, "%s: revision = 0x%04x\n", CARDNAME, revision_register);
+ version_string = chip_ids[ (revision_register >> 4) & 0xF];
+@@ -1931,8 +1931,8 @@ static int __init smc_probe(struct net_d
+ spin_lock_init(&lp->lock);
+
+ /* Get the MAC address */
+- SMC_SELECT_BANK(1);
+- SMC_GET_MAC_ADDR(dev->dev_addr);
++ SMC_SELECT_BANK(lp, 1);
++ SMC_GET_MAC_ADDR(lp, dev->dev_addr);
+
+ /* now, reset the chip, and put it into a known state */
+ smc_reset(dev);
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernat.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernat.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,2572 @@
+From schmitz at opal.biophys.uni-duesseldorf.de Mon Oct 22 10:03:40 2007
+Date: Mon, 22 Oct 2007 09:27:52 +0200 (CEST)
+From: Michael Schmitz <schmitz at opal.biophys.uni-duesseldorf.de>
+To: Geert Uytterhoeven <geert at linux-m68k.org>
+Cc: Michael Schmitz <schmitz at opal.biophys.uni-duesseldorf.de>, linux-m68k at vger.kernel.org, cts at debian.org
+Subject: [PATCH] Atari EtherNAT (SMC91C111) driver
+
+Hi Geert,
+
+> On Sun, 21 Oct 2007, Michael Schmitz wrote:
+> > this patch is needed to make the Atari EtherNEC driver with the associated
+> > ROM port ISA I/O stuff compile again. This is relative to your quilt patch
+> > queue and git 2.6 as of yesterday. Please apply.
+>
+> Thanks, applied.
+
+Thanks - I'll have a few updates to this shortly, just noticed the
+multi-byte IO emulation (inw, inl etc.) that we discussed months ago had
+gone missing from the patch. That's what you get for keeping too many
+trees around.
+
+But first things first - I finally had enough time to work on the platform
+driver code I need for the SMC91C111 driver aka EtherNAT driver for the
+Falcon. Here's the patch - I could only test it so far on ARAnyM, meaning
+the driver correctly fails to load because the hardware cannot be found.
+Christian may be able to build the driver and test on his Falcon before I
+get mine set up.
+
+One thing that I am not entirely happy about is having the driver resource
+registered unconditionally in atari/config.c, regardless whether the
+driver is built or not. May I incude autoconf.h in the arch code? The
+other one is a kconfig issue - I need to select MMIO either as module or
+builtin, depending on how the EtherNAT driver is built. That does not
+appear to be automatic yet.
+
+Aside from that, at least something that can be tested.
+
+Signed-off-by: Michael Schmitz <schmitz at biophys.uni-duesseldorf.de>
+
+---
+ arch/m68k/atari/config.c | 41
+ drivers/net/Kconfig | 10
+ drivers/net/Makefile | 1
+ drivers/net/atari_91C111.c | 2440 +++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 2492 insertions(+)
+
+--- a/arch/m68k/atari/config.c
++++ b/arch/m68k/atari/config.c
+@@ -30,6 +30,7 @@
+ #include <linux/init.h>
+ #include <linux/delay.h>
+ #include <linux/ioport.h>
++#include <linux/platform_device.h>
+ #include <linux/vt_kern.h>
+ #include <linux/module.h>
+
+@@ -670,3 +671,43 @@ static int atari_get_hardware_list(char
+
+ return len;
+ }
++
++/*
++ * MSch: initial platform device support for Atari, required for EtherNAT
++ */
++
++#define ATARI_ETHERNAT_PHYS_ADDR 0x80000000
++#define ATARI_ETHERNAT_IRQ 0xc3
++
++static struct resource smc91x_resources[] = {
++ [0] = {
++ .name = "smc91x-regs",
++ .start = ATARI_ETHERNAT_PHYS_ADDR,
++ .end = ATARI_ETHERNAT_PHYS_ADDR + 0xfffff,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .name = "smc91x-irq",
++ .start = ATARI_ETHERNAT_IRQ,
++ .end = ATARI_ETHERNAT_IRQ,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device smc91x_device = {
++ .name = "smc91x",
++ .id = -1,
++ .num_resources = ARRAY_SIZE(smc91x_resources),
++ .resource = smc91x_resources,
++};
++
++static struct platform_device *atari_platform_devices[] __initdata = {
++ &smc91x_device
++};
++
++int __init atari_platform_init(void)
++{
++ return platform_add_devices(atari_platform_devices, ARRAY_SIZE(atari_platform_devices));
++}
++
++arch_initcall(atari_platform_init);
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -422,6 +422,16 @@ config ATARI_ETHERNEC
+ ROM port. The driver works by polling instead of interrupts, so it
+ is quite slow.
+
++config ATARI_ETHERNAT
++ tristate "Atari EtherNAT Ethernet support"
++ select CRC32
++ select MII
++ depends on NET_ETHERNET && ATARI
++ help
++ Say Y to include support for the EtherNAT network adapter for the
++ CT/60 extension 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 SUN3 || SUN3X
+--- a/drivers/net/Makefile
++++ b/drivers/net/Makefile
+@@ -198,6 +198,7 @@ obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
+ obj-$(CONFIG_DECLANCE) += declance.o
+ obj-$(CONFIG_ATARILANCE) += atarilance.o
+ obj-$(CONFIG_ATARI_ETHERNEC) += atari_ethernec.o 8390.o
++obj-$(CONFIG_ATARI_ETHERNAT) += atari_91C111.o
+ obj-$(CONFIG_A2065) += a2065.o
+ obj-$(CONFIG_HYDRA) += hydra.o
+ obj-$(CONFIG_ARIADNE) += ariadne.o
+--- /dev/null
++++ b/drivers/net/atari_91C111.c
+@@ -0,0 +1,2440 @@
++/*
++ * smc91x.c
++ * This is a driver for SMSC's 91C9x/91C1xx single-chip Ethernet devices.
++ *
++ * Copyright (C) 1996 by Erik Stahlman
++ * Copyright (C) 2001 Standard Microsystems Corporation
++ * Developed by Simple Network Magic Corporation
++ * Copyright (C) 2003 Monta Vista Software, Inc.
++ * Unified SMC91x driver by Nicolas Pitre
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ *
++ * Arguments:
++ * io = for the base address
++ * irq = for the IRQ
++ * nowait = 0 for normal wait states, 1 eliminates additional wait states
++ *
++ * original author:
++ * Erik Stahlman <erik at vt.edu>
++ *
++ * hardware multicast code:
++ * Peter Cammaert <pc at denkart.be>
++ *
++ * contributors:
++ * Daris A Nevil <dnevil at snmc.com>
++ * Nicolas Pitre <nico at cam.org>
++ * Russell King <rmk at arm.linux.org.uk>
++ *
++ * History:
++ * 08/20/00 Arnaldo Melo fix kfree(skb) in smc_hardware_send_packet
++ * 12/15/00 Christian Jullien fix "Warning: kfree_skb on hard IRQ"
++ * 03/16/01 Daris A Nevil modified smc9194.c for use with LAN91C111
++ * 08/22/01 Scott Anderson merge changes from smc9194 to smc91111
++ * 08/21/01 Pramod B Bhardwaj added support for RevB of LAN91C111
++ * 12/20/01 Jeff Sutherland initial port to Xscale PXA with DMA support
++ * 04/07/03 Nicolas Pitre unified SMC91x driver, killed irq races,
++ * more bus abstraction, big cleanup, etc.
++ * 29/09/03 Russell King - add driver model support
++ * - ethtool support
++ * - convert to use generic MII interface
++ * - add link up/down notification
++ * - don't try to handle full negotiation in
++ * smc_phy_configure
++ * - clean up (and fix stack overrun) in PHY
++ * MII read/write functions
++ * 22/09/04 Nicolas Pitre big update (see commit log for details)
++ */
++static const char version[] =
++ "smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico at cam.org>\n";
++
++#define SMC_DEBUG 2
++
++/* Debugging level */
++#ifndef SMC_DEBUG
++#define SMC_DEBUG 0
++#endif
++
++
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/slab.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/errno.h>
++#include <linux/ioport.h>
++#include <linux/crc32.h>
++#include <linux/platform_device.h>
++#include <linux/spinlock.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/workqueue.h>
++
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/skbuff.h>
++
++#include <asm/hwtest.h>
++#include <asm/atariints.h>
++#include <asm/io.h>
++#include <asm/irq.h>
++
++#include "smc91x.h"
++
++#ifdef CONFIG_ISA
++/*
++ * the LAN91C111 can be at any of the following port addresses. To change,
++ * for a slightly different card, you can add it to the array. Keep in
++ * mind that the array must end in zero.
++ */
++static unsigned int smc_portlist[] __initdata = {
++ 0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0,
++ 0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0, 0x3C0, 0x3E0, 0
++};
++
++#endif /* CONFIG_ISA */
++
++#ifndef SMC_IOADDR
++# define SMC_IOADDR -1
++#endif
++static unsigned long io = SMC_IOADDR;
++module_param(io, ulong, 0400);
++MODULE_PARM_DESC(io, "I/O base address");
++
++#ifndef SMC_IRQ
++# define SMC_IRQ -1
++#endif
++static int irq = SMC_IRQ;
++module_param(irq, int, 0400);
++MODULE_PARM_DESC(irq, "IRQ number");
++
++
++#ifndef SMC_NOWAIT
++# define SMC_NOWAIT 0
++#endif
++static int nowait = SMC_NOWAIT;
++module_param(nowait, int, 0400);
++MODULE_PARM_DESC(nowait, "set to 1 for no wait state");
++
++/*
++ * Transmit timeout, default 5 seconds.
++ */
++static int watchdog = 1000;
++module_param(watchdog, int, 0400);
++MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
++
++MODULE_LICENSE("GPL");
++
++/*
++ * The internal workings of the driver. If you are changing anything
++ * here with the SMC stuff, you should have the datasheet and know
++ * what you are doing.
++ */
++#define CARDNAME "smc91x"
++
++/*
++ * Use power-down feature of the chip
++ */
++#define POWER_DOWN 1
++
++/*
++ * Wait time for memory to be free. This probably shouldn't be
++ * tuned that much, as waiting for this means nothing else happens
++ * in the system
++ */
++#define MEMORY_WAIT_TIME 16
++
++/*
++ * The maximum number of processing loops allowed for each call to the
++ * IRQ handler.
++ */
++#define MAX_IRQ_LOOPS 8
++
++/*
++ * This selects whether TX packets are sent one by one to the SMC91x internal
++ * memory and throttled until transmission completes. This may prevent
++ * RX overruns a litle by keeping much of the memory free for RX packets
++ * but to the expense of reduced TX throughput and increased IRQ overhead.
++ * Note this is not a cure for a too slow data bus or too high IRQ latency.
++ */
++#define THROTTLE_TX_PKTS 0
++
++/*
++ * The MII clock high/low times. 2x this number gives the MII clock period
++ * in microseconds. (was 50, but this gives 6.4ms for each MII transaction!)
++ */
++#define MII_DELAY 1
++
++#if SMC_DEBUG > 0
++#define DBG(n, args...) \
++ do { \
++ if (SMC_DEBUG >= (n)) \
++ printk(args); \
++ } while (0)
++
++#define PRINTK(args...) printk(args)
++#else
++#define DBG(n, args...) do { } while(0)
++#define PRINTK(args...) printk(KERN_DEBUG args)
++#endif
++
++#if SMC_DEBUG > 3
++static void PRINT_PKT(u_char *buf, int length)
++{
++ int i;
++ int remainder;
++ int lines;
++
++ lines = length / 16;
++ remainder = length % 16;
++
++ for (i = 0; i < lines ; i ++) {
++ int cur;
++ for (cur = 0; cur < 8; cur++) {
++ u_char a, b;
++ a = *buf++;
++ b = *buf++;
++ printk("%02x%02x ", a, b);
++ }
++ printk("\n");
++ }
++ for (i = 0; i < remainder/2 ; i++) {
++ u_char a, b;
++ a = *buf++;
++ b = *buf++;
++ printk("%02x%02x ", a, b);
++ }
++ printk("\n");
++}
++#else
++#define PRINT_PKT(x...) do { } while(0)
++#endif
++
++
++/* this enables an interrupt in the interrupt mask register */
++#define SMC_ENABLE_INT(x) do { \
++ unsigned char mask; \
++ spin_lock_irq(&lp->lock); \
++ mask = SMC_GET_INT_MASK(); \
++ mask |= (x); \
++ SMC_SET_INT_MASK(mask); \
++ spin_unlock_irq(&lp->lock); \
++} while (0)
++
++/* this disables an interrupt from the interrupt mask register */
++#define SMC_DISABLE_INT(x) do { \
++ unsigned char mask; \
++ spin_lock_irq(&lp->lock); \
++ mask = SMC_GET_INT_MASK(); \
++ mask &= ~(x); \
++ SMC_SET_INT_MASK(mask); \
++ spin_unlock_irq(&lp->lock); \
++} while (0)
++
++/*
++ * Wait while MMU is busy. This is usually in the order of a few nanosecs
++ * if at all, but let's avoid deadlocking the system if the hardware
++ * decides to go south.
++ */
++#define SMC_WAIT_MMU_BUSY() do { \
++ if (unlikely(SMC_GET_MMU_CMD() & MC_BUSY)) { \
++ unsigned long timeout = jiffies + 2; \
++ while (SMC_GET_MMU_CMD() & MC_BUSY) { \
++ if (time_after(jiffies, timeout)) { \
++ printk("%s: timeout %s line %d\n", \
++ dev->name, __FILE__, __LINE__); \
++ break; \
++ } \
++ cpu_relax(); \
++ } \
++ } \
++} while (0)
++
++/*
++ * Timer based operation on Atari
++ */
++static irqreturn_t smc_interrupt(int irq, void *dev_id);
++
++static int use_poll = 0;
++module_param(use_poll, int, 0);
++MODULE_PARM_DESC(use_poll, "Use timer interrupt to poll driver");
++
++/* This is used by cleanup, to prevent the module from being unloaded while
++ * intrpt_routine is still in the task queue
++ */
++static wait_queue_head_t WaitQ;
++
++static struct delayed_work tqueue;
++
++static struct net_device *poll_dev = NULL;
++
++static void atari_ethernat_int(struct work_struct *work)
++{
++ struct net_device *dev = poll_dev;
++
++ if(!dev) {
++ /* If cleanup wants us to die */
++ if (waitqueue_active(&WaitQ))
++ wake_up(&WaitQ); /* Now cleanup_module can return */
++ else
++ /* Put ourselves back in the task queue */
++ schedule_delayed_work(&tqueue, 1);
++ return;
++ }
++
++ if (netif_running(dev)) {
++ smc_interrupt(dev->irq, dev);
++ }
++
++ /* If cleanup wants us to die */
++ if (waitqueue_active(&WaitQ))
++ wake_up(&WaitQ); /* Now cleanup_module can return */
++ else
++ /* Put ourselves back in the task queue */
++ schedule_delayed_work(&tqueue, 0); /* reduced delay from 1 */
++}
++
++static void atari_ethernat_start_poll(struct net_device *dev)
++{
++ poll_dev = dev;
++
++ init_waitqueue_head(&WaitQ);
++
++ /* MSch: need to insert dev into work struct?? */
++
++ INIT_DELAYED_WORK(&tqueue, atari_ethernat_int);
++ schedule_delayed_work(&tqueue, 1);
++}
++
++static void atari_ethernat_stop_poll(struct net_device *dev)
++{
++ poll_dev = NULL;
++
++ if (dev) {
++ sleep_on(&WaitQ);
++ }
++}
++
++
++
++/*
++ * this does a soft reset on the device
++ */
++static void smc_reset(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int ctl, cfg;
++ struct sk_buff *pending_skb;
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ /* Disable all interrupts, block TX tasklet */
++ spin_lock_irq(&lp->lock);
++ SMC_SELECT_BANK(2);
++ SMC_SET_INT_MASK(0);
++ pending_skb = lp->pending_tx_skb;
++ lp->pending_tx_skb = NULL;
++ spin_unlock_irq(&lp->lock);
++
++ /* free any pending tx skb */
++ if (pending_skb) {
++ dev_kfree_skb(pending_skb);
++ dev->stats.tx_errors++;
++ dev->stats.tx_aborted_errors++;
++ }
++
++ /*
++ * This resets the registers mostly to defaults, but doesn't
++ * affect EEPROM. That seems unnecessary
++ */
++ SMC_SELECT_BANK(0);
++ SMC_SET_RCR(RCR_SOFTRST);
++
++ /*
++ * Setup the Configuration Register
++ * This is necessary because the CONFIG_REG is not affected
++ * by a soft reset
++ */
++ SMC_SELECT_BANK(1);
++
++ cfg = CONFIG_DEFAULT;
++
++ /*
++ * Setup for fast accesses if requested. If the card/system
++ * can't handle it then there will be no recovery except for
++ * a hard reset or power cycle
++ */
++ if (nowait)
++ cfg |= CONFIG_NO_WAIT;
++
++ /*
++ * Release from possible power-down state
++ * Configuration register is not affected by Soft Reset
++ */
++ cfg |= CONFIG_EPH_POWER_EN;
++
++ SMC_SET_CONFIG(cfg);
++
++ /* this should pause enough for the chip to be happy */
++ /*
++ * elaborate? What does the chip _need_? --jgarzik
++ *
++ * This seems to be undocumented, but something the original
++ * driver(s) have always done. Suspect undocumented timing
++ * info/determined empirically. --rmk
++ */
++ udelay(1);
++
++ /* Disable transmit and receive functionality */
++ SMC_SELECT_BANK(0);
++ SMC_SET_RCR(RCR_CLEAR);
++ SMC_SET_TCR(TCR_CLEAR);
++
++ SMC_SELECT_BANK(1);
++ ctl = SMC_GET_CTL() | CTL_LE_ENABLE;
++
++ /*
++ * Set the control register to automatically release successfully
++ * transmitted packets, to make the best use out of our limited
++ * memory
++ */
++ if(!THROTTLE_TX_PKTS)
++ ctl |= CTL_AUTO_RELEASE;
++ else
++ ctl &= ~CTL_AUTO_RELEASE;
++ SMC_SET_CTL(ctl);
++
++ /* Reset the MMU */
++ SMC_SELECT_BANK(2);
++ SMC_SET_MMU_CMD(MC_RESET);
++ SMC_WAIT_MMU_BUSY();
++}
++
++/*
++ * Enable Interrupts, Receive, and Transmit
++ */
++static void smc_enable(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ int mask;
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ /* see the header file for options in TCR/RCR DEFAULT */
++ SMC_SELECT_BANK(0);
++ SMC_SET_TCR(lp->tcr_cur_mode);
++ SMC_SET_RCR(lp->rcr_cur_mode);
++
++ SMC_SELECT_BANK(1);
++ SMC_SET_MAC_ADDR(dev->dev_addr);
++
++ /* now, enable interrupts */
++ mask = IM_EPH_INT|IM_RX_OVRN_INT|IM_RCV_INT;
++ if (lp->version >= (CHIP_91100 << 4))
++ mask |= IM_MDINT;
++ SMC_SELECT_BANK(2);
++ SMC_SET_INT_MASK(mask);
++
++ /*
++ * From this point the register bank must _NOT_ be switched away
++ * to something else than bank 2 without proper locking against
++ * races with any tasklet or interrupt handlers until smc_shutdown()
++ * or smc_reset() is called.
++ */
++}
++
++/*
++ * this puts the device in an inactive state
++ */
++static void smc_shutdown(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ struct sk_buff *pending_skb;
++
++ DBG(2, "%s: %s\n", CARDNAME, __FUNCTION__);
++
++ /* no more interrupts for me */
++ spin_lock_irq(&lp->lock);
++ SMC_SELECT_BANK(2);
++ SMC_SET_INT_MASK(0);
++ pending_skb = lp->pending_tx_skb;
++ lp->pending_tx_skb = NULL;
++ spin_unlock_irq(&lp->lock);
++ if (pending_skb)
++ dev_kfree_skb(pending_skb);
++
++ /* and tell the card to stay away from that nasty outside world */
++ SMC_SELECT_BANK(0);
++ SMC_SET_RCR(RCR_CLEAR);
++ SMC_SET_TCR(TCR_CLEAR);
++
++#ifdef POWER_DOWN
++ /* finally, shut the chip down */
++ SMC_SELECT_BANK(1);
++ SMC_SET_CONFIG(SMC_GET_CONFIG() & ~CONFIG_EPH_POWER_EN);
++#endif
++}
++
++/*
++ * This is the procedure to handle the receipt of a packet.
++ */
++static inline void smc_rcv(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int packet_number, status, packet_len;
++
++ DBG(3, "%s: %s\n", dev->name, __FUNCTION__);
++
++ packet_number = SMC_GET_RXFIFO();
++ if (unlikely(packet_number & RXFIFO_REMPTY)) {
++ PRINTK("%s: smc_rcv with nothing on FIFO.\n", dev->name);
++ return;
++ }
++
++ /* read from start of packet */
++ SMC_SET_PTR(PTR_READ | PTR_RCV | PTR_AUTOINC);
++
++ /* First two words are status and packet length */
++ SMC_GET_PKT_HDR(status, packet_len);
++ packet_len &= 0x07ff; /* mask off top bits */
++ DBG(2, "%s: RX PNR 0x%x STATUS 0x%04x LENGTH 0x%04x (%d)\n",
++ dev->name, packet_number, status,
++ packet_len, packet_len);
++
++ back:
++ if (unlikely(packet_len < 6 || status & RS_ERRORS)) {
++ if (status & RS_TOOLONG && packet_len <= (1514 + 4 + 6)) {
++ /* accept VLAN packets */
++ status &= ~RS_TOOLONG;
++ goto back;
++ }
++ if (packet_len < 6) {
++ /* bloody hardware */
++ printk(KERN_ERR "%s: fubar (rxlen %u status %x\n",
++ dev->name, packet_len, status);
++ status |= RS_TOOSHORT;
++ }
++ SMC_WAIT_MMU_BUSY();
++ SMC_SET_MMU_CMD(MC_RELEASE);
++ dev->stats.rx_errors++;
++ if (status & RS_ALGNERR)
++ dev->stats.rx_frame_errors++;
++ if (status & (RS_TOOSHORT | RS_TOOLONG))
++ dev->stats.rx_length_errors++;
++ if (status & RS_BADCRC)
++ dev->stats.rx_crc_errors++;
++ } else {
++ struct sk_buff *skb;
++ unsigned char *data;
++ unsigned int data_len;
++
++ /* set multicast stats */
++ if (status & RS_MULTICAST)
++ dev->stats.multicast++;
++
++ /*
++ * Actual payload is packet_len - 6 (or 5 if odd byte).
++ * We want skb_reserve(2) and the final ctrl word
++ * (2 bytes, possibly containing the payload odd byte).
++ * Furthermore, we add 2 bytes to allow rounding up to
++ * multiple of 4 bytes on 32 bit buses.
++ * Hence packet_len - 6 + 2 + 2 + 2.
++ */
++ skb = dev_alloc_skb(packet_len);
++ if (unlikely(skb == NULL)) {
++ printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
++ dev->name);
++ SMC_WAIT_MMU_BUSY();
++ SMC_SET_MMU_CMD(MC_RELEASE);
++ dev->stats.rx_dropped++;
++ return;
++ }
++
++ /* Align IP header to 32 bits */
++ skb_reserve(skb, 2);
++
++ /* BUG: the LAN91C111 rev A never sets this bit. Force it. */
++ if (lp->version == 0x90)
++ status |= RS_ODDFRAME;
++
++ /*
++ * If odd length: packet_len - 5,
++ * otherwise packet_len - 6.
++ * With the trailing ctrl byte it's packet_len - 4.
++ */
++ data_len = packet_len - ((status & RS_ODDFRAME) ? 5 : 6);
++ data = skb_put(skb, data_len);
++ SMC_PULL_DATA(data, packet_len - 4);
++
++ SMC_WAIT_MMU_BUSY();
++ SMC_SET_MMU_CMD(MC_RELEASE);
++
++ PRINT_PKT(data, packet_len - 4);
++
++ dev->last_rx = jiffies;
++ skb->protocol = eth_type_trans(skb, dev);
++ netif_rx(skb);
++ dev->stats.rx_packets++;
++ dev->stats.rx_bytes += data_len;
++ }
++}
++
++#ifdef CONFIG_SMP
++/*
++ * On SMP we have the following problem:
++ *
++ * A = smc_hardware_send_pkt()
++ * B = smc_hard_start_xmit()
++ * C = smc_interrupt()
++ *
++ * A and B can never be executed simultaneously. However, at least on UP,
++ * it is possible (and even desirable) for C to interrupt execution of
++ * A or B in order to have better RX reliability and avoid overruns.
++ * C, just like A and B, must have exclusive access to the chip and
++ * each of them must lock against any other concurrent access.
++ * Unfortunately this is not possible to have C suspend execution of A or
++ * B taking place on another CPU. On UP this is no an issue since A and B
++ * are run from softirq context and C from hard IRQ context, and there is
++ * no other CPU where concurrent access can happen.
++ * If ever there is a way to force at least B and C to always be executed
++ * on the same CPU then we could use read/write locks to protect against
++ * any other concurrent access and C would always interrupt B. But life
++ * isn't that easy in a SMP world...
++ */
++#define smc_special_trylock(lock) \
++({ \
++ int __ret; \
++ local_irq_disable(); \
++ __ret = spin_trylock(lock); \
++ if (!__ret) \
++ local_irq_enable(); \
++ __ret; \
++})
++#define smc_special_lock(lock) spin_lock_irq(lock)
++#define smc_special_unlock(lock) spin_unlock_irq(lock)
++#else
++#define smc_special_trylock(lock) (1)
++#define smc_special_lock(lock) do { } while (0)
++#define smc_special_unlock(lock) do { } while (0)
++#endif
++
++/*
++ * This is called to actually send a packet to the chip.
++ */
++static void smc_hardware_send_pkt(unsigned long data)
++{
++ struct net_device *dev = (struct net_device *)data;
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ struct sk_buff *skb;
++ unsigned int packet_no, len;
++ unsigned char *buf;
++
++ DBG(3, "%s: %s\n", dev->name, __FUNCTION__);
++
++ if (!smc_special_trylock(&lp->lock)) {
++ netif_stop_queue(dev);
++ tasklet_schedule(&lp->tx_task);
++ return;
++ }
++
++ skb = lp->pending_tx_skb;
++ if (unlikely(!skb)) {
++ smc_special_unlock(&lp->lock);
++ return;
++ }
++ lp->pending_tx_skb = NULL;
++
++ packet_no = SMC_GET_AR();
++ if (unlikely(packet_no & AR_FAILED)) {
++ printk("%s: Memory allocation failed.\n", dev->name);
++ dev->stats.tx_errors++;
++ dev->stats.tx_fifo_errors++;
++ smc_special_unlock(&lp->lock);
++ goto done;
++ }
++
++ /* point to the beginning of the packet */
++ SMC_SET_PN(packet_no);
++ SMC_SET_PTR(PTR_AUTOINC);
++
++ buf = skb->data;
++ len = skb->len;
++ DBG(2, "%s: TX PNR 0x%x LENGTH 0x%04x (%d) BUF 0x%p\n",
++ dev->name, packet_no, len, len, buf);
++ PRINT_PKT(buf, len);
++
++ /*
++ * Send the packet length (+6 for status words, length, and ctl.
++ * The card will pad to 64 bytes with zeroes if packet is too small.
++ */
++ SMC_PUT_PKT_HDR(0, len + 6);
++
++ /* send the actual data */
++ SMC_PUSH_DATA(buf, len & ~1);
++
++ /* Send final ctl word with the last byte if there is one */
++ SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG);
++
++ /*
++ * If THROTTLE_TX_PKTS is set, we stop the queue here. This will
++ * have the effect of having at most one packet queued for TX
++ * in the chip's memory at all time.
++ *
++ * If THROTTLE_TX_PKTS is not set then the queue is stopped only
++ * when memory allocation (MC_ALLOC) does not succeed right away.
++ */
++ if (THROTTLE_TX_PKTS)
++ netif_stop_queue(dev);
++
++ /* queue the packet for TX */
++ SMC_SET_MMU_CMD(MC_ENQUEUE);
++ smc_special_unlock(&lp->lock);
++
++ dev->trans_start = jiffies;
++ dev->stats.tx_packets++;
++ dev->stats.tx_bytes += len;
++
++ SMC_ENABLE_INT(IM_TX_INT | IM_TX_EMPTY_INT);
++
++done: if (!THROTTLE_TX_PKTS)
++ netif_wake_queue(dev);
++
++ dev_kfree_skb(skb);
++}
++
++/*
++ * Since I am not sure if I will have enough room in the chip's ram
++ * to store the packet, I call this routine which either sends it
++ * now, or set the card to generates an interrupt when ready
++ * for the packet.
++ */
++static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int numPages, poll_count, status;
++
++ DBG(3, "%s: %s\n", dev->name, __FUNCTION__);
++
++ BUG_ON(lp->pending_tx_skb != NULL);
++
++ /*
++ * The MMU wants the number of pages to be the number of 256 bytes
++ * 'pages', minus 1 (since a packet can't ever have 0 pages :))
++ *
++ * The 91C111 ignores the size bits, but earlier models don't.
++ *
++ * Pkt size for allocating is data length +6 (for additional status
++ * words, length and ctl)
++ *
++ * If odd size then last byte is included in ctl word.
++ */
++ numPages = ((skb->len & ~1) + (6 - 1)) >> 8;
++ if (unlikely(numPages > 7)) {
++ printk("%s: Far too big packet error.\n", dev->name);
++ dev->stats.tx_errors++;
++ dev->stats.tx_dropped++;
++ dev_kfree_skb(skb);
++ return 0;
++ }
++
++ smc_special_lock(&lp->lock);
++
++ /* now, try to allocate the memory */
++ SMC_SET_MMU_CMD(MC_ALLOC | numPages);
++
++ /*
++ * Poll the chip for a short amount of time in case the
++ * allocation succeeds quickly.
++ */
++ poll_count = MEMORY_WAIT_TIME;
++ do {
++ status = SMC_GET_INT();
++ if (status & IM_ALLOC_INT) {
++ SMC_ACK_INT(IM_ALLOC_INT);
++ break;
++ }
++ } while (--poll_count);
++
++ smc_special_unlock(&lp->lock);
++
++ lp->pending_tx_skb = skb;
++ if (!poll_count) {
++ /* oh well, wait until the chip finds memory later */
++ netif_stop_queue(dev);
++ DBG(2, "%s: TX memory allocation deferred.\n", dev->name);
++ SMC_ENABLE_INT(IM_ALLOC_INT);
++ } else {
++ /*
++ * Allocation succeeded: push packet to the chip's own memory
++ * immediately.
++ */
++ smc_hardware_send_pkt((unsigned long)dev);
++ }
++
++ return 0;
++}
++
++/*
++ * This handles a TX interrupt, which is only called when:
++ * - a TX error occurred, or
++ * - CTL_AUTO_RELEASE is not set and TX of a packet completed.
++ */
++static void smc_tx(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int saved_packet, packet_no, tx_status, pkt_len;
++
++ DBG(3, "%s: %s\n", dev->name, __FUNCTION__);
++
++ /* If the TX FIFO is empty then nothing to do */
++ packet_no = SMC_GET_TXFIFO();
++ if (unlikely(packet_no & TXFIFO_TEMPTY)) {
++ PRINTK("%s: smc_tx with nothing on FIFO.\n", dev->name);
++ return;
++ }
++
++ /* select packet to read from */
++ saved_packet = SMC_GET_PN();
++ SMC_SET_PN(packet_no);
++
++ /* read the first word (status word) from this packet */
++ SMC_SET_PTR(PTR_AUTOINC | PTR_READ);
++ SMC_GET_PKT_HDR(tx_status, pkt_len);
++ DBG(2, "%s: TX STATUS 0x%04x PNR 0x%02x\n",
++ dev->name, tx_status, packet_no);
++
++ if (!(tx_status & ES_TX_SUC))
++ dev->stats.tx_errors++;
++
++ if (tx_status & ES_LOSTCARR)
++ dev->stats.tx_carrier_errors++;
++
++ if (tx_status & (ES_LATCOL | ES_16COL)) {
++ PRINTK("%s: %s occurred on last xmit\n", dev->name,
++ (tx_status & ES_LATCOL) ?
++ "late collision" : "too many collisions");
++ dev->stats.tx_window_errors++;
++ if (!(dev->stats.tx_window_errors & 63) && net_ratelimit()) {
++ printk(KERN_INFO "%s: unexpectedly large number of "
++ "bad collisions. Please check duplex "
++ "setting.\n", dev->name);
++ }
++ }
++
++ /* kill the packet */
++ SMC_WAIT_MMU_BUSY();
++ SMC_SET_MMU_CMD(MC_FREEPKT);
++
++ /* Don't restore Packet Number Reg until busy bit is cleared */
++ SMC_WAIT_MMU_BUSY();
++ SMC_SET_PN(saved_packet);
++
++ /* re-enable transmit */
++ SMC_SELECT_BANK(0);
++ SMC_SET_TCR(lp->tcr_cur_mode);
++ SMC_SELECT_BANK(2);
++}
++
++
++/*---PHY CONTROL AND CONFIGURATION-----------------------------------------*/
++
++static void smc_mii_out(struct net_device *dev, unsigned int val, int bits)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int mii_reg, mask;
++
++ mii_reg = SMC_GET_MII() & ~(MII_MCLK | MII_MDOE | MII_MDO);
++ mii_reg |= MII_MDOE;
++
++ for (mask = 1 << (bits - 1); mask; mask >>= 1) {
++ if (val & mask)
++ mii_reg |= MII_MDO;
++ else
++ mii_reg &= ~MII_MDO;
++
++ SMC_SET_MII(mii_reg);
++ udelay(MII_DELAY);
++ SMC_SET_MII(mii_reg | MII_MCLK);
++ udelay(MII_DELAY);
++ }
++}
++
++static unsigned int smc_mii_in(struct net_device *dev, int bits)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int mii_reg, mask, val;
++
++ mii_reg = SMC_GET_MII() & ~(MII_MCLK | MII_MDOE | MII_MDO);
++ SMC_SET_MII(mii_reg);
++
++ for (mask = 1 << (bits - 1), val = 0; mask; mask >>= 1) {
++ if (SMC_GET_MII() & MII_MDI)
++ val |= mask;
++
++ SMC_SET_MII(mii_reg);
++ udelay(MII_DELAY);
++ SMC_SET_MII(mii_reg | MII_MCLK);
++ udelay(MII_DELAY);
++ }
++
++ return val;
++}
++
++/*
++ * Reads a register from the MII Management serial interface
++ */
++static int smc_phy_read(struct net_device *dev, int phyaddr, int phyreg)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int phydata;
++
++ SMC_SELECT_BANK(3);
++
++ /* Idle - 32 ones */
++ smc_mii_out(dev, 0xffffffff, 32);
++
++ /* Start code (01) + read (10) + phyaddr + phyreg */
++ smc_mii_out(dev, 6 << 10 | phyaddr << 5 | phyreg, 14);
++
++ /* Turnaround (2bits) + phydata */
++ phydata = smc_mii_in(dev, 18);
++
++ /* Return to idle state */
++ SMC_SET_MII(SMC_GET_MII() & ~(MII_MCLK|MII_MDOE|MII_MDO));
++
++ DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n",
++ __FUNCTION__, phyaddr, phyreg, phydata);
++
++ SMC_SELECT_BANK(2);
++ return phydata;
++}
++
++/*
++ * Writes a register to the MII Management serial interface
++ */
++static void smc_phy_write(struct net_device *dev, int phyaddr, int phyreg,
++ int phydata)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++
++ SMC_SELECT_BANK(3);
++
++ /* Idle - 32 ones */
++ smc_mii_out(dev, 0xffffffff, 32);
++
++ /* Start code (01) + write (01) + phyaddr + phyreg + turnaround + phydata */
++ smc_mii_out(dev, 5 << 28 | phyaddr << 23 | phyreg << 18 | 2 << 16 | phydata, 32);
++
++ /* Return to idle state */
++ SMC_SET_MII(SMC_GET_MII() & ~(MII_MCLK|MII_MDOE|MII_MDO));
++
++ DBG(3, "%s: phyaddr=0x%x, phyreg=0x%x, phydata=0x%x\n",
++ __FUNCTION__, phyaddr, phyreg, phydata);
++
++ SMC_SELECT_BANK(2);
++}
++
++/*
++ * Finds and reports the PHY address
++ */
++static void smc_phy_detect(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ int phyaddr;
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ lp->phy_type = 0;
++
++ /*
++ * Scan all 32 PHY addresses if necessary, starting at
++ * PHY#1 to PHY#31, and then PHY#0 last.
++ */
++ for (phyaddr = 1; phyaddr < 33; ++phyaddr) {
++ unsigned int id1, id2;
++
++ /* Read the PHY identifiers */
++ id1 = smc_phy_read(dev, phyaddr & 31, MII_PHYSID1);
++ id2 = smc_phy_read(dev, phyaddr & 31, MII_PHYSID2);
++
++ DBG(3, "%s: phy_id1=0x%x, phy_id2=0x%x\n",
++ dev->name, id1, id2);
++
++ /* Make sure it is a valid identifier */
++ if (id1 != 0x0000 && id1 != 0xffff && id1 != 0x8000 &&
++ id2 != 0x0000 && id2 != 0xffff && id2 != 0x8000) {
++ /* Save the PHY's address */
++ lp->mii.phy_id = phyaddr & 31;
++ lp->phy_type = id1 << 16 | id2;
++ break;
++ }
++ }
++}
++
++/*
++ * Sets the PHY to a configuration as determined by the user
++ */
++static int smc_phy_fixed(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ int phyaddr = lp->mii.phy_id;
++ int bmcr, cfg1;
++
++ DBG(3, "%s: %s\n", dev->name, __FUNCTION__);
++
++ /* Enter Link Disable state */
++ cfg1 = smc_phy_read(dev, phyaddr, PHY_CFG1_REG);
++ cfg1 |= PHY_CFG1_LNKDIS;
++ smc_phy_write(dev, phyaddr, PHY_CFG1_REG, cfg1);
++
++ /*
++ * Set our fixed capabilities
++ * Disable auto-negotiation
++ */
++ bmcr = 0;
++
++ if (lp->ctl_rfduplx)
++ bmcr |= BMCR_FULLDPLX;
++
++ if (lp->ctl_rspeed == 100)
++ bmcr |= BMCR_SPEED100;
++
++ /* Write our capabilities to the phy control register */
++ smc_phy_write(dev, phyaddr, MII_BMCR, bmcr);
++
++ /* Re-Configure the Receive/Phy Control register */
++ SMC_SELECT_BANK(0);
++ SMC_SET_RPC(lp->rpc_cur_mode);
++ SMC_SELECT_BANK(2);
++
++ return 1;
++}
++
++/*
++ * smc_phy_reset - reset the phy
++ * @dev: net device
++ * @phy: phy address
++ *
++ * Issue a software reset for the specified PHY and
++ * wait up to 100ms for the reset to complete. We should
++ * not access the PHY for 50ms after issuing the reset.
++ *
++ * The time to wait appears to be dependent on the PHY.
++ *
++ * Must be called with lp->lock locked.
++ */
++static int smc_phy_reset(struct net_device *dev, int phy)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ unsigned int bmcr;
++ int timeout;
++
++ smc_phy_write(dev, phy, MII_BMCR, BMCR_RESET);
++
++ for (timeout = 2; timeout; timeout--) {
++ spin_unlock_irq(&lp->lock);
++ msleep(50);
++ spin_lock_irq(&lp->lock);
++
++ bmcr = smc_phy_read(dev, phy, MII_BMCR);
++ if (!(bmcr & BMCR_RESET))
++ break;
++ }
++
++ return bmcr & BMCR_RESET;
++}
++
++/*
++ * smc_phy_powerdown - powerdown phy
++ * @dev: net device
++ *
++ * Power down the specified PHY
++ */
++static void smc_phy_powerdown(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ unsigned int bmcr;
++ int phy = lp->mii.phy_id;
++
++ if (lp->phy_type == 0)
++ return;
++
++ /* We need to ensure that no calls to smc_phy_configure are
++ pending.
++
++ flush_scheduled_work() cannot be called because we are
++ running with the netlink semaphore held (from
++ devinet_ioctl()) and the pending work queue contains
++ linkwatch_event() (scheduled by netif_carrier_off()
++ above). linkwatch_event() also wants the netlink semaphore.
++ */
++ while(lp->work_pending)
++ yield();
++
++ bmcr = smc_phy_read(dev, phy, MII_BMCR);
++ smc_phy_write(dev, phy, MII_BMCR, bmcr | BMCR_PDOWN);
++}
++
++/*
++ * smc_phy_check_media - check the media status and adjust TCR
++ * @dev: net device
++ * @init: set true for initialisation
++ *
++ * Select duplex mode depending on negotiation state. This
++ * also updates our carrier state.
++ */
++static void smc_phy_check_media(struct net_device *dev, int init)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++
++ if (mii_check_media(&lp->mii, netif_msg_link(lp), init)) {
++ /* duplex state has changed */
++ if (lp->mii.full_duplex) {
++ lp->tcr_cur_mode |= TCR_SWFDUP;
++ } else {
++ lp->tcr_cur_mode &= ~TCR_SWFDUP;
++ }
++
++ SMC_SELECT_BANK(0);
++ SMC_SET_TCR(lp->tcr_cur_mode);
++ }
++}
++
++/*
++ * Configures the specified PHY through the MII management interface
++ * using Autonegotiation.
++ * Calls smc_phy_fixed() if the user has requested a certain config.
++ * If RPC ANEG bit is set, the media selection is dependent purely on
++ * the selection by the MII (either in the MII BMCR reg or the result
++ * of autonegotiation.) If the RPC ANEG bit is cleared, the selection
++ * is controlled by the RPC SPEED and RPC DPLX bits.
++ */
++static void smc_phy_configure(struct work_struct *work)
++{
++ struct smc_local *lp =
++ container_of(work, struct smc_local, phy_configure);
++ struct net_device *dev = lp->dev;
++ void __iomem *ioaddr = lp->base;
++ int phyaddr = lp->mii.phy_id;
++ int my_phy_caps; /* My PHY capabilities */
++ int my_ad_caps; /* My Advertised capabilities */
++ int status;
++
++ DBG(3, "%s:smc_program_phy()\n", dev->name);
++
++ spin_lock_irq(&lp->lock);
++
++ /*
++ * We should not be called if phy_type is zero.
++ */
++ if (lp->phy_type == 0)
++ goto smc_phy_configure_exit;
++
++ if (smc_phy_reset(dev, phyaddr)) {
++ printk("%s: PHY reset timed out\n", dev->name);
++ goto smc_phy_configure_exit;
++ }
++
++ /*
++ * Enable PHY Interrupts (for register 18)
++ * Interrupts listed here are disabled
++ */
++ smc_phy_write(dev, phyaddr, PHY_MASK_REG,
++ PHY_INT_LOSSSYNC | PHY_INT_CWRD | PHY_INT_SSD |
++ PHY_INT_ESD | PHY_INT_RPOL | PHY_INT_JAB |
++ PHY_INT_SPDDET | PHY_INT_DPLXDET);
++
++ /* Configure the Receive/Phy Control register */
++ SMC_SELECT_BANK(0);
++ SMC_SET_RPC(lp->rpc_cur_mode);
++
++ /* If the user requested no auto neg, then go set his request */
++ if (lp->mii.force_media) {
++ smc_phy_fixed(dev);
++ goto smc_phy_configure_exit;
++ }
++
++ /* Copy our capabilities from MII_BMSR to MII_ADVERTISE */
++ my_phy_caps = smc_phy_read(dev, phyaddr, MII_BMSR);
++
++ if (!(my_phy_caps & BMSR_ANEGCAPABLE)) {
++ printk(KERN_INFO "Auto negotiation NOT supported\n");
++ smc_phy_fixed(dev);
++ goto smc_phy_configure_exit;
++ }
++
++ my_ad_caps = ADVERTISE_CSMA; /* I am CSMA capable */
++
++ if (my_phy_caps & BMSR_100BASE4)
++ my_ad_caps |= ADVERTISE_100BASE4;
++ if (my_phy_caps & BMSR_100FULL)
++ my_ad_caps |= ADVERTISE_100FULL;
++ if (my_phy_caps & BMSR_100HALF)
++ my_ad_caps |= ADVERTISE_100HALF;
++ if (my_phy_caps & BMSR_10FULL)
++ my_ad_caps |= ADVERTISE_10FULL;
++ if (my_phy_caps & BMSR_10HALF)
++ my_ad_caps |= ADVERTISE_10HALF;
++
++ /* Disable capabilities not selected by our user */
++ if (lp->ctl_rspeed != 100)
++ my_ad_caps &= ~(ADVERTISE_100BASE4|ADVERTISE_100FULL|ADVERTISE_100HALF);
++
++ if (!lp->ctl_rfduplx)
++ my_ad_caps &= ~(ADVERTISE_100FULL|ADVERTISE_10FULL);
++
++ /* Update our Auto-Neg Advertisement Register */
++ smc_phy_write(dev, phyaddr, MII_ADVERTISE, my_ad_caps);
++ lp->mii.advertising = my_ad_caps;
++
++ /*
++ * Read the register back. Without this, it appears that when
++ * auto-negotiation is restarted, sometimes it isn't ready and
++ * the link does not come up.
++ */
++ status = smc_phy_read(dev, phyaddr, MII_ADVERTISE);
++
++ DBG(2, "%s: phy caps=%x\n", dev->name, my_phy_caps);
++ DBG(2, "%s: phy advertised caps=%x\n", dev->name, my_ad_caps);
++
++ /* Restart auto-negotiation process in order to advertise my caps */
++ smc_phy_write(dev, phyaddr, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART);
++
++ smc_phy_check_media(dev, 1);
++
++smc_phy_configure_exit:
++ SMC_SELECT_BANK(2);
++ spin_unlock_irq(&lp->lock);
++ lp->work_pending = 0;
++}
++
++/*
++ * smc_phy_interrupt
++ *
++ * Purpose: Handle interrupts relating to PHY register 18. This is
++ * called from the "hard" interrupt handler under our private spinlock.
++ */
++static void smc_phy_interrupt(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ int phyaddr = lp->mii.phy_id;
++ int phy18;
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ if (lp->phy_type == 0)
++ return;
++
++ for(;;) {
++ smc_phy_check_media(dev, 0);
++
++ /* Read PHY Register 18, Status Output */
++ phy18 = smc_phy_read(dev, phyaddr, PHY_INT_REG);
++ if ((phy18 & PHY_INT_INT) == 0)
++ break;
++ }
++}
++
++/*--- END PHY CONTROL AND CONFIGURATION-------------------------------------*/
++
++static void smc_10bt_check_media(struct net_device *dev, int init)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int old_carrier, new_carrier;
++
++ old_carrier = netif_carrier_ok(dev) ? 1 : 0;
++
++ SMC_SELECT_BANK(0);
++ new_carrier = (SMC_GET_EPH_STATUS() & ES_LINK_OK) ? 1 : 0;
++ SMC_SELECT_BANK(2);
++
++ if (init || (old_carrier != new_carrier)) {
++ if (!new_carrier) {
++ netif_carrier_off(dev);
++ } else {
++ netif_carrier_on(dev);
++ }
++ if (netif_msg_link(lp))
++ printk(KERN_INFO "%s: link %s\n", dev->name,
++ new_carrier ? "up" : "down");
++ }
++}
++
++static void smc_eph_interrupt(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned int ctl;
++
++ smc_10bt_check_media(dev, 0);
++
++ SMC_SELECT_BANK(1);
++ ctl = SMC_GET_CTL();
++ SMC_SET_CTL(ctl & ~CTL_LE_ENABLE);
++ SMC_SET_CTL(ctl);
++ SMC_SELECT_BANK(2);
++}
++
++/*
++ * This is the main routine of the driver, to handle the device when
++ * it needs some attention.
++ */
++static irqreturn_t smc_interrupt(int irq, void *dev_id)
++{
++ struct net_device *dev = dev_id;
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ int status, mask, timeout, card_stats;
++ int saved_pointer;
++
++ DBG(3, "%s: %s\n", dev->name, __FUNCTION__);
++
++ spin_lock(&lp->lock);
++
++ /* A preamble may be used when there is a potential race
++ * between the interruptible transmit functions and this
++ * ISR. */
++ SMC_INTERRUPT_PREAMBLE;
++
++ saved_pointer = SMC_GET_PTR();
++ mask = SMC_GET_INT_MASK();
++ SMC_SET_INT_MASK(0);
++
++ /* set a timeout value, so I don't stay here forever */
++ timeout = MAX_IRQ_LOOPS;
++
++ do {
++ status = SMC_GET_INT();
++
++ DBG(2, "%s: INT 0x%02x MASK 0x%02x MEM 0x%04x FIFO 0x%04x\n",
++ dev->name, status, mask,
++ ({ int meminfo; SMC_SELECT_BANK(0);
++ meminfo = SMC_GET_MIR();
++ SMC_SELECT_BANK(2); meminfo; }),
++ SMC_GET_FIFO());
++
++ status &= mask;
++ if (!status)
++ break;
++
++ if (status & IM_TX_INT) {
++ /* do this before RX as it will free memory quickly */
++ DBG(3, "%s: TX int\n", dev->name);
++ smc_tx(dev);
++ SMC_ACK_INT(IM_TX_INT);
++ if (THROTTLE_TX_PKTS)
++ netif_wake_queue(dev);
++ } else if (status & IM_RCV_INT) {
++ DBG(3, "%s: RX irq\n", dev->name);
++ smc_rcv(dev);
++ } else if (status & IM_ALLOC_INT) {
++ DBG(3, "%s: Allocation irq\n", dev->name);
++ tasklet_hi_schedule(&lp->tx_task);
++ mask &= ~IM_ALLOC_INT;
++ } else if (status & IM_TX_EMPTY_INT) {
++ DBG(3, "%s: TX empty\n", dev->name);
++ mask &= ~IM_TX_EMPTY_INT;
++
++ /* update stats */
++ SMC_SELECT_BANK(0);
++ card_stats = SMC_GET_COUNTER();
++ SMC_SELECT_BANK(2);
++
++ /* single collisions */
++ dev->stats.collisions += card_stats & 0xF;
++ card_stats >>= 4;
++
++ /* multiple collisions */
++ dev->stats.collisions += card_stats & 0xF;
++ } else if (status & IM_RX_OVRN_INT) {
++ DBG(1, "%s: RX overrun (EPH_ST 0x%04x)\n", dev->name,
++ ({ int eph_st; SMC_SELECT_BANK(0);
++ eph_st = SMC_GET_EPH_STATUS();
++ SMC_SELECT_BANK(2); eph_st; }) );
++ SMC_ACK_INT(IM_RX_OVRN_INT);
++ dev->stats.rx_errors++;
++ dev->stats.rx_fifo_errors++;
++ } else if (status & IM_EPH_INT) {
++ smc_eph_interrupt(dev);
++ } else if (status & IM_MDINT) {
++ SMC_ACK_INT(IM_MDINT);
++ smc_phy_interrupt(dev);
++ } else if (status & IM_ERCV_INT) {
++ SMC_ACK_INT(IM_ERCV_INT);
++ PRINTK("%s: UNSUPPORTED: ERCV INTERRUPT \n", dev->name);
++ }
++ } while (--timeout);
++
++ /* restore register states */
++ SMC_SET_PTR(saved_pointer);
++ SMC_SET_INT_MASK(mask);
++ spin_unlock(&lp->lock);
++
++ if (timeout == MAX_IRQ_LOOPS)
++ PRINTK("%s: spurious interrupt (mask = 0x%02x)\n",
++ dev->name, mask);
++ DBG(3, "%s: Interrupt done (%d loops)\n",
++ dev->name, MAX_IRQ_LOOPS - timeout);
++
++ /*
++ * We return IRQ_HANDLED unconditionally here even if there was
++ * nothing to do. There is a possibility that a packet might
++ * get enqueued into the chip right after TX_EMPTY_INT is raised
++ * but just before the CPU acknowledges the IRQ.
++ * Better take an unneeded IRQ in some occasions than complexifying
++ * the code for all cases.
++ */
++ return IRQ_HANDLED;
++}
++
++#ifdef CONFIG_NET_POLL_CONTROLLER
++/*
++ * Polling receive - used by netconsole and other diagnostic tools
++ * to allow network i/o with interrupts disabled.
++ */
++static void smc_poll_controller(struct net_device *dev)
++{
++ disable_irq(dev->irq);
++ smc_interrupt(dev->irq, dev);
++ enable_irq(dev->irq);
++}
++#endif
++
++/* Our watchdog timed out. Called by the networking layer */
++static void smc_timeout(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ int status, mask, eph_st, meminfo, fifo;
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ spin_lock_irq(&lp->lock);
++ status = SMC_GET_INT();
++ mask = SMC_GET_INT_MASK();
++ fifo = SMC_GET_FIFO();
++ SMC_SELECT_BANK(0);
++ eph_st = SMC_GET_EPH_STATUS();
++ meminfo = SMC_GET_MIR();
++ SMC_SELECT_BANK(2);
++ spin_unlock_irq(&lp->lock);
++ PRINTK( "%s: TX timeout (INT 0x%02x INTMASK 0x%02x "
++ "MEM 0x%04x FIFO 0x%04x EPH_ST 0x%04x)\n",
++ dev->name, status, mask, meminfo, fifo, eph_st );
++
++ smc_reset(dev);
++ smc_enable(dev);
++
++ /*
++ * Reconfiguring the PHY doesn't seem like a bad idea here, but
++ * smc_phy_configure() calls msleep() which calls schedule_timeout()
++ * which calls schedule(). Hence we use a work queue.
++ */
++ if (lp->phy_type != 0) {
++ if (schedule_work(&lp->phy_configure)) {
++ lp->work_pending = 1;
++ }
++ }
++
++ /* We can accept TX packets again */
++ dev->trans_start = jiffies;
++ netif_wake_queue(dev);
++}
++
++/*
++ * This routine will, depending on the values passed to it,
++ * either make it accept multicast packets, go into
++ * promiscuous mode (for TCPDUMP and cousins) or accept
++ * a select set of multicast packets
++ */
++static void smc_set_multicast_list(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ void __iomem *ioaddr = lp->base;
++ unsigned char multicast_table[8];
++ int update_multicast = 0;
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ if (dev->flags & IFF_PROMISC) {
++ DBG(2, "%s: RCR_PRMS\n", dev->name);
++ lp->rcr_cur_mode |= RCR_PRMS;
++ }
++
++/* BUG? I never disable promiscuous mode if multicasting was turned on.
++ Now, I turn off promiscuous mode, but I don't do anything to multicasting
++ when promiscuous mode is turned on.
++*/
++
++ /*
++ * Here, I am setting this to accept all multicast packets.
++ * I don't need to zero the multicast table, because the flag is
++ * checked before the table is
++ */
++ else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) {
++ DBG(2, "%s: RCR_ALMUL\n", dev->name);
++ lp->rcr_cur_mode |= RCR_ALMUL;
++ }
++
++ /*
++ * This sets the internal hardware table to filter out unwanted
++ * multicast packets before they take up memory.
++ *
++ * The SMC chip uses a hash table where the high 6 bits of the CRC of
++ * address are the offset into the table. If that bit is 1, then the
++ * multicast packet is accepted. Otherwise, it's dropped silently.
++ *
++ * To use the 6 bits as an offset into the table, the high 3 bits are
++ * the number of the 8 bit register, while the low 3 bits are the bit
++ * within that register.
++ */
++ else if (dev->mc_count) {
++ int i;
++ struct dev_mc_list *cur_addr;
++
++ /* table for flipping the order of 3 bits */
++ static const unsigned char invert3[] = {0, 4, 2, 6, 1, 5, 3, 7};
++
++ /* start with a table of all zeros: reject all */
++ memset(multicast_table, 0, sizeof(multicast_table));
++
++ cur_addr = dev->mc_list;
++ for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) {
++ int position;
++
++ /* do we have a pointer here? */
++ if (!cur_addr)
++ break;
++ /* make sure this is a multicast address -
++ shouldn't this be a given if we have it here ? */
++ if (!(*cur_addr->dmi_addr & 1))
++ continue;
++
++ /* only use the low order bits */
++ position = crc32_le(~0, cur_addr->dmi_addr, 6) & 0x3f;
++
++ /* do some messy swapping to put the bit in the right spot */
++ multicast_table[invert3[position&7]] |=
++ (1<<invert3[(position>>3)&7]);
++ }
++
++ /* be sure I get rid of flags I might have set */
++ lp->rcr_cur_mode &= ~(RCR_PRMS | RCR_ALMUL);
++
++ /* now, the table can be loaded into the chipset */
++ update_multicast = 1;
++ } else {
++ DBG(2, "%s: ~(RCR_PRMS|RCR_ALMUL)\n", dev->name);
++ lp->rcr_cur_mode &= ~(RCR_PRMS | RCR_ALMUL);
++
++ /*
++ * since I'm disabling all multicast entirely, I need to
++ * clear the multicast list
++ */
++ memset(multicast_table, 0, sizeof(multicast_table));
++ update_multicast = 1;
++ }
++
++ spin_lock_irq(&lp->lock);
++ SMC_SELECT_BANK(0);
++ SMC_SET_RCR(lp->rcr_cur_mode);
++ if (update_multicast) {
++ SMC_SELECT_BANK(3);
++ SMC_SET_MCAST(multicast_table);
++ }
++ SMC_SELECT_BANK(2);
++ spin_unlock_irq(&lp->lock);
++}
++
++
++/*
++ * Open and Initialize the board
++ *
++ * Set up everything, reset the card, etc..
++ */
++static int
++smc_open(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ /*
++ * Check that the address is valid. If its not, refuse
++ * to bring the device up. The user must specify an
++ * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
++ */
++ if (!is_valid_ether_addr(dev->dev_addr)) {
++ PRINTK("%s: no valid ethernet hw addr\n", __FUNCTION__);
++ return -EINVAL;
++ }
++
++ /* Setup the default Register Modes */
++ lp->tcr_cur_mode = TCR_DEFAULT;
++ lp->rcr_cur_mode = RCR_DEFAULT;
++ lp->rpc_cur_mode = RPC_DEFAULT;
++
++ /*
++ * If we are not using a MII interface, we need to
++ * monitor our own carrier signal to detect faults.
++ */
++ if (lp->phy_type == 0)
++ lp->tcr_cur_mode |= TCR_MON_CSN;
++
++ /* reset the hardware */
++ smc_reset(dev);
++ smc_enable(dev);
++
++ /* Configure the PHY, initialize the link state */
++ if (lp->phy_type != 0)
++ smc_phy_configure(&lp->phy_configure);
++ else {
++ spin_lock_irq(&lp->lock);
++ smc_10bt_check_media(dev, 1);
++ spin_unlock_irq(&lp->lock);
++ }
++
++ netif_start_queue(dev);
++ return 0;
++}
++
++/*
++ * smc_close
++ *
++ * this makes the board clean up everything that it can
++ * and not talk to the outside world. Caused by
++ * an 'ifconfig ethX down'
++ */
++static int smc_close(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++
++ DBG(2, "%s: %s\n", dev->name, __FUNCTION__);
++
++ netif_stop_queue(dev);
++ netif_carrier_off(dev);
++
++ /* clear everything */
++ smc_shutdown(dev);
++ tasklet_kill(&lp->tx_task);
++ smc_phy_powerdown(dev);
++ return 0;
++}
++
++/*
++ * Ethtool support
++ */
++static int
++smc_ethtool_getsettings(struct net_device *dev, struct ethtool_cmd *cmd)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ int ret;
++
++ cmd->maxtxpkt = 1;
++ cmd->maxrxpkt = 1;
++
++ if (lp->phy_type != 0) {
++ spin_lock_irq(&lp->lock);
++ ret = mii_ethtool_gset(&lp->mii, cmd);
++ spin_unlock_irq(&lp->lock);
++ } else {
++ cmd->supported = SUPPORTED_10baseT_Half |
++ SUPPORTED_10baseT_Full |
++ SUPPORTED_TP | SUPPORTED_AUI;
++
++ if (lp->ctl_rspeed == 10)
++ cmd->speed = SPEED_10;
++ else if (lp->ctl_rspeed == 100)
++ cmd->speed = SPEED_100;
++
++ cmd->autoneg = AUTONEG_DISABLE;
++ cmd->transceiver = XCVR_INTERNAL;
++ cmd->port = 0;
++ cmd->duplex = lp->tcr_cur_mode & TCR_SWFDUP ? DUPLEX_FULL : DUPLEX_HALF;
++
++ ret = 0;
++ }
++
++ return ret;
++}
++
++static int
++smc_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ int ret;
++
++ if (lp->phy_type != 0) {
++ spin_lock_irq(&lp->lock);
++ ret = mii_ethtool_sset(&lp->mii, cmd);
++ spin_unlock_irq(&lp->lock);
++ } else {
++ if (cmd->autoneg != AUTONEG_DISABLE ||
++ cmd->speed != SPEED_10 ||
++ (cmd->duplex != DUPLEX_HALF && cmd->duplex != DUPLEX_FULL) ||
++ (cmd->port != PORT_TP && cmd->port != PORT_AUI))
++ return -EINVAL;
++
++// lp->port = cmd->port;
++ lp->ctl_rfduplx = cmd->duplex == DUPLEX_FULL;
++
++// if (netif_running(dev))
++// smc_set_port(dev);
++
++ ret = 0;
++ }
++
++ return ret;
++}
++
++static void
++smc_ethtool_getdrvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
++{
++ strncpy(info->driver, CARDNAME, sizeof(info->driver));
++ strncpy(info->version, version, sizeof(info->version));
++ strncpy(info->bus_info, dev->dev.parent->bus_id, sizeof(info->bus_info));
++}
++
++static int smc_ethtool_nwayreset(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ int ret = -EINVAL;
++
++ if (lp->phy_type != 0) {
++ spin_lock_irq(&lp->lock);
++ ret = mii_nway_restart(&lp->mii);
++ spin_unlock_irq(&lp->lock);
++ }
++
++ return ret;
++}
++
++static u32 smc_ethtool_getmsglevel(struct net_device *dev)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ return lp->msg_enable;
++}
++
++static void smc_ethtool_setmsglevel(struct net_device *dev, u32 level)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ lp->msg_enable = level;
++}
++
++static struct ethtool_ops smc_ethtool_ops = {
++ .get_settings = smc_ethtool_getsettings,
++ .set_settings = smc_ethtool_setsettings,
++ .get_drvinfo = smc_ethtool_getdrvinfo,
++
++ .get_msglevel = smc_ethtool_getmsglevel,
++ .set_msglevel = smc_ethtool_setmsglevel,
++ .nway_reset = smc_ethtool_nwayreset,
++ .get_link = ethtool_op_get_link,
++// .get_eeprom = smc_ethtool_geteeprom,
++// .set_eeprom = smc_ethtool_seteeprom,
++};
++
++/*
++ * smc_findirq
++ *
++ * This routine has a simple purpose -- make the SMC chip generate an
++ * interrupt, so an auto-detect routine can detect it, and find the IRQ,
++ */
++/*
++ * does this still work?
++ *
++ * I just deleted auto_irq.c, since it was never built...
++ * --jgarzik
++ */
++static int __init smc_findirq(void __iomem *ioaddr)
++{
++ int timeout = 20;
++ unsigned long cookie;
++
++ DBG(2, "%s: %s\n", CARDNAME, __FUNCTION__);
++
++ cookie = probe_irq_on();
++
++ /*
++ * What I try to do here is trigger an ALLOC_INT. This is done
++ * by allocating a small chunk of memory, which will give an interrupt
++ * when done.
++ */
++ /* enable ALLOCation interrupts ONLY */
++ SMC_SELECT_BANK(2);
++ SMC_SET_INT_MASK(IM_ALLOC_INT);
++
++ /*
++ * Allocate 512 bytes of memory. Note that the chip was just
++ * reset so all the memory is available
++ */
++ SMC_SET_MMU_CMD(MC_ALLOC | 1);
++
++ /*
++ * Wait until positive that the interrupt has been generated
++ */
++ do {
++ int int_status;
++ udelay(10);
++ int_status = SMC_GET_INT();
++ if (int_status & IM_ALLOC_INT)
++ break; /* got the interrupt */
++ } while (--timeout);
++
++ /*
++ * there is really nothing that I can do here if timeout fails,
++ * as autoirq_report will return a 0 anyway, which is what I
++ * want in this case. Plus, the clean up is needed in both
++ * cases.
++ */
++
++ /* and disable all interrupts again */
++ SMC_SET_INT_MASK(0);
++
++ /* and return what I found */
++ return probe_irq_off(cookie);
++}
++
++/*
++ * Function: smc_probe(unsigned long ioaddr)
++ *
++ * Purpose:
++ * Tests to see if a given ioaddr points to an SMC91x chip.
++ * Returns a 0 on success
++ *
++ * Algorithm:
++ * (1) see if the high byte of BANK_SELECT is 0x33
++ * (2) compare the ioaddr with the base register's address
++ * (3) see if I recognize the chip ID in the appropriate register
++ *
++ * Here I do typical initialization tasks.
++ *
++ * o Initialize the structure if needed
++ * o print out my vanity message if not done so already
++ * o print out what type of hardware is detected
++ * o print out the ethernet address
++ * o find the IRQ
++ * o set up my private data
++ * o configure the dev structure with my subroutines
++ * o actually GRAB the irq.
++ * o GRAB the region
++ */
++static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr)
++{
++ struct smc_local *lp = netdev_priv(dev);
++ static int version_printed = 0;
++ int retval;
++ unsigned int val, revision_register;
++ const char *version_string;
++ DECLARE_MAC_BUF(mac);
++
++ DBG(2, "%s: %s\n", CARDNAME, __FUNCTION__);
++
++ if (!hwreg_present( ioaddr + BANK_SELECT )) {
++ retval = -ENODEV;
++ goto err_out;
++ }
++
++ /* First, see if the high byte is 0x33 */
++ val = SMC_CURRENT_BANK();
++ DBG(2, "%s: bank signature probe returned 0x%04x\n", CARDNAME, val);
++ if ((val & 0xFF00) != 0x3300) {
++ if ((val & 0xFF) == 0x33) {
++ printk(KERN_WARNING
++ "%s: Detected possible byte-swapped interface"
++ " at IOADDR %p\n", CARDNAME, ioaddr);
++ }
++ retval = -ENODEV;
++ goto err_out;
++ }
++
++ /*
++ * The above MIGHT indicate a device, but I need to write to
++ * further test this.
++ */
++ SMC_SELECT_BANK(0);
++ val = SMC_CURRENT_BANK();
++ if ((val & 0xFF00) != 0x3300) {
++ retval = -ENODEV;
++ goto err_out;
++ }
++
++ /*
++ * well, we've already written once, so hopefully another
++ * time won't hurt. This time, I need to switch the bank
++ * register to bank 1, so I can access the base address
++ * register
++ */
++ SMC_SELECT_BANK(1);
++ val = SMC_GET_BASE();
++ val = ((val & 0x1F00) >> 3) << SMC_IO_SHIFT;
++ if (((unsigned int)ioaddr & (0x3e0 << SMC_IO_SHIFT)) != val) {
++ printk("%s: IOADDR %p doesn't match configuration (%x).\n",
++ CARDNAME, ioaddr, val);
++ }
++
++ /*
++ * check if the revision register is something that I
++ * recognize. These might need to be added to later,
++ * as future revisions could be added.
++ */
++ SMC_SELECT_BANK(3);
++ revision_register = SMC_GET_REV();
++ DBG(2, "%s: revision = 0x%04x\n", CARDNAME, revision_register);
++ version_string = chip_ids[ (revision_register >> 4) & 0xF];
++ if (!version_string || (revision_register & 0xff00) != 0x3300) {
++ /* I don't recognize this chip, so... */
++ printk("%s: IO %p: Unrecognized revision register 0x%04x"
++ ", Contact author.\n", CARDNAME,
++ ioaddr, revision_register);
++
++ retval = -ENODEV;
++ goto err_out;
++ }
++
++ /* At this point I'll assume that the chip is an SMC91x. */
++ if (version_printed++ == 0)
++ printk("%s", version);
++
++ /* fill in some of the fields */
++ dev->base_addr = (unsigned long)ioaddr;
++ lp->base = ioaddr;
++ lp->version = revision_register & 0xff;
++ spin_lock_init(&lp->lock);
++
++ /* Get the MAC address */
++ SMC_SELECT_BANK(1);
++ SMC_GET_MAC_ADDR(dev->dev_addr);
++
++ /* now, reset the chip, and put it into a known state */
++ smc_reset(dev);
++
++ /*
++ * If dev->irq is 0, then the device has to be banged on to see
++ * what the IRQ is.
++ *
++ * This banging doesn't always detect the IRQ, for unknown reasons.
++ * a workaround is to reset the chip and try again.
++ *
++ * Interestingly, the DOS packet driver *SETS* the IRQ on the card to
++ * be what is requested on the command line. I don't do that, mostly
++ * because the card that I have uses a non-standard method of accessing
++ * the IRQs, and because this _should_ work in most configurations.
++ *
++ * Specifying an IRQ is done with the assumption that the user knows
++ * what (s)he is doing. No checking is done!!!!
++ */
++ if (dev->irq < 1) {
++ int trials;
++
++ trials = 3;
++ while (trials--) {
++ dev->irq = smc_findirq(ioaddr);
++ if (dev->irq)
++ break;
++ /* kick the card and try again */
++ smc_reset(dev);
++ }
++ }
++ if (dev->irq == 0) {
++ printk("%s: Couldn't autodetect your IRQ. Use irq=xx.\n",
++ dev->name);
++ retval = -ENODEV;
++ goto err_out;
++ }
++ dev->irq = irq_canonicalize(dev->irq);
++
++ /* Fill in the fields of the device structure with ethernet values. */
++ ether_setup(dev);
++
++ dev->open = smc_open;
++ dev->stop = smc_close;
++ dev->hard_start_xmit = smc_hard_start_xmit;
++ dev->tx_timeout = smc_timeout;
++ dev->watchdog_timeo = msecs_to_jiffies(watchdog);
++ dev->set_multicast_list = smc_set_multicast_list;
++ dev->ethtool_ops = &smc_ethtool_ops;
++#ifdef CONFIG_NET_POLL_CONTROLLER
++ dev->poll_controller = smc_poll_controller;
++#endif
++
++ tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev);
++ INIT_WORK(&lp->phy_configure, smc_phy_configure);
++ lp->dev = dev;
++ lp->mii.phy_id_mask = 0x1f;
++ lp->mii.reg_num_mask = 0x1f;
++ lp->mii.force_media = 0;
++ lp->mii.full_duplex = 0;
++ lp->mii.dev = dev;
++ lp->mii.mdio_read = smc_phy_read;
++ lp->mii.mdio_write = smc_phy_write;
++
++ /*
++ * Locate the phy, if any.
++ */
++ if (lp->version >= (CHIP_91100 << 4))
++ smc_phy_detect(dev);
++
++ /* then shut everything down to save power */
++ smc_shutdown(dev);
++ smc_phy_powerdown(dev);
++
++ /* Set default parameters */
++ lp->msg_enable = NETIF_MSG_LINK;
++ lp->ctl_rfduplx = 0;
++ lp->ctl_rspeed = 10;
++
++ if (lp->version >= (CHIP_91100 << 4)) {
++ lp->ctl_rfduplx = 1;
++ lp->ctl_rspeed = 100;
++ }
++
++ /* Grab the IRQ */
++ retval = request_irq(dev->irq, &smc_interrupt, SMC_IRQ_FLAGS, dev->name, dev);
++ if (retval) {
++ use_poll = 1;
++ //goto err_out;
++ }
++
++#ifdef SMC_USE_PXA_DMA
++ {
++ int dma = pxa_request_dma(dev->name, DMA_PRIO_LOW,
++ smc_pxa_dma_irq, NULL);
++ if (dma >= 0)
++ dev->dma = dma;
++ }
++#endif
++
++ retval = register_netdev(dev);
++ if (retval == 0) {
++ /* now, print out the card info, in a short format.. */
++ printk("%s: %s (rev %d) at %p IRQ %d",
++ dev->name, version_string, revision_register & 0x0f,
++ lp->base, dev->irq);
++
++ if (dev->dma != (unsigned char)-1)
++ printk(" DMA %d", dev->dma);
++
++ printk("%s%s\n", nowait ? " [nowait]" : "",
++ THROTTLE_TX_PKTS ? " [throttle_tx]" : "");
++
++ if (!is_valid_ether_addr(dev->dev_addr)) {
++ printk("%s: Invalid ethernet MAC address. Please "
++ "set using ifconfig\n", dev->name);
++ } else {
++ /* Print the Ethernet address */
++ printk("%s: Ethernet addr: %s\n",
++ dev->name, print_mac(mac, dev->dev_addr));
++ }
++
++ if (lp->phy_type == 0) {
++ PRINTK("%s: No PHY found\n", dev->name);
++ } else if ((lp->phy_type & 0xfffffff0) == 0x0016f840) {
++ PRINTK("%s: PHY LAN83C183 (LAN91C111 Internal)\n", dev->name);
++ } else if ((lp->phy_type & 0xfffffff0) == 0x02821c50) {
++ PRINTK("%s: PHY LAN83C180\n", dev->name);
++ }
++ }
++
++err_out:
++#ifdef SMC_USE_PXA_DMA
++ if (retval && dev->dma != (unsigned char)-1)
++ pxa_free_dma(dev->dma);
++#endif
++ return retval;
++}
++
++static int smc_enable_device(struct platform_device *pdev)
++{
++ unsigned long flags;
++ unsigned char ecor, ecsr;
++ void __iomem *addr;
++ struct resource * res;
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib");
++ if (!res)
++ return 0;
++
++ printk("smc91x-attrib resource found, start=%x !\n", res->start);
++
++ /*
++ * Map the attribute space. This is overkill, but clean.
++ */
++ addr = ioremap(res->start, ATTRIB_SIZE);
++ if (!addr)
++ return -ENOMEM;
++
++ printk("smc91x-attrib resource remapped, start=%p !\n", addr);
++
++ /*
++ * Reset the device. We must disable IRQs around this
++ * since a reset causes the IRQ line become active.
++ */
++ local_irq_save(flags);
++ ecor = readb(addr + (ECOR << SMC_IO_SHIFT)) & ~ECOR_RESET;
++ writeb(ecor | ECOR_RESET, addr + (ECOR << SMC_IO_SHIFT));
++ readb(addr + (ECOR << SMC_IO_SHIFT));
++
++ /*
++ * Wait 100us for the chip to reset.
++ */
++ udelay(100);
++
++ /*
++ * The device will ignore all writes to the enable bit while
++ * reset is asserted, even if the reset bit is cleared in the
++ * same write. Must clear reset first, then enable the device.
++ */
++ writeb(ecor, addr + (ECOR << SMC_IO_SHIFT));
++ writeb(ecor | ECOR_ENABLE, addr + (ECOR << SMC_IO_SHIFT));
++
++ /*
++ * Set the appropriate byte/word mode.
++ */
++ ecsr = readb(addr + (ECSR << SMC_IO_SHIFT)) & ~ECSR_IOIS8;
++ if (!SMC_CAN_USE_16BIT)
++ ecsr |= ECSR_IOIS8;
++ writeb(ecsr, addr + (ECSR << SMC_IO_SHIFT));
++ local_irq_restore(flags);
++
++ iounmap(addr);
++
++ /*
++ * Wait for the chip to wake up. We could poll the control
++ * register in the main register space, but that isn't mapped
++ * yet. We know this is going to take 750us.
++ */
++ msleep(1);
++
++ return 0;
++}
++
++static int smc_request_attrib(struct platform_device *pdev)
++{
++ struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib");
++
++ if (!res)
++ return 0;
++
++ if (!request_mem_region(res->start, ATTRIB_SIZE, CARDNAME))
++ return -EBUSY;
++
++ return 0;
++}
++
++static void smc_release_attrib(struct platform_device *pdev)
++{
++ struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib");
++
++ if (res)
++ release_mem_region(res->start, ATTRIB_SIZE);
++}
++
++static inline void smc_request_datacs(struct platform_device *pdev, struct net_device *ndev)
++{
++ if (SMC_CAN_USE_DATACS) {
++ struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-data32");
++ struct smc_local *lp = netdev_priv(ndev);
++
++ if (!res)
++ return;
++
++ if(!request_mem_region(res->start, SMC_DATA_EXTENT, CARDNAME)) {
++ printk(KERN_INFO "%s: failed to request datacs memory region.\n", CARDNAME);
++ return;
++ }
++
++ lp->datacs = ioremap(res->start, SMC_DATA_EXTENT);
++ }
++}
++
++static void smc_release_datacs(struct platform_device *pdev, struct net_device *ndev)
++{
++ if (SMC_CAN_USE_DATACS) {
++ struct smc_local *lp = netdev_priv(ndev);
++ struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-data32");
++
++ if (lp->datacs)
++ iounmap(lp->datacs);
++
++ lp->datacs = NULL;
++
++ if (res)
++ release_mem_region(res->start, SMC_DATA_EXTENT);
++ }
++}
++
++/*
++ * Resources defined and added to platform data in arch/m68k/atari/config.c
++ * These are left here for reference only!
++ */
++
++struct resource ethernat_attr = {
++ .start = 0x80000000,
++ .end = 0x800000FF,
++ .name = "smc91x-attrib",
++ .flags = IORESOURCE_MEM
++};
++
++struct resource ethernat_datacs = {
++ .start = 0,
++ .end = 0,
++ .name = "smc91x-data32",
++ .flags = IORESOURCE_MEM
++};
++
++/*
++ * smc_init(void)
++ * Input parameters:
++ * dev->base_addr == 0, try to find all possible locations
++ * dev->base_addr > 0x1ff, this is the address to check
++ * dev->base_addr == <anything else>, return failure code
++ *
++ * Output:
++ * 0 --> there is a device
++ * anything else, error
++ */
++
++static int __init atari_ethernat_pdev_probe(struct platform_device *pdev)
++{
++ struct net_device *ndev;
++ struct resource *res;
++ unsigned int __iomem *addr;
++ int ret;
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs");
++ if (!res)
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ printk("smc91x-regs resource not found!\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ printk("smc91x-regs resource found, start=%x !\n", res->start);
++
++ if (!request_mem_region(res->start, SMC_IO_EXTENT, CARDNAME)) {
++ printk("could not request smc91x-regs resource at %ul!\n", res->start);
++ ret = -EBUSY;
++ goto out;
++ }
++
++ ndev = alloc_etherdev(sizeof(struct smc_local));
++ if (!ndev) {
++ printk("%s: could not allocate device.\n", CARDNAME);
++ ret = -ENOMEM;
++ goto out_release_io;
++ }
++ SET_NETDEV_DEV(ndev, &pdev->dev);
++
++ ndev->dma = (unsigned char)-1;
++ ndev->irq = platform_get_irq(pdev, 0);
++ if (ndev->irq < 0) {
++ printk("atari_91C111: cannot determine interrupt! Using timer D poll...\n");
++ ndev->irq = IRQ_MFP_TIMD;
++ /* timer actually set up later */
++ }
++
++ ret = smc_request_attrib(pdev);
++ if (ret)
++ goto out_free_netdev;
++#if defined(CONFIG_SA1100_ASSABET)
++ NCR_0 |= NCR_ENET_OSC_EN;
++#endif
++ ret = smc_enable_device(pdev);
++ if (ret)
++ goto out_release_attrib;
++
++ addr = ioremap(res->start, SMC_IO_EXTENT);
++ if (!addr) {
++ ret = -ENOMEM;
++ goto out_release_attrib;
++ }
++
++ /*
++ * Maybe postpone, see below?
++ */
++#ifdef SMC_USE_PXA_DMA
++ {
++ struct smc_local *lp = netdev_priv(ndev);
++ lp->device = &pdev->dev;
++ lp->physaddr = res->start;
++ }
++#endif
++
++ printk("smc91x-regs resource remapped, start=%p!\n", addr);
++
++ // about to probe for device; need to enable net IRQ here!
++ // probe for base address + 0x23 or 0x20
++
++ platform_set_drvdata(pdev, ndev);
++ ret = smc_probe(ndev, addr);
++ if (ret != 0)
++ goto out_iounmap;
++ /*
++ * allocation of lp and setting of device and physaddr maybe here instead?
++ */
++#ifdef SMC_USE_PXA_DMA
++ else {
++ struct smc_local *lp = netdev_priv(ndev);
++ lp->physaddr = res->start;
++ }
++#endif
++
++
++ if (ndev->irq < 0) {
++ if (use_poll)
++ atari_ethernat_start_poll(ndev);
++ } else if (ndev->irq == IRQ_MFP_TIMD) {
++ // init timer if not already running
++ /* set Timer D data Register */
++ mfp.tim_dt_d = 123; /* 200 Hz */
++ /* start timer D, div = 1:100 */
++ mfp.tim_ct_cd = (mfp.tim_ct_cd & 0xf0) | 0x6;
++ }
++
++ smc_request_datacs(pdev, ndev);
++
++ return 0;
++
++ out_iounmap:
++ platform_set_drvdata(pdev, NULL);
++ iounmap(addr);
++ out_release_attrib:
++ smc_release_attrib(pdev);
++ out_free_netdev:
++ free_netdev(ndev);
++ out_release_io:
++ release_mem_region(res->start, SMC_IO_EXTENT);
++ out:
++ printk("%s: not found (%d).\n", CARDNAME, ret);
++
++ return ret;
++}
++
++static int smc_drv_remove(struct platform_device *pdev)
++{
++ struct net_device *ndev = platform_get_drvdata(pdev);
++ struct smc_local *lp = netdev_priv(ndev);
++ struct resource *res;
++
++ platform_set_drvdata(pdev, NULL);
++
++ if (use_poll)
++ atari_ethernat_stop_poll(ndev);
++
++ unregister_netdev(ndev);
++
++ free_irq(ndev->irq, ndev);
++
++#ifdef SMC_USE_PXA_DMA
++ if (ndev->dma != (unsigned char)-1)
++ pxa_free_dma(ndev->dma);
++#endif
++ iounmap(lp->base);
++
++ smc_release_datacs(pdev,ndev);
++ smc_release_attrib(pdev);
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-regs");
++ if (!res)
++ platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ release_mem_region(res->start, SMC_IO_EXTENT);
++
++ free_netdev(ndev);
++
++ return 0;
++}
++
++static int smc_drv_suspend(struct platform_device *dev, pm_message_t state)
++{
++ struct net_device *ndev = platform_get_drvdata(dev);
++
++ if (ndev) {
++ if (netif_running(ndev)) {
++ netif_device_detach(ndev);
++ smc_shutdown(ndev);
++ smc_phy_powerdown(ndev);
++ }
++ }
++ return 0;
++}
++
++static int smc_drv_resume(struct platform_device *dev)
++{
++ struct net_device *ndev = platform_get_drvdata(dev);
++
++ if (ndev) {
++ struct smc_local *lp = netdev_priv(ndev);
++ smc_enable_device(dev);
++ if (netif_running(ndev)) {
++ smc_reset(ndev);
++ smc_enable(ndev);
++ if (lp->phy_type != 0)
++ smc_phy_configure(&lp->phy_configure);
++ netif_device_attach(ndev);
++ }
++ }
++ return 0;
++}
++
++static struct platform_driver smc_driver = {
++ .probe = atari_ethernat_pdev_probe,
++ .remove = smc_drv_remove,
++ .suspend = smc_drv_suspend,
++ .resume = smc_drv_resume,
++ .driver = {
++ .name = CARDNAME,
++ },
++};
++
++static int __init smc_init(void)
++{
++ if (!MACH_IS_ATARI)
++ return -ENODEV;
++
++#ifdef MODULE
++ if (io == -1)
++ printk(KERN_WARNING
++ "%s: You shouldn't use auto-probing with insmod!\n",
++ CARDNAME);
++#endif
++
++ return platform_driver_register(&smc_driver);
++}
++
++static void __exit smc_cleanup(void)
++{
++ platform_driver_unregister(&smc_driver);
++}
++
++module_init(smc_init);
++module_exit(smc_cleanup);
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernec.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-ethernec.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,1070 @@
+Subject: [PATCH] m68k: Atari EtherNEC driver
+Cc: Jeff Garzik <jgarzik at pobox.com>, netdev at vger.kernel.org
+
+From: Michael Schmitz <schmitz at opal.biophys.uni-duesseldorf.de>
+
+Atari EtherNEC driver
+
+Signed-off-by: Michael Schmitz <schmitz at debian.org>
+Signed-off-by: Roman Zippel <zippel at linux-m68k.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/net/Makefile | 1
+ drivers/net/Space.c | 4
+ drivers/net/atari_ethernec.c | 1021 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 1026 insertions(+)
+
+--- a/drivers/net/Makefile
++++ b/drivers/net/Makefile
+@@ -197,6 +197,7 @@ obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o
+ obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
+ obj-$(CONFIG_DECLANCE) += declance.o
+ obj-$(CONFIG_ATARILANCE) += atarilance.o
++obj-$(CONFIG_ATARI_ETHERNEC) += atari_ethernec.o 8390.o
+ obj-$(CONFIG_A2065) += a2065.o
+ obj-$(CONFIG_HYDRA) += hydra.o
+ obj-$(CONFIG_ARIADNE) += ariadne.o
+--- a/drivers/net/Space.c
++++ b/drivers/net/Space.c
+@@ -72,6 +72,7 @@ extern struct net_device *SK_init(int un
+ extern struct net_device *seeq8005_probe(int unit);
+ extern struct net_device *smc_init(int unit);
+ extern struct net_device *atarilance_probe(int unit);
++extern struct net_device *atari_ethernec_probe(int unit);
+ extern struct net_device *sun3lance_probe(int unit);
+ extern struct net_device *sun3_82586_probe(int unit);
+ extern struct net_device *apne_probe(int unit);
+@@ -253,6 +254,9 @@ static struct devprobe2 m68k_probes[] __
+ #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */
+ {atarilance_probe, 0},
+ #endif
++#ifdef CONFIG_ATARI_ETHERNEC /* NE2000 based ROM port ethernet cards */
++ {atari_ethernec_probe, 0},
++#endif
+ #ifdef CONFIG_SUN3LANCE /* sun3 onboard Lance chip */
+ {sun3lance_probe, 0},
+ #endif
+--- /dev/null
++++ b/drivers/net/atari_ethernec.c
+@@ -0,0 +1,1021 @@
++/*
++ * atari_ethernec.c: Atari cartridge port ethernet adapter
++ * (C) 2006 Michael Schmitz
++ *
++ * Modified after:
++ */
++
++/* ne.c: A general non-shared-memory NS8390 ethernet driver for linux. */
++/*
++ Written 1992-94 by Donald Becker.
++
++ Copyright 1993 United States Government as represented by the
++ Director, National Security Agency.
++
++ This software may be used and distributed according to the terms
++ of the GNU General Public License, incorporated herein by reference.
++
++ The author may be reached as becker at scyld.com, or C/O
++ Scyld Computing Corporation, 410 Severn Ave., Suite 210, Annapolis MD 21403
++
++ This driver should work with many programmed-I/O 8390-based ethernet
++ boards. Currently it supports the NE1000, NE2000, many clones,
++ and some Cabletron products.
++
++ Changelog:
++
++ Paul Gortmaker : use ENISR_RDC to monitor Tx PIO uploads, made
++ sanity checks and bad clone support optional.
++ Paul Gortmaker : new reset code, reset card after probe at boot.
++ Paul Gortmaker : multiple card support for module users.
++ Paul Gortmaker : Support for PCI ne2k clones, similar to lance.c
++ Paul Gortmaker : Allow users with bad cards to avoid full probe.
++ Paul Gortmaker : PCI probe changes, more PCI cards supported.
++ rjohnson at analogic.com : Changed init order so an interrupt will only
++ occur after memory is allocated for dev->priv. Deallocated memory
++ last in cleanup_modue()
++ Richard Guenther : Added support for ISAPnP cards
++ Paul Gortmaker : Discontinued PCI support - use ne2k-pci.c instead.
++ Hayato Fujiwara : Add m32r support.
++
++*/
++
++/*
++ * From the driver distribution kit by Thomas Redelberger:
++ *
++ * Hardware circuit description (see directory ETHERNEC for schematics)
++ *
++ * As there is no reset line on the CP, a resistor and a capacitor are
++ * used to reset the NE card on power up.
++ *
++ * Reading from the NE card is done by a read cycle on the CP at address
++ * /ROM4 + 512*ISA address as the ISA address lines A0-A4 are connected
++ * to CP A9-A13. /ROM4 going low will start the ISA read cycle, enable
++ * the ISA bus buffers of the NE card and start decoding of the ISA IO
++ * address by the NE card. /ROM4 going high ends the cycle and the
++ * processor latches the data.
++ *
++ * Because the CP is read only writing to the NE card must be done with
++ * the trick to read from addresses that stand for the data. Dummy reads
++ * at /ROM3 base address + data*2 + ISA address*512 effect this. You
++ * might wonder why everything appears to be shifted up one bit. There is
++ * no CP "A0" address line. There are the signals /UDS and /LDS instead
++ * typical for the 68000 family. The original design which generated an
++ * "A0" worked on an ST and an STE but did not on a Falcon.
++ *
++ * The falling edge of /ROM3 enables the CP address lines A1-A8 onto the
++ * data bus and starts the ISA write cycle. The rising edge will end the
++ * ISA write cycle and the NE latches the data. The processor will also
++ * see and just read this same data but that is harmless.
++ * Elmar Hilgart reported that the bus buffer IC shall be an TTL F-type
++ * to keep up with the fast cycles on the Falcon.
++ *
++ * Base addresses:
++ * rom4 EQU $00fa0000 ; ROM4 base address
++ * rom3 EQU $00fb0000 ; ROM3 base address
++ *
++ */
++
++/* Routines for the NatSemi-based designs (NE[12]000). */
++
++static const char version1[] =
++"ne.c:v1.10 9/23/94 Donald Becker (becker at scyld.com)\n";
++static const char version2[] =
++"atari_ethernec.c 11/10/06 Michael Schmitz (schmitz at debian.org)\n";
++
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/errno.h>
++#include <linux/isapnp.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/delay.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/jiffies.h>
++#include <linux/workqueue.h>
++
++#include <asm/system.h>
++#include <asm/atarihw.h>
++#include <asm/atariints.h>
++#include <asm/io.h>
++
++#include "8390.h"
++
++#define DRV_NAME "ethernec"
++
++/* Some defines that people can play with if so inclined. */
++
++/* Do we support clones that don't adhere to 14,15 of the SAprom ? */
++#define SUPPORT_NE_BAD_CLONES
++
++/* Do we perform extra sanity checks on stuff ? */
++/* #define NE_SANITY_CHECK */
++
++/* Do we implement the read before write bugfix ? */
++/* #define NE_RW_BUGFIX */
++
++/* Do we have a non std. amount of memory? (in units of 256 byte pages) */
++/* #define PACKETBUF_MEMSIZE 0x40 */
++
++/* A zero-terminated list of I/O addresses to be probed at boot. */
++#ifndef MODULE
++static unsigned int netcard_portlist[] __initdata = {
++ 0x300, 0x280, 0x320, 0x340, 0x360, 0x380, 0
++};
++#endif
++
++static struct isapnp_device_id isapnp_clone_list[] __initdata = {
++ { ISAPNP_CARD_ID('A','X','E',0x2011),
++ ISAPNP_VENDOR('A','X','E'), ISAPNP_FUNCTION(0x2011),
++ (long) "NetGear EA201" },
++ { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
++ ISAPNP_VENDOR('E','D','I'), ISAPNP_FUNCTION(0x0216),
++ (long) "NN NE2000" },
++ { ISAPNP_ANY_ID, ISAPNP_ANY_ID,
++ ISAPNP_VENDOR('P','N','P'), ISAPNP_FUNCTION(0x80d6),
++ (long) "Generic PNP" },
++ { } /* terminate list */
++};
++
++MODULE_DEVICE_TABLE(isapnp, isapnp_clone_list);
++
++#ifdef SUPPORT_NE_BAD_CLONES
++/* A list of bad clones that we none-the-less recognize. */
++static struct { const char *name8, *name16; unsigned char SAprefix[4];}
++bad_clone_list[] __initdata = {
++ {"DE100", "DE200", {0x00, 0xDE, 0x01,}},
++ {"DE120", "DE220", {0x00, 0x80, 0xc8,}},
++ {"DFI1000", "DFI2000", {'D', 'F', 'I',}}, /* Original, eh? */
++ {"EtherNext UTP8", "EtherNext UTP16", {0x00, 0x00, 0x79}},
++ {"NE1000","NE2000-invalid", {0x00, 0x00, 0xd8}}, /* Ancient real NE1000. */
++ {"NN1000", "NN2000", {0x08, 0x03, 0x08}}, /* Outlaw no-name clone. */
++ {"4-DIM8","4-DIM16", {0x00,0x00,0x4d,}}, /* Outlaw 4-Dimension cards. */
++ {"Con-Intl_8", "Con-Intl_16", {0x00, 0x00, 0x24}}, /* Connect Int'nl */
++ {"ET-100","ET-200", {0x00, 0x45, 0x54}}, /* YANG and YA clone */
++ {"COMPEX","COMPEX16",{0x00,0x80,0x48}}, /* Broken ISA Compex cards */
++ {"E-LAN100", "E-LAN200", {0x00, 0x00, 0x5d}}, /* Broken ne1000 clones */
++ {"PCM-4823", "PCM-4823", {0x00, 0xc0, 0x6c}}, /* Broken Advantech MoBo */
++ {"REALTEK", "RTL8019", {0x00, 0x00, 0xe8}}, /* no-name with Realtek chip */
++#if defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938)
++ {"RBHMA4X00-RTL8019", "RBHMA4X00/RTL8019", {0x00, 0x60, 0x0a}}, /* Toshiba built-in */
++#endif
++ {"LCS-8834", "LCS-8836", {0x04, 0x04, 0x37}}, /* ShinyNet (SET) */
++ {NULL,}
++};
++#endif
++
++/* ---- No user-serviceable parts below ---- */
++
++#define NE_BASE (dev->base_addr)
++#define NE_CMD 0x00
++#define NE_DATAPORT 0x10 /* NatSemi-defined port window offset. */
++#define NE_RESET 0x1f /* Issue a read to reset, a write to clear. */
++#define NE_IO_EXTENT 0x20
++
++#define NE1SM_START_PG 0x20 /* First page of TX buffer */
++#define NE1SM_STOP_PG 0x40 /* Last page +1 of RX ring */
++#define NESM_START_PG 0x40 /* First page of TX buffer */
++#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */
++
++#if defined(CONFIG_PLAT_MAPPI)
++# define DCR_VAL 0x4b
++#elif defined(CONFIG_PLAT_OAKS32R) || \
++ defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938) || \
++ defined(CONFIG_ATARI_ETHERNEC) || defined(CONFIG_ATARI_ETHERNEC_MODULE)
++# define DCR_VAL 0x48 /* 8-bit mode */
++#else
++# define DCR_VAL 0x49
++#endif
++
++#if defined(CONFIG_ATARI_ETHERNEC) || defined(CONFIG_ATARI_ETHERNEC_MODULE)
++# define ETHERNEC_RTL_8019_BASE 0x300
++# define ETHERNEC_RTL_8019_IRQ IRQ_MFP_TIMD
++#endif
++
++static int ne_probe1(struct net_device *dev, int ioaddr);
++static int ne_probe_isapnp(struct net_device *dev);
++
++static int ne_open(struct net_device *dev);
++static int ne_close(struct net_device *dev);
++
++static void ne_reset_8390(struct net_device *dev);
++static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
++ int ring_page);
++static void ne_block_input(struct net_device *dev, int count,
++ struct sk_buff *skb, int ring_offset);
++static void ne_block_output(struct net_device *dev, const int count,
++ const unsigned char *buf, const int start_page);
++
++
++/*
++ * The Atari ROM port has no interrupt line, so we poll the card instead.
++ */
++
++static int use_poll;
++
++/*
++ * This is used by cleanup, to prevent the module from being unloaded while
++ * intrpt_routine is still in the task queue
++ */
++static wait_queue_head_t WaitQ;
++
++static struct delayed_work tqueue;
++
++static struct net_device *poll_dev = NULL;
++
++static void atari_ethernec_int(struct work_struct *work)
++{
++ struct net_device *dev = poll_dev;
++
++ if (!dev) {
++ /* If cleanup wants us to die */
++ if (waitqueue_active(&WaitQ))
++ wake_up(&WaitQ); /* Now cleanup_module can return */
++ else
++ /* Put ourselves back in the task queue */
++ schedule_delayed_work(&tqueue, 1);
++ return;
++ }
++
++ if (netif_running(dev))
++ ei_interrupt(dev->irq, dev);
++
++ /* If cleanup wants us to die */
++ if (waitqueue_active(&WaitQ))
++ wake_up(&WaitQ); /* Now cleanup_module can return */
++ else
++ /* Put ourselves back in the task queue */
++ schedule_delayed_work(&tqueue, 0); /* reduced delay from 1 */
++}
++
++static void atari_ethernec_start_poll(struct net_device *dev)
++{
++ poll_dev = dev;
++
++ init_waitqueue_head(&WaitQ);
++
++ INIT_DELAYED_WORK(&tqueue, atari_ethernec_int);
++ schedule_delayed_work(&tqueue, 1);
++}
++
++static void atari_ethernec_stop_poll(struct net_device *dev)
++{
++ poll_dev = NULL;
++
++ if (dev)
++ sleep_on(&WaitQ);
++}
++
++
++/* Probe for various non-shared-memory ethercards.
++
++ NEx000-clone boards have a Station Address PROM (SAPROM) in the packet
++ buffer memory space. NE2000 clones have 0x57,0x57 in bytes 0x0e,0x0f of
++ the SAPROM, while other supposed NE2000 clones must be detected by their
++ SA prefix.
++
++ Reading the SAPROM from a word-wide card with the 8390 set in byte-wide
++ mode results in doubled values, which can be detected and compensated for.
++
++ The probe is also responsible for initializing the card and filling
++ in the 'dev' and 'ei_status' structures.
++
++ We use the minimum memory size for some ethercard product lines, iff we can't
++ distinguish models. You can increase the packet buffer size by setting
++ PACKETBUF_MEMSIZE. Reported Cabletron packet buffer locations are:
++ E1010 starts at 0x100 and ends at 0x2000.
++ E1010-x starts at 0x100 and ends at 0x8000. ("-x" means "more memory")
++ E2010 starts at 0x100 and ends at 0x4000.
++ E2010-x starts at 0x100 and ends at 0xffff.
++*/
++
++static int __init do_ne_probe(struct net_device *dev)
++{
++ unsigned int base_addr = dev->base_addr;
++ int rv;
++#ifndef MODULE
++ int orig_irq = dev->irq;
++#endif
++
++ /* First check any supplied i/o locations. User knows best. <cough> */
++ if (base_addr > 0x1ff) { /* Check a single specified location. */
++ rv = ne_probe1(dev, base_addr);
++ if (!rv && use_poll) {
++ /* Seems we have a valid device here; set up polling routine */
++ poll_dev = dev;
++ atari_ethernec_start_poll(dev);
++ }
++ return rv;
++ } else if (base_addr != 0) /* Don't probe at all. */
++ return -ENXIO;
++
++ /* Then look for any installed ISAPnP clones */
++ if (isapnp_present() && (ne_probe_isapnp(dev) == 0))
++ return 0;
++
++#ifndef MODULE
++ /* Last resort. The semi-risky ISA auto-probe. */
++ for (base_addr = 0; netcard_portlist[base_addr] != 0; base_addr++) {
++ int ioaddr = netcard_portlist[base_addr];
++ dev->irq = orig_irq;
++ rv = ne_probe1(dev, ioaddr);
++ if (rv == 0) {
++ if (use_poll) {
++ poll_dev = dev;
++ atari_ethernec_start_poll(dev);
++ }
++ return 0;
++ }
++ }
++#endif
++
++ return -ENODEV;
++}
++
++#ifndef MODULE
++struct net_device * __init atari_ethernec_probe(int unit)
++{
++ struct net_device *dev;
++ int err;
++
++ if (!MACH_IS_ATARI)
++ return ERR_PTR(-ENODEV);
++
++ dev = alloc_ei_netdev();
++ if (!dev)
++ return ERR_PTR(-ENOMEM);
++
++ sprintf(dev->name, "eth%d", unit);
++ netdev_boot_setup_check(dev);
++
++#if defined(CONFIG_ATARI_ETHERNEC)
++ dev->base_addr = ETHERNEC_RTL_8019_BASE;
++ dev->irq = ETHERNEC_RTL_8019_IRQ;
++#endif
++ err = do_ne_probe(dev);
++ if (err)
++ goto out;
++
++ /* Seems we have a valid device here; set up polling routine */
++ return dev;
++out:
++ free_netdev(dev);
++ return ERR_PTR(err);
++}
++#endif
++
++static int __init ne_probe_isapnp(struct net_device *dev)
++{
++ int i;
++
++ for (i = 0; isapnp_clone_list[i].vendor != 0; i++) {
++ struct pnp_dev *idev = NULL;
++
++ while ((idev = pnp_find_dev(NULL,
++ isapnp_clone_list[i].vendor,
++ isapnp_clone_list[i].function,
++ idev))) {
++ /* Avoid already found cards from previous calls */
++ if (pnp_device_attach(idev) < 0)
++ continue;
++ if (pnp_activate_dev(idev) < 0) {
++ pnp_device_detach(idev);
++ continue;
++ }
++ /* if no io and irq, search for next */
++ if (!pnp_port_valid(idev, 0) || !pnp_irq_valid(idev, 0)) {
++ pnp_device_detach(idev);
++ continue;
++ }
++ /* found it */
++ dev->base_addr = pnp_port_start(idev, 0);
++ dev->irq = pnp_irq(idev, 0);
++ printk(KERN_INFO "atari_ethernec.c: ISAPnP reports %s at i/o %#lx, irq %d.\n",
++ (char *) isapnp_clone_list[i].driver_data,
++ dev->base_addr, dev->irq);
++ if (ne_probe1(dev, dev->base_addr) != 0) { /* Shouldn't happen. */
++ printk(KERN_ERR "atari_ethernec.c: Probe of ISAPnP card at %#lx failed.\n",
++ dev->base_addr);
++ pnp_device_detach(idev);
++ return -ENXIO;
++ }
++ ei_status.priv = (unsigned long)idev;
++ break;
++ }
++ if (!idev)
++ continue;
++ return 0;
++ }
++
++ return -ENODEV;
++}
++
++static int __init ne_probe1(struct net_device *dev, int ioaddr)
++{
++ int i;
++ unsigned char SA_prom[32];
++ int wordlength = 2;
++ const char *name = NULL;
++ int start_page, stop_page;
++ int neX000, ctron, copam, bad_card;
++ int reg0, ret;
++ static unsigned version_printed;
++
++ if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
++ return -EBUSY;
++
++ reg0 = inb_p(ioaddr);
++ if (reg0 == 0xFF) {
++ ret = -ENODEV;
++ goto err_out;
++ }
++
++ /* Do a preliminary verification that we have a 8390. */
++ {
++ int regd;
++ outb_p(E8390_NODMA+E8390_PAGE1+E8390_STOP, ioaddr + E8390_CMD);
++ regd = inb_p(ioaddr + 0x0d);
++ outb_p(0xff, ioaddr + 0x0d);
++ outb_p(E8390_NODMA+E8390_PAGE0, ioaddr + E8390_CMD);
++ inb_p(ioaddr + EN0_COUNTER0); /* Clear the counter by reading. */
++ if (inb_p(ioaddr + EN0_COUNTER0) != 0) {
++ outb_p(reg0, ioaddr);
++ outb_p(regd, ioaddr + 0x0d); /* Restore the old values. */
++ ret = -ENODEV;
++ goto err_out;
++ }
++ }
++
++ if (ei_debug && version_printed++ == 0)
++ printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2);
++
++ /* A user with a poor card that fails to ack the reset, or that
++ does not have a valid 0x57,0x57 signature can still use this
++ without having to recompile. Specifying an i/o address along
++ with an otherwise unused dev->mem_end value of "0xBAD" will
++ cause the driver to skip these parts of the probe. */
++
++ bad_card = ((dev->base_addr != 0) && (dev->mem_end == 0xbad));
++
++ /* Reset card. Who knows what dain-bramaged state it was left in. */
++
++ {
++ unsigned long reset_start_time = jiffies;
++
++ /* DON'T change these to inb_p/outb_p or reset will fail on clones. */
++ outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET);
++
++ while ((inb_p(ioaddr + EN0_ISR) & ENISR_RESET) == 0) {
++ if (time_after(jiffies, reset_start_time + 2 * HZ / 100)) {
++ if (bad_card) {
++ printk(" (warning: no reset ack)");
++ break;
++ } else {
++ // MSch: ARAnyM exits here
++ printk(" not found (no reset ack).\n");
++ ret = -ENODEV;
++ goto err_out;
++ }
++ }
++ }
++
++ outb_p(0xff, ioaddr + EN0_ISR); /* Ack all intr. */
++ }
++
++ /* Read the 16 bytes of station address PROM.
++ We must first initialize registers, similar to NS8390_init(eifdev, 0).
++ We can't reliably read the SAPROM address without this.
++ (I learned the hard way!). */
++ {
++ struct {unsigned char value, offset; } program_seq[] =
++ {
++ {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD}, /* Select page 0*/
++ {0x48, EN0_DCFG}, /* Set byte-wide (0x48) access. */
++ {0x00, EN0_RCNTLO}, /* Clear the count regs. */
++ {0x00, EN0_RCNTHI},
++ {0x00, EN0_IMR}, /* Mask completion irq. */
++ {0xFF, EN0_ISR},
++ {E8390_RXOFF, EN0_RXCR}, /* 0x20 Set to monitor */
++ {E8390_TXOFF, EN0_TXCR}, /* 0x02 and loopback mode. */
++ {32, EN0_RCNTLO},
++ {0x00, EN0_RCNTHI},
++ {0x00, EN0_RSARLO}, /* DMA starting at 0x0000. */
++ {0x00, EN0_RSARHI},
++ {E8390_RREAD+E8390_START, E8390_CMD},
++ };
++
++ for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
++ outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
++
++ }
++ for (i = 0; i < 32 /*sizeof(SA_prom)*/; i += 2) {
++ SA_prom[i] = inb(ioaddr + NE_DATAPORT);
++ SA_prom[i+1] = inb(ioaddr + NE_DATAPORT);
++ if (SA_prom[i] != SA_prom[i+1])
++ wordlength = 1;
++ }
++
++ if (wordlength == 2) {
++ for (i = 0; i < 16; i++)
++ SA_prom[i] = SA_prom[i+i];
++ /* We must set the 8390 for word mode. */
++ outb_p(DCR_VAL, ioaddr + EN0_DCFG);
++ start_page = NESM_START_PG;
++
++ /*
++ * Realtek RTL8019AS datasheet says that the PSTOP register
++ * shouldn't exceed 0x60 in 8-bit mode.
++ * This chip can be identified by reading the signature from
++ * the remote byte count registers (otherwise write-only)...
++ */
++ if ((DCR_VAL & 0x01) == 0 && /* 8-bit mode */
++ inb(ioaddr + EN0_RCNTLO) == 0x50 &&
++ inb(ioaddr + EN0_RCNTHI) == 0x70)
++ stop_page = 0x60;
++ else
++ stop_page = NESM_STOP_PG;
++ } else {
++ start_page = NE1SM_START_PG;
++ stop_page = NE1SM_STOP_PG;
++ }
++
++#if defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R)
++ neX000 = ((SA_prom[14] == 0x57 && SA_prom[15] == 0x57)
++ || (SA_prom[14] == 0x42 && SA_prom[15] == 0x42));
++#else
++ neX000 = (SA_prom[14] == 0x57 && SA_prom[15] == 0x57);
++#endif
++ ctron = (SA_prom[0] == 0x00 && SA_prom[1] == 0x00 && SA_prom[2] == 0x1d);
++ copam = (SA_prom[14] == 0x49 && SA_prom[15] == 0x00);
++
++ /* Set up the rest of the parameters. */
++ if (neX000 || bad_card || copam) {
++ name = (wordlength == 2) ? "NE2000" : "NE1000";
++ } else if (ctron) {
++ name = (wordlength == 2) ? "Ctron-8" : "Ctron-16";
++ start_page = 0x01;
++ stop_page = (wordlength == 2) ? 0x40 : 0x20;
++ } else {
++#ifdef SUPPORT_NE_BAD_CLONES
++ /* Ack! Well, there might be a *bad* NE*000 clone there.
++ Check for total bogus addresses. */
++ for (i = 0; bad_clone_list[i].name8; i++) {
++ if (SA_prom[0] == bad_clone_list[i].SAprefix[0] &&
++ SA_prom[1] == bad_clone_list[i].SAprefix[1] &&
++ SA_prom[2] == bad_clone_list[i].SAprefix[2]) {
++ if (wordlength == 2) {
++ name = bad_clone_list[i].name16;
++ } else {
++ name = bad_clone_list[i].name8;
++ }
++ break;
++ }
++ }
++ if (bad_clone_list[i].name8 == NULL) {
++ printk(" not found (invalid signature %2.2x %2.2x).\n",
++ SA_prom[14], SA_prom[15]);
++ ret = -ENXIO;
++ goto err_out;
++ }
++#else
++ printk(" not found.\n");
++ ret = -ENXIO;
++ goto err_out;
++#endif
++ }
++
++ if (dev->irq < 2) {
++ unsigned long cookie = probe_irq_on();
++ outb_p(0x50, ioaddr + EN0_IMR); /* Enable one interrupt. */
++ outb_p(0x00, ioaddr + EN0_RCNTLO);
++ outb_p(0x00, ioaddr + EN0_RCNTHI);
++ outb_p(E8390_RREAD+E8390_START, ioaddr); /* Trigger it... */
++ mdelay(10); /* wait 10ms for interrupt to propagate */
++ outb_p(0x00, ioaddr + EN0_IMR); /* Mask it again. */
++ dev->irq = probe_irq_off(cookie);
++ if (ei_debug > 2)
++ printk(" autoirq is %d\n", dev->irq);
++ } else if (dev->irq == 2)
++ /* Fixup for users that don't know that IRQ 2 is really IRQ 9,
++ or don't know which one to set. */
++ dev->irq = 9;
++
++ /*
++ * use timer based polling!
++ */
++ if (! dev->irq) {
++ printk(" failed to detect IRQ line. Assuming irq %d\n",
++ ETHERNEC_RTL_8019_IRQ);
++ dev->irq = ETHERNEC_RTL_8019_IRQ;
++ /* timer routine set up in atari_ethernec_probe() */
++ if (dev->irq == IRQ_MFP_TIMD) {
++ /* set Timer D data Register */
++ mfp.tim_dt_d = 123; /* 200 Hz */
++ /* start timer D, div = 1:100 */
++ mfp.tim_ct_cd = (mfp.tim_ct_cd & 0xf0) | 0x6;
++ }
++ ret = request_irq(dev->irq, ei_interrupt, 0, name, dev);
++ if (ret) {
++ printk(" unable to get IRQ %d (errno=%d), polling instead.\n",
++ dev->irq, ret);
++ use_poll = 1;
++ }
++ } else {
++
++ /* Snarf the interrupt now. There's no point in waiting since we cannot
++ share and the board will usually be enabled. */
++ ret = request_irq(dev->irq, ei_interrupt, 0, name, dev);
++ if (ret) {
++ printk(" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
++ goto err_out;
++ }
++ }
++ dev->base_addr = ioaddr;
++
++#ifdef CONFIG_PLAT_MAPPI
++ outb_p(E8390_NODMA + E8390_PAGE1 + E8390_STOP,
++ ioaddr + E8390_CMD); /* 0x61 */
++ for (i = 0; i < ETHER_ADDR_LEN; i++) {
++ dev->dev_addr[i] = SA_prom[i] = inb_p(ioaddr + EN1_PHYS_SHIFT(i));
++ printk(" %2.2x", SA_prom[i]);
++ }
++#else
++ for (i = 0; i < ETHER_ADDR_LEN; i++) {
++ printk(" %2.2x", SA_prom[i]);
++ dev->dev_addr[i] = SA_prom[i];
++ }
++#endif
++
++ printk("\n%s: %s found at %#x, using IRQ %d.\n",
++ dev->name, name, ioaddr, dev->irq);
++
++ ei_status.name = name;
++ ei_status.tx_start_page = start_page;
++ ei_status.stop_page = stop_page;
++
++ /* Use 16-bit mode only if this wasn't overridden by DCR_VAL */
++ ei_status.word16 = (wordlength == 2 && (DCR_VAL & 0x01));
++
++ ei_status.rx_start_page = start_page + TX_PAGES;
++#ifdef PACKETBUF_MEMSIZE
++ /* Allow the packet buffer size to be overridden by know-it-alls. */
++ ei_status.stop_page = ei_status.tx_start_page + PACKETBUF_MEMSIZE;
++#endif
++
++ ei_status.reset_8390 = &ne_reset_8390;
++ ei_status.block_input = &ne_block_input;
++ ei_status.block_output = &ne_block_output;
++ ei_status.get_8390_hdr = &ne_get_8390_hdr;
++ ei_status.priv = 0;
++ dev->open = &ne_open;
++ dev->stop = &ne_close;
++#ifdef CONFIG_NET_POLL_CONTROLLER
++ dev->poll_controller = ei_poll;
++#endif
++ NS8390_init(dev, 0);
++
++ ret = register_netdev(dev);
++ if (ret)
++ goto out_irq;
++ return 0;
++
++out_irq:
++ free_irq(dev->irq, dev);
++err_out:
++ release_region(ioaddr, NE_IO_EXTENT);
++ return ret;
++}
++
++static int ne_open(struct net_device *dev)
++{
++ ei_open(dev);
++ return 0;
++}
++
++static int ne_close(struct net_device *dev)
++{
++ if (ei_debug > 1)
++ printk(KERN_DEBUG "%s: Shutting down ethercard.\n", dev->name);
++ ei_close(dev);
++ return 0;
++}
++
++/* Hard reset the card. This used to pause for the same period that a
++ 8390 reset command required, but that shouldn't be necessary. */
++
++static void ne_reset_8390(struct net_device *dev)
++{
++ unsigned long reset_start_time = jiffies;
++
++ if (ei_debug > 1)
++ printk(KERN_DEBUG "resetting the 8390 t=%ld...", jiffies);
++
++ /* DON'T change these to inb_p/outb_p or reset will fail on clones. */
++ outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET);
++
++ ei_status.txing = 0;
++ ei_status.dmaing = 0;
++
++ /* This check _should_not_ be necessary, omit eventually. */
++ while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) {
++ if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
++ printk(KERN_WARNING "%s: ne_reset_8390() did not complete.\n",
++ dev->name);
++ break;
++ }
++ }
++ outb_p(ENISR_RESET, NE_BASE + EN0_ISR); /* Ack intr. */
++}
++
++/* Grab the 8390 specific header. Similar to the block_input routine, but
++ we don't need to be concerned with ring wrap as the header will be at
++ the start of a page, so we optimize accordingly. */
++
++static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
++{
++ int nic_base = dev->base_addr;
++
++ /* This *shouldn't* happen. If it does, it's the last thing you'll see */
++
++ if (ei_status.dmaing)
++ {
++ printk(KERN_EMERG "%s: DMAing conflict in ne_get_8390_hdr "
++ "[DMAstat:%d][irqlock:%d].\n",
++ dev->name, ei_status.dmaing, ei_status.irqlock);
++ return;
++ }
++
++ ei_status.dmaing |= 0x01;
++ outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);
++ outb_p(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO);
++ outb_p(0, nic_base + EN0_RCNTHI);
++ outb_p(0, nic_base + EN0_RSARLO); /* On page boundary */
++ outb_p(ring_page, nic_base + EN0_RSARHI);
++ outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
++
++ if (ei_status.word16)
++ insw(NE_BASE + NE_DATAPORT, hdr, sizeof(struct e8390_pkt_hdr)>>1);
++ else
++ insb(NE_BASE + NE_DATAPORT, hdr, sizeof(struct e8390_pkt_hdr));
++
++ outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
++ ei_status.dmaing &= ~0x01;
++
++ le16_to_cpus(&hdr->count);
++}
++
++/* Block input and output, similar to the Crynwr packet driver. If you
++ are porting to a new ethercard, look at the packet driver source for hints.
++ The NEx000 doesn't share the on-board packet memory -- you have to put
++ the packet out through the "remote DMA" dataport using outb. */
++
++static void ne_block_input(struct net_device *dev, int count,
++ struct sk_buff *skb, int ring_offset)
++{
++#ifdef NE_SANITY_CHECK
++ int xfer_count = count;
++#endif
++ int nic_base = dev->base_addr;
++ char *buf = skb->data;
++
++ /* This *shouldn't* happen. If it does, it's the last thing you'll see */
++ if (ei_status.dmaing) {
++ printk(KERN_EMERG "%s: DMAing conflict in ne_block_input "
++ "[DMAstat:%d][irqlock:%d].\n",
++ dev->name, ei_status.dmaing, ei_status.irqlock);
++ return;
++ }
++ ei_status.dmaing |= 0x01;
++ outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);
++ outb_p(count & 0xff, nic_base + EN0_RCNTLO);
++ outb_p(count >> 8, nic_base + EN0_RCNTHI);
++ outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO);
++ outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);
++ outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
++
++ if (ei_status.word16) {
++ insw(NE_BASE + NE_DATAPORT,buf,count>>1);
++ if (count & 0x01) {
++ buf[count-1] = inb(NE_BASE + NE_DATAPORT);
++#ifdef NE_SANITY_CHECK
++ xfer_count++;
++#endif
++ }
++ } else {
++ insb(NE_BASE + NE_DATAPORT, buf, count);
++ }
++
++#ifdef NE_SANITY_CHECK
++ /* This was for the ALPHA version only, but enough people have
++ been encountering problems so it is still here. If you see
++ this message you either 1) have a slightly incompatible clone
++ or 2) have noise/speed problems with your bus. */
++
++ if (ei_debug > 1) {
++ /* DMA termination address check... */
++ int addr, tries = 20;
++ do {
++ /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
++ -- it's broken for Rx on some cards! */
++ int high = inb_p(nic_base + EN0_RSARHI);
++ int low = inb_p(nic_base + EN0_RSARLO);
++ addr = (high << 8) + low;
++ if (((ring_offset + xfer_count) & 0xff) == low)
++ break;
++ } while (--tries > 0);
++ if (tries <= 0)
++ printk(KERN_WARNING "%s: RX transfer address mismatch,"
++ "%#4.4x (expected) vs. %#4.4x (actual).\n",
++ dev->name, ring_offset + xfer_count, addr);
++ }
++#endif
++ outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
++ ei_status.dmaing &= ~0x01;
++}
++
++static void ne_block_output(struct net_device *dev, int count,
++ const unsigned char *buf, const int start_page)
++{
++ int nic_base = NE_BASE;
++ unsigned long dma_start;
++#ifdef NE_SANITY_CHECK
++ int retries = 0;
++#endif
++
++ /* Round the count up for word writes. Do we need to do this?
++ What effect will an odd byte count have on the 8390?
++ I should check someday. */
++
++ if (ei_status.word16 && (count & 0x01))
++ count++;
++
++ /* This *shouldn't* happen. If it does, it's the last thing you'll see */
++ if (ei_status.dmaing) {
++ printk(KERN_EMERG "%s: DMAing conflict in ne_block_output."
++ "[DMAstat:%d][irqlock:%d]\n",
++ dev->name, ei_status.dmaing, ei_status.irqlock);
++ return;
++ }
++ ei_status.dmaing |= 0x01;
++ /* We should already be in page 0, but to be safe... */
++ outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base + NE_CMD);
++
++#ifdef NE_SANITY_CHECK
++retry:
++#endif
++
++#ifdef NE8390_RW_BUGFIX
++ /* Handle the read-before-write bug the same way as the
++ Crynwr packet driver -- the NatSemi method doesn't work.
++ Actually this doesn't always work either, but if you have
++ problems with your NEx000 this is better than nothing! */
++
++ outb_p(0x42, nic_base + EN0_RCNTLO);
++ outb_p(0x00, nic_base + EN0_RCNTHI);
++ outb_p(0x42, nic_base + EN0_RSARLO);
++ outb_p(0x00, nic_base + EN0_RSARHI);
++ outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
++ /* Make certain that the dummy read has occurred. */
++ udelay(6);
++#endif
++
++ outb_p(ENISR_RDC, nic_base + EN0_ISR);
++
++ /* Now the normal output. */
++ outb_p(count & 0xff, nic_base + EN0_RCNTLO);
++ outb_p(count >> 8, nic_base + EN0_RCNTHI);
++ outb_p(0x00, nic_base + EN0_RSARLO);
++ outb_p(start_page, nic_base + EN0_RSARHI);
++
++ outb_p(E8390_RWRITE+E8390_START, nic_base + NE_CMD);
++ if (ei_status.word16)
++ outsw(NE_BASE + NE_DATAPORT, buf, count>>1);
++ else
++ outsb(NE_BASE + NE_DATAPORT, buf, count);
++
++ dma_start = jiffies;
++
++#ifdef NE_SANITY_CHECK
++ /* This was for the ALPHA version only, but enough people have
++ been encountering problems so it is still here. */
++
++ if (ei_debug > 1) {
++ /* DMA termination address check... */
++ int addr, tries = 20;
++ do {
++ int high = inb_p(nic_base + EN0_RSARHI);
++ int low = inb_p(nic_base + EN0_RSARLO);
++ addr = (high << 8) + low;
++ if ((start_page << 8) + count == addr)
++ break;
++ } while (--tries > 0);
++
++ if (tries <= 0) {
++ printk(KERN_WARNING "%s: Tx packet transfer address mismatch,"
++ "%#4.4x (expected) vs. %#4.4x (actual).\n",
++ dev->name, (start_page << 8) + count, addr);
++ if (retries++ == 0)
++ goto retry;
++ }
++ }
++#endif
++
++ while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) {
++ if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
++ printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
++ ne_reset_8390(dev);
++ NS8390_init(dev, 1);
++ break;
++ }
++ }
++
++ outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
++ ei_status.dmaing &= ~0x01;
++ return;
++}
++
++
++#ifdef MODULE
++#define MAX_NE_CARDS 4 /* Max number of NE cards per module */
++static struct net_device *dev_ne[MAX_NE_CARDS];
++static int io[MAX_NE_CARDS];
++static int irq[MAX_NE_CARDS];
++static int bad[MAX_NE_CARDS]; /* 0xbad = bad sig or no reset ack */
++
++module_param_array(io, int, NULL, 0);
++module_param_array(irq, int, NULL, 0);
++module_param_array(bad, int, NULL, 0);
++module_param(use_poll, int, 0);
++MODULE_PARM_DESC(io, "I/O base address(es),required");
++MODULE_PARM_DESC(irq, "IRQ number(s)");
++MODULE_PARM_DESC(bad, "Accept card(s) with bad signatures");
++MODULE_PARM_DESC(use_poll, "Use timer interrupt to poll driver");
++MODULE_DESCRIPTION("NE1000/NE2000 ISA/PnP Ethernet driver");
++MODULE_LICENSE("GPL");
++
++/* This is set up so that no ISA autoprobe takes place. We can't guarantee
++that the ne2k probe is the last 8390 based probe to take place (as it
++is at boot) and so the probe will get confused by any other 8390 cards.
++ISA device autoprobes on a running machine are not recommended anyway. */
++
++int __init init_module(void)
++{
++ int this_dev, found = 0;
++
++ if (!MACH_IS_ATARI)
++ return -ENODEV;
++
++ for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
++ struct net_device *dev = alloc_ei_netdev();
++ if (!dev)
++ break;
++ dev->irq = irq[this_dev];
++ dev->mem_end = bad[this_dev];
++ dev->base_addr = io[this_dev];
++ if (do_ne_probe(dev) == 0) {
++ dev_ne[found++] = dev;
++ continue;
++ }
++ free_netdev(dev);
++ if (found)
++ break;
++ if (io[this_dev] != 0)
++ printk(KERN_WARNING "atari_ethernec.c: No NE*000 card found at i/o = %#x\n", io[this_dev]);
++ else
++ printk(KERN_NOTICE "atari_ethernec.c: You must supply \"io=0xNNN\" value(s) for ISA cards.\n");
++ return -ENXIO;
++ }
++ if (found)
++ return 0;
++ return -ENODEV;
++}
++
++static void cleanup_card(struct net_device *dev)
++{
++ struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
++ if (idev)
++ pnp_device_detach(idev);
++ free_irq(dev->irq, dev);
++ release_region(dev->base_addr, NE_IO_EXTENT);
++}
++
++void cleanup_module(void)
++{
++ int this_dev;
++
++ for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
++ struct net_device *dev = dev_ne[this_dev];
++ if (dev) {
++ if (use_poll)
++ atari_ethernec_stop_poll(dev);
++ unregister_netdev(dev);
++ cleanup_card(dev);
++ free_netdev(dev);
++ }
++ }
++}
++#endif /* MODULE */
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-platform-device.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-platform-device.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,73 @@
+arch/m68k/atari/ataints.c: ATARIHW_PRESENT(TT_MFP)) || \
+arch/m68k/atari/ataints.c: !((n) & 1) && ATARIHW_PRESENT(SCC)) || \
+arch/m68k/atari/ataints.c: if (ATARIHW_PRESENT(TT_MFP)) {
+arch/m68k/atari/ataints.c: if (ATARIHW_PRESENT(SCC) && !atari_SCC_reset_done) {
+arch/m68k/atari/ataints.c: if (ATARIHW_PRESENT(SCU)) {
+arch/m68k/atari/ataints.c: if (ATARIHW_PRESENT(PCM_8BIT) && ATARIHW_PRESENT(MICROWIRE)) {
+arch/m68k/atari/config.c: if (!MACH_IS_HADES && !ATARIHW_PRESENT(ST_SCSI)) {
+arch/m68k/atari/config.c: if (ATARIHW_PRESENT(MSTE_CLK))
+arch/m68k/atari/config.c: if (ATARIHW_PRESENT(name)) \
+arch/m68k/atari/debug.c: if (ATARIHW_PRESENT(TT_MFP) && baud >= 6) {
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(FDCSPEED))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(FDCSPEED))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(FDCSPEED))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(FDCSPEED)) {
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(FDCSPEED))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(EXTD_DMA)) {
+drivers/block/ataflop.c: paddr = ATARIHW_PRESENT(EXTD_DMA) ?
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(EXTD_DMA))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT( EXTD_DMA ))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(FDCSPEED)) {
+drivers/block/ataflop.c: addr = ATARIHW_PRESENT( EXTD_DMA ) ? ReqData : DMABuffer;
+drivers/block/ataflop.c: if (!ATARIHW_PRESENT( EXTD_DMA ))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT( EXTD_DMA ))
+drivers/block/ataflop.c: if (ATARIHW_PRESENT( FDCSPEED ) || MACH_IS_MEDUSA)
+drivers/block/ataflop.c: if (ATARIHW_PRESENT(FDCSPEED))
+drivers/char/dsp56k.c: if(!MACH_IS_ATARI || !ATARIHW_PRESENT(DSP56K)) {
+drivers/char/nvram.c:#define CHECK_DRIVER_INIT() (MACH_IS_ATARI && ATARIHW_PRESENT(TT_CLK))
+drivers/ide/legacy/falconide.c: if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
+drivers/input/keyboard/atakbd.c: if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP))
+drivers/input/mouse/atarimouse.c: if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP))
+drivers/scsi/atari_scsi.c:#define IS_A_TT() ATARIHW_PRESENT(TT_SCSI)
+drivers/scsi/atari_scsi.c: (!ATARIHW_PRESENT(ST_SCSI) && !ATARIHW_PRESENT(TT_SCSI)) ||
+drivers/scsi/atari_scsi.c: if (ATARIHW_PRESENT(TT_CLK) && nvram_check_checksum()) {
+drivers/scsi/atari_scsi.c: if (MACH_IS_ATARI && ATARIHW_PRESENT(ST_SCSI) &&
+drivers/scsi/atari_scsi.c: !ATARIHW_PRESENT(EXTD_DMA) && m68k_num_memory > 1) {
+drivers/scsi/atari_scsi.c: atari_dma_stram_mask = (ATARIHW_PRESENT(EXTD_DMA) ? 0x00000000
+drivers/video/atafb.c: if (ATARIHW_PRESENT(PCM_8BIT)) {
+drivers/video/atafb.c: if (ATARIHW_PRESENT(EXTD_SHIFTER)) {
+drivers/video/atafb.c: var->red.length = ATARIHW_PRESENT(EXTD_SHIFTER) ? 4 : 3;
+drivers/video/atafb.c: if (ATARIHW_PRESENT(EXTD_SHIFTER))
+drivers/video/atafb.c: if (ATARIHW_PRESENT(EXTD_SHIFTER))
+drivers/video/atafb.c: if (ATARIHW_PRESENT(PCM_8BIT)) {
+drivers/video/atafb.c: if (!ATARIHW_PRESENT(EXTD_SHIFTER))
+drivers/video/atafb.c: if (ATARIHW_PRESENT(EXTD_SHIFTER))
+drivers/video/atafb.c: (!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset))
+drivers/video/atafb.c: if (ATARIHW_PRESENT(TT_SHIFTER)) {
+drivers/video/atafb.c: if (ATARIHW_PRESENT(VIDEL_SHIFTER)) {
+drivers/video/atafb.c: if (ATARIHW_PRESENT(STND_SHIFTER) ||
+drivers/video/atafb.c: ATARIHW_PRESENT(EXTD_SHIFTER)) {
+include/asm-m68k/atarihw.h:#define ATARIHW_PRESENT(name) (atari_hw_present.name)
+sound/oss/dmasound/dmasound_atari.c: if (MACH_IS_ATARI && ATARIHW_PRESENT(PCM_8BIT)) {
+sound/oss/dmasound/dmasound_atari.c: if (ATARIHW_PRESENT(CODEC)) {
+sound/oss/dmasound/dmasound_atari.c: } else if (ATARIHW_PRESENT(MICROWIRE)) {
+drivers/char/atari_scc.c: int escc = ATARIHW_PRESENT(ST_ESCC);
+drivers/char/atari_scc.c: if (!(ATARIHW_PRESENT(SCC) || ATARIHW_PRESENT(ST_ESCC)))
+drivers/char/atari_scc.c: if (ATARIHW_PRESENT(TT_MFP) && baud >= 6) {
+---
+ arch/m68k/atari/platform.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- /dev/null
++++ b/arch/m68k/atari/platform.c
+@@ -0,0 +1,10 @@
++/*
++ * Copyright (C) 2007 Geert Uytterhoeven
++ *
++ * 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/platform_device.h>
++
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-rom-isa.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-rom-isa.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,410 @@
+Subject: [PATCH] m68k: Atari ROM port ISA adapter support
+
+From: Michael Schmitz <schmitz at opal.biophys.uni-duesseldorf.de>
+
+Atari ROM port ISA adapter support
+
+Signed-off-by: Michael Schmitz <schmitz at debian.org>
+Signed-off-by: Roman Zippel <zippel at linux-m68k.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/Kconfig | 10 +++
+ arch/m68k/kernel/setup.c | 6 ++
+ include/asm-m68k/io.h | 137 ++++++++++++++++++++++++++++++++++++++++++++--
+ include/asm-m68k/raw_io.h | 116 ++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 265 insertions(+), 4 deletions(-)
+
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -153,6 +153,16 @@ config PCI
+ your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
+ VESA. If you have PCI, say Y, otherwise N.
+
++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
+--- a/arch/m68k/kernel/setup.c
++++ b/arch/m68k/kernel/setup.c
+@@ -371,6 +371,12 @@ void __init setup_arch(char **cmdline_p)
+ isa_sex = 1;
+ }
+ #endif
++#ifdef CONFIG_ATARI_ROM_ISA
++ if (MACH_IS_ATARI) {
++ isa_type = ISA_TYPE_ENEC;
++ isa_sex = 0;
++ }
++#endif
+ #endif
+ }
+
+--- a/include/asm-m68k/io.h
++++ b/include/asm-m68k/io.h
+@@ -83,9 +83,26 @@ 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))
++
++#ifndef MULTI_ISA
++#define MULTI_ISA 0
++#else
++#undef MULTI_ISA
++#define MULTI_ISA 1
++#endif
++#endif /* ATARI */
++
++
++#if defined(CONFIG_ISA) || defined(CONFIG_ATARI_ROM_ISA)
+
+ #if MULTI_ISA == 0
+ #undef MULTI_ISA
+@@ -94,6 +111,7 @@ extern unsigned long gg2_isa_base;
+ #define ISA_TYPE_Q40 (1)
+ #define ISA_TYPE_GG2 (2)
+ #define ISA_TYPE_AG (3)
++#define ISA_TYPE_ENEC (4)
+
+ #if defined(CONFIG_Q40) && !defined(MULTI_ISA)
+ #define ISA_TYPE ISA_TYPE_Q40
+@@ -107,6 +125,10 @@ extern unsigned long gg2_isa_base;
+ #define ISA_TYPE ISA_TYPE_GG2
+ #define ISA_SEX 0
+ #endif
++#if defined(CONFIG_ATARI_ROM_ISA) && !defined(MULTI_ISA)
++#define ISA_TYPE ISA_TYPE_ENEC
++#define ISA_SEX 0
++#endif
+
+ #ifdef MULTI_ISA
+ extern int isa_type;
+@@ -134,6 +156,9 @@ static inline u8 __iomem *isa_itb(unsign
+ #ifdef CONFIG_AMIGA_PCMCIA
+ case ISA_TYPE_AG: return (u8 __iomem *)AG_ISA_IO_B(addr);
+ #endif
++#ifdef CONFIG_ATARI_ROM_ISA
++ case ISA_TYPE_ENEC: return (u8 __iomem *)ENEC_ISA_IO_B(addr);
++#endif
+ default: return NULL; /* avoid warnings, just in case */
+ }
+ }
+@@ -150,6 +175,9 @@ static inline u16 __iomem *isa_itw(unsig
+ #ifdef CONFIG_AMIGA_PCMCIA
+ case ISA_TYPE_AG: return (u16 __iomem *)AG_ISA_IO_W(addr);
+ #endif
++#ifdef CONFIG_ATARI_ROM_ISA
++ case ISA_TYPE_ENEC: return (u16 __iomem *)ENEC_ISA_IO_W(addr);
++#endif
+ default: return NULL; /* avoid warnings, just in case */
+ }
+ }
+@@ -176,6 +204,9 @@ static inline u8 __iomem *isa_mtb(unsign
+ #ifdef CONFIG_AMIGA_PCMCIA
+ case ISA_TYPE_AG: return (u8 __iomem *)addr;
+ #endif
++#ifdef CONFIG_ATARI_ROM_ISA
++ case ISA_TYPE_ENEC: return (u8 __iomem *)ENEC_ISA_MEM_B(addr);
++#endif
+ default: return NULL; /* avoid warnings, just in case */
+ }
+ }
+@@ -192,6 +223,9 @@ static inline u16 __iomem *isa_mtw(unsig
+ #ifdef CONFIG_AMIGA_PCMCIA
+ case ISA_TYPE_AG: return (u16 __iomem *)addr;
+ #endif
++#ifdef CONFIG_ATARI_ROM_ISA
++ case ISA_TYPE_ENEC: return (u16 __iomem *)ENEC_ISA_MEM_W(addr);
++#endif
+ default: return NULL; /* avoid warnings, just in case */
+ }
+ }
+@@ -213,6 +247,34 @@ 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_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) \
++ (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)
+@@ -226,6 +288,9 @@ static inline void isa_delay(void)
+ #ifdef CONFIG_AMIGA_PCMCIA
+ case ISA_TYPE_AG: break;
+ #endif
++#ifdef CONFIG_ATARI_ROM_ISA
++ case ISA_TYPE_ENEC: break;
++#endif
+ default: break; /* avoid warnings */
+ }
+ }
+@@ -256,10 +321,40 @@ static inline void isa_delay(void)
+ (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \
+ raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1))
+
++
++#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_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 */
+
+
+-#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
+@@ -330,7 +425,43 @@ static inline void isa_delay(void)
+ #endif
+ #endif /* CONFIG_PCI */
+
+-#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI)
++#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 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
++#define readsl raw_insl
++#define writesl raw_outsl
++#endif
++
++#if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) && !defined(CONFIG_ATARI_ROM_ISA)
+ /*
+ * We need to define dummy functions for GENERIC_IOMAP support.
+ */
+--- a/include/asm-m68k/raw_io.h
++++ b/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 */
+@@ -60,6 +60,46 @@ extern void __iounmap(void *addr, unsign
+ #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
++ * 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;
+@@ -342,6 +382,80 @@ 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++);
++}
++
++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__ */
+
+ #endif /* _RAW_IO_H */
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-scc-readd-CONFIG_ATARI_SCC.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-scc-readd-CONFIG_ATARI_SCC.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,34 @@
+---
+ arch/m68k/Kconfig | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -490,6 +490,18 @@ config ATARI_MFPSER
+ Note for Falcon users: You also have an MFP port, it's just not
+ wired to the outside... But you could use the port under Linux.
+
++config ATARI_SCC
++ tristate "Atari SCC serial support"
++ depends on ATARI
++ ---help---
++ If you have serial ports based on a Zilog SCC chip (Modem2, Serial2,
++ LAN) and like to use them under Linux, say Y. All built-in SCC's are
++ supported (TT, MegaSTE, Falcon), and also the ST-ESCC. If you have
++ two connectors for channel A (Serial2 and LAN), they are visible as
++ two separate devices.
++
++ To compile this driver as a module, choose M here.
++
+ config ATARI_MIDI
+ tristate "Atari MIDI serial support"
+ depends on ATARI
+@@ -606,7 +618,7 @@ config DN_SERIAL
+
+ config SERIAL_CONSOLE
+ bool "Support for serial port console"
+- depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
++ depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_SCC=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
+ ---help---
+ If you say Y here, it will be possible to use a serial port as the
+ system console (the system console is the device which receives all
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-scc-readd-atari_SCC_init_done.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/atari-scc-readd-atari_SCC_init_done.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,25 @@
+---
+ arch/m68k/atari/debug.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/arch/m68k/atari/debug.c
++++ b/arch/m68k/atari/debug.c
+@@ -20,6 +20,10 @@
+ #include <asm/atarihw.h>
+ #include <asm/atariints.h>
+
++/* 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;
+@@ -259,6 +263,7 @@ static void __init atari_init_scc_port(i
+ SCC_WRITE(5, reg5 | 8);
+
+ atari_SCC_reset_done = 1;
++ atari_SCC_init_done = 1;
+ }
+
+ static void __init atari_init_midi_port(int cflag)
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/blinux-list-is-subscribers-only.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/blinux-list-is-subscribers-only.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,15 @@
+---
+ MAINTAINERS | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -1434,7 +1434,7 @@ S: Maintained
+ DOUBLETALK DRIVER
+ P: James R. Van Zandt
+ M: jrv at vanzandt.mv.com
+-L: blinux-list at redhat.com
++L: blinux-list at redhat.com (subscribers-only)
+ S: Maintained
+
+ DRIVER CORE, KOBJECTS, AND SYSFS
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/drivers-macintosh-possible-cleanups.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/drivers-macintosh-possible-cleanups.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,95 @@
+Subject: [PATCH] drivers/macintosh/: possible cleanups
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch contains the following possible cleanups:
+- make the following needlessly global code static:
+ - adb.c: adb_controller
+ - adb.c: adb_init()
+ - adbhid.c: adb_to_linux_keycodes[] (also make it const)
+ - via-pmu68k.c: backlight_level
+ - via-pmu68k.c: backlight_enabled
+- remove the following unused code:
+ - via-pmu68k.c: sleep_notifier_list
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/macintosh/adb.c | 5 ++---
+ drivers/macintosh/adbhid.c | 2 +-
+ drivers/macintosh/via-pmu68k.c | 5 ++---
+ include/linux/adb.h | 1 -
+ 4 files changed, 5 insertions(+), 8 deletions(-)
+
+45413fb42fb4215d80bb15f50a5bdc869465e9a1 diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
+index dbaad39..61b62a6 100644
+--- a/drivers/macintosh/adb.c
++++ b/drivers/macintosh/adb.c
+@@ -46,7 +46,6 @@
+ #endif
+
+
+-EXPORT_SYMBOL(adb_controller);
+ EXPORT_SYMBOL(adb_client_list);
+
+ extern struct adb_driver via_macii_driver;
+@@ -80,7 +79,7 @@ static struct adb_driver *adb_driver_lis
+
+ static struct class *adb_dev_class;
+
+-struct adb_driver *adb_controller;
++static struct adb_driver *adb_controller;
+ BLOCKING_NOTIFIER_HEAD(adb_client_list);
+ static int adb_got_sleep;
+ static int adb_inited;
+@@ -290,7 +289,7 @@ static int adb_resume(struct platform_de
+ }
+ #endif /* CONFIG_PM */
+
+-int __init adb_init(void)
++static int __init adb_init(void)
+ {
+ struct adb_driver *driver;
+ int i;
+--- a/drivers/macintosh/adbhid.c
++++ b/drivers/macintosh/adbhid.c
+@@ -75,7 +75,7 @@ static struct notifier_block adbhid_adb_
+ #define ADB_KEY_POWER_OLD 0x7e
+ #define ADB_KEY_POWER 0x7f
+
+-u16 adb_to_linux_keycodes[128] = {
++static const u16 adb_to_linux_keycodes[128] = {
+ /* 0x00 */ KEY_A, /* 30 */
+ /* 0x01 */ KEY_S, /* 31 */
+ /* 0x02 */ KEY_D, /* 32 */
+--- a/drivers/macintosh/via-pmu68k.c
++++ b/drivers/macintosh/via-pmu68k.c
+@@ -101,7 +101,6 @@ static int pmu_kind = PMU_UNKNOWN;
+ static int pmu_fully_inited;
+
+ int asleep;
+-BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
+
+ static int pmu_probe(void);
+ static int pmu_init(void);
+@@ -741,8 +740,8 @@ pmu_handle_data(unsigned char *data, int
+ }
+ }
+
+-int backlight_level = -1;
+-int backlight_enabled = 0;
++static int backlight_level = -1;
++static int backlight_enabled = 0;
+
+ #define LEVEL_TO_BRIGHT(lev) ((lev) < 1? 0x7f: 0x4a - ((lev) << 1))
+
+--- a/include/linux/adb.h
++++ b/include/linux/adb.h
+@@ -85,7 +85,6 @@ enum adb_message {
+ ADB_MSG_PRE_RESET, /* Called before resetting the bus */
+ ADB_MSG_POST_RESET /* Called after resetting the bus (re-do init & register) */
+ };
+-extern struct adb_driver *adb_controller;
+ extern struct blocking_notifier_head adb_client_list;
+
+ int adb_request(struct adb_request *req, void (*done)(struct adb_request *),
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/drivers-video-c2p.c-add-MODULE_LICENSE.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/drivers-video-c2p.c-add-MODULE_LICENSE.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,28 @@
+Subject: [PATCH] drivers/video/c2p.c: add MODULE_LICENSE
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch adds the missing MODULE_LICENSE("GPL").
+
+Reported-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/video/c2p.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/video/c2p.c
++++ b/drivers/video/c2p.c
+@@ -12,6 +12,7 @@
+ * for more details.
+ */
+
++#include <linux/module.h>
+ #include <linux/string.h>
+ #include "c2p.h"
+
+@@ -227,3 +228,4 @@ void c2p(u8 *dst, const u8 *src, u32 dx,
+ }
+ }
+
++MODULE_LICENSE("GPL");
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/falconide-fix-ide_release_lock-imbalance.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/falconide-fix-ide_release_lock-imbalance.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,35 @@
+From schmitz at opal.biophys.uni-duesseldorf.de Fri Jun 27 10:42:06 2008
+Date: Fri, 27 Jun 2008 10:40:43 +0200 (CEST)
+From: Michael Schmitz <schmitz at opal.biophys.uni-duesseldorf.de>
+To: Michael Schmitz <schmitz at opal.biophys.uni-duesseldorf.de>
+Cc: Stephen R Marenka <stephen at marenka.net>, linux-m68k at vger.kernel.org, Geert Uytterhoeven <geert at linux-m68k.org>
+Subject: Re: ide_release_lock: bug
+
+Hi,
+
+The following patch does, indeed, fix the ide_release_lock imbalance. No
+more warnings.
+
+---
+ drivers/ide/ide-io.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/ide/ide-io.c
++++ b/drivers/ide/ide-io.c
+@@ -1032,14 +1032,13 @@ static void ide_do_request (ide_hwgroup_
+ ide_startstop_t startstop;
+ int loops = 0;
+
+- /* for atari only: POSSIBLY BROKEN HERE(?) */
+- ide_get_lock(ide_intr, hwgroup);
+-
+ /* caller must own ide_lock */
+ BUG_ON(!irqs_disabled());
+
+ while (!hwgroup->busy) {
+ hwgroup->busy = 1;
++ /* for atari only */
++ ide_get_lock(ide_intr, hwgroup);
+ drive = choose_drive(hwgroup);
+ if (drive == NULL) {
+ int sleeping = 0;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-add-notes-to-init-data.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-add-notes-to-init-data.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,24 @@
+Subject: [PATCH] m68k: Add NOTES to init data so it's discarded at boot
+
+From: Roman Zippel <zippel at linux-m68k.org>
+
+Add .note.gnu.build-id to init data so it's discarded at boot.
+
+[Andreas Schwab] Use NOTES macro
+
+Signed-off-by: Roman Zippel <zippel at linux-m68k.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/kernel/vmlinux-std.lds | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/m68k/kernel/vmlinux-std.lds
++++ b/arch/m68k/kernel/vmlinux-std.lds
+@@ -74,6 +74,7 @@ SECTIONS
+ .init.ramfs : { *(.init.ramfs) }
+ __initramfs_end = .;
+ #endif
++ NOTES
+ . = ALIGN(8192);
+ __init_end = .;
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-add-support-for-ARAnyM-block-and-console-access.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-add-support-for-ARAnyM-block-and-console-access.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,453 @@
+Subject: [PATCH] m68k: Add support for ARAnyM block and console access
+
+From: Roman Zippel <zippel at linux-m68k.org>
+
+Add support for ARAnyM block and console access
+
+Signed-off-by: Roman Zippel <zippel at linux-m68k.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/Kconfig | 16 ++++
+ arch/m68k/emu/Makefile | 2
+ arch/m68k/emu/natfeat.c | 38 ----------
+ arch/m68k/emu/nfblock.c | 180 ++++++++++++++++++++++++++++++++++++++++++++++++
+ arch/m68k/emu/nfcon.c | 164 +++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 362 insertions(+), 38 deletions(-)
+
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -285,6 +285,22 @@ config NFETH
+ which will emulate a regular ethernet device while presenting an
+ ethertap device to the host system.
+
++config NFBLOCK
++ tristate "NatFeat block device support"
++ depends on BLOCK && NATFEAT
++ help
++ Say Y to include support for the ARAnyM NatFeat block device
++ which allows direct access to the hard drives without using
++ the hardware emulation.
++
++config NFCON
++ tristate "NatFeat console driver"
++ depends on NATFEAT
++ help
++ Say Y to include support for the ARAnyM NatFeat console driver
++ which allows the console output to be redirected to the stderr
++ output of ARAnyM.
++
+ comment "Processor type"
+
+ config M68020
+--- a/arch/m68k/emu/Makefile
++++ b/arch/m68k/emu/Makefile
+@@ -5,3 +5,5 @@
+ obj-y += natfeat.o
+
+ obj-$(CONFIG_NFETH) += nfeth.o
++obj-$(CONFIG_NFBLOCK) += nfblock.o
++obj-$(CONFIG_NFCON) += nfcon.o
+--- a/arch/m68k/emu/natfeat.c
++++ b/arch/m68k/emu/natfeat.c
+@@ -32,24 +32,6 @@ asm("\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];
+@@ -62,26 +44,6 @@ void nfprint(const char *fmt, ...)
+ 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");
+--- /dev/null
++++ b/arch/m68k/emu/nfblock.c
+@@ -0,0 +1,180 @@
++/*
++ * ARAnyM block device driver
++ *
++ * 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/module.h>
++#include <linux/moduleparam.h>
++#include <linux/init.h>
++
++#include <linux/kernel.h>
++#include <linux/errno.h>
++#include <linux/types.h>
++#include <linux/genhd.h>
++#include <linux/blkdev.h>
++#include <linux/hdreg.h>
++
++#include <asm/natfeat.h>
++
++static long nfhd_id;
++
++enum {
++ /* emulation entry points */
++ NFHD_READ_WRITE = 10,
++ NFHD_GET_CAPACITY = 14,
++
++ /* skip ACSI devices */
++ NFHD_DEV_OFFSET = 8,
++};
++
++static LIST_HEAD(nfhd_list);
++
++static int major_num;
++module_param(major_num, int, 0);
++
++struct nfhd_device {
++ struct list_head list;
++ int id;
++ u32 blocks, bsize;
++ int bshift;
++ struct request_queue *queue;
++ struct gendisk *disk;
++};
++
++static int nfhd_make_request(struct request_queue *queue, struct bio *bio)
++{
++ struct nfhd_device *dev = queue->queuedata;
++ struct bio_vec *bvec;
++ int i, dir, len, shift;
++ sector_t sec = bio->bi_sector;
++
++ dir = bio_data_dir(bio);
++ shift = dev->bshift;
++ bio_for_each_segment(bvec, bio, i) {
++ len = bvec->bv_len;
++ len >>= 9;
++ nf_call(nfhd_id + NFHD_READ_WRITE, dev->id, 0, dir,
++ sec >> shift, len >> shift, bvec_to_phys(bvec));
++ sec += len;
++ }
++ bio_endio(bio, 0);
++ return 0;
++}
++
++int nfhd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
++{
++ struct nfhd_device *dev = bdev->bd_disk->private_data;
++
++ geo->cylinders = dev->blocks >> (6 - dev->bshift);
++ geo->heads = 4;
++ geo->sectors = 16;
++
++ return 0;
++}
++
++static struct block_device_operations nfhd_ops = {
++ .owner = THIS_MODULE,
++ .getgeo = nfhd_getgeo,
++};
++
++static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
++{
++ struct nfhd_device *dev;
++ int dev_id = id - NFHD_DEV_OFFSET;
++
++ printk(KERN_INFO "nfhd%u: found device with %u blocks (%u bytes)\n",
++ dev_id, blocks, bsize);
++
++ if (bsize < 512 || (bsize & (bsize - 1))) {
++ printk(KERN_WARNING "nfhd%u: invalid block size\n", dev_id);
++ return -EINVAL;
++ }
++
++ dev = kmalloc(sizeof(struct nfhd_device), GFP_KERNEL);
++ if (!dev)
++ goto out;
++
++ dev->id = id;
++ dev->blocks = blocks;
++ dev->bsize = bsize;
++ dev->bshift = ffs(bsize) - 10;
++
++ dev->queue = blk_alloc_queue(GFP_KERNEL);
++ if (dev->queue == NULL)
++ goto free_dev;
++
++ dev->queue->queuedata = dev;
++ blk_queue_make_request(dev->queue, nfhd_make_request);
++ blk_queue_hardsect_size(dev->queue, bsize);
++
++ dev->disk = alloc_disk(16);
++ if (!dev->disk)
++ goto free_queue;
++
++ dev->disk->major = major_num;
++ dev->disk->first_minor = dev_id * 16;
++ dev->disk->fops = &nfhd_ops;
++ dev->disk->private_data = dev;
++ sprintf(dev->disk->disk_name, "nfhd%u", dev_id);
++ set_capacity(dev->disk, (sector_t)blocks * (bsize / 512));
++ dev->disk->queue = dev->queue;
++
++ add_disk(dev->disk);
++
++ list_add_tail(&dev->list, &nfhd_list);
++
++ return 0;
++
++free_queue:
++ blk_cleanup_queue(dev->queue);
++free_dev:
++ kfree(dev);
++out:
++ return -ENOMEM;
++}
++
++static int __init nfhd_init(void)
++{
++ u32 blocks, bsize;
++ int i;
++
++ nfhd_id = nf_get_id("XHDI");
++ if (!nfhd_id)
++ return -ENODEV;
++
++ major_num = register_blkdev(major_num, "nfhd");
++ if (major_num <= 0) {
++ printk(KERN_WARNING "nfhd: unable to get major number\n");
++ return -ENODEV;
++ }
++
++ for (i = NFHD_DEV_OFFSET; i < 24; i++) {
++ if (nf_call(nfhd_id + NFHD_GET_CAPACITY, i, 0, &blocks, &bsize))
++ continue;
++ nfhd_init_one(i, blocks, bsize);
++ }
++
++ return 0;
++}
++
++static void __exit nfhd_exit(void)
++{
++ struct nfhd_device *dev, *next;
++
++ list_for_each_entry_safe(dev, next, &nfhd_list, list) {
++ list_del(&dev->list);
++ del_gendisk(dev->disk);
++ put_disk(dev->disk);
++ blk_cleanup_queue(dev->queue);
++ kfree(dev);
++ }
++ unregister_blkdev(major_num, "nfhd");
++}
++
++module_init(nfhd_init);
++module_exit(nfhd_exit);
++
++MODULE_LICENSE("GPL");
+--- /dev/null
++++ b/arch/m68k/emu/nfcon.c
+@@ -0,0 +1,164 @@
++/*
++ * ARAnyM console driver
++ *
++ * 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/module.h>
++#include <linux/init.h>
++#include <linux/console.h>
++#include <linux/tty.h>
++#include <linux/tty_driver.h>
++#include <linux/tty_flip.h>
++#include <linux/slab.h>
++#include <linux/err.h>
++#include <linux/uaccess.h>
++
++#include <asm/natfeat.h>
++
++static int stderr_id;
++static struct tty_driver *nfcon_tty_driver;
++
++static void nfcon_write(struct console *con, 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);
++}
++
++struct tty_driver *nfcon_device(struct console *con, int *index)
++{
++ *index = 0;
++ return (con->flags & CON_ENABLED) ? nfcon_tty_driver : NULL;
++}
++
++static struct console nf_console = {
++ .name = "nfcon",
++ .write = nfcon_write,
++ .device = nfcon_device,
++ .flags = CON_PRINTBUFFER,
++ .index = -1,
++};
++
++
++static int nfcon_tty_open(struct tty_struct *tty, struct file *filp)
++{
++ return 0;
++}
++
++static void nfcon_tty_close(struct tty_struct *tty, struct file *filp)
++{
++}
++
++static int nfcon_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
++{
++ char temp[68];
++ int i = count;
++
++ temp[64] = 0;
++ while (i > 64) {
++ memcpy(temp, buf, 64);
++ nf_call(stderr_id, temp);
++ buf += 64;
++ i -= 64;
++ }
++ memcpy(temp, buf, i);
++ temp[i] = 0;
++ nf_call(stderr_id, temp);
++
++ return count;
++}
++
++static int nfcon_tty_put_char(struct tty_struct *tty, unsigned char ch)
++{
++ char temp[2] = { ch, 0 };
++
++ nf_call(stderr_id, temp);
++ return 1;
++}
++
++static int nfcon_tty_write_room(struct tty_struct *tty)
++{
++ return 64;
++}
++
++static const struct tty_operations nfcon_tty_ops = {
++ .open = nfcon_tty_open,
++ .close = nfcon_tty_close,
++ .write = nfcon_tty_write,
++ .put_char = nfcon_tty_put_char,
++ .write_room = nfcon_tty_write_room,
++};
++
++static int __init nf_debug_setup(char *arg)
++{
++ if (strcmp(arg, "nfcon"))
++ return 0;
++
++ stderr_id = nf_get_id("NF_STDERR");
++ if (stderr_id) {
++ nf_console.flags |= CON_ENABLED;
++ register_console(&nf_console);
++ }
++
++ return 0;
++}
++
++early_param("debug", nf_debug_setup);
++
++static int __init nfcon_init(void)
++{
++ int res;
++
++ stderr_id = nf_get_id("NF_STDERR");
++ if (!stderr_id)
++ return -ENODEV;
++
++ nfcon_tty_driver = alloc_tty_driver(1);
++ if (!nfcon_tty_driver)
++ return -ENOMEM;
++
++ nfcon_tty_driver->owner = THIS_MODULE;
++ nfcon_tty_driver->driver_name = "nfcon";
++ nfcon_tty_driver->name = "nfcon";
++ nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
++ nfcon_tty_driver->subtype = SYSTEM_TYPE_TTY;
++ nfcon_tty_driver->init_termios = tty_std_termios;
++ nfcon_tty_driver->flags = TTY_DRIVER_REAL_RAW;
++
++ tty_set_operations(nfcon_tty_driver, &nfcon_tty_ops);
++ res = tty_register_driver(nfcon_tty_driver);
++ if (res) {
++ printk(KERN_ERR "failed to register nfcon tty driver\n");
++ put_tty_driver(nfcon_tty_driver);
++ return res;
++ }
++
++ if (!(nf_console.flags & CON_ENABLED))
++ register_console(&nf_console);
++
++ return 0;
++}
++
++static void __exit nfcon_exit(void)
++{
++ unregister_console(&nf_console);
++ tty_unregister_driver(nfcon_tty_driver);
++ put_tty_driver(nfcon_tty_driver);
++}
++
++module_init(nfcon_init);
++module_exit(nfcon_exit);
++
++MODULE_LICENSE("GPL");
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-allnoconfig.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-allnoconfig.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,115 @@
+Subject: [PATCH] m68k: Allow no CPU/platform type for allnoconfig
+
+From: Geert Uytterhoeven <geert at linux-m68k.org>
+
+Allow no CPU/platform type for allnoconfig
+ - Provide a dummy value for FPSTATESIZE if no CPU type was selected
+ - Provide a dummy value for NR_IRQS if no platform type was selected
+ - Warn the user if no CPU or platform type was selected
+
+Note: you still cannot build an allnoconfig kernel, as CONFIG_SWAP=n doesn't
+build and we cannot easily fix that
+(http://groups.google.com/group/linux.kernel/browse_thread/thread/d430c78b07e1827b)
+
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/kernel/setup.c | 6 ++++++
+ include/asm-m68k/fpu.h | 10 +++++-----
+ include/asm-m68k/irq.h | 2 +-
+ include/asm-m68k/tlbflush.h | 8 ++++----
+ 4 files changed, 16 insertions(+), 10 deletions(-)
+
+--- a/arch/m68k/kernel/setup.c
++++ b/arch/m68k/kernel/setup.c
+@@ -26,6 +26,7 @@
+
+ #include <asm/bootinfo.h>
+ #include <asm/setup.h>
++#include <asm/fpu.h>
+ #include <asm/irq.h>
+ #include <asm/io.h>
+ #include <asm/machdep.h>
+@@ -40,6 +41,11 @@
+ #include <asm/dvma.h>
+ #endif
+
++#if !FPSTATESIZE || !NR_IRQS
++#warning No CPU/platform type selected, your kernel will not work!
++#warning Are you building an allnoconfig kernel?
++#endif
++
+ unsigned long m68k_machtype;
+ EXPORT_SYMBOL(m68k_machtype);
+ unsigned long m68k_cputype;
+--- a/include/asm-m68k/fpu.h
++++ b/include/asm-m68k/fpu.h
+@@ -7,15 +7,15 @@
+ */
+
+ #if defined(CONFIG_M68020) || defined(CONFIG_M68030)
+-#define FPSTATESIZE (216/sizeof(unsigned char))
++#define FPSTATESIZE (216)
+ #elif defined(CONFIG_M68040)
+-#define FPSTATESIZE (96/sizeof(unsigned char))
++#define FPSTATESIZE (96)
+ #elif defined(CONFIG_M68KFPU_EMU)
+-#define FPSTATESIZE (28/sizeof(unsigned char))
++#define FPSTATESIZE (28)
+ #elif defined(CONFIG_M68060)
+-#define FPSTATESIZE (12/sizeof(unsigned char))
++#define FPSTATESIZE (12)
+ #else
+-#define FPSTATESIZE error no_cpu_type_configured
++#define FPSTATESIZE (0)
+ #endif
+
+ #endif /* __M68K_FPU_H */
+--- a/include/asm-m68k/irq.h
++++ b/include/asm-m68k/irq.h
+@@ -24,7 +24,7 @@
+ #elif defined(CONFIG_HP300)
+ #define NR_IRQS 8
+ #else
+-#error unknown nr of irqs
++#define NR_IRQS 0
+ #endif
+
+ /*
+--- a/include/asm-m68k/tlbflush.h
++++ b/include/asm-m68k/tlbflush.h
+@@ -16,7 +16,7 @@ static inline void flush_tlb_kernel_page
+ ".chip 68k"
+ : : "a" (addr));
+ set_fs(old_fs);
+- } else
++ } else if (CPU_IS_020_OR_030)
+ __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr));
+ }
+
+@@ -29,7 +29,7 @@ static inline void __flush_tlb(void)
+ __asm__ __volatile__(".chip 68040\n\t"
+ "pflushan\n\t"
+ ".chip 68k");
+- else
++ else if (CPU_IS_020_OR_030)
+ __asm__ __volatile__("pflush #0,#4");
+ }
+
+@@ -45,7 +45,7 @@ static inline void __flush_tlb_one(unsig
+ {
+ if (CPU_IS_040_OR_060)
+ __flush_tlb040_one(addr);
+- else
++ else if (CPU_IS_020_OR_030)
+ __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr));
+ }
+
+@@ -60,7 +60,7 @@ static inline void flush_tlb_all(void)
+ __asm__ __volatile__(".chip 68040\n\t"
+ "pflusha\n\t"
+ ".chip 68k");
+- else
++ else if (CPU_IS_020_OR_030)
+ __asm__ __volatile__("pflusha");
+ }
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-allow-all-kernel-traps-to-be-handled-via-exception-fixups-all.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-allow-all-kernel-traps-to-be-handled-via-exception-fixups-all.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,150 @@
+---
+ arch/m68k/kernel/signal.c | 24 +++++++++++++++++++++++-
+ arch/m68k/kernel/traps.c | 21 ++++++++++++---------
+ arch/m68k/mm/fault.c | 16 +---------------
+ include/asm-m68k/processor.h | 2 ++
+ 4 files changed, 38 insertions(+), 25 deletions(-)
+
+--- a/arch/m68k/kernel/signal.c
++++ b/arch/m68k/kernel/signal.c
+@@ -42,6 +42,7 @@
+ #include <linux/personality.h>
+ #include <linux/tty.h>
+ #include <linux/binfmts.h>
++#include <linux/module.h>
+
+ #include <asm/setup.h>
+ #include <asm/uaccess.h>
+@@ -53,7 +54,7 @@
+
+ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs);
+
+-const int frame_extra_sizes[16] = {
++static const int frame_extra_sizes[16] = {
+ [1] = -1, /* sizeof(((struct frame *)0)->un.fmt1), */
+ [2] = sizeof(((struct frame *)0)->un.fmt2),
+ [3] = sizeof(((struct frame *)0)->un.fmt3),
+@@ -71,6 +72,27 @@ const int frame_extra_sizes[16] = {
+ [15] = -1, /* sizeof(((struct frame *)0)->un.fmtf), */
+ };
+
++int handle_kernel_fault(struct pt_regs *regs)
++{
++ const struct exception_table_entry *fixup;
++ struct pt_regs *tregs;
++
++ /* Are we prepared to handle this kernel fault? */
++ fixup = search_exception_tables(regs->pc);
++ if (!fixup)
++ return 0;
++
++ /* Create a new four word stack frame, discarding the old one. */
++ regs->stkadj = frame_extra_sizes[regs->format];
++ tregs = (struct pt_regs *)((long)regs + regs->stkadj);
++ tregs->vector = regs->vector;
++ tregs->format = 0;
++ tregs->pc = fixup->fixup;
++ tregs->sr = regs->sr;
++
++ return 1;
++}
++
+ /*
+ * Atomically swap in the new signal mask, and wait for a signal.
+ */
+--- a/arch/m68k/kernel/traps.c
++++ b/arch/m68k/kernel/traps.c
+@@ -48,10 +48,7 @@ asmlinkage void nmihandler(void);
+ asmlinkage void fpu_emu(void);
+ #endif
+
+-e_vector vectors[256] = {
+- [VEC_BUSERR] = buserr,
+- [VEC_SYS] = system_call,
+-};
++e_vector vectors[256];
+
+ /* nmi handler for the Amiga */
+ asm(".text\n"
+@@ -61,10 +58,11 @@ asm(".text\n"
+ /*
+ * this must be called very early as the kernel might
+ * use some instruction that are emulated on the 060
++ * and so we're prepared for early probe attempts (e.g. nf_init).
+ */
+ void __init base_trap_init(void)
+ {
+- if(MACH_IS_SUN3X) {
++ if (MACH_IS_SUN3X) {
+ extern e_vector *sun3x_prom_vbr;
+
+ __asm__ volatile ("movec %%vbr, %0" : "=r" (sun3x_prom_vbr));
+@@ -79,6 +77,10 @@ void __init base_trap_init(void)
+
+ vectors[VEC_UNIMPII] = unimp_vec;
+ }
++
++ vectors[VEC_BUSERR] = buserr;
++ vectors[VEC_ILLEGAL] = trap;
++ vectors[VEC_SYS] = system_call;
+ }
+
+ void __init trap_init (void)
+@@ -1058,10 +1060,11 @@ asmlinkage void trap_c(struct frame *fp)
+ siginfo_t info;
+
+ if (fp->ptregs.sr & PS_S) {
+- if ((fp->ptregs.vector >> 2) == VEC_TRACE) {
+- /* traced a trapping instruction */
+- current->ptrace |= PT_DTRACE;
+- } else
++ if (fp->ptregs.vector == VEC_TRACE << 2) {
++ /* traced a trapping instruction on a 68020/30,
++ * real exception will be executed afterwards.
++ */
++ } else if (!handle_kernel_fault(&fp->ptregs))
+ bad_super_trap(fp);
+ return;
+ }
+--- a/arch/m68k/mm/fault.c
++++ b/arch/m68k/mm/fault.c
+@@ -18,7 +18,6 @@
+ #include <asm/pgalloc.h>
+
+ extern void die_if_kernel(char *, struct pt_regs *, long);
+-extern const int frame_extra_sizes[]; /* in m68k/kernel/signal.c */
+
+ int send_fault_sig(struct pt_regs *regs)
+ {
+@@ -35,21 +34,8 @@ int send_fault_sig(struct pt_regs *regs)
+ force_sig_info(siginfo.si_signo,
+ &siginfo, current);
+ } else {
+- const struct exception_table_entry *fixup;
+-
+- /* Are we prepared to handle this kernel fault? */
+- if ((fixup = search_exception_tables(regs->pc))) {
+- struct pt_regs *tregs;
+- /* Create a new four word stack frame, discarding the old
+- one. */
+- regs->stkadj = frame_extra_sizes[regs->format];
+- tregs = (struct pt_regs *)((ulong)regs + regs->stkadj);
+- tregs->vector = regs->vector;
+- tregs->format = 0;
+- tregs->pc = fixup->fixup;
+- tregs->sr = regs->sr;
++ if (handle_kernel_fault(regs))
+ return -1;
+- }
+
+ //if (siginfo.si_signo == SIGBUS)
+ // force_sig_info(siginfo.si_signo,
+--- a/include/asm-m68k/processor.h
++++ b/include/asm-m68k/processor.h
+@@ -127,4 +127,6 @@ unsigned long get_wchan(struct task_stru
+
+ #define cpu_relax() barrier()
+
++extern int handle_kernel_fault(struct pt_regs *regs);
++
+ #endif
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-amiga-possible-cleanups.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-amiga-possible-cleanups.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,135 @@
+Subject: [PATCH] m68k/amiga/: possible cleanups
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch contains the following possible cleanups:
+- amiints.c: add a proper prototype for amiga_init_IRQ() in
+ include/asm-m68k/amigaints.h
+- make the following needlessly global code static:
+ - config.c: amiga_model
+ - config.c: amiga_psfreq
+ - config.c: amiga_serial_console_write()
+- #if 0 the following unused functions:
+ - config.c: amiga_serial_puts()
+ - config.c: amiga_serial_console_wait_key()
+ - config.c: amiga_serial_gets()
+- remove the following unused variable:
+ - config.c: amiga_masterclock
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/amiga/config.c | 20 ++++++--------------
+ include/asm-m68k/amigahw.h | 4 ----
+ include/asm-m68k/amigaints.h | 2 ++
+ 3 files changed, 8 insertions(+), 18 deletions(-)
+
+--- a/arch/m68k/amiga/config.c
++++ b/arch/m68k/amiga/config.c
+@@ -36,14 +36,11 @@
+ #include <asm/machdep.h>
+ #include <asm/io.h>
+
+-unsigned long amiga_model;
+-EXPORT_SYMBOL(amiga_model);
++static unsigned long amiga_model;
+
+ unsigned long amiga_eclock;
+ EXPORT_SYMBOL(amiga_eclock);
+
+-unsigned long amiga_masterclock;
+-
+ unsigned long amiga_colorclock;
+ EXPORT_SYMBOL(amiga_colorclock);
+
+@@ -53,7 +50,7 @@ EXPORT_SYMBOL(amiga_chipset);
+ unsigned char amiga_vblank;
+ EXPORT_SYMBOL(amiga_vblank);
+
+-unsigned char amiga_psfreq;
++static unsigned char amiga_psfreq;
+
+ struct amiga_hw_present amiga_hw_present;
+ EXPORT_SYMBOL(amiga_hw_present);
+@@ -94,8 +91,6 @@ static char *amiga_models[] __initdata =
+ static char amiga_model_name[13] = "Amiga ";
+
+ static void amiga_sched_init(irq_handler_t handler);
+-/* amiga specific irq functions */
+-extern void amiga_init_IRQ(void);
+ static void amiga_get_model(char *model);
+ static int amiga_get_hardware_list(char *buffer);
+ /* amiga specific timer functions */
+@@ -109,8 +104,6 @@ static void amiga_reset(void);
+ extern void amiga_init_sound(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);
+ #ifdef CONFIG_HEARTBEAT
+ static void amiga_heartbeat(int on);
+ #endif
+@@ -420,8 +413,7 @@ void __init config_amiga(void)
+ mach_heartbeat = amiga_heartbeat;
+ #endif
+
+- /* Fill in the clock values (based on the 700 kHz E-Clock) */
+- amiga_masterclock = 40*amiga_eclock; /* 28 MHz */
++ /* Fill in the clock value (based on the 700 kHz E-Clock) */
+ amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
+
+ /* clear all DMA bits */
+@@ -819,8 +811,8 @@ static void amiga_serial_putc(char c)
+ ;
+ }
+
+-void amiga_serial_console_write(struct console *co, const char *s,
+- unsigned int count)
++static void amiga_serial_console_write(struct console *co, const char *s,
++ unsigned int count)
+ {
+ while (count--) {
+ if (*s == '\n')
+@@ -829,7 +821,7 @@ void amiga_serial_console_write(struct c
+ }
+ }
+
+-#ifdef CONFIG_SERIAL_CONSOLE
++#if 0
+ void amiga_serial_puts(const char *s)
+ {
+ amiga_serial_console_write(NULL, s, strlen(s));
+--- a/include/asm-m68k/amigahw.h
++++ b/include/asm-m68k/amigahw.h
+@@ -22,8 +22,6 @@
+ * Different Amiga models
+ */
+
+-extern unsigned long amiga_model;
+-
+ #define AMI_UNKNOWN (0)
+ #define AMI_500 (1)
+ #define AMI_500PLUS (2)
+@@ -59,11 +57,9 @@ extern unsigned long amiga_chipset;
+ */
+
+ extern unsigned long amiga_eclock; /* 700 kHz E Peripheral Clock */
+-extern unsigned long amiga_masterclock; /* 28 MHz Master Clock */
+ extern unsigned long amiga_colorclock; /* 3.5 MHz Color Clock */
+ extern unsigned long amiga_chip_size; /* Chip RAM Size (bytes) */
+ extern unsigned char amiga_vblank; /* VBLANK Frequency */
+-extern unsigned char amiga_psfreq; /* Power Supply Frequency */
+
+
+ #define AMIGAHW_DECLARE(name) unsigned name : 1
+--- a/include/asm-m68k/amigaints.h
++++ b/include/asm-m68k/amigaints.h
+@@ -98,6 +98,8 @@
+ #define CIA_ICR_ALL 0x1f
+ #define CIA_ICR_SETCLR 0x80
+
++extern void amiga_init_IRQ(void);
++
+ /* to access the interrupt control registers of CIA's use only
+ ** these functions, they behave exactly like the amiga os routines
+ */
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-apollo-remove-the-unused-APOLLO_ELPLUS-option.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-apollo-remove-the-unused-APOLLO_ELPLUS-option.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,31 @@
+Subject: [PATCH] m68k/Apollo: remove the unused APOLLO_ELPLUS option
+
+Looking at older kernel sources the APOLLO_ELPLUS option was added
+somewhere during kernel 2.1, but even kernel 2.2.0 does not contain
+any driver that would be enabled through it...
+
+Reported-by: Robert P. J. Day <rpjday at crashcourse.ca>
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/net/Kconfig | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -333,15 +333,6 @@ config APNE
+ To compile this driver as a module, choose M here: the module
+ will be called apne.
+
+-config APOLLO_ELPLUS
+- tristate "Apollo 3c505 support"
+- depends on APOLLO
+- help
+- Say Y or M here if your Apollo has a 3Com 3c505 ISA Ethernet card.
+- If you don't have one made for Apollos, you can use one from a PC,
+- except that your Apollo won't be able to boot from it (because the
+- code in the ROM will be for a PC).
+-
+ config MAC8390
+ bool "Macintosh NS 8390 based ethernet cards"
+ depends on MAC
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-ariadne-use-netstats-in-net_device-structure.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-ariadne-use-netstats-in-net_device-structure.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,165 @@
+Subject: [PATCH] ariadne: use netstats in net_device structure
+Cc: linux-net at vger.kernel.org
+
+From: Paulius Zaleckas <paulius.zaleckas at teltonika.lt>
+
+Use net_device_stats from net_device structure instead of local.
+
+Signed-off-by: Paulius Zaleckas <paulius.zaleckas at teltonika.lt>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/net/ariadne.c | 47 ++++++++++++++++++++++-------------------------
+ 1 file changed, 22 insertions(+), 25 deletions(-)
+
+--- a/drivers/net/ariadne.c
++++ b/drivers/net/ariadne.c
+@@ -98,7 +98,6 @@ struct ariadne_private {
+ volatile u_short *rx_buff[RX_RING_SIZE];
+ int cur_tx, cur_rx; /* The next free ring entry */
+ int dirty_tx; /* The ring entries to be free()ed. */
+- struct net_device_stats stats;
+ char tx_full;
+ };
+
+@@ -378,20 +377,19 @@ static void ariadne_init_ring(struct net
+
+ static int ariadne_close(struct net_device *dev)
+ {
+- struct ariadne_private *priv = netdev_priv(dev);
+ volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr;
+
+ netif_stop_queue(dev);
+
+ lance->RAP = CSR112; /* Missed Frame Count */
+- priv->stats.rx_missed_errors = swapw(lance->RDP);
++ dev->stats.rx_missed_errors = swapw(lance->RDP);
+ lance->RAP = CSR0; /* PCnet-ISA Controller Status */
+
+ if (ariadne_debug > 1) {
+ printk(KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
+ dev->name, lance->RDP);
+ printk(KERN_DEBUG "%s: %lu packets missed\n", dev->name,
+- priv->stats.rx_missed_errors);
++ dev->stats.rx_missed_errors);
+ }
+
+ /* We stop the LANCE here -- it occasionally polls memory if we don't. */
+@@ -502,16 +500,16 @@ static irqreturn_t ariadne_interrupt(int
+ if (status & TF_ERR) {
+ /* There was an major error, log it. */
+ int err_status = priv->tx_ring[entry]->TMD3;
+- priv->stats.tx_errors++;
++ dev->stats.tx_errors++;
+ if (err_status & EF_RTRY)
+- priv->stats.tx_aborted_errors++;
++ dev->stats.tx_aborted_errors++;
+ if (err_status & EF_LCAR)
+- priv->stats.tx_carrier_errors++;
++ dev->stats.tx_carrier_errors++;
+ if (err_status & EF_LCOL)
+- priv->stats.tx_window_errors++;
++ dev->stats.tx_window_errors++;
+ if (err_status & EF_UFLO) {
+ /* Ackk! On FIFO errors the Tx unit is turned off! */
+- priv->stats.tx_fifo_errors++;
++ dev->stats.tx_fifo_errors++;
+ /* Remove this verbosity later! */
+ printk(KERN_ERR "%s: Tx FIFO error! Status %4.4x.\n",
+ dev->name, csr0);
+@@ -520,8 +518,8 @@ static irqreturn_t ariadne_interrupt(int
+ }
+ } else {
+ if (status & (TF_MORE|TF_ONE))
+- priv->stats.collisions++;
+- priv->stats.tx_packets++;
++ dev->stats.collisions++;
++ dev->stats.tx_packets++;
+ }
+ dirty_tx++;
+ }
+@@ -547,11 +545,11 @@ static irqreturn_t ariadne_interrupt(int
+ /* Log misc errors. */
+ if (csr0 & BABL) {
+ handled = 1;
+- priv->stats.tx_errors++; /* Tx babble. */
++ dev->stats.tx_errors++; /* Tx babble. */
+ }
+ if (csr0 & MISS) {
+ handled = 1;
+- priv->stats.rx_errors++; /* Missed a Rx frame. */
++ dev->stats.rx_errors++; /* Missed a Rx frame. */
+ }
+ if (csr0 & MERR) {
+ handled = 1;
+@@ -672,7 +670,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;
++ dev->stats.tx_bytes += len;
+
+ /* Trigger an immediate send poll. */
+ lance->RAP = CSR0; /* PCnet-ISA Controller Status */
+@@ -707,15 +705,15 @@ static int ariadne_rx(struct net_device
+ buffers, with only the last correctly noting the error. */
+ if (status & RF_ENP)
+ /* Only count a general error at the end of a packet.*/
+- priv->stats.rx_errors++;
++ dev->stats.rx_errors++;
+ if (status & RF_FRAM)
+- priv->stats.rx_frame_errors++;
++ dev->stats.rx_frame_errors++;
+ if (status & RF_OFLO)
+- priv->stats.rx_over_errors++;
++ dev->stats.rx_over_errors++;
+ if (status & RF_CRC)
+- priv->stats.rx_crc_errors++;
++ dev->stats.rx_crc_errors++;
+ if (status & RF_BUFF)
+- priv->stats.rx_fifo_errors++;
++ dev->stats.rx_fifo_errors++;
+ priv->rx_ring[entry]->RMD1 &= 0xff00|RF_STP|RF_ENP;
+ } else {
+ /* Malloc up new buffer, compatible with net-3. */
+@@ -731,7 +729,7 @@ static int ariadne_rx(struct net_device
+ break;
+
+ if (i > RX_RING_SIZE-2) {
+- priv->stats.rx_dropped++;
++ dev->stats.rx_dropped++;
+ priv->rx_ring[entry]->RMD1 |= RF_OWN;
+ priv->cur_rx++;
+ }
+@@ -764,8 +762,8 @@ static int ariadne_rx(struct net_device
+
+ netif_rx(skb);
+ dev->last_rx = jiffies;
+- priv->stats.rx_packets++;
+- priv->stats.rx_bytes += pkt_len;
++ dev->stats.rx_packets++;
++ dev->stats.rx_bytes += pkt_len;
+ }
+
+ priv->rx_ring[entry]->RMD1 |= RF_OWN;
+@@ -783,7 +781,6 @@ static int ariadne_rx(struct net_device
+
+ static struct net_device_stats *ariadne_get_stats(struct net_device *dev)
+ {
+- struct ariadne_private *priv = netdev_priv(dev);
+ volatile struct Am79C960 *lance = (struct Am79C960*)dev->base_addr;
+ short saved_addr;
+ unsigned long flags;
+@@ -791,11 +788,11 @@ static struct net_device_stats *ariadne_
+ local_irq_save(flags);
+ saved_addr = lance->RAP;
+ lance->RAP = CSR112; /* Missed Frame Count */
+- priv->stats.rx_missed_errors = swapw(lance->RDP);
++ dev->stats.rx_missed_errors = swapw(lance->RDP);
+ lance->RAP = saved_addr;
+ local_irq_restore(flags);
+
+- return &priv->stats;
++ return &dev->stats;
+ }
+
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-debug.c-possible-cleanups.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-debug.c-possible-cleanups.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,133 @@
+Subject: [PATCH] m68k/atari/debug.c: possible cleanups
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch contains the following possible cleanups:
+- make the following needlessly global functions (always) static:
+ - atari_mfp_console_write()
+ - atari_scc_console_write()
+ - atari_midi_console_write()
+ - atari_init_mfp_port()
+ - atari_init_scc_port()
+ - atari_init_midi_port()
+- #if 0 the following unused functions:
+ - atari_mfp_console_wait_key()
+ - atari_scc_console_wait_key()
+ - atari_midi_console_wait_key()
+- remove the following unused variables:
+ - atari_MFP_init_done
+ - atari_SCC_init_done
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/atari/debug.c | 37 +++++++------------------------------
+ 1 file changed, 7 insertions(+), 30 deletions(-)
+
+--- a/arch/m68k/atari/debug.c
++++ b/arch/m68k/atari/debug.c
+@@ -20,14 +20,6 @@
+ #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;
+@@ -47,8 +39,8 @@ static inline void ata_mfp_out(char c)
+ mfp.usart_dta = c;
+ }
+
+-void atari_mfp_console_write(struct console *co, const char *str,
+- unsigned int count)
++static void atari_mfp_console_write(struct console *co, const char *str,
++ unsigned int count)
+ {
+ while (count--) {
+ if (*str == '\n')
+@@ -66,8 +58,8 @@ static inline void ata_scc_out(char c)
+ scc.cha_b_data = c;
+ }
+
+-void atari_scc_console_write(struct console *co, const char *str,
+- unsigned int count)
++static void atari_scc_console_write(struct console *co, const char *str,
++ unsigned int count)
+ {
+ while (count--) {
+ if (*str == '\n')
+@@ -83,8 +75,8 @@ static inline void ata_midi_out(char c)
+ acia.mid_data = c;
+ }
+
+-void atari_midi_console_write(struct console *co, const char *str,
+- unsigned int count)
++static void atari_midi_console_write(struct console *co, const char *str,
++ unsigned int count)
+ {
+ while (count--) {
+ if (*str == '\n')
+@@ -136,7 +128,7 @@ static void atari_par_console_write(stru
+ }
+ }
+
+-#ifdef CONFIG_SERIAL_CONSOLE
++#if 0
+ int atari_mfp_console_wait_key(struct console *co)
+ {
+ while (!(mfp.rcv_stat & 0x80)) /* wait for rx buf filled */
+@@ -166,11 +158,7 @@ int atari_midi_console_wait_key(struct c
+ * SCC serial ports. They're used by the debugging interface, kgdb, and the
+ * serial console code.
+ */
+-#ifndef CONFIG_SERIAL_CONSOLE
+ static void __init atari_init_mfp_port(int cflag)
+-#else
+-void atari_init_mfp_port(int cflag)
+-#endif
+ {
+ /*
+ * timer values for 1200...115200 bps; > 38400 select 110, 134, or 150
+@@ -193,8 +181,6 @@ void atari_init_mfp_port(int cflag)
+ mfp.tim_dt_d = baud_table[baud];
+ mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */
+ mfp.trn_stat |= 0x01; /* enable TX */
+-
+- atari_MFP_init_done = 1;
+ }
+
+ #define SCC_WRITE(reg, val) \
+@@ -214,11 +200,7 @@ void atari_init_mfp_port(int cflag)
+ MFPDELAY(); \
+ } while (0)
+
+-#ifndef CONFIG_SERIAL_CONSOLE
+ static void __init atari_init_scc_port(int cflag)
+-#else
+-void atari_init_scc_port(int cflag)
+-#endif
+ {
+ extern int atari_SCC_reset_done;
+ static int clksrc_table[9] =
+@@ -277,14 +259,9 @@ void atari_init_scc_port(int cflag)
+ SCC_WRITE(5, reg5 | 8);
+
+ atari_SCC_reset_done = 1;
+- atari_SCC_init_done = 1;
+ }
+
+-#ifndef CONFIG_SERIAL_CONSOLE
+ static void __init atari_init_midi_port(int cflag)
+-#else
+-void atari_init_midi_port(int cflag)
+-#endif
+ {
+ int baud = cflag & CBAUD;
+ int csize = ((cflag & CSIZE) == CS8) ? 0x10 : 0x00;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-remove-the-dead-ATARI_SCC-options.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-remove-the-dead-ATARI_SCC-options.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,54 @@
+Subject: [PATCH] m68k/Atari: remove the dead ATARI_SCC{,_DMA} options
+
+From: Adrian Bunk <bunk at kernel.org>
+
+It seems the driver was removed back in kernel 2.3 but the options were
+forgotten.
+
+Reported-by: Robert P. J. Day <rpjday at crashcourse.ca>
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/Kconfig | 24 +-----------------------
+ 1 file changed, 1 insertion(+), 23 deletions(-)
+
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -490,28 +490,6 @@ config ATARI_MFPSER
+ Note for Falcon users: You also have an MFP port, it's just not
+ wired to the outside... But you could use the port under Linux.
+
+-config ATARI_SCC
+- tristate "Atari SCC serial support"
+- depends on ATARI
+- ---help---
+- If you have serial ports based on a Zilog SCC chip (Modem2, Serial2,
+- LAN) and like to use them under Linux, say Y. All built-in SCC's are
+- supported (TT, MegaSTE, Falcon), and also the ST-ESCC. If you have
+- two connectors for channel A (Serial2 and LAN), they are visible as
+- two separate devices.
+-
+- To compile this driver as a module, choose M here.
+-
+-config ATARI_SCC_DMA
+- bool "Atari SCC serial DMA support"
+- depends on ATARI_SCC
+- help
+- This enables DMA support for receiving data on channel A of the SCC.
+- If you have a TT you may say Y here and read
+- drivers/char/atari_SCC.README. All other users should say N here,
+- because only the TT has SCC-DMA, even if your machine keeps claiming
+- so at boot time.
+-
+ config ATARI_MIDI
+ tristate "Atari MIDI serial support"
+ depends on ATARI
+@@ -628,7 +606,7 @@ config DN_SERIAL
+
+ config SERIAL_CONSOLE
+ bool "Support for serial port console"
+- depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_SCC=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
++ depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
+ ---help---
+ If you say Y here, it will be possible to use a serial port as the
+ system console (the system console is the device which receives all
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-scc-checkpatch.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-scc-checkpatch.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,1319 @@
+---
+ arch/m68k/atari/ataints.c | 2
+ arch/m68k/atari/debug.c | 6
+ drivers/char/atari_scc.c | 570 +++++++++++++++++----------------------------
+ include/asm-m68k/atarihw.h | 3
+ 4 files changed, 232 insertions(+), 349 deletions(-)
+
+--- a/arch/m68k/atari/ataints.c
++++ b/arch/m68k/atari/ataints.c
+@@ -318,8 +318,6 @@ __ALIGN_STR "\n\t"
+
+ extern void atari_microwire_cmd(int cmd);
+
+-extern int atari_SCC_reset_done;
+-
+ static int atari_startup_irq(unsigned int irq)
+ {
+ m68k_irq_startup(irq);
+--- a/arch/m68k/atari/debug.c
++++ b/arch/m68k/atari/debug.c
+@@ -20,6 +20,11 @@
+ #include <asm/atarihw.h>
+ #include <asm/atariints.h>
+
++/*
++ * Flags to indicate one of the serial ports has already been initialized by the
++ * serial debug driver. We may want to hold off reinitializing ...
++ */
++
+ /* Flag that Modem1 port is already initialized and used */
+ int atari_SCC_init_done;
+ EXPORT_SYMBOL(atari_SCC_init_done);
+@@ -206,7 +211,6 @@ static void __init atari_init_mfp_port(i
+
+ static void __init atari_init_scc_port(int cflag)
+ {
+- extern int atari_SCC_reset_done;
+ static int clksrc_table[9] =
+ /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
+ { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
+--- a/drivers/char/atari_scc.c
++++ b/drivers/char/atari_scc.c
+@@ -22,7 +22,7 @@
+
+ #include <linux/module.h>
+ #include <linux/kdev_t.h>
+-#include <asm/io.h>
++#include <linux/io.h>
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
+ #include <linux/ioport.h>
+@@ -39,14 +39,14 @@
+ #include <linux/miscdevice.h>
+ #include <linux/console.h>
+ #include <linux/init.h>
++#include <linux/uaccess.h>
++#include <linux/generic_serial.h>
++
+ #include <asm/setup.h>
+-#include <asm/uaccess.h>
+ #include <asm/bootinfo.h>
+-
+ #include <asm/atarihw.h>
+ #include <asm/atariints.h>
+
+-#include <linux/generic_serial.h>
+ #include "scc.h"
+
+ #define CONFIG_TT_SCC 1
+@@ -61,7 +61,7 @@
+ static unsigned char scc_shadow[2][16];
+
+ /* Location to access for SCC register access delay */
+-static volatile unsigned char *scc_del = NULL;
++static volatile unsigned char *scc_del;
+
+ /* To keep track of STATUS_REG state for detection of Ext/Status int source */
+ static unsigned char scc_last_status_reg[2];
+@@ -95,16 +95,6 @@ static struct tty_driver *scc_driver;
+
+ static struct scc_port scc_ports[2];
+
+-/*
+- * Flags to indicate one of the serial ports has already been initialized by the
+- * serial debug driver. We may want to hold off reinitializing ...
+- */
+-
+-/* Flag that Modem1 port is already initialized and used */
+-extern int 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 */
+-extern int atari_SCC_reset_done;
+
+ /*---------------------------------------------------------------------------
+ * Interface from generic_serial.c back here
+@@ -144,17 +134,17 @@ static struct tty_operations scc_ops = {
+
+ /* BRG values for the standard speeds and the various clock sources */
+
+-typedef struct {
+- unsigned clksrc; /* clock source to use or -1 for not possible */
+- unsigned div; /* divisor: 1, 2 and 4 correspond to
+- * direct 1:16, 1:32 and 1:64 modes,
+- * divisors >= 4 yield a BRG value of
+- * div/2-2 (in 1:16 mode)
+- */
+-} BAUD_ENTRY;
++struct baud_entry {
++ unsigned clksrc; /* clock source to use or -1 for not possible */
++ unsigned div; /* divisor: 1, 2 and 4 correspond to
++ * direct 1:16, 1:32 and 1:64 modes,
++ * divisors >= 4 yield a BRG value of
++ * div/2-2 (in 1:16 mode)
++ */
++};
+
+ /* A pointer for each channel to the current baud table */
+-static BAUD_ENTRY *scc_baud_table[2];
++static struct baud_entry *scc_baud_table[2];
+
+ /* Baud table format:
+ *
+@@ -174,7 +164,7 @@ static BAUD_ENTRY *scc_baud_table[2];
+ * channel A and for both channels on the Mega STE/Falcon. (TRxC is unused)
+ */
+
+-static BAUD_ENTRY bdtab_norm[20] = {
++static struct baud_entry bdtab_norm[20] = {
+ /* B0 */ { 0, 0 },
+ /* B50 */ { CLK_RTxC, 4590 },
+ /* B75 */ { CLK_RTxC, 3060 },
+@@ -200,7 +190,7 @@ static BAUD_ENTRY bdtab_norm[20] = {
+ /* This is a special table for the TT channel B with 307.2 kHz at RTxC
+ * and 2.4576 MHz at TRxC
+ */
+-static BAUD_ENTRY bdtab_TTChB[20] = {
++static struct baud_entry bdtab_TTChB[20] = {
+ /* B0 */ { 0, 0 },
+ /* B50 */ { CLK_RTxC, 384 },
+ /* B75 */ { CLK_RTxC, 256 },
+@@ -217,8 +207,10 @@ static BAUD_ENTRY bdtab_TTChB[20] = {
+ /* B9600 */ { CLK_RTxC, 2 },
+ /* B19200 */ { CLK_RTxC, 1 },
+ /* B38400 */ { CLK_TRxC, 4 },
+- /* B57600 */ { CLK_TRxC, 2 }, /* 57600 is not possible, use 76800 instead */
+- /* B115200 */ { CLK_TRxC, 1 }, /* 115200 is not possible, use 153600 instead */
++ /* 57600 is not possible, use 76800 instead */
++ /* B57600 */ { CLK_TRxC, 2 },
++ /* 115200 is not possible, use 153600 instead */
++ /* B115200 */ { CLK_TRxC, 1 },
+ /* B230400 */ { 0, 0 }, /* #18 spd_shi: Impossible */
+ /* B460800 */ { 0, 0 } /* #19 spd_warp: Impossible */
+ };
+@@ -248,8 +240,9 @@ static int scc_init_drivers(void)
+
+ tty_set_operations(scc_driver, &scc_ops);
+
+- if ((error = tty_register_driver(scc_driver))) {
+- printk(KERN_ERR "scc: Couldn't register scc driver, error = %d\n",
++ error = tty_register_driver(scc_driver);
++ if (error) {
++ pr_err("scc: Couldn't register scc driver, error = %d\n",
+ error);
+ put_tty_driver(scc_driver);
+ return 1;
+@@ -287,23 +280,19 @@ static int atari_tt_scc_init(void)
+ {
+ struct scc_port *port;
+
+- printk(KERN_INFO "SCC: Atari TT Serial Driver\n");
++ pr_info("SCC: Atari TT Serial Driver\n");
+ /* FIXME channel A may be switchable between modem and LAN port */
+ /* Init channel A */
+ if (atari_SCC_init_done)
+- printk(KERN_INFO "SCC: already initialized, expect trouble!\n");
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: init channel A\n");
+-#endif
++ pr_warning("SCC: already initialized, expect trouble!\n");
++ pr_debug("SCC: init channel A\n");
+ port = &scc_ports[0];
+ port->channel = CHANNEL_A;
+ port->ctrlp = (volatile unsigned char *)&scc.cha_a_ctrl;
+ port->datap = port->ctrlp + 1;
+ port->port_a = &scc_ports[0];
+ port->port_b = &scc_ports[1];
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: request channel A irqs, port = %p\n", port);
+-#endif
++ pr_debug("SCC: request channel A irqs, port = %p\n", port);
+ request_irq(IRQ_SCCA_TX, scc_tx_int, IRQ_TYPE_PRIO, "SCC-A TX", port);
+ request_irq(IRQ_SCCA_STAT, scc_stat_int, IRQ_TYPE_PRIO,
+ "SCC-A status", port);
+@@ -312,14 +301,13 @@ static int atari_tt_scc_init(void)
+ "SCC-A special cond", port);
+ {
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: read SCC status\n");
+-#endif
+- /* on the first access, read status register to reset internal pointers */
++ pr_debug("SCC: read SCC status\n");
++ /*
++ * on the first access, read status register to reset internal
++ * pointers
++ */
+ SCCread(STATUS_REG);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: reset SCC\n");
+-#endif
++ pr_debug("SCC: reset SCC\n");
+ /* FIXME: master reset, once only */
+ SCCwrite(MASTER_INT_CTRL, MIC_HARD_RESET);
+ udelay(40);
+@@ -338,18 +326,14 @@ static int atari_tt_scc_init(void)
+
+ if (!atari_SCC_init_done) {
+ /* Init channel B */
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: init channel B\n");
+-#endif
++ pr_debug("SCC: init channel B\n");
+ port = &scc_ports[1];
+ port->channel = CHANNEL_B;
+ port->ctrlp = (volatile unsigned char *)&scc.cha_b_ctrl;
+ port->datap = port->ctrlp + 1;
+ port->port_a = &scc_ports[0];
+ port->port_b = &scc_ports[1];
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: request channel B irqs, port = %p\n", port);
+-#endif
++ pr_debug("SCC: request channel B irqs, port = %p\n", port);
+ request_irq(IRQ_SCCB_TX, scc_tx_int, IRQ_TYPE_PRIO,
+ "SCC-B TX", port);
+ request_irq(IRQ_SCCB_STAT, scc_stat_int, IRQ_TYPE_PRIO,
+@@ -382,13 +366,9 @@ static int atari_tt_scc_init(void)
+ scc_baud_table[CHANNEL_B] = bdtab_TTChB;
+
+ /* Initialise the tty driver structures and register */
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: scc_init_portstructs()\n");
+-#endif
++ pr_debug("SCC: scc_init_portstructs()\n");
+ scc_init_portstructs();
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: scc_init_drivers()\n");
+-#endif
++ pr_debug("SCC: scc_init_drivers()\n");
+ scc_init_drivers();
+
+ return 0;
+@@ -401,9 +381,9 @@ static int atari_falcon_scc_init(void)
+ {
+ struct scc_port *port;
+
+- printk(KERN_INFO "SCC: Atari Falcon Serial Driver\n");
++ pr_info("SCC: Atari Falcon Serial Driver\n");
+ if (atari_SCC_init_done)
+- printk(KERN_INFO "SCC: already initialized, expect trouble!\n");
++ pr_warning("SCC: already initialized, expect trouble!\n");
+
+ /* Init channel A */
+ port = &scc_ports[0];
+@@ -421,7 +401,10 @@ static int atari_falcon_scc_init(void)
+ {
+ SCC_ACCESS_INIT(port);
+
+- /* on the first access, read status register to reset internal pointers */
++ /*
++ * on the first access, read status register to reset internal
++ * pointers
++ */
+ SCCread(STATUS_REG);
+
+ /* FIXME: master reset, once only */
+@@ -476,15 +459,15 @@ static int atari_falcon_scc_init(void)
+ static int atari_st_scc_init(void)
+ {
+ struct scc_port *port;
+-
+ int escc = ATARIHW_PRESENT(ST_ESCC);
+
+- printk(KERN_INFO "SCC: Atari MegaST/E Serial Driver\n");
++ pr_info("SCC: Atari MegaST/E Serial Driver\n");
+ /* FIXME: ports reversed logic */
+ /* Init channel A */
+ port = &scc_ports[1];
+ port->channel = CHANNEL_A;
+- port->ctrlp = (volatile unsigned char *)(escc ? &st_escc.cha_a_ctrl : &scc.cha_a_ctrl);
++ port->ctrlp = (volatile unsigned char *)(escc ? &st_escc.cha_a_ctrl
++ : &scc.cha_a_ctrl);
+ port->datap = port->ctrlp + 4;
+ port->port_a = &scc_ports[1];
+ port->port_b = &scc_ports[0];
+@@ -497,7 +480,10 @@ static int atari_st_scc_init(void)
+ {
+ SCC_ACCESS_INIT(port);
+
+- /* on the first access, read status register to reset internal pointers */
++ /*
++ * on the first access, read status register to reset internal
++ * pointers
++ */
+ SCCread(STATUS_REG);
+
+ /* FIXME: master reset, once only */
+@@ -516,7 +502,8 @@ static int atari_st_scc_init(void)
+ /* Init channel B */
+ port = &scc_ports[0];
+ port->channel = CHANNEL_B;
+- port->ctrlp = (volatile unsigned char *)(escc ? &st_escc.cha_b_ctrl : &scc.cha_b_ctrl);
++ port->ctrlp = (volatile unsigned char *)(escc ? &st_escc.cha_b_ctrl
++ : &scc.cha_b_ctrl);
+ port->datap = port->ctrlp + 4;
+ port->port_a = &scc_ports[0];
+ port->port_b = &scc_ports[1];
+@@ -550,7 +537,7 @@ static int atari_st_scc_init(void)
+ int atari_scc_init(void)
+ {
+ int res = -ENODEV;
+- static int called = 0;
++ static int called;
+
+ if (called)
+ return res;
+@@ -582,18 +569,14 @@ void atari_scc_cleanup(void)
+
+ tty_unregister_driver(scc_driver);
+ port = &scc_ports[0];
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: free channel A irqs, port = %p\n", port);
+-#endif
++ pr_debug("SCC: free channel A irqs, port = %p\n", port);
+ free_irq(IRQ_SCCA_TX, port);
+ free_irq(IRQ_SCCA_STAT, port);
+ free_irq(IRQ_SCCA_RX, port);
+ free_irq(IRQ_SCCA_SPCOND, port);
+
+ port = &scc_ports[1];
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: free channel A irqs, port = %p\n", port);
+-#endif
++ pr_debug("SCC: free channel A irqs, port = %p\n", port);
+ free_irq(IRQ_SCCB_TX, port);
+ free_irq(IRQ_SCCB_STAT, port);
+ free_irq(IRQ_SCCB_RX, port);
+@@ -613,13 +596,12 @@ static irqreturn_t scc_rx_int(int irq, v
+ unsigned char ch;
+ struct scc_port *port = data;
+ struct tty_struct *tty = port->gs.tty;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: rx_int ...\n");
+-#endif
++ pr_debug("SCC: rx_int ...\n");
+ ch = SCCread_NB(RX_DATA_REG);
+ if (!tty) {
+- printk(KERN_WARNING "scc_rx_int with NULL tty!\n");
++ pr_warning("scc_rx_int with NULL tty!\n");
+ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
+ return IRQ_HANDLED;
+ }
+@@ -633,9 +615,11 @@ static irqreturn_t scc_rx_int(int irq, v
+ tty->flip.count++;
+ }
+ #endif
+- /* Check if another character is already ready; in that case, the
+- * spcond_int() function must be used, because this character may have an
+- * error condition that isn't signalled by the interrupt vector used!
++ /*
++ * Check if another character is already ready; in that case, the
++ * spcond_int() function must be used, because this character may have
++ * an * error condition that isn't signalled by the interrupt vector
++ * used!
+ */
+ if (SCCread(INT_PENDING_REG) &
+ (port->channel == CHANNEL_A ? IPR_A_RX : IPR_B_RX)) {
+@@ -646,9 +630,7 @@ static irqreturn_t scc_rx_int(int irq, v
+ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
+
+ tty_flip_buffer_push(tty);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: rx_int done\n");
+-#endif
++ pr_debug("SCC: rx_int done\n");
+ return IRQ_HANDLED;
+ }
+
+@@ -661,11 +643,9 @@ static irqreturn_t scc_spcond_int(int ir
+ int int_pending_mask = port->channel == CHANNEL_A ? IPR_A_RX : IPR_B_RX;
+
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: spcond_int ...\n");
+-#endif
++ pr_debug("SCC: spcond_int ...\n");
+ if (!tty) {
+- printk(KERN_WARNING "scc_spcond_int with NULL tty!\n");
++ pr_warning("scc_spcond_int with NULL tty!\n");
+ SCCwrite(COMMAND_REG, CR_ERROR_RESET);
+ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
+ return IRQ_HANDLED;
+@@ -704,9 +684,7 @@ static irqreturn_t scc_spcond_int(int ir
+ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
+
+ tty_flip_buffer_push(tty);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: spcond_int done\n");
+-#endif
++ pr_debug("SCC: spcond_int done\n");
+ return IRQ_HANDLED;
+ }
+
+@@ -724,12 +702,11 @@ static void scc_ri_int(int irq, void *da
+ static irqreturn_t scc_tx_int(int irq, void *data)
+ {
+ struct scc_port *port = data;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: tx_int irq %d port %p ...\n", irq, data);
+-#endif
++ pr_debug("SCC: tx_int irq %d port %p ...\n", irq, data);
+ if (!port->gs.tty) {
+- printk(KERN_WARNING "scc_tx_int with NULL tty!\n");
++ pr_warning("scc_tx_int with NULL tty!\n");
+ SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
+ SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET);
+ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
+@@ -737,50 +714,40 @@ static irqreturn_t scc_tx_int(int irq, v
+ }
+ while ((SCCread_NB(STATUS_REG) & SR_TX_BUF_EMPTY)) {
+ if (port->x_char) {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: tx_int writing char %c\n",
+- port->x_char);
+-#endif
++ pr_debug("SCC: tx_int writing char %c\n", port->x_char);
+ SCCwrite(TX_DATA_REG, port->x_char);
+ port->x_char = 0;
+ } else if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped ||
+ port->gs.tty->hw_stopped) {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: nothing to do!\n");
+-#endif
++ pr_debug("SCC: nothing to do!\n");
+ break;
+ } else {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: tx_int writing buf %c\n",
+- port->gs.xmit_buf[port->gs.xmit_tail]);
+-#endif
+- SCCwrite(TX_DATA_REG, port->gs.xmit_buf[port->gs.xmit_tail++]);
+- port->gs.xmit_tail = port->gs.xmit_tail & (SERIAL_XMIT_SIZE-1);
++ pr_debug("SCC: tx_int writing buf %c\n",
++ port->gs.xmit_buf[port->gs.xmit_tail]);
++ SCCwrite(TX_DATA_REG,
++ port->gs.xmit_buf[port->gs.xmit_tail++]);
++ port->gs.xmit_tail = port->gs.xmit_tail &
++ (SERIAL_XMIT_SIZE-1);
+ if (--port->gs.xmit_cnt <= 0)
+ break;
+ }
+ }
+ if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped ||
+ port->gs.tty->hw_stopped) {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: nothing to do, disabling int\n");
+-#endif
++ pr_debug("SCC: nothing to do, disabling int\n");
+ /* disable tx interrupts */
+ SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
+- SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); /* disable tx_int on next tx underrun? */
++ /* disable tx_int on next tx underrun? */
++ SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET);
+ port->gs.flags &= ~GS_TX_INTEN;
+ }
+ if (port->gs.tty && port->gs.xmit_cnt <= port->gs.wakeup_chars) {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: waking up tty!\n");
+-#endif
++ pr_debug("SCC: waking up tty!\n");
+ tty_wakeup(port->gs.tty);
+ }
+
+ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: tx_int done\n");
+-#endif
++ pr_debug("SCC: tx_int done\n");
+ return IRQ_HANDLED;
+ }
+
+@@ -790,10 +757,9 @@ static irqreturn_t scc_stat_int(int irq,
+ struct scc_port *port = data;
+ unsigned channel = port->channel;
+ unsigned char last_sr, sr, changed;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: stat_int ...\n");
+-#endif
++ pr_debug("SCC: stat_int ...\n");
+ last_sr = scc_last_status_reg[channel];
+ sr = scc_last_status_reg[channel] = SCCread_NB(STATUS_REG);
+ changed = last_sr ^ sr;
+@@ -811,13 +777,11 @@ static irqreturn_t scc_stat_int(int irq,
+ }
+ }
+
+- // FIXME: CTS and DSR status changes?
++ /* FIXME: CTS and DSR status changes? */
+
+ SCCwrite(COMMAND_REG, CR_EXTSTAT_RESET);
+ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: stat_int done\n");
+-#endif
++ pr_debug("SCC: stat_int done\n");
+ return IRQ_HANDLED;
+ }
+
+@@ -830,17 +794,14 @@ static void scc_disable_tx_interrupts(vo
+ {
+ struct scc_port *port = ptr;
+ unsigned long flags;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: disable_tx_int ...\n");
+-#endif
++ pr_debug("SCC: disable_tx_int ...\n");
+ local_irq_save(flags);
+ SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
+ port->gs.flags &= ~GS_TX_INTEN;
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: disable_tx_int done!\n");
+-#endif
++ pr_debug("SCC: disable_tx_int done!\n");
+ }
+
+
+@@ -850,17 +811,13 @@ static void scc_enable_tx_interrupts(voi
+ unsigned long flags;
+
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: enable_tx_int ...\n");
+-#endif
++ pr_debug("SCC: enable_tx_int ...\n");
+ local_irq_save(flags);
+ SCCmod(INT_AND_DMA_REG, 0xff, IDR_TX_INT_ENAB);
+ /* restart the transmitter */
+ scc_tx_int(0, port);
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: enable_tx_int done!\n");
+-#endif
++ pr_debug("SCC: enable_tx_int done!\n");
+ }
+
+
+@@ -870,16 +827,12 @@ static void scc_disable_rx_interrupts(vo
+ unsigned long flags;
+
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: disable_rx_int ...\n");
+-#endif
++ pr_debug("SCC: disable_rx_int ...\n");
+ local_irq_save(flags);
+ SCCmod(INT_AND_DMA_REG,
+ ~(IDR_RX_INT_MASK|IDR_PARERR_AS_SPCOND|IDR_EXTSTAT_INT_ENAB), 0);
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: disable_rx_int done!\n");
+-#endif
++ pr_debug("SCC: disable_rx_int done!\n");
+ }
+
+
+@@ -889,16 +842,12 @@ static void scc_enable_rx_interrupts(voi
+ unsigned long flags;
+
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: enable_rx_int ...\n");
+-#endif
++ pr_debug("SCC: enable_rx_int ...\n");
+ local_irq_save(flags);
+ SCCmod(INT_AND_DMA_REG, 0xff,
+ IDR_EXTSTAT_INT_ENAB|IDR_PARERR_AS_SPCOND|IDR_RX_INT_ALL);
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: enable_rx_int done!\n");
+-#endif
++ pr_debug("SCC: enable_rx_int done!\n");
+ }
+
+
+@@ -906,9 +855,8 @@ static int scc_get_CD(void *ptr)
+ {
+ struct scc_port *port = ptr;
+ unsigned channel = port->channel;
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: get_CD!\n");
+-#endif
++
++ pr_debug("SCC: get_CD!\n");
+ return !!(scc_last_status_reg[channel] & SR_DCD);
+ }
+
+@@ -916,15 +864,12 @@ static int scc_get_CD(void *ptr)
+ static void scc_shutdown_port(void *ptr)
+ {
+ struct scc_port *port = ptr;
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: shutdown_port ...\n");
+-#endif
++
++ pr_debug("SCC: shutdown_port ...\n");
+ port->gs.flags &= ~GS_ACTIVE;
+ if (port->gs.tty && port->gs.tty->termios->c_cflag & HUPCL)
+ scc_setsignals(port, 0, 0);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: shutdown_port done!\n");
+-#endif
++ pr_debug("SCC: shutdown_port done!\n");
+ }
+
+
+@@ -936,15 +881,14 @@ static int scc_set_real_termios(void *pt
+ unsigned int clkmode, clksrc, div, chsize, channel, brgval = 0;
+ unsigned long flags;
+ struct scc_port *port = ptr;
++
+ SCC_ACCESS_INIT(port);
+
+ if (!port->gs.tty || !port->gs.tty->termios)
+ return 0;
+
+ channel = port->channel;
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: termios for channel %p\n", channel);
+-#endif
++ pr_debug("SCC: termios for channel %u\n", channel);
+ cflag = port->gs.tty->termios->c_cflag;
+ baud = port->gs.baud;
+ baudbits = cflag & CBAUD;
+@@ -958,7 +902,7 @@ static int scc_set_real_termios(void *pt
+ return 0;
+ } else if ((MACH_IS_TT && (baud < 50 || baud > 115200)) ||
+ (MACH_IS_FALCON && (baud < 50 || baud > 230400))) {
+- printk(KERN_NOTICE "SCC: Bad speed requested, %d\n", baud);
++ pr_debug("SCC: Bad speed requested, %d\n", baud);
+ return 0;
+ }
+
+@@ -967,10 +911,12 @@ static int scc_set_real_termios(void *pt
+ else
+ port->gs.flags |= ASYNC_CHECK_CD;
+
+- // calculate brgval for Atari; enable direct modes!
+-
+- /* convert baud rate from gs.baud to table index, set custom divisor eventually */
++ /* calculate brgval for Atari; enable direct modes! */
+
++ /*
++ * convert baud rate from gs.baud to table index, set custom divisor
++ * eventually
++ */
+ div = 0;
+ clksrc = 0;
+ baudidx = 0;
+@@ -1042,14 +988,12 @@ static int scc_set_real_termios(void *pt
+ clksrc = scc_baud_table[channel][baudidx].clksrc;
+ div = scc_baud_table[channel][baudidx].div;
+ if (!div) {
+- printk(" SCC_change_speed: divisor = 0 !!!");
++ pr_debug("SCC_change_speed: divisor = 0 !!!\n");
+ return 0;
+ }
+ }
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: termios baud %d baudbits %d baudidx %d \n clksrc %d div %d\n",
+- baud, baudbits, baudidx, clksrc, div);
+-#endif
++ pr_debug("SCC: termios baud %d baudbits %d baudidx %d \n clksrc %d "
++ "div %d\n", baud, baudbits, baudidx, clksrc, div);
+ /* compute the SCC's clock source, clock mode, BRG mode and BRG
+ * value from clksrc and div
+ */
+@@ -1070,18 +1014,19 @@ static int scc_set_real_termios(void *pt
+ clksrc = CCR_TXCLK_BRG | CCR_RXCLK_BRG;
+ }
+
+- //printk(KERN_INFO "SCC: termios baud %d baudbits %d baudidx %d \n clksrc %d clkmode %d div %d brgval %d brgmode %d\n",
+- // baud, baudbits, baudidx, clksrc, clkmode, div, brgval, brgmode);
++ /*
++ * pr_info("SCC: termios baud %d baudbits %d baudidx %d \n clksrc %d "
++ * "clkmode %d div %d brgval %d brgmode %d\n", baud, baudbits,
++ * baudidx, clksrc, clkmode, div, brgval, brgmode);
++ */
+
+ /* Now we have all parameters and can go to set them: */
+ local_irq_save(flags);
+
+-#ifdef DEBUG
+- printk(" brgval=%d brgmode=%02x clkmode=%02x clksrc=%02x\n",
+- brgval, brgmode, clkmode, clksrc);
+-#endif
++ pr_debug(" brgval=%d brgmode=%02x clkmode=%02x clksrc=%02x\n", brgval,
++ brgmode, clkmode, clksrc);
+ /* receiver's character size and auto-enables */
+-#if 0 // auto-enable considered harmful ...
++#if 0 /* auto-enable considered harmful ... */
+ SCCmod(RX_CTRL_REG, ~(RCR_CHSIZE_MASK|RCR_AUTO_ENAB_MODE),
+ (chsize_map[chsize] << 6) |
+ ((cflag & CRTSCTS) ? RCR_AUTO_ENAB_MODE : 0));
+@@ -1089,11 +1034,9 @@ static int scc_set_real_termios(void *pt
+ /* receiver's character size */
+ SCCmod(RX_CTRL_REG, ~RCR_CHSIZE_MASK, chsize_map[chsize] << 6);
+ #endif
+-#ifdef DEBUG
+- printk(" RX_CTRL_REG <- %02x\n", SCCread( RX_CTRL_REG ));
+-#endif
++ pr_debug(" RX_CTRL_REG <- %02x\n", SCCread(RX_CTRL_REG));
+
+- // clock mode changes depending on baud rate
++ /* clock mode changes depending on baud rate */
+ /* parity and stop bits (both, Tx and Rx) and clock mode */
+ SCCmod(AUX1_CTRL_REG,
+ ~(A1CR_PARITY_MASK | A1CR_MODE_MASK | A1CR_CLKMODE_MASK),
+@@ -1103,22 +1046,17 @@ static int scc_set_real_termios(void *pt
+ | (cflag & CSTOPB ? A1CR_MODE_ASYNC_2 : A1CR_MODE_ASYNC_1)
+ | clkmode));
+
+-#ifdef DEBUG
+- printk(" AUX1_CTRL_REG <- %02x\n", SCCread(AUX1_CTRL_REG));
+-#endif
++ pr_debug(" AUX1_CTRL_REG <- %02x\n", SCCread(AUX1_CTRL_REG));
+ /* sender's character size, set DTR for valid baud rate */
+- SCCmod(TX_CTRL_REG, ~TCR_CHSIZE_MASK, chsize_map[chsize] << 5 | TCR_DTR);
+-#ifdef DEBUG
+- printk(" TX_CTRL_REG <- %02x\n", SCCread(TX_CTRL_REG));
+-#endif
++ SCCmod(TX_CTRL_REG, ~TCR_CHSIZE_MASK,
++ chsize_map[chsize] << 5 | TCR_DTR);
++ pr_debug(" TX_CTRL_REG <- %02x\n", SCCread(TX_CTRL_REG));
+
+- // clock sources change for TT !!
++ /* clock sources change for TT !! */
+ /* clock sources never change */
+ /* clock sources */
+ SCCmod(CLK_CTRL_REG, ~(CCR_TXCLK_MASK | CCR_RXCLK_MASK), clksrc);
+-#ifdef DEBUG
+- printk(" CLK_CTRL_REG <- %02x\n", SCCread(CLK_CTRL_REG));
+-#endif
++ pr_debug(" CLK_CTRL_REG <- %02x\n", SCCread(CLK_CTRL_REG));
+
+ /* disable BRG before changing the value */
+ SCCmod(DPLL_CTRL_REG, ~DCR_BRG_ENAB, 0);
+@@ -1126,20 +1064,14 @@ static int scc_set_real_termios(void *pt
+ SCCwrite(TIMER_LOW_REG, brgval & 0xff);
+ SCCwrite(TIMER_HIGH_REG, (brgval >> 8) & 0xff);
+ /* BRG enable, and clock source never changes */
+- //SCCmod(DPLL_CTRL_REG, 0xff, DCR_BRG_ENAB);
++ /* SCCmod(DPLL_CTRL_REG, 0xff, DCR_BRG_ENAB); */
+ SCCmod(DPLL_CTRL_REG, ~(DCR_BRG_ENAB | DCR_BRG_USE_PCLK), brgmode);
+-#ifdef DEBUG
+- printk(" TIMER_LOW_REG <- %02x\n", SCCread(TIMER_LOW_REG));
+- printk(" TIMER_HIGH_REG <- %02x\n", SCCread(TIMER_HIGH_REG));
+-#endif
+-#ifdef DEBUG
+- printk(" DPLL_CTRL_REG <- %02x\n", SCCread(DPLL_CTRL_REG));
+-#endif
++ pr_debug(" TIMER_LOW_REG <- %02x\n", SCCread(TIMER_LOW_REG));
++ pr_debug(" TIMER_HIGH_REG <- %02x\n", SCCread(TIMER_HIGH_REG));
++ pr_debug(" DPLL_CTRL_REG <- %02x\n", SCCread(DPLL_CTRL_REG));
+
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: done termios for channel %d\n", channel);
+-#endif
++ pr_debug("SCC: done termios for channel %d\n", channel);
+ return 0;
+ }
+
+@@ -1150,10 +1082,11 @@ static int scc_chars_in_buffer(void *ptr
+ #ifdef DEBUG
+ int rv;
+ #endif
++
+ SCC_ACCESS_INIT(port);
+ #ifdef DEBUG
+ rv = (SCCread(SPCOND_STATUS_REG) & SCSR_ALL_SENT) ? 0 : 1;
+- printk(KERN_INFO "SCC: chars_in_buffer: %d\n", rv);
++ pr_debug("SCC: chars_in_buffer: %d\n", rv);
+ return rv;
+ #else
+ return (SCCread(SPCOND_STATUS_REG) & SCSR_ALL_SENT) ? 0 : 1;
+@@ -1172,27 +1105,19 @@ static int scc_chars_in_buffer(void *ptr
+
+ static void scc_hungup(void *ptr)
+ {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: hungup ...\n");
+-#endif
++ pr_debug("SCC: hungup ...\n");
+ scc_disable_tx_interrupts(ptr);
+ scc_disable_rx_interrupts(ptr);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: hungup done\n");
+-#endif
++ pr_debug("SCC: hungup done\n");
+ }
+
+
+ static void scc_close(void *ptr)
+ {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: close ...\n");
+-#endif
++ pr_debug("SCC: close ...\n");
+ scc_disable_tx_interrupts(ptr);
+ scc_disable_rx_interrupts(ptr);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: close done\n");
+-#endif
++ pr_debug("SCC: close done\n");
+ }
+
+
+@@ -1204,10 +1129,9 @@ static void scc_setsignals(struct scc_po
+ {
+ unsigned long flags;
+ unsigned char t;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: setsignals dtr %d rts %d...\n", dtr, rts);
+-#endif
++ pr_debug("SCC: setsignals dtr %d rts %d...\n", dtr, rts);
+ local_irq_save(flags);
+ t = SCCread(TX_CTRL_REG);
+ if (dtr >= 0)
+@@ -1216,24 +1140,19 @@ static void scc_setsignals(struct scc_po
+ t = rts? (t | TCR_RTS): (t & ~TCR_RTS);
+ SCCwrite(TX_CTRL_REG, t);
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: setsignals done\n");
+-#endif
++ pr_debug("SCC: setsignals done\n");
+ }
+
+
+ static void scc_send_xchar(struct tty_struct *tty, char ch)
+ {
+ struct scc_port *port = (struct scc_port *)tty->driver_data;
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: send_xchar ...\n");
+-#endif
++
++ pr_debug("SCC: send_xchar ...\n");
+ port->x_char = ch;
+ if (ch)
+ scc_enable_tx_interrupts(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: send_xchar done\n");
+-#endif
++ pr_debug("SCC: send_xchar done\n");
+ }
+
+
+@@ -1254,7 +1173,8 @@ static int scc_open(struct tty_struct *t
+ unsigned reg, val;
+ } scc_init_tab[] = {
+ /* no parity, 1 stop bit, async, 1:16 */
+- { AUX1_CTRL_REG, A1CR_PARITY_NONE|A1CR_MODE_ASYNC_1|A1CR_CLKMODE_x64 },
++ { AUX1_CTRL_REG,
++ A1CR_PARITY_NONE|A1CR_MODE_ASYNC_1|A1CR_CLKMODE_x64 },
+ /* parity error is special cond, ints disabled, no DMA */
+ { INT_AND_DMA_REG, IDR_PARERR_AS_SPCOND | IDR_RX_INT_DISAB },
+ /* Rx 8 bits/char, no auto enable, Rx off */
+@@ -1264,14 +1184,16 @@ static int scc_open(struct tty_struct *t
+ /* special features off */
+ { AUX2_CTRL_REG, 0 },
+ /* RTxC is XTAL, TRxC is input, both clocks = RTxC */
+- { CLK_CTRL_REG, CCR_TRxCOUT_XTAL | CCR_TXCLK_RTxC | CCR_RXCLK_RTxC },
++ { CLK_CTRL_REG,
++ CCR_TRxCOUT_XTAL | CCR_TXCLK_RTxC | CCR_RXCLK_RTxC },
+ { DPLL_CTRL_REG, 0 },
+ /* Start Rx */
+ { RX_CTRL_REG, RCR_RX_ENAB | RCR_CHSIZE_8 },
+ /* Start Tx */
+ { TX_CTRL_REG, TCR_TX_ENAB | TCR_RTS | TCR_DTR | TCR_CHSIZE_8 },
+ /* Ext/Stat ints: CTS, DCD, SYNC (DSR) */
+- { INT_CTRL_REG, ICR_ENAB_DCD_INT | ICR_ENAB_CTS_INT | ICR_ENAB_SYNC_INT },
++ { INT_CTRL_REG,
++ ICR_ENAB_DCD_INT | ICR_ENAB_CTS_INT | ICR_ENAB_SYNC_INT },
+ /* Reset Ext/Stat ints */
+ { COMMAND_REG, CR_EXTSTAT_RESET },
+ /* ...again */
+@@ -1284,57 +1206,46 @@ static int scc_open(struct tty_struct *t
+ if (atari_SCC_init_done && line == 1)
+ return -ENODEV;
+
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: open port ...\n");
+-#endif
++ pr_debug("SCC: open port ...\n");
+ if (!(port->gs.flags & ASYNC_INITIALIZED)) {
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: init port ...\n");
+-#endif
++ pr_debug("SCC: init port ...\n");
+ local_irq_save(flags);
+
+ SCCmod(MASTER_INT_CTRL, 0x3f,
+ channel == 0 ? MIC_CH_A_RESET : MIC_CH_B_RESET);
+ udelay(40); /* extra delay after a reset */
+
+- for (i = 0; i < sizeof(scc_init_tab)/sizeof(*scc_init_tab); ++i)
++ for (i = 0; i < ARRAY_SIZE(scc_init_tab); ++i)
+ SCCwrite(scc_init_tab[i].reg, scc_init_tab[i].val);
+
+
+- /* remember status register for detection of DCD and CTS changes */
++ /*
++ * remember status register for detection of DCD and CTS
++ * changes
++ */
+ scc_last_status_reg[channel] = SCCread(STATUS_REG);
+
+ port->c_dcd = 0; /* Prevent initial 1->0 interrupt */
+ scc_setsignals(port, 1, 1);
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: init port done!\n");
+-#endif
++ pr_debug("SCC: init port done!\n");
+ }
+
+ tty->driver_data = port;
+ port->gs.tty = tty;
+ port->gs.count++;
+-#ifdef DEBUG
+- printk(KERN_WARNING "SCC: gs init port ...\n");
+-#endif
++ pr_debug(KERN_WARNING "SCC: gs init port ...\n");
+ retval = gs_init_port(&port->gs);
+ if (retval) {
+ port->gs.count--;
+ return retval;
+ }
+-#ifdef DEBUG
+- printk(KERN_WARNING "SCC: gs init port done!\n");
+-#endif
++ pr_debug(KERN_WARNING "SCC: gs init port done!\n");
+ port->gs.flags |= GS_ACTIVE;
+
+-#ifdef DEBUG
+- printk(KERN_WARNING "SCC: gs wait ready ...\n");
+-#endif
++ pr_debug(KERN_WARNING "SCC: gs wait ready ...\n");
+ retval = gs_block_til_ready(port, filp);
+-#ifdef DEBUG
+- printk(KERN_WARNING "SCC: gs wait ready done!\n");
+-#endif
++ pr_debug(KERN_WARNING "SCC: gs wait ready done!\n");
+ if (retval) {
+ port->gs.count--;
+ return retval;
+@@ -1342,15 +1253,10 @@ static int scc_open(struct tty_struct *t
+
+ port->c_dcd = scc_get_CD(port);
+
+-#ifdef DEBUG
+- printk(KERN_WARNING "SCC: enable rx ints ...\n");
+-#endif
++ pr_debug(KERN_WARNING "SCC: enable rx ints ...\n");
+ scc_enable_rx_interrupts(port);
+-#ifdef DEBUG
+- printk(KERN_WARNING "SCC: enable rx ints done!\n");
+-
+- printk(KERN_INFO "SCC: open port done!\n");
+-#endif
++ pr_debug(KERN_WARNING "SCC: enable rx ints done!\n");
++ pr_info("SCC: open port done!\n");
+ return 0;
+ }
+
+@@ -1359,10 +1265,9 @@ static void scc_throttle(struct tty_stru
+ {
+ struct scc_port *port = (struct scc_port *)tty->driver_data;
+ unsigned long flags;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: throttle ...\n");
+-#endif
++ pr_debug("SCC: throttle ...\n");
+ if (tty->termios->c_cflag & CRTSCTS) {
+ local_irq_save(flags);
+ SCCmod(TX_CTRL_REG, ~TCR_RTS, 0);
+@@ -1370,9 +1275,7 @@ static void scc_throttle(struct tty_stru
+ }
+ if (I_IXOFF(tty))
+ scc_send_xchar(tty, STOP_CHAR(tty));
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: throttle done!\n");
+-#endif
++ pr_debug("SCC: throttle done!\n");
+ }
+
+
+@@ -1380,10 +1283,9 @@ static void scc_unthrottle(struct tty_st
+ {
+ struct scc_port *port = (struct scc_port *)tty->driver_data;
+ unsigned long flags;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: unthrottle ...\n");
+-#endif
++ pr_debug("SCC: unthrottle ...\n");
+ if (tty->termios->c_cflag & CRTSCTS) {
+ local_irq_save(flags);
+ SCCmod(TX_CTRL_REG, 0xff, TCR_RTS);
+@@ -1391,9 +1293,7 @@ static void scc_unthrottle(struct tty_st
+ }
+ if (I_IXOFF(tty))
+ scc_send_xchar(tty, START_CHAR(tty));
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: unthrottle done!\n");
+-#endif
++ pr_debug("SCC: unthrottle done!\n");
+ }
+
+
+@@ -1402,11 +1302,10 @@ static int scc_ioctl(struct tty_struct *
+ {
+ struct scc_port *port = (struct scc_port *)tty->driver_data;
+ int retval;
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl! cmd %d, arg %p \n", cmd, arg);
+-#endif
+- //if (serial_paranoia_check(info, tty->device, "zs_ioctl"))
+- // return -ENODEV;
++
++ pr_debug("SCC: ioctl! cmd %d, arg %lu\n", cmd, arg);
++ /* if (serial_paranoia_check(info, tty->device, "zs_ioctl")) */
++ /* return -ENODEV; */
+
+ if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
+ (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
+@@ -1417,37 +1316,29 @@ static int scc_ioctl(struct tty_struct *
+
+ switch (cmd) {
+ case TCSBRK: /* SVID version: non-zero arg --> no break */
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TCSBRK\n");
+-#endif
++ pr_debug("SCC: ioctl TCSBRK\n");
+ retval = tty_check_change(tty);
+ if (retval)
+ return retval;
+ tty_wait_until_sent(tty, 0);
+- //if (!arg)
+- // send_break(info, HZ/4); /* 1/4 second */
++ /* if (!arg) */
++ /* send_break(info, HZ/4); */
+ return 0;
+ case TCSBRKP: /* support for POSIX tcsendbreak() */
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TCSBRKP\n");
+-#endif
++ pr_debug("SCC: ioctl TCSBRKP\n");
+ retval = tty_check_change(tty);
+ if (retval)
+ return retval;
+ tty_wait_until_sent(tty, 0);
+- //send_break(info, arg ? arg*(HZ/10) : HZ/4);
++ /* send_break(info, arg ? arg*(HZ/10) : HZ/4); */
+ return 0;
+ case TIOCGSOFTCAR:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCGSOFTCAR\n");
+-#endif
++ pr_debug("SCC: ioctl TIOCGSOFTCAR\n");
+ if (put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg))
+ return -EFAULT;
+ return 0;
+ case TIOCSSOFTCAR:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCSSOFTCAR\n");
+-#endif
++ pr_debug("SCC: ioctl TIOCSSOFTCAR\n");
+ if (get_user(arg, (unsigned long *)arg))
+ return -EFAULT;
+ tty->termios->c_cflag =
+@@ -1455,54 +1346,38 @@ static int scc_ioctl(struct tty_struct *
+ (arg ? CLOCAL : 0));
+ return 0;
+ case TIOCMGET:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCMGET\n");
+-#endif
+- //return get_modem_info(info, (unsigned int *)arg);
++ pr_debug("SCC: ioctl TIOCMGET\n");
++ /* return get_modem_info(info, (unsigned int *)arg); */
+ return 0;
+ case TIOCMBIS:
+ case TIOCMBIC:
+ case TIOCMSET:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCMSET\n");
+-#endif
+- //return set_modem_info(info, cmd, (unsigned int *)arg);
++ pr_debug("SCC: ioctl TIOCMSET\n");
++ /* return set_modem_info(info, cmd, (unsigned int *)arg); */
+ return 0;
+ case TIOCGSERIAL:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCGSERIAL\n");
+-#endif
++ pr_debug("SCC: ioctl TIOCGSERIAL\n");
+ return 0;
+- //return get_serial_info(info,
+- // (struct serial_struct *)arg);
++ /* return get_serial_info(info, (struct serial_struct *)arg); */
+ case TIOCSSERIAL:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCSSERIAL\n");
+-#endif
++ pr_debug("SCC: ioctl TIOCSSERIAL\n");
+ return 0;
+- //return set_serial_info(info,
+- // (struct serial_struct *)arg);
++ /* return set_serial_info(info, (struct serial_struct *)arg); */
+ case TIOCSERGETLSR: /* Get line status register */
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCSERGETLSR\n");
+-#endif
++ pr_debug("SCC: ioctl TIOCSERGETLSR\n");
+ return 0;
+- //return get_lsr_info(info, (unsigned int *)arg);
++ /* return get_lsr_info(info, (unsigned int *)arg); */
+
+ case TIOCSERGSTRUCT:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl TIOCSERGSTRUCT\n");
+-#endif
++ pr_debug("SCC: ioctl TIOCSERGSTRUCT\n");
+ return 0;
+- if (copy_to_user((struct scc_port *)arg,
+- port, sizeof(struct scc_port)))
++ if (copy_to_user((struct scc_port *)arg, port,
++ sizeof(struct scc_port)))
+ return -EFAULT;
+ return 0;
+
+ default:
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: ioctl default\n");
+-#endif
++ pr_debug("SCC: ioctl default\n");
+ return -ENOIOCTLCMD;
+ }
+ return 0;
+@@ -1513,16 +1388,13 @@ static void scc_break_ctl(struct tty_str
+ {
+ struct scc_port *port = (struct scc_port *)tty->driver_data;
+ unsigned long flags;
++
+ SCC_ACCESS_INIT(port);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: break ctl ...\n");
+-#endif
++ pr_debug("SCC: break ctl ...\n");
+ local_irq_save(flags);
+ SCCmod(TX_CTRL_REG, ~TCR_SEND_BREAK, break_state ? TCR_SEND_BREAK : 0);
+ local_irq_restore(flags);
+-#ifdef DEBUG
+- printk(KERN_INFO "SCC: break ctl done!\n");
+-#endif
++ pr_debug("SCC: break ctl done!\n");
+ }
+
+
+@@ -1541,18 +1413,19 @@ static void scc_break_ctl(struct tty_str
+ scc_delay(); \
+ } while (0)
+
+-/* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a
+- * delay of ~ 60us. */
++/*
++ * loops_per_jiffy isn't initialized yet, so we can't use udelay().
++ * This does a delay of ~ 60us.
++ */
+ #define LONG_DELAY() \
+ do { \
+ int i; \
+- for (i = 100; i > 0; --i) \
++ for (i = 100; i > 0; i--) \
+ scc_delay(); \
+ } while (0)
+
+ static void atari_init_scc_port(int cflag)
+ {
+- extern int atari_SCC_reset_done;
+ static int clksrc_table[9] =
+ /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
+ { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
+@@ -1573,15 +1446,20 @@ static void atari_init_scc_port(int cfla
+
+ if (cflag & CBAUDEX)
+ baud += B38400;
+- if (baud < B1200 || baud > B38400+2)
+- baud = B9600; /* use default 9600bps for non-implemented rates */
++ if (baud < B1200 || baud > B38400+2) {
++ /* use default 9600bps for non-implemented rates */
++ baud = B9600;
++ }
+ baud -= B1200; /* tables starts at 1200bps */
+
+ clksrc = clksrc_table[baud];
+ clkmode = clkmode_table[baud];
+ div = div_table[baud];
+ if (ATARIHW_PRESENT(TT_MFP) && baud >= 6) {
+- /* special treatment for TT, where rates >= 38400 are done via TRxC */
++ /*
++ * special treatment for TT, where rates >= 38400 are done via
++ * TRxC
++ */
+ clksrc = 0x28; /* TRxC */
+ clkmode = baud == 6 ? 0xc0 :
+ baud == 7 ? 0x80 : /* really 76800bps */
+@@ -1630,21 +1508,21 @@ static void scc_ch_write(char ch)
+
+ do {
+ scc_delay();
+- }
+- while (!(*p & 4));
+- // scc_delay();
+- // *p = 8;
++ } while (!(*p & 4));
++ /* scc_delay(); */
++ /* *p = 8; */
+ scc_delay();
+ *(p+1) = ch;
+ }
+
+ /* The console must be locked when we get here. */
+
+-static void scc_console_write(struct console *co, const char *str, unsigned count)
++static void scc_console_write(struct console *co, const char *str,
++ unsigned count)
+ {
+ unsigned long flags;
+
+- //printk("scc_console_write: %s\n", str);
++ /* printk("scc_console_write: %s\n", str); */
+ local_irq_save(flags);
+
+ while (count--) {
+@@ -1653,7 +1531,7 @@ static void scc_console_write(struct con
+ scc_ch_write(*str++);
+ }
+ local_irq_restore(flags);
+- //printk("scc_console_write done!\n");
++ /* printk("scc_console_write done!\n"); */
+ }
+
+ static struct tty_driver *scc_console_device(struct console *c, int *index)
+@@ -1665,9 +1543,9 @@ static struct tty_driver *scc_console_de
+
+ static int __init scc_console_setup(struct console *co, char *options)
+ {
+- printk("scc_console_setup: initializing SCC port B\n");
++ pr_debug("scc_console_setup: initializing SCC port B\n");
+ atari_init_scc_port(B9600|CS8);
+- printk("scc_console_setup: done!\n");
++ pr_debug("scc_console_setup: done!\n");
+ return 0;
+ }
+
+@@ -1682,14 +1560,14 @@ static struct console sercons = {
+ };
+
+
+-static int __init vme_scc_console_init(void)
++static int __init atari_scc_console_init(void)
+ {
+ if (MACH_IS_TT || MACH_IS_ST || MACH_IS_FALCON)
+ register_console(&sercons);
+ return 0;
+ }
+
+-console_initcall(vme_scc_console_init);
++console_initcall(atari_scc_console_init);
+ #endif
+
+ /***************************** End of Functions *********************/
+--- a/include/asm-m68k/atarihw.h
++++ b/include/asm-m68k/atarihw.h
+@@ -30,6 +30,9 @@ extern u_long atari_switches;
+ extern int atari_rtc_year_offset;
+ extern int atari_dont_touch_floppy_select;
+
++extern int atari_SCC_init_done;
++extern int atari_SCC_reset_done;
++
+ /* convenience macros for testing machine type */
+ #define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST)
+ #define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-scc.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-atari-scc.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,1737 @@
+To: linus, akpm
+Cc: lkml
+Subject: [PATCH] m68k: Atari SCC serial driver
+
+From: Michael Schmitz <schmitz at opal.biophys.uni-duesseldorf.de>
+
+Atari SCC serial driver - this one works less well in 2.6 than it did in 2.4,
+most likely due to the way flip buffer push is handled now - i.e. no
+immediate push of received characters to the line disc. if the handler
+runs in interrupt context, and the bottom half for pushing is run as
+delayed task. 9 out of 10 ping packets end up in the bit bucket this way.
+I haven't figured out how to prevent overruns yet, and getting this right
+will require a bit more testing.
+
+Anyway, the basics are working, and maybe someone can figure out a better
+way to push characters up to the ldisc.
+
+Signed-off-by: Michael Schmitz <schmitz at debian.org>
+Signed-off-by: Roman Zippel <zippel at linux-m68k.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/char/Makefile | 1
+ drivers/char/atari_scc.c | 1699 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 1700 insertions(+)
+
+--- a/drivers/char/Makefile
++++ b/drivers/char/Makefile
+@@ -31,6 +31,7 @@ obj-$(CONFIG_DIGIEPCA) += epca.o
+ obj-$(CONFIG_SPECIALIX) += specialix.o
+ obj-$(CONFIG_MOXA_INTELLIO) += moxa.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_COMPUTONE) += ip2/
+--- /dev/null
++++ b/drivers/char/atari_scc.c
+@@ -0,0 +1,1699 @@
++/*
++ * Atari TT/Falcon Am8530 SCC serial ports implementation.
++ *
++ * Copyright 2005 Michael Schmitz
++ *
++ * Based on:
++ * drivers/char/vme_scc.c: MVME147, MVME162, BVME6000 SCC serial ports
++ * implementation.
++ * Copyright 1999 Richard Hirst <richard at sleepie.demon.co.uk>
++ *
++ * which, in turn, was
++ *
++ * Based on atari_SCC.c which was
++ * Copyright 1994-95 Roman Hodek <Roman.Hodek at informatik.uni-erlangen.de>
++ * Partially based on PC-Linux serial.c by Linus Torvalds and Theodore Ts'o
++ *
++ * 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/module.h>
++#include <linux/kdev_t.h>
++#include <asm/io.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/ioport.h>
++#include <linux/interrupt.h>
++#include <linux/errno.h>
++#include <linux/tty.h>
++#include <linux/tty_flip.h>
++#include <linux/mm.h>
++#include <linux/serial.h>
++#include <linux/fcntl.h>
++#include <linux/major.h>
++#include <linux/delay.h>
++#include <linux/slab.h>
++#include <linux/miscdevice.h>
++#include <linux/console.h>
++#include <linux/init.h>
++#include <asm/setup.h>
++#include <asm/uaccess.h>
++#include <asm/bootinfo.h>
++
++#include <asm/atarihw.h>
++#include <asm/atariints.h>
++
++#include <linux/generic_serial.h>
++#include "scc.h"
++
++#define CONFIG_TT_SCC 1
++#define CONFIG_FALCON_SCC 1
++
++#define CHANNEL_A 0
++#define CHANNEL_B 1
++
++#define SCC_MINOR_BASE 64
++
++/* Shadows for all SCC write registers */
++static unsigned char scc_shadow[2][16];
++
++/* Location to access for SCC register access delay */
++static volatile unsigned char *scc_del = NULL;
++
++/* To keep track of STATUS_REG state for detection of Ext/Status int source */
++static unsigned char scc_last_status_reg[2];
++
++/***************************** Prototypes *****************************/
++
++/* Function prototypes */
++static void scc_disable_tx_interrupts(void *ptr);
++static void scc_enable_tx_interrupts(void *ptr);
++static void scc_disable_rx_interrupts(void *ptr);
++static void scc_enable_rx_interrupts(void *ptr);
++static int scc_get_CD(void *ptr);
++static void scc_shutdown_port(void *ptr);
++static int scc_set_real_termios(void *ptr);
++static void scc_hungup(void *ptr);
++static void scc_close(void *ptr);
++static int scc_chars_in_buffer(void *ptr);
++static int scc_open(struct tty_struct *tty, struct file *filp);
++static int scc_ioctl(struct tty_struct *tty, struct file *filp,
++ unsigned int cmd, unsigned long arg);
++static void scc_throttle(struct tty_struct *tty);
++static void scc_unthrottle(struct tty_struct *tty);
++static irqreturn_t scc_tx_int(int irq, void *data);
++static irqreturn_t scc_rx_int(int irq, void *data);
++static irqreturn_t scc_stat_int(int irq, void *data);
++static irqreturn_t scc_spcond_int(int irq, void *data);
++static void scc_setsignals(struct scc_port *port, int dtr, int rts);
++static void scc_break_ctl(struct tty_struct *tty, int break_state);
++
++static struct tty_driver *scc_driver;
++
++static struct scc_port scc_ports[2];
++
++/*
++ * Flags to indicate one of the serial ports has already been initialized by the
++ * serial debug driver. We may want to hold off reinitializing ...
++ */
++
++/* Flag that Modem1 port is already initialized and used */
++extern int 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 */
++extern int atari_SCC_reset_done;
++
++/*---------------------------------------------------------------------------
++ * Interface from generic_serial.c back here
++ *--------------------------------------------------------------------------*/
++
++static struct real_driver scc_real_driver = {
++ .disable_tx_interrupts = scc_disable_tx_interrupts,
++ .enable_tx_interrupts = scc_enable_tx_interrupts,
++ .disable_rx_interrupts = scc_disable_rx_interrupts,
++ .enable_rx_interrupts = scc_enable_rx_interrupts,
++ .get_CD = scc_get_CD,
++ .shutdown_port = scc_shutdown_port,
++ .set_real_termios = scc_set_real_termios,
++ .chars_in_buffer = scc_chars_in_buffer,
++ .close = scc_close,
++ .hungup = scc_hungup,
++};
++
++static struct tty_operations scc_ops = {
++ .open = scc_open,
++ .close = gs_close,
++ .write = gs_write,
++ .put_char = gs_put_char,
++ .flush_chars = gs_flush_chars,
++ .write_room = gs_write_room,
++ .chars_in_buffer = gs_chars_in_buffer,
++ .flush_buffer = gs_flush_buffer,
++ .ioctl = scc_ioctl,
++ .throttle = scc_throttle,
++ .unthrottle = scc_unthrottle,
++ .set_termios = gs_set_termios,
++ .stop = gs_stop,
++ .start = gs_start,
++ .hangup = gs_hangup,
++ .break_ctl = scc_break_ctl,
++};
++
++/* BRG values for the standard speeds and the various clock sources */
++
++typedef struct {
++ unsigned clksrc; /* clock source to use or -1 for not possible */
++ unsigned div; /* divisor: 1, 2 and 4 correspond to
++ * direct 1:16, 1:32 and 1:64 modes,
++ * divisors >= 4 yield a BRG value of
++ * div/2-2 (in 1:16 mode)
++ */
++} BAUD_ENTRY;
++
++/* A pointer for each channel to the current baud table */
++static BAUD_ENTRY *scc_baud_table[2];
++
++/* Baud table format:
++ *
++ * Each entry consists of the clock source (CLK_RTxC, CLK_TRxC or
++ * CLK_PCLK) and a divisor. The following rules apply to the divisor:
++ *
++ * - CLK_RTxC: 1 or even (1, 2 and 4 are the direct modes, > 4 use
++ * the BRG)
++ *
++ * - CLK_TRxC: 1, 2 or 4 (no BRG, only direct modes possible)
++ *
++ * - CLK_PCLK: >= 4 and even (no direct modes, only BRG)
++ *
++ */
++
++/* This table is used if RTxC = 3.672 MHz. This is the case for TT's
++ * channel A and for both channels on the Mega STE/Falcon. (TRxC is unused)
++ */
++
++static BAUD_ENTRY bdtab_norm[20] = {
++ /* B0 */ { 0, 0 },
++ /* B50 */ { CLK_RTxC, 4590 },
++ /* B75 */ { CLK_RTxC, 3060 },
++ /* B110 */ { CLK_PCLK, 4576 },
++ /* B134 */ { CLK_PCLK, 3756 },
++ /* B150 */ { CLK_RTxC, 1530 },
++ /* B200 */ { CLK_PCLK, 2516 },
++ /* B300 */ { CLK_PCLK, 1678 },
++ /* B600 */ { CLK_PCLK, 838 },
++ /* B1200 */ { CLK_PCLK, 420 },
++ /* B1800 */ { CLK_PCLK, 280 },
++ /* B2400 */ { CLK_PCLK, 210 },
++ /* B4800 */ { CLK_RTxC, 48 },
++ /* B9600 */ { CLK_RTxC, 24 },
++ /* B19200 */ { CLK_RTxC, 12 },
++ /* B38400 */ { CLK_RTxC, 6 }, /* #15 spd_extra */
++ /* B57600 */ { CLK_RTxC, 4 }, /* #16 spd_hi */
++ /* B115200 */ { CLK_RTxC, 2 }, /* #17 spd_vhi */
++ /* B230400 */ { CLK_RTxC, 1 }, /* #18 spd_shi */
++ /* B460800 */ { 0, 0 } /* #19 spd_warp: Impossible */
++};
++
++/* This is a special table for the TT channel B with 307.2 kHz at RTxC
++ * and 2.4576 MHz at TRxC
++ */
++static BAUD_ENTRY bdtab_TTChB[20] = {
++ /* B0 */ { 0, 0 },
++ /* B50 */ { CLK_RTxC, 384 },
++ /* B75 */ { CLK_RTxC, 256 },
++ /* B110 */ { CLK_PCLK, 4576 },
++ /* B134 */ { CLK_PCLK, 3756 },
++ /* B150 */ { CLK_RTxC, 128 },
++ /* B200 */ { CLK_RTxC, 96 },
++ /* B300 */ { CLK_RTxC, 64 },
++ /* B600 */ { CLK_RTxC, 32 },
++ /* B1200 */ { CLK_RTxC, 16 },
++ /* B1800 */ { CLK_PCLK, 280 },
++ /* B2400 */ { CLK_RTxC, 8 },
++ /* B4800 */ { CLK_RTxC, 4 },
++ /* B9600 */ { CLK_RTxC, 2 },
++ /* B19200 */ { CLK_RTxC, 1 },
++ /* B38400 */ { CLK_TRxC, 4 },
++ /* B57600 */ { CLK_TRxC, 2 }, /* 57600 is not possible, use 76800 instead */
++ /* B115200 */ { CLK_TRxC, 1 }, /* 115200 is not possible, use 153600 instead */
++ /* B230400 */ { 0, 0 }, /* #18 spd_shi: Impossible */
++ /* B460800 */ { 0, 0 } /* #19 spd_warp: Impossible */
++};
++
++
++/*----------------------------------------------------------------------------
++ * atari_scc_init() and support functions
++ *---------------------------------------------------------------------------*/
++
++static int scc_init_drivers(void)
++{
++ int error;
++
++ scc_driver = alloc_tty_driver(2);
++ if (!scc_driver)
++ return -ENOMEM;
++ scc_driver->owner = THIS_MODULE;
++ scc_driver->driver_name = "scc";
++ scc_driver->name = "ttyS";
++ scc_driver->major = TTY_MAJOR;
++ scc_driver->minor_start = SCC_MINOR_BASE;
++ scc_driver->type = TTY_DRIVER_TYPE_SERIAL;
++ scc_driver->subtype = SERIAL_TYPE_NORMAL;
++ scc_driver->init_termios = tty_std_termios;
++ scc_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
++ scc_driver->flags = TTY_DRIVER_REAL_RAW;
++
++ tty_set_operations(scc_driver, &scc_ops);
++
++ if ((error = tty_register_driver(scc_driver))) {
++ printk(KERN_ERR "scc: Couldn't register scc driver, error = %d\n",
++ error);
++ put_tty_driver(scc_driver);
++ return 1;
++ }
++
++ return 0;
++}
++
++
++/* ports[] array is indexed by line no (i.e. [0] for ttyS0, [1] for ttyS1).
++ */
++
++static void scc_init_portstructs(void)
++{
++ struct scc_port *port;
++ int i;
++
++ for (i = 0; i < 2; i++) {
++ port = scc_ports + i;
++ port->gs.magic = SCC_MAGIC;
++ port->gs.close_delay = HZ/2;
++ port->gs.closing_wait = 30 * HZ;
++ port->gs.rd = &scc_real_driver;
++#ifdef NEW_WRITE_LOCKING
++ port->gs.port_write_sem = MUTEX;
++#endif
++ init_waitqueue_head(&port->gs.open_wait);
++ init_waitqueue_head(&port->gs.close_wait);
++ }
++}
++
++
++#ifdef CONFIG_TT_SCC
++static int atari_tt_scc_init(void)
++{
++ struct scc_port *port;
++
++ printk(KERN_INFO "SCC: Atari TT Serial Driver\n");
++ /* FIXME channel A may be switchable between modem and LAN port */
++ /* Init channel A */
++ if (atari_SCC_init_done)
++ printk(KERN_INFO "SCC: already initialized, expect trouble!\n");
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: init channel A\n");
++#endif
++ port = &scc_ports[0];
++ port->channel = CHANNEL_A;
++ port->ctrlp = (volatile unsigned char *)&scc.cha_a_ctrl;
++ port->datap = port->ctrlp + 1;
++ port->port_a = &scc_ports[0];
++ port->port_b = &scc_ports[1];
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: request channel A irqs, port = %p\n", port);
++#endif
++ request_irq(IRQ_SCCA_TX, scc_tx_int, IRQ_TYPE_PRIO, "SCC-A TX", port);
++ request_irq(IRQ_SCCA_STAT, scc_stat_int, IRQ_TYPE_PRIO,
++ "SCC-A status", port);
++ request_irq(IRQ_SCCA_RX, scc_rx_int, IRQ_TYPE_PRIO, "SCC-A RX", port);
++ request_irq(IRQ_SCCA_SPCOND, scc_spcond_int, IRQ_TYPE_PRIO,
++ "SCC-A special cond", port);
++ {
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: read SCC status\n");
++#endif
++ /* on the first access, read status register to reset internal pointers */
++ SCCread(STATUS_REG);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: reset SCC\n");
++#endif
++ /* FIXME: master reset, once only */
++ SCCwrite(MASTER_INT_CTRL, MIC_HARD_RESET);
++ udelay(40);
++
++ /* disable interrupts for this channel */
++ SCCwrite(INT_AND_DMA_REG, 0);
++ /* Set the interrupt vector ; 0x60 for all Atari models */
++ SCCwrite(INT_VECTOR_REG, 0x60);
++ /* Interrupt parameters: vector includes status, status low */
++ SCCwrite(MASTER_INT_CTRL, MIC_VEC_INCL_STAT);
++ SCCmod(MASTER_INT_CTRL, 0xff, MIC_MASTER_INT_ENAB);
++
++ /* disable interrupts for this channel */
++ SCCwrite(INT_AND_DMA_REG, 0);
++ }
++
++ if (!atari_SCC_init_done) {
++ /* Init channel B */
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: init channel B\n");
++#endif
++ port = &scc_ports[1];
++ port->channel = CHANNEL_B;
++ port->ctrlp = (volatile unsigned char *)&scc.cha_b_ctrl;
++ port->datap = port->ctrlp + 1;
++ port->port_a = &scc_ports[0];
++ port->port_b = &scc_ports[1];
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: request channel B irqs, port = %p\n", port);
++#endif
++ request_irq(IRQ_SCCB_TX, scc_tx_int, IRQ_TYPE_PRIO,
++ "SCC-B TX", port);
++ request_irq(IRQ_SCCB_STAT, scc_stat_int, IRQ_TYPE_PRIO,
++ "SCC-B status", port);
++ request_irq(IRQ_SCCB_RX, scc_rx_int, IRQ_TYPE_PRIO,
++ "SCC-B RX", port);
++ request_irq(IRQ_SCCB_SPCOND, scc_spcond_int, IRQ_TYPE_PRIO,
++ "SCC-B special cond", port);
++ {
++ SCC_ACCESS_INIT(port);
++
++ /* disable interrupts for this channel */
++ SCCwrite(INT_AND_DMA_REG, 0);
++ }
++/* not implemented yet */
++#if 0
++ request_irq(IRQ_TT_MFP_RI, scc_ri_int, IRQ_TYPE_SLOW,
++ "TT-MFP ring indicator (modem 2)", port);
++#endif
++
++ }
++
++ /* once only: initalize MFP timer C for RTxC */
++ tt_mfp.tim_ct_cd = (tt_mfp.tim_ct_cd & ~0x70) | 0x10;
++ tt_mfp.tim_dt_c = 1;
++ atari_turnoff_irq(IRQ_TT_MFP_TIMC);
++
++ /* set baud tables */
++ scc_baud_table[CHANNEL_A] = bdtab_norm;
++ scc_baud_table[CHANNEL_B] = bdtab_TTChB;
++
++ /* Initialise the tty driver structures and register */
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: scc_init_portstructs()\n");
++#endif
++ scc_init_portstructs();
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: scc_init_drivers()\n");
++#endif
++ scc_init_drivers();
++
++ return 0;
++}
++#endif
++
++
++#ifdef CONFIG_FALCON_SCC
++static int atari_falcon_scc_init(void)
++{
++ struct scc_port *port;
++
++ printk(KERN_INFO "SCC: Atari Falcon Serial Driver\n");
++ if (atari_SCC_init_done)
++ printk(KERN_INFO "SCC: already initialized, expect trouble!\n");
++
++ /* Init channel A */
++ port = &scc_ports[0];
++ port->channel = CHANNEL_A;
++ port->ctrlp = (volatile unsigned char *)&scc.cha_a_ctrl;
++ port->datap = port->ctrlp + 2;
++ port->port_a = &scc_ports[0];
++ port->port_b = &scc_ports[1];
++ request_irq(IRQ_SCCA_TX, scc_tx_int, IRQ_TYPE_PRIO, "SCC-A TX", port);
++ request_irq(IRQ_SCCA_STAT, scc_stat_int, IRQ_TYPE_PRIO,
++ "SCC-A status", port);
++ request_irq(IRQ_SCCA_RX, scc_rx_int, IRQ_TYPE_PRIO, "SCC-A RX", port);
++ request_irq(IRQ_SCCA_SPCOND, scc_spcond_int, IRQ_TYPE_PRIO,
++ "SCC-A special cond", port);
++ {
++ SCC_ACCESS_INIT(port);
++
++ /* on the first access, read status register to reset internal pointers */
++ SCCread(STATUS_REG);
++
++ /* FIXME: master reset, once only */
++ SCCwrite(MASTER_INT_CTRL, MIC_HARD_RESET);
++ udelay(40);
++
++ /* disable interrupts for this channel */
++ SCCwrite(INT_AND_DMA_REG, 0);
++ /* Set the interrupt vector */
++ SCCwrite(INT_VECTOR_REG, 0x60);
++ /* Interrupt parameters: vector includes status, status low */
++ SCCwrite(MASTER_INT_CTRL, MIC_VEC_INCL_STAT);
++ SCCmod(MASTER_INT_CTRL, 0xff, MIC_MASTER_INT_ENAB);
++ }
++
++ /* conditionalize if port in use by console ?? */
++ /* Init channel B */
++ port = &scc_ports[1];
++ port->channel = CHANNEL_B;
++ port->ctrlp = (volatile unsigned char *)&scc.cha_b_ctrl;
++ port->datap = port->ctrlp + 2;
++ port->port_a = &scc_ports[0];
++ port->port_b = &scc_ports[1];
++ request_irq(IRQ_SCCB_TX, scc_tx_int, IRQ_TYPE_PRIO, "SCC-B TX", port);
++ request_irq(IRQ_SCCB_STAT, scc_stat_int, IRQ_TYPE_PRIO,
++ "SCC-B status", port);
++ request_irq(IRQ_SCCB_RX, scc_rx_int, IRQ_TYPE_PRIO, "SCC-B RX", port);
++ request_irq(IRQ_SCCB_SPCOND, scc_spcond_int, IRQ_TYPE_PRIO,
++ "SCC-B special cond", port);
++
++ {
++ SCC_ACCESS_INIT(port); /* Either channel will do */
++
++ /* disable interrupts for this channel */
++ SCCwrite(INT_AND_DMA_REG, 0);
++ }
++
++ /* set baud tables */
++ scc_baud_table[CHANNEL_A] = bdtab_norm;
++ scc_baud_table[CHANNEL_B] = bdtab_norm;
++
++ /* Initialise the tty driver structures and register */
++ scc_init_portstructs();
++ scc_init_drivers();
++
++ return 0;
++}
++#endif
++
++
++#ifdef CONFIG_ST_SCC
++static int atari_st_scc_init(void)
++{
++ struct scc_port *port;
++
++ int escc = ATARIHW_PRESENT(ST_ESCC);
++
++ printk(KERN_INFO "SCC: Atari MegaST/E Serial Driver\n");
++ /* FIXME: ports reversed logic */
++ /* Init channel A */
++ port = &scc_ports[1];
++ port->channel = CHANNEL_A;
++ port->ctrlp = (volatile unsigned char *)(escc ? &st_escc.cha_a_ctrl : &scc.cha_a_ctrl);
++ port->datap = port->ctrlp + 4;
++ port->port_a = &scc_ports[1];
++ port->port_b = &scc_ports[0];
++ request_irq(IRQ_SCCA_TX, scc_tx_int, IRQ_TYPE_PRIO, "SCC-A TX", port);
++ request_irq(IRQ_SCCA_STAT, scc_stat_int, IRQ_TYPE_PRIO,
++ "SCC-A status", port);
++ request_irq(IRQ_SCCA_RX, scc_rx_int, IRQ_TYPE_PRIO, "SCC-A RX", port);
++ request_irq(SCCA_SPCOND, scc_spcond_int, IRQ_TYPE_PRIO,
++ "SCC-A special cond", port);
++ {
++ SCC_ACCESS_INIT(port);
++
++ /* on the first access, read status register to reset internal pointers */
++ SCCread(STATUS_REG);
++
++ /* FIXME: master reset, once only */
++ SCCwrite(MASTER_INT_CTRL, MIC_HARD_RESET);
++ udelay(40);
++
++ /* disable interrupts for this channel */
++ SCCwrite(INT_AND_DMA_REG, 0);
++ /* Set the interrupt vector */
++ SCCwrite(INT_VECTOR_REG, BVME_IRQ_SCC_BASE);
++ /* Interrupt parameters: vector includes status, status low */
++ SCCwrite(MASTER_INT_CTRL, MIC_VEC_INCL_STAT);
++ SCCmod(MASTER_INT_CTRL, 0xff, MIC_MASTER_INT_ENAB);
++ }
++
++ /* Init channel B */
++ port = &scc_ports[0];
++ port->channel = CHANNEL_B;
++ port->ctrlp = (volatile unsigned char *)(escc ? &st_escc.cha_b_ctrl : &scc.cha_b_ctrl);
++ port->datap = port->ctrlp + 4;
++ port->port_a = &scc_ports[0];
++ port->port_b = &scc_ports[1];
++ request_irq(IRQ_SCCB_TX, scc_tx_int, IRQ_TYPE_PRIO, "SCC-B TX", port);
++ request_irq(IRQ_SCCB_STAT, scc_stat_int, IRQ_TYPE_PRIO,
++ "SCC-B status", port);
++ request_irq(IRQ_SCCB_RX, scc_rx_int, IRQ_TYPE_PRIO, "SCC-B RX", port);
++ request_irq(IRQ_SCCB_SPCOND, scc_spcond_int, IRQ_TYPE_PRIO,
++ "SCC-B special cond", port);
++
++ {
++ SCC_ACCESS_INIT(port); /* Either channel will do */
++
++ /* disable interrupts for this channel */
++ SCCwrite(INT_AND_DMA_REG, 0);
++ }
++
++ /* set baud tables */
++ scc_baud_table[CHANNEL_A] = bdtab_norm;
++ scc_baud_table[CHANNEL_B] = bdtab_norm;
++
++ /* Initialise the tty driver structures and register */
++ scc_init_portstructs();
++ scc_init_drivers();
++
++ return 0;
++}
++#endif
++
++
++int atari_scc_init(void)
++{
++ int res = -ENODEV;
++ static int called = 0;
++
++ if (called)
++ return res;
++ called = 1;
++
++ if (!(ATARIHW_PRESENT(SCC) || ATARIHW_PRESENT(ST_ESCC)))
++ return -ENODEV;
++
++ scc_del = &mfp.par_dt_reg;
++
++#ifdef CONFIG_TT_SCC
++ if (MACH_IS_TT)
++ res = atari_tt_scc_init();
++#endif
++#ifdef CONFIG_FALCON_SCC
++ if (MACH_IS_FALCON)
++ res = atari_falcon_scc_init();
++#endif
++#ifdef CONFIG_ST_SCC
++ if (MACH_IS_ST)
++ res = atari_st_scc_init();
++#endif
++ return res;
++}
++
++void atari_scc_cleanup(void)
++{
++ struct scc_port *port;
++
++ tty_unregister_driver(scc_driver);
++ port = &scc_ports[0];
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: free channel A irqs, port = %p\n", port);
++#endif
++ free_irq(IRQ_SCCA_TX, port);
++ free_irq(IRQ_SCCA_STAT, port);
++ free_irq(IRQ_SCCA_RX, port);
++ free_irq(IRQ_SCCA_SPCOND, port);
++
++ port = &scc_ports[1];
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: free channel A irqs, port = %p\n", port);
++#endif
++ free_irq(IRQ_SCCB_TX, port);
++ free_irq(IRQ_SCCB_STAT, port);
++ free_irq(IRQ_SCCB_RX, port);
++ free_irq(IRQ_SCCB_SPCOND, port);
++
++}
++
++module_init(atari_scc_init);
++module_exit(atari_scc_cleanup);
++
++/*---------------------------------------------------------------------------
++ * Interrupt handlers
++ *--------------------------------------------------------------------------*/
++
++static irqreturn_t scc_rx_int(int irq, void *data)
++{
++ unsigned char ch;
++ struct scc_port *port = data;
++ struct tty_struct *tty = port->gs.tty;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: rx_int ...\n");
++#endif
++ ch = SCCread_NB(RX_DATA_REG);
++ if (!tty) {
++ printk(KERN_WARNING "scc_rx_int with NULL tty!\n");
++ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
++ return IRQ_HANDLED;
++ }
++ tty_insert_flip_char(tty, ch, 0);
++#if 0
++ if (tty->flip.count < TTY_FLIPBUF_SIZE) {
++ *tty->flip.char_buf_ptr = ch;
++ *tty->flip.flag_buf_ptr = 0;
++ tty->flip.flag_buf_ptr++;
++ tty->flip.char_buf_ptr++;
++ tty->flip.count++;
++ }
++#endif
++ /* Check if another character is already ready; in that case, the
++ * spcond_int() function must be used, because this character may have an
++ * error condition that isn't signalled by the interrupt vector used!
++ */
++ if (SCCread(INT_PENDING_REG) &
++ (port->channel == CHANNEL_A ? IPR_A_RX : IPR_B_RX)) {
++ scc_spcond_int(irq, data);
++ return IRQ_HANDLED;
++ }
++
++ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
++
++ tty_flip_buffer_push(tty);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: rx_int done\n");
++#endif
++ return IRQ_HANDLED;
++}
++
++
++static irqreturn_t scc_spcond_int(int irq, void *data)
++{
++ struct scc_port *port = data;
++ struct tty_struct *tty = port->gs.tty;
++ unsigned char stat, ch, err;
++ int int_pending_mask = port->channel == CHANNEL_A ? IPR_A_RX : IPR_B_RX;
++
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: spcond_int ...\n");
++#endif
++ if (!tty) {
++ printk(KERN_WARNING "scc_spcond_int with NULL tty!\n");
++ SCCwrite(COMMAND_REG, CR_ERROR_RESET);
++ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
++ return IRQ_HANDLED;
++ }
++ do {
++ stat = SCCread(SPCOND_STATUS_REG);
++ ch = SCCread_NB(RX_DATA_REG);
++
++ if (stat & SCSR_RX_OVERRUN)
++ err = TTY_OVERRUN;
++ else if (stat & SCSR_PARITY_ERR)
++ err = TTY_PARITY;
++ else if (stat & SCSR_CRC_FRAME_ERR)
++ err = TTY_FRAME;
++ else
++ err = 0;
++
++ tty_insert_flip_char(tty, ch, err);
++#if 0
++ if (tty->flip.count < TTY_FLIPBUF_SIZE) {
++ *tty->flip.char_buf_ptr = ch;
++ *tty->flip.flag_buf_ptr = err;
++ tty->flip.flag_buf_ptr++;
++ tty->flip.char_buf_ptr++;
++ tty->flip.count++;
++ }
++#endif
++ /* ++TeSche: *All* errors have to be cleared manually,
++ * else the condition persists for the next chars
++ */
++ if (err)
++ SCCwrite(COMMAND_REG, CR_ERROR_RESET);
++
++ } while (SCCread(INT_PENDING_REG) & int_pending_mask);
++
++ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
++
++ tty_flip_buffer_push(tty);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: spcond_int done\n");
++#endif
++ return IRQ_HANDLED;
++}
++
++/* not implemented yet */
++#if 0
++static void scc_ri_int(int irq, void *data)
++{
++ struct scc_port *port = data;
++ /* update input line counter */
++ port->icount.rng++;
++ wake_up_interruptible(&port->delta_msr_wait);
++}
++#endif
++
++static irqreturn_t scc_tx_int(int irq, void *data)
++{
++ struct scc_port *port = data;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: tx_int irq %d port %p ...\n", irq, data);
++#endif
++ if (!port->gs.tty) {
++ printk(KERN_WARNING "scc_tx_int with NULL tty!\n");
++ SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
++ SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET);
++ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
++ return IRQ_HANDLED;
++ }
++ while ((SCCread_NB(STATUS_REG) & SR_TX_BUF_EMPTY)) {
++ if (port->x_char) {
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: tx_int writing char %c\n",
++ port->x_char);
++#endif
++ SCCwrite(TX_DATA_REG, port->x_char);
++ port->x_char = 0;
++ } else if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped ||
++ port->gs.tty->hw_stopped) {
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: nothing to do!\n");
++#endif
++ break;
++ } else {
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: tx_int writing buf %c\n",
++ port->gs.xmit_buf[port->gs.xmit_tail]);
++#endif
++ SCCwrite(TX_DATA_REG, port->gs.xmit_buf[port->gs.xmit_tail++]);
++ port->gs.xmit_tail = port->gs.xmit_tail & (SERIAL_XMIT_SIZE-1);
++ if (--port->gs.xmit_cnt <= 0)
++ break;
++ }
++ }
++ if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped ||
++ port->gs.tty->hw_stopped) {
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: nothing to do, disabling int\n");
++#endif
++ /* disable tx interrupts */
++ SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
++ SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); /* disable tx_int on next tx underrun? */
++ port->gs.flags &= ~GS_TX_INTEN;
++ }
++ if (port->gs.tty && port->gs.xmit_cnt <= port->gs.wakeup_chars) {
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: waking up tty!\n");
++#endif
++ tty_wakeup(port->gs.tty);
++ }
++
++ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: tx_int done\n");
++#endif
++ return IRQ_HANDLED;
++}
++
++
++static irqreturn_t scc_stat_int(int irq, void *data)
++{
++ struct scc_port *port = data;
++ unsigned channel = port->channel;
++ unsigned char last_sr, sr, changed;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: stat_int ...\n");
++#endif
++ last_sr = scc_last_status_reg[channel];
++ sr = scc_last_status_reg[channel] = SCCread_NB(STATUS_REG);
++ changed = last_sr ^ sr;
++
++ if (changed & SR_DCD) {
++ port->c_dcd = !!(sr & SR_DCD);
++ if (!(port->gs.flags & ASYNC_CHECK_CD))
++ ; /* Don't report DCD changes */
++ else if (port->c_dcd) {
++ /* Are we blocking in open? */
++ wake_up_interruptible(&port->gs.open_wait);
++ } else {
++ if (port->gs.tty)
++ tty_hangup(port->gs.tty);
++ }
++ }
++
++ // FIXME: CTS and DSR status changes?
++
++ SCCwrite(COMMAND_REG, CR_EXTSTAT_RESET);
++ SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: stat_int done\n");
++#endif
++ return IRQ_HANDLED;
++}
++
++
++/*---------------------------------------------------------------------------
++ * generic_serial.c callback funtions
++ *--------------------------------------------------------------------------*/
++
++static void scc_disable_tx_interrupts(void *ptr)
++{
++ struct scc_port *port = ptr;
++ unsigned long flags;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: disable_tx_int ...\n");
++#endif
++ local_irq_save(flags);
++ SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
++ port->gs.flags &= ~GS_TX_INTEN;
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: disable_tx_int done!\n");
++#endif
++}
++
++
++static void scc_enable_tx_interrupts(void *ptr)
++{
++ struct scc_port *port = ptr;
++ unsigned long flags;
++
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: enable_tx_int ...\n");
++#endif
++ local_irq_save(flags);
++ SCCmod(INT_AND_DMA_REG, 0xff, IDR_TX_INT_ENAB);
++ /* restart the transmitter */
++ scc_tx_int(0, port);
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: enable_tx_int done!\n");
++#endif
++}
++
++
++static void scc_disable_rx_interrupts(void *ptr)
++{
++ struct scc_port *port = ptr;
++ unsigned long flags;
++
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: disable_rx_int ...\n");
++#endif
++ local_irq_save(flags);
++ SCCmod(INT_AND_DMA_REG,
++ ~(IDR_RX_INT_MASK|IDR_PARERR_AS_SPCOND|IDR_EXTSTAT_INT_ENAB), 0);
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: disable_rx_int done!\n");
++#endif
++}
++
++
++static void scc_enable_rx_interrupts(void *ptr)
++{
++ struct scc_port *port = ptr;
++ unsigned long flags;
++
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: enable_rx_int ...\n");
++#endif
++ local_irq_save(flags);
++ SCCmod(INT_AND_DMA_REG, 0xff,
++ IDR_EXTSTAT_INT_ENAB|IDR_PARERR_AS_SPCOND|IDR_RX_INT_ALL);
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: enable_rx_int done!\n");
++#endif
++}
++
++
++static int scc_get_CD(void *ptr)
++{
++ struct scc_port *port = ptr;
++ unsigned channel = port->channel;
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: get_CD!\n");
++#endif
++ return !!(scc_last_status_reg[channel] & SR_DCD);
++}
++
++
++static void scc_shutdown_port(void *ptr)
++{
++ struct scc_port *port = ptr;
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: shutdown_port ...\n");
++#endif
++ port->gs.flags &= ~GS_ACTIVE;
++ if (port->gs.tty && port->gs.tty->termios->c_cflag & HUPCL)
++ scc_setsignals(port, 0, 0);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: shutdown_port done!\n");
++#endif
++}
++
++
++static int scc_set_real_termios(void *ptr)
++{
++ /* the SCC has char sizes 5,7,6,8 in that order! */
++ static int chsize_map[4] = { 0, 2, 1, 3 };
++ unsigned int cflag, baud, baudbits, baudidx, brgmode;
++ unsigned int clkmode, clksrc, div, chsize, channel, brgval = 0;
++ unsigned long flags;
++ struct scc_port *port = ptr;
++ SCC_ACCESS_INIT(port);
++
++ if (!port->gs.tty || !port->gs.tty->termios)
++ return 0;
++
++ channel = port->channel;
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: termios for channel %p\n", channel);
++#endif
++ cflag = port->gs.tty->termios->c_cflag;
++ baud = port->gs.baud;
++ baudbits = cflag & CBAUD;
++ chsize = (cflag & CSIZE) >> 4;
++
++ if (baud == 0) {
++ /* speed == 0 -> drop DTR */
++ local_irq_save(flags);
++ SCCmod(TX_CTRL_REG, ~TCR_DTR, 0);
++ local_irq_restore(flags);
++ return 0;
++ } else if ((MACH_IS_TT && (baud < 50 || baud > 115200)) ||
++ (MACH_IS_FALCON && (baud < 50 || baud > 230400))) {
++ printk(KERN_NOTICE "SCC: Bad speed requested, %d\n", baud);
++ return 0;
++ }
++
++ if (cflag & CLOCAL)
++ port->gs.flags &= ~ASYNC_CHECK_CD;
++ else
++ port->gs.flags |= ASYNC_CHECK_CD;
++
++ // calculate brgval for Atari; enable direct modes!
++
++ /* convert baud rate from gs.baud to table index, set custom divisor eventually */
++
++ div = 0;
++ clksrc = 0;
++ baudidx = 0;
++
++ switch (baud) {
++ case 50:
++ baudidx = 1;
++ break;
++ case 75:
++ baudidx = 2;
++ break;
++ case 110:
++ baudidx = 3;
++ break;
++ case 134:
++ baudidx = 4;
++ break;
++ case 150:
++ baudidx = 5;
++ break;
++ case 200:
++ baudidx = 6;
++ break;
++ case 300:
++ baudidx = 7;
++ break;
++ case 600:
++ baudidx = 8;
++ break;
++ case 1200:
++ baudidx = 9;
++ break;
++ case 1800:
++ baudidx = 10;
++ break;
++ case 2400:
++ baudidx = 11;
++ break;
++ case 4800:
++ baudidx = 12;
++ break;
++ case 9600:
++ baudidx = 13;
++ break;
++ case 19200:
++ baudidx = 14;
++ break;
++ case 38400:
++ baudidx = 15;
++ break;
++ case 57600:
++ baudidx = 16;
++ break;
++ case 115200:
++ baudidx = 17;
++ break;
++ case 230400:
++ baudidx = 18;
++ break;
++ default:
++ baudidx = 15;
++ break;
++ }
++
++ /* do we have a custom divisor ?? */
++ if (!div) {
++ if (baudidx > 19)
++ baudidx = 19;
++ clksrc = scc_baud_table[channel][baudidx].clksrc;
++ div = scc_baud_table[channel][baudidx].div;
++ if (!div) {
++ printk(" SCC_change_speed: divisor = 0 !!!");
++ return 0;
++ }
++ }
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: termios baud %d baudbits %d baudidx %d \n clksrc %d div %d\n",
++ baud, baudbits, baudidx, clksrc, div);
++#endif
++ /* compute the SCC's clock source, clock mode, BRG mode and BRG
++ * value from clksrc and div
++ */
++ if (div <= 4) {
++ clkmode = (div == 1 ? A1CR_CLKMODE_x16 :
++ div == 2 ? A1CR_CLKMODE_x32 :
++ A1CR_CLKMODE_x64);
++ clksrc = (clksrc == CLK_RTxC
++ ? CCR_TXCLK_RTxC | CCR_RXCLK_RTxC
++ : CCR_TXCLK_TRxC | CCR_RXCLK_TRxC);
++ brgmode = 0; /* off */
++ brgval = 0;
++ } else {
++ brgval = div/2 - 2;
++ brgmode = (DCR_BRG_ENAB |
++ (clksrc == CLK_PCLK ? DCR_BRG_USE_PCLK : 0));
++ clkmode = A1CR_CLKMODE_x16;
++ clksrc = CCR_TXCLK_BRG | CCR_RXCLK_BRG;
++ }
++
++ //printk(KERN_INFO "SCC: termios baud %d baudbits %d baudidx %d \n clksrc %d clkmode %d div %d brgval %d brgmode %d\n",
++ // baud, baudbits, baudidx, clksrc, clkmode, div, brgval, brgmode);
++
++ /* Now we have all parameters and can go to set them: */
++ local_irq_save(flags);
++
++#ifdef DEBUG
++ printk(" brgval=%d brgmode=%02x clkmode=%02x clksrc=%02x\n",
++ brgval, brgmode, clkmode, clksrc);
++#endif
++ /* receiver's character size and auto-enables */
++#if 0 // auto-enable considered harmful ...
++ SCCmod(RX_CTRL_REG, ~(RCR_CHSIZE_MASK|RCR_AUTO_ENAB_MODE),
++ (chsize_map[chsize] << 6) |
++ ((cflag & CRTSCTS) ? RCR_AUTO_ENAB_MODE : 0));
++#else
++ /* receiver's character size */
++ SCCmod(RX_CTRL_REG, ~RCR_CHSIZE_MASK, chsize_map[chsize] << 6);
++#endif
++#ifdef DEBUG
++ printk(" RX_CTRL_REG <- %02x\n", SCCread( RX_CTRL_REG ));
++#endif
++
++ // clock mode changes depending on baud rate
++ /* parity and stop bits (both, Tx and Rx) and clock mode */
++ SCCmod(AUX1_CTRL_REG,
++ ~(A1CR_PARITY_MASK | A1CR_MODE_MASK | A1CR_CLKMODE_MASK),
++ ((cflag & PARENB
++ ? (cflag & PARODD ? A1CR_PARITY_ODD : A1CR_PARITY_EVEN)
++ : A1CR_PARITY_NONE)
++ | (cflag & CSTOPB ? A1CR_MODE_ASYNC_2 : A1CR_MODE_ASYNC_1)
++ | clkmode));
++
++#ifdef DEBUG
++ printk(" AUX1_CTRL_REG <- %02x\n", SCCread(AUX1_CTRL_REG));
++#endif
++ /* sender's character size, set DTR for valid baud rate */
++ SCCmod(TX_CTRL_REG, ~TCR_CHSIZE_MASK, chsize_map[chsize] << 5 | TCR_DTR);
++#ifdef DEBUG
++ printk(" TX_CTRL_REG <- %02x\n", SCCread(TX_CTRL_REG));
++#endif
++
++ // clock sources change for TT !!
++ /* clock sources never change */
++ /* clock sources */
++ SCCmod(CLK_CTRL_REG, ~(CCR_TXCLK_MASK | CCR_RXCLK_MASK), clksrc);
++#ifdef DEBUG
++ printk(" CLK_CTRL_REG <- %02x\n", SCCread(CLK_CTRL_REG));
++#endif
++
++ /* disable BRG before changing the value */
++ SCCmod(DPLL_CTRL_REG, ~DCR_BRG_ENAB, 0);
++ /* BRG value */
++ SCCwrite(TIMER_LOW_REG, brgval & 0xff);
++ SCCwrite(TIMER_HIGH_REG, (brgval >> 8) & 0xff);
++ /* BRG enable, and clock source never changes */
++ //SCCmod(DPLL_CTRL_REG, 0xff, DCR_BRG_ENAB);
++ SCCmod(DPLL_CTRL_REG, ~(DCR_BRG_ENAB | DCR_BRG_USE_PCLK), brgmode);
++#ifdef DEBUG
++ printk(" TIMER_LOW_REG <- %02x\n", SCCread(TIMER_LOW_REG));
++ printk(" TIMER_HIGH_REG <- %02x\n", SCCread(TIMER_HIGH_REG));
++#endif
++#ifdef DEBUG
++ printk(" DPLL_CTRL_REG <- %02x\n", SCCread(DPLL_CTRL_REG));
++#endif
++
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: done termios for channel %d\n", channel);
++#endif
++ return 0;
++}
++
++
++static int scc_chars_in_buffer(void *ptr)
++{
++ struct scc_port *port = ptr;
++#ifdef DEBUG
++ int rv;
++#endif
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ rv = (SCCread(SPCOND_STATUS_REG) & SCSR_ALL_SENT) ? 0 : 1;
++ printk(KERN_INFO "SCC: chars_in_buffer: %d\n", rv);
++ return rv;
++#else
++ return (SCCread(SPCOND_STATUS_REG) & SCSR_ALL_SENT) ? 0 : 1;
++#endif
++}
++
++
++/* Comment taken from sx.c (2.4.0):
++ I haven't the foggiest why the decrement use count has to happen
++ here. The whole linux serial drivers stuff needs to be redesigned.
++ My guess is that this is a hack to minimize the impact of a bug
++ elsewhere. Thinking about it some more. (try it sometime) Try
++ running minicom on a serial port that is driven by a modularized
++ driver. Have the modem hangup. Then remove the driver module. Then
++ exit minicom. I expect an "oops". -- REW */
++
++static void scc_hungup(void *ptr)
++{
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: hungup ...\n");
++#endif
++ scc_disable_tx_interrupts(ptr);
++ scc_disable_rx_interrupts(ptr);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: hungup done\n");
++#endif
++}
++
++
++static void scc_close(void *ptr)
++{
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: close ...\n");
++#endif
++ scc_disable_tx_interrupts(ptr);
++ scc_disable_rx_interrupts(ptr);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: close done\n");
++#endif
++}
++
++
++/*---------------------------------------------------------------------------
++ * Internal support functions
++ *--------------------------------------------------------------------------*/
++
++static void scc_setsignals(struct scc_port *port, int dtr, int rts)
++{
++ unsigned long flags;
++ unsigned char t;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: setsignals dtr %d rts %d...\n", dtr, rts);
++#endif
++ local_irq_save(flags);
++ t = SCCread(TX_CTRL_REG);
++ if (dtr >= 0)
++ t = dtr? (t | TCR_DTR): (t & ~TCR_DTR);
++ if (rts >= 0)
++ t = rts? (t | TCR_RTS): (t & ~TCR_RTS);
++ SCCwrite(TX_CTRL_REG, t);
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: setsignals done\n");
++#endif
++}
++
++
++static void scc_send_xchar(struct tty_struct *tty, char ch)
++{
++ struct scc_port *port = (struct scc_port *)tty->driver_data;
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: send_xchar ...\n");
++#endif
++ port->x_char = ch;
++ if (ch)
++ scc_enable_tx_interrupts(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: send_xchar done\n");
++#endif
++}
++
++
++/*---------------------------------------------------------------------------
++ * Driver entrypoints referenced from above
++ *--------------------------------------------------------------------------*/
++
++static int scc_open(struct tty_struct *tty, struct file *filp)
++{
++ int line = tty->index;
++ int retval;
++ struct scc_port *port = &scc_ports[line];
++ int i, channel = port->channel;
++ unsigned long flags;
++ SCC_ACCESS_INIT(port);
++
++ static const struct {
++ unsigned reg, val;
++ } scc_init_tab[] = {
++ /* no parity, 1 stop bit, async, 1:16 */
++ { AUX1_CTRL_REG, A1CR_PARITY_NONE|A1CR_MODE_ASYNC_1|A1CR_CLKMODE_x64 },
++ /* parity error is special cond, ints disabled, no DMA */
++ { INT_AND_DMA_REG, IDR_PARERR_AS_SPCOND | IDR_RX_INT_DISAB },
++ /* Rx 8 bits/char, no auto enable, Rx off */
++ { RX_CTRL_REG, RCR_CHSIZE_8 },
++ /* DTR off, Tx 8 bits/char, RTS off, Tx off */
++ { TX_CTRL_REG, TCR_CHSIZE_8 },
++ /* special features off */
++ { AUX2_CTRL_REG, 0 },
++ /* RTxC is XTAL, TRxC is input, both clocks = RTxC */
++ { CLK_CTRL_REG, CCR_TRxCOUT_XTAL | CCR_TXCLK_RTxC | CCR_RXCLK_RTxC },
++ { DPLL_CTRL_REG, 0 },
++ /* Start Rx */
++ { RX_CTRL_REG, RCR_RX_ENAB | RCR_CHSIZE_8 },
++ /* Start Tx */
++ { TX_CTRL_REG, TCR_TX_ENAB | TCR_RTS | TCR_DTR | TCR_CHSIZE_8 },
++ /* Ext/Stat ints: CTS, DCD, SYNC (DSR) */
++ { INT_CTRL_REG, ICR_ENAB_DCD_INT | ICR_ENAB_CTS_INT | ICR_ENAB_SYNC_INT },
++ /* Reset Ext/Stat ints */
++ { COMMAND_REG, CR_EXTSTAT_RESET },
++ /* ...again */
++ { COMMAND_REG, CR_EXTSTAT_RESET },
++ /* Rx int always, TX int off, Ext/Stat int on */
++ { INT_AND_DMA_REG, IDR_EXTSTAT_INT_ENAB |
++ IDR_PARERR_AS_SPCOND | IDR_RX_INT_ALL }
++ };
++
++ if (atari_SCC_init_done && line == 1)
++ return -ENODEV;
++
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: open port ...\n");
++#endif
++ if (!(port->gs.flags & ASYNC_INITIALIZED)) {
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: init port ...\n");
++#endif
++ local_irq_save(flags);
++
++ SCCmod(MASTER_INT_CTRL, 0x3f,
++ channel == 0 ? MIC_CH_A_RESET : MIC_CH_B_RESET);
++ udelay(40); /* extra delay after a reset */
++
++ for (i = 0; i < sizeof(scc_init_tab)/sizeof(*scc_init_tab); ++i)
++ SCCwrite(scc_init_tab[i].reg, scc_init_tab[i].val);
++
++
++ /* remember status register for detection of DCD and CTS changes */
++ scc_last_status_reg[channel] = SCCread(STATUS_REG);
++
++ port->c_dcd = 0; /* Prevent initial 1->0 interrupt */
++ scc_setsignals(port, 1, 1);
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: init port done!\n");
++#endif
++ }
++
++ tty->driver_data = port;
++ port->gs.tty = tty;
++ port->gs.count++;
++#ifdef DEBUG
++ printk(KERN_WARNING "SCC: gs init port ...\n");
++#endif
++ retval = gs_init_port(&port->gs);
++ if (retval) {
++ port->gs.count--;
++ return retval;
++ }
++#ifdef DEBUG
++ printk(KERN_WARNING "SCC: gs init port done!\n");
++#endif
++ port->gs.flags |= GS_ACTIVE;
++
++#ifdef DEBUG
++ printk(KERN_WARNING "SCC: gs wait ready ...\n");
++#endif
++ retval = gs_block_til_ready(port, filp);
++#ifdef DEBUG
++ printk(KERN_WARNING "SCC: gs wait ready done!\n");
++#endif
++ if (retval) {
++ port->gs.count--;
++ return retval;
++ }
++
++ port->c_dcd = scc_get_CD(port);
++
++#ifdef DEBUG
++ printk(KERN_WARNING "SCC: enable rx ints ...\n");
++#endif
++ scc_enable_rx_interrupts(port);
++#ifdef DEBUG
++ printk(KERN_WARNING "SCC: enable rx ints done!\n");
++
++ printk(KERN_INFO "SCC: open port done!\n");
++#endif
++ return 0;
++}
++
++
++static void scc_throttle(struct tty_struct *tty)
++{
++ struct scc_port *port = (struct scc_port *)tty->driver_data;
++ unsigned long flags;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: throttle ...\n");
++#endif
++ if (tty->termios->c_cflag & CRTSCTS) {
++ local_irq_save(flags);
++ SCCmod(TX_CTRL_REG, ~TCR_RTS, 0);
++ local_irq_restore(flags);
++ }
++ if (I_IXOFF(tty))
++ scc_send_xchar(tty, STOP_CHAR(tty));
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: throttle done!\n");
++#endif
++}
++
++
++static void scc_unthrottle(struct tty_struct *tty)
++{
++ struct scc_port *port = (struct scc_port *)tty->driver_data;
++ unsigned long flags;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: unthrottle ...\n");
++#endif
++ if (tty->termios->c_cflag & CRTSCTS) {
++ local_irq_save(flags);
++ SCCmod(TX_CTRL_REG, 0xff, TCR_RTS);
++ local_irq_restore(flags);
++ }
++ if (I_IXOFF(tty))
++ scc_send_xchar(tty, START_CHAR(tty));
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: unthrottle done!\n");
++#endif
++}
++
++
++static int scc_ioctl(struct tty_struct *tty, struct file *file,
++ unsigned int cmd, unsigned long arg)
++{
++ struct scc_port *port = (struct scc_port *)tty->driver_data;
++ int retval;
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl! cmd %d, arg %p \n", cmd, arg);
++#endif
++ //if (serial_paranoia_check(info, tty->device, "zs_ioctl"))
++ // return -ENODEV;
++
++ if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
++ (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
++ (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
++ if (tty->flags & (1 << TTY_IO_ERROR))
++ return -EIO;
++ }
++
++ switch (cmd) {
++ case TCSBRK: /* SVID version: non-zero arg --> no break */
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TCSBRK\n");
++#endif
++ retval = tty_check_change(tty);
++ if (retval)
++ return retval;
++ tty_wait_until_sent(tty, 0);
++ //if (!arg)
++ // send_break(info, HZ/4); /* 1/4 second */
++ return 0;
++ case TCSBRKP: /* support for POSIX tcsendbreak() */
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TCSBRKP\n");
++#endif
++ retval = tty_check_change(tty);
++ if (retval)
++ return retval;
++ tty_wait_until_sent(tty, 0);
++ //send_break(info, arg ? arg*(HZ/10) : HZ/4);
++ return 0;
++ case TIOCGSOFTCAR:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCGSOFTCAR\n");
++#endif
++ if (put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg))
++ return -EFAULT;
++ return 0;
++ case TIOCSSOFTCAR:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCSSOFTCAR\n");
++#endif
++ if (get_user(arg, (unsigned long *)arg))
++ return -EFAULT;
++ tty->termios->c_cflag =
++ ((tty->termios->c_cflag & ~CLOCAL) |
++ (arg ? CLOCAL : 0));
++ return 0;
++ case TIOCMGET:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCMGET\n");
++#endif
++ //return get_modem_info(info, (unsigned int *)arg);
++ return 0;
++ case TIOCMBIS:
++ case TIOCMBIC:
++ case TIOCMSET:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCMSET\n");
++#endif
++ //return set_modem_info(info, cmd, (unsigned int *)arg);
++ return 0;
++ case TIOCGSERIAL:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCGSERIAL\n");
++#endif
++ return 0;
++ //return get_serial_info(info,
++ // (struct serial_struct *)arg);
++ case TIOCSSERIAL:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCSSERIAL\n");
++#endif
++ return 0;
++ //return set_serial_info(info,
++ // (struct serial_struct *)arg);
++ case TIOCSERGETLSR: /* Get line status register */
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCSERGETLSR\n");
++#endif
++ return 0;
++ //return get_lsr_info(info, (unsigned int *)arg);
++
++ case TIOCSERGSTRUCT:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl TIOCSERGSTRUCT\n");
++#endif
++ return 0;
++ if (copy_to_user((struct scc_port *)arg,
++ port, sizeof(struct scc_port)))
++ return -EFAULT;
++ return 0;
++
++ default:
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: ioctl default\n");
++#endif
++ return -ENOIOCTLCMD;
++ }
++ return 0;
++}
++
++
++static void scc_break_ctl(struct tty_struct *tty, int break_state)
++{
++ struct scc_port *port = (struct scc_port *)tty->driver_data;
++ unsigned long flags;
++ SCC_ACCESS_INIT(port);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: break ctl ...\n");
++#endif
++ local_irq_save(flags);
++ SCCmod(TX_CTRL_REG, ~TCR_SEND_BREAK, break_state ? TCR_SEND_BREAK : 0);
++ local_irq_restore(flags);
++#ifdef DEBUG
++ printk(KERN_INFO "SCC: break ctl done!\n");
++#endif
++}
++
++
++/*---------------------------------------------------------------------------
++ * Serial console stuff...
++ *--------------------------------------------------------------------------*/
++#if 1
++#define scc_delay() \
++ asm volatile ("tstb %0" : : "m" (*scc_del) : "cc")
++
++#define SCC_WRITE(reg,val) \
++ do { \
++ scc.cha_b_ctrl = (reg); \
++ scc_delay(); \
++ scc.cha_b_ctrl = (val); \
++ scc_delay(); \
++ } while (0)
++
++/* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a
++ * delay of ~ 60us. */
++#define LONG_DELAY() \
++ do { \
++ int i; \
++ for (i = 100; i > 0; --i) \
++ scc_delay(); \
++ } while (0)
++
++static void atari_init_scc_port(int cflag)
++{
++ extern int atari_SCC_reset_done;
++ static int clksrc_table[9] =
++ /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */
++ { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 };
++ static int brgsrc_table[9] =
++ /* reg 14: 0 = RTxC, 2 = PCLK */
++ { 2, 2, 2, 2, 2, 2, 0, 2, 2 };
++ static int clkmode_table[9] =
++ /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */
++ { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 };
++ static int div_table[9] =
++ /* reg12 (BRG low) */
++ { 208, 138, 103, 50, 24, 11, 1, 0, 0 };
++
++ int baud = cflag & CBAUD;
++ int clksrc, clkmode, div, reg3, reg5;
++
++ scc_del = &mfp.par_dt_reg;
++
++ if (cflag & CBAUDEX)
++ baud += B38400;
++ if (baud < B1200 || baud > B38400+2)
++ baud = B9600; /* use default 9600bps for non-implemented rates */
++ baud -= B1200; /* tables starts at 1200bps */
++
++ clksrc = clksrc_table[baud];
++ clkmode = clkmode_table[baud];
++ div = div_table[baud];
++ if (ATARIHW_PRESENT(TT_MFP) && baud >= 6) {
++ /* special treatment for TT, where rates >= 38400 are done via TRxC */
++ clksrc = 0x28; /* TRxC */
++ clkmode = baud == 6 ? 0xc0 :
++ baud == 7 ? 0x80 : /* really 76800bps */
++ 0x40; /* really 153600bps */
++ div = 0;
++ }
++
++ reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40;
++ reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */;
++
++ (void)scc.cha_b_ctrl; /* reset reg pointer */
++ SCC_WRITE(9, 0xc0); /* reset */
++ LONG_DELAY(); /* extra delay after WR9 access */
++ SCC_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 |
++ 0x04 /* 1 stopbit */ |
++ clkmode);
++ SCC_WRITE(3, reg3);
++ SCC_WRITE(5, reg5);
++ SCC_WRITE(9, 0); /* no interrupts */
++ LONG_DELAY(); /* extra delay after WR9 access */
++ SCC_WRITE(10, 0); /* NRZ mode */
++ SCC_WRITE(11, clksrc); /* main clock source */
++ SCC_WRITE(12, div); /* BRG value */
++ SCC_WRITE(13, 0); /* BRG high byte */
++ SCC_WRITE(14, brgsrc_table[baud]);
++ SCC_WRITE(14, brgsrc_table[baud] | (div ? 1 : 0));
++ SCC_WRITE(3, reg3 | 1);
++ SCC_WRITE(5, reg5 | 8);
++
++ atari_SCC_reset_done = 1;
++ atari_SCC_init_done = 1;
++}
++
++static void scc_ch_write(char ch)
++{
++ volatile char *p = NULL;
++
++ if (MACH_IS_TT || MACH_IS_FALCON)
++ p = (volatile char *)&scc.cha_b_ctrl;
++
++ if (MACH_IS_ST)
++ p = (volatile char *)&scc.cha_b_ctrl;
++
++ if (MACH_IS_STE)
++ p = (volatile char *)&st_escc.cha_b_ctrl;
++
++ do {
++ scc_delay();
++ }
++ while (!(*p & 4));
++ // scc_delay();
++ // *p = 8;
++ scc_delay();
++ *(p+1) = ch;
++}
++
++/* The console must be locked when we get here. */
++
++static void scc_console_write(struct console *co, const char *str, unsigned count)
++{
++ unsigned long flags;
++
++ //printk("scc_console_write: %s\n", str);
++ local_irq_save(flags);
++
++ while (count--) {
++ if (*str == '\n')
++ scc_ch_write('\r');
++ scc_ch_write(*str++);
++ }
++ local_irq_restore(flags);
++ //printk("scc_console_write done!\n");
++}
++
++static struct tty_driver *scc_console_device(struct console *c, int *index)
++{
++ *index = c->index;
++ return scc_driver;
++}
++
++
++static int __init scc_console_setup(struct console *co, char *options)
++{
++ printk("scc_console_setup: initializing SCC port B\n");
++ atari_init_scc_port(B9600|CS8);
++ printk("scc_console_setup: done!\n");
++ return 0;
++}
++
++
++static struct console sercons = {
++ .name = "ttyS",
++ .write = scc_console_write,
++ .device = scc_console_device,
++ .setup = scc_console_setup,
++ .flags = CON_PRINTBUFFER,
++ .index = -1,
++};
++
++
++static int __init vme_scc_console_init(void)
++{
++ if (MACH_IS_TT || MACH_IS_ST || MACH_IS_FALCON)
++ register_console(&sercons);
++ return 0;
++}
++
++console_initcall(vme_scc_console_init);
++#endif
++
++/***************************** End of Functions *********************/
++
++MODULE_AUTHOR("Michael Schmitz");
++MODULE_DESCRIPTION("Atari Amd8350 SCC serial driver");
++MODULE_LICENSE("GPL");
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-export-amiga_vblank.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-export-amiga_vblank.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,35 @@
+Subject: [PATCH] export amiga_vblank
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch fixes the following build error:
+
+<-- snip -->
+
+...
+ Building modules, stage 2.
+ MODPOST 1203 modules
+ERROR: "amiga_vblank" [drivers/video/amifb.ko] undefined!
+...
+make[2]: *** [__modpost] Error 1
+
+<-- snip -->
+
+Reported-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/amiga/config.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/m68k/amiga/config.c
++++ b/arch/m68k/amiga/config.c
+@@ -51,6 +51,8 @@ unsigned long amiga_chipset;
+ EXPORT_SYMBOL(amiga_chipset);
+
+ unsigned char amiga_vblank;
++EXPORT_SYMBOL(amiga_vblank);
++
+ unsigned char amiga_psfreq;
+
+ struct amiga_hw_present amiga_hw_present;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-export-c2p.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-export-c2p.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,33 @@
+Subject: [PATCH] export c2p
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch fixes the following build error:
+
+<-- snip -->
+
+...
+ Building modules, stage 2.
+ MODPOST 1203 modules
+ERROR: "c2p" [drivers/video/amifb.ko] undefined!
+...
+make[2]: *** [__modpost] Error 1
+
+<-- snip -->
+
+Reported-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/video/c2p.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/video/c2p.c
++++ b/drivers/video/c2p.c
+@@ -227,5 +227,6 @@ void c2p(u8 *dst, const u8 *src, u32 dx,
+ dst += dst_nextline;
+ }
+ }
++EXPORT_SYMBOL_GPL(c2p);
+
+ MODULE_LICENSE("GPL");
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-initcalls-should-return-ENODEV-if-device-not-found2.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-initcalls-should-return-ENODEV-if-device-not-found2.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,64 @@
+Subject: [PATCH] m68k: Return -ENODEV if no device is found
+
+From: Geert Uytterhoeven <geert at linux-m68k.org>
+
+According to the tests in do_initcalls(), the proper error code in case no
+device is found is -ENODEV, not -ENXIO or -EIO.
+
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/block/ataflop.c | 4 ++--
+ drivers/char/nvram.c | 2 +-
+ drivers/input/keyboard/atakbd.c | 2 +-
+ drivers/video/atafb.c | 2 +-
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/block/ataflop.c
++++ b/drivers/block/ataflop.c
+@@ -1880,11 +1880,11 @@ static int __init atari_floppy_init (voi
+
+ if (!MACH_IS_ATARI)
+ /* Amiga, Mac, ... don't have Atari-compatible floppy :-) */
+- return -ENXIO;
++ return -ENODEV;
+
+ if (MACH_IS_HADES)
+ /* Hades doesn't have Atari-compatible floppy */
+- return -ENXIO;
++ return -ENODEV;
+
+ if (register_blkdev(FLOPPY_MAJOR,"fd"))
+ return -EBUSY;
+--- a/drivers/char/nvram.c
++++ b/drivers/char/nvram.c
+@@ -440,7 +440,7 @@ nvram_init(void)
+
+ /* First test whether the driver should init at all */
+ if (!CHECK_DRIVER_INIT())
+- return -ENXIO;
++ return -ENODEV;
+
+ ret = misc_register(&nvram_dev);
+ if (ret) {
+--- a/drivers/input/keyboard/atakbd.c
++++ b/drivers/input/keyboard/atakbd.c
+@@ -220,7 +220,7 @@ static int __init atakbd_init(void)
+ int i, error;
+
+ if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP))
+- return -EIO;
++ return -ENODEV;
+
+ // need to init core driver if not already done so
+ if (atari_keyb_init())
+--- a/drivers/video/atafb.c
++++ b/drivers/video/atafb.c
+@@ -3110,7 +3110,7 @@ int __init atafb_init(void)
+ printk("atafb_init: start\n");
+
+ if (!MACH_IS_ATARI)
+- return -ENXIO;
++ return -ENODEV;
+
+ do {
+ #ifdef ATAFB_EXT
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-initrd-fix.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-initrd-fix.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,52 @@
+Subject: [PATCH] initrd: Fix virtual/physical mix-up in overwrite test
+
+From: Geert Uytterhoeven <geert at 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 safely be
+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 at 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
+@@ -629,9 +629,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
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-mac-possible-cleanups.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-mac-possible-cleanups.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,489 @@
+Subject: [PATCH] m68k/mac/: possible cleanups
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch contains the following possible cleanups:
+- make the following needlessly global code (always) static:
+ - baboon.c: struct baboon
+ - baboon.c: baboon_irq()
+ - config.c: mac_orig_videoaddr
+ - config.c: mac_identify()
+ - config.c: mac_report_hardware()
+ - config.c: mac_debug_console_write()
+ - config.c: mac_sccb_console_write()
+ - config.c: mac_scca_console_write()
+ - config.c: mac_init_scc_port()
+ - oss.c: oss_irq()
+ - oss.c: oss_nubus_irq()
+ - psc.c: psc_debug_dump()
+ - psc.c: psc_dma_die_die_die()
+ - via.c: rbv_clear
+- remove the unused bootparse.c
+- #if 0 the following unused functions:
+ - config.c: mac_debugging_short()
+ - config.c: mac_debugging_long()
+- remove the following unused code:
+ - config.c: mac_bisize
+ - config.c: mac_env
+ - config.c: mac_SCC_init_done
+ - config.c: mac_SCC_reset_done
+ - config.c: mac_init_scca_port()
+ - config.c: mac_init_sccb_port()
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/mac/Makefile | 2
+ arch/m68k/mac/baboon.c | 26 ++++----
+ arch/m68k/mac/bootparse.c | 122 ------------------------------------------
+ arch/m68k/mac/config.c | 11 +--
+ arch/m68k/mac/debug.c | 41 +++-----------
+ arch/m68k/mac/oss.c | 8 +-
+ arch/m68k/mac/psc.c | 4 -
+ arch/m68k/mac/via.c | 2
+ include/asm-m68k/mac_baboon.h | 2
+ include/asm-m68k/mac_via.h | 1
+ include/asm-m68k/macintosh.h | 5 -
+ 11 files changed, 35 insertions(+), 189 deletions(-)
+
+--- a/arch/m68k/mac/Makefile
++++ b/arch/m68k/mac/Makefile
+@@ -2,5 +2,5 @@
+ # Makefile for Linux arch/m68k/mac source directory
+ #
+
+-obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \
++obj-y := config.o macints.o iop.o via.o oss.o psc.o \
+ baboon.o macboing.o debug.o misc.o
+--- a/arch/m68k/mac/baboon.c
++++ b/arch/m68k/mac/baboon.c
+@@ -23,9 +23,7 @@
+ /* #define DEBUG_IRQS */
+
+ int baboon_present;
+-volatile struct baboon *baboon;
+-
+-irqreturn_t baboon_irq(int, void *);
++static volatile struct baboon *baboon;
+
+ #if 0
+ extern int macide_ack_intr(struct ata_channel *);
+@@ -50,20 +48,10 @@ void __init baboon_init(void)
+ }
+
+ /*
+- * Register the Baboon interrupt dispatcher on nubus slot $C.
+- */
+-
+-void __init baboon_register_interrupts(void)
+-{
+- request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
+- "baboon", (void *) baboon);
+-}
+-
+-/*
+ * Baboon interrupt handler. This works a lot like a VIA.
+ */
+
+-irqreturn_t baboon_irq(int irq, void *dev_id)
++static irqreturn_t baboon_irq(int irq, void *dev_id)
+ {
+ int irq_bit, irq_num;
+ unsigned char events;
+@@ -95,6 +83,16 @@ irqreturn_t baboon_irq(int irq, void *de
+ return IRQ_HANDLED;
+ }
+
++/*
++ * Register the Baboon interrupt dispatcher on nubus slot $C.
++ */
++
++void __init baboon_register_interrupts(void)
++{
++ request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
++ "baboon", (void *) baboon);
++}
++
+ void baboon_irq_enable(int irq) {
+ #ifdef DEBUG_IRQUSE
+ printk("baboon_irq_enable(%d)\n", irq);
+--- a/arch/m68k/mac/bootparse.c
++++ /dev/null
+@@ -1,122 +0,0 @@
+-#include <linux/string.h>
+-#include <linux/kernel.h>
+-#include <linux/sched.h>
+-#include <asm/irq.h>
+-#include <asm/setup.h>
+-#include <asm/bootinfo.h>
+-#include <asm/macintosh.h>
+-
+-/*
+- * Booter vars
+- */
+-
+-int boothowto;
+-int _boothowto;
+-
+-/*
+- * Called early to parse the environment (passed to us from the booter)
+- * into a bootinfo struct. Will die as soon as we have our own booter
+- */
+-
+-#define atol(x) simple_strtoul(x,NULL,0)
+-
+-void parse_booter(char *env)
+-{
+- char *name;
+- char *value;
+-#if 0
+- while(0 && *env)
+-#else
+- while(*env)
+-#endif
+- {
+- name=env;
+- value=name;
+- while(*value!='='&&*value)
+- value++;
+- if(*value=='=')
+- *value++=0;
+- env=value;
+- while(*env)
+- env++;
+- env++;
+-#if 0
+- if(strcmp(name,"VIDEO_ADDR")==0)
+- mac_mch.videoaddr=atol(value);
+- if(strcmp(name,"ROW_BYTES")==0)
+- mac_mch.videorow=atol(value);
+- if(strcmp(name,"SCREEN_DEPTH")==0)
+- mac_mch.videodepth=atol(value);
+- if(strcmp(name,"DIMENSIONS")==0)
+- mac_mch.dimensions=atol(value);
+-#endif
+- if(strcmp(name,"BOOTTIME")==0)
+- mac_bi_data.boottime=atol(value);
+- if(strcmp(name,"GMTBIAS")==0)
+- mac_bi_data.gmtbias=atol(value);
+- if(strcmp(name,"BOOTERVER")==0)
+- mac_bi_data.bootver=atol(value);
+- if(strcmp(name,"MACOS_VIDEO")==0)
+- mac_bi_data.videological=atol(value);
+- if(strcmp(name,"MACOS_SCC")==0)
+- mac_bi_data.sccbase=atol(value);
+- if(strcmp(name,"MACHINEID")==0)
+- mac_bi_data.id=atol(value);
+- if(strcmp(name,"MEMSIZE")==0)
+- mac_bi_data.memsize=atol(value);
+- if(strcmp(name,"SERIAL_MODEM_FLAGS")==0)
+- mac_bi_data.serialmf=atol(value);
+- if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0)
+- mac_bi_data.serialhsk=atol(value);
+- if(strcmp(name,"SERIAL_MODEM_GPICLK")==0)
+- mac_bi_data.serialgpi=atol(value);
+- if(strcmp(name,"SERIAL_PRINT_FLAGS")==0)
+- mac_bi_data.printmf=atol(value);
+- if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0)
+- mac_bi_data.printhsk=atol(value);
+- if(strcmp(name,"SERIAL_PRINT_GPICLK")==0)
+- mac_bi_data.printgpi=atol(value);
+- if(strcmp(name,"PROCESSOR")==0)
+- mac_bi_data.cpuid=atol(value);
+- if(strcmp(name,"ROMBASE")==0)
+- mac_bi_data.rombase=atol(value);
+- if(strcmp(name,"TIMEDBRA")==0)
+- mac_bi_data.timedbra=atol(value);
+- if(strcmp(name,"ADBDELAY")==0)
+- mac_bi_data.adbdelay=atol(value);
+- }
+-#if 0 /* XXX: TODO with m68k_mach_* */
+- /* Fill in the base stuff */
+- boot_info.machtype=MACH_MAC;
+- /* Read this from the macinfo we got ! */
+-/* boot_info.cputype=CPU_68020|FPUB_68881;*/
+-/* boot_info.memory[0].addr=0;*/
+-/* boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/
+- boot_info.num_memory=1; /* On a MacII */
+- boot_info.ramdisk_size=0; /* For now */
+- *boot_info.command_line=0;
+-#endif
+- }
+-
+-
+-void print_booter(char *env)
+-{
+- char *name;
+- char *value;
+- while(*env)
+- {
+- name=env;
+- value=name;
+- while(*value!='='&&*value)
+- value++;
+- if(*value=='=')
+- *value++=0;
+- env=value;
+- while(*env)
+- env++;
+- env++;
+- printk("%s=%s\n", name,value);
+- }
+- }
+-
+-
+--- a/arch/m68k/mac/config.c
++++ b/arch/m68k/mac/config.c
+@@ -46,7 +46,6 @@
+ /* Mac bootinfo struct */
+
+ struct mac_booter_data mac_bi_data;
+-int mac_bisize = sizeof mac_bi_data;
+
+ /* New m68k bootinfo stuff and videobase */
+
+@@ -55,10 +54,8 @@ extern struct mem_info m68k_memory[NUM_M
+
+ extern struct mem_info m68k_ramdisk;
+
+-void *mac_env; /* Loaded by the boot asm */
+-
+ /* The phys. video addr. - might be bogus on some machines */
+-unsigned long mac_orig_videoaddr;
++static unsigned long mac_orig_videoaddr;
+
+ /* Mac specific timer functions */
+ extern unsigned long mac_gettimeoffset(void);
+@@ -79,6 +76,8 @@ extern void mac_mksound(unsigned int, un
+ extern void nubus_sweep_video(void);
+
+ static void mac_get_model(char *str);
++static void mac_identify(void);
++static void mac_report_hardware(void);
+
+ static void __init mac_sched_init(irq_handler_t vector)
+ {
+@@ -765,7 +764,7 @@ static struct mac_model mac_data_table[]
+ }
+ };
+
+-void __init mac_identify(void)
++static void __init mac_identify(void)
+ {
+ struct mac_model *m;
+
+@@ -821,7 +820,7 @@ void __init mac_identify(void)
+ baboon_init();
+ }
+
+-void __init mac_report_hardware(void)
++static void __init mac_report_hardware(void)
+ {
+ printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
+ }
+--- a/arch/m68k/mac/debug.c
++++ b/arch/m68k/mac/debug.c
+@@ -51,6 +51,8 @@ extern void mac_serial_print(const char
+ static int peng, line;
+ #endif
+
++#if 0
++
+ void mac_debugging_short(int pos, short num)
+ {
+ #ifdef DEBUG_SCREEN
+@@ -125,6 +127,8 @@ void mac_debugging_long(int pos, long ad
+ #endif
+ }
+
++#endif /* 0 */
++
+ #ifdef DEBUG_SERIAL
+ /*
+ * TODO: serial debug code
+@@ -142,12 +146,6 @@ struct mac_SCC {
+
+ # define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase))
+
+-/* Flag that serial port is already initialized and used */
+-int mac_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 mac_SCC_reset_done;
+-
+ static int scc_port = -1;
+
+ static struct console mac_console_driver = {
+@@ -171,8 +169,8 @@ static struct console mac_console_driver
+ * this driver if Mac.
+ */
+
+-void mac_debug_console_write(struct console *co, const char *str,
+- unsigned int count)
++static void mac_debug_console_write(struct console *co, const char *str,
++ unsigned int count)
+ {
+ mac_serial_print(str);
+ }
+@@ -209,8 +207,8 @@ static inline void mac_scca_out(char c)
+ scc.cha_a_data = c;
+ }
+
+-void mac_sccb_console_write(struct console *co, const char *str,
+- unsigned int count)
++static void mac_sccb_console_write(struct console *co, const char *str,
++ unsigned int count)
+ {
+ while (count--) {
+ if (*str == '\n')
+@@ -219,8 +217,8 @@ void mac_sccb_console_write(struct conso
+ }
+ }
+
+-void mac_scca_console_write(struct console *co, const char *str,
+- unsigned int count)
++static void mac_scca_console_write(struct console *co, const char *str,
++ unsigned int count)
+ {
+ while (count--) {
+ if (*str == '\n')
+@@ -265,14 +263,8 @@ void mac_scca_console_write(struct conso
+ barrier(); \
+ } while(0)
+
+-#ifndef CONFIG_SERIAL_CONSOLE
+ static void __init mac_init_scc_port(int cflag, int port)
+-#else
+-void mac_init_scc_port(int cflag, int port)
+-#endif
+ {
+- extern int mac_SCC_reset_done;
+-
+ /*
+ * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k
+ */
+@@ -340,22 +332,9 @@ void mac_init_scc_port(int cflag, int po
+ SCCA_WRITE(3, reg3 | 1);
+ SCCA_WRITE(5, reg5 | 8);
+ }
+-
+- mac_SCC_reset_done = 1;
+- mac_SCC_init_done = 1;
+ }
+ #endif /* DEBUG_SERIAL */
+
+-void mac_init_scca_port(int cflag)
+-{
+- mac_init_scc_port(cflag, 0);
+-}
+-
+-void mac_init_sccb_port(int cflag)
+-{
+- mac_init_scc_port(cflag, 1);
+-}
+-
+ static int __init mac_debug_setup(char *arg)
+ {
+ if (!MACH_IS_MAC)
+--- a/arch/m68k/mac/oss.c
++++ b/arch/m68k/mac/oss.c
+@@ -30,8 +30,8 @@
+ int oss_present;
+ volatile struct mac_oss *oss;
+
+-irqreturn_t oss_irq(int, void *);
+-irqreturn_t oss_nubus_irq(int, void *);
++static irqreturn_t oss_irq(int, void *);
++static irqreturn_t oss_nubus_irq(int, void *);
+
+ extern irqreturn_t via1_irq(int, void *);
+ extern irqreturn_t mac_scc_dispatch(int, void *);
+@@ -92,7 +92,7 @@ void __init oss_nubus_init(void)
+ * and SCSI; everything else is routed to its own autovector IRQ.
+ */
+
+-irqreturn_t oss_irq(int irq, void *dev_id)
++static irqreturn_t oss_irq(int irq, void *dev_id)
+ {
+ int events;
+
+@@ -126,7 +126,7 @@ irqreturn_t oss_irq(int irq, void *dev_i
+ * Unlike the VIA/RBV this is on its own autovector interrupt level.
+ */
+
+-irqreturn_t oss_nubus_irq(int irq, void *dev_id)
++static irqreturn_t oss_nubus_irq(int irq, void *dev_id)
+ {
+ int events, irq_bit, i;
+
+--- a/arch/m68k/mac/psc.c
++++ b/arch/m68k/mac/psc.c
+@@ -36,7 +36,7 @@ irqreturn_t psc_irq(int, void *);
+ * Debugging dump, used in various places to see what's going on.
+ */
+
+-void psc_debug_dump(void)
++static void psc_debug_dump(void)
+ {
+ int i;
+
+@@ -55,7 +55,7 @@ void psc_debug_dump(void)
+ * expanded to cover what I think are the other 7 channels.
+ */
+
+-void psc_dma_die_die_die(void)
++static void psc_dma_die_die_die(void)
+ {
+ int i;
+
+--- a/arch/m68k/mac/via.c
++++ b/arch/m68k/mac/via.c
+@@ -45,7 +45,7 @@ volatile long *via_memory_bogon=(long *)
+ int rbv_present;
+ int via_alt_mapping;
+ EXPORT_SYMBOL(via_alt_mapping);
+-__u8 rbv_clear;
++static __u8 rbv_clear;
+
+ /*
+ * Globals for accessing the VIA chip registers without having to
+--- a/include/asm-m68k/mac_baboon.h
++++ b/include/asm-m68k/mac_baboon.h
+@@ -29,6 +29,4 @@ struct baboon {
+ */
+ };
+
+-extern volatile struct baboon *baboon;
+-
+ #endif /* __ASSEMBLY **/
+--- a/include/asm-m68k/mac_via.h
++++ b/include/asm-m68k/mac_via.h
+@@ -253,7 +253,6 @@
+
+ extern volatile __u8 *via1,*via2;
+ extern int rbv_present,via_alt_mapping;
+-extern __u8 rbv_clear;
+
+ static inline int rbv_set_video_bpp(int bpp)
+ {
+--- a/include/asm-m68k/macintosh.h
++++ b/include/asm-m68k/macintosh.h
+@@ -12,8 +12,6 @@ extern void mac_reset(void);
+ extern void mac_poweroff(void);
+ extern void mac_init_IRQ(void);
+ extern int mac_irq_pending(unsigned int);
+-extern void mac_identify(void);
+-extern void mac_report_hardware(void);
+
+ /*
+ * Floppy driver magic hook - probably shouldnt be here
+@@ -21,9 +19,6 @@ extern void mac_report_hardware(void);
+
+ extern void via1_set_head(int);
+
+-extern void parse_booter(char *ptr);
+-extern void print_booter(char *ptr);
+-
+ /*
+ * Macintosh Table
+ */
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-mac-remove-the-unused-ADB_KEYBOARD-option.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-mac-remove-the-unused-ADB_KEYBOARD-option.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,34 @@
+Subject: [PATCH] m68k/Mac: remove the unused ADB_KEYBOARD option
+
+From: Adrian Bunk <bunk at kernel.org>
+
+When the driver was removed back in 2002 the option was forgotten.
+
+Reported-by: Robert P. J. Day <rpjday at crashcourse.ca>
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/Kconfig | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -578,18 +578,6 @@ config MAC_HID
+ depends on INPUT_ADBHID
+ default y
+
+-config ADB_KEYBOARD
+- bool "Support for ADB keyboard (old driver)"
+- depends on MAC && !INPUT_ADBHID
+- help
+- This option allows you to use an ADB keyboard attached to your
+- machine. Note that this disables any other (ie. PS/2) keyboard
+- support, even if your machine is physically capable of using both at
+- the same time.
+-
+- If you use an ADB keyboard (4 pin connector), say Y here.
+- If you use a PS/2 keyboard (6 pin connector), say N here.
+-
+ config HPDCA
+ tristate "HP DCA serial support"
+ depends on DIO && SERIAL_8250
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-make-multi_defconfig-the-default-defconfig.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-make-multi_defconfig-the-default-defconfig.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,24 @@
+Subject: [PATCH] m68k: make multi_defconfig the default defconfig
+
+From: Adrian Bunk <bunk at kernel.org>
+
+It seems to match the intention behind multi_defconfig to make it the
+default defconfig.
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/m68k/Makefile
++++ b/arch/m68k/Makefile
+@@ -13,7 +13,7 @@
+ # Copyright (C) 1994 by Hamish Macdonald
+ #
+
+-KBUILD_DEFCONFIG := amiga_defconfig
++KBUILD_DEFCONFIG := multi_defconfig
+
+ # override top level makefile
+ AS += -m68020
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-motorola-eliminate-NULL-test-and-memset-after-alloc_bootmem.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-motorola-eliminate-NULL-test-and-memset-after-alloc_bootmem.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,51 @@
+Subject: [PATCH] arch/m68k/mm/motorola.c: Eliminate NULL test and memset after alloc_bootmem
+
+From: Julia Lawall <julia at diku.dk>
+
+As noted by Akinobu Mita in patch b1fceac2b9e04d278316b2faddf276015fc06e3b,
+alloc_bootmem and related functions never return NULL and always return a
+zeroed region of memory. Thus a NULL test or memset after calls to these
+functions is unnecessary.
+
+This was fixed using the following semantic patch.
+(http://www.emn.fr/x-info/coccinelle/)
+
+// <smpl>
+@@
+expression E;
+statement S;
+@@
+
+E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
+... when != E
+(
+- BUG_ON (E == NULL);
+|
+- if (E == NULL) S
+)
+
+@@
+expression E,E1;
+@@
+
+E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
+... when != E
+- memset(E,0,E1);
+// </smpl>
+
+Signed-off-by: Julia Lawall <julia at diku.dk>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/mm/motorola.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/arch/m68k/mm/motorola.c
++++ b/arch/m68k/mm/motorola.c
+@@ -285,7 +285,6 @@ void __init paging_init(void)
+ * to a couple of allocated pages
+ */
+ empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
+- memset(empty_zero_page, 0, PAGE_SIZE);
+
+ /*
+ * Set up SFC/DFC registers
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-noswap-linux-swap-h-needs-linux-pagemap-h.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-noswap-linux-swap-h-needs-linux-pagemap-h.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,46 @@
+Subject: [PATCH] CONFIG_SWAP=n: include/linux/swap.h needs <linux/pagemap.h>
+
+When compiling a m68k kernel with CONFIG_SWAP=n, I get:
+
+ include/asm-generic/tlb.h: In function 'tlb_flush_mmu':
+ include/asm-generic/tlb.h:76: error: implicit declaration of function 'release_pages'
+ include/asm-generic/tlb.h: In function 'tlb_remove_page':
+ include/asm-generic/tlb.h:105: error: implicit declaration of function 'page_cache_release'
+
+because include/linux/swap.h defines free_page_and_swap_cache() and
+free_pages_and_swap_cache() to page_cache_release() resp. release_pages()
+without including <linux/pagemap.h>.
+
+As the comment in include/linux/swap.h says it cannot include <linux/pagemap.h>
+on sparc,
+
+---
+ include/asm-generic/tlb.h | 5 +++++
+ include/linux/swap.h | 2 ++
+ 2 files changed, 7 insertions(+)
+
+--- a/include/asm-generic/tlb.h
++++ b/include/asm-generic/tlb.h
+@@ -14,6 +14,11 @@
+ #define _ASM_GENERIC__TLB_H
+
+ #include <linux/swap.h>
++
++#ifndef CONFIG_SWAP
++#include <linux/pagemap.h>
++#endif
++
+ #include <asm/pgalloc.h>
+ #include <asm/tlbflush.h>
+
+--- a/include/linux/swap.h
++++ b/include/linux/swap.h
+@@ -279,6 +279,8 @@ static inline void disable_swap_token(vo
+
+ #else /* CONFIG_SWAP */
+
++//#include <linux/pagemap.h>
++
+ #define total_swap_pages 0
+ #define total_swapcache_pages 0UL
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-put-bss-at-end-of-data-section.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-put-bss-at-end-of-data-section.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,37 @@
+Subject: [PATCH] m68k: Put .bss at the end of the data section
+
+From: Roman Zippel <zippel at linux-m68k.org>
+
+Put .bss at the end of the data section
+
+Signed-off-by: Roman Zippel <zippel at linux-m68k.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/kernel/vmlinux-std.lds | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/m68k/kernel/vmlinux-std.lds
++++ b/arch/m68k/kernel/vmlinux-std.lds
+@@ -34,10 +34,10 @@ SECTIONS
+ CONSTRUCTORS
+ }
+
+- .bss : { *(.bss) } /* BSS */
+-
+ . = ALIGN(16);
+- .data.cacheline_aligned : { *(.data.cacheline_aligned) } :data
++ .data.cacheline_aligned : { *(.data.cacheline_aligned) }
++
++ .bss : { *(.bss) } /* BSS */
+
+ _edata = .; /* End of data section */
+
+@@ -48,7 +48,7 @@ SECTIONS
+ _sinittext = .;
+ INIT_TEXT
+ _einittext = .;
+- }
++ } :data
+ .init.data : { INIT_DATA }
+ . = ALIGN(16);
+ __setup_start = .;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-q40-config.c-make-functions-static.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-q40-config.c-make-functions-static.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,105 @@
+Subject: [PATCH] m68k/q40/config.c: make functions static
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch makes the following needlessly global functions static:
+- q40_reset()
+- q40_halt()
+- q40_disable_irqs()
+- q40_gettimeoffset()
+- q40_hwclk()
+- q40_get_ss()
+- q40_set_clock_mmss()
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/q40/config.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+--- a/arch/m68k/q40/config.c
++++ b/arch/m68k/q40/config.c
+@@ -41,14 +41,12 @@ static void q40_get_model(char *model);
+ static int q40_get_hardware_list(char *buffer);
+ extern void q40_sched_init(irq_handler_t handler);
+
+-extern unsigned long q40_gettimeoffset(void);
+-extern int q40_hwclk(int, struct rtc_time *);
+-extern unsigned int q40_get_ss(void);
+-extern int q40_set_clock_mmss(unsigned long);
++static unsigned long q40_gettimeoffset(void);
++static int q40_hwclk(int, struct rtc_time *);
++static unsigned int q40_get_ss(void);
++static int q40_set_clock_mmss(unsigned long);
+ static int q40_get_rtc_pll(struct rtc_pll_info *pll);
+ static int q40_set_rtc_pll(struct rtc_pll_info *pll);
+-extern void q40_reset(void);
+-void q40_halt(void);
+ extern void q40_waitbut(void);
+ void q40_set_vectors(void);
+
+@@ -127,7 +125,7 @@ static void q40_heartbeat(int on)
+ }
+ #endif
+
+-void q40_reset(void)
++static void q40_reset(void)
+ {
+ halted = 1;
+ printk("\n\n*******************************************\n"
+@@ -137,7 +135,8 @@ void q40_reset(void)
+ while (1)
+ ;
+ }
+-void q40_halt(void)
++
++static void q40_halt(void)
+ {
+ halted = 1;
+ printk("\n\n*******************\n"
+@@ -165,7 +164,8 @@ static unsigned int serports[] =
+ {
+ 0x3f8,0x2f8,0x3e8,0x2e8,0
+ };
+-void q40_disable_irqs(void)
++
++static void q40_disable_irqs(void)
+ {
+ unsigned i, j;
+
+@@ -227,7 +227,7 @@ static inline unsigned char bin2bcd(unsi
+ }
+
+
+-unsigned long q40_gettimeoffset(void)
++static unsigned long q40_gettimeoffset(void)
+ {
+ return 5000 * (ql_ticks != 0);
+ }
+@@ -248,7 +248,7 @@ unsigned long q40_gettimeoffset(void)
+ * };
+ */
+
+-int q40_hwclk(int op, struct rtc_time *t)
++static int q40_hwclk(int op, struct rtc_time *t)
+ {
+ if (op) {
+ /* Write.... */
+@@ -285,7 +285,7 @@ int q40_hwclk(int op, struct rtc_time *t
+ return 0;
+ }
+
+-unsigned int q40_get_ss(void)
++static unsigned int q40_get_ss(void)
+ {
+ return bcd2bin(Q40_RTC_SECS);
+ }
+@@ -295,7 +295,7 @@ unsigned int q40_get_ss(void)
+ * clock is out by > 30 minutes. Logic lifted from atari code.
+ */
+
+-int q40_set_clock_mmss(unsigned long nowtime)
++static int q40_set_clock_mmss(unsigned long nowtime)
+ {
+ int retval = 0;
+ short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-AP1000-code.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-AP1000-code.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,93 @@
+Subject: [PATCH] m68k: remove AP1000 code
+
+From: Adrian Bunk <bunk at kernel.org>
+
+Unless I miss something that's code for a sparc machine even the sparc
+code no longer supports that got copied to m68k when these files were
+copied.
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/sun3/prom/console.c | 4 ----
+ arch/m68k/sun3/prom/init.c | 9 ---------
+ arch/m68k/sun3/prom/printf.c | 5 -----
+ include/asm-m68k/oplib.h | 1 -
+ 4 files changed, 19 deletions(-)
+
+--- a/arch/m68k/sun3/prom/console.c
++++ b/arch/m68k/sun3/prom/console.c
+@@ -104,8 +104,6 @@ prom_query_input_device()
+ return PROMDEV_ITTYB;
+ }
+ return PROMDEV_I_UNK;
+- case PROM_AP1000:
+- return PROMDEV_I_UNK;
+ };
+ }
+ #endif
+@@ -166,8 +164,6 @@ prom_query_output_device()
+ };
+ }
+ break;
+- case PROM_AP1000:
+- return PROMDEV_I_UNK;
+ };
+ return PROMDEV_O_UNK;
+ }
+--- a/arch/m68k/sun3/prom/init.c
++++ b/arch/m68k/sun3/prom/init.c
+@@ -31,11 +31,6 @@ extern void prom_ranges_init(void);
+
+ void __init prom_init(struct linux_romvec *rp)
+ {
+-#ifdef CONFIG_AP1000
+- extern struct linux_romvec *ap_prom_init(void);
+- rp = ap_prom_init();
+-#endif
+-
+ romvec = rp;
+ #ifndef CONFIG_SUN3
+ switch(romvec->pv_romvers) {
+@@ -53,10 +48,6 @@ void __init prom_init(struct linux_romve
+ prom_printf("PROMLIB: Sun IEEE Prom not supported yet\n");
+ prom_halt();
+ break;
+- case 42: /* why not :-) */
+- prom_vers = PROM_AP1000;
+- break;
+-
+ default:
+ prom_printf("PROMLIB: Bad PROM version %d\n",
+ romvec->pv_romvers);
+--- a/arch/m68k/sun3/prom/printf.c
++++ b/arch/m68k/sun3/prom/printf.c
+@@ -37,10 +37,6 @@ prom_printf(char *fmt, ...)
+
+ bptr = ppbuf;
+
+-#ifdef CONFIG_AP1000
+- ap_write(1,bptr,strlen(bptr));
+-#else
+-
+ #ifdef CONFIG_KGDB
+ if (kgdb_initialized) {
+ printk("kgdb_initialized = %d\n", kgdb_initialized);
+@@ -54,7 +50,6 @@ prom_printf(char *fmt, ...)
+ prom_putchar(ch);
+ }
+ #endif
+-#endif
+ va_end(args);
+ return;
+ }
+--- a/include/asm-m68k/oplib.h
++++ b/include/asm-m68k/oplib.h
+@@ -19,7 +19,6 @@ enum prom_major_version {
+ PROM_V2, /* sun4c and early sun4m V2 prom */
+ PROM_V3, /* sun4m and later, up to sun4d/sun4e machines V3 */
+ PROM_P1275, /* IEEE compliant ISA based Sun PROM, only sun4u */
+- PROM_AP1000, /* actually no prom at all */
+ };
+
+ extern enum prom_major_version prom_vers;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-CVS-keywords.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-CVS-keywords.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,160 @@
+Subject: [PATCH] m68k: remove CVS keywords
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch removes CVS keywords that weren't updated for a long time
+from comments.
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/sun3/idprom.c | 2 +-
+ arch/m68k/sun3/prom/Makefile | 1 -
+ arch/m68k/sun3/prom/console.c | 2 +-
+ arch/m68k/sun3/prom/init.c | 2 +-
+ arch/m68k/sun3/prom/misc.c | 2 +-
+ arch/m68k/sun3/prom/printf.c | 2 +-
+ drivers/zorro/proc.c | 2 --
+ drivers/zorro/zorro.c | 2 --
+ drivers/zorro/zorro.ids | 2 --
+ include/asm-m68k/apollodma.h | 2 +-
+ include/asm-m68k/dvma.h | 2 +-
+ include/asm-m68k/machines.h | 2 +-
+ include/asm-m68k/md.h | 2 +-
+ include/asm-m68k/openprom.h | 1 -
+ include/asm-m68k/oplib.h | 2 +-
+ include/asm-m68k/sun3-head.h | 1 -
+ 16 files changed, 10 insertions(+), 19 deletions(-)
+
+ee8fd7a1ce8ef99adde70ee370963c29bebdde2a diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c
+index dca6ab6..6c5336d 100644
+--- a/arch/m68k/sun3/idprom.c
++++ b/arch/m68k/sun3/idprom.c
+@@ -1,4 +1,4 @@
+-/* $Id: idprom.c,v 1.22 1996/11/13 05:09:25 davem Exp $
++/*
+ * idprom.c: Routines to load the idprom into kernel addresses and
+ * interpret the data contained within.
+ *
+--- a/arch/m68k/sun3/prom/Makefile
++++ b/arch/m68k/sun3/prom/Makefile
+@@ -1,4 +1,3 @@
+-# $Id: Makefile,v 1.5 1995/11/25 00:59:48 davem Exp $
+ # Makefile for the Sun Boot PROM interface library under
+ # Linux.
+ #
+--- a/arch/m68k/sun3/prom/console.c
++++ b/arch/m68k/sun3/prom/console.c
+@@ -1,4 +1,4 @@
+-/* $Id: console.c,v 1.10 1996/12/18 06:46:54 tridge Exp $
++/*
+ * console.c: Routines that deal with sending and receiving IO
+ * to/from the current console device using the PROM.
+ *
+--- a/arch/m68k/sun3/prom/init.c
++++ b/arch/m68k/sun3/prom/init.c
+@@ -1,4 +1,4 @@
+-/* $Id: init.c,v 1.9 1996/12/18 06:46:55 tridge Exp $
++/*
+ * init.c: Initialize internal variables used by the PROM
+ * library functions.
+ *
+--- a/arch/m68k/sun3/prom/misc.c
++++ b/arch/m68k/sun3/prom/misc.c
+@@ -1,4 +1,4 @@
+-/* $Id: misc.c,v 1.15 1997/05/14 20:45:00 davem Exp $
++/*
+ * misc.c: Miscellaneous prom functions that don't belong
+ * anywhere else.
+ *
+--- a/arch/m68k/sun3/prom/printf.c
++++ b/arch/m68k/sun3/prom/printf.c
+@@ -1,4 +1,4 @@
+-/* $Id: printf.c,v 1.5 1996/04/04 16:31:07 tridge Exp $
++/*
+ * printf.c: Internal prom library printf facility.
+ *
+ * Copyright (C) 1995 David S. Miller (davem at caip.rutgers.edu)
+--- a/drivers/zorro/proc.c
++++ b/drivers/zorro/proc.c
+@@ -1,6 +1,4 @@
+ /*
+- * $Id: proc.c,v 1.1.2.1 1998/06/07 23:21:01 geert Exp $
+- *
+ * Procfs interface for the Zorro bus.
+ *
+ * Copyright (C) 1998-2003 Geert Uytterhoeven
+--- a/drivers/zorro/zorro.c
++++ b/drivers/zorro/zorro.c
+@@ -1,6 +1,4 @@
+ /*
+- * $Id: zorro.c,v 1.1.2.1 1998/06/07 23:21:02 geert Exp $
+- *
+ * Zorro Bus Services
+ *
+ * Copyright (C) 1995-2003 Geert Uytterhoeven
+--- a/drivers/zorro/zorro.ids
++++ b/drivers/zorro/zorro.ids
+@@ -4,8 +4,6 @@
+ # Maintained by Geert Uytterhoeven <zorro at linux-m68k.org>
+ # If you have any new entries, please send them to the maintainer.
+ #
+-# $Id: zorro.ids,v 1.19 2002/10/14 13:08:58 geert Exp $
+-#
+
+ # Manufacturers and Products. Please keep sorted.
+
+--- a/include/asm-m68k/apollodma.h
++++ b/include/asm-m68k/apollodma.h
+@@ -1,4 +1,4 @@
+-/* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $
++/*
+ * linux/include/asm/dma.h: Defines for using and allocating dma channels.
+ * Written by Hennus Bergman, 1992.
+ * High DMA channel support & info by Hannu Savolainen
+--- a/include/asm-m68k/dvma.h
++++ b/include/asm-m68k/dvma.h
+@@ -1,4 +1,4 @@
+-/* $Id: dvma.h,v 1.4 1999/03/27 20:23:41 tsbogend Exp $
++/*
+ * include/asm-m68k/dma.h
+ *
+ * Copyright 1995 (C) David S. Miller (davem at caip.rutgers.edu)
+--- a/include/asm-m68k/machines.h
++++ b/include/asm-m68k/machines.h
+@@ -1,4 +1,4 @@
+-/* $Id: machines.h,v 1.4 1995/11/25 02:31:58 davem Exp $
++/*
+ * machines.h: Defines for taking apart the machine type value in the
+ * idprom and determining the kind of machine we are on.
+ *
+--- a/include/asm-m68k/md.h
++++ b/include/asm-m68k/md.h
+@@ -1,4 +1,4 @@
+-/* $Id: md.h,v 1.1 1997/12/15 15:12:04 jj Exp $
++/*
+ * md.h: High speed xor_block operation for RAID4/5
+ *
+ */
+--- a/include/asm-m68k/openprom.h
++++ b/include/asm-m68k/openprom.h
+@@ -1,4 +1,3 @@
+-/* $Id: openprom.h,v 1.19 1996/09/25 03:51:08 davem Exp $ */
+ #ifndef __SPARC_OPENPROM_H
+ #define __SPARC_OPENPROM_H
+
+--- a/include/asm-m68k/oplib.h
++++ b/include/asm-m68k/oplib.h
+@@ -1,4 +1,4 @@
+-/* $Id: oplib.h,v 1.12 1996/10/31 06:29:13 davem Exp $
++/*
+ * oplib.h: Describes the interface and available routines in the
+ * Linux Prom library.
+ *
+--- a/include/asm-m68k/sun3-head.h
++++ b/include/asm-m68k/sun3-head.h
+@@ -1,4 +1,3 @@
+-/* $Id: head.h,v 1.32 1996/12/04 00:12:48 ecd Exp $ */
+ #ifndef __SUN3_HEAD_H
+ #define __SUN3_HEAD_H
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-stale-ARCH_SUN4-define.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-stale-ARCH_SUN4-define.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,23 @@
+Subject: [PATCH] m68k: remove stale ARCH_SUN4 #define
+
+From: Adrian Bunk <bunk at stusta.de>
+
+m68k: remove stale ARCH_SUN4 #define
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ include/asm-m68k/sbus.h | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/include/asm-m68k/sbus.h
++++ b/include/asm-m68k/sbus.h
+@@ -12,8 +12,6 @@ struct sbus_dev {
+ } reg_addrs[1];
+ };
+
+-#define ARCH_SUN4 0
+-
+ /* sbus IO functions stolen from include/asm-sparc/io.h for the serial driver */
+ /* No SBUS on the Sun3, kludge -- sam */
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-traditional.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-remove-traditional.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,69 @@
+Subject: [PATCH] m68k: remove -traditional
+CC: Sam Ravnborg <sam at ravnborg.org>
+
+From: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
+
+Subject: [RFC patch 4/9] Re: [PATCH] Stringify support commas
+ > This is a no-no for those archs that still use -traditional.
+ > > I dunno if this is a problem for you at the moment and the
+ > > right fix is anyway to nuke -traditional.
+ > >
+ > > Sam
+
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at polymtl.ca>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/fpsp040/Makefile | 1 -
+ arch/m68k/ifpsp060/Makefile | 1 -
+ arch/m68k/kernel/Makefile | 2 --
+ arch/m68k/lib/Makefile | 2 --
+ arch/m68k/math-emu/Makefile | 2 --
+ 5 files changed, 8 deletions(-)
+
+--- a/arch/m68k/fpsp040/Makefile
++++ b/arch/m68k/fpsp040/Makefile
+@@ -10,7 +10,6 @@ obj-y := bindec.o binstr.o decbin.o d
+ x_bsun.o x_fline.o x_operr.o x_ovfl.o x_snan.o x_store.o \
+ x_unfl.o x_unimp.o x_unsupp.o bugfix.o skeleton.o
+
+-EXTRA_AFLAGS := -traditional
+ EXTRA_LDFLAGS := -x
+
+ $(OS_OBJS): fpsp.h
+--- a/arch/m68k/ifpsp060/Makefile
++++ b/arch/m68k/ifpsp060/Makefile
+@@ -6,5 +6,4 @@
+
+ obj-y := fskeleton.o iskeleton.o os.o
+
+-EXTRA_AFLAGS := -traditional
+ EXTRA_LDFLAGS := -x
+--- a/arch/m68k/kernel/Makefile
++++ b/arch/m68k/kernel/Makefile
+@@ -16,5 +16,3 @@ devres-y = ../../../kernel/irq/devres.o
+
+ obj-$(CONFIG_PCI) += bios32.o
+ obj-y$(CONFIG_MMU_SUN3) += dma.o # no, it's not a typo
+-
+-EXTRA_AFLAGS := -traditional
+--- a/arch/m68k/lib/Makefile
++++ b/arch/m68k/lib/Makefile
+@@ -2,7 +2,5 @@
+ # Makefile for m68k-specific library files..
+ #
+
+-EXTRA_AFLAGS := -traditional
+-
+ lib-y := ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
+ checksum.o string.o uaccess.o
+--- a/arch/m68k/math-emu/Makefile
++++ b/arch/m68k/math-emu/Makefile
+@@ -2,8 +2,6 @@
+ # Makefile for the linux kernel.
+ #
+
+-EXTRA_AFLAGS := -traditional
+-
+ #EXTRA_AFLAGS += -DFPU_EMU_DEBUG
+ #EXTRA_CFLAGS += -DFPU_EMU_DEBUG
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-replace-linux-68k-by-linux-m68k.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-replace-linux-68k-by-linux-m68k.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,603 @@
+Subject: [PATCH] m68k: Replace `Linux/68k' by `Linux/m68k'
+
+From: Geert Uytterhoeven <geert at linux-m68k.org>
+
+m68k: Replace `Linux/68k' by `Linux/m68k'
+
+We switched to `Linux/m68k' a very long time ago
+
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ CREDITS | 6 +++---
+ Documentation/crypto/descore-readme.txt | 2 +-
+ Documentation/devices.txt | 10 +++++-----
+ Documentation/m68k/kernel-options.txt | 2 +-
+ arch/m68k/Kconfig | 2 +-
+ arch/m68k/ifpsp060/iskeleton.S | 6 +++---
+ arch/m68k/ifpsp060/os.S | 4 ++--
+ arch/m68k/kernel/head.S | 4 ++--
+ arch/m68knommu/Kconfig | 4 ++--
+ arch/m68knommu/platform/68328/ints.c | 2 +-
+ drivers/char/ser_a2232fw.ax | 2 +-
+ drivers/macintosh/via-cuda.c | 2 +-
+ drivers/macintosh/via-pmu68k.c | 8 ++++----
+ drivers/net/a2065.c | 4 ++--
+ drivers/net/a2065.h | 4 ++--
+ drivers/net/apne.c | 2 +-
+ drivers/net/lib8390.c | 2 +-
+ drivers/net/macmace.c | 4 ++--
+ drivers/net/pcmcia/axnet_cs.c | 2 +-
+ drivers/net/sonic.h | 2 +-
+ drivers/scsi/NCR5380.c | 2 +-
+ drivers/scsi/atari_NCR5380.c | 2 +-
+ drivers/scsi/sun3_NCR5380.c | 2 +-
+ drivers/serial/68360serial.c | 2 +-
+ drivers/video/macfb.c | 4 ++--
+ drivers/video/valkyriefb.c | 2 +-
+ drivers/video/valkyriefb.h | 2 +-
+ fs/affs/Changes | 2 +-
+ include/asm-m68k/elf.h | 2 +-
+ include/asm-m68knommu/bootstd.h | 2 +-
+ include/asm-m68knommu/delay.h | 2 +-
+ include/asm-m68knommu/elf.h | 2 +-
+ include/asm-m68knommu/entry.h | 2 +-
+ include/asm-m68knommu/processor.h | 2 +-
+ include/asm-xtensa/bootparam.h | 2 +-
+ include/linux/major.h | 2 +-
+ include/linux/pmu.h | 4 ++--
+ 37 files changed, 56 insertions(+), 56 deletions(-)
+
+--- a/CREDITS
++++ b/CREDITS
+@@ -174,7 +174,7 @@ N: Ralf Baechle
+ E: ralf at gnu.org
+ P: 1024/AF7B30C1 CF 97 C2 CC 6D AE A7 FE C8 BA 9C FC 88 DE 32 C3
+ D: Linux/MIPS port
+-D: Linux/68k hacker
++D: Linux/m68k hacker
+ S: Hauptstrasse 19
+ S: 79837 St. Blasien
+ S: Germany
+@@ -1548,7 +1548,7 @@ E: dhd at eradicator.org
+ E: dhd at cepstral.com
+ D: PA-RISC port
+ D: Nubus subsystem
+-D: Generic 68k Macintosh framebuffer driver
++D: Generic m68k Macintosh framebuffer driver
+ D: STI framebuffer tweaks
+ D: LTPC driver tweaks
+ S: 110 S. 12th St., Apt. A
+@@ -2132,7 +2132,7 @@ D: dv1394
+
+ N: Hamish Macdonald
+ E: hamishm at lucent.com
+-D: Linux/68k port
++D: Linux/m68k port
+ S: 32 Clydesdale Avenue
+ S: Kanata, Ontario
+ S: Canada K2M-2G7
+--- a/Documentation/crypto/descore-readme.txt
++++ b/Documentation/crypto/descore-readme.txt
+@@ -249,7 +249,7 @@ b) the compiler may be too stupid to rea
+
+ i assume that indexing is cheaper or equivalent to auto increment/decrement,
+ where the index is 7 bits unsigned or smaller.
+-this assumption is reversed for 68k and vax.
++this assumption is reversed for m68k and vax.
+
+ i assume that addresses can be cheaply formed from two registers,
+ or from a register and a small constant.
+--- a/Documentation/devices.txt
++++ b/Documentation/devices.txt
+@@ -19,8 +19,8 @@ The LaTeX version of this document is no
+ This document is included by reference into the Filesystem Hierarchy
+ Standard (FHS). The FHS is available from http://www.pathname.com/fhs/.
+
+-Allocations marked (68k/Amiga) apply to Linux/68k on the Amiga
+-platform only. Allocations marked (68k/Atari) apply to Linux/68k on
++Allocations marked (m68k/Amiga) apply to Linux/m68k on the Amiga
++platform only. Allocations marked (m68k/Atari) apply to Linux/m68k on
+ the Atari platform only.
+
+ The symbol {2.6} means the allocation is obsolete and scheduled for
+@@ -328,7 +328,7 @@ Your cooperation is appreciated.
+ 2 = /dev/inportbm Microsoft Inport bus mouse
+ 3 = /dev/atibm ATI XL bus mouse
+ 4 = /dev/jbm J-mouse
+- 4 = /dev/amigamouse Amiga mouse (68k/Amiga)
++ 4 = /dev/amigamouse Amiga mouse (m68k/Amiga)
+ 5 = /dev/atarimouse Atari mouse
+ 6 = /dev/sunmouse Sun mouse
+ 7 = /dev/amigamouse1 Second Amiga mouse
+@@ -691,7 +691,7 @@ Your cooperation is appreciated.
+ 2 = /dev/staliomem2 Third Stallion card I/O memory
+ 3 = /dev/staliomem3 Fourth Stallion card I/O memory
+
+- 28 char Atari SLM ACSI laser printer (68k/Atari)
++ 28 char Atari SLM ACSI laser printer (m68k/Atari)
+ 0 = /dev/slm0 First SLM laser printer
+ 1 = /dev/slm1 Second SLM laser printer
+ ...
+@@ -701,7 +701,7 @@ Your cooperation is appreciated.
+ 2 = /dev/sbpcd14 Panasonic CD-ROM controller 3 unit 2
+ 3 = /dev/sbpcd15 Panasonic CD-ROM controller 3 unit 3
+
+- 28 block ACSI disk (68k/Atari)
++ 28 block ACSI disk (m68k/Atari)
+ 0 = /dev/ada First ACSI disk whole disk
+ 16 = /dev/adb Second ACSI disk whole disk
+ 32 = /dev/adc Third ACSI disk whole disk
+--- a/Documentation/m68k/kernel-options.txt
++++ b/Documentation/m68k/kernel-options.txt
+@@ -852,7 +852,7 @@ use of this option is now highly unrecom
+ Incorrect use can lead to unpredictable behavior, so please only use
+ this option if you *know* what you are doing and have a reason to do
+ so. In any case if you experience problems and need to use this
+-option, please inform us about it by mailing to the Linux/68k kernel
++option, please inform us about it by mailing to the Linux/m68k kernel
+ mailing list.
+
+ The address mask set by this option specifies which addresses are
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -60,7 +60,7 @@ config HZ
+ int
+ default 100
+
+-mainmenu "Linux/68k Kernel Configuration"
++mainmenu "Linux/m68k Kernel Configuration"
+
+ source "init/Kconfig"
+
+--- a/arch/m68k/ifpsp060/iskeleton.S
++++ b/arch/m68k/ifpsp060/iskeleton.S
+@@ -65,7 +65,7 @@
+ | To simply continue execution at the next instruction, just
+ | do an "rte".
+ |
+-| Linux/68k: If returning to user space, check for needed reselections.
++| Linux/m68k: If returning to user space, check for needed reselections.
+
+ .global _060_isp_done
+ _060_isp_done:
+@@ -87,7 +87,7 @@ _060_isp_done:
+ | a CHK exception stack frame from the Unimplemented Integer Instrcution
+ | stack frame and branches to this routine.
+ |
+-| Linux/68k: commented out test for tracing
++| Linux/m68k: commented out test for tracing
+
+ .global _060_real_chk
+ _060_real_chk:
+@@ -127,7 +127,7 @@ real_chk_end:
+ | then it create a Trace exception stack frame from the "chk" exception
+ | stack frame and branches to the _real_trace() entry point.
+ |
+-| Linux/68k: commented out test for tracing
++| Linux/m68k: commented out test for tracing
+
+ .global _060_real_divbyzero
+ _060_real_divbyzero:
+--- a/arch/m68k/ifpsp060/os.S
++++ b/arch/m68k/ifpsp060/os.S
+@@ -65,7 +65,7 @@
+ | The result is that Unix processes are allowed to sleep as a consequence
+ | of a page fault during a _copyout.
+ |
+-| Linux/68k: The _060_[id]mem_{read,write}_{byte,word,long} functions
++| Linux/m68k: The _060_[id]mem_{read,write}_{byte,word,long} functions
+ | (i.e. all the known length <= 4) are implemented by single moves
+ | statements instead of (more expensive) copy{in,out} calls, if
+ | working in user space
+@@ -305,7 +305,7 @@ dmwls: move.l %d0,(%a0) | store super
+ | Assumes that D0/D1/A0/A1 are scratch registers. The _copyin/_copyout
+ | below assume that the SFC/DFC have been set previously.
+ |
+-| Linux/68k: These are basically non-inlined versions of
++| Linux/m68k: These are basically non-inlined versions of
+ | memcpy_{to,from}fs, but without long-transfer optimization
+ | Note: Assumed that SFC/DFC are pointing correctly to user data
+ | space... Should be right, or are there any exceptions?
+--- a/arch/m68k/kernel/head.S
++++ b/arch/m68k/kernel/head.S
+@@ -1,7 +1,7 @@
+ /* -*- mode: asm -*-
+ **
+ ** head.S -- This file contains the initial boot code for the
+-** Linux/68k kernel.
++** Linux/m68k kernel.
+ **
+ ** Copyright 1993 by Hamish Macdonald
+ **
+@@ -1568,7 +1568,7 @@ func_return get_bi_record
+ /*
+ * MMU Initialization Begins Here
+ *
+- * The structure of the MMU tables on the 68k machines
++ * The structure of the MMU tables on the m68k machines
+ * is thus:
+ * Root Table
+ * Logical addresses are translated through
+--- a/arch/m68knommu/Kconfig
++++ b/arch/m68knommu/Kconfig
+@@ -3,7 +3,7 @@
+ # see Documentation/kbuild/kconfig-language.txt.
+ #
+
+-mainmenu "uClinux/68k (w/o MMU) Kernel Configuration"
++mainmenu "uClinux/m68k (w/o MMU) Kernel Configuration"
+
+ config M68K
+ bool
+@@ -174,7 +174,7 @@ config CLOCK_SET
+ help
+ On some CPU's you do not need to know what the core CPU clock
+ frequency is. On these you can disable clock setting. On some
+- traditional 68K parts, and on all ColdFire parts you need to set
++ traditional m68k parts, and on all ColdFire parts you need to set
+ the appropriate CPU clock frequency. On these devices many of the
+ onboard peripherals derive their timing from the master CPU clock
+ frequency.
+--- a/arch/m68knommu/platform/68328/ints.c
++++ b/arch/m68knommu/platform/68328/ints.c
+@@ -101,7 +101,7 @@ void __init init_vectors(void)
+ IMR = ~0;
+ }
+
+-/* The 68k family did not have a good way to determine the source
++/* The m68k family did not have a good way to determine the source
+ * of interrupts until later in the family. The EC000 core does
+ * not provide the vector number on the stack, we vector everything
+ * into one vector and look in the blasted mask register...
+--- a/drivers/char/ser_a2232fw.ax
++++ b/drivers/char/ser_a2232fw.ax
+@@ -462,7 +462,7 @@ Speedy2 lda ACIA0+A_SR ; read status
+ beq Speedy2 ; not yet, wait more ;
+ stx CIA+C_CTRLA ; stop the timer ;
+ ; ;
+- lda CIA+C_TAL ; copy timer value for 68k ;
++ lda CIA+C_TAL ; copy timer value for m68k ;
+ sta TimerL ; ;
+ lda CIA+C_TAH ; ;
+ sta TimerH ; ;
+--- a/drivers/macintosh/via-cuda.c
++++ b/drivers/macintosh/via-cuda.c
+@@ -158,7 +158,7 @@ int __init find_via_cuda(void)
+ return 0;
+ }
+
+- /* Clear and enable interrupts, but only on PPC. On 68K it's done */
++ /* Clear and enable interrupts, but only on PPC. On m68k it's done */
+ /* for us by the main VIA driver in arch/m68k/mac/via.c */
+
+ out_8(&via[IFR], 0x7f); /* clear interrupts by writing 1s */
+--- a/drivers/macintosh/via-pmu68k.c
++++ b/drivers/macintosh/via-pmu68k.c
+@@ -1,5 +1,5 @@
+ /*
+- * Device driver for the PMU on 68K-based Apple PowerBooks
++ * Device driver for the PMU on m68k-based Apple PowerBooks
+ *
+ * The VIA (versatile interface adapter) interfaces to the PMU,
+ * a 6805 microprocessor core whose primary function is to control
+@@ -8,7 +8,7 @@
+ * to the keyboard and mouse, as well as the non-volatile RAM
+ * and the RTC (real time clock) chip.
+ *
+- * Adapted for 68K PMU by Joshua M. Thompson
++ * Adapted for m68k PMU by Joshua M. Thompson
+ *
+ * Based largely on the PowerMac PMU code by Paul Mackerras and
+ * Fabio Riccardi.
+@@ -122,7 +122,7 @@ static void pmu_enable_backlight(int on)
+ static void pmu_set_brightness(int level);
+
+ struct adb_driver via_pmu_driver = {
+- "68K PMU",
++ "m68k PMU",
+ pmu_probe,
+ pmu_init,
+ pmu_send_request,
+@@ -260,7 +260,7 @@ pmu_init(void)
+ /* Enable backlight */
+ pmu_enable_backlight(1);
+
+- printk("adb: PMU 68K driver v0.5 for Unified ADB.\n");
++ printk("adb: PMU m68k driver v0.5 for Unified ADB.\n");
+
+ return 0;
+ }
+--- a/drivers/net/a2065.c
++++ b/drivers/net/a2065.c
+@@ -1,5 +1,5 @@
+ /*
+- * Amiga Linux/68k A2065 Ethernet Driver
++ * Amiga Linux/m68k A2065 Ethernet Driver
+ *
+ * (C) Copyright 1995-2003 by Geert Uytterhoeven <geert at linux-m68k.org>
+ *
+@@ -12,7 +12,7 @@
+ *
+ * This program is based on
+ *
+- * ariadne.?: Amiga Linux/68k Ariadne Ethernet Driver
++ * ariadne.?: Amiga Linux/m68k Ariadne Ethernet Driver
+ * (C) Copyright 1995 by Geert Uytterhoeven,
+ * Peter De Schrijver
+ *
+--- a/drivers/net/a2065.h
++++ b/drivers/net/a2065.h
+@@ -1,5 +1,5 @@
+ /*
+- * Amiga Linux/68k A2065 Ethernet Driver
++ * Amiga Linux/m68k A2065 Ethernet Driver
+ *
+ * (C) Copyright 1995 by Geert Uytterhoeven <geert at linux-m68k.org>
+ *
+@@ -7,7 +7,7 @@
+ *
+ * This program is based on
+ *
+- * ariadne.?: Amiga Linux/68k Ariadne Ethernet Driver
++ * ariadne.?: Amiga Linux/m68k Ariadne Ethernet Driver
+ * (C) Copyright 1995 by Geert Uytterhoeven,
+ * Peter De Schrijver
+ *
+--- a/drivers/net/apne.c
++++ b/drivers/net/apne.c
+@@ -1,5 +1,5 @@
+ /*
+- * Amiga Linux/68k 8390 based PCMCIA Ethernet Driver for the Amiga 1200
++ * Amiga Linux/m68k 8390 based PCMCIA Ethernet Driver for the Amiga 1200
+ *
+ * (C) Copyright 1997 Alain Malek
+ * (Alain.Malek at cryogen.com)
+--- a/drivers/net/lib8390.c
++++ b/drivers/net/lib8390.c
+@@ -36,7 +36,7 @@
+ Paul Gortmaker : tweak ANK's above multicast changes a bit.
+ Paul Gortmaker : update packet statistics for v2.1.x
+ Alan Cox : support arbitary stupid port mappings on the
+- 68K Macintosh. Support >16bit I/O spaces
++ m68k Macintosh. Support >16bit I/O spaces
+ Paul Gortmaker : add kmod support for auto-loading of the 8390
+ module by all drivers that require it.
+ Alan Cox : Spinlocking work, added 'BUG_83C690'
+--- a/drivers/net/macmace.c
++++ b/drivers/net/macmace.c
+@@ -1,5 +1,5 @@
+ /*
+- * Driver for the Macintosh 68K onboard MACE controller with PSC
++ * Driver for the Macintosh m68k onboard MACE controller with PSC
+ * driven DMA. The MACE driver code is derived from mace.c. The
+ * Mac68k theory of operation is courtesy of the MacBSD wizards.
+ *
+@@ -249,7 +249,7 @@ static int __devinit mace_probe(struct p
+ dev->set_multicast_list = mace_set_multicast;
+ dev->set_mac_address = mace_set_address;
+
+- printk(KERN_INFO "%s: 68K MACE, hardware address %s\n",
++ printk(KERN_INFO "%s: m68k MACE, hardware address %s\n",
+ dev->name, print_mac(mac, dev->dev_addr));
+
+ err = register_netdev(dev);
+--- a/drivers/net/pcmcia/axnet_cs.c
++++ b/drivers/net/pcmcia/axnet_cs.c
+@@ -857,7 +857,7 @@ module_exit(exit_axnet_cs);
+ Paul Gortmaker : tweak ANK's above multicast changes a bit.
+ Paul Gortmaker : update packet statistics for v2.1.x
+ Alan Cox : support arbitary stupid port mappings on the
+- 68K Macintosh. Support >16bit I/O spaces
++ m68k Macintosh. Support >16bit I/O spaces
+ Paul Gortmaker : add kmod support for auto-loading of the 8390
+ module by all drivers that require it.
+ Alan Cox : Spinlocking work, added 'BUG_83C690'
+--- a/drivers/net/sonic.h
++++ b/drivers/net/sonic.h
+@@ -9,7 +9,7 @@
+ * and pad structure members must be exchanged. Also, the structures
+ * need to be changed accordingly to the bus size.
+ *
+- * 981229 MSch: did just that for the 68k Mac port (32 bit, big endian)
++ * 981229 MSch: did just that for the m68k Mac port (32 bit, big endian)
+ *
+ * 990611 David Huggins-Daines <dhd at debian.org>: This machine abstraction
+ * does not cope with 16-bit bus sizes very well. Therefore I have
+--- a/drivers/scsi/NCR5380.c
++++ b/drivers/scsi/NCR5380.c
+@@ -125,7 +125,7 @@
+ *
+ * This is a generic 5380 driver. To use it on a different platform,
+ * one simply writes appropriate system specific macros (ie, data
+- * transfer - some PC's will use the I/O bus, 68K's must use
++ * transfer - some PC's will use the I/O bus, m68k's must use
+ * memory mapped) and drops this file in their 'C' wrapper.
+ *
+ * (Note from hch: unfortunately it was not enough for the different
+--- a/drivers/scsi/atari_NCR5380.c
++++ b/drivers/scsi/atari_NCR5380.c
+@@ -126,7 +126,7 @@
+ * This driver attempts to address these problems :
+ * This is a generic 5380 driver. To use it on a different platform,
+ * one simply writes appropriate system specific macros (ie, data
+- * transfer - some PC's will use the I/O bus, 68K's must use
++ * transfer - some PC's will use the I/O bus, m68k's must use
+ * memory mapped) and drops this file in their 'C' wrapper.
+ *
+ * As far as command queueing, two queues are maintained for
+--- a/drivers/scsi/sun3_NCR5380.c
++++ b/drivers/scsi/sun3_NCR5380.c
+@@ -120,7 +120,7 @@
+ * This driver attempts to address these problems :
+ * This is a generic 5380 driver. To use it on a different platform,
+ * one simply writes appropriate system specific macros (ie, data
+- * transfer - some PC's will use the I/O bus, 68K's must use
++ * transfer - some PC's will use the I/O bus, m68k's must use
+ * memory mapped) and drops this file in their 'C' wrapper.
+ *
+ * As far as command queueing, two queues are maintained for
+--- a/drivers/serial/68360serial.c
++++ b/drivers/serial/68360serial.c
+@@ -2802,7 +2802,7 @@ int serial_console_setup( struct console
+ volatile struct uart_pram *sup;
+
+ /* mleslie TODO:
+- * add something to the 68k bootloader to store a desired initial console baud rate */
++ * add something to the m68k bootloader to store a desired initial console baud rate */
+
+ /* bd_t *bd; */ /* a board info struct used by EPPC-bug */
+ /* bd = (bd_t *)__res; */
+--- a/drivers/video/macfb.c
++++ b/drivers/video/macfb.c
+@@ -563,7 +563,7 @@ static int macfb_setcolreg(unsigned regn
+ }
+ break;
+ /* I'm pretty sure that one or the other of these
+- doesn't exist on 68k Macs */
++ doesn't exist on m68k Macs */
+ case 24:
+ red >>= 8;
+ green >>= 8;
+@@ -719,7 +719,7 @@ static int __init macfb_init(void)
+ break;
+ case 24:
+ case 32:
+- /* XXX: have to test these... can any 68k Macs
++ /* XXX: have to test these... can any m68k Macs
+ actually do this on internal video? */
+ macfb_defined.red.offset = 16;
+ macfb_defined.red.length = 8;
+--- a/drivers/video/valkyriefb.c
++++ b/drivers/video/valkyriefb.c
+@@ -332,7 +332,7 @@ int __init valkyriefb_init(void)
+ || mac_bi_data.id == MAC_MODEL_P588))
+ return 0;
+
+- /* Hardcoded addresses... welcome to 68k Macintosh country :-) */
++ /* Hardcoded addresses... welcome to m68k Macintosh country :-) */
+ frame_buffer_phys = 0xf9000000;
+ cmap_regs_phys = 0x50f24000;
+ flags = IOMAP_NOCACHE_SER; /* IOMAP_WRITETHROUGH?? */
+--- a/drivers/video/valkyriefb.h
++++ b/drivers/video/valkyriefb.h
+@@ -9,7 +9,7 @@
+ *
+ * vmode 10 changed by Steven Borley <sjb at salix.demon.co.uk>, 14 mai 2000
+ *
+- * Ported to 68k Macintosh by David Huggins-Daines <dhd at debian.org>
++ * Ported to m68k Macintosh by David Huggins-Daines <dhd at debian.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+--- a/fs/affs/Changes
++++ b/fs/affs/Changes
+@@ -197,7 +197,7 @@ Version 3.6
+ - Fixed bug in add_entry(): When doing a sorted insert,
+ the pointer to the next entry in the hash chain wasn't
+ correctly byte-swapped. Since most of the users of the
+- affs use it on a 68k, they didn't notice. But why did
++ affs use it on a m68k, they didn't notice. But why did
+ I not find this during my tests?
+
+ - Fixed some oversights (version wasn't updated on some
+--- a/include/asm-m68k/elf.h
++++ b/include/asm-m68k/elf.h
+@@ -9,7 +9,7 @@
+ #include <asm/user.h>
+
+ /*
+- * 68k ELF relocation types
++ * m68k ELF relocation types
+ */
+ #define R_68K_NONE 0
+ #define R_68K_32 1
+--- a/include/asm-m68knommu/bootstd.h
++++ b/include/asm-m68knommu/bootstd.h
+@@ -30,7 +30,7 @@
+ #define __BN_flash_erase_range 19
+ #define __BN_flash_write_range 20
+
+-/* Calling conventions compatible to (uC)linux/68k
++/* Calling conventions compatible to (uC)linux/m68k
+ * We use simmilar macros to call into the bootloader as for uClinux
+ */
+
+--- a/include/asm-m68knommu/delay.h
++++ b/include/asm-m68knommu/delay.h
+@@ -34,7 +34,7 @@ static inline void __delay(unsigned long
+
+ /*
+ * Ideally we use a 32*32->64 multiply to calculate the number of
+- * loop iterations, but the older standard 68k and ColdFire do not
++ * loop iterations, but the older standard m68k and ColdFire do not
+ * have this instruction. So for them we have a clsoe approximation
+ * loop using 32*32->32 multiplies only. This calculation based on
+ * the ARM version of delay.
+--- a/include/asm-m68knommu/elf.h
++++ b/include/asm-m68knommu/elf.h
+@@ -9,7 +9,7 @@
+ #include <asm/user.h>
+
+ /*
+- * 68k ELF relocation types
++ * m68k ELF relocation types
+ */
+ #define R_68K_NONE 0
+ #define R_68K_32 1
+--- a/include/asm-m68knommu/entry.h
++++ b/include/asm-m68knommu/entry.h
+@@ -152,7 +152,7 @@ LENOSYS = 38
+ #else /* !CONFIG_COLDFIRE */
+
+ /*
+- * Standard 68k interrupt entry and exit macros.
++ * Standard m68k interrupt entry and exit macros.
+ */
+ .macro SAVE_ALL
+ clrl %sp at - /* stkadj */
+--- a/include/asm-m68knommu/processor.h
++++ b/include/asm-m68knommu/processor.h
+@@ -80,7 +80,7 @@ struct thread_struct {
+
+ /*
+ * Coldfire stacks need to be re-aligned on trap exit, conventional
+- * 68k can handle this case cleanly.
++ * m68k can handle this case cleanly.
+ */
+ #if defined(CONFIG_COLDFIRE)
+ #define reformat(_regs) do { (_regs)->format = 0x4; } while(0)
+--- a/include/asm-xtensa/bootparam.h
++++ b/include/asm-xtensa/bootparam.h
+@@ -9,7 +9,7 @@
+ *
+ * Copyright (C) 2001 - 2005 Tensilica Inc.
+ *
+- * (Concept borrowed from the 68K port)
++ * (Concept borrowed from the m68k port)
+ */
+
+ #ifndef _XTENSA_BOOTPARAM_H
+--- a/include/linux/major.h
++++ b/include/linux/major.h
+@@ -53,7 +53,7 @@
+ #define STL_SIOMEMMAJOR 28
+ #define ACSI_MAJOR 28
+ #define AZTECH_CDROM_MAJOR 29
+-#define GRAPHDEV_MAJOR 29 /* SparcLinux & Linux/68k /dev/fb */
++#define GRAPHDEV_MAJOR 29 /* SparcLinux & Linux/m68k /dev/fb */
+ #define CM206_CDROM_MAJOR 32
+ #define IDE2_MAJOR 33
+ #define IDE3_MAJOR 34
+--- a/include/linux/pmu.h
++++ b/include/linux/pmu.h
+@@ -90,8 +90,8 @@ enum {
+ PMU_HEATHROW_BASED, /* PowerBook G3 series */
+ PMU_PADDINGTON_BASED, /* 1999 PowerBook G3 */
+ PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */
+- PMU_68K_V1, /* 68K PMU, version 1 */
+- PMU_68K_V2, /* 68K PMU, version 2 */
++ PMU_68K_V1, /* m68k PMU, version 1 */
++ PMU_68K_V2, /* m68k PMU, version 2 */
+ };
+
+ /* PMU PMU_POWER_EVENTS commands */
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-scsi-HOST_C-cleanup.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-scsi-HOST_C-cleanup.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,22 @@
+
+FIXME a few more to take care of
+FIXME merge include files that are included only once into the .c file
+
+git grep HOSTS_C
+
+---
+ drivers/scsi/mvme147.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/scsi/mvme147.c
++++ b/drivers/scsi/mvme147.c
+@@ -128,9 +128,6 @@ static int mvme147_bus_reset(struct scsi
+ return SUCCESS;
+ }
+
+-#define HOSTS_C
+-
+-#include "mvme147.h"
+
+ static struct scsi_host_template driver_template = {
+ .proc_name = "MVME147",
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-sun3-eliminate-NULL-test-and-memset-after-alloc_bootmem.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-sun3-eliminate-NULL-test-and-memset-after-alloc_bootmem.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,51 @@
+Subject: [PATCH] arch/m68k/mm/Sun3mmu.c: Eliminate NULL test and memset after alloc_bootmem
+
+From: Julia Lawall <julia at diku.dk>
+
+As noted by Akinobu Mita in patch b1fceac2b9e04d278316b2faddf276015fc06e3b,
+alloc_bootmem and related functions never return NULL and always return a
+zeroed region of memory. Thus a NULL test or memset after calls to these
+functions is unnecessary.
+
+This was fixed using the following semantic patch.
+(http://www.emn.fr/x-info/coccinelle/)
+
+// <smpl>
+@@
+expression E;
+statement S;
+@@
+
+E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
+... when != E
+(
+- BUG_ON (E == NULL);
+|
+- if (E == NULL) S
+)
+
+@@
+expression E,E1;
+@@
+
+E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
+... when != E
+- memset(E,0,E1);
+// </smpl>
+
+Signed-off-by: Julia Lawall <julia at diku.dk>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/mm/sun3mmu.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/arch/m68k/mm/sun3mmu.c
++++ b/arch/m68k/mm/sun3mmu.c
+@@ -53,7 +53,6 @@ void __init paging_init(void)
+ wp_works_ok = 0;
+ #endif
+ empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
+- memset(empty_zero_page, 0, PAGE_SIZE);
+
+ address = PAGE_OFFSET;
+ pg_dir = swapper_pg_dir;
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-sun3-possible-cleanups.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-sun3-possible-cleanups.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,190 @@
+Subject: [PATCH] m68k/sun3/: possible cleanups
+
+From: Adrian Bunk <bunk at kernel.org>
+
+This patch contains the following possible cleanups:
+- make the following needlessly global code static:
+ - config.c: sun3_bootmem_alloc()
+ - config.c: sun3_sched_init()
+ - dvma.c: dvma_page()
+ - idprom.c: struct Sun_Machines[]
+ - mmu_emu.c: struct ctx_alloc[]
+ - sun3dvma.c: iommu_use[]
+ - sun3ints.c: led_pattern[]
+- remove the unused sbus.c
+
+Signed-off-by: Adrian Bunk <bunk at kernel.org>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/sun3/Makefile | 2 +-
+ arch/m68k/sun3/config.c | 7 ++++---
+ arch/m68k/sun3/dvma.c | 2 +-
+ arch/m68k/sun3/idprom.c | 2 +-
+ arch/m68k/sun3/mmu_emu.c | 2 +-
+ arch/m68k/sun3/sbus.c | 27 ---------------------------
+ arch/m68k/sun3/sun3dvma.c | 2 +-
+ arch/m68k/sun3/sun3ints.c | 2 +-
+ include/asm-m68k/dvma.h | 2 --
+ include/asm-m68k/machines.h | 2 --
+ include/asm-m68k/sbus.h | 3 ---
+ 11 files changed, 10 insertions(+), 43 deletions(-)
+
+--- a/arch/m68k/sun3/Makefile
++++ b/arch/m68k/sun3/Makefile
+@@ -2,6 +2,6 @@
+ # Makefile for Linux arch/m68k/sun3 source directory
+ #
+
+-obj-y := sun3ints.o sun3dvma.o sbus.o idprom.o
++obj-y := sun3ints.o sun3dvma.o idprom.o
+
+ obj-$(CONFIG_SUN3) += config.o mmu_emu.o leds.o dvma.o intersil.o
+--- a/arch/m68k/sun3/config.c
++++ b/arch/m68k/sun3/config.c
+@@ -36,7 +36,7 @@ extern char _text, _end;
+ char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
+
+ extern unsigned long sun3_gettimeoffset(void);
+-extern void sun3_sched_init(irq_handler_t handler);
++static void sun3_sched_init(irq_handler_t handler);
+ extern void sun3_get_model (char* model);
+ extern void idprom_init (void);
+ extern int sun3_hwclk(int set, struct rtc_time *t);
+@@ -114,7 +114,8 @@ static void sun3_halt (void)
+
+ /* sun3 bootmem allocation */
+
+-void __init sun3_bootmem_alloc(unsigned long memory_start, unsigned long memory_end)
++static void __init sun3_bootmem_alloc(unsigned long memory_start,
++ unsigned long memory_end)
+ {
+ unsigned long start_page;
+
+@@ -164,7 +165,7 @@ void __init config_sun3(void)
+ sun3_bootmem_alloc(memory_start, memory_end);
+ }
+
+-void __init sun3_sched_init(irq_handler_t timer_routine)
++static void __init sun3_sched_init(irq_handler_t timer_routine)
+ {
+ sun3_disable_interrupts();
+ intersil_clock->cmd_reg=(INTERSIL_RUN|INTERSIL_INT_DISABLE|INTERSIL_24H_MODE);
+--- a/arch/m68k/sun3/dvma.c
++++ b/arch/m68k/sun3/dvma.c
+@@ -19,7 +19,7 @@
+
+ static unsigned long ptelist[120];
+
+-inline unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
++static unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
+ {
+ unsigned long pte;
+ unsigned long j;
+--- a/arch/m68k/sun3/idprom.c
++++ b/arch/m68k/sun3/idprom.c
+@@ -25,7 +25,7 @@ static struct idprom idprom_buffer;
+ * of the Sparc CPU and have a meaningful IDPROM machtype value that we
+ * know about. See asm-sparc/machines.h for empirical constants.
+ */
+-struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = {
++static struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = {
+ /* First, Sun3's */
+ { .name = "Sun 3/160 Series", .id_machtype = (SM_SUN3 | SM_3_160) },
+ { .name = "Sun 3/50", .id_machtype = (SM_SUN3 | SM_3_50) },
+--- a/arch/m68k/sun3/mmu_emu.c
++++ b/arch/m68k/sun3/mmu_emu.c
+@@ -55,7 +55,7 @@ unsigned char pmeg_ctx[PMEGS_NUM];
+
+ /* pointers to the mm structs for each task in each
+ context. 0xffffffff is a marker for kernel context */
+-struct mm_struct *ctx_alloc[CONTEXTS_NUM] = {
++static struct mm_struct *ctx_alloc[CONTEXTS_NUM] = {
+ [0] = (struct mm_struct *)0xffffffff
+ };
+
+--- a/arch/m68k/sun3/sbus.c
++++ /dev/null
+@@ -1,27 +0,0 @@
+-/*
+- * SBus helper functions
+- *
+- * Sun3 don't have a sbus, but many of the used devices are also
+- * used on Sparc machines with sbus. To avoid having a lot of
+- * duplicate code, we provide necessary glue stuff to make using
+- * of the sbus driver code possible.
+- *
+- * (C) 1999 Thomas Bogendoerfer (tsbogend at alpha.franken.de)
+- */
+-
+-#include <linux/types.h>
+-#include <linux/compiler.h>
+-#include <linux/init.h>
+-
+-int __init sbus_init(void)
+-{
+- return 0;
+-}
+-
+-void *sparc_alloc_io (u32 address, void *virtual, int len, char *name,
+- u32 bus_type, int rdonly)
+-{
+- return (void *)address;
+-}
+-
+-subsys_initcall(sbus_init);
+--- a/arch/m68k/sun3/sun3dvma.c
++++ b/arch/m68k/sun3/sun3dvma.c
+@@ -29,7 +29,7 @@ static inline void dvma_unmap_iommu(unsi
+ extern void sun3_dvma_init(void);
+ #endif
+
+-unsigned long iommu_use[IOMMU_TOTAL_ENTRIES];
++static unsigned long iommu_use[IOMMU_TOTAL_ENTRIES];
+
+ #define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
+
+--- a/arch/m68k/sun3/sun3ints.c
++++ b/arch/m68k/sun3/sun3ints.c
+@@ -30,7 +30,7 @@ void sun3_enable_interrupts(void)
+ sun3_enable_irq(0);
+ }
+
+-int led_pattern[8] = {
++static int led_pattern[8] = {
+ ~(0x80), ~(0x01),
+ ~(0x40), ~(0x02),
+ ~(0x20), ~(0x04),
+--- a/include/asm-m68k/dvma.h
++++ b/include/asm-m68k/dvma.h
+@@ -63,8 +63,6 @@ static inline int dvma_map_cpu(unsigned
+ return 0;
+ }
+
+-extern unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr);
+-
+ #else /* Sun3x */
+
+ /* sun3x dvma page support */
+--- a/include/asm-m68k/machines.h
++++ b/include/asm-m68k/machines.h
+@@ -21,8 +21,6 @@ struct Sun_Machine_Models {
+ //#define NUM_SUN_MACHINES 23
+ #define NUM_SUN_MACHINES 8
+
+-extern struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES];
+-
+ /* The machine type in the idprom area looks like this:
+ *
+ * ---------------
+--- a/include/asm-m68k/sbus.h
++++ b/include/asm-m68k/sbus.h
+@@ -12,9 +12,6 @@ struct sbus_dev {
+ } reg_addrs[1];
+ };
+
+-extern void *sparc_alloc_io (u32, void *, int, char *, u32, int);
+-#define sparc_alloc_io(a,b,c,d,e,f) (a)
+-
+ #define ARCH_SUN4 0
+
+ /* sbus IO functions stolen from include/asm-sparc/io.h for the serial driver */
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-update-defconfig-latest.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-update-defconfig-latest.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,58 @@
+---
+ arch/m68k/configs/atari_defconfig | 4 ++++
+ arch/m68k/configs/multi_defconfig | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+--- a/arch/m68k/configs/atari_defconfig
++++ b/arch/m68k/configs/atari_defconfig
+@@ -116,12 +116,15 @@ CONFIG_CLASSIC_RCU=y
+ # CONFIG_SUN3 is not set
+ # CONFIG_AMIGA is not set
+ CONFIG_ATARI=y
++CONFIG_ATARI_ROM_ISA=y
+ # CONFIG_MAC is not set
+ # CONFIG_APOLLO is not set
+ # CONFIG_VME is not set
+ # CONFIG_HP300 is not set
+ # CONFIG_SUN3X is not set
+ # CONFIG_Q40 is not set
++CONFIG_NATFEAT=y
++CONFIG_NFETH=y
+
+ #
+ # Processor type
+@@ -564,6 +567,7 @@ CONFIG_VETH=m
+ CONFIG_NET_ETHERNET=y
+ CONFIG_MII=m
+ CONFIG_ATARILANCE=m
++CONFIG_ATARI_ETHERNEC=m
+ # CONFIG_IBM_NEW_EMAC_ZMII is not set
+ # CONFIG_IBM_NEW_EMAC_RGMII is not set
+ # CONFIG_IBM_NEW_EMAC_TAH is not set
+--- a/arch/m68k/configs/multi_defconfig
++++ b/arch/m68k/configs/multi_defconfig
+@@ -116,6 +116,7 @@ CONFIG_CLASSIC_RCU=y
+ # CONFIG_SUN3 is not set
+ CONFIG_AMIGA=y
+ CONFIG_ATARI=y
++CONFIG_ATARI_ROM_ISA=y
+ CONFIG_MAC=y
+ CONFIG_NUBUS=y
+ CONFIG_M68K_L2_CACHE=y
+@@ -128,6 +129,8 @@ CONFIG_HP300=y
+ CONFIG_DIO=y
+ CONFIG_SUN3X=y
+ CONFIG_Q40=y
++CONFIG_NATFEAT=y
++CONFIG_NFETH=y
+
+ #
+ # Processor type
+@@ -641,6 +644,7 @@ CONFIG_MVME147_NET=y
+ CONFIG_MVME16x_NET=y
+ CONFIG_BVME6000_NET=y
+ CONFIG_ATARILANCE=m
++CONFIG_ATARI_ETHERNEC=m
+ CONFIG_SUN3LANCE=y
+ CONFIG_HPLANCE=y
+ # CONFIG_NET_VENDOR_3COM is not set
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-vmlinux-std_sun3.lds.S_cleanup_use_PAGE_SIZE_macro.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/m68k-vmlinux-std_sun3.lds.S_cleanup_use_PAGE_SIZE_macro.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,67 @@
+Subject: [PATCH] m68k: vmlinux-std/sun3.lds.S cleanup - use PAGE_SIZE macro
+
+From: Cyrill Gorcunov <gorcunov at gmail.com>
+
+This patch includes page.h header into linker script that
+allow us to use PAGE_SIZE macro instead of numeric constant
+
+Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ arch/m68k/kernel/vmlinux-std.lds | 3 ++-
+ arch/m68k/kernel/vmlinux-sun3.lds | 7 ++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+--- a/arch/m68k/kernel/vmlinux-std.lds
++++ b/arch/m68k/kernel/vmlinux-std.lds
+@@ -1,6 +1,7 @@
+ /* ld script to make m68k Linux kernel */
+
+ #include <asm-generic/vmlinux.lds.h>
++#include <asm/page.h>
+
+ OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
+ OUTPUT_ARCH(m68k)
+@@ -41,7 +42,7 @@ SECTIONS
+ _edata = .; /* End of data section */
+
+ /* will be freed after init */
+- . = ALIGN(4096); /* Init code and data */
++ . = ALIGN(PAGE_SIZE); /* Init code and data */
+ __init_begin = .;
+ .init.text : {
+ _sinittext = .;
+--- a/arch/m68k/kernel/vmlinux-sun3.lds
++++ b/arch/m68k/kernel/vmlinux-sun3.lds
+@@ -1,6 +1,7 @@
+ /* ld script to make m68k Linux kernel */
+
+ #include <asm-generic/vmlinux.lds.h>
++#include <asm/page.h>
+
+ OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
+ OUTPUT_ARCH(m68k)
+@@ -34,7 +35,7 @@ SECTIONS
+ _edata = .;
+
+ /* will be freed after init */
+- . = ALIGN(8192); /* Init code and data */
++ . = ALIGN(PAGE_SIZE); /* Init code and data */
+ __init_begin = .;
+ .init.text : {
+ _sinittext = .;
+@@ -61,12 +62,12 @@ __init_begin = .;
+ }
+ SECURITY_INIT
+ #ifdef CONFIG_BLK_DEV_INITRD
+- . = ALIGN(8192);
++ . = ALIGN(PAGE_SIZE);
+ __initramfs_start = .;
+ .init.ramfs : { *(.init.ramfs) }
+ __initramfs_end = .;
+ #endif
+- . = ALIGN(8192);
++ . = ALIGN(PAGE_SIZE);
+ __init_end = .;
+ .data.init.task : { *(.data.init_task) }
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/mac-platform-device.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/mac-platform-device.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,20 @@
+drivers/scsi/mac_esp.c: if (MACHW_PRESENT(MAC_SCSI_96)) {
+drivers/scsi/mac_esp.c: if (MACHW_PRESENT(MAC_SCSI_96_2)) {
+include/asm-m68k/machw.h:#define MACHW_PRESENT(name) (mac_hw_present.name)
+---
+ arch/m68k/mac/platform.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- /dev/null
++++ b/arch/m68k/mac/platform.c
+@@ -0,0 +1,10 @@
++/*
++ * Copyright (C) 2007 Geert Uytterhoeven
++ *
++ * 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/platform_device.h>
++
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/net-b44-no-pci.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/net-b44-no-pci.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,26 @@
+---
+ drivers/net/b44.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/b44.c
++++ b/drivers/net/b44.c
+@@ -2233,7 +2233,9 @@ static void __devexit b44_remove_one(str
+ unregister_netdev(dev);
+ ssb_bus_may_powerdown(sdev->bus);
+ free_netdev(dev);
++#ifdef CONFIG_B44_PCI
+ ssb_pcihost_set_power_state(sdev, PCI_D3hot);
++#endif
+ ssb_set_drvdata(sdev, NULL);
+ }
+
+@@ -2262,7 +2264,9 @@ static int b44_suspend(struct ssb_device
+ b44_setup_wol(bp);
+ }
+
++#ifdef CONFIG_B44_PCI
+ ssb_pcihost_set_power_state(sdev, PCI_D3hot);
++#endif
+ return 0;
+ }
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-module-device-table.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-module-device-table.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,237 @@
+Subject: [PATCH] Add Amiga Zorro bus modalias support
+
+Add Amiga Zorro bus modalias and uevent support
+
+Signed-off-by: Geert Uytterhoeven <geert at 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-driver.c | 24 ++++++++++++++++++++++++
+ drivers/zorro/zorro-sysfs.c | 11 +++++++++++
+ include/linux/mod_devicetable.h | 10 ++++++++++
+ include/linux/zorro.h | 13 +------------
+ scripts/mod/file2alias.c | 14 ++++++++++++++
+ 12 files changed, 67 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/a2065.c
++++ b/drivers/net/a2065.c
+@@ -698,6 +698,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
+@@ -147,6 +147,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
+@@ -68,6 +68,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
+@@ -298,6 +298,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
+@@ -219,6 +219,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-driver.c
++++ b/drivers/zorro/zorro-driver.c
+@@ -137,10 +137,34 @@ static int zorro_bus_match(struct device
+ return 0;
+ }
+
++static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env)
++{
++#ifdef CONFIG_HOTPLUG
++ struct zorro_dev *z;
++
++ if (!dev)
++ return -ENODEV;
++
++ z = to_zorro_dev(dev);
++ if (!z)
++ return -ENODEV;
++
++ if (add_uevent_var(env, "ZORRO_ID=%08X", z->id) ||
++ add_uevent_var(env, "ZORRO_SLOT_NAME=%s", z->dev.bus_id) ||
++ add_uevent_var(env, "ZORRO_SLOT_ADDR=%04X", z->slotaddr) ||
++ add_uevent_var(env, "MODALIAS=" ZORRO_DEVICE_MODALIAS_FMT, z->id))
++ return -ENOMEM;
++
++ return 0;
++#else /* !CONFIG_HOTPLUG */
++ return -ENODEV;
++#endif /* !CONFIG_HOTPLUG */
++}
+
+ struct bus_type zorro_bus_type = {
+ .name = "zorro",
+ .match = zorro_bus_match,
++ .uevent = zorro_uevent,
+ .probe = zorro_device_probe,
+ .remove = zorro_device_remove,
+ };
+--- a/drivers/zorro/zorro-sysfs.c
++++ b/drivers/zorro/zorro-sysfs.c
+@@ -78,6 +78,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_DEVICE_MODALIAS_FMT "\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;
+@@ -89,6 +99,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
+@@ -380,4 +380,14 @@ struct i2c_device_id {
+ };
+
+
++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 */
++
++#define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X"
++
++
+ #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
+@@ -605,6 +605,16 @@ static int do_i2c_entry(const char *file
+ 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)
+ {
+@@ -734,6 +744,10 @@ void handle_moddevtable(struct module *m
+ do_table(symval, sym->st_size,
+ sizeof(struct i2c_device_id), "i2c",
+ do_i2c_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);
+ free(zeros);
+ }
+
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-replace-deprecated-__initcall-with-equivalent-device_initcall.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-replace-deprecated-__initcall-with-equivalent-device_initcall.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,20 @@
+Subject: [PATCH] ZORRO: Replace deprecated __initcall with equivalent device_initcall.
+
+From: Robert P. J. Day <rpjday at crashcourse.ca>
+
+ZORRO: Replace deprecated __initcall with equivalent device_initcall.
+
+Signed-off-by: Robert P. J. Day <rpjday at crashcourse.ca>
+Signed-off-by: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/zorro/proc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/zorro/proc.c
++++ b/drivers/zorro/proc.c
+@@ -158,4 +158,4 @@ static int __init zorro_proc_init(void)
+ return 0;
+ }
+
+-__initcall(zorro_proc_init);
++device_initcall(zorro_proc_init);
Added: dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-use-memory_read_from_buffer.diff
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/m68k/2.6.26/zorro-use-memory_read_from_buffer.diff Wed Jul 16 20:58:15 2008
@@ -0,0 +1,46 @@
+From akinobu.mita at gmail.com Mon Jun 2 01:32:58 2008
+Date: Mon, 02 Jun 2008 08:13:48 +0900
+From: akinobu.mita at gmail.com
+To: linux-kernel at vger.kernel.org
+Cc: Geert Uytterhoeven <geert at linux-m68k.org>
+Subject: [patch -v2 19/23] zorro: use memory_read_from_buffer
+
+Signed-off-by: Akinobu Mita <akinobu.mita at gmail.com>
+Cc: Geert Uytterhoeven <geert at linux-m68k.org>
+---
+ drivers/zorro/zorro-sysfs.c | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+--- a/drivers/zorro/zorro-sysfs.c
++++ b/drivers/zorro/zorro-sysfs.c
+@@ -15,6 +15,7 @@
+ #include <linux/zorro.h>
+ #include <linux/stat.h>
+ #include <linux/string.h>
++#include <linux/fs.h>
+
+ #include "zorro.h"
+
+@@ -56,12 +57,6 @@ static ssize_t zorro_read_config(struct
+ struct zorro_dev *z = to_zorro_dev(container_of(kobj, struct device,
+ kobj));
+ struct ConfigDev cd;
+- unsigned int size = sizeof(cd);
+-
+- if (off > size)
+- return 0;
+- if (off+count > size)
+- count = size-off;
+
+ /* Construct a ConfigDev */
+ memset(&cd, 0, sizeof(cd));
+@@ -71,8 +66,7 @@ static ssize_t zorro_read_config(struct
+ cd.cd_BoardAddr = (void *)zorro_resource_start(z);
+ cd.cd_BoardSize = zorro_resource_len(z);
+
+- memcpy(buf, (void *)&cd+off, count);
+- return count;
++ return memory_read_from_buffer(buf, count, &off, &cd, sizeof(cd));
+ }
+
+ static struct bin_attribute zorro_config_attr = {
More information about the Kernel-svn-changes
mailing list