Armada70x0DbBoardDescLib.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. *
  3. * Copyright (C) 2018, Marvell International Ltd. and its affiliates.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause-Patent
  6. *
  7. **/
  8. #include <Uefi.h>
  9. #include <Library/ArmadaBoardDescLib.h>
  10. #include <Library/BaseMemoryLib.h>
  11. #include <Library/DebugLib.h>
  12. #include <Library/IoLib.h>
  13. #include <Library/MemoryAllocationLib.h>
  14. #include <Library/MvGpioLib.h>
  15. #include <Library/UefiBootServicesTableLib.h>
  16. //
  17. // GPIO Expander
  18. //
  19. STATIC MV_GPIO_EXPANDER mGpioExpander = {
  20. PCA9555_ID,
  21. 0x21,
  22. 0x0,
  23. };
  24. EFI_STATUS
  25. EFIAPI
  26. ArmadaBoardGpioExpanderGet (
  27. IN OUT MV_GPIO_EXPANDER **GpioExpanders,
  28. IN OUT UINTN *GpioExpanderCount
  29. )
  30. {
  31. *GpioExpanderCount = 1;
  32. *GpioExpanders = &mGpioExpander;
  33. return EFI_SUCCESS;
  34. }
  35. //
  36. // Order of devices in SdMmcDescTemplate has to be in par with ArmadaSoCDescLib
  37. //
  38. STATIC
  39. MV_BOARD_SDMMC_DESC mSdMmcDescTemplate[] = {
  40. { /* eMMC 0xF06E0000 */
  41. 0, /* SOC will be filled by MvBoardDescDxe */
  42. 0, /* SdMmcDevCount will be filled by MvBoardDescDxe */
  43. FALSE, /* Xenon1v8Enabled */
  44. FALSE, /* Xenon8BitBusEnabled */
  45. TRUE, /* XenonSlowModeEnabled */
  46. 0x40, /* XenonTuningStepDivisor */
  47. EmbeddedSlot /* SlotType */
  48. },
  49. { /* SD/MMC 0xF2780000 */
  50. 0, /* SOC will be filled by MvBoardDescDxe */
  51. 0, /* SdMmcDevCount will be filled by MvBoardDescDxe */
  52. FALSE, /* Xenon1v8Enabled */
  53. FALSE, /* Xenon8BitBusEnabled */
  54. FALSE, /* XenonSlowModeEnabled */
  55. 0x19, /* XenonTuningStepDivisor */
  56. EmbeddedSlot /* SlotType */
  57. }
  58. };
  59. EFI_STATUS
  60. EFIAPI
  61. ArmadaBoardDescSdMmcGet (
  62. OUT UINTN *SdMmcDevCount,
  63. OUT MV_BOARD_SDMMC_DESC **SdMmcDesc
  64. )
  65. {
  66. *SdMmcDesc = mSdMmcDescTemplate;
  67. *SdMmcDevCount = ARRAY_SIZE (mSdMmcDescTemplate);
  68. return EFI_SUCCESS;
  69. }