From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andes Date: Tue, 19 Mar 2019 17:07:42 +0800 Subject: [U-Boot] [PATCH 1/9] riscv: ax25: Create a simple-bus driver for the soc node In-Reply-To: <20190319090750.8923-1-uboot@andestech.com> References: <20190319090750.8923-1-uboot@andestech.com> Message-ID: <20190319090750.8923-2-uboot@andestech.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Rick Chen To enumerate devices on the /soc/ node, create a "simple-bus" driver to match "andestech,riscv-ae350-soc". Signed-off-by: Rick Chen Cc: Greentime Hu --- 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 #include +#include /* * 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