diff options
author | Viktor Krivak <viktor.krivak@gmail.com> | 2012-08-08 01:42:28 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-09-02 18:00:01 +0200 |
commit | cbcc33e951fc3c16b167f0313823a2fdc295caf6 (patch) | |
tree | de0105ebeea3dfec31571cc471f8b24f0d6f9da2 /doc | |
parent | a09c649972d132a2998d28c8d402eb625966ffe2 (diff) | |
download | u-boot-imx-cbcc33e951fc3c16b167f0313823a2fdc295caf6.zip u-boot-imx-cbcc33e951fc3c16b167f0313823a2fdc295caf6.tar.gz u-boot-imx-cbcc33e951fc3c16b167f0313823a2fdc295caf6.tar.bz2 |
dm: Add pcmcia design document
Signed-off-by: Viktor Krivak <viktor.krivak@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/driver-model/UDM-pcmcia.txt | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/doc/driver-model/UDM-pcmcia.txt b/doc/driver-model/UDM-pcmcia.txt new file mode 100644 index 0000000..fc31461 --- /dev/null +++ b/doc/driver-model/UDM-pcmcia.txt @@ -0,0 +1,78 @@ +The U-Boot Driver Model Project +=============================== +PCMCIA analysis +=============== +Viktor Krivak <viktor.krivak@gmail.com> +2012-03-17 + +I) Overview +----------- + + U-boot implements only 2 methods to interoperate with pcmcia. One to turn + device on and other to turn device off. Names of these methods are usually + pcmcia_on() and pcmcia_off() without any parameters. Some files in driver + directory implements only internal API. These methods aren't used outside + driver directory and they are not converted to new driver model. + +II) Approach +----------- + + 1) New API + ---------- + + Current API is preserved and all internal methods are hiden. + + struct ops { + void (*pcmcia_on)(struct instance *i); + void (*pcmcia_off)(struct instance *i); + } + + 2) Conversion + ------------- + + In header file pcmcia.h are some other variables which are used for + additional configuration. But all have to be moved to platform data or to + specific driver implementation. + + 3) Platform data + ---------------- + + Many boards have custom implementation of internal API. Pointers to these + methods are stored in platform_data. But the most implementations for Intel + 82365 and compatible PC Card controllers and Yenta-compatible + PCI-to-CardBus controllers implement whole API per board. In these cases + pcmcia_on() and pcmcia_off() behave only as wrappers and call specific + board methods. + +III) Analysis of in-tree drivers +-------------------------------- + + 1) i82365.c + ----------- + Driver methods have different name i82365_init() and i82365_exit but + all functionality is the same. Board files board/atc/ti113x.c and + board/cpc45/pd67290.c use their own implementation of these method. + In this case all methods in driver behave only as wrappers. + + 2) marubun_pcmcia.c + ------------------- + Meets standard API behaviour. Simple conversion. + + 3) mpc8xx_pcmcia.c + ------------------ + Meets standard API behaviour. Simple conversion. + + 4) rpx_pcmcia.c + --------------- + Implements only internal API used in other drivers. Non of methods + implemented here are used outside driver model. + + 5) ti_pci1410a.c + ---------------- + Has different API but methods in this file are never called. Probably + dead code. + + 6)tqm8xx_pcmcia.c + ----------------- + Implements only internal API used in other drivers. Non of methods + implemented here are used outside driver model. |