2 * ICP DAS LP-8x4x Support
4 * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
5 * adapted from Voipac PXA270 Support by
6 * Copyright (C) 2013 Sergey Yanovich <ynvich@gmail.com>
8 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/arch/hardware.h>
13 #include <asm/arch/regs-mmc.h>
14 #include <asm/arch/pxa.h>
20 DECLARE_GLOBAL_DATA_PTR;
23 * Miscelaneous platform dependent initialisations
27 /* We have RAM, disable cache */
31 /* memory and cpu-speed are setup before relocation */
32 /* so we do _nothing_ here */
34 /* adress of boot parameters */
35 gd->bd->bi_boot_params = 0xa0000100;
43 gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
47 void dram_init_banksize(void)
49 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
50 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
54 int board_mmc_init(bd_t *bis)
62 int board_usb_init(int index, enum usb_init_type init)
64 if (index !=0 || init != USB_INIT_HOST)
67 writel(readl(CKEN) | CKEN10_USBHOST, CKEN);
69 writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
71 writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
73 writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);
75 while (readl(UHCHR) & UHCHR_FSBIR)
76 continue; /* required by checkpath.pl */
78 writel(readl(UHCHR) & ~UHCHR_SSEP0, UHCHR);
79 writel(readl(UHCRHDA) & ~(0x1000), UHCRHDA);
80 writel(readl(UHCRHDA) | 0x800, UHCRHDA);
82 writel(readl(UHCHR) & ~UHCHR_SSE, UHCHR);
83 writel((UHCHIE_UPRIE | UHCHIE_RWIE), UHCHIE);
85 /* Clear any OTG Pin Hold */
86 if (readl(PSSR) & PSSR_OTGPH)
87 writel(readl(PSSR) | PSSR_OTGPH, PSSR);
89 writel(readl(UHCRHDA) & ~(0x200), UHCRHDA);
90 writel(readl(UHCRHDA) | 0x100, UHCRHDA);
92 /* Set port power control mask bits, only 3 ports. */
93 writel(readl(UHCRHDB) | (0x7<<17), UHCRHDB);
98 int usb_board_stop(void)
100 writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
102 writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
104 writel(readl(UHCCOMS) | 1, UHCCOMS);
107 writel(readl(UHCHR) | UHCHR_SSEP0 | UHCHR_SSE, UHCHR);
109 writel(readl(CKEN) & ~CKEN10_USBHOST, CKEN);
114 int board_usb_cleanup(int index, enum usb_init_type init)
116 if (index !=0 || init != USB_INIT_HOST)
119 return usb_board_stop();
123 #ifdef CONFIG_DRIVER_DM9000
124 int board_eth_init(bd_t *bis)
126 return dm9000_initialize(bis);