Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
This commit is contained in:
Коммит
c088f4e9da
|
@ -3,8 +3,9 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
state. This holds the regulator output state.
|
||||
Some regulator directories will contain a field called
|
||||
state. This reports the regulator enable status, for
|
||||
regulators which can report that value.
|
||||
|
||||
This will be one of the following strings:
|
||||
|
||||
|
@ -18,7 +19,8 @@ Description:
|
|||
'disabled' means the regulator output is OFF and is not
|
||||
supplying power to the system..
|
||||
|
||||
'unknown' means software cannot determine the state.
|
||||
'unknown' means software cannot determine the state, or
|
||||
the reported state is invalid.
|
||||
|
||||
NOTE: this field can be used in conjunction with microvolts
|
||||
and microamps to determine regulator output levels.
|
||||
|
@ -53,9 +55,10 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
microvolts. This holds the regulator output voltage setting
|
||||
measured in microvolts (i.e. E-6 Volts).
|
||||
measured in microvolts (i.e. E-6 Volts), for regulators
|
||||
which can report that voltage.
|
||||
|
||||
NOTE: This value should not be used to determine the regulator
|
||||
output voltage level as this value is the same regardless of
|
||||
|
@ -67,9 +70,10 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
microamps. This holds the regulator output current limit
|
||||
setting measured in microamps (i.e. E-6 Amps).
|
||||
setting measured in microamps (i.e. E-6 Amps), for regulators
|
||||
which can report that current.
|
||||
|
||||
NOTE: This value should not be used to determine the regulator
|
||||
output current level as this value is the same regardless of
|
||||
|
@ -81,8 +85,9 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
opmode. This holds the regulator operating mode setting.
|
||||
Some regulator directories will contain a field called
|
||||
opmode. This holds the current regulator operating mode,
|
||||
for regulators which can report it.
|
||||
|
||||
The opmode value can be one of the following strings:
|
||||
|
||||
|
@ -92,7 +97,7 @@ Description:
|
|||
'standby'
|
||||
'unknown'
|
||||
|
||||
The modes are described in include/linux/regulator/regulator.h
|
||||
The modes are described in include/linux/regulator/consumer.h
|
||||
|
||||
NOTE: This value should not be used to determine the regulator
|
||||
output operating mode as this value is the same regardless of
|
||||
|
@ -104,9 +109,10 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
min_microvolts. This holds the minimum safe working regulator
|
||||
output voltage setting for this domain measured in microvolts.
|
||||
output voltage setting for this domain measured in microvolts,
|
||||
for regulators which support voltage constraints.
|
||||
|
||||
NOTE: this will return the string 'constraint not defined' if
|
||||
the power domain has no min microvolts constraint defined by
|
||||
|
@ -118,9 +124,10 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
max_microvolts. This holds the maximum safe working regulator
|
||||
output voltage setting for this domain measured in microvolts.
|
||||
output voltage setting for this domain measured in microvolts,
|
||||
for regulators which support voltage constraints.
|
||||
|
||||
NOTE: this will return the string 'constraint not defined' if
|
||||
the power domain has no max microvolts constraint defined by
|
||||
|
@ -132,10 +139,10 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
min_microamps. This holds the minimum safe working regulator
|
||||
output current limit setting for this domain measured in
|
||||
microamps.
|
||||
microamps, for regulators which support current constraints.
|
||||
|
||||
NOTE: this will return the string 'constraint not defined' if
|
||||
the power domain has no min microamps constraint defined by
|
||||
|
@ -147,10 +154,10 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
max_microamps. This holds the maximum safe working regulator
|
||||
output current limit setting for this domain measured in
|
||||
microamps.
|
||||
microamps, for regulators which support current constraints.
|
||||
|
||||
NOTE: this will return the string 'constraint not defined' if
|
||||
the power domain has no max microamps constraint defined by
|
||||
|
@ -185,7 +192,7 @@ Date: April 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
requested_microamps. This holds the total requested load
|
||||
current in microamps for this regulator from all its consumer
|
||||
devices.
|
||||
|
@ -204,125 +211,102 @@ Date: May 2008
|
|||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_mem_microvolts. This holds the regulator output
|
||||
voltage setting for this domain measured in microvolts when
|
||||
the system is suspended to memory.
|
||||
|
||||
NOTE: this will return the string 'not defined' if
|
||||
the power domain has no suspend to memory voltage defined by
|
||||
platform code.
|
||||
the system is suspended to memory, for voltage regulators
|
||||
implementing suspend voltage configuration constraints.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_disk_microvolts
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_disk_microvolts. This holds the regulator output
|
||||
voltage setting for this domain measured in microvolts when
|
||||
the system is suspended to disk.
|
||||
|
||||
NOTE: this will return the string 'not defined' if
|
||||
the power domain has no suspend to disk voltage defined by
|
||||
platform code.
|
||||
the system is suspended to disk, for voltage regulators
|
||||
implementing suspend voltage configuration constraints.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_standby_microvolts
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_standby_microvolts. This holds the regulator output
|
||||
voltage setting for this domain measured in microvolts when
|
||||
the system is suspended to standby.
|
||||
|
||||
NOTE: this will return the string 'not defined' if
|
||||
the power domain has no suspend to standby voltage defined by
|
||||
platform code.
|
||||
the system is suspended to standby, for voltage regulators
|
||||
implementing suspend voltage configuration constraints.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_mem_mode
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_mem_mode. This holds the regulator operating mode
|
||||
setting for this domain when the system is suspended to
|
||||
memory.
|
||||
|
||||
NOTE: this will return the string 'not defined' if
|
||||
the power domain has no suspend to memory mode defined by
|
||||
platform code.
|
||||
memory, for regulators implementing suspend mode
|
||||
configuration constraints.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_disk_mode
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_disk_mode. This holds the regulator operating mode
|
||||
setting for this domain when the system is suspended to disk.
|
||||
|
||||
NOTE: this will return the string 'not defined' if
|
||||
the power domain has no suspend to disk mode defined by
|
||||
platform code.
|
||||
setting for this domain when the system is suspended to disk,
|
||||
for regulators implementing suspend mode configuration
|
||||
constraints.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_standby_mode
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_standby_mode. This holds the regulator operating mode
|
||||
setting for this domain when the system is suspended to
|
||||
standby.
|
||||
|
||||
NOTE: this will return the string 'not defined' if
|
||||
the power domain has no suspend to standby mode defined by
|
||||
platform code.
|
||||
standby, for regulators implementing suspend mode
|
||||
configuration constraints.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_mem_state
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_mem_state. This holds the regulator operating state
|
||||
when suspended to memory.
|
||||
when suspended to memory, for regulators implementing suspend
|
||||
configuration constraints.
|
||||
|
||||
This will be one of the following strings:
|
||||
|
||||
'enabled'
|
||||
'disabled'
|
||||
'not defined'
|
||||
This will be one of the same strings reported by
|
||||
the "state" attribute.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_disk_state
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_disk_state. This holds the regulator operating state
|
||||
when suspended to disk.
|
||||
when suspended to disk, for regulators implementing
|
||||
suspend configuration constraints.
|
||||
|
||||
This will be one of the following strings:
|
||||
|
||||
'enabled'
|
||||
'disabled'
|
||||
'not defined'
|
||||
This will be one of the same strings reported by
|
||||
the "state" attribute.
|
||||
|
||||
What: /sys/class/regulator/.../suspend_standby_state
|
||||
Date: May 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Liam Girdwood <lrg@slimlogic.co.uk>
|
||||
Description:
|
||||
Each regulator directory will contain a field called
|
||||
Some regulator directories will contain a field called
|
||||
suspend_standby_state. This holds the regulator operating
|
||||
state when suspended to standby.
|
||||
state when suspended to standby, for regulators implementing
|
||||
suspend configuration constraints.
|
||||
|
||||
This will be one of the following strings:
|
||||
|
||||
'enabled'
|
||||
'disabled'
|
||||
'not defined'
|
||||
This will be one of the same strings reported by
|
||||
the "state" attribute.
|
||||
|
|
|
@ -12,7 +12,7 @@ DOCBOOKS := z8530book.xml mcabook.xml \
|
|||
kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
|
||||
gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \
|
||||
genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
|
||||
mac80211.xml debugobjects.xml sh.xml
|
||||
mac80211.xml debugobjects.xml sh.xml regulator.xml
|
||||
|
||||
###
|
||||
# The build process is as follows (targets):
|
||||
|
|
|
@ -0,0 +1,304 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
|
||||
|
||||
<book id="regulator-api">
|
||||
<bookinfo>
|
||||
<title>Voltage and current regulator API</title>
|
||||
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Liam</firstname>
|
||||
<surname>Girdwood</surname>
|
||||
<affiliation>
|
||||
<address>
|
||||
<email>lrg@slimlogic.co.uk</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Mark</firstname>
|
||||
<surname>Brown</surname>
|
||||
<affiliation>
|
||||
<orgname>Wolfson Microelectronics</orgname>
|
||||
<address>
|
||||
<email>broonie@opensource.wolfsonmicro.com</email>
|
||||
</address>
|
||||
</affiliation>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
<copyright>
|
||||
<year>2007-2008</year>
|
||||
<holder>Wolfson Microelectronics</holder>
|
||||
</copyright>
|
||||
<copyright>
|
||||
<year>2008</year>
|
||||
<holder>Liam Girdwood</holder>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
<para>
|
||||
This documentation is free software; you can redistribute
|
||||
it and/or modify it under the terms of the GNU General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This program is distributed in the hope that it will be
|
||||
useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU General Public License for more details.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
MA 02111-1307 USA
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For more details see the file COPYING in the source
|
||||
distribution of Linux.
|
||||
</para>
|
||||
</legalnotice>
|
||||
</bookinfo>
|
||||
|
||||
<toc></toc>
|
||||
|
||||
<chapter id="intro">
|
||||
<title>Introduction</title>
|
||||
<para>
|
||||
This framework is designed to provide a standard kernel
|
||||
interface to control voltage and current regulators.
|
||||
</para>
|
||||
<para>
|
||||
The intention is to allow systems to dynamically control
|
||||
regulator power output in order to save power and prolong
|
||||
battery life. This applies to both voltage regulators (where
|
||||
voltage output is controllable) and current sinks (where current
|
||||
limit is controllable).
|
||||
</para>
|
||||
<para>
|
||||
Note that additional (and currently more complete) documentation
|
||||
is available in the Linux kernel source under
|
||||
<filename>Documentation/power/regulator</filename>.
|
||||
</para>
|
||||
|
||||
<sect1 id="glossary">
|
||||
<title>Glossary</title>
|
||||
<para>
|
||||
The regulator API uses a number of terms which may not be
|
||||
familiar:
|
||||
</para>
|
||||
<glossary>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Regulator</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
Electronic device that supplies power to other devices. Most
|
||||
regulators can enable and disable their output and some can also
|
||||
control their output voltage or current.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Consumer</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
Electronic device which consumes power provided by a regulator.
|
||||
These may either be static, requiring only a fixed supply, or
|
||||
dynamic, requiring active management of the regulator at
|
||||
runtime.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Power Domain</glossterm>
|
||||
<glossdef>
|
||||
<para>
|
||||
The electronic circuit supplied by a given regulator, including
|
||||
the regulator and all consumer devices. The configuration of
|
||||
the regulator is shared between all the components in the
|
||||
circuit.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
|
||||
<glossentry>
|
||||
<glossterm>Power Management Integrated Circuit</glossterm>
|
||||
<acronym>PMIC</acronym>
|
||||
<glossdef>
|
||||
<para>
|
||||
An IC which contains numerous regulators and often also other
|
||||
subsystems. In an embedded system the primary PMIC is often
|
||||
equivalent to a combination of the PSU and southbridge in a
|
||||
desktop system.
|
||||
</para>
|
||||
</glossdef>
|
||||
</glossentry>
|
||||
</glossary>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<chapter id="consumer">
|
||||
<title>Consumer driver interface</title>
|
||||
<para>
|
||||
This offers a similar API to the kernel clock framework.
|
||||
Consumer drivers use <link
|
||||
linkend='API-regulator-get'>get</link> and <link
|
||||
linkend='API-regulator-put'>put</link> operations to acquire and
|
||||
release regulators. Functions are
|
||||
provided to <link linkend='API-regulator-enable'>enable</link>
|
||||
and <link linkend='API-regulator-disable'>disable</link> the
|
||||
reguator and to get and set the runtime parameters of the
|
||||
regulator.
|
||||
</para>
|
||||
<para>
|
||||
When requesting regulators consumers use symbolic names for their
|
||||
supplies, such as "Vcc", which are mapped into actual regulator
|
||||
devices by the machine interface.
|
||||
</para>
|
||||
<para>
|
||||
A stub version of this API is provided when the regulator
|
||||
framework is not in use in order to minimise the need to use
|
||||
ifdefs.
|
||||
</para>
|
||||
|
||||
<sect1 id="consumer-enable">
|
||||
<title>Enabling and disabling</title>
|
||||
<para>
|
||||
The regulator API provides reference counted enabling and
|
||||
disabling of regulators. Consumer devices use the <function><link
|
||||
linkend='API-regulator-enable'>regulator_enable</link></function>
|
||||
and <function><link
|
||||
linkend='API-regulator-disable'>regulator_disable</link>
|
||||
</function> functions to enable and disable regulators. Calls
|
||||
to the two functions must be balanced.
|
||||
</para>
|
||||
<para>
|
||||
Note that since multiple consumers may be using a regulator and
|
||||
machine constraints may not allow the regulator to be disabled
|
||||
there is no guarantee that calling
|
||||
<function>regulator_disable</function> will actually cause the
|
||||
supply provided by the regulator to be disabled. Consumer
|
||||
drivers should assume that the regulator may be enabled at all
|
||||
times.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="consumer-config">
|
||||
<title>Configuration</title>
|
||||
<para>
|
||||
Some consumer devices may need to be able to dynamically
|
||||
configure their supplies. For example, MMC drivers may need to
|
||||
select the correct operating voltage for their cards. This may
|
||||
be done while the regulator is enabled or disabled.
|
||||
</para>
|
||||
<para>
|
||||
The <function><link
|
||||
linkend='API-regulator-set-voltage'>regulator_set_voltage</link>
|
||||
</function> and <function><link
|
||||
linkend='API-regulator-set-current-limit'
|
||||
>regulator_set_current_limit</link>
|
||||
</function> functions provide the primary interface for this.
|
||||
Both take ranges of voltages and currents, supporting drivers
|
||||
that do not require a specific value (eg, CPU frequency scaling
|
||||
normally permits the CPU to use a wider range of supply
|
||||
voltages at lower frequencies but does not require that the
|
||||
supply voltage be lowered). Where an exact value is required
|
||||
both minimum and maximum values should be identical.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="consumer-callback">
|
||||
<title>Callbacks</title>
|
||||
<para>
|
||||
Callbacks may also be <link
|
||||
linkend='API-regulator-register-notifier'>registered</link>
|
||||
for events such as regulation failures.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<chapter id="driver">
|
||||
<title>Regulator driver interface</title>
|
||||
<para>
|
||||
Drivers for regulator chips <link
|
||||
linkend='API-regulator-register'>register</link> the regulators
|
||||
with the regulator core, providing operations structures to the
|
||||
core. A <link
|
||||
linkend='API-regulator-notifier-call-chain'>notifier</link> interface
|
||||
allows error conditions to be reported to the core.
|
||||
</para>
|
||||
<para>
|
||||
Registration should be triggered by explicit setup done by the
|
||||
platform, supplying a <link
|
||||
linkend='API-struct-regulator-init-data'>struct
|
||||
regulator_init_data</link> for the regulator containing
|
||||
<link linkend='machine-constraint'>constraint</link> and
|
||||
<link linkend='machine-supply'>supply</link> information.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="machine">
|
||||
<title>Machine interface</title>
|
||||
<para>
|
||||
This interface provides a way to define how regulators are
|
||||
connected to consumers on a given system and what the valid
|
||||
operating parameters are for the system.
|
||||
</para>
|
||||
|
||||
<sect1 id="machine-supply">
|
||||
<title>Supplies</title>
|
||||
<para>
|
||||
Regulator supplies are specified using <link
|
||||
linkend='API-struct-regulator-consumer-supply'>struct
|
||||
regulator_consumer_supply</link>. This is done at
|
||||
<link linkend='driver'>driver registration
|
||||
time</link> as part of the machine constraints.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="machine-constraint">
|
||||
<title>Constraints</title>
|
||||
<para>
|
||||
As well as definining the connections the machine interface
|
||||
also provides constraints definining the operations that
|
||||
clients are allowed to perform and the parameters that may be
|
||||
set. This is required since generally regulator devices will
|
||||
offer more flexibility than it is safe to use on a given
|
||||
system, for example supporting higher supply voltages than the
|
||||
consumers are rated for.
|
||||
</para>
|
||||
<para>
|
||||
This is done at <link linkend='driver'>driver
|
||||
registration time</link> by providing a <link
|
||||
linkend='API-struct-regulation-constraints'>struct
|
||||
regulation_constraints</link>.
|
||||
</para>
|
||||
<para>
|
||||
The constraints may also specify an initial configuration for the
|
||||
regulator in the constraints, which is particularly useful for
|
||||
use with static consumers.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<chapter id="api">
|
||||
<title>API reference</title>
|
||||
<para>
|
||||
Due to limitations of the kernel documentation framework and the
|
||||
existing layout of the source code the entire regulator API is
|
||||
documented here.
|
||||
</para>
|
||||
!Iinclude/linux/regulator/consumer.h
|
||||
!Iinclude/linux/regulator/machine.h
|
||||
!Iinclude/linux/regulator/driver.h
|
||||
!Edrivers/regulator/core.c
|
||||
</chapter>
|
||||
</book>
|
|
@ -12,6 +12,8 @@ rcuref.txt
|
|||
- Reference-count design for elements of lists/arrays protected by RCU
|
||||
rcu.txt
|
||||
- RCU Concepts
|
||||
rcubarrier.txt
|
||||
- Unloading modules that use RCU callbacks
|
||||
RTFP.txt
|
||||
- List of RCU papers (bibliography) going back to 1980.
|
||||
torture.txt
|
||||
|
|
|
@ -0,0 +1,304 @@
|
|||
RCU and Unloadable Modules
|
||||
|
||||
[Originally published in LWN Jan. 14, 2007: http://lwn.net/Articles/217484/]
|
||||
|
||||
RCU (read-copy update) is a synchronization mechanism that can be thought
|
||||
of as a replacement for read-writer locking (among other things), but with
|
||||
very low-overhead readers that are immune to deadlock, priority inversion,
|
||||
and unbounded latency. RCU read-side critical sections are delimited
|
||||
by rcu_read_lock() and rcu_read_unlock(), which, in non-CONFIG_PREEMPT
|
||||
kernels, generate no code whatsoever.
|
||||
|
||||
This means that RCU writers are unaware of the presence of concurrent
|
||||
readers, so that RCU updates to shared data must be undertaken quite
|
||||
carefully, leaving an old version of the data structure in place until all
|
||||
pre-existing readers have finished. These old versions are needed because
|
||||
such readers might hold a reference to them. RCU updates can therefore be
|
||||
rather expensive, and RCU is thus best suited for read-mostly situations.
|
||||
|
||||
How can an RCU writer possibly determine when all readers are finished,
|
||||
given that readers might well leave absolutely no trace of their
|
||||
presence? There is a synchronize_rcu() primitive that blocks until all
|
||||
pre-existing readers have completed. An updater wishing to delete an
|
||||
element p from a linked list might do the following, while holding an
|
||||
appropriate lock, of course:
|
||||
|
||||
list_del_rcu(p);
|
||||
synchronize_rcu();
|
||||
kfree(p);
|
||||
|
||||
But the above code cannot be used in IRQ context -- the call_rcu()
|
||||
primitive must be used instead. This primitive takes a pointer to an
|
||||
rcu_head struct placed within the RCU-protected data structure and
|
||||
another pointer to a function that may be invoked later to free that
|
||||
structure. Code to delete an element p from the linked list from IRQ
|
||||
context might then be as follows:
|
||||
|
||||
list_del_rcu(p);
|
||||
call_rcu(&p->rcu, p_callback);
|
||||
|
||||
Since call_rcu() never blocks, this code can safely be used from within
|
||||
IRQ context. The function p_callback() might be defined as follows:
|
||||
|
||||
static void p_callback(struct rcu_head *rp)
|
||||
{
|
||||
struct pstruct *p = container_of(rp, struct pstruct, rcu);
|
||||
|
||||
kfree(p);
|
||||
}
|
||||
|
||||
|
||||
Unloading Modules That Use call_rcu()
|
||||
|
||||
But what if p_callback is defined in an unloadable module?
|
||||
|
||||
If we unload the module while some RCU callbacks are pending,
|
||||
the CPUs executing these callbacks are going to be severely
|
||||
disappointed when they are later invoked, as fancifully depicted at
|
||||
http://lwn.net/images/ns/kernel/rcu-drop.jpg.
|
||||
|
||||
We could try placing a synchronize_rcu() in the module-exit code path,
|
||||
but this is not sufficient. Although synchronize_rcu() does wait for a
|
||||
grace period to elapse, it does not wait for the callbacks to complete.
|
||||
|
||||
One might be tempted to try several back-to-back synchronize_rcu()
|
||||
calls, but this is still not guaranteed to work. If there is a very
|
||||
heavy RCU-callback load, then some of the callbacks might be deferred
|
||||
in order to allow other processing to proceed. Such deferral is required
|
||||
in realtime kernels in order to avoid excessive scheduling latencies.
|
||||
|
||||
|
||||
rcu_barrier()
|
||||
|
||||
We instead need the rcu_barrier() primitive. This primitive is similar
|
||||
to synchronize_rcu(), but instead of waiting solely for a grace
|
||||
period to elapse, it also waits for all outstanding RCU callbacks to
|
||||
complete. Pseudo-code using rcu_barrier() is as follows:
|
||||
|
||||
1. Prevent any new RCU callbacks from being posted.
|
||||
2. Execute rcu_barrier().
|
||||
3. Allow the module to be unloaded.
|
||||
|
||||
Quick Quiz #1: Why is there no srcu_barrier()?
|
||||
|
||||
The rcutorture module makes use of rcu_barrier in its exit function
|
||||
as follows:
|
||||
|
||||
1 static void
|
||||
2 rcu_torture_cleanup(void)
|
||||
3 {
|
||||
4 int i;
|
||||
5
|
||||
6 fullstop = 1;
|
||||
7 if (shuffler_task != NULL) {
|
||||
8 VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task");
|
||||
9 kthread_stop(shuffler_task);
|
||||
10 }
|
||||
11 shuffler_task = NULL;
|
||||
12
|
||||
13 if (writer_task != NULL) {
|
||||
14 VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task");
|
||||
15 kthread_stop(writer_task);
|
||||
16 }
|
||||
17 writer_task = NULL;
|
||||
18
|
||||
19 if (reader_tasks != NULL) {
|
||||
20 for (i = 0; i < nrealreaders; i++) {
|
||||
21 if (reader_tasks[i] != NULL) {
|
||||
22 VERBOSE_PRINTK_STRING(
|
||||
23 "Stopping rcu_torture_reader task");
|
||||
24 kthread_stop(reader_tasks[i]);
|
||||
25 }
|
||||
26 reader_tasks[i] = NULL;
|
||||
27 }
|
||||
28 kfree(reader_tasks);
|
||||
29 reader_tasks = NULL;
|
||||
30 }
|
||||
31 rcu_torture_current = NULL;
|
||||
32
|
||||
33 if (fakewriter_tasks != NULL) {
|
||||
34 for (i = 0; i < nfakewriters; i++) {
|
||||
35 if (fakewriter_tasks[i] != NULL) {
|
||||
36 VERBOSE_PRINTK_STRING(
|
||||
37 "Stopping rcu_torture_fakewriter task");
|
||||
38 kthread_stop(fakewriter_tasks[i]);
|
||||
39 }
|
||||
40 fakewriter_tasks[i] = NULL;
|
||||
41 }
|
||||
42 kfree(fakewriter_tasks);
|
||||
43 fakewriter_tasks = NULL;
|
||||
44 }
|
||||
45
|
||||
46 if (stats_task != NULL) {
|
||||
47 VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task");
|
||||
48 kthread_stop(stats_task);
|
||||
49 }
|
||||
50 stats_task = NULL;
|
||||
51
|
||||
52 /* Wait for all RCU callbacks to fire. */
|
||||
53 rcu_barrier();
|
||||
54
|
||||
55 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */
|
||||
56
|
||||
57 if (cur_ops->cleanup != NULL)
|
||||
58 cur_ops->cleanup();
|
||||
59 if (atomic_read(&n_rcu_torture_error))
|
||||
60 rcu_torture_print_module_parms("End of test: FAILURE");
|
||||
61 else
|
||||
62 rcu_torture_print_module_parms("End of test: SUCCESS");
|
||||
63 }
|
||||
|
||||
Line 6 sets a global variable that prevents any RCU callbacks from
|
||||
re-posting themselves. This will not be necessary in most cases, since
|
||||
RCU callbacks rarely include calls to call_rcu(). However, the rcutorture
|
||||
module is an exception to this rule, and therefore needs to set this
|
||||
global variable.
|
||||
|
||||
Lines 7-50 stop all the kernel tasks associated with the rcutorture
|
||||
module. Therefore, once execution reaches line 53, no more rcutorture
|
||||
RCU callbacks will be posted. The rcu_barrier() call on line 53 waits
|
||||
for any pre-existing callbacks to complete.
|
||||
|
||||
Then lines 55-62 print status and do operation-specific cleanup, and
|
||||
then return, permitting the module-unload operation to be completed.
|
||||
|
||||
Quick Quiz #2: Is there any other situation where rcu_barrier() might
|
||||
be required?
|
||||
|
||||
Your module might have additional complications. For example, if your
|
||||
module invokes call_rcu() from timers, you will need to first cancel all
|
||||
the timers, and only then invoke rcu_barrier() to wait for any remaining
|
||||
RCU callbacks to complete.
|
||||
|
||||
|
||||
Implementing rcu_barrier()
|
||||
|
||||
Dipankar Sarma's implementation of rcu_barrier() makes use of the fact
|
||||
that RCU callbacks are never reordered once queued on one of the per-CPU
|
||||
queues. His implementation queues an RCU callback on each of the per-CPU
|
||||
callback queues, and then waits until they have all started executing, at
|
||||
which point, all earlier RCU callbacks are guaranteed to have completed.
|
||||
|
||||
The original code for rcu_barrier() was as follows:
|
||||
|
||||
1 void rcu_barrier(void)
|
||||
2 {
|
||||
3 BUG_ON(in_interrupt());
|
||||
4 /* Take cpucontrol mutex to protect against CPU hotplug */
|
||||
5 mutex_lock(&rcu_barrier_mutex);
|
||||
6 init_completion(&rcu_barrier_completion);
|
||||
7 atomic_set(&rcu_barrier_cpu_count, 0);
|
||||
8 on_each_cpu(rcu_barrier_func, NULL, 0, 1);
|
||||
9 wait_for_completion(&rcu_barrier_completion);
|
||||
10 mutex_unlock(&rcu_barrier_mutex);
|
||||
11 }
|
||||
|
||||
Line 3 verifies that the caller is in process context, and lines 5 and 10
|
||||
use rcu_barrier_mutex to ensure that only one rcu_barrier() is using the
|
||||
global completion and counters at a time, which are initialized on lines
|
||||
6 and 7. Line 8 causes each CPU to invoke rcu_barrier_func(), which is
|
||||
shown below. Note that the final "1" in on_each_cpu()'s argument list
|
||||
ensures that all the calls to rcu_barrier_func() will have completed
|
||||
before on_each_cpu() returns. Line 9 then waits for the completion.
|
||||
|
||||
This code was rewritten in 2008 to support rcu_barrier_bh() and
|
||||
rcu_barrier_sched() in addition to the original rcu_barrier().
|
||||
|
||||
The rcu_barrier_func() runs on each CPU, where it invokes call_rcu()
|
||||
to post an RCU callback, as follows:
|
||||
|
||||
1 static void rcu_barrier_func(void *notused)
|
||||
2 {
|
||||
3 int cpu = smp_processor_id();
|
||||
4 struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
|
||||
5 struct rcu_head *head;
|
||||
6
|
||||
7 head = &rdp->barrier;
|
||||
8 atomic_inc(&rcu_barrier_cpu_count);
|
||||
9 call_rcu(head, rcu_barrier_callback);
|
||||
10 }
|
||||
|
||||
Lines 3 and 4 locate RCU's internal per-CPU rcu_data structure,
|
||||
which contains the struct rcu_head that needed for the later call to
|
||||
call_rcu(). Line 7 picks up a pointer to this struct rcu_head, and line
|
||||
8 increments a global counter. This counter will later be decremented
|
||||
by the callback. Line 9 then registers the rcu_barrier_callback() on
|
||||
the current CPU's queue.
|
||||
|
||||
The rcu_barrier_callback() function simply atomically decrements the
|
||||
rcu_barrier_cpu_count variable and finalizes the completion when it
|
||||
reaches zero, as follows:
|
||||
|
||||
1 static void rcu_barrier_callback(struct rcu_head *notused)
|
||||
2 {
|
||||
3 if (atomic_dec_and_test(&rcu_barrier_cpu_count))
|
||||
4 complete(&rcu_barrier_completion);
|
||||
5 }
|
||||
|
||||
Quick Quiz #3: What happens if CPU 0's rcu_barrier_func() executes
|
||||
immediately (thus incrementing rcu_barrier_cpu_count to the
|
||||
value one), but the other CPU's rcu_barrier_func() invocations
|
||||
are delayed for a full grace period? Couldn't this result in
|
||||
rcu_barrier() returning prematurely?
|
||||
|
||||
|
||||
rcu_barrier() Summary
|
||||
|
||||
The rcu_barrier() primitive has seen relatively little use, since most
|
||||
code using RCU is in the core kernel rather than in modules. However, if
|
||||
you are using RCU from an unloadable module, you need to use rcu_barrier()
|
||||
so that your module may be safely unloaded.
|
||||
|
||||
|
||||
Answers to Quick Quizzes
|
||||
|
||||
Quick Quiz #1: Why is there no srcu_barrier()?
|
||||
|
||||
Answer: Since there is no call_srcu(), there can be no outstanding SRCU
|
||||
callbacks. Therefore, there is no need to wait for them.
|
||||
|
||||
Quick Quiz #2: Is there any other situation where rcu_barrier() might
|
||||
be required?
|
||||
|
||||
Answer: Interestingly enough, rcu_barrier() was not originally
|
||||
implemented for module unloading. Nikita Danilov was using
|
||||
RCU in a filesystem, which resulted in a similar situation at
|
||||
filesystem-unmount time. Dipankar Sarma coded up rcu_barrier()
|
||||
in response, so that Nikita could invoke it during the
|
||||
filesystem-unmount process.
|
||||
|
||||
Much later, yours truly hit the RCU module-unload problem when
|
||||
implementing rcutorture, and found that rcu_barrier() solves
|
||||
this problem as well.
|
||||
|
||||
Quick Quiz #3: What happens if CPU 0's rcu_barrier_func() executes
|
||||
immediately (thus incrementing rcu_barrier_cpu_count to the
|
||||
value one), but the other CPU's rcu_barrier_func() invocations
|
||||
are delayed for a full grace period? Couldn't this result in
|
||||
rcu_barrier() returning prematurely?
|
||||
|
||||
Answer: This cannot happen. The reason is that on_each_cpu() has its last
|
||||
argument, the wait flag, set to "1". This flag is passed through
|
||||
to smp_call_function() and further to smp_call_function_on_cpu(),
|
||||
causing this latter to spin until the cross-CPU invocation of
|
||||
rcu_barrier_func() has completed. This by itself would prevent
|
||||
a grace period from completing on non-CONFIG_PREEMPT kernels,
|
||||
since each CPU must undergo a context switch (or other quiescent
|
||||
state) before the grace period can complete. However, this is
|
||||
of no use in CONFIG_PREEMPT kernels.
|
||||
|
||||
Therefore, on_each_cpu() disables preemption across its call
|
||||
to smp_call_function() and also across the local call to
|
||||
rcu_barrier_func(). This prevents the local CPU from context
|
||||
switching, again preventing grace periods from completing. This
|
||||
means that all CPUs have executed rcu_barrier_func() before
|
||||
the first rcu_barrier_callback() can possibly execute, in turn
|
||||
preventing rcu_barrier_cpu_count from prematurely reaching zero.
|
||||
|
||||
Currently, -rt implementations of RCU keep but a single global
|
||||
queue for RCU callbacks, and thus do not suffer from this
|
||||
problem. However, when the -rt RCU eventually does have per-CPU
|
||||
callback queues, things will have to change. One simple change
|
||||
is to add an rcu_read_lock() before line 8 of rcu_barrier()
|
||||
and an rcu_read_unlock() after line 8 of this same function. If
|
||||
you can think of a better change, please let me know!
|
|
@ -0,0 +1,45 @@
|
|||
March 2008
|
||||
Jan-Simon Moeller, dl9pf@gmx.de
|
||||
|
||||
|
||||
How to deal with bad memory e.g. reported by memtest86+ ?
|
||||
#########################################################
|
||||
|
||||
There are three possibilities I know of:
|
||||
|
||||
1) Reinsert/swap the memory modules
|
||||
|
||||
2) Buy new modules (best!) or try to exchange the memory
|
||||
if you have spare-parts
|
||||
|
||||
3) Use BadRAM or memmap
|
||||
|
||||
This Howto is about number 3) .
|
||||
|
||||
|
||||
BadRAM
|
||||
######
|
||||
BadRAM is the actively developed and available as kernel-patch
|
||||
here: http://rick.vanrein.org/linux/badram/
|
||||
|
||||
For more details see the BadRAM documentation.
|
||||
|
||||
memmap
|
||||
######
|
||||
|
||||
memmap is already in the kernel and usable as kernel-parameter at
|
||||
boot-time. Its syntax is slightly strange and you may need to
|
||||
calculate the values by yourself!
|
||||
|
||||
Syntax to exclude a memory area (see kernel-parameters.txt for details):
|
||||
memmap=<size>$<address>
|
||||
|
||||
Example: memtest86+ reported here errors at address 0x18691458, 0x18698424 and
|
||||
some others. All had 0x1869xxxx in common, so I chose a pattern of
|
||||
0x18690000,0xffff0000.
|
||||
|
||||
With the numbers of the example above:
|
||||
memmap=64K$0x18690000
|
||||
or
|
||||
memmap=0x10000$0x18690000
|
||||
|
|
@ -227,7 +227,6 @@ Each cgroup is represented by a directory in the cgroup file system
|
|||
containing the following files describing that cgroup:
|
||||
|
||||
- tasks: list of tasks (by pid) attached to that cgroup
|
||||
- releasable flag: cgroup currently removeable?
|
||||
- notify_on_release flag: run the release agent on exit?
|
||||
- release_agent: the path to use for release notifications (this file
|
||||
exists in the top cgroup only)
|
||||
|
@ -360,7 +359,7 @@ Now you want to do something with this cgroup.
|
|||
|
||||
In this directory you can find several files:
|
||||
# ls
|
||||
notify_on_release releasable tasks
|
||||
notify_on_release tasks
|
||||
(plus whatever files added by the attached subsystems)
|
||||
|
||||
Now attach your shell to this cgroup:
|
||||
|
@ -479,7 +478,6 @@ newly-created cgroup if an error occurs after this subsystem's
|
|||
create() method has been called for the new cgroup).
|
||||
|
||||
void pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
(cgroup_mutex held by caller)
|
||||
|
||||
Called before checking the reference count on each subsystem. This may
|
||||
be useful for subsystems which have some extra references even if
|
||||
|
@ -498,6 +496,7 @@ remain valid while the caller holds cgroup_mutex.
|
|||
|
||||
void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup *old_cgrp, struct task_struct *task)
|
||||
(cgroup_mutex held by caller)
|
||||
|
||||
Called after the task has been attached to the cgroup, to allow any
|
||||
post-attachment activity that requires memory allocations or blocking.
|
||||
|
@ -511,6 +510,7 @@ void exit(struct cgroup_subsys *ss, struct task_struct *task)
|
|||
Called during task exit.
|
||||
|
||||
int populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
|
||||
(cgroup_mutex held by caller)
|
||||
|
||||
Called after creation of a cgroup to allow a subsystem to populate
|
||||
the cgroup directory with file entries. The subsystem should make
|
||||
|
@ -520,6 +520,7 @@ method can return an error code, the error code is currently not
|
|||
always handled well.
|
||||
|
||||
void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp)
|
||||
(cgroup_mutex held by caller)
|
||||
|
||||
Called at the end of cgroup_clone() to do any paramater
|
||||
initialization which might be required before a task could attach. For
|
||||
|
@ -527,7 +528,7 @@ example in cpusets, no task may attach before 'cpus' and 'mems' are set
|
|||
up.
|
||||
|
||||
void bind(struct cgroup_subsys *ss, struct cgroup *root)
|
||||
(cgroup_mutex held by caller)
|
||||
(cgroup_mutex and ss->hierarchy_mutex held by caller)
|
||||
|
||||
Called when a cgroup subsystem is rebound to a different hierarchy
|
||||
and root cgroup. Currently this will only involve movement between
|
||||
|
|
|
@ -0,0 +1,342 @@
|
|||
Memory Resource Controller(Memcg) Implementation Memo.
|
||||
Last Updated: 2008/12/15
|
||||
Base Kernel Version: based on 2.6.28-rc8-mm.
|
||||
|
||||
Because VM is getting complex (one of reasons is memcg...), memcg's behavior
|
||||
is complex. This is a document for memcg's internal behavior.
|
||||
Please note that implementation details can be changed.
|
||||
|
||||
(*) Topics on API should be in Documentation/controllers/memory.txt)
|
||||
|
||||
0. How to record usage ?
|
||||
2 objects are used.
|
||||
|
||||
page_cgroup ....an object per page.
|
||||
Allocated at boot or memory hotplug. Freed at memory hot removal.
|
||||
|
||||
swap_cgroup ... an entry per swp_entry.
|
||||
Allocated at swapon(). Freed at swapoff().
|
||||
|
||||
The page_cgroup has USED bit and double count against a page_cgroup never
|
||||
occurs. swap_cgroup is used only when a charged page is swapped-out.
|
||||
|
||||
1. Charge
|
||||
|
||||
a page/swp_entry may be charged (usage += PAGE_SIZE) at
|
||||
|
||||
mem_cgroup_newpage_charge()
|
||||
Called at new page fault and Copy-On-Write.
|
||||
|
||||
mem_cgroup_try_charge_swapin()
|
||||
Called at do_swap_page() (page fault on swap entry) and swapoff.
|
||||
Followed by charge-commit-cancel protocol. (With swap accounting)
|
||||
At commit, a charge recorded in swap_cgroup is removed.
|
||||
|
||||
mem_cgroup_cache_charge()
|
||||
Called at add_to_page_cache()
|
||||
|
||||
mem_cgroup_cache_charge_swapin()
|
||||
Called at shmem's swapin.
|
||||
|
||||
mem_cgroup_prepare_migration()
|
||||
Called before migration. "extra" charge is done and followed by
|
||||
charge-commit-cancel protocol.
|
||||
At commit, charge against oldpage or newpage will be committed.
|
||||
|
||||
2. Uncharge
|
||||
a page/swp_entry may be uncharged (usage -= PAGE_SIZE) by
|
||||
|
||||
mem_cgroup_uncharge_page()
|
||||
Called when an anonymous page is fully unmapped. I.e., mapcount goes
|
||||
to 0. If the page is SwapCache, uncharge is delayed until
|
||||
mem_cgroup_uncharge_swapcache().
|
||||
|
||||
mem_cgroup_uncharge_cache_page()
|
||||
Called when a page-cache is deleted from radix-tree. If the page is
|
||||
SwapCache, uncharge is delayed until mem_cgroup_uncharge_swapcache().
|
||||
|
||||
mem_cgroup_uncharge_swapcache()
|
||||
Called when SwapCache is removed from radix-tree. The charge itself
|
||||
is moved to swap_cgroup. (If mem+swap controller is disabled, no
|
||||
charge to swap occurs.)
|
||||
|
||||
mem_cgroup_uncharge_swap()
|
||||
Called when swp_entry's refcnt goes down to 0. A charge against swap
|
||||
disappears.
|
||||
|
||||
mem_cgroup_end_migration(old, new)
|
||||
At success of migration old is uncharged (if necessary), a charge
|
||||
to new page is committed. At failure, charge to old page is committed.
|
||||
|
||||
3. charge-commit-cancel
|
||||
In some case, we can't know this "charge" is valid or not at charging
|
||||
(because of races).
|
||||
To handle such case, there are charge-commit-cancel functions.
|
||||
mem_cgroup_try_charge_XXX
|
||||
mem_cgroup_commit_charge_XXX
|
||||
mem_cgroup_cancel_charge_XXX
|
||||
these are used in swap-in and migration.
|
||||
|
||||
At try_charge(), there are no flags to say "this page is charged".
|
||||
at this point, usage += PAGE_SIZE.
|
||||
|
||||
At commit(), the function checks the page should be charged or not
|
||||
and set flags or avoid charging.(usage -= PAGE_SIZE)
|
||||
|
||||
At cancel(), simply usage -= PAGE_SIZE.
|
||||
|
||||
Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
|
||||
|
||||
4. Anonymous
|
||||
Anonymous page is newly allocated at
|
||||
- page fault into MAP_ANONYMOUS mapping.
|
||||
- Copy-On-Write.
|
||||
It is charged right after it's allocated before doing any page table
|
||||
related operations. Of course, it's uncharged when another page is used
|
||||
for the fault address.
|
||||
|
||||
At freeing anonymous page (by exit() or munmap()), zap_pte() is called
|
||||
and pages for ptes are freed one by one.(see mm/memory.c). Uncharges
|
||||
are done at page_remove_rmap() when page_mapcount() goes down to 0.
|
||||
|
||||
Another page freeing is by page-reclaim (vmscan.c) and anonymous
|
||||
pages are swapped out. In this case, the page is marked as
|
||||
PageSwapCache(). uncharge() routine doesn't uncharge the page marked
|
||||
as SwapCache(). It's delayed until __delete_from_swap_cache().
|
||||
|
||||
4.1 Swap-in.
|
||||
At swap-in, the page is taken from swap-cache. There are 2 cases.
|
||||
|
||||
(a) If the SwapCache is newly allocated and read, it has no charges.
|
||||
(b) If the SwapCache has been mapped by processes, it has been
|
||||
charged already.
|
||||
|
||||
This swap-in is one of the most complicated work. In do_swap_page(),
|
||||
following events occur when pte is unchanged.
|
||||
|
||||
(1) the page (SwapCache) is looked up.
|
||||
(2) lock_page()
|
||||
(3) try_charge_swapin()
|
||||
(4) reuse_swap_page() (may call delete_swap_cache())
|
||||
(5) commit_charge_swapin()
|
||||
(6) swap_free().
|
||||
|
||||
Considering following situation for example.
|
||||
|
||||
(A) The page has not been charged before (2) and reuse_swap_page()
|
||||
doesn't call delete_from_swap_cache().
|
||||
(B) The page has not been charged before (2) and reuse_swap_page()
|
||||
calls delete_from_swap_cache().
|
||||
(C) The page has been charged before (2) and reuse_swap_page() doesn't
|
||||
call delete_from_swap_cache().
|
||||
(D) The page has been charged before (2) and reuse_swap_page() calls
|
||||
delete_from_swap_cache().
|
||||
|
||||
memory.usage/memsw.usage changes to this page/swp_entry will be
|
||||
Case (A) (B) (C) (D)
|
||||
Event
|
||||
Before (2) 0/ 1 0/ 1 1/ 1 1/ 1
|
||||
===========================================
|
||||
(3) +1/+1 +1/+1 +1/+1 +1/+1
|
||||
(4) - 0/ 0 - -1/ 0
|
||||
(5) 0/-1 0/ 0 -1/-1 0/ 0
|
||||
(6) - 0/-1 - 0/-1
|
||||
===========================================
|
||||
Result 1/ 1 1/ 1 1/ 1 1/ 1
|
||||
|
||||
In any cases, charges to this page should be 1/ 1.
|
||||
|
||||
4.2 Swap-out.
|
||||
At swap-out, typical state transition is below.
|
||||
|
||||
(a) add to swap cache. (marked as SwapCache)
|
||||
swp_entry's refcnt += 1.
|
||||
(b) fully unmapped.
|
||||
swp_entry's refcnt += # of ptes.
|
||||
(c) write back to swap.
|
||||
(d) delete from swap cache. (remove from SwapCache)
|
||||
swp_entry's refcnt -= 1.
|
||||
|
||||
|
||||
At (b), the page is marked as SwapCache and not uncharged.
|
||||
At (d), the page is removed from SwapCache and a charge in page_cgroup
|
||||
is moved to swap_cgroup.
|
||||
|
||||
Finally, at task exit,
|
||||
(e) zap_pte() is called and swp_entry's refcnt -=1 -> 0.
|
||||
Here, a charge in swap_cgroup disappears.
|
||||
|
||||
5. Page Cache
|
||||
Page Cache is charged at
|
||||
- add_to_page_cache_locked().
|
||||
|
||||
uncharged at
|
||||
- __remove_from_page_cache().
|
||||
|
||||
The logic is very clear. (About migration, see below)
|
||||
Note: __remove_from_page_cache() is called by remove_from_page_cache()
|
||||
and __remove_mapping().
|
||||
|
||||
6. Shmem(tmpfs) Page Cache
|
||||
Memcg's charge/uncharge have special handlers of shmem. The best way
|
||||
to understand shmem's page state transition is to read mm/shmem.c.
|
||||
But brief explanation of the behavior of memcg around shmem will be
|
||||
helpful to understand the logic.
|
||||
|
||||
Shmem's page (just leaf page, not direct/indirect block) can be on
|
||||
- radix-tree of shmem's inode.
|
||||
- SwapCache.
|
||||
- Both on radix-tree and SwapCache. This happens at swap-in
|
||||
and swap-out,
|
||||
|
||||
It's charged when...
|
||||
- A new page is added to shmem's radix-tree.
|
||||
- A swp page is read. (move a charge from swap_cgroup to page_cgroup)
|
||||
It's uncharged when
|
||||
- A page is removed from radix-tree and not SwapCache.
|
||||
- When SwapCache is removed, a charge is moved to swap_cgroup.
|
||||
- When swp_entry's refcnt goes down to 0, a charge in swap_cgroup
|
||||
disappears.
|
||||
|
||||
7. Page Migration
|
||||
One of the most complicated functions is page-migration-handler.
|
||||
Memcg has 2 routines. Assume that we are migrating a page's contents
|
||||
from OLDPAGE to NEWPAGE.
|
||||
|
||||
Usual migration logic is..
|
||||
(a) remove the page from LRU.
|
||||
(b) allocate NEWPAGE (migration target)
|
||||
(c) lock by lock_page().
|
||||
(d) unmap all mappings.
|
||||
(e-1) If necessary, replace entry in radix-tree.
|
||||
(e-2) move contents of a page.
|
||||
(f) map all mappings again.
|
||||
(g) pushback the page to LRU.
|
||||
(-) OLDPAGE will be freed.
|
||||
|
||||
Before (g), memcg should complete all necessary charge/uncharge to
|
||||
NEWPAGE/OLDPAGE.
|
||||
|
||||
The point is....
|
||||
- If OLDPAGE is anonymous, all charges will be dropped at (d) because
|
||||
try_to_unmap() drops all mapcount and the page will not be
|
||||
SwapCache.
|
||||
|
||||
- If OLDPAGE is SwapCache, charges will be kept at (g) because
|
||||
__delete_from_swap_cache() isn't called at (e-1)
|
||||
|
||||
- If OLDPAGE is page-cache, charges will be kept at (g) because
|
||||
remove_from_swap_cache() isn't called at (e-1)
|
||||
|
||||
memcg provides following hooks.
|
||||
|
||||
- mem_cgroup_prepare_migration(OLDPAGE)
|
||||
Called after (b) to account a charge (usage += PAGE_SIZE) against
|
||||
memcg which OLDPAGE belongs to.
|
||||
|
||||
- mem_cgroup_end_migration(OLDPAGE, NEWPAGE)
|
||||
Called after (f) before (g).
|
||||
If OLDPAGE is used, commit OLDPAGE again. If OLDPAGE is already
|
||||
charged, a charge by prepare_migration() is automatically canceled.
|
||||
If NEWPAGE is used, commit NEWPAGE and uncharge OLDPAGE.
|
||||
|
||||
But zap_pte() (by exit or munmap) can be called while migration,
|
||||
we have to check if OLDPAGE/NEWPAGE is a valid page after commit().
|
||||
|
||||
8. LRU
|
||||
Each memcg has its own private LRU. Now, it's handling is under global
|
||||
VM's control (means that it's handled under global zone->lru_lock).
|
||||
Almost all routines around memcg's LRU is called by global LRU's
|
||||
list management functions under zone->lru_lock().
|
||||
|
||||
A special function is mem_cgroup_isolate_pages(). This scans
|
||||
memcg's private LRU and call __isolate_lru_page() to extract a page
|
||||
from LRU.
|
||||
(By __isolate_lru_page(), the page is removed from both of global and
|
||||
private LRU.)
|
||||
|
||||
|
||||
9. Typical Tests.
|
||||
|
||||
Tests for racy cases.
|
||||
|
||||
9.1 Small limit to memcg.
|
||||
When you do test to do racy case, it's good test to set memcg's limit
|
||||
to be very small rather than GB. Many races found in the test under
|
||||
xKB or xxMB limits.
|
||||
(Memory behavior under GB and Memory behavior under MB shows very
|
||||
different situation.)
|
||||
|
||||
9.2 Shmem
|
||||
Historically, memcg's shmem handling was poor and we saw some amount
|
||||
of troubles here. This is because shmem is page-cache but can be
|
||||
SwapCache. Test with shmem/tmpfs is always good test.
|
||||
|
||||
9.3 Migration
|
||||
For NUMA, migration is an another special case. To do easy test, cpuset
|
||||
is useful. Following is a sample script to do migration.
|
||||
|
||||
mount -t cgroup -o cpuset none /opt/cpuset
|
||||
|
||||
mkdir /opt/cpuset/01
|
||||
echo 1 > /opt/cpuset/01/cpuset.cpus
|
||||
echo 0 > /opt/cpuset/01/cpuset.mems
|
||||
echo 1 > /opt/cpuset/01/cpuset.memory_migrate
|
||||
mkdir /opt/cpuset/02
|
||||
echo 1 > /opt/cpuset/02/cpuset.cpus
|
||||
echo 1 > /opt/cpuset/02/cpuset.mems
|
||||
echo 1 > /opt/cpuset/02/cpuset.memory_migrate
|
||||
|
||||
In above set, when you moves a task from 01 to 02, page migration to
|
||||
node 0 to node 1 will occur. Following is a script to migrate all
|
||||
under cpuset.
|
||||
--
|
||||
move_task()
|
||||
{
|
||||
for pid in $1
|
||||
do
|
||||
/bin/echo $pid >$2/tasks 2>/dev/null
|
||||
echo -n $pid
|
||||
echo -n " "
|
||||
done
|
||||
echo END
|
||||
}
|
||||
|
||||
G1_TASK=`cat ${G1}/tasks`
|
||||
G2_TASK=`cat ${G2}/tasks`
|
||||
move_task "${G1_TASK}" ${G2} &
|
||||
--
|
||||
9.4 Memory hotplug.
|
||||
memory hotplug test is one of good test.
|
||||
to offline memory, do following.
|
||||
# echo offline > /sys/devices/system/memory/memoryXXX/state
|
||||
(XXX is the place of memory)
|
||||
This is an easy way to test page migration, too.
|
||||
|
||||
9.5 mkdir/rmdir
|
||||
When using hierarchy, mkdir/rmdir test should be done.
|
||||
Use tests like the following.
|
||||
|
||||
echo 1 >/opt/cgroup/01/memory/use_hierarchy
|
||||
mkdir /opt/cgroup/01/child_a
|
||||
mkdir /opt/cgroup/01/child_b
|
||||
|
||||
set limit to 01.
|
||||
add limit to 01/child_b
|
||||
run jobs under child_a and child_b
|
||||
|
||||
create/delete following groups at random while jobs are running.
|
||||
/opt/cgroup/01/child_a/child_aa
|
||||
/opt/cgroup/01/child_b/child_bb
|
||||
/opt/cgroup/01/child_c
|
||||
|
||||
running new jobs in new group is also good.
|
||||
|
||||
9.6 Mount with other subsystems.
|
||||
Mounting with other subsystems is a good test because there is a
|
||||
race and lock dependency with other cgroup subsystems.
|
||||
|
||||
example)
|
||||
# mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices
|
||||
|
||||
and do task move, mkdir, rmdir etc...under this.
|
|
@ -137,7 +137,32 @@ behind this approach is that a cgroup that aggressively uses a shared
|
|||
page will eventually get charged for it (once it is uncharged from
|
||||
the cgroup that brought it in -- this will happen on memory pressure).
|
||||
|
||||
2.4 Reclaim
|
||||
Exception: If CONFIG_CGROUP_CGROUP_MEM_RES_CTLR_SWAP is not used..
|
||||
When you do swapoff and make swapped-out pages of shmem(tmpfs) to
|
||||
be backed into memory in force, charges for pages are accounted against the
|
||||
caller of swapoff rather than the users of shmem.
|
||||
|
||||
|
||||
2.4 Swap Extension (CONFIG_CGROUP_MEM_RES_CTLR_SWAP)
|
||||
Swap Extension allows you to record charge for swap. A swapped-in page is
|
||||
charged back to original page allocator if possible.
|
||||
|
||||
When swap is accounted, following files are added.
|
||||
- memory.memsw.usage_in_bytes.
|
||||
- memory.memsw.limit_in_bytes.
|
||||
|
||||
usage of mem+swap is limited by memsw.limit_in_bytes.
|
||||
|
||||
Note: why 'mem+swap' rather than swap.
|
||||
The global LRU(kswapd) can swap out arbitrary pages. Swap-out means
|
||||
to move account from memory to swap...there is no change in usage of
|
||||
mem+swap.
|
||||
|
||||
In other words, when we want to limit the usage of swap without affecting
|
||||
global LRU, mem+swap limit is better than just limiting swap from OS point
|
||||
of view.
|
||||
|
||||
2.5 Reclaim
|
||||
|
||||
Each cgroup maintains a per cgroup LRU that consists of an active
|
||||
and inactive list. When a cgroup goes over its limit, we first try
|
||||
|
@ -207,12 +232,6 @@ exceeded.
|
|||
The memory.stat file gives accounting information. Now, the number of
|
||||
caches, RSS and Active pages/Inactive pages are shown.
|
||||
|
||||
The memory.force_empty gives an interface to drop *all* charges by force.
|
||||
|
||||
# echo 1 > memory.force_empty
|
||||
|
||||
will drop all charges in cgroup. Currently, this is maintained for test.
|
||||
|
||||
4. Testing
|
||||
|
||||
Balbir posted lmbench, AIM9, LTP and vmmstress results [10] and [11].
|
||||
|
@ -242,10 +261,106 @@ reclaimed.
|
|||
|
||||
A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a
|
||||
cgroup might have some charge associated with it, even though all
|
||||
tasks have migrated away from it. Such charges are automatically dropped at
|
||||
rmdir() if there are no tasks.
|
||||
tasks have migrated away from it.
|
||||
Such charges are freed(at default) or moved to its parent. When moved,
|
||||
both of RSS and CACHES are moved to parent.
|
||||
If both of them are busy, rmdir() returns -EBUSY. See 5.1 Also.
|
||||
|
||||
5. TODO
|
||||
Charges recorded in swap information is not updated at removal of cgroup.
|
||||
Recorded information is discarded and a cgroup which uses swap (swapcache)
|
||||
will be charged as a new owner of it.
|
||||
|
||||
|
||||
5. Misc. interfaces.
|
||||
|
||||
5.1 force_empty
|
||||
memory.force_empty interface is provided to make cgroup's memory usage empty.
|
||||
You can use this interface only when the cgroup has no tasks.
|
||||
When writing anything to this
|
||||
|
||||
# echo 0 > memory.force_empty
|
||||
|
||||
Almost all pages tracked by this memcg will be unmapped and freed. Some of
|
||||
pages cannot be freed because it's locked or in-use. Such pages are moved
|
||||
to parent and this cgroup will be empty. But this may return -EBUSY in
|
||||
some too busy case.
|
||||
|
||||
Typical use case of this interface is that calling this before rmdir().
|
||||
Because rmdir() moves all pages to parent, some out-of-use page caches can be
|
||||
moved to the parent. If you want to avoid that, force_empty will be useful.
|
||||
|
||||
5.2 stat file
|
||||
memory.stat file includes following statistics (now)
|
||||
cache - # of pages from page-cache and shmem.
|
||||
rss - # of pages from anonymous memory.
|
||||
pgpgin - # of event of charging
|
||||
pgpgout - # of event of uncharging
|
||||
active_anon - # of pages on active lru of anon, shmem.
|
||||
inactive_anon - # of pages on active lru of anon, shmem
|
||||
active_file - # of pages on active lru of file-cache
|
||||
inactive_file - # of pages on inactive lru of file cache
|
||||
unevictable - # of pages cannot be reclaimed.(mlocked etc)
|
||||
|
||||
Below is depend on CONFIG_DEBUG_VM.
|
||||
inactive_ratio - VM inernal parameter. (see mm/page_alloc.c)
|
||||
recent_rotated_anon - VM internal parameter. (see mm/vmscan.c)
|
||||
recent_rotated_file - VM internal parameter. (see mm/vmscan.c)
|
||||
recent_scanned_anon - VM internal parameter. (see mm/vmscan.c)
|
||||
recent_scanned_file - VM internal parameter. (see mm/vmscan.c)
|
||||
|
||||
Memo:
|
||||
recent_rotated means recent frequency of lru rotation.
|
||||
recent_scanned means recent # of scans to lru.
|
||||
showing for better debug please see the code for meanings.
|
||||
|
||||
|
||||
5.3 swappiness
|
||||
Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
|
||||
|
||||
Following cgroup's swapiness can't be changed.
|
||||
- root cgroup (uses /proc/sys/vm/swappiness).
|
||||
- a cgroup which uses hierarchy and it has child cgroup.
|
||||
- a cgroup which uses hierarchy and not the root of hierarchy.
|
||||
|
||||
|
||||
6. Hierarchy support
|
||||
|
||||
The memory controller supports a deep hierarchy and hierarchical accounting.
|
||||
The hierarchy is created by creating the appropriate cgroups in the
|
||||
cgroup filesystem. Consider for example, the following cgroup filesystem
|
||||
hierarchy
|
||||
|
||||
root
|
||||
/ | \
|
||||
/ | \
|
||||
a b c
|
||||
| \
|
||||
| \
|
||||
d e
|
||||
|
||||
In the diagram above, with hierarchical accounting enabled, all memory
|
||||
usage of e, is accounted to its ancestors up until the root (i.e, c and root),
|
||||
that has memory.use_hierarchy enabled. If one of the ancestors goes over its
|
||||
limit, the reclaim algorithm reclaims from the tasks in the ancestor and the
|
||||
children of the ancestor.
|
||||
|
||||
6.1 Enabling hierarchical accounting and reclaim
|
||||
|
||||
The memory controller by default disables the hierarchy feature. Support
|
||||
can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup
|
||||
|
||||
# echo 1 > memory.use_hierarchy
|
||||
|
||||
The feature can be disabled by
|
||||
|
||||
# echo 0 > memory.use_hierarchy
|
||||
|
||||
NOTE1: Enabling/disabling will fail if the cgroup already has other
|
||||
cgroups created below it.
|
||||
|
||||
NOTE2: This feature can be enabled/disabled per subtree.
|
||||
|
||||
7. TODO
|
||||
|
||||
1. Add support for accounting huge pages (as a separate controller)
|
||||
2. Make per-cgroup scanner reclaim not-shared pages first
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
3.6 Constraints
|
||||
3.7 Example
|
||||
|
||||
4 DRIVER DEVELOPER NOTES
|
||||
4 DMAENGINE DRIVER DEVELOPER NOTES
|
||||
4.1 Conformance points
|
||||
4.2 "My application needs finer control of hardware channels"
|
||||
4.2 "My application needs exclusive control of hardware channels"
|
||||
|
||||
5 SOURCE
|
||||
|
||||
|
@ -150,6 +150,7 @@ ops_run_* and ops_complete_* routines in drivers/md/raid5.c for more
|
|||
implementation examples.
|
||||
|
||||
4 DRIVER DEVELOPMENT NOTES
|
||||
|
||||
4.1 Conformance points:
|
||||
There are a few conformance points required in dmaengine drivers to
|
||||
accommodate assumptions made by applications using the async_tx API:
|
||||
|
@ -158,58 +159,49 @@ accommodate assumptions made by applications using the async_tx API:
|
|||
3/ Use async_tx_run_dependencies() in the descriptor clean up path to
|
||||
handle submission of dependent operations
|
||||
|
||||
4.2 "My application needs finer control of hardware channels"
|
||||
This requirement seems to arise from cases where a DMA engine driver is
|
||||
trying to support device-to-memory DMA. The dmaengine and async_tx
|
||||
implementations were designed for offloading memory-to-memory
|
||||
operations; however, there are some capabilities of the dmaengine layer
|
||||
that can be used for platform-specific channel management.
|
||||
Platform-specific constraints can be handled by registering the
|
||||
application as a 'dma_client' and implementing a 'dma_event_callback' to
|
||||
apply a filter to the available channels in the system. Before showing
|
||||
how to implement a custom dma_event callback some background of
|
||||
dmaengine's client support is required.
|
||||
4.2 "My application needs exclusive control of hardware channels"
|
||||
Primarily this requirement arises from cases where a DMA engine driver
|
||||
is being used to support device-to-memory operations. A channel that is
|
||||
performing these operations cannot, for many platform specific reasons,
|
||||
be shared. For these cases the dma_request_channel() interface is
|
||||
provided.
|
||||
|
||||
The following routines in dmaengine support multiple clients requesting
|
||||
use of a channel:
|
||||
- dma_async_client_register(struct dma_client *client)
|
||||
- dma_async_client_chan_request(struct dma_client *client)
|
||||
The interface is:
|
||||
struct dma_chan *dma_request_channel(dma_cap_mask_t mask,
|
||||
dma_filter_fn filter_fn,
|
||||
void *filter_param);
|
||||
|
||||
dma_async_client_register takes a pointer to an initialized dma_client
|
||||
structure. It expects that the 'event_callback' and 'cap_mask' fields
|
||||
are already initialized.
|
||||
Where dma_filter_fn is defined as:
|
||||
typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
|
||||
|
||||
dma_async_client_chan_request triggers dmaengine to notify the client of
|
||||
all channels that satisfy the capability mask. It is up to the client's
|
||||
event_callback routine to track how many channels the client needs and
|
||||
how many it is currently using. The dma_event_callback routine returns a
|
||||
dma_state_client code to let dmaengine know the status of the
|
||||
allocation.
|
||||
When the optional 'filter_fn' parameter is set to NULL
|
||||
dma_request_channel simply returns the first channel that satisfies the
|
||||
capability mask. Otherwise, when the mask parameter is insufficient for
|
||||
specifying the necessary channel, the filter_fn routine can be used to
|
||||
disposition the available channels in the system. The filter_fn routine
|
||||
is called once for each free channel in the system. Upon seeing a
|
||||
suitable channel filter_fn returns DMA_ACK which flags that channel to
|
||||
be the return value from dma_request_channel. A channel allocated via
|
||||
this interface is exclusive to the caller, until dma_release_channel()
|
||||
is called.
|
||||
|
||||
Below is the example of how to extend this functionality for
|
||||
platform-specific filtering of the available channels beyond the
|
||||
standard capability mask:
|
||||
The DMA_PRIVATE capability flag is used to tag dma devices that should
|
||||
not be used by the general-purpose allocator. It can be set at
|
||||
initialization time if it is known that a channel will always be
|
||||
private. Alternatively, it is set when dma_request_channel() finds an
|
||||
unused "public" channel.
|
||||
|
||||
static enum dma_state_client
|
||||
my_dma_client_callback(struct dma_client *client,
|
||||
struct dma_chan *chan, enum dma_state state)
|
||||
{
|
||||
struct dma_device *dma_dev;
|
||||
struct my_platform_specific_dma *plat_dma_dev;
|
||||
|
||||
dma_dev = chan->device;
|
||||
plat_dma_dev = container_of(dma_dev,
|
||||
struct my_platform_specific_dma,
|
||||
dma_dev);
|
||||
|
||||
if (!plat_dma_dev->platform_specific_capability)
|
||||
return DMA_DUP;
|
||||
|
||||
. . .
|
||||
}
|
||||
A couple caveats to note when implementing a driver and consumer:
|
||||
1/ Once a channel has been privately allocated it will no longer be
|
||||
considered by the general-purpose allocator even after a call to
|
||||
dma_release_channel().
|
||||
2/ Since capabilities are specified at the device level a dma_device
|
||||
with multiple channels will either have all channels public, or all
|
||||
channels private.
|
||||
|
||||
5 SOURCE
|
||||
include/linux/dmaengine.h: core header file for DMA drivers and clients
|
||||
|
||||
include/linux/dmaengine.h: core header file for DMA drivers and api users
|
||||
drivers/dma/dmaengine.c: offload engine channel management routines
|
||||
drivers/dma/: location for offload engine drivers
|
||||
include/linux/async_tx.h: core header file for the async_tx api
|
||||
|
|
|
@ -375,10 +375,10 @@ say, this can be a large job, so it is best to be sure that the
|
|||
justification is solid.
|
||||
|
||||
When making an incompatible API change, one should, whenever possible,
|
||||
ensure that code which has not been updated is caught by the compiler.
|
||||
ensure that code which has not been updated is caught by the compiler.
|
||||
This will help you to be sure that you have found all in-tree uses of that
|
||||
interface. It will also alert developers of out-of-tree code that there is
|
||||
a change that they need to respond to. Supporting out-of-tree code is not
|
||||
something that kernel developers need to be worried about, but we also do
|
||||
not have to make life harder for out-of-tree developers than it it needs to
|
||||
be.
|
||||
not have to make life harder for out-of-tree developers than it needs to
|
||||
be.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
See Documentation/crypto/async-tx-api.txt
|
|
@ -97,8 +97,8 @@ prototypes:
|
|||
void (*put_super) (struct super_block *);
|
||||
void (*write_super) (struct super_block *);
|
||||
int (*sync_fs)(struct super_block *sb, int wait);
|
||||
void (*write_super_lockfs) (struct super_block *);
|
||||
void (*unlockfs) (struct super_block *);
|
||||
int (*freeze_fs) (struct super_block *);
|
||||
int (*unfreeze_fs) (struct super_block *);
|
||||
int (*statfs) (struct dentry *, struct kstatfs *);
|
||||
int (*remount_fs) (struct super_block *, int *, char *);
|
||||
void (*clear_inode) (struct inode *);
|
||||
|
@ -119,8 +119,8 @@ delete_inode: no
|
|||
put_super: yes yes no
|
||||
write_super: no yes read
|
||||
sync_fs: no no read
|
||||
write_super_lockfs: ?
|
||||
unlockfs: ?
|
||||
freeze_fs: ?
|
||||
unfreeze_fs: ?
|
||||
statfs: no no no
|
||||
remount_fs: yes yes maybe (see below)
|
||||
clear_inode: no
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
|
||||
BTRFS
|
||||
=====
|
||||
|
||||
Btrfs is a new copy on write filesystem for Linux aimed at
|
||||
implementing advanced features while focusing on fault tolerance,
|
||||
repair and easy administration. Initially developed by Oracle, Btrfs
|
||||
is licensed under the GPL and open for contribution from anyone.
|
||||
|
||||
Linux has a wealth of filesystems to choose from, but we are facing a
|
||||
number of challenges with scaling to the large storage subsystems that
|
||||
are becoming common in today's data centers. Filesystems need to scale
|
||||
in their ability to address and manage large storage, and also in
|
||||
their ability to detect, repair and tolerate errors in the data stored
|
||||
on disk. Btrfs is under heavy development, and is not suitable for
|
||||
any uses other than benchmarking and review. The Btrfs disk format is
|
||||
not yet finalized.
|
||||
|
||||
The main Btrfs features include:
|
||||
|
||||
* Extent based file storage (2^64 max file size)
|
||||
* Space efficient packing of small files
|
||||
* Space efficient indexed directories
|
||||
* Dynamic inode allocation
|
||||
* Writable snapshots
|
||||
* Subvolumes (separate internal filesystem roots)
|
||||
* Object level mirroring and striping
|
||||
* Checksums on data and metadata (multiple algorithms available)
|
||||
* Compression
|
||||
* Integrated multiple device support, with several raid algorithms
|
||||
* Online filesystem check (not yet implemented)
|
||||
* Very fast offline filesystem check
|
||||
* Efficient incremental backup and FS mirroring (not yet implemented)
|
||||
* Online filesystem defragmentation
|
||||
|
||||
|
||||
|
||||
MAILING LIST
|
||||
============
|
||||
|
||||
There is a Btrfs mailing list hosted on vger.kernel.org. You can
|
||||
find details on how to subscribe here:
|
||||
|
||||
http://vger.kernel.org/vger-lists.html#linux-btrfs
|
||||
|
||||
Mailing list archives are available from gmane:
|
||||
|
||||
http://dir.gmane.org/gmane.comp.file-systems.btrfs
|
||||
|
||||
|
||||
|
||||
IRC
|
||||
===
|
||||
|
||||
Discussion of Btrfs also occurs on the #btrfs channel of the Freenode
|
||||
IRC network.
|
||||
|
||||
|
||||
|
||||
UTILITIES
|
||||
=========
|
||||
|
||||
Userspace tools for creating and manipulating Btrfs file systems are
|
||||
available from the git repository at the following location:
|
||||
|
||||
http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs-unstable.git
|
||||
git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git
|
||||
|
||||
These include the following tools:
|
||||
|
||||
mkfs.btrfs: create a filesystem
|
||||
|
||||
btrfsctl: control program to create snapshots and subvolumes:
|
||||
|
||||
mount /dev/sda2 /mnt
|
||||
btrfsctl -s new_subvol_name /mnt
|
||||
btrfsctl -s snapshot_of_default /mnt/default
|
||||
btrfsctl -s snapshot_of_new_subvol /mnt/new_subvol_name
|
||||
btrfsctl -s snapshot_of_a_snapshot /mnt/snapshot_of_new_subvol
|
||||
ls /mnt
|
||||
default snapshot_of_a_snapshot snapshot_of_new_subvol
|
||||
new_subvol_name snapshot_of_default
|
||||
|
||||
Snapshots and subvolumes cannot be deleted right now, but you can
|
||||
rm -rf all the files and directories inside them.
|
||||
|
||||
btrfsck: do a limited check of the FS extent trees.
|
||||
|
||||
btrfs-debug-tree: print all of the FS metadata in text form. Example:
|
||||
|
||||
btrfs-debug-tree /dev/sda2 >& big_output_file
|
|
@ -58,13 +58,22 @@ Note: More extensive information for getting started with ext4 can be
|
|||
|
||||
# mount -t ext4 /dev/hda1 /wherever
|
||||
|
||||
- When comparing performance with other filesystems, remember that
|
||||
ext3/4 by default offers higher data integrity guarantees than most.
|
||||
So when comparing with a metadata-only journalling filesystem, such
|
||||
as ext3, use `mount -o data=writeback'. And you might as well use
|
||||
`mount -o nobh' too along with it. Making the journal larger than
|
||||
the mke2fs default often helps performance with metadata-intensive
|
||||
workloads.
|
||||
- When comparing performance with other filesystems, it's always
|
||||
important to try multiple workloads; very often a subtle change in a
|
||||
workload parameter can completely change the ranking of which
|
||||
filesystems do well compared to others. When comparing versus ext3,
|
||||
note that ext4 enables write barriers by default, while ext3 does
|
||||
not enable write barriers by default. So it is useful to use
|
||||
explicitly specify whether barriers are enabled or not when via the
|
||||
'-o barriers=[0|1]' mount option for both ext3 and ext4 filesystems
|
||||
for a fair comparison. When tuning ext3 for best benchmark numbers,
|
||||
it is often worthwhile to try changing the data journaling mode; '-o
|
||||
data=writeback,nobh' can be faster for some workloads. (Note
|
||||
however that running mounted with data=writeback can potentially
|
||||
leave stale data exposed in recently written files in case of an
|
||||
unclean shutdown, which could be a security exposure in some
|
||||
situations.) Configuring the filesystem with a large journal can
|
||||
also be helpful for metadata-intensive workloads.
|
||||
|
||||
2. Features
|
||||
===========
|
||||
|
@ -74,7 +83,7 @@ Note: More extensive information for getting started with ext4 can be
|
|||
* ability to use filesystems > 16TB (e2fsprogs support not available yet)
|
||||
* extent format reduces metadata overhead (RAM, IO for access, transactions)
|
||||
* extent format more robust in face of on-disk corruption due to magics,
|
||||
* internal redunancy in tree
|
||||
* internal redundancy in tree
|
||||
* improved file allocation (multi-block alloc)
|
||||
* fix 32000 subdirectory limit
|
||||
* nsec timestamps for mtime, atime, ctime, create time
|
||||
|
@ -116,10 +125,11 @@ grouping of bitmaps and inode tables. Some test results available here:
|
|||
When mounting an ext4 filesystem, the following option are accepted:
|
||||
(*) == default
|
||||
|
||||
extents (*) ext4 will use extents to address file data. The
|
||||
file system will no longer be mountable by ext3.
|
||||
|
||||
noextents ext4 will not use extents for newly created files
|
||||
ro Mount filesystem read only. Note that ext4 will
|
||||
replay the journal (and thus write to the
|
||||
partition) even when mounted "read only". The
|
||||
mount options "ro,noload" can be used to prevent
|
||||
writes to the filesystem.
|
||||
|
||||
journal_checksum Enable checksumming of the journal transactions.
|
||||
This will allow the recovery code in e2fsck and the
|
||||
|
@ -134,17 +144,17 @@ journal_async_commit Commit block can be written to disk without waiting
|
|||
journal=update Update the ext4 file system's journal to the current
|
||||
format.
|
||||
|
||||
journal=inum When a journal already exists, this option is ignored.
|
||||
Otherwise, it specifies the number of the inode which
|
||||
will represent the ext4 file system's journal file.
|
||||
|
||||
journal_dev=devnum When the external journal device's major/minor numbers
|
||||
have changed, this option allows the user to specify
|
||||
the new journal location. The journal device is
|
||||
identified through its new major/minor numbers encoded
|
||||
in devnum.
|
||||
|
||||
noload Don't load the journal on mounting.
|
||||
noload Don't load the journal on mounting. Note that
|
||||
if the filesystem was not unmounted cleanly,
|
||||
skipping the journal replay will lead to the
|
||||
filesystem containing inconsistencies that can
|
||||
lead to any number of problems.
|
||||
|
||||
data=journal All data are committed into the journal prior to being
|
||||
written into the main file system.
|
||||
|
@ -219,9 +229,12 @@ minixdf Make 'df' act like Minix.
|
|||
|
||||
debug Extra debugging information is sent to syslog.
|
||||
|
||||
errors=remount-ro(*) Remount the filesystem read-only on an error.
|
||||
errors=remount-ro Remount the filesystem read-only on an error.
|
||||
errors=continue Keep going on a filesystem error.
|
||||
errors=panic Panic and halt the machine if an error occurs.
|
||||
(These mount options override the errors behavior
|
||||
specified in the superblock, which can be configured
|
||||
using tune2fs)
|
||||
|
||||
data_err=ignore(*) Just print an error message if an error occurs
|
||||
in a file data buffer in ordered mode.
|
||||
|
@ -261,6 +274,42 @@ delalloc (*) Deferring block allocation until write-out time.
|
|||
nodelalloc Disable delayed allocation. Blocks are allocation
|
||||
when data is copied from user to page cache.
|
||||
|
||||
max_batch_time=usec Maximum amount of time ext4 should wait for
|
||||
additional filesystem operations to be batch
|
||||
together with a synchronous write operation.
|
||||
Since a synchronous write operation is going to
|
||||
force a commit and then a wait for the I/O
|
||||
complete, it doesn't cost much, and can be a
|
||||
huge throughput win, we wait for a small amount
|
||||
of time to see if any other transactions can
|
||||
piggyback on the synchronous write. The
|
||||
algorithm used is designed to automatically tune
|
||||
for the speed of the disk, by measuring the
|
||||
amount of time (on average) that it takes to
|
||||
finish committing a transaction. Call this time
|
||||
the "commit time". If the time that the
|
||||
transactoin has been running is less than the
|
||||
commit time, ext4 will try sleeping for the
|
||||
commit time to see if other operations will join
|
||||
the transaction. The commit time is capped by
|
||||
the max_batch_time, which defaults to 15000us
|
||||
(15ms). This optimization can be turned off
|
||||
entirely by setting max_batch_time to 0.
|
||||
|
||||
min_batch_time=usec This parameter sets the commit time (as
|
||||
described above) to be at least min_batch_time.
|
||||
It defaults to zero microseconds. Increasing
|
||||
this parameter may improve the throughput of
|
||||
multi-threaded, synchronous workloads on very
|
||||
fast disks, at the cost of increasing latency.
|
||||
|
||||
journal_ioprio=prio The I/O priority (from 0 to 7, where 0 is the
|
||||
highest priorty) which should be used for I/O
|
||||
operations submitted by kjournald2 during a
|
||||
commit operation. This defaults to 3, which is
|
||||
a slightly higher priority than the default I/O
|
||||
priority.
|
||||
|
||||
Data Mode
|
||||
=========
|
||||
There are 3 different data modes:
|
||||
|
|
|
@ -0,0 +1,225 @@
|
|||
SQUASHFS 4.0 FILESYSTEM
|
||||
=======================
|
||||
|
||||
Squashfs is a compressed read-only filesystem for Linux.
|
||||
It uses zlib compression to compress files, inodes and directories.
|
||||
Inodes in the system are very small and all blocks are packed to minimise
|
||||
data overhead. Block sizes greater than 4K are supported up to a maximum
|
||||
of 1Mbytes (default block size 128K).
|
||||
|
||||
Squashfs is intended for general read-only filesystem use, for archival
|
||||
use (i.e. in cases where a .tar.gz file may be used), and in constrained
|
||||
block device/memory systems (e.g. embedded systems) where low overhead is
|
||||
needed.
|
||||
|
||||
Mailing list: squashfs-devel@lists.sourceforge.net
|
||||
Web site: www.squashfs.org
|
||||
|
||||
1. FILESYSTEM FEATURES
|
||||
----------------------
|
||||
|
||||
Squashfs filesystem features versus Cramfs:
|
||||
|
||||
Squashfs Cramfs
|
||||
|
||||
Max filesystem size: 2^64 16 MiB
|
||||
Max file size: ~ 2 TiB 16 MiB
|
||||
Max files: unlimited unlimited
|
||||
Max directories: unlimited unlimited
|
||||
Max entries per directory: unlimited unlimited
|
||||
Max block size: 1 MiB 4 KiB
|
||||
Metadata compression: yes no
|
||||
Directory indexes: yes no
|
||||
Sparse file support: yes no
|
||||
Tail-end packing (fragments): yes no
|
||||
Exportable (NFS etc.): yes no
|
||||
Hard link support: yes no
|
||||
"." and ".." in readdir: yes no
|
||||
Real inode numbers: yes no
|
||||
32-bit uids/gids: yes no
|
||||
File creation time: yes no
|
||||
Xattr and ACL support: no no
|
||||
|
||||
Squashfs compresses data, inodes and directories. In addition, inode and
|
||||
directory data are highly compacted, and packed on byte boundaries. Each
|
||||
compressed inode is on average 8 bytes in length (the exact length varies on
|
||||
file type, i.e. regular file, directory, symbolic link, and block/char device
|
||||
inodes have different sizes).
|
||||
|
||||
2. USING SQUASHFS
|
||||
-----------------
|
||||
|
||||
As squashfs is a read-only filesystem, the mksquashfs program must be used to
|
||||
create populated squashfs filesystems. This and other squashfs utilities
|
||||
can be obtained from http://www.squashfs.org. Usage instructions can be
|
||||
obtained from this site also.
|
||||
|
||||
|
||||
3. SQUASHFS FILESYSTEM DESIGN
|
||||
-----------------------------
|
||||
|
||||
A squashfs filesystem consists of seven parts, packed together on a byte
|
||||
alignment:
|
||||
|
||||
---------------
|
||||
| superblock |
|
||||
|---------------|
|
||||
| datablocks |
|
||||
| & fragments |
|
||||
|---------------|
|
||||
| inode table |
|
||||
|---------------|
|
||||
| directory |
|
||||
| table |
|
||||
|---------------|
|
||||
| fragment |
|
||||
| table |
|
||||
|---------------|
|
||||
| export |
|
||||
| table |
|
||||
|---------------|
|
||||
| uid/gid |
|
||||
| lookup table |
|
||||
---------------
|
||||
|
||||
Compressed data blocks are written to the filesystem as files are read from
|
||||
the source directory, and checked for duplicates. Once all file data has been
|
||||
written the completed inode, directory, fragment, export and uid/gid lookup
|
||||
tables are written.
|
||||
|
||||
3.1 Inodes
|
||||
----------
|
||||
|
||||
Metadata (inodes and directories) are compressed in 8Kbyte blocks. Each
|
||||
compressed block is prefixed by a two byte length, the top bit is set if the
|
||||
block is uncompressed. A block will be uncompressed if the -noI option is set,
|
||||
or if the compressed block was larger than the uncompressed block.
|
||||
|
||||
Inodes are packed into the metadata blocks, and are not aligned to block
|
||||
boundaries, therefore inodes overlap compressed blocks. Inodes are identified
|
||||
by a 48-bit number which encodes the location of the compressed metadata block
|
||||
containing the inode, and the byte offset into that block where the inode is
|
||||
placed (<block, offset>).
|
||||
|
||||
To maximise compression there are different inodes for each file type
|
||||
(regular file, directory, device, etc.), the inode contents and length
|
||||
varying with the type.
|
||||
|
||||
To further maximise compression, two types of regular file inode and
|
||||
directory inode are defined: inodes optimised for frequently occurring
|
||||
regular files and directories, and extended types where extra
|
||||
information has to be stored.
|
||||
|
||||
3.2 Directories
|
||||
---------------
|
||||
|
||||
Like inodes, directories are packed into compressed metadata blocks, stored
|
||||
in a directory table. Directories are accessed using the start address of
|
||||
the metablock containing the directory and the offset into the
|
||||
decompressed block (<block, offset>).
|
||||
|
||||
Directories are organised in a slightly complex way, and are not simply
|
||||
a list of file names. The organisation takes advantage of the
|
||||
fact that (in most cases) the inodes of the files will be in the same
|
||||
compressed metadata block, and therefore, can share the start block.
|
||||
Directories are therefore organised in a two level list, a directory
|
||||
header containing the shared start block value, and a sequence of directory
|
||||
entries, each of which share the shared start block. A new directory header
|
||||
is written once/if the inode start block changes. The directory
|
||||
header/directory entry list is repeated as many times as necessary.
|
||||
|
||||
Directories are sorted, and can contain a directory index to speed up
|
||||
file lookup. Directory indexes store one entry per metablock, each entry
|
||||
storing the index/filename mapping to the first directory header
|
||||
in each metadata block. Directories are sorted in alphabetical order,
|
||||
and at lookup the index is scanned linearly looking for the first filename
|
||||
alphabetically larger than the filename being looked up. At this point the
|
||||
location of the metadata block the filename is in has been found.
|
||||
The general idea of the index is ensure only one metadata block needs to be
|
||||
decompressed to do a lookup irrespective of the length of the directory.
|
||||
This scheme has the advantage that it doesn't require extra memory overhead
|
||||
and doesn't require much extra storage on disk.
|
||||
|
||||
3.3 File data
|
||||
-------------
|
||||
|
||||
Regular files consist of a sequence of contiguous compressed blocks, and/or a
|
||||
compressed fragment block (tail-end packed block). The compressed size
|
||||
of each datablock is stored in a block list contained within the
|
||||
file inode.
|
||||
|
||||
To speed up access to datablocks when reading 'large' files (256 Mbytes or
|
||||
larger), the code implements an index cache that caches the mapping from
|
||||
block index to datablock location on disk.
|
||||
|
||||
The index cache allows Squashfs to handle large files (up to 1.75 TiB) while
|
||||
retaining a simple and space-efficient block list on disk. The cache
|
||||
is split into slots, caching up to eight 224 GiB files (128 KiB blocks).
|
||||
Larger files use multiple slots, with 1.75 TiB files using all 8 slots.
|
||||
The index cache is designed to be memory efficient, and by default uses
|
||||
16 KiB.
|
||||
|
||||
3.4 Fragment lookup table
|
||||
-------------------------
|
||||
|
||||
Regular files can contain a fragment index which is mapped to a fragment
|
||||
location on disk and compressed size using a fragment lookup table. This
|
||||
fragment lookup table is itself stored compressed into metadata blocks.
|
||||
A second index table is used to locate these. This second index table for
|
||||
speed of access (and because it is small) is read at mount time and cached
|
||||
in memory.
|
||||
|
||||
3.5 Uid/gid lookup table
|
||||
------------------------
|
||||
|
||||
For space efficiency regular files store uid and gid indexes, which are
|
||||
converted to 32-bit uids/gids using an id look up table. This table is
|
||||
stored compressed into metadata blocks. A second index table is used to
|
||||
locate these. This second index table for speed of access (and because it
|
||||
is small) is read at mount time and cached in memory.
|
||||
|
||||
3.6 Export table
|
||||
----------------
|
||||
|
||||
To enable Squashfs filesystems to be exportable (via NFS etc.) filesystems
|
||||
can optionally (disabled with the -no-exports Mksquashfs option) contain
|
||||
an inode number to inode disk location lookup table. This is required to
|
||||
enable Squashfs to map inode numbers passed in filehandles to the inode
|
||||
location on disk, which is necessary when the export code reinstantiates
|
||||
expired/flushed inodes.
|
||||
|
||||
This table is stored compressed into metadata blocks. A second index table is
|
||||
used to locate these. This second index table for speed of access (and because
|
||||
it is small) is read at mount time and cached in memory.
|
||||
|
||||
|
||||
4. TODOS AND OUTSTANDING ISSUES
|
||||
-------------------------------
|
||||
|
||||
4.1 Todo list
|
||||
-------------
|
||||
|
||||
Implement Xattr and ACL support. The Squashfs 4.0 filesystem layout has hooks
|
||||
for these but the code has not been written. Once the code has been written
|
||||
the existing layout should not require modification.
|
||||
|
||||
4.2 Squashfs internal cache
|
||||
---------------------------
|
||||
|
||||
Blocks in Squashfs are compressed. To avoid repeatedly decompressing
|
||||
recently accessed data Squashfs uses two small metadata and fragment caches.
|
||||
|
||||
The cache is not used for file datablocks, these are decompressed and cached in
|
||||
the page-cache in the normal way. The cache is used to temporarily cache
|
||||
fragment and metadata blocks which have been read as a result of a metadata
|
||||
(i.e. inode or directory) or fragment access. Because metadata and fragments
|
||||
are packed together into blocks (to gain greater compression) the read of a
|
||||
particular piece of metadata or fragment will retrieve other metadata/fragments
|
||||
which have been packed with it, these because of locality-of-reference may be
|
||||
read in the near future. Temporarily caching them ensures they are available
|
||||
for near future access without requiring an additional read and decompress.
|
||||
|
||||
In the future this internal cache may be replaced with an implementation which
|
||||
uses the kernel page cache. Because the page cache operates on page sized
|
||||
units this may introduce additional complexity in terms of locking and
|
||||
associated race conditions.
|
|
@ -210,8 +210,8 @@ struct super_operations {
|
|||
void (*put_super) (struct super_block *);
|
||||
void (*write_super) (struct super_block *);
|
||||
int (*sync_fs)(struct super_block *sb, int wait);
|
||||
void (*write_super_lockfs) (struct super_block *);
|
||||
void (*unlockfs) (struct super_block *);
|
||||
int (*freeze_fs) (struct super_block *);
|
||||
int (*unfreeze_fs) (struct super_block *);
|
||||
int (*statfs) (struct dentry *, struct kstatfs *);
|
||||
int (*remount_fs) (struct super_block *, int *, char *);
|
||||
void (*clear_inode) (struct inode *);
|
||||
|
@ -270,11 +270,11 @@ or bottom half).
|
|||
a superblock. The second parameter indicates whether the method
|
||||
should wait until the write out has been completed. Optional.
|
||||
|
||||
write_super_lockfs: called when VFS is locking a filesystem and
|
||||
freeze_fs: called when VFS is locking a filesystem and
|
||||
forcing it into a consistent state. This method is currently
|
||||
used by the Logical Volume Manager (LVM).
|
||||
|
||||
unlockfs: called when VFS is unlocking a filesystem and making it writable
|
||||
unfreeze_fs: called when VFS is unlocking a filesystem and making it writable
|
||||
again.
|
||||
|
||||
statfs: called when the VFS needs to get filesystem statistics. This
|
||||
|
|
|
@ -121,7 +121,7 @@ Once all bytes have been read data will hold 0x09, but there is no reason to
|
|||
test for this. Notice that the number of bytes is bank address dependent see
|
||||
above and below.
|
||||
|
||||
After completing a successfull read it is advised to put the uGuru back in
|
||||
After completing a successful read it is advised to put the uGuru back in
|
||||
ready mode, so that it is ready for the next read / write cycle. This way
|
||||
if your program / driver is unloaded and later loaded again the detection
|
||||
algorithm described above will still work.
|
||||
|
@ -141,7 +141,7 @@ don't ask why this is the way it is.
|
|||
|
||||
Once DATA holds 0x01 read CMD it should hold 0xAC now.
|
||||
|
||||
After completing a successfull write it is advised to put the uGuru back in
|
||||
After completing a successful write it is advised to put the uGuru back in
|
||||
ready mode, so that it is ready for the next read / write cycle. This way
|
||||
if your program / driver is unloaded and later loaded again the detection
|
||||
algorithm described above will still work.
|
||||
|
|
|
@ -141,6 +141,7 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
ht -- run only enough ACPI to enable Hyper Threading
|
||||
strict -- Be less tolerant of platforms that are not
|
||||
strictly ACPI specification compliant.
|
||||
rsdt -- prefer RSDT over (default) XSDT
|
||||
|
||||
See also Documentation/power/pm.txt, pci=noacpi
|
||||
|
||||
|
@ -151,16 +152,20 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
default: 0
|
||||
|
||||
acpi_sleep= [HW,ACPI] Sleep options
|
||||
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering }
|
||||
See Documentation/power/video.txt for s3_bios and s3_mode.
|
||||
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig,
|
||||
old_ordering, s4_nonvs }
|
||||
See Documentation/power/video.txt for information on
|
||||
s3_bios and s3_mode.
|
||||
s3_beep is for debugging; it makes the PC's speaker beep
|
||||
as soon as the kernel's real-mode entry point is called.
|
||||
s4_nohwsig prevents ACPI hardware signature from being
|
||||
used during resume from hibernation.
|
||||
old_ordering causes the ACPI 1.0 ordering of the _PTS
|
||||
control method, wrt putting devices into low power
|
||||
states, to be enforced (the ACPI 2.0 ordering of _PTS is
|
||||
used by default).
|
||||
control method, with respect to putting devices into
|
||||
low power states, to be enforced (the ACPI 2.0 ordering
|
||||
of _PTS is used by default).
|
||||
s4_nonvs prevents the kernel from saving/restoring the
|
||||
ACPI NVS memory during hibernation.
|
||||
|
||||
acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
|
||||
Format: { level | edge | high | low }
|
||||
|
@ -195,7 +200,7 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
acpi_skip_timer_override [HW,ACPI]
|
||||
Recognize and ignore IRQ0/pin2 Interrupt Override.
|
||||
For broken nForce2 BIOS resulting in XT-PIC timer.
|
||||
acpi_use_timer_override [HW,ACPI}
|
||||
acpi_use_timer_override [HW,ACPI]
|
||||
Use timer override. For some broken Nvidia NF5 boards
|
||||
that require a timer override, but don't have
|
||||
HPET
|
||||
|
@ -829,8 +834,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
|
||||
hlt [BUGS=ARM,SH]
|
||||
|
||||
hvc_iucv= [S390] Number of z/VM IUCV Hypervisor console (HVC)
|
||||
back-ends. Valid parameters: 0..8
|
||||
hvc_iucv= [S390] Number of z/VM IUCV hypervisor console (HVC)
|
||||
terminal devices. Valid values: 0..8
|
||||
|
||||
i8042.debug [HW] Toggle i8042 debug mode
|
||||
i8042.direct [HW] Put keyboard port into non-translated mode
|
||||
|
@ -878,17 +883,19 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
See Documentation/ide/ide.txt.
|
||||
|
||||
idle= [X86]
|
||||
Format: idle=poll or idle=mwait, idle=halt, idle=nomwait
|
||||
Poll forces a polling idle loop that can slightly improves the performance
|
||||
of waking up a idle CPU, but will use a lot of power and make the system
|
||||
run hot. Not recommended.
|
||||
idle=mwait. On systems which support MONITOR/MWAIT but the kernel chose
|
||||
to not use it because it doesn't save as much power as a normal idle
|
||||
loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same
|
||||
as idle=poll.
|
||||
idle=halt. Halt is forced to be used for CPU idle.
|
||||
Format: idle=poll, idle=mwait, idle=halt, idle=nomwait
|
||||
Poll forces a polling idle loop that can slightly
|
||||
improve the performance of waking up a idle CPU, but
|
||||
will use a lot of power and make the system run hot.
|
||||
Not recommended.
|
||||
idle=mwait: On systems which support MONITOR/MWAIT but
|
||||
the kernel chose to not use it because it doesn't save
|
||||
as much power as a normal idle loop, use the
|
||||
MONITOR/MWAIT idle loop anyways. Performance should be
|
||||
the same as idle=poll.
|
||||
idle=halt: Halt is forced to be used for CPU idle.
|
||||
In such case C2/C3 won't be used again.
|
||||
idle=nomwait. Disable mwait for CPU C-states
|
||||
idle=nomwait: Disable mwait for CPU C-states
|
||||
|
||||
ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
|
||||
Claim all unknown PCI IDE storage controllers.
|
||||
|
@ -1074,8 +1081,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
lapic [X86-32,APIC] Enable the local APIC even if BIOS
|
||||
disabled it.
|
||||
|
||||
lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer in
|
||||
C2 power state.
|
||||
lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer
|
||||
in C2 power state.
|
||||
|
||||
libata.dma= [LIBATA] DMA control
|
||||
libata.dma=0 Disable all PATA and SATA DMA
|
||||
|
@ -1562,6 +1569,9 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
|
||||
nosoftlockup [KNL] Disable the soft-lockup detector.
|
||||
|
||||
noswapaccount [KNL] Disable accounting of swap in memory resource
|
||||
controller. (See Documentation/controllers/memory.txt)
|
||||
|
||||
nosync [HW,M68K] Disables sync negotiation for all devices.
|
||||
|
||||
notsc [BUGS=X86-32] Disable Time Stamp Counter
|
||||
|
@ -2300,7 +2310,8 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
|
||||
thermal.psv= [HW,ACPI]
|
||||
-1: disable all passive trip points
|
||||
<degrees C>: override all passive trip points to this value
|
||||
<degrees C>: override all passive trip points to this
|
||||
value
|
||||
|
||||
thermal.tzp= [HW,ACPI]
|
||||
Specify global default ACPI thermal zone polling rate
|
||||
|
|
|
@ -109,12 +109,18 @@ and it's also much more restricted in the latter case:
|
|||
FURTHER NOTES ON NO-MMU MMAP
|
||||
============================
|
||||
|
||||
(*) A request for a private mapping of less than a page in size may not return
|
||||
a page-aligned buffer. This is because the kernel calls kmalloc() to
|
||||
allocate the buffer, not get_free_page().
|
||||
(*) A request for a private mapping of a file may return a buffer that is not
|
||||
page-aligned. This is because XIP may take place, and the data may not be
|
||||
paged aligned in the backing store.
|
||||
|
||||
(*) A list of all the mappings on the system is visible through /proc/maps in
|
||||
no-MMU mode.
|
||||
(*) A request for an anonymous mapping will always be page aligned. If
|
||||
possible the size of the request should be a power of two otherwise some
|
||||
of the space may be wasted as the kernel must allocate a power-of-2
|
||||
granule but will only discard the excess if appropriately configured as
|
||||
this has an effect on fragmentation.
|
||||
|
||||
(*) A list of all the private copy and anonymous mappings on the system is
|
||||
visible through /proc/maps in no-MMU mode.
|
||||
|
||||
(*) A list of all the mappings in use by a process is visible through
|
||||
/proc/<pid>/maps in no-MMU mode.
|
||||
|
@ -242,3 +248,18 @@ PROVIDING SHAREABLE BLOCK DEVICE SUPPORT
|
|||
Provision of shared mappings on block device files is exactly the same as for
|
||||
character devices. If there isn't a real device underneath, then the driver
|
||||
should allocate sufficient contiguous memory to honour any supported mapping.
|
||||
|
||||
|
||||
=================================
|
||||
ADJUSTING PAGE TRIMMING BEHAVIOUR
|
||||
=================================
|
||||
|
||||
NOMMU mmap automatically rounds up to the nearest power-of-2 number of pages
|
||||
when performing an allocation. This can have adverse effects on memory
|
||||
fragmentation, and as such, is left configurable. The default behaviour is to
|
||||
aggressively trim allocations and discard any excess pages back in to the page
|
||||
allocator. In order to retain finer-grained control over fragmentation, this
|
||||
behaviour can either be disabled completely, or bumped up to a higher page
|
||||
watermark where trimming begins.
|
||||
|
||||
Page trimming behaviour is configurable via the sysctl `vm.nr_trim_pages'.
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
AMCC NDFC (NanD Flash Controller)
|
||||
|
||||
Required properties:
|
||||
- compatible : "ibm,ndfc".
|
||||
- reg : should specify chip select and size used for the chip (0x2000).
|
||||
|
||||
Optional properties:
|
||||
- ccr : NDFC config and control register value (default 0).
|
||||
- bank-settings : NDFC bank configuration register value (default 0).
|
||||
|
||||
Notes:
|
||||
- partition(s) - follows the OF MTD standard for partitions
|
||||
|
||||
Example:
|
||||
|
||||
ndfc@1,0 {
|
||||
compatible = "ibm,ndfc";
|
||||
reg = <0x00000001 0x00000000 0x00002000>;
|
||||
ccr = <0x00001000>;
|
||||
bank-settings = <0x80002222>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
nand {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "kernel";
|
||||
reg = <0x00000000 0x00200000>;
|
||||
};
|
||||
partition@200000 {
|
||||
label = "root";
|
||||
reg = <0x00200000 0x03E00000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ This is the memory-mapped registers for on board FPGA.
|
|||
|
||||
Required properities:
|
||||
- compatible : should be "fsl,fpga-pixis".
|
||||
- reg : should contain the address and the lenght of the FPPGA register
|
||||
- reg : should contain the address and the length of the FPPGA register
|
||||
set.
|
||||
|
||||
Example (MPC8610HPCD):
|
||||
|
@ -27,3 +27,33 @@ Example (MPC8610HPCD):
|
|||
compatible = "fsl,fpga-pixis";
|
||||
reg = <0xe8000000 32>;
|
||||
};
|
||||
|
||||
* Freescale BCSR GPIO banks
|
||||
|
||||
Some BCSR registers act as simple GPIO controllers, each such
|
||||
register can be represented by the gpio-controller node.
|
||||
|
||||
Required properities:
|
||||
- compatible : Should be "fsl,<board>-bcsr-gpio".
|
||||
- reg : Should contain the address and the length of the GPIO bank
|
||||
register.
|
||||
- #gpio-cells : Should be two. The first cell is the pin number and the
|
||||
second cell is used to specify optional paramters (currently unused).
|
||||
- gpio-controller : Marks the port as GPIO controller.
|
||||
|
||||
Example:
|
||||
|
||||
bcsr@1,0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "fsl,mpc8360mds-bcsr";
|
||||
reg = <1 0 0x8000>;
|
||||
ranges = <0 1 0 0x8000>;
|
||||
|
||||
bcsr13: gpio-controller@d {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "fsl,mpc8360mds-bcsr-gpio";
|
||||
reg = <0xd 1>;
|
||||
gpio-controller;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -191,7 +191,7 @@ Vport States:
|
|||
This is equivalent to a driver "attach" on an adapter, which is
|
||||
independent of the adapter's link state.
|
||||
- Instantiation of the vport on the FC link via ELS traffic, etc.
|
||||
This is equivalent to a "link up" and successfull link initialization.
|
||||
This is equivalent to a "link up" and successful link initialization.
|
||||
Further information can be found in the interfaces section below for
|
||||
Vport Creation.
|
||||
|
||||
|
@ -320,7 +320,7 @@ Vport Creation:
|
|||
This is equivalent to a driver "attach" on an adapter, which is
|
||||
independent of the adapter's link state.
|
||||
- Instantiation of the vport on the FC link via ELS traffic, etc.
|
||||
This is equivalent to a "link up" and successfull link initialization.
|
||||
This is equivalent to a "link up" and successful link initialization.
|
||||
|
||||
The LLDD's vport_create() function will not synchronously wait for both
|
||||
parts to be fully completed before returning. It must validate that the
|
||||
|
|
|
@ -38,6 +38,7 @@ Currently, these files are in /proc/sys/vm:
|
|||
- numa_zonelist_order
|
||||
- nr_hugepages
|
||||
- nr_overcommit_hugepages
|
||||
- nr_trim_pages (only if CONFIG_MMU=n)
|
||||
|
||||
==============================================================
|
||||
|
||||
|
@ -348,3 +349,20 @@ Change the maximum size of the hugepage pool. The maximum is
|
|||
nr_hugepages + nr_overcommit_hugepages.
|
||||
|
||||
See Documentation/vm/hugetlbpage.txt
|
||||
|
||||
==============================================================
|
||||
|
||||
nr_trim_pages
|
||||
|
||||
This is available only on NOMMU kernels.
|
||||
|
||||
This value adjusts the excess page trimming behaviour of power-of-2 aligned
|
||||
NOMMU mmap allocations.
|
||||
|
||||
A value of 0 disables trimming of allocations entirely, while a value of 1
|
||||
trims excess pages aggressively. Any value >= 1 acts as the watermark where
|
||||
trimming of allocations is initiated.
|
||||
|
||||
The default value is 1.
|
||||
|
||||
See Documentation/nommu-mmap.txt for more information.
|
||||
|
|
|
@ -4,5 +4,7 @@ ds2482
|
|||
- The Maxim/Dallas Semiconductor DS2482 provides 1-wire busses.
|
||||
ds2490
|
||||
- The Maxim/Dallas Semiconductor DS2490 builds USB <-> W1 bridges.
|
||||
mxc_w1
|
||||
- W1 master controller driver found on Freescale MX2/MX3 SoCs
|
||||
w1-gpio
|
||||
- GPIO 1-wire bus master driver.
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
Kernel driver mxc_w1
|
||||
====================
|
||||
|
||||
Supported chips:
|
||||
* Freescale MX27, MX31 and probably other i.MX SoCs
|
||||
Datasheets:
|
||||
http://www.freescale.com/files/32bit/doc/data_sheet/MCIMX31.pdf?fpsp=1
|
||||
http://www.freescale.com/files/dsp/MCIMX27.pdf?fpsp=1
|
||||
|
||||
Author: Originally based on Freescale code, prepared for mainline by
|
||||
Sascha Hauer <s.hauer@pengutronix.de>
|
|
@ -5,69 +5,157 @@ Message types.
|
|||
=============
|
||||
|
||||
There are three types of messages between w1 core and userspace:
|
||||
1. Events. They are generated each time new master or slave device found
|
||||
either due to automatic or requested search.
|
||||
2. Userspace commands. Includes read/write and search/alarm search comamnds.
|
||||
1. Events. They are generated each time new master or slave device
|
||||
found either due to automatic or requested search.
|
||||
2. Userspace commands.
|
||||
3. Replies to userspace commands.
|
||||
|
||||
|
||||
Protocol.
|
||||
========
|
||||
|
||||
[struct cn_msg] - connector header. It's length field is equal to size of the attached data.
|
||||
[struct cn_msg] - connector header.
|
||||
Its length field is equal to size of the attached data
|
||||
[struct w1_netlink_msg] - w1 netlink header.
|
||||
__u8 type - message type.
|
||||
W1_SLAVE_ADD/W1_SLAVE_REMOVE - slave add/remove events.
|
||||
W1_MASTER_ADD/W1_MASTER_REMOVE - master add/remove events.
|
||||
W1_MASTER_CMD - userspace command for bus master device (search/alarm search).
|
||||
W1_SLAVE_CMD - userspace command for slave device (read/write/ search/alarm search
|
||||
for bus master device where given slave device found).
|
||||
W1_LIST_MASTERS
|
||||
list current bus masters
|
||||
W1_SLAVE_ADD/W1_SLAVE_REMOVE
|
||||
slave add/remove events
|
||||
W1_MASTER_ADD/W1_MASTER_REMOVE
|
||||
master add/remove events
|
||||
W1_MASTER_CMD
|
||||
userspace command for bus master
|
||||
device (search/alarm search)
|
||||
W1_SLAVE_CMD
|
||||
userspace command for slave device
|
||||
(read/write/touch)
|
||||
__u8 res - reserved
|
||||
__u16 len - size of attached to this header data.
|
||||
__u16 len - size of data attached to this header data
|
||||
union {
|
||||
__u8 id; - slave unique device id
|
||||
__u8 id[8]; - slave unique device id
|
||||
struct w1_mst {
|
||||
__u32 id; - master's id.
|
||||
__u32 id; - master's id
|
||||
__u32 res; - reserved
|
||||
} mst;
|
||||
} id;
|
||||
|
||||
[strucrt w1_netlink_cmd] - command for gived master or slave device.
|
||||
[struct w1_netlink_cmd] - command for given master or slave device.
|
||||
__u8 cmd - command opcode.
|
||||
W1_CMD_READ - read command.
|
||||
W1_CMD_WRITE - write command.
|
||||
W1_CMD_SEARCH - search command.
|
||||
W1_CMD_ALARM_SEARCH - alarm search command.
|
||||
W1_CMD_READ - read command
|
||||
W1_CMD_WRITE - write command
|
||||
W1_CMD_TOUCH - touch command
|
||||
(write and sample data back to userspace)
|
||||
W1_CMD_SEARCH - search command
|
||||
W1_CMD_ALARM_SEARCH - alarm search command
|
||||
__u8 res - reserved
|
||||
__u16 len - length of data for this command.
|
||||
For read command data must be allocated like for write command.
|
||||
__u8 data[0] - data for this command.
|
||||
__u16 len - length of data for this command
|
||||
For read command data must be allocated like for write command
|
||||
__u8 data[0] - data for this command
|
||||
|
||||
|
||||
Each connector message can include one or more w1_netlink_msg with zero of more attached w1_netlink_cmd messages.
|
||||
Each connector message can include one or more w1_netlink_msg with
|
||||
zero or more attached w1_netlink_cmd messages.
|
||||
|
||||
For event messages there are no w1_netlink_cmd embedded structures, only connector header
|
||||
and w1_netlink_msg strucutre with "len" field being zero and filled type (one of event types)
|
||||
and id - either 8 bytes of slave unique id in host order, or master's id, which is assigned
|
||||
to bus master device when it is added to w1 core.
|
||||
For event messages there are no w1_netlink_cmd embedded structures,
|
||||
only connector header and w1_netlink_msg strucutre with "len" field
|
||||
being zero and filled type (one of event types) and id:
|
||||
either 8 bytes of slave unique id in host order,
|
||||
or master's id, which is assigned to bus master device
|
||||
when it is added to w1 core.
|
||||
|
||||
Currently replies to userspace commands are only generated for read
|
||||
command request. One reply is generated exactly for one w1_netlink_cmd
|
||||
read request. Replies are not combined when sent - i.e. typical reply
|
||||
messages looks like the following:
|
||||
|
||||
Currently replies to userspace commands are only generated for read command request.
|
||||
One reply is generated exactly for one w1_netlink_cmd read request.
|
||||
Replies are not combined when sent - i.e. typical reply messages looks like the following:
|
||||
[cn_msg][w1_netlink_msg][w1_netlink_cmd]
|
||||
cn_msg.len = sizeof(struct w1_netlink_msg) + sizeof(struct w1_netlink_cmd) + cmd->len;
|
||||
cn_msg.len = sizeof(struct w1_netlink_msg) +
|
||||
sizeof(struct w1_netlink_cmd) +
|
||||
cmd->len;
|
||||
w1_netlink_msg.len = sizeof(struct w1_netlink_cmd) + cmd->len;
|
||||
w1_netlink_cmd.len = cmd->len;
|
||||
|
||||
Replies to W1_LIST_MASTERS should send a message back to the userspace
|
||||
which will contain list of all registered master ids in the following
|
||||
format:
|
||||
|
||||
cn_msg (CN_W1_IDX.CN_W1_VAL as id, len is equal to sizeof(struct
|
||||
w1_netlink_msg) plus number of masters multipled by 4)
|
||||
w1_netlink_msg (type: W1_LIST_MASTERS, len is equal to
|
||||
number of masters multiplied by 4 (u32 size))
|
||||
id0 ... idN
|
||||
|
||||
Each message is at most 4k in size, so if number of master devices
|
||||
exceeds this, it will be split into several messages,
|
||||
cn.seq will be increased for each one.
|
||||
|
||||
W1 search and alarm search commands.
|
||||
request:
|
||||
[cn_msg]
|
||||
[w1_netlink_msg type = W1_MASTER_CMD
|
||||
id is equal to the bus master id to use for searching]
|
||||
[w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH]
|
||||
|
||||
reply:
|
||||
[cn_msg, ack = 1 and increasing, 0 means the last message,
|
||||
seq is equal to the request seq]
|
||||
[w1_netlink_msg type = W1_MASTER_CMD]
|
||||
[w1_netlink_cmd cmd = W1_CMD_SEARCH or W1_CMD_ALARM_SEARCH
|
||||
len is equal to number of IDs multiplied by 8]
|
||||
[64bit-id0 ... 64bit-idN]
|
||||
Length in each header corresponds to the size of the data behind it, so
|
||||
w1_netlink_cmd->len = N * 8; where N is number of IDs in this message.
|
||||
Can be zero.
|
||||
w1_netlink_msg->len = sizeof(struct w1_netlink_cmd) + N * 8;
|
||||
cn_msg->len = sizeof(struct w1_netlink_msg) +
|
||||
sizeof(struct w1_netlink_cmd) +
|
||||
N*8;
|
||||
|
||||
W1 reset command.
|
||||
[cn_msg]
|
||||
[w1_netlink_msg type = W1_MASTER_CMD
|
||||
id is equal to the bus master id to use for searching]
|
||||
[w1_netlink_cmd cmd = W1_CMD_RESET]
|
||||
|
||||
|
||||
Command status replies.
|
||||
======================
|
||||
|
||||
Each command (either root, master or slave with or without w1_netlink_cmd
|
||||
structure) will be 'acked' by the w1 core. Format of the reply is the same
|
||||
as request message except that length parameters do not account for data
|
||||
requested by the user, i.e. read/write/touch IO requests will not contain
|
||||
data, so w1_netlink_cmd.len will be 0, w1_netlink_msg.len will be size
|
||||
of the w1_netlink_cmd structure and cn_msg.len will be equal to the sum
|
||||
of the sizeof(struct w1_netlink_msg) and sizeof(struct w1_netlink_cmd).
|
||||
If reply is generated for master or root command (which do not have
|
||||
w1_netlink_cmd attached), reply will contain only cn_msg and w1_netlink_msg
|
||||
structires.
|
||||
|
||||
w1_netlink_msg.status field will carry positive error value
|
||||
(EINVAL for example) or zero in case of success.
|
||||
|
||||
All other fields in every structure will mirror the same parameters in the
|
||||
request message (except lengths as described above).
|
||||
|
||||
Status reply is generated for every w1_netlink_cmd embedded in the
|
||||
w1_netlink_msg, if there are no w1_netlink_cmd structures,
|
||||
reply will be generated for the w1_netlink_msg.
|
||||
|
||||
All w1_netlink_cmd command structures are handled in every w1_netlink_msg,
|
||||
even if there were errors, only length mismatch interrupts message processing.
|
||||
|
||||
|
||||
Operation steps in w1 core when new command is received.
|
||||
=======================================================
|
||||
|
||||
When new message (w1_netlink_msg) is received w1 core detects if it is master of slave request,
|
||||
according to w1_netlink_msg.type field.
|
||||
When new message (w1_netlink_msg) is received w1 core detects if it is
|
||||
master or slave request, according to w1_netlink_msg.type field.
|
||||
Then master or slave device is searched for.
|
||||
When found, master device (requested or those one on where slave device is found) is locked.
|
||||
If slave command is requested, then reset/select procedure is started to select given device.
|
||||
When found, master device (requested or those one on where slave device
|
||||
is found) is locked. If slave command is requested, then reset/select
|
||||
procedure is started to select given device.
|
||||
|
||||
Then all requested in w1_netlink_msg operations are performed one by one.
|
||||
If command requires reply (like read command) it is sent on command completion.
|
||||
|
@ -82,8 +170,8 @@ Connector [1] specific documentation.
|
|||
Each connector message includes two u32 fields as "address".
|
||||
w1 uses CN_W1_IDX and CN_W1_VAL defined in include/linux/connector.h header.
|
||||
Each message also includes sequence and acknowledge numbers.
|
||||
Sequence number for event messages is appropriate bus master sequence number increased with
|
||||
each event message sent "through" this master.
|
||||
Sequence number for event messages is appropriate bus master sequence number
|
||||
increased with each event message sent "through" this master.
|
||||
Sequence number for userspace requests is set by userspace application.
|
||||
Sequence number for reply is the same as was in request, and
|
||||
acknowledge number is set to seq+1.
|
||||
|
@ -93,6 +181,6 @@ Additional documantion, source code examples.
|
|||
============================================
|
||||
|
||||
1. Documentation/connector
|
||||
2. http://tservice.net.ru/~s0mbre/archive/w1
|
||||
This archive includes userspace application w1d.c which
|
||||
uses read/write/search commands for all master/slave devices found on the bus.
|
||||
2. http://www.ioremap.net/archive/w1
|
||||
This archive includes userspace application w1d.c which uses
|
||||
read/write/search commands for all master/slave devices found on the bus.
|
||||
|
|
|
@ -44,7 +44,7 @@ Protocol 2.07: (Kernel 2.6.24) Added paravirtualised boot protocol.
|
|||
and KEEP_SEGMENTS flag in load_flags.
|
||||
|
||||
Protocol 2.08: (Kernel 2.6.26) Added crc32 checksum and ELF format
|
||||
payload. Introduced payload_offset and payload length
|
||||
payload. Introduced payload_offset and payload_length
|
||||
fields to aid in locating the payload.
|
||||
|
||||
Protocol 2.09: (Kernel 2.6.26) Added a field of 64-bit physical
|
||||
|
|
18
MAINTAINERS
18
MAINTAINERS
|
@ -1360,6 +1360,11 @@ P: Maciej W. Rozycki
|
|||
M: macro@linux-mips.org
|
||||
S: Maintained
|
||||
|
||||
DELL LAPTOP DRIVER
|
||||
P: Matthew Garrett
|
||||
M: mjg59@srcf.ucam.org
|
||||
S: Maintained
|
||||
|
||||
DELL LAPTOP SMM DRIVER
|
||||
P: Massimo Dal Zotto
|
||||
M: dz@debian.org
|
||||
|
@ -3484,6 +3489,12 @@ L: linuxppc-dev@ozlabs.org
|
|||
L: cbe-oss-dev@ozlabs.org
|
||||
S: Supported
|
||||
|
||||
PS3VRAM DRIVER
|
||||
P: Jim Paris
|
||||
M: jim@jtan.com
|
||||
L: cbe-oss-dev@ozlabs.org
|
||||
S: Maintained
|
||||
|
||||
PVRUSB2 VIDEO4LINUX DRIVER
|
||||
P: Mike Isely
|
||||
M: isely@pobox.com
|
||||
|
@ -4070,6 +4081,13 @@ L: cbe-oss-dev@ozlabs.org
|
|||
W: http://www.ibm.com/developerworks/power/cell/
|
||||
S: Supported
|
||||
|
||||
SQUASHFS FILE SYSTEM
|
||||
P: Phillip Lougher
|
||||
M: phillip@lougher.demon.co.uk
|
||||
L: squashfs-devel@lists.sourceforge.net (subscribers-only)
|
||||
W: http://squashfs.org.uk
|
||||
S: Maintained
|
||||
|
||||
SRM (Alpha) environment access
|
||||
P: Jan-Benedict Glaw
|
||||
M: jbglaw@lug-owl.de
|
||||
|
|
4
Makefile
4
Makefile
|
@ -1,7 +1,7 @@
|
|||
VERSION = 2
|
||||
PATCHLEVEL = 6
|
||||
SUBLEVEL = 28
|
||||
EXTRAVERSION =
|
||||
SUBLEVEL = 29
|
||||
EXTRAVERSION = -rc1
|
||||
NAME = Erotic Pickled Herring
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
|
|
@ -1,801 +0,0 @@
|
|||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.12-rc1-bk2
|
||||
# Sun Mar 27 17:20:48 2005
|
||||
#
|
||||
CONFIG_ARM=y
|
||||
CONFIG_MMU=y
|
||||
CONFIG_UID16=y
|
||||
CONFIG_RWSEM_GENERIC_SPINLOCK=y
|
||||
CONFIG_GENERIC_CALIBRATE_DELAY=y
|
||||
CONFIG_GENERIC_IOMAP=y
|
||||
|
||||
#
|
||||
# Code maturity level options
|
||||
#
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_CLEAN_COMPILE=y
|
||||
CONFIG_BROKEN_ON_SMP=y
|
||||
|
||||
#
|
||||
# General setup
|
||||
#
|
||||
CONFIG_LOCALVERSION=""
|
||||
CONFIG_SWAP=y
|
||||
CONFIG_SYSVIPC=y
|
||||
# CONFIG_POSIX_MQUEUE is not set
|
||||
# CONFIG_BSD_PROCESS_ACCT is not set
|
||||
# CONFIG_SYSCTL is not set
|
||||
# CONFIG_AUDIT is not set
|
||||
# CONFIG_HOTPLUG is not set
|
||||
CONFIG_KOBJECT_UEVENT=y
|
||||
# CONFIG_IKCONFIG is not set
|
||||
CONFIG_EMBEDDED=y
|
||||
CONFIG_KALLSYMS=y
|
||||
# CONFIG_KALLSYMS_EXTRA_PASS is not set
|
||||
CONFIG_BASE_FULL=y
|
||||
CONFIG_FUTEX=y
|
||||
CONFIG_EPOLL=y
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_SHMEM=y
|
||||
CONFIG_CC_ALIGN_FUNCTIONS=0
|
||||
CONFIG_CC_ALIGN_LABELS=0
|
||||
CONFIG_CC_ALIGN_LOOPS=0
|
||||
CONFIG_CC_ALIGN_JUMPS=0
|
||||
# CONFIG_TINY_SHMEM is not set
|
||||
CONFIG_BASE_SMALL=0
|
||||
|
||||
#
|
||||
# Loadable module support
|
||||
#
|
||||
# CONFIG_MODULES is not set
|
||||
|
||||
#
|
||||
# System Type
|
||||
#
|
||||
CONFIG_ARCH_CLPS7500=y
|
||||
# CONFIG_ARCH_CLPS711X is not set
|
||||
# CONFIG_ARCH_CO285 is not set
|
||||
# CONFIG_ARCH_EBSA110 is not set
|
||||
# CONFIG_ARCH_FOOTBRIDGE is not set
|
||||
# CONFIG_ARCH_INTEGRATOR is not set
|
||||
# CONFIG_ARCH_IOP3XX is not set
|
||||
# CONFIG_ARCH_IXP4XX is not set
|
||||
# CONFIG_ARCH_IXP2000 is not set
|
||||
# CONFIG_ARCH_L7200 is not set
|
||||
# CONFIG_ARCH_PXA is not set
|
||||
# CONFIG_ARCH_RPC is not set
|
||||
# CONFIG_ARCH_SA1100 is not set
|
||||
# CONFIG_ARCH_S3C2410 is not set
|
||||
# CONFIG_ARCH_SHARK is not set
|
||||
# CONFIG_ARCH_LH7A40X is not set
|
||||
# CONFIG_ARCH_OMAP is not set
|
||||
# CONFIG_ARCH_VERSATILE is not set
|
||||
# CONFIG_ARCH_IMX is not set
|
||||
# CONFIG_ARCH_H720X is not set
|
||||
|
||||
#
|
||||
# Processor Type
|
||||
#
|
||||
CONFIG_CPU_32=y
|
||||
CONFIG_CPU_ARM710=y
|
||||
CONFIG_CPU_32v3=y
|
||||
CONFIG_CPU_CACHE_V3=y
|
||||
CONFIG_CPU_CACHE_VIVT=y
|
||||
CONFIG_CPU_COPY_V3=y
|
||||
CONFIG_CPU_TLB_V3=y
|
||||
|
||||
#
|
||||
# Processor Features
|
||||
#
|
||||
CONFIG_TIMER_ACORN=y
|
||||
|
||||
#
|
||||
# Bus support
|
||||
#
|
||||
CONFIG_ISA=y
|
||||
|
||||
#
|
||||
# PCCARD (PCMCIA/CardBus) support
|
||||
#
|
||||
# CONFIG_PCCARD is not set
|
||||
|
||||
#
|
||||
# Kernel Features
|
||||
#
|
||||
# CONFIG_PREEMPT is not set
|
||||
CONFIG_ALIGNMENT_TRAP=y
|
||||
|
||||
#
|
||||
# Boot options
|
||||
#
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_CMDLINE="mem=16M root=nfs"
|
||||
# CONFIG_XIP_KERNEL is not set
|
||||
|
||||
#
|
||||
# Floating point emulation
|
||||
#
|
||||
|
||||
#
|
||||
# At least one emulation must be selected
|
||||
#
|
||||
# CONFIG_FPE_NWFPE is not set
|
||||
|
||||
#
|
||||
# Userspace binary formats
|
||||
#
|
||||
CONFIG_BINFMT_ELF=y
|
||||
# CONFIG_BINFMT_AOUT is not set
|
||||
# CONFIG_BINFMT_MISC is not set
|
||||
# CONFIG_ARTHUR is not set
|
||||
|
||||
#
|
||||
# Power management options
|
||||
#
|
||||
# CONFIG_PM is not set
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Generic Driver Options
|
||||
#
|
||||
CONFIG_STANDALONE=y
|
||||
CONFIG_PREVENT_FIRMWARE_BUILD=y
|
||||
# CONFIG_FW_LOADER is not set
|
||||
|
||||
#
|
||||
# Memory Technology Devices (MTD)
|
||||
#
|
||||
CONFIG_MTD=y
|
||||
# CONFIG_MTD_DEBUG is not set
|
||||
# CONFIG_MTD_CONCAT is not set
|
||||
# CONFIG_MTD_PARTITIONS is not set
|
||||
|
||||
#
|
||||
# User Modules And Translation Layers
|
||||
#
|
||||
# CONFIG_MTD_CHAR is not set
|
||||
# CONFIG_MTD_BLOCK is not set
|
||||
# CONFIG_MTD_BLOCK_RO is not set
|
||||
# CONFIG_FTL is not set
|
||||
# CONFIG_NFTL is not set
|
||||
# CONFIG_INFTL is not set
|
||||
|
||||
#
|
||||
# RAM/ROM/Flash chip drivers
|
||||
#
|
||||
# CONFIG_MTD_CFI is not set
|
||||
# CONFIG_MTD_JEDECPROBE is not set
|
||||
CONFIG_MTD_MAP_BANK_WIDTH_1=y
|
||||
CONFIG_MTD_MAP_BANK_WIDTH_2=y
|
||||
CONFIG_MTD_MAP_BANK_WIDTH_4=y
|
||||
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
|
||||
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
|
||||
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
|
||||
CONFIG_MTD_CFI_I1=y
|
||||
CONFIG_MTD_CFI_I2=y
|
||||
# CONFIG_MTD_CFI_I4 is not set
|
||||
# CONFIG_MTD_CFI_I8 is not set
|
||||
# CONFIG_MTD_RAM is not set
|
||||
# CONFIG_MTD_ROM is not set
|
||||
# CONFIG_MTD_ABSENT is not set
|
||||
|
||||
#
|
||||
# Mapping drivers for chip access
|
||||
#
|
||||
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
|
||||
|
||||
#
|
||||
# Self-contained MTD device drivers
|
||||
#
|
||||
# CONFIG_MTD_SLRAM is not set
|
||||
# CONFIG_MTD_PHRAM is not set
|
||||
# CONFIG_MTD_MTDRAM is not set
|
||||
# CONFIG_MTD_BLKMTD is not set
|
||||
# CONFIG_MTD_BLOCK2MTD is not set
|
||||
|
||||
#
|
||||
# Disk-On-Chip Device Drivers
|
||||
#
|
||||
# CONFIG_MTD_DOC2000 is not set
|
||||
# CONFIG_MTD_DOC2001 is not set
|
||||
# CONFIG_MTD_DOC2001PLUS is not set
|
||||
|
||||
#
|
||||
# NAND Flash Device Drivers
|
||||
#
|
||||
# CONFIG_MTD_NAND is not set
|
||||
|
||||
#
|
||||
# Parallel port support
|
||||
#
|
||||
CONFIG_PARPORT=y
|
||||
CONFIG_PARPORT_PC=y
|
||||
CONFIG_PARPORT_PC_FIFO=y
|
||||
# CONFIG_PARPORT_PC_SUPERIO is not set
|
||||
# CONFIG_PARPORT_ARC is not set
|
||||
# CONFIG_PARPORT_GSC is not set
|
||||
CONFIG_PARPORT_1284=y
|
||||
|
||||
#
|
||||
# Plug and Play support
|
||||
#
|
||||
# CONFIG_PNP is not set
|
||||
|
||||
#
|
||||
# Block devices
|
||||
#
|
||||
# CONFIG_BLK_DEV_FD is not set
|
||||
# CONFIG_BLK_DEV_XD is not set
|
||||
# CONFIG_PARIDE is not set
|
||||
# CONFIG_BLK_DEV_COW_COMMON is not set
|
||||
# CONFIG_BLK_DEV_LOOP is not set
|
||||
CONFIG_BLK_DEV_NBD=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
# CONFIG_CDROM_PKTCDVD is not set
|
||||
|
||||
#
|
||||
# IO Schedulers
|
||||
#
|
||||
CONFIG_IOSCHED_NOOP=y
|
||||
CONFIG_IOSCHED_AS=y
|
||||
CONFIG_IOSCHED_DEADLINE=y
|
||||
CONFIG_IOSCHED_CFQ=y
|
||||
# CONFIG_ATA_OVER_ETH is not set
|
||||
|
||||
#
|
||||
# ATA/ATAPI/MFM/RLL support
|
||||
#
|
||||
# CONFIG_IDE is not set
|
||||
|
||||
#
|
||||
# SCSI device support
|
||||
#
|
||||
# CONFIG_SCSI is not set
|
||||
|
||||
#
|
||||
# Multi-device support (RAID and LVM)
|
||||
#
|
||||
# CONFIG_MD is not set
|
||||
|
||||
#
|
||||
# Fusion MPT device support
|
||||
#
|
||||
|
||||
#
|
||||
# IEEE 1394 (FireWire) support
|
||||
#
|
||||
|
||||
#
|
||||
# I2O device support
|
||||
#
|
||||
|
||||
#
|
||||
# Networking support
|
||||
#
|
||||
CONFIG_NET=y
|
||||
|
||||
#
|
||||
# Networking options
|
||||
#
|
||||
# CONFIG_PACKET is not set
|
||||
# CONFIG_NETLINK_DEV is not set
|
||||
CONFIG_UNIX=y
|
||||
# CONFIG_NET_KEY is not set
|
||||
CONFIG_INET=y
|
||||
# CONFIG_IP_MULTICAST is not set
|
||||
# CONFIG_IP_ADVANCED_ROUTER is not set
|
||||
CONFIG_IP_PNP=y
|
||||
# CONFIG_IP_PNP_DHCP is not set
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
# CONFIG_IP_PNP_RARP is not set
|
||||
# CONFIG_NET_IPIP is not set
|
||||
# CONFIG_NET_IPGRE is not set
|
||||
# CONFIG_ARPD is not set
|
||||
# CONFIG_SYN_COOKIES is not set
|
||||
# CONFIG_INET_AH is not set
|
||||
# CONFIG_INET_ESP is not set
|
||||
# CONFIG_INET_IPCOMP is not set
|
||||
# CONFIG_INET_TUNNEL is not set
|
||||
CONFIG_IP_TCPDIAG=y
|
||||
# CONFIG_IP_TCPDIAG_IPV6 is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_NETFILTER is not set
|
||||
|
||||
#
|
||||
# SCTP Configuration (EXPERIMENTAL)
|
||||
#
|
||||
# CONFIG_IP_SCTP is not set
|
||||
# CONFIG_ATM is not set
|
||||
# CONFIG_BRIDGE is not set
|
||||
# CONFIG_VLAN_8021Q is not set
|
||||
# CONFIG_DECNET is not set
|
||||
# CONFIG_LLC2 is not set
|
||||
# CONFIG_IPX is not set
|
||||
# CONFIG_ATALK is not set
|
||||
# CONFIG_X25 is not set
|
||||
# CONFIG_LAPB is not set
|
||||
# CONFIG_NET_DIVERT is not set
|
||||
# CONFIG_ECONET is not set
|
||||
# CONFIG_WAN_ROUTER is not set
|
||||
|
||||
#
|
||||
# QoS and/or fair queueing
|
||||
#
|
||||
# CONFIG_NET_SCHED is not set
|
||||
# CONFIG_NET_CLS_ROUTE is not set
|
||||
|
||||
#
|
||||
# Network testing
|
||||
#
|
||||
# CONFIG_NET_PKTGEN is not set
|
||||
# CONFIG_NETPOLL is not set
|
||||
# CONFIG_NET_POLL_CONTROLLER is not set
|
||||
# CONFIG_HAMRADIO is not set
|
||||
# CONFIG_IRDA is not set
|
||||
# CONFIG_BT is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_EQUALIZER is not set
|
||||
# CONFIG_TUN is not set
|
||||
|
||||
#
|
||||
# ARCnet devices
|
||||
#
|
||||
# CONFIG_ARCNET is not set
|
||||
|
||||
#
|
||||
# Ethernet (10 or 100Mbit)
|
||||
#
|
||||
CONFIG_NET_ETHERNET=y
|
||||
# CONFIG_MII is not set
|
||||
# CONFIG_NET_VENDOR_3COM is not set
|
||||
# CONFIG_LANCE is not set
|
||||
# CONFIG_NET_VENDOR_SMC is not set
|
||||
# CONFIG_SMC91X is not set
|
||||
# CONFIG_NET_VENDOR_RACAL is not set
|
||||
# CONFIG_AT1700 is not set
|
||||
# CONFIG_DEPCA is not set
|
||||
# CONFIG_HP100 is not set
|
||||
# CONFIG_NET_ISA is not set
|
||||
CONFIG_NET_PCI=y
|
||||
# CONFIG_AC3200 is not set
|
||||
# CONFIG_APRICOT is not set
|
||||
CONFIG_CS89x0=y
|
||||
# CONFIG_NET_POCKET is not set
|
||||
|
||||
#
|
||||
# Ethernet (1000 Mbit)
|
||||
#
|
||||
|
||||
#
|
||||
# Ethernet (10000 Mbit)
|
||||
#
|
||||
|
||||
#
|
||||
# Token Ring devices
|
||||
#
|
||||
# CONFIG_TR is not set
|
||||
|
||||
#
|
||||
# Wireless LAN (non-hamradio)
|
||||
#
|
||||
# CONFIG_NET_RADIO is not set
|
||||
|
||||
#
|
||||
# Wan interfaces
|
||||
#
|
||||
# CONFIG_WAN is not set
|
||||
# CONFIG_PLIP is not set
|
||||
CONFIG_PPP=y
|
||||
# CONFIG_PPP_MULTILINK is not set
|
||||
# CONFIG_PPP_FILTER is not set
|
||||
# CONFIG_PPP_ASYNC is not set
|
||||
# CONFIG_PPP_SYNC_TTY is not set
|
||||
# CONFIG_PPP_DEFLATE is not set
|
||||
# CONFIG_PPP_BSDCOMP is not set
|
||||
# CONFIG_PPPOE is not set
|
||||
CONFIG_SLIP=y
|
||||
CONFIG_SLIP_COMPRESSED=y
|
||||
# CONFIG_SLIP_SMART is not set
|
||||
# CONFIG_SLIP_MODE_SLIP6 is not set
|
||||
# CONFIG_SHAPER is not set
|
||||
# CONFIG_NETCONSOLE is not set
|
||||
|
||||
#
|
||||
# ISDN subsystem
|
||||
#
|
||||
# CONFIG_ISDN is not set
|
||||
|
||||
#
|
||||
# Input device support
|
||||
#
|
||||
CONFIG_INPUT=y
|
||||
|
||||
#
|
||||
# Userland interfaces
|
||||
#
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
CONFIG_INPUT_MOUSEDEV_PSAUX=y
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
# CONFIG_INPUT_JOYDEV is not set
|
||||
# CONFIG_INPUT_TSDEV is not set
|
||||
# CONFIG_INPUT_EVDEV is not set
|
||||
# CONFIG_INPUT_EVBUG is not set
|
||||
|
||||
#
|
||||
# Input Device Drivers
|
||||
#
|
||||
CONFIG_INPUT_KEYBOARD=y
|
||||
CONFIG_KEYBOARD_ATKBD=y
|
||||
# CONFIG_KEYBOARD_SUNKBD is not set
|
||||
# CONFIG_KEYBOARD_LKKBD is not set
|
||||
# CONFIG_KEYBOARD_XTKBD is not set
|
||||
# CONFIG_KEYBOARD_NEWTON is not set
|
||||
CONFIG_INPUT_MOUSE=y
|
||||
CONFIG_MOUSE_PS2=y
|
||||
# CONFIG_MOUSE_SERIAL is not set
|
||||
# CONFIG_MOUSE_INPORT is not set
|
||||
# CONFIG_MOUSE_LOGIBM is not set
|
||||
# CONFIG_MOUSE_PC110PAD is not set
|
||||
# CONFIG_MOUSE_VSXXXAA is not set
|
||||
# CONFIG_INPUT_JOYSTICK is not set
|
||||
# CONFIG_INPUT_TOUCHSCREEN is not set
|
||||
# CONFIG_INPUT_MISC is not set
|
||||
|
||||
#
|
||||
# Hardware I/O ports
|
||||
#
|
||||
CONFIG_SERIO=y
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
# CONFIG_SERIO_PARKBD is not set
|
||||
CONFIG_SERIO_RPCKBD=y
|
||||
CONFIG_SERIO_LIBPS2=y
|
||||
# CONFIG_SERIO_RAW is not set
|
||||
# CONFIG_GAMEPORT is not set
|
||||
CONFIG_SOUND_GAMEPORT=y
|
||||
|
||||
#
|
||||
# Character devices
|
||||
#
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
# CONFIG_SERIAL_NONSTANDARD is not set
|
||||
|
||||
#
|
||||
# Serial drivers
|
||||
#
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=4
|
||||
# CONFIG_SERIAL_8250_EXTENDED is not set
|
||||
|
||||
#
|
||||
# Non-8250 serial port support
|
||||
#
|
||||
CONFIG_SERIAL_CORE=y
|
||||
CONFIG_SERIAL_CORE_CONSOLE=y
|
||||
CONFIG_UNIX98_PTYS=y
|
||||
CONFIG_LEGACY_PTYS=y
|
||||
CONFIG_LEGACY_PTY_COUNT=256
|
||||
CONFIG_PRINTER=y
|
||||
# CONFIG_LP_CONSOLE is not set
|
||||
# CONFIG_PPDEV is not set
|
||||
# CONFIG_TIPAR is not set
|
||||
|
||||
#
|
||||
# IPMI
|
||||
#
|
||||
# CONFIG_IPMI_HANDLER is not set
|
||||
|
||||
#
|
||||
# Watchdog Cards
|
||||
#
|
||||
# CONFIG_WATCHDOG is not set
|
||||
# CONFIG_NVRAM is not set
|
||||
# CONFIG_RTC is not set
|
||||
# CONFIG_DTLK is not set
|
||||
# CONFIG_R3964 is not set
|
||||
|
||||
#
|
||||
# Ftape, the floppy tape device driver
|
||||
#
|
||||
# CONFIG_DRM is not set
|
||||
# CONFIG_RAW_DRIVER is not set
|
||||
|
||||
#
|
||||
# TPM devices
|
||||
#
|
||||
# CONFIG_TCG_TPM is not set
|
||||
|
||||
#
|
||||
# I2C support
|
||||
#
|
||||
CONFIG_I2C=y
|
||||
# CONFIG_I2C_CHARDEV is not set
|
||||
|
||||
#
|
||||
# I2C Algorithms
|
||||
#
|
||||
CONFIG_I2C_ALGOBIT=y
|
||||
# CONFIG_I2C_ALGOPCF is not set
|
||||
# CONFIG_I2C_ALGOPCA is not set
|
||||
|
||||
#
|
||||
# I2C Hardware Bus support
|
||||
#
|
||||
# CONFIG_I2C_ELEKTOR is not set
|
||||
# CONFIG_I2C_PARPORT is not set
|
||||
# CONFIG_I2C_PARPORT_LIGHT is not set
|
||||
# CONFIG_I2C_PCA_ISA is not set
|
||||
|
||||
#
|
||||
# Hardware Sensors Chip support
|
||||
#
|
||||
# CONFIG_I2C_SENSOR is not set
|
||||
# CONFIG_SENSORS_ADM1021 is not set
|
||||
# CONFIG_SENSORS_ADM1025 is not set
|
||||
# CONFIG_SENSORS_ADM1026 is not set
|
||||
# CONFIG_SENSORS_ADM1031 is not set
|
||||
# CONFIG_SENSORS_ASB100 is not set
|
||||
# CONFIG_SENSORS_DS1621 is not set
|
||||
# CONFIG_SENSORS_FSCHER is not set
|
||||
# CONFIG_SENSORS_FSCPOS is not set
|
||||
# CONFIG_SENSORS_GL518SM is not set
|
||||
# CONFIG_SENSORS_GL520SM is not set
|
||||
# CONFIG_SENSORS_IT87 is not set
|
||||
# CONFIG_SENSORS_LM63 is not set
|
||||
# CONFIG_SENSORS_LM75 is not set
|
||||
# CONFIG_SENSORS_LM77 is not set
|
||||
# CONFIG_SENSORS_LM78 is not set
|
||||
# CONFIG_SENSORS_LM80 is not set
|
||||
# CONFIG_SENSORS_LM83 is not set
|
||||
# CONFIG_SENSORS_LM85 is not set
|
||||
# CONFIG_SENSORS_LM87 is not set
|
||||
# CONFIG_SENSORS_LM90 is not set
|
||||
# CONFIG_SENSORS_MAX1619 is not set
|
||||
# CONFIG_SENSORS_PC87360 is not set
|
||||
# CONFIG_SENSORS_SMSC47B397 is not set
|
||||
# CONFIG_SENSORS_SMSC47M1 is not set
|
||||
# CONFIG_SENSORS_W83781D is not set
|
||||
# CONFIG_SENSORS_W83L785TS is not set
|
||||
# CONFIG_SENSORS_W83627HF is not set
|
||||
|
||||
#
|
||||
# Other I2C Chip support
|
||||
#
|
||||
# CONFIG_SENSORS_EEPROM is not set
|
||||
# CONFIG_SENSORS_PCF8574 is not set
|
||||
# CONFIG_SENSORS_PCF8591 is not set
|
||||
# CONFIG_SENSORS_RTC8564 is not set
|
||||
# CONFIG_I2C_DEBUG_CORE is not set
|
||||
# CONFIG_I2C_DEBUG_ALGO is not set
|
||||
# CONFIG_I2C_DEBUG_BUS is not set
|
||||
# CONFIG_I2C_DEBUG_CHIP is not set
|
||||
|
||||
#
|
||||
# Misc devices
|
||||
#
|
||||
|
||||
#
|
||||
# Multimedia devices
|
||||
#
|
||||
# CONFIG_VIDEO_DEV is not set
|
||||
|
||||
#
|
||||
# Digital Video Broadcasting Devices
|
||||
#
|
||||
# CONFIG_DVB is not set
|
||||
|
||||
#
|
||||
# Graphics support
|
||||
#
|
||||
CONFIG_FB=y
|
||||
CONFIG_FB_CFB_FILLRECT=y
|
||||
CONFIG_FB_CFB_COPYAREA=y
|
||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
||||
CONFIG_FB_SOFT_CURSOR=y
|
||||
# CONFIG_FB_MODE_HELPERS is not set
|
||||
# CONFIG_FB_TILEBLITTING is not set
|
||||
CONFIG_FB_ACORN=y
|
||||
# CONFIG_FB_VIRTUAL is not set
|
||||
|
||||
#
|
||||
# Console display driver support
|
||||
#
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
# CONFIG_MDA_CONSOLE is not set
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FONTS=y
|
||||
CONFIG_FONT_8x8=y
|
||||
CONFIG_FONT_8x16=y
|
||||
# CONFIG_FONT_6x11 is not set
|
||||
# CONFIG_FONT_PEARL_8x8 is not set
|
||||
# CONFIG_FONT_ACORN_8x8 is not set
|
||||
# CONFIG_FONT_MINI_4x6 is not set
|
||||
# CONFIG_FONT_SUN8x16 is not set
|
||||
# CONFIG_FONT_SUN12x22 is not set
|
||||
|
||||
#
|
||||
# Logo configuration
|
||||
#
|
||||
CONFIG_LOGO=y
|
||||
CONFIG_LOGO_LINUX_MONO=y
|
||||
CONFIG_LOGO_LINUX_VGA16=y
|
||||
CONFIG_LOGO_LINUX_CLUT224=y
|
||||
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Sound
|
||||
#
|
||||
# CONFIG_SOUND is not set
|
||||
|
||||
#
|
||||
# USB support
|
||||
#
|
||||
CONFIG_USB_ARCH_HAS_HCD=y
|
||||
# CONFIG_USB_ARCH_HAS_OHCI is not set
|
||||
# CONFIG_USB is not set
|
||||
|
||||
#
|
||||
# USB Gadget Support
|
||||
#
|
||||
# CONFIG_USB_GADGET is not set
|
||||
|
||||
#
|
||||
# MMC/SD Card support
|
||||
#
|
||||
# CONFIG_MMC is not set
|
||||
|
||||
#
|
||||
# File systems
|
||||
#
|
||||
CONFIG_EXT2_FS=y
|
||||
# CONFIG_EXT2_FS_XATTR is not set
|
||||
# CONFIG_EXT3_FS is not set
|
||||
# CONFIG_JBD is not set
|
||||
# CONFIG_REISERFS_FS is not set
|
||||
# CONFIG_JFS_FS is not set
|
||||
|
||||
#
|
||||
# XFS support
|
||||
#
|
||||
# CONFIG_XFS_FS is not set
|
||||
CONFIG_MINIX_FS=y
|
||||
# CONFIG_ROMFS_FS is not set
|
||||
# CONFIG_QUOTA is not set
|
||||
CONFIG_DNOTIFY=y
|
||||
# CONFIG_AUTOFS_FS is not set
|
||||
# CONFIG_AUTOFS4_FS is not set
|
||||
|
||||
#
|
||||
# CD-ROM/DVD Filesystems
|
||||
#
|
||||
# CONFIG_ISO9660_FS is not set
|
||||
# CONFIG_UDF_FS is not set
|
||||
|
||||
#
|
||||
# DOS/FAT/NT Filesystems
|
||||
#
|
||||
# CONFIG_MSDOS_FS is not set
|
||||
# CONFIG_VFAT_FS is not set
|
||||
# CONFIG_NTFS_FS is not set
|
||||
|
||||
#
|
||||
# Pseudo filesystems
|
||||
#
|
||||
CONFIG_PROC_FS=y
|
||||
CONFIG_SYSFS=y
|
||||
# CONFIG_DEVFS_FS is not set
|
||||
# CONFIG_DEVPTS_FS_XATTR is not set
|
||||
# CONFIG_TMPFS is not set
|
||||
# CONFIG_HUGETLB_PAGE is not set
|
||||
CONFIG_RAMFS=y
|
||||
|
||||
#
|
||||
# Miscellaneous filesystems
|
||||
#
|
||||
# CONFIG_ADFS_FS is not set
|
||||
# CONFIG_AFFS_FS is not set
|
||||
# CONFIG_HFS_FS is not set
|
||||
# CONFIG_HFSPLUS_FS is not set
|
||||
# CONFIG_BEFS_FS is not set
|
||||
# CONFIG_BFS_FS is not set
|
||||
# CONFIG_EFS_FS is not set
|
||||
# CONFIG_JFFS_FS is not set
|
||||
# CONFIG_JFFS2_FS is not set
|
||||
# CONFIG_CRAMFS is not set
|
||||
# CONFIG_VXFS_FS is not set
|
||||
# CONFIG_HPFS_FS is not set
|
||||
# CONFIG_QNX4FS_FS is not set
|
||||
# CONFIG_SYSV_FS is not set
|
||||
# CONFIG_UFS_FS is not set
|
||||
|
||||
#
|
||||
# Network File Systems
|
||||
#
|
||||
CONFIG_NFS_FS=y
|
||||
# CONFIG_NFS_V3 is not set
|
||||
# CONFIG_NFS_V4 is not set
|
||||
# CONFIG_NFS_DIRECTIO is not set
|
||||
# CONFIG_NFSD is not set
|
||||
CONFIG_ROOT_NFS=y
|
||||
CONFIG_LOCKD=y
|
||||
CONFIG_SUNRPC=y
|
||||
# CONFIG_RPCSEC_GSS_KRB5 is not set
|
||||
# CONFIG_RPCSEC_GSS_SPKM3 is not set
|
||||
# CONFIG_SMB_FS is not set
|
||||
# CONFIG_CIFS is not set
|
||||
# CONFIG_NCP_FS is not set
|
||||
# CONFIG_CODA_FS is not set
|
||||
# CONFIG_AFS_FS is not set
|
||||
|
||||
#
|
||||
# Partition Types
|
||||
#
|
||||
CONFIG_PARTITION_ADVANCED=y
|
||||
# CONFIG_ACORN_PARTITION is not set
|
||||
# CONFIG_OSF_PARTITION is not set
|
||||
# CONFIG_AMIGA_PARTITION is not set
|
||||
# CONFIG_ATARI_PARTITION is not set
|
||||
# CONFIG_MAC_PARTITION is not set
|
||||
# CONFIG_MSDOS_PARTITION is not set
|
||||
# CONFIG_LDM_PARTITION is not set
|
||||
# CONFIG_SGI_PARTITION is not set
|
||||
# CONFIG_ULTRIX_PARTITION is not set
|
||||
# CONFIG_SUN_PARTITION is not set
|
||||
# CONFIG_EFI_PARTITION is not set
|
||||
|
||||
#
|
||||
# Native Language Support
|
||||
#
|
||||
# CONFIG_NLS is not set
|
||||
|
||||
#
|
||||
# Profiling support
|
||||
#
|
||||
# CONFIG_PROFILING is not set
|
||||
|
||||
#
|
||||
# Kernel hacking
|
||||
#
|
||||
# CONFIG_PRINTK_TIME is not set
|
||||
# CONFIG_DEBUG_KERNEL is not set
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
# CONFIG_DEBUG_BUGVERBOSE is not set
|
||||
CONFIG_FRAME_POINTER=y
|
||||
# CONFIG_DEBUG_USER is not set
|
||||
|
||||
#
|
||||
# Security options
|
||||
#
|
||||
# CONFIG_KEYS is not set
|
||||
# CONFIG_SECURITY is not set
|
||||
|
||||
#
|
||||
# Cryptographic options
|
||||
#
|
||||
# CONFIG_CRYPTO is not set
|
||||
|
||||
#
|
||||
# Hardware crypto devices
|
||||
#
|
||||
|
||||
#
|
||||
# Library routines
|
||||
#
|
||||
# CONFIG_CRC_CCITT is not set
|
||||
CONFIG_CRC32=y
|
||||
# CONFIG_LIBCRC32C is not set
|
|
@ -24,7 +24,6 @@ typedef struct {
|
|||
* modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
|
||||
*/
|
||||
typedef struct {
|
||||
struct vm_list_struct *vmlist;
|
||||
unsigned long end_brk;
|
||||
} mm_context_t;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/fs.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
static unsigned int isa_membase, isa_portbase, isa_portshift;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/at91rm9200.h>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/cpu.h>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/at91sam9261.h>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/at91sam9263.h>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <mach/cpu.h>
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <mach/hardware.h>
|
||||
#include <mach/board.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/at91sam9_smc.h>
|
||||
#include <mach/at91_shdwc.h>
|
||||
|
||||
#include "sam9_smc.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/sizes.h>
|
||||
|
||||
#include <asm/mach/map.h>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <linux/initrd.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/setup.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/i2c.h>
|
||||
#include <mach/irqs.h>
|
||||
|
||||
static struct resource i2c_resources[] = {
|
||||
{
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/io.h>
|
||||
#include <asm-generic/gpio.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/irqs.h>
|
||||
|
||||
/*
|
||||
* basic gpio routines
|
||||
|
|
|
@ -28,12 +28,17 @@
|
|||
|
||||
#include "common.h"
|
||||
|
||||
extern void __init isa_init_irq(unsigned int irq);
|
||||
|
||||
unsigned int mem_fclk_21285 = 50000000;
|
||||
|
||||
EXPORT_SYMBOL(mem_fclk_21285);
|
||||
|
||||
static void __init early_fclk(char **arg)
|
||||
{
|
||||
mem_fclk_21285 = simple_strtoul(*arg, arg, 0);
|
||||
}
|
||||
|
||||
__early_param("mem_fclk_21285=", early_fclk);
|
||||
|
||||
static int __init parse_tag_memclk(const struct tag *tag)
|
||||
{
|
||||
mem_fclk_21285 = tag->u.memclk.fmemclk;
|
||||
|
|
|
@ -7,3 +7,4 @@ extern void isa_rtc_init(void);
|
|||
extern void footbridge_map_io(void);
|
||||
extern void footbridge_init_irq(void);
|
||||
|
||||
extern void isa_init_irq(unsigned int irq);
|
||||
|
|
|
@ -287,6 +287,9 @@ struct pci_bus * __init dc21285_scan_bus(int nr, struct pci_sys_data *sys)
|
|||
return pci_scan_bus(0, &dc21285_ops, sys);
|
||||
}
|
||||
|
||||
#define dc21285_request_irq(_a, _b, _c, _d, _e) \
|
||||
WARN_ON(request_irq(_a, _b, _c, _d, _e) < 0)
|
||||
|
||||
void __init dc21285_preinit(void)
|
||||
{
|
||||
unsigned int mem_size, mem_mask;
|
||||
|
@ -335,16 +338,16 @@ void __init dc21285_preinit(void)
|
|||
/*
|
||||
* We don't care if these fail.
|
||||
*/
|
||||
request_irq(IRQ_PCI_SERR, dc21285_serr_irq, IRQF_DISABLED,
|
||||
"PCI system error", &serr_timer);
|
||||
request_irq(IRQ_PCI_PERR, dc21285_parity_irq, IRQF_DISABLED,
|
||||
"PCI parity error", &perr_timer);
|
||||
request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, IRQF_DISABLED,
|
||||
"PCI abort", NULL);
|
||||
request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, IRQF_DISABLED,
|
||||
"Discard timer", NULL);
|
||||
request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, IRQF_DISABLED,
|
||||
"PCI data parity", NULL);
|
||||
dc21285_request_irq(IRQ_PCI_SERR, dc21285_serr_irq, IRQF_DISABLED,
|
||||
"PCI system error", &serr_timer);
|
||||
dc21285_request_irq(IRQ_PCI_PERR, dc21285_parity_irq, IRQF_DISABLED,
|
||||
"PCI parity error", &perr_timer);
|
||||
dc21285_request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, IRQF_DISABLED,
|
||||
"PCI abort", NULL);
|
||||
dc21285_request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, IRQF_DISABLED,
|
||||
"Discard timer", NULL);
|
||||
dc21285_request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, IRQF_DISABLED,
|
||||
"PCI data parity", NULL);
|
||||
|
||||
if (cfn_mode) {
|
||||
static struct resource csrio;
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
static void isa_mask_pic_lo_irq(unsigned int irq)
|
||||
{
|
||||
unsigned int mask = 1 << (irq & 7);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <asm/page.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/hardware.h>
|
||||
#include "common.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <mach/imx-regs.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
/*
|
||||
* Very simple approach: We can't disable clocks, so we do
|
||||
|
|
|
@ -245,11 +245,11 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
|
|||
imx_mmc_device.dev.platform_data = info;
|
||||
}
|
||||
|
||||
static struct imxfb_mach_info imx_fb_info;
|
||||
static struct imx_fb_platform_data imx_fb_info;
|
||||
|
||||
void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info)
|
||||
void __init set_imx_fb_info(struct imx_fb_platform_data *hard_imx_fb_info)
|
||||
{
|
||||
memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info));
|
||||
memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imx_fb_platform_data));
|
||||
}
|
||||
|
||||
static struct resource imxfb_resources[] = {
|
||||
|
|
|
@ -373,110 +373,4 @@
|
|||
#define TSTAT_CAPT (1<<1)
|
||||
#define TSTAT_COMP (1<<0)
|
||||
|
||||
/*
|
||||
* LCD Controller
|
||||
*/
|
||||
|
||||
#define LCDC_SSA __REG(IMX_LCDC_BASE+0x00)
|
||||
|
||||
#define LCDC_SIZE __REG(IMX_LCDC_BASE+0x04)
|
||||
#define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20)
|
||||
#define SIZE_YMAX(y) ( (y) & 0x1ff )
|
||||
|
||||
#define LCDC_VPW __REG(IMX_LCDC_BASE+0x08)
|
||||
#define VPW_VPW(x) ( (x) & 0x3ff )
|
||||
|
||||
#define LCDC_CPOS __REG(IMX_LCDC_BASE+0x0C)
|
||||
#define CPOS_CC1 (1<<31)
|
||||
#define CPOS_CC0 (1<<30)
|
||||
#define CPOS_OP (1<<28)
|
||||
#define CPOS_CXP(x) (((x) & 3ff) << 16)
|
||||
#define CPOS_CYP(y) ((y) & 0x1ff)
|
||||
|
||||
#define LCDC_LCWHB __REG(IMX_LCDC_BASE+0x10)
|
||||
#define LCWHB_BK_EN (1<<31)
|
||||
#define LCWHB_CW(w) (((w) & 0x1f) << 24)
|
||||
#define LCWHB_CH(h) (((h) & 0x1f) << 16)
|
||||
#define LCWHB_BD(x) ((x) & 0xff)
|
||||
|
||||
#define LCDC_LCHCC __REG(IMX_LCDC_BASE+0x14)
|
||||
#define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11)
|
||||
#define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5)
|
||||
#define LCHCC_CUR_COL_B(b) ((b) & 0x1f)
|
||||
|
||||
#define LCDC_PCR __REG(IMX_LCDC_BASE+0x18)
|
||||
#define PCR_TFT (1<<31)
|
||||
#define PCR_COLOR (1<<30)
|
||||
#define PCR_PBSIZ_1 (0<<28)
|
||||
#define PCR_PBSIZ_2 (1<<28)
|
||||
#define PCR_PBSIZ_4 (2<<28)
|
||||
#define PCR_PBSIZ_8 (3<<28)
|
||||
#define PCR_BPIX_1 (0<<25)
|
||||
#define PCR_BPIX_2 (1<<25)
|
||||
#define PCR_BPIX_4 (2<<25)
|
||||
#define PCR_BPIX_8 (3<<25)
|
||||
#define PCR_BPIX_12 (4<<25)
|
||||
#define PCR_BPIX_16 (4<<25)
|
||||
#define PCR_PIXPOL (1<<24)
|
||||
#define PCR_FLMPOL (1<<23)
|
||||
#define PCR_LPPOL (1<<22)
|
||||
#define PCR_CLKPOL (1<<21)
|
||||
#define PCR_OEPOL (1<<20)
|
||||
#define PCR_SCLKIDLE (1<<19)
|
||||
#define PCR_END_SEL (1<<18)
|
||||
#define PCR_END_BYTE_SWAP (1<<17)
|
||||
#define PCR_REV_VS (1<<16)
|
||||
#define PCR_ACD_SEL (1<<15)
|
||||
#define PCR_ACD(x) (((x) & 0x7f) << 8)
|
||||
#define PCR_SCLK_SEL (1<<7)
|
||||
#define PCR_SHARP (1<<6)
|
||||
#define PCR_PCD(x) ((x) & 0x3f)
|
||||
|
||||
#define LCDC_HCR __REG(IMX_LCDC_BASE+0x1C)
|
||||
#define HCR_H_WIDTH(x) (((x) & 0x3f) << 26)
|
||||
#define HCR_H_WAIT_1(x) (((x) & 0xff) << 8)
|
||||
#define HCR_H_WAIT_2(x) ((x) & 0xff)
|
||||
|
||||
#define LCDC_VCR __REG(IMX_LCDC_BASE+0x20)
|
||||
#define VCR_V_WIDTH(x) (((x) & 0x3f) << 26)
|
||||
#define VCR_V_WAIT_1(x) (((x) & 0xff) << 8)
|
||||
#define VCR_V_WAIT_2(x) ((x) & 0xff)
|
||||
|
||||
#define LCDC_POS __REG(IMX_LCDC_BASE+0x24)
|
||||
#define POS_POS(x) ((x) & 1f)
|
||||
|
||||
#define LCDC_LSCR1 __REG(IMX_LCDC_BASE+0x28)
|
||||
#define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26)
|
||||
#define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16)
|
||||
#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
|
||||
#define LSCR1_GRAY2(x) (((x) & 0xf) << 4)
|
||||
#define LSCR1_GRAY1(x) (((x) & 0xf))
|
||||
|
||||
#define LCDC_PWMR __REG(IMX_LCDC_BASE+0x2C)
|
||||
#define PWMR_CLS(x) (((x) & 0x1ff) << 16)
|
||||
#define PWMR_LDMSK (1<<15)
|
||||
#define PWMR_SCR1 (1<<10)
|
||||
#define PWMR_SCR0 (1<<9)
|
||||
#define PWMR_CC_EN (1<<8)
|
||||
#define PWMR_PW(x) ((x) & 0xff)
|
||||
|
||||
#define LCDC_DMACR __REG(IMX_LCDC_BASE+0x30)
|
||||
#define DMACR_BURST (1<<31)
|
||||
#define DMACR_HM(x) (((x) & 0xf) << 16)
|
||||
#define DMACR_TM(x) ((x) &0xf)
|
||||
|
||||
#define LCDC_RMCR __REG(IMX_LCDC_BASE+0x34)
|
||||
#define RMCR_LCDC_EN (1<<1)
|
||||
#define RMCR_SELF_REF (1<<0)
|
||||
|
||||
#define LCDC_LCDICR __REG(IMX_LCDC_BASE+0x38)
|
||||
#define LCDICR_INT_SYN (1<<2)
|
||||
#define LCDICR_INT_CON (1)
|
||||
|
||||
#define LCDC_LCDISR __REG(IMX_LCDC_BASE+0x40)
|
||||
#define LCDISR_UDR_ERR (1<<3)
|
||||
#define LCDISR_ERR_RES (1<<2)
|
||||
#define LCDISR_EOF (1<<1)
|
||||
#define LCDISR_BOF (1<<0)
|
||||
|
||||
#endif // _IMX_REGS_H
|
||||
|
|
|
@ -698,6 +698,7 @@ void __init kirkwood_init(void)
|
|||
printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
|
||||
kirkwood_id(), kirkwood_tclk);
|
||||
kirkwood_ge00_shared_data.t_clk = kirkwood_tclk;
|
||||
kirkwood_ge01_shared_data.t_clk = kirkwood_tclk;
|
||||
kirkwood_spi_plat_data.tclk = kirkwood_tclk;
|
||||
kirkwood_uart0_data[0].uartclk = kirkwood_tclk;
|
||||
kirkwood_uart1_data[0].uartclk = kirkwood_tclk;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/mbus.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/pci.h>
|
||||
#include <plat/pcie.h>
|
||||
#include "common.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/regs-wan.h>
|
||||
#include <mach/regs-lan.h>
|
||||
#include <mach/regs-hpna.h>
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/msm_iomap.h>
|
||||
#include "devices.h"
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/mbus.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/pci.h>
|
||||
#include <plat/pcie.h>
|
||||
#include "common.h"
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
/*
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <linux/serial.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/imx-uart.h>
|
||||
|
||||
static struct resource uart0[] = {
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include <linux/amba/clcd.h>
|
||||
#include <linux/err.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include <mach/netx-regs.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ static void __init netx_timer_init(void)
|
|||
* Adding some safety ... */
|
||||
netx_clockevent.min_delta_ns =
|
||||
clockevent_delta2ns(0xa00, &netx_clockevent);
|
||||
netx_clockevent.cpumask = cpumask_of_cpu(0);
|
||||
netx_clockevent.cpumask = cpumask_of(0);
|
||||
clockevents_register_device(&netx_clockevent);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <linux/io.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/netx-regs.h>
|
||||
|
||||
#include <mach/xc.h>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
|
||||
#include <mach/dma.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/mux.h>
|
||||
#include <mach/cpu.h>
|
||||
#include <mach/mcbsp.h>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
|
||||
#include <mach/dma.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/mux.h>
|
||||
#include <mach/cpu.h>
|
||||
#include <mach/mcbsp.h>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/mbus.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/mach/pci.h>
|
||||
#include <plat/pcie.h>
|
||||
#include "common.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/io.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/platform.h>
|
||||
#include <mach/gpio.h>
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/err.h>
|
||||
#include <mach/platform.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/i2c.h>
|
||||
|
||||
static int set_clock_run(struct platform_device *pdev)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/ads7846.h>
|
||||
#include <linux/spi/corgi_lcd.h>
|
||||
#include <linux/mtd/sharpsl.h>
|
||||
#include <video/w100fb.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
|
@ -542,6 +543,55 @@ err_free_1:
|
|||
static inline void corgi_init_spi(void) {}
|
||||
#endif
|
||||
|
||||
static struct mtd_partition sharpsl_nand_partitions[] = {
|
||||
{
|
||||
.name = "System Area",
|
||||
.offset = 0,
|
||||
.size = 7 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "Root Filesystem",
|
||||
.offset = 7 * 1024 * 1024,
|
||||
.size = 25 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "Home Filesystem",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
|
||||
|
||||
static struct nand_bbt_descr sharpsl_bbt = {
|
||||
.options = 0,
|
||||
.offs = 4,
|
||||
.len = 2,
|
||||
.pattern = scan_ff_pattern
|
||||
};
|
||||
|
||||
static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
|
||||
.badblock_pattern = &sharpsl_bbt,
|
||||
.partitions = sharpsl_nand_partitions,
|
||||
.nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions),
|
||||
};
|
||||
|
||||
static struct resource sharpsl_nand_resources[] = {
|
||||
{
|
||||
.start = 0x0C000000,
|
||||
.end = 0x0C000FFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device sharpsl_nand_device = {
|
||||
.name = "sharpsl-nand",
|
||||
.id = -1,
|
||||
.resource = sharpsl_nand_resources,
|
||||
.num_resources = ARRAY_SIZE(sharpsl_nand_resources),
|
||||
.dev.platform_data = &sharpsl_nand_platform_data,
|
||||
};
|
||||
|
||||
static struct mtd_partition sharpsl_rom_parts[] = {
|
||||
{
|
||||
.name ="Boot PROM Filesystem",
|
||||
|
@ -577,6 +627,7 @@ static struct platform_device *devices[] __initdata = {
|
|||
&corgifb_device,
|
||||
&corgikbd_device,
|
||||
&corgiled_device,
|
||||
&sharpsl_nand_device,
|
||||
&sharpsl_rom_device,
|
||||
};
|
||||
|
||||
|
@ -617,6 +668,9 @@ static void __init corgi_init(void)
|
|||
|
||||
platform_scoop_config = &corgi_pcmcia_config;
|
||||
|
||||
if (machine_is_husky())
|
||||
sharpsl_nand_partitions[1].size = 53 * 1024 * 1024;
|
||||
|
||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/mfp-pxa25x.h>
|
||||
#include <mach/pxa-regs.h>
|
||||
#include <mach/hardware.h>
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <mach/eseries-gpio.h>
|
||||
#include <mach/pxafb.h>
|
||||
#include <mach/udc.h>
|
||||
#include <mach/irqs.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "eseries.h"
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <mach/eseries-gpio.h>
|
||||
#include <mach/udc.h>
|
||||
#include <mach/irda.h>
|
||||
#include <mach/irqs.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "eseries.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <mach/eseries-gpio.h>
|
||||
#include <mach/udc.h>
|
||||
#include <mach/irda.h>
|
||||
#include <mach/irqs.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "eseries.h"
|
||||
|
@ -105,6 +106,57 @@ static struct platform_device e750_fb_device = {
|
|||
.resource = e750_fb_resources,
|
||||
};
|
||||
|
||||
/* -------------------- e750 MFP parameters -------------------- */
|
||||
|
||||
static unsigned long e750_pin_config[] __initdata = {
|
||||
/* Chip selects */
|
||||
GPIO15_nCS_1, /* CS1 - Flash */
|
||||
GPIO79_nCS_3, /* CS3 - IMAGEON */
|
||||
GPIO80_nCS_4, /* CS4 - TMIO */
|
||||
|
||||
/* Clocks */
|
||||
GPIO11_3_6MHz,
|
||||
|
||||
/* BTUART */
|
||||
GPIO42_BTUART_RXD,
|
||||
GPIO43_BTUART_TXD,
|
||||
GPIO44_BTUART_CTS,
|
||||
|
||||
/* TMIO controller */
|
||||
GPIO19_GPIO, /* t7l66xb #PCLR */
|
||||
GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
|
||||
|
||||
/* UDC */
|
||||
GPIO13_GPIO,
|
||||
GPIO3_GPIO,
|
||||
|
||||
/* IrDA */
|
||||
GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
|
||||
|
||||
/* PC Card */
|
||||
GPIO8_GPIO, /* CD0 */
|
||||
GPIO44_GPIO, /* CD1 */
|
||||
GPIO11_GPIO, /* IRQ0 */
|
||||
GPIO6_GPIO, /* IRQ1 */
|
||||
GPIO27_GPIO, /* RST0 */
|
||||
GPIO24_GPIO, /* RST1 */
|
||||
GPIO20_GPIO, /* PWR0 */
|
||||
GPIO23_GPIO, /* PWR1 */
|
||||
GPIO48_nPOE,
|
||||
GPIO49_nPWE,
|
||||
GPIO50_nPIOR,
|
||||
GPIO51_nPIOW,
|
||||
GPIO52_nPCE_1,
|
||||
GPIO53_nPCE_2,
|
||||
GPIO54_nPSKTSEL,
|
||||
GPIO55_nPREG,
|
||||
GPIO56_nPWAIT,
|
||||
GPIO57_nIOIS16,
|
||||
|
||||
/* wakeup */
|
||||
GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
|
||||
};
|
||||
|
||||
/* ----------------- e750 tc6393xb parameters ------------------ */
|
||||
|
||||
static struct tc6393xb_platform_data e750_tc6393xb_info = {
|
||||
|
@ -137,6 +189,7 @@ static struct platform_device *devices[] __initdata = {
|
|||
|
||||
static void __init e750_init(void)
|
||||
{
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
|
||||
clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev,
|
||||
"GPIO11_CLK", NULL),
|
||||
eseries_get_tmio_gpios();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <mach/hardware.h>
|
||||
#include <mach/eseries-gpio.h>
|
||||
#include <mach/udc.h>
|
||||
#include <mach/irqs.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "eseries.h"
|
||||
|
|
|
@ -193,10 +193,8 @@
|
|||
#define CKEN_MINI_IM 48 /* < Mini-IM */
|
||||
#define CKEN_MINI_LCD 49 /* < Mini LCD */
|
||||
|
||||
#if defined(CONFIG_CPU_PXA310)
|
||||
#define CKEN_MMC3 5 /* < MMC3 Clock Enable */
|
||||
#define CKEN_MVED 43 /* < MVED clock enable */
|
||||
#endif
|
||||
|
||||
/* Note: GCU clock enable bit differs on PXA300/PXA310 and PXA320 */
|
||||
#define PXA300_CKEN_GRAPHICS 42 /* Graphics controller clock enable */
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <linux/gpio.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/ads7846.h>
|
||||
#include <linux/mtd/sharpsl.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
@ -414,6 +415,55 @@ static struct pxafb_mach_info poodle_fb_info = {
|
|||
.lcd_conn = LCD_COLOR_TFT_16BPP,
|
||||
};
|
||||
|
||||
static struct mtd_partition sharpsl_nand_partitions[] = {
|
||||
{
|
||||
.name = "System Area",
|
||||
.offset = 0,
|
||||
.size = 7 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "Root Filesystem",
|
||||
.offset = 7 * 1024 * 1024,
|
||||
.size = 22 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "Home Filesystem",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
|
||||
|
||||
static struct nand_bbt_descr sharpsl_bbt = {
|
||||
.options = 0,
|
||||
.offs = 4,
|
||||
.len = 2,
|
||||
.pattern = scan_ff_pattern
|
||||
};
|
||||
|
||||
static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
|
||||
.badblock_pattern = &sharpsl_bbt,
|
||||
.partitions = sharpsl_nand_partitions,
|
||||
.nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions),
|
||||
};
|
||||
|
||||
static struct resource sharpsl_nand_resources[] = {
|
||||
{
|
||||
.start = 0x0C000000,
|
||||
.end = 0x0C000FFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device sharpsl_nand_device = {
|
||||
.name = "sharpsl-nand",
|
||||
.id = -1,
|
||||
.resource = sharpsl_nand_resources,
|
||||
.num_resources = ARRAY_SIZE(sharpsl_nand_resources),
|
||||
.dev.platform_data = &sharpsl_nand_platform_data,
|
||||
};
|
||||
|
||||
static struct mtd_partition sharpsl_rom_parts[] = {
|
||||
{
|
||||
.name ="Boot PROM Filesystem",
|
||||
|
@ -447,6 +497,7 @@ static struct platform_device sharpsl_rom_device = {
|
|||
static struct platform_device *devices[] __initdata = {
|
||||
&poodle_locomo_device,
|
||||
&poodle_scoop_device,
|
||||
&sharpsl_nand_device,
|
||||
&sharpsl_rom_device,
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/ads7846.h>
|
||||
#include <linux/spi/corgi_lcd.h>
|
||||
#include <linux/mtd/sharpsl.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/memory.h>
|
||||
|
@ -613,6 +614,54 @@ static struct pxafb_mach_info spitz_pxafb_info = {
|
|||
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING,
|
||||
};
|
||||
|
||||
static struct mtd_partition sharpsl_nand_partitions[] = {
|
||||
{
|
||||
.name = "System Area",
|
||||
.offset = 0,
|
||||
.size = 7 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "Root Filesystem",
|
||||
.offset = 7 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "Home Filesystem",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
|
||||
|
||||
static struct nand_bbt_descr sharpsl_bbt = {
|
||||
.options = 0,
|
||||
.offs = 4,
|
||||
.len = 2,
|
||||
.pattern = scan_ff_pattern
|
||||
};
|
||||
|
||||
static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
|
||||
.badblock_pattern = &sharpsl_bbt,
|
||||
.partitions = sharpsl_nand_partitions,
|
||||
.nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions),
|
||||
};
|
||||
|
||||
static struct resource sharpsl_nand_resources[] = {
|
||||
{
|
||||
.start = 0x0C000000,
|
||||
.end = 0x0C000FFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device sharpsl_nand_device = {
|
||||
.name = "sharpsl-nand",
|
||||
.id = -1,
|
||||
.resource = sharpsl_nand_resources,
|
||||
.num_resources = ARRAY_SIZE(sharpsl_nand_resources),
|
||||
.dev.platform_data = &sharpsl_nand_platform_data,
|
||||
};
|
||||
|
||||
|
||||
static struct mtd_partition sharpsl_rom_parts[] = {
|
||||
{
|
||||
|
@ -648,6 +697,7 @@ static struct platform_device *devices[] __initdata = {
|
|||
&spitzscoop_device,
|
||||
&spitzkbd_device,
|
||||
&spitzled_device,
|
||||
&sharpsl_nand_device,
|
||||
&sharpsl_rom_device,
|
||||
};
|
||||
|
||||
|
@ -671,6 +721,14 @@ static void __init common_init(void)
|
|||
pm_power_off = spitz_poweroff;
|
||||
arm_pm_restart = spitz_restart;
|
||||
|
||||
if (machine_is_spitz()) {
|
||||
sharpsl_nand_partitions[1].size = 5 * 1024 * 1024;
|
||||
} else if (machine_is_akita()) {
|
||||
sharpsl_nand_partitions[1].size = 58 * 1024 * 1024;
|
||||
} else if (machine_is_borzoi()) {
|
||||
sharpsl_nand_partitions[1].size = 32 * 1024 * 1024;
|
||||
}
|
||||
|
||||
PMCR = 0x00;
|
||||
|
||||
/* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
|
||||
|
@ -715,10 +773,29 @@ static struct i2c_board_info akita_i2c_board_info[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct nand_bbt_descr sharpsl_akita_bbt = {
|
||||
.options = 0,
|
||||
.offs = 4,
|
||||
.len = 1,
|
||||
.pattern = scan_ff_pattern
|
||||
};
|
||||
|
||||
static struct nand_ecclayout akita_oobinfo = {
|
||||
.eccbytes = 24,
|
||||
.eccpos = {
|
||||
0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
|
||||
0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
|
||||
0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
|
||||
.oobfree = {{0x08, 0x09}}
|
||||
};
|
||||
|
||||
static void __init akita_init(void)
|
||||
{
|
||||
spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode;
|
||||
|
||||
sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
|
||||
sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
|
||||
|
||||
/* We just pretend the second element of the array doesn't exist */
|
||||
spitz_pcmcia_config.num_devs = 1;
|
||||
platform_scoop_config = &spitz_pcmcia_config;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/errno.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#define gpio_get_value __gpio_get_value
|
||||
#define gpio_set_value __gpio_set_value
|
||||
#define gpio_cansleep __gpio_cansleep
|
||||
#define gpio_to_irq __gpio_to_irq
|
||||
|
||||
/* some boards require extra gpio capacity to support external
|
||||
* devices that need GPIO.
|
||||
|
|
|
@ -12,10 +12,6 @@
|
|||
#ifndef __ASM_ARCH_IRQS_H
|
||||
#define __ASM_ARCH_IRQS_H __FILE__
|
||||
|
||||
#ifndef __ASM_ARM_IRQ_H
|
||||
#error "Do not include this directly, instead #include <asm/irq.h>"
|
||||
#endif
|
||||
|
||||
/* we keep the first set of CPU IRQs out of the range of
|
||||
* the ISA space, so that the PC104 has them to itself
|
||||
* and we don't end up having to do horrible things to the
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <asm/plat-s3c24xx/mci.h>
|
||||
#include <plat/mci.h>
|
||||
|
||||
static struct map_desc at2440evb_iodesc[] __initdata = {
|
||||
/* Nothing here */
|
||||
|
|
|
@ -11,10 +11,6 @@
|
|||
#ifndef __ASM_ARCH_IRQS_H
|
||||
#define __ASM_ARCH_IRQS_H __FILE__
|
||||
|
||||
#ifndef __ASM_ARM_IRQ_H
|
||||
#error "Do not include this directly, instead #include <asm/irq.h>"
|
||||
#endif
|
||||
|
||||
#include <plat/irqs.h>
|
||||
|
||||
#endif /* __ASM_ARCH_IRQ_H */
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <asm/mach-types.h>
|
||||
|
||||
#include <mach/regs-serial.h>
|
||||
#include <mach/map.h>
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <asm/mach/irq.h>
|
||||
#include <asm/mach/time.h>
|
||||
|
||||
#include <mach/system.h>
|
||||
#include <mach/map.h>
|
||||
#include <mach/regs-timer.h>
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ static DEFINE_SPINLOCK(consistent_lock);
|
|||
* the amount of RAM found at boot time.) I would imagine that get_vm_area()
|
||||
* would have to initialise this each time prior to calling vm_region_alloc().
|
||||
*/
|
||||
struct vm_region {
|
||||
struct arm_vm_region {
|
||||
struct list_head vm_list;
|
||||
unsigned long vm_start;
|
||||
unsigned long vm_end;
|
||||
|
@ -79,20 +79,20 @@ struct vm_region {
|
|||
int vm_active;
|
||||
};
|
||||
|
||||
static struct vm_region consistent_head = {
|
||||
static struct arm_vm_region consistent_head = {
|
||||
.vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
|
||||
.vm_start = CONSISTENT_BASE,
|
||||
.vm_end = CONSISTENT_END,
|
||||
};
|
||||
|
||||
static struct vm_region *
|
||||
vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp)
|
||||
static struct arm_vm_region *
|
||||
arm_vm_region_alloc(struct arm_vm_region *head, size_t size, gfp_t gfp)
|
||||
{
|
||||
unsigned long addr = head->vm_start, end = head->vm_end - size;
|
||||
unsigned long flags;
|
||||
struct vm_region *c, *new;
|
||||
struct arm_vm_region *c, *new;
|
||||
|
||||
new = kmalloc(sizeof(struct vm_region), gfp);
|
||||
new = kmalloc(sizeof(struct arm_vm_region), gfp);
|
||||
if (!new)
|
||||
goto out;
|
||||
|
||||
|
@ -127,9 +127,9 @@ vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static struct vm_region *vm_region_find(struct vm_region *head, unsigned long addr)
|
||||
static struct arm_vm_region *arm_vm_region_find(struct arm_vm_region *head, unsigned long addr)
|
||||
{
|
||||
struct vm_region *c;
|
||||
struct arm_vm_region *c;
|
||||
|
||||
list_for_each_entry(c, &head->vm_list, vm_list) {
|
||||
if (c->vm_active && c->vm_start == addr)
|
||||
|
@ -149,7 +149,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
|
|||
pgprot_t prot)
|
||||
{
|
||||
struct page *page;
|
||||
struct vm_region *c;
|
||||
struct arm_vm_region *c;
|
||||
unsigned long order;
|
||||
u64 mask = ISA_DMA_THRESHOLD, limit;
|
||||
|
||||
|
@ -214,7 +214,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
|
|||
/*
|
||||
* Allocate a virtual address in the consistent mapping region.
|
||||
*/
|
||||
c = vm_region_alloc(&consistent_head, size,
|
||||
c = arm_vm_region_alloc(&consistent_head, size,
|
||||
gfp & ~(__GFP_DMA | __GFP_HIGHMEM));
|
||||
if (c) {
|
||||
pte_t *pte;
|
||||
|
@ -311,13 +311,13 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
|||
void *cpu_addr, dma_addr_t dma_addr, size_t size)
|
||||
{
|
||||
unsigned long flags, user_size, kern_size;
|
||||
struct vm_region *c;
|
||||
struct arm_vm_region *c;
|
||||
int ret = -ENXIO;
|
||||
|
||||
user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
|
||||
|
||||
spin_lock_irqsave(&consistent_lock, flags);
|
||||
c = vm_region_find(&consistent_head, (unsigned long)cpu_addr);
|
||||
c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
|
||||
spin_unlock_irqrestore(&consistent_lock, flags);
|
||||
|
||||
if (c) {
|
||||
|
@ -359,7 +359,7 @@ EXPORT_SYMBOL(dma_mmap_writecombine);
|
|||
*/
|
||||
void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
|
||||
{
|
||||
struct vm_region *c;
|
||||
struct arm_vm_region *c;
|
||||
unsigned long flags, addr;
|
||||
pte_t *ptep;
|
||||
int idx;
|
||||
|
@ -378,7 +378,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
|
|||
size = PAGE_ALIGN(size);
|
||||
|
||||
spin_lock_irqsave(&consistent_lock, flags);
|
||||
c = vm_region_find(&consistent_head, (unsigned long)cpu_addr);
|
||||
c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
|
||||
if (!c)
|
||||
goto no_area;
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ EXPORT_SYMBOL(__cpuc_flush_kern_all);
|
|||
EXPORT_SYMBOL(__cpuc_flush_user_all);
|
||||
EXPORT_SYMBOL(__cpuc_flush_user_range);
|
||||
EXPORT_SYMBOL(__cpuc_coherent_kern_range);
|
||||
EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */
|
||||
#else
|
||||
EXPORT_SYMBOL(cpu_cache);
|
||||
#endif
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/mux.h>
|
||||
|
||||
#define OMAP_I2C_SIZE 0x3f
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/fb.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/map.h>
|
||||
#include <mach/regs-fb.h>
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/string.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/map.h>
|
||||
|
||||
#include <plat/regs-iic.h>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/string.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/map.h>
|
||||
|
||||
#include <plat/regs-iic.h>
|
||||
|
|
|
@ -59,6 +59,22 @@ static int s3c24xx_gpiolib_banka_output(struct gpio_chip *chip,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int s3c24xx_gpiolib_bankf_toirq(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
if (offset < 4)
|
||||
return IRQ_EINT0 + offset;
|
||||
|
||||
if (offset < 8)
|
||||
return IRQ_EINT4 + offset - 4;
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int s3c24xx_gpiolib_bankg_toirq(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
return IRQ_EINT8 + offset;
|
||||
}
|
||||
|
||||
struct s3c_gpio_chip s3c24xx_gpios[] = {
|
||||
[0] = {
|
||||
.base = S3C24XX_GPIO_BASE(S3C2410_GPA0),
|
||||
|
@ -114,6 +130,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
|
|||
.owner = THIS_MODULE,
|
||||
.label = "GPIOF",
|
||||
.ngpio = 8,
|
||||
.to_irq = s3c24xx_gpiolib_bankf_toirq,
|
||||
},
|
||||
},
|
||||
[6] = {
|
||||
|
@ -123,6 +140,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
|
|||
.owner = THIS_MODULE,
|
||||
.label = "GPIOG",
|
||||
.ngpio = 10,
|
||||
.to_irq = s3c24xx_gpiolib_bankg_toirq,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/pwm.h>
|
||||
|
||||
#include <mach/irqs.h>
|
||||
|
||||
#include <plat/devs.h>
|
||||
#include <plat/regs-timer.h>
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
#define IRQ_EINT_GROUP8_BASE (IRQ_EINT_GROUP7_BASE + IRQ_EINT_GROUP7_NR)
|
||||
#define IRQ_EINT_GROUP9_BASE (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR)
|
||||
|
||||
#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##__BASE + (x))
|
||||
#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no))
|
||||
|
||||
/* Set the default NR_IRQS */
|
||||
|
||||
|
|
|
@ -1305,7 +1305,7 @@ struct platform_device *__init
|
|||
at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
|
||||
{
|
||||
struct platform_device *pdev;
|
||||
struct dw_dma_slave *dws;
|
||||
struct dw_dma_slave *dws = &data->dma_slave;
|
||||
u32 pioa_mask;
|
||||
u32 piob_mask;
|
||||
|
||||
|
@ -1324,22 +1324,13 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
|
|||
ARRAY_SIZE(atmel_mci0_resource)))
|
||||
goto fail;
|
||||
|
||||
if (data->dma_slave)
|
||||
dws = kmemdup(to_dw_dma_slave(data->dma_slave),
|
||||
sizeof(struct dw_dma_slave), GFP_KERNEL);
|
||||
else
|
||||
dws = kzalloc(sizeof(struct dw_dma_slave), GFP_KERNEL);
|
||||
|
||||
dws->slave.dev = &pdev->dev;
|
||||
dws->slave.dma_dev = &dw_dmac0_device.dev;
|
||||
dws->slave.reg_width = DMA_SLAVE_WIDTH_32BIT;
|
||||
dws->dma_dev = &dw_dmac0_device.dev;
|
||||
dws->reg_width = DW_DMA_SLAVE_WIDTH_32BIT;
|
||||
dws->cfg_hi = (DWC_CFGH_SRC_PER(0)
|
||||
| DWC_CFGH_DST_PER(1));
|
||||
dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL
|
||||
| DWC_CFGL_HS_SRC_POL);
|
||||
|
||||
data->dma_slave = &dws->slave;
|
||||
|
||||
if (platform_device_add_data(pdev, data,
|
||||
sizeof(struct mci_platform_data)))
|
||||
goto fail;
|
||||
|
|
|
@ -10,7 +10,6 @@ struct sram_list_struct {
|
|||
};
|
||||
|
||||
typedef struct {
|
||||
struct vm_list_struct *vmlist;
|
||||
unsigned long end_brk;
|
||||
unsigned long stack_start;
|
||||
|
||||
|
|
|
@ -160,15 +160,15 @@ put_reg(struct task_struct *task, int regno, unsigned long data)
|
|||
static inline int is_user_addr_valid(struct task_struct *child,
|
||||
unsigned long start, unsigned long len)
|
||||
{
|
||||
struct vm_list_struct *vml;
|
||||
struct vm_area_struct *vma;
|
||||
struct sram_list_struct *sraml;
|
||||
|
||||
/* overflow */
|
||||
if (start + len < start)
|
||||
return -EIO;
|
||||
|
||||
for (vml = child->mm->context.vmlist; vml; vml = vml->next)
|
||||
if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end)
|
||||
vma = find_vma(child->mm, start);
|
||||
if (vma && start >= vma->vm_start && start + len <= vma->vm_end)
|
||||
return 0;
|
||||
|
||||
for (sraml = child->mm->context.sram_list; sraml; sraml = sraml->next)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/kallsyms.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <asm/traps.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/cplb.h>
|
||||
|
@ -83,6 +84,7 @@ static void decode_address(char *buf, unsigned long address)
|
|||
struct mm_struct *mm;
|
||||
unsigned long flags, offset;
|
||||
unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
|
||||
struct rb_node *n;
|
||||
|
||||
#ifdef CONFIG_KALLSYMS
|
||||
unsigned long symsize;
|
||||
|
@ -128,9 +130,10 @@ static void decode_address(char *buf, unsigned long address)
|
|||
if (!mm)
|
||||
continue;
|
||||
|
||||
vml = mm->context.vmlist;
|
||||
while (vml) {
|
||||
struct vm_area_struct *vma = vml->vma;
|
||||
for (n = rb_first(&mm->mm_rb); n; n = rb_next(n)) {
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
vma = rb_entry(n, struct vm_area_struct, vm_rb);
|
||||
|
||||
if (address >= vma->vm_start && address < vma->vm_end) {
|
||||
char _tmpbuf[256];
|
||||
|
@ -176,8 +179,6 @@ static void decode_address(char *buf, unsigned long address)
|
|||
|
||||
goto done;
|
||||
}
|
||||
|
||||
vml = vml->next;
|
||||
}
|
||||
if (!in_atomic)
|
||||
mmput(mm);
|
||||
|
|
|
@ -69,7 +69,8 @@ static inline int put_reg(struct task_struct *task, int regno,
|
|||
}
|
||||
|
||||
/*
|
||||
* check that an address falls within the bounds of the target process's memory mappings
|
||||
* check that an address falls within the bounds of the target process's memory
|
||||
* mappings
|
||||
*/
|
||||
static inline int is_user_addr_valid(struct task_struct *child,
|
||||
unsigned long start, unsigned long len)
|
||||
|
@ -79,11 +80,11 @@ static inline int is_user_addr_valid(struct task_struct *child,
|
|||
return -EIO;
|
||||
return 0;
|
||||
#else
|
||||
struct vm_list_struct *vml;
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
for (vml = child->mm->context.vmlist; vml; vml = vml->next)
|
||||
if (start >= vml->vma->vm_start && start + len <= vml->vma->vm_end)
|
||||
return 0;
|
||||
vma = find_vma(child->mm, start);
|
||||
if (vma && start >= vma->vm_start && start + len <= vma->vm_end)
|
||||
return 0;
|
||||
|
||||
return -EIO;
|
||||
#endif
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
|
||||
|
||||
typedef struct {
|
||||
struct vm_list_struct *vmlist;
|
||||
unsigned long end_brk;
|
||||
} mm_context_t;
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#define _ASM_IA64_ACPI_EXT_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <acpi/actypes.h>
|
||||
|
||||
extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ irq_canonicalize (int irq)
|
|||
}
|
||||
|
||||
extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
|
||||
bool is_affinity_mask_valid(cpumask_var_t cpumask);
|
||||
bool is_affinity_mask_valid(const struct cpumask *cpumask);
|
||||
|
||||
#define is_affinity_mask_valid is_affinity_mask_valid
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче