Re: [edk2] [PATCH v2 edk2-platforms 6/8] SgiClark.Ares: AcpiTables: Add entry for virtio network device

2019-02-26 Thread Vijayenthiran Subramaniam
Hi Ard,

This patch is part of the patch series "Platform/ARM/Sgi: Add support for
virtio network device". While other seven patches are merged upstream, this
patch is not yet merged. Please let me know if you have any comments on
this patch.

On Fri, Dec 14, 2018 at 11:28 PM Vijayenthiran Subramaniam <
vijayenthiran.subraman...@arm.com> wrote:

> SgiClark Ares include an instance of the virtio network device. Add
> a representation for it in the ACPI tables.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Vijayenthiran Subramaniam <
> vijayenthiran.subraman...@arm.com>
> ---
>  Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf |  3 +++
>  Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl  | 17
> +
>  2 files changed, 20 insertions(+)
>
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
> b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
> index 10a805e07fd1..d4bacdbc8c85 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
> +++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
> @@ -58,5 +58,8 @@ [FixedPcd]
>gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
>gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
>gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
> +  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
> +  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
> +  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
>
>gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
> diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
> b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
> index af4dc424a77c..69dc33c06b4d 100644
> --- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
> +++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
> @@ -118,5 +118,22 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1,
> "ARMLTD", "ARMSGI",
>  }
>})
>  }
> +
> +// VIRTIO NET
> +Device (VR01) {
> +  Name (_HID, "LNRO0005")
> +  Name (_UID, 1)
> +  Name (_CCA, 1)// mark the device coherent
> +
> +  Name (_CRS, ResourceTemplate() {
> +Memory32Fixed (ReadWrite,
> +  FixedPcdGet32 (PcdVirtioNetBaseAddress),
> +  FixedPcdGet32 (PcdVirtioNetSize)
> +)
> +Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
> +  FixedPcdGet32 (PcdVirtioNetInterrupt)
> +}
> +  })
> +}
>} // Scope(_SB)
>  }
> --
> 2.7.4
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 edk2-platforms 0/8] Platform/ARM/Sgi: Add support for virtio network device

2018-12-19 Thread Vijayenthiran Subramaniam
On Wed, Dec 19, 2018 at 4:08 PM Ard Biesheuvel
 wrote:
>
> On Fri, 14 Dec 2018 at 17:59, Vijayenthiran Subramaniam
>  wrote:
> >
> > Changes since v1:
> > - Rebased the series against latest edk2-platforms
> >
> > This patch series adds support for virtio network controller found in ARM 
> > SGI
> > plaform's fast models. The first patch in this series restructure the
> > virtio device registration code to allow registration of additional virtio
> > devices. The second patch adds support for the virtio network device. The 
> > rest
> > of the patches update the ACPI tables to add an entry for the virtio network
> > device and corresponding PCDs for virtio block and network device.
> >
> > Daniil Egranov (4):
> >   Platform/ARM/SgiPkg: Restructure virtio device registration
> >   Platform/ARM/SgiPkg: Add support for virtio net device
> >   Sgi575: AcpiTables: Use PCDs for virtio disk
> >   Sgi575: AcpiTables: Add entry for virtio network device
> >
> > Vijayenthiran Subramaniam (4):
> >   SgiClark.Ares: AcpiTables: Use PCDs for virtio disk
> >   SgiClark.Ares: AcpiTables: Add entry for virtio network device
> >   SgiClark.Helios: AcpiTables: Use PCDs for virtio disk
> >   SgiClark.Helios: AcpiTables: Add entry for virtio network device
> >
>
> Reviewed-by: Ard Biesheuvel 
>
> Pushed as c718cc037860..54a0e7ae1289
>
> Thanks!

Thank you Ard.

Regards,
Vijayenthiran
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 edk2-platforms 8/8] SgiClark.Helios: AcpiTables: Add entry for virtio network device

2018-12-14 Thread Vijayenthiran Subramaniam
SgiClark Helios include an instance of the virtio network device. Add
a representation for it in the ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf |  3 +++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl  | 18 
++
 2 files changed, 21 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
index 3686e91bb7e7..8b45702b7cd3 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
@@ -58,5 +58,8 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
index 3dcf6f71eadb..7cfc419eb3a2 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
@@ -264,5 +264,23 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
 }
   })
 }
+
+// VIRTIO NET
+Device (VR01) {
+  Name (_HID, "LNRO0005")
+  Name (_UID, 1)
+  Name (_CCA, 1)// mark the device coherent
+
+  Name (_CRS, ResourceTemplate() {
+Memory32Fixed (
+  ReadWrite,
+  FixedPcdGet32 (PcdVirtioNetBaseAddress),
+  FixedPcdGet32 (PcdVirtioNetSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioNetInterrupt)
+}
+  })
+}
   } // Scope(_SB)
 }
-- 
2.7.4

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


[edk2] [PATCH v2 edk2-platforms 7/8] SgiClark.Helios: AcpiTables: Use PCDs for virtio disk

2018-12-14 Thread Vijayenthiran Subramaniam
Use PCDs instead of hardcoded values for virtio disk in DSDT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf |  4 
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl  | 10 --
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
index 0ecce2db8a5d..3686e91bb7e7 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
@@ -55,4 +55,8 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
index b8eb3b8e7332..3dcf6f71eadb 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
@@ -254,8 +254,14 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
   Name (_CCA, 1)// mark the device coherent
 
   Name (_CRS, ResourceTemplate() {
-Memory32Fixed (ReadWrite, 0x1c13, 0x1)
-Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 202 }
+Memory32Fixed (
+  ReadWrite,
+  FixedPcdGet32 (PcdVirtioBlkBaseAddress),
+  FixedPcdGet32 (PcdVirtioBlkSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioBlkInterrupt)
+}
   })
 }
   } // Scope(_SB)
-- 
2.7.4

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


[edk2] [PATCH v2 edk2-platforms 6/8] SgiClark.Ares: AcpiTables: Add entry for virtio network device

2018-12-14 Thread Vijayenthiran Subramaniam
SgiClark Ares include an instance of the virtio network device. Add
a representation for it in the ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf |  3 +++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl  | 17 
+
 2 files changed, 20 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
index 10a805e07fd1..d4bacdbc8c85 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
@@ -58,5 +58,8 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
index af4dc424a77c..69dc33c06b4d 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
@@ -118,5 +118,22 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
 }
   })
 }
+
+// VIRTIO NET
+Device (VR01) {
+  Name (_HID, "LNRO0005")
+  Name (_UID, 1)
+  Name (_CCA, 1)// mark the device coherent
+
+  Name (_CRS, ResourceTemplate() {
+Memory32Fixed (ReadWrite,
+  FixedPcdGet32 (PcdVirtioNetBaseAddress),
+  FixedPcdGet32 (PcdVirtioNetSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioNetInterrupt)
+}
+  })
+}
   } // Scope(_SB)
 }
-- 
2.7.4

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


[edk2] [PATCH v2 edk2-platforms 5/8] SgiClark.Ares: AcpiTables: Use PCDs for virtio disk

2018-12-14 Thread Vijayenthiran Subramaniam
Use PCDs instead of hardcoded values for virtio disk in DSDT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf |  4 
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl  | 12 +---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
index dcfe4929bb5a..10a805e07fd1 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
@@ -55,4 +55,8 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
index c94a7c69e33a..af4dc424a77c 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
@@ -107,9 +107,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
   Name (_UID, 0)
   Name (_CCA, 1)// mark the device coherent
 
-  Name (_CRS, ResourceTemplate () {
-Memory32Fixed (ReadWrite, 0x1c13, 0x1)
-Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 202 }
+  Name (_CRS, ResourceTemplate() {
+Memory32Fixed (
+  ReadWrite,
+  FixedPcdGet32 (PcdVirtioBlkBaseAddress),
+  FixedPcdGet32 (PcdVirtioBlkSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioBlkInterrupt)
+}
   })
 }
   } // Scope(_SB)
-- 
2.7.4

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


[edk2] [PATCH v2 edk2-platforms 4/8] Sgi575: AcpiTables: Add entry for virtio network device

2018-12-14 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

SGI575 include an instance of the virtio network device. So add
a representation for it in the ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf |  3 +++
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl  | 18 ++
 2 files changed, 21 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index e236b940a802..c666ea9d51c7 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -58,5 +58,8 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
index 833f5b44b6a8..36bc8c3809a0 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
@@ -114,4 +114,22 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI", EFI_ACPI_ARM_OEM
   }
 })
   }
+
+  // VIRTIO NET
+  Device (VR01) {
+Name (_HID, "LNRO0005")
+Name (_UID, 1)
+Name (_CCA, 1)// mark the device coherent
+
+Name (_CRS, ResourceTemplate() {
+  Memory32Fixed (
+ReadWrite,
+FixedPcdGet32 (PcdVirtioNetBaseAddress),
+FixedPcdGet32 (PcdVirtioNetSize)
+  )
+  Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+FixedPcdGet32 (PcdVirtioNetInterrupt)
+  }
+})
+  }
 }
-- 
2.7.4

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


[edk2] [PATCH v2 edk2-platforms 3/8] Sgi575: AcpiTables: Use PCDs for virtio disk

2018-12-14 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

Use PCDs instead of hardcoded values for virtio disk in DSDT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf |  4 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl  | 10 --
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index 59ccb79b6475..e236b940a802 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -55,4 +55,8 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
index 509cd7cd4262..833f5b44b6a8 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
@@ -104,8 +104,14 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI", EFI_ACPI_ARM_OEM
 Name (_CCA, 1)// mark the device coherent
 
 Name (_CRS, ResourceTemplate() {
-  Memory32Fixed (ReadWrite, 0x1c13, 0x1)
-  Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 202 }
+  Memory32Fixed (
+ReadWrite,
+FixedPcdGet32 (PcdVirtioBlkBaseAddress),
+FixedPcdGet32 (PcdVirtioBlkSize)
+  )
+  Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+FixedPcdGet32 (PcdVirtioBlkInterrupt)
+  }
 })
   }
 }
-- 
2.7.4

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


[edk2] [PATCH v2 edk2-platforms 2/8] Platform/ARM/SgiPkg: Add support for virtio net device

2018-12-14 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

Add support for virtio net device by adding PCDs to specify the data
required to setup the virtio net device and register it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec|  6 +++
 Platform/ARM/SgiPkg/SgiPlatform.dsc| 18 +--
 Platform/ARM/SgiPkg/SgiPlatform.fdf|  4 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf|  3 ++
 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h |  3 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c| 54 

 6 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 9300337a8d68..10157c7b6eb3 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -38,6 +38,7 @@ [Guids.common]
 
 [PcdsFeatureFlag.common]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSupported|FALSE|BOOLEAN|0x0010
 
 [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
@@ -48,5 +49,10 @@ [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x|UINT32|0x0005
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|0x|UINT32|0x0006
 
+  # Virtio Network device
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress|0x|UINT32|0x0007
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x|UINT32|0x0008
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|0x|UINT32|0x0009
+
 [Ppis]
   gNtFwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 
0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index ffebddc19eff..7995c7d132d6 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -47,6 +47,7 @@ [LibraryClasses.common]
   VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
   
VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+  
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
 
 [LibraryClasses.common.SEC]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -101,6 +102,7 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 
 [PcdsFeatureFlag.common]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|TRUE
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSupported|TRUE
 
 [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdVFPEnabled|1
@@ -182,14 +184,19 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PcdCoreCount|4
   gArmPlatformTokenSpaceGuid.PcdClusterCount|2
 
-  # Ethernet
-  gEmbeddedTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1800
-
   # Virtio Disk
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x1c13
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x1
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|202
 
+  # Ethernet / Virtio Network
+!ifdef EDK2_ENABLE_SMSC_91X
+  gEmbeddedTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1800
+!endif
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress|0x1c15
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x1
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|204
+
 

 #
 # Components Section - list of all EDK II Modules needed by this Platform
@@ -294,8 +301,11 @@ [Components.common]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
   }
 
-  # SMSC LAN 91C111
+  # SMSC LAN 91C111 / Virtio Network
+!ifdef EDK2_ENABLE_SMSC_91X
   EmbeddedPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
+!endif
+  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
   #
   # Required by PCI
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index 9c0ec1fa43a6..80c3412fd4ad 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -197,7 +197,11 @@ [FV.FvMain]
   INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
   INF NetworkPkg/TcpDxe/TcpDxe.inf
   INF NetworkPkg/IScsiDxe/IScsiDxe.inf
+
+!ifdef EDK2_ENABLE_SMSC_91X
   INF EmbeddedPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
+!endif
+  INF OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
 [FV.FVMAIN_COMPACT]
 FvAlignment= 16
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
index f920f6ecafb8..3283ff045372 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
@@ -42,10 +42,13 @@ [Guids]
 
 [FeaturePcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSupported
 
 [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   

[edk2] [PATCH v2 edk2-platforms 1/8] Platform/ARM/SgiPkg: Restructure virtio device registration

2018-12-14 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

SGI platforms support multiple virtio devices. So the existing code, that
supports registration of only the virtio disk, is restructured to
accommodate the registration of additional virtio devices.

In addition to this, PCDs to represent the virtio controller base and
address space size are introduced.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec  | 
 8 ++-
 Platform/ARM/SgiPkg/SgiPlatform.dsc  | 
 7 +-
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf  | 
 8 ++-
 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h   | 
21 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c| 
14 +---
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => VirtioDevices.c} | 
67 
 6 files changed, 81 insertions(+), 44 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 916605298d9f..9300337a8d68 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -37,12 +37,16 @@ [Guids.common]
   gSgiClarkHeliosAcpiTablesFileGuid = { 0x2af40815, 0xa84e, 0x4de9, { 0x8c, 
0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } }
 
 [PcdsFeatureFlag.common]
-  # Set this PCD to TRUE to enable virtio support.
-  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE|BOOLEAN|0x0001
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
 
 [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
   gArmSgiTokenSpaceGuid.PcdDramBlock2Size|0|UINT64|0x0003
 
+  # Virtio Block device
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x|UINT32|0x0004
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x|UINT32|0x0005
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|0x|UINT32|0x0006
+
 [Ppis]
   gNtFwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 
0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 19d2ac3a656a..ffebddc19eff 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -100,7 +100,7 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 

 
 [PcdsFeatureFlag.common]
-  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|TRUE
 
 [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdVFPEnabled|1
@@ -185,6 +185,11 @@ [PcdsFixedAtBuild.common]
   # Ethernet
   gEmbeddedTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1800
 
+  # Virtio Disk
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x1c13
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x1
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|202
+
 

 #
 # Components Section - list of all EDK II Modules needed by this Platform
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
index d903ed8d3375..f920f6ecafb8 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
@@ -20,7 +20,7 @@ [Defines]
 
 [Sources.common]
   PlatformDxe.c
-  VirtioBlockIo.c
+  VirtioDevices.c
 
 [Packages]
   EmbeddedPkg/EmbeddedPkg.dec
@@ -41,7 +41,11 @@ [Guids]
   gSgiClarkHeliosAcpiTablesFileGuid
 
 [FeaturePcd]
-  gArmSgiTokenSpaceGuid.PcdVirtioSupported
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported
+
+[FixedPcd]
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
 
 [Depex]
   TRUE
diff --git a/Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h 
b/Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
new file mode 100644
index ..80d3e3ae4f91
--- /dev/null
+++ b/Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
@@ -0,0 +1,21 @@
+/** @file
+*
+*  Copyright (c) 2018, ARM Limited. All rights reserved.
+*
+*  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.
+*
+**/
+
+#ifndef  __SGI_VIRTIO_DEVICES_FORMSET_H__
+#define  __SGI_VIRTIO_DEVICES_FORMSET_H__
+
+#define SGI_VIRTIO_BLOCK_GUID  \
+  { 0x5a96cdcd, 0x6116, 0x4929, { 0xb7, 0x01, 0x3a, 0xc2, 0xfb, 0x1c, 0xe2, 
0x28 } }
+
+#endif
diff --git 

[edk2] [PATCH v2 edk2-platforms 0/8] Platform/ARM/Sgi: Add support for virtio network device

2018-12-14 Thread Vijayenthiran Subramaniam
Changes since v1:
- Rebased the series against latest edk2-platforms

This patch series adds support for virtio network controller found in ARM SGI
plaform's fast models. The first patch in this series restructure the
virtio device registration code to allow registration of additional virtio
devices. The second patch adds support for the virtio network device. The rest
of the patches update the ACPI tables to add an entry for the virtio network
device and corresponding PCDs for virtio block and network device.

Daniil Egranov (4):
  Platform/ARM/SgiPkg: Restructure virtio device registration
  Platform/ARM/SgiPkg: Add support for virtio net device
  Sgi575: AcpiTables: Use PCDs for virtio disk
  Sgi575: AcpiTables: Add entry for virtio network device

Vijayenthiran Subramaniam (4):
  SgiClark.Ares: AcpiTables: Use PCDs for virtio disk
  SgiClark.Ares: AcpiTables: Add entry for virtio network device
  SgiClark.Helios: AcpiTables: Use PCDs for virtio disk
  SgiClark.Helios: AcpiTables: Add entry for virtio network device

 Platform/ARM/SgiPkg/SgiPlatform.dec  | 
 14 ++-
 Platform/ARM/SgiPkg/SgiPlatform.dsc  | 
 21 +++-
 Platform/ARM/SgiPkg/SgiPlatform.fdf  | 
  4 +
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf  | 
  7 ++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf| 
  7 ++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf  | 
  7 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf  | 
 11 +-
 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h   | 
 24 
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c| 
 14 +--
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => VirtioDevices.c} | 
117 +++-
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl   | 
 28 -
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl | 
 29 -
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl   | 
 28 -
 13 files changed, 260 insertions(+), 51 deletions(-)
 create mode 100644 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
 rename Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => 
VirtioDevices.c} (25%)

-- 
2.7.4

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


Re: [edk2] [PATCH v1 edk2-platforms 1/8] Platform/ARM/SgiPkg: Restructure virtio device registration

2018-12-14 Thread Vijayenthiran Subramaniam
On Fri, Dec 14, 2018 at 8:26 PM Ard Biesheuvel
 wrote:
>
> On Tue, 11 Dec 2018 at 10:08, Vijayenthiran Subramaniam
>  wrote:
> >
> > On Fri, Dec 7, 2018 at 5:49 AM Vijayenthiran Subramaniam
> >  wrote:
> > >
> > > On Thu, Dec 6, 2018 at 5:18 PM Ard Biesheuvel  
> > > wrote:
> > > >
> > > > On Wed, 5 Dec 2018 at 07:10, Vijayenthiran Subramaniam
> > > >  wrote:
> > > > >
> > > > > Hi Ard,
> > > > >
> > > > > The virtio block device and virtio network device are available in 
> > > > > software model only. As of now, it exposes only one instance of each 
> > > > > device.
> > > > >
> > > >
> > > > Are the virtio devices described by the device tree obtained from the
> > > > secure firmware?
> > >
> > > No. The device tree from secure firmware does not carry any devices
> > > information other than platform/config id.
> > >
> >
> > Please let me know if there are any further comments on this patch
> > series. Otherwise, requesting to review the series and merge.
> >
>
> Please rebase the series against latest edk2-platforms, and I will do
> the final review (and merge)

Sure. Will post the series as v2 after rebasing.

Thanks,
Vijayenthiran.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 edk2-platforms 1/8] Platform/ARM/SgiPkg: Restructure virtio device registration

2018-12-11 Thread Vijayenthiran Subramaniam
On Fri, Dec 7, 2018 at 5:49 AM Vijayenthiran Subramaniam
 wrote:
>
> On Thu, Dec 6, 2018 at 5:18 PM Ard Biesheuvel  
> wrote:
> >
> > On Wed, 5 Dec 2018 at 07:10, Vijayenthiran Subramaniam
> >  wrote:
> > >
> > > Hi Ard,
> > >
> > > The virtio block device and virtio network device are available in 
> > > software model only. As of now, it exposes only one instance of each 
> > > device.
> > >
> >
> > Are the virtio devices described by the device tree obtained from the
> > secure firmware?
>
> No. The device tree from secure firmware does not carry any devices
> information other than platform/config id.
>

Please let me know if there are any further comments on this patch
series. Otherwise, requesting to review the series and merge.

> >
> > > On Tue, Dec 4, 2018 at 8:16 PM Ard Biesheuvel  
> > > wrote:
> > >>
> > >> On Tue, 4 Dec 2018 at 10:12, Vijayenthiran Subramaniam
> > >>  wrote:
> > >> >
> > >> > From: Daniil Egranov 
> > >> >
> > >> > SGI platforms support multiple virtio devices. So the existing code, 
> > >> > that
> > >> > supports registration of only the virtio disk, is restructured to
> > >> > accommodate the registration of additional virtio devices.
> > >> >
> > >> > In addition to this, PCDs to represent the virtio controller base and
> > >> > address space size are introduced.
> > >> >
> > >> > Contributed-under: TianoCore Contribution Agreement 1.1
> > >> > Signed-off-by: Daniil Egranov 
> > >> > ---
> > >> >  Platform/ARM/SgiPkg/SgiPlatform.dec   
> > >> >|  8 ++-
> > >> >  Platform/ARM/SgiPkg/SgiPlatform.dsc   
> > >> >|  7 +-
> > >> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf   
> > >> >|  8 ++-
> > >> >  Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
> > >> >| 21 ++
> > >> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c 
> > >> >| 14 +---
> > >> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => 
> > >> > VirtioDevices.c} | 67 
> > >> >  6 files changed, 81 insertions(+), 44 deletions(-)
> > >> >
> > >>
> > >> Can these platforms only ever expose a single block device and a
> > >> single network device?
> > >>
> > >> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
> > >> > b/Platform/ARM/SgiPkg/SgiPlatform.dec
> > >> > index f6e0ba1e927a..ed29a4d5d91f 100644
> > >> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dec
> > >> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
> > >> > @@ -37,12 +37,16 @@ [Guids.common]
> > >> >gSgiClarkHeliosAcpiTablesFileGuid = { 0x2af40815, 0xa84e, 0x4de9, { 
> > >> > 0x8c, 0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } }
> > >> >
> > >> >  [PcdsFeatureFlag.common]
> > >> > -  # Set this PCD to TRUE to enable virtio support.
> > >> > -  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE|BOOLEAN|0x0001
> > >> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
> > >> >
> > >> >  [PcdsFixedAtBuild]
> > >> >gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
> > >> >gArmSgiTokenSpaceGuid.PcdDramBlock2Size|0|UINT64|0x0003
> > >> >
> > >> > +  # Virtio Block device
> > >> > +  
> > >> > gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x|UINT32|0x0004
> > >> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x|UINT32|0x0005
> > >> > +  
> > >> > gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|0x|UINT32|0x0006
> > >> > +
> > >> >  [Ppis]
> > >> >gHwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 
> > >> > 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
> > >> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> > >> > b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > >> > index b3f76d2d9720..ada72be72f8a 100644
> > >> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
>

[edk2] [PATCH v3 edk2-platforms] Platform/ARM/SgiPkg: Add support for HDLCD

2018-12-07 Thread Vijayenthiran Subramaniam
Add HDLCD platform library for SGI platform that implements platform
callbacks for the Arm HDLCD driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
Change from v2:
No code change. Posting patch again with Change-Id removed.

 Platform/ARM/SgiPkg/SgiPlatform.dsc   |   6 +
 Platform/ARM/SgiPkg/SgiPlatform.fdf   |   6 +
 Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf |  40 +++
 Platform/ARM/SgiPkg/Include/SgiPlatform.h |   4 +
 Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgi.c  | 257 

 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c  |   8 +-
 6 files changed, 320 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 0c794c6b299d..7995c7d132d6 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -37,6 +37,8 @@ [LibraryClasses.common]
   ArmPlatformLib|Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
   BasePathLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
   
EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
+  LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
+  LcdPlatformLib|Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
   NorFlashPlatformLib|Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
@@ -155,6 +157,9 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PL011UartInteger|4
   gArmPlatformTokenSpaceGuid.PL011UartFractional|0
 
+  ## PL370 - HDLCD1
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase|0x7FF6
+
   ## PL011 - Serial Debug UART
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x7FF8
   gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|7372800
@@ -235,6 +240,7 @@ [Components.common]
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
   ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
+  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
   EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index ddf1fda5a16e..80c3412fd4ad 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -133,6 +133,9 @@ [FV.FvMain]
   #
   # Multiple Console IO support
   #
+  INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
+  INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
+  INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
   INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 
@@ -144,6 +147,9 @@ [FV.FvMain]
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 
+  # Graphics Output Protocol
+  INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
+
   INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 
diff --git a/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf 
b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
new file mode 100644
index ..751f0d9288eb
--- /dev/null
+++ b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
@@ -0,0 +1,40 @@
+#
+#  Copyright (c) 2018, ARM Limited. All rights reserved.
+#
+#  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.
+#
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = HdLcdArmSgiLib
+  FILE_GUID  = 0C77342C-7895-4DE1-A9C8-1DBBFA71AF34
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = LcdPlatformLib
+
+[Sources.common]
+  HdLcdArmSgi.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec
+
+[LibraryClasses]
+  BaseLib
+
+[FixedPcd]
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase
+  gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferBase
+  gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferSize
+  gArmPlatformTokenSpaceGuid.PcdGopPixelFormat
+
+[depex]
+  gEfiCpuArchProtocolGuid
diff --git a/Platform/ARM/SgiPkg/Include/SgiPla

Re: [edk2] [PATCH] Platform/ARM/SgiPkg: Add support for HDLCD

2018-12-06 Thread Vijayenthiran Subramaniam
On Thu, Dec 6, 2018 at 5:08 PM Ard Biesheuvel  wrote:
>
> On Thu, 6 Dec 2018 at 13:43, Vijayenthiran Subramaniam
>  wrote:
> >
> > Add HDLCD platform library for SGI platform that implements platform
> > callbacks for the Arm HDLCD driver.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Vijayenthiran Subramaniam 
> > ---
> >  Platform/ARM/SgiPkg/SgiPlatform.dsc   |   6 +
> >  Platform/ARM/SgiPkg/SgiPlatform.fdf   |   6 +
> >  Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf |  37 +++
> >  Platform/ARM/SgiPkg/Include/SgiPlatform.h |   4 +
> >  Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgi.c  | 262 
> > 
> >  Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c  |   8 +-
> >  6 files changed, 322 insertions(+), 1 deletion(-)
> >
> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> > b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > index 0c794c6b299d..7995c7d132d6 100644
> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > @@ -37,6 +37,8 @@ [LibraryClasses.common]
> >ArmPlatformLib|Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
> >BasePathLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> >
> > EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
> > +  LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
> > +  
> > LcdPlatformLib|Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
> >
> > NorFlashPlatformLib|Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
> >HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> >TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
> > @@ -155,6 +157,9 @@ [PcdsFixedAtBuild.common]
> >gArmPlatformTokenSpaceGuid.PL011UartInteger|4
> >gArmPlatformTokenSpaceGuid.PL011UartFractional|0
> >
> > +  ## PL370 - HDLCD1
> > +  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase|0x7FF6
> > +
> >## PL011 - Serial Debug UART
> >gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x7FF8
> >gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|7372800
> > @@ -235,6 +240,7 @@ [Components.common]
> >ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
> >ArmPkg/Drivers/TimerDxe/TimerDxe.inf
> >ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
> > +  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
> >ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> >EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> >EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
> > b/Platform/ARM/SgiPkg/SgiPlatform.fdf
> > index ddf1fda5a16e..80c3412fd4ad 100644
> > --- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
> > @@ -133,6 +133,9 @@ [FV.FvMain]
> >#
> ># Multiple Console IO support
> >#
> > +  INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> > +  INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> > +  INF 
> > MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
> >INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> >INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
> >
> > @@ -144,6 +147,9 @@ [FV.FvMain]
> >INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
> >INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
> >
> > +  # Graphics Output Protocol
> > +  INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
> > +
> >INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
> >INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
> >
> > diff --git a/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf 
> > b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
> > new file mode 100644
> > index ..25efbea5fb83
> > --- /dev/null
> > +++ b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
> > @@ -0,0 +1,37 @@
> > +#
> > +#  Copyright (c) 2018, ARM Limited. All rights reserved.
> > +#
> > +#  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
> > +#
> 

[edk2] [PATCH v2 edk2-platforms] Platform/ARM/SgiPkg: Add support for HDLCD

2018-12-06 Thread Vijayenthiran Subramaniam
Add HDLCD platform library for SGI platform that implements platform
callbacks for the Arm HDLCD driver.

Change-Id: I6cdca16bd69eeadeeb879dd5fe9acc72a12fbf2f
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc   |   6 +
 Platform/ARM/SgiPkg/SgiPlatform.fdf   |   6 +
 Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf |  40 +++
 Platform/ARM/SgiPkg/Include/SgiPlatform.h |   4 +
 Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgi.c  | 257 

 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c  |   8 +-
 6 files changed, 320 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 0c794c6b299d..7995c7d132d6 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -37,6 +37,8 @@ [LibraryClasses.common]
   ArmPlatformLib|Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
   BasePathLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
   
EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
+  LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
+  LcdPlatformLib|Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
   NorFlashPlatformLib|Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
@@ -155,6 +157,9 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PL011UartInteger|4
   gArmPlatformTokenSpaceGuid.PL011UartFractional|0
 
+  ## PL370 - HDLCD1
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase|0x7FF6
+
   ## PL011 - Serial Debug UART
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x7FF8
   gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|7372800
@@ -235,6 +240,7 @@ [Components.common]
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
   ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
+  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
   EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index ddf1fda5a16e..80c3412fd4ad 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -133,6 +133,9 @@ [FV.FvMain]
   #
   # Multiple Console IO support
   #
+  INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
+  INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
+  INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
   INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 
@@ -144,6 +147,9 @@ [FV.FvMain]
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 
+  # Graphics Output Protocol
+  INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
+
   INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 
diff --git a/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf 
b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
new file mode 100644
index ..751f0d9288eb
--- /dev/null
+++ b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
@@ -0,0 +1,40 @@
+#
+#  Copyright (c) 2018, ARM Limited. All rights reserved.
+#
+#  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.
+#
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = HdLcdArmSgiLib
+  FILE_GUID  = 0C77342C-7895-4DE1-A9C8-1DBBFA71AF34
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = LcdPlatformLib
+
+[Sources.common]
+  HdLcdArmSgi.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec
+
+[LibraryClasses]
+  BaseLib
+
+[FixedPcd]
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase
+  gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferBase
+  gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferSize
+  gArmPlatformTokenSpaceGuid.PcdGopPixelFormat
+
+[depex]
+  gEfiCpuArchProtocolGuid
diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h 
b/Platform/ARM/SgiP

Re: [edk2] [PATCH v1 edk2-platforms 1/8] Platform/ARM/SgiPkg: Restructure virtio device registration

2018-12-06 Thread Vijayenthiran Subramaniam
On Thu, Dec 6, 2018 at 5:18 PM Ard Biesheuvel  wrote:
>
> On Wed, 5 Dec 2018 at 07:10, Vijayenthiran Subramaniam
>  wrote:
> >
> > Hi Ard,
> >
> > The virtio block device and virtio network device are available in software 
> > model only. As of now, it exposes only one instance of each device.
> >
>
> Are the virtio devices described by the device tree obtained from the
> secure firmware?

No. The device tree from secure firmware does not carry any devices
information other than platform/config id.

>
> > On Tue, Dec 4, 2018 at 8:16 PM Ard Biesheuvel  
> > wrote:
> >>
> >> On Tue, 4 Dec 2018 at 10:12, Vijayenthiran Subramaniam
> >>  wrote:
> >> >
> >> > From: Daniil Egranov 
> >> >
> >> > SGI platforms support multiple virtio devices. So the existing code, that
> >> > supports registration of only the virtio disk, is restructured to
> >> > accommodate the registration of additional virtio devices.
> >> >
> >> > In addition to this, PCDs to represent the virtio controller base and
> >> > address space size are introduced.
> >> >
> >> > Contributed-under: TianoCore Contribution Agreement 1.1
> >> > Signed-off-by: Daniil Egranov 
> >> > ---
> >> >  Platform/ARM/SgiPkg/SgiPlatform.dec 
> >> >  |  8 ++-
> >> >  Platform/ARM/SgiPkg/SgiPlatform.dsc 
> >> >  |  7 +-
> >> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf 
> >> >  |  8 ++-
> >> >  Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h  
> >> >  | 21 ++
> >> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c   
> >> >  | 14 +---
> >> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => 
> >> > VirtioDevices.c} | 67 
> >> >  6 files changed, 81 insertions(+), 44 deletions(-)
> >> >
> >>
> >> Can these platforms only ever expose a single block device and a
> >> single network device?
> >>
> >> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
> >> > b/Platform/ARM/SgiPkg/SgiPlatform.dec
> >> > index f6e0ba1e927a..ed29a4d5d91f 100644
> >> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dec
> >> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
> >> > @@ -37,12 +37,16 @@ [Guids.common]
> >> >gSgiClarkHeliosAcpiTablesFileGuid = { 0x2af40815, 0xa84e, 0x4de9, { 
> >> > 0x8c, 0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } }
> >> >
> >> >  [PcdsFeatureFlag.common]
> >> > -  # Set this PCD to TRUE to enable virtio support.
> >> > -  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE|BOOLEAN|0x0001
> >> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
> >> >
> >> >  [PcdsFixedAtBuild]
> >> >gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
> >> >gArmSgiTokenSpaceGuid.PcdDramBlock2Size|0|UINT64|0x0003
> >> >
> >> > +  # Virtio Block device
> >> > +  
> >> > gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x|UINT32|0x0004
> >> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x|UINT32|0x0005
> >> > +  
> >> > gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|0x|UINT32|0x0006
> >> > +
> >> >  [Ppis]
> >> >gHwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 
> >> > 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
> >> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
> >> > b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> >> > index b3f76d2d9720..ada72be72f8a 100644
> >> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> >> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> >> > @@ -98,7 +98,7 @@ [LibraryClasses.common.UEFI_DRIVER, 
> >> > LibraryClasses.common.UEFI_APPLICATION, Libr
> >> >  
> >> > 
> >> >
> >> >  [PcdsFeatureFlag.common]
> >> > -  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE
> >> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|TRUE
> >> >
> >> >  [PcdsFixedAtBuild.common]
> >> >gArmTokenSpaceGuid.PcdVFPEnabled|1
> >> > 

[edk2] [PATCH] Platform/ARM/SgiPkg: Add support for HDLCD

2018-12-06 Thread Vijayenthiran Subramaniam
Add HDLCD platform library for SGI platform that implements platform
callbacks for the Arm HDLCD driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc   |   6 +
 Platform/ARM/SgiPkg/SgiPlatform.fdf   |   6 +
 Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf |  37 +++
 Platform/ARM/SgiPkg/Include/SgiPlatform.h |   4 +
 Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgi.c  | 262 

 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c  |   8 +-
 6 files changed, 322 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 0c794c6b299d..7995c7d132d6 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -37,6 +37,8 @@ [LibraryClasses.common]
   ArmPlatformLib|Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
   BasePathLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
   
EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
+  LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
+  LcdPlatformLib|Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
   NorFlashPlatformLib|Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
@@ -155,6 +157,9 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PL011UartInteger|4
   gArmPlatformTokenSpaceGuid.PL011UartFractional|0
 
+  ## PL370 - HDLCD1
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase|0x7FF6
+
   ## PL011 - Serial Debug UART
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x7FF8
   gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|7372800
@@ -235,6 +240,7 @@ [Components.common]
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf
   ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
+  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
   EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index ddf1fda5a16e..80c3412fd4ad 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -133,6 +133,9 @@ [FV.FvMain]
   #
   # Multiple Console IO support
   #
+  INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
+  INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
+  INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
   INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 
@@ -144,6 +147,9 @@ [FV.FvMain]
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
 
+  # Graphics Output Protocol
+  INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
+
   INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 
diff --git a/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf 
b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
new file mode 100644
index ..25efbea5fb83
--- /dev/null
+++ b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
@@ -0,0 +1,37 @@
+#
+#  Copyright (c) 2018, ARM Limited. All rights reserved.
+#
+#  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.
+#
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = HdLcdArmSgiLib
+  FILE_GUID  = 0C77342C-7895-4DE1-A9C8-1DBBFA71AF34
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = LcdPlatformLib
+
+[Sources.common]
+  HdLcdArmSgi.c
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec
+
+[LibraryClasses]
+  BaseLib
+
+[FixedPcd]
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase
+  gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferBase
+  gArmPlatformTokenSpaceGuid.PcdArmLcdDdrFrameBufferSize
+  gArmPlatformTokenSpaceGuid.PcdGopPixelFormat
diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h 
b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index 550189565752..b9a662ae41a1 100644
--- a/Platform/ARM/SgiP

Re: [edk2] [PATCH v1 edk2-platforms 1/8] Platform/ARM/SgiPkg: Restructure virtio device registration

2018-12-04 Thread Vijayenthiran Subramaniam
Hi Ard,

The virtio block device and virtio network device are available in software
model only. As of now, it exposes only one instance of each device.

On Tue, Dec 4, 2018 at 8:16 PM Ard Biesheuvel 
wrote:

> On Tue, 4 Dec 2018 at 10:12, Vijayenthiran Subramaniam
>  wrote:
> >
> > From: Daniil Egranov 
> >
> > SGI platforms support multiple virtio devices. So the existing code, that
> > supports registration of only the virtio disk, is restructured to
> > accommodate the registration of additional virtio devices.
> >
> > In addition to this, PCDs to represent the virtio controller base and
> > address space size are introduced.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Daniil Egranov 
> > ---
> >  Platform/ARM/SgiPkg/SgiPlatform.dec
>   |  8 ++-
> >  Platform/ARM/SgiPkg/SgiPlatform.dsc
>   |  7 +-
> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
>   |  8 ++-
> >  Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
>  | 21 ++
> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
>   | 14 +---
> >  Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c =>
> VirtioDevices.c} | 67 
> >  6 files changed, 81 insertions(+), 44 deletions(-)
> >
>
> Can these platforms only ever expose a single block device and a
> single network device?
>
> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec
> b/Platform/ARM/SgiPkg/SgiPlatform.dec
> > index f6e0ba1e927a..ed29a4d5d91f 100644
> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dec
> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
> > @@ -37,12 +37,16 @@ [Guids.common]
> >gSgiClarkHeliosAcpiTablesFileGuid = { 0x2af40815, 0xa84e, 0x4de9, {
> 0x8c, 0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } }
> >
> >  [PcdsFeatureFlag.common]
> > -  # Set this PCD to TRUE to enable virtio support.
> > -  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE|BOOLEAN|0x0001
> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
> >
> >  [PcdsFixedAtBuild]
> >gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
> >gArmSgiTokenSpaceGuid.PcdDramBlock2Size|0|UINT64|0x0003
> >
> > +  # Virtio Block device
> > +
> gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x|UINT32|0x0004
> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x|UINT32|0x0005
> > +
> gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|0x|UINT32|0x0006
> > +
> >  [Ppis]
> >gHwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8,
> 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
> > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > index b3f76d2d9720..ada72be72f8a 100644
> > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
> > @@ -98,7 +98,7 @@ [LibraryClasses.common.UEFI_DRIVER,
> LibraryClasses.common.UEFI_APPLICATION, Libr
> >
> 
> >
> >  [PcdsFeatureFlag.common]
> > -  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE
> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|TRUE
> >
> >  [PcdsFixedAtBuild.common]
> >gArmTokenSpaceGuid.PcdVFPEnabled|1
> > @@ -180,6 +180,11 @@ [PcdsFixedAtBuild.common]
> ># Ethernet
> >gEmbeddedTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1800
> >
> > +  # Virtio Disk
> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x1c13
> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x1
> > +  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|202
> > +
> >
> 
> >  #
> >  # Components Section - list of all EDK II Modules needed by this
> Platform
> > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
> b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
> > index d903ed8d3375..f920f6ecafb8 100644
> > --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
> > +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
> > @@ -20,7 +20,7 @@ [Defines]
> >
> >  [Sources.common]
> >PlatformDxe.c
> > -  VirtioBlockIo.c
> > +  VirtioDevices.c
> >
> >  [Packages]
> >EmbeddedPkg/EmbeddedPkg.dec
> > @@ -41,7 +41,11 @@ [Guids]
> >gSgiClarkHeliosAcpiTablesFileGuid
> >
> >  [FeaturePcd]
> > -  gArmSgiTokenSpaceGuid.PcdVirtioSupported
> > +  gArmSgiTokenSp

[edk2] [PATCH v1 edk2-platforms 8/8] SgiClark.Helios: AcpiTables: Add entry for virtio network device

2018-12-04 Thread Vijayenthiran Subramaniam
SgiClark Helios include an instance of the virtio network device. Add
a representation for it in the ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf |  3 +++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl  | 18 
++
 2 files changed, 21 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
index 3686e91bb7e7..8b45702b7cd3 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
@@ -58,5 +58,8 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
index 3dcf6f71eadb..7cfc419eb3a2 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
@@ -264,5 +264,23 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
 }
   })
 }
+
+// VIRTIO NET
+Device (VR01) {
+  Name (_HID, "LNRO0005")
+  Name (_UID, 1)
+  Name (_CCA, 1)// mark the device coherent
+
+  Name (_CRS, ResourceTemplate() {
+Memory32Fixed (
+  ReadWrite,
+  FixedPcdGet32 (PcdVirtioNetBaseAddress),
+  FixedPcdGet32 (PcdVirtioNetSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioNetInterrupt)
+}
+  })
+}
   } // Scope(_SB)
 }
-- 
2.7.4

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


[edk2] [PATCH v1 edk2-platforms 7/8] SgiClark.Helios: AcpiTables: Use PCDs for virtio disk

2018-12-04 Thread Vijayenthiran Subramaniam
Use PCDs instead of hardcoded values for virtio disk in DSDT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf |  4 
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl  | 10 --
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
index 0ecce2db8a5d..3686e91bb7e7 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
@@ -55,4 +55,8 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
index b8eb3b8e7332..3dcf6f71eadb 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
@@ -254,8 +254,14 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
   Name (_CCA, 1)// mark the device coherent
 
   Name (_CRS, ResourceTemplate() {
-Memory32Fixed (ReadWrite, 0x1c13, 0x1)
-Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 202 }
+Memory32Fixed (
+  ReadWrite,
+  FixedPcdGet32 (PcdVirtioBlkBaseAddress),
+  FixedPcdGet32 (PcdVirtioBlkSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioBlkInterrupt)
+}
   })
 }
   } // Scope(_SB)
-- 
2.7.4

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


[edk2] [PATCH v1 edk2-platforms 6/8] SgiClark.Ares: AcpiTables: Add entry for virtio network device

2018-12-04 Thread Vijayenthiran Subramaniam
SgiClark Ares include an instance of the virtio network device. Add
a representation for it in the ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf |  3 +++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl  | 17 
+
 2 files changed, 20 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
index 10a805e07fd1..d4bacdbc8c85 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
@@ -58,5 +58,8 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
index af4dc424a77c..69dc33c06b4d 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
@@ -118,5 +118,22 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
 }
   })
 }
+
+// VIRTIO NET
+Device (VR01) {
+  Name (_HID, "LNRO0005")
+  Name (_UID, 1)
+  Name (_CCA, 1)// mark the device coherent
+
+  Name (_CRS, ResourceTemplate() {
+Memory32Fixed (ReadWrite,
+  FixedPcdGet32 (PcdVirtioNetBaseAddress),
+  FixedPcdGet32 (PcdVirtioNetSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioNetInterrupt)
+}
+  })
+}
   } // Scope(_SB)
 }
-- 
2.7.4

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


[edk2] [PATCH v1 edk2-platforms 5/8] SgiClark.Ares: AcpiTables: Use PCDs for virtio disk

2018-12-04 Thread Vijayenthiran Subramaniam
Use PCDs instead of hardcoded values for virtio disk in DSDT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf |  4 
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl  | 12 +---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
index dcfe4929bb5a..10a805e07fd1 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
@@ -55,4 +55,8 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
index c94a7c69e33a..af4dc424a77c 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
@@ -107,9 +107,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI",
   Name (_UID, 0)
   Name (_CCA, 1)// mark the device coherent
 
-  Name (_CRS, ResourceTemplate () {
-Memory32Fixed (ReadWrite, 0x1c13, 0x1)
-Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 202 }
+  Name (_CRS, ResourceTemplate() {
+Memory32Fixed (
+  ReadWrite,
+  FixedPcdGet32 (PcdVirtioBlkBaseAddress),
+  FixedPcdGet32 (PcdVirtioBlkSize)
+)
+Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+  FixedPcdGet32 (PcdVirtioBlkInterrupt)
+}
   })
 }
   } // Scope(_SB)
-- 
2.7.4

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


[edk2] [PATCH v1 edk2-platforms 4/8] Sgi575: AcpiTables: Add entry for virtio network device

2018-12-04 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

SGI575 include an instance of the virtio network device. So add
a representation for it in the ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf |  3 +++
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl  | 18 ++
 2 files changed, 21 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index e236b940a802..c666ea9d51c7 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -58,5 +58,8 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
index 833f5b44b6a8..36bc8c3809a0 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
@@ -114,4 +114,22 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI", EFI_ACPI_ARM_OEM
   }
 })
   }
+
+  // VIRTIO NET
+  Device (VR01) {
+Name (_HID, "LNRO0005")
+Name (_UID, 1)
+Name (_CCA, 1)// mark the device coherent
+
+Name (_CRS, ResourceTemplate() {
+  Memory32Fixed (
+ReadWrite,
+FixedPcdGet32 (PcdVirtioNetBaseAddress),
+FixedPcdGet32 (PcdVirtioNetSize)
+  )
+  Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+FixedPcdGet32 (PcdVirtioNetInterrupt)
+  }
+})
+  }
 }
-- 
2.7.4

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


[edk2] [PATCH v1 edk2-platforms 3/8] Sgi575: AcpiTables: Use PCDs for virtio disk

2018-12-04 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

Use PCDs instead of hardcoded values for virtio disk in DSDT.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf |  4 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl  | 10 --
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index 59ccb79b6475..e236b940a802 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -55,4 +55,8 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdPciBusMin
   gArmTokenSpaceGuid.PcdPciBusMax
 
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
index 509cd7cd4262..833f5b44b6a8 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl
@@ -104,8 +104,14 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARMSGI", EFI_ACPI_ARM_OEM
 Name (_CCA, 1)// mark the device coherent
 
 Name (_CRS, ResourceTemplate() {
-  Memory32Fixed (ReadWrite, 0x1c13, 0x1)
-  Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 202 }
+  Memory32Fixed (
+ReadWrite,
+FixedPcdGet32 (PcdVirtioBlkBaseAddress),
+FixedPcdGet32 (PcdVirtioBlkSize)
+  )
+  Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) {
+FixedPcdGet32 (PcdVirtioBlkInterrupt)
+  }
 })
   }
 }
-- 
2.7.4

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


[edk2] [PATCH v1 edk2-platforms 2/8] Platform/ARM/SgiPkg: Add support for virtio net device

2018-12-04 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

Add support for virtio net device by adding PCDs to specify the data
required to setup the virtio net device and register it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec|  6 +++
 Platform/ARM/SgiPkg/SgiPlatform.dsc| 18 +--
 Platform/ARM/SgiPkg/SgiPlatform.fdf|  4 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf|  3 ++
 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h |  3 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/VirtioDevices.c| 54 

 6 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index ed29a4d5d91f..39cc3f89fd57 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -38,6 +38,7 @@ [Guids.common]
 
 [PcdsFeatureFlag.common]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSupported|FALSE|BOOLEAN|0x0010
 
 [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
@@ -48,5 +49,10 @@ [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x|UINT32|0x0005
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|0x|UINT32|0x0006
 
+  # Virtio Network device
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress|0x|UINT32|0x0007
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x|UINT32|0x0008
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|0x|UINT32|0x0009
+
 [Ppis]
   gHwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 
0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index ada72be72f8a..0c794c6b299d 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -45,6 +45,7 @@ [LibraryClasses.common]
   VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
   
VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
+  
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
 
 [LibraryClasses.common.SEC]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
@@ -99,6 +100,7 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 
 [PcdsFeatureFlag.common]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|TRUE
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSupported|TRUE
 
 [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdVFPEnabled|1
@@ -177,14 +179,19 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PcdCoreCount|4
   gArmPlatformTokenSpaceGuid.PcdClusterCount|2
 
-  # Ethernet
-  gEmbeddedTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1800
-
   # Virtio Disk
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x1c13
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x1
   gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|202
 
+  # Ethernet / Virtio Network
+!ifdef EDK2_ENABLE_SMSC_91X
+  gEmbeddedTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1800
+!endif
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress|0x1c15
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize|0x1
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|204
+
 

 #
 # Components Section - list of all EDK II Modules needed by this Platform
@@ -288,8 +295,11 @@ [Components.common]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
   }
 
-  # SMSC LAN 91C111
+  # SMSC LAN 91C111 / Virtio Network
+!ifdef EDK2_ENABLE_SMSC_91X
   EmbeddedPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
+!endif
+  OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
   #
   # Required by PCI
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index b7af4a2a5925..ddf1fda5a16e 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -191,7 +191,11 @@ [FV.FvMain]
   INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
   INF NetworkPkg/TcpDxe/TcpDxe.inf
   INF NetworkPkg/IScsiDxe/IScsiDxe.inf
+
+!ifdef EDK2_ENABLE_SMSC_91X
   INF EmbeddedPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
+!endif
+  INF OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
 [FV.FVMAIN_COMPACT]
 FvAlignment= 16
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
index f920f6ecafb8..3283ff045372 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
@@ -42,10 +42,13 @@ [Guids]
 
 [FeaturePcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSupported
 
 [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
   

[edk2] [PATCH v1 edk2-platforms 1/8] Platform/ARM/SgiPkg: Restructure virtio device registration

2018-12-04 Thread Vijayenthiran Subramaniam
From: Daniil Egranov 

SGI platforms support multiple virtio devices. So the existing code, that
supports registration of only the virtio disk, is restructured to
accommodate the registration of additional virtio devices.

In addition to this, PCDs to represent the virtio controller base and
address space size are introduced.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Daniil Egranov 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec  | 
 8 ++-
 Platform/ARM/SgiPkg/SgiPlatform.dsc  | 
 7 +-
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf  | 
 8 ++-
 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h   | 
21 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c| 
14 +---
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => VirtioDevices.c} | 
67 
 6 files changed, 81 insertions(+), 44 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index f6e0ba1e927a..ed29a4d5d91f 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -37,12 +37,16 @@ [Guids.common]
   gSgiClarkHeliosAcpiTablesFileGuid = { 0x2af40815, 0xa84e, 0x4de9, { 0x8c, 
0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } }
 
 [PcdsFeatureFlag.common]
-  # Set this PCD to TRUE to enable virtio support.
-  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE|BOOLEAN|0x0001
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
 
 [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
   gArmSgiTokenSpaceGuid.PcdDramBlock2Size|0|UINT64|0x0003
 
+  # Virtio Block device
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x|UINT32|0x0004
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x|UINT32|0x0005
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|0x|UINT32|0x0006
+
 [Ppis]
   gHwConfigDtInfoPpiGuid = { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8, 0x9b, 
0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } }
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index b3f76d2d9720..ada72be72f8a 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -98,7 +98,7 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 

 
 [PcdsFeatureFlag.common]
-  gArmSgiTokenSpaceGuid.PcdVirtioSupported|TRUE
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|TRUE
 
 [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdVFPEnabled|1
@@ -180,6 +180,11 @@ [PcdsFixedAtBuild.common]
   # Ethernet
   gEmbeddedTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1800
 
+  # Virtio Disk
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x1c13
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x1
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|202
+
 

 #
 # Components Section - list of all EDK II Modules needed by this Platform
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
index d903ed8d3375..f920f6ecafb8 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
@@ -20,7 +20,7 @@ [Defines]
 
 [Sources.common]
   PlatformDxe.c
-  VirtioBlockIo.c
+  VirtioDevices.c
 
 [Packages]
   EmbeddedPkg/EmbeddedPkg.dec
@@ -41,7 +41,11 @@ [Guids]
   gSgiClarkHeliosAcpiTablesFileGuid
 
 [FeaturePcd]
-  gArmSgiTokenSpaceGuid.PcdVirtioSupported
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported
+
+[FixedPcd]
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
 
 [Depex]
   TRUE
diff --git a/Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h 
b/Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
new file mode 100644
index ..80d3e3ae4f91
--- /dev/null
+++ b/Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
@@ -0,0 +1,21 @@
+/** @file
+*
+*  Copyright (c) 2018, ARM Limited. All rights reserved.
+*
+*  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.
+*
+**/
+
+#ifndef  __SGI_VIRTIO_DEVICES_FORMSET_H__
+#define  __SGI_VIRTIO_DEVICES_FORMSET_H__
+
+#define SGI_VIRTIO_BLOCK_GUID  \
+  { 0x5a96cdcd, 0x6116, 0x4929, { 0xb7, 0x01, 0x3a, 0xc2, 0xfb, 0x1c, 0xe2, 
0x28 } }
+
+#endif
diff --git 

[edk2] [PATCH v1 edk2-platforms 0/8] Platform/ARM/Sgi: Add support for virtio network device

2018-12-04 Thread Vijayenthiran Subramaniam
This patch series adds support for virtio network controller found in ARM SGI
plaform's fast models. The first patch in this series restructure the
virtio device registration code to allow registration of additional virtio
devices. The second patch adds support for the virtio network device. The rest
of the patches update the ACPI tables to add an entry for the virtio network
device and corresponding PCDs for virtio block and network device.

Daniil Egranov (4):
  Platform/ARM/SgiPkg: Restructure virtio device registration
  Platform/ARM/SgiPkg: Add support for virtio net device
  Sgi575: AcpiTables: Use PCDs for virtio disk
  Sgi575: AcpiTables: Add entry for virtio network device

Vijayenthiran Subramaniam (4):
  SgiClark.Ares: AcpiTables: Use PCDs for virtio disk
  SgiClark.Ares: AcpiTables: Add entry for virtio network device
  SgiClark.Helios: AcpiTables: Use PCDs for virtio disk
  SgiClark.Helios: AcpiTables: Add entry for virtio network device

 Platform/ARM/SgiPkg/SgiPlatform.dec  | 
 14 ++-
 Platform/ARM/SgiPkg/SgiPlatform.dsc  | 
 21 +++-
 Platform/ARM/SgiPkg/SgiPlatform.fdf  | 
  4 +
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf  | 
  7 ++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf| 
  7 ++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf  | 
  7 ++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf  | 
 11 +-
 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h   | 
 24 
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c| 
 14 +--
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => VirtioDevices.c} | 
117 +++-
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl   | 
 28 -
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl | 
 29 -
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl   | 
 28 -
 13 files changed, 260 insertions(+), 51 deletions(-)
 create mode 100644 Platform/ARM/SgiPkg/Include/Guid/SgiVirtioDevicesFormSet.h
 rename Platform/ARM/SgiPkg/Drivers/PlatformDxe/{VirtioBlockIo.c => 
VirtioDevices.c} (25%)

-- 
2.7.4

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


[edk2] [PATCH] Platform/ARM/Juno: increase max variable size to 8KB

2018-11-21 Thread Vijayenthiran Subramaniam
Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
package. This driver requires the platform to support a maximum variable
size of atleast 4KB.

So increase the maximum supported variable size to 8KB on the Juno
platform. Without this, the iSCSI driver fails to load.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Thomas Abraham 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/JunoPkg/ArmJuno.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index ac3d63b..ac85dc0 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -103,6 +103,8 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x0BFE
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x0001
 
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
+
   # System Memory (2GB - 16MB of Trusted DRAM at the top of the 32bit address 
space)
   gArmTokenSpaceGuid.PcdSystemMemoryBase|0x8000
 
-- 
2.7.4

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


[edk2] [PATCH v2] NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

2018-11-21 Thread Vijayenthiran Subramaniam
Add debug messages for failed attempts to write to a variable.

Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
Made the log messages bit more useful. 

Thanks,
Vijayenthiran

 NetworkPkg/IScsiDxe/IScsiMisc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index dd0d32dcda16..7bed95a8fba3 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -845,6 +845,10 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigOrder);
 if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR,
+"%a: Failed to set 'InitialAttemptOrder' with Guid (%g): "
+"%r\n",
+__FUNCTION__, , Status));
   return Status;
 }
 
@@ -887,6 +891,10 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigData);
 if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable (mPrivate->PortString) with Guid (%g): "
+  "%r\n",
+  __FUNCTION__, , Status));
   return Status;
 }
   }
-- 
2.17.1

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


[edk2] [PATCH v2] MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

2018-11-21 Thread Vijayenthiran Subramaniam
Print debug messages if size of the VariableName plus DataSize exceeds
Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any
platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to
be changed.

Cc: Star Zeng 
Cc: Jian J Wang 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
Thanks for the review. I have made changes based on Laszlo's and Star's
suggestions.

- Vijayenthiran

 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 30 
 1 file changed, 30 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 8e8db71bd201..d100b1dcc552 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -3234,14 +3234,44 @@ VariableServiceSetVariable (
 //
 if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxAuthVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxAuthVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 } else if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 } else {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVolatileVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxVolatileVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxVolatileVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 }
-- 
2.17.1

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


[edk2] [PATCH] NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

2018-11-20 Thread Vijayenthiran Subramaniam
Add debug messages for failed attempts to write to a variable.

Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 NetworkPkg/IScsiDxe/IScsiMisc.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index dd0d32dcda16..46760d79a8f3 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -845,6 +845,8 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigOrder);
 if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
+__FUNCTION__, Status));
   return Status;
 }
 
@@ -887,6 +889,8 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigData);
 if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "%a: SetVariable failed with return: %r\n",
+__FUNCTION__, Status));
   return Status;
 }
   }
-- 
2.17.1

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


[edk2] [PATCH] MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

2018-11-20 Thread Vijayenthiran Subramaniam
Print debug messages if size of the VariableName plus DataSize exceeds
Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any
platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to
be changed.

Cc: Star Zeng 
Cc: Jian J Wang 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 8e8db71bd201..db54fa4412c0 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -3234,14 +3234,20 @@ VariableServiceSetVariable (
 //
 if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxAuthVariableSize.\n",
+  __FUNCTION__, VariableName));
 return EFI_INVALID_PARAMETER;
   }
 } else if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxVariableSize.\n",
+  __FUNCTION__, VariableName));
 return EFI_INVALID_PARAMETER;
   }
 } else {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVolatileVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR, "%a: Size of (%s) variable + DataSize exceeds 
MaxVolatileVariableSize.\n",
+  __FUNCTION__, VariableName));
 return EFI_INVALID_PARAMETER;
   }
 }
-- 
2.17.1

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


[edk2] [PATCH 1/1] Platform/ARM/SgiPkg: increase max variable size to 8KB

2018-11-20 Thread Vijayenthiran Subramaniam
Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
package. This driver requires the platform to support a maximum variable
size of atleast 4KB.

So increase the maximum supported variable size to 8KB on the SGI
platforms. Without this, the iSCSI driver fails to load.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 3f0ca9872e79..1c152fad2246 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -102,6 +102,7 @@
 
 [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdVFPEnabled|1
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
 
   # DRAM Block2 Base and Size
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0x808000
-- 
2.17.1

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