Merge tag 'efi-2020-07-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / board / freescale / bsc9132qds / bsc9132qds.c
index c88838b3dfac59a7d83e002c222e14128e167b82..6870674f7a4144a6fd29eada5274519a69018ca5 100644 (file)
@@ -1,17 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2013 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <image.h>
+#include <init.h>
+#include <net.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/cache.h>
 #include <asm/immap_85xx.h>
 #include <asm/io.h>
+#include <env.h>
 #include <miiphy.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <fsl_mdio.h>
 #include <tsec.h>
@@ -36,9 +39,9 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int board_early_init_f(void)
 {
-       struct fsl_ifc *ifc = (void *)CONFIG_SYS_IFC_ADDR;
+       struct fsl_ifc ifc = {(void *)CONFIG_SYS_IFC_ADDR, (void *)NULL};
 
-       setbits_be32(&ifc->ifc_gcr, 1 << IFC_GCR_TBCTL_TRN_TIME_SHIFT);
+       setbits_be32(&ifc.gregs->ifc_gcr, 1 << IFC_GCR_TBCTL_TRN_TIME_SHIFT);
 
        return 0;
 }
@@ -151,7 +154,7 @@ void dsp_ddr_configure(void)
 
 int board_early_init_r(void)
 {
-#ifndef CONFIG_SYS_NO_FLASH
+#ifdef CONFIG_MTD_NOR_FLASH
        const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
        int flash_esel = find_tlb_idx((void *)flashbase, 1);
 
@@ -227,9 +230,9 @@ int checkboard(void)
        return 0;
 }
 
-#ifdef CONFIG_TSEC_ENET
 int board_eth_init(bd_t *bis)
 {
+#ifdef CONFIG_TSEC_ENET
        struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[4];
        int num = 0;
@@ -250,6 +253,7 @@ int board_eth_init(bd_t *bis)
 
        fsl_pq_mdio_init(bis, &mdio_info);
        tsec_eth_init(bis, tsec_info, num);
+#endif
 
        #ifdef CONFIG_PCI
        pci_eth_init(bis);
@@ -257,7 +261,6 @@ int board_eth_init(bd_t *bis)
 
        return 0;
 }
-#endif
 
 #define USBMUX_SEL_MASK                0xc0
 #define USBMUX_SEL_UART2       0xc0
@@ -358,20 +361,20 @@ void fdt_del_node_compat(void *blob, const char *compatible)
 
 #if defined(CONFIG_OF_BOARD_SETUP)
 #ifdef CONFIG_FDT_FIXUP_PARTITIONS
-struct node_info nodes[] = {
+static const struct node_info nodes[] = {
        { "cfi-flash",                  MTD_DEV_TYPE_NOR,  },
        { "fsl,ifc-nand",               MTD_DEV_TYPE_NAND, },
 };
 #endif
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
 {
        phys_addr_t base;
        phys_size_t size;
 
        ft_cpu_setup(blob, bd);
 
-       base = getenv_bootm_low();
-       size = getenv_bootm_size();
+       base = env_get_bootm_low();
+       size = env_get_bootm_size();
 
        #if defined(CONFIG_PCI)
        FT_FSL_PCI_SETUP;
@@ -394,7 +397,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                        /* remove dts usb node */
                        fdt_del_node_compat(blob, "fsl-usb2-dr");
                } else {
-                       fdt_fixup_dr_usb(blob, bd);
+                       fsl_fdt_fixup_dr_usb(blob, bd);
                        fdt_del_node_and_alias(blob, "serial2");
                }
        }
@@ -423,5 +426,7 @@ void ft_board_setup(void *blob, bd_t *bd)
                        printf("\nRemove sim from hwconfig and reset\n");
                }
        }
+
+       return 0;
 }
 #endif