## Automatically generated incremental diff ## From: linux-2.5.63-bk3 ## To: linux-2.5.63-bk4 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/IOP310/IQ80310 linux-2.5.63-bk4/Documentation/arm/XScale/IOP310/IQ80310 --- linux-2.5.63-bk3/Documentation/arm/XScale/IOP310/IQ80310 Mon Feb 24 11:05:43 2003 +++ linux-2.5.63-bk4/Documentation/arm/XScale/IOP310/IQ80310 Wed Dec 31 16:00:00 1969 @@ -1,295 +0,0 @@ - -Board Overview ------------------------------ - -The Cyclone IQ80310 board is an evaluation platform for Intel's 80200 Xscale -CPU and 80312 Intelligent I/O chipset (collectively called IOP310 chipset). - -The 80312 contains dual PCI hoses (called the ATUs), a PCI-to-PCI bridge, -three DMA channels (1 on secondary PCI, one on primary PCI ), I2C, I2O -messaging unit, XOR unit for RAID operations, a bus performance monitoring -unit, and a memory controller with ECC features. - -For more information on the board, see http://developer.intel.com/iio - -Port Status ------------------------------ - -Supported: - -- MTD/JFFS/JFFS2 -- NFS root -- RAMDISK root -- 2ndary PCI slots -- Onboard ethernet -- Serial ports (ttyS0/S1) -- Cache/TLB locking on 80200 CPU -- Performance monitoring unit on 80200 CPU -- 80200 Performance Monitoring Unit -- Acting as a system controller on Cyclone 80303BP PCI backplane -- DMA engines (EXPERIMENTAL) -- 80312 Bus Performance Monitor (EXPERIMENTAL) -- Application Accelerator Unit (XOR engine for RAID) (EXPERIMENTAL) -- Messaging Unit (EXPERIMENTAL) - -TODO: -- I2C - -Building the Kernel ------------------------------ -make iq80310_config -make oldconfig -make dep -make zImage - -This will build an image setup for BOOTP/NFS root support. To change this, -just run make menuconfig and disable nfs root or add a "root=" option. - -Preparing the Hardware ------------------------------ - -This document assumes you're using a Rev D or newer board running -Redboot as the bootloader. - -The as-supplied RedBoot image appears to leave the first page of RAM -in a corrupt state such that certain words in that page are unwritable -and contain random data. The value of the data, and the location within -the first page changes with each boot, but is generally in the range -0xa0000150 to 0xa0000fff. - -You can grab the source from the ECOS CVS or you can get a prebuilt image -from: - - ftp://source.mvista.com/pub/xscale/iop310/IQ80310/redboot.bin - -which is: - - # strings redboot.bin | grep bootstrap - RedBoot(tm) bootstrap and debug environment, version UNKNOWN - built 14:58:21, Aug 15 2001 - -md5sum of this version: - - bcb96edbc6f8e55b16c165930b6e4439 redboot.bin - -You have two options to program it: - -1. Using the FRU program (see the instructions in the user manual). - -2. Using a Linux host, with MTD support built into the host kernel: - - ensure that the RedBoot image is not locked (issue the following - command under the existing RedBoot image): - RedBoot> fis unlock -f 0 -l 0x40000 - - switch S3-1 and S3-2 on. - - reboot the host - - login as root - - identify the 80310 card: - # lspci - ... - 00:0c.1 Memory controller: Intel Corporation 80310 IOP [IO Processor] (rev 01) - - in this example, bus 0, slot 0c, function 1. - - insert the MTD modules, and the PCI map module: - # insmod drivers/mtd/maps/pci.o - - locate the MTD device (using the bus, slot, function) - # cat /proc/mtd - dev: size erasesize name - mtd0: 00800000 00020000 "00:0c.1" - - in this example, it is mtd device 0. Yours will be different. - Check carefully. - - program the flash - # cat redboot.bin > /dev/mtdblock0 - - check the kernel message log for errors (some cat commands don't - error on failure) - # dmesg - - switch S3-1 and S3-2 off - - reboot host - -In any case, make sure you do an 'fis init' command once you boot with the new -RedBoot image. - - - -Downloading Linux ------------------------------ - -Assuming you have your development system setup to act as a bootp/dhcp -server and running tftp: - - RedBoot> load -r -b 0xa1008000 /tftpboot/zImage.xs - Raw file loaded 0xa1008000-0xa1094bd8 - -If you're not using dhcp/tftp, you can use y-modem instead: - - RedBoot> load -r -b 0xa1008000 -m y - -Note that on Rev D. of the board, tftp does not work due to intermittent -interrupt issues, so you need to download using ymodem. - -Once the download is completed: - - RedBoot> go 0xa1008000 - -Root Devices ------------------------------ - -A kernel is not useful without a root filesystem, and you have several -choices with this board: NFS root, RAMDISK, or JFFS/JFFS2. For development -purposes, it is suggested that you use NFS root for easy access to various -tools. Once you're ready to deploy, probably want to utilize JFFS/JFFS2 on -the flash device. - -MTD on the IQ80310 ------------------------------ - -Linux on the IQ80310 supports RedBoot FIS paritioning if it is enabled. -Out of the box, once you've done 'fis init' on RedBoot, you will get -the following partitioning scheme: - - root@192.168.0.14:~# cat /proc/mtd - dev: size erasesize name - mtd0: 00040000 00020000 "RedBoot" - mtd1: 00040000 00020000 "RedBoot[backup]" - mtd2: 0075f000 00020000 "unallocated space" - mtd3: 00001000 00020000 "RedBoot config" - mtd4: 00020000 00020000 "FIS directory" - -To create an FIS directory, you need to use the fis command in RedBoot. -As an example, you can burn the kernel into the flash once it's downloaded: - - RedBoot> fis create -b 0xa1008000 -l 0x8CBAC -r 0xa1008000 -f 0x80000 kernel - ... Erase from 0x00080000-0x00120000: ..... - ... Program from 0xa1008000-0xa1094bac at 0x00080000: ..... - ... Unlock from 0x007e0000-0x00800000: . - ... Erase from 0x007e0000-0x00800000: . - ... Program from 0xa1fdf000-0xa1fff000 at 0x007e0000: . - ... Lock from 0x007e0000-0x00800000: . - - RedBoot> fis list - Name FLASH addr Mem addr Length Entry point - RedBoot 0x00000000 0x00000000 0x00040000 0x00000000 - RedBoot[backup] 0x00040000 0x00040000 0x00040000 0x00000000 - RedBoot config 0x007DF000 0x007DF000 0x00001000 0x00000000 - FIS directory 0x007E0000 0x007E0000 0x00020000 0x00000000 - kernel 0x00080000 0xA1008000 0x000A0000 0x00000000 - -This leads to the following Linux MTD setup: - - mtroot@192.168.0.14:~# cat /proc/mtd - dev: size erasesize name - mtd0: 00040000 00020000 "RedBoot" - mtd1: 00040000 00020000 "RedBoot[backup]" - mtd2: 000a0000 00020000 "kernel" - mtd3: 006bf000 00020000 "unallocated space" - mtd4: 00001000 00020000 "RedBoot config" - mtd5: 00020000 00020000 "FIS directory" - -Note that there is not a 1:1 mapping to the number of RedBoot paritions to -MTD partitions as unused space also gets allocated into MTD partitions. - -As an aside, the -r option when creating the Kernel entry allows you to -simply do an 'fis load kernel' to copy the image from flash into memory. -You can then do an 'fis go 0xa1008000' to start Linux. - -If you choose to use static partitioning instead of the RedBoot partioning: - - /dev/mtd0 0x00000000 - 0x0007ffff: Boot Monitor (512k) - /dev/mtd1 0x00080000 - 0x0011ffff: Kernel Image (640K) - /dev/mtd2 0x00120000 - 0x0071ffff: File System (6M) - /dev/mtd3 0x00720000 - 0x00800000: RedBoot Reserved (896K) - -To use a JFFS1/2 root FS, you need to donwload the JFFS image using either -tftp or ymodem, and then copy it to flash: - - RedBoot> load -r -b 0xa1000000 /tftpboot/jffs.img - Raw file loaded 0xa1000000-0xa1600000 - RedBoot> fis create -b 0xa1000000 -l 0x600000 -f 0x120000 jffs - ... Erase from 0x00120000-0x00720000: .................................. - ... Program from 0xa1000000-0xa1600000 at 0x00120000: .................. - ...................... - ... Unlock from 0x007e0000-0x00800000: . - ... Erase from 0x007e0000-0x00800000: . - ... Program from 0xa1fdf000-0xa1fff000 at 0x007e0000: . - ... Lock from 0x007e0000-0x00800000: . - RedBoot> fis list - Name FLASH addr Mem addr Length Entry point - RedBoot 0x00000000 0x00000000 0x00040000 0x00000000 - RedBoot[backup] 0x00040000 0x00040000 0x00040000 0x00000000 - RedBoot config 0x007DF000 0x007DF000 0x00001000 0x00000000 - FIS directory 0x007E0000 0x007E0000 0x00020000 0x00000000 - kernel 0x00080000 0xA1008000 0x000A0000 0xA1008000 - jffs 0x00120000 0x00120000 0x00600000 0x00000000 - -This looks like this in Linux: - - root@192.168.0.14:~# cat /proc/mtd - dev: size erasesize name - mtd0: 00040000 00020000 "RedBoot" - mtd1: 00040000 00020000 "RedBoot[backup]" - mtd2: 000a0000 00020000 "kernel" - mtd3: 00600000 00020000 "jffs" - mtd4: 000bf000 00020000 "unallocated space" - mtd5: 00001000 00020000 "RedBoot config" - mtd6: 00020000 00020000 "FIS directory" - -You need to boot the kernel once and watch the boot messages to see how the -JFFS RedBoot partition mapped into the MTD partition scheme. - -You can grab a pre-built JFFS image to use as a root file system at: - - ftp://source.mvista.com/pub/xscale/iop310/IQ80310/jffs.img - -For detailed info on using MTD and creating a JFFS image go to: - - http://www.linux-mtd.infradead.org. - -For details on using RedBoot's FIS commands, type 'fis help' or consult -your RedBoot manual. - -Contributors ------------------------------ - -Thanks to Intel Corporation for providing the hardware. - -John Clark - Initial discovery of RedBoot issues -Dave Jiang - IRQ demux fixes, AAU, DMA, MU -Nicolas Pitre - Initial port, cleanup, debugging -Matt Porter - PCI subsystem development, debugging -Tim Sanders - Initial PCI code -Mark Salter - RedBoot fixes -Deepak Saxena - Cleanup, debug, cache lock, PMU - ------------------------------ -Enjoy. - -If you have any problems please contact Deepak Saxena - -A few notes from rmk ------------------------------ - -These are notes of my initial experience getting the IQ80310 Rev D up and -running. In total, it has taken many hours to work out what's going on... -The version of redboot used is: - - RedBoot(tm) bootstrap and debug environment, version UNKNOWN - built 14:58:21, Aug 15 2001 - - -1. I've had a corrupted download of the redboot.bin file from Montavista's - FTP site. It would be a good idea if there were md5sums, sum or gpg - signatures available to ensure the integrity of the downloaded files. - The result of this was an apparantly 100% dead card. - -2. RedBoot Intel EtherExpress Pro 100 driver seems to be very unstable - - I've had it take out the whole of a 100mbit network for several minutes. - The Hub indiates ZERO activity, despite machines attempting to communicate. - Further to this, while tftping the kernel, the transfer will stall regularly, - and might even drop the link LED. - -3. There appears to be a bug in the Intel Documentation Pack that comes with - the IQ80310 board. Serial port 1, which is the socket next to the LEDs - is address 0xfe810000, not 0xfe800000. - - Note that RedBoot uses either serial port 1 OR serial port 2, so if you - have your console connected to the wrong port, you'll see redboot messages - but not kernel boot messages. - -4. Trying to use fconfig to setup a boot script fails - it hangs when trying - to erase the flash. diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/IQ80310 linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/IQ80310 --- linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/IQ80310 Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/IQ80310 Mon Mar 31 12:18:08 2003 @@ -0,0 +1,248 @@ + +Board Overview +----------------------------- + +The Cyclone IQ80310 board is an evaluation platform for Intel's 80200 Xscale +CPU and 80312 Intelligent I/O chipset (collectively called IOP310 chipset). + +The 80312 contains dual PCI hoses (called the ATUs), a PCI-to-PCI bridge, +three DMA channels (1 on secondary PCI, one on primary PCI ), I2C, I2O +messaging unit, XOR unit for RAID operations, a bus performance monitoring +unit, and a memory controller with ECC features. + +For more information on the board, see http://developer.intel.com/iio + +Port Status +----------------------------- + +Supported: + +- MTD/JFFS/JFFS2 +- NFS root +- RAMDISK root +- 2ndary PCI slots +- Onboard ethernet +- Serial ports (ttyS0/S1) +- Cache/TLB locking on 80200 CPU +- Performance monitoring unit on 80200 CPU +- 80200 Performance Monitoring Unit +- Acting as a system controller on Cyclone 80303BP PCI backplane +- DMA engines (EXPERIMENTAL) +- 80312 Bus Performance Monitor (EXPERIMENTAL) +- Application Accelerator Unit (XOR engine for RAID) (EXPERIMENTAL) +- Messaging Unit (EXPERIMENTAL) + +TODO: +- I2C + +Building the Kernel +----------------------------- +make iq80310_config +make oldconfig +make dep +make zImage + +This will build an image setup for BOOTP/NFS root support. To change this, +just run make menuconfig and disable nfs root or add a "root=" option. + +Preparing the Hardware +----------------------------- + +This document assumes you're using a Rev D or newer board running +Redboot as the bootloader. Note that the version of RedBoot provided +with the boards has a major issue and you need to replace it with the +latest RedBoot. You can grab the source from the ECOS CVS or you can +get a prebuilt image and burn it in using FRU at: + + ftp://source.mvista.com/pub/xscale/iq80310/redboot.bin + +Make sure you do an 'fis init' command once you boot with the new +RedBoot image. + + + +Downloading Linux +----------------------------- + +Assuming you have your development system setup to act as a bootp/dhcp +server and running tftp: + + RedBoot> load -r -b 0xa1008000 /tftpboot/zImage.xs + Raw file loaded 0xa1008000-0xa1094bd8 + +If you're not using dhcp/tftp, you can use y-modem instead: + + RedBoot> load -r -b 0xa1008000 -m y + +Note that on Rev D. of the board, tftp does not work due to intermittent +interrupt issues, so you need to download using ymodem. + +Once the download is completed: + + RedBoot> go 0xa1008000 + +Root Devices +----------------------------- + +A kernel is not useful without a root filesystem, and you have several +choices with this board: NFS root, RAMDISK, or JFFS/JFFS2. For development +purposes, it is suggested that you use NFS root for easy access to various +tools. Once you're ready to deploy, probably want to utilize JFFS/JFFS2 on +the flash device. + +MTD on the IQ80310 +----------------------------- + +Linux on the IQ80310 supports RedBoot FIS paritioning if it is enabled. +Out of the box, once you've done 'fis init' on RedBoot, you will get +the following partitioning scheme: + + root@192.168.0.14:~# cat /proc/mtd + dev: size erasesize name + mtd0: 00040000 00020000 "RedBoot" + mtd1: 00040000 00020000 "RedBoot[backup]" + mtd2: 0075f000 00020000 "unallocated space" + mtd3: 00001000 00020000 "RedBoot config" + mtd4: 00020000 00020000 "FIS directory" + +To create an FIS directory, you need to use the fis command in RedBoot. +As an example, you can burn the kernel into the flash once it's downloaded: + + RedBoot> fis create -b 0xa1008000 -l 0x8CBAC -r 0xa1008000 -f 0x80000 kernel + ... Erase from 0x00080000-0x00120000: ..... + ... Program from 0xa1008000-0xa1094bac at 0x00080000: ..... + ... Unlock from 0x007e0000-0x00800000: . + ... Erase from 0x007e0000-0x00800000: . + ... Program from 0xa1fdf000-0xa1fff000 at 0x007e0000: . + ... Lock from 0x007e0000-0x00800000: . + + RedBoot> fis list + Name FLASH addr Mem addr Length Entry point + RedBoot 0x00000000 0x00000000 0x00040000 0x00000000 + RedBoot[backup] 0x00040000 0x00040000 0x00040000 0x00000000 + RedBoot config 0x007DF000 0x007DF000 0x00001000 0x00000000 + FIS directory 0x007E0000 0x007E0000 0x00020000 0x00000000 + kernel 0x00080000 0xA1008000 0x000A0000 0x00000000 + +This leads to the following Linux MTD setup: + + mtroot@192.168.0.14:~# cat /proc/mtd + dev: size erasesize name + mtd0: 00040000 00020000 "RedBoot" + mtd1: 00040000 00020000 "RedBoot[backup]" + mtd2: 000a0000 00020000 "kernel" + mtd3: 006bf000 00020000 "unallocated space" + mtd4: 00001000 00020000 "RedBoot config" + mtd5: 00020000 00020000 "FIS directory" + +Note that there is not a 1:1 mapping to the number of RedBoot paritions to +MTD partitions as unused space also gets allocated into MTD partitions. + +As an aside, the -r option when creating the Kernel entry allows you to +simply do an 'fis load kernel' to copy the image from flash into memory. +You can then do an 'fis go 0xa1008000' to start Linux. + +If you choose to use static partitioning instead of the RedBoot partioning: + + /dev/mtd0 0x00000000 - 0x0007ffff: Boot Monitor (512k) + /dev/mtd1 0x00080000 - 0x0011ffff: Kernel Image (640K) + /dev/mtd2 0x00120000 - 0x0071ffff: File System (6M) + /dev/mtd3 0x00720000 - 0x00800000: RedBoot Reserved (896K) + +To use a JFFS1/2 root FS, you need to donwload the JFFS image using either +tftp or ymodem, and then copy it to flash: + + RedBoot> load -r -b 0xa1000000 /tftpboot/jffs.img + Raw file loaded 0xa1000000-0xa1600000 + RedBoot> fis create -b 0xa1000000 -l 0x600000 -f 0x120000 jffs + ... Erase from 0x00120000-0x00720000: .................................. + ... Program from 0xa1000000-0xa1600000 at 0x00120000: .................. + ...................... + ... Unlock from 0x007e0000-0x00800000: . + ... Erase from 0x007e0000-0x00800000: . + ... Program from 0xa1fdf000-0xa1fff000 at 0x007e0000: . + ... Lock from 0x007e0000-0x00800000: . + RedBoot> fis list + Name FLASH addr Mem addr Length Entry point + RedBoot 0x00000000 0x00000000 0x00040000 0x00000000 + RedBoot[backup] 0x00040000 0x00040000 0x00040000 0x00000000 + RedBoot config 0x007DF000 0x007DF000 0x00001000 0x00000000 + FIS directory 0x007E0000 0x007E0000 0x00020000 0x00000000 + kernel 0x00080000 0xA1008000 0x000A0000 0xA1008000 + jffs 0x00120000 0x00120000 0x00600000 0x00000000 + +This looks like this in Linux: + + root@192.168.0.14:~# cat /proc/mtd + dev: size erasesize name + mtd0: 00040000 00020000 "RedBoot" + mtd1: 00040000 00020000 "RedBoot[backup]" + mtd2: 000a0000 00020000 "kernel" + mtd3: 00600000 00020000 "jffs" + mtd4: 000bf000 00020000 "unallocated space" + mtd5: 00001000 00020000 "RedBoot config" + mtd6: 00020000 00020000 "FIS directory" + +You need to boot the kernel once and watch the boot messages to see how the +JFFS RedBoot partition mapped into the MTD partition scheme. + +You can grab a pre-built JFFS image to use as a root file system at: + + ftp://source.mvista.com/pub/xscale/iq80310/jffs.img + +For detailed info on using MTD and creating a JFFS image go to: + + http://www.linux-mtd.infradead.org. + +For details on using RedBoot's FIS commands, type 'fis help' or consult +your RedBoot manual. + +Contributors +----------------------------- + +Thanks to Intel Corporation for providing the hardware. + +John Clark - Initial discovery of RedBoot issues +Dave Jiang - IRQ demux fixes, AAU, DMA, MU +Nicolas Pitre - Initial port, cleanup, debugging +Matt Porter - PCI subsystem development, debugging +Tim Sanders - Initial PCI code +Mark Salter - RedBoot fixes +Deepak Saxena - Cleanup, debug, cache lock, PMU + +----------------------------- +Enjoy. + +If you have any problems please contact Deepak Saxena + +A few notes from rmk +----------------------------- + +These are notes of my initial experience getting the IQ80310 Rev D up and +running. In total, it has taken many hours to work out what's going on... +The version of redboot used is: + + RedBoot(tm) bootstrap and debug environment, version UNKNOWN - built 14:58:21, Aug 15 2001 + + +1. I've had a corrupted download of the redboot.bin file from Montavista's + FTP site. It would be a good idea if there were md5sums, sum or gpg + signatures available to ensure the integrity of the downloaded files. + The result of this was an apparantly 100% dead card. + +2. RedBoot Intel EtherExpress Pro 100 driver seems to be very unstable - + I've had it take out the whole of a 100mbit network for several minutes. + The Hub indiates ZERO activity, despite machines attempting to communicate. + Further to this, while tftping the kernel, the transfer will stall regularly, + and might even drop the link LED. + +3. There appears to be a bug in the Intel Documentation Pack that comes with + the IQ80310 board. Serial port 1, which is the socket next to the LEDs + is address 0xfe810000, not 0xfe800000. + + Note that RedBoot uses either serial port 1 OR serial port 2, so if you + have your console connected to the wrong port, you'll see redboot messages + but not kernel boot messages. + +4. Trying to use fconfig to setup a boot script fails - it hangs when trying + to erase the flash. diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/IQ80321 linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/IQ80321 --- linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/IQ80321 Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/IQ80321 Mon Mar 31 12:18:08 2003 @@ -0,0 +1,216 @@ + +Board Overview +----------------------------- + +The Worcester IQ80321 board is an evaluation platform for Intel's 80321 Xscale +CPU (sometimes called IOP321 chipset). + +The 80321 contains a single PCI hose (called the ATUs), a PCI-to-PCI bridge, +two DMA channels, I2C, I2O messaging unit, XOR unit for RAID operations, +a bus performance monitoring unit, and a memory controller with ECC features. + +For more information on the board, see http://developer.intel.com/iio + +Port Status +----------------------------- + +Supported: + +- MTD/JFFS/JFFS2 root +- NFS root +- RAMDISK root +- Serial port (ttyS0) +- Cache/TLB locking on 80321 CPU +- Performance monitoring unit on 80321 CPU + +TODO: + +- DMA engines +- I2C +- 80321 Bus Performance Monitor +- Application Accelerator Unit (XOR engine for RAID) +- I2O Messaging Unit +- I2C unit +- SSP + +Building the Kernel +----------------------------- +make iq80321_config +make oldconfig +make dep +make zImage + +This will build an image setup for BOOTP/NFS root support. To change this, +just run make menuconfig and disable nfs root or add a "root=" option. + +Preparing the Hardware +----------------------------- + +Make sure you do an 'fis init' command once you boot with the new +RedBoot image. + +Downloading Linux +----------------------------- + +Assuming you have your development system setup to act as a bootp/dhcp +server and running tftp: + +NOTE: The 80321 board uses a different default memory map than the 80310. + + RedBoot> load -r -b 0x01008000 -m y + +Once the download is completed: + + RedBoot> go 0x01008000 + +There is a version of RedBoot floating around that has DHCP support, but +I've never been able to cleanly transfer a kernel image and have it run. + +Root Devices +----------------------------- + +A kernel is not useful without a root filesystem, and you have several +choices with this board: NFS root, RAMDISK, or JFFS/JFFS2. For development +purposes, it is suggested that you use NFS root for easy access to various +tools. Once you're ready to deploy, probably want to utilize JFFS/JFFS2 on +the flash device. + +MTD on the IQ80321 +----------------------------- + +Linux on the IQ80321 supports RedBoot FIS paritioning if it is enabled. +Out of the box, once you've done 'fis init' on RedBoot, you will get +the following partitioning scheme: + + root@192.168.0.14:~# cat /proc/mtd + dev: size erasesize name + mtd0: 00040000 00020000 "RedBoot" + mtd1: 00040000 00020000 "RedBoot[backup]" + mtd2: 0075f000 00020000 "unallocated space" + mtd3: 00001000 00020000 "RedBoot config" + mtd4: 00020000 00020000 "FIS directory" + +To create an FIS directory, you need to use the fis command in RedBoot. +As an example, you can burn the kernel into the flash once it's downloaded: + + RedBoot> fis create -b 0x01008000 -l 0x8CBAC -r 0x01008000 -f 0x80000 kernel + ... Erase from 0x00080000-0x00120000: ..... + ... Program from 0x01008000-0x01094bac at 0x00080000: ..... + ... Unlock from 0x007e0000-0x00800000: . + ... Erase from 0x007e0000-0x00800000: . + ... Program from 0x01fdf000-0x01fff000 at 0x007e0000: . + ... Lock from 0x007e0000-0x00800000: . + + RedBoot> fis list + Name FLASH addr Mem addr Length Entry point + RedBoot 0x00000000 0x00000000 0x00040000 0x00000000 + RedBoot[backup] 0x00040000 0x00040000 0x00040000 0x00000000 + RedBoot config 0x007DF000 0x007DF000 0x00001000 0x00000000 + FIS directory 0x007E0000 0x007E0000 0x00020000 0x00000000 + kernel 0x00080000 0x01008000 0x000A0000 0x00000000 + +This leads to the following Linux MTD setup: + + mtroot@192.168.0.14:~# cat /proc/mtd + dev: size erasesize name + mtd0: 00040000 00020000 "RedBoot" + mtd1: 00040000 00020000 "RedBoot[backup]" + mtd2: 000a0000 00020000 "kernel" + mtd3: 006bf000 00020000 "unallocated space" + mtd4: 00001000 00020000 "RedBoot config" + mtd5: 00020000 00020000 "FIS directory" + +Note that there is not a 1:1 mapping to the number of RedBoot paritions to +MTD partitions as unused space also gets allocated into MTD partitions. + +As an aside, the -r option when creating the Kernel entry allows you to +simply do an 'fis load kernel' to copy the image from flash into memory. +You can then do an 'fis go 0x01008000' to start Linux. + +If you choose to use static partitioning instead of the RedBoot partioning: + + /dev/mtd0 0x00000000 - 0x0007ffff: Boot Monitor (512k) + /dev/mtd1 0x00080000 - 0x0011ffff: Kernel Image (640K) + /dev/mtd2 0x00120000 - 0x0071ffff: File System (6M) + /dev/mtd3 0x00720000 - 0x00800000: RedBoot Reserved (896K) + +To use a JFFS1/2 root FS, you need to donwload the JFFS image using either +tftp or ymodem, and then copy it to flash: + + RedBoot> load -r -b 0x01000000 /tftpboot/jffs.img + Raw file loaded 0x01000000-0x01600000 + RedBoot> fis create -b 0x01000000 -l 0x600000 -f 0x120000 jffs + ... Erase from 0x00120000-0x00720000: .................................. + ... Program from 0x01000000-0x01600000 at 0x00120000: .................. + ...................... + ... Unlock from 0x007e0000-0x00800000: . + ... Erase from 0x007e0000-0x00800000: . + ... Program from 0x01fdf000-0x01fff000 at 0x007e0000: . + ... Lock from 0x007e0000-0x00800000: . + RedBoot> fis list + Name FLASH addr Mem addr Length Entry point + RedBoot 0x00000000 0x00000000 0x00040000 0x00000000 + RedBoot[backup] 0x00040000 0x00040000 0x00040000 0x00000000 + RedBoot config 0x007DF000 0x007DF000 0x00001000 0x00000000 + FIS directory 0x007E0000 0x007E0000 0x00020000 0x00000000 + kernel 0x00080000 0x01008000 0x000A0000 0x01008000 + jffs 0x00120000 0x00120000 0x00600000 0x00000000 + +This looks like this in Linux: + + root@192.168.0.14:~# cat /proc/mtd + dev: size erasesize name + mtd0: 00040000 00020000 "RedBoot" + mtd1: 00040000 00020000 "RedBoot[backup]" + mtd2: 000a0000 00020000 "kernel" + mtd3: 00600000 00020000 "jffs" + mtd4: 000bf000 00020000 "unallocated space" + mtd5: 00001000 00020000 "RedBoot config" + mtd6: 00020000 00020000 "FIS directory" + +You need to boot the kernel once and watch the boot messages to see how the +JFFS RedBoot partition mapped into the MTD partition scheme. + +You can grab a pre-built JFFS image to use as a root file system at: + + ftp://source.mvista.com/pub/xscale/iq80310/jffs.img + +For detailed info on using MTD and creating a JFFS image go to: + + http://www.linux-mtd.infradead.org. + +For details on using RedBoot's FIS commands, type 'fis help' or consult +your RedBoot manual. + +BUGS and ISSUES +----------------------------- + +* As shipped from Intel, pre-production boards have two issues: + +- The on board ethernet is disabled S8E1-2 is off. You will need to turn it on. + +- The PCIXCAPs are configured for a 100Mhz clock, but the clock selected is + actually only 66Mhz. This causes the wrong PPL multiplier to be used and the + board only runs at 400Mhz instead of 600Mhz. The way to observe this is to + use a independent clock to time a "sleep 10" command from the prompt. If it + takes 15 seconds instead of 10, you are running at 400Mhz. + +- The experimental IOP310 drivers for the AAU, DMA, etc. are not supported yet. + +Contributors +----------------------------- +The port to the IQ80321 was performed by: + +Rory Bolt - Initial port, debugging. + +This port was based on the IQ80310 port with the following contributors: + +Nicolas Pitre - Initial port, cleanup, debugging +Matt Porter - PCI subsystem development, debugging +Tim Sanders - Initial PCI code +Deepak Saxena - Cleanup, debug, cache lock, PMU + +The port is currently maintained by Deepak Saxena + +----------------------------- +Enjoy. diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/aau.txt linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/aau.txt --- linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/aau.txt Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/aau.txt Mon Mar 31 12:18:08 2003 @@ -0,0 +1,178 @@ +Support functions for the Intel 80310 AAU +=========================================== + +Dave Jiang +Last updated: 09/18/2001 + +The Intel 80312 companion chip in the 80310 chipset contains an AAU. The +AAU is capable of processing up to 8 data block sources and perform XOR +operations on them. This unit is typically used to accelerated XOR +operations utilized by RAID storage device drivers such as RAID 5. This +API is designed to provide a set of functions to take adventage of the +AAU. The AAU can also be used to transfer data blocks and used as a memory +copier. The AAU transfer the memory faster than the operation performed by +using CPU copy therefore it is recommended to use the AAU for memory copy. + +------------------ +int aau_request(u32 *aau_context, const char *device_id); +This function allows the user the acquire the control of the the AAU. The +function will return a context of AAU to the user and allocate +an interrupt for the AAU. The user must pass the context as a parameter to +various AAU API calls. + +int aau_queue_buffer(u32 aau_context, aau_head_t *listhead); +This function starts the AAU operation. The user must create a SGL +header with a SGL attached. The format is presented below. The SGL is +built from kernel memory. + +/* hardware descriptor */ +typedef struct _aau_desc +{ + u32 NDA; /* next descriptor address [READONLY] */ + u32 SAR[AAU_SAR_GROUP]; /* src addrs */ + u32 DAR; /* destination addr */ + u32 BC; /* byte count */ + u32 DC; /* descriptor control */ + u32 SARE[AAU_SAR_GROUP]; /* extended src addrs */ +} aau_desc_t; + +/* user SGL format */ +typedef struct _aau_sgl +{ + aau_desc_t aau_desc; /* AAU HW Desc */ + u32 status; /* status of SGL [READONLY] */ + struct _aau_sgl *next; /* pointer to next SG [READONLY] */ + void *dest; /* destination addr */ + void *src[AAU_SAR_GROUP]; /* source addr[4] */ + void *ext_src[AAU_SAR_GROUP]; /* ext src addr[4] */ + u32 total_src; /* total number of source */ +} aau_sgl_t; + +/* header for user SGL */ +typedef struct _aau_head +{ + u32 total; /* total descriptors allocated */ + u32 status; /* SGL status */ + aau_sgl_t *list; /* ptr to head of list */ + aau_callback_t callback; /* callback func ptr */ +} aau_head_t; + + +The function will call aau_start() and start the AAU after it queues +the SGL to the processing queue. When the function will either +a. Sleep on the wait queue aau->wait_q if no callback has been provided, or +b. Continue and then call the provided callback function when DMA interrupt + has been triggered. + +int aau_suspend(u32 aau_context); +Stops/Suspends the AAU operation + +int aau_free(u32 aau_context); +Frees the ownership of AAU. Called when no longer need AAU service. + +aau_sgl_t * aau_get_buffer(u32 aau_context, int num_buf); +This function obtains an AAU SGL for the user. User must specify the number +of descriptors to be allocated in the chain that is returned. + +void aau_return_buffer(u32 aau_context, aau_sgl_t *list); +This function returns all SGL back to the API after user is done. + +int aau_memcpy(void *dest, void *src, u32 size); +This function is a short cut for user to do memory copy utilizing the AAU for +better large block memory copy vs using the CPU. This is similar to using +typical memcpy() call. + +* User is responsible for the source address(es) and the destination address. + The source and destination should all be cached memory. + + + +void aau_test() +{ + u32 aau; + char dev_id[] = "AAU"; + int size = 2; + int err = 0; + aau_head_t *head; + aau_sgl_t *list; + u32 i; + u32 result = 0; + void *src, *dest; + + printk("Starting AAU test\n"); + if((err = aau_request(&aau, dev_id))<0) + { + printk("test - AAU request failed: %d\n", err); + return; + } + else + { + printk("test - AAU request successful\n"); + } + + head = kmalloc(sizeof(aau_head_t), GFP_KERNEL); + head->total = size; + head->status = 0; + head->callback = NULL; + + list = aau_get_buffer(aau, size); + if(!list) + { + printk("Can't get buffers\n"); + return; + } + head->list = list; + + src = kmalloc(1024, GFP_KERNEL); + dest = kmalloc(1024, GFP_KERNEL); + + while(list) + { + list->status = 0; + list->aau_desc->SAR[0] = (u32)src; + list->aau_desc->DAR = (u32)dest; + list->aau_desc->BC = 1024; + + /* see iop310-aau.h for more DCR commands */ + list->aau_desc->DC = AAU_DCR_WRITE | AAU_DCR_BLKCTRL_1_DF; + if(!list->next) + { + list->aau_desc->DC = AAU_DCR_IE; + break; + } + list = list->next; + } + + printk("test- Queueing buffer for AAU operation\n"); + err = aau_queue_buffer(aau, head); + if(err >= 0) + { + printk("AAU Queue Buffer is done...\n"); + } + else + { + printk("AAU Queue Buffer failed...: %d\n", err); + } + + + +#if 1 + printk("freeing the AAU\n"); + aau_return_buffer(aau, head->list); + aau_free(aau); + kfree(src); + kfree(dest); + kfree((void *)head); +#endif +} + +All Disclaimers apply. Use this at your own discretion. Neither Intel nor I +will be responsible if anything goes wrong. =) + + +TODO +____ +* Testing +* Do zero-size AAU transfer/channel at init + so all we have to do is chainining + diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/dma.txt linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/dma.txt --- linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/dma.txt Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/dma.txt Mon Mar 31 12:18:08 2003 @@ -0,0 +1,214 @@ +Support functions forthe Intel 80310 DMA channels +================================================== + +Dave Jiang +Last updated: 09/18/2001 + +The Intel 80310 XScale chipset provides 3 DMA channels via the 80312 I/O +companion chip. Two of them resides on the primary PCI bus and one on the +secondary PCI bus. + +The DMA API provided is not compatible with the generic interface in the +ARM tree unfortunately due to how the 80312 DMACs work. Hopefully some time +in the near future a software interface can be done to bridge the differences. +The DMA API has been modeled after Nicholas Pitre's SA11x0 DMA API therefore +they will look somewhat similar. + + +80310 DMA API +------------- + +int dma_request(dmach_t channel, const char *device_id); + +This function will attempt to allocate the channel depending on what the +user requests: + +IOP310_DMA_P0: PCI Primary 1 +IOP310_DMA_P1: PCI Primary 2 +IOP310_DMA_S0: PCI Secondary 1 +/*EOF*/ + +Once the user allocates the DMA channel it is owned until released. Although +other users can also use the same DMA channel, but no new resources will be +allocated. The function will return the allocated channel number if successful. + +int dma_queue_buffer(dmach_t channel, dma_sghead_t *listhead); + +The user will construct a SGL in the form of below: +/* + * Scattered Gather DMA List for user + */ +typedef struct _dma_desc +{ + u32 NDAR; /* next descriptor adress [READONLY] */ + u32 PDAR; /* PCI address */ + u32 PUADR; /* upper PCI address */ + u32 LADR; /* local address */ + u32 BC; /* byte count */ + u32 DC; /* descriptor control */ +} dma_desc_t; + +typedef struct _dma_sgl +{ + dma_desc_t dma_desc; /* DMA descriptor */ + u32 status; /* descriptor status [READONLY] */ + u32 data; /* user defined data */ + struct _dma_sgl *next; /* next descriptor [READONLY] */ +} dma_sgl_t; + +/* dma sgl head */ +typedef struct _dma_head +{ + u32 total; /* total elements in SGL */ + u32 status; /* status of sgl */ + u32 mode; /* read or write mode */ + dma_sgl_t *list; /* pointer to list */ + dma_callback_t callback; /* callback function */ +} dma_head_t; + + +The user shall allocate user SGL elements by calling the function: +dma_get_buffer(). This function will give the user an SGL element. The user +is responsible for creating the SGL head however. The user is also +responsible for allocating the memory for DMA data. The following code segment +shows how a DMA operation can be performed: + +#include + +void dma_test(void) +{ + char dev_id[] = "Primary 0"; + dma_head_t *sgl_head = NULL; + dma_sgl_t *sgl = NULL; + int err = 0; + int channel = -1; + u32 *test_ptr = 0; + DECLARE_WAIT_QUEUE_HEAD(wait_q); + + + *(IOP310_ATUCR) = (IOP310_ATUCR_PRIM_OUT_ENAB | + IOP310_ATUCR_DIR_ADDR_ENAB); + + channel = dma_request(IOP310_DMA_P0, dev_id); + + sgl_head = (dma_head_t *)kmalloc(sizeof(dma_head_t), GFP_KERNEL); + sgl_head->callback = NULL; /* no callback created */ + sgl_head->total = 2; /* allocating 2 DMA descriptors */ + sgl_head->mode = (DMA_MOD_WRITE); + sgl_head->status = 0; + + /* now we get the two descriptors */ + sgl = dma_get_buffer(channel, 2); + + /* we set the header to point to the list we allocated */ + sgl_head->list = sgl; + + /* allocate 1k of DMA data */ + sgl->data = (u32)kmalloc(1024, GFP_KERNEL); + + /* Local address is physical */ + sgl->dma_desc.LADR = (u32)virt_to_phys(sgl->data); + + /* write to arbitrary location over the PCI bus */ + sgl->dma_desc.PDAR = 0x00600000; + sgl->dma_desc.PUADR = 0; + sgl->dma_desc.BC = 1024; + + /* set write & invalidate PCI command */ + sgl->dma_desc.DC = DMA_DCR_PCI_MWI; + sgl->status = 0; + + /* set a pattern */ + memset(sgl->data, 0xFF, 1024); + + /* User's responsibility to keep buffers cached coherent */ + cpu_dcache_clean(sgl->data, sgl->data + 1024); + + sgl = sgl->next; + + sgl->data = (u32)kmalloc(1024, GFP_KERNEL); + sgl->dma_desc.LADR = (u32)virt_to_phys(sgl->data); + sgl->dma_desc.PDAR = 0x00610000; + sgl->dma_desc.PUADR = 0; + sgl->dma_desc.BC = 1024; + + /* second descriptor has interrupt flag enabled */ + sgl->dma_desc.DC = (DMA_DCR_PCI_MWI | DMA_DCR_IE); + + /* must set end of chain flag */ + sgl->status = DMA_END_CHAIN; /* DO NOT FORGET THIS!!!! */ + + memset(sgl->data, 0x0f, 1024); + /* User's responsibility to keep buffers cached coherent */ + cpu_dcache_clean(sgl->data, sgl->data + 1024); + + /* queing the buffer, this function will sleep since no callback */ + err = dma_queue_buffer(channel, sgl_head); + + /* now we are woken from DMA complete */ + + /* do data operations here */ + + /* free DMA data if necessary */ + + /* return the descriptors */ + dma_return_buffer(channel, sgl_head->list); + + /* free the DMA */ + dma_free(channel); + + kfree((void *)sgl_head); +} + + +dma_sgl_t * dma_get_buffer(dmach_t channel, int buf_num); + +This call allocates DMA descriptors for the user. + + +void dma_return_buffer(dmach_t channel, dma_sgl_t *list); + +This call returns the allocated descriptors back to the API. + + +int dma_suspend(dmach_t channel); + +This call suspends any DMA transfer on the given channel. + + + +int dma_resume(dmach_t channel); + +This call resumes a DMA transfer which would have been stopped through +dma_suspend(). + + +int dma_flush_all(dmach_t channel); + +This completely flushes all queued buffers and on-going DMA transfers on a +given channel. This is called when DMA channel errors have occured. + + +void dma_free(dmach_t channel); + +This clears all activities on a given DMA channel and releases it for future +requests. + + + +Buffer Allocation +----------------- +It is the user's responsibility to allocate, free, and keep track of the +allocated DMA data memory. Upon calling dma_queue_buffer() the user must +relinquish the control of the buffers to the kernel and not change the +state of the buffers that it has passed to the kernel. The user will regain +the control of the buffers when it has been woken up by the bottom half of +the DMA interrupt handler. The user can allocate cached buffers or non-cached +via pci_alloc_consistent(). It is the user's responsibility to ensure that +the data is cache coherent. + +*Reminder* +The user is responsble to ensure the ATU is setup properly for DMA transfers. + +All Disclaimers apply. Use this at your own discretion. Neither Intel nor I +will be responsible ifanything goes wrong. diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/message.txt linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/message.txt --- linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/message.txt Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/message.txt Mon Mar 31 12:18:08 2003 @@ -0,0 +1,110 @@ +Support functions for the Intel 80310 MU +=========================================== + +Dave Jiang +Last updated: 10/11/2001 + +The messaging unit of the IOP310 contains 4 components and is utilized for +passing messages between the PCI agents on the primary bus and the Intel(R) +80200 CPU. The four components are: +Messaging Component +Doorbell Component +Circular Queues Component +Index Registers Component + +Messaging Component: +Contains 4 32bit registers, 2 in and 2 out. Writing to the registers assert +interrupt on the PCI bus or to the 80200 depend on incoming or outgoing. + +int mu_msg_request(u32 *mu_context); +Request the usage of Messaging Component. mu_context is written back by the +API. The MU context is passed to other Messaging calls as a parameter. + +int mu_msg_set_callback(u32 mu_context, u8 reg, mu_msg_cb_t func); +Setup the callback function for incoming messages. Callback can be setup for +outbound 0, 1, or both outbound registers. + +int mu_msg_post(u32 mu_context, u32 val, u8 reg); +Posting a message in the val parameter. The reg parameter denotes whether +to use register 0, 1. + +int mu_msg_free(u32 mu_context, u8 mode); +Free the usage of messaging component. mode can be specified soft or hard. In +hardmode all resources are unallocated. + +Doorbell Component: +The doorbell registers contains 1 inbound and 1 outbound. Depending on the bits +being set different interrupts are asserted. + +int mu_db_request(u32 *mu_context); +Request the usage of the doorbell register. + +int mu_db_set_callback(u32 mu_context, mu_db_cb_t func); +Setting up the inbound callback. + +void mu_db_ring(u32 mu_context, u32 mask); +Write to the outbound db register with mask. + +int mu_db_free(u32 mu_context); +Free the usage of doorbell component. + +Circular Queues Component: +The circular queue component has 4 circular queues. Inbound post, inbound free, +outbound post, outbound free. These queues are used to pass messages. + +int mu_cq_request(u32 *mu_context, u32 q_size); +Request the usage of the queue. See code comment header for q_size. It tells +the API how big of queues to setup. + +int mu_cq_inbound_init(u32 mu_context, mfa_list_t *list, u32 size, + mu_cq_cb_t func); +Init inbound queues. The user must provide a list of free message frames to +be put in inbound free queue and the callback function to handle the inbound +messages. + +int mu_cq_enable(u32 mu_context); +Enables the circular queues mechanism. Called once all the setup functions +are called. + +u32 mu_cq_get_frame(u32 mu_context); +Obtain the address of an outbound free frame for the user. + +int mu_cq_post_frame(u32 mu_context, u32 mfa); +The user can post the frame once getting the frame and put information in the +frame. + +int mu_cq_free(u32 mu_context); +Free the usage of circular queues mechanism. + +Index Registers Component: +The index register provides the mechanism to receive inbound messages. + +int mu_ir_request(u32 *mu_context); +Request of Index Register component usage. + +int mu_ir_set_callback(u32 mu_context, mu_ir_cb_t callback); +Setting up callback for inbound messages. The callback will receive the +value of the register that IAR offsets to. + +int mu_ir_free(u32 mu_context); +Free the usage of Index Registers component. + +void mu_set_irq_threshold(u32 mu_context, int thresh); +Setup the IRQ threshold before relinquish processing in IRQ space. Default +is set at 10 loops. + + +*NOTE: Example of host driver that utilize the MU can be found in the Linux I2O +driver. Specifically i2o_pci and some functions of i2o_core. The I2O driver +only utilize the circular queues mechanism. The other 3 components are simple +enough that they can be easily setup. The MU API provides no flow control for +the messaging mechanism. Flow control of the messaging needs to be established +by a higher layer of software on the IOP or the host driver. + +All Disclaimers apply. Use this at your own discretion. Neither Intel nor I +will be responsible if anything goes wrong. =) + + +TODO +____ + diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/pmon.txt linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/pmon.txt --- linux-2.5.63-bk3/Documentation/arm/XScale/IOP3XX/pmon.txt Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/IOP3XX/pmon.txt Mon Mar 31 12:18:08 2003 @@ -0,0 +1,71 @@ + +Intel's XScale Microarchitecture 80312 companion processor provides a +Performance Monitoring Unit (PMON) that can be utilized to provide +information that can be useful for fine tuning of code. This text +file describes the API that's been developed for use by Linux kernel +programmers. Note that to get the most usage out of the PMON, +I highly reccomend getting the XScale reference manual from Intel[1] +and looking at chapter 12. + +To use the PMON, you must #include in your +source file. + +Since there's only one PMON, only one user can currently use the PMON +at a given time. To claim the PMON for usage, call iop310_pmon_claim() which +returns an identifier. When you are done using the PMON, call +iop310_pmon_release() with the id you were given earlier. + +The PMON consists of 14 registers that can be used for performance measurements. +By combining different statistics, you can derive complex performance metrics. + +To start the PMON, just call iop310_pmon_start(mode). Mode tells the PMON what +statistics to capture and can each be one of: + + IOP310_PMU_MODE0 + Performance Monitoring Disabled + + IOP310_PMU_MODE1 + Primary PCI bus and internal agents (bridge, dma Ch0, dam Ch1, patu) + + IOP310_PMU_MODE2 + Secondary PCI bus and internal agents (bridge, dma Ch0, dam Ch1, patu) + + IOP310_PMU_MODE3 + Secondary PCI bus and internal agents (external masters 0..2 and Intel + 80312 I/O companion chip) + + IOP310_PMU_MODE4 + Secondary PCI bus and internal agents (external masters 3..5 and Intel + 80312 I/O companion chip) + + IOP310_PMU_MODE5 + Intel 80312 I/O companion chip internal bus, DMA Channels and Application + Accelerator + + IOP310_PMU_MODE6 + Intel 80312 I/O companion chip internal bus, PATU, SATU and Intel 80200 + processor + + IOP310_PMU_MODE7 + Intel 80312 I/O companion chip internal bus, Primary PCI bus, Secondary + PCI bus and Secondary PCI agents (external masters 0..5 & Intel 80312 I/O + companion chip) + +To get the results back, call iop310_pmon_stop(&results) where results is +defined as follows: + +typedef struct _iop310_pmon_result +{ + u32 timestamp; /* Global Time Stamp Register */ + u32 timestamp_overflow; /* Time Stamp overflow count */ + u32 event_count[14]; /* Programmable Event Counter + Registers 1-14 */ + u32 event_overflow[14]; /* Overflow counter for PECR1-14 */ +} iop310_pmon_res_t; + + +-- +This code is still under development, so please feel free to send patches, +questions, comments, etc to me. + +Deepak Saxena diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/cache-lock.txt linux-2.5.63-bk4/Documentation/arm/XScale/cache-lock.txt --- linux-2.5.63-bk3/Documentation/arm/XScale/cache-lock.txt Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/cache-lock.txt Mon Mar 31 12:18:08 2003 @@ -0,0 +1,123 @@ + +Intel's XScale Microarchitecture provides support for locking of data +and instructions into the appropriate caches. This file provides +an overview of the API that has been developed to take advantage of this +feature from kernel space. Note that there is NO support for user space +cache locking. + +For example usage of this code, grab: + + ftp://source.mvista.com/pub/xscale/cache-test.c + +If you have any questions, comments, patches, etc, please contact me. + +Deepak Saxena + +API DESCRIPTION + + +I. Header File + + #include + +II. Cache Capability Discovery + + SYNOPSIS + + int cache_query(u8 cache_type, + struct cache_capabilities *pcache); + + struct cache_capabilities + { + u32 flags; /* Flags defining capabilities */ + u32 cache_size; /* Cache size in K (1024 bytes) */ + u32 max_lock; /* Maximum lockable region in K */ + } + + /* + * Flags + */ + + /* + * Bit 0: Cache lockability + * Bits 1-31: Reserved for future use + */ + #define CACHE_LOCKABLE 0x00000001 /* Cache can be locked */ + + /* + * Cache Types + */ + #define ICACHE 0x00 + #define DCACHE 0x01 + + DESCRIPTION + + This function fills out the pcache capability identifier for the + requested cache. cache_type is either DCACHE or ICACHE. This + function is not very useful at the moment as all XScale CPU's + have the same size Cache, but is is provided for future XScale + based processors that may have larger cache sizes. + + RETURN VALUE + + This function returns 0 if no error occurs, otherwise it returns + a negative, errno compatible value. + + -EIO Unknown hardware error + +III. Cache Locking + + SYNOPSIS + + int cache_lock(void *addr, u32 len, u8 cache_type, const char *desc); + + DESCRIPTION + + This function locks a physically contigous portion of memory starting + at the virtual address pointed to by addr into the cache referenced + by cache_type. + + The address of the data/instruction that is to be locked must be + aligned on a cache line boundary (L1_CACHE_ALIGNEMENT). + + The desc parameter is an optional (pass NULL if not used) human readable + descriptor of the locked memory region that is used by the cache + management code to build the /proc/cache_locks table. + + Note that this function does not check whether the address is valid + or not before locking it into the cache. That duty is up to the + caller. Also, it does not check for duplicate or overlaping + entries. + + RETURN VALUE + + If the function is successful in locking the entry into cache, a + zero is returned. + + If an error occurs, an appropriate error value is returned. + + -EINVAL The memory address provided was not cache line aligned + -ENOMEM Could not allocate memory to complete operation + -ENOSPC Not enough space left on cache to lock in requested region + -EIO Unknown error + +III. Cache Unlocking + + SYNOPSIS + + int cache_unlock(void *addr) + + DESCRIPTION + + This function unlocks a portion of memory that was previously locked + into either the I or D cache. + + RETURN VALUE + + If the entry is cleanly unlocked from the cache, a 0 is returned. + In the case of an error, an appropriate error is returned. + + -ENOENT No entry with given address associated with this cache + -EIO Unknown error + + diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/pmu.txt linux-2.5.63-bk4/Documentation/arm/XScale/pmu.txt --- linux-2.5.63-bk3/Documentation/arm/XScale/pmu.txt Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/pmu.txt Mon Mar 31 12:18:08 2003 @@ -0,0 +1,168 @@ + +Intel's XScale Microarchitecture processors provide a Performance +Monitoring Unit (PMU) that can be utilized to provide information +that can be useful for fine tuning of code. This text file describes +the API that's been developed for use by Linux kernel programmers. +When I have some extra time on my hand, I will extend the code to +provide support for user mode performance monitoring (which is +probably much more useful). Note that to get the most usage out +of the PMU, I highly reccomend getting the XScale reference manual +from Intel and looking at chapter 12. + +To use the PMU, you must #include in your source file. + +Since there's only one PMU, only one user can currently use the PMU +at a given time. To claim the PMU for usage, call pmu_claim() which +returns an identifier. When you are done using the PMU, call +pmu_release() with the identifier that you were given by pmu_claim. + +In addition, the PMU can only be used on XScale based systems that +provide an external timer. Systems that the PMU is currently supported +on are: + + - Cyclone IQ80310 + +Before delving into how to use the PMU code, let's do a quick overview +of the PMU itself. The PMU consists of three registers that can be +used for performance measurements. The first is the CCNT register with +provides the number of clock cycles elapsed since the PMU was started. +The next two register, PMN0 and PMN1, are eace user programmable to +provide 1 of 20 different performance statistics. By combining different +statistics, you can derive complex performance metrics. + +To start the PMU, just call pmu_start(pm0, pmn1). pmn0 and pmn1 tell +the PMU what statistics to capture and can each be one of: + +EVT_ICACHE_MISS + Instruction fetches requiring access to external memory + +EVT_ICACHE_NO_DELIVER + Instruction cache could not deliver an instruction. Either an + ICACHE miss or an instruction TLB miss. + +EVT_ICACHE_DATA_STALL + Stall in execution due to a data dependency. This counter is + incremented each cycle in which the condition is present. + +EVT_ITLB_MISS + Instruction TLB miss + +EVT_DTLB_MISS + Data TLB miss + +EVT_BRANCH + A branch instruction was executed and it may or may not have + changed program flow + +EVT_BRANCH_MISS + A branch (B or BL instructions only) was mispredicted + +EVT_INSTRUCTION + An instruction was executed + +EVT_DCACHE_FULL_STALL + Stall because data cache buffers are full. Incremented on every + cycle in which condition is present. + +EVT_DCACHE_FULL_STALL_CONTIG + Stall because data cache buffers are full. Incremented on every + cycle in which condition is contigous. + +EVT_DCACHE_ACCESS + Data cache access (data fetch) + +EVT_DCACHE_MISS + Data cache miss + +EVT_DCACHE_WRITE_BACK + Data cache write back. This counter is incremented for every + 1/2 line (four words) that are written back. + +EVT_PC_CHANGED + Software changed the PC. This is incremented only when the + software changes the PC and there is no mode change. For example, + a MOV instruction that targets the PC would increment the counter. + An SWI would not as it triggers a mode change. + +EVT_BCU_REQUEST + The Bus Control Unit(BCU) received a request from the core + +EVT_BCU_FULL + The BCU request queue if full. A high value for this event means + that the BCU is often waiting for to complete on the external bus. + +EVT_BCU_DRAIN + The BCU queues were drained due to either a Drain Write Buffer + command or an I/O transaction for a page that was marked as + uncacheable and unbufferable. + +EVT_BCU_ECC_NO_ELOG + The BCU detected an ECC error on the memory bus but noe ELOG + register was available to to log the errors. + +EVT_BCU_1_BIT_ERR + The BCU detected a 1-bit error while reading from the bus. + +EVT_RMW + An RMW cycle occurred due to narrow write on ECC protected memory. + +To get the results back, call pmu_stop(&results) where results is defined +as a struct pmu_results: + + struct pmu_results + { + u32 ccnt; /* Clock Counter Register */ + u32 ccnt_of; / + u32 pmn0; /* Performance Counter Register 0 */ + u32 pmn0_of; + u32 pmn1; /* Performance Counter Register 1 */ + u32 pmn1_of; + }; + +Pretty simple huh? Following are some examples of how to get some commonly +wanted numbers out of the PMU data. Note that since you will be dividing +things, this isn't super useful from the kernel and you need to printk the +data out to syslog. See [1] for more examples. + +Instruction Cache Efficiency + + pmu_start(EVT_INSTRUCTION, EVT_ICACHE_MISS); + ... + pmu_stop(&results); + + icache_miss_rage = results.pmn1 / results.pmn0; + cycles_per_instruction = results.ccnt / results.pmn0; + +Data Cache Efficiency + + pmu_start(EVT_DCACHE_ACCESS, EVT_DCACHE_MISS); + ... + pmu_stop(&results); + + dcache_miss_rage = results.pmn1 / results.pmn0; + +Instruction Fetch Latency + + pmu_start(EVT_ICACHE_NO_DELIVER, EVT_ICACHE_MISS); + ... + pmu_stop(&results); + + average_stall_waiting_for_instruction_fetch = + results.pmn0 / results.pmn1; + + percent_stall_cycles_due_to_instruction_fetch = + results.pmn0 / results.ccnt; + + +ToDo: + +- Add support for usermode PMU usage. This might require hooking into + the scheduler so that we pause the PMU when the task that requested + statistics is scheduled out. + +-- +This code is still under development, so please feel free to send patches, +questions, comments, etc to me. + +Deepak Saxena + diff -urN linux-2.5.63-bk3/Documentation/arm/XScale/tlb-lock.txt linux-2.5.63-bk4/Documentation/arm/XScale/tlb-lock.txt --- linux-2.5.63-bk3/Documentation/arm/XScale/tlb-lock.txt Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/Documentation/arm/XScale/tlb-lock.txt Mon Mar 31 12:18:08 2003 @@ -0,0 +1,64 @@ + +Intel's XScale Microarchitecture provides support for locking of TLB +entries in both the instruction and data TLBs. This file provides +an overview of the API that has been developed to take advantage of this +feature from kernel space. Note that there is NO support for user space. + +In general, this feature should be used in conjunction with locking +data or instructions into the appropriate caches. See the file +cache-lock.txt in this directory. + +If you have any questions, comments, patches, etc, please contact me. + +Deepak Saxena + + +API DESCRIPTION + +I. Header file + + #include + +II. Locking an entry into the TLB + + SYNOPSIS + + xscale_tlb_lock(u8 tlb_type, u32 addr); + + /* + * TLB types + */ + #define ITLB 0x0 + #define DTLB 0x1 + + DESCRIPTION + + This function locks the virtual to physical mapping for virtual + address addr into the requested TLB. + + RETURN VALUE + + If the entry is properly locked into the TLB, a 0 is returned. + In case of an error, an appropriate error is returned. + + -ENOSPC No more entries left in the TLB + -EIO Unknown error + +III. Unlocking an entry from a TLB + + SYNOPSIS + + xscale_tlb_unlock(u8 tlb_type, u32 addr); + + DESCRIPTION + + This function unlocks the entry for virtual address addr from the + specified cache. + + RETURN VALUE + + If the TLB entry is properly unlocked, a 0 is returned. + In case of an error, an appropriate error is returned. + + -ENOENT No entry for given address in specified TLB + diff -urN linux-2.5.63-bk3/Makefile linux-2.5.63-bk4/Makefile --- linux-2.5.63-bk3/Makefile Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/Makefile Mon Mar 31 12:18:08 2003 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 63 -EXTRAVERSION = bk3 +EXTRAVERSION = bk4 # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff -urN linux-2.5.63-bk3/arch/alpha/kernel/entry.S linux-2.5.63-bk4/arch/alpha/kernel/entry.S --- linux-2.5.63-bk3/arch/alpha/kernel/entry.S Mon Feb 24 11:05:04 2003 +++ linux-2.5.63-bk4/arch/alpha/kernel/entry.S Mon Mar 31 12:18:08 2003 @@ -591,7 +591,6 @@ */ .globl ret_from_fork -#if CONFIG_SMP || CONFIG_PREEMPT .align 4 .ent ret_from_fork ret_from_fork: @@ -599,9 +598,6 @@ mov $17, $16 jmp $31, schedule_tail .end ret_from_fork -#else -ret_from_fork = ret_from_sys_call -#endif /* * kernel_thread(fn, arg, clone_flags) diff -urN linux-2.5.63-bk3/arch/alpha/kernel/pci-noop.c linux-2.5.63-bk4/arch/alpha/kernel/pci-noop.c --- linux-2.5.63-bk3/arch/alpha/kernel/pci-noop.c Mon Feb 24 11:05:29 2003 +++ linux-2.5.63-bk4/arch/alpha/kernel/pci-noop.c Mon Mar 31 12:18:08 2003 @@ -48,7 +48,6 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn) { struct pci_controller *hose; - struct pci_dev *dev; /* from hose or from bus.devfn */ if (which & IOBASE_FROM_HOSE) { @@ -106,6 +105,7 @@ void * pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) { + return NULL; } void pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr, @@ -116,6 +116,7 @@ pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int direction) { + return (dma_addr_t) 0; } void pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, diff -urN linux-2.5.63-bk3/arch/alpha/kernel/pci.c linux-2.5.63-bk4/arch/alpha/kernel/pci.c --- linux-2.5.63-bk3/arch/alpha/kernel/pci.c Mon Feb 24 11:05:06 2003 +++ linux-2.5.63-bk4/arch/alpha/kernel/pci.c Mon Mar 31 12:18:08 2003 @@ -63,17 +63,6 @@ } static void __init -quirk_ali_ide_ports(struct pci_dev *dev) -{ - if (dev->resource[0].end == 0xffff) - dev->resource[0].end = dev->resource[0].start + 7; - if (dev->resource[2].end == 0xffff) - dev->resource[2].end = dev->resource[2].start + 7; - if (dev->resource[3].end == 0xffff) - dev->resource[3].end = dev->resource[3].start + 7; -} - -static void __init quirk_cypress(struct pci_dev *dev) { /* The Notorious Cy82C693 chip. */ @@ -121,8 +110,6 @@ struct pci_fixup pcibios_fixups[] __initdata = { { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge }, - { PCI_FIXUP_HEADER, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, - quirk_ali_ide_ports }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, quirk_cypress }, { PCI_FIXUP_FINAL, PCI_ANY_ID, PCI_ANY_ID, diff -urN linux-2.5.63-bk3/arch/arm/common/sa1111.c linux-2.5.63-bk4/arch/arm/common/sa1111.c --- linux-2.5.63-bk3/arch/arm/common/sa1111.c Mon Feb 24 11:05:44 2003 +++ linux-2.5.63-bk4/arch/arm/common/sa1111.c Mon Mar 31 12:18:08 2003 @@ -418,6 +418,7 @@ spin_lock_irqsave(&sachip->lock, flags); +#if CONFIG_ARCH_SA1100 /* * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111: * (SA-1110 Developer's Manual, section 9.1.2.1) @@ -425,6 +426,11 @@ GAFR |= GPIO_32_768kHz; GPDR |= GPIO_32_768kHz; TUCR = TUCR_3_6864MHz; +#elif CONFIG_ARCH_PXA + pxa_gpio_mode(GPIO11_3_6MHz_MD); +#else +#error missing clock setup +#endif /* * Turn VCO on, and disable PLL Bypass. @@ -461,6 +467,8 @@ spin_unlock_irqrestore(&sachip->lock, flags); } +#ifdef CONFIG_ARCH_SA1100 + /* * Configure the SA1111 shared memory controller. */ @@ -476,6 +484,8 @@ sa1111_writel(smcr, sachip->base + SA1111_SMCR); } +#endif + static void sa1111_init_one_child(struct sa1111 *sachip, struct sa1111_dev *sadev, unsigned int offset) { @@ -569,6 +579,7 @@ */ sa1111_wake(sachip); +#ifdef CONFIG_ARCH_SA1100 /* * The SDRAM configuration of the SA1110 and the SA1111 must * match. This is very important to ensure that SA1111 accesses @@ -592,6 +603,7 @@ * Enable the SA1110 memory bus request and grant signals. */ sa1110_mb_enable(); +#endif /* * The interrupt controller must be initialised before any diff -urN linux-2.5.63-bk3/arch/arm/kernel/head.S linux-2.5.63-bk4/arch/arm/kernel/head.S --- linux-2.5.63-bk3/arch/arm/kernel/head.S Mon Feb 24 11:05:05 2003 +++ linux-2.5.63-bk4/arch/arm/kernel/head.S Mon Mar 31 12:18:08 2003 @@ -37,7 +37,7 @@ .globl swapper_pg_dir .equ swapper_pg_dir, TEXTADDR - 0x4000 - .macro pgtbl, reg, rambase + .macro pgtbl, reg adr \reg, stext sub \reg, \reg, #0x4000 .endm @@ -47,7 +47,7 @@ * can convert the page table base address to the base address of the section * containing both. */ - .macro krnladr, rd, pgtable, rambase + .macro krnladr, rd, pgtable bic \rd, \pgtable, #0x000ff000 .endm @@ -164,7 +164,7 @@ * r8 = page table flags */ __create_page_tables: - pgtbl r4, r5 @ page table address + pgtbl r4 @ page table address /* * Clear the 16K level 1 swapper page table @@ -184,7 +184,7 @@ * cater for the MMU enable. This identity mapping * will be removed by paging_init() */ - krnladr r2, r4, r5 @ start of kernel + krnladr r2, r4 @ start of kernel add r3, r8, r2 @ flags + kernel base str r3, [r4, r2, lsr #18] @ identity mapping diff -urN linux-2.5.63-bk3/arch/arm/mach-pxa/Makefile linux-2.5.63-bk4/arch/arm/mach-pxa/Makefile --- linux-2.5.63-bk3/arch/arm/mach-pxa/Makefile Mon Feb 24 11:05:32 2003 +++ linux-2.5.63-bk4/arch/arm/mach-pxa/Makefile Mon Mar 31 12:18:08 2003 @@ -4,18 +4,17 @@ # Common support (must be linked before board specific support) obj-y += generic.o irq.o dma.o -obj-$(CONFIG_SA1111) += sa1111.o # Specific board support obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o obj-$(CONFIG_ARCH_PXA_IDP) += idp.o # Support for blinky lights -leds-y := leds.o -leds-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o -leds-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o +led-y := leds.o +led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o +led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o -obj-$(CONFIG_LEDS) += $(leds-y) +obj-$(CONFIG_LEDS) += $(led-y) # Misc features obj-$(CONFIG_PM) += pm.o sleep.o diff -urN linux-2.5.63-bk3/arch/arm/mach-pxa/generic.c linux-2.5.63-bk4/arch/arm/mach-pxa/generic.c --- linux-2.5.63-bk3/arch/arm/mach-pxa/generic.c Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/arch/arm/mach-pxa/generic.c Mon Mar 31 12:18:08 2003 @@ -38,7 +38,7 @@ static unsigned char L_clk_mult[32] = { 0, 27, 32, 36, 40, 45, 0, }; /* Memory Frequency to Run Mode Frequency Multiplier (M) */ -static unsigned char M_clk_mult[4] = { 0, 1, 2, 0 }; +static unsigned char M_clk_mult[4] = { 0, 1, 2, 4 }; /* Run Mode Frequency to Turbo Mode Frequency Multiplier (N) */ /* Note: we store the value N * 2 here. */ @@ -47,11 +47,12 @@ /* Crystal clock */ #define BASE_CLK 3686400 - /* - * Display what we were booted with. + * Get the clock frequency as reflected by CCCR and the turbo flag. + * We assume these values have been applied via a fcs. + * If info is not 0 we also display the current settings. */ -static int __init pxa_display_clocks(void) +unsigned int get_clk_frequency_khz(int info) { unsigned long cccr, turbo; unsigned int l, L, m, M, n2, N; @@ -67,20 +68,24 @@ M = m * L; N = n2 * M / 2; - L += 5000; - printk( KERN_INFO "Memory clock: %d.%02dMHz (*%d)\n", - L / 1000000, (L % 1000000) / 10000, l ); - M += 5000; - printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n", - M / 1000000, (M % 1000000) / 10000, m ); - N += 5000; - printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n", - N / 1000000, (N % 1000000) / 10000, n2 / 2, (n2 % 2) * 5, - (turbo & 1) ? "" : "in" ); + if(info) + { + L += 5000; + printk( KERN_INFO "Memory clock: %d.%02dMHz (*%d)\n", + L / 1000000, (L % 1000000) / 10000, l ); + M += 5000; + printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n", + M / 1000000, (M % 1000000) / 10000, m ); + N += 5000; + printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n", + N / 1000000, (N % 1000000) / 10000, n2 / 2, (n2 % 2) * 5, + (turbo & 1) ? "" : "in" ); + } - return 0; + return (turbo & 1) ? (N/1000) : (M/1000); } +EXPORT_SYMBOL(get_clk_frequency_khz); /* * Return the current lclk requency in units of 10kHz @@ -132,5 +137,5 @@ void __init pxa_map_io(void) { iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); - pxa_display_clocks(); + get_clk_frequency_khz(1); } diff -urN linux-2.5.63-bk3/arch/arm/mach-pxa/irq.c linux-2.5.63-bk4/arch/arm/mach-pxa/irq.c --- linux-2.5.63-bk3/arch/arm/mach-pxa/irq.c Mon Feb 24 11:05:43 2003 +++ linux-2.5.63-bk4/arch/arm/mach-pxa/irq.c Mon Mar 31 12:18:08 2003 @@ -241,10 +241,4 @@ /* Install handler for GPIO 2-80 edge detect interrupts */ set_irq_chip(IRQ_GPIO_2_80, &pxa_internal_chip); set_irq_chained_handler(IRQ_GPIO_2_80, pxa_gpio_demux_handler); - - /* - * We generally don't want the LCD IRQ being - * enabled as soon as we request it. - */ - set_irq_flags(IRQ_LCD, IRQF_VALID | IRQF_NOAUTOEN); } diff -urN linux-2.5.63-bk3/arch/arm/mach-pxa/leds.c linux-2.5.63-bk4/arch/arm/mach-pxa/leds.c --- linux-2.5.63-bk3/arch/arm/mach-pxa/leds.c Mon Feb 24 11:06:01 2003 +++ linux-2.5.63-bk4/arch/arm/mach-pxa/leds.c Mon Mar 31 12:18:08 2003 @@ -27,4 +27,4 @@ return 0; } -__initcall(pxa_leds_init); +core_initcall(pxa_leds_init); diff -urN linux-2.5.63-bk3/arch/arm/mach-pxa/lubbock.c linux-2.5.63-bk4/arch/arm/mach-pxa/lubbock.c --- linux-2.5.63-bk3/arch/arm/mach-pxa/lubbock.c Mon Feb 24 11:05:16 2003 +++ linux-2.5.63-bk4/arch/arm/mach-pxa/lubbock.c Mon Mar 31 12:18:08 2003 @@ -13,6 +13,7 @@ */ #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include "generic.h" -#include "sa1111.h" static void lubbock_ack_irq(unsigned int irq) { @@ -106,24 +106,16 @@ static int __init lubbock_init(void) { - int ret; - - ret = sa1111_probe(LUBBOCK_SA1111_BASE); - if (ret) - return ret; - sa1111_wake(); - sa1111_init_irq(LUBBOCK_SA1111_IRQ); - return 0; + return sa1111_init(0x10000000, LUBBOCK_SA1111_IRQ); } -__initcall(lubbock_init); +subsys_initcall(lubbock_init); static struct map_desc lubbock_io_desc[] __initdata = { /* virtual physical length type */ { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE }, /* CPLD */ { 0xf1000000, 0x0c000000, 0x00100000, MT_DEVICE }, /* LAN91C96 IO */ { 0xf1100000, 0x0e000000, 0x00100000, MT_DEVICE }, /* LAN91C96 Attr */ - { 0xf4000000, 0x10000000, 0x00400000, MT_DEVICE } /* SA1111 */ }; static void __init lubbock_map_io(void) diff -urN linux-2.5.63-bk3/arch/cris/drivers/eeprom.c linux-2.5.63-bk4/arch/cris/drivers/eeprom.c --- linux-2.5.63-bk3/arch/cris/drivers/eeprom.c Mon Feb 24 11:05:16 2003 +++ linux-2.5.63-bk4/arch/cris/drivers/eeprom.c Mon Mar 31 12:18:08 2003 @@ -815,7 +815,7 @@ i2c_outbyte( eeprom.select_cmd | 1 ); } - if(i2c_getack()); + if(i2c_getack()) { break; } diff -urN linux-2.5.63-bk3/arch/i386/boot/bootsect.S linux-2.5.63-bk4/arch/i386/boot/bootsect.S --- linux-2.5.63-bk3/arch/i386/boot/bootsect.S Mon Feb 24 11:05:32 2003 +++ linux-2.5.63-bk4/arch/i386/boot/bootsect.S Mon Mar 31 12:18:08 2003 @@ -405,7 +405,7 @@ ret sectors: .word 0 -disksizes: .byte 36, 18, 15, 9 +disksizes: .byte 36, 21, 18, 15, 9 msg1: .byte 13, 10 .ascii "Loading" diff -urN linux-2.5.63-bk3/arch/i386/kernel/acpi/boot.c linux-2.5.63-bk4/arch/i386/kernel/acpi/boot.c --- linux-2.5.63-bk3/arch/i386/kernel/acpi/boot.c Mon Feb 24 11:05:42 2003 +++ linux-2.5.63-bk4/arch/i386/kernel/acpi/boot.c Mon Mar 31 12:18:08 2003 @@ -24,6 +24,7 @@ */ #include +#include #include #include #include diff -urN linux-2.5.63-bk3/arch/i386/kernel/cpu/amd.c linux-2.5.63-bk4/arch/i386/kernel/cpu/amd.c --- linux-2.5.63-bk3/arch/i386/kernel/cpu/amd.c Mon Feb 24 11:05:47 2003 +++ linux-2.5.63-bk4/arch/i386/kernel/cpu/amd.c Mon Mar 31 12:18:08 2003 @@ -151,11 +151,10 @@ case 6: /* An Athlon/Duron */ /* Bit 15 of Athlon specific MSR 15, needs to be 0 - * to enable SSE on Palomino/Morgan CPU's. - * If the BIOS didn't enable it already, enable it - * here. + * to enable SSE on Palomino/Morgan/Barton CPU's. + * If the BIOS didn't enable it already, enable it here. */ - if (c->x86_model == 6 || c->x86_model == 7) { + if (c->x86_model >= 6 && c->x86_model <= 10) { if (!cpu_has(c, X86_FEATURE_XMM)) { printk(KERN_INFO "Enabling disabled K7/SSE Support.\n"); rdmsr(MSR_K7_HWCR, l, h); diff -urN linux-2.5.63-bk3/arch/i386/kernel/cpu/centaur.c linux-2.5.63-bk4/arch/i386/kernel/cpu/centaur.c --- linux-2.5.63-bk3/arch/i386/kernel/cpu/centaur.c Mon Feb 24 11:05:35 2003 +++ linux-2.5.63-bk4/arch/i386/kernel/cpu/centaur.c Mon Mar 31 12:18:08 2003 @@ -412,8 +412,9 @@ size >>= 8; /* VIA also screwed up Nehemiah stepping 1, and made - it return '65KB' instead of '64KB' */ - if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1)) + it return '65KB' instead of '64KB' + - Note, it seems this may only be in engineering samples. */ + if ((c->x86==6) && (c->x86_model==9) && (c->x86_mask==1) && (size==65)) size -=1; return size; diff -urN linux-2.5.63-bk3/arch/i386/kernel/entry.S linux-2.5.63-bk4/arch/i386/kernel/entry.S --- linux-2.5.63-bk3/arch/i386/kernel/entry.S Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/arch/i386/kernel/entry.S Mon Mar 31 12:18:08 2003 @@ -228,7 +228,6 @@ #define SYSENTER_RETURN 0xffffe010 # sysenter call handler stub - ALIGN ENTRY(sysenter_entry) sti pushl $(__USER_DS) @@ -271,7 +270,6 @@ # system call handler stub - ALIGN ENTRY(system_call) pushl %eax # save orig_eax SAVE_ALL diff -urN linux-2.5.63-bk3/arch/i386/kernel/setup.c linux-2.5.63-bk4/arch/i386/kernel/setup.c --- linux-2.5.63-bk3/arch/i386/kernel/setup.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/arch/i386/kernel/setup.c Mon Mar 31 12:18:08 2003 @@ -14,6 +14,9 @@ * Moved CPU detection code to cpu/${cpu}.c * Patrick Mochel , March 2002 * + * Provisions for empty E820 memory regions (reported by certain BIOSes). + * Alex Achenbach , December 2002. + * */ /* @@ -279,7 +282,7 @@ int chgidx, still_changing; int overlap_entries; int new_bios_entry; - int old_nr, new_nr; + int old_nr, new_nr, chg_nr; int i; /* @@ -333,20 +336,24 @@ for (i=0; i < 2*old_nr; i++) change_point[i] = &change_point_list[i]; - /* record all known change-points (starting and ending addresses) */ + /* record all known change-points (starting and ending addresses), + omitting those that are for empty memory regions */ chgidx = 0; for (i=0; i < old_nr; i++) { - change_point[chgidx]->addr = biosmap[i].addr; - change_point[chgidx++]->pbios = &biosmap[i]; - change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size; - change_point[chgidx++]->pbios = &biosmap[i]; + if (biosmap[i].size != 0) { + change_point[chgidx]->addr = biosmap[i].addr; + change_point[chgidx++]->pbios = &biosmap[i]; + change_point[chgidx]->addr = biosmap[i].addr + biosmap[i].size; + change_point[chgidx++]->pbios = &biosmap[i]; + } } + chg_nr = chgidx; /* true number of change-points */ /* sort change-point list by memory addresses (low -> high) */ still_changing = 1; while (still_changing) { still_changing = 0; - for (i=1; i < 2*old_nr; i++) { + for (i=1; i < chg_nr; i++) { /* if > , swap */ /* or, if current= & last=, swap */ if ((change_point[i]->addr < change_point[i-1]->addr) || @@ -369,7 +376,7 @@ last_type = 0; /* start with undefined memory type */ last_addr = 0; /* start with 0 as last starting address */ /* loop through change-points, determining affect on the new bios map */ - for (chgidx=0; chgidx < 2*old_nr; chgidx++) + for (chgidx=0; chgidx < chg_nr; chgidx++) { /* keep track of all overlapping bios entries */ if (change_point[chgidx]->addr == change_point[chgidx]->pbios->addr) diff -urN linux-2.5.63-bk3/drivers/char/agp/Kconfig linux-2.5.63-bk4/drivers/char/agp/Kconfig --- linux-2.5.63-bk3/drivers/char/agp/Kconfig Mon Feb 24 11:05:34 2003 +++ linux-2.5.63-bk4/drivers/char/agp/Kconfig Mon Mar 31 12:18:08 2003 @@ -34,14 +34,17 @@ depends on AGP config AGP_INTEL - tristate "Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support" + tristate "Intel 440LX/BX/GX and I815/I820/830M/I830MP/I840/I845/845G/I850/852GM/855GM/I860/865G support" depends on AGP help This option gives you AGP support for the GLX component of the - XFree86 4.x on Intel 440LX/BX/GX, 815, 820, 830, 840, 845, 850 and 860 chipsets. + XFree86 4.x on Intel 440LX/BX/GX, 815, 820, 830, 840, 845, 850 + and 860 chipsets and full support for the 810, 815, 830M, 845G, + 852GM, 855GM and 865G integrated graphics chipsets. You should say Y here if you use XFree86 3.3.6 or 4.x and want to - use GLX or DRI. If unsure, say N. + use GLX or DRI, or if you have any Intel integrated graphics + chipsets. If unsure, say Y. #config AGP_I810 # tristate "Intel I810/I815/I830M (on-board) support" diff -urN linux-2.5.63-bk3/drivers/char/agp/agp.h linux-2.5.63-bk4/drivers/char/agp/agp.h --- linux-2.5.63-bk3/drivers/char/agp/agp.h Mon Feb 24 11:05:29 2003 +++ linux-2.5.63-bk4/drivers/char/agp/agp.h Mon Mar 31 12:18:08 2003 @@ -217,6 +217,21 @@ /* This one is for I830MP w. an external graphic card */ #define INTEL_I830_ERRSTS 0x92 +/* Intel 855GM/852GM registers */ +#define I855_GMCH_GMS_STOLEN_0M 0x0 +#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4) +#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4) +#define I855_GMCH_GMS_STOLEN_8M (0x3 << 4) +#define I855_GMCH_GMS_STOLEN_16M (0x4 << 4) +#define I855_GMCH_GMS_STOLEN_32M (0x5 << 4) +#define I85X_CAPID 0x44 +#define I85X_VARIANT_MASK 0x7 +#define I85X_VARIANT_SHIFT 5 +#define I855_GME 0x0 +#define I855_GM 0x4 +#define I852_GME 0x2 +#define I852_GM 0x5 + /* intel 815 register */ #define INTEL_815_APCONT 0x51 #define INTEL_815_ATTBASE_MASK ~0x1FFFFFFF diff -urN linux-2.5.63-bk3/drivers/char/agp/alpha-agp.c linux-2.5.63-bk4/drivers/char/agp/alpha-agp.c --- linux-2.5.63-bk3/drivers/char/agp/alpha-agp.c Mon Feb 24 11:05:36 2003 +++ linux-2.5.63-bk4/drivers/char/agp/alpha-agp.c Mon Mar 31 12:18:08 2003 @@ -185,7 +185,7 @@ agp_bridge->agp_destroy_page = agp_generic_destroy_page; agp_bridge->mode = agp->capability.lw; agp_bridge->cant_use_aperture = 1; - agp_bridgevm_ops = &alpha_core_agp_vm_ops; + agp_bridge->vm_ops = &alpha_core_agp_vm_ops; alpha_core_agp_driver.dev = agp_bridge->dev; agp_register_driver(&alpha_core_agp_driver); diff -urN linux-2.5.63-bk3/drivers/char/agp/intel-agp.c linux-2.5.63-bk4/drivers/char/agp/intel-agp.c --- linux-2.5.63-bk3/drivers/char/agp/intel-agp.c Mon Feb 24 11:05:32 2003 +++ linux-2.5.63-bk4/drivers/char/agp/intel-agp.c Mon Mar 31 12:18:08 2003 @@ -2,6 +2,11 @@ * Intel AGPGART routines. */ +/* + * Intel(R) 855GM/852GM and 865G support added by David Dawes + * . + */ + #include #include #include @@ -294,34 +299,62 @@ u16 gmch_ctrl; int gtt_entries; u8 rdct; + int local = 0; static const int ddt[4] = { 0, 16, 32, 64 }; pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl); - switch (gmch_ctrl & I830_GMCH_GMS_MASK) { - case I830_GMCH_GMS_STOLEN_512: - gtt_entries = KB(512) - KB(132); - printk(KERN_INFO PFX "detected %dK stolen memory.\n",gtt_entries / KB(1)); - break; - case I830_GMCH_GMS_STOLEN_1024: - gtt_entries = MB(1) - KB(132); - printk(KERN_INFO PFX "detected %dK stolen memory.\n",gtt_entries / KB(1)); - break; - case I830_GMCH_GMS_STOLEN_8192: - gtt_entries = MB(8) - KB(132); - printk(KERN_INFO PFX "detected %dK stolen memory.\n",gtt_entries / KB(1)); - break; - case I830_GMCH_GMS_LOCAL: - rdct = INREG8(intel_i830_private.registers,I830_RDRAM_CHANNEL_TYPE); - gtt_entries = (I830_RDRAM_ND(rdct) + 1) * MB(ddt[I830_RDRAM_DDT(rdct)]); - printk(KERN_INFO PFX "detected %dK local memory.\n",gtt_entries / KB(1)); - break; - default: - printk(KERN_INFO PFX "no video memory detected.\n"); - gtt_entries = 0; - break; + if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82830_HB || + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) { + switch (gmch_ctrl & I830_GMCH_GMS_MASK) { + case I830_GMCH_GMS_STOLEN_512: + gtt_entries = KB(512) - KB(132); + break; + case I830_GMCH_GMS_STOLEN_1024: + gtt_entries = MB(1) - KB(132); + break; + case I830_GMCH_GMS_STOLEN_8192: + gtt_entries = MB(8) - KB(132); + break; + case I830_GMCH_GMS_LOCAL: + rdct = INREG8(intel_i830_private.registers, + I830_RDRAM_CHANNEL_TYPE); + gtt_entries = (I830_RDRAM_ND(rdct) + 1) * + MB(ddt[I830_RDRAM_DDT(rdct)]); + local = 1; + break; + default: + gtt_entries = 0; + break; + } + } else { + switch (gmch_ctrl & I830_GMCH_GMS_MASK) { + case I855_GMCH_GMS_STOLEN_1M: + gtt_entries = MB(1) - KB(132); + break; + case I855_GMCH_GMS_STOLEN_4M: + gtt_entries = MB(4) - KB(132); + break; + case I855_GMCH_GMS_STOLEN_8M: + gtt_entries = MB(8) - KB(132); + break; + case I855_GMCH_GMS_STOLEN_16M: + gtt_entries = MB(16) - KB(132); + break; + case I855_GMCH_GMS_STOLEN_32M: + gtt_entries = MB(32) - KB(132); + break; + default: + gtt_entries = 0; + break; + } } - + if (gtt_entries > 0) + printk(KERN_INFO PFX "Detected %dK %s memory.\n", + gtt_entries / KB(1), local ? "local" : "stolen"); + else + printk(KERN_INFO PFX + "No pre-allocated video memory detected.\n"); gtt_entries /= KB(4); intel_i830_private.gtt_entries = gtt_entries; @@ -374,9 +407,18 @@ u16 gmch_ctrl; struct aper_size_info_fixed *values; - pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl); values = A_SIZE_FIX(agp_bridge->aperture_sizes); + if (agp_bridge->dev->device != PCI_DEVICE_ID_INTEL_82830_HB && + agp_bridge->dev->device != PCI_DEVICE_ID_INTEL_82845G_HB) { + /* 855GM/852GM/865G has 128MB aperture size */ + agp_bridge->previous_size = agp_bridge->current_size = (void *) values; + agp_bridge->aperture_size_idx = 0; + return(values[0].size); + } + + pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl); + if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) { agp_bridge->previous_size = agp_bridge->current_size = (void *) values; agp_bridge->aperture_size_idx = 0; @@ -558,6 +600,7 @@ return(0); } + static int intel_fetch_size(void) { int i; @@ -1241,7 +1284,7 @@ { .device_id = PCI_DEVICE_ID_INTEL_82830_HB, .chipset = INTEL_I830_M, - .chipset_name = "i830M", + .chipset_name = "830M", .chipset_setup = intel_830mp_setup }, { @@ -1259,7 +1302,7 @@ { .device_id = PCI_DEVICE_ID_INTEL_82845G_HB, .chipset = INTEL_I845_G, - .chipset_name = "i845G", + .chipset_name = "845G", .chipset_setup = intel_845_setup }, { @@ -1269,11 +1312,23 @@ .chipset_setup = intel_850_setup }, { + .device_id = PCI_DEVICE_ID_INTEL_82855_HB, + .chipset = INTEL_I855_PM, + .chipset_name = "855PM", + .chipset_setup = intel_845_setup + }, + { .device_id = PCI_DEVICE_ID_INTEL_82860_HB, .chipset = INTEL_I860, .chipset_name = "i860", .chipset_setup = intel_860_setup }, + { + .device_id = PCI_DEVICE_ID_INTEL_82865_HB, + .chipset = INTEL_I865_G, + .chipset_name = "865G", + .chipset_setup = intel_845_setup + }, { }, /* dummy final entry, always present */ }; @@ -1387,13 +1442,13 @@ if (i810_dev == NULL) { /* - * We probably have a I845MP chipset with an external graphics + * We probably have a I845G chipset with an external graphics * card. It will be initialized later */ agp_bridge->type = INTEL_I845_G; break; } - printk(KERN_INFO PFX "Detected an Intel 845G Chipset.\n"); + printk(KERN_INFO PFX "Detected an Intel(R) 845G Chipset.\n"); agp_bridge->type = INTEL_I810; return intel_i830_setup(i810_dev); @@ -1408,7 +1463,63 @@ agp_bridge->type = INTEL_I830_M; break; } - printk(KERN_INFO PFX "Detected an Intel 830M Chipset.\n"); + printk(KERN_INFO PFX "Detected an Intel(R) 830M Chipset.\n"); + agp_bridge->type = INTEL_I810; + return intel_i830_setup(i810_dev); + + case PCI_DEVICE_ID_INTEL_82855_HB: + i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855_IG, NULL); + if(i810_dev && PCI_FUNC(i810_dev->devfn) != 0) + i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855_IG, i810_dev); + + if (i810_dev == NULL) { + /* Intel 855PM with external graphic card */ + /* It will be initialized later */ + agp_bridge->type = INTEL_I855_PM; + break; + } + { + u32 capval = 0; + const char *name = "855GM/852GM"; + pci_read_config_dword(dev, I85X_CAPID, &capval); + switch ((capval >> I85X_VARIANT_SHIFT) & + I85X_VARIANT_MASK) { + case I855_GME: + name = "855GME"; + break; + case I855_GM: + name = "855GM"; + break; + case I852_GME: + name = "852GME"; + break; + case I852_GM: + name = "852GM"; + break; + } + printk(KERN_INFO PFX + "Detected an Intel(R) %s Chipset.\n", name); + } + agp_bridge->type = INTEL_I810; + return intel_i830_setup(i810_dev); + + case PCI_DEVICE_ID_INTEL_82865_HB: + i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82865_IG, NULL); + if (i810_dev && PCI_FUNC(i810_dev->devfn) != 0) { + i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82865_IG, i810_dev); + } + + if (i810_dev == NULL) { + /* + * We probably have a 865G chipset with an external graphics + * card. It will be initialized later + */ + agp_bridge->type = INTEL_I865_G; + break; + } + printk(KERN_INFO PFX "Detected an Intel(R) 865G Chipset.\n"); agp_bridge->type = INTEL_I810; return intel_i830_setup(i810_dev); diff -urN linux-2.5.63-bk3/drivers/char/generic_serial.c linux-2.5.63-bk4/drivers/char/generic_serial.c --- linux-2.5.63-bk3/drivers/char/generic_serial.c Mon Feb 24 11:05:32 2003 +++ linux-2.5.63-bk4/drivers/char/generic_serial.c Mon Mar 31 12:18:08 2003 @@ -142,14 +142,14 @@ /* Can't copy more? break out! */ if (c <= 0) break; - if (from_user) + if (from_user) { if (copy_from_user (port->xmit_buf + port->xmit_head, buf, c)) { up (& port->port_write_sem); return -EFAULT; } - else + } else memcpy (port->xmit_buf + port->xmit_head, buf, c); port -> xmit_cnt += c; diff -urN linux-2.5.63-bk3/drivers/char/watchdog/Kconfig linux-2.5.63-bk4/drivers/char/watchdog/Kconfig --- linux-2.5.63-bk3/drivers/char/watchdog/Kconfig Mon Feb 24 11:05:36 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/Kconfig Mon Mar 31 12:18:08 2003 @@ -313,6 +313,19 @@ You can compile this driver directly into the kernel, or use it as a module. The module will be called sc520_wdt. +config AMD7XX_TCO + tristate "AMD 766/768 TCO Timer/Watchdog" + depends on WATCHDOG + help + This is the driver for the hardware watchdog built in to the + AMD 766/768 chipsets. + This watchdog simply watches your kernel to make sure it doesn't + freeze, and if it does, it reboots your computer after a certain + amount of time. + + You can compile this driver directly into the kernel, or use + it as a module. The module will be called amd7xx_tco. + config ALIM7101_WDT tristate "ALi M7101 PMU Computer Watchdog" depends on WATCHDOG diff -urN linux-2.5.63-bk3/drivers/char/watchdog/Makefile linux-2.5.63-bk4/drivers/char/watchdog/Makefile --- linux-2.5.63-bk3/drivers/char/watchdog/Makefile Mon Feb 24 11:05:38 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/Makefile Mon Mar 31 12:18:08 2003 @@ -30,3 +30,4 @@ obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o +obj-$(CONFIG_AMD7XX_TCO) += amd7xx_tco.o diff -urN linux-2.5.63-bk3/drivers/char/watchdog/acquirewdt.c linux-2.5.63-bk4/drivers/char/watchdog/acquirewdt.c --- linux-2.5.63-bk3/drivers/char/watchdog/acquirewdt.c Mon Feb 24 11:05:35 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/acquirewdt.c Mon Mar 31 12:18:08 2003 @@ -141,8 +141,6 @@ spin_unlock(&acq_lock); return -EBUSY; } - if (nowayout) - MOD_INC_USE_COUNT; /* Activate */ acq_is_open=1; diff -urN linux-2.5.63-bk3/drivers/char/watchdog/amd7xx_tco.c linux-2.5.63-bk4/drivers/char/watchdog/amd7xx_tco.c --- linux-2.5.63-bk3/drivers/char/watchdog/amd7xx_tco.c Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/drivers/char/watchdog/amd7xx_tco.c Mon Mar 31 12:18:08 2003 @@ -0,0 +1,373 @@ +/* + * AMD 766/768 TCO Timer Driver + * (c) Copyright 2002 Zwane Mwaikambo + * All Rights Reserved. + * + * Parts from; + * Hardware driver for the AMD 768 Random Number Generator (RNG) + * (c) Copyright 2001 Red Hat Inc + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * The author(s) of this software shall not be held liable for damages + * of any nature resulting due to the use of this software. This + * software is provided AS-IS with no warranties. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define AMDTCO_MODULE_VER "build 20020601" +#define AMDTCO_MODULE_NAME "amd7xx_tco" +#define PFX AMDTCO_MODULE_NAME ": " + +#define MAX_TIMEOUT 38 /* max of 38 seconds */ + +/* pmbase registers */ +#define GLOBAL_SMI_REG 0x2a +#define TCO_EN (1 << 1) /* bit 1 in global SMI register */ +#define TCO_RELOAD_REG 0x40 /* bits 0-5 are current count, 6-7 are reserved */ +#define TCO_INITVAL_REG 0x41 /* bits 0-5 are value to load, 6-7 are reserved */ +#define TCO_TIMEOUT_MASK 0x3f +#define TCO_STATUS2_REG 0x46 +#define NDTO_STS2 (1 << 1) /* we're interested in the second timeout */ +#define BOOT_STS (1 << 2) /* will be set if NDTO_STS2 was set before reboot */ +#define TCO_CTRL1_REG 0x48 +#define TCO_HALT (1 << 11) + +static char banner[] __initdata = KERN_INFO PFX AMDTCO_MODULE_VER; +static int timeout = 38; +static u32 pmbase; /* PMxx I/O base */ +static struct pci_dev *dev; +static struct semaphore open_sem; +spinlock_t amdtco_lock; /* only for device access */ +static int expect_close = 0; + +MODULE_PARM(timeout, "i"); +MODULE_PARM_DESC(timeout, "range is 0-38 seconds, default is 38"); + +static inline int amdtco_status(void) +{ + u16 reg; + int status = 0; + + reg = inb(pmbase+TCO_CTRL1_REG); + if ((reg & TCO_HALT) == 0) + status |= WDIOF_KEEPALIVEPING; + + reg = inb(pmbase+TCO_STATUS2_REG); + if (reg & BOOT_STS) + status |= WDIOF_CARDRESET; + + return status; +} + +static inline void amdtco_ping(void) +{ + u8 reg; + + spin_lock(&amdtco_lock); + reg = inb(pmbase+TCO_RELOAD_REG); + outb(1 | reg, pmbase+TCO_RELOAD_REG); + spin_unlock(&amdtco_lock); +} + +static inline int amdtco_gettimeout(void) +{ + return inb(TCO_RELOAD_REG) & TCO_TIMEOUT_MASK; +} + +static inline void amdtco_settimeout(unsigned int timeout) +{ + u8 reg; + + spin_lock(&amdtco_lock); + reg = inb(pmbase+TCO_INITVAL_REG); + reg |= timeout & TCO_TIMEOUT_MASK; + outb(reg, pmbase+TCO_INITVAL_REG); + spin_unlock(&amdtco_lock); +} + +static inline void amdtco_global_enable(void) +{ + u16 reg; + + spin_lock(&amdtco_lock); + reg = inw(pmbase+GLOBAL_SMI_REG); + reg |= TCO_EN; + outw(reg, pmbase+GLOBAL_SMI_REG); + spin_unlock(&amdtco_lock); +} + +static inline void amdtco_enable(void) +{ + u16 reg; + + spin_lock(&amdtco_lock); + reg = inw(pmbase+TCO_CTRL1_REG); + reg &= ~TCO_HALT; + outw(reg, pmbase+TCO_CTRL1_REG); + spin_unlock(&amdtco_lock); +} + +static inline void amdtco_disable(void) +{ + u16 reg; + + spin_lock(&amdtco_lock); + reg = inw(pmbase+TCO_CTRL1_REG); + reg |= TCO_HALT; + outw(reg, pmbase+TCO_CTRL1_REG); + spin_unlock(&amdtco_lock); +} + +static int amdtco_fop_open(struct inode *inode, struct file *file) +{ + if (down_trylock(&open_sem)) + return -EBUSY; + + if (timeout > MAX_TIMEOUT) + timeout = MAX_TIMEOUT; + + amdtco_settimeout(timeout); + amdtco_global_enable(); + amdtco_ping(); + printk(KERN_INFO PFX "Watchdog enabled, timeout = %d/%d seconds", + amdtco_gettimeout(), timeout); + + return 0; +} + + +static int amdtco_fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + int new_timeout; + int tmp; + + static struct watchdog_info ident = { + .options = WDIOF_SETTIMEOUT | WDIOF_CARDRESET, + .identity = "AMD 766/768" + }; + + switch (cmd) { + default: + return -ENOTTY; + + case WDIOC_GETSUPPORT: + if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident)) + return -EFAULT; + return 0; + + case WDIOC_GETSTATUS: + return put_user(amdtco_status(), (int *)arg); + + case WDIOC_KEEPALIVE: + amdtco_ping(); + return 0; + + case WDIOC_SETTIMEOUT: + if (get_user(new_timeout, (int *)arg)) + return -EFAULT; + + if (new_timeout < 0) + return -EINVAL; + + if (new_timeout > MAX_TIMEOUT) + new_timeout = MAX_TIMEOUT; + + timeout = new_timeout; + amdtco_settimeout(timeout); + /* fall through and return the new timeout */ + + case WDIOC_GETTIMEOUT: + return put_user(amdtco_gettimeout(), (int *)arg); + + case WDIOC_SETOPTIONS: + if (copy_from_user(&tmp, (int *)arg, sizeof tmp)) + return -EFAULT; + + if (tmp & WDIOS_DISABLECARD) + amdtco_disable(); + + if (tmp & WDIOS_ENABLECARD) + amdtco_enable(); + + return 0; + } +} + + +static int amdtco_fop_release(struct inode *inode, struct file *file) +{ + if (expect_close) { + amdtco_disable(); + printk(KERN_INFO PFX "Watchdog disabled\n"); + } else { + amdtco_ping(); + printk(KERN_CRIT PFX "Unexpected close!, timeout in %d seconds)\n", timeout); + } + + up(&open_sem); + return 0; +} + + +static ssize_t amdtco_fop_write(struct file *file, const char *data, size_t len, loff_t *ppos) +{ + if (ppos != &file->f_pos) + return -ESPIPE; + + if (len) { +#ifndef CONFIG_WATCHDOG_NOWAYOUT + size_t i; + char c; + expect_close = 0; + + for (i = 0; i != len; i++) { + if (get_user(c, data + i)) + return -EFAULT; + + if (c == 'V') + expect_close = 1; + } +#endif + amdtco_ping(); + return len; + } + + return 0; +} + + +static int amdtco_notify_sys(struct notifier_block *this, unsigned long code, void *unused) +{ + if (code == SYS_DOWN || code == SYS_HALT) + amdtco_disable(); + + return NOTIFY_DONE; +} + + +static struct notifier_block amdtco_notifier = +{ + .notifier_call = amdtco_notify_sys +}; + +static struct file_operations amdtco_fops = +{ + .owner = THIS_MODULE, + .write = amdtco_fop_write, + .ioctl = amdtco_fop_ioctl, + .open = amdtco_fop_open, + .release = amdtco_fop_release +}; + +static struct miscdevice amdtco_miscdev = +{ + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &amdtco_fops +}; + +static struct pci_device_id amdtco_pci_tbl[] __initdata = { + /* AMD 766 PCI_IDs here */ + { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7443, PCI_ANY_ID, PCI_ANY_ID, }, + { 0, } +}; + +MODULE_DEVICE_TABLE (pci, amdtco_pci_tbl); + +static int __init amdtco_init(void) +{ + int ret; + + sema_init(&open_sem, 1); + spin_lock_init(&amdtco_lock); + + pci_for_each_dev(dev) { + if (pci_match_device (amdtco_pci_tbl, dev) != NULL) + goto found_one; + } + + return -ENODEV; + +found_one: + + if ((ret = register_reboot_notifier(&amdtco_notifier))) { + printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret); + goto out_clean; + } + + if ((ret = misc_register(&amdtco_miscdev))) { + printk(KERN_ERR PFX "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR); + goto out_unreg_reboot; + } + + pci_read_config_dword(dev, 0x58, &pmbase); + pmbase &= 0x0000FF00; + + if (pmbase == 0) { + printk (KERN_ERR PFX "power management base not set\n"); + ret = -EIO; + goto out_unreg_misc; + } + + /* ret = 0; */ + printk(banner); + goto out_clean; + +out_unreg_misc: + misc_deregister(&amdtco_miscdev); +out_unreg_reboot: + unregister_reboot_notifier(&amdtco_notifier); +out_clean: + return ret; +} + +static void __exit amdtco_exit(void) +{ + misc_deregister(&amdtco_miscdev); + unregister_reboot_notifier(&amdtco_notifier); +} + + +#ifndef MODULE +static int __init amdtco_setup(char *str) +{ + int ints[4]; + + str = get_options (str, ARRAY_SIZE(ints), ints); + if (ints[0] > 0) + timeout = ints[1]; + + return 1; +} + +__setup("amd7xx_tco=", amdtco_setup); +#endif + +module_init(amdtco_init); +module_exit(amdtco_exit); + +MODULE_AUTHOR("Zwane Mwaikambo "); +MODULE_DESCRIPTION("AMD 766/768 TCO Timer Driver"); +MODULE_LICENSE("GPL"); +EXPORT_NO_SYMBOLS; + diff -urN linux-2.5.63-bk3/drivers/char/watchdog/ib700wdt.c linux-2.5.63-bk4/drivers/char/watchdog/ib700wdt.c --- linux-2.5.63-bk3/drivers/char/watchdog/ib700wdt.c Mon Feb 24 11:05:44 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/ib700wdt.c Mon Mar 31 12:18:08 2003 @@ -50,6 +50,8 @@ static spinlock_t ibwdt_lock; static int expect_close = 0; +#define PFX "ib700wdt: " + /* * * Watchdog Timer Configuration @@ -226,8 +228,6 @@ spin_unlock(&ibwdt_lock); return -EBUSY; } - if (nowayout) - MOD_INC_USE_COUNT; /* Activate */ ibwdt_is_open = 1; @@ -247,7 +247,7 @@ if (expect_close) outb_p(wd_times[wd_margin], WDT_STOP); else - printk(KERN_CRIT "WDT device closed unexpectedly. WDT will not stop!\n"); + printk(KERN_CRIT PFX "WDT device closed unexpectedly. WDT will not stop!\n"); ibwdt_is_open = 0; spin_unlock(&ibwdt_lock); @@ -300,29 +300,49 @@ .priority = 0 }; -static int __init -ibwdt_init(void) +static int __init ibwdt_init(void) { - printk("WDT driver for IB700 single board computer initialising.\n"); + int res; + + printk(KERN_INFO PFX "WDT driver for IB700 single board computer initialising.\n"); spin_lock_init(&ibwdt_lock); - if (misc_register(&ibwdt_miscdev)) - return -ENODEV; + res = misc_register(&ibwdt_miscdev); + if (res) { + printk (KERN_ERR PFX "failed to register misc device\n"); + goto out_nomisc; + } + #if WDT_START != WDT_STOP if (!request_region(WDT_STOP, 1, "IB700 WDT")) { - misc_deregister(&ibwdt_miscdev); - return -EIO; + printk (KERN_ERR PFX "STOP method I/O %X is not available.\n", WDT_STOP); + res = -EIO; + goto out_nostopreg; } #endif + if (!request_region(WDT_START, 1, "IB700 WDT")) { -#if WDT_START != WDT_STOP - release_region(WDT_STOP, 1); -#endif - misc_deregister(&ibwdt_miscdev); - return -EIO; + printk (KERN_ERR PFX "START method I/O %X is not available.\n", WDT_START); + res = -EIO; + goto out_nostartreg; + } + res = register_reboot_notifier(&ibwdt_notifier); + if (res) { + printk (KERN_ERR PFX "Failed to register reboot notifier.\n"); + goto out_noreboot; } - register_reboot_notifier(&ibwdt_notifier); return 0; + +out_noreboot: + release_region(WDT_START, 1); +out_nostartreg: +#if WDT_START != WDT_STOP + release_region(WDT_STOP, 1); +#endif +out_nostopreg: + misc_deregister(&ibwdt_miscdev); +out_nomisc: + return res; } static void __exit diff -urN linux-2.5.63-bk3/drivers/char/watchdog/indydog.c linux-2.5.63-bk4/drivers/char/watchdog/indydog.c --- linux-2.5.63-bk3/drivers/char/watchdog/indydog.c Mon Feb 24 11:05:44 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/indydog.c Mon Mar 31 12:18:08 2003 @@ -53,9 +53,6 @@ if( test_and_set_bit(0,&indydog_alive) ) return -EBUSY; - if (nowayout) - MOD_INC_USE_COUNT; - /* * Activate timer */ diff -urN linux-2.5.63-bk3/drivers/char/watchdog/machzwd.c linux-2.5.63-bk4/drivers/char/watchdog/machzwd.c --- linux-2.5.63-bk3/drivers/char/watchdog/machzwd.c Mon Feb 24 11:05:11 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/machzwd.c Mon Mar 31 12:18:08 2003 @@ -390,9 +390,6 @@ return -EBUSY; } - if (nowayout) - MOD_INC_USE_COUNT; - zf_is_open = 1; spin_unlock(&zf_lock); diff -urN linux-2.5.63-bk3/drivers/char/watchdog/mixcomwd.c linux-2.5.63-bk4/drivers/char/watchdog/mixcomwd.c --- linux-2.5.63-bk3/drivers/char/watchdog/mixcomwd.c Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/mixcomwd.c Mon Mar 31 12:18:08 2003 @@ -93,9 +93,7 @@ } mixcomwd_ping(); - if (nowayout) { - MOD_INC_USE_COUNT; - } else { + if (!nowayout) { if(mixcomwd_timer_alive) { del_timer(&mixcomwd_timer); mixcomwd_timer_alive=0; diff -urN linux-2.5.63-bk3/drivers/char/watchdog/pcwd.c linux-2.5.63-bk4/drivers/char/watchdog/pcwd.c --- linux-2.5.63-bk3/drivers/char/watchdog/pcwd.c Mon Feb 24 11:05:06 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/pcwd.c Mon Mar 31 12:18:08 2003 @@ -430,7 +430,7 @@ atomic_inc( &open_allowed ); return -EBUSY; } - MOD_INC_USE_COUNT; + /* Enable the port */ if (revision == PCWD_REVISION_C) { spin_lock(&io_lock); diff -urN linux-2.5.63-bk3/drivers/char/watchdog/sbc60xxwdt.c linux-2.5.63-bk4/drivers/char/watchdog/sbc60xxwdt.c --- linux-2.5.63-bk3/drivers/char/watchdog/sbc60xxwdt.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/sbc60xxwdt.c Mon Mar 31 12:18:08 2003 @@ -206,9 +206,7 @@ /* Just in case we're already talking to someone... */ if(wdt_is_open) return -EBUSY; - if (nowayout) { - MOD_INC_USE_COUNT; - } + /* Good, fire up the show */ wdt_is_open = 1; wdt_startup(); diff -urN linux-2.5.63-bk3/drivers/char/watchdog/sc520_wdt.c linux-2.5.63-bk4/drivers/char/watchdog/sc520_wdt.c --- linux-2.5.63-bk3/drivers/char/watchdog/sc520_wdt.c Mon Feb 24 11:05:31 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/sc520_wdt.c Mon Mar 31 12:18:08 2003 @@ -229,8 +229,6 @@ return -EBUSY; /* Good, fire up the show */ wdt_startup(); - if (nowayout) - MOD_INC_USE_COUNT; return 0; default: @@ -253,11 +251,6 @@ return 0; } -static long long fop_llseek(struct file *file, long long offset, int origin) -{ - return -ESPIPE; -} - static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -282,7 +275,7 @@ static struct file_operations wdt_fops = { .owner = THIS_MODULE, - .llseek = fop_llseek, + .llseek = no_llseek, .write = fop_write, .open = fop_open, .release = fop_close, diff -urN linux-2.5.63-bk3/drivers/char/watchdog/shwdt.c linux-2.5.63-bk4/drivers/char/watchdog/shwdt.c --- linux-2.5.63-bk3/drivers/char/watchdog/shwdt.c Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/shwdt.c Mon Mar 31 12:18:08 2003 @@ -1,9 +1,9 @@ /* * drivers/char/shwdt.c * - * Watchdog driver for integrated watchdog in the SuperH 3/4 processors. + * Watchdog driver for integrated watchdog in the SuperH processors. * - * Copyright (C) 2001 Paul Mundt + * Copyright (C) 2001, 2002 Paul Mundt * * 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 @@ -26,14 +26,17 @@ #include #include -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_CPU_SH5) + #define WTCNT CPRC_BASE + 0x10 + #define WTCSR CPRC_BASE + 0x18 +#elif defined(CONFIG_CPU_SH4) #define WTCNT 0xffc00008 #define WTCSR 0xffc0000c #elif defined(CONFIG_CPU_SH3) #define WTCNT 0xffffff84 #define WTCSR 0xffffff86 #else - #error "Can't use SH 3/4 watchdog on non-SH 3/4 processor." + #error "Can't use SuperH watchdog on this platform" #endif #define WTCNT_HIGH 0x5a00 @@ -186,10 +189,6 @@ if (test_and_set_bit(0, &sh_is_open)) return -EBUSY; - if (nowayout) { - MOD_INC_USE_COUNT; - } - sh_wdt_start(); break; @@ -405,8 +404,8 @@ misc_deregister(&sh_wdt_miscdev); } -MODULE_AUTHOR("Paul Mundt "); -MODULE_DESCRIPTION("SH 3/4 watchdog driver"); +MODULE_AUTHOR("Paul Mundt "); +MODULE_DESCRIPTION("SuperH watchdog driver"); MODULE_LICENSE("GPL"); MODULE_PARM(clock_division_ratio, "i"); MODULE_PARM_DESC(clock_division_ratio, "Clock division ratio. Valid ranges are from 0x5 (1.31ms) to 0x7 (5.25ms). Defaults to 0x7."); diff -urN linux-2.5.63-bk3/drivers/char/watchdog/softdog.c linux-2.5.63-bk4/drivers/char/watchdog/softdog.c --- linux-2.5.63-bk3/drivers/char/watchdog/softdog.c Mon Feb 24 11:05:29 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/softdog.c Mon Mar 31 12:18:08 2003 @@ -103,9 +103,7 @@ { if(test_and_set_bit(0, &timer_alive)) return -EBUSY; - if (nowayout) { - MOD_INC_USE_COUNT; - } + /* * Activate timer */ diff -urN linux-2.5.63-bk3/drivers/char/watchdog/wdt977.c linux-2.5.63-bk4/drivers/char/watchdog/wdt977.c --- linux-2.5.63-bk3/drivers/char/watchdog/wdt977.c Mon Feb 24 11:05:40 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/wdt977.c Mon Mar 31 12:18:08 2003 @@ -99,8 +99,6 @@ if (nowayout) { - MOD_INC_USE_COUNT; - /* do not permit disabling the watchdog by writing 0 to reg. 0xF2 */ if (!timeoutM) timeoutM = DEFAULT_TIMEOUT; } diff -urN linux-2.5.63-bk3/drivers/char/watchdog/wdt_pci.c linux-2.5.63-bk4/drivers/char/watchdog/wdt_pci.c --- linux-2.5.63-bk3/drivers/char/watchdog/wdt_pci.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/drivers/char/watchdog/wdt_pci.c Mon Mar 31 12:18:08 2003 @@ -365,9 +365,6 @@ if (down_trylock(&open_sem)) return -EBUSY; - if (nowayout) { - MOD_INC_USE_COUNT; - } /* * Activate */ diff -urN linux-2.5.63-bk3/drivers/ide/pci/triflex.h linux-2.5.63-bk4/drivers/ide/pci/triflex.h --- linux-2.5.63-bk3/drivers/ide/pci/triflex.h Mon Feb 24 11:05:38 2003 +++ linux-2.5.63-bk4/drivers/ide/pci/triflex.h Mon Mar 31 12:18:08 2003 @@ -18,31 +18,26 @@ static ide_pci_device_t triflex_devices[] __devinitdata = { { - .vendor PCI_VENDOR_ID_COMPAQ, - .device PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE, - .name "TRIFLEX", - .init_chipset init_chipset_triflex, - .init_iops NULL, - .init_hwif init_hwif_triflex, - .channels 2, - .autodma AUTODMA, - .enablebits {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, - .bootable ON_BOARD, - .extra 0, + .vendor = PCI_VENDOR_ID_COMPAQ, + .device = PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE, + .name = "TRIFLEX", + .init_chipset = init_chipset_triflex, + .init_iops = NULL, + .init_hwif = init_hwif_triflex, + .channels = 2, + .autodma = AUTODMA, + .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, + .bootable = ON_BOARD, },{ - .vendor 0, - .device 0, - .channels 0, - .bootable EOL, + .bootable = EOL, } }; #ifdef CONFIG_PROC_FS static ide_pci_host_proc_t triflex_proc __initdata = { - name: "triflex", - set: 1, - get_info: triflex_get_info, - parent: NULL, + .name = "triflex", + .set = 1, + .get_info = triflex_get_info, }; #endif diff -urN linux-2.5.63-bk3/drivers/md/dm-ioctl.c linux-2.5.63-bk4/drivers/md/dm-ioctl.c --- linux-2.5.63-bk3/drivers/md/dm-ioctl.c Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/drivers/md/dm-ioctl.c Mon Mar 31 12:18:08 2003 @@ -173,14 +173,18 @@ */ static int register_with_devfs(struct hash_cell *hc) { - char name[32]; struct gendisk *disk = dm_disk(hc->md); + char *name = kmalloc(DM_NAME_LEN + strlen(DM_DIR) + 1, GFP_KERNEL); + if (!name) { + return -ENOMEM; + } sprintf(name, DM_DIR "/%s", hc->name); devfs_register(NULL, name, DEVFS_FL_CURRENT_OWNER, disk->major, disk->first_minor, S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, &dm_blk_dops, NULL); + kfree(name); return 0; } @@ -545,7 +549,7 @@ static int check_name(const char *name) { - if (strchr(name, '/')) { + if (name[0] == '/') { DMWARN("invalid device name"); return -EINVAL; } @@ -887,6 +891,7 @@ dm_table_put(t); return r; } + dm_table_put(t); /* md will have taken its own reference */ set_disk_ro(dm_disk(md), (param->flags & DM_READONLY_FLAG)); dm_put(md); @@ -1122,17 +1127,17 @@ return 0; failed: + devfs_remove(DM_DIR "/control"); + if (misc_deregister(&_dm_misc) < 0) + DMERR("misc_deregister failed for control device"); dm_hash_exit(); - misc_deregister(&_dm_misc); return r; } void dm_interface_exit(void) { - dm_hash_exit(); - devfs_remove(DM_DIR "/control"); - if (misc_deregister(&_dm_misc) < 0) DMERR("misc_deregister failed for control device"); + dm_hash_exit(); } diff -urN linux-2.5.63-bk3/drivers/md/dm-table.c linux-2.5.63-bk4/drivers/md/dm-table.c --- linux-2.5.63-bk3/drivers/md/dm-table.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/drivers/md/dm-table.c Mon Mar 31 12:18:08 2003 @@ -79,7 +79,7 @@ } #define __HIGH(l, r) if (*(l) < (r)) *(l) = (r) -#define __LOW(l, r) if (*(l) < (r)) *(l) = (r) +#define __LOW(l, r) if (*(l) == 0 || *(l) > (r)) *(l) = (r) /* * Combine two io_restrictions, always taking the lower value. @@ -591,7 +591,7 @@ tgt->type = dm_get_target_type(type); if (!tgt->type) { tgt->error = "unknown target type"; - goto bad; + return -EINVAL; } tgt->table = t; @@ -604,6 +604,7 @@ */ if (!adjoin(t, tgt)) { tgt->error = "Gap in table"; + r = -EINVAL; goto bad; } diff -urN linux-2.5.63-bk3/drivers/mtd/chips/amd_flash.c linux-2.5.63-bk4/drivers/mtd/chips/amd_flash.c --- linux-2.5.63-bk3/drivers/mtd/chips/amd_flash.c Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/amd_flash.c Mon Mar 31 12:18:08 2003 @@ -120,10 +120,10 @@ static struct mtd_chip_driver amd_flash_chipdrv = { - probe: amd_flash_probe, - destroy: amd_flash_destroy, - name: "amd_flash", - module: THIS_MODULE + .probe = amd_flash_probe, + .destroy = amd_flash_destroy, + .name = "amd_flash", + .module = THIS_MODULE }; @@ -424,194 +424,194 @@ */ const struct amd_flash_info table[] = { { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DT, - name: "AMD AM29LV160DT", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DB, - name: "AMD AM29LV160DB", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } - } - }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVT160, - name: "Toshiba TC58FVT160", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160TE, - name: "Fujitsu MBM29LV160TE", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVB160, - name: "Toshiba TC58FVB160", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } - } - }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160BE, - name: "Fujitsu MBM29LV160BE", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 15 } - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BB, - name: "AMD AM29F800BB", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 15 } - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BT, - name: "AMD AM29LV800BT", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BT, - name: "AMD AM29F800BT", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W800T, - name: "ST M29W800T", - size: 0x00100000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x0F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x0F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x0FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DT, - name: "ST M29W160DT", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x1F0000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x1F8000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x1FC000, erasesize: 0x04000, numblocks: 1 } - } - }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DB, - name: "ST M29W160DB", - size: 0x00200000, - numeraseregions: 4, - regions: { - { offset: 0x000000, erasesize: 0x04000, numblocks: 1 }, - { offset: 0x004000, erasesize: 0x02000, numblocks: 2 }, - { offset: 0x008000, erasesize: 0x08000, numblocks: 1 }, - { offset: 0x010000, erasesize: 0x10000, numblocks: 31 } - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29BDS323D, - name: "AMD AM29BDS323D", - size: 0x00400000, - numeraseregions: 3, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 48 }, - { offset: 0x300000, erasesize: 0x10000, numblocks: 15 }, - { offset: 0x3f0000, erasesize: 0x02000, numblocks: 8 }, - } - }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29BDS643D, - name: "AMD AM29BDS643D", - size: 0x00800000, - numeraseregions: 3, - regions: { - { offset: 0x000000, erasesize: 0x10000, numblocks: 96 }, - { offset: 0x600000, erasesize: 0x10000, numblocks: 31 }, - { offset: 0x7f0000, erasesize: 0x02000, numblocks: 8 }, + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DT, + .name = "AMD AM29LV160DT", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DB, + .name = "AMD AM29LV160DB", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } + } + }, { + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVT160, + .name = "Toshiba TC58FVT160", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160TE, + .name = "Fujitsu MBM29LV160TE", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVB160, + .name = "Toshiba TC58FVB160", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } + } + }, { + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160BE, + .name = "Fujitsu MBM29LV160BE", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 15 } + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BB, + .name = "AMD AM29F800BB", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 15 } + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BT, + .name = "AMD AM29LV800BT", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BT, + .name = "AMD AM29F800BT", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W800T, + .name = "ST M29W800T", + .size = 0x00100000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x0F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x0F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x0FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DT, + .name = "ST M29W160DT", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x1F0000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x1F8000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x1FC000, .erasesize = 0x04000, .numblocks = 1 } + } + }, { + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DB, + .name = "ST M29W160DB", + .size = 0x00200000, + .numeraseregions = 4, + .regions = { + { .offset = 0x000000, .erasesize = 0x04000, .numblocks = 1 }, + { .offset = 0x004000, .erasesize = 0x02000, .numblocks = 2 }, + { .offset = 0x008000, .erasesize = 0x08000, .numblocks = 1 }, + { .offset = 0x010000, .erasesize = 0x10000, .numblocks = 31 } + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29BDS323D, + .name = "AMD AM29BDS323D", + .size = 0x00400000, + .numeraseregions = 3, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 48 }, + { .offset = 0x300000, .erasesize = 0x10000, .numblocks = 15 }, + { .offset = 0x3f0000, .erasesize = 0x02000, .numblocks = 8 }, + } + }, { + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29BDS643D, + .name = "AMD AM29BDS643D", + .size = 0x00800000, + .numeraseregions = 3, + .regions = { + { .offset = 0x000000, .erasesize = 0x10000, .numblocks = 96 }, + { .offset = 0x600000, .erasesize = 0x10000, .numblocks = 31 }, + { .offset = 0x7f0000, .erasesize = 0x02000, .numblocks = 8 }, } } }; diff -urN linux-2.5.63-bk3/drivers/mtd/chips/cfi_cmdset_0001.c linux-2.5.63-bk4/drivers/mtd/chips/cfi_cmdset_0001.c --- linux-2.5.63-bk3/drivers/mtd/chips/cfi_cmdset_0001.c Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/cfi_cmdset_0001.c Mon Mar 31 12:18:08 2003 @@ -47,10 +47,10 @@ static struct mtd_info *cfi_intelext_setup (struct map_info *); static struct mtd_chip_driver cfi_intelext_chipdrv = { - probe: NULL, /* Not usable directly */ - destroy: cfi_intelext_destroy, - name: "cfi_cmdset_0001", - module: THIS_MODULE + .probe = NULL, /* Not usable directly */ + .destroy = cfi_intelext_destroy, + .name = "cfi_cmdset_0001", + .module = THIS_MODULE }; /* #define DEBUG_LOCK_BITS */ diff -urN linux-2.5.63-bk3/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.5.63-bk4/drivers/mtd/chips/cfi_cmdset_0002.c --- linux-2.5.63-bk3/drivers/mtd/chips/cfi_cmdset_0002.c Mon Feb 24 11:05:29 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/cfi_cmdset_0002.c Mon Mar 31 12:18:08 2003 @@ -43,10 +43,10 @@ static struct mtd_chip_driver cfi_amdstd_chipdrv = { - probe: NULL, /* Not usable directly */ - destroy: cfi_amdstd_destroy, - name: "cfi_cmdset_0002", - module: THIS_MODULE + .probe = NULL, /* Not usable directly */ + .destroy = cfi_amdstd_destroy, + .name = "cfi_cmdset_0002", + .module = THIS_MODULE }; struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) diff -urN linux-2.5.63-bk3/drivers/mtd/chips/cfi_probe.c linux-2.5.63-bk4/drivers/mtd/chips/cfi_probe.c --- linux-2.5.63-bk3/drivers/mtd/chips/cfi_probe.c Mon Feb 24 11:05:39 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/cfi_probe.c Mon Mar 31 12:18:08 2003 @@ -294,8 +294,8 @@ #endif /* DEBUG_CFI */ static struct chip_probe cfi_chip_probe = { - name: "CFI", - probe_chip: cfi_probe_chip + .name = "CFI", + .probe_chip = cfi_probe_chip }; struct mtd_info *cfi_probe(struct map_info *map) @@ -308,9 +308,9 @@ } static struct mtd_chip_driver cfi_chipdrv = { - probe: cfi_probe, - name: "cfi_probe", - module: THIS_MODULE + .probe = cfi_probe, + .name = "cfi_probe", + .module = THIS_MODULE }; int __init cfi_probe_init(void) diff -urN linux-2.5.63-bk3/drivers/mtd/chips/jedec.c linux-2.5.63-bk4/drivers/mtd/chips/jedec.c --- linux-2.5.63-bk3/drivers/mtd/chips/jedec.c Mon Feb 24 11:05:34 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/jedec.c Mon Mar 31 12:18:08 2003 @@ -33,14 +33,51 @@ /* Listing of parts and sizes. We need this table to learn the sector size of the chip and the total length */ -static const struct JEDECTable JEDEC_table[] = - {{0x013D,"AMD Am29F017D",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {0x01AD,"AMD Am29F016",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {0x01D5,"AMD Am29F080",1*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {0x01A4,"AMD Am29F040",512*1024,64*1024,MTD_CAP_NORFLASH}, - {0x20E3,"AMD Am29W040B",512*1024,64*1024,MTD_CAP_NORFLASH}, - {0xC2AD,"Macronix MX29F016",2*1024*1024,64*1024,MTD_CAP_NORFLASH}, - {}}; +static const struct JEDECTable JEDEC_table[] = { + { + .jedec = 0x013D, + .name = "AMD Am29F017D", + .size = 2*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x01AD, + .name = "AMD Am29F016", + .size = 2*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x01D5, + .name = "AMD Am29F080", + .size = 1*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x01A4, + .name = "AMD Am29F040", + .size = 512*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0x20E3, + .name = "AMD Am29W040B", + .size = 512*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { + .jedec = 0xC2AD, + .name = "Macronix MX29F016", + .size = 2*1024*1024, + .sectorsize = 64*1024, + .capabilities = MTD_CAP_NORFLASH + }, + { .jedec = 0x0 } +}; static const struct JEDECTable *jedec_idtoinf(__u8 mfr,__u8 id); static void jedec_sync(struct mtd_info *mtd) {}; @@ -54,9 +91,9 @@ static struct mtd_chip_driver jedec_chipdrv = { - probe: jedec_probe, - name: "jedec", - module: THIS_MODULE + .probe = jedec_probe, + .name = "jedec", + .module = THIS_MODULE }; /* Probe entry point */ diff -urN linux-2.5.63-bk3/drivers/mtd/chips/jedec_probe.c linux-2.5.63-bk4/drivers/mtd/chips/jedec_probe.c --- linux-2.5.63-bk3/drivers/mtd/chips/jedec_probe.c Mon Feb 24 11:06:02 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/jedec_probe.c Mon Mar 31 12:18:08 2003 @@ -75,176 +75,176 @@ static const struct amd_flash_info jedec_table[] = { { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DT, - name: "AMD AM29LV160DT", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DT, + .name = "AMD AM29LV160DT", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV160DB, - name: "AMD AM29LV160DB", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV160DB, + .name = "AMD AM29LV160DB", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVT160, - name: "Toshiba TC58FVT160", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVT160, + .name = "Toshiba TC58FVT160", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160TE, - name: "Fujitsu MBM29LV160TE", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160TE, + .name = "Fujitsu MBM29LV160TE", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_TOSHIBA, - dev_id: TC58FVB160, - name: "Toshiba TC58FVB160", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_TOSHIBA, + .dev_id = TC58FVB160, + .name = "Toshiba TC58FVB160", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_FUJITSU, - dev_id: MBM29LV160BE, - name: "Fujitsu MBM29LV160BE", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_FUJITSU, + .dev_id = MBM29LV160BE, + .name = "Fujitsu MBM29LV160BE", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,15), } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BB, - name: "AMD AM29F800BB", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BB, + .name = "AMD AM29F800BB", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,15), } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BT, - name: "AMD AM29LV800BT", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BT, + .name = "AMD AM29LV800BT", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29F800BT, - name: "AMD AM29F800BT", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29F800BT, + .name = "AMD AM29F800BT", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_AMD, - dev_id: AM29LV800BB, - name: "AMD AM29LV800BB", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_AMD, + .dev_id = AM29LV800BB, + .name = "AMD AM29LV800BB", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W800T, - name: "ST M29W800T", - DevSize: SIZE_1MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,15), + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W800T, + .name = "ST M29W800T", + .DevSize = SIZE_1MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,15), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DT, - name: "ST M29W160DT", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x10000,31), + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DT, + .name = "ST M29W160DT", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x10000,31), ERASEINFO(0x08000,1), ERASEINFO(0x02000,2), ERASEINFO(0x04000,1) } }, { - mfr_id: MANUFACTURER_ST, - dev_id: M29W160DB, - name: "ST M29W160DB", - DevSize: SIZE_2MiB, - NumEraseRegions: 4, - regions: {ERASEINFO(0x04000,1), + .mfr_id = MANUFACTURER_ST, + .dev_id = M29W160DB, + .name = "ST M29W160DB", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 4, + .regions = {ERASEINFO(0x04000,1), ERASEINFO(0x02000,2), ERASEINFO(0x08000,1), ERASEINFO(0x10000,31) } }, { - mfr_id: MANUFACTURER_ATMEL, - dev_id: AT49BV16X4, - name: "Atmel AT49BV16X4", - DevSize: SIZE_2MiB, - NumEraseRegions: 3, - regions: {ERASEINFO(0x02000,8), + .mfr_id = MANUFACTURER_ATMEL, + .dev_id = AT49BV16X4, + .name = "Atmel AT49BV16X4", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 3, + .regions = {ERASEINFO(0x02000,8), ERASEINFO(0x08000,2), ERASEINFO(0x10000,30) } }, { - mfr_id: MANUFACTURER_ATMEL, - dev_id: AT49BV16X4T, - name: "Atmel AT49BV16X4T", - DevSize: SIZE_2MiB, - NumEraseRegions: 3, - regions: {ERASEINFO(0x10000,30), + .mfr_id = MANUFACTURER_ATMEL, + .dev_id = AT49BV16X4T, + .name = "Atmel AT49BV16X4T", + .DevSize = SIZE_2MiB, + .NumEraseRegions = 3, + .regions = {ERASEINFO(0x10000,30), ERASEINFO(0x08000,2), ERASEINFO(0x02000,8) } @@ -403,8 +403,8 @@ } static struct chip_probe jedec_chip_probe = { - name: "JEDEC", - probe_chip: jedec_probe_chip + .name = "JEDEC", + .probe_chip = jedec_probe_chip }; struct mtd_info *jedec_probe(struct map_info *map) @@ -417,9 +417,9 @@ } static struct mtd_chip_driver jedec_chipdrv = { - probe: jedec_probe, - name: "jedec_probe", - module: THIS_MODULE + .probe = jedec_probe, + .name = "jedec_probe", + .module = THIS_MODULE }; int __init jedec_probe_init(void) diff -urN linux-2.5.63-bk3/drivers/mtd/chips/map_absent.c linux-2.5.63-bk4/drivers/mtd/chips/map_absent.c --- linux-2.5.63-bk3/drivers/mtd/chips/map_absent.c Mon Feb 24 11:05:38 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/map_absent.c Mon Mar 31 12:18:08 2003 @@ -36,10 +36,10 @@ static struct mtd_chip_driver map_absent_chipdrv = { - probe: map_absent_probe, - destroy: map_absent_destroy, - name: "map_absent", - module: THIS_MODULE + .probe = map_absent_probe, + .destroy = map_absent_destroy, + .name = "map_absent", + .module = THIS_MODULE }; static struct mtd_info *map_absent_probe(struct map_info *map) diff -urN linux-2.5.63-bk3/drivers/mtd/chips/map_ram.c linux-2.5.63-bk4/drivers/mtd/chips/map_ram.c --- linux-2.5.63-bk3/drivers/mtd/chips/map_ram.c Mon Feb 24 11:05:15 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/map_ram.c Mon Mar 31 12:18:08 2003 @@ -23,9 +23,9 @@ static struct mtd_chip_driver mapram_chipdrv = { - probe: map_ram_probe, - name: "map_ram", - module: THIS_MODULE + .probe = map_ram_probe, + .name = "map_ram", + .module = THIS_MODULE }; static struct mtd_info *map_ram_probe(struct map_info *map) diff -urN linux-2.5.63-bk3/drivers/mtd/chips/map_rom.c linux-2.5.63-bk4/drivers/mtd/chips/map_rom.c --- linux-2.5.63-bk3/drivers/mtd/chips/map_rom.c Mon Feb 24 11:05:35 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/map_rom.c Mon Mar 31 12:18:08 2003 @@ -21,9 +21,9 @@ struct mtd_info *map_rom_probe(struct map_info *map); static struct mtd_chip_driver maprom_chipdrv = { - probe: map_rom_probe, - name: "map_rom", - module: THIS_MODULE + .probe = map_rom_probe, + .name = "map_rom", + .module = THIS_MODULE }; struct mtd_info *map_rom_probe(struct map_info *map) diff -urN linux-2.5.63-bk3/drivers/mtd/chips/sharp.c linux-2.5.63-bk4/drivers/mtd/chips/sharp.c --- linux-2.5.63-bk3/drivers/mtd/chips/sharp.c Mon Feb 24 11:05:34 2003 +++ linux-2.5.63-bk4/drivers/mtd/chips/sharp.c Mon Mar 31 12:18:08 2003 @@ -98,10 +98,10 @@ static void sharp_destroy(struct mtd_info *mtd); static struct mtd_chip_driver sharp_chipdrv = { - probe: sharp_probe, - destroy: sharp_destroy, - name: "sharp", - module: THIS_MODULE + .probe = sharp_probe, + .destroy = sharp_destroy, + .name = "sharp", + .module = THIS_MODULE }; diff -urN linux-2.5.63-bk3/drivers/mtd/ftl.c linux-2.5.63-bk4/drivers/mtd/ftl.c --- linux-2.5.63-bk3/drivers/mtd/ftl.c Mon Feb 24 11:05:40 2003 +++ linux-2.5.63-bk4/drivers/mtd/ftl.c Mon Mar 31 12:18:08 2003 @@ -155,8 +155,8 @@ void ftl_freepart(partition_t *part); static struct mtd_notifier ftl_notifier = { - add: ftl_notify_add, - remove: ftl_notify_remove, + .add = ftl_notify_add, + .remove = ftl_notify_remove, }; /* Partition state flags */ diff -urN linux-2.5.63-bk3/drivers/mtd/maps/autcpu12-nvram.c linux-2.5.63-bk4/drivers/mtd/maps/autcpu12-nvram.c --- linux-2.5.63-bk3/drivers/mtd/maps/autcpu12-nvram.c Mon Feb 24 11:05:44 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/autcpu12-nvram.c Mon Mar 31 12:18:08 2003 @@ -83,17 +83,17 @@ static struct mtd_info *sram_mtd; struct map_info autcpu12_sram_map = { - name: "SRAM", - size: 32768, - buswidth: 8, - read8: autcpu12_read8, - read16: autcpu12_read16, - read32: autcpu12_read32, - copy_from: autcpu12_copy_from, - write8: autcpu12_write8, - write16: autcpu12_write16, - write32: autcpu12_write32, - copy_to: autcpu12_copy_to + .name = "SRAM", + .size = 32768, + .buswidth = 8, + .read8 = autcpu12_read8, + .read16 = autcpu12_read16, + .read32 = autcpu12_read32, + .copy_from = autcpu12_copy_from, + .write8 = autcpu12_write8, + .write16 = autcpu12_write16, + .write32 = autcpu12_write32, + .copy_to = autcpu12_copy_to }; static int __init init_autcpu12_sram (void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/cdb89712.c linux-2.5.63-bk4/drivers/mtd/maps/cdb89712.c --- linux-2.5.63-bk3/drivers/mtd/maps/cdb89712.c Mon Feb 24 11:06:02 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/cdb89712.c Mon Mar 31 12:18:08 2003 @@ -14,8 +14,6 @@ #include #include - - __u8 cdb89712_read8(struct map_info *map, unsigned long ofs) { return __raw_readb(map->map_priv_1 + ofs); @@ -65,28 +63,27 @@ } } - static struct mtd_info *flash_mtd; struct map_info cdb89712_flash_map = { - name: "flash", - size: FLASH_SIZE, - buswidth: FLASH_WIDTH, - read8: cdb89712_read8, - read16: cdb89712_read16, - read32: cdb89712_read32, - copy_from: cdb89712_copy_from, - write8: cdb89712_write8, - write16: cdb89712_write16, - write32: cdb89712_write32, - copy_to: cdb89712_copy_to + .name = "flash", + .size = FLASH_SIZE, + .buswidth = FLASH_WIDTH, + .read8 = cdb89712_read8, + .read16 = cdb89712_read16, + .read32 = cdb89712_read32, + .copy_from = cdb89712_copy_from, + .write8 = cdb89712_write8, + .write16 = cdb89712_write16, + .write32 = cdb89712_write32, + .copy_to = cdb89712_copy_to }; struct resource cdb89712_flash_resource = { - name: "Flash", - start: FLASH_START, - end: FLASH_START + FLASH_SIZE - 1, - flags: IORESOURCE_IO | IORESOURCE_BUSY, + .name = "Flash", + .start = FLASH_START, + .end = FLASH_START + FLASH_SIZE - 1, + .flags = IORESOURCE_IO | IORESOURCE_BUSY, }; static int __init init_cdb89712_flash (void) @@ -139,31 +136,27 @@ return err; } - - - - static struct mtd_info *sram_mtd; struct map_info cdb89712_sram_map = { - name: "SRAM", - size: SRAM_SIZE, - buswidth: SRAM_WIDTH, - read8: cdb89712_read8, - read16: cdb89712_read16, - read32: cdb89712_read32, - copy_from: cdb89712_copy_from, - write8: cdb89712_write8, - write16: cdb89712_write16, - write32: cdb89712_write32, - copy_to: cdb89712_copy_to + .name = "SRAM", + .size = SRAM_SIZE, + .buswidth = SRAM_WIDTH, + .read8 = cdb89712_read8, + .read16 = cdb89712_read16, + .read32 = cdb89712_read32, + .copy_from = cdb89712_copy_from, + .write8 = cdb89712_write8, + .write16 = cdb89712_write16, + .write32 = cdb89712_write32, + .copy_to = cdb89712_copy_to }; struct resource cdb89712_sram_resource = { - name: "SRAM", - start: SRAM_START, - end: SRAM_START + SRAM_SIZE - 1, - flags: IORESOURCE_IO | IORESOURCE_BUSY, + .name = "SRAM", + .start = SRAM_START, + .end = SRAM_START + SRAM_SIZE - 1, + .flags = IORESOURCE_IO | IORESOURCE_BUSY, }; static int __init init_cdb89712_sram (void) @@ -212,29 +205,23 @@ return err; } - - - - - - static struct mtd_info *bootrom_mtd; struct map_info cdb89712_bootrom_map = { - name: "BootROM", - size: BOOTROM_SIZE, - buswidth: BOOTROM_WIDTH, - read8: cdb89712_read8, - read16: cdb89712_read16, - read32: cdb89712_read32, - copy_from: cdb89712_copy_from, + .name = "BootROM", + .size = BOOTROM_SIZE, + .buswidth = BOOTROM_WIDTH, + .read8 = cdb89712_read8, + .read16 = cdb89712_read16, + .read32 = cdb89712_read32, + .copy_from = cdb89712_copy_from, }; struct resource cdb89712_bootrom_resource = { - name: "BootROM", - start: BOOTROM_START, - end: BOOTROM_START + BOOTROM_SIZE - 1, - flags: IORESOURCE_IO | IORESOURCE_BUSY, + .name = "BootROM", + .start = BOOTROM_START, + .end = BOOTROM_START + BOOTROM_SIZE - 1, + .flags = IORESOURCE_IO | IORESOURCE_BUSY, }; static int __init init_cdb89712_bootrom (void) @@ -283,10 +270,6 @@ return err; } - - - - static int __init init_cdb89712_maps(void) { diff -urN linux-2.5.63-bk3/drivers/mtd/maps/ceiva.c linux-2.5.63-bk4/drivers/mtd/maps/ceiva.c --- linux-2.5.63-bk3/drivers/mtd/maps/ceiva.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/ceiva.c Mon Mar 31 12:18:08 2003 @@ -76,15 +76,15 @@ } static struct map_info clps_map __initdata = { - name: "clps flash", - read8: clps_read8, - read16: clps_read16, - read32: clps_read32, - copy_from: clps_copy_from, - write8: clps_write8, - write16: clps_write16, - write32: clps_write32, - copy_to: clps_copy_to, + .name = "clps flash", + .read8 = clps_read8, + .read16 = clps_read16, + .read32 = clps_read32, + .copy_from = clps_copy_from, + .write8 = clps_write8, + .write16 = clps_write16, + .write32 = clps_write32, + .copy_to = clps_copy_to, }; #ifdef CONFIG_MTD_CEIVA_STATICMAP @@ -115,23 +115,25 @@ static struct mtd_partition ceiva_partitions[] = { { - name: "Ceiva BOOT partition", - size: BOOT_PARTITION_SIZE_KiB*1024, - offset: 0, - - },{ - name: "Ceiva parameters partition", - size: PARAMS_PARTITION_SIZE_KiB*1024, - offset: (16 + 8) * 1024, - },{ - name: "Ceiva kernel partition", - size: (KERNEL_PARTITION_SIZE_KiB)*1024, - offset: 0x20000, - - },{ - name: "Ceiva root filesystem partition", - offset: MTDPART_OFS_APPEND, - size: (ROOT_PARTITION_SIZE_KiB)*1024, + .name = "Ceiva BOOT partition", + .size = BOOT_PARTITION_SIZE_KiB*1024, + + }, + { + .name = "Ceiva parameters partition", + .size = PARAMS_PARTITION_SIZE_KiB*1024, + .offset = (16 + 8) * 1024, + }, + { + .name = "Ceiva kernel partition", + .size = (KERNEL_PARTITION_SIZE_KiB)*1024, + .offset = 0x20000, + + }, + { + .name = "Ceiva root filesystem partition", + .offset = MTDPART_OFS_APPEND, + .size = (ROOT_PARTITION_SIZE_KiB)*1024, } }; #endif diff -urN linux-2.5.63-bk3/drivers/mtd/maps/cfi_flagadm.c linux-2.5.63-bk4/drivers/mtd/maps/cfi_flagadm.c --- linux-2.5.63-bk3/drivers/mtd/maps/cfi_flagadm.c Mon Feb 24 11:05:04 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/cfi_flagadm.c Mon Mar 31 12:18:08 2003 @@ -99,39 +99,39 @@ } struct map_info flagadm_map = { - name: "FlagaDM flash device", - size: FLASH_SIZE, - buswidth: 2, - read8: flagadm_read8, - read16: flagadm_read16, - read32: flagadm_read32, - copy_from: flagadm_copy_from, - write8: flagadm_write8, - write16: flagadm_write16, - write32: flagadm_write32, - copy_to: flagadm_copy_to + .name = "FlagaDM flash device", + .size = FLASH_SIZE, + .buswidth = 2, + .read8 = flagadm_read8, + .read16 = flagadm_read16, + .read32 = flagadm_read32, + .copy_from = flagadm_copy_from, + .write8 = flagadm_write8, + .write16 = flagadm_write16, + .write32 = flagadm_write32, + .copy_to = flagadm_copy_to }; struct mtd_partition flagadm_parts[] = { { - name : "Bootloader", - offset : FLASH_PARTITION0_ADDR, - size : FLASH_PARTITION0_SIZE + .name = "Bootloader", + .offset = FLASH_PARTITION0_ADDR, + .size = FLASH_PARTITION0_SIZE }, { - name : "Kernel image", - offset : FLASH_PARTITION1_ADDR, - size : FLASH_PARTITION1_SIZE + .name = "Kernel image", + .offset = FLASH_PARTITION1_ADDR, + .size = FLASH_PARTITION1_SIZE }, { - name : "Initial ramdisk image", - offset : FLASH_PARTITION2_ADDR, - size : FLASH_PARTITION2_SIZE + .name = "Initial ramdisk image", + .offset = FLASH_PARTITION2_ADDR, + .size = FLASH_PARTITION2_SIZE }, { - name : "Persistant storage", - offset : FLASH_PARTITION3_ADDR, - size : FLASH_PARTITION3_SIZE + .name = "Persistant storage", + .offset = FLASH_PARTITION3_ADDR, + .size = FLASH_PARTITION3_SIZE } }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/cstm_mips_ixx.c linux-2.5.63-bk4/drivers/mtd/maps/cstm_mips_ixx.c --- linux-2.5.63-bk3/drivers/mtd/maps/cstm_mips_ixx.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/cstm_mips_ixx.c Mon Mar 31 12:18:08 2003 @@ -132,20 +132,15 @@ } const struct map_info basic_cstm_mips_ixx_map = { - NULL, - 0, - 0, - cstm_mips_ixx_read8, - cstm_mips_ixx_read16, - cstm_mips_ixx_read32, - cstm_mips_ixx_copy_from, - cstm_mips_ixx_write8, - cstm_mips_ixx_write16, - cstm_mips_ixx_write32, - cstm_mips_ixx_copy_to, - cstm_mips_ixx_set_vpp, - 0, - 0 + .read8 = cstm_mips_ixx_read8, + .read16 = cstm_mips_ixx_read16, + .read32 = cstm_mips_ixx_read32, + .copy_from = cstm_mips_ixx_copy_from, + .write8 = cstm_mips_ixx_write8, + .write16 = cstm_mips_ixx_write16, + .write32 = cstm_mips_ixx_write32, + .copy_to = cstm_mips_ixx_copy_to, + .set_vpp = cstm_mips_ixx_set_vpp, }; /* board and partition description */ @@ -175,9 +170,8 @@ static struct mtd_partition cstm_mips_ixx_partitions[PHYSMAP_NUMBER][MAX_PHYSMAP_PARTITIONS] = { { // 28F128J3A in 2x16 configuration { - name: "main partition ", - size: 0x02000000, // 128 x 2 x 128k byte sectors - offset: 0, + .name = "main partition ", + .size = 0x02000000, // 128 x 2 x 128k byte sectors }, }, }; @@ -197,9 +191,8 @@ static struct mtd_partition cstm_mips_ixx_partitions[PHYSMAP_NUMBER][MAX_PHYSMAP_PARTITIONS] = { { { - name: "main partition", - size: CONFIG_MTD_CSTM_MIPS_IXX_LEN, - offset: 0, + .name = "main partition", + .size = CONFIG_MTD_CSTM_MIPS_IXX_LEN, }, }, }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/dbox2-flash.c linux-2.5.63-bk4/drivers/mtd/maps/dbox2-flash.c --- linux-2.5.63-bk3/drivers/mtd/maps/dbox2-flash.c Mon Feb 24 11:05:47 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/dbox2-flash.c Mon Mar 31 12:18:08 2003 @@ -16,22 +16,28 @@ /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]= {{name: "BR bootloader", // raw - size: 128 * 1024, - offset: 0, - mask_flags: MTD_WRITEABLE}, - {name: "PPC bootloader", // flfs - size: 128 * 1024, - offset: MTDPART_OFS_APPEND, - mask_flags: 0}, - {name: "Kernel", // idxfs - size: 768 * 1024, - offset: MTDPART_OFS_APPEND, - mask_flags: 0}, - {name: "System", // jffs - size: MTDPART_SIZ_FULL, - offset: MTDPART_OFS_APPEND, - mask_flags: 0}}; +static struct mtd_partition partition_info[]= { + { + .name = "BR bootloader", /* raw */ + .size = 128 * 1024, + .mask_flags = MTD_WRITEABLE + }, + { + .name = "PPC bootloader", /* flfs */ + .size = 128 * 1024, + .offset = MTDPART_OFS_APPEND, + }, + { + .name = "Kernel", /* idxfs */ + .size = 768 * 1024, + .offset = MTDPART_OFS_APPEND, + }, + { + .name = "System", /* jffs */ + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, + } +}; #define NUM_PARTITIONS (sizeof(partition_info) / sizeof(partition_info[0])) @@ -84,17 +90,17 @@ } struct map_info dbox2_flash_map = { - name: "D-Box 2 flash memory", - size: WINDOW_SIZE, - buswidth: 4, - read8: dbox2_flash_read8, - read16: dbox2_flash_read16, - read32: dbox2_flash_read32, - copy_from: dbox2_flash_copy_from, - write8: dbox2_flash_write8, - write16: dbox2_flash_write16, - write32: dbox2_flash_write32, - copy_to: dbox2_flash_copy_to + .name = "D-Box 2 flash memory", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = dbox2_flash_read8, + .read16 = dbox2_flash_read16, + .read32 = dbox2_flash_read32, + .copy_from = dbox2_flash_copy_from, + .write8 = dbox2_flash_write8, + .write16 = dbox2_flash_write16, + .write32 = dbox2_flash_write32, + .copy_to = dbox2_flash_copy_to }; int __init init_dbox2_flash(void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/dc21285.c linux-2.5.63-bk4/drivers/mtd/maps/dc21285.c --- linux-2.5.63-bk3/drivers/mtd/maps/dc21285.c Mon Feb 24 11:05:16 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/dc21285.c Mon Mar 31 12:18:08 2003 @@ -92,23 +92,25 @@ } struct map_info dc21285_map = { - name: "DC21285 flash", - size: 16*1024*1024, - read8: dc21285_read8, - read16: dc21285_read16, - read32: dc21285_read32, - copy_from: dc21285_copy_from, - write8: dc21285_write8, - write16: dc21285_write16, - write32: dc21285_write32, - copy_to: dc21285_copy_to + .name = "DC21285 flash", + .size = 16*1024*1024, + .read8 = dc21285_read8, + .read16 = dc21285_read16, + .read32 = dc21285_read32, + .copy_from = dc21285_copy_from, + .write8 = dc21285_write8, + .write16 = dc21285_write16, + .write32 = dc21285_write32, + .copy_to = dc21285_copy_to }; - /* Partition stuff */ static struct mtd_partition *dc21285_parts; extern int parse_redboot_partitions(struct mtd_info *, struct mtd_partition **); +extern int parse_cmdline_partitions(struct mtd_info *master, + struct mtd_partition **pparts, + const char *mtd_id); int __init init_dc21285(void) { @@ -140,18 +142,34 @@ mymtd = do_map_probe("cfi_probe", &dc21285_map); if (mymtd) { int nrparts = 0; + const char *part_type = NULL; mymtd->module = THIS_MODULE; /* partition fixup */ - + do { +#ifdef CONFIG_MTD_CMDLINE_PARTS + nrparts = parse_cmdline_partitions(mymtd, &dc21285_parts, "dc21285"); + if (nrparts > 0) { + part_type = "command line"; + break; + } +#endif #ifdef CONFIG_MTD_REDBOOT_PARTS - nrparts = parse_redboot_partitions(mymtd, &dc21285_parts); + nrparts = parse_redboot_partitions(mymtd, &dc21285_parts); + if (nrparts > 0) { + part_type = "RedBoot"; + break; + } #endif + } while (0); + if (nrparts > 0) { add_mtd_partitions(mymtd, dc21285_parts, nrparts); + printk(KERN_NOTICE "DC21285 using %s partition " + "definition\n", part_type); } else if (nrparts == 0) { - printk(KERN_NOTICE "RedBoot partition table failed\n"); + printk(KERN_NOTICE "DC21285 partition table failed\n"); add_mtd_device(mymtd); } diff -urN linux-2.5.63-bk3/drivers/mtd/maps/edb7312.c linux-2.5.63-bk4/drivers/mtd/maps/edb7312.c --- linux-2.5.63-bk3/drivers/mtd/maps/edb7312.c Mon Feb 24 11:06:03 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/edb7312.c Mon Mar 31 12:18:08 2003 @@ -79,17 +79,17 @@ } struct map_info edb7312nor_map = { - name: "NOR flash on EDB7312", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: edb7312nor_read8, - read16: edb7312nor_read16, - read32: edb7312nor_read32, - copy_from: edb7312nor_copy_from, - write8: edb7312nor_write8, - write16: edb7312nor_write16, - write32: edb7312nor_write32, - copy_to: edb7312nor_copy_to + .name = "NOR flash on EDB7312", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = edb7312nor_read8, + .read16 = edb7312nor_read16, + .read32 = edb7312nor_read32, + .copy_from = edb7312nor_copy_from, + .write8 = edb7312nor_write8, + .write16 = edb7312nor_write16, + .write32 = edb7312nor_write32, + .copy_to = edb7312nor_copy_to }; #ifdef CONFIG_MTD_PARTITIONS @@ -97,23 +97,22 @@ /* * MTD partitioning stuff */ -static struct mtd_partition static_partitions[3] = -{ - { - name: "ARMboot", - size: 0x40000, - offset: 0 - }, - { - name: "Kernel", - size: 0x200000, - offset: 0x40000 - }, - { - name: "RootFS", - size: 0xDC0000, - offset: 0x240000 - }, +static struct mtd_partition static_partitions[3] = { + { + .name = "ARMboot", + .size = 0x40000, + .offset = 0 + }, + { + .name = "Kernel", + .size = 0x200000, + .offset = 0x40000 + }, + { + .name = "RootFS", + .size = 0xDC0000, + .offset = 0x240000 + }, }; #define NB_OF(x) (sizeof (x) / sizeof (x[0])) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/elan-104nc.c linux-2.5.63-bk4/drivers/mtd/maps/elan-104nc.c --- linux-2.5.63-bk3/drivers/mtd/maps/elan-104nc.c Mon Feb 24 11:05:32 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/elan-104nc.c Mon Mar 31 12:18:08 2003 @@ -58,15 +58,20 @@ /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ - { name: "ELAN-104NC flash boot partition", - offset: 0, - size: 640*1024 }, - { name: "ELAN-104NC flash partition 1", - offset: 640*1024, - size: 896*1024 }, - { name: "ELAN-104NC flash partition 2", - offset: (640+896)*1024 } +static struct mtd_partition partition_info[] = { + { + .name = "ELAN-104NC flash boot partition", + .size = 640*1024 + }, + { + .name = "ELAN-104NC flash partition 1", + .offset = 640*1024, + .size = 896*1024 + }, + { + .name = "ELAN-104NC flash partition 2", + .offset = (640+896)*1024, + } }; #define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0])) @@ -195,19 +200,20 @@ } static struct map_info elan_104nc_map = { - name: "ELAN-104NC flash", - size: 8*1024*1024, /* this must be set to a maximum possible amount - of flash so the cfi probe routines find all - the chips */ - buswidth: 2, - read8: elan_104nc_read8, - read16: elan_104nc_read16, - read32: elan_104nc_read32, - copy_from: elan_104nc_copy_from, - write8: elan_104nc_write8, - write16: elan_104nc_write16, - write32: elan_104nc_write32, - copy_to: elan_104nc_copy_to + .name = "ELAN-104NC flash", + .size = 8*1024*1024, /* this must be set to a maximum + possible amount of flash so the + cfi probe routines find all + the chips */ + .buswidth = 2, + .read8 = elan_104nc_read8, + .read16 = elan_104nc_read16, + .read32 = elan_104nc_read32, + .copy_from = elan_104nc_copy_from, + .write8 = elan_104nc_write8, + .write16 = elan_104nc_write16, + .write32 = elan_104nc_write32, + .copy_to = elan_104nc_copy_to }; /* MTD device for all of the flash. */ diff -urN linux-2.5.63-bk3/drivers/mtd/maps/epxa10db-flash.c linux-2.5.63-bk4/drivers/mtd/maps/epxa10db-flash.c --- linux-2.5.63-bk3/drivers/mtd/maps/epxa10db-flash.c Mon Feb 24 11:05:39 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/epxa10db-flash.c Mon Mar 31 12:18:08 2003 @@ -92,17 +92,17 @@ static struct map_info epxa_map = { - name: "EPXA flash", - size: FLASH_SIZE, - buswidth: 2, - read8: epxa_read8, - read16: epxa_read16, - read32: epxa_read32, - copy_from: epxa_copy_from, - write8: epxa_write8, - write16: epxa_write16, - write32: epxa_write32, - copy_to: epxa_copy_to + .name = "EPXA flash", + .size = FLASH_SIZE, + .buswidth = 2, + .read8 = epxa_read8, + .read16 = epxa_read16, + .read32 = epxa_read32, + .copy_from = epxa_copy_from, + .write8 = epxa_write8, + .write16 = epxa_write16, + .write32 = epxa_write32, + .copy_to = epxa_copy_to }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/fortunet.c linux-2.5.63-bk4/drivers/mtd/maps/fortunet.c --- linux-2.5.63-bk3/drivers/mtd/maps/fortunet.c Mon Feb 24 11:05:12 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/fortunet.c Mon Mar 31 12:18:08 2003 @@ -78,16 +78,16 @@ } struct map_info default_map = { - size: DEF_WINDOW_SIZE, - buswidth: 4, - read8: fortunet_read8, - read16: fortunet_read16, - read32: fortunet_read32, - copy_from: fortunet_copy_from, - write8: fortunet_write8, - write16: fortunet_write16, - write32: fortunet_write32, - copy_to: fortunet_copy_to + .size = DEF_WINDOW_SIZE, + .buswidth = 4, + .read8 = fortunet_read8, + .read16 = fortunet_read16, + .read32 = fortunet_read32, + .copy_from = fortunet_copy_from, + .write8 = fortunet_write8, + .write16 = fortunet_write16, + .write32 = fortunet_write32, + .copy_to = fortunet_copy_to }; static char * __init get_string_option(char *dest,int dest_size,char *sor) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/impa7.c linux-2.5.63-bk4/drivers/mtd/maps/impa7.c --- linux-2.5.63-bk3/drivers/mtd/maps/impa7.c Mon Feb 24 11:05:11 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/impa7.c Mon Mar 31 12:18:08 2003 @@ -82,30 +82,30 @@ static struct map_info impa7_map[NUM_FLASHBANKS] = { { - name: "impA7 NOR Flash Bank #0", - size: WINDOW_SIZE0, - buswidth: BUSWIDTH, - read8: impa7_read8, - read16: impa7_read16, - read32: impa7_read32, - copy_from: impa7_copy_from, - write8: impa7_write8, - write16: impa7_write16, - write32: impa7_write32, - copy_to: impa7_copy_to + .name = "impA7 NOR Flash Bank #0", + .size = WINDOW_SIZE0, + .buswidth = BUSWIDTH, + .read8 = impa7_read8, + .read16 = impa7_read16, + .read32 = impa7_read32, + .copy_from = impa7_copy_from, + .write8 = impa7_write8, + .write16 = impa7_write16, + .write32 = impa7_write32, + .copy_to = impa7_copy_to }, { - name: "impA7 NOR Flash Bank #1", - size: WINDOW_SIZE1, - buswidth: BUSWIDTH, - read8: impa7_read8, - read16: impa7_read16, - read32: impa7_read32, - copy_from: impa7_copy_from, - write8: impa7_write8, - write16: impa7_write16, - write32: impa7_write32, - copy_to: impa7_copy_to + .name = "impA7 NOR Flash Bank #1", + .size = WINDOW_SIZE1, + .buswidth = BUSWIDTH, + .read8 = impa7_read8, + .read16 = impa7_read16, + .read32 = impa7_read32, + .copy_from = impa7_copy_from, + .write8 = impa7_write8, + .write16 = impa7_write16, + .write32 = impa7_write32, + .copy_to = impa7_copy_to }, }; @@ -114,13 +114,12 @@ /* * MTD partitioning stuff */ -static struct mtd_partition static_partitions[] = -{ - { - name: "FileSystem", - size: 0x800000, - offset: 0x00000000 - }, +static struct mtd_partition static_partitions[] = { + { + .name = "FileSystem", + .size = 0x800000, + .offset = 0x00000000 + }, }; #define NB_OF(x) (sizeof (x) / sizeof (x[0])) @@ -143,8 +142,8 @@ const char *part_type = 0; int i; static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = { - { WINDOW_ADDR0, WINDOW_SIZE0 }, - { WINDOW_ADDR1, WINDOW_SIZE1 }, + { .addr = WINDOW_ADDR0, .size = WINDOW_SIZE0 }, + { .addr = WINDOW_ADDR1, .size = WINDOW_SIZE1 }, }; char mtdid[10]; int devicesfound = 0; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/integrator-flash.c linux-2.5.63-bk4/drivers/mtd/maps/integrator-flash.c --- linux-2.5.63-bk3/drivers/mtd/maps/integrator-flash.c Mon Feb 24 11:05:39 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/integrator-flash.c Mon Mar 31 12:18:08 2003 @@ -195,16 +195,16 @@ static struct map_info armflash_map = { - name: "AFS", - read8: armflash_read8, - read16: armflash_read16, - read32: armflash_read32, - copy_from: armflash_copy_from, - write8: armflash_write8, - write16: armflash_write16, - write32: armflash_write32, - copy_to: armflash_copy_to, - set_vpp: armflash_set_vpp, + .name = "AFS", + .read8 = armflash_read8, + .read16 = armflash_read16, + .read32 = armflash_read32, + .copy_from = armflash_copy_from, + .write8 = armflash_write8, + .write16 = armflash_write16, + .write32 = armflash_write32, + .copy_to = armflash_copy_to, + .set_vpp = armflash_set_vpp, }; static struct mtd_info *mtd; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/iq80310.c linux-2.5.63-bk4/drivers/mtd/maps/iq80310.c --- linux-2.5.63-bk3/drivers/mtd/maps/iq80310.c Mon Feb 24 11:05:44 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/iq80310.c Mon Mar 31 12:18:08 2003 @@ -67,38 +67,40 @@ } static struct map_info iq80310_map = { - name: "IQ80310 flash", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: iq80310_read8, - read16: iq80310_read16, - read32: iq80310_read32, - copy_from: iq80310_copy_from, - write8: iq80310_write8, - write16: iq80310_write16, - write32: iq80310_write32, - copy_to: iq80310_copy_to + .name = "IQ80310 flash", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = iq80310_read8, + .read16 = iq80310_read16, + .read32 = iq80310_read32, + .copy_from = iq80310_copy_from, + .write8 = iq80310_write8, + .write16 = iq80310_write16, + .write32 = iq80310_write32, + .copy_to = iq80310_copy_to }; static struct mtd_partition iq80310_partitions[4] = { { - name: "Firmware", - size: 0x00080000, - offset: 0, - mask_flags: MTD_WRITEABLE /* force read-only */ - },{ - name: "Kernel", - size: 0x000a0000, - offset: 0x00080000, - },{ - name: "Filesystem", - size: 0x00600000, - offset: 0x00120000 - },{ - name: "RedBoot", - size: 0x000e0000, - offset: 0x00720000, - mask_flags: MTD_WRITEABLE + .name = "Firmware", + .size = 0x00080000, + .mask_flags = MTD_WRITEABLE /* force read-only */ + }, + { + .name = "Kernel", + .size = 0x000a0000, + .offset = 0x00080000, + }, + { + .name = "Filesystem", + .size = 0x00600000, + .offset = 0x00120000 + }, + { + .name = "RedBoot", + .size = 0x000e0000, + .offset = 0x00720000, + .mask_flags = MTD_WRITEABLE } }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/l440gx.c linux-2.5.63-bk4/drivers/mtd/maps/l440gx.c --- linux-2.5.63-bk3/drivers/mtd/maps/l440gx.c Mon Feb 24 11:05:41 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/l440gx.c Mon Mar 31 12:18:08 2003 @@ -76,18 +76,18 @@ } struct map_info l440gx_map = { - name: "L440GX BIOS", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: l440gx_read8, - read16: l440gx_read16, - read32: l440gx_read32, - copy_from: l440gx_copy_from, - write8: l440gx_write8, - write16: l440gx_write16, - write32: l440gx_write32, - copy_to: l440gx_copy_to, - set_vpp: l440gx_set_vpp + .name = "L440GX BIOS", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = l440gx_read8, + .read16 = l440gx_read16, + .read32 = l440gx_read32, + .copy_from = l440gx_copy_from, + .write8 = l440gx_write8, + .write16 = l440gx_write16, + .write32 = l440gx_write32, + .copy_to = l440gx_copy_to, + .set_vpp = l440gx_set_vpp }; static int __init init_l440gx(void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/netsc520.c linux-2.5.63-bk4/drivers/mtd/maps/netsc520.c --- linux-2.5.63-bk3/drivers/mtd/maps/netsc520.c Mon Feb 24 11:05:39 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/netsc520.c Mon Mar 31 12:18:08 2003 @@ -93,27 +93,26 @@ /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ - { - name: "NetSc520 boot kernel", - offset: 0, - size: 0xc0000 - }, - { - name: "NetSc520 Low BIOS", - offset: 0xc0000, - size: 0x40000 - }, - { - name: "NetSc520 file system", - offset: 0x100000, - size: 0xe80000 - }, - { - name: "NetSc520 High BIOS", - offset: 0xf80000, - size: 0x80000 - }, +static struct mtd_partition partition_info[] = { + { + .name = "NetSc520 boot kernel", + .size = 0xc0000 + }, + { + .name = "NetSc520 Low BIOS", + .offset = 0xc0000, + .size = 0x40000 + }, + { + .name = "NetSc520 file system", + .offset = 0x100000, + .size = 0xe80000 + }, + { + .name = "NetSc520 High BIOS", + .offset = 0xf80000, + .size = 0x80000 + }, }; #define NUM_PARTITIONS (sizeof(partition_info)/sizeof(partition_info[0])) @@ -127,18 +126,18 @@ #define WINDOW_ADDR 0x00200000 static struct map_info netsc520_map = { - name: "netsc520 Flash Bank", - size: WINDOW_SIZE, - buswidth: 4, - read8: netsc520_read8, - read16: netsc520_read16, - read32: netsc520_read32, - copy_from: netsc520_copy_from, - write8: netsc520_write8, - write16: netsc520_write16, - write32: netsc520_write32, - copy_to: netsc520_copy_to, - map_priv_2: WINDOW_ADDR + .name = "netsc520 Flash Bank", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = netsc520_read8, + .read16 = netsc520_read16, + .read32 = netsc520_read32, + .copy_from = netsc520_copy_from, + .write8 = netsc520_write8, + .write16 = netsc520_write16, + .write32 = netsc520_write32, + .copy_to = netsc520_copy_to, + .map_priv_2 = WINDOW_ADDR }; #define NUM_FLASH_BANKS (sizeof(netsc520_map)/sizeof(struct map_info)) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/nora.c linux-2.5.63-bk4/drivers/mtd/maps/nora.c --- linux-2.5.63-bk3/drivers/mtd/maps/nora.c Mon Feb 24 11:05:38 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/nora.c Mon Mar 31 12:18:08 2003 @@ -58,17 +58,17 @@ } struct map_info nora_map = { - name: "NORA", - size: WINDOW_SIZE, - buswidth: 2, - read8: nora_read8, - read16: nora_read16, - read32: nora_read32, - copy_from: nora_copy_from, - write8: nora_write8, - write16: nora_write16, - write32: nora_write32, - copy_to: nora_copy_to + .name = "NORA", + .size = WINDOW_SIZE, + .buswidth = 2, + .read8 = nora_read8, + .read16 = nora_read16, + .read32 = nora_read32, + .copy_from = nora_copy_from, + .write8 = nora_write8, + .write16 = nora_write16, + .write32 = nora_write32, + .copy_to = nora_copy_to }; @@ -106,64 +106,63 @@ static struct mtd_info nora_mtds[4] = { /* boot, kernel, ramdisk, fs */ { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x60000, - erasesize: 0x20000, - name: "NORA boot firmware", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x60000, + .erasesize = 0x20000, + .name = "NORA boot firmware", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, }, { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x0a0000, - erasesize: 0x20000, - name: "NORA kernel", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0x60000 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x0a0000, + .erasesize = 0x20000, + .name = "NORA kernel", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, + .priv = (void *)0x60000 }, { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x900000, - erasesize: 0x20000, - name: "NORA root filesystem", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0x100000 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x900000, + .erasesize = 0x20000, + .name = "NORA root filesystem", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, + .priv = (void *)0x100000 }, { - type: MTD_NORFLASH, - flags: MTD_CAP_NORFLASH, - size: 0x1600000, - erasesize: 0x20000, - name: "NORA second filesystem", - module: THIS_MODULE, - erase: nora_mtd_erase, - read: nora_mtd_read, - write: nora_mtd_write, - suspend: nora_mtd_suspend, - resume: nora_mtd_resume, - sync: nora_mtd_sync, - priv: (void *)0xa00000 + .type = MTD_NORFLASH, + .flags = MTD_CAP_NORFLASH, + .size = 0x1600000, + .erasesize = 0x20000, + .name = "NORA second filesystem", + .module = THIS_MODULE, + .erase = nora_mtd_erase, + .read = nora_mtd_read, + .write = nora_mtd_write, + .suspend = nora_mtd_suspend, + .resume = nora_mtd_resume, + .sync = nora_mtd_sync, + .priv = (void *)0xa00000 } }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/ocelot.c linux-2.5.63-bk4/drivers/mtd/maps/ocelot.c --- linux-2.5.63-bk3/drivers/mtd/maps/ocelot.c Mon Feb 24 11:06:01 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/ocelot.c Mon Mar 31 12:18:08 2003 @@ -70,22 +70,22 @@ static struct mtd_partition *parsed_parts; struct map_info ocelot_flash_map = { - name: "Ocelot boot flash", - size: FLASH_WINDOW_SIZE, - buswidth: FLASH_BUSWIDTH, - read8: ocelot_read8, - copy_from: ocelot_copy_from_cache, - write8: ocelot_write8, + .name = "Ocelot boot flash", + .size = FLASH_WINDOW_SIZE, + .buswidth = FLASH_BUSWIDTH, + .read8 = ocelot_read8, + .copy_from = ocelot_copy_from_cache, + .write8 = ocelot_write8, }; struct map_info ocelot_nvram_map = { - name: "Ocelot NVRAM", - size: NVRAM_WINDOW_SIZE, - buswidth: NVRAM_BUSWIDTH, - read8: ocelot_read8, - copy_from: ocelot_copy_from, - write8: ocelot_write8, - copy_to: ocelot_copy_to + .name = "Ocelot NVRAM", + .size = NVRAM_WINDOW_SIZE, + .buswidth = NVRAM_BUSWIDTH, + .read8 = ocelot_read8, + .copy_from = ocelot_copy_from, + .write8 = ocelot_write8, + .copy_to = ocelot_copy_to }; static int __init init_ocelot_maps(void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/octagon-5066.c linux-2.5.63-bk4/drivers/mtd/maps/octagon-5066.c --- linux-2.5.63-bk3/drivers/mtd/maps/octagon-5066.c Mon Feb 24 11:05:11 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/octagon-5066.c Mon Mar 31 12:18:08 2003 @@ -151,32 +151,32 @@ static struct map_info oct5066_map[2] = { { - name: "Octagon 5066 Socket", - size: 512 * 1024, - buswidth: 1, - read8: oct5066_read8, - read16: oct5066_read16, - read32: oct5066_read32, - copy_from: oct5066_copy_from, - write8: oct5066_write8, - write16: oct5066_write16, - write32: oct5066_write32, - copy_to: oct5066_copy_to, - map_priv_1: 1<<6 + .name = "Octagon 5066 Socket", + .size = 512 * 1024, + .buswidth = 1, + .read8 = oct5066_read8, + .read16 = oct5066_read16, + .read32 = oct5066_read32, + .copy_from = oct5066_copy_from, + .write8 = oct5066_write8, + .write16 = oct5066_write16, + .write32 = oct5066_write32, + .copy_to = oct5066_copy_to, + .map_priv_1 = 1<<6 }, { - name: "Octagon 5066 Internal Flash", - size: 2 * 1024 * 1024, - buswidth: 1, - read8: oct5066_read8, - read16: oct5066_read16, - read32: oct5066_read32, - copy_from: oct5066_copy_from, - write8: oct5066_write8, - write16: oct5066_write16, - write32: oct5066_write32, - copy_to: oct5066_copy_to, - map_priv_1: 2<<6 + .name = "Octagon 5066 Internal Flash", + .size = 2 * 1024 * 1024, + .buswidth = 1, + .read8 = oct5066_read8, + .read16 = oct5066_read16, + .read32 = oct5066_read32, + .copy_from = oct5066_copy_from, + .write8 = oct5066_write8, + .write16 = oct5066_write16, + .write32 = oct5066_write32, + .copy_to = oct5066_copy_to, + .map_priv_1 = 2<<6 } }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/pci.c linux-2.5.63-bk4/drivers/mtd/maps/pci.c --- linux-2.5.63-bk3/drivers/mtd/maps/pci.c Mon Feb 24 11:05:16 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/pci.c Mon Mar 31 12:18:08 2003 @@ -98,10 +98,10 @@ } static struct mtd_pci_info intel_iq80310_info = { - init: intel_iq80310_init, - exit: intel_iq80310_exit, - translate: intel_iq80310_translate, - map_name: "cfi_probe", + .init = intel_iq80310_init, + .exit = intel_iq80310_exit, + .translate = intel_iq80310_translate, + .map_name = "cfi_probe", }; /* @@ -181,10 +181,10 @@ } static struct mtd_pci_info intel_dc21285_info = { - init: intel_dc21285_init, - exit: intel_dc21285_exit, - translate: intel_dc21285_translate, - map_name: "jedec_probe", + .init = intel_dc21285_init, + .exit = intel_dc21285_exit, + .translate = intel_dc21285_translate, + .map_name = "jedec_probe", }; /* @@ -193,24 +193,22 @@ static struct pci_device_id mtd_pci_ids[] __devinitdata = { { - vendor: PCI_VENDOR_ID_INTEL, - device: 0x530d, - subvendor: PCI_ANY_ID, - subdevice: PCI_ANY_ID, - class: PCI_CLASS_MEMORY_OTHER << 8, - class_mask: 0xffff00, - driver_data: (unsigned long)&intel_iq80310_info, + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x530d, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .class = PCI_CLASS_MEMORY_OTHER << 8, + .class_mask = 0xffff00, + .driver_data = (unsigned long)&intel_iq80310_info, }, { - vendor: PCI_VENDOR_ID_DEC, - device: PCI_DEVICE_ID_DEC_21285, - subvendor: 0, /* DC21285 defaults to 0 on reset */ - subdevice: 0, /* DC21285 defaults to 0 on reset */ - class: 0, - class_mask: 0, - driver_data: (unsigned long)&intel_dc21285_info, + .vendor = PCI_VENDOR_ID_DEC, + .device = PCI_DEVICE_ID_DEC_21285, + .subvendor = 0, /* DC21285 defaults to 0 on reset */ + .subdevice = 0, /* DC21285 defaults to 0 on reset */ + .driver_data = (unsigned long)&intel_dc21285_info, }, - { 0, } + { .vendor = 0, } }; /* @@ -275,14 +273,14 @@ } static struct map_info mtd_pci_map = { - read8: mtd_pci_read8, - read16: mtd_pci_read16, - read32: mtd_pci_read32, - copy_from: mtd_pci_copyfrom, - write8: mtd_pci_write8, - write16: mtd_pci_write16, - write32: mtd_pci_write32, - copy_to: mtd_pci_copyto, + .read8 = mtd_pci_read8, + .read16 = mtd_pci_read16, + .read32 = mtd_pci_read32, + .copy_from = mtd_pci_copyfrom, + .write8 = mtd_pci_write8, + .write16 = mtd_pci_write16, + .write32 = mtd_pci_write32, + .copy_to = mtd_pci_copyto, }; static int __devinit @@ -359,10 +357,10 @@ } static struct pci_driver mtd_pci_driver = { - name: "MTD PCI", - probe: mtd_pci_probe, - remove: mtd_pci_remove, - id_table: mtd_pci_ids, + .name = "MTD PCI", + .probe = mtd_pci_probe, + .remove = mtd_pci_remove, + .id_table = mtd_pci_ids, }; static int __init mtd_pci_maps_init(void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/physmap.c linux-2.5.63-bk4/drivers/mtd/maps/physmap.c --- linux-2.5.63-bk3/drivers/mtd/maps/physmap.c Mon Feb 24 11:05:35 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/physmap.c Mon Mar 31 12:18:08 2003 @@ -63,17 +63,17 @@ } struct map_info physmap_map = { - name: "Physically mapped flash", - size: WINDOW_SIZE, - buswidth: BUSWIDTH, - read8: physmap_read8, - read16: physmap_read16, - read32: physmap_read32, - copy_from: physmap_copy_from, - write8: physmap_write8, - write16: physmap_write16, - write32: physmap_write32, - copy_to: physmap_copy_to + .name = "Physically mapped flash", + .size = WINDOW_SIZE, + .buswidth = BUSWIDTH, + .read8 = physmap_read8, + .read16 = physmap_read16, + .read32 = physmap_read32, + .copy_from = physmap_copy_from, + .write8 = physmap_write8, + .write16 = physmap_write16, + .write32 = physmap_write32, + .copy_to = physmap_copy_to }; int __init init_physmap(void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/pnc2000.c linux-2.5.63-bk4/drivers/mtd/maps/pnc2000.c --- linux-2.5.63-bk3/drivers/mtd/maps/pnc2000.c Mon Feb 24 11:05:31 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/pnc2000.c Mon Mar 31 12:18:08 2003 @@ -65,17 +65,17 @@ } struct map_info pnc_map = { - name: "PNC-2000", - size: WINDOW_SIZE, - buswidth: 4, - read8: pnc_read8, - read16: pnc_read16, - read32: pnc_read32, - copy_from: pnc_copy_from, - write8: pnc_write8, - write16: pnc_write16, - write32: pnc_write32, - copy_to: pnc_copy_to + .name = "PNC-2000", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = pnc_read8, + .read16 = pnc_read16, + .read32 = pnc_read32, + .copy_from = pnc_copy_from, + .write8 = pnc_write8, + .write16 = pnc_write16, + .write32 = pnc_write32, + .copy_to = pnc_copy_to }; @@ -84,19 +84,18 @@ */ static struct mtd_partition pnc_partitions[3] = { { - name: "PNC-2000 boot firmware", - size: 0x20000, - offset: 0 + .name = "PNC-2000 boot firmware", + .size = 0x20000, }, { - name: "PNC-2000 kernel", - size: 0x1a0000, - offset: 0x20000 + .name = "PNC-2000 kernel", + .size = 0x1a0000, + .offset = 0x20000 }, { - name: "PNC-2000 filesystem", - size: 0x240000, - offset: 0x1c0000 + .name = "PNC-2000 filesystem", + .size = 0x240000, + .offset = 0x1c0000 } }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/rpxlite.c linux-2.5.63-bk4/drivers/mtd/maps/rpxlite.c --- linux-2.5.63-bk3/drivers/mtd/maps/rpxlite.c Mon Feb 24 11:06:01 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/rpxlite.c Mon Mar 31 12:18:08 2003 @@ -61,17 +61,17 @@ } struct map_info rpxlite_map = { - name: "RPX", - size: WINDOW_SIZE, - buswidth: 4, - read8: rpxlite_read8, - read16: rpxlite_read16, - read32: rpxlite_read32, - copy_from: rpxlite_copy_from, - write8: rpxlite_write8, - write16: rpxlite_write16, - write32: rpxlite_write32, - copy_to: rpxlite_copy_to + .name = "RPX", + .size = WINDOW_SIZE, + .buswidth = 4, + .read8 = rpxlite_read8, + .read16 = rpxlite_read16, + .read32 = rpxlite_read32, + .copy_from = rpxlite_copy_from, + .write8 = rpxlite_write8, + .write16 = rpxlite_write16, + .write32 = rpxlite_write32, + .copy_to = rpxlite_copy_to }; int __init init_rpxlite(void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/sbc_gxx.c linux-2.5.63-bk4/drivers/mtd/maps/sbc_gxx.c --- linux-2.5.63-bk3/drivers/mtd/maps/sbc_gxx.c Mon Feb 24 11:05:34 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/sbc_gxx.c Mon Mar 31 12:18:08 2003 @@ -90,15 +90,20 @@ /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ - { name: "SBC-GXx flash boot partition", - offset: 0, - size: BOOT_PARTITION_SIZE_KiB*1024 }, - { name: "SBC-GXx flash data partition", - offset: BOOT_PARTITION_SIZE_KiB*1024, - size: (DATA_PARTITION_SIZE_KiB)*1024 }, - { name: "SBC-GXx flash application partition", - offset: (BOOT_PARTITION_SIZE_KiB+DATA_PARTITION_SIZE_KiB)*1024 } +static struct mtd_partition partition_info[] = { + { + .name = "SBC-GXx flash boot partition", + .size = BOOT_PARTITION_SIZE_KiB*1024 + }, + { + .name = "SBC-GXx flash data partition", + .offset = BOOT_PARTITION_SIZE_KiB*1024, + .size = (DATA_PARTITION_SIZE_KiB)*1024 + }, + { + .name = "SBC-GXx flash application partition", + .offset = (BOOT_PARTITION_SIZE_KiB+DATA_PARTITION_SIZE_KiB)*1024 + } }; #define NUM_PARTITIONS 3 @@ -203,19 +208,20 @@ } static struct map_info sbc_gxx_map = { - name: "SBC-GXx flash", - size: MAX_SIZE_KiB*1024, /* this must be set to a maximum possible amount - of flash so the cfi probe routines find all - the chips */ - buswidth: 1, - read8: sbc_gxx_read8, - read16: sbc_gxx_read16, - read32: sbc_gxx_read32, - copy_from: sbc_gxx_copy_from, - write8: sbc_gxx_write8, - write16: sbc_gxx_write16, - write32: sbc_gxx_write32, - copy_to: sbc_gxx_copy_to + .name = "SBC-GXx flash", + .size = MAX_SIZE_KiB*1024, /* this must be set to a maximum + possible amount of flash so + the cfi probe routines find + all the chips */ + .buswidth = 1, + .read8 = sbc_gxx_read8, + .read16 = sbc_gxx_read16, + .read32 = sbc_gxx_read32, + .copy_from = sbc_gxx_copy_from, + .write8 = sbc_gxx_write8, + .write16 = sbc_gxx_write16, + .write32 = sbc_gxx_write32, + .copy_to = sbc_gxx_copy_to }; /* MTD device for all of the flash. */ diff -urN linux-2.5.63-bk3/drivers/mtd/maps/sc520cdp.c linux-2.5.63-bk4/drivers/mtd/maps/sc520cdp.c --- linux-2.5.63-bk3/drivers/mtd/maps/sc520cdp.c Mon Feb 24 11:05:44 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/sc520cdp.c Mon Mar 31 12:18:08 2003 @@ -125,46 +125,46 @@ static struct map_info sc520cdp_map[] = { { - name: "SC520CDP Flash Bank #0", - size: WINDOW_SIZE_0, - buswidth: 4, - read8: sc520cdp_read8, - read16: sc520cdp_read16, - read32: sc520cdp_read32, - copy_from: sc520cdp_copy_from, - write8: sc520cdp_write8, - write16: sc520cdp_write16, - write32: sc520cdp_write32, - copy_to: sc520cdp_copy_to, - map_priv_2: WINDOW_ADDR_0 + .name = "SC520CDP Flash Bank #0", + .size = WINDOW_SIZE_0, + .buswidth = 4, + .read8 = sc520cdp_read8, + .read16 = sc520cdp_read16, + .read32 = sc520cdp_read32, + .copy_from = sc520cdp_copy_from, + .write8 = sc520cdp_write8, + .write16 = sc520cdp_write16, + .write32 = sc520cdp_write32, + .copy_to = sc520cdp_copy_to, + .map_priv_2 = WINDOW_ADDR_0 }, { - name: "SC520CDP Flash Bank #1", - size: WINDOW_SIZE_1, - buswidth: 4, - read8: sc520cdp_read8, - read16: sc520cdp_read16, - read32: sc520cdp_read32, - copy_from: sc520cdp_copy_from, - write8: sc520cdp_write8, - write16: sc520cdp_write16, - write32: sc520cdp_write32, - copy_to: sc520cdp_copy_to, - map_priv_2: WINDOW_ADDR_1 + .name = "SC520CDP Flash Bank #1", + .size = WINDOW_SIZE_1, + .buswidth = 4, + .read8 = sc520cdp_read8, + .read16 = sc520cdp_read16, + .read32 = sc520cdp_read32, + .copy_from = sc520cdp_copy_from, + .write8 = sc520cdp_write8, + .write16 = sc520cdp_write16, + .write32 = sc520cdp_write32, + .copy_to = sc520cdp_copy_to, + .map_priv_2 = WINDOW_ADDR_1 }, { - name: "SC520CDP DIL Flash", - size: WINDOW_SIZE_2, - buswidth: 1, - read8: sc520cdp_read8, - read16: sc520cdp_read16, - read32: sc520cdp_read32, - copy_from: sc520cdp_copy_from, - write8: sc520cdp_write8, - write16: sc520cdp_write16, - write32: sc520cdp_write32, - copy_to: sc520cdp_copy_to, - map_priv_2: WINDOW_ADDR_2 + .name = "SC520CDP DIL Flash", + .size = WINDOW_SIZE_2, + .buswidth = 1, + .read8 = sc520cdp_read8, + .read16 = sc520cdp_read16, + .read32 = sc520cdp_read32, + .copy_from = sc520cdp_copy_from, + .write8 = sc520cdp_write8, + .write16 = sc520cdp_write16, + .write32 = sc520cdp_write32, + .copy_to = sc520cdp_copy_to, + .map_priv_2 = WINDOW_ADDR_2 }, }; diff -urN linux-2.5.63-bk3/drivers/mtd/maps/solutionengine.c linux-2.5.63-bk4/drivers/mtd/maps/solutionengine.c --- linux-2.5.63-bk3/drivers/mtd/maps/solutionengine.c Mon Feb 24 11:05:46 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/solutionengine.c Mon Mar 31 12:18:08 2003 @@ -42,19 +42,19 @@ static struct mtd_partition *parsed_parts; struct map_info soleng_eprom_map = { - name: "Solution Engine EPROM", - size: 0x400000, - buswidth: 4, - copy_from: soleng_copy_from, + .name = "Solution Engine EPROM", + .size = 0x400000, + .buswidth = 4, + .copy_from = soleng_copy_from, }; struct map_info soleng_flash_map = { - name: "Solution Engine FLASH", - size: 0x400000, - buswidth: 4, - read32: soleng_read32, - copy_from: soleng_copy_from, - write32: soleng_write32, + .name = "Solution Engine FLASH", + .size = 0x400000, + .buswidth = 4, + .read32 = soleng_read32, + .copy_from = soleng_copy_from, + .write32 = soleng_write32, }; static int __init init_soleng_maps(void) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/sun_uflash.c linux-2.5.63-bk4/drivers/mtd/maps/sun_uflash.c --- linux-2.5.63-bk3/drivers/mtd/maps/sun_uflash.c Mon Feb 24 11:05:37 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/sun_uflash.c Mon Mar 31 12:18:08 2003 @@ -91,17 +91,17 @@ } struct map_info uflash_map_templ = { - name: "SUNW,???-????", - size: UFLASH_WINDOW_SIZE, - buswidth: UFLASH_BUSWIDTH, - read8: uflash_read8, - read16: uflash_read16, - read32: uflash_read32, - copy_from: uflash_copy_from, - write8: uflash_write8, - write16: uflash_write16, - write32: uflash_write32, - copy_to: uflash_copy_to + .name = "SUNW,???-????", + .size = UFLASH_WINDOW_SIZE, + .buswidth = UFLASH_BUSWIDTH, + .read8 = uflash_read8, + .read16 = uflash_read16, + .read32 = uflash_read32, + .copy_from = uflash_copy_from, + .write8 = uflash_write8, + .write16 = uflash_write16, + .write32 = uflash_write32, + .copy_to = uflash_copy_to }; int uflash_devinit(struct linux_ebus_device* edev) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/tqm8xxl.c linux-2.5.63-bk4/drivers/mtd/maps/tqm8xxl.c --- linux-2.5.63-bk3/drivers/mtd/maps/tqm8xxl.c Mon Feb 24 11:05:11 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/tqm8xxl.c Mon Mar 31 12:18:08 2003 @@ -92,17 +92,16 @@ } struct map_info tqm8xxl_map = { - name: "TQM8xxL", - //size: WINDOW_SIZE, - buswidth: 4, - read8: tqm8xxl_read8, - read16: tqm8xxl_read16, - read32: tqm8xxl_read32, - copy_from: tqm8xxl_copy_from, - write8: tqm8xxl_write8, - write16: tqm8xxl_write16, - write32: tqm8xxl_write32, - copy_to: tqm8xxl_copy_to + .name = "TQM8xxL", + .buswidth = 4, + .read8 = tqm8xxl_read8, + .read16 = tqm8xxl_read16, + .read32 = tqm8xxl_read32, + .copy_from = tqm8xxl_copy_from, + .write8 = tqm8xxl_write8, + .write16 = tqm8xxl_write16, + .write32 = tqm8xxl_write32, + .copy_to = tqm8xxl_copy_to }; /* @@ -125,40 +124,39 @@ */ static struct mtd_partition tqm8xxl_partitions[] = { { - name: "ppcboot", - offset: 0x00000000, - size: 0x00020000, /* 128KB */ - mask_flags: MTD_WRITEABLE, /* force read-only */ + .name = "ppcboot", + .offset = 0x00000000, + .size = 0x00020000, /* 128KB */ + .mask_flags = MTD_WRITEABLE, /* force read-only */ }, { - name: "kernel", /* default kernel image */ - offset: 0x00020000, - size: 0x000e0000, - mask_flags: MTD_WRITEABLE, /* force read-only */ + .name = "kernel", /* default kernel image */ + .offset = 0x00020000, + .size = 0x000e0000, + .mask_flags = MTD_WRITEABLE, /* force read-only */ }, { - name: "user", - offset: 0x00100000, - size: 0x00100000, + .name = "user", + .offset = 0x00100000, + .size = 0x00100000, }, { - name: "initrd", - offset: 0x00200000, - size: 0x00200000, + .name = "initrd", + .offset = 0x00200000, + .size = 0x00200000, } }; /* partition definition for second flahs bank */ static struct mtd_partition tqm8xxl_fs_partitions[] = { { - name: "cramfs", - offset: 0x00000000, - size: 0x00200000, + .name = "cramfs", + .offset = 0x00000000, + .size = 0x00200000, }, { - name: "jffs", - offset: 0x00200000, - size: 0x00200000, - //size: MTDPART_SIZ_FULL, + .name = "jffs", + .offset = 0x00200000, + .size = 0x00200000, } }; #endif diff -urN linux-2.5.63-bk3/drivers/mtd/maps/uclinux.c linux-2.5.63-bk4/drivers/mtd/maps/uclinux.c --- linux-2.5.63-bk3/drivers/mtd/maps/uclinux.c Mon Feb 24 11:05:44 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/uclinux.c Mon Mar 31 12:18:08 2003 @@ -66,15 +66,15 @@ /****************************************************************************/ struct map_info uclinux_ram_map = { - name: "RAM", - read8: uclinux_read8, - read16: uclinux_read16, - read32: uclinux_read32, - copy_from: uclinux_copy_from, - write8: uclinux_write8, - write16: uclinux_write16, - write32: uclinux_write32, - copy_to: uclinux_copy_to, + .name = "RAM", + .read8 = uclinux_read8, + .read16 = uclinux_read16, + .read32 = uclinux_read32, + .copy_from = uclinux_copy_from, + .write8 = uclinux_write8, + .write16 = uclinux_write16, + .write32 = uclinux_write32, + .copy_to = uclinux_copy_to, }; struct mtd_info *uclinux_ram_mtdinfo; @@ -82,7 +82,7 @@ /****************************************************************************/ struct mtd_partition uclinux_romfs[] = { - { name: "ROMfs", offset: 0 } + { .name = "ROMfs", .offset = 0 } }; #define NUM_PARTITIONS (sizeof(uclinux_romfs) / sizeof(uclinux_romfs[0])) diff -urN linux-2.5.63-bk3/drivers/mtd/maps/vmax301.c linux-2.5.63-bk4/drivers/mtd/maps/vmax301.c --- linux-2.5.63-bk3/drivers/mtd/maps/vmax301.c Mon Feb 24 11:05:14 2003 +++ linux-2.5.63-bk4/drivers/mtd/maps/vmax301.c Mon Mar 31 12:18:08 2003 @@ -142,34 +142,33 @@ static struct map_info vmax_map[2] = { { - name: "VMAX301 Internal Flash", - size: 3*2*1024*1024, - buswidth: 1, - read8: vmax301_read8, - read16: vmax301_read16, - read32: vmax301_read32, - copy_from: vmax301_copy_from, - write8: vmax301_write8, - write16: vmax301_write16, - write32: vmax301_write32, - copy_to: vmax301_copy_to, - map_priv_1: WINDOW_START + WINDOW_LENGTH, - map_priv_2: 0xFFFFFFFF + .name = "VMAX301 Internal Flash", + .size = 3*2*1024*1024, + .buswidth = 1, + .read8 = vmax301_read8, + .read16 = vmax301_read16, + .read32 = vmax301_read32, + .copy_from = vmax301_copy_from, + .write8 = vmax301_write8, + .write16 = vmax301_write16, + .write32 = vmax301_write32, + .copy_to = vmax301_copy_to, + .map_priv_1 = WINDOW_START + WINDOW_LENGTH, + .map_priv_2 = 0xFFFFFFFF }, { - name: "VMAX301 Socket", - size: 0, - buswidth: 1, - read8: vmax301_read8, - read16: vmax301_read16, - read32: vmax301_read32, - copy_from: vmax301_copy_from, - write8: vmax301_write8, - write16: vmax301_write16, - write32: vmax301_write32, - copy_to: vmax301_copy_to, - map_priv_1: WINDOW_START + (3*WINDOW_LENGTH), - map_priv_2: 0xFFFFFFFF + .name = "VMAX301 Socket", + .buswidth = 1, + .read8 = vmax301_read8, + .read16 = vmax301_read16, + .read32 = vmax301_read32, + .copy_from = vmax301_copy_from, + .write8 = vmax301_write8, + .write16 = vmax301_write16, + .write32 = vmax301_write32, + .copy_to = vmax301_copy_to, + .map_priv_1 = WINDOW_START + (3*WINDOW_LENGTH), + .map_priv_2 = 0xFFFFFFFF } }; diff -urN linux-2.5.63-bk3/drivers/mtd/mtdchar.c linux-2.5.63-bk4/drivers/mtd/mtdchar.c --- linux-2.5.63-bk3/drivers/mtd/mtdchar.c Mon Feb 24 11:05:37 2003 +++ linux-2.5.63-bk4/drivers/mtd/mtdchar.c Mon Mar 31 12:18:08 2003 @@ -19,8 +19,8 @@ static void mtd_notify_remove(struct mtd_info* mtd); static struct mtd_notifier notifier = { - add: mtd_notify_add, - remove: mtd_notify_remove, + .add = mtd_notify_add, + .remove = mtd_notify_remove, }; #endif @@ -445,13 +445,13 @@ } /* memory_ioctl */ static struct file_operations mtd_fops = { - owner: THIS_MODULE, - llseek: mtd_lseek, /* lseek */ - read: mtd_read, /* read */ - write: mtd_write, /* write */ - ioctl: mtd_ioctl, /* ioctl */ - open: mtd_open, /* open */ - release: mtd_close, /* release */ + .owner = THIS_MODULE, + .llseek = mtd_lseek, /* lseek */ + .read = mtd_read, /* read */ + .write = mtd_write, /* write */ + .ioctl = mtd_ioctl, /* ioctl */ + .open = mtd_open, /* open */ + .release = mtd_close, /* release */ }; diff -urN linux-2.5.63-bk3/drivers/mtd/nand/spia.c linux-2.5.63-bk4/drivers/mtd/nand/spia.c --- linux-2.5.63-bk3/drivers/mtd/nand/spia.c Mon Feb 24 11:05:34 2003 +++ linux-2.5.63-bk4/drivers/mtd/nand/spia.c Mon Mar 31 12:18:08 2003 @@ -66,12 +66,15 @@ * Define partitions for flash device */ const static struct mtd_partition partition_info[] = { - { name: "SPIA flash partition 1", - offset: 0, - size: 2*1024*1024 }, - { name: "SPIA flash partition 2", - offset: 2*1024*1024, - size: 6*1024*1024 } + { + .name = "SPIA flash partition 1", + .size = 2*1024*1024 + }, + { + .name = "SPIA flash partition 2", + .offset = 2*1024*1024, + .size = 6*1024*1024 + } }; #define NUM_PARTITIONS 2 diff -urN linux-2.5.63-bk3/drivers/mtd/nftlcore.c linux-2.5.63-bk4/drivers/mtd/nftlcore.c --- linux-2.5.63-bk3/drivers/mtd/nftlcore.c Mon Feb 24 11:05:05 2003 +++ linux-2.5.63-bk4/drivers/mtd/nftlcore.c Mon Mar 31 12:18:08 2003 @@ -914,8 +914,8 @@ ****************************************************************************/ static struct mtd_notifier nftl_notifier = { - add: NFTL_notify_add, - remove: NFTL_notify_remove + .add = NFTL_notify_add, + .remove = NFTL_notify_remove }; extern char nftlmountrev[]; diff -urN linux-2.5.63-bk3/drivers/net/via-rhine.c linux-2.5.63-bk4/drivers/net/via-rhine.c --- linux-2.5.63-bk3/drivers/net/via-rhine.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/drivers/net/via-rhine.c Mon Mar 31 12:18:09 2003 @@ -368,6 +368,8 @@ #else #define RHINE_IOTYPE (PCI_USES_IO | PCI_USES_MASTER | PCI_ADDR0) #endif +/* Beware of PCI posted writes */ +#define IOSYNC do { readb(dev->base_addr + StationAddr); } while (0) /* directly indexed by enum via_rhine_chips, above */ static struct via_rhine_chip_info via_rhine_chip_info[] __devinitdata = @@ -403,7 +405,8 @@ MIICmd=0x70, MIIRegAddr=0x71, MIIData=0x72, MACRegEEcsr=0x74, ConfigA=0x78, ConfigB=0x79, ConfigC=0x7A, ConfigD=0x7B, RxMissed=0x7C, RxCRCErrs=0x7E, MiscCmd=0x81, - StickyHW=0x83, WOLcrClr=0xA4, WOLcgClr=0xA7, PwrcsrClr=0xAC, + StickyHW=0x83, IntrStatus2=0x84, WOLcrClr=0xA4, WOLcgClr=0xA7, + PwrcsrClr=0xAC, }; /* Bits in ConfigD */ @@ -430,6 +433,8 @@ IntrTxAborted=0x2000, IntrLinkChange=0x4000, IntrRxWakeUp=0x8000, IntrNormalSummary=0x0003, IntrAbnormalSummary=0xC260, + IntrTxDescRace=0x080000, /* mapped from IntrStatus2 */ + IntrTxErrSummary=0x082210, }; /* The Rx and Tx buffer descriptors. */ @@ -527,14 +532,28 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static int via_rhine_close(struct net_device *dev); +static inline u32 get_intr_status(struct net_device *dev) +{ + long ioaddr = dev->base_addr; + struct netdev_private *np = dev->priv; + u32 intr_status; + + intr_status = readw(ioaddr + IntrStatus); + /* On Rhine-II, Bit 3 indicates Tx descriptor write-back race. */ + if (np->chip_id == VT6102) + intr_status |= readb(ioaddr + IntrStatus2) << 16; + return intr_status; +} + static void wait_for_reset(struct net_device *dev, int chip_id, char *name) { long ioaddr = dev->base_addr; + int boguscnt = 20; - udelay(5); + IOSYNC; if (readw(ioaddr + ChipCmd) & CmdReset) { - printk(KERN_INFO "%s: Reset did not complete in 5 us. " + printk(KERN_INFO "%s: Reset not complete yet. " "Trying harder.\n", name); /* Rhine-II needs to be forced sometimes */ @@ -543,12 +562,14 @@ /* VT86C100A may need long delay after reset (dlink) */ /* Seen on Rhine-II as well (rl) */ - udelay(100); + while ((readw(ioaddr + ChipCmd) & CmdReset) && --boguscnt); + udelay(5); + } if (debug > 1) printk(KERN_INFO "%s: Reset %s.\n", name, - (readw(ioaddr + ChipCmd) & CmdReset) ? "failed" : "succeeded"); + boguscnt ? "succeeded" : "failed"); } #ifdef USE_MEM @@ -1226,6 +1247,7 @@ { struct netdev_private *np = dev->priv; unsigned entry; + u32 intr_status; /* Caution: the write order is important here, set the field with the "ownership" bits last. */ @@ -1275,8 +1297,15 @@ /* Non-x86 Todo: explicitly flush cache lines here. */ - /* Wake the potentially-idle transmit channel. */ - writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + /* + * Wake the potentially-idle transmit channel unless errors are + * pending (the ISR must sort them out first). + */ + intr_status = get_intr_status(dev); + if ((intr_status & IntrTxErrSummary) == 0) { + writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + } + IOSYNC; if (np->cur_tx == np->dirty_tx + TX_QUEUE_LEN) netif_stop_queue(dev); @@ -1303,38 +1332,51 @@ ioaddr = dev->base_addr; - while ((intr_status = readw(ioaddr + IntrStatus))) { + while ((intr_status = get_intr_status(dev))) { /* Acknowledge all of the current interrupt sources ASAP. */ + if (intr_status & IntrTxDescRace) + writeb(0x08, ioaddr + IntrStatus2); writew(intr_status & 0xffff, ioaddr + IntrStatus); + IOSYNC; if (debug > 4) - printk(KERN_DEBUG "%s: Interrupt, status %4.4x.\n", + printk(KERN_DEBUG "%s: Interrupt, status %8.8x.\n", dev->name, intr_status); if (intr_status & (IntrRxDone | IntrRxErr | IntrRxDropped | IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf)) via_rhine_rx(dev); - if (intr_status & (IntrTxDone | IntrTxError | IntrTxUnderrun | - IntrTxAborted)) + if (intr_status & (IntrTxErrSummary | IntrTxDone)) { + if (intr_status & IntrTxErrSummary) { + int cnt = 20; + /* Avoid scavenging before Tx engine turned off */ + while ((readw(ioaddr+ChipCmd) & CmdTxOn) && --cnt) + udelay(5); + if (debug > 2 && !cnt) + printk(KERN_WARNING "%s: via_rhine_interrupt() " + "Tx engine still on.\n", + dev->name); + } via_rhine_tx(dev); + } /* Abnormal error summary/uncommon events handlers. */ if (intr_status & (IntrPCIErr | IntrLinkChange | IntrStatsMax | IntrTxError | IntrTxAborted | - IntrTxUnderrun)) + IntrTxUnderrun | IntrTxDescRace)) via_rhine_error(dev, intr_status); if (--boguscnt < 0) { printk(KERN_WARNING "%s: Too much work at interrupt, " - "status=0x%4.4x.\n", + "status=%#8.8x.\n", dev->name, intr_status); break; } } if (debug > 3) - printk(KERN_DEBUG "%s: exiting interrupt, status=%4.4x.\n", + printk(KERN_DEBUG "%s: exiting interrupt, status=%8.8x.\n", dev->name, readw(ioaddr + IntrStatus)); } @@ -1512,7 +1554,8 @@ } /* Pre-emptively restart Rx engine. */ - writew(CmdRxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + writew(readw(dev->base_addr + ChipCmd) | CmdRxOn | CmdRxDemand, + dev->base_addr + ChipCmd); } /* Clears the "tally counters" for CRC errors and missed frames(?). @@ -1526,15 +1569,35 @@ readw(ioaddr + RxMissed); } -static inline void via_rhine_restart_tx(struct net_device *dev) { +static void via_rhine_restart_tx(struct net_device *dev) { struct netdev_private *np = dev->priv; + long ioaddr = dev->base_addr; int entry = np->dirty_tx % TX_RING_SIZE; + u32 intr_status; - /* We know better than the chip where it should continue */ - writel(np->tx_ring_dma + entry * sizeof(struct tx_desc), - dev->base_addr + TxRingPtr); + /* + * If new errors occured, we need to sort them out before doing Tx. + * In that case the ISR will be back here RSN anyway. + */ + intr_status = get_intr_status(dev); + + if ((intr_status & IntrTxErrSummary) == 0) { + + /* We know better than the chip where it should continue. */ + writel(np->tx_ring_dma + entry * sizeof(struct tx_desc), + ioaddr + TxRingPtr); + + writew(CmdTxDemand | np->chip_cmd, ioaddr + ChipCmd); + IOSYNC; + } + else { + /* This should never happen */ + if (debug > 1) + printk(KERN_WARNING "%s: via_rhine_restart_tx() " + "Another error occured %8.8x.\n", + dev->name, intr_status); + } - writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); } static void via_rhine_error(struct net_device *dev, int intr_status) @@ -1564,9 +1627,8 @@ } if (intr_status & IntrTxAborted) { if (debug > 1) - printk(KERN_INFO "%s: Abort %4.4x, frame dropped.\n", + printk(KERN_INFO "%s: Abort %8.8x, frame dropped.\n", dev->name, intr_status); - via_rhine_restart_tx(dev); } if (intr_status & IntrTxUnderrun) { if (np->tx_thresh < 0xE0) @@ -1575,15 +1637,21 @@ printk(KERN_INFO "%s: Transmitter underrun, Tx " "threshold now %2.2x.\n", dev->name, np->tx_thresh); - via_rhine_restart_tx(dev); } + if (intr_status & IntrTxDescRace) { + if (debug > 2) + printk(KERN_INFO "%s: Tx descriptor write-back race.\n", + dev->name); + } + if (intr_status & ( IntrTxAborted | IntrTxUnderrun | IntrTxDescRace )) + via_rhine_restart_tx(dev); + if (intr_status & ~( IntrLinkChange | IntrStatsMax | IntrTxUnderrun | - IntrTxError | IntrTxAborted | IntrNormalSummary)) { + IntrTxError | IntrTxAborted | IntrNormalSummary | + IntrTxDescRace )) { if (debug > 1) - printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", - dev->name, intr_status); - /* Recovery for other fault sources not known. */ - writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd); + printk(KERN_ERR "%s: Something Wicked happened! %8.8x.\n", + dev->name, intr_status); } spin_unlock (&np->lock); diff -urN linux-2.5.63-bk3/fs/dcache.c linux-2.5.63-bk4/fs/dcache.c --- linux-2.5.63-bk3/fs/dcache.c Mon Mar 31 12:18:05 2003 +++ linux-2.5.63-bk4/fs/dcache.c Mon Mar 31 12:18:10 2003 @@ -1056,7 +1056,7 @@ * as it is parsed under dcache_lock */ if (dentry == list_entry(lhp, struct dentry, d_hash)) { - dget(dentry); + __dget_locked(dentry); spin_unlock(&dcache_lock); return 1; } diff -urN linux-2.5.63-bk3/include/asm-alpha/bitops.h linux-2.5.63-bk4/include/asm-alpha/bitops.h --- linux-2.5.63-bk3/include/asm-alpha/bitops.h Mon Feb 24 11:05:32 2003 +++ linux-2.5.63-bk4/include/asm-alpha/bitops.h Mon Mar 31 12:18:10 2003 @@ -288,7 +288,7 @@ #else unsigned long bits, qofs, bofs; - bits = __kernel_cmpbge(word, 0); + bits = __kernel_cmpbge(0, word); qofs = ffz_b(bits); bits = __kernel_extbl(word, qofs); bofs = ffz_b(~bits); diff -urN linux-2.5.63-bk3/include/asm-alpha/thread_info.h linux-2.5.63-bk4/include/asm-alpha/thread_info.h --- linux-2.5.63-bk3/include/asm-alpha/thread_info.h Mon Feb 24 11:05:43 2003 +++ linux-2.5.63-bk4/include/asm-alpha/thread_info.h Mon Mar 31 12:18:10 2003 @@ -34,9 +34,9 @@ */ #define INIT_THREAD_INFO(tsk) \ { \ - task: &tsk, \ - exec_domain: &default_exec_domain, \ - addr_limit: KERNEL_DS, \ + .task = &tsk, \ + .exec_domain = &default_exec_domain, \ + .addr_limit = KERNEL_DS, \ .restart_block = { \ .fn = do_no_restart_syscall, \ }, \ diff -urN linux-2.5.63-bk3/include/asm-arm/arch-pxa/bitfield.h linux-2.5.63-bk4/include/asm-arm/arch-pxa/bitfield.h --- linux-2.5.63-bk3/include/asm-arm/arch-pxa/bitfield.h Wed Dec 31 16:00:00 1969 +++ linux-2.5.63-bk4/include/asm-arm/arch-pxa/bitfield.h Mon Mar 31 12:18:10 2003 @@ -0,0 +1,113 @@ +/* + * FILE bitfield.h + * + * Version 1.1 + * Author Copyright (c) Marc A. Viredaz, 1998 + * DEC Western Research Laboratory, Palo Alto, CA + * Date April 1998 (April 1997) + * System Advanced RISC Machine (ARM) + * Language C or ARM Assembly + * Purpose Definition of macros to operate on bit fields. + */ + + + +#ifndef __BITFIELD_H +#define __BITFIELD_H + +#ifndef __ASSEMBLY__ +#define UData(Data) ((unsigned long) (Data)) +#else +#define UData(Data) (Data) +#endif + + +/* + * MACRO: Fld + * + * Purpose + * The macro "Fld" encodes a bit field, given its size and its shift value + * with respect to bit 0. + * + * Note + * A more intuitive way to encode bit fields would have been to use their + * mask. However, extracting size and shift value information from a bit + * field's mask is cumbersome and might break the assembler (255-character + * line-size limit). + * + * Input + * Size Size of the bit field, in number of bits. + * Shft Shift value of the bit field with respect to bit 0. + * + * Output + * Fld Encoded bit field. + */ + +#define Fld(Size, Shft) (((Size) << 16) + (Shft)) + + +/* + * MACROS: FSize, FShft, FMsk, FAlnMsk, F1stBit + * + * Purpose + * The macros "FSize", "FShft", "FMsk", "FAlnMsk", and "F1stBit" return + * the size, shift value, mask, aligned mask, and first bit of a + * bit field. + * + * Input + * Field Encoded bit field (using the macro "Fld"). + * + * Output + * FSize Size of the bit field, in number of bits. + * FShft Shift value of the bit field with respect to bit 0. + * FMsk Mask for the bit field. + * FAlnMsk Mask for the bit field, aligned on bit 0. + * F1stBit First bit of the bit field. + */ + +#define FSize(Field) ((Field) >> 16) +#define FShft(Field) ((Field) & 0x0000FFFF) +#define FMsk(Field) (((UData (1) << FSize (Field)) - 1) << FShft (Field)) +#define FAlnMsk(Field) ((UData (1) << FSize (Field)) - 1) +#define F1stBit(Field) (UData (1) << FShft (Field)) + + +/* + * MACRO: FInsrt + * + * Purpose + * The macro "FInsrt" inserts a value into a bit field by shifting the + * former appropriately. + * + * Input + * Value Bit-field value. + * Field Encoded bit field (using the macro "Fld"). + * + * Output + * FInsrt Bit-field value positioned appropriately. + */ + +#define FInsrt(Value, Field) \ + (UData (Value) << FShft (Field)) + + +/* + * MACRO: FExtr + * + * Purpose + * The macro "FExtr" extracts the value of a bit field by masking and + * shifting it appropriately. + * + * Input + * Data Data containing the bit-field to be extracted. + * Field Encoded bit field (using the macro "Fld"). + * + * Output + * FExtr Bit-field value. + */ + +#define FExtr(Data, Field) \ + ((UData (Data) >> FShft (Field)) & FAlnMsk (Field)) + + +#endif /* __BITFIELD_H */ diff -urN linux-2.5.63-bk3/include/asm-arm/arch-pxa/hardware.h linux-2.5.63-bk4/include/asm-arm/arch-pxa/hardware.h --- linux-2.5.63-bk3/include/asm-arm/arch-pxa/hardware.h Mon Feb 24 11:05:05 2003 +++ linux-2.5.63-bk4/include/asm-arm/arch-pxa/hardware.h Mon Mar 31 12:18:10 2003 @@ -103,6 +103,5 @@ #include "lubbock.h" #include "idp.h" -#include "cerf.h" #endif /* _ASM_ARCH_HARDWARE_H */ diff -urN linux-2.5.63-bk3/include/asm-arm/arch-pxa/irqs.h linux-2.5.63-bk4/include/asm-arm/arch-pxa/irqs.h --- linux-2.5.63-bk3/include/asm-arm/arch-pxa/irqs.h Mon Feb 24 11:05:10 2003 +++ linux-2.5.63-bk4/include/asm-arm/arch-pxa/irqs.h Mon Mar 31 12:18:10 2003 @@ -44,78 +44,86 @@ ((i) - PXA_IRQ(32) + 2) #define IRQ_TO_GPIO(i) ((i) - (((i) > IRQ_GPIO1) ? IRQ_GPIO(2) : IRQ_GPIO(0))) -#define NR_IRQS (IRQ_GPIO(80) + 1) - -#if defined(CONFIG_SA1111) - -#define IRQ_SA1111_START (IRQ_GPIO(80) + 1) -#define SA1111_IRQ(x) (IRQ_SA1111_START + (x)) - -#define IRQ_GPAIN0 SA1111_IRQ(0) -#define IRQ_GPAIN1 SA1111_IRQ(1) -#define IRQ_GPAIN2 SA1111_IRQ(2) -#define IRQ_GPAIN3 SA1111_IRQ(3) -#define IRQ_GPBIN0 SA1111_IRQ(4) -#define IRQ_GPBIN1 SA1111_IRQ(5) -#define IRQ_GPBIN2 SA1111_IRQ(6) -#define IRQ_GPBIN3 SA1111_IRQ(7) -#define IRQ_GPBIN4 SA1111_IRQ(8) -#define IRQ_GPBIN5 SA1111_IRQ(9) -#define IRQ_GPCIN0 SA1111_IRQ(10) -#define IRQ_GPCIN1 SA1111_IRQ(11) -#define IRQ_GPCIN2 SA1111_IRQ(12) -#define IRQ_GPCIN3 SA1111_IRQ(13) -#define IRQ_GPCIN4 SA1111_IRQ(14) -#define IRQ_GPCIN5 SA1111_IRQ(15) -#define IRQ_GPCIN6 SA1111_IRQ(16) -#define IRQ_GPCIN7 SA1111_IRQ(17) -#define IRQ_MSTXINT SA1111_IRQ(18) -#define IRQ_MSRXINT SA1111_IRQ(19) -#define IRQ_MSSTOPERRINT SA1111_IRQ(20) -#define IRQ_TPTXINT SA1111_IRQ(21) -#define IRQ_TPRXINT SA1111_IRQ(22) -#define IRQ_TPSTOPERRINT SA1111_IRQ(23) -#define SSPXMTINT SA1111_IRQ(24) -#define SSPRCVINT SA1111_IRQ(25) -#define SSPROR SA1111_IRQ(26) -#define AUDXMTDMADONEA SA1111_IRQ(32) -#define AUDRCVDMADONEA SA1111_IRQ(33) -#define AUDXMTDMADONEB SA1111_IRQ(34) -#define AUDRCVDMADONEB SA1111_IRQ(35) -#define AUDTFSR SA1111_IRQ(36) -#define AUDRFSR SA1111_IRQ(37) -#define AUDTUR SA1111_IRQ(38) -#define AUDROR SA1111_IRQ(39) -#define AUDDTS SA1111_IRQ(40) -#define AUDRDD SA1111_IRQ(41) -#define AUDSTO SA1111_IRQ(42) -#define USBPWR SA1111_IRQ(43) -#define NIRQHCIM SA1111_IRQ(44) -#define HCIBUFFACC SA1111_IRQ(45) -#define HCIRMTWKP SA1111_IRQ(46) -#define NHCIMFCIR SA1111_IRQ(47) -#define PORT_RESUME SA1111_IRQ(48) -#define S0_READY_NINT SA1111_IRQ(49) -#define S1_READY_NINT SA1111_IRQ(50) -#define S0_CD_VALID SA1111_IRQ(51) -#define S1_CD_VALID SA1111_IRQ(52) -#define S0_BVD1_STSCHG SA1111_IRQ(53) -#define S1_BVD1_STSCHG SA1111_IRQ(54) - -#define SA1111_IRQ_MAX SA1111_IRQ(54) - -#undef NR_IRQS -#define NR_IRQS (SA1111_IRQ_MAX + 1) - -#endif // defined(CONFIG_SA1111) - -#if defined(CONFIG_ARCH_LUBBOCK) || defined(CONFIG_ARCH_PXA_IDP) -#if CONFIG_SA1111 -#define LUBBOCK_IRQ(x) (SA1111_IRQ_MAX + 1 + (x)) +/* + * The next 16 interrupts are for board specific purposes. Since + * the kernel can only run on one machine at a time, we can re-use + * these. If you need more, increase IRQ_BOARD_END, but keep it + * within sensible limits. + */ +#define IRQ_BOARD_START (IRQ_GPIO(80) + 1) +#define IRQ_BOARD_END (IRQ_BOARD_START + 16) + +#define IRQ_SA1111_START (IRQ_BOARD_END) +#define IRQ_GPAIN0 (IRQ_BOARD_END + 0) +#define IRQ_GPAIN1 (IRQ_BOARD_END + 1) +#define IRQ_GPAIN2 (IRQ_BOARD_END + 2) +#define IRQ_GPAIN3 (IRQ_BOARD_END + 3) +#define IRQ_GPBIN0 (IRQ_BOARD_END + 4) +#define IRQ_GPBIN1 (IRQ_BOARD_END + 5) +#define IRQ_GPBIN2 (IRQ_BOARD_END + 6) +#define IRQ_GPBIN3 (IRQ_BOARD_END + 7) +#define IRQ_GPBIN4 (IRQ_BOARD_END + 8) +#define IRQ_GPBIN5 (IRQ_BOARD_END + 9) +#define IRQ_GPCIN0 (IRQ_BOARD_END + 10) +#define IRQ_GPCIN1 (IRQ_BOARD_END + 11) +#define IRQ_GPCIN2 (IRQ_BOARD_END + 12) +#define IRQ_GPCIN3 (IRQ_BOARD_END + 13) +#define IRQ_GPCIN4 (IRQ_BOARD_END + 14) +#define IRQ_GPCIN5 (IRQ_BOARD_END + 15) +#define IRQ_GPCIN6 (IRQ_BOARD_END + 16) +#define IRQ_GPCIN7 (IRQ_BOARD_END + 17) +#define IRQ_MSTXINT (IRQ_BOARD_END + 18) +#define IRQ_MSRXINT (IRQ_BOARD_END + 19) +#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20) +#define IRQ_TPTXINT (IRQ_BOARD_END + 21) +#define IRQ_TPRXINT (IRQ_BOARD_END + 22) +#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23) +#define SSPXMTINT (IRQ_BOARD_END + 24) +#define SSPRCVINT (IRQ_BOARD_END + 25) +#define SSPROR (IRQ_BOARD_END + 26) +#define AUDXMTDMADONEA (IRQ_BOARD_END + 32) +#define AUDRCVDMADONEA (IRQ_BOARD_END + 33) +#define AUDXMTDMADONEB (IRQ_BOARD_END + 34) +#define AUDRCVDMADONEB (IRQ_BOARD_END + 35) +#define AUDTFSR (IRQ_BOARD_END + 36) +#define AUDRFSR (IRQ_BOARD_END + 37) +#define AUDTUR (IRQ_BOARD_END + 38) +#define AUDROR (IRQ_BOARD_END + 39) +#define AUDDTS (IRQ_BOARD_END + 40) +#define AUDRDD (IRQ_BOARD_END + 41) +#define AUDSTO (IRQ_BOARD_END + 42) +#define IRQ_USBPWR (IRQ_BOARD_END + 43) +#define IRQ_HCIM (IRQ_BOARD_END + 44) +#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45) +#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46) +#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47) +#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48) +#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49) +#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50) +#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51) +#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52) +#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53) +#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54) + +/* + * Figure out the MAX IRQ number. + * + * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1. + * Otherwise, we have the standard IRQs only. + */ +#ifdef CONFIG_SA1111 +#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1) +#elif defined(CONFIG_ARCH_LUBBOCK) +#define NR_IRQS (IRQ_BOARD_END) #else -#define LUBBOCK_IRQ(x) (IRQ_GPIO(80) + 1 + (x)) +#define NR_IRQS (IRQ_BOARD_START) #endif +/* + * Board specific IRQs. Define them here. + * Do not surround them with ifdefs. + */ +#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x)) #define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0) #define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1) #define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) @@ -123,10 +131,3 @@ #define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4) #define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5) -#undef NR_IRQS -#define NR_IRQS (LUBBOCK_IRQ(5) + 1) - -#endif // CONFIG_ARCH_LUBBOCK - - - diff -urN linux-2.5.63-bk3/include/asm-arm/arch-pxa/lubbock.h linux-2.5.63-bk4/include/asm-arm/arch-pxa/lubbock.h --- linux-2.5.63-bk3/include/asm-arm/arch-pxa/lubbock.h Mon Feb 24 11:05:11 2003 +++ linux-2.5.63-bk4/include/asm-arm/arch-pxa/lubbock.h Mon Mar 31 12:18:10 2003 @@ -13,7 +13,6 @@ #define LUBBOCK_FPGA_PHYS PXA_CS2_PHYS #define LUBBOCK_FPGA_VIRT (0xf0000000) /* phys 0x08000000 */ #define LUBBOCK_ETH_BASE (0xf1000000) /* phys 0x0c000000 */ -#define LUBBOCK_SA1111_BASE (0xf4000000) /* phys 0x10000000 */ #define LUB_P2V(x) ((x) - LUBBOCK_FPGA_PHYS + LUBBOCK_FPGA_VIRT) #define LUB_V2P(x) ((x) - LUBBOCK_FPGA_VIRT + LUBBOCK_FPGA_PHYS) diff -urN linux-2.5.63-bk3/include/asm-arm/arch-pxa/pxa-regs.h linux-2.5.63-bk4/include/asm-arm/arch-pxa/pxa-regs.h --- linux-2.5.63-bk3/include/asm-arm/arch-pxa/pxa-regs.h Mon Feb 24 11:05:35 2003 +++ linux-2.5.63-bk4/include/asm-arm/arch-pxa/pxa-regs.h Mon Mar 31 12:18:10 2003 @@ -380,32 +380,12 @@ /* * IrSR (Infrared Selection Register) */ -#define IrSR_OFFSET 0x20 +#define STISR_RXPL (1 << 4) /* Receive Data Polarity */ +#define STISR_TXPL (1 << 3) /* Transmit Data Polarity */ +#define STISR_XMODE (1 << 2) /* Transmit Pulse Width Select */ +#define STISR_RCVEIR (1 << 1) /* Receiver SIR Enable */ +#define STISR_XMITIR (1 << 0) /* Transmitter SIR Enable */ -#define IrSR_RXPL_NEG_IS_ZERO (1<<4) -#define IrSR_RXPL_POS_IS_ZERO 0x0 -#define IrSR_TXPL_NEG_IS_ZERO (1<<3) -#define IrSR_TXPL_POS_IS_ZERO 0x0 -#define IrSR_XMODE_PULSE_1_6 (1<<2) -#define IrSR_XMODE_PULSE_3_16 0x0 -#define IrSR_RCVEIR_IR_MODE (1<<1) -#define IrSR_RCVEIR_UART_MODE 0x0 -#define IrSR_XMITIR_IR_MODE (1<<0) -#define IrSR_XMITIR_UART_MODE 0x0 - -#define IrSR_IR_RECEIVE_ON (\ - IrSR_RXPL_NEG_IS_ZERO | \ - IrSR_TXPL_POS_IS_ZERO | \ - IrSR_XMODE_PULSE_3_16 | \ - IrSR_RCVEIR_IR_MODE | \ - IrSR_XMITIR_UART_MODE) - -#define IrSR_IR_TRANSMIT_ON (\ - IrSR_RXPL_NEG_IS_ZERO | \ - IrSR_TXPL_POS_IS_ZERO | \ - IrSR_XMODE_PULSE_3_16 | \ - IrSR_RCVEIR_UART_MODE | \ - IrSR_XMITIR_IR_MODE) /* * I2C registers @@ -417,53 +397,49 @@ #define ISR __REG(0x40301698) /* I2C Status Register - ISR */ #define ISAR __REG(0x403016A0) /* I2C Slave Address Register - ISAR */ -/* ----- Control register bits ---------------------------------------- */ +#define ICR_START (1 << 0) /* start bit */ +#define ICR_STOP (1 << 1) /* stop bit */ +#define ICR_ACKNAK (1 << 2) /* send ACK(0) or NAK(1) */ +#define ICR_TB (1 << 3) /* transfer byte bit */ +#define ICR_MA (1 << 4) /* master abort */ +#define ICR_SCLE (1 << 5) /* master clock enable */ +#define ICR_IUE (1 << 6) /* unit enable */ +#define ICR_GCD (1 << 7) /* general call disable */ +#define ICR_ITEIE (1 << 8) /* enable tx interrupts */ +#define ICR_IRFIE (1 << 9) /* enable rx interrupts */ +#define ICR_BEIE (1 << 10) /* enable bus error ints */ +#define ICR_SSDIE (1 << 11) /* slave STOP detected int enable */ +#define ICR_ALDIE (1 << 12) /* enable arbitration interrupt */ +#define ICR_SADIE (1 << 13) /* slave address detected int enable */ +#define ICR_UR (1 << 14) /* unit reset */ + +#define ISR_RWM (1 << 0) /* read/write mode */ +#define ISR_ACKNAK (1 << 1) /* ack/nak status */ +#define ISR_UB (1 << 2) /* unit busy */ +#define ISR_IBB (1 << 3) /* bus busy */ +#define ISR_SSD (1 << 4) /* slave stop detected */ +#define ISR_ALD (1 << 5) /* arbitration loss detected */ +#define ISR_ITE (1 << 6) /* tx buffer empty */ +#define ISR_IRF (1 << 7) /* rx buffer full */ +#define ISR_GCAD (1 << 8) /* general call address detected */ +#define ISR_SAD (1 << 9) /* slave address detected */ +#define ISR_BED (1 << 10) /* bus error no ACK/NAK */ -#define ICR_START 0x1 /* start bit */ -#define ICR_STOP 0x2 /* stop bit */ -#define ICR_ACKNAK 0x4 /* send ACK(0) or NAK(1) */ -#define ICR_TB 0x8 /* transfer byte bit */ -#define ICR_MA 0x10 /* master abort */ -#define ICR_SCLE 0x20 /* master clock enable */ -#define ICR_IUE 0x40 /* unit enable */ -#define ICR_GCD 0x80 /* general call disable */ -#define ICR_ITEIE 0x100 /* enable tx interrupts */ -#define ICR_IRFIE 0x200 /* enable rx interrupts */ -#define ICR_BEIE 0x400 /* enable bus error ints */ -#define ICR_SSDIE 0x800 /* slave STOP detected int enable */ -#define ICR_ALDIE 0x1000 /* enable arbitration interrupt */ -#define ICR_SADIE 0x2000 /* slave address detected int enable */ -#define ICR_UR 0x4000 /* unit reset */ - -/* ----- Status register bits ----------------------------------------- */ - -#define ISR_RWM 0x1 /* read/write mode */ -#define ISR_ACKNAK 0x2 /* ack/nak status */ -#define ISR_UB 0x4 /* unit busy */ -#define ISR_IBB 0x8 /* bus busy */ -#define ISR_SSD 0x10 /* slave stop detected */ -#define ISR_ALD 0x20 /* arbitration loss detected */ -#define ISR_ITE 0x40 /* tx buffer empty */ -#define ISR_IRF 0x80 /* rx buffer full */ -#define ISR_GCAD 0x100 /* general call address detected */ -#define ISR_SAD 0x200 /* slave address detected */ -#define ISR_BED 0x400 /* bus error no ACK/NAK */ /* * Serial Audio Controller */ - -/* FIXME the audio defines collide w/ the SA1111 defines. I don't like these - * short defines because there is too much chance of namespace collision */ - -//#define SACR0 __REG(0x40400000) /* Global Control Register */ -//#define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */ -//#define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ -//#define SAIMR __REG(0x40400014) /* Serial Audio Interrupt Mask Register */ -//#define SAICR __REG(0x40400018) /* Serial Audio Interrupt Clear Register */ -//#define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */ -//#define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */ +/* FIXME: This clash with SA1111 defines */ +#ifndef CONFIG_SA1111 +#define SACR0 __REG(0x40400000) /* Global Control Register */ +#define SACR1 __REG(0x40400004) /* Serial Audio I 2 S/MSB-Justified Control Register */ +#define SASR0 __REG(0x4040000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ +#define SAIMR __REG(0x40400014) /* Serial Audio Interrupt Mask Register */ +#define SAICR __REG(0x40400018) /* Serial Audio Interrupt Clear Register */ +#define SADIV __REG(0x40400060) /* Audio Clock Divider Register. */ +#define SADR __REG(0x40400080) /* Serial Audio Data Register (TX and RX FIFO access Register). */ +#endif /* @@ -714,6 +690,30 @@ #define ICSR0 __REG(0x40800014) /* ICP Status Register 0 */ #define ICSR1 __REG(0x40800018) /* ICP Status Register 1 */ +#define ICCR0_AME (1 << 7) /* Adress match enable */ +#define ICCR0_TIE (1 << 6) /* Transmit FIFO interrupt enable */ +#define ICCR0_RIE (1 << 5) /* Recieve FIFO interrupt enable */ +#define ICCR0_RXE (1 << 4) /* Receive enable */ +#define ICCR0_TXE (1 << 3) /* Transmit enable */ +#define ICCR0_TUS (1 << 2) /* Transmit FIFO underrun select */ +#define ICCR0_LBM (1 << 1) /* Loopback mode */ +#define ICCR0_ITR (1 << 0) /* IrDA transmission */ + +#define ICSR0_FRE (1 << 5) /* Framing error */ +#define ICSR0_RFS (1 << 4) /* Receive FIFO service request */ +#define ICSR0_TFS (1 << 3) /* Transnit FIFO service request */ +#define ICSR0_RAB (1 << 2) /* Receiver abort */ +#define ICSR0_TUR (1 << 1) /* Trunsmit FIFO underun */ +#define ICSR0_EIF (1 << 0) /* End/Error in FIFO */ + +#define ICSR1_ROR (1 << 6) /* Receiver FIFO underrun */ +#define ICSR1_CRE (1 << 5) /* CRC error */ +#define ICSR1_EOF (1 << 4) /* End of frame */ +#define ICSR1_TNF (1 << 3) /* Transmit FIFO not full */ +#define ICSR1_RNE (1 << 2) /* Receive FIFO not empty */ +#define ICSR1_TBY (1 << 1) /* Tramsmiter busy flag */ +#define ICSR1_RSY (1 << 0) /* Recevier synchronized flag */ + /* * Real Time Clock @@ -1171,19 +1171,105 @@ #define LCCR0_BM (1 << 20) /* Branch mask */ #define LCCR0_OUM (1 << 21) /* Output FIFO underrun mask */ +#define LCCR1_PPL Fld (10, 0) /* Pixels Per Line - 1 */ +#define LCCR1_DisWdth(Pixel) /* Display Width [1..800 pix.] */ \ + (((Pixel) - 1) << FShft (LCCR1_PPL)) + +#define LCCR1_HSW Fld (6, 10) /* Horizontal Synchronization */ +#define LCCR1_HorSnchWdth(Tpix) /* Horizontal Synchronization */ \ + /* pulse Width [1..64 Tpix] */ \ + (((Tpix) - 1) << FShft (LCCR1_HSW)) + +#define LCCR1_ELW Fld (8, 16) /* End-of-Line pixel clock Wait */ + /* count - 1 [Tpix] */ +#define LCCR1_EndLnDel(Tpix) /* End-of-Line Delay */ \ + /* [1..256 Tpix] */ \ + (((Tpix) - 1) << FShft (LCCR1_ELW)) + +#define LCCR1_BLW Fld (8, 24) /* Beginning-of-Line pixel clock */ + /* Wait count - 1 [Tpix] */ +#define LCCR1_BegLnDel(Tpix) /* Beginning-of-Line Delay */ \ + /* [1..256 Tpix] */ \ + (((Tpix) - 1) << FShft (LCCR1_BLW)) + + +#define LCCR2_LPP Fld (10, 0) /* Line Per Panel - 1 */ +#define LCCR2_DisHght(Line) /* Display Height [1..1024 lines] */ \ + (((Line) - 1) << FShft (LCCR2_LPP)) + +#define LCCR2_VSW Fld (6, 10) /* Vertical Synchronization pulse */ + /* Width - 1 [Tln] (L_FCLK) */ +#define LCCR2_VrtSnchWdth(Tln) /* Vertical Synchronization pulse */ \ + /* Width [1..64 Tln] */ \ + (((Tln) - 1) << FShft (LCCR2_VSW)) + +#define LCCR2_EFW Fld (8, 16) /* End-of-Frame line clock Wait */ + /* count [Tln] */ +#define LCCR2_EndFrmDel(Tln) /* End-of-Frame Delay */ \ + /* [0..255 Tln] */ \ + ((Tln) << FShft (LCCR2_EFW)) + +#define LCCR2_BFW Fld (8, 24) /* Beginning-of-Frame line clock */ + /* Wait count [Tln] */ +#define LCCR2_BegFrmDel(Tln) /* Beginning-of-Frame Delay */ \ + /* [0..255 Tln] */ \ + ((Tln) << FShft (LCCR2_BFW)) + +#if 0 #define LCCR3_PCD (0xff) /* Pixel clock divisor */ #define LCCR3_ACB (0xff << 8) /* AC Bias pin frequency */ #define LCCR3_ACB_S 8 +#endif + #define LCCR3_API (0xf << 16) /* AC Bias pin trasitions per interrupt */ #define LCCR3_API_S 16 #define LCCR3_VSP (1 << 20) /* vertical sync polarity */ #define LCCR3_HSP (1 << 21) /* horizontal sync polarity */ #define LCCR3_PCP (1 << 22) /* pixel clock polarity */ #define LCCR3_OEP (1 << 23) /* output enable polarity */ +#if 0 #define LCCR3_BPP (7 << 24) /* bits per pixel */ #define LCCR3_BPP_S 24 +#endif #define LCCR3_DPC (1 << 27) /* double pixel clock mode */ + +#define LCCR3_PCD Fld (8, 0) /* Pixel Clock Divisor */ +#define LCCR3_PixClkDiv(Div) /* Pixel Clock Divisor */ \ + (((Div) << FShft (LCCR3_PCD))) + + +#define LCCR3_BPP Fld (3, 24) /* Bit Per Pixel */ +#define LCCR3_Bpp(Bpp) /* Bit Per Pixel */ \ + (((Bpp) << FShft (LCCR3_BPP))) + +#define LCCR3_ACB Fld (8, 8) /* AC Bias */ +#define LCCR3_Acb(Acb) /* BAC Bias */ \ + (((Acb) << FShft (LCCR3_ACB))) + +#define LCCR3_HorSnchH (LCCR3_HSP*0) /* Horizontal Synchronization */ + /* pulse active High */ +#define LCCR3_HorSnchL (LCCR3_HSP*1) /* Horizontal Synchronization */ + +#define LCCR3_VrtSnchH (LCCR3_VSP*0) /* Vertical Synchronization pulse */ + /* active High */ +#define LCCR3_VrtSnchL (LCCR3_VSP*1) /* Vertical Synchronization pulse */ + /* active Low */ + +#define LCSR_LDD (1 << 0) /* LCD Disable Done */ +#define LCSR_SOF (1 << 1) /* Start of frame */ +#define LCSR_BER (1 << 2) /* Bus error */ +#define LCSR_ABC (1 << 3) /* AC Bias count */ +#define LCSR_IUL (1 << 4) /* input FIFO underrun Lower panel */ +#define LCSR_IUU (1 << 5) /* input FIFO underrun Upper panel */ +#define LCSR_OU (1 << 6) /* output FIFO underrun */ +#define LCSR_QD (1 << 7) /* quick disable */ +#define LCSR_EOF (1 << 8) /* end of frame */ +#define LCSR_BS (1 << 9) /* branch status */ +#define LCSR_SINT (1 << 10) /* subsequent interrupt */ + +#define LDCMD_PAL (1 << 26) /* instructs DMA to load palette buffer */ + #define LCSR_LDD (1 << 0) /* LCD Disable Done */ #define LCSR_SOF (1 << 1) /* Start of frame */ #define LCSR_BER (1 << 2) /* Bus error */ diff -urN linux-2.5.63-bk3/include/asm-arm/arch-pxa/system.h linux-2.5.63-bk4/include/asm-arm/arch-pxa/system.h --- linux-2.5.63-bk3/include/asm-arm/arch-pxa/system.h Mon Feb 24 11:05:16 2003 +++ linux-2.5.63-bk4/include/asm-arm/arch-pxa/system.h Mon Mar 31 12:18:10 2003 @@ -27,7 +27,7 @@ /* Initialize the watchdog and let it fire */ OWER = OWER_WME; OSSR = OSSR_M3; - OSMR3 = OSCR + 36864; /* ... in 10 ms */ + OSMR3 = OSCR + 368640; /* ... in 100 ms */ } } diff -urN linux-2.5.63-bk3/include/asm-arm/arch-pxa/time.h linux-2.5.63-bk4/include/asm-arm/arch-pxa/time.h --- linux-2.5.63-bk3/include/asm-arm/arch-pxa/time.h Mon Feb 24 11:05:31 2003 +++ linux-2.5.63-bk4/include/asm-arm/arch-pxa/time.h Mon Mar 31 12:18:10 2003 @@ -42,7 +42,7 @@ elapsed = LATCH - ticks_to_match; /* Now convert them to usec */ - usec = (unsigned long)(elapsed*tick)/LATCH; + usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH; return usec; } @@ -52,6 +52,8 @@ long flags; int next_match; + do_profile(regs); + /* Loop until we get ahead of the free running timer. * This ensures an exact clock tick count and time accuracy. * IRQs are disabled inside the loop to ensure coherence between diff -urN linux-2.5.63-bk3/include/linux/agp_backend.h linux-2.5.63-bk4/include/linux/agp_backend.h --- linux-2.5.63-bk3/include/linux/agp_backend.h Mon Feb 24 11:05:40 2003 +++ linux-2.5.63-bk4/include/linux/agp_backend.h Mon Mar 31 12:18:10 2003 @@ -46,6 +46,8 @@ INTEL_I820, INTEL_I830_M, INTEL_I845_G, + INTEL_I855_PM, + INTEL_I865_G, INTEL_I840, INTEL_I845, INTEL_I850, diff -urN linux-2.5.63-bk3/include/linux/ghash.h linux-2.5.63-bk4/include/linux/ghash.h --- linux-2.5.63-bk3/include/linux/ghash.h Mon Feb 24 11:06:01 2003 +++ linux-2.5.63-bk4/include/linux/ghash.h Wed Dec 31 16:00:00 1969 @@ -1,218 +0,0 @@ -/* - * include/linux/ghash.h -- generic hashing with fuzzy retrieval - * - * (C) 1997 Thomas Schoebel-Theuer - * - * The algorithms implemented here seem to be a completely new invention, - * and I'll publish the fundamentals in a paper. - */ - -#ifndef _GHASH_H -#define _GHASH_H -/* HASHSIZE _must_ be a power of two!!! */ - - -#define DEF_HASH_FUZZY_STRUCTS(NAME,HASHSIZE,TYPE) \ -\ -struct NAME##_table {\ - TYPE * hashtable[HASHSIZE];\ - TYPE * sorted_list;\ - int nr_entries;\ -};\ -\ -struct NAME##_ptrs {\ - TYPE * next_hash;\ - TYPE * prev_hash;\ - TYPE * next_sorted;\ - TYPE * prev_sorted;\ -}; - -#define DEF_HASH_FUZZY(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ -\ -LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - int ix = HASHFN(elem->KEY);\ - TYPE ** base = &tbl->hashtable[ix];\ - TYPE * ptr = *base;\ - TYPE * prev = NULL;\ -\ - tbl->nr_entries++;\ - while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ - base = &ptr->PTRS.next_hash;\ - prev = ptr;\ - ptr = *base;\ - }\ - elem->PTRS.next_hash = ptr;\ - elem->PTRS.prev_hash = prev;\ - if(ptr) {\ - ptr->PTRS.prev_hash = elem;\ - }\ - *base = elem;\ -\ - ptr = prev;\ - if(!ptr) {\ - ptr = tbl->sorted_list;\ - prev = NULL;\ - } else {\ - prev = ptr->PTRS.prev_sorted;\ - }\ - while(ptr) {\ - TYPE * next = ptr->PTRS.next_hash;\ - if(next && KEYCMP(next->KEY, elem->KEY)) {\ - prev = ptr;\ - ptr = next;\ - } else if(KEYCMP(ptr->KEY, elem->KEY)) {\ - prev = ptr;\ - ptr = ptr->PTRS.next_sorted;\ - } else\ - break;\ - }\ - elem->PTRS.next_sorted = ptr;\ - elem->PTRS.prev_sorted = prev;\ - if(ptr) {\ - ptr->PTRS.prev_sorted = elem;\ - }\ - if(prev) {\ - prev->PTRS.next_sorted = elem;\ - } else {\ - tbl->sorted_list = elem;\ - }\ -}\ -\ -LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - TYPE * next = elem->PTRS.next_hash;\ - TYPE * prev = elem->PTRS.prev_hash;\ -\ - tbl->nr_entries--;\ - if(next)\ - next->PTRS.prev_hash = prev;\ - if(prev)\ - prev->PTRS.next_hash = next;\ - else {\ - int ix = HASHFN(elem->KEY);\ - tbl->hashtable[ix] = next;\ - }\ -\ - next = elem->PTRS.next_sorted;\ - prev = elem->PTRS.prev_sorted;\ - if(next)\ - next->PTRS.prev_sorted = prev;\ - if(prev)\ - prev->PTRS.next_sorted = next;\ - else\ - tbl->sorted_list = next;\ -}\ -\ -LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ -{\ - int ix = hashfn(pos);\ - TYPE * ptr = tbl->hashtable[ix];\ - while(ptr && KEYCMP(ptr->KEY, pos))\ - ptr = ptr->PTRS.next_hash;\ - if(ptr && !KEYEQ(ptr->KEY, pos))\ - ptr = NULL;\ - return ptr;\ -}\ -\ -LINKAGE TYPE * find_##NAME##_hash_fuzzy(struct NAME##_table * tbl, KEYTYPE pos)\ -{\ - int ix;\ - int offset;\ - TYPE * ptr;\ - TYPE * next;\ -\ - ptr = tbl->sorted_list;\ - if(!ptr || KEYCMP(pos, ptr->KEY))\ - return NULL;\ - ix = HASHFN(pos);\ - offset = HASHSIZE;\ - do {\ - offset >>= 1;\ - next = tbl->hashtable[(ix+offset) & ((HASHSIZE)-1)];\ - if(next && (KEYCMP(next->KEY, pos) || KEYEQ(next->KEY, pos))\ - && KEYCMP(ptr->KEY, next->KEY))\ - ptr = next;\ - } while(offset);\ -\ - for(;;) {\ - next = ptr->PTRS.next_hash;\ - if(next) {\ - if(KEYCMP(next->KEY, pos)) {\ - ptr = next;\ - continue;\ - }\ - }\ - next = ptr->PTRS.next_sorted;\ - if(next && KEYCMP(next->KEY, pos)) {\ - ptr = next;\ - continue;\ - }\ - return ptr;\ - }\ - return NULL;\ -} - -#define DEF_HASH_STRUCTS(NAME,HASHSIZE,TYPE) \ -\ -struct NAME##_table {\ - TYPE * hashtable[HASHSIZE];\ - int nr_entries;\ -};\ -\ -struct NAME##_ptrs {\ - TYPE * next_hash;\ - TYPE * prev_hash;\ -}; - -#define DEF_HASH(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ -\ -LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - int ix = HASHFN(elem->KEY);\ - TYPE ** base = &tbl->hashtable[ix];\ - TYPE * ptr = *base;\ - TYPE * prev = NULL;\ -\ - tbl->nr_entries++;\ - while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ - base = &ptr->PTRS.next_hash;\ - prev = ptr;\ - ptr = *base;\ - }\ - elem->PTRS.next_hash = ptr;\ - elem->PTRS.prev_hash = prev;\ - if(ptr) {\ - ptr->PTRS.prev_hash = elem;\ - }\ - *base = elem;\ -}\ -\ -LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ -{\ - TYPE * next = elem->PTRS.next_hash;\ - TYPE * prev = elem->PTRS.prev_hash;\ -\ - tbl->nr_entries--;\ - if(next)\ - next->PTRS.prev_hash = prev;\ - if(prev)\ - prev->PTRS.next_hash = next;\ - else {\ - int ix = HASHFN(elem->KEY);\ - tbl->hashtable[ix] = next;\ - }\ -}\ -\ -LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ -{\ - int ix = hashfn(pos);\ - TYPE * ptr = tbl->hashtable[ix];\ - while(ptr && KEYCMP(ptr->KEY, pos))\ - ptr = ptr->PTRS.next_hash;\ - if(ptr && !KEYEQ(ptr->KEY, pos))\ - ptr = NULL;\ - return ptr;\ -} - -#endif diff -urN linux-2.5.63-bk3/include/linux/net.h linux-2.5.63-bk4/include/linux/net.h --- linux-2.5.63-bk3/include/linux/net.h Mon Feb 24 11:05:16 2003 +++ linux-2.5.63-bk4/include/linux/net.h Mon Mar 31 12:18:10 2003 @@ -210,23 +210,23 @@ (file, sock, vma)) \ \ static struct proto_ops name##_ops = { \ - family: fam, \ + .family = fam, \ \ - release: __lock_##name##_release, \ - bind: __lock_##name##_bind, \ - connect: __lock_##name##_connect, \ - socketpair: __lock_##name##_socketpair, \ - accept: __lock_##name##_accept, \ - getname: __lock_##name##_getname, \ - poll: __lock_##name##_poll, \ - ioctl: __lock_##name##_ioctl, \ - listen: __lock_##name##_listen, \ - shutdown: __lock_##name##_shutdown, \ - setsockopt: __lock_##name##_setsockopt, \ - getsockopt: __lock_##name##_getsockopt, \ - sendmsg: __lock_##name##_sendmsg, \ - recvmsg: __lock_##name##_recvmsg, \ - mmap: __lock_##name##_mmap, \ + .release = __lock_##name##_release, \ + .bind = __lock_##name##_bind, \ + .connect = __lock_##name##_connect, \ + .socketpair = __lock_##name##_socketpair, \ + .accept = __lock_##name##_accept, \ + .getname = __lock_##name##_getname, \ + .poll = __lock_##name##_poll, \ + .ioctl = __lock_##name##_ioctl, \ + .listen = __lock_##name##_listen, \ + .shutdown = __lock_##name##_shutdown, \ + .setsockopt = __lock_##name##_setsockopt, \ + .getsockopt = __lock_##name##_getsockopt, \ + .sendmsg = __lock_##name##_sendmsg, \ + .recvmsg = __lock_##name##_recvmsg, \ + .mmap = __lock_##name##_mmap, \ }; #endif diff -urN linux-2.5.63-bk3/include/linux/pci_ids.h linux-2.5.63-bk4/include/linux/pci_ids.h --- linux-2.5.63-bk3/include/linux/pci_ids.h Mon Feb 24 11:05:16 2003 +++ linux-2.5.63-bk4/include/linux/pci_ids.h Mon Mar 31 12:18:10 2003 @@ -1861,8 +1861,12 @@ #define PCI_DEVICE_ID_INTEL_82860_HB 0x2531 #define PCI_DEVICE_ID_INTEL_82845G_HB 0x2560 #define PCI_DEVICE_ID_INTEL_82845G_IG 0x2562 +#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570 +#define PCI_DEVICE_ID_INTEL_82865_IG 0x2572 #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 +#define PCI_DEVICE_ID_INTEL_82855_HB 0x3580 +#define PCI_DEVICE_ID_INTEL_82855_IG 0x3582 #define PCI_DEVICE_ID_INTEL_80310 0x530d #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 diff -urN linux-2.5.63-bk3/kernel/fork.c linux-2.5.63-bk4/kernel/fork.c --- linux-2.5.63-bk3/kernel/fork.c Mon Mar 31 12:18:06 2003 +++ linux-2.5.63-bk4/kernel/fork.c Mon Mar 31 12:18:10 2003 @@ -72,15 +72,8 @@ return total; } -void __put_task_struct(struct task_struct *tsk) +static void free_task_struct(struct task_struct *tsk) { - WARN_ON(!(tsk->state & (TASK_DEAD | TASK_ZOMBIE))); - WARN_ON(atomic_read(&tsk->usage)); - WARN_ON(tsk == current); - - security_task_free(tsk); - free_uid(tsk->user); - /* * The task cache is effectively disabled right now. * Do we want it? The slab cache already has per-cpu @@ -103,6 +96,17 @@ } } +void __put_task_struct(struct task_struct *tsk) +{ + WARN_ON(!(tsk->state & (TASK_DEAD | TASK_ZOMBIE))); + WARN_ON(atomic_read(&tsk->usage)); + WARN_ON(tsk == current); + + security_task_free(tsk); + free_uid(tsk->user); + free_task_struct(tsk); +} + void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) { unsigned long flags; @@ -1034,7 +1038,7 @@ atomic_dec(&p->user->processes); free_uid(p->user); bad_fork_free: - put_task_struct(p); + free_task_struct(p); goto fork_out; } diff -urN linux-2.5.63-bk3/kernel/posix-timers.c linux-2.5.63-bk4/kernel/posix-timers.c --- linux-2.5.63-bk3/kernel/posix-timers.c Mon Feb 24 11:05:32 2003 +++ linux-2.5.63-bk4/kernel/posix-timers.c Mon Mar 31 12:18:10 2003 @@ -1207,7 +1207,7 @@ { struct timespec t; struct timer_list new_timer; - struct abs_struct abs_struct = { list:{next:0} }; + struct abs_struct abs_struct = { .list = { .next = 0 } }; int abs; int rtn = 0; int active; diff -urN linux-2.5.63-bk3/sound/oss/ad1848.c linux-2.5.63-bk4/sound/oss/ad1848.c --- linux-2.5.63-bk3/sound/oss/ad1848.c Mon Feb 24 11:05:34 2003 +++ linux-2.5.63-bk4/sound/oss/ad1848.c Mon Mar 31 12:18:10 2003 @@ -2987,7 +2987,7 @@ if (err < 0) return(NULL); - if((err = pnp_activate_dev(dev,NULL)) < 0) { + if((err = pnp_activate_dev(dev)) < 0) { printk(KERN_ERR "ad1848: %s %s config failed (out of resources?)[%d]\n", devname, resname, err); pnp_device_detach(dev); @@ -3024,7 +3024,7 @@ static int __init ad1848_isapnp_init(struct address_info *hw_config, struct pnp_card *bus, int slot) { - char *busname = bus->name[0] ? bus->name : ad1848_isapnp_list[slot].name; + char *busname = bus->dev.name[0] ? bus->dev.name : ad1848_isapnp_list[slot].name; /* Initialize this baby. */