[U-Boot] [PATCH 1/9] riscv: ax25: Create a simple-bus driver for the soc node

Andes uboot at andestech.com
Tue Mar 19 09:07:42 UTC 2019


From: Rick Chen <rick at andestech.com>

To enumerate devices on the /soc/ node, create a "simple-bus"
driver to match "andestech,riscv-ae350-soc".

Signed-off-by: Rick Chen <rick at andestech.com>
Cc: Greentime Hu <greentime at andestech.com>
---
 arch/riscv/cpu/ax25/cpu.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/riscv/cpu/ax25/cpu.c b/arch/riscv/cpu/ax25/cpu.c
index 76689b2..e6e7404 100644
--- a/arch/riscv/cpu/ax25/cpu.c
+++ b/arch/riscv/cpu/ax25/cpu.c
@@ -7,6 +7,7 @@
 /* CPU specific code */
 #include <common.h>
 #include <asm/cache.h>
+#include <dm.h>
 
 /*
  * cleanup_before_linux() is called just before we call linux
@@ -25,3 +26,18 @@ int cleanup_before_linux(void)
 
 	return 0;
 }
+
+/* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
+static const struct udevice_id riscv_ae350_soc_ids[] = {
+	{
+		.compatible = "andestech,riscv-ae350-soc",
+	},
+	{ }
+};
+
+U_BOOT_DRIVER(riscv_ae350_soc_ids) = {
+	.name = "andestech,riscv-ae350-soc",
+	.id = UCLASS_SIMPLE_BUS,
+	.of_match = riscv_ae350_soc_ids,
+	.flags = DM_FLAG_PRE_RELOC,
+};
-- 
2.7.4



More information about the U-Boot mailing list