public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Chris Co <Christopher.Co@microsoft.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH edk2-platforms 1/4] Platform/Solidrun: Add Hummingboard SmBios
Date: Thu, 9 Aug 2018 11:11:50 +0100	[thread overview]
Message-ID: <20180809101149.jvcosdya5dg6larx@bivouac.eciton.net> (raw)
In-Reply-To: <DM5PR2101MB11288F652F263A64479620EF94250@DM5PR2101MB1128.namprd21.prod.outlook.com>

On Thu, Aug 09, 2018 at 05:42:02AM +0000, Chris Co wrote:
> Hi Leif,
> 
> > -----Original Message-----
> > From: Leif Lindholm <leif.lindholm@linaro.org>
> > Sent: Tuesday, August 7, 2018 5:50 AM
> > To: Chris Co <Christopher.Co@microsoft.com>
> > Cc: edk2-devel@lists.01.org; Michael D Kinney
> > <michael.d.kinney@intel.com>; Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Subject: Re: [PATCH edk2-platforms 1/4] Platform/Solidrun: Add
> > Hummingboard SmBios
> > 
> > I'll start trickling through some generic comments on the code, apart from
> > the general ones I made before.
> > 
> 
> Thank you for these comments and continuing with the review.  I do
> sincerely apologize about all the code style issues.  I should have
> been more rigorous about enforcing code style before sending it up
> (It was a lot worse before :-( )

Oh, that's what I expected, don't worry about it.
I just want the code that goes in to be as clean as practical, since
it may be used for reference for future contributions.

I'm also getting more strict as time goes on as I see previous
sloppiness I accepted in the past coming back to haunt me in new
patches.

> I am working on generating the new patch set.  Currently about
> halfway though.  I will incorporate these comments into it.  Should
> have it ready by early next week.  That said, if you do have more
> feedback on other patches, I would be glad to incorporate them in as
> soon as they are available.

FYI, I will be off Friday-Monday. So anything you don't see by end of
today won't arrive before Tuesday - and no rush getting anything out
Monday.
 
> > > +SMBIOS_TABLE_TYPE1 mSysInfoType1 = {
> > > +  { EFI_SMBIOS_TYPE_SYSTEM_INFORMATION, sizeof
> > (SMBIOS_TABLE_TYPE1), 0 },
> > > +  1,    // Manufacturer String
> > > +  2,    // ProductName String
> > > +  3,    // Version String
> > > +  4,    // SerialNumber String
> > > +  { 0x25EF0280, 0xEC82, 0x42B0, { 0x8F, 0xB6, 0x10, 0xAD, 0xCC, 0xC6,
> > > +0x7C, 0x02 } },
> > > +  SystemWakeupTypePowerSwitch,
> > > +  5,    // SKUNumber String
> > > +  6,    // Family String
> > > +};
> > > +CHAR8  *mSysInfoType1Strings[] = {
> > > +  "SolidRun",
> > > +  "HummingBoard-Edge i4Pro",
> > > +  "2.0",
> > > +  "System Serial#",
> > > +  "hb04w-e-110-00-004-0",
> > 
> > Do we have any way of obtaining the three above programmatically?
> > 
> 
> This is the default template for Sysinfo, which gets overwritten at
> runtime.  Given that we are overwriting this table at runtime, I'm
> thinking it would be better to just generate the table runtime and
> avoid confusion by having this template.

Agreed.

> > > +VOID
> > > +BIOSInfoUpdateSmbiosType0 (
> > > +  VOID
> > > +  )
> > > +{
> > > +  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0,
> > > +mBIOSInfoType0Strings, NULL); }
> > > +
> > > +VOID
> > > +I64ToHexString(
> > 
> > Hmm. We already have several copies of functions doing exactly this in EDK2.
> > Just no centrally reusable one. Maybe worth adding to BaseLib?
> > 
> > Regardless, it should probablt be called UINT64ToHexString or suchlike.
> > 
> 
> I'll rename it to UINT64ToHexString for the next patch set, then
> will look into making a centrally reusable version.

Thanks!

> > > +   BoardSerial = ((UINT64)(MmioRead32(RegOCOTP_CFG1Addr))) << 32;
> > > +   BoardSerial = BoardSerial |
> > > + ((UINT64)(MmioRead32(RegOCOTP_CFG0Addr)));
> > 
> > MmioRead32 (
> > A bit heavy on the parantheses.
> > 
> 
> Will fix.

For clarity: I'm all for using more parantheses than necessary where
it means avoiding needing to stop and think about operator precedence.
Ard isn't :)

But here they just don't add anything other than clutter.

Regards,

Leif


  reply	other threads:[~2018-08-09 10:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-22  1:30 [PATCH edk2-platforms 0/4] Import Solidrun Hummingboard Edge package Chris Co
2018-07-22  1:30 ` [PATCH edk2-platforms 1/4] Platform/Solidrun: Add Hummingboard SmBios Chris Co
2018-08-07 12:49   ` Leif Lindholm
2018-08-09  5:42     ` Chris Co
2018-08-09 10:11       ` Leif Lindholm [this message]
2018-07-22  1:30 ` [PATCH edk2-platforms 2/4] Platform/Solidrun: Add Hummingboard Peripheral Initialization Chris Co
2018-07-22  1:30 ` [PATCH edk2-platforms 3/4] Platform/SolidRun: Add Hummingboard ACPI tables Chris Co
2018-07-22  1:30 ` [PATCH edk2-platforms 4/4] Platform/Solidrun: Add Hummingboard dsc and fdf files Chris Co

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-list 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=20180809101149.jvcosdya5dg6larx@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /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