1 /* $NetBSD: flash_vrip.c,v 1.6 2008/04/28 20:23:22 martin Exp $ */
4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Naoto Shimazaki of YOKOGAWA Electric Corporation.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
36 #include <sys/cdefs.h>
37 __KERNEL_RCSID(0, "$NetBSD: flash_vrip.c,v 1.6 2008/04/28 20:23:22 martin Exp $");
39 #include <sys/param.h>
41 #include <sys/device.h>
42 #include <sys/kernel.h>
43 #include <sys/malloc.h>
45 #include <sys/systm.h>
47 #include <machine/bus.h>
49 #include <hpcmips/vr/vripif.h>
50 #include <hpcmips/vr/cfireg.h>
51 #include <hpcmips/vr/flashreg.h>
52 #include <hpcmips/vr/flashvar.h>
56 #define DPRINTF(x) if (flash_debug) printf x
61 static int flash_probe(struct device
*, struct cfdata
*, void *);
62 static void flash_attach(struct device
*, struct device
*, void *);
64 const static struct flashops
* find_command_set(u_int8_t cmdset0
,
66 static int i28f128_probe(bus_space_tag_t
, bus_space_handle_t
);
67 static int mbm29160_probe(bus_space_tag_t
, bus_space_handle_t
);
68 static int is_block_same(struct flash_softc
*, bus_size_t
, const void *);
69 static int probe_cfi(bus_space_tag_t iot
, bus_space_handle_t ioh
);
71 static int intel_erase(struct flash_softc
*, bus_size_t
);
72 static int intel_write(struct flash_softc
*, bus_size_t
);
73 static int amd_erase(struct flash_softc
*, bus_size_t
);
74 static int amd_write(struct flash_softc
*, bus_size_t
);
76 extern struct cfdriver flash_cd
;
78 CFATTACH_DECL(flash_vrip
, sizeof(struct flash_softc
),
79 flash_probe
, flash_attach
, NULL
, NULL
);
81 dev_type_open(flashopen
);
82 dev_type_close(flashclose
);
83 dev_type_read(flashread
);
84 dev_type_write(flashwrite
);
86 const struct cdevsw flash_cdevsw
= {
87 flashopen
, flashclose
, flashread
, flashwrite
, noioctl
,
88 nostop
, notty
, nopoll
, nommap
, nokqfilter
,
91 static const struct flash_command_set
{
94 struct flashops fc_ops
;
97 .fc_set0
= CFI_COMMSET_INTEL0
,
98 .fc_set1
= CFI_COMMSET_INTEL1
,
101 .fo_erase
= intel_erase
,
102 .fo_write
= intel_write
,
106 .fc_set0
= CFI_COMMSET_AMDFJITU0
,
107 .fc_set1
= CFI_COMMSET_AMDFJITU1
,
109 .fo_name
= "AMD/Fujitsu",
110 .fo_erase
= amd_erase
,
111 .fo_write
= amd_write
,
126 const static struct flashops
*
127 find_command_set(u_int8_t cmdset0
, u_int8_t cmdset1
)
129 const struct flash_command_set
*fc
;
131 for (fc
= flash_cmd
; fc
->fc_ops
.fo_name
; fc
++) {
132 if (cmdset0
== fc
->fc_set0
&& cmdset1
== fc
->fc_set1
)
139 probe_cfi(bus_space_tag_t iot
, bus_space_handle_t ioh
)
141 const u_int8_t
*idstr
= CFI_QUERY_ID_STR
;
146 /* start Common Flash Interface Query */
147 bus_space_write_2(iot
, ioh
, CFI_QUERY_OFFSET
, CFI_READ_CFI_QUERY
);
149 /* read CFI Query ID string */
150 i
= CFI_QUERY_ID_STR_REG
<< 1;
152 if (bus_space_read_2(iot
, ioh
, i
) != *idstr
) {
153 bus_space_write_2(iot
, ioh
, 0, FLASH_RESET
);
160 cmdset0
= bus_space_read_2(iot
, ioh
, CFI_PRIM_COMM_REG0
<< 1);
161 cmdset1
= bus_space_read_2(iot
, ioh
, CFI_PRIM_COMM_REG1
<< 1);
163 /* switch flash to read mode */
164 bus_space_write_2(iot
, ioh
, 0, FLASH_RESET
);
166 if (!find_command_set(cmdset0
, cmdset1
))
173 flash_probe(struct device
*parent
, struct cfdata
*match
, void *aux
)
175 struct vrip_attach_args
*va
= aux
;
176 bus_space_handle_t ioh
;
178 if (bus_space_map(va
->va_iot
, va
->va_addr
, va
->va_size
, 0, &ioh
))
180 if (!probe_cfi(va
->va_iot
, ioh
)) {
181 DPRINTF("CFI ID str and command set recognized\n");
184 if (!i28f128_probe(va
->va_iot
, ioh
)) {
185 DPRINTF("28F128 detected\n");
188 if (!mbm29160_probe(va
->va_iot
, ioh
)) {
189 DPRINTF("29LV160 detected\n");
195 bus_space_unmap(va
->va_iot
, ioh
, va
->va_size
);
200 flash_attach(struct device
*parent
, struct device
*self
, void *aux
)
202 struct flash_softc
*sc
= (void *) self
;
203 struct vrip_attach_args
*va
= aux
;
206 bus_space_tag_t iot
= va
->va_iot
;
207 bus_space_handle_t ioh
;
210 if (bus_space_map(iot
, va
->va_addr
, va
->va_size
, 0, &ioh
)) {
211 printf(": can't map i/o space\n");
217 sc
->sc_size
= va
->va_size
;
221 * Read entire CFI structure
223 bus_space_write_2(iot
, ioh
, CFI_QUERY_OFFSET
, CFI_READ_CFI_QUERY
);
224 for (i
= 0; i
< CFI_TOTAL_SIZE
; i
++) {
225 sc
->sc_cfi_raw
[i
] = bus_space_read_2(iot
, ioh
, i
<< 1);
227 bus_space_write_2(iot
, ioh
, 0, FLASH_RESET
);
229 sc
->sc_ops
= find_command_set(sc
->sc_cfi_raw
[CFI_PRIM_COMM_REG0
],
230 sc
->sc_cfi_raw
[CFI_PRIM_COMM_REG1
]);
232 printf(": using %s command set", sc
->sc_ops
->fo_name
);
234 printf("opps sc->sc_ops is NULL\n");
238 * determine size of the largest block
240 sc
->sc_block_size
= 0;
241 i
= CFI_EBLK1_INFO_REG
;
242 fence
= sc
->sc_cfi_raw
[CFI_NUM_ERASE_BLK_REG
] * CFI_EBLK_INFO_SIZE
244 for (; i
< fence
; i
+= CFI_EBLK_INFO_SIZE
) {
245 if (sc
->sc_cfi_raw
[i
+ CFI_EBLK_INFO_NSECT0
] == 0
246 && sc
->sc_cfi_raw
[i
+ CFI_EBLK_INFO_NSECT1
] == 0)
249 = (sc
->sc_cfi_raw
[i
+ CFI_EBLK_INFO_SECSIZE0
] << 8)
250 + (sc
->sc_cfi_raw
[i
+ CFI_EBLK_INFO_SECSIZE1
] << 16);
251 if (sc
->sc_block_size
< block_size
)
252 sc
->sc_block_size
= block_size
;
255 if ((sc
->sc_buf
= malloc(sc
->sc_block_size
, M_DEVBUF
, M_NOWAIT
))
257 printf(": can't alloc buffer space\n");
261 sc
->sc_write_buffer_size
262 = 1 << (sc
->sc_cfi_raw
[CFI_MAX_WBUF_SIZE_REG0
]
263 + (sc
->sc_cfi_raw
[CFI_MAX_WBUF_SIZE_REG1
] << 8));
264 sc
->sc_typ_word_prog_timo
265 = 1 << sc
->sc_cfi_raw
[CFI_TYP_WORD_PROG_REG
];
266 sc
->sc_max_word_prog_timo
267 = 1 << sc
->sc_cfi_raw
[CFI_MAX_WORD_PROG_REG
];
268 sc
->sc_typ_buffer_write_timo
269 = 1 << sc
->sc_cfi_raw
[CFI_TYP_BUF_WRITE_REG
];
270 sc
->sc_max_buffer_write_timo
271 = 1 << sc
->sc_cfi_raw
[CFI_MAX_BUF_WRITE_REG
];
272 sc
->sc_typ_block_erase_timo
273 = 1 << sc
->sc_cfi_raw
[CFI_TYP_BLOCK_ERASE_REG
];
274 sc
->sc_max_block_erase_timo
275 = 1 << sc
->sc_cfi_raw
[CFI_MAX_BLOCK_ERASE_REG
];
280 printf("read_cfi: extract cfi\n");
281 printf("max block size: %dbyte\n", sc
->sc_block_size
);
282 printf("write buffer size: %dbyte\n", sc
->sc_write_buffer_size
);
283 printf("typical word program timeout: %dusec\n",
284 sc
->sc_typ_word_prog_timo
);
285 printf("maximam word program timeout: %dusec (%d time of typ)\n",
286 sc
->sc_typ_word_prog_timo
* sc
->sc_max_word_prog_timo
,
287 sc
->sc_max_word_prog_timo
);
288 printf("typical buffer write timeout: %dusec\n",
289 sc
->sc_typ_buffer_write_timo
);
290 printf("maximam buffer write timeout: %dusec (%d time of typ)\n",
291 sc
->sc_typ_buffer_write_timo
* sc
->sc_max_buffer_write_timo
,
292 sc
->sc_max_buffer_write_timo
);
293 printf("typical block erase timeout: %dmsec\n",
294 sc
->sc_typ_block_erase_timo
);
295 printf("maximam block erase timeout: %dmsec (%d time of typ)\n",
296 sc
->sc_typ_block_erase_timo
* sc
->sc_max_block_erase_timo
,
297 sc
->sc_max_block_erase_timo
);
299 printf("read_cfi: dump cfi\n");
300 for (i
= 0; i
< CFI_TOTAL_SIZE
;) {
302 for (j
= 0; j
< 16; j
++) {
303 printf("%02x ", sc
->sc_cfi_raw
[i
++]);
311 flashopen(dev_t dev
, int flag
, int mode
, struct lwp
*l
)
313 struct flash_softc
*sc
;
315 sc
= device_lookup_private(&flash_cd
, minor(dev
));
318 if (sc
->sc_status
& FLASH_ST_BUSY
)
320 sc
->sc_status
|= FLASH_ST_BUSY
;
325 flashclose(dev_t dev
, int flag
, int mode
, struct lwp
*l
)
327 struct flash_softc
*sc
;
329 sc
= device_lookup_private(&flash_cd
, minor(dev
));
330 sc
->sc_status
&= ~FLASH_ST_BUSY
;
335 flashread(dev_t dev
, struct uio
*uio
, int flag
)
337 struct flash_softc
*sc
;
339 bus_space_handle_t ioh
;
345 sc
= device_lookup_private(&flash_cd
, minor(dev
));
349 off
= uio
->uio_offset
;
350 total
= min(sc
->sc_size
- off
, uio
->uio_resid
);
353 count
= min(sc
->sc_block_size
, uio
->uio_resid
);
354 bus_space_read_region_1(iot
, ioh
, off
, sc
->sc_buf
, count
);
355 if ((error
= uiomove(sc
->sc_buf
, count
, uio
)) != 0)
365 flashwrite(dev_t dev
, struct uio
*uio
, int flag
)
367 struct flash_softc
*sc
;
369 bus_space_handle_t ioh
;
374 sc
= device_lookup_private(&flash_cd
, minor(dev
));
376 if (sc
->sc_size
< uio
->uio_offset
+ uio
->uio_resid
)
378 if (uio
->uio_offset
% sc
->sc_block_size
)
380 if (uio
->uio_resid
% sc
->sc_block_size
)
386 for (off
= uio
->uio_offset
;
388 off
+= sc
->sc_block_size
) {
389 if ((error
= uiomove(sc
->sc_buf
, sc
->sc_block_size
, uio
)) != 0)
391 if (is_block_same(sc
, off
, sc
->sc_buf
))
393 if ((stat
= flash_block_erase(sc
, off
)) != 0) {
394 printf("block erase failed status = 0x%x\n", stat
);
397 if ((stat
= flash_block_write(sc
, off
)) != 0) {
398 printf("block write failed status = 0x%x\n", stat
);
407 * this function is too much specific for the device.
410 i28f128_probe(bus_space_tag_t iot
, bus_space_handle_t ioh
)
412 static const u_int8_t vendor_code
[] = {
413 0x89, /* manufacturer code: intel */
414 0x18, /* device code: 28F128 */
417 static const u_int8_t idstr
[] = {
426 /* start Common Flash Interface Query */
427 bus_space_write_2(iot
, ioh
, 0, CFI_READ_CFI_QUERY
);
428 /* read CFI Query ID string */
429 for (i
= 0; idstr
[i
] != 0xff; i
++) {
430 if (bus_space_read_2(iot
, ioh
, (0x10 + i
) << 1) != idstr
[i
])
434 /* read manufacturer code and device code */
435 if (bus_space_read_2(iot
, ioh
, 0x00) != vendor_code
[0])
437 if (bus_space_read_2(iot
, ioh
, 0x02) != vendor_code
[1])
440 bus_space_write_2(iot
, ioh
, 0, I28F128_RESET
);
446 * this function is too much specific for the device.
449 mbm29160_probe(bus_space_tag_t iot
, bus_space_handle_t ioh
)
451 static const u_int16_t vendor_code
[] = {
452 0x0004, /* manufacturer code: intel */
453 0x2249, /* device code: 29LV160BE */
456 static const u_int8_t idstr
[] = {
465 /* start Common Flash Interface Query */
466 bus_space_write_2(iot
, ioh
, 0xaa, CFI_READ_CFI_QUERY
);
467 /* read CFI Query ID string */
468 for (i
= 0; idstr
[i
] != 0xff; i
++) {
469 if (bus_space_read_2(iot
, ioh
, (0x10 + i
) << 1) != idstr
[i
])
473 bus_space_write_2(iot
, ioh
, 0, 0xff);
475 /* read manufacturer code and device code */
476 bus_space_write_2(iot
, ioh
, 0x555 << 1, 0xaa);
477 bus_space_write_2(iot
, ioh
, 0x2aa << 1, 0x55);
478 bus_space_write_2(iot
, ioh
, 0x555 << 1, 0x90);
479 if (bus_space_read_2(iot
, ioh
, 0x00) != vendor_code
[0])
481 if (bus_space_read_2(iot
, ioh
, 0x02) != vendor_code
[1])
484 bus_space_write_2(iot
, ioh
, 0, 0xff);
489 is_block_same(struct flash_softc
*sc
, bus_size_t offset
, const void *bufp
)
491 bus_space_tag_t iot
= sc
->sc_iot
;
492 bus_space_handle_t ioh
= sc
->sc_ioh
;
493 const u_int8_t
*p
= bufp
;
494 int count
= sc
->sc_block_size
;
496 while (count
-- > 0) {
497 if (bus_space_read_1(iot
, ioh
, offset
++) != *p
++)
504 intel_erase(struct flash_softc
*sc
, bus_size_t offset
)
506 bus_space_tag_t iot
= sc
->sc_iot
;
507 bus_space_handle_t ioh
= sc
->sc_ioh
;
511 bus_space_write_2(iot
, ioh
, offset
, I28F128_BLK_ERASE_1ST
);
512 bus_space_write_2(iot
, ioh
, offset
, I28F128_BLK_ERASE_2ND
);
515 for (i
= sc
->sc_max_block_erase_timo
; i
> 0; i
--) {
516 tsleep(sc
, PRIBIO
, "blockerase",
517 1 + (sc
->sc_typ_block_erase_timo
* hz
) / 1000);
518 if ((status
= bus_space_read_2(iot
, ioh
, offset
))
523 status
|= FLASH_TIMEOUT
;
525 bus_space_write_2(iot
, ioh
, offset
, I28F128_CLEAR_STATUS
);
526 bus_space_write_2(iot
, ioh
, offset
, I28F128_RESET
);
528 return status
& (FLASH_TIMEOUT
529 | I28F128_S_ERASE_SUSPEND
530 | I28F128_S_COMSEQ_ERROR
531 | I28F128_S_ERASE_ERROR
532 | I28F128_S_BLOCK_LOCKED
);
536 intel_write(struct flash_softc
*sc
, bus_size_t offset
)
538 bus_space_tag_t iot
= sc
->sc_iot
;
539 bus_space_handle_t ioh
= sc
->sc_ioh
;
547 /* wbuf_size = size in u_int16_t */
548 wbuf_size
= sc
->sc_write_buffer_size
>> 1;
550 p
= (u_int16_t
*) sc
->sc_buf
;
551 fence
= offset
+ sc
->sc_block_size
;
554 for (timo
= sc
->sc_max_buffer_write_timo
; timo
> 0; timo
--) {
555 bus_space_write_2(iot
, ioh
, offset
,
556 I28F128_WRITE_BUFFER
);
557 status
= bus_space_read_2(iot
, ioh
, offset
);
558 if (status
& I28F128_XS_BUF_AVAIL
)
560 DELAY(sc
->sc_typ_buffer_write_timo
);
563 status
|= FLASH_TIMEOUT
;
567 bus_space_write_2(iot
, ioh
, offset
, wbuf_size
- 1);
569 for (i
= wbuf_size
; i
> 0; i
--, p
++, offset
+= 2)
570 bus_space_write_2(iot
, ioh
, offset
, *p
);
572 bus_space_write_2(iot
, ioh
, offset
, I28F128_WBUF_CONFIRM
);
575 bus_space_write_2(iot
, ioh
, offset
,
576 I28F128_READ_STATUS
);
577 status
= bus_space_read_2(iot
, ioh
, offset
);
578 } while (!(status
& I28F128_S_READY
));
580 } while (offset
< fence
);
582 bus_space_write_2(iot
, ioh
, offset
, I28F128_CLEAR_STATUS
);
583 bus_space_write_2(iot
, ioh
, offset
, I28F128_RESET
);
588 bus_space_write_2(iot
, ioh
, offset
, I28F128_CLEAR_STATUS
);
589 bus_space_write_2(iot
, ioh
, offset
, I28F128_RESET
);
591 status
&= (FLASH_TIMEOUT
592 | I28F128_S_PROG_ERROR
593 | I28F128_S_COMSEQ_ERROR
594 | I28F128_S_LOW_VOLTAGE
595 | I28F128_S_PROG_SUSPEND
596 | I28F128_S_BLOCK_LOCKED
);
601 amd_erase_sector(struct flash_softc
*sc
, bus_size_t offset
)
603 bus_space_tag_t iot
= sc
->sc_iot
;
604 bus_space_handle_t ioh
= sc
->sc_ioh
;
607 DPRINTF(("amd_erase_sector offset = %08lx\n", offset
));
609 bus_space_write_2(iot
, ioh
,
610 MBM29LV160_COMM_ADDR0
, MBM29LV160_COMM_CMD0
);
611 bus_space_write_2(iot
, ioh
,
612 MBM29LV160_COMM_ADDR1
, MBM29LV160_COMM_CMD1
);
613 bus_space_write_2(iot
, ioh
,
614 MBM29LV160_COMM_ADDR2
, MBM29LV160_ESECT_CMD2
);
615 bus_space_write_2(iot
, ioh
,
616 MBM29LV160_COMM_ADDR3
, MBM29LV160_ESECT_CMD3
);
617 bus_space_write_2(iot
, ioh
,
618 MBM29LV160_COMM_ADDR4
, MBM29LV160_ESECT_CMD4
);
619 bus_space_write_2(iot
, ioh
, offset
, MBM29LV160_ESECT_CMD5
);
621 for (i
= sc
->sc_max_block_erase_timo
; i
> 0; i
--) {
622 tsleep(sc
, PRIBIO
, "blockerase",
623 1 + (sc
->sc_typ_block_erase_timo
* hz
) / 1000);
624 if (bus_space_read_2(iot
, ioh
, offset
) == 0xffff)
628 return FLASH_TIMEOUT
;
632 amd_erase(struct flash_softc
*sc
, bus_size_t offset
)
634 static const struct mbm29lv_subsect
{
636 u_int32_t subsect_mask
;
637 u_int32_t subsect_addr
;
640 MBM29LV160TE_DEVCODE
,
641 MBM29LV160_SUBSECT_MASK
,
642 MBM29LV160TE_SUBSECT_ADDR
645 MBM29LV160BE_DEVCODE
,
646 MBM29LV160_SUBSECT_MASK
,
647 MBM29LV160BE_SUBSECT_ADDR
652 bus_space_tag_t iot
= sc
->sc_iot
;
653 bus_space_handle_t ioh
= sc
->sc_ioh
;
655 const struct mbm29lv_subsect
*ss
;
660 bus_space_write_2(iot
, ioh
,
661 MBM29LV160_COMM_ADDR0
, MBM29LV160_COMM_CMD0
);
662 bus_space_write_2(iot
, ioh
,
663 MBM29LV160_COMM_ADDR1
, MBM29LV160_COMM_CMD1
);
664 bus_space_write_2(iot
, ioh
,
665 MBM29LV160_COMM_ADDR2
, MBM29LV160_SIGN_CMD2
);
666 devcode
= bus_space_read_2(iot
, ioh
, MBM29LV160_DEVCODE_REG
);
668 for (ss
= subsect
; ss
->devcode
; ss
++) {
669 if (ss
->devcode
== devcode
)
672 if (ss
->devcode
== 0) {
673 printf("flash: amd_erase(): unknown device code %04x\n",
678 DPRINTF(("flash: amd_erase(): devcode = %04x subsect = %08x\n",
679 devcode
, ss
->subsect_addr
));
681 fence
= offset
+ sc
->sc_block_size
;
682 step
= (offset
& ss
->subsect_mask
) == ss
->subsect_addr
683 ? MBM29LV160_SUBSECT_SIZE
: MBM29LV160_SECT_SIZE
;
685 if ((status
= amd_erase_sector(sc
, offset
)) != 0)
688 } while (offset
< fence
);
694 amd_write(struct flash_softc
*sc
, bus_size_t offset
)
696 bus_space_tag_t iot
= sc
->sc_iot
;
697 bus_space_handle_t ioh
= sc
->sc_ioh
;
702 p
= (u_int16_t
*) sc
->sc_buf
;
703 fence
= offset
+ sc
->sc_block_size
;
705 bus_space_write_2(iot
, ioh
,
706 MBM29LV160_COMM_ADDR0
,
707 MBM29LV160_COMM_CMD0
);
708 bus_space_write_2(iot
, ioh
,
709 MBM29LV160_COMM_ADDR1
,
710 MBM29LV160_COMM_CMD1
);
711 bus_space_write_2(iot
, ioh
,
712 MBM29LV160_COMM_ADDR2
,
713 MBM29LV160_PROG_CMD2
);
714 bus_space_write_2(iot
, ioh
, offset
, *p
);
716 for (timo
= sc
->sc_max_word_prog_timo
; timo
> 0; timo
--) {
717 if (bus_space_read_2(iot
, ioh
, offset
) == *p
)
719 DELAY(sc
->sc_typ_word_prog_timo
);
722 return FLASH_TIMEOUT
;
726 } while (offset
< fence
);