X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=board%2Fti%2Fevm%2Fevm.c;h=ff3971dda8adf6167b08ecfeaa28b274a3a7ab00;hb=a69fdc7787bfa2f27eed74c2ee58c28ce932d502;hp=e8360df96062ee1f43cd53fc20cef8a6867be8fa;hpb=dcc4f38b4384fc6e63e3674100737ea6e250a19f;p=platform%2Fkernel%2Fu-boot.git diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index e8360df..ff3971d 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2004-2008 + * (C) Copyright 2004-2011 * Texas Instruments, * * Author : @@ -9,23 +9,7 @@ * Richard Woodruff * Syed Mohammed Khasim * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ #include #include @@ -34,9 +18,11 @@ #include #include #include -#include +#include #include +#include #include +#include #include "evm.h" #define OMAP3EVM_GPIO_ETH_RST_GEN1 64 @@ -119,6 +105,41 @@ int board_init(void) return 0; } +#ifdef CONFIG_SPL_BUILD +/* + * Routine: get_board_mem_timings + * Description: If we use SPL then there is no x-loader nor config header + * so we have to setup the DDR timings ourself on the first bank. This + * provides the timing values back to the function that configures + * the memory. + */ +void get_board_mem_timings(struct board_sdrc_timings *timings) +{ + int pop_mfr, pop_id; + + /* + * We need to identify what PoP memory is on the board so that + * we know what timings to use. To map the ID values please see + * nand_ids.c + */ + identify_nand_chip(&pop_mfr, &pop_id); + + if (pop_mfr == NAND_MFR_HYNIX && pop_id == 0xbc) { + /* 256MB DDR */ + timings->mcfg = HYNIX_V_MCFG_200(256 << 20); + timings->ctrla = HYNIX_V_ACTIMA_200; + timings->ctrlb = HYNIX_V_ACTIMB_200; + } else { + /* 128MB DDR */ + timings->mcfg = MICRON_V_MCFG_165(128 << 20); + timings->ctrla = MICRON_V_ACTIMA_165; + timings->ctrlb = MICRON_V_ACTIMB_165; + } + timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz; + timings->mr = MICRON_V_MR_165; +} +#endif + /* * Routine: misc_init_r * Description: Init ethernet (done here so udelay works) @@ -126,8 +147,8 @@ int board_init(void) int misc_init_r(void) { -#ifdef CONFIG_DRIVER_OMAP34XX_I2C - i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); +#ifdef CONFIG_SYS_I2C_OMAP34XX + i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); #endif #if defined(CONFIG_CMD_NET) @@ -138,7 +159,7 @@ int misc_init_r(void) #if defined(CONFIG_CMD_NET) reset_net_chip(); #endif - dieid_num_r(); + omap_die_id_display(); return 0; } @@ -196,37 +217,58 @@ static void reset_net_chip(void) rst_gpio = OMAP3EVM_GPIO_ETH_RST_GEN2; } - ret = omap_request_gpio(rst_gpio); + ret = gpio_request(rst_gpio, ""); if (ret < 0) { printf("Unable to get GPIO %d\n", rst_gpio); return ; } /* Configure as output */ - omap_set_gpio_direction(rst_gpio, 0); + gpio_direction_output(rst_gpio, 0); /* Send a pulse on the GPIO pin */ - omap_set_gpio_dataout(rst_gpio, 1); + gpio_set_value(rst_gpio, 1); udelay(1); - omap_set_gpio_dataout(rst_gpio, 0); + gpio_set_value(rst_gpio, 0); udelay(1); - omap_set_gpio_dataout(rst_gpio, 1); + gpio_set_value(rst_gpio, 1); } int board_eth_init(bd_t *bis) { int rc = 0; #ifdef CONFIG_SMC911X +#define STR_ENV_ETHADDR "ethaddr" + + struct eth_device *dev; + uchar eth_addr[6]; + rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); + + if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { + dev = eth_get_dev_by_index(0); + if (dev) { + eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + } else { + printf("omap3evm: Couldn't get eth device\n"); + rc = -1; + } + } #endif return rc; } #endif /* CONFIG_CMD_NET */ -#ifdef CONFIG_GENERIC_MMC +#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD) int board_mmc_init(bd_t *bis) { - omap_mmc_init(0); - return 0; + return omap_mmc_init(0, 0, 0, -1, -1); +} +#endif + +#if defined(CONFIG_GENERIC_MMC) +void board_mmc_power_init(void) +{ + twl4030_power_mmc_init(0); } #endif