]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Merge with /home/wd/git/u-boot/custodian/u-boot-mpc85xx
authorWolfgang Denk <wd@denx.de>
Sun, 5 Aug 2007 22:55:51 +0000 (00:55 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 5 Aug 2007 22:55:51 +0000 (00:55 +0200)
34 files changed:
MAKEALL
Makefile
board/esd/cpci750/sdram_init.c
board/freescale/common/pixis.c
board/mpc8641hpcn/mpc8641hpcn.c
board/mpc8641hpcn/sys_eeprom.c
board/mpc8641hpcn/u-boot.lds
board/spc1920/hpi.c
board/trab/Makefile
common/exports.c
cpu/mpc86xx/Makefile
cpu/mpc86xx/interrupts.c
cpu/mpc86xx/pci.c [deleted file]
cpu/mpc86xx/pcie_indirect.c [deleted file]
drivers/Makefile
drivers/ahci.c
drivers/fsl_pci_init.c [new file with mode: 0644]
include/_exports.h
include/asm-ppc/immap_fsl_pci.h [new file with mode: 0644]
include/configs/GEN860T.h
include/configs/LANTEC.h
include/configs/MPC8260ADS.h
include/configs/MPC8266ADS.h
include/configs/MPC8313ERDB.h
include/configs/MPC8641HPCN.h
include/configs/RBC823.h
include/configs/ep8260.h
include/configs/gw8260.h
include/configs/hymod.h
include/configs/mpc7448hpc2.h
include/configs/ppmc7xx.h
include/configs/sbc8349.h
include/exports.h
include/pci.h

diff --git a/MAKEALL b/MAKEALL
index a53500053e9acc12db36f28c091adbeae12db367..0721472c0ecc590d6f077a3570d60478c167ea35 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -133,8 +133,9 @@ LIST_8260=" \
 #########################################################################
 
 LIST_83xx="    \
-       MPC8313ERDB     MPC832XEMDS     MPC8349EMDS     MPC8349ITX      \
-       MPC8349ITXGP    MPC8360EMDS     sbc8349         TQM834x         \
+       MPC8313ERDB_33  MPC8313ERDB_66  MPC832XEMDS     MPC8349EMDS     \
+       MPC8349ITX      MPC8349ITXGP    MPC8360EMDS     sbc8349         \
+       TQM834x                                                         \
 "
 
 
index 13793187da3366c2ae74a41ef0fb6a575c73dfee..4fdd485fb73ab67a1a2836cdd1139cebcbd87f20 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1020,9 +1020,8 @@ acadia_config:    unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx acadia amcc
 
 acadia_nand_config:    unconfig
-       @mkdir -p $(obj)include
-       @mkdir -p $(obj)nand_spl
-       @mkdir -p $(obj)board/amcc/acadia
+       @mkdir -p $(obj)include $(obj)board/amcc/acadia
+       @mkdir -p $(obj)nand_spl/board/amcc/acadia
        @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
        @$(MKCONFIG) -n $@ -a acadia ppc ppc4xx acadia amcc
        @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/acadia/config.tmp
@@ -1050,9 +1049,8 @@ bamboo_config:    unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx bamboo amcc
 
 bamboo_nand_config:    unconfig
-       @mkdir -p $(obj)include
-       @mkdir -p $(obj)nand_spl
-       @mkdir -p $(obj)board/amcc/bamboo
+       @mkdir -p $(obj)include $(obj)board/amcc/bamboo
+       @mkdir -p $(obj)nand_spl/board/amcc/bamboo
        @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
        @$(MKCONFIG) -n $@ -a bamboo ppc ppc4xx bamboo amcc
        @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/bamboo/config.tmp
@@ -1233,9 +1231,8 @@ rainier_config: unconfig
 
 sequoia_nand_config \
 rainier_nand_config: unconfig
-       @mkdir -p $(obj)include
-       @mkdir -p $(obj)nand_spl
-       @mkdir -p $(obj)board/amcc/sequoia
+       @mkdir -p $(obj)include $(obj)board/amcc/sequoia
+       @mkdir -p $(obj)nand_spl/board/amcc/sequoia
        @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
        @echo "#define CONFIG_$$(echo $(subst ,,$(@:_config=)) | \
                tr '[:lower:]' '[:upper:]')" >> $(obj)include/config.h
@@ -1651,14 +1648,15 @@ r5200_config :          unconfig
 
 MPC8313ERDB_33_config \
 MPC8313ERDB_66_config: unconfig
-       @echo "" >include/config.h ; \
+       @mkdir -p $(obj)include
+       @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "...33M ..." ; \
-               echo "#define CFG_33MHZ" >>include/config.h ; \
+               echo "...33M ..." ; \
+               echo "#define CFG_33MHZ" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _66_,$@)" ] ; then \
-               echo -n "...66M..." ; \
-               echo "#define CFG_66MHZ" >>include/config.h ; \
+               echo "...66M..." ; \
+               echo "#define CFG_66MHZ" >>$(obj)include/config.h ; \
        fi ;
        @$(MKCONFIG) -a MPC8313ERDB ppc mpc83xx mpc8313erdb
 
@@ -1666,23 +1664,24 @@ MPC832XEMDS_config \
 MPC832XEMDS_HOST_33_config \
 MPC832XEMDS_HOST_66_config \
 MPC832XEMDS_SLAVE_config:      unconfig
-       @echo "" >include/config.h ; \
+       @mkdir -p $(obj)include
+       @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _HOST_,$@)" ] ; then \
-               echo -n "... PCI HOST " ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
+               echo "... PCI HOST " ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _SLAVE_,$@)" ] ; then \
                echo "...PCI SLAVE 66M"  ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
-               echo "#define CONFIG_PCISLAVE" >>include/config.h ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
+               echo "#define CONFIG_PCISLAVE" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "...33M ..." ; \
-               echo "#define PCI_33M" >>include/config.h ; \
+               echo "...33M ..." ; \
+               echo "#define PCI_33M" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _66_,$@)" ] ; then \
-               echo -n "...66M..." ; \
-               echo "#define PCI_66M" >>include/config.h ; \
+               echo "...66M..." ; \
+               echo "#define PCI_66M" >>$(obj)include/config.h ; \
        fi ;
        @$(MKCONFIG) -a MPC832XEMDS ppc mpc83xx mpc832xemds
 
@@ -1707,23 +1706,24 @@ MPC8360EMDS_config \
 MPC8360EMDS_HOST_33_config \
 MPC8360EMDS_HOST_66_config \
 MPC8360EMDS_SLAVE_config:      unconfig
-       @echo "" >include/config.h ; \
+       @mkdir -p $(obj)include
+       @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _HOST_,$@)" ] ; then \
-               echo -n "... PCI HOST " ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
+               echo "... PCI HOST " ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _SLAVE_,$@)" ] ; then \
                echo "...PCI SLAVE 66M"  ; \
-               echo "#define CONFIG_PCI" >>include/config.h ; \
-               echo "#define CONFIG_PCISLAVE" >>include/config.h ; \
+               echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \
+               echo "#define CONFIG_PCISLAVE" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "...33M ..." ; \
-               echo "#define PCI_33M" >>include/config.h ; \
+               echo "...33M ..." ; \
+               echo "#define PCI_33M" >>$(obj)include/config.h ; \
        fi ; \
        if [ "$(findstring _66_,$@)" ] ; then \
-               echo -n "...66M..." ; \
-               echo "#define PCI_66M" >>include/config.h ; \
+               echo "...66M..." ; \
+               echo "#define PCI_66M" >>$(obj)include/config.h ; \
        fi ;
        @$(MKCONFIG) -a MPC8360EMDS ppc mpc83xx mpc8360emds
 
@@ -1749,10 +1749,10 @@ MPC8540EVAL_66_slave_config:      unconfig
        @mkdir -p $(obj)include
        @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _33_,$@)" ] ; then \
-               echo -n "... 33 MHz PCI" ; \
+               echo "... 33 MHz PCI" ; \
        else \
                echo "#define CONFIG_SYSCLK_66M" >>$(obj)include/config.h ; \
-               echo -n "... 66 MHz PCI" ; \
+               echo "... 66 MHz PCI" ; \
        fi ; \
        if [ "$(findstring _slave_,$@)" ] ; then \
                echo "#define CONFIG_PCI_SLAVE" >>$(obj)include/config.h ; \
@@ -2013,13 +2013,13 @@ omap1610h2_cs3boot_config \
 omap1610h2_cs_autoboot_config: unconfig
        @mkdir -p $(obj)include
        @if [ "$(findstring _cs0boot_, $@)" ] ; then \
-               echo "#define CONFIG_CS0_BOOT" >> .$(obj)/include/config.h ; \
+               echo "#define CONFIG_CS0_BOOT" >> .$(obj)include/config.h ; \
                echo "... configured for CS0 boot"; \
        elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
-               echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)./include/config.h ; \
+               echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)include/config.h ; \
                echo "... configured for CS_AUTO boot"; \
        else \
-               echo "#define CONFIG_CS3_BOOT" >> $(obj)./include/config.h ; \
+               echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
                echo "... configured for CS3 boot"; \
        fi;
        @$(MKCONFIG) -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn NULL omap
@@ -2188,11 +2188,12 @@ logodl_config   :       unconfig
 
 pdnb3_config \
 scpu_config:    unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring scpu_,$@)" ] ; then \
-               echo "#define CONFIG_SCPU"      >>include/config.h ; \
+               echo "#define CONFIG_SCPU"      >>$(obj)include/config.h ; \
                echo "... on SCPU board variant" ; \
        else \
-               >include/config.h ; \
+               >$(obj)include/config.h ; \
        fi
        @$(MKCONFIG) -a pdnb3 arm ixp pdnb3 prodrive
 
@@ -2414,13 +2415,15 @@ suzaku_config:  unconfig
        @$(MKCONFIG) -a $(@:_config=) microblaze microblaze suzaku AtmarkTechno
 
 ml401_config:  unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_ML401 1" >> include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_ML401 1" >> $(obj)include/config.h
        @$(MKCONFIG) -a $(@:_config=) microblaze microblaze ml401 xilinx
 
 xupv2p_config: unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_XUPV2P 1" >> include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_XUPV2P 1" >> $(obj)include/config.h
        @$(MKCONFIG) -a $(@:_config=) microblaze microblaze xupv2p xilinx
 
 #########################################################################
index c094755351cdb831f346e359ba66cac68af87c44..78d18801854658a817ff56e83357e6ff25f4091a 100644 (file)
@@ -1252,7 +1252,7 @@ static int check_dimm (uchar slot, AUX_MEM_DIMM_INFO * dimmInfo)
 /* sets up the GT properly with information passed in */
 int setup_sdram (AUX_MEM_DIMM_INFO * info)
 {
-       ulong tmp, check;
+       ulong tmp;
        ulong tmp_sdram_mode = 0;       /* 0x141c */
        ulong tmp_dunit_control_low = 0;        /* 0x1404 */
        int i;
index af98157dfd724d51acedd911a5e74c6b2aacc616..99cc2ee197ed1e1e8a83c5dc1a6cca974b0925fb 100644 (file)
@@ -321,10 +321,10 @@ static ulong strfractoint(uchar *strptr)
                mulconst = 1;
                for (i = 0; i < decarr_len; i++)
                        mulconst *= 10;
-               decval = simple_strtoul(decarr, NULL, 10);
+               decval = simple_strtoul((char *)decarr, NULL, 10);
        }
 
-       intval = simple_strtoul(intarr, NULL, 10);
+       intval = simple_strtoul((char *)intarr, NULL, 10);
        intval = intval * mulconst;
 
        retval = intval + decval;
@@ -362,7 +362,7 @@ pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
                val = set_px_sysclk(simple_strtoul(argv[2], NULL, 10));
 
-               corepll = strfractoint(argv[3]);
+               corepll = strfractoint((uchar *)argv[3]);
                val = val + set_px_corepll(corepll);
                val = val + set_px_mpxpll(simple_strtoul(argv[4], NULL, 10));
                if (val == 3) {
@@ -410,7 +410,7 @@ pixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        read_from_px_regs(0);
                        read_from_px_regs_altbank(0);
                        val = set_px_sysclk(simple_strtoul(argv[3], NULL, 10));
-                       corepll = strfractoint(argv[4]);
+                       corepll = strfractoint((uchar *)argv[4]);
                        val = val + set_px_corepll(corepll);
                        val = val + set_px_mpxpll(simple_strtoul(argv[5],
                                                                 NULL, 10));
index 7d7e2afad31cc1389e4a3dcdf404d42448dac0e4..d2182aba5f0483c99e5698f702307d868318cbea 100644 (file)
@@ -11,7 +11,7 @@
  *
  * 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
+ * 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
@@ -24,6 +24,7 @@
 #include <pci.h>
 #include <asm/processor.h>
 #include <asm/immap_86xx.h>
+#include <asm/immap_fsl_pci.h>
 #include <spd.h>
 #include <asm/io.h>
 
@@ -55,36 +56,6 @@ int checkboard(void)
 {
        puts("Board: MPC8641HPCN\n");
 
-#ifdef CONFIG_PCI
-
-       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_gur_t *gur = &immap->im_gur;
-       volatile ccsr_pex_t *pex1 = &immap->im_pex1;
-
-       uint devdisr = gur->devdisr;
-       uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
-       uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
-       uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
-
-       if ((io_sel == 2 || io_sel == 3 || io_sel == 5
-            || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
-           && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
-               debug("PCI-EXPRESS 1: %s \n", pex1_agent ? "Agent" : "Host");
-               debug("0x%08x=0x%08x ", &pex1->pme_msg_det, pex1->pme_msg_det);
-               if (pex1->pme_msg_det) {
-                       pex1->pme_msg_det = 0xffffffff;
-                       debug(" with errors.  Clearing.  Now 0x%08x",
-                             pex1->pme_msg_det);
-               }
-               debug("\n");
-       } else {
-               puts("PCI-EXPRESS 1: Disabled\n");
-       }
-
-#else
-       puts("PCI-EXPRESS1: Disabled\n");
-#endif
-
        return 0;
 }
 
@@ -219,21 +190,138 @@ static struct pci_config_table pci_fsl86xxads_config_table[] = {
 #endif
 
 
-static struct pci_controller hose = {
+static struct pci_controller pci1_hose = {
 #ifndef CONFIG_PCI_PNP
-      config_table:pci_mpc86xxcts_config_table,
+       config_table:pci_mpc86xxcts_config_table
 #endif
 };
-
 #endif /* CONFIG_PCI */
 
+#ifdef CONFIG_PCI2
+static struct pci_controller pci2_hose;
+#endif /* CONFIG_PCI2 */
+
+int first_free_busno = 0;
+
+
 void pci_init_board(void)
 {
-#ifdef CONFIG_PCI
-       extern void pci_mpc86xx_init(struct pci_controller *hose);
+       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
+       volatile ccsr_gur_t *gur = &immap->im_gur;
+       uint devdisr = gur->devdisr;
+       uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
+
+#ifdef CONFIG_PCI1
+{
+       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CFG_PCI1_ADDR;
+       extern void fsl_pci_init(struct pci_controller *hose);
+       struct pci_controller *hose = &pci1_hose;
+#ifdef DEBUG
+       uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
+       uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
+#endif
+       if ((io_sel == 2 || io_sel == 3 || io_sel == 5
+            || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
+           && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
+               debug("PCI-EXPRESS 1: %s \n", pex1_agent ? "Agent" : "Host");
+               debug("0x%08x=0x%08x ", &pci->pme_msg_det, pci->pme_msg_det);
+               if (pci->pme_msg_det) {
+                       pci->pme_msg_det = 0xffffffff;
+                       debug(" with errors.  Clearing.  Now 0x%08x",
+                             pci->pme_msg_det);
+               }
+               debug("\n");
+
+               /* inbound */
+               pci_set_region(hose->regions + 0,
+                              CFG_PCI_MEMORY_BUS,
+                              CFG_PCI_MEMORY_PHYS,
+                              CFG_PCI_MEMORY_SIZE,
+                              PCI_REGION_MEM | PCI_REGION_MEMORY);
+
+               /* outbound memory */
+               pci_set_region(hose->regions + 1,
+                              CFG_PCI1_MEM_BASE,
+                              CFG_PCI1_MEM_PHYS,
+                              CFG_PCI1_MEM_SIZE,
+                              PCI_REGION_MEM);
+
+               /* outbound io */
+               pci_set_region(hose->regions + 2,
+                              CFG_PCI1_IO_BASE,
+                              CFG_PCI1_IO_PHYS,
+                              CFG_PCI1_IO_SIZE,
+                              PCI_REGION_IO);
+
+               hose->region_count = 3;
+
+               hose->first_busno=first_free_busno;
+               pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
+
+               fsl_pci_init(hose);
+
+               first_free_busno=hose->last_busno+1;
+               printf ("    PCI-EXPRESS 1 on bus %02x - %02x\n",
+                       hose->first_busno,hose->last_busno);
+
+               /*
+                * Activate ULI1575 legacy chip by performing a fake
+                * memory access.  Needed to make ULI RTC work.
+                */
+               in_be32((unsigned *) CFG_PCI1_MEM_BASE
+                       + CFG_PCI1_MEM_SIZE - 0x1000000);
+
+       } else {
+               puts("PCI-EXPRESS 1: Disabled\n");
+       }
+}
+#else
+       puts("PCI-EXPRESS1: Disabled\n");
+#endif /* CONFIG_PCI1 */
+
+#ifdef CONFIG_PCI2
+{
+       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) CFG_PCI2_ADDR;
+       extern void fsl_pci_init(struct pci_controller *hose);
+       struct pci_controller *hose = &pci2_hose;
+
+
+       /* inbound */
+       pci_set_region(hose->regions + 0,
+                      CFG_PCI_MEMORY_BUS,
+                      CFG_PCI_MEMORY_PHYS,
+                      CFG_PCI_MEMORY_SIZE,
+                      PCI_REGION_MEM | PCI_REGION_MEMORY);
+
+       /* outbound memory */
+       pci_set_region(hose->regions + 1,
+                      CFG_PCI2_MEM_BASE,
+                      CFG_PCI2_MEM_PHYS,
+                      CFG_PCI2_MEM_SIZE,
+                      PCI_REGION_MEM);
+
+       /* outbound io */
+       pci_set_region(hose->regions + 2,
+                      CFG_PCI2_IO_BASE,
+                      CFG_PCI2_IO_PHYS,
+                      CFG_PCI2_IO_SIZE,
+                      PCI_REGION_IO);
+
+       hose->region_count = 3;
+
+       hose->first_busno=first_free_busno;
+       pci_setup_indirect(hose, (int) &pci->cfg_addr, (int) &pci->cfg_data);
+
+       fsl_pci_init(hose);
+
+       first_free_busno=hose->last_busno+1;
+       printf ("    PCI-EXPRESS 2 on bus %02x - %02x\n",
+               hose->first_busno,hose->last_busno);
+}
+#else
+       puts("PCI-EXPRESS 2: Disabled\n");
+#endif /* CONFIG_PCI2 */
 
-       pci_mpc86xx_init(&hose);
-#endif /* CONFIG_PCI */
 }
 
 #if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
index 74e2a3d46ffd9cf6a0ba66d0b88a7a9927f43426..7bc663bba464f765a35f9c8fe725086a5f8c7ec9 100644 (file)
@@ -68,7 +68,7 @@ int mac_show(void)
               mac_data.date[5],
               mac_data.date[6]);
        for (i = 0; i < 8; i++) {
-               sprintf(ethaddr[i],
+               sprintf((char *)ethaddr[i],
                        "%02x:%02x:%02x:%02x:%02x:%02x",
                        mac_data.mac[i][0],
                        mac_data.mac[i][1],
@@ -79,10 +79,10 @@ int mac_show(void)
                printf("MAC %d %s\n", i, ethaddr[i]);
        }
 
-       setenv("ethaddr", ethaddr[0]);
-       setenv("eth1addr", ethaddr[1]);
-       setenv("eth2addr", ethaddr[2]);
-       setenv("eth3addr", ethaddr[3]);
+       setenv("ethaddr",  (char *)ethaddr[0]);
+       setenv("eth1addr", (char *)ethaddr[1]);
+       setenv("eth2addr", (char *)ethaddr[2]);
+       setenv("eth3addr", (char *)ethaddr[3]);
 
        return 0;
 }
@@ -236,7 +236,7 @@ int mac_read_from_eeprom(void)
        } else {
                for (i = 0; i < 4; i++) {
                        if (memcmp(&mac_data.mac[i], "\0\0\0\0\0\0", 6)) {
-                               sprintf(ethaddr[i],
+                               sprintf((char *)ethaddr[i],
                                        "%02x:%02x:%02x:%02x:%02x:%02x",
                                        mac_data.mac[i][0],
                                        mac_data.mac[i][1],
@@ -244,10 +244,10 @@ int mac_read_from_eeprom(void)
                                        mac_data.mac[i][3],
                                        mac_data.mac[i][4],
                                        mac_data.mac[i][5]);
-                               sprintf(enetvar,
+                               sprintf((char *)enetvar,
                                        i ? "eth%daddr" : "ethaddr",
                                        i);
-                               setenv(enetvar, ethaddr[i]);
+                               setenv((char *)enetvar, (char *)ethaddr[i]);
                        }
                }
        }
index 34b50e4be208c69336d572b343846cb5fac96419..e4792ef1998284a10749db42b9269786c9428235 100644 (file)
@@ -57,7 +57,6 @@ SECTIONS
     cpu/mpc86xx/cpu_init.o (.text)
     cpu/mpc86xx/cpu.o (.text)
     cpu/mpc86xx/speed.o (.text)
-    cpu/mpc86xx/pci.o (.text)
     common/dlmalloc.o (.text)
     lib_generic/crc32.o (.text)
     lib_ppc/extable.o (.text)
index 3c36f7911bc216b8ff18cb57939d93669bb3c9b3..cd7799b277b6b97c68bfc02b97b8abacd260bcfd 100644 (file)
@@ -122,7 +122,9 @@ const uint dsp_table_fast[] =
 #define TINY_AUTOINC_BASE_ADDR 0x0
 
 static int hpi_activate(void);
+#if 0
 static void hpi_inactivate(void);
+#endif
 static void dsp_reset(void);
 
 static int hpi_write_inc(u32 addr, u32 *data, u32 count);
@@ -133,7 +135,9 @@ static u32 hpi_read_noinc(u32 addr);
 int hpi_test(void);
 static int hpi_write_addr_test(u32 addr);
 static int hpi_read_write_test(u32 addr, u32 data);
+#ifdef DO_TINY_TEST
 static int hpi_tiny_autoinc_test(void);
+#endif /* DO_TINY_TEST */
 #endif /* CONFIG_SPC1920_HPI_TEST */
 
 
@@ -185,6 +189,7 @@ static int hpi_activate(void)
        return 0;
 }
 
+#if 0
 /* turn off the host port interface */
 static void hpi_inactivate(void)
 {
@@ -200,6 +205,7 @@ static void hpi_inactivate(void)
        /* currently always on TBD */
 
 }
+#endif
 
 /* reset the DSP */
 static void dsp_reset(void)
@@ -570,6 +576,7 @@ static int hpi_read_write_test(u32 addr, u32 data)
        return 0;
 }
 
+#ifdef DO_TINY_TEST
 static int hpi_tiny_autoinc_test(void)
 {
        int i;
@@ -599,5 +606,6 @@ static int hpi_tiny_autoinc_test(void)
        }
        return 0;
 }
+#endif /* DO_TINY_TEST */
 
 #endif /* CONFIG_SPC1920_HPI_TEST */
index 868ca4281f180a6b0c105cd9ce0529e4e5da59bc..fbe1c3640fc661ab1218d8a83d9c1eaff316ed7d 100644 (file)
@@ -50,7 +50,6 @@ $(LIB):       $(obj).depend $(OBJS) $(SOBJS)
 $(obj)trab_fkt.srec:   $(OBJS_FKT) $(LIB)
        $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e trab_fkt $^ $(LIB) \
                -L$(obj)../../examples -lstubs \
-               -L$(obj)../../lib_generic -lgeneric \
                -L$(gcclibdir) -lgcc
        $(OBJCOPY) -O srec $(<:.o=) $@
 
index a579554ab52a0de8a47e08eef84746025ff0535c..ec4656bfbd172116be925a860cccb84d1c23ca77 100644 (file)
@@ -28,6 +28,8 @@ void jumptable_init (void)
        gd->jt[XF_get_timer] = (void *) get_timer;
        gd->jt[XF_simple_strtoul] = (void *) simple_strtoul;
        gd->jt[XF_udelay] = (void *) udelay;
+       gd->jt[XF_simple_strtol] = (void *) simple_strtol;
+       gd->jt[XF_strcmp] = (void *) strcmp;
 #if defined(CONFIG_I386) || defined(CONFIG_PPC)
        gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
        gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
index fffcfd24029fbdea9f5f8150fdcc68189be22683..6d9300e22e7e18e7b71d09f4c4ba56d2ae2efc7b 100644 (file)
@@ -1,4 +1,5 @@
 #
+# Copyright 2007 Freescale Semiconductor, Inc.
 # (C) Copyright 2002,2003 Motorola Inc.
 # Xianghua Xiao,X.Xiao@motorola.com
 #
@@ -30,7 +31,7 @@ LIB   = $(obj)lib$(CPU).a
 START  = start.o #resetvec.o
 SOBJS  = cache.o
 COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o \
-         pci.o pcie_indirect.o spd_sdram.o
+         spd_sdram.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
index 49820bbd81138fdb0675d5c62bf6b8651d84ddf4..08e0675fee4035179ed6eeeccac1c4ac0aa0feef 100644 (file)
@@ -71,7 +71,7 @@ static __inline__ void set_dec(unsigned long val)
 }
 
 /* interrupt is not supported yet */
-int interrupt_init_cpu(unsigned *decrementer_count)
+int interrupt_init_cpu(unsigned long *decrementer_count)
 {
        return 0;
 }
@@ -107,7 +107,7 @@ int interrupt_init(void)
                return ret;
 
        decrementer_count = get_tbclk() / CFG_HZ;
-       debug("interrupt init: tbclk() = %d MHz, decrementer_count = %d\n",
+       debug("interrupt init: tbclk() = %d MHz, decrementer_count = %ld\n",
              (get_tbclk() / 1000000),
              decrementer_count);
 
@@ -158,7 +158,7 @@ void timer_interrupt(struct pt_regs *regs)
 
        timestamp++;
 
-       ppcDcbf(&timestamp);
+       ppcDcbf((unsigned long)&timestamp);
 
        /* Restore Decrementer Count */
        set_dec(decrementer_count);
diff --git a/cpu/mpc86xx/pci.c b/cpu/mpc86xx/pci.c
deleted file mode 100644 (file)
index b86548d..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) Freescale Semiconductor,Inc.
- * 2005, 2006. All rights reserved.
- *
- * Ed Swarthout (ed.swarthout@freescale.com)
- * Jason Jin (Jason.jin@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
- */
-
-/*
- * PCIE Configuration space access support for PCIE Bridge
- */
-#include <common.h>
-#include <pci.h>
-
-#if defined(CONFIG_PCI)
-void
-pci_mpc86xx_init(struct pci_controller *hose)
-{
-       volatile immap_t *immap = (immap_t *) CFG_CCSRBAR;
-       volatile ccsr_pex_t *pcie1 = &immap->im_pex1;
-       u16 temp16;
-       u32 temp32;
-
-       volatile ccsr_gur_t *gur = &immap->im_gur;
-       uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
-       uint pcie1_host = (host1_agent == 2) || (host1_agent == 3);
-       uint pcie1_agent = (host1_agent == 0) || (host1_agent == 1);
-       uint devdisr = gur->devdisr;
-       uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
-
-       if ((io_sel == 2 || io_sel == 3 || io_sel == 5 || io_sel == 6 ||
-            io_sel == 7 || io_sel == 0xf)
-           && !(devdisr & MPC86xx_DEVDISR_PCIEX1)) {
-               printf("PCI-EXPRESS 1: Configured as %s \n",
-                      pcie1_agent ? "Agent" : "Host");
-               if (pcie1_agent)
-                       return; /*Don't scan bus when configured as agent */
-               printf("               Scanning PCIE bus");
-               debug("0x%08x=0x%08x ",
-                     &pcie1->pme_msg_det,
-                     pcie1->pme_msg_det);
-               if (pcie1->pme_msg_det) {
-                       pcie1->pme_msg_det = 0xffffffff;
-                       debug(" with errors.  Clearing.  Now 0x%08x",
-                             pcie1->pme_msg_det);
-               }
-               debug("\n");
-       } else {
-               printf("PCI-EXPRESS 1 disabled!\n");
-               return;
-       }
-
-       /*
-        * Set first_bus=0 only skipped B0:D0:F0 which is
-        * a reserved device in M1575, but make it easy for
-        * most of the scan process.
-        */
-       hose->first_busno = 0x00;
-       hose->last_busno = 0xfe;
-
-       pcie_setup_indirect(hose, (CFG_IMMR + 0x8000), (CFG_IMMR + 0x8004));
-
-       pci_hose_read_config_word(hose,
-                                 PCI_BDF(0, 0, 0), PCI_COMMAND, &temp16);
-       temp16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER |
-           PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
-       pci_hose_write_config_word(hose,
-                                  PCI_BDF(0, 0, 0), PCI_COMMAND, temp16);
-
-       pci_hose_write_config_word(hose, PCI_BDF(0, 0, 0), PCI_STATUS, 0xffff);
-       pci_hose_write_config_byte(hose,
-                                  PCI_BDF(0, 0, 0), PCI_LATENCY_TIMER, 0x80);
-
-       pci_hose_read_config_dword(hose, PCI_BDF(0, 0, 0), PCI_PRIMARY_BUS,
-                                  &temp32);
-       temp32 = (temp32 & 0xff000000) | (0xff) | (0x0 << 8) | (0xfe << 16);
-       pci_hose_write_config_dword(hose, PCI_BDF(0, 0, 0), PCI_PRIMARY_BUS,
-                                   temp32);
-
-       pcie1->powar1 = 0;
-       pcie1->powar2 = 0;
-       pcie1->piwar1 = 0;
-       pcie1->piwar1 = 0;
-
-       pcie1->powbar1 = (CFG_PCI1_MEM_BASE >> 12) & 0x000fffff;
-       pcie1->powar1 = 0x8004401c;     /* 512M MEM space */
-       pcie1->potar1 = (CFG_PCI1_MEM_BASE >> 12) & 0x000fffff;
-       pcie1->potear1 = 0x00000000;
-
-       pcie1->powbar2 = (CFG_PCI1_IO_BASE >> 12) & 0x000fffff;
-       pcie1->powar2 = 0x80088017;     /* 16M IO space */
-       pcie1->potar2 = 0x00000000;
-       pcie1->potear2 = 0x00000000;
-
-       pcie1->pitar1 = 0x00000000;
-       pcie1->piwbar1 = 0x00000000;
-       /* Enable, Prefetch, Local Mem, * Snoop R/W, 2G */
-       pcie1->piwar1 = 0xa0f5501e;
-
-       pci_set_region(hose->regions + 0,
-                      CFG_PCI_MEMORY_BUS,
-                      CFG_PCI_MEMORY_PHYS,
-                      CFG_PCI_MEMORY_SIZE,
-                      PCI_REGION_MEM | PCI_REGION_MEMORY);
-
-       pci_set_region(hose->regions + 1,
-                      CFG_PCI1_MEM_BASE,
-                      CFG_PCI1_MEM_PHYS,
-                      CFG_PCI1_MEM_SIZE,
-                      PCI_REGION_MEM);
-
-       pci_set_region(hose->regions + 2,
-                      CFG_PCI1_IO_BASE,
-                      CFG_PCI1_IO_PHYS,
-                      CFG_PCI1_IO_SIZE,
-                      PCI_REGION_IO);
-
-       hose->region_count = 3;
-
-       pci_register_hose(hose);
-
-       hose->last_busno = pci_hose_scan(hose);
-       debug("pcie_mpc86xx_init: last_busno %x\n", hose->last_busno);
-       debug("pcie_mpc86xx init: current_busno %x\n ", hose->current_busno);
-
-       printf("....PCIE1 scan & enumeration done\n");
-}
-#endif                         /* CONFIG_PCI */
diff --git a/cpu/mpc86xx/pcie_indirect.c b/cpu/mpc86xx/pcie_indirect.c
deleted file mode 100644 (file)
index b00ad76..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Support for indirect PCI bridges.
- *
- * Copyright (c) Freescale Semiconductor, Inc.
- * 2006. All rights reserved.
- *
- * Jason Jin <Jason.jin@freescale.com>
- *
- * 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.
- *
- * partly derived from
- * arch/powerpc/platforms/86xx/mpc86xx_pcie.c
- */
-
-#include <common.h>
-
-#ifdef CONFIG_PCI
-
-#include <asm/processor.h>
-#include <asm/io.h>
-#include <pci.h>
-
-#define PCI_CFG_OUT    out_be32
-#define PEX_FIX                out_be32(hose->cfg_addr+0x4, 0x0400ffff)
-
-static int
-indirect_read_config_pcie(struct pci_controller *hose,
-                         pci_dev_t dev,
-                         int offset,
-                         int len,
-                         u32 *val)
-{
-       int bus = PCI_BUS(dev);
-
-       volatile unsigned char *cfg_data;
-       u32 temp;
-
-       PEX_FIX;
-       if (bus == 0xff) {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000001);
-       } else {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000000);
-       }
-       /*
-        * Note: the caller has already checked that offset is
-        * suitably aligned and that len is 1, 2 or 4.
-        */
-       /* ERRATA PCI-Ex 12 - Configuration Address/Data Alignment */
-       cfg_data = hose->cfg_data;
-       PEX_FIX;
-       temp = in_le32((u32 *) cfg_data);
-       switch (len) {
-       case 1:
-               *val = (temp >> (((offset & 3)) * 8)) & 0xff;
-               break;
-       case 2:
-               *val = (temp >> (((offset & 3)) * 8)) & 0xffff;
-               break;
-       default:
-               *val = temp;
-               break;
-       }
-
-       return 0;
-}
-
-static int
-indirect_write_config_pcie(struct pci_controller *hose,
-                          pci_dev_t dev,
-                          int offset,
-                          int len,
-                          u32 val)
-{
-       int bus = PCI_BUS(dev);
-       volatile unsigned char *cfg_data;
-       u32 temp;
-
-       PEX_FIX;
-       if (bus == 0xff) {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000001);
-       } else {
-               PCI_CFG_OUT(hose->cfg_addr,
-                           dev | (offset & 0xfc) | 0x80000000);
-       }
-
-       /*
-        * Note: the caller has already checked that offset is
-        * suitably aligned and that len is 1, 2 or 4.
-        */
-       /* ERRATA PCI-Ex 12 - Configuration Address/Data Alignment */
-       cfg_data = hose->cfg_data;
-       switch (len) {
-       case 1:
-               PEX_FIX;
-               temp = in_le32((u32 *) cfg_data);
-               temp = (temp & ~(0xff << ((offset & 3) * 8))) |
-                   (val << ((offset & 3) * 8));
-               PEX_FIX;
-               out_le32((u32 *) cfg_data, temp);
-               break;
-       case 2:
-               PEX_FIX;
-               temp = in_le32((u32 *) cfg_data);
-               temp = (temp & ~(0xffff << ((offset & 3) * 8)));
-               temp |= (val << ((offset & 3) * 8));
-               PEX_FIX;
-               out_le32((u32 *) cfg_data, temp);
-               break;
-       default:
-               PEX_FIX;
-               out_le32((u32 *) cfg_data, val);
-               break;
-       }
-       PEX_FIX;
-       return 0;
-}
-
-static int
-indirect_read_config_byte_pcie(struct pci_controller *hose,
-                              pci_dev_t dev,
-                              int offset,
-                              u8 *val)
-{
-       u32 val32;
-       indirect_read_config_pcie(hose, dev, offset, 1, &val32);
-       *val = (u8) val32;
-       return 0;
-}
-
-static int
-indirect_read_config_word_pcie(struct pci_controller *hose,
-                              pci_dev_t dev,
-                              int offset,
-                              u16 *val)
-{
-       u32 val32;
-       indirect_read_config_pcie(hose, dev, offset, 2, &val32);
-       *val = (u16) val32;
-       return 0;
-}
-
-static int
-indirect_read_config_dword_pcie(struct pci_controller *hose,
-                               pci_dev_t dev,
-                               int offset,
-                               u32 *val)
-{
-       return indirect_read_config_pcie(hose, dev, offset, 4, val);
-}
-
-static int
-indirect_write_config_byte_pcie(struct pci_controller *hose,
-                               pci_dev_t dev,
-                               int offset,
-                               u8 val)
-{
-       return indirect_write_config_pcie(hose, dev, offset, 1, (u32) val);
-}
-
-static int
-indirect_write_config_word_pcie(struct pci_controller *hose,
-                               pci_dev_t dev,
-                               int offset,
-                               unsigned short val)
-{
-       return indirect_write_config_pcie(hose, dev, offset, 2, (u32) val);
-}
-
-static int
-indirect_write_config_dword_pcie(struct pci_controller *hose,
-                                pci_dev_t dev,
-                                int offset,
-                                u32 val)
-{
-       return indirect_write_config_pcie(hose, dev, offset, 4, val);
-}
-
-void
-pcie_setup_indirect(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data)
-{
-       pci_set_ops(hose,
-                   indirect_read_config_byte_pcie,
-                   indirect_read_config_word_pcie,
-                   indirect_read_config_dword_pcie,
-                   indirect_write_config_byte_pcie,
-                   indirect_write_config_word_pcie,
-                   indirect_write_config_dword_pcie);
-
-       hose->cfg_addr = (unsigned int *)cfg_addr;
-       hose->cfg_data = (unsigned char *)cfg_data;
-}
-
-#endif                         /* CONFIG_PCI */
index 48fd4eaade0c1c1b1ae193127f418cd42eefe62a..fa2e86fd20f276dd98f4f3c1ad6a370e7415a65a 100644 (file)
@@ -52,7 +52,7 @@ COBJS = 3c589.o 5701rls.o ali512x.o ata_piix.o atmel_usart.o \
          ks8695eth.o \
          pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o  \
          rpx_pcmcia.o \
-         fsl_i2c.o
+         fsl_i2c.o fsl_pci_init.o
 
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
index 8ceff00925fffbe54332da2b9c7b1fa6ab289598..ccd4d71e8ae223328c729257502fbf54917649ea 100644 (file)
@@ -253,7 +253,8 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
 
 static int ahci_init_one(pci_dev_t pdev)
 {
-       u32 iobase, vendor;
+       u32 iobase;
+       u16 vendor;
        int rc;
 
        memset((void *)ataid, 0, sizeof(hd_driveid_t *) * AHCI_MAX_PORTS);
diff --git a/drivers/fsl_pci_init.c b/drivers/fsl_pci_init.c
new file mode 100644 (file)
index 0000000..1d1f6df
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * 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
+ */
+#define DEBUG
+#include <common.h>
+
+#ifdef CONFIG_FSL_PCI_INIT
+
+/*
+ * PCI/PCIE Controller initialization for mpc85xx/mpc86xx soc's
+ *
+ * Initialize controller and call the common driver/pci pci_hose_scan to
+ * scan for bridges and devices.
+ *
+ * Hose fields which need to be pre-initialized by board specific code:
+ *   regions[]
+ *   first_busno
+ *
+ * Fields updated:
+ *   last_busno
+ */
+
+#include <pci.h>
+#include <asm/immap_fsl_pci.h>
+
+void pciauto_prescan_setup_bridge(struct pci_controller *hose,
+                               pci_dev_t dev, int sub_bus);
+void pciauto_postscan_setup_bridge(struct pci_controller *hose,
+                               pci_dev_t dev, int sub_bus);
+
+void pciauto_config_init(struct pci_controller *hose);
+void
+fsl_pci_init(struct pci_controller *hose)
+{
+       u16 temp16;
+       u32 temp32;
+       int busno = hose->first_busno;
+       int enabled;
+       u16 ltssm;
+       u8 temp8;
+       int r;
+       int bridge;
+       volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) hose->cfg_addr;
+       pci_dev_t dev = PCI_BDF(busno,0,0);
+
+       /* Initialize ATMU registers based on hose regions and flags */
+       volatile pot_t *po=&pci->pot[1];        /* skip 0 */
+       volatile pit_t *pi=&pci->pit[0];        /* ranges from: 3 to 1 */
+
+#ifdef DEBUG
+       int neg_link_w;
+#endif
+
+       for (r=0; r<hose->region_count; r++) {
+               if (hose->regions[r].flags & PCI_REGION_MEMORY) { /* inbound */
+                       pi->pitar = (hose->regions[r].bus_start >> 12) & 0x000fffff;
+                       pi->piwbar = (hose->regions[r].phys_start >> 12) & 0x000fffff;
+                       pi->piwbear = 0;
+                       pi->piwar = PIWAR_EN | PIWAR_PF | PIWAR_LOCAL |
+                               PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP |
+                               (__ilog2(hose->regions[r].size) - 1);
+                       pi++;
+               } else { /* Outbound */
+                       po->powbar = (hose->regions[r].phys_start >> 12) & 0x000fffff;
+                       po->potar = (hose->regions[r].bus_start >> 12) & 0x000fffff;
+                       po->potear = 0;
+                       if (hose->regions[r].flags & PCI_REGION_IO)
+                               po->powar = POWAR_EN | POWAR_IO_READ | POWAR_IO_WRITE |
+                                       (__ilog2(hose->regions[r].size) - 1);
+                       else
+                               po->powar = POWAR_EN | POWAR_MEM_READ | POWAR_MEM_WRITE |
+                                       (__ilog2(hose->regions[r].size) - 1);
+                       po++;
+               }
+       }
+
+       pci_register_hose(hose);
+       pciauto_config_init(hose);      /* grab pci_{mem,prefetch,io} */
+       hose->current_busno = hose->first_busno;
+
+       pci->pedr = 0xffffffff;         /* Clear any errors */
+       pci->peer = 0xffffffff;         /* Enable Error Interupts */
+       pci_hose_read_config_dword (hose, dev, PCI_DCR, &temp32);
+       temp32 |= 0xf000e;              /* set URR, FER, NFER (but not CER) */
+       pci_hose_write_config_dword(hose, dev, PCI_DCR, temp32);
+
+       pci_hose_read_config_byte (hose, dev, PCI_HEADER_TYPE, &temp8);
+       bridge = temp8 & PCI_HEADER_TYPE_BRIDGE; /* Bridge, such as pcie */
+
+       if ( bridge ) {
+
+               pci_hose_read_config_word(hose, dev, PCI_LTSSM, &ltssm);
+               enabled = ltssm >= PCI_LTSSM_L0;
+
+               if (!enabled) {
+                       debug("....PCIE link error.  Skipping scan."
+                             "LTSSM=0x%02x\n", temp16);
+                       hose->last_busno = hose->first_busno;
+                       return;
+               }
+
+               pci->pme_msg_det = 0xffffffff;
+               pci->pme_msg_int_en = 0xffffffff;
+#ifdef DEBUG
+               pci_hose_read_config_word(hose, dev, PCI_LSR, &temp16);
+               neg_link_w = (temp16 & 0x3f0 ) >> 4;
+               debug("...PCIE LTSSM=0x%x, Negotiated link width=%d\n",
+                     ltssm, neg_link_w);
+#endif
+               hose->current_busno++; /* Start scan with secondary */
+               pciauto_prescan_setup_bridge(hose, dev, hose->current_busno);
+
+       } else {
+#if 0
+/* done in pci_hose_config_device() */
+               pci_hose_read_config_word(hose, dev, PCI_COMMAND, &temp16);
+               temp16 |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER |
+                       PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
+               pci_hose_write_config_word(hose, dev, PCI_COMMAND, temp16);
+               pci_hose_write_config_word(hose, dev, PCI_STATUS, 0xffff);
+               pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
+#endif
+       }
+
+       /* Call setup to allocate PCSRBAR window */
+       pciauto_setup_device(hose, dev, 1, hose->pci_mem,
+                            hose->pci_prefetch, hose->pci_io);
+
+       printf ("               Scanning PCI bus %02x\n", hose->current_busno);
+       hose->last_busno = pci_hose_scan_bus(hose,hose->current_busno);
+
+       if ( bridge ) { /* update limit regs and subordinate busno */
+               pciauto_postscan_setup_bridge(hose, dev, hose->last_busno);
+       }
+
+       /* Clear all error indications */
+
+       if (pci->pme_msg_det && pci->pme_msg_det != 0xffffffff) {
+               debug("pci_fsl_init: pme_msg_det@%x=%x.  Clearing\n",
+                       &pci->pme_msg_det, pci->pme_msg_det);
+               pci->pme_msg_det = 0xffffffff;
+       }
+
+       if (pci->pedr) {
+               debug("pci_fsl_init: pedr@%x=%x.  Clearing\n",
+                       &pci->pedr, pci->pedr);
+               pci->pedr = 0xffffffff;
+       }
+
+       pci_hose_read_config_word (hose, dev, PCI_DSR, &temp16);
+       if (temp16) {
+               debug("pci_fsl_init: PCI_DSR@%x=%x.  Clearing\n",
+                       PCI_DSR, temp16);
+               pci_hose_write_config_word(hose, dev,
+                                          PCI_DSR, 0xffff);
+       }
+
+       pci_hose_read_config_word (hose, dev, PCI_SEC_STATUS, &temp16);
+       if (temp16) {
+               debug("pci_fsl_init: PCI_SEC_STATUS@%x=%x.  Clearing\n",
+                       PCI_SEC_STATUS, temp16);
+               pci_hose_write_config_word(hose, dev, PCI_SEC_STATUS, 0xffff);
+       }
+}
+
+#endif /* CONFIG_FSL_PCI */
index a0fbf2aba3621cbf92c9c697174e457982a8e8aa..da6e088163e48d55edd45fbd8b50407864cffc26 100644 (file)
@@ -15,6 +15,8 @@ EXPORT_FUNC(do_reset)
 EXPORT_FUNC(getenv)
 EXPORT_FUNC(setenv)
 EXPORT_FUNC(simple_strtoul)
+EXPORT_FUNC(simple_strtol)
+EXPORT_FUNC(strcmp)
 #if defined(CONFIG_CMD_I2C)
 EXPORT_FUNC(i2c_write)
 EXPORT_FUNC(i2c_read)
diff --git a/include/asm-ppc/immap_fsl_pci.h b/include/asm-ppc/immap_fsl_pci.h
new file mode 100644 (file)
index 0000000..bd732b6
--- /dev/null
@@ -0,0 +1,150 @@
+/* (C) Copyright 2007 Freescale Semiconductor, Inc.
+ *
+ * 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
+ *
+ */
+
+#ifndef __IMMAP_85xx_fsl_pci__
+#define __IMMAP_85xx_fsl_pci__
+
+/*
+ * Common PCI/PCIE Register structure for mpc85xx and mpc86xx
+ */
+
+/*
+ * PCI Translation Registers
+ */
+typedef struct pci_outbound_window {
+       u32     potar;          /* 0x00 - Address */
+       u32     potear;         /* 0x04 - Address Extended */
+       u32     powbar;         /* 0x08 - Window Base Address */
+       u32     res1;
+       u32     powar;          /* 0x10 - Window Attributes */
+#define POWAR_EN       0x80000000
+#define POWAR_IO_READ  0x00080000
+#define POWAR_MEM_READ 0x00040000
+#define POWAR_IO_WRITE 0x00008000
+#define POWAR_MEM_WRITE        0x00004000
+       u32     res2[3];
+} pot_t;
+
+typedef struct pci_inbound_window {
+       u32     pitar;          /* 0x00 - Address */
+       u32     res1;
+       u32     piwbar;         /* 0x08 - Window Base Address */
+       u32     piwbear;        /* 0x0c - Window Base Address Extended */
+       u32     piwar;          /* 0x10 - Window Attributes */
+#define PIWAR_EN               0x80000000
+#define PIWAR_PF               0x20000000
+#define PIWAR_LOCAL            0x00f00000
+#define PIWAR_READ_SNOOP       0x00050000
+#define PIWAR_WRITE_SNOOP      0x00005000
+       u32     res2[3];
+} pit_t;
+
+/* PCI/PCI Express Registers */
+typedef struct ccsr_pci {
+       u32     cfg_addr;       /* 0x000 - PCI Configuration Address Register */
+       u32     cfg_data;       /* 0x004 - PCI Configuration Data Register */
+       u32     int_ack;        /* 0x008 - PCI Interrupt Acknowledge Register */
+       u32     out_comp_to;    /* 0x00C - PCI Outbound Completion Timeout Register */
+       u32     out_conf_to;    /* 0x010 - PCI Configuration Timeout Register */
+       u32     config;         /* 0x014 - PCIE CONFIG Register */
+       char    res2[8];
+       u32     pme_msg_det;    /* 0x020 - PCIE PME & message detect register */
+       u32     pme_msg_dis;    /* 0x024 - PCIE PME & message disable register */
+       u32     pme_msg_int_en; /* 0x028 - PCIE PME & message interrupt enable register */
+       u32     pm_command;     /* 0x02c - PCIE PM Command register */
+       char    res4[3016];     /*     (- #xbf8  #x30)3016 */
+       u32     block_rev1;     /* 0xbf8 - PCIE Block Revision register 1 */
+       u32     block_rev2;     /* 0xbfc - PCIE Block Revision register 2 */
+
+       pot_t   pot[5];         /* 0xc00 - 0xc9f Outbound ATMU's 0, 1, 2, 3, and 4 */
+       u32     res5[64];
+       pit_t   pit[3];         /* 0xda0 - 0xdff Inbound ATMU's 3, 2, and 1 */
+#define PIT3 0
+#define PIT2 1
+#define PIT1 2
+
+#if 0
+       u32     potar0;         /* 0xc00 - PCI Outbound Transaction Address Register 0 */
+       u32     potear0;        /* 0xc04 - PCI Outbound Translation Extended Address Register 0 */
+       char    res5[8];
+       u32     powar0;         /* 0xc10 - PCI Outbound Window Attributes Register 0 */
+       char    res6[12];
+       u32     potar1;         /* 0xc20 - PCI Outbound Transaction Address Register 1 */
+       u32     potear1;        /* 0xc24 - PCI Outbound Translation Extended Address Register 1 */
+       u32     powbar1;        /* 0xc28 - PCI Outbound Window Base Address Register 1 */
+       char    res7[4];
+       u32     powar1;         /* 0xc30 - PCI Outbound Window Attributes Register 1 */
+       char    res8[12];
+       u32     potar2;         /* 0xc40 - PCI Outbound Transaction Address Register 2 */
+       u32     potear2;        /* 0xc44 - PCI Outbound Translation Extended Address Register 2 */
+       u32     powbar2;        /* 0xc48 - PCI Outbound Window Base Address Register 2 */
+       char    res9[4];
+       u32     powar2;         /* 0xc50 - PCI Outbound Window Attributes Register 2 */
+       char    res10[12];
+       u32     potar3;         /* 0xc60 - PCI Outbound Transaction Address Register 3 */
+       u32     potear3;        /* 0xc64 - PCI Outbound Translation Extended Address Register 3 */
+       u32     powbar3;        /* 0xc68 - PCI Outbound Window Base Address Register 3 */
+       char    res11[4];
+       u32     powar3;         /* 0xc70 - PCI Outbound Window Attributes Register 3 */
+       char    res12[12];
+       u32     potar4;         /* 0xc80 - PCI Outbound Transaction Address Register 4 */
+       u32     potear4;        /* 0xc84 - PCI Outbound Translation Extended Address Register 4 */
+       u32     powbar4;        /* 0xc88 - PCI Outbound Window Base Address Register 4 */
+       char    res13[4];
+       u32     powar4;         /* 0xc90 - PCI Outbound Window Attributes Register 4 */
+       char    res14[268];
+       u32     pitar3;         /* 0xda0 - PCI Inbound Translation Address Register 3 */
+       char    res15[4];
+       u32     piwbar3;        /* 0xda8 - PCI Inbound Window Base Address Register 3 */
+       u32     piwbear3;       /* 0xdac - PCI Inbound Window Base Extended Address Register 3 */
+       u32     piwar3;         /* 0xdb0 - PCI Inbound Window Attributes Register 3 */
+       char    res16[12];
+       u32     pitar2;         /* 0xdc0 - PCI Inbound Translation Address Register 2 */
+       char    res17[4];
+       u32     piwbar2;        /* 0xdc8 - PCI Inbound Window Base Address Register 2 */
+       u32     piwbear2;       /* 0xdcc - PCI Inbound Window Base Extended Address Register 2 */
+       u32     piwar2;         /* 0xdd0 - PCI Inbound Window Attributes Register 2 */
+       char    res18[12];
+       u32     pitar1;         /* 0xde0 - PCI Inbound Translation Address Register 1 */
+       char    res19[4];
+       u32     piwbar1;        /* 0xde8 - PCI Inbound Window Base Address Register 1 */
+       char    res20[4];
+       u32     piwar1;         /* 0xdf0 - PCI Inbound Window Attributes Register 1 */
+       char    res21[12];
+#endif
+       u32     pedr;           /* 0xe00 - PCI Error Detect Register */
+       u32     pecdr;          /* 0xe04 - PCI Error Capture Disable Register */
+       u32     peer;           /* 0xe08 - PCI Error Interrupt Enable Register */
+       u32     peattrcr;       /* 0xe0c - PCI Error Attributes Capture Register */
+       u32     peaddrcr;       /* 0xe10 - PCI Error Address Capture Register */
+/*     u32     perr_disr        * 0xe10 - PCIE Erorr Disable Register */
+       u32     peextaddrcr;    /* 0xe14 - PCI  Error Extended Address Capture Register */
+       u32     pedlcr;         /* 0xe18 - PCI Error Data Low Capture Register */
+       u32     pedhcr;         /* 0xe1c - PCI Error Error Data High Capture Register */
+       u32     gas_timr;       /* 0xe20 - PCI Gasket Timer Register */
+/*     u32     perr_cap_stat;   * 0xe20 - PCIE Error Capture Status Register */
+       char    res22[4];
+       u32     perr_cap0;      /* 0xe28 - PCIE Error Capture Register 0 */
+       u32     perr_cap1;      /* 0xe2c - PCIE Error Capture Register 1 */
+       u32     perr_cap2;      /* 0xe30 - PCIE Error Capture Register 2 */
+       u32     perr_cap3;      /* 0xe34 - PCIE Error Capture Register 3 */
+       char    res23[456];     /*     (- #x1000 #xe38) 456 */
+} ccsr_fsl_pci_t;
+
+#endif /*__IMMAP_fsl_pci__*/
index d88124a3b422931f2479642d0daab28651129343..bfbf3a839cf7cbfe2b29c0b4f22017dd3e548367 100644 (file)
 #endif
 
 #ifdef CONFIG_POST
-#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_DIAG
 #endif
 
 /*
index 2191c7b99c1dd5f87ed211880fea4d15c524f72d..46edd08a91f5b34762c8b5621907cd7438bfc7d8 100644 (file)
 #undef CONFIG_CMD_IRQ
 #undef CONFIG_CMD_JFFS2
 #undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_MFSL
 #undef CONFIG_CMD_MII
 #undef CONFIG_CMD_MMC
 #undef CONFIG_CMD_NAND
index f3e5330c7796a8b541d09ba837b801ffe86bb25c..713518d0da247427351f5283890caa2ba2bedcb8 100644 (file)
 #undef CONFIG_CMD_HWFLOW
 #undef CONFIG_CMD_IDE
 #undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_MFSL
 #undef CONFIG_CMD_MMC
 #undef CONFIG_CMD_NAND
 #undef CONFIG_CMD_PCMCIA
 #define CFG_BCR                        0x100C0000
 #define CFG_SIUMCR             0x0A200000
 #define CFG_SCCR               SCCR_DFBRG01
-#define CFG_BR0_PRELIM         CFG_FLASH_BASE | 0x00001801
+#define CFG_BR0_PRELIM         (CFG_FLASH_BASE | 0x00001801)
 #define CFG_OR0_PRELIM         0xFF800876
-#define CFG_BR1_PRELIM         CFG_BCSR | 0x00001801
+#define CFG_BR1_PRELIM         (CFG_BCSR | 0x00001801)
 #define CFG_OR1_PRELIM         0xFFFF8010
 
 /*We need to configure chip select to use CPLD PCI IC on MPC8272ADS*/
index 3a6c977a60616309ebfeeb251e6aef6fc9bafd9d..14b041e3aecb0a7e897bfec0e6149c77221ef346 100644 (file)
 #undef CONFIG_CMD_IDE
 #undef CONFIG_CMD_JFFS2
 #undef CONFIG_CMD_KGDB
+#undef CONFIG_CMD_MFSL
 #undef CONFIG_CMD_MMC
 #undef CONFIG_CMD_NAND
 #undef CONFIG_CMD_PCMCIA
index 45a7d81792d6cb0661a76ed2a851aaeca0bc4af5..81db96f4661e79d4cae14a1c9b103f01006c46ab 100644 (file)
 #define CONFIG_I2C_CMD_TREE
 #define CFG_I2C_SPEED          400000  /* I2C speed and slave address */
 #define CFG_I2C_SLAVE          0x7F
-#define CFG_I2C_NOPROBES       {0x69}  /* Don't probe these addrs */
+#define CFG_I2C_NOPROBES       {{0,0x69}} /* Don't probe these addrs */
 #define CFG_I2C_OFFSET         0x3000
 #define CFG_I2C2_OFFSET                0x3100
 
index 808c19f767326a5f432a89dfa16afbc9325dde74..5a511e53244828b29e5abb6cfdcc46658d5f7cfb 100644 (file)
 
 #define CFG_RESET_ADDRESS    0xfff00100
 
-/*#undef CONFIG_PCI*/
-#define CONFIG_PCI
+#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_TSEC_ENET               /* tsec ethernet support */
 #define CONFIG_ENV_OVERWRITE
@@ -76,6 +78,9 @@
 #define L2_ENABLE      (L2CR_L2E)
 
 #ifndef CONFIG_SYS_CLK_FREQ
+#ifndef __ASSEMBLY__
+extern unsigned long get_board_sys_clk(unsigned long dummy);
+#endif
 #define CONFIG_SYS_CLK_FREQ     get_board_sys_clk(0)
 #endif
 
@@ -93,6 +98,9 @@
 #define CFG_CCSRBAR            0xf8000000      /* relocated CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
+#define CFG_PCI1_ADDR          (CFG_CCSRBAR+0x8000)
+#define CFG_PCI2_ADDR          (CFG_CCSRBAR+0x9000)
+
 /*
  * DDR Setup
  */
 #define CFG_PCI1_MEM_BASE      0x80000000
 #define CFG_PCI1_MEM_PHYS      CFG_PCI1_MEM_BASE
 #define CFG_PCI1_MEM_SIZE      0x20000000      /* 512M */
-#define CFG_PCI1_IO_BASE       0xe2000000
-#define CFG_PCI1_IO_PHYS       CFG_PCI1_IO_BASE
-#define CFG_PCI1_IO_SIZE       0x1000000       /* 16M */
+#define CFG_PCI1_IO_BASE       0x00000000
+#define CFG_PCI1_IO_PHYS       0xe2000000
+#define CFG_PCI1_IO_SIZE       0x00100000      /* 1M */
 
 /* PCI view of System Memory */
 #define CFG_PCI_MEMORY_BUS      0x00000000
 
 #define CFG_PCI2_MEM_BASE      0xa0000000
 #define CFG_PCI2_MEM_PHYS      CFG_PCI2_MEM_BASE
-#define CFG_PCI2_MEM_SIZE      0x10000000      /* 256M */
-#define CFG_PCI2_IO_BASE       0xe3000000
-#define CFG_PCI2_IO_PHYS       CFG_PCI2_IO_BASE
-#define CFG_PCI2_IO_SIZE       0x1000000       /* 16M */
+#define CFG_PCI2_MEM_SIZE      0x20000000      /* 512M */
+#define CFG_PCI2_IO_BASE       0x00000000
+#define CFG_PCI2_IO_PHYS       0xe3000000
+#define CFG_PCI2_IO_SIZE       0x00100000      /* 1M */
 
 #if defined(CONFIG_PCI)
 
  * 0xa000_0000  512M   PCI-Express 2 Memory
  *     Changed it for operating from 0xd0000000
  */
-#define CFG_DBAT1L      ( CFG_PCI1_MEM_BASE | BATL_PP_RW \
+#define CFG_DBAT1L      ( CFG_PCI1_MEM_PHYS | BATL_PP_RW \
                        | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CFG_DBAT1U      (CFG_PCI1_MEM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
-#define CFG_IBAT1L      (CFG_PCI1_MEM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CFG_DBAT1U     (CFG_PCI1_MEM_PHYS | BATU_BL_1G | BATU_VS | BATU_VP)
+#define CFG_IBAT1L     (CFG_PCI1_MEM_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CFG_IBAT1U      CFG_DBAT1U
 
 /*
  * BAT2         512M   Cache-inhibited, guarded
  * 0xc000_0000  512M   RapidIO Memory
  */
-#define CFG_DBAT2L      (CFG_RIO_MEM_BASE | BATL_PP_RW \
+#define CFG_DBAT2L      (CFG_RIO_MEM_PHYS | BATL_PP_RW \
                        | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CFG_DBAT2U      (CFG_RIO_MEM_BASE | BATU_BL_512M | BATU_VS | BATU_VP)
-#define CFG_IBAT2L      (CFG_RIO_MEM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CFG_DBAT2U     (CFG_RIO_MEM_PHYS | BATU_BL_512M | BATU_VS | BATU_VP)
+#define CFG_IBAT2L     (CFG_RIO_MEM_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CFG_IBAT2U      CFG_DBAT2U
 
 /*
  * 0xe300_0000  16M    PCI-Express 2 I/0
  *    Note that this is at 0xe0000000
  */
-#define CFG_DBAT4L      ( CFG_PCI1_IO_BASE | BATL_PP_RW \
+#define CFG_DBAT4L      ( CFG_PCI1_IO_PHYS | BATL_PP_RW \
                        | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
-#define CFG_DBAT4U      (CFG_PCI1_IO_BASE | BATU_BL_32M | BATU_VS | BATU_VP)
-#define CFG_IBAT4L      (CFG_PCI1_IO_BASE | BATL_PP_RW | BATL_CACHEINHIBIT)
+#define CFG_DBAT4U     (CFG_PCI1_IO_PHYS | BATU_BL_32M | BATU_VS | BATU_VP)
+#define CFG_IBAT4L     (CFG_PCI1_IO_PHYS | BATL_PP_RW | BATL_CACHEINHIBIT)
 #define CFG_IBAT4U      CFG_DBAT4U
 
 /*
index 5e12dabecf75f43891f39450b7f2f3c90738a0dd..2f6de815514de24f5c89f3553c2b20321e72a45a 100644 (file)
 #undef CONFIG_CMD_IRQ
 #undef CONFIG_CMD_JFFS2
 #undef CONFIG_CMD_MII
+#undef CONFIG_CMD_MFSL
 #undef CONFIG_CMD_MMC
 #undef CONFIG_CMD_NAND
 #undef CONFIG_CMD_PCI
index f412ec8ed80e3fcdd70c99efd2e9e7129258f523..025c24960d2118441b14dc0015d5bd0c29d40e6a 100644 (file)
 #undef CONFIG_CMD_JFFS2
 #undef CONFIG_CMD_KGDB
 #undef CONFIG_CMD_MII
+#undef CONFIG_CMD_MFSL
 #undef CONFIG_CMD_MMC
 #undef CONFIG_CMD_NAND
 #undef CONFIG_CMD_PCI
index 79e6aa1ba6c47e4131e110aac72c732cc8845a1e..ff5724082d03daee86fb6494773efb2de2317bb0 100644 (file)
 #define CONFIG_BOOTP_BOOTPATH
 
 #define CONFIG_BOOTP_BOOTFILESIZE
-#definef CONFIG_BOOTP_DNS
+#define CONFIG_BOOTP_DNS
 
 /* undef this to save memory */
 #define CFG_LONGHELP
index b789067f81d01bc2c6874ae538960e318acd1c51..2f64ec238c652ef3e3862d8aa53ca4aa50a47d43 100644 (file)
 #undef CONFIG_CMD_IDE
 #undef CONFIG_CMD_JFFS2
 #undef CONFIG_CMD_NAND
+#undef CONFIG_CMD_MFSL
 #undef CONFIG_CMD_MMC
 #undef CONFIG_CMD_PCMCIA
 #undef CONFIG_CMD_PCI
index 4237228bebe5e0c887559927f9ce427752fce90a..f4f33f3e089c5513bb57a8223d780accef0bf688 100644 (file)
 /*-----------------------------------------------------------------------
  * FLASH organization
  */
-#define CFG_MAX_FLASH_BANKS    1/* Flash can be at one of two addresses */
+#define CFG_MAX_FLASH_BANKS    1               /* Flash can be at one of two addresses */
 #define FLASH_BANK_SIZE                0x01000000      /* 16 MB Total */
-#define CFG_FLASH_BANKS_LIST {CFG_FLASH_BASE, CFG_FLASH_BASE2}
+#define CFG_FLASH_BANKS_LIST   { CFG_FLASH_BASE, /* CFG_FLASH_BASE2 */ }
 
 #define CFG_FLASH_CFI_DRIVER
 #define CFG_FLASH_CFI
index 6e451d8b6cbce1d87b8e77dd12f4ed931ade5684..fe7de7bed0f2bc9417bbf8bd1df2e74ae0fdd51a 100644 (file)
 /*
  * Debug
  *
- * DEBUG                       - Define this is you want extra debug info
- * GTREGREAD                   - Required to build with debug
- * do_bdinfo                   - Required to build with debug
+ * DEBUG               - Define this is you want extra debug info
+ * GTREGREAD           - Required to build with debug
+ * do_bdinfo           - Required to build with debug
  */
 
 #undef DEBUG
-#define        GTREGREAD(x)                    0xFFFFFFFF
+#ifdef DEBUG
+#define        GTREGREAD(x)    0xFFFFFFFF
 #define        do_bdinfo(a,b,c,d)
-
+#endif
 
 /*
  * CPU type
  *
- * CONFIG_7xx                  - We have a 750 or 755 CPU
- * CONFIG_74xx                 - We have a 7400 CPU
- * CONFIG_ALTIVEC              - We have altivec enabled CPU (only 7400)
- * CONFIG_BUS_CLK              - System bus clock in Hz
+ * CONFIG_7xx          - We have a 750 or 755 CPU
+ * CONFIG_74xx         - We have a 7400 CPU
+ * CONFIG_ALTIVEC      - We have altivec enabled CPU (only 7400)
+ * CONFIG_BUS_CLK      - System bus clock in Hz
  */
 
 #define        CONFIG_7xx
 #undef CONFIG_74xx
 #undef CONFIG_ALTIVEC
-#define CONFIG_BUS_CLK                 66000000
+#define CONFIG_BUS_CLK 66000000
 
 
 /*
  * Serial configuration
  *
  * CONFIG_CONS_INDEX           - Serial console port number (COM1)
- * CONFIG_BAUDRATE                     - Serial speed
+ * CONFIG_BAUDRATE             - Serial speed
  */
 
-#define CONFIG_CONS_INDEX              1
-#define CONFIG_BAUDRATE                        9600
+#define CONFIG_CONS_INDEX      1
+#define CONFIG_BAUDRATE                9600
 
 
 /*
  * PCI config
  *
- * CONFIG_PCI                          - Enable PCI bus
- * CONFIG_PCI_PNP                      - Enable Plug & Play support
+ * CONFIG_PCI                  - Enable PCI bus
+ * CONFIG_PCI_PNP              - Enable Plug & Play support
  * CONFIG_PCI_SCAN_SHOW                - Enable display of devices at startup
  */
 
 /*
  * Network config
  *
- * CONFIG_NET_MULTI                    - Support for multiple network interfaces
- * CONFIG_EEPRO100                     - Intel 8255x Ethernet Controller
- * CONFIG_EEPRO100_SROM_WRITE - Enable writing to network card ROM
+ * CONFIG_NET_MULTI            - Support for multiple network interfaces
+ * CONFIG_EEPRO100             - Intel 8255x Ethernet Controller
+ * CONFIG_EEPRO100_SROM_WRITE  - Enable writing to network card ROM
  */
 
 #define        CONFIG_NET_MULTI
  * Boot config
  *
  * CONFIG_BOOTCOMMAND          - Command(s) to execute to auto-boot
- * CONFIG_BOOTDELAY                    - How long to wait before auto-boot (in sec)
+ * CONFIG_BOOTDELAY            - How long to wait before auto-boot (in sec)
  */
 
 #define CONFIG_BOOTCOMMAND             \
  *
  * This board runs in a standard CHRP (Map-B) configuration.
  *
- *     Type            Start           End                     Size    Width   Chip Sel
+ *     Type        Start       End         Size    Width   Chip Sel
  *     ----------- ----------- ----------- ------- ------- --------
- *     SDRAM           0x00000000      0x04000000      64MB    64b             SDRAMCS0
- *     User LED's      0x78000000                                              RCS3
- *     UART            0x7C000000                                              RCS2
- *     Mailbox         0xFF000000                                              RCS1
- *     Flash           0xFFC00000      0xFFFFFFFF      4MB     64b             RCS0
+ *     SDRAM       0x00000000  0x04000000  64MB    64b     SDRAMCS0
+ *     User LED's  0x78000000                              RCS3
+ *     UART        0x7C000000                              RCS2
+ *     Mailbox     0xFF000000                              RCS1
+ *     Flash       0xFFC00000  0xFFFFFFFF   4MB    64b     RCS0
  *
  * Flash sectors are laid out as follows.
  *
- *     Sector  Start           End                     Size    Comments
+ *     Sector  Start           End     Size    Comments
  *     ------- ----------- ----------- ------- -----------
- *      0              0xFFC00000      0xFFC3FFFF      256KB
- *   1         0xFFC40000      0xFFC7FFFF      256KB
- *      2              0xFFC80000      0xFFCBFFFF      256KB
- *      3              0xFFCC0000      0xFFCFFFFF      256KB
- *      4              0xFFD00000      0xFFD3FFFF      256KB
- *      5              0xFFD40000      0xFFD7FFFF      256KB
- *      6              0xFFD80000      0xFFDBFFFF      256KB
- *      7              0xFFDC0000      0xFFDFFFFF      256KB
- *   8         0xFFE00000      0xFFE3FFFF      256KB
- *      9              0xFFE40000      0xFFE7FFFF      256KB
- *  10         0xFFE80000      0xFFEBFFFF      256KB
- *  11         0xFFEC0000      0xFFEFFFFF      256KB
- *  12         0xFFF00000      0xFFF3FFFF      256KB   U-Boot code here
- *  13         0xFFF40000      0xFFF7FFFF      256KB
- *  14         0xFFF80000      0xFFFBFFFF      256KB
- *  15         0xFFFC0000      0xFFFDFFFF      128KB
- *  16         0xFFFE0000      0xFFFE7FFF       32KB   U-Boot env vars here
- *  17         0xFFFE8000      0xFFFEFFFF       32KB   U-Boot backup copy of env vars here
- *  18         0xFFFF0000      0xFFFFFFFF       64KB
+ *      0      0xFFC00000  0xFFC3FFFF  256KB
+ *      1      0xFFC40000  0xFFC7FFFF  256KB
+ *      2      0xFFC80000  0xFFCBFFFF  256KB
+ *      3      0xFFCC0000  0xFFCFFFFF  256KB
+ *      4      0xFFD00000  0xFFD3FFFF  256KB
+ *      5      0xFFD40000  0xFFD7FFFF  256KB
+ *      6      0xFFD80000  0xFFDBFFFF  256KB
+ *      7      0xFFDC0000  0xFFDFFFFF  256KB
+ *      8      0xFFE00000  0xFFE3FFFF  256KB
+ *      9      0xFFE40000  0xFFE7FFFF  256KB
+ *     10      0xFFE80000  0xFFEBFFFF  256KB
+ *     11      0xFFEC0000  0xFFEFFFFF  256KB
+ *     12      0xFFF00000  0xFFF3FFFF  256KB   U-Boot code here
+ *     13      0xFFF40000  0xFFF7FFFF  256KB
+ *     14      0xFFF80000  0xFFFBFFFF  256KB
+ *     15      0xFFFC0000  0xFFFDFFFF  128KB
+ *     16      0xFFFE0000  0xFFFE7FFF   32KB   U-Boot env vars here
+ *     17      0xFFFE8000  0xFFFEFFFF   32KB   U-Boot backup copy of env vars here
+ *     18      0xFFFF0000  0xFFFFFFFF   64KB
  */
 
 
 /*
  * SDRAM config - see memory map details above.
  *
- * CFG_SDRAM_BASE                      - Start address of SDRAM, this _must_ be zero!
- * CFG_SDRAM_SIZE                      - Total size of contiguous SDRAM bank(s)
+ * CFG_SDRAM_BASE              - Start address of SDRAM, this _must_ be zero!
+ * CFG_SDRAM_SIZE              - Total size of contiguous SDRAM bank(s)
  */
 
-#define CFG_SDRAM_BASE                 0x00000000
-#define CFG_SDRAM_SIZE                 0x04000000
+#define CFG_SDRAM_BASE         0x00000000
+#define CFG_SDRAM_SIZE         0x04000000
 
 
 /*
  * Flash config - see memory map details above.
  *
- * CFG_FLASH_BASE                      - Start address of flash memory
- * CFG_FLASH_SIZE                      - Total size of contiguous flash mem
+ * CFG_FLASH_BASE              - Start address of flash memory
+ * CFG_FLASH_SIZE              - Total size of contiguous flash mem
  * CFG_FLASH_ERASE_TOUT                - Erase timeout in ms
  * CFG_FLASH_WRITE_TOUT                - Write timeout in ms
  * CFG_MAX_FLASH_BANKS         - Number of banks of flash on board
  * CFG_MAX_FLASH_SECT          - Number of sectors in a bank
  */
 
-#define CFG_FLASH_BASE                 0xFFC00000
-#define CFG_FLASH_SIZE                 0x00400000
+#define CFG_FLASH_BASE         0xFFC00000
+#define CFG_FLASH_SIZE         0x00400000
 #define CFG_FLASH_ERASE_TOUT   250000
 #define CFG_FLASH_WRITE_TOUT   5000
-#define CFG_MAX_FLASH_BANKS            1
-#define CFG_MAX_FLASH_SECT             19
+#define CFG_MAX_FLASH_BANKS    1
+#define CFG_MAX_FLASH_SECT     19
 
 
 /*
  * Monitor config - see memory map details above
  *
- * CFG_MONITOR_BASE                    - Base address of monitor code
- * CFG_MALLOC_LEN                      - Size of malloc pool (128KB)
+ * CFG_MONITOR_BASE            - Base address of monitor code
+ * CFG_MALLOC_LEN              - Size of malloc pool (128KB)
  */
 
-#define CFG_MONITOR_BASE               TEXT_BASE
-#define CFG_MALLOC_LEN                 0x20000
+#define CFG_MONITOR_BASE       TEXT_BASE
+#define CFG_MALLOC_LEN         0x20000
 
 
 /*
  * CFG_PROMPT                  - Prompt string
  */
 
-#define CFG_BARGSIZE                   1024
-#define CFG_BOOTMAPSZ                  0x800000
-#define CFG_CBSIZE                     1024
-#define CFG_LOAD_ADDR                  0x100000
+#define CFG_BARGSIZE           1024
+#define CFG_BOOTMAPSZ          0x800000
+#define CFG_CBSIZE             1024
+#define CFG_LOAD_ADDR          0x100000
 #define CFG_LONGHELP
-#define CFG_MAXARGS                    16
-#define CFG_MEMTEST_START              0x00040000
-#define CFG_MEMTEST_END                        0x00040100
-#define CFG_PBSIZE                     1024
-#define CFG_PROMPT                     "=> "
+#define CFG_MAXARGS            16
+#define CFG_MEMTEST_START      0x00040000
+#define CFG_MEMTEST_END                0x00040100
+#define CFG_PBSIZE             1024
+#define CFG_PROMPT             "=> "
 
 
 /*
  * CFG_ENV_SECT_SIZE           - Size of sector containing env vars (32KB)
  */
 
-#define CFG_ENV_IS_IN_FLASH            1
-#define CFG_ENV_ADDR                   0xFFFE0000
-#define CFG_ENV_SIZE                   0x1000
-#define CFG_ENV_ADDR_REDUND            0xFFFE8000
-#define CFG_ENV_SIZE_REDUND            0x1000
-#define CFG_ENV_SECT_SIZE              0x8000
+#define CFG_ENV_IS_IN_FLASH    1
+#define CFG_ENV_ADDR           0xFFFE0000
+#define CFG_ENV_SIZE           0x1000
+#define CFG_ENV_ADDR_REDUND    0xFFFE8000
+#define CFG_ENV_SIZE_REDUND    0x1000
+#define CFG_ENV_SECT_SIZE      0x8000
 
 
 /*
  * copied to top of RAM by the init code.
  *
  * CFG_INIT_RAM_ADDR           - Address of Init RAM, above exception vect
- * CFG_INIT_RAM_END                    - Size of Init RAM
+ * CFG_INIT_RAM_END            - Size of Init RAM
  * CFG_GBL_DATA_SIZE           - Ammount of RAM to reserve for global data
  * CFG_GBL_DATA_OFFSET         - Start of global data, top of stack
  */
 
-#define CFG_INIT_RAM_ADDR              (CFG_SDRAM_BASE + 0x4000)
-#define CFG_INIT_RAM_END               0x4000
-#define CFG_GBL_DATA_SIZE              128
-#define CFG_GBL_DATA_OFFSET            (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_RAM_ADDR      (CFG_SDRAM_BASE + 0x4000)
+#define CFG_INIT_RAM_END       0x4000
+#define CFG_GBL_DATA_SIZE      128
+#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
 
 
 /*
  * Cache config
  *
  * CFG_CACHELINE_SIZE          - Size of a cache line (CPU specific)
- * CFG_L2                                      - L2 cache enabled if defined
- * L2_INIT                                     - L2 cache init flags
- * L2_ENABLE                           - L2 cache enable flags
+ * CFG_L2                      - L2 cache enabled if defined
+ * L2_INIT                     - L2 cache init flags
+ * L2_ENABLE                   - L2 cache enable flags
  */
 
-#define CFG_CACHELINE_SIZE             32
+#define CFG_CACHELINE_SIZE     32
 #undef CFG_L2
-#define L2_INIT                                        0
-#define L2_ENABLE                              0
+#define L2_INIT                        0
+#define L2_ENABLE              0
 
 
 /*
  * Clocks config
  *
- * CFG_BUS_HZ                          - Bus clock frequency in Hz
- * CFG_BUS_CLK                         - As above (?)
- * CFG_HZ                                      - Decrementer freq in Hz
+ * CFG_BUS_HZ                  - Bus clock frequency in Hz
+ * CFG_BUS_CLK                 - As above (?)
+ * CFG_HZ                      - Decrementer freq in Hz
  */
 
-#define CFG_BUS_HZ                             CONFIG_BUS_CLK
-#define CFG_BUS_CLK                            CONFIG_BUS_CLK
-#define CFG_HZ                                 1000
+#define CFG_BUS_HZ             CONFIG_BUS_CLK
+#define CFG_BUS_CLK            CONFIG_BUS_CLK
+#define CFG_HZ                 1000
 
 
 /*
  * Serial port config
  *
  * CFG_BAUDRATE_TABLE          - List of valid baud rates
- * CFG_NS16550                         - Include the NS16550 driver
+ * CFG_NS16550                 - Include the NS16550 driver
  * CFG_NS16550_SERIAL          - Include the serial (wrapper) driver
- * CFG_NS16550_CLK                     - Frequency of reference clock
+ * CFG_NS16550_CLK             - Frequency of reference clock
  * CFG_NS16550_REG_SIZE                - 64-bit accesses to 8-bit port
- * CFG_NS16550_COM1                    - Base address of 1st serial port
+ * CFG_NS16550_COM1            - Base address of 1st serial port
  */
 
-#define CFG_BAUDRATE_TABLE             { 9600, 19200, 38400, 57600, 115200 }
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 #define CFG_NS16550
 #define CFG_NS16550_SERIAL
-#define CFG_NS16550_CLK                        3686400
+#define CFG_NS16550_CLK                3686400
 #define CFG_NS16550_REG_SIZE   -8
-#define CFG_NS16550_COM1               0x7C000000
+#define CFG_NS16550_COM1       0x7C000000
 
 
 /*
  * PCI Config - Address Map B (CHRP)
  */
 
-#define CFG_PCI_MEMORY_BUS      0x00000000
-#define CFG_PCI_MEMORY_PHYS     0x00000000
-#define CFG_PCI_MEMORY_SIZE     0x40000000
-#define CFG_PCI_MEM_BUS         0x80000000
-#define CFG_PCI_MEM_PHYS        0x80000000
-#define CFG_PCI_MEM_SIZE        0x7D000000
-#define CFG_ISA_MEM_BUS         0x00000000
-#define CFG_ISA_MEM_PHYS        0xFD000000
-#define CFG_ISA_MEM_SIZE        0x01000000
-#define CFG_PCI_IO_BUS          0x00800000
-#define CFG_PCI_IO_PHYS         0xFE800000
-#define CFG_PCI_IO_SIZE         0x00400000
-#define CFG_ISA_IO_BUS          0x00000000
-#define CFG_ISA_IO_PHYS         0xFE000000
-#define CFG_ISA_IO_SIZE         0x00800000
+#define CFG_PCI_MEMORY_BUS     0x00000000
+#define CFG_PCI_MEMORY_PHYS    0x00000000
+#define CFG_PCI_MEMORY_SIZE    0x40000000
+#define CFG_PCI_MEM_BUS                0x80000000
+#define CFG_PCI_MEM_PHYS       0x80000000
+#define CFG_PCI_MEM_SIZE       0x7D000000
+#define CFG_ISA_MEM_BUS                0x00000000
+#define CFG_ISA_MEM_PHYS       0xFD000000
+#define CFG_ISA_MEM_SIZE       0x01000000
+#define CFG_PCI_IO_BUS         0x00800000
+#define CFG_PCI_IO_PHYS                0xFE800000
+#define CFG_PCI_IO_SIZE                0x00400000
+#define CFG_ISA_IO_BUS         0x00000000
+#define CFG_ISA_IO_PHYS                0xFE000000
+#define CFG_ISA_IO_SIZE                0x00800000
 #define CFG_ISA_IO_BASE_ADDRESS CFG_ISA_IO_PHYS
-#define CFG_ISA_IO              CFG_ISA_IO_PHYS
-#define CFG_60X_PCI_IO_OFFSET   CFG_ISA_IO_PHYS
+#define CFG_ISA_IO             CFG_ISA_IO_PHYS
+#define CFG_60X_PCI_IO_OFFSET  CFG_ISA_IO_PHYS
 
 
 /*
 /*
  * Boot flags
  *
- * BOOTFLAG_COLD                       - Indicates a power-on boot
- * BOOTFLAG_WARM                       - Indicates a software reset
+ * BOOTFLAG_COLD               - Indicates a power-on boot
+ * BOOTFLAG_WARM               - Indicates a software reset
  */
 
-#define BOOTFLAG_COLD                  0x01
-#define BOOTFLAG_WARM                  0x02
+#define BOOTFLAG_COLD          0x01
+#define BOOTFLAG_WARM          0x02
 
 
 #endif /* __CONFIG_H */
index 83a81fec1398e8cb05850f9f4c89dcaa9f4e5f09..1831bef0de11ad91e490437b791bcdbc04be52dd 100644 (file)
 #define CONFIG_I2C_CMD_TREE
 #define CFG_I2C_SPEED          400000  /* I2C speed and slave address */
 #define CFG_I2C_SLAVE          0x7F
-#define CFG_I2C_NOPROBES       {{0,0x69}}      /* Don't probe these addrs */
+#define CFG_I2C_NOPROBES       {0x69}  /* Don't probe these addrs */
 #define CFG_I2C1_OFFSET                0x3000
 #define CFG_I2C2_OFFSET                0x3100
 #define CFG_I2C_OFFSET         CFG_I2C2_OFFSET
index 704b1330b891a1d8c42c26febc1b0fca4cf03774..0516da93749be2c00d34ae575259b63eb9243a72 100644 (file)
@@ -23,6 +23,8 @@ void do_reset (void);
 unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
 char *getenv (char *name);
 void setenv (char *varname, char *varvalue);
+long simple_strtol(const char *cp,char **endp,unsigned int base);
+int strcmp(const char * cs,const char * ct);
 #if defined(CONFIG_CMD_I2C)
 int i2c_write (uchar, uint, int , uchar* , int);
 int i2c_read (uchar, uint, int , uchar* , int);
@@ -40,7 +42,7 @@ enum {
        XF_MAX
 };
 
-#define XF_VERSION     3
+#define XF_VERSION     4
 
 #if defined(CONFIG_I386)
 extern gd_t *global_data;
index 7c9a0e344100ecd31aacbde47281c3aaea36b32a..8e5dacc0df6cac054670e8b2238a485dbd02bd5f 100644 (file)
 #define PCI_MAX_PCI_DEVICES    32
 #define PCI_MAX_PCI_FUNCTIONS  8
 
+#define PCI_DCR                0x54    /* PCIe Device Control Register */
+#define PCI_DSR                0x56    /* PCIe Device Status Register */
+#define PCI_LSR                0x5e    /* PCIe Link Status Register */
+#define PCI_LTSSM      0x404   /* PCIe Link Training, Status State Machine */
+#define  PCI_LTSSM_L0  0x16    /* L0 state */
+
 /* Include the ID list */
 
 #include <pci_ids.h>