Date: Wed, 14 Mar 2018 03:37:37 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330900 - stable/11/sys/dev/ofw Message-ID: <201803140337.w2E3bb5E046227@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Wed Mar 14 03:37:37 2018 New Revision: 330900 URL: https://svnweb.freebsd.org/changeset/base/330900 Log: MFC r322287 (mw): Add support for "compatible" parameter in ofw_fdt_fixup Sometimes it's convenient to provide fixup to many boards that use the same SoC family (eg. Marvell Armada 38x). Instead of putting multiple entries in fdt_fixup_table, use one entry which refers to all boards with given SoC. Modified: stable/11/sys/dev/ofw/ofw_fdt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ofw/ofw_fdt.c ============================================================================== --- stable/11/sys/dev/ofw/ofw_fdt.c Wed Mar 14 03:36:27 2018 (r330899) +++ stable/11/sys/dev/ofw/ofw_fdt.c Wed Mar 14 03:37:37 2018 (r330900) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include <dev/fdt/fdt_common.h> #include <dev/ofw/ofwvar.h> #include <dev/ofw/openfirm.h> +#include <dev/ofw/ofw_bus_subr.h> #include "ofw_if.h" @@ -431,7 +432,15 @@ ofw_fdt_fixup(ofw_t ofw) for (i = 0; fdt_fixup_table[i].model != NULL; i++) { if (strncmp(model, fdt_fixup_table[i].model, FDT_MODEL_LEN) != 0) - continue; + /* + * Sometimes it's convenient to provide one + * fixup entry that refers to many boards. + * To handle this case, simply check if model + * is compatible parameter + */ + if(!ofw_bus_node_is_compatible(root, + fdt_fixup_table[i].model)) + continue; if (fdt_fixup_table[i].handler != NULL) (*fdt_fixup_table[i].handler)(root);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803140337.w2E3bb5E046227>