1566c9c16SVipin KUMAR /* 2566c9c16SVipin KUMAR * (C) Copyright 2009 3566c9c16SVipin KUMAR * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com. 4566c9c16SVipin KUMAR * 5566c9c16SVipin KUMAR * See file CREDITS for list of people who contributed to this 6566c9c16SVipin KUMAR * project. 7566c9c16SVipin KUMAR * 8566c9c16SVipin KUMAR * This program is free software; you can redistribute it and/or 9566c9c16SVipin KUMAR * modify it under the terms of the GNU General Public License as 10566c9c16SVipin KUMAR * published by the Free Software Foundation; either version 2 of 11566c9c16SVipin KUMAR * the License, or (at your option) any later version. 12566c9c16SVipin KUMAR * 13566c9c16SVipin KUMAR * This program is distributed in the hope that it will be useful, 14566c9c16SVipin KUMAR * but WITHOUT ANY WARRANTY; without even the implied warranty of 15566c9c16SVipin KUMAR * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16566c9c16SVipin KUMAR * GNU General Public License for more details. 17566c9c16SVipin KUMAR * 18566c9c16SVipin KUMAR * You should have received a copy of the GNU General Public License 19566c9c16SVipin KUMAR * along with this program; if not, write to the Free Software 20566c9c16SVipin KUMAR * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21566c9c16SVipin KUMAR * MA 02111-1307 USA 22566c9c16SVipin KUMAR */ 23566c9c16SVipin KUMAR 24566c9c16SVipin KUMAR #include <common.h> 25*9afc1af0SVipin Kumar #include <miiphy.h> 26deb00562SVipin KUMAR #include <netdev.h> 27566c9c16SVipin KUMAR #include <nand.h> 28566c9c16SVipin KUMAR #include <asm/io.h> 291fa943b9SVipin KUMAR #include <linux/mtd/fsmc_nand.h> 30566c9c16SVipin KUMAR #include <asm/arch/hardware.h> 31566c9c16SVipin KUMAR #include <asm/arch/spr_defs.h> 32566c9c16SVipin KUMAR #include <asm/arch/spr_misc.h> 331fa943b9SVipin KUMAR 341fa943b9SVipin KUMAR static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE]; 35566c9c16SVipin KUMAR 36566c9c16SVipin KUMAR int board_init(void) 37566c9c16SVipin KUMAR { 38566c9c16SVipin KUMAR return spear_board_init(MACH_TYPE_SPEAR600); 39566c9c16SVipin KUMAR } 40566c9c16SVipin KUMAR 41566c9c16SVipin KUMAR /* 42566c9c16SVipin KUMAR * board_nand_init - Board specific NAND initialization 43566c9c16SVipin KUMAR * @nand: mtd private chip structure 44566c9c16SVipin KUMAR * 45566c9c16SVipin KUMAR * Called by nand_init_chip to initialize the board specific functions 46566c9c16SVipin KUMAR */ 47566c9c16SVipin KUMAR 481fa943b9SVipin KUMAR void board_nand_init() 49566c9c16SVipin KUMAR { 50566c9c16SVipin KUMAR struct misc_regs *const misc_regs_p = 51566c9c16SVipin KUMAR (struct misc_regs *)CONFIG_SPEAR_MISCBASE; 521fa943b9SVipin KUMAR struct nand_chip *nand = &nand_chip[0]; 53566c9c16SVipin KUMAR 541fa943b9SVipin KUMAR #if defined(CONFIG_NAND_FSMC) 55566c9c16SVipin KUMAR if (!(readl(&misc_regs_p->auto_cfg_reg) & MISC_NANDDIS)) 561fa943b9SVipin KUMAR fsmc_nand_init(nand); 571fa943b9SVipin KUMAR #endif 581fa943b9SVipin KUMAR return; 59566c9c16SVipin KUMAR } 60deb00562SVipin KUMAR 61deb00562SVipin KUMAR int board_eth_init(bd_t *bis) 62deb00562SVipin KUMAR { 63*9afc1af0SVipin Kumar int ret = 0; 64*9afc1af0SVipin Kumar 65deb00562SVipin KUMAR #if defined(CONFIG_DESIGNWARE_ETH) 66*9afc1af0SVipin Kumar u32 interface = PHY_INTERFACE_MODE_MII; 67*9afc1af0SVipin Kumar #if defined(CONFIG_DW_AUTONEG) 68*9afc1af0SVipin Kumar interface = PHY_INTERFACE_MODE_GMII; 69deb00562SVipin KUMAR #endif 70*9afc1af0SVipin Kumar if (designware_initialize(0, CONFIG_SPEAR_ETHBASE, CONFIG_DW0_PHY, 71*9afc1af0SVipin Kumar interface) >= 0) 72*9afc1af0SVipin Kumar ret++; 73*9afc1af0SVipin Kumar #endif 74*9afc1af0SVipin Kumar return ret; 75deb00562SVipin KUMAR } 76