Merge branch 'master' of git://git.denx.de/u-boot-marvell
authorWolfgang Denk <wd@denx.de>
Fri, 29 Oct 2010 20:03:00 +0000 (22:03 +0200)
committerWolfgang Denk <wd@denx.de>
Fri, 29 Oct 2010 20:03:00 +0000 (22:03 +0200)
Conflicts:
include/configs/km_arm.h

Signed-off-by: Wolfgang Denk <wd@denx.de>
1  2 
Makefile
arch/arm/cpu/arm926ejs/kirkwood/dram.c
board/keymile/km_arm/km_arm.c
include/configs/km_arm.h
include/configs/mv-common.h

diff --combined Makefile
+++ b/Makefile
@@@ -22,9 -22,9 +22,9 @@@
  #
  
  VERSION = 2010
 -PATCHLEVEL = 09
 +PATCHLEVEL = 12
  SUBLEVEL =
 -EXTRAVERSION =
 +EXTRAVERSION = -rc1
  ifneq "$(SUBLEVEL)" ""
  U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
  else
@@@ -357,7 -357,7 +357,7 @@@ $(obj)u-boot.imx:       $(obj)u-boot.bi
                -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
  
  $(obj)u-boot.kwb:       $(obj)u-boot.bin
-               $(obj)tools/mkimage -n $(KWD_CONFIG) -T kwbimage \
+               $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
                -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
  
  $(obj)u-boot.sha1:    $(obj)u-boot.bin
@@@ -372,8 -372,7 +372,8 @@@ GEN_UBOOT = 
                cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
                        --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
                        -Map u-boot.map -o u-boot
 -$(obj)u-boot: depend $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
 +$(obj)u-boot: depend \
 +              $(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
                $(GEN_UBOOT)
  ifeq ($(CONFIG_KALLSYMS),y)
                smap=`$(call SYSTEM_MAP,u-boot) | \
@@@ -401,7 -400,7 +401,7 @@@ $(LDSCRIPT):       depen
  $(obj)u-boot.lds: $(LDSCRIPT)
                $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
  
 -$(NAND_SPL):  $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
 +$(NAND_SPL):  $(TIMESTAMP_FILE) $(VERSION_FILE) depend
                $(MAKE) -C nand_spl/board/$(BOARDDIR) all
  
  $(U_BOOT_NAND):       $(NAND_SPL) $(obj)u-boot.bin
@@@ -427,9 -426,7 +427,9 @@@ updater
  
  # Explicitly make _depend in subdirs containing multiple targets to prevent
  # parallel sub-makes creating .depend files simultaneously.
 -depend dep:   $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
 +depend dep:   $(TIMESTAMP_FILE) $(VERSION_FILE) \
 +              $(obj)include/autoconf.mk \
 +              $(obj)include/generated/generic-asm-offsets.h
                for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \
                        $(MAKE) -C $$dir _depend ; done
  
@@@ -476,18 -473,6 +476,18 @@@ $(obj)include/autoconf.mk: $(obj)includ
                sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
        mv $@.tmp $@
  
 +$(obj)include/generated/generic-asm-offsets.h:        $(obj)include/autoconf.mk.dep \
 +      $(obj)lib/asm-offsets.s
 +      @$(XECHO) Generating $@
 +      tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
 +
 +$(obj)lib/asm-offsets.s:      $(obj)include/autoconf.mk.dep \
 +      $(src)lib/asm-offsets.c
 +      @mkdir -p $(obj)lib
 +      $(CC) -DDO_DEPS_ONLY \
 +              $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
 +              -o $@ $(src)lib/asm-offsets.c -c -S
 +
  #########################################################################
  else  # !config.mk
  all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
@@@ -1067,6 -1052,7 +1067,6 @@@ mx31pdk_nand_config     : unconfi
                echo "#define CONFIG_NAND_U_BOOT" >> $(obj)include/config.h;            \
        else                                                                            \
                echo "#define CONFIG_SKIP_LOWLEVEL_INIT" >> $(obj)include/config.h;     \
 -              echo "#define CONFIG_SKIP_RELOCATE_UBOOT" >> $(obj)include/config.h;    \
        fi
        @$(MKCONFIG) -n $@ -a mx31pdk arm arm1136 mx31pdk freescale mx31
  
@@@ -1190,6 -1176,96 +1190,6 @@@ NIOS2_GENERIC = nios2-generi
  $(NIOS2_GENERIC:%=%_config) : unconfig
        @$(MKCONFIG) $@ nios2 nios2 nios2-generic altera
  
 -#========================================================================
 -# Blackfin
 -#========================================================================
 -
 -bf527-ezkit-v2_config : unconfig
 -      @$(MKCONFIG) -t BF527_EZKIT_REV_2_1 \
 -              bf527-ezkit blackfin blackfin bf527-ezkit
 -
 -#========================================================================
 -# SH3 (SuperH)
 -#========================================================================
 -
 -#########################################################################
 -## sh2 (Renesas SuperH)
 -#########################################################################
 -rsk7203_config: unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_RSK7203 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh2 rsk7203 renesas
 -
 -#########################################################################
 -## sh3 (Renesas SuperH)
 -#########################################################################
 -
 -mpr2_config: unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_MPR2 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh3 mpr2
 -
 -ms7720se_config: unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_MS7720SE 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh3 ms7720se
 -
 -#########################################################################
 -## sh4 (Renesas SuperH)
 -#########################################################################
 -
 -MigoR_config :       unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_MIGO_R 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 MigoR renesas
 -
 -ms7750se_config: unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_MS7750SE 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 ms7750se
 -
 -ms7722se_config :     unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_MS7722SE 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 ms7722se
 -
 -r2dplus_config  :   unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_R2DPLUS 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 r2dplus renesas
 -
 -r7780mp_config: unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_R7780MP 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 r7780mp renesas
 -
 -sh7763rdp_config  :   unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_SH7763RDP 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 sh7763rdp renesas
 -
 -sh7785lcr_32bit_config \
 -sh7785lcr_config  :   unconfig
 -      @mkdir -p $(obj)include
 -      @mkdir -p $(obj)board/renesas/sh7785lcr
 -      @echo "#define CONFIG_SH7785LCR 1" > $(obj)include/config.h
 -      @if [ "$(findstring 32bit, $@)" ] ; then \
 -              echo "#define CONFIG_SH_32BIT 1" >> $(obj)include/config.h ; \
 -              echo "CONFIG_SYS_TEXT_BASE = 0x8ff80000" > \
 -                      $(obj)board/renesas/sh7785lcr/config.tmp ; \
 -      fi
 -      @$(MKCONFIG) -n $@ -a sh7785lcr sh sh4 sh7785lcr renesas
 -
 -ap325rxa_config  :   unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_AP325RXA 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 ap325rxa renesas
 -
 -espt_config  :   unconfig
 -      @mkdir -p $(obj)include
 -      @echo "#define CONFIG_ESPT 1" > $(obj)include/config.h
 -      @$(MKCONFIG) -a $@ sh sh4 espt
 -
  #########################################################################
  #########################################################################
  
@@@ -1220,7 -1296,6 +1220,7 @@@ clean
               $(obj)u-boot.lds                                           \
               $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]
        @rm -f $(obj)include/bmp_logo.h
 +      @rm -f $(obj)lib/asm-offsets.s
        @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
        @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
        @rm -f $(ONENAND_BIN)
@@@ -1244,7 -1319,6 +1244,7 @@@ clobber:        clea
        @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
        @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
        @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
 +      @rm -fr $(obj)include/generated
        @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
        @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
  
@@@ -81,6 -81,16 +81,16 @@@ int dram_init(void
                gd->ram_size += gd->bd->bi_dram[i].size;
  
        }
+       for (; i < CONFIG_NR_DRAM_BANKS; i++) {
+               /* If above loop terminated prematurely, we need to set
+                * remaining banks' start address & size as 0. Otherwise other
+                * u-boot functions and Linux kernel gets wrong values which
+                * could result in crash */
+               gd->bd->bi_dram[i].start = 0;
+               gd->bd->bi_dram[i].size = 0;
+       }
        return 0;
  }
  
@@@ -93,3 -103,4 +103,3 @@@ void dram_init_banksize(void
        dram_init();
  }
  #endif /* CONFIG_SYS_BOARD_DRAM_INIT */
 -
@@@ -143,7 -143,7 +143,7 @@@ int misc_init_r(void
        return 0;
  }
  
- int board_init(void)
+ int board_early_init_f(void)
  {
        u32 tmp;
  
        writel(tmp & (~FLASH_GPIO_PIN) , KW_GPIO0_BASE + 4);
        printf("KM: setting NAND mode\n");
  
-       /*
-        * arch number of board
-        */
-       gd->bd->bi_arch_number = MACH_TYPE_SUEN3;
-       /* address of boot parameters */
-       gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
  #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_ENV_WP, 38);
        kw_gpio_direction_output(SUEN3_ENV_WP, 1);
  #endif
+       return 0;
+ }
+ int board_init(void)
+ {
+       /*
+        * arch number of board
+        */
+       gd->bd->bi_arch_number = MACH_TYPE_SUEN3;
+       /* address of boot parameters */
+       gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
        return 0;
  }
  
@@@ -225,6 -231,20 +231,6 @@@ U_BOOT_CMD
        );
  #endif
  
 -#if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
 -int dram_init(void)
 -{
 -      int i;
 -
 -      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 = get_ram_size((long *)kw_sdram_bar(i),
 -                                                     kw_sdram_bs(i));
 -      }
 -
 -      return 0;
 -}
 -#else
  int dram_init(void)
  {
        /* dram_init must store complete ramsize in gd->ram_size */
@@@ -245,6 -265,7 +251,6 @@@ void dram_init_banksize(void
                                                       kw_sdram_bs(i));
        }
  }
 -#endif
  
  /* Configure and enable MV88E1118 PHY */
  void reset_phy(void)
diff --combined include/configs/km_arm.h
  #define CONFIG_KM_CONSOLE_TTY "ttyS0"
  
  /* size in bytes reserved for initial data */
 -#define CONFIG_SYS_GBL_DATA_SIZE      128
  
  /*
   * Other required minimal configurations
@@@ -181,6 -182,8 +181,8 @@@ int get_scl (void)
  
  /* additions for new relocation code, must be added to all boards */
  #define CONFIG_SYS_SDRAM_BASE         0x00000000
- #define CONFIG_SYS_INIT_SP_ADDR               (0x00000000 + 0x1000 - /* Fix this */ \
-                                       GENERATED_GBL_DATA_SIZE)
+ /* Kirkwood has 2k of Security SRAM, use it for SP */
+ #define CONFIG_SYS_INIT_SP_ADDR               0xC8012000
+ /* Do early setups now in board_init_f() */
+ #define CONFIG_BOARD_EARLY_INIT_F
  #endif /* _CONFIG_KM_ARM_H */
  #define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */
  #define CONFIG_KIRKWOOD_PCIE_INIT       /* Enable PCIE Port0 for kernel */
  
+ /* 
+  * By default kwbimage.cfg from board specific folder is used
+  * If for some board, different configuration file need to be used,
+  * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
+  */
+ #ifndef CONFIG_SYS_KWD_CONFIG
+ #define       CONFIG_SYS_KWD_CONFIG   $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg 
+ #endif /* CONFIG_SYS_KWD_CONFIG */
+ /* 
+  * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
+  */
+ #ifndef CONFIG_SYS_TEXT_BASE
+ #define       CONFIG_SYS_TEXT_BASE    0x00600000
+ #endif /* CONFIG_SYS_TEXT_BASE */
  #define CONFIG_I2C_MVTWSI_BASE        KW_TWSI_BASE
  #define MV_UART0_BASE         KW_UART0_BASE
  #define MV_SATA_BASE          KW_SATA_BASE
   */
  #define CONFIG_SYS_MALLOC_LEN (1024 * 1024) /* 1MiB for malloc() */
  /* size in bytes reserved for initial data */
 -#define CONFIG_SYS_GBL_DATA_SIZE      128
  
  /*
   * Other required minimal configurations
  #define CONFIG_CONSOLE_INFO_QUIET     /* some code reduction */
  #define CONFIG_ARCH_CPU_INIT  /* call arch_cpu_init() */
  #define CONFIG_ARCH_MISC_INIT /* call arch_misc_init() */
+ #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */ 
  #define CONFIG_DISPLAY_CPUINFO        /* Display cpu info */
  #define CONFIG_NR_DRAM_BANKS  4
  #define CONFIG_STACKSIZE      0x00100000      /* regular stack- 1M */