0

I am writing one sample application which is used to read registers and write particular value on given SPI Device address.

I am using altera spi 1.0 driver and got base address as 0xE5002460 while registering spi device.

I want to read/write registers from SPI Flash from user space using ioremap call.

Is there any code snippet or any example about how to use ioremap function which can directly read value of registers from base address given without writing any specific driver for that?

Ritesh Prajapati
  • 953
  • 2
  • 13
  • 22
  • Is your system actually configured to present registers of a remote SPI device in some sort of proxied local address space for which it will trap access and automatically turn that into SPI transactions? Or do you simply need to explicitly generate SPI transactions *within your program* to access these registers of the flash device in accordance with its data sheet? – Chris Stratton Feb 25 '14 at 20:22

1 Answers1

0

@Ritesh, ioremap api is used in the kernel space to memory map the device/module for ex:SPI registers which returns virtual address. This address can be used only by ioread[8|16|32] and iowrite[8|16|32] api's to read or write to the spi registers. You can use mmap to map the SPI registers. Go through the link mmap slower than ioremap.

Community
  • 1
  • 1
Gautham Kantharaju
  • 1,735
  • 1
  • 21
  • 24