diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-27 09:38:29 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-27 09:38:29 -0400 |
commit | ebae41a5a0583fb732c41445df4ac2c41016df74 (patch) | |
tree | 0896acda21576aabf92ff7e7b4b99fac26d9f007 /drivers/ide/legacy/qd65xx.c | |
parent | 10569713c78f3c499745651aebc90b0d1c454c28 (diff) |
ide: add "vlb|pci_clock=" parameter
* Add "vlb_clock=" parameter for specifying VLB clock frequency (in MHz).
* Add "pci_clock=" parameter for specifying PCI bus clock frequency (in MHz).
While at it:
* qd65xx.c: rename {active,recovery}_cycle variables to {act,rec}_cyc.
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/qd65xx.c')
-rw-r--r-- | drivers/ide/legacy/qd65xx.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index 61d5889834e4..5621963f755f 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c | |||
@@ -114,17 +114,18 @@ static void qd65xx_select(ide_drive_t *drive) | |||
114 | 114 | ||
115 | static u8 qd6500_compute_timing (ide_hwif_t *hwif, int active_time, int recovery_time) | 115 | static u8 qd6500_compute_timing (ide_hwif_t *hwif, int active_time, int recovery_time) |
116 | { | 116 | { |
117 | u8 active_cycle,recovery_cycle; | 117 | int clk = ide_vlb_clk ? ide_vlb_clk : system_bus_clock(); |
118 | u8 act_cyc, rec_cyc; | ||
118 | 119 | ||
119 | if (system_bus_clock()<=33) { | 120 | if (clk <= 33) { |
120 | active_cycle = 9 - IDE_IN(active_time * system_bus_clock() / 1000 + 1, 2, 9); | 121 | act_cyc = 9 - IDE_IN(active_time * clk / 1000 + 1, 2, 9); |
121 | recovery_cycle = 15 - IDE_IN(recovery_time * system_bus_clock() / 1000 + 1, 0, 15); | 122 | rec_cyc = 15 - IDE_IN(recovery_time * clk / 1000 + 1, 0, 15); |
122 | } else { | 123 | } else { |
123 | active_cycle = 8 - IDE_IN(active_time * system_bus_clock() / 1000 + 1, 1, 8); | 124 | act_cyc = 8 - IDE_IN(active_time * clk / 1000 + 1, 1, 8); |
124 | recovery_cycle = 18 - IDE_IN(recovery_time * system_bus_clock() / 1000 + 1, 3, 18); | 125 | rec_cyc = 18 - IDE_IN(recovery_time * clk / 1000 + 1, 3, 18); |
125 | } | 126 | } |
126 | 127 | ||
127 | return((recovery_cycle<<4) | 0x08 | active_cycle); | 128 | return (rec_cyc << 4) | 0x08 | act_cyc; |
128 | } | 129 | } |
129 | 130 | ||
130 | /* | 131 | /* |
@@ -135,10 +136,13 @@ static u8 qd6500_compute_timing (ide_hwif_t *hwif, int active_time, int recovery | |||
135 | 136 | ||
136 | static u8 qd6580_compute_timing (int active_time, int recovery_time) | 137 | static u8 qd6580_compute_timing (int active_time, int recovery_time) |
137 | { | 138 | { |
138 | u8 active_cycle = 17 - IDE_IN(active_time * system_bus_clock() / 1000 + 1, 2, 17); | 139 | int clk = ide_vlb_clk ? ide_vlb_clk : system_bus_clock(); |
139 | u8 recovery_cycle = 15 - IDE_IN(recovery_time * system_bus_clock() / 1000 + 1, 2, 15); | 140 | u8 act_cyc, rec_cyc; |
140 | 141 | ||
141 | return((recovery_cycle<<4) | active_cycle); | 142 | act_cyc = 17 - IDE_IN(active_time * clk / 1000 + 1, 2, 17); |
143 | rec_cyc = 15 - IDE_IN(recovery_time * clk / 1000 + 1, 2, 15); | ||
144 | |||
145 | return (rec_cyc << 4) | act_cyc; | ||
142 | } | 146 | } |
143 | 147 | ||
144 | /* | 148 | /* |