Date: Wed, 9 Aug 2017 00:45:25 +0000 (UTC) From: Marcin Wojtas <mw@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322285 - head/sys/dev/fdt Message-ID: <201708090045.v790jPo8001356@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mw Date: Wed Aug 9 00:45:25 2017 New Revision: 322285 URL: https://svnweb.freebsd.org/changeset/base/322285 Log: Enable parsing simple-bus 'ranges' with multiple entries This patch makes possible to boot with up to 8 ranges in soc. Dynamic allocation cannot be used, because ftd_get_ranges function is called early, when malloc is not available. Change is required for the alignment of Marvell Armada 38x device trees present in sys/gnu/dts/arm - originally the platform has 6 entries in simple-bus 'ranges'. Submitted by: Patryk Duda <pdk@semihalf.com> Reviewed by: manu, nwhitehorn, cognet (mentor) Approved by: cognet (mentor) Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D11876 Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Tue Aug 8 23:55:38 2017 (r322284) +++ head/sys/dev/fdt/fdt_common.c Wed Aug 9 00:45:25 2017 (r322285) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #define FDT_TYPE_LEN 64 #define FDT_REG_CELLS 4 +#define FDT_RANGES_SIZE 48 SYSCTL_NODE(_hw, OID_AUTO, fdt, CTLFLAG_RD, 0, "Flattened Device Tree"); @@ -149,7 +150,7 @@ fdt_get_range_by_busaddr(phandle_t node, u_long addr, int fdt_get_range(phandle_t node, int range_id, u_long *base, u_long *size) { - pcell_t ranges[6], *rangesptr; + pcell_t ranges[FDT_RANGES_SIZE], *rangesptr; pcell_t addr_cells, size_cells, par_addr_cells; u_long par_bus_addr, pbase, psize; int err, len, tuple_size, tuples;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708090045.v790jPo8001356>