SPDX: Convert all of our single license tags to Linux Kernel style
[oweals/u-boot.git] / board / freescale / common / fman.c
index 3ef49369a4738fca3dbe25e7a39e006170df8f85..358303108d8dc7531d55947377553efeee42a43b 100644 (file)
@@ -1,32 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2011 Freescale Semiconductor, Inc.
- *
- * 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
+ * Copyright 2011-2015 Freescale Semiconductor, Inc.
  */
 
 #include <common.h>
-#include <libfdt.h>
-#include <libfdt_env.h>
+#include <linux/libfdt.h>
+#include <linux/libfdt_env.h>
 #include <fdt_support.h>
 
 #include <fm_eth.h>
+#ifdef CONFIG_FSL_LAYERSCAPE
+#include <asm/arch/fsl_serdes.h>
+#else
 #include <asm/fsl_serdes.h>
+#endif
 
 /*
  * Given the following ...
@@ -64,6 +51,8 @@ int fdt_set_phy_handle(void *fdt, char *compat, phys_addr_t addr,
        if (!ph)
                return -FDT_ERR_BADPHANDLE;
 
+       ph = cpu_to_fdt32(ph);
+
        offset = fdt_node_offset_by_compat_reg(fdt, compat, addr);
        if (offset < 0)
                return offset;