]> Git Repo - u-boot.git/blobdiff - board/toradex/colibri_pxa270/colibri_pxa270.c
common: Drop asm/global_data.h from common header
[u-boot.git] / board / toradex / colibri_pxa270 / colibri_pxa270.c
index 2e3e03a152716846659f43545fdf7d145de87283..25fbf4120955f6c578e15ad6e6ff0c9d4b4d1dca 100644 (file)
@@ -1,22 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Toradex Colibri PXA270 Support
  *
  * Copyright (C) 2010 Marek Vasut <[email protected]>
- *
- * SPDX-License-Identifier:    GPL-2.0+
+ * Copyright (C) 2016-2019 Marcel Ziswiler <[email protected]>
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <dm.h>
+#include <init.h>
+#include <net.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/pxa.h>
 #include <asm/arch/regs-mmc.h>
 #include <asm/arch/regs-uart.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <dm/platdata.h>
+#include <dm/platform_data/pxa_mmc_gen.h>
 #include <dm/platform_data/serial_pxa.h>
 #include <netdev.h>
 #include <serial.h>
 #include <usb.h>
+#include <asm/mach-types.h>
+#include <linux/delay.h>
+#include "../common/tdx-common.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -29,12 +38,26 @@ int board_init(void)
        /* arch number of Toradex Colibri PXA270 */
        gd->bd->bi_arch_number = MACH_TYPE_COLIBRI;
 
-       /* adress of boot parameters */
+       /* address of boot parameters */
        gd->bd->bi_boot_params = 0xa0000100;
 
        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, struct bd_info *bd)
+{
+       return ft_common_board_setup(blob, bd);
+}
+#endif
+
 int dram_init(void)
 {
        pxa2xx_dram_init();
@@ -65,7 +88,7 @@ int board_usb_init(int index, enum usb_init_type init)
        writel(readl(UHCRHDA) | 0x100, UHCRHDA);
 
        /* Set port power control mask bits, only 3 ports. */
-       writel(readl(UHCRHDB) | (0x7<<17), UHCRHDB);
+       writel(readl(UHCRHDB) | (0x7 << 17), UHCRHDB);
 
        /* enable port 2 */
        writel(readl(UP2OCR) | UP2OCR_HXOE | UP2OCR_HXS |
@@ -89,33 +112,42 @@ void usb_board_stop(void)
        udelay(10);
 
        writel(readl(CKEN) & ~CKEN10_USBHOST, CKEN);
-
-       return;
 }
 #endif
 
 #ifdef CONFIG_DRIVER_DM9000
-int board_eth_init(bd_t *bis)
+int board_eth_init(struct bd_info *bis)
 {
        return dm9000_initialize(bis);
 }
 #endif
 
 #ifdef CONFIG_CMD_MMC
-int board_mmc_init(bd_t *bis)
+#if !CONFIG_IS_ENABLED(DM_MMC)
+int board_mmc_init(struct bd_info *bis)
 {
        pxa_mmc_register(0);
        return 0;
 }
+#else /* !CONFIG_IS_ENABLED(DM_MMC) */
+static const struct pxa_mmc_plat mmc_plat = {
+       .base = (struct pxa_mmc_regs *)MMC0_BASE,
+};
+
+U_BOOT_DRVINFO(pxa_mmcs) = {
+       .name = "pxa_mmc",
+       .plat = &mmc_plat,
+};
+#endif /* !CONFIG_IS_ENABLED(DM_MMC) */
 #endif
 
-static const struct pxa_serial_platdata serial_platdata = {
+static const struct pxa_serial_plat serial_plat = {
        .base = (struct pxa_uart_regs *)FFUART_BASE,
        .port = FFUART_INDEX,
        .baudrate = CONFIG_BAUDRATE,
 };
 
-U_BOOT_DEVICE(pxa_serials) = {
+U_BOOT_DRVINFO(pxa_serials) = {
        .name = "serial_pxa",
-       .platdata = &serial_platdata,
+       .plat = &serial_plat,
 };
This page took 0.025376 seconds and 4 git commands to generate.