Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3921234pxu; Mon, 12 Oct 2020 05:04:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbto8eeoALtQkq22dR9hqPShuB9xXOs7BHAYrVFoP1XjUhJY7hVSCg1XKc8eFqnOJejiJd X-Received: by 2002:adf:90c4:: with SMTP id i62mr27695891wri.98.1602504266108; Mon, 12 Oct 2020 05:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602504266; cv=none; d=google.com; s=arc-20160816; b=b9aQyGmwOot3xFwowWCm7CqYqO4ynNep/PtL8tGIiUKs7qrJV4IMHI19zt4pkaXFpR KE6K697cok0k6KT5G1LkovoN448jCKMEnb3R2x2Y6NZKQY0DiccJp2Kyp3JM2FfhUclv ang05uJLqpnAsHF7DNcsaBQyqrXeQo0p3IIW0h7A6G7VHmRXIYgJuLduPQKePW1RQ2RQ 78aHKzjhqqSWwqB+J+RBy08WTEnHZF6ER5vtW9powwZOMZ2Yu+iAPQigosSMgiqeBbdn L1RNBBYU5qMxSj+T4GY4Jp4dImeynR4jqLG30aIJ5n7XaOhd54YFam4HydEVghkSkXnu 5lYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=m1nA8sjJ2yw706mL0MywV1XU+/OzuHx6Rn8jpTQlZYI=; b=R9ytkdFLW45/bbm6qz2IrXykzZR9zJXTKKWo99qbupZZ4zjc1YElABlppdg78wiA/7 6Xo+BlpPLCAHXojgnmn8bVyVfVG2x0/YeDNC9u72cHNcpoeageUhFKKBUJghItLs8kvR aqE+6zoWHaple/ucoqk+V5YrTnA2zld/2AxY15xoXsmK0jwxT93nqCLQYd/L+M9pVOu3 5ndeRKa0uXfXcmWjX3gKUWGDpGjNRQifjO/i+OvKWmMry8jPiclmg1P0pV2Nb4TdAyRk L8cnRta42d54pDAJDpMj2WZgUbbhyxAMYFOj2gUAPy9VDuOMCA0ixN8umd6tOLz8hJPs MOKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gl1si11363009ejb.706.2020.10.12.05.04.00; Mon, 12 Oct 2020 05:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388442AbgJLMCj (ORCPT + 99 others); Mon, 12 Oct 2020 08:02:39 -0400 Received: from mail.loongson.cn ([114.242.206.163]:51246 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388332AbgJLMCi (ORCPT ); Mon, 12 Oct 2020 08:02:38 -0400 Received: from [10.130.0.80] (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxGMbRRYRfq8ocAA--.4092S3; Mon, 12 Oct 2020 20:02:26 +0800 (CST) Subject: Re: [PATCH v2 3/4 RESEND] MIPS: Loongson64: Add /proc/boardinfo To: Thomas Bogendoerfer References: <1602373674-4579-1-git-send-email-yangtiezhu@loongson.cn> <1602373674-4579-4-git-send-email-yangtiezhu@loongson.cn> <20201012103805.GC7953@alpha.franken.de> Cc: Jonathan Corbet , Huacai Chen , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Xuefeng Li From: Tiezhu Yang Message-ID: <95060519-530b-c5f5-537d-a7b217b39003@loongson.cn> Date: Mon, 12 Oct 2020 20:02:25 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20201012103805.GC7953@alpha.franken.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf9DxGMbRRYRfq8ocAA--.4092S3 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw45Ww1fXr4DArWfCr13CFg_yoW8tFyrpa yfAw4DGr4DK3WUurn5Ww4UZrWFv3yYkFWqqFW2vw1fK3s5G34FqFW0kayjyF1ayr18Jayj qFWIkr4rWa4DCaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvm14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCYjI0SjxkI62AI1cAE67vI Y487MxkIecxEwVAFwVW5JwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8Jw C20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAF wI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjx v20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2 z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnU UI43ZEXa7VUjsjjDUUUUU== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/2020 06:38 PM, Thomas Bogendoerfer wrote: > On Sun, Oct 11, 2020 at 07:47:53AM +0800, Tiezhu Yang wrote: >> Add /proc/boardinfo to get mainboard and BIOS info easily on the Loongson >> platform, this is useful to point out the current used mainboard type and >> BIOS version when there exists problems related with hardware or firmware. >> >> E.g. with this patch: >> >> [loongson@linux ~]$ cat /proc/boardinfo >> Board Info >> Manufacturer : LEMOTE >> Board Name : LEMOTE-LS3A4000-7A1000-1w-V01-pc >> Family : LOONGSON3 >> >> BIOS Info >> Vendor : Kunlun >> Version : Kunlun-A1901-V4.1.3-20200414093938 >> ROM Size : 4 KB >> Release Date : 2020-04-14 > Why does Loongson64 need this extra file no other architecture or MIPS > platform need ? Do others provide this information via a different method ? > If yes, why can't Loongson64 do the same ? Hi Thomas, This is related with the implementation of firmware. Using dmidecode command can get the similar info if there exists SMBIOS in firmware, but the fact is there is no SMBIOS on some machines, we can see nothing when execute dmidecode, like this: [root@linux loongson]# dmidecode # dmidecode 2.12 # No SMBIOS nor DMI entry point found, sorry. The following three structures are already defined in the interface specification about firmware and kernel on the Loongson platform, this is common requirement and specific for Loongson64, so add a new boardinfo.c file in arch/mips/loongson64. arch/mips/include/asm/mach-loongson64/boot_param.h struct interface_info { u16 vers; /* version of the specificition */ u16 size; u8 flag; char description[64]; } __packed; struct board_devices { char name[64]; /* hold the device name */ u32 num_resources; /* number of device_resource */ /* for each device's resource */ struct resource_loongson resource[MAX_RESOURCE_NUMBER]; /* arch specific additions */ struct archdev_data archdata; }; struct loongson_special_attribute { u16 vers; /* version of this special */ char special_name[64]; /* special_atribute_name */ u32 loongson_special_type; /* type of special device */ /* for each device's resource */ struct resource_loongson resource[MAX_RESOURCE_NUMBER]; }; Thanks, Tiezhu > > Thomas. >