From nobody Sun Nov 14 14:41:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0D948185CB8D; Sun, 14 Nov 2021 14:41:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsZlg20nSz3myy; Sun, 14 Nov 2021 14:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06968328; Sun, 14 Nov 2021 14:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEEfo1B037954; Sun, 14 Nov 2021 14:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEEfoTO037953; Sun, 14 Nov 2021 14:41:50 GMT (envelope-from git) Date: Sun, 14 Nov 2021 14:41:50 GMT Message-Id: <202111141441.1AEEfoTO037953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 4c0c353d0e48 - main - loader: Add more bus name to pnpautoload List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c0c353d0e48d06f82cae16aba02e5923794ba98 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4c0c353d0e48d06f82cae16aba02e5923794ba98 commit 4c0c353d0e48d06f82cae16aba02e5923794ba98 Author: Emmanuel Vadot AuthorDate: 2021-11-14 14:32:00 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 14:41:30 +0000 loader: Add more bus name to pnpautoload Add ofwbus, iicbus and spibus to pnpautoload so modules under those buses will be loaded. On my rockpro64 now : OK pnpautoload -v Autoloading modules for simplebus Using DTB provided by EFI at 0x8100000. Autoloading modules for ofwbus /boot/kernel/rk_spi.ko text=0x14b2 text=0xd4c data=0x4d0+0x8 syms=[0x8+0xa98+0x8+0x807] /boot/kernel/dwwdt.ko text=0x12e2 text=0x78c data=0x4c8+0x10 syms=[0x8+0x990+0x8+0x6e1] Autoloading modules for iicbus Autoloading modules for spibus /boot/kernel/mx25l.ko text=0x1613 text=0x114c data=0x6e8+0x8 syms=[0x8+0xa08+0x8+0x665] loading required module 'fdt_slicer' /boot/kernel/fdt_slicer.ko text=0x95e text=0x340 data=0x290 syms=[0x8+0x6c0+0x8+0x4a0] --- stand/common/module.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/stand/common/module.c b/stand/common/module.c index e6567c735f36..f28771396af0 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -446,7 +446,7 @@ command_pnpload(int argc, char *argv[]) #if defined(LOADER_FDT_SUPPORT) static void -pnpautoload_simplebus(void) { +pnpautoload_fdt_bus(const char *busname) { const char *pnpstring; const char *compatstr; char *pnpinfo = NULL; @@ -464,7 +464,7 @@ pnpautoload_simplebus(void) { pnplen += strlen(compatstr) + 1; asprintf(&pnpinfo, "compat=%s", compatstr); - module = mod_searchmodule_pnpinfo("simplebus", pnpinfo); + module = mod_searchmodule_pnpinfo(busname, pnpinfo); if (module) { error = mod_loadkld(module, 0, NULL); if (error) @@ -480,12 +480,15 @@ pnpautoload_simplebus(void) { struct pnp_bus { const char *name; - void (*load)(void); + void (*load)(const char *busname); }; struct pnp_bus pnp_buses[] = { #if defined(LOADER_FDT_SUPPORT) - {"simplebus", pnpautoload_simplebus}, + {"simplebus", pnpautoload_fdt_bus}, + {"ofwbus", pnpautoload_fdt_bus}, + {"iicbus", pnpautoload_fdt_bus}, + {"spibus", pnpautoload_fdt_bus}, #endif }; @@ -528,8 +531,8 @@ command_pnpautoload(int argc, char *argv[]) continue; } if (verbose) - printf("Autoloading modules for simplebus\n"); - pnp_buses[i].load(); + printf("Autoloading modules for %s\n", pnp_buses[i].name); + pnp_buses[i].load(pnp_buses[i].name); match = 1; } if (match == 0)