diff -urN linux-2.4.28/CREDITS linux-2.4.29/CREDITS --- linux-2.4.28/CREDITS 2004-11-17 03:54:20.000000000 -0800 +++ linux-2.4.29/CREDITS 2005-01-19 06:09:22.562954940 -0800 @@ -1447,8 +1447,9 @@ S: Germany N: Mike Jagdis -E: jaggy@purplet.demon.co.uk -E: Mike.Jagdis@purplet.demon.co.uk +E: mjagdis@eris-associates.co.uk +E: jaggy@jaggycraft.co.uk +E: Mike.Jagdis@eris-associates.co.uk D: iBCS personalities, socket and X interfaces, x.out loader, syscalls... D: Purple Distribution maintainer D: UK FidoNet support @@ -1457,7 +1458,7 @@ S: 280 Silverdale Road S: Earley S: Reading -S: RG6 2NU +S: RG6 7NU S: United Kingdom N: Jakub Jelinek diff -urN linux-2.4.28/Documentation/Changes linux-2.4.29/Documentation/Changes --- linux-2.4.28/Documentation/Changes 2004-02-18 05:36:30.000000000 -0800 +++ linux-2.4.29/Documentation/Changes 2005-01-19 06:09:22.624957633 -0800 @@ -52,7 +52,7 @@ o Gnu make 3.77 # make --version o binutils 2.9.1.0.25 # ld -v o util-linux 2.10o # fdformat --version -o modutils 2.4.2 # insmod -V +o modutils 2.4.10 # insmod -V o e2fsprogs 1.25 # tune2fs o jfsutils 1.0.12 # fsck.jfs -V o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs @@ -159,8 +159,8 @@ Upgrade to recent modutils to fix various outstanding bugs which are seen more frequently under 2.4.x, and to enable auto-loading of USB modules. In addition, the layout of modules under -/lib/modules/`uname -r`/ has been made more sane. This change also -requires that you upgrade to a recent modutils. +/lib/modules/`uname -r`/ has been made more sane, and EXPORT_SYMBOL_GPL +also requires that you upgrade to a recent modutils. Mkinitrd -------- diff -urN linux-2.4.28/Documentation/Configure.help linux-2.4.29/Documentation/Configure.help --- linux-2.4.28/Documentation/Configure.help 2004-11-17 03:54:20.000000000 -0800 +++ linux-2.4.29/Documentation/Configure.help 2005-01-19 06:09:22.928970838 -0800 @@ -617,6 +617,8 @@ This is required for the full functionality of sar(8) and interesting if you want to do performance tuning, by tweaking the elevator, e.g. + On the other hand, it will cause random and mysterious failures for + fdisk, mount and other programs reading /proc/partitions. If unsure, say N. @@ -1317,21 +1319,6 @@ Please read the comments at the top of . - If you say Y here, you should also say Y to "PIIXn Tuning support", - below. - - If unsure, say N. - -PIIXn Tuning support -CONFIG_PIIX_TUNING - This driver extension adds DMA mode setting and tuning for all PIIX - IDE controllers by Intel. Since the BIOS can sometimes improperly - set up the device/adapter combination and speed limits, it has - become a necessity to back/forward speed devices as needed. - - Case 430HX/440FX PIIX3 need speed limits to reduce UDMA to DMA mode - 2 if the BIOS can not perform this task at initialization. - If unsure, say N. Promise PDC202{46|62|65|67} support @@ -2557,9 +2544,9 @@ # Choice: mipstype CPU type -CONFIG_CPU_R3000 +CONFIG_CPU_MIPS32 Please make sure to pick the right CPU type. Linux/MIPS is not - designed to be generic, i.e. Kernels compiled for R3000 CPUs will + designed to be generic, i.e. kernels compiled for R3000 CPUs will *not* work on R4000 machines and vice versa. However, since most of the supported machines have an R4000 (or similar) CPU, R4x00 might be a safe bet. If the resulting kernel does not work, @@ -2683,6 +2670,19 @@ machines which require flushing of write buffers in software. Saying Y is the safe option; N may result in kernel malfunction and crashes. +Use 64-bit ELF format for building +CONFIG_BUILD_ELF64 + A 64-bit kernel is usually built using the 64-bit ELF binary object + format as it's one that allows arbitrary 64-bit constructs. For + kernels that are loaded within the KSEG compatibility segments the + 32-bit ELF format can optionally be used resulting in a somewhat + smaller binary, but this option is not explicitly supported by the + toolchain and since binutils 2.14 it does not even work at all. + + Say Y to use the 64-bit format or N to use the 32-bit one. + + If unsure say Y. + Support for large 64-bit configurations CONFIG_MIPS_INSANE_LARGE MIPS R10000 does support a 44 bit / 16TB address space as opposed to @@ -3042,19 +3042,6 @@ If you want to compile it as a module, say M here and read . If unsure, say `N'. -Local NAT support -CONFIG_IP_NF_NAT_LOCAL - This option enables support for NAT of locally originated connections. - Enable this if you need to use destination NAT on connections - originating from local processes on the nat box itself. - - Please note that you will need a recent version (>= 1.2.6a) - of the iptables userspace program in order to use this feature. - See for download instructions. - - If unsure, say 'N'. - - Full NAT (Network Address Translation) CONFIG_IP_NF_NAT The Full NAT option allows masquerading, port forwarding and other @@ -5214,10 +5201,17 @@ This is the frame buffer device driver for the Chips & Technologies 65550 graphics chip in PowerBooks. -TGA frame buffer support +TGA/SFB+ frame buffer support CONFIG_FB_TGA - This is the frame buffer device driver for generic TGA graphic - cards. Say Y if you have one of those. + This is the frame buffer device driver for generic TGA and SFB+ + graphic cards. These include DEC ZLXp-E1, E2 and E3 PCI cards, + also known as PBXGA-A, B and C, and DEC ZLX-E2 and E3 TURBOchannel + cards, also known as PMAGD-B and C. The DEC ZLX-E1 or PMAGD-A card + is currently unsupported. Due to hardware limitations ZLX-E2 and + E3 cards are only supported for DECstation 5000/1xx and Personal + DECstation 5000/xx systems. + + Say Y if you have one of those. VESA VGA graphics console CONFIG_FB_VESA @@ -7739,7 +7733,7 @@ of MPT adapters via system ioctl calls. Use of ioctl calls to the MPT driver requires that you create and use a misc device node ala: - mknod /dev/mptctl c 10 240 + mknod /dev/mptctl c 10 220 One use of this ioctl interface is to perform an upgrade (reflash) of the MPT adapter firmware. Refer to readme file(s) distributed @@ -9325,6 +9319,11 @@ If unsure, say N. +CONFIG_SCSI_SATA_AHCI + This option enables support for AHCI Serial ATA. + + If unsure, say N. + CONFIG_SCSI_SATA_SVW This option enables support for Broadcom/Serverworks/Apple K2 SATA support. @@ -12204,65 +12203,16 @@ EtherExpress Pro/100 support (e100, Alternate Intel driver) CONFIG_E100 - This driver supports Intel(R) PRO/100 family of adapters, which - includes: - - Controller Adapter Name Board IDs - ---------- ------------ --------- - - 82558 PRO/100+ PCI Adapter 668081-xxx, - 689661-xxx - 82558 PRO/100+ Management Adapter 691334-xxx, - 701738-xxx, - 721383-xxx - 82558 PRO/100+ Dual Port Server Adapter 714303-xxx, - 711269-xxx, - A28276-xxx - 82558 PRO/100+ PCI Server Adapter 710550-xxx - 82550 PRO/100 S Server Adapter 752438-xxx - 82559 A56831-xxx, - A10563-xxx, - A12171-xxx, - A12321-xxx, - A12320-xxx, - A12170-xxx - 748568-xxx - 748565-xxx - 82550 PRO/100 S Desktop Adapter 751767-xxx - 82559 748592-xxx, - A12167-xxx, - A12318-xxx, - A12317-xxx, - A12165-xxx, - 748569-xxx - 82559 PRO/100+ Server Adapter 729757-xxx - 82559 PRO/100 S Management Adapter 748566-xxx, - 748564-xxx - 82550 PRO/100 S Dual Port Server Adapter A56831-xxx - 82551 PRO/100 M Desktop Adapter A80897-xxx - PRO/100 S Advanced Management Adapter - 747842-xxx, - 745171-xxx - CNR PRO/100 VE Desktop Adapter A10386-xxx, - A10725-xxx, - A23801-xxx, - A19716-xxx - PRO/100 VM Desktop Adapter A14323-xxx, - A19725-xxx, - A23801-xxx, - A22220-xxx, - A23796-xxx - - + This driver supports Intel(R) PRO/100 family of adapters. To verify that your adapter is supported, find the board ID number on the adapter. Look for a label that has a barcode and a number - in the format 123456-001 (six digits hyphen three digits). Match - this to the list of numbers above. + in the format 123456-001 (six digits hyphen three digits). - For more information on how to identify your adapter, go to the - Adapter & Driver ID Guide at: + Use the above information and the Adapter & Driver ID Guide at: - http://support.intel.com/support/network/adapter/pro100/21397.htm + http://support.intel.com/support/network/adapter/pro100/21397.htm + + to identify the adapter. For the latest Intel PRO/100 network driver for Linux, see: @@ -12280,28 +12230,7 @@ Intel(R) PRO/1000 Gigabit Ethernet support CONFIG_E1000 This driver supports Intel(R) PRO/1000 gigabit ethernet family of - adapters, which includes: - - Controller Adapter Name Board IDs - ---------- ------------ --------- - 82542 PRO/1000 Gigabit Server Adapter 700262-xxx, - 717037-xxx - 82543 PRO/1000 F Server Adapter 738640-xxx, - A38888-xxx - 82543 PRO/1000 T Server Adapter A19845-xxx, - A33948-xxx - 82544 PRO/1000 XT Server Adapter A51580-xxx - 82544 PRO/1000 XF Server Adapter A50484-xxx - 82544 PRO/1000 T Desktop Adapter A62947-xxx - 82540 PRO/1000 MT Desktop Adapter A78408-xxx - 82541 PRO/1000 MT Desktop Adapter C91016-xxx - 82545 PRO/1000 MT Server Adapter A92165-xxx - 82546 PRO/1000 MT Dual Port Server Adapter A92111-xxx - 82545 PRO/1000 MF Server Adapter A91622-xxx - 82545 PRO/1000 MF Server Adapter(LX) A91624-xxx - 82546 PRO/1000 MF Dual Port Server Adapter A91620-xxx - - For more information on how to identify your adapter, go to the + adapters. For more information on how to identify your adapter, go to the Adapter & Driver ID Guide at: @@ -13588,10 +13517,11 @@ then also Y to the driver for your FDDI card, below). Most people will say N. -Digital DEFEA and DEFPA adapter support +Digital DEFTA/DEFEA/DEFPA adapter support CONFIG_DEFXX - This is support for the DIGITAL series of EISA (DEFEA) and PCI - (DEFPA) controllers which can connect you to a local FDDI network. + This is support for the DIGITAL series of TURBOchannel (DEFTA), EISA + (DEFEA) and PCI (DEFPA) controllers which can connect you to a local + FDDI network. If you want to compile the driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), diff -urN linux-2.4.28/Documentation/DocBook/libata.tmpl linux-2.4.29/Documentation/DocBook/libata.tmpl --- linux-2.4.28/Documentation/DocBook/libata.tmpl 2004-08-07 16:26:04.000000000 -0700 +++ linux-2.4.29/Documentation/DocBook/libata.tmpl 2005-01-19 06:09:23.231984000 -0800 @@ -61,6 +61,196 @@ + + libata Driver API + + struct ata_port_operations + + +void (*port_disable) (struct ata_port *); + + + + Called from ata_bus_probe() and ata_bus_reset() error paths, + as well as when unregistering from the SCSI module (rmmod, hot + unplug). + + + +void (*dev_config) (struct ata_port *, struct ata_device *); + + + + Called after IDENTIFY [PACKET] DEVICE is issued to each device + found. Typically used to apply device-specific fixups prior to + issue of SET FEATURES - XFER MODE, and prior to operation. + + + +void (*set_piomode) (struct ata_port *, struct ata_device *); +void (*set_dmamode) (struct ata_port *, struct ata_device *); +void (*post_set_mode) (struct ata_port *ap); + + + + Hooks called prior to the issue of SET FEATURES - XFER MODE + command. dev->pio_mode is guaranteed to be valid when + ->set_piomode() is called, and dev->dma_mode is guaranteed to be + valid when ->set_dmamode() is called. ->post_set_mode() is + called unconditionally, after the SET FEATURES - XFER MODE + command completes successfully. + + + + ->set_piomode() is always called (if present), but + ->set_dma_mode() is only called if DMA is possible. + + + +void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); +void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); + + + + ->tf_load() is called to load the given taskfile into hardware + registers / DMA buffers. ->tf_read() is called to read the + hardware registers / DMA buffers, to obtain the current set of + taskfile register values. + + + +void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); + + + + causes an ATA command, previously loaded with + ->tf_load(), to be initiated in hardware. + + + +u8 (*check_status)(struct ata_port *ap); +void (*dev_select)(struct ata_port *ap, unsigned int device); + + + + Reads the Status ATA shadow register from hardware. On some + hardware, this has the side effect of clearing the interrupt + condition. + + + +void (*dev_select)(struct ata_port *ap, unsigned int device); + + + + Issues the low-level hardware command(s) that causes one of N + hardware devices to be considered 'selected' (active and + available for use) on the ATA bus. + + + +void (*phy_reset) (struct ata_port *ap); + + + + The very first step in the probe phase. Actions vary depending + on the bus type, typically. After waking up the device and probing + for device presence (PATA and SATA), typically a soft reset + (SRST) will be performed. Drivers typically use the helper + functions ata_bus_reset() or sata_phy_reset() for this hook. + + + +void (*bmdma_setup) (struct ata_queued_cmd *qc); +void (*bmdma_start) (struct ata_queued_cmd *qc); + + + + When setting up an IDE BMDMA transaction, these hooks arm + (->bmdma_setup) and fire (->bmdma_start) the hardware's DMA + engine. + + + +void (*qc_prep) (struct ata_queued_cmd *qc); +int (*qc_issue) (struct ata_queued_cmd *qc); + + + + Higher-level hooks, these two hooks can potentially supercede + several of the above taskfile/DMA engine hooks. ->qc_prep is + called after the buffers have been DMA-mapped, and is typically + used to populate the hardware's DMA scatter-gather table. + Most drivers use the standard ata_qc_prep() helper function, but + more advanced drivers roll their own. + + + ->qc_issue is used to make a command active, once the hardware + and S/G tables have been prepared. IDE BMDMA drivers use the + helper function ata_qc_issue_prot() for taskfile protocol-based + dispatch. More advanced drivers roll their own ->qc_issue + implementation, using this as the "issue new ATA command to + hardware" hook. + + + +void (*eng_timeout) (struct ata_port *ap); + + + + This is a high level error handling function, called from the + error handling thread, when a command times out. + + + +irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); +void (*irq_clear) (struct ata_port *); + + + + ->irq_handler is the interrupt handling routine registered with + the system, by libata. ->irq_clear is called during probe just + before the interrupt handler is registered, to be sure hardware + is quiet. + + + +u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); +void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, + u32 val); + + + + Read and write standard SATA phy registers. Currently only used + if ->phy_reset hook called the sata_phy_reset() helper function. + + + +int (*port_start) (struct ata_port *ap); +void (*port_stop) (struct ata_port *ap); +void (*host_stop) (struct ata_host_set *host_set); + + + + ->port_start() is called just after the data structures for each + port are initialized. Typically this is used to alloc per-port + DMA buffers / tables / rings, enable DMA engines, and similar + tasks. + + + ->host_stop() is called when the rmmod or hot unplug process + begins. The hook must stop all hardware interrupts, DMA + engines, etc. + + + ->port_stop() is called after ->host_stop(). It's sole function + is to release DMA/memory resources, now that they are no longer + actively being used. + + + + + libata Library !Edrivers/scsi/libata-core.c @@ -78,7 +268,7 @@ - ata_sil Internals + sata_sil Internals !Idrivers/scsi/sata_sil.c diff -urN linux-2.4.28/Documentation/computone.txt linux-2.4.29/Documentation/computone.txt --- linux-2.4.28/Documentation/computone.txt 2001-11-02 17:26:17.000000000 -0800 +++ linux-2.4.29/Documentation/computone.txt 2005-01-19 06:09:23.851010888 -0800 @@ -6,11 +6,11 @@ These notes are for the drivers which have already been integrated into the kernel and have been tested on Linux kernels 2.0, 2.2, 2.3, and 2.4. -Version: 1.2.14 -Date: 11/01/2001 +Version: 1.2.18 +Date: 12/22/2004 Historical Author: Andrew Manison Primary Author: Doug McNash -Support: support@computone.com +Support: mhw@wittsend.com Fixes and Updates: Mike Warfield This file assumes that you are using the Computone drivers which are @@ -26,7 +26,7 @@ products previous to the Intelliport II. This driver was developed on the v2.0.x Linux tree and has been tested up -to v2.4.14; it will probably not work with earlier v1.X kernels,. +to v2.4.28; it will probably not work with earlier v1.X kernels,. 2. QUICK INSTALLATION diff -urN linux-2.4.28/Documentation/filesystems/proc.txt linux-2.4.29/Documentation/filesystems/proc.txt --- linux-2.4.28/Documentation/filesystems/proc.txt 2003-06-13 07:51:29.000000000 -0700 +++ linux-2.4.29/Documentation/filesystems/proc.txt 2005-01-19 06:09:24.339032085 -0800 @@ -936,239 +936,7 @@ 2.4 /proc/sys/vm - The virtual memory subsystem ----------------------------------------------- - -The files in this directory can be used to tune the operation of the virtual -memory (VM) subsystem of the Linux kernel. In addition, one of the files -(bdflush) has some influence on disk usage. - -bdflush -------- - -This file controls the operation of the bdflush kernel daemon. It currently -contains nine integer values, six of which are actually used by the kernel. -They are listed in table 2-2. - - -Table 2-2: Parameters in /proc/sys/vm/bdflush -.............................................................................. - Value Meaning - nfract Percentage of buffer cache dirty to activate bdflush - ndirty Maximum number of dirty blocks to write out per wake-cycle - dummy Unused - dummy Unused - interval jiffies delay between kupdate flushes - age_buffer Time for normal buffer to age before we flush it - nfract_sync Percentage of buffer cache dirty to activate bdflush synchronously - nfract_stop_bdflush Percetange of buffer cache dirty to stop bdflush - dummy Unused -.............................................................................. - -nfract ------- - -This parameter governs the maximum number of dirty buffers in the buffer -cache. Dirty means that the contents of the buffer still have to be written to -disk (as opposed to a clean buffer, which can just be forgotten about). -Setting this to a higher value means that Linux can delay disk writes for a -long time, but it also means that it will have to do a lot of I/O at once when -memory becomes short. A lower value will spread out disk I/O more evenly. - -interval --------- - -The interval between two kupdate runs. The value is expressed in -jiffies (clockticks), the number of jiffies per second is 100. - -ndirty ------- - -Ndirty gives the maximum number of dirty buffers that bdflush can write to the -disk at one time. A high value will mean delayed, bursty I/O, while a small -value can lead to memory shortage when bdflush isn't woken up often enough. - -age_buffer ----------- - -Finally, the age_buffer parameter govern the maximum time Linux -waits before writing out a dirty buffer to disk. The value is expressed in -jiffies (clockticks), the number of jiffies per second is 100. - -nfract_sync ------------ - -nfract_stop_bdflush -------------------- - -buffermem ---------- - -The three values in this file control how much memory should be used for -buffer memory. The percentage is calculated as a percentage of total system -memory. - -The values are: - -min_percent ------------ - -This is the minimum percentage of memory that should be spent on buffer -memory. - -borrow_percent --------------- - -When Linux is short on memory, and the buffer cache uses more than it has been -allotted, the memory management (MM) subsystem will prune the buffer cache -more heavily than other memory to compensate. - -max_percent ------------ - -This is the maximum amount of memory that can be used for buffer memory. - -freepages ---------- - -This file contains three values: min, low and high: - -min ---- -When the number of free pages in the system reaches this number, only the -kernel can allocate more memory. - -low ---- -If the number of free pages falls below this point, the kernel starts swapping -aggressively. - -high ----- -The kernel tries to keep up to this amount of memory free; if memory falls -below this point, the kernel starts gently swapping in the hopes that it never -has to do really aggressive swapping. - -kswapd ------- - -Kswapd is the kernel swap out daemon. That is, kswapd is that piece of the -kernel that frees memory when it gets fragmented or full. Since every system -is different, you'll probably want some control over this piece of the system. - -The file contains three numbers: - -tries_base ----------- - -The maximum number of pages kswapd tries to free in one round is calculated -from this number. Usually this number will be divided by 4 or 8 (see -mm/vmscan.c), so it isn't as big as it looks. - -When you need to increase the bandwidth to/from swap, you'll want to increase -this number. - -tries_min ---------- - -This is the minimum number of times kswapd tries to free a page each time it -is called. Basically it's just there to make sure that kswapd frees some pages -even when it's being called with minimum priority. - -swap_cluster ------------- - -This is probably the greatest influence on system performance. - -swap_cluster is the number of pages kswapd writes in one turn. You'll want -this value to be large so that kswapd does its I/O in large chunks and the -disk doesn't have to seek as often, but you don't want it to be too large -since that would flood the request queue. - -overcommit_memory ------------------ - -This file contains one value. The following algorithm is used to decide if -there's enough memory: if the value of overcommit_memory is positive, then -there's always enough memory. This is a useful feature, since programs often -malloc() huge amounts of memory 'just in case', while they only use a small -part of it. Leaving this value at 0 will lead to the failure of such a huge -malloc(), when in fact the system has enough memory for the program to run. - -On the other hand, enabling this feature can cause you to run out of memory -and thrash the system to death, so large and/or important servers will want to -set this value to 0. - -pagecache ---------- - -This file does exactly the same job as buffermem, only this file controls the -amount of memory allowed for memory mapping and generic caching of files. - -You don't want the minimum level to be too low, otherwise your system might -thrash when memory is tight or fragmentation is high. - -pagetable_cache ---------------- - -The kernel keeps a number of page tables in a per-processor cache (this helps -a lot on SMP systems). The cache size for each processor will be between the -low and the high value. - -On a low-memory, single CPU system, you can safely set these values to 0 so -you don't waste memory. It is used on SMP systems so that the system can -perform fast pagetable allocations without having to acquire the kernel memory -lock. - -For large systems, the settings are probably fine. For normal systems they -won't hurt a bit. For small systems ( less than 16MB ram) it might be -advantageous to set both values to 0. - -swapctl -------- - -This file contains no less than 8 variables. All of these values are used by -kswapd. - -The first four variables -* sc_max_page_age, -* sc_page_advance, -* sc_page_decline and -* sc_page_initial_age -are used to keep track of Linux's page aging. Page aging is a bookkeeping -method to track which pages of memory are often used, and which pages can be -swapped out without consequences. - -When a page is swapped in, it starts at sc_page_initial_age (default 3) and -when the page is scanned by kswapd, its age is adjusted according to the -following scheme: - -* If the page was used since the last time we scanned, its age is increased - by sc_page_advance (default 3). Where the maximum value is given by - sc_max_page_age (default 20). -* Otherwise (meaning it wasn't used) its age is decreased by sc_page_decline - (default 1). - -When a page reaches age 0, it's ready to be swapped out. - -The variables sc_age_cluster_fract, sc_age_cluster_min, sc_pageout_weight and -sc_bufferout_weight, can be used to control kswapd's aggressiveness in -swapping out pages. - -Sc_age_cluster_fract is used to calculate how many pages from a process are to -be scanned by kswapd. The formula used is - -(sc_age_cluster_fract divided by 1024) times resident set size - -So if you want kswapd to scan the whole process, sc_age_cluster_fract needs to -have a value of 1024. The minimum number of pages kswapd will scan is -represented by sc_age_cluster_min, which is done so that kswapd will also scan -small processes. - -The values of sc_pageout_weight and sc_bufferout_weight are used to control -how many tries kswapd will make in order to swap out one page/buffer. These -values can be used to fine-tune the ratio between user pages and buffer/cache -memory. When you find that your Linux system is swapping out too many process -pages in order to satisfy buffer memory demands, you may want to either -increase sc_bufferout_weight, or decrease the value of sc_pageout_weight. +Please read Documentation/sysctl/vm.txt 2.5 /proc/sys/dev - Device specific parameters ---------------------------------------------- @@ -1786,10 +1554,3 @@ command to write value into these files, thereby changing the default settings of the kernel. ------------------------------------------------------------------------------ - - - - - - - diff -urN linux-2.4.28/Documentation/mips/time.README linux-2.4.29/Documentation/mips/time.README --- linux-2.4.28/Documentation/mips/time.README 2003-08-25 04:44:39.000000000 -0700 +++ linux-2.4.29/Documentation/mips/time.README 2005-01-19 06:09:24.457037211 -0800 @@ -30,6 +30,7 @@ However, it is expected every board will move to the new time.c in the near future. +In Linux 2.5 and Linux 2.4.26 CONFIG_OLD_TIME_C was removed. WHAT THE NEW CODE PROVIDES? --------------------------- diff -urN linux-2.4.28/Documentation/networking/dl2k.txt linux-2.4.29/Documentation/networking/dl2k.txt --- linux-2.4.28/Documentation/networking/dl2k.txt 2002-11-28 15:53:08.000000000 -0800 +++ linux-2.4.29/Documentation/networking/dl2k.txt 2005-01-19 06:09:24.527040251 -0800 @@ -1,7 +1,7 @@ D-Link DL2000-based Gigabit Ethernet Adapter Installation for Linux - May 23, 2002 + Oct 3, 2002 Contents ======== @@ -19,7 +19,9 @@ Adapter Support: D-Link DGE-550T Gigabit Ethernet Adapter. +D-Link DGE-510T Gigabit Ethernet Adapter. D-Link DGE-550SX Gigabit Ethernet Adapter. +D-Link DGE-570T 2 Port Giga Ethernet Server Adapter. D-Link DL2000-based Gigabit Ethernet Adapter. @@ -30,7 +32,8 @@ . Red Hat v7.0 (update kernel to 2.4.7) . Red Hat v7.1 (kernel 2.4.7) . Red Hat v7.2 (kernel 2.4.7-10) - + . Red Hat v7.3 (kernel 2.4.18-3) + . Red Hat v8.0 (kernel 2.4.18-14) Quick Install ============= @@ -77,8 +80,8 @@ [root@XXX /] cd root [root@XXX /root] mkdir dl2k [root@XXX /root] cd dl2k -[root@XXX dl2k] cp /cdrom/linux/dl2k.tgz /root/dl2k -[root@XXX dl2k] tar xfvz dl2k.tgz +[root@XXX dl2k] cp /cdrom/linux/dl2k-xx.tgz /root/dl2k +[root@XXX dl2k] tar xfvz dl2k-xx.tgz (xx refer to release version) [root@XXX dl2k] make all Floppy disc drive @@ -87,8 +90,8 @@ [root@XXX /] cd root [root@XXX /root] mkdir dl2k [root@XXX /root] cd dl2k -[root@XXX dl2k] mcopy a:/linux/dl2k.tgz /root/dl2k -[root@XXX dl2k] tar xfvz dl2k.tgz +[root@XXX dl2k] mcopy a:/linux/dl2k-xx.tgz /root/dl2k +[root@XXX dl2k] tar xfvz dl2k-xx.tgz (xx refer to release version) [root@XXX dl2k] make all Installing the Driver @@ -134,7 +137,7 @@ ifdown eth0 ifconfig eth0 down - rmmod dl2k.o + rmmod dl2k The following are the commands to list the currently loaded modules and to see the current network configuration. @@ -188,8 +191,8 @@ 10mbps_fd 10Mbps full duplex. 100mbps_hd 100Mbps half duplex. 100mbps_fd 100Mbps full duplex. - 1000mbps_fd 1000Mbps full duplex. 1000mbps_hd 1000Mbps half duplex. + 1000mbps_fd 1000Mbps full duplex. 0 Autosensing active media. 1 10Mbps half duplex. 2 10Mbps full duplex. @@ -198,9 +201,9 @@ 5 1000Mbps half duplex. 6 1000Mbps full duplex. - By default, the NIC operates at autosense. - 1000mbps_fd and 1000mbps_hd types are only - available for fiber adapter. + By default, the NIC operates at Autosense. + Fiber adapter only support Autosense and + 1000Mbps full duplex types. vlan=n - Specifies the VLAN ID. If vlan=0, the Virtual Local Area Network (VLAN) function is @@ -214,25 +217,6 @@ This feature need jumbo frame compatible remote. -rx_coalesce=m - Number of rx frame handled each interrupt. -rx_timeout=n - Rx DMA wait time for an interrupt. - If set rx_coalesce > 0, hardware only assert - an interrupt for m frames. Hardware won't - assert rx interrupt until m frames received or - reach timeout of n * 640 nano seconds. - Set proper rx_coalesce and rx_timeout can - reduce congestion collapse and overload which - has been a bottlenect for high speed network. - - For example, rx_coalesce=10 rx_timeout=800. - that is, hardware assert only 1 interrupt - for 10 frames received or timeout of 512 us. - -tx_coalesce=n - Number of tx frame handled each interrupt. - Set n > 1 can reduce the interrupts - congestion usually lower performance of - high speed network card. Default is 16. - tx_flow=[1|0] - Specifies the Tx flow control. If tx_flow=0, the Tx flow control disable else driver autodetect. diff -urN linux-2.4.28/Documentation/networking/e1000.txt linux-2.4.29/Documentation/networking/e1000.txt --- linux-2.4.28/Documentation/networking/e1000.txt 2003-06-13 07:51:29.000000000 -0700 +++ linux-2.4.29/Documentation/networking/e1000.txt 2005-01-19 06:09:24.605043639 -0800 @@ -1,14 +1,14 @@ Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters =============================================================== -January 8, 2003 +November 17, 2004 Contents ======== - In This Release -- Supported Adapters +- Identifying Your Adapter - Command Line Parameters - Speed and Duplex Configuration - Additional Configurations @@ -20,62 +20,28 @@ =============== This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family -of Adapters, version 5.0.x. This driver includes support for -Itanium(TM)-based systems. +of Adapters, version 5.x.x. +For questions related to hardware requirements, refer to the documentation +supplied with your Intel PRO/1000 adapter. All hardware requirements listed +apply to use with Linux. +Native VLANs are now available with supported kernels. - -Supported Adapters -================== - -The following Intel network adapters are compatible with the drivers in this -release: - - Controller Adapter Name Board IDs - ---------- ------------ --------- - - 82542 PRO/1000 Gigabit Server Adapter 700262-xxx, 717037-xxx - - 82543 PRO/1000 F Server Adapter 738640-xxx, A38888-xxx - - 82543 PRO/1000 T Server Adapter A19845-xxx, A33948-xxx - - 82544 PRO/1000 XT Server Adapter A51580-xxx - - 82544 PRO/1000 XF Server Adapter A50484-xxx - - 82544 PRO/1000 T Desktop Adapter A62947-xxx - - 82540 PRO/1000 MT Desktop Adapter A78408-xxx - 82541 C91016-xxx - - 82545 PRO/1000 MT Server Adapter A92165-xxx - - 82546 PRO/1000 MT Dual Port Server Adapter A92111-xxx - - 82545 PRO/1000 MF Server Adapter A91622-xxx - - 82545 PRO/1000 MF Server Adapter(LX) A91624-xxx - - 82546 PRO/1000 MF Dual Port Server Adapter A91620-xxx - - - -To verify your Intel adapter is supported, find the board ID number on the -adapter. Look for a label that has a barcode and a number in the format -A12345-001. Match this to the list of numbers above. +Identifying Your Adapter +======================== For more information on how to identify your adapter, go to the Adapter & Driver ID Guide at: http://support.intel.com/support/network/adapter/pro100/21397.htm -For the latest Intel network drivers for Linux, refer to the following +For the latest Intel network drivers for Linux, refer to the following +website. In the search field, enter your adapter name or type, or use the +networking link on the left to search for your adapter: http://downloadfinder.intel.com/scripts-df/support_intel.asp - Command Line Parameters ======================= @@ -91,15 +57,25 @@ insmod e1000 TxDescriptors=80,128 -loads the e1000 driver with 80 TX resources for the first adapter and 128 TX -resources for the second adapter. +loads the e1000 driver with 80 TX descriptors for the first adapter and 128 TX +descriptors for the second adapter. The default value for each parameter is generally the recommended setting, -unless otherwise noted. - -For more information about the AutoNeg, Duplex, and Speed parameters, see the -"Speed and Duplex Configuration" section in this document. +unless otherwise noted. Also, if the driver is statically built into the +kernel, the driver is loaded with the default values for all the parameters. +Ethtool can be used to change some of the parameters at runtime. + + NOTES: For more information about the AutoNeg, Duplex, and Speed + parameters, see the "Speed and Duplex Configuration" section in + this document. + + For more information about the InterruptThrottleRate, RxIntDelay, + TxIntDelay, RxAbsIntDelay, and TxAbsIntDelay parameters, see the + application note at: + http://www.intel.com/design/network/applnots/ap450.htm + A descriptor describes a data buffer and attributes related to the + data buffer. This information is accessed by the hardware. AutoNeg (adapters using copper connections only) Valid Range: 0x01-0x0F, 0x20-0x2F @@ -107,11 +83,13 @@ This parameter is a bit mask that specifies which speed and duplex settings the board advertises. When this parameter is used, the Speed and Duplex parameters must not be specified. + NOTE: Refer to the Speed and Duplex section of this readme for more + information on the AutoNeg parameter. Duplex (adapters using copper connections only) Valid Range: 0-2 (0=auto-negotiate, 1=half, 2=full) Default Value: 0 - Defines the direction in which data is allowed to flow. Can by either one + Defines the direction in which data is allowed to flow. Can be either one or two-directional. If both Duplex and the link partner are set to auto- negotiate, the board auto-detects the correct duplex. If the link partner is forced (either full or half), Duplex defaults to half-duplex. @@ -124,30 +102,59 @@ InterruptThrottleRate Valid Range: 100-100000 (0=off, 1=dynamic) -Default Value: 1 +Default Value: 8000 This value represents the maximum number of interrupts per second the controller generates. InterruptThrottleRate is another setting used in interrupt moderation. Dynamic mode uses a heuristic algorithm to adjust InterruptThrottleRate based on the current traffic load. +Un-supported Adapters: InterruptThrottleRate is NOT supported by 82542, 82543 + or 82544-based adapters. NOTE: InterruptThrottleRate takes precedence over the TxAbsIntDelay and RxAbsIntDelay parameters. In other words, minimizing the receive and/or transmit absolute delays does not force the controller to generate more interrupts than what the Interrupt Throttle Rate allows. + CAUTION: If you are using the Intel PRO/1000 CT Network Connection + (controller 82547), setting InterruptThrottleRate to a value + greater than 75,000, may hang (stop transmitting) adapters under + certain network conditions. If this occurs a NETDEV WATCHDOG + message is logged in the system event log. In addition, the + controller is automatically reset, restoring the network + connection. To eliminate the potential for the hang, ensure + that InterruptThrottleRate is set no greater than 75,000 and is + not set to 0. + NOTE: When e1000 is loaded with default settings and multiple adapters are + in use simultaneously, the CPU utilization may increase non-linearly. + In order to limit the CPU utilization without impacting the overall + throughput, we recommend that you load the driver as follows: + + insmod e1000.o InterruptThrottleRate=3000,3000,3000 + + This sets the InterruptThrottleRate to 3000 interrupts/sec for the + first, second, and third instances of the driver. The range of 2000 to + 3000 interrupts per second works on a majority of systems and is a + good starting point, but the optimal value will be platform-specific. + If CPU utilization is not a concern, use RX_POLLING (NAPI) and default + driver settings. RxDescriptors Valid Range: 80-256 for 82542 and 82543-based adapters - 80-4096 for 82540, 82544, 82545, and 82546-based adapters -Default Value: 80 + 80-4096 for all other supported adapters +Default Value: 256 This value is the number of receive descriptors allocated by the driver. Increasing this value allows the driver to buffer more incoming packets. - Each descriptor is 16 bytes. A receive buffer is also allocated for each - descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending - on the MTU setting. The maximum MTU size is 16110. + Each descriptor is 16 bytes. A receive buffer is allocated for each + descriptor and can either be 2048 or 4096 bytes long, depending on the MTU + + setting. An incoming packet can span one or more receive descriptors. + The maximum MTU size is 16110. NOTE: MTU designates the frame size. It only needs to be set for Jumbo Frames. + NOTE: Depending on the available system resources, the request for a + higher number of receive descriptors may be denied. In this case, + use a lower number. RxIntDelay Valid Range: 0-65535 (0=off) @@ -167,11 +174,11 @@ restoring the network connection. To eliminate the potential for the hang ensure that RxIntDelay is set to 0. -RxAbsIntDelay (82540, 82545, and 82546-based adapters only) +RxAbsIntDelay (82540, 82545 and later adapters only) Valid Range: 0-65535 (0=off) Default Value: 128 This value, in units of 1.024 microseconds, limits the delay in which a - transmit interrupt is generated. Useful only if RxIntDelay is non-zero, + receive interrupt is generated. Useful only if RxIntDelay is non-zero, this value ensures that an interrupt is generated after the initial packet is received within the set amount of time. Proper tuning, along with RxIntDelay, may improve traffic throughput in specific network @@ -187,12 +194,16 @@ TxDescriptors Valid Range: 80-256 for 82542 and 82543-based adapters - 80-4096 for 82540, 82544, 82545, and 82546-based adapters + 80-4096 for all other supported adapters Default Value: 256 This value is the number of transmit descriptors allocated by the driver. Increasing this value allows the driver to queue more transmits. Each descriptor is 16 bytes. + NOTE: Depending on the available system resources, the request for a + higher number of transmit descriptors may be denied. In this case, + use a lower number. + TxIntDelay Valid Range: 0-65535 (0=off) Default Value: 64 @@ -202,7 +213,7 @@ system is reporting dropped transmits, this value may be set too high causing the driver to run out of available transmit descriptors. -TxAbsIntDelay (82540, 82545, and 82546-based adapters only) +TxAbsIntDelay (82540, 82545 and later adapters only) Valid Range: 0-65535 (0=off) Default Value: 64 This value, in units of 1.024 microseconds, limits the delay in which a @@ -218,7 +229,6 @@ A value of '1' indicates that the driver should enable IP checksum offload for received packets (both UDP and TCP) to the adapter hardware. - Speed and Duplex Configuration ============================== @@ -242,13 +252,18 @@ also be forced. The AutoNeg parameter is used when more control is required over the auto- -negotiation process. When this parameter is used, Speed and Duplex must not -be specified. This parameter is a bitmap that specifies which speed and -duplex settings are advertised to the link partner. - -Bit 7 6 5 4 3 2 1 0 -Speed (Mbps) N/A N/A 1000 N/A 100 100 10 10 -Duplex Full Full Half Full Half +negotiation process. When this parameter is used, Speed and Duplex parameters +must not be specified. The following table describes supported values for the +AutoNeg parameter: + + +Speed (Mbps) 1000 100 100 10 10 +Duplex Full Full Half Full Half +Value (in base 16) 0x20 0x08 0x04 0x02 0x01 + + +Example: insmod e1000 AutoNeg=0x03, loads e1000 and specifies (10 full duplex, +10 half duplex) for negotiation with the peer. Note that setting AutoNeg does not guarantee that the board will link at the highest specified speed or duplex mode, but the board will link at the @@ -260,6 +275,38 @@ Additional Configurations ========================= + Configuring the Driver on Different Distributions + ------------------------------------------------- + + Configuring a network driver to load properly when the system is started is + distribution dependent. Typically, the configuration process involves adding + an alias line to /etc/modules.conf as well as editing other system startup + scripts and/or configuration files. Many popular Linux distributions ship + with tools to make these changes for you. To learn the proper way to + configure a network device for your system, refer to your distribution + documentation. If during this process you are asked for the driver or module + name, the name for the Linux Base Driver for the Intel PRO/1000 Family of + Adapters is e1000. + + As an example, if you install the e1000 driver for two PRO/1000 adapters + (eth0 and eth1) and set the speed and duplex to 10full and 100half, add the + following to modules.conf: + + alias eth0 e1000 + alias eth1 e1000 + options e1000 Speed=10,100 Duplex=2,1 + + Viewing Link Messages + --------------------- + + Link messages will not be displayed to the console if the distribution is + restricting system messages. In order to see network driver link messages on + your console, set dmesg to eight by entering the following: + + dmesg -n 8 + + NOTE: This setting is not saved across reboots. + Jumbo Frames ------------ @@ -277,6 +324,47 @@ 10 or 100 Mbps may result in poor performance or loss of link. + NOTE: MTU designates the frame size. To enable Jumbo Frames, increase the + MTU size on the interface beyond 1500. + + Ethtool + ------- + + The driver utilizes the ethtool interface for driver configuration and + diagnostics, as well as displaying statistical information. Ethtool + version 1.6 or later is required for this functionality. + + The latest release of ethtool can be found from + http://sf.net/projects/gkernel. + + NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support + for a more complete ethtool feature set can be enabled by upgrading + ethtool to ethtool-1.8.1. + + Enabling Wake on LAN* (WoL) + --------------------------- + + WoL is configured through the Ethtool* utility. Ethtool is included with + all versions of Red Hat after Red Hat 7.2. For other Linux distributions, + download and install Ethtool from the following website: + http://sourceforge.net/projects/gkernel. + + For instructions on enabling WoL with Ethtool, refer to the website listed + above. + + WoL will be enabled on the system during the next shut down or reboot. + For this driver version, in order to enable WoL, the e1000 driver must be + loaded when shutting down or rebooting the system. + + NAPI + ---- + + NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled + or disabled based on the configuration of the kernel. + + See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. + + Known Issues ============ @@ -284,9 +372,9 @@ ------------------------------- Memory allocation failures have been observed on Linux systems with 64 MB - of RAM or less that are running Jumbo Frames. If you are using Jumbo - Frames, your system may require more than the advertised minimum - requirement of 64 MB of system memory. + of RAM or less that are running Jumbo Frames. If you are using Jumbo Frames, + your system may require more than the advertised minimum requirement of 64 MB + of system memory. Support diff -urN linux-2.4.28/Documentation/parport.txt linux-2.4.29/Documentation/parport.txt --- linux-2.4.28/Documentation/parport.txt 2001-11-09 14:30:55.000000000 -0800 +++ linux-2.4.29/Documentation/parport.txt 2005-01-19 06:09:24.752050025 -0800 @@ -264,5 +264,5 @@ io=0x378 irq=7 dma=none (for PIO) io=0x378 irq=7 dma=3 (for DMA) -- -Philip.Blundell@pobox.com +philb@gnu.org tim@cyberelk.net diff -urN linux-2.4.28/Documentation/sysctl/vm.txt linux-2.4.29/Documentation/sysctl/vm.txt --- linux-2.4.28/Documentation/sysctl/vm.txt 2002-11-28 15:53:08.000000000 -0800 +++ linux-2.4.29/Documentation/sysctl/vm.txt 2005-01-19 06:09:24.803052240 -0800 @@ -1,146 +1,143 @@ -Documentation for /proc/sys/vm/* kernel version 2.4.19 - (c) 1998, 1999, Rik van Riel +Documentation for /proc/sys/vm/* Kernel version 2.4.28 +============================================================= + + (c) 1998, 1999, Rik van Riel + - Initial version + + (c) 2004, Marc-Christian Petersen + - Removed non-existent knobs which were removed in early + 2.4 stages + - Corrected values for bdflush + - Documented missing tunables + - Documented aa-vm tunables -For general info and legal blurb, please look in README. -============================================================== + +For general info and legal blurb, please look in README. +============================================================= This file contains the documentation for the sysctl files in -/proc/sys/vm and is valid for Linux kernel version 2.4. +/proc/sys/vm and is valid for Linux kernel v2.4.28. The files in this directory can be used to tune the operation of the virtual memory (VM) subsystem of the Linux kernel, and -one of the files (bdflush) also has a little influence on disk -usage. +three of the files (bdflush, max-readahead, min-readahead) +also have some influence on disk usage. Default values and initialization routines for most of these -files can be found in mm/swap.c. +files can be found in mm/vmscan.c, mm/page_alloc.c and +mm/filemap.c. Currently, these files are in /proc/sys/vm: - bdflush -- buffermem -- freepages +- block_dump - kswapd +- laptop_mode +- max-readahead +- min-readahead - max_map_count - overcommit_memory - page-cluster -- pagecache - pagetable_cache +- vm_anon_lru +- vm_cache_scan_ratio +- vm_gfp_debug +- vm_lru_balance_ratio +- vm_mapped_ratio +- vm_passes +- vm_vfs_scan_ratio +============================================================= -============================================================== -bdflush: +bdflush: +-------- This file controls the operation of the bdflush kernel daemon. The source code to this struct can be found in -linux/fs/buffer.c. It currently contains 9 integer values, +fs/buffer.c. It currently contains 9 integer values, of which 6 are actually used by the kernel. -From linux/fs/buffer.c: --------------------------------------------------------------- -union bdflush_param { - struct { - int nfract; /* Percentage of buffer cache dirty to - activate bdflush */ - int ndirty; /* Maximum number of dirty blocks to write out per - wake-cycle */ - int dummy2; /* old "nrefill" */ - int dummy3; /* unused */ - int interval; /* jiffies delay between kupdate flushes */ - int age_buffer; /* Time for normal buffer to age before we flush it */ - int nfract_sync;/* Percentage of buffer cache dirty to - activate bdflush synchronously */ - int nfract_stop_bdflush; /* Percentage of buffer cache dirty to stop bdflush */ - int dummy5; /* unused */ - } b_un; - unsigned int data[N_PARAM]; -} bdf_prm = {{30, 500, 0, 0, 5*HZ, 30*HZ, 60, 20, 0}}; --------------------------------------------------------------- - -int nfract: -The first parameter governs the maximum number of dirty -buffers in the buffer cache. Dirty means that the contents -of the buffer still have to be written to disk (as opposed -to a clean buffer, which can just be forgotten about). -Setting this to a high value means that Linux can delay disk -writes for a long time, but it also means that it will have -to do a lot of I/O at once when memory becomes short. A low -value will spread out disk I/O more evenly, at the cost of -more frequent I/O operations. The default value is 30%, -the minimum is 0%, and the maximum is 100%. - -int ndirty: -The second parameter (ndirty) gives the maximum number of -dirty buffers that bdflush can write to the disk in one time. -A high value will mean delayed, bursty I/O, while a small -value can lead to memory shortage when bdflush isn't woken -up often enough. - -int interval: -The fifth parameter, interval, is the minimum rate at -which kupdate will wake and flush. The value is expressed in -jiffies (clockticks), the number of jiffies per second is -normally 100 (Alpha is 1024). Thus, x*HZ is x seconds. The -default value is 5 seconds, the minimum is 0 seconds, and the -maximum is 600 seconds. - -int age_buffer: -The sixth parameter, age_buffer, governs the maximum time -Linux waits before writing out a dirty buffer to disk. The -value is in jiffies. The default value is 30 seconds, -the minimum is 1 second, and the maximum 6,000 seconds. - -int nfract_sync: -The seventh parameter, nfract_sync, governs the percentage -of buffer cache that is dirty before bdflush activates -synchronously. This can be viewed as the hard limit before -bdflush forces buffers to disk. The default is 60%, the -minimum is 0%, and the maximum is 100%. - -int nfract_stop_bdflush: -The eighth parameter, nfract_stop_bdflush, governs the percentage -of buffer cache that is dirty which will stop bdflush. -The default is 20%, the miniumum is 0%, and the maxiumum is 100%. -============================================================== -buffermem: - -The three values in this file correspond to the values in -the struct buffer_mem. It controls how much memory should -be used for buffer memory. The percentage is calculated -as a percentage of total system memory. - -The values are: -min_percent -- this is the minimum percentage of memory - that should be spent on buffer memory -borrow_percent -- UNUSED -max_percent -- UNUSED - -============================================================== -freepages: - -This file contains the values in the struct freepages. That -struct contains three members: min, low and high. - -The meaning of the numbers is: - -freepages.min When the number of free pages in the system - reaches this number, only the kernel can - allocate more memory. -freepages.low If the number of free pages gets below this - point, the kernel starts swapping aggressively. -freepages.high The kernel tries to keep up to this amount of - memory free; if memory comes below this point, - the kernel gently starts swapping in the hopes - that it never has to do real aggressive swapping. +nfract: The first parameter governs the maximum + number of dirty buffers in the buffer + cache. Dirty means that the contents of the + buffer still have to be written to disk (as + opposed to a clean buffer, which can just be + forgotten about). Setting this to a high + value means that Linux can delay disk writes + for a long time, but it also means that it + will have to do a lot of I/O at once when + memory becomes short. A low value will + spread out disk I/O more evenly, at the cost + of more frequent I/O operations. The default + value is 30%, the minimum is 0%, and the + maximum is 100%. + +ndirty: The second parameter (ndirty) gives the + maximum number of dirty buffers that bdflush + can write to the disk in one time. A high + value will mean delayed, bursty I/O, while a + small value can lead to memory shortage when + bdflush isn't woken up often enough. The + default value is 500 dirty buffers, the + minimum is 1, and the maximum is 50000. + +dummy2: The third parameter is not used. + +dummy3: The fourth parameter is not used. + +interval: The fifth parameter, interval, is the minimum + rate at which kupdate will wake and flush. + The value is in jiffies (clockticks), the + number of jiffies per second is normally 100 + (Alpha is 1024). Thus, x*HZ is x seconds. The + default value is 5 seconds, the minimum is 0 + seconds, and the maximum is 10,000 seconds. + +age_buffer: The sixth parameter, age_buffer, governs the + maximum time Linux waits before writing out a + dirty buffer to disk. The value is in jiffies. + The default value is 30 seconds, the minimum + is 1 second, and the maximum 10,000 seconds. + +sync: The seventh parameter, nfract_sync, governs + the percentage of buffer cache that is dirty + before bdflush activates synchronously. This + can be viewed as the hard limit before + bdflush forces buffers to disk. The default + is 60%, the minimum is 0%, and the maximum + is 100%. + +stop_bdflush: The eighth parameter, nfract_stop_bdflush, + governs the percentage of buffer cache that + is dirty which will stop bdflush. The default + is 20%, the miniumum is 0%, and the maxiumum + is 100%. + +dummy5: The ninth parameter is not used. + +So the default is: 30 500 0 0 500 3000 60 20 0 for 100 HZ. +============================================================= + + + +block_dump: +----------- +It can happen that the disk still keeps spinning up and you +don't quite know why or what causes it. The laptop mode patch +has a little helper for that as well. When set to 1, it will +dump info to the kernel message buffer about what process +caused the io. Be careful when playing with this setting. +It is advisable to shut down syslog first! The default is 0. +============================================================= -============================================================== -kswapd: +kswapd: +------- Kswapd is the kernel swapout daemon. That is, kswapd is that piece of the kernel that frees memory when it gets fragmented -or full. Since every system is different, you'll probably want -some control over this piece of the system. +or full. Since every system is different, you'll probably +want some control over this piece of the system. The numbers in this page correspond to the numbers in the struct pager_daemon {tries_base, tries_min, swap_cluster @@ -152,39 +149,83 @@ number. Usually this number will be divided by 4 or 8 (see mm/vmscan.c), so it isn't as big as it looks. - When you need to increase the bandwidth to/from - swap, you'll want to increase this number. + When you need to increase the bandwidth to/ + from swap, you'll want to increase this + number. + tries_min This is the minimum number of times kswapd tries to free a page each time it is called. Basically it's just there to make sure that kswapd frees some pages even when it's being called with minimum priority. + swap_cluster This is the number of pages kswapd writes in one turn. You want this large so that kswapd does it's I/O in large chunks and the disk - doesn't have to seek often, but you don't want - it to be too large since that would flood the - request queue. + doesn't have to seek often, but you don't + want it to be too large since that would + flood the request queue. + +The default value is: 512 32 8. +============================================================= -============================================================== -overcommit_memory: -This value contains a flag that enables memory overcommitment. -When this flag is 0, the kernel checks before each malloc() -to see if there's enough memory left. If the flag is nonzero, -the system pretends there's always enough memory. +laptop_mode: +------------ +Setting this to 1 switches the vm (and block layer) to laptop +mode. Leaving it to 0 makes the kernel work like before. When +in laptop mode, you also want to extend the intervals +desribed in Documentation/laptop-mode.txt. +See the laptop-mode.sh script for how to do that. + +The default value is 0. +============================================================= -This feature can be very useful because there are a lot of -programs that malloc() huge amounts of memory "just-in-case" -and don't use much of it. -Look at: mm/mmap.c::vm_enough_memory() for more information. -============================================================== +max-readahead: +-------------- +This tunable affects how early the Linux VFS will fetch the +next block of a file from memory. File readahead values are +determined on a per file basis in the VFS and are adjusted +based on the behavior of the application accessing the file. +Anytime the current position being read in a file plus the +current read ahead value results in the file pointer pointing +to the next block in the file, that block will be fetched +from disk. By raising this value, the Linux kernel will allow +the readahead value to grow larger, resulting in more blocks +being prefetched from disks which predictably access files in +uniform linear fashion. This can result in performance +improvements, but can also result in excess (and often +unnecessary) memory usage. Lowering this value has the +opposite affect. By forcing readaheads to be less aggressive, +memory may be conserved at a potential performance impact. + +The default value is 31. +============================================================= -max_map_count: + +min-readahead: +-------------- +Like max-readahead, min-readahead places a floor on the +readahead value. Raising this number forces a files readahead +value to be unconditionally higher, which can bring about +performance improvements, provided that all file access in +the system is predictably linear from the start to the end of +a file. This of course results in higher memory usage from +the pagecache. Conversely, lowering this value, allows the +kernel to conserve pagecache memory, at a potential +performance cost. + +The default value is 3. +============================================================= + + + +max_map_count: +-------------- This file contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap and mprotect, and also @@ -194,10 +235,29 @@ certain programs, particularly malloc debuggers, may consume lots of them, e.g. up to one or two maps per allocation. -============================================================== +The default value is 65536. +============================================================= -page-cluster: + +overcommit_memory: +------------------ +This value contains a flag to enable memory overcommitment. +When this flag is 0, the kernel checks before each malloc() +to see if there's enough memory left. If the flag is nonzero, +the system pretends there's always enough memory. + +This feature can be very useful because there are a lot of +programs that malloc() huge amounts of memory "just-in-case" +and don't use much of it. The default value is 0. + +Look at: mm/mmap.c::vm_enough_memory() for more information. +============================================================= + + + +page-cluster: +------------- The Linux VM subsystem avoids excessive disk seeks by reading multiple pages on a page fault. The number of pages it reads is dependent on the amount of memory in your machine. @@ -205,29 +265,12 @@ The number of pages the kernel reads in at once is equal to 2 ^ page-cluster. Values above 2 ^ 5 don't make much sense for swap because we only cluster swap data in 32-page groups. +============================================================= -============================================================== - -pagecache: - -This file does exactly the same as buffermem, only this -file controls the struct page_cache, and thus controls -the amount of memory used for the page cache. -In 2.2, the page cache is used for 3 main purposes: -- caching read() data from files -- caching mmap()ed data and executable files -- swap cache - -When your system is both deep in swap and high on cache, -it probably means that a lot of the swapped data is being -cached, making for more efficient swapping than possible -with the 2.0 kernel. - -============================================================== pagetable_cache: - +---------------- The kernel keeps a number of page tables in a per-processor cache (this helps a lot on SMP systems). The cache size for each processor will be between the low and the high value. @@ -241,3 +284,98 @@ systems they won't hurt a bit. For small systems (<16MB ram) it might be advantageous to set both values to 0. +The default value is: 25 50. +============================================================= + + + +vm_anon_lru: +------------ +select if to immdiatly insert anon pages in the lru. +Immediatly means as soon as they're allocated during the page +faults. If this is set to 0, they're inserted only after the +first swapout. + +Having anon pages immediatly inserted in the lru allows the +VM to know better when it's worthwhile to start swapping +anonymous ram, it will start to swap earlier and it should +swap smoother and faster, but it will decrease scalability +on the >16-ways of an order of magnitude. Big SMP/NUMA +definitely can't take an hit on a global spinlock at +every anon page allocation. + +Low ram machines that swaps all the time want to turn +this on (i.e. set to 1). + +The default value is 0. +============================================================= + + + +vm_cache_scan_ratio: +-------------------- +is how much of the inactive LRU queue we will scan in one go. +A value of 6 for vm_cache_scan_ratio implies that we'll scan +1/6 of the inactive lists during a normal aging round. + +The default value is 6. +============================================================= + + + +vm_gfp_debug: +------------ +is when __alloc_pages fails, dump us a stack. This will +mostly happen during OOM conditions (hopefully ;) + +The default value is 0. +============================================================= + + + +vm_lru_balance_ratio: +--------------------- +controls the balance between active and inactive cache. The +bigger vm_balance is, the easier the active cache will grow, +because we'll rotate the active list slowly. A value of 2 +means we'll go towards a balance of 1/3 of the cache being +inactive. + +The default value is 2. +============================================================= + + + +vm_mapped_ratio: +---------------- +controls the pageout rate, the smaller, the earlier we'll +start to pageout. + +The default value is 100. +============================================================= + + + +vm_passes: +---------- +is the number of vm passes before failing the memory +balancing. Take into account 3 passes are needed for a +flush/wait/free cycle and that we only scan +1/vm_cache_scan_ratio of the inactive list at each pass. + +The default value is 60. +============================================================= + + + +vm_vfs_scan_ratio: +------------------ +is what proportion of the VFS queues we will scan in one go. +A value of 6 for vm_vfs_scan_ratio implies that 1/6th of the +unused-inode, dentry and dquot caches will be freed during a +normal aging round. +Big fileservers (NFS, SMB etc.) probably want to set this +value to 3 or 2. + +The default value is 6. +============================================================= diff -urN linux-2.4.28/Documentation/tty.txt linux-2.4.29/Documentation/tty.txt --- linux-2.4.28/Documentation/tty.txt 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.29/Documentation/tty.txt 2005-01-19 06:09:24.804052283 -0800 @@ -0,0 +1,194 @@ + + The Lockronomicon + +Your guide to the ancient and twisted locking policies of the tty layer and +the warped logic behind them. Beware all ye who read on. + +FIXME: still need to work out the full set of BKL assumptions and document +them so they can eventually be killed off. + + +Line Discipline +--------------- + +Line disciplines are registered with tty_register_ldisc() passing the +discipline number and the ldisc structure. At the point of registration the +discipline must be ready to use and it is possible it will get used before +the call returns success. If the call returns an error then it won't get +called. Do not re-use ldisc numbers as they are part of the userspace ABI +and writing over an existing ldisc will cause demons to eat your computer. +After the return the ldisc data has been copied so you may free your own +copy of the structure. You must not re-register over the top of the line +discipline even with the same data or your computer again will be eaten by +demons. + +In order to remove a line discipline call tty_register_ldisc passing NULL. +In ancient times this always worked. In modern times the function will +return -EBUSY if the ldisc is currently in use. Since the ldisc referencing +code manages the module counts this should not usually be a concern. + +Heed this warning: the reference count field of the registered copies of the +tty_ldisc structure in the ldisc table counts the number of lines using this +discipline. The reference count of the tty_ldisc structure within a tty +counts the number of active users of the ldisc at this instant. In effect it +counts the number of threads of execution within an ldisc method (plus those +about to enter and exit although this detail matters not). + +Line Discipline Methods +----------------------- + +TTY side interfaces: + +close() - This is called on a terminal when the line + discipline is being unplugged. At the point of + execution no further users will enter the + ldisc code for this tty. Can sleep. + +open() - Called when the line discipline is attached to + the terminal. No other call into the line + discipline for this tty will occur until it + completes successfully. Can sleep. + +write() - A process is writing data from user space + through the line discipline. Multiple write calls + are serialized by the tty layer for the ldisc. May + sleep. + +flush_buffer() - May be called at any point between open and close. + +chars_in_buffer() - Report the number of bytes in the buffer. + +set_termios() - Called on termios structure changes. The caller + passes the old termios data and the current data + is in the tty. Currently can be parallel entered + and ordering isn't predictable - FIXME + +read() - Move data from the line discipline to the user. + Multiple read calls may occur in parallel and the + ldisc must deal with serialization issues. May + sleep. + +poll() - Check the status for the poll/select calls. Multiple + poll calls may occur in parallel. May sleep. + +ioctl() - Called when an ioctl is handed to the tty layer + that might be for the ldisc. Multiple ioctl calls + may occur in parallel. May sleep. + +Driver Side Interfaces: + +receive_buf() - Hand buffers of bytes from the driver to the ldisc + for processing. Semantics currently rather + mysterious 8( + +receive_room() - Can be called by the driver layer at any time when + the ldisc is opened. The ldisc must be able to + handle the reported amount of data at that instant. + Synchronization between active receive_buf and + receive_room calls is down to the driver not the + ldisc. Must not sleep. + +write_wakeup() - May be called at any point between open and close. + The TTY_DO_WRITE_WAKEUP flag indicates if a call + is needed but always races versus calls. Thus the + ldisc must be careful about setting order and to + handle unexpected calls. Must not sleep. + + +Locking + +Callers to the line discipline functions from the tty layer are required to +take line discipline locks. The same is true of calls from the driver side +but not yet enforced. + +Three calls are now provided + + ldisc = tty_ldisc_ref(tty); + +takes a handle to the line discipline in the tty and returns it. If no ldisc +is currently attached or the ldisc is being closed and re-opened at this +point then NULL is returned. While this handle is held the ldisc will not +change or go away. + + tty_ldisc_deref(ldisc) + +Returns the ldisc reference and allows the ldisc to be closed. Returning the +reference takes away your right to call the ldisc functions until you take +a new reference. + + ldisc = tty_ldisc_ref_wait(tty); + +Performs the same function as tty_ldisc_ref except that it will wait for an +ldisc change to complete and then return a reference to the new ldisc. + +While these functions are slightly slower than the old code they should have +minimal impact as most receive logic uses the flip buffers and they only +need to take a reference when they push bits up through the driver. + +A caution: The ldisc->open(), ldisc->close() and driver->set_ldisc +functions are called with the ldisc unavailable. Thus tty_ldisc_ref will +fail in this situation if used within these functions. Ldisc and driver +code calling its own functions must be careful in this case. + + +Driver Interface +---------------- + +open() - Called when a device is opened. May sleep + +close() - Called when a device is closed. At the point of + return from this call the driver must make no + further ldisc calls of any kind. May sleep + +write() - Called to write bytes to the device. May not + sleep. May occur in parallel in special cases. + Because this includes panic paths drivers generally + shouldn't try and do clever locking here. + +put_char() - Stuff a single character onto the queue. The + driver is guaranteed following up calls to + flush_chars. + +flush_chars() - Ask the kernel to write put_char queue + +write_room() - Return the number of characters tht can be stuffed + into the port buffers without overflow (or less). + The ldisc is responsible for being intelligent + about multi-threading of write_room/write calls + +ioctl() - Called when an ioctl may be for the driver + +set_termios() - Called on termios change, serialized against + itself by a semaphore. May sleep. + +set_ldisc() - Notifier for discipline change. At the point this + is done the discipline is not yet usable. Can now + sleep (I think) + +throttle() - Called by the ldisc to ask the driver to do flow + control. Serialization including with unthrottle + is the job of the ldisc layer. + +unthrottle() - Called by the ldisc to ask the driver to stop flow + control. + +stop() - Ldisc notifier to the driver to stop output. As with + throttle the serializations with start() are down + to the ldisc layer. + +start() - Ldisc notifier to the driver to start output. + +hangup() - Ask the tty driver to cause a hangup initiated + from the host side. [Can sleep ??] + +break_ctl() - Send RS232 break. Can sleep. Can get called in + parallel, driver must serialize (for now), and + with write calls. + +wait_until_sent() - Wait for characters to exit the hardware queue + of the driver. Can sleep + +send_xchar() - Send XON/XOFF and if possible jump the queue with + it in order to get fast flow control responses. + Cannot sleep ?? + diff -urN linux-2.4.28/MAINTAINERS linux-2.4.29/MAINTAINERS --- linux-2.4.28/MAINTAINERS 2004-11-17 03:54:21.000000000 -0800 +++ linux-2.4.29/MAINTAINERS 2005-01-19 06:09:24.805052327 -0800 @@ -80,7 +80,7 @@ 3C505 NETWORK DRIVER P: Philip Blundell -M: Philip.Blundell@pobox.com +M: philb@gnu.org L: linux-net@vger.kernel.org S: Maintained @@ -579,6 +579,11 @@ L: linux-decnet-user@lists.sourceforge.net S: Maintained +DEFXX FDDI NETWORK DRIVER +P: Maciej W. Rozycki +M: macro@linux-mips.org +S: Maintained + DELL LAPTOP SMM DRIVER P: Massimo Dal Zotto M: dz@debian.org @@ -694,7 +699,7 @@ ETHEREXPRESS-16 NETWORK DRIVER P: Philip Blundell -M: Philip.Blundell@pobox.com +M: philb@gnu.org L: linux-net@vger.kernel.org S: Maintained @@ -836,7 +841,7 @@ i386 SETUP CODE / CPU ERRATA WORKAROUNDS P: Dave Jones -M: davej@suse.de +M: davej@redhat.com P: H. Peter Anvin M: hpa@zytor.com S: Maintained @@ -971,11 +976,12 @@ S: Supported INTERMEZZO FILE SYSTEM -P: Chen Yang -M: intermezzo-devel@lists.sourceforge.net +P: Peter J. Braam +M: braam@clusterfs.com W: http://www.inter-mezzo.org/ +W: http://sourceforge.net/projects/intermezzo/ L: intermezzo-discuss@lists.sourceforge.net -S: Maintained +S: Orphan IOC3 DRIVER P: Ralf Baechle @@ -1415,13 +1421,13 @@ PARALLEL PORT SUPPORT P: Phil Blundell -M: Philip.Blundell@pobox.com +M: philb@gnu.org P: Tim Waugh M: tim@cyberelk.net P: David Campbell M: campbell@torque.net P: Andrea Arcangeli -M: andrea@e-mind.com +M: andrea@suse.de L: linux-parport@torque.net W: http://people.redhat.com/twaugh/parport/ S: Maintained @@ -1496,13 +1502,6 @@ W: http://www.realitydiluted.com/projects/nino S: Maintained -PHILIPS NINO PALM PC -P: Steven Hill -M: sjhill@realitydiluted.com -L: linux-mips@oss.sgi.com -W: http://www.realitydiluted.com/projects/nino -S: Maintained - PNP SUPPORT P: Tom Lees M: tom@lpsg.demon.co.uk @@ -1775,11 +1774,6 @@ L: linux-kernel@vger.kernel.org S: Maintained -STALLION TECHNOLOGIES MULTIPORT SERIAL BOARDS -M: support@stallion.oz.au -W: http://www.stallion.com -S: Supported - STARFIRE/DURALAN NETWORK DRIVER P: Ion Badulescu M: ionut@cs.columbia.edu diff -urN linux-2.4.28/Makefile linux-2.4.29/Makefile --- linux-2.4.28/Makefile 2004-11-17 03:54:22.000000000 -0800 +++ linux-2.4.29/Makefile 2005-01-19 06:10:14.711219850 -0800 @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 4 -SUBLEVEL = 28 +SUBLEVEL = 29 EXTRAVERSION = KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -urN linux-2.4.28/arch/cris/drivers/serial.c linux-2.4.29/arch/cris/drivers/serial.c --- linux-2.4.28/arch/cris/drivers/serial.c 2004-02-18 05:36:30.000000000 -0800 +++ linux-2.4.29/arch/cris/drivers/serial.c 2005-01-19 06:09:24.889055976 -0800 @@ -3324,10 +3324,7 @@ return; if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) { - if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && - tty->ldisc.write_wakeup) - (tty->ldisc.write_wakeup)(tty); - wake_up_interruptible(&tty->write_wait); + tty_wakeup(tty); } } @@ -3952,11 +3949,7 @@ info->xmit.head = info->xmit.tail = 0; restore_flags(flags); - wake_up_interruptible(&tty->write_wait); - - if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && - tty->ldisc.write_wakeup) - (tty->ldisc.write_wakeup)(tty); + tty_wakeup(tty); } /* @@ -4578,8 +4571,7 @@ shutdown(info); if (tty->driver.flush_buffer) tty->driver.flush_buffer(tty); - if (tty->ldisc.flush_buffer) - tty->ldisc.flush_buffer(tty); + tty_ldisc_flush(tty); tty->closing = 0; info->event = 0; info->tty = 0; diff -urN linux-2.4.28/arch/i386/defconfig linux-2.4.29/arch/i386/defconfig --- linux-2.4.28/arch/i386/defconfig 2004-11-17 03:54:21.000000000 -0800 +++ linux-2.4.29/arch/i386/defconfig 2005-01-19 06:09:25.010061231 -0800 @@ -200,11 +200,6 @@ # # CONFIG_IPX is not set # CONFIG_ATALK is not set - -# -# Appletalk devices -# -# CONFIG_DEV_APPLETALK is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set @@ -240,10 +235,12 @@ # # CONFIG_BLK_DEV_HD_IDE is not set # CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_IDEDISK_STROKE is not set # CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_DELKIN is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set @@ -346,11 +343,15 @@ # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_MEGARAID2 is not set # CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_SATA_AHCI is not set # CONFIG_SCSI_SATA_SVW is not set +# CONFIG_SCSI_ATA_PIIX is not set +# CONFIG_SCSI_SATA_NV is not set # CONFIG_SCSI_SATA_PROMISE is not set # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set # CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set # CONFIG_SCSI_SATA_VIA is not set # CONFIG_SCSI_SATA_VITESSE is not set # CONFIG_SCSI_BUSLOGIC is not set diff -urN linux-2.4.28/arch/i386/kernel/microcode.c linux-2.4.29/arch/i386/kernel/microcode.c --- linux-2.4.28/arch/i386/kernel/microcode.c 2004-04-14 06:05:25.000000000 -0700 +++ linux-2.4.29/arch/i386/kernel/microcode.c 2005-01-19 06:09:25.410078606 -0800 @@ -109,7 +109,10 @@ #define get_datasize(mc) \ (((microcode_t *)mc)->hdr.datasize ? \ ((microcode_t *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE) -#define sigmatch(s1, s2, p1, p2) (((s1) == (s2)) && ((p1) & (p2))) + +#define sigmatch(s1, s2, p1, p2) \ + (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0)))) + #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE) /* serialize access to the physical write to MSR 0x79 */ diff -urN linux-2.4.28/arch/i386/kernel/pci-irq.c linux-2.4.29/arch/i386/kernel/pci-irq.c --- linux-2.4.28/arch/i386/kernel/pci-irq.c 2004-11-17 03:54:21.000000000 -0800 +++ linux-2.4.29/arch/i386/kernel/pci-irq.c 2005-01-19 06:09:25.815096198 -0800 @@ -248,6 +248,44 @@ } /* + * OPTI Viper-M/N+: Bit field with 3 bits per entry. + * Due to the lack of a specification the information about this chipset + * was taken from the NetBSD source code. + */ +static int pirq_viper_get(struct pci_dev *router, struct pci_dev *dev, int pirq) +{ + static const int viper_irq_decode[] = { 0, 5, 9, 10, 11, 12, 14, 15 }; + u32 irq; + + pci_read_config_dword(router, 0x40, &irq); + irq >>= (pirq-1)*3; + irq &= 7; + + return viper_irq_decode[irq]; +} + +static int pirq_viper_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) +{ + static const int viper_irq_map[] = { -1, -1, -1, -1, -1, 1, -1, -1, -1, 2, 3, 4, 5, -1, 6, 7 }; + int newval = viper_irq_map[irq]; + u32 val; + u32 mask = 7 << (3*(pirq-1)); +#if 0 + mask |= 0x10000UL << (pirq-1); /* edge triggered */ +#endif + + if ( newval == -1 ) + return 0; + + pci_read_config_dword(router, 0x40, &val); + val &= ~mask; + val |= newval << (3*(pirq-1)); + pci_write_config_dword(router, 0x40, val); + + return 1; +} + +/* * Cyrix: nibble offset 0x5C */ static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq) @@ -715,9 +753,16 @@ r->name = "OPTI"; r->get = pirq_opti_get; r->set = pirq_opti_set; - return 1; + break; + case PCI_DEVICE_ID_OPTI_82C558: + r->name = "OPTI VIPER"; + r->get = pirq_viper_get; + r->set = pirq_viper_set; + break; + default: + return 0; } - return 0; + return 1; } static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) diff -urN linux-2.4.28/arch/ia64/ia32/binfmt_elf32.c linux-2.4.29/arch/ia64/ia32/binfmt_elf32.c --- linux-2.4.28/arch/ia64/ia32/binfmt_elf32.c 2004-08-07 16:26:04.000000000 -0700 +++ linux-2.4.29/arch/ia64/ia32/binfmt_elf32.c 2005-01-19 06:09:26.124109621 -0800 @@ -95,7 +95,11 @@ vma->vm_private_data = NULL; down_write(¤t->mm->mmap_sem); { - insert_vm_struct(current->mm, vma); + if (insert_vm_struct(current->mm, vma)) { + kmem_cache_free(vm_area_cachep, vma); + up_write(¤t->mm->mmap_sem); + return; + } } up_write(¤t->mm->mmap_sem); } @@ -117,7 +121,11 @@ vma->vm_private_data = NULL; down_write(¤t->mm->mmap_sem); { - insert_vm_struct(current->mm, vma); + if (insert_vm_struct(current->mm, vma)) { + kmem_cache_free(vm_area_cachep, vma); + up_write(¤t->mm->mmap_sem); + return; + } } up_write(¤t->mm->mmap_sem); } @@ -164,7 +172,7 @@ { unsigned long stack_base; struct vm_area_struct *mpnt; - int i; + int i, ret; stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE; @@ -188,7 +196,11 @@ mpnt->vm_pgoff = 0; mpnt->vm_file = NULL; mpnt->vm_private_data = 0; - insert_vm_struct(current->mm, mpnt); + if ((ret = insert_vm_struct(current->mm, mpnt))) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, mpnt); + return ret; + } current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; } diff -urN linux-2.4.28/arch/ia64/ia32/sys_ia32.c linux-2.4.29/arch/ia64/ia32/sys_ia32.c --- linux-2.4.28/arch/ia64/ia32/sys_ia32.c 2004-08-07 16:26:04.000000000 -0700 +++ linux-2.4.29/arch/ia64/ia32/sys_ia32.c 2005-01-19 06:09:26.355119654 -0800 @@ -111,6 +111,8 @@ *ap++ = (char *) A(addr); arg += sizeof(unsigned int); n++; + if (n >= (MAX_ARG_PAGES * PAGE_SIZE) / sizeof(char *)) + return -E2BIG; } while (addr); return n - 1; } @@ -1367,6 +1369,11 @@ #define __CMSG32_FIRSTHDR(ctl,len) \ ((len) >= sizeof(struct cmsghdr32) ? (struct cmsghdr32 *)(ctl) : (struct cmsghdr32 *)NULL) #define CMSG32_FIRSTHDR(msg) __CMSG32_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen) +#define CMSG32_OK(ucmlen, ucmsg, mhdr) \ + ((ucmlen) >= sizeof(struct cmsghdr32) && \ + (ucmlen) <= (unsigned long) \ + ((mhdr)->msg_controllen - \ + ((char *)(ucmsg) - (char *)(mhdr)->msg_control))) static inline struct cmsghdr32 * __cmsg32_nxthdr (void *ctl, __kernel_size_t size, struct cmsghdr32 *cmsg, int cmsg_len) @@ -1427,10 +1434,7 @@ return -EFAULT; /* Catch bogons. */ - if (CMSG32_ALIGN(ucmlen) < CMSG32_ALIGN(sizeof(struct cmsghdr32))) - return -EINVAL; - if ((unsigned long)(((char *)ucmsg - (char *)kmsg->msg_control) + ucmlen) - > kmsg->msg_controllen) + if (!CMSG32_OK(ucmlen, ucmsg, kmsg)) return -EINVAL; tmp = ((ucmlen - CMSG32_ALIGN(sizeof(*ucmsg))) + diff -urN linux-2.4.28/arch/ia64/mm/init.c linux-2.4.29/arch/ia64/mm/init.c --- linux-2.4.28/arch/ia64/mm/init.c 2004-02-18 05:36:30.000000000 -0800 +++ linux-2.4.29/arch/ia64/mm/init.c 2005-01-19 06:09:26.416122304 -0800 @@ -105,7 +105,13 @@ vma->vm_pgoff = 0; vma->vm_file = NULL; vma->vm_private_data = NULL; - insert_vm_struct(current->mm, vma); + down_write(¤t->mm->mmap_sem); + if (insert_vm_struct(current->mm, vma)) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, vma); + return; + } + up_write(¤t->mm->mmap_sem); } /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */ @@ -117,7 +123,13 @@ vma->vm_end = PAGE_SIZE; vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT); vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED; - insert_vm_struct(current->mm, vma); + down_write(¤t->mm->mmap_sem); + if (insert_vm_struct(current->mm, vma)) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, vma); + return; + } + up_write(¤t->mm->mmap_sem); } } } diff -urN linux-2.4.28/arch/m68k/kernel/setup.c linux-2.4.29/arch/m68k/kernel/setup.c --- linux-2.4.28/arch/m68k/kernel/setup.c 2004-11-17 03:54:21.000000000 -0800 +++ linux-2.4.29/arch/m68k/kernel/setup.c 2005-01-19 06:09:26.536127517 -0800 @@ -597,7 +597,5 @@ printk( KERN_EMERG "(see http://no-fpu.linux-m68k.org)\n" ); panic( "no FPU" ); } - -#endif /* CONFIG_SUN3 */ - +#endif /* !CONFIG_M68KFPU_EMU */ } diff -urN linux-2.4.28/arch/mips/Makefile linux-2.4.29/arch/mips/Makefile --- linux-2.4.28/arch/mips/Makefile 2004-02-18 05:36:30.000000000 -0800 +++ linux-2.4.29/arch/mips/Makefile 2005-01-19 06:09:26.602130383 -0800 @@ -5,7 +5,7 @@ # # Copyright (C) 1994, 1995, 1996 by Ralf Baechle # DECStation modifications by Paul M. Antoine, 1996 -# Copyright (C) 2002, 2003 Maciej W. Rozycki +# Copyright (C) 2002, 2003, 2004 Maciej W. Rozycki # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions @@ -28,6 +28,8 @@ CROSS_COMPILE = $(tool-prefix) endif +MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot + check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) # @@ -44,7 +46,7 @@ GCCFLAGS := -I $(TOPDIR)/include/asm/gcc GCCFLAGS += -G 0 -mno-abicalls -fno-pic -pipe GCCFLAGS += $(call check_gcc, -finline-limit=100000,) -LINKFLAGS += -G 0 -static # -N +LINKFLAGS += -G 0 -static -n MODFLAGS += -mlong-calls ifdef CONFIG_DEBUG_INFO @@ -98,6 +100,11 @@ gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \ break; \ done; \ +if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \ + $(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \ + -xc /dev/null > /dev/null 2>&1 && \ + gcc_isa=; \ +fi; \ echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu $$gas_isa) # @@ -168,7 +175,8 @@ AFLAGS += $(GCCFLAGS) CFLAGS += $(GCCFLAGS) -LDFLAGS += -m $(ld-emul) + +LD += -m $(ld-emul) # @@ -249,6 +257,13 @@ LOADADDR += 0x80100000 endif +ifdef CONFIG_MIPS_DB1550 +LIBS += arch/mips/au1000/db1x00/db1x00.o \ + arch/mips/au1000/common/au1000.o +SUBDIRS += arch/mips/au1000/db1x00 arch/mips/au1000/common +LOADADDR += 0x80100000 +endif + ifdef CONFIG_MIPS_DB1100 LIBS += arch/mips/au1000/db1x00/db1x00.o \ arch/mips/au1000/common/au1000.o @@ -463,6 +478,18 @@ LOADADDR := 0x80100000 endif +ifdef CONFIG_PMC_BIG_SUR +CORE_FILES += arch/mips/pmc-sierra/big_sur/big_sur.o +SUBDIRS += arch/mips/pmc-sierra/big_sur +LOADADDR := 0x80100000 +endif + +ifdef CONFIG_PMC_STRETCH +CORE_FILES += arch/mips/pmc-sierra/stretch/stretch.o +SUBDIRS += arch/mips/pmc-sierra/stretch +LOADADDR := 0x80200000 +endif + ifdef CONFIG_MOMENCO_JAGUAR_ATX LIBS += arch/mips/momentum/jaguar_atx/jaguar_atx.o SUBDIRS += arch/mips/momentum/jaguar_atx @@ -723,7 +750,10 @@ $(MAKE) -C arch/$(ARCH)/lasat/image $@ endif -MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot +boot: mips-boot + +mips-boot: vmlinux + @$(MAKEBOOT) boot vmlinux.ecoff: vmlinux @$(MAKEBOOT) $@ diff -urN linux-2.4.28/arch/mips/au1000/common/Makefile linux-2.4.29/arch/mips/au1000/common/Makefile --- linux-2.4.28/arch/mips/au1000/common/Makefile 2004-02-18 05:36:30.000000000 -0800 +++ linux-2.4.29/arch/mips/au1000/common/Makefile 2005-01-19 06:09:26.635131817 -0800 @@ -18,8 +18,10 @@ export-objs = prom.o clocks.o power.o usbdev.o -obj-y := prom.o int-handler.o dma.o irq.o puts.o time.o reset.o \ - clocks.o power.o setup.o sleeper.o +obj-y := prom.o int-handler.o irq.o puts.o time.o reset.o cputable.o \ + au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o dma.o dbdma.o + +export-objs += dma.o dbdma.o obj-$(CONFIG_AU1X00_USB_DEVICE) += usbdev.o obj-$(CONFIG_KGDB) += dbg_io.o diff -urN linux-2.4.28/arch/mips/au1000/common/au1xxx_irqmap.c linux-2.4.29/arch/mips/au1000/common/au1xxx_irqmap.c --- linux-2.4.28/arch/mips/au1000/common/au1xxx_irqmap.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.29/arch/mips/au1000/common/au1xxx_irqmap.c 2005-01-19 06:09:26.636131860 -0800 @@ -0,0 +1,223 @@ +/* + * BRIEF MODULE DESCRIPTION + * Au1xxx processor specific IRQ tables + * + * Copyright 2004 Embedded Edge, LLC + * dan@embeddededge.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* The IC0 interrupt table. This is processor, rather than + * board dependent, so no reason to keep this info in the board + * dependent files. + * + * Careful if you change match 2 request! + * The interrupt handler is called directly from the low level dispatch code. + */ +au1xxx_irq_map_t au1xxx_ic0_map[] = { + +#if defined(CONFIG_SOC_AU1000) + { AU1000_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_UART1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_UART2_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_SSI0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_SSI1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_IRDA_TX_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_IRDA_RX_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, + { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, + +#elif defined(CONFIG_SOC_AU1500) + + { AU1500_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_PCI_INTA, INTC_INT_LOW_LEVEL, 0 }, + { AU1000_PCI_INTB, INTC_INT_LOW_LEVEL, 0 }, + { AU1500_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_PCI_INTC, INTC_INT_LOW_LEVEL, 0 }, + { AU1000_PCI_INTD, INTC_INT_LOW_LEVEL, 0 }, + { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, + { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1500_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1500_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, + +#elif defined(CONFIG_SOC_AU1100) + + { AU1100_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_UART1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_SD_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1100_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_SSI0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_SSI1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_IRDA_TX_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_IRDA_RX_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, + { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1100_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + /*{ AU1000_GPIO215_208_INT, INTC_INT_HIGH_LEVEL, 0},*/ + { AU1100_LCD_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 }, + +#elif defined(CONFIG_SOC_AU1550) + + { AU1550_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_PCI_INTA, INTC_INT_LOW_LEVEL, 0 }, + { AU1550_PCI_INTB, INTC_INT_LOW_LEVEL, 0 }, + { AU1550_DDMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_CRYPTO_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_PCI_INTC, INTC_INT_LOW_LEVEL, 0 }, + { AU1550_PCI_INTD, INTC_INT_LOW_LEVEL, 0 }, + { AU1550_PCI_RST_INT, INTC_INT_LOW_LEVEL, 0 }, + { AU1550_UART1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_UART3_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_PSC0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_TOY_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, + { AU1550_RTC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0}, + { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1550_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 }, + { AU1550_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1550_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0}, + +#elif defined(CONFIG_SOC_AU1200) + + { AU1200_UART0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_SWT_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_SD_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_DDMA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_MAE_BE_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1200_UART1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_MAE_FE_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1200_PSC0_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_TOY_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 }, + { AU1200_RTC_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 }, + { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0}, + { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 }, + { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0}, + { AU1200_MAE_BOTH_INT, INTC_INT_HIGH_LEVEL, 0}, + +#else +#error "Error: Unknown Alchemy SOC" +#endif + +}; + +int au1xxx_ic0_nr_irqs = sizeof(au1xxx_ic0_map)/sizeof(au1xxx_irq_map_t); + diff -urN linux-2.4.28/arch/mips/au1000/common/clocks.c linux-2.4.29/arch/mips/au1000/common/clocks.c --- linux-2.4.28/arch/mips/au1000/common/clocks.c 2003-08-25 04:44:39.000000000 -0700 +++ linux-2.4.29/arch/mips/au1000/common/clocks.c 2005-01-19 06:09:26.637131904 -0800 @@ -95,4 +95,5 @@ return lcd_clock; } +EXPORT_SYMBOL(get_au1x00_speed); EXPORT_SYMBOL(get_au1x00_lcd_clock); diff -urN linux-2.4.28/arch/mips/au1000/common/cputable.c linux-2.4.29/arch/mips/au1000/common/cputable.c --- linux-2.4.28/arch/mips/au1000/common/cputable.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.29/arch/mips/au1000/common/cputable.c 2005-01-19 06:09:26.638131947 -0800 @@ -0,0 +1,57 @@ +/* + * arch/mips/au1000/common/cputable.c + * + * Copyright (C) 2004 Dan Malek (dan@embeddededge.com) + * Copied from PowerPC and updated for Alchemy Au1xxx processors. + * + * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include + +struct cpu_spec* cur_cpu_spec[NR_CPUS]; + +/* With some thought, we can probably use the mask to reduce the + * size of the table. + */ +struct cpu_spec cpu_specs[] = { + { 0xffffffff, 0x00030100, "Au1000 DA", 1, 0 }, + { 0xffffffff, 0x00030201, "Au1000 HA", 1, 0 }, + { 0xffffffff, 0x00030202, "Au1000 HB", 1, 0 }, + { 0xffffffff, 0x00030203, "Au1000 HC", 1, 1 }, + { 0xffffffff, 0x00030204, "Au1000 HD", 1, 1 }, + { 0xffffffff, 0x01030200, "Au1500 AB", 1, 1 }, + { 0xffffffff, 0x01030201, "Au1500 AC", 0, 1 }, + { 0xffffffff, 0x01030202, "Au1500 AD", 0, 1 }, + { 0xffffffff, 0x02030200, "Au1100 AB", 1, 1 }, + { 0xffffffff, 0x02030201, "Au1100 BA", 1, 1 }, + { 0xffffffff, 0x02030202, "Au1100 BC", 1, 1 }, + { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 }, + { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 }, + { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 }, + { 0xffffffff, 0x04030200, "Au1200 AA", 0, 1 }, + { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 }, +}; + +void +set_cpuspec(void) +{ + struct cpu_spec *sp; + u32 prid; + + prid = read_c0_prid(); + sp = cpu_specs; + while ((prid & sp->prid_mask) != sp->prid_value) + sp++; + cur_cpu_spec[0] = sp; +} diff -urN linux-2.4.28/arch/mips/au1000/common/dbdma.c linux-2.4.29/arch/mips/au1000/common/dbdma.c --- linux-2.4.28/arch/mips/au1000/common/dbdma.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.29/arch/mips/au1000/common/dbdma.c 2005-01-19 06:09:26.640132034 -0800 @@ -0,0 +1,834 @@ +/* + * + * BRIEF MODULE DESCRIPTION + * The Descriptor Based DMA channel manager that first appeared + * on the Au1550. I started with dma.c, but I think all that is + * left is this initial comment :-) + * + * Copyright 2004 Embedded Edge, LLC + * dan@embeddededge.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) + +/* + * The Descriptor Based DMA supports up to 16 channels. + * + * There are 32 devices defined. We keep an internal structure + * of devices using these channels, along with additional + * information. + * + * We allocate the descriptors and allow access to them through various + * functions. The drivers allocate the data buffers and assign them + * to the descriptors. + */ +static spinlock_t au1xxx_dbdma_spin_lock = SPIN_LOCK_UNLOCKED; + +/* I couldn't find a macro that did this...... +*/ +#define ALIGN_ADDR(x, a) ((((u32)(x)) + (a-1)) & ~(a-1)) + +static volatile dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE; +static int dbdma_initialized; +static void au1xxx_dbdma_init(void); + +typedef struct dbdma_device_table { + u32 dev_id; + u32 dev_flags; + u32 dev_tsize; + u32 dev_devwidth; + u32 dev_physaddr; /* If FIFO */ + u32 dev_intlevel; + u32 dev_intpolarity; +} dbdev_tab_t; + +typedef struct dbdma_chan_config { + u32 chan_flags; + u32 chan_index; + dbdev_tab_t *chan_src; + dbdev_tab_t *chan_dest; + au1x_dma_chan_t *chan_ptr; + au1x_ddma_desc_t *chan_desc_base; + au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr; + void *chan_callparam; + void (*chan_callback)(int, void *, struct pt_regs *); +} chan_tab_t; + +#define DEV_FLAGS_INUSE (1 << 0) +#define DEV_FLAGS_ANYUSE (1 << 1) +#define DEV_FLAGS_OUT (1 << 2) +#define DEV_FLAGS_IN (1 << 3) + +static dbdev_tab_t dbdev_tab[] = { +#ifdef CONFIG_SOC_AU1550 + /* UARTS */ + { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, + { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, + { DSCR_CMD0_UART3_TX, DEV_FLAGS_OUT, 0, 8, 0x11400004, 0, 0 }, + { DSCR_CMD0_UART3_RX, DEV_FLAGS_IN, 0, 8, 0x11400000, 0, 0 }, + + /* EXT DMA */ + { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ2, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ3, 0, 0, 0, 0x00000000, 0, 0 }, + + /* USB DEV */ + { DSCR_CMD0_USBDEV_RX0, DEV_FLAGS_IN, 4, 8, 0x10200000, 0, 0 }, + { DSCR_CMD0_USBDEV_TX0, DEV_FLAGS_OUT, 4, 8, 0x10200004, 0, 0 }, + { DSCR_CMD0_USBDEV_TX1, DEV_FLAGS_OUT, 4, 8, 0x10200008, 0, 0 }, + { DSCR_CMD0_USBDEV_TX2, DEV_FLAGS_OUT, 4, 8, 0x1020000c, 0, 0 }, + { DSCR_CMD0_USBDEV_RX3, DEV_FLAGS_IN, 4, 8, 0x10200010, 0, 0 }, + { DSCR_CMD0_USBDEV_RX4, DEV_FLAGS_IN, 4, 8, 0x10200014, 0, 0 }, + + /* PSC 0 */ + { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, + { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, + + /* PSC 1 */ + { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, + { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, + + /* PSC 2 */ + { DSCR_CMD0_PSC2_TX, DEV_FLAGS_OUT, 0, 0, 0x10a0001c, 0, 0 }, + { DSCR_CMD0_PSC2_RX, DEV_FLAGS_IN, 0, 0, 0x10a0001c, 0, 0 }, + + /* PSC 3 */ + { DSCR_CMD0_PSC3_TX, DEV_FLAGS_OUT, 0, 0, 0x10b0001c, 0, 0 }, + { DSCR_CMD0_PSC3_RX, DEV_FLAGS_IN, 0, 0, 0x10b0001c, 0, 0 }, + + { DSCR_CMD0_PCI_WRITE, 0, 0, 0, 0x00000000, 0, 0 }, /* PCI */ + { DSCR_CMD0_NAND_FLASH, 0, 0, 0, 0x00000000, 0, 0 }, /* NAND */ + + /* MAC 0 */ + { DSCR_CMD0_MAC0_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAC0_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + + /* MAC 1 */ + { DSCR_CMD0_MAC1_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAC1_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + +#endif /* CONFIG_SOC_AU1550 */ + +#ifdef CONFIG_SOC_AU1200 + { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, + { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, + { DSCR_CMD0_UART1_TX, DEV_FLAGS_OUT, 0, 8, 0x11200004, 0, 0 }, + { DSCR_CMD0_UART1_RX, DEV_FLAGS_IN, 0, 8, 0x11200000, 0, 0 }, + + { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_MAE_BE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAE_FE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_AES_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, + { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, + { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, + { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, + { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + + { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, + +#endif // CONFIG_SOC_AU1200 + + { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, + { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, +}; + +#define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t)) + +static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; + +static dbdev_tab_t * +find_dbdev_id (u32 id) +{ + int i; + dbdev_tab_t *p; + for (i = 0; i < DBDEV_TAB_SIZE; ++i) { + p = &dbdev_tab[i]; + if (p->dev_id == id) + return p; + } + return NULL; +} + +/* Allocate a channel and return a non-zero descriptor if successful. +*/ +u32 +au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid, + void (*callback)(int, void *, struct pt_regs *), void *callparam) +{ + unsigned long flags; + u32 used, chan, rv; + u32 dcp; + int i; + dbdev_tab_t *stp, *dtp; + chan_tab_t *ctp; + volatile au1x_dma_chan_t *cp; + + /* We do the intialization on the first channel allocation. + * We have to wait because of the interrupt handler initialization + * which can't be done successfully during board set up. + */ + if (!dbdma_initialized) + au1xxx_dbdma_init(); + dbdma_initialized = 1; + + if ((srcid > DSCR_NDEV_IDS) || (destid > DSCR_NDEV_IDS)) + return 0; + + if ((stp = find_dbdev_id(srcid)) == NULL) return 0; + if ((dtp = find_dbdev_id(destid)) == NULL) return 0; + + used = 0; + rv = 0; + + /* Check to see if we can get both channels. + */ + spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags); + if (!(stp->dev_flags & DEV_FLAGS_INUSE) || + (stp->dev_flags & DEV_FLAGS_ANYUSE)) { + /* Got source */ + stp->dev_flags |= DEV_FLAGS_INUSE; + if (!(dtp->dev_flags & DEV_FLAGS_INUSE) || + (dtp->dev_flags & DEV_FLAGS_ANYUSE)) { + /* Got destination */ + dtp->dev_flags |= DEV_FLAGS_INUSE; + } + else { + /* Can't get dest. Release src. + */ + stp->dev_flags &= ~DEV_FLAGS_INUSE; + used++; + } + } + else { + used++; + } + spin_unlock_irqrestore(&au1xxx_dbdma_spin_lock, flags); + + if (!used) { + /* Let's see if we can allocate a channel for it. + */ + ctp = NULL; + chan = 0; + spin_lock_irqsave(&au1xxx_dbdma_spin_lock, flags); + for (i=0; ichan_index = chan = i; + break; + } + } + spin_unlock_irqrestore(&au1xxx_dbdma_spin_lock, flags); + + if (ctp != NULL) { + memset(ctp, 0, sizeof(chan_tab_t)); + dcp = DDMA_CHANNEL_BASE; + dcp += (0x0100 * chan); + ctp->chan_ptr = (au1x_dma_chan_t *)dcp; + cp = (volatile au1x_dma_chan_t *)dcp; + ctp->chan_src = stp; + ctp->chan_dest = dtp; + ctp->chan_callback = callback; + ctp->chan_callparam = callparam; + + /* Initialize channel configuration. + */ + i = 0; + if (stp->dev_intlevel) + i |= DDMA_CFG_SED; + if (stp->dev_intpolarity) + i |= DDMA_CFG_SP; + if (dtp->dev_intlevel) + i |= DDMA_CFG_DED; + if (dtp->dev_intpolarity) + i |= DDMA_CFG_DP; + cp->ddma_cfg = i; + au_sync(); + + /* Return a non-zero value that can be used to + * find the channel information in subsequent + * operations. + */ + rv = (u32)(&chan_tab_ptr[chan]); + } + else { + /* Release devices. + */ + stp->dev_flags &= ~DEV_FLAGS_INUSE; + dtp->dev_flags &= ~DEV_FLAGS_INUSE; + } + } + return rv; +} + +/* Set the device width if source or destination is a FIFO. + * Should be 8, 16, or 32 bits. + */ +u32 +au1xxx_dbdma_set_devwidth(u32 chanid, int bits) +{ + u32 rv; + chan_tab_t *ctp; + dbdev_tab_t *stp, *dtp; + + ctp = *((chan_tab_t **)chanid); + stp = ctp->chan_src; + dtp = ctp->chan_dest; + rv = 0; + + if (stp->dev_flags & DEV_FLAGS_IN) { /* Source in fifo */ + rv = stp->dev_devwidth; + stp->dev_devwidth = bits; + } + if (dtp->dev_flags & DEV_FLAGS_OUT) { /* Destination out fifo */ + rv = dtp->dev_devwidth; + dtp->dev_devwidth = bits; + } + + return rv; +} + +/* Allocate a descriptor ring, initializing as much as possible. +*/ +u32 +au1xxx_dbdma_ring_alloc(u32 chanid, int entries) +{ + int i; + u32 desc_base, srcid, destid; + u32 cmd0, cmd1, src1, dest1; + u32 src0, dest0; + chan_tab_t *ctp; + dbdev_tab_t *stp, *dtp; + au1x_ddma_desc_t *dp; + + /* I guess we could check this to be within the + * range of the table...... + */ + ctp = *((chan_tab_t **)chanid); + stp = ctp->chan_src; + dtp = ctp->chan_dest; + + /* The descriptors must be 32-byte aligned. There is a + * possibility the allocation will give us such an address, + * and if we try that first we are likely to not waste larger + * slabs of memory. + */ + desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t), GFP_KERNEL); + if (desc_base == 0) + return 0; + + if (desc_base & 0x1f) { + /* Lost....do it again, allocate extra, and round + * the address base. + */ + kfree((const void *)desc_base); + i = entries * sizeof(au1x_ddma_desc_t); + i += (sizeof(au1x_ddma_desc_t) - 1); + if ((desc_base = (u32)kmalloc(i, GFP_KERNEL)) == 0) + return 0; + + desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t)); + } + dp = (au1x_ddma_desc_t *)desc_base; + + /* Keep track of the base descriptor. + */ + ctp->chan_desc_base = dp; + + /* Initialize the rings with as much information as we know. + */ + srcid = stp->dev_id; + destid = dtp->dev_id; + + cmd0 = cmd1 = src1 = dest1 = 0; + src0 = dest0 = 0; + + cmd0 |= DSCR_CMD0_SID(srcid); + cmd0 |= DSCR_CMD0_DID(destid); + cmd0 |= DSCR_CMD0_IE | DSCR_CMD0_CV; + cmd0 |= DSCR_CMD0_ST(DSCR_CMD0_ST_CURRENT); + + switch (stp->dev_devwidth) { + case 8: + cmd0 |= DSCR_CMD0_SW(DSCR_CMD0_BYTE); + break; + case 16: + cmd0 |= DSCR_CMD0_SW(DSCR_CMD0_HALFWORD); + break; + case 32: + default: + cmd0 |= DSCR_CMD0_SW(DSCR_CMD0_WORD); + break; + } + + switch (dtp->dev_devwidth) { + case 8: + cmd0 |= DSCR_CMD0_DW(DSCR_CMD0_BYTE); + break; + case 16: + cmd0 |= DSCR_CMD0_DW(DSCR_CMD0_HALFWORD); + break; + case 32: + default: + cmd0 |= DSCR_CMD0_DW(DSCR_CMD0_WORD); + break; + } + + /* If the device is marked as an in/out FIFO, ensure it is + * set non-coherent. + */ + if (stp->dev_flags & DEV_FLAGS_IN) + cmd0 |= DSCR_CMD0_SN; /* Source in fifo */ + if (dtp->dev_flags & DEV_FLAGS_OUT) + cmd0 |= DSCR_CMD0_DN; /* Destination out fifo */ + + /* Set up source1. For now, assume no stride and increment. + * A channel attribute update can change this later. + */ + switch (stp->dev_tsize) { + case 1: + src1 |= DSCR_SRC1_STS(DSCR_xTS_SIZE1); + break; + case 2: + src1 |= DSCR_SRC1_STS(DSCR_xTS_SIZE2); + break; + case 4: + src1 |= DSCR_SRC1_STS(DSCR_xTS_SIZE4); + break; + case 8: + default: + src1 |= DSCR_SRC1_STS(DSCR_xTS_SIZE8); + break; + } + + /* If source input is fifo, set static address. + */ + if (stp->dev_flags & DEV_FLAGS_IN) { + src0 = stp->dev_physaddr; + src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC); + } + + /* Set up dest1. For now, assume no stride and increment. + * A channel attribute update can change this later. + */ + switch (dtp->dev_tsize) { + case 1: + dest1 |= DSCR_DEST1_DTS(DSCR_xTS_SIZE1); + break; + case 2: + dest1 |= DSCR_DEST1_DTS(DSCR_xTS_SIZE2); + break; + case 4: + dest1 |= DSCR_DEST1_DTS(DSCR_xTS_SIZE4); + break; + case 8: + default: + dest1 |= DSCR_DEST1_DTS(DSCR_xTS_SIZE8); + break; + } + + /* If destination output is fifo, set static address. + */ + if (dtp->dev_flags & DEV_FLAGS_OUT) { + dest0 = dtp->dev_physaddr; + dest1 |= DSCR_DEST1_DAM(DSCR_xAM_STATIC); + } + + for (i=0; idscr_cmd0 = cmd0; + dp->dscr_cmd1 = cmd1; + dp->dscr_source0 = src0; + dp->dscr_source1 = src1; + dp->dscr_dest0 = dest0; + dp->dscr_dest1 = dest1; + dp->dscr_stat = 0; + dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1)); + dp++; + } + + /* Make last descrptor point to the first. + */ + dp--; + dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(ctp->chan_desc_base)); + ctp->get_ptr = ctp->put_ptr = ctp->cur_ptr = ctp->chan_desc_base; + + return (u32)(ctp->chan_desc_base); +} + +/* Put a source buffer into the DMA ring. + * This updates the source pointer and byte count. Normally used + * for memory to fifo transfers. + */ +u32 +au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes) +{ + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + + /* I guess we could check this to be within the + * range of the table...... + */ + ctp = *((chan_tab_t **)chanid); + + /* We should have multiple callers for a particular channel, + * an interrupt doesn't affect this pointer nor the descriptor, + * so no locking should be needed. + */ + dp = ctp->put_ptr; + + /* If the descriptor is valid, we are way ahead of the DMA + * engine, so just return an error condition. + */ + if (dp->dscr_cmd0 & DSCR_CMD0_V) { + return 0; + } + + /* Load up buffer address and byte count. + */ + dp->dscr_source0 = virt_to_phys(buf); + dp->dscr_cmd1 = nbytes; + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ + ctp->chan_ptr->ddma_dbell = 0xffffffff; /* Make it go */ + + /* Get next descriptor pointer. + */ + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); + + /* return something not zero. + */ + return nbytes; +} + +/* Put a destination buffer into the DMA ring. + * This updates the destination pointer and byte count. Normally used + * to place an empty buffer into the ring for fifo to memory transfers. + */ +u32 +au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes) +{ + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + + /* I guess we could check this to be within the + * range of the table...... + */ + ctp = *((chan_tab_t **)chanid); + + /* We should have multiple callers for a particular channel, + * an interrupt doesn't affect this pointer nor the descriptor, + * so no locking should be needed. + */ + dp = ctp->put_ptr; + + /* If the descriptor is valid, we are way ahead of the DMA + * engine, so just return an error condition. + */ + if (dp->dscr_cmd0 & DSCR_CMD0_V) + return 0; + + /* Load up buffer address and byte count. + */ + dp->dscr_dest0 = virt_to_phys(buf); + dp->dscr_cmd1 = nbytes; + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ + + /* Get next descriptor pointer. + */ + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); + + /* return something not zero. + */ + return nbytes; +} + +/* Get a destination buffer into the DMA ring. + * Normally used to get a full buffer from the ring during fifo + * to memory transfers. This does not set the valid bit, you will + * have to put another destination buffer to keep the DMA going. + */ +u32 +au1xxx_dbdma_get_dest(u32 chanid, void **buf, int *nbytes) +{ + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + u32 rv; + + /* I guess we could check this to be within the + * range of the table...... + */ + ctp = *((chan_tab_t **)chanid); + + /* We should have multiple callers for a particular channel, + * an interrupt doesn't affect this pointer nor the descriptor, + * so no locking should be needed. + */ + dp = ctp->get_ptr; + + /* If the descriptor is valid, we are way ahead of the DMA + * engine, so just return an error condition. + */ + if (dp->dscr_cmd0 & DSCR_CMD0_V) + return 0; + + /* Return buffer address and byte count. + */ + *buf = (void *)(phys_to_virt(dp->dscr_dest0)); + *nbytes = dp->dscr_cmd1; + rv = dp->dscr_stat; + + /* Get next descriptor pointer. + */ + ctp->get_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); + + /* return something not zero. + */ + return rv; +} + +void +au1xxx_dbdma_stop(u32 chanid) +{ + chan_tab_t *ctp; + volatile au1x_dma_chan_t *cp; + int halt_timeout = 0; + + ctp = *((chan_tab_t **)chanid); + + cp = ctp->chan_ptr; + cp->ddma_cfg &= ~DDMA_CFG_EN; /* Disable channel */ + au_sync(); + while (!(cp->ddma_stat & DDMA_STAT_H)) { + udelay(1); + halt_timeout++; + if (halt_timeout > 100) { + printk("warning: DMA channel won't halt\n"); + break; + } + } + /* clear current desc valid and doorbell */ + cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V); + au_sync(); +} + +/* Start using the current descriptor pointer. If the dbdma encounters + * a not valid descriptor, it will stop. In this case, we can just + * continue by adding a buffer to the list and starting again. + */ +void +au1xxx_dbdma_start(u32 chanid) +{ + chan_tab_t *ctp; + volatile au1x_dma_chan_t *cp; + + ctp = *((chan_tab_t **)chanid); + + cp = ctp->chan_ptr; + cp->ddma_desptr = virt_to_phys(ctp->cur_ptr); + cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */ + au_sync(); + cp->ddma_dbell = 0xffffffff; /* Make it go */ + au_sync(); +} + +void +au1xxx_dbdma_reset(u32 chanid) +{ + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + + au1xxx_dbdma_stop(chanid); + + ctp = *((chan_tab_t **)chanid); + ctp->get_ptr = ctp->put_ptr = ctp->cur_ptr = ctp->chan_desc_base; + + /* Run through the descriptors and reset the valid indicator. + */ + dp = ctp->chan_desc_base; + + do { + dp->dscr_cmd0 &= ~DSCR_CMD0_V; + dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); + } while (dp != ctp->chan_desc_base); +} + +u32 +au1xxx_get_dma_residue(u32 chanid) +{ + chan_tab_t *ctp; + volatile au1x_dma_chan_t *cp; + u32 rv; + + ctp = *((chan_tab_t **)chanid); + cp = ctp->chan_ptr; + + /* This is only valid if the channel is stopped. + */ + rv = cp->ddma_bytecnt; + au_sync(); + + return rv; +} + +void +au1xxx_dbdma_chan_free(u32 chanid) +{ + chan_tab_t *ctp; + dbdev_tab_t *stp, *dtp; + + ctp = *((chan_tab_t **)chanid); + stp = ctp->chan_src; + dtp = ctp->chan_dest; + + au1xxx_dbdma_stop(chanid); + + if (ctp->chan_desc_base != NULL) + kfree(ctp->chan_desc_base); + + stp->dev_flags &= ~DEV_FLAGS_INUSE; + dtp->dev_flags &= ~DEV_FLAGS_INUSE; + chan_tab_ptr[ctp->chan_index] = NULL; + + kfree(ctp); +} + +static void +dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + u32 intstat; + u32 chan_index; + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + volatile au1x_dma_chan_t *cp; + + intstat = dbdma_gptr->ddma_intstat; + au_sync(); + chan_index = au_ffs(intstat) - 1; + + ctp = chan_tab_ptr[chan_index]; + cp = ctp->chan_ptr; + dp = ctp->cur_ptr; + + /* Reset interrupt. + */ + cp->ddma_irq = 0; + au_sync(); + + if (ctp->chan_callback) + (ctp->chan_callback)(irq, ctp->chan_callparam, regs); + + ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); + +} + +static void +au1xxx_dbdma_init(void) +{ + dbdma_gptr->ddma_config = 0; + dbdma_gptr->ddma_throttle = 0; + dbdma_gptr->ddma_inten = 0xffff; + au_sync(); + + if (request_irq(AU1550_DDMA_INT, dbdma_interrupt, SA_INTERRUPT, + "Au1xxx dbdma", (void *)dbdma_gptr)) + printk("Can't get 1550 dbdma irq"); +} + +void +au1xxx_dbdma_dump(u32 chanid) +{ + chan_tab_t *ctp; + au1x_ddma_desc_t *dp; + dbdev_tab_t *stp, *dtp; + volatile au1x_dma_chan_t *cp; + + ctp = *((chan_tab_t **)chanid); + stp = ctp->chan_src; + dtp = ctp->chan_dest; + cp = ctp->chan_ptr; + + printk("Chan %x, stp %x (dev %d) dtp %x (dev %d) \n", + (u32)ctp, (u32)stp, stp - dbdev_tab, (u32)dtp, dtp - dbdev_tab); + printk("desc base %x, get %x, put %x, cur %x\n", + (u32)(ctp->chan_desc_base), (u32)(ctp->get_ptr), + (u32)(ctp->put_ptr), (u32)(ctp->cur_ptr)); + + printk("dbdma chan %x\n", (u32)cp); + printk("cfg %08x, desptr %08x, statptr %08x\n", + cp->ddma_cfg, cp->ddma_desptr, cp->ddma_statptr); + printk("dbell %08x, irq %08x, stat %08x, bytecnt %08x\n", + cp->ddma_dbell, cp->ddma_irq, cp->ddma_stat, cp->ddma_bytecnt); + + + /* Run through the descriptors + */ + dp = ctp->chan_desc_base; + + do { + printk("dp %08x, cmd0 %08x, cmd1 %08x\n", + (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1); + printk("src0 %08x, src1 %08x, dest0 %08x\n", + dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0); + printk("dest1 %08x, stat %08x, nxtptr %08x\n", + dp->dscr_dest1, dp->dscr_stat, dp->dscr_nxtptr); + dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr)); + } while (dp != ctp->chan_desc_base); +} + +#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ + diff -urN linux-2.4.28/arch/mips/au1000/common/dma.c linux-2.4.29/arch/mips/au1000/common/dma.c --- linux-2.4.28/arch/mips/au1000/common/dma.c 2004-02-18 05:36:30.000000000 -0800 +++ linux-2.4.29/arch/mips/au1000/common/dma.c 2005-01-19 06:09:26.679133728 -0800 @@ -40,6 +40,8 @@ #include #include +#include + #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100) /* @@ -73,7 +75,7 @@ }; // Device FIFO addresses and default DMA modes -static const struct { +static const struct dma_dev { unsigned int fifo_addr; unsigned int dma_mode; } dma_dev_table[DMA_NUM_DEV] = { @@ -120,12 +122,19 @@ return len; } +// Device FIFO addresses and default DMA modes - 2nd bank +static const struct dma_dev dma_dev_table_bank2[DMA_NUM_DEV_BANK2] = { + {SD0_XMIT_FIFO, DMA_DS | DMA_DW8}, // coherent + {SD0_RECV_FIFO, DMA_DS | DMA_DR | DMA_DW8}, // coherent + {SD1_XMIT_FIFO, DMA_DS | DMA_DW8}, // coherent + {SD1_RECV_FIFO, DMA_DS | DMA_DR | DMA_DW8} // coherent +}; void dump_au1000_dma_channel(unsigned int dmanr) { struct dma_chan *chan; - if (dmanr > NUM_AU1000_DMA_CHANNELS) + if (dmanr >= NUM_AU1000_DMA_CHANNELS) return; chan = &au1000_dma_table[dmanr]; @@ -156,10 +165,16 @@ void *irq_dev_id) { struct dma_chan *chan; + const struct dma_dev *dev; int i, ret; - if (dev_id < 0 || dev_id >= DMA_NUM_DEV) +#if defined(CONFIG_SOC_AU1100) + if (dev_id < 0 || dev_id >= (DMA_NUM_DEV + DMA_NUM_DEV_BANK2)) return -EINVAL; +#else + if (dev_id < 0 || dev_id >= DMA_NUM_DEV) + return -EINVAL; +#endif for (i = 0; i < NUM_AU1000_DMA_CHANNELS; i++) { if (au1000_dma_table[i].dev_id < 0) @@ -170,6 +185,13 @@ chan = &au1000_dma_table[i]; + if (dev_id >= DMA_NUM_DEV) { + dev_id -= DMA_NUM_DEV; + dev = &dma_dev_table_bank2[dev_id]; + } else { + dev = &dma_dev_table[dev_id]; + } + if (irqhandler) { chan->irq = AU1000_DMA_INT_BASE + i; chan->irq_dev = irq_dev_id; @@ -188,8 +210,8 @@ chan->io = DMA_CHANNEL_BASE + i * DMA_CHANNEL_LEN; chan->dev_id = dev_id; chan->dev_str = dev_str; - chan->fifo_addr = dma_dev_table[dev_id].fifo_addr; - chan->mode = dma_dev_table[dev_id].dma_mode; + chan->fifo_addr = dev->fifo_addr; + chan->mode = dev->dma_mode; /* initialize the channel before returning */ init_dma(i); @@ -213,4 +235,9 @@ chan->irq_dev = NUL