All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] improve printf behavior on arm/pxa after enabling 64bit support in printf by default.
@ 2010-03-29 12:23 Mikhail Kshevetskiy
  2010-04-09 21:40 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Mikhail Kshevetskiy @ 2010-03-29 12:23 UTC (permalink / raw)
  To: u-boot

commit 4b142febff71eabdb7ddbb125c7b583b24ddc434 (common: delete
CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL) breaks printf on my
arm/pxa270 board. For example, the code

	int a = 128;
	printf("a= %d\n", a);

will print zero on the console. The problem reproduced on gcc 4.1.1,
4.3.3, 4.4.1 and 4.4.2.

This patch fix printf unless you'll need printing 64-bit values.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@gmail.com>
---
 cpu/pxa/config.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/pxa/config.mk b/cpu/pxa/config.mk
index a05d69c..d87b5e0 100644
--- a/cpu/pxa/config.mk
+++ b/cpu/pxa/config.mk
@@ -24,7 +24,7 @@
 
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
-PLATFORM_CPPFLAGS += -march=armv5te -mtune=xscale
+PLATFORM_CPPFLAGS += -march=armv5t -mtune=xscale
 # =========================================================================
 #
 # Supply options according to compiler version
-- 
1.7.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/2] improve printf behavior on arm/pxa after enabling 64bit support in printf by default.
  2010-03-29 12:23 [U-Boot] [PATCH 1/2] improve printf behavior on arm/pxa after enabling 64bit support in printf by default Mikhail Kshevetskiy
@ 2010-04-09 21:40 ` Wolfgang Denk
  2010-04-14 17:38   ` Marek Vasut
       [not found]   ` <j2kb70f2f961004141612te0cff7b5h8c38e9255937f1dc@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Denk @ 2010-04-09 21:40 UTC (permalink / raw)
  To: u-boot

Dear Mikhail Kshevetskiy,

In message <20100329162346.017a43dc@laska.campus-ws.pu.ru> you wrote:
> commit 4b142febff71eabdb7ddbb125c7b583b24ddc434 (common: delete
> CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL) breaks printf on my
> arm/pxa270 board. For example, the code
> 
> 	int a = 128;
> 	printf("a= %d\n", a);
> 
> will print zero on the console. The problem reproduced on gcc 4.1.1,
> 4.3.3, 4.4.1 and 4.4.2.
> 
> This patch fix printf unless you'll need printing 64-bit values.

I doubt that your patch addresses the real cause of the problem.
Did you check if the stack alignment problem discussed here earlier
has been fixed for your architecture?

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: wd at denx.de
Die Scheu vor Verantwortung ist die Krankheit unserer Zeit.
                                                 -- Otto von Bismarck

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/2] improve printf behavior on arm/pxa after enabling 64bit support in printf by default.
  2010-04-09 21:40 ` Wolfgang Denk
@ 2010-04-14 17:38   ` Marek Vasut
       [not found]   ` <j2kb70f2f961004141612te0cff7b5h8c38e9255937f1dc@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2010-04-14 17:38 UTC (permalink / raw)
  To: u-boot

Dne P? 9. dubna 2010 23:40:11 Wolfgang Denk napsal(a):
> Dear Mikhail Kshevetskiy,
> 
> In message <20100329162346.017a43dc@laska.campus-ws.pu.ru> you wrote:
> > commit 4b142febff71eabdb7ddbb125c7b583b24ddc434 (common: delete
> > CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL) breaks printf on
> > my arm/pxa270 board. For example, the code
> > 
> > 	int a = 128;
> > 	printf("a= %d\n", a);
> > 
> > will print zero on the console. The problem reproduced on gcc 4.1.1,
> > 4.3.3, 4.4.1 and 4.4.2.
> > 
> > This patch fix printf unless you'll need printing 64-bit values.
> 
> I doubt that your patch addresses the real cause of the problem.
> Did you check if the stack alignment problem discussed here earlier
> has been fixed for your architecture?
> 
> Best regards,
> 
> Wolfgang Denk

Yes, this is a NAK, sorry. The real problem is addressed by "[PATCH] PXA: Align 
stack to 8 bytes". LDRD and STRD need the memory address aligned to 8 bytes.

Besides my patch also fixes the NAND driver, which didn't work as well and 
possibly various other issues.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/2] improve printf behavior on arm/pxa after enabling 64bit support in printf by default.
       [not found]   ` <j2kb70f2f961004141612te0cff7b5h8c38e9255937f1dc@mail.gmail.com>
@ 2010-04-15  7:44     ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2010-04-15  7:44 UTC (permalink / raw)
  To: u-boot

Dne ?t 15. dubna 2010 01:12:30 Mikhail Kshevetskiy napsal(a):
> Yes, you was right. This is definitely an alignment issue.
> Here is a patch to fix this issue.

Thanks, actually, I pushed a different patch that fixed the stack alignment 
issue, but forgot to reserve the space for abort stack in my patch. Therefore I 
pushed a patch on top of mine based on your patch. The patch is attached below.

Ah also please, keep track of the u-boot-pxa.git repo, that should contain most 
recent fixes for xscale. http://git.denx.de/?p=u-boot/u-boot-pxa.git;a=summary
> 
> Sorry for attaching file. I am in a trip and use web browser for sending
> mail

Fine by me.

But please, stop top posting (post below the mail or into the body). It's some 
rule that improves readability. Thanks!
> 
> 2010/4/10 Wolfgang Denk <wd@denx.de>:
> > Dear Mikhail Kshevetskiy,
> > 
> > In message <20100329162346.017a43dc@laska.campus-ws.pu.ru> you wrote:
> >> commit 4b142febff71eabdb7ddbb125c7b583b24ddc434 (common: delete
> >> CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL) breaks printf on
> >> my arm/pxa270 board. For example, the code
> >> 
> >>       int a = 128;
> >>       printf("a= %d\n", a);
> >> 
> >> will print zero on the console. The problem reproduced on gcc 4.1.1,
> >> 4.3.3, 4.4.1 and 4.4.2.
> >> 
> >> This patch fix printf unless you'll need printing 64-bit values.
> > 
> > I doubt that your patch addresses the real cause of the problem.
> > Did you check if the stack alignment problem discussed here earlier
> > has been fixed for your architecture?
> > From: Marek Vasut <marek.vasut@gmail.com>

Date: Thu, 15 Apr 2010 09:35:04 +0200
Subject: [PATCH] PXA: Fix abort stack

The stack alignment patch didn't reserve space for abort stack anymore. This
patch fixes the problem.

Original patch that pointed this issue out was by Mikhail Kshevetskiy.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/cpu/pxa/start.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index f7236bf..3989fa6 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -140,8 +140,8 @@ stack_setup:
 #ifdef CONFIG_USE_IRQ
        sub     r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
 #endif /* CONFIG_USE_IRQ */
-       bic     sp, r0, #7              /* leave 4 words for abort-stack    */
-                                       /* NOTE: stack MUST be aligned to   */
+       sub     r0, r0, #12             /* leave 3 words for abort-stack    */
+       bic     sp, r0, #7              /* NOTE: stack MUST be aligned to   */
                                        /* 8 bytes in case we want to use   */
                                        /* 64bit datatypes (eg. VSPRINTF64) */
 
-- 
1.7.0
> > 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: wd at denx.de
> > Die Scheu vor Verantwortung ist die Krankheit unserer Zeit.
> >                                                 -- Otto von Bismarck

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-15  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29 12:23 [U-Boot] [PATCH 1/2] improve printf behavior on arm/pxa after enabling 64bit support in printf by default Mikhail Kshevetskiy
2010-04-09 21:40 ` Wolfgang Denk
2010-04-14 17:38   ` Marek Vasut
     [not found]   ` <j2kb70f2f961004141612te0cff7b5h8c38e9255937f1dc@mail.gmail.com>
2010-04-15  7:44     ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.