Skip to contentSkip to conversation

arm:io.h: define __io() macro if not defined erlier

PATCH New Andreas Bießmann 4 participants 8 messages May 19, 2010 – May 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

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.

---
 arch/arm/include/asm/io.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/include/asm/io.h +7 -0
index 0a4b5be..ccbf80d 100644
@@ -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
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

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

Am 19.05.2010 10:57, schrieb Andreas Bie?mann:

Quoted 19 lines

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.

---
 arch/arm/include/asm/io.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/include/asm/io.h +0 -0
index 0a4b5be..ccbf80d 100644
@@ -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 */

arch/arm/include/asm/io.h extern void __raw_readsl(unsigned int addr, void *data, int longlen); · line 185

Quoted 10 lines
arch/arm/include/asm/io.h +7 -0
+/*
+ * 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.

#2 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

In reply to Andreas Bießmann

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

Quoted 11 lines · In message <[email protected]> you…

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.

---
 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

Signature · 6 lines
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
#3 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

Dear Wolfgang,

Am 21.05.2010 23:07, schrieb Wolfgang Denk:

Quoted 10 lines

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

Quoted 7 lines · In message <[email protected]> you…

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.

Quoted 6 lines
Quoted 4 lines
---
 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

#4 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

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

Quoted 4 lines · In message <[email protected]> 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

Quoted 1 line

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.

Quoted 11 lines

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.

Quoted 2 lines

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.

Quoted 1 line

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

Thanks.

Quoted 3 lines

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

Signature · 4 lines
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
#5 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

Dear Wolfgang,

Am 25.05.2010 13:29, schrieb Wolfgang Denk:

Quoted 5 lines
Quoted 3 lines · In message <[email protected]> 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).

Quoted 1 line

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

---

drivers/net/dm9000x.c +6 -6
index f121286..84f67b1 100644
@@ -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
#6 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

Quoted 12 lines · On Wednesday 26 May 2010 05:49:21 Andreas Bie?mann wrote:

Am 25.05.2010 13:29, schrieb Wolfgang Denk:

Quoted 4 lines
Quoted 3 lines · In message <[email protected]> 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).

Quoted 7 lines
Quoted 1 line

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

#7 lore raw

PATCH 1/1 arm:io.h: define __io() macro if not defined erlier

Dear Mike Frysinger,

Quoted 13 lines · In message <[email protected]> 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:

(quoted diff) +1 -1
-#define DM9000_outb(d,r) outb(d, r)
+#define DM9000_outb(d,r) writeb(d, r)
Quoted 1 line

etc...

This seems to work for me.

Will send a patch to do this ASAP.

Best regards,

Wolfgang Denk

Signature · 5 lines
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.