Big white-space cleanup.
[oweals/u-boot.git] / board / pm520 / flash.c
index 386822179d8a0f4fe3b5b1de8a8abbfb4ee592e7..4301b8c23433b7bd6fbbdf45f90d7500672d5aac 100644 (file)
@@ -35,36 +35,36 @@ flash_info_t flash_info[CFG_MAX_FLASH_BANKS];       /* info for FLASH chips    */
 #undef FLASH_PORT_WIDTH16
 
 #ifdef FLASH_PORT_WIDTH16
-#define FLASH_PORT_WIDTH               ushort
-#define FLASH_PORT_WIDTHV              vu_short
-#define SWAP(x)                        (x)
+#define FLASH_PORT_WIDTH       ushort
+#define FLASH_PORT_WIDTHV      vu_short
+#define SWAP(x)                        (x)
 #else
-#define FLASH_PORT_WIDTH               ulong
-#define FLASH_PORT_WIDTHV              vu_long
-#define SWAP(x)                        (x)
+#define FLASH_PORT_WIDTH       ulong
+#define FLASH_PORT_WIDTHV      vu_long
+#define SWAP(x)                        (x)
 #endif
 
 /* Intel-compatible flash ID */
-#define INTEL_COMPAT  0x00890089
-#define INTEL_ALT     0x00B000B0
+#define INTEL_COMPAT           0x00890089
+#define INTEL_ALT              0x00B000B0
 
 /* Intel-compatible flash commands */
-#define INTEL_PROGRAM 0x00100010
-#define INTEL_ERASE   0x00200020
-#define INTEL_CLEAR   0x00500050
-#define INTEL_LOCKBIT 0x00600060
-#define INTEL_PROTECT 0x00010001
-#define INTEL_STATUS  0x00700070
-#define INTEL_READID  0x00900090
-#define INTEL_CONFIRM 0x00D000D0
-#define INTEL_RESET   0xFFFFFFFF
+#define INTEL_PROGRAM          0x00100010
+#define INTEL_ERASE            0x00200020
+#define INTEL_CLEAR            0x00500050
+#define INTEL_LOCKBIT          0x00600060
+#define INTEL_PROTECT          0x00010001
+#define INTEL_STATUS           0x00700070
+#define INTEL_READID           0x00900090
+#define INTEL_CONFIRM          0x00D000D0
+#define INTEL_RESET            0xFFFFFFFF
 
 /* Intel-compatible flash status bits */
-#define INTEL_FINISHED 0x00800080
-#define INTEL_OK       0x00800080
+#define INTEL_FINISHED         0x00800080
+#define INTEL_OK               0x00800080
 
-#define FPW       FLASH_PORT_WIDTH
-#define FPWV   FLASH_PORT_WIDTHV
+#define FPW    FLASH_PORT_WIDTH
+#define FPWV   FLASH_PORT_WIDTHV
 
 #define mb() __asm__ __volatile__ ("" : : : "memory")
 
@@ -168,6 +168,10 @@ void flash_print_info (flash_info_t *info)
        }
 
        switch (info->flash_id & FLASH_TYPEMASK) {
+       case FLASH_28F256J3A:
+               printf ("28F256J3A\n");
+               break;
+
        case FLASH_28F128J3A:
                printf ("28F128J3A\n");
                break;
@@ -236,25 +240,33 @@ static ulong flash_get_size (FPW *addr, flash_info_t *info)
 
        switch (value) {
 
+       case (FPW) INTEL_ID_28F256J3A:
+               info->flash_id += FLASH_28F256J3A;
+               /* In U-Boot we support only 32 MB (no bank-switching) */
+               info->sector_count = 256 / 2;
+               info->size =  0x04000000 / 2;
+               info->start[0] = CFG_FLASH_BASE + 0x02000000;
+               break;                          /* => 32 MB     */
+
        case (FPW) INTEL_ID_28F128J3A:
                info->flash_id += FLASH_28F128J3A;
                info->sector_count = 128;
                info->size = 0x02000000;
-               info->start[0] = CFG_FLASH_BASE;
+               info->start[0] = CFG_FLASH_BASE + 0x02000000;
                break;                          /* => 32 MB     */
 
        case (FPW) INTEL_ID_28F640J3A:
                info->flash_id += FLASH_28F640J3A;
                info->sector_count = 64;
                info->size = 0x01000000;
-               info->start[0] = CFG_FLASH_BASE + 0x01000000;
+               info->start[0] = CFG_FLASH_BASE + 0x03000000;
                break;                          /* => 16 MB     */
 
        case (FPW) INTEL_ID_28F320J3A:
                info->flash_id += FLASH_28F320J3A;
                info->sector_count = 32;
                info->size = 0x800000;
-               info->start[0] = CFG_FLASH_BASE + 0x01800000;
+               info->start[0] = CFG_FLASH_BASE + 0x03800000;
                break;                          /* => 8 MB     */
 
        default:
@@ -285,6 +297,7 @@ static void flash_sync_real_protect (flash_info_t * info)
 
        switch (info->flash_id & FLASH_TYPEMASK) {
 
+       case FLASH_28F256J3A:
        case FLASH_28F128J3A:
        case FLASH_28F640J3A:
        case FLASH_28F320J3A: