diff options
Diffstat (limited to 'board')
65 files changed, 906 insertions, 103 deletions
diff --git a/board/Marvell/db64360/mv_eth.c b/board/Marvell/db64360/mv_eth.c index d1ac0c5..30304b0 100644 --- a/board/Marvell/db64360/mv_eth.c +++ b/board/Marvell/db64360/mv_eth.c @@ -248,7 +248,7 @@ void mv6436x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG @@ -351,7 +351,7 @@ void mv6436x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG diff --git a/board/Marvell/db64460/mv_eth.c b/board/Marvell/db64460/mv_eth.c index 58b63a3..cd9d5a4 100644 --- a/board/Marvell/db64460/mv_eth.c +++ b/board/Marvell/db64460/mv_eth.c @@ -248,7 +248,7 @@ void mv6446x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG @@ -350,7 +350,7 @@ void mv6446x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG diff --git a/board/avnet/fx12mm/fx12mm.c b/board/avnet/fx12mm/fx12mm.c index 4858645..e671a7b 100644 --- a/board/avnet/fx12mm/fx12mm.c +++ b/board/avnet/fx12mm/fx12mm.c @@ -34,7 +34,7 @@ int checkboard(void) { char tmp[64]; char *s, *e; - int i = getenv_r("serial", tmp, sizeof(tmp)); + int i = getenv_f("serial", tmp, sizeof(tmp)); if (i < 0) { printf("Avnet Virtex4 FX12 with no serial #"); diff --git a/board/cray/L1/L1.c b/board/cray/L1/L1.c index 1656e8a..33f2089 100644 --- a/board/cray/L1/L1.c +++ b/board/cray/L1/L1.c @@ -245,7 +245,7 @@ int testdram (void) uint *pend = (uint *) L1_MEMSIZE; uint *p; - if (getenv_r("booted",NULL,0) <= 0) + if (getenv_f("booted",NULL,0) <= 0) { printf ("testdram.."); /*AA*/ diff --git a/board/dave/PPChameleonEVB/PPChameleonEVB.c b/board/dave/PPChameleonEVB/PPChameleonEVB.c index 6bc70ef..8e26996 100644 --- a/board/dave/PPChameleonEVB/PPChameleonEVB.c +++ b/board/dave/PPChameleonEVB/PPChameleonEVB.c @@ -183,7 +183,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/esd/adciop/adciop.c b/board/esd/adciop/adciop.c index 63aaf2c..8e00785 100644 --- a/board/esd/adciop/adciop.c +++ b/board/esd/adciop/adciop.c @@ -62,7 +62,7 @@ int board_early_init_f (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); puts ("Board: "); diff --git a/board/esd/apc405/apc405.c b/board/esd/apc405/apc405.c index b58c1eb..564ee00 100644 --- a/board/esd/apc405/apc405.c +++ b/board/esd/apc405/apc405.c @@ -404,7 +404,7 @@ int misc_init_r(void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/esd/ar405/ar405.c b/board/esd/ar405/ar405.c index 21b2432..8879faf 100644 --- a/board/esd/ar405/ar405.c +++ b/board/esd/ar405/ar405.c @@ -151,7 +151,7 @@ int checkboard (void) int index; int len; char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); const unsigned char *fpga; puts ("Board: "); diff --git a/board/esd/ash405/ash405.c b/board/esd/ash405/ash405.c index 03c4098..ea28090 100644 --- a/board/esd/ash405/ash405.c +++ b/board/esd/ash405/ash405.c @@ -173,7 +173,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/esd/canbt/canbt.c b/board/esd/canbt/canbt.c index bfec548..0d2d7f1 100644 --- a/board/esd/canbt/canbt.c +++ b/board/esd/canbt/canbt.c @@ -157,7 +157,7 @@ int checkboard (void) int index; int len; char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); puts ("Board: "); diff --git a/board/esd/cms700/cms700.c b/board/esd/cms700/cms700.c index 20346e1..dcd49d4 100644 --- a/board/esd/cms700/cms700.c +++ b/board/esd/cms700/cms700.c @@ -96,7 +96,7 @@ int checkboard (void) puts ("Board: "); - if (getenv_r("serial#", str, sizeof(str)) == -1) { + if (getenv_f("serial#", str, sizeof(str)) == -1) { puts ("### No HW ID - assuming CMS700"); } else { puts(str); diff --git a/board/esd/cpci2dp/cpci2dp.c b/board/esd/cpci2dp/cpci2dp.c index 00456a7..ecfcf59 100644 --- a/board/esd/cpci2dp/cpci2dp.c +++ b/board/esd/cpci2dp/cpci2dp.c @@ -94,7 +94,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c index 51d3355..51e10fd 100644 --- a/board/esd/cpci405/cpci405.c +++ b/board/esd/cpci405/cpci405.c @@ -416,7 +416,7 @@ int checkboard(void) int len; #endif char str[64]; - int i = getenv_r("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); unsigned short ver; puts("Board: "); diff --git a/board/esd/cpci750/mv_eth.c b/board/esd/cpci750/mv_eth.c index dedf734..781ad23 100644 --- a/board/esd/cpci750/mv_eth.c +++ b/board/esd/cpci750/mv_eth.c @@ -248,7 +248,7 @@ void mv6436x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG @@ -352,7 +352,7 @@ void mv6436x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG diff --git a/board/esd/cpciiser4/cpciiser4.c b/board/esd/cpciiser4/cpciiser4.c index dcea50e..10a40be 100644 --- a/board/esd/cpciiser4/cpciiser4.c +++ b/board/esd/cpciiser4/cpciiser4.c @@ -153,7 +153,7 @@ int checkboard (void) int index; int len; char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); puts ("Board: "); diff --git a/board/esd/dasa_sim/dasa_sim.c b/board/esd/dasa_sim/dasa_sim.c index 127374b..e7f754c 100644 --- a/board/esd/dasa_sim/dasa_sim.c +++ b/board/esd/dasa_sim/dasa_sim.c @@ -168,7 +168,7 @@ int checkboard (void) int index; int len; char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); int fpga; unsigned short val; diff --git a/board/esd/dp405/dp405.c b/board/esd/dp405/dp405.c index 228a570..5878092 100644 --- a/board/esd/dp405/dp405.c +++ b/board/esd/dp405/dp405.c @@ -86,7 +86,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); unsigned char trans[16] = {0x0,0x8,0x4,0xc,0x2,0xa,0x6,0xe, 0x1,0x9,0x5,0xd,0x3,0xb,0x7,0xf}; unsigned char id1, id2, rev; diff --git a/board/esd/du405/du405.c b/board/esd/du405/du405.c index aa7ee92..e0faa77 100644 --- a/board/esd/du405/du405.c +++ b/board/esd/du405/du405.c @@ -163,7 +163,7 @@ int checkboard (void) int index; int len; char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); puts ("Board: "); diff --git a/board/esd/du440/du440.c b/board/esd/du440/du440.c index ba3c97c..ad255f9 100644 --- a/board/esd/du440/du440.c +++ b/board/esd/du440/du440.c @@ -350,7 +350,7 @@ int checkboard(void) puts("Board: DU440"); - if (getenv_r("serial#", serno, sizeof(serno)) > 0) { + if (getenv_f("serial#", serno, sizeof(serno)) > 0) { puts(", serial# "); puts(serno); } diff --git a/board/esd/hh405/hh405.c b/board/esd/hh405/hh405.c index ca7868c..c5e9514 100644 --- a/board/esd/hh405/hh405.c +++ b/board/esd/hh405/hh405.c @@ -650,7 +650,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); @@ -660,7 +660,7 @@ int checkboard (void) puts(str); } - if (getenv_r("bd_type", str, sizeof(str)) != -1) { + if (getenv_f("bd_type", str, sizeof(str)) != -1) { printf(" (%s", str); } else { puts(" (Missing bd_type!"); @@ -780,7 +780,7 @@ void video_get_info_str (int line_number, char *info) { char str[64]; char str2[64]; - int i = getenv_r("serial#", str2, sizeof(str)); + int i = getenv_f("serial#", str2, sizeof(str)); if (line_number == 1) { sprintf(str, " Board: "); @@ -791,7 +791,7 @@ void video_get_info_str (int line_number, char *info) strcat(str, str2); } - if (getenv_r("bd_type", str2, sizeof(str2)) != -1) { + if (getenv_f("bd_type", str2, sizeof(str2)) != -1) { strcat(str, " ("); strcat(str, str2); } else { diff --git a/board/esd/hub405/hub405.c b/board/esd/hub405/hub405.c index 2a2c434..d17c415 100644 --- a/board/esd/hub405/hub405.c +++ b/board/esd/hub405/hub405.c @@ -196,7 +196,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); @@ -206,7 +206,7 @@ int checkboard (void) puts(str); } - if (getenv_r("bd_type", str, sizeof(str)) != -1) { + if (getenv_f("bd_type", str, sizeof(str)) != -1) { printf(" (%s", str); } else { puts(" (Missing bd_type!"); diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c index a1b66cb..694bd74 100644 --- a/board/esd/meesc/meesc.c +++ b/board/esd/meesc/meesc.c @@ -184,7 +184,7 @@ int checkboard(void) puts("Board: EtherCAN/2 Gateway"); break; } - if (getenv_r("serial#", str, sizeof(str)) > 0) { + if (getenv_f("serial#", str, sizeof(str)) > 0) { puts(", serial# "); puts(str); } diff --git a/board/esd/ocrtc/ocrtc.c b/board/esd/ocrtc/ocrtc.c index ab909e5..24c92e3 100644 --- a/board/esd/ocrtc/ocrtc.c +++ b/board/esd/ocrtc/ocrtc.c @@ -68,7 +68,7 @@ int board_early_init_f (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); puts ("Board: "); diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c index 07d9c62..410d8b4 100644 --- a/board/esd/otc570/otc570.c +++ b/board/esd/otc570/otc570.c @@ -258,7 +258,7 @@ int checkboard(void) char str[32]; puts("Board: esd ARM9 HMI Panel - OTC570"); - if (getenv_r("serial#", str, sizeof(str)) > 0) { + if (getenv_f("serial#", str, sizeof(str)) > 0) { puts(", serial# "); puts(str); } @@ -308,7 +308,7 @@ int misc_init_r(void) printf("USART0: "); - if (getenv_r("usart0", str, sizeof(str)) == -1) { + if (getenv_f("usart0", str, sizeof(str)) == -1) { printf("No entry - assuming 1-wire\n"); /* CTS pin, works as mode select pin (0 = 1-wire; 1 = RS485) */ at91_set_pio_output(AT91_PIO_PORTA, 29, 0); diff --git a/board/esd/pci405/pci405.c b/board/esd/pci405/pci405.c index b0d7663..dd97c7a 100644 --- a/board/esd/pci405/pci405.c +++ b/board/esd/pci405/pci405.c @@ -298,7 +298,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/esd/plu405/plu405.c b/board/esd/plu405/plu405.c index 3a8a4cf..b68ffaf 100644 --- a/board/esd/plu405/plu405.c +++ b/board/esd/plu405/plu405.c @@ -240,7 +240,7 @@ int misc_init_r(void) int checkboard(void) { char str[64]; - int i = getenv_r("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts("Board: "); diff --git a/board/esd/pmc405/pmc405.c b/board/esd/pmc405/pmc405.c index e7415e4..03143fe 100644 --- a/board/esd/pmc405/pmc405.c +++ b/board/esd/pmc405/pmc405.c @@ -123,7 +123,7 @@ int checkboard (void) { ulong val; char str[64]; - int i = getenv_r("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/esd/voh405/voh405.c b/board/esd/voh405/voh405.c index 6ed493e..da25212 100644 --- a/board/esd/voh405/voh405.c +++ b/board/esd/voh405/voh405.c @@ -271,7 +271,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); @@ -281,7 +281,7 @@ int checkboard (void) puts(str); } - if (getenv_r("bd_type", str, sizeof(str)) != -1) { + if (getenv_f("bd_type", str, sizeof(str)) != -1) { printf(" (%s)", str); } else { puts(" (Missing bd_type!)"); diff --git a/board/esd/vom405/vom405.c b/board/esd/vom405/vom405.c index de35036..f665a3e 100644 --- a/board/esd/vom405/vom405.c +++ b/board/esd/vom405/vom405.c @@ -121,7 +121,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); int flashcnt; int delay; u8 *led_reg = (u8 *)(CAN_BA + 0x1000); diff --git a/board/esd/wuh405/wuh405.c b/board/esd/wuh405/wuh405.c index 704cd02..5a65133 100644 --- a/board/esd/wuh405/wuh405.c +++ b/board/esd/wuh405/wuh405.c @@ -173,7 +173,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/evb64260/eth.c b/board/evb64260/eth.c index ca8bab5..8d1b606 100644 --- a/board/evb64260/eth.c +++ b/board/evb64260/eth.c @@ -708,7 +708,7 @@ gt6426x_eth_initialize(bd_t *bis) return; } - temp = getenv_r (s, buf, sizeof(buf)); + temp = getenv_f(s, buf, sizeof(buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile index 2d48d7e..f93045f 100644 --- a/board/freescale/common/Makefile +++ b/board/freescale/common/Makefile @@ -46,6 +46,7 @@ COBJS-$(CONFIG_MPC8536DS) += ics307_clk.o COBJS-$(CONFIG_MPC8572DS) += ics307_clk.o COBJS-$(CONFIG_P1022DS) += ics307_clk.o COBJS-$(CONFIG_P2020DS) += ics307_clk.o +COBJS-$(CONFIG_P4080DS) += ics307_clk.o SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) OBJS := $(addprefix $(obj),$(COBJS-y)) diff --git a/board/freescale/corenet_ds/Makefile b/board/freescale/corenet_ds/Makefile new file mode 100644 index 0000000..8aa7255 --- /dev/null +++ b/board/freescale/corenet_ds/Makefile @@ -0,0 +1,55 @@ +# +# Copyright 2007-2009 Freescale Semiconductor, Inc. +# (C) Copyright 2001-2006 +# 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 = $(obj)lib$(BOARD).a + +COBJS-y += $(BOARD).o +COBJS-$(CONFIG_DDR_SPD) += ddr.o +COBJS-$(CONFIG_PCI) += pci.o +COBJS-y += law.o +COBJS-y += tlb.o + +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +clean: + rm -f $(OBJS) $(SOBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/freescale/corenet_ds/config.mk b/board/freescale/corenet_ds/config.mk new file mode 100644 index 0000000..72db24e --- /dev/null +++ b/board/freescale/corenet_ds/config.mk @@ -0,0 +1,30 @@ +# +# Copyright 2007-2009 Freescale Semiconductor, Inc. +# +# 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 +# + +# +# P4080DS board +# +ifndef TEXT_BASE +TEXT_BASE = 0xeff80000 +endif + +RESET_VECTOR_ADDRESS = 0xeffffffc diff --git a/board/freescale/corenet_ds/corenet_ds.c b/board/freescale/corenet_ds/corenet_ds.c new file mode 100644 index 0000000..3cdefb3 --- /dev/null +++ b/board/freescale/corenet_ds/corenet_ds.c @@ -0,0 +1,259 @@ +/* + * Copyright 2009-2010 Freescale Semiconductor, Inc. + * + * 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 <command.h> +#include <netdev.h> +#include <asm/mmu.h> +#include <asm/processor.h> +#include <asm/cache.h> +#include <asm/immap_85xx.h> +#include <asm/fsl_law.h> +#include <asm/fsl_ddr_sdram.h> +#include <asm/fsl_serdes.h> +#include <asm/fsl_portals.h> +#include <asm/fsl_liodn.h> + +extern void pci_of_setup(void *blob, bd_t *bd); + +#include "../common/ngpixis.h" + +DECLARE_GLOBAL_DATA_PTR; + +void cpu_mp_lmb_reserve(struct lmb *lmb); + +int checkboard (void) +{ + u8 sw; + struct cpu_type *cpu = gd->cpu; + + printf("Board: %sDS, ", cpu->name); + printf("Sys ID: 0x%02x, Sys Ver: 0x%02x, FPGA Ver: 0x%02x, ", + in_8(&pixis->id), in_8(&pixis->arch), in_8(&pixis->scver)); + + sw = in_8(&PIXIS_SW(PIXIS_LBMAP_SWITCH)); + sw = (sw & PIXIS_LBMAP_MASK) >> PIXIS_LBMAP_SHIFT; + + if (sw < 0x8) + printf("vBank: %d\n", sw); + else if (sw == 0x8) + puts("Promjet\n"); + else if (sw == 0x9) + puts("NAND\n"); + else + printf("invalid setting of SW%u\n", PIXIS_LBMAP_SWITCH); + +#ifdef CONFIG_PHYS_64BIT + puts("36-bit Addressing\n"); +#endif + + /* Display the actual SERDES reference clocks as configured by the + * dip switches on the board. Note that the SWx registers could + * technically be set to force the reference clocks to match the + * values that the SERDES expects (or vice versa). For now, however, + * we just display both values and hope the user notices when they + * don't match. + */ + puts("SERDES Reference Clocks: "); + sw = in_8(&PIXIS_SW(3)); + printf("Bank1=%uMHz ", (sw & 0x40) ? 125 : 100); + printf("Bank2=%sMHz ", (sw & 0x20) ? "156.25" : "125"); + printf("Bank3=%sMHz\n", (sw & 0x10) ? "156.25" : "125"); + + return 0; +} + +int board_early_init_f(void) +{ + volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + + /* + * P4080 DS board only uses the DDR1_MCK0/3 and DDR2_MCK0/3 + * disable the DDR1_MCK1/2/4/5 and DDR2_MCK1/2/4/5 to reduce + * the noise introduced by these unterminated and unused clock pairs. + */ + setbits_be32(&gur->ddrclkdr, 0x001B001B); + + return 0; +} + +int board_early_init_r(void) +{ + const unsigned int flashbase = CONFIG_SYS_FLASH_BASE; + const u8 flash_esel = find_tlb_idx((void *)flashbase, 1); + + /* + * Remap Boot flash + PROMJET region to caching-inhibited + * so that flash can be erased properly. + */ + + /* Flush d-cache and invalidate i-cache of any FLASH data */ + flush_dcache(); + invalidate_icache(); + + /* invalidate existing TLB entry for flash + promjet */ + disable_tlb(flash_esel); + + set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS, /* tlb, epn, rpn */ + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, /* perms, wimge */ + 0, flash_esel, BOOKE_PAGESZ_256M, 1); /* ts, esel, tsize, iprot */ + + set_liodns(); + setup_portals(); + +#ifdef CONFIG_SRIO1 + if (is_serdes_configured(SRIO1)) { + set_next_law(CONFIG_SYS_RIO1_MEM_PHYS, LAW_SIZE_256M, + LAW_TRGT_IF_RIO_1); + } else { + printf (" SRIO1: disabled\n"); + } +#else + setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO1); /* disable */ +#endif + +#ifdef CONFIG_SRIO2 + if (is_serdes_configured(SRIO2)) { + set_next_law(CONFIG_SYS_RIO2_MEM_PHYS, LAW_SIZE_256M, + LAW_TRGT_IF_RIO_2); + } else { + printf (" SRIO2: disabled\n"); + } +#else + setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_SRIO2); /* disable */ +#endif + + return 0; +} + +static const char *serdes_clock_to_string(u32 clock) +{ + switch(clock) { + case SRDS_PLLCR0_RFCK_SEL_100: + return "100"; + case SRDS_PLLCR0_RFCK_SEL_125: + return "125"; + case SRDS_PLLCR0_RFCK_SEL_156_25: + return "156.25"; + default: + return "???"; + } +} + +#define NUM_SRDS_BANKS 3 + +int misc_init_r(void) +{ + serdes_corenet_t *srds_regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR; + u32 actual[NUM_SRDS_BANKS]; + unsigned int i; + u8 sw3; + + /* Warn if the expected SERDES reference clocks don't match the + * actual reference clocks. This needs to be done after calling + * p4080_erratum_serdes8(), since that function may modify the clocks. + */ + sw3 = in_8(&PIXIS_SW(3)); + actual[0] = (sw3 & 0x40) ? + SRDS_PLLCR0_RFCK_SEL_125 : SRDS_PLLCR0_RFCK_SEL_100; + actual[1] = (sw3 & 0x20) ? + SRDS_PLLCR0_RFCK_SEL_156_25 : SRDS_PLLCR0_RFCK_SEL_125; + actual[2] = (sw3 & 0x10) ? + SRDS_PLLCR0_RFCK_SEL_156_25 : SRDS_PLLCR0_RFCK_SEL_125; + + for (i = 0; i < NUM_SRDS_BANKS; i++) { + u32 expected = srds_regs->bank[i].pllcr0 & SRDS_PLLCR0_RFCK_SEL_MASK; + if (expected != actual[i]) { + printf("Warning: SERDES bank %u expects reference clock" + " %sMHz, but actual is %sMHz\n", i + 1, + serdes_clock_to_string(expected), + serdes_clock_to_string(actual[i])); + } + } + + return 0; +} + +phys_size_t initdram(int board_type) +{ + phys_size_t dram_size; + + puts("Initializing....\n"); + + dram_size = fsl_ddr_sdram(); + + setup_ddr_tlbs(dram_size / 0x100000); + + puts(" DDR: "); + return dram_size; +} + +#ifdef CONFIG_MP +void board_lmb_reserve(struct lmb *lmb) +{ + cpu_mp_lmb_reserve(lmb); +} +#endif + +void ft_srio_setup(void *blob) +{ +#ifdef CONFIG_SRIO1 + if (!is_serdes_configured(SRIO1)) { + fdt_del_node_and_alias(blob, "rio0"); + } +#else + fdt_del_node_and_alias(blob, "rio0"); +#endif +#ifdef CONFIG_SRIO2 + if (!is_serdes_configured(SRIO2)) { + fdt_del_node_and_alias(blob, "rio1"); + } +#else + fdt_del_node_and_alias(blob, "rio1"); +#endif +} + +void ft_board_setup(void *blob, bd_t *bd) +{ + phys_addr_t base; + phys_size_t size; + + ft_cpu_setup(blob, bd); + + ft_srio_setup(blob); + + base = getenv_bootm_low(); + size = getenv_bootm_size(); + + fdt_fixup_memory(blob, (u64)base, (u64)size); + +#ifdef CONFIG_PCI + pci_of_setup(blob, bd); +#endif + + fdt_fixup_liodn(blob); +} + +int board_eth_init(bd_t *bis) +{ + return pci_eth_init(bis); +} diff --git a/board/freescale/corenet_ds/ddr.c b/board/freescale/corenet_ds/ddr.c new file mode 100644 index 0000000..82b2b4f --- /dev/null +++ b/board/freescale/corenet_ds/ddr.c @@ -0,0 +1,176 @@ +/* + * Copyright 2009-2010 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * Version 2 as published by the Free Software Foundation. + */ + +#include <common.h> +#include <i2c.h> + +#include <asm/fsl_ddr_sdram.h> +#include <asm/fsl_ddr_dimm_params.h> + +static void get_spd(ddr3_spd_eeprom_t *spd, unsigned char i2c_address) +{ + int ret; + + ret = i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr3_spd_eeprom_t)); + if (ret) { + debug("DDR: failed to read SPD from address %u\n", i2c_address); + memset(spd, 0, sizeof(ddr3_spd_eeprom_t)); + } +} + +unsigned int fsl_ddr_get_mem_data_rate(void) +{ + return get_ddr_freq(0); +} + +void fsl_ddr_get_spd(ddr3_spd_eeprom_t *ctrl_dimms_spd, + unsigned int ctrl_num) +{ + unsigned int i; + unsigned int i2c_address = 0; + + for (i = 0; i < CONFIG_DIMM_SLOTS_PER_CTLR; i++) { + if (ctrl_num == 0 && i == 0) + i2c_address = SPD_EEPROM_ADDRESS1; + else if (ctrl_num == 1 && i == 0) + i2c_address = SPD_EEPROM_ADDRESS2; + + get_spd(&(ctrl_dimms_spd[i]), i2c_address); + } +} + +typedef struct { + u32 datarate_mhz_low; + u32 datarate_mhz_high; + u32 n_ranks; + u32 clk_adjust; + u32 cpo; + u32 write_data_delay; + u32 force_2T; +} board_specific_parameters_t; + +/* ranges for parameters: + * wr_data_delay = 0-6 + * clk adjust = 0-8 + * cpo 2-0x1E (30) + */ + + +/* XXX: these values need to be checked for all interleaving modes. */ +/* XXX: No reliable dual-rank 800 MHz setting has been found. It may + * seem reliable, but errors will appear when memory intensive + * program is run. */ +/* XXX: Single rank at 800 MHz is OK. */ +const board_specific_parameters_t board_specific_parameters[][20] = { + { + /* memory controller 0 */ + /* lo| hi| num| clk| cpo|wrdata|2T */ + /* mhz| mhz|ranks|adjst| | delay| */ + { 0, 333, 2, 6, 7, 3, 0}, + {334, 400, 2, 6, 9, 3, 0}, + {401, 549, 2, 6, 11, 3, 0}, + {550, 680, 2, 1, 10, 5, 0}, + {681, 850, 2, 1, 12, 5, 0}, + {851, 1050, 2, 1, 12, 5, 0}, + {1051, 1250, 2, 1, 15, 4, 0}, + {1251, 1350, 2, 1, 15, 4, 0}, + { 0, 333, 1, 6, 7, 3, 0}, + {334, 400, 1, 6, 9, 3, 0}, + {401, 549, 1, 6, 11, 3, 0}, + {550, 680, 1, 1, 10, 5, 0}, + {681, 850, 1, 1, 12, 5, 0} + }, + + { + /* memory controller 1 */ + /* lo| hi| num| clk| cpo|wrdata|2T */ + /* mhz| mhz|ranks|adjst| | delay| */ + { 0, 333, 2, 6, 7, 3, 0}, + {334, 400, 2, 6, 9, 3, 0}, + {401, 549, 2, 6, 11, 3, 0}, + {550, 680, 2, 1, 11, 6, 0}, + {681, 850, 2, 1, 13, 6, 0}, + {851, 1050, 2, 1, 13, 6, 0}, + {1051, 1250, 2, 1, 15, 4, 0}, + {1251, 1350, 2, 1, 15, 4, 0}, + { 0, 333, 1, 6, 7, 3, 0}, + {334, 400, 1, 6, 9, 3, 0}, + {401, 549, 1, 6, 11, 3, 0}, + {550, 680, 1, 1, 11, 6, 0}, + {681, 850, 1, 1, 13, 6, 0} + } +}; + +void fsl_ddr_board_options(memctl_options_t *popts, + dimm_params_t *pdimm, + unsigned int ctrl_num) +{ + const board_specific_parameters_t *pbsp = + &(board_specific_parameters[ctrl_num][0]); + u32 num_params = sizeof(board_specific_parameters[ctrl_num]) / + sizeof(board_specific_parameters[0][0]); + u32 i; + ulong ddr_freq; + + /* set odt_rd_cfg and odt_wr_cfg. If the there is only one dimm in + * that controller, set odt_wr_cfg to 4 for CS0, and 0 to CS1. If + * there are two dimms in the controller, set odt_rd_cfg to 3 and + * odt_wr_cfg to 3 for the even CS, 0 for the odd CS. + */ + for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) { + if (i&1) { /* odd CS */ + popts->cs_local_opts[i].odt_rd_cfg = 0; + popts->cs_local_opts[i].odt_wr_cfg = 1; + } else { /* even CS */ + if (CONFIG_DIMM_SLOTS_PER_CTLR == 1) { + popts->cs_local_opts[i].odt_rd_cfg = 0; + popts->cs_local_opts[i].odt_wr_cfg = 1; + } else if (CONFIG_DIMM_SLOTS_PER_CTLR == 2) { + popts->cs_local_opts[i].odt_rd_cfg = 3; + popts->cs_local_opts[i].odt_wr_cfg = 3; + } + } + } + + /* Get clk_adjust, cpo, write_data_delay,2T, according to the board ddr + * freqency and n_banks specified in board_specific_parameters table. + */ + ddr_freq = get_ddr_freq(0) / 1000000; + for (i = 0; i < num_params; i++) { + if (ddr_freq >= pbsp->datarate_mhz_low && + ddr_freq <= pbsp->datarate_mhz_high && + pdimm->n_ranks == pbsp->n_ranks) { + popts->cpo_override = 0xff; /* force auto CPO calibration */ + popts->write_data_delay = 2; + popts->clk_adjust = 5; /* Force value to be 5/8 clock cycle */ + popts->twoT_en = pbsp->force_2T; + } + pbsp++; + } + + /* + * Factors to consider for half-strength driver enable: + * - number of DIMMs installed + */ + popts->half_strength_driver_enable = 0; + /* + * Write leveling override + */ + popts->wrlvl_override = 1; + popts->wrlvl_sample = 0xa; + popts->wrlvl_start = 0x7; + /* + * Rtt and Rtt_WR override + */ + popts->rtt_override = 1; + popts->rtt_override_value = DDR3_RTT_120_OHM; + popts->rtt_wr_override_value = 0; /* Rtt_WR= dynamic ODT off */ + + /* Enable ZQ calibration */ + popts->zq_en = 1; +} diff --git a/board/freescale/corenet_ds/law.c b/board/freescale/corenet_ds/law.c new file mode 100644 index 0000000..43b4b97 --- /dev/null +++ b/board/freescale/corenet_ds/law.c @@ -0,0 +1,40 @@ +/* + * Copyright 2008-2010 Freescale Semiconductor, Inc. + * + * (C) Copyright 2000 + * 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 <common.h> +#include <asm/fsl_law.h> +#include <asm/mmu.h> + +struct law_entry law_table[] = { + SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC), + SET_LAW(CONFIG_SYS_BMAN_MEM_PHYS, LAW_SIZE_2M, LAW_TRGT_IF_BMAN), + SET_LAW(CONFIG_SYS_QMAN_MEM_PHYS, LAW_SIZE_2M, LAW_TRGT_IF_QMAN), + SET_LAW(PIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_LBC), +#ifdef CONFIG_SYS_DCSRBAR_PHYS + SET_LAW(CONFIG_SYS_DCSRBAR_PHYS, LAW_SIZE_4M, LAW_TRGT_IF_DCSR), +#endif +}; + +int num_law_entries = ARRAY_SIZE(law_table); diff --git a/board/freescale/corenet_ds/pci.c b/board/freescale/corenet_ds/pci.c new file mode 100644 index 0000000..2994e36 --- /dev/null +++ b/board/freescale/corenet_ds/pci.c @@ -0,0 +1,127 @@ +/* + * Copyright 2007-2010 Freescale Semiconductor, Inc. + * + * 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 <command.h> +#include <pci.h> +#include <asm/fsl_pci.h> +#include <libfdt.h> +#include <fdt_support.h> +#include <asm/fsl_serdes.h> + +#ifdef CONFIG_PCIE1 +static struct pci_controller pcie1_hose; +#endif + +#ifdef CONFIG_PCIE2 +static struct pci_controller pcie2_hose; +#endif + +#ifdef CONFIG_PCIE3 +static struct pci_controller pcie3_hose; +#endif + +void pci_init_board(void) +{ + volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + struct fsl_pci_info pci_info[3]; + u32 devdisr; + int first_free_busno = 0; + int num = 0; + + int pcie_ep, pcie_configured; + + devdisr = in_be32(&gur->devdisr); + + debug (" pci_init_board: devdisr=%x\n", devdisr); + +#ifdef CONFIG_PCIE1 + pcie_configured = is_serdes_configured(PCIE1); + + if (pcie_configured && !(devdisr & FSL_CORENET_DEVDISR_PCIE1)) { + set_next_law(CONFIG_SYS_PCIE1_MEM_PHYS, LAW_SIZE_512M, + LAW_TRGT_IF_PCIE_1); + set_next_law(CONFIG_SYS_PCIE1_IO_PHYS, LAW_SIZE_64K, + LAW_TRGT_IF_PCIE_1); + SET_STD_PCIE_INFO(pci_info[num], 1); + pcie_ep = fsl_setup_hose(&pcie1_hose, pci_info[num].regs); + printf(" PCIE1 connected to Slot 1 as %s (base addr %lx)\n", + pcie_ep ? "End Point" : "Root Complex", + pci_info[num].regs); + first_free_busno = fsl_pci_init_port(&pci_info[num++], + &pcie1_hose, first_free_busno); + } else { + printf (" PCIE1: disabled\n"); + } +#else + setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_PCIE1); /* disable */ +#endif + +#ifdef CONFIG_PCIE2 + pcie_configured = is_serdes_configured(PCIE2); + + if (pcie_configured && !(devdisr & FSL_CORENET_DEVDISR_PCIE2)) { + set_next_law(CONFIG_SYS_PCIE2_MEM_PHYS, LAW_SIZE_512M, + LAW_TRGT_IF_PCIE_2); + set_next_law(CONFIG_SYS_PCIE2_IO_PHYS, LAW_SIZE_64K, + LAW_TRGT_IF_PCIE_2); + SET_STD_PCIE_INFO(pci_info[num], 2); + pcie_ep = fsl_setup_hose(&pcie2_hose, pci_info[num].regs); + printf(" PCIE2 connected to Slot 3 as %s (base addr %lx)\n", + pcie_ep ? "End Point" : "Root Complex", + pci_info[num].regs); + first_free_busno = fsl_pci_init_port(&pci_info[num++], + &pcie2_hose, first_free_busno); + } else { + printf (" PCIE2: disabled\n"); + } +#else + setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_PCIE2); /* disable */ +#endif + +#ifdef CONFIG_PCIE3 + pcie_configured = is_serdes_configured(PCIE3); + + if (pcie_configured && !(devdisr & FSL_CORENET_DEVDISR_PCIE3)) { + set_next_law(CONFIG_SYS_PCIE3_MEM_PHYS, LAW_SIZE_512M, + LAW_TRGT_IF_PCIE_3); + set_next_law(CONFIG_SYS_PCIE3_IO_PHYS, LAW_SIZE_64K, + LAW_TRGT_IF_PCIE_3); + SET_STD_PCIE_INFO(pci_info[num], 3); + pcie_ep = fsl_setup_hose(&pcie3_hose, pci_info[num].regs); + printf(" PCIE3 connected to Slot 2 as %s (base addr %lx)\n", + pcie_ep ? "End Point" : "Root Complex", + pci_info[num].regs); + first_free_busno = fsl_pci_init_port(&pci_info[num++], + &pcie3_hose, first_free_busno); + } else { + printf (" PCIE3: disabled\n"); + } +#else + setbits_be32(&gur->devdisr, FSL_CORENET_DEVDISR_PCIE3); /* disable */ +#endif +} + +void pci_of_setup(void *blob, bd_t *bd) +{ + FT_FSL_PCI_SETUP; +} diff --git a/board/freescale/corenet_ds/tlb.c b/board/freescale/corenet_ds/tlb.c new file mode 100644 index 0000000..1ae0416 --- /dev/null +++ b/board/freescale/corenet_ds/tlb.c @@ -0,0 +1,112 @@ +/* + * Copyright 2008-2010 Freescale Semiconductor, Inc. + * + * (C) Copyright 2000 + * 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 <common.h> +#include <asm/mmu.h> + +struct fsl_e_tlb_entry tlb_table[] = { + /* TLB 0 - for temp stack in cache */ + SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, + CONFIG_SYS_INIT_RAM_ADDR_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, 0, + 0, 0, BOOKE_PAGESZ_4K, 0), + SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024, + MAS3_SX|MAS3_SW|MAS3_SR, 0, + 0, 0, BOOKE_PAGESZ_4K, 0), + SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024, + MAS3_SX|MAS3_SW|MAS3_SR, 0, + 0, 0, BOOKE_PAGESZ_4K, 0), + SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024, + MAS3_SX|MAS3_SW|MAS3_SR, 0, + 0, 0, BOOKE_PAGESZ_4K, 0), + + SET_TLB_ENTRY(0, PIXIS_BASE, PIXIS_BASE_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_4K, 0), + + /* TLB 1 */ + /* *I*** - Covers boot page */ + SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 0, BOOKE_PAGESZ_4K, 1), + + /* *I*G* - CCSRBAR */ + SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 1, BOOKE_PAGESZ_16M, 1), + + /* *I*G* - Flash, localbus */ + /* This will be changed to *I*G* after relocation to RAM. */ + SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS, + MAS3_SX|MAS3_SR, MAS2_W|MAS2_G, + 0, 2, BOOKE_PAGESZ_256M, 1), + + /* *I*G* - PCI */ + SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 3, BOOKE_PAGESZ_1G, 1), + + /* *I*G* - PCI */ + SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT + 0x40000000, + CONFIG_SYS_PCIE1_MEM_PHYS + 0x40000000, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 4, BOOKE_PAGESZ_256M, 1), + + SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT + 0x50000000, + CONFIG_SYS_PCIE1_MEM_PHYS + 0x50000000, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 5, BOOKE_PAGESZ_256M, 1), + + /* *I*G* - PCI I/O */ + SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 6, BOOKE_PAGESZ_256K, 1), + + /* Bman/Qman */ + SET_TLB_ENTRY(1, CONFIG_SYS_BMAN_MEM_BASE, CONFIG_SYS_BMAN_MEM_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, 0, + 0, 9, BOOKE_PAGESZ_1M, 1), + SET_TLB_ENTRY(1, CONFIG_SYS_BMAN_MEM_BASE + 0x00100000, + CONFIG_SYS_BMAN_MEM_PHYS + 0x00100000, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 10, BOOKE_PAGESZ_1M, 1), + SET_TLB_ENTRY(1, CONFIG_SYS_QMAN_MEM_BASE, CONFIG_SYS_QMAN_MEM_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, 0, + 0, 11, BOOKE_PAGESZ_1M, 1), + SET_TLB_ENTRY(1, CONFIG_SYS_QMAN_MEM_BASE + 0x00100000, + CONFIG_SYS_QMAN_MEM_PHYS + 0x00100000, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 12, BOOKE_PAGESZ_1M, 1), +#ifdef CONFIG_SYS_DCSRBAR_PHYS + SET_TLB_ENTRY(1, CONFIG_SYS_DCSRBAR, CONFIG_SYS_DCSRBAR_PHYS, + MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, + 0, 13, BOOKE_PAGESZ_4M, 1), +#endif +}; + +int num_tlb_entries = ARRAY_SIZE(tlb_table); diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index d86ca12..fee310a 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -60,6 +60,8 @@ int checkboard(void) return 0; } +const char *board_hwconfig = "foo:bar=baz"; +const char *cpu_hwconfig = "foo:bar=baz"; phys_size_t initdram(int board_type) diff --git a/board/freescale/p2020ds/ddr.c b/board/freescale/p2020ds/ddr.c index b9c0cb2..30d640f 100644 --- a/board/freescale/p2020ds/ddr.c +++ b/board/freescale/p2020ds/ddr.c @@ -12,7 +12,7 @@ #include <asm/fsl_ddr_sdram.h> #include <asm/fsl_ddr_dimm_params.h> -static void get_spd(ddr3_spd_eeprom_t *spd, unsigned char i2c_address) +static void get_spd(generic_spd_eeprom_t *spd, unsigned char i2c_address) { i2c_read(i2c_address, 0, 1, (uchar *)spd, sizeof(ddr3_spd_eeprom_t)); } @@ -22,7 +22,7 @@ unsigned int fsl_ddr_get_mem_data_rate(void) return get_ddr_freq(0); } -void fsl_ddr_get_spd(ddr3_spd_eeprom_t *ctrl_dimms_spd, +void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd, unsigned int ctrl_num) { unsigned int i; @@ -51,27 +51,26 @@ typedef struct { * cpo 2-0x1E (30) */ - -/* XXX: these values need to be checked for all interleaving modes. */ -/* XXX: No reliable dual-rank 800 MHz setting has been found. It may - * seem reliable, but errors will appear when memory intensive - * program is run. */ -/* XXX: Single rank at 800 MHz is OK. */ const board_specific_parameters_t board_specific_parameters[][20] = { { /* memory controller 0 */ /* lo| hi| num| clk| cpo|wrdata|2T */ /* mhz| mhz|ranks|adjst| | delay| */ - { 0, 333, 2, 6, 7, 3, 0}, - {334, 400, 2, 6, 9, 3, 0}, - {401, 549, 2, 6, 11, 3, 0}, - {550, 680, 2, 1, 10, 5, 0}, - {681, 850, 2, 1, 12, 5, 1}, - { 0, 333, 1, 6, 7, 3, 0}, - {334, 400, 1, 6, 9, 3, 0}, - {401, 549, 1, 6, 11, 3, 0}, - {550, 680, 1, 1, 10, 5, 0}, - {681, 850, 1, 1, 12, 5, 0} +#ifdef CONFIG_FSL_DDR2 + { 0, 333, 2, 4, 0x1f, 2, 0}, + {334, 400, 2, 4, 0x1f, 2, 0}, + {401, 549, 2, 4, 0x1f, 2, 0}, + {550, 680, 2, 4, 0x1f, 3, 0}, + {681, 850, 2, 4, 0x1f, 4, 0}, + { 0, 333, 1, 4, 0x1f, 2, 0}, + {334, 400, 1, 4, 0x1f, 2, 0}, + {401, 549, 1, 4, 0x1f, 2, 0}, + {550, 680, 1, 4, 0x1f, 3, 0}, + {681, 850, 1, 4, 0x1f, 4, 0} +#else + { 0, 850, 2, 4, 0x1f, 4, 0}, + { 0, 850, 1, 4, 0x1f, 4, 0} +#endif }, }; @@ -92,18 +91,8 @@ void fsl_ddr_board_options(memctl_options_t *popts, * odt_wr_cfg to 3 for the even CS, 0 for the odd CS. */ for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) { - if (i&1) { /* odd CS */ popts->cs_local_opts[i].odt_rd_cfg = 0; - popts->cs_local_opts[i].odt_wr_cfg = 0; - } else { /* even CS */ - if (CONFIG_DIMM_SLOTS_PER_CTLR == 1) { - popts->cs_local_opts[i].odt_rd_cfg = 0; - popts->cs_local_opts[i].odt_wr_cfg = 4; - } else if (CONFIG_DIMM_SLOTS_PER_CTLR == 2) { - popts->cs_local_opts[i].odt_rd_cfg = 3; - popts->cs_local_opts[i].odt_wr_cfg = 3; - } - } + popts->cs_local_opts[i].odt_wr_cfg = 1; } /* Get clk_adjust, cpo, write_data_delay,2T, according to the board ddr @@ -127,4 +116,13 @@ void fsl_ddr_board_options(memctl_options_t *popts, * - number of DIMMs installed */ popts->half_strength_driver_enable = 0; + popts->wrlvl_en = 1; + /* Write leveling override */ + popts->wrlvl_override = 1; + popts->wrlvl_sample = 0xa; + popts->wrlvl_start = 0x7; + /* Rtt and Rtt_WR override */ + popts->rtt_override = 1; + popts->rtt_override_value = DDR3_RTT_120_OHM; + popts->rtt_wr_override_value = 0; /* Rtt_WR= dynamic ODT off */ } diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c index 3fd1b34..608ff91 100644 --- a/board/freescale/p2020ds/p2020ds.c +++ b/board/freescale/p2020ds/p2020ds.c @@ -69,13 +69,16 @@ int checkboard(void) return 0; } +const char *board_hwconfig = "foo:bar=baz"; +const char *cpu_hwconfig = "foo:bar=baz"; + phys_size_t initdram(int board_type) { phys_size_t dram_size = 0; puts("Initializing...."); -#ifdef CONFIG_SPD_EEPROM +#ifdef CONFIG_DDR_SPD dram_size = fsl_ddr_sdram(); #else dram_size = fixed_sdram(); @@ -94,7 +97,7 @@ phys_size_t initdram(int board_type) return dram_size; } -#if !defined(CONFIG_SPD_EEPROM) +#if !defined(CONFIG_DDR_SPD) /* * Fixed sdram init -- doesn't use serial presence detect. */ diff --git a/board/freescale/p2020ds/tlb.c b/board/freescale/p2020ds/tlb.c index 36ad086..824b3b2 100644 --- a/board/freescale/p2020ds/tlb.c +++ b/board/freescale/p2020ds/tlb.c @@ -28,19 +28,19 @@ struct fsl_e_tlb_entry tlb_table[] = { /* TLB 0 - for temp stack in cache */ - SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR, + SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR, CONFIG_SYS_INIT_RAM_ADDR_PHYS, MAS3_SX|MAS3_SW|MAS3_SR, 0, 0, 0, BOOKE_PAGESZ_4K, 0), SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024, - CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 4 * 1024, MAS3_SX|MAS3_SW|MAS3_SR, 0, 0, 0, BOOKE_PAGESZ_4K, 0), SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024, - CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 8 * 1024, MAS3_SX|MAS3_SW|MAS3_SR, 0, 0, 0, BOOKE_PAGESZ_4K, 0), SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, - CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024, + CONFIG_SYS_INIT_RAM_ADDR_PHYS + 12 * 1024, MAS3_SX|MAS3_SW|MAS3_SR, 0, 0, 0, BOOKE_PAGESZ_4K, 0), diff --git a/board/g2000/g2000.c b/board/g2000/g2000.c index 8b15e51..713b699 100644 --- a/board/g2000/g2000.c +++ b/board/g2000/g2000.c @@ -91,7 +91,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/gen860t/gen860t.c b/board/gen860t/gen860t.c index b37a0f2..d175858 100644 --- a/board/gen860t/gen860t.c +++ b/board/gen860t/gen860t.c @@ -132,7 +132,7 @@ int checkboard (void) char buf[64]; int i; - i = getenv_r ("board_id", buf, sizeof (buf)); + i = getenv_f("board_id", buf, sizeof (buf)); s = (i > 0) ? buf : NULL; if (s) { @@ -141,7 +141,7 @@ int checkboard (void) printf ("<unknown> "); } - i = getenv_r ("serial#", buf, sizeof (buf)); + i = getenv_f("serial#", buf, sizeof (buf)); s = (i > 0) ? buf : NULL; if (s) { @@ -276,7 +276,7 @@ int last_stage_init (void) /* * Read the environment to see what to do with the beeper */ - i = getenv_r ("beeper", buf, sizeof (buf)); + i = getenv_f("beeper", buf, sizeof (buf)); if (i > 0) { do_beeper (buf); } diff --git a/board/inka4x0/inka4x0.c b/board/inka4x0/inka4x0.c index 27b79ec..fc498d6 100644 --- a/board/inka4x0/inka4x0.c +++ b/board/inka4x0/inka4x0.c @@ -187,7 +187,7 @@ int misc_init_f (void) char tmp[10]; int i, br; - i = getenv_r("brightness", tmp, sizeof(tmp)); + i = getenv_f("brightness", tmp, sizeof(tmp)); br = (i > 0) ? (int) simple_strtoul (tmp, NULL, 10) : CONFIG_SYS_BRIGHTNESS; diff --git a/board/ip860/ip860.c b/board/ip860/ip860.c index e2a1851..adff2b2 100644 --- a/board/ip860/ip860.c +++ b/board/ip860/ip860.c @@ -114,7 +114,7 @@ int checkboard (void) puts ("Board: "); - i = getenv_r ("serial#", (char *)buf, sizeof (buf)); + i = getenv_f("serial#", (char *)buf, sizeof (buf)); s = (i > 0) ? buf : NULL; if (!s || strncmp ((char *)s, "IP860", 5)) { diff --git a/board/kup/kup4k/kup4k.c b/board/kup/kup4k/kup4k.c index 98f5f5a..607fd79 100644 --- a/board/kup/kup4k/kup4k.c +++ b/board/kup/kup4k/kup4k.c @@ -314,7 +314,7 @@ void lcd_logo (bd_t * bd) } - n = getenv_r ("lcd", tmp, sizeof (tmp)); + n = getenv_f("lcd", tmp, sizeof (tmp)); if (n > 0) { if (!strcmp ("tft", tmp)) tft = 1; @@ -342,7 +342,7 @@ void lcd_logo (bd_t * bd) ((S1D_VALUE *) fb_info.RegAddr)[s1dReg / sizeof(S1D_VALUE)] = s1dValue; } - n = getenv_r ("contrast", tmp, sizeof (tmp)); + n = getenv_f("contrast", tmp, sizeof (tmp)); ((S1D_VALUE *) fb_info.RegAddr)[0xB3] = (n > 0) ? (uchar) simple_strtoul (tmp, NULL, 10) * 255 / 100 : 0xA0; switch (bd->bi_busfreq) { diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c index b4343d8..624c708 100644 --- a/board/mpl/common/common_util.c +++ b/board/mpl/common/common_util.c @@ -284,13 +284,13 @@ void set_backup_values(int overwrite) } } memcpy(back.signature,"MPL\0",4); - i = getenv_r("serial#",back.serial_name,16); + i = getenv_f("serial#",back.serial_name,16); if(i < 0) { puts("Not possible to write Backup\n"); return; } back.serial_name[16]=0; - i = getenv_r("ethaddr",back.eth_addr,20); + i = getenv_f("ethaddr",back.eth_addr,20); if(i < 0) { puts("Not possible to write Backup\n"); return; diff --git a/board/mpl/common/memtst.c b/board/mpl/common/memtst.c index 92c33ba..68973f9 100644 --- a/board/mpl/common/memtst.c +++ b/board/mpl/common/memtst.c @@ -29,7 +29,7 @@ int testdram (void) unsigned char s[32]; int i; - i = getenv_r ("testmem", s, 32); + i = getenv_f("testmem", s, 32); if (i != 0) { i = (int) simple_strtoul (s, NULL, 10); if ((i > 0) && (i < 0xf)) { diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c index af3a98a..7400ca6 100644 --- a/board/mpl/mip405/mip405.c +++ b/board/mpl/mip405/mip405.c @@ -589,7 +589,7 @@ int checkboard (void) puts ("Board: "); get_pcbrev_var(&bc,&var); - i = getenv_r ("serial#", (char *)s, 32); + i = getenv_f("serial#", (char *)s, 32); if ((i == 0) || strncmp ((char *)s, BOARD_NAME,sizeof(BOARD_NAME))) { get_backup_values (b); if (strncmp (b->signature, "MPL\0", 4) != 0) { diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c index e12bc42..7f1164a 100644 --- a/board/mpl/pati/pati.c +++ b/board/mpl/pati/pati.c @@ -353,7 +353,7 @@ int checkboard (void) puts ("\nBoard: "); reg=in32(PLD_CONFIG_BASE+PLD_BOARD_TIMING); rev=(char)(SYSCNTR_BREV(reg)+'A'); - i = getenv_r ("serial#", s, 32); + i = getenv_f("serial#", s, 32); if ((i == -1)) { puts ("### No HW ID - assuming " BOARD_NAME); printf(" Rev. %c\n",rev); diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c index 792eccc..7b48c06 100644 --- a/board/mpl/pip405/pip405.c +++ b/board/mpl/pip405/pip405.c @@ -579,7 +579,7 @@ int checkboard (void) puts ("Board: "); - i = getenv_r ("serial#", (char *)s, 32); + i = getenv_f("serial#", (char *)s, 32); if ((i == 0) || strncmp ((char *)s, "PIP405", 6)) { get_backup_values (b); if (strncmp (b->signature, "MPL\0", 4) != 0) { diff --git a/board/mpl/vcma9/vcma9.c b/board/mpl/vcma9/vcma9.c index 1835677..eaeec82 100644 --- a/board/mpl/vcma9/vcma9.c +++ b/board/mpl/vcma9/vcma9.c @@ -295,7 +295,7 @@ int checkboard(void) int i; backup_t *b = (backup_t *) s; - i = getenv_r("serial#", s, 32); + i = getenv_f("serial#", s, 32); if ((i < 0) || strncmp (s, "VCMA9", 5)) { get_backup_values (b); if (strncmp (b->signature, "MPL\0", 4) != 0) { @@ -340,7 +340,7 @@ void print_vcma9_info(void) char s[50]; int i; - if ((i = getenv_r("serial#", s, 32)) < 0) { + if ((i = getenv_f("serial#", s, 32)) < 0) { puts ("### No HW ID - assuming VCMA9"); printf("i %d", i*24); } else { diff --git a/board/ppmc8260/ppmc8260.c b/board/ppmc8260/ppmc8260.c index 1808abd..bf0188c 100644 --- a/board/ppmc8260/ppmc8260.c +++ b/board/ppmc8260/ppmc8260.c @@ -285,7 +285,7 @@ int misc_init_r (void) int res; if ((ds != 0) && (ds != 0xff)) { - res = getenv_r ("ethaddr", (char *)tmp, sizeof (tmp)); + res = getenv_f("ethaddr", (char *)tmp, sizeof (tmp)); if (res > 0) { ss = ((ds >> 4) & 0x0f); ss += ss < 0x0a ? '0' : ('a' - 10); diff --git a/board/prodrive/p3mx/mv_eth.c b/board/prodrive/p3mx/mv_eth.c index 8fcc155..e67596b 100644 --- a/board/prodrive/p3mx/mv_eth.c +++ b/board/prodrive/p3mx/mv_eth.c @@ -298,7 +298,7 @@ void mv6446x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG @@ -397,7 +397,7 @@ void mv6446x_eth_initialize (bd_t * bis) return; } - temp = getenv_r (s, buf, sizeof (buf)); + temp = getenv_f(s, buf, sizeof (buf)); s = (temp > 0) ? buf : NULL; #ifdef DEBUG diff --git a/board/sbc405/sbc405.c b/board/sbc405/sbc405.c index 74e6204..33b4d11 100644 --- a/board/sbc405/sbc405.c +++ b/board/sbc405/sbc405.c @@ -79,7 +79,7 @@ int misc_init_r (void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); diff --git a/board/sbc8260/sbc8260.c b/board/sbc8260/sbc8260.c index f5f23be..33ce1a4 100644 --- a/board/sbc8260/sbc8260.c +++ b/board/sbc8260/sbc8260.c @@ -267,7 +267,7 @@ int misc_init_r (void) int res; if ((ds != 0) && (ds != 0xff)) { - res = getenv_r ("ethaddr", tmp, sizeof (tmp)); + res = getenv_f("ethaddr", tmp, sizeof (tmp)); if (res > 0) { ss = ((ds >> 4) & 0x0f); ss += ss < 0x0a ? '0' : ('a' - 10); diff --git a/board/siemens/CCM/ccm.c b/board/siemens/CCM/ccm.c index 8053da4..e91ceb0 100644 --- a/board/siemens/CCM/ccm.c +++ b/board/siemens/CCM/ccm.c @@ -102,7 +102,7 @@ int checkboard (void) unsigned char *s; unsigned char buf[64]; - s = (getenv_r ("serial#", (char *)&buf, sizeof(buf)) > 0) ? buf : NULL; + s = (getenv_f("serial#", (char *)&buf, sizeof(buf)) > 0) ? buf : NULL; puts ("Board: Siemens CCM"); diff --git a/board/siemens/SCM/scm.c b/board/siemens/SCM/scm.c index e0611fe..926e491 100644 --- a/board/siemens/SCM/scm.c +++ b/board/siemens/SCM/scm.c @@ -209,7 +209,7 @@ const iop_conf_t iop_conf_tab[4][32] = { int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); puts ("Board: "); diff --git a/board/snmc/qs850/qs850.c b/board/snmc/qs850/qs850.c index cc8eaad..43f7495 100644 --- a/board/snmc/qs850/qs850.c +++ b/board/snmc/qs850/qs850.c @@ -100,7 +100,7 @@ int checkboard (void) char buf[64]; int i; - i = getenv_r("serial#", buf, sizeof(buf)); + i = getenv_f("serial#", buf, sizeof(buf)); s = (i>0) ? buf : NULL; if (!s || strncmp(s, BOARD_IDENTITY, 5)) { diff --git a/board/snmc/qs860t/qs860t.c b/board/snmc/qs860t/qs860t.c index b272d80..fa88707 100644 --- a/board/snmc/qs860t/qs860t.c +++ b/board/snmc/qs860t/qs860t.c @@ -93,7 +93,7 @@ int checkboard (void) char buf[64]; int i; - i = getenv_r("serial#", buf, sizeof(buf)); + i = getenv_f("serial#", buf, sizeof(buf)); s = (i>0) ? buf : NULL; if (!s || strncmp(s, "QS860T", 6)) { diff --git a/board/tqc/tqm8260/tqm8260.c b/board/tqc/tqm8260/tqm8260.c index 3039999..95073b8 100644 --- a/board/tqc/tqm8260/tqm8260.c +++ b/board/tqc/tqm8260/tqm8260.c @@ -196,7 +196,7 @@ const iop_conf_t iop_conf_tab[4][32] = { int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof (str)); + int i = getenv_f("serial#", str, sizeof (str)); puts ("Board: "); diff --git a/board/trab/trab.c b/board/trab/trab.c index 12fe120..828facd 100644 --- a/board/trab/trab.c +++ b/board/trab/trab.c @@ -414,7 +414,7 @@ static void tsc2000_set_brightness(void) spi_init(); tsc2000_write(1, 2, 0x0); /* Power up DAC */ - i = getenv_r("brightness", tmp, sizeof(tmp)); + i = getenv_f("brightness", tmp, sizeof(tmp)); br = (i > 0) ? (int) simple_strtoul (tmp, NULL, 10) : CONFIG_SYS_BRIGHTNESS; diff --git a/board/uc100/uc100.c b/board/uc100/uc100.c index 4dba290..bdee4de 100644 --- a/board/uc100/uc100.c +++ b/board/uc100/uc100.c @@ -150,7 +150,7 @@ int board_switch(void) int checkboard (void) { char str[64]; - int i = getenv_r ("serial#", str, sizeof(str)); + int i = getenv_f("serial#", str, sizeof(str)); puts ("Board: "); |