📄 x
字号:
> break;
> }
> }
235,236d223
< }
< }
238,239c225,226
< /* Finished that 4-byte write, go on to the next (per cnt) */
< dest += 4;
---
> /* Finished that 4-byte write, go on to the next (per cnt) */
> dest += 4;
242,243c229,231
< /* Read/reset command: */
< Write_f0_to_555();
---
> /* Unlock Bypass Reset command: */
> Write_90_to_555();
> Write_00_to_555();
249,251c237,239
< Function place holder to determine the "end" of the
< Flashwrite() function.
< */
---
> * Function place holder to determine the "end" of the
> * Flashwrite() function.
> */
258,265c246,253
< Erase all sectors that are part of the address space to be written,
< then write the data to that address space. This is basically a
< concatenation of flasherase and flashwrite done in one step. This is
< necessary primarily for re-writing the bootcode; because after the boot
< code is erased, there is nowhere to return so the re-write must be done
< while executing out of ram also.
<
< Note that this routine is restricted to writing full words only.
---
> * Erase all sectors that are part of the address space to be written,
> * then write the data to that address space. This is basically a
> * concatenation of flasherase and flashwrite done in one step. This is
> * necessary primarily for re-writing the bootcode; because after the boot
> * code is erased, there is nowhere to return so the re-write must be done
> * while executing out of ram also.
> *
> * Note that this routine is restricted to writing full words only.
289,323c277,281
< if ((((uchar *)dest) > (fdev->sectors[i].end)) ||
< (((uchar *)dest+(bytecnt-1)) < (fdev->sectors[i].begin))) {
<
< add += fdev->sectors[i].size;
< continue;
< }
<
< /* Sector erase command: */
< Write_aa_to_555();
< Write_55_to_2aa();
< Write_80_to_555();
< Write_aa_to_555();
< Write_55_to_2aa();
< Write_30_to_(add);
<
< /* Wait for sector erase to complete or timeout.. */
< /* DQ7 polling: wait for D7 to be 1. */
< /* DQ5 timeout: if DQ7 is 0, and DQ5 = 1, timeout. */
< for (;;) {
< val = *(ftype *)add;
< if ((val & 0x00800080) == 0x00800080) {
< break;
< }
<
< /* Check for D5 timeout in upper flash if it's not done */
< /* In this case, there is nothing to return to */
< /* because the flash was just erased, so just break.*/
< if ( (val & 0x00800000) != 0x00800000
< && (val & 0x00200000) != 0 ) {
<
< /* Check D7 once more since D7 and D5 are asynchronous */
< val = *(ftype *)add;
< if ((val & 0x00800000) != 0x00800000) {
< reset = RESETFUNC();
< reset();
---
> if ((((uchar *)dest) > (fdev->sectors[i].end)) ||
> (((uchar *)dest+(bytecnt-1)) < (fdev->sectors[i].begin))) {
>
> add += fdev->sectors[i].size;
> continue;
325d282
< }
327,339c284,290
< /* Check for D5 timeout in lower flash if it's not done */
< /* In this case, there is nothing to return to */
< /* because the flash was just erased, so just break.*/
< if ( (val & 0x00000080) != 0x00000080
< && (val & 0x00000020) != 0 ) {
<
< /* Check D7 once more since D7 and D5 are asynchronous */
< val = *(ftype *)add;
< if ((val & 0x00000080) != 0x00000080) {
< reset = RESETFUNC();
< reset();
< }
< }
---
> /* Sector erase command: */
> Write_aa_to_555();
> Write_55_to_2aa();
> Write_80_to_555();
> Write_aa_to_555();
> Write_55_to_2aa();
> Write_30_to_(add);
341,342c292,333
< } /* end wait for sector erase to complete */
< add += fdev->sectors[i].size;
---
> /* Wait for sector erase to complete or timeout..
> * DQ7 polling: wait for D7 to be 1.
> * DQ5 timeout: if DQ7 is 0, and DQ5 = 1, timeout.
> */
> for (;;) {
> val = *(ftype *)add;
> if ((val & 0x00800080) == 0x00800080) {
> break;
> }
>
> /* Check for D5 timeout in upper flash if it's not done
> * In this case, there is nothing to return to
> * because the flash was just erased, so just break.
> */
> if (((val & 0x00800000) != 0x00800000) &&
> ((val & 0x00200000) != 0)) {
>
> /* Check D7 once more since D7 and D5 are asynchronous */
> val = *(ftype *)add;
> if ((val & 0x00800000) != 0x00800000) {
> reset = RESETFUNC();
> reset();
> }
> }
>
> /* Check for D5 timeout in lower flash if it's not done
> * In this case, there is nothing to return to
> * because the flash was just erased, so just break.
> */
> if (((val & 0x00000080) != 0x00000080) &&
> ((val & 0x00000020) != 0)) {
>
> /* Check D7 once more since D7 and D5 are asynchronous */
> val = *(ftype *)add;
> if ((val & 0x00000080) != 0x00000080) {
> reset = RESETFUNC();
> reset();
> }
> }
>
> } /* end wait for sector erase to complete */
> add += fdev->sectors[i].size;
350,354c341,345
< /* Write command: */
< Write_aa_to_555();
< Write_55_to_2aa();
< Write_a0_to_555();
< Fwrite(dest,src);
---
> /* Write command: */
> Write_aa_to_555();
> Write_55_to_2aa();
> Write_a0_to_555();
> Fwrite(dest,src);
356c347
< d7test = *src & 0x00800080;
---
> d7test = *src & 0x00800080;
358,378c349,356
< /* Wait for flash write to complete (each device might complete */
< /* at a different time). */
< for (;;) {
< val = *(ftype *)dest;
< if ((val & 0x00800080) == d7test) {
< break;
< }
<
< /* Check for D5 timeout in upper flash if it's not done */
< /* In this case, there is nothing to return to */
< /* because the flash was just erased, so just break.*/
< if ( (val & 0x00800000) != (d7test & 0x00800000)
< && (val & 0x00200000) != 0 ) {
<
< /* Check D7 once more since D7 and D5 are asynchronous */
< val = *(ftype *)dest;
< if ((val & 0x00800000) != (d7test & 0x00800000)) {
< reset = RESETFUNC();
< reset();
< }
< }
---
> /* Wait for flash write to complete (each device might complete
> * at a different time).
> */
> for (;;) {
> val = *(ftype *)dest;
> if ((val & 0x00800080) == d7test) {
> break;
> }
380,390c358,386
< /* Check for D5 timeout in lower flash if it's not done */
< /* In this case, there is nothing to return to */
< /* because the flash was just erased, so just break.*/
< if ( (val & 0x00000080) != (d7test & 0x00000080)
< && (val & 0x00000020) != 0 ) {
<
< /* Check D7 once more since D7 and D5 are asynchronous */
< val = *(ftype *)dest;
< if ((val & 0x00000080) != (d7test & 0x00000080)) {
< reset = RESETFUNC();
< reset();
---
> /* Check for D5 timeout in upper flash if it's not done
> * In this case, there is nothing to return to
> * because the flash was just erased, so just break.
> */
> if ( (val & 0x00800000) != (d7test & 0x00800000)
> && (val & 0x00200000) != 0 ) {
>
> /* Check D7 once more since D7 and D5 are asynchronous */
> val = *(ftype *)dest;
> if ((val & 0x00800000) != (d7test & 0x00800000)) {
> reset = RESETFUNC();
> reset();
> }
> }
>
> /* Check for D5 timeout in lower flash if it's not done
> * In this case, there is nothing to return to
> * because the flash was just erased, so just break.
> */
> if ((val & 0x00000080) != (d7test & 0x00000080) &&
> (val & 0x00000020) != 0) {
>
> /* Check D7 once more since D7 and D5 are asynchronous */
> val = *(ftype *)dest;
> if ((val & 0x00000080) != (d7test & 0x00000080)) {
> reset = RESETFUNC();
> reset();
> }
> }
392,396c388,389
< }
< }
<
< dest++;
< src++;
---
> dest++;
> src++;
405,407c398,400
< if (Is_Equal(dest1,src1)) {
< break;
< }
---
> if (Is_Equal(dest1,src1)) {
> break;
> }
FILE flashpic8.c:
1,18d0
< /*
< * %W% %E%
< *
< * Copyright (c) 1998-1999 Lucent Technologies, Inc. All Rights Reserved.
< *
< * This software is the confidential and proprietary information of Lucent
< * Technologies, Inc. ("Confidential Information"). You shall not disclose
< * such Confidential Information and shall use it only in accordance with
< * the terms of the license agreement you entered into with Lucent.
< *
< * LUCENT TECHNOLOGIES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
< * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
< * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
< * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. LUCENT TECHNOLOGIES SHALL
< * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
< * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
< */
<
FILE flash32.h:
1,18d0
< /*
< * %W% %E%
< *
< * Copyright (c) 1998-1999 Lucent Technologies, Inc. All Rights Reserved.
< *
< * This software is the confidential and proprietary information of Lucent
< * Technologies, Inc. ("Confidential Information"). You shall not disclose
< * such Confidential Information and shall use it only in accordance with
< * the terms of the license agreement you entered into with Lucent.
< *
< * LUCENT TECHNOLOGIES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
< * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
< * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
< * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. LUCENT TECHNOLOGIES SHALL
< * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
< * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
< */
<
58d39
< #define Write_55_to_2aa() (*(ftype *)(fdev->base+(0x2aa<<2)) = 0x00550055)
61a43
> #define Write_20_to_555() (*(ftype *)(fdev->base+(0x555<<2)) = 0x00200020)
62a45,46
> #define Write_00_to_555() (*(ftype *)(fdev->base+(0x555<<2)) = 0x00000000)
> #define Write_55_to_2aa() (*(ftype *)(fdev->base+(0x2aa<<2)) = 0x00550055)
FILE flash8.h:
1,18d0
< /*
< * %W% %E%
< *
< * Copyright (c) 1998-1999 Lucent Technologies, Inc. All Rights Reserved.
< *
< * This software is the confidential and proprietary information of Lucent
< * Technologies, Inc. ("Confidential Information"). You shall not disclose
< * such Confidential Information and shall use it only in accordance with
< * the terms of the license agreement you entered into with Lucent.
< *
< * LUCENT TECHNOLOGIES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
< * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
< * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
< * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. LUCENT TECHNOLOGIES SHALL
< * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
< * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
< */
<
FILE flashdev.h:
1,18d0
< /*
< * %W% %E%
< *
< * Copyright (c) 1998-1999 Lucent Technologies, Inc. All Rights Reserved.
< *
< * This software is the confidential and proprietary information of Lucent
< * Technologies, Inc. ("Confidential Information"). You shall not disclose
< * such Confidential Information and shall use it only in accordance with
< * the terms of the license agreement you entered into with Lucent.
< *
< * LUCENT TECHNOLOGIES MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
< * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
< * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
< * A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. LUCENT TECHNOLOGIES SHALL
< * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
< * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
< */
<
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -