diff options
Diffstat (limited to 'board')
35 files changed, 802 insertions, 1070 deletions
diff --git a/board/actux1/config.mk b/board/actux1/config.mk index 88634f7..9cb838b 100644 --- a/board/actux1/config.mk +++ b/board/actux1/config.mk @@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000 # include NPE ethernet driver BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o - -LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds diff --git a/board/actux2/config.mk b/board/actux2/config.mk index 88634f7..9cb838b 100644 --- a/board/actux2/config.mk +++ b/board/actux2/config.mk @@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000 # include NPE ethernet driver BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o - -LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds diff --git a/board/actux3/config.mk b/board/actux3/config.mk index 88634f7..9cb838b 100644 --- a/board/actux3/config.mk +++ b/board/actux3/config.mk @@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000 # include NPE ethernet driver BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o - -LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds diff --git a/board/altera/nios2-generic/config.mk b/board/altera/nios2-generic/config.mk index 95e75af..00c16fc 100644 --- a/board/altera/nios2-generic/config.mk +++ b/board/altera/nios2-generic/config.mk @@ -30,5 +30,3 @@ PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(VENDOR)/include ifeq ($(debug),1) PLATFORM_CPPFLAGS += -DDEBUG endif - -LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds diff --git a/board/amcc/acadia/config.mk b/board/amcc/acadia/config.mk index 2f2787f..bfc0945 100644 --- a/board/amcc/acadia/config.mk +++ b/board/amcc/acadia/config.mk @@ -28,10 +28,3 @@ ifeq ($(debug),1) PLATFORM_CPPFLAGS += -DDEBUG endif - -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -else ifdef CONFIG_NAND_U_BOOT -LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds -endif diff --git a/board/amcc/bamboo/config.mk b/board/amcc/bamboo/config.mk index 7ca16a0..24f74e1 100644 --- a/board/amcc/bamboo/config.mk +++ b/board/amcc/bamboo/config.mk @@ -30,10 +30,3 @@ endif ifeq ($(dbcr),1) PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000 endif - -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -else ifdef CONFIG_NAND_U_BOOT -LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds -endif diff --git a/board/amcc/canyonlands/config.mk b/board/amcc/canyonlands/config.mk index abf2a26..d693a26 100644 --- a/board/amcc/canyonlands/config.mk +++ b/board/amcc/canyonlands/config.mk @@ -33,10 +33,3 @@ endif ifeq ($(dbcr),1) PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000 endif - -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -else ifdef CONFIG_NAND_U_BOOT -LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds -endif diff --git a/board/amcc/kilauea/config.mk b/board/amcc/kilauea/config.mk index 4ae3ea9..003b8c3 100644 --- a/board/amcc/kilauea/config.mk +++ b/board/amcc/kilauea/config.mk @@ -24,10 +24,3 @@ ifeq ($(debug),1) PLATFORM_CPPFLAGS += -DDEBUG endif - -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -else ifdef CONFIG_NAND_U_BOOT -LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds -endif diff --git a/board/amcc/sequoia/config.mk b/board/amcc/sequoia/config.mk index 73efe72..e0bf071 100644 --- a/board/amcc/sequoia/config.mk +++ b/board/amcc/sequoia/config.mk @@ -33,10 +33,3 @@ endif ifeq ($(dbcr),1) PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000 endif - -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -else ifdef CONFIG_NAND_U_BOOT -LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds -endif diff --git a/board/armltd/vexpress/ca9x4_ct_vxp.c b/board/armltd/vexpress/ca9x4_ct_vxp.c index ce1be1e..3566b95 100644 --- a/board/armltd/vexpress/ca9x4_ct_vxp.c +++ b/board/armltd/vexpress/ca9x4_ct_vxp.c @@ -86,6 +86,15 @@ int board_eth_init(bd_t *bis) return rc; } +int cpu_mmc_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_ARM_PL180_MMCI + rc = arm_pl180_mmci_init(); +#endif + return rc; +} + static void flash__init(void) { /* Setup the sytem control register to allow writing to flash */ diff --git a/board/atmel/atstk1000/config.mk b/board/atmel/atstk1000/config.mk index 8c03b77..284f7ff 100644 --- a/board/atmel/atstk1000/config.mk +++ b/board/atmel/atstk1000/config.mk @@ -1,4 +1,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections PLATFORM_LDFLAGS += --gc-sections CONFIG_SYS_TEXT_BASE = 0x00000000 -LDSCRIPT = $(src)board/atmel/atstk1000/u-boot.lds diff --git a/board/avnet/fx12mm/config.mk b/board/avnet/fx12mm/config.mk deleted file mode 100644 index 78dde62..0000000 --- a/board/avnet/fx12mm/config.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -# (C) Copyright 2008 -# Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es -# Work supported by Qtechnology http://www.qtec.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 -# -# - -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -endif diff --git a/board/avnet/v5fx30teval/config.mk b/board/avnet/v5fx30teval/config.mk deleted file mode 100644 index 78dde62..0000000 --- a/board/avnet/v5fx30teval/config.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -# (C) Copyright 2008 -# Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es -# Work supported by Qtechnology http://www.qtec.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 -# -# - -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -endif diff --git a/board/cm5200/u-boot.lds b/board/cm5200/u-boot.lds deleted file mode 100644 index cf73b11..0000000 --- a/board/cm5200/u-boot.lds +++ /dev/null @@ -1,120 +0,0 @@ -/* - * (C) Copyright 2003-2007 - * 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 - */ - -OUTPUT_ARCH(powerpc) -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 : - { - arch/powerpc/cpu/mpc5xxx/start.o (.text) - *(.text) - *(.got1) - . = ALIGN(16); - *(.eh_frame) - *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) - } - .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 (NOLOAD) : - { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - . = ALIGN(4); - } - __bss_end__ = . ; - PROVIDE (end = .); -} diff --git a/board/cogent/config.mk b/board/cogent/config.mk index 78730db..12e2e7c 100644 --- a/board/cogent/config.mk +++ b/board/cogent/config.mk @@ -26,5 +26,3 @@ # PLATFORM_CPPFLAGS += -I$(TOPDIR) - -LDSCRIPT := $(SRCTREE)/board/cogent/u-boot.lds diff --git a/board/earthlcd/favr-32-ezkit/config.mk b/board/earthlcd/favr-32-ezkit/config.mk index f8bc88d..284f7ff 100644 --- a/board/earthlcd/favr-32-ezkit/config.mk +++ b/board/earthlcd/favr-32-ezkit/config.mk @@ -1,4 +1,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections PLATFORM_LDFLAGS += --gc-sections CONFIG_SYS_TEXT_BASE = 0x00000000 -LDSCRIPT = $(src)board/earthlcd/favr-32-ezkit/u-boot.lds diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c index 81e53e7..3011bb8 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c @@ -1,6 +1,7 @@ /* - * Copyright 2007 Freescale Semiconductor, Inc. - * York Sun <yorksun@freescale.com> + * Copyright 2007-2011 Freescale Semiconductor, Inc. + * Authors: York Sun <yorksun@freescale.com> + * Timur Tabi <timur@freescale.com> * * FSL DIU Framebuffer driver * @@ -27,6 +28,10 @@ #include <command.h> #include <asm/io.h> #include <fsl_diu_fb.h> +#include "../common/pixis.h" + +#define PX_BRDCFG0_DLINK 0x10 +#define PX_BRDCFG0_DVISEL 0x08 void diu_set_pixel_clock(unsigned int pixclock) { @@ -49,50 +54,34 @@ void diu_set_pixel_clock(unsigned int pixclock) debug("DIU: Modified value of CLKDVDR = 0x%08x\n", *guts_clkdvdr); } -int platform_diu_init(unsigned int *xres, unsigned int *yres) +int platform_diu_init(unsigned int xres, unsigned int yres, const char *port) { - char *monitor_port; - int gamma_fix; - unsigned int pixel_format; - unsigned char tmp_val; - unsigned char pixis_arch; - u8 *pixis_base = (u8 *)PIXIS_BASE; - - tmp_val = in_8(pixis_base + PIXIS_BRDCFG0); - pixis_arch = in_8(pixis_base + PIXIS_VER); - - monitor_port = getenv("monitor"); - if (!strncmp(monitor_port, "0", 1)) { /* 0 - DVI */ - *xres = 1280; - *yres = 1024; - if (pixis_arch == 0x01) - pixel_format = 0x88882317; - else - pixel_format = 0x88883316; - gamma_fix = 0; - out_8(pixis_base + PIXIS_BRDCFG0, tmp_val | 0x08); + const char *name; + int gamma_fix = 0; + u32 pixel_format = 0x88883316; + u8 temp; - } else if (!strncmp(monitor_port, "1", 1)) { /* 1 - Single link LVDS */ - *xres = 1024; - *yres = 768; - pixel_format = 0x88883316; - gamma_fix = 0; - out_8(pixis_base + PIXIS_BRDCFG0, (tmp_val & 0xf7) | 0x10); + temp = in_8(&pixis->brdcfg0); - } else if (!strncmp(monitor_port, "2", 1)) { /* 2 - Double link LVDS */ - *xres = 1280; - *yres = 1024; - pixel_format = 0x88883316; + if (strncmp(port, "dlvds", 5) == 0) { + /* Dual link LVDS */ gamma_fix = 1; - out_8(pixis_base + PIXIS_BRDCFG0, tmp_val & 0xe7); - - } else { /* DVI */ - *xres = 1280; - *yres = 1024; - pixel_format = 0x88882317; - gamma_fix = 0; - out_8(pixis_base + PIXIS_BRDCFG0, tmp_val | 0x08); + temp &= ~(PX_BRDCFG0_DLINK | PX_BRDCFG0_DVISEL); + name = "Dual-Link LVDS"; + } else if (strncmp(port, "lvds", 4) == 0) { + /* Single link LVDS */ + temp = (temp & ~PX_BRDCFG0_DVISEL) | PX_BRDCFG0_DLINK; + name = "Single-Link LVDS"; + } else { + /* DVI */ + if (in_8(&pixis->ver) == 1) /* Board version */ + pixel_format = 0x88882317; + temp |= PX_BRDCFG0_DVISEL; + name = "DVI"; } - return fsl_diu_init(*xres, pixel_format, gamma_fix); + printf("DIU: Switching to %s monitor @ %ux%u\n", name, xres, yres); + out_8(&pixis->brdcfg0, temp); + + return fsl_diu_init(xres, pixel_format, gamma_fix); } diff --git a/board/freescale/mx31ads/config.mk b/board/freescale/mx31ads/config.mk index 2303f30..0131edf 100644 --- a/board/freescale/mx31ads/config.mk +++ b/board/freescale/mx31ads/config.mk @@ -1,3 +1 @@ CONFIG_SYS_TEXT_BASE = 0x87f00000 - -LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds diff --git a/board/freescale/p1022ds/diu.c b/board/freescale/p1022ds/diu.c index b37e0e2..7d1f6aa 100644 --- a/board/freescale/p1022ds/diu.c +++ b/board/freescale/p1022ds/diu.c @@ -12,6 +12,7 @@ #include <common.h> #include <command.h> +#include <linux/ctype.h> #include <asm/io.h> #include <stdio_dev.h> #include <video_fb.h> @@ -81,10 +82,10 @@ void diu_set_pixel_clock(unsigned int pixclock) out_be32(&gur->clkdvdr, temp | 0x80000000 | ((pixval & 0x1F) << 16)); } -int platform_diu_init(unsigned int *xres, unsigned int *yres) +int platform_diu_init(unsigned int xres, unsigned int yres, const char *port) { ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); - char *monitor_port; + const char *name; u32 pixel_format; u8 temp; @@ -100,21 +101,23 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres) temp = in_8(&pixis->brdcfg1); - monitor_port = getenv("monitor"); - if (!strncmp(monitor_port, "1", 1)) { /* 1 - Single link LVDS */ - *xres = 1024; - *yres = 768; - /* Enable the DFP port, disable the DVI and the backlight */ - temp &= ~(PX_BRDCFG1_DVIEN | PX_BRDCFG1_BACKLIGHT); - temp |= PX_BRDCFG1_DFPEN; + if (strncmp(port, "lvds", 4) == 0) { + /* Single link LVDS */ + temp &= ~PX_BRDCFG1_DVIEN; + /* + * LVDS also needs backlight enabled, otherwise the display + * will be blank. + */ + temp |= (PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT); + name = "Single-Link LVDS"; } else { /* DVI */ - *xres = 1280; - *yres = 1024; /* Enable the DVI port, disable the DFP and the backlight */ temp &= ~(PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT); temp |= PX_BRDCFG1_DVIEN; + name = "DVI"; } + printf("DIU: Switching to %s monitor @ %ux%u\n", name, xres, yres); out_8(&pixis->brdcfg1, temp); /* @@ -136,7 +139,7 @@ int platform_diu_init(unsigned int *xres, unsigned int *yres) clrsetbits_be32(&gur->pmuxcr, PMUXCR_ELBCDIU_MASK, PMUXCR_ELBCDIU_DIU); pmuxcr = in_be32(&gur->pmuxcr); - return fsl_diu_init(*xres, pixel_format, 0); + return fsl_diu_init(xres, pixel_format, 0); } /* diff --git a/board/hymod/config.mk b/board/hymod/config.mk index ae766bc..ea64004 100644 --- a/board/hymod/config.mk +++ b/board/hymod/config.mk @@ -28,5 +28,3 @@ PLATFORM_CPPFLAGS += -I$(TOPDIR) OBJCFLAGS = --remove-section=.ppcenv - -LDSCRIPT := $(SRCTREE)/board/hymod/u-boot.lds diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 7b4eefd..4883fe5 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -22,13 +22,14 @@ */ #include <common.h> -#if defined(CONFIG_MGCOGE) +#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE) #include <mpc8260.h> #endif #include <ioports.h> #include <malloc.h> #include <hush.h> #include <net.h> +#include <netdev.h> #include <asm/io.h> #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) @@ -39,9 +40,11 @@ #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) #include <i2c.h> -extern int i2c_soft_read_pin (void); +static void i2c_write_start_seq(void); +static int i2c_make_abort(void); +DECLARE_GLOBAL_DATA_PTR; -int ivm_calc_crc (unsigned char *buf, int len) +int ivm_calc_crc(unsigned char *buf, int len) { const unsigned short crc_tab[16] = { 0x0000, 0xCC01, 0xD801, 0x1400, @@ -71,20 +74,55 @@ int ivm_calc_crc (unsigned char *buf, int len) return crc; } -static int ivm_set_value (char *name, char *value) +/* + * Set Keymile specific environment variables + * Currently only some memory layout variables are calculated here + * ... ------------------------------------------------ + * ... |@rootfsaddr |@pnvramaddr |@varaddr |@reserved |@END_OF_RAM + * ... |<------------------- pram ------------------->| + * ... ------------------------------------------------ + * @END_OF_RAM: denotes the RAM size + * @pnvramaddr: Startadress of pseudo non volatile RAM in hex + * @pram : preserved ram size in k + * @varaddr : startadress for /var mounted into RAM + */ +int set_km_env(void) +{ + uchar buf[32]; + unsigned int pnvramaddr; + unsigned int pram; + unsigned int varaddr; + + pnvramaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM + - CONFIG_KM_PNVRAM; + sprintf((char *)buf, "0x%x", pnvramaddr); + setenv("pnvramaddr", (char *)buf); + + pram = (CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) / + 0x400; + sprintf((char *)buf, "0x%x", pram); + setenv("pram", (char *)buf); + + varaddr = gd->ram_size - CONFIG_KM_RESERVED_PRAM - CONFIG_KM_PHRAM; + sprintf((char *)buf, "0x%x", varaddr); + setenv("varaddr", (char *)buf); + return 0; +} + +static int ivm_set_value(char *name, char *value) { char tempbuf[256]; if (value != NULL) { - sprintf (tempbuf, "%s=%s", name, value); - return set_local_var (tempbuf, 0); + sprintf(tempbuf, "%s=%s", name, value); + return set_local_var(tempbuf, 0); } else { - unset_local_var (name); + unset_local_var(name); } return 0; } -static int ivm_get_value (unsigned char *buf, int len, char *name, int off, +static int ivm_get_value(unsigned char *buf, int len, char *name, int off, int check) { unsigned short val; @@ -92,21 +130,21 @@ static int ivm_get_value (unsigned char *buf, int len, char *name, int off, if ((buf[off + 0] != buf[off + 2]) && (buf[off + 2] != buf[off + 4])) { - printf ("%s Error corrupted %s\n", __FUNCTION__, name); + printf("%s Error corrupted %s\n", __func__, name); val = -1; } else { val = buf[off + 0] + (buf[off + 1] << 8); if ((val == 0) && (check == 1)) val = -1; } - sprintf ((char *)valbuf, "%x", val); - ivm_set_value (name, (char *)valbuf); + sprintf((char *)valbuf, "%x", val); + ivm_set_value(name, (char *)valbuf); return val; } -#define INVENTORYBLOCKSIZE 0x100 -#define INVENTORYDATAADDRESS 0x21 -#define INVENTORYDATASIZE (INVENTORYBLOCKSIZE - INVENTORYDATAADDRESS - 3) +#define INV_BLOCKSIZE 0x100 +#define INV_DATAADDRESS 0x21 +#define INVENTORYDATASIZE (INV_BLOCKSIZE - INV_DATAADDRESS - 3) #define IVM_POS_SHORT_TEXT 0 #define IVM_POS_MANU_ID 1 @@ -121,19 +159,19 @@ static int ivm_get_value (unsigned char *buf, int len, char *name, int off, #define IVM_POS_HISTORY 10 #define IVM_POS_SYMBOL_ONLY 11 -static char convert_char (char c) +static char convert_char(char c) { return (c < ' ' || c > '~') ? '.' : c; } -static int ivm_findinventorystring (int type, +static int ivm_findinventorystring(int type, unsigned char* const string, unsigned long maxlen, unsigned char *buf) { int xcode = 0; unsigned long cr = 0; - unsigned long addr = INVENTORYDATAADDRESS; + unsigned long addr = INV_DATAADDRESS; unsigned long size = 0; unsigned long nr = type; int stop = 0; /* stop on semicolon */ @@ -157,8 +195,10 @@ static int ivm_findinventorystring (int type, addr++; } - /* the expected number of CR was found until the end of the IVM - * content --> fill string */ + /* + * the expected number of CR was found until the end of the IVM + * content --> fill string + */ if (addr < INVENTORYDATASIZE) { /* Copy the IVM string in the corresponding string */ for (; (buf[addr] != '\r') && @@ -170,64 +210,75 @@ static int ivm_findinventorystring (int type, convert_char (buf[addr])); } - /* copy phase is done: check if everything is ok. If not, + /* + * copy phase is done: check if everything is ok. If not, * the inventory data is most probably corrupted: tell - * the world there is a problem! */ + * the world there is a problem! + */ if (addr == INVENTORYDATASIZE) { xcode = -1; - printf ("Error end of string not found\n"); + printf("Error end of string not found\n"); } else if ((size >= (maxlen - 1)) && (buf[addr] != '\r')) { xcode = -1; - printf ("string too long till next CR\n"); + printf("string too long till next CR\n"); } } else { - /* some CR are missing... - * the inventory data is most probably corrupted */ + /* + * some CR are missing... + * the inventory data is most probably corrupted + */ xcode = -1; - printf ("not enough cr found\n"); + printf("not enough cr found\n"); } return xcode; } #define GET_STRING(name, which, len) \ - if (ivm_findinventorystring (which, valbuf, len, buf) == 0) { \ - ivm_set_value (name, (char *)valbuf); \ + if (ivm_findinventorystring(which, valbuf, len, buf) == 0) { \ + ivm_set_value(name, (char *)valbuf); \ } -static int ivm_check_crc (unsigned char *buf, int block) +static int ivm_check_crc(unsigned char *buf, int block) { unsigned long crc; unsigned long crceeprom; - crc = ivm_calc_crc (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2); + crc = ivm_calc_crc(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2); crceeprom = (buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 1] + \ buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN - 2] * 256); if (crc != crceeprom) { if (block == 0) - printf ("Error CRC Block: %d EEprom: calculated: \ + printf("Error CRC Block: %d EEprom: calculated: \ %lx EEprom: %lx\n", block, crc, crceeprom); return -1; } return 0; } -static int ivm_analyze_block2 (unsigned char *buf, int len) +static int ivm_analyze_block2(unsigned char *buf, int len) { unsigned char valbuf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN]; unsigned long count; /* IVM_MacAddress */ - sprintf ((char *)valbuf, "%02X:%02X:%02X:%02X:%02X:%02X", - buf[1], - buf[2], - buf[3], - buf[4], - buf[5], - buf[6]); - ivm_set_value ("IVM_MacAddress", (char *)valbuf); - if (getenv ("ethaddr") == NULL) - setenv ((char *)"ethaddr", (char *)valbuf); + sprintf((char *)valbuf, "%pM", buf); + ivm_set_value("IVM_MacAddress", (char *)valbuf); + /* if an offset is defined, add it */ +#if defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET) + if (CONFIG_PIGGY_MAC_ADRESS_OFFSET > 0) { + unsigned long val = (buf[4] << 16) + (buf[5] << 8) + buf[6]; + + val += CONFIG_PIGGY_MAC_ADRESS_OFFSET; + buf[4] = (val >> 16) & 0xff; + buf[5] = (val >> 8) & 0xff; + buf[6] = val & 0xff; + sprintf((char *)valbuf, "%pM", buf); + } +#endif + if (getenv("ethaddr") == NULL) + setenv((char *)"ethaddr", (char *)valbuf); + /* IVM_MacCount */ count = (buf[10] << 24) + (buf[11] << 16) + @@ -235,48 +286,52 @@ static int ivm_analyze_block2 (unsigned char *buf, int len) buf[13]; if (count == 0xffffffff) count = 1; - sprintf ((char *)valbuf, "%lx", count); - ivm_set_value ("IVM_MacCount", (char *)valbuf); + sprintf((char *)valbuf, "%lx", count); + ivm_set_value("IVM_MacCount", (char *)valbuf); return 0; } -int ivm_analyze_eeprom (unsigned char *buf, int len) +int ivm_analyze_eeprom(unsigned char *buf, int len) { unsigned short val; unsigned char valbuf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN]; unsigned char *tmp; - if (ivm_check_crc (buf, 0) != 0) + if (ivm_check_crc(buf, 0) != 0) return -1; - ivm_get_value (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, "IVM_BoardId", 0, 1); - val = ivm_get_value (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, "IVM_HWKey", 6, 1); + ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, + "IVM_BoardId", 0, 1); + val = ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, + "IVM_HWKey", 6, 1); if (val != 0xffff) { - sprintf ((char *)valbuf, "%x", ((val /100) % 10)); - ivm_set_value ("IVM_HWVariant", (char *)valbuf); - sprintf ((char *)valbuf, "%x", (val % 100)); - ivm_set_value ("IVM_HWVersion", (char *)valbuf); + sprintf((char *)valbuf, "%x", ((val / 100) % 10)); + ivm_set_value("IVM_HWVariant", (char *)valbuf); + sprintf((char *)valbuf, "%x", (val % 100)); + ivm_set_value("IVM_HWVersion", (char *)valbuf); } - ivm_get_value (buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, "IVM_Functions", 12, 0); + ivm_get_value(buf, CONFIG_SYS_IVM_EEPROM_PAGE_LEN, + "IVM_Functions", 12, 0); GET_STRING("IVM_Symbol", IVM_POS_SYMBOL_ONLY, 8) GET_STRING("IVM_DeviceName", IVM_POS_SHORT_TEXT, 64) tmp = (unsigned char *) getenv("IVM_DeviceName"); if (tmp) { - int len = strlen ((char *)tmp); + int len = strlen((char *)tmp); int i = 0; while (i < len) { if (tmp[i] == ';') { - ivm_set_value ("IVM_ShortText", (char *)&tmp[i + 1]); + ivm_set_value("IVM_ShortText", + (char *)&tmp[i + 1]); break; } i++; } if (i >= len) - ivm_set_value ("IVM_ShortText", NULL); + ivm_set_value("IVM_ShortText", NULL); } else { - ivm_set_value ("IVM_ShortText", NULL); + ivm_set_value("IVM_ShortText", NULL); } GET_STRING("IVM_ManufacturerID", IVM_POS_MANU_ID, 32) GET_STRING("IVM_ManufacturerSerialNumber", IVM_POS_MANU_SERIAL, 20) @@ -288,14 +343,15 @@ int ivm_analyze_eeprom (unsigned char *buf, int len) GET_STRING("IVM_CustomerID", IVM_POS_CUSTOMER_ID, 32) GET_STRING("IVM_CustomerProductID", IVM_POS_CUSTOMER_PROD_ID, 32) - if (ivm_check_crc (&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], 2) != 0) + if (ivm_check_crc(&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], 2) != 0) return 0; - ivm_analyze_block2 (&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], CONFIG_SYS_IVM_EEPROM_PAGE_LEN); + ivm_analyze_block2(&buf[CONFIG_SYS_IVM_EEPROM_PAGE_LEN * 2], + CONFIG_SYS_IVM_EEPROM_PAGE_LEN); return 0; } -int ivm_read_eeprom (void) +int ivm_read_eeprom(void) { #if defined(CONFIG_I2C_MUX) I2C_MUX_DEVICE *dev = NULL; @@ -303,229 +359,259 @@ int ivm_read_eeprom (void) uchar i2c_buffer[CONFIG_SYS_IVM_EEPROM_MAX_LEN]; uchar *buf; unsigned dev_addr = CONFIG_SYS_IVM_EEPROM_ADR; + int ret; #if defined(CONFIG_I2C_MUX) /* First init the Bus, select the Bus */ #if defined(CONFIG_SYS_I2C_IVM_BUS) - dev = i2c_mux_ident_muxstring ((uchar *)CONFIG_SYS_I2C_IVM_BUS); + dev = i2c_mux_ident_muxstring((uchar *)CONFIG_SYS_I2C_IVM_BUS); #else - buf = (unsigned char *) getenv ("EEprom_ivm"); + buf = (unsigned char *) getenv("EEprom_ivm"); if (buf != NULL) - dev = i2c_mux_ident_muxstring (buf); + dev = i2c_mux_ident_muxstring(buf); #endif if (dev == NULL) { - printf ("Error couldnt add Bus for IVM\n"); + printf("Error couldnt add Bus for IVM\n"); return -1; } - i2c_set_bus_num (dev->busid); + i2c_set_bus_num(dev->busid); #endif - buf = (unsigned char *) getenv ("EEprom_ivm_addr"); + buf = (unsigned char *) getenv("EEprom_ivm_addr"); if (buf != NULL) - dev_addr = simple_strtoul ((char *)buf, NULL, 16); + dev_addr = simple_strtoul((char *)buf, NULL, 16); - if (i2c_read(dev_addr, 0, 1, i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN) != 0) { + /* add deblocking here */ + i2c_make_abort(); + + ret = i2c_read(dev_addr, 0, 1, i2c_buffer, + CONFIG_SYS_IVM_EEPROM_MAX_LEN); + if (ret != 0) { printf ("Error reading EEprom\n"); return -2; } - return ivm_analyze_eeprom (i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN); + return ivm_analyze_eeprom(i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN); } #if defined(CONFIG_SYS_I2C_INIT_BOARD) -#define DELAY_ABORT_SEQ 62 +#define DELAY_ABORT_SEQ 62 /* @200kHz 9 clocks = 44us, 62us is ok */ #define DELAY_HALF_PERIOD (500 / (CONFIG_SYS_I2C_SPEED / 1000)) -#if defined(CONFIG_MGCOGE) +#if defined(CONFIG_MGCOGE) || defined(CONFIG_MGCOGE2NE) #define SDA_MASK 0x00010000 #define SCL_MASK 0x00020000 -static void set_pin (int state, unsigned long mask) +static void set_pin(int state, unsigned long mask) { - volatile ioport_t *iop = ioport_addr ((immap_t *)CONFIG_SYS_IMMR, 3); + ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3); if (state) - iop->pdat |= (mask); + setbits_be32(&iop->pdat, mask); else - iop->pdat &= ~(mask); + clrbits_be32(&iop->pdat, mask); - iop->pdir |= (mask); + setbits_be32(&iop->pdir, mask); } -static int get_pin (unsigned long mask) +static int get_pin(unsigned long mask) { - volatile ioport_t *iop = ioport_addr ((immap_t *)CONFIG_SYS_IMMR, 3); + ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3); - iop->pdir &= ~(mask); - return (0 != (iop->pdat & (mask))); + clrbits_be32(&iop->pdir, mask); + return 0 != (in_be32(&iop->pdat) & mask); } -static void set_sda (int state) +static void set_sda(int state) { - set_pin (state, SDA_MASK); + set_pin(state, SDA_MASK); } -static void set_scl (int state) +static void set_scl(int state) { - set_pin (state, SCL_MASK); + set_pin(state, SCL_MASK); } -static int get_sda (void) +static int get_sda(void) { - return get_pin (SDA_MASK); + return get_pin(SDA_MASK); } -static int get_scl (void) +static int get_scl(void) { - return get_pin (SCL_MASK); + return get_pin(SCL_MASK); } #if defined(CONFIG_HARD_I2C) -static void setports (int gpio) +static void setports(int gpio) { - volatile ioport_t *iop = ioport_addr ((immap_t *)CONFIG_SYS_IMMR, 3); + ioport_t *iop = ioport_addr((immap_t *)CONFIG_SYS_IMMR, 3); if (gpio) { - iop->ppar &= ~(SDA_MASK | SCL_MASK); - iop->podr &= ~(SDA_MASK | SCL_MASK); + clrbits_be32(&iop->ppar, (SDA_MASK | SCL_MASK)); + clrbits_be32(&iop->podr, (SDA_MASK | SCL_MASK)); } else { - iop->ppar |= (SDA_MASK | SCL_MASK); - iop->pdir &= ~(SDA_MASK | SCL_MASK); - iop->podr |= (SDA_MASK | SCL_MASK); + setbits_be32(&iop->ppar, (SDA_MASK | SCL_MASK)); + clrbits_be32(&iop->pdir, (SDA_MASK | SCL_MASK)); + setbits_be32(&iop->podr, (SDA_MASK | SCL_MASK)); } } #endif #endif -#if defined(CONFIG_KM8XX) -static void set_sda (int state) -{ - I2C_SDA(state); -} - -static void set_scl (int state) +#if !defined(CONFIG_MPC83xx) +static void i2c_write_start_seq(void) { - I2C_SCL(state); + set_sda(1); + udelay(DELAY_HALF_PERIOD); + set_scl(1); + udelay(DELAY_HALF_PERIOD); + set_sda(0); + udelay(DELAY_HALF_PERIOD); + set_scl(0); + udelay(DELAY_HALF_PERIOD); } -static int get_sda (void) +/* + * I2C is a synchronous protocol and resets of the processor in the middle + * of an access can block the I2C Bus until a powerdown of the full unit is + * done. This function toggles the SCL until the SCL and SCA line are + * released, but max. 16 times, after this a I2C start-sequence is sent. + * This I2C Deblocking mechanism was developed by Keymile in association + * with Anatech and Atmel in 1998. + */ +static int i2c_make_abort(void) { - return I2C_READ; -} -static int get_scl (void) -{ - int val; +#if defined(CONFIG_HARD_I2C) && !defined(MACH_TYPE_KM_KIRKWOOD) + immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ; + i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c; - *(unsigned short *)(I2C_BASE_DIR) &= ~SCL_CONF; - udelay (1); - val = *(unsigned char *)(I2C_BASE_PORT); + /* + * disable I2C controller first, otherwhise it thinks we want to + * talk to the slave port... + */ + clrbits_8(&i2c->i2c_i2mod, 0x01); - return ((val & SCL_BIT) == SCL_BIT); -} + /* Set the PortPins to GPIO */ + setports(1); #endif -#if !defined(CONFIG_KMETER1) -static void writeStartSeq (void) -{ - set_sda (1); - udelay (DELAY_HALF_PERIOD); - set_scl (1); - udelay (DELAY_HALF_PERIOD); - set_sda (0); - udelay (DELAY_HALF_PERIOD); - set_scl (0); - udelay (DELAY_HALF_PERIOD); -} - -/* I2C is a synchronous protocol and resets of the processor in the middle - of an access can block the I2C Bus until a powerdown of the full unit is - done. This function toggles the SCL until the SCL and SCA line are - released, but max. 16 times, after this a I2C start-sequence is sent. - This I2C Deblocking mechanism was developed by Keymile in association - with Anatech and Atmel in 1998. - */ -static int i2c_make_abort (void) -{ int scl_state = 0; int sda_state = 0; int i = 0; int ret = 0; - if (!get_sda ()) { + if (!get_sda()) { ret = -1; while (i < 16) { i++; - set_scl (0); - udelay (DELAY_ABORT_SEQ); - set_scl (1); - udelay (DELAY_ABORT_SEQ); - scl_state = get_scl (); - sda_state = get_sda (); + set_scl(0); + udelay(DELAY_ABORT_SEQ); + set_scl(1); + udelay(DELAY_ABORT_SEQ); + scl_state = get_scl(); + sda_state = get_sda(); if (scl_state && sda_state) { ret = 0; break; } } } - if (ret == 0) { - for (i =0; i < 5; i++) { - writeStartSeq (); - } - } - get_sda (); + if (ret == 0) + for (i = 0; i < 5; i++) + i2c_write_start_seq(); + + /* respect stop setup time */ + udelay(DELAY_ABORT_SEQ); + set_scl(1); + udelay(DELAY_ABORT_SEQ); + set_sda(1); + get_sda(); + +#if defined(CONFIG_HARD_I2C) + /* Set the PortPins back to use for I2C */ + setports(0); +#endif return ret; } #endif -/** - * i2c_init_board - reset i2c bus. When the board is powercycled during a - * bus transfer it might hang; for details see doc/I2C_Edge_Conditions. - */ -void i2c_init_board(void) +#if defined(CONFIG_MPC83xx) +static void i2c_write_start_seq(void) { -#if defined(CONFIG_KMETER1) struct fsl_i2c *dev; dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET); - uchar dummy; + udelay(DELAY_ABORT_SEQ); + out_8(&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA)); + udelay(DELAY_ABORT_SEQ); + out_8(&dev->cr, (I2C_CR_MEN)); +} - out_8 (&dev->cr, (I2C_CR_MSTA)); - out_8 (&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA)); - dummy = in_8(&dev->dr); +static int i2c_make_abort(void) +{ + struct fsl_i2c *dev; + dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET); + uchar dummy; + uchar last; + int nbr_read = 0; + int i = 0; + int ret = 0; + + /* wait after each operation to finsh with a delay */ + out_8(&dev->cr, (I2C_CR_MSTA)); + udelay(DELAY_ABORT_SEQ); + out_8(&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA)); + udelay(DELAY_ABORT_SEQ); dummy = in_8(&dev->dr); - if (dummy != 0xff) { - dummy = in_8(&dev->dr); + udelay(DELAY_ABORT_SEQ); + last = in_8(&dev->dr); + nbr_read++; + + /* + * do read until the last bit is 1, but stop if the full eeprom is + * read. + */ + while (((last & 0x01) != 0x01) && + (nbr_read < CONFIG_SYS_IVM_EEPROM_MAX_LEN)) { + udelay(DELAY_ABORT_SEQ); + last = in_8(&dev->dr); + nbr_read++; } - out_8 (&dev->cr, (I2C_CR_MEN)); - out_8 (&dev->cr, 0x00); - out_8 (&dev->cr, (I2C_CR_MEN)); - -#else -#if defined(CONFIG_HARD_I2C) && !defined(CONFIG_MACH_SUEN3) - volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ; - volatile i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c; - - /* disable I2C controller first, otherwhise it thinks we want to */ - /* talk to the slave port... */ - i2c->i2c_i2mod &= ~0x01; + if ((last & 0x01) != 0x01) + ret = -2; + if ((last != 0xff) || (nbr_read > 1)) + printf("[INFO] i2c abort after %d bytes (0x%02x)\n", + nbr_read, last); + udelay(DELAY_ABORT_SEQ); + out_8(&dev->cr, (I2C_CR_MEN)); + udelay(DELAY_ABORT_SEQ); + /* clear status reg */ + out_8(&dev->sr, 0); + + for (i = 0; i < 5; i++) + i2c_write_start_seq(); + if (ret != 0) + printf("[ERROR] i2c abort failed after %d bytes (0x%02x)\n", + nbr_read, last); - /* Set the PortPins to GPIO */ - setports (1); + return ret; +} #endif +/** + * i2c_init_board - reset i2c bus. When the board is powercycled during a + * bus transfer it might hang; for details see doc/I2C_Edge_Conditions. + */ +void i2c_init_board(void) +{ /* Now run the AbortSequence() */ - i2c_make_abort (); - -#if defined(CONFIG_HARD_I2C) - /* Set the PortPins back to use for I2C */ - setports (0); -#endif -#endif + i2c_make_abort(); } #endif #endif #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) -int fdt_set_node_and_value (void *blob, +int fdt_set_node_and_value(void *blob, char *nodename, char *regname, void *var, @@ -534,21 +620,22 @@ int fdt_set_node_and_value (void *blob, int ret = 0; int nodeoffset = 0; - nodeoffset = fdt_path_offset (blob, nodename); + nodeoffset = fdt_path_offset(blob, nodename); if (nodeoffset >= 0) { - ret = fdt_setprop (blob, nodeoffset, regname, var, + ret = fdt_setprop(blob, nodeoffset, regname, var, size); if (ret < 0) printf("ft_blob_update(): cannot set %s/%s " "property err:%s\n", nodename, regname, - fdt_strerror (ret)); + fdt_strerror(ret)); } else { printf("ft_blob_update(): cannot find %s node " - "err:%s\n", nodename, fdt_strerror (nodeoffset)); + "err:%s\n", nodename, fdt_strerror(nodeoffset)); } return ret; } -int fdt_get_node_and_value (void *blob, + +int fdt_get_node_and_value(void *blob, char *nodename, char *propname, void **var) @@ -556,42 +643,45 @@ int fdt_get_node_and_value (void *blob, int len; int nodeoffset = 0; - nodeoffset = fdt_path_offset (blob, nodename); + nodeoffset = fdt_path_offset(blob, nodename); if (nodeoffset >= 0) { - *var = (void *)fdt_getprop (blob, nodeoffset, propname, &len); + *var = (void *)fdt_getprop(blob, nodeoffset, propname, &len); if (len == 0) { /* no value */ - printf ("%s no value\n", __FUNCTION__); + printf("%s no value\n", __func__); return -1; } else if (len > 0) { return len; } else { - printf ("libfdt fdt_getprop(): %s\n", + printf("libfdt fdt_getprop(): %s\n", fdt_strerror(len)); return -2; } } else { - printf("%s: cannot find %s node err:%s\n", __FUNCTION__, - nodename, fdt_strerror (nodeoffset)); + printf("%s: cannot find %s node err:%s\n", __func__, + nodename, fdt_strerror(nodeoffset)); return -3; } } #endif -#if !defined(CONFIG_MACH_SUEN3) -int ethernet_present (void) +#if !defined(MACH_TYPE_KM_KIRKWOOD) +int ethernet_present(void) { - return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 0x80); + struct km_bec_fpga *base = + (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE; + + return in_8(&base->bprth) & PIGGY_PRESENT; } #endif -int board_eth_init (bd_t *bis) +int board_eth_init(bd_t *bis) { #ifdef CONFIG_KEYMILE_HDLC_ENET - (void)keymile_hdlc_enet_initialize (bis); + (void)keymile_hdlc_enet_initialize(bis); #endif - if (ethernet_present ()) { - return -1; - } - return 0; + if (ethernet_present()) + return cpu_eth_init(bis); + + return -1; } diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h index a38c727..099de98 100644 --- a/board/keymile/common/common.h +++ b/board/keymile/common/common.h @@ -11,20 +11,55 @@ #ifndef __KEYMILE_COMMON_H #define __KEYMILE_COMMON_H -int ethernet_present (void); -int ivm_read_eeprom (void); +#define WRG_RESET 0x80 +#define H_OPORTS_14 0x40 +#define WRG_LED 0x02 +#define WRL_BOOT 0x01 + +#define H_OPORTS_SCC4_ENA 0x10 +#define H_OPORTS_SCC4_FD_ENA 0x04 +#define H_OPORTS_FCC1_PW_DWN 0x01 + +#define PIGGY_PRESENT 0x80 + +struct km_bec_fpga { + unsigned char id; + unsigned char rev; + unsigned char oprth; + unsigned char oprtl; + unsigned char res1[3]; + unsigned char bprth; + unsigned char bprtl; + unsigned char res2[6]; + unsigned char prst; + unsigned char res3[0xfff0]; + unsigned char pgy_id; + unsigned char pgy_rev; + unsigned char pgy_outputs; + unsigned char pgy_eth; +}; + +#if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET) +#define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0 +#endif + +int ethernet_present(void); +int ivm_read_eeprom(void); #ifdef CONFIG_KEYMILE_HDLC_ENET -int keymile_hdlc_enet_initialize (bd_t *bis); +int keymile_hdlc_enet_initialize(bd_t *bis); #endif -int fdt_set_node_and_value (void *blob, +int set_km_env(void); +int fdt_set_node_and_value(void *blob, char *nodename, char *regname, void *var, int size); -int fdt_get_node_and_value (void *blob, +int fdt_get_node_and_value(void *blob, char *nodename, char *propname, void **var); + +int i2c_soft_read_pin(void); #endif /* __KEYMILE_COMMON_H */ diff --git a/board/keymile/kmeter1/Makefile b/board/keymile/km83xx/Makefile index 2fa84f3..2fa84f3 100644 --- a/board/keymile/kmeter1/Makefile +++ b/board/keymile/km83xx/Makefile diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c new file mode 100644 index 0000000..17560c8 --- /dev/null +++ b/board/keymile/km83xx/km83xx.c @@ -0,0 +1,288 @@ +/* + * Copyright (C) 2006 Freescale Semiconductor, Inc. + * Dave Liu <daveliu@freescale.com> + * + * Copyright (C) 2007 Logic Product Development, Inc. + * Peter Barada <peterb@logicpd.com> + * + * Copyright (C) 2007 MontaVista Software, Inc. + * Anton Vorontsov <avorontsov@ru.mvista.com> + * + * (C) Copyright 2008 - 2010 + * Heiko Schocher, DENX Software Engineering, hs@denx.de. + * + * 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. + */ + +#include <common.h> +#include <ioports.h> +#include <mpc83xx.h> +#include <i2c.h> +#include <miiphy.h> +#include <asm/io.h> +#include <asm/mmu.h> +#include <asm/processor.h> +#include <pci.h> +#include <libfdt.h> + +#include "../common/common.h" + +const qe_iop_conf_t qe_iop_conf_tab[] = { + /* port pin dir open_drain assign */ +#if defined(CONFIG_KMETER1) + /* MDIO */ + {0, 1, 3, 0, 2}, /* MDIO */ + {0, 2, 1, 0, 1}, /* MDC */ + + /* UCC4 - UEC */ + {1, 14, 1, 0, 1}, /* TxD0 */ + {1, 15, 1, 0, 1}, /* TxD1 */ + {1, 20, 2, 0, 1}, /* RxD0 */ + {1, 21, 2, 0, 1}, /* RxD1 */ + {1, 18, 1, 0, 1}, /* TX_EN */ + {1, 26, 2, 0, 1}, /* RX_DV */ + {1, 27, 2, 0, 1}, /* RX_ER */ + {1, 24, 2, 0, 1}, /* COL */ + {1, 25, 2, 0, 1}, /* CRS */ + {2, 15, 2, 0, 1}, /* TX_CLK - CLK16 */ + {2, 16, 2, 0, 1}, /* RX_CLK - CLK17 */ + + /* DUART - UART2 */ + {5, 0, 1, 0, 2}, /* UART2_SOUT */ + {5, 2, 1, 0, 1}, /* UART2_RTS */ + {5, 3, 2, 0, 2}, /* UART2_SIN */ + {5, 1, 2, 0, 3}, /* UART2_CTS */ +#else + /* Local Bus */ + {0, 16, 1, 0, 3}, /* LA00 */ + {0, 17, 1, 0, 3}, /* LA01 */ + {0, 18, 1, 0, 3}, /* LA02 */ + {0, 19, 1, 0, 3}, /* LA03 */ + {0, 20, 1, 0, 3}, /* LA04 */ + {0, 21, 1, 0, 3}, /* LA05 */ + {0, 22, 1, 0, 3}, /* LA06 */ + {0, 23, 1, 0, 3}, /* LA07 */ + {0, 24, 1, 0, 3}, /* LA08 */ + {0, 25, 1, 0, 3}, /* LA09 */ + {0, 26, 1, 0, 3}, /* LA10 */ + {0, 27, 1, 0, 3}, /* LA11 */ + {0, 28, 1, 0, 3}, /* LA12 */ + {0, 29, 1, 0, 3}, /* LA13 */ + {0, 30, 1, 0, 3}, /* LA14 */ + {0, 31, 1, 0, 3}, /* LA15 */ + + /* MDIO */ + {3, 4, 3, 0, 2}, /* MDIO */ + {3, 5, 1, 0, 2}, /* MDC */ + + /* UCC4 - UEC */ + {1, 18, 1, 0, 1}, /* TxD0 */ + {1, 19, 1, 0, 1}, /* TxD1 */ + {1, 22, 2, 0, 1}, /* RxD0 */ + {1, 23, 2, 0, 1}, /* RxD1 */ + {1, 26, 2, 0, 1}, /* RxER */ + {1, 28, 2, 0, 1}, /* Rx_DV */ + {1, 30, 1, 0, 1}, /* TxEN */ + {1, 31, 2, 0, 1}, /* CRS */ + {3, 10, 2, 0, 3}, /* TxCLK->CLK17 */ +#endif + + /* END of table */ + {0, 0, 0, 0, QE_IOP_TAB_END}, +}; + +static int board_init_i2c_busses(void) +{ + I2C_MUX_DEVICE *dev = NULL; + uchar *buf; + + /* Set up the Bus for the DTTs */ + buf = (unsigned char *) getenv("dtt_bus"); + if (buf != NULL) + dev = i2c_mux_ident_muxstring(buf); + if (dev == NULL) { + printf("Error couldn't add Bus for DTT\n"); + printf("please setup dtt_bus to where your\n"); + printf("DTT is found.\n"); + } + return 0; +} + +#if defined(CONFIG_SUVD3) +const uint upma_table[] = { + 0x1ffedc00, 0x0ffcdc80, 0x0ffcdc80, 0x0ffcdc04, /* Words 0 to 3 */ + 0x0ffcdc00, 0xffffcc00, 0xffffcc01, 0xfffffc01, /* Words 4 to 7 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 8 to 11 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 12 to 15 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 16 to 19 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 20 to 23 */ + 0x9cfffc00, 0x00fffc80, 0x00fffc80, 0x00fffc00, /* Words 24 to 27 */ + 0xffffec04, 0xffffec01, 0xfffffc01, 0xfffffc01, /* Words 28 to 31 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 32 to 35 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 36 to 39 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 40 to 43 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 44 to 47 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 48 to 51 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 52 to 55 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 56 to 59 */ + 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01 /* Words 60 to 63 */ +}; +#endif + +int board_early_init_r(void) +{ + struct km_bec_fpga *base = + (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE; +#if defined(CONFIG_SUVD3) + immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; + fsl_lbc_t *lbc = &immap->im_lbc; + u32 *mxmr = &lbc->mamr; +#endif + +#if defined(CONFIG_MPC8360) + unsigned short svid; + /* + * Because of errata in the UCCs, we have to write to the reserved + * registers to slow the clocks down. + */ + svid = SVR_REV(mfspr(SVR)); + switch (svid) { + case 0x0020: + /* + * MPC8360ECE.pdf QE_ENET10 table 4: + * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2) + * IMMR + 0x14A8[18:19] = 11 (clk delay for UCC 1) + */ + setbits_be32((void *)(CONFIG_SYS_IMMR + 0x14a8), 0x0c003000); + break; + case 0x0021: + /* + * MPC8360ECE.pdf QE_ENET10 table 4: + * IMMR + 0x14AC[24:27] = 1010 + */ + clrsetbits_be32((void *)(CONFIG_SYS_IMMR + 0x14ac), + 0x00000050, 0x000000a0); + break; + } +#endif + + /* enable the PHY on the PIGGY */ + setbits_8(&base->pgy_eth, 0x01); + /* enable the Unit LED (green) */ + setbits_8(&base->oprth, WRL_BOOT); + +#if defined(CONFIG_SUVD3) + /* configure UPMA for APP1 */ + upmconfig(UPMA, (uint *) upma_table, + sizeof(upma_table) / sizeof(uint)); + out_be32(mxmr, CONFIG_SYS_MAMR); +#endif + return 0; +} + +int misc_init_r(void) +{ + /* add board specific i2c busses */ + board_init_i2c_busses(); + return 0; +} + +int last_stage_init(void) +{ + set_km_env(); + return 0; +} + +int fixed_sdram(void) +{ + immap_t *im = (immap_t *)CONFIG_SYS_IMMR; + u32 msize = 0; + u32 ddr_size; + u32 ddr_size_log2; + + out_be32(&im->sysconf.ddrlaw[0].ar, (LAWAR_EN | 0x1e)); + out_be32(&im->ddr.csbnds[0].csbnds, CONFIG_SYS_DDR_CS0_BNDS); + out_be32(&im->ddr.cs_config[0], CONFIG_SYS_DDR_CS0_CONFIG); + out_be32(&im->ddr.timing_cfg_0, CONFIG_SYS_DDR_TIMING_0); + out_be32(&im->ddr.timing_cfg_1, CONFIG_SYS_DDR_TIMING_1); + out_be32(&im->ddr.timing_cfg_2, CONFIG_SYS_DDR_TIMING_2); + out_be32(&im->ddr.timing_cfg_3, CONFIG_SYS_DDR_TIMING_3); + out_be32(&im->ddr.sdram_cfg, CONFIG_SYS_DDR_SDRAM_CFG); + out_be32(&im->ddr.sdram_cfg2, CONFIG_SYS_DDR_SDRAM_CFG2); + out_be32(&im->ddr.sdram_mode, CONFIG_SYS_DDR_MODE); + out_be32(&im->ddr.sdram_mode2, CONFIG_SYS_DDR_MODE2); + out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL); + out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_CLK_CNTL); + udelay(200); + out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); + + msize = CONFIG_SYS_DDR_SIZE << 20; + disable_addr_trans(); + msize = get_ram_size(CONFIG_SYS_DDR_BASE, msize); + enable_addr_trans(); + msize /= (1024 * 1024); + if (CONFIG_SYS_DDR_SIZE != msize) { + for (ddr_size = msize << 20, ddr_size_log2 = 0; + (ddr_size > 1); + ddr_size = ddr_size >> 1, ddr_size_log2++) + if (ddr_size & 1) + return -1; + out_be32(&im->sysconf.ddrlaw[0].ar, + (LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE))); + out_be32(&im->ddr.csbnds[0].csbnds, + (((msize / 16) - 1) & 0xff)); + } + + return msize; +} + +phys_size_t initdram(int board_type) +{ + immap_t *im = (immap_t *)CONFIG_SYS_IMMR; + u32 msize = 0; + + if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) + return -1; + + out_be32(&im->sysconf.ddrlaw[0].bar, + CONFIG_SYS_DDR_BASE & LAWBAR_BAR); + msize = fixed_sdram(); + +#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER) + /* + * Initialize DDR ECC byte + */ + ddr_enable_ecc(msize * 1024 * 1024); +#endif + + /* return total bus SDRAM size(bytes) -- DDR */ + return msize * 1024 * 1024; +} + +int checkboard(void) +{ + puts("Board: Keymile " CONFIG_KM_BOARD_NAME); + + if (ethernet_present()) + puts(" with PIGGY."); + puts("\n"); + return 0; +} + +#if defined(CONFIG_OF_BOARD_SETUP) +void ft_board_setup(void *blob, bd_t *bd) +{ + ft_cpu_setup(blob, bd); +} +#endif + +#if defined(CONFIG_HUSH_INIT_VAR) +int hush_init_var(void) +{ + ivm_read_eeprom(); + return 0; +} +#endif diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index dcf0f42..c772ee2 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -93,7 +93,7 @@ u32 kwmpp_config[] = { MPP41_GPIO, /* Piggy3 LED[4] */ MPP42_GPIO, /* Piggy3 LED[5] */ MPP43_GPIO, /* Piggy3 LED[6] */ - MPP44_GPIO, /* Piggy3 LED[7] */ + MPP44_GPIO, /* Piggy3 LED[7], BIST_EN_L */ MPP45_GPIO, /* Piggy3 LED[8] */ MPP46_GPIO, /* Reserved */ MPP47_GPIO, /* Reserved */ @@ -108,15 +108,43 @@ int ethernet_present(void) int ret = 0; if (i2c_read(0x10, 2, 1, &buf, 1) != 0) { - printf ("%s: Error reading Boco\n", __FUNCTION__); + printf("%s: Error reading Boco\n", __func__); return -1; } - if ((buf & 0x40) == 0x40) { + if ((buf & 0x40) == 0x40) ret = 1; - } + return ret; } +int initialize_unit_leds(void) +{ + /* + * init the unit LEDs + * per default they all are + * ok apart from bootstat + * LED connected through BOCO + * BOCO lies at the address 0x10 + * LEDs are in the block CTRL_H (addr 0x02) + * BOOTSTAT LED is the first 0x01 + */ + #define BOCO 0x10 + #define CTRL_H 0x02 + #define APPLEDMASK 0x01 + uchar buf; + + if (i2c_read(BOCO, CTRL_H, 1, &buf, 1) != 0) { + printf("%s: Error reading Boco\n", __func__); + return -1; + } + buf |= APPLEDMASK; + if (i2c_write(BOCO, CTRL_H, 1, &buf, 1) != 0) { + printf("%s: Error writing Boco\n", __func__); + return -1; + } + return 0; +} + int misc_init_r(void) { char *str; @@ -133,6 +161,9 @@ int misc_init_r(void) printf("Overwriting MACH_TYPE with %d!!!\n", mach_type); gd->bd->bi_arch_number = mach_type; } + + initialize_unit_leds(); + return 0; } @@ -155,14 +186,14 @@ int board_early_init_f(void) #if defined(CONFIG_SOFT_I2C) /* init the GPIO for I2C Bitbang driver */ - kw_gpio_set_valid(SUEN3_SDA_PIN, 1); - kw_gpio_set_valid(SUEN3_SCL_PIN, 1); - kw_gpio_direction_output(SUEN3_SDA_PIN, 0); - kw_gpio_direction_output(SUEN3_SCL_PIN, 0); + kw_gpio_set_valid(KM_KIRKWOOD_SDA_PIN, 1); + kw_gpio_set_valid(KM_KIRKWOOD_SCL_PIN, 1); + kw_gpio_direction_output(KM_KIRKWOOD_SDA_PIN, 0); + kw_gpio_direction_output(KM_KIRKWOOD_SCL_PIN, 0); #endif #if defined(CONFIG_SYS_EEPROM_WREN) - kw_gpio_set_valid(SUEN3_ENV_WP, 38); - kw_gpio_direction_output(SUEN3_ENV_WP, 1); + kw_gpio_set_valid(KM_KIRKWOOD_ENV_WP, 38); + kw_gpio_direction_output(KM_KIRKWOOD_ENV_WP, 1); #endif return 0; @@ -173,7 +204,7 @@ int board_init(void) /* * arch number of board */ - gd->bd->bi_arch_number = MACH_TYPE_SUEN3; + gd->bd->bi_arch_number = MACH_TYPE_KM_KIRKWOOD; /* address of boot parameters */ gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100; @@ -181,6 +212,12 @@ int board_init(void) return 0; } +int last_stage_init(void) +{ + set_km_env(); + return 0; +} + #if defined(CONFIG_CMD_SF) int do_spi_toggle(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -239,7 +276,6 @@ void dram_init_banksize(void) for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { gd->bd->bi_dram[i].start = kw_sdram_bar(i); - gd->bd->bi_dram[i].size = kw_sdram_bs(i); gd->bd->bi_dram[i].size = get_ram_size((long *)kw_sdram_bar(i), kw_sdram_bs(i)); } @@ -258,15 +294,15 @@ void reset_phy(void) } #if defined(CONFIG_HUSH_INIT_VAR) -int hush_init_var (void) +int hush_init_var(void) { - ivm_read_eeprom (); + ivm_read_eeprom(); return 0; } #endif #if defined(CONFIG_BOOTCOUNT_LIMIT) -void bootcount_store (ulong a) +void bootcount_store(ulong a) { volatile ulong *save_addr; volatile ulong size = 0; @@ -279,7 +315,7 @@ void bootcount_store (ulong a) writel(BOOTCOUNT_MAGIC, &save_addr[1]); } -ulong bootcount_load (void) +ulong bootcount_load(void) { volatile ulong *save_addr; volatile ulong size = 0; @@ -296,34 +332,34 @@ ulong bootcount_load (void) #endif #if defined(CONFIG_SOFT_I2C) -void set_sda (int state) +void set_sda(int state) { I2C_ACTIVE; I2C_SDA(state); } -void set_scl (int state) +void set_scl(int state) { I2C_SCL(state); } -int get_sda (void) +int get_sda(void) { I2C_TRISTATE; return I2C_READ; } -int get_scl (void) +int get_scl(void) { - return (kw_gpio_get_value(SUEN3_SCL_PIN) ? 1 : 0); + return kw_gpio_get_value(KM_KIRKWOOD_SCL_PIN) ? 1 : 0; } #endif #if defined(CONFIG_SYS_EEPROM_WREN) -int eeprom_write_enable (unsigned dev_addr, int state) +int eeprom_write_enable(unsigned dev_addr, int state) { - kw_gpio_set_value(SUEN3_ENV_WP, !state); + kw_gpio_set_value(KM_KIRKWOOD_ENV_WP, !state); - return !kw_gpio_get_value(SUEN3_ENV_WP); + return !kw_gpio_get_value(KM_KIRKWOOD_ENV_WP); } #endif diff --git a/board/keymile/km_arm/kwbimage.cfg b/board/keymile/km_arm/kwbimage.cfg index 26d6aa0..b2f5193 100644 --- a/board/keymile/km_arm/kwbimage.cfg +++ b/board/keymile/km_arm/kwbimage.cfg @@ -27,16 +27,18 @@ # Boot Media configurations BOOT_FROM spi # Boot from SPI flash -DATA 0xFFD10000 0x01111111 # MPP Control 0 Register -# bit 3-0: MPPSel0 1, NF_IO[2] -# bit 7-4: MPPSel1 1, NF_IO[3] -# bit 12-8: MPPSel2 1, NF_IO[4] -# bit 15-12: MPPSel3 1, NF_IO[5] +DATA 0xFFD10000 0x01112222 # MPP Control 0 Register +# bit 3-0: MPPSel0 2, NF_IO[2] +# bit 7-4: MPPSel1 2, NF_IO[3] +# bit 12-8: MPPSel2 2, NF_IO[4] +# bit 15-12: MPPSel3 2, NF_IO[5] # bit 19-16: MPPSel4 1, NF_IO[6] # bit 23-20: MPPSel5 1, NF_IO[7] # bit 27-24: MPPSel6 1, SYSRST_O # bit 31-28: MPPSel7 0, GPO[7] +DATA 0xFFD10004 0x03303300 + DATA 0xFFD10008 0x00001100 # MPP Control 2 Register # bit 3-0: MPPSel16 0, GPIO[16] # bit 7-4: MPPSel17 0, GPIO[17] @@ -48,8 +50,8 @@ DATA 0xFFD10008 0x00001100 # MPP Control 2 Register # bit 31-28: MPPSel23 0, GPIO[23] DATA 0xFFD100E0 0x1B1B1B1B # IO Configuration 0 Register -DATA 0xFFD20134 0xBBBBBBBB # L2 RAM Timing 0 Register -DATA 0xFFD20138 0x00BBBBBB # L2 RAM Timing 1 Register +DATA 0xFFD20134 0x66666666 # L2 RAM Timing 0 Register +DATA 0xFFD20138 0x66666666 # L2 RAM Timing 1 Register DATA 0xFFD20154 0x00000200 # CPU RAM Management Control3 Register DATA 0xFFD2014C 0x00001C00 # CPU RAM Management Control1 Register DATA 0xFFD20148 0x00000001 # CPU RAM Management Control0 Register @@ -63,7 +65,7 @@ DATA 0xFFD01400 0x43000400 # SDRAM Configuration Register # bit29-26: zero # bit31-30: 01 -DATA 0xFFD01404 0x36343000 # DDR Controller Control Low +DATA 0xFFD01404 0x39543000 # DDR Controller Control Low # bit 3-0: 0 reserved # bit 4: 0=addr/cmd in smame cycle # bit 5: 0=clk is driven during self refresh, we don't care for APX @@ -75,7 +77,7 @@ DATA 0xFFD01404 0x36343000 # DDR Controller Control Low # bit30-28: 3 required # bit31: 0=no additional STARTBURST delay -DATA 0xFFD01408 0x2302544B # DDR Timing (Low) (active cycles value +1) +DATA 0xFFD01408 0x34136552 # DDR Timing (Low) (active cycles value +1) # bit3-0: TRAS lsbs # bit7-4: TRCD # bit11- 8: TRP @@ -86,7 +88,7 @@ DATA 0xFFD01408 0x2302544B # DDR Timing (Low) (active cycles value +1) # bit27-24: TRRD # bit31-28: TRTP -DATA 0xFFD0140C 0x00000032 # DDR Timing (High) +DATA 0xFFD0140C 0x00000033 # DDR Timing (High) # bit6-0: TRFC # bit8-7: TR2R # bit10-9: TR2W @@ -116,8 +118,8 @@ DATA 0xFFD01418 0x00000000 # DDR Operation # bit3-0: 0x0, DDR cmd # bit31-4: 0 required -DATA 0xFFD0141C 0x00000642 # DDR Mode -DATA 0xFFD01420 0x00000040 # DDR Extended Mode +DATA 0xFFD0141C 0x00000652 # DDR Mode +DATA 0xFFD01420 0x00000044 # DDR Extended Mode # bit0: 0, DDR DLL enabled # bit1: 0, DDR drive strenght normal # bit2: 1, DDR ODT control lsd disabled @@ -140,6 +142,8 @@ DATA 0xFFD01424 0x0000F07F # DDR Controller Control High # bit11 : 0 , 1/4 clock cycle skew disabled for write mesh # bit15-12: 1111 required # bit31-16: 0 required +DATA 0xFFD01428 0x00074510 +DATA 0xFFD0147c 0x00007451 DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 DATA 0xFFD01504 0x07FFFFF1 # CS[0]n Size @@ -153,7 +157,7 @@ DATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled -DATA 0xFFD01494 0x00000000 # DDR ODT Control (Low) +DATA 0xFFD01494 0x00010001 # DDR ODT Control (Low) # bit3-0: 0, ODT0Rd, MODT[0] asserted during read from DRAM CS0 # bit19-16:0, ODT0Wr, MODT[0] asserted during write to DRAM CS0 @@ -162,7 +166,7 @@ DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) # bit3-2: 00, ODT1 controlled by register # bit31-4: zero, required -DATA 0xFFD0149C 0x0000E90F # CPU ODT Control +DATA 0xFFD0149C 0x0000FC11 # CPU ODT Control # bit3-0: F, ODT0Rd, Internal ODT asserted during read from DRAM bank0 # bit7-4: 0, ODT0Wr, Internal ODT asserted during write to DRAM bank0 # bit9-8: 1, ODTEn, never active diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c deleted file mode 100644 index bbcaf5d..0000000 --- a/board/keymile/kmeter1/kmeter1.c +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (C) 2006 Freescale Semiconductor, Inc. - * Dave Liu <daveliu@freescale.com> - * - * Copyright (C) 2007 Logic Product Development, Inc. - * Peter Barada <peterb@logicpd.com> - * - * Copyright (C) 2007 MontaVista Software, Inc. - * Anton Vorontsov <avorontsov@ru.mvista.com> - * - * (C) Copyright 2008 - * Heiko Schocher, DENX Software Engineering, hs@denx.de. - * - * 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. - */ - -#include <common.h> -#include <ioports.h> -#include <mpc83xx.h> -#include <i2c.h> -#include <miiphy.h> -#include <asm/io.h> -#include <asm/mmu.h> -#include <asm/processor.h> -#include <pci.h> -#include <libfdt.h> - -#include "../common/common.h" - -extern void disable_addr_trans (void); -extern void enable_addr_trans (void); -const qe_iop_conf_t qe_iop_conf_tab[] = { - /* port pin dir open_drain assign */ - - /* MDIO */ - {0, 1, 3, 0, 2}, /* MDIO */ - {0, 2, 1, 0, 1}, /* MDC */ - - /* UCC4 - UEC */ - {1, 14, 1, 0, 1}, /* TxD0 */ - {1, 15, 1, 0, 1}, /* TxD1 */ - {1, 20, 2, 0, 1}, /* RxD0 */ - {1, 21, 2, 0, 1}, /* RxD1 */ - {1, 18, 1, 0, 1}, /* TX_EN */ - {1, 26, 2, 0, 1}, /* RX_DV */ - {1, 27, 2, 0, 1}, /* RX_ER */ - {1, 24, 2, 0, 1}, /* COL */ - {1, 25, 2, 0, 1}, /* CRS */ - {2, 15, 2, 0, 1}, /* TX_CLK - CLK16 */ - {2, 16, 2, 0, 1}, /* RX_CLK - CLK17 */ - - /* DUART - UART2 */ - {5, 0, 1, 0, 2}, /* UART2_SOUT */ - {5, 2, 1, 0, 1}, /* UART2_RTS */ - {5, 3, 2, 0, 2}, /* UART2_SIN */ - {5, 1, 2, 0, 3}, /* UART2_CTS */ - - /* END of table */ - {0, 0, 0, 0, QE_IOP_TAB_END}, -}; - -static int board_init_i2c_busses (void) -{ - I2C_MUX_DEVICE *dev = NULL; - uchar *buf; - - /* Set up the Bus for the DTTs */ - buf = (unsigned char *) getenv ("dtt_bus"); - if (buf != NULL) - dev = i2c_mux_ident_muxstring (buf); - if (dev == NULL) { - printf ("Error couldn't add Bus for DTT\n"); - printf ("please setup dtt_bus to where your\n"); - printf ("DTT is found.\n"); - } - return 0; -} - -int board_early_init_r (void) -{ - unsigned short svid; - - /* - * Because of errata in the UCCs, we have to write to the reserved - * registers to slow the clocks down. - */ - svid = SVR_REV(mfspr (SVR)); - switch (svid) { - case 0x0020: - setbits_be32((void *)(CONFIG_SYS_IMMR + 0x14a8), 0x0c003000); - break; - case 0x0021: - clrsetbits_be32((void *)(CONFIG_SYS_IMMR + 0x14ac), - 0x00000050, 0x000000a0); - break; - } - /* enable the PHY on the PIGGY */ - setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x10003), 0x01); - /* enable the Unit LED (green) */ - setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x00002), 0x01); - /* take FE/GbE PHYs out of reset */ - setbits (8, (void *)(CONFIG_SYS_PIGGY_BASE + 0x0000f), 0x1c); - - return 0; -} - -int misc_init_r (void) -{ - /* add board specific i2c busses */ - board_init_i2c_busses (); - return 0; -} - -int fixed_sdram(void) -{ - volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; - u32 msize = 0; - u32 ddr_size; - u32 ddr_size_log2; - - im->sysconf.ddrlaw[0].ar = LAWAR_EN | 0x1e; - im->ddr.csbnds[0].csbnds = CONFIG_SYS_DDR_CS0_BNDS; - im->ddr.cs_config[0] = CONFIG_SYS_DDR_CS0_CONFIG; - im->ddr.timing_cfg_0 = CONFIG_SYS_DDR_TIMING_0; - im->ddr.timing_cfg_1 = CONFIG_SYS_DDR_TIMING_1; - im->ddr.timing_cfg_2 = CONFIG_SYS_DDR_TIMING_2; - im->ddr.timing_cfg_3 = CONFIG_SYS_DDR_TIMING_3; - im->ddr.sdram_cfg = CONFIG_SYS_DDR_SDRAM_CFG; - im->ddr.sdram_cfg2 = CONFIG_SYS_DDR_SDRAM_CFG2; - im->ddr.sdram_mode = CONFIG_SYS_DDR_MODE; - im->ddr.sdram_mode2 = CONFIG_SYS_DDR_MODE2; - im->ddr.sdram_interval = CONFIG_SYS_DDR_INTERVAL; - im->ddr.sdram_clk_cntl = CONFIG_SYS_DDR_CLK_CNTL; - udelay (200); - im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN; - - msize = CONFIG_SYS_DDR_SIZE << 20; - disable_addr_trans (); - msize = get_ram_size (CONFIG_SYS_DDR_BASE, msize); - enable_addr_trans (); - msize /= (1024 * 1024); - if (CONFIG_SYS_DDR_SIZE != msize) { - for (ddr_size = msize << 20, ddr_size_log2 = 0; - (ddr_size > 1); ddr_size = ddr_size >> 1, ddr_size_log2++) - if (ddr_size & 1) - return -1; - im->sysconf.ddrlaw[0].ar = - LAWAR_EN | ((ddr_size_log2 - 1) & LAWAR_SIZE); - im->ddr.csbnds[0].csbnds = (((msize / 16) - 1) & 0xff); - } - - return msize; -} - -phys_size_t initdram (int board_type) -{ -#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER) - extern void ddr_enable_ecc (unsigned int dram_size); -#endif - volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; - u32 msize = 0; - - if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) - return -1; - - /* DDR SDRAM - Main SODIMM */ - im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; - msize = fixed_sdram (); - -#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER) - /* - * Initialize DDR ECC byte - */ - ddr_enable_ecc (msize * 1024 * 1024); -#endif - - /* return total bus SDRAM size(bytes) -- DDR */ - return (msize * 1024 * 1024); -} - -int checkboard (void) -{ - puts ("Board: Keymile kmeter1"); - if (ethernet_present ()) - puts (" with PIGGY."); - puts ("\n"); - return 0; -} - -#if defined(CONFIG_OF_BOARD_SETUP) -/* - * update property in the blob - */ -void ft_blob_update (void *blob, bd_t *bd) -{ - /* no board specific update */ -} - - -void ft_board_setup (void *blob, bd_t *bd) -{ - ft_cpu_setup (blob, bd); - ft_blob_update (blob, bd); -} -#endif - -#if defined(CONFIG_HUSH_INIT_VAR) -extern int ivm_read_eeprom (void); -int hush_init_var (void) -{ - ivm_read_eeprom (); - return 0; -} -#endif diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c index 5dcdf37..7b34684 100644 --- a/board/keymile/mgcoge/mgcoge.c +++ b/board/keymile/mgcoge/mgcoge.c @@ -195,33 +195,30 @@ const iop_conf_t iop_conf_tab[4][32] = { } }; -/* Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx +/* + * Try SDRAM initialization with P/LSDMR=sdmr and ORx=orx * * This routine performs standard 8260 initialization sequence * and calculates the available memory size. It may be called * several times to try different SDRAM configurations on both * 60x and local buses. */ -static long int try_init (volatile memctl8260_t * memctl, ulong sdmr, - ulong orx, volatile uchar * base) +static long int try_init(memctl8260_t *memctl, ulong sdmr, + ulong orx, uchar *base) { - volatile uchar c = 0xff; - volatile uint *sdmr_ptr; - volatile uint *orx_ptr; + uchar c = 0xff; ulong maxsize, size; int i; - /* We must be able to test a location outsize the maximum legal size + /* + * We must be able to test a location outsize the maximum legal size * to find out THAT we are outside; but this address still has to be * mapped by the controller. That means, that the initial mapping has * to be (at least) twice as large as the maximum expected size. */ maxsize = (1 + (~orx | 0x7fff))/* / 2*/; - sdmr_ptr = &memctl->memc_psdmr; - orx_ptr = &memctl->memc_or1; - - *orx_ptr = orx; + out_be32(&memctl->memc_or1, orx); /* * Quote from 8260 UM (10.4.2 SDRAM Power-On Initialization, 10-35): @@ -243,53 +240,58 @@ static long int try_init (volatile memctl8260_t * memctl, ulong sdmr, * get here. The SDRAM can be accessed at the address CONFIG_SYS_SDRAM_BASE. */ - *sdmr_ptr = sdmr | PSDMR_OP_PREA; - *base = c; + out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_PREA); + out_8(base, c); - *sdmr_ptr = sdmr | PSDMR_OP_CBRR; + out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_CBRR); for (i = 0; i < 8; i++) - *base = c; + out_8(base, c); - *sdmr_ptr = sdmr | PSDMR_OP_MRW; - *(base + CONFIG_SYS_MRS_OFFS) = c; /* setting MR on address lines */ + out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_MRW); + /* setting MR on address lines */ + out_8((uchar *)(base + CONFIG_SYS_MRS_OFFS), c); - *sdmr_ptr = sdmr | PSDMR_OP_NORM | PSDMR_RFEN; - *base = c; + out_be32(&memctl->memc_psdmr, sdmr | PSDMR_OP_NORM | PSDMR_RFEN); + out_8(base, c); - size = get_ram_size ((long *)base, maxsize); - *orx_ptr = orx | ~(size - 1); + size = get_ram_size((long *)base, maxsize); + out_be32(&memctl->memc_or1, orx | ~(size - 1)); return (size); } -phys_size_t initdram (int board_type) +phys_size_t initdram(int board_type) { - volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; - volatile memctl8260_t *memctl = &immap->im_memctl; + immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; + memctl8260_t *memctl = &immap->im_memctl; long psize; - memctl->memc_psrt = CONFIG_SYS_PSRT; - memctl->memc_mptpr = CONFIG_SYS_MPTPR; + out_8(&memctl->memc_psrt, CONFIG_SYS_PSRT); + out_be16(&memctl->memc_mptpr, CONFIG_SYS_MPTPR); #ifndef CONFIG_SYS_RAMBOOT /* 60x SDRAM setup: */ - psize = try_init (memctl, CONFIG_SYS_PSDMR, CONFIG_SYS_OR1, - (uchar *) CONFIG_SYS_SDRAM_BASE); + psize = try_init(memctl, CONFIG_SYS_PSDMR, CONFIG_SYS_OR1, + (uchar *) CONFIG_SYS_SDRAM_BASE); #endif /* CONFIG_SYS_RAMBOOT */ - icache_enable (); + icache_enable(); return (psize); } int checkboard(void) { - puts ("Board: Keymile mgcoge"); - if (ethernet_present ()) - puts (" with PIGGY."); - puts ("\n"); +#if defined(CONFIG_MGCOGE) + puts("Board: Keymile mgcoge"); +#else + puts("Board: Keymile mgcoge2ne"); +#endif + if (ethernet_present()) + puts(" with PIGGY."); + puts("\n"); return 0; } @@ -308,31 +310,37 @@ int last_stage_init(void) puts("DIP: Enabled\n"); setenv("actual_bank", "0"); } + set_km_env(); return 0; } /* * Early board initalization. */ -int board_early_init_r (void) +int board_early_init_r(void) { + struct km_bec_fpga *base = + (struct km_bec_fpga *)CONFIG_SYS_KMBEC_FPGA_BASE; + /* setup the UPIOx */ /* General Unit Reset disabled, Flash Bank enabled, UnitLed on */ - out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x02), 0xc2); + out_8(&base->oprth, (WRG_RESET | H_OPORTS_14 | WRG_LED)); /* SCC4 enable, halfduplex, FCC1 powerdown */ - out_8((u8 *)(CONFIG_SYS_PIGGY_BASE + 0x03), 0x15); + out_8(&base->oprtl, (H_OPORTS_SCC4_ENA | H_OPORTS_SCC4_FD_ENA | + H_OPORTS_FCC1_PW_DWN)); + return 0; } -int hush_init_var (void) +int hush_init_var(void) { - ivm_read_eeprom (); + ivm_read_eeprom(); return 0; } #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) -void ft_board_setup (void *blob, bd_t *bd) +void ft_board_setup(void *blob, bd_t *bd) { - ft_cpu_setup (blob, bd); + ft_cpu_setup(blob, bd); } #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ diff --git a/board/munices/u-boot.lds b/board/munices/u-boot.lds deleted file mode 100644 index 99576bf..0000000 --- a/board/munices/u-boot.lds +++ /dev/null @@ -1,120 +0,0 @@ -/* - * (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) -/* 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 : - { - arch/powerpc/cpu/mpc5xxx/start.o (.text) - *(.text) - *(.got1) - . = ALIGN(16); - *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) - } - .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 (NOLOAD) : - { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - . = ALIGN(4); - } - __bss_end__ = . ; - PROVIDE (end = .); -} diff --git a/board/samsung/smdk6400/config.mk b/board/samsung/smdk6400/config.mk index 90cbcf2..6f04c2f 100644 --- a/board/samsung/smdk6400/config.mk +++ b/board/samsung/smdk6400/config.mk @@ -28,5 +28,3 @@ CONFIG_SYS_TEXT_BASE = $(RAM_TEXT) else CONFIG_SYS_TEXT_BASE = 0 endif - -LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot-nand.lds diff --git a/board/sc3/u-boot.lds b/board/sc3/u-boot.lds deleted file mode 100644 index 4db46ca..0000000 --- a/board/sc3/u-boot.lds +++ /dev/null @@ -1,148 +0,0 @@ -/* - * (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 - */ - -OUTPUT_ARCH(powerpc) -/* Do we need any of these for elf? - __DYNAMIC = 0; */ -SECTIONS -{ - .resetvec 0xFFFFFFFC : - { - *(.resetvec) - } = 0xffff - - /* 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 : - { - /* WARNING - the following is hand-optimized to fit within */ - /* the sector layout of our flash chips! XXX FIXME XXX */ - - arch/powerpc/cpu/ppc4xx/start.o (.text) - board/sc3/init.o (.text) - arch/powerpc/cpu/ppc4xx/kgdb.o (.text) - arch/powerpc/cpu/ppc4xx/traps.o (.text) - arch/powerpc/cpu/ppc4xx/interrupts.o (.text) - arch/powerpc/cpu/ppc4xx/4xx_uart.o (.text) - arch/powerpc/cpu/ppc4xx/cpu_init.o (.text) - arch/powerpc/cpu/ppc4xx/speed.o (.text) - common/dlmalloc.o (.text) - lib/crc32.o (.text) - arch/powerpc/lib/extable.o (.text) - lib/zlib.o (.text) - -/* . = env_offset;*/ -/* common/env_embedded.o(.text)*/ - - *(.text) - *(.got1) - } - _etext = .; - PROVIDE (etext = .); - .rodata : - { - *(.eh_frame) - *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) - } - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } - - /* Read-write section, merged into data segment: */ - . = (. + 0x00FF) & 0xFFFFFF00; - _erotext = .; - PROVIDE (erotext = .); - .reloc : - { - _GOT2_TABLE_ = .; - *(.got2) - *(.got) - PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); - _FIXUP_TABLE_ = .; - *(.fixup) - } - __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; - __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(256); - __init_begin = .; - .text.init : { *(.text.init) } - .data.init : { *(.data.init) } - . = ALIGN(256); - __init_end = .; - - __bss_start = .; - .bss (NOLOAD) : - { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - . = ALIGN(4); - } - __bss_end__ = . ; - PROVIDE (end = .); -} diff --git a/board/trab/config.mk b/board/trab/config.mk index a349b8c..367f0b7 100644 --- a/board/trab/config.mk +++ b/board/trab/config.mk @@ -24,5 +24,3 @@ sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp ifndef CONFIG_SYS_TEXT_BASE CONFIG_SYS_TEXT_BASE = 0x0DF40000 endif - -LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk deleted file mode 100644 index 4df1d9c..0000000 --- a/board/xilinx/ml507/config.mk +++ /dev/null @@ -1,4 +0,0 @@ -# need to strip off double quotes -ifneq ($(CONFIG_SYS_LDSCRIPT),) -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -endif diff --git a/board/xilinx/ppc405-generic/config.mk b/board/xilinx/ppc405-generic/config.mk deleted file mode 100644 index 4df1d9c..0000000 --- a/board/xilinx/ppc405-generic/config.mk +++ /dev/null @@ -1,4 +0,0 @@ -# need to strip off double quotes -ifneq ($(CONFIG_SYS_LDSCRIPT),) -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -endif diff --git a/board/xilinx/ppc440-generic/config.mk b/board/xilinx/ppc440-generic/config.mk deleted file mode 100644 index 4df1d9c..0000000 --- a/board/xilinx/ppc440-generic/config.mk +++ /dev/null @@ -1,4 +0,0 @@ -# need to strip off double quotes -ifneq ($(CONFIG_SYS_LDSCRIPT),) -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -endif |