Merge branch 'linus' into x86/x2apic
Conflicts: drivers/pci/dmar.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
commit
10a010f695
8
CREDITS
8
CREDITS
|
@ -317,6 +317,14 @@ S: 2322 37th Ave SW
|
|||
S: Seattle, Washington 98126-2010
|
||||
S: USA
|
||||
|
||||
N: Muli Ben-Yehuda
|
||||
E: mulix@mulix.org
|
||||
E: muli@il.ibm.com
|
||||
W: http://www.mulix.org
|
||||
D: trident OSS sound driver, x86-64 dma-ops and Calgary IOMMU,
|
||||
D: KVM and Xen bits and other misc. hackery.
|
||||
S: Haifa, Israel
|
||||
|
||||
N: Johannes Berg
|
||||
E: johannes@sipsolutions.net
|
||||
W: http://johannes.sipsolutions.net/
|
||||
|
|
20
Documentation/ABI/testing/sysfs-dev
Normal file
20
Documentation/ABI/testing/sysfs-dev
Normal file
|
@ -0,0 +1,20 @@
|
|||
What: /sys/dev
|
||||
Date: April 2008
|
||||
KernelVersion: 2.6.26
|
||||
Contact: Dan Williams <dan.j.williams@intel.com>
|
||||
Description: The /sys/dev tree provides a method to look up the sysfs
|
||||
path for a device using the information returned from
|
||||
stat(2). There are two directories, 'block' and 'char',
|
||||
beneath /sys/dev containing symbolic links with names of
|
||||
the form "<major>:<minor>". These links point to the
|
||||
corresponding sysfs path for the given device.
|
||||
|
||||
Example:
|
||||
$ readlink /sys/dev/block/8:32
|
||||
../../block/sdc
|
||||
|
||||
Entries in /sys/dev/char and /sys/dev/block will be
|
||||
dynamically created and destroyed as devices enter and
|
||||
leave the system.
|
||||
|
||||
Users: mdadm <linux-raid@vger.kernel.org>
|
24
Documentation/ABI/testing/sysfs-devices-memory
Normal file
24
Documentation/ABI/testing/sysfs-devices-memory
Normal file
|
@ -0,0 +1,24 @@
|
|||
What: /sys/devices/system/memory
|
||||
Date: June 2008
|
||||
Contact: Badari Pulavarty <pbadari@us.ibm.com>
|
||||
Description:
|
||||
The /sys/devices/system/memory contains a snapshot of the
|
||||
internal state of the kernel memory blocks. Files could be
|
||||
added or removed dynamically to represent hot-add/remove
|
||||
operations.
|
||||
|
||||
Users: hotplug memory add/remove tools
|
||||
https://w3.opensource.ibm.com/projects/powerpc-utils/
|
||||
|
||||
What: /sys/devices/system/memory/memoryX/removable
|
||||
Date: June 2008
|
||||
Contact: Badari Pulavarty <pbadari@us.ibm.com>
|
||||
Description:
|
||||
The file /sys/devices/system/memory/memoryX/removable
|
||||
indicates whether this memory block is removable or not.
|
||||
This is useful for a user-level agent to determine
|
||||
identify removable sections of the memory before attempting
|
||||
potentially expensive hot-remove memory operation
|
||||
|
||||
Users: hotplug memory remove tools
|
||||
https://w3.opensource.ibm.com/projects/powerpc-utils/
|
6
Documentation/ABI/testing/sysfs-kernel-mm
Normal file
6
Documentation/ABI/testing/sysfs-kernel-mm
Normal file
|
@ -0,0 +1,6 @@
|
|||
What: /sys/kernel/mm
|
||||
Date: July 2008
|
||||
Contact: Nishanth Aravamudan <nacc@us.ibm.com>, VM maintainers
|
||||
Description:
|
||||
/sys/kernel/mm/ should contain any and all VM
|
||||
related information in /sys/kernel/.
|
15
Documentation/ABI/testing/sysfs-kernel-mm-hugepages
Normal file
15
Documentation/ABI/testing/sysfs-kernel-mm-hugepages
Normal file
|
@ -0,0 +1,15 @@
|
|||
What: /sys/kernel/mm/hugepages/
|
||||
Date: June 2008
|
||||
Contact: Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers
|
||||
Description:
|
||||
/sys/kernel/mm/hugepages/ contains a number of subdirectories
|
||||
of the form hugepages-<size>kB, where <size> is the page size
|
||||
of the hugepages supported by the kernel/CPU combination.
|
||||
|
||||
Under these directories are a number of files:
|
||||
nr_hugepages
|
||||
nr_overcommit_hugepages
|
||||
free_hugepages
|
||||
surplus_hugepages
|
||||
resv_hugepages
|
||||
See Documentation/vm/hugetlbpage.txt for details.
|
|
@ -22,3 +22,12 @@ ready and available in memory. The DMA of the "completion indication"
|
|||
could race with data DMA. Mapping the memory used for completion
|
||||
indications with DMA_ATTR_WRITE_BARRIER would prevent the race.
|
||||
|
||||
DMA_ATTR_WEAK_ORDERING
|
||||
----------------------
|
||||
|
||||
DMA_ATTR_WEAK_ORDERING specifies that reads and writes to the mapping
|
||||
may be weakly ordered, that is that reads and writes may pass each other.
|
||||
|
||||
Since it is optional for platforms to implement DMA_ATTR_WEAK_ORDERING,
|
||||
those that do not will simply ignore the attribute and exhibit default
|
||||
behavior.
|
||||
|
|
|
@ -219,10 +219,10 @@
|
|||
</para>
|
||||
|
||||
<sect1 id="lock-intro">
|
||||
<title>Three Main Types of Kernel Locks: Spinlocks, Mutexes and Semaphores</title>
|
||||
<title>Two Main Types of Kernel Locks: Spinlocks and Mutexes</title>
|
||||
|
||||
<para>
|
||||
There are three main types of kernel locks. The fundamental type
|
||||
There are two main types of kernel locks. The fundamental type
|
||||
is the spinlock
|
||||
(<filename class="headerfile">include/asm/spinlock.h</filename>),
|
||||
which is a very simple single-holder lock: if you can't get the
|
||||
|
@ -239,14 +239,6 @@
|
|||
can't sleep (see <xref linkend="sleeping-things"/>), and so have to
|
||||
use a spinlock instead.
|
||||
</para>
|
||||
<para>
|
||||
The third type is a semaphore
|
||||
(<filename class="headerfile">include/linux/semaphore.h</filename>): it
|
||||
can have more than one holder at any time (the number decided at
|
||||
initialization time), although it is most commonly used as a
|
||||
single-holder lock (a mutex). If you can't get a semaphore, your
|
||||
task will be suspended and later on woken up - just like for mutexes.
|
||||
</para>
|
||||
<para>
|
||||
Neither type of lock is recursive: see
|
||||
<xref linkend="deadlock"/>.
|
||||
|
@ -278,7 +270,7 @@
|
|||
</para>
|
||||
|
||||
<para>
|
||||
Semaphores still exist, because they are required for
|
||||
Mutexes still exist, because they are required for
|
||||
synchronization between <firstterm linkend="gloss-usercontext">user
|
||||
contexts</firstterm>, as we will see below.
|
||||
</para>
|
||||
|
@ -289,18 +281,17 @@
|
|||
|
||||
<para>
|
||||
If you have a data structure which is only ever accessed from
|
||||
user context, then you can use a simple semaphore
|
||||
(<filename>linux/linux/semaphore.h</filename>) to protect it. This
|
||||
is the most trivial case: you initialize the semaphore to the number
|
||||
of resources available (usually 1), and call
|
||||
<function>down_interruptible()</function> to grab the semaphore, and
|
||||
<function>up()</function> to release it. There is also a
|
||||
<function>down()</function>, which should be avoided, because it
|
||||
user context, then you can use a simple mutex
|
||||
(<filename>include/linux/mutex.h</filename>) to protect it. This
|
||||
is the most trivial case: you initialize the mutex. Then you can
|
||||
call <function>mutex_lock_interruptible()</function> to grab the mutex,
|
||||
and <function>mutex_unlock()</function> to release it. There is also a
|
||||
<function>mutex_lock()</function>, which should be avoided, because it
|
||||
will not return if a signal is received.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Example: <filename>linux/net/core/netfilter.c</filename> allows
|
||||
Example: <filename>net/netfilter/nf_sockopt.c</filename> allows
|
||||
registration of new <function>setsockopt()</function> and
|
||||
<function>getsockopt()</function> calls, with
|
||||
<function>nf_register_sockopt()</function>. Registration and
|
||||
|
@ -515,7 +506,7 @@
|
|||
<listitem>
|
||||
<para>
|
||||
If you are in a process context (any syscall) and want to
|
||||
lock other process out, use a semaphore. You can take a semaphore
|
||||
lock other process out, use a mutex. You can take a mutex
|
||||
and sleep (<function>copy_from_user*(</function> or
|
||||
<function>kmalloc(x,GFP_KERNEL)</function>).
|
||||
</para>
|
||||
|
@ -662,7 +653,7 @@
|
|||
<entry>SLBH</entry>
|
||||
<entry>SLBH</entry>
|
||||
<entry>SLBH</entry>
|
||||
<entry>DI</entry>
|
||||
<entry>MLI</entry>
|
||||
<entry>None</entry>
|
||||
</row>
|
||||
|
||||
|
@ -692,8 +683,8 @@
|
|||
<entry>spin_lock_bh</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>DI</entry>
|
||||
<entry>down_interruptible</entry>
|
||||
<entry>MLI</entry>
|
||||
<entry>mutex_lock_interruptible</entry>
|
||||
</row>
|
||||
|
||||
</tbody>
|
||||
|
@ -1310,7 +1301,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.
|
|||
<para>
|
||||
There is a coding bug where a piece of code tries to grab a
|
||||
spinlock twice: it will spin forever, waiting for the lock to
|
||||
be released (spinlocks, rwlocks and semaphores are not
|
||||
be released (spinlocks, rwlocks and mutexes are not
|
||||
recursive in Linux). This is trivial to diagnose: not a
|
||||
stay-up-five-nights-talk-to-fluffy-code-bunnies kind of
|
||||
problem.
|
||||
|
@ -1335,7 +1326,7 @@ as Alan Cox says, <quote>Lock data, not code</quote>.
|
|||
|
||||
<para>
|
||||
This complete lockup is easy to diagnose: on SMP boxes the
|
||||
watchdog timer or compiling with <symbol>DEBUG_SPINLOCKS</symbol> set
|
||||
watchdog timer or compiling with <symbol>DEBUG_SPINLOCK</symbol> set
|
||||
(<filename>include/linux/spinlock.h</filename>) will show this up
|
||||
immediately when it happens.
|
||||
</para>
|
||||
|
@ -1558,7 +1549,7 @@ the amount of locking which needs to be done.
|
|||
<title>Read/Write Lock Variants</title>
|
||||
|
||||
<para>
|
||||
Both spinlocks and semaphores have read/write variants:
|
||||
Both spinlocks and mutexes have read/write variants:
|
||||
<type>rwlock_t</type> and <structname>struct rw_semaphore</structname>.
|
||||
These divide users into two classes: the readers and the writers. If
|
||||
you are only reading the data, you can get a read lock, but to write to
|
||||
|
@ -1681,7 +1672,7 @@ the amount of locking which needs to be done.
|
|||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
+#include <linux/rcupdate.h>
|
||||
#include <linux/semaphore.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <asm/errno.h>
|
||||
|
||||
struct object
|
||||
|
@ -1913,7 +1904,7 @@ machines due to caching.
|
|||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<function> put_user()</function>
|
||||
<function>put_user()</function>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
@ -1927,13 +1918,13 @@ machines due to caching.
|
|||
|
||||
<listitem>
|
||||
<para>
|
||||
<function>down_interruptible()</function> and
|
||||
<function>down()</function>
|
||||
<function>mutex_lock_interruptible()</function> and
|
||||
<function>mutex_lock()</function>
|
||||
</para>
|
||||
<para>
|
||||
There is a <function>down_trylock()</function> which can be
|
||||
There is a <function>mutex_trylock()</function> which can be
|
||||
used inside interrupt context, as it will not sleep.
|
||||
<function>up()</function> will also never sleep.
|
||||
<function>mutex_unlock()</function> will also never sleep.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
@ -2023,7 +2014,7 @@ machines due to caching.
|
|||
<para>
|
||||
Prior to 2.5, or when <symbol>CONFIG_PREEMPT</symbol> is
|
||||
unset, processes in user context inside the kernel would not
|
||||
preempt each other (ie. you had that CPU until you have it up,
|
||||
preempt each other (ie. you had that CPU until you gave it up,
|
||||
except for interrupts). With the addition of
|
||||
<symbol>CONFIG_PREEMPT</symbol> in 2.5.4, this changed: when
|
||||
in user context, higher priority tasks can "cut in": spinlocks
|
||||
|
|
|
@ -21,6 +21,18 @@
|
|||
</affiliation>
|
||||
</author>
|
||||
|
||||
<copyright>
|
||||
<year>2006-2008</year>
|
||||
<holder>Hans-Jürgen Koch.</holder>
|
||||
</copyright>
|
||||
|
||||
<legalnotice>
|
||||
<para>
|
||||
This documentation is Free Software licensed under the terms of the
|
||||
GPL version 2.
|
||||
</para>
|
||||
</legalnotice>
|
||||
|
||||
<pubdate>2006-12-11</pubdate>
|
||||
|
||||
<abstract>
|
||||
|
@ -29,6 +41,12 @@
|
|||
</abstract>
|
||||
|
||||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>0.5</revnumber>
|
||||
<date>2008-05-22</date>
|
||||
<authorinitials>hjk</authorinitials>
|
||||
<revremark>Added description of write() function.</revremark>
|
||||
</revision>
|
||||
<revision>
|
||||
<revnumber>0.4</revnumber>
|
||||
<date>2007-11-26</date>
|
||||
|
@ -57,20 +75,9 @@
|
|||
</bookinfo>
|
||||
|
||||
<chapter id="aboutthisdoc">
|
||||
<?dbhtml filename="about.html"?>
|
||||
<?dbhtml filename="aboutthis.html"?>
|
||||
<title>About this document</title>
|
||||
|
||||
<sect1 id="copyright">
|
||||
<?dbhtml filename="copyright.html"?>
|
||||
<title>Copyright and License</title>
|
||||
<para>
|
||||
Copyright (c) 2006 by Hans-Jürgen Koch.</para>
|
||||
<para>
|
||||
This documentation is Free Software licensed under the terms of the
|
||||
GPL version 2.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="translations">
|
||||
<?dbhtml filename="translations.html"?>
|
||||
<title>Translations</title>
|
||||
|
@ -189,6 +196,30 @@ interested in translating it, please email me
|
|||
represents the total interrupt count. You can use this number
|
||||
to figure out if you missed some interrupts.
|
||||
</para>
|
||||
<para>
|
||||
For some hardware that has more than one interrupt source internally,
|
||||
but not separate IRQ mask and status registers, there might be
|
||||
situations where userspace cannot determine what the interrupt source
|
||||
was if the kernel handler disables them by writing to the chip's IRQ
|
||||
register. In such a case, the kernel has to disable the IRQ completely
|
||||
to leave the chip's register untouched. Now the userspace part can
|
||||
determine the cause of the interrupt, but it cannot re-enable
|
||||
interrupts. Another cornercase is chips where re-enabling interrupts
|
||||
is a read-modify-write operation to a combined IRQ status/acknowledge
|
||||
register. This would be racy if a new interrupt occurred
|
||||
simultaneously.
|
||||
</para>
|
||||
<para>
|
||||
To address these problems, UIO also implements a write() function. It
|
||||
is normally not used and can be ignored for hardware that has only a
|
||||
single interrupt source or has separate IRQ mask and status registers.
|
||||
If you need it, however, a write to <filename>/dev/uioX</filename>
|
||||
will call the <function>irqcontrol()</function> function implemented
|
||||
by the driver. You have to write a 32-bit value that is usually either
|
||||
0 or 1 to disable or enable interrupts. If a driver does not implement
|
||||
<function>irqcontrol()</function>, <function>write()</function> will
|
||||
return with <varname>-ENOSYS</varname>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To handle interrupts properly, your custom kernel module can
|
||||
|
@ -362,6 +393,14 @@ device is actually used.
|
|||
<function>open()</function>, you will probably also want a custom
|
||||
<function>release()</function> function.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<varname>int (*irqcontrol)(struct uio_info *info, s32 irq_on)
|
||||
</varname>: Optional. If you need to be able to enable or disable
|
||||
interrupts from userspace by writing to <filename>/dev/uioX</filename>,
|
||||
you can implement this function. The parameter <varname>irq_on</varname>
|
||||
will be 0 to disable interrupts and 1 to enable them.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
|
|
|
@ -358,7 +358,7 @@ Here is a list of some of the different kernel trees available:
|
|||
- pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
|
||||
git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
|
||||
|
||||
- SCSI, James Bottomley <James.Bottomley@SteelEye.com>
|
||||
- SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
|
||||
git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
|
||||
|
||||
- x86, Ingo Molnar <mingo@elte.hu>
|
||||
|
|
131
Documentation/fb/sh7760fb.txt
Normal file
131
Documentation/fb/sh7760fb.txt
Normal file
|
@ -0,0 +1,131 @@
|
|||
SH7760/SH7763 integrated LCDC Framebuffer driver
|
||||
================================================
|
||||
|
||||
0. Overwiew
|
||||
-----------
|
||||
The SH7760/SH7763 have an integrated LCD Display controller (LCDC) which
|
||||
supports (in theory) resolutions ranging from 1x1 to 1024x1024,
|
||||
with color depths ranging from 1 to 16 bits, on STN, DSTN and TFT Panels.
|
||||
|
||||
Caveats:
|
||||
* Framebuffer memory must be a large chunk allocated at the top
|
||||
of Area3 (HW requirement). Because of this requirement you should NOT
|
||||
make the driver a module since at runtime it may become impossible to
|
||||
get a large enough contiguous chunk of memory.
|
||||
|
||||
* The driver does not support changing resolution while loaded
|
||||
(displays aren't hotpluggable anyway)
|
||||
|
||||
* Heavy flickering may be observed
|
||||
a) if you're using 15/16bit color modes at >= 640x480 px resolutions,
|
||||
b) during PCMCIA (or any other slow bus) activity.
|
||||
|
||||
* Rotation works only 90degress clockwise, and only if horizontal
|
||||
resolution is <= 320 pixels.
|
||||
|
||||
files: drivers/video/sh7760fb.c
|
||||
include/asm-sh/sh7760fb.h
|
||||
Documentation/fb/sh7760fb.txt
|
||||
|
||||
1. Platform setup
|
||||
-----------------
|
||||
SH7760:
|
||||
Video data is fetched via the DMABRG DMA engine, so you have to
|
||||
configure the SH DMAC for DMABRG mode (write 0x94808080 to the
|
||||
DMARSRA register somewhere at boot).
|
||||
|
||||
PFC registers PCCR and PCDR must be set to peripheral mode.
|
||||
(write zeros to both).
|
||||
|
||||
The driver does NOT do the above for you since board setup is, well, job
|
||||
of the board setup code.
|
||||
|
||||
2. Panel definitions
|
||||
--------------------
|
||||
The LCDC must explicitly be told about the type of LCD panel
|
||||
attached. Data must be wrapped in a "struct sh7760fb_platdata" and
|
||||
passed to the driver as platform_data.
|
||||
|
||||
Suggest you take a closer look at the SH7760 Manual, Section 30.
|
||||
(http://documentation.renesas.com/eng/products/mpumcu/e602291_sh7760.pdf)
|
||||
|
||||
The following code illustrates what needs to be done to
|
||||
get the framebuffer working on a 640x480 TFT:
|
||||
|
||||
====================== cut here ======================================
|
||||
|
||||
#include <linux/fb.h>
|
||||
#include <asm/sh7760fb.h>
|
||||
|
||||
/*
|
||||
* NEC NL6440bc26-01 640x480 TFT
|
||||
* dotclock 25175 kHz
|
||||
* Xres 640 Yres 480
|
||||
* Htotal 800 Vtotal 525
|
||||
* HsynStart 656 VsynStart 490
|
||||
* HsynLenn 30 VsynLenn 2
|
||||
*
|
||||
* The linux framebuffer layer does not use the syncstart/synclen
|
||||
* values but right/left/upper/lower margin values. The comments
|
||||
* for the x_margin explain how to calculate those from given
|
||||
* panel sync timings.
|
||||
*/
|
||||
static struct fb_videomode nl6448bc26 = {
|
||||
.name = "NL6448BC26",
|
||||
.refresh = 60,
|
||||
.xres = 640,
|
||||
.yres = 480,
|
||||
.pixclock = 39683, /* in picoseconds! */
|
||||
.hsync_len = 30,
|
||||
.vsync_len = 2,
|
||||
.left_margin = 114, /* HTOT - (HSYNSLEN + HSYNSTART) */
|
||||
.right_margin = 16, /* HSYNSTART - XRES */
|
||||
.upper_margin = 33, /* VTOT - (VSYNLEN + VSYNSTART) */
|
||||
.lower_margin = 10, /* VSYNSTART - YRES */
|
||||
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
|
||||
.vmode = FB_VMODE_NONINTERLACED,
|
||||
.flag = 0,
|
||||
};
|
||||
|
||||
static struct sh7760fb_platdata sh7760fb_nl6448 = {
|
||||
.def_mode = &nl6448bc26,
|
||||
.ldmtr = LDMTR_TFT_COLOR_16, /* 16bit TFT panel */
|
||||
.lddfr = LDDFR_8BPP, /* we want 8bit output */
|
||||
.ldpmmr = 0x0070,
|
||||
.ldpspr = 0x0500,
|
||||
.ldaclnr = 0,
|
||||
.ldickr = LDICKR_CLKSRC(LCDC_CLKSRC_EXTERNAL) |
|
||||
LDICKR_CLKDIV(1),
|
||||
.rotate = 0,
|
||||
.novsync = 1,
|
||||
.blank = NULL,
|
||||
};
|
||||
|
||||
/* SH7760:
|
||||
* 0xFE300800: 256 * 4byte xRGB palette ram
|
||||
* 0xFE300C00: 42 bytes ctrl registers
|
||||
*/
|
||||
static struct resource sh7760_lcdc_res[] = {
|
||||
[0] = {
|
||||
.start = 0xFE300800,
|
||||
.end = 0xFE300CFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = 65,
|
||||
.end = 65,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device sh7760_lcdc_dev = {
|
||||
.dev = {
|
||||
.platform_data = &sh7760fb_nl6448,
|
||||
},
|
||||
.name = "sh7760-lcdc",
|
||||
.id = -1,
|
||||
.resource = sh7760_lcdc_res,
|
||||
.num_resources = ARRAY_SIZE(sh7760_lcdc_res),
|
||||
};
|
||||
|
||||
====================== cut here ======================================
|
|
@ -3,11 +3,25 @@ Tridentfb is a framebuffer driver for some Trident chip based cards.
|
|||
The following list of chips is thought to be supported although not all are
|
||||
tested:
|
||||
|
||||
those from the Image series with Cyber in their names - accelerated
|
||||
those with Blade in their names (Blade3D,CyberBlade...) - accelerated
|
||||
the newer CyberBladeXP family - nonaccelerated
|
||||
those from the TGUI series 9440/96XX and with Cyber in their names
|
||||
those from the Image series and with Cyber in their names
|
||||
those with Blade in their names (Blade3D,CyberBlade...)
|
||||
the newer CyberBladeXP family
|
||||
|
||||
Only PCI/AGP based cards are supported, none of the older Tridents.
|
||||
All families are accelerated. Only PCI/AGP based cards are supported,
|
||||
none of the older Tridents.
|
||||
The driver supports 8, 16 and 32 bits per pixel depths.
|
||||
The TGUI family requires a line length to be power of 2 if acceleration
|
||||
is enabled. This means that range of possible resolutions and bpp is
|
||||
limited comparing to the range if acceleration is disabled (see list
|
||||
of parameters below).
|
||||
|
||||
Known bugs:
|
||||
1. The driver randomly locks up on 3DImage975 chip with acceleration
|
||||
enabled. The same happens in X11 (Xorg).
|
||||
2. The ramdac speeds require some more fine tuning. It is possible to
|
||||
switch resolution which the chip does not support at some depths for
|
||||
older chips.
|
||||
|
||||
How to use it?
|
||||
==============
|
||||
|
@ -17,12 +31,11 @@ video=tridentfb
|
|||
|
||||
The parameters for tridentfb are concatenated with a ':' as in this example.
|
||||
|
||||
video=tridentfb:800x600,bpp=16,noaccel
|
||||
video=tridentfb:800x600-16@75,noaccel
|
||||
|
||||
The second level parameters that tridentfb understands are:
|
||||
|
||||
noaccel - turns off acceleration (when it doesn't work for your card)
|
||||
accel - force text acceleration (for boards which by default are noacceled)
|
||||
|
||||
fp - use flat panel related stuff
|
||||
crt - assume monitor is present instead of fp
|
||||
|
@ -31,21 +44,24 @@ center - for flat panels and resolutions smaller than native size center the
|
|||
image, otherwise use
|
||||
stretch
|
||||
|
||||
memsize - integer value in Kb, use if your card's memory size is misdetected.
|
||||
memsize - integer value in KB, use if your card's memory size is misdetected.
|
||||
look at the driver output to see what it says when initializing.
|
||||
memdiff - integer value in Kb,should be nonzero if your card reports
|
||||
more memory than it actually has.For instance mine is 192K less than
|
||||
|
||||
memdiff - integer value in KB, should be nonzero if your card reports
|
||||
more memory than it actually has. For instance mine is 192K less than
|
||||
detection says in all three BIOS selectable situations 2M, 4M, 8M.
|
||||
Only use if your video memory is taken from main memory hence of
|
||||
configurable size.Otherwise use memsize.
|
||||
If in some modes which barely fit the memory you see garbage at the bottom
|
||||
this might help by not letting change to that mode anymore.
|
||||
configurable size. Otherwise use memsize.
|
||||
If in some modes which barely fit the memory you see garbage
|
||||
at the bottom this might help by not letting change to that mode
|
||||
anymore.
|
||||
|
||||
nativex - the width in pixels of the flat panel.If you know it (usually 1024
|
||||
800 or 1280) and it is not what the driver seems to detect use it.
|
||||
|
||||
bpp - bits per pixel (8,16 or 32)
|
||||
mode - a mode name like 800x600 (as described in Documentation/fb/modedb.txt)
|
||||
bpp - bits per pixel (8,16 or 32)
|
||||
mode - a mode name like 800x600-8@75 as described in
|
||||
Documentation/fb/modedb.txt
|
||||
|
||||
Using insane values for the above parameters will probably result in driver
|
||||
misbehaviour so take care(for instance memsize=12345678 or memdiff=23784 or
|
||||
|
|
|
@ -300,14 +300,6 @@ Who: ocfs2-devel@oss.oracle.com
|
|||
|
||||
---------------------------
|
||||
|
||||
What: asm/semaphore.h
|
||||
When: 2.6.26
|
||||
Why: Implementation became generic; users should now include
|
||||
linux/semaphore.h instead.
|
||||
Who: Matthew Wilcox <willy@linux.intel.com>
|
||||
|
||||
---------------------------
|
||||
|
||||
What: SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD,
|
||||
SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD
|
||||
When: June 2009
|
||||
|
|
|
@ -510,6 +510,7 @@ prototypes:
|
|||
void (*close)(struct vm_area_struct*);
|
||||
int (*fault)(struct vm_area_struct*, struct vm_fault *);
|
||||
int (*page_mkwrite)(struct vm_area_struct *, struct page *);
|
||||
int (*access)(struct vm_area_struct *, unsigned long, void*, int, int);
|
||||
|
||||
locking rules:
|
||||
BKL mmap_sem PageLocked(page)
|
||||
|
@ -517,6 +518,7 @@ open: no yes
|
|||
close: no yes
|
||||
fault: no yes
|
||||
page_mkwrite: no yes no
|
||||
access: no yes
|
||||
|
||||
->page_mkwrite() is called when a previously read-only page is
|
||||
about to become writeable. The file system is responsible for
|
||||
|
@ -525,6 +527,11 @@ taking to lock out truncate, the page range should be verified to be
|
|||
within i_size. The page mapping should also be checked that it is not
|
||||
NULL.
|
||||
|
||||
->access() is called when get_user_pages() fails in
|
||||
acces_process_vm(), typically used to debug a process through
|
||||
/proc/pid/mem or ptrace. This function is needed only for
|
||||
VM_IO | VM_PFNMAP VMAs.
|
||||
|
||||
================================================================================
|
||||
Dubious stuff
|
||||
|
||||
|
|
|
@ -26,11 +26,11 @@ You can simplify mounting by just typing:
|
|||
|
||||
this will allocate the first available loopback device (and load loop.o
|
||||
kernel module if necessary) automatically. If the loopback driver is not
|
||||
loaded automatically, make sure that your kernel is compiled with kmod
|
||||
support (CONFIG_KMOD) enabled. Beware that umount will not
|
||||
deallocate /dev/loopN device if /etc/mtab file on your system is a
|
||||
symbolic link to /proc/mounts. You will need to do it manually using
|
||||
"-d" switch of losetup(8). Read losetup(8) manpage for more info.
|
||||
loaded automatically, make sure that you have compiled the module and
|
||||
that modprobe is functioning. Beware that umount will not deallocate
|
||||
/dev/loopN device if /etc/mtab file on your system is a symbolic link to
|
||||
/proc/mounts. You will need to do it manually using "-d" switch of
|
||||
losetup(8). Read losetup(8) manpage for more info.
|
||||
|
||||
To create the BFS image under UnixWare you need to find out first which
|
||||
slice contains it. The command prtvtoc(1M) is your friend:
|
||||
|
|
|
@ -296,6 +296,7 @@ Table 1-4: Kernel info in /proc
|
|||
uptime System uptime
|
||||
version Kernel version
|
||||
video bttv info of video resources (2.4)
|
||||
vmallocinfo Show vmalloced areas
|
||||
..............................................................................
|
||||
|
||||
You can, for example, check which interrupts are currently in use and what
|
||||
|
@ -557,6 +558,49 @@ VmallocTotal: total size of vmalloc memory area
|
|||
VmallocUsed: amount of vmalloc area which is used
|
||||
VmallocChunk: largest contigious block of vmalloc area which is free
|
||||
|
||||
..............................................................................
|
||||
|
||||
vmallocinfo:
|
||||
|
||||
Provides information about vmalloced/vmaped areas. One line per area,
|
||||
containing the virtual address range of the area, size in bytes,
|
||||
caller information of the creator, and optional information depending
|
||||
on the kind of area :
|
||||
|
||||
pages=nr number of pages
|
||||
phys=addr if a physical address was specified
|
||||
ioremap I/O mapping (ioremap() and friends)
|
||||
vmalloc vmalloc() area
|
||||
vmap vmap()ed pages
|
||||
user VM_USERMAP area
|
||||
vpages buffer for pages pointers was vmalloced (huge area)
|
||||
N<node>=nr (Only on NUMA kernels)
|
||||
Number of pages allocated on memory node <node>
|
||||
|
||||
> cat /proc/vmallocinfo
|
||||
0xffffc20000000000-0xffffc20000201000 2101248 alloc_large_system_hash+0x204 ...
|
||||
/0x2c0 pages=512 vmalloc N0=128 N1=128 N2=128 N3=128
|
||||
0xffffc20000201000-0xffffc20000302000 1052672 alloc_large_system_hash+0x204 ...
|
||||
/0x2c0 pages=256 vmalloc N0=64 N1=64 N2=64 N3=64
|
||||
0xffffc20000302000-0xffffc20000304000 8192 acpi_tb_verify_table+0x21/0x4f...
|
||||
phys=7fee8000 ioremap
|
||||
0xffffc20000304000-0xffffc20000307000 12288 acpi_tb_verify_table+0x21/0x4f...
|
||||
phys=7fee7000 ioremap
|
||||
0xffffc2000031d000-0xffffc2000031f000 8192 init_vdso_vars+0x112/0x210
|
||||
0xffffc2000031f000-0xffffc2000032b000 49152 cramfs_uncompress_init+0x2e ...
|
||||
/0x80 pages=11 vmalloc N0=3 N1=3 N2=2 N3=3
|
||||
0xffffc2000033a000-0xffffc2000033d000 12288 sys_swapon+0x640/0xac0 ...
|
||||
pages=2 vmalloc N1=2
|
||||
0xffffc20000347000-0xffffc2000034c000 20480 xt_alloc_table_info+0xfe ...
|
||||
/0x130 [x_tables] pages=4 vmalloc N0=4
|
||||
0xffffffffa0000000-0xffffffffa000f000 61440 sys_init_module+0xc27/0x1d00 ...
|
||||
pages=14 vmalloc N2=14
|
||||
0xffffffffa000f000-0xffffffffa0014000 20480 sys_init_module+0xc27/0x1d00 ...
|
||||
pages=4 vmalloc N1=4
|
||||
0xffffffffa0014000-0xffffffffa0017000 12288 sys_init_module+0xc27/0x1d00 ...
|
||||
pages=2 vmalloc N1=2
|
||||
0xffffffffa0017000-0xffffffffa0022000 45056 sys_init_module+0xc27/0x1d00 ...
|
||||
pages=10 vmalloc N0=10
|
||||
|
||||
1.3 IDE devices in /proc/ide
|
||||
----------------------------
|
||||
|
|
|
@ -248,6 +248,7 @@ The top level sysfs directory looks like:
|
|||
block/
|
||||
bus/
|
||||
class/
|
||||
dev/
|
||||
devices/
|
||||
firmware/
|
||||
net/
|
||||
|
@ -274,6 +275,11 @@ fs/ contains a directory for some filesystems. Currently each
|
|||
filesystem wanting to export attributes must create its own hierarchy
|
||||
below fs/ (see ./fuse.txt for an example).
|
||||
|
||||
dev/ contains two directories char/ and block/. Inside these two
|
||||
directories there are symlinks named <major>:<minor>. These symlinks
|
||||
point to the sysfs directory for the given device. /sys/dev provides a
|
||||
quick way to lookup the sysfs interface for a device from the result of
|
||||
a stat(2) operation.
|
||||
|
||||
More information can driver-model specific features can be found in
|
||||
Documentation/driver-model/.
|
||||
|
|
|
@ -87,7 +87,8 @@ parameter is applicable:
|
|||
SH SuperH architecture is enabled.
|
||||
SMP The kernel is an SMP kernel.
|
||||
SPARC Sparc architecture is enabled.
|
||||
SWSUSP Software suspend is enabled.
|
||||
SWSUSP Software suspend (hibernation) is enabled.
|
||||
SUSPEND System suspend states are enabled.
|
||||
TS Appropriate touchscreen support is enabled.
|
||||
USB USB support is enabled.
|
||||
USBHID USB Human Interface Device support is enabled.
|
||||
|
@ -147,10 +148,12 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
default: 0
|
||||
|
||||
acpi_sleep= [HW,ACPI] Sleep options
|
||||
Format: { s3_bios, s3_mode, s3_beep, old_ordering }
|
||||
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering }
|
||||
See Documentation/power/video.txt for s3_bios and s3_mode.
|
||||
s3_beep is for debugging; it makes the PC's speaker beep
|
||||
as soon as the kernel's real-mode entry point is called.
|
||||
s4_nohwsig prevents ACPI hardware signature from being
|
||||
used during resume from hibernation.
|
||||
old_ordering causes the ACPI 1.0 ordering of the _PTS
|
||||
control method, wrt putting devices into low power
|
||||
states, to be enforced (the ACPI 2.0 ordering of _PTS is
|
||||
|
@ -774,8 +777,22 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
hisax= [HW,ISDN]
|
||||
See Documentation/isdn/README.HiSax.
|
||||
|
||||
hugepages= [HW,X86-32,IA-64] Maximal number of HugeTLB pages.
|
||||
hugepagesz= [HW,IA-64,PPC] The size of the HugeTLB pages.
|
||||
hugepages= [HW,X86-32,IA-64] HugeTLB pages to allocate at boot.
|
||||
hugepagesz= [HW,IA-64,PPC,X86-64] The size of the HugeTLB pages.
|
||||
On x86-64 and powerpc, this option can be specified
|
||||
multiple times interleaved with hugepages= to reserve
|
||||
huge pages of different sizes. Valid pages sizes on
|
||||
x86-64 are 2M (when the CPU supports "pse") and 1G
|
||||
(when the CPU supports the "pdpe1gb" cpuinfo flag)
|
||||
Note that 1GB pages can only be allocated at boot time
|
||||
using hugepages= and not freed afterwards.
|
||||
default_hugepagesz=
|
||||
[same as hugepagesz=] The size of the default
|
||||
HugeTLB page size. This is the size represented by
|
||||
the legacy /proc/ hugepages APIs, used for SHM, and
|
||||
default size when mounting hugetlbfs filesystems.
|
||||
Defaults to the default architecture's huge page size
|
||||
if not specified.
|
||||
|
||||
i8042.direct [HW] Put keyboard port into non-translated mode
|
||||
i8042.dumbkbd [HW] Pretend that controller can only read data from
|
||||
|
@ -1225,6 +1242,14 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
|
||||
mga= [HW,DRM]
|
||||
|
||||
mminit_loglevel=
|
||||
[KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
|
||||
parameter allows control of the logging verbosity for
|
||||
the additional memory initialisation checks. A value
|
||||
of 0 disables mminit logging and a level of 4 will
|
||||
log everything. Information is printed at KERN_DEBUG
|
||||
so loglevel=8 may also need to be specified.
|
||||
|
||||
mousedev.tap_time=
|
||||
[MOUSE] Maximum time between finger touching and
|
||||
leaving touchpad surface for touch to be considered
|
||||
|
@ -2040,6 +2065,9 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
|
||||
snd-ymfpci= [HW,ALSA]
|
||||
|
||||
softlockup_panic=
|
||||
[KNL] Should the soft-lockup detector generate panics.
|
||||
|
||||
sonypi.*= [HW] Sony Programmable I/O Control Device driver
|
||||
See Documentation/sonypi.txt
|
||||
|
||||
|
@ -2104,6 +2132,12 @@ and is between 256 and 4096 characters. It is defined in the file
|
|||
|
||||
tdfx= [HW,DRM]
|
||||
|
||||
test_suspend= [SUSPEND]
|
||||
Specify "mem" (for Suspend-to-RAM) or "standby" (for
|
||||
standby suspend) as the system sleep state to briefly
|
||||
enter during system startup. The system is woken from
|
||||
this state using a wakeup-capable RTC alarm.
|
||||
|
||||
thash_entries= [KNL,NET]
|
||||
Set number of hash buckets for TCP connection
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ThinkPad ACPI Extras Driver
|
||||
|
||||
Version 0.20
|
||||
April 09th, 2008
|
||||
Version 0.21
|
||||
May 29th, 2008
|
||||
|
||||
Borislav Deianov <borislav@users.sf.net>
|
||||
Henrique de Moraes Holschuh <hmh@hmh.eng.br>
|
||||
|
@ -621,7 +621,8 @@ Bluetooth
|
|||
---------
|
||||
|
||||
procfs: /proc/acpi/ibm/bluetooth
|
||||
sysfs device attribute: bluetooth_enable
|
||||
sysfs device attribute: bluetooth_enable (deprecated)
|
||||
sysfs rfkill class: switch "tpacpi_bluetooth_sw"
|
||||
|
||||
This feature shows the presence and current state of a ThinkPad
|
||||
Bluetooth device in the internal ThinkPad CDC slot.
|
||||
|
@ -643,8 +644,12 @@ Sysfs notes:
|
|||
0: disables Bluetooth / Bluetooth is disabled
|
||||
1: enables Bluetooth / Bluetooth is enabled.
|
||||
|
||||
Note: this interface will be probably be superseded by the
|
||||
generic rfkill class, so it is NOT to be considered stable yet.
|
||||
Note: this interface has been superseded by the generic rfkill
|
||||
class. It has been deprecated, and it will be removed in year
|
||||
2010.
|
||||
|
||||
rfkill controller switch "tpacpi_bluetooth_sw": refer to
|
||||
Documentation/rfkill.txt for details.
|
||||
|
||||
Video output control -- /proc/acpi/ibm/video
|
||||
--------------------------------------------
|
||||
|
@ -1374,7 +1379,8 @@ EXPERIMENTAL: WAN
|
|||
-----------------
|
||||
|
||||
procfs: /proc/acpi/ibm/wan
|
||||
sysfs device attribute: wwan_enable
|
||||
sysfs device attribute: wwan_enable (deprecated)
|
||||
sysfs rfkill class: switch "tpacpi_wwan_sw"
|
||||
|
||||
This feature is marked EXPERIMENTAL because the implementation
|
||||
directly accesses hardware registers and may not work as expected. USE
|
||||
|
@ -1404,8 +1410,12 @@ Sysfs notes:
|
|||
0: disables WWAN card / WWAN card is disabled
|
||||
1: enables WWAN card / WWAN card is enabled.
|
||||
|
||||
Note: this interface will be probably be superseded by the
|
||||
generic rfkill class, so it is NOT to be considered stable yet.
|
||||
Note: this interface has been superseded by the generic rfkill
|
||||
class. It has been deprecated, and it will be removed in year
|
||||
2010.
|
||||
|
||||
rfkill controller switch "tpacpi_wwan_sw": refer to
|
||||
Documentation/rfkill.txt for details.
|
||||
|
||||
Multiple Commands, Module Parameters
|
||||
------------------------------------
|
||||
|
|
|
@ -513,21 +513,11 @@ Additional Configurations
|
|||
Intel(R) PRO/1000 PT Dual Port Server Connection
|
||||
Intel(R) PRO/1000 PT Dual Port Server Adapter
|
||||
Intel(R) PRO/1000 PF Dual Port Server Adapter
|
||||
Intel(R) PRO/1000 PT Quad Port Server Adapter
|
||||
Intel(R) PRO/1000 PT Quad Port Server Adapter
|
||||
|
||||
NAPI
|
||||
----
|
||||
NAPI (Rx polling mode) is supported in the e1000 driver. NAPI is enabled
|
||||
or disabled based on the configuration of the kernel. To override
|
||||
the default, use the following compile-time flags.
|
||||
|
||||
To enable NAPI, compile the driver module, passing in a configuration option:
|
||||
|
||||
make CFLAGS_EXTRA=-DE1000_NAPI install
|
||||
|
||||
To disable NAPI, compile the driver module, passing in a configuration option:
|
||||
|
||||
make CFLAGS_EXTRA=-DE1000_NO_NAPI install
|
||||
NAPI (Rx polling mode) is enabled in the e1000 driver.
|
||||
|
||||
See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI.
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...);
|
||||
|
||||
is meaningless (as in TCP). Packets with a zero checksum field are
|
||||
illegal (cf. RFC 3828, sec. 3.1) will be silently discarded.
|
||||
illegal (cf. RFC 3828, sec. 3.1) and will be silently discarded.
|
||||
|
||||
4) Fragmentation
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
00-INDEX
|
||||
- This file
|
||||
apm-acpi.txt
|
||||
- basic info about the APM and ACPI support.
|
||||
basic-pm-debugging.txt
|
||||
- Debugging suspend and resume
|
||||
devices.txt
|
||||
|
@ -14,8 +16,6 @@ notifiers.txt
|
|||
- Registering suspend notifiers in device drivers
|
||||
pci.txt
|
||||
- How the PCI Subsystem Does Power Management
|
||||
pm.txt
|
||||
- info on Linux power management support.
|
||||
pm_qos_interface.txt
|
||||
- info on Linux PM Quality of Service interface
|
||||
power_supply_class.txt
|
||||
|
|
32
Documentation/power/apm-acpi.txt
Normal file
32
Documentation/power/apm-acpi.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
APM or ACPI?
|
||||
------------
|
||||
If you have a relatively recent x86 mobile, desktop, or server system,
|
||||
odds are it supports either Advanced Power Management (APM) or
|
||||
Advanced Configuration and Power Interface (ACPI). ACPI is the newer
|
||||
of the two technologies and puts power management in the hands of the
|
||||
operating system, allowing for more intelligent power management than
|
||||
is possible with BIOS controlled APM.
|
||||
|
||||
The best way to determine which, if either, your system supports is to
|
||||
build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is
|
||||
enabled by default). If a working ACPI implementation is found, the
|
||||
ACPI driver will override and disable APM, otherwise the APM driver
|
||||
will be used.
|
||||
|
||||
No, sorry, you cannot have both ACPI and APM enabled and running at
|
||||
once. Some people with broken ACPI or broken APM implementations
|
||||
would like to use both to get a full set of working features, but you
|
||||
simply cannot mix and match the two. Only one power management
|
||||
interface can be in control of the machine at once. Think about it..
|
||||
|
||||
User-space Daemons
|
||||
------------------
|
||||
Both APM and ACPI rely on user-space daemons, apmd and acpid
|
||||
respectively, to be completely functional. Obtain both of these
|
||||
daemons from your Linux distribution or from the Internet (see below)
|
||||
and be sure that they are started sometime in the system boot process.
|
||||
Go ahead and start both. If ACPI or APM is not available on your
|
||||
system the associated daemon will exit gracefully.
|
||||
|
||||
apmd: http://worldvisions.ca/~apenwarr/apmd/
|
||||
acpid: http://acpid.sf.net/
|
|
@ -1,257 +0,0 @@
|
|||
Linux Power Management Support
|
||||
|
||||
This document briefly describes how to use power management with your
|
||||
Linux system and how to add power management support to Linux drivers.
|
||||
|
||||
APM or ACPI?
|
||||
------------
|
||||
If you have a relatively recent x86 mobile, desktop, or server system,
|
||||
odds are it supports either Advanced Power Management (APM) or
|
||||
Advanced Configuration and Power Interface (ACPI). ACPI is the newer
|
||||
of the two technologies and puts power management in the hands of the
|
||||
operating system, allowing for more intelligent power management than
|
||||
is possible with BIOS controlled APM.
|
||||
|
||||
The best way to determine which, if either, your system supports is to
|
||||
build a kernel with both ACPI and APM enabled (as of 2.3.x ACPI is
|
||||
enabled by default). If a working ACPI implementation is found, the
|
||||
ACPI driver will override and disable APM, otherwise the APM driver
|
||||
will be used.
|
||||
|
||||
No, sorry, you cannot have both ACPI and APM enabled and running at
|
||||
once. Some people with broken ACPI or broken APM implementations
|
||||
would like to use both to get a full set of working features, but you
|
||||
simply cannot mix and match the two. Only one power management
|
||||
interface can be in control of the machine at once. Think about it..
|
||||
|
||||
User-space Daemons
|
||||
------------------
|
||||
Both APM and ACPI rely on user-space daemons, apmd and acpid
|
||||
respectively, to be completely functional. Obtain both of these
|
||||
daemons from your Linux distribution or from the Internet (see below)
|
||||
and be sure that they are started sometime in the system boot process.
|
||||
Go ahead and start both. If ACPI or APM is not available on your
|
||||
system the associated daemon will exit gracefully.
|
||||
|
||||
apmd: http://worldvisions.ca/~apenwarr/apmd/
|
||||
acpid: http://acpid.sf.net/
|
||||
|
||||
Driver Interface -- OBSOLETE, DO NOT USE!
|
||||
----------------*************************
|
||||
|
||||
Note: pm_register(), pm_access(), pm_dev_idle() and friends are
|
||||
obsolete. Please do not use them. Instead you should properly hook
|
||||
your driver into the driver model, and use its suspend()/resume()
|
||||
callbacks to do this kind of stuff.
|
||||
|
||||
If you are writing a new driver or maintaining an old driver, it
|
||||
should include power management support. Without power management
|
||||
support, a single driver may prevent a system with power management
|
||||
capabilities from ever being able to suspend (safely).
|
||||
|
||||
Overview:
|
||||
1) Register each instance of a device with "pm_register"
|
||||
2) Call "pm_access" before accessing the hardware.
|
||||
(this will ensure that the hardware is awake and ready)
|
||||
3) Your "pm_callback" is called before going into a
|
||||
suspend state (ACPI D1-D3) or after resuming (ACPI D0)
|
||||
from a suspend.
|
||||
4) Call "pm_dev_idle" when the device is not being used
|
||||
(optional but will improve device idle detection)
|
||||
5) When unloaded, unregister the device with "pm_unregister"
|
||||
|
||||
/*
|
||||
* Description: Register a device with the power-management subsystem
|
||||
*
|
||||
* Parameters:
|
||||
* type - device type (PCI device, system device, ...)
|
||||
* id - instance number or unique identifier
|
||||
* cback - request handler callback (suspend, resume, ...)
|
||||
*
|
||||
* Returns: Registered PM device or NULL on error
|
||||
*
|
||||
* Examples:
|
||||
* dev = pm_register(PM_SYS_DEV, PM_SYS_VGA, vga_callback);
|
||||
*
|
||||
* struct pci_dev *pci_dev = pci_find_dev(...);
|
||||
* dev = pm_register(PM_PCI_DEV, PM_PCI_ID(pci_dev), callback);
|
||||
*/
|
||||
struct pm_dev *pm_register(pm_dev_t type, unsigned long id, pm_callback cback);
|
||||
|
||||
/*
|
||||
* Description: Unregister a device with the power management subsystem
|
||||
*
|
||||
* Parameters:
|
||||
* dev - PM device previously returned from pm_register
|
||||
*/
|
||||
void pm_unregister(struct pm_dev *dev);
|
||||
|
||||
/*
|
||||
* Description: Unregister all devices with a matching callback function
|
||||
*
|
||||
* Parameters:
|
||||
* cback - previously registered request callback
|
||||
*
|
||||
* Notes: Provided for easier porting from old APM interface
|
||||
*/
|
||||
void pm_unregister_all(pm_callback cback);
|
||||
|
||||
/*
|
||||
* Power management request callback
|
||||
*
|
||||
* Parameters:
|
||||
* dev - PM device previously returned from pm_register
|
||||
* rqst - request type
|
||||
* data - data, if any, associated with the request
|
||||
*
|
||||
* Returns: 0 if the request is successful
|
||||
* EINVAL if the request is not supported
|
||||
* EBUSY if the device is now busy and cannot handle the request
|
||||
* ENOMEM if the device was unable to handle the request due to memory
|
||||
*
|
||||
* Details: The device request callback will be called before the
|
||||
* device/system enters a suspend state (ACPI D1-D3) or
|
||||
* or after the device/system resumes from suspend (ACPI D0).
|
||||
* For PM_SUSPEND, the ACPI D-state being entered is passed
|
||||
* as the "data" argument to the callback. The device
|
||||
* driver should save (PM_SUSPEND) or restore (PM_RESUME)
|
||||
* device context when the request callback is called.
|
||||
*
|
||||
* Once a driver returns 0 (success) from a suspend
|
||||
* request, it should not process any further requests or
|
||||
* access the device hardware until a call to "pm_access" is made.
|
||||
*/
|
||||
typedef int (*pm_callback)(struct pm_dev *dev, pm_request_t rqst, void *data);
|
||||
|
||||
Driver Details
|
||||
--------------
|
||||
This is just a quick Q&A as a stopgap until a real driver writers'
|
||||
power management guide is available.
|
||||
|
||||
Q: When is a device suspended?
|
||||
|
||||
Devices can be suspended based on direct user request (eg. laptop lid
|
||||
closes), system power policy (eg. sleep after 30 minutes of console
|
||||
inactivity), or device power policy (eg. power down device after 5
|
||||
minutes of inactivity)
|
||||
|
||||
Q: Must a driver honor a suspend request?
|
||||
|
||||
No, a driver can return -EBUSY from a suspend request and this
|
||||
will stop the system from suspending. When a suspend request
|
||||
fails, all suspended devices are resumed and the system continues
|
||||
to run. Suspend can be retried at a later time.
|
||||
|
||||
Q: Can the driver block suspend/resume requests?
|
||||
|
||||
Yes, a driver can delay its return from a suspend or resume
|
||||
request until the device is ready to handle requests. It
|
||||
is advantageous to return as quickly as possible from a
|
||||
request as suspend/resume are done serially.
|
||||
|
||||
Q: What context is a suspend/resume initiated from?
|
||||
|
||||
A suspend or resume is initiated from a kernel thread context.
|
||||
It is safe to block, allocate memory, initiate requests
|
||||
or anything else you can do within the kernel.
|
||||
|
||||
Q: Will requests continue to arrive after a suspend?
|
||||
|
||||
Possibly. It is the driver's responsibility to queue(*),
|
||||
fail, or drop any requests that arrive after returning
|
||||
success to a suspend request. It is important that the
|
||||
driver not access its device until after it receives
|
||||
a resume request as the device's bus may no longer
|
||||
be active.
|
||||
|
||||
(*) If a driver queues requests for processing after
|
||||
resume be aware that the device, network, etc.
|
||||
might be in a different state than at suspend time.
|
||||
It's probably better to drop requests unless
|
||||
the driver is a storage device.
|
||||
|
||||
Q: Do I have to manage bus-specific power management registers
|
||||
|
||||
No. It is the responsibility of the bus driver to manage
|
||||
PCI, USB, etc. power management registers. The bus driver
|
||||
or the power management subsystem will also enable any
|
||||
wake-on functionality that the device has.
|
||||
|
||||
Q: So, really, what do I need to do to support suspend/resume?
|
||||
|
||||
You need to save any device context that would
|
||||
be lost if the device was powered off and then restore
|
||||
it at resume time. When ACPI is active, there are
|
||||
three levels of device suspend states; D1, D2, and D3.
|
||||
(The suspend state is passed as the "data" argument
|
||||
to the device callback.) With D3, the device is powered
|
||||
off and loses all context, D1 and D2 are shallower power
|
||||
states and require less device context to be saved. To
|
||||
play it safe, just save everything at suspend and restore
|
||||
everything at resume.
|
||||
|
||||
Q: Where do I store device context for suspend?
|
||||
|
||||
Anywhere in memory, kmalloc a buffer or store it
|
||||
in the device descriptor. You are guaranteed that the
|
||||
contents of memory will be restored and accessible
|
||||
before resume, even when the system suspends to disk.
|
||||
|
||||
Q: What do I need to do for ACPI vs. APM vs. etc?
|
||||
|
||||
Drivers need not be aware of the specific power management
|
||||
technology that is active. They just need to be aware
|
||||
of when the overlying power management system requests
|
||||
that they suspend or resume.
|
||||
|
||||
Q: What about device dependencies?
|
||||
|
||||
When a driver registers a device, the power management
|
||||
subsystem uses the information provided to build a
|
||||
tree of device dependencies (eg. USB device X is on
|
||||
USB controller Y which is on PCI bus Z) When power
|
||||
management wants to suspend a device, it first sends
|
||||
a suspend request to its driver, then the bus driver,
|
||||
and so on up to the system bus. Device resumes
|
||||
proceed in the opposite direction.
|
||||
|
||||
Q: Who do I contact for additional information about
|
||||
enabling power management for my specific driver/device?
|
||||
|
||||
ACPI Development mailing list: linux-acpi@vger.kernel.org
|
||||
|
||||
System Interface -- OBSOLETE, DO NOT USE!
|
||||
----------------*************************
|
||||
If you are providing new power management support to Linux (ie.
|
||||
adding support for something like APM or ACPI), you should
|
||||
communicate with drivers through the existing generic power
|
||||
management interface.
|
||||
|
||||
/*
|
||||
* Send a request to all devices
|
||||
*
|
||||
* Parameters:
|
||||
* rqst - request type
|
||||
* data - data, if any, associated with the request
|
||||
*
|
||||
* Returns: 0 if the request is successful
|
||||
* See "pm_callback" return for errors
|
||||
*
|
||||
* Details: Walk list of registered devices and call pm_send
|
||||
* for each until complete or an error is encountered.
|
||||
* If an error is encountered for a suspend request,
|
||||
* return all devices to the state they were in before
|
||||
* the suspend request.
|
||||
*/
|
||||
int pm_send_all(pm_request_t rqst, void *data);
|
||||
|
||||
/*
|
||||
* Find a matching device
|
||||
*
|
||||
* Parameters:
|
||||
* type - device type (PCI device, system device, or 0 to match all devices)
|
||||
* from - previous match or NULL to start from the beginning
|
||||
*
|
||||
* Returns: Matching device or NULL if none found
|
||||
*/
|
||||
struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from);
|
|
@ -89,10 +89,12 @@ Table of Contents
|
|||
3) OpenPIC Interrupt Controllers
|
||||
4) ISA Interrupt Controllers
|
||||
|
||||
VIII - Specifying GPIO information for devices
|
||||
IX - Specifying GPIO information for devices
|
||||
1) gpios property
|
||||
2) gpio-controller nodes
|
||||
|
||||
X - Specifying device power management information (sleep property)
|
||||
|
||||
Appendix A - Sample SOC node for MPC8540
|
||||
|
||||
|
||||
|
@ -2488,8 +2490,8 @@ encodings listed below:
|
|||
2 = high to low edge sensitive type enabled
|
||||
3 = low to high edge sensitive type enabled
|
||||
|
||||
VIII - Specifying GPIO information for devices
|
||||
==============================================
|
||||
IX - Specifying GPIO information for devices
|
||||
============================================
|
||||
|
||||
1) gpios property
|
||||
-----------------
|
||||
|
@ -2537,116 +2539,151 @@ Example of two SOC GPIO banks defined as gpio-controller nodes:
|
|||
gpio-controller;
|
||||
};
|
||||
|
||||
X - Specifying Device Power Management Information (sleep property)
|
||||
===================================================================
|
||||
|
||||
Devices on SOCs often have mechanisms for placing devices into low-power
|
||||
states that are decoupled from the devices' own register blocks. Sometimes,
|
||||
this information is more complicated than a cell-index property can
|
||||
reasonably describe. Thus, each device controlled in such a manner
|
||||
may contain a "sleep" property which describes these connections.
|
||||
|
||||
The sleep property consists of one or more sleep resources, each of
|
||||
which consists of a phandle to a sleep controller, followed by a
|
||||
controller-specific sleep specifier of zero or more cells.
|
||||
|
||||
The semantics of what type of low power modes are possible are defined
|
||||
by the sleep controller. Some examples of the types of low power modes
|
||||
that may be supported are:
|
||||
|
||||
- Dynamic: The device may be disabled or enabled at any time.
|
||||
- System Suspend: The device may request to be disabled or remain
|
||||
awake during system suspend, but will not be disabled until then.
|
||||
- Permanent: The device is disabled permanently (until the next hard
|
||||
reset).
|
||||
|
||||
Some devices may share a clock domain with each other, such that they should
|
||||
only be suspended when none of the devices are in use. Where reasonable,
|
||||
such nodes should be placed on a virtual bus, where the bus has the sleep
|
||||
property. If the clock domain is shared among devices that cannot be
|
||||
reasonably grouped in this manner, then create a virtual sleep controller
|
||||
(similar to an interrupt nexus, except that defining a standardized
|
||||
sleep-map should wait until its necessity is demonstrated).
|
||||
|
||||
Appendix A - Sample SOC node for MPC8540
|
||||
========================================
|
||||
|
||||
Note that the #address-cells and #size-cells for the SoC node
|
||||
in this example have been explicitly listed; these are likely
|
||||
not necessary as they are usually the same as the root node.
|
||||
|
||||
soc8540@e0000000 {
|
||||
soc@e0000000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
#interrupt-cells = <2>;
|
||||
compatible = "fsl,mpc8540-ccsr", "simple-bus";
|
||||
device_type = "soc";
|
||||
ranges = <00000000 e0000000 00100000>
|
||||
reg = <e0000000 00003000>;
|
||||
ranges = <0x00000000 0xe0000000 0x00100000>
|
||||
bus-frequency = <0>;
|
||||
|
||||
mdio@24520 {
|
||||
reg = <24520 20>;
|
||||
device_type = "mdio";
|
||||
compatible = "gianfar";
|
||||
|
||||
ethernet-phy@0 {
|
||||
linux,phandle = <2452000>
|
||||
interrupt-parent = <40000>;
|
||||
interrupts = <35 1>;
|
||||
reg = <0>;
|
||||
device_type = "ethernet-phy";
|
||||
};
|
||||
|
||||
ethernet-phy@1 {
|
||||
linux,phandle = <2452001>
|
||||
interrupt-parent = <40000>;
|
||||
interrupts = <35 1>;
|
||||
reg = <1>;
|
||||
device_type = "ethernet-phy";
|
||||
};
|
||||
|
||||
ethernet-phy@3 {
|
||||
linux,phandle = <2452002>
|
||||
interrupt-parent = <40000>;
|
||||
interrupts = <35 1>;
|
||||
reg = <3>;
|
||||
device_type = "ethernet-phy";
|
||||
};
|
||||
|
||||
};
|
||||
interrupt-parent = <&pic>;
|
||||
|
||||
ethernet@24000 {
|
||||
#size-cells = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
device_type = "network";
|
||||
model = "TSEC";
|
||||
compatible = "gianfar";
|
||||
reg = <24000 1000>;
|
||||
mac-address = [ 00 E0 0C 00 73 00 ];
|
||||
interrupts = <d 3 e 3 12 3>;
|
||||
interrupt-parent = <40000>;
|
||||
phy-handle = <2452000>;
|
||||
compatible = "gianfar", "simple-bus";
|
||||
reg = <0x24000 0x1000>;
|
||||
local-mac-address = [ 00 E0 0C 00 73 00 ];
|
||||
interrupts = <29 2 30 2 34 2>;
|
||||
phy-handle = <&phy0>;
|
||||
sleep = <&pmc 00000080>;
|
||||
ranges;
|
||||
|
||||
mdio@24520 {
|
||||
reg = <0x24520 0x20>;
|
||||
compatible = "fsl,gianfar-mdio";
|
||||
|
||||
phy0: ethernet-phy@0 {
|
||||
interrupts = <5 1>;
|
||||
reg = <0>;
|
||||
device_type = "ethernet-phy";
|
||||
};
|
||||
|
||||
phy1: ethernet-phy@1 {
|
||||
interrupts = <5 1>;
|
||||
reg = <1>;
|
||||
device_type = "ethernet-phy";
|
||||
};
|
||||
|
||||
phy3: ethernet-phy@3 {
|
||||
interrupts = <7 1>;
|
||||
reg = <3>;
|
||||
device_type = "ethernet-phy";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ethernet@25000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
device_type = "network";
|
||||
model = "TSEC";
|
||||
compatible = "gianfar";
|
||||
reg = <25000 1000>;
|
||||
mac-address = [ 00 E0 0C 00 73 01 ];
|
||||
interrupts = <13 3 14 3 18 3>;
|
||||
interrupt-parent = <40000>;
|
||||
phy-handle = <2452001>;
|
||||
reg = <0x25000 0x1000>;
|
||||
local-mac-address = [ 00 E0 0C 00 73 01 ];
|
||||
interrupts = <13 2 14 2 18 2>;
|
||||
phy-handle = <&phy1>;
|
||||
sleep = <&pmc 00000040>;
|
||||
};
|
||||
|
||||
ethernet@26000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
device_type = "network";
|
||||
model = "FEC";
|
||||
compatible = "gianfar";
|
||||
reg = <26000 1000>;
|
||||
mac-address = [ 00 E0 0C 00 73 02 ];
|
||||
interrupts = <19 3>;
|
||||
interrupt-parent = <40000>;
|
||||
phy-handle = <2452002>;
|
||||
reg = <0x26000 0x1000>;
|
||||
local-mac-address = [ 00 E0 0C 00 73 02 ];
|
||||
interrupts = <41 2>;
|
||||
phy-handle = <&phy3>;
|
||||
sleep = <&pmc 00000020>;
|
||||
};
|
||||
|
||||
serial@4500 {
|
||||
device_type = "serial";
|
||||
compatible = "ns16550";
|
||||
reg = <4500 100>;
|
||||
clock-frequency = <0>;
|
||||
interrupts = <1a 3>;
|
||||
interrupt-parent = <40000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "fsl,mpc8540-duart", "simple-bus";
|
||||
sleep = <&pmc 00000002>;
|
||||
ranges;
|
||||
|
||||
serial@4500 {
|
||||
device_type = "serial";
|
||||
compatible = "ns16550";
|
||||
reg = <0x4500 0x100>;
|
||||
clock-frequency = <0>;
|
||||
interrupts = <42 2>;
|
||||
};
|
||||
|
||||
serial@4600 {
|
||||
device_type = "serial";
|
||||
compatible = "ns16550";
|
||||
reg = <0x4600 0x100>;
|
||||
clock-frequency = <0>;
|
||||
interrupts = <42 2>;
|
||||
};
|
||||
};
|
||||
|
||||
pic@40000 {
|
||||
linux,phandle = <40000>;
|
||||
pic: pic@40000 {
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
reg = <40000 40000>;
|
||||
#interrupt-cells = <2>;
|
||||
reg = <0x40000 0x40000>;
|
||||
compatible = "chrp,open-pic";
|
||||
device_type = "open-pic";
|
||||
};
|
||||
|
||||
i2c@3000 {
|
||||
interrupt-parent = <40000>;
|
||||
interrupts = <1b 3>;
|
||||
reg = <3000 18>;
|
||||
device_type = "i2c";
|
||||
interrupts = <43 2>;
|
||||
reg = <0x3000 0x100>;
|
||||
compatible = "fsl-i2c";
|
||||
dfsrr;
|
||||
sleep = <&pmc 00000004>;
|
||||
};
|
||||
|
||||
pmc: power@e0070 {
|
||||
compatible = "fsl,mpc8540-pmc", "fsl,mpc8548-pmc";
|
||||
reg = <0xe0070 0x20>;
|
||||
};
|
||||
};
|
||||
|
|
38
Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt
Normal file
38
Documentation/powerpc/dts-bindings/fsl/cpm_qe/gpio.txt
Normal file
|
@ -0,0 +1,38 @@
|
|||
Every GPIO controller node must have #gpio-cells property defined,
|
||||
this information will be used to translate gpio-specifiers.
|
||||
|
||||
On CPM1 devices, all ports are using slightly different register layouts.
|
||||
Ports A, C and D are 16bit ports and Ports B and E are 32bit ports.
|
||||
|
||||
On CPM2 devices, all ports are 32bit ports and use a common register layout.
|
||||
|
||||
Required properties:
|
||||
- compatible : "fsl,cpm1-pario-bank-a", "fsl,cpm1-pario-bank-b",
|
||||
"fsl,cpm1-pario-bank-c", "fsl,cpm1-pario-bank-d",
|
||||
"fsl,cpm1-pario-bank-e", "fsl,cpm2-pario-bank"
|
||||
- #gpio-cells : Should be two. The first cell is the pin number and the
|
||||
second cell is used to specify optional paramters (currently unused).
|
||||
- gpio-controller : Marks the port as GPIO controller.
|
||||
|
||||
Example of three SOC GPIO banks defined as gpio-controller nodes:
|
||||
|
||||
CPM1_PIO_A: gpio-controller@950 {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "fsl,cpm1-pario-bank-a";
|
||||
reg = <0x950 0x10>;
|
||||
gpio-controller;
|
||||
};
|
||||
|
||||
CPM1_PIO_B: gpio-controller@ab8 {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "fsl,cpm1-pario-bank-b";
|
||||
reg = <0xab8 0x10>;
|
||||
gpio-controller;
|
||||
};
|
||||
|
||||
CPM1_PIO_E: gpio-controller@ac8 {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "fsl,cpm1-pario-bank-e";
|
||||
reg = <0xac8 0x18>;
|
||||
gpio-controller;
|
||||
};
|
|
@ -1,22 +1,37 @@
|
|||
* USB (Universal Serial Bus Controller)
|
||||
Freescale QUICC Engine USB Controller
|
||||
|
||||
Required properties:
|
||||
- compatible : could be "qe_udc" or "fhci-hcd".
|
||||
- mode : the could be "host" or "slave".
|
||||
- reg : Offset and length of the register set for the device
|
||||
- interrupts : <a b> where a is the interrupt number and b is a
|
||||
field that represents an encoding of the sense and level
|
||||
information for the interrupt. This should be encoded based on
|
||||
the information in section 2) depending on the type of interrupt
|
||||
controller you have.
|
||||
- interrupt-parent : the phandle for the interrupt controller that
|
||||
services interrupts for this device.
|
||||
- compatible : should be "fsl,<chip>-qe-usb", "fsl,mpc8323-qe-usb".
|
||||
- reg : the first two cells should contain usb registers location and
|
||||
length, the next two two cells should contain PRAM location and
|
||||
length.
|
||||
- interrupts : should contain USB interrupt.
|
||||
- interrupt-parent : interrupt source phandle.
|
||||
- fsl,fullspeed-clock : specifies the full speed USB clock source:
|
||||
"none": clock source is disabled
|
||||
"brg1" through "brg16": clock source is BRG1-BRG16, respectively
|
||||
"clk1" through "clk24": clock source is CLK1-CLK24, respectively
|
||||
- fsl,lowspeed-clock : specifies the low speed USB clock source:
|
||||
"none": clock source is disabled
|
||||
"brg1" through "brg16": clock source is BRG1-BRG16, respectively
|
||||
"clk1" through "clk24": clock source is CLK1-CLK24, respectively
|
||||
- hub-power-budget : USB power budget for the root hub, in mA.
|
||||
- gpios : should specify GPIOs in this order: USBOE, USBTP, USBTN, USBRP,
|
||||
USBRN, SPEED (optional), and POWER (optional).
|
||||
|
||||
Example(slave):
|
||||
usb@6c0 {
|
||||
compatible = "qe_udc";
|
||||
reg = <6c0 40>;
|
||||
interrupts = <8b 0>;
|
||||
interrupt-parent = <700>;
|
||||
mode = "slave";
|
||||
};
|
||||
Example:
|
||||
|
||||
usb@6c0 {
|
||||
compatible = "fsl,mpc8360-qe-usb", "fsl,mpc8323-qe-usb";
|
||||
reg = <0x6c0 0x40 0x8b00 0x100>;
|
||||
interrupts = <11>;
|
||||
interrupt-parent = <&qeic>;
|
||||
fsl,fullspeed-clock = "clk21";
|
||||
gpios = <&qe_pio_b 2 0 /* USBOE */
|
||||
&qe_pio_b 3 0 /* USBTP */
|
||||
&qe_pio_b 8 0 /* USBTN */
|
||||
&qe_pio_b 9 0 /* USBRP */
|
||||
&qe_pio_b 11 0 /* USBRN */
|
||||
&qe_pio_e 20 0 /* SPEED */
|
||||
&qe_pio_e 21 0 /* POWER */>;
|
||||
};
|
||||
|
|
17
Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt
Normal file
17
Documentation/powerpc/dts-bindings/fsl/mcu-mpc8349emitx.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
Freescale MPC8349E-mITX-compatible Power Management Micro Controller Unit (MCU)
|
||||
|
||||
Required properties:
|
||||
- compatible : "fsl,<mcu-chip>-<board>", "fsl,mcu-mpc8349emitx".
|
||||
- reg : should specify I2C address (0x0a).
|
||||
- #gpio-cells : should be 2.
|
||||
- gpio-controller : should be present.
|
||||
|
||||
Example:
|
||||
|
||||
mcu@0a {
|
||||
#gpio-cells = <2>;
|
||||
compatible = "fsl,mc9s08qg8-mpc8349emitx",
|
||||
"fsl,mcu-mpc8349emitx";
|
||||
reg = <0x0a>;
|
||||
gpio-controller;
|
||||
};
|
63
Documentation/powerpc/dts-bindings/fsl/pmc.txt
Normal file
63
Documentation/powerpc/dts-bindings/fsl/pmc.txt
Normal file
|
@ -0,0 +1,63 @@
|
|||
* Power Management Controller
|
||||
|
||||
Properties:
|
||||
- compatible: "fsl,<chip>-pmc".
|
||||
|
||||
"fsl,mpc8349-pmc" should be listed for any chip whose PMC is
|
||||
compatible. "fsl,mpc8313-pmc" should also be listed for any chip
|
||||
whose PMC is compatible, and implies deep-sleep capability.
|
||||
|
||||
"fsl,mpc8548-pmc" should be listed for any chip whose PMC is
|
||||
compatible. "fsl,mpc8536-pmc" should also be listed for any chip
|
||||
whose PMC is compatible, and implies deep-sleep capability.
|
||||
|
||||
"fsl,mpc8641d-pmc" should be listed for any chip whose PMC is
|
||||
compatible; all statements below that apply to "fsl,mpc8548-pmc" also
|
||||
apply to "fsl,mpc8641d-pmc".
|
||||
|
||||
Compatibility does not include bit assigments in SCCR/PMCDR/DEVDISR; these
|
||||
bit assigments are indicated via the sleep specifier in each device's
|
||||
sleep property.
|
||||
|
||||
- reg: For devices compatible with "fsl,mpc8349-pmc", the first resource
|
||||
is the PMC block, and the second resource is the Clock Configuration
|
||||
block.
|
||||
|
||||
For devices compatible with "fsl,mpc8548-pmc", the first resource
|
||||
is a 32-byte block beginning with DEVDISR.
|
||||
|
||||
- interrupts: For "fsl,mpc8349-pmc"-compatible devices, the first
|
||||
resource is the PMC block interrupt.
|
||||
|
||||
- fsl,mpc8313-wakeup-timer: For "fsl,mpc8313-pmc"-compatible devices,
|
||||
this is a phandle to an "fsl,gtm" node on which timer 4 can be used as
|
||||
a wakeup source from deep sleep.
|
||||
|
||||
Sleep specifiers:
|
||||
|
||||
fsl,mpc8349-pmc: Sleep specifiers consist of one cell. For each bit
|
||||
that is set in the cell, the corresponding bit in SCCR will be saved
|
||||
and cleared on suspend, and restored on resume. This sleep controller
|
||||
supports disabling and resuming devices at any time.
|
||||
|
||||
fsl,mpc8536-pmc: Sleep specifiers consist of three cells, the third of
|
||||
which will be ORed into PMCDR upon suspend, and cleared from PMCDR
|
||||
upon resume. The first two cells are as described for fsl,mpc8578-pmc.
|
||||
This sleep controller only supports disabling devices during system
|
||||
sleep, or permanently.
|
||||
|
||||
fsl,mpc8548-pmc: Sleep specifiers consist of one or two cells, the
|
||||
first of which will be ORed into DEVDISR (and the second into
|
||||
DEVDISR2, if present -- this cell should be zero or absent if the
|
||||
hardware does not have DEVDISR2) upon a request for permanent device
|
||||
disabling. This sleep controller does not support configuring devices
|
||||
to disable during system sleep (unless supported by another compatible
|
||||
match), or dynamically.
|
||||
|
||||
Example:
|
||||
|
||||
power@b00 {
|
||||
compatible = "fsl,mpc8313-pmc", "fsl,mpc8349-pmc";
|
||||
reg = <0xb00 0x100 0xa00 0x100>;
|
||||
interrupts = <80 8>;
|
||||
};
|
|
@ -24,46 +24,39 @@ Example:
|
|||
|
||||
* Gianfar-compatible ethernet nodes
|
||||
|
||||
Required properties:
|
||||
Properties:
|
||||
|
||||
- device_type : Should be "network"
|
||||
- model : Model of the device. Can be "TSEC", "eTSEC", or "FEC"
|
||||
- compatible : Should be "gianfar"
|
||||
- reg : Offset and length of the register set for the device
|
||||
- mac-address : List of bytes representing the ethernet address of
|
||||
- local-mac-address : List of bytes representing the ethernet address of
|
||||
this controller
|
||||
- interrupts : <a b> where a is the interrupt number and b is a
|
||||
field that represents an encoding of the sense and level
|
||||
information for the interrupt. This should be encoded based on
|
||||
the information in section 2) depending on the type of interrupt
|
||||
controller you have.
|
||||
- interrupt-parent : the phandle for the interrupt controller that
|
||||
services interrupts for this device.
|
||||
- interrupts : For FEC devices, the first interrupt is the device's
|
||||
interrupt. For TSEC and eTSEC devices, the first interrupt is
|
||||
transmit, the second is receive, and the third is error.
|
||||
- phy-handle : The phandle for the PHY connected to this ethernet
|
||||
controller.
|
||||
- fixed-link : <a b c d e> where a is emulated phy id - choose any,
|
||||
but unique to the all specified fixed-links, b is duplex - 0 half,
|
||||
1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
|
||||
pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
|
||||
|
||||
Recommended properties:
|
||||
|
||||
- phy-connection-type : a string naming the controller/PHY interface type,
|
||||
i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
|
||||
"tbi", or "rtbi". This property is only really needed if the connection
|
||||
is of type "rgmii-id", as all other connection types are detected by
|
||||
hardware.
|
||||
|
||||
- fsl,magic-packet : If present, indicates that the hardware supports
|
||||
waking up via magic packet.
|
||||
|
||||
Example:
|
||||
ethernet@24000 {
|
||||
#size-cells = <0>;
|
||||
device_type = "network";
|
||||
model = "TSEC";
|
||||
compatible = "gianfar";
|
||||
reg = <24000 1000>;
|
||||
mac-address = [ 00 E0 0C 00 73 00 ];
|
||||
interrupts = <d 3 e 3 12 3>;
|
||||
interrupt-parent = <40000>;
|
||||
phy-handle = <2452000>
|
||||
reg = <0x24000 0x1000>;
|
||||
local-mac-address = [ 00 E0 0C 00 73 00 ];
|
||||
interrupts = <29 2 30 2 34 2>;
|
||||
interrupt-parent = <&mpic>;
|
||||
phy-handle = <&phy0>
|
||||
};
|
||||
|
|
28
Documentation/powerpc/dts-bindings/fsl/upm-nand.txt
Normal file
28
Documentation/powerpc/dts-bindings/fsl/upm-nand.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
Freescale Localbus UPM programmed to work with NAND flash
|
||||
|
||||
Required properties:
|
||||
- compatible : "fsl,upm-nand".
|
||||
- reg : should specify localbus chip select and size used for the chip.
|
||||
- fsl,upm-addr-offset : UPM pattern offset for the address latch.
|
||||
- fsl,upm-cmd-offset : UPM pattern offset for the command latch.
|
||||
- gpios : may specify optional GPIO connected to the Ready-Not-Busy pin.
|
||||
|
||||
Example:
|
||||
|
||||
upm@1,0 {
|
||||
compatible = "fsl,upm-nand";
|
||||
reg = <1 0 1>;
|
||||
fsl,upm-addr-offset = <16>;
|
||||
fsl,upm-cmd-offset = <8>;
|
||||
gpios = <&qe_pio_e 18 0>;
|
||||
|
||||
flash {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "...";
|
||||
|
||||
partition@0 {
|
||||
...
|
||||
};
|
||||
};
|
||||
};
|
15
Documentation/powerpc/dts-bindings/gpio/led.txt
Normal file
15
Documentation/powerpc/dts-bindings/gpio/led.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
LED connected to GPIO
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "gpio-led".
|
||||
- label : (optional) the label for this LED. If omitted, the label is
|
||||
taken from the node name (excluding the unit address).
|
||||
- gpios : should specify LED GPIO.
|
||||
|
||||
Example:
|
||||
|
||||
led@0 {
|
||||
compatible = "gpio-led";
|
||||
label = "hdd";
|
||||
gpios = <&mcu_pio 0 1>;
|
||||
};
|
|
@ -42,7 +42,7 @@
|
|||
<sect1><title>Device Components</title>
|
||||
!Esound/core/device.c
|
||||
</sect1>
|
||||
<sect1><title>KMOD and Device File Entries</title>
|
||||
<sect1><title>Module requests and Device File Entries</title>
|
||||
!Esound/core/sound.c
|
||||
</sect1>
|
||||
<sect1><title>Memory Management Helpers</title>
|
||||
|
|
|
@ -270,8 +270,8 @@ The pinout of the connectors on the IO8+ is:
|
|||
Hardware handshaking issues.
|
||||
============================
|
||||
|
||||
The driver can be compiled in two different ways. The default
|
||||
("Specialix DTR/RTS pin is RTS" is off) the pin behaves as DTR when
|
||||
The driver can be told to operate in two different ways. The default
|
||||
behaviour is specialix.sx_rtscts = 0 where the pin behaves as DTR when
|
||||
hardware handshaking is off. It behaves as the RTS hardware
|
||||
handshaking signal when hardware handshaking is selected.
|
||||
|
||||
|
@ -280,7 +280,7 @@ cable will either be compatible with hardware handshaking or with
|
|||
software handshaking. So switching on the fly is not really an
|
||||
option.
|
||||
|
||||
I actually prefer to use the "Specialix DTR/RTS pin is RTS" option.
|
||||
I actually prefer to use the "specialix.sx_rtscts=1" option.
|
||||
This makes the DTR/RTS pin always an RTS pin, and ioctls to
|
||||
change DTR are always ignored. I have a cable that is configured
|
||||
for this.
|
||||
|
@ -379,7 +379,5 @@ it doesn't fit in your computer, bring back the card.
|
|||
You have to WRITE to the address register to even
|
||||
read-probe a CD186x register. Disable autodetection?
|
||||
-- Specialix: any suggestions?
|
||||
- Arbitrary baud rates are not implemented yet.
|
||||
If you need this, bug me about it.
|
||||
|
||||
|
||||
|
|
|
@ -3,9 +3,8 @@ Rules on how to access information in the Linux kernel sysfs
|
|||
The kernel-exported sysfs exports internal kernel implementation details
|
||||
and depends on internal kernel structures and layout. It is agreed upon
|
||||
by the kernel developers that the Linux kernel does not provide a stable
|
||||
internal API. As sysfs is a direct export of kernel internal
|
||||
structures, the sysfs interface cannot provide a stable interface either;
|
||||
it may always change along with internal kernel changes.
|
||||
internal API. Therefore, there are aspects of the sysfs interface that
|
||||
may not be stable across kernel releases.
|
||||
|
||||
To minimize the risk of breaking users of sysfs, which are in most cases
|
||||
low-level userspace applications, with a new kernel release, the users
|
||||
|
|
|
@ -305,21 +305,14 @@ driver, like this:
|
|||
|
||||
which will result in the needed drivers getting loaded automatically.
|
||||
|
||||
g. if you are planning on using kerneld to automatically load the
|
||||
module for you, then you need to edit /etc/conf.modules and add the
|
||||
g. if you are planning on having the kernel automatically request
|
||||
the module for you, then you need to edit /etc/conf.modules and add the
|
||||
following lines:
|
||||
|
||||
options ixj dspio=0x340 xio=0x330 ixjdebug=0
|
||||
|
||||
If you do this, then when you execute an application that uses the
|
||||
module kerneld will load the module for you. Note that to do this,
|
||||
you need to have your kernel set to support kerneld. You can check
|
||||
for this by looking at /usr/src/linux/.config and you should see this:
|
||||
|
||||
# Loadable module support
|
||||
#
|
||||
<snip>
|
||||
CONFIG_KMOD=y
|
||||
module the kernel will request that it is loaded.
|
||||
|
||||
h. if you want non-root users to be able to read and write to the
|
||||
ixj devices (this is a good idea!) you should do the following:
|
||||
|
|
|
@ -193,9 +193,6 @@ Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
|
|||
loads that module automatically. This action is performed as
|
||||
once soon as the 'w9968cf' module is loaded into memory.
|
||||
Default: 1
|
||||
Note: The kernel must be compiled with the CONFIG_KMOD option
|
||||
enabled for the 'ovcamchip' module to be loaded and for
|
||||
this parameter to be present.
|
||||
-------------------------------------------------------------------------------
|
||||
Name: simcams
|
||||
Type: int
|
||||
|
|
|
@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be
|
|||
allowed on the system until one of the two sysctls are increased
|
||||
sufficiently, or the surplus huge pages go out of use and are freed.
|
||||
|
||||
With support for multiple hugepage pools at run-time available, much of
|
||||
the hugepage userspace interface has been duplicated in sysfs. The above
|
||||
information applies to the default hugepage size (which will be
|
||||
controlled by the proc interfaces for backwards compatibility). The root
|
||||
hugepage control directory is
|
||||
|
||||
/sys/kernel/mm/hugepages
|
||||
|
||||
For each hugepage size supported by the running kernel, a subdirectory
|
||||
will exist, of the form
|
||||
|
||||
hugepages-${size}kB
|
||||
|
||||
Inside each of these directories, the same set of files will exist:
|
||||
|
||||
nr_hugepages
|
||||
nr_overcommit_hugepages
|
||||
free_hugepages
|
||||
resv_hugepages
|
||||
surplus_hugepages
|
||||
|
||||
which function as described above for the default hugepage-sized case.
|
||||
|
||||
If the user applications are going to request hugepages using mmap system
|
||||
call, then it is required that system administrator mount a file system of
|
||||
type hugetlbfs:
|
||||
|
|
54
MAINTAINERS
54
MAINTAINERS
|
@ -441,10 +441,7 @@ M: spyro@f2s.com
|
|||
S: Maintained
|
||||
|
||||
ARM PRIMECELL MMCI PL180/1 DRIVER
|
||||
P: Russell King
|
||||
M: rmk@arm.linux.org.uk
|
||||
L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
|
||||
S: Maintained
|
||||
S: Orphan
|
||||
|
||||
ARM/ADI ROADRUNNER MACHINE SUPPORT
|
||||
P: Lennert Buytenhek
|
||||
|
@ -483,11 +480,28 @@ M: kernel@wantstofly.org
|
|||
L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
|
||||
S: Maintained
|
||||
|
||||
ARM/COMPULAB CM-X270/EM-X270 MACHINE SUPPORT
|
||||
P: Mike Rapoport
|
||||
M: mike@compulab.co.il
|
||||
L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
|
||||
S: Maintained
|
||||
|
||||
ARM/CORGI MACHINE SUPPORT
|
||||
P: Richard Purdie
|
||||
M: rpurdie@rpsys.net
|
||||
S: Maintained
|
||||
|
||||
ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6)
|
||||
P: Daniel Ribeiro
|
||||
M: drwyrm@gmail.com
|
||||
P: Stefan Schmidt
|
||||
M: stefan@openezx.org
|
||||
P: Harald Welte
|
||||
M: laforge@openezx.org
|
||||
L: openezx-devel@lists.openezx.org (subscribers-only)
|
||||
W: http://www.openezx.org/
|
||||
S: Maintained
|
||||
|
||||
ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
|
||||
P: Lennert Buytenhek
|
||||
M: kernel@wantstofly.org
|
||||
|
@ -575,10 +589,18 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
|
|||
S: Maintained
|
||||
|
||||
ARM/TOSA MACHINE SUPPORT
|
||||
P: Dmitry Baryshkov
|
||||
M: dbaryshkov@gmail.com
|
||||
P: Dirk Opfer
|
||||
M: dirk@opfer-online.de
|
||||
S: Maintained
|
||||
|
||||
ARM/PALMTX SUPPORT
|
||||
P: Marek Vasut
|
||||
M: marek.vasut@gmail.com
|
||||
W: http://hackndev.com
|
||||
S: Maintained
|
||||
|
||||
ARM/PLEB SUPPORT
|
||||
P: Peter Chubb
|
||||
M: pleb@gelato.unsw.edu.au
|
||||
|
@ -1962,7 +1984,7 @@ P: Carlos Corbacho
|
|||
M: carlos@strangeworlds.co.uk
|
||||
S: Odd Fixes
|
||||
|
||||
HPET: High Precision Event Timers driver (hpet.c)
|
||||
HPET: High Precision Event Timers driver (drivers/char/hpet.c)
|
||||
P: Clemens Ladisch
|
||||
M: clemens@ladisch.de
|
||||
S: Maintained
|
||||
|
@ -2915,8 +2937,6 @@ P: Faisal Latif
|
|||
M: flatif@neteffect.com
|
||||
P: Chien Tung
|
||||
M: ctung@neteffect.com
|
||||
P: Glenn Streiff
|
||||
M: gstreiff@neteffect.com
|
||||
L: general@lists.openfabrics.org
|
||||
W: http://www.neteffect.com
|
||||
S: Supported
|
||||
|
@ -3533,7 +3553,7 @@ S: Supported
|
|||
|
||||
S390 NETWORK DRIVERS
|
||||
P: Ursula Braun
|
||||
M: ubraun@linux.vnet.ibm.com
|
||||
M: ursula.braun@de.ibm.com
|
||||
P: Frank Blaschka
|
||||
M: blaschka@linux.vnet.ibm.com
|
||||
M: linux390@de.ibm.com
|
||||
|
@ -3553,7 +3573,7 @@ S: Supported
|
|||
|
||||
S390 IUCV NETWORK LAYER
|
||||
P: Ursula Braun
|
||||
M: ubraun@linux.vnet.ibm.com
|
||||
M: ursula.braun@de.ibm.com
|
||||
M: linux390@de.ibm.com
|
||||
L: linux-s390@vger.kernel.org
|
||||
W: http://www.ibm.com/developerworks/linux/linux390/
|
||||
|
@ -4047,9 +4067,10 @@ W: http://www.buzzard.org.uk/toshiba/
|
|||
S: Maintained
|
||||
|
||||
TPM DEVICE DRIVER
|
||||
P: Debora Velarde
|
||||
P: Rajiv Andrade
|
||||
M: tpmdd-devel@lists.sourceforge.net
|
||||
P: Debora Velarde
|
||||
M: debora@linux.vnet.ibm.com
|
||||
P: Rajiv Andrade
|
||||
M: srajiv@linux.vnet.ibm.com
|
||||
W: http://tpmdd.sourceforge.net
|
||||
P: Marcel Selhorst
|
||||
M: tpm@selhorst.net
|
||||
|
@ -4057,12 +4078,6 @@ W: http://www.prosec.rub.de/tpm/
|
|||
L: tpmdd-devel@lists.sourceforge.net
|
||||
S: Maintained
|
||||
|
||||
TRIDENT 4DWAVE/SIS 7018 PCI AUDIO CORE
|
||||
P: Muli Ben-Yehuda
|
||||
M: mulix@mulix.org
|
||||
L: linux-kernel@vger.kernel.org
|
||||
S: Maintained
|
||||
|
||||
TRIVIAL PATCHES
|
||||
P: Jesper Juhl
|
||||
M: trivial@kernel.org
|
||||
|
@ -4108,9 +4123,6 @@ W: http://www.uclinux.org/
|
|||
L: uclinux-dev@uclinux.org (subscribers-only)
|
||||
S: Maintained
|
||||
|
||||
UCLINUX FOR NEC V850
|
||||
P: Miles Bader
|
||||
|
||||
UCLINUX FOR RENESAS H8/300
|
||||
P: Yoshinori Sato
|
||||
M: ysato@users.sourceforge.jp
|
||||
|
|
3
Makefile
3
Makefile
|
@ -1148,7 +1148,8 @@ clean: archclean $(clean-dirs)
|
|||
@find . $(RCS_FIND_IGNORE) \
|
||||
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
|
||||
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
|
||||
-o -name '*.symtypes' -o -name 'modules.order' \) \
|
||||
-o -name '*.symtypes' -o -name 'modules.order' \
|
||||
-o -name 'Module.markers' \) \
|
||||
-type f -print | xargs rm -f
|
||||
|
||||
# mrproper - Delete all generated files, including .config
|
||||
|
|
10
arch/Kconfig
10
arch/Kconfig
|
@ -31,6 +31,9 @@ config KRETPROBES
|
|||
def_bool y
|
||||
depends on KPROBES && HAVE_KRETPROBES
|
||||
|
||||
config HAVE_IOREMAP_PROT
|
||||
def_bool n
|
||||
|
||||
config HAVE_KPROBES
|
||||
def_bool n
|
||||
|
||||
|
@ -42,3 +45,10 @@ config HAVE_DMA_ATTRS
|
|||
|
||||
config USE_GENERIC_SMP_HELPERS
|
||||
def_bool n
|
||||
|
||||
config HAVE_CLK
|
||||
def_bool n
|
||||
help
|
||||
The <linux/clk.h> calls support software clock gating and
|
||||
thus are a key power management tool on many systems.
|
||||
|
||||
|
|
|
@ -333,11 +333,6 @@ config PCI_SYSCALL
|
|||
config IOMMU_HELPER
|
||||
def_bool PCI
|
||||
|
||||
config ALPHA_CORE_AGP
|
||||
bool
|
||||
depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL
|
||||
default y
|
||||
|
||||
config ALPHA_NONAME
|
||||
bool
|
||||
depends on ALPHA_BOOK1 || ALPHA_NONAME_CH
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <asm/pgalloc.h>
|
||||
|
||||
pg_data_t node_data[MAX_NUMNODES];
|
||||
bootmem_data_t node_bdata[MAX_NUMNODES];
|
||||
EXPORT_SYMBOL(node_data);
|
||||
|
||||
#undef DEBUG_DISCONTIG
|
||||
|
@ -141,7 +140,7 @@ setup_memory_node(int nid, void *kernel_end)
|
|||
printk(" not enough mem to reserve NODE_DATA");
|
||||
return;
|
||||
}
|
||||
NODE_DATA(nid)->bdata = &node_bdata[nid];
|
||||
NODE_DATA(nid)->bdata = &bootmem_node_data[nid];
|
||||
|
||||
printk(" Detected node memory: start %8lu, end %8lu\n",
|
||||
node_min_pfn, node_max_pfn);
|
||||
|
@ -304,8 +303,9 @@ void __init paging_init(void)
|
|||
dma_local_pfn = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
|
||||
|
||||
for_each_online_node(nid) {
|
||||
unsigned long start_pfn = node_bdata[nid].node_boot_start >> PAGE_SHIFT;
|
||||
unsigned long end_pfn = node_bdata[nid].node_low_pfn;
|
||||
bootmem_data_t *bdata = &bootmem_node_data[nid];
|
||||
unsigned long start_pfn = bdata->node_min_pfn;
|
||||
unsigned long end_pfn = bdata->node_low_pfn;
|
||||
|
||||
if (dma_local_pfn >= end_pfn - start_pfn)
|
||||
zones_size[ZONE_DMA] = end_pfn - start_pfn;
|
||||
|
@ -313,7 +313,7 @@ void __init paging_init(void)
|
|||
zones_size[ZONE_DMA] = dma_local_pfn;
|
||||
zones_size[ZONE_NORMAL] = (end_pfn - start_pfn) - dma_local_pfn;
|
||||
}
|
||||
free_area_init_node(nid, NODE_DATA(nid), zones_size, start_pfn, NULL);
|
||||
free_area_init_node(nid, zones_size, start_pfn, NULL);
|
||||
}
|
||||
|
||||
/* Initialize the kernel's ZERO_PGE. */
|
||||
|
|
|
@ -12,6 +12,7 @@ config ARM
|
|||
select RTC_LIB
|
||||
select SYS_SUPPORTS_APM_EMULATION
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_KPROBES if (!XIP_KERNEL)
|
||||
select HAVE_KRETPROBES if (HAVE_KPROBES)
|
||||
select HAVE_FTRACE if (!XIP_KERNEL)
|
||||
|
@ -197,12 +198,14 @@ choice
|
|||
config ARCH_AAEC2000
|
||||
bool "Agilent AAEC-2000 based"
|
||||
select ARM_AMBA
|
||||
select HAVE_CLK
|
||||
help
|
||||
This enables support for systems based on the Agilent AAEC-2000
|
||||
|
||||
config ARCH_INTEGRATOR
|
||||
bool "ARM Ltd. Integrator family"
|
||||
select ARM_AMBA
|
||||
select HAVE_CLK
|
||||
select ICST525
|
||||
help
|
||||
Support for ARM's Integrator platform.
|
||||
|
@ -210,6 +213,7 @@ config ARCH_INTEGRATOR
|
|||
config ARCH_REALVIEW
|
||||
bool "ARM Ltd. RealView family"
|
||||
select ARM_AMBA
|
||||
select HAVE_CLK
|
||||
select ICST307
|
||||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
|
@ -220,6 +224,7 @@ config ARCH_VERSATILE
|
|||
bool "ARM Ltd. Versatile family"
|
||||
select ARM_AMBA
|
||||
select ARM_VIC
|
||||
select HAVE_CLK
|
||||
select ICST307
|
||||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
|
@ -261,6 +266,8 @@ config ARCH_EP93XX
|
|||
select ARM_AMBA
|
||||
select ARM_VIC
|
||||
select GENERIC_GPIO
|
||||
select HAVE_CLK
|
||||
select HAVE_CLK
|
||||
select HAVE_GPIO_LIB
|
||||
help
|
||||
This enables support for the Cirrus EP93xx series of CPUs.
|
||||
|
@ -380,6 +387,7 @@ config ARCH_NS9XXX
|
|||
select GENERIC_GPIO
|
||||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_CLK
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
|
||||
System.
|
||||
|
@ -429,6 +437,7 @@ config ARCH_ORION5X
|
|||
|
||||
config ARCH_PNX4008
|
||||
bool "Philips Nexperia PNX4008 Mobile"
|
||||
select HAVE_CLK
|
||||
help
|
||||
This enables support for Philips PNX4008 mobile platform.
|
||||
|
||||
|
@ -437,6 +446,7 @@ config ARCH_PXA
|
|||
depends on MMU
|
||||
select ARCH_MTD_XIP
|
||||
select GENERIC_GPIO
|
||||
select HAVE_CLK
|
||||
select HAVE_GPIO_LIB
|
||||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
|
@ -467,6 +477,7 @@ config ARCH_SA1100
|
|||
select GENERIC_GPIO
|
||||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_CLK
|
||||
select TICK_ONESHOT
|
||||
select HAVE_GPIO_LIB
|
||||
help
|
||||
|
@ -475,6 +486,7 @@ config ARCH_SA1100
|
|||
config ARCH_S3C2410
|
||||
bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
|
||||
select GENERIC_GPIO
|
||||
select HAVE_CLK
|
||||
help
|
||||
Samsung S3C2410X CPU based systems, such as the Simtec Electronics
|
||||
BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
|
||||
|
@ -502,12 +514,14 @@ config ARCH_DAVINCI
|
|||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select GENERIC_GPIO
|
||||
select HAVE_CLK
|
||||
help
|
||||
Support for TI's DaVinci platform.
|
||||
|
||||
config ARCH_OMAP
|
||||
bool "TI OMAP"
|
||||
select GENERIC_GPIO
|
||||
select HAVE_CLK
|
||||
select HAVE_GPIO_LIB
|
||||
select GENERIC_TIME
|
||||
select GENERIC_CLOCKEVENTS
|
||||
|
|
|
@ -554,9 +554,8 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
|
|||
|
||||
device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
|
||||
if (!device_info) {
|
||||
printk(KERN_ERR
|
||||
"Could not allocated dmabounce_device_info for %s",
|
||||
dev->bus_id);
|
||||
dev_err(dev,
|
||||
"Could not allocated dmabounce_device_info\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -594,8 +593,7 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,
|
|||
|
||||
dev->archdata.dmabounce = device_info;
|
||||
|
||||
printk(KERN_INFO "dmabounce: registered device %s on %s bus\n",
|
||||
dev->bus_id, dev->bus->name);
|
||||
dev_info(dev, "dmabounce: registered device\n");
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -614,16 +612,15 @@ dmabounce_unregister_dev(struct device *dev)
|
|||
dev->archdata.dmabounce = NULL;
|
||||
|
||||
if (!device_info) {
|
||||
printk(KERN_WARNING
|
||||
"%s: Never registered with dmabounce but attempting" \
|
||||
"to unregister!\n", dev->bus_id);
|
||||
dev_warn(dev,
|
||||
"Never registered with dmabounce but attempting"
|
||||
"to unregister!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!list_empty(&device_info->safe_buffers)) {
|
||||
printk(KERN_ERR
|
||||
"%s: Removing from dmabounce with pending buffers!\n",
|
||||
dev->bus_id);
|
||||
dev_err(dev,
|
||||
"Removing from dmabounce with pending buffers!\n");
|
||||
BUG();
|
||||
}
|
||||
|
||||
|
@ -639,8 +636,7 @@ dmabounce_unregister_dev(struct device *dev)
|
|||
|
||||
kfree(device_info);
|
||||
|
||||
printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n",
|
||||
dev->bus_id, dev->bus->name);
|
||||
dev_info(dev, "dmabounce: device unregistered\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -543,7 +543,6 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
|
|||
goto out;
|
||||
}
|
||||
|
||||
strncpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id));
|
||||
/*
|
||||
* If the parent device has a DMA mask associated with it,
|
||||
* propagate it down to the children.
|
||||
|
@ -553,6 +552,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
|
|||
dev->dev.dma_mask = &dev->dma_mask;
|
||||
}
|
||||
|
||||
dev_set_name(&dev->dev, "%s", info->name);
|
||||
dev->devid = info->devid;
|
||||
dev->dev.parent = lchip->dev;
|
||||
dev->dev.bus = &locomo_bus_type;
|
||||
|
|
|
@ -550,9 +550,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
|||
goto out;
|
||||
}
|
||||
|
||||
snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id),
|
||||
"%4.4lx", info->offset);
|
||||
|
||||
dev_set_name(&dev->dev, "%4.4lx", info->offset);
|
||||
dev->devid = info->devid;
|
||||
dev->dev.parent = sachip->dev;
|
||||
dev->dev.bus = &sa1111_bus_type;
|
||||
|
@ -560,7 +558,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
|||
dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask;
|
||||
dev->res.start = sachip->phys + info->offset;
|
||||
dev->res.end = dev->res.start + 511;
|
||||
dev->res.name = dev->dev.bus_id;
|
||||
dev->res.name = dev_name(&dev->dev);
|
||||
dev->res.flags = IORESOURCE_MEM;
|
||||
dev->mapbase = sachip->base + info->offset;
|
||||
dev->skpcr_mask = info->skpcr_mask;
|
||||
|
@ -570,6 +568,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
|||
if (ret) {
|
||||
printk("SA1111: failed to allocate resource for %s\n",
|
||||
dev->res.name);
|
||||
dev_set_name(&dev->dev, NULL);
|
||||
kfree(dev);
|
||||
goto out;
|
||||
}
|
||||
|
@ -593,7 +592,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
|||
if (dev->dma_mask != 0xffffffffUL) {
|
||||
ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
|
||||
if (ret) {
|
||||
printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id);
|
||||
dev_err(&dev->dev, "SA1111: Failed to register"
|
||||
" with dmabounce\n");
|
||||
device_unregister(&dev->dev);
|
||||
}
|
||||
}
|
||||
|
@ -627,7 +627,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
|
|||
if (!sachip)
|
||||
return -ENOMEM;
|
||||
|
||||
sachip->clk = clk_get(me, "GPIO27_CLK");
|
||||
sachip->clk = clk_get(me, "SA1111_CLK");
|
||||
if (!sachip->clk) {
|
||||
ret = PTR_ERR(sachip->clk);
|
||||
goto err_free;
|
||||
|
|
|
@ -247,7 +247,7 @@ static int __devinit scoop_probe(struct platform_device *pdev)
|
|||
devptr->gpio.base = -1;
|
||||
|
||||
if (inf->gpio_base != 0) {
|
||||
devptr->gpio.label = pdev->dev.bus_id;
|
||||
devptr->gpio.label = dev_name(&pdev->dev);
|
||||
devptr->gpio.base = inf->gpio_base;
|
||||
devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */
|
||||
devptr->gpio.set = scoop_gpio_set;
|
||||
|
|
1614
arch/arm/configs/ezx_defconfig
Normal file
1614
arch/arm/configs/ezx_defconfig
Normal file
File diff suppressed because it is too large
Load diff
|
@ -28,6 +28,7 @@ obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o
|
|||
obj-$(CONFIG_ATAGS_PROC) += atags.o
|
||||
obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
|
||||
obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
|
||||
obj-$(CONFIG_KGDB) += kgdb.o
|
||||
|
||||
obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
|
||||
AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
|
||||
|
|
|
@ -783,7 +783,7 @@ static void ecard_proc_init(void)
|
|||
|
||||
#define ec_set_resource(ec,nr,st,sz) \
|
||||
do { \
|
||||
(ec)->resource[nr].name = ec->dev.bus_id; \
|
||||
(ec)->resource[nr].name = dev_name(&ec->dev); \
|
||||
(ec)->resource[nr].start = st; \
|
||||
(ec)->resource[nr].end = (st) + (sz) - 1; \
|
||||
(ec)->resource[nr].flags = IORESOURCE_MEM; \
|
||||
|
@ -853,8 +853,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
|
|||
for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
|
||||
if (ec->resource[i].flags &&
|
||||
request_resource(&iomem_resource, &ec->resource[i])) {
|
||||
printk(KERN_ERR "%s: resource(s) not available\n",
|
||||
ec->dev.bus_id);
|
||||
dev_err(&ec->dev, "resource(s) not available\n");
|
||||
ec->resource[i].end -= ec->resource[i].start;
|
||||
ec->resource[i].start = 0;
|
||||
ec->resource[i].flags = 0;
|
||||
|
|
201
arch/arm/kernel/kgdb.c
Normal file
201
arch/arm/kernel/kgdb.c
Normal file
|
@ -0,0 +1,201 @@
|
|||
/*
|
||||
* arch/arm/kernel/kgdb.c
|
||||
*
|
||||
* ARM KGDB support
|
||||
*
|
||||
* Copyright (c) 2002-2004 MontaVista Software, Inc
|
||||
* Copyright (c) 2008 Wind River Systems, Inc.
|
||||
*
|
||||
* Authors: George Davis <davis_g@mvista.com>
|
||||
* Deepak Saxena <dsaxena@plexity.net>
|
||||
*/
|
||||
#include <linux/kgdb.h>
|
||||
#include <asm/traps.h>
|
||||
|
||||
/* Make a local copy of the registers passed into the handler (bletch) */
|
||||
void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *kernel_regs)
|
||||
{
|
||||
int regno;
|
||||
|
||||
/* Initialize all to zero. */
|
||||
for (regno = 0; regno < GDB_MAX_REGS; regno++)
|
||||
gdb_regs[regno] = 0;
|
||||
|
||||
gdb_regs[_R0] = kernel_regs->ARM_r0;
|
||||
gdb_regs[_R1] = kernel_regs->ARM_r1;
|
||||
gdb_regs[_R2] = kernel_regs->ARM_r2;
|
||||
gdb_regs[_R3] = kernel_regs->ARM_r3;
|
||||
gdb_regs[_R4] = kernel_regs->ARM_r4;
|
||||
gdb_regs[_R5] = kernel_regs->ARM_r5;
|
||||
gdb_regs[_R6] = kernel_regs->ARM_r6;
|
||||
gdb_regs[_R7] = kernel_regs->ARM_r7;
|
||||
gdb_regs[_R8] = kernel_regs->ARM_r8;
|
||||
gdb_regs[_R9] = kernel_regs->ARM_r9;
|
||||
gdb_regs[_R10] = kernel_regs->ARM_r10;
|
||||
gdb_regs[_FP] = kernel_regs->ARM_fp;
|
||||
gdb_regs[_IP] = kernel_regs->ARM_ip;
|
||||
gdb_regs[_SPT] = kernel_regs->ARM_sp;
|
||||
gdb_regs[_LR] = kernel_regs->ARM_lr;
|
||||
gdb_regs[_PC] = kernel_regs->ARM_pc;
|
||||
gdb_regs[_CPSR] = kernel_regs->ARM_cpsr;
|
||||
}
|
||||
|
||||
/* Copy local gdb registers back to kgdb regs, for later copy to kernel */
|
||||
void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *kernel_regs)
|
||||
{
|
||||
kernel_regs->ARM_r0 = gdb_regs[_R0];
|
||||
kernel_regs->ARM_r1 = gdb_regs[_R1];
|
||||
kernel_regs->ARM_r2 = gdb_regs[_R2];
|
||||
kernel_regs->ARM_r3 = gdb_regs[_R3];
|
||||
kernel_regs->ARM_r4 = gdb_regs[_R4];
|
||||
kernel_regs->ARM_r5 = gdb_regs[_R5];
|
||||
kernel_regs->ARM_r6 = gdb_regs[_R6];
|
||||
kernel_regs->ARM_r7 = gdb_regs[_R7];
|
||||
kernel_regs->ARM_r8 = gdb_regs[_R8];
|
||||
kernel_regs->ARM_r9 = gdb_regs[_R9];
|
||||
kernel_regs->ARM_r10 = gdb_regs[_R10];
|
||||
kernel_regs->ARM_fp = gdb_regs[_FP];
|
||||
kernel_regs->ARM_ip = gdb_regs[_IP];
|
||||
kernel_regs->ARM_sp = gdb_regs[_SPT];
|
||||
kernel_regs->ARM_lr = gdb_regs[_LR];
|
||||
kernel_regs->ARM_pc = gdb_regs[_PC];
|
||||
kernel_regs->ARM_cpsr = gdb_regs[_CPSR];
|
||||
}
|
||||
|
||||
void
|
||||
sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
|
||||
{
|
||||
struct pt_regs *thread_regs;
|
||||
int regno;
|
||||
|
||||
/* Just making sure... */
|
||||
if (task == NULL)
|
||||
return;
|
||||
|
||||
/* Initialize to zero */
|
||||
for (regno = 0; regno < GDB_MAX_REGS; regno++)
|
||||
gdb_regs[regno] = 0;
|
||||
|
||||
/* Otherwise, we have only some registers from switch_to() */
|
||||
thread_regs = task_pt_regs(task);
|
||||
gdb_regs[_R0] = thread_regs->ARM_r0;
|
||||
gdb_regs[_R1] = thread_regs->ARM_r1;
|
||||
gdb_regs[_R2] = thread_regs->ARM_r2;
|
||||
gdb_regs[_R3] = thread_regs->ARM_r3;
|
||||
gdb_regs[_R4] = thread_regs->ARM_r4;
|
||||
gdb_regs[_R5] = thread_regs->ARM_r5;
|
||||
gdb_regs[_R6] = thread_regs->ARM_r6;
|
||||
gdb_regs[_R7] = thread_regs->ARM_r7;
|
||||
gdb_regs[_R8] = thread_regs->ARM_r8;
|
||||
gdb_regs[_R9] = thread_regs->ARM_r9;
|
||||
gdb_regs[_R10] = thread_regs->ARM_r10;
|
||||
gdb_regs[_FP] = thread_regs->ARM_fp;
|
||||
gdb_regs[_IP] = thread_regs->ARM_ip;
|
||||
gdb_regs[_SPT] = thread_regs->ARM_sp;
|
||||
gdb_regs[_LR] = thread_regs->ARM_lr;
|
||||
gdb_regs[_PC] = thread_regs->ARM_pc;
|
||||
gdb_regs[_CPSR] = thread_regs->ARM_cpsr;
|
||||
}
|
||||
|
||||
static int compiled_break;
|
||||
|
||||
int kgdb_arch_handle_exception(int exception_vector, int signo,
|
||||
int err_code, char *remcom_in_buffer,
|
||||
char *remcom_out_buffer,
|
||||
struct pt_regs *linux_regs)
|
||||
{
|
||||
unsigned long addr;
|
||||
char *ptr;
|
||||
|
||||
switch (remcom_in_buffer[0]) {
|
||||
case 'D':
|
||||
case 'k':
|
||||
case 'c':
|
||||
kgdb_contthread = NULL;
|
||||
|
||||
/*
|
||||
* Try to read optional parameter, pc unchanged if no parm.
|
||||
* If this was a compiled breakpoint, we need to move
|
||||
* to the next instruction or we will just breakpoint
|
||||
* over and over again.
|
||||
*/
|
||||
ptr = &remcom_in_buffer[1];
|
||||
if (kgdb_hex2long(&ptr, &addr))
|
||||
linux_regs->ARM_pc = addr;
|
||||
else if (compiled_break == 1)
|
||||
linux_regs->ARM_pc += 4;
|
||||
|
||||
compiled_break = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int kgdb_brk_fn(struct pt_regs *regs, unsigned int instr)
|
||||
{
|
||||
kgdb_handle_exception(1, SIGTRAP, 0, regs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int instr)
|
||||
{
|
||||
compiled_break = 1;
|
||||
kgdb_handle_exception(1, SIGTRAP, 0, regs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct undef_hook kgdb_brkpt_hook = {
|
||||
.instr_mask = 0xffffffff,
|
||||
.instr_val = KGDB_BREAKINST,
|
||||
.fn = kgdb_brk_fn
|
||||
};
|
||||
|
||||
static struct undef_hook kgdb_compiled_brkpt_hook = {
|
||||
.instr_mask = 0xffffffff,
|
||||
.instr_val = KGDB_COMPILED_BREAK,
|
||||
.fn = kgdb_compiled_brk_fn
|
||||
};
|
||||
|
||||
/**
|
||||
* kgdb_arch_init - Perform any architecture specific initalization.
|
||||
*
|
||||
* This function will handle the initalization of any architecture
|
||||
* specific callbacks.
|
||||
*/
|
||||
int kgdb_arch_init(void)
|
||||
{
|
||||
register_undef_hook(&kgdb_brkpt_hook);
|
||||
register_undef_hook(&kgdb_compiled_brkpt_hook);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* kgdb_arch_exit - Perform any architecture specific uninitalization.
|
||||
*
|
||||
* This function will handle the uninitalization of any architecture
|
||||
* specific callbacks, for dynamic registration and unregistration.
|
||||
*/
|
||||
void kgdb_arch_exit(void)
|
||||
{
|
||||
unregister_undef_hook(&kgdb_brkpt_hook);
|
||||
unregister_undef_hook(&kgdb_compiled_brkpt_hook);
|
||||
}
|
||||
|
||||
/*
|
||||
* Register our undef instruction hooks with ARM undef core.
|
||||
* We regsiter a hook specifically looking for the KGB break inst
|
||||
* and we handle the normal undef case within the do_undefinstr
|
||||
* handler.
|
||||
*/
|
||||
struct kgdb_arch arch_kgdb_ops = {
|
||||
#ifndef __ARMEB__
|
||||
.gdb_bpt_instr = {0xfe, 0xde, 0xff, 0xe7}
|
||||
#else /* ! __ARMEB__ */
|
||||
.gdb_bpt_instr = {0xe7, 0xff, 0xde, 0xfe}
|
||||
#endif
|
||||
};
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/moduleloader.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/elf.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/slab.h>
|
||||
|
|
|
@ -162,7 +162,7 @@ void cpu_idle(void)
|
|||
if (!idle)
|
||||
idle = default_idle;
|
||||
leds_event(led_idle_start);
|
||||
tick_nohz_stop_sched_tick();
|
||||
tick_nohz_stop_sched_tick(1);
|
||||
while (!need_resched())
|
||||
idle();
|
||||
leds_event(led_idle_end);
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/irq.h>
|
||||
#include <asm/mach/time.h>
|
||||
#include <asm/traps.h>
|
||||
|
||||
#include "compat.h"
|
||||
#include "atags.h"
|
||||
|
@ -853,6 +854,7 @@ void __init setup_arch(char **cmdline_p)
|
|||
conswitchp = &dummy_con;
|
||||
#endif
|
||||
#endif
|
||||
early_trap_init();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -130,7 +130,9 @@ static const struct leds_evt_name evt_names[] = {
|
|||
{ "red", led_red_on, led_red_off },
|
||||
};
|
||||
|
||||
static ssize_t leds_store(struct sys_device *dev, const char *buf, size_t size)
|
||||
static ssize_t leds_store(struct sys_device *dev,
|
||||
struct sysdev_attribute *attr,
|
||||
const char *buf, size_t size)
|
||||
{
|
||||
int ret = -EINVAL, len = strcspn(buf, " ");
|
||||
|
||||
|
|
|
@ -707,6 +707,11 @@ void abort(void)
|
|||
EXPORT_SYMBOL(abort);
|
||||
|
||||
void __init trap_init(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void __init early_trap_init(void)
|
||||
{
|
||||
unsigned long vectors = CONFIG_VECTORS_BASE;
|
||||
extern char __stubs_start[], __stubs_end[];
|
||||
|
|
|
@ -393,9 +393,7 @@ static int impd1_probe(struct lm_device *dev)
|
|||
if (!d)
|
||||
continue;
|
||||
|
||||
snprintf(d->dev.bus_id, sizeof(d->dev.bus_id),
|
||||
"lm%x:%5.5lx", dev->id, idev->offset >> 12);
|
||||
|
||||
dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12);
|
||||
d->dev.parent = &dev->dev;
|
||||
d->res.start = dev->resource.start + idev->offset;
|
||||
d->res.end = d->res.start + SZ_4K - 1;
|
||||
|
@ -407,8 +405,7 @@ static int impd1_probe(struct lm_device *dev)
|
|||
|
||||
ret = amba_device_register(d, &dev->resource);
|
||||
if (ret) {
|
||||
printk("unable to register device %s: %d\n",
|
||||
d->dev.bus_id, ret);
|
||||
dev_err(&d->dev, "unable to register device: %d\n");
|
||||
kfree(d);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,8 +81,10 @@ int lm_device_register(struct lm_device *dev)
|
|||
dev->dev.release = lm_device_release;
|
||||
dev->dev.bus = &lm_bustype;
|
||||
|
||||
snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), "lm%d", dev->id);
|
||||
dev->resource.name = dev->dev.bus_id;
|
||||
ret = dev_set_name(&dev->dev, "lm%d", dev->id);
|
||||
if (ret)
|
||||
return ret;
|
||||
dev->resource.name = dev_name(&dev->dev);
|
||||
|
||||
ret = request_resource(&iomem_resource, &dev->resource);
|
||||
if (ret == 0) {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/f75375s.h>
|
||||
#include <linux/leds-pca9532.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/pci.h>
|
||||
|
@ -206,6 +207,53 @@ static struct f75375s_platform_data n2100_f75375s = {
|
|||
.pwm_enable = { 0, 0 },
|
||||
};
|
||||
|
||||
static struct pca9532_platform_data n2100_leds = {
|
||||
.leds = {
|
||||
{ .name = "n2100:red:satafail0",
|
||||
.state = PCA9532_OFF,
|
||||
.type = PCA9532_TYPE_LED,
|
||||
},
|
||||
{ .name = "n2100:red:satafail1",
|
||||
.state = PCA9532_OFF,
|
||||
.type = PCA9532_TYPE_LED,
|
||||
},
|
||||
{ .name = "n2100:blue:usb",
|
||||
.state = PCA9532_OFF,
|
||||
.type = PCA9532_TYPE_LED,
|
||||
},
|
||||
{ .type = PCA9532_TYPE_NONE },
|
||||
|
||||
{ .type = PCA9532_TYPE_NONE },
|
||||
{ .type = PCA9532_TYPE_NONE },
|
||||
{ .type = PCA9532_TYPE_NONE },
|
||||
{ .name = "n2100:red:usb",
|
||||
.state = PCA9532_OFF,
|
||||
.type = PCA9532_TYPE_LED,
|
||||
},
|
||||
|
||||
{ .type = PCA9532_TYPE_NONE }, /* power OFF gpio */
|
||||
{ .type = PCA9532_TYPE_NONE }, /* reset gpio */
|
||||
{ .type = PCA9532_TYPE_NONE },
|
||||
{ .type = PCA9532_TYPE_NONE },
|
||||
|
||||
{ .type = PCA9532_TYPE_NONE },
|
||||
{ .name = "n2100:orange:system",
|
||||
.state = PCA9532_OFF,
|
||||
.type = PCA9532_TYPE_LED,
|
||||
},
|
||||
{ .name = "n2100:red:system",
|
||||
.state = PCA9532_OFF,
|
||||
.type = PCA9532_TYPE_LED,
|
||||
},
|
||||
{ .name = "N2100 beeper" ,
|
||||
.state = PCA9532_OFF,
|
||||
.type = PCA9532_TYPE_N2100_BEEP,
|
||||
},
|
||||
},
|
||||
.psc = { 0, 0 },
|
||||
.pwm = { 0, 0 },
|
||||
};
|
||||
|
||||
static struct i2c_board_info __initdata n2100_i2c_devices[] = {
|
||||
{
|
||||
I2C_BOARD_INFO("rs5c372b", 0x32),
|
||||
|
@ -214,6 +262,10 @@ static struct i2c_board_info __initdata n2100_i2c_devices[] = {
|
|||
I2C_BOARD_INFO("f75375", 0x2e),
|
||||
.platform_data = &n2100_f75375s,
|
||||
},
|
||||
{
|
||||
I2C_BOARD_INFO("pca9532", 0x60),
|
||||
.platform_data = &n2100_leds,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include <linux/clk.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/semaphore.h>
|
||||
|
||||
#include <asm/semaphore.h>
|
||||
#include "clock.h"
|
||||
|
||||
static LIST_HEAD(clocks);
|
||||
|
|
|
@ -16,18 +16,24 @@ config CPU_PXA310
|
|||
config CPU_PXA320
|
||||
bool "PXA320 (codename Monahans-P)"
|
||||
|
||||
config CPU_PXA930
|
||||
bool "PXA930 (codename Tavor-P)"
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
|
||||
menu "Select target boards"
|
||||
|
||||
config ARCH_GUMSTIX
|
||||
bool "Gumstix XScale boards"
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a
|
||||
Gumstix Full Function Minature Computer.
|
||||
|
||||
config MACH_GUMSTIX_F
|
||||
bool "Basix, Connex, ws-200ax, ws-400ax systems"
|
||||
depends on ARCH_GUMSTIX
|
||||
select PXA25x
|
||||
|
||||
config ARCH_LUBBOCK
|
||||
bool "Intel DBPXA250 Development Platform"
|
||||
select PXA25x
|
||||
|
@ -58,146 +64,6 @@ config PXA_SHARPSL
|
|||
SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa)
|
||||
handheld computer.
|
||||
|
||||
config ARCH_PXA_ESERIES
|
||||
bool "PXA based Toshiba e-series PDAs"
|
||||
select PXA25x
|
||||
|
||||
config MACH_E330
|
||||
bool "Toshiba e330"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e330 family PDA.
|
||||
|
||||
config MACH_E740
|
||||
bool "Toshiba e740"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e740 family PDA.
|
||||
|
||||
config MACH_E750
|
||||
bool "Toshiba e750"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e750 family PDA.
|
||||
|
||||
config MACH_E400
|
||||
bool "Toshiba e400"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e400 family PDA.
|
||||
|
||||
config MACH_E800
|
||||
bool "Toshiba e800"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e800 family PDA.
|
||||
|
||||
config MACH_TRIZEPS4
|
||||
bool "Keith und Koep Trizeps4 DIMM-Module"
|
||||
select PXA27x
|
||||
|
||||
config MACH_EM_X270
|
||||
bool "CompuLab EM-x270 platform"
|
||||
select PXA27x
|
||||
|
||||
config MACH_COLIBRI
|
||||
bool "Toradex Colibri PX27x"
|
||||
select PXA27x
|
||||
|
||||
config MACH_ZYLONITE
|
||||
bool "PXA3xx Development Platform"
|
||||
select PXA3xx
|
||||
select HAVE_PWM
|
||||
|
||||
config MACH_LITTLETON
|
||||
bool "PXA3xx Form Factor Platform (aka Littleton)"
|
||||
select PXA3xx
|
||||
select PXA_SSP
|
||||
|
||||
config MACH_ARMCORE
|
||||
bool "CompuLab CM-X270 modules"
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
|
||||
config MACH_MAGICIAN
|
||||
bool "Enable HTC Magician Support"
|
||||
depends on ARCH_PXA
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
|
||||
config MACH_PCM027
|
||||
bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
|
||||
endmenu
|
||||
|
||||
choice
|
||||
prompt "Used baseboard"
|
||||
depends on MACH_PCM027
|
||||
|
||||
config MACH_PCM990_BASEBOARD
|
||||
bool "PHYTEC PCM-990 development board"
|
||||
select HAVE_PWM
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "display on pcm990"
|
||||
depends on MACH_PCM990_BASEBOARD
|
||||
|
||||
config PCM990_DISPLAY_SHARP
|
||||
bool "sharp lq084v1dg21 stn display"
|
||||
|
||||
config PCM990_DISPLAY_NEC
|
||||
bool "nec nl6448bc20_18d tft display"
|
||||
|
||||
config PCM990_DISPLAY_NONE
|
||||
bool "no display"
|
||||
|
||||
endchoice
|
||||
|
||||
if ARCH_GUMSTIX
|
||||
|
||||
choice
|
||||
prompt "Select target Gumstix board"
|
||||
|
||||
config MACH_GUMSTIX_F
|
||||
bool "Basix, Connex, ws-200ax, ws-400ax systems"
|
||||
select PXA25x
|
||||
|
||||
endchoice
|
||||
|
||||
endif
|
||||
|
||||
|
||||
if MACH_TRIZEPS4
|
||||
|
||||
choice
|
||||
prompt "Select base board for Trizeps 4 module"
|
||||
|
||||
config MACH_TRIZEPS4_CONXS
|
||||
bool "ConXS Eval Board"
|
||||
|
||||
config MACH_TRIZEPS4_ANY
|
||||
bool "another Board"
|
||||
|
||||
endchoice
|
||||
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
config MACH_POODLE
|
||||
bool "Enable Sharp SL-5600 (Poodle) Support"
|
||||
depends on PXA_SHARPSL
|
||||
|
@ -249,6 +115,186 @@ config MACH_TOSA
|
|||
depends on PXA_SHARPSL
|
||||
select PXA25x
|
||||
|
||||
config ARCH_PXA_ESERIES
|
||||
bool "PXA based Toshiba e-series PDAs"
|
||||
select PXA25x
|
||||
|
||||
config MACH_E330
|
||||
bool "Toshiba e330"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e330 family PDA.
|
||||
|
||||
config MACH_E350
|
||||
bool "Toshiba e350"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e350 family PDA.
|
||||
|
||||
config MACH_E740
|
||||
bool "Toshiba e740"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
select FB_W100
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e740 family PDA.
|
||||
|
||||
config MACH_E750
|
||||
bool "Toshiba e750"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
select FB_W100
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e750 family PDA.
|
||||
|
||||
config MACH_E400
|
||||
bool "Toshiba e400"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e400 family PDA.
|
||||
|
||||
config MACH_E800
|
||||
bool "Toshiba e800"
|
||||
default y
|
||||
depends on ARCH_PXA_ESERIES
|
||||
select FB_W100
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Toshiba
|
||||
e800 family PDA.
|
||||
|
||||
config MACH_TRIZEPS4
|
||||
bool "Keith und Koep Trizeps4 DIMM-Module"
|
||||
select PXA27x
|
||||
|
||||
config MACH_TRIZEPS4_CONXS
|
||||
bool "ConXS Eval Board"
|
||||
depends on MACH_TRIZEPS4
|
||||
|
||||
config MACH_EM_X270
|
||||
bool "CompuLab EM-x270 platform"
|
||||
select PXA27x
|
||||
|
||||
config MACH_COLIBRI
|
||||
bool "Toradex Colibri PX27x"
|
||||
select PXA27x
|
||||
|
||||
config MACH_ZYLONITE
|
||||
bool "PXA3xx Development Platform (aka Zylonite)"
|
||||
select PXA3xx
|
||||
select HAVE_PWM
|
||||
|
||||
config MACH_LITTLETON
|
||||
bool "PXA3xx Form Factor Platform (aka Littleton)"
|
||||
select PXA3xx
|
||||
select PXA_SSP
|
||||
|
||||
config MACH_TAVOREVB
|
||||
bool "PXA930 Evaluation Board (aka TavorEVB)"
|
||||
select PXA3xx
|
||||
select PXA930
|
||||
|
||||
config MACH_SAAR
|
||||
bool "PXA930 Handheld Platform (aka SAAR)"
|
||||
select PXA3xx
|
||||
select PXA930
|
||||
|
||||
config MACH_ARMCORE
|
||||
bool "CompuLab CM-X270 modules"
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
|
||||
config MACH_MAGICIAN
|
||||
bool "Enable HTC Magician Support"
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
|
||||
config MACH_PCM027
|
||||
bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
select PXA_SSP
|
||||
|
||||
config ARCH_PXA_PALM
|
||||
bool "PXA based Palm PDAs"
|
||||
select HAVE_PWM
|
||||
|
||||
config MACH_PALMTX
|
||||
bool "Palm T|X"
|
||||
default y
|
||||
depends on ARCH_PXA_PALM
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Palm T|X
|
||||
handheld computer.
|
||||
|
||||
config MACH_PCM990_BASEBOARD
|
||||
bool "PHYTEC PCM-990 development board"
|
||||
select HAVE_PWM
|
||||
depends on MACH_PCM027
|
||||
|
||||
choice
|
||||
prompt "display on pcm990"
|
||||
depends on MACH_PCM990_BASEBOARD
|
||||
|
||||
config PCM990_DISPLAY_SHARP
|
||||
bool "sharp lq084v1dg21 stn display"
|
||||
|
||||
config PCM990_DISPLAY_NEC
|
||||
bool "nec nl6448bc20_18d tft display"
|
||||
|
||||
config PCM990_DISPLAY_NONE
|
||||
bool "no display"
|
||||
|
||||
endchoice
|
||||
|
||||
|
||||
config PXA_EZX
|
||||
bool "Motorola EZX Platform"
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
select HAVE_PWM
|
||||
|
||||
config MACH_EZX_A780
|
||||
bool "Motorola EZX A780"
|
||||
default y
|
||||
depends on PXA_EZX
|
||||
|
||||
config MACH_EZX_E680
|
||||
bool "Motorola EZX E680"
|
||||
default y
|
||||
depends on PXA_EZX
|
||||
|
||||
config MACH_EZX_A1200
|
||||
bool "Motorola EZX A1200"
|
||||
default y
|
||||
depends on PXA_EZX
|
||||
|
||||
config MACH_EZX_A910
|
||||
bool "Motorola EZX A910"
|
||||
default y
|
||||
depends on PXA_EZX
|
||||
|
||||
config MACH_EZX_E6
|
||||
bool "Motorola EZX E6"
|
||||
default y
|
||||
depends on PXA_EZX
|
||||
|
||||
config MACH_EZX_E2
|
||||
bool "Motorola EZX E2"
|
||||
default y
|
||||
depends on PXA_EZX
|
||||
|
||||
endmenu
|
||||
|
||||
config PXA25x
|
||||
bool
|
||||
help
|
||||
|
@ -288,4 +334,13 @@ config PXA_PWM
|
|||
default BACKLIGHT_PWM
|
||||
help
|
||||
Enable support for PXA2xx/PXA3xx PWM controllers
|
||||
|
||||
config TOSA_BT
|
||||
tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
|
||||
depends on MACH_TOSA
|
||||
select RFKILL
|
||||
help
|
||||
This is a simple driver that is able to control
|
||||
the state of built in bluetooth chip on tosa.
|
||||
|
||||
endif
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
# Common support (must be linked before board specific support)
|
||||
obj-y += clock.o devices.o generic.o irq.o dma.o \
|
||||
time.o gpio.o
|
||||
time.o gpio.o reset.o
|
||||
obj-$(CONFIG_PM) += pm.o sleep.o standby.o
|
||||
obj-$(CONFIG_CPU_FREQ) += cpu-pxa.o
|
||||
|
||||
|
@ -18,6 +18,7 @@ obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o pxa2xx.o pxa27x.o
|
|||
obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o
|
||||
obj-$(CONFIG_CPU_PXA300) += pxa300.o
|
||||
obj-$(CONFIG_CPU_PXA320) += pxa320.o
|
||||
obj-$(CONFIG_CPU_PXA930) += pxa930.o
|
||||
|
||||
# Specific board support
|
||||
obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
|
||||
|
@ -36,7 +37,12 @@ obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
|
|||
obj-$(CONFIG_MACH_TOSA) += tosa.o
|
||||
obj-$(CONFIG_MACH_EM_X270) += em-x270.o
|
||||
obj-$(CONFIG_MACH_MAGICIAN) += magician.o
|
||||
obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
|
||||
obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o eseries_udc.o
|
||||
obj-$(CONFIG_MACH_E740) += e740_lcd.o
|
||||
obj-$(CONFIG_MACH_E750) += e750_lcd.o
|
||||
obj-$(CONFIG_MACH_E400) += e400_lcd.o
|
||||
obj-$(CONFIG_MACH_E800) += e800_lcd.o
|
||||
obj-$(CONFIG_MACH_PALMTX) += palmtx.o
|
||||
|
||||
ifeq ($(CONFIG_MACH_ZYLONITE),y)
|
||||
obj-y += zylonite.o
|
||||
|
@ -44,8 +50,11 @@ ifeq ($(CONFIG_MACH_ZYLONITE),y)
|
|||
obj-$(CONFIG_CPU_PXA320) += zylonite_pxa320.o
|
||||
endif
|
||||
obj-$(CONFIG_MACH_LITTLETON) += littleton.o
|
||||
obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
|
||||
obj-$(CONFIG_MACH_SAAR) += saar.o
|
||||
|
||||
obj-$(CONFIG_MACH_ARMCORE) += cm-x270.o
|
||||
obj-$(CONFIG_PXA_EZX) += ezx.o
|
||||
|
||||
# Support for blinky lights
|
||||
led-y := leds.o
|
||||
|
@ -59,3 +68,5 @@ obj-$(CONFIG_LEDS) += $(led-y)
|
|||
ifeq ($(CONFIG_PCI),y)
|
||||
obj-$(CONFIG_MACH_ARMCORE) += cm-x270-pci.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_TOSA_BT) += tosa-bt.o
|
||||
|
|
|
@ -101,21 +101,6 @@ unsigned long clk_get_rate(struct clk *clk)
|
|||
EXPORT_SYMBOL(clk_get_rate);
|
||||
|
||||
|
||||
static void clk_gpio27_enable(struct clk *clk)
|
||||
{
|
||||
pxa_gpio_mode(GPIO11_3_6MHz_MD);
|
||||
}
|
||||
|
||||
static void clk_gpio27_disable(struct clk *clk)
|
||||
{
|
||||
}
|
||||
|
||||
static const struct clkops clk_gpio27_ops = {
|
||||
.enable = clk_gpio27_enable,
|
||||
.disable = clk_gpio27_disable,
|
||||
};
|
||||
|
||||
|
||||
void clk_cken_enable(struct clk *clk)
|
||||
{
|
||||
CKEN |= 1 << clk->cken;
|
||||
|
@ -131,14 +116,6 @@ const struct clkops clk_cken_ops = {
|
|||
.disable = clk_cken_disable,
|
||||
};
|
||||
|
||||
static struct clk common_clks[] = {
|
||||
{
|
||||
.name = "GPIO27_CLK",
|
||||
.ops = &clk_gpio27_ops,
|
||||
.rate = 3686400,
|
||||
},
|
||||
};
|
||||
|
||||
void clks_register(struct clk *clks, size_t num)
|
||||
{
|
||||
int i;
|
||||
|
@ -148,10 +125,3 @@ void clks_register(struct clk *clks, size_t num)
|
|||
list_add(&clks[i].node, &clocks);
|
||||
mutex_unlock(&clocks_mutex);
|
||||
}
|
||||
|
||||
static int __init clk_init(void)
|
||||
{
|
||||
clks_register(common_clks, ARRAY_SIZE(common_clks));
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(clk_init);
|
||||
|
|
|
@ -47,9 +47,42 @@ struct clk {
|
|||
.other = _other, \
|
||||
}
|
||||
|
||||
#define INIT_CLK(_name, _ops, _rate, _delay, _dev) \
|
||||
{ \
|
||||
.name = _name, \
|
||||
.dev = _dev, \
|
||||
.ops = _ops, \
|
||||
.rate = _rate, \
|
||||
.delay = _delay, \
|
||||
}
|
||||
|
||||
extern const struct clkops clk_cken_ops;
|
||||
|
||||
void clk_cken_enable(struct clk *clk);
|
||||
void clk_cken_disable(struct clk *clk);
|
||||
|
||||
#ifdef CONFIG_PXA3xx
|
||||
#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \
|
||||
{ \
|
||||
.name = _name, \
|
||||
.dev = _dev, \
|
||||
.ops = &clk_pxa3xx_cken_ops, \
|
||||
.rate = _rate, \
|
||||
.cken = CKEN_##_cken, \
|
||||
.delay = _delay, \
|
||||
}
|
||||
|
||||
#define PXA3xx_CK(_name, _cken, _ops, _dev) \
|
||||
{ \
|
||||
.name = _name, \
|
||||
.dev = _dev, \
|
||||
.ops = _ops, \
|
||||
.cken = CKEN_##_cken, \
|
||||
}
|
||||
|
||||
extern const struct clkops clk_pxa3xx_cken_ops;
|
||||
extern void clk_pxa3xx_cken_enable(struct clk *);
|
||||
extern void clk_pxa3xx_cken_disable(struct clk *);
|
||||
#endif
|
||||
|
||||
void clks_register(struct clk *clks, size_t num);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*
|
||||
* Bits taken from various places.
|
||||
*
|
||||
* Copyright (C) 2007 Compulab, Ltd.
|
||||
* Copyright (C) 2007, 2008 Compulab, Ltd.
|
||||
* Mike Rapoport <mike@compulab.co.il>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -19,16 +19,16 @@
|
|||
#include <linux/device.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/gpio.h>
|
||||
|
||||
#include <asm/mach/pci.h>
|
||||
#include <asm/arch/cm-x270.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-gpio.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/hardware/it8152.h>
|
||||
|
||||
unsigned long it8152_base_address = CMX270_IT8152_VIRT;
|
||||
unsigned long it8152_base_address;
|
||||
static int cmx270_it8152_irq_gpio;
|
||||
|
||||
/*
|
||||
* Only first 64MB of memory can be accessed via PCI.
|
||||
|
@ -42,7 +42,7 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
|
|||
unsigned int sz = SZ_64M >> PAGE_SHIFT;
|
||||
|
||||
if (machine_is_armcore()) {
|
||||
pr_info("Adjusting zones for CM-x270\n");
|
||||
pr_info("Adjusting zones for CM-X270\n");
|
||||
|
||||
/*
|
||||
* Only adjust if > 64M on current system
|
||||
|
@ -60,19 +60,20 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
|
|||
static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
/* clear our parent irq */
|
||||
GEDR(GPIO_IT8152_IRQ) = GPIO_bit(GPIO_IT8152_IRQ);
|
||||
GEDR(cmx270_it8152_irq_gpio) = GPIO_bit(cmx270_it8152_irq_gpio);
|
||||
|
||||
it8152_irq_demux(irq, desc);
|
||||
}
|
||||
|
||||
void __cmx270_pci_init_irq(void)
|
||||
void __cmx270_pci_init_irq(int irq_gpio)
|
||||
{
|
||||
it8152_init_irq();
|
||||
pxa_gpio_mode(IRQ_TO_GPIO(GPIO_IT8152_IRQ));
|
||||
set_irq_type(IRQ_GPIO(GPIO_IT8152_IRQ), IRQT_RISING);
|
||||
|
||||
set_irq_chained_handler(IRQ_GPIO(GPIO_IT8152_IRQ),
|
||||
cmx270_it8152_irq_demux);
|
||||
cmx270_it8152_irq_gpio = irq_gpio;
|
||||
|
||||
set_irq_type(gpio_to_irq(irq_gpio), IRQT_RISING);
|
||||
|
||||
set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx270_it8152_irq_demux);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
@ -115,8 +116,8 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
|
|||
|
||||
/*
|
||||
Here comes the ugly part. The routing is baseboard specific,
|
||||
but defining a platform for each possible base of CM-x270 is
|
||||
unrealistic. Here we keep mapping for ATXBase and SB-x270.
|
||||
but defining a platform for each possible base of CM-X270 is
|
||||
unrealistic. Here we keep mapping for ATXBase and SB-X270.
|
||||
*/
|
||||
/* ATXBASE PCI slot */
|
||||
if (slot == 7)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
extern void __cmx270_pci_init_irq(void);
|
||||
extern void __cmx270_pci_init_irq(int irq_gpio);
|
||||
extern void __cmx270_pci_suspend(void);
|
||||
extern void __cmx270_pci_resume(void);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
#define cmx270_pci_init_irq __cmx270_pci_init_irq
|
||||
#define cmx270_pci_suspend __cmx270_pci_suspend
|
||||
#define cmx270_pci_resume __cmx270_pci_resume
|
||||
#define cmx270_pci_init_irq(x) __cmx270_pci_init_irq(x)
|
||||
#define cmx270_pci_suspend(x) __cmx270_pci_suspend(x)
|
||||
#define cmx270_pci_resume(x) __cmx270_pci_resume(x)
|
||||
#else
|
||||
#define cmx270_pci_init_irq() do {} while (0)
|
||||
#define cmx270_pci_suspend() do {} while (0)
|
||||
#define cmx270_pci_resume() do {} while (0)
|
||||
#define cmx270_pci_init_irq(x) do {} while (0)
|
||||
#define cmx270_pci_suspend(x) do {} while (0)
|
||||
#define cmx270_pci_resume(x) do {} while (0)
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-pxa/cm-x270.c
|
||||
*
|
||||
* Copyright (C) 2007 CompuLab, Ltd.
|
||||
* Copyright (C) 2007, 2008 CompuLab, Ltd.
|
||||
* Mike Rapoport <mike@compulab.co.il>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -9,44 +9,156 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/gpio.h>
|
||||
|
||||
#include <linux/dm9000.h>
|
||||
#include <linux/rtc-v3020.h>
|
||||
#include <linux/serial_8250.h>
|
||||
|
||||
#include <video/mbxfb.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/map.h>
|
||||
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-regs.h>
|
||||
#include <asm/arch/pxa2xx-gpio.h>
|
||||
#include <asm/arch/mfp-pxa27x.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/audio.h>
|
||||
#include <asm/arch/pxafb.h>
|
||||
#include <asm/arch/ohci.h>
|
||||
#include <asm/arch/mmc.h>
|
||||
#include <asm/arch/bitfield.h>
|
||||
#include <asm/arch/cm-x270.h>
|
||||
|
||||
#include <asm/hardware/it8152.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "cm-x270-pci.h"
|
||||
|
||||
/* virtual addresses for statically mapped regions */
|
||||
#define CMX270_VIRT_BASE (0xe8000000)
|
||||
#define CMX270_IT8152_VIRT (CMX270_VIRT_BASE)
|
||||
|
||||
#define RTC_PHYS_BASE (PXA_CS1_PHYS + (5 << 22))
|
||||
#define DM9000_PHYS_BASE (PXA_CS1_PHYS + (6 << 22))
|
||||
|
||||
static struct resource cmx270_dm9k_resource[] = {
|
||||
/* GPIO IRQ usage */
|
||||
#define GPIO10_ETHIRQ (10)
|
||||
#define GPIO22_IT8152_IRQ (22)
|
||||
#define GPIO83_MMC_IRQ (83)
|
||||
#define GPIO95_GFXIRQ (95)
|
||||
|
||||
#define CMX270_ETHIRQ IRQ_GPIO(GPIO10_ETHIRQ)
|
||||
#define CMX270_IT8152_IRQ IRQ_GPIO(GPIO22_IT8152_IRQ)
|
||||
#define CMX270_MMC_IRQ IRQ_GPIO(GPIO83_MMC_IRQ)
|
||||
#define CMX270_GFXIRQ IRQ_GPIO(GPIO95_GFXIRQ)
|
||||
|
||||
/* MMC power enable */
|
||||
#define GPIO105_MMC_POWER (105)
|
||||
|
||||
static unsigned long cmx270_pin_config[] = {
|
||||
/* AC'97 */
|
||||
GPIO28_AC97_BITCLK,
|
||||
GPIO29_AC97_SDATA_IN_0,
|
||||
GPIO30_AC97_SDATA_OUT,
|
||||
GPIO31_AC97_SYNC,
|
||||
GPIO98_AC97_SYSCLK,
|
||||
GPIO113_AC97_nRESET,
|
||||
|
||||
/* BTUART */
|
||||
GPIO42_BTUART_RXD,
|
||||
GPIO43_BTUART_TXD,
|
||||
GPIO44_BTUART_CTS,
|
||||
GPIO45_BTUART_RTS,
|
||||
|
||||
/* STUART */
|
||||
GPIO46_STUART_RXD,
|
||||
GPIO47_STUART_TXD,
|
||||
|
||||
/* MCI controller */
|
||||
GPIO32_MMC_CLK,
|
||||
GPIO112_MMC_CMD,
|
||||
GPIO92_MMC_DAT_0,
|
||||
GPIO109_MMC_DAT_1,
|
||||
GPIO110_MMC_DAT_2,
|
||||
GPIO111_MMC_DAT_3,
|
||||
|
||||
/* LCD */
|
||||
GPIO58_LCD_LDD_0,
|
||||
GPIO59_LCD_LDD_1,
|
||||
GPIO60_LCD_LDD_2,
|
||||
GPIO61_LCD_LDD_3,
|
||||
GPIO62_LCD_LDD_4,
|
||||
GPIO63_LCD_LDD_5,
|
||||
GPIO64_LCD_LDD_6,
|
||||
GPIO65_LCD_LDD_7,
|
||||
GPIO66_LCD_LDD_8,
|
||||
GPIO67_LCD_LDD_9,
|
||||
GPIO68_LCD_LDD_10,
|
||||
GPIO69_LCD_LDD_11,
|
||||
GPIO70_LCD_LDD_12,
|
||||
GPIO71_LCD_LDD_13,
|
||||
GPIO72_LCD_LDD_14,
|
||||
GPIO73_LCD_LDD_15,
|
||||
GPIO74_LCD_FCLK,
|
||||
GPIO75_LCD_LCLK,
|
||||
GPIO76_LCD_PCLK,
|
||||
GPIO77_LCD_BIAS,
|
||||
|
||||
/* I2C */
|
||||
GPIO117_I2C_SCL,
|
||||
GPIO118_I2C_SDA,
|
||||
|
||||
/* SSP1 */
|
||||
GPIO23_SSP1_SCLK,
|
||||
GPIO24_SSP1_SFRM,
|
||||
GPIO25_SSP1_TXD,
|
||||
GPIO26_SSP1_RXD,
|
||||
|
||||
/* SSP2 */
|
||||
GPIO19_SSP2_SCLK,
|
||||
GPIO14_SSP2_SFRM,
|
||||
GPIO87_SSP2_TXD,
|
||||
GPIO88_SSP2_RXD,
|
||||
|
||||
/* PC Card */
|
||||
GPIO48_nPOE,
|
||||
GPIO49_nPWE,
|
||||
GPIO50_nPIOR,
|
||||
GPIO51_nPIOW,
|
||||
GPIO85_nPCE_1,
|
||||
GPIO54_nPCE_2,
|
||||
GPIO55_nPREG,
|
||||
GPIO56_nPWAIT,
|
||||
GPIO57_nIOIS16,
|
||||
|
||||
/* SDRAM and local bus */
|
||||
GPIO15_nCS_1,
|
||||
GPIO78_nCS_2,
|
||||
GPIO79_nCS_3,
|
||||
GPIO80_nCS_4,
|
||||
GPIO33_nCS_5,
|
||||
GPIO49_nPWE,
|
||||
GPIO18_RDY,
|
||||
|
||||
/* GPIO */
|
||||
GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH,
|
||||
GPIO105_GPIO | MFP_LPM_DRIVE_HIGH, /* MMC/SD power */
|
||||
GPIO53_GPIO, /* PC card reset */
|
||||
|
||||
/* NAND controls */
|
||||
GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */
|
||||
GPIO89_GPIO, /* NAND Ready/Busy */
|
||||
|
||||
/* interrupts */
|
||||
GPIO10_GPIO, /* DM9000 interrupt */
|
||||
GPIO83_GPIO, /* MMC card detect */
|
||||
};
|
||||
|
||||
#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
|
||||
static struct resource cmx270_dm9000_resource[] = {
|
||||
[0] = {
|
||||
.start = DM9000_PHYS_BASE,
|
||||
.end = DM9000_PHYS_BASE + 4,
|
||||
|
@ -64,31 +176,45 @@ static struct resource cmx270_dm9k_resource[] = {
|
|||
}
|
||||
};
|
||||
|
||||
/* for the moment we limit ourselves to 32bit IO until some
|
||||
* better IO routines can be written and tested
|
||||
*/
|
||||
static struct dm9000_plat_data cmx270_dm9k_platdata = {
|
||||
static struct dm9000_plat_data cmx270_dm9000_platdata = {
|
||||
.flags = DM9000_PLATF_32BITONLY,
|
||||
};
|
||||
|
||||
/* Ethernet device */
|
||||
static struct platform_device cmx270_device_dm9k = {
|
||||
static struct platform_device cmx270_dm9000_device = {
|
||||
.name = "dm9000",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(cmx270_dm9k_resource),
|
||||
.resource = cmx270_dm9k_resource,
|
||||
.num_resources = ARRAY_SIZE(cmx270_dm9000_resource),
|
||||
.resource = cmx270_dm9000_resource,
|
||||
.dev = {
|
||||
.platform_data = &cmx270_dm9k_platdata,
|
||||
.platform_data = &cmx270_dm9000_platdata,
|
||||
}
|
||||
};
|
||||
|
||||
/* touchscreen controller */
|
||||
static void __init cmx270_init_dm9000(void)
|
||||
{
|
||||
platform_device_register(&cmx270_dm9000_device);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_dm9000(void) {}
|
||||
#endif
|
||||
|
||||
/* UCB1400 touchscreen controller */
|
||||
#if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
|
||||
static struct platform_device cmx270_ts_device = {
|
||||
.name = "ucb1400_ts",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
/* RTC */
|
||||
static void __init cmx270_init_touchscreen(void)
|
||||
{
|
||||
platform_device_register(&cmx270_ts_device);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_touchscreen(void) {}
|
||||
#endif
|
||||
|
||||
/* V3020 RTC */
|
||||
#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE)
|
||||
static struct resource cmx270_v3020_resource[] = {
|
||||
[0] = {
|
||||
.start = RTC_PHYS_BASE,
|
||||
|
@ -111,28 +237,67 @@ static struct platform_device cmx270_rtc_device = {
|
|||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* CM-X270 LEDs
|
||||
*/
|
||||
static struct platform_device cmx270_led_device = {
|
||||
.name = "cm-x270-led",
|
||||
.id = -1,
|
||||
static void __init cmx270_init_rtc(void)
|
||||
{
|
||||
platform_device_register(&cmx270_rtc_device);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_rtc(void) {}
|
||||
#endif
|
||||
|
||||
/* CM-X270 LEDs */
|
||||
#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
|
||||
static struct gpio_led cmx270_leds[] = {
|
||||
[0] = {
|
||||
.name = "cm-x270:red",
|
||||
.default_trigger = "nand-disk",
|
||||
.gpio = 93,
|
||||
.active_low = 1,
|
||||
},
|
||||
[1] = {
|
||||
.name = "cm-x270:green",
|
||||
.default_trigger = "heartbeat",
|
||||
.gpio = 94,
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_led_platform_data cmx270_gpio_led_pdata = {
|
||||
.num_leds = ARRAY_SIZE(cmx270_leds),
|
||||
.leds = cmx270_leds,
|
||||
};
|
||||
|
||||
static struct platform_device cmx270_led_device = {
|
||||
.name = "leds-gpio",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &cmx270_gpio_led_pdata,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init cmx270_init_leds(void)
|
||||
{
|
||||
platform_device_register(&cmx270_led_device);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_leds(void) {}
|
||||
#endif
|
||||
|
||||
/* 2700G graphics */
|
||||
#if defined(CONFIG_FB_MBX) || defined(CONFIG_FB_MBX_MODULE)
|
||||
static u64 fb_dma_mask = ~(u64)0;
|
||||
|
||||
static struct resource cmx270_2700G_resource[] = {
|
||||
/* frame buffer memory including ODFB and External SDRAM */
|
||||
[0] = {
|
||||
.start = MARATHON_PHYS,
|
||||
.end = MARATHON_PHYS + 0x02000000,
|
||||
.start = PXA_CS2_PHYS,
|
||||
.end = PXA_CS2_PHYS + 0x01ffffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
/* Marathon registers */
|
||||
[1] = {
|
||||
.start = MARATHON_PHYS + 0x03fe0000,
|
||||
.end = MARATHON_PHYS + 0x03ffffff,
|
||||
.start = PXA_CS2_PHYS + 0x03fe0000,
|
||||
.end = PXA_CS2_PHYS + 0x03ffffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
@ -200,43 +365,15 @@ static struct platform_device cmx270_2700G = {
|
|||
.id = -1,
|
||||
};
|
||||
|
||||
static u64 ata_dma_mask = ~(u64)0;
|
||||
|
||||
static struct platform_device cmx270_ata = {
|
||||
.name = "pata_cm_x270",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.dma_mask = &ata_dma_mask,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
},
|
||||
};
|
||||
|
||||
/* platform devices */
|
||||
static struct platform_device *platform_devices[] __initdata = {
|
||||
&cmx270_device_dm9k,
|
||||
&cmx270_rtc_device,
|
||||
&cmx270_2700G,
|
||||
&cmx270_led_device,
|
||||
&cmx270_ts_device,
|
||||
&cmx270_ata,
|
||||
};
|
||||
|
||||
/* Map PCI companion and IDE/General Purpose CS statically */
|
||||
static struct map_desc cmx270_io_desc[] __initdata = {
|
||||
[0] = { /* IDE/general purpose space */
|
||||
.virtual = CMX270_IDE104_VIRT,
|
||||
.pfn = __phys_to_pfn(CMX270_IDE104_PHYS),
|
||||
.length = SZ_64M - SZ_8M,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
[1] = { /* PCI bridge */
|
||||
.virtual = CMX270_IT8152_VIRT,
|
||||
.pfn = __phys_to_pfn(CMX270_IT8152_PHYS),
|
||||
.length = SZ_64M,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
};
|
||||
static void __init cmx270_init_2700G(void)
|
||||
{
|
||||
platform_device_register(&cmx270_2700G);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_2700G(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
|
||||
/*
|
||||
Display definitions
|
||||
keep these for backwards compatibility, although symbolic names (as
|
||||
|
@ -446,7 +583,16 @@ static int __init cmx270_set_display(char *str)
|
|||
*/
|
||||
__setup("monitor=", cmx270_set_display);
|
||||
|
||||
static void __init cmx270_init_display(void)
|
||||
{
|
||||
set_pxa_fb_info(cmx270_display);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_display(void) {}
|
||||
#endif
|
||||
|
||||
/* PXA27x OHCI controller setup */
|
||||
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
|
||||
static int cmx270_ohci_init(struct device *dev)
|
||||
{
|
||||
/* Set the Power Control Polarity Low */
|
||||
|
@ -461,35 +607,37 @@ static struct pxaohci_platform_data cmx270_ohci_platform_data = {
|
|||
.init = cmx270_ohci_init,
|
||||
};
|
||||
|
||||
static void __init cmx270_init_ohci(void)
|
||||
{
|
||||
pxa_set_ohci_info(&cmx270_ohci_platform_data);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_ohci(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
|
||||
static int cmx270_mci_init(struct device *dev,
|
||||
irq_handler_t cmx270_detect_int,
|
||||
void *data)
|
||||
{
|
||||
int err;
|
||||
|
||||
/*
|
||||
* setup GPIO for PXA27x MMC controller
|
||||
*/
|
||||
pxa_gpio_mode(GPIO32_MMCCLK_MD);
|
||||
pxa_gpio_mode(GPIO112_MMCCMD_MD);
|
||||
pxa_gpio_mode(GPIO92_MMCDAT0_MD);
|
||||
pxa_gpio_mode(GPIO109_MMCDAT1_MD);
|
||||
pxa_gpio_mode(GPIO110_MMCDAT2_MD);
|
||||
pxa_gpio_mode(GPIO111_MMCDAT3_MD);
|
||||
err = gpio_request(GPIO105_MMC_POWER, "MMC/SD power");
|
||||
if (err) {
|
||||
dev_warn(dev, "power gpio unavailable\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
/* SB-X270 uses GPIO105 as SD power enable */
|
||||
pxa_gpio_mode(105 | GPIO_OUT);
|
||||
|
||||
/* card detect IRQ on GPIO 83 */
|
||||
pxa_gpio_mode(IRQ_TO_GPIO(CMX270_MMC_IRQ));
|
||||
gpio_direction_output(GPIO105_MMC_POWER, 0);
|
||||
|
||||
err = request_irq(CMX270_MMC_IRQ, cmx270_detect_int,
|
||||
IRQF_DISABLED | IRQF_TRIGGER_FALLING,
|
||||
"MMC card detect", data);
|
||||
if (err)
|
||||
printk(KERN_ERR "cmx270_mci_init: MMC/SD: can't"
|
||||
" request MMC card detect IRQ\n");
|
||||
if (err) {
|
||||
gpio_free(GPIO105_MMC_POWER);
|
||||
dev_err(dev, "cmx270_mci_init: MMC/SD: can't"
|
||||
" request MMC card detect IRQ\n");
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -499,17 +647,18 @@ static void cmx270_mci_setpower(struct device *dev, unsigned int vdd)
|
|||
struct pxamci_platform_data *p_d = dev->platform_data;
|
||||
|
||||
if ((1 << vdd) & p_d->ocr_mask) {
|
||||
printk(KERN_DEBUG "%s: on\n", __func__);
|
||||
GPCR(105) = GPIO_bit(105);
|
||||
dev_dbg(dev, "power on\n");
|
||||
gpio_set_value(GPIO105_MMC_POWER, 0);
|
||||
} else {
|
||||
GPSR(105) = GPIO_bit(105);
|
||||
printk(KERN_DEBUG "%s: off\n", __func__);
|
||||
gpio_set_value(GPIO105_MMC_POWER, 1);
|
||||
dev_dbg(dev, "power off\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void cmx270_mci_exit(struct device *dev, void *data)
|
||||
{
|
||||
free_irq(CMX270_MMC_IRQ, data);
|
||||
gpio_free(GPIO105_MMC_POWER);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data cmx270_mci_platform_data = {
|
||||
|
@ -519,6 +668,14 @@ static struct pxamci_platform_data cmx270_mci_platform_data = {
|
|||
.exit = cmx270_mci_exit,
|
||||
};
|
||||
|
||||
static void __init cmx270_init_mmc(void)
|
||||
{
|
||||
pxa_set_mci_info(&cmx270_mci_platform_data);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_mmc(void) {}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static unsigned long sleep_save_msc[10];
|
||||
|
||||
|
@ -580,53 +737,63 @@ static int __init cmx270_pm_init(void)
|
|||
static int __init cmx270_pm_init(void) { return 0; }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE)
|
||||
static void __init cmx270_init_ac97(void)
|
||||
{
|
||||
pxa_set_ac97_info(NULL);
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_ac97(void) {}
|
||||
#endif
|
||||
|
||||
static void __init cmx270_init(void)
|
||||
{
|
||||
cmx270_pm_init();
|
||||
|
||||
set_pxa_fb_info(cmx270_display);
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config));
|
||||
|
||||
/* register CM-X270 platform devices */
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
pxa_set_ac97_info(NULL);
|
||||
|
||||
/* set MCI and OHCI platform parameters */
|
||||
pxa_set_mci_info(&cmx270_mci_platform_data);
|
||||
pxa_set_ohci_info(&cmx270_ohci_platform_data);
|
||||
|
||||
/* This enables the STUART */
|
||||
pxa_gpio_mode(GPIO46_STRXD_MD);
|
||||
pxa_gpio_mode(GPIO47_STTXD_MD);
|
||||
|
||||
/* This enables the BTUART */
|
||||
pxa_gpio_mode(GPIO42_BTRXD_MD);
|
||||
pxa_gpio_mode(GPIO43_BTTXD_MD);
|
||||
pxa_gpio_mode(GPIO44_BTCTS_MD);
|
||||
pxa_gpio_mode(GPIO45_BTRTS_MD);
|
||||
cmx270_init_dm9000();
|
||||
cmx270_init_rtc();
|
||||
cmx270_init_display();
|
||||
cmx270_init_mmc();
|
||||
cmx270_init_ohci();
|
||||
cmx270_init_ac97();
|
||||
cmx270_init_touchscreen();
|
||||
cmx270_init_leds();
|
||||
cmx270_init_2700G();
|
||||
}
|
||||
|
||||
static void __init cmx270_init_irq(void)
|
||||
{
|
||||
pxa27x_init_irq();
|
||||
|
||||
|
||||
cmx270_pci_init_irq();
|
||||
|
||||
/* Setup interrupt for dm9000 */
|
||||
pxa_gpio_mode(IRQ_TO_GPIO(CMX270_ETHIRQ));
|
||||
set_irq_type(CMX270_ETHIRQ, IRQT_RISING);
|
||||
|
||||
/* Setup interrupt for 2700G */
|
||||
pxa_gpio_mode(IRQ_TO_GPIO(CMX270_GFXIRQ));
|
||||
set_irq_type(CMX270_GFXIRQ, IRQT_FALLING);
|
||||
cmx270_pci_init_irq(GPIO22_IT8152_IRQ);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
/* Map PCI companion statically */
|
||||
static struct map_desc cmx270_io_desc[] __initdata = {
|
||||
[0] = { /* PCI bridge */
|
||||
.virtual = CMX270_IT8152_VIRT,
|
||||
.pfn = __phys_to_pfn(PXA_CS4_PHYS),
|
||||
.length = SZ_64M,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
};
|
||||
|
||||
static void __init cmx270_map_io(void)
|
||||
{
|
||||
pxa_map_io();
|
||||
iotable_init(cmx270_io_desc, ARRAY_SIZE(cmx270_io_desc));
|
||||
}
|
||||
|
||||
it8152_base_address = CMX270_IT8152_VIRT;
|
||||
}
|
||||
#else
|
||||
static void __init cmx270_map_io(void)
|
||||
{
|
||||
pxa_map_io();
|
||||
}
|
||||
#endif
|
||||
|
||||
MACHINE_START(ARMCORE, "Compulab CM-x270")
|
||||
.boot_params = 0xa0000100,
|
||||
|
|
|
@ -465,6 +465,7 @@ static void corgi_irda_transceiver_mode(struct device *dev, int mode)
|
|||
GPSR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
|
||||
else
|
||||
GPCR(CORGI_GPIO_IR_ON) = GPIO_bit(CORGI_GPIO_IR_ON);
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
}
|
||||
|
||||
static struct pxaficp_platform_data corgi_ficp_platform_data = {
|
||||
|
|
|
@ -13,8 +13,10 @@
|
|||
#include <asm/arch/mfp-pxa27x.h>
|
||||
#include <asm/arch/ohci.h>
|
||||
#include <asm/arch/pxa27x_keypad.h>
|
||||
#include <asm/arch/pxa2xx_spi.h>
|
||||
#include <asm/arch/camera.h>
|
||||
#include <asm/arch/audio.h>
|
||||
#include <asm/arch/pxa3xx_nand.h>
|
||||
|
||||
#include "devices.h"
|
||||
#include "generic.h"
|
||||
|
@ -830,4 +832,63 @@ void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
|
|||
pxa_register_device(&pxa3xx_device_mci3, info);
|
||||
}
|
||||
|
||||
static struct resource pxa3xx_resources_nand[] = {
|
||||
[0] = {
|
||||
.start = 0x43100000,
|
||||
.end = 0x43100053,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = IRQ_NAND,
|
||||
.end = IRQ_NAND,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
[2] = {
|
||||
/* DRCMR for Data DMA */
|
||||
.start = 97,
|
||||
.end = 97,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
[3] = {
|
||||
/* DRCMR for Command DMA */
|
||||
.start = 99,
|
||||
.end = 99,
|
||||
.flags = IORESOURCE_DMA,
|
||||
},
|
||||
};
|
||||
|
||||
static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
|
||||
|
||||
struct platform_device pxa3xx_device_nand = {
|
||||
.name = "pxa3xx-nand",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.dma_mask = &pxa3xx_nand_dma_mask,
|
||||
.coherent_dma_mask = DMA_BIT_MASK(32),
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(pxa3xx_resources_nand),
|
||||
.resource = pxa3xx_resources_nand,
|
||||
};
|
||||
|
||||
void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
|
||||
{
|
||||
pxa_register_device(&pxa3xx_device_nand, info);
|
||||
}
|
||||
#endif /* CONFIG_PXA3xx */
|
||||
|
||||
/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
|
||||
* See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
|
||||
void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
|
||||
{
|
||||
struct platform_device *pd;
|
||||
|
||||
pd = platform_device_alloc("pxa2xx-spi", id);
|
||||
if (pd == NULL) {
|
||||
printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n",
|
||||
id);
|
||||
return;
|
||||
}
|
||||
|
||||
pd->dev.platform_data = info;
|
||||
platform_device_add(pd);
|
||||
}
|
||||
|
|
|
@ -31,4 +31,6 @@ extern struct platform_device pxa25x_device_pwm1;
|
|||
extern struct platform_device pxa27x_device_pwm0;
|
||||
extern struct platform_device pxa27x_device_pwm1;
|
||||
|
||||
extern struct platform_device pxa3xx_device_nand;
|
||||
|
||||
void __init pxa_register_device(struct platform_device *dev, void *data);
|
||||
|
|
56
arch/arm/mach-pxa/e400_lcd.c
Normal file
56
arch/arm/mach-pxa/e400_lcd.c
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* e400_lcd.c
|
||||
*
|
||||
* (c) 2005 Ian Molton <spyro@f2s.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxafb.h>
|
||||
|
||||
static struct pxafb_mode_info e400_pxafb_mode_info = {
|
||||
.pixclock = 140703,
|
||||
.xres = 240,
|
||||
.yres = 320,
|
||||
.bpp = 16,
|
||||
.hsync_len = 4,
|
||||
.left_margin = 28,
|
||||
.right_margin = 8,
|
||||
.vsync_len = 3,
|
||||
.upper_margin = 5,
|
||||
.lower_margin = 6,
|
||||
.sync = 0,
|
||||
};
|
||||
|
||||
static struct pxafb_mach_info e400_pxafb_mach_info = {
|
||||
.modes = &e400_pxafb_mode_info,
|
||||
.num_modes = 1,
|
||||
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
|
||||
.lccr3 = 0,
|
||||
.pxafb_backlight_power = NULL,
|
||||
};
|
||||
|
||||
static int __init e400_lcd_init(void)
|
||||
{
|
||||
if (!machine_is_e400())
|
||||
return -ENODEV;
|
||||
|
||||
set_pxa_fb_info(&e400_pxafb_mach_info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_init(e400_lcd_init);
|
||||
|
||||
MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
|
||||
MODULE_DESCRIPTION("e400 lcd driver");
|
||||
MODULE_LICENSE("GPLv2");
|
||||
|
123
arch/arm/mach-pxa/e740_lcd.c
Normal file
123
arch/arm/mach-pxa/e740_lcd.c
Normal file
|
@ -0,0 +1,123 @@
|
|||
/* e740_lcd.c
|
||||
*
|
||||
* This file contains the definitions for the LCD timings and functions
|
||||
* to control the LCD power / frontlighting via the w100fb driver.
|
||||
*
|
||||
* (c) 2005 Ian Molton <spyro@f2s.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <video/w100fb.h>
|
||||
|
||||
/*
|
||||
**potential** shutdown routine - to be investigated
|
||||
devmem2 0x0c010528 w 0xff3fff00
|
||||
devmem2 0x0c010190 w 0x7FFF8000
|
||||
devmem2 0x0c0101b0 w 0x00FF0000
|
||||
devmem2 0x0c01008c w 0x00000000
|
||||
devmem2 0x0c010080 w 0x000000bf
|
||||
devmem2 0x0c010098 w 0x00000015
|
||||
devmem2 0x0c010088 w 0x4b000204
|
||||
devmem2 0x0c010098 w 0x0000001d
|
||||
*/
|
||||
|
||||
static struct w100_gen_regs e740_lcd_regs = {
|
||||
.lcd_format = 0x00008023,
|
||||
.lcdd_cntl1 = 0x0f000000,
|
||||
.lcdd_cntl2 = 0x0003ffff,
|
||||
.genlcd_cntl1 = 0x00ffff03,
|
||||
.genlcd_cntl2 = 0x003c0f03,
|
||||
.genlcd_cntl3 = 0x000143aa,
|
||||
};
|
||||
|
||||
static struct w100_mode e740_lcd_mode = {
|
||||
.xres = 240,
|
||||
.yres = 320,
|
||||
.left_margin = 20,
|
||||
.right_margin = 28,
|
||||
.upper_margin = 9,
|
||||
.lower_margin = 8,
|
||||
.crtc_ss = 0x80140013,
|
||||
.crtc_ls = 0x81150110,
|
||||
.crtc_gs = 0x80050005,
|
||||
.crtc_vpos_gs = 0x000a0009,
|
||||
.crtc_rev = 0x0040010a,
|
||||
.crtc_dclk = 0xa906000a,
|
||||
.crtc_gclk = 0x80050108,
|
||||
.crtc_goe = 0x80050108,
|
||||
.pll_freq = 57,
|
||||
.pixclk_divider = 4,
|
||||
.pixclk_divider_rotated = 4,
|
||||
.pixclk_src = CLK_SRC_XTAL,
|
||||
.sysclk_divider = 1,
|
||||
.sysclk_src = CLK_SRC_PLL,
|
||||
.crtc_ps1_active = 0x41060010,
|
||||
};
|
||||
|
||||
|
||||
static struct w100_gpio_regs e740_w100_gpio_info = {
|
||||
.init_data1 = 0x21002103,
|
||||
.gpio_dir1 = 0xffffdeff,
|
||||
.gpio_oe1 = 0x03c00643,
|
||||
.init_data2 = 0x003f003f,
|
||||
.gpio_dir2 = 0xffffffff,
|
||||
.gpio_oe2 = 0x000000ff,
|
||||
};
|
||||
|
||||
static struct w100fb_mach_info e740_fb_info = {
|
||||
.modelist = &e740_lcd_mode,
|
||||
.num_modes = 1,
|
||||
.regs = &e740_lcd_regs,
|
||||
.gpio = &e740_w100_gpio_info,
|
||||
.xtal_freq = 14318000,
|
||||
.xtal_dbl = 1,
|
||||
};
|
||||
|
||||
static struct resource e740_fb_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x0c000000,
|
||||
.end = 0x0cffffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
/* ----------------------- device declarations -------------------------- */
|
||||
|
||||
|
||||
static struct platform_device e740_fb_device = {
|
||||
.name = "w100fb",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &e740_fb_info,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(e740_fb_resources),
|
||||
.resource = e740_fb_resources,
|
||||
};
|
||||
|
||||
static int e740_lcd_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!machine_is_e740())
|
||||
return -ENODEV;
|
||||
|
||||
return platform_device_register(&e740_fb_device);
|
||||
}
|
||||
|
||||
module_init(e740_lcd_init);
|
||||
|
||||
MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
|
||||
MODULE_DESCRIPTION("e740 lcd driver");
|
||||
MODULE_LICENSE("GPLv2");
|
109
arch/arm/mach-pxa/e750_lcd.c
Normal file
109
arch/arm/mach-pxa/e750_lcd.c
Normal file
|
@ -0,0 +1,109 @@
|
|||
/* e750_lcd.c
|
||||
*
|
||||
* This file contains the definitions for the LCD timings and functions
|
||||
* to control the LCD power / frontlighting via the w100fb driver.
|
||||
*
|
||||
* (c) 2005 Ian Molton <spyro@f2s.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <video/w100fb.h>
|
||||
|
||||
static struct w100_gen_regs e750_lcd_regs = {
|
||||
.lcd_format = 0x00008003,
|
||||
.lcdd_cntl1 = 0x00000000,
|
||||
.lcdd_cntl2 = 0x0003ffff,
|
||||
.genlcd_cntl1 = 0x00fff003,
|
||||
.genlcd_cntl2 = 0x003c0f03,
|
||||
.genlcd_cntl3 = 0x000143aa,
|
||||
};
|
||||
|
||||
static struct w100_mode e750_lcd_mode = {
|
||||
.xres = 240,
|
||||
.yres = 320,
|
||||
.left_margin = 21,
|
||||
.right_margin = 22,
|
||||
.upper_margin = 5,
|
||||
.lower_margin = 4,
|
||||
.crtc_ss = 0x80150014,
|
||||
.crtc_ls = 0x8014000d,
|
||||
.crtc_gs = 0xc1000005,
|
||||
.crtc_vpos_gs = 0x00020147,
|
||||
.crtc_rev = 0x0040010a,
|
||||
.crtc_dclk = 0xa1700030,
|
||||
.crtc_gclk = 0x80cc0015,
|
||||
.crtc_goe = 0x80cc0015,
|
||||
.crtc_ps1_active = 0x61060017,
|
||||
.pll_freq = 57,
|
||||
.pixclk_divider = 4,
|
||||
.pixclk_divider_rotated = 4,
|
||||
.pixclk_src = CLK_SRC_XTAL,
|
||||
.sysclk_divider = 1,
|
||||
.sysclk_src = CLK_SRC_PLL,
|
||||
};
|
||||
|
||||
|
||||
static struct w100_gpio_regs e750_w100_gpio_info = {
|
||||
.init_data1 = 0x01192f1b,
|
||||
.gpio_dir1 = 0xd5ffdeff,
|
||||
.gpio_oe1 = 0x000020bf,
|
||||
.init_data2 = 0x010f010f,
|
||||
.gpio_dir2 = 0xffffffff,
|
||||
.gpio_oe2 = 0x000001cf,
|
||||
};
|
||||
|
||||
static struct w100fb_mach_info e750_fb_info = {
|
||||
.modelist = &e750_lcd_mode,
|
||||
.num_modes = 1,
|
||||
.regs = &e750_lcd_regs,
|
||||
.gpio = &e750_w100_gpio_info,
|
||||
.xtal_freq = 14318000,
|
||||
.xtal_dbl = 1,
|
||||
};
|
||||
|
||||
static struct resource e750_fb_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x0c000000,
|
||||
.end = 0x0cffffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
/* ----------------------- device declarations -------------------------- */
|
||||
|
||||
|
||||
static struct platform_device e750_fb_device = {
|
||||
.name = "w100fb",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &e750_fb_info,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(e750_fb_resources),
|
||||
.resource = e750_fb_resources,
|
||||
};
|
||||
|
||||
static int e750_lcd_init(void)
|
||||
{
|
||||
if (!machine_is_e750())
|
||||
return -ENODEV;
|
||||
|
||||
return platform_device_register(&e750_fb_device);
|
||||
}
|
||||
|
||||
module_init(e750_lcd_init);
|
||||
|
||||
MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
|
||||
MODULE_DESCRIPTION("e750 lcd driver");
|
||||
MODULE_LICENSE("GPLv2");
|
159
arch/arm/mach-pxa/e800_lcd.c
Normal file
159
arch/arm/mach-pxa/e800_lcd.c
Normal file
|
@ -0,0 +1,159 @@
|
|||
/* e800_lcd.c
|
||||
*
|
||||
* This file contains the definitions for the LCD timings and functions
|
||||
* to control the LCD power / frontlighting via the w100fb driver.
|
||||
*
|
||||
* (c) 2005 Ian Molton <spyro@f2s.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <video/w100fb.h>
|
||||
|
||||
static struct w100_gen_regs e800_lcd_regs = {
|
||||
.lcd_format = 0x00008003,
|
||||
.lcdd_cntl1 = 0x02a00000,
|
||||
.lcdd_cntl2 = 0x0003ffff,
|
||||
.genlcd_cntl1 = 0x000ff2a3,
|
||||
.genlcd_cntl2 = 0x000002a3,
|
||||
.genlcd_cntl3 = 0x000102aa,
|
||||
};
|
||||
|
||||
static struct w100_mode e800_lcd_mode[2] = {
|
||||
[0] = {
|
||||
.xres = 480,
|
||||
.yres = 640,
|
||||
.left_margin = 52,
|
||||
.right_margin = 148,
|
||||
.upper_margin = 2,
|
||||
.lower_margin = 6,
|
||||
.crtc_ss = 0x80350034,
|
||||
.crtc_ls = 0x802b0026,
|
||||
.crtc_gs = 0x80160016,
|
||||
.crtc_vpos_gs = 0x00020003,
|
||||
.crtc_rev = 0x0040001d,
|
||||
.crtc_dclk = 0xe0000000,
|
||||
.crtc_gclk = 0x82a50049,
|
||||
.crtc_goe = 0x80ee001c,
|
||||
.crtc_ps1_active = 0x00000000,
|
||||
.pll_freq = 128,
|
||||
.pixclk_divider = 4,
|
||||
.pixclk_divider_rotated = 6,
|
||||
.pixclk_src = CLK_SRC_PLL,
|
||||
.sysclk_divider = 0,
|
||||
.sysclk_src = CLK_SRC_PLL,
|
||||
},
|
||||
[1] = {
|
||||
.xres = 240,
|
||||
.yres = 320,
|
||||
.left_margin = 15,
|
||||
.right_margin = 88,
|
||||
.upper_margin = 0,
|
||||
.lower_margin = 7,
|
||||
.crtc_ss = 0xd010000f,
|
||||
.crtc_ls = 0x80070003,
|
||||
.crtc_gs = 0x80000000,
|
||||
.crtc_vpos_gs = 0x01460147,
|
||||
.crtc_rev = 0x00400003,
|
||||
.crtc_dclk = 0xa1700030,
|
||||
.crtc_gclk = 0x814b0008,
|
||||
.crtc_goe = 0x80cc0015,
|
||||
.crtc_ps1_active = 0x00000000,
|
||||
.pll_freq = 100,
|
||||
.pixclk_divider = 6, /* Wince uses 14 which gives a 7MHz pclk. */
|
||||
.pixclk_divider_rotated = 6, /* we want a 14MHz one (much nicer to look at) */
|
||||
.pixclk_src = CLK_SRC_PLL,
|
||||
.sysclk_divider = 0,
|
||||
.sysclk_src = CLK_SRC_PLL,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
static struct w100_gpio_regs e800_w100_gpio_info = {
|
||||
.init_data1 = 0xc13fc019,
|
||||
.gpio_dir1 = 0x3e40df7f,
|
||||
.gpio_oe1 = 0x003c3000,
|
||||
.init_data2 = 0x00000000,
|
||||
.gpio_dir2 = 0x00000000,
|
||||
.gpio_oe2 = 0x00000000,
|
||||
};
|
||||
|
||||
static struct w100_mem_info e800_w100_mem_info = {
|
||||
.ext_cntl = 0x09640011,
|
||||
.sdram_mode_reg = 0x00600021,
|
||||
.ext_timing_cntl = 0x10001545,
|
||||
.io_cntl = 0x7ddd7333,
|
||||
.size = 0x1fffff,
|
||||
};
|
||||
|
||||
static void e800_tg_change(struct w100fb_par *par)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
|
||||
if (par->mode->xres == 480)
|
||||
tmp |= 0x100;
|
||||
else
|
||||
tmp &= ~0x100;
|
||||
w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
|
||||
}
|
||||
|
||||
static struct w100_tg_info e800_tg_info = {
|
||||
.change = e800_tg_change,
|
||||
};
|
||||
|
||||
static struct w100fb_mach_info e800_fb_info = {
|
||||
.modelist = e800_lcd_mode,
|
||||
.num_modes = 2,
|
||||
.regs = &e800_lcd_regs,
|
||||
.gpio = &e800_w100_gpio_info,
|
||||
.mem = &e800_w100_mem_info,
|
||||
.tg = &e800_tg_info,
|
||||
.xtal_freq = 16000000,
|
||||
};
|
||||
|
||||
static struct resource e800_fb_resources[] = {
|
||||
[0] = {
|
||||
.start = 0x0c000000,
|
||||
.end = 0x0cffffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
/* ----------------------- device declarations -------------------------- */
|
||||
|
||||
|
||||
static struct platform_device e800_fb_device = {
|
||||
.name = "w100fb",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &e800_fb_info,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(e800_fb_resources),
|
||||
.resource = e800_fb_resources,
|
||||
};
|
||||
|
||||
static int e800_lcd_init(void)
|
||||
{
|
||||
if (!machine_is_e800())
|
||||
return -ENODEV;
|
||||
|
||||
return platform_device_register(&e800_fb_device);
|
||||
}
|
||||
|
||||
module_init(e800_lcd_init);
|
||||
|
||||
MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
|
||||
MODULE_DESCRIPTION("e800 lcd driver");
|
||||
MODULE_LICENSE("GPLv2");
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Support for CompuLab EM-x270 platform
|
||||
* Support for CompuLab EM-X270 platform
|
||||
*
|
||||
* Copyright (C) 2007 CompuLab, Ltd.
|
||||
* Copyright (C) 2007, 2008 CompuLab, Ltd.
|
||||
* Author: Mike Rapoport <mike@compulab.co.il>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -14,31 +14,159 @@
|
|||
|
||||
#include <linux/dm9000.h>
|
||||
#include <linux/rtc-v3020.h>
|
||||
|
||||
#include <linux/mtd/nand.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/gpio.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include <asm/arch/mfp-pxa27x.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-gpio.h>
|
||||
#include <asm/arch/pxa27x-udc.h>
|
||||
#include <asm/arch/audio.h>
|
||||
#include <asm/arch/pxafb.h>
|
||||
#include <asm/arch/ohci.h>
|
||||
#include <asm/arch/mmc.h>
|
||||
#include <asm/arch/bitfield.h>
|
||||
#include <asm/arch/pxa27x_keypad.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
||||
/* GPIO IRQ usage */
|
||||
#define EM_X270_MMC_PD (105)
|
||||
#define EM_X270_ETHIRQ IRQ_GPIO(41)
|
||||
#define EM_X270_MMC_IRQ IRQ_GPIO(13)
|
||||
#define GPIO41_ETHIRQ (41)
|
||||
#define GPIO13_MMC_CD (13)
|
||||
#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ)
|
||||
#define EM_X270_MMC_CD IRQ_GPIO(GPIO13_MMC_CD)
|
||||
|
||||
static struct resource em_x270_dm9k_resource[] = {
|
||||
/* NAND control GPIOs */
|
||||
#define GPIO11_NAND_CS (11)
|
||||
#define GPIO56_NAND_RB (56)
|
||||
|
||||
static unsigned long em_x270_pin_config[] = {
|
||||
/* AC'97 */
|
||||
GPIO28_AC97_BITCLK,
|
||||
GPIO29_AC97_SDATA_IN_0,
|
||||
GPIO30_AC97_SDATA_OUT,
|
||||
GPIO31_AC97_SYNC,
|
||||
GPIO98_AC97_SYSCLK,
|
||||
GPIO113_AC97_nRESET,
|
||||
|
||||
/* BTUART */
|
||||
GPIO42_BTUART_RXD,
|
||||
GPIO43_BTUART_TXD,
|
||||
GPIO44_BTUART_CTS,
|
||||
GPIO45_BTUART_RTS,
|
||||
|
||||
/* STUART */
|
||||
GPIO46_STUART_RXD,
|
||||
GPIO47_STUART_TXD,
|
||||
|
||||
/* MCI controller */
|
||||
GPIO32_MMC_CLK,
|
||||
GPIO112_MMC_CMD,
|
||||
GPIO92_MMC_DAT_0,
|
||||
GPIO109_MMC_DAT_1,
|
||||
GPIO110_MMC_DAT_2,
|
||||
GPIO111_MMC_DAT_3,
|
||||
|
||||
/* LCD */
|
||||
GPIO58_LCD_LDD_0,
|
||||
GPIO59_LCD_LDD_1,
|
||||
GPIO60_LCD_LDD_2,
|
||||
GPIO61_LCD_LDD_3,
|
||||
GPIO62_LCD_LDD_4,
|
||||
GPIO63_LCD_LDD_5,
|
||||
GPIO64_LCD_LDD_6,
|
||||
GPIO65_LCD_LDD_7,
|
||||
GPIO66_LCD_LDD_8,
|
||||
GPIO67_LCD_LDD_9,
|
||||
GPIO68_LCD_LDD_10,
|
||||
GPIO69_LCD_LDD_11,
|
||||
GPIO70_LCD_LDD_12,
|
||||
GPIO71_LCD_LDD_13,
|
||||
GPIO72_LCD_LDD_14,
|
||||
GPIO73_LCD_LDD_15,
|
||||
GPIO74_LCD_FCLK,
|
||||
GPIO75_LCD_LCLK,
|
||||
GPIO76_LCD_PCLK,
|
||||
GPIO77_LCD_BIAS,
|
||||
|
||||
/* QCI */
|
||||
GPIO84_CIF_FV,
|
||||
GPIO25_CIF_LV,
|
||||
GPIO53_CIF_MCLK,
|
||||
GPIO54_CIF_PCLK,
|
||||
GPIO81_CIF_DD_0,
|
||||
GPIO55_CIF_DD_1,
|
||||
GPIO51_CIF_DD_2,
|
||||
GPIO50_CIF_DD_3,
|
||||
GPIO52_CIF_DD_4,
|
||||
GPIO48_CIF_DD_5,
|
||||
GPIO17_CIF_DD_6,
|
||||
GPIO12_CIF_DD_7,
|
||||
|
||||
/* I2C */
|
||||
GPIO117_I2C_SCL,
|
||||
GPIO118_I2C_SDA,
|
||||
|
||||
/* Keypad */
|
||||
GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO34_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO39_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO91_KP_MKIN_6 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO36_KP_MKIN_7 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO103_KP_MKOUT_0,
|
||||
GPIO104_KP_MKOUT_1,
|
||||
GPIO105_KP_MKOUT_2,
|
||||
GPIO106_KP_MKOUT_3,
|
||||
GPIO107_KP_MKOUT_4,
|
||||
GPIO108_KP_MKOUT_5,
|
||||
GPIO96_KP_MKOUT_6,
|
||||
GPIO22_KP_MKOUT_7,
|
||||
|
||||
/* SSP1 */
|
||||
GPIO26_SSP1_RXD,
|
||||
GPIO23_SSP1_SCLK,
|
||||
GPIO24_SSP1_SFRM,
|
||||
GPIO57_SSP1_TXD,
|
||||
|
||||
/* SSP2 */
|
||||
GPIO19_SSP2_SCLK,
|
||||
GPIO14_SSP2_SFRM,
|
||||
GPIO89_SSP2_TXD,
|
||||
GPIO88_SSP2_RXD,
|
||||
|
||||
/* SDRAM and local bus */
|
||||
GPIO15_nCS_1,
|
||||
GPIO78_nCS_2,
|
||||
GPIO79_nCS_3,
|
||||
GPIO80_nCS_4,
|
||||
GPIO49_nPWE,
|
||||
GPIO18_RDY,
|
||||
|
||||
/* GPIO */
|
||||
GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
|
||||
|
||||
/* power controls */
|
||||
GPIO20_GPIO | MFP_LPM_DRIVE_LOW, /* GPRS_PWEN */
|
||||
GPIO115_GPIO | MFP_LPM_DRIVE_LOW, /* WLAN_PWEN */
|
||||
|
||||
/* NAND controls */
|
||||
GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */
|
||||
GPIO56_GPIO, /* NAND Ready/Busy */
|
||||
|
||||
/* interrupts */
|
||||
GPIO13_GPIO, /* MMC card detect */
|
||||
GPIO41_GPIO, /* DM9000 interrupt */
|
||||
};
|
||||
|
||||
#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
|
||||
static struct resource em_x270_dm9000_resource[] = {
|
||||
[0] = {
|
||||
.start = PXA_CS2_PHYS,
|
||||
.end = PXA_CS2_PHYS + 3,
|
||||
|
@ -56,32 +184,30 @@ static struct resource em_x270_dm9k_resource[] = {
|
|||
}
|
||||
};
|
||||
|
||||
/* for the moment we limit ourselves to 32bit IO until some
|
||||
* better IO routines can be written and tested
|
||||
*/
|
||||
static struct dm9000_plat_data em_x270_dm9k_platdata = {
|
||||
static struct dm9000_plat_data em_x270_dm9000_platdata = {
|
||||
.flags = DM9000_PLATF_32BITONLY,
|
||||
};
|
||||
|
||||
/* Ethernet device */
|
||||
static struct platform_device em_x270_dm9k = {
|
||||
static struct platform_device em_x270_dm9000 = {
|
||||
.name = "dm9000",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(em_x270_dm9k_resource),
|
||||
.resource = em_x270_dm9k_resource,
|
||||
.num_resources = ARRAY_SIZE(em_x270_dm9000_resource),
|
||||
.resource = em_x270_dm9000_resource,
|
||||
.dev = {
|
||||
.platform_data = &em_x270_dm9k_platdata,
|
||||
.platform_data = &em_x270_dm9000_platdata,
|
||||
}
|
||||
};
|
||||
|
||||
/* WM9712 touchscreen controller. Hopefully the driver will make it to
|
||||
* the mainstream sometime */
|
||||
static struct platform_device em_x270_ts = {
|
||||
.name = "wm97xx-ts",
|
||||
.id = -1,
|
||||
};
|
||||
static void __init em_x270_init_dm9000(void)
|
||||
{
|
||||
platform_device_register(&em_x270_dm9000);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_dm9000(void) {}
|
||||
#endif
|
||||
|
||||
/* RTC */
|
||||
/* V3020 RTC */
|
||||
#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE)
|
||||
static struct resource em_x270_v3020_resource[] = {
|
||||
[0] = {
|
||||
.start = PXA_CS4_PHYS,
|
||||
|
@ -104,20 +230,26 @@ static struct platform_device em_x270_rtc = {
|
|||
}
|
||||
};
|
||||
|
||||
/* NAND flash */
|
||||
#define GPIO_NAND_CS (11)
|
||||
#define GPIO_NAND_RB (56)
|
||||
static void __init em_x270_init_rtc(void)
|
||||
{
|
||||
platform_device_register(&em_x270_rtc);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_rtc(void) {}
|
||||
#endif
|
||||
|
||||
/* NAND flash */
|
||||
#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
|
||||
static inline void nand_cs_on(void)
|
||||
{
|
||||
GPCR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS);
|
||||
gpio_set_value(GPIO11_NAND_CS, 0);
|
||||
}
|
||||
|
||||
static void nand_cs_off(void)
|
||||
{
|
||||
dsb();
|
||||
|
||||
GPSR(GPIO_NAND_CS) = GPIO_bit(GPIO_NAND_CS);
|
||||
gpio_set_value(GPIO11_NAND_CS, 1);
|
||||
}
|
||||
|
||||
/* hardware specific access to control-lines */
|
||||
|
@ -157,7 +289,7 @@ static int em_x270_nand_device_ready(struct mtd_info *mtd)
|
|||
{
|
||||
dsb();
|
||||
|
||||
return GPLR(GPIO_NAND_RB) & GPIO_bit(GPIO_NAND_RB);
|
||||
return gpio_get_value(GPIO56_NAND_RB);
|
||||
}
|
||||
|
||||
static struct mtd_partition em_x270_partition_info[] = {
|
||||
|
@ -210,16 +342,35 @@ static struct platform_device em_x270_nand = {
|
|||
}
|
||||
};
|
||||
|
||||
/* platform devices */
|
||||
static struct platform_device *platform_devices[] __initdata = {
|
||||
&em_x270_dm9k,
|
||||
&em_x270_ts,
|
||||
&em_x270_rtc,
|
||||
&em_x270_nand,
|
||||
};
|
||||
static void __init em_x270_init_nand(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = gpio_request(GPIO11_NAND_CS, "NAND CS");
|
||||
if (err) {
|
||||
pr_warning("EM-X270: failed to request NAND CS gpio\n");
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_direction_output(GPIO11_NAND_CS, 1);
|
||||
|
||||
err = gpio_request(GPIO56_NAND_RB, "NAND R/B");
|
||||
if (err) {
|
||||
pr_warning("EM-X270: failed to request NAND R/B gpio\n");
|
||||
gpio_free(GPIO11_NAND_CS);
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_direction_input(GPIO56_NAND_RB);
|
||||
|
||||
platform_device_register(&em_x270_nand);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_nand(void) {}
|
||||
#endif
|
||||
|
||||
/* PXA27x OHCI controller setup */
|
||||
#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
|
||||
static int em_x270_ohci_init(struct device *dev)
|
||||
{
|
||||
/* Set the Power Control Polarity Low */
|
||||
|
@ -237,27 +388,23 @@ static struct pxaohci_platform_data em_x270_ohci_platform_data = {
|
|||
.init = em_x270_ohci_init,
|
||||
};
|
||||
|
||||
static void __init em_x270_init_ohci(void)
|
||||
{
|
||||
pxa_set_ohci_info(&em_x270_ohci_platform_data);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_ohci(void) {}
|
||||
#endif
|
||||
|
||||
/* MCI controller setup */
|
||||
#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
|
||||
static int em_x270_mci_init(struct device *dev,
|
||||
irq_handler_t em_x270_detect_int,
|
||||
void *data)
|
||||
{
|
||||
int err;
|
||||
|
||||
/* setup GPIO for PXA27x MMC controller */
|
||||
pxa_gpio_mode(GPIO32_MMCCLK_MD);
|
||||
pxa_gpio_mode(GPIO112_MMCCMD_MD);
|
||||
pxa_gpio_mode(GPIO92_MMCDAT0_MD);
|
||||
pxa_gpio_mode(GPIO109_MMCDAT1_MD);
|
||||
pxa_gpio_mode(GPIO110_MMCDAT2_MD);
|
||||
pxa_gpio_mode(GPIO111_MMCDAT3_MD);
|
||||
|
||||
/* EM-X270 uses GPIO13 as SD power enable */
|
||||
pxa_gpio_mode(EM_X270_MMC_PD | GPIO_OUT);
|
||||
|
||||
err = request_irq(EM_X270_MMC_IRQ, em_x270_detect_int,
|
||||
IRQF_DISABLED | IRQF_TRIGGER_FALLING,
|
||||
"MMC card detect", data);
|
||||
int err = request_irq(EM_X270_MMC_CD, em_x270_detect_int,
|
||||
IRQF_DISABLED | IRQF_TRIGGER_FALLING,
|
||||
"MMC card detect", data);
|
||||
if (err) {
|
||||
printk(KERN_ERR "%s: can't request MMC card detect IRQ: %d\n",
|
||||
__func__, err);
|
||||
|
@ -279,7 +426,8 @@ static void em_x270_mci_setpower(struct device *dev, unsigned int vdd)
|
|||
|
||||
static void em_x270_mci_exit(struct device *dev, void *data)
|
||||
{
|
||||
free_irq(EM_X270_MMC_IRQ, data);
|
||||
int irq = gpio_to_irq(GPIO13_MMC_CD);
|
||||
free_irq(irq, data);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data em_x270_mci_platform_data = {
|
||||
|
@ -289,7 +437,16 @@ static struct pxamci_platform_data em_x270_mci_platform_data = {
|
|||
.exit = em_x270_mci_exit,
|
||||
};
|
||||
|
||||
static void __init em_x270_init_mmc(void)
|
||||
{
|
||||
pxa_set_mci_info(&em_x270_mci_platform_data);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_mmc(void) {}
|
||||
#endif
|
||||
|
||||
/* LCD 480x640 */
|
||||
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
|
||||
static struct pxafb_mode_info em_x270_lcd_mode = {
|
||||
.pixclock = 50000,
|
||||
.bpp = 16,
|
||||
|
@ -307,40 +464,96 @@ static struct pxafb_mode_info em_x270_lcd_mode = {
|
|||
static struct pxafb_mach_info em_x270_lcd = {
|
||||
.modes = &em_x270_lcd_mode,
|
||||
.num_modes = 1,
|
||||
.cmap_inverse = 0,
|
||||
.cmap_static = 0,
|
||||
.lccr0 = LCCR0_PAS,
|
||||
.lccr3 = LCCR3_PixClkDiv(0x01) | LCCR3_Acb(0xff),
|
||||
.lcd_conn = LCD_COLOR_TFT_16BPP,
|
||||
};
|
||||
static void __init em_x270_init_lcd(void)
|
||||
{
|
||||
set_pxa_fb_info(&em_x270_lcd);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_lcd(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE)
|
||||
static void __init em_x270_init_ac97(void)
|
||||
{
|
||||
pxa_set_ac97_info(NULL);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_ac97(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
|
||||
static unsigned int em_x270_matrix_keys[] = {
|
||||
KEY(0, 0, KEY_A), KEY(1, 0, KEY_UP), KEY(2, 1, KEY_B),
|
||||
KEY(0, 2, KEY_LEFT), KEY(1, 1, KEY_ENTER), KEY(2, 0, KEY_RIGHT),
|
||||
KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D),
|
||||
};
|
||||
|
||||
struct pxa27x_keypad_platform_data em_x270_keypad_info = {
|
||||
/* code map for the matrix keys */
|
||||
.matrix_key_rows = 3,
|
||||
.matrix_key_cols = 3,
|
||||
.matrix_key_map = em_x270_matrix_keys,
|
||||
.matrix_key_map_size = ARRAY_SIZE(em_x270_matrix_keys),
|
||||
};
|
||||
|
||||
static void __init em_x270_init_keypad(void)
|
||||
{
|
||||
pxa_set_keypad_info(&em_x270_keypad_info);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_keypad(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
|
||||
static struct gpio_keys_button gpio_keys_button[] = {
|
||||
[0] = {
|
||||
.desc = "sleep/wakeup",
|
||||
.code = KEY_SUSPEND,
|
||||
.type = EV_PWR,
|
||||
.gpio = 1,
|
||||
.wakeup = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_keys_platform_data em_x270_gpio_keys_data = {
|
||||
.buttons = gpio_keys_button,
|
||||
.nbuttons = 1,
|
||||
};
|
||||
|
||||
static struct platform_device em_x270_gpio_keys = {
|
||||
.name = "gpio-keys",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &em_x270_gpio_keys_data,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init em_x270_init_gpio_keys(void)
|
||||
{
|
||||
platform_device_register(&em_x270_gpio_keys);
|
||||
}
|
||||
#else
|
||||
static inline void em_x270_init_gpio_keys(void) {}
|
||||
#endif
|
||||
|
||||
static void __init em_x270_init(void)
|
||||
{
|
||||
/* setup LCD */
|
||||
set_pxa_fb_info(&em_x270_lcd);
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_pin_config));
|
||||
|
||||
/* register EM-X270 platform devices */
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
pxa_set_ac97_info(NULL);
|
||||
|
||||
/* set MCI and OHCI platform parameters */
|
||||
pxa_set_mci_info(&em_x270_mci_platform_data);
|
||||
pxa_set_ohci_info(&em_x270_ohci_platform_data);
|
||||
|
||||
/* setup STUART GPIOs */
|
||||
pxa_gpio_mode(GPIO46_STRXD_MD);
|
||||
pxa_gpio_mode(GPIO47_STTXD_MD);
|
||||
|
||||
/* setup BTUART GPIOs */
|
||||
pxa_gpio_mode(GPIO42_BTRXD_MD);
|
||||
pxa_gpio_mode(GPIO43_BTTXD_MD);
|
||||
pxa_gpio_mode(GPIO44_BTCTS_MD);
|
||||
pxa_gpio_mode(GPIO45_BTRTS_MD);
|
||||
|
||||
/* Setup interrupt for dm9000 */
|
||||
set_irq_type(EM_X270_ETHIRQ, IRQT_RISING);
|
||||
em_x270_init_dm9000();
|
||||
em_x270_init_rtc();
|
||||
em_x270_init_nand();
|
||||
em_x270_init_lcd();
|
||||
em_x270_init_mmc();
|
||||
em_x270_init_ohci();
|
||||
em_x270_init_keypad();
|
||||
em_x270_init_gpio_keys();
|
||||
em_x270_init_ac97();
|
||||
}
|
||||
|
||||
MACHINE_START(EM_X270, "Compulab EM-x270")
|
||||
MACHINE_START(EM_X270, "Compulab EM-X270")
|
||||
.boot_params = 0xa0000100,
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <asm/arch/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <generic.h>
|
||||
#include "generic.h"
|
||||
|
||||
/* Only e800 has 128MB RAM */
|
||||
static void __init eseries_fixup(struct machine_desc *desc,
|
||||
|
@ -47,6 +47,19 @@ MACHINE_START(E330, "Toshiba e330")
|
|||
MACHINE_END
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACH_E350
|
||||
MACHINE_START(E350, "Toshiba e350")
|
||||
/* Maintainer: Ian Molton (spyro@f2s.com) */
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa25x_init_irq,
|
||||
.fixup = eseries_fixup,
|
||||
.timer = &pxa_timer,
|
||||
MACHINE_END
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACH_E740
|
||||
MACHINE_START(E740, "Toshiba e740")
|
||||
/* Maintainer: Ian Molton (spyro@f2s.com) */
|
||||
|
|
57
arch/arm/mach-pxa/eseries_udc.c
Normal file
57
arch/arm/mach-pxa/eseries_udc.c
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* UDC functions for the Toshiba e-series PDAs
|
||||
*
|
||||
* Copyright (c) Ian Molton 2003
|
||||
*
|
||||
* This file is licensed under
|
||||
* the terms of the GNU General Public License version 2. This program
|
||||
* is licensed "as is" without any warranty of any kind, whether express
|
||||
* or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/device.h>
|
||||
|
||||
#include <asm/arch/udc.h>
|
||||
#include <asm/arch/eseries-gpio.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/domain.h>
|
||||
|
||||
/* local PXA generic code */
|
||||
#include "generic.h"
|
||||
|
||||
static struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
|
||||
.gpio_vbus = GPIO_E7XX_USB_DISC,
|
||||
.gpio_pullup = GPIO_E7XX_USB_PULLUP,
|
||||
.gpio_pullup_inverted = 1
|
||||
};
|
||||
|
||||
static struct pxa2xx_udc_mach_info e800_udc_mach_info = {
|
||||
.gpio_vbus = GPIO_E800_USB_DISC,
|
||||
.gpio_pullup = GPIO_E800_USB_PULLUP,
|
||||
.gpio_pullup_inverted = 1
|
||||
};
|
||||
|
||||
static int __init eseries_udc_init(void)
|
||||
{
|
||||
if (machine_is_e330() || machine_is_e350() ||
|
||||
machine_is_e740() || machine_is_e750() ||
|
||||
machine_is_e400())
|
||||
pxa_set_udc_info(&e7xx_udc_mach_info);
|
||||
else if (machine_is_e800())
|
||||
pxa_set_udc_info(&e800_udc_mach_info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_init(eseries_udc_init);
|
||||
|
||||
MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
|
||||
MODULE_DESCRIPTION("eseries UDC support");
|
||||
MODULE_LICENSE("GPLv2");
|
220
arch/arm/mach-pxa/ezx.c
Normal file
220
arch/arm/mach-pxa/ezx.c
Normal file
|
@ -0,0 +1,220 @@
|
|||
/*
|
||||
* ezx.c - Common code for the EZX platform.
|
||||
*
|
||||
* Copyright (C) 2005-2006 Harald Welte <laforge@openezx.org>,
|
||||
* 2007-2008 Daniel Ribeiro <drwyrm@gmail.com>,
|
||||
* 2007-2008 Stefan Schmidt <stefan@datenfreihafen.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/pwm_backlight.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/arch/pxafb.h>
|
||||
#include <asm/arch/ohci.h>
|
||||
#include <asm/arch/i2c.h>
|
||||
|
||||
#include <asm/arch/mfp-pxa27x.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-regs.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
||||
#include "devices.h"
|
||||
#include "generic.h"
|
||||
|
||||
static struct platform_pwm_backlight_data ezx_backlight_data = {
|
||||
.pwm_id = 0,
|
||||
.max_brightness = 1023,
|
||||
.dft_brightness = 1023,
|
||||
.pwm_period_ns = 78770,
|
||||
};
|
||||
|
||||
static struct platform_device ezx_backlight_device = {
|
||||
.name = "pwm-backlight",
|
||||
.dev = {
|
||||
.parent = &pxa27x_device_pwm0.dev,
|
||||
.platform_data = &ezx_backlight_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct pxafb_mode_info mode_ezx_old = {
|
||||
.pixclock = 150000,
|
||||
.xres = 240,
|
||||
.yres = 320,
|
||||
.bpp = 16,
|
||||
.hsync_len = 10,
|
||||
.left_margin = 20,
|
||||
.right_margin = 10,
|
||||
.vsync_len = 2,
|
||||
.upper_margin = 3,
|
||||
.lower_margin = 2,
|
||||
.sync = 0,
|
||||
};
|
||||
|
||||
static struct pxafb_mach_info ezx_fb_info_1 = {
|
||||
.modes = &mode_ezx_old,
|
||||
.num_modes = 1,
|
||||
.lcd_conn = LCD_COLOR_TFT_16BPP,
|
||||
};
|
||||
|
||||
static struct pxafb_mode_info mode_72r89803y01 = {
|
||||
.pixclock = 192308,
|
||||
.xres = 240,
|
||||
.yres = 320,
|
||||
.bpp = 32,
|
||||
.depth = 18,
|
||||
.hsync_len = 10,
|
||||
.left_margin = 20,
|
||||
.right_margin = 10,
|
||||
.vsync_len = 2,
|
||||
.upper_margin = 3,
|
||||
.lower_margin = 2,
|
||||
.sync = 0,
|
||||
};
|
||||
|
||||
static struct pxafb_mach_info ezx_fb_info_2 = {
|
||||
.modes = &mode_72r89803y01,
|
||||
.num_modes = 1,
|
||||
.lcd_conn = LCD_COLOR_TFT_18BPP,
|
||||
};
|
||||
|
||||
static struct platform_device *devices[] __initdata = {
|
||||
&ezx_backlight_device,
|
||||
};
|
||||
|
||||
static unsigned long ezx_pin_config[] __initdata = {
|
||||
/* PWM backlight */
|
||||
GPIO16_PWM0_OUT,
|
||||
|
||||
/* BTUART */
|
||||
GPIO42_BTUART_RXD,
|
||||
GPIO43_BTUART_TXD,
|
||||
GPIO44_BTUART_CTS,
|
||||
GPIO45_BTUART_RTS,
|
||||
|
||||
/* STUART */
|
||||
GPIO46_STUART_RXD,
|
||||
GPIO47_STUART_TXD,
|
||||
|
||||
/* For A780 support (connected with Neptune GSM chip) */
|
||||
GPIO30_USB_P3_2, /* ICL_TXENB */
|
||||
GPIO31_USB_P3_6, /* ICL_VPOUT */
|
||||
GPIO90_USB_P3_5, /* ICL_VPIN */
|
||||
GPIO91_USB_P3_1, /* ICL_XRXD */
|
||||
GPIO56_USB_P3_4, /* ICL_VMOUT */
|
||||
GPIO113_USB_P3_3, /* /ICL_VMIN */
|
||||
};
|
||||
|
||||
static void __init ezx_init(void)
|
||||
{
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config));
|
||||
pxa_set_i2c_info(NULL);
|
||||
if (machine_is_ezx_a780() || machine_is_ezx_e680())
|
||||
set_pxa_fb_info(&ezx_fb_info_1);
|
||||
else
|
||||
set_pxa_fb_info(&ezx_fb_info_2);
|
||||
|
||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||
}
|
||||
|
||||
static void __init ezx_fixup(struct machine_desc *desc, struct tag *tags,
|
||||
char **cmdline, struct meminfo *mi)
|
||||
{
|
||||
/* We have two ram chips. First one with 32MB at 0xA0000000 and a second
|
||||
* 16MB one at 0xAC000000
|
||||
*/
|
||||
mi->nr_banks = 2;
|
||||
mi->bank[0].start = 0xa0000000;
|
||||
mi->bank[0].node = 0;
|
||||
mi->bank[0].size = (32*1024*1024);
|
||||
mi->bank[1].start = 0xac000000;
|
||||
mi->bank[1].node = 1;
|
||||
mi->bank[1].size = (16*1024*1024);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MACH_EZX_A780
|
||||
MACHINE_START(EZX_A780, "Motorola EZX A780")
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.fixup = ezx_fixup,
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa27x_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = &ezx_init,
|
||||
MACHINE_END
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACH_EZX_E680
|
||||
MACHINE_START(EZX_E680, "Motorola EZX E680")
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.fixup = ezx_fixup,
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa27x_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = &ezx_init,
|
||||
MACHINE_END
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACH_EZX_A1200
|
||||
MACHINE_START(EZX_A1200, "Motorola EZX A1200")
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.fixup = ezx_fixup,
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa27x_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = &ezx_init,
|
||||
MACHINE_END
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACH_EZX_A910
|
||||
MACHINE_START(EZX_A910, "Motorola EZX A910")
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.fixup = ezx_fixup,
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa27x_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = &ezx_init,
|
||||
MACHINE_END
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACH_EZX_E6
|
||||
MACHINE_START(EZX_E6, "Motorola EZX E6")
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.fixup = ezx_fixup,
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa27x_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = &ezx_init,
|
||||
MACHINE_END
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACH_EZX_E2
|
||||
MACHINE_START(EZX_E2, "Motorola EZX E2")
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.fixup = ezx_fixup,
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa27x_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = &ezx_init,
|
||||
MACHINE_END
|
||||
#endif
|
|
@ -20,6 +20,7 @@
|
|||
#include <linux/delay.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <asm/setup.h>
|
||||
|
@ -38,6 +39,7 @@
|
|||
#include <asm/arch/pxafb.h>
|
||||
#include <asm/arch/ssp.h>
|
||||
#include <asm/arch/pxa27x_keypad.h>
|
||||
#include <asm/arch/pxa3xx_nand.h>
|
||||
#include <asm/arch/littleton.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
@ -101,18 +103,26 @@ static struct resource smc91x_resources[] = {
|
|||
[1] = {
|
||||
.start = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)),
|
||||
.end = IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)),
|
||||
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
|
||||
}
|
||||
};
|
||||
|
||||
static struct smc91x_platdata littleton_smc91x_info = {
|
||||
.flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT |
|
||||
SMC91X_NOWAIT | SMC91X_USE_DMA,
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &littleton_smc91x_info,
|
||||
},
|
||||
};
|
||||
|
||||
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULES)
|
||||
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
|
||||
/* use bit 30, 31 as the indicator of command parameter number */
|
||||
#define CMD0(x) ((0x00000000) | ((x) << 9))
|
||||
#define CMD1(x, x1) ((0x40000000) | ((x) << 9) | 0x100 | (x1))
|
||||
|
@ -311,9 +321,9 @@ static void littleton_init_lcd(void)
|
|||
}
|
||||
#else
|
||||
static inline void littleton_init_lcd(void) {};
|
||||
#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */
|
||||
#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
|
||||
|
||||
#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
|
||||
#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
|
||||
static unsigned int littleton_matrix_key_map[] = {
|
||||
/* KEY(row, col, key_code) */
|
||||
KEY(1, 3, KEY_0), KEY(0, 0, KEY_1), KEY(1, 0, KEY_2), KEY(2, 0, KEY_3),
|
||||
|
@ -361,6 +371,57 @@ static void __init littleton_init_keypad(void)
|
|||
static inline void littleton_init_keypad(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
|
||||
static struct mtd_partition littleton_nand_partitions[] = {
|
||||
[0] = {
|
||||
.name = "Bootloader",
|
||||
.offset = 0,
|
||||
.size = 0x060000,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
[1] = {
|
||||
.name = "Kernel",
|
||||
.offset = 0x060000,
|
||||
.size = 0x200000,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
[2] = {
|
||||
.name = "Filesystem",
|
||||
.offset = 0x0260000,
|
||||
.size = 0x3000000, /* 48M - rootfs */
|
||||
},
|
||||
[3] = {
|
||||
.name = "MassStorage",
|
||||
.offset = 0x3260000,
|
||||
.size = 0x3d40000,
|
||||
},
|
||||
[4] = {
|
||||
.name = "BBT",
|
||||
.offset = 0x6FA0000,
|
||||
.size = 0x80000,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
/* NOTE: we reserve some blocks at the end of the NAND flash for
|
||||
* bad block management, and the max number of relocation blocks
|
||||
* differs on different platforms. Please take care with it when
|
||||
* defining the partition table.
|
||||
*/
|
||||
};
|
||||
|
||||
static struct pxa3xx_nand_platform_data littleton_nand_info = {
|
||||
.enable_arbiter = 1,
|
||||
.parts = littleton_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(littleton_nand_partitions),
|
||||
};
|
||||
|
||||
static void __init littleton_init_nand(void)
|
||||
{
|
||||
pxa3xx_set_nand_info(&littleton_nand_info);
|
||||
}
|
||||
#else
|
||||
static inline void littleton_init_nand(void) {}
|
||||
#endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */
|
||||
|
||||
static void __init littleton_init(void)
|
||||
{
|
||||
/* initialize MFP configurations */
|
||||
|
@ -374,6 +435,7 @@ static void __init littleton_init(void)
|
|||
|
||||
littleton_init_lcd();
|
||||
littleton_init_keypad();
|
||||
littleton_init_nand();
|
||||
}
|
||||
|
||||
MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)")
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/ads7846.h>
|
||||
|
@ -226,14 +227,6 @@ static struct pxa2xx_spi_master pxa_ssp_master_info = {
|
|||
.num_chipselect = 0,
|
||||
};
|
||||
|
||||
static struct platform_device pxa_ssp = {
|
||||
.name = "pxa2xx-spi",
|
||||
.id = 1,
|
||||
.dev = {
|
||||
.platform_data = &pxa_ssp_master_info,
|
||||
},
|
||||
};
|
||||
|
||||
static int lubbock_ads7846_pendown_state(void)
|
||||
{
|
||||
/* TS_BUSY is bit 8 in LUB_MISC_RD, but pendown is irq-only */
|
||||
|
@ -292,11 +285,18 @@ static struct resource smc91x_resources[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct smc91x_platdata lubbock_smc91x_info = {
|
||||
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_IO_SHIFT_2,
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &lubbock_smc91x_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct resource flash_resources[] = {
|
||||
|
@ -367,7 +367,6 @@ static struct platform_device *devices[] __initdata = {
|
|||
&smc91x_device,
|
||||
&lubbock_flash_device[0],
|
||||
&lubbock_flash_device[1],
|
||||
&pxa_ssp,
|
||||
};
|
||||
|
||||
static struct pxafb_mode_info sharp_lm8v31_mode = {
|
||||
|
@ -471,6 +470,7 @@ static void lubbock_irda_transceiver_mode(struct device *dev, int mode)
|
|||
} else if (mode & IR_FIRMODE) {
|
||||
LUB_MISC_WR |= 1 << 4;
|
||||
}
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
|
@ -501,6 +501,7 @@ static void __init lubbock_init(void)
|
|||
lubbock_flash_data[flashboot].name = "boot-rom";
|
||||
(void) platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||
|
||||
pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
|
||||
spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
|
||||
}
|
||||
|
||||
|
|
|
@ -17,17 +17,15 @@
|
|||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/mfd/htc-egpio.h>
|
||||
#include <linux/mfd/htc-pasic3.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/map.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/pda_power.h>
|
||||
#include <linux/pwm_backlight.h>
|
||||
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
|
@ -44,7 +42,7 @@
|
|||
#include "devices.h"
|
||||
#include "generic.h"
|
||||
|
||||
static unsigned long magician_pin_config[] = {
|
||||
static unsigned long magician_pin_config[] __initdata = {
|
||||
|
||||
/* SDRAM and Static Memory I/O Signals */
|
||||
GPIO20_nSDCS_2,
|
||||
|
@ -134,6 +132,7 @@ static unsigned long magician_pin_config[] = {
|
|||
static void magician_irda_transceiver_mode(struct device *dev, int mode)
|
||||
{
|
||||
gpio_set_value(GPIO83_MAGICIAN_nIR_EN, mode & IR_OFF);
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
}
|
||||
|
||||
static struct pxaficp_platform_data magician_ficp_info = {
|
||||
|
@ -399,6 +398,7 @@ static struct platform_pwm_backlight_data backlight_data = {
|
|||
|
||||
static struct platform_device backlight = {
|
||||
.name = "pwm-backlight",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.parent = &pxa27x_device_pwm0.dev,
|
||||
.platform_data = &backlight_data,
|
||||
|
@ -511,6 +511,37 @@ static struct platform_device pasic3 = {
|
|||
* External power
|
||||
*/
|
||||
|
||||
static int power_supply_init(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(EGPIO_MAGICIAN_CABLE_STATE_AC, "CABLE_STATE_AC");
|
||||
if (ret)
|
||||
goto err_cs_ac;
|
||||
ret = gpio_request(EGPIO_MAGICIAN_CABLE_STATE_USB, "CABLE_STATE_USB");
|
||||
if (ret)
|
||||
goto err_cs_usb;
|
||||
ret = gpio_request(EGPIO_MAGICIAN_CHARGE_EN, "CHARGE_EN");
|
||||
if (ret)
|
||||
goto err_chg_en;
|
||||
ret = gpio_request(GPIO30_MAGICIAN_nCHARGE_EN, "nCHARGE_EN");
|
||||
if (!ret)
|
||||
ret = gpio_direction_output(GPIO30_MAGICIAN_nCHARGE_EN, 0);
|
||||
if (ret)
|
||||
goto err_nchg_en;
|
||||
|
||||
return 0;
|
||||
|
||||
err_nchg_en:
|
||||
gpio_free(EGPIO_MAGICIAN_CHARGE_EN);
|
||||
err_chg_en:
|
||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_USB);
|
||||
err_cs_usb:
|
||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
||||
err_cs_ac:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int magician_is_ac_online(void)
|
||||
{
|
||||
return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
||||
|
@ -527,14 +558,24 @@ static void magician_set_charge(int flags)
|
|||
gpio_set_value(EGPIO_MAGICIAN_CHARGE_EN, flags);
|
||||
}
|
||||
|
||||
static void power_supply_exit(struct device *dev)
|
||||
{
|
||||
gpio_free(GPIO30_MAGICIAN_nCHARGE_EN);
|
||||
gpio_free(EGPIO_MAGICIAN_CHARGE_EN);
|
||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_USB);
|
||||
gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC);
|
||||
}
|
||||
|
||||
static char *magician_supplicants[] = {
|
||||
"ds2760-battery.0", "backup-battery"
|
||||
};
|
||||
|
||||
static struct pda_power_pdata power_supply_info = {
|
||||
.init = power_supply_init,
|
||||
.is_ac_online = magician_is_ac_online,
|
||||
.is_usb_online = magician_is_usb_online,
|
||||
.set_charge = magician_set_charge,
|
||||
.exit = power_supply_exit,
|
||||
.supplied_to = magician_supplicants,
|
||||
.num_supplicants = ARRAY_SIZE(magician_supplicants),
|
||||
};
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/input.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/pwm_backlight.h>
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <asm/setup.h>
|
||||
|
@ -110,9 +111,9 @@ static unsigned long mainstone_pin_config[] = {
|
|||
GPIO45_AC97_SYSCLK,
|
||||
|
||||
/* Keypad */
|
||||
GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO94_KP_DKIN_1 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO95_KP_DKIN_2 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO93_KP_DKIN_0,
|
||||
GPIO94_KP_DKIN_1,
|
||||
GPIO95_KP_DKIN_2,
|
||||
GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
|
||||
GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
|
||||
|
@ -240,11 +241,19 @@ static struct resource smc91x_resources[] = {
|
|||
}
|
||||
};
|
||||
|
||||
static struct smc91x_platdata mainstone_smc91x_info = {
|
||||
.flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | SMC91X_USE_32BIT |
|
||||
SMC91X_NOWAIT | SMC91X_USE_DMA,
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &mainstone_smc91x_info,
|
||||
},
|
||||
};
|
||||
|
||||
static int mst_audio_startup(struct snd_pcm_substream *substream, void *priv)
|
||||
|
@ -455,6 +464,7 @@ static void mainstone_irda_transceiver_mode(struct device *dev, int mode)
|
|||
} else if (mode & IR_FIRMODE) {
|
||||
MST_MSCWR1 |= MST_MSCWR1_IRDA_FIR;
|
||||
}
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
if (mode & IR_OFF) {
|
||||
MST_MSCWR1 = (MST_MSCWR1 & ~MST_MSCWR1_IRDA_MASK) | MST_MSCWR1_IRDA_OFF;
|
||||
} else {
|
||||
|
@ -513,7 +523,7 @@ static struct pxaohci_platform_data mainstone_ohci_platform_data = {
|
|||
.init = mainstone_ohci_init,
|
||||
};
|
||||
|
||||
#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
|
||||
#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
|
||||
static unsigned int mainstone_matrix_keys[] = {
|
||||
KEY(0, 0, KEY_A), KEY(1, 0, KEY_B), KEY(2, 0, KEY_C),
|
||||
KEY(3, 0, KEY_D), KEY(4, 0, KEY_E), KEY(5, 0, KEY_F),
|
||||
|
|
|
@ -39,6 +39,28 @@ struct gpio_desc {
|
|||
|
||||
static struct gpio_desc gpio_desc[MFP_PIN_GPIO127 + 1];
|
||||
|
||||
static int __mfp_config_lpm(unsigned gpio, unsigned long lpm)
|
||||
{
|
||||
unsigned mask = GPIO_bit(gpio);
|
||||
|
||||
/* low power state */
|
||||
switch (lpm) {
|
||||
case MFP_LPM_DRIVE_HIGH:
|
||||
PGSR(gpio) |= mask;
|
||||
break;
|
||||
case MFP_LPM_DRIVE_LOW:
|
||||
PGSR(gpio) &= ~mask;
|
||||
break;
|
||||
case MFP_LPM_INPUT:
|
||||
break;
|
||||
default:
|
||||
pr_warning("%s: invalid low power state for GPIO%d\n",
|
||||
__func__, gpio);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __mfp_config_gpio(unsigned gpio, unsigned long c)
|
||||
{
|
||||
unsigned long gafr, mask = GPIO_bit(gpio);
|
||||
|
@ -57,21 +79,8 @@ static int __mfp_config_gpio(unsigned gpio, unsigned long c)
|
|||
else
|
||||
GPDR(gpio) &= ~mask;
|
||||
|
||||
/* low power state */
|
||||
switch (c & MFP_LPM_STATE_MASK) {
|
||||
case MFP_LPM_DRIVE_HIGH:
|
||||
PGSR(gpio) |= mask;
|
||||
break;
|
||||
case MFP_LPM_DRIVE_LOW:
|
||||
PGSR(gpio) &= ~mask;
|
||||
break;
|
||||
case MFP_LPM_INPUT:
|
||||
break;
|
||||
default:
|
||||
pr_warning("%s: invalid low power state for GPIO%d\n",
|
||||
__func__, gpio);
|
||||
if (__mfp_config_lpm(gpio, c & MFP_LPM_STATE_MASK))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* give early warning if MFP_LPM_CAN_WAKEUP is set on the
|
||||
* configurations of those pins not able to wakeup
|
||||
|
@ -91,6 +100,18 @@ static int __mfp_config_gpio(unsigned gpio, unsigned long c)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline int __mfp_validate(int mfp)
|
||||
{
|
||||
int gpio = mfp_to_gpio(mfp);
|
||||
|
||||
if ((mfp > MFP_PIN_GPIO127) || !gpio_desc[gpio].valid) {
|
||||
pr_warning("%s: GPIO%d is invalid pin\n", __func__, gpio);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return gpio;
|
||||
}
|
||||
|
||||
void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
@ -99,13 +120,9 @@ void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num)
|
|||
|
||||
for (i = 0, c = mfp_cfgs; i < num; i++, c++) {
|
||||
|
||||
gpio = mfp_to_gpio(MFP_PIN(*c));
|
||||
|
||||
if (!gpio_desc[gpio].valid) {
|
||||
pr_warning("%s: GPIO%d is invalid pin\n",
|
||||
__func__, gpio);
|
||||
gpio = __mfp_validate(MFP_PIN(*c));
|
||||
if (gpio < 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
|
@ -116,6 +133,20 @@ void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num)
|
|||
}
|
||||
}
|
||||
|
||||
void pxa2xx_mfp_set_lpm(int mfp, unsigned long lpm)
|
||||
{
|
||||
unsigned long flags;
|
||||
int gpio;
|
||||
|
||||
gpio = __mfp_validate(mfp);
|
||||
if (gpio < 0)
|
||||
return;
|
||||
|
||||
local_irq_save(flags);
|
||||
__mfp_config_lpm(gpio, lpm);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
int gpio_set_wake(unsigned int gpio, unsigned int on)
|
||||
{
|
||||
struct gpio_desc *d;
|
||||
|
|
416
arch/arm/mach-pxa/palmtx.c
Normal file
416
arch/arm/mach-pxa/palmtx.c
Normal file
|
@ -0,0 +1,416 @@
|
|||
/*
|
||||
* Hardware definitions for PalmTX
|
||||
*
|
||||
* Author: Marek Vasut <marek.vasut@gmail.com>
|
||||
*
|
||||
* Based on work of:
|
||||
* Alex Osborne <ato@meshy.org>
|
||||
* Cristiano P. <cristianop@users.sourceforge.net>
|
||||
* Jan Herman <2hp@seznam.cz>
|
||||
* Michal Hrusecky
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* (find more info at www.hackndev.com)
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/pda_power.h>
|
||||
#include <linux/pwm_backlight.h>
|
||||
#include <linux/gpio.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
|
||||
#include <asm/arch/audio.h>
|
||||
#include <asm/arch/palmtx.h>
|
||||
#include <asm/arch/mmc.h>
|
||||
#include <asm/arch/pxafb.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/mfp-pxa27x.h>
|
||||
#include <asm/arch/irda.h>
|
||||
#include <asm/arch/pxa27x_keypad.h>
|
||||
#include <asm/arch/udc.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "devices.h"
|
||||
|
||||
/******************************************************************************
|
||||
* Pin configuration
|
||||
******************************************************************************/
|
||||
static unsigned long palmtx_pin_config[] __initdata = {
|
||||
/* MMC */
|
||||
GPIO32_MMC_CLK,
|
||||
GPIO92_MMC_DAT_0,
|
||||
GPIO109_MMC_DAT_1,
|
||||
GPIO110_MMC_DAT_2,
|
||||
GPIO111_MMC_DAT_3,
|
||||
GPIO112_MMC_CMD,
|
||||
|
||||
/* AC97 */
|
||||
GPIO28_AC97_BITCLK,
|
||||
GPIO29_AC97_SDATA_IN_0,
|
||||
GPIO30_AC97_SDATA_OUT,
|
||||
GPIO31_AC97_SYNC,
|
||||
|
||||
/* IrDA */
|
||||
GPIO46_FICP_RXD,
|
||||
GPIO47_FICP_TXD,
|
||||
|
||||
/* PWM */
|
||||
GPIO16_PWM0_OUT,
|
||||
|
||||
/* USB */
|
||||
GPIO13_GPIO,
|
||||
|
||||
/* PCMCIA */
|
||||
GPIO48_nPOE,
|
||||
GPIO49_nPWE,
|
||||
GPIO50_nPIOR,
|
||||
GPIO51_nPIOW,
|
||||
GPIO85_nPCE_1,
|
||||
GPIO54_nPCE_2,
|
||||
GPIO79_PSKTSEL,
|
||||
GPIO55_nPREG,
|
||||
GPIO56_nPWAIT,
|
||||
GPIO57_nIOIS16,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* SD/MMC card controller
|
||||
******************************************************************************/
|
||||
static int palmtx_mci_init(struct device *dev, irq_handler_t palmtx_detect_int,
|
||||
void *data)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
/* Setup an interrupt for detecting card insert/remove events */
|
||||
err = request_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, palmtx_detect_int,
|
||||
IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
|
||||
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
|
||||
"SD/MMC card detect", data);
|
||||
if (err) {
|
||||
printk(KERN_ERR "%s: cannot request SD/MMC card detect IRQ\n",
|
||||
__func__);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = gpio_request(GPIO_NR_PALMTX_SD_POWER, "SD_POWER");
|
||||
if (err)
|
||||
goto pwr_err;
|
||||
|
||||
err = gpio_request(GPIO_NR_PALMTX_SD_READONLY, "SD_READONLY");
|
||||
if (err)
|
||||
goto ro_err;
|
||||
|
||||
printk(KERN_DEBUG "%s: irq registered\n", __func__);
|
||||
|
||||
return 0;
|
||||
|
||||
ro_err:
|
||||
gpio_free(GPIO_NR_PALMTX_SD_POWER);
|
||||
pwr_err:
|
||||
free_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, data);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void palmtx_mci_exit(struct device *dev, void *data)
|
||||
{
|
||||
gpio_free(GPIO_NR_PALMTX_SD_READONLY);
|
||||
gpio_free(GPIO_NR_PALMTX_SD_POWER);
|
||||
free_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, data);
|
||||
}
|
||||
|
||||
static void palmtx_mci_power(struct device *dev, unsigned int vdd)
|
||||
{
|
||||
struct pxamci_platform_data *p_d = dev->platform_data;
|
||||
gpio_set_value(GPIO_NR_PALMTX_SD_POWER, p_d->ocr_mask & (1 << vdd));
|
||||
}
|
||||
|
||||
static int palmtx_mci_get_ro(struct device *dev)
|
||||
{
|
||||
return gpio_get_value(GPIO_NR_PALMTX_SD_READONLY);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data palmtx_mci_platform_data = {
|
||||
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
|
||||
.setpower = palmtx_mci_power,
|
||||
.get_ro = palmtx_mci_get_ro,
|
||||
.init = palmtx_mci_init,
|
||||
.exit = palmtx_mci_exit,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* GPIO keyboard
|
||||
******************************************************************************/
|
||||
static unsigned int palmtx_matrix_keys[] = {
|
||||
KEY(0, 0, KEY_POWER),
|
||||
KEY(0, 1, KEY_F1),
|
||||
KEY(0, 2, KEY_ENTER),
|
||||
|
||||
KEY(1, 0, KEY_F2),
|
||||
KEY(1, 1, KEY_F3),
|
||||
KEY(1, 2, KEY_F4),
|
||||
|
||||
KEY(2, 0, KEY_UP),
|
||||
KEY(2, 2, KEY_DOWN),
|
||||
|
||||
KEY(3, 0, KEY_RIGHT),
|
||||
KEY(3, 2, KEY_LEFT),
|
||||
|
||||
};
|
||||
|
||||
static struct pxa27x_keypad_platform_data palmtx_keypad_platform_data = {
|
||||
.matrix_key_rows = 4,
|
||||
.matrix_key_cols = 3,
|
||||
.matrix_key_map = palmtx_matrix_keys,
|
||||
.matrix_key_map_size = ARRAY_SIZE(palmtx_matrix_keys),
|
||||
|
||||
.debounce_interval = 30,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* GPIO keys
|
||||
******************************************************************************/
|
||||
static struct gpio_keys_button palmtx_pxa_buttons[] = {
|
||||
{KEY_F8, GPIO_NR_PALMTX_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
|
||||
};
|
||||
|
||||
static struct gpio_keys_platform_data palmtx_pxa_keys_data = {
|
||||
.buttons = palmtx_pxa_buttons,
|
||||
.nbuttons = ARRAY_SIZE(palmtx_pxa_buttons),
|
||||
};
|
||||
|
||||
static struct platform_device palmtx_pxa_keys = {
|
||||
.name = "gpio-keys",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &palmtx_pxa_keys_data,
|
||||
},
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* Backlight
|
||||
******************************************************************************/
|
||||
static int palmtx_backlight_init(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTX_BL_POWER, "BL POWER");
|
||||
if (ret)
|
||||
goto err;
|
||||
ret = gpio_request(GPIO_NR_PALMTX_LCD_POWER, "LCD POWER");
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
return 0;
|
||||
err2:
|
||||
gpio_free(GPIO_NR_PALMTX_BL_POWER);
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int palmtx_backlight_notify(int brightness)
|
||||
{
|
||||
gpio_set_value(GPIO_NR_PALMTX_BL_POWER, brightness);
|
||||
gpio_set_value(GPIO_NR_PALMTX_LCD_POWER, brightness);
|
||||
return brightness;
|
||||
}
|
||||
|
||||
static void palmtx_backlight_exit(struct device *dev)
|
||||
{
|
||||
gpio_free(GPIO_NR_PALMTX_BL_POWER);
|
||||
gpio_free(GPIO_NR_PALMTX_LCD_POWER);
|
||||
}
|
||||
|
||||
static struct platform_pwm_backlight_data palmtx_backlight_data = {
|
||||
.pwm_id = 0,
|
||||
.max_brightness = PALMTX_MAX_INTENSITY,
|
||||
.dft_brightness = PALMTX_MAX_INTENSITY,
|
||||
.pwm_period_ns = PALMTX_PERIOD_NS,
|
||||
.init = palmtx_backlight_init,
|
||||
.notify = palmtx_backlight_notify,
|
||||
.exit = palmtx_backlight_exit,
|
||||
};
|
||||
|
||||
static struct platform_device palmtx_backlight = {
|
||||
.name = "pwm-backlight",
|
||||
.dev = {
|
||||
.parent = &pxa27x_device_pwm0.dev,
|
||||
.platform_data = &palmtx_backlight_data,
|
||||
},
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* IrDA
|
||||
******************************************************************************/
|
||||
static void palmtx_irda_transceiver_mode(struct device *dev, int mode)
|
||||
{
|
||||
gpio_set_value(GPIO_NR_PALMTX_IR_DISABLE, mode & IR_OFF);
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
}
|
||||
|
||||
static struct pxaficp_platform_data palmtx_ficp_platform_data = {
|
||||
.transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
|
||||
.transceiver_mode = palmtx_irda_transceiver_mode,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* UDC
|
||||
******************************************************************************/
|
||||
static void palmtx_udc_command(int cmd)
|
||||
{
|
||||
gpio_set_value(GPIO_NR_PALMTX_USB_POWER, !cmd);
|
||||
udelay(50);
|
||||
gpio_set_value(GPIO_NR_PALMTX_USB_PULLUP, !cmd);
|
||||
}
|
||||
|
||||
static struct pxa2xx_udc_mach_info palmtx_udc_info __initdata = {
|
||||
.gpio_vbus = GPIO_NR_PALMTX_USB_DETECT_N,
|
||||
.gpio_vbus_inverted = 1,
|
||||
.udc_command = palmtx_udc_command,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* Power supply
|
||||
******************************************************************************/
|
||||
static int power_supply_init(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTX_POWER_DETECT, "CABLE_STATE_AC");
|
||||
if (ret)
|
||||
goto err_cs_ac;
|
||||
|
||||
ret = gpio_request(GPIO_NR_PALMTX_USB_DETECT_N, "CABLE_STATE_USB");
|
||||
if (ret)
|
||||
goto err_cs_usb;
|
||||
|
||||
return 0;
|
||||
|
||||
err_cs_usb:
|
||||
gpio_free(GPIO_NR_PALMTX_POWER_DETECT);
|
||||
err_cs_ac:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int palmtx_is_ac_online(void)
|
||||
{
|
||||
return gpio_get_value(GPIO_NR_PALMTX_POWER_DETECT);
|
||||
}
|
||||
|
||||
static int palmtx_is_usb_online(void)
|
||||
{
|
||||
return !gpio_get_value(GPIO_NR_PALMTX_USB_DETECT_N);
|
||||
}
|
||||
|
||||
static void power_supply_exit(struct device *dev)
|
||||
{
|
||||
gpio_free(GPIO_NR_PALMTX_USB_DETECT_N);
|
||||
gpio_free(GPIO_NR_PALMTX_POWER_DETECT);
|
||||
}
|
||||
|
||||
static char *palmtx_supplicants[] = {
|
||||
"main-battery",
|
||||
};
|
||||
|
||||
static struct pda_power_pdata power_supply_info = {
|
||||
.init = power_supply_init,
|
||||
.is_ac_online = palmtx_is_ac_online,
|
||||
.is_usb_online = palmtx_is_usb_online,
|
||||
.exit = power_supply_exit,
|
||||
.supplied_to = palmtx_supplicants,
|
||||
.num_supplicants = ARRAY_SIZE(palmtx_supplicants),
|
||||
};
|
||||
|
||||
static struct platform_device power_supply = {
|
||||
.name = "pda-power",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &power_supply_info,
|
||||
},
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* Framebuffer
|
||||
******************************************************************************/
|
||||
static struct pxafb_mode_info palmtx_lcd_modes[] = {
|
||||
{
|
||||
.pixclock = 57692,
|
||||
.xres = 320,
|
||||
.yres = 480,
|
||||
.bpp = 16,
|
||||
|
||||
.left_margin = 32,
|
||||
.right_margin = 1,
|
||||
.upper_margin = 7,
|
||||
.lower_margin = 1,
|
||||
|
||||
.hsync_len = 4,
|
||||
.vsync_len = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct pxafb_mach_info palmtx_lcd_screen = {
|
||||
.modes = palmtx_lcd_modes,
|
||||
.num_modes = ARRAY_SIZE(palmtx_lcd_modes),
|
||||
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
* Machine init
|
||||
******************************************************************************/
|
||||
static struct platform_device *devices[] __initdata = {
|
||||
#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
|
||||
&palmtx_pxa_keys,
|
||||
#endif
|
||||
&palmtx_backlight,
|
||||
&power_supply,
|
||||
};
|
||||
|
||||
static struct map_desc palmtx_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = PALMTX_PCMCIA_VIRT,
|
||||
.pfn = __phys_to_pfn(PALMTX_PCMCIA_PHYS),
|
||||
.length = PALMTX_PCMCIA_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
};
|
||||
|
||||
static void __init palmtx_map_io(void)
|
||||
{
|
||||
pxa_map_io();
|
||||
iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc));
|
||||
}
|
||||
|
||||
static void __init palmtx_init(void)
|
||||
{
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config));
|
||||
|
||||
set_pxa_fb_info(&palmtx_lcd_screen);
|
||||
pxa_set_mci_info(&palmtx_mci_platform_data);
|
||||
pxa_set_udc_info(&palmtx_udc_info);
|
||||
pxa_set_ac97_info(NULL);
|
||||
pxa_set_ficp_info(&palmtx_ficp_platform_data);
|
||||
pxa_set_keypad_info(&palmtx_keypad_platform_data);
|
||||
|
||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||
}
|
||||
|
||||
MACHINE_START(PALMTX, "Palm T|X")
|
||||
.phys_io = PALMTX_PHYS_IO_START,
|
||||
.io_pg_offst = io_p2v(0x40000000),
|
||||
.boot_params = 0xa0000100,
|
||||
.map_io = palmtx_map_io,
|
||||
.init_irq = pxa27x_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = palmtx_init
|
||||
MACHINE_END
|
|
@ -24,7 +24,9 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/max7301.h>
|
||||
#include <linux/leds.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
|
@ -108,6 +110,32 @@ static struct platform_device smc91x_device = {
|
|||
.resource = smc91x_resources,
|
||||
};
|
||||
|
||||
/*
|
||||
* SPI host and devices
|
||||
*/
|
||||
static struct pxa2xx_spi_master pxa_ssp_master_info = {
|
||||
.num_chipselect = 1,
|
||||
};
|
||||
|
||||
static struct max7301_platform_data max7301_info = {
|
||||
.base = -1,
|
||||
};
|
||||
|
||||
/* bus_num must match id in pxa2xx_set_spi_info() call */
|
||||
static struct spi_board_info spi_board_info[] __initdata = {
|
||||
{
|
||||
.modalias = "max7301",
|
||||
.platform_data = &max7301_info,
|
||||
.max_speed_hz = 13000000,
|
||||
.bus_num = 1,
|
||||
.chip_select = 0,
|
||||
.mode = SPI_MODE_0,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* NOR flash
|
||||
*/
|
||||
static struct physmap_flash_data pcm027_flash_data = {
|
||||
.width = 4,
|
||||
};
|
||||
|
@ -190,6 +218,9 @@ static void __init pcm027_init(void)
|
|||
#ifdef CONFIG_MACH_PCM990_BASEBOARD
|
||||
pcm990_baseboard_init();
|
||||
#endif
|
||||
|
||||
pxa2xx_set_spi_info(1, &pxa_ssp_master_info);
|
||||
spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
|
||||
}
|
||||
|
||||
static void __init pcm027_map_io(void)
|
||||
|
|
|
@ -33,14 +33,30 @@
|
|||
#include <asm/arch/camera.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-gpio.h>
|
||||
#include <asm/arch/audio.h>
|
||||
#include <asm/arch/mmc.h>
|
||||
#include <asm/arch/ohci.h>
|
||||
#include <asm/arch/pcm990_baseboard.h>
|
||||
#include <asm/arch/pxafb.h>
|
||||
#include <asm/arch/mfp-pxa27x.h>
|
||||
|
||||
#include "devices.h"
|
||||
#include "generic.h"
|
||||
|
||||
static unsigned long pcm990_pin_config[] __initdata = {
|
||||
/* MMC */
|
||||
GPIO32_MMC_CLK,
|
||||
GPIO112_MMC_CMD,
|
||||
GPIO92_MMC_DAT_0,
|
||||
GPIO109_MMC_DAT_1,
|
||||
GPIO110_MMC_DAT_2,
|
||||
GPIO111_MMC_DAT_3,
|
||||
/* USB */
|
||||
GPIO88_USBH1_PWR,
|
||||
GPIO89_USBH1_PEN,
|
||||
/* PWM0 */
|
||||
GPIO16_PWM0_OUT,
|
||||
};
|
||||
|
||||
/*
|
||||
* pcm990_lcd_power - control power supply to the LCD
|
||||
|
@ -277,16 +293,6 @@ static int pcm990_mci_init(struct device *dev, irq_handler_t mci_detect_int,
|
|||
{
|
||||
int err;
|
||||
|
||||
/*
|
||||
* enable GPIO for PXA27x MMC controller
|
||||
*/
|
||||
pxa_gpio_mode(GPIO32_MMCCLK_MD);
|
||||
pxa_gpio_mode(GPIO112_MMCCMD_MD);
|
||||
pxa_gpio_mode(GPIO92_MMCDAT0_MD);
|
||||
pxa_gpio_mode(GPIO109_MMCDAT1_MD);
|
||||
pxa_gpio_mode(GPIO110_MMCDAT2_MD);
|
||||
pxa_gpio_mode(GPIO111_MMCDAT3_MD);
|
||||
|
||||
err = request_irq(PCM027_MMCDET_IRQ, mci_detect_int, IRQF_DISABLED,
|
||||
"MMC card detect", data);
|
||||
if (err)
|
||||
|
@ -333,8 +339,6 @@ static struct pxamci_platform_data pcm990_mci_platform_data = {
|
|||
*/
|
||||
static int pcm990_ohci_init(struct device *dev)
|
||||
{
|
||||
pxa_gpio_mode(PCM990_USB_OVERCURRENT);
|
||||
pxa_gpio_mode(PCM990_USB_PWR_EN);
|
||||
/*
|
||||
* disable USB port 2 and 3
|
||||
* power sense is active low
|
||||
|
@ -361,23 +365,27 @@ static struct pxaohci_platform_data pcm990_ohci_platform_data = {
|
|||
* PXA27x Camera specific stuff
|
||||
*/
|
||||
#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
|
||||
static unsigned long pcm990_camera_pin_config[] = {
|
||||
/* CIF */
|
||||
GPIO98_CIF_DD_0,
|
||||
GPIO105_CIF_DD_1,
|
||||
GPIO104_CIF_DD_2,
|
||||
GPIO103_CIF_DD_3,
|
||||
GPIO95_CIF_DD_4,
|
||||
GPIO94_CIF_DD_5,
|
||||
GPIO93_CIF_DD_6,
|
||||
GPIO108_CIF_DD_7,
|
||||
GPIO107_CIF_DD_8,
|
||||
GPIO106_CIF_DD_9,
|
||||
GPIO42_CIF_MCLK,
|
||||
GPIO45_CIF_PCLK,
|
||||
GPIO43_CIF_FV,
|
||||
GPIO44_CIF_LV,
|
||||
};
|
||||
|
||||
static int pcm990_pxacamera_init(struct device *dev)
|
||||
{
|
||||
pxa_gpio_mode(GPIO98_CIF_DD_0_MD);
|
||||
pxa_gpio_mode(GPIO105_CIF_DD_1_MD);
|
||||
pxa_gpio_mode(GPIO104_CIF_DD_2_MD);
|
||||
pxa_gpio_mode(GPIO103_CIF_DD_3_MD);
|
||||
pxa_gpio_mode(GPIO95_CIF_DD_4_MD);
|
||||
pxa_gpio_mode(GPIO94_CIF_DD_5_MD);
|
||||
pxa_gpio_mode(GPIO93_CIF_DD_6_MD);
|
||||
pxa_gpio_mode(GPIO108_CIF_DD_7_MD);
|
||||
pxa_gpio_mode(GPIO107_CIF_DD_8_MD);
|
||||
pxa_gpio_mode(GPIO106_CIF_DD_9_MD);
|
||||
pxa_gpio_mode(GPIO42_CIF_MCLK_MD);
|
||||
pxa_gpio_mode(GPIO45_CIF_PCLK_MD);
|
||||
pxa_gpio_mode(GPIO43_CIF_FV_MD);
|
||||
pxa_gpio_mode(GPIO44_CIF_LV_MD);
|
||||
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_camera_pin_config));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -449,8 +457,10 @@ static struct map_desc pcm990_io_desc[] __initdata = {
|
|||
*/
|
||||
void __init pcm990_baseboard_init(void)
|
||||
{
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_pin_config));
|
||||
|
||||
/* register CPLD access */
|
||||
iotable_init(pcm990_io_desc, ARRAY_SIZE(pcm990_io_desc));
|
||||
iotable_init(ARRAY_AND_SIZE(pcm990_io_desc));
|
||||
|
||||
/* register CPLD's IRQ controller */
|
||||
pcm990_init_irq();
|
||||
|
@ -458,7 +468,6 @@ void __init pcm990_baseboard_init(void)
|
|||
#ifndef CONFIG_PCM990_DISPLAY_NONE
|
||||
set_pxa_fb_info(&pcm990_fbinfo);
|
||||
#endif
|
||||
pxa_gpio_mode(GPIO16_PWM0_MD);
|
||||
platform_device_register(&pcm990_backlight_device);
|
||||
|
||||
/* MMC */
|
||||
|
@ -473,9 +482,8 @@ void __init pcm990_baseboard_init(void)
|
|||
#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
|
||||
pxa_set_camera_info(&pcm990_pxacamera_platform_data);
|
||||
|
||||
i2c_register_board_info(0, pcm990_i2c_devices,
|
||||
ARRAY_SIZE(pcm990_i2c_devices));
|
||||
i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
|
||||
#endif
|
||||
|
||||
printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n");
|
||||
printk(KERN_INFO "PCM-990 Evaluation baseboard initialized\n");
|
||||
}
|
||||
|
|
|
@ -267,6 +267,7 @@ static void poodle_irda_transceiver_mode(struct device *dev, int mode)
|
|||
} else {
|
||||
GPCR(POODLE_GPIO_IR_ON) = GPIO_bit(POODLE_GPIO_IR_ON);
|
||||
}
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
}
|
||||
|
||||
static struct pxaficp_platform_data poodle_ficp_platform_data = {
|
||||
|
|
|
@ -109,6 +109,52 @@ static const struct clkops clk_pxa25x_lcd_ops = {
|
|||
.getrate = clk_pxa25x_lcd_getrate,
|
||||
};
|
||||
|
||||
static unsigned long gpio12_config_32k[] = {
|
||||
GPIO12_32KHz,
|
||||
};
|
||||
|
||||
static unsigned long gpio12_config_gpio[] = {
|
||||
GPIO12_GPIO,
|
||||
};
|
||||
|
||||
static void clk_gpio12_enable(struct clk *clk)
|
||||
{
|
||||
pxa2xx_mfp_config(gpio12_config_32k, 1);
|
||||
}
|
||||
|
||||
static void clk_gpio12_disable(struct clk *clk)
|
||||
{
|
||||
pxa2xx_mfp_config(gpio12_config_gpio, 1);
|
||||
}
|
||||
|
||||
static const struct clkops clk_pxa25x_gpio12_ops = {
|
||||
.enable = clk_gpio12_enable,
|
||||
.disable = clk_gpio12_disable,
|
||||
};
|
||||
|
||||
static unsigned long gpio11_config_3m6[] = {
|
||||
GPIO11_3_6MHz,
|
||||
};
|
||||
|
||||
static unsigned long gpio11_config_gpio[] = {
|
||||
GPIO11_GPIO,
|
||||
};
|
||||
|
||||
static void clk_gpio11_enable(struct clk *clk)
|
||||
{
|
||||
pxa2xx_mfp_config(gpio11_config_3m6, 1);
|
||||
}
|
||||
|
||||
static void clk_gpio11_disable(struct clk *clk)
|
||||
{
|
||||
pxa2xx_mfp_config(gpio11_config_gpio, 1);
|
||||
}
|
||||
|
||||
static const struct clkops clk_pxa25x_gpio11_ops = {
|
||||
.enable = clk_gpio11_enable,
|
||||
.disable = clk_gpio11_disable,
|
||||
};
|
||||
|
||||
/*
|
||||
* 3.6864MHz -> OST, GPIO, SSP, PWM, PLLs (95.842MHz, 147.456MHz)
|
||||
* 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz
|
||||
|
@ -128,6 +174,8 @@ static struct clk pxa25x_clks[] = {
|
|||
INIT_CKEN("UARTCLK", BTUART, 14745600, 1, &pxa_device_btuart.dev),
|
||||
INIT_CKEN("UARTCLK", STUART, 14745600, 1, NULL),
|
||||
INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa25x_device_udc.dev),
|
||||
INIT_CLK("GPIO11_CLK", &clk_pxa25x_gpio11_ops, 3686400, 0, NULL),
|
||||
INIT_CLK("GPIO12_CLK", &clk_pxa25x_gpio12_ops, 32768, 0, NULL),
|
||||
INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev),
|
||||
INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev),
|
||||
|
||||
|
@ -145,7 +193,10 @@ static struct clk pxa25x_clks[] = {
|
|||
INIT_CKEN("FICPCLK", FICP, 47923000, 0, NULL),
|
||||
};
|
||||
|
||||
static struct clk gpio7_clk = INIT_CKOTHER("GPIO7_CK", &pxa25x_clks[4], NULL);
|
||||
static struct clk pxa2xx_clk_aliases[] = {
|
||||
INIT_CKOTHER("GPIO7_CLK", &pxa25x_clks[4], NULL),
|
||||
INIT_CKOTHER("SA1111_CLK", &pxa25x_clks[5], NULL),
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
|
@ -293,7 +344,7 @@ static int __init pxa25x_init(void)
|
|||
int i, ret = 0;
|
||||
|
||||
/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
|
||||
if (cpu_is_pxa25x())
|
||||
if (cpu_is_pxa255())
|
||||
clks_register(&pxa25x_hwuart_clk, 1);
|
||||
|
||||
if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
|
||||
|
@ -317,10 +368,10 @@ static int __init pxa25x_init(void)
|
|||
}
|
||||
|
||||
/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
|
||||
if (cpu_is_pxa25x())
|
||||
if (cpu_is_pxa255())
|
||||
ret = platform_device_register(&pxa_device_hwuart);
|
||||
|
||||
clks_register(&gpio7_clk, 1);
|
||||
clks_register(pxa2xx_clk_aliases, ARRAY_SIZE(pxa2xx_clk_aliases));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -15,10 +15,16 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/pxa3xx-regs.h>
|
||||
#include <asm/arch/mfp-pxa300.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "devices.h"
|
||||
#include "clock.h"
|
||||
|
||||
static struct pxa3xx_mfp_addr_map pxa300_mfp_addr_map[] __initdata = {
|
||||
|
||||
MFP_ADDR_X(GPIO0, GPIO2, 0x00b4),
|
||||
|
@ -79,15 +85,26 @@ static struct pxa3xx_mfp_addr_map pxa310_mfp_addr_map[] __initdata = {
|
|||
MFP_ADDR_END,
|
||||
};
|
||||
|
||||
static struct clk common_clks[] = {
|
||||
PXA3xx_CKEN("NANDCLK", NAND, 156000000, 0, &pxa3xx_device_nand.dev),
|
||||
};
|
||||
|
||||
static struct clk pxa310_clks[] = {
|
||||
PXA3xx_CKEN("MMCCLK", MMC3, 19500000, 0, &pxa3xx_device_mci3.dev),
|
||||
};
|
||||
|
||||
static int __init pxa300_init(void)
|
||||
{
|
||||
if (cpu_is_pxa300() || cpu_is_pxa310()) {
|
||||
pxa3xx_init_mfp();
|
||||
pxa3xx_mfp_init_addr(pxa300_mfp_addr_map);
|
||||
clks_register(ARRAY_AND_SIZE(common_clks));
|
||||
}
|
||||
|
||||
if (cpu_is_pxa310())
|
||||
if (cpu_is_pxa310()) {
|
||||
pxa3xx_mfp_init_addr(pxa310_mfp_addr_map);
|
||||
clks_register(ARRAY_AND_SIZE(pxa310_clks));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -15,11 +15,17 @@
|
|||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/mfp.h>
|
||||
#include <asm/arch/pxa3xx-regs.h>
|
||||
#include <asm/arch/mfp-pxa320.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "devices.h"
|
||||
#include "clock.h"
|
||||
|
||||
static struct pxa3xx_mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
|
||||
|
||||
MFP_ADDR_X(GPIO0, GPIO4, 0x0124),
|
||||
|
@ -74,16 +80,17 @@ static struct pxa3xx_mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
|
|||
MFP_ADDR_END,
|
||||
};
|
||||
|
||||
static void __init pxa320_init_mfp(void)
|
||||
{
|
||||
pxa3xx_init_mfp();
|
||||
pxa3xx_mfp_init_addr(pxa320_mfp_addr_map);
|
||||
}
|
||||
static struct clk pxa320_clks[] = {
|
||||
PXA3xx_CKEN("NANDCLK", NAND, 104000000, 0, &pxa3xx_device_nand.dev),
|
||||
};
|
||||
|
||||
static int __init pxa320_init(void)
|
||||
{
|
||||
if (cpu_is_pxa320())
|
||||
pxa320_init_mfp();
|
||||
if (cpu_is_pxa320()) {
|
||||
pxa3xx_init_mfp();
|
||||
pxa3xx_mfp_init_addr(pxa320_mfp_addr_map);
|
||||
clks_register(ARRAY_AND_SIZE(pxa320_clks));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk)
|
|||
return hsio_clk;
|
||||
}
|
||||
|
||||
static void clk_pxa3xx_cken_enable(struct clk *clk)
|
||||
void clk_pxa3xx_cken_enable(struct clk *clk)
|
||||
{
|
||||
unsigned long mask = 1ul << (clk->cken & 0x1f);
|
||||
|
||||
|
@ -154,7 +154,7 @@ static void clk_pxa3xx_cken_enable(struct clk *clk)
|
|||
CKENB |= mask;
|
||||
}
|
||||
|
||||
static void clk_pxa3xx_cken_disable(struct clk *clk)
|
||||
void clk_pxa3xx_cken_disable(struct clk *clk)
|
||||
{
|
||||
unsigned long mask = 1ul << (clk->cken & 0x1f);
|
||||
|
||||
|
@ -164,7 +164,7 @@ static void clk_pxa3xx_cken_disable(struct clk *clk)
|
|||
CKENB &= ~mask;
|
||||
}
|
||||
|
||||
static const struct clkops clk_pxa3xx_cken_ops = {
|
||||
const struct clkops clk_pxa3xx_cken_ops = {
|
||||
.enable = clk_pxa3xx_cken_enable,
|
||||
.disable = clk_pxa3xx_cken_disable,
|
||||
};
|
||||
|
@ -196,24 +196,6 @@ static const struct clkops clk_pout_ops = {
|
|||
.disable = clk_pout_disable,
|
||||
};
|
||||
|
||||
#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \
|
||||
{ \
|
||||
.name = _name, \
|
||||
.dev = _dev, \
|
||||
.ops = &clk_pxa3xx_cken_ops, \
|
||||
.rate = _rate, \
|
||||
.cken = CKEN_##_cken, \
|
||||
.delay = _delay, \
|
||||
}
|
||||
|
||||
#define PXA3xx_CK(_name, _cken, _ops, _dev) \
|
||||
{ \
|
||||
.name = _name, \
|
||||
.dev = _dev, \
|
||||
.ops = _ops, \
|
||||
.cken = CKEN_##_cken, \
|
||||
}
|
||||
|
||||
static struct clk pxa3xx_clks[] = {
|
||||
{
|
||||
.name = "CLK_POUT",
|
||||
|
@ -244,7 +226,6 @@ static struct clk pxa3xx_clks[] = {
|
|||
|
||||
PXA3xx_CKEN("MMCCLK", MMC1, 19500000, 0, &pxa_device_mci.dev),
|
||||
PXA3xx_CKEN("MMCCLK", MMC2, 19500000, 0, &pxa3xx_device_mci2.dev),
|
||||
PXA3xx_CKEN("MMCCLK", MMC3, 19500000, 0, &pxa3xx_device_mci3.dev),
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
|
190
arch/arm/mach-pxa/pxa930.c
Normal file
190
arch/arm/mach-pxa/pxa930.c
Normal file
|
@ -0,0 +1,190 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-pxa/pxa930.c
|
||||
*
|
||||
* Code specific to PXA930
|
||||
*
|
||||
* Copyright (C) 2007-2008 Marvell Internation Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/mfp-pxa930.h>
|
||||
|
||||
static struct pxa3xx_mfp_addr_map pxa930_mfp_addr_map[] __initdata = {
|
||||
|
||||
MFP_ADDR(GPIO0, 0x02e0),
|
||||
MFP_ADDR(GPIO1, 0x02dc),
|
||||
MFP_ADDR(GPIO2, 0x02e8),
|
||||
MFP_ADDR(GPIO3, 0x02d8),
|
||||
MFP_ADDR(GPIO4, 0x02e4),
|
||||
MFP_ADDR(GPIO5, 0x02ec),
|
||||
MFP_ADDR(GPIO6, 0x02f8),
|
||||
MFP_ADDR(GPIO7, 0x02fc),
|
||||
MFP_ADDR(GPIO8, 0x0300),
|
||||
MFP_ADDR(GPIO9, 0x02d4),
|
||||
MFP_ADDR(GPIO10, 0x02f4),
|
||||
MFP_ADDR(GPIO11, 0x02f0),
|
||||
MFP_ADDR(GPIO12, 0x0304),
|
||||
MFP_ADDR(GPIO13, 0x0310),
|
||||
MFP_ADDR(GPIO14, 0x0308),
|
||||
MFP_ADDR(GPIO15, 0x030c),
|
||||
MFP_ADDR(GPIO16, 0x04e8),
|
||||
MFP_ADDR(GPIO17, 0x04f4),
|
||||
MFP_ADDR(GPIO18, 0x04f8),
|
||||
MFP_ADDR(GPIO19, 0x04fc),
|
||||
MFP_ADDR(GPIO20, 0x0518),
|
||||
MFP_ADDR(GPIO21, 0x051c),
|
||||
MFP_ADDR(GPIO22, 0x04ec),
|
||||
MFP_ADDR(GPIO23, 0x0500),
|
||||
MFP_ADDR(GPIO24, 0x04f0),
|
||||
MFP_ADDR(GPIO25, 0x0504),
|
||||
MFP_ADDR(GPIO26, 0x0510),
|
||||
MFP_ADDR(GPIO27, 0x0514),
|
||||
MFP_ADDR(GPIO28, 0x0520),
|
||||
MFP_ADDR(GPIO29, 0x0600),
|
||||
MFP_ADDR(GPIO30, 0x0618),
|
||||
MFP_ADDR(GPIO31, 0x0610),
|
||||
MFP_ADDR(GPIO32, 0x060c),
|
||||
MFP_ADDR(GPIO33, 0x061c),
|
||||
MFP_ADDR(GPIO34, 0x0620),
|
||||
MFP_ADDR(GPIO35, 0x0628),
|
||||
MFP_ADDR(GPIO36, 0x062c),
|
||||
MFP_ADDR(GPIO37, 0x0630),
|
||||
MFP_ADDR(GPIO38, 0x0634),
|
||||
MFP_ADDR(GPIO39, 0x0638),
|
||||
MFP_ADDR(GPIO40, 0x063c),
|
||||
MFP_ADDR(GPIO41, 0x0614),
|
||||
MFP_ADDR(GPIO42, 0x0624),
|
||||
MFP_ADDR(GPIO43, 0x0608),
|
||||
MFP_ADDR(GPIO44, 0x0604),
|
||||
MFP_ADDR(GPIO45, 0x050c),
|
||||
MFP_ADDR(GPIO46, 0x0508),
|
||||
MFP_ADDR(GPIO47, 0x02bc),
|
||||
MFP_ADDR(GPIO48, 0x02b4),
|
||||
MFP_ADDR(GPIO49, 0x02b8),
|
||||
MFP_ADDR(GPIO50, 0x02c8),
|
||||
MFP_ADDR(GPIO51, 0x02c0),
|
||||
MFP_ADDR(GPIO52, 0x02c4),
|
||||
MFP_ADDR(GPIO53, 0x02d0),
|
||||
MFP_ADDR(GPIO54, 0x02cc),
|
||||
MFP_ADDR(GPIO55, 0x029c),
|
||||
MFP_ADDR(GPIO56, 0x02a0),
|
||||
MFP_ADDR(GPIO57, 0x0294),
|
||||
MFP_ADDR(GPIO58, 0x0298),
|
||||
MFP_ADDR(GPIO59, 0x02a4),
|
||||
MFP_ADDR(GPIO60, 0x02a8),
|
||||
MFP_ADDR(GPIO61, 0x02b0),
|
||||
MFP_ADDR(GPIO62, 0x02ac),
|
||||
MFP_ADDR(GPIO63, 0x0640),
|
||||
MFP_ADDR(GPIO64, 0x065c),
|
||||
MFP_ADDR(GPIO65, 0x0648),
|
||||
MFP_ADDR(GPIO66, 0x0644),
|
||||
MFP_ADDR(GPIO67, 0x0674),
|
||||
MFP_ADDR(GPIO68, 0x0658),
|
||||
MFP_ADDR(GPIO69, 0x0654),
|
||||
MFP_ADDR(GPIO70, 0x0660),
|
||||
MFP_ADDR(GPIO71, 0x0668),
|
||||
MFP_ADDR(GPIO72, 0x0664),
|
||||
MFP_ADDR(GPIO73, 0x0650),
|
||||
MFP_ADDR(GPIO74, 0x066c),
|
||||
MFP_ADDR(GPIO75, 0x064c),
|
||||
MFP_ADDR(GPIO76, 0x0670),
|
||||
MFP_ADDR(GPIO77, 0x0678),
|
||||
MFP_ADDR(GPIO78, 0x067c),
|
||||
MFP_ADDR(GPIO79, 0x0694),
|
||||
MFP_ADDR(GPIO80, 0x069c),
|
||||
MFP_ADDR(GPIO81, 0x06a0),
|
||||
MFP_ADDR(GPIO82, 0x06a4),
|
||||
MFP_ADDR(GPIO83, 0x0698),
|
||||
MFP_ADDR(GPIO84, 0x06bc),
|
||||
MFP_ADDR(GPIO85, 0x06b4),
|
||||
MFP_ADDR(GPIO86, 0x06b0),
|
||||
MFP_ADDR(GPIO87, 0x06c0),
|
||||
MFP_ADDR(GPIO88, 0x06c4),
|
||||
MFP_ADDR(GPIO89, 0x06ac),
|
||||
MFP_ADDR(GPIO90, 0x0680),
|
||||
MFP_ADDR(GPIO91, 0x0684),
|
||||
MFP_ADDR(GPIO92, 0x0688),
|
||||
MFP_ADDR(GPIO93, 0x0690),
|
||||
MFP_ADDR(GPIO94, 0x068c),
|
||||
MFP_ADDR(GPIO95, 0x06a8),
|
||||
MFP_ADDR(GPIO96, 0x06b8),
|
||||
MFP_ADDR(GPIO97, 0x0410),
|
||||
MFP_ADDR(GPIO98, 0x0418),
|
||||
MFP_ADDR(GPIO99, 0x041c),
|
||||
MFP_ADDR(GPIO100, 0x0414),
|
||||
MFP_ADDR(GPIO101, 0x0408),
|
||||
MFP_ADDR(GPIO102, 0x0324),
|
||||
MFP_ADDR(GPIO103, 0x040c),
|
||||
MFP_ADDR(GPIO104, 0x0400),
|
||||
MFP_ADDR(GPIO105, 0x0328),
|
||||
MFP_ADDR(GPIO106, 0x0404),
|
||||
|
||||
MFP_ADDR(nXCVREN, 0x0204),
|
||||
MFP_ADDR(DF_CLE_nOE, 0x020c),
|
||||
MFP_ADDR(DF_nADV1_ALE, 0x0218),
|
||||
MFP_ADDR(DF_SCLK_E, 0x0214),
|
||||
MFP_ADDR(DF_SCLK_S, 0x0210),
|
||||
MFP_ADDR(nBE0, 0x021c),
|
||||
MFP_ADDR(nBE1, 0x0220),
|
||||
MFP_ADDR(DF_nADV2_ALE, 0x0224),
|
||||
MFP_ADDR(DF_INT_RnB, 0x0228),
|
||||
MFP_ADDR(DF_nCS0, 0x022c),
|
||||
MFP_ADDR(DF_nCS1, 0x0230),
|
||||
MFP_ADDR(nLUA, 0x0254),
|
||||
MFP_ADDR(nLLA, 0x0258),
|
||||
MFP_ADDR(DF_nWE, 0x0234),
|
||||
MFP_ADDR(DF_nRE_nOE, 0x0238),
|
||||
MFP_ADDR(DF_ADDR0, 0x024c),
|
||||
MFP_ADDR(DF_ADDR1, 0x0250),
|
||||
MFP_ADDR(DF_ADDR2, 0x025c),
|
||||
MFP_ADDR(DF_ADDR3, 0x0260),
|
||||
MFP_ADDR(DF_IO0, 0x023c),
|
||||
MFP_ADDR(DF_IO1, 0x0240),
|
||||
MFP_ADDR(DF_IO2, 0x0244),
|
||||
MFP_ADDR(DF_IO3, 0x0248),
|
||||
MFP_ADDR(DF_IO4, 0x0264),
|
||||
MFP_ADDR(DF_IO5, 0x0268),
|
||||
MFP_ADDR(DF_IO6, 0x026c),
|
||||
MFP_ADDR(DF_IO7, 0x0270),
|
||||
MFP_ADDR(DF_IO8, 0x0274),
|
||||
MFP_ADDR(DF_IO9, 0x0278),
|
||||
MFP_ADDR(DF_IO10, 0x027c),
|
||||
MFP_ADDR(DF_IO11, 0x0280),
|
||||
MFP_ADDR(DF_IO12, 0x0284),
|
||||
MFP_ADDR(DF_IO13, 0x0288),
|
||||
MFP_ADDR(DF_IO14, 0x028c),
|
||||
MFP_ADDR(DF_IO15, 0x0290),
|
||||
|
||||
MFP_ADDR(GSIM_UIO, 0x0314),
|
||||
MFP_ADDR(GSIM_UCLK, 0x0318),
|
||||
MFP_ADDR(GSIM_UDET, 0x031c),
|
||||
MFP_ADDR(GSIM_nURST, 0x0320),
|
||||
|
||||
MFP_ADDR(PMIC_INT, 0x06c8),
|
||||
|
||||
MFP_ADDR(RDY, 0x0200),
|
||||
|
||||
MFP_ADDR_END,
|
||||
};
|
||||
|
||||
static int __init pxa930_init(void)
|
||||
{
|
||||
if (cpu_is_pxa930()) {
|
||||
pxa3xx_init_mfp();
|
||||
pxa3xx_mfp_init_addr(pxa930_mfp_addr_map);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
core_initcall(pxa930_init);
|
96
arch/arm/mach-pxa/reset.c
Normal file
96
arch/arm/mach-pxa/reset.c
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/proc-fns.h>
|
||||
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-regs.h>
|
||||
|
||||
static void do_hw_reset(void);
|
||||
|
||||
static int reset_gpio = -1;
|
||||
|
||||
int init_gpio_reset(int gpio)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = gpio_request(gpio, "reset generator");
|
||||
if (rc) {
|
||||
printk(KERN_ERR "Can't request reset_gpio\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = gpio_direction_input(gpio);
|
||||
if (rc) {
|
||||
printk(KERN_ERR "Can't configure reset_gpio for input\n");
|
||||
gpio_free(gpio);
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
if (!rc)
|
||||
reset_gpio = gpio;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* Trigger GPIO reset.
|
||||
* This covers various types of logic connecting gpio pin
|
||||
* to RESET pins (nRESET or GPIO_RESET):
|
||||
*/
|
||||
static void do_gpio_reset(void)
|
||||
{
|
||||
BUG_ON(reset_gpio == -1);
|
||||
|
||||
/* drive it low */
|
||||
gpio_direction_output(reset_gpio, 0);
|
||||
mdelay(2);
|
||||
/* rising edge or drive high */
|
||||
gpio_set_value(reset_gpio, 1);
|
||||
mdelay(2);
|
||||
/* falling edge */
|
||||
gpio_set_value(reset_gpio, 0);
|
||||
|
||||
/* give it some time */
|
||||
mdelay(10);
|
||||
|
||||
WARN_ON(1);
|
||||
/* fallback */
|
||||
do_hw_reset();
|
||||
}
|
||||
|
||||
static void do_hw_reset(void)
|
||||
{
|
||||
/* Initialize the watchdog and let it fire */
|
||||
OWER = OWER_WME;
|
||||
OSSR = OSSR_M3;
|
||||
OSMR3 = OSCR + 368640; /* ... in 100 ms */
|
||||
}
|
||||
|
||||
void arch_reset(char mode)
|
||||
{
|
||||
if (cpu_is_pxa2xx())
|
||||
RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
|
||||
|
||||
switch (mode) {
|
||||
case 's':
|
||||
/* Jump into ROM at address 0 */
|
||||
cpu_reset(0);
|
||||
break;
|
||||
case 'h':
|
||||
do_hw_reset();
|
||||
break;
|
||||
case 'g':
|
||||
do_gpio_reset();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
84
arch/arm/mach-pxa/saar.c
Normal file
84
arch/arm/mach-pxa/saar.c
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-pxa/saar.c
|
||||
*
|
||||
* Support for the Marvell PXA930 Handheld Platform (aka SAAR)
|
||||
*
|
||||
* Copyright (C) 2007-2008 Marvell International Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* publishhed by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/pxa3xx-regs.h>
|
||||
#include <asm/arch/mfp-pxa930.h>
|
||||
|
||||
#include "devices.h"
|
||||
#include "generic.h"
|
||||
|
||||
/* SAAR MFP configurations */
|
||||
static mfp_cfg_t saar_mfp_cfg[] __initdata = {
|
||||
/* Ethernet */
|
||||
DF_nCS1_nCS3,
|
||||
GPIO97_GPIO,
|
||||
};
|
||||
|
||||
#define SAAR_ETH_PHYS (0x14000000)
|
||||
|
||||
static struct resource smc91x_resources[] = {
|
||||
[0] = {
|
||||
.start = (SAAR_ETH_PHYS + 0x300),
|
||||
.end = (SAAR_ETH_PHYS + 0xfffff),
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
|
||||
.end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
|
||||
}
|
||||
};
|
||||
|
||||
static struct smc91x_platdata saar_smc91x_info = {
|
||||
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_USE_DMA,
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &saar_smc91x_info,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init saar_init(void)
|
||||
{
|
||||
/* initialize MFP configurations */
|
||||
pxa3xx_mfp_config(ARRAY_AND_SIZE(saar_mfp_cfg));
|
||||
|
||||
platform_device_register(&smc91x_device);
|
||||
}
|
||||
|
||||
MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
|
||||
/* Maintainer: Eric Miao <eric.miao@marvell.com> */
|
||||
.phys_io = 0x40000000,
|
||||
.boot_params = 0xa0000100,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa3xx_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = saar_init,
|
||||
MACHINE_END
|
|
@ -38,6 +38,7 @@
|
|||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-regs.h>
|
||||
#include <asm/arch/pxa2xx-gpio.h>
|
||||
#include <asm/arch/pxa27x-udc.h>
|
||||
#include <asm/arch/irda.h>
|
||||
#include <asm/arch/mmc.h>
|
||||
#include <asm/arch/ohci.h>
|
||||
|
@ -450,6 +451,7 @@ static void spitz_irda_transceiver_mode(struct device *dev, int mode)
|
|||
set_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
|
||||
else
|
||||
reset_scoop_gpio(&spitzscoop2_device.dev, SPITZ_SCP2_IR_ON);
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MACH_AKITA
|
||||
|
@ -459,6 +461,7 @@ static void akita_irda_transceiver_mode(struct device *dev, int mode)
|
|||
akita_set_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
|
||||
else
|
||||
akita_reset_ioexp(&akitaioexp_device.dev, AKITA_IOEXP_IR_ON);
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -529,11 +532,7 @@ static struct platform_device *devices[] __initdata = {
|
|||
|
||||
static void spitz_poweroff(void)
|
||||
{
|
||||
pxa_gpio_mode(SPITZ_GPIO_ON_RESET | GPIO_OUT);
|
||||
GPSR(SPITZ_GPIO_ON_RESET) = GPIO_bit(SPITZ_GPIO_ON_RESET);
|
||||
|
||||
mdelay(1000);
|
||||
arm_machine_restart('h');
|
||||
arm_machine_restart('g');
|
||||
}
|
||||
|
||||
static void spitz_restart(char mode)
|
||||
|
@ -547,6 +546,7 @@ static void spitz_restart(char mode)
|
|||
|
||||
static void __init common_init(void)
|
||||
{
|
||||
init_gpio_reset(SPITZ_GPIO_ON_RESET);
|
||||
pm_power_off = spitz_poweroff;
|
||||
arm_pm_restart = spitz_restart;
|
||||
|
||||
|
|
|
@ -14,13 +14,6 @@
|
|||
* IO-based SSP applications and allows easy port setup for DMA access.
|
||||
*
|
||||
* Author: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
|
||||
*
|
||||
* Revision history:
|
||||
* 22nd Aug 2003 Initial version.
|
||||
* 20th Dec 2004 Added ssp_config for changing port config without
|
||||
* closing the port.
|
||||
* 4th Aug 2005 Added option to disable irq handler registration and
|
||||
* cleaned up irq and clock detection.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
@ -285,7 +278,7 @@ int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags)
|
|||
goto out_region;
|
||||
dev->irq = ssp->irq;
|
||||
} else
|
||||
dev->irq = 0;
|
||||
dev->irq = NO_IRQ;
|
||||
|
||||
/* turn on SSP port clock */
|
||||
clk_enable(ssp->clk);
|
||||
|
@ -306,7 +299,8 @@ void ssp_exit(struct ssp_dev *dev)
|
|||
struct ssp_device *ssp = dev->ssp;
|
||||
|
||||
ssp_disable(dev);
|
||||
free_irq(dev->irq, dev);
|
||||
if (dev->irq != NO_IRQ)
|
||||
free_irq(dev->irq, dev);
|
||||
clk_disable(ssp->clk);
|
||||
ssp_free(ssp);
|
||||
}
|
||||
|
@ -360,6 +354,7 @@ static int __devinit ssp_probe(struct platform_device *pdev, int type)
|
|||
dev_err(&pdev->dev, "failed to allocate memory");
|
||||
return -ENOMEM;
|
||||
}
|
||||
ssp->pdev = pdev;
|
||||
|
||||
ssp->clk = clk_get(&pdev->dev, "SSPCLK");
|
||||
if (IS_ERR(ssp->clk)) {
|
||||
|
|
84
arch/arm/mach-pxa/tavorevb.c
Normal file
84
arch/arm/mach-pxa/tavorevb.c
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-pxa/tavorevb.c
|
||||
*
|
||||
* Support for the Marvell PXA930 Evaluation Board
|
||||
*
|
||||
* Copyright (C) 2007-2008 Marvell International Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* publishhed by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/smc91x.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/arch/pxa3xx-regs.h>
|
||||
#include <asm/arch/mfp-pxa930.h>
|
||||
|
||||
#include "devices.h"
|
||||
#include "generic.h"
|
||||
|
||||
/* Tavor EVB MFP configurations */
|
||||
static mfp_cfg_t tavorevb_mfp_cfg[] __initdata = {
|
||||
/* Ethernet */
|
||||
DF_nCS1_nCS3,
|
||||
GPIO47_GPIO,
|
||||
};
|
||||
|
||||
#define TAVOREVB_ETH_PHYS (0x14000000)
|
||||
|
||||
static struct resource smc91x_resources[] = {
|
||||
[0] = {
|
||||
.start = (TAVOREVB_ETH_PHYS + 0x300),
|
||||
.end = (TAVOREVB_ETH_PHYS + 0xfffff),
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
[1] = {
|
||||
.start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
|
||||
.end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
|
||||
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
|
||||
}
|
||||
};
|
||||
|
||||
static struct smc91x_platdata tavorevb_smc91x_info = {
|
||||
.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_USE_DMA,
|
||||
};
|
||||
|
||||
static struct platform_device smc91x_device = {
|
||||
.name = "smc91x",
|
||||
.id = 0,
|
||||
.num_resources = ARRAY_SIZE(smc91x_resources),
|
||||
.resource = smc91x_resources,
|
||||
.dev = {
|
||||
.platform_data = &tavorevb_smc91x_info,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init tavorevb_init(void)
|
||||
{
|
||||
/* initialize MFP configurations */
|
||||
pxa3xx_mfp_config(ARRAY_AND_SIZE(tavorevb_mfp_cfg));
|
||||
|
||||
platform_device_register(&smc91x_device);
|
||||
}
|
||||
|
||||
MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
|
||||
/* Maintainer: Eric Miao <eric.miao@marvell.com> */
|
||||
.phys_io = 0x40000000,
|
||||
.boot_params = 0xa0000100,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.map_io = pxa_map_io,
|
||||
.init_irq = pxa3xx_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = tavorevb_init,
|
||||
MACHINE_END
|
150
arch/arm/mach-pxa/tosa-bt.c
Normal file
150
arch/arm/mach-pxa/tosa-bt.c
Normal file
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* Bluetooth built-in chip control
|
||||
*
|
||||
* Copyright (c) 2008 Dmitry Baryshkov
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/rfkill.h>
|
||||
|
||||
#include <asm/arch/tosa_bt.h>
|
||||
|
||||
static void tosa_bt_on(struct tosa_bt_data *data)
|
||||
{
|
||||
gpio_set_value(data->gpio_reset, 0);
|
||||
gpio_set_value(data->gpio_pwr, 1);
|
||||
gpio_set_value(data->gpio_reset, 1);
|
||||
mdelay(20);
|
||||
gpio_set_value(data->gpio_reset, 0);
|
||||
}
|
||||
|
||||
static void tosa_bt_off(struct tosa_bt_data *data)
|
||||
{
|
||||
gpio_set_value(data->gpio_reset, 1);
|
||||
mdelay(10);
|
||||
gpio_set_value(data->gpio_pwr, 0);
|
||||
gpio_set_value(data->gpio_reset, 0);
|
||||
}
|
||||
|
||||
static int tosa_bt_toggle_radio(void *data, enum rfkill_state state)
|
||||
{
|
||||
pr_info("BT_RADIO going: %s\n",
|
||||
state == RFKILL_STATE_ON ? "on" : "off");
|
||||
|
||||
if (state == RFKILL_STATE_ON) {
|
||||
pr_info("TOSA_BT: going ON\n");
|
||||
tosa_bt_on(data);
|
||||
} else {
|
||||
pr_info("TOSA_BT: going OFF\n");
|
||||
tosa_bt_off(data);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tosa_bt_probe(struct platform_device *dev)
|
||||
{
|
||||
int rc;
|
||||
struct rfkill *rfk;
|
||||
|
||||
struct tosa_bt_data *data = dev->dev.platform_data;
|
||||
|
||||
rc = gpio_request(data->gpio_reset, "Bluetooth reset");
|
||||
if (rc)
|
||||
goto err_reset;
|
||||
rc = gpio_direction_output(data->gpio_reset, 0);
|
||||
if (rc)
|
||||
goto err_reset_dir;
|
||||
rc = gpio_request(data->gpio_pwr, "Bluetooth power");
|
||||
if (rc)
|
||||
goto err_pwr;
|
||||
rc = gpio_direction_output(data->gpio_pwr, 0);
|
||||
if (rc)
|
||||
goto err_pwr_dir;
|
||||
|
||||
rfk = rfkill_allocate(&dev->dev, RFKILL_TYPE_BLUETOOTH);
|
||||
if (!rfk) {
|
||||
rc = -ENOMEM;
|
||||
goto err_rfk_alloc;
|
||||
}
|
||||
|
||||
rfk->name = "tosa-bt";
|
||||
rfk->toggle_radio = tosa_bt_toggle_radio;
|
||||
rfk->data = data;
|
||||
#ifdef CONFIG_RFKILL_LEDS
|
||||
rfk->led_trigger.name = "tosa-bt";
|
||||
#endif
|
||||
|
||||
rc = rfkill_register(rfk);
|
||||
if (rc)
|
||||
goto err_rfkill;
|
||||
|
||||
platform_set_drvdata(dev, rfk);
|
||||
|
||||
return 0;
|
||||
|
||||
err_rfkill:
|
||||
if (rfk)
|
||||
rfkill_free(rfk);
|
||||
rfk = NULL;
|
||||
err_rfk_alloc:
|
||||
tosa_bt_off(data);
|
||||
err_pwr_dir:
|
||||
gpio_free(data->gpio_pwr);
|
||||
err_pwr:
|
||||
err_reset_dir:
|
||||
gpio_free(data->gpio_reset);
|
||||
err_reset:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int __devexit tosa_bt_remove(struct platform_device *dev)
|
||||
{
|
||||
struct tosa_bt_data *data = dev->dev.platform_data;
|
||||
struct rfkill *rfk = platform_get_drvdata(dev);
|
||||
|
||||
platform_set_drvdata(dev, NULL);
|
||||
|
||||
if (rfk)
|
||||
rfkill_unregister(rfk);
|
||||
rfk = NULL;
|
||||
|
||||
tosa_bt_off(data);
|
||||
|
||||
gpio_free(data->gpio_pwr);
|
||||
gpio_free(data->gpio_reset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver tosa_bt_driver = {
|
||||
.probe = tosa_bt_probe,
|
||||
.remove = __devexit_p(tosa_bt_remove),
|
||||
|
||||
.driver = {
|
||||
.name = "tosa-bt",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static int __init tosa_bt_init(void)
|
||||
{
|
||||
return platform_driver_register(&tosa_bt_driver);
|
||||
}
|
||||
|
||||
static void __exit tosa_bt_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&tosa_bt_driver);
|
||||
}
|
||||
|
||||
module_init(tosa_bt_init);
|
||||
module_exit(tosa_bt_exit);
|
|
@ -18,30 +18,31 @@
|
|||
#include <linux/major.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/mmc/host.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/mmc/host.h>
|
||||
#include <linux/mfd/tc6393xb.h>
|
||||
#include <linux/mfd/tmio.h>
|
||||
#include <linux/mtd/nand.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/pda_power.h>
|
||||
#include <linux/rfkill.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/memory.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/arch/pxa-regs.h>
|
||||
#include <asm/arch/pxa2xx-regs.h>
|
||||
#include <asm/arch/mfp-pxa25x.h>
|
||||
#include <asm/arch/irda.h>
|
||||
#include <asm/arch/i2c.h>
|
||||
#include <asm/arch/mmc.h>
|
||||
#include <asm/arch/udc.h>
|
||||
#include <asm/arch/tosa_bt.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/irq.h>
|
||||
#include <asm/arch/tosa.h>
|
||||
|
||||
#include <asm/hardware/scoop.h>
|
||||
|
@ -86,7 +87,7 @@ static unsigned long tosa_pin_config[] = {
|
|||
GPIO6_MMC_CLK,
|
||||
GPIO8_MMC_CS0,
|
||||
GPIO9_GPIO, /* Detect */
|
||||
// GPIO10 nSD_INT
|
||||
GPIO10_GPIO, /* nSD_INT */
|
||||
|
||||
/* CF */
|
||||
GPIO13_GPIO, /* CD_IRQ */
|
||||
|
@ -124,34 +125,34 @@ static unsigned long tosa_pin_config[] = {
|
|||
GPIO44_BTUART_CTS,
|
||||
GPIO45_BTUART_RTS,
|
||||
|
||||
/* IrDA */
|
||||
GPIO46_STUART_RXD,
|
||||
GPIO47_STUART_TXD,
|
||||
|
||||
/* Keybd */
|
||||
GPIO58_GPIO,
|
||||
GPIO59_GPIO,
|
||||
GPIO60_GPIO,
|
||||
GPIO61_GPIO,
|
||||
GPIO62_GPIO,
|
||||
GPIO63_GPIO,
|
||||
GPIO64_GPIO,
|
||||
GPIO65_GPIO,
|
||||
GPIO66_GPIO,
|
||||
GPIO67_GPIO,
|
||||
GPIO68_GPIO,
|
||||
GPIO69_GPIO,
|
||||
GPIO70_GPIO,
|
||||
GPIO71_GPIO,
|
||||
GPIO72_GPIO,
|
||||
GPIO73_GPIO,
|
||||
GPIO74_GPIO,
|
||||
GPIO75_GPIO,
|
||||
GPIO58_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO59_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO60_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO61_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO62_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO63_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO64_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO65_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO66_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO67_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO68_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO69_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO70_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO71_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO72_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO73_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO74_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
GPIO75_GPIO | MFP_LPM_DRIVE_LOW,
|
||||
|
||||
/* SPI */
|
||||
GPIO81_SSP2_CLK_OUT,
|
||||
GPIO82_SSP2_FRM_OUT,
|
||||
GPIO83_SSP2_TXD,
|
||||
|
||||
/* IrDA is managed in other way */
|
||||
GPIO46_GPIO,
|
||||
GPIO47_GPIO,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -249,6 +250,15 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
|
|||
|
||||
tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
|
||||
|
||||
err = gpio_request(TOSA_GPIO_nSD_DETECT, "MMC/SD card detect");
|
||||
if (err) {
|
||||
printk(KERN_ERR "tosa_mci_init: can't request nSD_DETECT gpio\n");
|
||||
goto err_gpio_detect;
|
||||
}
|
||||
err = gpio_direction_input(TOSA_GPIO_nSD_DETECT);
|
||||
if (err)
|
||||
goto err_gpio_detect_dir;
|
||||
|
||||
err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int,
|
||||
IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
|
||||
"MMC/SD card detect", data);
|
||||
|
@ -257,7 +267,7 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
|
|||
goto err_irq;
|
||||
}
|
||||
|
||||
err = gpio_request(TOSA_GPIO_SD_WP, "sd_wp");
|
||||
err = gpio_request(TOSA_GPIO_SD_WP, "SD Write Protect");
|
||||
if (err) {
|
||||
printk(KERN_ERR "tosa_mci_init: can't request SD_WP gpio\n");
|
||||
goto err_gpio_wp;
|
||||
|
@ -266,7 +276,7 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
|
|||
if (err)
|
||||
goto err_gpio_wp_dir;
|
||||
|
||||
err = gpio_request(TOSA_GPIO_PWR_ON, "sd_pwr");
|
||||
err = gpio_request(TOSA_GPIO_PWR_ON, "SD Power");
|
||||
if (err) {
|
||||
printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
|
||||
goto err_gpio_pwr;
|
||||
|
@ -275,8 +285,20 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
|
|||
if (err)
|
||||
goto err_gpio_pwr_dir;
|
||||
|
||||
err = gpio_request(TOSA_GPIO_nSD_INT, "SD Int");
|
||||
if (err) {
|
||||
printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
|
||||
goto err_gpio_int;
|
||||
}
|
||||
err = gpio_direction_input(TOSA_GPIO_nSD_INT);
|
||||
if (err)
|
||||
goto err_gpio_int_dir;
|
||||
|
||||
return 0;
|
||||
|
||||
err_gpio_int_dir:
|
||||
gpio_free(TOSA_GPIO_nSD_INT);
|
||||
err_gpio_int:
|
||||
err_gpio_pwr_dir:
|
||||
gpio_free(TOSA_GPIO_PWR_ON);
|
||||
err_gpio_pwr:
|
||||
|
@ -285,6 +307,9 @@ err_gpio_wp_dir:
|
|||
err_gpio_wp:
|
||||
free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
|
||||
err_irq:
|
||||
err_gpio_detect_dir:
|
||||
gpio_free(TOSA_GPIO_nSD_DETECT);
|
||||
err_gpio_detect:
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -306,9 +331,11 @@ static int tosa_mci_get_ro(struct device *dev)
|
|||
|
||||
static void tosa_mci_exit(struct device *dev, void *data)
|
||||
{
|
||||
gpio_free(TOSA_GPIO_nSD_INT);
|
||||
gpio_free(TOSA_GPIO_PWR_ON);
|
||||
gpio_free(TOSA_GPIO_SD_WP);
|
||||
free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
|
||||
gpio_free(TOSA_GPIO_nSD_DETECT);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data tosa_mci_platform_data = {
|
||||
|
@ -322,29 +349,55 @@ static struct pxamci_platform_data tosa_mci_platform_data = {
|
|||
/*
|
||||
* Irda
|
||||
*/
|
||||
static void tosa_irda_transceiver_mode(struct device *dev, int mode)
|
||||
{
|
||||
if (mode & IR_OFF) {
|
||||
gpio_set_value(TOSA_GPIO_IR_POWERDWN, 0);
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
gpio_direction_output(TOSA_GPIO_IRDA_TX, 0);
|
||||
} else {
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
gpio_set_value(TOSA_GPIO_IR_POWERDWN, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static int tosa_irda_startup(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gpio_request(TOSA_GPIO_IRDA_TX, "IrDA TX");
|
||||
if (ret)
|
||||
goto err_tx;
|
||||
ret = gpio_direction_output(TOSA_GPIO_IRDA_TX, 0);
|
||||
if (ret)
|
||||
goto err_tx_dir;
|
||||
|
||||
ret = gpio_request(TOSA_GPIO_IR_POWERDWN, "IrDA powerdown");
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_pwr;
|
||||
|
||||
ret = gpio_direction_output(TOSA_GPIO_IR_POWERDWN, 0);
|
||||
if (ret)
|
||||
gpio_free(TOSA_GPIO_IR_POWERDWN);
|
||||
goto err_pwr_dir;
|
||||
|
||||
tosa_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
|
||||
|
||||
return 0;
|
||||
|
||||
err_pwr_dir:
|
||||
gpio_free(TOSA_GPIO_IR_POWERDWN);
|
||||
err_pwr:
|
||||
err_tx_dir:
|
||||
gpio_free(TOSA_GPIO_IRDA_TX);
|
||||
err_tx:
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
static void tosa_irda_shutdown(struct device *dev)
|
||||
{
|
||||
tosa_irda_transceiver_mode(dev, IR_SIRMODE | IR_OFF);
|
||||
gpio_free(TOSA_GPIO_IR_POWERDWN);
|
||||
}
|
||||
|
||||
static void tosa_irda_transceiver_mode(struct device *dev, int mode)
|
||||
{
|
||||
gpio_set_value(TOSA_GPIO_IR_POWERDWN, !(mode & IR_OFF));
|
||||
gpio_free(TOSA_GPIO_IRDA_TX);
|
||||
}
|
||||
|
||||
static struct pxaficp_platform_data tosa_ficp_platform_data = {
|
||||
|
@ -354,6 +407,70 @@ static struct pxaficp_platform_data tosa_ficp_platform_data = {
|
|||
.shutdown = tosa_irda_shutdown,
|
||||
};
|
||||
|
||||
/*
|
||||
* Tosa AC IN
|
||||
*/
|
||||
static int tosa_power_init(struct device *dev)
|
||||
{
|
||||
int ret = gpio_request(TOSA_GPIO_AC_IN, "ac in");
|
||||
if (ret)
|
||||
goto err_gpio_req;
|
||||
|
||||
ret = gpio_direction_input(TOSA_GPIO_AC_IN);
|
||||
if (ret)
|
||||
goto err_gpio_in;
|
||||
|
||||
return 0;
|
||||
|
||||
err_gpio_in:
|
||||
gpio_free(TOSA_GPIO_AC_IN);
|
||||
err_gpio_req:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void tosa_power_exit(struct device *dev)
|
||||
{
|
||||
gpio_free(TOSA_GPIO_AC_IN);
|
||||
}
|
||||
|
||||
static int tosa_power_ac_online(void)
|
||||
{
|
||||
return gpio_get_value(TOSA_GPIO_AC_IN) == 0;
|
||||
}
|
||||
|
||||
static char *tosa_ac_supplied_to[] = {
|
||||
"main-battery",
|
||||
"backup-battery",
|
||||
"jacket-battery",
|
||||
};
|
||||
|
||||
static struct pda_power_pdata tosa_power_data = {
|
||||
.init = tosa_power_init,
|
||||
.is_ac_online = tosa_power_ac_online,
|
||||
.exit = tosa_power_exit,
|
||||
.supplied_to = tosa_ac_supplied_to,
|
||||
.num_supplicants = ARRAY_SIZE(tosa_ac_supplied_to),
|
||||
};
|
||||
|
||||
static struct resource tosa_power_resource[] = {
|
||||
{
|
||||
.name = "ac",
|
||||
.start = gpio_to_irq(TOSA_GPIO_AC_IN),
|
||||
.end = gpio_to_irq(TOSA_GPIO_AC_IN),
|
||||
.flags = IORESOURCE_IRQ |
|
||||
IORESOURCE_IRQ_HIGHEDGE |
|
||||
IORESOURCE_IRQ_LOWEDGE,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device tosa_power_device = {
|
||||
.name = "pda-power",
|
||||
.id = -1,
|
||||
.dev.platform_data = &tosa_power_data,
|
||||
.resource = tosa_power_resource,
|
||||
.num_resources = ARRAY_SIZE(tosa_power_resource),
|
||||
};
|
||||
|
||||
/*
|
||||
* Tosa Keyboard
|
||||
*/
|
||||
|
@ -439,7 +556,7 @@ static struct gpio_led tosa_gpio_leds[] = {
|
|||
},
|
||||
{
|
||||
.name = "tosa:blue:bluetooth",
|
||||
.default_trigger = "none",
|
||||
.default_trigger = "tosa-bt",
|
||||
.gpio = TOSA_GPIO_BT_LED,
|
||||
},
|
||||
};
|
||||
|
@ -457,21 +574,184 @@ static struct platform_device tosaled_device = {
|
|||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* Toshiba Mobile IO Controller
|
||||
*/
|
||||
static struct resource tc6393xb_resources[] = {
|
||||
[0] = {
|
||||
.start = TOSA_LCDC_PHYS,
|
||||
.end = TOSA_LCDC_PHYS + 0x3ffffff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
|
||||
[1] = {
|
||||
.start = TOSA_IRQ_GPIO_TC6393XB_INT,
|
||||
.end = TOSA_IRQ_GPIO_TC6393XB_INT,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
static int tosa_tc6393xb_enable(struct platform_device *dev)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = gpio_request(TOSA_GPIO_TC6393XB_REST_IN, "tc6393xb #pclr");
|
||||
if (rc)
|
||||
goto err_req_pclr;
|
||||
rc = gpio_request(TOSA_GPIO_TC6393XB_SUSPEND, "tc6393xb #suspend");
|
||||
if (rc)
|
||||
goto err_req_suspend;
|
||||
rc = gpio_request(TOSA_GPIO_TC6393XB_L3V_ON, "l3v");
|
||||
if (rc)
|
||||
goto err_req_l3v;
|
||||
rc = gpio_direction_output(TOSA_GPIO_TC6393XB_L3V_ON, 0);
|
||||
if (rc)
|
||||
goto err_dir_l3v;
|
||||
rc = gpio_direction_output(TOSA_GPIO_TC6393XB_SUSPEND, 0);
|
||||
if (rc)
|
||||
goto err_dir_suspend;
|
||||
rc = gpio_direction_output(TOSA_GPIO_TC6393XB_REST_IN, 0);
|
||||
if (rc)
|
||||
goto err_dir_pclr;
|
||||
|
||||
mdelay(1);
|
||||
|
||||
gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 1);
|
||||
|
||||
mdelay(10);
|
||||
|
||||
gpio_set_value(TOSA_GPIO_TC6393XB_REST_IN, 1);
|
||||
gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 1);
|
||||
|
||||
return 0;
|
||||
err_dir_pclr:
|
||||
err_dir_suspend:
|
||||
err_dir_l3v:
|
||||
gpio_free(TOSA_GPIO_TC6393XB_L3V_ON);
|
||||
err_req_l3v:
|
||||
gpio_free(TOSA_GPIO_TC6393XB_SUSPEND);
|
||||
err_req_suspend:
|
||||
gpio_free(TOSA_GPIO_TC6393XB_REST_IN);
|
||||
err_req_pclr:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int tosa_tc6393xb_disable(struct platform_device *dev)
|
||||
{
|
||||
gpio_free(TOSA_GPIO_TC6393XB_L3V_ON);
|
||||
gpio_free(TOSA_GPIO_TC6393XB_SUSPEND);
|
||||
gpio_free(TOSA_GPIO_TC6393XB_REST_IN);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tosa_tc6393xb_resume(struct platform_device *dev)
|
||||
{
|
||||
gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 1);
|
||||
mdelay(10);
|
||||
gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 1);
|
||||
mdelay(10);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tosa_tc6393xb_suspend(struct platform_device *dev)
|
||||
{
|
||||
gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON, 0);
|
||||
gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct mtd_partition tosa_nand_partition[] = {
|
||||
{
|
||||
.name = "smf",
|
||||
.offset = 0,
|
||||
.size = 7 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "root",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = 28 * 1024 * 1024,
|
||||
},
|
||||
{
|
||||
.name = "home",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
|
||||
|
||||
static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = {
|
||||
.options = 0,
|
||||
.offs = 4,
|
||||
.len = 2,
|
||||
.pattern = scan_ff_pattern
|
||||
};
|
||||
|
||||
static struct tmio_nand_data tosa_tc6393xb_nand_config = {
|
||||
.num_partitions = ARRAY_SIZE(tosa_nand_partition),
|
||||
.partition = tosa_nand_partition,
|
||||
.badblock_pattern = &tosa_tc6393xb_nand_bbt,
|
||||
};
|
||||
|
||||
static struct tc6393xb_platform_data tosa_tc6393xb_setup = {
|
||||
.scr_pll2cr = 0x0cc1,
|
||||
.scr_gper = 0x3300,
|
||||
.scr_gpo_dsr =
|
||||
TOSA_TC6393XB_GPIO_BIT(TOSA_GPIO_CARD_VCC_ON),
|
||||
.scr_gpo_doecr =
|
||||
TOSA_TC6393XB_GPIO_BIT(TOSA_GPIO_CARD_VCC_ON),
|
||||
|
||||
.irq_base = IRQ_BOARD_START,
|
||||
.gpio_base = TOSA_TC6393XB_GPIO_BASE,
|
||||
|
||||
.enable = tosa_tc6393xb_enable,
|
||||
.disable = tosa_tc6393xb_disable,
|
||||
.suspend = tosa_tc6393xb_suspend,
|
||||
.resume = tosa_tc6393xb_resume,
|
||||
|
||||
.nand_data = &tosa_tc6393xb_nand_config,
|
||||
};
|
||||
|
||||
|
||||
static struct platform_device tc6393xb_device = {
|
||||
.name = "tc6393xb",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &tosa_tc6393xb_setup,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(tc6393xb_resources),
|
||||
.resource = tc6393xb_resources,
|
||||
};
|
||||
|
||||
static struct tosa_bt_data tosa_bt_data = {
|
||||
.gpio_pwr = TOSA_GPIO_BT_PWR_EN,
|
||||
.gpio_reset = TOSA_GPIO_BT_RESET,
|
||||
};
|
||||
|
||||
static struct platform_device tosa_bt_device = {
|
||||
.name = "tosa-bt",
|
||||
.id = -1,
|
||||
.dev.platform_data = &tosa_bt_data,
|
||||
};
|
||||
|
||||
|
||||
static struct platform_device *devices[] __initdata = {
|
||||
&tosascoop_device,
|
||||
&tosascoop_jc_device,
|
||||
&tc6393xb_device,
|
||||
&tosa_power_device,
|
||||
&tosakbd_device,
|
||||
&tosa_gpio_keys_device,
|
||||
&tosaled_device,
|
||||
&tosa_bt_device,
|
||||
};
|
||||
|
||||
static void tosa_poweroff(void)
|
||||
{
|
||||
gpio_direction_output(TOSA_GPIO_ON_RESET, 0);
|
||||
gpio_set_value(TOSA_GPIO_ON_RESET, 1);
|
||||
|
||||
mdelay(1000);
|
||||
arm_machine_restart('h');
|
||||
arm_machine_restart('g');
|
||||
}
|
||||
|
||||
static void tosa_restart(char mode)
|
||||
|
@ -485,10 +765,14 @@ static void tosa_restart(char mode)
|
|||
|
||||
static void __init tosa_init(void)
|
||||
{
|
||||
int dummy;
|
||||
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
|
||||
gpio_set_wake(MFP_PIN_GPIO1, 1);
|
||||
/* We can't pass to gpio-keys since it will drop the Reset altfunc */
|
||||
|
||||
init_gpio_reset(TOSA_GPIO_ON_RESET);
|
||||
|
||||
pm_power_off = tosa_poweroff;
|
||||
arm_pm_restart = tosa_restart;
|
||||
|
||||
|
@ -497,6 +781,10 @@ static void __init tosa_init(void)
|
|||
/* enable batt_fault */
|
||||
PMCR = 0x01;
|
||||
|
||||
dummy = gpiochip_reserve(TOSA_SCOOP_GPIO_BASE, 12);
|
||||
dummy = gpiochip_reserve(TOSA_SCOOP_JC_GPIO_BASE, 12);
|
||||
dummy = gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE, 16);
|
||||
|
||||
pxa_set_mci_info(&tosa_mci_platform_data);
|
||||
pxa_set_udc_info(&udc_info);
|
||||
pxa_set_ficp_info(&tosa_ficp_platform_data);
|
||||
|
|
|
@ -254,6 +254,7 @@ static void board_irda_mode(struct device *dev, int mode)
|
|||
/* Fast mode */
|
||||
trizeps_conxs_ircr |= ConXS_IRCR_MODE;
|
||||
}
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
if (mode & IR_OFF) {
|
||||
trizeps_conxs_ircr |= ConXS_IRCR_SD;
|
||||
} else {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue