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