]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
am33xx: remove global variable gpmc_cfg
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 24 Jun 2013 09:44:57 +0000 (11:44 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 24 Jun 2013 09:44:57 +0000 (11:44 +0200)
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.

arch/arm/cpu/armv7/am33xx/mem.c
arch/arm/include/asm/arch-am33xx/cpu.h
drivers/mtd/nand/am33xx_nand.c

index b8f54abae2f99ada121803785939b8ecae5a0a56..ab5d69dcc6e0c4cb6151a387ca95b22b970d6ec7 100644 (file)
@@ -33,8 +33,6 @@
 #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,
@@ -73,8 +71,7 @@ void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
 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;
index 5b10826ef7f07ec6d5144d19beb89a857366e5f2..ec28b30a57ab2762902327fa8c692bb8f9f96150 100644 (file)
@@ -108,9 +108,6 @@ struct gpmc {
        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 */
index 8c5545b7ac169178691c4b485c83fbd176601227..4a7433181643e172be8157527bea71cd4ff06000 100644 (file)
@@ -57,6 +57,8 @@ static struct nand_ecclayout hw_bch16_nand_oob = GPMC_NAND_HW_BCH16_ECC_LAYOUT;
 #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,