summaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:02:03 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:02:03 +0200
commit758a1107f87b255678551ada7a090cc7ba28faec (patch)
treee8069c7d177feb6539709ac035025a4d6c58c161 /arch/ppc
parent6877b3bde7929980137028c55161aea8424e6b1b (diff)
downloadbarebox-758a1107f87b255678551ada7a090cc7ba28faec.tar.gz
barebox-758a1107f87b255678551ada7a090cc7ba28faec.tar.xz
svn_rev_538
several powerpc fixes
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/lib/board.c31
-rw-r--r--arch/ppc/lib/ppclinux.c18
2 files changed, 24 insertions, 25 deletions
diff --git a/arch/ppc/lib/board.c b/arch/ppc/lib/board.c
index d306d8ec9c..7a4a580ca4 100644
--- a/arch/ppc/lib/board.c
+++ b/arch/ppc/lib/board.c
@@ -50,15 +50,15 @@ char *strmhz (char *buf, long hz)
/***********************************************************************/
static void init_bd(bd_t *bd, ulong bootflag) {
-// bd->bi_memstart = CFG_SDRAM_BASE; /* start of DRAM memory */
-// bd->bi_memsize = gd->ram_size; /* size of DRAM memory in bytes */
+ bd->bi_memstart = CFG_SDRAM_BASE; /* start of DRAM memory */
+// bd->bi_memsize = gd->ram_size; /* size of DRAM memory in bytes */ /* FIXME */
#ifdef CONFIG_IP860
-// bd->bi_sramstart = SRAM_BASE; /* start of SRAM memory */
-// bd->bi_sramsize = SRAM_SIZE; /* size of SRAM memory */
+ bd->bi_sramstart = SRAM_BASE; /* start of SRAM memory */
+ bd->bi_sramsize = SRAM_SIZE; /* size of SRAM memory */
#else
-// bd->bi_sramstart = 0; /* FIXME */ /* start of SRAM memory */
-// bd->bi_sramsize = 0; /* FIXME */ /* size of SRAM memory */
+ bd->bi_sramstart = 0; /* FIXME */ /* start of SRAM memory */
+ bd->bi_sramsize = 0; /* FIXME */ /* size of SRAM memory */
#endif
#if defined(CONFIG_8xx) || defined(CONFIG_8260) || defined(CONFIG_5xx) || \
@@ -103,23 +103,22 @@ static void init_bd(bd_t *bd, ulong bootflag) {
*
************************************************************************
*/
+
+bd_t *bd;
+
void board_init_r (ulong end_of_ram)
{
- bd_t *bd;
- char *x;
extern void malloc_bin_reloc (void);
- asm ("sync ; isync");
+ asm ("sync ; isync");
- mem_malloc_init((void *)(end_of_ram - 4096 - CFG_MALLOC_LEN), (void *)(end_of_ram - 4096));
+ mem_malloc_init((void *)(end_of_ram - 4096 - CFG_MALLOC_LEN), (void *)(end_of_ram - 4096));
- /* get gd and bd */
- gd = malloc(sizeof(gd_t));
- memset(gd, 0x0, sizeof(gd_t));
- bd = malloc(sizeof(bd_t));
- memset(bd, 0x0, sizeof(bd_t));
+ /* get gd and bd */
+ bd = malloc(sizeof(bd_t));
+ memset(bd, 0x0, sizeof(bd_t));
- gd->bd = bd;
+ init_bd(bd, 0);
/*
* Setup trap handlers
diff --git a/arch/ppc/lib/ppclinux.c b/arch/ppc/lib/ppclinux.c
index 6562860e58..8ef91a40be 100644
--- a/arch/ppc/lib/ppclinux.c
+++ b/arch/ppc/lib/ppclinux.c
@@ -10,6 +10,8 @@
#ifdef CONFIG_OF_FLAT_TREE
#include <ft_build.h>
#endif
+extern bd_t *bd;
+#define SHOW_BOOT_PROGRESS(x)
void __attribute__((noinline))
do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
@@ -18,7 +20,6 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
ulong *len_ptr,
int verify)
{
-#if 0
ulong sp;
ulong len, checksum;
ulong initrd_start, initrd_end;
@@ -76,7 +77,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
debug ("=> set upper limit to 0x%08lX\n", sp);
- cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF);
+ cmdline = (char *)((sp - CONFIG_CBSIZE) & ~0xF);
kbd = (bd_t *)(((ulong)cmdline - sizeof(bd_t)) & ~0xF);
if ((s = getenv("bootargs")) == NULL)
@@ -87,7 +88,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
cmd_start = (ulong)&cmdline[0];
cmd_end = cmd_start + strlen(cmdline);
- *kbd = *(gd->bd);
+ *kbd = *(bd);
#ifdef DEBUG
printf ("## cmdline at 0x%08lX ... 0x%08lX\n", cmd_start, cmd_end);
@@ -146,7 +147,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
if (ntohl(hdr->ih_magic) != IH_MAGIC) {
puts ("Bad Magic Number\n");
SHOW_BOOT_PROGRESS (-10);
- do_reset (cmdtp, flag, argc, argv);
+ do_reset ();
}
data = (ulong)&header;
@@ -158,7 +159,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
if (crc32 (0, (uchar *)data, len) != checksum) {
puts ("Bad Header Checksum\n");
SHOW_BOOT_PROGRESS (-11);
- do_reset (cmdtp, flag, argc, argv);
+ do_reset();
}
SHOW_BOOT_PROGRESS (10);
@@ -195,7 +196,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
if (csum != ntohl(hdr->ih_dcrc)) {
puts ("Bad Data CRC\n");
SHOW_BOOT_PROGRESS (-12);
- do_reset (cmdtp, flag, argc, argv);
+ do_reset ();
}
puts ("OK\n");
}
@@ -207,7 +208,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
(hdr->ih_type != IH_TYPE_RAMDISK) ) {
puts ("No Linux PPC Ramdisk Image\n");
SHOW_BOOT_PROGRESS (-13);
- do_reset (cmdtp, flag, argc, argv);
+ do_reset ();
}
/*
@@ -247,7 +248,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
hdr = (image_header_t *)of_flat_tree;
if (*(ulong *)of_flat_tree == OF_DT_HEADER) {
-#ifndef CFG_NO_FLASH
+#ifdef CONFIG_OF_FLAT_TREE_FLASH /* FIXME */
if (addr2info((ulong)of_flat_tree) != NULL)
of_data = (ulong)of_flat_tree;
#endif
@@ -464,6 +465,5 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
(*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
#endif
-#endif
}