dm: Use dm.h header when driver mode is used
[oweals/u-boot.git] / board / toradex / colibri_pxa270 / colibri_pxa270.c
index 3def0a6fd0709533beafcea38b44a50a4761bf75..5d62e66495b5826bc2269d861fe09855fba3dd9c 100644 (file)
@@ -2,18 +2,24 @@
  * Toradex Colibri PXA270 Support
  *
  * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
+ * Copyright (C) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <dm.h>
 #include <asm/arch/hardware.h>
-#include <asm/arch/regs-mmc.h>
 #include <asm/arch/pxa.h>
-#include <netdev.h>
+#include <asm/arch/regs-mmc.h>
+#include <asm/arch/regs-uart.h>
 #include <asm/io.h>
+#include <dm/platdata.h>
+#include <dm/platform_data/serial_pxa.h>
+#include <netdev.h>
 #include <serial.h>
 #include <usb.h>
+#include "../common/tdx-common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -32,6 +38,20 @@ int board_init(void)
        return 0;
 }
 
+int checkboard(void)
+{
+       puts("Model: Toradex Colibri PXA270\n");
+
+       return 0;
+}
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       return ft_common_board_setup(blob, bd);
+}
+#endif
+
 int dram_init(void)
 {
        pxa2xx_dram_init();
@@ -105,3 +125,14 @@ int board_mmc_init(bd_t *bis)
        return 0;
 }
 #endif
+
+static const struct pxa_serial_platdata serial_platdata = {
+       .base = (struct pxa_uart_regs *)FFUART_BASE,
+       .port = FFUART_INDEX,
+       .baudrate = CONFIG_BAUDRATE,
+};
+
+U_BOOT_DEVICE(pxa_serials) = {
+       .name = "serial_pxa",
+       .platdata = &serial_platdata,
+};