powerpc/microwatt: Populate platform bus from device-tree
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 18 Jun 2021 03:45:11 +0000 (13:45 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 21 Jun 2021 11:15:26 +0000 (21:15 +1000)
Just like any other embedded platform.

Add an empty soc node.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/YMwWx98+PMibZq/G@thinks.paulus.ozlabs.org
arch/powerpc/boot/dts/microwatt.dts
arch/powerpc/platforms/microwatt/setup.c

index ac264ad3faaf5b4bcb9722fee0106fa02525fdbe..9b6140c90370941b97ff5cadc407fc2d79d78c7d 100644 (file)
                                          00 00 00 00 00 00 00 00 40 00 40];
        };
 
+       soc@c0000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               ranges = <0 0 0xc0000000 0x40000000>;
+       };
 };
index d80d526126727fdb9a818d5d8fdda44d907a98ca..5af4adf881bcddab63f42c807f5b60630a68fb29 100644 (file)
@@ -8,6 +8,8 @@
 #include <linux/kernel.h>
 #include <linux/stddef.h>
 #include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
 #include <asm/machdep.h>
 #include <asm/time.h>
 
@@ -16,6 +18,12 @@ static int __init microwatt_probe(void)
        return of_machine_is_compatible("microwatt-soc");
 }
 
+static int __init microwatt_populate(void)
+{
+       return of_platform_default_populate(NULL, NULL, NULL);
+}
+machine_arch_initcall(microwatt, microwatt_populate);
+
 define_machine(microwatt) {
        .name                   = "microwatt",
        .probe                  = microwatt_probe,