Re: [U-Boot] [U-BOOT][PATCH] mmc: support the revision check for eMMC4.5

2012-09-01 Thread Marek Vasut
Dear Jae hoon Chung,

 Hi,
 
 Anybody think about this patch?
 mmcinfo is produce correctly?
 
 if i miss something, let me know, plz.

Andy?

 Best Regards,
 Jaehoon Chung
 
 2012/3/27 Jaehoon Chung jh80.ch...@samsung.com:
  eMMC card is introduced the eMMC4.5.
  But now eMMC card is checked up to eMMC4.0.
  This patch is supported until eMMC4.5
  
  Signed-off-by: Jaehoon Chung jh80.ch...@samsung.com
  Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
  ---
   common/cmd_mmc.c  |5 -
   drivers/mmc/mmc.c |   25 +
   include/mmc.h |8 
   3 files changed, 37 insertions(+), 1 deletions(-)
  
  diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
  index 8f13c22..ff150ca 100644
  --- a/common/cmd_mmc.c
  +++ b/common/cmd_mmc.c
  @@ -106,7 +106,10 @@ static void print_mmcinfo(struct mmc *mmc)
 printf(Rd Block Len: %d\n, mmc-read_bl_len);
  
 printf(%s version %d.%d\n, IS_SD(mmc) ? SD : MMC,
  -   (mmc-version  4)  0xf, mmc-version  0xf);
  +   (mmc-version  4)  0xf,
  +   (mmc-version  0xf) == EXT_CSD_REV_1_5 ?
  +   41 :((mmc-version  0xf)  EXT_CSD_REV_1_5 ?
  +   (mmc-version  0xf) - 1 : (mmc-version 
  0xf)));
  
 printf(High Capacity: %s\n, mmc-high_capacity ? Yes : No);
 puts(Capacity: );
  diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
  index 49c3349..e035012 100644
  --- a/drivers/mmc/mmc.c
  +++ b/drivers/mmc/mmc.c
  @@ -651,6 +651,31 @@ int mmc_change_freq(struct mmc *mmc)
 if (err)
 return err;
  
  +   switch (ext_csd[EXT_CSD_REV]) {
  +   case EXT_CSD_REV_1_0:
  +   mmc-version |= EXT_CSD_REV_1_0;
  +   break;
  +   case EXT_CSD_REV_1_1:
  +   mmc-version |= EXT_CSD_REV_1_1;
  +   break;
  +   case EXT_CSD_REV_1_2:
  +   mmc-version |= EXT_CSD_REV_1_2;
  +   break;
  +   case EXT_CSD_REV_1_3:
  +   mmc-version |= EXT_CSD_REV_1_3;
  +   break;
  +   case EXT_CSD_REV_1_5:
  +   mmc-version |= EXT_CSD_REV_1_5;
  +   break;
  +   case EXT_CSD_REV_1_6:
  +   mmc-version |= EXT_CSD_REV_1_6;
  +   break;
  +   case EXT_CSD_REV_1_4:
  +   default:
  +   printf(Unknown revision - %x\n, ext_csd[EXT_CSD_REV]);
  +   return 0;
  +   }
  +
 /* No high-speed support */
 if (!ext_csd[EXT_CSD_HS_TIMING])
 return 0;
  diff --git a/include/mmc.h b/include/mmc.h
  index 30c2375..726da99 100644
  --- a/include/mmc.h
  +++ b/include/mmc.h
  @@ -157,6 +157,14 @@
   #define EXT_CSD_SEC_CNT212 /* RO, 4 bytes */
   #define EXT_CSD_HC_ERASE_GRP_SIZE  224 /* RO */
  
  +#define EXT_CSD_REV_1_00
  +#define EXT_CSD_REV_1_11
  +#define EXT_CSD_REV_1_22
  +#define EXT_CSD_REV_1_33
  +#define EXT_CSD_REV_1_44
  +#define EXT_CSD_REV_1_55
  +#define EXT_CSD_REV_1_66
  +
   /*
   * EXT_CSD field definitions
   */
  --
  1.7.4.1
  ___
  U-Boot mailing list
  U-Boot@lists.denx.de
  http://lists.denx.de/mailman/listinfo/u-boot
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] pull request for u-boot-tegra/master

2012-09-01 Thread Albert ARIBAUD
Hi Tom,

On Fri, 31 Aug 2012 14:28:57 -0700, Tom Warren
twarren.nvi...@gmail.com wrote:

 Albert,
 
 Please pull u-boot-tegra/master into arm/master. Hopefully this is the
 final request for Allen's SPL patchset. Thanks!
 
 The following changes since commit
 092592c3b79aa3974ea12ae4f408db7679e6a109: Stephen Warren (1):
 ARM: add Raspberry Pi model B board, using BCM2835 SoC
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-tegra master
 
 Allen Martin (16):
   tegra20: rename tegra2 - tegra20
   tegra20: move tegra20 SoC code to arch/arm/cpu/tegra20-common
   tegra20: rename CONFIG_MACH_TEGRA_GENERIC
   tegra20: tec: add tegra20-common-post.h
   tegra20: make board mkdir commands unconditional
   mkconfig: remove bashisms and cleanup config.mk generation
   MAKEALL: update to work with new boards.cfg syntax
   ARM: Fix arm720t SPL build
   tegra20: remove timer_init from SPL build
   ARM: add tegra20 support to arm720t
   tegra20: add u-boot-*-tegra.bin targets
   tegra20: move SDRAM param save to later in boot
   tegra20: enable SPL for tegra20 boards
   arm: enable libgcc build for SPL
   spl: fix SPL build of private libgcc
   tegra20: Remove armv4t build flags
 
  MAINTAINERS|   18 ++--
  MAKEALL|9 +-
  Makefile   |   26 
  arch/arm/cpu/arm720t/cpu.c |2 +
  arch/arm/cpu/arm720t/interrupts.c  |5 +
  arch/arm/cpu/arm720t/start.S   |   25 +++-
  .../cpu/{armv7/tegra2 = arm720t/tegra20}/Makefile |   28 +---
  .../arch-tegra2 = cpu/arm720t/tegra20}/board.h|   11 +-
  .../{armv7/tegra2 = arm720t/tegra20}/config.mk|   12 --
  .../{armv7/tegra2/ap20.c = arm720t/tegra20/cpu.c} |  148
 ++-- .../ap20.h =
 cpu/arm720t/tegra20/cpu.h}   |   15 +--
 arch/arm/cpu/arm720t/tegra20/spl.c |  133
 ++ arch/arm/cpu/armv7/Makefile
 |2 +- arch/arm/cpu/armv7/start.S |6
 +- arch/arm/cpu/armv7/{tegra2 = tegra20}/Makefile|   15
 +-- .../cpu/armv7/{tegra2 = tegra20}/cmd_enterrcm.c   |4 +-
 arch/arm/cpu/armv7/{tegra2 = tegra20}/config.mk   |   12 --
 arch/arm/cpu/armv7/{tegra2 = tegra20}/usb.c   |2
 +- .../cpu/{armv7/tegra2 = tegra20-common}/Makefile  |   29 ++---
 arch/arm/cpu/tegra20-common/ap20.c |  131
 + .../cpu/{armv7/tegra2 = tegra20-common}/board.c
 |   39 ++ .../cpu/{armv7/tegra2 = tegra20-common}/clock.c   |
 10 +- .../cpu/{armv7/tegra2 = tegra20-common}/crypto.c  |
 0 .../cpu/{armv7/tegra2 = tegra20-common}/crypto.h  |
 0 .../arm/cpu/{armv7/tegra2 = tegra20-common}/emc.c |2
 +- .../cpu/{armv7/tegra2 = tegra20-common}/funcmux.c |2
 +- .../tegra2 = tegra20-common}/lowlevel_init.S  |
 0 .../cpu/{armv7/tegra2 = tegra20-common}/pinmux.c  |4
 +- .../arm/cpu/{armv7/tegra2 = tegra20-common}/pmu.c |2
 +- .../{armv7/tegra2 = tegra20-common}/sys_info.c|2
 +- .../cpu/{armv7/tegra2 = tegra20-common}/timer.c   |2
 +- .../{armv7/tegra2 = tegra20-common}/warmboot.c|   18
 ++-- .../tegra2 = tegra20-common}/warmboot_avp.c   |4
 +- .../tegra2 = tegra20-common}/warmboot_avp.h   |
 0 .../asm/{arch-tegra2 = arch-tegra20}/ap20.h   |4
 +- .../asm/{arch-tegra2 = arch-tegra20}/apb_misc.h   |
 0 .../asm/{arch-tegra2 = arch-tegra20}/board.h  |
 0 .../asm/{arch-tegra2 = arch-tegra20}/clk_rst.h|
 0 .../asm/{arch-tegra2 = arch-tegra20}/clock.h  |
 0 .../asm/{arch-tegra2 = arch-tegra20}/emc.h|
 0 .../asm/{arch-tegra2 = arch-tegra20}/flow.h   |
 0 .../asm/{arch-tegra2 = arch-tegra20}/funcmux.h|2
 +- .../asm/{arch-tegra2 = arch-tegra20}/fuse.h   |
 0 .../asm/{arch-tegra2 = arch-tegra20}/gp_padctrl.h |2
 +- .../asm/{arch-tegra2 = arch-tegra20}/gpio.h   |2 +-
 arch/arm/include/asm/arch-tegra20/hardware.h   |   29
  .../asm/{arch-tegra2 = arch-tegra20}/mmc.h|8
 +- .../asm/{arch-tegra2 = arch-tegra20}/pinmux.h |
 0 .../asm/{arch-tegra2 = arch-tegra20}/pmc.h|
 0 .../asm/{arch-tegra2 = arch-tegra20}/pmu.h|
 0 .../asm/{arch-tegra2 = arch-tegra20}/scu.h|
 0 .../{arch-tegra2 = arch-tegra20}/sdram_param.h|
 0 .../asm/{arch-tegra2 = arch-tegra20}/sys_proto.h  |4
 +- .../tegra2.h = arch-tegra20/tegra20.h}|   18
 ++-- .../asm/{arch-tegra2 = arch-tegra20}/tegra_i2c.h  |2
 +- .../asm/{arch-tegra2 = arch-tegra20}/tegra_spi.h  |4
 +- .../asm/{arch-tegra2 = arch-tegra20}/timer.h  |6
 +- .../uart-spi-switch.h  |
 0 .../asm/{arch-tegra2 = arch-tegra20}/uart.h   |
 0 .../asm/{arch-tegra2 = arch-tegra20}/usb.h|
 0 .../asm/{arch-tegra2 = arch-tegra20}/warmboot.h   |0
 arch/arm/lib/Makefile  

Re: [U-Boot] [PATCH] MX28: SPI: Fix CTRL0 not being written at end of DMA transfer

2012-09-01 Thread Stefano Babic
On 01/09/2012 03:31, Marek Vasut wrote:
 The final DMA descriptor doesn't properly write CTRL0 register
 during the DMA transfer. Properly write CTRL0 to make sure the
 transmission is complete.

 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Fabio Estevam feste...@gmail.com
 Cc: Otavio Salvador ota...@ossystems.com.br
 Cc: Stefano Babic sba...@denx.de
 
 !!
 
 Please discard
 

Done !

Stefano


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: do explicit unaligned accesses

2012-09-01 Thread Albert ARIBAUD
Hi Marek,

(Apologies for the private mail)

On Sat, 1 Sep 2012 00:16:43 +0200, Marek Vasut ma...@denx.de wrote:

 Dear Albert ARIBAUD,

  I think you are talking about lumping small-sized accesses together
  into a bigger access possibly aligned.
 
 This is exactly what I mean.
 
  If I am correct, then I don't
  think this is related to misaligned accesses.
 
 Why won't it be? Such access can in the end turn out to be aligned,
 therefore leveraging all the penalty.

I have not expressed myself clearly. Yes, access lumping is related to
access alignment. What I meant is: disallowing misaligned native
accesses will not prevent access lumping. Misalignment restrictions do
indeed restrict how such lumpings will happen, but it does not prevent
lumping per se.

One place where lumping and misalignement prevention did clash was
raised in the previous discussion: a 7+1 bytes function-local char array
was allocated on a non-aligned address (which is possible and normal
because it is a char) and was initialized with some content. The
compiler lumped the initialization as two misaligned 32-byte native
accesses, despite misaligned native accesses being forbidden by
compiler command line options. This was a compiler bug.
 
  If I am not correct, can
  you please detail what you meant?
  
   Besides, right now, the code is much more readable. So I really
   don't like adding some strange macros to force crazy aligned
   access if the compiler can do it for us and can do it better.
  
  I personally would let the compiler do it too, but I prefer it to be
  clearly indicated to the reader of the code when an access is
  known to be misaligned.
 
 I'd enable enable the Alignment trapping in the CPU and die on an
 unaligned access at runtime -- to indicate the user that he should
 fix his bloody compiler.

... or fix his bloody structure, or fix his bloody f...ixing pointer
arithmetic, or... but I do agree with the trapping, and that's my plan.

However other architectures may need, or choose, another stance on
alignments, and it is best if they don't have to discover intended
misaligned accesses the hard way. Thus my opinion that any misaligned
access which cannot be fixed should not be sliently left for the
compiler to handle, but should (also) be clearly marked as such, if only
for humans to notice.

 Best regards,
 Marek Vasut

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] mxc: Define architecture identifier

2012-09-01 Thread Stefano Babic
On 13/08/2012 19:27, Benoît Thébaudeau wrote:
 Define ARCH_MXC for i.MX devices. This is useful to identify features or
 behaviors common to all i.MX SoCs.
 
 The i.MX28 is omitted because its architecture is a bit different (like 
 imx/mxc
 vs. mxs in Linux).
 
 Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
 Cc: Stefano Babic sba...@denx.de
 Cc: Andy Fleming aflem...@gmail.com
 Cc: Kim Phillips kim.phill...@freescale.com
 ---

Hi Benoît,

I checked again this patch and I already set this patch in patchwork as
merged (=awaiting upstream), but I could not find it in u-boot-imx.
Something went wrong..

I have applied it now to u-boot-imx.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-staging/tr...@ti.com

2012-09-01 Thread Albert ARIBAUD
Hi Tom,

On Fri, 31 Aug 2012 16:27:18 -0700, Tom Rini tr...@ti.com wrote:

 Hello,
 
 The following changes since commit
 092592c3b79aa3974ea12ae4f408db7679e6a109:
 
   ARM: add Raspberry Pi model B board, using BCM2835 SoC (2012-08-30
 08:50:50 +0200)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-staging tr...@ti.com
 
 for you to fetch changes up to
 a2d4138ccbe6c38ac0db21ac900f05fadfdf0f02:
 
   ARM: Remove unused stack and irq config defines (2012-08-31
 15:44:13 -0700)
 
 
 Rob Herring (1):
   ARM: Remove unused stack and irq config defines
 
 Tetsuyuki Kobayashi (1):
   arm: bugfix: save_boot_params_default accesses uninitalized
 stack when -O0
 
  arch/arm/cpu/armv7/cpu.c   |7 ---
  arch/arm/cpu/armv7/start.S |   14 ++
  include/configs/SX1.h  |   13 -
  include/configs/VCMA9.h|   12 
  include/configs/a320evb.h  |   13 -
  include/configs/actux1.h   |6 --
  include/configs/actux2.h   |6 --
  include/configs/actux3.h   |7 ---
  include/configs/actux4.h   |6 --
  include/configs/adp-ag101.h|7 ---
  include/configs/adp-ag101p.h   |7 ---
  include/configs/adp-ag102.h|7 ---
  include/configs/afeb9260.h |5 -
  include/configs/am335x_evm.h   |3 ---
  include/configs/am3517_crane.h |8 
  include/configs/am3517_evm.h   |8 
  include/configs/apollon.h  |8 
  include/configs/at91rm9200ek.h |3 ---
  include/configs/at91sam9260ek.h|7 ---
  include/configs/at91sam9261ek.h|7 ---
  include/configs/at91sam9263ek.h|5 -
  include/configs/at91sam9m10g45ek.h |7 ---
  include/configs/at91sam9rlek.h |5 -
  include/configs/balloon3.h |9 -
  include/configs/ca9x4_ct_vxp.h |7 ---
  include/configs/calimain.h |1 -
  include/configs/cam_enc_4xx.h  |2 --
  include/configs/cm4008.h   |   13 -
  include/configs/cm41xx.h   |   13 -
  include/configs/cm_t35.h   |8 
  include/configs/colibri_pxa270.h   |   11 ---
  include/configs/cpu9260.h  |7 ---
  include/configs/cpuat91.h  |   10 --
  include/configs/da830evm.h |2 --
  include/configs/da850evm.h |1 -
  include/configs/davinci_dm355evm.h |2 --
  include/configs/davinci_dm355leopard.h |2 --
  include/configs/davinci_dm365evm.h |2 --
  include/configs/davinci_dm6467evm.h|2 --
  include/configs/davinci_dvevm.h|2 --
  include/configs/davinci_schmoogie.h|2 --
  include/configs/davinci_sffsdr.h   |2 --
  include/configs/davinci_sonata.h   |2 --
  include/configs/devkit3250.h   |1 -
  include/configs/devkit8000.h   |4 
  include/configs/dig297.h   |   12 
  include/configs/dvlhost.h  |7 ---
  include/configs/ea20.h |1 -
  include/configs/eb_cpux9k2.h   |2 --
  include/configs/edminiv2.h |1 -
  include/configs/efikamx.h  |7 ---
  include/configs/enbw_cmc.h |1 -
  include/configs/ethernut5.h|5 ++---
  include/configs/flea3.h|8 
  include/configs/hawkboard.h|1 -
  include/configs/highbank.h |   11 ---
  include/configs/igep00x0.h |7 ---
  include/configs/ima3-mx53.h|3 ---
  include/configs/imx27lite-common.h |1 -
  include/configs/imx31_litekit.h|7 ---
  include/configs/imx31_phycore.h|7 ---
  include/configs/integratorap.h |   11 ---
  include/configs/integratorcp.h |   11 ---
  include/configs/jadecpu.h  |7 ---
  include/configs/jornada.h  |7 ---
  include/configs/km/km_arm.h|1 -
  include/configs/lubbock.h  |   12 
  include/configs/m28evk.h   |1 -
  include/configs/mcx.h  |7 ---
  include/configs/meesc.h|7 ---
  include/configs/mv-common.h|1 -
  include/configs/mx1ads.h   |   12 
  include/configs/mx25pdk.h  |3 ---
  include/configs/mx28evk.h  |1 -
  include/configs/mx31ads.h  |7 ---
  include/configs/mx31pdk.h  |7 ---
  include/configs/mx35pdk.h  |8 
  

Re: [U-Boot] [PATCH V2 1/1] mx31/mx35/mx51/mx53/mx6: add watchdog

2012-09-01 Thread Stefano Babic
On 23/08/2012 11:19, Stefano Babic wrote:

Hi Troy,

 We have discussed recently how we can put common code across CPU
 boundaries. I mean, code generic for all i.MXs (as in this case) that is
 then replicated under cpu/arm1136, cpu/arm926ejs,...
 

It seems we are now blocked without exactly know what to do...I am
making a proposal to move shared files in a common place. I will send a
patch for it in some minutes. If we agree, it could be a place where you
can put the reset code.

Regards,
Stefano


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v1] MX: set a common place to share code for Freescale i.MX

2012-09-01 Thread Stefano Babic
Up now only MX5 and MX6 can share code, because they have
a common source directory in cpu/armv7. Other not armv7
i.MX can profit of the same shared code. Move these files
into a directory accessible for all, similar to plat-mxc
in linux.

Signed-off-by: Stefano Babic sba...@denx.de
---
 Makefile|4 ++--
 arch/arm/{cpu/armv7 = }/imx-common/Makefile|2 ++
 arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c |0
 arch/arm/{cpu/armv7 = }/imx-common/cpu.c   |0
 arch/arm/{cpu/armv7 = }/imx-common/i2c.c   |0
 arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c  |0
 arch/arm/{cpu/armv7 = }/imx-common/speed.c |0
 arch/arm/{cpu/armv7 = }/imx-common/timer.c |0
 8 files changed, 4 insertions(+), 2 deletions(-)
 rename arch/arm/{cpu/armv7 = }/imx-common/Makefile (97%)
 rename arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c (100%)
 rename arch/arm/{cpu/armv7 = }/imx-common/cpu.c (100%)
 rename arch/arm/{cpu/armv7 = }/imx-common/i2c.c (100%)
 rename arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c (100%)
 rename arch/arm/{cpu/armv7 = }/imx-common/speed.c (100%)
 rename arch/arm/{cpu/armv7 = }/imx-common/timer.c (100%)

diff --git a/Makefile b/Makefile
index d27bb17..10af1d3 100644
--- a/Makefile
+++ b/Makefile
@@ -306,10 +306,10 @@ LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
 endif
 
 ifeq ($(SOC),mx5)
-LIBS-y += $(CPUDIR)/imx-common/libimx-common.o
+LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
 ifeq ($(SOC),mx6)
-LIBS-y += $(CPUDIR)/imx-common/libimx-common.o
+LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
 
 ifeq ($(SOC),s5pc1xx)
diff --git a/arch/arm/cpu/armv7/imx-common/Makefile 
b/arch/arm/imx-common/Makefile
similarity index 97%
rename from arch/arm/cpu/armv7/imx-common/Makefile
rename to arch/arm/imx-common/Makefile
index 16fba8d..d5dc6c0 100644
--- a/arch/arm/cpu/armv7/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -27,7 +27,9 @@ include $(TOPDIR)/config.mk
 
 LIB = $(obj)libimx-common.o
 
+ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
 COBJS-y= iomux-v3.o timer.o cpu.o speed.o
+endif
 COBJS-$(CONFIG_I2C_MXC) += i2c.o
 COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o
 COBJS  := $(sort $(COBJS-y))
diff --git a/arch/arm/cpu/armv7/imx-common/cmd_bmode.c 
b/arch/arm/imx-common/cmd_bmode.c
similarity index 100%
rename from arch/arm/cpu/armv7/imx-common/cmd_bmode.c
rename to arch/arm/imx-common/cmd_bmode.c
diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
similarity index 100%
rename from arch/arm/cpu/armv7/imx-common/cpu.c
rename to arch/arm/imx-common/cpu.c
diff --git a/arch/arm/cpu/armv7/imx-common/i2c.c b/arch/arm/imx-common/i2c.c
similarity index 100%
rename from arch/arm/cpu/armv7/imx-common/i2c.c
rename to arch/arm/imx-common/i2c.c
diff --git a/arch/arm/cpu/armv7/imx-common/iomux-v3.c 
b/arch/arm/imx-common/iomux-v3.c
similarity index 100%
rename from arch/arm/cpu/armv7/imx-common/iomux-v3.c
rename to arch/arm/imx-common/iomux-v3.c
diff --git a/arch/arm/cpu/armv7/imx-common/speed.c b/arch/arm/imx-common/speed.c
similarity index 100%
rename from arch/arm/cpu/armv7/imx-common/speed.c
rename to arch/arm/imx-common/speed.c
diff --git a/arch/arm/cpu/armv7/imx-common/timer.c b/arch/arm/imx-common/timer.c
similarity index 100%
rename from arch/arm/cpu/armv7/imx-common/timer.c
rename to arch/arm/imx-common/timer.c
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] mx35: Fix decode_pll

2012-09-01 Thread Stefano Babic
On 14/08/2012 22:32, Benoît Thébaudeau wrote:
 The MFN bit-field of the PLL registers represents a signed value. See the
 reference manual.
 
 Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
 Cc: Stefano Babic sba...@denx.de
 ---

Hi Benoît,

  .../arch/arm/cpu/arm1136/mx35/generic.c|9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)
 
 diff --git u-boot-4d3c95f.orig/arch/arm/cpu/arm1136/mx35/generic.c 
 u-boot-4d3c95f/arch/arm/cpu/arm1136/mx35/generic.c
 index dba4903..e369c86 100644
 --- u-boot-4d3c95f.orig/arch/arm/cpu/arm1136/mx35/generic.c
 +++ u-boot-4d3c95f/arch/arm/cpu/arm1136/mx35/generic.c
 @@ -24,6 +24,7 @@
   */
  
  #include common.h
 +#include div64.h
  #include asm/io.h
  #include asm/errno.h
  #include asm/arch/imx-regs.h
 @@ -126,15 +127,17 @@ static int get_ahb_div(u32 pdr0)
  static u32 decode_pll(u32 reg, u32 infreq)
  {
   u32 mfi = (reg  10)  0xf;
 - u32 mfn = reg  0x3f;
 - u32 mfd = (reg  16)  0x3f;
 + s32 mfn = reg  0x3ff;
 + u32 mfd = (reg  16)  0x3ff;

The MFN is a signed value. But you are masking now 11 bits. According to
the manual, bit 9-0 are MFN. You are taking in the mask the first bit of
MFI, and this is wrong, isn't it ?

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Commit 94e8652a664f01cffb1f0abb0b114261c03a234d breaks tnetv107x_evm?

2012-09-01 Thread Albert ARIBAUD
Tom, Stephen,

I am surprised because I keep copy-pastes of my builds, and this one
does not appear in recent copy-pastes, so even though I double-checked
on my local u-boot-arm repository, I need confirmation from someone
else.

In u-boot-arm, commit 94e8652a664f01cffb1f0abb0b114261c03a234d breaks
tnetv107x_evm:

Configuring for tnetv107x_evm board...
arm-linux-gnueabi-size: './build/tnetv107x_evm/u-boot': No such file
arch/arm/cpu/arm1176/tnetv107x/libtnetv107x.o: In function
`arch_cpu_init': 
/home/albert/src/u-boot-arm/arch/arm/cpu/arm1176/tnetv107x/init.c:32:
multiple definition of `arch_cpu_init'
arch/arm/cpu/arm1176/libarm1176.o:/home/albert/src/u-boot-arm/arch/arm/cpu/arm1176/cpu.c:70:
first defined here make: ***
[/home/albert/src/u-boot-arm/build/tnetv107x_evm/u-boot] Error 1

Parent 94d9bfe70d5b93af8005c52314a9388306053faf builds tnetv107x_evm
fine.

Tom (as the commit originates from staging/tr...@ti.com) or Stephen
(as the author of the commit), can you please confirm the issue?

If the issue is confirmed:

Stephen, can you look into a fix and submit a patch for this?

Apologies for not noticing this earlier.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/7] mx35: Fix clock dividers

2012-09-01 Thread Stefano Babic
On 14/08/2012 22:33, Benoît Thébaudeau wrote:
 The clock dividers that were used do not match at all the reference manual. 
 They
 were either completely broken, or came from an early silicon revision
 incompatible with the current one.
 
 Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
 Cc: Stefano Babic sba...@denx.de
 ---
  .../arch/arm/cpu/arm1136/mx35/generic.c|   48 
 
  .../arch/arm/include/asm/arch-mx35/crm_regs.h  |   42 ++---
  2 files changed, 31 insertions(+), 59 deletions(-)
 
 diff --git u-boot-4d3c95f.orig/arch/arm/cpu/arm1136/mx35/generic.c 
 u-boot-4d3c95f/arch/arm/cpu/arm1136/mx35/generic.c
 index e369c86..4af052c 100644
 --- u-boot-4d3c95f.orig/arch/arm/cpu/arm1136/mx35/generic.c
 +++ u-boot-4d3c95f/arch/arm/cpu/arm1136/mx35/generic.c
 @@ -171,17 +171,14 @@ static u32 get_ipg_per_clk(void)
   u32 pdr4 = readl(ccm-pdr4);
   u32 div;
   if (pdr0  MXC_CCM_PDR0_PER_SEL) {
 - div = (CCM_GET_DIVIDER(pdr4,
 - MXC_CCM_PDR4_PER0_PRDF_MASK,
 - MXC_CCM_PDR4_PER0_PODF_OFFSET) + 1) *
 - (CCM_GET_DIVIDER(pdr4,

It seems also to me that the current code is wrong if
MXC_CCM_PDR0_PER_SEL is set. Maybe it was never set. As I see in figure
5-4, the ipg_per_clk depends only on pdr[21:16]. No idea where the
second multiplier comes.

 + div = CCM_GET_DIVIDER(pdr4,
   MXC_CCM_PDR4_PER0_PODF_MASK,
 - MXC_CCM_PDR4_PER0_PODF_OFFSET) + 1);
 + MXC_CCM_PDR4_PER0_PODF_OFFSET) + 1;

The name remains quite confusing. In the manual is PER0_DIV, which is
the meaning of PODF here ?

Anyway, the masks you set are correct, I agree.

   } else {
   div = CCM_GET_DIVIDER(pdr0,
   MXC_CCM_PDR0_PER_PODF_MASK,
   MXC_CCM_PDR0_PER_PODF_OFFSET) + 1;
 - freq /= get_ahb_div(pdr0);
 + div *= get_ahb_div(pdr0);

This does not change the behavior.

   }
   return freq / div;
  }
 @@ -199,19 +196,16 @@ u32 imx_get_uartclk(void)
   freq = decode_pll(readl(ccm-ppctl),
   CONFIG_MX35_HCLK_FREQ);
   }
 - freq /= ((CCM_GET_DIVIDER(pdr4,
 - MXC_CCM_PDR4_UART_PRDF_MASK,
 - MXC_CCM_PDR4_UART_PRDF_OFFSET) + 1) *
 - (CCM_GET_DIVIDER(pdr4,
 + freq /= CCM_GET_DIVIDER(pdr4,
   MXC_CCM_PDR4_UART_PODF_MASK,
 - MXC_CCM_PDR4_UART_PODF_OFFSET) + 1));
 + MXC_CCM_PDR4_UART_PODF_OFFSET) + 1;

This is also right. I am only asking myself why it works correctly now.


   return freq;
  }
  
  unsigned int mxc_get_main_clock(enum mxc_main_clock clk)
  {
   u32 nfc_pdf, hsp_podf;
 - u32 pll, ret_val = 0, usb_prdf, usb_podf;
 + u32 pll, ret_val = 0, usb_podf;
   struct ccm_regs *ccm =
   (struct ccm_regs *)IMX_CCM_BASE;
  
 @@ -255,8 +249,7 @@ unsigned int mxc_get_main_clock(enum mxc_main_clock clk)
   ret_val = pll / (nfc_pdf + 1);
   break;
   case USB_CLK:
 - usb_prdf = (reg4  25)  0x7;
 - usb_podf = (reg4  22)  0x7;
 + usb_podf = (reg4  22)  0x3F;

Agree again. The code seems generated from another manual. Maybe the
USB_DIV field was split into two fields. With this in mind, there is no
apparent error in current code, but it cannot be derived from the manual.

   break;
   default:
   printf(Unknown clock: %d\n, clk);
 @@ -287,11 +280,10 @@ unsigned int mxc_get_peri_clock(enum mxc_peri_clock clk)
   case UART2_BAUD:
   case UART3_BAUD:
   clk_sel = mpdr3  (1  14);
 - pre_pdf = (mpdr4  13)  0x7;
 - pdf = (mpdr4  10)  0x7;
 + pdf = (mpdr4  10)  0x3F;

Right !


The main issue about this patch is that it does not fix one problem, but
a lot of. Really it should be split into several patches. Anyway, I will
make some tests on the mx35 boards I have - if I will not get problems,
I will push it, hoping that someone else can make some further tests.

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] dlmalloc: remove manual reloc alias warning

2012-09-01 Thread Wolfgang Denk
Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message 1344848523-20359-1-git-send-email-andreas.de...@googlemail.com you 
wrote:
 
 This patch fixes following warning:
 ---8---
 dlmalloc.c: In function 'malloc_bin_reloc':
 dlmalloc.c:1493: warning: dereferencing pointer 'p' does break 
 strict-aliasing rules
 dlmalloc.c:1493: warning: dereferencing pointer 'p' does break 
 strict-aliasing rules
 dlmalloc.c:1490: note: initialized from here
 dlmalloc.c:1493: note: initialized from here
...
 +typedef unsigned long __attribute__((__may_alias__)) ulong_aliased;
  void malloc_bin_reloc (void)
  {
 - unsigned long *p = (unsigned long *)(av_[2]);
 + ulong_aliased *p = (ulong_aliased *)(av_[2]);

I dislike this typedef, especially as it's used only a single time.
But even so - why cannot we avoid the __may_alias__ thing alltogether?

You wrote in http://article.gmane.org/gmane.comp.boot-loaders.u-boot/137770
that Simon's patch breaks avr32 boards at runtime.

The implementation is indeed broken.  I wonder if it ever worked:

mbinptr *p = av_[2];
int i;

for (i = 2; i  ARRAY_SIZE(av_); ++i)
*p = (mbinptr)((ulong)*p + gd-reloc_off);

i. e. this has the offset 2 added twice, so it is missing the first
two real entries, env writing beyond the end of the array.

Can you please test this code instead:

mbinptr *p = av_;
int i;

for (i = 2; i  ARRAY_SIZE(av_); ++i)
*p = (mbinptr)((ulong)*p + gd-reloc_off);


?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Don't try to outweird me, three-eyes. I get stranger things than you
free with my breakfast cereal.
   - Zaphod Beeblebrox in  Hitchhiker's Guide to the Galaxy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] please pull u-boot-avr32/master

2012-09-01 Thread Wolfgang Denk
Dear Andreas,

In message 502d2ad3.3030...@gmail.com you wrote:
 
 So
 a) this pull request is outdated
 b) I need to rebase uu-boot-avr32/master on u-boot/master after
 u-boot-arm/master gets merged

OK, I ignored this, and wait for a new pull req.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
This all sounds complicated, but it mostly does excatly what you  ex-
pect. It's just difficult for us to explain what you expect...
   - L. Wall  R. L. Schwartz, _Programming Perl_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request u-boot-blackfin.git (sf branch)

2012-09-01 Thread Wolfgang Denk
Dear Mike Frysinger,

In message 1344959244-5077-1-git-send-email-vap...@gentoo.org you wrote:
 The following changes since commit 4d3c95f5ea7c737a21cd6b9c59435ee693b3f127:
 
   zfs: Add ZFS filesystem support (2012-08-09 23:42:20 +0200)
 
 are available in the git repository at:
 
   git://www.denx.de/git/u-boot-blackfin.git sf
 
 for you to fetch changes up to 4a4cb4e11149158c9eabb1537a1eaee7372ce491:
 
   sf: spansion: Add support for S25FL256S (2012-08-14 11:45:50 -0400)
 
 
 Marek Vasut (1):
   cmd_spi: remove superfluous semicolon
 
 Michal Simek (2):
   sf: stmicro: add support for N25Q128A
   sf: spansion: Add support for S25FL256S
 
 Rajeshwari Shinde (1):
   sf: winbond: add W25Q32
 
 Stephan Linz (2):
   sf: stmicro: support JEDEC standard two-byte signature
   sf: stmicro: add support N25Q128 parts
 
 Stephen Warren (1):
   sf: winbond: fix page_size
 
  common/cmd_spi.c   |2 +-
  drivers/mtd/spi/spansion.c |7 +++
  drivers/mtd/spi/stmicro.c  |   39 +++
  drivers/mtd/spi/winbond.c  |7 ++-
  4 files changed, 41 insertions(+), 14 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If you're not part of the solution, you're part of the problem.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] please pull u-boot-samsung master

2012-09-01 Thread Albert ARIBAUD
Hi Minkyu,

On Mon, 27 Aug 2012 13:24:11 +0900, Minkyu Kang proms...@gmail.com
wrote:

 Dear Albert ARIBAUD,
 
 The following changes since commit
 5f50310588e87f2ff501992564d1b05df71419f4:
 
   davinci, c6x: Always use C version of reset code (2012-08-25
 13:40:03 +0200)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-samsung master
 
 for you to fetch changes up to
 76f60ac2246d433c6995041d1aaf9f5d4e59b941:
 
   arm:cache:trats: Enable PL310 L2 Cache Controller at TRATS Samsung
 board (2012-08-27 12:25:09 +0900)
 
 
 Donghwa Lee (9):
   video: support exynos fimd driver for various exynos series
   EXYNOS5: support exynos5 lcd clock control
   EXYNOS5: support display system register control
   EXYNOS5: support display port phy control function
   EXYNOS5: add display port base address
   video: support exynos display port drivers
   video: add dp_enabled variable in vidinfo structure
   video: exynos fb driver supports display port feature
   video: support exynos pwm backlight driver
 
 Jaehoon Chung (1):
   ARM: EXYNOS: fixed compiler warning message
 
 Rajeshwari Shinde (10):
   ARCH: SPL: Add parametric board initializer
   SMDK5250: SPL: Define parametric board initializer
   SMDK5250: Add smdk5250-uboot-spl.lds
   EXYNOS5: CLOCK: define additional clock registers for
 Exynos5250 Rev 1.0 EXYNOS5: CLOCK: Add clock support for Exynos5250
 Rev 1.0 Exynos5: DDR3: Add DDR3 memory setup for Exynos5250 Rev 1.0
   EXYNOS5: CLOCK: Modify MPLL clock out for Exynos5250 Rev 1.0
   EXYNOS5: CLOCK: Add BPLL support
   EXYNOS5 : Modify pinnumx settings as per Exynos5250 Rev 1.0
 Zhong Hongbo (1):
   arm/s5pxx: Fix get_timer_masked to get the time.
 
 Łukasz Majewski (3):
   arm:trats: loaduimage environment variable defied for TRATS
 target arm:exynos: Enable data cache at exynos based processors.
   arm:cache:trats: Enable PL310 L2 Cache Controller at TRATS
 Samsung board
 
  arch/arm/cpu/armv7/exynos/clock.c|  139 ++-
  arch/arm/cpu/armv7/exynos/pinmux.c   |   22 +-
  arch/arm/cpu/armv7/exynos/power.c|   21 +
  arch/arm/cpu/armv7/exynos/soc.c  |8 +
  arch/arm/cpu/armv7/exynos/system.c   |   18 +
  arch/arm/cpu/armv7/s5p-common/pwm.c  |2 +-
  arch/arm/cpu/armv7/s5p-common/timer.c|   20 +-
  arch/arm/include/asm/arch-exynos/clk.h   |1 +
  arch/arm/include/asm/arch-exynos/clock.h |  237 ++--
  arch/arm/include/asm/arch-exynos/cpu.h   |3 +
  arch/arm/include/asm/arch-exynos/dmc.h   |   65 ++
  arch/arm/include/asm/arch-exynos/dp.h|  751 +
  arch/arm/include/asm/arch-exynos/dp_info.h   |  214 
  arch/arm/include/asm/arch-exynos/fb.h|   27 +-
  arch/arm/include/asm/arch-exynos/gpio.h  |7 +-
  arch/arm/include/asm/arch-exynos/power.h |5 +
  arch/arm/include/asm/arch-exynos/pwm_backlight.h |   34 +
  arch/arm/include/asm/arch-exynos/spl.h   |   97 ++
  board/samsung/smdk5250/Makefile  |3 +-
  board/samsung/smdk5250/clock_init.c  |  714 +---
  board/samsung/smdk5250/clock_init.h  |  149 +++
  board/samsung/smdk5250/dmc_common.c  |  199 
  board/samsung/smdk5250/dmc_init.c|  462 
  board/samsung/smdk5250/dmc_init_ddr3.c   |  228 
  board/samsung/smdk5250/setup.h   |  763 +++--
  board/samsung/smdk5250/smdk5250-uboot-spl.lds|   66 ++
  board/samsung/smdk5250/smdk5250.c|6 +-
  board/samsung/smdk5250/smdk5250_spl.c|   68 ++
  drivers/video/Makefile   |2 +
  drivers/video/exynos_dp.c|  925
  drivers/video/exynos_dp_lowlevel.c   |
 1291 ++
 drivers/video/exynos_dp_lowlevel.h   |   80 ++
 drivers/video/exynos_fb.c|5 +-
 drivers/video/exynos_fimd.c  |   91 +-
 drivers/video/exynos_pwm_bl.c|   57 +
 include/configs/smdk5250.h   |7 +-
 include/configs/trats.h  |7 +-
 include/lcd.h|1 + 38 files
 changed, 5730 insertions(+), 1065 deletions(-) create mode 100644
 arch/arm/include/asm/arch-exynos/dp.h create mode 100644
 arch/arm/include/asm/arch-exynos/dp_info.h create mode 100644
 arch/arm/include/asm/arch-exynos/pwm_backlight.h create mode 100644
 arch/arm/include/asm/arch-exynos/spl.h create mode 100644
 board/samsung/smdk5250/clock_init.h create mode 100644
 board/samsung/smdk5250/dmc_common.c delete mode 100644
 board/samsung/smdk5250/dmc_init.c create mode 100644
 board/samsung/smdk5250/dmc_init_ddr3.c create mode 

Re: [U-Boot] [PATCH] dlmalloc: remove manual reloc alias warning

2012-09-01 Thread Wolfgang Denk
Dear Andreas,

In message 20120901101031.2da15205...@gemini.denx.de I wrote:
 
 i. e. this has the offset 2 added twice, so it is missing the first
 two real entries, env writing beyond the end of the array.

Please ignore me. Seems my brain is still in vacation mode.

However, I really wonder why you say this code would be causing
runtime errors for you:

   mbinptr *p = av_[2];
   int i;
 
   for (i = 2; i  ARRAY_SIZE(av_); ++i)
   *p = (mbinptr)((ulong)*p + gd-reloc_off);

It looks good to me.

Can you please add some debug printf()s to find out how the old code
and this one differ in their results?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
All your people must learn before you can reach for the stars.
-- Kirk, The Gamesters of Triskelion, stardate 3259.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Request pull: u-boot-sh

2012-09-01 Thread Wolfgang Denk
Dear Nobuhiro Iwamatsu,

In message 
CABMQnVKUCvW5KusMRc50qjEB1v=MvXo=Aj9JNS9xhP5x66_T=a...@mail.gmail.com you 
wrote:
 Dear Wolfgang.
 
 Please pull u-boot-sh master branch.
 
 Best regards,
   Nobuhiro
 
 The following changes since commit e66443fdb5355e68cfdbbdd37248c4b7eb4968f5:
 
   Makefile: fix HAVE_VENDOR_COMMON_LIB (2012-08-17 18:07:12 +0200)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-sh.git master
 
 for you to fetch changes up to 31d4fe8d405c4b9e27f7eca6c6710092ba14b49d:
 
   sh: tmu: Removed arch/sh/include/asm/clk.h (2012-08-21 15:00:34 +0900)
 
 
 Nobuhiro Iwamatsu (3):
   sh: tmu: Changed TMU driver using array of structures
   sh: tmu: Changed switch statement to shift operation
   sh: tmu: Removed arch/sh/include/asm/clk.h
 
  arch/sh/include/asm/clk.h|   35 
  arch/sh/include/asm/cpu_sh7706.h |5 +---
  arch/sh/include/asm/cpu_sh7710.h |5 +---
  arch/sh/include/asm/cpu_sh7720.h |   10 
  arch/sh/include/asm/cpu_sh7722.h |   11 +
  arch/sh/include/asm/cpu_sh7723.h |   11 +
  arch/sh/include/asm/cpu_sh7724.h |   11 +
  arch/sh/include/asm/cpu_sh7734.h |4 +---
  arch/sh/include/asm/cpu_sh7750.h |   21 +
  arch/sh/include/asm/cpu_sh7757.h |   14 +---
  arch/sh/include/asm/cpu_sh7763.h |5 +---
  arch/sh/include/asm/cpu_sh7780.h |   24 +--
  arch/sh/include/asm/cpu_sh7785.h |   24 +--
  arch/sh/lib/time.c   |   72
 +
  include/sh_tmu.h |   75
 
  15 files changed, 117 insertions(+), 210 deletions(-)
  delete mode 100644 arch/sh/include/asm/clk.h
  create mode 100644 include/sh_tmu.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Women professionals do tend to over-compensate.
-- Dr. Elizabeth Dehaver, Where No Man Has Gone Before,
   stardate 1312.9.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] stdio: Clean up

2012-09-01 Thread Wolfgang Denk
Dear Marek Vasut,

In message 1346453055-30888-1-git-send-email-ma...@denx.de you wrote:
 Clean up a few things in STDIO. Mostly, don't export structures directly,
 but introduce some kind of accessors if needed and remove dead code.
 
 NOTE: I'm still working on the compile tested on 2 different architectures
   part. I'll keep you posted about that. I'd be glad for a review though.
   I'd hate to pull in logic errors, especially into such critical code.
 NOTE2: Cross-posting cover to DM list, so I get feedback from those guys.
 
 Marek Vasut (6):
   stdio: dm: Murder dead code in console.c
   stdio: dm: Add accessors to stdio_devices[]
   stdio: dm: Make stdio_devices[] local
   stdio: dm: Add stdio_fd_to_name() call
   stdio: dm: Use stdio_fd_to_name() call to localize stdio_names
   stdio: dm: Optimize stdio_print_current_devices()

I can't make heads nor tails from this patch series.

1) It was posted to the U-Boot list, but all patches carry a dm: in
   the subject, which does not appear to make sense to me, as at
   least some of the changes have no relation to DM work at all.

2) It appears this might be a RFC series, so why isn't it maked as
   such in the Subject: ?

3) It appears that some code gets added - what is the impact of these
   changes on the memory footprint?

4) Besides the dead code removal - what exactly is the purpose of
   these patches?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Emotions are alien to me.  I'm a scientist.
-- Spock, This Side of Paradise, stardate 3417.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] mpc5xxx: add pci_mpc5xxx_init prototype to common header

2012-09-01 Thread Wolfgang Denk
Dear Anatolij Gustschin,

In message 1344850692-29748-1-git-send-email-ag...@denx.de you wrote:
 Add pci_mpc5xxx_init() prototype to the header file, so board .c files
 do not need to add extern pci_mpc5xxx_init() declaration.
 
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 ---
  include/mpc5xxx.h |3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The man on tops walks a lonely street;  the  chain  of  command  is
often a noose.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] mpc5xxx: add GPIO port configuration

2012-09-01 Thread Wolfgang Denk
Dear Anatolij Gustschin,

In message 1344850692-29748-2-git-send-email-ag...@denx.de you wrote:
 Add posibility for board specifig GPIO configurations using
 various CONFIG_SYS_ macros.
 
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 ---
  arch/powerpc/cpu/mpc5xxx/cpu_init.c |   14 ++
  1 files changed, 14 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I wish I had a bronze torc for every user who didn't read the manual.
 - Terry Pratchett, _The Light Fantastic_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/4] mpc52xx: add common o2dnt and o2dnt2 support and configurations

2012-09-01 Thread Wolfgang Denk
Dear Anatolij Gustschin,

In message 1346412597-4410-1-git-send-email-ag...@denx.de you wrote:
 Add common code for o2dnt and o2dnt2 based boards and add different
 board configuration files for O2D, O2I, O2DNT2, O2D300, O2MNT and
 O3DNT boards.
 
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 ---
 v2:
  - add maintainer entries
  - fix o2d board flash configuration, also tested on o2d variant
  - add itest cmd configuration to o2dnt2 and o2d config files
  - sort targets list of added boards in boards.cfg
...
 diff --git a/MAINTAINERS b/MAINTAINERS
 index c5a6f2f..afa6c0c 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -161,6 +161,15 @@ egnite GmbH i...@egnite.de
...
 +Anatolij Gustschin ag...@denx.de
...
  Dirk Eibach eib...@gdsys.de

Bad sort order.  Fixed when applying.



Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
No journaling file system can recover your data if the disk dies.
 - Steve Rago in d4cw1p@plc.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/4] mpc52xx: remove o2dnt board

2012-09-01 Thread Wolfgang Denk
Dear Anatolij Gustschin,

In message 1346412644-4446-1-git-send-email-ag...@denx.de you wrote:
 Remove old o2dnt board without OF support. New support for this board
 is added by the previous patch, O2I configuration.
 
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 ---
 v2:
  - also remove old o2dnt.h
  - fix commit message
 
  board/o2dnt/Makefile|   45 
  board/o2dnt/flash.c |  587 
 ---
  board/o2dnt/o2dnt.c |  189 ---
  boards.cfg  |1 -
  include/configs/o2dnt.h |  297 
  5 files changed, 0 insertions(+), 1119 deletions(-)
  delete mode 100644 board/o2dnt/Makefile
  delete mode 100644 board/o2dnt/flash.c
  delete mode 100644 board/o2dnt/o2dnt.c
  delete mode 100644 include/configs/o2dnt.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
We have phasers, I vote we blast 'em!
-- Bailey, The Corbomite Maneuver, stardate 1514.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5] Consolidate bootcount code into drivers/bootcount

2012-09-01 Thread Wolfgang Denk
Dear Stefan Roese,

In message 1345175741-18016-1-git-send-email...@denx.de you wrote:
 This patch moves all bootcount implementations into a common
 directory: drivers/bootcount. The generic bootcount driver
 is now usable not only by powerpc platforms, but others as well.
 
 Signed-off-by: Stefan Roese s...@denx.de
 Cc: Heiko Schocher h...@denx.de
 Cc: Valentin Longchamp valentin.longch...@keymile.com
 Cc: Christian Riesch christian.rie...@omicron.at
 Cc: Manfred Rudigier manfred.rudig...@omicron.at
 Cc: Mike Frysinger vap...@gentoo.org
 Cc: Rob Herring rob.herr...@calxeda.com
 Cc: Reinhard Meyer reinhard.me...@emk-elektronik.de
 Tested-by: Valentin Longchamp valentin.longch...@keymile.com
 Tested-by: Christian Riesch christian.rie...@omicron.at
 Acked-by: Rob Herring rob.herr...@calxeda.com
 ---
 v5:
 - Removed bootcount target from arch/blackfin/cpu/Makefile
   as pointer out by Mike (thanks)
 
 v4:
 - Rebased against TOT
 - Addressed Mike's comments
 
 v3:
 - Moved le-/be-accessors into header so that they now can be
   used by all bootcount drivers.
 - Changed CONFIG_BOOTCOUNT_LE to CONFIG_SYS_BOOTCOUNT_LE
 - Enabled CONFIG_SYS_BOOTCOUNT_LE in highbank
 - Enabled CONFIG_SYS_BOOTCOUNT_SINGLEWORD in highbank
 
 v2:
 - Added CONFIG_BOOTCOUNT_LE to bootcount_davinci.c and enabled it
   in calimain.h to select little-endian accessors.
 
  Makefile   |  1 +
  arch/arm/cpu/arm926ejs/at91/cpu.c  | 26 
  arch/arm/cpu/armv7/highbank/Makefile   |  2 +-
  arch/arm/cpu/armv7/highbank/bootcount.c| 36 ---
  arch/arm/cpu/ixp/cpu.c | 22 ---
  arch/blackfin/cpu/Makefile |  1 -
  arch/powerpc/lib/Makefile  |  1 -
  board/enbw/enbw_cmc/enbw_cmc.c | 29 -
  board/keymile/km_arm/km_arm.c  | 51 ---
  board/omicron/calimain/calimain.c  | 29 -
  drivers/bootcount/Makefile | 45 ++
  .../powerpc/lib = drivers/bootcount}/bootcount.c  | 25 
  drivers/bootcount/bootcount_at91.c | 43 +
  .../bootcount/bootcount_blackfin.c |  0
  drivers/bootcount/bootcount_davinci.c  | 49 +++
  drivers/bootcount/bootcount_ram.c  | 72 
 ++
  include/bootcount.h| 51 +++
  include/configs/calimain.h |  1 +
  include/configs/enbw_cmc.h |  1 +
  include/configs/highbank.h |  2 +
  include/configs/km/km_arm.h|  2 +
  21 files changed, 282 insertions(+), 207 deletions(-)
  delete mode 100644 arch/arm/cpu/armv7/highbank/bootcount.c
  create mode 100644 drivers/bootcount/Makefile
  rename {arch/powerpc/lib = drivers/bootcount}/bootcount.c (82%)
  create mode 100644 drivers/bootcount/bootcount_at91.c
  rename arch/blackfin/cpu/bootcount.c = 
 drivers/bootcount/bootcount_blackfin.c (100%)
  create mode 100644 drivers/bootcount/bootcount_davinci.c
  create mode 100644 drivers/bootcount/bootcount_ram.c
  create mode 100644 include/bootcount.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Microsoft Multimedia:
You have nice graphics, sound and animations when the system crashes.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [[Patch V2] mips: 01/16] add mips64 standalone support

2012-09-01 Thread Wolfgang Denk
Dear Zhizhou Zhang,

In message 1345217476-32034-2-git-send-email-etou...@gmail.com you wrote:
 Daniel Schwierzeck told me to do it with macro, But it seems not
 work. For u-boot.lds was genarete by gcc. It's hard to do that
 without a lot modify.
 ---
  arch/mips/config.mk |4 
  1 file changed, 4 insertions(+)
 
 diff --git a/arch/mips/config.mk b/arch/mips/config.mk
 index 6ab8acd..56996cc 100644
 --- a/arch/mips/config.mk
 +++ b/arch/mips/config.mk
 @@ -23,7 +23,11 @@
  
  CROSS_COMPILE ?= mips_4KC-
  
 +ifeq $(CPU) mips64
 +CONFIG_STANDALONE_LOAD_ADDR ?= 0xFfffFfff8020 -T mips64.lds

Please use a consistent style, use all uper or all lower case
letters, i. e. make this 0x8020 or 0x8020.

Aloso, please make sure your patches are bisectable.  This change adds
a reference to mips64.lds, but does not add this file.  That's bad.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Space is big. You just won't believe how vastly, hugely, mind-
bogglingly big it is. I mean, you may think it's a long way down the
road to the drug store, but that's just peanuts to space.
  -- The Hitchhiker's Guide to the Galaxy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V4 0/4] MIPS: add mips64 cpu support

2012-09-01 Thread Wolfgang Denk
Dear Zhizhou Zhang,

In message 1346071750-6634-1-git-send-email-etou...@gmail.com you wrote:
 This patch add mips64 cpu support.
 Changes in V4:
   - Add both big-endian and little-endian support
   - Remove cache probe
   - Add standalone support for mips64
 Changes in V3:
   - merge related files into one patch, no longer one file one patch.
   - add detailed commit message.
   - remove standalone example. it's too complicate.
 
 Zhizhou Zhang (4):
   MIPS: Add support for MIPS64 cpus
   MIPS: change related header files
   MIPS: add board qemu-mips64 support
   MIPS: add mips64 standalone support

Is there any specific reason why you post all patches _twice_?
Please stop doing his.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Probably the best operating system in the world  is  the  [operating
system] made for the PDP-11 by Bell Laboratories.
   - Ted Nelson, October 1977
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V4 1/4] MIPS: Add support for MIPS64 cpus

2012-09-01 Thread Wolfgang Denk
Dear Zhizhou Zhang,

In message 1346071750-6634-7-git-send-email-etou...@gmail.com you wrote:
 These files are derived from arch/mips/cpu/mips32/*. The main changes are:
 1, changes ABI o32 to n64, 2, add mips64 build cflags.
 
 Signed-off-by: Zhizhou Zhang etou...@gmail.com

Checkpatch reports a number of unnecessary whitespace before a quoted
newline warnings; please fix these.

 diff --git a/arch/mips/cpu/mips64/Makefile b/arch/mips/cpu/mips64/Makefile
 new file mode 100644
 index 000..f4c88f5
 --- /dev/null
 +++ b/arch/mips/cpu/mips64/Makefile
...
 +sinclude $(obj).depend
 +
 diff --git a/arch/mips/cpu/mips64/cache.S b/arch/mips/cpu/mips64/cache.S

Please do not add trailing empty lines.  Please fix globally.

...
 +++ b/arch/mips/cpu/mips64/config.mk
 @@ -0,0 +1,40 @@
...
 +CONFIG_STANDALONE_LOAD_ADDR ?= 0xFfffFfff8020 -T mips64.lds

As requested before: please don't mix upper and lower case letters in
a number; use a consistent styile everywhere. PLease fix globally.


As requested before: please make sure your patches are bisectable.
This references file mips64.lds, but doesn;t add it, so it cannot
work.

...
 +#define cache_op(op, addr)   \
 + __asm__ __volatile__(   \
 +.setpush\n \
 +.setnoreorder   \n \
 +.setmips64\n\t  \n \
 +cache   %0, %1  \n \
 +.setpop \n \

Fix checkpatch warnings here (and globally).

 + while (1) {
 + cache_op(Hit_Writeback_Inv_D, addr);
 + cache_op(Hit_Invalidate_I, addr);

We don't allow camel-case identifiers.  Please fix globally.



Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If it has syntax, it isn't user friendly.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request: u-boot-staging

2012-09-01 Thread Anatolij Gustschin
Hello Wolfgang,

The following changes since commit 4d3c95f5ea7c737a21cd6b9c59435ee693b3f127:

  zfs: Add ZFS filesystem support (2012-08-09 23:42:20 +0200)

are available in the git repository at:
  git://git.denx.de/u-boot-staging.git ag...@denx.de

Khem Raj (1):
  config: Always use GNU ld

Luka Perkov (1):
  tools: add kwboot binary to .gitignore file

Michal Simek (2):
  serial: CONSOLE macro is not used
  fdt: Include arch specific gpio.h instead of asm-generic/gpio.h

Vikram Narayanan (1):
  tx25: Use generic gpio_* calls

 board/karo/tx25/tx25.c  |   25 +
 config.mk   |6 +-
 drivers/serial/serial.c |3 ---
 lib/fdtdec.c|3 +--
 tools/.gitignore|1 +
 5 files changed, 16 insertions(+), 22 deletions(-)

Please pull. Thanks!

Anatolij
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V4 3/4] MIPS: add board qemu-mips64 support

2012-09-01 Thread Wolfgang Denk
Dear Zhizhou Zhang,

In message 1346071750-6634-9-git-send-email-etou...@gmail.com you wrote:
 Both big-endian and little-endian are tested with below commands:
 qemu-system-mips64el -M mips -cpu MIPS64R2-generic -kernel u-boot -nographic
 qemu-system-mips64 -M mips -cpu MIPS64R2-generic -kernel u-boot -nographic
...
 +/*IP address is default used by Qemu*/
 +#define CONFIG_IPADDR10.0.2.15   /* Our IP address */
 +#define CONFIG_SERVERIP  10.0.2.2/* Server IP address */

NAK.  We don't allow static network settings in board config files.
Please remove.


 +#define CONFIG_BOOTCOMMAND   

This makes no sense. Please fix or omit.

...
 +#define CONFIG_DRIVER_NE2000_BASE(0xb4000300)

Please remove parens around simple numbers.  Please fix globally.

 +#define CONFIG_ENV_IS_NOWHERE1

Please don't define values for logical variables.  Please fix
globally.

 +#undef CONFIG_MEMSIZE_IN_BYTES

Please don't undef what is not defined anyway.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
In the realm of scientific observation, luck is granted only to those
who are prepared. - Louis Pasteur
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V4 4/4] MIPS: add mips64 standalone support

2012-09-01 Thread Wolfgang Denk
Dear Zhizhou Zhang,

In message 1346071750-6634-10-git-send-email-etou...@gmail.com you wrote:
 Move CONFIG_SYS_TEXT_BASE to the board specified header file. So
 change qemu-mips.h also. board/qemu-mips/config.mk is not used, then
 remove it.
 
 Signed-off-by: Zhizhou Zhang etou...@gmail.com
 ---
  board/qemu-mips/config.mk  |   10 ---
  examples/standalone/mips64.lds |   59 
 
  include/configs/qemu-mips.h|1 +
  3 files changed, 60 insertions(+), 10 deletions(-)
  delete mode 100644 board/qemu-mips/config.mk
  create mode 100644 examples/standalone/mips64.lds

This patch appears to be too late in this patch series  Either
re-order and/or squash with other parts to ensure bisectability.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If I ever needed a brain transplant, I'd choose a teenager's  because
I'd want a brain that had never been used.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Credits for MCF5249 initialization code

2012-09-01 Thread Wolfgang Denk
Dear Jeremy Andrus,

In message ce3e66fb-cbef-41e4-b4ab-11e962aae...@jeremya.com you wrote:
 diff --git a/CREDITS b/CREDITS
 index 933104c..fa9a14e 100644
 --- a/CREDITS
 +++ b/CREDITS
 @@ -428,6 +428,11 @@ E: a...@videon-central.com
  D: Support for NetSilicon NS7520
  D: Support for ColdFire MCF5275
  
 +N: Jeremy C. Andrus
 +E: jer...@jeremya.com
 +D: ColdFire MCF5249 initialization code
 +W: jeremya.com
 +

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I think there's a world market for about five computers.
 -- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [GIT PULL] Pull request: u-boot-imx

2012-09-01 Thread Albert ARIBAUD
Hi Stefano,

On Mon, 27 Aug 2012 08:41:16 +0200, Stefano Babic sba...@denx.de
wrote:

 Hi Albert,
 
 please pull from u-boot-imx, thanks.
 
 The following changes since commit
 5f50310588e87f2ff501992564d1b05df71419f4:
 
   davinci, c6x: Always use C version of reset code (2012-08-25
 13:40:03 +0200)
 
 are available in the git repository at:
 
   git://www.denx.de/git/u-boot-imx.git master
 
 for you to fetch changes up to
 ff1728c902587c2dc76869a30a32013ef005b84a:
 
   mxs: Convert timeout parameter to 'unsigned int' (2012-08-27
 08:28:01 +0200)
 
 
 Ashok Kumar Reddy (1):
   mx6qarm2:Use IMX_GPIO_NR macro
 
 Benoît Thébaudeau (17):
   mxc_spi: Round up clock divider
   mx25: Enable dcache
   mx5: Enable dcache
   mx35: Fix typo on EDIO
   mx3: Fix typo on IPU_CONF_CSI_EN
   mx5/6 timer: Round up tick_to_time() value
   mx5: cosmetic: Clean up lowlevel_init
   mx35: Remove duplicate GPIO3_BASE_ADDR
   mx5/6: Fix cpu_mmc_init() return value
   mx35: Add cpu_mmc_init()
   mx5: Undeclare imx_decode_pll()
   mx35 iomux: Remove unused macro
   mx35: Fix broken pin definitions
   mx35: Remove declaration of non-existing function
   mx35: Move clock enums to clock.h
   mx35: Remove declaration of non-existing function
   mxc: Make gpio_get_value() use PSR
 
 Fabio Estevam (7):
   m28evk: Turn on caches
   apx4devkit: Turn on caches
   mx28evk: Remove unneeded 'undef'
   mxs: Use correct function name to initialize dram
   mx53loco: Use IMX_GPIO_NR macro
   mx51evk: Use IMX_GPIO_NR macro
   mx53ard: Use IMX_GPIO_NR macro
 
 Marek Vasut (7):
   MX28: Drop the cp15 reconfiguration from SPL
   MX28: Shuffle around the power management code
   MX28: DMA: Align the struct mxs_dma_desc
   MX28: DMA: Prolong the DMA timeout
   MX28: SPI: Supercharge the SPI driver
   MX28: m28evk: Align SSP clock speed
   MX28: m28evk: Enable SPI DMA
 
 Matt Sealey (7):
   spi: fix mxc_spi_slave structure allocation to clear memory
   spi: fix mxs_spi_slave structure allocation to clear memory
   mx5: add iomux-mx51.h include
   efikamx: move and rename Efika MX directories and config files
 to prepare for new boards
   efikamx: remove drive strength function and roll its
 functionality into the DCD
   efikamx: configure Smarttop PCBID and LED pads in DCD for
 convenience efikamx: update MAINTAINERS for Genesi Efika MX systems
 
 Otavio Salvador (9):
   mxs: Remove not required explicit iomux-mx28.h include
   mxs: Remove not required include of iomux-mx28.h
   mxs: rename regs-clkctrl.h to regs-clkctrl-mx28.h
   mxs: Convert sys_proto.h prefixes to 'mxs'
   MX28: config: Allow different target generation in elftosb call
   MX28: Move regs-base.h include after SoC type configuration
   mxs: Replace i.MX233 by i.MX23 on copyright header
   mxs: Only build internal Ethernet controller for i.MX28
   mxs: Rename 'mx28_dram_init' to 'mxs_dram_init'
 
 Stefano Babic (1):
   MX: Set a common gpio.h for all i.MX
 
 Troy Kisky (4):
   iomux: move IOMUX_GPR13_xxx defines
   imx-common/cmd_bmode.c: add imx bmode (bootmode) command
   mx6qsabrelite: add boot_mode support
   mx53evk: add boot_mode support
 
 Vikram Narayanan (1):
   tx25: Use generic gpio_* calls
 
 fabio.este...@freescale.com (1):
   mxs: Convert timeout parameter to 'unsigned int'
 
 trem (3):
   rtc: add support of mx27 rtc
   gpio: add gpio api support to mx27 (v4)
   imx27lite: update with gpio api change (v4)
 
  MAINTAINERS|7 +-
  Makefile   |5 +-
  arch/arm/cpu/arm1136/mx35/generic.c|   19 ++-
  arch/arm/cpu/arm1136/mx35/iomux.c  |2 -
  arch/arm/cpu/arm926ejs/mx25/generic.c  |8 +
  arch/arm/cpu/arm926ejs/mx27/generic.c  |   11 +-
  arch/arm/cpu/arm926ejs/mxs/mxs.c   |   40 ++---
  arch/arm/cpu/arm926ejs/mxs/spl_boot.c  |7 +-
  arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c  |1 -
  arch/arm/cpu/arm926ejs/mxs/spl_power_init.c|9 +-
  arch/arm/cpu/arm926ejs/mxs/start.S |   42 -
  arch/arm/cpu/arm926ejs/mxs/timer.c |2 +-
  .../arm926ejs/mxs/{u-boot.bd = u-boot-imx28.bd}   |0
  arch/arm/cpu/armv7/imx-common/Makefile |1 +
  arch/arm/cpu/armv7/imx-common/cmd_bmode.c  |  119
 ++ arch/arm/cpu/armv7/imx-common/cpu.c
 |6 +- arch/arm/cpu/armv7/imx-common/timer.c  |2 +-
  arch/arm/cpu/armv7/mx5/lowlevel_init.S |   46 +++---
  arch/arm/cpu/armv7/mx5/soc.c   |   39 +
  arch/arm/cpu/armv7/mx6/soc.c   |   36 +
  

Re: [U-Boot] [PATCH] at91sam9263ek: remove unnecessary console_init_f

2012-09-01 Thread Andreas Bießmann

Dear Andreas Bießmann,

On 16.08.2012 10:18, Andreas Bießmann wrote:

From: Andreas Biesmann andreas.de...@googlemail.com

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
cc: Stelian Pop stel...@popies.net
---


applied to u-boot-atmel/master, thanks!

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm:at91-boards: remove console_init_f where unnecessary

2012-09-01 Thread Andreas Bießmann

Dear Andreas Bießmann,

On 16.08.2012 18:01, Andreas Bießmann wrote:

A lot of at91 boards have the console_init_f in board_init. This is useless
cause it was called before by generic code in lib/board.c.

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
cc: Jens Scharsig e...@bus-elektronik.de
cc: Stelian Pop stel...@popies.net
cc: Sedji Gaouaousedji.gaou...@atmel.com
cc: Albin Tonnerre albin.tonne...@free-electrons.com
cc: Eric Benard e...@eukrea.com
---


applied to u-boot-atmel/master, thanks!

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: sam9g10/sam9m10g45: remove CONFIG_ARCH_CPU_INIT

2012-09-01 Thread Andreas Bießmann

Dear Bo Shen,

On 27.08.2012 12:04, Bo Shen wrote:

Remove CONFIG_ARCH_CPU_INIT for at91sam9g10ek and at91sam9m10g45ek

Signed-off-by: Bo Shen voice.s...@atmel.com
---


applied to u-boot-atmel/master (after rebase), thanks!

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request u-boot-blackfin.git (sf branch)

2012-09-01 Thread Andreas Bießmann

Dear Mike Frysinger,

On 14.08.2012 17:47, Mike Frysinger wrote:

The following changes since commit 4d3c95f5ea7c737a21cd6b9c59435ee693b3f127:

   zfs: Add ZFS filesystem support (2012-08-09 23:42:20 +0200)

are available in the git repository at:

   git://www.denx.de/git/u-boot-blackfin.git sf

for you to fetch changes up to 4a4cb4e11149158c9eabb1537a1eaee7372ce491:

   sf: spansion: Add support for S25FL256S (2012-08-14 11:45:50 -0400)


Marek Vasut (1):
   cmd_spi: remove superfluous semicolon

Michal Simek (2):
   sf: stmicro: add support for N25Q128A
   sf: spansion: Add support for S25FL256S

Rajeshwari Shinde (1):
   sf: winbond: add W25Q32

Stephan Linz (2):
   sf: stmicro: support JEDEC standard two-byte signature
   sf: stmicro: add support N25Q128 parts

Stephen Warren (1):
   sf: winbond: fix page_size


how about

http://patchwork.ozlabs.org/patch/177896/
and
http://patchwork.ozlabs.org/patch/178691/

I think they are required for new at91sam9x5 board support for serial 
flash booting.


Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] dlmalloc: remove manual reloc alias warning

2012-09-01 Thread Andreas Bießmann

Dera Wolfgang Denk,

On 01.09.2012 14:02, Wolfgang Denk wrote:

Dear Andreas,

In message 20120901101031.2da15205...@gemini.denx.de I wrote:


i. e. this has the offset 2 added twice, so it is missing the first
two real entries, env writing beyond the end of the array.


Please ignore me. Seems my brain is still in vacation mode.

However, I really wonder why you say this code would be causing
runtime errors for you:


mbinptr *p = av_[2];
int i;

for (i = 2; i  ARRAY_SIZE(av_); ++i)
*p = (mbinptr)((ulong)*p + gd-reloc_off);


It looks good to me.


Well, I did not investigate it further, but I can do this weekend (after 
merging/testing/pull request the atmel arm stuff). Hopefully we get a 
solution for the annoying alias warning in upcoming release.


Best regards

Andreas Bießmann


Can you please add some debug printf()s to find out how the old code
and this one differ in their results?

Best regards,

Wolfgang Denk


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] Use loop block device in sandbox board

2012-09-01 Thread Pavel Herrmann
Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com
---
 include/configs/sandbox.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 0220386..3126542 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -93,4 +93,13 @@
stdout=serial\0 \
stderr=serial\0
 
+/* SATA loopback device */
+#define CONFIG_CMD_SATA
+#define CONFIG_SATA_LOOP
+#define CONFIG_SATA_LOOP_DISKS {disk1, obscenelylongfilename, disk3}
+#define CONFIG_SYS_SATA_MAX_DEVICE 3
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT2
+
 #endif
-- 
1.7.12

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/2] Loop block device for sandbox

2012-09-01 Thread Pavel Herrmann
This driver uses files as block devices, can be used for testing disk
operations on sandbox. Port count and filenames are set in board config.

Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com
CC: Marek Vasut ma...@denx.de
---
Changes for v2:
  split sandbox config off into separate patch (2/2)
  rename file to signify exported API
  style fixes
  show end of long filenames rather than beginning
  check for lseek errors to indicate non-regular file

 drivers/block/Makefile|   1 +
 drivers/block/sata_loopback.c | 122 ++
 2 files changed, 123 insertions(+)
 create mode 100644 drivers/block/sata_loopback.c

diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index f1ebdcc..c95651a 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -40,6 +40,7 @@ COBJS-$(CONFIG_SATA_SIL) += sata_sil.o
 COBJS-$(CONFIG_IDE_SIL680) += sil680.o
 COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
 COBJS-$(CONFIG_SYSTEMACE) += systemace.o
+COBJS-${CONFIG_SATA_LOOP} += sata_loopback.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/block/sata_loopback.c b/drivers/block/sata_loopback.c
new file mode 100644
index 000..7f25a4f
--- /dev/null
+++ b/drivers/block/sata_loopback.c
@@ -0,0 +1,122 @@
+/*
+ * (C) Copyright 2012
+ * Pavel Herrmann morpheus.i...@gmail.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
+ */
+
+#include common.h
+#include part.h
+#include ata.h
+#include libata.h
+#include errno.h
+#include os.h
+
+static const char revision[] = 0.0;
+static const char vendor[] = SATA loopback;
+
+static const char * const filenames[] = CONFIG_SATA_LOOP_DISKS;
+static int max_devs = CONFIG_SYS_SATA_MAX_DEVICE;
+
+extern block_dev_desc_t sata_dev_desc[];
+
+int init_sata(int dev)
+{
+   block_dev_desc_t *pdev = sata_dev_desc[dev];
+   int fd;
+
+   if ((dev  0) || (dev = max_devs)) {
+   printf(File index %d is out of range.\n, dev);
+   return -EINVAL;
+   }
+
+   fd = os_open(filenames[dev], OS_O_RDWR);
+   /* This is ugly, but saves allocation for 1 int. */
+   pdev-priv = (void *) (long) fd;
+
+   return 0;
+}
+
+lbaint_t sata_read(int dev, lbaint_t start, lbaint_t blkcnt, void *buffer)
+{
+   block_dev_desc_t *pdev = sata_dev_desc[dev];
+   int fd = (long) pdev-priv;
+   lbaint_t start_byte = ATA_SECT_SIZE * start;
+   lbaint_t length_byte = ATA_SECT_SIZE * blkcnt;
+   lbaint_t retval;
+
+   if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte)
+   return -1;
+
+   retval = os_read(fd, buffer, length_byte);
+
+   return retval/ATA_SECT_SIZE;
+}
+
+lbaint_t sata_write(int dev, lbaint_t start, lbaint_t blkcnt, void *buffer)
+{
+   block_dev_desc_t *pdev = sata_dev_desc[dev];
+   int fd = (long) pdev-priv;
+   lbaint_t start_byte = ATA_SECT_SIZE * start;
+   lbaint_t length_byte = ATA_SECT_SIZE * blkcnt;
+   lbaint_t retval;
+
+   if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte)
+   return -1;
+
+   retval = os_write(fd, buffer, length_byte);
+
+   return retval/ATA_SECT_SIZE;
+}
+
+int scan_sata(int dev)
+{
+   block_dev_desc_t *pdev = sata_dev_desc[dev];
+   int fd = (long) pdev-priv;
+   int namelen;
+   const char *filename = filenames[dev];
+   lbaint_t bytes = 0;
+
+   memcpy(pdev-vendor, vendor, sizeof(vendor));
+   memcpy(pdev-revision, revision, sizeof(revision));
+   namelen = strlen(filenames[dev]);
+
+   if (namelen  20) {
+   /* take the last 17 chars, prepend them with ... */
+   filename += (namelen - 17);
+   memcpy(pdev-product, ..., 3);
+   memcpy(pdev-product+3, filename, 17);
+   } else
+   memcpy(pdev-product, filename, namelen);
+
+   pdev-product[20] = 0;
+
+   bytes = os_lseek(fd, 0, OS_SEEK_END);
+   if (bytes != -1) {
+   pdev-type = DEV_TYPE_HARDDISK;
+   pdev-blksz = ATA_SECT_SIZE;
+   pdev-lun = 0;
+   pdev-lba = bytes/ATA_SECT_SIZE;
+   }
+
+   printf(SATA loop info:\nfilename: %s\nsize: %lu\nblock count: %lu\n,
+   

Re: [U-Boot] [PATCH 0/6] stdio: Clean up

2012-09-01 Thread Marek Vasut
Dear Wolfgang Denk,

 Dear Marek Vasut,
 
 In message 1346453055-30888-1-git-send-email-ma...@denx.de you wrote:
  Clean up a few things in STDIO. Mostly, don't export structures directly,
  but introduce some kind of accessors if needed and remove dead code.
  
  NOTE: I'm still working on the compile tested on 2 different
  architectures
  
part. I'll keep you posted about that. I'd be glad for a review
though. I'd hate to pull in logic errors, especially into such
critical code.
  
  NOTE2: Cross-posting cover to DM list, so I get feedback from those guys.
  
  Marek Vasut (6):
stdio: dm: Murder dead code in console.c
stdio: dm: Add accessors to stdio_devices[]
stdio: dm: Make stdio_devices[] local
stdio: dm: Add stdio_fd_to_name() call
stdio: dm: Use stdio_fd_to_name() call to localize stdio_names
stdio: dm: Optimize stdio_print_current_devices()
 
 I can't make heads nor tails from this patch series.
 
 1) It was posted to the U-Boot list, but all patches carry a dm: in
the subject, which does not appear to make sense to me, as at
least some of the changes have no relation to DM work at all.

They very distantly are. I really needed to clean up the STDIO a bit to 
familiarize myself with the code I'm soon going to break.

But all in all, I think exporting structures for others to access them as they 
wish isn't the best of ideas. Therefore I encapsulated these into the file and 
added accessors. The direction these patches take with STDIO and console.c 
stuff 
in U-Boot is such that applying proper encapsulation will allow easier 
conversion to the driver model stuff later. Yet I'm getting there with really 
small steps as I need to be very careful here.

 2) It appears this might be a RFC series, so why isn't it maked as
such in the Subject: ?

It's not RFC, why would it be RFC? I'm still working on the NOTE part though.

 3) It appears that some code gets added - what is the impact of these
changes on the memory footprint?

So far I tested this on M28:

Before:
   textdata bss dec hex filename
 4157057688  288708  712101   adda5 ./u-boot
  11754 788  12   12554310a ./spl/u-boot-spl

After:
   textdata bss dec hex filename
 4155907676  288700  711966   add1e ./u-boot
  11794 788  12   125943132 ./spl/u-boot-spl

As you can see, the SPL grows a bit, yet U-Boot shrunk. Tested with Debian GCC 
4.7.1 .

 4) Besides the dead code removal - what exactly is the purpose of
these patches?

Mostly see 1).

 Best regards,
 
 Wolfgang Denk

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/5] at91: atmel_nand: extract HWECC initialization code into one function: atmel_hw_nand_init_param().

2012-09-01 Thread Andreas Bießmann

Dear Josh Wu,

On 23.08.2012 12:05, Josh Wu wrote:

This patch
1. extract the hwecc initialization code into one function. It is a preparation 
for adding atmel PMECC support.
2. enable CONFIG_SYS_NAND_SELF_INIT. Which make us can configurate the ecc 
parameters between nand_scan_ident() and nand_scan_tail().

Signed-off-by: Josh Wu josh...@atmel.com
---


applied to u-boot-atmel/master with two minor changes (read on).


Changes since v2:
adapt to CONFIG_SYS_NAND_SELF_INIT.

  drivers/mtd/nand/atmel_nand.c |  145 -
  include/nand.h|2 +-
  2 files changed, 88 insertions(+), 59 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index de66382..21dc4f5 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -232,6 +232,60 @@ static int atmel_nand_correct(struct mtd_info *mtd, u_char 
*dat,
  static void atmel_nand_hwctl(struct mtd_info *mtd, int mode)
  {
  }
+
+int atmel_hwecc_nand_init_param(struct nand_chip *nand, struct mtd_info *mtd)
+{
+   nand-ecc.mode = NAND_ECC_HW;
+   nand-ecc.calculate = atmel_nand_calculate;
+   nand-ecc.correct = atmel_nand_correct;
+   nand-ecc.hwctl = atmel_nand_hwctl;
+   nand-ecc.read_page = atmel_nand_read_page;
+   nand-ecc.bytes = 4;
+
+   if (nand-ecc.mode == NAND_ECC_HW) {
+   /* ECC is calculated for the whole page (1 step) */
+   nand-ecc.size = mtd-writesize;
+
+   /* set ECC page size and oob layout */
+   switch (mtd-writesize) {
+   case 512:
+   nand-ecc.layout = atmel_oobinfo_small;
+   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ATMEL_ECC_PAGESIZE_528);
+   break;
+   case 1024:
+   nand-ecc.layout = atmel_oobinfo_large;
+   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ATMEL_ECC_PAGESIZE_1056);
+   break;
+   case 2048:
+   nand-ecc.layout = atmel_oobinfo_large;
+   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ATMEL_ECC_PAGESIZE_2112);
+   break;
+   case 4096:
+   nand-ecc.layout = atmel_oobinfo_large;
+   ecc_writel(CONFIG_SYS_NAND_ECC_BASE, MR,
+   ATMEL_ECC_PAGESIZE_4224);
+   break;
+   default:
+   /* page size not handled by HW ECC */
+   /* switching back to soft ECC */
+   nand-ecc.mode = NAND_ECC_SOFT;
+   nand-ecc.calculate = NULL;
+   nand-ecc.correct = NULL;
+   nand-ecc.hwctl = NULL;
+   nand-ecc.read_page = NULL;
+   nand-ecc.postpad = 0;
+   nand-ecc.prepad = 0;
+   nand-ecc.bytes = 0;
+   break;
+   }
+   }
+
+   return 0;
+}
+
  #endif

  static void at91_nand_hwcontrol(struct mtd_info *mtd,
@@ -267,12 +321,20 @@ static int at91_nand_ready(struct mtd_info *mtd)
  }
  #endif

-int board_nand_init(struct nand_chip *nand)
-{
-#ifdef CONFIG_ATMEL_NAND_HWECC
-   static int chip_nr = 0;
-   struct mtd_info *mtd;
+#ifndef CONFIG_SYS_NAND_BASE_LIST
+#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
  #endif
+static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE];
+static ulong base_addr[CONFIG_SYS_MAX_NAND_DEVICE] = CONFIG_SYS_NAND_BASE_LIST;
+
+int atmel_nand_chip_init(int devnum, ulong base_addr)
+{
+   int ret;
+   struct mtd_info *mtd = nand_info[devnum];
+   struct nand_chip *nand = nand_chip[devnum];
+
+   mtd-priv = nand;
+   nand-IO_ADDR_R = nand-IO_ADDR_W = (void  __iomem *)base_addr;

nand-ecc.mode = NAND_ECC_SOFT;
  #ifdef CONFIG_SYS_NAND_DBW_16
@@ -284,62 +346,29 @@ int board_nand_init(struct nand_chip *nand)
  #endif
nand-chip_delay = 20;

-#ifdef CONFIG_ATMEL_NAND_HWECC
-   nand-ecc.mode = NAND_ECC_HW;
-   nand-ecc.calculate = atmel_nand_calculate;
-   nand-ecc.correct = atmel_nand_correct;
-   nand-ecc.hwctl = atmel_nand_hwctl;
-   nand-ecc.read_page = atmel_nand_read_page;
-   nand-ecc.bytes = 4;
-#endif
+   ret = nand_scan_ident(mtd, CONFIG_SYS_NAND_MAX_CHIPS, NULL);
+   if (ret)
+   return ret;

  #ifdef CONFIG_ATMEL_NAND_HWECC
-   mtd = nand_info[chip_nr++];
-   mtd-priv = nand;
+   ret = atmel_hwecc_nand_init_param(nand, mtd);
+#endif
+   if (ret)
+   return ret;


put this return value check into the ifdef, run time tested on 
at91sam9260ek with HWECC enabled in board config.




-   /* Detect NAND chips */
-   if 

Re: [U-Boot] [PATCH v3 2/5] at91: atmel_nand: remove unused variables.

2012-09-01 Thread Andreas Bießmann

Dear Josh Wu,

On 23.08.2012 12:05, Josh Wu wrote:

Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Scott Wood scottw...@freescale.com
---


applied to u-boot-atmel/master, thanks!

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] Use loop block device in sandbox board

2012-09-01 Thread Marek Vasut
Dear Pavel Herrmann,

I don't understand what this patch does from the lacking description. Please 
add 
proper description to the patch. ALWAYS!

 Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com
 ---
  include/configs/sandbox.h | 9 +
  1 file changed, 9 insertions(+)
 
 diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
 index 0220386..3126542 100644
 --- a/include/configs/sandbox.h
 +++ b/include/configs/sandbox.h
 @@ -93,4 +93,13 @@
   stdout=serial\0 \
   stderr=serial\0
 
 +/* SATA loopback device */
 +#define CONFIG_CMD_SATA
 +#define CONFIG_SATA_LOOP
 +#define CONFIG_SATA_LOOP_DISKS {disk1, obscenelylongfilename, disk3}
 +#define CONFIG_SYS_SATA_MAX_DEVICE 3
 +#define CONFIG_DOS_PARTITION
 +#define CONFIG_CMD_FAT
 +#define CONFIG_CMD_EXT2
 +
  #endif

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/5] at91: atmel_nand: Update driver to support Programmable Multibit ECC controller

2012-09-01 Thread Andreas Bießmann

Dear Josh Wu,

On 23.08.2012 12:05, Josh Wu wrote:

The Programmable Multibit ECC (PMECC) controller is a programmable binary
BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder. This controller
can be used to support both SLC and MLC NAND Flash devices. It supports to
generate ECC to correct 2, 4, 8, 12 or 24 bits of error per sector of data.

To use PMECC in this driver, the user needs to set the PMECC correction
capability, the sector size and ROM lookup table offsets in board config file.

This driver is ported from Linux kernel atmel_nand PMECC patch. The main 
difference
is in this version it uses registers structure access hardware instead of using 
macros.
It is tested in 9x5 serial boards.

Signed-off-by: Josh Wu josh...@atmel.com
---


applied to u-boot-atmel/master (slightly modified due to required rebase 
cause of change in 1/5), thanks!


Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 4/5] at91: 9x5: change SMC config timing that both works for PMECC non-PMECC.

2012-09-01 Thread Andreas Bießmann

Dear Josh Wu,

On 23.08.2012 12:05, Josh Wu wrote:

Signed-off-by: Josh Wu josh...@atmel.com
---


applied to u-boot-atmel/master, thnaks!

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 5/5] at91: 9x5: Enable PMECC for 5series ek board.

2012-09-01 Thread Andreas Bießmann

Dear Josh Wu,

On 23.08.2012 12:05, Josh Wu wrote:

Signed-off-by: Josh Wu josh...@atmel.com
---


applied to u-boot-atmel/master, thanks!

Best regards

Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL] u-boot-usb/master

2012-09-01 Thread Marek Vasut
Dear Wolfgang Denk,

This is a patch collection I accumulated in u-boot-usb/master, please apply to 
u-boot/master . btw. nice to have you back ;-)

The following changes since commit 27e301e5b7df6254c768d27130d3a36c31d55c96:

  CREDITS: Add credits for MCF5249 initialization code (2012-09-01 14:50:09 
+0200)

are available in the git repository at:

  git://git.denx.de/u-boot-usb.git master

for you to fetch changes up to 8c8650181904cee37721fa303622cd37255d51d6:

  MUSB driver: Timeout is never detected as the while loop does not end 
(2012-09-01 16:21:53 +0200)


Benoît Thébaudeau (8):
  ehci: cosmetic: Define the number of qt_buffers
  ehci: Fail for multi-transaction interrupt transfers
  ehci: cosmetic: Define used constants
  ehci-hcd: Boost transfer speed
  usb_storage: Restore non-EHCI support
  usb_storage: Remove EHCI constraints
  usb_stor_BBB_transport: Do not delay when not required
  ehci: Optimize qTD allocations

Jim Shimer (1):
  usb: Optimize USB storage read/write

Lucas Stach (1):
  usb: fix ulpi_set_vbus prototype

Lukasz Majewski (7):
  dfu:usb: Support for g_dnl composite download gadget.
  dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget
  dfu: DFU backend implementation
  dfu: MMC specific routines for DFU operation
  dfu:cmd: Support for DFU u-boot command
  arm:trats: Support for USB UDC driver at TRATS board.
  arm:trats: Enable g_dnl composite USB gadget with embedded DFU function 
on 
TRATS

Matej Frančeškin (1):
  MUSB driver: Timeout is never detected as the while loop does not end

Troy Kisky (1):
  USB: Fix strict aliasing in ohci-hcd

Łukasz Dałek (1):
  pxa25x: Add UDC registers definitions

 Makefile |1 +
 arch/arm/include/asm/arch-pxa/regs-usb.h |  159 +
 board/samsung/trats/trats.c  |8 +
 common/Makefile  |1 +
 common/cmd_dfu.c |   81 +
 common/usb_storage.c |   58 +++
 drivers/dfu/Makefile |   44 +
 drivers/dfu/dfu.c|  238 +
 drivers/dfu/dfu_mmc.c|  162 +
 drivers/usb/gadget/Makefile  |2 +
 drivers/usb/gadget/f_dfu.c   |  749 
+++
 drivers/usb/gadget/f_dfu.h   |  100 +++
 drivers/usb/gadget/g_dnl.c   |  202 ++
 drivers/usb/host/ehci-hcd.c  |  305 
++--
 drivers/usb/host/ehci.h  |   60 ++-
 drivers/usb/host/ohci-hcd.c  |   70 
 drivers/usb/musb/musb_hcd.c  |2 +-
 include/configs/trats.h  |   24 ++-
 include/dfu.h|  103 +++
 include/g_dnl.h  |   33 
 include/usb/ulpi.h   |2 +-
 21 files changed, 2236 insertions(+), 168 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-usb.h
 create mode 100644 common/cmd_dfu.c
 create mode 100644 drivers/dfu/Makefile
 create mode 100644 drivers/dfu/dfu.c
 create mode 100644 drivers/dfu/dfu_mmc.c
 create mode 100644 drivers/usb/gadget/f_dfu.c
 create mode 100644 drivers/usb/gadget/f_dfu.h
 create mode 100644 drivers/usb/gadget/g_dnl.c
 create mode 100644 include/dfu.h
 create mode 100644 include/g_dnl.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: do explicit unaligned accesses

2012-09-01 Thread Marek Vasut
Dear Albert ARIBAUD,

 Hi Marek,
 
 On Sat, 1 Sep 2012 00:16:43 +0200, Marek Vasut ma...@denx.de wrote:
  Dear Albert ARIBAUD,
  
   I think you are talking about lumping small-sized accesses together
   into a bigger access possibly aligned.
  
  This is exactly what I mean.
  
   If I am correct, then I don't
   think this is related to misaligned accesses.
  
  Why won't it be? Such access can in the end turn out to be aligned,
  therefore leveraging all the penalty.
 
 I have not expressed myself clearly. Yes, access lumping is related to
 access alignment. What I meant is: disallowing misaligned native
 accesses will not prevent access lumping. Misalignment restrictions do
 indeed restrict how such lumpings will happen, but it does not prevent
 lumping per se.
 
 One place where lumping and misalignement prevention did clash was
 raised in the previous discussion: a 7+1 bytes function-local char array
 was allocated on a non-aligned address (which is possible and normal
 because it is a char) and was initialized with some content. The
 compiler lumped the initialization as two misaligned 32-byte native
 accesses, despite misaligned native accesses being forbidden by
 compiler command line options. This was a compiler bug.

But that'd mean that instead of fixing a compiler, we'd be doing a workaround 
in 
our code?

   If I am not correct, can
   you please detail what you meant?
   
Besides, right now, the code is much more readable. So I really
don't like adding some strange macros to force crazy aligned
access if the compiler can do it for us and can do it better.
   
   I personally would let the compiler do it too, but I prefer it to be
   clearly indicated to the reader of the code when an access is
   known to be misaligned.
  
  I'd enable enable the Alignment trapping in the CPU and die on an
  unaligned access at runtime -- to indicate the user that he should
  fix his bloody compiler.
 
 ... or fix his bloody structure, or fix his bloody f...ixing pointer
 arithmetic, or... but I do agree with the trapping, and that's my plan.
 
 However other architectures may need, or choose, another stance on
 alignments, and it is best if they don't have to discover intended
 misaligned accesses the hard way.

Yet still, in such case, valid compiler has to generate valid workaround code.

 Thus my opinion that any misaligned
 access which cannot be fixed should not be sliently left for the
 compiler to handle, but should (also) be clearly marked as such, if only
 for humans to notice.

I can't say I agree here ... since it's a really ad-hoc solution. I can't say I 
see any real benefit other than that it's hiding possible compiler bugs :-(

  Best regards,
  Marek Vasut
 
 Amicalement,

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-atmel/master

2012-09-01 Thread Andreas Bießmann
Dear Albert Aribaud,

The following changes since commit d602b7a6b94628004fdefb7932a24185346b030b:

  fsl_esdhc: Remove cache snooping for i.MX (2012-09-01 13:50:35 +0200)

are available in the git repository at:

  git://git.denx.de/u-boot-atmel.git master

for you to fetch changes up to cc443d073801c8fd57d74954d61120214b960d61:

  at91: 9x5: Enable PMECC for 5series ek board. (2012-09-01 16:43:53 +0200)


Andreas Bießmann (3):
  at91sam9263ek: fix 'update' script
  at91sam9263ek: remove unnecessary console_init_f
  arm:at91-boards: remove console_init_f where unnecessary

Bo Shen (7):
  ARM : at91sam9x5 : Remove CONFIG_ARCH_CPU_INIT
  arm : at91sam9x5 : fix a small bug for NAND
  Take over the maintainer for sam9g10 and sam9m10g45
  atmel: at91sam9x5: fix name error for spi
  spi: atmel: add WDRBT bit to avoid receive overrun
  arm: sam9g10/sam9m10g45: remove CONFIG_ARCH_CPU_INIT
  atmel: at91sam9x5: add spi flash boot support

Wu, Josh (5):
  at91: atmel_nand: extract HWECC initialization code into one function: 
atmel_hw_nand_init_param().
  at91: atmel_nand: remove unused variables.
  at91: atmel_nand: Update driver to support Programmable Multibit ECC 
controller
  at91: 9x5: change SMC config timing that both works for PMECC  non-PMECC.
  at91: 9x5: Enable PMECC for 5series ek board.

Xu, Hong (1):
  AT91: Small fix on AT91 USART initialization code

 MAINTAINERS  |2 +-
 arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |4 +-
 board/BuS/eb_cpux9k2/cpux9k2.c   |2 -
 board/BuS/vl_ma2sc/vl_ma2sc.c|3 -
 board/atmel/at91sam9261ek/at91sam9261ek.c|3 -
 board/atmel/at91sam9263ek/at91sam9263ek.c|3 -
 board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c  |3 -
 board/atmel/at91sam9rlek/at91sam9rlek.c  |3 -
 board/atmel/at91sam9x5ek/at91sam9x5ek.c  |   14 +-
 board/calao/sbc35_a9g20/sbc35_a9g20.c|3 -
 board/calao/tny_a9260/tny_a9260.c|3 -
 board/eukrea/cpuat91/cpuat91.c   |2 -
 boards.cfg   |1 +
 doc/README.atmel_pmecc   |   44 ++
 drivers/mtd/nand/atmel_nand.c|  827 --
 drivers/mtd/nand/atmel_nand_ecc.h|  113 +++
 drivers/serial/atmel_usart.c |   11 +-
 drivers/spi/atmel_spi.c  |3 +
 drivers/spi/atmel_spi.h  |1 +
 include/configs/at91sam9261ek.h  |2 -
 include/configs/at91sam9263ek.h  |2 +-
 include/configs/at91sam9m10g45ek.h   |1 -
 include/configs/at91sam9x5ek.h   |   29 +-
 include/nand.h   |2 +-
 24 files changed, 974 insertions(+), 107 deletions(-)
 create mode 100644 doc/README.atmel_pmecc
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [ARM] [STATUS] u-boot-arm has been rebased on current u-boot/master

2012-09-01 Thread Albert ARIBAUD
Hi all,

Subject says most of all... Anyone intending to request a pull into
u-boot-arm/master should make sure to rebase onto it as needed.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1] MX: set a common place to share code for Freescale i.MX

2012-09-01 Thread Marek Vasut
Dear Stefano Babic,

 Up now only MX5 and MX6 can share code, because they have
 a common source directory in cpu/armv7. Other not armv7
 i.MX can profit of the same shared code. Move these files
 into a directory accessible for all, similar to plat-mxc
 in linux.
 
 Signed-off-by: Stefano Babic sba...@denx.de

Reviewed-by: Marek Vasut ma...@denx.de

[...]

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-atmel/master

2012-09-01 Thread Albert ARIBAUD
Hi Andreas,

On Sat,  1 Sep 2012 16:50:25 +0200, Andreas Bießmann
andreas.de...@googlemail.com wrote:

 Dear Albert Aribaud,
 
 The following changes since commit
 d602b7a6b94628004fdefb7932a24185346b030b:

Argh! Of course your pull req went out before my update to
u-boot-arm.

I'll take this pull request as-is, no need to rebase.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: do explicit unaligned accesses

2012-09-01 Thread Marek Vasut
Dear Albert ARIBAUD,

 Hi Marek,
 
 On Sat, 1 Sep 2012 16:34:09 +0200, Marek Vasut ma...@denx.de wrote:
  Dear Albert ARIBAUD,
  
   Hi Marek,
   
   On Sat, 1 Sep 2012 00:16:43 +0200, Marek Vasut ma...@denx.de
   
   wrote:
Dear Albert ARIBAUD,

 I think you are talking about lumping small-sized accesses
 together into a bigger access possibly aligned.

This is exactly what I mean.

 If I am correct, then I don't
 think this is related to misaligned accesses.

Why won't it be? Such access can in the end turn out to be
aligned, therefore leveraging all the penalty.
   
   I have not expressed myself clearly. Yes, access lumping is related
   to access alignment. What I meant is: disallowing misaligned native
   accesses will not prevent access lumping. Misalignment restrictions
   do indeed restrict how such lumpings will happen, but it does not
   prevent lumping per se.
   
   One place where lumping and misalignement prevention did clash was
   raised in the previous discussion: a 7+1 bytes function-local char
   array was allocated on a non-aligned address (which is possible and
   normal because it is a char) and was initialized with some content.
   The compiler lumped the initialization as two misaligned 32-byte
   native accesses, despite misaligned native accesses being forbidden
   by compiler command line options. This was a compiler bug.
  
  But that'd mean that instead of fixing a compiler, we'd be doing a
  workaround in our code?
 
 Not exactly.
 
 First, in this instance, a fix to the compiler has been at least
 requested, if not already applied (I would need to check this). The fix
 causes the compiler to still generate misaligned 32-bit accesses *if*
 misaligned native accesses are allowed, and to use only allowed
 accesses otherwise.

But then again, this is compiler bug we exposed, no need to hide it. I'm firm 
on 
this one.

 Second, I do not ask U-Boot contributors to mark code as explicitly
 unaligned when the misaligned access is caused by a compiler or
 code error; I ask them to mark code as unaligned when the misaligned
 access is *unavoidable* because the HW or some standard imposes it.

I see, I'm starting to see your point. Maybe because I've missed the previous 
discussion.

 Here, the specification from which the USB struc is derived imposes a
 misaligned field. This, rather than any compiler bug, makes the
 misaligned access *unavoidable*. And because it is, I ask that it be
 marked so, by the explicit use of unaligned accessors.

Still, this is unaligned only on ARM, not on maybe some other arches, right?

 If I am not correct, can
 you please detail what you meant?
 
  Besides, right now, the code is much more readable. So I
  really don't like adding some strange macros to force crazy
  aligned access if the compiler can do it for us and can do it
  better.
 
 I personally would let the compiler do it too, but I prefer it
 to be clearly indicated to the reader of the code when an
 access is known to be misaligned.

I'd enable enable the Alignment trapping in the CPU and die on an
unaligned access at runtime -- to indicate the user that he should
fix his bloody compiler.
   
   ... or fix his bloody structure, or fix his bloody f...ixing pointer
   arithmetic, or... but I do agree with the trapping, and that's my
   plan.
   
   However other architectures may need, or choose, another stance on
   alignments, and it is best if they don't have to discover intended
   misaligned accesses the hard way.
  
  Yet still, in such case, valid compiler has to generate valid
  workaround code.
 
 Yes. However, letting the compiler generate workarounds may end up
 letting it generate workarounds for misaligned accesses caused by errors
 or bugs also. Marking the code explicitly helps telling which is which
 too.

Does this work across architectures too? Like, on arm it's misaligned, on intel 
it isnt.

   Thus my opinion that any misaligned
   access which cannot be fixed should not be sliently left for the
   compiler to handle, but should (also) be clearly marked as such, if
   only for humans to notice.
  
  I can't say I agree here ... since it's a really ad-hoc solution. I
  can't say I see any real benefit other than that it's hiding possible
  compiler bugs :-(
 
 Here it is barely an ad hoc solution, as the alternative would be
 fixing the hardware or worse, spec (can someone tell us where this
 misaligned struct field originates from exactly, hw or USB spec?)

http://www.intel.com/technology/usb/download/ehci-r10.pdf I think you're 
looking 
around 3.6 .

  Best regards,
  Marek Vasut
 
 Amicalement,
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-atmel/master

2012-09-01 Thread Albert ARIBAUD
Hi Andreas,

On Sat,  1 Sep 2012 16:50:25 +0200, Andreas Bießmann
andreas.de...@googlemail.com wrote:

 Dear Albert Aribaud,
 
 The following changes since commit
 d602b7a6b94628004fdefb7932a24185346b030b:
 
   fsl_esdhc: Remove cache snooping for i.MX (2012-09-01 13:50:35
 +0200)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-atmel.git master
 
 for you to fetch changes up to
 cc443d073801c8fd57d74954d61120214b960d61:
 
   at91: 9x5: Enable PMECC for 5series ek board. (2012-09-01 16:43:53
 +0200)
 
 
 Andreas Bießmann (3):
   at91sam9263ek: fix 'update' script
   at91sam9263ek: remove unnecessary console_init_f
   arm:at91-boards: remove console_init_f where unnecessary
 
 Bo Shen (7):
   ARM : at91sam9x5 : Remove CONFIG_ARCH_CPU_INIT
   arm : at91sam9x5 : fix a small bug for NAND
   Take over the maintainer for sam9g10 and sam9m10g45
   atmel: at91sam9x5: fix name error for spi
   spi: atmel: add WDRBT bit to avoid receive overrun
   arm: sam9g10/sam9m10g45: remove CONFIG_ARCH_CPU_INIT
   atmel: at91sam9x5: add spi flash boot support
 
 Wu, Josh (5):
   at91: atmel_nand: extract HWECC initialization code into one
 function: atmel_hw_nand_init_param(). at91: atmel_nand: remove unused
 variables. at91: atmel_nand: Update driver to support Programmable
 Multibit ECC controller at91: 9x5: change SMC config timing that both
 works for PMECC  non-PMECC. at91: 9x5: Enable PMECC for 5series ek
 board.
 
 Xu, Hong (1):
   AT91: Small fix on AT91 USART initialization code
 
  MAINTAINERS  |2 +-
  arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |4 +-
  board/BuS/eb_cpux9k2/cpux9k2.c   |2 -
  board/BuS/vl_ma2sc/vl_ma2sc.c|3 -
  board/atmel/at91sam9261ek/at91sam9261ek.c|3 -
  board/atmel/at91sam9263ek/at91sam9263ek.c|3 -
  board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c  |3 -
  board/atmel/at91sam9rlek/at91sam9rlek.c  |3 -
  board/atmel/at91sam9x5ek/at91sam9x5ek.c  |   14 +-
  board/calao/sbc35_a9g20/sbc35_a9g20.c|3 -
  board/calao/tny_a9260/tny_a9260.c|3 -
  board/eukrea/cpuat91/cpuat91.c   |2 -
  boards.cfg   |1 +
  doc/README.atmel_pmecc   |   44 ++
  drivers/mtd/nand/atmel_nand.c|  827
 --
 drivers/mtd/nand/atmel_nand_ecc.h|  113 +++
 drivers/serial/atmel_usart.c |   11 +-
 drivers/spi/atmel_spi.c  |3 +
 drivers/spi/atmel_spi.h  |1 +
 include/configs/at91sam9261ek.h  |2 -
 include/configs/at91sam9263ek.h  |2 +-
 include/configs/at91sam9m10g45ek.h   |1 -
 include/configs/at91sam9x5ek.h   |   29 +-
 include/nand.h   |2 +- 24 files
 changed, 974 insertions(+), 107 deletions(-) create mode 100644
 doc/README.atmel_pmecc
 

Applied to u-boot-arm/master, thanks!

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: do explicit unaligned accesses

2012-09-01 Thread Albert ARIBAUD
Hi Marek,

On Sat, 1 Sep 2012 17:12:29 +0200, Marek Vasut ma...@denx.de wrote:

One place where lumping and misalignement prevention did clash
was raised in the previous discussion: a 7+1 bytes
function-local char array was allocated on a non-aligned
address (which is possible and normal because it is a char) and
was initialized with some content. The compiler lumped the
initialization as two misaligned 32-byte native accesses,
despite misaligned native accesses being forbidden by compiler
command line options. This was a compiler bug.
   
   But that'd mean that instead of fixing a compiler, we'd be doing a
   workaround in our code?
  
  Not exactly.
  
  First, in this instance, a fix to the compiler has been at least
  requested, if not already applied (I would need to check this). The
  fix causes the compiler to still generate misaligned 32-bit
  accesses *if* misaligned native accesses are allowed, and to use
  only allowed accesses otherwise.
 
 But then again, this is compiler bug we exposed, no need to hide it.
 I'm firm on this one.

I guess I was not clear: this issue with an 8-char local array was
*not* in U-Boot. So we exposed nothing there, and none of the
discussion led to any conclusion that we should hide anything under the
carpet. Actually, if/when we meet a compiler issue, my suggestion is
always to explicitly and lavishly comment the 'fix', whatever it is,
with warnings such as /* CAUTION! BRAINDEAD COMPILER! There is an issue
with compiler X versions Y and up where [...] */. And keep an eye on the
compiler.

  Second, I do not ask U-Boot contributors to mark code as explicitly
  unaligned when the misaligned access is caused by a compiler or
  code error; I ask them to mark code as unaligned when the misaligned
  access is *unavoidable* because the HW or some standard imposes it.
 
 I see, I'm starting to see your point. Maybe because I've missed the
 previous discussion.

I think so.

  Here, the specification from which the USB struc is derived imposes
  a misaligned field. This, rather than any compiler bug, makes the
  misaligned access *unavoidable*. And because it is, I ask that it be
  marked so, by the explicit use of unaligned accessors.
 
 Still, this is unaligned only on ARM, not on maybe some other arches,
 right?

The notion of 'misaligned' (rather than unaligned) is pretty much
architecture-independent: the fact that a 32-bit int is not on a
4-byte boundary makes it misaligned. Now, depending on arches, this
misalignment may be irrelevant because the arch can do native misaligned
accesses with little or no penalty, or may be a worry because the arch
can (be made to) do native misaligned accesses but at a performance
cost, or it may be a blocker because the arch cannot do native
misaligned accesses.

So maybe on some other arches misalignment is 'not a problem', or
maybe it is 'a serious issue'. Anyway, for ARM is ranges from one ed
to the other, and for any arch, on a given system the seriousness of the
issue may be set by the designers of the system.
 
  Yes. However, letting the compiler generate workarounds may end up
  letting it generate workarounds for misaligned accesses caused by
  errors or bugs also. Marking the code explicitly helps telling
  which is which too.
 
 Does this work across architectures too? Like, on arm it's
 misaligned, on intel it isnt.

Each architecture has its own capabilites regarding native misaligned
accesses... This is why I consider that as a general rule U-Boot should
always align its data properly, because (hopefully) all architectures
can do aligned native accesses; OTOH, if we accept misaligned code on
the grounds that 'it works on such and suh arches' or that 'any normal
arch should be able to handle misaligned accesses some way' or 'no one
in their right mind would physically forbit misaligned accesses', then
we're just giving Murphy a chance to kick us at some point.

Consider this an application of Postel's principle: we liberally
accept architectures that maybe allow misaligned accesses and maybe
handle them well; and we conservatively do not do such accesses unless
we have no other choice.

  Here it is barely an ad hoc solution, as the alternative would be
  fixing the hardware or worse, spec (can someone tell us where this
  misaligned struct field originates from exactly, hw or USB spec?)
 
 http://www.intel.com/technology/usb/download/ehci-r10.pdf I think
 you're looking around 3.6 .

I see section 3.6 (Queue Head) but I don't readily see the link
between the header and the patch we're discussiong (but I'm not an
USB expert either). Can you connect e few more dots for me? Thanks in
advance.

   Best regards,
   Marek Vasut

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] stdio: Clean up

2012-09-01 Thread Wolfgang Denk
Dear Marek,

In message 201209011619.06260.ma...@denx.de you wrote:
 
   NOTE: I'm still working on the compile tested on 2 different
   architectures
...

 But all in all, I think exporting structures for others to access them as 
 they 
 wish isn't the best of ideas. Therefore I encapsulated these into the file 
 and 
 added accessors. The direction these patches take with STDIO and console.c 
 stuff 
 in U-Boot is such that applying proper encapsulation will allow easier 
 conversion to the driver model stuff later. Yet I'm getting there with really 
 small steps as I need to be very careful here.

Then please drop the dm: part from the commit messages.

  2) It appears this might be a RFC series, so why isn't it maked as
 such in the Subject: ?
 
 It's not RFC, why would it be RFC? I'm still working on the NOTE part 
 though.

Well, either a patch is ready for submitting (which includes being
compile-clean), or it is not - in which case it might still be good
enough as a RFC.

You claim these patches are not ready yet, but they are not RFC
either.  What are they then?

  4) Besides the dead code removal - what exactly is the purpose of
 these patches?
 
 Mostly see 1).

Then please document this in the commit message(s).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There are three ways to get something done:
(1) Do it yourself.
(2) Hire someone to do it for you.
(3) Forbid your kids to do it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: do explicit unaligned accesses

2012-09-01 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message 20120901182841.3ae8b35f@lilith you wrote:
 
 Each architecture has its own capabilites regarding native misaligned
 accesses... This is why I consider that as a general rule U-Boot should
 always align its data properly, because (hopefully) all architectures
 can do aligned native accesses; OTOH, if we accept misaligned code on
 the grounds that 'it works on such and suh arches' or that 'any normal
 arch should be able to handle misaligned accesses some way' or 'no one
 in their right mind would physically forbit misaligned accesses', then
 we're just giving Murphy a chance to kick us at some point.
 
 Consider this an application of Postel's principle: we liberally
 accept architectures that maybe allow misaligned accesses and maybe
 handle them well; and we conservatively do not do such accesses unless
 we have no other choice.

Full agreement.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Even historians fail to learn from history -- they repeat the same
mistakes.
-- John Gill, Patterns of Force, stardate 2534.7
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] stdio: Clean up

2012-09-01 Thread Marek Vasut
Dear Wolfgang Denk,

 Dear Marek,
 
 In message 201209011619.06260.ma...@denx.de you wrote:
NOTE: I'm still working on the compile tested on 2 different
architectures
 
 ...
 
  But all in all, I think exporting structures for others to access them as
  they wish isn't the best of ideas. Therefore I encapsulated these into
  the file and added accessors. The direction these patches take with
  STDIO and console.c stuff in U-Boot is such that applying proper
  encapsulation will allow easier conversion to the driver model stuff
  later. Yet I'm getting there with really small steps as I need to be
  very careful here.
 
 Then please drop the dm: part from the commit messages.

I'd like to use it to track what's gonna end up in our patchdrop for the 
university, hope it's not a problem.

   2) It appears this might be a RFC series, so why isn't it maked as
   
  such in the Subject: ?
  
  It's not RFC, why would it be RFC? I'm still working on the NOTE part
  though.
 
 Well, either a patch is ready for submitting (which includes being
 compile-clean), or it is not - in which case it might still be good
 enough as a RFC.
 
 You claim these patches are not ready yet, but they are not RFC
 either.  What are they then?

Something inbetween, still building. Yet, it does seem to be going well.

   4) Besides the dead code removal - what exactly is the purpose of
   
  these patches?
  
  Mostly see 1).
 
 Then please document this in the commit message(s).

Every patch has it's proper commit message (but 1/6, which is obvious).

 Best regards,
 
 Wolfgang Denk

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: do explicit unaligned accesses

2012-09-01 Thread Marek Vasut
Dear Albert ARIBAUD,

 Hi Marek,
 
 On Sat, 1 Sep 2012 17:12:29 +0200, Marek Vasut ma...@denx.de wrote:
 One place where lumping and misalignement prevention did clash
 was raised in the previous discussion: a 7+1 bytes
 function-local char array was allocated on a non-aligned
 address (which is possible and normal because it is a char) and
 was initialized with some content. The compiler lumped the
 initialization as two misaligned 32-byte native accesses,
 despite misaligned native accesses being forbidden by compiler
 command line options. This was a compiler bug.

But that'd mean that instead of fixing a compiler, we'd be doing a
workaround in our code?
   
   Not exactly.
   
   First, in this instance, a fix to the compiler has been at least
   requested, if not already applied (I would need to check this). The
   fix causes the compiler to still generate misaligned 32-bit
   accesses *if* misaligned native accesses are allowed, and to use
   only allowed accesses otherwise.
  
  But then again, this is compiler bug we exposed, no need to hide it.
  I'm firm on this one.
 
 I guess I was not clear: this issue with an 8-char local array was
 *not* in U-Boot. So we exposed nothing there, and none of the
 discussion led to any conclusion that we should hide anything under the
 carpet. Actually, if/when we meet a compiler issue, my suggestion is
 always to explicitly and lavishly comment the 'fix', whatever it is,
 with warnings such as /* CAUTION! BRAINDEAD COMPILER! There is an issue
 with compiler X versions Y and up where [...] */. And keep an eye on the
 compiler.

Agreed

   Second, I do not ask U-Boot contributors to mark code as explicitly
   unaligned when the misaligned access is caused by a compiler or
   code error; I ask them to mark code as unaligned when the misaligned
   access is *unavoidable* because the HW or some standard imposes it.
  
  I see, I'm starting to see your point. Maybe because I've missed the
  previous discussion.
 
 I think so.
 
   Here, the specification from which the USB struc is derived imposes
   a misaligned field. This, rather than any compiler bug, makes the
   misaligned access *unavoidable*. And because it is, I ask that it be
   marked so, by the explicit use of unaligned accessors.
  
  Still, this is unaligned only on ARM, not on maybe some other arches,
  right?
 
 The notion of 'misaligned' (rather than unaligned) is pretty much
 architecture-independent: the fact that a 32-bit int is not on a
 4-byte boundary makes it misaligned. Now, depending on arches, this
 misalignment may be irrelevant because the arch can do native misaligned
 accesses with little or no penalty, or may be a worry because the arch
 can (be made to) do native misaligned accesses but at a performance
 cost, or it may be a blocker because the arch cannot do native
 misaligned accesses.
 
 So maybe on some other arches misalignment is 'not a problem', or
 maybe it is 'a serious issue'. Anyway, for ARM is ranges from one ed
 to the other, and for any arch, on a given system the seriousness of the
 issue may be set by the designers of the system.
 
   Yes. However, letting the compiler generate workarounds may end up
   letting it generate workarounds for misaligned accesses caused by
   errors or bugs also. Marking the code explicitly helps telling
   which is which too.
  
  Does this work across architectures too? Like, on arm it's
  misaligned, on intel it isnt.
 
 Each architecture has its own capabilites regarding native misaligned
 accesses... This is why I consider that as a general rule U-Boot should
 always align its data properly, because (hopefully) all architectures
 can do aligned native accesses; OTOH, if we accept misaligned code on
 the grounds that 'it works on such and suh arches' or that 'any normal
 arch should be able to handle misaligned accesses some way' or 'no one
 in their right mind would physically forbit misaligned accesses', then
 we're just giving Murphy a chance to kick us at some point.
 
 Consider this an application of Postel's principle: we liberally
 accept architectures that maybe allow misaligned accesses and maybe
 handle them well; and we conservatively do not do such accesses unless
 we have no other choice.
 
   Here it is barely an ad hoc solution, as the alternative would be
   fixing the hardware or worse, spec (can someone tell us where this
   misaligned struct field originates from exactly, hw or USB spec?)
  
  http://www.intel.com/technology/usb/download/ehci-r10.pdf I think
  you're looking around 3.6 .
 
 I see section 3.6 (Queue Head) but I don't readily see the link
 between the header and the patch we're discussiong (but I'm not an
 USB expert either). Can you connect e few more dots for me? Thanks in
 advance.

Nevermind, I took a second look and noticed how the structure looks.

Anyway, I see USB is pioneering this new rule, nice :-) I now basically see the 
issue at hand, sorry for 

[U-Boot] while booting u-boot hang at relocate_code(addr_sp, id, addr);

2012-09-01 Thread Thirumalesha N
Dear sir,

I'm porting u-boot for mpc8280 based custom board by taking mpc8260ads
board with latest u-boot source code.

its hanging while booting at relocate_code(addr_sp, id, addr);

unsigned long logbuffer_base(void)
{

,...
..
relocate_code(addr_sp, id, addr);

}

U-Boot 2012.07 (Sep 01 2012 - 09:43:41)

MPC8260 Reset Status: External Soft, External Hard

MPC8260 Clock Configuration
 - Bus-to-Core Mult 2.5x, VCO Div 4, 60x Bus Freq  20-60 , Core Freq  50-120
 - dfbrg 1, corecnf 0x11, busdf 3, cpmdf 1, plldf 0, pllmf 3, pcidf 3
 - vco_out  4, scc_clk  1, brg_clk   2500
 - cpu_clk  25000, cpm_clk  2, bus_clk  1

CPU:   MPC8260 (HiP7 Rev 14, Mask 1.0 1K49M) at 250 MHz
Board: MPC8280 Based RIO CARD.Testing  By Thiru N...
I2C:   [I2C] Setting rate...
[I2C] trying hz=2500, speed=50, filter=0, modval=0
moddiv=32, brgdiv=2
rejected brgval=-2
[I2C] trying hz=2500, speed=50, filter=0, modval=1
moddiv=16, brgdiv=4
rejected brgval=-1
[I2C] trying hz=2500, speed=50, filter=0, modval=2
moddiv=8, brgdiv=7
accepted brgval=1, totspeed=390625
[I2C] trying hz=2500, speed=50, filter=0, modval=3
moddiv=4, brgdiv=13
accepted brgval=4, totspeed=446428
[I2C] Best is:
[I2C] CPU=2500hz RATE=50 F=0 I2MOD=0003 I2BRG=0004
DIFF=53572hz
[I2C] i2mod=0006 i2brg=0004
[I2C] rbase = 0100
[I2C] tbase = 0120
[I2C] rxbd = f100
[I2C] txbd = f120
ready
DRAM:  512 MiB
Top of RAM usable for U-Boot at: 2000
Reserving 221k for U-Boot at: 1ffc8000
Reserving 4160k for malloc() at: 1fbb8000
Reserving 72 Bytes for Board Info at: 1fbb7fb8
Reserving 108 Bytes for Global Data at: 1fbb7f4c
Stack Pointer at: 1fbb7f28
New Stack Pointer is: 1fbb7f28

what may be the reason its hanging at this point? what changes still i need
to change?

Regards
Thiru N
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] while booting u-boot hang at relocate_code(addr_sp, id, addr);

2012-09-01 Thread Albert ARIBAUD
Hi Thirumalesha,

On Sat, 1 Sep 2012 22:37:24 +0530, Thirumalesha N
thiru.li...@gmail.com wrote:

 Dear sir,
 
 I'm porting u-boot for mpc8280 based custom board by taking mpc8260ads
 board with latest u-boot source code.
 
 its hanging while booting at relocate_code(addr_sp, id, addr);
 
 unsigned long logbuffer_base(void)
 {
 
 ,...
 ..
 relocate_code(addr_sp, id, addr);
 
 }
 
 U-Boot 2012.07 (Sep 01 2012 - 09:43:41)
 
 MPC8260 Reset Status: External Soft, External Hard
 
 MPC8260 Clock Configuration
  - Bus-to-Core Mult 2.5x, VCO Div 4, 60x Bus Freq  20-60 , Core Freq
 50-120
  - dfbrg 1, corecnf 0x11, busdf 3, cpmdf 1, plldf 0, pllmf 3, pcidf 3
  - vco_out  4, scc_clk  1, brg_clk   2500
  - cpu_clk  25000, cpm_clk  2, bus_clk  1
 
 CPU:   MPC8260 (HiP7 Rev 14, Mask 1.0 1K49M) at 250 MHz
 Board: MPC8280 Based RIO CARD.Testing  By Thiru N...
 I2C:   [I2C] Setting rate...
 [I2C] trying hz=2500, speed=50, filter=0, modval=0
 moddiv=32, brgdiv=2
 rejected brgval=-2
 [I2C] trying hz=2500, speed=50, filter=0, modval=1
 moddiv=16, brgdiv=4
 rejected brgval=-1
 [I2C] trying hz=2500, speed=50, filter=0, modval=2
 moddiv=8, brgdiv=7
 accepted brgval=1, totspeed=390625
 [I2C] trying hz=2500, speed=50, filter=0, modval=3
 moddiv=4, brgdiv=13
 accepted brgval=4, totspeed=446428
 [I2C] Best is:
 [I2C] CPU=2500hz RATE=50 F=0 I2MOD=0003 I2BRG=0004
 DIFF=53572hz
 [I2C] i2mod=0006 i2brg=0004
 [I2C] rbase = 0100
 [I2C] tbase = 0120
 [I2C] rxbd = f100
 [I2C] txbd = f120
 ready
 DRAM:  512 MiB
 Top of RAM usable for U-Boot at: 2000
 Reserving 221k for U-Boot at: 1ffc8000
 Reserving 4160k for malloc() at: 1fbb8000
 Reserving 72 Bytes for Board Info at: 1fbb7fb8
 Reserving 108 Bytes for Global Data at: 1fbb7f4c
 Stack Pointer at: 1fbb7f28
 New Stack Pointer is: 1fbb7f28
 
 what may be the reason its hanging at this point? what changes still
 i need to change?
 
 Regards
 Thiru N

Relocation is typically when the code starts writing to SDRAM. Did you
triple-check that the SDRAM settings are ok?

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] stdio: Clean up

2012-09-01 Thread Wolfgang Denk
Dear Marek Vasut,

In message 201209011857.18390.ma...@denx.de you wrote:
 
 I'd like to use it to track what's gonna end up in our patchdrop for the 
 university, hope it's not a problem.

Please feel free to add a line to the commit message body, but please
keep the Subject: clean.

  You claim these patches are not ready yet, but they are not RFC
  either.  What are they then?
 
 Something inbetween, still building. Yet, it does seem to be going well.

If not clean, then it's RFC.  Please mark as such when posting.

4) Besides the dead code removal - what exactly is the purpose of
   these patches?
   
   Mostly see 1).
  
  Then please document this in the commit message(s).
 
 Every patch has it's proper commit message (but 1/6, which is obvious).

Hm... it didn't become clear to me...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
You might not be as stupid as you look. This is not hard. Let's think
about this. I mean ... I'll think about this, and  you  can  join  in
when you know the words. - Terry Pratchett, _Men at Arms_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/6] stdio: Clean up

2012-09-01 Thread Marek Vasut
Dear Wolfgang Denk,

 Dear Marek Vasut,
 
 In message 201209011857.18390.ma...@denx.de you wrote:
  I'd like to use it to track what's gonna end up in our patchdrop for the
  university, hope it's not a problem.
 
 Please feel free to add a line to the commit message body, but please
 keep the Subject: clean.

OK

   You claim these patches are not ready yet, but they are not RFC
   either.  What are they then?
  
  Something inbetween, still building. Yet, it does seem to be going well.
 
 If not clean, then it's RFC.  Please mark as such when posting.

ARM just finished building, I'll have V2 for one of the patches, the rest seems 
OK.

 4) Besides the dead code removal - what exactly is the purpose of
 
these patches?

Mostly see 1).
   
   Then please document this in the commit message(s).
  
  Every patch has it's proper commit message (but 1/6, which is obvious).
 
 Hm... it didn't become clear to me...

Hm... I'll review and repost.

Yet, it still bothers me to see SPL grow by a few bytes. On the other hand, 
uboot shrunk:

  1316  Configuring for omap5_evm board...
  1317 text   data bss dec hex filename
  1318 - 173007   4312  201912  379231   5c95f ./u-boot
  1319 -  32046   1216  197508  230770   38572 ./spl/u-boot-spl
  1320 + 172912   4300  201900  379112   5c8e8 ./u-boot
  1321 +  32092   1216  197508  230816   385a0 ./spl/u-boot-spl

   798  Configuring for da850evm - Board: da850evm, Options: 
MAC_ADDR_IN_SPIFLASH
   799 text   data bss dec hex filename
   800 - 153161   3476   54260  210897   337d1 ./u-boot
   801 -  13867   1228  76   151713b43 ./spl/u-boot-spl
   802 + 153046   3464   54252  210762   3374a ./u-boot
   803 +  13907   1228  76   152113b6b ./spl/u-boot-spl

  1280  Configuring for devkit8000 board...
  1281 text   data bss dec hex filename
  1282 - 272855   7880  216436  497171   79613 ./u-boot
  1283 -  42601   1840  198020  242461   3b31d ./spl/u-boot-spl
  1284 + 272744   7868  216424  497036   7958c ./u-boot
  1285 +  42647   1840  198020  242507   3b34b ./spl/u-boot-spl

etc.

 Best regards,
 
 Wolfgang Denk

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] stdio: dm: Make stdio_devices[] local

2012-09-01 Thread Marek Vasut
Dear Marek Vasut,

 Use stdio_get_fd() and stdio_set_fd() instead of direct access
 to the array. This allows making stdio_devices[] local to stdio.c
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Wolfgang Denk w...@denx.de

[...]

 @@ -622,6 +635,7 @@ int console_init_r(void)
  {
   char *stdinname, *stdoutname, *stderrname;
   struct stdio_dev *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
 + struct stdio_dev *sio;

Self-review: NAK! This generates a warning.

Self-reply: V2 on the way.

  #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
   int i;
  #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
 @@ -690,7 +704,9 @@ done:
  #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
   /* set the environment variables (will overwrite previous env settings)
 */ for (i = 0; i  3; i++) {
 - setenv(stdio_names[i], stdio_devices[i]-name);
 + sio = stdio_get_fd(i);
 + if (sio)
 + setenv(stdio_names[i], sio-name);
   }
  #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
 

[...]

Best regards,
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver

2012-09-01 Thread Stefano Babic
On 31/08/2012 01:39, Marek Vasut wrote:
 This is based on Linux kernel -next:
 
 commit a1256b0e087ed3cdb584c683acb966ee885f733c
 Author: Brian Norris computersforpe...@gmail.com
 Date:   Fri Jul 13 09:28:24 2012 -0700
 
 mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver
 
 The NAND_CHIPOPTIONS_MSK has limited utility and is causing real bugs. It
 silently masks off at least one flag that might be set by the driver
 (NAND_NO_SUBPAGE_WRITE). This breaks the GPMI NAND driver and possibly
 others.
 
 Really, as long as driver writers exercise a small amount of care with
 NAND_* options, this mask is not necessary at all; it was only here to
 prevent certain options from accidentally being set by the driver. But the
 original thought turns out to be a bad idea occasionally. Thus, kill it.
 
 Note, this patch fixes some major gpmi-nand breakage.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Brian Norris computersforpe...@gmail.com
 Cc: Eric Nelson eric.nel...@boundarydevices.com
 Cc: Fabio Estevam feste...@gmail.com
 Cc: Otavio Salvador ota...@ossystems.com.br
 Cc: Scott Wood scottw...@freescale.com
 ---

Hi Marek,

  drivers/mtd/nand/nand_base.c |7 ++-
  include/linux/mtd/nand.h |3 ---
  2 files changed, 2 insertions(+), 8 deletions(-)
 
 NOTE: Please test before applying, I'd like to know it doesn't cause breakage.
 
 diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
 index bfd668f..658b3ad 100644

This fixes the same issue on the ea20 (davinci), and drop the painful
NAND_CHIPOPTIONS_MSK. Thanks !

Regards,
Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver

2012-09-01 Thread Marek Vasut
Dear Stefano Babic,

 On 31/08/2012 01:39, Marek Vasut wrote:
  This is based on Linux kernel -next:
  
  commit a1256b0e087ed3cdb584c683acb966ee885f733c
  Author: Brian Norris computersforpe...@gmail.com
  Date:   Fri Jul 13 09:28:24 2012 -0700
  
  mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver
  
  The NAND_CHIPOPTIONS_MSK has limited utility and is causing real
  bugs. It silently masks off at least one flag that might be set by
  the driver (NAND_NO_SUBPAGE_WRITE). This breaks the GPMI NAND driver
  and possibly others.
  
  Really, as long as driver writers exercise a small amount of care
  with NAND_* options, this mask is not necessary at all; it was only
  here to prevent certain options from accidentally being set by the
  driver. But the original thought turns out to be a bad idea
  occasionally. Thus, kill it.
  
  Note, this patch fixes some major gpmi-nand breakage.
  
  Signed-off-by: Marek Vasut ma...@denx.de
  Cc: Brian Norris computersforpe...@gmail.com
  Cc: Eric Nelson eric.nel...@boundarydevices.com
  Cc: Fabio Estevam feste...@gmail.com
  Cc: Otavio Salvador ota...@ossystems.com.br
  Cc: Scott Wood scottw...@freescale.com
  ---
 
 Hi Marek,
 
   drivers/mtd/nand/nand_base.c |7 ++-
   include/linux/mtd/nand.h |3 ---
   2 files changed, 2 insertions(+), 8 deletions(-)
  
  NOTE: Please test before applying, I'd like to know it doesn't cause
  breakage.
  
  diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
  index bfd668f..658b3ad 100644
 
 This fixes the same issue on the ea20 (davinci), and drop the painful
 NAND_CHIPOPTIONS_MSK. Thanks !

I'm glad. I hope I didn't infringe anything with this patch and that I properly 
followed this porting Linux patches procedure.

 Regards,
 Stefano

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Add a new protocol

2012-09-01 Thread Wolfgang Denk
Dear EVS Hardware Dpt,

In message CAEDiaShw4=4PX98fq_z-fqezQTMX+kqWyDXjWkr=pdoaw1e...@mail.gmail.com 
you wrote:

 Anyway, I've implemented the protocol and it's working properly. As it's
 used for internal testing, i'm not forced to make source code available, so
 this issue is closed.

GPL will hit as soon as you distribute any binary containing this
code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Too many people are ready to carry the stool when the piano needs  to
be moved.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/6] video: cfb_console: logo can be positioned via the splashpos variable

2012-09-01 Thread Anatolij Gustschin
From: Bastian Ruppert bastian.rupp...@sewerin.de

Extend the driver for placing the video/bmp logo as specified
by splashpos environment variable.

Signed-off-by: Bastian Ruppert bastian.rupp...@sewerin.de
Signed-off-by: Anatolij Gustschin ag...@denx.de
CC: Tom Rini tr...@ti.com
CC: Stefano Babic sba...@denx.de
---
v2:
 - remove some ifdefs
 - revise commit log
 - adjust video_logo_height by video_logo_ypos and thus
   fix return address for video console offset
 - add BMP_ALIGN_CENTER case to logo_plot() for proper logo
   offset calculation if m specifier is used in splashpos

 drivers/video/cfb_console.c |   88 ++
 1 files changed, 63 insertions(+), 25 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 19d061f..81e5e08 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -66,7 +66,11 @@
  * CONFIG_CONSOLE_TIME   - display time/date in upper right
  * corner, needs CONFIG_CMD_DATE and
  * CONFIG_CONSOLE_CURSOR
- * CONFIG_VIDEO_LOGO - display Linux Logo in upper left corner
+ * CONFIG_VIDEO_LOGO - display Linux Logo in upper left corner.
+ * Use CONFIG_SPLASH_SCREEN_ALIGN with
+ * environment variable splashpos to place
+ * the logo on other position. In this case
+ * no CONSOLE_EXTRA_INFO is possible.
  * CONFIG_VIDEO_BMP_LOGO  - use bmp_logo instead of linux_logo
  * CONFIG_CONSOLE_EXTRA_INFO  - display additional board information
  * strings that normaly goes to serial
@@ -369,6 +373,8 @@ static void *video_fb_address;  /* frame buffer address 
*/
 static void *video_console_address;/* console buffer start address */
 
 static int video_logo_height = VIDEO_LOGO_HEIGHT;
+static int video_logo_xpos;
+static int video_logo_ypos;
 
 static int __maybe_unused cursor_state;
 static int __maybe_unused old_col;
@@ -1488,8 +1494,21 @@ void logo_plot(void *screen, int width, int x, int y)
int ycount = video_logo_height;
unsigned char r, g, b, *logo_red, *logo_blue, *logo_green;
unsigned char *source;
-   unsigned char *dest = (unsigned char *) screen +
-   ((y * width * VIDEO_PIXEL_SIZE) + x * VIDEO_PIXEL_SIZE);
+   unsigned char *dest;
+
+#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+   if (x == BMP_ALIGN_CENTER)
+   x = max(0, (VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH) / 2);
+   else if (x  0)
+   x = max(0, VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH + x + 1);
+
+   if (y == BMP_ALIGN_CENTER)
+   y = max(0, (VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT) / 2);
+   else if (y  0)
+   y = max(0, VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT + y + 1);
+#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
+
+   dest = (unsigned char *)screen + (y * width  + x) * VIDEO_PIXEL_SIZE;
 
 #ifdef CONFIG_VIDEO_BMP_LOGO
source = bmp_logo_bitmap;
@@ -1592,42 +1611,61 @@ static void *video_logo(void)
char info[128];
int space, len;
__maybe_unused int y_off = 0;
+   __maybe_unused ulong addr;
+   __maybe_unused char *s;
 
-#ifdef CONFIG_SPLASH_SCREEN
-   char *s;
-   ulong addr;
-
-   s = getenv(splashimage);
+#ifdef CONFIG_SPLASH_SCREEN_ALIGN
+   s = getenv(splashpos);
if (s != NULL) {
-   int x = 0, y = 0;
+   if (s[0] == 'm')
+   video_logo_xpos = BMP_ALIGN_CENTER;
+   else
+   video_logo_xpos = simple_strtol(s, NULL, 0);
 
-   addr = simple_strtoul(s, NULL, 16);
-#ifdef CONFIG_SPLASH_SCREEN_ALIGN
-   s = getenv(splashpos);
+   s = strchr(s + 1, ',');
if (s != NULL) {
-   if (s[0] == 'm')
-   x = BMP_ALIGN_CENTER;
+   if (s[1] == 'm')
+   video_logo_ypos = BMP_ALIGN_CENTER;
else
-   x = simple_strtol(s, NULL, 0);
-
-   s = strchr(s + 1, ',');
-   if (s != NULL) {
-   if (s[1] == 'm')
-   y = BMP_ALIGN_CENTER;
-   else
-   y = simple_strtol(s + 1, NULL, 0);
-   }
+   video_logo_ypos = simple_strtol(s + 1, NULL, 0);
}
+   }
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
-   if (video_display_bitmap(addr, x, y) == 0) {
+#ifdef CONFIG_SPLASH_SCREEN
+   s = getenv(splashimage);
+   if (s != NULL) {
+
+   addr = simple_strtoul(s, NULL, 16);
+
+
+   if (video_display_bitmap(addr,
+   

Re: [U-Boot] Pull request: u-boot-staging

2012-09-01 Thread Wolfgang Denk
Dear Anatolij Gustschin,

In message 20120901144454.42208737@wker you wrote:
 Hello Wolfgang,
 
 The following changes since commit 4d3c95f5ea7c737a21cd6b9c59435ee693b3f127:
 
   zfs: Add ZFS filesystem support (2012-08-09 23:42:20 +0200)
 
 are available in the git repository at:
   git://git.denx.de/u-boot-staging.git ag...@denx.de
 
 Khem Raj (1):
   config: Always use GNU ld
 
 Luka Perkov (1):
   tools: add kwboot binary to .gitignore file
 
 Michal Simek (2):
   serial: CONSOLE macro is not used
   fdt: Include arch specific gpio.h instead of asm-generic/gpio.h
 
 Vikram Narayanan (1):
   tx25: Use generic gpio_* calls

I get a merge conflict for board/karo/tx25/tx25.c, due to the
previously applied IMX_GPIO_NR patches.  I tried to reslve this, but
please double-check.



Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Never give in.  Never give in.  Never. Never. Never.
- Winston Churchill
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] video: cfb_console: logo can be positioned via the splashpos variable

2012-09-01 Thread Anatolij Gustschin
Hi Bastian,

there is a number of issues with this patch, please see comments
below.

On Fri, 10 Aug 2012 09:26:43 +0200
Bastian Ruppert bastian.rupp...@sewerin.de wrote:

 Signed-off-by: Bastian Ruppert bastian.rupp...@sewerin.de
 CC: Anatolij Gustschin ag...@denx.de
 CC: Tom Rini tr...@ti.com
 CC: Stefano Babic sba...@denx.de
 ---
  drivers/video/cfb_console.c |   61 
 ---
  1 files changed, 40 insertions(+), 21 deletions(-)
 
 diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
 index 19d061f..21b52bd 100644
 --- a/drivers/video/cfb_console.c
 +++ b/drivers/video/cfb_console.c
 @@ -66,7 +66,11 @@
   * CONFIG_CONSOLE_TIME - display time/date in upper right
   *   corner, needs CONFIG_CMD_DATE and
   *   CONFIG_CONSOLE_CURSOR
 - * CONFIG_VIDEO_LOGO   - display Linux Logo in upper left corner
 + * CONFIG_VIDEO_LOGO   - display Linux Logo in upper left corner.
 + *   Use CONFIG_SPLASH_SCREEN_ALIGN with
 + *   environment variable splashpos to place
 + *   the logo on other position. In this case
 + *   no CONSOLE_EXTRA_INFO is possible.
   * CONFIG_VIDEO_BMP_LOGO  - use bmp_logo instead of linux_logo
   * CONFIG_CONSOLE_EXTRA_INFO  - display additional board information
   *   strings that normaly goes to serial
 @@ -369,6 +373,8 @@ static void *video_fb_address;/* frame buffer address 
 */
  static void *video_console_address;  /* console buffer start address */
  
  static int video_logo_height = VIDEO_LOGO_HEIGHT;
 +static int video_logo_xpos;
 +static int video_logo_ypos;
  
  static int __maybe_unused cursor_state;
  static int __maybe_unused old_col;
 @@ -1594,40 +1600,53 @@ static void *video_logo(void)
   __maybe_unused int y_off = 0;
  
  #ifdef CONFIG_SPLASH_SCREEN
 - char *s;
   ulong addr;
 -
 - s = getenv(splashimage);
 +#endif
 +#if defined(CONFIG_SPLASH_SCREEN) || defined(CONFIG_SPLASH_SCREEN_ALIGN)
 + char *s;
 +#endif

these ifdefs should be better reduced, I think we can use __maybe_unused
here, like for y_off above.

 +#ifdef CONFIG_SPLASH_SCREEN_ALIGN
 + s = getenv(splashpos);
   if (s != NULL) {
 - int x = 0, y = 0;
 + if (s[0] == 'm')
 + video_logo_xpos = BMP_ALIGN_CENTER;

The 'm' case will work with splashscreen, but not with the video logo.
There is no proper offset calculation in logo_plot() if xpos or ypos
are set to BMP_ALIGN_CENTER. As a result the logo offset will be wrong
and an access to wrong offset can even brick the board (on boards with
small frame buffers).

...
 +
 + if (video_display_bitmap(addr,  \
 + video_logo_xpos,\

no need to use \ here.

...
 + logo_plot(video_fb_address, \
 + VIDEO_COLS, \
 + video_logo_xpos,\

ditto.

...
 +#ifdef CONFIG_SPLASH_SCREEN_ALIGN
 + /* when using splashpos for video_logo, no console output */
 + return (video_fb_address + video_logo_height * VIDEO_LINE_LEN);

The returned address is used as text console offset, so if the logo is
moved down, the video_logo_height should be increased by video_logo_ypos.
Otherwise the text and cursor positions will be wrong in the video
console.

I've fixed these issues and submitted a patch v2 3/6. Please test.

Thanks,

Anatolij
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] stdio: dm: Make stdio_devices[] local

2012-09-01 Thread Andreas Bießmann
Dear Marek Vasut,

On 01.09.12 00:44, Marek Vasut wrote:
 Use stdio_get_fd() and stdio_set_fd() instead of direct access
 to the array. This allows making stdio_devices[] local to stdio.c
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Wolfgang Denk w...@denx.de
 ---
  common/cmd_console.c  |8 +++
  common/cmd_terminal.c |9 ++--
  common/console.c  |   60 
 -
  common/fdt_support.c  |8 ++-
  common/stdio.c|2 +-
  include/stdio_dev.h   |1 -
  6 files changed, 58 insertions(+), 30 deletions(-)
 
 diff --git a/common/cmd_console.c b/common/cmd_console.c
 index d8cad6b..343bc28 100644
 --- a/common/cmd_console.c
 +++ b/common/cmd_console.c
 @@ -34,7 +34,7 @@ int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char * 
 const argv[])
   int l;
   struct list_head *list = stdio_get_list();
   struct list_head *pos;
 - struct stdio_dev *dev;
 + struct stdio_dev *dev, *sio;
  
   /* Scan for valid output and input devices */
  
 @@ -51,9 +51,9 @@ int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char * 
 const argv[])
   (dev-flags  DEV_FLAGS_OUTPUT) ? 'O' : '.');
  
   for (l = 0; l  MAX_FILES; l++) {
 - if (stdio_devices[l] == dev) {
 - printf (%s , stdio_names[l]);
 - }
 + sio = stdio_get_fd(l);
 + if (sio == dev)
 + printf(%s , stdio_names[l]);
   }
   putc ('\n');
   }
 diff --git a/common/cmd_terminal.c b/common/cmd_terminal.c
 index 7cc1a6c..ba34033 100644
 --- a/common/cmd_terminal.c
 +++ b/common/cmd_terminal.c
 @@ -33,6 +33,7 @@ int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char * 
 const argv[])
  {
   int last_tilde = 0;
   struct stdio_dev *dev = NULL;
 + struct stdio_dev *sio;
  
   if (argc  1)
   return -1;
 @@ -46,12 +47,16 @@ int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char 
 * const argv[])
   printf(Entering terminal mode for port %s\n, dev-name);
   puts(Use '~.' to leave the terminal and get back to u-boot\n);
  
 + sio = stdio_get_dev(stdin);
 + if (!sio)
 + return -1;
 +
   while (1) {
   int c;
  
   /* read from console and display on serial port */
 - if (stdio_devices[0]-tstc()) {
 - c = stdio_devices[0]-getc();
 + if (sio-tstc()) {
 + c = sio-getc();
   if (last_tilde == 1) {
   if (c == '.') {
   putc(c);
 diff --git a/common/console.c b/common/console.c
 index df03cef..4a1938a 100644
 --- a/common/console.c
 +++ b/common/console.c
 @@ -64,7 +64,7 @@ static int console_setfile(int file, struct stdio_dev * dev)
   }
  
   /* Assign the new device (leaving the existing one started) */
 - stdio_devices[file] = dev;
 + stdio_set_fd(file, dev);
  
   /*
* Update monitor functions
 @@ -170,27 +170,39 @@ static inline void console_doenv(int file, struct 
 stdio_dev *dev)
  #else
  static inline int console_getc(int file)
  {
 - return stdio_devices[file]-getc();
 + struct stdio_dev *dev = stdio_get_fd(file);
 + if (dev)
 + return dev-getc();
 + return 0;
  }
  
  static inline int console_tstc(int file)
  {
 - return stdio_devices[file]-tstc();
 + struct stdio_dev *dev = stdio_get_fd(file);
 + if (dev)
 + return dev-tstc();
 + return 0;
  }
  
  static inline void console_putc(int file, const char c)
  {
 - stdio_devices[file]-putc(c);
 + struct stdio_dev *dev = stdio_get_fd(file);
 + if (dev)
 + return dev-putc(c);

return is not required here ..

  }
  
  static inline void console_puts(int file, const char *s)
  {
 - stdio_devices[file]-puts(s);
 + struct stdio_dev *dev = stdio_get_fd(file);
 + if (dev)
 + return dev-puts(s);

.. and here

  }
  
  static inline void console_printdevs(int file)
  {
 - printf(%s\n, stdio_devices[file]-name);
 + struct stdio_dev *dev = stdio_get_fd(file);
 + if (dev)
 + printf(%s\n, dev-name);
  }
  
  static inline void console_doenv(int file, struct stdio_dev *dev)
 @@ -592,27 +604,28 @@ int console_init_f(void)
  void stdio_print_current_devices(void)
  {
  #ifndef CONFIG_SYS_CONSOLE_INFO_QUIET
 + struct stdio_dev *sio;
   /* Print information */
   puts(In:);
 - if (stdio_devices[stdin] == NULL) {
 + sio = stdio_get_fd(stdin);
 + if (sio == NULL)
   puts(No input devices available!\n);
 - } else {
 - printf (%s\n, stdio_devices[stdin]-name);
 - }
 + else
 + printf(%s\n, sio-name);
  
   puts(Out:   );
 - if 

Re: [U-Boot] [PATCH 3/6] stdio: dm: Make stdio_devices[] local

2012-09-01 Thread Marek Vasut
Dear Andreas Bießmann,

 Dear Marek Vasut,

Heh, this Dear $recipient became really popular :-)

[...]

 return is not required here ..
 
   }
   
   static inline void console_puts(int file, const char *s)
   {
  
  -   stdio_devices[file]-puts(s);
  +   struct stdio_dev *dev = stdio_get_fd(file);
  +   if (dev)
  +   return dev-puts(s);
 
 .. and here

Thanks!

   }
   
   static inline void console_printdevs(int file)
   {
  
  -   printf(%s\n, stdio_devices[file]-name);
  +   struct stdio_dev *dev = stdio_get_fd(file);
  +   if (dev)
  +   printf(%s\n, dev-name);
  
   }
   
   static inline void console_doenv(int file, struct stdio_dev *dev)
  
  @@ -592,27 +604,28 @@ int console_init_f(void)
  
   void stdio_print_current_devices(void)
   {
   #ifndef CONFIG_SYS_CONSOLE_INFO_QUIET
  
  +   struct stdio_dev *sio;
  
  /* Print information */
  puts(In:);
  
  -   if (stdio_devices[stdin] == NULL) {
  +   sio = stdio_get_fd(stdin);
  +   if (sio == NULL)
  
  puts(No input devices available!\n);
  
  -   } else {
  -   printf (%s\n, stdio_devices[stdin]-name);
  -   }
  +   else
  +   printf(%s\n, sio-name);
  
  puts(Out:   );
  
  -   if (stdio_devices[stdout] == NULL) {
  +   sio = stdio_get_fd(stdout);
 
 Isn't sio still set properly here ...

It is, but it still can be NULL. Also notice the argument differs, first it's 
stdin, then stdout and lastly stderr

  +   if (sio == NULL)
  
  puts(No output devices available!\n);
  
  -   } else {
  -   printf (%s\n, stdio_devices[stdout]-name);
  -   }
  +   else
  +   printf(%s\n, sio-name);
  
  puts(Err:   );
  
  -   if (stdio_devices[stderr] == NULL) {
  +   sio = stdio_get_fd(stderr);
 
 .. and here?
 
  +   if (sio == NULL)
 
 Side note: in your newly introduced checks you use just
 
  if (sio) {
  ...
 
 Why check explicitly for NULL here? I personally favor 'if (!sio)'.

Compat reason really ... I didn't wanted to introduce more change than 
necessary 
... incremental patching can be done indeed ;-)

  puts(No error devices available!\n);
  
  -   } else {
  -   printf (%s\n, stdio_devices[stderr]-name);
  -   }
  +   else
  +   printf(%s\n, sio-name);

Thanks for the review :)

 Best regards
 
 Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Commit 94e8652a664f01cffb1f0abb0b114261c03a234d breaks tnetv107x_evm?

2012-09-01 Thread Stephen Warren
On 09/01/2012 02:10 AM, Albert ARIBAUD wrote:
 Tom, Stephen,
 
 I am surprised because I keep copy-pastes of my builds, and this one
 does not appear in recent copy-pastes, so even though I double-checked
 on my local u-boot-arm repository, I need confirmation from someone
 else.
 
 In u-boot-arm, commit 94e8652a664f01cffb1f0abb0b114261c03a234d breaks
 tnetv107x_evm:
 
 Configuring for tnetv107x_evm board...
 arm-linux-gnueabi-size: './build/tnetv107x_evm/u-boot': No such file
 arch/arm/cpu/arm1176/tnetv107x/libtnetv107x.o: In function
 `arch_cpu_init': 
 /home/albert/src/u-boot-arm/arch/arm/cpu/arm1176/tnetv107x/init.c:32:
 multiple definition of `arch_cpu_init'
 arch/arm/cpu/arm1176/libarm1176.o:/home/albert/src/u-boot-arm/arch/arm/cpu/arm1176/cpu.c:70:
 first defined here make: ***
 [/home/albert/src/u-boot-arm/build/tnetv107x_evm/u-boot] Error 1

I can confirm the issue, and will send a patch in just a couple minutes.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM: arm1176: Define arch_cpu_init() at the SoC level

2012-09-01 Thread Stephen Warren
Commit 86c6326 ARM: arm1176: enable instruction cache in
arch_cpu_init() defined arch_cpu_init() in a file that is shared across
all arm1176 SoCs. tnetv107x already implemented this function, which
caused linking to break. Move the new conflicting arch_cpu_init() into
arm1176/bcm2835/init.c so that it doesn't conflict; grep indicates this
function is usually defined at the SoC-level, not the CPU-level, at least
for ARM.

Signed-off-by: Stephen Warren swar...@wwwdotorg.org
---
 arch/arm/cpu/arm1176/bcm2835/Makefile |2 +-
 arch/arm/cpu/arm1176/bcm2835/init.c   |   24 
 arch/arm/cpu/arm1176/cpu.c|7 ---
 3 files changed, 25 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/init.c

diff --git a/arch/arm/cpu/arm1176/bcm2835/Makefile 
b/arch/arm/cpu/arm1176/bcm2835/Makefile
index 4ea6d6b..95da6a8 100644
--- a/arch/arm/cpu/arm1176/bcm2835/Makefile
+++ b/arch/arm/cpu/arm1176/bcm2835/Makefile
@@ -17,7 +17,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(SOC).o
 
 SOBJS  := lowlevel_init.o
-COBJS  := reset.o timer.o
+COBJS  := init.o reset.o timer.o
 
 SRCS   := $(SOBJS:.o=.c) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/arch/arm/cpu/arm1176/bcm2835/init.c 
b/arch/arm/cpu/arm1176/bcm2835/init.c
new file mode 100644
index 000..e90d3bb
--- /dev/null
+++ b/arch/arm/cpu/arm1176/bcm2835/init.c
@@ -0,0 +1,24 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * 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
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#include common.h
+
+int arch_cpu_init(void)
+{
+   icache_enable();
+
+   return 0;
+}
diff --git a/arch/arm/cpu/arm1176/cpu.c b/arch/arm/cpu/arm1176/cpu.c
index 532a90b..c0fd114 100644
--- a/arch/arm/cpu/arm1176/cpu.c
+++ b/arch/arm/cpu/arm1176/cpu.c
@@ -65,10 +65,3 @@ static void cache_flush (void)
/* mem barrier to sync things */
asm (mcr p15, 0, %0, c7, c10, 4: :r (0));
 }
-
-int arch_cpu_init(void)
-{
-   icache_enable();
-
-   return 0;
-}
-- 
1.7.9.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot