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, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH edk2-platforms v2 7/7] Platform/Socionext/DeveloperBox: add 96boards mezzanine support
Date: Tue, 20 Feb 2018 17:49:44 +0000	[thread overview]
Message-ID: <20180220174944.525-8-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20180220174944.525-1-ard.biesheuvel@linaro.org>

Wire up the various drivers for the 96boards LS connector and the
optional Secure96 mezzanine board.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 Platform/Socionext/DeveloperBox/DeveloperBox.dsc                | 34 ++++++++++++++++++++
 Platform/Socionext/DeveloperBox/DeveloperBox.fdf                | 10 ++++++
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c   |  9 ++++++
 Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf |  2 ++
 4 files changed, 55 insertions(+)

diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
index 9c95618a20fe..39f40534bb39 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc
@@ -33,6 +33,9 @@ [Defines]
 [BuildOptions]
   RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
 
+  # add ample padding to the DTC so we can apply 96boards mezzanine overlays
+  *_*_*_DTC_FLAGS = -p 1024
+
 [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
 
@@ -398,6 +401,28 @@ [PcdsFixedAtBuild.common]
 !endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision|$(BUILD_NUMBER)
 
+  #
+  # 96boards mezzanine support
+  #
+  gNinetySixBoardsTokenSpaceGuid.PcdI2c0Parent|"/i2c@51210000"
+  gNinetySixBoardsTokenSpaceGuid.PcdI2c0BusFrequencyHz|100000
+  gNinetySixBoardsTokenSpaceGuid.PcdSpiParent|"/spi@54810000"
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioParent|"/gpio@51000000"
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPolarity|0
+
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinA|10
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinB|11
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinC|12
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinD|13
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinE|18
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinF|19
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinG|20
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinH|21
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinI|22
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinJ|23
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinK|24
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinL|25
+
 [PcdsPatchableInModule]
   gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0
   gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0
@@ -644,8 +669,17 @@ [Components.common]
   SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareUpdateDxe.inf
 
   #
+  # 96board mezzanine support
+  #
+  Platform/NinetySixBoards/Secure96Dxe/Secure96Dxe.inf
+  Silicon/Atmel/AtSha204a/AtSha204aDxe.inf
+  Platform/NinetySixBoards/NinetySixBoardsI2cDxe/NinetySixBoardsI2cDxe.inf
+  Platform/NinetySixBoards/NinetySixBoardsDxe/NinetySixBoardsDxe.inf
+
+  #
   # I2C
   #
   Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf
+  MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.inf
 
   Platform/Socionext/DeveloperBox/OsInstallerMenuDxe/OsInstallerMenuDxe.inf
diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
index c2bc5aa85739..636bfaa3dd29 100644
--- a/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
+++ b/Platform/Socionext/DeveloperBox/DeveloperBox.fdf
@@ -237,9 +237,18 @@ [FV.FvMain]
   }
 
   #
+  # 96board mezzanine support
+  #
+  INF Platform/NinetySixBoards/Secure96Dxe/Secure96Dxe.inf
+  INF Platform/NinetySixBoards/NinetySixBoardsI2cDxe/NinetySixBoardsI2cDxe.inf
+  INF Silicon/Atmel/AtSha204a/AtSha204aDxe.inf
+  INF Platform/NinetySixBoards/NinetySixBoardsDxe/NinetySixBoardsDxe.inf
+
+  #
   # I2C
   #
   INF Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.inf
+  INF MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.inf
 
   INF Platform/Socionext/DeveloperBox/OsInstallerMenuDxe/OsInstallerMenuDxe.inf
 
@@ -430,6 +439,7 @@ [Rule.Common.DXE_DRIVER]
     DXE_DEPEX    DXE_DEPEX              Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
     PE32         PE32                   $(INF_OUTPUT)/$(MODULE_NAME).efi
     UI           STRING="$(MODULE_NAME)" Optional
+    RAW          BIN                    Optional    |.dtb
   }
 
 [Rule.Common.DXE_RUNTIME_DRIVER]
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
index aab830dc3a5a..11c0648c2ca0 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.c
@@ -313,6 +313,15 @@ PlatformDxeEntryPoint (
              &Handle);
   ASSERT_EFI_ERROR (Status);
 
+  //
+  // Install the gNinetySixBoardsI2c0MasterGuid GUID onto the same handle,
+  // identifying I2C #1 on our SoC as I2C #0 on the 96boards low speed connector
+  //
+  Status = gBS->InstallProtocolInterface (&Handle,
+                  &gNinetySixBoardsI2c0MasterGuid,
+                  EFI_NATIVE_INTERFACE, NULL);
+  ASSERT_EFI_ERROR (Status);
+
   SmmuEnableCoherentDma ();
   SetMmioTimerFrequency ();
 
diff --git a/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf b/Silicon/Socionext/SynQuacer/Drivers/PlatformDxe/PlatformDxe.inf
index 49d9deee57ea..4ba8bf4f761e 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/NinetySixBoards/NinetySixBoards.dec
   Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.dec
   Silicon/Socionext/SynQuacer/Drivers/Net/NetsecDxe/NetsecDxe.dec
   Silicon/Socionext/SynQuacer/SynQuacer.dec
@@ -56,6 +57,7 @@ [LibraryClasses]
   UefiRuntimeServicesTableLib
 
 [Guids]
+  gNinetySixBoardsI2c0MasterGuid
   gEfiHiiPlatformSetupFormsetGuid
   gFdtTableGuid
   gNetsecNonDiscoverableDeviceGuid
-- 
2.11.0



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

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 17:49 [PATCH edk2-platforms v2 0/7] Add Secure96 mezzanine support Ard Biesheuvel
2018-02-20 17:49 ` [PATCH edk2-platforms v2 1/7] Silicon/Atmel: add support for AtSha204a RNG Ard Biesheuvel
2018-02-22 13:08   ` Leif Lindholm
2018-02-23 15:33     ` Ard Biesheuvel
2018-02-20 17:49 ` [PATCH edk2-platforms v2 2/7] Platform/NinetySixBoards: introduce package and mezzanine protocol Ard Biesheuvel
2018-02-22 13:15   ` Leif Lindholm
2018-02-22 13:21     ` Ard Biesheuvel
2018-02-22 13:44       ` Leif Lindholm
2018-02-22 15:13         ` Ard Biesheuvel
2018-02-20 17:49 ` [PATCH edk2-platforms v2 3/7] Platform/NinetySixBoards: introduce I2C driver Ard Biesheuvel
2018-02-20 17:49 ` [PATCH edk2-platforms v2 4/7] Platform/NinetySixBoards: introduce LsConnector protocol Ard Biesheuvel
2018-02-22 15:29   ` Leif Lindholm
2018-02-20 17:49 ` [PATCH edk2-platforms v2 5/7] Platform/NinetySixBoards: add a driver for the Secure96 mezzanine board Ard Biesheuvel
2018-02-22 15:38   ` Leif Lindholm
2018-02-20 17:49 ` [PATCH edk2-platforms v2 6/7] Platform/NinetySixBoards: add core driver for LS connector and config Ard Biesheuvel
2018-02-22 15:59   ` Leif Lindholm
2018-02-22 19:00     ` Ard Biesheuvel
2018-02-22 19:10       ` Ard Biesheuvel
2018-02-22 20:21         ` Leif Lindholm
2018-02-20 17:49 ` Ard Biesheuvel [this message]
2018-02-22 16:04 ` [PATCH edk2-platforms v2 0/7] Add Secure96 mezzanine support Leif Lindholm

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20180220174944.525-8-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