Sandeep Paulraj | 6ab176d | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 1 | /* |
| 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 Paulraj | b157dd5 | 2010-12-28 17:38:22 -0500 | [diff] [blame] | 20 | #include <netdev.h> |
Sandeep Paulraj | 6ab176d | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 21 | #include <asm/io.h> |
Sandeep Paulraj | c1ee63c | 2009-11-21 18:08:49 -0500 | [diff] [blame] | 22 | #include <nand.h> |
| 23 | #include <asm/arch/nand_defs.h> |
Sandeep Paulraj | 6ab176d | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 24 | |
| 25 | DECLARE_GLOBAL_DATA_PTR; |
| 26 | |
Manjunath Hadli | b79df8f | 2011-11-08 08:59:57 -0500 | [diff] [blame] | 27 | #define REV_DM6467EVM 0 |
| 28 | #define REV_DM6467TEVM 1 |
| 29 | /* |
| 30 | * get_board_rev() - setup to pass kernel board revision information |
| 31 | * Returns: |
| 32 | * bit[0-3] System clock frequency |
| 33 | * 0000b - 27 MHz |
| 34 | * 0001b - 33 MHz |
| 35 | */ |
| 36 | u32 get_board_rev(void) |
| 37 | { |
| 38 | |
prabhakar.csengg@gmail.com | fda9c20 | 2012-02-12 21:38:22 +0000 | [diff] [blame] | 39 | #ifdef CONFIG_DAVINCI_DM6467TEVM |
Manjunath Hadli | b79df8f | 2011-11-08 08:59:57 -0500 | [diff] [blame] | 40 | return REV_DM6467TEVM; |
| 41 | #else |
| 42 | return REV_DM6467EVM; |
| 43 | #endif |
| 44 | |
| 45 | } |
| 46 | |
Sandeep Paulraj | 6ab176d | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 47 | int board_init(void) |
| 48 | { |
| 49 | gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM6467_EVM; |
| 50 | gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; |
| 51 | |
Sandeep Paulraj | b157dd5 | 2010-12-28 17:38:22 -0500 | [diff] [blame] | 52 | lpsc_on(DAVINCI_DM646X_LPSC_TIMER0); |
| 53 | lpsc_on(DAVINCI_DM646X_LPSC_UART0); |
| 54 | lpsc_on(DAVINCI_DM646X_LPSC_I2C); |
| 55 | lpsc_on(DAVINCI_DM646X_LPSC_EMAC); |
| 56 | |
| 57 | /* Enable GIO3.3V cells used for EMAC */ |
| 58 | REG(VDD3P3V_PWDN) = 0x80000c0; |
| 59 | |
| 60 | /* Select UART function on UART0 */ |
| 61 | REG(PINMUX0) &= ~(0x0000003f << 18); |
| 62 | REG(PINMUX1) &= ~(0x00000003); |
| 63 | |
Sandeep Paulraj | 6ab176d | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 64 | return 0; |
| 65 | } |
Sandeep Paulraj | c1ee63c | 2009-11-21 18:08:49 -0500 | [diff] [blame] | 66 | |
Sandeep Paulraj | b157dd5 | 2010-12-28 17:38:22 -0500 | [diff] [blame] | 67 | #if defined(CONFIG_DRIVER_TI_EMAC) |
| 68 | |
| 69 | int board_eth_init(bd_t *bis) |
| 70 | { |
| 71 | if (!davinci_emac_initialize()) { |
| 72 | printf("Error: Ethernet init failed!\n"); |
| 73 | return -1; |
| 74 | } |
| 75 | |
| 76 | return 0; |
| 77 | } |
| 78 | #endif /* CONFIG_DRIVER_TI_EMAC */ |
| 79 | |
Sandeep Paulraj | c1ee63c | 2009-11-21 18:08:49 -0500 | [diff] [blame] | 80 | #ifdef CONFIG_NAND_DAVINCI |
| 81 | int board_nand_init(struct nand_chip *nand) |
| 82 | { |
| 83 | davinci_nand_init(nand); |
| 84 | |
| 85 | return 0; |
| 86 | } |
| 87 | #endif |