summaryrefslogtreecommitdiff
path: root/src/pmc/altimus/mpc7410
diff options
context:
space:
mode:
authorGreg Watson <jarrah@users.sourceforge.net>2003-06-09 21:29:23 +0000
committerGreg Watson <jarrah@users.sourceforge.net>2003-06-09 21:29:23 +0000
commit032211593248d4d9a569ecfd269a2433ea5b1c7c (patch)
tree0cd5ca04ea4add897a92f4df7c6cc37730d8daf8 /src/pmc/altimus/mpc7410
parentfd958cea68e7df40c47a3a97762d2433b5a52819 (diff)
Moved from freebios
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@862 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/pmc/altimus/mpc7410')
-rw-r--r--src/pmc/altimus/mpc7410/mpc7410.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/pmc/altimus/mpc7410/mpc7410.c b/src/pmc/altimus/mpc7410/mpc7410.c
new file mode 100644
index 0000000000..ee1dc4b096
--- /dev/null
+++ b/src/pmc/altimus/mpc7410/mpc7410.c
@@ -0,0 +1,68 @@
+/* $Id$ */
+/* Copyright 2000 AG Electronics Ltd. */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include <ppc.h>
+#include <ppcreg.h>
+#include <types.h>
+#include <string.h>
+#include <pci.h>
+#include <printk.h>
+
+#define ONEMEG 0x00100000
+#define HALFMEG 0x00080000
+
+unsigned long memory_base = 0;
+unsigned long memory_top = 0;
+unsigned long memory_size = 0;
+
+//extern char __heap_end[];
+extern unsigned mpc107_config_memory(void);
+
+unsigned config_memory(unsigned offset)
+{
+ //extern char __start[];
+ //extern char __bss_start[];
+ //unsigned rom_image = (unsigned) __start & 0xfff00000;
+ //unsigned physical = rom_image + offset;
+ //unsigned codesize = (unsigned) __bss_start - rom_image;
+
+#if 0
+ /* At this point, DBAT 0 is memory, 1 is variable, 2 is the rom image,
+ and 3 is IO. */
+ ppc_set_io_dbat_reloc(2, rom_image, physical, ONEMEG);
+ ppc_set_io_dbat (3, 0xf0000000, 0x10000000);
+ if ( rom_image != physical )
+ ppc_set_ibats_reloc(rom_image, physical, ONEMEG);
+ else
+ ppc_set_ibats(physical, ONEMEG);
+
+ printk_debug("bsp_init_memory...\n");
+#endif
+
+ ppc_setup_cpu(1); /* icache enable = 1 */
+ //ppc_enable_mmu();
+
+ memory_size = mpc107_config_memory();
+
+ /* If we have some working RAM, we copy the code and rodata into it.
+ * This allows us to reprogram the flash later. */
+#if 0
+ if (memory_size)
+ {
+ unsigned onemeg = memory_size - ONEMEG;
+ ppc_set_mem_dbat_reloc(1, onemeg, onemeg, ONEMEG);
+ memcpy((void *)onemeg, (void *)rom_image, codesize);
+ memset((void *)(onemeg + codesize), 0, ONEMEG - codesize);
+ ppc_set_ibats_reloc2(rom_image, physical, onemeg, ONEMEG);
+ ppc_set_mem_dbat_reloc(2, rom_image, onemeg, ONEMEG);
+ make_coherent((void *)onemeg, ONEMEG);
+ }
+
+ ppc_set_memory_dbat (memory_size);
+#endif
+
+ //ppc_enable_dcache ();
+
+ return memory_size;
+}