Lines Matching full:sd

95 #define CLOCK_PULSE(sd, rdy)				\  argument
96 while ((SEEPROM_STATUS_INB(sd) & rdy) == 0) { \
99 (void)SEEPROM_INB(sd); /* Clear clock */
105 send_seeprom_cmd(struct seeprom_descriptor *sd, const struct seeprom_cmd *cmd) in send_seeprom_cmd() argument
111 temp = sd->sd_MS ^ sd->sd_CS; in send_seeprom_cmd()
112 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in send_seeprom_cmd()
113 CLOCK_PULSE(sd, sd->sd_RDY); in send_seeprom_cmd()
117 temp ^= sd->sd_DO; in send_seeprom_cmd()
118 SEEPROM_OUTB(sd, temp); in send_seeprom_cmd()
119 CLOCK_PULSE(sd, sd->sd_RDY); in send_seeprom_cmd()
120 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in send_seeprom_cmd()
121 CLOCK_PULSE(sd, sd->sd_RDY); in send_seeprom_cmd()
123 temp ^= sd->sd_DO; in send_seeprom_cmd()
131 reset_seeprom(struct seeprom_descriptor *sd) in reset_seeprom() argument
135 temp = sd->sd_MS; in reset_seeprom()
136 SEEPROM_OUTB(sd, temp); in reset_seeprom()
137 CLOCK_PULSE(sd, sd->sd_RDY); in reset_seeprom()
138 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in reset_seeprom()
139 CLOCK_PULSE(sd, sd->sd_RDY); in reset_seeprom()
140 SEEPROM_OUTB(sd, temp); in reset_seeprom()
141 CLOCK_PULSE(sd, sd->sd_RDY); in reset_seeprom()
149 ahc_read_seeprom(struct seeprom_descriptor *sd, uint16_t *buf, in ahc_read_seeprom() argument
166 send_seeprom_cmd(sd, &seeprom_read); in ahc_read_seeprom()
169 temp = sd->sd_MS ^ sd->sd_CS; in ahc_read_seeprom()
170 for (i = (sd->sd_chip - 1); i >= 0; i--) { in ahc_read_seeprom()
172 temp ^= sd->sd_DO; in ahc_read_seeprom()
173 SEEPROM_OUTB(sd, temp); in ahc_read_seeprom()
174 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_read_seeprom()
175 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in ahc_read_seeprom()
176 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_read_seeprom()
178 temp ^= sd->sd_DO; in ahc_read_seeprom()
189 SEEPROM_OUTB(sd, temp); in ahc_read_seeprom()
190 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_read_seeprom()
192 if (SEEPROM_DATA_INB(sd) & sd->sd_DI) in ahc_read_seeprom()
194 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in ahc_read_seeprom()
195 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_read_seeprom()
201 reset_seeprom(sd); in ahc_read_seeprom()
221 ahc_write_seeprom(struct seeprom_descriptor *sd, uint16_t *buf, in ahc_write_seeprom() argument
230 if (sd->sd_chip == C46) { in ahc_write_seeprom()
233 } else if (sd->sd_chip == C56_66) { in ahc_write_seeprom()
238 sd->sd_chip); in ahc_write_seeprom()
242 send_seeprom_cmd(sd, ewen); in ahc_write_seeprom()
243 reset_seeprom(sd); in ahc_write_seeprom()
246 temp = sd->sd_MS ^ sd->sd_CS; in ahc_write_seeprom()
249 send_seeprom_cmd(sd, &seeprom_write); in ahc_write_seeprom()
252 for (i = (sd->sd_chip - 1); i >= 0; i--) { in ahc_write_seeprom()
254 temp ^= sd->sd_DO; in ahc_write_seeprom()
255 SEEPROM_OUTB(sd, temp); in ahc_write_seeprom()
256 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_write_seeprom()
257 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in ahc_write_seeprom()
258 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_write_seeprom()
260 temp ^= sd->sd_DO; in ahc_write_seeprom()
267 temp ^= sd->sd_DO; in ahc_write_seeprom()
268 SEEPROM_OUTB(sd, temp); in ahc_write_seeprom()
269 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_write_seeprom()
270 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in ahc_write_seeprom()
271 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_write_seeprom()
273 temp ^= sd->sd_DO; in ahc_write_seeprom()
277 temp = sd->sd_MS; in ahc_write_seeprom()
278 SEEPROM_OUTB(sd, temp); in ahc_write_seeprom()
279 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_write_seeprom()
280 temp = sd->sd_MS ^ sd->sd_CS; in ahc_write_seeprom()
282 SEEPROM_OUTB(sd, temp); in ahc_write_seeprom()
283 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_write_seeprom()
284 SEEPROM_OUTB(sd, temp ^ sd->sd_CK); in ahc_write_seeprom()
285 CLOCK_PULSE(sd, sd->sd_RDY); in ahc_write_seeprom()
286 } while ((SEEPROM_DATA_INB(sd) & sd->sd_DI) == 0); in ahc_write_seeprom()
288 reset_seeprom(sd); in ahc_write_seeprom()
292 send_seeprom_cmd(sd, ewds); in ahc_write_seeprom()
293 reset_seeprom(sd); in ahc_write_seeprom()