mbox series

[edk2,v2,0/5] ArmPlatformPkg, ArmVirtPkg: discover NOR flash banks from DTB

Message ID 20181121115828.3026-1-ard.biesheuvel@linaro.org
Headers show
Series ArmPlatformPkg, ArmVirtPkg: discover NOR flash banks from DTB | expand

Message

Ard Biesheuvel Nov. 21, 2018, 11:58 a.m. UTC
This series fixes an issue reported by Hongbo and Philippe, where
ArmVirtQemuKernel will crash on an attempt to access flash bank #0,
which is secure-only when running QEMU with support for EL3.

So let's switch to discovering the NOR flash banks from the device tree
instead. This requires some preparatory changes in the NOR flash driver
to avoid having to invent GUIDs on the fly.

Changes since v1:
- split ArmPlatformPkg for clarity
- move DT node status check into FdtClientDxe where it belongs
- use correct UINT32* type for DT property values, and be pedantic about
  their potential misalignment when casting to UINT64*
- add patch to remove the 'Guid' member from NOR_FLASH_DESCRIPTION
- add some acks

Ard Biesheuvel (5):
  ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change
  ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash
    banks
  ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account
  ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically
  ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from
    struct

 .../Drivers/NorFlashDxe/NorFlashDxe.c         | 15 ++--
 .../Drivers/NorFlashDxe/NorFlashDxe.h         |  3 +
 .../Include/Library/NorFlashPlatformLib.h     |  1 -
 ArmVirtPkg/FdtClientDxe/FdtClientDxe.c        | 38 +++++++--
 .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 78 ++++++++++++++-----
 .../NorFlashQemuLib/NorFlashQemuLib.inf       | 12 +++
 6 files changed, 114 insertions(+), 33 deletions(-)

-- 
2.17.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Ard Biesheuvel Nov. 26, 2018, 5 p.m. UTC | #1
On Wed, 21 Nov 2018 at 12:58, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>

> This series fixes an issue reported by Hongbo and Philippe, where

> ArmVirtQemuKernel will crash on an attempt to access flash bank #0,

> which is secure-only when running QEMU with support for EL3.

>

> So let's switch to discovering the NOR flash banks from the device tree

> instead. This requires some preparatory changes in the NOR flash driver

> to avoid having to invent GUIDs on the fly.

>

> Changes since v1:

> - split ArmPlatformPkg for clarity

> - move DT node status check into FdtClientDxe where it belongs

> - use correct UINT32* type for DT property values, and be pedantic about

>   their potential misalignment when casting to UINT64*

> - add patch to remove the 'Guid' member from NOR_FLASH_DESCRIPTION

> - add some acks

>

> Ard Biesheuvel (5):

>   ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change

>   ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash

>     banks

>   ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account

>   ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically

>   ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from

>     struct

>

>  .../Drivers/NorFlashDxe/NorFlashDxe.c         | 15 ++--

>  .../Drivers/NorFlashDxe/NorFlashDxe.h         |  3 +

>  .../Include/Library/NorFlashPlatformLib.h     |  1 -

>  ArmVirtPkg/FdtClientDxe/FdtClientDxe.c        | 38 +++++++--

>  .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 78 ++++++++++++++-----

>  .../NorFlashQemuLib/NorFlashQemuLib.inf       | 12 +++

>  6 files changed, 114 insertions(+), 33 deletions(-)

>


Pushed as 1ec194b21c0e..72e514c90730

Thanks all
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Nov. 26, 2018, 5:02 p.m. UTC | #2
On Mon, 26 Nov 2018 at 18:00, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>

> On Wed, 21 Nov 2018 at 12:58, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> >

> > This series fixes an issue reported by Hongbo and Philippe, where

> > ArmVirtQemuKernel will crash on an attempt to access flash bank #0,

> > which is secure-only when running QEMU with support for EL3.

> >

> > So let's switch to discovering the NOR flash banks from the device tree

> > instead. This requires some preparatory changes in the NOR flash driver

> > to avoid having to invent GUIDs on the fly.

> >

> > Changes since v1:

> > - split ArmPlatformPkg for clarity

> > - move DT node status check into FdtClientDxe where it belongs

> > - use correct UINT32* type for DT property values, and be pedantic about

> >   their potential misalignment when casting to UINT64*

> > - add patch to remove the 'Guid' member from NOR_FLASH_DESCRIPTION

> > - add some acks

> >

> > Ard Biesheuvel (5):

> >   ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change

> >   ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash

> >     banks

> >   ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account

> >   ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically

> >   ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from

> >     struct

> >

> >  .../Drivers/NorFlashDxe/NorFlashDxe.c         | 15 ++--

> >  .../Drivers/NorFlashDxe/NorFlashDxe.h         |  3 +

> >  .../Include/Library/NorFlashPlatformLib.h     |  1 -

> >  ArmVirtPkg/FdtClientDxe/FdtClientDxe.c        | 38 +++++++--

> >  .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 78 ++++++++++++++-----

> >  .../NorFlashQemuLib/NorFlashQemuLib.inf       | 12 +++

> >  6 files changed, 114 insertions(+), 33 deletions(-)

> >

>

> Pushed as 1ec194b21c0e..72e514c90730

>

> Thanks all


Forgot to add: minus the 5th patch, which I will push once the
dependent changes in edk2-platforms have been pushed.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Nov. 27, 2018, 12:07 p.m. UTC | #3
On Mon, 26 Nov 2018 at 18:02, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>

> On Mon, 26 Nov 2018 at 18:00, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> >

> > On Wed, 21 Nov 2018 at 12:58, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> > >

> > > This series fixes an issue reported by Hongbo and Philippe, where

> > > ArmVirtQemuKernel will crash on an attempt to access flash bank #0,

> > > which is secure-only when running QEMU with support for EL3.

> > >

> > > So let's switch to discovering the NOR flash banks from the device tree

> > > instead. This requires some preparatory changes in the NOR flash driver

> > > to avoid having to invent GUIDs on the fly.

> > >

> > > Changes since v1:

> > > - split ArmPlatformPkg for clarity

> > > - move DT node status check into FdtClientDxe where it belongs

> > > - use correct UINT32* type for DT property values, and be pedantic about

> > >   their potential misalignment when casting to UINT64*

> > > - add patch to remove the 'Guid' member from NOR_FLASH_DESCRIPTION

> > > - add some acks

> > >

> > > Ard Biesheuvel (5):

> > >   ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change

> > >   ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash

> > >     banks

> > >   ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account

> > >   ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically

> > >   ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from

> > >     struct

> > >

> > >  .../Drivers/NorFlashDxe/NorFlashDxe.c         | 15 ++--

> > >  .../Drivers/NorFlashDxe/NorFlashDxe.h         |  3 +

> > >  .../Include/Library/NorFlashPlatformLib.h     |  1 -

> > >  ArmVirtPkg/FdtClientDxe/FdtClientDxe.c        | 38 +++++++--

> > >  .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 78 ++++++++++++++-----

> > >  .../NorFlashQemuLib/NorFlashQemuLib.inf       | 12 +++

> > >  6 files changed, 114 insertions(+), 33 deletions(-)

> > >

> >

> > Pushed as 1ec194b21c0e..72e514c90730

> >

> > Thanks all

>

> Forgot to add: minus the 5th patch, which I will push once the

> dependent changes in edk2-platforms have been pushed.


#5 now pushed as 13d5d0a56e486be39f95c5e0883e64698ed02714
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel