164a93860SMarek Vasut /* 264a93860SMarek Vasut * Olimex MX23 Olinuxino board 364a93860SMarek Vasut * 464a93860SMarek Vasut * Copyright (C) 2013 Marek Vasut <marex@denx.de> 564a93860SMarek Vasut * 664a93860SMarek Vasut * See file CREDITS for list of people who contributed to this 764a93860SMarek Vasut * project. 864a93860SMarek Vasut * 964a93860SMarek Vasut * This program is free software; you can redistribute it and/or 1064a93860SMarek Vasut * modify it under the terms of the GNU General Public License as 1164a93860SMarek Vasut * published by the Free Software Foundation; either version 2 of 1264a93860SMarek Vasut * the License, or (at your option) any later version. 1364a93860SMarek Vasut * 1464a93860SMarek Vasut * This program is distributed in the hope that it will be useful, 1564a93860SMarek Vasut * but WITHOUT ANY WARRANTY; without even the implied warranty of 1664a93860SMarek Vasut * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1764a93860SMarek Vasut * GNU General Public License for more details. 1864a93860SMarek Vasut * 1964a93860SMarek Vasut * You should have received a copy of the GNU General Public License 2064a93860SMarek Vasut * along with this program; if not, write to the Free Software 2164a93860SMarek Vasut * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 2264a93860SMarek Vasut * MA 02111-1307 USA 2364a93860SMarek Vasut */ 2464a93860SMarek Vasut 2564a93860SMarek Vasut #include <common.h> 2613b1ebdeSMarek Vasut #include <asm/io.h> 2713b1ebdeSMarek Vasut #include <asm/arch/iomux-mx23.h> 2864a93860SMarek Vasut #include <asm/arch/imx-regs.h> 2913b1ebdeSMarek Vasut #include <asm/arch/clock.h> 3064a93860SMarek Vasut #include <asm/arch/sys_proto.h> 3136c7c925SOtavio Salvador #ifdef CONFIG_STATUS_LED 3236c7c925SOtavio Salvador #include <status_led.h> 3336c7c925SOtavio Salvador #endif 3464a93860SMarek Vasut 3564a93860SMarek Vasut DECLARE_GLOBAL_DATA_PTR; 3664a93860SMarek Vasut 3764a93860SMarek Vasut /* 3864a93860SMarek Vasut * Functions 3964a93860SMarek Vasut */ 4064a93860SMarek Vasut int board_early_init_f(void) 4164a93860SMarek Vasut { 4213b1ebdeSMarek Vasut /* IO0 clock at 480MHz */ 4313b1ebdeSMarek Vasut mxs_set_ioclk(MXC_IOCLK0, 480000); 4413b1ebdeSMarek Vasut 4513b1ebdeSMarek Vasut /* SSP0 clock at 96MHz */ 4613b1ebdeSMarek Vasut mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); 4713b1ebdeSMarek Vasut 48*ebe1d170SOtavio Salvador #ifdef CONFIG_CMD_USB 49*ebe1d170SOtavio Salvador /* Enable LAN9512 */ 50*ebe1d170SOtavio Salvador gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 1); 51*ebe1d170SOtavio Salvador #endif 52*ebe1d170SOtavio Salvador 5364a93860SMarek Vasut return 0; 5464a93860SMarek Vasut } 5564a93860SMarek Vasut 5664a93860SMarek Vasut int dram_init(void) 5764a93860SMarek Vasut { 5864a93860SMarek Vasut return mxs_dram_init(); 5964a93860SMarek Vasut } 6064a93860SMarek Vasut 6113b1ebdeSMarek Vasut #ifdef CONFIG_CMD_MMC 6213b1ebdeSMarek Vasut static int mx23_olx_mmc_cd(int id) 6313b1ebdeSMarek Vasut { 6413b1ebdeSMarek Vasut return 1; /* Card always present */ 6513b1ebdeSMarek Vasut } 6613b1ebdeSMarek Vasut 6713b1ebdeSMarek Vasut int board_mmc_init(bd_t *bis) 6813b1ebdeSMarek Vasut { 6913b1ebdeSMarek Vasut return mxsmmc_initialize(bis, 0, NULL, mx23_olx_mmc_cd); 7013b1ebdeSMarek Vasut } 7113b1ebdeSMarek Vasut #endif 7213b1ebdeSMarek Vasut 7364a93860SMarek Vasut int board_init(void) 7464a93860SMarek Vasut { 7564a93860SMarek Vasut /* Adress of boot parameters */ 7664a93860SMarek Vasut gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; 7764a93860SMarek Vasut 7836c7c925SOtavio Salvador #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) 7936c7c925SOtavio Salvador status_led_set(STATUS_LED_BOOT, STATUS_LED_STATE); 8036c7c925SOtavio Salvador #endif 8136c7c925SOtavio Salvador 8264a93860SMarek Vasut return 0; 8364a93860SMarek Vasut } 84