public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, joakim.bech@linaro.org,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH edk2-platforms 4/5] Silicon/SynQuacer/PlatformDxe: add menu option to select mezzanine
Date: Thu, 15 Feb 2018 17:20:53 +0000	[thread overview]
Message-ID: <20180215172054.27452-5-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20180215172054.27452-1-ard.biesheuvel@linaro.org>

96boards mezzanines are not runtime discoverable, so it is up to the
user to tell the firmware what is connected. So add a pulldown entry
that allows a selection to be made: note that boards are only expected
to have a single LS connector, so a pulldown is appropriate here.

If Secure96 has been selected by the user, install the associated GUID
as a protocol, which the Secure96Dxe (which installs the DT overlay into
the device tree) has a depex on.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c      | 8 ++++++++
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf    | 2 ++
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni | 6 ++++++
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr | 8 ++++++++
 Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h            | 6 +++++-
 5 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
index aab830dc3a5a..d57d1bbb52fa 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
@@ -327,5 +327,13 @@ PlatformDxeEntryPoint (
     ASSERT_EFI_ERROR (Status);
   }
 
+  if (mHiiSettings->InstalledMezzanineType == MEZZANINE_SECURE96) {
+    Handle = NULL;
+    Status = gBS->InstallProtocolInterface (&Handle,
+                    &gSecure96HardwarePresent,
+                    EFI_NATIVE_INTERFACE, NULL);
+    ASSERT_EFI_ERROR (Status);
+  }
+
   return EFI_SUCCESS;
 }
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
index 49d9deee57ea..f3f913609452 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
@@ -34,6 +34,7 @@ [Packages]
   EmbeddedPkg/EmbeddedPkg.dec
   MdeModulePkg/MdeModulePkg.dec
   MdePkg/MdePkg.dec
+  Platform/96boards/Secure96/Secure96.dec
   Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec
   Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.dec
   Silicon/Socionext/SynQuacer/SynQuacer.dec
@@ -59,6 +60,7 @@ [Guids]
   gEfiHiiPlatformSetupFormsetGuid
   gFdtTableGuid
   gNetsecNonDiscoverableDeviceGuid
+  gSecure96HardwarePresent
   gSynQuacerNonDiscoverableI2cMasterGuid
   gSynQuacerNonDiscoverableRuntimeI2cMasterGuid
   gSynQuacerPlatformFormSetGuid
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni
index 2eca8bbba8c3..707540542616 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.uni
@@ -33,3 +33,9 @@
 
 #string STR_EMMC_DISABLED              #language en-US "Disabled"
 #string STR_EMMC_ENABLED               #language en-US "Enabled"
+
+#string STR_MEZZANINE_SELECT_PROMPT    #language en-US "96boards mezzanine"
+#string STR_MEZZANINE_SELECT_HELP      #language en-US "The type of mezzanine board plugged into the 96boards LS connector"
+
+#string STR_MEZZANINE_NONE             #language en-US "None/Unknown"
+#string STR_MEZZANINE_SECURE96         #language en-US "Secure96"
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr
index ea35e902b2d7..6c348aa0a29b 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxeHii.vfr
@@ -70,6 +70,14 @@ formset
         option text = STRING_TOKEN(STR_EMMC_ENABLED), value = EMMC_ENABLED, flags = 0;
     endoneof;
 
+    oneof varid = SynQuacerPlatformSettings.InstalledMezzanineType,
+        prompt      = STRING_TOKEN(STR_MEZZANINE_SELECT_PROMPT),
+        help        = STRING_TOKEN(STR_MEZZANINE_SELECT_HELP),
+        flags       = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED,
+        option text = STRING_TOKEN(STR_MEZZANINE_NONE), value = MEZZANINE_NONE, flags = DEFAULT;
+        option text = STRING_TOKEN(STR_MEZZANINE_SECURE96), value = MEZZANINE_SECURE96, flags = 0;
+    endoneof;
+
     subtitle text = STRING_TOKEN(STR_NULL_STRING);
 
   endform;
diff --git a/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h b/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h
index fbbcbd7d3eec..a723f78a738a 100644
--- a/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h
+++ b/Silicon/Socionext/SynQuacer/Include/Platform/VarStore.h
@@ -22,12 +22,16 @@
 #define PCIE_MAX_SPEED_UNLIMITED          0x0
 #define PCIE_MAX_SPEED_GEN1               0x1
 
+#define MEZZANINE_NONE                    0x0
+#define MEZZANINE_SECURE96                0x1
+
 typedef struct {
   UINT8         EnableEmmc;
   UINT8         PcieSlot0MaxSpeed;
   UINT8         PcieSlot1MaxSpeed;
   UINT8         PcieSlot2MaxSpeed;
-  UINT8         Reserved[4];
+  UINT8         InstalledMezzanineType;
+  UINT8         Reserved[3];
 } SYNQUACER_PLATFORM_VARSTORE_DATA;
 
 #endif
-- 
2.11.0



  parent reply	other threads:[~2018-02-15 17:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 17:20 [PATCH edk2-platforms 0/5] Add Secure96 mezzanine support Ard Biesheuvel
2018-02-15 17:20 ` [PATCH edk2-platforms 1/5] Silicon/SynQuaver/DeviceTree: add node for SPI controller Ard Biesheuvel
2018-02-16 17:00   ` Leif Lindholm
2018-02-16 18:34     ` Ard Biesheuvel
2018-02-18 11:39       ` Leif Lindholm
2018-02-19  8:20         ` Ard Biesheuvel
2018-02-19 11:48           ` Leif Lindholm
2018-02-15 17:20 ` [PATCH edk2-platforms 2/5] Silicon/SynQuaver/DeviceTree: add node for I2C controller Ard Biesheuvel
2018-02-15 17:20 ` [PATCH edk2-platforms 3/5] Platform: add support for 96boards Secure96 mezzanine adapter Ard Biesheuvel
2018-02-15 17:20 ` Ard Biesheuvel [this message]
2018-02-15 17:20 ` [PATCH edk2-platforms 5/5] Platform/Socionext/DeveloperBox: add Secure96 support Ard Biesheuvel
2018-02-16 17:35 ` [PATCH edk2-platforms 0/5] Add Secure96 mezzanine support Leif Lindholm
2018-02-16 18:41   ` Ard Biesheuvel
2018-02-21 12:10 ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180215172054.27452-5-ard.biesheuvel@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox