How to map resources of two devices in one Linux kernel driver using device tree?
<p>I am writing a Linux kernel driver for a watchdog using the CPU’s internal registers <strong>and</strong> a dedicated location in (persistent) RAM for storing debug information in case of a watchdog-triggered reset. </p>

<p>In the old world, I had two resources of type <code>IORESOURCE_MEM</code> in my board file: the internal registers (base address of internal regs plus offset) and the location in RAM (absolute memory address). </p>

<p>I could access these via <code>platform_get_resource()</code> with the appropriate index, and then I could remap. </p>

<p>In the new world featuring a device tree, my node for the watchdog is located in the domain of internal CPU registers and I can access them without problems. </p>

<p>But how do I add my memory location in RAM? The base address of RAM is different from the CPU-internal registers, so I can’t just add another range to the “reg” entry (like <code>reg = &lt;0x20300 0x408&gt;, &lt;0x3BFFE000 0x1000&gt;;</code>). Do I need to add a new “device” like this, maybe?</p>

<pre><code>PRAM {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;1&gt;;       
    PRAM0: Watchdog_Crash_Debug_Context {            
        reg = &lt;0x3BFFE000 0x1000&gt;;
    };
};
</code></pre>

<p>But how do I reference it in the watchdog device driver? Or in the watchdog device tree entry?</p>

<p>Linux version is 4.1.18.</p>