X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=board%2Fmusenki%2Fmusenki.c;h=aa92fc4281056802bd4a11b8c53605759c94b4a1;hb=9067b30008e4c09fb6287d306caf2a6bed08370f;hp=d805f09e3f2403a6f4d74f2d200be42a75add703;hpb=ad10dd9aaf573fefe1cbd9d446a24f07f8b87428;p=karo-tx-uboot.git diff --git a/board/musenki/musenki.c b/board/musenki/musenki.c index d805f09e3f..aa92fc4281 100644 --- a/board/musenki/musenki.c +++ b/board/musenki/musenki.c @@ -2,28 +2,13 @@ * (C) Copyright 2001 * Rob Taylor, Flying Pig Systems. robt@flyingpig.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 #include #include +#include int checkboard (void) { @@ -35,7 +20,7 @@ int checkboard (void) } -#if 0 /* NOT USED */ +#if 0 /* NOT USED */ int checkflash (void) { /* TODO: XXX XXX XXX */ @@ -45,52 +30,26 @@ int checkflash (void) } #endif -long int initdram (int board_type) +phys_size_t initdram (int board_type) { - int i, cnt; - volatile uchar * base= CFG_SDRAM_BASE; - volatile ulong * addr; - ulong save[32]; - ulong val, ret = 0; - - for (i=0, cnt=(CFG_MAX_RAM_SIZE / sizeof(long)) >> 1; cnt > 0; cnt >>= 1) { - addr = (volatile ulong *)base + cnt; - save[i++] = *addr; - *addr = ~cnt; - } - - addr = (volatile ulong *)base; - save[i] = *addr; - *addr = 0; - - if (*addr != 0) { - *addr = save[i]; - goto Done; - } - - for (cnt = 1; cnt <= CFG_MAX_RAM_SIZE / sizeof(long); cnt <<= 1) { - addr = (volatile ulong *)base + cnt; - val = *addr; - *addr = save[--i]; - if (val != ~cnt) { - ulong new_bank0_end = cnt * sizeof(long) - 1; - ulong mear1 = mpc824x_mpc107_getreg(MEAR1); - ulong emear1 = mpc824x_mpc107_getreg(EMEAR1); - mear1 = (mear1 & 0xFFFFFF00) | - ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT); - emear1 = (emear1 & 0xFFFFFF00) | - ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT); - mpc824x_mpc107_setreg(MEAR1, mear1); - mpc824x_mpc107_setreg(EMEAR1, emear1); - - ret = cnt * sizeof(long); - goto Done; - } - } - - ret = CFG_MAX_RAM_SIZE; -Done: - return ret; + long size; + long new_bank0_end; + long mear1; + long emear1; + + size = get_ram_size(CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_MAX_RAM_SIZE); + + new_bank0_end = size - 1; + mear1 = mpc824x_mpc107_getreg(MEAR1); + emear1 = mpc824x_mpc107_getreg(EMEAR1); + mear1 = (mear1 & 0xFFFFFF00) | + ((new_bank0_end & MICR_ADDR_MASK) >> MICR_ADDR_SHIFT); + emear1 = (emear1 & 0xFFFFFF00) | + ((new_bank0_end & MICR_ADDR_MASK) >> MICR_EADDR_SHIFT); + mpc824x_mpc107_setreg(MEAR1, mear1); + mpc824x_mpc107_setreg(EMEAR1, emear1); + + return (size); } /* @@ -128,3 +87,8 @@ void pci_init_board(void) { pci_mpc824x_init(&hose); } + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +}