summaryrefslogtreecommitdiffstats
path: root/lib_mips
diff options
context:
space:
mode:
Diffstat (limited to 'lib_mips')
-rw-r--r--lib_mips/board.c24
-rw-r--r--lib_mips/mips_linux.c4
2 files changed, 13 insertions, 15 deletions
diff --git a/lib_mips/board.c b/lib_mips/board.c
index 12df61fdde..b7d335641a 100644
--- a/lib_mips/board.c
+++ b/lib_mips/board.c
@@ -29,6 +29,8 @@
#include <net.h>
#include <environment.h>
+DECLARE_GLOBAL_DATA_PTR;
+
#if ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < CFG_MONITOR_BASE) || \
(CFG_ENV_ADDR >= (CFG_MONITOR_BASE + CFG_MONITOR_LEN)) ) || \
defined(CFG_ENV_IS_IN_NVRAM)
@@ -66,8 +68,6 @@ static ulong mem_malloc_brk;
*/
static void mem_malloc_init (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
mem_malloc_end = dest_addr;
@@ -94,8 +94,6 @@ void *sbrk (ptrdiff_t increment)
static int init_func_ram (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
#ifdef CONFIG_BOARD_TYPES
int board_type = gd->board_type;
#else
@@ -127,9 +125,7 @@ static void display_flash_config(ulong size)
static int init_baudrate (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
- uchar tmp[64]; /* long enough for environment variables */
+ char tmp[64]; /* long enough for environment variables */
int i = getenv_r ("baudrate", tmp, sizeof (tmp));
gd->baudrate = (i > 0)
@@ -180,12 +176,11 @@ init_fnc_t *init_sequence[] = {
void board_init_f(ulong bootflag)
{
- DECLARE_GLOBAL_DATA_PTR;
-
gd_t gd_data, *id;
bd_t *bd;
init_fnc_t **init_fnc_ptr;
ulong addr, addr_sp, len = (ulong)&uboot_end - CFG_MONITOR_BASE;
+ ulong *s;
#ifdef CONFIG_PURPLE
void copy_code (ulong);
#endif
@@ -262,8 +257,10 @@ void board_init_f(ulong bootflag)
*/
addr_sp -= 16;
addr_sp &= ~0xF;
- *((ulong *) addr_sp)-- = 0;
- *((ulong *) addr_sp)-- = 0;
+ s = (ulong *)addr_sp;
+ *s-- = 0;
+ *s-- = 0;
+ addr_sp = (ulong)s;
debug ("Stack Pointer at: %08lx\n", addr_sp);
/*
@@ -298,7 +295,6 @@ void board_init_f(ulong bootflag)
void board_init_r (gd_t *id, ulong dest_addr)
{
- DECLARE_GLOBAL_DATA_PTR;
cmd_tbl_t *cmdtp;
ulong size;
extern void malloc_bin_reloc (void);
@@ -414,8 +410,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
misc_init_r ();
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_NET_MULTI)
puts ("Net: ");
+#endif
eth_initialize(gd->bd);
#endif
diff --git a/lib_mips/mips_linux.c b/lib_mips/mips_linux.c
index 18eafe13de..12e84359c9 100644
--- a/lib_mips/mips_linux.c
+++ b/lib_mips/mips_linux.c
@@ -94,7 +94,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
checksum = ntohl (hdr->ih_hcrc);
hdr->ih_hcrc = 0;
- if (crc32 (0, (char *) data, len) != checksum) {
+ if (crc32 (0, (uchar *) data, len) != checksum) {
printf ("Bad Header Checksum\n");
SHOW_BOOT_PROGRESS (-11);
do_reset (cmdtp, flag, argc, argv);
@@ -111,7 +111,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
ulong csum = 0;
printf (" Verifying Checksum ... ");
- csum = crc32 (0, (char *) data, len);
+ csum = crc32 (0, (uchar *) data, len);
if (csum != ntohl (hdr->ih_dcrc)) {
printf ("Bad Data CRC\n");
SHOW_BOOT_PROGRESS (-12);
OpenPOWER on IntegriCloud