xref: /OK3568_Linux_fs/kernel/Documentation/driver-api/sm501.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. include:: <isonum.txt>
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun============
4*4882a593SmuzhiyunSM501 Driver
5*4882a593Smuzhiyun============
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun:Copyright: |copy| 2006, 2007 Simtec Electronics
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThe Silicon Motion SM501 multimedia companion chip is a multifunction device
10*4882a593Smuzhiyunwhich may provide numerous interfaces including USB host controller USB gadget,
11*4882a593Smuzhiyunasynchronous serial ports, audio functions, and a dual display video interface.
12*4882a593SmuzhiyunThe device may be connected by PCI or local bus with varying functions enabled.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunCore
15*4882a593Smuzhiyun----
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunThe core driver in drivers/mfd provides common services for the
18*4882a593Smuzhiyundrivers which manage the specific hardware blocks. These services
19*4882a593Smuzhiyuninclude locking for common registers, clock control and resource
20*4882a593Smuzhiyunmanagement.
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunThe core registers drivers for both PCI and generic bus based
23*4882a593Smuzhiyunchips via the platform device and driver system.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunOn detection of a device, the core initialises the chip (which may
26*4882a593Smuzhiyunbe specified by the platform data) and then exports the selected
27*4882a593Smuzhiyunperipheral set as platform devices for the specific drivers.
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunThe core re-uses the platform device system as the platform device
30*4882a593Smuzhiyunsystem provides enough features to support the drivers without the
31*4882a593Smuzhiyunneed to create a new bus-type and the associated code to go with it.
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunResources
35*4882a593Smuzhiyun---------
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunEach peripheral has a view of the device which is implicitly narrowed to
38*4882a593Smuzhiyunthe specific set of resources that peripheral requires in order to
39*4882a593Smuzhiyunfunction correctly.
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunThe centralised memory allocation allows the driver to ensure that the
42*4882a593Smuzhiyunmaximum possible resource allocation can be made to the video subsystem
43*4882a593Smuzhiyunas this is by-far the most resource-sensitive of the on-chip functions.
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunThe primary issue with memory allocation is that of moving the video
46*4882a593Smuzhiyunbuffers once a display mode is chosen. Indeed when a video mode change
47*4882a593Smuzhiyunoccurs the memory footprint of the video subsystem changes.
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunSince video memory is difficult to move without changing the display
50*4882a593Smuzhiyun(unless sufficient contiguous memory can be provided for the old and new
51*4882a593Smuzhiyunmodes simultaneously) the video driver fully utilises the memory area
52*4882a593Smuzhiyungiven to it by aligning fb0 to the start of the area and fb1 to the end
53*4882a593Smuzhiyunof it. Any memory left over in the middle is used for the acceleration
54*4882a593Smuzhiyunfunctions, which are transient and thus their location is less critical
55*4882a593Smuzhiyunas it can be moved.
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunConfiguration
59*4882a593Smuzhiyun-------------
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunThe platform device driver uses a set of platform data to pass
62*4882a593Smuzhiyunconfigurations through to the core and the subsidiary drivers
63*4882a593Smuzhiyunso that there can be support for more than one system carrying
64*4882a593Smuzhiyunan SM501 built into a single kernel image.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunThe PCI driver assumes that the PCI card behaves as per the Silicon
67*4882a593SmuzhiyunMotion reference design.
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunThere is an errata (AB-5) affecting the selection of the
70*4882a593Smuzhiyunof the M1XCLK and M1CLK frequencies. These two clocks
71*4882a593Smuzhiyunmust be sourced from the same PLL, although they can then
72*4882a593Smuzhiyunbe divided down individually. If this is not set, then SM501 may
73*4882a593Smuzhiyunlock and hang the whole system. The driver will refuse to
74*4882a593Smuzhiyunattach if the PLL selection is different.
75