public inbox for devicetree-spec@vger.kernel.org
 help / color / mirror / Atom feed
* Ranges - Intended use case
@ 2026-02-12 13:14 Kyle Bonnici
  2026-02-12 15:33 ` Yao Zi
  2026-02-13  5:13 ` David Gibson
  0 siblings, 2 replies; 7+ messages in thread
From: Kyle Bonnici @ 2026-02-12 13:14 UTC (permalink / raw)
  To: devicetree-spec@vger.kernel.org

Hi 

I have been trying to understand how ranges should/should not be used.

Looking at the spec 

> The ranges property provides a means of defining a mapping or translation between the address space of the
bus (the child address space) and the address space of the bus node’s parent (the parent address space).

This to me the spec leave some space for interpretation on if ranges should be used on just buses or not. Below are some examples to try to get a better understanding.

```
/ {
	foo { // not a bus
		#address-cells = <1>;
		#size-cells = <1>;
		ranges; // does this ranges have any meaning?

		bar@10 {
			reg<0x10 …> 
		};
	};
};
```

```
/ {
	foo { // not a bus
		#address-cells = <1>;
		#size-cells = <1>;
		reg = <0x100 0x50>;
		ranges = <0x0 0x100 0x50>; // is this an intended use case?

		bar@10 {
			reg<0x10 …> // hence abs address is 0x110. 
		};
	};
};
```

```
/ {
	foo { // bus
		compatible = <simple-bus>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges; // this I understand to declare that children will have direct mapping

		bar {
			ranges; // is this needed? Or is it implied that the foobar is in the same address space of bar?
			foobar@10 {
				reg<0x10 …>  // hence abs address is 0x10. 
			};
		};
	};
};
```

```
/ {
	soc { // bus
		compatible = <simple-bus>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges; // this I understand to declare that children will have direct mapping

		flash@1000 {
			reg<0x1000 …> 
			ranges = <0x0 0x1000 …>;
		
			partitions {
				ranges;  // is this needed? Or is it implied that the partition1 is in the same address space of partitions?

				partition1@10 {
					reg<0x10 …>   // hence abs address is 0x1010. 
				};
			};
		};
	};
};
```

Looking forward to explanations on this topic to extend my understanding of devicetree

Regards
Kyle

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-02-14  2:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12 13:14 Ranges - Intended use case Kyle Bonnici
2026-02-12 15:33 ` Yao Zi
2026-02-12 19:24   ` Rob Herring
2026-02-13  5:16     ` David Gibson
2026-02-13  9:04     ` McCrae, Jamie
2026-02-14  2:02       ` David Gibson
2026-02-13  5:13 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox