Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c7e072b authored by Scott Wood's avatar Scott Wood Committed by Kumar Gala
Browse files

[POWERPC] fsl_soc: Fix get_immrbase() to use ranges, rather than reg.



Don't depend on the reg property as a way to determine the base
of the immr space.  The reg property might be defined differently for
different SoC families.

Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent c7d24a2d
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -55,10 +55,18 @@ phys_addr_t get_immrbase(void)
	soc = of_find_node_by_type(NULL, "soc");
	soc = of_find_node_by_type(NULL, "soc");
	if (soc) {
	if (soc) {
		int size;
		int size;
		const void *prop = of_get_property(soc, "reg", &size);
		u32 naddr;
		const u32 *prop = of_get_property(soc, "#address-cells", &size);


		if (prop && size == 4)
			naddr = *prop;
		else
			naddr = 2;

		prop = of_get_property(soc, "ranges", &size);
		if (prop)
		if (prop)
			immrbase = of_translate_address(soc, prop);
			immrbase = of_translate_address(soc, prop + naddr);

		of_node_put(soc);
		of_node_put(soc);
	}
	}