IdeController.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /** @file
  2. This driver module produces IDE_CONTROLLER_INIT protocol and will be used by
  3. IDE Bus driver to support platform dependent timing information. This driver
  4. is responsible for early initialization of IDE controller.
  5. Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. **/
  8. #include "IdeController.h"
  9. ///
  10. /// EFI_DRIVER_BINDING_PROTOCOL instance
  11. ///
  12. EFI_DRIVER_BINDING_PROTOCOL gIdeControllerDriverBinding = {
  13. IdeControllerSupported,
  14. IdeControllerStart,
  15. IdeControllerStop,
  16. 0xa,
  17. NULL,
  18. NULL
  19. };
  20. ///
  21. /// EFI_IDE_CONTROLLER_PROVATE_DATA Template
  22. ///
  23. EFI_IDE_CONTROLLER_INIT_PROTOCOL gEfiIdeControllerInit = {
  24. IdeInitGetChannelInfo,
  25. IdeInitNotifyPhase,
  26. IdeInitSubmitData,
  27. IdeInitDisqualifyMode,
  28. IdeInitCalculateMode,
  29. IdeInitSetTiming,
  30. ICH_IDE_ENUMER_ALL,
  31. ICH_IDE_MAX_CHANNEL
  32. };
  33. ///
  34. /// EFI_ATA_COLLECTIVE_MODE Template
  35. ///
  36. EFI_ATA_COLLECTIVE_MODE gEfiAtaCollectiveModeTemplate = {
  37. {
  38. TRUE, ///< PioMode.Valid
  39. 0 ///< PioMode.Mode
  40. },
  41. {
  42. TRUE, ///< SingleWordDmaMode.Valid
  43. 0
  44. },
  45. {
  46. FALSE, ///< MultiWordDmaMode.Valid
  47. 0
  48. },
  49. {
  50. TRUE, ///< UdmaMode.Valid
  51. 0 ///< UdmaMode.Mode
  52. }
  53. };
  54. /**
  55. Chipset Ide Driver EntryPoint function. It follows the standard EFI driver model.
  56. It's called by StartImage() of DXE Core.
  57. @param ImageHandle While the driver image loaded be the ImageLoader(),
  58. an image handle is assigned to this driver binary,
  59. all activities of the driver is tied to this ImageHandle
  60. @param SystemTable A pointer to the system table, for all BS(Boo Services) and
  61. RT(Runtime Services)
  62. @return EFI_STATUS Status of EfiLibInstallDriverBindingComponentName2().
  63. **/
  64. EFI_STATUS
  65. EFIAPI
  66. InitializeIdeControllerDriver (
  67. IN EFI_HANDLE ImageHandle,
  68. IN EFI_SYSTEM_TABLE *SystemTable
  69. )
  70. {
  71. EFI_STATUS Status;
  72. //
  73. // Install driver model protocol(s).
  74. //
  75. Status = EfiLibInstallDriverBindingComponentName2 (
  76. ImageHandle,
  77. SystemTable,
  78. &gIdeControllerDriverBinding,
  79. ImageHandle,
  80. &gIdeControllerComponentName,
  81. &gIdeControllerComponentName2
  82. );
  83. ASSERT_EFI_ERROR (Status);
  84. return Status;
  85. }
  86. /**
  87. Register Driver Binding protocol for this driver.
  88. @param This A pointer points to the Binding Protocol instance
  89. @param Controller The handle of controller to be tested.
  90. @param RemainingDevicePath A pointer to the device path. Ignored by device
  91. driver but used by bus driver
  92. @retval EFI_SUCCESS Driver loaded.
  93. @retval !EFI_SUCCESS Driver not loaded.
  94. **/
  95. EFI_STATUS
  96. EFIAPI
  97. IdeControllerSupported (
  98. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  99. IN EFI_HANDLE Controller,
  100. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  101. )
  102. {
  103. EFI_STATUS Status;
  104. EFI_PCI_IO_PROTOCOL *PciIo;
  105. UINT8 PciClass;
  106. UINT8 PciSubClass;
  107. //
  108. // Attempt to Open PCI I/O Protocol
  109. //
  110. Status = gBS->OpenProtocol (
  111. Controller,
  112. &gEfiPciIoProtocolGuid,
  113. (VOID **) &PciIo,
  114. This->DriverBindingHandle,
  115. Controller,
  116. EFI_OPEN_PROTOCOL_BY_DRIVER
  117. );
  118. if (EFI_ERROR (Status)) {
  119. return Status;
  120. }
  121. //
  122. // Now further check the PCI header: Base class (offset 0x0B) and
  123. // Sub Class (offset 0x0A). This controller should be an Ide controller
  124. //
  125. Status = PciIo->Pci.Read (
  126. PciIo,
  127. EfiPciIoWidthUint8,
  128. PCI_CLASSCODE_OFFSET + 2,
  129. 1,
  130. &PciClass
  131. );
  132. if (EFI_ERROR (Status)) {
  133. goto Done;
  134. }
  135. Status = PciIo->Pci.Read (
  136. PciIo,
  137. EfiPciIoWidthUint8,
  138. PCI_CLASSCODE_OFFSET + 1,
  139. 1,
  140. &PciSubClass
  141. );
  142. if (EFI_ERROR (Status)) {
  143. goto Done;
  144. }
  145. //
  146. // Examine Ide PCI Configuration table fields
  147. //
  148. if ((PciClass != PCI_CLASS_MASS_STORAGE) || (PciSubClass != PCI_CLASS_MASS_STORAGE_IDE)) {
  149. Status = EFI_UNSUPPORTED;
  150. }
  151. Done:
  152. gBS->CloseProtocol (
  153. Controller,
  154. &gEfiPciIoProtocolGuid,
  155. This->DriverBindingHandle,
  156. Controller
  157. );
  158. return Status;
  159. }
  160. /**
  161. This routine is called right after the .Supported() called and return
  162. EFI_SUCCESS. Notes: The supported protocols are checked but the Protocols
  163. are closed.
  164. @param This A pointer points to the Binding Protocol instance
  165. @param Controller The handle of controller to be tested. Parameter
  166. passed by the caller
  167. @param RemainingDevicePath A pointer to the device path. Should be ignored by
  168. device driver
  169. @return EFI_STATUS Status of InstallMultipleProtocolInterfaces()
  170. **/
  171. EFI_STATUS
  172. EFIAPI
  173. IdeControllerStart (
  174. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  175. IN EFI_HANDLE Controller,
  176. IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
  177. )
  178. {
  179. EFI_STATUS Status;
  180. EFI_PCI_IO_PROTOCOL *PciIo;
  181. //
  182. // Now test and open the EfiPciIoProtocol
  183. //
  184. Status = gBS->OpenProtocol (
  185. Controller,
  186. &gEfiPciIoProtocolGuid,
  187. (VOID **) &PciIo,
  188. This->DriverBindingHandle,
  189. Controller,
  190. EFI_OPEN_PROTOCOL_BY_DRIVER
  191. );
  192. //
  193. // Status == EFI_SUCCESS - A normal execution flow, SUCCESS and the program proceeds.
  194. // Status == ALREADY_STARTED - A non-zero Status code returned. It indicates
  195. // that the protocol has been opened and should be treated as a
  196. // normal condition and the program proceeds. The Protocol will not
  197. // opened 'again' by this call.
  198. // Status != ALREADY_STARTED - Error status, terminate program execution
  199. //
  200. if (EFI_ERROR (Status)) {
  201. return Status;
  202. }
  203. //
  204. // Install IDE_CONTROLLER_INIT protocol
  205. //
  206. return gBS->InstallMultipleProtocolInterfaces (
  207. &Controller,
  208. &gEfiIdeControllerInitProtocolGuid, &gEfiIdeControllerInit,
  209. NULL
  210. );
  211. }
  212. /**
  213. Stop this driver on Controller Handle.
  214. @param This Protocol instance pointer.
  215. @param Controller Handle of device to stop driver on
  216. @param NumberOfChildren Not used
  217. @param ChildHandleBuffer Not used
  218. @retval EFI_SUCCESS This driver is removed DeviceHandle
  219. @retval !EFI_SUCCESS This driver was not removed from this device
  220. **/
  221. EFI_STATUS
  222. EFIAPI
  223. IdeControllerStop (
  224. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  225. IN EFI_HANDLE Controller,
  226. IN UINTN NumberOfChildren,
  227. IN EFI_HANDLE *ChildHandleBuffer
  228. )
  229. {
  230. EFI_STATUS Status;
  231. EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInit;
  232. //
  233. // Open the produced protocol
  234. //
  235. Status = gBS->OpenProtocol (
  236. Controller,
  237. &gEfiIdeControllerInitProtocolGuid,
  238. (VOID **) &IdeControllerInit,
  239. This->DriverBindingHandle,
  240. Controller,
  241. EFI_OPEN_PROTOCOL_GET_PROTOCOL
  242. );
  243. if (EFI_ERROR (Status)) {
  244. return EFI_UNSUPPORTED;
  245. }
  246. //
  247. // Make sure the protocol was produced by this driver
  248. //
  249. if (IdeControllerInit != &gEfiIdeControllerInit) {
  250. return EFI_UNSUPPORTED;
  251. }
  252. //
  253. // Uninstall the IDE Controller Init Protocol
  254. //
  255. Status = gBS->UninstallMultipleProtocolInterfaces (
  256. Controller,
  257. &gEfiIdeControllerInitProtocolGuid, &gEfiIdeControllerInit,
  258. NULL
  259. );
  260. if (EFI_ERROR (Status)) {
  261. return Status;
  262. }
  263. //
  264. // Close protocols opened by Ide controller driver
  265. //
  266. return gBS->CloseProtocol (
  267. Controller,
  268. &gEfiPciIoProtocolGuid,
  269. This->DriverBindingHandle,
  270. Controller
  271. );
  272. }
  273. //
  274. // Interface functions of IDE_CONTROLLER_INIT protocol
  275. //
  276. /**
  277. Returns the information about the specified IDE channel.
  278. This function can be used to obtain information about a particular IDE channel.
  279. The driver entity uses this information during the enumeration process.
  280. If Enabled is set to FALSE, the driver entity will not scan the channel. Note
  281. that it will not prevent an operating system driver from scanning the channel.
  282. For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
  283. controllers, this value will always be 1. SATA configurations can contain SATA
  284. port multipliers. SATA port multipliers behave like SATA bridges and can support
  285. up to 16 devices on the other side. If a SATA port out of the IDE controller
  286. is connected to a port multiplier, MaxDevices will be set to the number of SATA
  287. devices that the port multiplier supports. Because today's port multipliers
  288. support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
  289. bus driver is required to scan for the presence of port multipliers behind an SATA
  290. controller and enumerate up to MaxDevices number of devices behind the port
  291. multiplier.
  292. In this context, the devices behind a port multiplier constitute a channel.
  293. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  294. @param[in] Channel Zero-based channel number.
  295. @param[out] Enabled TRUE if this channel is enabled. Disabled channels
  296. are not scanned to see if any devices are present.
  297. @param[out] MaxDevices The maximum number of IDE devices that the bus driver
  298. can expect on this channel. For the ATA/ATAPI
  299. specification, version 6, this number will either be
  300. one or two. For Serial ATA (SATA) configurations with a
  301. port multiplier, this number can be as large as fifteen.
  302. @retval EFI_SUCCESS Information was returned without any errors.
  303. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  304. **/
  305. EFI_STATUS
  306. EFIAPI
  307. IdeInitGetChannelInfo (
  308. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  309. IN UINT8 Channel,
  310. OUT BOOLEAN *Enabled,
  311. OUT UINT8 *MaxDevices
  312. )
  313. {
  314. //
  315. // Channel number (0 based, either 0 or 1)
  316. //
  317. if (Channel < ICH_IDE_MAX_CHANNEL) {
  318. *Enabled = TRUE;
  319. *MaxDevices = ICH_IDE_MAX_DEVICES;
  320. return EFI_SUCCESS;
  321. }
  322. *Enabled = FALSE;
  323. return EFI_INVALID_PARAMETER;
  324. }
  325. /**
  326. The notifications from the driver entity that it is about to enter a certain
  327. phase of the IDE channel enumeration process.
  328. This function can be used to notify the IDE controller driver to perform
  329. specific actions, including any chipset-specific initialization, so that the
  330. chipset is ready to enter the next phase. Seven notification points are defined
  331. at this time.
  332. More synchronization points may be added as required in the future.
  333. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  334. @param[in] Phase The phase during enumeration.
  335. @param[in] Channel Zero-based channel number.
  336. @retval EFI_SUCCESS The notification was accepted without any errors.
  337. @retval EFI_UNSUPPORTED Phase is not supported.
  338. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  339. @retval EFI_NOT_READY This phase cannot be entered at this time; for
  340. example, an attempt was made to enter a Phase
  341. without having entered one or more previous
  342. Phase.
  343. **/
  344. EFI_STATUS
  345. EFIAPI
  346. IdeInitNotifyPhase (
  347. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  348. IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,
  349. IN UINT8 Channel
  350. )
  351. {
  352. return EFI_SUCCESS;
  353. }
  354. /**
  355. Submits the device information to the IDE controller driver.
  356. This function is used by the driver entity to pass detailed information about
  357. a particular device to the IDE controller driver. The driver entity obtains
  358. this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
  359. is the pointer to the response data buffer. The IdentifyData buffer is owned
  360. by the driver entity, and the IDE controller driver must make a local copy
  361. of the entire buffer or parts of the buffer as needed. The original IdentifyData
  362. buffer pointer may not be valid when
  363. - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
  364. - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
  365. The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
  366. compute the optimum mode for the device. These fields are not limited to the
  367. timing information. For example, an implementation of the IDE controller driver
  368. may examine the vendor and type/mode field to match known bad drives.
  369. The driver entity may submit drive information in any order, as long as it
  370. submits information for all the devices belonging to the enumeration group
  371. before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
  372. in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  373. should be called with IdentifyData set to NULL. The IDE controller driver may
  374. not have any other mechanism to know whether a device is present or not. Therefore,
  375. setting IdentifyData to NULL does not constitute an error condition.
  376. EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
  377. given (Channel, Device) pair.
  378. @param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  379. @param[in] Channel Zero-based channel number.
  380. @param[in] Device Zero-based device number on the Channel.
  381. @param[in] IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.
  382. @retval EFI_SUCCESS The information was accepted without any errors.
  383. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  384. @retval EFI_INVALID_PARAMETER Device is invalid.
  385. **/
  386. EFI_STATUS
  387. EFIAPI
  388. IdeInitSubmitData (
  389. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  390. IN UINT8 Channel,
  391. IN UINT8 Device,
  392. IN EFI_IDENTIFY_DATA *IdentifyData
  393. )
  394. {
  395. return EFI_SUCCESS;
  396. }
  397. /**
  398. Disqualifies specific modes for an IDE device.
  399. This function allows the driver entity or other drivers (such as platform
  400. drivers) to reject certain timing modes and request the IDE controller driver
  401. to recalculate modes. This function allows the driver entity and the IDE
  402. controller driver to negotiate the timings on a per-device basis. This function
  403. is useful in the case of drives that lie about their capabilities. An example
  404. is when the IDE device fails to accept the timing modes that are calculated
  405. by the IDE controller driver based on the response to the Identify Drive command.
  406. If the driver entity does not want to limit the ATA timing modes and leave that
  407. decision to the IDE controller driver, it can either not call this function for
  408. the given device or call this function and set the Valid flag to FALSE for all
  409. modes that are listed in EFI_ATA_COLLECTIVE_MODE.
  410. The driver entity may disqualify modes for a device in any order and any number
  411. of times.
  412. This function can be called multiple times to invalidate multiple modes of the
  413. same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
  414. specification for more information on PIO modes.
  415. For Serial ATA (SATA) controllers, this member function can be used to disqualify
  416. a higher transfer rate mode on a given channel. For example, a platform driver
  417. may inform the IDE controller driver to not use second-generation (Gen2) speeds
  418. for a certain SATA drive.
  419. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  420. @param[in] Channel The zero-based channel number.
  421. @param[in] Device The zero-based device number on the Channel.
  422. @param[in] BadModes The modes that the device does not support and that
  423. should be disqualified.
  424. @retval EFI_SUCCESS The modes were accepted without any errors.
  425. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  426. @retval EFI_INVALID_PARAMETER Device is invalid.
  427. @retval EFI_INVALID_PARAMETER IdentifyData is NULL.
  428. **/
  429. EFI_STATUS
  430. EFIAPI
  431. IdeInitDisqualifyMode (
  432. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  433. IN UINT8 Channel,
  434. IN UINT8 Device,
  435. IN EFI_ATA_COLLECTIVE_MODE *BadModes
  436. )
  437. {
  438. return EFI_SUCCESS;
  439. }
  440. /**
  441. Returns the information about the optimum modes for the specified IDE device.
  442. This function is used by the driver entity to obtain the optimum ATA modes for
  443. a specific device. The IDE controller driver takes into account the following
  444. while calculating the mode:
  445. - The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  446. - The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
  447. The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  448. for all the devices that belong to an enumeration group before calling
  449. EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
  450. The IDE controller driver will use controller- and possibly platform-specific
  451. algorithms to arrive at SupportedModes. The IDE controller may base its
  452. decision on user preferences and other considerations as well. This function
  453. may be called multiple times because the driver entity may renegotiate the mode
  454. with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
  455. The driver entity may collect timing information for various devices in any
  456. order. The driver entity is responsible for making sure that all the dependencies
  457. are satisfied. For example, the SupportedModes information for device A that
  458. was previously returned may become stale after a call to
  459. EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
  460. The buffer SupportedModes is allocated by the callee because the caller does
  461. not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
  462. is defined in a way that allows for future extensibility and can be of variable
  463. length. This memory pool should be deallocated by the caller when it is no
  464. longer necessary.
  465. The IDE controller driver for a Serial ATA (SATA) controller can use this
  466. member function to force a lower speed (first-generation [Gen1] speeds on a
  467. second-generation [Gen2]-capable hardware). The IDE controller driver can
  468. also allow the driver entity to stay with the speed that has been negotiated
  469. by the physical layer.
  470. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  471. @param[in] Channel A zero-based channel number.
  472. @param[in] Device A zero-based device number on the Channel.
  473. @param[out] SupportedModes The optimum modes for the device.
  474. @retval EFI_SUCCESS SupportedModes was returned.
  475. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  476. @retval EFI_INVALID_PARAMETER Device is invalid.
  477. @retval EFI_INVALID_PARAMETER SupportedModes is NULL.
  478. @retval EFI_NOT_READY Modes cannot be calculated due to a lack of
  479. data. This error may happen if
  480. EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  481. and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
  482. were not called for at least one drive in the
  483. same enumeration group.
  484. **/
  485. EFI_STATUS
  486. EFIAPI
  487. IdeInitCalculateMode (
  488. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  489. IN UINT8 Channel,
  490. IN UINT8 Device,
  491. OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes
  492. )
  493. {
  494. if (Channel >= ICH_IDE_MAX_CHANNEL || Device >= ICH_IDE_MAX_DEVICES) {
  495. return EFI_INVALID_PARAMETER;
  496. }
  497. *SupportedModes = AllocateCopyPool (sizeof (EFI_ATA_COLLECTIVE_MODE), &gEfiAtaCollectiveModeTemplate);
  498. if (*SupportedModes == NULL) {
  499. return EFI_OUT_OF_RESOURCES;
  500. }
  501. return EFI_SUCCESS;
  502. }
  503. /**
  504. Commands the IDE controller driver to program the IDE controller hardware
  505. so that the specified device can operate at the specified mode.
  506. This function is used by the driver entity to instruct the IDE controller
  507. driver to program the IDE controller hardware to the specified modes. This
  508. function can be called only once for a particular device. For a Serial ATA
  509. (SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
  510. specific programming may be required.
  511. @param[in] This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  512. @param[in] Channel Zero-based channel number.
  513. @param[in] Device Zero-based device number on the Channel.
  514. @param[in] Modes The modes to set.
  515. @retval EFI_SUCCESS The command was accepted without any errors.
  516. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  517. @retval EFI_INVALID_PARAMETER Device is invalid.
  518. @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.
  519. @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.
  520. The driver entity should not use this device.
  521. **/
  522. EFI_STATUS
  523. EFIAPI
  524. IdeInitSetTiming (
  525. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  526. IN UINT8 Channel,
  527. IN UINT8 Device,
  528. IN EFI_ATA_COLLECTIVE_MODE *Modes
  529. )
  530. {
  531. return EFI_SUCCESS;
  532. }