From patchwork Thu Oct 22 14:19:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386294 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TkBee3r0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8h456WNz9sRK for ; Fri, 23 Oct 2020 01:22:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4DD8C824A9; Thu, 22 Oct 2020 16:20:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TkBee3r0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4BF8982455; Thu, 22 Oct 2020 16:20:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3BFC582423 for ; Thu, 22 Oct 2020 16:20:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x143.google.com with SMTP id j8so1890587ilk.0 for ; Thu, 22 Oct 2020 07:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ojWncpFFlusFrnYQvrMNE8ENAEGD7uJq9CiCjprwfhE=; b=TkBee3r0MQjfeBd6GAdqrdbavcZYNbu47rRCFUus4cY5NWCZTsdR8Wxtgx485cpzig EH0dUACvoHUxfFtcq5f3CzvSMkF7wtxI1vtHD1CT0wt4LWxB19uooBp41N3i7yh/hE9D oYckN1kyKFdFn2PzSKExKHaR9DuzcDVdCCFr4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ojWncpFFlusFrnYQvrMNE8ENAEGD7uJq9CiCjprwfhE=; b=nGyLPKojD5ZRO8V8gYBZGKzoWLjamjYdSrVd5Q3w+4LXwQB9/E//8qcEf8bdwoEoFl mLi1uz4hktOz7w2o9sY5yMbGng2fgYn3t7aazU51QpsLQTJfZzyHLcGovMlFUZUoM4+d JLOWascaLDOF5lwMI4Tt741S4J+4Oni6PrIpJi75M8jYvbXWi/AGStWnLmBhH51xNHbD xvFDCTPhXEnJhntdd5EcTzLXf/VVruLN8tL4VlWlRTKso7WxbmmGtyQC4CeRytHOtFcY Jz9Fl5Yfyh7Blu4mi4oK+8cN9TfF2z/bRO+vJTcek4j4aHANB+3BsAKixLiYF+rSh/M2 A3WA== X-Gm-Message-State: AOAM533BWup2i3FccN3ujkikY/H3UrmXTyuQUlyLUKCXwmxdrhiuAoxR 5FQnQlbNCq7nDdGsrOIV2Tq3NiH6qiBLW0qS X-Google-Smtp-Source: ABdhPJyyANUse8kNM1mhMUj4QacZ+mXO5BsbJHEQLjk02b8K4gTWW/ipGCyYfT2fnI/sH0Fw5ZCswA== X-Received: by 2002:a92:da8e:: with SMTP id u14mr1989674iln.235.1603376398664; Thu, 22 Oct 2020 07:19:58 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:19:58 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 01/13] board: Rename uclass to sysinfo Date: Thu, 22 Oct 2020 08:19:36 -0600 Message-Id: <20201022141949.711984-2-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This uclass is intended to provide a way to obtain information about a U-Boot board. But the concept of a U-Boot 'board' is the whole system, not just one circuit board, meaning that 'board' is something of a misnomer for this uclass. In addition, the name 'board' is a bit overused in U-Boot and we want to use the same uclass to provide SMBIOS information. The obvious name is 'system' but that is so vague as to be meaningless. Use 'sysinfo' instead, since this uclass is aimed at providing information on the system. Rename everything accordingly. Signed-off-by: Simon Glass --- (no changes since v1) arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi | 2 +- arch/sandbox/dts/test.dts | 8 +- board/gdsys/common/cmd_ioloop.c | 12 +-- board/gdsys/mpc8308/gazerbeam.c | 47 ++++++----- board/google/chromebook_coral/coral.c | 2 +- common/spl/spl_fit.c | 15 ++-- configs/chromebook_coral_defconfig | 2 +- configs/gazerbeam_defconfig | 4 +- configs/sandbox64_defconfig | 8 +- configs/sandbox_defconfig | 8 +- configs/sandbox_flattree_defconfig | 4 +- configs/sandbox_spl_defconfig | 4 +- .../gdsys,sysinfo_gazerbeam.txt} | 8 +- drivers/Kconfig | 4 +- drivers/Makefile | 2 +- drivers/board/board-uclass.c | 71 ---------------- drivers/{board => sysinfo}/Kconfig | 16 ++-- drivers/{board => sysinfo}/Makefile | 6 +- drivers/{board => sysinfo}/gazerbeam.c | 74 ++++++++--------- drivers/{board => sysinfo}/gazerbeam.h | 0 drivers/{board => sysinfo}/sandbox.c | 50 ++++++------ drivers/{board => sysinfo}/sandbox.h | 0 drivers/sysinfo/sysinfo-uclass.c | 71 ++++++++++++++++ drivers/timer/mpc83xx_timer.c | 10 +-- include/dm/uclass-id.h | 2 +- include/{board.h => sysinfo.h} | 80 +++++++++---------- test/dm/Makefile | 2 +- test/dm/board.c | 59 -------------- test/dm/sysinfo.c | 59 ++++++++++++++ 29 files changed, 318 insertions(+), 312 deletions(-) rename doc/device-tree-bindings/{board/gdsys,board_gazerbeam.txt => sysinfo/gdsys,sysinfo_gazerbeam.txt} (90%) delete mode 100644 drivers/board/board-uclass.c rename drivers/{board => sysinfo}/Kconfig (65%) rename drivers/{board => sysinfo}/Makefile (50%) rename drivers/{board => sysinfo}/gazerbeam.c (69%) rename drivers/{board => sysinfo}/gazerbeam.h (100%) rename drivers/{board => sysinfo}/sandbox.c (50%) rename drivers/{board => sysinfo}/sandbox.h (100%) create mode 100644 drivers/sysinfo/sysinfo-uclass.c rename include/{board.h => sysinfo.h} (65%) delete mode 100644 test/dm/board.c create mode 100644 test/dm/sysinfo.c diff --git a/arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi b/arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi index 1c4977f20f3..3439737fa3f 100644 --- a/arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi +++ b/arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi @@ -32,7 +32,7 @@ }; board { - compatible = "gdsys,board_gazerbeam"; + compatible = "gdsys,sysinfo-gazerbeam"; csb = <&board_soc>; serdes = <&SERDES>; rxaui0 = <&RXAUI0_0>; diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index fa84b2c10f3..0f0d69da50e 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -1070,10 +1070,6 @@ compatible = "sandbox,sandbox_osd"; }; - board { - compatible = "sandbox,board_sandbox"; - }; - sandbox_tee { compatible = "sandbox,tee"; }; @@ -1209,6 +1205,10 @@ reset-names = "valid", "no_mask", "out_of_range"; }; + sysinfo { + compatible = "sandbox,sysinfo-sandbox"; + }; + some_regmapped-bus { #address-cells = <0x1>; #size-cells = <0x1>; diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c index 3ea2bec8ebd..658756d9842 100644 --- a/board/gdsys/common/cmd_ioloop.c +++ b/board/gdsys/common/cmd_ioloop.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include "../../../drivers/misc/gdsys_soc.h" #include "../../../drivers/misc/gdsys_ioep.h" @@ -506,11 +506,11 @@ int do_ioloop(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) int do_iodev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct udevice *ioep = NULL; - struct udevice *board; + struct udevice *sysinfo; char name[8]; int ret; - if (board_get(&board)) + if (sysinfo_get(&sysinfo)) return CMD_RET_FAILURE; if (argc > 1) { @@ -518,7 +518,8 @@ int do_iodev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) snprintf(name, sizeof(name), "ioep%d", i); - ret = uclass_get_device_by_phandle(UCLASS_MISC, board, name, &ioep); + ret = uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, name, + &ioep); if (ret || !ioep) { printf("Invalid IOEP %d\n", i); @@ -532,7 +533,8 @@ int do_iodev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) while (1) { snprintf(name, sizeof(name), "ioep%d", i); - ret = uclass_get_device_by_phandle(UCLASS_MISC, board, name, &ioep); + ret = uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, + name, &ioep); if (ret || !ioep) break; diff --git a/board/gdsys/mpc8308/gazerbeam.c b/board/gdsys/mpc8308/gazerbeam.c index c317260251e..0e7fa1e333e 100644 --- a/board/gdsys/mpc8308/gazerbeam.c +++ b/board/gdsys/mpc8308/gazerbeam.c @@ -6,7 +6,6 @@ */ #include -#include #include #include #include @@ -15,11 +14,12 @@ #include #include #include +#include #include #include #include "../common/ihs_mdio.h" -#include "../../../drivers/board/gazerbeam.h" +#include "../../../drivers/sysinfo/gazerbeam.h" DECLARE_GLOBAL_DATA_PTR; @@ -43,22 +43,22 @@ static int get_tpm(struct udevice **devp) int board_early_init_r(void) { - struct udevice *board; + struct udevice *sysinfo; struct udevice *serdes; int mc = 0; int con = 0; - if (board_get(&board)) - puts("Could not find board information device.\n"); + if (sysinfo_get(&sysinfo)) + puts("Could not find sysinfo information device.\n"); /* Initialize serdes */ - uclass_get_device_by_phandle(UCLASS_MISC, board, "serdes", &serdes); + uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, "serdes", &serdes); - if (board_detect(board)) + if (sysinfo_detect(sysinfo)) puts("Device information detection failed.\n"); - board_get_int(board, BOARD_MULTICHANNEL, &mc); - board_get_int(board, BOARD_VARIANT, &con); + sysinfo_get_int(sysinfo, BOARD_MULTICHANNEL, &mc); + sysinfo_get_int(sysinfo, BOARD_VARIANT, &con); if (mc == 2 || mc == 1) dev_disable_by_path("/immr@e0000000/i2c@3100/pca9698@22"); @@ -84,18 +84,18 @@ int board_early_init_r(void) return 0; } -int checkboard(void) +int checksysinfo(void) { - struct udevice *board; + struct udevice *sysinfo; char *s = env_get("serial#"); int mc = 0; int con = 0; - if (board_get(&board)) - puts("Could not find board information device.\n"); + if (sysinfo_get(&sysinfo)) + puts("Could not find sysinfo information device.\n"); - board_get_int(board, BOARD_MULTICHANNEL, &mc); - board_get_int(board, BOARD_VARIANT, &con); + sysinfo_get_int(sysinfo, BOARD_MULTICHANNEL, &mc); + sysinfo_get_int(sysinfo, BOARD_VARIANT, &con); puts("Board: Gazerbeam "); printf("%s ", mc == 4 ? "MC4" : mc == 2 ? "MC2" : "SC"); @@ -123,20 +123,22 @@ int last_stage_init(void) { int fpga_hw_rev = 0; int i; - struct udevice *board; + struct udevice *sysinfo; struct udevice *osd; struct video_osd_info osd_info; struct udevice *tpm; int ret; - if (board_get(&board)) - puts("Could not find board information device.\n"); + if (sysinfo_get(&sysinfo)) + puts("Could not find sysinfo information device.\n"); - if (board) { - int res = board_get_int(board, BOARD_HWVERSION, &fpga_hw_rev); + if (sysinfo) { + int res = sysinfo_get_int(sysinfo, BOARD_HWVERSION, + &fpga_hw_rev); if (res) - printf("Could not determind FPGA HW revision (res = %d)\n", res); + printf("Could not determind FPGA HW revision (res = %d)\n", + res); } env_set_ulong("fpga_hw_rev", fpga_hw_rev); @@ -154,7 +156,8 @@ int last_stage_init(void) snprintf(name, sizeof(name), "rxaui%d", i); /* Disable RXAUI polarity inversion */ - ret = uclass_get_device_by_phandle(UCLASS_MISC, board, name, &rxaui); + ret = uclass_get_device_by_phandle(UCLASS_MISC, sysinfo, + name, &rxaui); if (!ret) misc_set_enabled(rxaui, false); } diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c index f5ae48290f4..b8b923c139e 100644 --- a/board/google/chromebook_coral/coral.c +++ b/board/google/chromebook_coral/coral.c @@ -150,7 +150,7 @@ static const struct udevice_id coral_ids[] = { U_BOOT_DRIVER(coral_drv) = { .name = "coral", - .id = UCLASS_BOARD, + .id = UCLASS_SYSINFO, .of_match = coral_ids, ACPI_OPS_PTR(&coral_acpi_ops) }; diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index a90d821c82e..f8f52771352 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -6,13 +6,13 @@ #include #include -#include #include #include #include #include #include #include +#include #include #include @@ -74,7 +74,7 @@ static int spl_fit_get_image_name(const void *fit, int images, const char *type, int index, const char **outname) { - struct udevice *board; + struct udevice *sysinfo; const char *name, *str; __maybe_unused int node; int conf_node; @@ -110,19 +110,20 @@ static int spl_fit_get_image_name(const void *fit, int images, } } - if (!found && !board_get(&board)) { + if (!found && CONFIG_IS_ENABLED(SYSINFO) && !sysinfo_get(&sysinfo)) { int rc; /* - * no string in the property for this index. Check if the board - * level code can supply one. + * no string in the property for this index. Check if the + * sysinfo-level code can supply one. */ - rc = board_get_fit_loadable(board, index - i - 1, type, &str); + rc = sysinfo_get_fit_loadable(sysinfo, index - i - 1, type, + &str); if (rc && rc != -ENOENT) return rc; if (!rc) { /* - * The board provided a name for a loadable. + * The sysinfo provided a name for a loadable. * Try to match it against the description properties * first. If no matching node is found, use it as a * node name. diff --git a/configs/chromebook_coral_defconfig b/configs/chromebook_coral_defconfig index 0ec95af75e0..d934eeb8866 100644 --- a/configs/chromebook_coral_defconfig +++ b/configs/chromebook_coral_defconfig @@ -77,7 +77,6 @@ CONFIG_SYSCON=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_INTEL_ACPIGEN=y CONFIG_CPU=y -CONFIG_BOARD=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_DW=y CONFIG_MISC=y @@ -98,6 +97,7 @@ CONFIG_SOUND_MAX98357A=y CONFIG_SOUND_RT5677=y CONFIG_SPI=y CONFIG_ICH_SPI=y +CONFIG_SYSINFO=y CONFIG_TPL_SYSRESET=y # CONFIG_TPM_V1 is not set CONFIG_TPM2_CR50_I2C=y diff --git a/configs/gazerbeam_defconfig b/configs/gazerbeam_defconfig index 36c2500bae1..5765ef456be 100644 --- a/configs/gazerbeam_defconfig +++ b/configs/gazerbeam_defconfig @@ -157,8 +157,6 @@ CONFIG_CLK=y CONFIG_ICS8N3QV01=y CONFIG_CPU=y CONFIG_CPU_MPC83XX=y -CONFIG_BOARD=y -CONFIG_BOARD_GAZERBEAM=y CONFIG_DM_PCA953X=y CONFIG_MPC8XXX_GPIO=y CONFIG_DM_I2C=y @@ -197,6 +195,8 @@ CONFIG_MPC83XX_SDRAM=y CONFIG_DM_RESET=y CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_GAZERBEAM=y CONFIG_SYSRESET=y CONFIG_SYSRESET_MPC83XX=y CONFIG_TIMER=y diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index e9928d5fc2e..dc993cd13aa 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -69,6 +69,8 @@ CONFIG_CMD_TIME=y CONFIG_CMD_TIMER=y CONFIG_CMD_SOUND=y CONFIG_CMD_QFW=y +CONFIG_CMD_PSTORE=y +CONFIG_CMD_PSTORE_MEM_ADDR=0x3000000 CONFIG_CMD_BOOTSTAGE=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y @@ -80,8 +82,6 @@ CONFIG_CMD_CBFS=y CONFIG_CMD_CRAMFS=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_MTDPARTS=y -CONFIG_CMD_PSTORE=y -CONFIG_CMD_PSTORE_MEM_ADDR=0x3000000 CONFIG_MAC_PARTITION=y CONFIG_AMIGA_PARTITION=y CONFIG_OF_CONTROL=y @@ -109,8 +109,6 @@ CONFIG_CPU=y CONFIG_DM_DEMO=y CONFIG_DM_DEMO_SIMPLE=y CONFIG_DM_DEMO_SHAPE=y -CONFIG_BOARD=y -CONFIG_BOARD_SANDBOX=y CONFIG_GPIO_HOG=y CONFIG_DM_GPIO_LOOKUP_LABEL=y CONFIG_PM8916_GPIO=y @@ -201,6 +199,8 @@ CONFIG_SOC_DEVICE=y CONFIG_SANDBOX_SPI=y CONFIG_SPMI=y CONFIG_SPMI_SANDBOX=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SANDBOX=y CONFIG_SYSRESET=y CONFIG_TIMER=y CONFIG_TIMER_EARLY=y diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index b15b1889e07..5b7cee7889a 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -81,6 +81,8 @@ CONFIG_CMD_TIME=y CONFIG_CMD_TIMER=y CONFIG_CMD_SOUND=y CONFIG_CMD_QFW=y +CONFIG_CMD_PSTORE=y +CONFIG_CMD_PSTORE_MEM_ADDR=0x3000000 CONFIG_CMD_BOOTSTAGE=y CONFIG_CMD_PMIC=y CONFIG_CMD_REGULATOR=y @@ -93,8 +95,6 @@ CONFIG_CMD_CRAMFS=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_SQUASHFS=y CONFIG_CMD_MTDPARTS=y -CONFIG_CMD_PSTORE=y -CONFIG_CMD_PSTORE_MEM_ADDR=0x3000000 CONFIG_MAC_PARTITION=y CONFIG_AMIGA_PARTITION=y CONFIG_OF_CONTROL=y @@ -130,8 +130,6 @@ CONFIG_CPU=y CONFIG_DM_DEMO=y CONFIG_DM_DEMO_SIMPLE=y CONFIG_DM_DEMO_SHAPE=y -CONFIG_BOARD=y -CONFIG_BOARD_SANDBOX=y CONFIG_DMA=y CONFIG_DMA_CHANNELS=y CONFIG_SANDBOX_DMA=y @@ -235,6 +233,8 @@ CONFIG_SOC_DEVICE=y CONFIG_SANDBOX_SPI=y CONFIG_SPMI=y CONFIG_SPMI_SANDBOX=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SANDBOX=y CONFIG_SYSRESET=y CONFIG_TIMER=y CONFIG_TIMER_EARLY=y diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig index 6ee23c4a619..1f593eba8fd 100644 --- a/configs/sandbox_flattree_defconfig +++ b/configs/sandbox_flattree_defconfig @@ -90,8 +90,6 @@ CONFIG_CPU=y CONFIG_DM_DEMO=y CONFIG_DM_DEMO_SIMPLE=y CONFIG_DM_DEMO_SHAPE=y -CONFIG_BOARD=y -CONFIG_BOARD_SANDBOX=y CONFIG_GPIO_HOG=y CONFIG_DM_GPIO_LOOKUP_LABEL=y CONFIG_PM8916_GPIO=y @@ -177,6 +175,8 @@ CONFIG_SOC_DEVICE=y CONFIG_SANDBOX_SPI=y CONFIG_SPMI=y CONFIG_SPMI_SANDBOX=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SANDBOX=y CONFIG_SYSRESET=y CONFIG_TIMER=y CONFIG_TIMER_EARLY=y diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig index 1d49e816393..9205f84b86e 100644 --- a/configs/sandbox_spl_defconfig +++ b/configs/sandbox_spl_defconfig @@ -109,8 +109,6 @@ CONFIG_CPU=y CONFIG_DM_DEMO=y CONFIG_DM_DEMO_SIMPLE=y CONFIG_DM_DEMO_SHAPE=y -CONFIG_BOARD=y -CONFIG_BOARD_SANDBOX=y CONFIG_SPL_FIRMWARE=y CONFIG_GPIO_HOG=y CONFIG_PM8916_GPIO=y @@ -194,6 +192,8 @@ CONFIG_SOC_DEVICE=y CONFIG_SANDBOX_SPI=y CONFIG_SPMI=y CONFIG_SPMI_SANDBOX=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SANDBOX=y CONFIG_SYSRESET=y CONFIG_SPL_SYSRESET=y CONFIG_TIMER=y diff --git a/doc/device-tree-bindings/board/gdsys,board_gazerbeam.txt b/doc/device-tree-bindings/sysinfo/gdsys,sysinfo_gazerbeam.txt similarity index 90% rename from doc/device-tree-bindings/board/gdsys,board_gazerbeam.txt rename to doc/device-tree-bindings/sysinfo/gdsys,sysinfo_gazerbeam.txt index 28c1080d904..f70652d3c48 100644 --- a/doc/device-tree-bindings/board/gdsys,board_gazerbeam.txt +++ b/doc/device-tree-bindings/sysinfo/gdsys,sysinfo_gazerbeam.txt @@ -1,11 +1,11 @@ -gdsys Gazerbeam board driver +gdsys Gazerbeam sysinfo driver This driver provides capabilities to access the gdsys Gazerbeam board's device information. Furthermore, phandles to some internal devices are provided for the board files. Required properties: -- compatible: should be "gdsys,board_gazerbeam" +- compatible: should be "gdsys,sysinfo-gazerbeam" - csb: phandle to the board's coherent system bus (CSB) device node - rxaui[0-3]: phandles to the rxaui control device nodes - fpga[0-1]: phandles to the board's gdsys FPGA device nodes @@ -17,8 +17,8 @@ Required properties: Example: -board { - compatible = "gdsys,board_gazerbeam"; +sysinfo { + compatible = "gdsys,sysinfo-gazerbeam"; csb = <&board_soc>; serdes = <&SERDES>; rxaui0 = <&RXAUI0>; diff --git a/drivers/Kconfig b/drivers/Kconfig index 613669cb381..37293e8da9d 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -30,8 +30,6 @@ source "drivers/ddr/Kconfig" source "drivers/demo/Kconfig" -source "drivers/board/Kconfig" - source "drivers/ddr/fsl/Kconfig" source "drivers/dfu/Kconfig" @@ -112,6 +110,8 @@ source "drivers/spi/Kconfig" source "drivers/spmi/Kconfig" +source "drivers/sysinfo/Kconfig" + source "drivers/sysreset/Kconfig" source "drivers/tee/Kconfig" diff --git a/drivers/Makefile b/drivers/Makefile index 9eb51453e57..51eec712996 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -26,9 +26,9 @@ obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/ obj-$(CONFIG_$(SPL_TPL_)VIRTIO) += virtio/ obj-$(CONFIG_$(SPL_)DM_MAILBOX) += mailbox/ obj-$(CONFIG_$(SPL_)REMOTEPROC) += remoteproc/ +obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/ obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/ obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += power/acpi_pmc/ -obj-$(CONFIG_$(SPL_)BOARD) += board/ obj-$(CONFIG_XEN) += xen/ obj-$(CONFIG_$(SPL_)FPGA) += fpga/ diff --git a/drivers/board/board-uclass.c b/drivers/board/board-uclass.c deleted file mode 100644 index b5485e9895b..00000000000 --- a/drivers/board/board-uclass.c +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2017 - * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc - */ - -#include -#include -#include - -int board_get(struct udevice **devp) -{ - return uclass_first_device_err(UCLASS_BOARD, devp); -} - -int board_detect(struct udevice *dev) -{ - struct board_ops *ops = board_get_ops(dev); - - if (!ops->detect) - return -ENOSYS; - - return ops->detect(dev); -} - -int board_get_fit_loadable(struct udevice *dev, int index, - const char *type, const char **strp) -{ - struct board_ops *ops = board_get_ops(dev); - - if (!ops->get_fit_loadable) - return -ENOSYS; - - return ops->get_fit_loadable(dev, index, type, strp); -} - -int board_get_bool(struct udevice *dev, int id, bool *val) -{ - struct board_ops *ops = board_get_ops(dev); - - if (!ops->get_bool) - return -ENOSYS; - - return ops->get_bool(dev, id, val); -} - -int board_get_int(struct udevice *dev, int id, int *val) -{ - struct board_ops *ops = board_get_ops(dev); - - if (!ops->get_int) - return -ENOSYS; - - return ops->get_int(dev, id, val); -} - -int board_get_str(struct udevice *dev, int id, size_t size, char *val) -{ - struct board_ops *ops = board_get_ops(dev); - - if (!ops->get_str) - return -ENOSYS; - - return ops->get_str(dev, id, size, val); -} - -UCLASS_DRIVER(board) = { - .id = UCLASS_BOARD, - .name = "board", - .post_bind = dm_scan_fdt_dev, -}; diff --git a/drivers/board/Kconfig b/drivers/sysinfo/Kconfig similarity index 65% rename from drivers/board/Kconfig rename to drivers/sysinfo/Kconfig index 254f657049d..39141500a05 100644 --- a/drivers/board/Kconfig +++ b/drivers/sysinfo/Kconfig @@ -1,24 +1,24 @@ -menuconfig BOARD - bool "Device Information" +menuconfig SYSINFO + bool "Device System Information" help Support methods to query hardware configurations from internal mechanisms (e.g. reading GPIO values, determining the presence of devices on busses, etc.). This enables the usage of U-Boot with modular board architectures. -if BOARD +if SYSINFO -config SPL_BOARD +config SPL_SYSINFO depends on SPL_DM bool "Enable board driver support in SPL" -config BOARD_GAZERBEAM - bool "Enable board driver for the Gazerbeam board" +config SYSINFO_GAZERBEAM + bool "Enable sysinfo driver for the Gazerbeam board" help Support querying device information for the gdsys Gazerbeam board. -config BOARD_SANDBOX - bool "Enable board driver for the Sandbox board" +config SYSINFO_SANDBOX + bool "Enable sysinfo driver for the Sandbox board" help Support querying device information for the Sandbox boards. diff --git a/drivers/board/Makefile b/drivers/sysinfo/Makefile similarity index 50% rename from drivers/board/Makefile rename to drivers/sysinfo/Makefile index cc16361755a..aecf0b0d47c 100644 --- a/drivers/board/Makefile +++ b/drivers/sysinfo/Makefile @@ -2,6 +2,6 @@ # # (C) Copyright 2017 # Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc -obj-y += board-uclass.o -obj-$(CONFIG_BOARD_GAZERBEAM) += gazerbeam.o -obj-$(CONFIG_BOARD_SANDBOX) += sandbox.o +obj-y += sysinfo-uclass.o +obj-$(CONFIG_SYSINFO_GAZERBEAM) += gazerbeam.o +obj-$(CONFIG_SYSINFO_SANDBOX) += sandbox.o diff --git a/drivers/board/gazerbeam.c b/drivers/sysinfo/gazerbeam.c similarity index 69% rename from drivers/board/gazerbeam.c rename to drivers/sysinfo/gazerbeam.c index ed50fc530cb..58012d1dbaa 100644 --- a/drivers/board/gazerbeam.c +++ b/drivers/sysinfo/gazerbeam.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -27,16 +27,16 @@ static const int SC_GPIO_NO; static const int CON_GPIO_NO = 1; /** - * struct board_gazerbeam_priv - Private data structure for the gazerbeam board - * driver. - * @reset_gpios: GPIOs for the board's reset GPIOs. - * @var_gpios: GPIOs for the board's hardware variant GPIOs - * @ver_gpios: GPIOs for the board's hardware version GPIOs - * @variant: Container for the board's hardware variant (CON/CPU) - * @multichannel: Container for the board's multichannel variant (MC4/MC2/SC) - * @hwversion: Container for the board's hardware version + * struct sysinfo_gazerbeam_priv - Private data structure for the gazerbeam + * sysinfo driver + * @reset_gpios: GPIOs for the sysinfo's reset GPIOs. + * @var_gpios: GPIOs for the sysinfo's hardware variant GPIOs + * @ver_gpios: GPIOs for the sysinfo's hardware version GPIOs + * @variant: Container for the sysinfo's hardware variant (CON/CPU) + * @multichannel: Container for the sysinfo's multichannel variant (MC4/MC2/SC) + * @hwversion: Container for the sysinfo's hardware version */ -struct board_gazerbeam_priv { +struct sysinfo_gazerbeam_priv { struct gpio_desc reset_gpios[2]; struct gpio_desc var_gpios[2]; struct gpio_desc ver_gpios[4]; @@ -46,19 +46,19 @@ struct board_gazerbeam_priv { }; /** - * _read_board_variant_data() - Read variant information from the hardware. - * @dev: The board device for which to determine the multichannel and device + * _read_sysinfo_variant_data() - Read variant information from the hardware. + * @dev: The sysinfo device for which to determine the multichannel and device * type information. * - * The data read from the board's hardware (mostly hard-wired GPIOs) is stored + * The data read from the sysinfo's hardware (mostly hard-wired GPIOs) is stored * in the private data structure of the driver to be used by other driver * methods. * * Return: 0 if OK, -ve on error. */ -static int _read_board_variant_data(struct udevice *dev) +static int _read_sysinfo_variant_data(struct udevice *dev) { - struct board_gazerbeam_priv *priv = dev_get_priv(dev); + struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev); struct udevice *i2c_bus; struct udevice *dummy; char *listname; @@ -129,10 +129,10 @@ static int _read_board_variant_data(struct udevice *dev) } /** - * _read_hwversion() - Read the hardware version from the board. - * @dev: The board device for which to read the hardware version. + * _read_hwversion() - Read the hardware version from the sysinfo. + * @dev: The sysinfo device for which to read the hardware version. * - * The hardware version read from the board (from hard-wired GPIOs) is stored + * The hardware version read from the sysinfo (from hard-wired GPIOs) is stored * in the private data structure of the driver to be used by other driver * methods. * @@ -140,7 +140,7 @@ static int _read_board_variant_data(struct udevice *dev) */ static int _read_hwversion(struct udevice *dev) { - struct board_gazerbeam_priv *priv = dev_get_priv(dev); + struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev); int res; res = gpio_request_list_by_name(dev, "ver-gpios", priv->ver_gpios, @@ -172,11 +172,11 @@ static int _read_hwversion(struct udevice *dev) return 0; } -static int board_gazerbeam_detect(struct udevice *dev) +static int sysinfo_gazerbeam_detect(struct udevice *dev) { int res; - res = _read_board_variant_data(dev); + res = _read_sysinfo_variant_data(dev); if (res) { debug("%s: Error reading multichannel variant (err = %d)\n", dev->name, res); @@ -193,9 +193,9 @@ static int board_gazerbeam_detect(struct udevice *dev) return 0; } -static int board_gazerbeam_get_int(struct udevice *dev, int id, int *val) +static int sysinfo_gazerbeam_get_int(struct udevice *dev, int id, int *val) { - struct board_gazerbeam_priv *priv = dev_get_priv(dev); + struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev); switch (id) { case BOARD_MULTICHANNEL: @@ -215,19 +215,19 @@ static int board_gazerbeam_get_int(struct udevice *dev, int id, int *val) return 0; } -static const struct udevice_id board_gazerbeam_ids[] = { - { .compatible = "gdsys,board_gazerbeam" }, +static const struct udevice_id sysinfo_gazerbeam_ids[] = { + { .compatible = "gdsys,sysinfo_gazerbeam" }, { /* sentinel */ } }; -static const struct board_ops board_gazerbeam_ops = { - .detect = board_gazerbeam_detect, - .get_int = board_gazerbeam_get_int, +static const struct sysinfo_ops sysinfo_gazerbeam_ops = { + .detect = sysinfo_gazerbeam_detect, + .get_int = sysinfo_gazerbeam_get_int, }; -static int board_gazerbeam_probe(struct udevice *dev) +static int sysinfo_gazerbeam_probe(struct udevice *dev) { - struct board_gazerbeam_priv *priv = dev_get_priv(dev); + struct sysinfo_gazerbeam_priv *priv = dev_get_priv(dev); int gpio_num, i; gpio_num = gpio_request_list_by_name(dev, "reset-gpios", @@ -255,11 +255,11 @@ static int board_gazerbeam_probe(struct udevice *dev) return 0; } -U_BOOT_DRIVER(board_gazerbeam) = { - .name = "board_gazerbeam", - .id = UCLASS_BOARD, - .of_match = board_gazerbeam_ids, - .ops = &board_gazerbeam_ops, - .priv_auto_alloc_size = sizeof(struct board_gazerbeam_priv), - .probe = board_gazerbeam_probe, +U_BOOT_DRIVER(sysinfo_gazerbeam) = { + .name = "sysinfo_gazerbeam", + .id = UCLASS_SYSINFO, + .of_match = sysinfo_gazerbeam_ids, + .ops = &sysinfo_gazerbeam_ops, + .priv_auto_alloc_size = sizeof(struct sysinfo_gazerbeam_priv), + .probe = sysinfo_gazerbeam_probe, }; diff --git a/drivers/board/gazerbeam.h b/drivers/sysinfo/gazerbeam.h similarity index 100% rename from drivers/board/gazerbeam.h rename to drivers/sysinfo/gazerbeam.h diff --git a/drivers/board/sandbox.c b/drivers/sysinfo/sandbox.c similarity index 50% rename from drivers/board/sandbox.c rename to drivers/sysinfo/sandbox.c index 50621e47a4f..62a1cb4ac65 100644 --- a/drivers/board/sandbox.c +++ b/drivers/sysinfo/sandbox.c @@ -6,11 +6,11 @@ #include #include -#include +#include #include "sandbox.h" -struct board_sandbox_priv { +struct sysinfo_sandbox_priv { bool called_detect; int test_i1; int test_i2; @@ -19,9 +19,9 @@ struct board_sandbox_priv { char vacation_spots[][64] = {"R'lyeh", "Dreamlands", "Plateau of Leng", "Carcosa", "Yuggoth", "The Nameless City"}; -int board_sandbox_detect(struct udevice *dev) +int sysinfo_sandbox_detect(struct udevice *dev) { - struct board_sandbox_priv *priv = dev_get_priv(dev); + struct sysinfo_sandbox_priv *priv = dev_get_priv(dev); priv->called_detect = true; priv->test_i2 = 100; @@ -29,9 +29,9 @@ int board_sandbox_detect(struct udevice *dev) return 0; } -int board_sandbox_get_bool(struct udevice *dev, int id, bool *val) +int sysinfo_sandbox_get_bool(struct udevice *dev, int id, bool *val) { - struct board_sandbox_priv *priv = dev_get_priv(dev); + struct sysinfo_sandbox_priv *priv = dev_get_priv(dev); switch (id) { case BOOL_CALLED_DETECT: @@ -43,9 +43,9 @@ int board_sandbox_get_bool(struct udevice *dev, int id, bool *val) return -ENOENT; } -int board_sandbox_get_int(struct udevice *dev, int id, int *val) +int sysinfo_sandbox_get_int(struct udevice *dev, int id, int *val) { - struct board_sandbox_priv *priv = dev_get_priv(dev); + struct sysinfo_sandbox_priv *priv = dev_get_priv(dev); switch (id) { case INT_TEST1: @@ -63,9 +63,9 @@ int board_sandbox_get_int(struct udevice *dev, int id, int *val) return -ENOENT; } -int board_sandbox_get_str(struct udevice *dev, int id, size_t size, char *val) +int sysinfo_sandbox_get_str(struct udevice *dev, int id, size_t size, char *val) { - struct board_sandbox_priv *priv = dev_get_priv(dev); + struct sysinfo_sandbox_priv *priv = dev_get_priv(dev); int i1 = priv->test_i1; int i2 = priv->test_i2; int index = (i1 * i2) % ARRAY_SIZE(vacation_spots); @@ -80,28 +80,28 @@ int board_sandbox_get_str(struct udevice *dev, int id, size_t size, char *val) return -ENOENT; } -static const struct udevice_id board_sandbox_ids[] = { - { .compatible = "sandbox,board_sandbox" }, +static const struct udevice_id sysinfo_sandbox_ids[] = { + { .compatible = "sandbox,sysinfo-sandbox" }, { /* sentinel */ } }; -static const struct board_ops board_sandbox_ops = { - .detect = board_sandbox_detect, - .get_bool = board_sandbox_get_bool, - .get_int = board_sandbox_get_int, - .get_str = board_sandbox_get_str, +static const struct sysinfo_ops sysinfo_sandbox_ops = { + .detect = sysinfo_sandbox_detect, + .get_bool = sysinfo_sandbox_get_bool, + .get_int = sysinfo_sandbox_get_int, + .get_str = sysinfo_sandbox_get_str, }; -int board_sandbox_probe(struct udevice *dev) +int sysinfo_sandbox_probe(struct udevice *dev) { return 0; } -U_BOOT_DRIVER(board_sandbox) = { - .name = "board_sandbox", - .id = UCLASS_BOARD, - .of_match = board_sandbox_ids, - .ops = &board_sandbox_ops, - .priv_auto_alloc_size = sizeof(struct board_sandbox_priv), - .probe = board_sandbox_probe, +U_BOOT_DRIVER(sysinfo_sandbox) = { + .name = "sysinfo_sandbox", + .id = UCLASS_SYSINFO, + .of_match = sysinfo_sandbox_ids, + .ops = &sysinfo_sandbox_ops, + .priv_auto_alloc_size = sizeof(struct sysinfo_sandbox_priv), + .probe = sysinfo_sandbox_probe, }; diff --git a/drivers/board/sandbox.h b/drivers/sysinfo/sandbox.h similarity index 100% rename from drivers/board/sandbox.h rename to drivers/sysinfo/sandbox.h diff --git a/drivers/sysinfo/sysinfo-uclass.c b/drivers/sysinfo/sysinfo-uclass.c new file mode 100644 index 00000000000..6df58fe160b --- /dev/null +++ b/drivers/sysinfo/sysinfo-uclass.c @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2017 + * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc + */ + +#include +#include +#include + +int sysinfo_get(struct udevice **devp) +{ + return uclass_first_device_err(UCLASS_SYSINFO, devp); +} + +int sysinfo_detect(struct udevice *dev) +{ + struct sysinfo_ops *ops = sysinfo_get_ops(dev); + + if (!ops->detect) + return -ENOSYS; + + return ops->detect(dev); +} + +int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, + const char **strp) +{ + struct sysinfo_ops *ops = sysinfo_get_ops(dev); + + if (!ops->get_fit_loadable) + return -ENOSYS; + + return ops->get_fit_loadable(dev, index, type, strp); +} + +int sysinfo_get_bool(struct udevice *dev, int id, bool *val) +{ + struct sysinfo_ops *ops = sysinfo_get_ops(dev); + + if (!ops->get_bool) + return -ENOSYS; + + return ops->get_bool(dev, id, val); +} + +int sysinfo_get_int(struct udevice *dev, int id, int *val) +{ + struct sysinfo_ops *ops = sysinfo_get_ops(dev); + + if (!ops->get_int) + return -ENOSYS; + + return ops->get_int(dev, id, val); +} + +int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val) +{ + struct sysinfo_ops *ops = sysinfo_get_ops(dev); + + if (!ops->get_str) + return -ENOSYS; + + return ops->get_str(dev, id, size, val); +} + +UCLASS_DRIVER(sysinfo) = { + .id = UCLASS_SYSINFO, + .name = "sysinfo", + .post_bind = dm_scan_fdt_dev, +}; diff --git a/drivers/timer/mpc83xx_timer.c b/drivers/timer/mpc83xx_timer.c index ad8bb28e8b3..125056235e7 100644 --- a/drivers/timer/mpc83xx_timer.c +++ b/drivers/timer/mpc83xx_timer.c @@ -5,12 +5,12 @@ */ #include -#include #include #include #include #include #include +#include #include #include #include @@ -97,7 +97,7 @@ int interrupt_init(void) { immap_t *immr = (immap_t *)CONFIG_SYS_IMMR; struct udevice *csb; - struct udevice *board; + struct udevice *sysinfo; struct udevice *timer; struct mpc83xx_timer_priv *timer_priv; struct clk clock; @@ -112,12 +112,12 @@ int interrupt_init(void) timer_priv = dev_get_priv(timer); - if (board_get(&board)) { - debug("%s: board device could not be fetched.\n", __func__); + if (sysinfo_get(&sysinfo)) { + debug("%s: sysinfo device could not be fetched.\n", __func__); return -ENOENT; } - ret = uclass_get_device_by_phandle(UCLASS_SIMPLE_BUS, board, + ret = uclass_get_device_by_phandle(UCLASS_SIMPLE_BUS, sysinfo, "csb", &csb); if (ret) { debug("%s: Could not retrieve CSB device (error: %d)", diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index 88f10c46221..e5f942e8a51 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -36,7 +36,6 @@ enum uclass_id { UCLASS_AUDIO_CODEC, /* Audio codec with control and data path */ UCLASS_AXI, /* AXI bus */ UCLASS_BLK, /* Block device */ - UCLASS_BOARD, /* Device information from hardware */ UCLASS_BOOTCOUNT, /* Bootcount backing store */ UCLASS_BUTTON, /* Button */ UCLASS_CACHE, /* Cache controller */ @@ -106,6 +105,7 @@ enum uclass_id { UCLASS_SPI_GENERIC, /* Generic SPI flash target */ UCLASS_SPMI, /* System Power Management Interface bus */ UCLASS_SYSCON, /* System configuration device */ + UCLASS_SYSINFO, /* Device information from hardware */ UCLASS_SYSRESET, /* System reset device */ UCLASS_TEE, /* Trusted Execution Environment device */ UCLASS_THERMAL, /* Thermal sensor */ diff --git a/include/board.h b/include/sysinfo.h similarity index 65% rename from include/board.h rename to include/sysinfo.h index 678b652b0aa..c045d316b07 100644 --- a/include/board.h +++ b/include/sysinfo.h @@ -6,23 +6,23 @@ /* * This uclass encapsulates hardware methods to gather information about a - * board or a specific device such as hard-wired GPIOs on GPIO expanders, + * sysinfo or a specific device such as hard-wired GPIOs on GPIO expanders, * read-only data in flash ICs, or similar. * * The interface offers functions to read the usual standard data types (bool, * int, string) from the device, each of which is identified by a static * numeric ID (which will usually be defined as a enum in a header file). * - * If for example the board had a read-only serial number flash IC, we could + * If for example the sysinfo had a read-only serial number flash IC, we could * call * - * ret = board_detect(dev); + * ret = sysinfo_detect(dev); * if (ret) { - * debug("board device not found."); + * debug("sysinfo device not found."); * return ret; * } * - * ret = board_get_int(dev, ID_SERIAL_NUMBER, &serial); + * ret = sysinfo_get_int(dev, ID_SERIAL_NUMBER, &serial); * if (ret) { * debug("Error when reading serial number from device."); * return ret; @@ -31,8 +31,8 @@ * to read the serial number. */ -#if CONFIG_IS_ENABLED(BOARD) -struct board_ops { +#if CONFIG_IS_ENABLED(SYSINFO) +struct sysinfo_ops { /** * detect() - Run the hardware info detection procedure for this * device. @@ -50,7 +50,7 @@ struct board_ops { /** * get_bool() - Read a specific bool data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @id: A unique identifier for the bool value to be read. * @val: Pointer to a buffer that receives the value read. * @@ -61,7 +61,7 @@ struct board_ops { /** * get_int() - Read a specific int data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @id: A unique identifier for the int value to be read. * @val: Pointer to a buffer that receives the value read. * @@ -72,7 +72,7 @@ struct board_ops { /** * get_str() - Read a specific string data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @id: A unique identifier for the string value to be read. * @size: The size of the buffer to receive the string data. * @val: Pointer to a buffer that receives the value read. @@ -87,7 +87,7 @@ struct board_ops { * detection. A classic use-case would when DTBOs are used to describe * additionnal daughter cards. * - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @index: Index of the image. Starts at 0 and gets incremented * after each call to this function. * @type: The type of image. For example, "fdt" for DTBs @@ -100,70 +100,70 @@ struct board_ops { const char *type, const char **strp); }; -#define board_get_ops(dev) ((struct board_ops *)(dev)->driver->ops) +#define sysinfo_get_ops(dev) ((struct sysinfo_ops *)(dev)->driver->ops) /** - * board_detect() - Run the hardware info detection procedure for this device. + * sysinfo_detect() - Run the hardware info detection procedure for this device. * * @dev: The device containing the information * * Return: 0 if OK, -ve on error. */ -int board_detect(struct udevice *dev); +int sysinfo_detect(struct udevice *dev); /** - * board_get_bool() - Read a specific bool data value that describes the + * sysinfo_get_bool() - Read a specific bool data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @id: A unique identifier for the bool value to be read. * @val: Pointer to a buffer that receives the value read. * * Return: 0 if OK, -ve on error. */ -int board_get_bool(struct udevice *dev, int id, bool *val); +int sysinfo_get_bool(struct udevice *dev, int id, bool *val); /** - * board_get_int() - Read a specific int data value that describes the + * sysinfo_get_int() - Read a specific int data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @id: A unique identifier for the int value to be read. * @val: Pointer to a buffer that receives the value read. * * Return: 0 if OK, -ve on error. */ -int board_get_int(struct udevice *dev, int id, int *val); +int sysinfo_get_int(struct udevice *dev, int id, int *val); /** - * board_get_str() - Read a specific string data value that describes the + * sysinfo_get_str() - Read a specific string data value that describes the * hardware setup. - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @id: A unique identifier for the string value to be read. * @size: The size of the buffer to receive the string data. * @val: Pointer to a buffer that receives the value read. * * Return: 0 if OK, -ve on error. */ -int board_get_str(struct udevice *dev, int id, size_t size, char *val); +int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val); /** - * board_get() - Return the board device for the board in question. - * @devp: Pointer to structure to receive the board device. + * sysinfo_get() - Return the sysinfo device for the sysinfo in question. + * @devp: Pointer to structure to receive the sysinfo device. * - * Since there can only be at most one board instance, the API can supply a + * Since there can only be at most one sysinfo instance, the API can supply a * function that returns the unique device. This is especially useful for use - * in board files. + * in sysinfo files. * * Return: 0 if OK, -ve on error. */ -int board_get(struct udevice **devp); +int sysinfo_get(struct udevice **devp); /** - * board_get_fit_loadable - Get the name of an image to load from FIT + * sysinfo_get_fit_loadable - Get the name of an image to load from FIT * This function can be used to provide the image names based on runtime * detection. A classic use-case would when DTBOs are used to describe * additionnal daughter cards. * - * @dev: The board instance to gather the data. + * @dev: The sysinfo instance to gather the data. * @index: Index of the image. Starts at 0 and gets incremented * after each call to this function. * @type: The type of image. For example, "fdt" for DTBs @@ -173,39 +173,39 @@ int board_get(struct udevice **devp); * Return: 0 if OK, -ENOENT if no loadable is available else -ve on * error. */ -int board_get_fit_loadable(struct udevice *dev, int index, - const char *type, const char **strp); +int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, + const char **strp); #else -static inline int board_detect(struct udevice *dev) +static inline int sysinfo_detect(struct udevice *dev) { return -ENOSYS; } -static inline int board_get_bool(struct udevice *dev, int id, bool *val) +static inline int sysinfo_get_bool(struct udevice *dev, int id, bool *val) { return -ENOSYS; } -static inline int board_get_int(struct udevice *dev, int id, int *val) +static inline int sysinfo_get_int(struct udevice *dev, int id, int *val) { return -ENOSYS; } -static inline int board_get_str(struct udevice *dev, int id, size_t size, - char *val) +static inline int sysinfo_get_str(struct udevice *dev, int id, size_t size, + char *val) { return -ENOSYS; } -static inline int board_get(struct udevice **devp) +static inline int sysinfo_get(struct udevice **devp) { return -ENOSYS; } -static inline int board_get_fit_loadable(struct udevice *dev, int index, - const char *type, const char **strp) +static inline int sysinfo_get_fit_loadable(struct udevice *dev, int index, + const char *type, const char **strp) { return -ENOSYS; } diff --git a/test/dm/Makefile b/test/dm/Makefile index e2b07983885..0d507791a12 100644 --- a/test/dm/Makefile +++ b/test/dm/Makefile @@ -18,7 +18,6 @@ obj-$(CONFIG_ACPIGEN) += acpigen.o obj-$(CONFIG_ACPIGEN) += acpi_dp.o obj-$(CONFIG_SOUND) += audio.o obj-$(CONFIG_BLK) += blk.o -obj-$(CONFIG_BOARD) += board.o obj-$(CONFIG_BUTTON) += button.o obj-$(CONFIG_DM_BOOTCOUNT) += bootcount.o obj-$(CONFIG_CLK) += clk.o clk_ccf.o @@ -71,6 +70,7 @@ obj-$(CONFIG_DM_SERIAL) += serial.o obj-$(CONFIG_CPU) += cpu.o obj-$(CONFIG_SOC_DEVICE) += soc.o obj-$(CONFIG_SOUND) += sound.o +obj-$(CONFIG_SYSINFO) += sysinfo.o obj-$(CONFIG_TEE) += tee.o obj-$(CONFIG_VIRTIO_SANDBOX) += virtio.o obj-$(CONFIG_DMA) += dma.o diff --git a/test/dm/board.c b/test/dm/board.c deleted file mode 100644 index f3e7f63f258..00000000000 --- a/test/dm/board.c +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2018 - * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "../../drivers/board/sandbox.h" - -static int dm_test_board(struct unit_test_state *uts) -{ - struct udevice *board; - bool called_detect; - char str[64]; - int i; - - board_get(&board); - ut_assert(board); - - board_get_bool(board, BOOL_CALLED_DETECT, &called_detect); - ut_assert(!called_detect); - - board_detect(board); - - board_get_bool(board, BOOL_CALLED_DETECT, &called_detect); - ut_assert(called_detect); - - board_get_str(board, STR_VACATIONSPOT, sizeof(str), str); - ut_assertok(strcmp(str, "R'lyeh")); - - board_get_int(board, INT_TEST1, &i); - ut_asserteq(0, i); - - board_get_int(board, INT_TEST2, &i); - ut_asserteq(100, i); - - board_get_str(board, STR_VACATIONSPOT, sizeof(str), str); - ut_assertok(strcmp(str, "Carcosa")); - - board_get_int(board, INT_TEST1, &i); - ut_asserteq(1, i); - - board_get_int(board, INT_TEST2, &i); - ut_asserteq(99, i); - - board_get_str(board, STR_VACATIONSPOT, sizeof(str), str); - ut_assertok(strcmp(str, "Yuggoth")); - - return 0; -} - -DM_TEST(dm_test_board, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); diff --git a/test/dm/sysinfo.c b/test/dm/sysinfo.c new file mode 100644 index 00000000000..4aaa9e85bce --- /dev/null +++ b/test/dm/sysinfo.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2018 + * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "../../drivers/sysinfo/sandbox.h" + +static int dm_test_sysinfo(struct unit_test_state *uts) +{ + struct udevice *sysinfo; + bool called_detect; + char str[64]; + int i; + + ut_assertok(sysinfo_get(&sysinfo)); + ut_assert(sysinfo); + + sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, &called_detect); + ut_assert(!called_detect); + + sysinfo_detect(sysinfo); + + sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, &called_detect); + ut_assert(called_detect); + + sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(strcmp(str, "R'lyeh")); + + sysinfo_get_int(sysinfo, INT_TEST1, &i); + ut_asserteq(0, i); + + sysinfo_get_int(sysinfo, INT_TEST2, &i); + ut_asserteq(100, i); + + sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(strcmp(str, "Carcosa")); + + sysinfo_get_int(sysinfo, INT_TEST1, &i); + ut_asserteq(1, i); + + sysinfo_get_int(sysinfo, INT_TEST2, &i); + ut_asserteq(99, i); + + sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(strcmp(str, "Yuggoth")); + + return 0; +} + +DM_TEST(dm_test_sysinfo, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); From patchwork Thu Oct 22 14:19:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386286 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=bat8abWt; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8f01VXMz9s0b for ; Fri, 23 Oct 2020 01:20:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 72E7782452; Thu, 22 Oct 2020 16:20:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bat8abWt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B9DBF8242B; Thu, 22 Oct 2020 16:20:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E31BC823F3 for ; Thu, 22 Oct 2020 16:20:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id h21so1793439iob.10 for ; Thu, 22 Oct 2020 07:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t74aI4yVwp3IHQvnD0ZjYRKKqgD9JUSgRDtP049WQM4=; b=bat8abWtqGbl5lApDA4rQ84ctK43PYv3HhcoCxnSq7m8xlsEB4o/4Aa/EXtjA4BYVj 5UqhTJaR/sps9j8X/yZ6DmGTJgKBcZKluq+bfNjCxqfXskpf0BaJDD/6+AioA50ANi99 XjRIO/7jIhX41wyl6wxpshkr8ASS4A3C4vgnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t74aI4yVwp3IHQvnD0ZjYRKKqgD9JUSgRDtP049WQM4=; b=cpQ34FJmYH5xQOrxESaEJS9LYcd1jEVTo3QEZARFFtJwgqzp4w21TgiiODrzwSW3Kd h7JFJIMCV49UcqSDFpV9zinZl8n91sh0971I9IrWoeFegpvv1jSi7eEXH4ciwq0VgOBq 41vpiCW1vIsKqI/abuwn/YZCnOI7TjVHqEK0TxT5ku29KiU7EbVmbatEEhhwkwHZ9EEp 1+cMTbVqnVYhxgo0I3FqEEv/iAL2IHDK1HHY0lw60m68+nQGJG+4T1uUCZL/TmmU3WWK u5COYAVtLbgcTNs/3+dFwJB1jiw5hmFnJKOGOqB2TLswUkGpKMZzxnHNakz0K794XI1Y YVLA== X-Gm-Message-State: AOAM532YE2X8txDHqAHdXMpvAJloawpgapUb7YViVf9WnUaeLmUxXhCF BTtwYZv5+YAOjiHXg03fRidrPKGR6AVAWkZ9 X-Google-Smtp-Source: ABdhPJyOC0v7CES7DQej7otYz54kTrp6SI57fVuDD1IkD/88OxPu9u6OlXAWWtA2Rg/POqIPSVowFw== X-Received: by 2002:a02:a83:: with SMTP id 125mr1898433jaw.133.1603376399607; Thu, 22 Oct 2020 07:19:59 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.19.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:19:59 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 02/13] doc: Add a binding for sysinfo Date: Thu, 22 Oct 2020 08:19:37 -0600 Message-Id: <20201022141949.711984-3-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add a simple binding file for this, so that it is clear what this binding directory is for. Signed-off-by: Simon Glass --- (no changes since v1) doc/device-tree-bindings/sysinfo/sysinfo.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/device-tree-bindings/sysinfo/sysinfo.txt diff --git a/doc/device-tree-bindings/sysinfo/sysinfo.txt b/doc/device-tree-bindings/sysinfo/sysinfo.txt new file mode 100644 index 00000000000..ed8830b8284 --- /dev/null +++ b/doc/device-tree-bindings/sysinfo/sysinfo.txt @@ -0,0 +1,18 @@ +Sysinfo +======= + +This provides capabilities to access information about a board/system, for +use by drivers. + +Required properties: + + - compatible: any suitable string where the driver is in the UCLASS_SYSINFO + class + +See also smbios.txt + + +Example + +sysinfo { + compatible = "sandbox,sysinfo"; From patchwork Thu Oct 22 14:19:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386288 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=loRHDw2K; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8fT0yc4z9s0b for ; Fri, 23 Oct 2020 01:20:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8DF4582424; Thu, 22 Oct 2020 16:20:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="loRHDw2K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 786AE82452; Thu, 22 Oct 2020 16:20:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1606D823DE for ; Thu, 22 Oct 2020 16:20:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id u19so1814268ion.3 for ; Thu, 22 Oct 2020 07:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1OOSSXOz2wNwXvrfNvAaWHWM0/3YkGSPQmvdXmvrlpk=; b=loRHDw2KvDBNnM5hnY4VJx8nezavj6s1HZGycwi7/oO4b0ZE6wikthn3VuHN2cg0o/ NWJrJusFDnWJVgYYJCv7IYNX0cDY68NFtgY5BeyP+jRNZ2+V7HL9fB6UTuYjaJI7puiy 96amYdyWacy1EdTuO1gERpujqnX8MCMFYbDpU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1OOSSXOz2wNwXvrfNvAaWHWM0/3YkGSPQmvdXmvrlpk=; b=baGADsBowJ0y8B5NBCdfvlRNYjY9Zi9yyRljXTrEO0JJc1LaAO/0GM6Ej4XjoKsykC qX6zkkp8Rdag8SyAemBXXqn+HYXIVUUrGdSTPJNYI1yakOu9Q90jvDA4tE+f3EFFpm1i qvhNhgA94+1CrfTJ7P8SUP+s0PpEE/EFCeUbzzqTL5RhQ0nAF+xijU6DZ6wNZ/P2+4fk 7EOw96KIPRvWh0kl0NWVG+iLH42slJJE0e3JiMtvNrmKR7+lXleDbY2jNVBqtpU/4p7J WPlauzMQC06H/XtsIHp//p1WM9NrW2+50u0Me2HyjEykZ9OgUN8bEKgjDvti7tiwXI/X j23A== X-Gm-Message-State: AOAM532uMvzs4kCDW8sl/Q61T6YmCzVQSrkK1iQYpQSEZH7kuY8P6GYm iB6WiNrsBjVCCkfm6Aqw81080Xk3wg9iREP3 X-Google-Smtp-Source: ABdhPJzzOCRvu2hvtB21uXQ/spBq2VPuqSdzbRUYGgrbJ6d8fj5vEsAVYnG/kFc8R1rxpQ0pza2DVw== X-Received: by 2002:a5d:9e16:: with SMTP id h22mr2018498ioh.141.1603376400707; Thu, 22 Oct 2020 07:20:00 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:00 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH v4 03/13] x86: Pass an ofnode into each SMBIOS function Date: Thu, 22 Oct 2020 08:19:38 -0600 Message-Id: <20201022081943.v4.3.I9fdd5f232eb03edc10714dbe8e46289e9a1971af@changeid> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean As a first step to obtaining SMBIOS information from the devicetree, add an ofnode parameter to the writing functions. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v2) Changes in v2: - Move dm.h header file to avoid build error on qemu-arm - Deal with boards that don't use of-control include/smbios.h | 5 ++++- lib/smbios.c | 44 ++++++++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/include/smbios.h b/include/smbios.h index 97b9ddce237..c19afbe16c7 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -8,6 +8,8 @@ #ifndef _SMBIOS_H_ #define _SMBIOS_H_ +#include + /* SMBIOS spec version implemented */ #define SMBIOS_MAJOR_VER 3 #define SMBIOS_MINOR_VER 0 @@ -222,9 +224,10 @@ static inline void fill_smbios_header(void *table, int type, * * @addr: start address to write the structure * @handle: the structure's handle, a unique 16-bit number + * @node: node containing the information to write (ofnode_null() if none) * @return: size of the structure */ -typedef int (*smbios_write_type)(ulong *addr, int handle); +typedef int (*smbios_write_type)(ulong *addr, int handle, ofnode node); /** * write_smbios_table() - Write SMBIOS table diff --git a/lib/smbios.c b/lib/smbios.c index 11790443e1a..b0f5e936044 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -13,7 +14,6 @@ #include #ifdef CONFIG_CPU #include -#include #include #endif @@ -25,7 +25,7 @@ * * @start: string area start address * @str: string to add - * @return: string number in the string area + * @return: string number in the string area (1 or more) */ static int smbios_add_string(char *start, const char *str) { @@ -74,7 +74,7 @@ static int smbios_string_table_len(char *start) return len + 1; } -static int smbios_write_type0(ulong *current, int handle) +static int smbios_write_type0(ulong *current, int handle, ofnode node) { struct smbios_type0 *t; int len = sizeof(struct smbios_type0); @@ -111,7 +111,7 @@ static int smbios_write_type0(ulong *current, int handle) return len; } -static int smbios_write_type1(ulong *current, int handle) +static int smbios_write_type1(ulong *current, int handle, ofnode node) { struct smbios_type1 *t; int len = sizeof(struct smbios_type1); @@ -134,7 +134,7 @@ static int smbios_write_type1(ulong *current, int handle) return len; } -static int smbios_write_type2(ulong *current, int handle) +static int smbios_write_type2(ulong *current, int handle, ofnode node) { struct smbios_type2 *t; int len = sizeof(struct smbios_type2); @@ -154,7 +154,7 @@ static int smbios_write_type2(ulong *current, int handle) return len; } -static int smbios_write_type3(ulong *current, int handle) +static int smbios_write_type3(ulong *current, int handle, ofnode node) { struct smbios_type3 *t; int len = sizeof(struct smbios_type3); @@ -176,7 +176,7 @@ static int smbios_write_type3(ulong *current, int handle) return len; } -static void smbios_write_type4_dm(struct smbios_type4 *t) +static void smbios_write_type4_dm(struct smbios_type4 *t, ofnode node) { u16 processor_family = SMBIOS_PROCESSOR_FAMILY_UNKNOWN; const char *vendor = "Unknown"; @@ -185,20 +185,20 @@ static void smbios_write_type4_dm(struct smbios_type4 *t) #ifdef CONFIG_CPU char processor_name[49]; char vendor_name[49]; - struct udevice *dev = NULL; + struct udevice *cpu = NULL; - uclass_find_first_device(UCLASS_CPU, &dev); - if (dev) { - struct cpu_platdata *plat = dev_get_parent_platdata(dev); + uclass_find_first_device(UCLASS_CPU, &cpu); + if (cpu) { + struct cpu_platdata *plat = dev_get_parent_platdata(cpu); if (plat->family) processor_family = plat->family; t->processor_id[0] = plat->id[0]; t->processor_id[1] = plat->id[1]; - if (!cpu_get_vendor(dev, vendor_name, sizeof(vendor_name))) + if (!cpu_get_vendor(cpu, vendor_name, sizeof(vendor_name))) vendor = vendor_name; - if (!cpu_get_desc(dev, processor_name, sizeof(processor_name))) + if (!cpu_get_desc(cpu, processor_name, sizeof(processor_name))) name = processor_name; } #endif @@ -208,7 +208,7 @@ static void smbios_write_type4_dm(struct smbios_type4 *t) t->processor_version = smbios_add_string(t->eos, name); } -static int smbios_write_type4(ulong *current, int handle) +static int smbios_write_type4(ulong *current, int handle, ofnode node) { struct smbios_type4 *t; int len = sizeof(struct smbios_type4); @@ -217,7 +217,7 @@ static int smbios_write_type4(ulong *current, int handle) memset(t, 0, sizeof(struct smbios_type4)); fill_smbios_header(t, SMBIOS_PROCESSOR_INFORMATION, len, handle); t->processor_type = SMBIOS_PROCESSOR_TYPE_CENTRAL; - smbios_write_type4_dm(t); + smbios_write_type4_dm(t, node); t->status = SMBIOS_PROCESSOR_STATUS_ENABLED; t->processor_upgrade = SMBIOS_PROCESSOR_UPGRADE_NONE; t->l1_cache_handle = 0xffff; @@ -232,7 +232,7 @@ static int smbios_write_type4(ulong *current, int handle) return len; } -static int smbios_write_type32(ulong *current, int handle) +static int smbios_write_type32(ulong *current, int handle, ofnode node) { struct smbios_type32 *t; int len = sizeof(struct smbios_type32); @@ -247,7 +247,7 @@ static int smbios_write_type32(ulong *current, int handle) return len; } -static int smbios_write_type127(ulong *current, int handle) +static int smbios_write_type127(ulong *current, int handle, ofnode node) { struct smbios_type127 *t; int len = sizeof(struct smbios_type127); @@ -274,7 +274,9 @@ static smbios_write_type smbios_write_funcs[] = { ulong write_smbios_table(ulong addr) { + ofnode node = ofnode_null(); struct smbios_entry *se; + struct udevice *dev; ulong table_addr; ulong tables; int len = 0; @@ -284,6 +286,12 @@ ulong write_smbios_table(ulong addr) int isize; int i; + if (IS_ENABLED(CONFIG_OF_CONTROL)) { + uclass_first_device(UCLASS_SYSINFO, &dev); + if (dev) + node = dev_read_subnode(dev, "smbios"); + } + /* 16 byte align the table address */ addr = ALIGN(addr, 16); @@ -296,7 +304,7 @@ ulong write_smbios_table(ulong addr) /* populate minimum required tables */ for (i = 0; i < ARRAY_SIZE(smbios_write_funcs); i++) { - int tmp = smbios_write_funcs[i]((ulong *)&addr, handle++); + int tmp = smbios_write_funcs[i]((ulong *)&addr, handle++, node); max_struct_size = max(max_struct_size, tmp); len += tmp; From patchwork Thu Oct 22 14:19:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386289 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IBz2/cH+; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8fm160rz9s0b for ; Fri, 23 Oct 2020 01:21:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C75682462; Thu, 22 Oct 2020 16:20:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="IBz2/cH+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E280B82468; Thu, 22 Oct 2020 16:20:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2097E82434 for ; Thu, 22 Oct 2020 16:20:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id g7so1845950ilr.12 for ; Thu, 22 Oct 2020 07:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kuRZ9ibuFiUHRBauPNwBLtPAZHvFw0c/li0xKHDp+Qs=; b=IBz2/cH+pzgDtXS9gptN/yf0gyZNKXWCZ+2tyjUvZjfvvFqBuEKcfb57L73VuyB34x XPem1aa991i9YSsr4oNihNEgEACvZOXJA/PCaKDjd6CjpUw2cfvMk7hSN6TB2EEB9vzn e7kzmKDWdkjS0Qkyo6ftFF4did3pqaNo6WvJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kuRZ9ibuFiUHRBauPNwBLtPAZHvFw0c/li0xKHDp+Qs=; b=buR7nRnlwLGBOyXy+wGa1bWCY8wLPw0lECcCtWdYi+fkr1xxcfXYFOXDB/U5cXFxFz 1e4wx8YkpRmHmFpD9CW3LxrRnIHeUVuQmQ4qXSRDBA1RZLNUAGgFPscGlvBy/nOxwmaB ouwTnrQJJsQfr5DNy4XidpGLz+NeDDS0r3HKGeOojKUf+WsC2Rf6tQX8MDeT78c/RCDp ZUjgmpbxxulNHcNOHw8ZGmq4OsoD+1U8f26fgBzMLog7cWZFHCPZ7UVYdPAa6yu4NRPU B7Z7VGWXikbQ99q2HkWnZ6jwMGWbsli9pY9h+vGr8dYbzVXKE555M9WXUAXzWGvkGkcW cMUA== X-Gm-Message-State: AOAM530RFcg6AaTgyWWIJrhoArpmZGoJ3qlHYL2DNvj7cloc+e/MyEqD x0tEnrXLMQxxnq7swbgZbAjBjSJXPZE0dWTt X-Google-Smtp-Source: ABdhPJzjMDZzyBF4mGgUhO/1EHjlsr4JFpK+PA+MV4Ah/4iZsF9/Fz6XqdJeQaoljMd2F2tRsNBTFw== X-Received: by 2002:a92:bb0d:: with SMTP id w13mr2183256ili.168.1603376401650; Thu, 22 Oct 2020 07:20:01 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:01 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 04/13] smbios: Allow properties to come from the device tree Date: Thu, 22 Oct 2020 08:19:39 -0600 Message-Id: <20201022141949.711984-4-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Support a way to put SMBIOS properties in the device tree. These can be placed in a 'board' device in an 'smbios' subnode. Signed-off-by: Simon Glass --- Changes in v4: - Fix build error with vexpress_ca9x4 Changes in v3: - Use a different binding with subnodes for each table type lib/smbios.c | 98 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 81 insertions(+), 17 deletions(-) diff --git a/lib/smbios.c b/lib/smbios.c index b0f5e936044..be72a98c49d 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -17,6 +17,18 @@ #include #endif +/** + * struct smbios_write_method - Informaiton about a table-writing function + * + * @write: Function to call + * @subnode_name: Name of subnode which has the information for this function, + * NULL if none + */ +struct smbios_write_method { + smbios_write_type write; + const char *subnode_name; +}; + /** * smbios_add_string() - add a string to the string area * @@ -52,6 +64,43 @@ static int smbios_add_string(char *start, const char *str) } } +/** + * smbios_add_prop_default() - Add a property from the device tree or default + * + * @start: string area start address + * @node: node containing the information to write (ofnode_null() if none) + * @prop: property to write + * @def: default string if the node has no such property + * @return 0 if not found, else SMBIOS string number (1 or more) + */ +static int smbios_add_prop_default(char *start, ofnode node, const char *prop, + const char *def) +{ + const char *str = NULL; + + if (IS_ENABLED(CONFIG_OF_CONTROL)) + str = ofnode_read_string(node, prop); + if (str) + return smbios_add_string(start, str); + else if (def) + return smbios_add_string(start, def); + + return 0; +} + +/** + * smbios_add_prop() - Add a property from the device tree + * + * @start: string area start address + * @node: node containing the information to write (ofnode_null() if none) + * @prop: property to write + * @return 0 if not found, else SMBIOS string number (1 or more) + */ +static int smbios_add_prop(char *start, ofnode node, const char *prop) +{ + return smbios_add_prop_default(start, node, prop, NULL); +} + /** * smbios_string_table_len() - compute the string area size * @@ -120,11 +169,15 @@ static int smbios_write_type1(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type1)); fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle); - t->manufacturer = smbios_add_string(t->eos, CONFIG_SMBIOS_MANUFACTURER); - t->product_name = smbios_add_string(t->eos, CONFIG_SMBIOS_PRODUCT_NAME); + t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer", + CONFIG_SMBIOS_MANUFACTURER); + t->product_name = smbios_add_prop_default(t->eos, node, "product", + CONFIG_SMBIOS_PRODUCT_NAME); if (serial_str) { - strncpy((char *)t->uuid, serial_str, sizeof(t->uuid)); t->serial_number = smbios_add_string(t->eos, serial_str); + strncpy((char *)t->uuid, serial_str, sizeof(t->uuid)); + } else { + t->serial_number = smbios_add_prop(t->eos, node, "serial"); } len = t->length + smbios_string_table_len(t->eos); @@ -142,8 +195,10 @@ static int smbios_write_type2(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type2)); fill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, handle); - t->manufacturer = smbios_add_string(t->eos, CONFIG_SMBIOS_MANUFACTURER); - t->product_name = smbios_add_string(t->eos, CONFIG_SMBIOS_PRODUCT_NAME); + t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer", + CONFIG_SMBIOS_MANUFACTURER); + t->product_name = smbios_add_prop_default(t->eos, node, "product", + CONFIG_SMBIOS_PRODUCT_NAME); t->feature_flags = SMBIOS_BOARD_FEATURE_HOSTING; t->board_type = SMBIOS_BOARD_MOTHERBOARD; @@ -162,7 +217,8 @@ static int smbios_write_type3(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type3)); fill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, handle); - t->manufacturer = smbios_add_string(t->eos, CONFIG_SMBIOS_MANUFACTURER); + t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer", + CONFIG_SMBIOS_MANUFACTURER); t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP; t->bootup_state = SMBIOS_STATE_SAFE; t->power_supply_state = SMBIOS_STATE_SAFE; @@ -262,19 +318,19 @@ static int smbios_write_type127(ulong *current, int handle, ofnode node) return len; } -static smbios_write_type smbios_write_funcs[] = { - smbios_write_type0, - smbios_write_type1, - smbios_write_type2, - smbios_write_type3, - smbios_write_type4, - smbios_write_type32, - smbios_write_type127 +static struct smbios_write_method smbios_write_funcs[] = { + { smbios_write_type0, }, + { smbios_write_type1, "system", }, + { smbios_write_type2, "baseboard", }, + { smbios_write_type3, "chassis", }, + { smbios_write_type4, }, + { smbios_write_type32, }, + { smbios_write_type127 }, }; ulong write_smbios_table(ulong addr) { - ofnode node = ofnode_null(); + ofnode parent_node = ofnode_null(); struct smbios_entry *se; struct udevice *dev; ulong table_addr; @@ -289,7 +345,7 @@ ulong write_smbios_table(ulong addr) if (IS_ENABLED(CONFIG_OF_CONTROL)) { uclass_first_device(UCLASS_SYSINFO, &dev); if (dev) - node = dev_read_subnode(dev, "smbios"); + parent_node = dev_read_subnode(dev, "smbios"); } /* 16 byte align the table address */ @@ -304,7 +360,15 @@ ulong write_smbios_table(ulong addr) /* populate minimum required tables */ for (i = 0; i < ARRAY_SIZE(smbios_write_funcs); i++) { - int tmp = smbios_write_funcs[i]((ulong *)&addr, handle++, node); + const struct smbios_write_method *method; + ofnode node = ofnode_null(); + int tmp; + + method = &smbios_write_funcs[i]; + if (IS_ENABLED(CONFIG_OF_CONTROL) && method->subnode_name) + node = ofnode_find_subnode(parent_node, + method->subnode_name); + tmp = method->write((ulong *)&addr, handle++, node); max_struct_size = max(max_struct_size, tmp); len += tmp; From patchwork Thu Oct 22 14:19:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386287 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IvORdscV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8fD43PSz9s0b for ; Fri, 23 Oct 2020 01:20:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CFB782456; Thu, 22 Oct 2020 16:20:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="IvORdscV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2310E82424; Thu, 22 Oct 2020 16:20:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0BAB982424 for ; Thu, 22 Oct 2020 16:20:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id j17so1885371ilr.2 for ; Thu, 22 Oct 2020 07:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NNU8Edll9pJa9s3YsHEk6HUd3feeZvxxtG6ibxzIwLQ=; b=IvORdscVC4iN7tzH+DWj0n8R27Lt0oNZsgxJWaNKW2Be+AIiXOVYUfxPZW8TO7kqxG 2pU/h+pfPme6ZLgneMEGuCu17a/zevy43k3ss+6eduS78XWu6oKsepgexg60fOlVW4mw UU/nBW2EhG6/J7xrq95RASDzr5unUOU4CQkRM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NNU8Edll9pJa9s3YsHEk6HUd3feeZvxxtG6ibxzIwLQ=; b=rZzt7+y3Groa2EX/5de8QOPWFVZmpsgerxHsuuj40SymwdsCF8TMId08kvS+zLEMOa 373fKhYvUA/pHMbipZEU1qLZGMrlEI4WHT1jWiAqeySxSNvsguX+eL/zb/ZnPTJnUZBw nAa9gEVqRIx2cqAa0rHmdQdfzqGFWIoG6dpOa8ZLVFr18lmjpgr6qHD4wnXSv0Mm1+u/ 1uvx2SIdfPuOWOQPIz2/3JkXmmJvqC/3buuqNIHE+V+TM/c7Yevfk0gTFE8XZfWdTdC9 PM39YJRdQ44jQVjeSWb4zXBPCIcLClIFuFN3hft5NWp3dY7AOTJnY3NhpagkPE2NwTht WN+A== X-Gm-Message-State: AOAM5321ktb16OSl8amStD/E6jghTlh6voQN0ExJX12FSnvhgegQAP/W F/YIvUTfGVQerDw+yvYZuYegvcVFc1f78kr0 X-Google-Smtp-Source: ABdhPJzGmdBM//NtDNMPA+TC8zjH0p2qeFs/pwkdKWQZGDI0L2gr31529J9XHUq42F4w8FV6ePt+wA== X-Received: by 2002:a92:89d0:: with SMTP id w77mr1046038ilk.101.1603376402670; Thu, 22 Oct 2020 07:20:02 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 05/13] smbios: Add more properties Date: Thu, 22 Oct 2020 08:19:40 -0600 Message-Id: <20201022141949.711984-5-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The current tables only support a subset of the available fields defined by the SMBIOS spec. Add a few more. Signed-off-by: Simon Glass --- (no changes since v1) lib/smbios.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/smbios.c b/lib/smbios.c index be72a98c49d..87dd4be415d 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -173,12 +173,15 @@ static int smbios_write_type1(ulong *current, int handle, ofnode node) CONFIG_SMBIOS_MANUFACTURER); t->product_name = smbios_add_prop_default(t->eos, node, "product", CONFIG_SMBIOS_PRODUCT_NAME); + t->version = smbios_add_prop(t->eos, node, "version"); if (serial_str) { t->serial_number = smbios_add_string(t->eos, serial_str); strncpy((char *)t->uuid, serial_str, sizeof(t->uuid)); } else { t->serial_number = smbios_add_prop(t->eos, node, "serial"); } + t->sku_number = smbios_add_prop(t->eos, node, "sku"); + t->family = smbios_add_prop(t->eos, node, "family"); len = t->length + smbios_string_table_len(t->eos); *current += len; @@ -199,6 +202,7 @@ static int smbios_write_type2(ulong *current, int handle, ofnode node) CONFIG_SMBIOS_MANUFACTURER); t->product_name = smbios_add_prop_default(t->eos, node, "product", CONFIG_SMBIOS_PRODUCT_NAME); + t->asset_tag_number = smbios_add_prop(t->eos, node, "asset-tag"); t->feature_flags = SMBIOS_BOARD_FEATURE_HOSTING; t->board_type = SMBIOS_BOARD_MOTHERBOARD; From patchwork Thu Oct 22 14:19:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386290 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TlHRMmNG; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8fz6JTSz9s0b for ; Fri, 23 Oct 2020 01:21:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 08BCF82485; Thu, 22 Oct 2020 16:20:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TlHRMmNG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BAC9282434; Thu, 22 Oct 2020 16:20:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E1531823DD for ; Thu, 22 Oct 2020 16:20:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id y17so1874938ilg.4 for ; Thu, 22 Oct 2020 07:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+o5fhYjlTdouVerOLJnmHqMxLuyGYWbqbjE4YF9LHd0=; b=TlHRMmNGGxxciJL4teUp2Va/VtLCfokrCrl43Ewd+LWolWF5DwEeLUXiqrT3gtJt1i Lt5Fc6UbmGlIhawbe6QlL7W9k4WEAUIYQmQBtsTDOA1Pq+u18YY3KoHFBr+L7iyyTjgd QhVnDz2cpxPdpkX+XvrxIlSyXohhcwE3i0vC8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+o5fhYjlTdouVerOLJnmHqMxLuyGYWbqbjE4YF9LHd0=; b=fV//FuGYv1ZXprcj5Z/1TWkf95PQq8FDYObioOcwNV5JKt0mFIgIHsPS53Zm2z09h3 C7oTy4OoXzUFqvgqgPEyAxjcC2J3V+HFuK1WpYiILYnLH/fPx3D7QC75wWLi5o/whbsu 9MGiFzSBcWdhNumOePEM1eDXJQqOIsonPbP2r0C/2q/CqntfZEpya7FeoNGHYcr0xwc1 A+nDvwQ6WMNVh81DfWV7+jzTBDGRqOYJAsf2o7x9yDxOnpTY0o4UgVWTXYSVINw4h7N0 025BhOmm+R9qzUGLW7JYgfjh85GL4TKJEdxGqOjnfYa/uMELa6+J6yTUWewhg2c4xPMr rVIA== X-Gm-Message-State: AOAM531aB9WJUgcIakdJqAWzIXAgUBCbmuxd0D4GrGOk/tnDGL/+wp4i KRg2m4vXEtc13EydcLsdSDADigBXZ+QbANov X-Google-Smtp-Source: ABdhPJy4uSGn4sXLSNnECuHTk8n8NmBevnYlQEvNQyFb6zGa0uflbvgeUYhQfJsV5NMVgB/347++vQ== X-Received: by 2002:a05:6e02:970:: with SMTP id q16mr2028280ilt.69.1603376403605; Thu, 22 Oct 2020 07:20:03 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:03 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 06/13] smbios: Add documentation and devicetree binding Date: Thu, 22 Oct 2020 08:19:41 -0600 Message-Id: <20201022141949.711984-6-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add information about how to set SMBIOS properties using the devicetree. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) doc/arch/x86.rst | 8 +++ doc/device-tree-bindings/sysinfo/smbios.txt | 77 +++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 doc/device-tree-bindings/sysinfo/smbios.txt diff --git a/doc/arch/x86.rst b/doc/arch/x86.rst index c6b70ce61a3..cc307aa8d5e 100644 --- a/doc/arch/x86.rst +++ b/doc/arch/x86.rst @@ -740,6 +740,14 @@ Note that this is a development feature only. It is not intended for use in production environments. Also it is not currently part of the automated tests so may break in the future. +SMBIOS tables +------------- + +To generate SMBIOS tables in U-Boot, for use by the OS, enable the +CONFIG_GENERATE_SMBIOS_TABLE option. The easiest way to provide the values to +use is via the device tree. For details see +device-tree-bindings/sysinfo/smbios.txt + TODO List --------- - Audio diff --git a/doc/device-tree-bindings/sysinfo/smbios.txt b/doc/device-tree-bindings/sysinfo/smbios.txt new file mode 100644 index 00000000000..b5223228025 --- /dev/null +++ b/doc/device-tree-bindings/sysinfo/smbios.txt @@ -0,0 +1,77 @@ +SMBIOS sysinfo information +========================== + +This binding allows the values for the SMBIOS tables to be specified in the +devicetree, as below. + +Required properties: + + - compatible: "u-boot,smbios" or any other string depending on your board + +This driver allows providing board-specific features such as power control +GPIOs. In addition, the SMBIOS values can be specified in the device tree, +as below: + +An optional 'smbios' subnode can be used to provide these properties. Within +that, the properties are broken down by table type, as in the System Management +BIOS (Basic Input/Output System) Specification. + +Available subnodes for each table type are: + + - 1 : system + - 2 : baseboard + - 3 : chassis + +Within each subnode the following tables are recognised: + +"system" subnode optional properties: + + - manufacturer: Product manufacturer for system + - product: Product name + - version: Product version string + - serial: Serial number for system (note that this can be overridden by + the serial# environment variable) + - sku: Product SKU (Stock-Keeping Unit) + - family: Product family + +"baseboard" subnode optional properties: + + - manufacturer: Product manufacturer for baseboard + - product: Product name + - asset-tag: Asset tag for the motherboard, sometimes used in organisations + to track devices + +"chassis" subnode optional properties: + + - manufacturer: Product manufacturer for chassis + + +Example: + +sysinfo { + compatible = "sandbox,sysinfo-sandbox"; + + smbios { + /* Type 1 table */ + system { + manufacturer = "Google"; + product = "Coral"; + version = "rev2"; + serial = "123456789"; + sku = "sku3"; + family = "Google_Coral"; + }; + + /* Type 2 table */ + baseboard { + manufacturer = "Google"; + product = "Coral"; + asset-tag = "ABC123"; + }; + + /* Type 3 table */ + chassis { + manufacturer = "Google"; + }; + }; +}; From patchwork Thu Oct 22 14:19:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386291 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CmXxp1qJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8gG29VSz9sRK for ; Fri, 23 Oct 2020 01:21:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E31482495; Thu, 22 Oct 2020 16:20:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CmXxp1qJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0049782462; Thu, 22 Oct 2020 16:20:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D58068243E for ; Thu, 22 Oct 2020 16:20:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id w17so1864650ilg.8 for ; Thu, 22 Oct 2020 07:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wm25ZtiJ9EmOfWPvzDEHrwxq82Nu88kycZMJiMWQyEY=; b=CmXxp1qJKfDglvIZTDRynXjjPx5mOUlb0OTjAIBGmH4XRw7N3WSSje7NT6g1GOmyOV un1bv5cEYXFxt+0ffA5EuEIoQAA3WzifO4CZx3wCrYPUTOTaBSlSxmWCnIg+UiyOBC/D cf5hl5C0u2c0/f3mZ75Wkoyfhu3SdS7CP35P0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wm25ZtiJ9EmOfWPvzDEHrwxq82Nu88kycZMJiMWQyEY=; b=RFzQ3HaDHxdfe8fWZyAZKTSQIVne2w92Is+Phq+2La2E7ggy+uckx4dKqOaxHY+CUd pigHUuso3nYDvYJmSZ8WdNwx2J1BbN933vB1ydicpYWnTvo2KMHkkaGi4JCh4uUZ1zUC wSvV6ERar3jDsYBACFatFIBJJfb3o3U7NcsVWQxJQL+J8oOIkfij2KiIE+DgZ8076S5T H7keqCKtHTEW6UIjy1XFXQSjbGmT+9che047WU8MrmUuNvr1AEgLklJReLkr6w1jSdOl 6w3LIgzMgbZ5vqlMpHEOklPxsMvK73vsOr9vSSgpkzS3taaq+s8+UzU2V5ytbTtiJtE8 7wMw== X-Gm-Message-State: AOAM5309ytwB1xFlv3s9zsQYSy+9WknsAnYfpjgPXab3r3SRkxulV3Mx s1X7SNN5olxF8htWtR2RG+oYq6Fo6UX9/atY X-Google-Smtp-Source: ABdhPJyK0CfeHFdSxeXmyb5lupGhG0lw0VeEeLknLWYQv0YGSGfA9372tU/WLf+nkwegbiNlosVd8A== X-Received: by 2002:a05:6e02:c:: with SMTP id h12mr2098310ilr.177.1603376404528; Thu, 22 Oct 2020 07:20:04 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:04 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 07/13] sysinfo: Provide a default driver to set SMBIOS values Date: Thu, 22 Oct 2020 08:19:42 -0600 Message-Id: <20201022141949.711984-7-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Some boards want to specify the manuafacture or product name but do not need to have their own sysinfo driver. Add a default driver which provides a way to specify this SMBIOS information in the devicetree, without needing any board-specific functionality. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) drivers/sysinfo/Kconfig | 8 ++++++++ drivers/sysinfo/Makefile | 1 + drivers/sysinfo/smbios.c | 24 ++++++++++++++++++++++++ lib/Kconfig | 3 +++ 4 files changed, 36 insertions(+) create mode 100644 drivers/sysinfo/smbios.c diff --git a/drivers/sysinfo/Kconfig b/drivers/sysinfo/Kconfig index 39141500a05..ee55b6206f4 100644 --- a/drivers/sysinfo/Kconfig +++ b/drivers/sysinfo/Kconfig @@ -22,4 +22,12 @@ config SYSINFO_SANDBOX help Support querying device information for the Sandbox boards. +config SYSINFO_SMBIOS + bool "Provide a default sysinfo driver for SMBIOS information" + help + Some boards want to specify the manuafacture or product name but do + not need to have their own sysinfo driver. This includes a default + one which provides a way to specify this SMBIOS information in the + devicetree, without needing any board-specific functionality. + endif diff --git a/drivers/sysinfo/Makefile b/drivers/sysinfo/Makefile index aecf0b0d47c..6d04fcba1d1 100644 --- a/drivers/sysinfo/Makefile +++ b/drivers/sysinfo/Makefile @@ -5,3 +5,4 @@ obj-y += sysinfo-uclass.o obj-$(CONFIG_SYSINFO_GAZERBEAM) += gazerbeam.o obj-$(CONFIG_SYSINFO_SANDBOX) += sandbox.o +obj-$(CONFIG_SYSINFO_SMBIOS) += smbios.o diff --git a/drivers/sysinfo/smbios.c b/drivers/sysinfo/smbios.c new file mode 100644 index 00000000000..80ebd1921d8 --- /dev/null +++ b/drivers/sysinfo/smbios.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2020 Google LLC + * Written by Simon Glass + */ + +#include +#include +#include + +static const struct udevice_id sysinfo_smbios_ids[] = { + { .compatible = "u-boot,sysinfo-smbios" }, + { /* sentinel */ } +}; + +static const struct sysinfo_ops sysinfo_smbios_ops = { +}; + +U_BOOT_DRIVER(sysinfo_smbios) = { + .name = "sysinfo_smbios", + .id = UCLASS_SYSINFO, + .of_match = sysinfo_smbios_ids, + .ops = &sysinfo_smbios_ops, +}; diff --git a/lib/Kconfig b/lib/Kconfig index 37aae73a266..ab2fa3cc706 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -644,6 +644,9 @@ config GENERATE_SMBIOS_TABLE Check http://www.dmtf.org/standards/smbios for details. + See also SMBIOS_SYSINFO which allows SMBIOS values to be provided in + the devicetree. + config SMBIOS_MANUFACTURER string "SMBIOS Manufacturer" depends on GENERATE_SMBIOS_TABLE From patchwork Thu Oct 22 14:19:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386293 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TCjm52/g; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8gq4RrNz9sPB for ; Fri, 23 Oct 2020 01:21:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E30038249C; Thu, 22 Oct 2020 16:20:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TCjm52/g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 66D0582468; Thu, 22 Oct 2020 16:20:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ECFCB82442 for ; Thu, 22 Oct 2020 16:20:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id z5so1818131iob.1 for ; Thu, 22 Oct 2020 07:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IFZGCK90wZJWvimEPZn6VUINX1ZmFV68Xd3/Ms9U46E=; b=TCjm52/gt6G+pSOgnXNG64X6XxjIkaTDyrekd8uO+7U2KJQRvkPcheTLM+j9C8kVio eqhT/5aGoi775HS8CowebttkvsGFEqAnGnaCZHx7nNlIIbpRZKiev+BonTwVDtfE9n42 UY1x8p9iGnCN7FoTUZHZtPQvdtSVgRtB77KGc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IFZGCK90wZJWvimEPZn6VUINX1ZmFV68Xd3/Ms9U46E=; b=qE4glMdfGz9TCFPLc5CAg828fjjriCgjhHJXKcruPlNqiDSP0ev+EA4ONSgjNNrIe4 pKYX/sKPqj7YoGanlij2rikl+CZVisAXY+Pa04CP3HHoQzekbTX8Bbaog8dAGUhOk6DM 11E8EHtF2leZnUmvXy/AlIyUdIJS4/GkbkMpfWAZ0V6aViDSQAmDkxGlQxSHVkWthNNU ZiAeeneqFpI1qzNMietMtKOIQrydbOyWaR64YyyqQzUgqNGS7KcqXifWzUaX9RENCjP3 3aMfefYpFp3AAStlG0U0W5jXlLWlO9jqOmqY/WaCY+JcPQ2uLJEp/WsKf2c1hv0CIhh2 9/sA== X-Gm-Message-State: AOAM533ixg5Wy5XYCxewd5AltB2WiAJKG6cDPMxJs83f96j3SBjGk0eX Wly45aImj3lVUC1BxxgGN/5DNzHyG0Fh55gi X-Google-Smtp-Source: ABdhPJxhVboPm3ENyj6oTOZBtQKUv2T9useUXW2Bfl6d4a8yqszDroWBZsgxWvOXa2vepSEfpYtCfg== X-Received: by 2002:a05:6602:2d85:: with SMTP id k5mr2004073iow.165.1603376405596; Thu, 22 Oct 2020 07:20:05 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Jeffy Chen , Kever Yang , Philipp Tomsich , huang lin Subject: [PATCH v4 08/13] rockchip: Use devicetree for SMBIOS settings Date: Thu, 22 Oct 2020 08:19:43 -0600 Message-Id: <20201022141949.711984-8-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add settings and enable the default sysinfo driver so that these can come from the device tree. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/arm/dts/rk3328-roc-cc-u-boot.dtsi | 21 +++++++++++++++++++++ arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi | 23 +++++++++++++++++++++++ arch/arm/dts/rk3328-rock64-u-boot.dtsi | 21 +++++++++++++++++++++ arch/arm/dts/rk3368-lion-u-boot.dtsi | 20 ++++++++++++++++++++ configs/lion-rk3368_defconfig | 4 ++-- configs/roc-cc-rk3328_defconfig | 4 ++-- configs/rock-pi-e-rk3328_defconfig | 4 ++-- configs/rock64-rk3328_defconfig | 4 ++-- 8 files changed, 93 insertions(+), 8 deletions(-) diff --git a/arch/arm/dts/rk3328-roc-cc-u-boot.dtsi b/arch/arm/dts/rk3328-roc-cc-u-boot.dtsi index e929d86e306..08806dfc0f9 100644 --- a/arch/arm/dts/rk3328-roc-cc-u-boot.dtsi +++ b/arch/arm/dts/rk3328-roc-cc-u-boot.dtsi @@ -9,6 +9,27 @@ chosen { u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc; }; + + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "firefly"; + product = "roc-rk3328-cc"; + }; + + baseboard { + manufacturer = "firefly"; + product = "roc-rk3328-cc"; + }; + + chassis { + manufacturer = "firefly"; + product = "roc-rk3328-cc"; + }; + }; + }; }; &gpio0 { diff --git a/arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi b/arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi index bf5b1f3adcb..4fc055eacb7 100644 --- a/arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi +++ b/arch/arm/dts/rk3328-rock-pi-e-u-boot.dtsi @@ -6,6 +6,29 @@ #include "rk3328-u-boot.dtsi" #include "rk3328-sdram-ddr3-666.dtsi" +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "radxa"; + product = "rock-pi-e_rk3328"; + }; + + baseboard { + manufacturer = "radxa"; + product = "rock-pi-e_rk3328"; + }; + + chassis { + manufacturer = "radxa"; + product = "rock-pi-e_rk3328"; + }; + }; + }; +}; + &gpio0 { u-boot,dm-spl; }; diff --git a/arch/arm/dts/rk3328-rock64-u-boot.dtsi b/arch/arm/dts/rk3328-rock64-u-boot.dtsi index 7340ef95f1d..2af32aea05a 100644 --- a/arch/arm/dts/rk3328-rock64-u-boot.dtsi +++ b/arch/arm/dts/rk3328-rock64-u-boot.dtsi @@ -9,6 +9,27 @@ chosen { u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc; }; + + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "pine64"; + product = "rock64_rk3328"; + }; + + baseboard { + manufacturer = "pine64"; + product = "rock64_rk3328"; + }; + + chassis { + manufacturer = "pine64"; + product = "rock64_rk3328"; + }; + }; + }; }; &gpio0 { diff --git a/arch/arm/dts/rk3368-lion-u-boot.dtsi b/arch/arm/dts/rk3368-lion-u-boot.dtsi index edc93e438f9..6d54214de9c 100644 --- a/arch/arm/dts/rk3368-lion-u-boot.dtsi +++ b/arch/arm/dts/rk3368-lion-u-boot.dtsi @@ -14,6 +14,26 @@ u-boot,spl-boot-order = &emmc, &sdmmc; }; + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "rockchip"; + product = "sheep_rk3368"; + }; + + baseboard { + manufacturer = "rockchip"; + product = "sheep_rk3368"; + }; + + chassis { + manufacturer = "rockchip"; + product = "sheep_rk3368"; + }; + }; + }; }; &pinctrl { diff --git a/configs/lion-rk3368_defconfig b/configs/lion-rk3368_defconfig index b5b7a0b2daa..3287bd1c05e 100644 --- a/configs/lion-rk3368_defconfig +++ b/configs/lion-rk3368_defconfig @@ -16,7 +16,6 @@ CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-lion" -CONFIG_SMBIOS_PRODUCT_NAME="sheep_rk3368" CONFIG_DEBUG_UART=y CONFIG_ANDROID_BOOT_IMAGE=y CONFIG_FIT=y @@ -89,4 +88,5 @@ CONFIG_SYSRESET=y CONFIG_SPL_TINY_MEMSET=y CONFIG_LZO=y CONFIG_ERRNO_STR=y -CONFIG_SMBIOS_MANUFACTURER="rockchip" +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y diff --git a/configs/roc-cc-rk3328_defconfig b/configs/roc-cc-rk3328_defconfig index 98b11af2d9f..946a007a798 100644 --- a/configs/roc-cc-rk3328_defconfig +++ b/configs/roc-cc-rk3328_defconfig @@ -13,7 +13,6 @@ CONFIG_SPL_STACK_R_ADDR=0x600000 CONFIG_DEBUG_UART_BASE=0xFF130000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_DEFAULT_DEVICE_TREE="rk3328-roc-cc" -CONFIG_SMBIOS_PRODUCT_NAME="roc-rk3328-cc" CONFIG_DEBUG_UART=y CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 # CONFIG_ANDROID_BOOT_IMAGE is not set @@ -100,4 +99,5 @@ CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_SPL_TINY_MEMSET=y CONFIG_TPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y -CONFIG_SMBIOS_MANUFACTURER="firefly" +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y diff --git a/configs/rock-pi-e-rk3328_defconfig b/configs/rock-pi-e-rk3328_defconfig index 5267691732c..fae9a50c818 100644 --- a/configs/rock-pi-e-rk3328_defconfig +++ b/configs/rock-pi-e-rk3328_defconfig @@ -14,7 +14,6 @@ CONFIG_SPL_SYS_MALLOC_F_LEN=0x4000 CONFIG_DEBUG_UART_BASE=0xFF130000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_DEFAULT_DEVICE_TREE="rk3328-rock-pi-e" -CONFIG_SMBIOS_PRODUCT_NAME="rock-pi-e_rk3328" CONFIG_DEBUG_UART=y CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 # CONFIG_ANDROID_BOOT_IMAGE is not set @@ -102,4 +101,5 @@ CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_SPL_TINY_MEMSET=y CONFIG_TPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y -CONFIG_SMBIOS_MANUFACTURER="radxa" +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig index d6074adb04d..c625a47dc7d 100644 --- a/configs/rock64-rk3328_defconfig +++ b/configs/rock64-rk3328_defconfig @@ -13,7 +13,6 @@ CONFIG_SPL_STACK_R_ADDR=0x600000 CONFIG_DEBUG_UART_BASE=0xFF130000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_DEFAULT_DEVICE_TREE="rk3328-rock64" -CONFIG_SMBIOS_PRODUCT_NAME="rock64_rk3328" CONFIG_DEBUG_UART=y CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 # CONFIG_ANDROID_BOOT_IMAGE is not set @@ -99,4 +98,5 @@ CONFIG_USB_GADGET_DWC2_OTG=y CONFIG_SPL_TINY_MEMSET=y CONFIG_TPL_TINY_MEMSET=y CONFIG_ERRNO_STR=y -CONFIG_SMBIOS_MANUFACTURER="pine64" +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y From patchwork Thu Oct 22 14:19:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386292 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=gbX36XcJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8gY4XkSz9s0b for ; Fri, 23 Oct 2020 01:21:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 771B082481; Thu, 22 Oct 2020 16:20:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gbX36XcJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1998782469; Thu, 22 Oct 2020 16:20:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D02E182455 for ; Thu, 22 Oct 2020 16:20:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id q1so1869599ilt.6 for ; Thu, 22 Oct 2020 07:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=abqb+gBe1cac9+zw83JC0myibiRK/IYz9Nh1mYjmur0=; b=gbX36XcJ3Abhs9h1Szq9wM3z50tJ6RTjMOlc0wLPKo5MO1GQVUPljQXpB77hMQ0So1 dmTgYmRVWU+AAY6dnQrYNFinx0G3JLbAZtHiQd/8qXvTbv9yCPBlV4ezfR3tgjpfZ5M/ 51jagVQgRMRjCVfycgNwdnvDkBCIA6JymIXhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=abqb+gBe1cac9+zw83JC0myibiRK/IYz9Nh1mYjmur0=; b=hOWZxIUMwxmohYXguW0AJMX5qhSyPwDTPvv1ruYxapMEmsz+cnKxQP/TBFYkuQ7h19 9q9picRKcPaIDrmvOlT85HIzjM8ar8D+1WBlk6TDgJXxt+uBiwmzIbCsUtUsWHWlOjyd MPZTO+4AuCSDAPwsyrqynH4ZNj/xd932YaOQ0MnCUlhtCvfFrPNmo3tCE8KN+oZ4Vrvs 3oJVFepgGfSek1RnybdJ0qgzUD+m8op+9yBy2K2Fr2u79KsWEWBzEpY6G+Xs/tuPYrHe 0rxGZA14hx9wEsbPSUyXnV/frR9FbVX6E9PTUVt0gqRiuyTZ7sf6S+QAZfg6ZI/AnYMt tH6Q== X-Gm-Message-State: AOAM530gOEzameU6QqhLwumnRJROAfCDd8zIb6OsveOXO6SVnf+8baol B0F/99yi2i0w28GbsyXJssuFfpx7DzYcYzSG X-Google-Smtp-Source: ABdhPJwCO0WOcHCvhyhD8S1oWJZVB4JCvo7ZSXxSIzSdHUF5ITCXbIXkeIveq96JmLhkyr5A+6R+9g== X-Received: by 2002:a05:6e02:2cc:: with SMTP id v12mr2067271ilr.115.1603376406555; Thu, 22 Oct 2020 07:20:06 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:06 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Stefano Babic Subject: [PATCH v4 09/13] imx: Use devicetree for SMBIOS settings on MYiR MYS-6ULX Date: Thu, 22 Oct 2020 08:19:44 -0600 Message-Id: <20201022141949.711984-9-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add settings and enable the default sysinfo driver so that these can come from the device tree. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) .../dts/imx6ull-myir-mys-6ulx-eval-u-boot.dts | 25 +++++++++++++++++++ configs/myir_mys_6ulx_defconfig | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/imx6ull-myir-mys-6ulx-eval-u-boot.dts diff --git a/arch/arm/dts/imx6ull-myir-mys-6ulx-eval-u-boot.dts b/arch/arm/dts/imx6ull-myir-mys-6ulx-eval-u-boot.dts new file mode 100644 index 00000000000..378e4fa58dc --- /dev/null +++ b/arch/arm/dts/imx6ull-myir-mys-6ulx-eval-u-boot.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 Linumiz + * Author: Parthiban Nallathambi + */ + +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "MYiR"; + }; + + baseboard { + manufacturer = "MYiR"; + }; + + chassis { + manufacturer = "MYiR"; + }; + }; + }; +}; diff --git a/configs/myir_mys_6ulx_defconfig b/configs/myir_mys_6ulx_defconfig index 02b2060874a..4ba817ab1e9 100644 --- a/configs/myir_mys_6ulx_defconfig +++ b/configs/myir_mys_6ulx_defconfig @@ -67,4 +67,5 @@ CONFIG_MXC_UART=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_GADGET=y -CONFIG_SMBIOS_MANUFACTURER="MYiR" +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y From patchwork Thu Oct 22 14:19:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386296 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=NaA2J8Ol; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8hb2pD2z9s0b for ; Fri, 23 Oct 2020 01:22:38 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E3900824B3; Thu, 22 Oct 2020 16:20:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="NaA2J8Ol"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4693482457; Thu, 22 Oct 2020 16:20:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A4C0382456 for ; Thu, 22 Oct 2020 16:20:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id l16so1860309ilj.9 for ; Thu, 22 Oct 2020 07:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vA0hviRminXY4tfK9Fla9/uRECh/KbPjuqM6CqKtxTA=; b=NaA2J8OlJuVKpo5PhqmVRzCA7ZmMNW3T5IY3pWpxtfu44zkGminqV5BH+/X4r4xauS eT7vyciQ2zcksWz7lS/efQWa3U397ybONyZG0ncHLtuEeeF7mG1pVjC5VlcnhhY+4JXb cy7lvIkC9V85isRzyUf+u+99BcIXoEi6dDfvo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vA0hviRminXY4tfK9Fla9/uRECh/KbPjuqM6CqKtxTA=; b=YDDNJYBW7mgmsnorMBqngnZeulPco5GEdWDR8UYD8LU5FqsMezrXTyuZMutNkWoStv 8YbuYfwoAe76OTnsaFhgpX8WFC0TrefrxajA5k9irQE7bfw6pQ0jCYsgm4gP0XIQRkGU PTrdtPfx8W+0RiPKTMMo2PLG7hb9RNkm4pbUzer4MyhJg2XDA3MR6bQmWn0Z6lwFNrVH 1QO/wPwWpViPEQeEbi2bJegkNaiNs/a5EYTZX0xkqS9e7KWmpcScgLUB4IpLllKtnMI/ 9U39AMMAQveSNs8WAlKmTrbR3INk+6jYASR7a2ZDx7szHPgMQv01L50BgLHDwwOagC2n qC7Q== X-Gm-Message-State: AOAM532Nus0FLyQ/wwJ8TKvShrNyFX/UyOMi/6ALDM+n6UHn0XuIHG1u +1MNRQUjUv+dBOC3unDgIps31ixeTunE1+I0 X-Google-Smtp-Source: ABdhPJwpyr6c/kE6HrqvP11K+VWrUfxwRbmUuTeYSrqBS4cjSl8SgCjjuLf4hPYTDAiRZcy90QocXQ== X-Received: by 2002:a92:3007:: with SMTP id x7mr2102689ile.141.1603376407451; Thu, 22 Oct 2020 07:20:07 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 10/13] odroid-c2: Use devicetree for SMBIOS settings Date: Thu, 22 Oct 2020 08:19:45 -0600 Message-Id: <20201022141949.711984-10-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add settings and enable the default sysinfo driver so that these can come from the device tree. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi | 23 ++++++++++++++++++++ configs/odroid-c2_defconfig | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi b/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi index 484b40504dc..90087b00dba 100644 --- a/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi +++ b/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi @@ -6,6 +6,29 @@ #include "meson-gx-u-boot.dtsi" +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "Hardkernel Co., Ltd."; + product = "ODROID-C2"; + }; + + baseboard { + manufacturer = "Hardkernel Co., Ltd."; + product = "ODROID-C2"; + }; + + chassis { + manufacturer = "Hardkernel Co., Ltd."; + product = "ODROID-C2"; + }; + }; + }; +}; + &usb0 { status = "disabled"; }; diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index 5fdce3b4638..f2c9fa72778 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -8,7 +8,6 @@ CONFIG_DEBUG_UART_BASE=0xc81004c0 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" odroid-c2" CONFIG_DEFAULT_DEVICE_TREE="meson-gxbb-odroidc2" -CONFIG_SMBIOS_PRODUCT_NAME="ODROID-C2" CONFIG_DEBUG_UART=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -64,4 +63,5 @@ CONFIG_BMP_16BPP=y CONFIG_BMP_24BPP=y CONFIG_BMP_32BPP=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="Hardkernel Co., Ltd." +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y From patchwork Thu Oct 22 14:19:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386295 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=aQFQbwH7; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8hL44fCz9sPB for ; Fri, 23 Oct 2020 01:22:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EA43B824B8; Thu, 22 Oct 2020 16:20:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="aQFQbwH7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5F8ED82442; Thu, 22 Oct 2020 16:20:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 89133823DE for ; Thu, 22 Oct 2020 16:20:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x143.google.com with SMTP id g7so1846271ilr.12 for ; Thu, 22 Oct 2020 07:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RUY6rHTN33wabconcnVjFiX6AZ1/K2wQm+Qo5IEleqA=; b=aQFQbwH7ku1tWABDg7I5ojzCa9Sxc9JUNij22/zBVFA/+k1YRn/55U3pG9fpddXLB4 iECfbZ82pjzBCJd5GlDVAFbX+FD09lyJOAfInWiZlKdgeh+5IiAIuArFBs6r8IQKHNoC 9SjnMbYGXrCqYs2a+dkfpTyBY5tY7LM4S/kbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RUY6rHTN33wabconcnVjFiX6AZ1/K2wQm+Qo5IEleqA=; b=gXHI8LXxfbkTOlULHF315p1jUq4Ph2blVt0NGd8Fbp5rvqNDLpNtRqKWkX9Mm6qrT4 FsIvEoVNMhe0ALXZdb3A4PdUbrR6ai4aBgTaV78cwxCsVlibTqTWYguib661CQyOEk5a shmnuzH4AfGiPDhdhbCVZY1x249rA3SwdbVLaUHp8Ml376Kg8sVpMbgRkU0YH6ORRipf GdPZRvzgbtCK7woF8SWDBgyf2dTK9jd7J05og15/vwms3gz0JgmvgL9xnmJXfwzqq7x3 9YyIaPTdllQdlG2XE+6QNUwSIbsFlxGZ7bOzb8m8mLRSO1xCgtxaRcyoQ8ywHCjcjVhd 8j7w== X-Gm-Message-State: AOAM530rHId/X2XEisit7UTnVoSoNPgJ2PRc/Emp52M3V9t4v0qdn96M xaYq5WZ8EDDXsEU6MaFTWE/Zm8YYu3EeDi12 X-Google-Smtp-Source: ABdhPJzLfsjEYwzArDKQE7vJG2Uzp+vHBjE3Hz9x2Cte5hHpjqYMtD8gxbEQcqTydloOZSJf9cvcqg== X-Received: by 2002:a05:6e02:1283:: with SMTP id y3mr1980532ilq.305.1603376408339; Thu, 22 Oct 2020 07:20:08 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 11/13] arm64: mvebu: Use devicetree for SMBIOS settings on uDPU Date: Thu, 22 Oct 2020 08:19:46 -0600 Message-Id: <20201022141949.711984-11-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add settings and enable the default sysinfo driver so that these can come from the device tree. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) arch/arm/dts/armada-3720-uDPU-u-boot.dtsi | 20 ++++++++++++++++++++ configs/uDPU_defconfig | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi b/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi index ef178bdc86e..fdad90ad123 100644 --- a/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi +++ b/arch/arm/dts/armada-3720-uDPU-u-boot.dtsi @@ -1,5 +1,25 @@ // SPDX-License-Identifier: GPL-2.0+ +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + product = "uDPU"; + }; + + baseboard { + product = "uDPU"; + }; + + chassis { + product = "uDPU"; + }; + }; + }; +}; + &spi0 { u-boot,dm-pre-reloc; diff --git a/configs/uDPU_defconfig b/configs/uDPU_defconfig index dfab2b306bb..ec97489523d 100644 --- a/configs/uDPU_defconfig +++ b/configs/uDPU_defconfig @@ -11,7 +11,6 @@ CONFIG_DM_GPIO=y CONFIG_DEBUG_UART_BASE=0xd0012000 CONFIG_DEBUG_UART_CLOCK=25804800 CONFIG_DEFAULT_DEVICE_TREE="armada-3720-uDPU" -CONFIG_SMBIOS_PRODUCT_NAME="uDPU" CONFIG_DEBUG_UART=y CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y @@ -97,3 +96,5 @@ CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_ETHER_SMSC95XX=y CONFIG_LZO=y CONFIG_SPL_LZO=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y From patchwork Thu Oct 22 14:19:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386297 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=go0b9DDg; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8hn3KlCz9s0b for ; Fri, 23 Oct 2020 01:22:49 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 49B21824C2; Thu, 22 Oct 2020 16:20:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="go0b9DDg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9AD9182442; Thu, 22 Oct 2020 16:20:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9687D823DD for ; Thu, 22 Oct 2020 16:20:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x141.google.com with SMTP id p10so1878166ile.3 for ; Thu, 22 Oct 2020 07:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6O2LPQBtIBftbfRqhKUTi7nRpiuWnPx76VzQT/TYMtA=; b=go0b9DDg35XfvbZNnIE+G5RDP/gZ9YfUQ/f8x5W8tuw0bn5DqxYERVtTVJZFXeQoFy UiqDBCGpqeI2n3Q08QDt2gicx2/8bF9WJSFfnreYrY3/LhGa0ez1v2WGLrxhctmv9vy0 Vka8hZp7iy8jmCrH/OYra4ZxW7NEQCSG/cnGg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6O2LPQBtIBftbfRqhKUTi7nRpiuWnPx76VzQT/TYMtA=; b=sXtg0agvARpgImX5iLaw93ymW+eZ1/J1IRtb8y8JlteQ0sYdTlPUShWdsv0czdKh11 fFcUW2rvo6zdVbeOaHnv1tT1ts7tW95oSeuMab3mFIedVAQR3pAQbHdMn2L+J3TrrjgP UX+jR3pcdIV1bDf26mt6PYQ3COxfs5QxqzwiVqxWSD7X9Hwd+qMp8ocz9ymgMAIoSXkv GvCNzplUUW/S9txf5b9Q5i3TWed3plUMxiFgC6AVVIvTMuHlaCKTqavXuC2M+d7WpSNt h9EPyOAkbTufwzWAEVJ2xl6A2b915ioqVMJHGV8LWlQPuhVSASe/bEqD6WQ8u32TPals qN3Q== X-Gm-Message-State: AOAM531gqt+UW9okXgKNeTPDCn0K1sLsW5eqagD99wO/+kyNS45qs6AF 1e+pNqDo+H39NoLniNfqmtrDVcIxeabDqxyU X-Google-Smtp-Source: ABdhPJy29m5U0+a1oWgnmfoosESCqb1IaYy+Yd1uaCVjPqdIdSatmIg9laB4gmY6t82ETqUvfpK3Gw== X-Received: by 2002:a92:2003:: with SMTP id j3mr2080298ile.28.1603376409238; Thu, 22 Oct 2020 07:20:09 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:08 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH v4 12/13] x86: galileo: Use devicetree for SMBIOS settings Date: Thu, 22 Oct 2020 08:19:47 -0600 Message-Id: <20201022141949.711984-12-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add settings and enable the default sysinfo driver so that these can come from the device tree. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/dts/galileo.dts | 18 ++++++++++++++++++ board/intel/galileo/Kconfig | 11 ----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/arch/x86/dts/galileo.dts b/arch/x86/dts/galileo.dts index 5de4568679a..18d6cf625e9 100644 --- a/arch/x86/dts/galileo.dts +++ b/arch/x86/dts/galileo.dts @@ -164,4 +164,22 @@ }; }; + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + product = "GalileoGen2"; + }; + + baseboard { + product = "GalileoGen2"; + }; + + chassis { + product = "GalileoGen2"; + }; + }; + }; + }; diff --git a/board/intel/galileo/Kconfig b/board/intel/galileo/Kconfig index 1416c891e86..fb8d94fb5b1 100644 --- a/board/intel/galileo/Kconfig +++ b/board/intel/galileo/Kconfig @@ -22,15 +22,4 @@ config BOARD_SPECIFIC_OPTIONS # dummy select BOARD_ROMSIZE_KB_1024 select SPI_FLASH_WINBOND -config SMBIOS_PRODUCT_NAME - default "GalileoGen2" - help - Override the default product name U-Boot reports in the SMBIOS - table, to be compatible with the Intel provided UEFI BIOS, as - Linux kernel drivers (drivers/mfd/intel_quark_i2c_gpio.c and - drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c) make use of - it to do different board level configuration. - - This can be "Galileo" for GEN1 Galileo board. - endif From patchwork Thu Oct 22 14:19:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1386298 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Fz/yj2Hk; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CH8j01fS6z9sPB for ; Fri, 23 Oct 2020 01:23:00 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DF1FF824C6; Thu, 22 Oct 2020 16:20:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Fz/yj2Hk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2983F82457; Thu, 22 Oct 2020 16:20:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A6CFA82434 for ; Thu, 22 Oct 2020 16:20:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id a20so1854398ilk.13 for ; Thu, 22 Oct 2020 07:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Py0qbbkkGmxPRiD7kuGlrLaOz4QiWFfdDCdXs2IxJOk=; b=Fz/yj2HkLbeP3sqBWUmjcRIv7aWW5ndPlPt5jUBMDgNFYSwnajCdjUTWyVyBxrV4GS PXnK+rW6Xqv/wKTTqJlPgTJj+cOPRCuZrqM/nE1FLmeMyu5mHgD/lwICJksbF2UHDuLM YsHLYfe0rGW3vw7so72rL5RKUQmG8ci9fMiDY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Py0qbbkkGmxPRiD7kuGlrLaOz4QiWFfdDCdXs2IxJOk=; b=f/+D/tERqJPuaMLKVUpjWoDSfPmPxcLo4ArsZw2uaDFkmqgw1y24+d9WswcMn/OLIU bF0Mp2/rCMx9Na10q5mFqASglqPmkFKDM7+Y/La8ubMGI4jC/lxmRu/Nhq0/O54PCNul 0PJVmKA3Re8k5tJ2gw3ux2Eeo8NX+0CSlc6T91pocV2WB3VF85TMhhuRFL2nbOxujsJu QH7SoWrk2cvAPW/15Tr6BDPVTbVLE8/7+3C7BYeHV2Gdue9Lqxika49pA5Q6F4X8nMpe DH5PWccSu1P4fQn3iVgKJKUeOkJsJbH64hUd8j2vhQEKtqg2H/dvn916055Z/I/RM/fD ckNA== X-Gm-Message-State: AOAM532e26BP9d293X6P/lmpmnPJB6s20k6CVVx+9jxSCHj3tiQ3B/VZ 2Kyix2B9YT9+WqBND1oKIjIpcyfbyIQdSr7u X-Google-Smtp-Source: ABdhPJyqXjA5U0CJE+tKsj4knJzvdHL222ja7VkeSUDswCpbL8Br8p8IrOvOlBZhYMv9sDxofeIgRg== X-Received: by 2002:a92:ba56:: with SMTP id o83mr2154590ili.19.1603376410248; Thu, 22 Oct 2020 07:20:10 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id j3sm1211115ilq.85.2020.10.22.07.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:20:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass Subject: [PATCH v4 13/13] smbios: Drop the unused Kconfig options Date: Thu, 22 Oct 2020 08:19:48 -0600 Message-Id: <20201022141949.711984-13-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022141949.711984-1-sjg@chromium.org> References: <20201022141949.711984-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Now that we can use devicetree to specify this information, drop the old CONFIG options. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Add onto the sysinfo binding configs/clearfog_gt_8k_defconfig | 2 -- configs/mt7622_rfb_defconfig | 1 - configs/mvebu_db_armada8k_defconfig | 2 -- configs/r8a774a1_beacon_defconfig | 2 -- configs/r8a77970_eagle_defconfig | 2 -- configs/r8a77980_condor_defconfig | 2 -- configs/r8a77990_ebisu_defconfig | 2 -- configs/r8a77995_draak_defconfig | 2 -- configs/rcar3_salvator-x_defconfig | 2 -- configs/rcar3_ulcb_defconfig | 2 -- lib/Kconfig | 16 ------------- lib/smbios.c | 35 ++++++++++++----------------- 12 files changed, 14 insertions(+), 56 deletions(-) diff --git a/configs/clearfog_gt_8k_defconfig b/configs/clearfog_gt_8k_defconfig index 552df3a8b80..9bb1f212a70 100644 --- a/configs/clearfog_gt_8k_defconfig +++ b/configs/clearfog_gt_8k_defconfig @@ -12,7 +12,6 @@ CONFIG_DM_GPIO=y CONFIG_DEBUG_UART_BASE=0xf0512000 CONFIG_DEBUG_UART_CLOCK=200000000 CONFIG_DEFAULT_DEVICE_TREE="armada-8040-clearfog-gt-8k" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_DEBUG_UART=y CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y @@ -78,4 +77,3 @@ CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_MCS7830=y CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_ETHER_SMSC95XX=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/mt7622_rfb_defconfig b/configs/mt7622_rfb_defconfig index a6089d6cf6a..ccf926e1040 100644 --- a/configs/mt7622_rfb_defconfig +++ b/configs/mt7622_rfb_defconfig @@ -5,7 +5,6 @@ CONFIG_SYS_TEXT_BASE=0x41e00000 CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_NR_DRAM_BANKS=1 CONFIG_DEFAULT_DEVICE_TREE="mt7622-rfb" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_DEFAULT_FDT_FILE="mt7622-rfb" CONFIG_LOGLEVEL=7 diff --git a/configs/mvebu_db_armada8k_defconfig b/configs/mvebu_db_armada8k_defconfig index a88d5cc98bd..5d8a1b655cd 100644 --- a/configs/mvebu_db_armada8k_defconfig +++ b/configs/mvebu_db_armada8k_defconfig @@ -11,7 +11,6 @@ CONFIG_ENV_SECT_SIZE=0x10000 CONFIG_DEBUG_UART_BASE=0xf0512000 CONFIG_DEBUG_UART_CLOCK=200000000 CONFIG_DEFAULT_DEVICE_TREE="armada-8040-db" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_DEBUG_UART=y CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y @@ -72,4 +71,3 @@ CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_MCS7830=y CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_ETHER_SMSC95XX=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/r8a774a1_beacon_defconfig b/configs/r8a774a1_beacon_defconfig index 5d564d82c2f..2f45edd92ec 100644 --- a/configs/r8a774a1_beacon_defconfig +++ b/configs/r8a774a1_beacon_defconfig @@ -8,7 +8,6 @@ CONFIG_RCAR_GEN3=y CONFIG_TARGET_BEACON_RZG2M=y # CONFIG_SPL is not set CONFIG_DEFAULT_DEVICE_TREE="r8a774a1-beacon-rzg2m-kit" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_SUPPORT_RAW_INITRD=y # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set @@ -64,4 +63,3 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/r8a77970_eagle_defconfig b/configs/r8a77970_eagle_defconfig index a7774842353..9dbe0e1d5b4 100644 --- a/configs/r8a77970_eagle_defconfig +++ b/configs/r8a77970_eagle_defconfig @@ -11,7 +11,6 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_EAGLE=y CONFIG_DEFAULT_DEVICE_TREE="r8a77970-eagle-u-boot" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_SUPPORT_RAW_INITRD=y CONFIG_USE_BOOTARGS=y @@ -74,4 +73,3 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/r8a77980_condor_defconfig b/configs/r8a77980_condor_defconfig index 4e457234ed0..dbe2912779c 100644 --- a/configs/r8a77980_condor_defconfig +++ b/configs/r8a77980_condor_defconfig @@ -11,7 +11,6 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_CONDOR=y CONFIG_DEFAULT_DEVICE_TREE="r8a77980-condor-u-boot" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_SUPPORT_RAW_INITRD=y CONFIG_USE_BOOTARGS=y @@ -75,4 +74,3 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/r8a77990_ebisu_defconfig b/configs/r8a77990_ebisu_defconfig index 4667284bb37..cb75b5c3a60 100644 --- a/configs/r8a77990_ebisu_defconfig +++ b/configs/r8a77990_ebisu_defconfig @@ -10,7 +10,6 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_EBISU=y CONFIG_DEFAULT_DEVICE_TREE="r8a77990-ebisu-u-boot" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_SUPPORT_RAW_INITRD=y CONFIG_USE_BOOTARGS=y @@ -84,4 +83,3 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/r8a77995_draak_defconfig b/configs/r8a77995_draak_defconfig index 5cc0f608da2..46a7314fa90 100644 --- a/configs/r8a77995_draak_defconfig +++ b/configs/r8a77995_draak_defconfig @@ -10,7 +10,6 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_DRAAK=y CONFIG_DEFAULT_DEVICE_TREE="r8a77995-draak-u-boot" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_SUPPORT_RAW_INITRD=y CONFIG_USE_BOOTARGS=y @@ -85,4 +84,3 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/rcar3_salvator-x_defconfig b/configs/rcar3_salvator-x_defconfig index 5f2f3665544..ff6e0e945e6 100644 --- a/configs/rcar3_salvator-x_defconfig +++ b/configs/rcar3_salvator-x_defconfig @@ -9,7 +9,6 @@ CONFIG_SPL_TEXT_BASE=0xe6338000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_SALVATOR_X=y CONFIG_DEFAULT_DEVICE_TREE="r8a77950-salvator-x-u-boot" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_SUPPORT_RAW_INITRD=y CONFIG_USE_BOOTARGS=y @@ -89,4 +88,3 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/configs/rcar3_ulcb_defconfig b/configs/rcar3_ulcb_defconfig index 03865dfc34a..df202a75983 100644 --- a/configs/rcar3_ulcb_defconfig +++ b/configs/rcar3_ulcb_defconfig @@ -10,7 +10,6 @@ CONFIG_SPL_TEXT_BASE=0xe6338000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_ULCB=y CONFIG_DEFAULT_DEVICE_TREE="r8a77950-ulcb-u-boot" -CONFIG_SMBIOS_PRODUCT_NAME="" CONFIG_FIT=y CONFIG_SUPPORT_RAW_INITRD=y CONFIG_USE_BOOTARGS=y @@ -87,4 +86,3 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_OF_LIBFDT_OVERLAY=y -CONFIG_SMBIOS_MANUFACTURER="" diff --git a/lib/Kconfig b/lib/Kconfig index ab2fa3cc706..9414665aca4 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -647,22 +647,6 @@ config GENERATE_SMBIOS_TABLE See also SMBIOS_SYSINFO which allows SMBIOS values to be provided in the devicetree. -config SMBIOS_MANUFACTURER - string "SMBIOS Manufacturer" - depends on GENERATE_SMBIOS_TABLE - default SYS_VENDOR - help - The board manufacturer to store in SMBIOS structures. - Change this to override the default one (CONFIG_SYS_VENDOR). - -config SMBIOS_PRODUCT_NAME - string "SMBIOS Product Name" - depends on GENERATE_SMBIOS_TABLE - default SYS_BOARD - help - The product name to store in SMBIOS structures. - Change this to override the default one (CONFIG_SYS_BOARD). - endmenu config ASN1_COMPILER diff --git a/lib/smbios.c b/lib/smbios.c index 87dd4be415d..7b0c692b852 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -65,25 +65,23 @@ static int smbios_add_string(char *start, const char *str) } /** - * smbios_add_prop_default() - Add a property from the device tree or default + * smbios_add_prop_default() - Add a property from the device tree * * @start: string area start address * @node: node containing the information to write (ofnode_null() if none) * @prop: property to write - * @def: default string if the node has no such property * @return 0 if not found, else SMBIOS string number (1 or more) */ -static int smbios_add_prop_default(char *start, ofnode node, const char *prop, - const char *def) +static int smbios_add_prop_default(char *start, ofnode node, const char *prop) { - const char *str = NULL; - if (IS_ENABLED(CONFIG_OF_CONTROL)) + if (IS_ENABLED(CONFIG_OF_CONTROL)) { + const char *str; + str = ofnode_read_string(node, prop); - if (str) - return smbios_add_string(start, str); - else if (def) - return smbios_add_string(start, def); + if (str) + return smbios_add_string(start, str); + } return 0; } @@ -98,7 +96,7 @@ static int smbios_add_prop_default(char *start, ofnode node, const char *prop, */ static int smbios_add_prop(char *start, ofnode node, const char *prop) { - return smbios_add_prop_default(start, node, prop, NULL); + return smbios_add_prop_default(start, node, prop); } /** @@ -169,10 +167,8 @@ static int smbios_write_type1(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type1)); fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle); - t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer", - CONFIG_SMBIOS_MANUFACTURER); - t->product_name = smbios_add_prop_default(t->eos, node, "product", - CONFIG_SMBIOS_PRODUCT_NAME); + t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer"); + t->product_name = smbios_add_prop_default(t->eos, node, "product"); t->version = smbios_add_prop(t->eos, node, "version"); if (serial_str) { t->serial_number = smbios_add_string(t->eos, serial_str); @@ -198,10 +194,8 @@ static int smbios_write_type2(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type2)); fill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, handle); - t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer", - CONFIG_SMBIOS_MANUFACTURER); - t->product_name = smbios_add_prop_default(t->eos, node, "product", - CONFIG_SMBIOS_PRODUCT_NAME); + t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer"); + t->product_name = smbios_add_prop_default(t->eos, node, "product"); t->asset_tag_number = smbios_add_prop(t->eos, node, "asset-tag"); t->feature_flags = SMBIOS_BOARD_FEATURE_HOSTING; t->board_type = SMBIOS_BOARD_MOTHERBOARD; @@ -221,8 +215,7 @@ static int smbios_write_type3(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type3)); fill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, handle); - t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer", - CONFIG_SMBIOS_MANUFACTURER); + t->manufacturer = smbios_add_prop_default(t->eos, node, "manufactuer"); t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP; t->bootup_state = SMBIOS_STATE_SAFE; t->power_supply_state = SMBIOS_STATE_SAFE;