]> git.pld-linux.org Git - packages/kernel.git/blob - 2.6.0-test9-nforce-ideata133.patch
- obsolete
[packages/kernel.git] / 2.6.0-test9-nforce-ideata133.patch
1 diff -ruN linux-2.6.0-test9.old/drivers/ide/pci/amd74xx.c linux-2.6.0-test9/drivers/ide/pci/amd74xx.c
2 --- linux-2.6.0-test9.old/drivers/ide/pci/amd74xx.c     2003-10-25 14:44:56.000000000 -0400
3 +++ linux-2.6.0-test9/drivers/ide/pci/amd74xx.c 2003-10-26 11:52:21.356658016 -0500
4 @@ -40,6 +40,7 @@
5  #define AMD_UDMA_33            0x01
6  #define AMD_UDMA_66            0x02
7  #define AMD_UDMA_100           0x03
8 +#define AMD_UDMA_133           0x04
9  #define AMD_CHECK_SWDMA                0x08
10  #define AMD_BAD_SWDMA          0x10
11  #define AMD_BAD_FIFO           0x20
12 @@ -60,7 +61,13 @@
13         { PCI_DEVICE_ID_AMD_OPUS_7441, 0x00, 0x40, AMD_UDMA_100 },                      /* AMD-768 Opus */
14         { PCI_DEVICE_ID_AMD_8111_IDE,  0x00, 0x40, AMD_UDMA_100 },                      /* AMD-8111 */
15          { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x00, 0x50, AMD_UDMA_100 },                  /* nVidia nForce */
16 -       { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_100 },                 /* nVidia nForce 2 */
17 +       { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_133 },                 /* nVidia nForce2 */
18 +       { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x00, 0x50, AMD_UDMA_133 },                /* nVidia nForce2s */
19 +       { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x00, 0x50, AMD_UDMA_133 },               /* nVidia nForce2s SATA */
20 +       { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x00, 0x50, AMD_UDMA_133 },                 /* NVIDIA nForce3 */
21 +       { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x00, 0x50, AMD_UDMA_133 },                /* NVIDIA nForce3s */
22 +       { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x00, 0x50, AMD_UDMA_133 },               /* NVIDIA nForce3s SATA */
23 +       { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x00, 0x50, AMD_UDMA_133 },              /* NVIDIA nForce3s SATA2 */
24         { 0 }
25  };
26  
27 @@ -68,9 +75,9 @@
28  static unsigned int amd_80w;
29  static unsigned int amd_clock;
30  
31 -static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3 };
32 -static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 1 };
33 -static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100" };
34 +static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 7 };
35 +static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 0 };
36 +static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" };
37  
38  /*
39   * AMD /proc entry.
40 @@ -152,6 +159,11 @@
41                         cycle[i] = 666666 / amd_clock;
42                         continue;
43                 }
44 +               if (den[i] && uen[i] && udma[i] == 0) {
45 +                       speed[i] = amd_clock * 4;
46 +                       cycle[i] = 500000 / amd_clock;
47 +                       continue;
48 +               }
49  
50                 speed[i] = 4 * amd_clock / ((den[i] && uen[i]) ? udma[i] : (active[i] + recover[i]) * 2);
51                 cycle[i] = 1000000 * ((den[i] && uen[i]) ? udma[i] : (active[i] + recover[i]) * 2) / amd_clock / 2;
52 @@ -198,6 +210,7 @@
53                 case AMD_UDMA_33:  t = timing->udma ? (0xc0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
54                 case AMD_UDMA_66:  t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
55                 case AMD_UDMA_100: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
56 +               case AMD_UDMA_133: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 11)]) : 0x03; break;
57                 default: return;
58         }
59  
60 @@ -231,7 +244,12 @@
61                 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
62         }
63  
64 +       /*
65 +        * AMD / nForce UDMA timing register should really be programmed 
66 +        * based on UDMA mode not UDMA cycle time...
67 +        */
68         if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
69 +       if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 11;
70  
71         amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);
72  
73 @@ -271,7 +289,8 @@
74                 XFER_PIO | XFER_EPIO | XFER_MWDMA | XFER_UDMA |
75                 ((amd_config->flags & AMD_BAD_SWDMA) ? 0 : XFER_SWDMA) |
76                 (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_66 ? XFER_UDMA_66 : 0) |
77 -               (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ? XFER_UDMA_100 : 0));
78 +               (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ? XFER_UDMA_100 : 0) |
79 +               (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_133 ? XFER_UDMA_133 : 0));
80  
81         amd_set_drive(drive, speed);
82  
83 @@ -307,6 +326,7 @@
84  
85         switch (amd_config->flags & AMD_UDMA) {
86  
87 +               case AMD_UDMA_133:
88                 case AMD_UDMA_100:
89                         pci_read_config_byte(dev, AMD_CABLE_DETECT, &t);
90                         pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);
91 @@ -431,6 +451,12 @@
92         { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE,        PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
93         { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
94         { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
95 +       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
96 +       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
97 +       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9},
98 +       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10},
99 +       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11},
100 +       { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
101         { 0, },
102  };
103  
104 diff -ruN linux-2.6.0-test9.old/drivers/ide/pci/amd74xx.h linux-2.6.0-test9/drivers/ide/pci/amd74xx.h
105 --- linux-2.6.0-test9.old/drivers/ide/pci/amd74xx.h     2003-10-25 14:42:51.000000000 -0400
106 +++ linux-2.6.0-test9/drivers/ide/pci/amd74xx.h 2003-10-26 11:52:21.356658016 -0500
107 @@ -109,6 +109,84 @@
108                 .bootable       = ON_BOARD,
109                 .extra          = 0,
110         },
111 +       {       /* 7 */
112 +               .vendor         = PCI_VENDOR_ID_NVIDIA,
113 +               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE,
114 +               .name           = "NFORCE2",
115 +               .init_chipset   = init_chipset_amd74xx,
116 +               .init_iops      = NULL,
117 +               .init_hwif      = init_hwif_amd74xx,
118 +               .channels       = 2,
119 +               .autodma        = AUTODMA,
120 +               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
121 +               .bootable       = ON_BOARD,
122 +               .extra          = 0,
123 +       },
124 +       {       /* 8 */
125 +               .vendor         = PCI_VENDOR_ID_NVIDIA,
126 +               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA,
127 +               .name           = "NFORCE2",
128 +               .init_chipset   = init_chipset_amd74xx,
129 +               .init_iops      = NULL,
130 +               .init_hwif      = init_hwif_amd74xx,
131 +               .channels       = 2,
132 +               .autodma        = AUTODMA,
133 +               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
134 +               .bootable       = ON_BOARD,
135 +               .extra          = 0,
136 +       },
137 +       {       /* 9 */
138 +               .vendor         = PCI_VENDOR_ID_NVIDIA,
139 +               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE,
140 +               .name           = "NFORCE3",
141 +               .init_chipset   = init_chipset_amd74xx,
142 +               .init_iops      = NULL,
143 +               .init_hwif      = init_hwif_amd74xx,
144 +               .channels       = 2,
145 +               .autodma        = AUTODMA,
146 +               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
147 +               .bootable       = ON_BOARD,
148 +               .extra          = 0,
149 +       },
150 +       {       /* 10 */
151 +               .vendor         = PCI_VENDOR_ID_NVIDIA,
152 +               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE,
153 +               .name           = "NFORCE3",
154 +               .init_chipset   = init_chipset_amd74xx,
155 +               .init_iops      = NULL,
156 +               .init_hwif      = init_hwif_amd74xx,
157 +               .channels       = 2,
158 +               .autodma        = AUTODMA,
159 +               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
160 +               .bootable       = ON_BOARD,
161 +               .extra          = 0,
162 +       },
163 +       {       /* 11 */
164 +               .vendor         = PCI_VENDOR_ID_NVIDIA,
165 +               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,
166 +               .name           = "NFORCE3",
167 +               .init_chipset   = init_chipset_amd74xx,
168 +               .init_iops      = NULL,
169 +               .init_hwif      = init_hwif_amd74xx,
170 +               .channels       = 2,
171 +               .autodma        = AUTODMA,
172 +               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
173 +               .bootable       = ON_BOARD,
174 +               .extra          = 0,
175 +       },
176 +       {       /* 12 */
177 +               .vendor         = PCI_VENDOR_ID_NVIDIA,
178 +               .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2,
179 +               .name           = "NFORCE3",
180 +               .init_chipset   = init_chipset_amd74xx,
181 +               .init_iops      = NULL,
182 +               .init_hwif      = init_hwif_amd74xx,
183 +               .channels       = 2,
184 +               .autodma        = AUTODMA,
185 +               .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}},
186 +               .bootable       = ON_BOARD,
187 +               .extra          = 0,
188 +       },
189         {
190                 .vendor         = 0,
191                 .device         = 0,
192 diff -ruN linux-2.6.0-test9.old/include/linux/pci_ids.h linux-2.6.0-test9/include/linux/pci_ids.h
193 --- linux-2.6.0-test9.old/include/linux/pci_ids.h       2003-10-25 14:43:29.000000000 -0400
194 +++ linux-2.6.0-test9/include/linux/pci_ids.h   2003-10-26 11:52:21.357657864 -0500
195 @@ -1023,7 +1023,13 @@
196  #define PCI_DEVICE_ID_NVIDIA_VTNT2             0x002C
197  #define PCI_DEVICE_ID_NVIDIA_UVTNT2            0x002D
198  #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE       0x0065
199 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE      0x0085
200 +#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA     0x008e
201  #define PCI_DEVICE_ID_NVIDIA_ITNT2             0x00A0
202 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE       0x00d5
203 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA     0x00e3
204 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE      0x00e5
205 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2    0x00ee
206  #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR       0x0100
207  #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR       0x0101
208  #define PCI_DEVICE_ID_NVIDIA_QUADRO            0x0103
This page took 0.048885 seconds and 3 git commands to generate.