mirror of https://gitee.com/openkylin/linux.git
Merge branches 'drivers/macb-gem' and 'drivers/pxa-gpio' into next/drivers
This commit is contained in:
commit
58a273745f
2
.mailmap
2
.mailmap
|
@ -68,6 +68,7 @@ Juha Yrjola <juha.yrjola@solidboot.com>
|
|||
Kay Sievers <kay.sievers@vrfy.org>
|
||||
Kenneth W Chen <kenneth.w.chen@intel.com>
|
||||
Koushik <raghavendra.koushik@neterion.com>
|
||||
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
||||
Leonid I Ananiev <leonid.i.ananiev@intel.com>
|
||||
Linas Vepstas <linas@austin.ibm.com>
|
||||
Mark Brown <broonie@sirena.org.uk>
|
||||
|
@ -111,3 +112,4 @@ Uwe Kleine-König <ukl@pengutronix.de>
|
|||
Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
|
||||
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
|
||||
Takashi YOSHII <takashi.yoshii.zj@renesas.com>
|
||||
Yusuke Goda <goda.yusuke@renesas.com>
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
What: /sys/firmware/acpi/pm_profile
|
||||
Date: 03-Nov-2011
|
||||
KernelVersion: v3.2
|
||||
Contact: linux-acpi@vger.kernel.org
|
||||
Description: The ACPI pm_profile sysfs interface exports the platform
|
||||
power management (and performance) requirement expectations
|
||||
as provided by BIOS. The integer value is directly passed as
|
||||
retrieved from the FADT ACPI table.
|
||||
Values: For possible values see ACPI specification:
|
||||
5.2.9 Fixed ACPI Description Table (FADT)
|
||||
Field: Preferred_PM_Profile
|
||||
|
||||
Currently these values are defined by spec:
|
||||
0 Unspecified
|
||||
1 Desktop
|
||||
2 Mobile
|
||||
3 Workstation
|
||||
4 Enterprise Server
|
||||
5 SOHO Server
|
||||
6 Appliance PC
|
||||
7 Performance Server
|
||||
>7 Reserved
|
|
@ -32,7 +32,7 @@
|
|||
The Linux DRM layer contains code intended to support the needs
|
||||
of complex graphics devices, usually containing programmable
|
||||
pipelines well suited to 3D graphics acceleration. Graphics
|
||||
drivers in the kernel can make use of DRM functions to make
|
||||
drivers in the kernel may make use of DRM functions to make
|
||||
tasks like memory management, interrupt handling and DMA easier,
|
||||
and provide a uniform interface to applications.
|
||||
</para>
|
||||
|
@ -57,10 +57,10 @@
|
|||
existing drivers.
|
||||
</para>
|
||||
<para>
|
||||
First, we'll go over some typical driver initialization
|
||||
First, we go over some typical driver initialization
|
||||
requirements, like setting up command buffers, creating an
|
||||
initial output configuration, and initializing core services.
|
||||
Subsequent sections will cover core internals in more detail,
|
||||
Subsequent sections cover core internals in more detail,
|
||||
providing implementation notes and examples.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -74,7 +74,7 @@
|
|||
</para>
|
||||
<para>
|
||||
The core of every DRM driver is struct drm_driver. Drivers
|
||||
will typically statically initialize a drm_driver structure,
|
||||
typically statically initialize a drm_driver structure,
|
||||
then pass it to drm_init() at load time.
|
||||
</para>
|
||||
|
||||
|
@ -88,8 +88,8 @@
|
|||
</para>
|
||||
<programlisting>
|
||||
static struct drm_driver driver = {
|
||||
/* don't use mtrr's here, the Xserver or user space app should
|
||||
* deal with them for intel hardware.
|
||||
/* Don't use MTRRs here; the Xserver or userspace app should
|
||||
* deal with them for Intel hardware.
|
||||
*/
|
||||
.driver_features =
|
||||
DRIVER_USE_AGP | DRIVER_REQUIRE_AGP |
|
||||
|
@ -154,8 +154,8 @@
|
|||
</programlisting>
|
||||
<para>
|
||||
In the example above, taken from the i915 DRM driver, the driver
|
||||
sets several flags indicating what core features it supports.
|
||||
We'll go over the individual callbacks in later sections. Since
|
||||
sets several flags indicating what core features it supports;
|
||||
we go over the individual callbacks in later sections. Since
|
||||
flags indicate which features your driver supports to the DRM
|
||||
core, you need to set most of them prior to calling drm_init(). Some,
|
||||
like DRIVER_MODESET can be set later based on user supplied parameters,
|
||||
|
@ -203,8 +203,8 @@
|
|||
<term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term>
|
||||
<listitem>
|
||||
<para>
|
||||
DRIVER_HAVE_IRQ indicates whether the driver has a IRQ
|
||||
handler, DRIVER_IRQ_SHARED indicates whether the device &
|
||||
DRIVER_HAVE_IRQ indicates whether the driver has an IRQ
|
||||
handler. DRIVER_IRQ_SHARED indicates whether the device &
|
||||
handler support shared IRQs (note that this is required of
|
||||
PCI drivers).
|
||||
</para>
|
||||
|
@ -214,8 +214,8 @@
|
|||
<term>DRIVER_DMA_QUEUE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
If the driver queues DMA requests and completes them
|
||||
asynchronously, this flag should be set. Deprecated.
|
||||
Should be set if the driver queues DMA requests and completes them
|
||||
asynchronously. Deprecated.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -238,7 +238,7 @@
|
|||
</variablelist>
|
||||
<para>
|
||||
In this specific case, the driver requires AGP and supports
|
||||
IRQs. DMA, as we'll see, is handled by device specific ioctls
|
||||
IRQs. DMA, as discussed later, is handled by device-specific ioctls
|
||||
in this case. It also supports the kernel mode setting APIs, though
|
||||
unlike in the actual i915 driver source, this example unconditionally
|
||||
exports KMS capability.
|
||||
|
@ -269,36 +269,34 @@
|
|||
initial output configuration.
|
||||
</para>
|
||||
<para>
|
||||
Note that the tasks performed at driver load time must not
|
||||
conflict with DRM client requirements. For instance, if user
|
||||
If compatibility is a concern (e.g. with drivers converted over
|
||||
to the new interfaces from the old ones), care must be taken to
|
||||
prevent device initialization and control that is incompatible with
|
||||
currently active userspace drivers. For instance, if user
|
||||
level mode setting drivers are in use, it would be problematic
|
||||
to perform output discovery & configuration at load time.
|
||||
Likewise, if pre-memory management aware user level drivers are
|
||||
Likewise, if user-level drivers unaware of memory management are
|
||||
in use, memory management and command buffer setup may need to
|
||||
be omitted. These requirements are driver specific, and care
|
||||
be omitted. These requirements are driver-specific, and care
|
||||
needs to be taken to keep both old and new applications and
|
||||
libraries working. The i915 driver supports the "modeset"
|
||||
module parameter to control whether advanced features are
|
||||
enabled at load time or in legacy fashion. If compatibility is
|
||||
a concern (e.g. with drivers converted over to the new interfaces
|
||||
from the old ones), care must be taken to prevent incompatible
|
||||
device initialization and control with the currently active
|
||||
userspace drivers.
|
||||
enabled at load time or in legacy fashion.
|
||||
</para>
|
||||
|
||||
<sect2>
|
||||
<title>Driver private & performance counters</title>
|
||||
<para>
|
||||
The driver private hangs off the main drm_device structure and
|
||||
can be used for tracking various device specific bits of
|
||||
can be used for tracking various device-specific bits of
|
||||
information, like register offsets, command buffer status,
|
||||
register state for suspend/resume, etc. At load time, a
|
||||
driver can simply allocate one and set drm_device.dev_priv
|
||||
appropriately; at unload the driver can free it and set
|
||||
drm_device.dev_priv to NULL.
|
||||
driver may simply allocate one and set drm_device.dev_priv
|
||||
appropriately; it should be freed and drm_device.dev_priv set
|
||||
to NULL when the driver is unloaded.
|
||||
</para>
|
||||
<para>
|
||||
The DRM supports several counters which can be used for rough
|
||||
The DRM supports several counters which may be used for rough
|
||||
performance characterization. Note that the DRM stat counter
|
||||
system is not often used by applications, and supporting
|
||||
additional counters is completely optional.
|
||||
|
@ -307,15 +305,15 @@
|
|||
These interfaces are deprecated and should not be used. If performance
|
||||
monitoring is desired, the developer should investigate and
|
||||
potentially enhance the kernel perf and tracing infrastructure to export
|
||||
GPU related performance information to performance monitoring
|
||||
tools and applications.
|
||||
GPU related performance information for consumption by performance
|
||||
monitoring tools and applications.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Configuring the device</title>
|
||||
<para>
|
||||
Obviously, device configuration will be device specific.
|
||||
Obviously, device configuration is device-specific.
|
||||
However, there are several common operations: finding a
|
||||
device's PCI resources, mapping them, and potentially setting
|
||||
up an IRQ handler.
|
||||
|
@ -323,10 +321,10 @@
|
|||
<para>
|
||||
Finding & mapping resources is fairly straightforward. The
|
||||
DRM wrapper functions, drm_get_resource_start() and
|
||||
drm_get_resource_len() can be used to find BARs on the given
|
||||
drm_get_resource_len(), may be used to find BARs on the given
|
||||
drm_device struct. Once those values have been retrieved, the
|
||||
driver load function can call drm_addmap() to create a new
|
||||
mapping for the BAR in question. Note you'll probably want a
|
||||
mapping for the BAR in question. Note that you probably want a
|
||||
drm_local_map_t in your driver private structure to track any
|
||||
mappings you create.
|
||||
<!-- !Fdrivers/gpu/drm/drm_bufs.c drm_get_resource_* -->
|
||||
|
@ -335,20 +333,20 @@
|
|||
<para>
|
||||
if compatibility with other operating systems isn't a concern
|
||||
(DRM drivers can run under various BSD variants and OpenSolaris),
|
||||
native Linux calls can be used for the above, e.g. pci_resource_*
|
||||
native Linux calls may be used for the above, e.g. pci_resource_*
|
||||
and iomap*/iounmap. See the Linux device driver book for more
|
||||
info.
|
||||
</para>
|
||||
<para>
|
||||
Once you have a register map, you can use the DRM_READn() and
|
||||
Once you have a register map, you may use the DRM_READn() and
|
||||
DRM_WRITEn() macros to access the registers on your device, or
|
||||
use driver specific versions to offset into your MMIO space
|
||||
relative to a driver specific base pointer (see I915_READ for
|
||||
example).
|
||||
use driver-specific versions to offset into your MMIO space
|
||||
relative to a driver-specific base pointer (see I915_READ for
|
||||
an example).
|
||||
</para>
|
||||
<para>
|
||||
If your device supports interrupt generation, you may want to
|
||||
setup an interrupt handler at driver load time as well. This
|
||||
set up an interrupt handler when the driver is loaded. This
|
||||
is done using the drm_irq_install() function. If your device
|
||||
supports vertical blank interrupts, it should call
|
||||
drm_vblank_init() to initialize the core vblank handling code before
|
||||
|
@ -357,7 +355,7 @@
|
|||
</para>
|
||||
<!--!Fdrivers/char/drm/drm_irq.c drm_irq_install-->
|
||||
<para>
|
||||
Once your interrupt handler is registered (it'll use your
|
||||
Once your interrupt handler is registered (it uses your
|
||||
drm_driver.irq_handler as the actual interrupt handling
|
||||
function), you can safely enable interrupts on your device,
|
||||
assuming any other state your interrupt handler uses is also
|
||||
|
@ -371,10 +369,10 @@
|
|||
using the pci_map_rom() call, a convenience function that
|
||||
takes care of mapping the actual ROM, whether it has been
|
||||
shadowed into memory (typically at address 0xc0000) or exists
|
||||
on the PCI device in the ROM BAR. Note that once you've
|
||||
mapped the ROM and extracted any necessary information, be
|
||||
sure to unmap it; on many devices the ROM address decoder is
|
||||
shared with other BARs, so leaving it mapped can cause
|
||||
on the PCI device in the ROM BAR. Note that after the ROM
|
||||
has been mapped and any necessary information has been extracted,
|
||||
it should be unmapped; on many devices, the ROM address decoder is
|
||||
shared with other BARs, so leaving it mapped could cause
|
||||
undesired behavior like hangs or memory corruption.
|
||||
<!--!Fdrivers/pci/rom.c pci_map_rom-->
|
||||
</para>
|
||||
|
@ -389,9 +387,9 @@
|
|||
should support a memory manager.
|
||||
</para>
|
||||
<para>
|
||||
If your driver supports memory management (it should!), you'll
|
||||
If your driver supports memory management (it should!), you
|
||||
need to set that up at load time as well. How you initialize
|
||||
it depends on which memory manager you're using, TTM or GEM.
|
||||
it depends on which memory manager you're using: TTM or GEM.
|
||||
</para>
|
||||
<sect3>
|
||||
<title>TTM initialization</title>
|
||||
|
@ -401,7 +399,7 @@
|
|||
and devices with dedicated video RAM (VRAM), i.e. most discrete
|
||||
graphics devices. If your device has dedicated RAM, supporting
|
||||
TTM is desirable. TTM also integrates tightly with your
|
||||
driver specific buffer execution function. See the radeon
|
||||
driver-specific buffer execution function. See the radeon
|
||||
driver for examples.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -429,21 +427,21 @@
|
|||
created by the memory manager at runtime. Your global TTM should
|
||||
have a type of TTM_GLOBAL_TTM_MEM. The size field for the global
|
||||
object should be sizeof(struct ttm_mem_global), and the init and
|
||||
release hooks should point at your driver specific init and
|
||||
release routines, which will probably eventually call
|
||||
ttm_mem_global_init and ttm_mem_global_release respectively.
|
||||
release hooks should point at your driver-specific init and
|
||||
release routines, which probably eventually call
|
||||
ttm_mem_global_init and ttm_mem_global_release, respectively.
|
||||
</para>
|
||||
<para>
|
||||
Once your global TTM accounting structure is set up and initialized
|
||||
(done by calling ttm_global_item_ref on the global object you
|
||||
just created), you'll need to create a buffer object TTM to
|
||||
by calling ttm_global_item_ref() on it,
|
||||
you need to create a buffer object TTM to
|
||||
provide a pool for buffer object allocation by clients and the
|
||||
kernel itself. The type of this object should be TTM_GLOBAL_TTM_BO,
|
||||
and its size should be sizeof(struct ttm_bo_global). Again,
|
||||
driver specific init and release functions can be provided,
|
||||
likely eventually calling ttm_bo_global_init and
|
||||
ttm_bo_global_release, respectively. Also like the previous
|
||||
object, ttm_global_item_ref is used to create an initial reference
|
||||
driver-specific init and release functions may be provided,
|
||||
likely eventually calling ttm_bo_global_init() and
|
||||
ttm_bo_global_release(), respectively. Also, like the previous
|
||||
object, ttm_global_item_ref() is used to create an initial reference
|
||||
count for the TTM, which will call your initialization function.
|
||||
</para>
|
||||
</sect3>
|
||||
|
@ -453,27 +451,26 @@
|
|||
GEM is an alternative to TTM, designed specifically for UMA
|
||||
devices. It has simpler initialization and execution requirements
|
||||
than TTM, but has no VRAM management capability. Core GEM
|
||||
initialization is comprised of a basic drm_mm_init call to create
|
||||
is initialized by calling drm_mm_init() to create
|
||||
a GTT DRM MM object, which provides an address space pool for
|
||||
object allocation. In a KMS configuration, the driver will
|
||||
need to allocate and initialize a command ring buffer following
|
||||
basic GEM initialization. Most UMA devices have a so-called
|
||||
object allocation. In a KMS configuration, the driver
|
||||
needs to allocate and initialize a command ring buffer following
|
||||
core GEM initialization. A UMA device usually has what is called a
|
||||
"stolen" memory region, which provides space for the initial
|
||||
framebuffer and large, contiguous memory regions required by the
|
||||
device. This space is not typically managed by GEM, and must
|
||||
device. This space is not typically managed by GEM, and it must
|
||||
be initialized separately into its own DRM MM object.
|
||||
</para>
|
||||
<para>
|
||||
Initialization will be driver specific, and will depend on
|
||||
the architecture of the device. In the case of Intel
|
||||
Initialization is driver-specific. In the case of Intel
|
||||
integrated graphics chips like 965GM, GEM initialization can
|
||||
be done by calling the internal GEM init function,
|
||||
i915_gem_do_init(). Since the 965GM is a UMA device
|
||||
(i.e. it doesn't have dedicated VRAM), GEM will manage
|
||||
(i.e. it doesn't have dedicated VRAM), GEM manages
|
||||
making regular RAM available for GPU operations. Memory set
|
||||
aside by the BIOS (called "stolen" memory by the i915
|
||||
driver) will be managed by the DRM memrange allocator; the
|
||||
rest of the aperture will be managed by GEM.
|
||||
driver) is managed by the DRM memrange allocator; the
|
||||
rest of the aperture is managed by GEM.
|
||||
<programlisting>
|
||||
/* Basic memrange allocator for stolen space (aka vram) */
|
||||
drm_memrange_init(&dev_priv->vram, 0, prealloc_size);
|
||||
|
@ -483,7 +480,7 @@
|
|||
<!--!Edrivers/char/drm/drm_memrange.c-->
|
||||
</para>
|
||||
<para>
|
||||
Once the memory manager has been set up, we can allocate the
|
||||
Once the memory manager has been set up, we may allocate the
|
||||
command buffer. In the i915 case, this is also done with a
|
||||
GEM function, i915_gem_init_ringbuffer().
|
||||
</para>
|
||||
|
@ -493,16 +490,25 @@
|
|||
<sect2>
|
||||
<title>Output configuration</title>
|
||||
<para>
|
||||
The final initialization task is output configuration. This involves
|
||||
finding and initializing the CRTCs, encoders and connectors
|
||||
for your device, creating an initial configuration and
|
||||
registering a framebuffer console driver.
|
||||
The final initialization task is output configuration. This involves:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
Finding and initializing the CRTCs, encoders, and connectors
|
||||
for the device.
|
||||
</listitem>
|
||||
<listitem>
|
||||
Creating an initial configuration.
|
||||
</listitem>
|
||||
<listitem>
|
||||
Registering a framebuffer console driver.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<sect3>
|
||||
<title>Output discovery and initialization</title>
|
||||
<para>
|
||||
Several core functions exist to create CRTCs, encoders and
|
||||
connectors, namely drm_crtc_init(), drm_connector_init() and
|
||||
Several core functions exist to create CRTCs, encoders, and
|
||||
connectors, namely: drm_crtc_init(), drm_connector_init(), and
|
||||
drm_encoder_init(), along with several "helper" functions to
|
||||
perform common tasks.
|
||||
</para>
|
||||
|
@ -555,10 +561,10 @@ void intel_crt_init(struct drm_device *dev)
|
|||
</programlisting>
|
||||
<para>
|
||||
In the example above (again, taken from the i915 driver), a
|
||||
CRT connector and encoder combination is created. A device
|
||||
specific i2c bus is also created, for fetching EDID data and
|
||||
CRT connector and encoder combination is created. A device-specific
|
||||
i2c bus is also created for fetching EDID data and
|
||||
performing monitor detection. Once the process is complete,
|
||||
the new connector is registered with sysfs, to make its
|
||||
the new connector is registered with sysfs to make its
|
||||
properties available to applications.
|
||||
</para>
|
||||
<sect4>
|
||||
|
@ -567,12 +573,12 @@ void intel_crt_init(struct drm_device *dev)
|
|||
Since many PC-class graphics devices have similar display output
|
||||
designs, the DRM provides a set of helper functions to make
|
||||
output management easier. The core helper routines handle
|
||||
encoder re-routing and disabling of unused functions following
|
||||
mode set. Using the helpers is optional, but recommended for
|
||||
encoder re-routing and the disabling of unused functions following
|
||||
mode setting. Using the helpers is optional, but recommended for
|
||||
devices with PC-style architectures (i.e. a set of display planes
|
||||
for feeding pixels to encoders which are in turn routed to
|
||||
connectors). Devices with more complex requirements needing
|
||||
finer grained management can opt to use the core callbacks
|
||||
finer grained management may opt to use the core callbacks
|
||||
directly.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -580,17 +586,25 @@ void intel_crt_init(struct drm_device *dev)
|
|||
</para>
|
||||
</sect4>
|
||||
<para>
|
||||
For each encoder, CRTC and connector, several functions must
|
||||
be provided, depending on the object type. Encoder objects
|
||||
need to provide a DPMS (basically on/off) function, mode fixup
|
||||
(for converting requested modes into native hardware timings),
|
||||
and prepare, set and commit functions for use by the core DRM
|
||||
helper functions. Connector helpers need to provide mode fetch and
|
||||
validity functions as well as an encoder matching function for
|
||||
returning an ideal encoder for a given connector. The core
|
||||
connector functions include a DPMS callback, (deprecated)
|
||||
save/restore routines, detection, mode probing, property handling,
|
||||
and cleanup functions.
|
||||
Each encoder object needs to provide:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
A DPMS (basically on/off) function.
|
||||
</listitem>
|
||||
<listitem>
|
||||
A mode-fixup function (for converting requested modes into
|
||||
native hardware timings).
|
||||
</listitem>
|
||||
<listitem>
|
||||
Functions (prepare, set, and commit) for use by the core DRM
|
||||
helper functions.
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
Connector helpers need to provide functions (mode-fetch, validity,
|
||||
and encoder-matching) for returning an ideal encoder for a given
|
||||
connector. The core connector functions include a DPMS callback,
|
||||
save/restore routines (deprecated), detection, mode probing,
|
||||
property handling, and cleanup functions.
|
||||
</para>
|
||||
<!--!Edrivers/char/drm/drm_crtc.h-->
|
||||
<!--!Edrivers/char/drm/drm_crtc.c-->
|
||||
|
@ -605,22 +619,33 @@ void intel_crt_init(struct drm_device *dev)
|
|||
<title>VBlank event handling</title>
|
||||
<para>
|
||||
The DRM core exposes two vertical blank related ioctls:
|
||||
DRM_IOCTL_WAIT_VBLANK and DRM_IOCTL_MODESET_CTL.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>DRM_IOCTL_WAIT_VBLANK</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This takes a struct drm_wait_vblank structure as its argument,
|
||||
and it is used to block or request a signal when a specified
|
||||
vblank event occurs.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>DRM_IOCTL_MODESET_CTL</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This should be called by application level drivers before and
|
||||
after mode setting, since on many devices the vertical blank
|
||||
counter is reset at that time. Internally, the DRM snapshots
|
||||
the last vblank count when the ioctl is called with the
|
||||
_DRM_PRE_MODESET command, so that the counter won't go backwards
|
||||
(which is dealt with when _DRM_POST_MODESET is used).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<!--!Edrivers/char/drm/drm_irq.c-->
|
||||
</para>
|
||||
<para>
|
||||
DRM_IOCTL_WAIT_VBLANK takes a struct drm_wait_vblank structure
|
||||
as its argument, and is used to block or request a signal when a
|
||||
specified vblank event occurs.
|
||||
</para>
|
||||
<para>
|
||||
DRM_IOCTL_MODESET_CTL should be called by application level
|
||||
drivers before and after mode setting, since on many devices the
|
||||
vertical blank counter will be reset at that time. Internally,
|
||||
the DRM snapshots the last vblank count when the ioctl is called
|
||||
with the _DRM_PRE_MODESET command so that the counter won't go
|
||||
backwards (which is dealt with when _DRM_POST_MODESET is used).
|
||||
</para>
|
||||
<para>
|
||||
To support the functions above, the DRM core provides several
|
||||
helper functions for tracking vertical blank counters, and
|
||||
|
@ -632,24 +657,24 @@ void intel_crt_init(struct drm_device *dev)
|
|||
register. The enable and disable vblank callbacks should enable
|
||||
and disable vertical blank interrupts, respectively. In the
|
||||
absence of DRM clients waiting on vblank events, the core DRM
|
||||
code will use the disable_vblank() function to disable
|
||||
interrupts, which saves power. They'll be re-enabled again when
|
||||
code uses the disable_vblank() function to disable
|
||||
interrupts, which saves power. They are re-enabled again when
|
||||
a client calls the vblank wait ioctl above.
|
||||
</para>
|
||||
<para>
|
||||
Devices that don't provide a count register can simply use an
|
||||
A device that doesn't provide a count register may simply use an
|
||||
internal atomic counter incremented on every vertical blank
|
||||
interrupt, and can make their enable and disable vblank
|
||||
functions into no-ops.
|
||||
interrupt (and then treat the enable_vblank() and disable_vblank()
|
||||
callbacks as no-ops).
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1>
|
||||
<title>Memory management</title>
|
||||
<para>
|
||||
The memory manager lies at the heart of many DRM operations, and
|
||||
is also required to support advanced client features like OpenGL
|
||||
pbuffers. The DRM currently contains two memory managers, TTM
|
||||
The memory manager lies at the heart of many DRM operations; it
|
||||
is required to support advanced client features like OpenGL
|
||||
pbuffers. The DRM currently contains two memory managers: TTM
|
||||
and GEM.
|
||||
</para>
|
||||
|
||||
|
@ -679,41 +704,46 @@ void intel_crt_init(struct drm_device *dev)
|
|||
<para>
|
||||
GEM-enabled drivers must provide gem_init_object() and
|
||||
gem_free_object() callbacks to support the core memory
|
||||
allocation routines. They should also provide several driver
|
||||
specific ioctls to support command execution, pinning, buffer
|
||||
allocation routines. They should also provide several driver-specific
|
||||
ioctls to support command execution, pinning, buffer
|
||||
read & write, mapping, and domain ownership transfers.
|
||||
</para>
|
||||
<para>
|
||||
On a fundamental level, GEM involves several operations: memory
|
||||
allocation and freeing, command execution, and aperture management
|
||||
at command execution time. Buffer object allocation is relatively
|
||||
On a fundamental level, GEM involves several operations:
|
||||
<itemizedlist>
|
||||
<listitem>Memory allocation and freeing</listitem>
|
||||
<listitem>Command execution</listitem>
|
||||
<listitem>Aperture management at command execution time</listitem>
|
||||
</itemizedlist>
|
||||
Buffer object allocation is relatively
|
||||
straightforward and largely provided by Linux's shmem layer, which
|
||||
provides memory to back each object. When mapped into the GTT
|
||||
or used in a command buffer, the backing pages for an object are
|
||||
flushed to memory and marked write combined so as to be coherent
|
||||
with the GPU. Likewise, when the GPU finishes rendering to an object,
|
||||
if the CPU accesses it, it must be made coherent with the CPU's view
|
||||
with the GPU. Likewise, if the CPU accesses an object after the GPU
|
||||
has finished rendering to the object, then the object must be made
|
||||
coherent with the CPU's view
|
||||
of memory, usually involving GPU cache flushing of various kinds.
|
||||
This core CPU<->GPU coherency management is provided by the GEM
|
||||
set domain function, which evaluates an object's current domain and
|
||||
This core CPU<->GPU coherency management is provided by a
|
||||
device-specific ioctl, which evaluates an object's current domain and
|
||||
performs any necessary flushing or synchronization to put the object
|
||||
into the desired coherency domain (note that the object may be busy,
|
||||
i.e. an active render target; in that case the set domain function
|
||||
will block the client and wait for rendering to complete before
|
||||
i.e. an active render target; in that case, setting the domain
|
||||
blocks the client and waits for rendering to complete before
|
||||
performing any necessary flushing operations).
|
||||
</para>
|
||||
<para>
|
||||
Perhaps the most important GEM function is providing a command
|
||||
execution interface to clients. Client programs construct command
|
||||
buffers containing references to previously allocated memory objects
|
||||
and submit them to GEM. At that point, GEM will take care to bind
|
||||
buffers containing references to previously allocated memory objects,
|
||||
and then submit them to GEM. At that point, GEM takes care to bind
|
||||
all the objects into the GTT, execute the buffer, and provide
|
||||
necessary synchronization between clients accessing the same buffers.
|
||||
This often involves evicting some objects from the GTT and re-binding
|
||||
others (a fairly expensive operation), and providing relocation
|
||||
support which hides fixed GTT offsets from clients. Clients must
|
||||
take care not to submit command buffers that reference more objects
|
||||
than can fit in the GTT or GEM will reject them and no rendering
|
||||
than can fit in the GTT; otherwise, GEM will reject them and no rendering
|
||||
will occur. Similarly, if several objects in the buffer require
|
||||
fence registers to be allocated for correct rendering (e.g. 2D blits
|
||||
on pre-965 chips), care must be taken not to require more fence
|
||||
|
@ -729,7 +759,7 @@ void intel_crt_init(struct drm_device *dev)
|
|||
<title>Output management</title>
|
||||
<para>
|
||||
At the core of the DRM output management code is a set of
|
||||
structures representing CRTCs, encoders and connectors.
|
||||
structures representing CRTCs, encoders, and connectors.
|
||||
</para>
|
||||
<para>
|
||||
A CRTC is an abstraction representing a part of the chip that
|
||||
|
@ -765,21 +795,19 @@ void intel_crt_init(struct drm_device *dev)
|
|||
<sect1>
|
||||
<title>Framebuffer management</title>
|
||||
<para>
|
||||
In order to set a mode on a given CRTC, encoder and connector
|
||||
configuration, clients need to provide a framebuffer object which
|
||||
will provide a source of pixels for the CRTC to deliver to the encoder(s)
|
||||
and ultimately the connector(s) in the configuration. A framebuffer
|
||||
is fundamentally a driver specific memory object, made into an opaque
|
||||
handle by the DRM addfb function. Once an fb has been created this
|
||||
way it can be passed to the KMS mode setting routines for use in
|
||||
a configuration.
|
||||
Clients need to provide a framebuffer object which provides a source
|
||||
of pixels for a CRTC to deliver to the encoder(s) and ultimately the
|
||||
connector(s). A framebuffer is fundamentally a driver-specific memory
|
||||
object, made into an opaque handle by the DRM's addfb() function.
|
||||
Once a framebuffer has been created this way, it may be passed to the
|
||||
KMS mode setting routines for use in a completed configuration.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1>
|
||||
<title>Command submission & fencing</title>
|
||||
<para>
|
||||
This should cover a few device specific command submission
|
||||
This should cover a few device-specific command submission
|
||||
implementations.
|
||||
</para>
|
||||
</sect1>
|
||||
|
@ -789,7 +817,7 @@ void intel_crt_init(struct drm_device *dev)
|
|||
<para>
|
||||
The DRM core provides some suspend/resume code, but drivers
|
||||
wanting full suspend/resume support should provide save() and
|
||||
restore() functions. These will be called at suspend,
|
||||
restore() functions. These are called at suspend,
|
||||
hibernate, or resume time, and should perform any state save or
|
||||
restore required by your device across suspend or hibernate
|
||||
states.
|
||||
|
@ -812,8 +840,8 @@ void intel_crt_init(struct drm_device *dev)
|
|||
<para>
|
||||
The DRM core exports several interfaces to applications,
|
||||
generally intended to be used through corresponding libdrm
|
||||
wrapper functions. In addition, drivers export device specific
|
||||
interfaces for use by userspace drivers & device aware
|
||||
wrapper functions. In addition, drivers export device-specific
|
||||
interfaces for use by userspace drivers & device-aware
|
||||
applications through ioctls and sysfs files.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -822,8 +850,8 @@ void intel_crt_init(struct drm_device *dev)
|
|||
management, memory management, and output management.
|
||||
</para>
|
||||
<para>
|
||||
Cover generic ioctls and sysfs layout here. Only need high
|
||||
level info, since man pages will cover the rest.
|
||||
Cover generic ioctls and sysfs layout here. We only need high-level
|
||||
info, since man pages should cover the rest.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
|
|
|
@ -572,7 +572,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
|
|||
</para>
|
||||
<para>
|
||||
The simplest way to activate the FLASH based bad block table support
|
||||
is to set the option NAND_USE_FLASH_BBT in the option field of
|
||||
is to set the option NAND_BBT_USE_FLASH in the bbt_option field of
|
||||
the nand chip structure before calling nand_scan(). For AG-AND
|
||||
chips is this done by default.
|
||||
This activates the default FLASH based bad block table functionality
|
||||
|
@ -773,20 +773,6 @@ struct nand_oobinfo {
|
|||
done according to the default builtin scheme.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="User_space_placement_selection">
|
||||
<title>User space placement selection</title>
|
||||
<para>
|
||||
All non ecc functions like mtd->read and mtd->write use an internal
|
||||
structure, which can be set by an ioctl. This structure is preset
|
||||
to the autoplacement default.
|
||||
<programlisting>
|
||||
ioctl (fd, MEMSETOOBSEL, oobsel);
|
||||
</programlisting>
|
||||
oobsel is a pointer to a user supplied structure of type
|
||||
nand_oobconfig. The contents of this structure must match the
|
||||
criteria of the filesystem, which will be used. See an example in utils/nandwrite.c.
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<sect1 id="Spare_area_autoplacement_default">
|
||||
<title>Spare area autoplacement default schemes</title>
|
||||
|
@ -1158,9 +1144,6 @@ in this page</entry>
|
|||
These constants are defined in nand.h. They are ored together to describe
|
||||
the functionality.
|
||||
<programlisting>
|
||||
/* Use a flash based bad block table. This option is parsed by the
|
||||
* default bad block table function (nand_default_bbt). */
|
||||
#define NAND_USE_FLASH_BBT 0x00010000
|
||||
/* The hw ecc generator provides a syndrome instead a ecc value on read
|
||||
* This can only work if we have the ecc bytes directly behind the
|
||||
* data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
|
||||
|
|
|
@ -33,9 +33,9 @@ demonstrate this problem using nested bash shells:
|
|||
|
||||
From a second, unrelated bash shell:
|
||||
$ kill -SIGSTOP 16690
|
||||
$ kill -SIGCONT 16990
|
||||
$ kill -SIGCONT 16690
|
||||
|
||||
<at this point 16990 exits and causes 16644 to exit too>
|
||||
<at this point 16690 exits and causes 16644 to exit too>
|
||||
|
||||
This happens because bash can observe both signals and choose how it
|
||||
responds to them.
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
* Atmel Data Flash
|
||||
|
||||
Required properties:
|
||||
- compatible : "atmel,<model>", "atmel,<series>", "atmel,dataflash".
|
||||
|
||||
Example:
|
||||
|
||||
flash@1 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
|
||||
spi-max-frequency = <25000000>;
|
||||
reg = <1>;
|
||||
};
|
|
@ -349,6 +349,7 @@ STAC92HD83*
|
|||
ref Reference board
|
||||
mic-ref Reference board with power management for ports
|
||||
dell-s14 Dell laptop
|
||||
dell-vostro-3500 Dell Vostro 3500 laptop
|
||||
hp HP laptops with (inverted) mute-LED
|
||||
hp-dv7-4000 HP dv-7 4000
|
||||
auto BIOS setup (default)
|
||||
|
|
2
Kbuild
2
Kbuild
|
@ -92,7 +92,7 @@ always += missing-syscalls
|
|||
targets += missing-syscalls
|
||||
|
||||
quiet_cmd_syscalls = CALL $<
|
||||
cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags)
|
||||
cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
|
||||
|
||||
missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
|
||||
$(call cmd,syscalls)
|
||||
|
|
15
MAINTAINERS
15
MAINTAINERS
|
@ -1032,6 +1032,7 @@ F: arch/arm/include/asm/hardware/ioc.h
|
|||
F: arch/arm/include/asm/hardware/iomd.h
|
||||
F: arch/arm/include/asm/hardware/memc.h
|
||||
F: arch/arm/mach-rpc/
|
||||
F: drivers/net/ethernet/8390/etherh.c
|
||||
F: drivers/net/ethernet/i825xx/ether1*
|
||||
F: drivers/net/ethernet/seeq/ether3*
|
||||
F: drivers/scsi/arm/
|
||||
|
@ -1105,6 +1106,7 @@ F: drivers/media/video/s5p-fimc/
|
|||
ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT
|
||||
M: Kyungmin Park <kyungmin.park@samsung.com>
|
||||
M: Kamil Debski <k.debski@samsung.com>
|
||||
M: Jeongtae Park <jtp.park@samsung.com>
|
||||
L: linux-arm-kernel@lists.infradead.org
|
||||
L: linux-media@vger.kernel.org
|
||||
S: Maintained
|
||||
|
@ -2341,6 +2343,13 @@ S: Supported
|
|||
F: drivers/gpu/drm/i915
|
||||
F: include/drm/i915*
|
||||
|
||||
DRM DRIVERS FOR EXYNOS
|
||||
M: Inki Dae <inki.dae@samsung.com>
|
||||
L: dri-devel@lists.freedesktop.org
|
||||
S: Supported
|
||||
F: drivers/gpu/drm/exynos
|
||||
F: include/drm/exynos*
|
||||
|
||||
DSCC4 DRIVER
|
||||
M: Francois Romieu <romieu@fr.zoreil.com>
|
||||
L: netdev@vger.kernel.org
|
||||
|
@ -4672,7 +4681,7 @@ L: linux-omap@vger.kernel.org
|
|||
W: http://www.muru.com/linux/omap/
|
||||
W: http://linux.omap.com/
|
||||
Q: http://patchwork.kernel.org/project/linux-omap/list/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
|
||||
S: Maintained
|
||||
F: arch/arm/*omap*/
|
||||
|
||||
|
@ -5470,7 +5479,7 @@ S: Maintained
|
|||
F: drivers/net/ethernet/rdc/r6040.c
|
||||
|
||||
RDS - RELIABLE DATAGRAM SOCKETS
|
||||
M: Andy Grover <andy.grover@oracle.com>
|
||||
M: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
|
||||
L: rds-devel@oss.oracle.com (moderated for non-subscribers)
|
||||
S: Supported
|
||||
F: net/rds/
|
||||
|
@ -6121,7 +6130,7 @@ F: sound/
|
|||
SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
|
||||
M: Liam Girdwood <lrg@ti.com>
|
||||
M: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
|
||||
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
|
||||
W: http://alsa-project.org/main/index.php/ASoC
|
||||
S: Supported
|
||||
|
|
6
Makefile
6
Makefile
|
@ -1,8 +1,8 @@
|
|||
VERSION = 3
|
||||
PATCHLEVEL = 1
|
||||
PATCHLEVEL = 2
|
||||
SUBLEVEL = 0
|
||||
EXTRAVERSION =
|
||||
NAME = "Divemaster Edition"
|
||||
EXTRAVERSION = -rc2
|
||||
NAME = Saber-toothed Squirrel
|
||||
|
||||
# *DOCUMENTATION*
|
||||
# To see a list of typical targets execute "make help"
|
||||
|
|
|
@ -22,11 +22,10 @@ serial@70006300 {
|
|||
sdhci@c8000400 {
|
||||
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
|
||||
wp-gpios = <&gpio 57 0>; /* gpio PH1 */
|
||||
power-gpios = <&gpio 155 0>; /* gpio PT3 */
|
||||
power-gpios = <&gpio 70 0>; /* gpio PI6 */
|
||||
};
|
||||
|
||||
sdhci@c8000600 {
|
||||
power-gpios = <&gpio 70 0>; /* gpio PI6 */
|
||||
support-8bit;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -137,7 +137,7 @@ static struct clk pwm_clk = {
|
|||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
static struct clk macb_clk = {
|
||||
.name = "macb_clk",
|
||||
.name = "pclk",
|
||||
.pmc_mask = 1 << AT91CAP9_ID_EMAC,
|
||||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
|
@ -210,6 +210,8 @@ static struct clk *periph_clocks[] __initdata = {
|
|||
};
|
||||
|
||||
static struct clk_lookup periph_clocks_lookups[] = {
|
||||
/* One additional fake clock for macb_hclk */
|
||||
CLKDEV_CON_ID("hclk", &macb_clk),
|
||||
CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
|
||||
CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
|
||||
CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
|
||||
|
|
|
@ -98,7 +98,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
|
|||
* USB HS Device (Gadget)
|
||||
* -------------------------------------------------------------------- */
|
||||
|
||||
#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
|
||||
#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
|
||||
|
||||
static struct resource usba_udc_resources[] = {
|
||||
[0] = {
|
||||
|
@ -200,7 +200,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
|
|||
|
||||
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
|
||||
static u64 eth_dmamask = DMA_BIT_MASK(32);
|
||||
static struct at91_eth_data eth_data;
|
||||
static struct macb_platform_data eth_data;
|
||||
|
||||
static struct resource eth_resources[] = {
|
||||
[0] = {
|
||||
|
@ -227,7 +227,7 @@ static struct platform_device at91cap9_eth_device = {
|
|||
.num_resources = ARRAY_SIZE(eth_resources),
|
||||
};
|
||||
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data)
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data)
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
@ -264,7 +264,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
|
|||
platform_device_register(&at91cap9_eth_device);
|
||||
}
|
||||
#else
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data) {}
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data) {}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1021,8 +1021,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
|
|||
#if defined(CONFIG_SERIAL_ATMEL)
|
||||
static struct resource dbgu_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91_VA_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.start = AT91_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
|
@ -1035,7 +1035,6 @@ static struct resource dbgu_resources[] = {
|
|||
static struct atmel_uart_data dbgu_data = {
|
||||
.use_dma_tx = 0,
|
||||
.use_dma_rx = 0, /* DBGU not capable of receive DMA */
|
||||
.regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
|
||||
};
|
||||
|
||||
static u64 dbgu_dmamask = DMA_BIT_MASK(32);
|
||||
|
|
|
@ -135,7 +135,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
|
|||
|
||||
#if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
|
||||
static u64 eth_dmamask = DMA_BIT_MASK(32);
|
||||
static struct at91_eth_data eth_data;
|
||||
static struct macb_platform_data eth_data;
|
||||
|
||||
static struct resource eth_resources[] = {
|
||||
[0] = {
|
||||
|
@ -162,7 +162,7 @@ static struct platform_device at91rm9200_eth_device = {
|
|||
.num_resources = ARRAY_SIZE(eth_resources),
|
||||
};
|
||||
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data)
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data)
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
@ -199,7 +199,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
|
|||
platform_device_register(&at91rm9200_eth_device);
|
||||
}
|
||||
#else
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data) {}
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data) {}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -877,8 +877,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
|
|||
#if defined(CONFIG_SERIAL_ATMEL)
|
||||
static struct resource dbgu_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91_VA_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.start = AT91_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
|
@ -891,7 +891,6 @@ static struct resource dbgu_resources[] = {
|
|||
static struct atmel_uart_data dbgu_data = {
|
||||
.use_dma_tx = 0,
|
||||
.use_dma_rx = 0, /* DBGU not capable of receive DMA */
|
||||
.regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
|
||||
};
|
||||
|
||||
static u64 dbgu_dmamask = DMA_BIT_MASK(32);
|
||||
|
|
|
@ -120,7 +120,7 @@ static struct clk ohci_clk = {
|
|||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
static struct clk macb_clk = {
|
||||
.name = "macb_clk",
|
||||
.name = "pclk",
|
||||
.pmc_mask = 1 << AT91SAM9260_ID_EMAC,
|
||||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
|
@ -190,6 +190,8 @@ static struct clk *periph_clocks[] __initdata = {
|
|||
};
|
||||
|
||||
static struct clk_lookup periph_clocks_lookups[] = {
|
||||
/* One additional fake clock for macb_hclk */
|
||||
CLKDEV_CON_ID("hclk", &macb_clk),
|
||||
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
|
||||
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
|
||||
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
|
||||
|
|
|
@ -136,7 +136,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
|
|||
|
||||
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
|
||||
static u64 eth_dmamask = DMA_BIT_MASK(32);
|
||||
static struct at91_eth_data eth_data;
|
||||
static struct macb_platform_data eth_data;
|
||||
|
||||
static struct resource eth_resources[] = {
|
||||
[0] = {
|
||||
|
@ -163,7 +163,7 @@ static struct platform_device at91sam9260_eth_device = {
|
|||
.num_resources = ARRAY_SIZE(eth_resources),
|
||||
};
|
||||
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data)
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data)
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
@ -200,7 +200,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
|
|||
platform_device_register(&at91sam9260_eth_device);
|
||||
}
|
||||
#else
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data) {}
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data) {}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -837,8 +837,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
|
|||
#if defined(CONFIG_SERIAL_ATMEL)
|
||||
static struct resource dbgu_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91_VA_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.start = AT91_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
|
@ -851,7 +851,6 @@ static struct resource dbgu_resources[] = {
|
|||
static struct atmel_uart_data dbgu_data = {
|
||||
.use_dma_tx = 0,
|
||||
.use_dma_rx = 0, /* DBGU not capable of receive DMA */
|
||||
.regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
|
||||
};
|
||||
|
||||
static u64 dbgu_dmamask = DMA_BIT_MASK(32);
|
||||
|
|
|
@ -816,8 +816,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
|
|||
#if defined(CONFIG_SERIAL_ATMEL)
|
||||
static struct resource dbgu_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91_VA_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.start = AT91_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
|
@ -830,7 +830,6 @@ static struct resource dbgu_resources[] = {
|
|||
static struct atmel_uart_data dbgu_data = {
|
||||
.use_dma_tx = 0,
|
||||
.use_dma_rx = 0, /* DBGU not capable of receive DMA */
|
||||
.regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
|
||||
};
|
||||
|
||||
static u64 dbgu_dmamask = DMA_BIT_MASK(32);
|
||||
|
|
|
@ -118,7 +118,7 @@ static struct clk pwm_clk = {
|
|||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
static struct clk macb_clk = {
|
||||
.name = "macb_clk",
|
||||
.name = "pclk",
|
||||
.pmc_mask = 1 << AT91SAM9263_ID_EMAC,
|
||||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
|
@ -182,6 +182,8 @@ static struct clk *periph_clocks[] __initdata = {
|
|||
};
|
||||
|
||||
static struct clk_lookup periph_clocks_lookups[] = {
|
||||
/* One additional fake clock for macb_hclk */
|
||||
CLKDEV_CON_ID("hclk", &macb_clk),
|
||||
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
|
||||
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
|
||||
CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
|
||||
|
|
|
@ -144,7 +144,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
|
|||
|
||||
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
|
||||
static u64 eth_dmamask = DMA_BIT_MASK(32);
|
||||
static struct at91_eth_data eth_data;
|
||||
static struct macb_platform_data eth_data;
|
||||
|
||||
static struct resource eth_resources[] = {
|
||||
[0] = {
|
||||
|
@ -171,7 +171,7 @@ static struct platform_device at91sam9263_eth_device = {
|
|||
.num_resources = ARRAY_SIZE(eth_resources),
|
||||
};
|
||||
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data)
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data)
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
@ -208,7 +208,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
|
|||
platform_device_register(&at91sam9263_eth_device);
|
||||
}
|
||||
#else
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data) {}
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data) {}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1196,8 +1196,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
|
|||
|
||||
static struct resource dbgu_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91_VA_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.start = AT91_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
|
@ -1210,7 +1210,6 @@ static struct resource dbgu_resources[] = {
|
|||
static struct atmel_uart_data dbgu_data = {
|
||||
.use_dma_tx = 0,
|
||||
.use_dma_rx = 0, /* DBGU not capable of receive DMA */
|
||||
.regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
|
||||
};
|
||||
|
||||
static u64 dbgu_dmamask = DMA_BIT_MASK(32);
|
||||
|
|
|
@ -150,7 +150,7 @@ static struct clk ac97_clk = {
|
|||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
static struct clk macb_clk = {
|
||||
.name = "macb_clk",
|
||||
.name = "pclk",
|
||||
.pmc_mask = 1 << AT91SAM9G45_ID_EMAC,
|
||||
.type = CLK_TYPE_PERIPHERAL,
|
||||
};
|
||||
|
@ -209,6 +209,8 @@ static struct clk *periph_clocks[] __initdata = {
|
|||
};
|
||||
|
||||
static struct clk_lookup periph_clocks_lookups[] = {
|
||||
/* One additional fake clock for macb_hclk */
|
||||
CLKDEV_CON_ID("hclk", &macb_clk),
|
||||
/* One additional fake clock for ohci */
|
||||
CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
|
||||
CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
|
||||
|
|
|
@ -197,7 +197,7 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data) {}
|
|||
* USB HS Device (Gadget)
|
||||
* -------------------------------------------------------------------- */
|
||||
|
||||
#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
|
||||
#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
|
||||
static struct resource usba_udc_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91SAM9G45_UDPHS_FIFO,
|
||||
|
@ -284,7 +284,7 @@ void __init at91_add_device_usba(struct usba_platform_data *data) {}
|
|||
|
||||
#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
|
||||
static u64 eth_dmamask = DMA_BIT_MASK(32);
|
||||
static struct at91_eth_data eth_data;
|
||||
static struct macb_platform_data eth_data;
|
||||
|
||||
static struct resource eth_resources[] = {
|
||||
[0] = {
|
||||
|
@ -311,7 +311,7 @@ static struct platform_device at91sam9g45_eth_device = {
|
|||
.num_resources = ARRAY_SIZE(eth_resources),
|
||||
};
|
||||
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data)
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data)
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
@ -348,7 +348,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data)
|
|||
platform_device_register(&at91sam9g45_eth_device);
|
||||
}
|
||||
#else
|
||||
void __init at91_add_device_eth(struct at91_eth_data *data) {}
|
||||
void __init at91_add_device_eth(struct macb_platform_data *data) {}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1332,8 +1332,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
|
|||
#if defined(CONFIG_SERIAL_ATMEL)
|
||||
static struct resource dbgu_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91_VA_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.start = AT91_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
|
@ -1346,7 +1346,6 @@ static struct resource dbgu_resources[] = {
|
|||
static struct atmel_uart_data dbgu_data = {
|
||||
.use_dma_tx = 0,
|
||||
.use_dma_rx = 0,
|
||||
.regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
|
||||
};
|
||||
|
||||
static u64 dbgu_dmamask = DMA_BIT_MASK(32);
|
||||
|
|
|
@ -75,7 +75,7 @@ void __init at91_add_device_hdmac(void) {}
|
|||
* USB HS Device (Gadget)
|
||||
* -------------------------------------------------------------------- */
|
||||
|
||||
#if defined(CONFIG_USB_GADGET_ATMEL_USBA) || defined(CONFIG_USB_GADGET_ATMEL_USBA_MODULE)
|
||||
#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
|
||||
|
||||
static struct resource usba_udc_resources[] = {
|
||||
[0] = {
|
||||
|
@ -908,8 +908,8 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
|
|||
#if defined(CONFIG_SERIAL_ATMEL)
|
||||
static struct resource dbgu_resources[] = {
|
||||
[0] = {
|
||||
.start = AT91_VA_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.start = AT91_BASE_SYS + AT91_DBGU,
|
||||
.end = AT91_BASE_SYS + AT91_DBGU + SZ_512 - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
|
@ -922,7 +922,6 @@ static struct resource dbgu_resources[] = {
|
|||
static struct atmel_uart_data dbgu_data = {
|
||||
.use_dma_tx = 0,
|
||||
.use_dma_rx = 0, /* DBGU not capable of receive DMA */
|
||||
.regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
|
||||
};
|
||||
|
||||
static u64 dbgu_dmamask = DMA_BIT_MASK(32);
|
||||
|
|
|
@ -63,7 +63,7 @@ static void __init onearm_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata onearm_eth_data = {
|
||||
static struct macb_platform_data __initdata onearm_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -103,7 +103,7 @@ static struct spi_board_info afeb9260_spi_devices[] = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata afeb9260_macb_data = {
|
||||
static struct macb_platform_data __initdata afeb9260_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA9,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
@ -130,19 +130,14 @@ static struct mtd_partition __initdata afeb9260_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(afeb9260_nand_partition);
|
||||
return afeb9260_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata afeb9260_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
.rdy_pin = AT91_PIN_PC13,
|
||||
.enable_pin = AT91_PIN_PC14,
|
||||
.partition_info = nand_partitions,
|
||||
.bus_width_16 = 0,
|
||||
.parts = afeb9260_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(afeb9260_nand_partition),
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ static struct spi_board_info cam60_spi_devices[] __initdata = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct __initdata at91_eth_data cam60_macb_data = {
|
||||
static struct __initdata macb_platform_data cam60_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PB5,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
@ -132,19 +132,14 @@ static struct mtd_partition __initdata cam60_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(cam60_nand_partition);
|
||||
return cam60_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata cam60_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not there
|
||||
.rdy_pin = AT91_PIN_PA9,
|
||||
.enable_pin = AT91_PIN_PA7,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = cam60_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(cam60_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata cam60_nand_smc_config = {
|
||||
|
|
|
@ -153,7 +153,7 @@ static struct at91_mmc_data __initdata cap9adk_mmc_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata cap9adk_macb_data = {
|
||||
static struct macb_platform_data __initdata cap9adk_macb_data = {
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
||||
|
@ -169,19 +169,14 @@ static struct mtd_partition __initdata cap9adk_nand_partitions[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(cap9adk_nand_partitions);
|
||||
return cap9adk_nand_partitions;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata cap9adk_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not connected
|
||||
// .rdy_pin = ... not connected
|
||||
.enable_pin = AT91_PIN_PD15,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = cap9adk_nand_partitions,
|
||||
.num_parts = ARRAY_SIZE(cap9adk_nand_partitions),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata cap9adk_nand_smc_config = {
|
||||
|
|
|
@ -57,7 +57,7 @@ static void __init carmeva_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata carmeva_eth_data = {
|
||||
static struct macb_platform_data __initdata carmeva_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -99,7 +99,7 @@ static struct at91_udc_data __initdata cpu9krea_udc_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata cpu9krea_macb_data = {
|
||||
static struct macb_platform_data __initdata cpu9krea_macb_data = {
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ static void __init cpuat91_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata cpuat91_eth_data = {
|
||||
static struct macb_platform_data __initdata cpuat91_eth_data = {
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ static void __init csb337_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata csb337_eth_data = {
|
||||
static struct macb_platform_data __initdata csb337_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC2,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
|
|
@ -52,7 +52,7 @@ static void __init csb637_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata csb637_eth_data = {
|
||||
static struct macb_platform_data __initdata csb637_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC0,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
|
|
@ -60,7 +60,7 @@ static void __init eb9200_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata eb9200_eth_data = {
|
||||
static struct macb_platform_data __initdata eb9200_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -64,7 +64,7 @@ static void __init ecb_at91init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata ecb_at91eth_data = {
|
||||
static struct macb_platform_data __initdata ecb_at91eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
|
|
@ -47,7 +47,7 @@ static void __init eco920_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata eco920_eth_data = {
|
||||
static struct macb_platform_data __initdata eco920_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC2,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -135,7 +135,7 @@ static struct spi_board_info foxg20_spi_devices[] = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata foxg20_macb_data = {
|
||||
static struct macb_platform_data __initdata foxg20_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA7,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -93,7 +93,7 @@ static struct at91_udc_data __initdata udc_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata macb_data = {
|
||||
static struct macb_platform_data __initdata macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA28,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -61,7 +61,7 @@ static void __init kafa_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata kafa_eth_data = {
|
||||
static struct macb_platform_data __initdata kafa_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
|
|
@ -69,7 +69,7 @@ static void __init kb9202_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata kb9202_eth_data = {
|
||||
static struct macb_platform_data __initdata kb9202_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PB29,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
@ -97,19 +97,14 @@ static struct mtd_partition __initdata kb9202_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(kb9202_nand_partition);
|
||||
return kb9202_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata kb9202_nand_data = {
|
||||
.ale = 22,
|
||||
.cle = 21,
|
||||
// .det_pin = ... not there
|
||||
.rdy_pin = AT91_PIN_PC29,
|
||||
.enable_pin = AT91_PIN_PC28,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = kb9202_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(kb9202_nand_partition),
|
||||
};
|
||||
|
||||
static void __init kb9202_board_init(void)
|
||||
|
|
|
@ -155,7 +155,7 @@ static struct at91_mmc_data __initdata neocore926_mmc_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata neocore926_macb_data = {
|
||||
static struct macb_platform_data __initdata neocore926_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PE31,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -182,19 +182,14 @@ static struct mtd_partition __initdata neocore926_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(neocore926_nand_partition);
|
||||
return neocore926_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata neocore926_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
.rdy_pin = AT91_PIN_PB19,
|
||||
.rdy_pin_active_low = 1,
|
||||
.enable_pin = AT91_PIN_PD15,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = neocore926_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(neocore926_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata neocore926_nand_smc_config = {
|
||||
|
|
|
@ -122,7 +122,7 @@ static struct at91_udc_data __initdata pcontrol_g20_udc_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata macb_data = {
|
||||
static struct macb_platform_data __initdata macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA28,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -60,7 +60,7 @@ static void __init picotux200_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata picotux200_eth_data = {
|
||||
static struct macb_platform_data __initdata picotux200_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -104,7 +104,7 @@ static struct spi_board_info ek_spi_devices[] = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata ek_macb_data = {
|
||||
static struct macb_platform_data __initdata ek_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA31,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -130,19 +130,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PC13,
|
||||
.enable_pin = AT91_PIN_PC14,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -65,7 +65,7 @@ static void __init dk_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata dk_eth_data = {
|
||||
static struct macb_platform_data __initdata dk_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -138,19 +138,14 @@ static struct mtd_partition __initdata dk_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(dk_nand_partition);
|
||||
return dk_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata dk_nand_data = {
|
||||
.ale = 22,
|
||||
.cle = 21,
|
||||
.det_pin = AT91_PIN_PB1,
|
||||
.rdy_pin = AT91_PIN_PC2,
|
||||
// .enable_pin = ... not there
|
||||
.partition_info = nand_partitions,
|
||||
.parts = dk_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(dk_nand_partition),
|
||||
};
|
||||
|
||||
#define DK_FLASH_BASE AT91_CHIPSELECT_0
|
||||
|
|
|
@ -65,7 +65,7 @@ static void __init ek_init_early(void)
|
|||
at91_set_serial_console(0);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata ek_eth_data = {
|
||||
static struct macb_platform_data __initdata ek_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -60,7 +60,7 @@ static void __init rsi_ews_init_early(void)
|
|||
/*
|
||||
* Ethernet
|
||||
*/
|
||||
static struct at91_eth_data rsi_ews_eth_data __initdata = {
|
||||
static struct macb_platform_data rsi_ews_eth_data __initdata = {
|
||||
.phy_irq_pin = AT91_PIN_PC4,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -109,7 +109,7 @@ static struct spi_board_info ek_spi_devices[] = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata ek_macb_data = {
|
||||
static struct macb_platform_data __initdata ek_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA7,
|
||||
.is_rmii = 0,
|
||||
};
|
||||
|
@ -131,19 +131,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PC13,
|
||||
.enable_pin = AT91_PIN_PC14,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -151,7 +151,7 @@ static struct spi_board_info ek_spi_devices[] = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata ek_macb_data = {
|
||||
static struct macb_platform_data __initdata ek_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA7,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -173,19 +173,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PC13,
|
||||
.enable_pin = AT91_PIN_PC14,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -179,19 +179,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 22,
|
||||
.cle = 21,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PC15,
|
||||
.enable_pin = AT91_PIN_PC14,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -158,7 +158,7 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata ek_macb_data = {
|
||||
static struct macb_platform_data __initdata ek_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PE31,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -180,19 +180,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PA22,
|
||||
.enable_pin = AT91_PIN_PD15,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -123,7 +123,7 @@ static struct spi_board_info ek_spi_devices[] = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata ek_macb_data = {
|
||||
static struct macb_platform_data __initdata ek_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA7,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -157,19 +157,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
/* det_pin is not connected */
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
.rdy_pin = AT91_PIN_PC13,
|
||||
.enable_pin = AT91_PIN_PC14,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -115,7 +115,7 @@ static struct mci_platform_data __initdata mci1_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata ek_macb_data = {
|
||||
static struct macb_platform_data __initdata ek_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PD5,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -137,19 +137,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
/* det_pin is not connected */
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
.rdy_pin = AT91_PIN_PC8,
|
||||
.enable_pin = AT91_PIN_PC14,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -88,19 +88,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PD17,
|
||||
.enable_pin = AT91_PIN_PB6,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata ek_nand_smc_config = {
|
||||
|
|
|
@ -65,7 +65,7 @@ static struct at91_udc_data __initdata snapper9260_udc_data = {
|
|||
.vbus_polled = 1,
|
||||
};
|
||||
|
||||
static struct at91_eth_data snapper9260_macb_data = {
|
||||
static struct macb_platform_data snapper9260_macb_data = {
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
||||
|
@ -97,18 +97,12 @@ static struct mtd_partition __initdata snapper9260_nand_partitions[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init
|
||||
snapper9260_nand_partition_info(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(snapper9260_nand_partitions);
|
||||
return snapper9260_nand_partitions;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata snapper9260_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
.rdy_pin = AT91_PIN_PC13,
|
||||
.partition_info = snapper9260_nand_partition_info,
|
||||
.parts = snapper9260_nand_partitions,
|
||||
.num_parts = ARRAY_SIZE(snapper9260_nand_partitions),
|
||||
.bus_width_16 = 0,
|
||||
};
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ static struct at91_udc_data __initdata stamp9g20evb_udc_data = {
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata macb_data = {
|
||||
static struct macb_platform_data __initdata macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PA28,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
|
|
@ -146,7 +146,7 @@ static void __init ek_add_device_spi(void)
|
|||
/*
|
||||
* MACB Ethernet device
|
||||
*/
|
||||
static struct at91_eth_data __initdata ek_macb_data = {
|
||||
static struct macb_platform_data __initdata ek_macb_data = {
|
||||
.phy_irq_pin = AT91_PIN_PE31,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -190,19 +190,14 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
|
|||
}
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(ek_nand_partition);
|
||||
return ek_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata ek_nand_data = {
|
||||
.ale = 21,
|
||||
.cle = 22,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PA22,
|
||||
.enable_pin = AT91_PIN_PD15,
|
||||
.partition_info = nand_partitions,
|
||||
.parts = ek_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(ek_nand_partition),
|
||||
};
|
||||
|
||||
static struct sam9_smc_config __initdata usb_a9260_nand_smc_config = {
|
||||
|
|
|
@ -110,7 +110,7 @@ static struct gpio_led yl9200_leds[] = {
|
|||
/*
|
||||
* Ethernet
|
||||
*/
|
||||
static struct at91_eth_data __initdata yl9200_eth_data = {
|
||||
static struct macb_platform_data __initdata yl9200_eth_data = {
|
||||
.phy_irq_pin = AT91_PIN_PB28,
|
||||
.is_rmii = 1,
|
||||
};
|
||||
|
@ -172,19 +172,14 @@ static struct mtd_partition __initdata yl9200_nand_partition[] = {
|
|||
}
|
||||
};
|
||||
|
||||
static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
|
||||
{
|
||||
*num_partitions = ARRAY_SIZE(yl9200_nand_partition);
|
||||
return yl9200_nand_partition;
|
||||
}
|
||||
|
||||
static struct atmel_nand_data __initdata yl9200_nand_data = {
|
||||
.ale = 6,
|
||||
.cle = 7,
|
||||
// .det_pin = ... not connected
|
||||
.rdy_pin = AT91_PIN_PC14, /* R/!B (Sheet10) */
|
||||
.enable_pin = AT91_PIN_PC15, /* !CE (Sheet10) */
|
||||
.partition_info = nand_partitions,
|
||||
.parts = yl9200_nand_partition,
|
||||
.num_parts = ARRAY_SIZE(yl9200_nand_partition),
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -389,7 +384,7 @@ static struct spi_board_info yl9200_spi_devices[] = {
|
|||
#include <video/s1d13xxxfb.h>
|
||||
|
||||
|
||||
static void __init yl9200_init_video(void)
|
||||
static void yl9200_init_video(void)
|
||||
{
|
||||
/* NWAIT Signal */
|
||||
at91_set_A_periph(AT91_PIN_PC6, 0);
|
||||
|
|
|
@ -34,7 +34,8 @@ static struct cpuidle_driver at91_idle_driver = {
|
|||
|
||||
/* Actual code that puts the SoC in different idle states */
|
||||
static int at91_enter_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state)
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
struct timeval before, after;
|
||||
int idle_time;
|
||||
|
@ -42,10 +43,10 @@ static int at91_enter_idle(struct cpuidle_device *dev,
|
|||
|
||||
local_irq_disable();
|
||||
do_gettimeofday(&before);
|
||||
if (state == &dev->states[0])
|
||||
if (index == 0)
|
||||
/* Wait for interrupt state */
|
||||
cpu_do_idle();
|
||||
else if (state == &dev->states[1]) {
|
||||
else if (index == 1) {
|
||||
asm("b 1f; .align 5; 1:");
|
||||
asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */
|
||||
saved_lpr = sdram_selfrefresh_enable();
|
||||
|
@ -56,34 +57,38 @@ static int at91_enter_idle(struct cpuidle_device *dev,
|
|||
local_irq_enable();
|
||||
idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
|
||||
(after.tv_usec - before.tv_usec);
|
||||
return idle_time;
|
||||
|
||||
dev->last_residency = idle_time;
|
||||
return index;
|
||||
}
|
||||
|
||||
/* Initialize CPU idle by registering the idle states */
|
||||
static int at91_init_cpuidle(void)
|
||||
{
|
||||
struct cpuidle_device *device;
|
||||
|
||||
cpuidle_register_driver(&at91_idle_driver);
|
||||
struct cpuidle_driver *driver = &at91_idle_driver;
|
||||
|
||||
device = &per_cpu(at91_cpuidle_device, smp_processor_id());
|
||||
device->state_count = AT91_MAX_STATES;
|
||||
driver->state_count = AT91_MAX_STATES;
|
||||
|
||||
/* Wait for interrupt state */
|
||||
device->states[0].enter = at91_enter_idle;
|
||||
device->states[0].exit_latency = 1;
|
||||
device->states[0].target_residency = 10000;
|
||||
device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(device->states[0].name, "WFI");
|
||||
strcpy(device->states[0].desc, "Wait for interrupt");
|
||||
driver->states[0].enter = at91_enter_idle;
|
||||
driver->states[0].exit_latency = 1;
|
||||
driver->states[0].target_residency = 10000;
|
||||
driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(driver->states[0].name, "WFI");
|
||||
strcpy(driver->states[0].desc, "Wait for interrupt");
|
||||
|
||||
/* Wait for interrupt and RAM self refresh state */
|
||||
device->states[1].enter = at91_enter_idle;
|
||||
device->states[1].exit_latency = 10;
|
||||
device->states[1].target_residency = 10000;
|
||||
device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(device->states[1].name, "RAM_SR");
|
||||
strcpy(device->states[1].desc, "WFI and RAM Self Refresh");
|
||||
driver->states[1].enter = at91_enter_idle;
|
||||
driver->states[1].exit_latency = 10;
|
||||
driver->states[1].target_residency = 10000;
|
||||
driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(driver->states[1].name, "RAM_SR");
|
||||
strcpy(driver->states[1].desc, "WFI and RAM Self Refresh");
|
||||
|
||||
cpuidle_register_driver(&at91_idle_driver);
|
||||
|
||||
if (cpuidle_register_device(device)) {
|
||||
printk(KERN_ERR "at91_init_cpuidle: Failed registering\n");
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <linux/atmel-mci.h>
|
||||
#include <sound/atmel-ac97c.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/platform_data/macb.h>
|
||||
|
||||
/* USB Device */
|
||||
struct at91_udc_data {
|
||||
|
@ -81,18 +82,7 @@ extern void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
|
|||
/* atmel-mci platform config */
|
||||
extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data);
|
||||
|
||||
/* Ethernet (EMAC & MACB) */
|
||||
struct at91_eth_data {
|
||||
u32 phy_mask;
|
||||
u8 phy_irq_pin; /* PHY IRQ */
|
||||
u8 is_rmii; /* using RMII interface? */
|
||||
};
|
||||
extern void __init at91_add_device_eth(struct at91_eth_data *data);
|
||||
|
||||
#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \
|
||||
|| defined(CONFIG_ARCH_AT91SAM9G45)
|
||||
#define eth_platform_data at91_eth_data
|
||||
#endif
|
||||
extern void __init at91_add_device_eth(struct macb_platform_data *data);
|
||||
|
||||
/* USB Host */
|
||||
struct at91_usbh_data {
|
||||
|
@ -117,7 +107,8 @@ struct atmel_nand_data {
|
|||
u8 ale; /* address line number connected to ALE */
|
||||
u8 cle; /* address line number connected to CLE */
|
||||
u8 bus_width_16; /* buswidth is 16 bit */
|
||||
struct mtd_partition* (*partition_info)(int, int*);
|
||||
struct mtd_partition *parts;
|
||||
unsigned int num_parts;
|
||||
};
|
||||
extern void __init at91_add_device_nand(struct atmel_nand_data *data);
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#ifndef __ASM_ARCH_VMALLOC_H
|
||||
#define __ASM_ARCH_VMALLOC_H
|
||||
|
||||
#include <mach/hardware.h>
|
||||
|
||||
#define VMALLOC_END (AT91_VIRT_BASE & PGDIR_MASK)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -377,7 +377,7 @@ static struct davinci_nand_pdata da830_evm_nand_pdata = {
|
|||
.nr_parts = ARRAY_SIZE(da830_evm_nand_partitions),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.ecc_bits = 4,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.bbt_td = &da830_evm_nand_bbt_main_descr,
|
||||
.bbt_md = &da830_evm_nand_bbt_mirror_descr,
|
||||
.timing = &da830_evm_nandflash_timing,
|
||||
|
|
|
@ -256,7 +256,7 @@ static struct davinci_nand_pdata da850_evm_nandflash_data = {
|
|||
.nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.ecc_bits = 4,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.timing = &da850_evm_nandflash_timing,
|
||||
};
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
|
|||
.parts = davinci_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(davinci_nand_partitions),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.ecc_bits = 4,
|
||||
};
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
|
|||
.parts = davinci_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(davinci_nand_partitions),
|
||||
.ecc_mode = NAND_ECC_HW_SYNDROME,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
};
|
||||
|
||||
static struct resource davinci_nand_resources[] = {
|
||||
|
|
|
@ -139,7 +139,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
|
|||
.parts = davinci_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(davinci_nand_partitions),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.ecc_bits = 4,
|
||||
};
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ static struct davinci_nand_pdata davinci_evm_nandflash_data = {
|
|||
.parts = davinci_evm_nandflash_partition,
|
||||
.nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.timing = &davinci_evm_nandflash_timing,
|
||||
};
|
||||
|
||||
|
|
|
@ -396,7 +396,8 @@ static struct davinci_nand_pdata mityomapl138_nandflash_data = {
|
|||
.parts = mityomapl138_nandflash_partition,
|
||||
.nr_parts = ARRAY_SIZE(mityomapl138_nandflash_partition),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.options = NAND_USE_FLASH_BBT | NAND_BUSWIDTH_16,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.options = NAND_BUSWIDTH_16,
|
||||
.ecc_bits = 1, /* 4 bit mode is not supported with 16 bit NAND */
|
||||
};
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = {
|
|||
.parts = davinci_ntosd2_nandflash_partition,
|
||||
.nr_parts = ARRAY_SIZE(davinci_ntosd2_nandflash_partition),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
};
|
||||
|
||||
static struct resource davinci_ntosd2_nandflash_resource[] = {
|
||||
|
|
|
@ -144,7 +144,7 @@ static struct davinci_nand_pdata nand_config = {
|
|||
.parts = nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(nand_partitions),
|
||||
.ecc_mode = NAND_ECC_HW,
|
||||
.options = NAND_USE_FLASH_BBT,
|
||||
.bbt_options = NAND_BBT_USE_FLASH,
|
||||
.ecc_bits = 1,
|
||||
};
|
||||
|
||||
|
|
|
@ -79,9 +79,11 @@ static struct davinci_ops davinci_states[DAVINCI_CPUIDLE_MAX_STATES] = {
|
|||
|
||||
/* Actual code that puts the SoC in different idle states */
|
||||
static int davinci_enter_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state)
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
struct davinci_ops *ops = cpuidle_get_statedata(state);
|
||||
struct cpuidle_state_usage *state_usage = &dev->states_usage[index];
|
||||
struct davinci_ops *ops = cpuidle_get_statedata(state_usage);
|
||||
struct timeval before, after;
|
||||
int idle_time;
|
||||
|
||||
|
@ -99,13 +101,17 @@ static int davinci_enter_idle(struct cpuidle_device *dev,
|
|||
local_irq_enable();
|
||||
idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
|
||||
(after.tv_usec - before.tv_usec);
|
||||
return idle_time;
|
||||
|
||||
dev->last_residency = idle_time;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
static int __init davinci_cpuidle_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
struct cpuidle_device *device;
|
||||
struct cpuidle_driver *driver = &davinci_idle_driver;
|
||||
struct davinci_cpuidle_config *pdata = pdev->dev.platform_data;
|
||||
|
||||
device = &per_cpu(davinci_cpuidle_device, smp_processor_id());
|
||||
|
@ -117,33 +123,34 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
|
|||
|
||||
ddr2_reg_base = pdata->ddr2_ctlr_base;
|
||||
|
||||
/* Wait for interrupt state */
|
||||
driver->states[0].enter = davinci_enter_idle;
|
||||
driver->states[0].exit_latency = 1;
|
||||
driver->states[0].target_residency = 10000;
|
||||
driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(driver->states[0].name, "WFI");
|
||||
strcpy(driver->states[0].desc, "Wait for interrupt");
|
||||
|
||||
/* Wait for interrupt and DDR self refresh state */
|
||||
driver->states[1].enter = davinci_enter_idle;
|
||||
driver->states[1].exit_latency = 10;
|
||||
driver->states[1].target_residency = 10000;
|
||||
driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(driver->states[1].name, "DDR SR");
|
||||
strcpy(driver->states[1].desc, "WFI and DDR Self Refresh");
|
||||
if (pdata->ddr2_pdown)
|
||||
davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
|
||||
cpuidle_set_statedata(&device->states_usage[1], &davinci_states[1]);
|
||||
|
||||
device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
|
||||
driver->state_count = DAVINCI_CPUIDLE_MAX_STATES;
|
||||
|
||||
ret = cpuidle_register_driver(&davinci_idle_driver);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register driver\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Wait for interrupt state */
|
||||
device->states[0].enter = davinci_enter_idle;
|
||||
device->states[0].exit_latency = 1;
|
||||
device->states[0].target_residency = 10000;
|
||||
device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(device->states[0].name, "WFI");
|
||||
strcpy(device->states[0].desc, "Wait for interrupt");
|
||||
|
||||
/* Wait for interrupt and DDR self refresh state */
|
||||
device->states[1].enter = davinci_enter_idle;
|
||||
device->states[1].exit_latency = 10;
|
||||
device->states[1].target_residency = 10000;
|
||||
device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(device->states[1].name, "DDR SR");
|
||||
strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
|
||||
if (pdata->ddr2_pdown)
|
||||
davinci_states[1].flags |= DAVINCI_CPUIDLE_FLAGS_DDR2_PWDN;
|
||||
cpuidle_set_statedata(&device->states[1], &davinci_states[1]);
|
||||
|
||||
device->state_count = DAVINCI_CPUIDLE_MAX_STATES;
|
||||
|
||||
ret = cpuidle_register_device(device);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register device\n");
|
||||
|
|
|
@ -74,8 +74,10 @@ struct davinci_nand_pdata { /* platform_data */
|
|||
nand_ecc_modes_t ecc_mode;
|
||||
u8 ecc_bits;
|
||||
|
||||
/* e.g. NAND_BUSWIDTH_16 or NAND_USE_FLASH_BBT */
|
||||
/* e.g. NAND_BUSWIDTH_16 */
|
||||
unsigned options;
|
||||
/* e.g. NAND_BBT_USE_FLASH */
|
||||
unsigned bbt_options;
|
||||
|
||||
/* Main and mirror bbt descriptor overrides */
|
||||
struct nand_bbt_descr *bbt_td;
|
||||
|
|
|
@ -116,8 +116,9 @@ static struct mtd_partition ts72xx_nand_parts[] = {
|
|||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
}, {
|
||||
.name = "Linux",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 0, /* filled in later */
|
||||
.offset = MTDPART_OFS_RETAIN,
|
||||
.size = TS72XX_REDBOOT_PART_SIZE,
|
||||
/* leave so much for last partition */
|
||||
}, {
|
||||
.name = "RedBoot",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
|
@ -126,28 +127,14 @@ static struct mtd_partition ts72xx_nand_parts[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static void ts72xx_nand_set_parts(uint64_t size,
|
||||
struct platform_nand_chip *chip)
|
||||
{
|
||||
/* Factory TS-72xx boards only come with 32MiB or 128MiB NAND options */
|
||||
if (size == SZ_32M || size == SZ_128M) {
|
||||
/* Set the "Linux" partition size */
|
||||
ts72xx_nand_parts[1].size = size - TS72XX_REDBOOT_PART_SIZE;
|
||||
|
||||
chip->partitions = ts72xx_nand_parts;
|
||||
chip->nr_partitions = ARRAY_SIZE(ts72xx_nand_parts);
|
||||
} else {
|
||||
pr_warning("Unknown nand disk size:%lluMiB\n", size >> 20);
|
||||
}
|
||||
}
|
||||
|
||||
static struct platform_nand_data ts72xx_nand_data = {
|
||||
.chip = {
|
||||
.nr_chips = 1,
|
||||
.chip_offset = 0,
|
||||
.chip_delay = 15,
|
||||
.part_probe_types = ts72xx_nand_part_probes,
|
||||
.set_parts = ts72xx_nand_set_parts,
|
||||
.partitions = ts72xx_nand_parts,
|
||||
.nr_partitions = ARRAY_SIZE(ts72xx_nand_parts),
|
||||
},
|
||||
.ctrl = {
|
||||
.cmd_ctrl = ts72xx_nand_hwcontrol,
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
#include <asm/proc-fns.h>
|
||||
|
||||
static int exynos4_enter_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state);
|
||||
struct cpuidle_driver *drv,
|
||||
int index);
|
||||
|
||||
static struct cpuidle_state exynos4_cpuidle_set[] = {
|
||||
[0] = {
|
||||
|
@ -37,7 +38,8 @@ static struct cpuidle_driver exynos4_idle_driver = {
|
|||
};
|
||||
|
||||
static int exynos4_enter_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state)
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
struct timeval before, after;
|
||||
int idle_time;
|
||||
|
@ -52,29 +54,31 @@ static int exynos4_enter_idle(struct cpuidle_device *dev,
|
|||
idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
|
||||
(after.tv_usec - before.tv_usec);
|
||||
|
||||
return idle_time;
|
||||
dev->last_residency = idle_time;
|
||||
return index;
|
||||
}
|
||||
|
||||
static int __init exynos4_init_cpuidle(void)
|
||||
{
|
||||
int i, max_cpuidle_state, cpu_id;
|
||||
struct cpuidle_device *device;
|
||||
struct cpuidle_driver *drv = &exynos4_idle_driver;
|
||||
|
||||
/* Setup cpuidle driver */
|
||||
drv->state_count = (sizeof(exynos4_cpuidle_set) /
|
||||
sizeof(struct cpuidle_state));
|
||||
max_cpuidle_state = drv->state_count;
|
||||
for (i = 0; i < max_cpuidle_state; i++) {
|
||||
memcpy(&drv->states[i], &exynos4_cpuidle_set[i],
|
||||
sizeof(struct cpuidle_state));
|
||||
}
|
||||
cpuidle_register_driver(&exynos4_idle_driver);
|
||||
|
||||
for_each_cpu(cpu_id, cpu_online_mask) {
|
||||
device = &per_cpu(exynos4_cpuidle_device, cpu_id);
|
||||
device->cpu = cpu_id;
|
||||
|
||||
device->state_count = (sizeof(exynos4_cpuidle_set) /
|
||||
sizeof(struct cpuidle_state));
|
||||
|
||||
max_cpuidle_state = device->state_count;
|
||||
|
||||
for (i = 0; i < max_cpuidle_state; i++) {
|
||||
memcpy(&device->states[i], &exynos4_cpuidle_set[i],
|
||||
sizeof(struct cpuidle_state));
|
||||
}
|
||||
device->state_count = drv->state_count;
|
||||
|
||||
if (cpuidle_register_device(device)) {
|
||||
printk(KERN_ERR "CPUidle register device failed\n,");
|
||||
|
|
|
@ -1,22 +1,26 @@
|
|||
zreladdr-$(CONFIG_ARCH_MX1) += 0x08008000
|
||||
params_phys-$(CONFIG_ARCH_MX1) := 0x08000100
|
||||
initrd_phys-$(CONFIG_ARCH_MX1) := 0x08800000
|
||||
zreladdr-$(CONFIG_SOC_IMX1) += 0x08008000
|
||||
params_phys-$(CONFIG_SOC_IMX1) := 0x08000100
|
||||
initrd_phys-$(CONFIG_SOC_IMX1) := 0x08800000
|
||||
|
||||
zreladdr-$(CONFIG_MACH_MX21) += 0xC0008000
|
||||
params_phys-$(CONFIG_MACH_MX21) := 0xC0000100
|
||||
initrd_phys-$(CONFIG_MACH_MX21) := 0xC0800000
|
||||
zreladdr-$(CONFIG_SOC_IMX21) += 0xC0008000
|
||||
params_phys-$(CONFIG_SOC_IMX21) := 0xC0000100
|
||||
initrd_phys-$(CONFIG_SOC_IMX21) := 0xC0800000
|
||||
|
||||
zreladdr-$(CONFIG_ARCH_MX25) += 0x80008000
|
||||
params_phys-$(CONFIG_ARCH_MX25) := 0x80000100
|
||||
initrd_phys-$(CONFIG_ARCH_MX25) := 0x80800000
|
||||
zreladdr-$(CONFIG_SOC_IMX25) += 0x80008000
|
||||
params_phys-$(CONFIG_SOC_IMX25) := 0x80000100
|
||||
initrd_phys-$(CONFIG_SOC_IMX25) := 0x80800000
|
||||
|
||||
zreladdr-$(CONFIG_MACH_MX27) += 0xA0008000
|
||||
params_phys-$(CONFIG_MACH_MX27) := 0xA0000100
|
||||
initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000
|
||||
zreladdr-$(CONFIG_SOC_IMX27) += 0xA0008000
|
||||
params_phys-$(CONFIG_SOC_IMX27) := 0xA0000100
|
||||
initrd_phys-$(CONFIG_SOC_IMX27) := 0xA0800000
|
||||
|
||||
zreladdr-$(CONFIG_ARCH_MX3) += 0x80008000
|
||||
params_phys-$(CONFIG_ARCH_MX3) := 0x80000100
|
||||
initrd_phys-$(CONFIG_ARCH_MX3) := 0x80800000
|
||||
zreladdr-$(CONFIG_SOC_IMX31) += 0x80008000
|
||||
params_phys-$(CONFIG_SOC_IMX31) := 0x80000100
|
||||
initrd_phys-$(CONFIG_SOC_IMX31) := 0x80800000
|
||||
|
||||
zreladdr-$(CONFIG_SOC_IMX35) += 0x80008000
|
||||
params_phys-$(CONFIG_SOC_IMX35) := 0x80000100
|
||||
initrd_phys-$(CONFIG_SOC_IMX35) := 0x80800000
|
||||
|
||||
zreladdr-$(CONFIG_SOC_IMX6Q) += 0x10008000
|
||||
params_phys-$(CONFIG_SOC_IMX6Q) := 0x10000100
|
||||
|
|
|
@ -1139,7 +1139,7 @@ static int _clk_set_rate(struct clk *clk, unsigned long rate)
|
|||
return -EINVAL;
|
||||
|
||||
max_div = ((d->bm_pred >> d->bp_pred) + 1) *
|
||||
((d->bm_pred >> d->bp_pred) + 1);
|
||||
((d->bm_podf >> d->bp_podf) + 1);
|
||||
|
||||
div = parent_rate / rate;
|
||||
if (div == 0)
|
||||
|
@ -2002,6 +2002,21 @@ int __init mx6q_clocks_init(void)
|
|||
clk_set_rate(&asrc_serial_clk, 1500000);
|
||||
clk_set_rate(&enfc_clk, 11000000);
|
||||
|
||||
/*
|
||||
* Before pinctrl API is available, we have to rely on the pad
|
||||
* configuration set up by bootloader. For usdhc example here,
|
||||
* u-boot sets up the pads for 49.5 MHz case, and we have to lower
|
||||
* the usdhc clock from 198 to 49.5 MHz to match the pad configuration.
|
||||
*
|
||||
* FIXME: This is should be removed after pinctrl API is available.
|
||||
* At that time, usdhc driver can call pinctrl API to change pad
|
||||
* configuration dynamically per different usdhc clock settings.
|
||||
*/
|
||||
clk_set_rate(&usdhc1_clk, 49500000);
|
||||
clk_set_rate(&usdhc2_clk, 49500000);
|
||||
clk_set_rate(&usdhc3_clk, 49500000);
|
||||
clk_set_rate(&usdhc4_clk, 49500000);
|
||||
|
||||
np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt");
|
||||
base = of_iomap(np, 0);
|
||||
WARN_ON(!base);
|
||||
|
|
|
@ -33,17 +33,18 @@ static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
|
|||
|
||||
/* Actual code that puts the SoC in different idle states */
|
||||
static int kirkwood_enter_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state)
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
struct timeval before, after;
|
||||
int idle_time;
|
||||
|
||||
local_irq_disable();
|
||||
do_gettimeofday(&before);
|
||||
if (state == &dev->states[0])
|
||||
if (index == 0)
|
||||
/* Wait for interrupt state */
|
||||
cpu_do_idle();
|
||||
else if (state == &dev->states[1]) {
|
||||
else if (index == 1) {
|
||||
/*
|
||||
* Following write will put DDR in self refresh.
|
||||
* Note that we have 256 cycles before DDR puts it
|
||||
|
@ -58,35 +59,40 @@ static int kirkwood_enter_idle(struct cpuidle_device *dev,
|
|||
local_irq_enable();
|
||||
idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
|
||||
(after.tv_usec - before.tv_usec);
|
||||
return idle_time;
|
||||
|
||||
/* Update last residency */
|
||||
dev->last_residency = idle_time;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
/* Initialize CPU idle by registering the idle states */
|
||||
static int kirkwood_init_cpuidle(void)
|
||||
{
|
||||
struct cpuidle_device *device;
|
||||
|
||||
cpuidle_register_driver(&kirkwood_idle_driver);
|
||||
struct cpuidle_driver *driver = &kirkwood_idle_driver;
|
||||
|
||||
device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id());
|
||||
device->state_count = KIRKWOOD_MAX_STATES;
|
||||
driver->state_count = KIRKWOOD_MAX_STATES;
|
||||
|
||||
/* Wait for interrupt state */
|
||||
device->states[0].enter = kirkwood_enter_idle;
|
||||
device->states[0].exit_latency = 1;
|
||||
device->states[0].target_residency = 10000;
|
||||
device->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(device->states[0].name, "WFI");
|
||||
strcpy(device->states[0].desc, "Wait for interrupt");
|
||||
driver->states[0].enter = kirkwood_enter_idle;
|
||||
driver->states[0].exit_latency = 1;
|
||||
driver->states[0].target_residency = 10000;
|
||||
driver->states[0].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(driver->states[0].name, "WFI");
|
||||
strcpy(driver->states[0].desc, "Wait for interrupt");
|
||||
|
||||
/* Wait for interrupt and DDR self refresh state */
|
||||
device->states[1].enter = kirkwood_enter_idle;
|
||||
device->states[1].exit_latency = 10;
|
||||
device->states[1].target_residency = 10000;
|
||||
device->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(device->states[1].name, "DDR SR");
|
||||
strcpy(device->states[1].desc, "WFI and DDR Self Refresh");
|
||||
driver->states[1].enter = kirkwood_enter_idle;
|
||||
driver->states[1].exit_latency = 10;
|
||||
driver->states[1].target_residency = 10000;
|
||||
driver->states[1].flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
strcpy(driver->states[1].name, "DDR SR");
|
||||
strcpy(driver->states[1].desc, "WFI and DDR Self Refresh");
|
||||
|
||||
cpuidle_register_driver(&kirkwood_idle_driver);
|
||||
if (cpuidle_register_device(device)) {
|
||||
printk(KERN_ERR "kirkwood_init_cpuidle: Failed registering\n");
|
||||
return -EIO;
|
||||
|
|
|
@ -167,8 +167,9 @@ static struct mtd_partition aspenite_nand_partitions[] = {
|
|||
|
||||
static struct pxa3xx_nand_platform_data aspenite_nand_info = {
|
||||
.enable_arbiter = 1,
|
||||
.parts = aspenite_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(aspenite_nand_partitions),
|
||||
.num_cs = 1,
|
||||
.parts[0] = aspenite_nand_partitions,
|
||||
.nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
|
||||
};
|
||||
|
||||
static struct i2c_board_info aspenite_i2c_info[] __initdata = {
|
||||
|
|
|
@ -15,6 +15,8 @@ obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
|
|||
obj-$(CONFIG_MSM_SMD) += last_radio_log.o
|
||||
obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
|
||||
|
||||
CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
|
||||
|
||||
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
|
||||
obj-$(CONFIG_SMP) += headsmp.o platsmp.o
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
|
||||
extern struct sys_timer msm_timer;
|
||||
|
||||
static void __init msm7x30_fixup(struct machine_desc *desc, struct tag *tag,
|
||||
char **cmdline, struct meminfo *mi)
|
||||
static void __init msm7x30_fixup(struct tag *tag, char **cmdline,
|
||||
struct meminfo *mi)
|
||||
{
|
||||
for (; tag->hdr.size; tag = tag_next(tag))
|
||||
if (tag->hdr.tag == ATAG_MEM && tag->u.mem.start == 0x200000) {
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
#include "devices.h"
|
||||
|
||||
static void __init msm8960_fixup(struct machine_desc *desc, struct tag *tag,
|
||||
char **cmdline, struct meminfo *mi)
|
||||
static void __init msm8960_fixup(struct tag *tag, char **cmdline,
|
||||
struct meminfo *mi)
|
||||
{
|
||||
for (; tag->hdr.size; tag = tag_next(tag))
|
||||
if (tag->hdr.tag == ATAG_MEM &&
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
#include <mach/board.h>
|
||||
#include <mach/msm_iomap.h>
|
||||
|
||||
static void __init msm8x60_fixup(struct machine_desc *desc, struct tag *tag,
|
||||
char **cmdline, struct meminfo *mi)
|
||||
static void __init msm8x60_fixup(struct tag *tag, char **cmdline,
|
||||
struct meminfo *mi)
|
||||
{
|
||||
for (; tag->hdr.size; tag = tag_next(tag))
|
||||
if (tag->hdr.tag == ATAG_MEM &&
|
||||
|
|
|
@ -180,6 +180,9 @@ static u32 smc(u32 cmd_addr)
|
|||
__asmeq("%1", "r0")
|
||||
__asmeq("%2", "r1")
|
||||
__asmeq("%3", "r2")
|
||||
#ifdef REQUIRES_SEC
|
||||
".arch_extension sec\n"
|
||||
#endif
|
||||
"smc #0 @ switch to secure world\n"
|
||||
: "=r" (r0)
|
||||
: "r" (r0), "r" (r1), "r" (r2)
|
||||
|
|
|
@ -1281,9 +1281,9 @@ DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET,
|
|||
NULL, NULL, &ipg_clk, &gpt_ipg_clk);
|
||||
|
||||
DEFINE_CLOCK(pwm1_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG6_OFFSET,
|
||||
NULL, NULL, &ipg_clk, NULL);
|
||||
NULL, NULL, &ipg_perclk, NULL);
|
||||
DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
|
||||
NULL, NULL, &ipg_clk, NULL);
|
||||
NULL, NULL, &ipg_perclk, NULL);
|
||||
|
||||
/* I2C */
|
||||
DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
|
||||
|
@ -1634,6 +1634,7 @@ int __init mx53_clocks_init(unsigned long ckil, unsigned long osc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static void __init clk_get_freq_dt(unsigned long *ckil, unsigned long *osc,
|
||||
unsigned long *ckih1, unsigned long *ckih2)
|
||||
{
|
||||
|
@ -1671,3 +1672,4 @@ int __init mx53_clocks_init_dt(void)
|
|||
clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
|
||||
return mx53_clocks_init(ckil, osc, ckih1, ckih2);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -471,7 +471,8 @@ static void __init mx28evk_init(void)
|
|||
"mmc0-slot-power");
|
||||
if (ret)
|
||||
pr_warn("failed to request gpio mmc0-slot-power: %d\n", ret);
|
||||
mx28_add_mxs_mmc(0, &mx28evk_mmc_pdata[0]);
|
||||
else
|
||||
mx28_add_mxs_mmc(0, &mx28evk_mmc_pdata[0]);
|
||||
|
||||
ret = gpio_request_one(MX28EVK_MMC1_SLOT_POWER, GPIOF_OUT_INIT_LOW,
|
||||
"mmc1-slot-power");
|
||||
|
@ -480,7 +481,6 @@ static void __init mx28evk_init(void)
|
|||
else
|
||||
mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
|
||||
|
||||
mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
|
||||
mx28_add_rtc_stmp3xxx();
|
||||
|
||||
gpio_led_register_device(0, &mx28evk_led_data);
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include <plat/irda.h>
|
||||
#include <plat/keypad.h>
|
||||
#include <plat/common.h>
|
||||
#include <plat/omap-alsa.h>
|
||||
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/ads7846.h>
|
||||
|
|
|
@ -116,7 +116,7 @@ void omap1_pm_idle(void)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OMAP_MPU_TIMER
|
||||
#if defined(CONFIG_OMAP_MPU_TIMER) && !defined(CONFIG_OMAP_DM_TIMER)
|
||||
#warning Enable 32kHz OS timer in order to allow sleep states in idle
|
||||
use_idlect1 = use_idlect1 & ~(1 << 9);
|
||||
#else
|
||||
|
|
|
@ -226,7 +226,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
|
|||
{
|
||||
int ret;
|
||||
|
||||
omap_mux_init_gpio(29, OMAP_PIN_INPUT);
|
||||
/* gpio + 0 is "mmc0_cd" (input/IRQ) */
|
||||
mmc[0].gpio_cd = gpio + 0;
|
||||
omap2_hsmmc_init(mmc);
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
* XXX: Still needed to boot until the i2c & twl driver is adapted to
|
||||
* device-tree
|
||||
*/
|
||||
#ifdef CONFIG_ARCH_OMAP4
|
||||
static struct twl4030_platform_data sdp4430_twldata = {
|
||||
.irq_base = TWL6030_IRQ_BASE,
|
||||
.irq_end = TWL6030_IRQ_END,
|
||||
|
@ -37,7 +38,9 @@ static void __init omap4_i2c_init(void)
|
|||
{
|
||||
omap4_pmic_init("twl6030", &sdp4430_twldata);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP3
|
||||
static struct twl4030_platform_data beagle_twldata = {
|
||||
.irq_base = TWL4030_IRQ_BASE,
|
||||
.irq_end = TWL4030_IRQ_END,
|
||||
|
@ -47,6 +50,7 @@ static void __init omap3_i2c_init(void)
|
|||
{
|
||||
omap3_pmic_init("twl4030", &beagle_twldata);
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct of_device_id omap_dt_match_table[] __initdata = {
|
||||
{ .compatible = "simple-bus", },
|
||||
|
@ -72,17 +76,21 @@ static void __init omap_generic_init(void)
|
|||
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP4
|
||||
static void __init omap4_init(void)
|
||||
{
|
||||
omap4_i2c_init();
|
||||
omap_generic_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP3
|
||||
static void __init omap3_init(void)
|
||||
{
|
||||
omap3_i2c_init();
|
||||
omap_generic_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SOC_OMAP2420)
|
||||
static const char *omap242x_boards_compat[] __initdata = {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/input/matrix_keypad.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
@ -34,7 +35,6 @@
|
|||
#include <plat/usb.h>
|
||||
#include <plat/board.h>
|
||||
#include <plat/common.h>
|
||||
#include <plat/keypad.h>
|
||||
#include <plat/menelaus.h>
|
||||
#include <plat/dma.h>
|
||||
#include <plat/gpmc.h>
|
||||
|
@ -50,10 +50,8 @@
|
|||
|
||||
#define H4_ETHR_GPIO_IRQ 92
|
||||
|
||||
static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };
|
||||
static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };
|
||||
|
||||
static const unsigned int h4_keymap[] = {
|
||||
#if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE)
|
||||
static const uint32_t board_matrix_keys[] = {
|
||||
KEY(0, 0, KEY_LEFT),
|
||||
KEY(1, 0, KEY_RIGHT),
|
||||
KEY(2, 0, KEY_A),
|
||||
|
@ -86,6 +84,71 @@ static const unsigned int h4_keymap[] = {
|
|||
KEY(4, 5, KEY_ENTER),
|
||||
};
|
||||
|
||||
static const struct matrix_keymap_data board_keymap_data = {
|
||||
.keymap = board_matrix_keys,
|
||||
.keymap_size = ARRAY_SIZE(board_matrix_keys),
|
||||
};
|
||||
|
||||
static unsigned int board_keypad_row_gpios[] = {
|
||||
88, 89, 124, 11, 6, 96
|
||||
};
|
||||
|
||||
static unsigned int board_keypad_col_gpios[] = {
|
||||
90, 91, 100, 36, 12, 97, 98
|
||||
};
|
||||
|
||||
static struct matrix_keypad_platform_data board_keypad_platform_data = {
|
||||
.keymap_data = &board_keymap_data,
|
||||
.row_gpios = board_keypad_row_gpios,
|
||||
.num_row_gpios = ARRAY_SIZE(board_keypad_row_gpios),
|
||||
.col_gpios = board_keypad_col_gpios,
|
||||
.num_col_gpios = ARRAY_SIZE(board_keypad_col_gpios),
|
||||
.active_low = 1,
|
||||
|
||||
.debounce_ms = 20,
|
||||
.col_scan_delay_us = 5,
|
||||
};
|
||||
|
||||
static struct platform_device board_keyboard = {
|
||||
.name = "matrix-keypad",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &board_keypad_platform_data,
|
||||
},
|
||||
};
|
||||
static void __init board_mkp_init(void)
|
||||
{
|
||||
omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
if (omap_has_menelaus()) {
|
||||
omap_mux_init_signal("sdrc_a14.gpio0",
|
||||
OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
|
||||
omap_mux_init_signal("gpio_98", 0);
|
||||
board_keypad_row_gpios[5] = 0;
|
||||
board_keypad_col_gpios[2] = 15;
|
||||
board_keypad_col_gpios[6] = 18;
|
||||
} else {
|
||||
omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_signal("gpio_100", 0);
|
||||
omap_mux_init_signal("gpio_98", 0);
|
||||
}
|
||||
omap_mux_init_signal("gpio_90", 0);
|
||||
omap_mux_init_signal("gpio_91", 0);
|
||||
omap_mux_init_signal("gpio_36", 0);
|
||||
omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
|
||||
omap_mux_init_signal("gpio_97", 0);
|
||||
|
||||
platform_device_register(&board_keyboard);
|
||||
}
|
||||
#else
|
||||
static inline void board_mkp_init(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct mtd_partition h4_partitions[] = {
|
||||
/* bootloader (U-Boot, etc) in first sector */
|
||||
{
|
||||
|
@ -137,31 +200,8 @@ static struct platform_device h4_flash_device = {
|
|||
.resource = &h4_flash_resource,
|
||||
};
|
||||
|
||||
static const struct matrix_keymap_data h4_keymap_data = {
|
||||
.keymap = h4_keymap,
|
||||
.keymap_size = ARRAY_SIZE(h4_keymap),
|
||||
};
|
||||
|
||||
static struct omap_kp_platform_data h4_kp_data = {
|
||||
.rows = 6,
|
||||
.cols = 7,
|
||||
.keymap_data = &h4_keymap_data,
|
||||
.rep = true,
|
||||
.row_gpios = row_gpios,
|
||||
.col_gpios = col_gpios,
|
||||
};
|
||||
|
||||
static struct platform_device h4_kp_device = {
|
||||
.name = "omap-keypad",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &h4_kp_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *h4_devices[] __initdata = {
|
||||
&h4_flash_device,
|
||||
&h4_kp_device,
|
||||
};
|
||||
|
||||
static struct panel_generic_dpi_data h4_panel_data = {
|
||||
|
@ -336,31 +376,7 @@ static void __init omap_h4_init(void)
|
|||
* if not needed.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE)
|
||||
omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
if (omap_has_menelaus()) {
|
||||
omap_mux_init_signal("sdrc_a14.gpio0",
|
||||
OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_signal("vlynq_rx0.gpio_15", 0);
|
||||
omap_mux_init_signal("gpio_98", 0);
|
||||
row_gpios[5] = 0;
|
||||
col_gpios[2] = 15;
|
||||
col_gpios[6] = 18;
|
||||
} else {
|
||||
omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP);
|
||||
omap_mux_init_signal("gpio_100", 0);
|
||||
omap_mux_init_signal("gpio_98", 0);
|
||||
}
|
||||
omap_mux_init_signal("gpio_90", 0);
|
||||
omap_mux_init_signal("gpio_91", 0);
|
||||
omap_mux_init_signal("gpio_36", 0);
|
||||
omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0);
|
||||
omap_mux_init_signal("gpio_97", 0);
|
||||
#endif
|
||||
|
||||
board_mkp_init();
|
||||
i2c_register_board_info(1, h4_i2c_board_info,
|
||||
ARRAY_SIZE(h4_i2c_board_info));
|
||||
|
||||
|
|
|
@ -46,10 +46,19 @@
|
|||
(DPLL_SCALE_FACTOR / DPLL_SCALE_BASE))
|
||||
|
||||
/* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */
|
||||
#define DPLL_FINT_BAND1_MIN 750000
|
||||
#define DPLL_FINT_BAND1_MAX 2100000
|
||||
#define DPLL_FINT_BAND2_MIN 7500000
|
||||
#define DPLL_FINT_BAND2_MAX 21000000
|
||||
#define OMAP3430_DPLL_FINT_BAND1_MIN 750000
|
||||
#define OMAP3430_DPLL_FINT_BAND1_MAX 2100000
|
||||
#define OMAP3430_DPLL_FINT_BAND2_MIN 7500000
|
||||
#define OMAP3430_DPLL_FINT_BAND2_MAX 21000000
|
||||
|
||||
/*
|
||||
* DPLL valid Fint frequency range for OMAP36xx and OMAP4xxx.
|
||||
* From device data manual section 4.3 "DPLL and DLL Specifications".
|
||||
*/
|
||||
#define OMAP3PLUS_DPLL_FINT_JTYPE_MIN 500000
|
||||
#define OMAP3PLUS_DPLL_FINT_JTYPE_MAX 2500000
|
||||
#define OMAP3PLUS_DPLL_FINT_MIN 32000
|
||||
#define OMAP3PLUS_DPLL_FINT_MAX 52000000
|
||||
|
||||
/* _dpll_test_fint() return codes */
|
||||
#define DPLL_FINT_UNDERFLOW -1
|
||||
|
@ -71,33 +80,43 @@
|
|||
static int _dpll_test_fint(struct clk *clk, u8 n)
|
||||
{
|
||||
struct dpll_data *dd;
|
||||
long fint;
|
||||
long fint, fint_min, fint_max;
|
||||
int ret = 0;
|
||||
|
||||
dd = clk->dpll_data;
|
||||
|
||||
/* DPLL divider must result in a valid jitter correction val */
|
||||
fint = clk->parent->rate / n;
|
||||
if (fint < DPLL_FINT_BAND1_MIN) {
|
||||
|
||||
if (cpu_is_omap24xx()) {
|
||||
/* Should not be called for OMAP2, so warn if it is called */
|
||||
WARN(1, "No fint limits available for OMAP2!\n");
|
||||
return DPLL_FINT_INVALID;
|
||||
} else if (cpu_is_omap3430()) {
|
||||
fint_min = OMAP3430_DPLL_FINT_BAND1_MIN;
|
||||
fint_max = OMAP3430_DPLL_FINT_BAND2_MAX;
|
||||
} else if (dd->flags & DPLL_J_TYPE) {
|
||||
fint_min = OMAP3PLUS_DPLL_FINT_JTYPE_MIN;
|
||||
fint_max = OMAP3PLUS_DPLL_FINT_JTYPE_MAX;
|
||||
} else {
|
||||
fint_min = OMAP3PLUS_DPLL_FINT_MIN;
|
||||
fint_max = OMAP3PLUS_DPLL_FINT_MAX;
|
||||
}
|
||||
|
||||
if (fint < fint_min) {
|
||||
pr_debug("rejecting n=%d due to Fint failure, "
|
||||
"lowering max_divider\n", n);
|
||||
dd->max_divider = n;
|
||||
ret = DPLL_FINT_UNDERFLOW;
|
||||
|
||||
} else if (fint > DPLL_FINT_BAND1_MAX &&
|
||||
fint < DPLL_FINT_BAND2_MIN) {
|
||||
|
||||
pr_debug("rejecting n=%d due to Fint failure\n", n);
|
||||
ret = DPLL_FINT_INVALID;
|
||||
|
||||
} else if (fint > DPLL_FINT_BAND2_MAX) {
|
||||
|
||||
} else if (fint > fint_max) {
|
||||
pr_debug("rejecting n=%d due to Fint failure, "
|
||||
"boosting min_divider\n", n);
|
||||
dd->min_divider = n;
|
||||
ret = DPLL_FINT_INVALID;
|
||||
|
||||
} else if (cpu_is_omap3430() && fint > OMAP3430_DPLL_FINT_BAND1_MAX &&
|
||||
fint < OMAP3430_DPLL_FINT_BAND2_MIN) {
|
||||
pr_debug("rejecting n=%d due to Fint failure\n", n);
|
||||
ret = DPLL_FINT_INVALID;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -66,6 +66,8 @@ void omap3_noncore_dpll_disable(struct clk *clk);
|
|||
int omap4_dpllmx_gatectrl_read(struct clk *clk);
|
||||
void omap4_dpllmx_allow_gatectrl(struct clk *clk);
|
||||
void omap4_dpllmx_deny_gatectrl(struct clk *clk);
|
||||
long omap4_dpll_regm4xen_round_rate(struct clk *clk, unsigned long target_rate);
|
||||
unsigned long omap4_dpll_regm4xen_recalc(struct clk *clk);
|
||||
|
||||
#ifdef CONFIG_OMAP_RESET_CLOCKS
|
||||
void omap2_clk_disable_unused(struct clk *clk);
|
||||
|
|
|
@ -1898,18 +1898,6 @@ static struct omap_clk omap2420_clks[] = {
|
|||
CLK(NULL, "pka_ick", &pka_ick, CK_242X),
|
||||
CLK(NULL, "usb_fck", &usb_fck, CK_242X),
|
||||
CLK("musb-hdrc", "fck", &osc_ck, CK_242X),
|
||||
CLK("omap_timer.1", "fck", &gpt1_fck, CK_242X),
|
||||
CLK("omap_timer.2", "fck", &gpt2_fck, CK_242X),
|
||||
CLK("omap_timer.3", "fck", &gpt3_fck, CK_242X),
|
||||
CLK("omap_timer.4", "fck", &gpt4_fck, CK_242X),
|
||||
CLK("omap_timer.5", "fck", &gpt5_fck, CK_242X),
|
||||
CLK("omap_timer.6", "fck", &gpt6_fck, CK_242X),
|
||||
CLK("omap_timer.7", "fck", &gpt7_fck, CK_242X),
|
||||
CLK("omap_timer.8", "fck", &gpt8_fck, CK_242X),
|
||||
CLK("omap_timer.9", "fck", &gpt9_fck, CK_242X),
|
||||
CLK("omap_timer.10", "fck", &gpt10_fck, CK_242X),
|
||||
CLK("omap_timer.11", "fck", &gpt11_fck, CK_242X),
|
||||
CLK("omap_timer.12", "fck", &gpt12_fck, CK_242X),
|
||||
CLK("omap_timer.1", "32k_ck", &func_32k_ck, CK_243X),
|
||||
CLK("omap_timer.2", "32k_ck", &func_32k_ck, CK_243X),
|
||||
CLK("omap_timer.3", "32k_ck", &func_32k_ck, CK_243X),
|
||||
|
|
|
@ -1998,18 +1998,6 @@ static struct omap_clk omap2430_clks[] = {
|
|||
CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
|
||||
CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
|
||||
CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
|
||||
CLK("omap_timer.1", "fck", &gpt1_fck, CK_243X),
|
||||
CLK("omap_timer.2", "fck", &gpt2_fck, CK_243X),
|
||||
CLK("omap_timer.3", "fck", &gpt3_fck, CK_243X),
|
||||
CLK("omap_timer.4", "fck", &gpt4_fck, CK_243X),
|
||||
CLK("omap_timer.5", "fck", &gpt5_fck, CK_243X),
|
||||
CLK("omap_timer.6", "fck", &gpt6_fck, CK_243X),
|
||||
CLK("omap_timer.7", "fck", &gpt7_fck, CK_243X),
|
||||
CLK("omap_timer.8", "fck", &gpt8_fck, CK_243X),
|
||||
CLK("omap_timer.9", "fck", &gpt9_fck, CK_243X),
|
||||
CLK("omap_timer.10", "fck", &gpt10_fck, CK_243X),
|
||||
CLK("omap_timer.11", "fck", &gpt11_fck, CK_243X),
|
||||
CLK("omap_timer.12", "fck", &gpt12_fck, CK_243X),
|
||||
CLK("omap_timer.1", "32k_ck", &func_32k_ck, CK_243X),
|
||||
CLK("omap_timer.2", "32k_ck", &func_32k_ck, CK_243X),
|
||||
CLK("omap_timer.3", "32k_ck", &func_32k_ck, CK_243X),
|
||||
|
|
|
@ -3464,18 +3464,6 @@ static struct omap_clk omap3xxx_clks[] = {
|
|||
CLK("musb-am35x", "fck", &hsotgusb_fck_am35xx, CK_AM35XX),
|
||||
CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX),
|
||||
CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX),
|
||||
CLK("omap_timer.1", "fck", &gpt1_fck, CK_3XXX),
|
||||
CLK("omap_timer.2", "fck", &gpt2_fck, CK_3XXX),
|
||||
CLK("omap_timer.3", "fck", &gpt3_fck, CK_3XXX),
|
||||
CLK("omap_timer.4", "fck", &gpt4_fck, CK_3XXX),
|
||||
CLK("omap_timer.5", "fck", &gpt5_fck, CK_3XXX),
|
||||
CLK("omap_timer.6", "fck", &gpt6_fck, CK_3XXX),
|
||||
CLK("omap_timer.7", "fck", &gpt7_fck, CK_3XXX),
|
||||
CLK("omap_timer.8", "fck", &gpt8_fck, CK_3XXX),
|
||||
CLK("omap_timer.9", "fck", &gpt9_fck, CK_3XXX),
|
||||
CLK("omap_timer.10", "fck", &gpt10_fck, CK_3XXX),
|
||||
CLK("omap_timer.11", "fck", &gpt11_fck, CK_3XXX),
|
||||
CLK("omap_timer.12", "fck", &gpt12_fck, CK_3XXX),
|
||||
CLK("omap_timer.1", "32k_ck", &omap_32k_fck, CK_3XXX),
|
||||
CLK("omap_timer.2", "32k_ck", &omap_32k_fck, CK_3XXX),
|
||||
CLK("omap_timer.3", "32k_ck", &omap_32k_fck, CK_3XXX),
|
||||
|
|
|
@ -8,6 +8,13 @@
|
|||
#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H
|
||||
#define __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H
|
||||
|
||||
/*
|
||||
* OMAP4430_REGM4XEN_MULT: If the CM_CLKMODE_DPLL_ABE.DPLL_REGM4XEN bit is
|
||||
* set, then the DPLL's lock frequency is multiplied by 4 (OMAP4430 TRM
|
||||
* vV Section 3.6.3.3.1 "DPLLs Output Clocks Parameters")
|
||||
*/
|
||||
#define OMAP4430_REGM4XEN_MULT 4
|
||||
|
||||
int omap4xxx_clk_init(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -270,8 +270,8 @@ static struct clk dpll_abe_ck = {
|
|||
.dpll_data = &dpll_abe_dd,
|
||||
.init = &omap2_init_dpll_parent,
|
||||
.ops = &clkops_omap3_noncore_dpll_ops,
|
||||
.recalc = &omap3_dpll_recalc,
|
||||
.round_rate = &omap2_dpll_round_rate,
|
||||
.recalc = &omap4_dpll_regm4xen_recalc,
|
||||
.round_rate = &omap4_dpll_regm4xen_round_rate,
|
||||
.set_rate = &omap3_noncore_dpll_set_rate,
|
||||
};
|
||||
|
||||
|
@ -1195,11 +1195,25 @@ static struct clk l4_wkup_clk_mux_ck = {
|
|||
.recalc = &omap2_clksel_recalc,
|
||||
};
|
||||
|
||||
static const struct clksel_rate div2_2to1_rates[] = {
|
||||
{ .div = 1, .val = 1, .flags = RATE_IN_4430 },
|
||||
{ .div = 2, .val = 0, .flags = RATE_IN_4430 },
|
||||
{ .div = 0 },
|
||||
};
|
||||
|
||||
static const struct clksel ocp_abe_iclk_div[] = {
|
||||
{ .parent = &aess_fclk, .rates = div2_2to1_rates },
|
||||
{ .parent = NULL },
|
||||
};
|
||||
|
||||
static struct clk ocp_abe_iclk = {
|
||||
.name = "ocp_abe_iclk",
|
||||
.parent = &aess_fclk,
|
||||
.clksel = ocp_abe_iclk_div,
|
||||
.clksel_reg = OMAP4430_CM1_ABE_AESS_CLKCTRL,
|
||||
.clksel_mask = OMAP4430_CLKSEL_AESS_FCLK_MASK,
|
||||
.ops = &clkops_null,
|
||||
.recalc = &followparent_recalc,
|
||||
.recalc = &omap2_clksel_recalc,
|
||||
};
|
||||
|
||||
static struct clk per_abe_24m_fclk = {
|
||||
|
@ -1398,9 +1412,9 @@ static struct clk dss_dss_clk = {
|
|||
};
|
||||
|
||||
static const struct clksel_rate div3_8to32_rates[] = {
|
||||
{ .div = 8, .val = 0, .flags = RATE_IN_44XX },
|
||||
{ .div = 16, .val = 1, .flags = RATE_IN_44XX },
|
||||
{ .div = 32, .val = 2, .flags = RATE_IN_44XX },
|
||||
{ .div = 8, .val = 0, .flags = RATE_IN_4460 },
|
||||
{ .div = 16, .val = 1, .flags = RATE_IN_4460 },
|
||||
{ .div = 32, .val = 2, .flags = RATE_IN_4460 },
|
||||
{ .div = 0 },
|
||||
};
|
||||
|
||||
|
@ -3363,17 +3377,6 @@ static struct omap_clk omap44xx_clks[] = {
|
|||
CLK("usbhs-omap.0", "usbhost_ick", &dummy_ck, CK_443X),
|
||||
CLK("usbhs-omap.0", "usbtll_fck", &dummy_ck, CK_443X),
|
||||
CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
|
||||
CLK("omap_timer.1", "fck", &timer1_fck, CK_443X),
|
||||
CLK("omap_timer.2", "fck", &timer2_fck, CK_443X),
|
||||
CLK("omap_timer.3", "fck", &timer3_fck, CK_443X),
|
||||
CLK("omap_timer.4", "fck", &timer4_fck, CK_443X),
|
||||
CLK("omap_timer.5", "fck", &timer5_fck, CK_443X),
|
||||
CLK("omap_timer.6", "fck", &timer6_fck, CK_443X),
|
||||
CLK("omap_timer.7", "fck", &timer7_fck, CK_443X),
|
||||
CLK("omap_timer.8", "fck", &timer8_fck, CK_443X),
|
||||
CLK("omap_timer.9", "fck", &timer9_fck, CK_443X),
|
||||
CLK("omap_timer.10", "fck", &timer10_fck, CK_443X),
|
||||
CLK("omap_timer.11", "fck", &timer11_fck, CK_443X),
|
||||
CLK("omap_timer.1", "32k_ck", &sys_32k_ck, CK_443X),
|
||||
CLK("omap_timer.2", "32k_ck", &sys_32k_ck, CK_443X),
|
||||
CLK("omap_timer.3", "32k_ck", &sys_32k_ck, CK_443X),
|
||||
|
@ -3403,12 +3406,12 @@ int __init omap4xxx_clk_init(void)
|
|||
struct omap_clk *c;
|
||||
u32 cpu_clkflg;
|
||||
|
||||
if (cpu_is_omap44xx()) {
|
||||
if (cpu_is_omap443x()) {
|
||||
cpu_mask = RATE_IN_4430;
|
||||
cpu_clkflg = CK_443X;
|
||||
} else if (cpu_is_omap446x()) {
|
||||
cpu_mask = RATE_IN_4460;
|
||||
cpu_clkflg = CK_446X;
|
||||
cpu_mask = RATE_IN_4460 | RATE_IN_4430;
|
||||
cpu_clkflg = CK_446X | CK_443X;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -88,17 +88,21 @@ static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
|
|||
/**
|
||||
* omap3_enter_idle - Programs OMAP3 to enter the specified state
|
||||
* @dev: cpuidle device
|
||||
* @state: The target state to be programmed
|
||||
* @drv: cpuidle driver
|
||||
* @index: the index of state to be entered
|
||||
*
|
||||
* Called from the CPUidle framework to program the device to the
|
||||
* specified target state selected by the governor.
|
||||
*/
|
||||
static int omap3_enter_idle(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state)
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
struct omap3_idle_statedata *cx = cpuidle_get_statedata(state);
|
||||
struct omap3_idle_statedata *cx =
|
||||
cpuidle_get_statedata(&dev->states_usage[index]);
|
||||
struct timespec ts_preidle, ts_postidle, ts_idle;
|
||||
u32 mpu_state = cx->mpu_state, core_state = cx->core_state;
|
||||
int idle_time;
|
||||
|
||||
/* Used to keep track of the total time in idle */
|
||||
getnstimeofday(&ts_preidle);
|
||||
|
@ -113,7 +117,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
|
|||
goto return_sleep_time;
|
||||
|
||||
/* Deny idle for C1 */
|
||||
if (state == &dev->states[0]) {
|
||||
if (index == 0) {
|
||||
pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle);
|
||||
pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
|
||||
}
|
||||
|
@ -122,7 +126,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
|
|||
omap_sram_idle();
|
||||
|
||||
/* Re-allow idle for C1 */
|
||||
if (state == &dev->states[0]) {
|
||||
if (index == 0) {
|
||||
pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
|
||||
pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle);
|
||||
}
|
||||
|
@ -134,28 +138,38 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
|
|||
local_irq_enable();
|
||||
local_fiq_enable();
|
||||
|
||||
return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC;
|
||||
idle_time = ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * \
|
||||
USEC_PER_SEC;
|
||||
|
||||
/* Update cpuidle counters */
|
||||
dev->last_residency = idle_time;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* next_valid_state - Find next valid C-state
|
||||
* @dev: cpuidle device
|
||||
* @state: Currently selected C-state
|
||||
* @drv: cpuidle driver
|
||||
* @index: Index of currently selected c-state
|
||||
*
|
||||
* If the current state is valid, it is returned back to the caller.
|
||||
* Else, this function searches for a lower c-state which is still
|
||||
* valid.
|
||||
* If the state corresponding to index is valid, index is returned back
|
||||
* to the caller. Else, this function searches for a lower c-state which is
|
||||
* still valid (as defined in omap3_power_states[]) and returns its index.
|
||||
*
|
||||
* A state is valid if the 'valid' field is enabled and
|
||||
* if it satisfies the enable_off_mode condition.
|
||||
*/
|
||||
static struct cpuidle_state *next_valid_state(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *curr)
|
||||
static int next_valid_state(struct cpuidle_device *dev,
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
struct cpuidle_state *next = NULL;
|
||||
struct omap3_idle_statedata *cx = cpuidle_get_statedata(curr);
|
||||
struct cpuidle_state_usage *curr_usage = &dev->states_usage[index];
|
||||
struct cpuidle_state *curr = &drv->states[index];
|
||||
struct omap3_idle_statedata *cx = cpuidle_get_statedata(curr_usage);
|
||||
u32 mpu_deepest_state = PWRDM_POWER_RET;
|
||||
u32 core_deepest_state = PWRDM_POWER_RET;
|
||||
int next_index = -1;
|
||||
|
||||
if (enable_off_mode) {
|
||||
mpu_deepest_state = PWRDM_POWER_OFF;
|
||||
|
@ -172,20 +186,20 @@ static struct cpuidle_state *next_valid_state(struct cpuidle_device *dev,
|
|||
if ((cx->valid) &&
|
||||
(cx->mpu_state >= mpu_deepest_state) &&
|
||||
(cx->core_state >= core_deepest_state)) {
|
||||
return curr;
|
||||
return index;
|
||||
} else {
|
||||
int idx = OMAP3_NUM_STATES - 1;
|
||||
|
||||
/* Reach the current state starting at highest C-state */
|
||||
for (; idx >= 0; idx--) {
|
||||
if (&dev->states[idx] == curr) {
|
||||
next = &dev->states[idx];
|
||||
if (&drv->states[idx] == curr) {
|
||||
next_index = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Should never hit this condition */
|
||||
WARN_ON(next == NULL);
|
||||
WARN_ON(next_index == -1);
|
||||
|
||||
/*
|
||||
* Drop to next valid state.
|
||||
|
@ -193,41 +207,44 @@ static struct cpuidle_state *next_valid_state(struct cpuidle_device *dev,
|
|||
*/
|
||||
idx--;
|
||||
for (; idx >= 0; idx--) {
|
||||
cx = cpuidle_get_statedata(&dev->states[idx]);
|
||||
cx = cpuidle_get_statedata(&dev->states_usage[idx]);
|
||||
if ((cx->valid) &&
|
||||
(cx->mpu_state >= mpu_deepest_state) &&
|
||||
(cx->core_state >= core_deepest_state)) {
|
||||
next = &dev->states[idx];
|
||||
next_index = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* C1 is always valid.
|
||||
* So, no need to check for 'next==NULL' outside this loop.
|
||||
* So, no need to check for 'next_index == -1' outside
|
||||
* this loop.
|
||||
*/
|
||||
}
|
||||
|
||||
return next;
|
||||
return next_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* omap3_enter_idle_bm - Checks for any bus activity
|
||||
* @dev: cpuidle device
|
||||
* @state: The target state to be programmed
|
||||
* @drv: cpuidle driver
|
||||
* @index: array index of target state to be programmed
|
||||
*
|
||||
* This function checks for any pending activity and then programs
|
||||
* the device to the specified or a safer state.
|
||||
*/
|
||||
static int omap3_enter_idle_bm(struct cpuidle_device *dev,
|
||||
struct cpuidle_state *state)
|
||||
struct cpuidle_driver *drv,
|
||||
int index)
|
||||
{
|
||||
struct cpuidle_state *new_state;
|
||||
int new_state_idx;
|
||||
u32 core_next_state, per_next_state = 0, per_saved_state = 0, cam_state;
|
||||
struct omap3_idle_statedata *cx;
|
||||
int ret;
|
||||
|
||||
if (!omap3_can_sleep()) {
|
||||
new_state = dev->safe_state;
|
||||
new_state_idx = drv->safe_state_index;
|
||||
goto select_state;
|
||||
}
|
||||
|
||||
|
@ -237,7 +254,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
|
|||
*/
|
||||
cam_state = pwrdm_read_pwrst(cam_pd);
|
||||
if (cam_state == PWRDM_POWER_ON) {
|
||||
new_state = dev->safe_state;
|
||||
new_state_idx = drv->safe_state_index;
|
||||
goto select_state;
|
||||
}
|
||||
|
||||
|
@ -253,7 +270,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
|
|||
* Prevent PER off if CORE is not in retention or off as this
|
||||
* would disable PER wakeups completely.
|
||||
*/
|
||||
cx = cpuidle_get_statedata(state);
|
||||
cx = cpuidle_get_statedata(&dev->states_usage[index]);
|
||||
core_next_state = cx->core_state;
|
||||
per_next_state = per_saved_state = pwrdm_read_next_pwrst(per_pd);
|
||||
if ((per_next_state == PWRDM_POWER_OFF) &&
|
||||
|
@ -264,11 +281,10 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
|
|||
if (per_next_state != per_saved_state)
|
||||
pwrdm_set_next_pwrst(per_pd, per_next_state);
|
||||
|
||||
new_state = next_valid_state(dev, state);
|
||||
new_state_idx = next_valid_state(dev, drv, index);
|
||||
|
||||
select_state:
|
||||
dev->last_state = new_state;
|
||||
ret = omap3_enter_idle(dev, new_state);
|
||||
ret = omap3_enter_idle(dev, drv, new_state_idx);
|
||||
|
||||
/* Restore original PER state if it was modified */
|
||||
if (per_next_state != per_saved_state)
|
||||
|
@ -301,22 +317,31 @@ struct cpuidle_driver omap3_idle_driver = {
|
|||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
/* Helper to fill the C-state common data and register the driver_data */
|
||||
static inline struct omap3_idle_statedata *_fill_cstate(
|
||||
struct cpuidle_device *dev,
|
||||
/* Helper to fill the C-state common data*/
|
||||
static inline void _fill_cstate(struct cpuidle_driver *drv,
|
||||
int idx, const char *descr)
|
||||
{
|
||||
struct omap3_idle_statedata *cx = &omap3_idle_data[idx];
|
||||
struct cpuidle_state *state = &dev->states[idx];
|
||||
struct cpuidle_state *state = &drv->states[idx];
|
||||
|
||||
state->exit_latency = cpuidle_params_table[idx].exit_latency;
|
||||
state->target_residency = cpuidle_params_table[idx].target_residency;
|
||||
state->flags = CPUIDLE_FLAG_TIME_VALID;
|
||||
state->enter = omap3_enter_idle_bm;
|
||||
cx->valid = cpuidle_params_table[idx].valid;
|
||||
sprintf(state->name, "C%d", idx + 1);
|
||||
strncpy(state->desc, descr, CPUIDLE_DESC_LEN);
|
||||
cpuidle_set_statedata(state, cx);
|
||||
|
||||
}
|
||||
|
||||
/* Helper to register the driver_data */
|
||||
static inline struct omap3_idle_statedata *_fill_cstate_usage(
|
||||
struct cpuidle_device *dev,
|
||||
int idx)
|
||||
{
|
||||
struct omap3_idle_statedata *cx = &omap3_idle_data[idx];
|
||||
struct cpuidle_state_usage *state_usage = &dev->states_usage[idx];
|
||||
|
||||
cx->valid = cpuidle_params_table[idx].valid;
|
||||
cpuidle_set_statedata(state_usage, cx);
|
||||
|
||||
return cx;
|
||||
}
|
||||
|
@ -330,6 +355,7 @@ static inline struct omap3_idle_statedata *_fill_cstate(
|
|||
int __init omap3_idle_init(void)
|
||||
{
|
||||
struct cpuidle_device *dev;
|
||||
struct cpuidle_driver *drv = &omap3_idle_driver;
|
||||
struct omap3_idle_statedata *cx;
|
||||
|
||||
mpu_pd = pwrdm_lookup("mpu_pwrdm");
|
||||
|
@ -337,44 +363,52 @@ int __init omap3_idle_init(void)
|
|||
per_pd = pwrdm_lookup("per_pwrdm");
|
||||
cam_pd = pwrdm_lookup("cam_pwrdm");
|
||||
|
||||
cpuidle_register_driver(&omap3_idle_driver);
|
||||
|
||||
drv->safe_state_index = -1;
|
||||
dev = &per_cpu(omap3_idle_dev, smp_processor_id());
|
||||
|
||||
/* C1 . MPU WFI + Core active */
|
||||
cx = _fill_cstate(dev, 0, "MPU ON + CORE ON");
|
||||
(&dev->states[0])->enter = omap3_enter_idle;
|
||||
dev->safe_state = &dev->states[0];
|
||||
_fill_cstate(drv, 0, "MPU ON + CORE ON");
|
||||
(&drv->states[0])->enter = omap3_enter_idle;
|
||||
drv->safe_state_index = 0;
|
||||
cx = _fill_cstate_usage(dev, 0);
|
||||
cx->valid = 1; /* C1 is always valid */
|
||||
cx->mpu_state = PWRDM_POWER_ON;
|
||||
cx->core_state = PWRDM_POWER_ON;
|
||||
|
||||
/* C2 . MPU WFI + Core inactive */
|
||||
cx = _fill_cstate(dev, 1, "MPU ON + CORE ON");
|
||||
_fill_cstate(drv, 1, "MPU ON + CORE ON");
|
||||
cx = _fill_cstate_usage(dev, 1);
|
||||
cx->mpu_state = PWRDM_POWER_ON;
|
||||
cx->core_state = PWRDM_POWER_ON;
|
||||
|
||||
/* C3 . MPU CSWR + Core inactive */
|
||||
cx = _fill_cstate(dev, 2, "MPU RET + CORE ON");
|
||||
_fill_cstate(drv, 2, "MPU RET + CORE ON");
|
||||
cx = _fill_cstate_usage(dev, 2);
|
||||
cx->mpu_state = PWRDM_POWER_RET;
|
||||
cx->core_state = PWRDM_POWER_ON;
|
||||
|
||||
/* C4 . MPU OFF + Core inactive */
|
||||
cx = _fill_cstate(dev, 3, "MPU OFF + CORE ON");
|
||||
_fill_cstate(drv, 3, "MPU OFF + CORE ON");
|
||||
cx = _fill_cstate_usage(dev, 3);
|
||||
cx->mpu_state = PWRDM_POWER_OFF;
|
||||
cx->core_state = PWRDM_POWER_ON;
|
||||
|
||||
/* C5 . MPU RET + Core RET */
|
||||
cx = _fill_cstate(dev, 4, "MPU RET + CORE RET");
|
||||
_fill_cstate(drv, 4, "MPU RET + CORE RET");
|
||||
cx = _fill_cstate_usage(dev, 4);
|
||||
cx->mpu_state = PWRDM_POWER_RET;
|
||||
cx->core_state = PWRDM_POWER_RET;
|
||||
|
||||
/* C6 . MPU OFF + Core RET */
|
||||
cx = _fill_cstate(dev, 5, "MPU OFF + CORE RET");
|
||||
_fill_cstate(drv, 5, "MPU OFF + CORE RET");
|
||||
cx = _fill_cstate_usage(dev, 5);
|
||||
cx->mpu_state = PWRDM_POWER_OFF;
|
||||
cx->core_state = PWRDM_POWER_RET;
|
||||
|
||||
/* C7 . MPU OFF + Core OFF */
|
||||
cx = _fill_cstate(dev, 6, "MPU OFF + CORE OFF");
|
||||
_fill_cstate(drv, 6, "MPU OFF + CORE OFF");
|
||||
cx = _fill_cstate_usage(dev, 6);
|
||||
/*
|
||||
* Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot
|
||||
* enable OFF mode in a stable form for previous revisions.
|
||||
|
@ -388,6 +422,9 @@ int __init omap3_idle_init(void)
|
|||
cx->mpu_state = PWRDM_POWER_OFF;
|
||||
cx->core_state = PWRDM_POWER_OFF;
|
||||
|
||||
drv->state_count = OMAP3_NUM_STATES;
|
||||
cpuidle_register_driver(&omap3_idle_driver);
|
||||
|
||||
dev->state_count = OMAP3_NUM_STATES;
|
||||
if (cpuidle_register_device(dev)) {
|
||||
printk(KERN_ERR "%s: CPUidle register device failed\n",
|
||||
|
|
|
@ -318,18 +318,10 @@ static inline void omap_init_audio(void) {}
|
|||
#if defined(CONFIG_SND_OMAP_SOC_MCPDM) || \
|
||||
defined(CONFIG_SND_OMAP_SOC_MCPDM_MODULE)
|
||||
|
||||
static struct omap_device_pm_latency omap_mcpdm_latency[] = {
|
||||
{
|
||||
.deactivate_func = omap_device_idle_hwmods,
|
||||
.activate_func = omap_device_enable_hwmods,
|
||||
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
|
||||
},
|
||||
};
|
||||
|
||||
static void omap_init_mcpdm(void)
|
||||
{
|
||||
struct omap_hwmod *oh;
|
||||
struct omap_device *od;
|
||||
struct platform_device *pdev;
|
||||
|
||||
oh = omap_hwmod_lookup("mcpdm");
|
||||
if (!oh) {
|
||||
|
@ -337,11 +329,8 @@ static void omap_init_mcpdm(void)
|
|||
return;
|
||||
}
|
||||
|
||||
od = omap_device_build("omap-mcpdm", -1, oh, NULL, 0,
|
||||
omap_mcpdm_latency,
|
||||
ARRAY_SIZE(omap_mcpdm_latency), 0);
|
||||
if (IS_ERR(od))
|
||||
printk(KERN_ERR "Could not build omap_device for omap-mcpdm-dai\n");
|
||||
pdev = omap_device_build("omap-mcpdm", -1, oh, NULL, 0, NULL, 0, 0);
|
||||
WARN(IS_ERR(pdev), "Can't build omap_device for omap-mcpdm.\n");
|
||||
}
|
||||
#else
|
||||
static inline void omap_init_mcpdm(void) {}
|
||||
|
|
|
@ -390,7 +390,8 @@ int omap3_noncore_dpll_enable(struct clk *clk)
|
|||
* propagating?
|
||||
*/
|
||||
if (!r)
|
||||
clk->rate = omap2_get_dpll_rate(clk);
|
||||
clk->rate = (clk->recalc) ? clk->recalc(clk) :
|
||||
omap2_get_dpll_rate(clk);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
@ -424,6 +425,7 @@ void omap3_noncore_dpll_disable(struct clk *clk)
|
|||
int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
struct clk *new_parent = NULL;
|
||||
unsigned long hw_rate;
|
||||
u16 freqsel = 0;
|
||||
struct dpll_data *dd;
|
||||
int ret;
|
||||
|
@ -435,7 +437,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
|
|||
if (!dd)
|
||||
return -EINVAL;
|
||||
|
||||
if (rate == omap2_get_dpll_rate(clk))
|
||||
hw_rate = (clk->recalc) ? clk->recalc(clk) : omap2_get_dpll_rate(clk);
|
||||
if (rate == hw_rate)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
@ -455,7 +458,7 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
|
|||
new_parent = dd->clk_bypass;
|
||||
} else {
|
||||
if (dd->last_rounded_rate != rate)
|
||||
omap2_dpll_round_rate(clk, rate);
|
||||
rate = clk->round_rate(clk, rate);
|
||||
|
||||
if (dd->last_rounded_rate == 0)
|
||||
return -EINVAL;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <plat/clock.h>
|
||||
|
||||
#include "clock.h"
|
||||
#include "clock44xx.h"
|
||||
#include "cm-regbits-44xx.h"
|
||||
|
||||
/* Supported only on OMAP4 */
|
||||
|
@ -82,3 +83,71 @@ const struct clkops clkops_omap4_dpllmx_ops = {
|
|||
.deny_idle = omap4_dpllmx_deny_gatectrl,
|
||||
};
|
||||
|
||||
/**
|
||||
* omap4_dpll_regm4xen_recalc - compute DPLL rate, considering REGM4XEN bit
|
||||
* @clk: struct clk * of the DPLL to compute the rate for
|
||||
*
|
||||
* Compute the output rate for the OMAP4 DPLL represented by @clk.
|
||||
* Takes the REGM4XEN bit into consideration, which is needed for the
|
||||
* OMAP4 ABE DPLL. Returns the DPLL's output rate (before M-dividers)
|
||||
* upon success, or 0 upon error.
|
||||
*/
|
||||
unsigned long omap4_dpll_regm4xen_recalc(struct clk *clk)
|
||||
{
|
||||
u32 v;
|
||||
unsigned long rate;
|
||||
struct dpll_data *dd;
|
||||
|
||||
if (!clk || !clk->dpll_data)
|
||||
return 0;
|
||||
|
||||
dd = clk->dpll_data;
|
||||
|
||||
rate = omap2_get_dpll_rate(clk);
|
||||
|
||||
/* regm4xen adds a multiplier of 4 to DPLL calculations */
|
||||
v = __raw_readl(dd->control_reg);
|
||||
if (v & OMAP4430_DPLL_REGM4XEN_MASK)
|
||||
rate *= OMAP4430_REGM4XEN_MULT;
|
||||
|
||||
return rate;
|
||||
}
|
||||
|
||||
/**
|
||||
* omap4_dpll_regm4xen_round_rate - round DPLL rate, considering REGM4XEN bit
|
||||
* @clk: struct clk * of the DPLL to round a rate for
|
||||
* @target_rate: the desired rate of the DPLL
|
||||
*
|
||||
* Compute the rate that would be programmed into the DPLL hardware
|
||||
* for @clk if set_rate() were to be provided with the rate
|
||||
* @target_rate. Takes the REGM4XEN bit into consideration, which is
|
||||
* needed for the OMAP4 ABE DPLL. Returns the rounded rate (before
|
||||
* M-dividers) upon success, -EINVAL if @clk is null or not a DPLL, or
|
||||
* ~0 if an error occurred in omap2_dpll_round_rate().
|
||||
*/
|
||||
long omap4_dpll_regm4xen_round_rate(struct clk *clk, unsigned long target_rate)
|
||||
{
|
||||
u32 v;
|
||||
struct dpll_data *dd;
|
||||
long r;
|
||||
|
||||
if (!clk || !clk->dpll_data)
|
||||
return -EINVAL;
|
||||
|
||||
dd = clk->dpll_data;
|
||||
|
||||
/* regm4xen adds a multiplier of 4 to DPLL calculations */
|
||||
v = __raw_readl(dd->control_reg) & OMAP4430_DPLL_REGM4XEN_MASK;
|
||||
|
||||
if (v)
|
||||
target_rate = target_rate / OMAP4430_REGM4XEN_MULT;
|
||||
|
||||
r = omap2_dpll_round_rate(clk, target_rate);
|
||||
if (r == ~0)
|
||||
return r;
|
||||
|
||||
if (v)
|
||||
clk->dpll_data->last_rounded_rate *= OMAP4430_REGM4XEN_MULT;
|
||||
|
||||
return clk->dpll_data->last_rounded_rate;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* of the OMAP PM core code.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include "cm2xxx_3xxx.h"
|
||||
#include "prm2xxx_3xxx.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue