]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mpc8349itx/mpc8349itx.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / board / freescale / mpc8349itx / mpc8349itx.c
index 9cc808ed7d6978d81f9a549e625c28a9338491dd..3bdec1c40054d876d2e66208e5b4cc9e45639661 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) Freescale Semiconductor, Inc. 2006.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS for A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
  */
 
 #include <common.h>
 #include <spd_sdram.h>
 #include <asm/mmu.h>
 #if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #endif
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CONFIG_SPD_EEPROM
 /*************************************************************************
  *  fixed sdram init -- doesn't use serial presence detect.
@@ -132,7 +117,7 @@ volatile static struct pci_controller hose[] = {
 };
 #endif                         /* CONFIG_PCI */
 
-phys_size_t initdram(int board_type)
+int dram_init(void)
 {
        volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
        u32 msize = 0;
@@ -141,7 +126,7 @@ phys_size_t initdram(int board_type)
 #endif
 
        if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
-               return -1;
+               return -ENXIO;
 
        /* DDR SDRAM - Main SODIMM */
        im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
@@ -160,7 +145,9 @@ phys_size_t initdram(int board_type)
 #endif
 
        /* return total bus RAM size(bytes) */
-       return msize * 1024 * 1024;
+       gd->ram_size = msize * 1024 * 1024;
+
+       return 0;
 }
 
 int checkboard(void)
@@ -263,8 +250,7 @@ int misc_init_r(void)
 {
        int rc = 0;
 
-#ifdef CONFIG_HARD_I2C
-
+#if defined(CONFIG_SYS_I2C)
        unsigned int orig_bus = i2c_get_bus_num();
        u8 i2c_data;
 
@@ -395,11 +381,13 @@ int misc_init_r(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)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
+
+       return 0;
 }
 #endif