]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/Marvell/guruplug/guruplug.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / board / Marvell / guruplug / guruplug.c
index ba47ca179f26f50cc0f8327e690b8b6d45c18a82..72bccc821ce2cc2b7d9fe21e83382f0546a9663e 100644 (file)
@@ -3,34 +3,19 @@
  * Marvell Semiconductor <www.marvell.com>
  * Written-by: Siddarth Gore <gores@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 <miiphy.h>
+#include <asm/arch/cpu.h>
 #include <asm/arch/kirkwood.h>
 #include <asm/arch/mpp.h>
 #include "guruplug.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int board_init(void)
+int board_early_init_f(void)
 {
        /*
         * default gpio configuration
@@ -42,7 +27,7 @@ int board_init(void)
                        GURUPLUG_OE_LOW, GURUPLUG_OE_HIGH);
 
        /* Multi-Purpose Pins Functionality configuration */
-       u32 kwmpp_config[] = {
+       static const u32 kwmpp_config[] = {
                MPP0_NF_IO2,
                MPP1_NF_IO3,
                MPP2_NF_IO4,
@@ -95,8 +80,12 @@ int board_init(void)
                MPP49_GPIO,     /* B_GLED */
                0
        };
-       kirkwood_mpp_conf(kwmpp_config);
+       kirkwood_mpp_conf(kwmpp_config, NULL);
+       return 0;
+}
 
+int board_init(void)
+{
        /*
         * arch number of board
         */
@@ -108,17 +97,6 @@ int board_init(void)
        return 0;
 }
 
-int dram_init(void)
-{
-       int i;
-
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
-               gd->bd->bi_dram[i].start = kw_sdram_bar(i);
-               gd->bd->bi_dram[i].size = kw_sdram_bs(i);
-       }
-       return 0;
-}
-
 #ifdef CONFIG_RESET_PHY_R
 void mv_phy_88e1121_init(char *name)
 {
@@ -146,14 +124,7 @@ void mv_phy_88e1121_init(char *name)
        miiphy_write(name, devadr, MV88E1121_PGADR_REG, 0);
 
        /* reset the phy */
-       if (miiphy_read (name, devadr, PHY_BMCR, &reg) != 0) {
-               printf("Err..(%s) PHY status read failed\n", __FUNCTION__);
-               return;
-       }
-       if (miiphy_write (name, devadr, PHY_BMCR, reg | 0x8000) != 0) {
-               printf("Err..(%s) PHY reset failed\n", __FUNCTION__);
-               return;
-       }
+       miiphy_reset(name, devadr);
 
        printf("88E1121 Initialized on %s\n", name);
 }