Merge tag 'scmi-updates-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep...
[linux-2.6-microblaze.git] / drivers / firmware / arm_scpi.c
index 4ceba5e..ddf0b9f 100644 (file)
@@ -899,6 +899,14 @@ static const struct of_device_id legacy_scpi_of_match[] = {
        {},
 };
 
+static const struct of_device_id shmem_of_match[] __maybe_unused = {
+       { .compatible = "amlogic,meson-gxbb-scp-shmem", },
+       { .compatible = "amlogic,meson-axg-scp-shmem", },
+       { .compatible = "arm,juno-scp-shmem", },
+       { .compatible = "arm,scp-shmem", },
+       { }
+};
+
 static int scpi_probe(struct platform_device *pdev)
 {
        int count, idx, ret;
@@ -935,6 +943,9 @@ static int scpi_probe(struct platform_device *pdev)
                struct mbox_client *cl = &pchan->cl;
                struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
 
+               if (!of_match_node(shmem_of_match, shmem))
+                       return -ENXIO;
+
                ret = of_address_to_resource(shmem, 0, &res);
                of_node_put(shmem);
                if (ret) {