1
0

rpi2fw.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. rpi2fw.h
  5. Abstract:
  6. This header contains internal definitions for the UEFI Raspberry Pi 2
  7. firmware.
  8. Author:
  9. Chris Stevens 19-Mar-2015
  10. --*/
  11. //
  12. // ------------------------------------------------------------------- Includes
  13. //
  14. #include <dev/bcm2709.h>
  15. //
  16. // --------------------------------------------------------------------- Macros
  17. //
  18. //
  19. // ---------------------------------------------------------------- Definitions
  20. //
  21. //
  22. // Based on the Raspberry Pi 2's APB clock frequency of 250MHz, a predivider
  23. // value of 0xF9 can be used to achieve the target clock frequency of 1MHz.
  24. //
  25. #define RASPBERRY_PI_2_BCM2836_APB_CLOCK_FREQUENCY 250000000
  26. #define RASPBERRY_PI_2_BCM2836_TIMER_PREDIVIDER_VALUE 0xF9
  27. //
  28. // ------------------------------------------------------ Data Type Definitions
  29. //
  30. //
  31. // -------------------------------------------------------------------- Globals
  32. //
  33. //
  34. // -------------------------------------------------------- Function Prototypes
  35. //
  36. EFI_STATUS
  37. EfipEnumerateRamDisks (
  38. VOID
  39. );
  40. /*++
  41. Routine Description:
  42. This routine enumerates any RAM disks embedded in the firmware.
  43. Arguments:
  44. None.
  45. Return Value:
  46. EFI Status code.
  47. --*/
  48. EFI_STATUS
  49. EfipPlatformSetInterruptLineState (
  50. UINT32 LineNumber,
  51. BOOLEAN Enabled,
  52. BOOLEAN EdgeTriggered
  53. );
  54. /*++
  55. Routine Description:
  56. This routine enables or disables an interrupt line.
  57. Arguments:
  58. LineNumber - Supplies the line number to enable or disable.
  59. Enabled - Supplies a boolean indicating if the line should be enabled or
  60. disabled.
  61. EdgeTriggered - Supplies a boolean indicating if the interrupt is edge
  62. triggered (TRUE) or level triggered (FALSE).
  63. Return Value:
  64. EFI Status code.
  65. --*/
  66. EFI_STATUS
  67. EfipRpi2CreateSmbiosTables (
  68. VOID
  69. );
  70. /*++
  71. Routine Description:
  72. This routine creates the SMBIOS tables.
  73. Arguments:
  74. None.
  75. Return Value:
  76. EFI Status code.
  77. --*/
  78. EFI_STATUS
  79. EfipBcm2836SmpInitialize (
  80. UINT32 Phase
  81. );
  82. /*++
  83. Routine Description:
  84. This routine initializes and parks the application processors on the
  85. BCM2836.
  86. Arguments:
  87. Phase - Supplies the iteration number this routine is being called on.
  88. Phase zero occurs very early, just after the debugger comes up.
  89. Phase one occurs a bit later, after timer, interrupt services, and the
  90. memory core are initialized.
  91. Return Value:
  92. EFI status code.
  93. --*/
  94. //
  95. // Runtime functions.
  96. //
  97. EFIAPI
  98. VOID
  99. EfipBcm2836ResetSystem (
  100. EFI_RESET_TYPE ResetType,
  101. EFI_STATUS ResetStatus,
  102. UINTN DataSize,
  103. VOID *ResetData
  104. );
  105. /*++
  106. Routine Description:
  107. This routine resets the entire platform.
  108. Arguments:
  109. ResetType - Supplies the type of reset to perform.
  110. ResetStatus - Supplies the status code for this reset.
  111. DataSize - Supplies the size of the reset data.
  112. ResetData - Supplies an optional pointer for reset types of cold, warm, or
  113. shutdown to a null-terminated string, optionally followed by additional
  114. binary data.
  115. Return Value:
  116. None. This routine does not return.
  117. --*/