public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Daniel Thompson" <daniel.thompson@linaro.org>,
	"Masami Hiramatsu" <masami.hiramatsu@linaro.org>,
	"Pipat/メタワニットポン ピパット" <methavanitpong.pipat@socionext.com>
Subject: Re: [PATCH edk2-platforms v2 13/23] Silicon/Socionext: add driver for SPI NOR flash
Date: Sat, 28 Oct 2017 22:31:00 +0100	[thread overview]
Message-ID: <20171028213100.ctexodlfehapsbt2@bivouac.eciton.net> (raw)
In-Reply-To: <CAKv+Gu9H5TUa8MRTUOfEsitoybSkOa6wZk4koWCmX0wyz+FxSw@mail.gmail.com>

On Sat, Oct 28, 2017 at 03:16:50PM +0100, Ard Biesheuvel wrote:
> On 26 October 2017 at 22:19, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > On Wed, Oct 25, 2017 at 06:59:37PM +0100, Ard Biesheuvel wrote:
> >> From: Pipat Methavanitpong <methavanitpong.pipat@socionext.com>
> >>
> >> This imports the driver sources provided by Socionext for the FIP006
> >> SPI NOR flash device found on SynQuacer SoCs. It has been slightly
> >> tweaked to bring it up to date with the changes made on the EDK2 side
> >> since it was forked.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Pipat Methavanitpong <methavanitpong.pipat@socionext.com>
> >>
> >> [various tweaks and bugfixes]
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >
> > Do we need Contributed-under twice?
> > I'm not sure that carries any legal significane anyway.
> >
> > Sorry, I would love to trim the below, but there are minor comments
> > spread throughout.
> >
> >> ---
> >>  Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Dxe.dec        |   31 +
> >>  Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Dxe.inf        |   79 ++
> >>  Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Reg.h          |  244 ++++
> >>  Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashBlockIoDxe.c |  138 ++
> >>  Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c        | 1376 ++++++++++++++++++++
> >>  Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h        |  314 +++++
> >>  Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashFvbDxe.c     |  859 ++++++++++++
> >>  7 files changed, 3041 insertions(+)
> >>

> >> diff --git a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c
> >> new file mode 100644
> >> index 000000000000..d9cf11dd5be5
> >> --- /dev/null
> >> +++ b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c
> >> @@ -0,0 +1,1376 @@
> >> +/** @file  NorFlashDxe.c
> >> +
> >> +  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
> >> +  Copyright (c) 2017, Socionext Inc. All rights reserved.<BR>
> >> +  Copyright (c) 2017, Linaro, Ltd. All rights reserved.<BR>
> >> +
> >> +  This program and the accompanying materials are licensed and made available
> >> +  under the terms and conditions of the BSD License which accompanies this
> >> +  distribution.  The full text of the license may be found at
> >> +  http://opensource.org/licenses/bsd-license.php
> >> +
> >> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> >> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> >> +
> >> +**/
> >> +
> >> +#include <Library/UefiLib.h>
> >> +#include <Library/BaseMemoryLib.h>
> >> +#include <Library/MemoryAllocationLib.h>
> >> +#include <Library/UefiBootServicesTableLib.h>
> >> +#include <Library/PcdLib.h>
> >
> > Move up one row?
> >
> >> +
> >> +#include "NorFlashDxe.h"
> >> +
> >> +STATIC EFI_EVENT mNorFlashVirtualAddrChangeEvent;
> >> +
> >> +//
> >> +// Global variable declarations
> >> +//
> >> +STATIC NOR_FLASH_INSTANCE   **mNorFlashInstances;
> >> +STATIC UINT32               mNorFlashDeviceCount;
> >> +
> >> +STATIC CONST UINT16 mFip006NullCmdSeq[] = {
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1),
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1),
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1),
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1),
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1),
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1),
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1),
> >> +  CSDC (0x07, 0, CSDC_TRP_MBM, 1)
> >
> > Can we get some helpful #defines for these live-coded values please?
> 
> I can fix up the other cosmetic values, but unfortunately, only
> Socionext can address the comments regarding the use of symbolic
> constants, because I don't have a clue what they mean.

Right. That's sort of the problem.
That basically reduces code review to looking for canaries.

> Pipat?
> 
> I will note that some of the comments below apply to
> ArmPlatformPkg/Drivers/NorFlashDxe equally.

Fair enough.
Will need to revisit that one at some point then.

/
    Leif


  reply	other threads:[~2017-10-28 21:27 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25 17:59 [PATCH edk2-platforms v2 00/23] add support for Socionext Synquacer Ard Biesheuvel
2017-10-25 17:59 ` [PATCH edk2-platforms v2 01/23] Silicon/SynQuacer: add package with platform headers Ard Biesheuvel
2017-10-26 14:39   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 02/23] Silicon/Socionext: add driver for NETSEC network controller Ard Biesheuvel
2017-10-26 14:49   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 03/23] Silicon/SynQuacer: add MemoryInitPeiLib implementation Ard Biesheuvel
2017-10-26 14:56   ` Leif Lindholm
2017-10-26 14:57     ` Ard Biesheuvel
2017-10-26 15:05       ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 04/23] Platform: add support for Socionext SynQuacer eval board Ard Biesheuvel
2017-10-26 15:02   ` Leif Lindholm
2017-10-26 15:14     ` Ard Biesheuvel
2017-10-25 17:59 ` [PATCH edk2-platforms v2 05/23] Silicon/SynQuacer: implement PciSegmentLib to support dual RCs Ard Biesheuvel
2017-10-26 15:06   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 06/23] Silicon/SynQuacer: implement PciHostBridgeLib support Ard Biesheuvel
2017-10-26 15:10   ` Leif Lindholm
2017-10-26 15:12     ` Ard Biesheuvel
2017-10-25 17:59 ` [PATCH edk2-platforms v2 07/23] Silicon/SynQuacer: implement EFI_CPU_IO2_PROTOCOL Ard Biesheuvel
2017-10-26 15:13   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 08/23] Platform/SynQuacerEvalBoard: add PCI support Ard Biesheuvel
2017-10-26 15:38   ` Leif Lindholm
2017-10-26 15:41     ` Ard Biesheuvel
2017-10-26 21:49       ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 09/23] Platform/SynQuacerEvalBoard: add NETSEC driver Ard Biesheuvel
2017-10-26 15:39   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 10/23] Silicon/SynQuacer: add ACPI support Ard Biesheuvel
2017-10-26 17:13   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 11/23] Silicon/SynQuacer: add device tree support for eval board Ard Biesheuvel
2017-10-26 17:15   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 12/23] Silicon/SynQuacer: add NorFlashPlatformLib implementation Ard Biesheuvel
2017-10-25 17:59 ` [PATCH edk2-platforms v2 13/23] Silicon/Socionext: add driver for SPI NOR flash Ard Biesheuvel
2017-10-26 21:19   ` Leif Lindholm
2017-10-28 14:16     ` Ard Biesheuvel
2017-10-28 21:31       ` Leif Lindholm [this message]
2017-10-25 17:59 ` [PATCH edk2-platforms v2 14/23] Platform/SynQuacer: incorporate NOR flash and variable drivers Ard Biesheuvel
2017-10-25 17:59 ` [PATCH edk2-platforms v2 15/23] Silicon/SynQuacer: implement PlatformFlashAccessLib Ard Biesheuvel
2017-10-26 21:22   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 16/23] SynQuacer/SynQuacerMemoryInitPeiLib: add capsule support Ard Biesheuvel
2017-10-26 21:27   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 17/23] Socionext/SynQuacerEvalBoard: wire up basic " Ard Biesheuvel
2017-10-26 21:28   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 18/23] Socionext/SynQuacerEvalBoard: switch to execute in place Ard Biesheuvel
2017-10-26 21:30   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 19/23] Platform/SynQuacerEvalBoard: add signed capsule update support Ard Biesheuvel
2017-10-26 21:33   ` Leif Lindholm
2017-10-28 13:48     ` Ard Biesheuvel
2017-10-25 17:59 ` [PATCH edk2-platforms v2 20/23] Silicon/SynQuacer/AcpiTables: hide PCI domain #0 Ard Biesheuvel
2017-10-26 21:34   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 21/23] Silicon/SynQuacerPciHostBridgeLib: add workaround to support 32-bit only cards Ard Biesheuvel
2017-10-26 21:35   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 22/23] Platform/Socionext: add support for Socionext Developer Box rev 0.1 Ard Biesheuvel
2017-10-26 21:46   ` Leif Lindholm
2017-10-25 17:59 ` [PATCH edk2-platforms v2 23/23] Platform/DeveloperBox: add ConsolePrefDxe driver Ard Biesheuvel
2017-10-26 21:46   ` Leif Lindholm

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=20171028213100.ctexodlfehapsbt2@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