net: dm9000x: use standard I/O accessors
PATCH 1/1 net: dm9000x: use standard I/O accessors
The current dm9000x driver accesses its memory mapped registers directly instead of using the standard I/O accessors. This can cause problems on Blackfin systems as the accesses can get out of order. So convert the direct volatile dereferences to use the normal in/out macros.
--- drivers/net/dm9000x.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/dm9000x.c +6 -6
@@ -117,12 +117,12 @@ static void DM9000_iow(int reg, u8 value);/* DM9000 network board routine ---------------------------- */ -#define DM9000_outb (d,r) ( *(volatile u8 *)r = d ) -#define DM9000_outw (d,r) ( *(volatile u16 *)r = d ) -#define DM9000_outl (d,r) ( *(volatile u32 *)r = d ) -#define DM9000_inb (r) (*(volatile u8 *)r) -#define DM9000_inw (r) (*(volatile u16 *)r) -#define DM9000_inl (r) (*(volatile u32 *)r) +#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)#ifdef CONFIG_DM9000_DEBUG static void
Signature · 1 line
1.7.0.4
Ben Warren
AppliedPATCH 1/1 net: dm9000x: use standard I/O accessors
Mike,
Quoted 24 lines · Mike Frysinger
The current dm9000x driver accesses its memory mapped registers directly instead of using the standard I/O accessors. This can cause problems on Blackfin systems as the accesses can get out of order. So convert the direct volatile dereferences to use the normal in/out macros.
Signed-off-by Mike Frysinger<[email protected]>--- drivers/net/dm9000x.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)drivers/net/dm9000x.c +0
-5@@ -117,12 +117,12 @@ static void DM9000_iow(int reg, u8 value);/* DM9000 network board routine ---------------------------- */ -#define DM9000_outb (d,r) ( *(volatile u8 *)r = d ) -#define DM9000_outw (d,r) ( *(volatile u16 *)r = d ) -#define DM9000_outl (d,r) ( *(volatile u32 *)r = d ) -#define DM9000_inb (r) (*(volatile u8 *)r) -#define DM9000_inw (r) (*(volatile u16 *)r)
drivers/net/dm9000x.c static void DM9000_iow(int reg, u8 value); · line 128
Quoted 10 lines
drivers/net/dm9000x.c +6
-1-#define DM9000_inl (r) (*(volatile u32 *)r) +#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)#ifdef CONFIG_DM9000_DEBUG static void
Applied to net repo.
thanks,
Ben
PATCH 1/1 net: dm9000x: use standard I/O accessors
Quoted 39 lines · Ben Warren
Mike,
Quoted 24 lines · Mike Frysinger
The current dm9000x driver accesses its memory mapped registers directly instead of using the standard I/O accessors. This can cause problems on Blackfin systems as the accesses can get out of order. So convert the direct volatile dereferences to use the normal in/out macros.
Signed-off-by Mike Frysinger<[email protected]>--- drivers/net/dm9000x.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)drivers/net/dm9000x.c +0
-5@@ -117,12 +117,12 @@ static void DM9000_iow(int reg, u8 value);/* DM9000 network board routine ---------------------------- */ -#define DM9000_outb (d,r) ( *(volatile u8 *)r = d ) -#define DM9000_outw (d,r) ( *(volatile u16 *)r = d ) -#define DM9000_outl (d,r) ( *(volatile u32 *)r = d ) -#define DM9000_inb (r) (*(volatile u8 *)r) -#define DM9000_inw (r) (*(volatile u16 *)r)drivers/net/dm9000x.c static void DM9000_iow(int reg, u8 value); · line 128
Quoted 10 lines
drivers/net/dm9000x.c +6
-1-#define DM9000_inl (r) (*(volatile u32 *)r) +#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)#ifdef CONFIG_DM9000_DEBUG static voidApplied to net repo.
Quoted 6 lines
thanks,
Ben
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Hi,
this patch breaks compilation for devkit8000 (ARM, Cortex-A8)
dm9000x.c: In function 'dm9000_outblk_8bit':
dm9000x.c:148: warning: implicit declaration of function 'outb'dm9000x.c: In function 'dm9000_outblk_16bit':
dm9000x.c:157: warning: implicit declaration of function 'outw'dm9000x.c: In function 'dm9000_outblk_32bit':
dm9000x.c:165: warning: implicit declaration of function 'outl'dm9000x.c: In function 'dm9000_inblk_8bit':
dm9000x.c:172: warning: implicit declaration of function 'inb'dm9000x.c: In function 'dm9000_inblk_16bit':
dm9000x.c:181: warning: implicit declaration of function 'inw'dm9000x.c: In function 'dm9000_inblk_32bit':
dm9000x.c:189: warning: implicit declaration of function 'inl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_inblk_8bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:172: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `DM9000_ior':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:566: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:567: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `DM9000_iow':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:576: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:577: undefined
reference to `outb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx_status_8bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:213: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:216: undefined
reference to `inb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:216: undefined
reference to `inb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:219: undefined
reference to `inb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:219: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_outblk_8bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:148: undefined
reference to `outb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:476: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_send':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:412: undefined
reference to `outb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx_status_32bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:196: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:198: undefined
reference to `inl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_inblk_32bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:189: undefined
reference to `inl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_outblk_32bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:165: undefined
reference to `outl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx_status_16bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:205: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:207: undefined
reference to `inw'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:208: undefined
reference to `inw'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_inblk_16bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:181: undefined
reference to `inw'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_outblk_16bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:157: undefined
reference to `outw' /home/tweber/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(bpabi.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0' /home/tweber/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(_divdi3.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0' /home/tweber/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(_udivdi3.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0'
make: *** [u-boot] Error 1
I think the arch/arm/include/asm/io.h needs some rework with the __io definition. Is it the right way?
Thomas
PATCH 1/1 net: dm9000x: use standard I/O accessors
Quoted 131 lines · Thomas Weber
Quoted 41 lines · Ben Warren
Mike,
Quoted 25 lines · Mike Frysinger
The current dm9000x driver accesses its memory mapped registers directly instead of using the standard I/O accessors. This can cause problems on Blackfin systems as the accesses can get out of order. So convert the direct volatile dereferences to use the normal in/out macros.
Signed-off-by Mike Frysinger<[email protected]>--- drivers/net/dm9000x.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)drivers/net/dm9000x.c +0
-5@@ -117,12 +117,12 @@ static void DM9000_iow(int reg, u8 value);/* DM9000 network board routine ---------------------------- */ -#define DM9000_outb (d,r) ( *(volatile u8 *)r = d ) -#define DM9000_outw (d,r) ( *(volatile u16 *)r = d ) -#define DM9000_outl (d,r) ( *(volatile u32 *)r = d ) -#define DM9000_inb (r) (*(volatile u8 *)r) -#define DM9000_inw (r) (*(volatile u16 *)r)drivers/net/dm9000x.c static void DM9000_iow(int reg, u8 value); · line 128
Quoted 10 lines
drivers/net/dm9000x.c +6
-1-#define DM9000_inl (r) (*(volatile u32 *)r) +#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)#ifdef CONFIG_DM9000_DEBUG static voidApplied to net repo.
Quoted 7 lines
thanks,
Ben
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-bootHi,
this patch breaks compilation for devkit8000 (ARM, Cortex-A8)
dm9000x.c: In function 'dm9000_outblk_8bit':
dm9000x.c:148: warning: implicit declaration of function 'outb'dm9000x.c: In function 'dm9000_outblk_16bit':
dm9000x.c:157: warning: implicit declaration of function 'outw'dm9000x.c: In function 'dm9000_outblk_32bit':
dm9000x.c:165: warning: implicit declaration of function 'outl'dm9000x.c: In function 'dm9000_inblk_8bit':
dm9000x.c:172: warning: implicit declaration of function 'inb'dm9000x.c: In function 'dm9000_inblk_16bit':
dm9000x.c:181: warning: implicit declaration of function 'inw'dm9000x.c: In function 'dm9000_inblk_32bit':
dm9000x.c:189: warning: implicit declaration of function 'inl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_inblk_8bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:172: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `DM9000_ior':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:566: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:567: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `DM9000_iow':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:576: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:577: undefined
reference to `outb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx_status_8bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:213: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:216: undefined
reference to `inb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:216: undefined
reference to `inb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:219: undefined
reference to `inb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:219: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_outblk_8bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:148: undefined
reference to `outb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:476: undefined
reference to `inb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_send':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:412: undefined
reference to `outb'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx_status_32bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:196: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:198: undefined
reference to `inl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_inblk_32bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:189: undefined
reference to `inl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_outblk_32bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:165: undefined
reference to `outl'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_rx_status_16bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:205: undefined
reference to `outb'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:207: undefined
reference to `inw'/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:208: undefined
reference to `inw'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_inblk_16bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:181: undefined
reference to `inw'
drivers/net/libnet.a(dm9000x.o): In function `dm9000_outblk_16bit':/home/tweber/work/git/u-boot/drivers/net/dm9000x.c:157: undefined
reference to `outw' /home/tweber/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(bpabi.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0' /home/tweber/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(_divdi3.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0' /home/tweber/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(_udivdi3.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0'
make: *** [u-boot] Error 1
Quoted 9 lines
I think the
arch/arm/include/asm/io.hneeds some rework with the__iodefinition. Is it the right way?Thomas
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Hi,
#define __io
in devkit8000.h fixes the upper part of the error messages.
/home/thomas/toolchains/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(bpabi.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0' /home/thomas/toolchains/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(_divdi3.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0' /home/thomas/toolchains/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/armv4t/libgcc.a(_udivdi3.o):(.ARM.exidx+0x0):
undefined reference to `__aeabi_unwind_cpp_pr0'
make: *** [u-boot] Error 1
is still there.
Thomas