1 // SPDX-License-Identifier: GPL-2.0-only
3 * Freescale SOC support functions
5 * Author: Scott Wood <scottwood@freescale.com>
7 * Copyright (c) 2007 Freescale Semiconductor, Inc.
15 static u32 prop_buf
[MAX_PROP_LEN
/ 4];
17 u32
*fsl_get_immr(void)
20 unsigned long ret
= 0;
22 soc
= find_node_by_devtype(NULL
, "soc");
27 size
= getprop(soc
, "#address-cells", prop_buf
, MAX_PROP_LEN
);
33 if (naddr
!= 1 && naddr
!= 2)
36 size
= getprop(soc
, "ranges", prop_buf
, MAX_PROP_LEN
);
42 if (naddr
== 2 && prop_buf
[1] != 0)
45 if (!dt_xlate_addr(soc
, prop_buf
+ naddr
, 8, &ret
))
51 printf("fsl_get_immr: Failed to find immr base\r\n");