]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/etin/kvme080/kvme080.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / board / etin / kvme080 / kvme080.c
index de62fa0973870b18085da16c364aae110604dc54..baf4cbc4da1a33776f398fa1d6a4e8d602c1d023 100644 (file)
@@ -2,30 +2,16 @@
  * (C) Copyright 2005
  * Sangmoon Kim, Etin Systems. dogoil@etinsys.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+
  */
 
 #include <common.h>
 #include <mpc824x.h>
 #include <pci.h>
 #include <i2c.h>
+#include <netdev.h>
 #include <asm/processor.h>
+#include <asm/mmu.h>
 
 int checkboard(void)
 {
@@ -45,7 +31,7 @@ unsigned long setdram(int m, int row, int col, int bank)
        CONFIG_READ_WORD(MCCR1, mccr1);
        mccr1 &= 0xffff0000;
 
-       start = CFG_SDRAM_BASE;
+       start = CONFIG_SYS_SDRAM_BASE;
        end = start + (1 << (col + row + 3) ) * bank - 1;
 
        for (i = 0; i < m; i++) {
@@ -93,38 +79,38 @@ unsigned long setdram(int m, int row, int col, int bank)
        return (1 << (col + row + 3) ) * bank * m;
 }
 
-long int initdram(int board_type)
+phys_size_t initdram(int board_type)
 {
        unsigned int msr;
        long int size = 0;
 
        msr = mfmsr();
        mtmsr(msr & ~(MSR_IR | MSR_DR));
-       mtspr(IBAT2L, CFG_IBAT0L + 0x10000000);
-       mtspr(IBAT2U, CFG_IBAT0U + 0x10000000);
-       mtspr(DBAT2L, CFG_DBAT0L + 0x10000000);
-       mtspr(DBAT2U, CFG_DBAT0U + 0x10000000);
+       mtspr(IBAT2L, CONFIG_SYS_IBAT0L + 0x10000000);
+       mtspr(IBAT2U, CONFIG_SYS_IBAT0U + 0x10000000);
+       mtspr(DBAT2L, CONFIG_SYS_DBAT0L + 0x10000000);
+       mtspr(DBAT2U, CONFIG_SYS_DBAT0U + 0x10000000);
        mtmsr(msr);
 
-       if (setdram(2,13,10,4) == get_ram_size(CFG_SDRAM_BASE, 0x20000000))
+       if (setdram(2,13,10,4) == get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x20000000))
                size = 0x20000000;      /* 512MB */
-       else if (setdram(1,13,10,4) == get_ram_size(CFG_SDRAM_BASE, 0x10000000))
+       else if (setdram(1,13,10,4) == get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x10000000))
                size = 0x10000000;      /* 256MB */
-       else if (setdram(2,13,9,4) == get_ram_size(CFG_SDRAM_BASE, 0x10000000))
+       else if (setdram(2,13,9,4) == get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x10000000))
                size = 0x10000000;      /* 256MB */
-       else if (setdram(1,13,9,4) == get_ram_size(CFG_SDRAM_BASE, 0x08000000))
+       else if (setdram(1,13,9,4) == get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x08000000))
                size = 0x08000000;      /* 128MB */
-       else if (setdram(2,12,9,4) == get_ram_size(CFG_SDRAM_BASE, 0x08000000))
+       else if (setdram(2,12,9,4) == get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x08000000))
                size = 0x08000000;      /* 128MB */
-       else if (setdram(1,12,9,4) == get_ram_size(CFG_SDRAM_BASE, 0x04000000))
+       else if (setdram(1,12,9,4) == get_ram_size(CONFIG_SYS_SDRAM_BASE, 0x04000000))
                size = 0x04000000;      /* 64MB */
 
        msr = mfmsr();
        mtmsr(msr & ~(MSR_IR | MSR_DR));
-       mtspr(IBAT2L, CFG_IBAT2L);
-       mtspr(IBAT2U, CFG_IBAT2U);
-       mtspr(DBAT2L, CFG_DBAT2L);
-       mtspr(DBAT2U, CFG_DBAT2U);
+       mtspr(IBAT2L, CONFIG_SYS_IBAT2L);
+       mtspr(IBAT2U, CONFIG_SYS_IBAT2U);
+       mtspr(DBAT2L, CONFIG_SYS_DBAT2L);
+       mtspr(DBAT2U, CONFIG_SYS_DBAT2U);
        mtmsr(msr);
 
        return size;
@@ -191,3 +177,8 @@ void nvram_write(long dest, const void *src, size_t count)
                asm volatile("sync");
        }
 }
+
+int board_eth_init(bd_t *bis)
+{
+       return pci_eth_init(bis);
+}