bcm2709.h 20 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  1. /*++
  2. Copyright (c) 2015 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. bcm2709.h
  9. Abstract:
  10. This header contains definitions for the BCM2709 UEFI device library.
  11. Author:
  12. Chris Stevens 18-Mar-2015
  13. --*/
  14. //
  15. // ------------------------------------------------------------------- Includes
  16. //
  17. #include <minoca/soc/bcm2709.h>
  18. //
  19. // --------------------------------------------------------------------- Macros
  20. //
  21. //
  22. // This macro converts a BCM2709 device offset into the base address.
  23. //
  24. #define BCM2709_GET_BASE(_Offset) (EfiBcm2709Base + (_Offset))
  25. //
  26. // These macros define the device base addresses based on the fixed offsets.
  27. //
  28. #define BCM2709_SYSTEM_TIMER_BASE BCM2709_GET_BASE(BCM2709_SYSTEM_TIMER_OFFSET)
  29. #define BCM2709_INTERRUPT_BASE BCM2709_GET_BASE(BCM2709_INTERRUPT_OFFSET)
  30. #define BCM2709_ARM_TIMER_BASE BCM2709_GET_BASE(BCM2709_ARM_TIMER_OFFSET)
  31. #define BCM2709_MAILBOX_BASE BCM2709_GET_BASE(BCM2709_MAILBOX_OFFSET)
  32. #define BCM2709_PRM_BASE BCM2709_GET_BASE(BCM2709_PRM_OFFSET)
  33. #define BCM2709_CLOCK_BASE BCM2709_GET_BASE(BCM2709_CLOCK_OFFSET)
  34. #define BCM2709_GPIO_BASE BCM2709_GET_BASE(BCM2709_GPIO_OFFSET)
  35. #define BCM2709_UART_BASE BCM2709_GET_BASE(BCM2709_UART_OFFSET)
  36. #define BCM2709_EMMC_BASE BCM2709_GET_BASE(BCM2709_EMMC_OFFSET)
  37. //
  38. // ---------------------------------------------------------------- Definitions
  39. //
  40. //
  41. // ------------------------------------------------------ Data Type Definitions
  42. //
  43. /*++
  44. Structure Description:
  45. This structure defines the header used when sending property messages to
  46. the BCM2709 mailbox.
  47. Members:
  48. Size - Stores the size of the data being sent.
  49. Code - Stores the status code on return from the mailbox.
  50. --*/
  51. typedef struct _BCM2709_MAILBOX_HEADER {
  52. UINT32 Size;
  53. UINT32 Code;
  54. } BCM2709_MAILBOX_HEADER, *PBCM2709_MAILBOX_HEADER;
  55. /*++
  56. Structure Description:
  57. This structure defines the header for a mailbox tag, that is, an individual
  58. property's message.
  59. Members:
  60. Tag - Stores the tag that devices the nature of the mailbox message.
  61. Size - Stores the number of bytes in the message's buffer.
  62. Length - Stores the number of bytes sent to the mailbox in the message's
  63. buffer. On receive, this will contain the number of bytes read from the
  64. mailbox.
  65. --*/
  66. typedef struct _BCM2709_MAILBOX_TAG {
  67. UINT32 Tag;
  68. UINT32 Size;
  69. UINT32 Length;
  70. } BCM2709_MAILBOX_TAG, *PBCM2709_MAILBOX_TAG;
  71. /*++
  72. Structure Description:
  73. This structure defines a memory region message for the BCM2709 mailbox.
  74. Members:
  75. TagHeader - Stores the identification tag header for the message.
  76. BaseAddress - Stores the base physical address of the memory region.
  77. Size - Stores the size of the memory region, in bytes.
  78. --*/
  79. typedef struct _BCM2709_MAILBOX_MEMORY_REGION {
  80. BCM2709_MAILBOX_TAG TagHeader;
  81. UINT32 BaseAddress;
  82. UINT32 Size;
  83. } BCM2709_MAILBOX_MEMORY_REGION, *PBCM2709_MAILBOX_MEMORY_REGION;
  84. /*++
  85. Structure Description:
  86. This structure defines a device state message for the BCM2709 mailbox.
  87. Members:
  88. TagHeader - Stores the identification tag header for the message.
  89. DeviceId - Stores the identification number for the targeted device.
  90. State - Stores the desired state of the device.
  91. --*/
  92. typedef struct _BCM2709_MAILBOX_DEVICE_STATE {
  93. BCM2709_MAILBOX_TAG TagHeader;
  94. UINT32 DeviceId;
  95. UINT32 State;
  96. } BCM2709_MAILBOX_DEVICE_STATE, *PBCM2709_MAILBOX_DEVICE_STATE;
  97. /*++
  98. Structure Description:
  99. This structure defines the get clock rate message for the BCM2709 mailbox.
  100. Members:
  101. TagHeader - Stores the identification tag header for the message.
  102. ClockId - Stores the identification number for the clock.
  103. Rate - Stores the frequency of the clock in Hz.
  104. --*/
  105. typedef struct _BCM2709_MAILBOX_GET_CLOCK_RATE {
  106. BCM2709_MAILBOX_TAG TagHeader;
  107. UINT32 ClockId;
  108. UINT32 Rate;
  109. } BCM2709_MAILBOX_GET_CLOCK_RATE, *PBCM2709_MAILBOX_GET_CLOCK_RATE;
  110. /*++
  111. Structure Description:
  112. This structure defines the set clock rate message for the BCM2709 mailbox.
  113. Members:
  114. TagHeader - Stores the identification tag header for the message.
  115. ClockId - Stores the identification number for the clock.
  116. Rate - Stores the frequency of the clock in Hz.
  117. SkipSettingTurbo - Stores a boolean indicating whether or not to skip
  118. setting other high performance ("turbo") settings when the ARM
  119. frequency is set above the default.
  120. --*/
  121. typedef struct _BCM2709_MAILBOX_SET_CLOCK_RATE {
  122. BCM2709_MAILBOX_TAG TagHeader;
  123. UINT32 ClockId;
  124. UINT32 Rate;
  125. UINT32 SkipSettingTurbo;
  126. } BCM2709_MAILBOX_SET_CLOCK_RATE, *PBCM2709_MAILBOX_SET_CLOCK_RATE;
  127. /*++
  128. Structure Description:
  129. This structure defines a video resolution used by the BCM2709 mailbox.
  130. Members:
  131. Width - Stores the width of the resolution, in pixels.
  132. Height - Stores the height of the resolution, in pixels.
  133. --*/
  134. typedef struct _BCM2709_RESOLUTION {
  135. UINT32 Width;
  136. UINT32 Height;
  137. } BCM2709_RESOLUTION, *PBCM2709_RESOLUTION;
  138. /*++
  139. Structure Description:
  140. This structure defines a video offset used by the BCM2709 mailbox.
  141. Members:
  142. X - Stores the horizontal offset.
  143. Y - Stores the vertical offset.
  144. --*/
  145. typedef struct _BCM2709_OFFSET {
  146. UINT32 X;
  147. UINT32 Y;
  148. } BCM2709_OFFSET, *PBCM2709_OFFSET;
  149. /*++
  150. Structure Description:
  151. This structure defines a video overscan used by the BCM2709 mailbox.
  152. Members:
  153. Top - Stores the overcan value for the top edge of the screen.
  154. Bottom - Stores the overcan value for the bottom edge of the screen.
  155. Left - Stores the overcan value for the left side of the screen.
  156. Right - Stores the overcan value for the right side of the screen.
  157. --*/
  158. typedef struct _BCM2709_OVERSCAN {
  159. UINT32 Top;
  160. UINT32 Bottom;
  161. UINT32 Left;
  162. UINT32 Right;
  163. } BCM2709_OVERSCAN, *PBCM2709_OVERSCAN;
  164. /*++
  165. Structure Description:
  166. This structure defines a frame buffer used by the BCM2709 mailbox.
  167. Members:
  168. Base - Stores the base address of the frame buffer.
  169. Size - Stores the size of the frame buffer, in bytes.
  170. --*/
  171. typedef struct _BCM2709_FRAME_BUFFER {
  172. UINT32 Base;
  173. UINT32 Size;
  174. } BCM2709_FRAME_BUFFER, *PBCM2709_FRAME_BUFFER;
  175. /*++
  176. Structure Description:
  177. This structure defines a video resolution message for the BCM2709 mailbox.
  178. Members:
  179. TagHeader - Stores the identification tag header for the message.
  180. Resolution - Stores the resolution to set or receives the current
  181. resolution.
  182. --*/
  183. typedef struct _BCM2709_MAILBOX_RESOLUTION {
  184. BCM2709_MAILBOX_TAG TagHeader;
  185. BCM2709_RESOLUTION Resolution;
  186. } BCM2709_MAILBOX_RESOLUTION, *PBCM2709_MAILBOX_RESOLUTION;
  187. /*++
  188. Structure Description:
  189. This structure defines a bits per pixel message for the BCM2709 mailbox.
  190. Members:
  191. TagHeader - Stores the identification tag header for the message.
  192. BitsPerPixel - Stores the bits per pixel to set or receives the current
  193. bits per pixel.
  194. --*/
  195. typedef struct _BCM2709_MAILBOX_BITS_PER_PIXEL {
  196. BCM2709_MAILBOX_TAG TagHeader;
  197. UINT32 BitsPerPixel;
  198. } BCM2709_MAILBOX_BITS_PER_PIXEL, *PBCM2709_MAILBOX_BITS_PER_PIXEL;
  199. /*++
  200. Structure Description:
  201. This structure defines a pixel order message for the BCM2709 mailbox.
  202. Members:
  203. TagHeader - Stores the identification tag header for the message.
  204. PixelOrder - Stores the pixel order to set or receives the current pixel
  205. order.
  206. --*/
  207. typedef struct _BCM2709_MAILBOX_PIXEL_ORDER {
  208. BCM2709_MAILBOX_TAG TagHeader;
  209. UINT32 PixelOrder;
  210. } BCM2709_MAILBOX_PIXEL_ORDER, *PBCM2709_MAILBOX_PIXEL_ORDER;
  211. /*++
  212. Structure Description:
  213. This structure defines a video alpha mode message for the BCM2709 mailbox.
  214. Members:
  215. TagHeader - Stores the identification tag header for the message.
  216. AlphaMode - Stores the alpha mode to set or receives the current alpha mode.
  217. --*/
  218. typedef struct _BCM2709_MAILBOX_ALPHA_MODE {
  219. BCM2709_MAILBOX_TAG TagHeader;
  220. UINT32 AlphaMode;
  221. } BCM2709_MAILBOX_ALPHA_MODE, *PBCM2709_MAILBOX_ALPHA_MODE;
  222. /*++
  223. Structure Description:
  224. This structure defines a video virtual offset message for the BCM2709
  225. mailbox.
  226. Members:
  227. TagHeader - Stores the identification tag header for the message.
  228. Offset - Stores the virtual offset to set or receives the current virtual
  229. offset.
  230. --*/
  231. typedef struct _BCM2709_MAILBOX_VIRTUAL_OFFSET {
  232. BCM2709_MAILBOX_TAG TagHeader;
  233. BCM2709_OFFSET Offset;
  234. } BCM2709_MAILBOX_VIRTUAL_OFFSET, *PBCM2709_MAILBOX_VIRTUAL_OFFSET;
  235. /*++
  236. Structure Description:
  237. This structure defines a video overscan message for the BCM2709 mailbox.
  238. Members:
  239. TagHeader - Stores the identification tag header for the message.
  240. Overcan - Stores the overscan values to set or receives the current
  241. overscan values.
  242. --*/
  243. typedef struct _BCM2709_MAILBOX_OVERSCAN {
  244. BCM2709_MAILBOX_TAG TagHeader;
  245. BCM2709_OVERSCAN Overscan;
  246. } BCM2709_MAILBOX_OVERSCAN, *PBCM2709_MAILBOX_OVERSCAN;
  247. /*++
  248. Structure Description:
  249. This structure defines a video pitch message for the BCM2709 mailbox.
  250. Members:
  251. TagHeader - Stores the identification tag header for the message.
  252. BytesPerLine - Stores the bytes per scan line of the frame buffer.
  253. --*/
  254. typedef struct _BCM2709_MAILBOX_PITCH {
  255. BCM2709_MAILBOX_TAG TagHeader;
  256. UINT32 BytesPerScanLine;
  257. } BCM2709_MAILBOX_PITCH, *PBCM2709_MAILBOX_PITCH;
  258. /*++
  259. Structure Description:
  260. This structure defines a video frame buffer message for the BCM2709 mailbox.
  261. Members:
  262. TagHeader - Stores the identification tag header for the message.
  263. FrameBuffer - Stores the frame buffer to release or receives a frame buffer
  264. base and size.
  265. --*/
  266. typedef struct _BCM2709_MAILBOX_FRAME_BUFFER {
  267. BCM2709_MAILBOX_TAG TagHeader;
  268. BCM2709_FRAME_BUFFER FrameBuffer;
  269. } BCM2709_MAILBOX_FRAME_BUFFER, *PBCM2709_MAILBOX_FRAME_BUFFER;
  270. /*++
  271. Structure Description:
  272. This structure defines a board model message for the BCM2709 mailbox.
  273. Members:
  274. TagHeader - Stores the identification tag header for the message.
  275. ModelNumber - Stores the board model number.
  276. --*/
  277. typedef struct _BCM2709_MAILBOX_BOARD_MODEL {
  278. BCM2709_MAILBOX_TAG TagHeader;
  279. UINT32 ModelNumber;
  280. } BCM2709_MAILBOX_BOARD_MODEL, *PBCM2709_MAILBOX_BOARD_MODEL;
  281. /*++
  282. Structure Description:
  283. This structure defines a board revision message for the BCM2709 mailbox.
  284. Members:
  285. TagHeader - Stores the identification tag header for the message.
  286. ModelNumber - Stores the board revision number.
  287. --*/
  288. typedef struct _BCM2709_MAILBOX_BOARD_REVISION {
  289. BCM2709_MAILBOX_TAG TagHeader;
  290. UINT32 Revision;
  291. } BCM2709_MAILBOX_BOARD_REVISION, *PBCM2709_MAILBOX_BOARD_REVISION;
  292. /*++
  293. Structure Description:
  294. This structure defines a board serial number message for the BCM2709
  295. mailbox.
  296. Members:
  297. TagHeader - Stores the identification tag header for the message.
  298. SerialNumber - Stores the board serial number.
  299. --*/
  300. typedef struct _BCM2709_MAILBOX_BOARD_SERIAL_NUMBER {
  301. BCM2709_MAILBOX_TAG TagHeader;
  302. UINT32 SerialNumber[2];
  303. } BCM2709_MAILBOX_BOARD_SERIAL_NUMBER, *PBCM2709_MAILBOX_BOARD_SERIAL_NUMBER;
  304. /*++
  305. Structure Description:
  306. This structure defines a BCM2709 timer.
  307. Members:
  308. ClockTimer - Stores a boolean indicating whether or not the timer is the
  309. clock timer (TRUE) or the time counter (FALSE).
  310. Predivider - Stores the predivider to use when initializing the clock timer.
  311. --*/
  312. typedef struct _BCM2709_TIMER {
  313. BOOLEAN ClockTimer;
  314. UINT32 Predivider;
  315. } BCM2709_TIMER, *PBCM2709_TIMER;
  316. //
  317. // -------------------------------------------------------------------- Globals
  318. //
  319. //
  320. // Store the base address of the BCM2709 device registers.
  321. //
  322. extern VOID *EfiBcm2709Base;
  323. //
  324. // Store whether or not the BCM2709 device library has been initialized.
  325. //
  326. extern BOOLEAN EfiBcm2709Initialized;
  327. //
  328. // -------------------------------------------------------- Function Prototypes
  329. //
  330. EFI_STATUS
  331. EfipBcm2709Initialize (
  332. VOID *PlatformBase
  333. );
  334. /*++
  335. Routine Description:
  336. This routine initializes the BCM2709 UEFI device library.
  337. Arguments:
  338. PlatformBase - Supplies the base address for the BCM2709 device registers.
  339. Return Value:
  340. Status code.
  341. --*/
  342. EFI_STATUS
  343. EfipBcm2709InterruptInitialize (
  344. VOID
  345. );
  346. /*++
  347. Routine Description:
  348. This routine initializes a BCM2709 Interrupt Controller.
  349. Arguments:
  350. PlatformBase - Supplies the platform's BCM2709 register base address.
  351. Return Value:
  352. EFI Status code.
  353. --*/
  354. VOID
  355. EfipBcm2709InterruptBeginInterrupt (
  356. UINT32 *InterruptNumber,
  357. VOID **InterruptContext
  358. );
  359. /*++
  360. Routine Description:
  361. This routine is called when an interrupts comes in. This routine is
  362. responsible for reporting the interrupt number.
  363. Arguments:
  364. InterruptNumber - Supplies a pointer where interrupt line number will be
  365. returned.
  366. InterruptContext - Supplies a pointer where the platform can store a
  367. pointer's worth of context that will be passed back when ending the
  368. interrupt.
  369. Return Value:
  370. None.
  371. --*/
  372. VOID
  373. EfipBcm2709InterruptEndInterrupt (
  374. UINT32 InterruptNumber,
  375. VOID *InterruptContext
  376. );
  377. /*++
  378. Routine Description:
  379. This routine is called to finish handling of a platform interrupt. This is
  380. where the End-Of-Interrupt would get sent to the interrupt controller.
  381. Arguments:
  382. InterruptNumber - Supplies the interrupt number that occurred.
  383. InterruptContext - Supplies the context returned by the interrupt
  384. controller when the interrupt began.
  385. Return Value:
  386. None.
  387. --*/
  388. EFI_STATUS
  389. EfipBcm2709InterruptSetInterruptLineState (
  390. UINT32 LineNumber,
  391. BOOLEAN Enabled,
  392. BOOLEAN EdgeTriggered
  393. );
  394. /*++
  395. Routine Description:
  396. This routine enables or disables an interrupt line.
  397. Arguments:
  398. LineNumber - Supplies the line number to enable or disable.
  399. Enabled - Supplies a boolean indicating if the line should be enabled or
  400. disabled.
  401. EdgeTriggered - Supplies a boolean indicating if the interrupt is edge
  402. triggered (TRUE) or level triggered (FALSE).
  403. Return Value:
  404. EFI Status code.
  405. --*/
  406. VOID
  407. EfipBcm2709MailboxSend (
  408. UINT32 Channel,
  409. VOID *Data
  410. );
  411. /*++
  412. Routine Description:
  413. This routine sends the given data to the specified mailbox channel.
  414. Arguments:
  415. Channel - Supplies the mailbox channel to which the data should be sent.
  416. Data - Supplies the data buffer to send to the mailbox.
  417. Return Value:
  418. None.
  419. --*/
  420. EFI_STATUS
  421. EfipBcm2709MailboxReceive (
  422. UINT32 Channel,
  423. VOID **Data
  424. );
  425. /*++
  426. Routine Description:
  427. This routine receives data from the given mailbox channel.
  428. Arguments:
  429. Channel - Supplies the mailbox channel from which data is expected.
  430. Data - Supplies a pointer that receives the data buffer returned by the
  431. mailbox.
  432. Return Value:
  433. Status code.
  434. --*/
  435. EFI_STATUS
  436. EfipBcm2709MailboxSendCommand (
  437. UINT32 Channel,
  438. VOID *Command,
  439. UINT32 CommandSize,
  440. BOOLEAN Set
  441. );
  442. /*++
  443. Routine Description:
  444. This routine sends the given command to the given channel of the BCM2709's
  445. mailbox. If it is a GET request, then the data will be returned in the
  446. supplied command buffer.
  447. Arguments:
  448. Channel - Supplies the mailbox channel that is to receive the command.
  449. Command - Supplies the command to send.
  450. CommandSize - Supplies the size of the command to send.
  451. Set - Supplies a boolean indicating whether or not the command is a SET
  452. (TRUE) or GET (FALSE) request.
  453. Return Value:
  454. Status code.
  455. --*/
  456. EFI_STATUS
  457. EfipBcm2709TimerInitialize (
  458. PBCM2709_TIMER Timer
  459. );
  460. /*++
  461. Routine Description:
  462. This routine initializes a BCM2709 timer.
  463. Arguments:
  464. Timer - Supplies the pointer to the timer data.
  465. Return Value:
  466. Status code.
  467. --*/
  468. UINT64
  469. EfipBcm2709TimerRead (
  470. PBCM2709_TIMER Timer
  471. );
  472. /*++
  473. Routine Description:
  474. This routine returns the hardware counter's raw value.
  475. Arguments:
  476. Timer - Supplies the pointer to the timer data.
  477. Return Value:
  478. Returns the timer's current count.
  479. --*/
  480. VOID
  481. EfipBcm2709TimerArm (
  482. PBCM2709_TIMER Timer,
  483. UINT64 TickCount
  484. );
  485. /*++
  486. Routine Description:
  487. This routine arms the timer to fire an interrupt after the specified number
  488. of ticks.
  489. Arguments:
  490. Timer - Supplies the pointer to the timer data.
  491. Periodic - Supplies a boolean indicating if the timer should be armed
  492. periodically or one-shot.
  493. TickCount - Supplies the interval, in ticks, from now for the timer to fire
  494. in.
  495. Return Value:
  496. None.
  497. --*/
  498. VOID
  499. EfipBcm2709TimerDisarm (
  500. PBCM2709_TIMER Timer
  501. );
  502. /*++
  503. Routine Description:
  504. This routine disarms the timer, stopping interrupts from firing.
  505. Arguments:
  506. Timer - Supplies the pointer to the timer data.
  507. Return Value:
  508. None.
  509. --*/
  510. VOID
  511. EfipBcm2709TimerAcknowledgeInterrupt (
  512. PBCM2709_TIMER Timer
  513. );
  514. /*++
  515. Routine Description:
  516. This routine performs any actions necessary upon reciept of a timer's
  517. interrupt. This may involve writing to an acknowledge register to re-enable
  518. the timer to fire again, or other hardware specific actions.
  519. Arguments:
  520. Timer - Supplies the pointer to the timer data.
  521. Return Value:
  522. None.
  523. --*/
  524. EFI_STATUS
  525. EfipBcm2709GetInitialMemoryMap (
  526. EFI_MEMORY_DESCRIPTOR **Map,
  527. UINTN *MapSize
  528. );
  529. /*++
  530. Routine Description:
  531. This routine returns the initial platform memory map to the EFI core. The
  532. core maintains this memory map. The memory map returned does not need to
  533. take into account the firmware image itself or stack, the EFI core will
  534. reserve those regions automatically.
  535. Arguments:
  536. Map - Supplies a pointer where the array of memory descriptors constituting
  537. the initial memory map is returned on success. The EFI core will make
  538. a copy of these descriptors, so they can be in read-only or
  539. temporary memory.
  540. MapSize - Supplies a pointer where the number of elements in the initial
  541. memory map will be returned on success.
  542. Return Value:
  543. EFI status code.
  544. --*/
  545. EFI_STATUS
  546. EfipBcm2709GpioFunctionSelect (
  547. UINT32 Pin,
  548. UINT32 Mode
  549. );
  550. /*++
  551. Routine Description:
  552. This routine sets the given mode for the pin's function select.
  553. Arguments:
  554. Pin - Supplies the GPIO pin whose function select to modify.
  555. Mode - Supplies the function select mode to set.
  556. Return Value:
  557. EFI status code.
  558. --*/
  559. EFI_STATUS
  560. EfipBcm2709UsbInitialize (
  561. VOID
  562. );
  563. /*++
  564. Routine Description:
  565. This routine initialize the USB device on Broadcom 2709 SoCs.
  566. Arguments:
  567. None.
  568. Return Value:
  569. None.
  570. --*/
  571. EFI_STATUS
  572. EfipBcm2709PwmInitialize (
  573. VOID
  574. );
  575. /*++
  576. Routine Description:
  577. This routine initializes the PWM controller making sure that it is exposed
  578. on GPIO pins 40 and 45. This allows audio to be generated using PWM and it
  579. will go out the headphone jack.
  580. Arguments:
  581. None.
  582. Return Value:
  583. EFI status code.
  584. --*/
  585. EFI_STATUS
  586. EfipBcm2709EnumerateSd (
  587. VOID
  588. );
  589. /*++
  590. Routine Description:
  591. This routine enumerates the SD card on the BCM2709.
  592. Arguments:
  593. None.
  594. Return Value:
  595. EFI status code.
  596. --*/
  597. EFI_STATUS
  598. EfipBcm2709EnumerateVideo (
  599. VOID
  600. );
  601. /*++
  602. Routine Description:
  603. This routine enumerates the display on BCM2709 SoCs.
  604. Arguments:
  605. None.
  606. Return Value:
  607. EFI status code.
  608. --*/
  609. EFI_STATUS
  610. EfipBcm2709EnumerateSerial (
  611. VOID
  612. );
  613. /*++
  614. Routine Description:
  615. This routine enumerates the serial port on BCM2709 SoCs.
  616. Arguments:
  617. None.
  618. Return Value:
  619. EFI status code.
  620. --*/