Apalis iMX6Q: Accessing / Reading SoC register values in Linux userspace

Hi team,

A customer asked about how they could identify the reset cause for logic purposes in their application and after some grepping I successfully pinpointed the register that saves this in Uboot source code, which is basically the SRC Reset Status Register (SRC_SRSR - Section 60.7.2, page 5063 in NXPs i.MX6 reference manual, base address: 0x020D_8008).

However, I was thinking that I’m not sure how it is possible to access this register within Linux userspace through a simple C call (given root permission), and after some googling, I couldn’t find anything clear. Any idea?

Thanks and kind regards,
Alvaro.

I believe this very topic has been discussed here before. Accessing SoC registers from user space is definitely not the right approach and should actually be disallowed in any productive software. Rather, one would need passing such information either from the boot loader (e.g. via device tree or kernel command line) or via a kernel level driver.

Hi Marcel, thanks. That makes sense, I will let the customer know and try to follow the kernel command line / parameter approach.