linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Tiezhu Yang <yangtiezhu@loongson.cn>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Jonathan Corbet <corbet@lwn.net>, Huacai Chen <chenhc@lemote.com>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, Xuefeng Li <lixuefeng@loongson.cn>
Subject: Re: [PATCH v2 3/4 RESEND] MIPS: Loongson64: Add /proc/boardinfo
Date: Tue, 13 Oct 2020 08:15:15 +0800	[thread overview]
Message-ID: <3707A9AD-DD41-4DD0-A015-DE4DC33279DE@flygoat.com> (raw)
In-Reply-To: <95060519-530b-c5f5-537d-a7b217b39003@loongson.cn>



于 2020年10月12日 GMT+08:00 下午8:02:25, Tiezhu Yang <yangtiezhu@loongson.cn> 写到:
>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];
>};

Hi Tiezhu,

Through I don't think touching top level of proc would be a good idea. It's all about API consistency.

If you intend to provide user an interface then I guess /sys/firmware/lefi
like what DMI did or somewhere less critical is better.

There is no guarantee that Loongson64 device would come with LEFI,
although it's mandatory for now.

Thanks.

- Jiaxun

>
>Thanks,
>Tiezhu
>
>>
>> Thomas.
>>

  reply	other threads:[~2020-10-13  2:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10 23:47 [PATCH v2 0/4 RESEND] Avoid build error, clean up numa.c and add /proc/boardinfo Tiezhu Yang
2020-10-10 23:47 ` [PATCH v2 1/4 RESEND] MIPS: Loongson64: Select SMP in Kconfig to avoid build error Tiezhu Yang
2020-10-12 10:34   ` Thomas Bogendoerfer
2020-10-10 23:47 ` [PATCH v2 2/4 RESEND] MIPS: Loongson64: Clean up numa.c Tiezhu Yang
2020-10-12 10:35   ` Thomas Bogendoerfer
2020-10-10 23:47 ` [PATCH v2 3/4 RESEND] MIPS: Loongson64: Add /proc/boardinfo Tiezhu Yang
2020-10-12 10:38   ` Thomas Bogendoerfer
2020-10-12 12:02     ` Tiezhu Yang
2020-10-13  0:15       ` Jiaxun Yang [this message]
2020-10-13  4:36         ` Tiezhu Yang
2020-10-10 23:47 ` [PATCH v2 4/4 RESEND] docs: fs: proc.rst: Add boardinfo description for Loongson64 Tiezhu Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3707A9AD-DD41-4DD0-A015-DE4DC33279DE@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhc@lemote.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=tsbogend@alpha.franken.de \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).