]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/nds32/lib/board.c
Merge branch 'master' of git://git.denx.de/u-boot-i2c
[karo-tx-uboot.git] / arch / nds32 / lib / board.c
index c919928a371620ca156e8a92d06f3db11d1f6e88..2d4c6231a3774114366bed986631bb7a59e98587 100644 (file)
@@ -6,23 +6,7 @@
  * Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com>
  * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.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
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <nand.h>
 #include <onenand_uboot.h>
 #include <mmc.h>
+#include <asm/sections.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if defined(CONFIG_SYS_I2C)
+#include <i2c.h>
+#endif
+
 ulong monitor_flash_len;
 
 /*
@@ -172,7 +161,7 @@ init_fnc_t *init_sequence[] = {
 #if defined(CONFIG_DISPLAY_BOARDINFO)
        checkboard,             /* display board info */
 #endif
-#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C)
        init_func_i2c,
 #endif
        dram_init,              /* configure available RAM banks */
@@ -192,7 +181,7 @@ void board_init_f(ulong bootflag)
 
        memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
 
-       gd->mon_len = (unsigned int)(&__bss_end__) - (unsigned int)(&_start);
+       gd->mon_len = (unsigned int)(&__bss_end) - (unsigned int)(&_start);
 
        for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
                if ((*init_fnc_ptr)() != 0)
@@ -300,7 +289,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
        gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
 
-       monitor_flash_len = &_end - &_start;
+       monitor_flash_len = (ulong)&_end - (ulong)&_start;
        debug("monitor flash len: %08lX\n", monitor_flash_len);
 
        board_init();   /* Setup chipselects */
@@ -346,6 +335,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
        mmc_initialize(gd->bd);
 #endif
 
+#if defined(CONFIG_SYS_I2C_ADAPTERS)
+       i2c_reloc_fixup();
+#endif
+
        /* initialize environment */
        env_relocate();
 
@@ -404,10 +397,3 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
        /* NOTREACHED - no way out of command loop except booting */
 }
-
-void hang(void)
-{
-       puts("### ERROR ### Please RESET the board ###\n");
-       for (;;)
-               ;
-}