IdeController.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  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,
  209. &gEfiIdeControllerInit,
  210. NULL
  211. );
  212. }
  213. /**
  214. Stop this driver on Controller Handle.
  215. @param This Protocol instance pointer.
  216. @param Controller Handle of device to stop driver on
  217. @param NumberOfChildren Not used
  218. @param ChildHandleBuffer Not used
  219. @retval EFI_SUCCESS This driver is removed DeviceHandle
  220. @retval !EFI_SUCCESS This driver was not removed from this device
  221. **/
  222. EFI_STATUS
  223. EFIAPI
  224. IdeControllerStop (
  225. IN EFI_DRIVER_BINDING_PROTOCOL *This,
  226. IN EFI_HANDLE Controller,
  227. IN UINTN NumberOfChildren,
  228. IN EFI_HANDLE *ChildHandleBuffer
  229. )
  230. {
  231. EFI_STATUS Status;
  232. EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInit;
  233. //
  234. // Open the produced protocol
  235. //
  236. Status = gBS->OpenProtocol (
  237. Controller,
  238. &gEfiIdeControllerInitProtocolGuid,
  239. (VOID **)&IdeControllerInit,
  240. This->DriverBindingHandle,
  241. Controller,
  242. EFI_OPEN_PROTOCOL_GET_PROTOCOL
  243. );
  244. if (EFI_ERROR (Status)) {
  245. return EFI_UNSUPPORTED;
  246. }
  247. //
  248. // Make sure the protocol was produced by this driver
  249. //
  250. if (IdeControllerInit != &gEfiIdeControllerInit) {
  251. return EFI_UNSUPPORTED;
  252. }
  253. //
  254. // Uninstall the IDE Controller Init Protocol
  255. //
  256. Status = gBS->UninstallMultipleProtocolInterfaces (
  257. Controller,
  258. &gEfiIdeControllerInitProtocolGuid,
  259. &gEfiIdeControllerInit,
  260. NULL
  261. );
  262. if (EFI_ERROR (Status)) {
  263. return Status;
  264. }
  265. //
  266. // Close protocols opened by Ide controller driver
  267. //
  268. return gBS->CloseProtocol (
  269. Controller,
  270. &gEfiPciIoProtocolGuid,
  271. This->DriverBindingHandle,
  272. Controller
  273. );
  274. }
  275. //
  276. // Interface functions of IDE_CONTROLLER_INIT protocol
  277. //
  278. /**
  279. Returns the information about the specified IDE channel.
  280. This function can be used to obtain information about a particular IDE channel.
  281. The driver entity uses this information during the enumeration process.
  282. If Enabled is set to FALSE, the driver entity will not scan the channel. Note
  283. that it will not prevent an operating system driver from scanning the channel.
  284. For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
  285. controllers, this value will always be 1. SATA configurations can contain SATA
  286. port multipliers. SATA port multipliers behave like SATA bridges and can support
  287. up to 16 devices on the other side. If a SATA port out of the IDE controller
  288. is connected to a port multiplier, MaxDevices will be set to the number of SATA
  289. devices that the port multiplier supports. Because today's port multipliers
  290. support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
  291. bus driver is required to scan for the presence of port multipliers behind an SATA
  292. controller and enumerate up to MaxDevices number of devices behind the port
  293. multiplier.
  294. In this context, the devices behind a port multiplier constitute a channel.
  295. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  296. @param[in] Channel Zero-based channel number.
  297. @param[out] Enabled TRUE if this channel is enabled. Disabled channels
  298. are not scanned to see if any devices are present.
  299. @param[out] MaxDevices The maximum number of IDE devices that the bus driver
  300. can expect on this channel. For the ATA/ATAPI
  301. specification, version 6, this number will either be
  302. one or two. For Serial ATA (SATA) configurations with a
  303. port multiplier, this number can be as large as fifteen.
  304. @retval EFI_SUCCESS Information was returned without any errors.
  305. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  306. **/
  307. EFI_STATUS
  308. EFIAPI
  309. IdeInitGetChannelInfo (
  310. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  311. IN UINT8 Channel,
  312. OUT BOOLEAN *Enabled,
  313. OUT UINT8 *MaxDevices
  314. )
  315. {
  316. //
  317. // Channel number (0 based, either 0 or 1)
  318. //
  319. if (Channel < ICH_IDE_MAX_CHANNEL) {
  320. *Enabled = TRUE;
  321. *MaxDevices = ICH_IDE_MAX_DEVICES;
  322. return EFI_SUCCESS;
  323. }
  324. *Enabled = FALSE;
  325. return EFI_INVALID_PARAMETER;
  326. }
  327. /**
  328. The notifications from the driver entity that it is about to enter a certain
  329. phase of the IDE channel enumeration process.
  330. This function can be used to notify the IDE controller driver to perform
  331. specific actions, including any chipset-specific initialization, so that the
  332. chipset is ready to enter the next phase. Seven notification points are defined
  333. at this time.
  334. More synchronization points may be added as required in the future.
  335. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  336. @param[in] Phase The phase during enumeration.
  337. @param[in] Channel Zero-based channel number.
  338. @retval EFI_SUCCESS The notification was accepted without any errors.
  339. @retval EFI_UNSUPPORTED Phase is not supported.
  340. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  341. @retval EFI_NOT_READY This phase cannot be entered at this time; for
  342. example, an attempt was made to enter a Phase
  343. without having entered one or more previous
  344. Phase.
  345. **/
  346. EFI_STATUS
  347. EFIAPI
  348. IdeInitNotifyPhase (
  349. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  350. IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,
  351. IN UINT8 Channel
  352. )
  353. {
  354. return EFI_SUCCESS;
  355. }
  356. /**
  357. Submits the device information to the IDE controller driver.
  358. This function is used by the driver entity to pass detailed information about
  359. a particular device to the IDE controller driver. The driver entity obtains
  360. this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
  361. is the pointer to the response data buffer. The IdentifyData buffer is owned
  362. by the driver entity, and the IDE controller driver must make a local copy
  363. of the entire buffer or parts of the buffer as needed. The original IdentifyData
  364. buffer pointer may not be valid when
  365. - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
  366. - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
  367. The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
  368. compute the optimum mode for the device. These fields are not limited to the
  369. timing information. For example, an implementation of the IDE controller driver
  370. may examine the vendor and type/mode field to match known bad drives.
  371. The driver entity may submit drive information in any order, as long as it
  372. submits information for all the devices belonging to the enumeration group
  373. before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
  374. in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  375. should be called with IdentifyData set to NULL. The IDE controller driver may
  376. not have any other mechanism to know whether a device is present or not. Therefore,
  377. setting IdentifyData to NULL does not constitute an error condition.
  378. EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
  379. given (Channel, Device) pair.
  380. @param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  381. @param[in] Channel Zero-based channel number.
  382. @param[in] Device Zero-based device number on the Channel.
  383. @param[in] IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.
  384. @retval EFI_SUCCESS The information was accepted without any errors.
  385. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  386. @retval EFI_INVALID_PARAMETER Device is invalid.
  387. **/
  388. EFI_STATUS
  389. EFIAPI
  390. IdeInitSubmitData (
  391. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  392. IN UINT8 Channel,
  393. IN UINT8 Device,
  394. IN EFI_IDENTIFY_DATA *IdentifyData
  395. )
  396. {
  397. return EFI_SUCCESS;
  398. }
  399. /**
  400. Disqualifies specific modes for an IDE device.
  401. This function allows the driver entity or other drivers (such as platform
  402. drivers) to reject certain timing modes and request the IDE controller driver
  403. to recalculate modes. This function allows the driver entity and the IDE
  404. controller driver to negotiate the timings on a per-device basis. This function
  405. is useful in the case of drives that lie about their capabilities. An example
  406. is when the IDE device fails to accept the timing modes that are calculated
  407. by the IDE controller driver based on the response to the Identify Drive command.
  408. If the driver entity does not want to limit the ATA timing modes and leave that
  409. decision to the IDE controller driver, it can either not call this function for
  410. the given device or call this function and set the Valid flag to FALSE for all
  411. modes that are listed in EFI_ATA_COLLECTIVE_MODE.
  412. The driver entity may disqualify modes for a device in any order and any number
  413. of times.
  414. This function can be called multiple times to invalidate multiple modes of the
  415. same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
  416. specification for more information on PIO modes.
  417. For Serial ATA (SATA) controllers, this member function can be used to disqualify
  418. a higher transfer rate mode on a given channel. For example, a platform driver
  419. may inform the IDE controller driver to not use second-generation (Gen2) speeds
  420. for a certain SATA drive.
  421. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  422. @param[in] Channel The zero-based channel number.
  423. @param[in] Device The zero-based device number on the Channel.
  424. @param[in] BadModes The modes that the device does not support and that
  425. should be disqualified.
  426. @retval EFI_SUCCESS The modes were accepted without any errors.
  427. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  428. @retval EFI_INVALID_PARAMETER Device is invalid.
  429. @retval EFI_INVALID_PARAMETER IdentifyData is NULL.
  430. **/
  431. EFI_STATUS
  432. EFIAPI
  433. IdeInitDisqualifyMode (
  434. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  435. IN UINT8 Channel,
  436. IN UINT8 Device,
  437. IN EFI_ATA_COLLECTIVE_MODE *BadModes
  438. )
  439. {
  440. return EFI_SUCCESS;
  441. }
  442. /**
  443. Returns the information about the optimum modes for the specified IDE device.
  444. This function is used by the driver entity to obtain the optimum ATA modes for
  445. a specific device. The IDE controller driver takes into account the following
  446. while calculating the mode:
  447. - The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  448. - The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
  449. The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  450. for all the devices that belong to an enumeration group before calling
  451. EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
  452. The IDE controller driver will use controller- and possibly platform-specific
  453. algorithms to arrive at SupportedModes. The IDE controller may base its
  454. decision on user preferences and other considerations as well. This function
  455. may be called multiple times because the driver entity may renegotiate the mode
  456. with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
  457. The driver entity may collect timing information for various devices in any
  458. order. The driver entity is responsible for making sure that all the dependencies
  459. are satisfied. For example, the SupportedModes information for device A that
  460. was previously returned may become stale after a call to
  461. EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
  462. The buffer SupportedModes is allocated by the callee because the caller does
  463. not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
  464. is defined in a way that allows for future extensibility and can be of variable
  465. length. This memory pool should be deallocated by the caller when it is no
  466. longer necessary.
  467. The IDE controller driver for a Serial ATA (SATA) controller can use this
  468. member function to force a lower speed (first-generation [Gen1] speeds on a
  469. second-generation [Gen2]-capable hardware). The IDE controller driver can
  470. also allow the driver entity to stay with the speed that has been negotiated
  471. by the physical layer.
  472. @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  473. @param[in] Channel A zero-based channel number.
  474. @param[in] Device A zero-based device number on the Channel.
  475. @param[out] SupportedModes The optimum modes for the device.
  476. @retval EFI_SUCCESS SupportedModes was returned.
  477. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  478. @retval EFI_INVALID_PARAMETER Device is invalid.
  479. @retval EFI_INVALID_PARAMETER SupportedModes is NULL.
  480. @retval EFI_NOT_READY Modes cannot be calculated due to a lack of
  481. data. This error may happen if
  482. EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
  483. and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
  484. were not called for at least one drive in the
  485. same enumeration group.
  486. **/
  487. EFI_STATUS
  488. EFIAPI
  489. IdeInitCalculateMode (
  490. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  491. IN UINT8 Channel,
  492. IN UINT8 Device,
  493. OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes
  494. )
  495. {
  496. if ((Channel >= ICH_IDE_MAX_CHANNEL) || (Device >= ICH_IDE_MAX_DEVICES)) {
  497. return EFI_INVALID_PARAMETER;
  498. }
  499. *SupportedModes = AllocateCopyPool (sizeof (EFI_ATA_COLLECTIVE_MODE), &gEfiAtaCollectiveModeTemplate);
  500. if (*SupportedModes == NULL) {
  501. return EFI_OUT_OF_RESOURCES;
  502. }
  503. return EFI_SUCCESS;
  504. }
  505. /**
  506. Commands the IDE controller driver to program the IDE controller hardware
  507. so that the specified device can operate at the specified mode.
  508. This function is used by the driver entity to instruct the IDE controller
  509. driver to program the IDE controller hardware to the specified modes. This
  510. function can be called only once for a particular device. For a Serial ATA
  511. (SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
  512. specific programming may be required.
  513. @param[in] This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
  514. @param[in] Channel Zero-based channel number.
  515. @param[in] Device Zero-based device number on the Channel.
  516. @param[in] Modes The modes to set.
  517. @retval EFI_SUCCESS The command was accepted without any errors.
  518. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
  519. @retval EFI_INVALID_PARAMETER Device is invalid.
  520. @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.
  521. @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.
  522. The driver entity should not use this device.
  523. **/
  524. EFI_STATUS
  525. EFIAPI
  526. IdeInitSetTiming (
  527. IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
  528. IN UINT8 Channel,
  529. IN UINT8 Device,
  530. IN EFI_ATA_COLLECTIVE_MODE *Modes
  531. )
  532. {
  533. return EFI_SUCCESS;
  534. }