Skip to content

Commit

Permalink
Platforms/HiKey: enable more driver
Browse files Browse the repository at this point in the history
Enable MMC, USB, platform GPIO, platform fastboot and platform
driver on HiKey platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <[email protected]>
  • Loading branch information
hzhuang1 committed Jan 13, 2016
1 parent 2046537 commit 83e1194
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 10 deletions.
8 changes: 8 additions & 0 deletions Platforms/Hisilicon/HiKey/HiKey.dec
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@
Include # Root include for the package

[Guids.common]
gArmPL061GpioGuid = { 0x5c1997d7, 0x8d45, 0x4f21, { 0xaf, 0x3c, 0x22, 0x06, 0xb8, 0xed, 0x8b, 0xec } }
gDwUsbDeviceGuid = { 0x72d78ea6, 0x4dee, 0x11e3, { 0x81, 0x00, 0xf3, 0x84, 0x2a, 0x48, 0xd0, 0xa0 } }
gFaultTolerantWriteGuid = { 0xfe5cea76, 0x4f72, 0x49e8, { 0x98, 0x6f, 0x2c, 0xd8, 0x99, 0xdf, 0xfe, 0x5d } }
gHiKeyTokenSpaceGuid = { 0x91148425, 0xcdd2, 0x4830, { 0x8b, 0xd0, 0xc6, 0x1c, 0x6d, 0xea, 0x36, 0x21 } }
gHiKeyVariableGuid = { 0x66b8d063, 0x1daa, 0x4c60, { 0xb9, 0xf2, 0x55, 0x0d, 0x7e, 0xe1, 0x2f, 0x38 } }

[PcdsFixedAtBuild.common]
gHiKeyTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|L""|VOID*|0x00000001
gHiKeyTokenSpaceGuid.PcdArmFastbootFlashLimit|L""|VOID*|0x00000002
73 changes: 64 additions & 9 deletions Platforms/Hisilicon/HiKey/HiKey.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf

[BuildOptions]
GCC:*_*_*_PLATFORM_FLAGS == -I$(WORKSPACE)/MdeModulePkg/Include -I$(WORKSPACE)/OpenPlatformPkg/Platforms/Hisilicon/HiKey/Include
GCC:*_*_*_PLATFORM_FLAGS == -I$(WORKSPACE)/MdeModulePkg/Include -I$(WORKSPACE)/OpenPlatformPkg/Include -I$(WORKSPACE)/OpenPlatformPkg/Chips/Hisilicon/Hi6220/Include -I$(WORKSPACE)/OpenPlatformPkg/Platforms/Hisilicon/HiKey/Include

[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
GCC:*_*_ARM_DLINK_FLAGS = -z common-page-size=0x1000
Expand Down Expand Up @@ -253,6 +253,20 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Alpha"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"HiKey"

#
# NV Storage PCDs.
#
gBlockVariableDxeTokenSpaceGuid.PcdNvStorageVariableBlockCount|0x00001000
gBlockVariableDxeTokenSpaceGuid.PcdNvStorageVariableBlockSize|0x00000200
gBlockVariableDxeTokenSpaceGuid.PcdNvStorageVariableBlockLba|0x00006000
gBlockVariableDxeTokenSpaceGuid.PcdNvStorageVariableBlockDevicePath|L"VenHw(B549F005-4BD4-4020-A0CB-06F42BDA68C3)/HD(5,GPT,00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43)"
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x30000000
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x00010000
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x30010000
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x00010000
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x30020000
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00010000

# System Memory (1GB)
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x00000000
gArmTokenSpaceGuid.PcdSystemMemorySize|0x3E000000
Expand Down Expand Up @@ -288,13 +302,6 @@
gArmTokenSpaceGuid.PcdGicDistributorBase|0xF6801000
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0xF6802000

#
# ARM OS Loader
#
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"Linux from eMMC"
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(B549F005-4BD4-4020-A0CB-06F42BDA68C3)/HD(6,GPT,5C0F213C-17E1-4149-88C8-8B50FB4EC70E,0x7000,0x20000)/Image"
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|L"dtb=hi6220-hikey.dtb console=ttyAMA3,115200 earlycon=pl011,0xf7113000 root=/dev/disk/by-partlabel/system rw rootwait efi=noruntime"

# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();VenHw(CE660500-824D-11E0-AC72-0002A5D5C51B)"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"
Expand All @@ -308,6 +315,27 @@
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|10000
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|10000 # expressed in 100ns units, 10,000 x 100 ns = 1,000,000 ns = 1 ms

#
# DW MMC/SD card controller
#
gDwEmmcDxeTokenSpaceGuid.PcdDwEmmcDxeBaseAddress|0xF723D000
gDwEmmcDxeTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz|100000000
gDwSdDxeTokenSpaceGuid.PcdDwSdDxeBaseAddress|0xF723E000
gDwSdDxeTokenSpaceGuid.PcdDwSdDxeClockFrequencyInHz|24000000

#
# DW USB controller
#
gDwUsbDxeTokenSpaceGuid.PcdDwUsbDxeBaseAddress|0xF72C0000

#
# Fastboot
#
gEmbeddedTokenSpaceGuid.PcdAndroidFastbootUsbVendorId|0x18d1
gEmbeddedTokenSpaceGuid.PcdAndroidFastbootUsbProductId|0xd00d
gHiKeyTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|L"VenHw(b549f005-4bd4-4020-a0cb-06f42bda68c3)"
gHiKeyTokenSpaceGuid.PcdArmFastbootFlashLimit|"524288000"

[PcdsDynamicDefault.common]
#
# The size of a dynamic PCD of the (VOID*) type can not be increased at run
Expand Down Expand Up @@ -354,8 +382,15 @@
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
<LibraryClasses>
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
}
OpenPlatformPkg/Drivers/Variable/BlockVariableDxe/BlockVariableDxe.inf
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
Expand All @@ -368,21 +403,26 @@
# GPIO
#
ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf
OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKeyGpio/HiKeyGpio.inf
#
# MMC/SD
#
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
OpenPlatformPkg/Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.inf
OpenPlatformPkg/Drivers/Mmc/DwSdDxe/DwSdDxe.inf
#
# USB
#
EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
OpenPlatformPkg/Drivers/Usb/DwUsbDxe/DwUsbDxe.inf
#
# Fastboot
#
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf
OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastbootDxe.inf
#
# FAT filesystem + GPT/MBR partitioning
Expand All @@ -396,3 +436,18 @@
#
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
ArmPlatformPkg/Bds/Bds.inf
#
# Legacy Linux Loader
#
ArmPkg/Application/LinuxLoader/LinuxLoader.inf {
<LibraryClasses>
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
}
#
# HiKey Platform
#
OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKeyDxe/HiKeyDxe.inf
23 changes: 22 additions & 1 deletion Platforms/Hisilicon/HiKey/HiKey.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,26 @@ READ_LOCK_STATUS = TRUE
# GPIO
#
INF ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf
INF OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKeyGpio/HiKeyGpio.inf

#
# Multimedia Card Interface
#
INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
INF OpenPlatformPkg/Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.inf
INF OpenPlatformPkg/Drivers/Mmc/DwSdDxe/DwSdDxe.inf

#
# USB
#
INF EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
INF OpenPlatformPkg/Drivers/Usb/DwUsbDxe/DwUsbDxe.inf

#
# Fastboot
#
INF EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf
INF OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKeyFastbootDxe/HiKeyFastbootDxe.inf

#
# FAT filesystem + GPT/MBR partitioning
Expand All @@ -135,8 +145,9 @@ READ_LOCK_STATUS = TRUE
INF FatBinPkg/EnhancedFatDxe/Fat.inf
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf

INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
INF OpenPlatformPkg/Drivers/Variable/BlockVariableDxe/BlockVariableDxe.inf

INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf

Expand All @@ -151,6 +162,16 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
INF ArmPlatformPkg/Bds/Bds.inf

#
# Legacy Linux Loader
#
INF ArmPkg/Application/LinuxLoader/LinuxLoader.inf

#
# HiKey Platform
#
INF OpenPlatformPkg/Platforms/Hisilicon/HiKey/HiKeyDxe/HiKeyDxe.inf

[FV.FVMAIN_COMPACT]
FvAlignment = 8
ERASE_POLARITY = 1
Expand Down

0 comments on commit 83e1194

Please sign in to comment.