As a follow up to the changes proposed by Laszlo to make ACPI and DT
mutually exclusive on ArmVirtQemu, this patch proposes a DT platform
DXE driver that either installs the NULL protocol PlatformHasAcpiGuid,
or installs the FV embedded DTB binary as a configuration table under
the appropriate GUID, depending on a preference setting recorded as
a UEFI variable, and configurable via a HII screen.
The DTB binary can be embedded in the firmware image by adding the
following to the platform .fdf file:
  FILE FREEFORM = 25462CDA-221F-47DF-AC1D-259CFAA4E326 {
    SECTION RAW = SomePkg/path/to/foo.dtb
  }
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			897 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			897 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /** @file
 | |
| *
 | |
| *  Copyright (c) 2017, Linaro 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 __DT_PLATFORM_DXE_H__
 | |
| #define __DT_PLATFORM_DXE_H__
 | |
| 
 | |
| #include <Guid/HiiPlatformSetupFormset.h>
 | |
| #include <Guid/DtPlatformFormSet.h>
 | |
| 
 | |
| #define DT_ACPI_SELECT_DT       0x0
 | |
| #define DT_ACPI_SELECT_ACPI     0x1
 | |
| 
 | |
| #define DT_ACPI_VARIABLE_NAME   L"DtAcpiPref"
 | |
| 
 | |
| typedef struct {
 | |
|   UINT8         Pref;
 | |
|   UINT8         Reserved[3];
 | |
| } DT_ACPI_VARSTORE_DATA;
 | |
| 
 | |
| #endif
 |