Home | History | Annotate | Download | only in HiKey960
      1 #
      2 #  Copyright (c) 2016-2017, Linaro Limited. All rights reserved.
      3 #
      4 #  This program and the accompanying materials
      5 #  are licensed and made available under the terms and conditions of the BSD License
      6 #  which accompanies this distribution.  The full text of the license may be found at
      7 #  http://opensource.org/licenses/bsd-license.php
      8 #
      9 #  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 #
     12 
     13 ################################################################################
     14 #
     15 # FD Section
     16 # The [FD] Section is made up of the definition statements and a
     17 # description of what goes into  the Flash Device Image.  Each FD section
     18 # defines one flash "device" image.  A flash device image may be one of
     19 # the following: Removable media bootable image (like a boot floppy
     20 # image,) an Option ROM image (that would be "flashed" into an add-in
     21 # card,) a System "Flash"  image (that would be burned into a system's
     22 # flash) or an Update ("Capsule") image that will be used to update and
     23 # existing system flash.
     24 #
     25 ################################################################################
     26 
     27 [FD.BL33_AP_UEFI]
     28 BaseAddress   = 0x1AC98000|gArmTokenSpaceGuid.PcdFdBaseAddress  # The base address of the Firmware in NOR Flash.
     29 Size          = 0x000F0000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the FLASH Device
     30 ErasePolarity = 1
     31 
     32 # This one is tricky, it must be: BlockSize * NumBlocks = Size
     33 BlockSize     = 0x00001000
     34 NumBlocks     = 0xF0
     35 
     36 ################################################################################
     37 #
     38 # Following are lists of FD Region layout which correspond to the locations of different
     39 # images within the flash device.
     40 #
     41 # Regions must be defined in ascending order and may not overlap.
     42 #
     43 # A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
     44 # the pipe "|" character, followed by the size of the region, also in hex with the leading
     45 # "0x" characters. Like:
     46 # Offset|Size
     47 # PcdOffsetCName|PcdSizeCName
     48 # RegionType <FV, DATA, or FILE>
     49 #
     50 ################################################################################
     51 
     52 0x00000000|0x000F0000
     53 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
     54 FV = FVMAIN_COMPACT
     55 
     56 
     57 ################################################################################
     58 #
     59 # FV Section
     60 #
     61 # [FV] section is used to define what components or modules are placed within a flash
     62 # device file.  This section also defines order the components and modules are positioned
     63 # within the image.  The [FV] section consists of define statements, set statements and
     64 # module statements.
     65 #
     66 ################################################################################
     67 
     68 [FV.FvMain]
     69 BlockSize          = 0x40
     70 NumBlocks          = 0         # This FV gets compressed so make it just big enough
     71 FvAlignment        = 8         # FV alignment and FV attributes setting.
     72 ERASE_POLARITY     = 1
     73 MEMORY_MAPPED      = TRUE
     74 STICKY_WRITE       = TRUE
     75 LOCK_CAP           = TRUE
     76 LOCK_STATUS        = TRUE
     77 WRITE_DISABLED_CAP = TRUE
     78 WRITE_ENABLED_CAP  = TRUE
     79 WRITE_STATUS       = TRUE
     80 WRITE_LOCK_CAP     = TRUE
     81 WRITE_LOCK_STATUS  = TRUE
     82 READ_DISABLED_CAP  = TRUE
     83 READ_ENABLED_CAP   = TRUE
     84 READ_STATUS        = TRUE
     85 READ_LOCK_CAP      = TRUE
     86 READ_LOCK_STATUS   = TRUE
     87 
     88   INF MdeModulePkg/Core/Dxe/DxeMain.inf
     89 
     90   #
     91   # PI DXE Drivers producing Architectural Protocols (EFI Services)
     92   #
     93   INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
     94   INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
     95   INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
     96   INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
     97   INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
     98   INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
     99   INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
    100   INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
    101   INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
    102 
    103   #
    104   # Multiple Console IO support
    105   #
    106   INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
    107   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
    108   INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
    109 
    110   INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
    111   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
    112 
    113   INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
    114 
    115   #
    116   # GPIO
    117   #
    118   INF OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960GpioDxe/HiKey960GpioDxe.inf
    119   INF ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf
    120 
    121   #
    122   # Virtual Keyboard
    123   #
    124   INF OpenPlatformPkg/Drivers/Keyboard/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
    125 
    126   #
    127   # MMC/SD
    128   #
    129   INF OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960MmcDxe/HiKey960MmcDxe.inf
    130   INF MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf
    131   INF OpenPlatformPkg/Drivers/SdMmc/DwMmcHcDxe/DwMmcHcDxe.inf
    132   INF MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf
    133 
    134   INF OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960Dxe/HiKey960Dxe.inf
    135 
    136   #
    137   # UEFI Network Stack
    138   #
    139   INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
    140   INF MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
    141   INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
    142   INF MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
    143   INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
    144   INF MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
    145   INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
    146   INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
    147   INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
    148 
    149   #
    150   # AX88772 Ethernet Driver for Apple Ethernet Adapter
    151   #
    152   INF OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/Ax88772b.inf
    153 
    154   INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
    155   INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
    156 
    157   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
    158 
    159   #
    160   # Ufs
    161   #
    162   INF OpenPlatformPkg/Drivers/Block/DwUfsHcDxe/DwUfsHcDxe.inf
    163   INF MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruDxe.inf
    164   INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
    165   INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
    166 
    167   #
    168   # FAT filesystem + GPT/MBR partitioning
    169   #
    170   INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
    171   INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
    172   INF FatBinPkg/EnhancedFatDxe/Fat.inf
    173   INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
    174 
    175   #
    176   # USB Host Support
    177   #
    178   INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
    179 
    180   #
    181   # USB Mass Storage Support
    182   #
    183   INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
    184 
    185   #
    186   # USB Peripheral Support
    187   #
    188   INF OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf
    189   INF OpenPlatformPkg/Drivers/Usb/DwUsb3Dxe/DwUsb3Dxe.inf
    190   INF OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf
    191   INF EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
    192 
    193   #
    194   # Fastboot
    195   #
    196   INF EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf
    197 
    198   #
    199   # Android Loader
    200   #
    201   INF EmbeddedPkg/Application/AndroidBoot/AndroidBootApp.inf
    202 
    203   #
    204   # UEFI applications
    205   #
    206   INF ShellPkg/Application/Shell/Shell.inf
    207 
    208 
    209   #
    210   # Bds
    211   #
    212   INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
    213   INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
    214   INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
    215   INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
    216   INF MdeModulePkg/Application/UiApp/UiApp.inf
    217 
    218   # add Device Tree to the Firmware Volume
    219   INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
    220   FILE FREEFORM = 25462CDA-221F-47DF-AC1D-259CFAA4E326 {
    221     SECTION RAW = OpenPlatformPkg/Platforms/Hisilicon/DeviceTree/hi3660-hikey960.dtb
    222   }
    223 
    224 
    225 [FV.FVMAIN_COMPACT]
    226 FvAlignment        = 8
    227 ERASE_POLARITY     = 1
    228 MEMORY_MAPPED      = TRUE
    229 STICKY_WRITE       = TRUE
    230 LOCK_CAP           = TRUE
    231 LOCK_STATUS        = TRUE
    232 WRITE_DISABLED_CAP = TRUE
    233 WRITE_ENABLED_CAP  = TRUE
    234 WRITE_STATUS       = TRUE
    235 WRITE_LOCK_CAP     = TRUE
    236 WRITE_LOCK_STATUS  = TRUE
    237 READ_DISABLED_CAP  = TRUE
    238 READ_ENABLED_CAP   = TRUE
    239 READ_STATUS        = TRUE
    240 READ_LOCK_CAP      = TRUE
    241 READ_LOCK_STATUS   = TRUE
    242 
    243   INF ArmPlatformPkg/PrePi/PeiUniCore.inf
    244 
    245   FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
    246     SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
    247       SECTION FV_IMAGE = FVMAIN
    248     }
    249   }
    250 
    251 
    252 ################################################################################
    253 #
    254 # Rules are use with the [FV] section's module INF type to define
    255 # how an FFS file is created for a given INF file. The following Rule are the default
    256 # rules for the different module type. User can add the customized rules to define the
    257 # content of the FFS file.
    258 #
    259 ################################################################################
    260 
    261 
    262 ############################################################################
    263 # Example of a DXE_DRIVER FFS file with a Checksum encapsulation section   #
    264 ############################################################################
    265 #
    266 #[Rule.Common.DXE_DRIVER]
    267 #  FILE DRIVER = $(NAMED_GUID) {
    268 #    DXE_DEPEX    DXE_DEPEX               Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
    269 #    COMPRESS PI_STD {
    270 #      GUIDED {
    271 #        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi
    272 #        UI       STRING="$(MODULE_NAME)" Optional
    273 #        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
    274 #      }
    275 #    }
    276 #  }
    277 #
    278 ############################################################################
    279 
    280 #
    281 # These SEC rules are used for ArmPlatformPkg/PrePi module.
    282 # ArmPlatformPkg/PrePi is declared as a SEC module to make GenFv patch the
    283 # UEFI Firmware to jump to ArmPlatformPkg/PrePi entrypoint
    284 #
    285 [Rule.ARM.SEC]
    286   FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
    287     TE  TE    Align = 32                $(INF_OUTPUT)/$(MODULE_NAME).efi
    288   }
    289 
    290 [Rule.AARCH64.SEC]
    291   FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
    292     TE  TE    Align = 4K                $(INF_OUTPUT)/$(MODULE_NAME).efi
    293   }
    294 
    295 # A shim specific rule is required to ensure the alignment is 4K.
    296 # Otherwise BaseTools pick up the AArch32 alignment (ie: 32)
    297 [Rule.ARM.SEC.SHIM]
    298   FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
    299     TE  TE    Align = 4K                $(INF_OUTPUT)/$(MODULE_NAME).efi
    300   }
    301 
    302 [Rule.Common.PEI_CORE]
    303   FILE PEI_CORE = $(NAMED_GUID) {
    304     TE     TE                           $(INF_OUTPUT)/$(MODULE_NAME).efi
    305     UI     STRING ="$(MODULE_NAME)" Optional
    306   }
    307 
    308 [Rule.Common.PEIM]
    309   FILE PEIM = $(NAMED_GUID) {
    310      PEI_DEPEX PEI_DEPEX Optional       $(INF_OUTPUT)/$(MODULE_NAME).depex
    311      TE       TE                        $(INF_OUTPUT)/$(MODULE_NAME).efi
    312      UI       STRING="$(MODULE_NAME)" Optional
    313   }
    314 
    315 [Rule.Common.PEIM.TIANOCOMPRESSED]
    316   FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 {
    317     PEI_DEPEX PEI_DEPEX Optional        $(INF_OUTPUT)/$(MODULE_NAME).depex
    318     GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {
    319       PE32      PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi
    320       UI        STRING="$(MODULE_NAME)" Optional
    321     }
    322   }
    323 
    324 [Rule.Common.DXE_CORE]
    325   FILE DXE_CORE = $(NAMED_GUID) {
    326     PE32     PE32                       $(INF_OUTPUT)/$(MODULE_NAME).efi
    327     UI       STRING="$(MODULE_NAME)" Optional
    328   }
    329 
    330 [Rule.Common.UEFI_DRIVER]
    331   FILE DRIVER = $(NAMED_GUID) {
    332     DXE_DEPEX    DXE_DEPEX              Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
    333     PE32         PE32                   $(INF_OUTPUT)/$(MODULE_NAME).efi
    334     UI           STRING="$(MODULE_NAME)" Optional
    335   }
    336 
    337 [Rule.Common.DXE_DRIVER]
    338   FILE DRIVER = $(NAMED_GUID) {
    339     DXE_DEPEX    DXE_DEPEX              Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
    340     PE32         PE32                   $(INF_OUTPUT)/$(MODULE_NAME).efi
    341     UI           STRING="$(MODULE_NAME)" Optional
    342   }
    343 
    344 [Rule.Common.DXE_DRIVER.BINARY]
    345   FILE DRIVER = $(NAMED_GUID) {
    346   DXE_DEPEX    DXE_DEPEX              Optional |.depex
    347   PE32         PE32                   |.efi
    348   UI           STRING="$(MODULE_NAME)" Optional
    349   }
    350 
    351 [Rule.Common.DXE_RUNTIME_DRIVER]
    352   FILE DRIVER = $(NAMED_GUID) {
    353     DXE_DEPEX    DXE_DEPEX              Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
    354     PE32         PE32                   $(INF_OUTPUT)/$(MODULE_NAME).efi
    355     UI           STRING="$(MODULE_NAME)" Optional
    356   }
    357 
    358 [Rule.Common.UEFI_APPLICATION]
    359   FILE APPLICATION = $(NAMED_GUID) {
    360     UI     STRING ="$(MODULE_NAME)" Optional
    361     PE32   PE32                         $(INF_OUTPUT)/$(MODULE_NAME).efi
    362   }
    363 
    364 [Rule.Common.UEFI_DRIVER.BINARY]
    365   FILE DRIVER = $(NAMED_GUID) {
    366     DXE_DEPEX DXE_DEPEX Optional      |.depex
    367     PE32      PE32                    |.efi
    368     UI        STRING="$(MODULE_NAME)" Optional
    369     VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
    370   }
    371 
    372 [Rule.Common.UEFI_APPLICATION.BINARY]
    373   FILE APPLICATION = $(NAMED_GUID) {
    374     PE32      PE32                    |.efi
    375     UI        STRING="$(MODULE_NAME)" Optional
    376     VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
    377   }
    378 
    379 [Rule.Common.USER_DEFINED.ACPITABLE]
    380   FILE FREEFORM = $(NAMED_GUID) {
    381     RAW ACPI               |.acpi
    382     RAW ASL                |.aml
    383   }
    384