]> git.sur5r.net Git - u-boot/commitdiff
Merge commit 'wd/master'
authorJon Loeliger <jdl@freescale.com>
Mon, 10 Nov 2008 16:04:51 +0000 (10:04 -0600)
committerJon Loeliger <jdl@freescale.com>
Mon, 10 Nov 2008 16:04:51 +0000 (10:04 -0600)
13 files changed:
board/freescale/mpc8610hpcd/mpc8610hpcd.c
board/freescale/mpc8641hpcn/law.c
board/freescale/mpc8641hpcn/mpc8641hpcn.c
cpu/mpc86xx/Makefile
cpu/mpc86xx/cpu_init.c
cpu/mpc86xx/fdt.c
cpu/mpc86xx/mp.c [new file with mode: 0644]
cpu/mpc86xx/mp.h [new file with mode: 0644]
cpu/mpc86xx/release.S [new file with mode: 0644]
cpu/mpc86xx/start.S
include/configs/MPC8610HPCD.h
include/configs/MPC8641HPCN.h
include/configs/sbc8641d.h

index 159e7d1d8190f6b23e11b3df1547bf7912ab0108..2792778e320cae3a79b715b8e0bad95d01660540 100644 (file)
@@ -37,7 +37,7 @@
 #include "../common/pixis.h"
 
 void sdram_init(void);
-long int fixed_sdram(void);
+phys_size_t fixed_sdram(void);
 void mpc8610hpcd_diu_init(void);
 
 
@@ -117,7 +117,7 @@ int checkboard(void)
 phys_size_t
 initdram(int board_type)
 {
-       long dram_size = 0;
+       phys_size_t dram_size = 0;
 
 #if defined(CONFIG_SPD_EEPROM)
        dram_size = fsl_ddr_sdram();
@@ -140,7 +140,7 @@ initdram(int board_type)
  * Fixed sdram init -- doesn't use serial presence detect.
  */
 
-long int fixed_sdram(void)
+phys_size_t fixed_sdram(void)
 {
 #if !defined(CONFIG_SYS_RAMBOOT)
        volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
index 8e137289df6cded1520eaf359db45b5c69c51f1b..1ad186c980aa7b557977bfcbc9546776c2c8b6f9 100644 (file)
@@ -49,13 +49,16 @@ struct law_entry law_table[] = {
 #if !defined(CONFIG_SPD_EEPROM)
        SET_LAW(CONFIG_SYS_DDR_SDRAM_BASE, LAW_SIZE_256M, LAW_TRGT_IF_DDR_1),
 #endif
+#ifdef CONFIG_PCI
        SET_LAW(CONFIG_SYS_PCI1_MEM_BASE, LAW_SIZE_512M, LAW_TRGT_IF_PCI_1),
        SET_LAW(CONFIG_SYS_PCI2_MEM_BASE, LAW_SIZE_512M, LAW_TRGT_IF_PCI_2),
-       SET_LAW(PIXIS_BASE, LAW_SIZE_2M, LAW_TRGT_IF_LBC),
        SET_LAW(CONFIG_SYS_PCI1_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI_1),
        SET_LAW(CONFIG_SYS_PCI2_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI_2),
+#elif defined(CONFIG_RIO)
+       SET_LAW(CONFIG_SYS_RIO_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_RIO),
+#endif
+       SET_LAW(PIXIS_BASE, LAW_SIZE_2M, LAW_TRGT_IF_LBC),
        SET_LAW((CONFIG_SYS_FLASH_BASE & 0xfe000000), LAW_SIZE_32M, LAW_TRGT_IF_LBC),
-       SET_LAW(CONFIG_SYS_RIO_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_RIO)
 };
 
 int num_law_entries = ARRAY_SIZE(law_table);
index cccb63e39674bb1ffcb4920ba394d0b4e21d654e..15be0c6134a2a0e0c7dd1875ea2ef502ed0654b8 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "../common/pixis.h"
 
-long int fixed_sdram(void);
+phys_size_t fixed_sdram(void);
 
 int board_early_init_f(void)
 {
@@ -53,7 +53,7 @@ int checkboard(void)
 phys_size_t
 initdram(int board_type)
 {
-       long dram_size = 0;
+       phys_size_t dram_size = 0;
 
 #if defined(CONFIG_SPD_EEPROM)
        dram_size = fsl_ddr_sdram();
@@ -75,7 +75,7 @@ initdram(int board_type)
 /*
  * Fixed sdram init -- doesn't use serial presence detect.
  */
-long int
+phys_size_t
 fixed_sdram(void)
 {
 #if !defined(CONFIG_SYS_RAMBOOT)
@@ -121,27 +121,7 @@ fixed_sdram(void)
 
 
 #if defined(CONFIG_PCI)
-/*
- * Initialize PCI Devices, report devices found.
- */
-
-#ifndef CONFIG_PCI_PNP
-static struct pci_config_table pci_fsl86xxads_config_table[] = {
-       {PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-        PCI_IDSEL_NUMBER, PCI_ANY_ID,
-        pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
-                                    PCI_ENET0_MEMADDR,
-                                    PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER}},
-       {}
-};
-#endif
-
-
-static struct pci_controller pci1_hose = {
-#ifndef CONFIG_PCI_PNP
-       config_table:pci_mpc86xxcts_config_table
-#endif
-};
+static struct pci_controller pci1_hose;
 #endif /* CONFIG_PCI */
 
 #ifdef CONFIG_PCI2
@@ -155,17 +135,16 @@ extern void fsl_pci_init(struct pci_controller *hose);
 
 void pci_init_board(void)
 {
-       volatile immap_t *immap = (immap_t *) CONFIG_SYS_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
-       uint devdisr = gur->devdisr;
-       uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL)
-               >> MPC8641_PORDEVSR_IO_SEL_SHIFT;
-
 #ifdef CONFIG_PCI1
 {
        volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CONFIG_SYS_PCI1_ADDR;
        struct pci_controller *hose = &pci1_hose;
        struct pci_region *r = hose->regions;
+       volatile immap_t *immap = (immap_t *) CONFIG_SYS_CCSRBAR;
+       volatile ccsr_gur_t *gur = &immap->im_gur;
+       uint devdisr = gur->devdisr;
+       uint io_sel = (gur->pordevsr & MPC8641_PORDEVSR_IO_SEL)
+               >> MPC8641_PORDEVSR_IO_SEL_SHIFT;
 
 #ifdef DEBUG
        uint host1_agent = (gur->porbmsr & MPC8641_PORBMSR_HA)
index a9767adeb798f5f9a6536c41bc3a1d26b3367f18..34a97555621457c1b7556250df9ed64a26477f3e 100644 (file)
@@ -31,6 +31,10 @@ LIB  = $(obj)lib$(CPU).a
 START  = start.o
 SOBJS  = cache.o
 
+ifneq ($(CONFIG_NUM_CPUS),1)
+COBJS-y += mp.o
+SOBJS += release.o
+endif
 COBJS-y        += traps.o
 COBJS-y        += cpu.o
 COBJS-y        += cpu_init.o
index 4ab88f0b0a8a4158146f76b04d27f30a5fd9ae46..06f179c0937073195012400a19245c7ef85aa7b5 100644 (file)
@@ -31,6 +31,7 @@
 #include <mpc86xx.h>
 #include <asm/mmu.h>
 #include <asm/fsl_law.h>
+#include "mp.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -121,6 +122,9 @@ void cpu_init_f(void)
  */
 int cpu_init_r(void)
 {
+#if (CONFIG_NUM_CPUS > 1)
+       setup_mp();
+#endif
        return 0;
 }
 
index 1fef94f5db54190b4783a82a61e3644c52fbefbb..3adfad98c6b30a5b7cf8acbeae72c780abd14971 100644 (file)
@@ -9,9 +9,17 @@
 #include <common.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include "mp.h"
+
+DECLARE_GLOBAL_DATA_PTR;
 
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
+#if (CONFIG_NUM_CPUS > 1)
+       int off;
+       u32 bootpg;
+#endif
+
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
                             "timebase-frequency", bd->bi_busfreq / 4, 1);
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
@@ -32,4 +40,17 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        do_fixup_by_compat_u32(blob, "ns16550",
                               "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
 #endif
+
+#if (CONFIG_NUM_CPUS > 1)
+       /* if we have 4G or more of memory, put the boot page at 4Gb-1M */
+       if (gd->ram_size > 0xfffff000)
+               bootpg = 0xfff00000;
+       else
+               bootpg = gd->ram_size - (1024 * 1024);
+
+       /* Reserve the boot page so OSes dont use it */
+       off = fdt_add_mem_rsv(blob, bootpg, (u64)4096);
+       if (off < 0)
+               printf("%s: %s\n", __FUNCTION__, fdt_strerror(off));
+#endif
 }
diff --git a/cpu/mpc86xx/mp.c b/cpu/mpc86xx/mp.c
new file mode 100644 (file)
index 0000000..5014401
--- /dev/null
@@ -0,0 +1,68 @@
+#include <common.h>
+#include <asm/processor.h>
+#include <asm/mmu.h>
+#include <ioports.h>
+#include <lmb.h>
+#include <asm/io.h>
+#include "mp.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#if (CONFIG_NUM_CPUS > 1)
+void cpu_mp_lmb_reserve(struct lmb *lmb)
+{
+       u32 bootpg;
+
+       /* if we have 4G or more of memory, put the boot page at 4Gb-1M */
+       if ((u64)gd->ram_size > 0xfffff000)
+               bootpg = 0xfff00000;
+       else
+               bootpg = gd->ram_size - (1024 * 1024);
+
+       /* tell u-boot we stole a page */
+       lmb_reserve(lmb, bootpg, 4096);
+}
+
+/*
+ * Copy the code for other cpus to execute into an
+ * aligned location accessible via BPTR
+ */
+void setup_mp(void)
+{
+       extern ulong __secondary_start_page;
+       ulong fixup = (ulong)&__secondary_start_page;
+       u32 bootpg;
+       u32 bootpg_va;
+
+       /*
+        * If we have 4G or more of memory, put the boot page at 4Gb-1M.
+        * Otherwise, put it at the very end of RAM.
+        */
+       if (gd->ram_size > 0xfffff000)
+               bootpg = 0xfff00000;
+       else
+               bootpg = gd->ram_size - (1024 * 1024);
+
+       if (bootpg >= CONFIG_SYS_MAX_DDR_BAT_SIZE) {
+               /* We're not covered by the DDR mapping, set up BAT  */
+               write_bat(DBAT7, CONFIG_SYS_SCRATCH_VA | BATU_BL_128K |
+                         BATU_VS | BATU_VP,
+                         bootpg | BATL_PP_RW | BATL_MEMCOHERENCE);
+               bootpg_va = CONFIG_SYS_SCRATCH_VA;
+       } else {
+               bootpg_va = bootpg;
+       }
+
+       memcpy((void *)bootpg_va, (void *)fixup, 4096);
+       flush_cache(bootpg_va, 4096);
+
+       /* remove the temporary BAT mapping */
+       if (bootpg >= CONFIG_SYS_MAX_DDR_BAT_SIZE)
+               write_bat(DBAT7, 0, 0);
+
+       /* If the physical location of bootpg is not at fff00000, set BPTR */
+       if (bootpg != 0xfff00000)
+               out_be32((uint *)(CONFIG_SYS_CCSRBAR + 0x20), 0x80000000 |
+                        (bootpg >> 12));
+}
+#endif
diff --git a/cpu/mpc86xx/mp.h b/cpu/mpc86xx/mp.h
new file mode 100644 (file)
index 0000000..886e0c8
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __MPC86XX_MP_H_
+#define __MPC86XX_MP_H_
+
+void setup_mp(void);
+void cpu_mp_lmb_reserve(struct lmb *lmb);
+
+#endif
diff --git a/cpu/mpc86xx/release.S b/cpu/mpc86xx/release.S
new file mode 100644 (file)
index 0000000..b524e50
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2004, 2007, 2008 Freescale Semiconductor.
+ * Srikanth Srinivasan <srikanth.srinivaan@freescale.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 <config.h>
+#include <mpc86xx.h>
+#include <version.h>
+
+#include <ppc_asm.tmpl>
+#include <ppc_defs.h>
+
+#include <asm/cache.h>
+#include <asm/mmu.h>
+
+/* If this is a multi-cpu system then we need to handle the
+ * 2nd cpu.  The assumption is that the 2nd cpu is being
+ * held in boot holdoff mode until the 1st cpu unlocks it
+ * from Linux. We'll do some basic cpu init and then pass
+ * it to the Linux Reset Vector.
+ * Sri:         Much of this initialization is not required. Linux
+ * rewrites the bats, and the sprs and also enables the L1 cache.
+ *
+ * Core 0 must copy this to a 1M aligned region and set BPTR
+ * to point to it.
+ */
+#if (CONFIG_NUM_CPUS > 1)
+       .align 12
+.globl __secondary_start_page
+__secondary_start_page:
+       .space 0x100    /* space over to reset vector loc */
+       mfspr   r0, MSSCR0
+       andi.   r0, r0, 0x0020
+       rlwinm  r0,r0,27,31,31
+       mtspr   PIR, r0
+
+       /* Invalidate BATs */
+       li      r0, 0
+       mtspr   IBAT0U, r0
+       mtspr   IBAT1U, r0
+       mtspr   IBAT2U, r0
+       mtspr   IBAT3U, r0
+       mtspr   IBAT4U, r0
+       mtspr   IBAT5U, r0
+       mtspr   IBAT6U, r0
+       mtspr   IBAT7U, r0
+       isync
+       mtspr   DBAT0U, r0
+       mtspr   DBAT1U, r0
+       mtspr   DBAT2U, r0
+       mtspr   DBAT3U, r0
+       mtspr   DBAT4U, r0
+       mtspr   DBAT5U, r0
+       mtspr   DBAT6U, r0
+       mtspr   DBAT7U, r0
+       isync
+       sync
+
+       /* enable extended addressing */
+       mfspr   r0, HID0
+       lis     r0, (HID0_HIGH_BAT_EN | HID0_XBSEN | HID0_XAEN)@h
+       ori     r0, r0, (HID0_HIGH_BAT_EN | HID0_XBSEN | HID0_XAEN)@l
+       mtspr   HID0, r0
+       sync
+       isync
+
+#ifdef CONFIG_SYS_L2
+       /* init the L2 cache */
+       addis   r3, r0, L2_INIT@h
+       ori     r3, r3, L2_INIT@l
+       sync
+       mtspr   l2cr, r3
+#ifdef CONFIG_ALTIVEC
+       dssall
+#endif
+       /* invalidate the L2 cache */
+       mfspr   r3, l2cr
+       rlwinm. r3, r3, 0, 0, 0
+       beq     1f
+
+       mfspr   r3, l2cr
+       rlwinm  r3, r3, 0, 1, 31
+
+#ifdef CONFIG_ALTIVEC
+       dssall
+#endif
+       sync
+       mtspr   l2cr, r3
+       sync
+1:     mfspr   r3, l2cr
+       oris    r3, r3, L2CR_L2I@h
+       mtspr   l2cr, r3
+
+invl2:
+       mfspr   r3, l2cr
+       andis.  r3, r3, L2CR_L2I@h
+       bne     invl2
+       sync
+#endif
+
+       /* enable and invalidate the data cache */
+       mfspr   r3, HID0
+       li      r5, HID0_DCFI|HID0_DLOCK
+       andc    r3, r3, r5
+       mtspr   HID0, r3                /* no invalidate, unlock */
+       ori     r3, r3, HID0_DCE
+       ori     r5, r3, HID0_DCFI
+       mtspr   HID0, r5                /* enable + invalidate */
+       mtspr   HID0, r3                /* enable */
+       sync
+#ifdef CFG_L2
+       sync
+       lis     r3, L2_ENABLE@h
+       ori     r3, r3, L2_ENABLE@l
+       mtspr   l2cr, r3
+       isync
+       sync
+#endif
+
+       /* enable and invalidate the instruction cache*/
+       mfspr   r3, HID0
+       li      r5, HID0_ICFI|HID0_ILOCK
+       andc    r3, r3, r5
+       ori     r3, r3, HID0_ICE
+       ori     r5, r3, HID0_ICFI
+       mtspr   HID0, r5
+       mtspr   HID0, r3
+       isync
+       sync
+
+       /* TBEN in HID0 */
+       mfspr   r4, HID0
+       oris    r4, r4, 0x0400
+       mtspr   HID0, r4
+       sync
+       isync
+
+       /* MCP|SYNCBE|ABE in HID1 */
+       mfspr   r4, HID1
+       oris    r4, r4, 0x8000
+       ori     r4, r4, 0x0C00
+       mtspr   HID1, r4
+       sync
+       isync
+
+       lis     r3, CONFIG_LINUX_RESET_VEC@h
+       ori     r3, r3, CONFIG_LINUX_RESET_VEC@l
+       mtlr    r3
+       blr
+
+       /* Never Returns, Running in Linux Now */
+#endif
index 75e431764b53a3a8912c0edeed4d8ee89a625201..48f8c5acf59b343cb3a319b598f5b5f772ae30ef 100644 (file)
@@ -179,20 +179,10 @@ _end_of_vectors:
 
 boot_cold:
 boot_warm:
-
-       /* if this is a multi-core system we need to check which cpu
-        * this is, if it is not cpu 0 send the cpu to the linux reset
-        * vector */
-#if (CONFIG_NUM_CPUS > 1)
-       mfspr   r0, MSSCR0
-       andi.   r0, r0, 0x0020
-       rlwinm  r0,r0,27,31,31
-       mtspr   PIR, r0
-       beq     1f
-
-       bl      secondary_cpu_setup
-#endif
-
+       /*
+        * NOTE: Only Cpu 0 will ever come here.  Other cores go to an
+        * address specified by the BPTR
+        */
 1:
 #ifdef CONFIG_SYS_RAMBOOT
        /* disable everything */
@@ -219,6 +209,11 @@ boot_warm:
        sync
 #endif
 
+#if (CONFIG_SYS_CCSRBAR_DEFAULT != CONFIG_SYS_CCSRBAR)
+       /* setup ccsrbar now while we're in real mode */
+       bl      setup_ccsrbar
+#endif
+
        /*
         * Calculate absolute address in FLASH and jump there
         *------------------------------------------------------*/
@@ -281,10 +276,6 @@ in_flash:
        bl      setup_bats
        sync
 
-#if (CONFIG_SYS_CCSRBAR_DEFAULT != CONFIG_SYS_CCSRBAR)
-       /* setup ccsrbar */
-       bl      setup_ccsrbar
-#endif
 
        /* run low-level CPU init code     (from Flash) */
        bl      cpu_init_f
@@ -365,10 +356,28 @@ invalidate_bats:
  * early_bats:
  *
  * Set up bats needed early on - this is usually the BAT for the
- * stack-in-cache and the Flash
+ * stack-in-cache, the Flash, and CCSR space
  */
        .globl  early_bats
 early_bats:
+       /* IBAT 3 */
+       lis     r4, CONFIG_SYS_IBAT3L@h
+       ori     r4, r4, CONFIG_SYS_IBAT3L@l
+       lis     r3, CONFIG_SYS_IBAT3U@h
+       ori     r3, r3, CONFIG_SYS_IBAT3U@l
+       mtspr   IBAT3L, r4
+       mtspr   IBAT3U, r3
+       isync
+
+       /* DBAT 3 */
+       lis     r4, CONFIG_SYS_DBAT3L@h
+       ori     r4, r4, CONFIG_SYS_DBAT3L@l
+       lis     r3, CONFIG_SYS_DBAT3U@h
+       ori     r3, r3, CONFIG_SYS_DBAT3U@l
+       mtspr   DBAT3L, r4
+       mtspr   DBAT3U, r3
+       isync
+
        /* IBAT 5 */
        lis     r4, CONFIG_SYS_IBAT5L@h
        ori     r4, r4, CONFIG_SYS_IBAT5L@l
@@ -959,63 +968,4 @@ unlock_ram_in_cache:
 #endif
 #endif
 
-/* If this is a multi-cpu system then we need to handle the
- * 2nd cpu.  The assumption is that the 2nd cpu is being
- * held in boot holdoff mode until the 1st cpu unlocks it
- * from Linux. We'll do some basic cpu init and then pass
- * it to the Linux Reset Vector.
- * Sri:         Much of this initialization is not required. Linux
- * rewrites the bats, and the sprs and also enables the L1 cache.
- */
-#if (CONFIG_NUM_CPUS > 1)
-.globl secondary_cpu_setup
-secondary_cpu_setup:
-       /* Do only core setup on all cores except cpu0 */
-       bl      invalidate_bats
-       sync
-       bl      enable_ext_addr
-
-#ifdef CONFIG_SYS_L2
-       /* init the L2 cache */
-       addis   r3, r0, L2_INIT@h
-       ori     r3, r3, L2_INIT@l
-       sync
-       mtspr   l2cr, r3
-#ifdef CONFIG_ALTIVEC
-       dssall
-#endif
-       /* invalidate the L2 cache */
-       bl      l2cache_invalidate
-       sync
-#endif
-
-       /* enable and invalidate the data cache */
-       bl      dcache_enable
-       sync
 
-       /* enable and invalidate the instruction cache*/
-       bl      icache_enable
-       sync
-
-       /* TBEN in HID0 */
-       mfspr   r4, HID0
-       oris    r4, r4, 0x0400
-       mtspr   HID0, r4
-       sync
-       isync
-
-       /* MCP|SYNCBE|ABE in HID1 */
-       mfspr   r4, HID1
-       oris    r4, r4, 0x8000
-       ori     r4, r4, 0x0C00
-       mtspr   HID1, r4
-       sync
-       isync
-
-       lis     r3, CONFIG_LINUX_RESET_VEC@h
-       ori     r3, r3, CONFIG_LINUX_RESET_VEC@l
-       mtlr    r3
-       blr
-
-       /* Never Returns, Running in Linux Now */
-#endif
index 67b2764289ac4203360c0e97e1eaac15b024de43..44867633667e56dad1868ea7bd0bbb75130595ed 100644 (file)
 
 #define CONFIG_SYS_RESET_ADDRESS       0xfff00100
 
+/*
+ * virtual address to be used for temporary mappings.  There
+ * should be 128k free at this VA.
+ */
+#define CONFIG_SYS_SCRATCH_VA  0xc0000000
+
 #define CONFIG_PCI             1       /* Enable PCI/PCIE*/
 #define CONFIG_PCI1            1       /* PCI controler 1 */
 #define CONFIG_PCIE1           1       /* PCIe 1 connected to ULI bridge */
@@ -92,6 +98,7 @@
 
 #define CONFIG_SYS_DDR_SDRAM_BASE      0x00000000      /* DDR is system memory*/
 #define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_SDRAM_BASE
+#define CONFIG_SYS_MAX_DDR_BAT_SIZE    0x80000000      /* BAT mapping size */
 #define CONFIG_VERY_BIG_RAM
 
 #define MPC86xx_DDR_SDRAM_CLK_CNTL
 #define CONFIG_SYS_IBAT2U      CONFIG_SYS_DBAT2U
 
 /*
- * BAT3                32M     Cache-inhibited, guarded
- * 0xe200_0000 1M      PCI-Express 2 I/O
- * 0xe300_0000 1M      PCI-Express 1 I/O
+ * BAT3                4M      Cache-inhibited, guarded
+ * 0xe000_0000 4M      CCSR
  */
 
-#define CONFIG_SYS_DBAT3L      (CONFIG_SYS_PCIE2_IO_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT \
+#define CONFIG_SYS_DBAT3L      (CONFIG_SYS_CCSRBAR | BATL_PP_RW | BATL_CACHEINHIBIT \
                        | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT3U      (CONFIG_SYS_PCIE2_IO_PHYS | BATU_BL_32M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_IBAT3L      (CONFIG_SYS_PCIE2_IO_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CONFIG_SYS_DBAT3U      (CONFIG_SYS_CCSRBAR | BATU_BL_1M | BATU_VS | BATU_VP)
+#define CONFIG_SYS_IBAT3L      (CONFIG_SYS_CCSRBAR | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CONFIG_SYS_IBAT3U      CONFIG_SYS_DBAT3U
 
 /*
- * BAT4                4M      Cache-inhibited, guarded
- * 0xe000_0000 4M      CCSR
+ * BAT4                32M     Cache-inhibited, guarded
+ * 0xe200_0000 1M      PCI-Express 2 I/O
+ * 0xe300_0000 1M      PCI-Express 1 I/O
  */
-#define CONFIG_SYS_DBAT4L      (CONFIG_SYS_CCSRBAR | BATL_PP_RW | BATL_CACHEINHIBIT \
+
+#define CONFIG_SYS_DBAT4L      (CONFIG_SYS_PCIE2_IO_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT \
                        | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT4U      (CONFIG_SYS_CCSRBAR | BATU_BL_1M | BATU_VS | BATU_VP)
-#define CONFIG_SYS_IBAT4L      (CONFIG_SYS_CCSRBAR | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CONFIG_SYS_DBAT4U      (CONFIG_SYS_PCIE2_IO_PHYS | BATU_BL_32M | BATU_VS | BATU_VP)
+#define CONFIG_SYS_IBAT4L      (CONFIG_SYS_PCIE2_IO_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CONFIG_SYS_IBAT4U      CONFIG_SYS_DBAT4U
 
+
 /*
  * BAT5                128K    Cacheable, non-guarded
  * 0xe400_0000 128K    Init RAM for stack in the CPU DCache (no backing memory)
index 542877bca508a805dc77daf4bc526dc925c31708..1401e159a3d2fa87582b30f952ab81b94f51f88e 100644 (file)
 
 #define CONFIG_SYS_RESET_ADDRESS    0xfff00100
 
+/*
+ * virtual address to be used for temporary mappings.  There
+ * should be 128k free at this VA.
+ */
+#define CONFIG_SYS_SCRATCH_VA  0xe0000000
+
+/*
+ * set this to enable Rapid IO.  PCI and RIO are mutually exclusive
+ */
+/*#define CONFIG_RIO           1*/
+
+#ifndef CONFIG_RIO                     /* RIO/PCI are mutually exclusive */
 #define CONFIG_PCI             1       /* Enable PCI/PCIE */
 #define CONFIG_PCI1            1       /* PCIE controler 1 (ULI bridge) */
 #define CONFIG_PCI2            1       /* PCIE controler 2 (slot) */
 #define CONFIG_FSL_PCI_INIT    1       /* Use common FSL init code */
 #define CONFIG_SYS_PCI_64BIT   1       /* enable 64-bit PCI resources */
+#endif
 #define CONFIG_FSL_LAW         1       /* Use common FSL law init code */
 
 #define CONFIG_TSEC_ENET               /* tsec ethernet support */
@@ -102,6 +115,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #define CONFIG_SYS_DDR_SDRAM_BASE      0x00000000      /* DDR is system memory*/
 #define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_SDRAM_BASE
+#define CONFIG_SYS_MAX_DDR_BAT_SIZE    0x80000000      /* BAT mapping size */
 #define CONFIG_VERY_BIG_RAM
 
 #define MPC86xx_DDR_SDRAM_CLK_CNTL
@@ -162,21 +176,26 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE2}
 
+/* Convert an address into the right format for the BR registers */
+#define BR_PHYS_ADDR(x) (x & 0xffff8000)
+
 #define CONFIG_SYS_BR0_PRELIM          0xff001001      /* port size 16bit */
 #define CONFIG_SYS_OR0_PRELIM          0xff006ff7      /* 16MB Boot Flash area*/
 
 #define CONFIG_SYS_BR1_PRELIM          0xfe001001      /* port size 16bit */
 #define CONFIG_SYS_OR1_PRELIM          0xff006ff7      /* 16MB Alternate Boot Flash area*/
 
-#define CONFIG_SYS_BR2_PRELIM          0xf8201001      /* port size 16bit */
+#define CONFIG_SYS_BR2_PRELIM          (BR_PHYS_ADDR(CF_BASE)          \
+                                        | 0x000001001) /* port size 16bit */
 #define CONFIG_SYS_OR2_PRELIM          0xfff06ff7      /* 1MB Compact Flash area*/
 
-#define CONFIG_SYS_BR3_PRELIM          0xf8100801      /* port size 8bit */
+#define CONFIG_SYS_BR3_PRELIM          (BR_PHYS_ADDR(PIXIS_BASE)       \
+                                        | 0x00000801) /* port size 8bit */
 #define CONFIG_SYS_OR3_PRELIM          0xfff06ff7      /* 1MB PIXIS area*/
 
 
 #define CONFIG_FSL_PIXIS       1       /* use common PIXIS code */
-#define PIXIS_BASE     0xf8100000      /* PIXIS registers */
+#define PIXIS_BASE     (CONFIG_SYS_CCSRBAR + 0x00100000) /* PIXIS registers */
 #define PIXIS_ID               0x0     /* Board ID at offset 0 */
 #define PIXIS_VER              0x1     /* Board version at offset 1 */
 #define PIXIS_PVER             0x2     /* PIXIS FPGA version at offset 2 */
@@ -193,6 +212,9 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define PIXIS_VCLKL            0x1A    /* VELA VCLKL register */
 #define CONFIG_SYS_PIXIS_VBOOT_MASK    0x40    /* Reset altbank mask*/
 
+/* Compact flash shares a BAT with PIXIS; make sure they're contiguous */
+#define CF_BASE                        (PIXIS_BASE + 0x00100000)
+
 #define CONFIG_SYS_MAX_FLASH_BANKS     2               /* number of banks */
 #define CONFIG_SYS_MAX_FLASH_SECT      128             /* sectors per device */
 
@@ -298,11 +320,13 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define KSEG1ADDR(x)           ({u32 _x=le32_to_cpu(*(u32 *)(x)); (&_x);})
 #define _IO_BASE               0x00000000
 
-#define CONFIG_SYS_PCI2_MEM_BASE       0xa0000000
+#define CONFIG_SYS_PCI2_MEM_BASE       (CONFIG_SYS_PCI1_MEM_BASE \
+                                        + CONFIG_SYS_PCI1_MEM_SIZE)
 #define CONFIG_SYS_PCI2_MEM_PHYS       CONFIG_SYS_PCI2_MEM_BASE
 #define CONFIG_SYS_PCI2_MEM_SIZE       0x20000000      /* 512M */
 #define CONFIG_SYS_PCI2_IO_BASE        0x00000000
-#define CONFIG_SYS_PCI2_IO_PHYS        0xe3000000
+#define CONFIG_SYS_PCI2_IO_PHYS        (CONFIG_SYS_PCI1_IO_PHYS \
+                                + CONFIG_SYS_PCI1_IO_SIZE)
 #define CONFIG_SYS_PCI2_IO_SIZE        0x00100000      /* 1M */
 
 #if defined(CONFIG_PCI)
@@ -331,12 +355,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     15
 #define CONFIG_SYS_OHCI_SWAP_REG_ACCESS        1
 
-#if !defined(CONFIG_PCI_PNP)
-    #define PCI_ENET0_IOADDR   0xe0000000
-    #define PCI_ENET0_MEMADDR  0xe0000000
-    #define PCI_IDSEL_NUMBER   0x0c    /* slot0->3(IDSEL)=12->15 */
-#endif
-
 /*PCIE video card used*/
 #define VIDEO_IO_OFFSET                CONFIG_SYS_PCI2_IO_PHYS
 
@@ -418,26 +436,38 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_IBAT0U      CONFIG_SYS_DBAT0U
 
 /*
- * BAT1                1G     Cache-inhibited, guarded
+ * BAT1                unused
+ */
+#define CONFIG_SYS_DBAT1L      0
+#define CONFIG_SYS_DBAT1U      0
+#define CONFIG_SYS_IBAT1L      0
+#define CONFIG_SYS_IBAT1U      0
+
+/* if CONFIG_PCI:
+ * BAT2                1G     Cache-inhibited, guarded
  * 0x8000_0000 512M   PCI-Express 1 Memory
  * 0xa000_0000 512M   PCI-Express 2 Memory
  *     Changed it for operating from 0xd0000000
- */
-#define CONFIG_SYS_DBAT1L      ( CONFIG_SYS_PCI1_MEM_PHYS | BATL_PP_RW \
-                       | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CONFIG_SYS_DBAT1U      (CONFIG_SYS_PCI1_MEM_PHYS | BATU_BL_1G | BATU_VS | BATU_VP)
-#define CONFIG_SYS_IBAT1L      (CONFIG_SYS_PCI1_MEM_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
-#define CONFIG_SYS_IBAT1U      CONFIG_SYS_DBAT1U
-
-/*
+ *
+ * if CONFIG_RIO
  * BAT2                512M   Cache-inhibited, guarded
  * 0xc000_0000 512M   RapidIO Memory
  */
+#ifdef CONFIG_PCI
+#define CONFIG_SYS_DBAT2L      (CONFIG_SYS_PCI1_MEM_PHYS | BATL_PP_RW \
+                                | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CONFIG_SYS_DBAT2U      (CONFIG_SYS_PCI1_MEM_PHYS | BATU_BL_1G \
+                                | BATU_VS | BATU_VP)
+#define CONFIG_SYS_IBAT2L      (CONFIG_SYS_PCI1_MEM_PHYS | BATL_PP_RW \
+                                | BATL_CACHEINHIBIT)
+#define CONFIG_SYS_IBAT2U      CONFIG_SYS_DBAT2U
+#else /* CONFIG_RIO */
 #define CONFIG_SYS_DBAT2L      (CONFIG_SYS_RIO_MEM_PHYS | BATL_PP_RW \
                        | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT2U      (CONFIG_SYS_RIO_MEM_PHYS | BATU_BL_512M | BATU_VS | BATU_VP)
 #define CONFIG_SYS_IBAT2L      (CONFIG_SYS_RIO_MEM_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CONFIG_SYS_IBAT2U      CONFIG_SYS_DBAT2U
+#endif
 
 /*
  * BAT3                4M     Cache-inhibited, guarded
index 09a990111b91f6cbb49e081098c8e149f984cf38..e8216ea358f288f82b27cc14a7301042dc8b977b 100644 (file)
 
 #define CONFIG_SYS_RESET_ADDRESS    0xfff00100
 
+/*
+ * virtual address to be used for temporary mappings.  There
+ * should be 128k free at this VA.
+ */
+#define CONFIG_SYS_SCRATCH_VA  0xe8000000
+
 #define CONFIG_PCI             1       /* Enable PCIE */
 #define CONFIG_PCI1            1       /* PCIE controler 1 (slot 1) */
 #define CONFIG_PCI2            1       /* PCIE controler 2 (slot 2) */
 #define CONFIG_SYS_DDR_SDRAM_BASE2     0x10000000      /* DDR bank 2 */
 #define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_SDRAM_BASE
 #define CONFIG_SYS_SDRAM_BASE2         CONFIG_SYS_DDR_SDRAM_BASE2
+#define CONFIG_SYS_MAX_DDR_BAT_SIZE    0x80000000      /* BAT mapping size */
 #define CONFIG_VERY_BIG_RAM
 
 #define MPC86xx_DDR_SDRAM_CLK_CNTL