]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/freescale/corenet_ds/eth_hydra.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / board / freescale / corenet_ds / eth_hydra.c
index 91b340826dd0ac9be235fcf774fc4207415a5fd0..a594efcada7dad81527cda4d208cae04e098ebbe 100644 (file)
@@ -2,23 +2,7 @@
  * Copyright 2009-2011 Freescale Semiconductor, Inc.
  * Author: Timur Tabi <timur@freescale.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., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -70,6 +54,7 @@
 #include <fm_eth.h>
 #include <fsl_mdio.h>
 #include <malloc.h>
+#include <fdt_support.h>
 #include <asm/fsl_dtsec.h>
 
 #include "../common/ngpixis.h"
@@ -199,25 +184,6 @@ static int hydra_mdio_init(char *realbusname, char *fakebusname)
        return mdio_register(bus);
 }
 
-/*
- * Given an alias or a path for a node, set the status of that node.
- *
- * If 'alias' is not a valid alias, then it is treated as a full path to the
- * node.  No error checking is performed.
- *
- * This function is normally called to set the status for a virtual MDIO node.
- */
-static void fdt_set_node_status(void *fdt, const char *alias,
-                               const char *status)
-{
-       const char *path = fdt_get_alias(fdt, alias);
-
-       if (!path)
-               path = alias;
-
-       do_fixup_by_path(fdt, path, "status", status, strlen(status) + 1, 1);
-}
-
 /*
  * Given an alias or a path for a node, set the mux value of that node.
  *
@@ -372,14 +338,14 @@ void fdt_fixup_board_enet(void *fdt)
                case PHY_INTERFACE_MODE_SGMII:
                        lane = serdes_get_first_lane(SGMII_FM1_DTSEC1 + idx);
                        if (lane >= 0) {
-                               fdt_set_node_status(fdt, "emi1_sgmii", "okay");
+                               fdt_status_okay_by_alias(fdt, "emi1_sgmii");
                                /* Also set the MUX value */
                                fdt_set_mdio_mux(fdt, "emi1_sgmii",
                                                 mdio_mux[i].val);
                        }
                        break;
                case PHY_INTERFACE_MODE_RGMII:
-                       fdt_set_node_status(fdt, "emi1_rgmii", "okay");
+                       fdt_status_okay_by_alias(fdt, "emi1_rgmii");
                        break;
                default:
                        break;
@@ -388,14 +354,13 @@ void fdt_fixup_board_enet(void *fdt)
 
        lane = serdes_get_first_lane(XAUI_FM1);
        if (lane >= 0)
-               fdt_set_node_status(fdt, "emi2_xgmii", "okay");
+               fdt_status_okay_by_alias(fdt, "emi2_xgmii");
 #endif
 }
 
 int board_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_FMAN_ENET
-       struct dtsec *tsec = (void *)CONFIG_SYS_FSL_FM1_DTSEC1_ADDR;
        struct fsl_pq_mdio_info dtsec_mdio_info;
        struct tgec_mdio_info tgec_mdio_info;
        unsigned int i, slot;
@@ -405,13 +370,6 @@ int board_eth_init(bd_t *bis)
 
        initialize_lane_to_slot();
 
-       /*
-        * Set TBIPA on FM1@DTSEC1.  This is needed for configurations
-        * where FM1@DTSEC1 isn't used directly, since it provides
-        * MDIO for other ports.
-        */
-       out_be32(&tsec->tbipa, CONFIG_SYS_TBIPA_VALUE);
-
        /* We want to use the PIXIS to configure MUX routing, not GPIOs. */
        setbits_8(&pixis->brdcfg2, BRDCFG2_REG_GPIO_SEL);