1. 04 Jul, 2010 1 commit
    • Wolfgang Denk's avatar
      Make sure that argv[] argument pointers are not modified. · 54841ab5
      Wolfgang Denk authored
      The hush shell dynamically allocates (and re-allocates) memory for the
      argument strings in the "char *argv[]" argument vector passed to
      commands.  Any code that modifies these pointers will cause serious
      corruption of the malloc data structures and crash U-Boot, so make
      sure the compiler can check that no such modifications are being done
      by changing the code into "char * const argv[]".
      
      This modification is the result of debugging a strange crash caused
      after adding a new command, which used the following argument
      processing code which has been working perfectly fine in all Unix
      systems since version 6 - but not so in U-Boot:
      
      int main (int argc, char **argv)
      {
      	while (--argc > 0 && **++argv == '-') {
      /* ====> */	while (*++*argv) {
      			switch (**argv) {
      			case 'd':
      				debug++;
      				break;
      			...
      			default:
      				usage ();
      			}
      		}
      	}
      	...
      }
      
      The line marked "====>" will corrupt the malloc data structures and
      usually cause U-Boot to crash when the next command gets executed by
      the shell.  With the modification, the compiler will prevent this with
      an
      	error: increment of read-only location '*argv'
      
      N.B.: The code above can be trivially rewritten like this:
      
      	while (--argc > 0 && **++argv == '-') {
      		char *arg = *argv;
      		while (*++arg) {
      			switch (*arg) {
      			...
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      54841ab5
  2. 01 Jul, 2010 5 commits
    • Stefan Roese's avatar
      ppc4xx: Cleanup Boot/FLASH TLB reassignment for PPC440/460 · 4978e605
      Stefan Roese authored
      Background Info:
      Some PPC440/460 boards have caches enabled in the Boot/FLASH TLB (via
      init.S) to speed up the boot process. In relocate_code (start.S) the
      cache inhibit attribute for this TLB is set to disable cache. This is
      needed for the CFI FLASH driver.
      
      This patch now cleans this code up:
      - CONFIG_SYS_TLB_FOR_BOOT_FLASH is defined to 0 (default TLB) if not
        defined in the top of this file. This way, we can remove an ugly
        #ifdef in this code.
      - Replace complex "#if defined(CONFIG_440EP) || defined(CONFIG_GR)..."
        statement with "#if defined(CONFIG_440)".
      - Remove unnecessary cache invalidate calls resulting in faster bootup.
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      4978e605
    • Stefan Roese's avatar
      ppc4xx: DDR2: Complete RDSS configuration on non-SPD based boards · e9c020df
      Stefan Roese authored
      As described in item #10 of the SDRAM initialization (chapter 22.2.9
      of the PPC460EX/EXr/GT users manual), RDSS may need to be adjusted. The
      code for this is now factored out and executed for non-SPD based boards
      as well.
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      e9c020df
    • Stefan Roese's avatar
      ppc4xx: Enable overwriting of default scan window for IBM DDR2 controller · 066003b2
      Stefan Roese authored
      This patch makes it possible to overwrite the default auto-calibration
      scan window (SDRAM_WRDTR.[WDTR], SDRAM_CLKTR.[CKTR] values) with
      board specific values. The parameters of the weak default function are
      corrected as well. This way we don't need the casts any more.
      
      This feature will be used by an upcoming PPC460GT board port.
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      066003b2
    • Stefan Roese's avatar
      ppc4xx: Enable PCIe support without PCI support on PPC440/460 · db643773
      Stefan Roese authored
      By not defining CONFIG_SYS_PCI_MASTER_INIT and CONFIG_SYS_PCI_TARGET_INIT,
      PCI support (host and adapter) will not be enabled. But it's still
      possible to use the U-Boot PCI infrastructure for the PCIe ports.
      
      This configuration option is needed for a new 460GT board, which uses
      PCIe but has PCI disabled.
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      db643773
    • Stefan Roese's avatar
      ppc4xx: Enable booting with Option E on 460EX/EXr/GT · fe7cca71
      Stefan Roese authored
      This patch enables booting with option E on the PPC460EX/EXr/GT.
      When booting with Option E, the PLL is in bypass, CPR0_PLLC[ENG]=0.
      The Software Boot Configuration Procedure is needed to engage the
      PLL and perform a chip reset.
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      fe7cca71
  3. 29 Jun, 2010 1 commit
  4. 23 Jun, 2010 3 commits
    • Wolfgang Denk's avatar
      Remove AmigaOneG3SE board · 953b7e62
      Wolfgang Denk authored
      The AmigaOneG3SE board has been orphaned or a very long time, and
      broken for more than 12 releases resp. more than 3 years.  As nobody
      seems to be interested any more in this stuff we may as well ged rid
      of it, especially as it clutters many areas of the code so it is a
      continuous pain for all kinds of ongoing work.
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      953b7e62
    • Wolfgang Denk's avatar
      Get rid of bogus CONFIG_SYS_BUS_HZ and CONFIG_SYS_CONFIG_BUS_CLK definitions · ee80fa7b
      Wolfgang Denk authored
      CONFIG_SYS_BUS_HZ has not really been used anywhere except to be
      redined as CONFIG_SYS_BUS_CLK; in addition, the mpc7448hpc2 had the
      bogus CONFIG_SYS_CONFIG_BUS_CLK setting which duplicated the
      funtionality.  Change all this to use CONFIG_SYS_BUS_CLK consistently.
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Cc: Frank Gottschling <fgottschling@eltec.de>
      Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
      Cc: Eran Man <eran@nbase.co.il>
      Cc: Stefan Roese <sr@denx.de>
      Cc: Nye Liu <nyet@zumanetworks.com>
      Cc: Roy Zang <tie-fei.zang@freescale.com>
      ee80fa7b
    • Wolfgang Denk's avatar
      MPC5200: workaround data corruption for unaligned local bus accesses · 460c2ce3
      Wolfgang Denk authored
      The MPC5200 has a nasty problem that will cause silent data corruption
      when performing unaligned 16 or 32 byte accesses when reading from the
      local bus - typically this affects reading from flash. The problem can
      be easily shown:
      
      => md fc0c0000 10
      fc0c0000: 323e4337 01626f6f 74636d64 3d72756e    2>C7.bootcmd=run
      fc0c0010: 206e6574 5f6e6673 00626f6f 7464656c     net_nfs.bootdel
      fc0c0020: 61793d35 00626175 64726174 653d3131    ay=5.baudrate=11
      fc0c0030: 35323030 00707265 626f6f74 3d656368    5200.preboot=ech
      => md fc0c0001 10
      fc0c0001: 65636801 00000074 0000003d 00000020    ech....t...=...
      fc0c0011: 0000005f 00000000 00000074 00000061    ..._.......t...a
      fc0c0021: 00000000 00000064 00000065 00000035    .......d...e...5
      fc0c0031: 00000000 00000062 0000003d 0000006f    .......b...=...o
      => md.w fc0c0001 10
      fc0c0001: 0000 3701 0000 6f74 0000 643d 0000 6e20    ..7...ot..d=..n
      fc0c0011: 0000 745f 0000 7300 0000 6f74 0000 6c61    ..t_..s...ot..la
      
      This commit implements a workaround at least for the most blatant
      problem: using memcpy() from NOR flash. We rename the assembler
      routine into __memcpy() and provide a wrapper, which will use a
      byte-wise copy loop for unaligned source or target addresses when
      reading from NOR flash, and branch to the optimized __memcpy()
      in all other cases, thus minimizing the performance impact.
      
      Tested on lite5200b and TQM5200S.
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      Cc: Detlev Zundel <dzu@denx.de>
      460c2ce3
  5. 14 Jun, 2010 1 commit
  6. 26 May, 2010 1 commit
  7. 21 May, 2010 2 commits
  8. 17 May, 2010 1 commit
    • Kim Phillips's avatar
      mpc83xx: fix NAND bootstrap too big error · a4bfc4cc
      Kim Phillips authored
      commit 167cdad1 "SERIAL: Enable
      port-mapped access" inadvertently broke 83xx nand boards by
      converting NS16550_init to use io accessors, which expanded
      the size of the generated code.
      
      this patch fixes the problem by removing icache functions from
      the nand builds, which somewhat follows commit
      1a2e203b "mpc83xx: turn on icache
      in core initialization to improve u-boot boot time"
      Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
      a4bfc4cc
  9. 12 May, 2010 4 commits
  10. 06 May, 2010 1 commit
    • Stefan Roese's avatar
      powerpc: Consolidate bootcount_{store|load} for PowerPC · e4a95d11
      Stefan Roese authored
      This patch consolidates bootcount_{store|load} for PowerPC by
      implementing a common version in arch/powerpc/lib/bootcount.c. This
      code is now used by all PowerPC variants that currently have these
      functions implemented.
      
      The functions now use the proper IO-accessor functions to read/write the
      values.
      
      This code also supports two different bootcount versions:
      
      a) Use 2 separate words (2 * 32bit) to store the bootcounter
      b) Use only 1 word (2 * 16bit) to store the bootcounter
      
      Version b) was already used by MPC5xxx.
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      Acked-by: default avatarDetlev Zundel <dzu@denx.de>
      Acked-by: default avatarKim Phillips <kim.phillips@freescale.com>
                for 83xx parts
      Cc: Michael Zaidman <michael.zaidman@gmail.com>
      Cc: Wolfgang Denk <wd@denx.de>
      Cc: Kim Phillips <kim.phillips@freescale.com>
      Cc: Anatolij Gustschin <agust@denx.de>
      e4a95d11
  11. 03 May, 2010 1 commit
  12. 27 Apr, 2010 7 commits
  13. 24 Apr, 2010 7 commits
  14. 22 Apr, 2010 2 commits
  15. 21 Apr, 2010 1 commit