[edk2,edk2-platforms,v2,2/7] Platform/NinetySixBoards: introduce package and mezzanine protocol

Message ID 20180220174944.525-3-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • Add Secure96 mezzanine support
Related show

Commit Message

Ard Biesheuvel Feb. 20, 2018, 5:49 p.m.
Introduce the mezzanine protocol and the 96boards package defining
the PCDs and GUIDs that may be used by implementations of the
protocol.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Platform/NinetySixBoards/Include/Protocol/Mezzanine.h | 71 ++++++++++++++++++++
 Platform/NinetySixBoards/NinetySixBoards.dec          | 67 ++++++++++++++++++
 2 files changed, 138 insertions(+)

-- 
2.11.0

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

Comments

Leif Lindholm Feb. 22, 2018, 1:15 p.m. | #1
On Tue, Feb 20, 2018 at 05:49:39PM +0000, Ard Biesheuvel wrote:
> Introduce the mezzanine protocol and the 96boards package defining

> the PCDs and GUIDs that may be used by implementations of the

> protocol.


This looks really good. Comments below are all style related.

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  Platform/NinetySixBoards/Include/Protocol/Mezzanine.h | 71 ++++++++++++++++++++

>  Platform/NinetySixBoards/NinetySixBoards.dec          | 67 ++++++++++++++++++


Why NinetySixBoards? Is 96Boards ENOTENOUGHCAMEL?

>  2 files changed, 138 insertions(+)

> 

> diff --git a/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h

> new file mode 100644

> index 000000000000..7869ea979b48

> --- /dev/null

> +++ b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h

> @@ -0,0 +1,71 @@

> +/** @file

> +

> +  Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>

> +

> +  This program and the accompanying materials are licensed and made available

> +  under the terms and conditions of the BSD License which accompanies this

> +  distribution. The full text of the license may be found at

> +  http://opensource.org/licenses/bsd-license.php

> +

> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,

> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

> +

> +**/

> +

> +#ifndef _MEZZANINE_H_

> +#define _MEZZANINE_H_


Maybe do the fulle _96BOARDS_MEZZANINE_H_?

> +

> +#include <Pi/PiI2c.h>

> +#include <Protocol/SpiConfiguration.h>

> +

> +#define MEZZANINE_PROTOCOL_GUID \

> +  { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } }

> +

> +typedef struct _MEZZANINE_PROTOCOL MEZZANINE_PROTOCOL;

> +

> +/**

> +  Apply the mezzanine's DT overlay

> +

> +  @param[in]      This      Pointer to the MEZZANINE_PROTOCOL instance.

> +  @param[in,out]  Dtb       Pointer to the device tree blob

> +

> +  @return   EFI_SUCCESS     Operation succeeded.

> +  @return   other           An error has occurred.

> +**/

> +typedef

> +EFI_STATUS

> +(EFIAPI *APPLY_DEVICE_TREE_OVERLAY) (

> +  IN      MEZZANINE_PROTOCOL    *This,

> +  IN  OUT VOID                  *Dtb

> +  );

> +

> +struct _MEZZANINE_PROTOCOL {

> +  //

> +  // Get the device tree overlay for this mezzanine board

> +  //

> +  APPLY_DEVICE_TREE_OVERLAY   ApplyDeviceTreeOverlay;

> +  //

> +  // The number of devices on LS connector I2C bus #0

> +  //

> +  UINT32                      I2c0NumDevices;

> +  //

> +  // The number of devices on LS connector I2C bus #1

> +  //

> +  UINT32                      I2c1NumDevices;

> +  //

> +  // Linear array of I2C devices on LS connector bus #0

> +  //

> +  CONST EFI_I2C_DEVICE        *I2c0DeviceArray;

> +  //

> +  // Linear array of I2C devices on LS connector bus #0

> +  //

> +  CONST EFI_I2C_DEVICE        *I2c1DeviceArray;

> +  //

> +  // NULL terminated linked list of SPI devices attached to the LS connector

> +  //

> +  CONST EFI_SPI_PERIPHERAL    *SpiDeviceLinkedList;

> +};

> +

> +extern EFI_GUID gNinetySixBoardsMezzanineProtocolGuid;

> +

> +#endif // _MEZZANINE_H_

> diff --git a/Platform/NinetySixBoards/NinetySixBoards.dec b/Platform/NinetySixBoards/NinetySixBoards.dec

> new file mode 100644

> index 000000000000..f7e2b01459d7

> --- /dev/null

> +++ b/Platform/NinetySixBoards/NinetySixBoards.dec

> @@ -0,0 +1,67 @@

> +## @file

> +#

> +#  Copyright (c) 2018, Linaro Ltd. 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]

> +  DEC_SPECIFICATION              = 0x0001001A

> +  PACKAGE_NAME                   = NinetySixBoards

> +  PACKAGE_GUID                   = ce4a4683-6e2d-4ec3-bc11-974289a09ab0

> +  PACKAGE_VERSION                = 0.1

> +

> +[Includes]

> +  Include

> +

> +[Protocols]

> +  ## Include/Protocol/Mezzanine.h

> +  gNinetySixBoardsMezzanineProtocolGuid = { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } }

> +

> +[Guids]

> +  # PCD scope GUID

> +  gNinetySixBoardsTokenSpaceGuid = { 0xe0d2f33a, 0xb7dd, 0x4a69, { 0xb6, 0x76, 0xda, 0xe8, 0xa4, 0x17, 0xa7, 0xb5 } }

> +

> +  # GUIDs to be installed as protocols to identify which controller connects to which bus

> +  gNinetySixBoardsI2c0MasterGuid = { 0xba10e402, 0xcfdd, 0x4b87, { 0xbd, 0x02, 0x6e, 0x26, 0x9f, 0x01, 0x94, 0x11 } }

> +  gNinetySixBoardsI2c1MasterGuid = { 0xcf64ac46, 0xd0be, 0x4a69, { 0x90, 0xa2, 0xf2, 0x82, 0x5b, 0x92, 0x25, 0x61 } }

> +  gNinetySixBoardsSpiMasterGuid = { 0x9703fd99, 0xe638, 0x42b8, { 0xab, 0x81, 0x52, 0x61, 0x1b, 0xf7, 0xf7, 0x5d } }

> +

> +[PcdsFixedAtBuild]

> +  # ASCII DT paths to the I2C parent nodes of the 96boards LS connector

> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c0Parent|""|VOID*|0x00000001

> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c1Parent|""|VOID*|0x00000002

> +

> +  # I2C bus frequency in Hertz

> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c0BusFrequencyHz|0|UINT32|0x00000003

> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c1BusFrequencyHz|0|UINT32|0x00000004

> +

> +  # ASCII DT path to the SPI parent node of the 96boards LS connector

> +  gNinetySixBoardsTokenSpaceGuid.PcdSpiParent|""|VOID*|0x00000005

> +

> +  # ASCII DT path to the GPIO parent node of the 96boards LS connector

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioParent|""|VOID*|0x00000006

> +

> +  # Polarity of the 96boards LS connector GPIOs (0 == GPIO_ACTIVE_HIGH, 1 == GPIO_ACTIVE_LOW)

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPolarity|0|UINT32|0x00000007

> +

> +  # Pin numbers of the 96boards LS connector GPIOs

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinA|0|UINT32|0x00000010

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinB|0|UINT32|0x00000011

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinC|0|UINT32|0x00000012

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinD|0|UINT32|0x00000013

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinE|0|UINT32|0x00000014

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinF|0|UINT32|0x00000015

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinG|0|UINT32|0x00000016

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinH|0|UINT32|0x00000017

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinI|0|UINT32|0x00000018

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinJ|0|UINT32|0x00000019

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinK|0|UINT32|0x0000001A

> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinL|0|UINT32|0x0000001B

> -- 

> 2.11.0

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Feb. 22, 2018, 1:21 p.m. | #2
On 22 February 2018 at 13:15, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Tue, Feb 20, 2018 at 05:49:39PM +0000, Ard Biesheuvel wrote:

>> Introduce the mezzanine protocol and the 96boards package defining

>> the PCDs and GUIDs that may be used by implementations of the

>> protocol.

>

> This looks really good. Comments below are all style related.

>

>> Contributed-under: TianoCore Contribution Agreement 1.1

>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>> ---

>>  Platform/NinetySixBoards/Include/Protocol/Mezzanine.h | 71 ++++++++++++++++++++

>>  Platform/NinetySixBoards/NinetySixBoards.dec          | 67 ++++++++++++++++++

>

> Why NinetySixBoards? Is 96Boards ENOTENOUGHCAMEL?

>


That is what I started out with, but having CPP macros and lots of VFR
identifiers and other bits and pieces using leading digits was making
me nervous about whether it is supported in all configurations, so I
bit the bullet and renamed everything.


>>  2 files changed, 138 insertions(+)

>>

>> diff --git a/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h

>> new file mode 100644

>> index 000000000000..7869ea979b48

>> --- /dev/null

>> +++ b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h

>> @@ -0,0 +1,71 @@

>> +/** @file

>> +

>> +  Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>

>> +

>> +  This program and the accompanying materials are licensed and made available

>> +  under the terms and conditions of the BSD License which accompanies this

>> +  distribution. The full text of the license may be found at

>> +  http://opensource.org/licenses/bsd-license.php

>> +

>> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,

>> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

>> +

>> +**/

>> +

>> +#ifndef _MEZZANINE_H_

>> +#define _MEZZANINE_H_

>

> Maybe do the fulle _96BOARDS_MEZZANINE_H_?

>


Sure

>> +

>> +#include <Pi/PiI2c.h>

>> +#include <Protocol/SpiConfiguration.h>

>> +

>> +#define MEZZANINE_PROTOCOL_GUID \

>> +  { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } }

>> +

>> +typedef struct _MEZZANINE_PROTOCOL MEZZANINE_PROTOCOL;

>> +

>> +/**

>> +  Apply the mezzanine's DT overlay

>> +

>> +  @param[in]      This      Pointer to the MEZZANINE_PROTOCOL instance.

>> +  @param[in,out]  Dtb       Pointer to the device tree blob

>> +

>> +  @return   EFI_SUCCESS     Operation succeeded.

>> +  @return   other           An error has occurred.

>> +**/

>> +typedef

>> +EFI_STATUS

>> +(EFIAPI *APPLY_DEVICE_TREE_OVERLAY) (

>> +  IN      MEZZANINE_PROTOCOL    *This,

>> +  IN  OUT VOID                  *Dtb

>> +  );

>> +

>> +struct _MEZZANINE_PROTOCOL {

>> +  //

>> +  // Get the device tree overlay for this mezzanine board

>> +  //

>> +  APPLY_DEVICE_TREE_OVERLAY   ApplyDeviceTreeOverlay;

>> +  //

>> +  // The number of devices on LS connector I2C bus #0

>> +  //

>> +  UINT32                      I2c0NumDevices;

>> +  //

>> +  // The number of devices on LS connector I2C bus #1

>> +  //

>> +  UINT32                      I2c1NumDevices;

>> +  //

>> +  // Linear array of I2C devices on LS connector bus #0

>> +  //

>> +  CONST EFI_I2C_DEVICE        *I2c0DeviceArray;

>> +  //

>> +  // Linear array of I2C devices on LS connector bus #0

>> +  //

>> +  CONST EFI_I2C_DEVICE        *I2c1DeviceArray;

>> +  //

>> +  // NULL terminated linked list of SPI devices attached to the LS connector

>> +  //

>> +  CONST EFI_SPI_PERIPHERAL    *SpiDeviceLinkedList;

>> +};

>> +

>> +extern EFI_GUID gNinetySixBoardsMezzanineProtocolGuid;

>> +

>> +#endif // _MEZZANINE_H_

>> diff --git a/Platform/NinetySixBoards/NinetySixBoards.dec b/Platform/NinetySixBoards/NinetySixBoards.dec

>> new file mode 100644

>> index 000000000000..f7e2b01459d7

>> --- /dev/null

>> +++ b/Platform/NinetySixBoards/NinetySixBoards.dec

>> @@ -0,0 +1,67 @@

>> +## @file

>> +#

>> +#  Copyright (c) 2018, Linaro Ltd. 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]

>> +  DEC_SPECIFICATION              = 0x0001001A

>> +  PACKAGE_NAME                   = NinetySixBoards

>> +  PACKAGE_GUID                   = ce4a4683-6e2d-4ec3-bc11-974289a09ab0

>> +  PACKAGE_VERSION                = 0.1

>> +

>> +[Includes]

>> +  Include

>> +

>> +[Protocols]

>> +  ## Include/Protocol/Mezzanine.h

>> +  gNinetySixBoardsMezzanineProtocolGuid = { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } }

>> +

>> +[Guids]

>> +  # PCD scope GUID

>> +  gNinetySixBoardsTokenSpaceGuid = { 0xe0d2f33a, 0xb7dd, 0x4a69, { 0xb6, 0x76, 0xda, 0xe8, 0xa4, 0x17, 0xa7, 0xb5 } }

>> +

>> +  # GUIDs to be installed as protocols to identify which controller connects to which bus

>> +  gNinetySixBoardsI2c0MasterGuid = { 0xba10e402, 0xcfdd, 0x4b87, { 0xbd, 0x02, 0x6e, 0x26, 0x9f, 0x01, 0x94, 0x11 } }

>> +  gNinetySixBoardsI2c1MasterGuid = { 0xcf64ac46, 0xd0be, 0x4a69, { 0x90, 0xa2, 0xf2, 0x82, 0x5b, 0x92, 0x25, 0x61 } }

>> +  gNinetySixBoardsSpiMasterGuid = { 0x9703fd99, 0xe638, 0x42b8, { 0xab, 0x81, 0x52, 0x61, 0x1b, 0xf7, 0xf7, 0x5d } }

>> +

>> +[PcdsFixedAtBuild]

>> +  # ASCII DT paths to the I2C parent nodes of the 96boards LS connector

>> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c0Parent|""|VOID*|0x00000001

>> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c1Parent|""|VOID*|0x00000002

>> +

>> +  # I2C bus frequency in Hertz

>> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c0BusFrequencyHz|0|UINT32|0x00000003

>> +  gNinetySixBoardsTokenSpaceGuid.PcdI2c1BusFrequencyHz|0|UINT32|0x00000004

>> +

>> +  # ASCII DT path to the SPI parent node of the 96boards LS connector

>> +  gNinetySixBoardsTokenSpaceGuid.PcdSpiParent|""|VOID*|0x00000005

>> +

>> +  # ASCII DT path to the GPIO parent node of the 96boards LS connector

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioParent|""|VOID*|0x00000006

>> +

>> +  # Polarity of the 96boards LS connector GPIOs (0 == GPIO_ACTIVE_HIGH, 1 == GPIO_ACTIVE_LOW)

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPolarity|0|UINT32|0x00000007

>> +

>> +  # Pin numbers of the 96boards LS connector GPIOs

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinA|0|UINT32|0x00000010

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinB|0|UINT32|0x00000011

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinC|0|UINT32|0x00000012

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinD|0|UINT32|0x00000013

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinE|0|UINT32|0x00000014

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinF|0|UINT32|0x00000015

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinG|0|UINT32|0x00000016

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinH|0|UINT32|0x00000017

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinI|0|UINT32|0x00000018

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinJ|0|UINT32|0x00000019

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinK|0|UINT32|0x0000001A

>> +  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinL|0|UINT32|0x0000001B

>> --

>> 2.11.0

>>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Leif Lindholm Feb. 22, 2018, 1:44 p.m. | #3
On Thu, Feb 22, 2018 at 01:21:37PM +0000, Ard Biesheuvel wrote:
> On 22 February 2018 at 13:15, Leif Lindholm <leif.lindholm@linaro.org> wrote:

> > On Tue, Feb 20, 2018 at 05:49:39PM +0000, Ard Biesheuvel wrote:

> >> Introduce the mezzanine protocol and the 96boards package defining

> >> the PCDs and GUIDs that may be used by implementations of the

> >> protocol.

> >

> > This looks really good. Comments below are all style related.

> >

> >> Contributed-under: TianoCore Contribution Agreement 1.1

> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> >> ---

> >>  Platform/NinetySixBoards/Include/Protocol/Mezzanine.h | 71 ++++++++++++++++++++

> >>  Platform/NinetySixBoards/NinetySixBoards.dec          | 67 ++++++++++++++++++

> >

> > Why NinetySixBoards? Is 96Boards ENOTENOUGHCAMEL?

> >

> 

> That is what I started out with, but having CPP macros and lots of VFR

> identifiers and other bits and pieces using leading digits was making

> me nervous about whether it is supported in all configurations, so I

> bit the bullet and renamed everything.


I understand the paranoia, but we do have
PcAtChipsetPkg/8259InterruptControllerDxe
and
PcAtChipsetPkg/8254TimerDxe
so I would expect this to actually be reasonably well supported.

We may not have to worry about 3com and 3ware anymore, but if someone
wants to write drivers for ancient cards, I'd still prefer to be able
to give them predictable paths.

/
    Leif
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Feb. 22, 2018, 3:13 p.m. | #4
On 22 February 2018 at 13:44, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Thu, Feb 22, 2018 at 01:21:37PM +0000, Ard Biesheuvel wrote:

>> On 22 February 2018 at 13:15, Leif Lindholm <leif.lindholm@linaro.org> wrote:

>> > On Tue, Feb 20, 2018 at 05:49:39PM +0000, Ard Biesheuvel wrote:

>> >> Introduce the mezzanine protocol and the 96boards package defining

>> >> the PCDs and GUIDs that may be used by implementations of the

>> >> protocol.

>> >

>> > This looks really good. Comments below are all style related.

>> >

>> >> Contributed-under: TianoCore Contribution Agreement 1.1

>> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>> >> ---

>> >>  Platform/NinetySixBoards/Include/Protocol/Mezzanine.h | 71 ++++++++++++++++++++

>> >>  Platform/NinetySixBoards/NinetySixBoards.dec          | 67 ++++++++++++++++++

>> >

>> > Why NinetySixBoards? Is 96Boards ENOTENOUGHCAMEL?

>> >

>>

>> That is what I started out with, but having CPP macros and lots of VFR

>> identifiers and other bits and pieces using leading digits was making

>> me nervous about whether it is supported in all configurations, so I

>> bit the bullet and renamed everything.

>

> I understand the paranoia, but we do have

> PcAtChipsetPkg/8259InterruptControllerDxe

> and

> PcAtChipsetPkg/8254TimerDxe

> so I would expect this to actually be reasonably well supported.

>

> We may not have to worry about 3com and 3ware anymore, but if someone

> wants to write drivers for ancient cards, I'd still prefer to be able

> to give them predictable paths.

>


Fair enough, I'll change it back.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch

diff --git a/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h
new file mode 100644
index 000000000000..7869ea979b48
--- /dev/null
+++ b/Platform/NinetySixBoards/Include/Protocol/Mezzanine.h
@@ -0,0 +1,71 @@ 
+/** @file
+
+  Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution. The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _MEZZANINE_H_
+#define _MEZZANINE_H_
+
+#include <Pi/PiI2c.h>
+#include <Protocol/SpiConfiguration.h>
+
+#define MEZZANINE_PROTOCOL_GUID \
+  { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } }
+
+typedef struct _MEZZANINE_PROTOCOL MEZZANINE_PROTOCOL;
+
+/**
+  Apply the mezzanine's DT overlay
+
+  @param[in]      This      Pointer to the MEZZANINE_PROTOCOL instance.
+  @param[in,out]  Dtb       Pointer to the device tree blob
+
+  @return   EFI_SUCCESS     Operation succeeded.
+  @return   other           An error has occurred.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *APPLY_DEVICE_TREE_OVERLAY) (
+  IN      MEZZANINE_PROTOCOL    *This,
+  IN  OUT VOID                  *Dtb
+  );
+
+struct _MEZZANINE_PROTOCOL {
+  //
+  // Get the device tree overlay for this mezzanine board
+  //
+  APPLY_DEVICE_TREE_OVERLAY   ApplyDeviceTreeOverlay;
+  //
+  // The number of devices on LS connector I2C bus #0
+  //
+  UINT32                      I2c0NumDevices;
+  //
+  // The number of devices on LS connector I2C bus #1
+  //
+  UINT32                      I2c1NumDevices;
+  //
+  // Linear array of I2C devices on LS connector bus #0
+  //
+  CONST EFI_I2C_DEVICE        *I2c0DeviceArray;
+  //
+  // Linear array of I2C devices on LS connector bus #0
+  //
+  CONST EFI_I2C_DEVICE        *I2c1DeviceArray;
+  //
+  // NULL terminated linked list of SPI devices attached to the LS connector
+  //
+  CONST EFI_SPI_PERIPHERAL    *SpiDeviceLinkedList;
+};
+
+extern EFI_GUID gNinetySixBoardsMezzanineProtocolGuid;
+
+#endif // _MEZZANINE_H_
diff --git a/Platform/NinetySixBoards/NinetySixBoards.dec b/Platform/NinetySixBoards/NinetySixBoards.dec
new file mode 100644
index 000000000000..f7e2b01459d7
--- /dev/null
+++ b/Platform/NinetySixBoards/NinetySixBoards.dec
@@ -0,0 +1,67 @@ 
+## @file
+#
+#  Copyright (c) 2018, Linaro Ltd. 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]
+  DEC_SPECIFICATION              = 0x0001001A
+  PACKAGE_NAME                   = NinetySixBoards
+  PACKAGE_GUID                   = ce4a4683-6e2d-4ec3-bc11-974289a09ab0
+  PACKAGE_VERSION                = 0.1
+
+[Includes]
+  Include
+
+[Protocols]
+  ## Include/Protocol/Mezzanine.h
+  gNinetySixBoardsMezzanineProtocolGuid = { 0xf0467a37, 0x3436, 0x40ef, { 0x94, 0x09, 0x4d, 0x1d, 0x7f, 0x51, 0x06, 0xd3 } }
+
+[Guids]
+  # PCD scope GUID
+  gNinetySixBoardsTokenSpaceGuid = { 0xe0d2f33a, 0xb7dd, 0x4a69, { 0xb6, 0x76, 0xda, 0xe8, 0xa4, 0x17, 0xa7, 0xb5 } }
+
+  # GUIDs to be installed as protocols to identify which controller connects to which bus
+  gNinetySixBoardsI2c0MasterGuid = { 0xba10e402, 0xcfdd, 0x4b87, { 0xbd, 0x02, 0x6e, 0x26, 0x9f, 0x01, 0x94, 0x11 } }
+  gNinetySixBoardsI2c1MasterGuid = { 0xcf64ac46, 0xd0be, 0x4a69, { 0x90, 0xa2, 0xf2, 0x82, 0x5b, 0x92, 0x25, 0x61 } }
+  gNinetySixBoardsSpiMasterGuid = { 0x9703fd99, 0xe638, 0x42b8, { 0xab, 0x81, 0x52, 0x61, 0x1b, 0xf7, 0xf7, 0x5d } }
+
+[PcdsFixedAtBuild]
+  # ASCII DT paths to the I2C parent nodes of the 96boards LS connector
+  gNinetySixBoardsTokenSpaceGuid.PcdI2c0Parent|""|VOID*|0x00000001
+  gNinetySixBoardsTokenSpaceGuid.PcdI2c1Parent|""|VOID*|0x00000002
+
+  # I2C bus frequency in Hertz
+  gNinetySixBoardsTokenSpaceGuid.PcdI2c0BusFrequencyHz|0|UINT32|0x00000003
+  gNinetySixBoardsTokenSpaceGuid.PcdI2c1BusFrequencyHz|0|UINT32|0x00000004
+
+  # ASCII DT path to the SPI parent node of the 96boards LS connector
+  gNinetySixBoardsTokenSpaceGuid.PcdSpiParent|""|VOID*|0x00000005
+
+  # ASCII DT path to the GPIO parent node of the 96boards LS connector
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioParent|""|VOID*|0x00000006
+
+  # Polarity of the 96boards LS connector GPIOs (0 == GPIO_ACTIVE_HIGH, 1 == GPIO_ACTIVE_LOW)
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPolarity|0|UINT32|0x00000007
+
+  # Pin numbers of the 96boards LS connector GPIOs
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinA|0|UINT32|0x00000010
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinB|0|UINT32|0x00000011
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinC|0|UINT32|0x00000012
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinD|0|UINT32|0x00000013
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinE|0|UINT32|0x00000014
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinF|0|UINT32|0x00000015
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinG|0|UINT32|0x00000016
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinH|0|UINT32|0x00000017
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinI|0|UINT32|0x00000018
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinJ|0|UINT32|0x00000019
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinK|0|UINT32|0x0000001A
+  gNinetySixBoardsTokenSpaceGuid.PcdGpioPinL|0|UINT32|0x0000001B