ARM omap: Make gpmc base runtime configurable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
f42ee5fd40
commit
e412cb7805
|
@ -46,7 +46,7 @@ int omap_add_gpmc_nand_device(struct gpmc_nand_platform_data *pdata)
|
||||||
/* Configure GPMC CS before register */
|
/* Configure GPMC CS before register */
|
||||||
gpmc_cs_config(pdata->cs, pdata->nand_cfg);
|
gpmc_cs_config(pdata->cs, pdata->nand_cfg);
|
||||||
|
|
||||||
add_generic_device("gpmc_nand", DEVICE_ID_DYNAMIC, NULL, OMAP_GPMC_BASE,
|
add_generic_device("gpmc_nand", DEVICE_ID_DYNAMIC, NULL, (resource_size_t)omap_gpmc_base,
|
||||||
1024 * 4, IORESOURCE_MEM, pdata);
|
1024 * 4, IORESOURCE_MEM, pdata);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -29,6 +29,16 @@
|
||||||
#include <mach/sys_info.h>
|
#include <mach/sys_info.h>
|
||||||
#include <mach/syslib.h>
|
#include <mach/syslib.h>
|
||||||
|
|
||||||
|
void __iomem *omap_gpmc_base;
|
||||||
|
|
||||||
|
static int gpmc_init(void)
|
||||||
|
{
|
||||||
|
omap_gpmc_base = (void *)OMAP_GPMC_BASE;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
pure_initcall(gpmc_init);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Do a Generic initialization of GPMC. if you choose otherwise,
|
* @brief Do a Generic initialization of GPMC. if you choose otherwise,
|
||||||
* Use gpmc registers to modify the values. The defaults configured are:
|
* Use gpmc registers to modify the values. The defaults configured are:
|
||||||
|
@ -43,7 +53,7 @@
|
||||||
void gpmc_generic_init(unsigned int cfg)
|
void gpmc_generic_init(unsigned int cfg)
|
||||||
{
|
{
|
||||||
uint64_t start;
|
uint64_t start;
|
||||||
unsigned int reg = GPMC_REG(CONFIG7_0);
|
void __iomem *reg = GPMC_REG(CONFIG7_0);
|
||||||
char x = 0;
|
char x = 0;
|
||||||
|
|
||||||
debug("gpmccfg=0x%x\n", cfg);
|
debug("gpmccfg=0x%x\n", cfg);
|
||||||
|
@ -89,7 +99,7 @@ EXPORT_SYMBOL(gpmc_generic_init);
|
||||||
*/
|
*/
|
||||||
void gpmc_cs_config(char cs, struct gpmc_config *config)
|
void gpmc_cs_config(char cs, struct gpmc_config *config)
|
||||||
{
|
{
|
||||||
unsigned int reg = GPMC_REG(CONFIG1_0) + (cs * GPMC_CONFIG_CS_SIZE);
|
void __iomem *reg = GPMC_REG(CONFIG1_0) + (cs * GPMC_CONFIG_CS_SIZE);
|
||||||
unsigned char x = 0;
|
unsigned char x = 0;
|
||||||
debug("gpmccs=0x%x cfg=0x%p\n", cs, config);
|
debug("gpmccs=0x%x cfg=0x%p\n", cs, config);
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,10 @@
|
||||||
#ifndef __ASM_ARCH_OMAP_GPMC_H
|
#ifndef __ASM_ARCH_OMAP_GPMC_H
|
||||||
#define __ASM_ARCH_OMAP_GPMC_H
|
#define __ASM_ARCH_OMAP_GPMC_H
|
||||||
|
|
||||||
|
extern void __iomem *omap_gpmc_base;
|
||||||
|
|
||||||
/** GPMC Reg Wrapper */
|
/** GPMC Reg Wrapper */
|
||||||
#define GPMC_REG(REGNAME) (OMAP_GPMC_BASE + GPMC_##REGNAME)
|
#define GPMC_REG(REGNAME) (omap_gpmc_base + GPMC_##REGNAME)
|
||||||
|
|
||||||
#define GPMC_SYS_CONFIG (0x10)
|
#define GPMC_SYS_CONFIG (0x10)
|
||||||
#define GPMC_SYS_STATUS (0x14)
|
#define GPMC_SYS_STATUS (0x14)
|
||||||
|
|
Loading…
Reference in New Issue