Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102074
b: refs/heads/master
c: bd887f7
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 16, 2008
1 parent 8be7944 commit 4bc9ff1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3be53f3f213223f50d8e29b5e1869685bf040a1e
refs/heads/master: bd887f72d2a28a8202519e67fd9ed93ee3c4e78d
24 changes: 7 additions & 17 deletions trunk/drivers/ide/ide-timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ static struct ide_timing ide_timing[] = {
#define ENOUGH(v,unit) (((v)-1)/(unit)+1)
#define EZ(v,unit) ((v)?ENOUGH(v,unit):0)

#define XFER_MODE 0xf0
#define XFER_MWDMA 0x20
#define XFER_EPIO 0x01
#define XFER_PIO 0x00

static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int T, int UT)
{
q->setup = EZ(t->setup * 1000, T);
Expand Down Expand Up @@ -137,17 +132,12 @@ static int ide_timing_compute(ide_drive_t *drive, u8 speed,

memset(&p, 0, sizeof(p));

switch (speed & XFER_MODE) {

case XFER_PIO:
if (speed <= XFER_PIO_2) p.cycle = p.cyc8b = id->eide_pio;
else p.cycle = p.cyc8b = id->eide_pio_iordy;
break;

case XFER_MWDMA:
p.cycle = id->eide_dma_min;
break;
}
if (speed <= XFER_PIO_2)
p.cycle = p.cyc8b = id->eide_pio;
else if (speed <= XFER_PIO_5)
p.cycle = p.cyc8b = id->eide_pio_iordy;
else if (speed >= XFER_MW_DMA_0 && speed <= XFER_MW_DMA_2)
p.cycle = id->eide_dma_min;

ide_timing_merge(&p, t, t, IDE_TIMING_CYCLE | IDE_TIMING_CYC8B);
}
Expand All @@ -164,7 +154,7 @@ static int ide_timing_compute(ide_drive_t *drive, u8 speed,
* slower/equal than the fastest PIO timing.
*/

if ((speed & XFER_MODE) != XFER_PIO) {
if (speed >= XFER_SW_DMA_0) {
u8 pio = ide_get_best_pio_mode(drive, 255, 5);
ide_timing_compute(drive, XFER_PIO_0 + pio, &p, T, UT);
ide_timing_merge(&p, t, t, IDE_TIMING_ALL);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/pci/cs5535.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,11 @@ static unsigned int cs5535_udma_timings[5] =
*/
static void cs5535_set_speed(ide_drive_t *drive, const u8 speed)
{

u32 reg = 0, dummy;
int unit = drive->select.b.unit;


/* Set the PIO timings */
if ((speed & XFER_MODE) == XFER_PIO) {
if (speed < XFER_SW_DMA_0) {
ide_drive_t *pair = ide_get_paired_drive(drive);
u8 cmd, pioa;

Expand Down

0 comments on commit 4bc9ff1

Please sign in to comment.