upstream u-boot with additional patches for our devices/boards:
https://lists.denx.de/pipermail/u-boot/2017-March/282789.html (AXP crashes) ;
Gbit ethernet patch for some LIME2 revisions ;
with SPI flash support
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
2.6 KiB
120 lines
2.6 KiB
15 years ago
|
/*
|
||
|
* Toradex Colibri PXA270 Support
|
||
|
*
|
||
|
* Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU General Public License as
|
||
|
* published by the Free Software Foundation; either version 2 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program; if not, write to the Free Software
|
||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||
|
* MA 02111-1307 USA
|
||
|
*/
|
||
|
|
||
|
#include <common.h>
|
||
|
#include <asm/arch/hardware.h>
|
||
13 years ago
|
#include <asm/arch/regs-mmc.h>
|
||
13 years ago
|
#include <asm/arch/pxa.h>
|
||
15 years ago
|
#include <netdev.h>
|
||
14 years ago
|
#include <asm/io.h>
|
||
13 years ago
|
#include <serial.h>
|
||
15 years ago
|
|
||
|
DECLARE_GLOBAL_DATA_PTR;
|
||
|
|
||
13 years ago
|
int board_init(void)
|
||
15 years ago
|
{
|
||
14 years ago
|
/* We have RAM, disable cache */
|
||
|
dcache_disable();
|
||
|
icache_disable();
|
||
15 years ago
|
|
||
|
/* arch number of vpac270 */
|
||
|
gd->bd->bi_arch_number = MACH_TYPE_COLIBRI;
|
||
|
|
||
|
/* adress of boot parameters */
|
||
|
gd->bd->bi_boot_params = 0xa0000100;
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
14 years ago
|
int dram_init(void)
|
||
15 years ago
|
{
|
||
13 years ago
|
pxa2xx_dram_init();
|
||
14 years ago
|
gd->ram_size = PHYS_SDRAM_1_SIZE;
|
||
|
return 0;
|
||
|
}
|
||
15 years ago
|
|
||
|
#ifdef CONFIG_CMD_USB
|
||
|
int usb_board_init(void)
|
||
|
{
|
||
14 years ago
|
writel((readl(UHCHR) | UHCHR_PCPL | UHCHR_PSPL) &
|
||
|
~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
|
||
|
UHCHR);
|
||
15 years ago
|
|
||
14 years ago
|
writel(readl(UHCHR) | UHCHR_FSBIR, UHCHR);
|
||
15 years ago
|
|
||
13 years ago
|
while (UHCHR & UHCHR_FSBIR)
|
||
|
;
|
||
15 years ago
|
|
||
14 years ago
|
writel(readl(UHCHR) & ~UHCHR_SSE, UHCHR);
|
||
|
writel((UHCHIE_UPRIE | UHCHIE_RWIE), UHCHIE);
|
||
15 years ago
|
|
||
|
/* Clear any OTG Pin Hold */
|
||
14 years ago
|
if (readl(PSSR) & PSSR_OTGPH)
|
||
|
writel(readl(PSSR) | PSSR_OTGPH, PSSR);
|
||
15 years ago
|
|
||
14 years ago
|
writel(readl(UHCRHDA) & ~(0x200), UHCRHDA);
|
||
|
writel(readl(UHCRHDA) | 0x100, UHCRHDA);
|
||
15 years ago
|
|
||
|
/* Set port power control mask bits, only 3 ports. */
|
||
14 years ago
|
writel(readl(UHCRHDB) | (0x7<<17), UHCRHDB);
|
||
15 years ago
|
|
||
|
/* enable port 2 */
|
||
14 years ago
|
writel(readl(UP2OCR) | UP2OCR_HXOE | UP2OCR_HXS |
|
||
|
UP2OCR_DMPDE | UP2OCR_DPPDE, UP2OCR);
|
||
15 years ago
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
void usb_board_init_fail(void)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
void usb_board_stop(void)
|
||
|
{
|
||
14 years ago
|
writel(readl(UHCHR) | UHCHR_FHR, UHCHR);
|
||
15 years ago
|
udelay(11);
|
||
14 years ago
|
writel(readl(UHCHR) & ~UHCHR_FHR, UHCHR);
|
||
15 years ago
|
|
||
14 years ago
|
writel(readl(UHCCOMS) | 1, UHCCOMS);
|
||
15 years ago
|
udelay(10);
|
||
|
|
||
14 years ago
|
writel(readl(CKEN) & ~CKEN10_USBHOST, CKEN);
|
||
15 years ago
|
|
||
|
return;
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
#ifdef CONFIG_DRIVER_DM9000
|
||
|
int board_eth_init(bd_t *bis)
|
||
|
{
|
||
|
return dm9000_initialize(bis);
|
||
|
}
|
||
|
#endif
|
||
13 years ago
|
|
||
|
#ifdef CONFIG_CMD_MMC
|
||
|
int board_mmc_init(bd_t *bis)
|
||
|
{
|
||
|
pxa_mmc_register(0);
|
||
|
return 0;
|
||
|
}
|
||
|
#endif
|