All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jae Hyun Yoo <quic_jaehyoo@quicinc.com>
To: "Michal Simek" <michal.simek@amd.com>,
	"Ovidiu Panait" <ovidiu.panait@windriver.com>,
	"Simon Glass" <sjg@chromium.org>,
	"Masahisa Kojima" <masahisa.kojima@linaro.org>,
	"Pali Rohár" <pali@kernel.org>,
	"Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Ashok Reddy Soma" <ashok.reddy.soma@xilinx.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Huang Jianan" <jnhuang95@gmail.com>,
	"Chris Morgan" <macromorgan@hotmail.com>,
	"Roland Gaudig" <roland.gaudig@weidmueller.com>,
	"Patrick Delaunay" <patrick.delaunay@foss.st.com>,
	"Alexandru Gagniuc" <mr.nuke.me@gmail.com>
Cc: "Jamie Iles" <quic_jiles@quicinc.com>,
	"Graeme Gregory" <quic_ggregory@quicinc.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	u-boot@lists.denx.de
Subject: Re: [RFC PATCH 1/2] cmd/fru: cmd/fru: move FRU handling support to common region
Date: Fri, 29 Jul 2022 07:38:20 -0700	[thread overview]
Message-ID: <9b8f6fd8-4669-c114-e953-f0694a280ba9@quicinc.com> (raw)
In-Reply-To: <593b8fed-476f-b4d7-3729-da93c07308c5@amd.com>

Hello Michal,

On 7/29/2022 4:13 AM, Michal Simek wrote:
> You should fix subject.

Ah, I'll remove one of 'cmd/fru:' prefix in the title.

> On 7/27/22 01:50, Jae Hyun Yoo wrote:
>> From: Graeme Gregory <quic_ggregory@quicinc.com>
>>
>> The FRU handling was added as a Xilinx board dependent support but it
>> would be useful for other boards too, so this commit moves the FRU
>> handling support to the common region to be enabled by CONFIG_CMD_FRU.
>> Since the Multirecord parsing logic should be implemented on each OEM
>> board specifically, it defines 'fru_parse_multirec' as a weak function
>> so that it can be replaced with the board specific implementation.
> 
> Not entirely. Some multirecords are common and described by spec. But 
> parising multirecord based on IANA ID is vendor specific.
> It means boards shouldn't replicate code for hearder checking. Only 
> handle that IANA specific part.

Right. I'll change the multirecords parsing logic to call the vendor
specific parsing function only when record type is 0xc0 - 0xff. All
other standard type parsing logic and header checking will be placed
in the generic location.

>>
>> Signed-off-by: Graeme Gregory <quic_ggregory@quicinc.com>
>> Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com>
>> ---
>>   board/xilinx/Kconfig                      |  8 ---
>>   board/xilinx/common/Makefile              |  3 --
>>   board/xilinx/common/board.c               | 63 +++++++++++++++++++----
>>   cmd/Kconfig                               |  8 +++
>>   cmd/Makefile                              |  1 +
>>   {board/xilinx/common => cmd}/fru.c        |  3 +-
>>   common/Makefile                           |  2 +
>>   {board/xilinx/common => common}/fru_ops.c | 37 ++++++-------
>>   {board/xilinx/common => include}/fru.h    | 15 +-----
>>   9 files changed, 82 insertions(+), 58 deletions(-)
>>   rename {board/xilinx/common => cmd}/fru.c (99%)
>>   rename {board/xilinx/common => common}/fru_ops.c (93%)
>>   rename {board/xilinx/common => include}/fru.h (85%)
> 
> The main reason why I didn't added to generic location was that in board 
> field there are xilinx specific custom fields.
> With other vendor this won't work.
> I think this should be solved before this code can be moved to generic 
> location.
> 
> Also maybe make sense to move and spec that variable creation.

Yes, I realized that the Xilinx specific customization was added into
the standard board info area so actually it breaks the spec.

struct fru_board_data {
         [....]

	/* Xilinx custom fields */
	u8 rev_type_len;
	u8 rev[FRU_BOARD_MAX_LEN];
	u8 pcie_type_len;
	u8 pcie[FRU_BOARD_MAX_LEN];
	u8 uuid_type_len;
	u8 uuid[FRU_BOARD_MAX_LEN];
};

I think, this type of customization should be added using multirecords
instead of expanding the common board info structure, and it's the
reason why the FRU spec provides OEM multirecord types (0xc0 - 0xff).
Do you have any plan to replace them with OEM multirecords?

Thanks,
Jae

  reply	other threads:[~2022-07-29 14:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 23:50 [RFC PATCH 0/2] cmd/fru: move FRU handling support to common region Jae Hyun Yoo
2022-07-26 23:50 ` [RFC PATCH 1/2] cmd/fru: " Jae Hyun Yoo
2022-07-29 11:13   ` Michal Simek
2022-07-29 14:38     ` Jae Hyun Yoo [this message]
2022-07-29 15:00       ` Jae Hyun Yoo
2022-08-01  7:58         ` Michal Simek
2022-08-01  7:57       ` Michal Simek
2022-07-26 23:50 ` [RFC PATCH 2/2] cmd/fru: add product info area parsing support Jae Hyun Yoo
2022-07-29 11:11   ` Michal Simek
2022-07-29 14:15     ` Jae Hyun Yoo

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=9b8f6fd8-4669-c114-e953-f0694a280ba9@quicinc.com \
    --to=quic_jaehyoo@quicinc.com \
    --cc=ashok.reddy.soma@xilinx.com \
    --cc=clg@kaod.org \
    --cc=jnhuang95@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=masahisa.kojima@linaro.org \
    --cc=michal.simek@amd.com \
    --cc=mr.nuke.me@gmail.com \
    --cc=ovidiu.panait@windriver.com \
    --cc=pali@kernel.org \
    --cc=patrick.delaunay@foss.st.com \
    --cc=quic_ggregory@quicinc.com \
    --cc=quic_jiles@quicinc.com \
    --cc=roland.gaudig@weidmueller.com \
    --cc=sjg@chromium.org \
    --cc=thuth@redhat.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.