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 12 10:57:05 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
@@ -1518,6 +1520,17 @@
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
D: CYPRESS CY82C693 chipset IDE, Digital's PC-Alpha 164SX boards
@@ -2697,9 +2710,7 @@
N: Marcelo W. Tosatti
E: marcelo@conectiva.com.br
W: http://bazar.conectiva.com.br/~marcelo/
-D: Miscellaneous kernel hacker
-D: Cyclom 2X driver, drbd hacker
-D: linuxconf apache & proftpd module maintainer
+D: Miscellaneous kernel hacker (mostly VM/MM work)
S: Conectiva S.A.
S: R. Tocantins, 89 - Cristo Rei
S: 80050-430 - Curitiba - Paraná
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 Mon Jun 11 19:15:27 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 Tue Jun 12 11:07:16 2001
@@ -10182,91 +10182,150 @@
Memory Technology Device (MTD) support
CONFIG_MTD
Memory Technology Devices are flash, RAM and similar chips, often
- used for solid state file systems on embedded devices. This option
+ used for solid state filesystems on embedded devices. This option
will provide the generic support for MTD drivers to register
themselves with the kernel and for potential users of MTD devices
to enumerate the devices which are present and obtain a handle on
them. It will also allow you to select individual drivers for
- particular hardware and users of MTD device. If unsure, say N.
+ particular hardware and users of MTD devices. If unsure, say N.
MTD debugging support
CONFIG_MTD_DEBUG
This turns on low-level debugging for the entire MTD sub-system.
+ Normally, you should say 'N'.
+
+MTD partitioning support
+CONFIG_MTD_PARTITIONS
+ If you have a device which needs to divide its flash chip(s) up
+ into multiple 'partitions', each of which appears to the user as
+ a separate MTD device, you require this option to be enabled. If
+ unsure, say 'Y'.
+
+ Note, however, that you don't need this option for the DiskOnChip
+ devices. Partitioning on NFTL 'devices' is a different - that's the
+ 'normal' form of partitioning used on a block device.
+
+RedBoot partition table parsing
+CONFIG_MTD_REDBOOT_PARTS
+ RedBoot is a ROM monitor and bootloader which deals with multiple
+ 'images' in flash devices by putting a table in the last erase
+ block of the device, similar to a partition table, which gives
+ the offsets, lengths and names of all the images stored in the
+ flash.
+
+ If you need code which can detect and parse this table, and register
+ MTD 'partitions' corresponding to each image in the table, enable
+ this option.
+
+ You will still need the parsing functions to be called by the driver
+ for your particular device. It won't happen automatically. The
+ SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
+ example.
+
+Compaq bootldr partition table parsing
+CONFIG_MTD_BOOTLDR_PARTS
+ The Compaq bootldr deals with multiple 'images' in flash devices
+ by putting a table in one of the first erase blocks of the device,
+ similar to a partition table, which gives the offsets, lengths and
+ names of all the images stored in the flash.
+
+ If you need code which can detect and parse this table, and register
+ MTD 'partitions' corresponding to each image in the table, enable
+ this option.
+
+ You will still need the parsing functions to be called by the driver
+ for your particular device. It won't happen automatically. The
+ SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
+ example.
+
+ARM Firmware Suite flash layout / partition parsing
+CONFIG_MTD_AFS_PARTS
+ The ARM Firmware Suite allows the user to divide flash devices into
+ multiple 'images'. Each such image has a header containing its name
+ and offset/size etc.
+
+ If you need code which can detect and parse these tables, and register
+ MTD 'partitions' corresponding to each image detected, enable
+ this option.
+
+ You will still need the parsing functions to be called by the driver
+ for your particular device. It won't happen automatically. The
+ 'armflash' map driver (CONFIG_MTD_ARMFLASH) does this, for example.
MTD debugging verbosity
CONFIG_MTD_DEBUG_VERBOSE
Determines the verbosity level of the MTD debugging messages.
-M-Systems Disk-On-Chip 1000 support
-CONFIG_MTD_DOC1000
- This provides an MTD device driver for the M-Systems DiskOnChip
- 1000 devices, which are obsolete so you probably want to say 'N'.
-M-Systems Disk-On-Chip 2000 and Millennium support
-CONFIG_MTD_DOC2000
- This provides an MTD device driver for the M-Systems DiskOnChip
- 2000 and Millennium devices. Originally designed for the DiskOnChip
- 2000, it also now includes support for the DiskOnChip Millennium.
- If you have problems with this driver and the DiskOnChip Millennium,
- you may wish to try the alternative Millennium driver below. To use
- the alternative driver, you will need to undefine DOC_SINGLE_DRIVER
- in the drivers/mtd/docprobe.c source code.
+Direct chardevice access to MTD devices
+CONFIG_MTD_CHAR
+ This provides a character device for each MTD device present in
+ the system, allowing the user to read and write directly to the
+ memory chips, and also use ioctl() to obtain information about
+ the device, or to erase parts of it.
- If you use this device, you probably also want to enable the NFTL
- 'NAND Flash Translation Layer' option below, which is used to emulate
- a block device by using a kind of filesystem on the flash chips.
+Caching block device access to MTD devices
+CONFIG_MTD_BLOCK
+ Although most flash chips have an erase size too large to be useful
+ as block devices, it is possible to use MTD devices which are based
+ on RAM chips in this manner. This block device is a user of MTD devices
+ performing that function.
+
+ At the moment, it is also required for the Journalling Flash File
+ System(s) to obtain a handle on the MTD device when it's mounted
+ (although JFFS and JFFS2 don't actually use any of the functionality
+ of the mtdblock device).
-Alternative Disk-On-Chip Millennium support
-CONFIG_MTD_DOC2001
- This provides an alternative MTD device driver for the M-Systems
- DiskOnChip Millennium devices. Use this if you have problems with
- the combined DiskOnChip 2000 and Millennium driver above. To get
- the DiskOnChip probe code to load and use this driver instead of
- the other one, you will need to undefine DOC_SINGLE_DRIVER near
- the beginning of drivers/mtd/docprobe.c
+ Later, it may be extended to perform read/erase/modify/write cycles
+ on flash chips to emulate a smaller block size. Needless to say,
+ this is very unsafe, but could be useful for filesystems which are
+ almost never written to.
- If you use this device, you probably also want to enable the NFTL
- 'NAND Flash Translation Layer' option below, which is used to emulate
- a block device by using a kind of filesystem on the flash chips.
+ You do not need this option for use with the DiskOnChip devices. For
+ those, enable NFTL support (CONFIG_NFTL) instead.
-Ramix PMC551 PCI Mezzanine ram card support
-CONFIG_MTD_PMC551
- This provides a MTD device driver for the Ramix PMC551 RAM PCI card
- from Ramix Inc. (http://www.ramix.com/products/memory/pmc551.html).
- These devices come in memory configurations from 32M - 1G. If you
- have one, you probably want to enable this.
+Readonly block device access to MTD devices
+CONFIG_MTD_BLOCK_RO
+ This allows you to mount read-only filesystems (such as cramfs) from
+ an MTD device, without the overhead (and danger) of the caching
+ driver.
- If this driver is compiled as a module you get the ability to select the
- size of the aperture window pointing into the devices memory. What this
- means is that if you have a 1G card, normally the kernel will use a 1G
- memory map as it's view of the device. As a module, you can select a
- 1M window into the memory and the driver will "slide" the window around
- the PMC551's memory. This was particularly useful on the 2.2 kernels
- on PPC architectures as there was limited kernel space to deal with.
+ You do not need this option for use with the DiskOnChip devices. For
+ those, enable NFTL support (CONFIG_NFTL) instead.
-Use extra onboard system memory as MTD device
-CONFIG_MTD_SLRAM
- If your CPU cannot cache all of the physical memory in your machine,
- you can still use it for storage or swap by using this driver to
- present it to the system as a Memory Technology Device.
+FTL (Flash Translation Layer) support
+CONFIG_FTL
+ This provides support for the original Flash Translation Layer which
+ is part of the PCMCIA specification. It uses a kind of pseudo-
+ filesystem on a flash device to emulate a block device with 512-byte
+ sectors, on top of which you put a 'normal' filesystem.
-PMC551 256M DRAM Bugfix
-CONFIG_MTD_PMC551_BUGFIX
- Some of Ramix's PMC551 boards with 256M configurations have invalid
- column and row mux values. This option will fix them, but will break
- other memory configurations. If unsure say N.
+ You may find that the algorithms used in this code are patented
+ unless you live in the Free World where software patents aren't
+ legal - in the USA you are only permitted to use this on PCMCIA
+ hardware, although under the terms of the GPL you're obviously
+ permitted to copy, modify and distribute the code as you wish. Just
+ not use it.
-PMC551 Debugging
-CONFIG_MTD_PMC551_DEBUG
- This option makes the PMC551 more verbose during it's operation and is
- only really useful if you are developing on this driver or suspect a
- possible hardware or driver bug. If unsure say N.
+NFTL (NAND Flash Translation Layer) support
+CONFIG_NFTL
+ This provides support for the NAND Flash Translation Layer which is
+ used on M-Systems' DiskOnChip devices. It uses a kind of pseudo-
+ filesystem on a flash device to emulate a block device with 512-byte
+ sectors, on top of which you put a 'normal' filesystem.
-Debugging RAM test driver
-CONFIG_MTD_MTDRAM
- This enables a test MTD device driver which uses vmalloc() to
- provide storage. You probably want to say 'N' unless you're
- testing stuff.
+ You may find that the algorithms used in this code are patented
+ unless you live in the Free World where software patents aren't
+ legal - in the USA you are only permitted to use this on DiskOnChip
+ hardware, although under the terms of the GPL you're obviously
+ permitted to copy, modify and distribute the code as you wish. Just
+ not use it.
+
+Write support for NFTL (EXPERIMENTAL)
+CONFIG_NFTL_RW
+ If you're lucky, this will actually work. Don't whinge if it doesn't.
+ Send mail to the MTD mailing list if
+ you want to help to make it more reliable.
Common Flash Interface (CFI) support
CONFIG_MTD_CFI
@@ -10277,12 +10336,135 @@
option. Visit (http://www.amd.com/products/nvd/overview/cfi.html)
for more information on CFI.
-CFI support for Intel/Sharp Extended Command Set chips
+CFI Advanced configuration options
+CONFIG_MTD_CFI_ADV_OPTIONS
+ If you need to specify a specific endianness for access to flash
+ chips, or if you wish to reduce the size of the kernel by including
+ support for only specific arrangements of flash chips, say 'Y'. This
+ option does not directly affect the code, but will enable other
+ configuration options which allow you to do so.
+
+ If unsure, say 'N'.
+
+Specific CFI Flash geometry selection
+CONFIG_MTD_CFI_GEOMETRY
+ This option does not affect the code directly, but will enable
+ some other configuration options which would allow you to reduce
+ the size of the kernel by including support for only certain
+ arrangements of CFI chips. If unsure, say 'N' and all options
+ which are supported by the current code will be enabled.
+
+Support 8-bit buswidth
+CONFIG_MTD_CFI_B1
+ If you wish to support CFI devices on a physical bus which is
+ 8 bits wide, say 'Y'.
+
+Support 16-bit buswidth
+CONFIG_MTD_CFI_B2
+ If you wish to support CFI devices on a physical bus which is
+ 16 bits wide, say 'Y'.
+
+Support 32-bit buswidth
+CONFIG_MTD_CFI_B4
+ If you wish to support CFI devices on a physical bus which is
+ 32 bits wide, say 'Y'.
+
+Support 1-chip flash interleave
+CONFIG_MTD_CFI_I1
+ If your flash chips are not interleaved - i.e. you only have one
+ flash chip addressed by each bus cycle, then say 'Y'.
+
+Support 2-chip flash interleave
+CONFIG_MTD_CFI_I2
+ If your flash chips are interleaved in pairs - i.e. you have two
+ flash chips addressed by each bus cycle, then say 'Y'.
+
+Support 4-chip flash interleave
+CONFIG_MTD_CFI_I4
+ If your flash chips are interleaved in fours - i.e. you have four
+ flash chips addressed by each bus cycle, then say 'Y'.
+
+Flash cmd/query data swapping
+CONFIG_MTD_CFI_NOSWAP
+ This option defines the way in which the CPU attempts to arrange
+ data bits when writing the 'magic' commands to the chips. Saying
+ 'NO', which is the default when CONFIG_MTD_CFI_ADV_OPTIONS isn't
+ enabled, means that the CPU will not do any swapping; the chips
+ are expected to be wired to the CPU in 'host-endian' form.
+ Specific arrangements are possible with the BIG_ENDIAN_BYTE and
+ LITTLE_ENDIAN_BYTE, if the bytes are reversed.
+
+ If you have a LART, on which the data (and address) lines were
+ connected in a fashion which ensured that the nets were as short
+ as possible, resulting in a bit-shuffling which seems utterly
+ random to the untrained eye, you need the LART_ENDIAN_BYTE option.
+
+ Yes, there really exists something sicker than PDP-endian :)
+
+CFI support for Intel/Sharp Extended Commands
CONFIG_MTD_CFI_INTELEXT
The Common Flash Interface defines a number of different command
sets which a CFI-compliant chip may claim to implement. This code
provides support for one of those command sets, used on Intel
- Strataflash and other parts.
+ StrataFlash and other parts.
+
+CFI support for AMD/Fujitsu Standard Commands
+CONFIG_MTD_CFI_AMDSTD
+ The Common Flash Interface defines a number of different command
+ sets which a CFI-compliant chip may claim to implement. This code
+ provides support for one of those command sets, used on chips
+ chips including the AMD Am29LV320.
+
+CFI support for Intel/Sharp Standard Commands
+CONFIG_MTD_CFI_INTELSTD
+ The Common Flash Interface defines a number of different command
+ sets which a CFI-compliant chip may claim to implement. This code
+ provides support for one of those command sets.
+
+pre-CFI Sharp chip support
+CONFIG_MTD_SHARP
+ This option enables support for flash chips using Sharp-compatible
+ commands, including some which are not CFI-compatible and hence
+ cannot be used with the CONFIG_MTD_CFI_INTELxxx options.
+
+AMD compatible flash chip support (non-CFI)
+CONFIG_MTD_AMDSTD
+ This option enables support for flash chips using AMD-compatible
+ commands, including some which are not CFI-compatible and hence
+ cannot be used with the CONFIG_MTD_CFI_AMDSTD option.
+
+ It also works on AMD compatible chips that do conform to CFI.
+
+Support for RAM chips in bus mapping
+CONFIG_MTD_RAM
+ This option enables basic support for RAM chips accessed through
+ a bus mapping driver.
+
+Support for ROM chips in bus mapping
+CONFIG_MTD_ROM
+ This option enables basic support for ROM chips accessed through
+ a bus mapping driver.
+
+CONFIG_MTD_JEDEC
+ Enable older older JEDEC flash interface devices for self programming
+ flash. It is commonly used in older AMD chips. It is only called
+ JEDEC because the JEDEC association (http://www.jedec.org/)
+ distributes the identification codes for the chips. WARNING!!!! This
+ code does not compile and is incomplete as are the specific JEDEC
+ devices drivers.
+
+CFI Flash device mapped on StrongARM SA11x0
+CONFIG_MTD_SA1100
+ This enables access to the flash chips on most platforms based on the
+ SA1100 and SA1110, including the Assabet and the Compaq iPAQ. If you
+ have such a board, say 'Y'.
+
+CONFIG_MTD_SA1100_REDBOOT_PARTITIONS
+ Enabling this option will cause the kernel to look for a RedBoot
+ FIS (Flash Image System) table in the last erase block of the flash
+ chips detected. If you are using RedBoot on your SA11x0-based board
+ and want Linux to present 'partitions' matching the images which
+ RedBoot has listed, say 'Y'.
Flash chip mapping in physical memory
CONFIG_MTD_PHYSMAP
@@ -10295,18 +10477,18 @@
Physical start location of flash chip mapping
CONFIG_MTD_PHYSMAP_START
This is the physical memory location at which the flash chips
- are mapped on your particular target board. Refer to the
+ are mapped on your particular target board. Refer to the
memory map which should hopefully be in the documentation for
your board.
Physical length of flash chip mapping
CONFIG_MTD_PHYSMAP_LEN
This is the total length of the mapping of the flash chips on
- your particular board. If there is space, or aliases, in the
+ your particular board. If there is space, or aliases, in the
physical memory map between the chips, this could be larger
than the total amount of flash present. Refer to the memory
map which should hopefully be in the documentation for your
- board.
+ board.
CONFIG_MTD_PHYSMAP_BUSWIDTH
This is the total width of the data bus of the flash devices
@@ -10314,14 +10496,12 @@
bits, you would set the bus width octect value to 4. This is
used internally by the CFI drivers.
-Flash chip mapping on Mixcom piggyback card
-CONFIG_MTD_MIXMEM
- This supports the paging arrangement for access to flash chips
- on the MixCOM piggyback card, allowing the flash chip drivers
- to get on with their job of driving the flash chips without
- having to know about the paging. If you have one of these boards,
- you probably want to enable this mapping driver. More info is at
- (http://www.itc.hu/).
+Flash chip mapping on Sun Microsystems boardsets
+CONFIG_MTD_SUN_UFLASH
+ This provides a 'mapping' driver which supports the way in
+ which user-programmable flash chips are connected on various
+ Sun Microsystems boardsets. This driver will require CFI support
+ in the kernel, so if you did not enable CFI previously, do that now.
Flash chip mapping on Nora
CONFIG_MTD_NORA
@@ -10332,13 +10512,6 @@
PNC-2000 is the name of Network Camera product from PHOTRON
Ltd. in Japan. It uses CFI-compliant flash.
-Flash chip mapping on Octagon 5066 SBC
-CONFIG_MTD_OCTAGON
- This provides a 'mapping' driver which supports the way in which
- the flash chips are connected in the Octagon-5066 Single Board
- Computer. More information on the board is available at
- (http://www.octagonsystems.com/Products/5066/5066.html).
-
Flash chip mapping on RPXlite PPC board
CONFIG_MTD_RPXLITE
The RPXLite PowerPC board has CFI-compliant chips mapped in
@@ -10347,6 +10520,89 @@
to communicate with the chips on the RPXLite board. More at
(http://www.embeddedplanet.com/rpx_lite_specification_sheet.htm).
+Flash chip mapping on AMD SC520 CDP board
+CONFIG_MTD_SC520CDP
+ The SC520 CDP board has two banks of CFI-compliant chips and one
+ Dual-in-line JEDEC chip. This 'mapping' driver supports that
+ arrangement, implementing three MTD devices.
+
+Flash chip mapping on Arcom Control Systems' SBC-MediaGX
+CONFIG_MTD_SBC_MEDIAGX
+ This provides a driver for the on-board flash of Arcom Control
+ Systems' SBC-MediaGX development board. By default the flash
+ is split into 3 partitions which are accessed as separate MTD
+ devices. This board utilizes Intel StrataFlash. More info at
+ (http://www.arcomcontrols.com/products/icp/pc104/processors/).
+
+Flash chip mapping on Arcom Control Systems' ELAN-104NC
+CONFIG_MTD_ELAN_104NC
+ This provides a driver for the on-board flash of the Arcom Control
+ System's ELAN-104NC development board. By default the flash
+ is split into 3 partitions which are accessed as separate MTD
+ devices. This board utilizes Intel StrataFlash. More info at
+ (http://www.arcomcontrols.com/products/icp/pc104/processors/).
+
+Flash chip mapping on Compaq iPAQ/Bitsy
+CONFIG_MTD_BITSY
+ This provides a driver for the on-board flash found in Compaq's
+ iPAQ Palm PC and their research prototype the Itsy. iPAQ info at
+ (http://www5.compaq.com/products/handhelds/pocketpc/) and the
+ Itsy (http://www.research.digital.com/wrl/projects/Itsy/index.html).
+
+Flash chip mapping on Compaq iPAQ/Bitsy
+CONFIG_MTD_DC21285
+ This provides a driver for the flash accessed using Intel's
+ 21285 bridge used with Intel's StrongARM processors. More info at
+ (http://developer.intel.com/design/bridge/quicklist/dsc-21285.htm).
+
+Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board
+CONFIG_MTD_CSTM_MIPS_IXX
+ This provides a mapping driver for the Integrated Tecnology
+ Express, Inc (ITE) QED-4N-S01B eval board and the Globespan IVR Reference
+ Board. It provides the necessary addressing, length, buswidth, vpp code
+ and addition setup of the flash device for these boards. In addition,
+ this mapping driver can be used for other boards via setting of the
+ CONFIG_MTD_CSTM_MIPS_IXX_START/LEN/BUSWIDTH parameters. This mapping
+ will provide one mtd device using one partition. The start address can
+ be offset from the beginning of flash and the len can be less than the
+ total flash device size to allow a window into the flash. Both CFI and
+ JEDEC probes are called.
+
+Physical start location of flash mapping
+CONFIG_MTD_CSTM_MIPS_IXX_START
+ This is the physical memory location that the MTD driver will
+ use for the flash chips on your particular target board.
+ Refer to the memory map which should hopefully be in the
+ documentation for your board.
+
+Physical length of flash mapping
+CONFIG_MTD_CSTM_MIPS_IXX_LEN
+ This is the total length that the MTD driver will use for the
+ flash chips on your particular board. Refer to the memory
+ map which should hopefully be in the documentation for your
+ board.
+
+Physical bus width of flash mapping
+CONFIG_MTD_CSTM_MIPS_IXX_BUSWIDTH
+ This is the total bus width of the mapping of the flash chips
+ on your particular board.
+
+Flash chip mapping on Mixcom piggyback card
+CONFIG_MTD_MIXMEM
+ This supports the paging arrangement for access to flash chips
+ on the MixCOM piggyback card, allowing the flash chip drivers
+ to get on with their job of driving the flash chips without
+ having to know about the paging. If you have one of these boards,
+ you probably want to enable this mapping driver. More info is at
+ (http://www.itc.hu/).
+
+Flash chip mapping on Octagon 5066 SBC
+CONFIG_MTD_OCTAGON
+ This provides a 'mapping' driver which supports the way in which
+ the flash chips are connected in the Octagon-5066 Single Board
+ Computer. More information on the board is available at
+ (http://www.octagonsystems.com/Products/5066/5066.html).
+
Flash chip mapping on Tempustech VMAX SBC301
CONFIG_MTD_VMAX
This provides a 'mapping' driver which supports the way in which
@@ -10354,57 +10610,168 @@
Board Computer. More information on the board is available at
(http://www.tempustech.com/tt301.htm).
-Direct chardevice access to MTD devices
-CONFIG_MTD_CHAR
- This provides a character device for each MTD device present in
- the system, allowing the user to read and write directly to the
- memory chips, and also use ioctl() to obtain information about
- the device, or to erase parts of it.
+Support for NAND flash devices
+CONFIG_MTD_NAND
+ This enables support for accessing all type of NAND flash
+ devices.
+
+Support for software ECC algorithm
+CONFIG_MTD_NAND_ECC
+ This enables software-based ECC for use with NAND flash chips. It
+ can detect and correct 1 bit errors per 256 byte blocks. This
+ should be used to increase the reliability of the data stored and
+ read on the device.
+
+Support for verify read after write
+CONFIG_MTD_NAND_VERIFY_WRITE
+ This adds an extra check when data is written to the flash. The
+ NAND flash device internally checks only bits transitioning
+ from 1 to 0. There is a rare possibility that even though the
+ device thinks the write was successful, a bit could have been
+ flipped accidentaly due to device wear, gamma rays, whatever.
+ Enable this if you are really paranoid.
-Pseudo-blockdevice access to MTD devices
-CONFIG_MTD_BLOCK
- Although flash chips have an erase size too large to useful as
- block devices, it is possible to use MTD devices which are based
- on RAM chips in this manner. This blockdevice user of MTD devices
- performs that function. At the moment, it is also required for
- the Journalling Flash File System to obtain a handle on the MTD
- device when it's mounted - although the JFFS doesn't actually use
- any of the functions of the mtdblock device.
+Support for the SPIA board
+CONFIG_MTD_NAND_SPIA
+ If you had to ask, you don't have one. Say 'N'.
- Later, it may be extended to perform read/erase/modify/write cycles
- on flash chips to emulate a smaller block size. Needless to say,
- this is very unsafe, but could be useful for file systems which are
- almost never written to.
+M-Systems Disk-On-Chip 1000 support
+CONFIG_MTD_DOC1000
+ This provides an MTD device driver for the M-Systems DiskOnChip
+ 1000 devices, which are obsolete so you probably want to say 'N'.
-FTL (Flash Translation Layer) support
-CONFIG_FTL
- This provides support for the original Flash Translation Layer which
- is part of the PCMCIA specification. It uses a kind of pseudo-
- file system on a flash device to emulate a block device with 512-byte
- sectors, on top of which you put a 'normal' file system. You may find
- that the algorithms used in this code are patented unless you live
- in the Free World where software patents aren't legal - in the USA
- you are only permitted to use this on PCMCIA hardware, although
- under the terms of the GPL you're obviously permitted to copy,
- modify and distribute the code as you wish. Just not use it.
+M-Systems Disk-On-Chip 2000 and Millennium support
+CONFIG_MTD_DOC2000
+ This provides an MTD device driver for the M-Systems DiskOnChip
+ 2000 and Millennium devices. Originally designed for the DiskOnChip
+ 2000, it also now includes support for the DiskOnChip Millennium.
+ If you have problems with this driver and the DiskOnChip Millennium,
+ you may wish to try the alternative Millennium driver below. To use
+ the alternative driver, you will need to undefine DOC_SINGLE_DRIVER
+ in the drivers/mtd/devices/docprobe.c source code.
-NFTL (NAND Flash Translation Layer) support
-CONFIG_NFTL
- This provides support for the NAND Flash Translation Layer which is
- used on M-Systems' DiskOnChip devices. It uses a kind of pseudo-
- file system on a flash device to emulate a block device with 512-byte
- sectors, on top of which you put a 'normal' file system. You may find
- that the algorithms used in this code are patented unless you live
- in the Free World where software patents aren't legal - in the USA
- you are only permitted to use this on DiskOnChip hardware, although
- under the terms of the GPL you're obviously permitted to copy,
- modify and distribute the code as you wish. Just not use it.
+ If you use this device, you probably also want to enable the NFTL
+ 'NAND Flash Translation Layer' option below, which is used to emulate
+ a block device by using a kind of filesystem on the flash chips.
-Write support for NFTL (EXPERIMENTAL)
-CONFIG_NFTL_RW
- If you're lucky, this will actually work. Don't whine if it doesn't.
- Contact (dwmw2@infradead.org) if you want to help to make it more
- reliable.
+Alternative Disk-On-Chip Millennium support
+CONFIG_MTD_DOC2001
+ This provides an alternative MTD device driver for the M-Systems
+ DiskOnChip Millennium devices. Use this if you have problems with
+ the combined DiskOnChip 2000 and Millennium driver above. To get
+ the DiskOnChip probe code to load and use this driver instead of
+ the other one, you will need to undefine DOC_SINGLE_DRIVER near
+ the beginning of drivers/mtd/devices/docprobe.c
+
+ If you use this device, you probably also want to enable the NFTL
+ 'NAND Flash Translation Layer' option below, which is used to emulate
+ a block device by using a kind of filesystem on the flash chips.
+
+Probe for DiskOnChip devices
+CONFIG_MTD_DOCPROBE
+ This isn't a real config option, it's derived.
+
+Advanced detection options for DiskOnChip
+CONFIG_MTD_DOCPROBE_ADVANCED
+ This option allows you to specify nonstandard address at which to
+ probe for a DiskOnChip, or to change the detection options. You're
+ unlikely to need any of this unless you're using LinuxBIOS. Say 'N'.
+
+Probe for 0x55 0xAA BIOS Extension Signature.
+CONFIG_MTD_DOCPROBE_55AA
+ Check for the 0x55 0xAA signature of a DiskOnChip, and do not continue
+ with probing if it is absent. The signature will always be present for
+ a DiskOnChip 2000 or a normal DiskOnChip Millennium. Only if you have
+ overwritten the first block of a DiskOnChip Millennium will it be
+ absent. Enable this option if you are using LinuxBIOS or if you need
+ to recover a DiskOnChip Millennium on which you have managed to wipe
+ the first block.
+
+Physical address of DiskOnChip
+CONFIG_MTD_DOCPROBE_ADDRESS
+ By default, the probe for DiskOnChip devices will look for a DiskOnChip
+ at every multiple of 0x2000 between 0xC8000 and 0xEE000. This option
+ allows you to specify a single address at which to probe for the device,
+ which is useful if you have other devices in that range which get upset
+ when they're probed.
+
+ (Note that on PowerPC, the normal probe will only check at 0xE4000000.)
+
+ Normally, you should leave this set to zero, to allow the probe at the
+ normal addresses.
+
+Probe high addresses
+CONFIG_MTD_DOCPROBE_HIGH
+ By default, the probe for DiskOnChip devices will look for a DiskOnChip
+ at every multiple of 0x2000 between 0xC8000 and 0xEE000. This option
+ changes to make it probe between 0xFFFC8000 and 0xFFFEE000. Unless
+ you're using LinuxBIOS, this is unlikely to be useful to you. Say 'N'.
+
+Ramix PMC551 PCI Mezzanine ram card support
+CONFIG_MTD_PMC551
+ This provides a MTD device driver for the Ramix PMC551 RAM PCI card
+ from Ramix Inc. (http://www.ramix.com/products/memory/pmc551.html).
+ These devices come in memory configurations from 32M - 1G. If you
+ have one, you probably want to enable this.
+
+ If this driver is compiled as a module you get the ability to select the
+ size of the aperture window pointing into the devices memory. What this
+ means is that if you have a 1G card, normally the kernel will use a 1G
+ memory map as it's view of the device. As a module, you can select a
+ 1M window into the memory and the driver will "slide" the window around
+ the PMC551's memory. This was particularly useful on the 2.2 kernels
+ on PPC architectures as there was limited kernel space to deal with.
+
+PMC551 256M DRAM Bugfix
+CONFIG_MTD_PMC551_BUGFIX
+ Some of Ramix's PMC551 boards with 256M configurations have invalid column
+ and row mux values. This option will fix them, but will break other memory
+ configurations. If unsure say N.
+
+PMC551 Debugging
+CONFIG_MTD_PMC551_DEBUG
+ This option makes the PMC551 more verbose during it's operation and is only
+ really usefull if you are developing on this driver or suspect a possible
+ hardware or driver bug. If unsure say N.
+
+Use extra onboard system memory as MTD device
+CONFIG_MTD_SLRAM
+ If your CPU cannot cache all of the physical memory in your machine,
+ you can still use it for storage or swap by using this driver to
+ present it to the system as a Memory Technology Device.
+
+Debugging RAM test driver
+CONFIG_MTD_MTDRAM
+ This enables a test MTD device driver which uses vmalloc() to
+ provide storage. You probably want to say 'N' unless you're
+ testing stuff.
+
+MTDRAM erase block size in KiB
+CONFIG_MTDRAM_ERASE_SIZE
+ This allows you to configure the size of the erase blocks in the
+ device emulated by the MTDRAM driver. If the MTDRAM driver is built
+ as a module, it is also possible to specify this as a parameter when
+ loading the module.
+
+MTDRAM device size in KiB
+CONFIG_MTDRAM_TOTAL_SIZE
+ This allows you to configure the total size of the MTD device
+ emulated by the MTDRAM driver. If the MTDRAM driver is built
+ as a module, it is also possible to specify this as a parameter when
+ loading the module.
+
+SRAM absolute position
+CONFIG_MTDRAM_ABS_POS
+ If you have system RAM accessible by the CPU but not used by Linux
+ in normal operation, you can give the physical address at which the
+ available RAM starts, and the MTDRAM driver will use it instead of
+ allocating space from Linux's available memory. Otherwise, leave
+ this set to zero. Most people will want to leave this as zero.
+
+Flash chip mapping on the Flaga Digital Module
+CONFIG_MTD_CFI_FLAGADM
+ Mapping for the Flaga digital module. If you don´t have one, ignore this
+ setting.
Support for USB
CONFIG_USB
@@ -10709,9 +11076,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 +11496,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
@@ -13241,8 +13610,8 @@
Apple Desktop Bus support
CONFIG_ADB
Apple Desktop Bus (ADB) support is for support of devices which
- are connected to the to an ADB port. ADB devices tend to have
- 4 pins. If you have an Apple Macintosh prior to the iMac, or a
+ are connected to an ADB port. ADB devices tend to have 4 pins.
+ If you have an Apple Macintosh prior to the iMac, or a
"Blue and White G3", you probably want to say Y here. Otherwise
say N.
@@ -14883,17 +15252,20 @@
If unsure, say Y.
-ACI mixer (miroPCM12/PCM20)
+ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)
CONFIG_SOUND_ACI_MIXER
ACI (Audio Command Interface) is a protocol used to communicate with
- the microcontroller on some sound cards produced by miro, e.g. the
- miroSOUND PCM12 and PCM20. The main function of the ACI is to
- control the mixer and to get a product identification.
-
- This Voxware ACI driver currently only supports the ACI functions on
- the miroSOUND PCM12 and PCM20 cards. On the PCM20, ACI also controls
- the radio tuner. This is supported in the video4linux
- radio-miropcm20 driver.
+ the microcontroller on some sound cards produced by miro and Cardinal
+ Technologies. The main function of the ACI is to control the mixer
+ and to get a product identification.
+
+ This Voxware ACI driver currently supports the ACI functions on the
+ miroSOUND PCM1-pro, PCM12 and PCM20 radio. On the PCM20 radio, ACI
+ also controls the radio tuner. This is supported in the video4linux
+ miropcm20 driver (say M or Y here and go back to "Multimedia devices"
+ -> "Radio Adapters").
+
+ This driver is also available as a module and will be called aci.o.
SB32/AWE support
CONFIG_SOUND_AWE32_SYNTH
@@ -16711,11 +17083,11 @@
say M here and read Documentation/modules.txt. The module will be
called i2c-parport.o.
-Miro PCM20 Radio
+miroSOUND PCM20 radio
CONFIG_RADIO_MIROPCM20
- Choose Y here if you have this FM radio card. You also need to say Y
- to "ACI mixer (miroPCM12/PCM20)" (in "additional low level sound
- drivers") for this to work.
+ Choose Y here if you have this sound card. You also need to say Y
+ to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound")
+ for this to work.
In order to control your radio card, you will need to use programs
that are compatible with the Video for Linux API. Information on
@@ -16725,7 +17097,21 @@
If you want to compile this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read Documentation/modules.txt. The module will be
- called radio-miropcm20.o
+ called miropcm20.o
+
+miroSOUND PCM20 radio RDS user interface (EXPERIMENTAL)
+CONFIG_RADIO_MIROPCM20_RDS
+ Choose Y here if you want to see RDS/RBDS information like RadioText,
+ Programme Service name, Clock Time and date, Programme TYpe and
+ Traffic Announcement/Programme identification. You also need to say
+ Y to "miroSOUND PCM20 radio" and devfs!
+
+ It's not possible to read the raw RDS packets from the device, so
+ the driver cant provide an V4L interface for this. But the
+ availability of RDS is reported over V4L by the basic driver already.
+ Here RDS can be read from files in /dev/v4l/rds.
+
+ As module the driver will be called miropcm20-rds.o.
GemTek Radio Card
CONFIG_RADIO_GEMTEK
diff -u --recursive --new-file v2.4.5/linux/Documentation/filesystems/devfs/ChangeLog linux/Documentation/filesystems/devfs/ChangeLog
--- v2.4.5/linux/Documentation/filesystems/devfs/ChangeLog Fri Apr 6 10:42:48 2001
+++ linux/Documentation/filesystems/devfs/ChangeLog Tue Jun 12 10:57:46 2001
@@ -1613,3 +1613,35 @@
- Updated README from master HTML file
- Ported to kernel 2.4.0-test3-pre4 (which had devfs-patch-v174)
+===============================================================================
+Changes for patch v177
+
+- Updated README from master HTML file
+
+- Documentation cleanups
+
+- Ensure terminates string for root entry
+ Thanks to Tim Jansen
+
+- Exported to modules
+
+- Make send events to devfsd
+
+- Cleaned up option processing in
+
+- Fixed bugs in handling symlinks: could leak or cause Oops
+
+- Cleaned up directory handling by separating fops
+ Thanks to Alexander Viro
+===============================================================================
+Changes for patch v178
+
+- Fixed handling of inverted options in
+===============================================================================
+Changes for patch v179
+
+- Adjusted to account for fix
+===============================================================================
+Changes for patch v180
+
+- Fixed !CONFIG_DEVFS_FS stub declaration of
diff -u --recursive --new-file v2.4.5/linux/Documentation/filesystems/devfs/README linux/Documentation/filesystems/devfs/README
--- v2.4.5/linux/Documentation/filesystems/devfs/README Wed Nov 29 10:11:38 2000
+++ linux/Documentation/filesystems/devfs/README Tue Jun 12 10:57:46 2001
@@ -3,7 +3,7 @@
Linux Devfs (Device File System) FAQ
Richard Gooch
-3-JUL-2000
+26-APR-2001
-----------------------------------------------------------------------------
@@ -18,7 +18,7 @@
http://www.atnf.csiro.au/~rgooch/linux/
-NEWFLASH: The official 2.3.46 kernel has
+NEWSFLASH: The official 2.3.46 kernel has
included the devfs patch. Future patches will be released which
build on this. These patches are rolled into Linus' tree from time to
time.
@@ -54,6 +54,7 @@
Other Issues
Kernel Naming Scheme
Devfsd Naming Scheme
+Old Compatibility Names
SCSI Host Probing Issues
@@ -99,6 +100,7 @@
can easily mount the root filesystem by referring to an entry in the
devfs namespace.
+
The cost of devfs is a small increase in kernel code size and memory
usage. About 7 pages of code (some of that in __init sections) and 72
bytes for each entry in the namespace. A modest system has only a
@@ -157,6 +159,7 @@
of nodes. This means that changes in the kernel must be reflected by
changes in the MAKEDEV programme, or else the system administrator
creates device nodes by hand.
+
The basic problem is that there are two separate databases of
major and minor numbers. One is in the kernel and one is in /dev (or
in a MAKEDEV programme, if you want to look at it that way). This is
@@ -192,6 +195,7 @@
256 kBytes of /dev inodes, but you could argue that embedded systems
would have hand-tuned /dev directories. I've had to do just that on my
embedded systems, but I would rather just leave it to devfs.
+
Another issue is the time taken to lookup an inode when first
referenced. Not only does this take time in scanning through a list in
memory, but also the seek times to read the inodes off disc.
@@ -212,7 +216,7 @@
likely be implemented in an ad-hoc fashion, as different drivers will
provide their information in different ways.
-Devfs is much cleaner, because it (natually) has a uniform mechanism
+Devfs is much cleaner, because it (naturally) has a uniform mechanism
to provide this information: the device nodes themselves!
@@ -253,7 +257,7 @@
But why do that search at all if you don't have to? Once again, it
seems pointless.
-Note thate devfs doesn't use the major&minor system. For devfs
+Note that devfs doesn't use the major&minor system. For devfs
entries, the connection is done when you lookup the /dev entry. When
devfs_register() is called, an internal table is appended which has
the entry name and the file_operations. If the dentry cache doesn't
@@ -274,9 +278,9 @@
/dev as a system administration tool
Right now /dev contains a list of conceivable devices, most of which I
-don't have. A devfs would only show those devices available on my
-system. This means that listing /dev would be a handy way of checking
-what devices were available.
+don't have. Devfs only shows those devices available on my
+system. This means that listing /dev is a handy way of checking what
+devices are available.
Major&minor size
@@ -289,9 +293,9 @@
each device entry, which can be used to give an effective 32 bit
device identifier (i.e. that's like having a 32 bit minor
number). Since this is private to the kernel, there are no C library
-compatibility which you would have with increasing major and minor
-number sizes. See the section on "Allocation of Device Numbers" for
-details on maintaining compatibility with userspace.
+compatibility issues which you would have with increasing major and
+minor number sizes. See the section on "Allocation of Device Numbers"
+for details on maintaining compatibility with userspace.
Solving this requires a kernel change.
@@ -375,9 +379,9 @@
devfsd on any event, such as registration/unregistration of device
entries, opening and closing devices, looking up inodes, scanning
directories and more. This has many possibilities. Some of these are
-already implemented.
+already implemented. See:
+
-See:
http://www.atnf.csiro.au/~rgooch/linux/
Device entry registration events can be used by devfsd to change
@@ -414,6 +418,7 @@
requests. Instead of using kmod directly, the event is sent to
devfsd which can implement an arbitrary authentication before loading
the module itself.
+
Inode lookup events can also be used to construct arbitrary
namespaces, without having to resort to populating devfs with symlinks
to devices that don't exist.
@@ -447,10 +452,10 @@
Who else does it?
-FreeBSD has a devfs implementation. Solaris 2 has a pseudo-devfs
-(something akin to scsidev but for all devices, with some unspecified
-kernel support). BeOS, Plan9 and QNX also have it. SGI's IRIX 6.4 and
-above also have a device filesystem.
+FreeBSD has a devfs implementation. Solaris and AIX each have a
+pseudo-devfs (something akin to scsidev but for all devices, with some
+unspecified kernel support). BeOS, Plan9 and QNX also have it. SGI's
+IRIX 6.4 and above also have a device filesystem.
While we shouldn't just automatically do something because others do
it, we should not ignore the work of others either. FreeBSD has a lot
@@ -613,6 +618,21 @@
are problems with dealing with symlinks, I'm suspicious of the level
of security offered in any case.
+A better solution is to install util-linux-2.10.h or later, which
+fixes a bug with ttyname handling in the login programme. Then append
+the following lines to your /etc/securetty file:
+
+vc/1
+vc/2
+vc/3
+vc/4
+vc/5
+vc/6
+vc/7
+vc/8
+
+This will not weaken security.
+
XFree86
While not essential, it's probably a good idea to upgrade to XFree86
4.0, as patches went in to make it more devfs-friendly. If you don't,
@@ -627,17 +647,25 @@
# file classes -- these are regular expressions
-=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
-+=tty[0-9][0-9]* [0-9][0-9]* :[0-9]\.[0-9] :[0-9]
++=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
# device classes -- these are shell-style globs
=/dev/fd[0-1]*
+If the patch does not apply, then change the line:
+
+=tty[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
+
+with:
+
+=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
+
Disable devpts
I've had a report of devpts mounted on /dev/pts not working
correctly. Since devfs will also manage /dev/pts, there is no
need to mount devpts as well. You should either edit your
-/etc/fstab so devpts is not mounted, or disable devfs from
+/etc/fstab so devpts is not mounted, or disable devpts from
your kernel configuration.
Unsupported drivers
@@ -664,15 +692,23 @@
The Kernel
Finally, you need to make sure devfs is compiled into your
-kernel. Set CONFIG_DEVFS_FS=y and recompile your kernel. Next, you
-need to make sure devfs is mounted. The best solution is to pass
-devfs=mount at the kernel boot command line. You can edit
-/etc/lilo.conf and add the line:
-
-append = "devfs=mount"
+kernel. Set CONFIG_DEVFS_FS=y and CONFIG_DEVFS_MOUNT=y and recompile
+your kernel. At boot, devfs will be mounted onto /dev.
-
-This will make the kernel mount devfs at boot time onto /dev.
+If you encounter problems booting (for example if you forgot a
+configuration step), you can pass devfs=nomount at the kernel
+boot command line. This will prevent the kernel from mounting devfs at
+boot time onto /dev.
+
+In general, a kernel built with CONFIG_DEVFS_FS=y but without mounting
+devfs onto /dev is completely safe, and requires no
+configuration changes. One exception to take note of is when
+LABEL= directives are used in /etc/fstab. In this
+case you will be unable to boot properly. This is because the
+mount(8) programme uses /proc/partitions as part of
+the volume label search process, and the device names it finds are not
+available, because setting CONFIG_DEVFS_FS=y changes the names in
+/proc/partitions, irrespective of whether devfs is mounted.
Now you've finished all the steps required. You're now ready to boot
your shiny new kernel. Enjoy.
@@ -701,7 +737,7 @@
permissions. It may be configured to record changes in permissions and
will save them in a database (in fact a directory tree), and restore
these upon boot. This is an efficient method and results in immediate
-saving of current permissions (unlike the tar approach, which save
+saving of current permissions (unlike the tar approach, which saves
permissions at some unspecified future time).
The default configuration file supplied with devfsd has config entries
@@ -745,8 +781,11 @@
+
add the following lines to your /etc/devfsd.conf file:
+REGISTER ^pt[sy]/.* IGNORE
+CHANGE ^pt[sy]/.* IGNORE
REGISTER .* COPY /dev-state/$devname $devpath
CHANGE .* COPY $devpath /dev-state/$devname
CREATE .* COPY $devpath /dev-state/$devname
@@ -758,6 +797,17 @@
+Permissions database stored in normal directory
+
+If you are using an older kernel which doesn't support VFS binding,
+then you won't be able to have the permissions database in a
+mounted-over /dev. However, you can still use a regular
+directory to store the database. The sample /etc/devfsd.conf
+file above may still be used. You will need to create the
+/dev-state directory prior to installing devfsd. If you have
+old permissions in /dev, then just copy the device nodes over
+to the new directory.
+
Dealing with drivers without devfs support
@@ -910,13 +960,48 @@
configuration file is installed, which is used by the MODLOAD
action. This should be sufficient for most configurations. If you
require further configuration, edit your /etc/modules.conf
-file.
+file. The way module autoloading work with devfs is:
+
+
+a process attempts to lookup a device node (e.g. /dev/fred)
+
+
+if that device node does not exist, the full pathname is passed to
+devfsd as a string
+
+
+devfsd will pass the string to the modprobe programme (provided the
+configuration line shown above is present), and specifies that
+/etc/modules.devfs is the configuration file
+
+
+/etc/modules.devfs includes /etc/modules.conf to
+access local configurations
+
+modprobe will search it's configuration files, looking for an alias
+that translates the pathname into a module name
+
+
+the translated pathname is then used to load the module.
+
+
+If you wanted a lookup of /dev/fred to load the
+mymod module, you would require the following configuration
+line in /etc/modules.conf:
+
+alias /dev/fred mymod
+
+The /etc/modules.devfs configuration file provides many such
+aliases for standard device names. If you look closely at this file,
+you will note that some modules require multiple alias configuration
+lines. This is required to support module autoloading for old and new
+device names.
Mounting root off a devfs device
If you wish to mount root off a devfs device when you pass the
-"devfs=only" boot option, then you need to pass in the "root="
-option to the kernel when booting. If you use LILO, then you must have
-this in lilo.conf:
+"devfs=only" boot option, then you need to pass in the
+"root=" option to the kernel when booting. If you use
+LILO, then you must have this in lilo.conf:
append = "root="
@@ -926,12 +1011,12 @@
root =
-then LILO will determine the device number of and will write
-that device number into a special place in the kernel image before
-starting the kernel, and the kernel will use that device number to
-mount the root filesystem. So, using the "append" variety ensures that
-LILO passes the root filesystem device as a string, which devfs can
-then use.
+then LILO will determine the device number of and will
+write that device number into a special place in the kernel image
+before starting the kernel, and the kernel will use that device number
+to mount the root filesystem. So, using the "append" variety ensures
+that LILO passes the root filesystem device as a string, which devfs
+can then use.
Note that this isn't an issue if you don't pass "devfs=only".
@@ -1067,7 +1152,8 @@
-------- -------- -----------
/dev/tts/{0,1,...} /dev/ttyS{0,1,...} Serial ports
/dev/cua/{0,1,...} /dev/cua{0,1,...} Call out devices
- /dev/vc/{0,1,...} /dev/tty{1...63} Virtual consoles
+ /dev/vc/0 /dev/tty Current virtual console
+ /dev/vc/{1,2,...} /dev/tty{1...63} Virtual consoles
/dev/vcc/{0,1,...} /dev/vcs{1...63} Virtual consoles
/dev/pty/m{0,1,...} /dev/ptyp?? PTY masters
/dev/pty/s{0,1,...} /dev/ttyp?? PTY slaves
@@ -1109,7 +1195,8 @@
cases, the kernel-supplied naming scheme is quite convenient, so
devfsd does not provide another naming scheme. The convenience names
that devfsd creates are in fact the same names as the original devfs
-kernel patch created (before Linus mandated the Big Name Change).
+kernel patch created (before Linus mandated the Big Name
+Change). These are referred to as "new compatibility entries".
In order to configure devfsd to create these convenience names, the
following lines should be placed in your /etc/devfsd.conf:
@@ -1198,6 +1285,24 @@
would appear as /dev/xd/c0t0.
+Old Compatibility Names
+
+The old compatibility names are the legacy device names, such as
+/dev/hda, /dev/sda, /dev/rtc and so on.
+Devfsd can be configured to create compatibility symlinks so that you
+may continue to use the old names in your configuration files and so
+that old applications will continue to function correctly.
+
+In order to configure devfsd to create these legacy names, the
+following lines should be placed in your /etc/devfsd.conf:
+
+REGISTER .* MKOLDCOMPAT
+UNREGISTER .* RMOLDCOMPAT
+
+This will cause devfsd to create (and destroy) symbolic links which
+point to the kernel-supplied names.
+
+
SCSI Host Probing Issues
Devfs allows you to identify SCSI discs based in part on SCSI host
@@ -1220,14 +1325,15 @@
means that devices connected to
-- first aha1542 controller - will be c0b#t#u#
-- first parallel port ZIP - will be c1b#t#u#
-- second aha1542 controller - will be c2b#t#u#
-- first NCR53C7xx controller - will be c4b#t#u#
-- any extra controller - will be c5b#t#u#, c6b#t#u#, etc
+- first aha1542 controller - will be /dev/scsi/host0/bus#/target#/lun#
+- first parallel port ZIP - will be /dev/scsi/host1/bus#/target#/lun#
+- second aha1542 controller - will be /dev/scsi/host2/bus#/target#/lun#
+- first NCR53C7xx controller - will be /dev/scsi/host4/bus#/target#/lun#
+- any extra controller - will be /dev/scsi/host5/bus#/target#/lun#,
+ /dev/scsi/host6/bus#/target#/lun#, etc
- if any of above controllers will not be found - the reserved names will
not be used by any other device.
-- c3b#t#u# names will never be used
+- /dev/scsi/host3/bus#/target#/lun# names will never be used
You can use ',' instead of ':' as the separator character if you
@@ -1343,6 +1449,7 @@
Making things work
Alternatives to devfs
+What I don't like about devfs
@@ -1518,6 +1625,54 @@
+
+What I don't like about devfs
+
+Here are some common complaints about devfs, and some suggestions and
+solutions that may make it more palatable for you. I can't please
+everybody, but I do try :-)
+
+I hate the naming scheme
+
+First, remember that no naming scheme will please everybody. You hate
+the scheme, others love it. Who's to say who's right and who's wrong?
+Ultimately, the person who writes the code gets to choose, and what
+exists now is a combination of the the choices made by the
+devfs author and the
+kernel maintainer (Linus).
+
+However, not all is lost. If you want to create your own naming
+scheme, it is a simple matter to write a standalone script, hack
+devfsd, or write a script called by devfsd. You can create whatever
+naming scheme you like.
+
+Further, if you want to remove all traces of the devfs naming scheme
+from /dev, you can mount devfs elsewhere (say
+/devfs) and populate /dev with links into
+/devfs. This population can be automated using devfsd if you
+wish.
+
+You can even use the VFS binding facility to make the links, rather
+than using symbolic links. This way, you don't even have to see the
+"destination" of these symbolic links.
+
+Devfs puts policy into the kernel
+
+There's already policy in the kernel. Device numbers are in fact
+policy (why should the kernel dictate what device numbers I use?).
+Face it, some policy has to be in the kernel. The real difference
+between device names as policy and device numbers as policy is that
+no one will use device numbers directly, because device
+numbers are devoid of meaning to humans and are ugly. At least with
+the devfs device names, (even though you can add your own naming
+scheme) some people will use the devfs-supplied names directly. This
+offends some people :-)
+
+Devfs is bloatware
+
+This is not even remotely true. As shown above,
+both code and data size are quite modest.
+
-----------------------------------------------------------------------------
@@ -1550,6 +1705,14 @@
http://johannes.erdfelt.com/hotswap.txt.
Johannes has promised a HTML version will follow.
+
+
+I presented an invited
+paper
+at the
+
+2nd Annual Storage Management Workshop held in Miamia, Florida,
+U.S.A. in October 2000.
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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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/Documentation/sound/README.OSS linux/Documentation/sound/README.OSS
--- v2.4.5/linux/Documentation/sound/README.OSS Wed Apr 11 19:02:27 2001
+++ linux/Documentation/sound/README.OSS Tue Jun 12 10:56:11 2001
@@ -17,7 +17,7 @@
document can be still interesting and very helpful.
[ File edited 17.01.1999 - Riccardo Facchetti ]
-[ Edited miroSOUND section 17.09.2000 - Robert Siemer ]
+[ Edited miroSOUND section 19.04.2001 - Robert Siemer ]
OSS/Free version 3.8 release notes
----------------------------------
@@ -1327,7 +1327,7 @@
---------
The miroSOUND PCM1-pro, PCM12 and PCM20 radio has been used
-successfully. This card is based on the MAD16, OPL4, and CS4231A chips
+successfully. These cards are based on the MAD16, OPL4, and CS4231A chips
and everything said in the section about MAD16 cards applies here,
too. The only major difference between the PCMxx and other MAD16 cards
is that instead of the mixer in the CS4231 codec a separate mixer
@@ -1337,8 +1337,8 @@
you compile this ACI driver together with the normal MAD16 support
when you use a miroSOUND PCMxx card. The ACI mixer is controlled by
/dev/mixer and the CS4231 mixer by /dev/mixer1 (depends on load
-time). Only in special cases you want to change something on the CS4231
-mixer.
+time). Only in special cases you want to change something regularly on
+the CS4231 mixer.
The miroSOUND PCM12 and PCM20 radio is capable of full duplex
operation (simultaneous PCM replay and recording), which allows you to
@@ -1354,10 +1354,9 @@
miropcm20.o module. Also the 7-band equalizer is integrated
(limited by the OSS-design). Developement has started and maybe
finished for the RDS decoder on this card, too. You will be able to
-read radio text, the program service name, program type and
+read RadioText, the Programme Service name, Programme TYpe and
others. Even the v4l radio module benefits from it with a refined
-strength value. See aci.c, radio-miropcm20.c and rds-miropcm20.c for
-more details.
+strength value. See aci.[ch] and miropcm20*.[ch] for more details.
The following configuration parameters have worked fine for the PCM12
in Markus Kuhn's system, many other configurations might work, too:
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 Tue Jun 12 10:34:48 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
@@ -712,16 +712,11 @@
M: perex@suse.cz
S: Maintained
-ISDN SUBSYSTEM (general)
-P: Fritz Elfert
-M: fritz@isdn4linux.de
-L: isdn4linux@listserv.isdn4linux.de
-W: http://www.isdn4linux.de
-S: Maintained
-
-ISDN SUBSYSTEM (card drivers)
+ISDN SUBSYSTEM
P: Karsten Keil
M: kkeil@suse.de
+P: Kai Germaschewski
+M: kai.germaschewski@gmx.de
L: isdn4linux@listserv.isdn4linux.de
W: http://www.isdn4linux.de
S: Maintained
@@ -804,9 +799,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 +1082,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 +1342,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 +1566,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 12 11:06:54 2001
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 4
-SUBLEVEL = 5
-EXTRAVERSION =
+SUBLEVEL = 6
+EXTRAVERSION =-pre3
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
@@ -87,7 +87,8 @@
CPPFLAGS := -D__KERNEL__ -I$(HPATH)
-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing
+CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+ -fomit-frame-pointer -fno-strict-aliasing
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
#
@@ -177,6 +178,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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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/osf_sys.c linux/arch/alpha/kernel/osf_sys.c
--- v2.4.5/linux/arch/alpha/kernel/osf_sys.c Mon Mar 19 12:35:09 2001
+++ linux/arch/alpha/kernel/osf_sys.c Tue Jun 12 10:26:14 2001
@@ -44,7 +44,6 @@
extern int do_pipe(int *);
-extern asmlinkage int sys_swapon(const char *specialfile, int swap_flags);
extern asmlinkage unsigned long sys_brk(unsigned long);
/*
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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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/alpha/kernel/sys_sable.c linux/arch/alpha/kernel/sys_sable.c
--- v2.4.5/linux/arch/alpha/kernel/sys_sable.c Fri Oct 27 10:55:01 2000
+++ linux/arch/alpha/kernel/sys_sable.c Tue Jun 12 11:44:59 2001
@@ -96,7 +96,7 @@
static inline void
sable_update_irq_hw(unsigned long bit, unsigned long mask)
{
- int port = 0x536;
+ int port = 0x537;
if (bit >= 16) {
port = 0x53d;
@@ -121,7 +121,7 @@
} else if (bit >= 8) {
port = 0x53a;
val1 = 0xE0 | (bit - 8);
- val2 = 0xE0 | 2;
+ val2 = 0xE0 | 3;
} else {
port = 0x536;
val1 = 0xE0 | (bit - 0);
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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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/defconfig linux/arch/i386/defconfig
--- v2.4.5/linux/arch/i386/defconfig Fri May 25 18:28:53 2001
+++ linux/arch/i386/defconfig Tue Jun 12 11:00:43 2001
@@ -103,6 +103,64 @@
# CONFIG_MTD is not set
#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_AMDSTD is not set
+# CONFIG_MTD_SHARP is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_JEDEC is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_SUN_UFLASH is not set
+# CONFIG_MTD_NORA is not set
+# CONFIG_MTD_PNC2000 is not set
+# CONFIG_MTD_RPXLITE is not set
+# CONFIG_MTD_SC520CDP is not set
+# CONFIG_MTD_NETSC520 is not set
+# CONFIG_MTD_SBC_GXX is not set
+# CONFIG_MTD_ELAN_104NC is not set
+# CONFIG_MTD_SA1100 is not set
+# CONFIG_MTD_SA1100_REDBOOT_PARTITIONS is not set
+# CONFIG_MTD_SA1100_BOOTLDR_PARTITIONS is not set
+# CONFIG_MTD_DC21285 is not set
+# CONFIG_MTD_IQ80310 is not set
+# CONFIG_MTD_DBOX2 is not set
+# CONFIG_MTD_CSTM_MIPS_IXX is not set
+# CONFIG_MTD_CFI_FLAGADM is not set
+# CONFIG_MTD_MIXMEM is not set
+# CONFIG_MTD_OCTAGON is not set
+# CONFIG_MTD_VMAX is not set
+# CONFIG_MTD_OCELOT is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC1000 is not set
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOCPROBE is not set
+
+#
+# NAND Flash Device Drivers
+#
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_NAND_SPIA is not set
+
+#
# Parallel port support
#
# CONFIG_PARPORT is not set
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 11 19:15:27 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 Tue Jun 12 11:47:28 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)
@@ -257,33 +246,16 @@
jmp ret_from_sys_call
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
-
ENTRY(ret_from_intr)
GET_CURRENT(%ebx)
+ret_from_exception:
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
jmp ret_from_sys_call
@@ -334,14 +306,16 @@
pushl $-1 # mark this as an int
SAVE_ALL
GET_CURRENT(%ebx)
- pushl $ret_from_exception
movl %cr0,%eax
testl $0x4,%eax # EM (math emulation bit)
- je SYMBOL_NAME(math_state_restore)
+ jne device_not_available_emulate
+ call SYMBOL_NAME(math_state_restore)
+ jmp ret_from_exception
+device_not_available_emulate:
pushl $0 # temporary storage for ORIG_EIP
call SYMBOL_NAME(math_emulate)
addl $4,%esp
- ret
+ jmp ret_from_exception
ENTRY(debug)
pushl $0
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 Mon Jun 11 19:15:27 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 11 19:15:27 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 11 19:15:27 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 11 19:15:27 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/i386/math-emu/fpu_trig.c linux/arch/i386/math-emu/fpu_trig.c
--- v2.4.5/linux/arch/i386/math-emu/fpu_trig.c Fri Apr 6 10:42:47 2001
+++ linux/arch/i386/math-emu/fpu_trig.c Tue Jun 12 11:06:54 2001
@@ -1543,6 +1543,7 @@
EXCEPTION(EX_INTERNAL | 0x116);
return;
#endif /* PARANOID */
+ break;
}
}
else if ( (st0_tag == TAG_Valid) || (st0_tag == TW_Denormal) )
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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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 Mon Jun 11 19:15:27 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