      ATA/133 Kernel Patch Package for VIA VT8251/VT8237A/CX700

                   Version 4.3, February 10, 2006
 
          Copyright (C) 2002-2006 VIA Technologies, INC.


Summary
====================================================================

This file describes how to patch IDE driver source file to rebuild 
the Linux kernel including ATA/133 support of VIA VT8251/VT8237A/CX700.
Also, This package only supports Fedora Core 2/3/4, Mandriva 2005/2006
and SuSE 9.3/10.0. In addtion, there are a boot issue in Mandriva Linux
and an installation issue in SUSE Linux, VIA has provided the solutions
for each issues. 
For Mandriva Linux, please refer to:

      Solution_for_Mandriva_boot_issue

For SUSE Linux, please refer to:

      Solution_for_SUSE_installation_issue
    

File description
====================================================================

This package contains 10 files as described below. 

      README
      Solution_for_Mandriva_boot_issue
      Solution_for_SUSE_installation_issue
      Fedora/FC2_2.6.5-1.358.patch
      Fedora/FC3_2.6.9-1.667.patch
      Fedora/FC4_2.6.11-1.1369_FC4.patch
      Mandriva/MDK2005_2.6.11-6.patch
      Mandriva/MDK2006_2.6.12-12mdk.patch
      SuSE/SuSE10_2.6.13-15-default.patch
      SuSE/SuSE9.3_2.6.11.4-20a.patch    


Patch the Linux IDE driver source file
====================================================================

1. Before patchng the kernel, make sure the kernel source package is
   installed. If not, please install it from the Installation CD by 
   the following command:
   
   For Mandriva and SUSE Linux

      # rpm -ivh kernel-source-<Kernel Version>.ix86.rpm

   For Fedora Linux

      # rpm -ivh kernel-<Kernel Version>.ix86.src.rpm

2. The Linux kernel including driver source files are all placed in
   the directory /usr/src/linux-<Kernel Version>. 

      #cd /usr/src/linux-<Kernel Version>
 
   In Fedora Core series, users have to patch the kernel source after
   installing the kernel source RPM package.
      
      #cd /usr/src/redhat/SPEC/
      #rpmbuild -bp kernel-2.6.spec --target i686
      #cd /usr/src/redhat/BUILD/kernel-<Kernel Version>
      #mv linux-<Kernel Version> /usr/src/linux-<Kernel Version>

3. Then find the suitable patch, "<OS>_<Kernel Version>.patch"
   in the package.

      #cd /usr/src/linux-<Kernel Version>
      #patch -p1 < <Patch_DIR>/<OS>/<OS>_<Kernel Version>.patch


Rebuild the Linux kernel
====================================================================

1. Change the current directory to /usr/src/linux-<Kernel Version>

      # cd linux-<Kernel Version>
      # cp /boot/config-<Kernel Version> .config

2. Edit the "Makefile" and modify the forth line form "EXTRAVERSION="
   to "EXTRAVERSION=-test" in order to name the new kernel.

3. Configure the system. The system will ask about driver settings.

      #make menuconfig (config or  xconfig)

4. Make sure the "VIA82CXXX chipset support" is enabled under the
   "ATA/IDE/MFM/RLL support/IDE,ATA and ATAPI Block devices"

   Note: Pay attention to the processor type and check if the system
         supports multiple processors. If the system is a uni-processor
         system, disable the multiprocessor support. 

5. Then exit and save the configuration. Run the following commands to 
   rebuild the kernel.

      # make 
      # make modules_install 
      # mkinitrd /boot/test.img <Kernel Version>-test

          
6. Copy the newly built kernel to /boot/.
 
      # cp arch/i386/boot/bzImage /boot/vmlinuz-test

7. For the GRUB boot loader, add the following two lines to the 
   /boot/grub/menu.lst file. Then modify the "hda1" according to
   the actual system settings.

      Title linux-test
      kernel /boot/vmlinuz-test ro root=/dev/hda1 acpi=off
      initrd /boot/test.img	

8. Reboot Linux system and choose the newly added "linux-test". The
   boot message will show below if using the south bridge VT8251, 
   VT8237a or CX700.
    
    "VP_IDE: VIA vt8251 (rev 00) IDE UDMA133 controller on pci00:0f.1"
    or    
    "VP_IDE: VIA vt8237a (rev 00) IDE UDMA133 controller on pci00:0f.1"
    or
    "VP_IDE: VIA cx700 (rev 00) IDE UDMA133 controller on pci00:0f.1"
    

Measure IDE performance
====================================================================

Use the "hdparm" utility to test IDE performance. The utility provides
a command line interface to various hard disk ioctls supported by the
device driver. The following options are available for how to enable/
disable DMA, change the UDMA mode, and measure the data transfer
throughput.
 
1. The parameter -T is essentially to measure the throughput of the
   processor, cache, and the memory of the system, -t is to measure
   how fast the drive can sustain sequential data reads.

    eg: hdparm -tT /dev/hda

2. The parameter -d1 is to enable DMA mode, -d0 is to disable DMA mode.

    eg: hdparm -d1 /dev/hda  (to enable DMA)
        hdparm -d0 /dev/hda  (to disable DMA)

3. The parameter -X [16~18, 32~34, 64~70] is to switch the transfer mode,
   16~18 for SDMA 0~2, 32~34 for MDMA 0~2, 64~70 for UDMA 0~6.

    eg: hdparm -X70 /dev/hda  (switch to UDMA 6 mode)

4. The parameter -i to check the current transfer mode.

