]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mpc8641hpcn/mpc8641hpcn.c
libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
[u-boot] / board / freescale / mpc8641hpcn / mpc8641hpcn.c
index 455569e422b1f702cd332b3bf5ebf4d6f2156003..2714cacfbe409aaa996e7318cd608e6575772191 100644 (file)
@@ -1,23 +1,7 @@
 /*
  * Copyright 2006, 2007, 2010-2011 Freescale Semiconductor.
  *
- * 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
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <asm/processor.h>
 #include <asm/immap_86xx.h>
 #include <asm/fsl_pci.h>
-#include <asm/fsl_ddr_sdram.h>
+#include <fsl_ddr_sdram.h>
 #include <asm/fsl_serdes.h>
 #include <asm/io.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <netdev.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 phys_size_t fixed_sdram(void);
 
 int checkboard(void)
@@ -50,14 +36,10 @@ int checkboard(void)
        else
                puts ("Promjet\n");
 
-#ifdef CONFIG_PHYS_64BIT
-       printf ("       36-bit physical address map\n");
-#endif
        return 0;
 }
 
-phys_size_t
-initdram(int board_type)
+int dram_init(void)
 {
        phys_size_t dram_size = 0;
 
@@ -70,7 +52,9 @@ initdram(int board_type)
        setup_ddr_bat(dram_size);
 
        debug("    DDR: ");
-       return dram_size;
+       gd->ram_size = dram_size;
+
+       return 0;
 }
 
 
@@ -83,7 +67,7 @@ fixed_sdram(void)
 {
 #if !defined(CONFIG_SYS_RAMBOOT)
        volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
-       volatile ccsr_ddr_t *ddr = &immap->im_ddr1;
+       struct ccsr_ddr __iomem *ddr = &immap->im_ddr1;
 
        ddr->cs0_bnds = CONFIG_SYS_DDR_CS0_BNDS;
        ddr->cs0_config = CONFIG_SYS_DDR_CS0_CONFIG;
@@ -138,12 +122,11 @@ void pci_init_board(void)
 
 
 #if defined(CONFIG_OF_BOARD_SETUP)
-void
-ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        int off;
        u64 *tmp;
-       u32 *addrcells;
+       int addrcells;
 
        ft_cpu_setup(blob, bd);
 
@@ -155,12 +138,13 @@ ft_board_setup(void *blob, bd_t *bd)
         * which is defined by the "reg" property in the soc node.
         */
        off = fdt_path_offset(blob, "/soc8641");
-       addrcells = (u32 *)fdt_getprop(blob, 0, "#address-cells", NULL);
+       addrcells = fdt_address_cells(blob, 0);
        tmp = (u64 *)fdt_getprop(blob, off, "reg", NULL);
 
        if (tmp) {
                u64 addr;
-               if (addrcells && (*addrcells == 1))
+
+               if (addrcells == 1)
                        addr = *(u32 *)tmp;
                else
                        addr = *tmp;
@@ -171,6 +155,8 @@ ft_board_setup(void *blob, bd_t *bd)
                               "in u-boot.  This means your .dts might "
                               "be old.\n");
        }
+
+       return 0;
 }
 #endif