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> 26*7315e3bfSOtavio Salvador #include <asm/gpio.h> 2713b1ebdeSMarek Vasut #include <asm/io.h> 2813b1ebdeSMarek Vasut #include <asm/arch/iomux-mx23.h> 2964a93860SMarek Vasut #include <asm/arch/imx-regs.h> 3013b1ebdeSMarek Vasut #include <asm/arch/clock.h> 3164a93860SMarek Vasut #include <asm/arch/sys_proto.h> 3236c7c925SOtavio Salvador #ifdef CONFIG_STATUS_LED 3336c7c925SOtavio Salvador #include <status_led.h> 3436c7c925SOtavio Salvador #endif 3564a93860SMarek Vasut 3664a93860SMarek Vasut DECLARE_GLOBAL_DATA_PTR; 3764a93860SMarek Vasut 3864a93860SMarek Vasut /* 3964a93860SMarek Vasut * Functions 4064a93860SMarek Vasut */ 4164a93860SMarek Vasut int board_early_init_f(void) 4264a93860SMarek Vasut { 4313b1ebdeSMarek Vasut /* IO0 clock at 480MHz */ 4413b1ebdeSMarek Vasut mxs_set_ioclk(MXC_IOCLK0, 480000); 4513b1ebdeSMarek Vasut 4613b1ebdeSMarek Vasut /* SSP0 clock at 96MHz */ 4713b1ebdeSMarek Vasut mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); 4813b1ebdeSMarek Vasut 49ebe1d170SOtavio Salvador #ifdef CONFIG_CMD_USB 50ebe1d170SOtavio Salvador /* Enable LAN9512 */ 51ebe1d170SOtavio Salvador gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 1); 52ebe1d170SOtavio Salvador #endif 53ebe1d170SOtavio Salvador 5464a93860SMarek Vasut return 0; 5564a93860SMarek Vasut } 5664a93860SMarek Vasut 5764a93860SMarek Vasut int dram_init(void) 5864a93860SMarek Vasut { 5964a93860SMarek Vasut return mxs_dram_init(); 6064a93860SMarek Vasut } 6164a93860SMarek Vasut 6213b1ebdeSMarek Vasut #ifdef CONFIG_CMD_MMC 6313b1ebdeSMarek Vasut static int mx23_olx_mmc_cd(int id) 6413b1ebdeSMarek Vasut { 6513b1ebdeSMarek Vasut return 1; /* Card always present */ 6613b1ebdeSMarek Vasut } 6713b1ebdeSMarek Vasut 6813b1ebdeSMarek Vasut int board_mmc_init(bd_t *bis) 6913b1ebdeSMarek Vasut { 7013b1ebdeSMarek Vasut return mxsmmc_initialize(bis, 0, NULL, mx23_olx_mmc_cd); 7113b1ebdeSMarek Vasut } 7213b1ebdeSMarek Vasut #endif 7313b1ebdeSMarek Vasut 7464a93860SMarek Vasut int board_init(void) 7564a93860SMarek Vasut { 7664a93860SMarek Vasut /* Adress of boot parameters */ 7764a93860SMarek Vasut gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; 7864a93860SMarek Vasut 7936c7c925SOtavio Salvador #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT) 8036c7c925SOtavio Salvador status_led_set(STATUS_LED_BOOT, STATUS_LED_STATE); 8136c7c925SOtavio Salvador #endif 8236c7c925SOtavio Salvador 8364a93860SMarek Vasut return 0; 8464a93860SMarek Vasut } 85