blob: 469c9bac4b2fc580036315d916252557908576b6 [file] [log] [blame]
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -04001/*
2 * Copyright (C) 2009 Texas Instruments Incorporated
3 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -04005 */
6
7#include <common.h>
Sandeep Paulrajb157dd52010-12-28 17:38:22 -05008#include <netdev.h>
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -04009#include <asm/io.h>
Sandeep Paulrajc1ee63c2009-11-21 18:08:49 -050010#include <nand.h>
11#include <asm/arch/nand_defs.h>
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -040012
13DECLARE_GLOBAL_DATA_PTR;
14
Manjunath Hadlib79df8f2011-11-08 08:59:57 -050015#define REV_DM6467EVM 0
16#define REV_DM6467TEVM 1
17/*
18 * get_board_rev() - setup to pass kernel board revision information
19 * Returns:
20 * bit[0-3] System clock frequency
21 * 0000b - 27 MHz
22 * 0001b - 33 MHz
23 */
24u32 get_board_rev(void)
25{
26
prabhakar.csengg@gmail.comfda9c202012-02-12 21:38:22 +000027#ifdef CONFIG_DAVINCI_DM6467TEVM
Manjunath Hadlib79df8f2011-11-08 08:59:57 -050028 return REV_DM6467TEVM;
29#else
30 return REV_DM6467EVM;
31#endif
32
33}
34
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -040035int board_init(void)
36{
37 gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM6467_EVM;
38 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
39
Sandeep Paulrajb157dd52010-12-28 17:38:22 -050040 lpsc_on(DAVINCI_DM646X_LPSC_TIMER0);
41 lpsc_on(DAVINCI_DM646X_LPSC_UART0);
42 lpsc_on(DAVINCI_DM646X_LPSC_I2C);
43 lpsc_on(DAVINCI_DM646X_LPSC_EMAC);
44
45 /* Enable GIO3.3V cells used for EMAC */
46 REG(VDD3P3V_PWDN) = 0x80000c0;
47
48 /* Select UART function on UART0 */
49 REG(PINMUX0) &= ~(0x0000003f << 18);
50 REG(PINMUX1) &= ~(0x00000003);
51
Sandeep Paulraj6ab176d2009-10-10 12:00:47 -040052 return 0;
53}
Sandeep Paulrajc1ee63c2009-11-21 18:08:49 -050054
Sandeep Paulrajb157dd52010-12-28 17:38:22 -050055#if defined(CONFIG_DRIVER_TI_EMAC)
56
57int board_eth_init(bd_t *bis)
58{
59 if (!davinci_emac_initialize()) {
60 printf("Error: Ethernet init failed!\n");
61 return -1;
62 }
63
64 return 0;
65}
66#endif /* CONFIG_DRIVER_TI_EMAC */
67
Sandeep Paulrajc1ee63c2009-11-21 18:08:49 -050068#ifdef CONFIG_NAND_DAVINCI
69int board_nand_init(struct nand_chip *nand)
70{
71 davinci_nand_init(nand);
72
73 return 0;
74}
75#endif