summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Delien <robert@delien.nl>2012-02-07 04:08:56 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-03-26 23:09:23 +0200
commit1e94d07faf871ebe0fdd06de0b14dc048c742913 (patch)
treed467884caa2ccf8baefc91391ca80193664d01e9
parentc67d9c5e58d4eb3a23a3ed435a33102adcec8c15 (diff)
downloadu-boot-imx-1e94d07faf871ebe0fdd06de0b14dc048c742913.zip
u-boot-imx-1e94d07faf871ebe0fdd06de0b14dc048c742913.tar.gz
u-boot-imx-1e94d07faf871ebe0fdd06de0b14dc048c742913.tar.bz2
i.mx28: Replaced magic numbers for scratch register addresses with register definitions
This patch replaces the use of magice numbers for scratch register addresses with earlier defined register definitions. Signed-off-by: Robert Delien <robert@delien.nl>
-rw-r--r--arch/arm/cpu/arm926ejs/mx28/mx28.c8
-rw-r--r--arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c b/arch/arm/cpu/arm926ejs/mx28/mx28.c
index 683777f..b235091 100644
--- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
+++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
@@ -261,14 +261,14 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
}
#endif
-#define HW_DIGCTRL_SCRATCH0 0x8001c280
-#define HW_DIGCTRL_SCRATCH1 0x8001c290
int mx28_dram_init(void)
{
+ struct mx28_digctl_regs *digctl_regs =
+ (struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
uint32_t sz[2];
- sz[0] = readl(HW_DIGCTRL_SCRATCH0);
- sz[1] = readl(HW_DIGCTRL_SCRATCH1);
+ sz[0] = readl(&digctl_regs->hw_digctl_scratch0);
+ sz[1] = readl(&digctl_regs->hw_digctl_scratch1);
if (sz[0] != sz[1]) {
printf("MX28:\n"
diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
index 00493b8..db67011 100644
--- a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
+++ b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
@@ -165,8 +165,6 @@ void mx28_mem_setup_vddd(void)
&power_regs->hw_power_vdddctrl);
}
-#define HW_DIGCTRL_SCRATCH0 0x8001c280
-#define HW_DIGCTRL_SCRATCH1 0x8001c290
void data_abort_memdetect_handler(void) __attribute__((naked));
void data_abort_memdetect_handler(void)
{
@@ -175,6 +173,8 @@ void data_abort_memdetect_handler(void)
void mx28_mem_get_size(void)
{
+ struct mx28_digctl_regs *digctl_regs =
+ (struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
uint32_t sz, da;
uint32_t *vt = (uint32_t *)0x20;
@@ -183,8 +183,8 @@ void mx28_mem_get_size(void)
vt[4] = (uint32_t)&data_abort_memdetect_handler;
sz = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
- writel(sz, HW_DIGCTRL_SCRATCH0);
- writel(sz, HW_DIGCTRL_SCRATCH1);
+ writel(sz, &digctl_regs->hw_digctl_scratch0);
+ writel(sz, &digctl_regs->hw_digctl_scratch1);
/* Restore the old DABT handler. */
vt[4] = da;