public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
@ 2010-05-19  8:57 Andreas Bießmann
  2010-05-19 14:34 ` Thomas Weber
  2010-05-21 21:07 ` Wolfgang Denk
  0 siblings, 2 replies; 8+ messages in thread
From: Andreas Bießmann @ 2010-05-19  8:57 UTC (permalink / raw)
  To: u-boot

This patch adds __io() macro to enable {in|out}[bwl] macros in
arch/arm/asm/io.h

Commit a45dde2293c816138e53c26eca6fd0322583f9a6 uses {in|out}[bwl] macros in
DM9000x and breaks compilation for arm devices.

Signed-off-by: Andreas Bie?mann <biessmann@corscience.de>
---
 arch/arm/include/asm/io.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 0a4b5be..ccbf80d 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -173,6 +173,13 @@ extern void __raw_readsl(unsigned int addr, void *data, int longlen);
 #if 0	/* XXX###XXX */
 #include <asm/arch/io.h>
 #endif	/* XXX###XXX */
+/*
+ * we need to define __io(p) for {in,out}[bwl] macros. This macro may be
+ * defined in a machine specific io definition earlier.
+ */
+#ifndef __io
+#define __io(p) (p)
+#endif
 
 /*
  *  IO port access primitives
-- 
1.7.1

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

* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
  2010-05-19  8:57 [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier Andreas Bießmann
@ 2010-05-19 14:34 ` Thomas Weber
  2010-05-21 21:07 ` Wolfgang Denk
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Weber @ 2010-05-19 14:34 UTC (permalink / raw)
  To: u-boot

Hello,
there is a typo in comment -> earlier.

Am 19.05.2010 10:57, schrieb Andreas Bie?mann:
> This patch adds __io() macro to enable {in|out}[bwl] macros in
> arch/arm/asm/io.h
> 
> Commit a45dde2293c816138e53c26eca6fd0322583f9a6 uses {in|out}[bwl] macros in
> DM9000x and breaks compilation for arm devices.
> 
> Signed-off-by: Andreas Bie?mann <biessmann@corscience.de>
> ---
>  arch/arm/include/asm/io.h |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index 0a4b5be..ccbf80d 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -173,6 +173,13 @@ extern void __raw_readsl(unsigned int addr, void *data, int longlen);
>  #if 0	/* XXX###XXX */
>  #include <asm/arch/io.h>
>  #endif	/* XXX###XXX */
> +/*
> + * we need to define __io(p) for {in,out}[bwl] macros. This macro may be
> + * defined in a machine specific io definition earlier.
> + */
> +#ifndef __io
> +#define __io(p) (p)
> +#endif
>  
>  /*
>   *  IO port access primitives

I tested it on Devkit8000.

Tested-by: Thomas Weber <weber@corscience.de>

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

* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
  2010-05-19  8:57 [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier Andreas Bießmann
  2010-05-19 14:34 ` Thomas Weber
@ 2010-05-21 21:07 ` Wolfgang Denk
  2010-05-25  8:15   ` Andreas Bießmann
  1 sibling, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2010-05-21 21:07 UTC (permalink / raw)
  To: u-boot

Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,

In message <1274259427-29386-1-git-send-email-biessmann@corscience.de> you wrote:
> This patch adds __io() macro to enable {in|out}[bwl] macros in
> arch/arm/asm/io.h
> 
> Commit a45dde2293c816138e53c26eca6fd0322583f9a6 uses {in|out}[bwl]
> macros in
> DM9000x and breaks compilation for arm devices.
> 
> Signed-off-by: Andreas Bie?mann <biessmann@corscience.de>
> ---
>  arch/arm/include/asm/io.h |    7 +++++++
>   1 files changed, 7 insertions(+), 0 deletions(-)

Hm... with this patch applied I see a lot of other warnings:

Configuring for netstar board...
In file included from timer.c:41:
/work/wd/tmp-arm/include2/asm/io.h:209:1: warning: "outb" redefined
In file included from timer.c:40:
/home/wd/git/u-boot/work/include/configs/omap1510.h:784:1: warning: this is the location of the previous definition
In file included from timer.c:41:
/work/wd/tmp-arm/include2/asm/io.h:210:1: warning: "outw" redefined
In file included from timer.c:40:
/home/wd/git/u-boot/work/include/configs/omap1510.h:785:1: warning: this is the location of the previous definition
In file included from timer.c:41:
/work/wd/tmp-arm/include2/asm/io.h:211:1: warning: "outl" redefined
In file included from timer.c:40:
/home/wd/git/u-boot/work/include/configs/omap1510.h:786:1: warning: this is the location of the previous definition
In file included from timer.c:41:
/work/wd/tmp-arm/include2/asm/io.h:213:1: warning: "inb" redefined
In file included from timer.c:40:
/home/wd/git/u-boot/work/include/configs/omap1510.h:788:1: warning: this is the location of the previous definition
In file included from timer.c:41:
/work/wd/tmp-arm/include2/asm/io.h:214:1: warning: "inw" redefined
In file included from timer.c:40:
/home/wd/git/u-boot/work/include/configs/omap1510.h:789:1: warning: this is the location of the previous definition
In file included from timer.c:41:
/work/wd/tmp-arm/include2/asm/io.h:215:1: warning: "inl" redefined
In file included from timer.c:40:
/home/wd/git/u-boot/work/include/configs/omap1510.h:790:1: warning: this is the location of the previous definition
In file included from display_options.c:27:
/work/wd/tmp-arm/include2/asm/io.h:209:1: warning: "outb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from display_options.c:24:
/home/wd/git/u-boot/work/include/configs/omap1510.h:784:1: warning: this is the location of the previous definition
In file included from display_options.c:27:
/work/wd/tmp-arm/include2/asm/io.h:210:1: warning: "outw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from display_options.c:24:
/home/wd/git/u-boot/work/include/configs/omap1510.h:785:1: warning: this is the location of the previous definition
In file included from display_options.c:27:
/work/wd/tmp-arm/include2/asm/io.h:211:1: warning: "outl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from display_options.c:24:
/home/wd/git/u-boot/work/include/configs/omap1510.h:786:1: warning: this is the location of the previous definition
In file included from display_options.c:27:
/work/wd/tmp-arm/include2/asm/io.h:213:1: warning: "inb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from display_options.c:24:
/home/wd/git/u-boot/work/include/configs/omap1510.h:788:1: warning: this is the location of the previous definition
In file included from display_options.c:27:
/work/wd/tmp-arm/include2/asm/io.h:214:1: warning: "inw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from display_options.c:24:
/home/wd/git/u-boot/work/include/configs/omap1510.h:789:1: warning: this is the location of the previous definition
In file included from display_options.c:27:
/work/wd/tmp-arm/include2/asm/io.h:215:1: warning: "inl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from display_options.c:24:
/home/wd/git/u-boot/work/include/configs/omap1510.h:790:1: warning: this is the location of the previous definition
In file included from cfi_flash.c:39:
/work/wd/tmp-arm/include2/asm/io.h:209:1: warning: "outb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from cfi_flash.c:37:
/home/wd/git/u-boot/work/include/configs/omap1510.h:784:1: warning: this is the location of the previous definition
In file included from cfi_flash.c:39:
/work/wd/tmp-arm/include2/asm/io.h:210:1: warning: "outw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from cfi_flash.c:37:
/home/wd/git/u-boot/work/include/configs/omap1510.h:785:1: warning: this is the location of the previous definition
In file included from cfi_flash.c:39:
/work/wd/tmp-arm/include2/asm/io.h:211:1: warning: "outl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from cfi_flash.c:37:
/home/wd/git/u-boot/work/include/configs/omap1510.h:786:1: warning: this is the location of the previous definition
In file included from cfi_flash.c:39:
/work/wd/tmp-arm/include2/asm/io.h:213:1: warning: "inb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from cfi_flash.c:37:
/home/wd/git/u-boot/work/include/configs/omap1510.h:788:1: warning: this is the location of the previous definition
In file included from cfi_flash.c:39:
/work/wd/tmp-arm/include2/asm/io.h:214:1: warning: "inw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from cfi_flash.c:37:
/home/wd/git/u-boot/work/include/configs/omap1510.h:789:1: warning: this is the location of the previous definition
In file included from cfi_flash.c:39:
/work/wd/tmp-arm/include2/asm/io.h:215:1: warning: "inl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from cfi_flash.c:37:
/home/wd/git/u-boot/work/include/configs/omap1510.h:790:1: warning: this is the location of the previous definition
In file included from nand_base.c:75:
/work/wd/tmp-arm/include2/asm/io.h:209:1: warning: "outb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from nand_base.c:59:
/home/wd/git/u-boot/work/include/configs/omap1510.h:784:1: warning: this is the location of the previous definition
In file included from nand_base.c:75:
/work/wd/tmp-arm/include2/asm/io.h:210:1: warning: "outw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from nand_base.c:59:
/home/wd/git/u-boot/work/include/configs/omap1510.h:785:1: warning: this is the location of the previous definition
In file included from nand_base.c:75:
/work/wd/tmp-arm/include2/asm/io.h:211:1: warning: "outl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from nand_base.c:59:
/home/wd/git/u-boot/work/include/configs/omap1510.h:786:1: warning: this is the location of the previous definition
In file included from nand_base.c:75:
/work/wd/tmp-arm/include2/asm/io.h:213:1: warning: "inb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from nand_base.c:59:
/home/wd/git/u-boot/work/include/configs/omap1510.h:788:1: warning: this is the location of the previous definition
In file included from nand_base.c:75:
/work/wd/tmp-arm/include2/asm/io.h:214:1: warning: "inw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from nand_base.c:59:
/home/wd/git/u-boot/work/include/configs/omap1510.h:789:1: warning: this is the location of the previous definition
In file included from nand_base.c:75:
/work/wd/tmp-arm/include2/asm/io.h:215:1: warning: "inl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from nand_base.c:59:
/home/wd/git/u-boot/work/include/configs/omap1510.h:790:1: warning: this is the location of the previous definition
In file included from jedec_flash.c:34:
/work/wd/tmp-arm/include2/asm/io.h:209:1: warning: "outb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from jedec_flash.c:32:
/home/wd/git/u-boot/work/include/configs/omap1510.h:784:1: warning: this is the location of the previous definition
In file included from jedec_flash.c:34:
/work/wd/tmp-arm/include2/asm/io.h:210:1: warning: "outw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from jedec_flash.c:32:
/home/wd/git/u-boot/work/include/configs/omap1510.h:785:1: warning: this is the location of the previous definition
In file included from jedec_flash.c:34:
/work/wd/tmp-arm/include2/asm/io.h:211:1: warning: "outl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from jedec_flash.c:32:
/home/wd/git/u-boot/work/include/configs/omap1510.h:786:1: warning: this is the location of the previous definition
In file included from jedec_flash.c:34:
/work/wd/tmp-arm/include2/asm/io.h:213:1: warning: "inb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from jedec_flash.c:32:
/home/wd/git/u-boot/work/include/configs/omap1510.h:788:1: warning: this is the location of the previous definition
In file included from jedec_flash.c:34:
/work/wd/tmp-arm/include2/asm/io.h:214:1: warning: "inw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from jedec_flash.c:32:
/home/wd/git/u-boot/work/include/configs/omap1510.h:789:1: warning: this is the location of the previous definition
In file included from jedec_flash.c:34:
/work/wd/tmp-arm/include2/asm/io.h:215:1: warning: "inl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from jedec_flash.c:32:
/home/wd/git/u-boot/work/include/configs/omap1510.h:790:1: warning: this is the location of the previous definition
In file included from ns16550.c:11:
/work/wd/tmp-arm/include2/asm/io.h:209:1: warning: "outb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from ns16550.c:7:
/home/wd/git/u-boot/work/include/configs/omap1510.h:784:1: warning: this is the location of the previous definition
In file included from ns16550.c:11:
/work/wd/tmp-arm/include2/asm/io.h:210:1: warning: "outw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from ns16550.c:7:
/home/wd/git/u-boot/work/include/configs/omap1510.h:785:1: warning: this is the location of the previous definition
In file included from ns16550.c:11:
/work/wd/tmp-arm/include2/asm/io.h:211:1: warning: "outl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from ns16550.c:7:
/home/wd/git/u-boot/work/include/configs/omap1510.h:786:1: warning: this is the location of the previous definition
In file included from ns16550.c:11:
/work/wd/tmp-arm/include2/asm/io.h:213:1: warning: "inb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from ns16550.c:7:
/home/wd/git/u-boot/work/include/configs/omap1510.h:788:1: warning: this is the location of the previous definition
In file included from ns16550.c:11:
/work/wd/tmp-arm/include2/asm/io.h:214:1: warning: "inw" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from ns16550.c:7:
/home/wd/git/u-boot/work/include/configs/omap1510.h:789:1: warning: this is the location of the previous definition
In file included from ns16550.c:11:
/work/wd/tmp-arm/include2/asm/io.h:215:1: warning: "inl" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from ns16550.c:7:
/home/wd/git/u-boot/work/include/configs/omap1510.h:790:1: warning: this is the location of the previous definition
In file included from cmd_pcmcia.c:60:
/work/wd/tmp-arm/include2/asm/io.h:209:1: warning: "outb" redefined
In file included from /home/wd/git/u-boot/work/include/configs/netstar.h:28,
                 from /work/wd/tmp-arm/include/config.h:4,
                 from /home/wd/git/u-boot/work/include/common.h:37,
                 from cmd_pcmcia.c:56:
/home/wd/git/u-boot/work/include/configs/omap1510.h:784:1: warning: this is the location of the previous definition
..
etc. etc.

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
It is practically impossible to teach good programming style to  stu-
dents that have had prior exposure to BASIC: as potential programmers
they are mentally mutilated beyond hope of regeneration.   - Dijkstra

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

* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
  2010-05-21 21:07 ` Wolfgang Denk
@ 2010-05-25  8:15   ` Andreas Bießmann
  2010-05-25 11:29     ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Bießmann @ 2010-05-25  8:15 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

Am 21.05.2010 23:07, schrieb Wolfgang Denk:
> Dear =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=,
> 
> In message <1274259427-29386-1-git-send-email-biessmann@corscience.de> you wrote:
>> This patch adds __io() macro to enable {in|out}[bwl] macros in
>> arch/arm/asm/io.h
>>
>> Commit a45dde2293c816138e53c26eca6fd0322583f9a6 uses {in|out}[bwl]
>> macros in
>> DM9000x and breaks compilation for arm devices.
>>
>> Signed-off-by: Andreas Bie?mann <biessmann@corscience.de>
>> ---
>>  arch/arm/include/asm/io.h |    7 +++++++
>>   1 files changed, 7 insertions(+), 0 deletions(-)
> 
> Hm... with this patch applied I see a lot of other warnings:

[snip lot of redefine warnings]

Warnings appeared due to too little testing on my side ... sorry for
that. Is there an easy way to build all e.g. arm-related
boards/configuration-sets in a test run?

We should discuss where to fix this issue.

It is a fact that commit a45dde2293c816138e53c26eca6fd0322583f9a6 breaks
compilation of arm boards using dm9000x driver.

Another fact is that mostly all arch/asm/io.h defines {in|out}[bxl]
macros except for arm (and sparc, they name them __arch_{put|get}[bwl]).
Arm defines them conditionally only if the macro __io(p) is defined.
By some reason omap1510 defines his own {in|out}[bxl]. My first argument
for removing this is that this boards definition is the only one
defining his own {in|out}[bxl] -> '# grep -nr outb\( include/configs/'
The second one is that kind of the definition is so common to put it in
generic arch/asm/io.h.

The other way around we could define the {in|out}[bxl] macros everywhere
is needed in board specific configuration files. Namely there are at least:

---8<---
grep -nr CONFIG_DRIVER_DM9000 include/configs/
include/configs/pm9261.h:248:#define CONFIG_DRIVER_DM9000			1
include/configs/davinci_dm355evm.h:55:#define CONFIG_DRIVER_DM9000		1
include/configs/scb9328.h:259:#define CONFIG_DRIVER_DM9000		1
include/configs/trizepsiv.h:292:#define CONFIG_DRIVER_DM9000		1
include/configs/devkit8000.h:75:#define	CONFIG_DRIVER_DM9000		1
include/configs/M5253DEMO.h:92:#define CONFIG_DRIVER_DM9000
include/configs/M5253DEMO.h:93:#ifdef CONFIG_DRIVER_DM9000
include/configs/davinci_dm355leopard.h:54:#define CONFIG_DRIVER_DM9000		1
include/configs/at91sam9261ek.h:146:#define CONFIG_DRIVER_DM9000		1
include/configs/ip04.h:75:#define CONFIG_DRIVER_DM9000	1
--->8---

(most of them are proven to be arm related)

The only argument doing this is ... we need a working DM9000 driver ;)

Any other comments?

I'm willing to build another patch but like to have this discussed before.

I think the easiest way to solve this is to create another patch
including exactely the changes sent before plus removing {in|out}[bxl]
macros in omap1510.h.

regards

Andreas Bie?mann

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

* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
  2010-05-25  8:15   ` Andreas Bießmann
@ 2010-05-25 11:29     ` Wolfgang Denk
  2010-05-26  9:49       ` Andreas Bießmann
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2010-05-25 11:29 UTC (permalink / raw)
  To: u-boot

Dear =?ISO-8859-1?Q?Andreas_Bie=DFmann?=,

In message <4BFB8708.4010408@corscience.de> you wrote:
>
> Warnings appeared due to too little testing on my side ... sorry for
> that. Is there an easy way to build all e.g. arm-related
> boards/configuration-sets in a test run?

Sure, and it's documented.

Try:

	./MAKEALL arm

> We should discuss where to fix this issue.

Thanks for addressing this.  At the moment this issue is blocking the
-rc1 pre-release, so I really appreciate if we could find a working
solution for this quickly.

> It is a fact that commit a45dde2293c816138e53c26eca6fd0322583f9a6 breaks
> compilation of arm boards using dm9000x driver.
> 
> Another fact is that mostly all arch/asm/io.h defines {in|out}[bxl]
> macros except for arm (and sparc, they name them __arch_{put|get}[bwl]).
> Arm defines them conditionally only if the macro __io(p) is defined.
> By some reason omap1510 defines his own {in|out}[bxl]. My first argument
> for removing this is that this boards definition is the only one
> defining his own {in|out}[bxl] -> '# grep -nr outb\( include/configs/'
> The second one is that kind of the definition is so common to put it in
> generic arch/asm/io.h.

Makes sense to me, especially since the omap1510 code is very old, so
we can assume it has not been adapted to later generalizations of such
code.

> The other way around we could define the {in|out}[bxl] macros everywhere
> is needed in board specific configuration files. Namely there are at least:

This does not sound attractive at all.

> I'm willing to build another patch but like to have this discussed before.

Thanks.

> I think the easiest way to solve this is to create another patch
> including exactely the changes sent before plus removing {in|out}[bxl]
> macros in omap1510.h.

Sounds like a plan to me.

Best regards,


Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Eureka!                                                 -- Archimedes

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

* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
  2010-05-25 11:29     ` Wolfgang Denk
@ 2010-05-26  9:49       ` Andreas Bießmann
  2010-05-26 17:50         ` Mike Frysinger
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Bießmann @ 2010-05-26  9:49 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

Am 25.05.2010 13:29, schrieb Wolfgang Denk:
> In message <4BFB8708.4010408@corscience.de> you wrote:

>> I think the easiest way to solve this is to create another patch
>> including exactely the changes sent before plus removing {in|out}[bwl]
>> macros in omap1510.h.

Well ... this statement was a bit precipitate. Just defining __io() to
get {in|out}[bwl] macros in asm/io.h for arch arm is dangerous cause the
enabled macros do conversion from/to little endian. This is ok for
some/most current arm devices but may be wrong for older ones (eg.
omap1510).

> Sounds like a plan to me.

I can not test the generated code on omap1510 therefore my current
suggestion is to modify commit a45dde2293c816138e53c26eca6fd0322583f9a6
to something like attached at end of this message. Each devices asm/io.h
using dm9000x defines __raw_{read|write}[bwl] and therefore it would be
an easy task (easier than rewriting arm asm/io.h).

Ben and Mike, can you please give a statement to this suggestion?

regards

Andreas Bie?mann

---
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index f121286..84f67b1 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -117,12 +117,12 @@ static void DM9000_iow(int reg, u8 value);

 /* DM9000 network board routine ---------------------------- */

-#define DM9000_outb(d,r) outb(d, r)
-#define DM9000_outw(d,r) outw(d, r)
-#define DM9000_outl(d,r) outl(d, r)
-#define DM9000_inb(r) inb(r)
-#define DM9000_inw(r) inw(r)
-#define DM9000_inl(r) inl(r)
+#define DM9000_outb(d,r) __raw_writeb(d, r)
+#define DM9000_outw(d,r) __raw_writew(d, r)
+#define DM9000_outl(d,r) __raw_writel(d, r)
+#define DM9000_inb(r) __raw_readb(r)
+#define DM9000_inw(r) __raw_readw(r)
+#define DM9000_inl(r) __raw_readl(r)

 #ifdef CONFIG_DM9000_DEBUG
 static void

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

* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
  2010-05-26  9:49       ` Andreas Bießmann
@ 2010-05-26 17:50         ` Mike Frysinger
  2010-05-26 20:19           ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2010-05-26 17:50 UTC (permalink / raw)
  To: u-boot

On Wednesday 26 May 2010 05:49:21 Andreas Bie?mann wrote:
> Am 25.05.2010 13:29, schrieb Wolfgang Denk:
> > In message <4BFB8708.4010408@corscience.de> you wrote:
> >> I think the easiest way to solve this is to create another patch
> >> including exactely the changes sent before plus removing {in|out}[bwl]
> >> macros in omap1510.h.
> 
> Well ... this statement was a bit precipitate. Just defining __io() to
> get {in|out}[bwl] macros in asm/io.h for arch arm is dangerous cause the
> enabled macros do conversion from/to little endian. This is ok for
> some/most current arm devices but may be wrong for older ones (eg.
> omap1510).
> 
> > Sounds like a plan to me.
> 
> I can not test the generated code on omap1510 therefore my current
> suggestion is to modify commit a45dde2293c816138e53c26eca6fd0322583f9a6
> to something like attached at end of this message. Each devices asm/io.h
> using dm9000x defines __raw_{read|write}[bwl] and therefore it would be
> an easy task (easier than rewriting arm asm/io.h).

i changed the accessors to use in/out macros as i thought that was the correct 
set of accessor functions to use.  looking at a set of definitions and picking 
a set because they look like they'll "just work" isnt how i set about it.

after having read the deviceiobook in the Linux kernel, i think the correct 
funcs to use here are the read/write helpers.  now that i have that 
information, looking at the definitions shows that this should work for ARM 
just fine.

so, to be clear, i think we should do:
-#define DM9000_outb(d,r) outb(d, r)
+#define DM9000_outb(d,r) writeb(d, r)
etc...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100526/d1860205/attachment.pgp 

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

* [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier
  2010-05-26 17:50         ` Mike Frysinger
@ 2010-05-26 20:19           ` Wolfgang Denk
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2010-05-26 20:19 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <201005261350.16464.vapier@gentoo.org> you wrote:
>
> i changed the accessors to use in/out macros as i thought that was the correct 
> set of accessor functions to use.  looking at a set of definitions and picking 
> a set because they look like they'll "just work" isnt how i set about it.
>
> after having read the deviceiobook in the Linux kernel, i think the correct 
> funcs to use here are the read/write helpers.  now that i have that 
> information, looking at the definitions shows that this should work for ARM 
> just fine.
>
> so, to be clear, i think we should do:
> -#define DM9000_outb(d,r) outb(d, r)
> +#define DM9000_outb(d,r) writeb(d, r)
> etc...

This seems to work for me.

Will send a patch to do this ASAP.

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
I am a computer. I am dumber than any human and smarter than any  ad-
ministrator.

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

end of thread, other threads:[~2010-05-26 20:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19  8:57 [U-Boot] [PATCH] arm:io.h: define __io() macro if not defined erlier Andreas Bießmann
2010-05-19 14:34 ` Thomas Weber
2010-05-21 21:07 ` Wolfgang Denk
2010-05-25  8:15   ` Andreas Bießmann
2010-05-25 11:29     ` Wolfgang Denk
2010-05-26  9:49       ` Andreas Bießmann
2010-05-26 17:50         ` Mike Frysinger
2010-05-26 20:19           ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox