diff options
-rw-r--r-- | drivers/ata/libata-core.c | 72 | ||||
-rw-r--r-- | include/linux/libata.h | 9 |
2 files changed, 43 insertions, 38 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 552ecae13434..88c242856dae 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -3029,33 +3029,33 @@ int sata_set_spd(struct ata_link *link) | |||
3029 | */ | 3029 | */ |
3030 | 3030 | ||
3031 | static const struct ata_timing ata_timing[] = { | 3031 | static const struct ata_timing ata_timing[] = { |
3032 | /* { XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 960, 0 }, */ | 3032 | /* { XFER_PIO_SLOW, 120, 290, 240, 960, 290, 240, 0, 960, 0 }, */ |
3033 | { XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0 }, | 3033 | { XFER_PIO_0, 70, 290, 240, 600, 165, 150, 0, 600, 0 }, |
3034 | { XFER_PIO_1, 50, 290, 93, 383, 125, 100, 383, 0 }, | 3034 | { XFER_PIO_1, 50, 290, 93, 383, 125, 100, 0, 383, 0 }, |
3035 | { XFER_PIO_2, 30, 290, 40, 330, 100, 90, 240, 0 }, | 3035 | { XFER_PIO_2, 30, 290, 40, 330, 100, 90, 0, 240, 0 }, |
3036 | { XFER_PIO_3, 30, 80, 70, 180, 80, 70, 180, 0 }, | 3036 | { XFER_PIO_3, 30, 80, 70, 180, 80, 70, 0, 180, 0 }, |
3037 | { XFER_PIO_4, 25, 70, 25, 120, 70, 25, 120, 0 }, | 3037 | { XFER_PIO_4, 25, 70, 25, 120, 70, 25, 0, 120, 0 }, |
3038 | { XFER_PIO_5, 15, 65, 25, 100, 65, 25, 100, 0 }, | 3038 | { XFER_PIO_5, 15, 65, 25, 100, 65, 25, 0, 100, 0 }, |
3039 | { XFER_PIO_6, 10, 55, 20, 80, 55, 20, 80, 0 }, | 3039 | { XFER_PIO_6, 10, 55, 20, 80, 55, 20, 0, 80, 0 }, |
3040 | 3040 | ||
3041 | { XFER_SW_DMA_0, 120, 0, 0, 0, 480, 480, 960, 0 }, | 3041 | { XFER_SW_DMA_0, 120, 0, 0, 0, 480, 480, 50, 960, 0 }, |
3042 | { XFER_SW_DMA_1, 90, 0, 0, 0, 240, 240, 480, 0 }, | 3042 | { XFER_SW_DMA_1, 90, 0, 0, 0, 240, 240, 30, 480, 0 }, |
3043 | { XFER_SW_DMA_2, 60, 0, 0, 0, 120, 120, 240, 0 }, | 3043 | { XFER_SW_DMA_2, 60, 0, 0, 0, 120, 120, 20, 240, 0 }, |
3044 | 3044 | ||
3045 | { XFER_MW_DMA_0, 60, 0, 0, 0, 215, 215, 480, 0 }, | 3045 | { XFER_MW_DMA_0, 60, 0, 0, 0, 215, 215, 20, 480, 0 }, |
3046 | { XFER_MW_DMA_1, 45, 0, 0, 0, 80, 50, 150, 0 }, | 3046 | { XFER_MW_DMA_1, 45, 0, 0, 0, 80, 50, 5, 150, 0 }, |
3047 | { XFER_MW_DMA_2, 25, 0, 0, 0, 70, 25, 120, 0 }, | 3047 | { XFER_MW_DMA_2, 25, 0, 0, 0, 70, 25, 5, 120, 0 }, |
3048 | { XFER_MW_DMA_3, 25, 0, 0, 0, 65, 25, 100, 0 }, | 3048 | { XFER_MW_DMA_3, 25, 0, 0, 0, 65, 25, 5, 100, 0 }, |
3049 | { XFER_MW_DMA_4, 25, 0, 0, 0, 55, 20, 80, 0 }, | 3049 | { XFER_MW_DMA_4, 25, 0, 0, 0, 55, 20, 5, 80, 0 }, |
3050 | 3050 | ||
3051 | /* { XFER_UDMA_SLOW, 0, 0, 0, 0, 0, 0, 0, 150 }, */ | 3051 | /* { XFER_UDMA_SLOW, 0, 0, 0, 0, 0, 0, 0, 0, 150 }, */ |
3052 | { XFER_UDMA_0, 0, 0, 0, 0, 0, 0, 0, 120 }, | 3052 | { XFER_UDMA_0, 0, 0, 0, 0, 0, 0, 0, 0, 120 }, |
3053 | { XFER_UDMA_1, 0, 0, 0, 0, 0, 0, 0, 80 }, | 3053 | { XFER_UDMA_1, 0, 0, 0, 0, 0, 0, 0, 0, 80 }, |
3054 | { XFER_UDMA_2, 0, 0, 0, 0, 0, 0, 0, 60 }, | 3054 | { XFER_UDMA_2, 0, 0, 0, 0, 0, 0, 0, 0, 60 }, |
3055 | { XFER_UDMA_3, 0, 0, 0, 0, 0, 0, 0, 45 }, | 3055 | { XFER_UDMA_3, 0, 0, 0, 0, 0, 0, 0, 0, 45 }, |
3056 | { XFER_UDMA_4, 0, 0, 0, 0, 0, 0, 0, 30 }, | 3056 | { XFER_UDMA_4, 0, 0, 0, 0, 0, 0, 0, 0, 30 }, |
3057 | { XFER_UDMA_5, 0, 0, 0, 0, 0, 0, 0, 20 }, | 3057 | { XFER_UDMA_5, 0, 0, 0, 0, 0, 0, 0, 0, 20 }, |
3058 | { XFER_UDMA_6, 0, 0, 0, 0, 0, 0, 0, 15 }, | 3058 | { XFER_UDMA_6, 0, 0, 0, 0, 0, 0, 0, 0, 15 }, |
3059 | 3059 | ||
3060 | { 0xFF } | 3060 | { 0xFF } |
3061 | }; | 3061 | }; |
@@ -3065,14 +3065,15 @@ static const struct ata_timing ata_timing[] = { | |||
3065 | 3065 | ||
3066 | static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT) | 3066 | static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT) |
3067 | { | 3067 | { |
3068 | q->setup = EZ(t->setup * 1000, T); | 3068 | q->setup = EZ(t->setup * 1000, T); |
3069 | q->act8b = EZ(t->act8b * 1000, T); | 3069 | q->act8b = EZ(t->act8b * 1000, T); |
3070 | q->rec8b = EZ(t->rec8b * 1000, T); | 3070 | q->rec8b = EZ(t->rec8b * 1000, T); |
3071 | q->cyc8b = EZ(t->cyc8b * 1000, T); | 3071 | q->cyc8b = EZ(t->cyc8b * 1000, T); |
3072 | q->active = EZ(t->active * 1000, T); | 3072 | q->active = EZ(t->active * 1000, T); |
3073 | q->recover = EZ(t->recover * 1000, T); | 3073 | q->recover = EZ(t->recover * 1000, T); |
3074 | q->cycle = EZ(t->cycle * 1000, T); | 3074 | q->dmack_hold = EZ(t->dmack_hold * 1000, T); |
3075 | q->udma = EZ(t->udma * 1000, UT); | 3075 | q->cycle = EZ(t->cycle * 1000, T); |
3076 | q->udma = EZ(t->udma * 1000, UT); | ||
3076 | } | 3077 | } |
3077 | 3078 | ||
3078 | void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b, | 3079 | void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b, |
@@ -3084,6 +3085,7 @@ void ata_timing_merge(const struct ata_timing *a, const struct ata_timing *b, | |||
3084 | if (what & ATA_TIMING_CYC8B ) m->cyc8b = max(a->cyc8b, b->cyc8b); | 3085 | if (what & ATA_TIMING_CYC8B ) m->cyc8b = max(a->cyc8b, b->cyc8b); |
3085 | if (what & ATA_TIMING_ACTIVE ) m->active = max(a->active, b->active); | 3086 | if (what & ATA_TIMING_ACTIVE ) m->active = max(a->active, b->active); |
3086 | if (what & ATA_TIMING_RECOVER) m->recover = max(a->recover, b->recover); | 3087 | if (what & ATA_TIMING_RECOVER) m->recover = max(a->recover, b->recover); |
3088 | if (what & ATA_TIMING_DMACK_HOLD) m->dmack_hold = max(a->dmack_hold, b->dmack_hold); | ||
3087 | if (what & ATA_TIMING_CYCLE ) m->cycle = max(a->cycle, b->cycle); | 3089 | if (what & ATA_TIMING_CYCLE ) m->cycle = max(a->cycle, b->cycle); |
3088 | if (what & ATA_TIMING_UDMA ) m->udma = max(a->udma, b->udma); | 3090 | if (what & ATA_TIMING_UDMA ) m->udma = max(a->udma, b->udma); |
3089 | } | 3091 | } |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 73b69c7071c5..2c6bd66209ff 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -401,12 +401,14 @@ enum { | |||
401 | ATA_TIMING_CYC8B, | 401 | ATA_TIMING_CYC8B, |
402 | ATA_TIMING_ACTIVE = (1 << 4), | 402 | ATA_TIMING_ACTIVE = (1 << 4), |
403 | ATA_TIMING_RECOVER = (1 << 5), | 403 | ATA_TIMING_RECOVER = (1 << 5), |
404 | ATA_TIMING_CYCLE = (1 << 6), | 404 | ATA_TIMING_DMACK_HOLD = (1 << 6), |
405 | ATA_TIMING_UDMA = (1 << 7), | 405 | ATA_TIMING_CYCLE = (1 << 7), |
406 | ATA_TIMING_UDMA = (1 << 8), | ||
406 | ATA_TIMING_ALL = ATA_TIMING_SETUP | ATA_TIMING_ACT8B | | 407 | ATA_TIMING_ALL = ATA_TIMING_SETUP | ATA_TIMING_ACT8B | |
407 | ATA_TIMING_REC8B | ATA_TIMING_CYC8B | | 408 | ATA_TIMING_REC8B | ATA_TIMING_CYC8B | |
408 | ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER | | 409 | ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER | |
409 | ATA_TIMING_CYCLE | ATA_TIMING_UDMA, | 410 | ATA_TIMING_DMACK_HOLD | ATA_TIMING_CYCLE | |
411 | ATA_TIMING_UDMA, | ||
410 | }; | 412 | }; |
411 | 413 | ||
412 | enum ata_xfer_mask { | 414 | enum ata_xfer_mask { |
@@ -866,6 +868,7 @@ struct ata_timing { | |||
866 | unsigned short cyc8b; /* t0 for 8-bit I/O */ | 868 | unsigned short cyc8b; /* t0 for 8-bit I/O */ |
867 | unsigned short active; /* t2 or tD */ | 869 | unsigned short active; /* t2 or tD */ |
868 | unsigned short recover; /* t2i or tK */ | 870 | unsigned short recover; /* t2i or tK */ |
871 | unsigned short dmack_hold; /* tj */ | ||
869 | unsigned short cycle; /* t0 */ | 872 | unsigned short cycle; /* t0 */ |
870 | unsigned short udma; /* t2CYCTYP/2 */ | 873 | unsigned short udma; /* t2CYCTYP/2 */ |
871 | }; | 874 | }; |