blob: 1a01c3ce2cab58bfba2bf283828274f79ab2cc71 [file] [log] [blame]
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -04001/*
2 * Copyright (C) 2009 Texas Instruments Incorporated
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#include <common.h>
Sandeep Paulrajb157dd52010-12-28 17:38:22 -050020#include <netdev.h>
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -040021#include <asm/io.h>
Sandeep Paulrajc1ee63c2009-11-21 18:08:49 -050022#include <nand.h>
23#include <asm/arch/nand_defs.h>
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -040024
25DECLARE_GLOBAL_DATA_PTR;
26
27int board_init(void)
28{
29 gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM6467_EVM;
30 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
31
Sandeep Paulrajb157dd52010-12-28 17:38:22 -050032 lpsc_on(DAVINCI_DM646X_LPSC_TIMER0);
33 lpsc_on(DAVINCI_DM646X_LPSC_UART0);
34 lpsc_on(DAVINCI_DM646X_LPSC_I2C);
35 lpsc_on(DAVINCI_DM646X_LPSC_EMAC);
36
37 /* Enable GIO3.3V cells used for EMAC */
38 REG(VDD3P3V_PWDN) = 0x80000c0;
39
40 /* Select UART function on UART0 */
41 REG(PINMUX0) &= ~(0x0000003f << 18);
42 REG(PINMUX1) &= ~(0x00000003);
43
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -040044 return 0;
45}
Sandeep Paulrajc1ee63c2009-11-21 18:08:49 -050046
Sandeep Paulrajb157dd52010-12-28 17:38:22 -050047#if defined(CONFIG_DRIVER_TI_EMAC)
48
49int board_eth_init(bd_t *bis)
50{
51 if (!davinci_emac_initialize()) {
52 printf("Error: Ethernet init failed!\n");
53 return -1;
54 }
55
56 return 0;
57}
58#endif /* CONFIG_DRIVER_TI_EMAC */
59
Sandeep Paulrajc1ee63c2009-11-21 18:08:49 -050060#ifdef CONFIG_NAND_DAVINCI
61int board_nand_init(struct nand_chip *nand)
62{
63 davinci_nand_init(nand);
64
65 return 0;
66}
67#endif