diff -u --recursive --new-file v2.4.5/linux/CREDITS linux/CREDITS
--- v2.4.5/linux/CREDITS Fri May 25 18:28:53 2001
+++ linux/CREDITS Tue Jun 5 18:11:40 2001
@@ -1356,13 +1356,15 @@
E: davej@suse.de
W: http://www.suse.de/~davej
D: Moved PCI bridge tuning to userspace (Powertweak).
-D: Centaur/IDT Winchip/Winchip 2 tweaks.
+D: Various x86 (& clones) setup code hacking.
D: AFFS fixes for 2.3.x
-D: Misc clean ups and other random hacking.
-S: 28, Laura Street,
-S: Treforest, Pontypridd,
-S: Mid Glamorgan, CF37 1NW,
-S: Wales, United Kingdom
+D: Various Janitorial hacks. (kernel-janitor.sourceforge.net)
+S: c/o SuSE Linux UK Ltd
+S: The Kinetic Centre
+S: Theobald Street
+S: Borehamwood
+S: Herts, WD6 4PJ
+S: United Kingdom
N: Ani Joshi
E: ajoshi@shell.unixbox.com
@@ -1517,6 +1519,17 @@
S: Markham, Ontario
S: L3R 8B2
S: Canada
+
+N: Maxim Krasnyansky
+E: maxk@qualcomm.com
+W: http://vtun.sf.net
+W: http://bluez.sf.net
+D: Author of the Universal TUN/TAP driver
+D: Author of the Linux Bluetooth Subsystem (BlueZ)
+D: Various other kernel patches, cleanups and fixes
+S: 2213 La Terrace Circle
+S: San Jose, CA 95123
+S: USA
N: Andreas S. Krebs
E: akrebs@altavista.net
diff -u --recursive --new-file v2.4.5/linux/Documentation/Changes linux/Documentation/Changes
--- v2.4.5/linux/Documentation/Changes Fri May 25 18:28:53 2001
+++ linux/Documentation/Changes Tue Jun 5 18:27:19 2001
@@ -320,7 +320,7 @@
LVM toolset
-----------
-o
+o
Pcmcia-cs
---------
diff -u --recursive --new-file v2.4.5/linux/Documentation/Configure.help linux/Documentation/Configure.help
--- v2.4.5/linux/Documentation/Configure.help Fri May 25 18:28:53 2001
+++ linux/Documentation/Configure.help Mon Jun 4 16:02:56 2001
@@ -10709,9 +10709,10 @@
USB Handspring Visor Driver
CONFIG_USB_SERIAL_VISOR
- Say Y here if you want to connect to your HandSpring Visor through
- its USB docking station. See http://usbvisor.sourceforge.net for
- more information on using this driver.
+ Say Y here if you want to connect to your HandSpring Visor, Palm m500
+ or m505 through its USB docking station.
+ See http://usbvisor.sourceforge.net for more information on using this
+ driver.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
@@ -11128,12 +11129,13 @@
Microtek USB scanner support
CONFIG_USB_MICROTEK
- Say Y here if you want support for the Microtek X6USB and possibly
- some other scanners by that vendor. The scanner will appear as a
- scsi generic device to the rest of the system.
- A patched version of SANE is necessary to use the
- scanner. It's available at
- http://fachschaft.cup.uni-muenchen.de/~neukum/scanner.html
+ Say Y here if you want support for the Microtek X6USB and
+ possibly the Phantom 336CX, Phantom C6 and ScanMaker V6U(S)L.
+ Support for anything but the X6 is experimetal.
+ Please report failures and successes.
+ The scanner will appear as a scsi generic device to the rest
+ of the system. Scsi support is required for this driver to compile
+ and work. SANE 1.0.4 or newer is needed to make use of your scanner.
This driver can be compiled as a module.
USB Bluetooth support
diff -u --recursive --new-file v2.4.5/linux/Documentation/filesystems/hpfs.txt linux/Documentation/filesystems/hpfs.txt
--- v2.4.5/linux/Documentation/filesystems/hpfs.txt Fri Jul 28 12:50:51 2000
+++ linux/Documentation/filesystems/hpfs.txt Fri Jun 8 13:17:08 2001
@@ -1,5 +1,5 @@
-Read/Write HPFS 2.00
-1998-1999, Mikulas Patocka
+Read/Write HPFS 2.05
+1998-2001, Mikulas Patocka
email: mikulas@artax.karlin.mff.cuni.cz
homepage: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
@@ -269,6 +269,20 @@
Removed a lot of redundant code
2.00 Fixed a bug in rename (it was there since 1.96)
Better anti-fragmentation strategy
+2.01 Fixed problem with directory listing over NFS
+ Directory lseek now checks for proper parameters
+ Fixed race-condition in buffer code - it is in all filesystems in Linux;
+ when reading device (cat /dev/hda) while creating files on it, files
+ could be damaged
+2.02 Woraround for bug in breada in Linux. breada could cause accesses beyond
+ end of partition
+2.03 Char, block devices and pipes are correctly created
+ Fixed non-crashing race in unlink (Alexander Viro)
+ Now it works with Japanese version of OS/2
+2.04 Fixed error when ftruncate used to extend file
+2.05 Fixed crash when got mount parameters without =
+ Fixed crash when allocation of anode failed due to full disk
+ Fixed some crashes when block io or inode allocation failed
vim: set textwidth=80:
diff -u --recursive --new-file v2.4.5/linux/Documentation/filesystems/udf.txt linux/Documentation/filesystems/udf.txt
--- v2.4.5/linux/Documentation/filesystems/udf.txt Thu Mar 2 11:17:32 2000
+++ linux/Documentation/filesystems/udf.txt Wed Jun 6 10:24:10 2001
@@ -1,10 +1,10 @@
*
* ./Documentation/filesystems/udf.txt
*
-UDF Filesystem version 0.9.1
+UDF Filesystem version 0.9.4
If you encounter problems with reading UDF discs using this driver,
-please report them to linux_udf@hootie.lvld.hp.com, which is the
+please report them to linux_udf@hpesjro.fc.hp.com, which is the
developer's list.
Write support requires a block driver which supports writing. The current
@@ -23,7 +23,8 @@
noadinicb Don't embed data in the inode
shortad Use short ad's
longad Use long ad's (default)
- strict Set strict conformance (unused)
+ strict Set strict conformance
+ iocharset= Set the NLS character set
The remaining are for debugging and disaster recovery:
diff -u --recursive --new-file v2.4.5/linux/MAINTAINERS linux/MAINTAINERS
--- v2.4.5/linux/MAINTAINERS Fri May 25 18:28:53 2001
+++ linux/MAINTAINERS Wed Jun 6 10:25:21 2001
@@ -231,7 +231,7 @@
CIRRUS LOGIC GENERIC FBDEV DRIVER
P: Jeff Garzik
M: jgarzik@mandrakesoft.com
-L: linux-fbdev@vuser.vu.union.edu
+L: linux-fbdev-devel@lists.sourceforge.net
S: Odd Fixes
CIRRUS LOGIC CS4280/CS461x SOUNDDRIVER
@@ -804,9 +804,9 @@
LOGICAL VOLUME MANAGER
P: Heinz Mauelshagen
-M: linux-LVM@EZ-Darmstadt.Telekom.de
-L: linux-LVM@msede.com
-W: http://linux.msede.com/lvm
+M: mge@sistina.de
+L: linux-LVM@sistina.com
+W: http://www.sistina.com/lvm
S: Maintained
M68K
@@ -1087,9 +1087,9 @@
S: Maintained
RAGE128 FRAMEBUFFER DISPLAY DRIVER
-P: Brad Douglas
-M: brad@neruo.com
-L: linux-fbdev@vuser.vu.union.edu
+P: Ani Joshi
+M: ajoshi@shell.unixbox.com
+L: linux-fbdev-devel@lists.sourceforge.net
S: Maintained
RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
@@ -1347,8 +1347,8 @@
M: bfennema@falcon.csc.calpoly.edu
P: Dave Boynton
M: dave@trylinux.com
-L: linux_udf@hootie.lvld.hp.com
-W: http://www.trylinux.com/projects/udf/index.html
+L: linux_udf@hpesjro.fc.hp.com
+W: http://linux-udf.sourceforge.net
S: Maintained
UMSDOS FILESYSTEM
@@ -1571,6 +1571,12 @@
M: middelin@polyware.nl
W: http://www.polyware.nl/~middelin/En/hobbies.html
W: http://www.polyware.nl/~middelin/hobbies.html
+S: Maintained
+
+Bluetooth Subsystem (BlueZ)
+P: Maxim Krasnyansky
+M: maxk@qualcomm.com
+W: http://bluez.sf.net
S: Maintained
THE REST
diff -u --recursive --new-file v2.4.5/linux/Makefile linux/Makefile
--- v2.4.5/linux/Makefile Fri May 25 18:28:53 2001
+++ linux/Makefile Tue Jun 5 18:11:40 2001
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
-SUBLEVEL = 5
-EXTRAVERSION =
+SUBLEVEL = 6
+EXTRAVERSION =-pre1
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
@@ -177,6 +177,7 @@
DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o
DRIVERS-$(CONFIG_ACPI) += drivers/acpi/acpi.o
DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o
+DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o
DRIVERS := $(DRIVERS-y)
diff -u --recursive --new-file v2.4.5/linux/arch/alpha/config.in linux/arch/alpha/config.in
--- v2.4.5/linux/arch/alpha/config.in Fri May 25 18:28:53 2001
+++ linux/arch/alpha/config.in Tue Jun 5 18:11:40 2001
@@ -348,6 +348,10 @@
source drivers/usb/Config.in
source drivers/input/Config.in
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ source net/bluetooth/Config.in
+fi
+
mainmenu_option next_comment
comment 'Kernel hacking'
diff -u --recursive --new-file v2.4.5/linux/arch/alpha/kernel/core_tsunami.c linux/arch/alpha/kernel/core_tsunami.c
--- v2.4.5/linux/arch/alpha/kernel/core_tsunami.c Fri May 25 18:28:53 2001
+++ linux/arch/alpha/kernel/core_tsunami.c Sun Jun 3 16:45:55 2001
@@ -11,7 +11,6 @@
#include
#include
#include
-#include
#include
#include
@@ -21,6 +20,8 @@
#include
#include
#undef __EXTERN_INLINE
+
+#include
#include "proto.h"
#include "pci_impl.h"
diff -u --recursive --new-file v2.4.5/linux/arch/alpha/kernel/entry.S linux/arch/alpha/kernel/entry.S
--- v2.4.5/linux/arch/alpha/kernel/entry.S Fri May 25 18:28:53 2001
+++ linux/arch/alpha/kernel/entry.S Tue Jun 5 16:53:23 2001
@@ -31,7 +31,7 @@
#define TASK_STATE 0
#define TASK_FLAGS 8
#define TASK_SIGPENDING 16
-#define TASK_ADDR_LIMIT 24
+#define TASK_ADDR_LIMIT 24
#define TASK_EXEC_DOMAIN 32
#define TASK_NEED_RESCHED 40
#define TASK_PTRACE 48
@@ -576,13 +576,15 @@
.align 3
ret_from_sys_call:
cmovne $26,0,$19 /* $19 = 0 => non-restartable */
+#ifdef CONFIG_SMP
ldl $3,TASK_PROCESSOR($8)
- lda $4,irq_stat /* softirq_active */
sll $3,L1_CACHE_SHIFT,$3
+#endif
+ lda $4,irq_stat
+#ifdef CONFIG_SMP
addq $3,$4,$4
- ldq $4,0($4) /* softirq_active[32] + softirq_mask[32] */
- sll $4,32,$3
- and $4,$3,$4
+#endif
+ ldq $4,0($4) /* __softirq_pending */
bne $4,handle_softirq
ret_from_softirq:
ldq $0,SP_OFF($30)
diff -u --recursive --new-file v2.4.5/linux/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c
--- v2.4.5/linux/arch/alpha/kernel/irq.c Fri Feb 9 11:29:44 2001
+++ linux/arch/alpha/kernel/irq.c Tue Jun 5 16:53:23 2001
@@ -359,7 +359,9 @@
static void
register_irq_proc (unsigned int irq)
{
+#ifdef CONFIG_SMP
struct proc_dir_entry *entry;
+#endif
char name [MAX_NAMELEN];
if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type))
@@ -389,7 +391,9 @@
void
init_irq_proc (void)
{
+#ifdef CONFIG_SMP
struct proc_dir_entry *entry;
+#endif
int i;
/* create /proc/irq */
@@ -569,7 +573,7 @@
/*
- * do_IRQ handles all normal device IRQ's (the special
+ * handle_irq handles all normal device IRQ's (the special
* SMP cross-CPU interrupts have their own specific
* handlers).
*/
@@ -632,7 +636,7 @@
/*
* Edge triggered interrupts need to remember pending events.
* This applies to any hw interrupts that allow a second
- * instance of the same irq to arrive while we are in do_IRQ
+ * instance of the same irq to arrive while we are in handle_irq
* or in the handler. But the code here only handles the _second_
* instance of the irq, not the third or fourth. So it is mostly
* useful for irq hardware that does not mask cleanly in an
@@ -656,6 +660,9 @@
*/
desc->handler->end(irq);
spin_unlock(&desc->lock);
+
+ if (softirq_pending(cpu))
+ do_softirq();
}
/*
diff -u --recursive --new-file v2.4.5/linux/arch/alpha/kernel/smp.c linux/arch/alpha/kernel/smp.c
--- v2.4.5/linux/arch/alpha/kernel/smp.c Fri May 25 18:28:53 2001
+++ linux/arch/alpha/kernel/smp.c Tue Jun 5 16:53:23 2001
@@ -682,6 +682,9 @@
data->prof_counter = data->prof_multiplier;
irq_exit(cpu, RTC_IRQ);
+
+ if (softirq_pending(cpu))
+ do_softirq();
}
}
diff -u --recursive --new-file v2.4.5/linux/arch/alpha/kernel/sys_dp264.c linux/arch/alpha/kernel/sys_dp264.c
--- v2.4.5/linux/arch/alpha/kernel/sys_dp264.c Fri May 25 18:28:53 2001
+++ linux/arch/alpha/kernel/sys_dp264.c Sun Jun 3 16:34:41 2001
@@ -16,18 +16,15 @@
#include
#include
-#define __EXTERN_INLINE inline
-#include
-#include
-#undef __EXTERN_INLINE
-
#include
#include
#include
#include
#include
#include
+#include
#include
+#include
#include
#include "proto.h"
diff -u --recursive --new-file v2.4.5/linux/arch/alpha/kernel/sys_rawhide.c linux/arch/alpha/kernel/sys_rawhide.c
--- v2.4.5/linux/arch/alpha/kernel/sys_rawhide.c Fri Mar 2 11:12:07 2001
+++ linux/arch/alpha/kernel/sys_rawhide.c Sun Jun 3 16:51:30 2001
@@ -59,10 +59,11 @@
irq -= 16;
hose = irq / 24;
irq -= hose * 24;
+ mask = 1 << irq;
spin_lock(&rawhide_irq_lock);
- mask = cached_irq_masks[hose] |= 1 << irq;
- mask |= hose_irq_masks[hose];
+ mask |= cached_irq_masks[hose];
+ cached_irq_masks[hose] = mask;
rawhide_update_irq_hw(hose, mask);
spin_unlock(&rawhide_irq_lock);
}
@@ -75,14 +76,37 @@
irq -= 16;
hose = irq / 24;
irq -= hose * 24;
+ mask = ~(1 << irq) | hose_irq_masks[hose];
spin_lock(&rawhide_irq_lock);
- mask = cached_irq_masks[hose] &= ~(1 << irq);
- mask |= hose_irq_masks[hose];
+ mask &= cached_irq_masks[hose];
+ cached_irq_masks[hose] = mask;
rawhide_update_irq_hw(hose, mask);
spin_unlock(&rawhide_irq_lock);
}
+static void
+rawhide_mask_and_ack_irq(unsigned int irq)
+{
+ unsigned int mask, mask1, hose;
+
+ irq -= 16;
+ hose = irq / 24;
+ irq -= hose * 24;
+ mask1 = 1 << irq;
+ mask = ~mask1 | hose_irq_masks[hose];
+
+ spin_lock(&rawhide_irq_lock);
+
+ mask &= cached_irq_masks[hose];
+ cached_irq_masks[hose] = mask;
+ rawhide_update_irq_hw(hose, mask);
+
+ /* Clear the interrupt. */
+ *(vuip)MCPCIA_INT_REQ(MCPCIA_HOSE2MID(hose)) = mask1;
+
+ spin_unlock(&rawhide_irq_lock);
+}
static unsigned int
rawhide_startup_irq(unsigned int irq)
@@ -104,7 +128,7 @@
shutdown: rawhide_disable_irq,
enable: rawhide_enable_irq,
disable: rawhide_disable_irq,
- ack: rawhide_disable_irq,
+ ack: rawhide_mask_and_ack_irq,
end: rawhide_end_irq,
};
@@ -145,8 +169,12 @@
mcpcia_init_hoses();
for (hose = hose_head; hose; hose = hose->next) {
- int h = hose->index;
- rawhide_update_irq_hw(h, hose_irq_masks[h]);
+ unsigned int h = hose->index;
+ unsigned int mask = hose_irq_masks[h];
+
+ cached_irq_masks[h] = mask;
+ *(vuip)MCPCIA_INT_MASK0(MCPCIA_HOSE2MID(h)) = mask;
+ *(vuip)MCPCIA_INT_MASK1(MCPCIA_HOSE2MID(h)) = 0;
}
for (i = 16; i < 128; ++i) {
diff -u --recursive --new-file v2.4.5/linux/arch/arm/config.in linux/arch/arm/config.in
--- v2.4.5/linux/arch/arm/config.in Tue Apr 17 17:19:24 2001
+++ linux/arch/arm/config.in Tue Jun 5 18:11:40 2001
@@ -482,6 +482,9 @@
source drivers/usb/Config.in
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ source net/bluetooth/Config.in
+fi
mainmenu_option next_comment
comment 'Kernel hacking'
diff -u --recursive --new-file v2.4.5/linux/arch/cris/drivers/ide.c linux/arch/cris/drivers/ide.c
--- v2.4.5/linux/arch/cris/drivers/ide.c Fri Apr 6 10:42:55 2001
+++ linux/arch/cris/drivers/ide.c Sun Jun 3 21:17:47 2001
@@ -1,4 +1,4 @@
-/* $Id: ide.c,v 1.9 2001/03/01 13:11:18 bjornw Exp $
+/* $Id: ide.c,v 1.16 2001/04/05 08:30:07 matsfg Exp $
*
* Etrax specific IDE functions, like init and PIO-mode setting etc.
* Almost the entire ide.c is used for the rest of the Etrax ATA driver.
@@ -8,6 +8,28 @@
* Mikael Starvik (pio setup stuff)
*
* $Log: ide.c,v $
+ * Revision 1.16 2001/04/05 08:30:07 matsfg
+ * Corrected cse1 and csp0 reset.
+ *
+ * Revision 1.15 2001/04/04 14:34:06 bjornw
+ * Re-instated code that mysteriously disappeared during review updates.
+ *
+ * Revision 1.14 2001/04/04 13:45:12 matsfg
+ * Calls REG_SHADOW_SET for cse1 reset so only the resetbit is affected
+ *
+ * Revision 1.13 2001/04/04 13:26:40 matsfg
+ * memmapping is done in init.c
+ *
+ * Revision 1.12 2001/04/04 11:37:56 markusl
+ * Updated according to review remarks
+ *
+ * Revision 1.11 2001/03/29 12:49:14 matsfg
+ * Changed check for ata_tot_size from >= to >.
+ * Sets sw_len to 0 if size is exactly 65536.
+ *
+ * Revision 1.10 2001/03/16 09:39:30 matsfg
+ * Support for reset on port CSP0
+ *
* Revision 1.9 2001/03/01 13:11:18 bjornw
* 100 -> HZ
*
@@ -158,6 +180,10 @@
#define ATA_PIO0_STROBE 19
#define ATA_PIO0_HOLD 4
+static int e100_dmaproc (ide_dma_action_t func, ide_drive_t *drive);
+static void e100_ideproc (ide_ide_action_t func, ide_drive_t *drive,
+ void *buffer, unsigned int length);
+
/*
* good_dma_drives() lists the model names (from "hdparm -i")
* of drives which do not support mword2 DMA but which are
@@ -174,7 +200,7 @@
unsigned long flags;
pio = 4;
- //pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
+ /* pio = ide_get_best_pio_mode(drive, pio, 4, NULL); */
save_flags(flags);
cli();
@@ -226,10 +252,6 @@
restore_flags(flags);
}
-static int e100_dmaproc (ide_dma_action_t func, ide_drive_t *drive); /* defined below */
-static void e100_ideproc (ide_ide_action_t func, ide_drive_t *drive,
- void *buffer, unsigned int length); /* defined below */
-
void __init
init_e100_ide (void)
{
@@ -277,26 +299,23 @@
*R_GEN_CONFIG = genconfig_shadow;
#ifdef CONFIG_ETRAX_IDE_CSE1_16_RESET
-#ifndef CONFIG_CRIS_LOW_MAP
- /* remap the I/O-mapped reset-bit from CSE1 to something inside our kernel space */
- reset_addr = (unsigned long *)ioremap((unsigned long)(MEM_CSE1_START |
- MEM_NON_CACHEABLE), 16);
- *reset_addr = 0;
-#else
- /* LOW_MAP, can't do the ioremap, but it's already mapped straight over */
- reset_addr = (unsigned long *)(MEM_CSE1_START | MEM_NON_CACHEABLE);
- *reset_addr = 0;
+ init_ioremap();
+ REG_SHADOW_SET(port_cse1_addr, port_cse1_shadow, 16, 0);
#endif
+
+#ifdef CONFIG_ETRAX_IDE_CSP0_8_RESET
+ init_ioremap();
+ REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, 8, 0);
#endif
/* wait some */
-
- dummy = 1;
- dummy = 2;
- dummy = 3;
+ udelay(25);
#ifdef CONFIG_ETRAX_IDE_CSE1_16_RESET
- *reset_addr = 1 << 16;
+ REG_SHADOW_SET(port_cse1_addr, port_cse1_shadow, 16, 1);
+#endif
+#ifdef CONFIG_ETRAX_IDE_CSP0_8_RESET
+ REG_SHADOW_SET(port_csp0_addr, port_csp0_shadow, 8, 1);
#endif
#ifdef CONFIG_ETRAX_IDE_G27_RESET
*R_PORT_G_DATA = 0; /* de-assert bus-reset */
@@ -349,7 +368,6 @@
e100_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount)
{
ide_ioreg_t data_reg = IDE_DATA_REG;
- unsigned long status;
D(printk("atapi_input_bytes, dreg 0x%x, buffer 0x%x, count %d\n",
data_reg, buffer, bytecount));
@@ -376,7 +394,7 @@
/* initiate a multi word dma read using PIO handshaking */
- *R_ATA_TRANSFER_CNT = bytecount >> 1;
+ *R_ATA_TRANSFER_CNT = IO_FIELD(R_ATA_TRANSFER_CNT, count, bytecount >> 1);
*R_ATA_CTRL_DATA = data_reg |
IO_STATE(R_ATA_CTRL_DATA, rw, read) |
@@ -390,35 +408,38 @@
LED_DISK_READ(1);
WAIT_DMA(3);
LED_DISK_READ(0);
-
+
#if 0
- /* old polled transfer code */
-
- /* initiate a multi word read */
-
- *R_ATA_TRANSFER_CNT = wcount << 1;
-
- *R_ATA_CTRL_DATA = data_reg |
- IO_STATE(R_ATA_CTRL_DATA, rw, read) |
- IO_STATE(R_ATA_CTRL_DATA, src_dst, register) |
- IO_STATE(R_ATA_CTRL_DATA, handsh, pio) |
- IO_STATE(R_ATA_CTRL_DATA, multi, on) |
- IO_STATE(R_ATA_CTRL_DATA, dma_size, word);
-
- /* svinto has a latency until the busy bit actually is set */
-
- nop(); nop();
- nop(); nop();
- nop(); nop();
- nop(); nop();
- nop(); nop();
-
- /* unit should be busy during multi transfer */
- while((status = *R_ATA_STATUS_DATA) & IO_MASK(R_ATA_STATUS_DATA, busy)) {
- while(!(status & IO_MASK(R_ATA_STATUS_DATA, dav)))
- status = *R_ATA_STATUS_DATA;
- *ptr++ = (unsigned short)(status & 0xffff);
- }
+ /* old polled transfer code
+ * this should be moved into a new function that can do polled
+ * transfers if DMA is not available
+ */
+
+ /* initiate a multi word read */
+
+ *R_ATA_TRANSFER_CNT = wcount << 1;
+
+ *R_ATA_CTRL_DATA = data_reg |
+ IO_STATE(R_ATA_CTRL_DATA, rw, read) |
+ IO_STATE(R_ATA_CTRL_DATA, src_dst, register) |
+ IO_STATE(R_ATA_CTRL_DATA, handsh, pio) |
+ IO_STATE(R_ATA_CTRL_DATA, multi, on) |
+ IO_STATE(R_ATA_CTRL_DATA, dma_size, word);
+
+ /* svinto has a latency until the busy bit actually is set */
+
+ nop(); nop();
+ nop(); nop();
+ nop(); nop();
+ nop(); nop();
+ nop(); nop();
+
+ /* unit should be busy during multi transfer */
+ while((status = *R_ATA_STATUS_DATA) & IO_MASK(R_ATA_STATUS_DATA, busy)) {
+ while(!(status & IO_MASK(R_ATA_STATUS_DATA, dav)))
+ status = *R_ATA_STATUS_DATA;
+ *ptr++ = (unsigned short)(status & 0xffff);
+ }
#endif
}
@@ -426,8 +447,6 @@
e100_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount)
{
ide_ioreg_t data_reg = IDE_DATA_REG;
- unsigned short *ptr = (unsigned short *)buffer;
- unsigned long ctrl;
D(printk("atapi_output_bytes, dreg 0x%x, buffer 0x%x, count %d\n",
data_reg, buffer, bytecount));
@@ -454,7 +473,7 @@
/* initiate a multi word dma write using PIO handshaking */
- *R_ATA_TRANSFER_CNT = bytecount >> 1;
+ *R_ATA_TRANSFER_CNT = IO_FIELD(R_ATA_TRANSFER_CNT, count, bytecount >> 1);
*R_ATA_CTRL_DATA = data_reg |
IO_STATE(R_ATA_CTRL_DATA, rw, write) |
@@ -470,40 +489,42 @@
LED_DISK_WRITE(0);
#if 0
- /* old polled write code */
+ /* old polled write code - see comment in input_bytes */
- while(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy)); /* wait for busy flag */
+ /* wait for busy flag */
+ while(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy));
- /* initiate a multi word write */
+ /* initiate a multi word write */
- *R_ATA_TRANSFER_CNT = bytecount >> 1;
+ *R_ATA_TRANSFER_CNT = bytecount >> 1;
- ctrl = data_reg |
- IO_STATE(R_ATA_CTRL_DATA, rw, write) |
- IO_STATE(R_ATA_CTRL_DATA, src_dst, register) |
- IO_STATE(R_ATA_CTRL_DATA, handsh, pio) |
- IO_STATE(R_ATA_CTRL_DATA, multi, on) |
- IO_STATE(R_ATA_CTRL_DATA, dma_size, word);
-
- LED_DISK_WRITE(1);
-
- /* Etrax will set busy = 1 until the multi pio transfer has finished
- * and tr_rdy = 1 after each succesful word transfer.
- * When the last byte has been transferred Etrax will first set tr_tdy = 1
- * and then busy = 0 (not in the same cycle). If we read busy before it
- * has been set to 0 we will think that we should transfer more bytes
- * and then tr_rdy would be 0 forever. This is solved by checking busy
- * in the inner loop.
- */
-
- do {
- *R_ATA_CTRL_DATA = ctrl | *ptr++;
- while(!(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, tr_rdy)) &&
- (*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy)));
- } while(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy));
+ ctrl = data_reg |
+ IO_STATE(R_ATA_CTRL_DATA, rw, write) |
+ IO_STATE(R_ATA_CTRL_DATA, src_dst, register) |
+ IO_STATE(R_ATA_CTRL_DATA, handsh, pio) |
+ IO_STATE(R_ATA_CTRL_DATA, multi, on) |
+ IO_STATE(R_ATA_CTRL_DATA, dma_size, word);
+
+ LED_DISK_WRITE(1);
+
+ /* Etrax will set busy = 1 until the multi pio transfer has finished
+ * and tr_rdy = 1 after each succesful word transfer.
+ * When the last byte has been transferred Etrax will first set tr_tdy = 1
+ * and then busy = 0 (not in the same cycle). If we read busy before it
+ * has been set to 0 we will think that we should transfer more bytes
+ * and then tr_rdy would be 0 forever. This is solved by checking busy
+ * in the inner loop.
+ */
+
+ do {
+ *R_ATA_CTRL_DATA = ctrl | *ptr++;
+ while(!(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, tr_rdy)) &&
+ (*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy)));
+ } while(*R_ATA_STATUS_DATA & IO_MASK(R_ATA_STATUS_DATA, busy));
+
+ LED_DISK_WRITE(0);
+#endif
- LED_DISK_WRITE(0);
-#endif
}
/*
@@ -604,7 +625,7 @@
those blocks that were actually set-up for transfer.
*/
- if(ata_tot_size + size >= 131072) {
+ if(ata_tot_size + size > 131072) {
printk("too large total ATA DMA request, %d + %d!\n", ata_tot_size, size);
return 1;
}
@@ -625,7 +646,12 @@
addr += 65536;
}
/* ok we want to do IO at addr, size bytes. set up a new descriptor entry */
- ata_descrs[count].sw_len = size;
+ if(size == 65536) {
+ ata_descrs[count].sw_len = 0; /* 0 means 65536, this is a 16-bit field */
+ }
+ else {
+ ata_descrs[count].sw_len = size;
+ }
ata_descrs[count].ctrl = 0;
ata_descrs[count].buf = addr;
ata_descrs[count].next = virt_to_phys(&ata_descrs[count + 1]);
@@ -793,9 +819,11 @@
/* initiate a multi word dma read using DMA handshaking */
- *R_ATA_TRANSFER_CNT = ata_tot_size >> 1;
+ *R_ATA_TRANSFER_CNT =
+ IO_FIELD(R_ATA_TRANSFER_CNT, count, ata_tot_size >> 1);
- *R_ATA_CTRL_DATA = IDE_DATA_REG |
+ *R_ATA_CTRL_DATA =
+ IO_FIELD(R_ATA_CTRL_DATA, data, IDE_DATA_REG) |
IO_STATE(R_ATA_CTRL_DATA, rw, read) |
IO_STATE(R_ATA_CTRL_DATA, src_dst, dma) |
IO_STATE(R_ATA_CTRL_DATA, handsh, dma) |
@@ -834,9 +862,11 @@
/* initiate a multi word dma write using DMA handshaking */
- *R_ATA_TRANSFER_CNT = ata_tot_size >> 1;
+ *R_ATA_TRANSFER_CNT =
+ IO_FIELD(R_ATA_TRANSFER_CNT, count, ata_tot_size >> 1);
- *R_ATA_CTRL_DATA = IDE_DATA_REG |
+ *R_ATA_CTRL_DATA =
+ IO_FIELD(R_ATA_CTRL_DATA, data, IDE_DATA_REG) |
IO_STATE(R_ATA_CTRL_DATA, rw, write) |
IO_STATE(R_ATA_CTRL_DATA, src_dst, dma) |
IO_STATE(R_ATA_CTRL_DATA, handsh, dma) |
diff -u --recursive --new-file v2.4.5/linux/arch/i386/config.in linux/arch/i386/config.in
--- v2.4.5/linux/arch/i386/config.in Fri May 25 18:28:53 2001
+++ linux/arch/i386/config.in Tue Jun 5 18:11:40 2001
@@ -375,6 +375,10 @@
source drivers/usb/Config.in
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ source net/bluetooth/Config.in
+fi
+
mainmenu_option next_comment
comment 'Kernel hacking'
diff -u --recursive --new-file v2.4.5/linux/arch/i386/kernel/apic.c linux/arch/i386/kernel/apic.c
--- v2.4.5/linux/arch/i386/kernel/apic.c Tue Dec 5 12:43:48 2000
+++ linux/arch/i386/kernel/apic.c Mon Jun 4 15:57:49 2001
@@ -728,6 +728,9 @@
irq_enter(cpu, 0);
smp_local_timer_interrupt(regs);
irq_exit(cpu, 0);
+
+ if (softirq_pending(cpu))
+ do_softirq();
}
/*
diff -u --recursive --new-file v2.4.5/linux/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
--- v2.4.5/linux/arch/i386/kernel/entry.S Wed Nov 8 17:09:50 2000
+++ linux/arch/i386/kernel/entry.S Wed Jun 6 10:03:11 2001
@@ -203,18 +203,7 @@
call *SYMBOL_NAME(sys_call_table)(,%eax,4)
movl %eax,EAX(%esp) # save the return value
ENTRY(ret_from_sys_call)
-#ifdef CONFIG_SMP
- movl processor(%ebx),%eax
- shll $CONFIG_X86_L1_CACHE_SHIFT,%eax
- movl SYMBOL_NAME(irq_stat)(,%eax),%ecx # softirq_active
- testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx # softirq_mask
-#else
- movl SYMBOL_NAME(irq_stat),%ecx # softirq_active
- testl SYMBOL_NAME(irq_stat)+4,%ecx # softirq_mask
-#endif
- jne handle_softirq
-
-ret_with_reschedule:
+ cli # need_resched and signals atomic test
cmpl $0,need_resched(%ebx)
jne reschedule
cmpl $0,sigpending(%ebx)
@@ -258,31 +247,21 @@
ALIGN
ret_from_exception:
-#ifdef CONFIG_SMP
- GET_CURRENT(%ebx)
- movl processor(%ebx),%eax
- shll $CONFIG_X86_L1_CACHE_SHIFT,%eax
- movl SYMBOL_NAME(irq_stat)(,%eax),%ecx # softirq_active
- testl SYMBOL_NAME(irq_stat)+4(,%eax),%ecx # softirq_mask
-#else
- movl SYMBOL_NAME(irq_stat),%ecx # softirq_active
- testl SYMBOL_NAME(irq_stat)+4,%ecx # softirq_mask
-#endif
- jne handle_softirq
+ cli
+ cmpl $0,need_resched(%ebx)
+ jne reschedule
+ cmpl $0,sigpending(%ebx)
+ jne signal_return
+ jmp restore_all
ENTRY(ret_from_intr)
GET_CURRENT(%ebx)
movl EFLAGS(%esp),%eax # mix EFLAGS and CS
movb CS(%esp),%al
testl $(VM_MASK | 3),%eax # return to VM86 mode or non-supervisor?
- jne ret_with_reschedule
+ jne ret_from_sys_call
jmp restore_all
- ALIGN
-handle_softirq:
- call SYMBOL_NAME(do_softirq)
- jmp ret_from_intr
-
ALIGN
reschedule:
call SYMBOL_NAME(schedule) # test
diff -u --recursive --new-file v2.4.5/linux/arch/i386/kernel/io_apic.c linux/arch/i386/kernel/io_apic.c
--- v2.4.5/linux/arch/i386/kernel/io_apic.c Fri Feb 9 11:28:31 2001
+++ linux/arch/i386/kernel/io_apic.c Thu Jun 7 00:12:45 2001
@@ -255,10 +255,16 @@
*/
static int pin_2_irq(int idx, int apic, int pin);
-int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pci_pin)
+int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
{
int apic, i, best_guess = -1;
+ Dprintk("querying PCI -> IRQ mapping bus:%d, slot:%d, pin:%d.\n",
+ bus, slot, pin);
+ if (mp_bus_id_to_pci_bus[bus] == -1) {
+ printk(KERN_WARNING "PCI BIOS passed nonexistent PCI bus %d!\n", bus);
+ return -1;
+ }
for (i = 0; i < mp_irq_entries; i++) {
int lbus = mp_irqs[i].mpc_srcbus;
@@ -269,14 +275,14 @@
if ((mp_bus_id_to_type[lbus] == MP_BUS_PCI) &&
!mp_irqs[i].mpc_irqtype &&
- (bus == mp_bus_id_to_pci_bus[mp_irqs[i].mpc_srcbus]) &&
+ (bus == lbus) &&
(slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) {
int irq = pin_2_irq(i,apic,mp_irqs[i].mpc_dstirq);
if (!(apic || IO_APIC_IRQ(irq)))
continue;
- if (pci_pin == (mp_irqs[i].mpc_srcbusirq & 3))
+ if (pin == (mp_irqs[i].mpc_srcbusirq & 3))
return irq;
/*
* Use the first all-but-pin matching entry as a
@@ -728,9 +734,11 @@
printk(KERN_DEBUG ".... register #01: %08X\n", *(int *)®_01);
printk(KERN_DEBUG "....... : max redirection entries: %04X\n", reg_01.entries);
if ( (reg_01.entries != 0x0f) && /* older (Neptune) boards */
+ (reg_01.entries != 0x11) &&
(reg_01.entries != 0x17) && /* typical ISA+PCI boards */
(reg_01.entries != 0x1b) && /* Compaq Proliant boards */
(reg_01.entries != 0x1f) && /* dual Xeon boards */
+ (reg_01.entries != 0x20) &&
(reg_01.entries != 0x22) && /* bigger Xeon boards */
(reg_01.entries != 0x2E) &&
(reg_01.entries != 0x3F)
@@ -1426,7 +1434,7 @@
pin1 = find_isa_irq_pin(0, mp_INT);
pin2 = find_isa_irq_pin(0, mp_ExtINT);
- printk(KERN_INFO "..TIMER: vector=%d pin1=%d pin2=%d\n", vector, pin1, pin2);
+ printk(KERN_INFO "..TIMER: vector=%02X pin1=%d pin2=%d\n", vector, pin1, pin2);
if (pin1 != -1) {
/*
diff -u --recursive --new-file v2.4.5/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- v2.4.5/linux/arch/i386/kernel/irq.c Fri Feb 9 11:29:44 2001
+++ linux/arch/i386/kernel/irq.c Mon Jun 4 15:57:49 2001
@@ -623,7 +623,7 @@
desc->handler->end(irq);
spin_unlock(&desc->lock);
- if (softirq_active(cpu) & softirq_mask(cpu))
+ if (softirq_pending(cpu))
do_softirq();
return 1;
}
diff -u --recursive --new-file v2.4.5/linux/arch/i386/kernel/mpparse.c linux/arch/i386/kernel/mpparse.c
--- v2.4.5/linux/arch/i386/kernel/mpparse.c Tue Nov 14 21:25:34 2000
+++ linux/arch/i386/kernel/mpparse.c Mon Jun 4 15:57:21 2001
@@ -36,7 +36,7 @@
*/
int apic_version [MAX_APICS];
int mp_bus_id_to_type [MAX_MP_BUSSES];
-int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { -1, };
+int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 };
int mp_current_pci_id;
int pic_mode;
unsigned long mp_lapic_addr;
diff -u --recursive --new-file v2.4.5/linux/arch/i386/kernel/pci-irq.c linux/arch/i386/kernel/pci-irq.c
--- v2.4.5/linux/arch/i386/kernel/pci-irq.c Fri May 25 18:28:53 2001
+++ linux/arch/i386/kernel/pci-irq.c Mon Jun 4 15:57:21 2001
@@ -656,10 +656,12 @@
if (pin) {
pin--; /* interrupt pins are numbered starting from 1 */
irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
-/*
- * Will be removed completely if things work out well with fuzzy parsing
- */
-#if 0
+ /*
+ * Busses behind bridges are typically not listed in the MP-table.
+ * In this case we have to look up the IRQ based on the parent bus,
+ * parent slot, and pin number. The SMP code detects such bridged
+ * busses itself so we should get into this branch reliably.
+ */
if (irq < 0 && dev->bus->parent) { /* go back to the bridge */
struct pci_dev * bridge = dev->bus->self;
@@ -670,7 +672,6 @@
printk(KERN_WARNING "PCI: using PPB(B%d,I%d,P%d) to get irq %d\n",
bridge->bus->number, PCI_SLOT(bridge->devfn), pin, irq);
}
-#endif
if (irq >= 0) {
printk(KERN_INFO "PCI->APIC IRQ transform: (B%d,I%d,P%d) -> %d\n",
dev->bus->number, PCI_SLOT(dev->devfn), pin, irq);
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/Makefile linux/arch/m68k/Makefile
--- v2.4.5/linux/arch/m68k/Makefile Thu Jan 4 13:00:55 2001
+++ linux/arch/m68k/Makefile Tue Jun 5 18:27:19 2001
@@ -110,8 +110,8 @@
endif
ifdef CONFIG_SUN3X
-CORE_FILES := $(CORE_FILES) arch/m68k/sun3x/sun3x.o
-SUBDIRS := $(SUBDIRS) arch/m68k/sun3x
+CORE_FILES := $(CORE_FILES) arch/m68k/sun3x/sun3x.o arch/m68k/sun3/sun3.o
+SUBDIRS := $(SUBDIRS) arch/m68k/sun3x arch/m68k/sun3
endif
ifdef CONFIG_SUN3
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/amiga/amisound.c linux/arch/m68k/amiga/amisound.c
--- v2.4.5/linux/arch/m68k/amiga/amisound.c Thu Jan 4 13:00:55 2001
+++ linux/arch/m68k/amiga/amisound.c Tue Jun 5 18:27:19 2001
@@ -16,7 +16,7 @@
#include
#include
-static u_short *snd_data = NULL;
+static unsigned short *snd_data = NULL;
static const signed char sine_data[] = {
0, 39, 75, 103, 121, 127, 121, 103, 75, 39,
0, -39, -75, -103, -121, -127, -121, -103, -75, -39
@@ -28,7 +28,7 @@
* device since it depends on htotal (for OCS/ECS/AGA)
*/
-volatile u_short amiga_audio_min_period = 124; /* Default for pre-OCS */
+volatile unsigned short amiga_audio_min_period = 124; /* Default for pre-OCS */
#define MAX_PERIOD (65535)
@@ -37,9 +37,9 @@
* Current period (set by dmasound.c)
*/
-u_short amiga_audio_period = MAX_PERIOD;
+unsigned short amiga_audio_period = MAX_PERIOD;
-static u_long clock_constant;
+static unsigned long clock_constant;
void __init amiga_init_sound(void)
{
@@ -76,7 +76,7 @@
del_timer( &sound_timer );
if (hz > 20 && hz < 32767) {
- u_long period = (clock_constant / hz);
+ unsigned long period = (clock_constant / hz);
if (period < amiga_audio_min_period)
period = amiga_audio_min_period;
@@ -86,7 +86,7 @@
/* setup pointer to data, period, length and volume */
custom.aud[2].audlc = snd_data;
custom.aud[2].audlen = sizeof(sine_data)/2;
- custom.aud[2].audper = (u_short)period;
+ custom.aud[2].audper = (unsigned short)period;
custom.aud[2].audvol = 32; /* 50% of maxvol */
if (ticks) {
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/amiga/cia.c linux/arch/m68k/amiga/cia.c
--- v2.4.5/linux/arch/m68k/amiga/cia.c Mon Nov 27 17:57:34 2000
+++ linux/arch/m68k/amiga/cia.c Tue Jun 5 18:27:20 2001
@@ -23,8 +23,8 @@
struct ciabase {
volatile struct CIA *cia;
- u_char icr_mask, icr_data;
- u_short int_mask;
+ unsigned char icr_mask, icr_data;
+ unsigned short int_mask;
int handler_irq, cia_irq, server_irq;
char *name;
irq_handler_t irq_list[CIA_IRQS];
@@ -46,7 +46,7 @@
unsigned char cia_set_irq(struct ciabase *base, unsigned char mask)
{
- u_char old;
+ unsigned char old;
old = (base->icr_data |= base->cia->icr);
if (mask & CIA_ICR_SETCLR)
@@ -65,7 +65,7 @@
unsigned char cia_able_irq(struct ciabase *base, unsigned char mask)
{
- u_char old, tmp;
+ unsigned char old, tmp;
int i;
old = base->icr_mask;
@@ -91,7 +91,7 @@
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id)
{
- u_char mask;
+ unsigned char mask;
base->irq_list[irq].handler = handler;
base->irq_list[irq].flags = flags;
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/amiga/config.c linux/arch/m68k/amiga/config.c
--- v2.4.5/linux/arch/m68k/amiga/config.c Fri Apr 13 20:26:07 2001
+++ linux/arch/m68k/amiga/config.c Tue Jun 5 18:27:20 2001
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -31,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/amiga/pcmcia.c linux/arch/m68k/amiga/pcmcia.c
--- v2.4.5/linux/arch/m68k/amiga/pcmcia.c Thu Dec 17 09:06:25 1998
+++ linux/arch/m68k/amiga/pcmcia.c Tue Jun 5 18:27:20 2001
@@ -19,7 +19,7 @@
#include
/* gayle config byte for program voltage and access speed */
-static u_char cfg_byte = GAYLE_CFG_0V|GAYLE_CFG_150NS;
+static unsigned char cfg_byte = GAYLE_CFG_0V|GAYLE_CFG_150NS;
void pcmcia_reset(void)
{
@@ -64,7 +64,7 @@
void pcmcia_program_voltage(int voltage)
{
- u_char v;
+ unsigned char v;
switch (voltage) {
case PCMCIA_0V:
@@ -87,7 +87,7 @@
void pcmcia_access_speed(int speed)
{
- u_char s;
+ unsigned char s;
if (speed <= PCMCIA_SPEED_100NS)
s = GAYLE_CFG_100NS;
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/apollo/config.c linux/arch/m68k/apollo/config.c
--- v2.4.5/linux/arch/m68k/apollo/config.c Wed Jan 26 12:44:20 2000
+++ linux/arch/m68k/apollo/config.c Tue Jun 5 18:27:20 2001
@@ -2,7 +2,6 @@
#include
#include
#include
-#include
#include
#include
@@ -12,6 +11,7 @@
#include
#include
#include
+#include
#include
u_long sio01_physaddr;
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/atari/time.c linux/arch/m68k/atari/time.c
--- v2.4.5/linux/arch/m68k/atari/time.c Thu Aug 26 12:42:31 1999
+++ linux/arch/m68k/atari/time.c Tue Jun 5 18:27:20 2001
@@ -12,10 +12,10 @@
#include
#include
-#include
#include
#include
+#include
void __init
atari_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/bvme6000/config.c linux/arch/m68k/bvme6000/config.c
--- v2.4.5/linux/arch/m68k/bvme6000/config.c Mon Jan 31 10:32:53 2000
+++ linux/arch/m68k/bvme6000/config.c Tue Jun 5 18:27:20 2001
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -30,6 +29,7 @@
#include
#include
#include
+#include
#include
#include
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/bvme6000/rtc.c linux/arch/m68k/bvme6000/rtc.c
--- v2.4.5/linux/arch/m68k/bvme6000/rtc.c Fri Feb 9 11:29:44 2001
+++ linux/arch/m68k/bvme6000/rtc.c Tue Jun 5 18:27:20 2001
@@ -76,7 +76,7 @@
unsigned char mon, day, hrs, min, sec, leap_yr;
unsigned int yrs;
- if (!suser())
+ if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/config.in linux/arch/m68k/config.in
--- v2.4.5/linux/arch/m68k/config.in Fri May 25 18:28:53 2001
+++ linux/arch/m68k/config.in Tue Jun 5 18:27:20 2001
@@ -55,8 +55,8 @@
if [ "$CONFIG_HP300" = "y" ]; then
bool ' DIO bus support' CONFIG_DIO
fi
-bool 'Sun3 support' CONFIG_SUN3
bool 'Sun3x support' CONFIG_SUN3X
+bool 'Sun3 support' CONFIG_SUN3
bool 'Q40/Q60 support' CONFIG_Q40
@@ -112,7 +112,7 @@
bool 'Support for ST-RAM as swap space' CONFIG_STRAM_SWAP
bool 'ST-RAM statistics in /proc' CONFIG_STRAM_PROC
fi
-if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_ATARI" = "y" ]; then
+if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_ATARI" = "y" -o "$CONFIG_Q40" = "y" ]; then
bool 'Use power LED as a heartbeat' CONFIG_HEARTBEAT
else
if [ "$CONFIG_HP300" = "y" ]; then
@@ -142,13 +142,17 @@
fi
dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
if [ "$CONFIG_PRINTER" != "n" ]; then
- bool ' Support IEEE1284 status readback' CONFIG_PRINTER_READBACK
+ bool ' Support IEEE1284 status readback' CONFIG_PARPORT_1284
fi
fi
source drivers/pci/Config.in
source drivers/zorro/Config.in
+if [ "$CONFIG_Q40" = "y" ]; then
+source drivers/pnp/Config.in
+fi
+
endmenu
source drivers/mtd/Config.in
@@ -264,11 +268,11 @@
fi
if [ "$CONFIG_SUN3" = "y" ]; then
- dep_tristate 'Sun3 NCR5380 SCSI' CONFIG_SUN3_SCSI $CONFIG_SCSI
+ dep_tristate 'Sun3 NCR5380 OBIO SCSI' CONFIG_SUN3_SCSI $CONFIG_SCSI
fi
if [ "$CONFIG_SUN3X" = "y" ]; then
- bool 'ESP SCSI driver' CONFIG_SUN3X_ESP
+ bool 'Sun3x ESP SCSI' CONFIG_SUN3X_ESP
fi
endmenu
@@ -338,6 +342,9 @@
if [ "$CONFIG_SUN3" = "y" -o "$CONFIG_SUN3X" = "y" ]; then
tristate ' Sun3/Sun3x on-board LANCE support' CONFIG_SUN3LANCE
fi
+ if [ "$CONFIG_SUN3" = "y" ]; then
+ tristate ' Sun3 on-board Intel 82586 support' CONFIG_SUN3_82586
+ fi
if [ "$CONFIG_HP300" = "y" ]; then
bool ' HP on-board LANCE support' CONFIG_HPLANCE
fi
@@ -367,7 +374,6 @@
if [ "$CONFIG_SERIAL_EXTENDED" = "y" ]; then
bool ' Support more than 4 serial ports' CONFIG_SERIAL_MANY_PORTS
bool ' Support for sharing serial interrupts' CONFIG_SERIAL_SHARE_IRQ
-# bool ' Autodetect IRQ - do not yet enable !!' CONFIG_SERIAL_DETECT_IRQ
bool ' Support special multiport boards' CONFIG_SERIAL_MULTIPORT
bool ' Support the Bell Technologies HUB6 card' CONFIG_HUB6
fi
@@ -451,16 +457,16 @@
else
define_bool CONFIG_SUN3X_ZS n
fi
-dep_bool ' Sun keyboard support' CONFIG_SUN_KEYBOARD $CONFIG_SUN3X_ZS
-dep_bool ' Sun mouse support' CONFIG_SUN_MOUSE $CONFIG_SUN3X_ZS
-if [ "$CONFIG_SUN_MOUSE" = "y" ]; then
- define_bool CONFIG_BUSMOUSE y
-fi
if [ "$CONFIG_SUN3X_ZS" = "y" ]; then
+ define_bool CONFIG_SUN_KEYBOARD y
+ define_bool CONFIG_SUN_MOUSE y
+ define_bool CONFIG_BUSMOUSE y
define_bool CONFIG_SBUS y
define_bool CONFIG_SBUSCHAR y
define_bool CONFIG_SUN_SERIAL y
else
+ define_bool CONFIG_SUN_KEYBOARD n
+ define_bool CONFIG_SUN_MOUSE n
define_bool CONFIG_SBUS n
fi
@@ -508,9 +514,6 @@
else
bool 'Generic /dev/rtc emulation' CONFIG_GEN_RTC
fi
-fi
-if [ "$CONFIG_Q40" = "y" ]; then
- bool 'Q40 Real Time Clock Support' CONFIG_Q40RTC
fi
bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/kernel/head.S linux/arch/m68k/kernel/head.S
--- v2.4.5/linux/arch/m68k/kernel/head.S Tue Mar 6 19:44:36 2001
+++ linux/arch/m68k/kernel/head.S Tue Jun 5 18:27:20 2001
@@ -1178,8 +1178,45 @@
#ifdef CONFIG_SUN3X
is_not_sun3x(L(notsun3x))
+ /* oh, the pain.. We're gonna want the prom code after
+ * starting the MMU, so we copy the mappings, translating
+ * from 8k -> 4k pages as we go.
+ */
+
+ /* copy maps from 0xfee00000 to 0xff000000 */
+ movel #0xfee00000, %d0
+ moveq #ROOT_INDEX_SHIFT, %d1
+ lsrl %d1,%d0
+ mmu_get_root_table_entry %d0
+
+ movel #0xfee00000, %d0
+ moveq #PTR_INDEX_SHIFT, %d1
+ lsrl %d1,%d0
+ andl #PTR_TABLE_SIZE-1, %d0
+ mmu_get_ptr_table_entry %a0,%d0
+
+ movel #0xfee00000, %d0
+ moveq #PAGE_INDEX_SHIFT, %d1
+ lsrl %d1,%d0
+ andl #PAGE_TABLE_SIZE-1, %d0
+ mmu_get_page_table_entry %a0,%d0
+
+ /* this is where the prom page table lives */
+ movel 0xfefe00d4, %a1
+ movel %a1@, %a1
+
+ movel #((0x200000 >> 13)-1), %d1
+
+1:
+ movel %a1@+, %d3
+ movel %d3,%a0@+
+ addl #0x1000,%d3
+ movel %d3,%a0@+
+
+ dbra %d1,1b
+
/* setup tt1 for I/O */
- mmu_map_tt #1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S
+ mmu_map_tt #1,#0x40000000,#0x40000000,#_PAGE_NOCACHE_S
jbra L(mmu_init_done)
L(notsun3x):
@@ -1363,7 +1400,7 @@
is_not_sun3x(1f)
/* enable copro */
- oriw #0x4000,0x61000000
+ oriw #0x4000,0x61000000
1:
#endif
@@ -3061,6 +3098,16 @@
2:
#endif
+#ifdef CONFIG_SUN3X
+ is_not_sun3x(2f)
+ movel %d0,-(%sp)
+ movel 0xFEFE0018,%a1
+ jbsr (%a1)
+ addq #4,%sp
+ jbra L(serial_putc_done)
+2:
+#endif
+
#ifdef CONFIG_Q40
is_not_q40(2f)
tst.l %pc@(L(q40_do_debug)) /* only debug if requested */
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/kernel/ptrace.c linux/arch/m68k/kernel/ptrace.c
--- v2.4.5/linux/arch/m68k/kernel/ptrace.c Mon Nov 27 18:02:06 2000
+++ linux/arch/m68k/kernel/ptrace.c Tue Jun 5 18:27:20 2001
@@ -107,15 +107,19 @@
ret = -ESRCH;
read_lock(&tasklist_lock);
child = find_task_by_pid(pid);
- read_unlock(&tasklist_lock); /* FIXME!!! */
+ if (child)
+ get_task_struct(child);
+ read_unlock(&tasklist_lock);
if (!child)
goto out;
+
ret = -EPERM;
if (pid == 1) /* you may not mess with init */
- goto out;
+ goto out_tsk;
+
if (request == PTRACE_ATTACH) {
if (child == current)
- goto out;
+ goto out_tsk;
if ((!child->dumpable ||
(current->uid != child->euid) ||
(current->uid != child->suid) ||
@@ -124,10 +128,10 @@
(current->gid != child->sgid) ||
(!cap_issubset(child->cap_permitted, current->cap_permitted)) ||
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
- goto out;
+ goto out_tsk;
/* the same process cannot be attached many times */
if (child->ptrace & PT_PTRACED)
- goto out;
+ goto out_tsk;
child->ptrace |= PT_PTRACED;
write_lock_irqsave(&tasklist_lock, flags);
@@ -140,17 +144,17 @@
send_sig(SIGSTOP, child, 1);
ret = 0;
- goto out;
+ goto out_tsk;
}
ret = -ESRCH;
if (!(child->ptrace & PT_PTRACED))
- goto out;
+ goto out_tsk;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
- goto out;
+ goto out_tsk;
}
if (child->p_pptr != current)
- goto out;
+ goto out_tsk;
switch (request) {
/* when I and D space are separate, these will need to be fixed. */
@@ -162,9 +166,9 @@
copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
ret = -EIO;
if (copied != sizeof(tmp))
- goto out;
+ break;
ret = put_user(tmp,(unsigned long *) data);
- goto out;
+ break;
}
/* read the word at location addr in the USER area. */
@@ -172,8 +176,9 @@
unsigned long tmp;
ret = -EIO;
- if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
- goto out;
+ if ((addr & 3) || addr < 0 ||
+ addr > sizeof(struct user) - 3)
+ break;
tmp = 0; /* Default return condition */
addr = addr >> 2; /* temporary hack. */
@@ -193,9 +198,9 @@
((tmp & 0x0000ffff) << 16);
#endif
} else
- goto out;
+ break;
ret = put_user(tmp,(unsigned long *) data);
- goto out;
+ break;
}
/* when I and D space are separate, this will have to be fixed. */
@@ -203,14 +208,15 @@
case PTRACE_POKEDATA:
ret = 0;
if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
- goto out;
+ break;
ret = -EIO;
- goto out;
+ break;
case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
ret = -EIO;
- if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
- goto out;
+ if ((addr & 3) || addr < 0 ||
+ addr > sizeof(struct user) - 3)
+ break;
addr = addr >> 2; /* temporary hack. */
@@ -221,9 +227,9 @@
}
if (addr < 19) {
if (put_reg(child, addr, data))
- goto out;
+ break;
ret = 0;
- goto out;
+ break;
}
if (addr >= 21 && addr < 48)
{
@@ -240,7 +246,7 @@
child->thread.fp[addr - 21] = data;
ret = 0;
}
- goto out;
+ break;
case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
case PTRACE_CONT: { /* restart after signal. */
@@ -248,7 +254,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
- goto out;
+ break;
if (request == PTRACE_SYSCALL)
child->ptrace |= PT_TRACESYS;
else
@@ -259,7 +265,7 @@
put_reg(child, PT_SR, tmp);
wake_up_process(child);
ret = 0;
- goto out;
+ break;
}
/*
@@ -272,13 +278,13 @@
ret = 0;
if (child->state == TASK_ZOMBIE) /* already dead */
- goto out;
+ break;
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
wake_up_process(child);
- goto out;
+ break;
}
case PTRACE_SINGLESTEP: { /* set the trap flag. */
@@ -286,7 +292,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
- goto out;
+ break;
child->ptrace &= ~PT_TRACESYS;
tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
@@ -295,7 +301,7 @@
/* give it a chance to run. */
wake_up_process(child);
ret = 0;
- goto out;
+ break;
}
case PTRACE_DETACH: { /* detach a process that was attached. */
@@ -303,7 +309,7 @@
ret = -EIO;
if ((unsigned long) data > _NSIG)
- goto out;
+ break;
child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
@@ -316,7 +322,7 @@
put_reg(child, PT_SR, tmp);
wake_up_process(child);
ret = 0;
- goto out;
+ break;
}
case PTRACE_GETREGS: { /* Get all gp regs from the child. */
@@ -328,12 +334,12 @@
tmp >>= 16;
if (put_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
- goto out;
+ break;
}
data += sizeof(long);
}
ret = 0;
- goto out;
+ break;
}
case PTRACE_SETREGS: { /* Set all gp regs in the child. */
@@ -342,7 +348,7 @@
for (i = 0; i < 19; i++) {
if (get_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
- goto out;
+ break;
}
if (i == PT_SR) {
tmp &= SR_MASK;
@@ -353,7 +359,7 @@
data += sizeof(long);
}
ret = 0;
- goto out;
+ break;
}
case PTRACE_GETFPREGS: { /* Get the child FPU state. */
@@ -361,7 +367,7 @@
if (copy_to_user((void *)data, &child->thread.fp,
sizeof(struct user_m68kfp_struct)))
ret = -EFAULT;
- goto out;
+ break;
}
case PTRACE_SETFPREGS: { /* Set the child FPU state. */
@@ -369,13 +375,15 @@
if (copy_from_user(&child->thread.fp, (void *)data,
sizeof(struct user_m68kfp_struct)))
ret = -EFAULT;
- goto out;
+ break;
}
default:
ret = -EIO;
- goto out;
+ break;
}
+out_tsk:
+ free_task_struct(child);
out:
unlock_kernel();
return ret;
@@ -383,10 +391,9 @@
asmlinkage void syscall_trace(void)
{
- lock_kernel();
if ((current->ptrace & (PT_PTRACED|PT_TRACESYS))
!= (PT_PTRACED|PT_TRACESYS))
- goto out;
+ return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
@@ -400,6 +407,4 @@
send_sig(current->exit_code, current, 1);
current->exit_code = 0;
}
-out:
- unlock_kernel();
}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/kernel/setup.c linux/arch/m68k/kernel/setup.c
--- v2.4.5/linux/arch/m68k/kernel/setup.c Fri Apr 13 20:26:07 2001
+++ linux/arch/m68k/kernel/setup.c Tue Jun 5 18:27:20 2001
@@ -34,6 +34,10 @@
#ifdef CONFIG_ATARI
#include
#endif
+#ifdef CONFIG_SUN3X
+#include
+extern void sun_serial_setup(void);
+#endif
#ifdef CONFIG_BLK_DEV_INITRD
#include
@@ -106,6 +110,11 @@
char *mach_sysrq_xlate = NULL;
#endif
+#if defined(CONFIG_ISA)
+int isa_type;
+int isa_sex;
+#endif
+
extern int amiga_parse_bootinfo(const struct bi_record *);
extern int atari_parse_bootinfo(const struct bi_record *);
extern int mac_parse_bootinfo(const struct bi_record *);
@@ -137,7 +146,7 @@
{
while (record->tag != BI_LAST) {
int unknown = 0;
- const u_long *data = record->data;
+ const unsigned long *data = record->data;
switch (record->tag) {
case BI_MACHTYPE:
case BI_CPUTYPE:
@@ -186,7 +195,7 @@
if (unknown)
printk("m68k_parse_bootinfo: unknown tag 0x%04x ignored\n",
record->tag);
- record = (struct bi_record *)((u_long)record+record->size);
+ record = (struct bi_record *)((unsigned long)record+record->size);
}
m68k_realnum_memory = m68k_num_memory;
@@ -365,14 +374,44 @@
if (MACH_IS_ATARI)
atari_stram_reserve_pages(availmem);
#endif
+#ifdef CONFIG_SUN3X
+ if (MACH_IS_SUN3X) {
+ dvma_init();
+#ifdef CONFIG_SUN3X_ZS
+ sun_serial_setup();
+#endif
+ }
+#endif
+
#endif /* !CONFIG_SUN3 */
+
paging_init();
+
+/* set ISA defs early as possible */
+#if defined(CONFIG_ISA)
+#if defined(CONFIG_Q40)
+ if (MACH_IS_Q40) {
+ isa_type = Q40_ISA;
+ isa_sex = 0;
+ }
+#elif defined(CONFIG_GG2)
+ if (MACH_IS_AMIGA && AMIGAHW_PRESENT(GG2_ISA)){
+ isa_type = GG2_ISA;
+ isa_sex = 0;
+ }
+#elif defined(CONFIG_AMIGA_PCMCIA)
+ if (MACH_IS_AMIGA && AMIGAHW_PRESENT(PCMCIA)){
+ isa_type = AG_ISA;
+ isa_sex = 1;
+ }
+#endif
+#endif
}
int get_cpuinfo(char * buffer)
{
const char *cpu, *mmu, *fpu;
- u_long clockfreq, clockfactor;
+ unsigned long clockfreq, clockfactor;
#define LOOP_CYCLES_68020 (8)
#define LOOP_CYCLES_68030 (8)
@@ -447,7 +486,7 @@
{
int len = 0;
char model[80];
- u_long mem;
+ unsigned long mem;
int i;
if (mach_get_model)
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/kernel/sys_m68k.c linux/arch/m68k/kernel/sys_m68k.c
--- v2.4.5/linux/arch/m68k/kernel/sys_m68k.c Mon Mar 19 12:35:09 2001
+++ linux/arch/m68k/kernel/sys_m68k.c Tue Jun 5 18:27:20 2001
@@ -267,7 +267,8 @@
return -ENOSYS;
}
-/* Convert virtual address VADDR to physical address PADDR */
+
+/* Convert virtual (user) address VADDR to physical address PADDR */
#define virt_to_phys_040(vaddr) \
({ \
unsigned long _mmusr, _paddr; \
@@ -447,6 +448,12 @@
{
unsigned long paddr, i;
+ /*
+ * 68060 manual says:
+ * cpush %dc : flush DC, remains valid (with our %cacr setup)
+ * cpush %ic : invalidate IC
+ * cpush %bc : flush DC + invalidate IC
+ */
switch (scope)
{
case FLUSH_SCOPE_ALL:
@@ -455,20 +462,17 @@
case FLUSH_CACHE_DATA:
__asm__ __volatile__ (".chip 68060\n\t"
"cpusha %dc\n\t"
- "cinva %dc\n\t"
".chip 68k");
break;
case FLUSH_CACHE_INSN:
__asm__ __volatile__ (".chip 68060\n\t"
"cpusha %ic\n\t"
- "cinva %ic\n\t"
".chip 68k");
break;
default:
case FLUSH_CACHE_BOTH:
__asm__ __volatile__ (".chip 68060\n\t"
"cpusha %bc\n\t"
- "cinva %bc\n\t"
".chip 68k");
break;
}
@@ -506,14 +510,12 @@
case FLUSH_CACHE_DATA:
__asm__ __volatile__ (".chip 68060\n\t"
"cpushl %%dc,(%0)\n\t"
- "cinvl %%dc,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
break;
case FLUSH_CACHE_INSN:
__asm__ __volatile__ (".chip 68060\n\t"
"cpushl %%ic,(%0)\n\t"
- "cinvl %%ic,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
break;
@@ -521,7 +523,6 @@
case FLUSH_CACHE_BOTH:
__asm__ __volatile__ (".chip 68060\n\t"
"cpushl %%bc,(%0)\n\t"
- "cinvl %%bc,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
break;
@@ -568,14 +569,12 @@
case FLUSH_CACHE_DATA:
__asm__ __volatile__ (".chip 68060\n\t"
"cpushp %%dc,(%0)\n\t"
- "cinvp %%dc,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
break;
case FLUSH_CACHE_INSN:
__asm__ __volatile__ (".chip 68060\n\t"
"cpushp %%ic,(%0)\n\t"
- "cinvp %%ic,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
break;
@@ -583,7 +582,6 @@
case FLUSH_CACHE_BOTH:
__asm__ __volatile__ (".chip 68060\n\t"
"cpushp %%bc,(%0)\n\t"
- "cinvp %%bc,(%0)\n\t"
".chip 68k"
: : "a" (paddr));
break;
@@ -607,13 +605,14 @@
goto out;
if (scope == FLUSH_SCOPE_ALL) {
- /* Only the superuser may flush the whole cache. */
+ /* Only the superuser may explicitly flush the whole cache. */
ret = -EPERM;
if (!capable(CAP_SYS_ADMIN))
goto out;
} else {
- /* Verify that the specified address region actually belongs to
- * this process.
+ /*
+ * Verify that the specified address region actually belongs
+ * to this process.
*/
vma = find_vma (current->mm, addr);
ret = -EINVAL;
@@ -652,10 +651,21 @@
}
ret = 0;
goto out;
- } else if (CPU_IS_040) {
+ } else {
+ /*
+ * 040 or 060: don't blindly trust 'scope', someone could
+ * try to flush a few megs of memory.
+ */
+
+ if (len>=3*PAGE_SIZE && scope=10*PAGE_SIZE && scopeun.fmt7.faddr = current->thread.faddr;
+ fp->un.fmt7.faddr = wba;
fp->un.fmt7.ssw = wbs & 0xff;
+ if (wba != current->thread.faddr)
+ fp->un.fmt7.ssw |= MA_040;
}
static inline void do_040writebacks(struct frame *fp)
@@ -312,7 +331,7 @@
res = do_040writeback1(fp->un.fmt7.wb2s, fp->un.fmt7.wb2a,
fp->un.fmt7.wb2d);
if (res)
- fix_xframe040(fp, fp->un.fmt7.wb2s);
+ fix_xframe040(fp, fp->un.fmt7.wb2a, fp->un.fmt7.wb2s);
else
fp->un.fmt7.wb2s = 0;
}
@@ -322,7 +341,14 @@
res = do_040writeback1(fp->un.fmt7.wb3s, fp->un.fmt7.wb3a,
fp->un.fmt7.wb3d);
if (res)
- fix_xframe040(fp, fp->un.fmt7.wb3s);
+ {
+ fix_xframe040(fp, fp->un.fmt7.wb3a, fp->un.fmt7.wb3s);
+
+ fp->un.fmt7.wb2s = fp->un.fmt7.wb3s;
+ fp->un.fmt7.wb3s &= (~WBV_040);
+ fp->un.fmt7.wb2a = fp->un.fmt7.wb3a;
+ fp->un.fmt7.wb2d = fp->un.fmt7.wb3d;
+ }
else
fp->un.fmt7.wb3s = 0;
}
@@ -339,19 +365,15 @@
*/
asmlinkage void berr_040cleanup(struct frame *fp)
{
- mm_segment_t old_fs = get_fs();
-
fp->un.fmt7.wb2s &= ~4;
fp->un.fmt7.wb3s &= ~4;
do_040writebacks(fp);
- set_fs(old_fs);
}
static inline void access_error040(struct frame *fp)
{
unsigned short ssw = fp->un.fmt7.ssw;
- mm_segment_t old_fs = get_fs();
unsigned long mmusr;
#ifdef DEBUG
@@ -374,9 +396,8 @@
if (ssw & MA_040)
addr = (addr + 7) & -8;
- set_fs(MAKE_MM_SEG(ssw));
/* MMU error, get the MMUSR info for this access */
- mmusr = probe040(!(ssw & RW_040), addr);
+ mmusr = probe040(!(ssw & RW_040), addr, ssw);
#ifdef DEBUG
printk("mmusr = %lx\n", mmusr);
#endif
@@ -386,8 +407,12 @@
__flush_tlb040_one(addr);
errorcode = 0;
}
- if (!(ssw & RW_040))
+
+ /* despite what documentation seems to say, RMW
+ * accesses have always both the LK and RW bits set */
+ if (!(ssw & RW_040) || (ssw & LK_040))
errorcode |= 2;
+
if (do_page_fault(&fp->ptregs, addr, errorcode)) {
#ifdef DEBUG
printk("do_page_fault() !=0 \n");
@@ -415,7 +440,6 @@
}
do_040writebacks(fp);
- set_fs(old_fs);
}
#endif /* CONFIG_M68040 */
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mac/config.c linux/arch/m68k/mac/config.c
--- v2.4.5/linux/arch/m68k/mac/config.c Sun Dec 3 17:48:19 2000
+++ linux/arch/m68k/mac/config.c Tue Jun 5 18:27:20 2001
@@ -13,7 +13,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -31,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
@@ -78,8 +78,6 @@
extern void (*kd_mksound)(unsigned int, unsigned int);
extern void mac_mksound(unsigned int, unsigned int);
-extern int mac_floppy_init(void);
-extern void mac_floppy_setup(char *,int *);
extern void nubus_sweep_video(void);
@@ -122,8 +120,6 @@
}
#endif
-extern struct fb_info *mac_fb_init(long *);
-
extern void mac_default_handler(int, void *, struct pt_regs *);
void (*mac_handlers[8])(int, void *, struct pt_regs *)=
@@ -387,8 +383,7 @@
{ MAC_MODEL_P460, "Performa 460", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS},
{ MAC_MODEL_P475, "Performa 475", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS},
{ MAC_MODEL_P475F, "Performa 475", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS},
- { MAC_MODEL_P520, "Performa 520", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS},
-
+ { MAC_MODEL_P520, "Performa 520", MAC_ADB_CUDA, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS},
{ MAC_MODEL_P550, "Performa 550", MAC_ADB_CUDA, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS},
{ MAC_MODEL_P575, "Performa 575", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS},
/* These have the comm slot, and therefore the possibility of SONIC ethernet */
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mac/debug.c linux/arch/m68k/mac/debug.c
--- v2.4.5/linux/arch/m68k/mac/debug.c Thu Oct 12 14:20:48 2000
+++ linux/arch/m68k/mac/debug.c Tue Jun 5 18:27:20 2001
@@ -187,7 +187,7 @@
-/* Mac: loops_per_sec min. 1900000 ^= .5 us; MFPDELAY was 0.6 us*/
+/* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/
#define uSEC 1
@@ -286,9 +286,9 @@
barrier(); \
} while(0)
-/* loops_per_sec isn't initialized yet, so we can't use udelay(). This does a
+/* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a
* delay of ~ 60us. */
-/* Mac: loops_per_sec min. 1900000 ^= .5 us; MFPDELAY was 0.6 us*/
+/* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/
#define LONG_DELAY() \
do { \
int i; \
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mac/iop.c linux/arch/m68k/mac/iop.c
--- v2.4.5/linux/arch/m68k/mac/iop.c Sun Feb 13 11:21:42 2000
+++ linux/arch/m68k/mac/iop.c Tue Jun 5 18:27:20 2001
@@ -51,9 +51,6 @@
* IOP hasn't died.
* o Some of the IOP manager routines need better error checking and
* return codes. Nothing major, just prettying up.
- *
- * + share the stuff you were smoking when you wrote the iop_get_proc_info()
- * for case when CONFIG_PROC_FS is undefined.
*/
/*
@@ -129,9 +126,6 @@
#ifdef CONFIG_PROC_FS
static int iop_get_proc_info(char *, char **, off_t, int);
-#else
-/* What the bloody hell is THAT ??? */
-static int iop_get_proc_info(char *, char **, off_t, int) {}
#endif /* CONFIG_PROC_FS */
/* structure for tracking channel listeners */
@@ -307,7 +301,11 @@
iop_listeners[IOP_NUM_ISM][i].handler = NULL;
}
- create_proc_info_entry("mac_iop",0,0,iop_get_proc_info);
+#if 0 /* Crashing in 2.4 now, not yet sure why. --jmt */
+#ifdef CONFIG_PROC_FS
+ create_proc_info_entry("mac_iop", 0, &proc_root, iop_get_proc_info);
+#endif
+#endif
}
/*
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mac/macints.c linux/arch/m68k/mac/macints.c
--- v2.4.5/linux/arch/m68k/mac/macints.c Sun Dec 3 17:48:19 2000
+++ linux/arch/m68k/mac/macints.c Tue Jun 5 18:27:20 2001
@@ -129,9 +129,13 @@
#include
#include
#include
+#include
#include
+#define DEBUG_SPURIOUS
+#define SHUTUP_SONIC
+
/*
* The mac_irq_list array is an array of linked lists of irq_node_t nodes.
* Each node contains one handler to be called whenever the interrupt
@@ -233,6 +237,17 @@
scc_mask = 0;
+ /* Make sure the SONIC interrupt is cleared or things get ugly */
+#ifdef SHUTUP_SONIC
+ printk("Killing onboard sonic... ");
+ /* This address should hopefully be mapped already */
+ if (hwreg_present((void*)(0x50f0a000))) {
+ *(long *)(0x50f0a014) = 0x7fffL;
+ *(long *)(0x50f0a010) = 0L;
+ }
+ printk("Done.\n");
+#endif /* SHUTUP_SONIC */
+
/*
* Now register the handlers for the the master IRQ handlers
* at levels 1-7. Most of the work is done elsewhere.
@@ -627,9 +642,7 @@
void mac_default_handler(int irq, void *dev_id, struct pt_regs *regs)
{
#ifdef DEBUG_SPURIOUS
- if (console_loglevel > 6) {
- printk("Unexpected IRQ %d on device %p\n", irq, dev_id);
- }
+ printk("Unexpected IRQ %d on device %p\n", irq, dev_id);
#endif
}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mac/misc.c linux/arch/m68k/mac/misc.c
--- v2.4.5/linux/arch/m68k/mac/misc.c Fri Feb 9 11:29:44 2001
+++ linux/arch/m68k/mac/misc.c Tue Jun 5 18:27:20 2001
@@ -2,7 +2,6 @@
* Miscellaneous Mac68K-specific stuff
*/
-#include
#include
#include
#include
@@ -12,7 +11,7 @@
#include
#include
#include
-#include
+
#include
#include
@@ -21,6 +20,7 @@
#include
#include
+#include
#include
#include
#include
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mac/psc.c linux/arch/m68k/mac/psc.c
--- v2.4.5/linux/arch/m68k/mac/psc.c Sun Dec 3 17:48:19 2000
+++ linux/arch/m68k/mac/psc.c Tue Jun 5 18:27:20 2001
@@ -139,7 +139,6 @@
int irq_bit,i;
unsigned char events;
- irq -= VEC_SPUR;
base_irq = irq << 3;
#ifdef DEBUG_IRQS
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mac/via.c linux/arch/m68k/mac/via.c
--- v2.4.5/linux/arch/m68k/mac/via.c Sun Dec 3 17:45:20 2000
+++ linux/arch/m68k/mac/via.c Tue Jun 5 18:27:20 2001
@@ -410,8 +410,6 @@
int irq_bit, i;
unsigned char events, mask;
- irq -= VEC_SPUR;
-
mask = via1[vIER] & 0x7F;
if (!(events = via1[vIFR] & mask)) return;
@@ -423,6 +421,7 @@
via1[vIER] = irq_bit | 0x80;
}
+#if 0 /* freakin' pmu is doing weird stuff */
if (!oss_present) {
/* This (still) seems to be necessary to get IDE
working. However, if you enable VBL interrupts,
@@ -435,14 +434,13 @@
mac_do_irq_list(IRQ_MAC_NUBUS, regs);
via_irq_enable(IRQ_MAC_NUBUS);
}
+#endif
}
void via2_irq(int irq, void *dev_id, struct pt_regs *regs)
{
int irq_bit, i;
unsigned char events, mask;
-
- irq -= VEC_SPUR;
mask = via2[gIER] & 0x7F;
if (!(events = via2[gIFR] & mask)) return;
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/math-emu/multi_arith.h linux/arch/m68k/math-emu/multi_arith.h
--- v2.4.5/linux/arch/m68k/math-emu/multi_arith.h Sun Aug 15 11:47:29 1999
+++ linux/arch/m68k/math-emu/multi_arith.h Tue Jun 5 18:27:20 2001
@@ -329,7 +329,7 @@
int carry;
/* we assume here, gcc only insert move and a clr instr */
- asm volatile ("add.b %1,%0" : "=d,=g" (dest->lowmant)
+ asm volatile ("add.b %1,%0" : "=d,g" (dest->lowmant)
: "g,d" (src->lowmant), "0,0" (dest->lowmant));
asm volatile ("addx.l %1,%0" : "=d" (dest->mant.m32[1])
: "d" (src->mant.m32[1]), "0" (dest->mant.m32[1]));
@@ -360,7 +360,7 @@
extern inline void fp_submant(struct fp_ext *dest, struct fp_ext *src1, struct fp_ext *src2)
{
/* we assume here, gcc only insert move and a clr instr */
- asm volatile ("sub.b %1,%0" : "=d,=g" (dest->lowmant)
+ asm volatile ("sub.b %1,%0" : "=d,g" (dest->lowmant)
: "g,d" (src2->lowmant), "0,0" (src1->lowmant));
asm volatile ("subx.l %1,%0" : "=d" (dest->mant.m32[1])
: "d" (src2->mant.m32[1]), "0" (src1->mant.m32[1]));
@@ -383,7 +383,7 @@
})
#define fp_addx96(dest, src) ({ \
/* we assume here, gcc only insert move and a clr instr */ \
- asm volatile ("add.l %1,%0" : "=d,=g" (dest->m32[2]) \
+ asm volatile ("add.l %1,%0" : "=d,g" (dest->m32[2]) \
: "g,d" (temp.m32[1]), "0,0" (dest->m32[2])); \
asm volatile ("addx.l %1,%0" : "=d" (dest->m32[1]) \
: "d" (temp.m32[0]), "0" (dest->m32[1])); \
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mm/init.c linux/arch/m68k/mm/init.c
--- v2.4.5/linux/arch/m68k/mm/init.c Mon Oct 16 12:58:51 2000
+++ linux/arch/m68k/mm/init.c Tue Jun 5 18:27:20 2001
@@ -32,11 +32,7 @@
#include
#endif
-static unsigned long totalram_pages;
-
-#ifdef CONFIG_SUN3
-void mmu_emu_reserve_pages(unsigned long max_page);
-#endif
+unsigned long totalram_pages = 0;
int do_check_pgt_cache(int low, int high)
{
@@ -86,7 +82,7 @@
void show_mem(void)
{
unsigned long i;
- int free = 0, total = 0, reserved = 0, nonshared = 0, shared = 0;
+ int free = 0, total = 0, reserved = 0, shared = 0;
int cached = 0;
printk("\nMem-info:\n");
@@ -101,15 +97,12 @@
cached++;
else if (!page_count(mem_map+i))
free++;
- else if (page_count(mem_map+i) == 1)
- nonshared++;
else
shared += page_count(mem_map+i) - 1;
}
printk("%d pages of RAM\n",total);
printk("%d free pages\n",free);
printk("%d reserved pages\n",reserved);
- printk("%d pages nonshared\n",nonshared);
printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size);
@@ -137,17 +130,11 @@
#ifdef CONFIG_ATARI
if (MACH_IS_ATARI)
- atari_stram_reserve_pages( start_mem );
-#endif
-
-#ifdef CONFIG_SUN3
- /* reserve rom pages */
- mmu_emu_reserve_pages(max_mapnr);
+ atari_stram_mem_init_hook();
#endif
/* this will put all memory onto the freelists */
totalram_pages = free_all_bootmem();
- printk("tp:%ld\n", totalram_pages);
for (tmp = PAGE_OFFSET ; tmp < (unsigned long)high_memory; tmp += PAGE_SIZE) {
#if 0
@@ -201,13 +188,15 @@
#ifdef CONFIG_BLK_DEV_INITRD
void free_initrd_mem(unsigned long start, unsigned long end)
{
+ int pages = 0;
for (; start < end; start += PAGE_SIZE) {
ClearPageReserved(virt_to_page(start));
set_page_count(virt_to_page(start), 1);
free_page(start);
totalram_pages++;
+ pages++;
}
- printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
+ printk ("Freeing initrd memory: %dk freed\n", pages);
}
#endif
@@ -220,15 +209,8 @@
val->sharedram = 0;
val->freeram = nr_free_pages();
val->bufferram = atomic_read(&buffermem_pages);
- while (i-- > 0) {
- if (PageReserved(mem_map+i))
- continue;
- val->totalram++;
- if (!page_count(mem_map+i))
- continue;
- val->sharedram += page_count(mem_map+i) - 1;
- }
val->totalhigh = 0;
val->freehigh = 0;
+ val->mem_unit = PAGE_SIZE;
return;
}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mm/memory.c linux/arch/m68k/mm/memory.c
--- v2.4.5/linux/arch/m68k/mm/memory.c Fri May 25 18:28:53 2001
+++ linux/arch/m68k/mm/memory.c Tue Jun 5 18:27:20 2001
@@ -39,6 +39,7 @@
pgd_set(pgd, (pmd_t *)BAD_PAGETABLE);
}
+#if 0
pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset)
{
pte_t *pte;
@@ -63,7 +64,9 @@
}
return (pte_t *)__pmd_page(*pmd) + offset;
}
+#endif
+#if 0
pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long offset)
{
pmd_t *pmd;
@@ -84,7 +87,7 @@
}
return (pmd_t *)__pgd_page(*pgd) + offset;
}
-
+#endif
/* ++andreas: {get,free}_pointer_table rewritten to use unused fields from
struct page instead of separately kmalloced struct. Stolen from
@@ -250,6 +253,10 @@
if (voff == 0)
return m68k_memory[i-1].addr + m68k_memory[i-1].size;
+ /* As a special case allow `__pa(high_memory)'. */
+ if (voff == 0)
+ return m68k_memory[i-1].addr + m68k_memory[i-1].size;
+
return mm_vtop_fallback(vaddr);
}
#endif
@@ -454,16 +461,21 @@
".chip 68k" \
: : "a" (paddr))
-/* push and invalidate page in both caches */
+/* push and invalidate page in both caches, must disable ints
+ * to avoid invalidating valid data */
#define pushcl040(paddr) \
- do { push040(paddr); \
+ do { unsigned long flags; \
+ save_flags(flags); \
+ cli(); \
+ push040(paddr); \
if (CPU_IS_060) clear040(paddr); \
+ restore_flags(flags); \
} while(0)
/* push page in both caches, invalidate in i-cache */
+/* RZ: cpush %bc DOES invalidate %ic, regardless of DPI */
#define pushcli040(paddr) \
do { push040(paddr); \
- if (CPU_IS_060) cleari040(paddr); \
} while(0)
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mvme147/config.c linux/arch/m68k/mvme147/config.c
--- v2.4.5/linux/arch/m68k/mvme147/config.c Mon Nov 27 17:11:26 2000
+++ linux/arch/m68k/mvme147/config.c Tue Jun 5 18:27:20 2001
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -29,6 +28,7 @@
#include
#include
#include
+#include
#include
#include
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mvme16x/config.c linux/arch/m68k/mvme16x/config.c
--- v2.4.5/linux/arch/m68k/mvme16x/config.c Mon Jan 31 10:32:53 2000
+++ linux/arch/m68k/mvme16x/config.c Tue Jun 5 18:27:20 2001
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -30,11 +29,10 @@
#include
#include
#include
+#include
#include
#include
-int atari_SCC_reset_done = 1; /* So SCC doesn't get reset */
-u_long atari_mch_cookie = 0;
extern t_bdid mvme_bdid;
static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE;
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/mvme16x/rtc.c linux/arch/m68k/mvme16x/rtc.c
--- v2.4.5/linux/arch/m68k/mvme16x/rtc.c Fri Feb 9 11:29:44 2001
+++ linux/arch/m68k/mvme16x/rtc.c Tue Jun 5 18:27:20 2001
@@ -72,7 +72,7 @@
unsigned char mon, day, hrs, min, sec, leap_yr;
unsigned int yrs;
- if (!suser())
+ if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/q40/README linux/arch/m68k/q40/README
--- v2.4.5/linux/arch/m68k/q40/README Tue Mar 6 19:44:36 2001
+++ linux/arch/m68k/q40/README Tue Jun 5 18:27:20 2001
@@ -3,43 +3,48 @@
You may try http://www.geocities.com/SiliconValley/Bay/2602/ for
some up to date information. Booter and other tools will be also
-available from this place and ftp.uni-erlangen.de/linux/680x0/q40/
+available from this place or ftp.uni-erlangen.de/linux/680x0/q40/
and mirrors.
Hints to documentation usually refer to the linux source tree in
/usr/src/linux/Documentation unless URL given.
-It seems IRQ unmasking can't be safely done on a Q40. Autoprobing is
-not yet implemented - do not try it! (See below)
+It seems IRQ unmasking can't be safely done on a Q40. IRQ probing
+is not implemented - do not try it! (See below)
-For a list of kernel commandline options read the documentation for the
+For a list of kernel command-line options read the documentation for the
particular device drivers.
The floppy imposes a very high interrupt load on the CPU, approx 30K/s.
When something blocks interrupts (HD) it will loose some of them, so far
-this is not known to have caused any data loss. On hihgly loaded systems
-it can make the floppy very slow or practicaly stop. Other Q40 OS' simply
+this is not known to have caused any data loss. On highly loaded systems
+it can make the floppy very slow or practically stop. Other Q40 OS' simply
poll the floppy for this reason - something that can't be done in Linux.
-Only possible cure is getting a 82072 contoler with fifo instead of
-the 8272A
+Only possible cure is getting a 82072 controller with fifo instead of
+the 8272A.
-drivers used by the Q40, appart from the very obvious (console etc.):
+drivers used by the Q40, apart from the very obvious (console etc.):
drivers/char/q40_keyb.c # use PC keymaps for national keyboards
serial.c # normal PC driver - any speed
lp.c # printer driver
- char/joystick/* # most of this should work
+ genrtc.c # RTC
+ char/joystick/* # most of this should work, not
+ # in default config.in
block/q40ide.c # startup for ide
ide* # see Documentation/ide.txt
floppy.c # normal PC driver, DMA emu in asm/floppy.h
# and arch/m68k/kernel/entry.S
# see drivers/block/README.fd
+ net/ne.c
video/q40fb.c
- misc/parport_pc.c
+ parport/*
+ sound/dmasound_core.c
+ dmasound_q40.c
Various other PC drivers can be enabled simply by adding them to
arch/m68k/config.in, especially 8 bit devices should be without any
problems. For cards using 16bit io/mem more care is required, like
-checking byteorder issues, hacking memcpy_*_io etc.
+checking byte order issues, hacking memcpy_*_io etc.
Debugging
@@ -47,7 +52,7 @@
Upon startup the kernel will usually output "ABCQGHIJ" into the SRAM,
preceded by the booter signature. This is a trace just in case something
-went wrong during earliest setup stages.
+went wrong during earliest setup stages of head.S.
**Changed** to preserve SRAM contents by default, this is only done when
requested - SRAM must start with '%LX$' signature to do this. '-d' option
to 'lxx' loader enables this.
@@ -55,13 +60,15 @@
SRAM can also be used as additional console device, use debug=mem.
This will save kernel startup msgs into SRAM, the screen will display
only the penguin - and shell prompt if it gets that far..
+Unfortunately only 2000 bytes are available.
Serial console works and can also be used for debugging, see loader_txt
Most problems seem to be caused by fawlty or badly configured io-cards or
-harddrives anyway..there are so many things that can go wrong here.
-Make sure to configure the parallel port as SPP for first testing..the
-Q40 may have trouble with parallel interrupts.
+hard drives anyway.
+Make sure to configure the parallel port as SPP and remove IRQ/DMA jumpers
+for first testing. The Q40 does not support DMA and may have trouble with
+parallel ports version of interrupts.
Q40 Hardware Description
@@ -71,30 +78,27 @@
questions.
The Q40 consists of a 68040@40 MHz, 1MB video RAM, up to 32MB RAM, AT-style
-keyboard interface, 1 Programmable LED, 2 8bit DACs and up to 1MB ROM, 1MB
+keyboard interface, 1 Programmable LED, 2x8bit DACs and up to 1MB ROM, 1MB
shadow ROM.
+The Q60 has any of 68060 or 68LC060 and up to 128 MB RAM.
-Most interfacing like floppy, hd, serial, parallel ports is done via ISA
+Most interfacing like floppy, IDE, serial and parallel ports is done via ISA
slots. The ISA io and mem range is mapped (sparse&byteswapped!) into separate
regions of the memory.
The main interrupt register IIRQ_REG will indicate whether an IRQ was internal
or from some ISA devices, EIRQ_REG can distinguish up to 8 ISA IRQs.
The Q40 custom chip is programmable to provide 2 periodic timers:
- - 50 or 200 Hz - level 2,
- - 10 or 20 KHz - level 4
- !!THIS CANT BE DISABLED!!
-
+ - 50 or 200 Hz - level 2, !!THIS CANT BE DISABLED!!
+ - 10 or 20 KHz - level 4, used for dma-sound
+
Linux uses the 200 Hz interrupt for timer and beep by default.
Interrupts
==========
-q40 master chip handles only level triggered interrupts :-((
-
-IRQ sharing is not yet implemented but this should be only a minor
-problem..
+q40 master chip handles only a subset of level triggered interrupts.
Linux has some requirements wrt interrupt architecture, these are
to my knowledge:
@@ -103,27 +107,28 @@
(b) working enable/disable_irq
Luckily these requirements are only important for drivers shared
-with other architectures - ide,serial,parallel, ethernet..
+with other architectures - ide,serial,parallel, ethernet.
q40ints.c now contains a trivial hack for (a), (b) is more difficult
-because only irq's 4-15 can be disabled - and only all o them at once.
+because only irq's 4-15 can be disabled - and only all of them at once.
Thus disable_irq() can effectively block the machine if the driver goes
asleep.
-One thing to keep in minde when hacking around the interrupt code is
-that there is no way to find out which IRQ caused a request.
+One thing to keep in mind when hacking around the interrupt code is
+that there is no way to find out which IRQ caused a request, [EI]IRQ_REG
+displays current state of the various IRQ lines.
Keyboard
========
q40 receives AT make/break codes from the keyboard, these are translated to
the PC scancodes x86 Linux uses. So by theory every national keyboard should
-work just by loading the apropriate x86 keytable - see any national-HOWTO.
+work just by loading the appropriate x86 keytable - see any national-HOWTO.
Unfortunately the AT->PC translation isn't quite trivial and even worse, my
documentation of it is absolutely minimal - thus some exotic keys may not
behave exactly as expected.
There is still hope that it can be fixed completely though. If you encounter
-problems, email me idealy this:
+problems, email me ideally this:
- exact keypress/release sequence
- 'showkey -s' run on q40, non-X session
- 'showkey -s' run on a PC, non-X session
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/q40/config.c linux/arch/m68k/q40/config.c
--- v2.4.5/linux/arch/m68k/q40/config.c Fri Apr 6 10:42:48 2001
+++ linux/arch/m68k/q40/config.c Tue Jun 5 18:27:20 2001
@@ -13,11 +13,9 @@
*/
#include
-#include
#include
#include
#include
-#include
#include
#include
#include
@@ -25,6 +23,7 @@
#include
#include
+#include
#include
#include
#include
@@ -32,6 +31,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -39,6 +39,8 @@
extern void floppy_eject(void);
extern void floppy_setup(char *str, int *ints);
+extern int q40kbd_translate(unsigned char scancode, unsigned char *keycode,
+ char raw_mode);
extern void q40_process_int (int level, struct pt_regs *regs);
extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */
extern void q40_init_IRQ (void);
@@ -50,16 +52,17 @@
static int q40_get_hardware_list(char *buffer);
extern int q40_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id);
extern void q40_sched_init(void (*handler)(int, void *, struct pt_regs *));
-extern int q40_keyb_init(void);
-extern int q40_kbdrate (struct kbd_repeat *);
+
extern unsigned long q40_gettimeoffset (void);
extern void q40_gettod (int *year, int *mon, int *day, int *hour,
int *min, int *sec);
extern int q40_hwclk (int, struct hwclk_time *);
extern int q40_set_clock_mmss (unsigned long);
extern void q40_reset (void);
+void q40_halt(void);
extern void q40_waitbut(void);
void q40_set_vectors (void);
+
extern void (*kd_mksound)(unsigned int, unsigned int);
void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/ );
@@ -67,16 +70,9 @@
extern char m68k_debug_device[];
static void q40_mem_console_write(struct console *co, const char *b,
unsigned int count);
-#if 0
-extern int ql_ticks=0;
-extern int sound_ticks=0;
-#endif
extern int ql_ticks;
-static unsigned char bcd2bin (unsigned char b);
-static unsigned char bin2bcd (unsigned char b);
-
static int q40_wait_key(struct console *co){return 0;}
static struct console q40_console_driver = {
name: "debug",
@@ -90,11 +86,13 @@
extern char *q40_mem_cptr; /*=(char *)0xff020000;*/
static int _cpleft;
+#if 0
int q40_kbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode)
{
*keycodep = keycode;
return 1;
}
+#endif
static void q40_mem_console_write(struct console *co, const char *s,
unsigned int count)
@@ -130,13 +128,36 @@
}
#endif
-void q40_reset()
+static int halted=0;
+
+#ifdef CONFIG_HEARTBEAT
+static void q40_heartbeat(int on)
{
+ if (halted) return;
+ if (on)
+ Q40_LED_ON();
+ else
+ Q40_LED_OFF();
+}
+#endif
+
+void q40_reset()
+{
+ halted=1;
printk ("\n\n*******************************************\n"
"Called q40_reset : press the RESET button!! \n"
"*******************************************\n");
-
+ Q40_LED_ON();
+ while(1) ;
+}
+void q40_halt()
+{
+ halted=1;
+ printk ("\n\n*******************\n"
+ " Called q40_halt\n"
+ "*******************\n");
+ Q40_LED_ON();
while(1) ;
}
@@ -202,17 +223,17 @@
void __init config_q40(void)
{
- mach_sched_init = q40_sched_init; /* ok */
- /*mach_kbdrate = q40_kbdrate;*/ /* unneeded ?*/
- mach_keyb_init = q40_keyb_init; /* OK */
- mach_kbd_translate = q40_kbd_translate;
+ mach_sched_init = q40_sched_init;
+
+ mach_keyb_init = q40kbd_init_hw;
+ mach_kbd_translate = q40kbd_translate;
mach_init_IRQ = q40_init_IRQ;
mach_gettimeoffset = q40_gettimeoffset;
mach_gettod = q40_gettod;
mach_hwclk = q40_hwclk;
mach_set_clock_mmss = q40_set_clock_mmss;
-/* mach_mksound = q40_mksound; */
- mach_reset = q40_reset; /* use reset button instead !*/
+
+ mach_reset = q40_reset;
mach_free_irq = q40_free_irq;
mach_process_int = q40_process_int;
mach_get_irq_list = q40_get_irq_list;
@@ -220,26 +241,28 @@
enable_irq = q40_enable_irq;
disable_irq = q40_disable_irq;
mach_default_handler = &q40_sys_default_handler;
- mach_get_model = q40_get_model; /* no use..*/
- mach_get_hardware_list = q40_get_hardware_list; /* no use */
+ mach_get_model = q40_get_model;
+ mach_get_hardware_list = q40_get_hardware_list;
kd_mksound = q40_mksound;
- /*mach_kbd_leds = q40kbd_leds;*/
+
#ifdef CONFIG_MAGIC_SYSRQ
mach_sysrq_key = 0x54;
#endif
- conswitchp = &dummy_con;
-#if 0 /*def CONFIG_BLK_DEV_FD*/
- mach_floppy_setup = floppy_setup;
- mach_floppy_eject = floppy_eject;
- /**/
+#ifdef CONFIG_HEARTBEAT
+ mach_heartbeat = q40_heartbeat;
#endif
+ mach_halt = q40_halt;
+ conswitchp = &dummy_con;
+ /* disable a few things that SMSQ might have left enabled */
q40_disable_irqs();
- mach_max_dma_address = 32*1024*1024; /* no DMA at all, but ide-scsi requires it.. */
+ /* no DMA at all, but ide-scsi requires it.. make sure
+ * all physical RAM fits into the boundary - otherwise
+ * allocator may play costly and useless tricks */
+ mach_max_dma_address = 1024*1024*1024;
-/* useful for early debugging stages - writes kernel messages into SRAM */
-
+ /* useful for early debugging stages - writes kernel messages into SRAM */
if (!strncmp( m68k_debug_device,"mem",3 ))
{
/*printk("using NVRAM debug, q40_mem_cptr=%p\n",q40_mem_cptr);*/
@@ -252,109 +275,24 @@
int q40_parse_bootinfo(const struct bi_record *rec)
{
- return 1; /* unknown */
+ return 1;
}
-#if 0
-#define DAC_LEFT ((unsigned char *)0xff008000)
-#define DAC_RIGHT ((unsigned char *)0xff008004)
-void q40_mksound(unsigned int hz, unsigned int ticks)
-{
- /* for now ignore hz, except that hz==0 switches off sound */
- /* simply alternate the ampl 0-255-0-.. at 200Hz */
- if (hz==0)
- {
- if (sound_ticks)
- sound_ticks=1; /* atomic - no irq spinlock used */
-
- *DAC_LEFT=0;
- *DAC_RIGHT=0;
- return;
- }
- /* sound itself is done in q40_timer_int */
- if (sound_ticks == 0) sound_ticks=1000; /* pretty long beep */
- sound_ticks=ticks<<1;
-}
-
-static void (*q40_timer_routine)(int, void *, struct pt_regs *);
-static short rtc_oldsecs=0;
-unsigned rtc_irq_flags=0;
-unsigned rtc_irq_ctrl=0;
-
-static void q40_timer_int (int irq, void *dev_id, struct pt_regs *fp)
-{
-#if (HZ==10000)
- master_outb(-1,SAMPLE_CLEAR_REG);
-#else /* must be 50 or 100 */
- master_outb(-1,FRAME_CLEAR_REG);
-#endif
-
-#if (HZ==100)
- ql_ticks = ql_ticks ? 0 : 1;
- if (sound_ticks)
- {
- unsigned char sval=(sound_ticks & 1) ? 0 : 255;
- sound_ticks--;
- *DAC_LEFT=sval;
- *DAC_RIGHT=sval;
- }
-#ifdef CONFIG_Q40RTC
- if (rtc_irq_ctrl && (rtc_oldsecs != RTC_SECS))
- {
- rtc_oldsecs = RTC_SECS;
- rtc_irq_flags = RTC_UIE;
- rtc_interrupt();
- }
-#endif
- if (ql_ticks) return;
-#endif
- q40_timer_routine(irq, dev_id, fp);
+static inline unsigned char bcd2bin (unsigned char b)
+{
+ return ((b>>4)*10 + (b&15));
}
-#endif
-#if 0
-extern void (*q40_timer_routine)(int, void *, struct pt_regs *);
-extern void q40_timer_int();
-
-void q40_sched_init (void (*timer_routine)(int, void *, struct pt_regs *))
+static inline unsigned char bin2bcd (unsigned char b)
{
- int timer_irq;
-
- q40_timer_routine = timer_routine;
-
-#if (HZ==10000)
- timer_irq=Q40_IRQ_TIMER;
-#else
- timer_irq=Q40_IRQ_FRAME;
-#endif
-
- /*printk("registering sched/timer IRQ %d\n", timer_irq);*/
-
- if (request_irq(timer_irq, q40_timer_int, 0,
- "timer", q40_timer_int))
- panic ("Couldn't register timer int");
-
-#if (HZ==10000)
- master_outb(SAMPLE_LOW,SAMPLE_RATE_REG);
- master_outb(-1,SAMPLE_CLEAR_REG);
- master_outb(1,SAMPLE_ENABLE_REG);
-#else
- master_outb(-1,FRAME_CLEAR_REG); /* not necessary ? */
-#if (HZ==100)
- master_outb( 1,FRAME_RATE_REG);
-#endif
-#endif
+ return (((b/10)*16) + (b%10));
}
-#endif
+
unsigned long q40_gettimeoffset (void)
{
-#if (HZ==100)
return 5000*(ql_ticks!=0);
-#else
- return 0;
-#endif
}
extern void q40_gettod (int *year, int *mon, int *day, int *hour,
@@ -362,7 +300,7 @@
{
RTC_CTRL |= RTC_READ;
*year = bcd2bin (RTC_YEAR);
- *mon = bcd2bin (RTC_MNTH)-1;
+ *mon = bcd2bin (RTC_MNTH);
*day = bcd2bin (RTC_DATE);
*hour = bcd2bin (RTC_HOUR);
*min = bcd2bin (RTC_MINS);
@@ -371,15 +309,6 @@
}
-static unsigned char bcd2bin (unsigned char b)
-{
- return ((b>>4)*10 + (b&15));
-}
-
-static unsigned char bin2bcd (unsigned char b)
-{
- return (((b/10)*16) + (b%10));
-}
/*
@@ -439,8 +368,6 @@
/*
* Set the minutes and seconds from seconds value 'nowtime'. Fail if
* clock is out by > 30 minutes. Logic lifted from atari code.
- * Algorithm is to wait for the 10ms register to change, and then to
- * wait a short while, and then set it.
*/
int q40_set_clock_mmss (unsigned long nowtime)
@@ -469,18 +396,3 @@
return retval;
}
-extern void q40kbd_init_hw(void);
-
-int q40_keyb_init (void)
-{
- q40kbd_init_hw();
- return 0;
-}
-
-#if 0
-/* dummy to cause */
-void q40_slow_io()
-{
- return;
-}
-#endif
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/q40/q40ints.c linux/arch/m68k/q40/q40ints.c
--- v2.4.5/linux/arch/m68k/q40/q40ints.c Mon Nov 27 17:11:26 2000
+++ linux/arch/m68k/q40/q40ints.c Tue Jun 5 18:27:20 2001
@@ -1,7 +1,7 @@
/*
* arch/m68k/q40/q40ints.c
*
- * Copyright (C) 1999 Richard Zidlicky
+ * Copyright (C) 1999,2001 Richard Zidlicky
*
* 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
@@ -44,7 +44,7 @@
void q40_irq2_handler (int, void *, struct pt_regs *fp);
-extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */
+extern void (*q40_sys_default_handler[]) (int, void *, struct pt_regs *);
static void q40_defhand (int irq, void *dev_id, struct pt_regs *fp);
static void sys_default_handler(int lev, void *dev_id, struct pt_regs *regs);
@@ -97,9 +97,9 @@
sys_request_irq(IRQ2,q40_irq2_handler, 0, "q40 ISA and master chip", NULL);
/* now enable some ints.. */
- master_outb(1,EXT_ENABLE_REG); /* hm, aint that too early? */
+ master_outb(1,EXT_ENABLE_REG); /* ISA IRQ 5-15 */
- /* would be spurious ints by now, q40kbd_init_hw() does that */
+ /* make sure keyboard IRQ is disabled */
master_outb(0,KEY_IRQ_ENABLE_REG);
}
@@ -139,7 +139,7 @@
if (dev_id==NULL)
{
printk("WARNING: dev_id == NULL in request_irq\n");
- dev_id=1;
+ dev_id=(void*)1;
}
irq_tab[irq].handler = handler;
irq_tab[irq].flags = flags;
@@ -202,7 +202,8 @@
/*
* this stuff doesn't really belong here..
*/
-int ql_ticks=0;
+
+int ql_ticks=0; /* 200Hz ticks since last jiffie */
static int sound_ticks=0;
#define SVOL 45
@@ -214,7 +215,7 @@
if (hz==0)
{
if (sound_ticks)
- sound_ticks=1; /* atomic - no irq spinlock used */
+ sound_ticks=1;
*DAC_LEFT=128;
*DAC_RIGHT=128;
@@ -227,14 +228,9 @@
}
static void (*q40_timer_routine)(int, void *, struct pt_regs *);
-static short rtc_oldsecs=0;
-unsigned rtc_irq_flags=0;
-unsigned rtc_irq_ctrl=0;
static void q40_timer_int (int irq, void * dev, struct pt_regs * regs)
{
-
-
#if (HZ==100)
ql_ticks = ql_ticks ? 0 : 1;
if (sound_ticks)
@@ -244,12 +240,12 @@
*DAC_LEFT=sval;
*DAC_RIGHT=sval;
}
-#ifdef CONFIG_Q40RTC
- if (rtc_irq_ctrl && (rtc_oldsecs != RTC_SECS))
+#if defined(CONFIG_Q40RTC) || defined(CONFIG_GEN_RTC)
+ if (gen_rtc_irq_ctrl && (q40rtc_oldsecs != RTC_SECS))
{
- rtc_oldsecs = RTC_SECS;
- rtc_irq_flags = RTC_UIE;
- rtc_interrupt();
+ q40rtc_oldsecs = RTC_SECS;
+ gen_rtc_irq_flags = RTC_UIE;
+ gen_rtc_interrupt(0);
}
#endif
if (ql_ticks) return;
@@ -322,16 +318,14 @@
static int ccleirq=60; /* ISA dev IRQ's*/
/*static int cclirq=60;*/ /* internal */
-/* FIX: add shared ints,mask,unmask,probing.... */
-
+/* FIXME: add shared ints,mask,unmask,probing.... */
#define IRQ_INPROGRESS 1
/*static unsigned short saved_mask;*/
static int do_tint=0;
#define DEBUG_Q40INT
-#define IP_USE_DISABLE /* would be nice, but crashes ???? */
-/*static int dd_count=0;*/
+/*#define IP_USE_DISABLE *//* would be nice, but crashes ???? */
static int mext_disabled=0; /* ext irq disabled by master chip? */
static int aliased_irq=0; /* how many times inside handler ?*/
@@ -404,40 +398,36 @@
if ( disabled )
{
#ifdef IP_USE_DISABLE
- if (irq>4){
- disabled=0;
- /*dd_count--;*/
- enable_irq(irq);}
+ if (irq>4){
+ disabled=0;
+ enable_irq(irq);}
#else
- disabled=0;
+ disabled=0;
/*printk("reenabling irq %d\n",irq); */
-#if 0
- fp->sr = ((fp->sr) & (~0x700)); /* unneeded ?! */
-#endif
#endif
}
goto repeat; /* return; */
}
}
- if (mer && ccleirq>0 && !aliased_irq)
+ if (mer && ccleirq>0 && !aliased_irq)
printk("ISA interrupt from unknown source? EIRQ_REG = %x\n",mer),ccleirq--;
}
iirq:
- mir=master_inb(IIRQ_REG);
- if (mir&IRQ_FRAME_MASK)
+ mir=master_inb(IIRQ_REG);
+ if (mir&IRQ_FRAME_MASK)
{
- do_tint++;
- master_outb(-1,FRAME_CLEAR_REG);
- }
- for(;do_tint>0;do_tint--)
- {
- irq_tab[Q40_IRQ_FRAME].count++;
- irq_tab[Q40_IRQ_FRAME].handler(Q40_IRQ_FRAME,irq_tab[Q40_IRQ_FRAME].dev_id,fp);
- }
- if (mir&IRQ_KEYB_MASK) /* may handle it even if actually disabled*/
- {
- irq_tab[Q40_IRQ_KEYBOARD].count++;
- irq_tab[Q40_IRQ_KEYBOARD].handler(Q40_IRQ_KEYBOARD,irq_tab[Q40_IRQ_KEYBOARD].dev_id,fp);
+ do_tint++;
+ master_outb(-1,FRAME_CLEAR_REG);
+ }
+ for(;do_tint>0;do_tint--)
+ {
+ irq_tab[Q40_IRQ_FRAME].count++;
+ irq_tab[Q40_IRQ_FRAME].handler(Q40_IRQ_FRAME,irq_tab[Q40_IRQ_FRAME].dev_id,fp);
+ }
+ if (mir&IRQ_KEYB_MASK) /* may handle it even if actually disabled*/
+ {
+ irq_tab[Q40_IRQ_KEYBOARD].count++;
+ irq_tab[Q40_IRQ_KEYBOARD].handler(Q40_IRQ_KEYBOARD,irq_tab[Q40_IRQ_KEYBOARD].dev_id,fp);
}
}
@@ -499,7 +489,7 @@
void q40_disable_irq (unsigned int irq)
{
/* disable ISA iqs : only do something if the driver has been
- * verified to be Q40 "compatible" - right now only IDE
+ * verified to be Q40 "compatible" - right now IDE, NE2K
* Any driver should not attempt to sleep accross disable_irq !!
*/
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/Makefile linux/arch/m68k/sun3/Makefile
--- v2.4.5/linux/arch/m68k/sun3/Makefile Fri Dec 29 14:07:20 2000
+++ linux/arch/m68k/sun3/Makefile Tue Jun 5 18:27:20 2001
@@ -14,7 +14,9 @@
export-objs := sun3_ksyms.o
-obj-y := config.o idprom.o mmu_emu.o sun3ints.o leds.o dvma.o \
- sbus.o intersil.o sun3_ksyms.o
+obj-y := sun3_ksyms.o sun3ints.o sun3dvma.o sbus.o
+
+obj-$(CONFIG_SUN3) += config.o idprom.o mmu_emu.o leds.o dvma.o \
+ intersil.o
include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/config.c linux/arch/m68k/sun3/config.c
--- v2.4.5/linux/arch/m68k/sun3/config.c Fri Dec 29 14:07:20 2000
+++ linux/arch/m68k/sun3/config.c Tue Jun 5 18:27:20 2001
@@ -8,13 +8,10 @@
* for more details.
*/
-#include
-
#include
#include
#include
#include
-#include
#include
#include
#include
@@ -27,10 +24,12 @@
#include
#include
#include
+#include
#include
#include
#include
#include
+#include
extern char _text, _end;
@@ -39,15 +38,6 @@
extern unsigned long sun3_gettimeoffset(void);
extern int sun3_get_irq_list (char *);
extern void sun3_sched_init(void (*handler)(int, void *, struct pt_regs *));
-extern void sun3_init_IRQ (void);
-extern void (*sun3_default_handler[]) (int, void *, struct pt_regs *);
-extern int sun3_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
- unsigned long flags, const char *devname, void *dev_id);
-extern void sun3_free_irq (unsigned int irq, void *dev_id);
-extern void sun3_enable_irq (unsigned int);
-extern void sun3_disable_irq (unsigned int);
-extern void sun3_enable_interrupts (void);
-extern void sun3_disable_interrupts (void);
extern void sun3_get_model (char* model);
extern void idprom_init (void);
extern void sun3_gettod (int *yearp, int *monp, int *dayp,
@@ -56,7 +46,7 @@
extern void sun_serial_setup(void);
volatile char* clock_va;
-extern unsigned char* sun3_intreg;
+extern volatile unsigned char* sun3_intreg;
extern unsigned long availmem;
unsigned long num_pages;
@@ -76,7 +66,7 @@
prom_init((void *)LINUX_OPPROM_BEGVM);
GET_CONTROL_BYTE(AC_SENABLE,enable_register);
- enable_register |= 0x40; /* Enable FPU */
+ enable_register |= 0x50; /* Enable FPU */
SET_CONTROL_BYTE(AC_SENABLE,enable_register);
GET_CONTROL_BYTE(AC_SENABLE,enable_register);
@@ -154,6 +144,7 @@
// mach_keyb_init = sun3_keyb_init;
enable_irq = sun3_enable_irq;
disable_irq = sun3_disable_irq;
+ mach_process_int = sun3_process_int;
mach_get_irq_list = sun3_get_irq_list;
mach_gettod = sun3_gettod;
mach_reset = sun3_reboot;
@@ -161,7 +152,7 @@
mach_get_model = sun3_get_model;
mach_hwclk = sun3_hwclk;
mach_halt = sun3_halt;
-#ifndef CONFIG_SERIAL_CONSOLE
+#if !defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_FB)
conswitchp = &dummy_con;
#endif
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/dvma.c linux/arch/m68k/sun3/dvma.c
--- v2.4.5/linux/arch/m68k/sun3/dvma.c Fri Dec 29 14:07:20 2000
+++ linux/arch/m68k/sun3/dvma.c Tue Jun 5 18:27:20 2001
@@ -4,42 +4,62 @@
#include
#include
#include
+#include
#include
#include
#include
#include
-unsigned long dvma_next_free = DVMA_START;
-unsigned long dvma_region_end = DVMA_START + (DVMA_RESERVED_PMEGS * SUN3_PMEG_SIZE);
+static unsigned long ptelist[120];
-/* reserve such dma memory as we see fit */
-void sun3_dvma_init(void)
+inline unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
{
- unsigned long dvma_phys_start;
-
- dvma_phys_start = (sun3_get_pte(DVMA_START) &
- SUN3_PAGE_PGNUM_MASK);
- dvma_phys_start <<= PAGE_SHIFT;
+ unsigned long pte;
+ unsigned long j;
+ pte_t ptep;
- reserve_bootmem(dvma_phys_start,
- (DVMA_RESERVED_PMEGS * SUN3_PMEG_SIZE));
+ j = *(volatile unsigned long *)kaddr;
+ *(volatile unsigned long *)kaddr = j;
-}
+ ptep = __mk_pte(kaddr, PAGE_KERNEL);
+ pte = pte_val(ptep);
+// printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n",
+// kaddr, vaddr, pte, len);
+ if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) {
+ sun3_put_pte(vaddr, pte);
+ ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] = pte;
+ }
-/* get needed number of free dma pages, or panic if not enough */
+ return (vaddr + (kaddr & ~PAGE_MASK));
-void *sun3_dvma_malloc(int len)
+}
+
+int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
+ int len)
{
+
+ unsigned long end;
unsigned long vaddr;
- if((dvma_next_free + len) > dvma_region_end)
- panic("sun3_dvma_malloc: out of dvma pages");
+ vaddr = dvma_btov(baddr);
+
+ end = vaddr + len;
- vaddr = dvma_next_free;
- dvma_next_free = DVMA_ALIGN(dvma_next_free + len);
+ while(vaddr < end) {
+ dvma_page(kaddr, vaddr);
+ kaddr += PAGE_SIZE;
+ vaddr += PAGE_SIZE;
+ }
+
+ return 0;
- return (void *)vaddr;
}
-
+void sun3_dvma_init(void)
+{
+
+ memset(ptelist, 0, sizeof(ptelist));
+
+
+}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/intersil.c linux/arch/m68k/sun3/intersil.c
--- v2.4.5/linux/arch/m68k/sun3/intersil.c Wed Jan 26 12:44:21 2000
+++ linux/arch/m68k/sun3/intersil.c Tue Jun 5 18:27:20 2001
@@ -11,9 +11,9 @@
*/
#include
-#include
#include
+#include
#include
@@ -30,7 +30,7 @@
void sun3_gettod (int *yearp, int *monp, int *dayp,
int *hourp, int *minp, int *secp)
{
- u_char wday;
+ unsigned char wday;
volatile struct intersil_dt* todintersil;
unsigned long flags;
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/mmu_emu.c linux/arch/m68k/sun3/mmu_emu.c
--- v2.4.5/linux/arch/m68k/sun3/mmu_emu.c Fri Dec 29 14:07:20 2000
+++ linux/arch/m68k/sun3/mmu_emu.c Tue Jun 5 18:27:20 2001
@@ -29,6 +29,7 @@
extern void prom_reboot (char *) __attribute__ ((__noreturn__));
#undef DEBUG_MMU_EMU
+#define DEBUG_PROM_MAPS
/*
** Defines
@@ -157,9 +158,12 @@
j = 0;
for (num=0, seg=0x0F800000; seg<0x10000000; seg+=16*PAGE_SIZE) {
if (sun3_get_segmap (seg) != SUN3_INVALID_PMEG) {
-#ifdef DEBUG_MMU_EMU
- printk ("mapped:");
- print_pte_vaddr (seg);
+#ifdef DEBUG_PROM_MAPS
+ for(i = 0; i < 16; i++) {
+ printk ("mapped:");
+ print_pte_vaddr (seg + (i*PAGE_SIZE));
+ break;
+ }
#endif
// the lowest mapping here is the end of our
// vmalloc region
@@ -174,7 +178,7 @@
}
- sun3_dvma_init();
+ dvma_init();
/* blank everything below the kernel, and we've got the base
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/sbus.c linux/arch/m68k/sun3/sbus.c
--- v2.4.5/linux/arch/m68k/sun3/sbus.c Wed Sep 8 11:20:42 1999
+++ linux/arch/m68k/sun3/sbus.c Tue Jun 5 18:27:20 2001
@@ -12,8 +12,12 @@
#include
#include
+extern void rs_init(void);
+
void __init sbus_init(void)
{
+
+ rs_init();
}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/sun3_ksyms.c linux/arch/m68k/sun3/sun3_ksyms.c
--- v2.4.5/linux/arch/m68k/sun3/sun3_ksyms.c Fri Jan 28 08:04:58 2000
+++ linux/arch/m68k/sun3/sun3_ksyms.c Tue Jun 5 18:27:20 2001
@@ -6,5 +6,8 @@
/*
* Add things here when you find the need for it.
*/
-EXPORT_SYMBOL(sun3_dvma_malloc);
+EXPORT_SYMBOL(dvma_map_align);
+EXPORT_SYMBOL(dvma_unmap);
+EXPORT_SYMBOL(dvma_malloc_align);
+EXPORT_SYMBOL(dvma_free);
EXPORT_SYMBOL(idprom);
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/sun3dvma.c linux/arch/m68k/sun3/sun3dvma.c
--- v2.4.5/linux/arch/m68k/sun3/sun3dvma.c Wed Dec 31 16:00:00 1969
+++ linux/arch/m68k/sun3/sun3dvma.c Tue Jun 5 18:27:20 2001
@@ -0,0 +1,295 @@
+/*
+ * linux/arch/m68k/mm/sun3dvma.c
+ *
+ * Copyright (C) 2000 Sam Creasey
+ *
+ * Contains common routines for sun3/sun3x DVMA management.
+ */
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#ifdef CONFIG_SUN3X
+extern void dvma_unmap_iommu(unsigned long baddr, int len);
+#else
+static inline void dvma_unmap_iommu(unsigned long a, int b)
+{
+}
+#endif
+
+unsigned long iommu_use[IOMMU_TOTAL_ENTRIES];
+
+#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
+
+#define dvma_entry_use(baddr) (iommu_use[dvma_index(baddr)])
+
+struct hole {
+ unsigned long start;
+ unsigned long end;
+ unsigned long size;
+ struct list_head list;
+};
+
+static struct list_head hole_list;
+static struct list_head hole_cache;
+static struct hole initholes[64];
+
+static inline int refill(void)
+{
+
+ struct hole *hole;
+ struct hole *prev = NULL;
+ struct list_head *cur;
+ int ret = 0;
+
+ list_for_each(cur, &hole_list) {
+ hole = list_entry(cur, struct hole, list);
+
+ if(!prev) {
+ prev = hole;
+ continue;
+ }
+
+ if(hole->end == prev->start) {
+ hole->size += prev->size;
+ hole->end = prev->end;
+ list_del(&(prev->list));
+ list_add(&(prev->list), &hole_cache);
+ ret++;
+ }
+
+ }
+
+ return ret;
+}
+
+static inline struct hole *rmcache(void)
+{
+ struct hole *ret;
+
+ if(list_empty(&hole_cache)) {
+ if(!refill()) {
+ printk("out of dvma hole cache!\n");
+ BUG();
+ }
+ }
+
+ ret = list_entry(hole_cache.next, struct hole, list);
+ list_del(&(ret->list));
+
+ return ret;
+
+}
+
+static inline unsigned long get_baddr(int len, unsigned long align)
+{
+
+ struct list_head *cur;
+ struct hole *hole;
+
+ if(list_empty(&hole_list)) {
+ printk("out of dvma holes!\n");
+ BUG();
+ }
+
+ list_for_each(cur, &hole_list) {
+ unsigned long newlen;
+
+ hole = list_entry(cur, struct hole, list);
+
+ if(align > DVMA_PAGE_SIZE)
+ newlen = len + ((hole->end - len) & (align-1));
+ else
+ newlen = len;
+
+ if(hole->size > newlen) {
+ hole->end -= newlen;
+ hole->size -= newlen;
+ dvma_entry_use(hole->end) = newlen;
+ return hole->end;
+ } else if(hole->size == newlen) {
+ list_del(&(hole->list));
+ list_add(&(hole->list), &hole_cache);
+ dvma_entry_use(hole->start) = newlen;
+ return hole->start;
+ }
+
+ }
+
+ printk("unable to find dvma hole!\n");
+ BUG();
+ return 0;
+}
+
+static inline int free_baddr(unsigned long baddr)
+{
+
+ unsigned long len;
+ struct hole *hole;
+ struct list_head *cur;
+ unsigned long orig_baddr;
+
+ orig_baddr = baddr;
+ len = dvma_entry_use(baddr);
+ dvma_entry_use(baddr) = 0;
+ baddr &= DVMA_PAGE_MASK;
+ dvma_unmap_iommu(baddr, len);
+
+ list_for_each(cur, &hole_list) {
+ hole = list_entry(cur, struct hole, list);
+
+ if(hole->end == baddr) {
+ hole->end += len;
+ hole->size += len;
+ return 0;
+ } else if(hole->start == (baddr + len)) {
+ hole->start = baddr;
+ hole->size += len;
+ return 0;
+ }
+
+ }
+
+ hole = rmcache();
+
+ hole->start = baddr;
+ hole->end = baddr + len;
+ hole->size = len;
+
+// list_add_tail(&(hole->list), cur);
+ list_add(&(hole->list), cur);
+
+ return 0;
+
+}
+
+void dvma_init(void)
+{
+
+ struct hole *hole;
+ int i;
+
+ INIT_LIST_HEAD(&hole_list);
+ INIT_LIST_HEAD(&hole_cache);
+
+ /* prepare the hole cache */
+ for(i = 0; i < 64; i++)
+ list_add(&(initholes[i].list), &hole_cache);
+
+ hole = rmcache();
+ hole->start = DVMA_START;
+ hole->end = DVMA_END;
+ hole->size = DVMA_SIZE;
+
+ list_add(&(hole->list), &hole_list);
+
+ memset(iommu_use, 0, sizeof(iommu_use));
+
+ dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
+
+#ifdef CONFIG_SUN3
+ sun3_dvma_init();
+#endif
+
+}
+
+inline unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
+{
+
+ unsigned long baddr;
+ unsigned long off;
+
+ if(!len)
+ len = 0x800;
+
+ if(!kaddr || !len) {
+// printk("error: kaddr %lx len %x\n", kaddr, len);
+// *(int *)4 = 0;
+ return 0;
+ }
+
+#ifdef DEBUG
+ printk("dvma_map request %08lx bytes from %08lx\n",
+ len, kaddr);
+#endif
+ off = kaddr & ~DVMA_PAGE_MASK;
+ kaddr &= PAGE_MASK;
+ len += off;
+ len = ((len + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK);
+
+ if(align == 0)
+ align = DVMA_PAGE_SIZE;
+ else
+ align = ((align + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK);
+
+ baddr = get_baddr(len, align);
+// printk("using baddr %lx\n", baddr);
+
+ if(!dvma_map_iommu(kaddr, baddr, len))
+ return (baddr + off);
+
+ printk("dvma_map failed kaddr %lx baddr %lx len %x\n", kaddr, baddr, len);
+ BUG();
+ return 0;
+}
+
+void dvma_unmap(void *baddr)
+{
+
+ free_baddr((unsigned long)baddr);
+
+ return;
+
+}
+
+
+void *dvma_malloc_align(unsigned long len, unsigned long align)
+{
+ unsigned long kaddr;
+ unsigned long baddr;
+ unsigned long vaddr;
+
+ if(!len)
+ return NULL;
+
+#ifdef DEBUG
+ printk("dvma_malloc request %lx bytes\n", len);
+#endif
+ len = ((len + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK);
+
+ if((kaddr = __get_free_pages(GFP_ATOMIC, get_order(len))) == 0)
+ return NULL;
+
+ if((baddr = (unsigned long)dvma_map_align(kaddr, len, align)) == 0) {
+ free_pages(kaddr, get_order(len));
+ return NULL;
+ }
+
+ vaddr = dvma_btov(baddr);
+
+ if(dvma_map_cpu(kaddr, vaddr, len) < 0) {
+ dvma_unmap((void *)baddr);
+ free_pages(kaddr, get_order(len));
+ return NULL;
+ }
+
+#ifdef DEBUG
+ printk("mapped %08lx bytes %08lx kern -> %08lx bus\n",
+ len, kaddr, baddr);
+#endif
+
+ return (void *)vaddr;
+
+}
+
+void dvma_free(void *vaddr)
+{
+
+ return;
+
+}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3/sun3ints.c linux/arch/m68k/sun3/sun3ints.c
--- v2.4.5/linux/arch/m68k/sun3/sun3ints.c Fri Dec 29 14:07:20 2000
+++ linux/arch/m68k/sun3/sun3ints.c Tue Jun 5 18:27:20 2001
@@ -1,5 +1,5 @@
/*
- * linux/arch/m68k/sun3/sun3ints.c -- Sun-3 Linux interrupt handling code
+ * linux/arch/m68k/sun3/sun3ints.c -- Sun-3(x) Linux interrupt handling code
*
* 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
@@ -35,7 +35,7 @@
~(0x10), ~(0x08)
};
-unsigned char* sun3_intreg;
+volatile unsigned char* sun3_intreg;
void sun3_insert_irq(irq_node_t **list, irq_node_t *node)
{
@@ -45,10 +45,6 @@
{
}
-void sun3_free_irq(unsigned int irq, void *dev_id)
-{
-}
-
void sun3_enable_irq(unsigned int irq)
{
*sun3_intreg |= (1<= 64) && (irq <= 255)) {
+ int vec;
+
+ vec = irq - 64;
+ if(sun3_vechandler[vec] != NULL) {
+ printk("sun3_request_irq: request for vec %d -- already taken!\n", irq);
+ return 1;
+ }
+
+ sun3_vechandler[vec] = handler;
+ vec_ids[vec] = dev_id;
+ vec_names[vec] = devname;
+
+ return 0;
+ }
+ }
- /* setting devname would be nice */
-
- sys_request_irq(irq, sun3_default_handler[irq], 0, devname, NULL);
-
+ printk("sun3_request_irq: invalid irq %d\n", irq);
+ return 1;
- return 0;
}
+void sun3_free_irq(unsigned int irq, void *dev_id)
+{
+
+ if(irq < SYS_IRQS) {
+ if(sun3_inthandler[irq] == NULL)
+ panic("sun3_free_int: attempt to free unused irq %d\n", irq);
+ if(dev_ids[irq] != dev_id)
+ panic("sun3_free_int: incorrect dev_id for irq %d\n", irq);
+
+ sun3_inthandler[irq] = NULL;
+ return;
+ } else if((irq >= 64) && (irq <= 255)) {
+ int vec;
+
+ vec = irq - 64;
+ if(sun3_vechandler[vec] == NULL)
+ panic("sun3_free_int: attempt to free unused vector %d\n", irq);
+ if(vec_ids[irq] != dev_id)
+ panic("sun3_free_int: incorrect dev_id for vec %d\n", irq);
+
+ sun3_vechandler[vec] = NULL;
+ return;
+ } else {
+ panic("sun3_free_irq: invalid irq %d\n", irq);
+ }
+}
+
+void sun3_process_int(int irq, struct pt_regs *regs)
+{
+
+ if((irq >= 64) && (irq <= 255)) {
+ int vec;
+
+ vec = irq - 64;
+ if(sun3_vechandler[vec] == NULL)
+ panic ("bad interrupt vector %d received\n",irq);
+
+ sun3_vechandler[vec](irq, vec_ids[vec], regs);
+ return;
+ } else {
+ panic("sun3_process_int: unable to handle interrupt vector %d\n",
+ irq);
+ }
+}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/Makefile linux/arch/m68k/sun3x/Makefile
--- v2.4.5/linux/arch/m68k/sun3x/Makefile Fri Dec 29 14:07:20 2000
+++ linux/arch/m68k/sun3x/Makefile Tue Jun 5 18:27:20 2001
@@ -9,6 +9,6 @@
O_TARGET := sun3x.o
-obj-y := config.o time.o dvma.o sbus.o
+obj-y := config.o time.o dvma.o prom.o
include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/config.c linux/arch/m68k/sun3x/config.c
--- v2.4.5/linux/arch/m68k/sun3x/config.c Thu Aug 26 12:42:31 1999
+++ linux/arch/m68k/sun3x/config.c Tue Jun 5 18:27:20 2001
@@ -14,39 +14,24 @@
#include
#include
#include
-#include
+#include
+#include
+#include
#include "time.h"
-static volatile unsigned char *sun3x_intreg = (unsigned char *)SUN3X_INTREG;
-extern int serial_console;
+volatile char *clock_va;
+extern volatile unsigned char *sun3_intreg;
-void sun3x_halt(void)
-{
- /* Disable interrupts */
- cli();
-
- /* we can't drop back to PROM, so we loop here */
- for (;;);
-}
-
-void sun3x_reboot(void)
-{
- /* This never returns, don't bother saving things */
- cli();
-
- /* no idea, whether this works */
- asm ("reset");
-}
int __init sun3x_keyb_init(void)
{
- return 0;
+ return 0;
}
int sun3x_kbdrate(struct kbd_repeat *r)
{
- return 0;
+ return 0;
}
void sun3x_kbd_leds(unsigned int i)
@@ -54,36 +39,15 @@
}
-static void sun3x_badint (int irq, void *dev_id, struct pt_regs *fp)
+void sun3_leds(unsigned int i)
{
- printk ("received spurious interrupt %d\n",irq);
- num_spurious += 1;
-}
-void (*sun3x_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
- sun3x_badint, sun3x_badint, sun3x_badint, sun3x_badint,
- sun3x_badint, sun3x_badint, sun3x_badint, sun3x_badint
-};
-
-void sun3x_enable_irq(unsigned int irq)
-{
- *sun3x_intreg |= (1 << irq);
}
-void sun3x_disable_irq(unsigned int irq)
+/* should probably detect types of these eventually. */
+static void sun3x_get_model(char *model)
{
- *sun3x_intreg &= ~(1 << irq);
-}
-
-void __init sun3x_init_IRQ(void)
-{
- /* disable all interrupts initially */
- *sun3x_intreg = 1; /* master enable only */
-}
-
-int sun3x_get_irq_list(char *buf)
-{
- return 0;
+ sprintf(model, "Sun3x");
}
/*
@@ -91,38 +55,51 @@
*/
void __init config_sun3x(void)
{
- mach_get_irq_list = sun3x_get_irq_list;
- mach_max_dma_address = 0xffffffff; /* we can DMA anywhere, whee */
- mach_keyb_init = sun3x_keyb_init;
- mach_kbdrate = sun3x_kbdrate;
- mach_kbd_leds = sun3x_kbd_leds;
-
- mach_sched_init = sun3x_sched_init;
- mach_init_IRQ = sun3x_init_IRQ;
- enable_irq = sun3x_enable_irq;
- disable_irq = sun3x_disable_irq;
- mach_request_irq = sys_request_irq;
- mach_free_irq = sys_free_irq;
- mach_default_handler = &sun3x_default_handler;
- mach_gettimeoffset = sun3x_gettimeoffset;
- mach_reset = sun3x_reboot;
+ sun3x_prom_init();
+
+ mach_get_irq_list = sun3_get_irq_list;
+ mach_max_dma_address = 0xffffffff; /* we can DMA anywhere, whee */
- mach_gettod = sun3x_gettod;
+ mach_keyb_init = sun3x_keyb_init;
+ mach_kbdrate = sun3x_kbdrate;
+ mach_kbd_leds = sun3x_kbd_leds;
+
+ mach_default_handler = &sun3_default_handler;
+ mach_sched_init = sun3x_sched_init;
+ mach_init_IRQ = sun3_init_IRQ;
+ enable_irq = sun3_enable_irq;
+ disable_irq = sun3_disable_irq;
+ mach_request_irq = sun3_request_irq;
+ mach_free_irq = sun3_free_irq;
+ mach_process_int = sun3_process_int;
- switch (*(unsigned char *)SUN3X_EEPROM_CONS) {
+ mach_gettimeoffset = sun3x_gettimeoffset;
+ mach_reset = sun3x_reboot;
+
+ mach_gettod = sun3x_gettod;
+ mach_hwclk = sun3x_hwclk;
+ mach_get_model = sun3x_get_model;
+
+ sun3_intreg = (unsigned char *)SUN3X_INTREG;
+
+ /* only the serial console is known to work anyway... */
+#if 0
+ switch (*(unsigned char *)SUN3X_EEPROM_CONS) {
case 0x10:
- serial_console = 1;
- conswitchp = NULL;
- break;
+ serial_console = 1;
+ conswitchp = NULL;
+ break;
case 0x11:
- serial_console = 2;
- conswitchp = NULL;
- break;
+ serial_console = 2;
+ conswitchp = NULL;
+ break;
default:
- serial_console = 0;
- conswitchp = &dummy_con;
- break;
- }
+ serial_console = 0;
+ conswitchp = &dummy_con;
+ break;
+ }
+#endif
}
+
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/dvma.c linux/arch/m68k/sun3x/dvma.c
--- v2.4.5/linux/arch/m68k/sun3x/dvma.c Tue May 11 09:57:14 1999
+++ linux/arch/m68k/sun3x/dvma.c Tue Jun 5 18:27:20 2001
@@ -2,21 +2,31 @@
* Virtual DMA allocation
*
* (C) 1999 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
+ *
+ * 11/26/2000 -- disabled the existing code because it didn't work for
+ * me in 2.4. Replaced with a significantly more primitive version
+ * similar to the sun3 code. the old functionality was probably more
+ * desirable, but.... -- Sam Creasey (sammy@oh.verio.com)
+ *
*/
#include
#include
#include
#include
+#include
+#include
+#include
#include
#include
#include
#include
+#include
+#include
/* IOMMU support */
-#define IOMMU_ENTRIES 2048
#define IOMMU_ADDR_MASK 0x03ffe000
#define IOMMU_CACHE_INHIBIT 0x00000040
#define IOMMU_FULL_BLOCK 0x00000020
@@ -28,135 +38,170 @@
#define IOMMU_DT_VALID 0x00000001
#define IOMMU_DT_BAD 0x00000002
-#define DVMA_PAGE_SHIFT 13
-#define DVMA_PAGE_SIZE (1UL << DVMA_PAGE_SHIFT)
-#define DVMA_PAGE_MASK (~(DVMA_PAGE_SIZE-1))
-
static volatile unsigned long *iommu_pte = (unsigned long *)SUN3X_IOMMU;
-static unsigned long iommu_use[IOMMU_ENTRIES];
-static unsigned long iommu_bitmap[IOMMU_ENTRIES/32];
#define dvma_entry_paddr(index) (iommu_pte[index] & IOMMU_ADDR_MASK)
#define dvma_entry_vaddr(index,paddr) ((index << DVMA_PAGE_SHIFT) | \
(paddr & (DVMA_PAGE_SIZE-1)))
+#if 0
+#define dvma_entry_set(index,addr) (iommu_pte[index] = \
+ (addr & IOMMU_ADDR_MASK) | \
+ IOMMU_DT_VALID | IOMMU_CACHE_INHIBIT)
+#else
#define dvma_entry_set(index,addr) (iommu_pte[index] = \
(addr & IOMMU_ADDR_MASK) | \
IOMMU_DT_VALID)
+#endif
#define dvma_entry_clr(index) (iommu_pte[index] = IOMMU_DT_INVALID)
-#define dvma_entry_use(index) (iommu_use[index])
-#define dvma_entry_inc(index) (iommu_use[index]++)
-#define dvma_entry_dec(index) (iommu_use[index]--)
#define dvma_entry_hash(addr) ((addr >> DVMA_PAGE_SHIFT) ^ \
((addr & 0x03c00000) >> \
(DVMA_PAGE_SHIFT+4)))
-#define dvma_map iommu_bitmap
-#define dvma_map_size (IOMMU_ENTRIES/2)
-#define dvma_slow_offset (IOMMU_ENTRIES/2)
-#define dvma_is_slow(addr) ((addr) & \
- (dvma_slow_offset << DVMA_PAGE_SHIFT))
-static int fixed_dvma;
+#undef DEBUG
-void __init dvma_init(void)
+#ifdef DEBUG
+/* code to print out a dvma mapping for debugging purposes */
+void dvma_print (unsigned long dvma_addr)
{
- unsigned long tmp;
- if ((unsigned long)high_memory < (IOMMU_ENTRIES << DVMA_PAGE_SHIFT)) {
- printk ("Sun3x fixed DVMA mapping\n");
- fixed_dvma = 1;
- for (tmp = 0; tmp < (unsigned long)high_memory; tmp += DVMA_PAGE_SIZE)
- dvma_entry_set (tmp >> DVMA_PAGE_SHIFT, virt_to_phys((void *)tmp));
- fixed_dvma = 1;
- } else {
- printk ("Sun3x variable DVMA mapping\n");
- for (tmp = 0; tmp < IOMMU_ENTRIES; tmp++)
- dvma_entry_clr (tmp);
- fixed_dvma = 0;
- }
+ unsigned long index;
+
+ index = dvma_addr >> DVMA_PAGE_SHIFT;
+
+ printk("idx %lx dvma_addr %08lx paddr %08lx\n", index, dvma_addr,
+ dvma_entry_paddr(index));
+
+
}
+#endif
-unsigned long dvma_slow_alloc (unsigned long paddr, int npages)
+
+/* create a virtual mapping for a page assigned within the IOMMU
+ so that the cpu can reach it easily */
+inline int dvma_map_cpu(unsigned long kaddr,
+ unsigned long vaddr, int len)
{
- int scan, base;
-
- scan = 0;
- for (;;) {
- scan = find_next_zero_bit(dvma_map, dvma_map_size, scan);
- if ((base = scan) + npages > dvma_map_size) {
- printk ("dvma_slow_alloc failed for %d pages\n",npages);
- return 0;
- }
- for (;;) {
- if (scan >= base + npages) goto found;
- if (test_bit(scan, dvma_map)) break;
- scan++;
- }
- }
+ pgd_t *pgd;
+ unsigned long end;
+ int ret = 0;
+
+ kaddr &= PAGE_MASK;
+ vaddr &= PAGE_MASK;
+
+ end = PAGE_ALIGN(vaddr + len);
+
+#ifdef DEBUG
+ printk("dvma: mapping kern %08lx to virt %08lx\n",
+ kaddr, vaddr);
+#endif
+ pgd = pgd_offset_k(vaddr);
+
+ do {
+ pmd_t *pmd;
+ unsigned long end2;
+
+ if((pmd = pmd_alloc_kernel(pgd, vaddr)) == NULL) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ if((end & PGDIR_MASK) > (vaddr & PGDIR_MASK))
+ end2 = (vaddr + (PGDIR_SIZE-1)) & PGDIR_MASK;
+ else
+ end2 = end;
+
+ do {
+ pte_t *pte;
+ unsigned long end3;
+
+ if((pte = pte_alloc_kernel(pmd, vaddr)) == NULL) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ if((end2 & PMD_MASK) > (vaddr & PMD_MASK))
+ end3 = (vaddr + (PMD_SIZE-1)) & PMD_MASK;
+ else
+ end3 = end2;
+
+ do {
+#ifdef DEBUG
+ printk("mapping %08lx phys to %08lx\n",
+ __pa(kaddr), vaddr);
+#endif
+ set_pte(pte, __mk_pte(kaddr, PAGE_KERNEL));
+ pte++;
+ kaddr += PAGE_SIZE;
+ vaddr += PAGE_SIZE;
+ } while(vaddr < end3);
+
+ } while(vaddr < end2);
+
+ } while(vaddr < end);
+
+ flush_tlb_all();
-found:
- for (scan = base; scan < base+npages; scan++) {
- dvma_entry_set(scan+dvma_slow_offset, paddr);
- paddr += DVMA_PAGE_SIZE;
- set_bit(scan, dvma_map);
- }
- return (dvma_entry_vaddr((base+dvma_slow_offset),paddr));
+ out:
+ return ret;
}
-unsigned long dvma_alloc (unsigned long paddr, unsigned long size)
+
+inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
+ int len)
{
- int index;
- int pages = ((paddr & ~DVMA_PAGE_MASK) + size + (DVMA_PAGE_SIZE-1)) >>
- DVMA_PAGE_SHIFT;
-
- if (fixed_dvma)
- return ((unsigned long)phys_to_virt (paddr));
-
- if (pages > 1) /* multi page, allocate from slow pool */
- return dvma_slow_alloc (paddr, pages);
-
- index = dvma_entry_hash (paddr);
-
- if (dvma_entry_use(index)) {
- if (dvma_entry_paddr(index) == (paddr & DVMA_PAGE_MASK)) {
- dvma_entry_inc(index);
- return dvma_entry_vaddr(index,paddr);
+ unsigned long end, index;
+
+ index = baddr >> DVMA_PAGE_SHIFT;
+ end = ((baddr+len) >> DVMA_PAGE_SHIFT);
+
+ if(len & ~DVMA_PAGE_MASK)
+ end++;
+
+ for(; index < end ; index++) {
+// if(dvma_entry_use(index))
+// BUG();
+// printk("mapping pa %lx to ba %lx\n", __pa(kaddr), index << DVMA_PAGE_SHIFT);
+
+ dvma_entry_set(index, __pa(kaddr));
+
+ iommu_pte[index] |= IOMMU_FULL_BLOCK;
+// dvma_entry_inc(index);
+
+ kaddr += DVMA_PAGE_SIZE;
}
- /* collision, allocate from slow pool */
- return dvma_slow_alloc (paddr, pages);
- }
-
- dvma_entry_set(index,paddr);
- dvma_entry_inc(index);
- return dvma_entry_vaddr(index,paddr);
+
+#ifdef DEBUG
+ for(index = (baddr >> DVMA_PAGE_SHIFT); index < end; index++)
+ dvma_print(index << DVMA_PAGE_SHIFT);
+#endif
+ return 0;
+
}
-void dvma_free (unsigned long dvma_addr, unsigned long size)
+void dvma_unmap_iommu(unsigned long baddr, int len)
{
- int npages;
- int index;
-
- if (fixed_dvma)
- return;
-
- if (!dvma_is_slow(dvma_addr)) {
- index = (dvma_addr >> DVMA_PAGE_SHIFT);
- if (dvma_entry_use(index) == 0) {
- printk ("dvma_free: %lx entry already free\n",dvma_addr);
- return;
+
+ int index, end;
+
+
+ index = baddr >> DVMA_PAGE_SHIFT;
+ end = (DVMA_PAGE_ALIGN(baddr+len) >> DVMA_PAGE_SHIFT);
+
+ for(; index < end ; index++) {
+#ifdef DEBUG
+ printk("freeing bus mapping %08x\n", index << DVMA_PAGE_SHIFT);
+#endif
+#if 0
+ if(!dvma_entry_use(index))
+ printk("dvma_unmap freeing unused entry %04x\n",
+ index);
+ else
+ dvma_entry_dec(index);
+#endif
+ dvma_entry_clr(index);
}
- dvma_entry_dec(index);
- if (dvma_entry_use(index) == 0)
- dvma_entry_clr(index);
- return;
- }
-
- /* free in slow pool */
- npages = ((dvma_addr & ~DVMA_PAGE_MASK) + size + (DVMA_PAGE_SIZE-1)) >>
- DVMA_PAGE_SHIFT;
- for (index = (dvma_addr >> DVMA_PAGE_SHIFT); npages--; index++) {
- dvma_entry_clr(index);
- clear_bit (index,dvma_map);
- }
+
}
+
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/prom.c linux/arch/m68k/sun3x/prom.c
--- v2.4.5/linux/arch/m68k/sun3x/prom.c Wed Dec 31 16:00:00 1969
+++ linux/arch/m68k/sun3x/prom.c Tue Jun 5 18:27:20 2001
@@ -0,0 +1,165 @@
+/* Prom access routines for the sun3x */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+void (*sun3x_putchar)(int);
+int (*sun3x_getchar)(void);
+int (*sun3x_mayget)(void);
+int (*sun3x_mayput)(int);
+void (*sun3x_prom_reboot)(void);
+e_vector sun3x_prom_abort;
+struct idprom *idprom;
+static struct idprom idprom_buffer;
+struct linux_romvec *romvec;
+
+/* prom vector table */
+e_vector *sun3x_prom_vbr;
+
+extern e_vector vectors[256]; /* arch/m68k/kernel/traps.c */
+
+/* Handle returning to the prom */
+void sun3x_halt(void)
+{
+ unsigned long flags;
+
+ /* Disable interrupts while we mess with things */
+ save_flags(flags); cli();
+
+ /* Restore prom vbr */
+ __asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
+
+ /* Restore prom NMI clock */
+// sun3x_disable_intreg(5);
+ sun3_enable_irq(7);
+
+ /* Let 'er rip */
+ __asm__ volatile ("trap #14" : : );
+
+ /* Restore everything */
+ sun3_disable_irq(7);
+ sun3_enable_irq(5);
+
+ __asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
+ restore_flags(flags);
+}
+
+void sun3x_reboot(void)
+{
+ /* This never returns, don't bother saving things */
+ cli();
+
+ /* Restore prom vbr */
+ __asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
+
+ /* Restore prom NMI clock */
+ sun3_disable_irq(5);
+ sun3_enable_irq(7);
+
+ /* Let 'er rip */
+ (*romvec->pv_reboot)("vmlinux");
+}
+
+extern char m68k_debug_device[];
+
+static void sun3x_prom_write(struct console *co, const char *s,
+ unsigned int count)
+{
+ while (count--) {
+ if (*s == '\n')
+ sun3x_putchar('\r');
+ sun3x_putchar(*s++);
+ }
+}
+
+/* debug console - write-only */
+
+static struct console sun3x_debug = {
+ "debug",
+ sun3x_prom_write, /* write */
+ NULL, /* read */
+ NULL, /* device */
+ NULL, /* wait_key */
+ NULL, /* unblank */
+ NULL, /* setup */
+ CON_PRINTBUFFER,
+ -1,
+ 0,
+ NULL
+};
+
+void sun3x_prom_init(void)
+{
+ /* Read the vector table */
+ int i;
+
+
+ sun3x_putchar = *(void (**)(int)) (SUN3X_P_PUTCHAR);
+ sun3x_getchar = *(int (**)(void)) (SUN3X_P_GETCHAR);
+ sun3x_mayget = *(int (**)(void)) (SUN3X_P_MAYGET);
+ sun3x_mayput = *(int (**)(int)) (SUN3X_P_MAYPUT);
+ sun3x_prom_reboot = *(void (**)(void)) (SUN3X_P_REBOOT);
+ sun3x_prom_abort = *(e_vector *) (SUN3X_P_ABORT);
+ romvec = (struct linux_romvec *)SUN3X_PROM_BASE;
+
+ /* make a copy of the idprom structure */
+ for(i = 0; i < sizeof(struct idprom); i++)
+ ((unsigned char *)(&idprom_buffer))[i] = ((unsigned char *)SUN3X_IDPROM)[i];
+ idprom = &idprom_buffer;
+
+ if((idprom->id_machtype & SM_ARCH_MASK) != SM_SUN3X) {
+ printk("Warning: machine reports strange type %02x\n");
+ printk("Pretending it's a 3/80, but very afraid...\n");
+ idprom->id_machtype = SM_SUN3X | SM_3_80;
+ }
+
+ /* point trap #14 at abort.
+ * XXX this is futile since we restore the vbr first - oops
+ */
+ vectors[VEC_TRAP14] = sun3x_prom_abort;
+
+ /* If debug=prom was specified, start the debug console */
+
+ if (!strcmp(m68k_debug_device, "prom"))
+ register_console(&sun3x_debug);
+
+
+}
+
+/* some prom functions to export */
+int prom_getintdefault(int node, char *property, int deflt)
+{
+ return deflt;
+}
+
+int prom_getbool (int node, char *prop)
+{
+ return 1;
+}
+
+void prom_printf(char *fmt, ...)
+{
+
+}
+
+void prom_halt (void)
+{
+ sun3x_halt();
+}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/sbus.c linux/arch/m68k/sun3x/sbus.c
--- v2.4.5/linux/arch/m68k/sun3x/sbus.c Thu Aug 26 12:42:31 1999
+++ linux/arch/m68k/sun3x/sbus.c Wed Dec 31 16:00:00 1969
@@ -1,44 +0,0 @@
-/*
- * SBus helper functions
- *
- * Sun3x 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@alpha.franken.de)
- */
-
-#include
-#include
-
-void __init sbus_init(void)
-{
-
-}
-
-void *sparc_alloc_io (u32 address, void *virtual, int len, char *name,
- u32 bus_type, int rdonly)
-{
- return (void *)address;
-}
-
-int prom_getintdefault(int node, char *property, int deflt)
-{
- return deflt;
-}
-
-int prom_getbool (int node, char *prop)
-{
- return 1;
-}
-
-void prom_printf(char *fmt, ...)
-{
-
-}
-
-void prom_halt (void)
-{
-
-}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/sun3x_ksyms.c linux/arch/m68k/sun3x/sun3x_ksyms.c
--- v2.4.5/linux/arch/m68k/sun3x/sun3x_ksyms.c Wed Dec 31 16:00:00 1969
+++ linux/arch/m68k/sun3x/sun3x_ksyms.c Tue Jun 5 18:27:20 2001
@@ -0,0 +1,13 @@
+#include
+#include
+#include
+#include
+
+/*
+ * Add things here when you find the need for it.
+ */
+EXPORT_SYMBOL(dvma_map_align);
+EXPORT_SYMBOL(dvma_unmap);
+EXPORT_SYMBOL(dvma_malloc_align);
+EXPORT_SYMBOL(dvma_free);
+EXPORT_SYMBOL(idprom);
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/time.c linux/arch/m68k/sun3x/time.c
--- v2.4.5/linux/arch/m68k/sun3x/time.c Thu Aug 26 12:42:31 1999
+++ linux/arch/m68k/sun3x/time.c Tue Jun 5 18:27:20 2001
@@ -5,6 +5,7 @@
*/
#include
+#include
#include
#include
#include
@@ -15,6 +16,8 @@
#include
#include
#include
+#include
+#include
#include "time.h"
@@ -33,6 +36,7 @@
#define C_CALIB 0x1f
#define BCD_TO_BIN(val) (((val)&15) + ((val)>>4)*10)
+#define BIN_TO_BCD(val) (((val/10) << 4) | (val % 10))
/* Read the Mostek */
void sun3x_gettod (int *yearp, int *monp, int *dayp,
@@ -45,7 +49,7 @@
/* Read values */
*yearp = BCD_TO_BIN(*(eeprom + M_YEAR));
- *monp = BCD_TO_BIN(*(eeprom + M_MONTH));
+ *monp = BCD_TO_BIN(*(eeprom + M_MONTH)) +1;
*dayp = BCD_TO_BIN(*(eeprom + M_DATE));
*hourp = BCD_TO_BIN(*(eeprom + M_HOUR));
*minp = BCD_TO_BIN(*(eeprom + M_MIN));
@@ -55,6 +59,40 @@
*(eeprom + M_CONTROL) &= ~C_READ;
}
+int sun3x_hwclk(int set, struct hwclk_time *t)
+{
+ volatile struct mostek_dt *h =
+ (unsigned char *)(SUN3X_EEPROM+M_CONTROL);
+ unsigned long flags;
+
+ save_and_cli(flags);
+
+ if(set) {
+ h->csr |= C_WRITE;
+ h->sec = BIN_TO_BCD(t->sec);
+ h->min = BIN_TO_BCD(t->min);
+ h->hour = BIN_TO_BCD(t->hour);
+ h->wday = BIN_TO_BCD(t->wday);
+ h->mday = BIN_TO_BCD(t->day);
+ h->month = BIN_TO_BCD(t->mon);
+ h->year = BIN_TO_BCD(t->year);
+ h->csr &= ~C_WRITE;
+ } else {
+ h->csr |= C_READ;
+ t->sec = BCD_TO_BIN(h->sec);
+ t->min = BCD_TO_BIN(h->min);
+ t->hour = BCD_TO_BIN(h->hour);
+ t->wday = BCD_TO_BIN(h->wday);
+ t->day = BCD_TO_BIN(h->mday);
+ t->mon = BCD_TO_BIN(h->month);
+ t->year = BCD_TO_BIN(h->year);
+ h->csr &= ~C_READ;
+ }
+
+ restore_flags(flags);
+
+ return 0;
+}
/* Not much we can do here */
unsigned long sun3x_gettimeoffset (void)
{
@@ -74,9 +112,12 @@
void __init sun3x_sched_init(void (*vector)(int, void *, struct pt_regs *))
{
- sys_request_irq(5, sun3x_timer_tick, IRQ_FLG_STD, "timer tick", vector);
+
+ sun3_disable_interrupts();
+
/* Pulse enable low to get the clock started */
- disable_irq(5);
- enable_irq(5);
+ sun3_disable_irq(5);
+ sun3_enable_irq(5);
+ sun3_enable_interrupts();
}
diff -u --recursive --new-file v2.4.5/linux/arch/m68k/sun3x/time.h linux/arch/m68k/sun3x/time.h
--- v2.4.5/linux/arch/m68k/sun3x/time.h Tue May 11 09:57:14 1999
+++ linux/arch/m68k/sun3x/time.h Tue Jun 5 18:27:20 2001
@@ -1,9 +1,21 @@
#ifndef SUN3X_TIME_H
#define SUN3X_TIME_H
-void sun3x_gettod (int *yearp, int *monp, int *dayp,
+extern void sun3x_gettod (int *yearp, int *monp, int *dayp,
int *hourp, int *minp, int *secp);
+extern int sun3x_hwclk(int set, struct hwclk_time *t);
unsigned long sun3x_gettimeoffset (void);
void sun3x_sched_init(void (*vector)(int, void *, struct pt_regs *));
+
+struct mostek_dt {
+ volatile unsigned char csr;
+ volatile unsigned char sec;
+ volatile unsigned char min;
+ volatile unsigned char hour;
+ volatile unsigned char wday;
+ volatile unsigned char mday;
+ volatile unsigned char month;
+ volatile unsigned char year;
+};
#endif
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/boot/common/misc-common.c linux/arch/ppc/boot/common/misc-common.c
--- v2.4.5/linux/arch/ppc/boot/common/misc-common.c Fri May 25 18:28:53 2001
+++ linux/arch/ppc/boot/common/misc-common.c Thu Jun 7 00:16:57 2001
@@ -268,7 +268,7 @@
s.zfree = zfree;
r = inflateInit2(&s, -MAX_WBITS);
if (r != Z_OK) {
- puts("inflateInit2 returned %d\n");
+ puts("inflateInit2 returned "); puthex(r); puts("\n");
exit();
}
s.next_in = src + i;
@@ -277,7 +277,7 @@
s.avail_out = dstlen;
r = inflate(&s, Z_FINISH);
if (r != Z_OK && r != Z_STREAM_END) {
- puts("inflate returned %d\n");
+ puts("inflate returned "); puthex(r); puts("\n");
exit();
}
*lenp = s.next_out - (unsigned char *) dst;
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/boot/mbx/Makefile linux/arch/ppc/boot/mbx/Makefile
--- v2.4.5/linux/arch/ppc/boot/mbx/Makefile Fri May 25 18:28:53 2001
+++ linux/arch/ppc/boot/mbx/Makefile Thu Jun 7 00:16:57 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.5 05/18/01 06:20:29 patch
+# BK Id: SCCS/s.Makefile 1.7 06/05/01 20:20:05 paulus
#
#
# arch/ppc/mbxboot/Makefile
@@ -87,13 +87,21 @@
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=initrd=../images/ramdisk.image.gz \
--add-section=image=../images/vmlinux.gz \
- $@.tmp ../images/$@.mbx
+ $@.tmp ../images/$@.embedded
zImage: zvmlinux
- ln -sf zvmlinux.mbx ../images/zImage.mbx
+ifeq ($(CONFIG_RPXCLASSIC),y)
+ dd if=../images/zvmlinux.embedded of=../images/zImage.embedded bs=65536 skip=1
+else
+ ln -sf ../images/zvmlinux.embedded ../images/zImage.embedded
+endif
zImage.initrd: zvmlinux.initrd
- ln -sf zvmlinux.initrd.mbx ../images/zImage.initrd.mbx
+ifeq ($(CONFIG_RPXCLASSIC),y)
+ dd if=../images/zvmlinux.initrd.embedded of=../images/zImage.initrd.embedded bs=65536 skip=1
+else
+ ln -sf ../images/zvmlinux.initrd.embedded ../images/zImage.initrd.embedded
+endif
zvmlinux: $(OBJECTS) $(LIBS) ../images/vmlinux.gz
#
@@ -114,14 +122,14 @@
$(LD) $(ZLINKFLAGS) -o $@.tmp $(OBJECTS) $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section=image=../images/vmlinux.gz \
- $@.tmp ../images/$@.mbx
-# Remove zvmlinux and zvmlinux.temp, we have ../images/zvmlinux.mbx
+ $@.tmp ../images/$@.embedded
+# Remove zvmlinux and zvmlinux.temp, we have ../images/zvmlinux.embedded
rm -f $@.tmp $@
znetboot : zImage
- cp ../images/zImage.mbx $(TFTPIMAGE)
+ cp ../images/zImage.embedded $(TFTPIMAGE)
znetboot.initrd : zImage.initrd
- cp ../images/zImage.initrd.mbx $(TFTPIMAGE)
+ cp ../images/zImage.initrd.embedded $(TFTPIMAGE)
include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/boot/pmac/Makefile linux/arch/ppc/boot/pmac/Makefile
--- v2.4.5/linux/arch/ppc/boot/pmac/Makefile Fri May 25 18:28:53 2001
+++ linux/arch/ppc/boot/pmac/Makefile Thu Jun 7 00:16:57 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.8 05/21/01 09:10:38 trini
+# BK Id: SCCS/s.Makefile 1.10 06/05/01 20:22:51 paulus
#
# Makefile for making XCOFF bootable images for booting on PowerMacs
# using Open Firmware.
@@ -7,7 +7,7 @@
#
# Cleaned up, moved into arch/ppc/boot/pmac
# Tom Rini January 2001
-
+
OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
COFF_LD_ARGS = -e _start -T ld.script -Ttext 500000 -Tdata 510000 -Bstatic
CHRP_LD_ARGS = -Ttext 0x01000000
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/boot/prep/misc.c linux/arch/ppc/boot/prep/misc.c
--- v2.4.5/linux/arch/ppc/boot/prep/misc.c Fri May 25 18:28:53 2001
+++ linux/arch/ppc/boot/prep/misc.c Thu Jun 7 00:16:57 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.misc.c 1.8 05/18/01 06:20:29 patch
+ * BK Id: SCCS/s.misc.c 1.10 06/05/01 20:20:05 paulus
*/
/*
* misc.c
@@ -393,7 +393,7 @@
{
struct bi_record *rec;
- rec = (struct bi_record *)PAGE_ALIGN(zimage_size);
+ rec = (struct bi_record *)_ALIGN((unsigned long)(zimage_size)+(1<<20)-1,(1<<20));
rec->tag = BI_FIRST;
rec->size = sizeof(struct bi_record);
@@ -406,8 +406,8 @@
rec->tag = BI_MACHTYPE;
rec->data[0] = _MACH_prep;
- rec->data[1] = 1;
- rec->size = sizeof(struct bi_record) + sizeof(unsigned long);
+ rec->data[1] = 0;
+ rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_CMD_LINE;
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/config.in linux/arch/ppc/config.in
--- v2.4.5/linux/arch/ppc/config.in Fri May 25 18:28:53 2001
+++ linux/arch/ppc/config.in Tue Jun 5 18:11:40 2001
@@ -365,6 +365,10 @@
source drivers/usb/Config.in
+if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ source net/bluetooth/Config.in
+fi
+
mainmenu_option next_comment
comment 'Kernel hacking'
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/kernel/Makefile linux/arch/ppc/kernel/Makefile
--- v2.4.5/linux/arch/ppc/kernel/Makefile Fri May 25 18:28:54 2001
+++ linux/arch/ppc/kernel/Makefile Thu Jun 7 00:16:57 2001
@@ -1,4 +1,4 @@
-# BK Id: SCCS/s.Makefile 1.17 05/21/01 00:48:24 cort
+# BK Id: SCCS/s.Makefile 1.19 05/26/01 14:48:14 paulus
#
#
# Makefile for the linux kernel.
@@ -32,7 +32,7 @@
export-objs := ppc_ksyms.o prep_setup.o
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
- process.o signal.o bitops.o ptrace.o \
+ process.o signal.o ptrace.o \
ppc_htab.o semaphore.o syscalls.o \
align.o setup.o
obj-$(CONFIG_MODULES) += ppc_ksyms.o
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/kernel/chrp_setup.c linux/arch/ppc/kernel/chrp_setup.c
--- v2.4.5/linux/arch/ppc/kernel/chrp_setup.c Fri May 25 18:28:54 2001
+++ linux/arch/ppc/kernel/chrp_setup.c Thu Jun 7 00:16:57 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.chrp_setup.c 1.17 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.chrp_setup.c 1.20 06/05/01 21:22:02 paulus
*/
/*
* linux/arch/ppc/kernel/setup.c
@@ -204,13 +204,10 @@
active = sio_read(0x30);
level0 = sio_read(0x70);
type0 = sio_read(0x71);
- printk("sio: %s irq level %d, type %d, %sactive: ", name, level0,
- type0, !active ? "in" : "");
- if (level0 == level && type0 == type && active)
- printk("OK\n");
- else {
- printk("remapping to level %d, type %d, active\n", level,
- type);
+ if (level0 != level || type0 != type || !active) {
+ printk(KERN_WARNING "sio: %s irq level %d, type %d, %sactive: "
+ "remapping to level %d, type %d, active\n",
+ name, level0, type0, !active ? "in" : "", level, type);
sio_write(0x01, 0x30);
sio_write(level, 0x70);
sio_write(type, 0x71);
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/kernel/irq.c linux/arch/ppc/kernel/irq.c
--- v2.4.5/linux/arch/ppc/kernel/irq.c Fri May 25 18:28:54 2001
+++ linux/arch/ppc/kernel/irq.c Thu Jun 7 00:16:57 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.irq.c 1.23 05/17/01 18:14:21 cort
+ * BK Id: SCCS/s.irq.c 1.26 06/06/01 22:33:09 paulus
*/
/*
* arch/ppc/kernel/irq.c
@@ -551,6 +551,9 @@
ppc_irq_dispatch_handler( regs, irq );
out:
hardirq_exit( cpu );
+
+ if (softirq_pending(cpu))
+ do_softirq();
return 1; /* lets ret_from_int know we can do checks */
}
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c
--- v2.4.5/linux/arch/ppc/kernel/prom.c Fri May 25 18:28:54 2001
+++ linux/arch/ppc/kernel/prom.c Thu Jun 7 00:16:57 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.prom.c 1.20 05/23/01 00:38:42 cort
+ * BK Id: SCCS/s.prom.c 1.23 06/06/01 22:49:01 paulus
*/
/*
* Procedures for interfacing to the Open Firmware PROM on
@@ -42,9 +42,11 @@
/*
* Properties whose value is longer than this get excluded from our
* copy of the device tree. This way we don't waste space storing
- * things like "driver,AAPL,MacOS,PowerPC" properties.
+ * things like "driver,AAPL,MacOS,PowerPC" properties. But this value
+ * does need to be big enough to ensure that we don't lose things
+ * like the interrupt-map property on a PCI-PCI bridge.
*/
-#define MAX_PROPERTY_LENGTH 1024
+#define MAX_PROPERTY_LENGTH 4096
struct prom_args {
const char *service;
@@ -670,16 +672,16 @@
prom_alloc_htab();
#endif
-#ifdef CONFIG_SMP
- prom_hold_cpus(mem);
-#endif
-
mem = check_display(mem);
prom_print(RELOC("copying OF device tree..."));
mem = copy_device_tree(mem, mem + (1<<20));
prom_print(RELOC("done\n"));
+#ifdef CONFIG_SMP
+ prom_hold_cpus(mem);
+#endif
+
RELOC(klimit) = (char *) (mem - offset);
/* If we are already running at 0xc0000000, we assume we were loaded by
@@ -1190,7 +1192,7 @@
if ((_machine == _MACH_chrp) || (boot_infos == 0 && pmac_newworld))
use_of_interrupt_tree = 1;
- mem = finish_node(allnodes, mem, NULL, 0, 0);
+ mem = finish_node(allnodes, mem, NULL, 1, 1);
dev_tree_size = mem - (unsigned long) allnodes;
klimit = (char *) mem;
}
@@ -1225,10 +1227,7 @@
np->name = get_property(np, "name", 0);
np->type = get_property(np, "device_type", 0);
-#if 0
- np->n_addr_cells = naddrc;
- np->n_size_cells = nsizec;
-#endif
+
/* get the device addresses and interrupts */
if (ifunc != NULL) {
mem_start = ifunc(np, mem_start, naddrc, nsizec);
@@ -1244,16 +1243,6 @@
ip = (int *) get_property(np, "#size-cells", 0);
if (ip != NULL)
nsizec = *ip;
-#if 0
- if (np->parent == NULL) {
- /*
- * Set the n_addr/size_cells on the root to its
- * own values, rather than 0.
- */
- np->n_addr_cells = naddrc;
- np->n_size_cells = nsizec;
- }
-#endif
/* the f50 sets the name to 'display' and 'compatible' to what we
* expect for the name -- Cort
@@ -1479,7 +1468,8 @@
if (ip != NULL)
return *ip;
} while(np->parent);
- return 0;
+ /* No #address-cells property for the root node, default to 1 */
+ return 1;
}
int
@@ -1493,7 +1483,8 @@
if (ip != NULL)
return *ip;
} while(np->parent);
- return 0;
+ /* No #size-cells property for the root node, default to 1 */
+ return 1;
}
__init
@@ -1980,7 +1971,7 @@
struct property *pp;
for (pp = np->properties; pp != 0; pp = pp->next) {
- if (name && strcmp(pp->name, name) == 0) {
+ if (pp->name != NULL && strcmp(pp->name, name) == 0) {
if (lenp != 0)
*lenp = pp->length;
return pp->value;
diff -u --recursive --new-file v2.4.5/linux/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c
--- v2.4.5/linux/arch/ppc/kernel/smp.c Fri May 25 18:28:54 2001
+++ linux/arch/ppc/kernel/smp.c Thu Jun 7 00:16:57 2001
@@ -1,5 +1,5 @@
/*
- * BK Id: SCCS/s.smp.c 1.23 05/17/01 18:14:22 cort
+ * BK Id: SCCS/s.smp.c 1.25 05/23/01 00:38:42 cort
*/
/*
* Smp support for ppc.
@@ -670,12 +670,12 @@
static void
smp_gemini_kick_cpu(int nr)
{
- openpic_init_processor( 1<
#include
+#include