Lines Matching +full:patch +full:- +full:address

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * of PCI-SCSI IO processors.
6 * Copyright (C) 1999-2001 Gerard Roudier <groudier@free.fr>
9 * Copyright (C) 1998-2000 Gerard Roudier
12 * a port of the FreeBSD ncr driver to Linux-1.2.13.
16 * Stefan Esser <se@mi.Uni-Koeln.de>
24 *-----------------------------------------------------------------------------
91 * Patch routine for firmware #1.
100 scripta0 = (struct sym_fw1a_scr *) np->scripta0; in sym_fw1_patch()
101 scriptb0 = (struct sym_fw1b_scr *) np->scriptb0; in sym_fw1_patch()
106 if (!(np->features & FE_LED0)) { in sym_fw1_patch()
107 scripta0->idle[0] = cpu_to_scr(SCR_NO_OP); in sym_fw1_patch()
108 scripta0->reselected[0] = cpu_to_scr(SCR_NO_OP); in sym_fw1_patch()
109 scripta0->start[0] = cpu_to_scr(SCR_NO_OP); in sym_fw1_patch()
116 * patch the SCRIPTS accordingly with a SCRIPT NO_OP. in sym_fw1_patch()
119 scripta0->ungetjob[0] = cpu_to_scr(SCR_NO_OP); in sym_fw1_patch()
122 * Patch some data in SCRIPTS. in sym_fw1_patch()
123 * - start and done queue initial bus address. in sym_fw1_patch()
124 * - target bus address table bus address. in sym_fw1_patch()
126 scriptb0->startpos[0] = cpu_to_scr(np->squeue_ba); in sym_fw1_patch()
127 scriptb0->done_pos[0] = cpu_to_scr(np->dqueue_ba); in sym_fw1_patch()
128 scriptb0->targtbl[0] = cpu_to_scr(np->targtbl_ba); in sym_fw1_patch()
133 * Patch routine for firmware #2.
139 struct pci_dev *pdev = sym_data->pdev; in sym_fw2_patch()
140 struct sym_hcb *np = sym_data->ncb; in sym_fw2_patch()
144 scripta0 = (struct sym_fw2a_scr *) np->scripta0; in sym_fw2_patch()
145 scriptb0 = (struct sym_fw2b_scr *) np->scriptb0; in sym_fw2_patch()
150 if (!(np->features & FE_LED0)) { in sym_fw2_patch()
151 scripta0->idle[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
152 scripta0->reselected[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
153 scripta0->start[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
162 scripta0->is_dmap_dirty[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
163 scripta0->is_dmap_dirty[1] = 0; in sym_fw2_patch()
164 scripta0->is_dmap_dirty[2] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
165 scripta0->is_dmap_dirty[3] = 0; in sym_fw2_patch()
173 * patch the SCRIPTS accordingly with a SCRIPT NO_OP. in sym_fw2_patch()
176 scripta0->ungetjob[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
179 * Patch some variable in SCRIPTS. in sym_fw2_patch()
180 * - start and done queue initial bus address. in sym_fw2_patch()
181 * - target bus address table bus address. in sym_fw2_patch()
183 scriptb0->startpos[0] = cpu_to_scr(np->squeue_ba); in sym_fw2_patch()
184 scriptb0->done_pos[0] = cpu_to_scr(np->dqueue_ba); in sym_fw2_patch()
185 scriptb0->targtbl[0] = cpu_to_scr(np->targtbl_ba); in sym_fw2_patch()
190 if (!(np->features & FE_C10)) { in sym_fw2_patch()
191 scripta0->resel_scntl4[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
192 scripta0->resel_scntl4[1] = cpu_to_scr(0); in sym_fw2_patch()
196 * Remove a couple of work-arounds specific to C1010 if in sym_fw2_patch()
199 if (!(pdev->device == PCI_DEVICE_ID_LSI_53C1010_66 && in sym_fw2_patch()
200 pdev->revision < 0x1 && in sym_fw2_patch()
201 np->pciclk_khz < 60000)) { in sym_fw2_patch()
202 scripta0->datao_phase[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
203 scripta0->datao_phase[1] = cpu_to_scr(0); in sym_fw2_patch()
205 if (!(pdev->device == PCI_DEVICE_ID_LSI_53C1010_33 /* && in sym_fw2_patch()
206 pdev->revision < 0xff */)) { in sym_fw2_patch()
207 scripta0->sel_done[0] = cpu_to_scr(SCR_NO_OP); in sym_fw2_patch()
208 scripta0->sel_done[1] = cpu_to_scr(0); in sym_fw2_patch()
212 * Patch some other variables in SCRIPTS. in sym_fw2_patch()
215 scriptb0->pm0_data_addr[0] = in sym_fw2_patch()
216 cpu_to_scr(np->scripta_ba + in sym_fw2_patch()
218 scriptb0->pm1_data_addr[0] = in sym_fw2_patch()
219 cpu_to_scr(np->scripta_ba + in sym_fw2_patch()
252 * Build the bus address table for script A in sym_fw_setup_bus_addresses()
255 po = (u_short *) fw->a_ofs; in sym_fw_setup_bus_addresses()
256 pa = (u32 *) &np->fwa_bas; in sym_fw_setup_bus_addresses()
257 for (i = 0 ; i < sizeof(np->fwa_bas)/sizeof(u32) ; i++) in sym_fw_setup_bus_addresses()
258 pa[i] = np->scripta_ba + po[i]; in sym_fw_setup_bus_addresses()
263 po = (u_short *) fw->b_ofs; in sym_fw_setup_bus_addresses()
264 pa = (u32 *) &np->fwb_bas; in sym_fw_setup_bus_addresses()
265 for (i = 0 ; i < sizeof(np->fwb_bas)/sizeof(u32) ; i++) in sym_fw_setup_bus_addresses()
266 pa[i] = np->scriptb_ba + po[i]; in sym_fw_setup_bus_addresses()
271 po = (u_short *) fw->z_ofs; in sym_fw_setup_bus_addresses()
272 pa = (u32 *) &np->fwz_bas; in sym_fw_setup_bus_addresses()
273 for (i = 0 ; i < sizeof(np->fwz_bas)/sizeof(u32) ; i++) in sym_fw_setup_bus_addresses()
274 pa[i] = np->scriptz_ba + po[i]; in sym_fw_setup_bus_addresses()
286 scripta0 = (struct sym_fw1a_scr *) np->scripta0; in sym_fw1_setup()
291 sym_fw_fill_data(scripta0->data_in, scripta0->data_out); in sym_fw1_setup()
308 scripta0 = (struct sym_fw2a_scr *) np->scripta0; in sym_fw2_setup()
313 sym_fw_fill_data(scripta0->data_in, scripta0->data_out); in sym_fw2_setup()
325 static struct sym_fw sym_fw1 = SYM_FW_ENTRY(sym_fw1, "NCR-generic");
327 static struct sym_fw sym_fw2 = SYM_FW_ENTRY(sym_fw2, "LOAD/STORE-based");
335 if (chip->features & FE_LDSTR) in sym_find_firmware()
338 else if (!(chip->features & (FE_PFEN|FE_NOPM|FE_DAC))) in sym_find_firmware()
369 sym_name(np), (int) (cur-start)); in sym_fw_bind_script()
375 * We use the bogus value 0xf00ff00f ;-) in sym_fw_bind_script()
384 printf ("%d: <%x>\n", (int) (cur-start), in sym_fw_bind_script()
412 sym_name(np), (int) (cur-start)); in sym_fw_bind_script()
419 !(np->features & FE_PFEN)) { in sym_fw_bind_script()
425 * MOVE/CHMOV (absolute address) in sym_fw_bind_script()
427 if (!(np->features & FE_WIDE)) in sym_fw_bind_script()
435 if (!(np->features & FE_WIDE)) in sym_fw_bind_script()
442 * MOVE/CHMOV in target role (absolute address) in sym_fw_bind_script()
445 if (!(np->features & FE_WIDE)) in sym_fw_bind_script()
454 if (!(np->features & FE_WIDE)) in sym_fw_bind_script()
462 * don't relocate if relative :-) in sym_fw_bind_script()
500 while (relocs--) { in sym_fw_bind_script()
505 new = (old & ~RELOC_MASK) + np->mmio_ba; in sym_fw_bind_script()
508 new = (old & ~RELOC_MASK) + np->scripta_ba; in sym_fw_bind_script()
511 new = (old & ~RELOC_MASK) + np->scriptb_ba; in sym_fw_bind_script()
514 new = (old & ~RELOC_MASK) + np->hcb_ba; in sym_fw_bind_script()
518 * Don't relocate a 0 address. in sym_fw_bind_script()
520 * script self-modified areas. in sym_fw_bind_script()