[U-Boot] [PATCH v2 10/58] arm: Move tlb_addr to arch_global_data

Simon Glass
2012-12-14T06:48:39Z

Move this field into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2: None

arch/arm/include/asm/global_data.h | 6 +++---
arch/arm/lib/board.c | 2 +-
arch/arm/lib/cache-cp15.c | 4 ++--
common/cmd_bdinfo.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index 35d07d0..0d1ebfd 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -44,6 +44,9 @@ struct arch_global_data {
#ifdef CONFIG_IXP425
unsigned long timestamp;
#endif
+#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
+ unsigned long tlb_addr;
+#endif
};

/*
@@ -74,9 +77,6 @@ typedef struct global_data {
unsigned long irq_sp; /* irq stack pointer */
unsigned long start_addr_sp; /* start_addr_stackpointer */
unsigned long reloc_off;
-#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
- unsigned long tlb_addr;
-#endif
const void *fdt_blob; /* Our device tree, NULL if none */
void **jt; /* jump table */
char env_buf[32]; /* buffer for getenv() before reloc. */
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 22a4d9c..637fb01 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -358,7 +358,7 @@ void board_init_f(ulong bootflag)
/* round down to next 64 kB limit */
addr &= ~(0x10000 - 1);

- gd->tlb_addr = addr;
+ gd->arch.tlb_addr = addr;
debug("TLB table at: %08lx\n", addr);
#endif

diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index 939de10..5df6735 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -52,7 +52,7 @@ static void cp_delay (void)

static inline void dram_bank_mmu_setup(int bank)
{
- u32 *page_table = (u32 *)gd->tlb_addr;
+ u32 *page_table = (u32 *)gd->arch.tlb_addr;
bd_t *bd = gd->bd;
int i;

@@ -67,7 +67,7 @@ static inline void dram_bank_mmu_setup(int bank)
/* to activate the MMU we need to set up virtual memory: use 1M areas */
static inline void mmu_setup(void)
{
- u32 *page_table = (u32 *)gd->tlb_addr;
+ u32 *page_table = (u32 *)gd->arch.tlb_addr;
int i;
u32 reg;

diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 48cdd16..82a3693 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -371,7 +371,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif
printf("baudrate = %u bps\n", bd->bi_baudrate);
#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
- print_num("TLB addr", gd->tlb_addr);
+ print_num("TLB addr", gd->arch.tlb_addr);
#endif
print_num("relocaddr", gd->relocaddr);
print_num("reloc off", gd->reloc_off);
--
1.7.7.3