summaryrefslogtreecommitdiff
path: root/arch/microblaze/lib
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/lib')
-rw-r--r--arch/microblaze/lib/Makefile1
-rw-r--r--arch/microblaze/lib/board.c31
-rw-r--r--arch/microblaze/lib/bootm.c47
-rw-r--r--arch/microblaze/lib/cache.c43
4 files changed, 68 insertions, 54 deletions
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
index 9b0f296e3f..817643795e 100644
--- a/arch/microblaze/lib/Makefile
+++ b/arch/microblaze/lib/Makefile
@@ -29,7 +29,6 @@ SOBJS-y +=
COBJS-y += board.o
COBJS-y += bootm.o
-COBJS-y += cache.o
COBJS-y += time.o
SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index d4baea930a..3ff5c17d24 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -30,6 +30,7 @@
#include <timestamp.h>
#include <version.h>
#include <watchdog.h>
+#include <stdio_dev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -44,6 +45,12 @@ extern int interrupts_init (void);
#if defined(CONFIG_CMD_NET)
extern int eth_init (bd_t * bis);
#endif
+#ifdef CONFIG_SYS_TIMER_0
+extern int timer_init (void);
+#endif
+#ifdef CONFIG_SYS_FSL_2
+extern void fsl_init2 (void);
+#endif
/*
* All attempts to come up with a "common" initialization sequence
@@ -68,6 +75,12 @@ init_fnc_t *init_sequence[] = {
#ifdef CONFIG_SYS_INTC_0
interrupts_init,
#endif
+#ifdef CONFIG_SYS_TIMER_0
+ timer_init,
+#endif
+#ifdef CONFIG_SYS_FSL_2
+ fsl_init2,
+#endif
NULL,
};
@@ -76,6 +89,7 @@ void board_init (void)
bd_t *bd;
init_fnc_t **init_fnc_ptr;
gd = (gd_t *) CONFIG_SYS_GBL_DATA_OFFSET;
+ char *s;
#if defined(CONFIG_CMD_FLASH)
ulong flash_size = 0;
#endif
@@ -104,8 +118,8 @@ void board_init (void)
}
puts ("SDRAM :\n");
- printf ("\t\tIcache:%s\n", icache_status() ? "OK" : "FAIL");
- printf ("\t\tDcache:%s\n", dcache_status() ? "OK" : "FAIL");
+ printf ("\t\tIcache:%s\n", icache_status() ? "ON" : "OFF");
+ printf ("\t\tDcache:%s\n", dcache_status() ? "ON" : "OFF");
printf ("\tU-Boot Start:0x%08x\n", TEXT_BASE);
#if defined(CONFIG_CMD_FLASH)
@@ -139,15 +153,22 @@ void board_init (void)
}
#endif
+ /* relocate environment function pointers etc. */
+ env_relocate ();
+
+ /* Initialize stdio devices */
+ stdio_init ();
+
+ if ((s = getenv ("loadaddr")) != NULL) {
+ load_addr = simple_strtoul (s, NULL, 16);
+ }
+
#if defined(CONFIG_CMD_NET)
/* IP Address */
bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
eth_init (bd);
#endif
- /* relocate environment function pointers etc. */
- env_relocate ();
-
/* main_loop */
for (;;) {
WATCHDOG_RESET ();
diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index bce4774fe3..2227a81bb0 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -35,22 +35,59 @@ DECLARE_GLOBAL_DATA_PTR;
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
{
/* First parameter is mapped to $r5 for kernel boot args */
- void (*theKernel) (char *);
+ void (*theKernel) (char *, ulong, ulong);
char *commandline = getenv ("bootargs");
+ ulong rd_data_start, rd_data_end;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
- theKernel = (void (*)(char *))images->ep;
+ int ret;
+
+ char *of_flat_tree = NULL;
+#if defined(CONFIG_OF_LIBFDT)
+ ulong of_size = 0;
+
+ /* find flattened device tree */
+ ret = boot_get_fdt (flag, argc, argv, images, &of_flat_tree, &of_size);
+ if (ret)
+ return 1;
+#endif
+
+ theKernel = (void (*)(char *, ulong, ulong))images->ep;
+
+ /* find ramdisk */
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MICROBLAZE,
+ &rd_data_start, &rd_data_end);
+ if (ret)
+ return 1;
show_boot_progress (15);
+ if (!(ulong) of_flat_tree)
+ of_flat_tree = (char *)simple_strtoul (argv[3], NULL, 16);
+
#ifdef DEBUG
- printf ("## Transferring control to Linux (at address %08lx) ...\n",
- (ulong) theKernel);
+ printf ("## Transferring control to Linux (at address 0x%08lx) " \
+ "ramdisk 0x%08lx, FDT 0x%08lx...\n",
+ (ulong) theKernel, rd_data_start, (ulong) of_flat_tree);
#endif
- theKernel (commandline);
+#ifdef XILINX_USE_DCACHE
+#ifdef XILINX_DCACHE_BYTE_SIZE
+ flush_cache(0, XILINX_DCACHE_BYTE_SIZE);
+#else
+#warning please rebuild BSPs and update configuration
+ flush_cache(0, 32768);
+#endif
+#endif
+ /*
+ * Linux Kernel Parameters (passing device tree):
+ * r5: pointer to command line
+ * r6: pointer to ramdisk
+ * r7: pointer to the fdt, followed by the board info data
+ */
+ theKernel (commandline, rd_data_start, (ulong) of_flat_tree);
/* does not return */
return 1;
diff --git a/arch/microblaze/lib/cache.c b/arch/microblaze/lib/cache.c
deleted file mode 100644
index 4b2e8e3790..0000000000
--- a/arch/microblaze/lib/cache.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * (C) Copyright 2004 Atmark Techno, Inc.
- *
- * Yasushi SHOJI <yashi@atmark-techno.com>
- *
- * 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
- */
-
-#include <common.h>
-
-void flush_cache (ulong addr, ulong size)
-{
- int i;
- for (i = 0; i < size; i += 4)
- asm volatile (
-#ifdef CONFIG_ICACHE
- "wic %0, r0;"
-#endif
- "nop;"
-#ifdef CONFIG_DCACHE
- "wdc %0, r0;"
-#endif
- "nop;"
- :
- : "r" (addr + i)
- : "memory");
-}