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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to