]> git.sur5r.net Git - u-boot/commitdiff
mpc83xx: Cleanup usage of LBC constants
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 12 Oct 2011 04:57:30 +0000 (23:57 -0500)
committerKim Phillips <kim.phillips@freescale.com>
Thu, 3 Nov 2011 23:27:56 +0000 (18:27 -0500)
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
26 files changed:
arch/powerpc/include/asm/fsl_lbc.h
include/configs/MERGERBOX.h
include/configs/MPC8308RDB.h
include/configs/MPC8313ERDB.h
include/configs/MPC8315ERDB.h
include/configs/MPC8323ERDB.h
include/configs/MPC832XEMDS.h
include/configs/MPC8349EMDS.h
include/configs/MPC8349ITX.h
include/configs/MPC8360EMDS.h
include/configs/MPC8360ERDK.h
include/configs/MPC837XEMDS.h
include/configs/MPC837XERDB.h
include/configs/MVBLM7.h
include/configs/SIMPC8313.h
include/configs/TQM834x.h
include/configs/km/km83xx-common.h
include/configs/kmeter1.h
include/configs/kmsupx5.h
include/configs/mpc8308_p1m.h
include/configs/sbc8349.h
include/configs/suvd3.h
include/configs/tuda1.h
include/configs/tuxa1.h
include/configs/ve8313.h
include/configs/vme8349.h

index 8695a6269afce161396330fceabdfccecea95076..bf572b78e1fb528e156afcd5808409884635146f 100644 (file)
@@ -50,8 +50,10 @@ void lbc_sdram_init(void);
 #define BR_MSEL                                0x000000E0
 #define BR_MSEL_SHIFT                  5
 #define BR_MS_GPCM                     0x00000000      /* GPCM */
+#if !defined(CONFIG_MPC834x) && !defined(CONFIG_MPC8360)
 #define BR_MS_FCM                      0x00000020      /* FCM */
-#ifdef CONFIG_MPC83xx
+#endif
+#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC8360)
 #define BR_MS_SDRAM                    0x00000060      /* SDRAM */
 #elif defined(CONFIG_MPC85xx)
 #define BR_MS_SDRAM                    0x00000000      /* SDRAM */
@@ -138,8 +140,10 @@ void lbc_sdram_init(void);
 #define OR_GPCM_EHTR_SHIFT             1
 #define OR_GPCM_EHTR_CLEAR             0x00000000
 #define OR_GPCM_EHTR_SET               0x00000002
+#if !defined(CONFIG_MPC8308)
 #define OR_GPCM_EAD                    0x00000001
 #define OR_GPCM_EAD_SHIFT              0
+#endif
 
 /* helpers to convert values into an OR address mask (GPCM mode) */
 #define P2SZ_TO_AM(s)  ((~((s) - 1)) & 0xffff8000)     /* must be pow of 2 */
@@ -196,8 +200,10 @@ void lbc_sdram_init(void);
 #define OR_SDRAM_XAM_SHIFT             13
 #define OR_SDRAM_COLS                  0x00001C00
 #define OR_SDRAM_COLS_SHIFT            10
+#define OR_SDRAM_MIN_COLS              7
 #define OR_SDRAM_ROWS                  0x000001C0
 #define OR_SDRAM_ROWS_SHIFT            6
+#define OR_SDRAM_MIN_ROWS              9
 #define OR_SDRAM_PMSEL                 0x00000020
 #define OR_SDRAM_PMSEL_SHIFT           5
 #define OR_SDRAM_EAD                   0x00000001
index aa35c1c9d9858080c8a3a130092185efd2272e16..81769164ec4bf7d5f8a1d29c2d7836c6ea109a57 100644 (file)
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_64MB)
 
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | BR_PS_16 | BR_V)
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | BR_PS_16 |\
+                                BR_MS_GPCM | BR_V)
 #define CONFIG_SYS_OR0_PRELIM  (CONFIG_SYS_FLASH_BASE | OR_UPM_XAM |\
                                 OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 |\
-                                OR_GPCM_XACS | OR_GPCM_SCY_15 | OR_GPCM_TRLX |\
-                                OR_GPCM_EHTR | OR_GPCM_EAD)
+                                OR_GPCM_XACS | OR_GPCM_SCY_15 |\
+                                OR_GPCM_TRLX_SET | OR_GPCM_EHTR_SET |\
+                                OR_GPCM_EAD)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1
 #define CONFIG_SYS_MAX_FLASH_SECT      512
 #define CONFIG_NAND_FSL_ELBC           1
 
 #define CONFIG_SYS_NAND_BASE   0xE0600000
-#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_NAND_BASE | (2<<BR_DECC_SHIFT) |\
+#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_NAND_BASE | BR_DECC_CHK_GEN |\
                                 BR_PS_8 | BR_MS_FCM | BR_V)
-#define CONFIG_SYS_OR1_PRELIM  (0xFFFF8000 | OR_FCM_BCTLD | OR_FCM_CST |\
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB | OR_FCM_BCTLD | OR_FCM_CST |\
                                 OR_FCM_CHT | OR_FCM_SCY_1 | OR_FCM_RST |\
                                 OR_FCM_TRLX | OR_FCM_EHTR)
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 /*
  * Serial Port
index 334c96ea3801d980ece68386344620cbee5a1b5f..47ff2f550b7a533671ed87a2962fea069cca6de4 100644 (file)
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_8MB)
 
-#define CONFIG_SYS_BR0_PRELIM  (\
-               CONFIG_SYS_FLASH_BASE   /* Flash Base address */        |\
-               (2 << BR_PS_SHIFT)      /* 16 bit port size */          |\
-               BR_V)                   /* valid */
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_UPM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
-                               | OR_GPCM_EAD)
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
 /* 127 64KB sectors and 8 8KB top sectors per device */
  * NAND Flash on the Local Bus
  */
 #define CONFIG_SYS_NAND_BASE   0xE0600000              /* 0xE0600000 */
+#define CONFIG_SYS_NAND_WINDOW_SIZE    (32 * 1024)     /* 0x00008000 */
 #define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_NAND_BASE \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
-                               | BR_PS_8               /* 8 bit port */ \
+                               | BR_DECC_CHK_GEN       /* Use HW ECC */ \
+                               | BR_PS_8               /* 8 bit Port */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR1_PRELIM  (0xFFFF8000             /* length 32K */ \
+#define CONFIG_SYS_OR1_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
                                | OR_FCM_CSCT \
                                | OR_FCM_CST \
                                | OR_FCM_CHT \
 
 #ifdef CONFIG_VSC7385_ENET
 #define CONFIG_TSEC2
+                                       /* VSC7385 Base address on CS2 */
 #define CONFIG_SYS_VSC7385_BASE                0xF0000000
-#define CONFIG_SYS_BR2_PRELIM          0xf0000801 /* VSC7385 Base address */
-#define CONFIG_SYS_OR2_PRELIM          0xfffe09ff /* VSC7385, 128K bytes*/
+#define CONFIG_SYS_VSC7385_SIZE                (128 * 1024) /* 0x00020000 */
+#define CONFIG_SYS_BR2_PRELIM          (CONFIG_SYS_VSC7385_BASE \
+                                       | BR_PS_8       /* 8-bit port */ \
+                                       | BR_MS_GPCM    /* MSEL = GPCM */ \
+                                       | BR_V)         /* valid */
+                                       /* 0xF0000801 */
+#define CONFIG_SYS_OR2_PRELIM          (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_SETA \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET)
+                                       /* 0xFFFE09FF */
 /* Access window base at VSC7385 base */
 #define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_VSC7385_BASE
 /* Access window size 128K */
index 93e1b1b1afe5836092dfa35475dee8c70ceffd71..21771fd0116aef12c0a4ec3cb71731e6cd7c2b9f 100644 (file)
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE      /* buffer up multiple bytes */
 
 #define CONFIG_SYS_NOR_BR_PRELIM       (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM       (0xFF800000     /* 8 MByte */ \
+                                       | BR_PS_16      /* 16 bit port */ \
+                                       | BR_MS_GPCM    /* MSEL = GPCM */ \
+                                       | BR_V)         /* valid */
+#define CONFIG_SYS_NOR_OR_PRELIM       (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_9 \
                                | OR_GPCM_EHTR \
                                /* 0xFF006FF7   TODO SLOW 16 MB flash size */
                                        /* window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000017      /* 16 MB window size */
+                                       /* 16 MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_16MB)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1       /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      135     /* sectors per device */
 #define CONFIG_CMD_NAND 1
 #define CONFIG_NAND_FSL_ELBC 1
 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
+#define CONFIG_SYS_NAND_WINDOW_SIZE (32 * 1024)
 
 
 #define CONFIG_SYS_NAND_BR_PRELIM      (CONFIG_SYS_NAND_BASE \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
+                               | BR_DECC_CHK_GEN       /* Use HW ECC */ \
                                | BR_PS_8               /* 8 bit port */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFFF8000     /* length 32K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM      \
+                               (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
                                | OR_FCM_CSCT \
                                | OR_FCM_CST \
                                | OR_FCM_CHT \
 #endif
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E      /* 32KB  */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 #define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR1_PRELIM
 #define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR1_PRELIM
 
-/* local bus read write buffer mapping */
-#define CONFIG_SYS_BR3_PRELIM          0xFA000801      /* map at 0xFA000000 */
-#define CONFIG_SYS_OR3_PRELIM          0xFFFF8FF7      /* 32kB */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM    0xFA000000
-#define CONFIG_SYS_LBLAWAR3_PRELIM     0x8000000E      /* 32KB  */
+/* local bus write LED / read status buffer (BCSR) mapping */
+#define CONFIG_SYS_BCSR_ADDR           0xFA000000
+#define CONFIG_SYS_BCSR_SIZE           (32 * 1024)     /* 0x00008000 */
+                                       /* map at 0xFA000000 on LCS3 */
+#define CONFIG_SYS_BR3_PRELIM          (CONFIG_SYS_BCSR_ADDR \
+                                       | BR_PS_8       /* 8 bit port */ \
+                                       | BR_MS_GPCM    /* MSEL = GPCM */ \
+                                       | BR_V)         /* valid */
+                                       /* 0xFA000801 */
+#define CONFIG_SYS_OR3_PRELIM          (P2SZ_TO_AM(CONFIG_SYS_BCSR_SIZE) \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_ACS_DIV2 \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
+                                       /* 0xFFFF8FF7 */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_BCSR_ADDR
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 /* Vitesse 7385 */
 
-#define CONFIG_SYS_VSC7385_BASE        0xF0000000
-
 #ifdef CONFIG_VSC7385_ENET
 
-                                       /* VSC7385 Base address */
-#define CONFIG_SYS_BR2_PRELIM          0xf0000801
-                                       /* VSC7385, 128K bytes*/
-#define CONFIG_SYS_OR2_PRELIM          0xfffe09ff
+                                       /* VSC7385 Base address on LCS2 */
+#define CONFIG_SYS_VSC7385_BASE                0xF0000000
+#define CONFIG_SYS_VSC7385_SIZE                (128 * 1024)    /* 0x00020000 */
+
+#define CONFIG_SYS_BR2_PRELIM          (CONFIG_SYS_VSC7385_BASE \
+                                       | BR_PS_8       /* 8 bit port */ \
+                                       | BR_MS_GPCM    /* MSEL = GPCM */ \
+                                       | BR_V)         /* valid */
+#define CONFIG_SYS_OR2_PRELIM          (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_SETA \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
+                                       /* 0xFFFE09FF */
+
                                        /* Access window base at VSC7385 base */
 #define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_VSC7385_BASE
-                                       /* Access window size 128K */
-#define CONFIG_SYS_LBLAWAR2_PRELIM     0x80000010
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_128KB)
 
 #endif
 
index 0ae1d998eac95b63c44777f9e14b2e35c297f2cc..2ebe6adc5363906b48b1925f1ea5106c5ea1d858 100644 (file)
 
                                        /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000016 /* 8MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_8MB)
 
 #define CONFIG_SYS_NOR_BR_PRELIM       (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)         /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM       ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
-                               | OR_UPM_XAM \
-                               | OR_GPCM_CSNT \
-                               | OR_GPCM_ACS_DIV2 \
-                               | OR_GPCM_XACS \
-                               | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
-                               | OR_GPCM_EAD)
+                                       | BR_PS_16      /* 16 bit port */ \
+                                       | BR_MS_GPCM    /* MSEL = GPCM */ \
+                                       | BR_V)         /* valid */
+#define CONFIG_SYS_NOR_OR_PRELIM       (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+                                       | OR_UPM_XAM \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_ACS_DIV2 \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
 /* 127 64KB sectors and 8 8KB top sectors per device */
 #define CONFIG_MTD_NAND_VERIFY_WRITE   1
 #define CONFIG_CMD_NAND                        1
 #define CONFIG_NAND_FSL_ELBC           1
-#define CONFIG_SYS_NAND_BLOCK_SIZE 16384
+#define CONFIG_SYS_NAND_BLOCK_SIZE     16384
+#define CONFIG_SYS_NAND_WINDOW_SIZE    (32 * 1024)     /* 0x00008000 */
 
 #define CONFIG_SYS_NAND_U_BOOT_SIZE  (512 << 10)
 #define CONFIG_SYS_NAND_U_BOOT_DST   0x00100000
 #define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
 
 #define CONFIG_SYS_NAND_BR_PRELIM      (CONFIG_SYS_NAND_BASE \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
+                               | BR_DECC_CHK_GEN       /* Use HW ECC */ \
                                | BR_PS_8               /* 8 bit port */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFFF8000     /* length 32K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM      \
+                               (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
                                | OR_FCM_CSCT \
                                | OR_FCM_CST \
                                | OR_FCM_CHT \
 #endif
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E      /* 32KB  */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 #define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR1_PRELIM
 #define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR1_PRELIM
index 28c61cabfc2ba2aa22c8b4f2aab1842e8e51d1c5..40e95464316de0c3b2cb89d500d1ee58d2a0ea2c 100644 (file)
 
                                        /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000018      /* 32MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
 
 #define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR0_PRELIM  0xfe006ff7              /* 16MB Flash size */
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_ACS_DIV2 \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xFE006FF7 */
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1       /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      128     /* sectors per device */
 
 #undef CONFIG_SYS_FLASH_CHECKSUM
 
-/*
- * SDRAM on the Local Bus
- */
-#undef CONFIG_SYS_LB_SDRAM     /* The board has not SRDAM on local bus */
-
-#ifdef CONFIG_SYS_LB_SDRAM
-#define CONFIG_SYS_LBC_SDRAM_BASE      0xF0000000      /* SDRAM base addr */
-#define CONFIG_SYS_LBC_SDRAM_SIZE      64              /* LBC SDRAM is 64MB */
-
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_LBC_SDRAM_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     0x80000019      /* 64MB */
-
-/*local bus BR2, OR2 definition for SDRAM if soldered on the EPB board */
-/*
- * Base Register 2 and Option Register 2 configure SDRAM.
- * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf0000000.
- *
- * For BR2, need:
- *    Base address of 0xf0000000 = BR[0:16] = 1111 0000 0000 0000 0
- *    port size = 32-bits = BR2[19:20] = 11
- *    no parity checking = BR2[21:22] = 00
- *    SDRAM for MSEL = BR2[24:26] = 011
- *    Valid = BR[31] = 1
- *
- * 0    4    8    12   16   20   24   28
- * 1111 0000 0000 0000 0001 1000 0110 0001 = f0001861
- *
- * CONFIG_SYS_LBC_SDRAM_BASE should be masked and OR'ed into
- * the top 17 bits of BR2.
- */
-
-                               /*Port size=32bit, MSEL=SDRAM */
-#define CONFIG_SYS_BR2_PRELIM  0xf0001861
-
-/*
- * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
- *
- * For OR2, need:
- *    64MB mask for AM, OR2[0:7] = 1111 1100
- *                 XAM, OR2[17:18] = 11
- *    9 columns OR2[19-21] = 010
- *    13 rows   OR2[23-25] = 100
- *    EAD set for extra time OR[31] = 1
- *
- * 0    4    8    12   16   20   24   28
- * 1111 1100 0000 0000 0110 1001 0000 0001 = fc006901
- */
-
-#define CONFIG_SYS_OR2_PRELIM  0xfc006901
-
-                               /* LB sdram refresh timer, about 6us */
-#define CONFIG_SYS_LBC_LSRT    0x32000000
-                               /* LB refresh timer prescal, 266MHz/32 */
-#define CONFIG_SYS_LBC_MRTPR   0x20000000
-
-#define CONFIG_SYS_LBC_LSDMR_COMMON    0x0063b723
-
-#endif
-
-/*
- * Windows to access PIB via local bus
- */
-                                       /* windows base 0xf8008000 */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM    0xf8008000
-#define CONFIG_SYS_LBLAWAR3_PRELIM     0x8000000f      /* windows size 64KB */
-
 /*
  * Serial Port
  */
index d5520466ae455b1753b6e501852a0dac98067de1..4ed5a9769be60f154bf6b8d84bfab2ecf162f658 100644 (file)
 
                                        /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000018      /* 32MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
 
 #define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR0_PRELIM  0xfe006ff7              /* 16MB Flash size */
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_ACS_DIV2 \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xfe006ff7 */
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1       /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      128     /* sectors per device */
 #define CONFIG_SYS_BCSR                        0xF8000000
                                        /* Access window base at BCSR base */
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_BCSR
-                                       /* Access window size 32K */
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E
-
-                                       /* Port size=8bit, MSEL=GPCM */
-#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_BCSR|0x00000801)
-#define CONFIG_SYS_OR1_PRELIM          0xFFFFE9f7      /* length 32K */
-
-/*
- * SDRAM on the Local Bus
- */
-#undef CONFIG_SYS_LB_SDRAM     /* The board has not SRDAM on local bus */
-
-#ifdef CONFIG_SYS_LB_SDRAM
-#define CONFIG_SYS_LBC_SDRAM_BASE      0xF0000000      /* SDRAM base address */
-#define CONFIG_SYS_LBC_SDRAM_SIZE      64              /* LBC SDRAM is 64MB */
-
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_LBC_SDRAM_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     0x80000019      /* 64MB */
-
-/*local bus BR2, OR2 definition for SDRAM if soldered on the EPB board */
-/*
- * Base Register 2 and Option Register 2 configure SDRAM.
- * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf0000000.
- *
- * For BR2, need:
- *    Base address of 0xf0000000 = BR[0:16] = 1111 0000 0000 0000 0
- *    port size = 32-bits = BR2[19:20] = 11
- *    no parity checking = BR2[21:22] = 00
- *    SDRAM for MSEL = BR2[24:26] = 011
- *    Valid = BR[31] = 1
- *
- * 0    4    8    12   16   20   24   28
- * 1111 0000 0000 0000 0001 1000 0110 0001 = f0001861
- *
- * CONFIG_SYS_LBC_SDRAM_BASE should be masked and OR'ed into
- * the top 17 bits of BR2.
- */
-
-#define CONFIG_SYS_BR2_PRELIM  0xf0001861      /*Port size=32bit, MSEL=SDRAM */
-
-/*
- * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
- *
- * For OR2, need:
- *    64MB mask for AM, OR2[0:7] = 1111 1100
- *                 XAM, OR2[17:18] = 11
- *    9 columns OR2[19-21] = 010
- *    13 rows   OR2[23-25] = 100
- *    EAD set for extra time OR[31] = 1
- *
- * 0    4    8    12   16   20   24   28
- * 1111 1100 0000 0000 0110 1001 0000 0001 = fc006901
- */
-
-#define CONFIG_SYS_OR2_PRELIM  0xfc006901
-
-                               /* LB sdram refresh timer, about 6us */
-#define CONFIG_SYS_LBC_LSRT    0x32000000
-                               /* LB refresh timer prescal, 266MHz/32 */
-#define CONFIG_SYS_LBC_MRTPR   0x20000000
-
-#define CONFIG_SYS_LBC_LSDMR_COMMON    0x0063b723
-
-#endif
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
+
+#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_BCSR \
+                                       | BR_PS_8 \
+                                       | BR_MS_GPCM \
+                                       | BR_V)
+#define CONFIG_SYS_OR1_PRELIM          (OR_AM_32KB \
+                                       | OR_GPCM_XAM \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
+                                       /* 0xFFFFE9F7 */
 
 /*
  * Windows to access PIB via local bus
  */
-                                       /* windows base 0xf8008000 */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM    0xf8008000
-                                       /* windows size 64KB */
-#define CONFIG_SYS_LBLAWAR3_PRELIM     0x8000000f
+                                       /* PIB window base 0xF8008000 */
+#define CONFIG_SYS_PIB_BASE            0xF8008000
+#define CONFIG_SYS_PIB_WINDOW_SIZE     (32 * 1024)
+#define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_PIB_BASE
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_64KB)
 
 /*
  * CS2 on Local Bus, to PIB
  */
-                               /* CS2 base address at 0xf8008000 */
-#define CONFIG_SYS_BR2_PRELIM  0xf8008801
-                               /* size 32KB, port size 8bit, GPCM */
-#define CONFIG_SYS_OR2_PRELIM  0xffffe9f7
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_PIB_BASE \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+                               /* 0xF8008801 */
+#define CONFIG_SYS_OR2_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_PIB_WINDOW_SIZE) \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xffffe9f7 */
 
 /*
  * CS3 on Local Bus, to PIB
  */
-                               /* CS3 base address at 0xf8010000 */
-#define CONFIG_SYS_BR3_PRELIM  0xf8010801
-                               /* size 32KB, port size 8bit, GPCM */
-#define CONFIG_SYS_OR3_PRELIM  0xffffe9f7
+#define CONFIG_SYS_BR3_PRELIM  ((CONFIG_SYS_PIB_BASE + \
+                                       CONFIG_SYS_PIB_WINDOW_SIZE) \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+                               /* 0xF8010801 */
+#define CONFIG_SYS_OR3_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_PIB_WINDOW_SIZE) \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xffffe9f7 */
 
 /*
  * Serial Port
index 0c0e9048aedad3b1f16c8a2c78bbab7b2b0a1a32..a6aebb76cef6878f73e7ba210ff06da63d7b5ce6 100644 (file)
 #define CONFIG_SYS_FLASH_PROTECTION    1       /* Use h/w Flash protection. */
 /* #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
 
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | \
-                               (2 << BR_PS_SHIFT) |    /* 16 bit port */ \
-                               BR_V)                   /* valid */
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
+                               | BR_PS_16      /* 16 bit port  */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_UPM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
+
                                        /* window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000018      /* 32 MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1       /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      256     /* max sectors per device */
 #define CONFIG_SYS_BCSR                        0xE2400000
                                        /* Access window base at BCSR base */
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_BCSR
-                                       /* Access window size 32K */
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E
-                                       /* Port-size=8bit, MSEL=GPCM */
-#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_BCSR|0x00000801)
-#define CONFIG_SYS_OR1_PRELIM          0xFFFFE8F0      /* length 32K */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
+#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_BCSR \
+                                       | BR_PS_8 \
+                                       | BR_MS_GPCM \
+                                       | BR_V)
+                                       /* 0x00000801 */
+#define CONFIG_SYS_OR1_PRELIM          (OR_AM_32KB \
+                                       | OR_GPCM_XAM \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_TRLX_CLEAR \
+                                       | OR_GPCM_EHTR_CLEAR)
+                                       /* 0xFFFFE8F0 */
 
 #define CONFIG_SYS_INIT_RAM_LOCK       1
 #define CONFIG_SYS_INIT_RAM_ADDR       0xFD000000      /* Initial RAM addr */
  *
  * 0    4    8    12   16   20   24   28
  * 1111 0000 0000 0000 0001 1000 0110 0001 = F0001861
- *
- * FIXME: CONFIG_SYS_LBC_SDRAM_BASE should be masked and OR'ed into
- * FIXME: the top 17 bits of BR2.
  */
 
-                                       /* Port-size=32bit, MSEL=SDRAM */
-#define CONFIG_SYS_BR2_PRELIM          0xF0001861
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    0xF0000000
-#define CONFIG_SYS_LBLAWAR2_PRELIM     0x80000019      /* 64M */
+#define CONFIG_SYS_BR2_PRELIM          (CONFIG_SYS_LBC_SDRAM_BASE \
+                                       | BR_PS_32      /* 32-bit port */ \
+                                       | BR_MS_SDRAM   /* MSEL = SDRAM */ \
+                                       | BR_V)         /* Valid */
+                                       /* 0xF0001861 */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_LBC_SDRAM_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_64MB)
 
 /*
  * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
  * 1111 1100 0000 0000 0110 1001 0000 0001 = FC006901
  */
 
-#define CONFIG_SYS_OR2_PRELIM  0xFC006901
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_64MB \
+                       | OR_SDRAM_XAM \
+                       | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
+                       | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
+                       | OR_SDRAM_EAD)
+                       /* 0xFC006901 */
 
                                /* LB sdram refresh timer, about 6us */
 #define CONFIG_SYS_LBC_LSRT    0x32000000
index 3fb558f59d58e2e3caac16483abaf4d8ae523841..a2ceba7ae33fafa37cd7c787737bb6921dbe3626 100644 (file)
@@ -235,7 +235,6 @@ boards, we say we have two, but don't display a message if we find only one. */
 #define CONFIG_SYS_FLASH_BANKS_LIST    \
                {CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE + 0x800000}
 #define CONFIG_SYS_FLASH_SIZE          16      /* FLASH size in MB */
-#define CONFIG_SYS_FLASH_SIZE_SHIFT    4       /* log2 of the above value */
 #define CONFIG_SYS_FLASH_PROTECTION    1       /* Use h/w Flash protection. */
 
 /* Vitesse 7385 */
@@ -256,19 +255,21 @@ boards, we say we have two, but don't display a message if we find only one. */
 
 /* Flash */
 
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | BR_PS_16 | BR_V)
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
+                               | BR_PS_16 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_UPM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN \
-                                       | (0x13 + CONFIG_SYS_FLASH_SIZE_SHIFT))
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_16MB)
 
 /* Vitesse 7385 */
 
@@ -276,14 +277,17 @@ boards, we say we have two, but don't display a message if we find only one. */
 
 #ifdef CONFIG_VSC7385_ENET
 
-#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_VSC7385_BASE | BR_PS_8 | BR_V)
+#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_VSC7385_BASE \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
 #define CONFIG_SYS_OR1_PRELIM  (OR_AM_128KB \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
                                | OR_GPCM_SETA \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_VSC7385_BASE
@@ -294,14 +298,17 @@ boards, we say we have two, but don't display a message if we find only one. */
 /* LED */
 
 #define CONFIG_SYS_LED_BASE    0xF9000000
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_LED_BASE | BR_PS_8 | BR_V)
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_LED_BASE \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
 #define CONFIG_SYS_OR2_PRELIM  (OR_AM_2MB \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_9 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
 
 /* Compact Flash */
index 3a5af2d21e9f3f9e55f893ade0d9761574da554c..aaff93f09ab0b305e234c5b11ddb7666e874f7b9 100644 (file)
 
                                        /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000018 /* 32MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
 
 #define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
-                               | OR_UPM_XAM \
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+                               | OR_GPCM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
 #define CONFIG_SYS_BCSR                        0xF8000000
                                        /* Access window base at BCSR base */
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_BCSR
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000F /* Access window size 64K */
-
-                                       /* Port size=8bit, MSEL=GPCM */
-#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_BCSR|0x00000801)
-#define CONFIG_SYS_OR1_PRELIM          0xFFFFE9f7 /* length 32K */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_64KB)
+
+#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_BCSR \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xFFFFE9F7 */
 
 /*
  * SDRAM on the Local Bus
 
 #ifdef CONFIG_SYS_LB_SDRAM
 #define CONFIG_SYS_LBLAWBAR2           0
-#define CONFIG_SYS_LBLAWAR2            0x80000019 /* 64MB */
+#define CONFIG_SYS_LBLAWAR2            (LBLAWAR_EN | LBLAWAR_64MB)
 
 /*local bus BR2, OR2 definition for SDRAM if soldered on the EPB board */
 /*
  * xxxx xxxx xxxx xxxx x001 1000 0110 0001 = 00001861
  */
 
-#define CONFIG_SYS_BR2         0x00001861 /*Port size=32bit, MSEL=SDRAM */
+/* Port size=32bit, MSEL=DRAM */
+#define CONFIG_SYS_BR2 (BR_PS_32 | BR_MS_SDRAM | BR_V) /* 0xF0001861 */
 
 /*
  * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
  * 1111 1100 0000 0000 0110 1001 0000 0001 = fc006901
  */
 
-#define CONFIG_SYS_OR2         0xfc006901
+#define CONFIG_SYS_OR2 (MEG_TO_AM(CONFIG_SYS_LBC_SDRAM_SIZE) \
+                       | OR_SDRAM_XAM \
+                       | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
+                       | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
+                       | OR_SDRAM_EAD)
+                       /* 0xFC006901 */
 
                                /* LB sdram refresh timer, about 6us */
 #define CONFIG_SYS_LBC_LSRT    0x32000000
 #endif
 
 /*
- * Windows to access PIB via local bus
+ * Windows to access Platform I/O Boards (PIB) via local bus
  */
-#define CONFIG_SYS_LBLAWBAR3_PRELIM    0xf8010000 /* windows base 0xf8010000 */
-#define CONFIG_SYS_LBLAWAR3_PRELIM     0x8000000e /* windows size 32KB */
+#define CONFIG_SYS_PIB_BASE            0xF8008000
+#define CONFIG_SYS_PIB_WINDOW_SIZE     (32 * 1024)
+
+/* [RFC] This LBLAW only covers the 2nd window (CS5) */
+#define CONFIG_SYS_LBLAWBAR3_PRELIM    \
+                       CONFIG_SYS_PIB_BASE + CONFIG_SYS_PIB_WINDOW_SIZE
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 /*
  * CS4 on Local Bus, to PIB
  */
-#define CONFIG_SYS_BR4_PRELIM  0xf8008801 /* CS4 base address at 0xf8008000 */
-#define CONFIG_SYS_OR4_PRELIM  0xffffe9f7 /* size 32KB, port size 8bit, GPCM */
+                               /* CS4 base address at 0xf8008000 */
+#define CONFIG_SYS_BR4_PRELIM  (CONFIG_SYS_PIB_BASE \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+                               /* 0xF8008801 */
+#define CONFIG_SYS_OR4_PRELIM  (OR_AM_32KB \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xffffe9f7 */
 
 /*
  * CS5 on Local Bus, to PIB
  */
-#define CONFIG_SYS_BR5_PRELIM  0xf8010801 /* CS5 base address at 0xf8010000 */
-#define CONFIG_SYS_OR5_PRELIM  0xffffe9f7 /* size 32KB, port size 8bit, GPCM */
+                               /* CS5 base address at 0xf8010000 */
+#define CONFIG_SYS_BR5_PRELIM  ((CONFIG_SYS_PIB_BASE + \
+                                               CONFIG_SYS_PIB_WINDOW_SIZE) \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+                               /* 0xF8010801 */
+#define CONFIG_SYS_OR5_PRELIM  (CONFIG_SYS_PIB_BASE \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xffffe9f7 */
 
 /*
  * Serial Port
index bc574a6375dddcdd05795ea87bd933e075fd83a4..ea634a633552d852ef200e0441f37a38e1cf295c 100644 (file)
 
                                        /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000018 /* 32MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
 
 #define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT) /* 16 bit port */ \
-                               | BR_V) /* valid */
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_UPM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000001b /* Access window size 4K */
+/*
+ * [RFC] Comment said 4KB window; code said 256MB window; OR1 says 64MB
+ * ... What's correct?
+ */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
 
 /* Port size 8 bit, UPMA */
-#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_NAND_BASE | 0x00000881)
-#define CONFIG_SYS_OR1_PRELIM          0xfc000001
+#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_NAND_BASE \
+                                       | BR_PS_8 \
+                                       | BR_MS_UPMA \
+                                       | BR_V)
+                                       /* 0x60000881 */
+#define CONFIG_SYS_OR1_PRELIM          (OR_AM_64MB | OR_UPM_EAD)
+                                       /* 0xFC000001 */
 
 /*
  * Fujitsu MB86277 (MINT) graphics controller
 #define CONFIG_SYS_VIDEO_BASE          0x70000000
 
 #define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_VIDEO_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     0x80000019 /* Access window size 64MB */
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_64MB)
 
 /* Port size 32 bit, UPMB */
-                               /* PS=11, UPMB */
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_VIDEO_BASE | 0x000018a1)
-#define CONFIG_SYS_OR2_PRELIM  0xfc000001 /* (64MB, EAD=1) */
+#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_VIDEO_BASE \
+                               | BR_PS_32 \
+                               | BR_MS_UPMB \
+                               | BR_V)
+                               /* 0x000018a1 */
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_64MB | OR_UPM_EAD)
+                               /* 0xFC000001 */
 
 /*
  * Serial Port
index 8c2af084a160c874d3c57149ab00d393cf26d9a2..d7ee405636fa1e0941226486364d9d42c43fdc9a 100644 (file)
 
                                        /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000018 /* 32MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
 
 #define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_UPM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
                                /* 0xFE000FF7 */
 
 #define CONFIG_SYS_BCSR                0xF8000000
                                        /* Access window base at BCSR base */
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_BCSR
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E /* Access window size 32K */
-
-                               /* Port size=8bit, MSEL=GPCM */
-#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_BCSR | 0x00000801)
-#define CONFIG_SYS_OR1_PRELIM  0xFFFFE9f7 /* length 32K */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
+
+#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_BCSR \
+                               | BR_PS_8 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+                               /* 0xF8000801 */
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
+                               | OR_GPCM_XAM \
+                               | OR_GPCM_CSNT \
+                               | OR_GPCM_XACS \
+                               | OR_GPCM_SCY_15 \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
+                               | OR_GPCM_EAD)
+                               /* 0xFFFFE9F7 */
 
 /*
  * NAND Flash on the Local Bus
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
 #define CONFIG_NAND_FSL_ELBC   1
 
-#define CONFIG_SYS_NAND_BASE   0xE0600000      /* 0xE0600000 */
+#define CONFIG_SYS_NAND_BASE   0xE0600000
 #define CONFIG_SYS_BR3_PRELIM  (CONFIG_SYS_NAND_BASE \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
+                               | BR_DECC_CHK_GEN       /* Use HW ECC */ \
                                | BR_PS_8               /* 8 bit port */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
-                               | BR_V)         /* valid */
-#define CONFIG_SYS_OR3_PRELIM  (0xFFFF8000     /* length 32K */ \
+                               | BR_V)                 /* valid */
+#define CONFIG_SYS_OR3_PRELIM  (OR_AM_32KB \
                                | OR_FCM_BCTLD \
                                | OR_FCM_CST \
                                | OR_FCM_CHT \
                                /* 0xFFFF919E */
 
 #define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_LBLAWAR3_PRELIM     0x8000000E      /* 32KB  */
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 /*
  * Serial Port
index bf8a94dadec46c484932d3aff3f3f56cb8b6fb5d..f249cbb5ef61423714a7c7ea89ca2f26fd863425 100644 (file)
 #define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000016      /* 8 MB window size */
 
 #define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR0_PRELIM  (0xFF800000             /* 8 MByte */ \
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_9 \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
-                               /* 0xFF806FF7   TODO SLOW 8 MB flash size */
+                               /* 0xFF800191 */
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      256 /* max sectors per device */
 /*
  * NAND Flash on the Local Bus
  */
-#define CONFIG_SYS_NAND_BASE   0xE0600000      /* 0xE0600000 */
+#define CONFIG_SYS_NAND_BASE   0xE0600000
 #define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_NAND_BASE \
-                               | (2 << BR_DECC_SHIFT)  /* Use HW ECC */ \
-                               | BR_PS_8 |             /* 8 bit Port */ \
-                               | BR_MS_FCM |           /* MSEL = FCM */ \
+                               | BR_DECC_CHK_GEN       /* Use HW ECC */ \
+                               | BR_PS_8               /* 8 bit port */ \
+                               | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
-#define CONFIG_SYS_OR1_PRELIM  (0xFFFF8000             /* length 32K */ \
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
                                | OR_FCM_CSCT \
                                | OR_FCM_CST \
                                | OR_FCM_CHT \
                                | OR_FCM_TRLX \
                                | OR_FCM_EHTR)
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E      /* 32KB  */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 /* Vitesse 7385 */
 
 
 #ifdef CONFIG_VSC7385_ENET
 
-#define CONFIG_SYS_BR2_PRELIM          0xf0000801      /* Base address */
-#define CONFIG_SYS_OR2_PRELIM          0xfffe09ff      /* 128K bytes*/
+#define CONFIG_SYS_BR2_PRELIM          (CONFIG_SYS_VSC7385_BASE \
+                                       | BR_PS_8 \
+                                       | BR_MS_GPCM \
+                                       | BR_V)
+                                       /* 0xF0000801 */
+#define CONFIG_SYS_OR2_PRELIM          (OR_AM_128KB \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_SETA \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
+                                       /* 0xfffe09ff */
+
                                        /* Access Base */
 #define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_VSC7385_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM     0x80000010      /* Access Size 128K */
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_128KB)
 
 #endif
 
index f0d4e80b5e031d40e1092c5ec387bff509ee700c..8b20f72451e0d825eb64c3422e56f667f556f15b 100644 (file)
 
 #define CONFIG_SYS_FLASH_BASE          0xFF800000
 #define CONFIG_SYS_FLASH_SIZE          8
-#define CONFIG_SYS_FLASH_SIZE_SHIFT    3
 #define CONFIG_SYS_FLASH_EMPTY_INFO
 #define CONFIG_SYS_FLASH_ERASE_TOUT    60000
 #define CONFIG_SYS_FLASH_WRITE_TOUT    500
 #define CONFIG_SYS_MAX_FLASH_BANKS     1
 #define CONFIG_SYS_MAX_FLASH_SECT      256
 
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | BR_PS_16 | BR_V)
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
+                               | BR_PS_16 \
+                               | BR_MS_GPCM \
+                               | BR_V)
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_UPM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN \
-                               | (0x13 + CONFIG_SYS_FLASH_SIZE_SHIFT))
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_8MB)
 
 /*
  * U-Boot memory configuration
index e7d477d86e5f5db58d52bd51593fe2366bb6ec2d..77be3600f27b17db6eee8ad53b0aa3398186face 100644 (file)
 #define CONFIG_NAND_FSL_ELBC           1
 
 #define CONFIG_SYS_NAND_BR_PRELIM      (CONFIG_SYS_NAND_BASE \
-                               | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
+                               | BR_DECC_CHK_GEN       /* Use HW ECC */ \
                                | BR_PS_8               /* 8 bit Port */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
                                | BR_V)                 /* valid */
 
 #ifdef CONFIG_NAND_SP
-#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFFF8000     /* length 32K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM      (OR_AM_32KB \
                                        | OR_FCM_CSCT \
                                        | OR_FCM_CST \
                                        | OR_FCM_CHT \
                                        | OR_FCM_SCY_1 \
                                        | OR_FCM_TRLX \
                                        | OR_FCM_EHTR)
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x8000000E      /* 32KB */
-#define CONFIG_SYS_NAND_PAGE_SIZE      (512)   /* NAND chip page size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
+#define CONFIG_SYS_NAND_PAGE_SIZE      512     /* NAND chip page size */
                                        /* NAND chip block size */
 #define CONFIG_SYS_NAND_BLOCK_SIZE     (16 << 10)
 #define NAND_CACHE_PAGES               32
 #elif defined(CONFIG_NAND_LP)
-#define CONFIG_SYS_NAND_OR_PRELIM      (0xFFFC0000     /* length 256K */ \
+#define CONFIG_SYS_NAND_OR_PRELIM      (OR_AM_256KB \
                                        | OR_FCM_PGS \
                                        | OR_FCM_CSCT \
                                        | OR_FCM_CST \
                                        | OR_FCM_SCY_1 \
                                        | OR_FCM_TRLX \
                                        | OR_FCM_EHTR)
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000011      /* 256KB */
-#define CONFIG_SYS_NAND_PAGE_SIZE      (2048)  /* NAND chip page size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_256KB)
+#define CONFIG_SYS_NAND_PAGE_SIZE      2048    /* NAND chip page size */
                                        /* NAND chip block size */
 #define CONFIG_SYS_NAND_BLOCK_SIZE     (128 << 10)
 #define NAND_CACHE_PAGES               64
index ae296ebea0becd38d9f38d717b7a67be5ffe92e0..0b5370241b666e78b167692366d206ea3703114f 100644 (file)
                                        | OR_GPCM_SCY_5 \
                                        | OR_GPCM_TRLX)
 
-#define CONFIG_SYS_PRELIM_OR_AM        0xc0000000      /* OR addr mask: 1 GiB */
+#define CONFIG_SYS_PRELIM_OR_AM                OR_AM_1GB /* OR addr mask: 1 GiB */
 
 #define CONFIG_SYS_OR0_PRELIM          (CONFIG_SYS_PRELIM_OR_AM  \
                                        | CONFIG_SYS_OR_TIMING_FLASH)
 
-                                       /* 1 GiB window size (2^(size + 1)) */
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x8000001D
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_1GB)
 
                                        /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
index 0d411c2a4eeb78f3a57a6246b2279f6667fc386d..06ecb8a3e96ca78f2dbe4785705c7f02b83accb9 100644 (file)
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
 
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x8000001b /* 256MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_256MB)
 
 #define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | \
-                               (2 << BR_PS_SHIFT) | /* 16 bit port size */ \
+                               BR_PS_16 | /* 16 bit port size */ \
+                               BR_MS_GPCM | /* MSEL = GPCM */ \
                                BR_V)
 
 #define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
                                OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
                                OR_GPCM_SCY_5 | \
-                               OR_GPCM_TRLX | OR_GPCM_EAD)
+                               OR_GPCM_TRLX_SET | OR_GPCM_EAD)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1   /* max num of flash banks   */
 #define CONFIG_SYS_MAX_FLASH_SECT      512 /* max num of sects on one chip */
  */
 /* Window base at flash base */
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_KMBEC_FPGA_BASE
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000001A /* 128MB window size */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_128MB)
 
 #define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_KMBEC_FPGA_BASE | \
-                               (1 << BR_PS_SHIFT) | /* 8 bit port size */ \
+                               BR_PS_8 | /* 8 bit port size */ \
+                               BR_MS_GPCM | /* MSEL = GPCM */ \
                                BR_V)
 #define CONFIG_SYS_OR1_PRELIM  (MEG_TO_AM(CONFIG_SYS_KMBEC_FPGA_SIZE) | \
                                OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
                                OR_GPCM_SCY_2 | \
-                               OR_GPCM_TRLX | OR_GPCM_EAD)
+                               OR_GPCM_TRLX_SET | OR_GPCM_EAD)
 
 /*
  * Serial Port
index c04bde9e58ed83305444132adca593605c7fc35d..6b5a6feaf7bc1f61fa383539d157e3ac9bee8d80 100644 (file)
  * PAXE on the local bus CS3
  */
 #define CONFIG_SYS_LBLAWBAR3_PRELIM    CONFIG_SYS_PAXE_BASE
-#define CONFIG_SYS_LBLAWAR3_PRELIM     0x8000001C /* 512MB window size */
+#define CONFIG_SYS_LBLAWAR3_PRELIM     (LBLAWAR_EN | LBLAWAR_512MB)
 
 #define CONFIG_SYS_BR3_PRELIM  (CONFIG_SYS_PAXE_BASE | \
-                               (1 << BR_PS_SHIFT) | /* 8 bit port size */ \
+                               BR_PS_8 | /* 8 bit port size */ \
+                               BR_MS_GPCM | /* MSEL = GPCM */ \
                                BR_V)
 #define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_PAXE_SIZE) | \
                                OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
                                OR_GPCM_SCY_2 | \
-                               OR_GPCM_TRLX | OR_GPCM_EAD)
+                               OR_GPCM_TRLX_SET | OR_GPCM_EAD)
 
 /*
  * MMU Setup
index ccc1561523702f2c210728e6346f3c48da197514..b0dd88cd78098d11221255b06ca7fcdfbcbdccaa 100644 (file)
@@ -69,8 +69,8 @@
                                 OR_GPCM_CSNT | \
                                 OR_GPCM_ACS_DIV4 | \
                                 OR_GPCM_SCY_2 | \
-                                (OR_GPCM_TRLX & \
-                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_TRLX_SET | \
+                                OR_GPCM_EHTR_CLEAR | \
                                 OR_GPCM_EAD)
 
 /* LPXF:  icache cacheable, but dcache-inhibit and guarded */
index fbce8004f405735055de9dde7d7ec81b7cce48db..20fc6418b97032334ea84aef26abc8fee6de442a 100644 (file)
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_64MB)
 
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE  /* Flash Base addr */ \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR0_PRELIM  ((~(CONFIG_SYS_FLASH_SIZE - 1) << 20) \
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
+                               | BR_PS_16      /* 16 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                | OR_UPM_XAM \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_ACS_DIV2 \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_4 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
-                               | OR_GPCM_EAD)
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1 /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      512
  */
 #define CONFIG_SYS_SJA1000_BASE        0xFBFF0000
 #define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_SJA1000_BASE \
-                               | (1 << BR_PS_SHIFT)    /* 8 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR1_PRELIM  (0xFFFF8000             /* length 32K */ \
+                               | BR_PS_8       /* 8 bit port size */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
                                | OR_GPCM_SCY_5 \
-                               | OR_GPCM_EHTR)
+                               | OR_GPCM_EHTR_SET)
                                /* 0xFFFF8052 */
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_SJA1000_BASE
  */
 #define CONFIG_SYS_CPLD_BASE   0xFBFF8000
 #define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_CPLD_BASE \
-                               | (1 << BR_PS_SHIFT)    /* 8 bit port */ \
-                               | BR_V)                 /* valid */
-#define CONFIG_SYS_OR2_PRELIM  (0xFFFF8000             /* length 32K */ \
+                               | BR_PS_8       /* 8 bit port */ \
+                               | BR_MS_GPCM    /* MSEL = GPCM */ \
+                               | BR_V)         /* valid */
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_32KB \
                                | OR_GPCM_SCY_4 \
-                               | OR_GPCM_EHTR)
+                               | OR_GPCM_EHTR_SET)
                                /* 0xFFFF8042 */
 
 #define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_CPLD_BASE
index 99f8fb75d38f5a9796adadce887716dc8812860f..4812f686d56e79407a429ffb4744ed37892daeba 100644 (file)
 /*
  * SDRAM on the Local Bus
  */
-#define CONFIG_SYS_LBC_SDRAM_BASE      0x10000000      /* Localbus SDRAM */
-#define CONFIG_SYS_LBC_SDRAM_SIZE      128     /* LBC SDRAM is 128MB */
+#define CONFIG_SYS_LBC_SDRAM_BASE      0xF0000000      /* Localbus SDRAM */
+#define CONFIG_SYS_LBC_SDRAM_SIZE      64              /* LBC SDRAM is 64MB */
 
 /*
  * FLASH on the Local Bus
 #define CONFIG_SYS_FLASH_SIZE          8               /* flash size in MB */
 /* #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
 
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-                               | (2 << BR_PS_SHIFT)    /* 16 bit port */ \
-                               | BR_V)                 /* valid */
+#define CONFIG_SYS_BR0_PRELIM          (CONFIG_SYS_FLASH_BASE \
+                                       | BR_PS_16      /* 16 bit port */ \
+                                       | BR_MS_GPCM    /* MSEL = GPCM */ \
+                                       | BR_V)         /* valid */
+
+#define CONFIG_SYS_OR0_PRELIM          (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+                                       | OR_GPCM_XAM \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_ACS_DIV2 \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
+                                       /* 0xFF806FF7 */
 
-#define CONFIG_SYS_OR0_PRELIM          0xFF806FF7      /* 8 MB flash size */
                                        /* window base at flash base */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000016      /* 8 MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_8MB)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1       /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      64      /* sectors per device */
  *
  * 0    4    8    12   16   20   24   28
  * 1111 0000 0000 0000 0001 1000 0110 0001 = F0001861
- *
- * FIXME: CONFIG_SYS_LBC_SDRAM_BASE should be masked and OR'ed into
- * FIXME: the top 17 bits of BR2.
  */
 
-                                       /* Port-size=32bit, MSEL=SDRAM */
-#define CONFIG_SYS_BR2_PRELIM          0xF0001861
-#define CONFIG_SYS_LBLAWBAR2_PRELIM    0xF0000000
-#define CONFIG_SYS_LBLAWAR2_PRELIM     0x80000019 /* 64M */
+#define CONFIG_SYS_BR2_PRELIM          (CONFIG_SYS_LBC_SDRAM_BASE \
+                                       | BR_PS_32 \
+                                       | BR_MS_SDRAM \
+                                       | BR_V)
+                                       /* 0xF0001861 */
+#define CONFIG_SYS_LBLAWBAR2_PRELIM    CONFIG_SYS_LBC_SDRAM_BASE
+#define CONFIG_SYS_LBLAWAR2_PRELIM     (LBLAWAR_EN | LBLAWAR_64MB)
 
 /*
  * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
  * 1111 1100 0000 0000 0110 1001 0000 0001 = FC006901
  */
 
-#define CONFIG_SYS_OR2_PRELIM  0xFC006901
+#define CONFIG_SYS_OR2_PRELIM  (MEG_TO_AM(CONFIG_SYS_LBC_SDRAM_SIZE) \
+                       | OR_SDRAM_XAM \
+                       | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
+                       | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
+                       | OR_SDRAM_EAD)
+                       /* 0xFC006901 */
 
                                /* LB sdram refresh timer, about 6us */
 #define CONFIG_SYS_LBC_LSRT    0x32000000
                                | BATU_VS \
                                | BATU_VP)
 
-/* SDRAM @ 0xF0000000, stack in DCACHE 0xFDF00000 & FLASH @ 0xFE000000 */
-#define CONFIG_SYS_IBAT6L      (0xF0000000 \
+/* LBC SDRAM @ 0xF0000000, stack in DCACHE 0xFDF00000 & FLASH @ 0xFE000000 */
+#define CONFIG_SYS_IBAT6L      (CONFIG_SYS_LBC_SDRAM_BASE \
                                | BATL_PP_RW \
                                | BATL_MEMCOHERENCE \
                                | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_IBAT6U      (0xF0000000 | BATU_BL_256M | BATU_VS | BATU_VP)
+#define CONFIG_SYS_IBAT6U      (CONFIG_SYS_LBC_SDRAM_BASE \
+                               | BATU_BL_256M \
+                               | BATU_VS \
+                               | BATU_VP)
 
 #define CONFIG_SYS_IBAT7L      (0)
 #define CONFIG_SYS_IBAT7U      (0)
index 5f2e1e37f4aa37038423c6573ad3782321a53595..ae197018b81ddf6a2734c3f8a51bd199ab52a437 100644 (file)
@@ -70,7 +70,7 @@
                                 OR_GPCM_CSNT | \
                                 OR_GPCM_ACS_DIV4 | \
                                 OR_GPCM_SCY_3 | \
-                                OR_GPCM_TRLX)
+                                OR_GPCM_TRLX_SET)
 
 #define CONFIG_SYS_MAMR        (MxMR_GPL_x4DIS | \
                         0x0000c000 | \
index 7ae7d58bbd7a6f59fb816af1c283d9e7cd865397..577bbd01c6bdf62af77109928436cd6d8f4a2a8b 100644 (file)
@@ -73,8 +73,8 @@
                                 OR_GPCM_CSNT | \
                                 OR_GPCM_ACS_DIV4 | \
                                 OR_GPCM_SCY_2 | \
-                                (OR_GPCM_TRLX & \
-                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_TRLX_SET | \
+                                OR_GPCM_EHTR_CLEAR | \
                                 OR_GPCM_EAD)
 /*
  * PINC3 on the local bus CS3
 
 #define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_APP2_SIZE) | \
                                 OR_GPCM_CSNT | \
-                                (OR_GPCM_ACS_DIV2 & /* ACS = 11 */\
-                                (~OR_GPCM_XACS)) |  /* XACS = 0 */\
-                                (OR_GPCM_SCY_2 & \
-                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
-                                OR_GPCM_TRLX)
+                                OR_GPCM_ACS_DIV2 | \
+                                OR_GPCM_SCY_2 | \
+                                OR_GPCM_TRLX_SET | \
+                                OR_GPCM_EHTR_CLEAR)
 
 #define CONFIG_SYS_MAMR                (MxMR_GPL_x4DIS | \
                                 0x0000c000 | \
index 815c2602b67c710921d3e91a07d6d6eba3fb0e4e..2d9af3f525f5ad907e27ab594d7325108a08e6ff 100644 (file)
@@ -67,8 +67,8 @@
                                 OR_GPCM_CSNT | \
                                 OR_GPCM_ACS_DIV4 | \
                                 OR_GPCM_SCY_2 | \
-                                (OR_GPCM_TRLX & \
-                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
+                                OR_GPCM_TRLX_SET | \
+                                OR_GPCM_EHTR_CLEAR | \
                                 OR_GPCM_EAD)
 /*
  * PINC2 on the local bus CS3
 
 #define CONFIG_SYS_OR3_PRELIM  (MEG_TO_AM(CONFIG_SYS_PINC2_SIZE) | \
                                 OR_GPCM_CSNT | \
-                                (OR_GPCM_ACS_DIV2 & /* ACS = 11 */ \
-                                (~OR_GPCM_XACS)) |  /* XACS = 0 */ \
-                                (OR_GPCM_SCY_2 & \
-                                (~OR_GPCM_EHTR)) |  /* EHTR = 0 */ \
-                                OR_GPCM_TRLX)
+                                OR_GPCM_ACS_DIV2 | \
+                                OR_GPCM_SCY_2 | \
+                                OR_GPCM_TRLX_SET | \
+                                OR_GPCM_EHTR_CLEAR)
 
 #define CONFIG_SYS_MAMR                (MxMR_GPL_x4DIS | \
                                 0x0000c000 | \
index 69f29c72639d7ae58e2de517e6cde11b1415f5fe..1d458898a877eb58f1d0342688672592b6558dea 100644 (file)
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE      /* buffer up multiple bytes */
 
 #define CONFIG_SYS_NOR_BR_PRELIM       (CONFIG_SYS_FLASH_BASE \
-                                       | (2 << BR_PS_SHIFT)    /* 16 bit */ \
-                                       | BR_V)                 /* valid */
+                                       | BR_PS_16      /* 16 bit */ \
+                                       | BR_MS_GPCM    /* MSEL = GPCM */ \
+                                       | BR_V)         /* valid */
 #define CONFIG_SYS_NOR_OR_PRELIM       (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
                                        | OR_GPCM_CSNT \
                                        | OR_GPCM_ACS_DIV4 \
                                        | OR_GPCM_SCY_5 \
-                                       | OR_GPCM_TRLX \
+                                       | OR_GPCM_TRLX_SET \
                                        | OR_GPCM_EAD)
                                        /* 0xfe000c55 */
 
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000018 /* 32 MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_32MB)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1               /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      256             /* sectors per dev */
                                        | BR_MS_FCM             \
                                        | BR_V) /* valid */
                                        /* 0x61000c21 */
-#define CONFIG_SYS_NAND_OR_PRELIM      (0xffff8000 \
+#define CONFIG_SYS_NAND_OR_PRELIM      (OR_AM_32KB \
                                        | OR_FCM_BCTLD \
                                        | OR_FCM_CHT \
                                        | OR_FCM_SCY_2 \
 #define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
-#define CONFIG_SYS_LBLAWAR1_PRELIM     0x8000000E      /* 32KB  */
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_32KB)
 
 #define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR1_PRELIM
 #define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR1_PRELIM
                                | BR_PS_8 \
                                | BR_V)
                                /* 0x60000801 */
-#define CONFIG_SYS_OR2_PRELIM  (0xfffe0000 \
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_128KB \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_3 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
                                /* 0xfffe0937 */
 /* local bus read write buffer mapping SRAM@0x64000000 */
                                | BR_V)
                                /* 0x62001001 */
 
-#define CONFIG_SYS_OR3_PRELIM  (0xfe000000 \
+#define CONFIG_SYS_OR3_PRELIM  (OR_AM_32MB \
                                | OR_GPCM_CSNT \
                                | OR_GPCM_XACS \
                                | OR_GPCM_SCY_15 \
-                               | OR_GPCM_TRLX \
-                               | OR_GPCM_EHTR \
+                               | OR_GPCM_TRLX_SET \
+                               | OR_GPCM_EHTR_SET \
                                | OR_GPCM_EAD)
                                /* 0xfe0009f7 */
 
index 8e9b1f033678d1f1c66b535e11abdd5353da9189..67a5c892d0404831d4a4276a48fae06cec7292e2 100644 (file)
 #define CONFIG_SYS_FLASH_BASE          0xffc00000      /* start of FLASH   */
 #define CONFIG_SYS_FLASH_SIZE          4               /* flash size in MB */
 #define CONFIG_SYS_BR0_PRELIM          (CONFIG_SYS_FLASH_BASE | \
-                                        (2 << BR_PS_SHIFT) |   /*  16bit */ \
-                                        BR_V)                  /* valid */
-
-#define CONFIG_SYS_OR0_PRELIM          0xffc06ff7      /*   4 MB flash size */
+                                        BR_PS_16 |     /*  16bit */ \
+                                        BR_MS_GPCM |   /*  MSEL = GPCM */ \
+                                        BR_V)          /* valid */
+
+#define CONFIG_SYS_OR0_PRELIM          (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+                                       | OR_GPCM_XAM \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_ACS_DIV2 \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
+                                       /* 0xffc06ff7 */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x80000015      /*   4 MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_4MB)
 #else
 #define CONFIG_SYS_FLASH_BASE          0xf8000000      /* start of FLASH   */
 #define CONFIG_SYS_FLASH_SIZE          128             /* flash size in MB */
 #define CONFIG_SYS_BR0_PRELIM          (CONFIG_SYS_FLASH_BASE | \
-                                        (2 << BR_PS_SHIFT) |   /*  16bit */ \
-                                        BR_V)                  /* valid */
-
-#define CONFIG_SYS_OR0_PRELIM          0xf8006ff7      /* 128 MB flash size */
+                                        BR_PS_16 |     /*  16bit */ \
+                                        BR_MS_GPCM |   /*  MSEL = GPCM */ \
+                                        BR_V)          /* valid */
+
+#define CONFIG_SYS_OR0_PRELIM          (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+                                       | OR_GPCM_XAM \
+                                       | OR_GPCM_CSNT \
+                                       | OR_GPCM_ACS_DIV2 \
+                                       | OR_GPCM_XACS \
+                                       | OR_GPCM_SCY_15 \
+                                       | OR_GPCM_TRLX_SET \
+                                       | OR_GPCM_EHTR_SET \
+                                       | OR_GPCM_EAD)
+                                       /* 0xf8006ff7 */
 #define CONFIG_SYS_LBLAWBAR0_PRELIM    CONFIG_SYS_FLASH_BASE
-#define CONFIG_SYS_LBLAWAR0_PRELIM     0x8000001a      /* 128 MB window size */
+#define CONFIG_SYS_LBLAWAR0_PRELIM     (LBLAWAR_EN | LBLAWAR_128MB)
 #endif
 /* #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
 
-#define CONFIG_SYS_BR1_PRELIM          (0xf0000000 | 0x00001801)
-#define CONFIG_SYS_OR1_PRELIM          (0xfffc0008 | 0x00000200)
-#define CONFIG_SYS_LBLAWBAR1_PRELIM    0xf0000000
-#define CONFIG_SYS_LBLAWAR1_PRELIM     (0x80000000 | 0x00000011)
+#define CONFIG_SYS_WINDOW1_BASE                0xf0000000
+#define CONFIG_SYS_BR1_PRELIM          (CONFIG_SYS_WINDOW1_BASE \
+                                       | BR_PS_32 \
+                                       | BR_MS_GPCM \
+                                       | BR_V)
+                                       /* 0xF0001801 */
+#define CONFIG_SYS_OR1_PRELIM          (OR_AM_256KB \
+                                       | OR_GPCM_SETA)
+                                       /* 0xfffc0208 */
+#define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_WINDOW1_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM     (LBLAWAR_EN | LBLAWAR_256KB)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS     1       /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      1024    /* sectors per device*/