Merge tag 'ti-v2020.07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
[oweals/u-boot.git] / board / atmel / at91sam9263ek / at91sam9263ek.c
index 2aafafe35ee213167efc5c47f3a6f1b61a30401a..be132bc185fbd3c53b59bd0776a8bd67f71d5364 100644 (file)
@@ -1,12 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2007-2008
  * Stelian Pop <stelian@popies.net>
  * Lead Tech Design <www.leadtechdesign.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <debug_uart.h>
+#include <flash.h>
+#include <init.h>
+#include <net.h>
+#include <vsprintf.h>
 #include <linux/sizes.h>
 #include <asm/arch/at91sam9263.h>
 #include <asm/arch/at91sam9_smc.h>
@@ -19,6 +23,7 @@
 #include <asm/arch/hardware.h>
 #include <lcd.h>
 #include <atmel_lcdc.h>
+#include <asm/mach-types.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -158,7 +163,7 @@ void lcd_show_board_info(void)
                dram_size += gd->bd->bi_dram[i].size;
        nand_size = 0;
        for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += nand_info[i]->size;
+               nand_size += get_nand_dev_by_index(i)->size;
 #ifdef CONFIG_MTD_NOR_FLASH
        flash_size = 0;
        for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++)
@@ -176,10 +181,22 @@ void lcd_show_board_info(void)
 #endif /* CONFIG_LCD_INFO */
 #endif
 
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+       at91_seriald_hw_init();
+}
+#endif
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
+#ifdef CONFIG_DEBUG_UART
+       debug_uart_init();
+#endif
        return 0;
 }
+#endif
 
 int board_init(void)
 {
@@ -191,10 +208,6 @@ int board_init(void)
 #ifdef CONFIG_CMD_NAND
        at91sam9263ek_nand_hw_init();
 #endif
-#ifdef CONFIG_HAS_DATAFLASH
-       at91_set_pio_output(AT91_PIO_PORTE, 20, 1);     /* select spi0 clock */
-       at91_spi0_hw_init(1 << 0);
-#endif
 #ifdef CONFIG_USB_OHCI_NEW
        at91_uhp_hw_init();
 #endif