Skip to contentSkip to conversation

nios2: change ioremap to map_physmem

PATCH New Thomas Chou 2 participants 13 messages Nov 14, 2015 – Nov 18, 2015

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

cover nios2: change ioremap to map_physmem

Change ioremap() to map_physmem(,,MAP_NOCACHE), as it is more used in u-boot. There are no other archs use ioremap(), except nios2.

Thomas Chou (10):
altera_jtag_uart: change ioremap to map_physmem
altera_uart: change ioremap to map_physmem
altera_timer: change ioremap to map_physmem
altera_spi: change ioremap to map_physmem
altera_sysid: change ioremap to map_physmem
altera_tse: change ioremap to map_physmem
altera_qspi: change ioremap to map_physmem
altera_pio: change ioremap to map_physmem
nios2: dma-mapping.h: change ioremap to map_physmem
nios2: zap ioremap

 arch/nios2/include/asm/dma-mapping.h | 2 +-
 arch/nios2/include/asm/io.h          | 6 ------
 drivers/gpio/altera_pio.c            | 5 +++--
 drivers/misc/altera_sysid.c          | 5 +++--
 drivers/mtd/altera_qspi.c            | 2 +-
 drivers/net/altera_tse.c             | 2 +-
 drivers/serial/altera_jtag_uart.c    | 5 +++--
 drivers/serial/altera_uart.c         | 5 +++--
 drivers/spi/altera_spi.c             | 5 +++--
 drivers/timer/altera_timer.c         | 5 +++--
 10 files changed, 21 insertions(+), 21 deletions(-)
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/10 altera_jtag_uart: change ioremap to map_physmem

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/serial/altera_jtag_uart.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/serial/altera_jtag_uart.c +3 -2
index c77bea3..cb11b31 100644
@@ -97,8 +97,9 @@ static int altera_jtaguart_ofdata_to_platdata(struct udevice *dev)
 {
 	struct altera_jtaguart_platdata *plat = dev_get_platdata(dev);
 
-	plat->regs = ioremap(dev_get_addr(dev),
-		sizeof(struct altera_jtaguart_regs));
+	plat->regs = map_physmem(dev_get_addr(dev),
+				 sizeof(struct altera_jtaguart_regs),
+				 MAP_NOCACHE);
 
 	return 0;
 }
Signature · 1 line
2.5.0
#2 lore raw

PATCH 2/10 altera_uart: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/serial/altera_uart.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/serial/altera_uart.c +3 -2
index 5d76c33..eff9c59 100644
@@ -89,8 +89,9 @@ static int altera_uart_ofdata_to_platdata(struct udevice *dev)
 {
 	struct altera_uart_platdata *plat = dev_get_platdata(dev);
 
-	plat->regs = ioremap(dev_get_addr(dev),
-		sizeof(struct altera_uart_regs));
+	plat->regs = map_physmem(dev_get_addr(dev),
+				 sizeof(struct altera_uart_regs),
+				 MAP_NOCACHE);
 	plat->uartclk = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
 		"clock-frequency", 0);
 
Signature · 1 line
2.5.0
#3 lore raw

PATCH 3/10 altera_timer: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/timer/altera_timer.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/timer/altera_timer.c +3 -2
index 46a598a..971ed38 100644
@@ -75,8 +75,9 @@ static int altera_timer_ofdata_to_platdata(struct udevice *dev)
 {
 	struct altera_timer_platdata *plat = dev_get_platdata(dev);
 
-	plat->regs = ioremap(dev_get_addr(dev),
-		sizeof(struct altera_timer_regs));
+	plat->regs = map_physmem(dev_get_addr(dev),
+				 sizeof(struct altera_timer_regs),
+				 MAP_NOCACHE);
 	plat->clock_rate = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
 		"clock-frequency", 0);
 
Signature · 1 line
2.5.0
#4 lore raw

PATCH 4/10 altera_spi: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/spi/altera_spi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/spi/altera_spi.c +3 -2
index 3e09592..eb1ba27 100644
@@ -174,8 +174,9 @@ static int altera_spi_ofdata_to_platdata(struct udevice *bus)
 {
 	struct altera_spi_platdata *plat = dev_get_platdata(bus);
 
-	plat->regs = ioremap(dev_get_addr(bus),
-		sizeof(struct altera_spi_regs));
+	plat->regs = map_physmem(dev_get_addr(bus),
+				 sizeof(struct altera_spi_regs),
+				 MAP_NOCACHE);
 
 	return 0;
 }
Signature · 1 line
2.5.0
#5 lore raw

PATCH 5/10 altera_sysid: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/misc/altera_sysid.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/misc/altera_sysid.c +3 -2
index 737520f..2d0fa2a 100644
@@ -76,8 +76,9 @@ static int altera_sysid_ofdata_to_platdata(struct udevice *dev)
 {
 	struct altera_sysid_platdata *plat = dev_get_platdata(dev);
 
-	plat->regs = ioremap(dev_get_addr(dev),
-		sizeof(struct altera_sysid_regs));
+	plat->regs = map_physmem(dev_get_addr(dev),
+				 sizeof(struct altera_sysid_regs),
+				 MAP_NOCACHE);
 
 	return 0;
 }
Signature · 1 line
2.5.0
#6 lore raw

PATCH 6/10 altera_tse: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/net/altera_tse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/altera_tse.c +1 -1
index 5692fe9..3eaa270 100644
@@ -608,7 +608,7 @@ static int altera_tse_probe(struct udevice *dev)
 		addr = fdt_translate_address((void *)blob,
 					     node, cell + idx);
 		size = fdt_addr_to_cpu(cell[idx + addrc]);
-		base = ioremap(addr, size);
+		base = map_physmem(addr, size, MAP_NOCACHE);
 		len = strlen(list);
 		if (strcmp(list, "control_port") == 0)
 			priv->mac_dev = base;
Signature · 1 line
2.5.0
#7 lore raw

PATCH 7/10 altera_qspi: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/mtd/altera_qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/altera_qspi.c +1 -1
index 1826dc8..50c6e0e 100644
@@ -243,7 +243,7 @@ static int altera_qspi_ofdata_to_platdata(struct udevice *dev)
 		addr = fdt_translate_address((void *)blob,
 					     node, cell + idx);
 		size = fdt_addr_to_cpu(cell[idx + addrc]);
-		base = ioremap(addr, size);
+		base = map_physmem(addr, size, MAP_NOCACHE);
 		len = strlen(list);
 		if (strcmp(list, "avl_csr") == 0) {
 			pdata->regs = base;
Signature · 1 line
2.5.0
#8 lore raw

PATCH 8/10 altera_pio: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 drivers/gpio/altera_pio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpio/altera_pio.c +3 -2
index 7ceb80e..6f42bf8 100644
@@ -89,8 +89,9 @@ static int altera_pio_ofdata_to_platdata(struct udevice *dev)
 {
 	struct altera_pio_platdata *plat = dev_get_platdata(dev);
 
-	plat->regs = ioremap(dev_get_addr(dev),
-		sizeof(struct altera_pio_regs));
+	plat->regs = map_physmem(dev_get_addr(dev),
+				 sizeof(struct altera_pio_regs),
+				 MAP_NOCACHE);
 	plat->gpio_count = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
 		"altr,gpio-bank-width", 32);
 	plat->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset,
Signature · 1 line
2.5.0
#9 lore raw

PATCH 9/10 nios2: dma-mapping.h: change ioremap to map_physmem

In reply to Thomas Chou

Change ioremap() to map_physmem(), as it is more used in u-boot.

---
 arch/nios2/include/asm/dma-mapping.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nios2/include/asm/dma-mapping.h +1 -1
index 1562d35..65f67bc 100644
@@ -19,6 +19,6 @@ static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
 	if (handle)
 		*handle = addr;
 
-	return ioremap(addr, len);
+	return map_physmem(addr, len, MAP_NOCACHE);
 }
 #endif /* __ASM_NIOS2_DMA_MAPPING_H */
Signature · 1 line
2.5.0
#10 lore raw

PATCH 10/10 nios2: zap ioremap

In reply to Thomas Chou

Zap ioremap(), as it is replaced by map_physmem(,,MAP_NOCACHE).

---
 arch/nios2/include/asm/io.h | 6 ------
 1 file changed, 6 deletions(-)
arch/nios2/include/asm/io.h +0 -6
index 95d8801..e951500 100644
@@ -47,12 +47,6 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 	return (phys_addr_t)vaddr & gd->arch.physaddr_mask;
 }
 
-static inline void *ioremap(unsigned long physaddr, unsigned long size)
-{
-	DECLARE_GLOBAL_DATA_PTR;
-	return (void *)(gd->arch.io_region_base | physaddr);
-}
-
 #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.5.0
#11 lore raw

cover nios2: change ioremap to map_physmem

In reply to Thomas Chou
Quoted 15 lines · Thomas Chou

Change ioremap() to map_physmem(,,MAP_NOCACHE), as it is more used in u-boot. There are no other archs use ioremap(), except nios2.

Thomas Chou (10):
altera_jtag_uart: change ioremap to map_physmem
altera_uart: change ioremap to map_physmem
altera_timer: change ioremap to map_physmem
altera_spi: change ioremap to map_physmem
altera_sysid: change ioremap to map_physmem
altera_tse: change ioremap to map_physmem
altera_qspi: change ioremap to map_physmem
altera_pio: change ioremap to map_physmem
nios2: dma-mapping.h: change ioremap to map_physmem
nios2: zap ioremap

Quoted 11 lines
 arch/nios2/include/asm/dma-mapping.h | 2 +-
 arch/nios2/include/asm/io.h          | 6 ------
 drivers/gpio/altera_pio.c            | 5 +++--
 drivers/misc/altera_sysid.c          | 5 +++--
 drivers/mtd/altera_qspi.c            | 2 +-
 drivers/net/altera_tse.c             | 2 +-
 drivers/serial/altera_jtag_uart.c    | 5 +++--
 drivers/serial/altera_uart.c         | 5 +++--
 drivers/spi/altera_spi.c             | 5 +++--
 drivers/timer/altera_timer.c         | 5 +++--
 10 files changed, 21 insertions(+), 21 deletions(-)

Quickly

Best regards,
Marek Vasut

#12 lore raw

cover nios2: change ioremap to map_physmem

In reply to Thomas Chou
Quoted 15 lines · Thomas Chou

Change ioremap() to map_physmem(,,MAP_NOCACHE), as it is more used in u-boot. There are no other archs use ioremap(), except nios2.

Thomas Chou (10):
altera_jtag_uart: change ioremap to map_physmem
altera_uart: change ioremap to map_physmem
altera_timer: change ioremap to map_physmem
altera_spi: change ioremap to map_physmem
altera_sysid: change ioremap to map_physmem
altera_tse: change ioremap to map_physmem
altera_qspi: change ioremap to map_physmem
altera_pio: change ioremap to map_physmem
nios2: dma-mapping.h: change ioremap to map_physmem
nios2: zap ioremap

Quoted 12 lines
  arch/nios2/include/asm/dma-mapping.h | 2 +-
  arch/nios2/include/asm/io.h          | 6 ------
  drivers/gpio/altera_pio.c            | 5 +++--
  drivers/misc/altera_sysid.c          | 5 +++--
  drivers/mtd/altera_qspi.c            | 2 +-
  drivers/net/altera_tse.c             | 2 +-
  drivers/serial/altera_jtag_uart.c    | 5 +++--
  drivers/serial/altera_uart.c         | 5 +++--
  drivers/spi/altera_spi.c             | 5 +++--
  drivers/timer/altera_timer.c         | 5 +++--
  10 files changed, 21 insertions(+), 21 deletions(-)

Applied to u-boot-nios.