Merge branch 'master' of git://git.denx.de/u-boot-samsung
[platform/kernel/u-boot.git] / board / Marvell / gplugd / gplugd.c
index b4f7f81..05ce98b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright 2011
  * eInfochips Ltd. <www.einfochips.com>
- * Written-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
+ * Written-by: Ajay Bhargav <contact@8051projects.net>
  *
  * Based on Aspenite:
  * (C) Copyright 2010
@@ -9,31 +9,17 @@
  * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
  * Contributor: Mahavir Jain <mjain@marvell.com>
  *
- * 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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <mvmfp.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/mfp.h>
 #include <asm/arch/armada100.h>
 #include <asm/gpio.h>
 #include <miiphy.h>
+#include <asm/mach-types.h>
 
 #ifdef CONFIG_ARMADA100_FEC
 #include <net.h>
@@ -72,6 +58,12 @@ int board_early_init_f(void)
                MFP101_ETH_MDIO,
                MFP103_ETH_RXDV,
 
+               /* SSP2 */
+               MFP107_SSP2_RXD,
+               MFP108_SSP2_TXD,
+               MFP110_SSP2_CS,
+               MFP111_SSP2_CLK,
+
                MFP_EOC         /*End of configuration*/
        };
        /* configure MFP's */
@@ -81,8 +73,11 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
+       struct armd1apb2_registers *apb2_regs =
+               (struct armd1apb2_registers *)ARMD1_APBC2_BASE;
+
        /* arch number of Board */
-       gd->bd->bi_arch_number = MACH_TYPE_SHEEVAD;
+       gd->bd->bi_arch_number = MACH_TYPE_GPLUGD;
        /* adress of boot parameters */
        gd->bd->bi_boot_params = armd1_sdram_base(0) + 0x100;
        /* Assert PHY_RST# */
@@ -90,6 +85,9 @@ int board_init(void)
        udelay(10);
        /* Deassert PHY_RST# */
        gpio_set_value(CONFIG_SYS_GPIO_PHY_RST, GPIO_HIGH);
+
+       /* Enable SSP2 clock */
+       writel(SSP2_APBCLK | SSP2_FNCLK, &apb2_regs->ssp2_clkrst);
        return 0;
 }