Lines Matching full:nvram

21  * NVRAM detection and reading.
35 * Get host setup from NVRAM.
37 void sym_nvram_setup_host(struct Scsi_Host *shost, struct sym_hcb *np, struct sym_nvram *nvram) in sym_nvram_setup_host() argument
41 * and miscellaneous host flags from NVRAM. in sym_nvram_setup_host()
43 switch (nvram->type) { in sym_nvram_setup_host()
45 if (!(nvram->data.Symbios.flags & SYMBIOS_PARITY_ENABLE)) in sym_nvram_setup_host()
47 np->myaddr = nvram->data.Symbios.host_id & 0x0f; in sym_nvram_setup_host()
48 if (nvram->data.Symbios.flags & SYMBIOS_VERBOSE_MSGS) in sym_nvram_setup_host()
50 if (nvram->data.Symbios.flags1 & SYMBIOS_SCAN_HI_LO) in sym_nvram_setup_host()
52 if (nvram->data.Symbios.flags2 & SYMBIOS_AVOID_BUS_RESET) in sym_nvram_setup_host()
56 np->myaddr = nvram->data.Tekram.host_id & 0x0f; in sym_nvram_setup_host()
60 if (nvram->data.parisc.host_id != -1) in sym_nvram_setup_host()
61 np->myaddr = nvram->data.parisc.host_id; in sym_nvram_setup_host()
62 if (nvram->data.parisc.factor != -1) in sym_nvram_setup_host()
63 np->minsync = nvram->data.parisc.factor; in sym_nvram_setup_host()
64 if (nvram->data.parisc.width != -1) in sym_nvram_setup_host()
65 np->maxwide = nvram->data.parisc.width; in sym_nvram_setup_host()
66 switch (nvram->data.parisc.mode) { in sym_nvram_setup_host()
79 * Get target set-up from Symbios format NVRAM.
82 sym_Symbios_setup_target(struct sym_tcb *tp, int target, Symbios_nvram *nvram) in sym_Symbios_setup_target() argument
84 Symbios_target *tn = &nvram->target[target]; in sym_Symbios_setup_target()
103 * Get target set-up from Tekram format NVRAM.
106 sym_Tekram_setup_target(struct sym_tcb *tp, int target, Tekram_nvram *nvram) in sym_Tekram_setup_target() argument
108 struct Tekram_target *tn = &nvram->target[target]; in sym_Tekram_setup_target()
111 tp->usrtags = 2 << nvram->max_tags_index; in sym_Tekram_setup_target()
123 * Get target setup from NVRAM.
141 * Dump Symbios format NVRAM for debugging purpose.
143 static void sym_display_Symbios_nvram(struct sym_device *np, Symbios_nvram *nvram) in sym_display_Symbios_nvram() argument
147 /* display Symbios nvram host data */ in sym_display_Symbios_nvram()
149 sym_name(np), nvram->host_id & 0x0f, in sym_display_Symbios_nvram()
150 (nvram->flags & SYMBIOS_SCAM_ENABLE) ? " SCAM" :"", in sym_display_Symbios_nvram()
151 (nvram->flags & SYMBIOS_PARITY_ENABLE) ? " PARITY" :"", in sym_display_Symbios_nvram()
152 (nvram->flags & SYMBIOS_VERBOSE_MSGS) ? " VERBOSE" :"", in sym_display_Symbios_nvram()
153 (nvram->flags & SYMBIOS_CHS_MAPPING) ? " CHS_ALT" :"", in sym_display_Symbios_nvram()
154 (nvram->flags2 & SYMBIOS_AVOID_BUS_RESET)?" NO_RESET" :"", in sym_display_Symbios_nvram()
155 (nvram->flags1 & SYMBIOS_SCAN_HI_LO) ? " HI_LO" :""); in sym_display_Symbios_nvram()
157 /* display Symbios nvram drive data */ in sym_display_Symbios_nvram()
159 struct Symbios_target *tn = &nvram->target[i]; in sym_display_Symbios_nvram()
173 * Dump TEKRAM format NVRAM for debugging purpose.
175 static void sym_display_Tekram_nvram(struct sym_device *np, Tekram_nvram *nvram) in sym_display_Tekram_nvram() argument
180 /* display Tekram nvram host data */ in sym_display_Tekram_nvram()
181 tags = 2 << nvram->max_tags_index; in sym_display_Tekram_nvram()
183 if (nvram->boot_delay_index < 6) in sym_display_Tekram_nvram()
184 boot_delay = Tekram_boot_delay[nvram->boot_delay_index]; in sym_display_Tekram_nvram()
185 switch ((nvram->flags & TEKRAM_REMOVABLE_FLAGS) >> 6) { in sym_display_Tekram_nvram()
193 sym_name(np), nvram->host_id & 0x0f, in sym_display_Tekram_nvram()
194 (nvram->flags1 & SYMBIOS_SCAM_ENABLE) ? " SCAM" :"", in sym_display_Tekram_nvram()
195 (nvram->flags & TEKRAM_MORE_THAN_2_DRIVES) ? " >2DRIVES":"", in sym_display_Tekram_nvram()
196 (nvram->flags & TEKRAM_DRIVES_SUP_1GB) ? " >1GB" :"", in sym_display_Tekram_nvram()
197 (nvram->flags & TEKRAM_RESET_ON_POWER_ON) ? " RESET" :"", in sym_display_Tekram_nvram()
198 (nvram->flags & TEKRAM_ACTIVE_NEGATION) ? " ACT_NEG" :"", in sym_display_Tekram_nvram()
199 (nvram->flags & TEKRAM_IMMEDIATE_SEEK) ? " IMM_SEEK" :"", in sym_display_Tekram_nvram()
200 (nvram->flags & TEKRAM_SCAN_LUNS) ? " SCAN_LUNS" :"", in sym_display_Tekram_nvram()
201 (nvram->flags1 & TEKRAM_F2_F6_ENABLED) ? " F2_F6" :"", in sym_display_Tekram_nvram()
204 /* display Tekram nvram drive data */ in sym_display_Tekram_nvram()
207 struct Tekram_target *tn = &nvram->target[i]; in sym_display_Tekram_nvram()
222 …d sym_display_Symbios_nvram(struct sym_device *np, Symbios_nvram *nvram) { (void)np; (void)nvram; } in sym_display_Symbios_nvram() argument
223 …oid sym_display_Tekram_nvram(struct sym_device *np, Tekram_nvram *nvram) { (void)np; (void)nvram; } in sym_display_Tekram_nvram() argument
232 * Symbios NVRAM wiring now also used by Tekram.
268 * Send START condition to NVRAM to wake it up.
279 * Send STOP condition to NVRAM - puts NVRAM to sleep... ZZzzzz!!
288 * Read or write a bit to the NVRAM,
303 * Output an ACK to the NVRAM after reading,
315 * Input an ACK from NVRAM after writing,
327 * WRITE a byte to the NVRAM and then get an ACK to see it was accepted OK,
342 * READ a byte from the NVRAM and then send an ACK to say we have got it,
381 /* this is to set NVRAM into a known state with GPIO0/1 both low */ in sym_write_S24C16_nvram()
386 /* now set NVRAM inactive with GPIO0/1 both high */ in sym_write_S24C16_nvram()
389 /* NVRAM has to be written in segments of 16 bytes */ in sym_write_S24C16_nvram()
407 /* return GPIO0/1 to original states after having accessed NVRAM */ in sym_write_S24C16_nvram()
435 /* this is to set NVRAM into a known state with GPIO0/1 both low */ in sym_read_S24C16_nvram()
440 /* now set NVRAM inactive with GPIO0/1 both high */ in sym_read_S24C16_nvram()
443 /* activate NVRAM */ in sym_read_S24C16_nvram()
471 /* input all requested data - only part of total NVRAM */ in sym_read_S24C16_nvram()
475 /* finally put NVRAM back in inactive mode */ in sym_read_S24C16_nvram()
481 /* return GPIO0/1 to original states after having accessed NVRAM */ in sym_read_S24C16_nvram()
494 * Try reading Symbios NVRAM.
497 static int sym_read_Symbios_nvram(struct sym_device *np, Symbios_nvram *nvram) in sym_read_Symbios_nvram() argument
500 u_char *data = (u_char *) nvram; in sym_read_Symbios_nvram()
501 int len = sizeof(*nvram); in sym_read_Symbios_nvram()
509 /* check valid NVRAM signature, verify byte count and checksum */ in sym_read_Symbios_nvram()
510 if (nvram->type != 0 || in sym_read_Symbios_nvram()
511 memcmp(nvram->trailer, Symbios_trailer, 6) || in sym_read_Symbios_nvram()
512 nvram->byte_count != len - 12) in sym_read_Symbios_nvram()
518 if (csum != nvram->checksum) in sym_read_Symbios_nvram()
547 * Read bit from NVRAM
576 * Send STOP condition to NVRAM - puts NVRAM to sleep... ZZZzzz!!
589 * Send read command and address to NVRAM
604 * READ 2 bytes from the NVRAM
624 * Read Tekram NvRAM data.
645 * Try reading 93C46 Tekram NVRAM.
647 static int sym_read_T93C46_nvram(struct sym_device *np, Tekram_nvram *nvram) in sym_read_T93C46_nvram() argument
664 /* input all of NVRAM, 64 words */ in sym_read_T93C46_nvram()
665 retv = T93C46_Read_Data(np, (u_short *) nvram, in sym_read_T93C46_nvram()
666 sizeof(*nvram) / sizeof(short), &gpreg); in sym_read_T93C46_nvram()
668 /* return GPIO0/1/2/4 to original states after having accessed NVRAM */ in sym_read_T93C46_nvram()
676 * Try reading Tekram NVRAM.
679 static int sym_read_Tekram_nvram (struct sym_device *np, Tekram_nvram *nvram) in sym_read_Tekram_nvram() argument
681 u_char *data = (u_char *) nvram; in sym_read_Tekram_nvram()
682 int len = sizeof(*nvram); in sym_read_Tekram_nvram()
700 x = sym_read_T93C46_nvram(np, nvram); in sym_read_Tekram_nvram()
739 * Try reading Symbios or Tekram NVRAM
759 return "Symbios NVRAM"; in sym_nvram_type()
761 return "Tekram NVRAM"; in sym_nvram_type()
765 return "No NVRAM"; in sym_nvram_type()