armv7: nuke global_data.h and remove some references to gd struct
This begins to remove references to global data which u-boot used. There are still many commented out references to gd-> and bd-> which we'll fix once we're happy with the replacements. Change-Id: Ie1b40a997e28a118f8f3ad96a2f9a2462d32fbe3 Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: http://review.coreboot.org/2210 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
4a484203d0
commit
1fb9bfa0f9
|
@ -83,7 +83,6 @@ void __assert_fail(const char *assertion, const char *file, unsigned line,
|
||||||
typedef void (interrupt_handler_t)(void *);
|
typedef void (interrupt_handler_t)(void *);
|
||||||
|
|
||||||
//#include <asm/u-boot.h> /* boot information for Linux kernel */
|
//#include <asm/u-boot.h> /* boot information for Linux kernel */
|
||||||
#include <global_data.h> /* global data used for startup functions */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the time since boot in microseconds, This is needed for bootstage
|
* Return the time since boot in microseconds, This is needed for bootstage
|
||||||
|
@ -152,7 +151,6 @@ void reset_cmd_timeout(void);
|
||||||
|
|
||||||
/* arch/$(ARCH)/lib/board.c */
|
/* arch/$(ARCH)/lib/board.c */
|
||||||
void board_init_f (void);
|
void board_init_f (void);
|
||||||
void board_init_r (gd_t *, ulong) __attribute__ ((noreturn));
|
|
||||||
int checkboard (void);
|
int checkboard (void);
|
||||||
int checkflash (void);
|
int checkflash (void);
|
||||||
int checkdram (void);
|
int checkdram (void);
|
||||||
|
@ -247,7 +245,6 @@ int dcache_status (void);
|
||||||
void dcache_enable (void);
|
void dcache_enable (void);
|
||||||
void dcache_disable(void);
|
void dcache_disable(void);
|
||||||
void mmu_disable(void);
|
void mmu_disable(void);
|
||||||
void relocate_code (ulong, gd_t *, ulong) __attribute__ ((noreturn));
|
|
||||||
ulong get_endaddr (void);
|
ulong get_endaddr (void);
|
||||||
void trap_init (ulong);
|
void trap_init (ulong);
|
||||||
#if defined (CONFIG_4xx) || \
|
#if defined (CONFIG_4xx) || \
|
||||||
|
|
|
@ -1,108 +0,0 @@
|
||||||
/*
|
|
||||||
* (C) Copyright 2002-2010
|
|
||||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
||||||
*
|
|
||||||
* See file CREDITS for list of people who contributed to this
|
|
||||||
* project.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ASM_GBL_DATA_H
|
|
||||||
#define __ASM_GBL_DATA_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following data structure is placed in some memory which is
|
|
||||||
* available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
|
|
||||||
* some locked parts of the data cache) to allow for a minimum set of
|
|
||||||
* global variables during system initialization (until we have set
|
|
||||||
* up the memory controller so that we can use RAM).
|
|
||||||
*
|
|
||||||
* Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t)
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct global_data {
|
|
||||||
// bd_t *bd;
|
|
||||||
unsigned long flags;
|
|
||||||
unsigned long baudrate;
|
|
||||||
unsigned long have_console; /* serial_init() was called */
|
|
||||||
#ifdef CONFIG_PRE_CONSOLE_BUFFER
|
|
||||||
unsigned long precon_buf_idx; /* Pre-Console buffer index */
|
|
||||||
#endif
|
|
||||||
unsigned long env_addr; /* Address of Environment struct */
|
|
||||||
unsigned long env_valid; /* Checksum of Environment valid? */
|
|
||||||
unsigned long fb_base; /* base address of frame buffer */
|
|
||||||
#ifdef CONFIG_FSL_ESDHC
|
|
||||||
unsigned long sdhc_clk;
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_AT91FAMILY
|
|
||||||
/* "static data" needed by at91's clock.c */
|
|
||||||
unsigned long cpu_clk_rate_hz;
|
|
||||||
unsigned long main_clk_rate_hz;
|
|
||||||
unsigned long mck_rate_hz;
|
|
||||||
unsigned long plla_rate_hz;
|
|
||||||
unsigned long pllb_rate_hz;
|
|
||||||
unsigned long at91_pllb_usb_init;
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_ARM
|
|
||||||
/* "static data" needed by most of timer.c on ARM platforms */
|
|
||||||
unsigned long timer_rate_hz;
|
|
||||||
unsigned long tbl;
|
|
||||||
unsigned long tbu;
|
|
||||||
unsigned long long timer_reset_value;
|
|
||||||
unsigned long lastinc;
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_IXP425
|
|
||||||
unsigned long timestamp;
|
|
||||||
#endif
|
|
||||||
unsigned long relocaddr; /* Start address of U-Boot in RAM */
|
|
||||||
unsigned long long ram_size; /* RAM size */
|
|
||||||
unsigned long mon_len; /* monitor len */
|
|
||||||
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;
|
|
||||||
unsigned long tlb_size;
|
|
||||||
#endif
|
|
||||||
const void *fdt_blob; /* Our device tree, NULL if none */
|
|
||||||
#ifdef CONFIG_SYS_SKIP_ARM_RELOCATION
|
|
||||||
ulong malloc_end; /* End of malloc region (addr + 1) */
|
|
||||||
#endif
|
|
||||||
void **jt; /* jump table */
|
|
||||||
char env_buf[32]; /* buffer for getenv() before reloc. */
|
|
||||||
#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
|
|
||||||
unsigned long post_log_word; /* Record POST activities */
|
|
||||||
unsigned long post_log_res; /* success of POST test */
|
|
||||||
unsigned long post_init_f_time; /* When post_init_f started */
|
|
||||||
#endif
|
|
||||||
} gd_t;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Global Data Flags
|
|
||||||
*/
|
|
||||||
#define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */
|
|
||||||
#define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
|
|
||||||
#define GD_FLG_SILENT 0x00004 /* Silent mode */
|
|
||||||
#define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */
|
|
||||||
#define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */
|
|
||||||
#define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
|
|
||||||
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
|
|
||||||
#define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
|
|
||||||
|
|
||||||
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
|
|
||||||
|
|
||||||
#endif /* __ASM_GBL_DATA_H */
|
|
|
@ -24,9 +24,8 @@
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <system.h>
|
#include <system.h>
|
||||||
#include <global_data.h>
|
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
static unsigned int tlb_addr;
|
||||||
|
|
||||||
static void cp_delay (void)
|
static void cp_delay (void)
|
||||||
{
|
{
|
||||||
|
@ -41,9 +40,7 @@ static void cp_delay (void)
|
||||||
static void set_section_dcache(int section, enum dcache_option option)
|
static void set_section_dcache(int section, enum dcache_option option)
|
||||||
{
|
{
|
||||||
u32 value = section << MMU_SECTION_SHIFT | (3 << 10);
|
u32 value = section << MMU_SECTION_SHIFT | (3 << 10);
|
||||||
// u32 *page_table = (u32 *)gd->tlb_addr;
|
|
||||||
u32 *page_table;
|
u32 *page_table;
|
||||||
unsigned int tlb_addr;
|
|
||||||
unsigned int tlb_size = 4096 * 4;
|
unsigned int tlb_size = 4096 * 4;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -82,7 +79,7 @@ void __mmu_page_table_flush(unsigned long start, unsigned long stop)
|
||||||
|
|
||||||
void mmu_set_region_dcache(unsigned long start, int size, enum dcache_option option)
|
void mmu_set_region_dcache(unsigned long start, int size, enum dcache_option option)
|
||||||
{
|
{
|
||||||
u32 *page_table = (u32 *)gd->tlb_addr;
|
u32 *page_table = &tlb_addr;
|
||||||
u32 upto, end;
|
u32 upto, end;
|
||||||
|
|
||||||
end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT;
|
end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT;
|
||||||
|
@ -113,8 +110,6 @@ static inline void dram_bank_mmu_setup(int bank)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME(dhendrix): modified to take arguments from the caller (mainboard's
|
|
||||||
romstage.c) so it doesn't rely on global data struct */
|
|
||||||
/**
|
/**
|
||||||
* dram_bank_mmu_set - set up the data cache policy for a given dram bank
|
* dram_bank_mmu_set - set up the data cache policy for a given dram bank
|
||||||
*
|
*
|
||||||
|
@ -163,7 +158,7 @@ static inline void mmu_setup(void)
|
||||||
|
|
||||||
/* Copy the page table address to cp15 */
|
/* Copy the page table address to cp15 */
|
||||||
asm volatile("mcr p15, 0, %0, c2, c0, 0"
|
asm volatile("mcr p15, 0, %0, c2, c0, 0"
|
||||||
: : "r" (gd->tlb_addr) : "memory");
|
: : "r" (tlb_addr) : "memory");
|
||||||
/* Set the access control to all-supervisor */
|
/* Set the access control to all-supervisor */
|
||||||
asm volatile("mcr p15, 0, %0, c3, c0, 0"
|
asm volatile("mcr p15, 0, %0, c3, c0, 0"
|
||||||
: : "r" (~0));
|
: : "r" (~0));
|
||||||
|
|
|
@ -55,9 +55,6 @@
|
||||||
|
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
|
|
||||||
/* FIXME(dhendrix): clean out u-boot global data stuff */
|
|
||||||
//DECLARE_GLOBAL_DATA_PTR;
|
|
||||||
|
|
||||||
#define OM_STAT (0x1f << 1)
|
#define OM_STAT (0x1f << 1)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -344,15 +341,6 @@ void board_init_f(void)
|
||||||
hlt();
|
hlt();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Place Holders */
|
|
||||||
void board_init_r(gd_t *id, ulong dest_addr)
|
|
||||||
{
|
|
||||||
/* Function attribute is no-return */
|
|
||||||
/* This Function never executes */
|
|
||||||
while (1)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
//void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
|
//void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in New Issue