]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
Patch by Brad Kemp, 8 Mar 2002:
authorwdenk <wdenk>
Sun, 10 Mar 2002 00:04:21 +0000 (00:04 +0000)
committerwdenk <wdenk>
Sun, 10 Mar 2002 00:04:21 +0000 (00:04 +0000)
- fixes protection for the flash on ppmc8260 board
- come doc cleanup

CHANGELOG
README
board/ppmc8260/strataflash.c
include/config_ppmc8260.h

index e91059a1e57fe275ca48a1a18e5a2fd7d02012f9..23c5233f2d60d2f906d2915f7a66a7b1a79000f6 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,10 @@
 Modifications for 1.1.6:
 ======================================================================
 
+* Patch by Brad Kemp, 8 Mar 2002:
+  - fixes protection for the flash on ppmc8260 board
+  - come doc cleanup
+
 * Series of patches by Erik Theisen, 5 Mar 2002:
 
   #1:  - allow generation of GNU stabs line number debugging symbols
diff --git a/README b/README
index 314451afd59801b8b14549c899f4a952e14896d7..da5de29a62e37955a5a090648e93ed1b56be7eb3 100644 (file)
--- a/README
+++ b/README
@@ -831,6 +831,9 @@ Configuration Settings:
                too limited to allow for a tempory copy of the
                downloaded image) this option may be very useful.
 
+- CFG_FLASH_CFI:
+               Define if the flash driver uses extra elements in the common
+               flash structure for storing flash geometry
 
 The following definitions that deal with the placement and management
 of environment data (variable area); in general, we support the
index d367949a8bfc4542d7a87386d678c7c7ae54df42..dd9211f82f8a2ea7615ac671ab2726b6c7f3dd38 100644 (file)
@@ -340,44 +340,38 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
  */
 int flash_real_protect(flash_info_t *info, long sector, int prot)
 {
-       long sectnum;
        ulong start;
 
-
-       for(sectnum = 0; sectnum<info->sector_count; sectnum++)
-               if(info->start[sectnum] == sector)
-                       break;
-
-       flash_write_cmd(info, sectnum, 0, FLASH_CMD_CLEAR_STATUS);
-       flash_write_cmd(info, sectnum, 0, FLASH_CMD_PROTECT);
+       flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
+       flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
        if(prot)
-               flash_write_cmd(info, sectnum, 0, FLASH_CMD_PROTECT_SET);
+               flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_SET);
        else
-               flash_write_cmd(info, sectnum, 0, FLASH_CMD_PROTECT_CLEAR);
+               flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
 
        /* Wait for command completion */
        start = get_timer (0);
-       while(!flash_isset(info, sectnum, 0, FLASH_STATUS_DONE)) {
+       while(!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
                if (get_timer(start) > info->erase_blk_tout) {
-                       printf("Flash %sprotect timeout at address %lx\n", prot?"":"un", sector);
-                       flash_write_cmd(info, sectnum, 0, FLASH_CMD_RESET);
+                       printf("Flash %sprotect timeout at address %lx\n", prot?"":"un", info->start[sector]);
+                       flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
                        return 1;
                }
        }
-       if(!flash_isequal(info,sectnum, 0, FLASH_STATUS_DONE)) {
-               printf("\nFlash %sprotect error at address %lx\n", prot?"":"un",sector);
+       if(!flash_isequal(info,sector, 0, FLASH_STATUS_DONE)) {
+               printf("\nFlash %sprotect error at address %lx\n", prot?"":"un",info->start[sector]);
                flash_status_display(info, 0);
-               flash_write_cmd(info, sectnum, 0, FLASH_CMD_RESET);
+               flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
                return 1;
        }
-       flash_write_cmd(info, sectnum, 0, FLASH_CMD_RESET);
-       info->protect[sectnum] = prot;
+       flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
+       info->protect[sector] = prot;
        /* Intel's unprotect unprotects all locking */
        if(prot == 0) {
                int i;
                for(i = 0 ; i<info->sector_count; i++) {
                        if(info->protect[i])
-                               flash_real_protect(info, info->start[i], 1);
+                               flash_real_protect(info, i, 1);
                }
        }
 
index 456e055c06b10e787278b04b49f80ffd67c1db3d..0401c1b5c83f3cd527e7152493464e2cf8b7ab3f 100644 (file)
  *     - Address Multiplexing where A5 is output on A14 pin
  *      (A6 on A15, and so on),
  *     - use address pins A13-A15 as bank select,
- *     - A7 is output on SDA10 during an ACTIVATE command,
+ *     - A9 is output on SDA10 during an ACTIVATE command,
  *     - earliest timing for ACTIVATE command after REFRESH command is 7 clocks,
  *     - earliest timing for ACTIVATE or REFRESH command after PRECHARGE command
  *      is 3 clocks,
 /*
  * With 16MB SDRAM, OR4 is configured as follows
  *     - 4 internal banks per device
- *     - Row start address bit is A7 with LSDMR[PBI] = 0
- *     - 13 row address lines
+ *     - Row start address bit is A10 with LSDMR[PBI] = 0
+ *     - 12 row address lines
  *     - Back-to-back page mode
  *     - Internal bank interleaving within save device enabled
  */