]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/incaip/incaip.c
Coding Style cleanup: replace leading SPACEs by TABs
[karo-tx-uboot.git] / board / incaip / incaip.c
index dc513739fa3fce57c133cc18313f599006924389..217b8afa34734de04481702c1d102ed0be01187a 100644 (file)
@@ -2,27 +2,12 @@
  * (C) Copyright 2003
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * 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+
  */
 
 #include <common.h>
 #include <command.h>
+#include <netdev.h>
 #include <asm/addrspace.h>
 #include <asm/inca-ip.h>
 #include <asm/io.h>
@@ -39,21 +24,21 @@ static ulong max_sdram_size(void)
 {
        /* The only supported SDRAM data width is 16bit.
         */
-#define CFG_DW 2
+#define CONFIG_SYS_DW  2
 
        /* The only supported number of SDRAM banks is 4.
         */
-#define CFG_NB 4
+#define CONFIG_SYS_NB  4
 
        ulong cfgpb0 = *INCA_IP_SDRAM_MC_CFGPB0;
        int   cols   = cfgpb0 & 0xF;
        int   rows   = (cfgpb0 & 0xF0) >> 4;
-       ulong size   = (1 << (rows + cols)) * CFG_DW * CFG_NB;
+       ulong size   = (1 << (rows + cols)) * CONFIG_SYS_DW * CONFIG_SYS_NB;
 
        return size;
 }
 
-long int initdram(int board_type)
+phys_size_t initdram(int board_type)
 {
        int   rows, cols, best_val = *INCA_IP_SDRAM_MC_CFGPB0;
        ulong size, max_size       = 0;
@@ -73,9 +58,9 @@ long int initdram(int board_type)
                for (rows = 0xB; rows <= 0xD; rows++)
                {
                        *INCA_IP_SDRAM_MC_CFGPB0 = (0x14 << 8) |
-                                                  (rows << 4) | cols;
-                       size = get_ram_size((long *)CFG_SDRAM_BASE,
-                                                            max_sdram_size());
+                                                  (rows << 4) | cols;
+                       size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
+                                                            max_sdram_size());
 
                        if (size > max_size)
                        {
@@ -116,3 +101,10 @@ int checkboard (void)
 
        return 0;
 }
+
+#if defined(CONFIG_INCA_IP_SWITCH)
+int board_eth_init(bd_t *bis)
+{
+       return inca_switch_initialize(bis);
+}
+#endif