Re: [preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Vojtech Pavlik

On Fri, Oct 06, 2000 at 08:04:42AM -0400, Byron Stanoszek wrote:
> On Fri, 6 Oct 2000, Vojtech Pavlik wrote:
> 
> > Hi!
> > 
> > For those who like to try out the very latest developments, I'm
> > including my latest VIA and AMD IDE tuning drivers.
> > 
> > Just place all the files in drivers/ide of a 2.4 kernel and have fun.
> > 
> > Of course, I'm interested in all success/failure stories.
> 
> Hi there. I have not had a chance to test my kernel with your patch yet, but I
> couldn't help noticing a glob of timing code in your ide-timing.h file. Did I
> miss something one day, or is the general concensus now to put code in header
> files? I'd prefer to see them as a separate module (ide-timing.c) or something
> that is compiled in for both via82cxxx.c and amd7540.c. What if you wanted both
> drivers for some reason, the code would get entered into the kernel twice.
> 
> Well, I assume it is in the header file because it is used by both .c files. If
> not, then it makes sense to just stick that code into one of the .c files.
> (Perhaps I should take a closer look at the code :).

It's a .h file just for the ease-of-use sake now. I'm planning to turn
it into a .c library file. However, that requires modificating the
makefiles and I needed a drop-in replacement for the moment.

> Anyway, I'm planning on doing some pretty big tests later tonight with that
> driver. One thing that I noticed while using v1.2 of the via82cxxx.c driver is
> that with a pci bus rate of 37mhz and a 33mhz udma dvd-rom (Pioneer 16x),
> playing a cd will suddenly stop playing on certain songs. These 'stop points'
> seem to be evenly distributed across the cd (every 12 minutes or so). Not sure
> exactly what it is, but I thought I'd bring it to your attention. I don't have
> enough testing performed on that to determine if it is overclocking the pci bus
> that caused that, or your driver, or something else. I do know that it worked
> fine in test7 with the old non-existant drive timings.
> 
> I guess I'm just ranting for now, but I will have some results for you later
> tonight. Thanks for hearing me out. :)

Just make sure you specify idebus=37 to the kernel, so that the driver
has a chance to compute the correct timing.

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Vojtech Pavlik

On Fri, Oct 06, 2000 at 01:58:52AM -0700, Andre Hedrick wrote:

> You are just having to much fun!

Oh yes, I am. :) Just found yet-another-vt82c686a-bug. With heavy IDE disk
activity at UDMA66 speed the PIT (i8253) latch register gets reset to a
random value now and then. Seems like some interference inside the chip.

The time on the machine then behaves rather funny ... I wonder if this
affects other VIA chips as well or just my stepping CD silicon of the 686a.

By the way, any comments about the new VIA & AMD drivers, and the
ide-tuning.h include file?

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Andre Hedrick


You are just having to much fun!


On Fri, 6 Oct 2000, Vojtech Pavlik wrote:

> Hi!
> 
> For those who like to try out the very latest developments, I'm
> including my latest VIA and AMD IDE tuning drivers.
> 
> Just place all the files in drivers/ide of a 2.4 kernel and have fun.
> 
> Of course, I'm interested in all success/failure stories.
> 
> Thanks.
> 
> -- 
> Vojtech Pavlik
> SuSE Labs
> 

Andre Hedrick
The Linux ATA/IDE guy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



[preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Vojtech Pavlik

Hi!

For those who like to try out the very latest developments, I'm
including my latest VIA and AMD IDE tuning drivers.

Just place all the files in drivers/ide of a 2.4 kernel and have fun.

Of course, I'm interested in all success/failure stories.

Thanks.

-- 
Vojtech Pavlik
SuSE Labs


#ifndef _IDE_TIMING_H
#define _IDE_TIMING_H

/*
 * $Id: ide-timing.h,v 1.4 2000/10/02 20:48:56 vojtech Exp $
 *
 *  Copyright (c) 1999-2000 Vojtech Pavlik
 *
 *  Sponsored by SuSE
 */

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * Should you need to contact me, the author, you can do so either by
 * e-mail - mail your message to <[EMAIL PROTECTED]>, or by paper mail:
 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
 */

#include 

#ifndef XFER_PIO_5
#define XFER_PIO_5  0x0d
#endif

struct ide_timing {
short mode;
short setup;/* t1 */
short act8b;/* t2 for 8-bit io */
short rec8b;/* t2i for 8-bit io */
short cyc8b;/* t0 for 8-bit io */
short active;   /* t2 or tD */
short recover;  /* t2i or tK */
short cycle;/* t0 */
short udma; /* t2CYCTYP/2 */
};

/*
 * PIO 0-5, MWDMA 0-2 and UDMA 0-5 timings (in nanoseconds).
 * These were taken from ATA/ATAPI-6 standard, rev 0a, except
 * for PIO 5, which is a nonstandard extension.
 */

static struct ide_timing ide_timing[] = {

{ XFER_UDMA_5, 0,   0,   0,   0,   0,   0,   0,  20 },
{ XFER_UDMA_4, 0,   0,   0,   0,   0,   0,   0,  30 },
{ XFER_UDMA_3, 0,   0,   0,   0,   0,   0,   0,  45 },

{ XFER_UDMA_2, 0,   0,   0,   0,   0,   0,   0,  60 },
{ XFER_UDMA_1, 0,   0,   0,   0,   0,   0,   0,  80 },
{ XFER_UDMA_0, 0,   0,   0,   0,   0,   0,   0, 120 },
  
{ XFER_MW_DMA_2,  25,   0,   0,   0,  70,  25, 120,   0 },
{ XFER_MW_DMA_1,  45,   0,   0,   0,  80,  50, 150,   0 },
{ XFER_MW_DMA_0,  60,   0,   0,   0, 215, 215, 480,   0 },
  
{ XFER_SW_DMA_2,  60,   0,   0,   0, 120, 120, 240,   0 },
{ XFER_SW_DMA_1,  90,   0,   0,   0, 240, 240, 480,   0 },
{ XFER_SW_DMA_0, 120,   0,   0,   0, 480, 480, 960,   0 },

{ XFER_PIO_5, 20,  50,  30, 100,  50,  30, 100,   0 },
{ XFER_PIO_4, 25,  70,  25, 120,  70,  25, 120,   0 },
{ XFER_PIO_3, 30,  80,  70, 180,  80,  70, 180,   0 },

{ XFER_PIO_2, 30, 290,  40, 330, 100,  90, 240,   0 },
{ XFER_PIO_1, 50, 290,  93, 383, 125, 100, 383,   0 },
{ XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600,   0 },

{ XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 960,   0 },

{ -1 }
};

#define IDE_TIMING_SETUP0x01
#define IDE_TIMING_ACT8B0x02
#define IDE_TIMING_REC8B0x04
#define IDE_TIMING_CYC8B0x08
#define IDE_TIMING_8BIT 0x0e
#define IDE_TIMING_ACTIVE   0x10
#define IDE_TIMING_RECOVER  0x20
#define IDE_TIMING_CYCLE0x40
#define IDE_TIMING_UDMA 0x80
#define IDE_TIMING_ALL  0xff

#define MIN(a,b)((a)<(b)?(a):(b))
#define MAX(a,b)((a)>(b)?(a):(b))
#define FIT(v,min,max)  MAX(MIN(v,max),min)
#define ENOUGH(v,unit)  (((v)-1)/(unit)+1)
#define EZ(v,unit)  ((v)?ENOUGH(v,unit):0)

#define XFER_MODE   0xf0
#define XFER_UDMA_100   0x44
#define XFER_UDMA_660x42
#define XFER_UDMA   0x40
#define XFER_MWDMA  0x20
#define XFER_SWDMA  0x10
#define XFER_EPIO   0x01
#define XFER_PIO0x00

static short ide_find_best_mode(ide_drive_t *drive, int map)
{
struct hd_driveid *id = drive->id;
short best = 0;

if (!id)
return XFER_PIO_SLOW;

if ((map & XFER_UDMA) && (id->field_valid & 4)) {   /* Want UDMA and UDMA 
bitmap valid */

if ((map & XFER_UDMA_100) == XFER_UDMA_100)
if ((best = (id->dma_ultra & 0x0020) ? XFER_UDMA_5 : 0)) 
return best;

if ((map & XFER_UDMA_66) == XFER_UDMA_66)
if ((best = (id->dma_ultra & 0x0010) ? XFER_UDMA_4 :
(id->dma_ultra & 0x0008) ? XFER_UDMA_3 : 0)) 
return best;

if ((best = 

[preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Vojtech Pavlik

Hi!

For those who like to try out the very latest developments, I'm
including my latest VIA and AMD IDE tuning drivers.

Just place all the files in drivers/ide of a 2.4 kernel and have fun.

Of course, I'm interested in all success/failure stories.

Thanks.

-- 
Vojtech Pavlik
SuSE Labs


#ifndef _IDE_TIMING_H
#define _IDE_TIMING_H

/*
 * $Id: ide-timing.h,v 1.4 2000/10/02 20:48:56 vojtech Exp $
 *
 *  Copyright (c) 1999-2000 Vojtech Pavlik
 *
 *  Sponsored by SuSE
 */

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * Should you need to contact me, the author, you can do so either by
 * e-mail - mail your message to [EMAIL PROTECTED], or by paper mail:
 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
 */

#include linux/hdreg.h

#ifndef XFER_PIO_5
#define XFER_PIO_5  0x0d
#endif

struct ide_timing {
short mode;
short setup;/* t1 */
short act8b;/* t2 for 8-bit io */
short rec8b;/* t2i for 8-bit io */
short cyc8b;/* t0 for 8-bit io */
short active;   /* t2 or tD */
short recover;  /* t2i or tK */
short cycle;/* t0 */
short udma; /* t2CYCTYP/2 */
};

/*
 * PIO 0-5, MWDMA 0-2 and UDMA 0-5 timings (in nanoseconds).
 * These were taken from ATA/ATAPI-6 standard, rev 0a, except
 * for PIO 5, which is a nonstandard extension.
 */

static struct ide_timing ide_timing[] = {

{ XFER_UDMA_5, 0,   0,   0,   0,   0,   0,   0,  20 },
{ XFER_UDMA_4, 0,   0,   0,   0,   0,   0,   0,  30 },
{ XFER_UDMA_3, 0,   0,   0,   0,   0,   0,   0,  45 },

{ XFER_UDMA_2, 0,   0,   0,   0,   0,   0,   0,  60 },
{ XFER_UDMA_1, 0,   0,   0,   0,   0,   0,   0,  80 },
{ XFER_UDMA_0, 0,   0,   0,   0,   0,   0,   0, 120 },
  
{ XFER_MW_DMA_2,  25,   0,   0,   0,  70,  25, 120,   0 },
{ XFER_MW_DMA_1,  45,   0,   0,   0,  80,  50, 150,   0 },
{ XFER_MW_DMA_0,  60,   0,   0,   0, 215, 215, 480,   0 },
  
{ XFER_SW_DMA_2,  60,   0,   0,   0, 120, 120, 240,   0 },
{ XFER_SW_DMA_1,  90,   0,   0,   0, 240, 240, 480,   0 },
{ XFER_SW_DMA_0, 120,   0,   0,   0, 480, 480, 960,   0 },

{ XFER_PIO_5, 20,  50,  30, 100,  50,  30, 100,   0 },
{ XFER_PIO_4, 25,  70,  25, 120,  70,  25, 120,   0 },
{ XFER_PIO_3, 30,  80,  70, 180,  80,  70, 180,   0 },

{ XFER_PIO_2, 30, 290,  40, 330, 100,  90, 240,   0 },
{ XFER_PIO_1, 50, 290,  93, 383, 125, 100, 383,   0 },
{ XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600,   0 },

{ XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 960,   0 },

{ -1 }
};

#define IDE_TIMING_SETUP0x01
#define IDE_TIMING_ACT8B0x02
#define IDE_TIMING_REC8B0x04
#define IDE_TIMING_CYC8B0x08
#define IDE_TIMING_8BIT 0x0e
#define IDE_TIMING_ACTIVE   0x10
#define IDE_TIMING_RECOVER  0x20
#define IDE_TIMING_CYCLE0x40
#define IDE_TIMING_UDMA 0x80
#define IDE_TIMING_ALL  0xff

#define MIN(a,b)((a)(b)?(a):(b))
#define MAX(a,b)((a)(b)?(a):(b))
#define FIT(v,min,max)  MAX(MIN(v,max),min)
#define ENOUGH(v,unit)  (((v)-1)/(unit)+1)
#define EZ(v,unit)  ((v)?ENOUGH(v,unit):0)

#define XFER_MODE   0xf0
#define XFER_UDMA_100   0x44
#define XFER_UDMA_660x42
#define XFER_UDMA   0x40
#define XFER_MWDMA  0x20
#define XFER_SWDMA  0x10
#define XFER_EPIO   0x01
#define XFER_PIO0x00

static short ide_find_best_mode(ide_drive_t *drive, int map)
{
struct hd_driveid *id = drive-id;
short best = 0;

if (!id)
return XFER_PIO_SLOW;

if ((map  XFER_UDMA)  (id-field_valid  4)) {   /* Want UDMA and UDMA 
bitmap valid */

if ((map  XFER_UDMA_100) == XFER_UDMA_100)
if ((best = (id-dma_ultra  0x0020) ? XFER_UDMA_5 : 0)) 
return best;

if ((map  XFER_UDMA_66) == XFER_UDMA_66)
if ((best = (id-dma_ultra  0x0010) ? XFER_UDMA_4 :
(id-dma_ultra  0x0008) ? XFER_UDMA_3 : 0)) 
return best;

if ((best = (id-dma_ultra  

Re: [preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Andre Hedrick


You are just having to much fun!


On Fri, 6 Oct 2000, Vojtech Pavlik wrote:

 Hi!
 
 For those who like to try out the very latest developments, I'm
 including my latest VIA and AMD IDE tuning drivers.
 
 Just place all the files in drivers/ide of a 2.4 kernel and have fun.
 
 Of course, I'm interested in all success/failure stories.
 
 Thanks.
 
 -- 
 Vojtech Pavlik
 SuSE Labs
 

Andre Hedrick
The Linux ATA/IDE guy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Vojtech Pavlik

On Fri, Oct 06, 2000 at 01:58:52AM -0700, Andre Hedrick wrote:

 You are just having to much fun!

Oh yes, I am. :) Just found yet-another-vt82c686a-bug. With heavy IDE disk
activity at UDMA66 speed the PIT (i8253) latch register gets reset to a
random value now and then. Seems like some interference inside the chip.

The time on the machine then behaves rather funny ... I wonder if this
affects other VIA chips as well or just my stepping CD silicon of the 686a.

By the way, any comments about the new VIA  AMD drivers, and the
ide-tuning.h include file?

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [preview] VIA v3.6 and AMD v1.2 IDE drivers

2000-10-06 Thread Vojtech Pavlik

On Fri, Oct 06, 2000 at 08:04:42AM -0400, Byron Stanoszek wrote:
 On Fri, 6 Oct 2000, Vojtech Pavlik wrote:
 
  Hi!
  
  For those who like to try out the very latest developments, I'm
  including my latest VIA and AMD IDE tuning drivers.
  
  Just place all the files in drivers/ide of a 2.4 kernel and have fun.
  
  Of course, I'm interested in all success/failure stories.
 
 Hi there. I have not had a chance to test my kernel with your patch yet, but I
 couldn't help noticing a glob of timing code in your ide-timing.h file. Did I
 miss something one day, or is the general concensus now to put code in header
 files? I'd prefer to see them as a separate module (ide-timing.c) or something
 that is compiled in for both via82cxxx.c and amd7540.c. What if you wanted both
 drivers for some reason, the code would get entered into the kernel twice.
 
 Well, I assume it is in the header file because it is used by both .c files. If
 not, then it makes sense to just stick that code into one of the .c files.
 (Perhaps I should take a closer look at the code :).

It's a .h file just for the ease-of-use sake now. I'm planning to turn
it into a .c library file. However, that requires modificating the
makefiles and I needed a drop-in replacement for the moment.

 Anyway, I'm planning on doing some pretty big tests later tonight with that
 driver. One thing that I noticed while using v1.2 of the via82cxxx.c driver is
 that with a pci bus rate of 37mhz and a 33mhz udma dvd-rom (Pioneer 16x),
 playing a cd will suddenly stop playing on certain songs. These 'stop points'
 seem to be evenly distributed across the cd (every 12 minutes or so). Not sure
 exactly what it is, but I thought I'd bring it to your attention. I don't have
 enough testing performed on that to determine if it is overclocking the pci bus
 that caused that, or your driver, or something else. I do know that it worked
 fine in test7 with the old non-existant drive timings.
 
 I guess I'm just ranting for now, but I will have some results for you later
 tonight. Thanks for hearing me out. :)

Just make sure you specify idebus=37 to the kernel, so that the driver
has a chance to compute the correct timing.

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/