[U-Boot] [PATCH] 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.
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

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

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

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

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

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

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

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
participants (4)
-
Andreas Bießmann
-
Mike Frysinger
-
Thomas Weber
-
Wolfgang Denk