Sandeep Paulraj | 1830bba | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 Texas Instruments Incorporated |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Sandeep Paulraj | 1830bba | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Sandeep Paulraj | 0f45095 | 2010-12-28 17:38:22 -0500 | [diff] [blame] | 8 | #include <netdev.h> |
Sandeep Paulraj | 1830bba | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 9 | #include <asm/io.h> |
Sandeep Paulraj | dd62a11 | 2009-11-21 18:08:49 -0500 | [diff] [blame] | 10 | #include <nand.h> |
Khoronzhuk, Ivan | 753a00a | 2014-06-07 04:22:52 +0300 | [diff] [blame] | 11 | #include <asm/arch/hardware.h> |
| 12 | #include <asm/ti-common/davinci_nand.h> |
Sandeep Paulraj | 1830bba | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
Manjunath Hadli | eae752b | 2011-11-08 08:59:57 -0500 | [diff] [blame] | 16 | #define REV_DM6467EVM 0 |
| 17 | #define REV_DM6467TEVM 1 |
| 18 | /* |
| 19 | * get_board_rev() - setup to pass kernel board revision information |
| 20 | * Returns: |
| 21 | * bit[0-3] System clock frequency |
| 22 | * 0000b - 27 MHz |
| 23 | * 0001b - 33 MHz |
| 24 | */ |
| 25 | u32 get_board_rev(void) |
| 26 | { |
| 27 | |
prabhakar.csengg@gmail.com | 50bf417 | 2012-02-12 21:38:22 +0000 | [diff] [blame] | 28 | #ifdef CONFIG_DAVINCI_DM6467TEVM |
Manjunath Hadli | eae752b | 2011-11-08 08:59:57 -0500 | [diff] [blame] | 29 | return REV_DM6467TEVM; |
| 30 | #else |
| 31 | return REV_DM6467EVM; |
| 32 | #endif |
| 33 | |
| 34 | } |
| 35 | |
Sandeep Paulraj | 1830bba | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 36 | int board_init(void) |
| 37 | { |
| 38 | gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM6467_EVM; |
| 39 | gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; |
| 40 | |
Sandeep Paulraj | 0f45095 | 2010-12-28 17:38:22 -0500 | [diff] [blame] | 41 | lpsc_on(DAVINCI_DM646X_LPSC_TIMER0); |
| 42 | lpsc_on(DAVINCI_DM646X_LPSC_UART0); |
| 43 | lpsc_on(DAVINCI_DM646X_LPSC_I2C); |
| 44 | lpsc_on(DAVINCI_DM646X_LPSC_EMAC); |
| 45 | |
| 46 | /* Enable GIO3.3V cells used for EMAC */ |
| 47 | REG(VDD3P3V_PWDN) = 0x80000c0; |
| 48 | |
| 49 | /* Select UART function on UART0 */ |
| 50 | REG(PINMUX0) &= ~(0x0000003f << 18); |
| 51 | REG(PINMUX1) &= ~(0x00000003); |
| 52 | |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | #if defined(CONFIG_DRIVER_TI_EMAC) |
| 57 | |
| 58 | int board_eth_init(bd_t *bis) |
| 59 | { |
| 60 | if (!davinci_emac_initialize()) { |
| 61 | printf("Error: Ethernet init failed!\n"); |
| 62 | return -1; |
| 63 | } |
| 64 | |
Sandeep Paulraj | 1830bba | 2009-10-10 12:00:47 -0400 | [diff] [blame] | 65 | return 0; |
| 66 | } |
Sandeep Paulraj | 0f45095 | 2010-12-28 17:38:22 -0500 | [diff] [blame] | 67 | #endif /* CONFIG_DRIVER_TI_EMAC */ |
Sandeep Paulraj | dd62a11 | 2009-11-21 18:08:49 -0500 | [diff] [blame] | 68 | |
| 69 | #ifdef CONFIG_NAND_DAVINCI |
| 70 | int board_nand_init(struct nand_chip *nand) |
| 71 | { |
| 72 | davinci_nand_init(nand); |
| 73 | |
| 74 | return 0; |
| 75 | } |
| 76 | #endif |