summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2016-07-12 20:28:16 +0200
committerTom Rini <trini@konsulko.com>2016-07-22 14:46:00 -0400
commit0568dd0663429b00fb77c452e27434c2f4faa14b (patch)
treee52c5496dc78faaa9126433f3b233416e7baf55a
parentb1509e3a4aa55b003e814386dd83972858544e55 (diff)
downloadu-boot-imx-0568dd0663429b00fb77c452e27434c2f4faa14b.zip
u-boot-imx-0568dd0663429b00fb77c452e27434c2f4faa14b.tar.gz
u-boot-imx-0568dd0663429b00fb77c452e27434c2f4faa14b.tar.bz2
armv7: make gpmc_cfg const
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> [trini: Adapt am33xx, duovero, omap_zoom1] Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--arch/arm/cpu/armv7/omap-common/mem-common.c8
-rw-r--r--arch/arm/include/asm/arch-am33xx/sys_proto.h3
-rw-r--r--arch/arm/include/asm/arch-omap3/sys_proto.h4
-rw-r--r--board/gumstix/duovero/duovero.c2
-rw-r--r--board/logicpd/zoom1/zoom1.c9
-rw-r--r--drivers/mtd/nand/omap_gpmc.c3
-rw-r--r--include/linux/mtd/omap_gpmc.h2
7 files changed, 15 insertions, 16 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/mem-common.c b/arch/arm/cpu/armv7/omap-common/mem-common.c
index fc4290c..136a032 100644
--- a/arch/arm/cpu/armv7/omap-common/mem-common.c
+++ b/arch/arm/cpu/armv7/omap-common/mem-common.c
@@ -21,7 +21,7 @@
#include <command.h>
#include <linux/mtd/omap_gpmc.h>
-struct gpmc *gpmc_cfg;
+const struct gpmc *gpmc_cfg = (struct gpmc *)GPMC_BASE;
#if defined(CONFIG_OMAP34XX)
/********************************************************
@@ -50,8 +50,8 @@ u32 mem_ok(u32 cs)
}
#endif
-void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
- u32 size)
+void enable_gpmc_cs_config(const u32 *gpmc_config, const struct gpmc_cs *cs,
+ u32 base, u32 size)
{
writel(0, &cs->config7);
sdelay(1000);
@@ -75,8 +75,6 @@ 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;
#if defined(CONFIG_NOR)
/* configure GPMC for NOR */
const u32 gpmc_regs[GPMC_MAX_REG] = { STNOR_GPMC_CONFIG1,
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index 8f573d2..ed1a46c 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -25,9 +25,8 @@ void ddr_pll_config(unsigned int ddrpll_M);
void sdelay(unsigned long);
-struct gpmc_cs;
void gpmc_init(void);
-void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
+void enable_gpmc_cs_config(const u32 *gpmc_config, const struct gpmc_cs *cs, u32 base,
u32 size);
void omap_nand_switch_ecc(uint32_t, uint32_t);
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 1be2b15..4c5aa99 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -43,8 +43,8 @@ void get_board_mem_timings(struct board_sdrc_timings *timings);
int identify_nand_chip(int *mfr, int *id);
void emif4_init(void);
void gpmc_init(void);
-void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base,
- u32 size);
+void enable_gpmc_cs_config(const u32 *gpmc_config, const struct gpmc_cs *cs,
+ u32 base, u32 size);
void watchdog_init(void);
void set_muxconf_regs(void);
diff --git a/board/gumstix/duovero/duovero.c b/board/gumstix/duovero/duovero.c
index 9671c5a..3786842 100644
--- a/board/gumstix/duovero/duovero.c
+++ b/board/gumstix/duovero/duovero.c
@@ -128,7 +128,7 @@ void board_mmc_power_init(void)
#define GPMC_BASEADDR_MASK 0x3F
#define GPMC_CS_ENABLE 0x1
-static void enable_gpmc_net_config(const u32 *gpmc_config, struct gpmc_cs *cs,
+static void enable_gpmc_net_config(const u32 *gpmc_config, const struct gpmc_cs *cs,
u32 base, u32 size)
{
writel(0, &cs->config7);
diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c
index 982619c..2821ee2 100644
--- a/board/logicpd/zoom1/zoom1.c
+++ b/board/logicpd/zoom1/zoom1.c
@@ -19,6 +19,7 @@
#include <ns16550.h>
#include <netdev.h>
#include <twl4030.h>
+#include <linux/mtd/omap_gpmc.h>
#include <asm/io.h>
#include <asm/arch/mem.h>
#include <asm/arch/mmc_host_def.h>
@@ -29,10 +30,10 @@
DECLARE_GLOBAL_DATA_PTR;
-/* gpmc_cfg is initialized by gpmc_init and we use it here */
-extern struct gpmc *gpmc_cfg;
-
-/* GPMC definitions for Ethenet Controller LAN9211 */
+/*
+ * gpmc_cfg is initialized by gpmc_init and we use it here.
+ * GPMC definitions for Ethenet Controller LAN9211
+ */
static const u32 gpmc_lab_enet[] = {
ZOOM1_ENET_GPMC_CONF1,
ZOOM1_ENET_GPMC_CONF2,
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 67f293d..6e201d6 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -264,7 +264,8 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const uint8_t *dat,
{
struct nand_chip *chip = mtd_to_nand(mtd);
struct omap_nand_info *info = nand_get_controller_data(chip);
- uint32_t *ptr, val = 0;
+ const uint32_t *ptr;
+ uint32_t val = 0;
int8_t i = 0, j;
switch (info->ecc_scheme) {
diff --git a/include/linux/mtd/omap_gpmc.h b/include/linux/mtd/omap_gpmc.h
index 3a75674..f49ea3d 100644
--- a/include/linux/mtd/omap_gpmc.h
+++ b/include/linux/mtd/omap_gpmc.h
@@ -92,6 +92,6 @@ struct gpmc {
};
/* Used for board specific gpmc initialization */
-extern struct gpmc *gpmc_cfg;
+extern const struct gpmc *gpmc_cfg;
#endif /* __ASM_OMAP_GPMC_H */