From patchwork Wed Sep 3 13:36:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 198 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906639; bh=PcVZC/OElzcphVJaR5XJiT991VKHf1Yd4YAVejl90dA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=a2moWYXjV+kWFzEZ/HhfTU7t4ksejVxjrFvTfPpBjvw75sucJh0V3TG7APTtCDsR5 fmUTV3RNWgNTKwQRWT2JMQE013Z6PSQ0jMgF80AU33osLQzecplBqzH1uM+8HpDfQj el797wVDR6MWxrZwF6OxyTPS8CZEApZXGCntSV9Q52NByH6pE2y738F7XrXk4/eJKw z8cQcg5KWpdZdHu9hCz3QMSNM881b0kEYJwDNdziWzV0f7b6hsKS0ceH/EsFZUT6eL GGtk7N+Mc1TM4rlACR08rhCv6VoCGvSK7XdQkyYHMVmN3NdNm0nXh+m6ORvyMdUSGm X2oaFIiQUqeyQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1AA2A678F3 for ; Wed, 3 Sep 2025 07:37:19 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id TEEuPbs0Xc7l for ; Wed, 3 Sep 2025 07:37:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906639; bh=PcVZC/OElzcphVJaR5XJiT991VKHf1Yd4YAVejl90dA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=a2moWYXjV+kWFzEZ/HhfTU7t4ksejVxjrFvTfPpBjvw75sucJh0V3TG7APTtCDsR5 fmUTV3RNWgNTKwQRWT2JMQE013Z6PSQ0jMgF80AU33osLQzecplBqzH1uM+8HpDfQj el797wVDR6MWxrZwF6OxyTPS8CZEApZXGCntSV9Q52NByH6pE2y738F7XrXk4/eJKw z8cQcg5KWpdZdHu9hCz3QMSNM881b0kEYJwDNdziWzV0f7b6hsKS0ceH/EsFZUT6eL GGtk7N+Mc1TM4rlACR08rhCv6VoCGvSK7XdQkyYHMVmN3NdNm0nXh+m6ORvyMdUSGm X2oaFIiQUqeyQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0861D678B2 for ; Wed, 3 Sep 2025 07:37:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906636; bh=Rqz8xsQJVmU0t4SRHhDKH+4aze8yeisBcxNQqH1cmb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alHeTOgClXswAgRRVCXKYe+c6brYUvdqPWcpg6u/3DEk5d/BltHgsVCdeuhpmNapF 3idra1hBVJIZowWxYjtooTEMxfP+t4gfIGdRfgvorryIAel9Eipwna99MiNnUpO4Bo ZXazMbb3jVRiEOUdtA9k7a9/OzfDPkoiEGEHs4QOIZds1dvsdXVh1EN8q8Rw/oGkDV YYnfCoLb+aijnuLAa7+yuI8avho6fEtL75lAIdobex0El3+dA8aEwOABaJH2d0qZFy OmFSQp9mPk8ryflPRXjtH2NI2RpYx6UHp/byaxv9uHAcgEKzKxGBJq9Aq7g+D4wOSD 3YV0hahXKyNig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C5E785FCF5; Wed, 3 Sep 2025 07:37:16 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id A4hhTIEE18i7; Wed, 3 Sep 2025 07:37:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906632; bh=T/ukSSEpHHuqndOJjWMt3WzDKZkgQOBFcqGfJt+Fe9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lqteWTKJpeaMdbqx/uHrg5oIS2ZIbylyZRBPzZ9qRtTtaWm5mdOrk0dCt7054z7Of /zBuRRPRinbss/VxfJK4jhYYc/rpFie+a3LTkLC0H2GhAkblFbrbKvsUcDEQegEXhs UZ2cz3sEBggJ1UcZ6tpSRSLDoMocS3FslsJ3FW1GLEMyzL5BkHmT9399ECnhfKnOPM +8XNBmDMISSM9pfTabGF3PnCxK2qAEBtP7XncCldDpqDWHv+BD3RZf94lCwzqzuw03 7y9jPE/gs/tl0M1g2+T2zSWgHErmbA8vKOHCTnjIgLosyIJ8DSyT113tO7vxuO9TRk BM+TUnhEAeyBQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 660B35FE1B; Wed, 3 Sep 2025 07:37:12 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 3 Sep 2025 07:36:09 -0600 Message-ID: <20250903133639.3235920-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250903133639.3235920-1-sjg@u-boot.org> References: <20250903133639.3235920-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZZT2UOUCOCNW7PQBBKGOAQMAXM7FR3EB X-Message-ID-Hash: ZZT2UOUCOCNW7PQBBKGOAQMAXM7FR3EB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/25] smbios: Add docs for the main types List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add kerneldoc documentation for SMBIOS information structure types: - Type 0: BIOS Information - Type 2: Baseboard Information - Type 3: System Enclosure Information - Type 4: Processor Information Add an enum for the enclosure type too. Co-developed-by: Claude Signed-off-by: Simon Glass --- include/smbios.h | 155 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/include/smbios.h b/include/smbios.h index 86a1a1b76f9..723b1540712 100644 --- a/include/smbios.h +++ b/include/smbios.h @@ -146,6 +146,29 @@ struct __packed smbios_header { u16 handle; }; +/** + * struct smbios_type0 - SMBIOS Type 0 (BIOS Information) structure + * + * This structure contains information about the BIOS/UEFI firmware + * including vendor, version, release date, size, characteristics, + * and version information for both BIOS and embedded controller. + * + * @hdr: Common SMBIOS structure header + * @vendor: String number for BIOS vendor name + * @bios_ver: String number for BIOS version + * @bios_start_segment: Segment location of BIOS starting address + * @bios_release_date: String number for BIOS release date + * @bios_rom_size: Size of BIOS image + * @bios_characteristics: BIOS characteristics bit field + * @bios_characteristics_ext1: BIOS characteristics extension byte 1 + * @bios_characteristics_ext2: BIOS characteristics extension byte 2 + * @bios_major_release: Major release number of system BIOS + * @bios_minor_release: Minor release number of system BIOS + * @ec_major_release: Major release number of embedded controller + * @ec_minor_release: Minor release number of embedded controller + * @extended_bios_rom_size: Extended size of BIOS image + * @eos: End-of-structure marker (double null bytes) + */ struct __packed smbios_type0 { struct smbios_header hdr; u8 vendor; @@ -201,6 +224,28 @@ struct __packed smbios_type1 { #define SMBIOS_TYPE2_CON_OBJ_HANDLE_SIZE sizeof(u16) +/** + * struct smbios_type2 - SMBIOS Type 2 (Baseboard Information) structure + * + * This structure contains information about the motherboard or system + * baseboard including manufacturer, model, serial number, asset tag, + * feature flags, and information about contained objects. + * + * @hdr: Common SMBIOS structure header + * @manufacturer: String number for baseboard manufacturer name + * @product_name: String number for baseboard product name + * @version: String number for baseboard version + * @serial_number: String number for baseboard serial number + * @asset_tag_number: String number for asset tag + * @feature_flags: Collection of flags identifying baseboard features + * @chassis_location: String number describing baseboard location in chassis + * @chassis_handle: Handle of chassis containing this baseboard + * @board_type: Type of board (motherboard, processor card, etc.) + * @number_contained_objects: Number of contained object handles + * @eos: End-of-structure marker (double null bytes) + * + * Note: Dynamic bytes for contained object handles are inserted before @eos + */ struct __packed smbios_type2 { struct smbios_header hdr; u8 manufacturer; @@ -220,6 +265,79 @@ struct __packed smbios_type2 { char eos[SMBIOS_STRUCT_EOS_BYTES]; }; +/** + * enum smbios_chassis_type - SMBIOS System Enclosure Chassis Types + * + * Defines the standard chassis types as specified in the SMBIOS specification. + * The chassis type indicates the physical characteristics and form factor + * of the system enclosure. + */ +enum smbios_chassis_type { + SMBIOSCH_OTHER = 0x01, + SMBIOSCH_UNKNOWN = 0x02, + SMBIOSCH_DESKTOP = 0x03, + SMBIOSCH_LOW_PROFILE_DESKTOP = 0x04, + SMBIOSCH_PIZZA_BOX = 0x05, + SMBIOSCH_MINI_TOWER = 0x06, + SMBIOSCH_TOWER = 0x07, + SMBIOSCH_PORTABLE = 0x08, + SMBIOSCH_LAPTOP = 0x09, + SMBIOSCH_NOTEBOOK = 0x0a, + SMBIOSCH_HAND_HELD = 0x0b, + SMBIOSCH_DOCKING_STATION = 0x0c, + SMBIOSCH_ALL_IN_ONE = 0x0d, + SMBIOSCH_SUB_NOTEBOOK = 0x0e, + SMBIOSCH_SPACE_SAVING = 0x0f, + SMBIOSCH_LUNCH_BOX = 0x10, + SMBIOSCH_MAIN_SERVER = 0x11, + SMBIOSCH_EXPANSION = 0x12, + SMBIOSCH_SUB_CHASSIS = 0x13, + SMBIOSCH_BUS_EXPANSION = 0x14, + SMBIOSCH_PERIPHERAL = 0x15, + SMBIOSCH_RAID = 0x16, + SMBIOSCH_RACK_MOUNT = 0x17, + SMBIOSCH_SEALED_CASE_PC = 0x18, + SMBIOSCH_MULTI_SYSTEM = 0x19, + SMBIOSCH_COMPACT_PCI = 0x1a, + SMBIOSCH_ADVANCED_TCA = 0x1b, + SMBIOSCH_BLADE = 0x1c, + SMBIOSCH_BLADE_ENCLOSURE = 0x1d, + SMBIOSCH_TABLET = 0x1e, + SMBIOSCH_CONVERTIBLE = 0x1f, + SMBIOSCH_DETACHABLE = 0x20, + SMBIOSCH_IOT_GATEWAY = 0x21, + SMBIOSCH_EMBEDDED_PC = 0x22, + SMBIOSCH_MINI_PC = 0x23, + SMBIOSCH_STICK_PC = 0x24, +}; + +/** + * struct smbios_type3 - SMBIOS Type 3 (System Enclosure) structure + * + * This structure contains information about the system enclosure or chassis + * including manufacturer, type, version, serial number, asset tag, power + * states, thermal state, security status, and physical characteristics. + * + * @hdr: Common SMBIOS structure header + * @manufacturer: String number for chassis manufacturer name + * @chassis_type: Type of chassis (desktop, laptop, server, etc.) + * @version: String number for chassis version + * @serial_number: String number for chassis serial number + * @asset_tag_number: String number for asset tag + * @bootup_state: State of enclosure when last booted + * @power_supply_state: State of enclosure's power supply + * @thermal_state: Thermal state of the enclosure + * @security_status: Physical security status of the enclosure + * @oem_defined: OEM or BIOS vendor-specific information + * @height: Height of enclosure in 'U's (rack units) + * @number_of_power_cords: Number of power cords associated with enclosure + * @element_count: Number of contained element records + * @element_record_length: Length of each contained element record + * @sku_number: String number for chassis or enclosure SKU number + * @eos: End-of-structure marker (double null bytes) + * + * Note: Dynamic bytes for contained elements are inserted before @sku_number + */ struct __packed smbios_type3 { struct smbios_header hdr; u8 manufacturer; @@ -244,6 +362,43 @@ struct __packed smbios_type3 { char eos[SMBIOS_STRUCT_EOS_BYTES]; }; +/** + * struct smbios_type4 - SMBIOS Type 4 (Processor Information) structure + * + * This structure contains information about installed processors including + * manufacturer, family, model, speed, cache handles, core/thread counts, + * and other processor-specific characteristics and capabilities. + * + * @hdr: Common SMBIOS structure header + * @socket_design: String number for socket designation + * @processor_type: Type of processor (CPU, math processor, DSP, etc.) + * @processor_family: Processor family information + * @processor_manufacturer: String number for processor manufacturer + * @processor_id: Processor identification information (2 DWORDs) + * @processor_version: String number for processor version + * @voltage: Voltage of the processor + * @external_clock: External clock frequency in MHz + * @max_speed: Maximum processor speed in MHz + * @current_speed: Current processor speed in MHz + * @status: Processor status information + * @processor_upgrade: Processor socket type + * @l1_cache_handle: Handle of L1 cache information + * @l2_cache_handle: Handle of L2 cache information + * @l3_cache_handle: Handle of L3 cache information + * @serial_number: String number for processor serial number + * @asset_tag: String number for asset tag + * @part_number: String number for processor part number + * @core_count: Number of cores per processor socket + * @core_enabled: Number of enabled cores per processor socket + * @thread_count: Number of threads per processor socket + * @processor_characteristics: Processor characteristics + * @processor_family2: Extended processor family information + * @core_count2: Extended number of cores per processor socket + * @core_enabled2: Extended number of enabled cores per processor socket + * @thread_count2: Extended number of threads per processor socket + * @thread_enabled: Number of enabled threads per processor socket + * @eos: End-of-structure marker (double null bytes) + */ struct __packed smbios_type4 { struct smbios_header hdr; u8 socket_design;