read/write reg

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

read/write reg

1,329 Views
rainho
Contributor II

I wrote the device driver code for the SPI slave device mounted under the spi device tree node, and it works normally. But now I have a requirement for fast communication. I do not use APIs such as kernel spi_sync during transmission, and choose to directly operate the SPI register. I found that it will cause the kernel to hang directly. When matching the device driver, I used ioremap again to obtain the starting virtual address of the hardware SPI, and then directly operated the offset (register) of the starting address in the device driver file, but the kernel hung. What is this? The reason? Is it because Ioremap uses the same SPI memory twice? Or is there a conflict with spi_imx.c when using functions such as readl?
Please answer it. Thank you!

Labels (1)
0 Kudos
Reply
3 Replies

1,306 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Recommend you use regmap framework to operate regs

0 Kudos
Reply

1,303 Views
rainho
Contributor II

thanks for the reply!
I probably know about the regmap operation, but I'm not sure whether it is a safe operation, or whether it can be used directly in interrupts?

0 Kudos
Reply

1,286 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Avoid using ioremap,  regmap is more safety.

0 Kudos
Reply