Skip to contentSkip to conversation

nios2: convert ioremap to use dm cpu data

PATCH New Thomas Chou 1 participant 2 messages Oct 5, 2015 – Oct 13, 2015 NIOS2 architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nios2: convert ioremap to use dm cpu data

Convert ioremap() to use io_region_base in dm cpu global data.

Also remove three unused io functions, which have style issue and are replaced by macros already.

---
 arch/nios2/include/asm/io.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
arch/nios2/include/asm/io.h +2 -5
index 2200dab..d0adf08 100644
@@ -44,13 +44,10 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 
 static inline void *ioremap(unsigned long physaddr, unsigned long size)
 {
-	return (void *)(IO_REGION_BASE | physaddr);
+	DECLARE_GLOBAL_DATA_PTR;
+	return (void *)(gd->arch.io_region_base | physaddr);
 }
 
-extern unsigned char inb (unsigned char *port);
-extern unsigned short inw (unsigned short *port);
-extern unsigned inl (unsigned port);
-
 #define __raw_writeb(v,a)       (*(volatile unsigned char  *)(a) = (v))
 #define __raw_writew(v,a)       (*(volatile unsigned short *)(a) = (v))
 #define __raw_writel(v,a)       (*(volatile unsigned int   *)(a) = (v))
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 nios2: convert ioremap to use dm cpu data

Quoted 10 lines · Thomas Chou

Convert ioremap() to use io_region_base in dm cpu global data.

Also remove three unused io functions, which have style issue and are replaced by macros already.

---
  arch/nios2/include/asm/io.h | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)

Applied to u-boot-nios.

Quoted 21 lines
arch/nios2/include/asm/io.h +2 -5
index 2200dab..d0adf08 100644
@@ -44,13 +44,10 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 
  static inline void *ioremap(unsigned long physaddr, unsigned long size)
  {
-	return (void *)(IO_REGION_BASE | physaddr);
+	DECLARE_GLOBAL_DATA_PTR;
+	return (void *)(gd->arch.io_region_base | physaddr);
  }
 
-extern unsigned char inb (unsigned char *port);
-extern unsigned short inw (unsigned short *port);
-extern unsigned inl (unsigned port);
-
  #define __raw_writeb(v,a)       (*(volatile unsigned char  *)(a) = (v))
  #define __raw_writew(v,a)       (*(volatile unsigned short *)(a) = (v))
  #define __raw_writel(v,a)       (*(volatile unsigned int   *)(a) = (v))