1 // SPDX-License-Identifier: GPL-2.0+
3 * Toradex Colibri PXA270 Support
5 * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
6 * Copyright (C) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
14 #include <asm/arch/hardware.h>
15 #include <asm/arch/pxa.h>
16 #include <asm/arch/regs-mmc.h>
17 #include <asm/arch/regs-uart.h>
19 #include <dm/platdata.h>
20 #include <dm/platform_data/serial_pxa.h>
24 #include <asm/mach-types.h>
25 #include "../common/tdx-common.h"
27 DECLARE_GLOBAL_DATA_PTR;
31 /* We have RAM, disable cache */
35 /* arch number of Toradex Colibri PXA270 */
36 gd->bd->bi_arch_number = MACH_TYPE_COLIBRI;
38 /* adress of boot parameters */
39 gd->bd->bi_boot_params = 0xa0000100;
46 puts("Model: Toradex Colibri PXA270\n");
51 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
52 int ft_board_setup(void *blob, bd_t *bd)
54 return ft_common_board_setup(blob, bd);
61 gd->ram_size = PHYS_SDRAM_1_SIZE;
66 int board_usb_init(int index, enum usb_init_type init)
68 writel((readl(UHCHR) | UHCHR_PCPL | UHCHR_PSPL) &
69 ~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
72 writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);
74 while (UHCHR & UHCHR_FSBIR)
77 writel(readl(UHCHR) & ~UHCHR_SSE, UHCHR);
78 writel((UHCHIE_UPRIE | UHCHIE_RWIE), UHCHIE);
80 /* Clear any OTG Pin Hold */
81 if (readl(PSSR) & PSSR_OTGPH)
82 writel(readl(PSSR) | PSSR_OTGPH, PSSR);
84 writel(readl(UHCRHDA) & ~(0x200), UHCRHDA);
85 writel(readl(UHCRHDA) | 0x100, UHCRHDA);
87 /* Set port power control mask bits, only 3 ports. */
88 writel(readl(UHCRHDB) | (0x7<<17), UHCRHDB);
91 writel(readl(UP2OCR) | UP2OCR_HXOE | UP2OCR_HXS |
92 UP2OCR_DMPDE | UP2OCR_DPPDE, UP2OCR);
97 int board_usb_cleanup(int index, enum usb_init_type init)
102 void usb_board_stop(void)
104 writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
106 writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
108 writel(readl(UHCCOMS) | 1, UHCCOMS);
111 writel(readl(CKEN) & ~CKEN10_USBHOST, CKEN);
117 #ifdef CONFIG_DRIVER_DM9000
118 int board_eth_init(bd_t *bis)
120 return dm9000_initialize(bis);
124 #ifdef CONFIG_CMD_MMC
125 int board_mmc_init(bd_t *bis)
132 static const struct pxa_serial_platdata serial_platdata = {
133 .base = (struct pxa_uart_regs *)FFUART_BASE,
134 .port = FFUART_INDEX,
135 .baudrate = CONFIG_BAUDRATE,
138 U_BOOT_DEVICE(pxa_serials) = {
139 .name = "serial_pxa",
140 .platdata = &serial_platdata,