UDM-pcmcia.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. The U-Boot Driver Model Project
  2. ===============================
  3. PCMCIA analysis
  4. ===============
  5. Viktor Krivak <viktor.krivak@gmail.com>
  6. 2012-03-17
  7. I) Overview
  8. -----------
  9. U-boot implements only 2 methods to interoperate with pcmcia. One to turn
  10. device on and other to turn device off. Names of these methods are usually
  11. pcmcia_on() and pcmcia_off() without any parameters. Some files in driver
  12. directory implements only internal API. These methods aren't used outside
  13. driver directory and they are not converted to new driver model.
  14. II) Approach
  15. -----------
  16. 1) New API
  17. ----------
  18. Current API is preserved and all internal methods are hiden.
  19. struct ops {
  20. void (*pcmcia_on)(struct instance *i);
  21. void (*pcmcia_off)(struct instance *i);
  22. }
  23. 2) Conversion
  24. -------------
  25. In header file pcmcia.h are some other variables which are used for
  26. additional configuration. But all have to be moved to platform data or to
  27. specific driver implementation.
  28. 3) Platform data
  29. ----------------
  30. Many boards have custom implementation of internal API. Pointers to these
  31. methods are stored in platform_data. But the most implementations for Intel
  32. 82365 and compatible PC Card controllers and Yenta-compatible
  33. PCI-to-CardBus controllers implement whole API per board. In these cases
  34. pcmcia_on() and pcmcia_off() behave only as wrappers and call specific
  35. board methods.
  36. III) Analysis of in-tree drivers
  37. --------------------------------
  38. 1) i82365.c
  39. -----------
  40. Driver methods have different name i82365_init() and i82365_exit but
  41. all functionality is the same. Board files board/atc/ti113x.c and
  42. board/cpc45/pd67290.c use their own implementation of these method.
  43. In this case all methods in driver behave only as wrappers.
  44. 2) marubun_pcmcia.c
  45. -------------------
  46. Meets standard API behaviour. Simple conversion.
  47. 3) mpc8xx_pcmcia.c
  48. ------------------
  49. Meets standard API behaviour. Simple conversion.
  50. 4) rpx_pcmcia.c
  51. ---------------
  52. Implements only internal API used in other drivers. Non of methods
  53. implemented here are used outside driver model.
  54. 5) ti_pci1410a.c
  55. ----------------
  56. Has different API but methods in this file are never called. Probably
  57. dead code.
  58. 6)tqm8xx_pcmcia.c
  59. -----------------
  60. Implements only internal API used in other drivers. Non of methods
  61. implemented here are used outside driver model.