Date: Fri, 19 Dec 2014 13:07:37 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275937 - head/sys/dev/fdt Message-ID: <201412191307.sBJD7bfh035353@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Fri Dec 19 13:07:36 2014 New Revision: 275937 URL: https://svnweb.freebsd.org/changeset/base/275937 Log: Add support for empty ranges properties within the tree, some vendor device trees have these, for example the ARM AArch64 Foundation Model. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Fri Dec 19 12:09:29 2014 (r275936) +++ head/sys/dev/fdt/fdt_common.c Fri Dec 19 13:07:36 2014 (r275937) @@ -75,6 +75,12 @@ fdt_get_range_by_busaddr(phandle_t node, u_long bus_addr, par_bus_addr, pbase, psize; int err, i, len, tuple_size, tuples; + if (node == 0) { + *base = 0; + *size = ULONG_MAX; + return (0); + } + if ((fdt_addrsize_cells(node, &addr_cells, &size_cells)) != 0) return (ENXIO); /* @@ -91,9 +97,8 @@ fdt_get_range_by_busaddr(phandle_t node, if (len > sizeof(ranges)) return (ENOMEM); if (len == 0) { - *base = 0; - *size = ULONG_MAX; - return (0); + return (fdt_get_range_by_busaddr(OF_parent(node), addr, + base, size)); } if (OF_getprop(node, "ranges", ranges, sizeof(ranges)) <= 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412191307.sBJD7bfh035353>