SPL and regular code use different addresses for global variables.
Thus the initial value from SPL code is not available in regular code.
Make the variable local to each file where it is used.
#include <asm/arch/sys_proto.h>
#include <command.h>
-struct gpmc *gpmc_cfg;
-
#if defined(CONFIG_CMD_NAND)
static const u32 gpmc_m_nand[GPMC_MAX_REG] = {
M_NAND_GPMC_CONFIG1,
void gpmc_init(void)
{
/* putting a blanket check on GPMC based on ZeBu for now */
- gpmc_cfg = (struct gpmc *)GPMC_BASE;
-
+ struct gpmc *gpmc_cfg = (struct gpmc *)GPMC_BASE;
#ifdef CONFIG_CMD_NAND
const u32 *gpmc_config = NULL;
u32 base = 0;
struct bch_res_0_3 bch_result_0_3[2]; /* 0x240 */
};
-/* Used for board specific gpmc initialization */
-extern struct gpmc *gpmc_cfg;
-
/* Encapsulating core pll registers */
struct cm_wkuppll {
unsigned int wkclkstctrl; /* offset 0x00 */
#endif
static struct nand_ecclayout hw_bch8_nand_oob = GPMC_NAND_HW_BCH8_ECC_LAYOUT;
+static struct gpmc *gpmc_cfg = (struct gpmc *)GPMC_BASE;
+
static struct nand_bch_priv bch_priv = {
.type = ECC_BCH8,
.nibbles = ECC_BCH8_NIBBLES,