diff options
author | David Hendricks <dhendrix@chromium.org> | 2013-01-28 12:24:54 -0800 |
---|---|---|
committer | David Hendricks <dhendrix@chromium.org> | 2013-01-29 00:02:53 +0100 |
commit | 1fb9bfa0f90c73c73bf0b9b7d9d5a2af6d7fe530 (patch) | |
tree | 16521e78bbd6b5721ee33b8392356f4c78853385 | |
parent | 4a484203d011c6fb3dd6f0edb2fadb3f2b07220c (diff) |
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>
-rw-r--r-- | src/arch/armv7/include/common.h | 3 | ||||
-rw-r--r-- | src/arch/armv7/include/global_data.h | 108 | ||||
-rw-r--r-- | src/arch/armv7/lib/cache-cp15.c | 11 | ||||
-rw-r--r-- | src/cpu/samsung/exynos5-common/spl_boot.c | 12 |
4 files changed, 3 insertions, 131 deletions
diff --git a/src/arch/armv7/include/common.h b/src/arch/armv7/include/common.h index a2cd9ae44b..5a27fc0dec 100644 --- a/src/arch/armv7/include/common.h +++ b/src/arch/armv7/include/common.h @@ -83,7 +83,6 @@ void __assert_fail(const char *assertion, const char *file, unsigned line, typedef void (interrupt_handler_t)(void *); //#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 @@ -152,7 +151,6 @@ void reset_cmd_timeout(void); /* arch/$(ARCH)/lib/board.c */ void board_init_f (void); -void board_init_r (gd_t *, ulong) __attribute__ ((noreturn)); int checkboard (void); int checkflash (void); int checkdram (void); @@ -247,7 +245,6 @@ int dcache_status (void); void dcache_enable (void); void dcache_disable(void); void mmu_disable(void); -void relocate_code (ulong, gd_t *, ulong) __attribute__ ((noreturn)); ulong get_endaddr (void); void trap_init (ulong); #if defined (CONFIG_4xx) || \ diff --git a/src/arch/armv7/include/global_data.h b/src/arch/armv7/include/global_data.h deleted file mode 100644 index 4ae86aa0e6..0000000000 --- a/src/arch/armv7/include/global_data.h +++ /dev/null @@ -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 */ diff --git a/src/arch/armv7/lib/cache-cp15.c b/src/arch/armv7/lib/cache-cp15.c index c684d65dfd..221befa952 100644 --- a/src/arch/armv7/lib/cache-cp15.c +++ b/src/arch/armv7/lib/cache-cp15.c @@ -24,9 +24,8 @@ #include <common.h> #include <stdlib.h> #include <system.h> -#include <global_data.h> -DECLARE_GLOBAL_DATA_PTR; +static unsigned int tlb_addr; 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) { u32 value = section << MMU_SECTION_SHIFT | (3 << 10); -// u32 *page_table = (u32 *)gd->tlb_addr; u32 *page_table; - unsigned int tlb_addr; 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) { - u32 *page_table = (u32 *)gd->tlb_addr; + u32 *page_table = &tlb_addr; u32 upto, end; end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT; @@ -113,8 +110,6 @@ static inline void dram_bank_mmu_setup(int bank) } #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 * @@ -163,7 +158,7 @@ static inline void mmu_setup(void) /* Copy the page table address to cp15 */ 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 */ asm volatile("mcr p15, 0, %0, c3, c0, 0" : : "r" (~0)); diff --git a/src/cpu/samsung/exynos5-common/spl_boot.c b/src/cpu/samsung/exynos5-common/spl_boot.c index ecff87131e..ddf69372ef 100644 --- a/src/cpu/samsung/exynos5-common/spl_boot.c +++ b/src/cpu/samsung/exynos5-common/spl_boot.c @@ -55,9 +55,6 @@ #include <arch/io.h> -/* FIXME(dhendrix): clean out u-boot global data stuff */ -//DECLARE_GLOBAL_DATA_PTR; - #define OM_STAT (0x1f << 1) /** @@ -344,15 +341,6 @@ void board_init_f(void) 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) {} #if 0 |