blob: 0daff9abf148a0e556b82e3160c111611136c79f [file] [log] [blame]
wdenkd9fd6ff2002-10-11 08:43:32 +00001/*
2 * (C) Copyright 2002
3 * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
4 *
5 * (C) Copyright 2002
6 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
7 * Marius Groeger <mgroeger@sysgo.de>
8 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02009 * SPDX-License-Identifier: GPL-2.0+
wdenkd9fd6ff2002-10-11 08:43:32 +000010 */
11
12#include <common.h>
Ben Warren1ab70f62009-12-14 16:30:39 -080013#include <netdev.h>
Marek Vasut4438a452011-11-26 11:17:32 +010014#include <asm/arch/pxa.h>
Marek Vasute570fe82011-12-12 05:34:03 +000015#include <asm/arch/pxa-regs.h>
Marek Vasut831f8492012-09-30 10:09:49 +000016#include <asm/arch/regs-mmc.h>
Marek Vasute570fe82011-12-12 05:34:03 +000017#include <asm/io.h>
wdenkd9fd6ff2002-10-11 08:43:32 +000018
Wolfgang Denkd87080b2006-03-31 18:32:53 +020019DECLARE_GLOBAL_DATA_PTR;
wdenkd9fd6ff2002-10-11 08:43:32 +000020
21/*
22 * Miscelaneous platform dependent initialisations
23 */
24
25int board_init (void)
26{
Marek Vasut3c43ca22010-10-20 20:55:44 +020027 /* We have RAM, disable cache */
28 dcache_disable();
29 icache_disable();
wdenkd9fd6ff2002-10-11 08:43:32 +000030
31 /* arch number of Lubbock-Board */
wdenk731215e2004-10-10 18:41:04 +000032 gd->bd->bi_arch_number = MACH_TYPE_LUBBOCK;
wdenkd9fd6ff2002-10-11 08:43:32 +000033
34 /* adress of boot parameters */
35 gd->bd->bi_boot_params = 0xa0000100;
36
Marek Vasute570fe82011-12-12 05:34:03 +000037 /* Configure GPIO6 and GPIO8 as OUT, AF1. */
38 setbits_le32(GPDR0, (1 << 6) | (1 << 8));
39 clrsetbits_le32(GAFR0_L, (3 << 12) | (3 << 16), (1 << 12) | (1 << 16));
40
wdenkdb2f721f2003-03-06 00:58:30 +000041 return 0;
wdenkd9fd6ff2002-10-11 08:43:32 +000042}
43
Marek Vasut831f8492012-09-30 10:09:49 +000044#ifdef CONFIG_CMD_MMC
45int board_mmc_init(bd_t *bis)
46{
47 pxa_mmc_register(0);
48 return 0;
49}
50#endif
51
wdenkc837dcb2004-01-20 23:12:12 +000052int board_late_init(void)
wdenk71f95112003-06-15 22:40:42 +000053{
wdenkc837dcb2004-01-20 23:12:12 +000054 setenv("stdout", "serial");
55 setenv("stderr", "serial");
wdenk71f95112003-06-15 22:40:42 +000056 return 0;
57}
58
Marek Vasut3c43ca22010-10-20 20:55:44 +020059int dram_init(void)
60{
Marek Vasutf68d2a22011-11-26 11:18:57 +010061 pxa2xx_dram_init();
Marek Vasut3c43ca22010-10-20 20:55:44 +020062 gd->ram_size = PHYS_SDRAM_1_SIZE;
63 return 0;
64}
wdenk71f95112003-06-15 22:40:42 +000065
Marek Vasut3c43ca22010-10-20 20:55:44 +020066void dram_init_banksize(void)
wdenkd9fd6ff2002-10-11 08:43:32 +000067{
wdenkd9fd6ff2002-10-11 08:43:32 +000068 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
69 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
wdenkd9fd6ff2002-10-11 08:43:32 +000070}
Ben Warren1ab70f62009-12-14 16:30:39 -080071
72#ifdef CONFIG_CMD_NET
73int board_eth_init(bd_t *bis)
74{
75 int rc = 0;
76#ifdef CONFIG_LAN91C96
77 rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
78#endif
79 return rc;
80}
81#endif