Re: [U-Boot] [PATCH v2] ppc4xx: Add Io64 board support

2011-10-13 Thread Eibach, Dirk
 

  Our FPGA guys keep bugging me to get their stuff in a defined state 
  ASAP after poweron. So before relocation seemed to me the 
 best thing 
  I could offer to them.
 
 Well, tell them that ASAP means right after relocation, then.

Hmm, maybe they won't even notice...

  To get around this would involve black magic and sacrifice 
 of chickens 
  to appease them which always leaves a bloody mess on our 
 RD floor. So 
  I thought this hook might be a better option.
 
 Yes, but we definitely do not want to clutter this common 
 code with board specific #ifdef's.

Ok, so tell Stefan to bring some chickens with him in November. And a
mop maybe.

Cheers
Dirk


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


Re: [U-Boot] [PATCH 3/4] arm, davinci: Add function lpsc_syncreset()

2011-10-13 Thread Christian Riesch
Good morning Heiko,
Thanks for reviewing. See my reply below.

On Thu, Oct 13, 2011 at 7:42 AM, Heiko Schocher h...@denx.de wrote:
 Christian Riesch wrote:
 This patch adds a function lpsc_syncreset that allows setting a
 lpsc module into Sync Reset state.

 Signed-off-by: Christian Riesch christian.rie...@omicron.at
 Cc: Heiko Schocher h...@denx.de
 Cc: Paulraj Sandeep s-paul...@ti.com
 Cc: Albert ARIBAUD albert.u.b...@aribaud.net
 ---
  arch/arm/cpu/arm926ejs/davinci/psc.c         |   20 +++-
  arch/arm/include/asm/arch-davinci/hardware.h |    1 +
  2 files changed, 16 insertions(+), 5 deletions(-)

 diff --git a/arch/arm/cpu/arm926ejs/davinci/psc.c 
 b/arch/arm/cpu/arm926ejs/davinci/psc.c
 index 486adb0..e02d1f6 100644
 --- a/arch/arm/cpu/arm926ejs/davinci/psc.c
 +++ b/arch/arm/cpu/arm926ejs/davinci/psc.c
 @@ -46,7 +46,7 @@
   */

  /* Works on Always On power domain only (no PD argument) */
 -void lpsc_on(unsigned int id)
 +static void lpsc_transition(unsigned int id, unsigned int state)
  {
       dv_reg_p mdstat, mdctl, ptstat, ptcmd;
  #ifdef CONFIG_SOC_DA8XX
 @@ -83,10 +83,10 @@ void lpsc_on(unsigned int id)
       while (readl(ptstat)  0x01)
               continue;

 -     if ((readl(mdstat)  0x3f) == 0x03)
 -             return; /* Already on and enabled */
 +     if ((readl(mdstat)  0x3f) == state)
 +             return; /* Already in that state */

 -     writel(readl(mdctl) | 0x03, mdctl);
 +     writel((readl(mdctl)  ~0x1f) | state, mdctl);
                                  ^
 Shouldn't this be ~0x3f ?

I checked the documentation: Actually this should be ~0x07 since the
NEXT bitfield (next module state) in the MDCTL register occupies only
bits 0..2. The additional bits in the STATE bitfield of the MDSTAT
register are used to indicate state transitions.

 And we should use a define instead 0x3f ...

Ok, I'll do.

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


Re: [U-Boot] [PATCH v2] ppc4xx: Add Io64 board support

2011-10-13 Thread Stefan Roese
On Thursday 13 October 2011 08:14:40 Eibach, Dirk wrote:
   To get around this would involve black magic and sacrifice
  
  of chickens
  
   to appease them which always leaves a bloody mess on our
  
  RD floor. So
  
   I thought this hook might be a better option.
  
  Yes, but we definitely do not want to clutter this common
  code with board specific #ifdef's.
 
 Ok, so tell Stefan to bring some chickens with him in November. And a
 mop maybe.

/me needs to watch Angel Heart again to prepare... ;)

Cheers,
Stefan

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


Re: [U-Boot] [PATCH 04/12] powerpc: cache: define ARCH_DMA_MINALIGN for DMA buffer alignment

2011-10-13 Thread Stefan Roese
On Wednesday 12 October 2011 23:01:43 Anton Staaf wrote:
 Signed-off-by: Anton Staaf robot...@chromium.org
 Cc: Mike Frysinger vap...@gentoo.org
 Cc: Lukasz Majewski l.majew...@samsung.com
 Cc: Wolfgang Denk w...@denx.de
 Cc: Stefan Roese s...@denx.de

Acked-by: Stefan Roese s...@denx.de

Thanks,
Stefan

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


Re: [U-Boot] [PATCH 0/4] Remove duplicate functions for power and sleep configuration

2011-10-13 Thread Heiko Schocher
Hello Christian,

Heiko Schocher wrote:
 Hello Christian,
 
 Christian Riesch wrote:
 Hi,
 these patches apply on top of Heiko Schocher's patches for the enbw_cmc
 board. They remove the duplicate functions for the power and sleep
 controller of the davinci devices.

 The first patch renames the low level configuration functions since they
 can not only be used for the AM1808 but for the entire da850 family.

 The second patch corrects the mask for the state bitfield of the MDSTAT
 registers. Similar patches have been already submitted for the Linux kernel
 and other parts of u-boot, see e.g. http://patchwork.ozlabs.org/patch/114942/

 Patch number three adds a function to set an LPSC module to Sync Reset
 state as this is required for DDR memory controller initialization.

 The forth patch finally replaces the PSC related functions in
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c by those of psc.c.

 I tested the DDR initialization functions on my board and they worked fine,
 but of course I can only compile-test them for Heiko's board.

 I am looking forward to your comments!
 
 just tried your patches, but after applying it, my console on UART2
 is not longer working properly on the enbw_cmc board, it seems, Tx
 only works ... investigating this behaviour ...

Found it, your code is Ok. If you sent an update version of this
patchset, with the issues fixed, I test them on my hardware, thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/3] arm, davinci: Add function lpsc_syncreset()

2011-10-13 Thread Christian Riesch
This patch adds a function lpsc_syncreset that allows setting a
lpsc module into Sync Reset state.

Signed-off-by: Christian Riesch christian.rie...@omicron.at
Cc: Heiko Schocher h...@denx.de
Cc: Paulraj Sandeep s-paul...@ti.com
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
---
 arch/arm/cpu/arm926ejs/davinci/psc.c |   20 +++-
 arch/arm/include/asm/arch-davinci/hardware.h |2 ++
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/psc.c 
b/arch/arm/cpu/arm926ejs/davinci/psc.c
index 707fa47..3e92518 100644
--- a/arch/arm/cpu/arm926ejs/davinci/psc.c
+++ b/arch/arm/cpu/arm926ejs/davinci/psc.c
@@ -46,7 +46,7 @@
  */
 
 /* Works on Always On power domain only (no PD argument) */
-void lpsc_on(unsigned int id)
+static void lpsc_transition(unsigned int id, unsigned int state)
 {
dv_reg_p mdstat, mdctl, ptstat, ptcmd;
 #ifdef CONFIG_SOC_DA8XX
@@ -83,10 +83,10 @@ void lpsc_on(unsigned int id)
while (readl(ptstat)  0x01)
continue;
 
-   if ((readl(mdstat)  PSC_MDSTAT_STATE) == 0x03)
-   return; /* Already on and enabled */
+   if ((readl(mdstat)  PSC_MDSTAT_STATE) == state)
+   return; /* Already in that state */
 
-   writel(readl(mdctl) | 0x03, mdctl);
+   writel((readl(mdctl)  ~PSC_MDCTL_NEXT) | state, mdctl);
 
switch (id) {
 #ifdef CONFIG_SOC_DM644X
@@ -114,10 +114,20 @@ void lpsc_on(unsigned int id)
 
while (readl(ptstat)  0x01)
continue;
-   while ((readl(mdstat)  PSC_MDSTAT_STATE) != 0x03)
+   while ((readl(mdstat)  PSC_MDSTAT_STATE) != state)
continue;
 }
 
+void lpsc_on(unsigned int id)
+{
+   lpsc_transition(id, 0x03);
+}
+
+void lpsc_syncreset(unsigned int id)
+{
+   lpsc_transition(id, 0x01);
+}
+
 /* Not all DaVinci chips have a DSP power domain. */
 #ifdef CONFIG_SOC_DM644X
 
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index a9c2839..26f17a3 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -291,6 +291,7 @@ typedef volatile unsigned int * dv_reg_p;
 #endif /* CONFIG_SOC_DA8XX */
 
 void lpsc_on(unsigned int id);
+void lpsc_syncreset(unsigned int id);
 void dsp_on(void);
 
 void davinci_enable_uart0(void);
@@ -357,6 +358,7 @@ struct davinci_psc_regs {
 #endif /* CONFIG_SOC_DA8XX */
 
 #define PSC_MDSTAT_STATE   0x3f
+#define PSC_MDCTL_NEXT 0x07
 
 #ifndef CONFIG_SOC_DA8XX
 
-- 
1.7.0.4

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


[U-Boot] [PATCH v2 1/3] arm, davinci: Rename AM1808 lowlevel functions to DA850

2011-10-13 Thread Christian Riesch
Rename arch/arm/cpu/arm926ejs/davinci/am1808_lowlevel.c and
arch/arm/include/asm/arch-davinci/am1808_lowlevel.h to da850_lowlevel.c
and da850_lowlevel.h since they apply not only to the AM1808 SoC
but to all DA850 chips. The function names and #defines are changed
likewise.

Signed-off-by: Christian Riesch christian.rie...@omicron.at
Cc: Heiko Schocher h...@denx.de
Cc: Paulraj Sandeep s-paul...@ti.com
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
---
 arch/arm/cpu/arm926ejs/davinci/Makefile|2 +-
 .../{am1808_lowlevel.c = da850_lowlevel.c}|  136 ++--
 .../{am1808_lowlevel.h = da850_lowlevel.h}|   26 ++--
 board/enbw/enbw_cmc/enbw_cmc.c |2 +-
 include/configs/enbw_cmc.h |   92 +++---
 5 files changed, 129 insertions(+), 129 deletions(-)
 rename arch/arm/cpu/arm926ejs/davinci/{am1808_lowlevel.c = da850_lowlevel.c} 
(70%)
 rename arch/arm/include/asm/arch-davinci/{am1808_lowlevel.h = 
da850_lowlevel.h} (63%)

diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile 
b/arch/arm/cpu/arm926ejs/davinci/Makefile
index d91a2b8..b2152df 100644
--- a/arch/arm/cpu/arm926ejs/davinci/Makefile
+++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
@@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(SOC).o
 
 COBJS-y+= cpu.o timer.o psc.o
-COBJS-$(CONFIG_AM1808_LOWLEVEL)   += am1808_lowlevel.o
+COBJS-$(CONFIG_DA850_LOWLEVEL) += da850_lowlevel.o
 COBJS-$(CONFIG_SOC_DM355)  += dm355.o
 COBJS-$(CONFIG_SOC_DM365)  += dm365.o
 COBJS-$(CONFIG_SOC_DM644X) += dm644x.o
diff --git a/arch/arm/cpu/arm926ejs/davinci/am1808_lowlevel.c 
b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
similarity index 70%
rename from arch/arm/cpu/arm926ejs/davinci/am1808_lowlevel.c
rename to arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
index 1ea4a9f..a6f0178 100644
--- a/arch/arm/cpu/arm926ejs/davinci/am1808_lowlevel.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
@@ -1,5 +1,5 @@
 /*
- * SoC-specific lowlevel code for AM1808 and similar chips
+ * SoC-specific lowlevel code for DA850
  *
  * Copyright (C) 2011
  * Heiko Schocher, DENX Software Engineering, h...@denx.de.
@@ -25,12 +25,12 @@
 #include nand.h
 #include ns16550.h
 #include post.h
-#include asm/arch/am1808_lowlevel.h
+#include asm/arch/da850_lowlevel.h
 #include asm/arch/hardware.h
 #include asm/arch/ddr2_defs.h
 #include asm/arch/emif_defs.h
 
-void am1808_waitloop(unsigned long loopcnt)
+void da850_waitloop(unsigned long loopcnt)
 {
unsigned long   i;
 
@@ -38,7 +38,7 @@ void am1808_waitloop(unsigned long loopcnt)
asm(   NOP);
 }
 
-int am1808_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
+int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
 {
if (reg == davinci_pllc0_regs)
/* Unlock PLL registers. */
@@ -55,7 +55,7 @@ int am1808_pll_init(struct davinci_pllc_regs *reg, unsigned 
long pllmult)
/* Set PLLEN=0 = PLL BYPASS MODE */
clrbits_le32(reg-pllctl, 0x0001);
 
-   am1808_waitloop(150);
+   da850_waitloop(150);
 
if (reg == davinci_pllc0_regs) {
/*
@@ -87,10 +87,10 @@ int am1808_pll_init(struct davinci_pllc_regs *reg, unsigned 
long pllmult)
 
/* program the postdiv */
if (reg == davinci_pllc0_regs)
-   writel((0x8000 | CONFIG_SYS_AM1808_PLL0_POSTDIV),
+   writel((0x8000 | CONFIG_SYS_DA850_PLL0_POSTDIV),
reg-postdiv);
else
-   writel((0x8000 | CONFIG_SYS_AM1808_PLL1_POSTDIV),
+   writel((0x8000 | CONFIG_SYS_DA850_PLL1_POSTDIV),
reg-postdiv);
 
/*
@@ -101,17 +101,17 @@ int am1808_pll_init(struct davinci_pllc_regs *reg, 
unsigned long pllmult)
;
 
if (reg == davinci_pllc0_regs) {
-   writel(CONFIG_SYS_AM1808_PLL0_PLLDIV1, reg-plldiv1);
-   writel(CONFIG_SYS_AM1808_PLL0_PLLDIV2, reg-plldiv2);
-   writel(CONFIG_SYS_AM1808_PLL0_PLLDIV3, reg-plldiv3);
-   writel(CONFIG_SYS_AM1808_PLL0_PLLDIV4, reg-plldiv4);
-   writel(CONFIG_SYS_AM1808_PLL0_PLLDIV5, reg-plldiv5);
-   writel(CONFIG_SYS_AM1808_PLL0_PLLDIV6, reg-plldiv6);
-   writel(CONFIG_SYS_AM1808_PLL0_PLLDIV7, reg-plldiv7);
+   writel(CONFIG_SYS_DA850_PLL0_PLLDIV1, reg-plldiv1);
+   writel(CONFIG_SYS_DA850_PLL0_PLLDIV2, reg-plldiv2);
+   writel(CONFIG_SYS_DA850_PLL0_PLLDIV3, reg-plldiv3);
+   writel(CONFIG_SYS_DA850_PLL0_PLLDIV4, reg-plldiv4);
+   writel(CONFIG_SYS_DA850_PLL0_PLLDIV5, reg-plldiv5);
+   writel(CONFIG_SYS_DA850_PLL0_PLLDIV6, reg-plldiv6);
+   writel(CONFIG_SYS_DA850_PLL0_PLLDIV7, reg-plldiv7);
} else {
-   writel(CONFIG_SYS_AM1808_PLL1_PLLDIV1, reg-plldiv1);
-   

[U-Boot] [PATCH v2 0/3] Remove duplicate functions for power and sleep configuration

2011-10-13 Thread Christian Riesch
Hi,
these patches apply on top of Heiko Schocher's patches for the enbw_cmc
board. They remove the duplicate functions for the power and sleep
controller of the davinci devices.

Changes for v2:
- use -M option of git format-patch to detect the renaming of files
- Removed one patch of the patchset (arm, davinci: Correct the MDSTAT.STATE
  mask) since a similar patch was already submitted by Sergei Shtylyov. 
  The prerequisites list below was updated accordingly.
- Use defines for bitmasks for PSC configuration instead of magic numbers.

The first patch renames the low level configuration functions since they can
not only be used for the AM1808 but for the entire da850 family.

Patch number two adds a function to set an LPSC module to Sync Reset
state as this is required for DDR memory controller initialization.

The third patch finally replaces the PSC related functions in
arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c by those of psc.c.

I am looking forward to your comments!

Prerequisites:

[U-Boot] arm, post, memory: fix bug if sdram base != 0x
http://patchwork.ozlabs.org/patch/118208/

[U-Boot] : davinci: Replace CONFIG_PRELOADER with CONFIG_SPL_BUILD in 
board/davinci/common/misc.c
http://patchwork.ozlabs.org/patch/114482/

[U-Boot] arm, fdt: update ethernet mac address before booting Linux
http://patchwork.ozlabs.org/patch/114736/

[U-Boot,v2] arm, logbuffer: make it compileclean
http://patchwork.ozlabs.org/patch/119183/

[U-Boot,v2] cosmetic, post: Codingstyle cleanup
http://patchwork.ozlabs.org/patch/119184/

[U-Boot] arm, post: add missing post_time_ms for arm
http://patchwork.ozlabs.org/patch/114743/

[U-Boot,v2,1/3] arm, davinci: fix typo in 
arch/arm/cpu/arm926ejs/davinci/Makefile
http://patchwork.ozlabs.org/patch/118310/

[U-Boot,v2,2/3] arm, davinci: add DAVINCI_MMC_CLKID
http://patchwork.ozlabs.org/patch/118309/

[U-Boot,v2,3/3] arm, davinci: add support for am1808 based enbw_cmc board
http://patchwork.ozlabs.org/patch/118311/

[U-Boot,v3] DaVinci: correct MDSTAT.STATE mask
http://patchwork.ozlabs.org/patch/116094/

Regards, Christian

Cc: Heiko Schocher h...@denx.de
Cc: Paulraj Sandeep s-paul...@ti.com
Cc: Albert ARIBAUD albert.u.b...@aribaud.net

Christian Riesch (3):
  arm, davinci: Rename AM1808 lowlevel functions to DA850
  arm, davinci: Add function lpsc_syncreset()
  arm, davinci: Remove the duplication of LPSC functions in
da850_lowlevel.c

 arch/arm/cpu/arm926ejs/davinci/Makefile|2 +-
 .../{am1808_lowlevel.c = da850_lowlevel.c}|  202 ++--
 arch/arm/cpu/arm926ejs/davinci/psc.c   |   20 ++-
 .../{am1808_lowlevel.h = da850_lowlevel.h}|   26 ++--
 arch/arm/include/asm/arch-davinci/hardware.h   |2 +
 board/enbw/enbw_cmc/enbw_cmc.c |2 +-
 include/configs/enbw_cmc.h |   92 +-
 7 files changed, 135 insertions(+), 211 deletions(-)
 rename arch/arm/cpu/arm926ejs/davinci/{am1808_lowlevel.c = da850_lowlevel.c} 
(57%)
 rename arch/arm/include/asm/arch-davinci/{am1808_lowlevel.h = 
da850_lowlevel.h} (63%)

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


[U-Boot] [PATCH v2 3/3] arm, davinci: Remove the duplication of LPSC functions in da850_lowlevel.c

2011-10-13 Thread Christian Riesch
The LPSC functions defined in
arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
are replaced by those already defined in
arch/arm/cpu/arm926ejs/davinci/psc.c.

Signed-off-by: Christian Riesch christian.rie...@omicron.at
Cc: Heiko Schocher h...@denx.de
Cc: Paulraj Sandeep s-paul...@ti.com
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |   96 +--
 1 files changed, 4 insertions(+), 92 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c 
b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
index a6f0178..490ef8f 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
@@ -153,49 +153,12 @@ int da850_pll_init(struct davinci_pllc_regs *reg, 
unsigned long pllmult)
return 0;
 }
 
-void da850_lpc_transition(unsigned char pscnum, unsigned char module,
-   unsigned char domain, unsigned char state)
-{
-   struct davinci_psc_regs *reg;
-   dv_reg_p mdstat, mdctl;
-
-   if (pscnum == 0) {
-   reg = davinci_psc0_regs;
-   mdstat = reg-psc0.mdstat[module];
-   mdctl = reg-psc0.mdctl[module];
-   } else {
-   reg = davinci_psc1_regs;
-   mdstat = reg-psc1.mdstat[module];
-   mdctl = reg-psc1.mdctl[module];
-   }
-
-   /* Wait for any outstanding transition to complete */
-   while ((readl(reg-ptstat)  (0x0001  domain)))
-   ;
-
-   /* If we are already in that state, just return */
-   if ((readl(mdstat)  0x1F) == state)
-   return;
-
-   /* Perform transition */
-   writel((readl(mdctl)  0xFFE0) | state, mdctl);
-   setbits_le32(reg-ptcmd, (0x0001  domain));
-
-   /* Wait for transition to complete */
-   while (readl(reg-ptstat)  (0x0001  domain))
-   ;
-
-   /* Wait and verify the state */
-   while ((readl(mdstat)  0x1F) != state)
-   ;
-}
-
 int da850_ddr_setup(unsigned int freq)
 {
unsigned long   tmp;
 
/* Enable the Clock to DDR2/mDDR */
-   da850_lpc_transition(1, 6, 0, PSC_ENABLE);
+   lpsc_on(DAVINCI_LPSC_DDR_EMIF);
 
tmp = readl(davinci_syscfg1_regs-vtpio_ctl);
if ((tmp  VTP_POWERDWN) == VTP_POWERDWN) {
@@ -244,9 +207,9 @@ int da850_ddr_setup(unsigned int freq)
dv_ddr2_regs_ctrl-sdrcr);
 
/* SyncReset the Clock to EMIF3A SDRAM */
-   da850_lpc_transition(1, 6, 0, PSC_SYNCRESET);
+   lpsc_syncreset(DAVINCI_LPSC_DDR_EMIF);
/* Enable the Clock to EMIF3A SDRAM */
-   da850_lpc_transition(1, 6, 0, PSC_ENABLE);
+   lpsc_on(DAVINCI_LPSC_DDR_EMIF);
 
/* disable self refresh */
clrbits_le32(dv_ddr2_regs_ctrl-sdrcr, 0xc000);
@@ -255,54 +218,6 @@ int da850_ddr_setup(unsigned int freq)
return 0;
 }
 
-static void da850_set_mdctl(dv_reg_p mdctl)
-{
-   if ((readl(mdctl)  0x1F) != PSC_ENABLE)
-   writel(((readl(mdctl)  0xFFE0) | PSC_ENABLE), mdctl);
-}
-
-void da850_psc_init(void)
-{
-   struct davinci_psc_regs *reg;
-   int i;
-
-   /* PSC 0 domain 0 init */
-   reg = davinci_psc0_regs;
-   while ((readl(reg-ptstat)  0x0001))
-   ;
-
-   for (i = 3; i = 4 ; i++)
-   da850_set_mdctl(reg-psc0.mdctl[i]);
-
-   for (i = 7; i = 12 ; i++)
-   da850_set_mdctl(reg-psc0.mdctl[i]);
-
-   /* Do Always-On Power Domain Transitions */
-   setbits_le32(reg-ptcmd, 0x0001);
-   while (readl(reg-ptstat)  0x0001)
-   ;
-
-   /* PSC1, domain 1 init */
-   reg = davinci_psc1_regs;
-   while ((readl(reg-ptstat)  0x0001))
-   ;
-
-   da850_set_mdctl(reg-psc1.mdctl[3]);
-   da850_set_mdctl(reg-psc1.mdctl[6]);
-
-   /* UART1 + UART2 */
-   for (i = 12 ; i = 13 ; i++)
-   da850_set_mdctl(reg-psc1.mdctl[i]);
-
-   da850_set_mdctl(reg-psc1.mdctl[26]);
-   da850_set_mdctl(reg-psc1.mdctl[31]);
-
-   /* Do Always-On Power Domain Transitions */
-   setbits_le32(reg-ptcmd, 0x0001);
-   while (readl(reg-ptstat)  0x0001)
-   ;
-}
-
 void da850_pinmux_ctl(unsigned long offset, unsigned long mask,
unsigned long value)
 {
@@ -368,9 +283,6 @@ int arch_cpu_init(void)
dv_maskbits(davinci_syscfg_regs-suspsrc,
((1  27) | (1  22) | (1  20) | (1  5) | (1  16)));
 
-   /* System PSC setup - enable all */
-   da850_psc_init();
-
/* Setup Pinmux */
da850_pinmux_ctl(0, 0x, CONFIG_SYS_DA850_PINMUX0);
da850_pinmux_ctl(1, 0x, CONFIG_SYS_DA850_PINMUX1);
@@ -404,7 +316,7 @@ int arch_cpu_init(void)
writel(CONFIG_SYS_DA850_CS2CFG, davinci_emif_regs-ab1cr);
writel(CONFIG_SYS_DA850_CS3CFG, davinci_emif_regs-ab2cr);
 
-   da850_lpc_transition(1, 13, 0, PSC_ENABLE);
+   

Re: [U-Boot] [PATCH] avr32: fix timer_init() return type

2011-10-13 Thread Andreas Bießmann
Dear Mike,

Am 13.10.2011 07:11, schrieb Mike Frysinger:
 The common.h header says this has to return an int, otherwise we get
 build failures due to mismatched prototype and function definition.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---
  arch/avr32/cpu/interrupts.c |6 --
  1 files changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/arch/avr32/cpu/interrupts.c b/arch/avr32/cpu/interrupts.c
 index 6681e13..1127580 100644
 --- a/arch/avr32/cpu/interrupts.c
 +++ b/arch/avr32/cpu/interrupts.c
 @@ -107,7 +107,7 @@ static int set_interrupt_handler(unsigned int nr, void 
 (*handler)(void),
   return 0;
  }
  
 -void timer_init(void)
 +int timer_init(void)
  {
   extern void timer_interrupt_handler(void);
   u64 tmp;
 @@ -120,8 +120,10 @@ void timer_init(void)
   tb_factor = (u32)tmp;
  
   if (set_interrupt_handler(0, timer_interrupt_handler, 3))
 - return;
 + return 0;

NAK, this is an error and should return a negative value (though the
return value is currently not evaluated).

BTW there is another patch pending -
http://patchwork.ozlabs.org/patch/117688/

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 1/2] AVR32: use generic mmc framework

2011-10-13 Thread Sven Schnelle
Hi Wolfgang,

On 10/12/2011 07:54 PM, Wolfgang Denk wrote:
 Dear Sven Schnelle,

 In message4e95a965.20...@stackframe.org  you wrote:

 a) mmc init is not known? Is this not longer necessar
 'mmc init' is only available if CONFIG_GENERIC_MMC isn't set, at least
 that's how i unterstand the source code. (See common/cmd_mmc.c:29)

 Argh.  No, we will not allow different implementations / feature sets.

Can you please explain that statement? Actually i have no idea what 
you're trying to say.

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


Re: [U-Boot] [PATCH] sh: only add -mno-fdpic if the compiler supports it

2011-10-13 Thread phil . edworthy
Hi Mike,

Mike Frysinger wrote on 13/10/2011 05:45:47:
 Not all SuperH toolchains support -mno-fdpic.  Chances are good that if
 the flag doesn't work, it isn't defaulting to the FDPIC ABI, so the flag
 isn't needed.  So only add it if it is actually supported.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---

Tested on SH7264 with CodeSourcery 2011.03 SH2A toolchain.

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


Re: [U-Boot] [PATCH v2 1/3] arm, davinci: Rename AM1808 lowlevel functions to DA850

2011-10-13 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
 Rename arch/arm/cpu/arm926ejs/davinci/am1808_lowlevel.c and
 arch/arm/include/asm/arch-davinci/am1808_lowlevel.h to da850_lowlevel.c
 and da850_lowlevel.h since they apply not only to the AM1808 SoC
 but to all DA850 chips. The function names and #defines are changed
 likewise.
 
 Signed-off-by: Christian Riesch christian.rie...@omicron.at
 Cc: Heiko Schocher h...@denx.de
 Cc: Paulraj Sandeep s-paul...@ti.com
 Cc: Albert ARIBAUD albert.u.b...@aribaud.net
 ---
  arch/arm/cpu/arm926ejs/davinci/Makefile|2 +-
  .../{am1808_lowlevel.c = da850_lowlevel.c}|  136 
 ++--
  .../{am1808_lowlevel.h = da850_lowlevel.h}|   26 ++--
  board/enbw/enbw_cmc/enbw_cmc.c |2 +-
  include/configs/enbw_cmc.h |   92 +++---
  5 files changed, 129 insertions(+), 129 deletions(-)
  rename arch/arm/cpu/arm926ejs/davinci/{am1808_lowlevel.c = 
 da850_lowlevel.c} (70%)
  rename arch/arm/include/asm/arch-davinci/{am1808_lowlevel.h = 
 da850_lowlevel.h} (63%)

Tested on the enbw_cmc board, so:

Acked-by: Heiko Schocher h...@denx.de
Tested-by: Heiko Schocher h...@denx.de

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/3] arm, davinci: Add function lpsc_syncreset()

2011-10-13 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
 This patch adds a function lpsc_syncreset that allows setting a
 lpsc module into Sync Reset state.
 
 Signed-off-by: Christian Riesch christian.rie...@omicron.at
 Cc: Heiko Schocher h...@denx.de
 Cc: Paulraj Sandeep s-paul...@ti.com
 Cc: Albert ARIBAUD albert.u.b...@aribaud.net
 ---
  arch/arm/cpu/arm926ejs/davinci/psc.c |   20 +++-
  arch/arm/include/asm/arch-davinci/hardware.h |2 ++
  2 files changed, 17 insertions(+), 5 deletions(-)

Tested on the enbw_cmc board, so:

Acked-by: Heiko Schocher h...@denx.de
Tested-by: Heiko Schocher h...@denx.de

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/3] arm, davinci: Remove the duplication of LPSC functions in da850_lowlevel.c

2011-10-13 Thread Heiko Schocher
Hello Christian,

Christian Riesch wrote:
 The LPSC functions defined in
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
 are replaced by those already defined in
 arch/arm/cpu/arm926ejs/davinci/psc.c.
 
 Signed-off-by: Christian Riesch christian.rie...@omicron.at
 Cc: Heiko Schocher h...@denx.de
 Cc: Paulraj Sandeep s-paul...@ti.com
 Cc: Albert ARIBAUD albert.u.b...@aribaud.net
 ---
  arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |   96 
 +--
  1 files changed, 4 insertions(+), 92 deletions(-)

Tested on the enbw_cmc board, so:

Acked-by: Heiko Schocher h...@denx.de
Tested-by: Heiko Schocher h...@denx.de

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] AVR32: use generic mmc framework

2011-10-13 Thread Sven Schnelle
On 10/12/2011 04:59 PM, Andreas Bießmann wrote:
 Am 12.10.2011 16:51, schrieb Sven Schnelle:
 On 10/12/2011 04:29 PM, Andreas Bießmann wrote:
 Am 12.10.2011 15:09, schrieb Sven Schnelle:
 And does not work on device:

 b) ext2ls is not reliable:

 ---8---
 U-Boot   ext2ls mmc 0:1
 DIR 1024 .
 DIR 1024 ..
 DIR12288 lost+found
 gen_atmel_mci: CMDR 00051051 (17) ARGR 02008600 (SR: 00400025) Data
 Transfer Failed
** ext2fs_devread read error - last part
 U-Boot
 ---8---
 Hmm, that's really bad. What type of card is this? MMC, SD or SDHC?

 It is SD card (the one delivered with my atstk1002, there is an Atmel
 label on it ;).

 When initialising mmc with old atmel_mci driver I get this:

 ---8---
 U-Boot  mmc init
 Manufacturer ID:   03
 OEM/Application ID:5344
 Product name:  SD128
 Product Revision:  5.8
 Product Serial Number: 8227719
 Manufacturing Date:06/03
 SD Card detected (RCA 58916)
 CSD data: 00260032 1f5983c0 fefa4fff 924040ab
 CSD structure version:   1.0
 MMC System Spec version: 0
 Card command classes:1f5
 Read block length:   512
 Supports partial reads
 Write block length:  512
 Does not support partial writes
 Supports group WP:  32
 Card capacity:125960192 bytes
 File format:0/0
 Write protection:
 mmc: Using 131072 cycles data timeout (DTOR=0x62)
 .mmc1 is available
 ---8---

 best regards

 Andreas Bießmann

I've just tried all SD cards i have here, which are in particular:

Noname 32GB SDHC: works
'PLATINUM' 4GB SDHC: works
Sandisk 2GB SD: works
Sandisk 2GB Micro SD: works

So this seems to be an issue with the specific card - it would be nice 
if you could enable CONFIG_MMC_TRACE, and send me the output.

Regards

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


Re: [U-Boot] [PATCH] AVR32: switch to generic mmc framework

2011-10-13 Thread Andreas Bießmann
Dear Reinhard,
Dear Sven,

Am 12.10.2011 19:01, schrieb Reinhard Meyer:
 Dear Sven Schnelle,
 Hi List,


snip

 As I see it, all this should come as three patches:
 
 1. switching *all* AVR32 and AT91 boards to use the *existing* generic driver
 
 2. removal of the now obsolete legacy driver
 
 3. renaming the existing generic driver into the old legacy name
 (this is a pure cosmetic act)
 
 I would tend to dispute whether 3. is really necessary and beneficial

Now that Reinhard brings this up I would also say the name gen_atmel_mci
is better than atmel_mci here cause it implements the GENERIC_MMC
framework. So I guess it would be best to have again two patches:
 1. switch all AVR32 (and AT91, if there are still some) to
gen_atmel_mci
 2. remove legacy atmel_mci (but no renaming)

But before applying I would like to dig into my issue with the special
card. So maybe do 1) immediately and 2) later, I don't think I will get
the issue til merge window is closed and maybe not until final release
2011.12.

best regards

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


[U-Boot] [PATCH v3] ppc4xx: Add Io64 board support

2011-10-13 Thread Dirk Eibach
Board support for the Guntermann  Drunck Io64.

Signed-off-by: Dirk Eibach eib...@gdsys.de
---
Changes for v2:
  - Added MAINTAINERS entry
  - Cleaned up issues reported by checkpatch
Changes for v3:
  - migrated board specific init_func_fpga() to board_early_init_r()

 MAINTAINERS |1 +
 board/gdsys/405ex/405ex.c   |  250 +
 board/gdsys/405ex/405ex.h   |   10 +
 board/gdsys/405ex/Makefile  |   53 
 board/gdsys/405ex/chip_config.c |   96 +++
 board/gdsys/405ex/io64.c|  380 ++
 board/gdsys/common/Makefile |1 +
 board/gdsys/common/miiphybb.c   |   58 -
 boards.cfg  |1 +
 include/configs/io64.h  |  565 +++
 include/gdsys_fpga.h|   19 ++
 11 files changed, 1426 insertions(+), 8 deletions(-)
 create mode 100644 board/gdsys/405ex/405ex.c
 create mode 100644 board/gdsys/405ex/405ex.h
 create mode 100644 board/gdsys/405ex/Makefile
 create mode 100644 board/gdsys/405ex/chip_config.c
 create mode 100644 board/gdsys/405ex/io64.c
 create mode 100644 include/configs/io64.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 5b2fb57..d872343 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -154,6 +154,7 @@ Dirk Eibach eib...@gdsys.de
gdppc440etx PPC440EP/GR
intip   PPC460EX
io  PPC405EP
+   io64PPC405EX
iocon   PPC405EP
neo PPC405EP
 
diff --git a/board/gdsys/405ex/405ex.c b/board/gdsys/405ex/405ex.c
new file mode 100644
index 000..0d25214
--- /dev/null
+++ b/board/gdsys/405ex/405ex.c
@@ -0,0 +1,250 @@
+#include common.h
+#include asm/ppc4xx.h
+#include asm/ppc405.h
+#include asm/processor.h
+#include asm/io.h
+
+#include gdsys_fpga.h
+
+#include 405ex.h
+
+#define REFLECTION_TESTPATTERN 0xdede
+#define REFLECTION_TESTPATTERN_INV (~REFLECTION_TESTPATTERN  0x)
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int get_fpga_state(unsigned dev)
+{
+   return gd-fpga_state[dev];
+}
+
+void print_fpga_state(unsigned dev)
+{
+   if (gd-fpga_state[dev]  FPGA_STATE_DONE_FAILED)
+   puts(   Waiting for FPGA-DONE timed out.\n);
+   if (gd-fpga_state[dev]  FPGA_STATE_REFLECTION_FAILED)
+   puts(   FPGA reflection test failed.\n);
+}
+
+int board_early_init_f(void)
+{
+   u32 val;
+
+   /*+
+| Interrupt controller setup
+++
+   +-+
+   |Interrupt| Source| Pol.  | Sensi.| Crit. |
+   +-+---+---+---+---+
+   | IRQ 00  | UART0 | High  | Level | Non   |
+   | IRQ 01  | UART1 | High  | Level | Non   |
+   | IRQ 02  | IIC0  | High  | Level | Non   |
+   | IRQ 03  | TBD   | High  | Level | Non   |
+   | IRQ 04  | TBD   | High  | Level | Non   |
+   | IRQ 05  | EBM   | High  | Level | Non   |
+   | IRQ 06  | BGI   | High  | Level | Non   |
+   | IRQ 07  | IIC1  | Rising| Edge  | Non   |
+   | IRQ 08  | SPI   | High  | Lvl/ed| Non   |
+   | IRQ 09  | External IRQ 0 - (PCI-Express)| pgm H | Pgm   | Non   |
+   | IRQ 10  | MAL TX EOB| High  | Level | Non   |
+   | IRQ 11  | MAL RX EOB| High  | Level | Non   |
+   | IRQ 12  | DMA Channel 0 FIFO Full   | High  | Level | Non   |
+   | IRQ 13  | DMA Channel 0 Stat FIFO   | High  | Level | Non   |
+   | IRQ 14  | DMA Channel 1 FIFO Full   | High  | Level | Non   |
+   | IRQ 15  | DMA Channel 1 Stat FIFO   | High  | Level | Non   |
+   | IRQ 16  | PCIE0 AL  | high  | Level | Non   |
+   | IRQ 17  | PCIE0 VPD access  | rising| Edge  | Non   |
+   | IRQ 18  | PCIE0 hot reset request   | rising| Edge  | Non   |
+   | IRQ 19  | PCIE0 hot reset request   | faling| Edge  | Non   |
+   | IRQ 20  | PCIE0 TCR | High  | Level | Non   |
+   | IRQ 21  | PCIE0 MSI level0  | High  | Level | Non   |
+   | IRQ 22  | PCIE0 MSI level1  | High  | Level | Non   |
+   | IRQ 23  | Security EIP-94   | High  | Level | Non   |
+   | IRQ 24  | EMAC0 interrupt   | High  | Level | Non   |
+   | IRQ 25  | EMAC1 interrupt   | High  | Level | Non   |
+   | IRQ 26  | PCIE0 MSI level2  | High  | Level | Non  

Re: [U-Boot] SPL broken for pandaboard with v2011.09?

2011-10-13 Thread Aneesh V
Hi Steve, John,

Sorry for the late reply.

On Thursday 13 October 2011 05:12 AM, Steve Sakoman wrote:
 On Wed, Oct 12, 2011 at 3:23 PM, John Rigbyjohn.ri...@linaro.org  wrote:

 My tree has a bunch of extra patches on top and is based on rc2.  I
 know it works:

 http://git.linaro.org/gitweb?p=boot/u-boot-linaro-stable.git;a=summary

 Very strange - it doesn't work for me :-(

 I build from the above repo, commit 5cb383736d0e26cf85336389e234b5372fb500dd

 I get similar results:

 U-Boot SPL 2011.09-rc2 (Oct 12 2011 - 15:48:01)
 Texas Instruments OMAP4430 ES2.0
 SDRAM: identified size not same as expected size identified: 4
 expected: 4000

 MMC Device 0 not found
 spl: mmc device not found!!
 ### ERROR ### Please RESET the board ###

 X-load builds work just fine on my pandaboard, which is Rev EA1.
 Perhaps it is a board rev issue.

Yes it is. SPL works on everything other than a Panda with OMAP4430
ES2.0. I could reproduce it on an ES2.0 Panda. Please note that an SDP
with OMAP4430 ES2.0 works too, which is rather strange. At the outset,
it looked like a memory issue so I used
CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS, which removed memory check
failure. However, it still fails at the same point. The fact that
Lauterbach is not working on my board is not helping my investigations.
Also, the only ES2.0 Panda I could find here is also being used by
another person. So, I have to time-share it with him. I will try to
investigate it further today as soon as I get the board.

br,
Aneesh


 Steve

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


[U-Boot] Uboot with simpleImage elf.

2011-10-13 Thread Vineeth
Hi,

For this particular project i cant burn more than 1 image in to the flash.
and so i cant use uImage (which needs the DTB file). We were thinking of
burning the simpleImage.elf file (ram image of kernel) ; tweaking uboot such
that it will copy the simpleImage from the flash and put it on 0x40
(link address) ;

things are done..but whenver i try i get a machine check exception. Is it
because kernel trying to access some memory which is used by uboot ?? did
anyone try to boot kernel this way ?

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


Re: [U-Boot] [PATCH v4] net: axi_ethernet: Add driver to u-boot

2011-10-13 Thread Michal Simek
Mike Frysinger wrote:
 Acked-by: Mike Frysinger vap...@gentoo.org
 -mike

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request - emaclite and axi ethernet driver

2011-10-13 Thread Michal Simek
Dear Wolfgang,

I have composed new branch with emaclite changes and axi ethernet driver
(I have got ACK from Mike).

I have 3 more patches in my queue which I am going to send to mailing list for 
review.
They will be based on this tree.

Please pull these changes.

Thanks,
Michal


The following changes since commit d8fffa057c9430fd0c5104ab6ff7db4cdb03db51:
   Wolfgang Denk (1):
 Merge branch 'master' of git://git.denx.de/u-boot-mips

are available in the git repository at:

   git://www.denx.de/git/u-boot-microblaze.git network-drivers

Michal Simek (4):
   net: emaclite: Setup RX/TX ping pong for every instance
   net: emaclite: Use PKTSIZE directly
   net: emaclite: Fix coding style
   net: axi_ethernet: Add driver to u-boot

  drivers/net/Makefile  |1 +
  drivers/net/xilinx_axi_emac.c |  664 +
  drivers/net/xilinx_emaclite.c |  190 ++--
  include/netdev.h  |2 +
  4 files changed, 766 insertions(+), 91 deletions(-)
  create mode 100644 drivers/net/xilinx_axi_emac.c


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 1/2] mx31: make HSP clock for mx3fb driver available

2011-10-13 Thread Anatolij Gustschin
From: Helmut Raiger helmut.rai...@hale.at

This additionally updates mx31/generic.c by
- replacing __REG() macro accesses with readl() and writel()
- providing macros for PDR0 and PLL bit accesses

Signed-off-by: Helmut Raiger helmut.rai...@hale.at
Acked-by: Marek Vasut marek.va...@gmail.com
Signed-off-by: Anatolij Gustschin ag...@denx.de
Cc: Stefano Babic sba...@denx.de
---
Changes since v2:
 - rebased to apply on current top of tree

 arch/arm/cpu/arm1136/mx31/generic.c   |   40 +++-
 arch/arm/include/asm/arch-mx31/clock.h|1 +
 arch/arm/include/asm/arch-mx31/imx-regs.h |   14 ++
 3 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/generic.c 
b/arch/arm/cpu/arm1136/mx31/generic.c
index c6def5d..5524b23 100644
--- a/arch/arm/cpu/arm1136/mx31/generic.c
+++ b/arch/arm/cpu/arm1136/mx31/generic.c
@@ -28,10 +28,10 @@
 
 static u32 mx31_decode_pll(u32 reg, u32 infreq)
 {
-   u32 mfi = (reg  10)  0xf;
-   u32 mfn = reg  0x3ff;
-   u32 mfd = (reg  16)  0x3ff;
-   u32 pd =  (reg  26)  0xf;
+   u32 mfi = GET_PLL_MFI(reg);
+   u32 mfn = GET_PLL_MFN(reg);
+   u32 mfd = GET_PLL_MFD(reg);
+   u32 pd =  GET_PLL_PD(reg);
 
mfi = mfi = 5 ? 5 : mfi;
mfd += 1;
@@ -45,12 +45,12 @@ static u32 mx31_get_mpl_dpdgck_clk(void)
 {
u32 infreq;
 
-   if ((__REG(CCM_CCMR)  CCMR_PRCS_MASK) == CCMR_FPM)
+   if ((readl(CCM_CCMR)  CCMR_PRCS_MASK) == CCMR_FPM)
infreq = CONFIG_MX31_CLK32 * 1024;
else
infreq = CONFIG_MX31_HCLK_FREQ;
 
-   return mx31_decode_pll(__REG(CCM_MPCTL), infreq);
+   return mx31_decode_pll(readl(CCM_MPCTL), infreq);
 }
 
 static u32 mx31_get_mcu_main_clk(void)
@@ -64,10 +64,21 @@ static u32 mx31_get_mcu_main_clk(void)
 static u32 mx31_get_ipg_clk(void)
 {
u32 freq = mx31_get_mcu_main_clk();
-   u32 pdr0 = __REG(CCM_PDR0);
+   u32 pdr0 = readl(CCM_PDR0);
 
-   freq /= ((pdr0  3)  0x7) + 1;
-   freq /= ((pdr0  6)  0x3) + 1;
+   freq /= GET_PDR0_MAX_PODF(pdr0) + 1;
+   freq /= GET_PDR0_IPG_PODF(pdr0) + 1;
+
+   return freq;
+}
+
+/* hsp is the clock for the ipu */
+static u32 mx31_get_hsp_clk(void)
+{
+   u32 freq = mx31_get_mcu_main_clk();
+   u32 pdr0 = readl(CCM_PDR0);
+
+   freq /= GET_PDR0_HSP_PODF(pdr0) + 1;
 
return freq;
 }
@@ -77,6 +88,7 @@ void mx31_dump_clocks(void)
u32 cpufreq = mx31_get_mcu_main_clk();
printf(mx31 cpu clock: %dMHz\n,cpufreq / 100);
printf(ipg clock : %dHz\n, mx31_get_ipg_clk());
+   printf(hsp clock : %dHz\n, mx31_get_hsp_clk());
 }
 
 unsigned int mxc_get_clock(enum mxc_clock clk)
@@ -89,6 +101,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
case MXC_CSPI_CLK:
case MXC_UART_CLK:
return mx31_get_ipg_clk();
+   case MXC_IPU_CLK:
+   return mx31_get_hsp_clk();
}
return -1;
 }
@@ -105,10 +119,10 @@ void mx31_gpio_mux(unsigned long mode)
reg = IOMUXC_BASE + (mode  0x1fc);
shift = (~mode  0x3) * 8;
 
-   tmp = __REG(reg);
+   tmp = readl(reg);
tmp = ~(0xff  shift);
tmp |= ((mode  IOMUX_MODE_POS)  0xff)  shift;
-   __REG(reg) = tmp;
+   writel(tmp, reg);
 }
 
 void mx31_set_pad(enum iomux_pins pin, u32 config)
@@ -119,10 +133,10 @@ void mx31_set_pad(enum iomux_pins pin, u32 config)
reg = (IOMUXC_BASE + 0x154) + (pin + 2) / 3 * 4;
field = (pin + 2) % 3;
 
-   l = __REG(reg);
+   l = readl(reg);
l = ~(0x1ff  (field * 10));
l |= config  (field * 10);
-   __REG(reg) = l;
+   writel(l, reg);
 
 }
 
diff --git a/arch/arm/include/asm/arch-mx31/clock.h 
b/arch/arm/include/asm/arch-mx31/clock.h
index cc99a75..2e3bce2 100644
--- a/arch/arm/include/asm/arch-mx31/clock.h
+++ b/arch/arm/include/asm/arch-mx31/clock.h
@@ -30,6 +30,7 @@ enum mxc_clock {
MXC_IPG_PERCLK,
MXC_CSPI_CLK,
MXC_UART_CLK,
+   MXC_IPU_CLK
 };
 
 unsigned int mxc_get_clock(enum mxc_clock clk);
diff --git a/arch/arm/include/asm/arch-mx31/imx-regs.h 
b/arch/arm/include/asm/arch-mx31/imx-regs.h
index 0dcd9fe..f263e6b 100644
--- a/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -513,6 +513,20 @@ enum iomux_pins {
 #define PLL_MFI(x) (((x)  0xf)  10)
 #define PLL_MFN(x) (((x)  0x3ff)  0)
 
+#define GET_PDR0_CSI_PODF(x)   (((x)  23)  0x1ff)
+#define GET_PDR0_PER_PODF(x)   (((x)  16)  0x1f)
+#define GET_PDR0_HSP_PODF(x)   (((x)  11)  0x7)
+#define GET_PDR0_NFC_PODF(x)   (((x)  8)  0x7)
+#define GET_PDR0_IPG_PODF(x)   (((x)  6)  0x3)
+#define GET_PDR0_MAX_PODF(x)   (((x)  3)  0x7)
+#define GET_PDR0_MCU_PODF(x)   ((x)  0x7)
+
+#define GET_PLL_PD(x)  (((x)  26)  0xf)
+#define GET_PLL_MFD(x) (((x)  16)  0x3ff)
+#define GET_PLL_MFI(x) (((x)  10)  0xf)
+#define GET_PLL_MFN(x) 

[U-Boot] [PATCH v3 2/2] video: Moving mx3fb.c to CONFIG_VIDEO

2011-10-13 Thread Anatolij Gustschin
From: Helmut Raiger helmut.rai...@hale.at

mx3fb.c was based on CONFIG_LCD and is moved by this patch to
CONFIG_VIDEO, which has greater freedom in selecting videomodes
even at runtime.

This renders the accumulating list of display defines
(CONFIG_DISPLAY_VBEST..., CONFIG_DISPLAY_C057...) obsolete as
these may be setup through env variables:

uboot setenv mydisplay 'video=ctfb:x:240,y:320,depth:16,mode:0,pclk:185925,
le:9,ri:17,up:7,lo:10,hs:1,vs:1,sync:100663296,vmode:0'
uboot setenv videomode ${mydisplay}

This commit also fixes the board config files for qong and
imx31_phycore boards as needed. The videomode settings of
previously supported displays are added to CONFIG_EXTRA_ENV_SETTINGS
now. CONFIG_SYS_MALLOC_LEN for imx31_phycore board is increased
to make the frame buffer allocation working with the changed
driver.

Signed-off-by: Helmut Raiger helmut.rai...@hale.at
Signed-off-by: Anatolij Gustschin ag...@denx.de
Cc: Stefano Babic sba...@denx.de
---
Changes since v2:
 - fixed commit message
 - added display info for removed display timings of
   previously supported displays (in a comment)
 - fixed compiler warning showed when compiling with debug
   enabled
 - added Video:  prefix before display info output (as
   we usually do it in U-Boot)
 - fixed board config files for 'qong' and 'imx31_phycore' boards
   so that this commit doesn't break compiling (bisectable now)
 - added videomode settings for previously supported displays on
   'qong' and 'imx31_phycore' to CONFIG_EXTRA_ENV_SETTINGS
 - increased CONFIG_SYS_MALLOC_LEN for 'imx31_phycore' so that
   the frame buffer can be allocated now (this is required to make
   the display support working with the changed mx3fb driver)

 drivers/video/Makefile  |2 +-
 drivers/video/cfb_console.c |7 +
 drivers/video/mx3fb.c   |  459 +++
 include/configs/imx31_phycore.h |   24 +-
 include/configs/qong.h  |   14 +-
 5 files changed, 297 insertions(+), 209 deletions(-)

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 3790f91..ecc1896 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -35,7 +35,7 @@ COBJS-$(CONFIG_VIDEO_AMBA) += amba.o
 COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
 COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o
 COBJS-$(CONFIG_VIDEO_MB86R0xGDC) += mb86r0xgdc.o videomodes.o
-COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o
+COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o videomodes.o
 COBJS-$(CONFIG_VIDEO_MX5) += mxc_ipuv3_fb.o ipu_common.o ipu_disp.o
 COBJS-$(CONFIG_VIDEO_OMAP3) += omap3_dss.o videomodes.o
 COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 3a93b64..4e653b8 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -161,6 +161,13 @@
 #endif
 
 /*
+ * Defines for the i.MX31 driver (mx3fb.c)
+ */
+#ifdef CONFIG_VIDEO_MX3
+#define VIDEO_FB_16BPP_WORD_SWAP
+#endif
+
+/*
  * Include video_fb.h after definitions of VIDEO_HW_RECTFILL etc.
  */
 #include video_fb.h
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 0c925a0..f30deb3 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -1,6 +1,8 @@
 /*
  * Copyright (C) 2009
  * Guennadi Liakhovetski, DENX Software Engineering, l...@denx.de
+ * Copyright (C) 2011
+ * HALE electronic GmbH, helmut.rai...@hale.at
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,100 +23,20 @@
  * MA 02111-1307 USA
  */
 #include common.h
-#include lcd.h
-#include asm/arch/clock.h
+#include malloc.h
+#include video_fb.h
+
 #include asm/arch/imx-regs.h
+#include asm/arch/clock.h
 #include asm/errno.h
+#include asm/io.h
 
-DECLARE_GLOBAL_DATA_PTR;
-
-void *lcd_base;/* Start of framebuffer memory  */
-void *lcd_console_address; /* Start of console buffer  */
-
-int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
-
-short console_col;
-short console_row;
-
-void lcd_initcolregs(void)
-{
-}
-
-void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
-{
-}
-
-void lcd_disable(void)
-{
-}
-
-void lcd_panel_disable(void)
-{
-}
+#include videomodes.h
 
-#define msleep(a) udelay(a * 1000)
-
-#if defined(CONFIG_DISPLAY_VBEST_VGG322403)
-#define XRES   320
-#define YRES   240
-#define PANEL_TYPE IPU_PANEL_TFT
-#define PIXEL_CLK  156000
-#define PIXEL_FMT  IPU_PIX_FMT_RGB666
-#define H_START_WIDTH  20  /* left_margin */
-#define H_SYNC_WIDTH   30  /* hsync_len */
-#define H_END_WIDTH(38 + 30)   /* right_margin + hsync_len */
-#define V_START_WIDTH  7   /* upper_margin */
-#define V_SYNC_WIDTH   3   /* vsync_len */
-#define V_END_WIDTH(26 + 3)/* lower_margin + vsync_len */
-#define SIG_POL(DI_D3_DRDY_SHARP_POL | DI_D3_CLK_POL)
+/* this might need panel specific set-up as-well */
 #define 

[U-Boot] [PATCH 0/3] Microblaze/Xilinx network driver changes

2011-10-13 Thread Michal Simek
Hi,

The patches are based on 
git://git.denx.de/u-boot-microblaze.git network-drivers branch.

Thanks for your review.

Thanks,
Michal

Michal Simek (3):
  net: emaclite: Use unsigned long for baseaddr
  net: emaclite: Move RX/TX ping pong initialization to board
  microblaze: Wire up axi_ethernet driver initialization

 .../xilinx/microblaze-generic/microblaze-generic.c |   24 +++-
 drivers/net/xilinx_emaclite.c  |   13 --
 include/configs/microblaze-generic.h   |4 +++
 include/netdev.h   |3 +-
 4 files changed, 29 insertions(+), 15 deletions(-)

-- 
1.7.5.4

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


[U-Boot] [PATCH 1/3 v2] net: emaclite: Use unsigned long for baseaddr

2011-10-13 Thread Michal Simek
Baseaddr should be unsigned long.

Signed-off-by: Michal Simek mon...@monstr.eu

---
v2: Fix merge confict - no function change
---
 drivers/net/xilinx_emaclite.c |4 ++--
 include/netdev.h  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index bb4fb01..ac3dae1 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -342,7 +342,7 @@ static int emaclite_recv(struct eth_device *dev)
 
 }
 
-int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
+int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr)
 {
struct eth_device *dev;
struct xemaclite *emaclite;
@@ -366,7 +366,7 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
emaclite-rxpp = 1;
 #endif
 
-   sprintf(dev-name, Xelite.%x, base_addr);
+   sprintf(dev-name, Xelite.%lx, base_addr);
 
dev-iobase = base_addr;
dev-init = emaclite_init;
diff --git a/include/netdev.h b/include/netdev.h
index 669f60b..a624677 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -97,7 +97,7 @@ int uli526x_initialize(bd_t *bis);
 int armada100_fec_register(unsigned long base_addr);
 int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
unsigned long dma_addr);
-int xilinx_emaclite_initialize (bd_t *bis, int base_addr);
+int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr);
 
 /* Boards with PCI network controllers can call this from their 
board_eth_init()
  * function to initialize whatever's on board.
-- 
1.7.5.4

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


[U-Boot] [PATCH 2/3 v2] net: emaclite: Move RX/TX ping pong initialization to

2011-10-13 Thread Michal Simek
Init RX/TX ping pong directly from board not in the driver.

Signed-off-by: Michal Simek mon...@monstr.eu

---
v2: Fix merge confict - no function change
---
 .../xilinx/microblaze-generic/microblaze-generic.c |   18 --
 drivers/net/xilinx_emaclite.c  |   11 ---
 include/netdev.h   |3 ++-
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c 
b/board/xilinx/microblaze-generic/microblaze-generic.c
index 183e4dc..9b2952f 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -71,12 +71,18 @@ int fsl_init2 (void) {
 
 int board_eth_init(bd_t *bis)
 {
-   /*
-* This board either has PCI NICs or uses the CPU's TSECs
-* pci_eth_init() will return 0 if no NICs found, so in that case
-* returning -1 will force cpu_eth_init() to be called.
-*/
+   int ret = 0;
 #ifdef CONFIG_XILINX_EMACLITE
-   return xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR);
+   u32 txpp = 0;
+   u32 rxpp = 0;
+# ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
+   txpp = 1;
+# endif
+# ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
+   rxpp = 1;
+# endif
+   ret |= xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR,
+   txpp, rxpp);
 #endif
+   return ret;
 }
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index ac3dae1..9791b9a 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -342,7 +342,8 @@ static int emaclite_recv(struct eth_device *dev)
 
 }
 
-int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr)
+int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
+   int txpp, int rxpp)
 {
struct eth_device *dev;
struct xemaclite *emaclite;
@@ -359,12 +360,8 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long 
base_addr)
 
dev-priv = emaclite;
 
-#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
-   emaclite-txpp = 1;
-#endif
-#ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
-   emaclite-rxpp = 1;
-#endif
+   emaclite-txpp = txpp;
+   emaclite-rxpp = rxpp;
 
sprintf(dev-name, Xelite.%lx, base_addr);
 
diff --git a/include/netdev.h b/include/netdev.h
index a624677..54b52a5 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -97,7 +97,8 @@ int uli526x_initialize(bd_t *bis);
 int armada100_fec_register(unsigned long base_addr);
 int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
unsigned long dma_addr);
-int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr);
+int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
+   int txpp, int rxpp);
 
 /* Boards with PCI network controllers can call this from their 
board_eth_init()
  * function to initialize whatever's on board.
-- 
1.7.5.4

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


[U-Boot] [PATCH 3/3] microblaze: Wire up axi_ethernet driver initialization

2011-10-13 Thread Michal Simek
Initialize axi_ethernet driver.

Signed-off-by: Michal Simek mon...@monstr.eu
---
 .../xilinx/microblaze-generic/microblaze-generic.c |6 ++
 include/configs/microblaze-generic.h   |4 
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c 
b/board/xilinx/microblaze-generic/microblaze-generic.c
index 9b2952f..c4c13a6 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -72,6 +72,12 @@ int fsl_init2 (void) {
 int board_eth_init(bd_t *bis)
 {
int ret = 0;
+
+#ifdef CONFIG_XILINX_AXIEMAC
+   ret |= xilinx_axiemac_initialize(bis, XILINX_AXIEMAC_BASEADDR,
+   XILINX_AXIDMA_BASEADDR);
+#endif
+
 #ifdef CONFIG_XILINX_EMACLITE
u32 txpp = 0;
u32 rxpp = 0;
diff --git a/include/configs/microblaze-generic.h 
b/include/configs/microblaze-generic.h
index 09ff7c4..6b3fd76 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -68,6 +68,10 @@
 # define CONFIG_XILINX_LL_TEMAC1
 # define CONFIG_SYS_ENET
 #endif
+#if defined(XILINX_AXIEMAC_BASEADDR)
+# define CONFIG_XILINX_AXIEMAC 1
+# define CONFIG_SYS_ENET
+#endif
 
 #undef ET_DEBUG
 
-- 
1.7.5.4

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


Re: [U-Boot] [PATCH v3 1/2] mx31: make HSP clock for mx3fb driver available

2011-10-13 Thread Anatolij Gustschin
Hi Stefano,

On Thu, 13 Oct 2011 11:16:28 +0200
Anatolij Gustschin ag...@denx.de wrote:

 From: Helmut Raiger helmut.rai...@hale.at
 
 This additionally updates mx31/generic.c by
 - replacing __REG() macro accesses with readl() and writel()
 - providing macros for PDR0 and PLL bit accesses
 
 Signed-off-by: Helmut Raiger helmut.rai...@hale.at
 Acked-by: Marek Vasut marek.va...@gmail.com
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 Cc: Stefano Babic sba...@denx.de
 ---
 Changes since v2:
  - rebased to apply on current top of tree
 
  arch/arm/cpu/arm1136/mx31/generic.c   |   40 +++-
  arch/arm/include/asm/arch-mx31/clock.h|1 +
  arch/arm/include/asm/arch-mx31/imx-regs.h |   14 ++
  3 files changed, 42 insertions(+), 13 deletions(-)

Are you okay with this patch? Should I queue it with another
(video: Moving mx3fb.c to CONFIG_VIDEO) patch in my video tree?

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


[U-Boot] hwmon: problems with fan control

2011-10-13 Thread Eibach, Dirk

Commit 780f13a... hwmon: do not init sensors on startup moved
initialization of the dtt driver to cmd_dtt.
I just realized that this means trouble for me, because the lm63 driver
used on our boards is responsible for setting up the fans. Relying on
cmd_dtt being called by preboot seems fragile to me. The vision of
molten FPGAs makes me shudder.
What would be the right way (tm) to solve this? Should I strip the fan
initialization from dtt_init_one()? Should I call dtt_init_one() form
board bootcode? Other ideas welcome.

Cheers
Dirk


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


Re: [U-Boot] [PATCH v3 1/2] mx31: make HSP clock for mx3fb driver available

2011-10-13 Thread Stefano Babic
On 10/13/2011 11:23 AM, Anatolij Gustschin wrote:
 Hi Stefano,
 
 On Thu, 13 Oct 2011 11:16:28 +0200
 Anatolij Gustschin ag...@denx.de wrote:
 
 From: Helmut Raiger helmut.rai...@hale.at

 This additionally updates mx31/generic.c by
 - replacing __REG() macro accesses with readl() and writel()
 - providing macros for PDR0 and PLL bit accesses

 Signed-off-by: Helmut Raiger helmut.rai...@hale.at
 Acked-by: Marek Vasut marek.va...@gmail.com
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 Cc: Stefano Babic sba...@denx.de
 ---
 Changes since v2:
  - rebased to apply on current top of tree

  arch/arm/cpu/arm1136/mx31/generic.c   |   40 
 +++-
  arch/arm/include/asm/arch-mx31/clock.h|1 +
  arch/arm/include/asm/arch-mx31/imx-regs.h |   14 ++
  3 files changed, 42 insertions(+), 13 deletions(-)
 
 Are you okay with this patch?

Yes, they are ok - if not yet sent, here my:

Acked-by: Stefano Babic sba...@denx.de


 Should I queue it with another
 (video: Moving mx3fb.c to CONFIG_VIDEO) patch in my video tree?

Yes, they belong together - we should assure that all three goes to
mainline in the same shot.

Thanks,
Stefano

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


Re: [U-Boot] [PATCH] sparc: fix unknown escape sequence warnings

2011-10-13 Thread Daniel Hellstrom

On 10/13/2011 07:47 AM, Mike Frysinger wrote:
 I don't know what exactly the code was going for, but the object code
 is the same before/after my change, and in looking at the env strings,
 this seems to be OK.

 Otherwise gcc warns:
 cc1: warning: unknown escape sequence: '\$'
 cc1: warning: unknown escape sequence: '\)'
 cc1: warning: unknown escape sequence: '\040'
 cc1: warning: unknown escape sequence: '\$'
 cc1: warning: unknown escape sequence: '\)'

Thanks for fixing this. Do you want me to run it through the sparc repository 
or should Wolfgang take the two patches right away?

Daniel

 Signed-off-by: Mike Frysingervap...@gentoo.org
 ---
   include/configs/gr_cpci_ax2000.h |2 +-
   include/configs/gr_ep2s60.h  |2 +-
   include/configs/gr_xc3s_1500.h   |2 +-
   include/configs/grsim.h  |2 +-
   include/configs/grsim_leon2.h|2 +-
   5 files changed, 5 insertions(+), 5 deletions(-)

 diff --git a/include/configs/gr_cpci_ax2000.h 
 b/include/configs/gr_cpci_ax2000.h
 index a127a2b..992aea5 100644
 --- a/include/configs/gr_cpci_ax2000.h
 +++ b/include/configs/gr_cpci_ax2000.h
 @@ -108,7 +108,7 @@
   bootm ${kernel_addr}\0\
   flash_self=run ramargs addip; \
   bootm ${kernel_addr} ${ramdisk_addr}\0\
 - getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0 \
 + getkernel=tftpboot $(scratch) $(bootfile)\0 \
   bootargs=console=ttyS0,38400 root=/dev/nfs rw 
 nfsroot=192.168.0.20:/export/rootfs 
 ip=192.168.0.206:192.168.0.20:192.168.0.1:255.255.255.0:ax2000:eth0\0

   #if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SRAM
 diff --git a/include/configs/gr_ep2s60.h b/include/configs/gr_ep2s60.h
 index 643efc4..d1fcf3b 100644
 --- a/include/configs/gr_ep2s60.h
 +++ b/include/configs/gr_ep2s60.h
 @@ -115,7 +115,7 @@
   bootm ${kernel_addr} ${ramdisk_addr}\0\
   net_nfs=tftp 4000 ${bootfile};run nfsargs addip;bootm\0   \
   scratch=4080\0\
 - getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0 \
 + getkernel=tftpboot $(scratch) $(bootfile)\0 \
   bootargs=console=ttyS0,38400 root=/dev/nfs rw 
 nfsroot=192.168.0.20:/export/rootfs 
 ip=192.168.0.207:192.168.0.20:192.168.0.1:255.255.255.0:ml401:eth0\0 \
   

 diff --git a/include/configs/gr_xc3s_1500.h b/include/configs/gr_xc3s_1500.h
 index e13299e..1d804f8 100644
 --- a/include/configs/gr_xc3s_1500.h
 +++ b/include/configs/gr_xc3s_1500.h
 @@ -91,7 +91,7 @@
   bootm ${kernel_addr} ${ramdisk_addr}\0\
   net_nfs=tftp 4000 ${bootfile};run nfsargs addip;bootm\0   \
   scratch=4020\0\
 - getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0 \
 + getkernel=tftpboot $(scratch) $(bootfile)\0 \
   bootargs=console=ttyS0,38400 root=/dev/nfs rw 
 nfsroot=192.168.0.20:/export/rootfs 
 ip=192.168.0.206:192.168.0.20:192.168.0.1:255.255.255.0:grxc3s1500_daniel:eth0\0
  \
   

 diff --git a/include/configs/grsim.h b/include/configs/grsim.h
 index f868d96..73bd494 100644
 --- a/include/configs/grsim.h
 +++ b/include/configs/grsim.h
 @@ -113,7 +113,7 @@
   net_nfs=tftp 4000 ${bootfile};run nfsargs addip;bootm\0   \
   rootpath=/export/roofs\0  \
   scratch=4000\0\
 - getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0 \
 + getkernel=tftpboot $(scratch) $(bootfile)\0 \
   ethaddr=00:00:7A:CC:00:12\0 \
   bootargs=console=ttyS0,38400 \
   
 diff --git a/include/configs/grsim_leon2.h b/include/configs/grsim_leon2.h
 index ed1008f..75e9605 100644
 --- a/include/configs/grsim_leon2.h
 +++ b/include/configs/grsim_leon2.h
 @@ -110,7 +110,7 @@
   net_nfs=tftp 4000 ${bootfile};run nfsargs addip;bootm\0   \
   rootpath=/export/roofs\0  \
   scratch=4000\0\
 - getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0 \
 + getkernel=tftpboot $(scratch) $(bootfile)\0 \
   ethaddr=00:00:7A:CC:00:12\0 \
   bootargs=console=ttyS0,38400 \
   

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


Re: [U-Boot] [PATCH] avr32: fix timer_init() return type

2011-10-13 Thread Reinhard Meyer
Dear Andreas Bießmann,
  if (set_interrupt_handler(0, timer_interrupt_handler, 3))
 -return;
 +return 0;
 
 NAK, this is an error and should return a negative value (though the
 return value is currently not evaluated).

Agreed

 
 BTW there is another patch pending -
 http://patchwork.ozlabs.org/patch/117688/

I'll apply that one in the year 2015 ;)

NO.. its on my list for applying into next

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


[U-Boot] [PATCH v3] da850evm: Move LPSC configuration to board_early_init_f()

2011-10-13 Thread Christian Riesch
Since commit f1d2b313c9eb6808d30c16a9eb5251240452a56c the serial
port of the da850evm is accessed before the UART2 peripheral of
the SoC is powered on in the function board_init() in
board/davinci/da8xxevm/da850evm.c.

When u-boot is used in conjunction with the UBL (user boot loader, see
doc/README.davinci) on this board, the UART2 peripheral is already
turned on by UBL at the time u-boot is started. Hence, the wrong
initialization sequence is not noticed by most users. However, if UBL is not
used, u-boot must power on the peripheral before using it.

This patch adds a board_early_init_f() function for the LPSC
configuration to the da850evm board configuration.

Signed-off-by: Christian Riesch christian.rie...@omicron.at
Cc: Sudhakar Rajashekhara sudhakar@ti.com
Cc: Sandeep Paulraj s-paul...@ti.com
Cc: Heiko Schocher h...@denx.de
Cc: Ben Gardiner bengardi...@nanometrics.ca
---

Changes for v3:
- rebased

Changes for v2: 
- rebased

Hello Sudhakar Rajashekhara and Sandeep Paulraj,
I did not get any comments about this patch, can you please comment on it/
apply it?

I understand that most people use u-boot on the da850evm in conjunction
with the UBL and so this patch is rather unimportant to them. UBL will
initialize the LPSC and the wrong initialization sequence in u-boot will
not be noticed. But I think this should be corrected nevertheless and it
also helps people like me who are not using the UBL.

Regards, Christian

 board/davinci/da8xxevm/da850evm.c |   23 ++-
 include/configs/da850evm.h|1 +
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 46924d3..e0a3bbe 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -278,6 +278,20 @@ u32 get_board_rev(void)
return rev;
 }
 
+int board_early_init_f(void)
+{
+   /*
+* Power on required peripherals
+* ARM does not have access by default to PSC0 and PSC1
+* assuming here that the DSP bootloader has set the IOPU
+* such that PSC access is available to ARM
+*/
+   if (da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
+   return 1;
+
+   return 0;
+}
+
 int board_init(void)
 {
 #ifdef CONFIG_USE_NOR
@@ -310,15 +324,6 @@ int board_init(void)
/* address of boot parameters */
gd-bd-bi_boot_params = LINUX_BOOT_PARAM_ADDR;
 
-   /*
-* Power on required peripherals
-* ARM does not have access by default to PSC0 and PSC1
-* assuming here that the DSP bootloader has set the IOPU
-* such that PSC access is available to ARM
-*/
-   if (da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
-   return 1;
-
/* setup the SUSPSRC for ARM to control emulation suspend */
writel(readl(davinci_syscfg_regs-suspsrc) 
   ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index cad5620..b4e4890 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -160,6 +160,7 @@
  * U-Boot general configuration
  */
 #define CONFIG_MISC_INIT_R
+#define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_BOOTFILEuImage /* Boot file name */
 #define CONFIG_SYS_PROMPT  U-Boot   /* Command Prompt */
 #define CONFIG_SYS_CBSIZE  1024 /* Console I/O Buffer Size */
-- 
1.7.0.4

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


Re: [U-Boot] sparc and .udiv/.rem/.urem/.umul/etc... link errors

2011-10-13 Thread Daniel Hellstrom
On 10/13/2011 07:33 AM, Mike Frysinger wrote:
 it seems that these symbols are usually implemented in the C library on sparc
 systems, but under u-boot, we don't have that luxury.  Linux itself simply
 imports the relevant asm files from glibc into their lib subdir.  without
 these, building u-boot for sparc targets with sparc linux compilers fail.  any
 desire to make this work ?  or just continue to force everyone to install a
 dedicated sparc-elf compiler ?
 -mike

The .udiv/.rem ... functions are implemented by libgcc, an suggested 
implementation is given in the SPARCv8 Appendix E. The functions are needed 
when compiling for SPARCv7 CPUs which doesn't have a 
hardware multiplier/divider instead they are implemented in software, SPARCv8 
CPUs have multiplier/divider in hardware so .mul/.rem etc is not needed. One 
can switch between V7 or V8 compatible code 
by adding -mv8 (GCC 3.4.4 or earlier) or -mcpu=v8 (in newer GCC). Sparc-linux 
toolchains will generate ELF binaries for Linux, that is not what we want?

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


Re: [U-Boot] [PATCH v3] DaVinci: correct MDSTAT.STATE mask

2011-10-13 Thread Christian Riesch
Hi,

On Fri, Sep 23, 2011 at 4:29 PM, Sergei Shtylyov
sshtyl...@ru.mvista.com wrote:
 MDSTAT.STATE occupies bits 0..5 according to all available documentation, so 
 fix
 the mask which previously was leaving out the intermediate state indicator 
 bit.

 While at it, introduce two #define's for that mask -- unfortunately, we can't
 use a single #define as the assembly code can't include asm/arch/hardware.h
 due to C-specfic constructs in it.

 Signed-off-by: Sergei Shtylyov sshtyl...@ru.mvista.com

 ---
  arch/arm/cpu/arm926ejs/davinci/lowlevel_init.S |    8 +---
  arch/arm/cpu/arm926ejs/davinci/psc.c           |    4 ++--
  arch/arm/include/asm/arch-davinci/hardware.h   |    2 ++
  3 files changed, 9 insertions(+), 5 deletions(-)

What's the state of this patch? Could this be merged please? Thank you!
Regards, Christian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/1] pci: move pcidelay code to new location just before PCI bus scan

2011-10-13 Thread Matthias Fuchs
On 12.10.2011 10:44, Anatolij Gustschin wrote:
 PCI cards might need some time after reset to respond. On some
 boards (mpc5200 or mpc8260 based) the PCI bus reset is deasserted
 at pci_init_board() time, so we currently can not use available
 pcidelay option for waiting before PCI bus scan since this
 waiting takes place before calling pci_init_board(). By moving
 the pcidelay code to the new location using of the pcidelay
 option is possible on mpc5200 or mpc8260 based boards, too.
 
 Since pci_hose_scan() could be called multiple times, restrict
 the function to wait only during its first call and to ignore
 pcidelay for any further call (as pointed out by Matthias).
 
 Signed-off-by: Anatolij Gustschin ag...@denx.de
 Cc: Matthias Fuchs matthias.fu...@esd.eu
 ---
 Changes since first version:
  - extend to wait only during initial pci_hose_scan() call
as pointed out by Matthias

Tested on PMC440. Works fine.

Acked-by: Matthias Fuchs matthias.fu...@esd.eu


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


Re: [U-Boot] [PATCH v2 1/1] pci: move pcidelay code to new location just before PCI bus scan

2011-10-13 Thread Stefan Roese
On Thursday 13 October 2011 14:50:02 Matthias Fuchs wrote:
 On 12.10.2011 10:44, Anatolij Gustschin wrote:
  PCI cards might need some time after reset to respond. On some
  boards (mpc5200 or mpc8260 based) the PCI bus reset is deasserted
  at pci_init_board() time, so we currently can not use available
  pcidelay option for waiting before PCI bus scan since this
  waiting takes place before calling pci_init_board(). By moving
  the pcidelay code to the new location using of the pcidelay
  option is possible on mpc5200 or mpc8260 based boards, too.
  
  Since pci_hose_scan() could be called multiple times, restrict
  the function to wait only during its first call and to ignore
  pcidelay for any further call (as pointed out by Matthias).
  
  Signed-off-by: Anatolij Gustschin ag...@denx.de
  Cc: Matthias Fuchs matthias.fu...@esd.eu
  ---
  
  Changes since first version:
   - extend to wait only during initial pci_hose_scan() call
   
 as pointed out by Matthias
 
 Tested on PMC440. Works fine.
 
 Acked-by: Matthias Fuchs matthias.fu...@esd.eu

Thanks. In this case a:

Tested-by: ...

would be even better. :)

Thanks,
Stefan

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


[U-Boot] [PATCH 3/3] ppc4xx: fix PMC440 painit command

2011-10-13 Thread matthias . fuchs
From: Matthias Fuchs matthias.fu...@esd.eu

This patch fixes the PMC440 BSP command painit. The implementation was
broken since the step to the new environment handling.

Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu
---
 board/esd/pmc440/cmd_pmc440.c |   17 +++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c
index 200d7ee..3bcf2b0 100644
--- a/board/esd/pmc440/cmd_pmc440.c
+++ b/board/esd/pmc440/cmd_pmc440.c
@@ -342,7 +342,8 @@ U_BOOT_CMD(
 
 #if defined(CONFIG_PRAM)
 #include environment.h
-extern env_t *env_ptr;
+#include search.h
+#include errno.h
 
 int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
@@ -351,6 +352,10 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
u32 param;
ulong *lptr;
 
+   env_t *envp;
+   char *res;
+   int len;
+
v = getenv(pram);
if (v)
pram = simple_strtoul(v, NULL, 10);
@@ -384,7 +389,15 @@ int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 
/* env is first (4k aligned) */
nextbase -= ((CONFIG_ENV_SIZE + 4096 - 1)  ~(4096 - 1));
-   memcpy((void*)nextbase, env_ptr, CONFIG_ENV_SIZE);
+   envp = (env_t *)nextbase;
+   res = (char *)envp-data;
+   len = hexport_r(env_htab, '\0', res, ENV_SIZE);
+if (len  0) {
+error(Cannot export environment: errno = %d\n, errno);
+return 1;
+}
+   envp-crc = crc32(0, envp-data, ENV_SIZE);
+
*(--lptr) = CONFIG_ENV_SIZE; /* size */
*(--lptr) = base - nextbase;  /* offset | type=0 */
 
-- 
1.6.1

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


[U-Boot] [PATCH 2/3] ppc4xx: remove invalid access to PCI_BRDGOPT2 register

2011-10-13 Thread matthias . fuchs
From: Matthias Fuchs matthias.fu...@esd.eu

This patch removes an invalid call to pci_write_config_dword to
PCI_BRDGOPT2 register. This function must not be used from pci_target_init
and is also at the wrong place. The correct call is done later in
pci_target_init via pci_hose_write_config_dword.

Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu
---
 board/esd/pmc440/pmc440.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/board/esd/pmc440/pmc440.c b/board/esd/pmc440/pmc440.c
index 0d56064..3713e37 100644
--- a/board/esd/pmc440/pmc440.c
+++ b/board/esd/pmc440/pmc440.c
@@ -574,8 +574,6 @@ void pci_target_init(struct pci_controller *hose)
/* No error reporting */
pci_hose_write_config_word(hose, 0, PCI_ERREN, 0);
 
-   pci_write_config_dword(0, PCI_BRDGOPT2, 0x0101);
-
if (!is_monarch()) {
/* Program the board's subsystem id/classcode */
pci_hose_write_config_word(hose, 0, PCI_SUBSYSTEM_ID,
-- 
1.6.1

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


Re: [U-Boot] [PATCH v2 1/3] davinci: emac: add new features to autonegotiate for EMAC

2011-10-13 Thread Hadli, Manjunath
Hi Mike,

On Wed, Oct 12, 2011 at 20:39:29, Mike Frysinger wrote:
 On Wednesday 12 October 2011 09:27:59 manjunath.ha...@ti.com wrote:
  --- a/include/miiphy.h
  +++ b/include/miiphy.h
 
 NAK to all of these changes.  you should be migrating to linux/mii.h.  we've 
 gone through a lot of trouble to scrub miiphy.h and re-introducing defines is 
 unacceptable.
Thank you for the comment. I will fix it.

Regards
-manju
 -mike
 

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


Re: [U-Boot] [PATCH v2 1/1] pci: move pcidelay code to new location just before PCI bus scan

2011-10-13 Thread Matthias Fuchs
On 13.10.2011 15:03, Stefan Roese wrote:

 Tested on PMC440. Works fine.

 Acked-by: Matthias Fuchs matthias.fu...@esd.eu
 
 Thanks. In this case a:
 
 Tested-by: ...
 
 would be even better. :)
 
Even both if you like :-)

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


[U-Boot] [PATCH 1/3] ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation

2011-10-13 Thread matthias . fuchs
From: Matthias Fuchs matthias.fu...@esd.eu

This patch switches PMC440 board code to the CONFIG_PCI_BOOTDELAY option
instead of using a private implemention. This relies on Anatolji's patch
that moves the pcidelay handling behind pci_target_init.

Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu
---
 board/esd/pmc440/pmc440.c |   15 ---
 include/configs/PMC440.h  |2 ++
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/board/esd/pmc440/pmc440.c b/board/esd/pmc440/pmc440.c
index 5236f44..0d56064 100644
--- a/board/esd/pmc440/pmc440.c
+++ b/board/esd/pmc440/pmc440.c
@@ -617,21 +617,6 @@ void pci_master_init(struct pci_controller *hose)
 
 static void wait_for_pci_ready(void)
 {
-   int i;
-   char *s = getenv(pcidelay);
-   /*
-* We have our own handling of the pcidelay variable.
-* Using CONFIG_PCI_BOOTDELAY enables pausing for host
-* and adapter devices. For adapter devices we do not
-* want this.
-*/
-   if (s) {
-   int ms = simple_strtoul(s, NULL, 10);
-   printf(PCI:   Waiting for %d ms\n, ms);
-   for (i=0; ims; i++)
-   udelay(1000);
-   }
-
if (!(in_be32((void*)GPIO1_IR)  GPIO1_PPC_EREADY)) {
printf(PCI:   Waiting for EREADY (CTRL-C to skip) ... );
while (1) {
diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h
index bee74aa..ed47a87 100644
--- a/include/configs/PMC440.h
+++ b/include/configs/PMC440.h
@@ -432,6 +432,8 @@
 #define CONFIG_SYS_PCI_MASTER_INIT
 #define CONFIG_SYS_PCI_BOARD_FIXUP_IRQ
 
+#define CONFIG_PCI_BOOTDELAY 0
+
 /* PCI identification */
 #define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x12FE  /* PCI Vendor ID: esd gmbh  
*/
 #define CONFIG_SYS_PCI_SUBSYS_ID_NONMONARCH 0x0441 /* PCI Device ID: 
Non-Monarch */
-- 
1.6.1

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


[U-Boot] [PATCH v3 0/3] These patches add features relating davinci emac driver.

2011-10-13 Thread manjunath.hadli
From: Manjunath Hadli manjunath.ha...@ti.com

Changes for revision v2:
1: Used a #define for maximum number of phy's as
   suggested by Laurence.
2: Dropped a patch, da830: emac: add support for RMII,
   it has some issues, Will come back with this patch soon.
3: fixed checkpatch warnings.

Changes for revision v3:
1: migrating to linux/mii.h as suggested by Mike

Manjunath Hadli (3):
  davinci: emac: add new features to autonegotiate for EMAC
  davinci: emac: add support for more than 1 PHYs
  davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUM

 arch/arm/cpu/arm926ejs/davinci/et1011c.c  |6 +-
 arch/arm/include/asm/arch-davinci/emac_defs.h |4 -
 drivers/net/davinci_emac.c|  209 -
 include/configs/da830evm.h|1 -
 include/configs/da850_am18xevm.h  |1 -
 include/configs/da850_l138evm.h   |1 -
 include/configs/davinci_dm365evm.h|1 -
 include/configs/davinci_dm6467Tevm.h  |1 -
 include/configs/davinci_dm6467evm.h   |1 -
 include/configs/davinci_dvevm.h   |1 -
 include/configs/davinci_schmoogie.h   |1 -
 include/configs/davinci_sffsdr.h  |1 -
 include/configs/davinci_sonata.h  |1 -
 include/configs/ea20.h|1 -
 include/configs/hawkboard.h   |1 -
 15 files changed, 137 insertions(+), 94 deletions(-)

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


[U-Boot] [PATCH v3 1/3] davinci: emac: add new features to autonegotiate for EMAC

2011-10-13 Thread manjunath.hadli
From: Manjunath Hadli manjunath.ha...@ti.com

add more features like DUPLEX, 100MB link speed etc to auto negotiate
in EMAC driver. EMAC controller autonegotiates for these features with
PHYs which are on the board.

Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com
Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com
---
 drivers/net/davinci_emac.c |   30 --
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index a8905b8..52617a7 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -279,16 +279,42 @@ static int gen_get_link_speed(int phy_addr)
 static int gen_auto_negotiate(int phy_addr)
 {
u_int16_t   tmp;
+   u_int16_t   val;
+   unsigned long   cntr = 0;
+
+   if (!davinci_eth_phy_read(phy_addr, MII_BMCR, tmp))
+   return 0;
+
+   val = tmp | BMCR_FULLDPLX | BMCR_ANENABLE |
+   BMCR_SPEED100;
+   davinci_eth_phy_write(phy_addr, MII_BMCR, val);
+
+   if (!davinci_eth_phy_read(phy_addr, MII_ADVERTISE, val))
+   return 0;
+
+   val |= (ADVERTISE_100FULL | ADVERTISE_100HALF | ADVERTISE_10FULL |
+   ADVERTISE_10HALF);
+   davinci_eth_phy_write(phy_addr, MII_ADVERTISE, val);
 
if (!davinci_eth_phy_read(phy_addr, MII_BMCR, tmp))
return(0);
 
/* Restart Auto_negotiation  */
-   tmp |= BMCR_ANENABLE;
+   tmp |= BMCR_ANRESTART;
davinci_eth_phy_write(phy_addr, MII_BMCR, tmp);
 
/*check AutoNegotiate complete */
-   udelay (1);
+   do {
+   udelay(4);
+   if (!davinci_eth_phy_read(phy_addr, MII_BMSR, tmp))
+   return 0;
+
+   if (tmp  BMSR_ANEGCOMPLETE)
+   break;
+
+   cntr++;
+   } while (cntr  200);
+
if (!davinci_eth_phy_read(phy_addr, MII_BMSR, tmp))
return(0);
 
-- 
1.6.2.4

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


[U-Boot] [PATCH v3 2/3] davinci: emac: add support for more than 1 PHYs

2011-10-13 Thread manjunath.hadli
From: Manjunath Hadli manjunath.ha...@ti.com

add support for more than 1 PHYs. Many of the davinci platforms have more
than 1 PHYs on thier board. This patch extends support in davinci emac
driver for upto 3 PHYs.

Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com
Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com
---
 drivers/net/davinci_emac.c |  165 ++-
 1 files changed, 100 insertions(+), 65 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 52617a7..4ffd086 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -80,10 +80,15 @@ static int  emac_rx_queue_active = 0;
 /* Receive packet buffers */
 static unsigned char   emac_rx_buffers[EMAC_MAX_RX_BUFFERS * 
(EMAC_MAX_ETHERNET_PKT_SIZE + EMAC_PKT_ALIGN)];
 
+#define MAX_PHY3
+
 /* PHY address for a discovered PHY (0xff - not found) */
-static volatile u_int8_t   active_phy_addr = 0xff;
+static u_int8_tactive_phy_addr[MAX_PHY] = { 0xff, 0xff, 0xff };
+
+/* number of PHY found active */
+static u_int8_tnum_phy;
 
-phy_t  phy;
+phy_t  phy[MAX_PHY];
 
 static int davinci_eth_set_mac_addr(struct eth_device *dev)
 {
@@ -147,27 +152,30 @@ static int davinci_eth_phy_detect(void)
 {
u_int32_t   phy_act_state;
int i;
+   int j;
+   unsigned intcount = 0;
+
+   active_phy_addr[0] = 0xff;
+   active_phy_addr[1] = 0xff;
+   active_phy_addr[2] = 0xff;
 
-   active_phy_addr = 0xff;
+   udelay(1000);
+   phy_act_state = readl(adap_mdio-ALIVE);
 
-   phy_act_state = readl(adap_mdio-ALIVE)  EMAC_MDIO_PHY_MASK;
if (phy_act_state == 0)
-   return(0);  /* No active PHYs */
+   return 0;   /* No active PHYs */
 
debug_emac(davinci_eth_phy_detect(), ALIVE = 0x%08x\n, phy_act_state);
 
-   for (i = 0; i  32; i++) {
+   for (i = 0, j = 0; i  32; i++)
if (phy_act_state  (1  i)) {
-   if (phy_act_state  ~(1  i))
-   return(0);  /* More than one PHY */
-   else {
-   active_phy_addr = i;
-   return(1);
-   }
+   count++;
+   active_phy_addr[j++] = i;
}
-   }
 
-   return(0);  /* Just to make GCC happy */
+   num_phy = count;
+
+   return count;
 }
 
 
@@ -236,7 +244,18 @@ static int gen_is_phy_connected(int phy_addr)
 {
u_int16_t   dummy;
 
-   return(davinci_eth_phy_read(phy_addr, MII_PHYSID1, dummy));
+   return davinci_eth_phy_read(phy_addr, MII_PHYSID1, dummy);
+}
+
+static int get_active_phy(void)
+{
+   int i;
+
+   for (i = 0; i  num_phy; i++)
+   if (phy[i].get_link_speed(active_phy_addr[i]))
+   return i;
+
+   return -1;  /* Return error if no link */
 }
 
 static int gen_get_link_speed(int phy_addr)
@@ -362,6 +381,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
dv_reg_paddr;
u_int32_t   clkdiv, cnt;
volatile emac_desc  *rx_desc;
+   int index;
 
debug_emac(+ emac_open\n);
 
@@ -460,7 +480,8 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
/* We need to wait for MDIO to start */
udelay(1000);
 
-   if (!phy.get_link_speed(active_phy_addr))
+   index = get_active_phy();
+   if (index == -1)
return(0);
 
emac_gigabit_enable();
@@ -559,12 +580,12 @@ static int davinci_eth_send_packet (struct eth_device 
*dev,
volatile void *packet, int length)
 {
int ret_status = -1;
-
+   int index;
tx_send_loop = 0;
 
-   /* Return error if no link */
-   if (!phy.get_link_speed (active_phy_addr)) {
-   printf (WARN: emac_send_packet: No link\n);
+   index = get_active_phy();
+   if (index == -1) {
+   printf( WARN: emac_send_packet: No link\n);
return (ret_status);
}
 
@@ -588,7 +609,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
 
/* Wait for packet to complete or link down */
while (1) {
-   if (!phy.get_link_speed (active_phy_addr)) {
+   if (!phy[index].get_link_speed(active_phy_addr[index])) {
davinci_eth_ch_teardown (EMAC_CH_TX);
return (ret_status);
}
@@ -685,6 +706,7 @@ int davinci_emac_initialize(void)
u_int32_t   phy_id;
u_int16_t   tmp;
int i;
+   int ret;
struct eth_device *dev;
 
dev = 

[U-Boot] [PATCH v3 3/3] davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUM

2011-10-13 Thread manjunath.hadli
From: Manjunath Hadli manjunath.ha...@ti.com

remove macro CONFIG_EMAC_MDIO_PHY_NUM and depending macro EMAC_MDIO_PHY_NUM
as they are no longer needed with the support for more than 1 PHYs in davinci
emac driver.

Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com
---
 arch/arm/cpu/arm926ejs/davinci/et1011c.c  |6 ++
 arch/arm/include/asm/arch-davinci/emac_defs.h |4 
 drivers/net/davinci_emac.c|   14 +++---
 include/configs/da830evm.h|1 -
 include/configs/da850_am18xevm.h  |1 -
 include/configs/da850_l138evm.h   |1 -
 include/configs/davinci_dm365evm.h|1 -
 include/configs/davinci_dm6467Tevm.h  |1 -
 include/configs/davinci_dm6467evm.h   |1 -
 include/configs/davinci_dvevm.h   |1 -
 include/configs/davinci_schmoogie.h   |1 -
 include/configs/davinci_sffsdr.h  |1 -
 include/configs/davinci_sonata.h  |1 -
 include/configs/ea20.h|1 -
 include/configs/hawkboard.h   |1 -
 15 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/et1011c.c 
b/arch/arm/cpu/arm926ejs/davinci/et1011c.c
index da07345..df35e44 100644
--- a/arch/arm/cpu/arm926ejs/davinci/et1011c.c
+++ b/arch/arm/cpu/arm926ejs/davinci/et1011c.c
@@ -39,11 +39,9 @@ int et1011c_get_link_speed(int phy_addr)
u_int16_t   data;
 
if (davinci_eth_phy_read(phy_addr, MII_STATUS_REG, data)  (data  
0x04)) {
-   davinci_eth_phy_read(EMAC_MDIO_PHY_NUM,
-   MII_PHY_CONFIG_REG, data);
+   davinci_eth_phy_read(phy_addr, MII_PHY_CONFIG_REG, data);
/* Enable 125MHz clock sourced from PHY */
-   davinci_eth_phy_write(EMAC_MDIO_PHY_NUM,
-   MII_PHY_CONFIG_REG,
+   davinci_eth_phy_write(phy_addr, MII_PHY_CONFIG_REG,
data | PHY_SYS_CLK_EN);
return (1);
}
diff --git a/arch/arm/include/asm/arch-davinci/emac_defs.h 
b/arch/arm/include/asm/arch-davinci/emac_defs.h
index 294a9a8..ea52888 100644
--- a/arch/arm/include/asm/arch-davinci/emac_defs.h
+++ b/arch/arm/include/asm/arch-davinci/emac_defs.h
@@ -84,10 +84,6 @@
 #define EMAC_MDIO_CLOCK_FREQ   200 /* 2.0 MHz */
 #endif
 
-/* PHY mask - set only those phy number bits where phy is/can be connected */
-#define EMAC_MDIO_PHY_NUM   CONFIG_EMAC_MDIO_PHY_NUM
-#define EMAC_MDIO_PHY_MASK  (1  EMAC_MDIO_PHY_NUM)
-
 /* Ethernet Min/Max packet size */
 #define EMAC_MIN_ETHERNET_PKT_SIZE 60
 #define EMAC_MAX_ETHERNET_PKT_SIZE 1518
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 4ffd086..7dacb23 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -48,9 +48,9 @@ unsigned int  emac_dbg = 0;
 #define debug_emac(fmt,args...)if (emac_dbg) printf(fmt,##args)
 
 #ifdef DAVINCI_EMAC_GIG_ENABLE
-#define emac_gigabit_enable()  davinci_eth_gigabit_enable()
+#define emac_gigabit_enable(phy_addr)  davinci_eth_gigabit_enable(phy_addr)
 #else
-#define emac_gigabit_enable()  /* no gigabit to enable */
+#define emac_gigabit_enable(phy_addr)  /* no gigabit to enable */
 #endif
 
 static void davinci_eth_mdio_enable(void);
@@ -357,11 +357,11 @@ static int davinci_mii_phy_write(const char *devname, 
unsigned char addr, unsign
 }
 #endif
 
-static void  __attribute__((unused)) davinci_eth_gigabit_enable(void)
+static void  __attribute__((unused)) davinci_eth_gigabit_enable(int phy_addr)
 {
u_int16_t data;
 
-   if (davinci_eth_phy_read(EMAC_MDIO_PHY_NUM, 0, data)) {
+   if (davinci_eth_phy_read(phy_addr, 0, data)) {
if (data  (1  6)) { /* speed selection MSB */
/*
 * Check if link detected is giga-bit
@@ -484,7 +484,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
if (index == -1)
return(0);
 
-   emac_gigabit_enable();
+   emac_gigabit_enable(active_phy_addr[index]);
 
/* Start receive process */
writel((u_int32_t)emac_rx_desc, adap_emac-RX0HDP);
@@ -589,7 +589,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
return (ret_status);
}
 
-   emac_gigabit_enable();
+   emac_gigabit_enable(active_phy_addr[index]);
 
/* Check packet size and if  EMAC_MIN_ETHERNET_PKT_SIZE, pad it up */
if (length  EMAC_MIN_ETHERNET_PKT_SIZE) {
@@ -614,7 +614,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
return (ret_status);
}
 
-   emac_gigabit_enable();
+   emac_gigabit_enable(active_phy_addr[index]);
 
if (readl(adap_emac-TXINTSTATRAW)  0x01) {
ret_status = length;
diff --git 

Re: [U-Boot] [PATCH 1/2] Tegra2: Make XTal speed configurable

2011-10-13 Thread Marek Vasut
On Thursday, October 13, 2011 06:31:09 AM Simon Glass wrote:
 On Wed, Oct 12, 2011 at 5:27 PM, Marek Vasut marek.va...@gmail.com wrote:
  On Wednesday, October 12, 2011 11:17:07 PM Simon Glass wrote:
  Hi Marek,
  
  On Wed, Oct 12, 2011 at 4:19 AM, Marek Vasut marek.va...@gmail.com wrote:
   On Wednesday, October 12, 2011 02:30:57 AM Simon Glass wrote:
   Hi Marek,
   
   On Wed, Oct 5, 2011 at 10:05 AM, Marek Vasut marek.va...@gmail.com 
wrote:
On Wednesday, October 05, 2011 04:10:56 PM Simon Glass wrote:
Hi Marek,

On Fri, Sep 30, 2011 at 5:12 PM, Marek Vasut
marek.va...@gmail.com
  
  wrote:
 The Toradex T20 module uses 13MHz Xtal, so make the Xtal speed
 configurable.
 
 Signed-off-by: Marek Vasut marek.va...@gmail.com
 Cc: Simon Glass s...@chromium.org
 Cc: Ben Warren biggerbadder...@gmail.com
 Cc: Tom Warren twarren.nvi...@gmail.com
 Cc: Stephen Warren swar...@nvidia.com
 ---
  arch/arm/cpu/armv7/tegra2/ap20.c |9 +++--
  1 files changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c
 b/arch/arm/cpu/armv7/tegra2/ap20.c index dc5f984..71d9f26 100644
 --- a/arch/arm/cpu/armv7/tegra2/ap20.c
 +++ b/arch/arm/cpu/armv7/tegra2/ap20.c
 @@ -31,6 +31,11 @@
  #include asm/arch/scu.h
  #include common.h
 
 +/* The default XTal is 12MHz, some boards might use 13MHz one
 though */ +#ifndefCONFIG_SYS_TEGRA2_XTAL_MHZ
 +#defineCONFIG_SYS_TEGRA2_XTAL_MHZ  12
 +#endif
 +
  u32 s_first_boot = 1;
 
  void init_pllx(void)
 @@ -46,8 +51,8 @@ void init_pllx(void)
/* Set PLLX_MISC */
writel(1  PLL_CPCON_SHIFT, pll-pll_misc);
 
 -   /* Use 12MHz clock here */
 -   reg = PLL_BYPASS_MASK | (12  PLL_DIVM_SHIFT);
 +   /* Use 13MHz clock here */

Change comment?

 +   reg = PLL_BYPASS_MASK | (CONFIG_SYS_TEGRA2_XTAL_MHZ 
 PLL_DIVM_SHIFT); reg |= 1000  PLL_DIVN_SHIFT;
writel(reg, pll-pll_base);
 
 --
 1.7.5.4

Regards,
Simon

Hi Simon, I'll probably also change the board.c to support this.
But then, can't the board.c be moved to
arch/arm/cpu/armv7/tegra... and it's functions exported via
standard header ? Cheers
   
   Which board.c do you mean and which change do you need to make?
   
   Hi Simon,
   
   board/nvidia/common/board.c
   
   same as this patch does .
  
  Well there are several files called board.c:
  
  board/nvidia/common/board.c - Common things for Nvidia boards
  arch/arm/lib/board.c - Generic ARM things
  arch/arm/cpu/armv7/tegra2/board.c - Generic Tegra things
  
  Since this is to do with Tegra, I think it should stay where it is in
  ap20.c and you should just add a config. For now
  arch/arm/cpu/armv7/tegra2/board.c just deals with DRAM.
  
  Hi Simon,
  
  the same register gets set in both boards/.../board.c and ap20.c ...
  which itself is a bit suspicious.
  
  Cheers
 
 Hi Marek,
 
 Yes but I think you are still looking at the old code. The patches are
 applied now to u-boot-arm/master - can you please take a look? The
 clock/pinmux framework is basically complete now so most of the poking
 of registers elsewhere is gone.
 
 Regards,
 Simon

Ah, will do.

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


Re: [U-Boot] [PATCH] imx: fix coding style

2011-10-13 Thread Fabio Estevam
On Wed, Oct 12, 2011 at 7:20 AM, Stefano Babic sba...@denx.de wrote:
136/mx31/timer.c
 +++ b/arch/arm/cpu/arm1136/mx31/timer.c
 @@ -43,7 +43,10 @@

  DECLARE_GLOBAL_DATA_PTR;

 -/* time is measured in 1 / CONFIG_SYS_HZ seconds, tick is internal 
 timer period */
 +/* time is measured in 1 / CONFIG_SYS_HZ seconds,
 + * tick is internal timer period
 + */

 This style for multiline comments is wrong. Please fix it.

After applying the patch I read:

/* time is measured in 1 / CONFIG_SYS_HZ seconds,
 * tick is internal timer period
 */

Could you please let me know what is the error?


 -/*
 - * Initializes on-chip ethernet controllers.
 - * to override, implement board_eth_init()
 - */
 -#if defined(CONFIG_FEC_MXC)
 -extern int fecmxc_initialize(bd_t *bis);
 -#endif

 Right - the prototype should be in an header file. However, this is not
 a codestyle issue, it is something more. Can you add in the commit
 message that you fix this topic too ?

Ok.


  int cpu_eth_init(bd_t *bis)
  {
       int rc = -ENODEV;
 diff --git a/arch/arm/include/asm/arch-mx5/sys_proto.h 
 b/arch/arm/include/asm/arch-mx5/sys_proto.h
 index ce63675..789558e 100644
 --- a/arch/arm/include/asm/arch-mx5/sys_proto.h
 +++ b/arch/arm/include/asm/arch-mx5/sys_proto.h
 @@ -28,4 +28,14 @@ u32 get_cpu_rev(void);
  #define is_soc_rev(rev)      ((get_cpu_rev()  0xFF) - rev)
  void sdelay(unsigned long);
  void set_chipselect_size(int const);
 +
 +/*
 + * Initializes on-chip ethernet controllers.
 + * to override, implement board_eth_init()
 + */
 +#if defined(CONFIG_FEC_MXC)
 +int fecmxc_initialize(bd_t *bis);

 Do we really need the #if in the header file ? I think we can get rid of it.

Ok, I cam remove it.

Regards,

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


[U-Boot] [PATCH] mpc5200: digsy_mtc: fix detection of Coral-PA

2011-10-13 Thread Anatolij Gustschin
A delay of approximately 250 ms after PCI bus reset in
pci_mpc5xxx_init() is needed to recognize the Coral-PA
controller on the graphic extention board.

Signed-off-by: Anatolij Gustschin ag...@denx.de
---
To make it actually work another patch
pci: move pcidelay code to new location just before PCI bus scan
is also required. It has been submitted earlier [1] and there is
already some positive feedback.

[1] http://patchwork.ozlabs.org/patch/119171/

 include/configs/digsy_mtc.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/digsy_mtc.h b/include/configs/digsy_mtc.h
index 522ec57..d0d1eda 100644
--- a/include/configs/digsy_mtc.h
+++ b/include/configs/digsy_mtc.h
@@ -70,6 +70,7 @@
 #define CONFIG_PCI 1
 #define CONFIG_PCI_PNP 1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCI_BOOTDELAY   250
 
 #define CONFIG_PCI_MEM_BUS 0x4000
 #define CONFIG_PCI_MEM_PHYSCONFIG_PCI_MEM_BUS
-- 
1.7.1

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


Re: [U-Boot] [PATCH] imx: fix coding style

2011-10-13 Thread Stefan Roese
On Thursday 13 October 2011 17:17:03 Fabio Estevam wrote:
  This style for multiline comments is wrong. Please fix it.
 
 After applying the patch I read:
 
 /* time is measured in 1 / CONFIG_SYS_HZ seconds,
  * tick is internal timer period
  */
 
 Could you please let me know what is the error?

It should be:

/*
 * time is measured in 1 / CONFIG_SYS_HZ seconds,
 * tick is internal timer period
 */

instead.

Cheers,
Stefan

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


Re: [U-Boot] [PATCH] avr32: fix timer_init() return type

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 06:27:38 Reinhard Meyer wrote:
 Dear Andreas Bießmann,
  BTW there is another patch pending -
  http://patchwork.ozlabs.org/patch/117688/
 
 I'll apply that one in the year 2015 ;)
 
 NO.. its on my list for applying into next

WFM
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] imx: fix coding style

2011-10-13 Thread Fabio Estevam
Fix checkpatch warning and errors in several i.MX related files.

While at it also address a checkpatch warning at arch/arm/cpu/armv7/mx5/soc.c
regarding the usage of extern in a C file.

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
Changes since v1:
- Fix multi-line style
- Add comment in the changelog regarding the fix for externs in C file
- Remove ifdef from header file

 arch/arm/cpu/arm1136/mx31/timer.c   |   23 --
 arch/arm/cpu/arm1136/mx35/generic.c |2 +-
 arch/arm/cpu/arm926ejs/mx25/generic.c   |  110 +-
 arch/arm/cpu/arm926ejs/mx25/reset.c |2 +-
 arch/arm/cpu/arm926ejs/mx25/timer.c |   16 ++--
 arch/arm/cpu/arm926ejs/mx27/reset.c |2 +-
 arch/arm/cpu/arm926ejs/mx27/timer.c |   14 ++--
 arch/arm/cpu/armv7/mx5/soc.c|   10 +--
 arch/arm/include/asm/arch-mx5/sys_proto.h   |8 ++
 board/davedenx/qong/qong.c  |   10 +-
 board/freescale/mx31ads/mx31ads.c   |2 +-
 board/karo/tx25/tx25.c  |2 +-
 board/logicpd/imx27lite/imx27lite.c |6 +-
 board/logicpd/imx31_litekit/imx31_litekit.c |2 +-
 14 files changed, 108 insertions(+), 101 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/timer.c 
b/arch/arm/cpu/arm1136/mx31/timer.c
index 717a2b7..f494440 100644
--- a/arch/arm/cpu/arm1136/mx31/timer.c
+++ b/arch/arm/cpu/arm1136/mx31/timer.c
@@ -43,7 +43,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* time is measured in 1 / CONFIG_SYS_HZ seconds, tick is internal timer 
period */
+/*
+ * time is measured in 1 / CONFIG_SYS_HZ seconds,
+ * tick is internal timer period
+ */
+
 #ifdef CONFIG_MX31_TIMER_HIGH_PRECISION
 /* ~0.4% error - measured with stop-watch on 100s boot-delay */
 static inline unsigned long long tick_to_time(unsigned long long tick)
@@ -68,7 +72,8 @@ static inline unsigned long long us_to_tick(unsigned long 
long us)
 }
 #else
 /* ~2% error */
-#define TICK_PER_TIME  ((CONFIG_MX31_CLK32 + CONFIG_SYS_HZ / 2) / 
CONFIG_SYS_HZ)
+#define TICK_PER_TIME  ((CONFIG_MX31_CLK32 + CONFIG_SYS_HZ / 2) \
+   / CONFIG_SYS_HZ)
 #define US_PER_TICK(100 / CONFIG_MX31_CLK32)
 
 static inline unsigned long long tick_to_time(unsigned long long tick)
@@ -91,7 +96,7 @@ static inline unsigned long long us_to_tick(unsigned long 
long us)
 #endif
 
 /* The 32768Hz 32-bit timer overruns in 131072 seconds */
-int timer_init (void)
+int timer_init(void)
 {
int i;
 
@@ -106,7 +111,7 @@ int timer_init (void)
return 0;
 }
 
-unsigned long long get_ticks (void)
+unsigned long long get_ticks(void)
 {
ulong now = GPTCNT; /* current tick value */
 
@@ -119,7 +124,7 @@ unsigned long long get_ticks (void)
return gd-tbl;
 }
 
-ulong get_timer_masked (void)
+ulong get_timer_masked(void)
 {
/*
 * get_ticks() returns a long long (64 bit), it wraps in
@@ -130,13 +135,13 @@ ulong get_timer_masked (void)
return tick_to_time(get_ticks());
 }
 
-ulong get_timer (ulong base)
+ulong get_timer(ulong base)
 {
-   return get_timer_masked () - base;
+   return get_timer_masked() - base;
 }
 
 /* delay x useconds AND preserve advance timestamp value */
-void __udelay (unsigned long usec)
+void __udelay(unsigned long usec)
 {
unsigned long long tmp;
ulong tmo;
@@ -148,7 +153,7 @@ void __udelay (unsigned long usec)
 /*NOP*/;
 }
 
-void reset_cpu (ulong addr)
+void reset_cpu(ulong addr)
 {
struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE;
wdog-wcr = WDOG_ENABLE;
diff --git a/arch/arm/cpu/arm1136/mx35/generic.c 
b/arch/arm/cpu/arm1136/mx35/generic.c
index fcfaba5..1b9809b 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -240,7 +240,7 @@ unsigned int mxc_get_main_clock(enum mxc_main_clocks clk)
}
break;
case IPG_CLK:
-   ret_val = get_ipg_clk();;
+   ret_val = get_ipg_clk();
break;
case IPG_PER_CLK:
ret_val = get_ipg_per_clk();
diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c 
b/arch/arm/cpu/arm926ejs/mx25/generic.c
index 8e60a26..c045a0b 100644
--- a/arch/arm/cpu/arm926ejs/mx25/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
@@ -39,7 +39,7 @@
  *  f = 2 * f_ref * 
  *pd + 1
  */
-static unsigned int imx_decode_pll (unsigned int pll, unsigned int f_ref)
+static unsigned int imx_decode_pll(unsigned int pll, unsigned int f_ref)
 {
unsigned int mfi = (pll  CCM_PLL_MFI_SHIFT)
 CCM_PLL_MFI_MASK;
@@ -52,57 +52,57 @@ static unsigned int imx_decode_pll (unsigned int pll, 
unsigned int f_ref)
 
mfi = mfi = 5 ? 5 : mfi;
 
-   return lldiv (2 * (u64) f_ref * (mfi * (mfd + 1) + mfn),
+   return lldiv(2 * (u64) f_ref * (mfi * (mfd + 1) + mfn),
  (mfd + 1) * 

Re: [U-Boot] [PATCH] sparc: fix unknown escape sequence warnings

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 04:49:59 Daniel Hellstrom wrote:
 On 10/13/2011 07:47 AM, Mike Frysinger wrote:
  I don't know what exactly the code was going for, but the object code
  is the same before/after my change, and in looking at the env strings,
  this seems to be OK.
  
  Otherwise gcc warns:
  cc1: warning: unknown escape sequence: '\$'
  cc1: warning: unknown escape sequence: '\)'
  cc1: warning: unknown escape sequence: '\040'
  cc1: warning: unknown escape sequence: '\$'
  cc1: warning: unknown escape sequence: '\)'
 
 Thanks for fixing this. Do you want me to run it through the sparc
 repository or should Wolfgang take the two patches right away?

they're not critical, so feel free to merge however you like
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] sparc and .udiv/.rem/.urem/.umul/etc... link errors

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 04:45:27 Daniel Hellstrom wrote:
 On 10/13/2011 07:33 AM, Mike Frysinger wrote:
  it seems that these symbols are usually implemented in the C library on
  sparc systems, but under u-boot, we don't have that luxury.  Linux
  itself simply imports the relevant asm files from glibc into their lib
  subdir.  without these, building u-boot for sparc targets with sparc
  linux compilers fail.  any desire to make this work ?  or just continue
  to force everyone to install a dedicated sparc-elf compiler ?
 
 The .udiv/.rem ... functions are implemented by libgcc

that is target dependent

 Sparc-linux toolchains will generate ELF binaries for Linux, that is not
 what we want?

the file format is fine, but the supplementary libgcc for sparc-linux targets 
does not include these symbols.  it relies on the C library to provide them.

glibc sparc system:
$ readelf -s /lib/libc.so.6 | grep '[.]u'
  1231: 000f41e020 FUNCGLOBAL DEFAULT   10 .urem@@GLIBC_2.0
  1369: 000f41a012 FUNCGLOBAL DEFAULT   10 .udiv@@GLIBC_2.0
  1557: 000f416020 FUNCGLOBAL DEFAULT   10 .umul@@GLIBC_2.0

and if you look at gcc's source tree in gcc/config/sparc/t-*, you'll see that 
these libgcc routines are included for elf and leon targets, but not linux.

so whenever i build u-boot using a sparc-linux-gnu cross-compiler, it fails to 
link due to missing these symbols.  if i use sparc-elf, it links fine.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] common: fix missing function pointer relocation in fixup_cmdtable()

2011-10-13 Thread Daniel Schwierzeck
The command auto-completion does not work on architectures relying
on CONFIG_NEEDS_MANUAL_RELOC like MIPS. Cause is the missing function
pointer fixup for cmd_tbl_t::complete function in fixup_cmdtable().

This patch adds the missing pointer fixup in case of CONFIG_AUTO_COMPLETE
is defined.

Signed-off-by: Daniel Schwierzeck daniel.schwierz...@googlemail.com
---
 common/command.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/common/command.c b/common/command.c
index ddaed68..ed931d7 100644
--- a/common/command.c
+++ b/common/command.c
@@ -475,6 +475,12 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
cmdtp-help = (char *)addr;
}
 #endif
+#ifdef CONFIG_AUTO_COMPLETE
+   if (cmdtp-complete) {
+   addr = (ulong)(cmdtp-complete) + gd-reloc_off;
+   cmdtp-complete = (char *)addr;
+   }
+#endif
cmdtp++;
}
 }
-- 
1.7.7

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


Re: [U-Boot] [PATCH 01/15 V3] iMX28: Initial support for iMX28 CPU

2011-10-13 Thread Stefano Babic
On 09/30/2011 11:42 AM, Marek Vasut wrote:
 This patch supports:
 - Timers
 - Debug UART
 - Clock

Hi Marek,

/opt/tools/bin/checkpatch.pl --no-tree
~/Desktop/U-Boot-01-15-V3-iMX28-Initial-support-for-iMX28-CPU.patch
WARNING: line over 80 characters
#634: FILE: arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
+int do_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char *
const argv[])

total: 0 errors, 1 warnings, 4527 lines checked

Can you fix and resubmit ?

Stefano

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


Re: [U-Boot] [PATCH 00/12] Define ARCH_DMA_MINALIGN for all architectures

2011-10-13 Thread Anton Staaf
On Wed, Oct 12, 2011 at 8:47 PM, Kumar Gala ga...@kernel.crashing.org wrote:

 On Oct 12, 2011, at 4:01 PM, Anton Staaf wrote:

 ARCH_DMA_MINALIGN is a new define borrowed from the Linux kernel.  It is
 used to define the minimum alignement requirement for a DMA buffer.  This
 series of patches ensures that it will always be defined in the arch specific
 asm/cache.h header and that asm/cache.h is included in common.h.  I chose to
 add this new define instead of reusing CONFIG_SYS_CACHELINE_SIZE for two
 reasons.  First, CONFIG_SYS_CACHELINE_SIZE is not defined for all 
 architectures
 and thus to use it I would have to first define it correctly for all used
 architectures.  I wasn't quite up to that task right now.  Defining
 ARCH_DMA_MINALIGN is easier because it has slightly different semantics that
 allow it to be the maximum cacheline size known for an architecture.  And
 secondly, CONFIG_SYS_CACHELINE_SIZE may not always be the correct value to 
 use
 to align DMA buffers.  In particular, on cache coherent architectures you can
 define ARCH_DMA_MINALIGN as 1 and be safe (unless there are other 
 restrictions
 such as PCI alignment requirements).

 This patch set will allow me to resubmit my ALLOC_CACHE_ALIGN_BUFFER patch 
 set
 modified to use this new define in place of CONFIG_SYS_CACHELINE_SIZE.  I 
 will
 repost those patches based on this set shortly.

 I haven't looked at this patchset you reference, but what is causing the need 
 for buffer alignment?

 I question if on PPC we really need this to be at a cache line granularity.

Briefly, if your cache architecture is not coherent with respect to
DMA transactions
then you need to flush and invalidate the cache before and after read
and write DMA
operations.

To safely do this you need the region that you wish to invalidate
and/or flush to
be aligned with the cache line at both ends.  If it is not then you
run the risk of
corrupting variables that are in the unaligned memory at either end of
the buffer.

So, in short, if the PowerPC cache architecture is coherent with
respect to memory
access done by other bus masters then you can set this value to 1.  If
it is not,
then you must set it to at least the cache line size.

Thanks,
Anton

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


Re: [U-Boot] checkpatch compliance

2011-10-13 Thread Joe Hershberger
On Wed, Oct 12, 2011 at 8:03 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Wednesday 12 October 2011 20:56:09 Joe Hershberger wrote:
 WARNING:NEW_TYPEDEFS: do not add new typedefs
 This seems rather limiting... I'm not sure why even Linux would want
 this, at least when it applies to typedefs of structs.  It makes sense
 if it's a new typedef for int or something.

 Linux has been discouraging new struct typedefs.  but it is too broad and
 catches typedefs that we want (like posix_types.h).

So it's a candidate to ignore, right?

 WARNING:VOLATILE: Use of volatile is usually wrong: see
 Documentation/volatile-considered-harmful.txt
 Sometimes using volatile is correct... not sure how this fits in with
 a policy of 0 errors and 0 warnings...  Should it be ignored or not?

 it depends.  we'll have to see the specific instance.

That's what I was getting at... should we ignore it in checkpatch and
simply review any new volatile variables?  Or should we not ignore it
in checkpatch and have exceptions to no errors, no warnings?

I also think that for code cleanup where progress can be incremental,
the rules may need to be a little more lenient.

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


Re: [U-Boot] [PATCH] tools: checkpatch.pl from Linux added to tools

2011-10-13 Thread Joe Hershberger
On Wed, Oct 12, 2011 at 10:27 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Tuesday 11 October 2011 21:41:19 Joe Hershberger wrote:
 --- /dev/null
 +++ b/.checkpatch.conf

 +# Not Linux, so don't expect a Linux tree.
 +--no-tree

Why depend on or have to specify where a linux tree is for building u-boot?

 the only things checkpatch.pl uses $tree for, i think we want.  like #include
 asm/foo.h instead of linux/foo.h.  why do you want this ?

 +# For Linux includes
 +--ignore ARCH_INCLUDE_LINUX
 +--ignore INCLUDE_LINUX

 i think these checks are good actually.  we import headers from Linux all the
 time ...

These seem to be irrelevant if --no-tree is specified.  It doesn't
seem like checkpatch would make good decisions about this anyway given
that an include file that exists in the referred-to Linux tree may not
exist in the u-boot tree.

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


Re: [U-Boot] [PATCH v3 1/6] cache: add ALLOC_CACHE_ALIGN_BUFFER macro

2011-10-13 Thread Anton Staaf
On Wed, Oct 12, 2011 at 5:55 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Wednesday 12 October 2011 19:55:59 Anton Staaf wrote:
  doc/README.arm-caches |    2 +

 seems like most of the advice in this is arch independent

Agreed.  It probably makes sense to change the name of the file.  I'm not
sure that any of it's contents should be ARM specific moving forward.  That
is, it reflects where all of the supported architectures should go yes?

-Anton

 -mike

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


Re: [U-Boot] [PATCH 01/15 V3] iMX28: Initial support for iMX28 CPU

2011-10-13 Thread Marek Vasut
On Thursday, October 13, 2011 06:19:44 PM Stefano Babic wrote:
 On 09/30/2011 11:42 AM, Marek Vasut wrote:
  This patch supports:
  - Timers
  - Debug UART
  - Clock
 
 Hi Marek,
 
 /opt/tools/bin/checkpatch.pl --no-tree
 ~/Desktop/U-Boot-01-15-V3-iMX28-Initial-support-for-iMX28-CPU.patch
 WARNING: line over 80 characters
 #634: FILE: arch/arm/cpu/arm926ejs/mx28/mx28.c:150:
 +int do_mx28_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char *
 const argv[])
 
 total: 0 errors, 1 warnings, 4527 lines checked
 
 Can you fix and resubmit ?
 
 Stefano

Hi Stefano,

the patch is big and will need approval to be let into ML. Removing the space 
in 
char * const argv[] shall do the trick, can you please do that by hand ?

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


Re: [U-Boot] [PATCH v3 1/6] cache: add ALLOC_CACHE_ALIGN_BUFFER macro

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 14:06:41 Anton Staaf wrote:
 On Wed, Oct 12, 2011 at 5:55 PM, Mike Frysinger wrote:
  On Wednesday 12 October 2011 19:55:59 Anton Staaf wrote:
   doc/README.arm-caches |2 +
  
  seems like most of the advice in this is arch independent
 
 Agreed.  It probably makes sense to change the name of the file.  I'm not
 sure that any of it's contents should be ARM specific moving forward.  That
 is, it reflects where all of the supported architectures should go yes?

hmm, i thought you were adding this file, not updating it

the enable_caches() part is ARM specific, as is the Cleanup Before Linux.  but 
the rest should be in like README.caches.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] checkpatch compliance

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 13:14:34 Joe Hershberger wrote:
 On Wed, Oct 12, 2011 at 8:03 PM, Mike Frysinger vap...@gentoo.org wrote:
  On Wednesday 12 October 2011 20:56:09 Joe Hershberger wrote:
  WARNING:NEW_TYPEDEFS: do not add new typedefs
  This seems rather limiting... I'm not sure why even Linux would want
  this, at least when it applies to typedefs of structs.  It makes sense
  if it's a new typedef for int or something.
  
  Linux has been discouraging new struct typedefs.  but it is too broad and
  catches typedefs that we want (like posix_types.h).
 
 So it's a candidate to ignore, right?

it's like the volatiles check.  reviewed on a case by case basis.

  WARNING:VOLATILE: Use of volatile is usually wrong: see
  Documentation/volatile-considered-harmful.txt
  Sometimes using volatile is correct... not sure how this fits in with
  a policy of 0 errors and 0 warnings...  Should it be ignored or not?
  
  it depends.  we'll have to see the specific instance.
 
 That's what I was getting at... should we ignore it in checkpatch and
 simply review any new volatile variables?

if checkpatch ignores it, people won't notice

 Or should we not ignore it in checkpatch and have exceptions to no errors,
 no warnings?

i've always advocated not using checkpatch this way.  it's simply another tool 
which has known bugs and doesn't cover realistic nuances.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/6] cache: add ALLOC_CACHE_ALIGN_BUFFER macro

2011-10-13 Thread Anton Staaf
On Thu, Oct 13, 2011 at 11:15 AM, Mike Frysinger vap...@gentoo.org wrote:
 On Thursday 13 October 2011 14:06:41 Anton Staaf wrote:
 On Wed, Oct 12, 2011 at 5:55 PM, Mike Frysinger wrote:
  On Wednesday 12 October 2011 19:55:59 Anton Staaf wrote:
   doc/README.arm-caches |    2 +
 
  seems like most of the advice in this is arch independent

 Agreed.  It probably makes sense to change the name of the file.  I'm not
 sure that any of it's contents should be ARM specific moving forward.  That
 is, it reflects where all of the supported architectures should go yes?

 hmm, i thought you were adding this file, not updating it

Nope, just adding a line about the new buffer allocation macro.

 the enable_caches() part is ARM specific, as is the Cleanup Before Linux.  but
 the rest should be in like README.caches.

Let's do that in a separate patch.

Thanks,
Anton

 -mike

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


Re: [U-Boot] [PATCH] tools: checkpatch.pl from Linux added to tools

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 13:25:51 Joe Hershberger wrote:
 On Wed, Oct 12, 2011 at 10:27 PM, Mike Frysinger vap...@gentoo.org wrote:
  On Tuesday 11 October 2011 21:41:19 Joe Hershberger wrote:
  --- /dev/null
  +++ b/.checkpatch.conf
  
  +# Not Linux, so don't expect a Linux tree.
  +--no-tree
 
 Why depend on or have to specify where a linux tree is for building u-boot?

that's not how it works.  use the u-boot tree as the linux tree.

  the only things checkpatch.pl uses $tree for, i think we want.  like
  #include asm/foo.h instead of linux/foo.h.  why do you want this ?
  
  +# For Linux includes
  +--ignore ARCH_INCLUDE_LINUX
  +--ignore INCLUDE_LINUX
  
  i think these checks are good actually.  we import headers from Linux all
  the time ...
 
 These seem to be irrelevant if --no-tree is specified.  It doesn't
 seem like checkpatch would make good decisions about this anyway given
 that an include file that exists in the referred-to Linux tree may not
 exist in the u-boot tree.

use the u-boot tree, then it works fine
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] tools: checkpatch.pl from Linux added to tools

2011-10-13 Thread Joe Hershberger
On Thu, Oct 13, 2011 at 1:20 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Thursday 13 October 2011 13:25:51 Joe Hershberger wrote:
 On Wed, Oct 12, 2011 at 10:27 PM, Mike Frysinger vap...@gentoo.org wrote:
  On Tuesday 11 October 2011 21:41:19 Joe Hershberger wrote:
  --- /dev/null
  +++ b/.checkpatch.conf
 
  +# Not Linux, so don't expect a Linux tree.
  +--no-tree

 Why depend on or have to specify where a linux tree is for building u-boot?

 that's not how it works.  use the u-boot tree as the linux tree.

  the only things checkpatch.pl uses $tree for, i think we want.  like
  #include asm/foo.h instead of linux/foo.h.  why do you want this ?
 
  +# For Linux includes
  +--ignore ARCH_INCLUDE_LINUX
  +--ignore INCLUDE_LINUX
 
  i think these checks are good actually.  we import headers from Linux all
  the time ...

 These seem to be irrelevant if --no-tree is specified.  It doesn't
 seem like checkpatch would make good decisions about this anyway given
 that an include file that exists in the referred-to Linux tree may not
 exist in the u-boot tree.

 use the u-boot tree, then it works fine

With the latest version of checkpatch that does not work... checkpatch
looks for the following files/folders to identify the
top_of_kernel_tree:

COPYING, CREDITS, Kbuild, MAINTAINERS, Makefile,
README, Documentation, arch, include, drivers,
fs, init, ipc, kernel, lib, scripts,

u-boot has no Kbuild, Documentation, init, ipc, kernel, or scripts.

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


[U-Boot] [PATCHv9] new tool mkenvimage: generates an env image from an arbitrary config file

2011-10-13 Thread David Wagner
This tool takes a key=value configuration file (same as would a `printenv' show)
and generates the corresponding environment image, ready to be flashed.

use case: flash the environment with an external tool

Signed-off-by: David Wagner david.wag...@free-electrons.com
Acked-by; Mike Frysinger vap...@gentoo.org
Tested-by: Thomas Petazzoni thomas.petazz...@free-electrons.com
---
(My first try to send it seems to have failed ; please disregard if it actually
suceeded)

change since v8
~~~

 * Make checkpatch happy by putting an instruction out of a while().
   Incidently, it also fixes a possible segfault (in the event of a comment
   being at the end of a file that hasn't an ending newline).

 tools/Makefile |5 +
 tools/mkenvimage.c |  272 
 2 files changed, 277 insertions(+), 0 deletions(-)
 create mode 100644 tools/mkenvimage.c

diff --git a/tools/Makefile b/tools/Makefile
index fc741d3..da7caf0 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -66,6 +66,7 @@ BIN_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc$(SFX)
 BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
 BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
 BIN_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX)
+BIN_FILES-y += mkenvimage$(SFX)
 BIN_FILES-y += mkimage$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
@@ -89,6 +90,7 @@ OBJ_FILES-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes.o
 NOPED_OBJ_FILES-y += kwbimage.o
 NOPED_OBJ_FILES-y += imximage.o
 NOPED_OBJ_FILES-y += omapimage.o
+NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
 OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
@@ -184,6 +186,9 @@ $(obj)xway-swap-bytes$(SFX):$(obj)xway-swap-bytes.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
$(HOSTSTRIP) $@
 
+$(obj)mkenvimage$(SFX):$(obj)crc32.o $(obj)mkenvimage.o
+   $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+
 $(obj)mkimage$(SFX):   $(obj)crc32.o \
$(obj)default_image.o \
$(obj)fit_image.o \
diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
new file mode 100644
index 000..2c7fbe7
--- /dev/null
+++ b/tools/mkenvimage.c
@@ -0,0 +1,272 @@
+/*
+ * (C) Copyright 2011 Free Electrons
+ * David Wagner david.wag...@free-electrons.com
+ *
+ * Inspired from envcrc.c:
+ * (C) Copyright 2001
+ * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arse...@tin.it
+ *
+ * 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 errno.h
+#include fcntl.h
+#include stdio.h
+#include stdlib.h
+#include stdint.h
+#include string.h
+#include unistd.h
+#include compiler.h
+#include sys/types.h
+#include sys/stat.h
+
+#include u-boot/crc.h
+
+#define CRC_SIZE sizeof(uint32_t)
+
+static void usage(const char *exec_name)
+{
+   fprintf(stderr, %s [-h] [-r] [-b] [-p byte] 
+  -s environment partition size -o output input file\n
+  \n
+  This tool takes a key=value input file (same as would a 
+  `printenv' show) and generates the corresponding environment 
+  image, ready to be flashed.\n
+  \n
+  \tThe input file is in format:\n
+  \t\tkey1=value1\n
+  \t\tkey2=value2\n
+  \t\t...\n
+  \t-r : the environment has multiple copies in flash\n
+  \t-b : the target is big endian (default is little endian)\n
+  \t-p byte : fill the image with byte bytes instead of 
+  0xff bytes\n
+  \n
+  If the input file is \-\, data is read from standard input\n,
+  exec_name);
+}
+
+int main(int argc, char **argv)
+{
+   uint32_t crc, targetendian_crc;
+   const char *txt_filename = NULL, *bin_filename = NULL;
+   int txt_fd, bin_fd;
+   unsigned char *dataptr, *envptr;
+   unsigned char *filebuf = NULL;
+   unsigned int filesize = 0, envsize = 0, datasize = 0;
+   int bigendian = 0;
+   int redundant = 0;
+   unsigned char padbyte = 0xff;
+
+   int option;
+   int ret = EXIT_SUCCESS;
+
+   struct 

Re: [U-Boot] [PATCH] tools: checkpatch.pl from Linux added to tools

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 14:30:12 Joe Hershberger wrote:
 On Thu, Oct 13, 2011 at 1:20 PM, Mike Frysinger wrote:
  On Thursday 13 October 2011 13:25:51 Joe Hershberger wrote:
  On Wed, Oct 12, 2011 at 10:27 PM, Mike Frysinger wrote:
   On Tuesday 11 October 2011 21:41:19 Joe Hershberger wrote:
   +# For Linux includes
   +--ignore ARCH_INCLUDE_LINUX
   +--ignore INCLUDE_LINUX
   
   i think these checks are good actually.  we import headers from Linux
   all the time ...
  
  These seem to be irrelevant if --no-tree is specified.  It doesn't
  seem like checkpatch would make good decisions about this anyway given
  that an include file that exists in the referred-to Linux tree may not
  exist in the u-boot tree.
  
  use the u-boot tree, then it works fine
 
 With the latest version of checkpatch that does not work...

sad

 checkpatch looks for the following files/folders to identify the
 top_of_kernel_tree:
 
 COPYING, CREDITS, Kbuild, MAINTAINERS, Makefile,
 README, Documentation, arch, include, drivers,
 fs, init, ipc, kernel, lib, scripts,
 
 u-boot has no Kbuild, Documentation, init, ipc, kernel, or scripts.

i guess let's talk to lkml to see about decoupling this so that only the 
required paths get checked for the relevant tests.  for the header tests, that 
should only require include/linux/ to exist.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] powerpc/p3060qds: Add board related support for P3060QDS platform

2011-10-13 Thread Tabi Timur-B04825
On Thu, Oct 6, 2011 at 4:23 PM, Wolfgang Denk w...@denx.de wrote:

 Checkpatch says:

 WARNING: static const char * array should probably be static const
 char * const
 #1511: FILE: board/freescale/p3060qds/p3060qds.c:84:
 +               static const char *freq[] = {100, 125, Reserved,


 Please clean up and resubmit.  Thanks.

I also get this when I apply the patch:

Applying: powerpc/p3060qds: Add board related support for P3060QDS platform
/home/b04825/git/u-boot.28/.git/rebase-apply/patch:1622: new blank line at EOF.
+
warning: 1 line adds whitespace errors.


-- 
Timur Tabi
Linux kernel developer at Freescale
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] image: Support relative-addresses property in FIT images

2011-10-13 Thread Wolfgang Denk
Dear Stephen Warren,

In message 74cdbe0f657a3d45afbb94109fb122ff173a2c7...@hqmail01.nvidia.com you 
wrote:

   OK. Wouldn't we also need e.g. IH_TYPE_STANDALONE_REL, IH_TYPE_RAMDISK_REL
   and perhaps other too?
  
  I don't think so - either these don't have (and use) load and entry
  point addesses (like in the ramdisk case), or they are not easily
  relocatable in the same way as the Linux kernel.

 Sorry, I don't quite understand then; in both boot_get_ramdisk() and
 boot_get_fdt(), I see calls to image_get_load() and fit_image_get_load().

Agreed for FDT images, but you wrote IH_TYPE_STANDALONE_REL -
standanole images are something differend, and usually not
relocatable.  And ramdisks have neither a load address nor an entry
point associated with them; no matter where they are located in
memory, we just pass their address to the Linux kernel.

 I guess in the ramdisk case, this just sets rd_load, which isn't used,
 but in the FDT case, it sets load_start, which is used to derive load_end
 and fdt_blob.

Agreed.  But that's not what you wrote above.


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's only one way to have a happy marriage and as soon as I learn
what it is I'll get married again.  - Clint Eastwood
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] ColdFire: Cleanup lds files for multiple defined symbols

2011-10-13 Thread Wolfgang Denk
Dear Stany MARCEL,

In message 1512c13c0c5ea947ae50b9b9ac314f4701b00...@atlas.pactenovation.fr 
you wrote:
 
 Each time a file is edited do I have to actualizes end dates ? Or leave them 
 as they are ?

If the file has a copyright entry for yourself, you would udate this
to include the current calendar year.  Never touch copyright entries
of other persons or entities.

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 has been an alarming increase in the number of things you  know
nothing about.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-13 Thread Wolfgang Denk
Dear Anton Staaf,

In message caf6fiowhpea8_npa85e3spc17zdckzqkv2ros_eaab_9wv9...@mail.gmail.com 
you wrote:

 Would you be OK with a build warning for the lack of definition of
 CONFIG_SYS_CACHELINE_SIZE like I have now if it only happened
 once per board? ...

Yes, that would be great.

  ... I could move it from common.h to a c file that is always
 built.  Perhaps I could add a checks.c file to libgeneric?  I'm not really 
 sure
 if that's the right place for it.  Do you have a suggestion?

I'd like to avoid a new file.  But I don't have a good idea either.
Well, heck, go and add the test to the top of common/main.c .


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
What can it profit a man to gain the whole world and to come  to  his
property with a gastric ulcer, a blown prostate, and bifocals?
 -- John Steinbeck, _Cannery Row_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] mmc: change magic number to macro define

2011-10-13 Thread Wolfgang Denk
Dear Lei Wen,

In message CALButC+bZZwYhE0VT99Yjh_=p0lvjqnmm1yvzsex3inutn7...@mail.gmail.com 
Graeme Russ wrote:
 
  So do you means I should keep the EXT_CSD_HS_TIMING? Or I change like below?
 
  from
  err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);
  to:
  err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, ext_csd.hs_timing - 
  ext_csd, 1);
 
 I imagine the compiler will complain that the types for ext_csd.hs_timing
 and ext_csd are different.
 
 Try:
   struct ext_csd *ext_csd_ptr = 0;
 
   err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, ext_csd_ptr-hs_timing, 
 1);

Umm... no.

The signature of mmc_switch() [as used here - there is also a two
argument version; what a mess!] is:

int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)

The set argument is bous, as the function never uses it anywhere.

And both the index and value arguments are never used in I/O
context, i. e. they are actual plain integer parameters.  So just keep
it as

err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);


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
That Microsoft, the Trabant of the operating  system  world,  may  be
glancing  over the Berlin Wall at the Audis and BMWs and Mercedes. In
their own universe Trabants and Ladas were mainstream too...
   -- Evan Leibovitch
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-13 Thread Anton Staaf
On Thu, Oct 13, 2011 at 1:03 PM, Wolfgang Denk w...@denx.de wrote:
 Dear Anton Staaf,

 In message 
 caf6fiowhpea8_npa85e3spc17zdckzqkv2ros_eaab_9wv9...@mail.gmail.com you 
 wrote:

 Would you be OK with a build warning for the lack of definition of
 CONFIG_SYS_CACHELINE_SIZE like I have now if it only happened
 once per board? ...

 Yes, that would be great.

Turns out I was able to define ARCH_DMA_MINALIGN for all U-Boot
architectures and use that
instead of the actual cache line size to generate correctly aligned
buffers.  My latest
patch set implements this.  So we shouldn't have any warnings being
generated and we should
have no need for the extra file (or addition to main.c) to generate
said warnings.  :)

Thanks,
Anton

              ... I could move it from common.h to a c file that is always
 built.  Perhaps I could add a checks.c file to libgeneric?  I'm not really 
 sure
 if that's the right place for it.  Do you have a suggestion?

 I'd like to avoid a new file.  But I don't have a good idea either.
 Well, heck, go and add the test to the top of common/main.c .


 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
 What can it profit a man to gain the whole world and to come  to  his
 property with a gastric ulcer, a blown prostate, and bifocals?
                                     -- John Steinbeck, _Cannery Row_

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


Re: [U-Boot] Interrupt issue about bootvx command

2011-10-13 Thread Wolfgang Denk
Dear Peter Pan,

please stop top posting / full quoting.


In message CAGQXtZFp6oE_BjQGd6SSDAYk7kkg4-dy_1==lnk2snh5h1g...@mail.gmail.com 
you wrote:
 
 And the following is my updated patch. My git does not have git
 send-mail supported, so I have to paste the formatted commit below.
 Sorry for that.

Well, you'd better spend the time installing a full-featured version
of git.

 From 9758bc34e8459c8b906029105e41fe8adf9e79ca Mon Sep 17 00:00:00 2001
 From: Ke Pan pppeterpp...@gmail.com
 Date: Thu, 13 Oct 2011 10:34:23 +0800
 Subject: [PATCH] common/cmd_elf : Disable interrupts before boot vxWorks
 
 The vxWorks needs all interrupts to be disabled before its boot.

Hm... And what exactly was not clear about the following statement:

  Checkpatch says: total: 2 errors, 3 warnings, 10 lines checked
 
  Please see http://www.denx.de/wiki/U-Boot/Patches ; then clean up and
  resubmit.

- Your commit message is mixed with text that belongs to the comment
  section only.

- Your SoB line is still missing

- There is a typo in Disableing; actually you should get rid of this
  printf().



Are there any testers out there?  I don't want to take this untested,
and I don't have any VxWorks anywhere around... (nor any other
proprietary 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
I'd rather be led to hell than managed to heaven.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 5/6] fdt: ARM: Add fdtcontroladdr to set device tree address in environment

2011-10-13 Thread Mike Frysinger
On Tuesday 11 October 2011 18:26:10 Simon Glass wrote:
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c
 
 +/**
 + * Decode the value of an environment variable and return it.
 + *
 + * @param name   Name of environemnt variable
 + * @param base   Number base to use (normally 10, or 16 for hex)
 + * @param default_valDefault value to return if the variable is not
 + *   found
 + * @return the decoded value, or default_val if not found
 + */
 +static int getenv_int(const char *name, int base, int default_val)
 +{
 + char tmp[64];   /* long enough for environment variables */
 + int i = getenv_f(name, tmp, sizeof(tmp));
 +
 + return (i  0)
 + ? (int) simple_strtoul(tmp, NULL, base)
 + : default_val;
 +}

pretty much everyone does this with gd-baudrate.  would make sense to put 
this into common/cmd_nvedit.c and convert all arches.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-13 Thread Wolfgang Denk
Dear Anton Staaf,

In message CAF6FioWnYJNBz0+4Af3-0vLCoGrgGgcN10z=k0df8yv87gu...@mail.gmail.com 
you wrote:

 Turns out I was able to define ARCH_DMA_MINALIGN for all U-Boot
 architectures and use that
 instead of the actual cache line size to generate correctly aligned
 buffers.  My latest
 patch set implements this.  So we shouldn't have any warnings being
 generated and we should
 have no need for the extra file (or addition to main.c) to generate
 said warnings.  :)

Great.  So this latest patch set is the final one?

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
Hokey religions and ancient weapons are  no  substitute  for  a  good
blaster at your side.  - Han Solo
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 6/6] fdt: add decode helper library

2011-10-13 Thread Mike Frysinger
On Tuesday 11 October 2011 18:26:11 Simon Glass wrote:
 --- /dev/null
 +++ b/include/fdtdec.h

 +/*
 + * A typedef for a physical address. Note that fdt data is always big
 + * endian even on a litle endian machine.
 + */
 +#ifdef CONFIG_PHYS_64BIT
 +typedef u64 addr_t;
 +#define ADDR_T_NONE (-1ULL)
 +#define addr_to_cpu(reg) be64_to_cpu(reg)
 +#else
 +typedef u32 addr_t;
 +#define ADDR_T_NONE (-1U)
 +#define addr_to_cpu(reg) be32_to_cpu(reg)
 +#endif

addr is fairly generic.  how about fdt_addr instead ?

 --- /dev/null
 +++ b/lib/fdtdec.c

 +/* we need a generic GPIO interface here */
 +#include asm/arch/gpio.h

we have asm/gpio.h now, although i don't see this code using anything from the 
gpio header to need this include ...

 +static const char *compat_names[COMPAT_COUNT] = {

static const char * const compat_names[COMPAT_COUNT] = {

 +int fdtdec_next_alias(const void *blob, const char *name,
 + enum fdt_compat_id id, int *upto)
 +{
 +#define MAX_STR_LEN 20
 + char str[MAX_STR_LEN + 20];
 + int node, err;
 +
 + sprintf(str, %.*s%d, MAX_STR_LEN, name, *upto);

where's that 20 coming from ?  just arbitrarily defined ?  might want to add 
an assert(strlen(name) = MAX_STR_LEN).
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] powerpc/p3060: remove all references to RCW bits EC1_EXT, EC2_EXT, and EC3

2011-10-13 Thread Timur Tabi
The EC1_EXT, EC2_EXT, and EC3 bits in the RCW don't officially exist on the
P3060 and should always be set to zero.

Signed-off-by: Timur Tabi ti...@freescale.com
---
 arch/powerpc/cpu/mpc85xx/p3060_serdes.c |   20 
 arch/powerpc/include/asm/immap_85xx.h   |   10 --
 drivers/net/fm/p3060.c  |   17 -
 3 files changed, 0 insertions(+), 47 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/p3060_serdes.c 
b/arch/powerpc/cpu/mpc85xx/p3060_serdes.c
index 6387276..e720dcf 100644
--- a/arch/powerpc/cpu/mpc85xx/p3060_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/p3060_serdes.c
@@ -83,8 +83,6 @@ void soc_serdes_init(void)
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
u32 devdisr2 = in_be32(gur-devdisr2);
u32 rcwsr11 = in_be32(gur-rcwsr[11]);
-   u32 rcwsr13 = in_be32(gur-rcwsr[13]);
-   u32 ec1_ext, ec2_ext;
 
/* NOTE: Leave FM1-1,FM1-2 alone for MDIO access */
 
@@ -116,23 +114,5 @@ void soc_serdes_init(void)
devdisr2 = ~FSL_CORENET_DEVDISR2_DTSEC2_1;
}
 
-   ec1_ext = rcwsr13  FSL_CORENET_RCWSR13_EC1_EXT;
-   if (ec1_ext) {
-   if ((ec1_ext == FSL_CORENET_RCWSR13_EC1_EXT_FM1_DTSEC4_RGMII) ||
-   (ec1_ext == FSL_CORENET_RCWSR13_EC1_EXT_FM1_DTSEC4_MII))
-   devdisr2 = ~FSL_CORENET_DEVDISR2_DTSEC1_4;
-   }
-
-   ec2_ext = rcwsr13  FSL_CORENET_RCWSR13_EC2_EXT;
-   if (ec2_ext) {
-   if ((ec2_ext == FSL_CORENET_RCWSR13_EC2_EXT_FM2_DTSEC4_RGMII) ||
-   (ec2_ext == FSL_CORENET_RCWSR13_EC2_EXT_FM2_DTSEC4_MII))
-   devdisr2 = ~FSL_CORENET_DEVDISR2_DTSEC2_4;
-   }
-
-   if ((rcwsr13  FSL_CORENET_RCWSR13_EC3) ==
-   FSL_CORENET_RCWSR13_EC3_FM2_DTSEC4_MII)
-   devdisr2 = ~FSL_CORENET_DEVDISR2_DTSEC2_4;
-
out_be32(gur-devdisr2, devdisr2);
 }
diff --git a/arch/powerpc/include/asm/immap_85xx.h 
b/arch/powerpc/include/asm/immap_85xx.h
index a29fe35..1bbf986 100644
--- a/arch/powerpc/include/asm/immap_85xx.h
+++ b/arch/powerpc/include/asm/immap_85xx.h
@@ -1708,16 +1708,6 @@ typedef struct ccsr_gur {
 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC2 0x0008
 #define FSL_CORENET_RCWSR11_EC2_USB2   0x0010
 #endif
-#if defined(CONFIG_PPC_P3060)
-#define FSL_CORENET_RCWSR13_EC1_EXT0x1c00
-#define FSL_CORENET_RCWSR13_EC1_EXT_FM1_DTSEC4_RGMII   0x0400
-#define FSL_CORENET_RCWSR13_EC1_EXT_FM1_DTSEC4_MII 0x0800
-#define FSL_CORENET_RCWSR13_EC2_EXT0x01c0
-#define FSL_CORENET_RCWSR13_EC2_EXT_FM2_DTSEC4_RGMII   0x0040
-#define FSL_CORENET_RCWSR13_EC2_EXT_FM2_DTSEC4_MII 0x0080
-#define FSL_CORENET_RCWSR13_EC30x0038
-#define FSL_CORENET_RCWSR13_EC3_FM2_DTSEC4_MII 0x0010
-#endif
 #if defined(CONFIG_PPC_P2040) || defined(CONFIG_PPC_P2041) \
|| defined(CONFIG_PPC_P3041) || defined(CONFIG_PPC_P5020)
 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_RGMII   0x
diff --git a/drivers/net/fm/p3060.c b/drivers/net/fm/p3060.c
index b25bca7..176e1d2 100644
--- a/drivers/net/fm/p3060.c
+++ b/drivers/net/fm/p3060.c
@@ -52,7 +52,6 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
 {
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
u32 rcwsr11 = in_be32(gur-rcwsr[11]);
-   u32 rcwsr13 = in_be32(gur-rcwsr[13]);
 
if (is_device_disabled(port))
return PHY_INTERFACE_MODE_NONE;
@@ -70,22 +69,6 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
FSL_CORENET_RCWSR11_EC2_FM2_DTSEC1))
return PHY_INTERFACE_MODE_RGMII;
 
-   if ((port == FM1_DTSEC4)  ((rcwsr13  FSL_CORENET_RCWSR13_EC1_EXT) ==
-   FSL_CORENET_RCWSR13_EC1_EXT_FM1_DTSEC4_RGMII))
-   return PHY_INTERFACE_MODE_RGMII;
-
-   if ((port == FM1_DTSEC4)  ((rcwsr13  FSL_CORENET_RCWSR13_EC1_EXT) ==
-   FSL_CORENET_RCWSR13_EC1_EXT_FM1_DTSEC4_MII))
-   return PHY_INTERFACE_MODE_MII;
-
-   if ((port == FM2_DTSEC4)  ((rcwsr13  FSL_CORENET_RCWSR13_EC2_EXT) ==
-   FSL_CORENET_RCWSR13_EC2_EXT_FM2_DTSEC4_RGMII))
-   return PHY_INTERFACE_MODE_RGMII;
-
-   if ((port == FM2_DTSEC4)  ((rcwsr13  FSL_CORENET_RCWSR13_EC2_EXT) ==
-   FSL_CORENET_RCWSR13_EC2_EXT_FM2_DTSEC4_MII))
-   return PHY_INTERFACE_MODE_MII;
-
switch (port) {
case FM1_DTSEC1:
case FM1_DTSEC2:
-- 
1.7.3.4


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


Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-13 Thread Mike Frysinger
On Thursday 13 October 2011 16:03:37 Wolfgang Denk wrote:
 Anton Staaf wrote:
   ... I could move it from common.h to a c file that is always
  
  built.  Perhaps I could add a checks.c file to libgeneric?  I'm not
  really sure if that's the right place for it.  Do you have a suggestion?
 
 I'd like to avoid a new file.  But I don't have a good idea either.
 Well, heck, go and add the test to the top of common/main.c .

fwiw, we added a dummy file in the Blackfin linux port called arch_checks.c 
where we kept all of our #ifdef sanity checks.  that way it got checked once 
(rather than in every header include), and we didn't have to clutter up semi-
related files with it.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] checkpatch compliance

2011-10-13 Thread Wolfgang Denk
Dear Joe Hershberger,

In message CANr=Z=bmm64Qxv+Zpc=gshy7c2kapagh9xm-cq79tm1oq76...@mail.gmail.com 
you wrote:

 WARNING:NEW_TYPEDEFS: do not add new typedefs
 This seems rather limiting... I'm not sure why even Linux would want
 this, at least when it applies to typedefs of structs.  It makes sense
 if it's a new typedef for int or something.

See the CodingStyle, start reading at It's a _mistake_ to use typedef
for structures and pointers.

 WARNING:VOLATILE: Use of volatile is usually wrong: see
 Documentation/volatile-considered-harmful.txt
 Sometimes using volatile is correct... not sure how this fits in with
 a policy of 0 errors and 0 warnings...  Should it be ignored or not?

There are very, very few cases where a volatile is actually OK, and
these should be hiddenin the lowese levels of the implementation.  In
all cases where we are dealing with device I/O and similar, the
volatile shall be removed, and proper I/O accessors be used instead
(these may then actually use volatile pointer accesses internally, but
usually they don't need to either).

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 is a theory which states that if ever anyone discovers  exactly
what  the  Universe is for and why it is here, it will instantly dis-
appear and be replaced by something even more  bizarre  and  inexpli-
cable.  There  is  another  theory which states that this has already
happened.-- Douglas Adams, 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 4/6] davinci_emac: fix for running with dcache enabled

2011-10-13 Thread Anton Staaf
On Thu, Oct 13, 2011 at 1:31 PM, Wolfgang Denk w...@denx.de wrote:
 Dear Anton Staaf,

 In message 
 CAF6FioWnYJNBz0+4Af3-0vLCoGrgGgcN10z=k0df8yv87gu...@mail.gmail.com you 
 wrote:

 Turns out I was able to define ARCH_DMA_MINALIGN for all U-Boot
 architectures and use that
 instead of the actual cache line size to generate correctly aligned
 buffers.  My latest
 patch set implements this.  So we shouldn't have any warnings being
 generated and we should
 have no need for the extra file (or addition to main.c) to generate
 said warnings.  :)

 Great.  So this latest patch set is the final one?

I believe it is correct yes.  But it would be good to have each
architecture custodian
weigh in on the architectures I couldn't test directly.  Also, Mike
has submitted a
patch that adds the asm/cache.h file for blackfin from the Linux
kernel.  This patch
obsoletes one of the patches in my series.  My thinking is that we
should wait a bit to
hear from other custodians, and then I'll send a second version of the
patch set that
addresses any comments.  But I am also pretty confident that we could submit the
existing patch set (minus the blackfin asm/cache.h patch) and we would be safe.

Thanks,
Anton

 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
 Hokey religions and ancient weapons are  no  substitute  for  a  good
 blaster at your side.                                      - Han Solo

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


Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-13 Thread Anton Staaf
On Thu, Oct 13, 2011 at 1:36 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Thursday 13 October 2011 16:03:37 Wolfgang Denk wrote:
 Anton Staaf wrote:
               ... I could move it from common.h to a c file that is always
 
  built.  Perhaps I could add a checks.c file to libgeneric?  I'm not
  really sure if that's the right place for it.  Do you have a suggestion?

 I'd like to avoid a new file.  But I don't have a good idea either.
 Well, heck, go and add the test to the top of common/main.c .

 fwiw, we added a dummy file in the Blackfin linux port called arch_checks.c
 where we kept all of our #ifdef sanity checks.  that way it got checked once
 (rather than in every header include), and we didn't have to clutter up semi-
 related files with it.

This makes sense to me, as it is pretty much what I did initially.  I ended up
not sending that patch up because I was able to define ARCH_DMA_MINALIGN for
all architectures we care about.  But in the future it might be a good pattern
for static checking configs.

Thanks,
Anton

 -mike

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


Re: [U-Boot] [PATCH 01/15 V3] iMX28: Initial support for iMX28 CPU

2011-10-13 Thread Wolfgang Denk
Dear Marek Vasut,

In message 201110132014.55510.marek.va...@gmail.com you wrote:

 the patch is big and will need approval to be let into ML. Removing the space 
 in 
 char * const argv[] shall do the trick, can you please do that by hand ?

It will do the trick and trigger a new checkpatch warning?

Please fix yourself, test, and resubmit.

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
Some people march to the beat of a different drummer. And some people
tango!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-13 Thread Wolfgang Denk
Dear Anton Staaf,

In message CAF6FioXcAAP=QOF3a5s_L6zUB5ArEUAQYutruAx=bpmt7rg...@mail.gmail.com 
you wrote:

 I believe it is correct yes.  But it would be good to have each
 architecture custodian
 weigh in on the architectures I couldn't test directly.  Also, Mike
 has submitted a
 patch that adds the asm/cache.h file for blackfin from the Linux
 kernel.  This patch
 obsoletes one of the patches in my series.  My thinking is that we
 should wait a bit to
 hear from other custodians, and then I'll send a second version of the
 patch set that
 addresses any comments.  But I am also pretty confident that we could submit 
 the
 existing patch set (minus the blackfin asm/cache.h patch) and we would be 
 safe.

OK. so I'll wait for your next version patch set.  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 more data I punch in this card,  the lighter it becomes, and the
lower the mailing cost.
 - Stan Kelly-Bootle, The Devil's DP Dictionary
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/9] tegra2: Tidy up boot path

2011-10-13 Thread Simon Glass
On Tegra2 the AVP runs the normal U-Boot code to a point, then halts and
the A9 takes over. The current Tegra2 boot path is fairly complex, since it
has a separate path and code for the Cortex-A9 and the AVP. In fact, they
can largely execute the same code path.

This series cleans up this logic and removes some parallel and un-needed
code.


Simon Glass (9):
  tegra2: Add arch_cpu_init() to fire up Cortex-A9
  tegra2: Simplify tegra_start() boot path
  arm: Move CP15 init out of cpu_init_crit()
  tegra2: Enable instruction cache
  tegra2: Remove unneeded boot code
  tegra2: Remove unneeded config option
  tegra2: Remove unused low-level Tegra2 UART code
  tegra2: Remove unneeded 'dynamic ram size' message
  tegra2: Don't use board pointer before it is set up

 arch/arm/cpu/armv7/start.S|   36 +-
 arch/arm/cpu/armv7/tegra2/Makefile|7 ++-
 arch/arm/cpu/armv7/tegra2/ap20.c  |   54 +++--
 arch/arm/cpu/armv7/tegra2/ap20.h  |   10 +--
 arch/arm/cpu/armv7/tegra2/board.c |   35 -
 arch/arm/cpu/armv7/tegra2/config.mk   |   28 ---
 arch/arm/cpu/armv7/tegra2/lowlevel_init.S |  118 -
 arch/arm/include/asm/u-boot-arm.h |3 +
 arch/arm/lib/Makefile |6 ++
 board/nvidia/common/board.c   |6 +-
 board/nvidia/common/board.h   |1 -
 drivers/serial/Makefile   |1 -
 drivers/serial/serial_tegra2.c|   77 ---
 drivers/serial/serial_tegra2.h|   29 ---
 include/configs/tegra2-common.h   |4 +-
 15 files changed, 86 insertions(+), 329 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/tegra2/config.mk
 delete mode 100644 drivers/serial/serial_tegra2.c
 delete mode 100644 drivers/serial/serial_tegra2.h

-- 
1.7.3.1

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


[U-Boot] [PATCH 9/9] tegra2: Don't use board pointer before it is set up

2011-10-13 Thread Simon Glass
In board_init_f() the gd-bd pointer is not valid when dram_init() is called.
This only avoids dying because DRAM is at zero on Tegra2. The common ARM
routine sets up the banks in the same way anyway, so we can just remove this
code.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/tegra2/board.c |   10 +-
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index 04c1683..91e0a6f 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -57,16 +57,8 @@ unsigned int query_sdram_size(void)
 
 int dram_init(void)
 {
-   unsigned long rs;
-
/* We do not initialise DRAM here. We just query the size */
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = gd-ram_size = query_sdram_size();
-
-   /* Now check it dynamically */
-   rs = get_ram_size(CONFIG_SYS_SDRAM_BASE, gd-ram_size);
-   if (rs)
-   gd-bd-bi_dram[0].size = gd-ram_size = rs;
+   gd-ram_size = query_sdram_size();
return 0;
 }
 
-- 
1.7.3.1

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


[U-Boot] [PATCH 1/9] tegra2: Add arch_cpu_init() to fire up Cortex-A9

2011-10-13 Thread Simon Glass
We want to move away from a special Tegra2 start-up, and just use
arch_cpu_init() instead. However, if we run board_init_f() from boot
we need to build it for ARMv4T, since the Tegra's AVP start-up CPU
does not support ARMv7.

The effect of this is to do the AVP init earlier, and in
arch_cpu_init(), rather that board_early_init_f().

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/tegra2/board.c |   15 +++
 arch/arm/lib/Makefile |6 ++
 board/nvidia/common/board.c   |3 ---
 board/nvidia/common/board.h   |1 -
 include/configs/tegra2-common.h   |2 +-
 5 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index 9061d18..e725134 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -23,6 +23,7 @@
 
 #include common.h
 #include asm/io.h
+#include ap20.h
 #include asm/arch/sys_proto.h
 #include asm/arch/tegra2.h
 #include asm/arch/pmc.h
@@ -86,3 +87,17 @@ int checkboard(void)
return 0;
 }
 #endif /* CONFIG_DISPLAY_BOARDINFO */
+
+#ifdef CONFIG_ARCH_CPU_INIT
+/*
+ * Note this function is executed by the ARM7TDMI AVP. It does not return
+ * in this case. It is also called once the A9 starts up, but does nothing in
+ * that case.
+ */
+int arch_cpu_init(void)
+{
+   /* Fire up the Cortex A9 */
+   tegra2_start();
+   return 0;
+}
+#endif
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 300c8fa..3341d11 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -23,6 +23,12 @@
 
 include $(TOPDIR)/config.mk
 
+# Tegra has an ARMv4T CPU which runs board_init_f(), so we must build this
+# file with compatible flags
+ifdef CONFIG_TEGRA2
+CFLAGS_arch/arm/lib/board.o += -march=armv4t
+endif
+
 LIB= $(obj)lib$(ARCH).o
 LIBGCC = $(obj)libgcc.o
 
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index d13537d..6af317b 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -188,9 +188,6 @@ int board_early_init_f(void)
 
/* Initialize periph GPIOs */
gpio_config_uart();
-
-   /* Init UART, scratch regs, and start CPU */
-   tegra2_start();
return 0;
 }
 #endif /* EARLY_INIT */
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 344e702..5a6b323 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -24,7 +24,6 @@
 #ifndef _BOARD_H_
 #define _BOARD_H_
 
-void tegra2_start(void);
 void gpio_config_uart(void);
 void gpio_config_mmc(void);
 int tegra2_mmc_init(int dev_index, int bus_width);
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 73e0f05..3454689 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -32,7 +32,7 @@
 #define CONFIG_TEGRA2  /* in a NVidia Tegra2 core */
 #define CONFIG_MACH_TEGRA_GENERIC  /* which is a Tegra generic machine */
 #define CONFIG_SYS_L2CACHE_OFF /* No L2 cache */
-
+#define CONFIG_ARCH_CPU_INIT   /* Fire up the A9 core */
 #define CONFIG_ENABLE_CORTEXA9 /* enable CPU (A9 complex) */
 
 #include asm/arch/tegra2.h   /* get chip and board defs */
-- 
1.7.3.1

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


[U-Boot] [PATCH 8/9] tegra2: Remove unneeded 'dynamic ram size' message

2011-10-13 Thread Simon Glass
This message is not required, since it is followed by an 'official' U-Boot
message.

U-Boot 2011.03-00048-gd7cb0d3 (May 11 2011 - 17:17:23)

TEGRA2
Board: NVIDIA Seaboard
dynamic ram_size = 1073741824
DRAM:  1 GiB

becomes:

TEGRA2
Board: NVIDIA Seaboard
DRAM:  1 GiB

This is a separate commit since it changes behavior.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/tegra2/board.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index 9fc4f1b..04c1683 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -65,10 +65,8 @@ int dram_init(void)
 
/* Now check it dynamically */
rs = get_ram_size(CONFIG_SYS_SDRAM_BASE, gd-ram_size);
-   if (rs) {
-   printf(dynamic ram_size = %lu\n, rs);
+   if (rs)
gd-bd-bi_dram[0].size = gd-ram_size = rs;
-   }
return 0;
 }
 
-- 
1.7.3.1

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


[U-Boot] [PATCH 5/9] tegra2: Remove unneeded boot code

2011-10-13 Thread Simon Glass
Since we have cache support built in we can remove Tegra's existing cache
initialization code amd other related dead code.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/start.S|   12 ---
 arch/arm/cpu/armv7/tegra2/ap20.h  |7 +--
 arch/arm/cpu/armv7/tegra2/board.c |8 --
 arch/arm/cpu/armv7/tegra2/config.mk   |   28 ---
 arch/arm/cpu/armv7/tegra2/lowlevel_init.S |  118 -
 5 files changed, 1 insertions(+), 172 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/tegra2/config.mk

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 7fdd422..fa79d73 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -81,18 +81,6 @@ _end_vect:
 _TEXT_BASE:
.word   CONFIG_SYS_TEXT_BASE
 
-#ifdef CONFIG_TEGRA2
-/*
- * Tegra2 uses 2 separate CPUs - the AVP (ARM7TDMI) and the CPU (dual A9s).
- * U-Boot runs on the AVP first, setting things up for the CPU (PLLs,
- * muxes, clocks, clamps, etc.). Then the AVP halts, and expects the CPU
- * to pick up its reset vector, which points here.
- */
-.globl _armboot_start
-_armboot_start:
-   .word _start
-#endif
-
 /*
  * These are defined in the board-specific linker script.
  */
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.h b/arch/arm/cpu/armv7/tegra2/ap20.h
index 1bb48d6..a4b4d73 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.h
+++ b/arch/arm/cpu/armv7/tegra2/ap20.h
@@ -95,13 +95,8 @@
 #define HALT_COP_EVENT_IRQ_1   (1  11)
 #define HALT_COP_EVENT_FIQ_1   (1  9)
 
-/* Prototypes */
-
+/* Start up the tegra2 SOC */
 void tegra2_start(void);
-void uart_init(void);
-void udelay(unsigned long);
-void cold_boot(void);
-void cache_configure(void);
 
 /* This is the main entry into U-Boot, used by the Cortex-A9 */
 extern void _start(void);
diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index e725134..9fc4f1b 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -55,14 +55,6 @@ unsigned int query_sdram_size(void)
}
 }
 
-void s_init(void)
-{
-#ifndef CONFIG_ICACHE_OFF
-   icache_enable();
-#endif
-   invalidate_dcache();
-}
-
 int dram_init(void)
 {
unsigned long rs;
diff --git a/arch/arm/cpu/armv7/tegra2/config.mk 
b/arch/arm/cpu/armv7/tegra2/config.mk
deleted file mode 100644
index 96c0795..000
--- a/arch/arm/cpu/armv7/tegra2/config.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# (C) Copyright 2010,2011
-# NVIDIA Corporation www.nvidia.com
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, ga...@denx.de
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-# Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
-PLATFORM_CPPFLAGS += -march=armv4
diff --git a/arch/arm/cpu/armv7/tegra2/lowlevel_init.S 
b/arch/arm/cpu/armv7/tegra2/lowlevel_init.S
index f24a2ff..6b86647 100644
--- a/arch/arm/cpu/armv7/tegra2/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/tegra2/lowlevel_init.S
@@ -26,14 +26,6 @@
 #include config.h
 #include version.h
 
-
-_TEXT_BASE:
-   .word   CONFIG_SYS_TEXT_BASE@ sdram load addr from config file
-
-.global invalidate_dcache
-invalidate_dcache:
-   mov pc, lr
-
.align  5
 .global reset_cpu
 reset_cpu:
@@ -47,113 +39,3 @@ _loop_forever:
b   _loop_forever
 rstctl:
.word   PRM_RSTCTRL
-
-.globl lowlevel_init
-lowlevel_init:
-   ldr sp, SRAM_STACK
-   str ip, [sp]
-   mov ip, lr
-   bl  s_init  @ go setup pll, mux  memory
-   ldr ip, [sp]
-   mov lr, ip
-
-   mov pc, lr  @ back to arch calling code
-
-
-.globl startup_cpu
-startup_cpu:
-   @ Initialize the AVP, clocks, and memory controller
-   @ SDRAM is guaranteed to be on at this point
-
-   ldr r0, =cold_boot  @ R0 = reset vector for CPU
-   bl  start_cpu   @ start the CPU
-
-   @ Transfer control to the AVP code
-   bl  halt_avp
-
-   @ Should never get here
-_loop_forever2:
-   b   _loop_forever2
-
-.globl cache_configure
-cache_configure:
-   stmdb   r13!,{r14}
-   @ 

[U-Boot] [PATCH 7/9] tegra2: Remove unused low-level Tegra2 UART code

2011-10-13 Thread Simon Glass
This was used by the AVP in early boot but is no longer used. Unless we
plan to enable it somehow it is not needed. In any case we should try
to use the ns16550 driver instead as it has the same code.

Signed-off-by: Simon Glass s...@chromium.org
---
 drivers/serial/Makefile|1 -
 drivers/serial/serial_tegra2.c |   77 
 drivers/serial/serial_tegra2.h |   29 ---
 3 files changed, 0 insertions(+), 107 deletions(-)
 delete mode 100644 drivers/serial/serial_tegra2.c
 delete mode 100644 drivers/serial/serial_tegra2.h

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 1dcc1c7..d2915f5 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -54,7 +54,6 @@ COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
 COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
-COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
 
 ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
diff --git a/drivers/serial/serial_tegra2.c b/drivers/serial/serial_tegra2.c
deleted file mode 100644
index 8ff34ea..000
--- a/drivers/serial/serial_tegra2.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation www.nvidia.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 ns16550.h
-#include asm/io.h
-#include asm/arch/tegra2.h
-#include serial_tegra2.h
-
-static void setup_uart(struct uart_ctlr *u)
-{
-   u32 reg;
-
-   /* Prepare the divisor value */
-   reg = NVRM_PLLP_FIXED_FREQ_KHZ * 1000 / NV_DEFAULT_DEBUG_BAUD / 16;
-
-   /* Set up UART parameters */
-   writel(UART_LCR_DLAB, u-uart_lcr);
-   writel(reg, u-uart_thr_dlab_0);
-   writel(0, u-uart_ier_dlab_0);
-   writel(0, u-uart_lcr);/* clear DLAB */
-   writel((UART_FCR_TRIGGER_3 | UART_FCR_FIFO_EN | \
-   UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR), u-uart_iir_fcr);
-   writel(0, u-uart_ier_dlab_0);
-   writel(UART_LCR_WLS_8, u-uart_lcr);   /* 8N1 */
-   writel(UART_MCR_RTS, u-uart_mcr);
-   writel(0, u-uart_msr);
-   writel(0, u-uart_spr);
-   writel(0, u-uart_irda_csr);
-   writel(0, u-uart_asr);
-   writel((UART_FCR_TRIGGER_3 | UART_FCR_FIFO_EN), u-uart_iir_fcr);
-
-   /* Flush any old characters out of the RX FIFO */
-   reg = readl(u-uart_lsr);
-
-   while (reg  UART_LSR_DR) {
-   reg = readl(u-uart_thr_dlab_0);
-   reg = readl(u-uart_lsr);
-   }
-}
-
-/*
- * Routine: uart_init
- * Description: init the UART clocks, muxes, and baudrate/parity/etc.
- */
-void uart_init(void)
-{
-   struct uart_ctlr *uart = (struct uart_ctlr *)NV_PA_APB_UARTD_BASE;
-#if defined(CONFIG_TEGRA2_ENABLE_UARTD)
-   setup_uart(uart);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
-#if defined(CONFIG_TEGRA2_ENABLE_UARTA)
-   uart = (struct uart_ctlr *)NV_PA_APB_UARTA_BASE;
-
-   setup_uart(uart);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTA */
-}
diff --git a/drivers/serial/serial_tegra2.h b/drivers/serial/serial_tegra2.h
deleted file mode 100644
index 5704800..000
--- a/drivers/serial/serial_tegra2.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation www.nvidia.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
- */
-
-#ifndef _SERIAL_TEGRA_H_
-#define 

[U-Boot] [PATCH 4/9] tegra2: Enable instruction cache

2011-10-13 Thread Simon Glass
Since low-level init is skipped, the instruction cache is never enabled on
Tegra2. This explicitly calls this initialization as soon as the A9 is
initialized.

Signed-off-by: Simon Glass s...@chromium.org
---
 board/nvidia/common/board.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 6af317b..0db95ff 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -177,6 +177,9 @@ int board_mmc_init(bd_t *bd)
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
+   /* We didn't do this init in start.S, so do it now */
+   cpu_init_cp15();
+
/* Initialize essential common plls */
clock_early_init();
 
-- 
1.7.3.1

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


[U-Boot] [PATCH 2/9] tegra2: Simplify tegra_start() boot path

2011-10-13 Thread Simon Glass
The Tegra2 boot path is more complicated than it needs to be. Since we want
to move to building most of U-Boot with ARMv7 and only a small part with
ARMv4T (for AVP) it should be as simple as possible.

This makes tegra2_start() into a simple function which either does AVP
init or A9 init depending on which core is running it. Both cores now
following the same init path, beginning at _start, and the special Tegra2
boot path code is no longer required.

Only two files need to be built for ARMv4T, and this is handled in the
Tegra2 CPU Makefile.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/tegra2/Makefile |7 -
 arch/arm/cpu/armv7/tegra2/ap20.c   |   54 +++
 arch/arm/cpu/armv7/tegra2/ap20.h   |3 ++
 3 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/Makefile 
b/arch/arm/cpu/armv7/tegra2/Makefile
index f673f03..955c3b6 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -23,6 +23,11 @@
 # MA 02111-1307 USA
 #
 
+# The AVP is ARMv4T architecture so we must use special compiler
+# flags for any startup files it might use.
+CFLAGS_arch/arm/cpu/armv7/tegra2/ap20.o += -march=armv4t
+CFLAGS_arch/arm/cpu/armv7/tegra2/clock.o += -march=armv4t
+
 include $(TOPDIR)/config.mk
 
 LIB=  $(obj)lib$(SOC).o
@@ -36,7 +41,7 @@ OBJS  := $(addprefix $(obj),$(COBJS) $(SOBJS))
 all:$(obj).depend $(LIB)
 
 $(LIB):$(OBJS)
-   $(AR) $(ARFLAGS) $@ $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
 
 #
 
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c b/arch/arm/cpu/armv7/tegra2/ap20.c
index 5cb4b1b..4c44bb3 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.c
+++ b/arch/arm/cpu/armv7/tegra2/ap20.c
@@ -31,7 +31,12 @@
 #include asm/arch/scu.h
 #include common.h
 
-u32 s_first_boot = 1;
+/* Returns 1 if the current CPU executing is a Cortex-A9, else 0 */
+static int ap20_cpu_is_cortexa9(void)
+{
+   u32 id = readb(NV_PA_PG_UP_BASE + PG_UP_TAG_0);
+   return id == (PG_UP_TAG_0_PID_CPU  0xff);
+}
 
 void init_pllx(void)
 {
@@ -283,38 +288,37 @@ void init_pmc_scratch(void)
writel(CONFIG_SYS_BOARD_ODMDATA, pmc-pmc_scratch20);
 }
 
-void cpu_start(void)
+void tegra2_start(void)
 {
struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
 
-   /* enable JTAG */
-   writel(0xC0, pmt-pmt_cfg_ctl);
+   /* If we are the AVP, start up the first Cortex-A9 */
+   if (!ap20_cpu_is_cortexa9()) {
+   /* enable JTAG */
+   writel(0xC0, pmt-pmt_cfg_ctl);
 
-   if (s_first_boot) {
/*
-* Need to set this before cold-booting,
-*  otherwise we'll end up in an infinite loop.
-*/
-   s_first_boot = 0;
-   cold_boot();
+   * If we are ARM7 - give it a different stack. We are about to
+   * start up the A9 which will want to use this one.
+   */
+   asm volatile(ldr   sp, =%c0\n
+   : : i(AVP_EARLY_BOOT_STACK_LIMIT));
+
+   start_cpu((u32)_start);
+   halt_avp();
+   /* not reached */
}
-}
 
-void tegra2_start()
-{
-   if (s_first_boot) {
-   /* Init Debug UART Port (115200 8n1) */
-   uart_init();
+   /* Init PMC scratch memory */
+   init_pmc_scratch();
 
-   /* Init PMC scratch memory */
-   init_pmc_scratch();
-   }
+   enable_scu();
 
-#ifdef CONFIG_ENABLE_CORTEXA9
-   /* take the mpcore out of reset */
-   cpu_start();
+   /* enable SMP mode and FW for CPU0, by writing to Auxiliary Ctl reg */
+   asm volatile(
+   mrcp15, 0, r0, c1, c0, 1\n
+   orrr0, r0, #0x41\n
+   mcrp15, 0, r0, c1, c0, 1\n);
 
-   /* configure cache */
-   cache_configure();
-#endif
+   /* FIXME: should have ap20's L2 disabled too? */
 }
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.h b/arch/arm/cpu/armv7/tegra2/ap20.h
index 49fe340..1bb48d6 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.h
+++ b/arch/arm/cpu/armv7/tegra2/ap20.h
@@ -102,3 +102,6 @@ void uart_init(void);
 void udelay(unsigned long);
 void cold_boot(void);
 void cache_configure(void);
+
+/* This is the main entry into U-Boot, used by the Cortex-A9 */
+extern void _start(void);
-- 
1.7.3.1

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


[U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()

2011-10-13 Thread Simon Glass
Some SOCs have do not start up with their 'main' CPU. The first U-Boot
code may then be executed with a CPU which does not have a CP15, or not a
useful one.

Here we split the initialization of CP15 into a separate call, which can
be performed later if required.

Once the main CPU is running, you should call cpu_init_cp15() to perform
this init as early as possible.

Existing ARMv7 boards which define CONFIG_SKIP_LOWLEVEL_INIT should not
need to change, this CP15 init is still skipped in that case. The only
impact for these boards is that the cpu_init_cp15() will be available
even if it is never used on these boards.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/start.S|   24 ++--
 arch/arm/include/asm/u-boot-arm.h |3 +++
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index db8e9d2..7fdd422 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -168,6 +168,7 @@ next:
 #endif
/* the mask ROM code should have PLL and others stable */
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
+   bl  cpu_reset_cp15
bl  cpu_init_crit
 #endif
 
@@ -305,17 +306,16 @@ jump_2_ram:
 _board_init_r_ofs:
.word board_init_r - _start
 
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*
  *
- * CPU_init_critical registers
+ * cpu_reset_cp15
  *
- * setup important registers
- * setup memory timing
+ * Setup CP15 registers (cache, MMU, TLBs). The I-cache is turned on unless
+ * CONFIG_SYS_ICACHE_OFF is defined.
  *
  */
-cpu_init_crit:
+.globl cpu_init_cp15
+cpu_init_cp15:
/*
 * Invalidate L1 I/D
 */
@@ -340,7 +340,19 @@ cpu_init_crit:
orr r0, r0, #0x1000 @ set bit 12 (I) I-cache
 #endif
mcr p15, 0, r0, c1, c0, 0
+   mov pc, lr  @ back to my caller
 
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+/*
+ *
+ * CPU_init_critical registers
+ *
+ * setup important registers
+ * setup memory timing
+ *
+ */
+cpu_init_crit:
/*
 * Jump to board specific initialization...
 * The Mask ROM will have already initialized
diff --git a/arch/arm/include/asm/u-boot-arm.h 
b/arch/arm/include/asm/u-boot-arm.h
index d3308f7..4ca75f9 100644
--- a/arch/arm/include/asm/u-boot-arm.h
+++ b/arch/arm/include/asm/u-boot-arm.h
@@ -46,6 +46,9 @@ extern ulong IRQ_STACK_START_IN;  /* 8 bytes in IRQ stack 
*/
 intcpu_init(void);
 intcleanup_before_linux(void);
 
+/* Set up ARMv7 MMU, caches and TLBs */
+void   cpu_init_cp15(void);
+
 /* cpu/.../arch/cpu.c */
 intarch_cpu_init(void);
 intarch_misc_init(void);
-- 
1.7.3.1

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


[U-Boot] [PATCH 6/9] tegra2: Remove unneeded config option

2011-10-13 Thread Simon Glass
CONFIG_ENABLE_CORTEXA9 and CONFIG_SKIP_RELOCATE_UBOOT are not needed,
so remove them.

Signed-off-by: Simon Glass s...@chromium.org
---
 include/configs/tegra2-common.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 3454689..4d59eda 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -33,7 +33,6 @@
 #define CONFIG_MACH_TEGRA_GENERIC  /* which is a Tegra generic machine */
 #define CONFIG_SYS_L2CACHE_OFF /* No L2 cache */
 #define CONFIG_ARCH_CPU_INIT   /* Fire up the A9 core */
-#define CONFIG_ENABLE_CORTEXA9 /* enable CPU (A9 complex) */
 
 #include asm/arch/tegra2.h   /* get chip and board defs */
 
@@ -43,7 +42,6 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
-#define CONFIG_SKIP_RELOCATE_UBOOT
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
-- 
1.7.3.1

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


Re: [U-Boot] [PATCH v3 5/6] fdt: ARM: Add fdtcontroladdr to set device tree address in environment

2011-10-13 Thread Simon Glass
Hi Mike,

On Thu, Oct 13, 2011 at 1:27 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Tuesday 11 October 2011 18:26:10 Simon Glass wrote:
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c

 +/**
 + * Decode the value of an environment variable and return it.
 + *
 + * @param name               Name of environemnt variable
 + * @param base               Number base to use (normally 10, or 16 for hex)
 + * @param default_val        Default value to return if the variable is not
 + *                   found
 + * @return the decoded value, or default_val if not found
 + */
 +static int getenv_int(const char *name, int base, int default_val)
 +{
 +     char tmp[64];   /* long enough for environment variables */
 +     int i = getenv_f(name, tmp, sizeof(tmp));
 +
 +     return (i  0)
 +             ? (int) simple_strtoul(tmp, NULL, base)
 +             : default_val;
 +}

 pretty much everyone does this with gd-baudrate.  would make sense to put
 this into common/cmd_nvedit.c and convert all arches.
 -mike


I was worried someone might say that. I will take a look.

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


[U-Boot] [PATCH 2/2] common: cosmetic: CONFIG_BOOTFILE checkpatch compliance

2011-10-13 Thread Joe Hershberger
Remove MK_STR from places that consume CONFIG_BOOTFILE to force all definitions 
to be string literals.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
Cc: Joe Hershberger joe.hershber...@gmail.com
Cc: Wolfgang Denk w...@denx.de
---
 common/env_common.c  |2 +-
 common/env_embedded.c|2 +-
 doc/README.usb   |2 +-
 include/configs/MPC8313ERDB.h|2 +-
 include/configs/MPC8323ERDB.h|2 +-
 include/configs/MPC8349EMDS.h|2 +-
 include/configs/MPC8349ITX.h |2 +-
 include/configs/MPC8360ERDK.h|2 +-
 include/configs/MPC837XERDB.h|2 +-
 include/configs/MPC8536DS.h  |2 +-
 include/configs/MPC8540ADS.h |2 +-
 include/configs/MPC8541CDS.h |2 +-
 include/configs/MPC8544DS.h  |2 +-
 include/configs/MPC8548CDS.h |2 +-
 include/configs/MPC8555CDS.h |2 +-
 include/configs/MPC8560ADS.h |2 +-
 include/configs/MPC8568MDS.h |2 +-
 include/configs/MPC8569MDS.h |2 +-
 include/configs/MPC8572DS.h  |2 +-
 include/configs/MPC8610HPCD.h|2 +-
 include/configs/MPC8641HPCN.h|2 +-
 include/configs/P1010RDB.h   |2 +-
 include/configs/P1022DS.h|2 +-
 include/configs/P1023RDS.h   |2 +-
 include/configs/P1_P2_RDB.h  |2 +-
 include/configs/P2020DS.h|2 +-
 include/configs/P2041RDB.h   |2 +-
 include/configs/RPXlite_DW.h |2 +-
 include/configs/SBC8540.h|2 +-
 include/configs/SIMPC8313.h  |2 +-
 include/configs/am3517_crane.h   |2 +-
 include/configs/am3517_evm.h |2 +-
 include/configs/aria.h   |2 +-
 include/configs/corenet_ds.h |2 +-
 include/configs/debris.h |2 +-
 include/configs/gr_cpci_ax2000.h |2 +-
 include/configs/gr_ep2s60.h  |2 +-
 include/configs/gr_xc3s_1500.h   |2 +-
 include/configs/grsim.h  |2 +-
 include/configs/grsim_leon2.h|2 +-
 include/configs/idmr.h   |2 +-
 include/configs/inka4x0.h|2 +-
 include/configs/mecp5123.h   |2 +-
 include/configs/mpc5121ads.h |2 +-
 include/configs/mpc7448hpc2.h|2 +-
 include/configs/mpr2.h   |2 +-
 include/configs/ms7720se.h   |2 +-
 include/configs/omap3_evm.h  |2 +-
 include/configs/p1_p2_rdb_pc.h   |2 +-
 include/configs/sbc8349.h|2 +-
 include/configs/sbc8548.h|2 +-
 include/configs/sbc8560.h|2 +-
 include/configs/sbc8641d.h   |2 +-
 include/configs/stxgp3.h |2 +-
 include/configs/stxssa.h |2 +-
 include/configs/vme8349.h|2 +-
 tools/env/fw_env.c   |2 +-
 57 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/common/env_common.c b/common/env_common.c
index 596af82..c7e9bea 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -112,7 +112,7 @@ const uchar default_environment[] = {
hostname= MK_STR(CONFIG_HOSTNAME) \0
 #endif
 #ifdef CONFIG_BOOTFILE
-   bootfile= MK_STR(CONFIG_BOOTFILE) \0
+   bootfile= CONFIG_BOOTFILE \0
 #endif
 #ifdef CONFIG_LOADADDR
loadaddr= MK_STR(CONFIG_LOADADDR) \0
diff --git a/common/env_embedded.c b/common/env_embedded.c
index 9b3018a..6ce1307 100644
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -166,7 +166,7 @@ env_t environment __PPCENV__ = {
hostname= MK_STR(CONFIG_HOSTNAME) \0
 #endif
 #ifdef CONFIG_BOOTFILE
-   bootfile= MK_STR(CONFIG_BOOTFILE) \0
+   bootfile= CONFIG_BOOTFILE \0
 #endif
 #ifdef CONFIG_LOADADDR
loadaddr= MK_STR(CONFIG_LOADADDR) \0
diff --git a/doc/README.usb b/doc/README.usb
index c4df9cd..ef1d6ba 100644
--- a/doc/README.usb
+++ b/doc/README.usb
@@ -169,7 +169,7 @@ All of these can be obtained from the bootp server if not 
set.
 
 #define CONFIG_IPADDR  10.0.0.2  (replace with your value)
 #define CONFIG_SERVERIP10.0.0.1  (replace with your value)
-#define CONFIG_BOOTFILEuImage
+#define CONFIG_BOOTFILEuImage
 
 
 The 'usb start' command should identify the adapter something like this:
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index aa7c114..d8e384a 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -598,7 +598,7 @@
 
 #define CONFIG_HOSTNAMEmpc8313erdb
 #define CONFIG_ROOTPATH/nfs/root/path
-#define CONFIG_BOOTFILEuImage
+#define CONFIG_BOOTFILEuImage
 #define CONFIG_UBOOTPATH   u-boot.bin  /* U-Boot image on TFTP server 
*/
 #define CONFIG_FDTFILE mpc8313erdb.dtb
 
diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h
index 5b73137..5cc9160 100644
--- a/include/configs/MPC8323ERDB.h
+++ 

[U-Boot] [PATCH 1/2] common: cosmetic: CONFIG_ROOTPATH checkpatch compliance

2011-10-13 Thread Joe Hershberger
Remove MK_STR from places that consume CONFIG_ROOTPATH to force all definitions 
to be string literals.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
Cc: Joe Hershberger joe.hershber...@gmail.com
Cc: Wolfgang Denk w...@denx.de
---
 common/env_common.c   |2 +-
 common/env_embedded.c |2 +-
 include/configs/DB64360.h |2 +-
 include/configs/DB64460.h |2 +-
 include/configs/MPC8313ERDB.h |2 +-
 include/configs/MPC8323ERDB.h |2 +-
 include/configs/MPC8349EMDS.h |2 +-
 include/configs/MPC8349ITX.h  |4 ++--
 include/configs/MPC8360ERDK.h |2 +-
 include/configs/MPC837XERDB.h |2 +-
 include/configs/MPC8536DS.h   |2 +-
 include/configs/MPC8540ADS.h  |2 +-
 include/configs/MPC8541CDS.h  |2 +-
 include/configs/MPC8544DS.h   |2 +-
 include/configs/MPC8548CDS.h  |2 +-
 include/configs/MPC8555CDS.h  |2 +-
 include/configs/MPC8560ADS.h  |2 +-
 include/configs/MPC8568MDS.h  |2 +-
 include/configs/MPC8569MDS.h  |2 +-
 include/configs/MPC8572DS.h   |2 +-
 include/configs/MPC8610HPCD.h |2 +-
 include/configs/MPC8641HPCN.h |2 +-
 include/configs/P1010RDB.h|2 +-
 include/configs/P1022DS.h |2 +-
 include/configs/P1_P2_RDB.h   |2 +-
 include/configs/P2020DS.h |2 +-
 include/configs/P2041RDB.h|2 +-
 include/configs/PN62.h|2 +-
 include/configs/RPXlite_DW.h  |2 +-
 include/configs/RRvision.h|2 +-
 include/configs/SBC8540.h |2 +-
 include/configs/SIMPC8313.h   |2 +-
 include/configs/aria.h|2 +-
 include/configs/bct-brettl2.h |2 +-
 include/configs/bf537-minotaur.h  |2 +-
 include/configs/bf537-srv1.h  |2 +-
 include/configs/bfin_adi_common.h |2 +-
 include/configs/blackstamp.h  |2 +-
 include/configs/blackvme.h|2 +-
 include/configs/corenet_ds.h  |2 +-
 include/configs/debris.h  |2 +-
 include/configs/dnp5370.h |2 +-
 include/configs/gr_cpci_ax2000.h  |2 +-
 include/configs/gr_ep2s60.h   |2 +-
 include/configs/gr_xc3s_1500.h|2 +-
 include/configs/grsim.h   |2 +-
 include/configs/grsim_leon2.h |2 +-
 include/configs/idmr.h|2 +-
 include/configs/inka4x0.h |2 +-
 include/configs/mecp5123.h|2 +-
 include/configs/mpc5121ads.h  |2 +-
 include/configs/p1_p2_rdb_pc.h|2 +-
 include/configs/pm9263.h  |2 +-
 include/configs/quantum.h |2 +-
 include/configs/sbc8349.h |2 +-
 include/configs/sbc8548.h |2 +-
 include/configs/sbc8560.h |2 +-
 include/configs/sbc8641d.h|2 +-
 include/configs/stxgp3.h  |2 +-
 include/configs/stxssa.h  |2 +-
 include/configs/vme8349.h |2 +-
 tools/env/fw_env.c|2 +-
 62 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/common/env_common.c b/common/env_common.c
index 19149b5..596af82 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -100,7 +100,7 @@ const uchar default_environment[] = {
preboot=  CONFIG_PREBOOT  \0
 #endif
 #ifdef CONFIG_ROOTPATH
-   rootpath= MK_STR(CONFIG_ROOTPATH) \0
+   rootpath= CONFIG_ROOTPATH \0
 #endif
 #ifdef CONFIG_GATEWAYIP
gatewayip=MK_STR(CONFIG_GATEWAYIP)\0
diff --git a/common/env_embedded.c b/common/env_embedded.c
index e438575..9b3018a 100644
--- a/common/env_embedded.c
+++ b/common/env_embedded.c
@@ -154,7 +154,7 @@ env_t environment __PPCENV__ = {
autoload= CONFIG_SYS_AUTOLOAD \0
 #endif
 #ifdef CONFIG_ROOTPATH
-   rootpath= MK_STR(CONFIG_ROOTPATH) \0
+   rootpath= CONFIG_ROOTPATH \0
 #endif
 #ifdef CONFIG_GATEWAYIP
gatewayip=MK_STR(CONFIG_GATEWAYIP)\0
diff --git a/include/configs/DB64360.h b/include/configs/DB64360.h
index 1f825fd..c3f3a24 100644
--- a/include/configs/DB64360.h
+++ b/include/configs/DB64360.h
@@ -201,7 +201,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x40;\0
 
 #define CONFIG_SERIAL  No. 1
 #define CONFIG_SERVERIP10.2.1.126
-#define CONFIG_ROOTPATH /mnt/yellow_dog_mini
+#define CONFIG_ROOTPATH/mnt/yellow_dog_mini
 
 
 #define CONFIG_TESTDRAMDATAy
diff --git a/include/configs/DB64460.h b/include/configs/DB64460.h
index 4218774..d48f092 100644
--- a/include/configs/DB64460.h
+++ b/include/configs/DB64460.h
@@ -139,7 +139,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x40;\0
 
 #define CONFIG_SERIAL  No. 1
 #define CONFIG_SERVERIP10.2.1.126
-#define CONFIG_ROOTPATH /mnt/yellow_dog_mini
+#define CONFIG_ROOTPATH/mnt/yellow_dog_mini
 
 
 

[U-Boot] [PATCH 0/8][v2] DaVinci EMAC for AM35x and HTKW mcx board support

2011-10-13 Thread Ilya Yanok
Hello,

These series bring support of DaVinci EMAC interface on TI AM35xx
processors as well as support for HTKW mcx board which uses it.
Changes:
 1. Common defines and register definitions moved to
drivers/net/davinci_emac.h
 2. Added coding/decoding of internal RAM addresses.
 3. DaVinci-specific PHY parts moved under #ifdefs.
 4. Added support for running with D-Cache enabled.
 5. Speed is hardcoded to 100Mbps. This definetely needs a better
solution but somehow existing code causes troubles.
 6. AM35xx-specific defines added into the separate header.
 7. AM3517 specific mux defines moved to common header.

Regards,

Signed-off-by: Ilya Yanok ya...@emcraft.com


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


  1   2   >