diff options
| -rwxr-xr-x | MAKEALL | 1 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | board/munices/Makefile | 55 | ||||
| -rw-r--r-- | board/munices/config.mk | 38 | ||||
| -rw-r--r-- | board/munices/mt48lc16m16a2-75.h | 43 | ||||
| -rw-r--r-- | board/munices/munices.c | 170 | ||||
| -rw-r--r-- | board/munices/u-boot.lds | 123 | ||||
| -rw-r--r-- | cpu/mpc5xxx/fec.c | 7 | 
8 files changed, 438 insertions, 3 deletions
| @@ -46,6 +46,7 @@ LIST_5xxx="		\  	mcc200		\  	mecp5200	\  	motionpro	\ +	munices		\  	o2dnt		\  	pf5200		\  	PM520		\ @@ -576,6 +576,10 @@ prs200_highboot_DDR_config:	unconfig  mecp5200_config:  unconfig  	@$(MKCONFIG) -a mecp5200  ppc mpc5xxx mecp5200 esd +munices_config:	unconfig +	@ >include/config.h +	@$(MKCONFIG) -a munices ppc mpc5xxx munices +  o2dnt_config:  	@$(MKCONFIG) o2dnt ppc mpc5xxx o2dnt diff --git a/board/munices/Makefile b/board/munices/Makefile new file mode 100644 index 000000000..111caed08 --- /dev/null +++ b/board/munices/Makefile @@ -0,0 +1,55 @@ + +# +# (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 +# + +include $(TOPDIR)/config.mk + +LIB	= lib$(BOARD).a + +OBJS	:= $(BOARD).o + +$(LIB):	$(OBJS) $(SOBJS) +	$(AR) crv $@ $(OBJS) + +%.dtb: %.dts +	dtc -f -V 0x10 -I dts -O dtb $< >$@ + +%.c: %.dtb +	xxd -i $< \ +	   | sed -e "s/^unsigned char/const unsigned char/g" \ +	   | sed -e "s/^unsigned int/const unsigned int/g" > $@ + +clean: +	rm -f $(SOBJS) $(OBJS) + +distclean:	clean +	rm -f $(LIB) core *.bak .depend + +######################################################################### + +.depend:	Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c) +		$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@ + +-include .depend + +######################################################################### diff --git a/board/munices/config.mk b/board/munices/config.mk new file mode 100644 index 000000000..d226244a1 --- /dev/null +++ b/board/munices/config.mk @@ -0,0 +1,38 @@ +# +# (C) Copyright 2007 +# Heiko Schocher, DENX Software Engineering, hs@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 +# + +# +# MUNICes board: +# +#	Valid values for TEXT_BASE are: +# +#	0xFFF00000   boot high (standard configuration) +# + +sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp + +ifndef TEXT_BASE +TEXT_BASE = 0xFFF00000 +endif + +PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board diff --git a/board/munices/mt48lc16m16a2-75.h b/board/munices/mt48lc16m16a2-75.h new file mode 100644 index 000000000..ffdf0396a --- /dev/null +++ b/board/munices/mt48lc16m16a2-75.h @@ -0,0 +1,43 @@ +/* + * (C) Copyright 2004 + * Mark Jonas, Freescale Semiconductor, mark.jonas@motorola.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 + */ + +#define SDRAM_DDR	0		/* is SDR */ + +#if defined(CONFIG_MPC5200) +/* Settings for XLB = 132 MHz */ +#define SDRAM_MODE	0x00CD0000 +#define SDRAM_CONTROL	0x504F0000 +#define SDRAM_CONFIG1	0xD2322800 +#define SDRAM_CONFIG2	0x8AD70000 + +#elif defined(CONFIG_MGT5100) +/* Settings for XLB = 66 MHz */ +#define SDRAM_MODE	0x008D0000 +#define SDRAM_CONTROL	0x504F0000 +#define SDRAM_CONFIG1	0xC2222600 +#define SDRAM_CONFIG2	0x88B70004 +#define SDRAM_ADDRSEL	0x02000000 + +#else +#error Neither CONFIG_MPC5200 or CONFIG_MGT5100 defined +#endif diff --git a/board/munices/munices.c b/board/munices/munices.c new file mode 100644 index 000000000..395909d7c --- /dev/null +++ b/board/munices/munices.c @@ -0,0 +1,170 @@ +/* + * (C) Copyright 2007 + * Heiko Schocher, DENX Software Engineering, hs@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 + */ + +#include <common.h> +#include <mpc5xxx.h> +#include <pci.h> + +#include "mt48lc16m16a2-75.h" + +#ifndef CFG_RAMBOOT +static void sdram_start (int hi_addr) +{ +	long hi_addr_bit = hi_addr ? 0x01000000 : 0; + +	/* unlock mode register */ +	*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000000 | hi_addr_bit; +	__asm__ volatile ("sync"); + +	/* precharge all banks */ +	*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit; +	__asm__ volatile ("sync"); + +#if SDRAM_DDR +	/* set mode register: extended mode */ +	*(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_EMODE; +	__asm__ volatile ("sync"); + +	/* set mode register: reset DLL */ +	*(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE | 0x04000000; +	__asm__ volatile ("sync"); +#endif + +	/* precharge all banks */ +	*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000002 | hi_addr_bit; +	__asm__ volatile ("sync"); + +	/* auto refresh */ +	*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x80000004 | hi_addr_bit; +	__asm__ volatile ("sync"); + +	/* set mode register */ +	*(vu_long *)MPC5XXX_SDRAM_MODE = SDRAM_MODE; +	__asm__ volatile ("sync"); + +	/* normal operation */ +	*(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | hi_addr_bit; +	__asm__ volatile ("sync"); +} +#endif + +/* + * ATTENTION: Although partially referenced initdram does NOT make real use + *            use of CFG_SDRAM_BASE. The code does not work if CFG_SDRAM_BASE + *            is something else than 0x00000000. + */ + +long int initdram (int board_type) +{ +	ulong dramsize = 0; +	ulong dramsize2 = 0; +#ifndef CFG_RAMBOOT +	ulong test1, test2; + +	/* setup SDRAM chip selects */ +	*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001b;/* 256MB at 0x0 */ +	*(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x10000000;/* disabled */ +	__asm__ volatile ("sync"); + +	/* setup config registers */ +	*(vu_long *)MPC5XXX_SDRAM_CONFIG1 = SDRAM_CONFIG1; +	*(vu_long *)MPC5XXX_SDRAM_CONFIG2 = SDRAM_CONFIG2; +	__asm__ volatile ("sync"); + +#if SDRAM_DDR && SDRAM_TAPDELAY +	/* set tap delay */ +	*(vu_long *)MPC5XXX_CDM_PORCFG = SDRAM_TAPDELAY; +	__asm__ volatile ("sync"); +#endif + +	/* find RAM size using SDRAM CS0 only */ +	sdram_start(0); +	test1 = (ulong )get_ram_size((long *)CFG_SDRAM_BASE, 0x10000000); +	sdram_start(1); +	test2 = (ulong )get_ram_size((long *)CFG_SDRAM_BASE, 0x10000000); +	if (test1 > test2) { +		sdram_start(0); +		dramsize = test1; +	} else { +		dramsize = test2; +	} + +	/* memory smaller than 1MB is impossible */ +	if (dramsize < (1 << 20)) { +		dramsize = 0; +	} + +	/* set SDRAM CS0 size according to the amount of RAM found */ +	if (dramsize > 0) { +		*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x13 + __builtin_ffs(dramsize >> 20) - 1; +	} else { +		*(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0; /* disabled */ +	} + +#else /* CFG_RAMBOOT */ + +	/* retrieve size of memory connected to SDRAM CS0 */ +	dramsize = *(vu_long *)MPC5XXX_SDRAM_CS0CFG & 0xFF; +	if (dramsize >= 0x13) { +		dramsize = (1 << (dramsize - 0x13)) << 20; +	} else { +		dramsize = 0; +	} + +	/* retrieve size of memory connected to SDRAM CS1 */ +	dramsize2 = *(vu_long *)MPC5XXX_SDRAM_CS1CFG & 0xFF; +	if (dramsize2 >= 0x13) { +		dramsize2 = (1 << (dramsize2 - 0x13)) << 20; +	} else { +		dramsize2 = 0; +	} + +#endif /* CFG_RAMBOOT */ + +	return dramsize + dramsize2; +} + +int checkboard (void) +{ +	puts ("Board: MUNICes\n"); +	return 0; +} + +#ifdef	CONFIG_PCI +static struct pci_controller hose; + +extern void pci_mpc5xxx_init(struct pci_controller *); + +void pci_init_board(void) +{ +	pci_mpc5xxx_init(&hose); +} +#endif + +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +void +ft_board_setup(void *blob, bd_t *bd) +{ +	ft_cpu_setup(blob, bd); +} +#endif diff --git a/board/munices/u-boot.lds b/board/munices/u-boot.lds new file mode 100644 index 000000000..4bc1f238b --- /dev/null +++ b/board/munices/u-boot.lds @@ -0,0 +1,123 @@ +/* + * (C) Copyright 2007 + * Heiko Schocher, DENX Software Engineering, hs@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 + */ + +OUTPUT_ARCH(powerpc) +SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); +/* Do we need any of these for elf? +   __DYNAMIC = 0;    */ +SECTIONS +{ +  /* Read-only sections, merged into text segment: */ +  . = + SIZEOF_HEADERS; +  .interp : { *(.interp) } +  .hash          : { *(.hash)		} +  .dynsym        : { *(.dynsym)		} +  .dynstr        : { *(.dynstr)		} +  .rel.text      : { *(.rel.text)		} +  .rela.text     : { *(.rela.text) 	} +  .rel.data      : { *(.rel.data)		} +  .rela.data     : { *(.rela.data) 	} +  .rel.rodata    : { *(.rel.rodata) 	} +  .rela.rodata   : { *(.rela.rodata) 	} +  .rel.got       : { *(.rel.got)		} +  .rela.got      : { *(.rela.got)		} +  .rel.ctors     : { *(.rel.ctors)	} +  .rela.ctors    : { *(.rela.ctors)	} +  .rel.dtors     : { *(.rel.dtors)	} +  .rela.dtors    : { *(.rela.dtors)	} +  .rel.bss       : { *(.rel.bss)		} +  .rela.bss      : { *(.rela.bss)		} +  .rel.plt       : { *(.rel.plt)		} +  .rela.plt      : { *(.rela.plt)		} +  .init          : { *(.init)	} +  .plt : { *(.plt) } +  .text      : +  { +    cpu/mpc5xxx/start.o	(.text) +    *(.text) +    *(.fixup) +    *(.got1) +    . = ALIGN(16); +    *(.rodata) +    *(.rodata1) +    *(.rodata.str1.4) +  } +  .fini      : { *(.fini)    } =0 +  .ctors     : { *(.ctors)   } +  .dtors     : { *(.dtors)   } + +  /* Read-write section, merged into data segment: */ +  . = (. + 0x0FFF) & 0xFFFFF000; +  _erotext = .; +  PROVIDE (erotext = .); +  .reloc   : +  { +    *(.got) +    _GOT2_TABLE_ = .; +    *(.got2) +    _FIXUP_TABLE_ = .; +    *(.fixup) +  } +  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2; +  __fixup_entries = (. - _FIXUP_TABLE_) >> 2; + +  .data    : +  { +    *(.data) +    *(.data1) +    *(.sdata) +    *(.sdata2) +    *(.dynamic) +    CONSTRUCTORS +  } +  _edata  =  .; +  PROVIDE (edata = .); + +  . = .; +  __u_boot_cmd_start = .; +  .u_boot_cmd : { *(.u_boot_cmd) } +  __u_boot_cmd_end = .; + + +  __start___ex_table = .; +  __ex_table : { *(__ex_table) } +  __stop___ex_table = .; + +  . = ALIGN(4096); +  __init_begin = .; +  .text.init : { *(.text.init) } +  .data.init : { *(.data.init) } +  . = ALIGN(4096); +  __init_end = .; + +  __bss_start = .; +  .bss       : +  { +   *(.sbss) *(.scommon) +   *(.dynbss) +   *(.bss) +   *(COMMON) +  } +  _end = . ; +  PROVIDE (end = .); +} diff --git a/cpu/mpc5xxx/fec.c b/cpu/mpc5xxx/fec.c index 1d3da779a..2aded1a5f 100644 --- a/cpu/mpc5xxx/fec.c +++ b/cpu/mpc5xxx/fec.c @@ -288,13 +288,13 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)  		 * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock  		 * and do not drop the Preamble.  		 */ -		fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1);	/* No MII for 7-wire mode */ +		fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */  	}  	/*  	 * Set Opcode/Pause Duration Register  	 */ -	fec->eth->op_pause = 0x00010020;	/*FIXME0xffff0020; */ +	fec->eth->op_pause = 0x00010020;	/*FIXME 0xffff0020; */  	/*  	 * Set Rx FIFO alarm and granularity value @@ -902,7 +902,8 @@ int mpc5xxx_fec_initialize(bd_t * bis)  	defined(CONFIG_TOP5200)		|| \  	defined(CONFIG_TQM5200)		|| \  	defined(CONFIG_UC101)		|| \ -	defined(CONFIG_V38B) +	defined(CONFIG_V38B)		|| \ +	defined(CONFIG_MUNICES)  # ifndef CONFIG_FEC_10MBIT  	fec->xcv_type = MII100;  # else |