9
0
Fork 0

svn_rev_152

remove global data gd_t and board info bd_t entirely for arm
This commit is contained in:
Sascha Hauer 2007-07-05 18:01:28 +02:00 committed by Sascha Hauer
parent a21d0bc4c2
commit a8421600d1
8 changed files with 56 additions and 64 deletions

View File

@ -40,18 +40,18 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
defined (CONFIG_REVISION_TAG) || \
defined (CONFIG_VFD) || \
defined (CONFIG_LCD)
static void setup_start_tag (bd_t *bd);
static void setup_start_tag (void);
# ifdef CONFIG_SETUP_MEMORY_TAGS
static void setup_memory_tags (bd_t *bd);
static void setup_memory_tags (void);
# endif
static void setup_commandline_tag (bd_t *bd, char *commandline);
static void setup_commandline_tag (char *commandline);
# ifdef CONFIG_INITRD_TAG
static void setup_initrd_tag (bd_t *bd, ulong initrd_start,
static void setup_initrd_tag (ulong initrd_start,
ulong initrd_end);
# endif
static void setup_end_tag (bd_t *bd);
static void setup_end_tag (void);
# if defined (CONFIG_VFD) || defined (CONFIG_LCD)
static void setup_videolfb_tag (gd_t *gd);
@ -79,7 +79,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
ulong data;
void (*theKernel)(int zero, int arch, uint params);
image_header_t *hdr = &header;
bd_t *bd = gd->bd;
#ifdef CONFIG_CMDLINE_TAG
char *commandline = getenv ("bootargs");
@ -214,7 +213,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
defined (CONFIG_REVISION_TAG) || \
defined (CONFIG_LCD) || \
defined (CONFIG_VFD)
setup_start_tag (bd);
setup_start_tag ();
#ifdef CONFIG_SERIAL_TAG
setup_serial_tag (&params);
#endif
@ -222,19 +221,19 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
setup_revision_tag (&params);
#endif
#ifdef CONFIG_SETUP_MEMORY_TAGS
setup_memory_tags (bd);
setup_memory_tags ();
#endif
#ifdef CONFIG_CMDLINE_TAG
setup_commandline_tag (bd, commandline);
setup_commandline_tag (commandline);
#endif
#ifdef CONFIG_INITRD_TAG
if (initrd_start && initrd_end)
setup_initrd_tag (bd, initrd_start, initrd_end);
setup_initrd_tag (initrd_start, initrd_end);
#endif
#if defined (CONFIG_VFD) || defined (CONFIG_LCD)
setup_videolfb_tag ((gd_t *) gd);
#endif
setup_end_tag (bd);
setup_end_tag ();
#endif
/* we assume that the kernel is in place */
@ -260,9 +259,9 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
defined (CONFIG_REVISION_TAG) || \
defined (CONFIG_LCD) || \
defined (CONFIG_VFD)
static void setup_start_tag (bd_t *bd)
static void setup_start_tag (void)
{
params = (struct tag *) bd->bi_boot_params;
params = (struct tag *) CONFIG_BOOT_PARAMS;
params->hdr.tag = ATAG_CORE;
params->hdr.size = tag_size (tag_core);
@ -276,7 +275,7 @@ static void setup_start_tag (bd_t *bd)
#ifdef CONFIG_SETUP_MEMORY_TAGS
static void setup_memory_tags (bd_t *bd)
static void setup_memory_tags (void)
{
struct device_d *dev = NULL;
@ -298,7 +297,7 @@ static void setup_memory_tags (bd_t *bd)
#endif /* CONFIG_SETUP_MEMORY_TAGS */
static void setup_commandline_tag (bd_t *bd, char *commandline)
static void setup_commandline_tag (char *commandline)
{
char *p;
@ -325,7 +324,7 @@ static void setup_commandline_tag (bd_t *bd, char *commandline)
#ifdef CONFIG_INITRD_TAG
static void setup_initrd_tag (bd_t *bd, ulong initrd_start, ulong initrd_end)
static void setup_initrd_tag (ulong initrd_start, ulong initrd_end)
{
/* an ATAG_INITRD node tells the kernel where the compressed
* ramdisk can be found. ATAG_RDIMG is a better name, actually.
@ -396,7 +395,7 @@ void setup_revision_tag(struct tag **in_params)
#endif /* CONFIG_REVISION_TAG */
static void setup_end_tag (bd_t *bd)
static void setup_end_tag (void)
{
params->hdr.tag = ATAG_NONE;
params->hdr.size = 0;

View File

@ -147,15 +147,9 @@ void start_armboot (void)
int result;
int i = 'a';
/* Pointer is writable since we allocated a register for it */
gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t));
/* compiler optimization barrier needed for GCC >= 3.4 */
__asm__ __volatile__("": : :"memory");
memset ((void*)gd, 0, sizeof (gd_t));
gd->bd = (bd_t*)((char*)gd - sizeof(bd_t));
memset (gd->bd, 0, sizeof (bd_t));
monitor_flash_len = _bss_start - _armboot_start;
/* armboot_start is defined in the board-specific linker script */
@ -170,8 +164,6 @@ void start_armboot (void)
display_banner();
jumptable_init ();
/* enable exceptions */
enable_interrupts ();

View File

@ -1024,7 +1024,11 @@ do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
* r5: console device
* r6: boot args string
*/
#if 0
(*loader) (gd->bd, img_addr, consdev, cmdline);
#else
#warning NetBSD Support is broken
#endif
}
#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
@ -1484,8 +1488,11 @@ do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
* RTEMS Parameters:
* r3: ptr to board info data
*/
#if 0
(*entry_point ) ( gd->bd );
#else
#warning RTEMS support is broken
#endif
}
#if (CONFIG_COMMANDS & CFG_CMD_ELF)

View File

@ -549,13 +549,16 @@ static mbinptr av_[NAV * 2 + 2] = {
void malloc_bin_reloc (void)
{
#ifdef CONFIG_ARM
return;
#else
unsigned long *p = (unsigned long *)(&av_[2]);
int i;
for (i=2; i<(sizeof(av_)/sizeof(mbinptr)); ++i) {
*p++ += gd->reloc_off;
}
#endif
}
/* field-extraction macros */

View File

@ -1,8 +1,11 @@
#include <common.h>
#include <driver.h>
#include <init.h>
#include <exports.h>
DECLARE_GLOBAL_DATA_PTR;
#if 0
static void dummy(void)
{
}
@ -12,7 +15,13 @@ unsigned long get_version(void)
return XF_VERSION;
}
void jumptable_init (void)
/*
* FIXME: instead of using the global data struct for standalone
* programs, just use a register to pass the jumptable.
* For now, this is broken.
*/
int jumptable_init (void)
{
int i;
@ -36,4 +45,11 @@ void jumptable_init (void)
gd->jt[XF_i2c_write] = (void *) i2c_write;
gd->jt[XF_i2c_read] = (void *) i2c_read;
#endif /* CFG_CMD_I2C */
return 0;
}
late_initcall(jumptable_init);
#endif

View File

@ -3228,9 +3228,17 @@ static void u_boot_hush_reloc(void)
{
unsigned long addr;
struct reserved_combo *r;
unsigned long reloc_off;
#if 0
reloc_off = gd->reloc_off;
#else
reloc_off = 0;
#warning FIXME: This is broken on !ARM
#endif
for (r=reserved_list; r<reserved_list+NRES; r++) {
addr = (ulong) (r->literal) + gd->reloc_off;
addr = (ulong) (r->literal) + reloc_off;
r->literal = (char *)addr;
}
}

View File

@ -40,10 +40,6 @@
#include <post.h>
#ifdef CONFIG_SILENT_CONSOLE
DECLARE_GLOBAL_DATA_PTR;
#endif
#if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY)
extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* for do_reset() prototype */
#endif

View File

@ -23,38 +23,9 @@
#ifndef __ASM_GBL_DATA_H
#define __ASM_GBL_DATA_H
/*
* The following data structure is placed in some memory wich 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 CFG_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 */
unsigned long reloc_off; /* Relocation Offset */
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_VFD
unsigned char vfd_type; /* display type */
#endif
void **jt; /* jump table */
} gd_t;
typedef struct global_data {} 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 DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
#define DECLARE_GLOBAL_DATA_PTR
#endif /* __ASM_GBL_DATA_H */