Questions tagged [ioremap]

`ioremap()` maps bus memory into CPU space for memory mapped I/O in the Linux kernel

void __iomem *ioremap(unsigned long port, unsigned long size) is the function in the Linux kernel that maps bus memory into CPU space. It will perform a platform specific sequence of operations to make bus memory CPU accessible via the read{b,w,l} write{b,w,l} functions and the other memory mapped I/O helper functions. The returned address is not guaranteed to be usable directly as a virtual address.

Cache behavior through the newly established mapping could be one of but are not limited to:

  • Uncached
  • Write-back
  • Write Combining

References

27 questions
4
votes
1 answer

Why shouldn't I use ioremap on system memory for ARMv6+?

I need to reserve a large buffer of physically contiguous RAM from the kernel and be able to gaurantee that the buffer will always use a specific, hard-coded physical address. This buffer should remain reserved for the kernel's entire lifetime. I…
Woodrow Barlow
  • 8,477
  • 3
  • 48
  • 86
3
votes
1 answer

What is meant by holes in the memory Linux?

I have come across a term - holes in the memory in Linux. I believe this is the memory that is I/O remapped. Is my understanding correct?
dexterous
  • 6,422
  • 12
  • 51
  • 99
2
votes
1 answer

Using writel to write 4 bit to ioremap-ed memory address

I'm new to kernel programming, and now trying to write some values to a 32-bit GPIO register in a device driver. The I/O is ioremap()-ed to a memory address. The problem is, I don't know how writel()/writeb()/writew() writes bits to the…
Chung Lun Yuen
  • 319
  • 4
  • 15
2
votes
1 answer

map reserver memory at boot to user space using remap_pfn_range

I am trying to map reserved memory (30M with offset of 2G) at boot time (boot kernel parameters mem=2G memmap=30M$2G) to user space using the remap_pfn_range, bellow is my driver code: #include #include #include…
Mondher123
  • 67
  • 1
  • 9
2
votes
0 answers

Unexpected changes in data written to a physical memory address

The platform is MIPS, and the kernel is linux 2.6.31. First, I reserve 8M RAM zone, out of total RAM of 64M, so the kernel only uses 56M RAM zone. Second, I use the ioremap() function to transform the physical address to a virtual address in kernel,…
dovelj
  • 21
  • 1
2
votes
1 answer

Kernel driver, ioremap necessary in MMU-less system?

So, I am a total newbie when it comes to kernel drivers and have a question regarding ioremap function. I am writing a driver for accessing some registers defined in a custom VHDL-module on a SoC with a ARM Cortex-M3 and FPGA fabric. Looking at…
2
votes
2 answers

Why we can directly access only the 640k-1MB area in a PCI physical addresses?

http://www.mjmwired.net/kernel/Documentation/IO-mapping.txt 153 - remapping and writing: 154 /* 155 * remap framebuffer PCI memory area at 0xFC000000, 156 * size 1MB, so that we can access it: We can directly 157 * access only…
0x90
  • 39,472
  • 36
  • 165
  • 245
1
vote
1 answer

How does PCIe Endpoint device memory is mapped into the systems memory map (MMIO)?

How does Linux Kernel or BIOS map the PCIe endpoint device memory into systems MMIO space ? Is there any API to achieve it ? Lets assume that when writing a Linux device driver for a PCIe endpoint device, How can we map PCIe device memory into MMIO…
Usr1
  • 369
  • 1
  • 6
  • 15
1
vote
0 answers

Using physical address as sk_buff data fragment

Is it possible to map physical address as data fragment in sk_buff? I am working on Zynq Ultrascale+ platform (FPGA + ARM SOC). I have memory buffer mapped to physical address. The goal is to efficiently send that data over UDP. By efficiently I…
modimo
  • 11
  • 1
1
vote
2 answers

LINUX KERNEL driver hangs/freeze after handling mapped register

I'm completely new developing in LINUX kernel, and I'm having some problems in a new LINUX driver I'm developing. After I map NXP PWM registers using ioremap()/ioremap_nocache() and then I try to write to the register mappend my system…
1
vote
1 answer

What is the effect of using ioremap on physical address already ioremapped by a driver?

I am trying to use the ARM watchdog thorough kernel space. I have a watchdog driver which is statically built and deployed in the kernel. The memory remapped by the driver is seen in /proc/iomem. cat /proc/iomem | grep wdt ff567000-ff567018 :…
1
vote
0 answers

list ioremap() mapped addresses in Kernel

As you might know it is possible to list all the mapped physical addresses and their respected virtual addresses for user space applications using /proc/$pid/maps Is there any way to do the same and find virtual addresses of all mapped physical…
Sama Azari
  • 377
  • 4
  • 17
1
vote
1 answer

ioremap - Unable to handle kernel paging request at virtual address XXXXXXXX

I am attempting to access a given memory-region on an am335x-processor in Linux. The idea is to first designate physical addresses, then access said addresses using ioremap. I have been googling the issue for some time, but cannot seem to find any…
Tom
  • 414
  • 4
  • 17
1
vote
1 answer

Is the second parameter in ioremap() gives the size in number of bits for a register- Linux?

My NEC microcontroller has a timer controller register 8-bits - Do, I need to pass 8 in the second parameter of ioremap? After reading the spec, I got to know the following property of it. Address |Function Register Name |Symbol |R/W…
1
vote
2 answers

what is the meaning of mapping virtual address to physical address?

I am using "ioremap" to map the address of a GPIO port in the datasheet of Ti AM3359 . The code is running fine. Problem: 1> The problem is , why do we need to map the virtual address to physical address? Is it because physical address is the…
Virendra Kumar
  • 947
  • 2
  • 13
  • 31
1
2