[ARM] Add ability to dump exception stacks to kernel backtraces

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ab3f8d595a1b1e5cf8d726b72fd476fe0d0226c
Commit: 7ab3f8d595a1b1e5cf8d726b72fd476fe0d0226c
Parent: 46fcc86dd71d70211e965102fb69414c90381880
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Fri Mar 2 15:01:36 2007 +
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:34:34 2007 +0100

[ARM] Add ability to dump exception stacks to kernel backtraces

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/irq.c |2 +-
 arch/arm/kernel/traps.c   |   18 -
 arch/arm/kernel/vmlinux.lds.S |3 +
 arch/arm/lib/backtrace.S  |  165 -
 arch/arm/mm/fault.c   |4 +-
 include/asm-arm/system.h  |2 +
 6 files changed, 105 insertions(+), 89 deletions(-)

diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index e101846..a72b82e 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -109,7 +109,7 @@ static struct irq_desc bad_irq_desc = {
  * come via this function.  Instead, they should provide their
  * own 'handler'
  */
-asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
+asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
struct pt_regs *old_regs = set_irq_regs(regs);
struct irq_desc *desc = irq_desc + irq;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 2409560..ba1c188 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -45,7 +45,18 @@ static int __init user_debug_setup(char *str)
 __setup("user_debug=", user_debug_setup);
 #endif
 
-void dump_backtrace_entry(unsigned long where, unsigned long from)
+static void dump_mem(const char *str, unsigned long bottom, unsigned long top);
+
+static inline int in_exception_text(unsigned long ptr)
+{
+   extern char __exception_text_start[];
+   extern char __exception_text_end[];
+
+   return ptr >= (unsigned long)&__exception_text_start &&
+  ptr < (unsigned long)&__exception_text_end;
+}
+
+void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned 
long frame)
 {
 #ifdef CONFIG_KALLSYMS
printk("[<%08lx>] ", where);
@@ -55,6 +66,9 @@ void dump_backtrace_entry(unsigned long where, unsigned long 
from)
 #else
printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
 #endif
+
+   if (in_exception_text(where))
+   dump_mem("Exception stack", frame + 4, frame + 4 + 
sizeof(struct pt_regs));
 }
 
 /*
@@ -266,7 +280,7 @@ void unregister_undef_hook(struct undef_hook *hook)
spin_unlock_irqrestore(&undef_lock, flags);
 }
 
-asmlinkage void do_undefinstr(struct pt_regs *regs)
+asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
 {
unsigned int correction = thumb_mode(regs) ? 2 : 4;
unsigned int instr;
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index ddbdad4..b295f6a 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -83,6 +83,9 @@ SECTIONS
 
.text : {   /* Real text segment*/
_text = .;  /* Text and read-only data  */
+   __exception_text_start = .;
+   *(.exception.text)
+   __exception_text_end = .;
*(.text)
SCHED_TEXT
LOCK_TEXT
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S
index 7423008..84dc890 100644
--- a/arch/arm/lib/backtrace.S
+++ b/arch/arm/lib/backtrace.S
@@ -17,8 +17,8 @@
 @ fp is 0 or stack frame
 
 #define frame  r4
-#define next   r5
-#define save   r6
+#define sv_fp  r5
+#define sv_pc  r6
 #define mask   r7
 #define offset r8
 
@@ -31,108 +31,106 @@ ENTRY(c_backtrace)
 #if !defined(CONFIG_FRAME_POINTER) || !defined(CONFIG_PRINTK)
mov pc, lr
 #else
-
stmfd   sp!, {r4 - r8, lr}  @ Save an extra register so we 
have a location...
-   tst r1, #0x10   @ 26 or 32-bit?
-   moveq   mask, #0xfc03
-   movne   mask, #0
-   tst mask, r0
-   movne   r0, #0
-   movsframe, r0
-1: moveq   r0, #-2
-   ldmeqfd sp!, {r4 - r8, pc}
-
-2: stmfd   sp!, {pc}   @ calculate offset of PC in 
STMIA instruction
-   ldr r0, [sp], #4
-   adr r1, 2b - 4
+   movsframe, r0   @ if frame pointer is zero
+   beq no_frame@ we have no stack frames
+
+   tst r1, #0x10   @ 26 or 32-bit mode?
+   moveq   mask, #0xfc03   @ mask for 26-bit
+   movne   mask, #0@ mask for 32-bit
+
+1: stmfd   sp!, {pc} 

[ARM] EBSA110: Add readsw/readsl/writesw/writesl

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27350afdfc94a78adbdee20bb00f6058a0ef1eab
Commit: 27350afdfc94a78adbdee20bb00f6058a0ef1eab
Parent: 7ab3f8d595a1b1e5cf8d726b72fd476fe0d0226c
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Mar 3 11:51:31 2007 +
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:34:37 2007 +0100

[ARM] EBSA110: Add readsw/readsl/writesw/writesl

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-ebsa110/io.c|   40 +
 include/asm-arm/arch-ebsa110/io.h |8 +++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c
index db38afb..bbf0d33 100644
--- a/arch/arm/mach-ebsa110/io.c
+++ b/arch/arm/mach-ebsa110/io.c
@@ -102,6 +102,26 @@ EXPORT_SYMBOL(__readb);
 EXPORT_SYMBOL(__readw);
 EXPORT_SYMBOL(__readl);
 
+void readsw(void __iomem *addr, void *data, int len)
+{
+   void __iomem *a = __isamem_convert_addr(addr);
+
+   BUG_ON((unsigned long)addr & 1);
+
+   __raw_readsw(a, data, len);
+}
+EXPORT_SYMBOL(readsw);
+
+void readsl(void __iomem *addr, void *data, int len)
+{
+   void __iomem *a = __isamem_convert_addr(addr);
+
+   BUG_ON((unsigned long)addr & 3);
+
+   __raw_readsl(a, data, len);
+}
+EXPORT_SYMBOL(readsl);
+
 void __writeb(u8 val, void __iomem *addr)
 {
void __iomem *a = __isamem_convert_addr(addr);
@@ -137,6 +157,26 @@ EXPORT_SYMBOL(__writeb);
 EXPORT_SYMBOL(__writew);
 EXPORT_SYMBOL(__writel);
 
+void writesw(void __iomem *addr, void *data, int len)
+{
+   void __iomem *a = __isamem_convert_addr(addr);
+
+   BUG_ON((unsigned long)addr & 1);
+
+   __raw_writesw(a, data, len);
+}
+EXPORT_SYMBOL(writesw);
+
+void writesl(void __iomem *addr, void *data, int len)
+{
+   void __iomem *a = __isamem_convert_addr(addr);
+
+   BUG_ON((unsigned long)addr & 3);
+
+   __raw_writesl(a, data, len);
+}
+EXPORT_SYMBOL(writesl);
+
 #define SUPERIO_PORT(p) \
(((p) >> 3) == (0x3f8 >> 3) || \
 ((p) >> 3) == (0x2f8 >> 3) || \
diff --git a/include/asm-arm/arch-ebsa110/io.h 
b/include/asm-arm/arch-ebsa110/io.h
index 722c5e0..44a4001 100644
--- a/include/asm-arm/arch-ebsa110/io.h
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -81,4 +81,12 @@ extern void outsb(unsigned int port, const void *buf, int 
sz);
 extern void outsw(unsigned int port, const void *buf, int sz);
 extern void outsl(unsigned int port, const void *buf, int sz);
 
+/* can't support writesb atm */
+extern void writesw(void __iomem *addr, const void *data, int wordlen);
+extern void writesl(void __iomem *addr, const void *data, int longlen);
+
+/* can't support readsb atm */
+extern void readsw(const void __iomem *addr, void *data, int wordlen);
+extern void readsl(const void __iomem *addr, void *data, int longlen);
+
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Remove needless linux/ptrace.h includes

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f0a00beb80624a446ba7c0152cd171008eeab2e
Commit: 0f0a00beb80624a446ba7c0152cd171008eeab2e
Parent: 27350afdfc94a78adbdee20bb00f6058a0ef1eab
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Mar 3 19:45:25 2007 +
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:34:47 2007 +0100

[ARM] Remove needless linux/ptrace.h includes

Lots of places in arch/arm were needlessly including linux/ptrace.h,
resumably because we used to pass a struct pt_regs to interrupt
handlers.  Now that we don't, all these ptrace.h includes are
redundant.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/common/sa.c |1 -
 arch/arm/common/via82c505.c  |1 -
 arch/arm/kernel/irq.c|1 -
 arch/arm/kernel/process.c|1 -
 arch/arm/kernel/traps.c  |1 -
 arch/arm/mach-footbridge/dc21285.c   |1 -
 arch/arm/mach-integrator/pci.c   |1 -
 arch/arm/mach-integrator/pci_v3.c|1 -
 arch/arm/mach-lh7a40x/irq-lh7a400.c  |1 -
 arch/arm/mach-lh7a40x/irq-lh7a404.c  |1 -
 arch/arm/mach-lh7a40x/irq-lpd7a40x.c |1 -
 arch/arm/mach-omap1/irq.c|1 -
 arch/arm/mach-pxa/irq.c  |1 -
 arch/arm/mach-s3c2410/bast-irq.c |1 -
 arch/arm/mach-s3c2410/irq.c  |1 -
 arch/arm/mach-s3c2412/irq.c  |1 -
 arch/arm/mach-s3c2440/irq.c  |1 -
 arch/arm/mach-s3c2443/irq.c  |1 -
 arch/arm/mach-sa1100/irq.c   |1 -
 arch/arm/mach-sa1100/neponset.c  |1 -
 arch/arm/mach-shark/irq.c|1 -
 arch/arm/mach-versatile/pci.c|1 -
 arch/arm/mm/alignment.c  |1 -
 arch/arm/mm/fault.c  |1 -
 arch/arm/mm/init.c   |1 -
 arch/arm/plat-omap/gpio.c|1 -
 arch/arm/plat-s3c24xx/irq.c  |1 -
 arch/arm/plat-s3c24xx/s3c244x-irq.c  |1 -
 28 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/arch/arm/common/sa.c b/arch/arm/common/sa.c
index fe3f059..798bbfc 100644
--- a/arch/arm/common/sa.c
+++ b/arch/arm/common/sa.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/common/via82c505.c b/arch/arm/common/via82c505.c
index ba2e629..79a8206 100644
--- a/arch/arm/common/via82c505.c
+++ b/arch/arm/common/via82c505.c
@@ -1,6 +1,5 @@
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index a72b82e..11dcd52 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 782af3c..8afd83d 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index ba1c188..6055ab4 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/mach-footbridge/dc21285.c 
b/arch/arm/mach-footbridge/dc21285.c
index 1463330..d0dc51e 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -10,7 +10,6 @@
  */
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c
index 394ec92..af7d3ff 100644
--- a/arch/arm/mach-integrator/pci.c
+++ b/arch/arm/mach-integrator/pci.c
@@ -23,7 +23,6 @@
  */
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/arch/arm/mach-integrator/pci_v3.c 
b/arch/arm/mach-integrator/pci_v3.c
index fb8c6d9..af9ebcc 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -22,7 +22,6 @@
  */
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a400.c 
b/arch/arm/mach-lh7a40x/irq-lh7a400.c
index 0b938e8..9472bbe 100644
--- a/arch/arm/mach-lh7a40x/irq-lh7a400.c
+++ b/arch/arm/mach-lh7a40x/irq-lh7a400.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a404.c 
b/arch/arm/mach-lh7a40x/irq-lh7a404.c
index 5760f8c..9b28389 100644
--- a/arch/arm/mach-lh7a40x/irq-lh7a404.c
+++ b/arch/arm/mach-lh7a40x/irq-lh7a404.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c 
b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
index 15b9577..66e1ed3 100644
--- a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
@@ -12,7 +12,6 @

[ARM] ptrace: clean up single stepping support

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b2a0d36fde90fa9dd20b7dde21dbcff09b130b38
Commit: b2a0d36fde90fa9dd20b7dde21dbcff09b130b38
Parent: 0f0a00beb80624a446ba7c0152cd171008eeab2e
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 09:50:28 2007 +
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:34:58 2007 +0100

[ARM] ptrace: clean up single stepping support

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/ptrace.c |   15 ---
 arch/arm/kernel/ptrace.h |   39 +++
 arch/arm/kernel/signal.c |   22 +-
 3 files changed, 48 insertions(+), 28 deletions(-)

diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 9254ba2..e594b84 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -457,13 +457,10 @@ void ptrace_cancel_bpt(struct task_struct *child)
 
 /*
  * Called by kernel/ptrace.c when detaching..
- *
- * Make sure the single step bit is not set.
  */
 void ptrace_disable(struct task_struct *child)
 {
-   child->ptrace &= ~PT_SINGLESTEP;
-   ptrace_cancel_bpt(child);
+   single_step_disable(child);
 }
 
 /*
@@ -712,9 +709,7 @@ long arch_ptrace(struct task_struct *child, long request, 
long addr, long data)
else
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->exit_code = data;
-   /* make sure single-step breakpoint is gone. */
-   child->ptrace &= ~PT_SINGLESTEP;
-   ptrace_cancel_bpt(child);
+   single_step_disable(child);
wake_up_process(child);
ret = 0;
break;
@@ -725,9 +720,7 @@ long arch_ptrace(struct task_struct *child, long request, 
long addr, long data)
 * exit.
 */
case PTRACE_KILL:
-   /* make sure single-step breakpoint is gone. */
-   child->ptrace &= ~PT_SINGLESTEP;
-   ptrace_cancel_bpt(child);
+   single_step_disable(child);
if (child->exit_state != EXIT_ZOMBIE) {
child->exit_code = SIGKILL;
wake_up_process(child);
@@ -742,7 +735,7 @@ long arch_ptrace(struct task_struct *child, long request, 
long addr, long data)
ret = -EIO;
if (!valid_signal(data))
break;
-   child->ptrace |= PT_SINGLESTEP;
+   single_step_enable(child);
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->exit_code = data;
/* give it a chance to run. */
diff --git a/arch/arm/kernel/ptrace.h b/arch/arm/kernel/ptrace.h
index f7cad13..def3b61 100644
--- a/arch/arm/kernel/ptrace.h
+++ b/arch/arm/kernel/ptrace.h
@@ -7,6 +7,45 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include 
+
 extern void ptrace_cancel_bpt(struct task_struct *);
 extern void ptrace_set_bpt(struct task_struct *);
 extern void ptrace_break(struct task_struct *, struct pt_regs *);
+
+/*
+ * make sure single-step breakpoint is gone.
+ */
+static inline void single_step_disable(struct task_struct *task)
+{
+   task->ptrace &= ~PT_SINGLESTEP;
+   ptrace_cancel_bpt(task);
+}
+
+static inline void single_step_enable(struct task_struct *task)
+{
+   task->ptrace |= PT_SINGLESTEP;
+}
+
+/*
+ * Send SIGTRAP if we're single-stepping
+ */
+static inline void single_step_trap(struct task_struct *task)
+{
+   if (task->ptrace & PT_SINGLESTEP) {
+   ptrace_cancel_bpt(task);
+   send_sig(SIGTRAP, task, 1);
+   }
+}
+
+static inline void single_step_clear(struct task_struct *task)
+{
+   if (task->ptrace & PT_SINGLESTEP)
+   ptrace_cancel_bpt(task);
+}
+
+static inline void single_step_set(struct task_struct *task)
+{
+   if (task->ptrace & PT_SINGLESTEP)
+   ptrace_set_bpt(task);
+}
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 3843d3b..54cdf1a 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -9,7 +9,6 @@
  */
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -285,11 +284,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
if (restore_sigframe(regs, frame))
goto badframe;
 
-   /* Send SIGTRAP if we're single-stepping */
-   if (current->ptrace & PT_SINGLESTEP) {
-   ptrace_cancel_bpt(current);
-   send_sig(SIGTRAP, current, 1);
-   }
+   single_step_trap(current);
 
return regs->ARM_r0;
 
@@ -324,11 +319,7

[ARM] getuser.S and putuser.S don't need thread_info.h nor asm-offsets.h

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Commit: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Parent: b2a0d36fde90fa9dd20b7dde21dbcff09b130b38
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 20:44:59 2007 +
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:35:22 2007 +0100

[ARM] getuser.S and putuser.S don't need thread_info.h nor asm-offsets.h

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/lib/getuser.S |2 --
 arch/arm/lib/putuser.S |2 --
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S
index c03ea8e..1dd8ea4 100644
--- a/arch/arm/lib/getuser.S
+++ b/arch/arm/lib/getuser.S
@@ -26,8 +26,6 @@
  * Note that ADDR_LIMIT is either 0 or 0xc000.
  * Note also that it is intended that __get_user_bad is not global.
  */
-#include 
-#include 
 #include 
 
.global __get_user_1
diff --git a/arch/arm/lib/putuser.S b/arch/arm/lib/putuser.S
index 4593e9c..8620afe 100644
--- a/arch/arm/lib/putuser.S
+++ b/arch/arm/lib/putuser.S
@@ -26,8 +26,6 @@
  * Note that ADDR_LIMIT is either 0 or 0xc000
  * Note also that it is intended that __put_user_bad is not global.
  */
-#include 
-#include 
 #include 
 
.global __put_user_1
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] mm 1: Combine mem_type domain into prot_* at init time

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2497f0a8125e307cf1fd4222bab53f66305eba27
Commit: 2497f0a8125e307cf1fd4222bab53f66305eba27
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 21 09:59:44 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:35:44 2007 +0100

[ARM] mm 1: Combine mem_type domain into prot_* at init time

Rather than combining the domain for a particular memory type with
the protection information each time we want to use it, do so when
we fix up the mem_type array at initialisation time.

Rename struct mem_types to be mem_type - each structure is one
memory type description, not several.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/mmu.c |   16 
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 94fd4bf..6178be0 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -176,14 +176,14 @@ void adjust_cr(unsigned long mask, unsigned long set)
 }
 #endif
 
-struct mem_types {
+struct mem_type {
unsigned intprot_pte;
unsigned intprot_l1;
unsigned intprot_sect;
unsigned intdomain;
 };
 
-static struct mem_types mem_types[] __initdata = {
+static struct mem_type mem_types[] __initdata = {
[MT_DEVICE] = {
.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_WRITE,
@@ -368,6 +368,14 @@ static void __init build_mem_type_table(void)
}
printk("Memory policy: ECC %sabled, Data cache %s\n",
ecc_mask ? "en" : "dis", cp->policy);
+
+   for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
+   struct mem_type *t = &mem_types[i];
+   if (t->prot_l1)
+   t->prot_l1 |= PMD_DOMAIN(t->domain);
+   if (t->prot_sect)
+   t->prot_sect |= PMD_DOMAIN(t->domain);
+   }
 }
 
 #define vectors_base() (vectors_high() ? 0x : 0)
@@ -458,8 +466,8 @@ void __init create_mapping(struct map_desc *md)
 
domain= mem_types[md->type].domain;
prot_pte  = __pgprot(mem_types[md->type].prot_pte);
-   prot_l1   = mem_types[md->type].prot_l1 | PMD_DOMAIN(domain);
-   prot_sect = mem_types[md->type].prot_sect | PMD_DOMAIN(domain);
+   prot_l1   = mem_types[md->type].prot_l1;
+   prot_sect = mem_types[md->type].prot_sect;
 
/*
 * Catch 36-bit addresses
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] mm 2: clean up create_mapping()

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d5c98176ef34b8b78645646593c17e10f62f53ff
Commit: d5c98176ef34b8b78645646593c17e10f62f53ff
Parent: 2497f0a8125e307cf1fd4222bab53f66305eba27
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 21 10:05:32 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:35:48 2007 +0100

[ARM] mm 2: clean up create_mapping()

There's now no need to carry around each protection separately.
Instead, pass around the pointer to the entry in the mem_types
array which we're interested in.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/mmu.c |   30 +-
 1 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 6178be0..e359f36 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -420,7 +420,7 @@ alloc_init_supersection(unsigned long virt, unsigned long 
phys, int prot)
  * the hardware pte table.
  */
 static inline void
-alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, 
pgprot_t prot)
+alloc_init_page(unsigned long virt, unsigned long phys, const struct mem_type 
*type)
 {
pmd_t *pmdp = pmd_off_k(virt);
pte_t *ptep;
@@ -429,11 +429,11 @@ alloc_init_page(unsigned long virt, unsigned long phys, 
unsigned int prot_l1, pg
ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *
   sizeof(pte_t));
 
-   __pmd_populate(pmdp, __pa(ptep) | prot_l1);
+   __pmd_populate(pmdp, __pa(ptep) | type->prot_l1);
}
ptep = pte_offset_kernel(pmdp, virt);
 
-   set_pte_ext(ptep, pfn_pte(phys >> PAGE_SHIFT, prot), 0);
+   set_pte_ext(ptep, pfn_pte(phys >> PAGE_SHIFT, 
__pgprot(type->prot_pte)), 0);
 }
 
 /*
@@ -446,9 +446,8 @@ alloc_init_page(unsigned long virt, unsigned long phys, 
unsigned int prot_l1, pg
 void __init create_mapping(struct map_desc *md)
 {
unsigned long virt, length;
-   int prot_sect, prot_l1, domain;
-   pgprot_t prot_pte;
unsigned long off = (u32)__pfn_to_phys(md->pfn);
+   const struct mem_type *type;
 
if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
printk(KERN_WARNING "BUG: not creating mapping for "
@@ -464,16 +463,13 @@ void __init create_mapping(struct map_desc *md)
   __pfn_to_phys((u64)md->pfn), md->virtual);
}
 
-   domain= mem_types[md->type].domain;
-   prot_pte  = __pgprot(mem_types[md->type].prot_pte);
-   prot_l1   = mem_types[md->type].prot_l1;
-   prot_sect = mem_types[md->type].prot_sect;
+   type = &mem_types[md->type];
 
/*
 * Catch 36-bit addresses
 */
if(md->pfn >= 0x10) {
-   if(domain) {
+   if (type->domain) {
printk(KERN_ERR "MM: invalid domain in supersection "
"mapping for 0x%08llx at 0x%08lx\n",
__pfn_to_phys((u64)md->pfn), md->virtual);
@@ -498,7 +494,7 @@ void __init create_mapping(struct map_desc *md)
off   -= virt;
length = md->length;
 
-   if (mem_types[md->type].prot_l1 == 0 &&
+   if (type->prot_l1 == 0 &&
(virt & 0xf || (virt + off) & 0xf || (virt + length) & 
0xf)) {
printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not "
   "be mapped using pages, ignoring.\n",
@@ -507,7 +503,7 @@ void __init create_mapping(struct map_desc *md)
}
 
while ((virt & 0xf || (virt + off) & 0xf) && length >= 
PAGE_SIZE) {
-   alloc_init_page(virt, virt + off, prot_l1, prot_pte);
+   alloc_init_page(virt, virt + off, type);
 
virt   += PAGE_SIZE;
length -= PAGE_SIZE;
@@ -520,7 +516,7 @@ void __init create_mapping(struct map_desc *md)
 *  of the actual domain assignments in use.
 */
if ((cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())
-   && domain == 0) {
+   && type->domain == 0) {
/*
 * Align to supersection boundary if !high pages.
 * High pages have already been checked for proper
@@ -532,7 +528,7 @@ void __init create_mapping(struct map_desc *md)
while ((virt & ~SUPERSECTION_MASK ||
(virt + off) & ~SUPERSECTION_MASK) &&
length >= (PGDIR_SIZE / 2)) {
-   alloc_init_section(virt, virt + off, prot_sect);
+   alloc_init_section(virt, virt + off, 
type->prot_sect);
 
virt   += (PGDIR_SIZE / 2);
length -= (PGDIR_SIZE / 2);
@@ -540,7 +536,7 @@ void __init create_ma

[ARM] mm 3: separate out supersection mappings, avoid for <4GB

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4a56c1e41f19393577bdd5c774c289c199b7269d
Commit: 4a56c1e41f19393577bdd5c774c289c199b7269d
Parent: d5c98176ef34b8b78645646593c17e10f62f53ff
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 21 10:16:48 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:35:52 2007 +0100

[ARM] mm 3: separate out supersection mappings, avoid for <4GB

Catalin Marinas at ARM Ltd says:
> The CPU architects in ARM intended supersections only as a way to map
> addresses >= 4GB. Supersections are not mandated by the architecture
> and there is no easy way to detect their hardware support at run-time
> (other than checking for a specific core). From the analysis done in
> ARM, there wasn't a clear performance gain by using supersections
> rather than sections (no significant improvement in the TLB misses).

Therefore, we should avoid using supersections unless there's a real
need (iow, we're mapping addresses >= 4GB).

This means that we can simplify create_mapping() a bit since we will
only use supersection mappings for addresses >= 4GB, which means that
the physical, virtual and length must be multiples of the supersection
mapping size.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/ioremap.c |2 +-
 arch/arm/mm/mmu.c |  130 +++--
 2 files changed, 62 insertions(+), 70 deletions(-)

diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 0ac615c..800855b 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -302,7 +302,7 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, 
size_t size,
 #ifndef CONFIG_SMP
if (DOMAIN_IO == 0 &&
(((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
-  cpu_is_xsc3()) &&
+  cpu_is_xsc3()) && pfn >= 0x10 &&
   !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
area->flags |= VM_ARM_SECTION_MAPPING;
err = remap_area_supersections(addr, pfn, size, flags);
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index e359f36..3213980 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -398,21 +398,6 @@ alloc_init_section(unsigned long virt, unsigned long phys, 
int prot)
 }
 
 /*
- * Create a SUPER SECTION PGD between VIRT and PHYS with protection PROT
- */
-static inline void
-alloc_init_supersection(unsigned long virt, unsigned long phys, int prot)
-{
-   int i;
-
-   for (i = 0; i < 16; i += 1) {
-   alloc_init_section(virt, phys, prot | PMD_SECT_SUPER);
-
-   virt += (PGDIR_SIZE / 2);
-   }
-}
-
-/*
  * Add a PAGE mapping between VIRT and PHYS in domain
  * DOMAIN with protection PROT.  Note that due to the
  * way we map the PTEs, we must allocate two PTE_SIZE'd
@@ -436,6 +421,64 @@ alloc_init_page(unsigned long virt, unsigned long phys, 
const struct mem_type *t
set_pte_ext(ptep, pfn_pte(phys >> PAGE_SHIFT, 
__pgprot(type->prot_pte)), 0);
 }
 
+static void __init create_36bit_mapping(struct map_desc *md,
+   const struct mem_type *type)
+{
+   unsigned long phys, addr, length, end;
+   pgd_t *pgd;
+
+   addr = md->virtual;
+   phys = (unsigned long)__pfn_to_phys(md->pfn);
+   length = PAGE_ALIGN(md->length);
+
+   if (!(cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())) {
+   printk(KERN_ERR "MM: CPU does not support supersection "
+  "mapping for 0x%08llx at 0x%08lx\n",
+  __pfn_to_phys((u64)md->pfn), addr);
+   return;
+   }
+
+   /* N.B. ARMv6 supersections are only defined to work with domain 0.
+*  Since domain assignments can in fact be arbitrary, the
+*  'domain == 0' check below is required to insure that ARMv6
+*  supersections are only allocated for domain 0 regardless
+*  of the actual domain assignments in use.
+*/
+   if (type->domain) {
+   printk(KERN_ERR "MM: invalid domain in supersection "
+  "mapping for 0x%08llx at 0x%08lx\n",
+  __pfn_to_phys((u64)md->pfn), addr);
+   return;
+   }
+
+   if ((addr | length | __pfn_to_phys(md->pfn)) & ~SUPERSECTION_MASK) {
+   printk(KERN_ERR "MM: cannot create mapping for "
+  "0x%08llx at 0x%08lx invalid alignment\n",
+  __pfn_to_phys((u64)md->pfn), addr);
+   return;
+   }
+
+   /*
+* Shift bits [35:32] of address into bits [23:20] of PMD
+* (See ARMv6 spec).
+*/
+   phys |= (((md->pfn >> (32 - PAGE_SHIFT)) & 0xF) << 20);
+
+   pgd = pgd_offset_k(addr);
+   end = addr + length;
+   do {
+ 

[ARM] mm 4: make create_mapping() more conventional

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24e6c6996fb6e0e716c1dda1def1bb023a0fe43b
Commit: 24e6c6996fb6e0e716c1dda1def1bb023a0fe43b
Parent: 4a56c1e41f19393577bdd5c774c289c199b7269d
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 21 10:21:28 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:35:55 2007 +0100

[ARM] mm 4: make create_mapping() more conventional

Rather than our three separate loops to setup mappings (by page
mappings up to a section boundary, then section mappings, and the
remainder by page mappings) convert this to a more conventional
Linux style of a loop over each page table level.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/mmu.c |  114 +---
 1 files changed, 55 insertions(+), 59 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 3213980..5821e67 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -380,45 +380,55 @@ static void __init build_mem_type_table(void)
 
 #define vectors_base() (vectors_high() ? 0x : 0)
 
-/*
- * Create a SECTION PGD between VIRT and PHYS in domain
- * DOMAIN with protection PROT.  This operates on half-
- * pgdir entry increments.
- */
-static inline void
-alloc_init_section(unsigned long virt, unsigned long phys, int prot)
+static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
+ unsigned long end, unsigned long pfn,
+ const struct mem_type *type)
 {
-   pmd_t *pmdp = pmd_off_k(virt);
+   pte_t *pte;
 
-   if (virt & (1 << 20))
-   pmdp++;
+   if (pmd_none(*pmd)) {
+   pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t));
+   __pmd_populate(pmd, __pa(pte) | type->prot_l1);
+   }
 
-   *pmdp = __pmd(phys | prot);
-   flush_pmd_entry(pmdp);
+   pte = pte_offset_kernel(pmd, addr);
+   do {
+   set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0);
+   pfn++;
+   } while (pte++, addr += PAGE_SIZE, addr != end);
 }
 
-/*
- * Add a PAGE mapping between VIRT and PHYS in domain
- * DOMAIN with protection PROT.  Note that due to the
- * way we map the PTEs, we must allocate two PTE_SIZE'd
- * blocks - one for the Linux pte table, and one for
- * the hardware pte table.
- */
-static inline void
-alloc_init_page(unsigned long virt, unsigned long phys, const struct mem_type 
*type)
+static void __init alloc_init_section(pgd_t *pgd, unsigned long addr,
+ unsigned long end, unsigned long phys,
+ const struct mem_type *type)
 {
-   pmd_t *pmdp = pmd_off_k(virt);
-   pte_t *ptep;
+   pmd_t *pmd = pmd_offset(pgd, addr);
 
-   if (pmd_none(*pmdp)) {
-   ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *
-  sizeof(pte_t));
+   /*
+* Try a section mapping - end, addr and phys must all be aligned
+* to a section boundary.  Note that PMDs refer to the individual
+* L1 entries, whereas PGDs refer to a group of L1 entries making
+* up one logical pointer to an L2 table.
+*/
+   if (((addr | end | phys) & ~SECTION_MASK) == 0) {
+   pmd_t *p = pmd;
 
-   __pmd_populate(pmdp, __pa(ptep) | type->prot_l1);
-   }
-   ptep = pte_offset_kernel(pmdp, virt);
+   if (addr & SECTION_SIZE)
+   pmd++;
+
+   do {
+   *pmd = __pmd(phys | type->prot_sect);
+   phys += SECTION_SIZE;
+   } while (pmd++, addr += SECTION_SIZE, addr != end);
 
-   set_pte_ext(ptep, pfn_pte(phys >> PAGE_SHIFT, 
__pgprot(type->prot_pte)), 0);
+   flush_pmd_entry(p);
+   } else {
+   /*
+* No need to loop; pte's aren't interested in the
+* individual L1 entries.
+*/
+   alloc_init_pte(pmd, addr, end, __phys_to_pfn(phys), type);
+   }
 }
 
 static void __init create_36bit_mapping(struct map_desc *md,
@@ -488,9 +498,9 @@ static void __init create_36bit_mapping(struct map_desc *md,
  */
 void __init create_mapping(struct map_desc *md)
 {
-   unsigned long virt, length;
-   unsigned long off = (u32)__pfn_to_phys(md->pfn);
+   unsigned long phys, addr, length, end;
const struct mem_type *type;
+   pgd_t *pgd;
 
if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
printk(KERN_WARNING "BUG: not creating mapping for "
@@ -516,41 +526,27 @@ void __init create_mapping(struct map_desc *md)
return;
}
 
-   virt   = md->virtual;
-   off   -= virt;
-   length = md->length;
+   addr = md->virtual;
+   phy

[ARM] mm 5: Use mem_types table in ioremap

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b29e9f5e64fb90d2e4be1c7ef8c925b56669c74a
Commit: b29e9f5e64fb90d2e4be1c7ef8c925b56669c74a
Parent: 24e6c6996fb6e0e716c1dda1def1bb023a0fe43b
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 21 10:47:29 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:36:00 2007 +0100

[ARM] mm 5: Use mem_types table in ioremap

We really want to be using the memory type table in ioremap, so we
only have to do the CPU type fixups in one place.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/ioremap.c |   65 
 arch/arm/mm/mm.h  |9 +++
 arch/arm/mm/mmu.c |   14 --
 3 files changed, 42 insertions(+), 46 deletions(-)

diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 800855b..b26b361 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -32,6 +32,9 @@
 #include 
 #include 
 
+#include 
+#include "mm.h"
+
 /*
  * Used by ioremap() and iounmap() code to mark (super)section-mapped
  * I/O regions in vm_struct->flags field.
@@ -39,8 +42,9 @@
 #define VM_ARM_SECTION_MAPPING 0x8000
 
 static int remap_area_pte(pmd_t *pmd, unsigned long addr, unsigned long end,
- unsigned long phys_addr, pgprot_t prot)
+ unsigned long phys_addr, const struct mem_type *type)
 {
+   pgprot_t prot = __pgprot(type->prot_pte);
pte_t *pte;
 
pte = pte_alloc_kernel(pmd, addr);
@@ -63,7 +67,7 @@ static int remap_area_pte(pmd_t *pmd, unsigned long addr, 
unsigned long end,
 
 static inline int remap_area_pmd(pgd_t *pgd, unsigned long addr,
 unsigned long end, unsigned long phys_addr,
-pgprot_t prot)
+const struct mem_type *type)
 {
unsigned long next;
pmd_t *pmd;
@@ -75,7 +79,7 @@ static inline int remap_area_pmd(pgd_t *pgd, unsigned long 
addr,
 
do {
next = pmd_addr_end(addr, end);
-   ret = remap_area_pte(pmd, addr, next, phys_addr, prot);
+   ret = remap_area_pte(pmd, addr, next, phys_addr, type);
if (ret)
return ret;
phys_addr += next - addr;
@@ -84,13 +88,11 @@ static inline int remap_area_pmd(pgd_t *pgd, unsigned long 
addr,
 }
 
 static int remap_area_pages(unsigned long start, unsigned long pfn,
-   unsigned long size, unsigned long flags)
+   size_t size, const struct mem_type *type)
 {
unsigned long addr = start;
unsigned long next, end = start + size;
unsigned long phys_addr = __pfn_to_phys(pfn);
-   pgprot_t prot = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
-L_PTE_DIRTY | L_PTE_WRITE | flags);
pgd_t *pgd;
int err = 0;
 
@@ -98,7 +100,7 @@ static int remap_area_pages(unsigned long start, unsigned 
long pfn,
pgd = pgd_offset_k(addr);
do {
next = pgd_addr_end(addr, end);
-   err = remap_area_pmd(pgd, addr, next, phys_addr, prot);
+   err = remap_area_pmd(pgd, addr, next, phys_addr, type);
if (err)
break;
phys_addr += next - addr;
@@ -178,9 +180,9 @@ static void unmap_area_sections(unsigned long virt, 
unsigned long size)
 
 static int
 remap_area_sections(unsigned long virt, unsigned long pfn,
-   unsigned long size, unsigned long flags)
+   size_t size, const struct mem_type *type)
 {
-   unsigned long prot, addr = virt, end = virt + size;
+   unsigned long addr = virt, end = virt + size;
pgd_t *pgd;
 
/*
@@ -189,23 +191,13 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
 */
unmap_area_sections(virt, size);
 
-   prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO) |
-  (flags & (L_PTE_CACHEABLE | L_PTE_BUFFERABLE));
-
-   /*
-* ARMv6 and above need XN set to prevent speculative prefetches
-* hitting IO.
-*/
-   if (cpu_architecture() >= CPU_ARCH_ARMv6)
-   prot |= PMD_SECT_XN;
-
pgd = pgd_offset_k(addr);
do {
pmd_t *pmd = pmd_offset(pgd, addr);
 
-   pmd[0] = __pmd(__pfn_to_phys(pfn) | prot);
+   pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
pfn += SZ_1M >> PAGE_SHIFT;
-   pmd[1] = __pmd(__pfn_to_phys(pfn) | prot);
+   pmd[1] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
pfn += SZ_1M >> PAGE_SHIFT;
flush_pmd_entry(pmd);
 
@@ -218,9 +210,9 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
 
 static int
 remap_area_supersections(unsigned long virt, unsigne

[ARM] mm 6: allow mem_types table to specify extended pte attributes

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c172cc92c87103c98b5cd359205b684bf99b5067
Commit: c172cc92c87103c98b5cd359205b684bf99b5067
Parent: b29e9f5e64fb90d2e4be1c7ef8c925b56669c74a
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 21 10:52:32 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:36:02 2007 +0100

[ARM] mm 6: allow mem_types table to specify extended pte attributes

Add prot_pte_ext to the mem_types table to allow the extended pte
attributes to be passed to set_pte_ext(), thereby permitting us to
specify memory type information for the hardware PTE entries.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/ioremap.c |3 ++-
 arch/arm/mm/mm.h  |1 +
 arch/arm/mm/mmu.c |3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index b26b361..216623e 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -55,7 +55,8 @@ static int remap_area_pte(pmd_t *pmd, unsigned long addr, 
unsigned long end,
if (!pte_none(*pte))
goto bad;
 
-   set_pte_ext(pte, pfn_pte(phys_addr >> PAGE_SHIFT, prot), 0);
+   set_pte_ext(pte, pfn_pte(phys_addr >> PAGE_SHIFT, prot),
+   type->prot_pte_ext);
phys_addr += PAGE_SIZE;
} while (pte++, addr += PAGE_SIZE, addr != end);
return 0;
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 66f8612..7647c59 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -18,6 +18,7 @@ static inline pmd_t *pmd_off_k(unsigned long virt)
 
 struct mem_type {
unsigned int prot_pte;
+   unsigned int prot_pte_ext;
unsigned int prot_l1;
unsigned int prot_sect;
unsigned int domain;
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 6cb80b4..3604055 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -391,7 +391,8 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long 
addr,
 
pte = pte_offset_kernel(pmd, addr);
do {
-   set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)), 0);
+   set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)),
+   type->prot_pte_ext);
pfn++;
} while (pte++, addr += PAGE_SIZE, addr != end);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] mm 7: remove duplicated __ioremap() prototypes

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0058ca32c3004547ede575668a2be31862b92000
Commit: 0058ca32c3004547ede575668a2be31862b92000
Parent: c172cc92c87103c98b5cd359205b684bf99b5067
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat May 5 11:57:39 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 11:57:39 2007 +0100

[ARM] mm 7: remove duplicated __ioremap() prototypes

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-iop13xx/io.h |1 -
 include/asm-arm/arch-iop32x/io.h  |1 -
 include/asm-arm/arch-iop33x/io.h  |1 -
 3 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/asm-arm/arch-iop13xx/io.h 
b/include/asm-arm/arch-iop13xx/io.h
index 5a7bdb5..7dfff4a 100644
--- a/include/asm-arm/arch-iop13xx/io.h
+++ b/include/asm-arm/arch-iop13xx/io.h
@@ -26,7 +26,6 @@
 #define __mem_isa(a) (a)
 
 extern void __iomem * __iop13xx_io(unsigned long io_addr);
-extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
 extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
unsigned long flags);
 extern void __iop13xx_iounmap(void __iomem *addr);
diff --git a/include/asm-arm/arch-iop32x/io.h b/include/asm-arm/arch-iop32x/io.h
index 5f570a5..994f16a 100644
--- a/include/asm-arm/arch-iop32x/io.h
+++ b/include/asm-arm/arch-iop32x/io.h
@@ -13,7 +13,6 @@
 
 #include 
 
-extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
 extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
unsigned long flags);
 extern void __iop3xx_iounmap(void __iomem *addr);
diff --git a/include/asm-arm/arch-iop33x/io.h b/include/asm-arm/arch-iop33x/io.h
index 1bb5071..993f758 100644
--- a/include/asm-arm/arch-iop33x/io.h
+++ b/include/asm-arm/arch-iop33x/io.h
@@ -13,7 +13,6 @@
 
 #include 
 
-extern void __iomem * __ioremap(unsigned long, size_t, unsigned long);
 extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
unsigned long flags);
 extern void __iop3xx_iounmap(void __iomem *addr);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] mm 8: define mem_types table L1 bit 4 to be for ARMv6

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ef7963503abd3287943125681c2dc17879e8d4e
Commit: 9ef7963503abd3287943125681c2dc17879e8d4e
Parent: 0058ca32c3004547ede575668a2be31862b92000
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat May 5 20:03:35 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 20:03:35 2007 +0100

[ARM] mm 8: define mem_types table L1 bit 4 to be for ARMv6

Change the memory types table to define the L1 descriptor bit 4 to
be in terms of the ARMv6 definition - execute never.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mm/mmu.c |   44 
 1 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 3604055..44f385a 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -181,16 +181,16 @@ static struct mem_type mem_types[] = {
.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_WRITE,
.prot_l1   = PMD_TYPE_TABLE,
-   .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED |
+   .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_UNCACHED |
PMD_SECT_AP_WRITE,
.domain= DOMAIN_IO,
},
[MT_CACHECLEAN] = {
-   .prot_sect = PMD_TYPE_SECT | PMD_BIT4,
+   .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
.domain= DOMAIN_KERNEL,
},
[MT_MINICLEAN] = {
-   .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_MINICACHE,
+   .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE,
.domain= DOMAIN_KERNEL,
},
[MT_LOW_VECTORS] = {
@@ -206,25 +206,25 @@ static struct mem_type mem_types[] = {
.domain= DOMAIN_USER,
},
[MT_MEMORY] = {
-   .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_AP_WRITE,
+   .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
.domain= DOMAIN_KERNEL,
},
[MT_ROM] = {
-   .prot_sect = PMD_TYPE_SECT | PMD_BIT4,
+   .prot_sect = PMD_TYPE_SECT,
.domain= DOMAIN_KERNEL,
},
[MT_IXP2000_DEVICE] = { /* IXP2400 requires XCB=101 for on-chip I/O */
.prot_pte  = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_WRITE,
.prot_l1   = PMD_TYPE_TABLE,
-   .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED |
+   .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_UNCACHED |
PMD_SECT_AP_WRITE | PMD_SECT_BUFFERABLE |
PMD_SECT_TEX(1),
.domain= DOMAIN_IO,
},
[MT_NONSHARED_DEVICE] = {
.prot_l1   = PMD_TYPE_TABLE,
-   .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_NONSHARED_DEV |
+   .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | 
PMD_SECT_NONSHARED_DEV |
PMD_SECT_AP_WRITE,
.domain= DOMAIN_IO,
}
@@ -260,20 +260,23 @@ static void __init build_mem_type_table(void)
}
 
/*
-* Xscale must not have PMD bit 4 set for section mappings.
+* ARMv5 and lower, bit 4 must be set for page tables.
+* (was: cache "update-able on write" bit on ARM610)
+* However, Xscale cores require this bit to be cleared.
 */
-   if (cpu_is_xscale())
-   for (i = 0; i < ARRAY_SIZE(mem_types); i++)
+   if (cpu_is_xscale()) {
+   for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
mem_types[i].prot_sect &= ~PMD_BIT4;
-
-   /*
-* ARMv5 and lower, excluding Xscale, bit 4 must be set for
-* page tables.
-*/
-   if (cpu_arch < CPU_ARCH_ARMv6 && !cpu_is_xscale())
-   for (i = 0; i < ARRAY_SIZE(mem_types); i++)
+   mem_types[i].prot_l1 &= ~PMD_BIT4;
+   }
+   } else if (cpu_arch < CPU_ARCH_ARMv6) {
+   for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
if (mem_types[i].prot_l1)
mem_types[i].prot_l1 |= PMD_BIT4;
+   if (mem_types[i].prot_sect)
+   mem_types[i].prot_sect |= PMD_BIT4;
+   }
+   }
 
cp = &cache_policies[cachepolicy];
kern_pgprot = user_pgprot = cp->pte;
@@ -294,13 +297,6 @@ static void __init build_mem_type_table(void)
 */
if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
/*
-* bit 4 becomes XN which we must clear for the
-* kernel memory mapping.
-*/
-   mem_types[MT_MEMORY].prot_se

[ARM] mm 9: add additional device memory types

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0af92befeb4b330c46cce6b520b2cc775cd6931f
Commit: 0af92befeb4b330c46cce6b520b2cc775cd6931f
Parent: 9ef7963503abd3287943125681c2dc17879e8d4e
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat May 5 20:28:16 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 20:28:16 2007 +0100

[ARM] mm 9: add additional device memory types

Add cached device type for ioremap_cached().  Group all device memory
types together, and ensure that they all have a "MT_DEVICE" prefix.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-ixp2000/core.c|   22 
 arch/arm/mach-ixp2000/enp2611.c |6 ++--
 arch/arm/mm/mmu.c   |   50 +-
 include/asm-arm/mach/map.h  |   20 +--
 4 files changed, 54 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 27b7480..9cf2498 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -84,59 +84,59 @@ static struct map_desc ixp2000_io_desc[] __initdata = {
.virtual= IXP2000_CAP_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_CAP_PHYS_BASE),
.length = IXP2000_CAP_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_INTCTL_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_INTCTL_PHYS_BASE),
.length = IXP2000_INTCTL_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_PCI_CREG_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_PCI_CREG_PHYS_BASE),
.length = IXP2000_PCI_CREG_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_PCI_CSR_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_PCI_CSR_PHYS_BASE),
.length = IXP2000_PCI_CSR_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_MSF_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_MSF_PHYS_BASE),
.length = IXP2000_MSF_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_SCRATCH_RING_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_SCRATCH_RING_PHYS_BASE),
.length = IXP2000_SCRATCH_RING_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_SRAM0_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_SRAM0_PHYS_BASE),
.length = IXP2000_SRAM0_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_PCI_IO_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE),
.length = IXP2000_PCI_IO_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_PCI_CFG0_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_PCI_CFG0_PHYS_BASE),
.length = IXP2000_PCI_CFG0_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}, {
.virtual= IXP2000_PCI_CFG1_VIRT_BASE,
.pfn= __phys_to_pfn(IXP2000_PCI_CFG1_PHYS_BASE),
.length = IXP2000_PCI_CFG1_SIZE,
-   .type   = MT_IXP2000_DEVICE,
+   .type   = MT_DEVICE_IXP2000,
}
 };
 
 void __init ixp2000_map_io(void)
 {
/*
-* On IXP2400 CPUs we need to use MT_IXP2000_DEVICE so that
+* On IXP2400 CPUs we need to use MT_DEVICE_IXP2000 so that
 * XCB=101 (to avoid triggering erratum #66), and given that
 * this mode speeds up I/O accesses and we have write buffer
 * flushes in the right places anyway, it doesn't hurt to use
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index ac29298..500e997 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -70,17 +70,17 @@ static struct map_desc enp2611_io_desc[] __initdata = {
.v

[ARM] mm 10: allow memory type to be specified with ioremap

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3603ab2b62ad8372fc93816b080b370dd55d7cec
Commit: 3603ab2b62ad8372fc93816b080b370dd55d7cec
Parent: 0af92befeb4b330c46cce6b520b2cc775cd6931f
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat May 5 20:59:27 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 20:59:27 2007 +0100

[ARM] mm 10: allow memory type to be specified with ioremap

__ioremap() took a set of page table flags (specifically the cacheable
and bufferable bits) to control the mapping type.  However, with
the advent of ARMv6, this is far too limited.

Replace the page table flags with a memory type index, so that the
desired attributes can be selected from the mem_type table.

Finally, to prevent silent miscompilation due to the differing
arguments, rename the __ioremap() and __ioremap_pfn() functions.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-iop13xx/io.c|   10 +-
 arch/arm/mach-iop13xx/pci.c   |8 
 arch/arm/mm/ioremap.c |   20 +---
 arch/arm/mm/nommu.c   |   12 ++--
 arch/arm/plat-iop/io.c|4 ++--
 include/asm-arm/arch-ixp23xx/io.h |4 ++--
 include/asm-arm/arch-ixp4xx/io.h  |4 ++--
 include/asm-arm/io.h  |   33 +
 include/asm-arm/mach/map.h|7 +++
 9 files changed, 54 insertions(+), 48 deletions(-)

diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
index e79a1b6..5b22fde 100644
--- a/arch/arm/mach-iop13xx/io.c
+++ b/arch/arm/mach-iop13xx/io.c
@@ -41,7 +41,7 @@ void * __iomem __iop13xx_io(unsigned long io_addr)
 EXPORT_SYMBOL(__iop13xx_io);
 
 void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
-   unsigned long flags)
+   unsigned int mtype)
 {
void __iomem * retval;
 
@@ -61,9 +61,9 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t 
size,
 (cookie - IOP13XX_PCIE_LOWER_MEM_RA));
break;
case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA:
-   retval = __ioremap(IOP13XX_PBI_LOWER_MEM_PA +
- (cookie - IOP13XX_PBI_LOWER_MEM_RA),
- size, flags);
+   retval = __arm_ioremap(IOP13XX_PBI_LOWER_MEM_PA +
+  (cookie - IOP13XX_PBI_LOWER_MEM_RA),
+  size, mtype);
break;
case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
@@ -75,7 +75,7 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t 
size,
retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
break;
default:
-   retval = __ioremap(cookie, size, flags);
+   retval = __arm_ioremap(cookie, size, mtype);
}
 
return retval;
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 89ec70e..d85b88f 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -88,9 +88,9 @@ void iop13xx_map_pci_memory(void)
 
if (end) {
iop13xx_atux_mem_base =
-   (u32) __ioremap_pfn(
+   (u32) __arm_ioremap_pfn(
__phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA)
-   , 0, iop13xx_atux_mem_size, 0);
+   , 0, iop13xx_atux_mem_size, MT_DEVICE);
if (!iop13xx_atux_mem_base) {
printk("%s: atux allocation "
   "failed\n", 
__FUNCTION__);
@@ -114,9 +114,9 @@ void iop13xx_map_pci_memory(void)
 
if (end) {
iop13xx_atue_mem_base =
-   (u32) __ioremap_pfn(
+   (u32) __arm_ioremap_pfn(
__phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA)
-   , 0, iop13xx_atue_mem_size, 0);
+   , 0, iop13xx_atue_mem_size, MT_DEVICE);
if (!iop13xx_atue_mem_base) {
printk("%s: atue allocation "
   "failed\n", 
__FUNCTION__);
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 216623e..d6167ad 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -262,11 +262,10 @@ remap_area_supersections(unsign

[ARM] 4300/1: Add picotux 200 ARM board

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d01f133412b0e27b340ab1bbb2cf0017329ae61
Commit: 5d01f133412b0e27b340ab1bbb2cf0017329ae61
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Simon Richter <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 2 14:06:29 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 21:01:08 2007 +0100

[ARM] 4300/1: Add picotux 200 ARM board

Add the picotux 200 ARM board:
 - Enable its machine type in the filter in head.S
 - Add configuration option
 - Add board initialisation
 - Add default configuration

Signed-off-by: Simon Richter <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/boot/compressed/head-at91rm9200.S |6 +
 arch/arm/configs/picotux200_defconfig  | 1386 
 arch/arm/mach-at91/Kconfig |7 +
 arch/arm/mach-at91/Makefile|1 +
 arch/arm/mach-at91/board-picotux200.c  |  166 
 5 files changed, 1566 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/compressed/head-at91rm9200.S 
b/arch/arm/boot/compressed/head-at91rm9200.S
index d68b9ac..11782cc 100644
--- a/arch/arm/boot/compressed/head-at91rm9200.S
+++ b/arch/arm/boot/compressed/head-at91rm9200.S
@@ -61,6 +61,12 @@
cmp r7, r3
beq 99f
 
+   @ picotux 200 : 963
+   mov r3, #(MACH_TYPE_PICOTUX2XX & 0xff)
+   orr r3, r3, #(MACH_TYPE_PICOTUX2XX & 0xff00)
+   cmp r7, r3
+   beq 99f
+
@ Ajeco 1ARM : 1075
mov r3, #(MACH_TYPE_ONEARM & 0xff)
orr r3, r3, #(MACH_TYPE_ONEARM & 0xff00)
diff --git a/arch/arm/configs/picotux200_defconfig 
b/arch/arm/configs/picotux200_defconfig
new file mode 100644
index 000..339c489
--- /dev/null
+++ b/arch/arm/configs/picotux200_defconfig
@@ -0,0 +1,1386 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.21-rc4
+# Wed Mar 28 16:19:50 2007
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_GENERIC_TIME is not set
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_VECTORS_BASE=0x
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_UTS_NS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+CONFIG_ARCH_AT91=y
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG

[ARM] fix section mismatch warning in board-sam9260

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e18c8dd0d3456f96e13bc2e72197bfae11d8501
Commit: 3e18c8dd0d3456f96e13bc2e72197bfae11d8501
Parent: 5d01f133412b0e27b340ab1bbb2cf0017329ae61
Author: Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 00:04:39 2007 -0700
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 10:26:47 2007 +0100

[ARM] fix section mismatch warning in board-sam9260

Andrew Morton found a section mismatch warning in x86_64 triggered by a
wrongly placed __initdata marker.

git grep "struct __initdata" revealed that board-sam9260.c had the same
problem.

This patch fixes this by placing the __initdata marker correct.  It was
checked with objdump that the variable was moved to .init.data by this
change.

Fixed an unrelated section mismatch warning while touching the file.

Both changes are only compile tested but obvious correct.
[Used at91sam9260ek_defconfig to get compile coverage]

Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-at91/board-sam9260ek.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-sam9260ek.c 
b/arch/arm/mach-at91/board-sam9260ek.c
index 57fb449..7a31db0 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -118,7 +118,7 @@ static struct spi_board_info ek_spi_devices[] = {
 /*
  * MACB Ethernet device
  */
-static struct __initdata at91_eth_data ek_macb_data = {
+static struct at91_eth_data __initdata ek_macb_data = {
.phy_irq_pin= AT91_PIN_PA7,
.is_rmii= 1,
 };
@@ -140,7 +140,7 @@ static struct mtd_partition __initdata ek_nand_partition[] 
= {
},
 };
 
-static struct mtd_partition *nand_partitions(int size, int *num_partitions)
+static struct mtd_partition * __init nand_partitions(int size, int 
*num_partitions)
 {
*num_partitions = ARRAY_SIZE(ek_nand_partition);
return ek_nand_partition;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4350/1: AT91: Hardware header for ADC peripheral

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce813b97e58cdfd780b8f8b4e15cd3ebfe940415
Commit: ce813b97e58cdfd780b8f8b4e15cd3ebfe940415
Parent: 3e18c8dd0d3456f96e13bc2e72197bfae11d8501
Author: Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 17:08:13 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:10:20 2007 +0100

[ARM] 4350/1: AT91: Hardware header for ADC peripheral

Definitions for Analog-to-Digital Converter (ADC) found on the Atmel
AT91SAM9260 processor.

Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-at91/at91_adc.h |   61 ++
 1 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-at91/at91_adc.h 
b/include/asm-arm/arch-at91/at91_adc.h
new file mode 100644
index 000..1ed66ea
--- /dev/null
+++ b/include/asm-arm/arch-at91/at91_adc.h
@@ -0,0 +1,61 @@
+/*
+ * include/asm-arm/arch-at91/at91_adc.h
+ *
+ * Copyright (C) SAN People
+ *
+ * Analog-to-Digital Converter (ADC) registers.
+ * Based on AT91SAM9260 datasheet revision D.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91_ADC_H
+#define AT91_ADC_H
+
+#define AT91_ADC_CR0x00/* Control Register */
+#defineAT91_ADC_SWRST  (1 << 0)/* Software 
Reset */
+#defineAT91_ADC_START  (1 << 1)/* Start 
Conversion */
+
+#define AT91_ADC_MR0x04/* Mode Register */
+#defineAT91_ADC_TRGEN  (1 << 0)/* Trigger 
Enable */
+#defineAT91_ADC_TRGSEL (7 << 1)/* Trigger 
Selection */
+#defineAT91_ADC_TRGSEL_TC0 (0 << 1)
+#defineAT91_ADC_TRGSEL_TC1 (1 << 1)
+#defineAT91_ADC_TRGSEL_TC2 (2 << 1)
+#defineAT91_ADC_TRGSEL_EXTERNAL(6 << 1)
+#defineAT91_ADC_LOWRES (1 << 4)/* Low 
Resolution */
+#defineAT91_ADC_SLEEP  (1 << 5)/* Sleep Mode */
+#defineAT91_ADC_PRESCAL(0x3f << 8) /* Prescalar 
Rate Selection */
+#defineAT91_ADC_PRESCAL_(x)((x) << 8)
+#defineAT91_ADC_STARTUP(0x1f << 16)/* Startup Up 
Time */
+#defineAT91_ADC_STARTUP_(x)((x) << 16)
+#defineAT91_ADC_SHTIM  (0xf  << 24)/* Sample & 
Hold Time */
+#defineAT91_ADC_SHTIM_(x)  ((x) << 24)
+
+#define AT91_ADC_CHER  0x10/* Channel Enable Register */
+#define AT91_ADC_CHDR  0x14/* Channel Disable Register */
+#define AT91_ADC_CHSR  0x18/* Channel Status Register */
+#defineAT91_ADC_CH(n)  (1 << (n))  /* Channel 
Number */
+
+#define AT91_ADC_SR0x1C/* Status Register */
+#defineAT91_ADC_EOC(n) (1 << (n))  /* End of 
Conversion on Channel N */
+#defineAT91_ADC_OVRE(n)(1 << ((n) + 8))/* Overrun 
Error on Channel N */
+#defineAT91_ADC_DRDY   (1 << 16)   /* Data Ready */
+#defineAT91_ADC_GOVRE  (1 << 17)   /* General 
Overrun Error */
+#defineAT91_ADC_ENDRX  (1 << 18)   /* End of RX 
Buffer */
+#defineAT91_ADC_RXFUFF (1 << 19)   /* RX Buffer 
Full */
+
+#define AT91_ADC_LCDR  0x20/* Last Converted Data Register 
*/
+#defineAT91_ADC_LDATA  (0x3ff)
+
+#define AT91_ADC_IER   0x24/* Interrupt Enable Register */
+#define AT91_ADC_IDR   0x28/* Interrupt Disable Register */
+#define AT91_ADC_IMR   0x2C/* Interrupt Mask Register */
+
+#define AT91_ADC_CHR(n)(0x30 + ((n) * 4)   /* Channel Data 
Register N */
+#defineAT91_ADC_DATA   (0x3ff)
+
+#endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4351/1: AT91: Define rest of peripheral clocks

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e8788babe6ddb35ab041a146d6b3e18874513566
Commit: e8788babe6ddb35ab041a146d6b3e18874513566
Parent: ce813b97e58cdfd780b8f8b4e15cd3ebfe940415
Author: Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 17:14:57 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:10:21 2007 +0100

[ARM] 4351/1: AT91: Define rest of peripheral clocks

Define and register the remaining peripheral clocks for the AT91
processors.

AT91SAM9261 clocks patch by Ivan Zhakov.

Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-at91/at91rm9200.c  |   19 ++-
 arch/arm/mach-at91/at91sam9260.c |7 -
 arch/arm/mach-at91/at91sam9261.c |   19 ++-
 arch/arm/mach-at91/at91sam9263.c |   48 +
 4 files changed, 84 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 2ddcdd6..2cad2bf 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -117,6 +117,21 @@ static struct clk pioD_clk = {
.pmc_mask   = 1 << AT91RM9200_ID_PIOD,
.type   = CLK_TYPE_PERIPHERAL,
 };
+static struct clk ssc0_clk = {
+   .name   = "ssc0_clk",
+   .pmc_mask   = 1 << AT91RM9200_ID_SSC0,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ssc1_clk = {
+   .name   = "ssc1_clk",
+   .pmc_mask   = 1 << AT91RM9200_ID_SSC1,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ssc2_clk = {
+   .name   = "ssc2_clk",
+   .pmc_mask   = 1 << AT91RM9200_ID_SSC2,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
 static struct clk tc0_clk = {
.name   = "tc0_clk",
.pmc_mask   = 1 << AT91RM9200_ID_TC0,
@@ -161,7 +176,9 @@ static struct clk *periph_clocks[] __initdata = {
&udc_clk,
&twi_clk,
&spi_clk,
-   // ssc 0 .. ssc2
+   &ssc0_clk,
+   &ssc1_clk,
+   &ssc2_clk,
&tc0_clk,
&tc1_clk,
&tc2_clk,
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 6ea41d8..e47381e 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -119,6 +119,11 @@ static struct clk spi1_clk = {
.pmc_mask   = 1 << AT91SAM9260_ID_SPI1,
.type   = CLK_TYPE_PERIPHERAL,
 };
+static struct clk ssc_clk = {
+   .name   = "ssc_clk",
+   .pmc_mask   = 1 << AT91SAM9260_ID_SSC,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
 static struct clk tc0_clk = {
.name   = "tc0_clk",
.pmc_mask   = 1 << AT91SAM9260_ID_TC0,
@@ -193,7 +198,7 @@ static struct clk *periph_clocks[] __initdata = {
&twi_clk,
&spi0_clk,
&spi1_clk,
-   // ssc
+   &ssc_clk,
&tc0_clk,
&tc1_clk,
&tc2_clk,
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 784d1e6..dfe8c39 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -97,6 +97,21 @@ static struct clk spi1_clk = {
.pmc_mask   = 1 << AT91SAM9261_ID_SPI1,
.type   = CLK_TYPE_PERIPHERAL,
 };
+static struct clk ssc0_clk = {
+   .name   = "ssc0_clk",
+   .pmc_mask   = 1 << AT91SAM9261_ID_SSC0,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ssc1_clk = {
+   .name   = "ssc1_clk",
+   .pmc_mask   = 1 << AT91SAM9261_ID_SSC1,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ssc2_clk = {
+   .name   = "ssc2_clk",
+   .pmc_mask   = 1 << AT91SAM9261_ID_SSC2,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
 static struct clk tc0_clk = {
.name   = "tc0_clk",
.pmc_mask   = 1 << AT91SAM9261_ID_TC0,
@@ -135,7 +150,9 @@ static struct clk *periph_clocks[] __initdata = {
&twi_clk,
&spi0_clk,
&spi1_clk,
-   // ssc 0 .. ssc2
+   &ssc0_clk,
+   &ssc1_clk,
+   &ssc2_clk,
&tc0_clk,
&tc1_clk,
&tc2_clk,
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 0e89a7f..00e27b1 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -87,6 +87,11 @@ static struct clk mmc1_clk = {
.pmc_mask   = 1 << AT91SAM9263_ID_MCI1,
.type   = CLK_TYPE_PERIPHERAL,
 };
+static struct clk can_clk = {
+   .name   = "can_clk",
+   .pmc_mask   = 1 << AT91SAM9263_ID_CAN,
+   .type   = CLK_TYPE_PERIPHERAL,
+};
 static struct clk twi_clk = {
.name   = "twi_clk",
.pmc_mask   = 1 << AT91SAM9263_ID_TWI,
@@ -102,16 +107,46 @@ static

[ARM] 4352/1: AT91: Platform data for LCD and AC97.

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7776a94c311504f26e73060920dfb3ccf02786b7
Commit: 7776a94c311504f26e73060920dfb3ccf02786b7
Parent: e8788babe6ddb35ab041a146d6b3e18874513566
Author: Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 17:46:49 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:10:22 2007 +0100

[ARM] 4352/1: AT91: Platform data for LCD and AC97.

Define resources, platform_device and device registration functions for
the LCD and AC97 controllers on the AT91SAM9263.
Also update the AT91SAM9261 to use the common atmel_lcdfb driver.

Signed-off-by: Nicolas Ferre <[EMAIL PROTECTED]>
Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-at91/at91sam9261_devices.c |   10 +-
 arch/arm/mach-at91/at91sam9263_devices.c |  124 ++
 include/asm-arm/arch-at91/board.h|   12 +++-
 3 files changed, 140 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9261_devices.c 
b/arch/arm/mach-at91/at91sam9261_devices.c
index e150476..8e78199 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -430,9 +430,9 @@ void __init at91_add_device_spi(struct spi_board_info 
*devices, int nr_devices)
  *  LCD Controller
  *  */
 
-#if defined(CONFIG_FB_AT91) || defined(CONFIG_FB_AT91_MODULE)
+#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
 static u64 lcdc_dmamask = 0xUL;
-static struct at91fb_info lcdc_data;
+static struct atmel_lcdfb_info lcdc_data;
 
 static struct resource lcdc_resources[] = {
[0] = {
@@ -455,7 +455,7 @@ static struct resource lcdc_resources[] = {
 };
 
 static struct platform_device at91_lcdc_device = {
-   .name   = "at91-fb",
+   .name   = "atmel_lcdfb",
.id = 0,
.dev= {
.dma_mask   = &lcdc_dmamask,
@@ -466,7 +466,7 @@ static struct platform_device at91_lcdc_device = {
.num_resources  = ARRAY_SIZE(lcdc_resources),
 };
 
-void __init at91_add_device_lcdc(struct at91fb_info *data)
+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
 {
if (!data) {
return;
@@ -499,7 +499,7 @@ void __init at91_add_device_lcdc(struct at91fb_info *data)
platform_device_register(&at91_lcdc_device);
 }
 #else
-void __init at91_add_device_lcdc(struct at91fb_info *data) {}
+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
 #endif
 
 
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c 
b/arch/arm/mach-at91/at91sam9263_devices.c
index b77121f..2b2e18a 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -573,6 +573,130 @@ void __init at91_add_device_spi(struct spi_board_info 
*devices, int nr_devices)
 
 
 /* 
+ *  AC97
+ *  */
+
+#if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE)
+static u64 ac97_dmamask = 0xUL;
+static struct atmel_ac97_data ac97_data;
+
+static struct resource ac97_resources[] = {
+   [0] = {
+   .start  = AT91SAM9263_BASE_AC97C,
+   .end= AT91SAM9263_BASE_AC97C + SZ_16K - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = AT91SAM9263_ID_AC97C,
+   .end= AT91SAM9263_ID_AC97C,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device at91sam9263_ac97_device = {
+   .name   = "ac97c",
+   .id = 1,
+   .dev= {
+   .dma_mask   = &ac97_dmamask,
+   .coherent_dma_mask  = 0x,
+   .platform_data  = &ac97_data,
+   },
+   .resource   = ac97_resources,
+   .num_resources  = ARRAY_SIZE(ac97_resources),
+};
+
+void __init at91_add_device_ac97(struct atmel_ac97_data *data)
+{
+   if (!data)
+   return;
+
+   at91_set_A_periph(AT91_PIN_PB0, 0); /* AC97FS */
+   at91_set_A_periph(AT91_PIN_PB1, 0); /* AC97CK */
+   at91_set_A_periph(AT91_PIN_PB2, 0); /* AC97TX */
+   at91_set_A_periph(AT91_PIN_PB3, 0); /* AC97RX */
+
+   /* reset */
+   if (data->reset_pin)
+   at91_set_gpio_output(data->reset_pin, 0);
+
+   ac97_data = *ek_data;
+   platform_device_register(&at91sam9263_ac97_device);
+}
+#else
+void __init at91_add_device_ac97(struct atmel_ac97_data *data) {}
+#endif
+
+
+/* 
+ *  LCD Controller

[ARM] 4353/1: AT91: Support ADS7846 touchsceen on SAM9261-EK board

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=235227285b3e4bae616be5720e6dedb49b914e9d
Commit: 235227285b3e4bae616be5720e6dedb49b914e9d
Parent: 7776a94c311504f26e73060920dfb3ccf02786b7
Author: Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 17:58:51 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:10:23 2007 +0100

[ARM] 4353/1: AT91: Support ADS7846 touchsceen on SAM9261-EK board

Add support for the ADS7846 Touchscreen found on the Atmel
AT91SAM9261-EK board.

Original patch by Morten Larsen.

Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-at91/board-sam9261ek.c |   52 -
 1 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-sam9261ek.c 
b/arch/arm/mach-at91/board-sam9261ek.c
index b7e7724..bcf7153 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -195,6 +196,41 @@ static struct at91_nand_data __initdata ek_nand_data = {
 };
 
 /*
+ * ADS7846 Touchscreen
+ */
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || 
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+
+static int ads7843_pendown_state(void)
+{
+   return !at91_get_gpio_value(AT91_PIN_PC2);  /* Touchscreen PENIRQ */
+}
+
+static struct ads7846_platform_data ads_info = {
+   .model  = 7843,
+   .x_min  = 150,
+   .x_max  = 3830,
+   .y_min  = 190,
+   .y_max  = 3830,
+   .vref_delay_usecs   = 100,
+   .x_plate_ohms   = 450,
+   .y_plate_ohms   = 250,
+   .pressure_max   = 15000,
+   .debounce_max   = 1,
+   .debounce_rep   = 0,
+   .debounce_tol   = (~0),
+   .get_pendown_state  = ads7843_pendown_state,
+};
+
+static void __init ek_add_device_ts(void)
+{
+   at91_set_B_periph(AT91_PIN_PC2, 1); /* External IRQ0, with pullup */
+   at91_set_gpio_input(AT91_PIN_PA11, 1);  /* Touchscreen BUSY signal */
+}
+#else
+static void __init ek_add_device_ts(void) {}
+#endif
+
+/*
  * SPI devices
  */
 static struct spi_board_info ek_spi_devices[] = {
@@ -204,6 +240,16 @@ static struct spi_board_info ek_spi_devices[] = {
.max_speed_hz   = 15 * 1000 * 1000,
.bus_num= 0,
},
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || 
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+   {
+   .modalias   = "ads7846",
+   .chip_select= 2,
+   .max_speed_hz   = 125000 * 26,  /* (max sample rate @ 3V) * 
(cmd + data + overhead) */
+   .bus_num= 0,
+   .platform_data  = &ads_info,
+   .irq= AT91SAM9261_ID_IRQ0,
+   },
+#endif
 #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
{   /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
.modalias   = "mtd_dataflash",
@@ -211,9 +257,9 @@ static struct spi_board_info ek_spi_devices[] = {
.max_speed_hz   = 15 * 1000 * 1000,
.bus_num= 0,
},
-#elif defined(CONFIG_SND_AT73C213)
+#elif defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
{   /* AT73C213 DAC */
-   .modalias   = "snd_at73c213",
+   .modalias   = "at73c213",
.chip_select= 3,
.max_speed_hz   = 10 * 1000 * 1000,
.bus_num= 0,
@@ -241,6 +287,8 @@ static void __init ek_board_init(void)
 #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
/* SPI */
at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
+   /* Touchscreen */
+   ek_add_device_ts();
 #else
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4354/1: AT91: Support ADS7846 touchsceen on SAM9263-EK board

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c73628f24ea73479232d1b608359aa7d8d2c95d
Commit: 7c73628f24ea73479232d1b608359aa7d8d2c95d
Parent: 235227285b3e4bae616be5720e6dedb49b914e9d
Author: Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 18:00:45 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:10:26 2007 +0100

[ARM] 4354/1: AT91: Support ADS7846 touchsceen on SAM9263-EK board

Add support for the ADS7846 Touchscreen found on the Atmel
AT91SAM9263-EK board.

Signed-off-by: Nicolas Ferre <[EMAIL PROTECTED]>
Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-at91/board-sam9263ek.c |   48 ++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-at91/board-sam9263ek.c 
b/arch/arm/mach-at91/board-sam9263ek.c
index 8fdce11..81d3d6a 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -86,6 +87,40 @@ static struct at91_udc_data __initdata ek_udc_data = {
 
 
 /*
+ * ADS7846 Touchscreen
+ */
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || 
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+static int ads7843_pendown_state(void)
+{
+   return !at91_get_gpio_value(AT91_PIN_PA15); /* Touchscreen PENIRQ */
+}
+
+static struct ads7846_platform_data ads_info = {
+   .model  = 7843,
+   .x_min  = 150,
+   .x_max  = 3830,
+   .y_min  = 190,
+   .y_max  = 3830,
+   .vref_delay_usecs   = 100,
+   .x_plate_ohms   = 450,
+   .y_plate_ohms   = 250,
+   .pressure_max   = 15000,
+   .debounce_max   = 1,
+   .debounce_rep   = 0,
+   .debounce_tol   = (~0),
+   .get_pendown_state  = ads7843_pendown_state,
+};
+
+static void __init ek_add_device_ts(void)
+{
+   at91_set_B_periph(AT91_PIN_PA15, 1);/* External IRQ1, with pullup */
+   at91_set_gpio_input(AT91_PIN_PA31, 1);  /* Touchscreen BUSY signal */
+}
+#else
+static void __init ek_add_device_ts(void) {}
+#endif
+
+/*
  * SPI devices.
  */
 static struct spi_board_info ek_spi_devices[] = {
@@ -97,6 +132,16 @@ static struct spi_board_info ek_spi_devices[] = {
.bus_num= 0,
},
 #endif
+#if defined(CONFIG_TOUCHSCREEN_ADS7846) || 
defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
+   {
+   .modalias   = "ads7846",
+   .chip_select= 3,
+   .max_speed_hz   = 125000 * 26,  /* (max sample rate @ 3V) * 
(cmd + data + overhead) */
+   .bus_num= 0,
+   .platform_data  = &ads_info,
+   .irq= AT91SAM9263_ID_IRQ1,
+   },
+#endif
 };
 
 
@@ -157,7 +202,10 @@ static void __init ek_board_init(void)
/* USB Device */
at91_add_device_udc(&ek_udc_data);
/* SPI */
+   at91_set_gpio_output(AT91_PIN_PE20, 1); /* select spi0 clock */
at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
+   /* Touchscreen */
+   ek_add_device_ts();
/* MMC */
at91_add_device_mmc(1, &ek_mmc_data);
/* NAND */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4357/1: AT91: Support slower serial baud-rates

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03abeac0a222060ae8f02e8359c285df0971437e
Commit: 03abeac0a222060ae8f02e8359c285df0971437e
Parent: 7c73628f24ea73479232d1b608359aa7d8d2c95d
Author: Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 12:26:24 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:12:45 2007 +0100

[ARM] 4357/1: AT91: Support slower serial baud-rates

Allow slower serial baud-rates by switching the UART clock from MCK to
MCK/8.

Based on patches by Mike Wolfram and Russell King.

Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 drivers/serial/atmel_serial.c |9 +++--
 drivers/serial/atmel_serial.h |3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 935f48f..3320bcd 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -484,11 +484,16 @@ static void atmel_set_termios(struct uart_port *port, 
struct ktermios * termios,
unsigned long flags;
unsigned int mode, imr, quot, baud;
 
+   /* Get current mode register */
+   mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL | 
ATMEL_US_NBSTOP | ATMEL_US_PAR);
+
baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
quot = uart_get_divisor(port, baud);
 
-   /* Get current mode register */
-   mode = UART_GET_MR(port) & ~(ATMEL_US_CHRL | ATMEL_US_NBSTOP | 
ATMEL_US_PAR);
+   if (quot > 65535) { /* BRGR is 16-bit, so switch to slower 
clock */
+   quot /= 8;
+   mode |= ATMEL_US_USCLKS_MCK_DIV8;
+   }
 
/* byte size */
switch (termios->c_cflag & CSIZE) {
diff --git a/drivers/serial/atmel_serial.h b/drivers/serial/atmel_serial.h
index 11b4436..e014177 100644
--- a/drivers/serial/atmel_serial.h
+++ b/drivers/serial/atmel_serial.h
@@ -46,6 +46,9 @@
 #defineATMEL_US_USMODE_ISO7816_T1  6
 #defineATMEL_US_USMODE_IRDA8
 #defineATMEL_US_USCLKS (3   <<  4) /* 
Clock Selection */
+#defineATMEL_US_USCLKS_MCK (0 <<  4)
+#defineATMEL_US_USCLKS_MCK_DIV8(1 <<  4)
+#defineATMEL_US_USCLKS_SCK (3 <<  4)
 #defineATMEL_US_CHRL   (3   <<  6) /* 
Character Length */
 #defineATMEL_US_CHRL_5 (0 <<  6)
 #defineATMEL_US_CHRL_6 (1 <<  6)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4355/2: AT91: SAM9260-EK and SAM9263-EK board updates

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=93afa75230f5969d559386e52819f54bb1182327
Commit: 93afa75230f5969d559386e52819f54bb1182327
Parent: 03abeac0a222060ae8f02e8359c285df0971437e
Author: Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 14:39:41 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 17:42:42 2007 +0100

[ARM] 4355/2: AT91: SAM9260-EK and SAM9263-EK board updates

Various small changes for the Atmel AT91SAM9260-EK and AT91SAM9263-EK
boards.

SAM9260-EK:
  - Register I2C device.

SAM9263-EK:
  - Add platform_data and register MACB device.
(Patch by Nicolas Ferre)
  - Add platform_data and register AC97 device.
(Patch by Nicolas Ferre)
  - Register I2C device.

Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-at91/board-sam9260ek.c |6 --
 arch/arm/mach-at91/board-sam9263ek.c |   22 ++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-sam9260ek.c 
b/arch/arm/mach-at91/board-sam9260ek.c
index 7a31db0..65fa532 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -104,9 +104,9 @@ static struct spi_board_info ek_spi_devices[] = {
},
 #endif
 #endif
-#if defined(CONFIG_SND_AT73C213)
+#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
{   /* AT73C213 DAC */
-   .modalias   = "snd_at73c213",
+   .modalias   = "at73c213",
.chip_select= 0,
.max_speed_hz   = 10 * 1000 * 1000,
.bus_num= 1,
@@ -188,6 +188,8 @@ static void __init ek_board_init(void)
at91_add_device_eth(&ek_macb_data);
/* MMC */
at91_add_device_mmc(0, &ek_mmc_data);
+   /* I2C */
+   at91_add_device_i2c();
 }
 
 MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
diff --git a/arch/arm/mach-at91/board-sam9263ek.c 
b/arch/arm/mach-at91/board-sam9263ek.c
index 81d3d6a..f574585 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -157,6 +157,14 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
 
 
 /*
+ * MACB Ethernet device
+ */
+static struct at91_eth_data __initdata ek_macb_data = {
+   .is_rmii= 1,
+};
+
+
+/*
  * NAND flash
  */
 static struct mtd_partition __initdata ek_nand_partition[] = {
@@ -193,6 +201,14 @@ static struct at91_nand_data __initdata ek_nand_data = {
 };
 
 
+/*
+ * AC97
+ */
+static struct atmel_ac97_data ek_ac97_data = {
+   .reset_pin  = AT91_PIN_PA13,
+};
+
+
 static void __init ek_board_init(void)
 {
/* Serial */
@@ -208,8 +224,14 @@ static void __init ek_board_init(void)
ek_add_device_ts();
/* MMC */
at91_add_device_mmc(1, &ek_mmc_data);
+   /* Ethernet */
+   at91_add_device_eth(&ek_macb_data);
/* NAND */
at91_add_device_nand(&ek_nand_data);
+   /* I2C */
+   at91_add_device_i2c();
+   /* AC97 */
+   at91_add_device_ac97(&ek_ac97_data);
 }
 
 MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4257/2: Kconfig support for GENERIC_CLOCKEVENTS

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0567a0c022d5b343370a343121f38fd89925de55
Commit: 0567a0c022d5b343370a343121f38fd89925de55
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Kevin Hilman <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 13 20:29:24 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 21:02:21 2007 +0100

[ARM] 4257/2: Kconfig support for GENERIC_CLOCKEVENTS

This time with LEDS_TIMER set with !GENERIC_CLOCKEVENTS

Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]>
Acked-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/Kconfig |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e7baca2..2d13b01 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -29,6 +29,10 @@ config GENERIC_TIME
bool
default n
 
+config GENERIC_CLOCKEVENTS
+   bool
+   default n
+
 config MMU
bool
default y
@@ -513,6 +517,8 @@ endmenu
 
 menu "Kernel Features"
 
+source "kernel/time/Kconfig"
+
 config SMP
bool "Symmetric Multi-Processing (EXPERIMENTAL)"
depends on EXPERIMENTAL && REALVIEW_MPCORE
@@ -572,6 +578,7 @@ config PREEMPT
 
 config NO_IDLE_HZ
bool "Dynamic tick timer"
+   depends on !GENERIC_CLOCKEVENTS
help
  Select this option if you want to disable continuous timer ticks
  and have them programmed to occur as required. This option saves
@@ -669,6 +676,7 @@ config LEDS_TIMER
bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
MACH_OMAP_H2 || MACH_OMAP_PERSEUS2
depends on LEDS
+   depends on !GENERIC_CLOCKEVENTS
default y if ARCH_EBSA110
help
  If you say Y here, one of the system LEDs (the green one on the
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4258/2: Support for dynticks in idle loop

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e4559ddffc012a73ea0b54ed3b6a219c1483ae9
Commit: 9e4559ddffc012a73ea0b54ed3b6a219c1483ae9
Parent: 0567a0c022d5b343370a343121f38fd89925de55
Author: Kevin Hilman <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 14 17:33:24 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 21:02:25 2007 +0100

[ARM] 4258/2: Support for dynticks in idle loop

And, wrap timer_tick() and sysdev suspend/resume in
!GENERIC_CLOCKEVENTS since clockevent layer takes care
of these.

Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]>
Acked-by: Thomas Gleixner <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/process.c |3 +++
 arch/arm/kernel/time.c|4 +++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 8afd83d..5d6e652 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -159,9 +160,11 @@ void cpu_idle(void)
if (!idle)
idle = default_idle;
leds_event(led_idle_start);
+   tick_nohz_stop_sched_tick();
while (!need_resched())
idle();
leds_event(led_idle_end);
+   tick_nohz_restart_sched_tick();
preempt_enable_no_resched();
schedule();
preempt_disable();
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index f61decb..d0540e4 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -327,6 +327,7 @@ void restore_time_delta(struct timespec *delta, struct 
timespec *rtc)
 }
 EXPORT_SYMBOL(restore_time_delta);
 
+#ifndef CONFIG_GENERIC_CLOCKEVENTS
 /*
  * Kernel system timer support.
  */
@@ -340,8 +341,9 @@ void timer_tick(void)
update_process_times(user_mode(get_irq_regs()));
 #endif
 }
+#endif
 
-#ifdef CONFIG_PM
+#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS)
 static int timer_suspend(struct sys_device *dev, pm_message_t state)
 {
struct sys_timer *timer = container_of(dev, struct sys_timer, dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4259/1: clockevent support for ixp4xx platform

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e32f1502be3fa459723b1e4105e014f0828f7513
Commit: e32f1502be3fa459723b1e4105e014f0828f7513
Parent: 9e4559ddffc012a73ea0b54ed3b6a219c1483ae9
Author: Kevin Hilman <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 8 20:23:59 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 21:02:30 2007 +0100

[ARM] 4259/1: clockevent support for ixp4xx platform

Update ixp4xx timer support to use new clockevent infrastructure.

Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/Kconfig  |1 +
 arch/arm/mach-ixp4xx/common.c |   93 
 2 files changed, 75 insertions(+), 19 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2d13b01..2aadd0e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -266,6 +266,7 @@ config ARCH_IXP4XX
bool "IXP4xx-based"
depends on MMU
select GENERIC_TIME
+   select GENERIC_CLOCKEVENTS
help
  Support for Intel's IXP4XX (XScale) family of processors.
 
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 45068c3..09edea9 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -41,6 +42,8 @@
 #include 
 
 static int __init ixp4xx_clocksource_init(void);
+static int __init ixp4xx_clockevent_init(void);
+static struct clock_event_device clockevent_ixp4xx;
 
 /*
  * IXP4xx chipset I/O mapping
@@ -239,52 +242,40 @@ void __init ixp4xx_init_irq(void)
  * counter as a source of real clock ticks to account for missed jiffies.
  */
 
-static unsigned volatile last_jiffy_time;
-
-#define CLOCK_TICKS_PER_USEC   ((CLOCK_TICK_RATE + USEC_PER_SEC/2) / 
USEC_PER_SEC)
-
 static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
 {
-   write_seqlock(&xtime_lock);
+   struct clock_event_device *evt = &clockevent_ixp4xx;
 
/* Clear Pending Interrupt by writing '1' to it */
*IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
 
-   /*
-* Catch up with the real idea of time
-*/
-   while ((signed long)(*IXP4XX_OSTS - last_jiffy_time) >= LATCH) {
-   timer_tick();
-   last_jiffy_time += LATCH;
-   }
-
-   write_sequnlock(&xtime_lock);
+   evt->event_handler(evt);
 
return IRQ_HANDLED;
 }
 
 static struct irqaction ixp4xx_timer_irq = {
-   .name   = "IXP4xx Timer Tick",
+   .name   = "timer1",
.flags  = IRQF_DISABLED | IRQF_TIMER,
.handler= ixp4xx_timer_interrupt,
 };
 
 static void __init ixp4xx_timer_init(void)
 {
+   /* Reset/disable counter */
+   *IXP4XX_OSRT1 = 0;
+
/* Clear Pending Interrupt by writing '1' to it */
*IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
 
-   /* Setup the Timer counter value */
-   *IXP4XX_OSRT1 = (LATCH & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE;
-
/* Reset time-stamp counter */
*IXP4XX_OSTS = 0;
-   last_jiffy_time = 0;
 
/* Connect the interrupt handler and enable the interrupt */
setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq);
 
ixp4xx_clocksource_init();
+   ixp4xx_clockevent_init();
 }
 
 struct sys_timer ixp4xx_timer = {
@@ -384,6 +375,9 @@ void __init ixp4xx_sys_init(void)
ixp4xx_exp_bus_size >> 20);
 }
 
+/*
+ * clocksource
+ */
 cycle_t ixp4xx_get_cycles(void)
 {
return *IXP4XX_OSTS;
@@ -408,3 +402,64 @@ static int __init ixp4xx_clocksource_init(void)
 
return 0;
 }
+
+/*
+ * clockevents
+ */
+static int ixp4xx_set_next_event(unsigned long evt,
+struct clock_event_device *unused)
+{
+   unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK;
+
+   *IXP4XX_OSRT1 = (evt & ~IXP4XX_OST_RELOAD_MASK) | opts;
+
+   return 0;
+}
+
+static void ixp4xx_set_mode(enum clock_event_mode mode,
+   struct clock_event_device *evt)
+{
+   unsigned long opts, osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;
+
+   switch (mode) {
+   case CLOCK_EVT_MODE_PERIODIC:
+   osrt = LATCH & ~IXP4XX_OST_RELOAD_MASK;
+   opts = IXP4XX_OST_ENABLE;
+   break;
+   case CLOCK_EVT_MODE_ONESHOT:
+   /* period set by 'set next_event' */
+   osrt = 0;
+   opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT;
+   break;
+   case CLOCK_EVT_MODE_SHUTDOWN:
+   case CLOCK_EVT_MODE_UNUSED:
+   default:
+   osrt = opts = 0;
+   break;
+   }
+
+   *IXP4XX_OSRT1 = osrt | 

[ARM] 4260/1: clocksource support for Versatile platform

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b49c87c2a5059af14b68ee5f596ac0e9c93678bb
Commit: b49c87c2a5059af14b68ee5f596ac0e9c93678bb
Parent: e32f1502be3fa459723b1e4105e014f0828f7513
Author: Kevin Hilman <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 8 20:25:13 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 21:02:39 2007 +0100

[ARM] 4260/1: clocksource support for Versatile platform

Update Versatile to use new clocksource infrastructure for basic 
timekeeping.

Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/Kconfig   |1 +
 arch/arm/mach-versatile/core.c |   75 ++--
 2 files changed, 35 insertions(+), 41 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2aadd0e..cddd054 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -166,6 +166,7 @@ config ARCH_VERSATILE
select ARM_AMBA
select ARM_VIC
select ICST307
+   select GENERIC_TIME
help
  This enables support for ARM Ltd Versatile board.
 
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index bf71507..08a9fe6 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -829,46 +830,6 @@ void __init versatile_init(void)
 #endif
 
 /*
- * Returns number of ms since last clock interrupt.  Note that interrupts
- * will have been disabled by do_gettimeoffset()
- */
-static unsigned long versatile_gettimeoffset(void)
-{
-   unsigned long ticks1, ticks2, status;
-
-   /*
-* Get the current number of ticks.  Note that there is a race
-* condition between us reading the timer and checking for
-* an interrupt.  We get around this by ensuring that the
-* counter has not reloaded between our two reads.
-*/
-   ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0x;
-   do {
-   ticks1 = ticks2;
-   status = __raw_readl(VA_IC_BASE + VIC_RAW_STATUS);
-   ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0x;
-   } while (ticks2 > ticks1);
-
-   /*
-* Number of ticks since last interrupt.
-*/
-   ticks1 = TIMER_RELOAD - ticks2;
-
-   /*
-* Interrupt pending?  If so, we've reloaded once already.
-*
-* FIXME: Need to check this is effectively timer 0 that expires
-*/
-   if (status & IRQMASK_TIMERINT0_1)
-   ticks1 += TIMER_RELOAD;
-
-   /*
-* Convert the ticks to usecs
-*/
-   return TICKS2USECS(ticks1);
-}
-
-/*
  * IRQ handler for the timer
  */
 static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id)
@@ -891,6 +852,36 @@ static struct irqaction versatile_timer_irq = {
.handler= versatile_timer_interrupt,
 };
 
+static cycle_t versatile_get_cycles(void)
+{
+   return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
+}
+
+static struct clocksource clocksource_versatile = {
+   .name   = "timer3",
+   .rating = 200,
+   .read   = versatile_get_cycles,
+   .mask   = CLOCKSOURCE_MASK(32),
+   .shift  = 20,
+   .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+static int __init versatile_clocksource_init(void)
+{
+   /* setup timer3 as free-running clocksource */
+   writel(0, TIMER3_VA_BASE + TIMER_CTRL);
+   writel(0x, TIMER3_VA_BASE + TIMER_LOAD);
+   writel(0x, TIMER3_VA_BASE + TIMER_VALUE);
+   writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
+  TIMER3_VA_BASE + TIMER_CTRL);
+
+   clocksource_versatile.mult =
+   clocksource_khz2mult(1000, clocksource_versatile.shift);
+   clocksource_register(&clocksource_versatile);
+
+   return 0;
+}
+
 /*
  * Set up timer interrupt, and return the current time in seconds.
  */
@@ -927,9 +918,11 @@ static void __init versatile_timer_init(void)
 * Make irqs happen for the system timer
 */
setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq);
+
+   versatile_clocksource_init();
 }
 
 struct sys_timer versatile_timer = {
.init   = versatile_timer_init,
-   .offset = versatile_gettimeoffset,
 };
+
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4261/1: clockevent support for Versatile platform

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89df127246f23add865f4a8f719c990e41151843
Commit: 89df127246f23add865f4a8f719c990e41151843
Parent: b49c87c2a5059af14b68ee5f596ac0e9c93678bb
Author: Kevin Hilman <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 8 20:30:38 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 21:02:51 2007 +0100

[ARM] 4261/1: clockevent support for Versatile platform

Update Versatile platform to use new clockevent infrastructure.

Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/Kconfig   |1 +
 arch/arm/mach-versatile/core.c |   68 ++--
 2 files changed, 59 insertions(+), 10 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index cddd054..d1f24aa 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -167,6 +167,7 @@ config ARCH_VERSATILE
select ARM_VIC
select ICST307
select GENERIC_TIME
+   select GENERIC_CLOCKEVENTS
help
  This enables support for ARM Ltd Versatile board.
 
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 08a9fe6..1275aa7 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -829,19 +830,61 @@ void __init versatile_init(void)
 #define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
 #endif
 
+static void timer_set_mode(enum clock_event_mode mode,
+  struct clock_event_device *clk)
+{
+   unsigned long ctrl;
+
+   switch(mode) {
+   case CLOCK_EVT_MODE_PERIODIC:
+   writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
+
+   ctrl = TIMER_CTRL_PERIODIC;
+   ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE;
+   break;
+   case CLOCK_EVT_MODE_ONESHOT:
+   /* period set, and timer enabled in 'next_event' hook */
+   ctrl = TIMER_CTRL_ONESHOT;
+   ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE;
+   break;
+   case CLOCK_EVT_MODE_UNUSED:
+   case CLOCK_EVT_MODE_SHUTDOWN:
+   default:
+   ctrl = 0;
+   }
+
+   writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL);
+}
+
+static int timer_set_next_event(unsigned long evt,
+   struct clock_event_device *unused)
+{
+   unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL);
+
+   writel(evt, TIMER0_VA_BASE + TIMER_LOAD);
+   writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL);
+
+   return 0;
+}
+
+static struct clock_event_device timer0_clockevent ={
+   .name   = "timer0",
+   .shift  = 32,
+   .features   = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+   .set_mode   = timer_set_mode,
+   .set_next_event = timer_set_next_event,
+};
+
 /*
  * IRQ handler for the timer
  */
 static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id)
 {
-   write_seqlock(&xtime_lock);
+   struct clock_event_device *evt = &timer0_clockevent;
 
-   // ...clear the interrupt
writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
 
-   timer_tick();
-
-   write_sequnlock(&xtime_lock);
+   evt->event_handler(evt);
 
return IRQ_HANDLED;
 }
@@ -909,17 +952,22 @@ static void __init versatile_timer_init(void)
writel(0, TIMER2_VA_BASE + TIMER_CTRL);
writel(0, TIMER3_VA_BASE + TIMER_CTRL);
 
-   writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
-   writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_VALUE);
-   writel(TIMER_DIVISOR | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC |
-  TIMER_CTRL_IE, TIMER0_VA_BASE + TIMER_CTRL);
-
/* 
 * Make irqs happen for the system timer
 */
setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq);
 
versatile_clocksource_init();
+
+   timer0_clockevent.mult =
+   div_sc(100, NSEC_PER_SEC, timer0_clockevent.shift);
+   timer0_clockevent.max_delta_ns =
+   clockevent_delta2ns(0x, &timer0_clockevent);
+   timer0_clockevent.min_delta_ns =
+   clockevent_delta2ns(0xf, &timer0_clockevent);
+
+   timer0_clockevent.cpumask = cpumask_of_cpu(0);
+   clockevents_register_device(&timer0_clockevent);
 }
 
 struct sys_timer versatile_timer = {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4262/1: OMAP: clocksource and clockevent support

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=075192ae807579448afcc0833bd349ccce057825
Commit: 075192ae807579448afcc0833bd349ccce057825
Parent: 89df127246f23add865f4a8f719c990e41151843
Author: Kevin Hilman <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 8 20:32:19 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 21:02:55 2007 +0100

[ARM] 4262/1: OMAP: clocksource and clockevent support

Update OMAP1 to enable support for hrtimers and dynticks by using new 
clocksource and clockevent infrastructure.

Signed-off-by: Kevin Hilman <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/Kconfig  |1 +
 arch/arm/mach-omap1/time.c|  206 ++---
 arch/arm/plat-omap/Kconfig|1 +
 arch/arm/plat-omap/common.c   |   50 ++
 arch/arm/plat-omap/timer32k.c |  139 
 5 files changed, 224 insertions(+), 173 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d1f24aa..3116baf 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -370,6 +370,7 @@ config ARCH_LH7A40X
 config ARCH_OMAP
bool "TI OMAP"
select GENERIC_GPIO
+   select GENERIC_TIME
help
  Support for TI's OMAP platform (OMAP1 and OMAP2).
 
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 1b7e4a5..85e048b 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -39,6 +39,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -48,13 +52,7 @@
 #include 
 #include 
 
-struct sys_timer omap_timer;
 
-/*
- * ---
- * MPU timer
- * ---
- */
 #define OMAP_MPU_TIMER_BASEOMAP_MPU_TIMER1_BASE
 #define OMAP_MPU_TIMER_OFFSET  0x100
 
@@ -88,21 +86,6 @@ static inline unsigned long long cycles_2_ns(unsigned long 
long cyc)
return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
 }
 
-/*
- * MPU_TICKS_PER_SEC must be an even number, otherwise machinecycles_to_usecs
- * will break. On P2, the timer count rate is 6.5 MHz after programming PTV
- * with 0. This divides the 13MHz input by 2, and is undocumented.
- */
-#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE)
-/* REVISIT: This ifdef construct should be replaced by a query to clock
- * framework to see if timer base frequency is 12.0, 13.0 or 19.2 MHz.
- */
-#define MPU_TICKS_PER_SEC  (1300 / 2)
-#else
-#define MPU_TICKS_PER_SEC  (1200 / 2)
-#endif
-
-#define MPU_TIMER_TICK_PERIOD  ((MPU_TICKS_PER_SEC / HZ) - 1)
 
 typedef struct {
u32 cntl;   /* CNTL_TIMER, R/W */
@@ -120,98 +103,164 @@ static inline unsigned long omap_mpu_timer_read(int nr)
return timer->read_tim;
 }
 
-static inline void omap_mpu_timer_start(int nr, unsigned long load_val)
+static inline void omap_mpu_set_autoreset(int nr)
 {
volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
 
-   timer->cntl = MPU_TIMER_CLOCK_ENABLE;
-   udelay(1);
-   timer->load_tim = load_val;
-udelay(1);
-   timer->cntl = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_AR | MPU_TIMER_ST);
+   timer->cntl = timer->cntl | MPU_TIMER_AR;
 }
 
-unsigned long omap_mpu_timer_ticks_to_usecs(unsigned long nr_ticks)
+static inline void omap_mpu_remove_autoreset(int nr)
 {
-   unsigned long long nsec;
+   volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
 
-   nsec = cycles_2_ns((unsigned long long)nr_ticks);
-   return (unsigned long)nsec / 1000;
+   timer->cntl = timer->cntl & ~MPU_TIMER_AR;
 }
 
-/*
- * Last processed system timer interrupt
- */
-static unsigned long omap_mpu_timer_last = 0;
+static inline void omap_mpu_timer_start(int nr, unsigned long load_val,
+   int autoreset)
+{
+   volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
+   unsigned int timerflags = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST);
+
+   if (autoreset) timerflags |= MPU_TIMER_AR;
+
+   timer->cntl = MPU_TIMER_CLOCK_ENABLE;
+   udelay(1);
+   timer->load_tim = load_val;
+udelay(1);
+   timer->cntl = timerflags;
+}
 
 /*
- * Returns elapsed usecs since last system timer interrupt
+ * ---
+ * MPU timer 1 ... count down to zero, interrupt, reload
+ * ---
  */
-static unsigned long omap_mpu_timer_gettimeoffset(void)
+static int omap_mpu_set_next_event(unsigned long cycles,
+   struct clock_event_device *evt)
 {
-   unsigned long now = 0 - omap_mpu_timer

[ARM] 4328/1: Move i.MX UART regs to driver

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ff4bfb2163e8914332267be3758eb28239460316
Commit: ff4bfb2163e8914332267be3758eb28239460316
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Sascha Hauer <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 08:26:13 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 20:24:21 2007 +0100

[ARM] 4328/1: Move i.MX UART regs to driver

This patch moves the i.MX UART register descriptions from
include/asm-arm/arch-imx/imx-regs.h to the serial driver itself.
This helps using the driver on other architectures like mx31

Signed-off-by: Sascha Hauer <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 drivers/serial/imx.c|  268 ++
 include/asm-arm/arch-imx/imx-regs.h |  118 ---
 2 files changed, 205 insertions(+), 181 deletions(-)

diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 04cc88c..e42faa4 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -46,6 +46,122 @@
 #include 
 #include 
 
+/* Register definitions */
+#define URXD0 0x0  /* Receiver Register */
+#define URTX0 0x40 /* Transmitter Register */
+#define UCR1  0x80 /* Control Register 1 */
+#define UCR2  0x84 /* Control Register 2 */
+#define UCR3  0x88 /* Control Register 3 */
+#define UCR4  0x8c /* Control Register 4 */
+#define UFCR  0x90 /* FIFO Control Register */
+#define USR1  0x94 /* Status Register 1 */
+#define USR2  0x98 /* Status Register 2 */
+#define UESC  0x9c /* Escape Character Register */
+#define UTIM  0xa0 /* Escape Timer Register */
+#define UBIR  0xa4 /* BRM Incremental Register */
+#define UBMR  0xa8 /* BRM Modulator Register */
+#define UBRC  0xac /* Baud Rate Count Register */
+#define BIPR1 0xb0 /* Incremental Preset Register 1 */
+#define BIPR2 0xb4 /* Incremental Preset Register 2 */
+#define BIPR3 0xb8 /* Incremental Preset Register 3 */
+#define BIPR4 0xbc /* Incremental Preset Register 4 */
+#define BMPR1 0xc0 /* BRM Modulator Register 1 */
+#define BMPR2 0xc4 /* BRM Modulator Register 2 */
+#define BMPR3 0xc8 /* BRM Modulator Register 3 */
+#define BMPR4 0xcc /* BRM Modulator Register 4 */
+#define UTS   0xd0 /* UART Test Register */
+
+/* UART Control Register Bit Fields.*/
+#define  URXD_CHARRDY(1<<15)
+#define  URXD_ERR(1<<14)
+#define  URXD_OVRRUN (1<<13)
+#define  URXD_FRMERR (1<<12)
+#define  URXD_BRK(1<<11)
+#define  URXD_PRERR  (1<<10)
+#define  UCR1_ADEN   (1<<15) /* Auto dectect interrupt */
+#define  UCR1_ADBR   (1<<14) /* Auto detect baud rate */
+#define  UCR1_TRDYEN (1<<13) /* Transmitter ready interrupt enable */
+#define  UCR1_IDEN   (1<<12) /* Idle condition interrupt */
+#define  UCR1_RRDYEN (1<<9) /* Recv ready interrupt enable */
+#define  UCR1_RDMAEN (1<<8) /* Recv ready DMA enable */
+#define  UCR1_IREN   (1<<7) /* Infrared interface enable */
+#define  UCR1_TXMPTYEN   (1<<6) /* Transimitter empty interrupt enable 
*/
+#define  UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */
+#define  UCR1_SNDBRK (1<<4) /* Send break */
+#define  UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */
+#define  UCR1_UARTCLKEN  (1<<2) /* UART clock enabled */
+#define  UCR1_DOZE   (1<<1) /* Doze */
+#define  UCR1_UARTEN (1<<0) /* UART enabled */
+#define  UCR2_ESCI  (1<<15) /* Escape seq interrupt enable */
+#define  UCR2_IRTS  (1<<14) /* Ignore RTS pin */
+#define  UCR2_CTSC  (1<<13) /* CTS pin control */
+#define  UCR2_CTS(1<<12) /* Clear to send */
+#define  UCR2_ESCEN  (1<<11) /* Escape enable */
+#define  UCR2_PREN   (1<<8)  /* Parity enable */
+#define  UCR2_PROE   (1<<7)  /* Parity odd/even */
+#define  UCR2_STPB   (1<<6) /* Stop */
+#define  UCR2_WS (1<<5) /* Word size */
+#define  UCR2_RTSEN  (1<<4) /* Request to send interrupt enable */
+#define  UCR2_TXEN   (1<<2) /* Transmitter enabled */
+#define  UCR2_RXEN   (1<<1) /* Receiver enabled */
+#define  UCR2_SRST  (1<<0)  /* SW reset */
+#define  UCR3_DTREN (1<<13) /* DTR interrupt enable */
+#define  UCR3_PARERREN   (1<<12) /* Parity enable */
+#define  UCR3_FRAERREN   (1<<11) /* Frame error interrupt enable */
+#define  UCR3_DSR(1<<10) /* Data set ready */
+#define  UCR3_DCD(1<<9)  /* Data carrier detect */
+#define  UCR3_RI (1<<8)  /* Ring indicator */
+#define  UCR3_TIMEOUTEN  (1<<7)  /* Timeout interrupt enable */
+#define  UCR3_RXDSEN(1<<6)  /* Receive status interrupt enable */
+#define  UCR3_AIRINTEN   (1<<5)  /* Async IR wake interrupt enable */
+#define  UCR3_AWAKEN(1<<4)  /* Async wake interrupt enable */
+#define  UCR3_REF25 (1<<3)  /* Ref freq 25 MHz */
+#define  UCR3_REF30 (1<<2)  

[ARM] 4340/1: iop: fix iop_getttimeoffset

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8903fcce9b91bab6bb98adbb57a4edfc372c8bff
Commit: 8903fcce9b91bab6bb98adbb57a4edfc372c8bff
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 29 09:31:21 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Apr 30 15:24:47 2007 +0100

[ARM] 4340/1: iop: fix iop_getttimeoffset

Fix a typo which causes a necessary cpwait to be missed on iop3xx, Michael
Brunner <[EMAIL PROTECTED]>

Save a register in the assembly routine, rmk

Cc: Lennert Buytenhek <[EMAIL PROTECTED]>
Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-iop/time.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 16300ad..0cc26da 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -32,22 +32,22 @@ static unsigned long next_jiffy_time;
 
 unsigned long iop_gettimeoffset(void)
 {
-   unsigned long offset, temp1, temp2;
+   unsigned long offset, temp;
 
/* enable cp6, if necessary, to avoid taking the overhead of an
 * undefined instruction trap
 */
asm volatile (
"mrcp15, 0, %0, c15, c1, 0\n\t"
-   "ands   %1, %0, #(1 << 6)\n\t"
+   "tst%0, #(1 << 6)\n\t"
"orreq  %0, %0, #(1 << 6)\n\t"
"mcreq  p15, 0, %0, c15, c1, 0\n\t"
-#ifdef CONFIG_XSCALE
+#ifdef CONFIG_CPU_XSCALE
"mrceq  p15, 0, %0, c15, c1, 0\n\t"
"moveq  %0, %0\n\t"
"subeq  pc, pc, #4\n\t"
 #endif
-   : "=r"(temp1), "=r"(temp2) : : "cc");
+   : "=r"(temp) : : "cc");
 
offset = next_jiffy_time - read_tcr1();
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4341/1: iop13xx: fix i/o address translation

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7dcad376e85b6eff56f29ee21e10e1fe855f1ed7
Commit: 7dcad376e85b6eff56f29ee21e10e1fe855f1ed7
Parent: 8903fcce9b91bab6bb98adbb57a4edfc372c8bff
Author: Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 29 09:31:51 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Apr 30 15:24:50 2007 +0100

[ARM] 4341/1: iop13xx: fix i/o address translation

PCI devices were being programmed with an incorrect base address value.
This patch moves I/O space into a 16-bit addressable region and corrects
the i/o offset.

Much thanks to Martin Michlmayr for tracking this issue and testing
debug patches.

Cc: Martin Michlmayr <[EMAIL PROTECTED]>
Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-iop13xx/pci.c|8 
 include/asm-arm/arch-iop13xx/iop13xx.h |   22 +-
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 89ec70e..d907a2a 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -1023,7 +1023,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
  << IOP13XX_ATUX_PCIXSR_FUNC_NUM;
__raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR);
 
-   res[0].start = IOP13XX_PCIX_LOWER_IO_PA;
+   res[0].start = IOP13XX_PCIX_LOWER_IO_PA + 
IOP13XX_PCIX_IO_BUS_OFFSET;
res[0].end   = IOP13XX_PCIX_UPPER_IO_PA;
res[0].name  = "IQ81340 ATUX PCI I/O Space";
res[0].flags = IORESOURCE_IO;
@@ -1033,7 +1033,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
res[1].name  = "IQ81340 ATUX PCI Memory Space";
res[1].flags = IORESOURCE_MEM;
sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET;
-   sys->io_offset = IOP13XX_PCIX_IO_OFFSET;
+   sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA;
break;
case IOP13XX_INIT_ATU_ATUE:
/* Note: the function number field in the PCSR is ro */
@@ -1044,7 +1044,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
 
__raw_writel(pcsr, IOP13XX_ATUE_PCSR);
 
-   res[0].start = IOP13XX_PCIE_LOWER_IO_PA;
+   res[0].start = IOP13XX_PCIE_LOWER_IO_PA + 
IOP13XX_PCIE_IO_BUS_OFFSET;
res[0].end   = IOP13XX_PCIE_UPPER_IO_PA;
res[0].name  = "IQ81340 ATUE PCI I/O Space";
res[0].flags = IORESOURCE_IO;
@@ -1054,7 +1054,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
res[1].name  = "IQ81340 ATUE PCI Memory Space";
res[1].flags = IORESOURCE_MEM;
sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET;
-   sys->io_offset = IOP13XX_PCIE_IO_OFFSET;
+   sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA;
sys->map_irq = iop13xx_pcie_map_irq;
break;
default:
diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h 
b/include/asm-arm/arch-iop13xx/iop13xx.h
index d26b755..2d1e23b 100644
--- a/include/asm-arm/arch-iop13xx/iop13xx.h
+++ b/include/asm-arm/arch-iop13xx/iop13xx.h
@@ -27,19 +27,24 @@ static inline int iop13xx_cpu_id(void)
 #define IOP13XX_PCI_OFFSET  IOP13XX_MAX_RAM_SIZE
 
 /* PCI MAP
- * 0x. - 0x8000.   1:1 mapping with Physical RAM
- * 0x8000. - 0x8800.   PCIX/PCIE memory window (128MB)
-*/
+ * bus range   cpu physcpu virtnote
+ * 0x. + 2GB   (n/a)   (n/a)   inbound, 1:1 mapping 
with Physical RAM
+ * 0x8000. + 928M  0x1.8000.   (ioremap)   PCIX outbound memory 
window
+ * 0x8000. + 928M  0x2.8000.   (ioremap)   PCIE outbound memory 
window
+ *
+ * IO MAP
+ * 0x1000 + 64K0x0.fffb.1000   0xfec6.1000 PCIX outbound i/o window
+ * 0x1000 + 64K0x0.fffd.1000   0xfed7.1000 PCIE outbound i/o window
+ */
 #define IOP13XX_PCIX_IO_WINDOW_SIZE   0x1UL
 #define IOP13XX_PCIX_LOWER_IO_PA  0xfffbUL
 #define IOP13XX_PCIX_LOWER_IO_VA  0xfec6UL
-#define IOP13XX_PCIX_LOWER_IO_BA  0x0fffUL
+#define IOP13XX_PCIX_LOWER_IO_BA  0x0UL /* OIOTVR */
+#define IOP13XX_PCIX_IO_BUS_OFFSET0x1000UL
 #define IOP13XX_PCIX_UPPER_IO_PA  (IOP13XX_PCIX_LOWER_IO_PA +\
   IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
 #define IOP13XX_PCIX_UPPER_IO_VA  (IOP13XX_PCIX_LOWER_IO_VA +\
   IOP13XX_PCIX_IO_WINDOW_SIZE - 1)
-#define IOP13XX_PCIX_IO_OFFSET(IOP13XX_PCIX_LOWER_IO_VA -\
-  IOP13XX_PCIX_LOWER_IO_BA)
 #define IOP13XX_PCIX_IO_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
   (IOP13XX

[ARM] 4343/1: iop13xx: automatically detect the internal bus frequency

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=84c981ffb371828ad6d1d220f076453b54734302
Commit: 84c981ffb371828ad6d1d220f076453b54734302
Parent: 7dcad376e85b6eff56f29ee21e10e1fe855f1ed7
Author: Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 29 09:32:51 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Apr 30 15:24:54 2007 +0100

[ARM] 4343/1: iop13xx: automatically detect the internal bus frequency

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-iop13xx/iq81340mc.c  |4 ++-
 arch/arm/mach-iop13xx/iq81340sc.c  |4 ++-
 include/asm-arm/arch-iop13xx/iop13xx.h |1 +
 include/asm-arm/arch-iop13xx/time.h|   56 
 4 files changed, 63 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-iop13xx/iq81340mc.c 
b/arch/arm/mach-iop13xx/iq81340mc.c
index a519d70..1ae08cc 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -79,7 +79,9 @@ static void __init iq81340mc_init(void)
 
 static void __init iq81340mc_timer_init(void)
 {
-   iop_init_time(4);
+   unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
+   printk(KERN_DEBUG "%s: bus frequency: %lu\n", __FUNCTION__, bus_freq);
+   iop_init_time(bus_freq);
 }
 
 static struct sys_timer iq81340mc_timer = {
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c 
b/arch/arm/mach-iop13xx/iq81340sc.c
index 0e71fbc..0f88014 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -81,7 +81,9 @@ static void __init iq81340sc_init(void)
 
 static void __init iq81340sc_timer_init(void)
 {
-   iop_init_time(4);
+   unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
+   printk(KERN_DEBUG "%s: bus frequency: %lu\n", __FUNCTION__, bus_freq);
+   iop_init_time(bus_freq);
 }
 
 static struct sys_timer iq81340sc_timer = {
diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h 
b/include/asm-arm/arch-iop13xx/iop13xx.h
index 2d1e23b..c8762ae 100644
--- a/include/asm-arm/arch-iop13xx/iop13xx.h
+++ b/include/asm-arm/arch-iop13xx/iop13xx.h
@@ -455,4 +455,5 @@ static inline int iop13xx_cpu_id(void)
 #define IOP13XX_PBI_BAR1   IOP13XX_PBI_OFFSET(0x10)
 #define IOP13XX_PBI_LR1IOP13XX_PBI_OFFSET(0x14)
 
+#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180)
 #endif /* _IOP13XX_HW_H_ */
diff --git a/include/asm-arm/arch-iop13xx/time.h 
b/include/asm-arm/arch-iop13xx/time.h
index 77a837a..49213d9 100644
--- a/include/asm-arm/arch-iop13xx/time.h
+++ b/include/asm-arm/arch-iop13xx/time.h
@@ -7,9 +7,65 @@
 #define IOP_TMR_PRIVILEGED 0x08
 #define IOP_TMR_RATIO_1_1  0x00
 
+#define IOP13XX_XSI_FREQ_RATIO_MASK(3 << 19)
+#define IOP13XX_XSI_FREQ_RATIO_2   (0 << 19)
+#define IOP13XX_XSI_FREQ_RATIO_3   (1 << 19)
+#define IOP13XX_XSI_FREQ_RATIO_4   (2 << 19)
+#define IOP13XX_CORE_FREQ_MASK (7 << 16)
+#define IOP13XX_CORE_FREQ_600  (0 << 16)
+#define IOP13XX_CORE_FREQ_667  (1 << 16)
+#define IOP13XX_CORE_FREQ_800  (2 << 16)
+#define IOP13XX_CORE_FREQ_933  (3 << 16)
+#define IOP13XX_CORE_FREQ_1000 (4 << 16)
+#define IOP13XX_CORE_FREQ_1200 (5 << 16)
+
 void iop_init_time(unsigned long tickrate);
 unsigned long iop_gettimeoffset(void);
 
+static inline unsigned long iop13xx_core_freq(void)
+{
+   unsigned long freq = __raw_readl(IOP13XX_PROCESSOR_FREQ);
+   freq &= IOP13XX_CORE_FREQ_MASK;
+   switch (freq) {
+   case IOP13XX_CORE_FREQ_600:
+   return 6;
+   case IOP13XX_CORE_FREQ_667:
+   return 66700;
+   case IOP13XX_CORE_FREQ_800:
+   return 8;
+   case IOP13XX_CORE_FREQ_933:
+   return 93300;
+   case IOP13XX_CORE_FREQ_1000:
+   return 10;
+   case IOP13XX_CORE_FREQ_1200:
+   return 12;
+   default:
+   printk("%s: warning unknown frequency, defaulting to 800Mhz\n",
+   __FUNCTION__);
+   }
+
+   return 8;
+}
+
+static inline unsigned long iop13xx_xsi_bus_ratio(void)
+{
+   unsigned long  ratio = __raw_readl(IOP13XX_PROCESSOR_FREQ);
+   ratio &= IOP13XX_XSI_FREQ_RATIO_MASK;
+   switch (ratio) {
+   case IOP13XX_XSI_FREQ_RATIO_2:
+   return 2;
+   case IOP13XX_XSI_FREQ_RATIO_3:
+   return 3;
+   case IOP13XX_XSI_FREQ_RATIO_4:
+   return 4;
+   default:
+   printk("%s: warning unknown ratio, defaulting to 2\n",
+   __FUNCTION__);
+   }
+
+   return 2;
+}
+
 static inline void write_tmr0(u32 val)
 {
asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-

[ARM] 4344/1: iop13xx: do not claim both uarts by default on iop342

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa543f005de175080640266ca536d45b4b0b1a61
Commit: fa543f005de175080640266ca536d45b4b0b1a61
Parent: 84c981ffb371828ad6d1d220f076453b54734302
Author: Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 29 09:33:22 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Apr 30 15:24:56 2007 +0100

[ARM] 4344/1: iop13xx: do not claim both uarts by default on iop342

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-iop13xx/setup.c |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
index 9a46bcd..bc48715 100644
--- a/arch/arm/mach-iop13xx/setup.c
+++ b/arch/arm/mach-iop13xx/setup.c
@@ -258,15 +258,11 @@ void __init iop13xx_platform_init(void)
 
if (init_uart == IOP13XX_INIT_UART_DEFAULT) {
switch (iop13xx_dev_id()) {
-   /* enable both uarts on iop341 and iop342 */
+   /* enable both uarts on iop341 */
case 0x3380:
case 0x3384:
case 0x3388:
case 0x338c:
-   case 0x3382:
-   case 0x3386:
-   case 0x338a:
-   case 0x338e:
init_uart |= IOP13XX_INIT_UART_0;
init_uart |= IOP13XX_INIT_UART_1;
break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4348/4: iop3xx: Give Linux control over PCI initialization

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e90ddd813df7897af34226ed1cd442f7a182816e
Commit: e90ddd813df7897af34226ed1cd442f7a182816e
Parent: fa543f005de175080640266ca536d45b4b0b1a61
Author: Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 17:59:44 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:02:48 2007 +0100

[ARM] 4348/4:  iop3xx: Give Linux control over PCI initialization

Currently the iop3xx platform support code assumes that RedBoot is the
bootloader and has already initialized the ATU.  Linux should handle this
initialization for three reasons:

1/ The memory map that RedBoot sets up is not optimal (page_to_dma and
virt_to_phys return different addresses).  The effect of this is that using
the dma mapping API for the internal bus dma units generates pci bus
addresses that are incorrect for the internal bus.

2/ Not all iop platforms use RedBoot

3/ If the ATU is already initialized it indicates that the iop is an add-in
card in another host, it does not own the PCI bus, and should not be
re-initialized.

Changelog:
* rather than change nr_controllers to zero, simply do not call
  pci_common_init

Cc: Lennert Buytenhek <[EMAIL PROTECTED]>
Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-iop32x/Kconfig |8 ++
 arch/arm/mach-iop32x/iq31244.c   |   11 ++-
 arch/arm/mach-iop32x/iq80321.c   |3 +-
 arch/arm/mach-iop33x/Kconfig |8 ++
 arch/arm/mach-iop33x/iq80331.c   |3 +-
 arch/arm/mach-iop33x/iq80332.c   |3 +-
 arch/arm/plat-iop/pci.c  |  140 +-
 include/asm-arm/arch-iop32x/iop32x.h |9 ++
 include/asm-arm/arch-iop32x/memory.h |4 +-
 include/asm-arm/arch-iop33x/iop33x.h |   10 +++
 include/asm-arm/arch-iop33x/memory.h |4 +-
 include/asm-arm/hardware/iop3xx.h|   22 +-
 12 files changed, 209 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-iop32x/Kconfig b/arch/arm/mach-iop32x/Kconfig
index 9dd49cf..9bb02b6 100644
--- a/arch/arm/mach-iop32x/Kconfig
+++ b/arch/arm/mach-iop32x/Kconfig
@@ -34,6 +34,14 @@ config MACH_N2100
  Say Y here if you want to run your kernel on the Thecus n2100
  NAS appliance.
 
+config IOP3XX_ATU
+bool "Enable the PCI Controller"
+default y
+help
+  Say Y here if you want the IOP to initialize its PCI Controller.
+  Say N if the IOP is an add in card, the host system owns the PCI
+  bus in this case.
+
 endmenu
 
 endif
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index 60e7430..7b21c6e 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -178,9 +178,10 @@ static struct hw_pci iq31244_pci __initdata = {
 
 static int __init iq31244_pci_init(void)
 {
-   if (is_ep80219())
-   pci_common_init(&ep80219_pci);
-   else if (machine_is_iq31244()) {
+   if (is_ep80219()) {
+   if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
+   pci_common_init(&ep80219_pci);
+   } else if (machine_is_iq31244()) {
if (is_80219()) {
printk("note: iq31244 board type has been selected\n");
printk("note: to select ep80219 operation:\n");
@@ -189,7 +190,9 @@ static int __init iq31244_pci_init(void)
printk("\t2/ update boot loader to pass"
" the ep80219 id: %d\n", MACH_TYPE_EP80219);
}
-   pci_common_init(&iq31244_pci);
+
+   if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
+   pci_common_init(&iq31244_pci);
}
 
return 0;
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index 361c70c..bc25fb9 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -113,7 +113,8 @@ static struct hw_pci iq80321_pci __initdata = {
 
 static int __init iq80321_pci_init(void)
 {
-   if (machine_is_iq80321())
+   if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
+   machine_is_iq80321())
pci_common_init(&iq80321_pci);
 
return 0;
diff --git a/arch/arm/mach-iop33x/Kconfig b/arch/arm/mach-iop33x/Kconfig
index 9aa016b..45598e0 100644
--- a/arch/arm/mach-iop33x/Kconfig
+++ b/arch/arm/mach-iop33x/Kconfig
@@ -16,6 +16,14 @@ config MACH_IQ80332
  Say Y here if you want to run your kernel on the Intel IQ80332
  evaluation kit for the IOP332 chipset.
 
+config IOP3XX_ATU
+   bool "Enable the PCI Controller"
+   default y
+   help
+ Say Y here if you want the IOP to initialize its PCI Controller.
+ Say N if the IOP is an add in card, 

[ARM] 4342/2: iop13xx: add resource definitions for the tpmi units

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d2dd8b1fed314d22c50965f78f6895117c4abfc8
Commit: d2dd8b1fed314d22c50965f78f6895117c4abfc8
Parent: e90ddd813df7897af34226ed1cd442f7a182816e
Author: Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 17:47:47 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:03:54 2007 +0100

[ARM] 4342/2:  iop13xx: add resource definitions for the tpmi units

The tpmi units interface with the SAS controller on iop348.

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-iop13xx/Makefile |1 +
 arch/arm/mach-iop13xx/iq81340mc.c  |1 +
 arch/arm/mach-iop13xx/iq81340sc.c  |1 +
 arch/arm/mach-iop13xx/tpmi.c   |  234 
 include/asm-arm/arch-iop13xx/iop13xx.h |1 +
 5 files changed, 238 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-iop13xx/Makefile b/arch/arm/mach-iop13xx/Makefile
index 4185e05..da1609d 100644
--- a/arch/arm/mach-iop13xx/Makefile
+++ b/arch/arm/mach-iop13xx/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_ARCH_IOP13XX) += setup.o
 obj-$(CONFIG_ARCH_IOP13XX) += irq.o
 obj-$(CONFIG_ARCH_IOP13XX) += pci.o
 obj-$(CONFIG_ARCH_IOP13XX) += io.o
+obj-$(CONFIG_ARCH_IOP13XX) += tpmi.o
 obj-$(CONFIG_MACH_IQ81340SC) += iq81340sc.o
 obj-$(CONFIG_MACH_IQ81340MC) += iq81340mc.o
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c 
b/arch/arm/mach-iop13xx/iq81340mc.c
index 1ae08cc..268a8d8 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -75,6 +75,7 @@ static void __init iq81340mc_init(void)
 {
iop13xx_platform_init();
iq81340mc_pci_init();
+   iop13xx_add_tpmi_devices();
 }
 
 static void __init iq81340mc_timer_init(void)
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c 
b/arch/arm/mach-iop13xx/iq81340sc.c
index 0f88014..a51ffd2 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -77,6 +77,7 @@ static void __init iq81340sc_init(void)
 {
iop13xx_platform_init();
iq81340sc_pci_init();
+   iop13xx_add_tpmi_devices();
 }
 
 static void __init iq81340sc_timer_init(void)
diff --git a/arch/arm/mach-iop13xx/tpmi.c b/arch/arm/mach-iop13xx/tpmi.c
new file mode 100644
index 000..d3dc278
--- /dev/null
+++ b/arch/arm/mach-iop13xx/tpmi.c
@@ -0,0 +1,234 @@
+/*
+ * iop13xx tpmi device resources
+ * Copyright (c) 2005-2006, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* assumes CONTROLLER_ONLY# is never asserted in the ESSR register */
+#define IOP13XX_TPMI_MMR(dev)  IOP13XX_REG_ADDR32_PHYS(0x48000 + (dev << 12))
+#define IOP13XX_TPMI_MEM(dev)  IOP13XX_REG_ADDR32_PHYS(0x6 + (dev << 13))
+#define IOP13XX_TPMI_CTRL(dev) IOP13XX_REG_ADDR32_PHYS(0x5 + (dev << 10))
+#define IOP13XX_TPMI_MMR_SIZE  (SZ_4K - 1)
+#define IOP13XX_TPMI_MEM_SIZE  (255)
+#define IOP13XX_TPMI_MEM_CTRL  (SZ_1K - 1)
+#define IOP13XX_TPMI_RESOURCE_MMR  0
+#define IOP13XX_TPMI_RESOURCE_MEM  1
+#define IOP13XX_TPMI_RESOURCE_CTRL 2
+#define IOP13XX_TPMI_RESOURCE_IRQ  3
+
+static struct resource iop13xx_tpmi_0_resources[] = {
+   [IOP13XX_TPMI_RESOURCE_MMR] = {
+   .start = IOP13XX_TPMI_MMR(4), /* tpmi0 starts at dev == 4 */
+   .end = IOP13XX_TPMI_MMR(4) + IOP13XX_TPMI_MMR_SIZE,
+   .flags = IORESOURCE_MEM,
+   },
+   [IOP13XX_TPMI_RESOURCE_MEM] = {
+   .start = IOP13XX_TPMI_MEM(0),
+   .end = IOP13XX_TPMI_MEM(0) + IOP13XX_TPMI_MEM_SIZE,
+   .flags = IORESOURCE_MEM,
+   },
+   [IOP13XX_TPMI_RESOURCE_CTRL] = {
+   .start = IOP13XX_TPMI_CTRL(0),
+   .end = IOP13XX_TPMI_CTRL(0) + IOP13XX_TPMI_MEM_CTRL,
+   .flags = IORESOURCE_MEM,
+   },
+   [IOP13XX_TPMI_RESOURCE_IRQ] = {
+   .start = IRQ_IOP13XX_TPMI0_OUT,
+   .end = IRQ_IOP13XX_TPMI0_OUT,
+   .flags = IORESOURCE_IRQ
+   }
+};
+
+static struct resource iop13xx_tpmi_1_resources[] = {
+   [IOP13XX_TPMI_RESOURCE_MMR] = {
+   .start = IOP13XX_TPMI_MMR(1),
+   .end = IOP13XX_TPMI_MMR(1)

[ARM] iop: add missing parens in macro

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad902cb9e29a4d6ff155f682ae79d8d8b2b73a9b
Commit: ad902cb9e29a4d6ff155f682ae79d8d8b2b73a9b
Parent: d2dd8b1fed314d22c50965f78f6895117c4abfc8
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat May 5 11:59:13 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 11:59:13 2007 +0100

[ARM] iop: add missing parens in macro

Fix:

 drivers/serial/8250.c:1837: warning: suggest parentheses around arithmetic 
in operand of |

due to a macro argument being used without required parenthesis.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/hardware/iop3xx.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-arm/hardware/iop3xx.h 
b/include/asm-arm/hardware/iop3xx.h
index ebbcd9b..63feceb 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -42,7 +42,7 @@ extern int init_atu;
IOP3XX_PERIPHERAL_SIZE - 1)
 #define IOP3XX_PERIPHERAL_UPPER_VA (IOP3XX_PERIPHERAL_VIRT_BASE +\
IOP3XX_PERIPHERAL_SIZE - 1)
-#define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) addr -\
+#define IOP3XX_PMMR_PHYS_TO_VIRT(addr) (u32) ((u32) (addr) -\
(IOP3XX_PERIPHERAL_PHYS_BASE\
- IOP3XX_PERIPHERAL_VIRT_BASE))
 #define IOP3XX_REG_ADDR(reg)   (IOP3XX_PERIPHERAL_VIRT_BASE + (reg))
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Remove unnecessary asm/ptrace.h from VFP support code

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7531a1c2c4477f63688871c1648d828f55313d42
Commit: 7531a1c2c4477f63688871c1648d828f55313d42
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 22 10:56:40 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sun Apr 22 10:56:40 2007 +0100

[ARM] Remove unnecessary asm/ptrace.h from VFP support code

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/vfp/vfpdouble.c |1 -
 arch/arm/vfp/vfpsingle.c |1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index e44b9ed..74e89f8 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -34,7 +34,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include "vfpinstr.h"
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c
index 0221ba3..b252631 100644
--- a/arch/arm/vfp/vfpsingle.c
+++ b/arch/arm/vfp/vfpsingle.c
@@ -34,7 +34,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include "vfpinstr.h"
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Convert AMBA PL010 driver to use 'uart_amba_port'

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b0646a033c370d6c7f5390f2cb452cc1884bb5b
Commit: 1b0646a033c370d6c7f5390f2cb452cc1884bb5b
Parent: 7531a1c2c4477f63688871c1648d828f55313d42
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 22 11:55:59 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sun Apr 22 11:55:59 2007 +0100

[ARM] Convert AMBA PL010 driver to use 'uart_amba_port'

Use a pointer to struct uart_amba_port throughout the driver
rather than a mixture of that and struct uart_port.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 drivers/serial/amba-pl010.c |  258 ++-
 1 files changed, 134 insertions(+), 124 deletions(-)

diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index f69bd09..ea49aaf 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -77,73 +77,77 @@ struct uart_amba_port {
 
 static void pl010_stop_tx(struct uart_port *port)
 {
+   struct uart_amba_port *uap = (struct uart_amba_port *)port;
unsigned int cr;
 
-   cr = readb(port->membase + UART010_CR);
+   cr = readb(uap->port.membase + UART010_CR);
cr &= ~UART010_CR_TIE;
-   writel(cr, port->membase + UART010_CR);
+   writel(cr, uap->port.membase + UART010_CR);
 }
 
 static void pl010_start_tx(struct uart_port *port)
 {
+   struct uart_amba_port *uap = (struct uart_amba_port *)port;
unsigned int cr;
 
-   cr = readb(port->membase + UART010_CR);
+   cr = readb(uap->port.membase + UART010_CR);
cr |= UART010_CR_TIE;
-   writel(cr, port->membase + UART010_CR);
+   writel(cr, uap->port.membase + UART010_CR);
 }
 
 static void pl010_stop_rx(struct uart_port *port)
 {
+   struct uart_amba_port *uap = (struct uart_amba_port *)port;
unsigned int cr;
 
-   cr = readb(port->membase + UART010_CR);
+   cr = readb(uap->port.membase + UART010_CR);
cr &= ~(UART010_CR_RIE | UART010_CR_RTIE);
-   writel(cr, port->membase + UART010_CR);
+   writel(cr, uap->port.membase + UART010_CR);
 }
 
 static void pl010_enable_ms(struct uart_port *port)
 {
+   struct uart_amba_port *uap = (struct uart_amba_port *)port;
unsigned int cr;
 
-   cr = readb(port->membase + UART010_CR);
+   cr = readb(uap->port.membase + UART010_CR);
cr |= UART010_CR_MSIE;
-   writel(cr, port->membase + UART010_CR);
+   writel(cr, uap->port.membase + UART010_CR);
 }
 
-static void pl010_rx_chars(struct uart_port *port)
+static void pl010_rx_chars(struct uart_amba_port *uap)
 {
-   struct tty_struct *tty = port->info->tty;
+   struct tty_struct *tty = uap->port.info->tty;
unsigned int status, ch, flag, rsr, max_count = 256;
 
-   status = readb(port->membase + UART01x_FR);
+   status = readb(uap->port.membase + UART01x_FR);
while (UART_RX_DATA(status) && max_count--) {
-   ch = readb(port->membase + UART01x_DR);
+   ch = readb(uap->port.membase + UART01x_DR);
flag = TTY_NORMAL;
 
-   port->icount.rx++;
+   uap->port.icount.rx++;
 
/*
 * Note that the error handling code is
 * out of the main execution path
 */
-   rsr = readb(port->membase + UART01x_RSR) | UART_DUMMY_RSR_RX;
+   rsr = readb(uap->port.membase + UART01x_RSR) | 
UART_DUMMY_RSR_RX;
if (unlikely(rsr & UART01x_RSR_ANY)) {
-   writel(0, port->membase + UART01x_ECR);
+   writel(0, uap->port.membase + UART01x_ECR);
 
if (rsr & UART01x_RSR_BE) {
rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
-   port->icount.brk++;
-   if (uart_handle_break(port))
+   uap->port.icount.brk++;
+   if (uart_handle_break(&uap->port))
goto ignore_char;
} else if (rsr & UART01x_RSR_PE)
-   port->icount.parity++;
+   uap->port.icount.parity++;
else if (rsr & UART01x_RSR_FE)
-   port->icount.frame++;
+   uap->port.icount.frame++;
if (rsr & UART01x_RSR_OE)
-   port->icount.overrun++;
+   uap->port.icount.overrun++;
 
-   rsr &= port->read_status_mask;
+   rsr &= uap->port.read_status_mask;
 
if (rsr & UART01x_RSR_BE)
flag = TTY_BREAK;
@@ -153,53 +157,52 @@ static void pl010_rx_chars(struct uart_port *port)
flag = TTY_

[ARM] Convert AMBA PL010 driver to use the clk infrastructure

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed519dede3d705e1c0012acd5b8de4074aa30fa4
Commit: ed519dede3d705e1c0012acd5b8de4074aa30fa4
Parent: 1b0646a033c370d6c7f5390f2cb452cc1884bb5b
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 22 12:30:41 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sun Apr 22 12:30:41 2007 +0100

[ARM] Convert AMBA PL010 driver to use the clk infrastructure

Convert the AMBA PL010 serial driver to use the clock infrastructure
to allow EP93xx platforms to properly gate the clock to the UARTs.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-ep93xx/clock.c |5 +
 drivers/serial/amba-pl010.c  |   39 +--
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index f174d1a..9d7515c 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -27,6 +27,10 @@ struct clk {
u32 enable_mask;
 };
 
+static struct clk clk_uart = {
+   .name   = "UARTCLK",
+   .rate   = 14745600,
+};
 static struct clk clk_pll1 = {
.name   = "pll1",
 };
@@ -50,6 +54,7 @@ static struct clk clk_usb_host = {
 
 
 static struct clk *clocks[] = {
+   &clk_uart,
&clk_pll1,
&clk_f,
&clk_h,
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index ea49aaf..1a9a24b 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -70,6 +71,7 @@
  */
 struct uart_amba_port {
struct uart_portport;
+   struct clk  *clk;
struct amba_device  *dev;
struct amba_pl010_data  *data;
unsigned intold_status;
@@ -313,11 +315,20 @@ static int pl010_startup(struct uart_port *port)
int retval;
 
/*
+* Try to enable the clock producer.
+*/
+   retval = clk_enable(uap->clk);
+   if (retval)
+   goto out;
+
+   uap->port.uartclk = clk_get_rate(uap->clk);
+
+   /*
 * Allocate the IRQ
 */
retval = request_irq(uap->port.irq, pl010_int, 0, "uart-pl010", uap);
if (retval)
-   return retval;
+   goto clk_dis;
 
/*
 * initialise the old status of the modem signals
@@ -331,6 +342,11 @@ static int pl010_startup(struct uart_port *port)
   uap->port.membase + UART010_CR);
 
return 0;
+
+ clk_dis:
+   clk_disable(uap->clk);
+ out:
+   return retval;
 }
 
 static void pl010_shutdown(struct uart_port *port)
@@ -351,6 +367,11 @@ static void pl010_shutdown(struct uart_port *port)
writel(readb(uap->port.membase + UART010_LCRH) &
~(UART01x_LCRH_BRK | UART01x_LCRH_FEN),
   uap->port.membase + UART010_LCRH);
+
+   /*
+* Shut down the clock producer
+*/
+   clk_disable(uap->clk);
 }
 
 static void
@@ -540,6 +561,8 @@ pl010_console_write(struct console *co, const char *s, 
unsigned int count)
struct uart_amba_port *uap = amba_ports[co->index];
unsigned int status, old_cr;
 
+   clk_enable(uap->clk);
+
/*
 *  First save the CR then disable the interrupts
 */
@@ -557,6 +580,8 @@ pl010_console_write(struct console *co, const char *s, 
unsigned int count)
barrier();
} while (status & UART01x_FR_BUSY);
writel(old_cr, uap->port.membase + UART010_CR);
+
+   clk_disable(uap->clk);
 }
 
 static void __init
@@ -605,6 +630,8 @@ static int __init pl010_console_setup(struct console *co, 
char *options)
if (!uap)
return -ENODEV;
 
+   uap->port.uartclk = clk_get_rate(uap->clk);
+
if (options)
uart_parse_options(options, &baud, &parity, &bits, &flow);
else
@@ -666,12 +693,17 @@ static int pl010_probe(struct amba_device *dev, void *id)
goto free;
}
 
+   uap->clk = clk_get(&dev->dev, "UARTCLK");
+   if (IS_ERR(uap->clk)) {
+   ret = PTR_ERR(uap->clk);
+   goto unmap;
+   }
+
uap->port.dev = &dev->dev;
uap->port.mapbase = dev->res.start;
uap->port.membase = base;
uap->port.iotype = UPIO_MEM;
uap->port.irq = dev->irq[0];
-   uap->port.uartclk = 14745600;
uap->port.fifosize = 16;
uap->port.ops = &amba_pl010_pops;
uap->port.flags = UPF_BOOT_AUTOCONF;
@@ -686,6 +718,8 @@ static int pl010_probe(struct amba_device *dev, void *id)
if (ret) {
amba_set_drvdata(dev, NULL);
amba_ports[i] = NULL;
+   clk_put(uap->clk);
+ unmap:
iounmap(base);
  free:
kfree(uap);
@@ -708,6 +742,7 @@ static int pl01

[ARM] Add stacktrace support and make oprofile use it

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f16fb1ecc5a1cb2f7cc595179d1fe55e711e599f
Commit: f16fb1ecc5a1cb2f7cc595179d1fe55e711e599f
Parent: ed519dede3d705e1c0012acd5b8de4074aa30fa4
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 28 09:59:37 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 09:59:37 2007 +0100

[ARM] Add stacktrace support and make oprofile use it

Add support for stacktrace.  Use the new stacktrace code with
oprofile instead of it's version; there's no point having
multiple versions of stacktracing in the kernel.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/Kconfig  |8 
 arch/arm/kernel/Makefile  |4 +-
 arch/arm/kernel/stacktrace.c  |   73 +
 arch/arm/kernel/stacktrace.h  |9 +
 arch/arm/oprofile/backtrace.c |   69 +-
 5 files changed, 109 insertions(+), 54 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e7baca2..e25a197 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -67,6 +67,14 @@ config GENERIC_HARDIRQS
bool
default y
 
+config STACKTRACE_SUPPORT
+   bool
+   default y
+
+config LOCKDEP_SUPPORT
+   bool
+   default y
+
 config TRACE_IRQFLAGS_SUPPORT
bool
default y
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index bb28087..593b565 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -7,8 +7,8 @@ AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
 # Object file lists.
 
 obj-y  := compat.o entry-armv.o entry-common.o irq.o \
-  process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \
-  time.o traps.o
+  process.o ptrace.o semaphore.o setup.o signal.o \
+  sys_arm.o stacktrace.o time.o traps.o
 
 obj-$(CONFIG_ISA_DMA_API)  += dma.o
 obj-$(CONFIG_ARCH_ACORN)   += ecard.o 
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
new file mode 100644
index 000..77ef35e
--- /dev/null
+++ b/arch/arm/kernel/stacktrace.c
@@ -0,0 +1,73 @@
+#include 
+#include 
+
+#include "stacktrace.h"
+
+int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high,
+   int (*fn)(struct stackframe *, void *), void *data)
+{
+   struct stackframe *frame;
+
+   do {
+   /*
+* Check current frame pointer is within bounds
+*/
+   if ((fp - 12) < low || fp + 4 >= high)
+   break;
+
+   frame = (struct stackframe *)(fp - 12);
+
+   if (fn(frame, data))
+   break;
+
+   /*
+* Update the low bound - the next frame must always
+* be at a higher address than the current frame.
+*/
+   low = fp + 4;
+   fp = frame->fp;
+   } while (fp);
+
+   return 0;
+}
+
+#ifdef CONFIG_STACKTRACE
+struct stack_trace_data {
+   struct stack_trace *trace;
+   unsigned int skip;
+};
+
+static int save_trace(struct stackframe *frame, void *d)
+{
+   struct stack_trace_data *data = d;
+   struct stack_trace *trace = data->trace;
+
+   if (data->skip) {
+   data->skip--;
+   return 0;
+   }
+
+   trace->entries[trace->nr_entries++] = frame->lr;
+
+   return trace->nr_entries >= trace->max_entries;
+}
+
+void save_stack_trace(struct stack_trace *trace, struct task_struct *task)
+{
+   struct stack_trace_data data;
+   unsigned long fp, base;
+
+   data.trace = trace;
+   data.skip = trace->skip;
+
+   if (task) {
+   base = (unsigned long)task_stack_page(task);
+   fp = 0; /* FIXME */
+   } else {
+   base = (unsigned long)task_stack_page(current);
+   asm("mov %0, fp" : "=r" (fp));
+   }
+
+   walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data);
+}
+#endif
diff --git a/arch/arm/kernel/stacktrace.h b/arch/arm/kernel/stacktrace.h
new file mode 100644
index 000..e9fd20c
--- /dev/null
+++ b/arch/arm/kernel/stacktrace.h
@@ -0,0 +1,9 @@
+struct stackframe {
+   unsigned long fp;
+   unsigned long sp;
+   unsigned long lr;
+   unsigned long pc;
+};
+
+int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high,
+   int (*fn)(struct stackframe *, void *), void *data);
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
index 7c22c12..f5ebf30 100644
--- a/arch/arm/oprofile/backtrace.c
+++ b/arch/arm/oprofile/backtrace.c
@@ -19,6 +19,19 @@
 #include 
 #include 
 
+#include "../kernel/stacktrace.h"
+
+static int report_trace(struct stackframe *frame, void *d)
+{
+   unsigned int *depth = d;
+
+   if (*depth) {

[ARM] 4356/1: arm: fix handling of svc mode undefined instructions

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99cce8f7b10716f8fdbaca21a7f3ba000119ad3b
Commit: 99cce8f7b10716f8fdbaca21a7f3ba000119ad3b
Parent: f16fb1ecc5a1cb2f7cc595179d1fe55e711e599f
Author: Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 00:18:34 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:07:48 2007 +0100

[ARM] 4356/1: arm: fix handling of svc mode undefined instructions

Now that do_undefinstr handles kernel and user mode undefined
instruction exceptions it must not assume that interrupts are enabled at
entry.

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/traps.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 6055ab4..f05e66b 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -286,6 +286,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs 
*regs)
struct undef_hook *hook;
siginfo_t info;
void __user *pc;
+   unsigned long flags;
 
/*
 * According to the ARM ARM, PC is 2 or 4 bytes ahead,
@@ -304,7 +305,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs 
*regs)
get_user(instr, (u32 __user *)pc);
}
 
-   spin_lock_irq(&undef_lock);
+   spin_lock_irqsave(&undef_lock, flags);
list_for_each_entry(hook, &undef_hook, node) {
if ((instr & hook->instr_mask) == hook->instr_val &&
(regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
@@ -314,7 +315,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs 
*regs)
}
}
}
-   spin_unlock_irq(&undef_lock);
+   spin_unlock_irqrestore(&undef_lock, flags);
 
 #ifdef CONFIG_DEBUG_USER
if (user_debug & UDBG_UNDEFINED) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4227/1: minor head.S fixups

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40435792525c49cf126ba92d223e877acb5ce021
Commit: 40435792525c49cf126ba92d223e877acb5ce021
Parent: 99cce8f7b10716f8fdbaca21a7f3ba000119ad3b
Author: Nicolas Pitre <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 15:58:13 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 21:03:48 2007 +0100

[ARM] 4227/1: minor head.S fixups

Let's surround constructs like:

orr r3, r3, #(KERNEL_RAM_PADDR & 0x00f0)

between .if .endif since (KERNEL_RAM_PADDR & 0x00f0) is 0 in 99% of
all cases.

Also let's mask PHYS_OFFSET with 0x00f0 instead of 0x00e0.
Section mappings are really 1MB not 2MB and the 2MB groupping is
a higher level issue already much better enforced with

#if (PHYS_OFFSET & 0x001f)
#error "PHYS_OFFSET must be at an even 2MiB boundary!"
#endif

at the top of the file.

Signed-off-by: Nicolas Pitre <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/head.S |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 66db0a9..1d35eda 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -257,7 +257,9 @@ __create_page_tables:
 * Map some ram to cover our .data and .bss areas.
 */
orr r3, r7, #(KERNEL_RAM_PADDR & 0xff00)
+   .if (KERNEL_RAM_PADDR & 0x00f0)
orr r3, r3, #(KERNEL_RAM_PADDR & 0x00f0)
+   .endif
add r0, r4,  #(KERNEL_RAM_VADDR & 0xff00) >> 18
str r3, [r0, #(KERNEL_RAM_VADDR & 0x00f0) >> 18]!
ldr r6, =(_end - 1)
@@ -274,7 +276,9 @@ __create_page_tables:
 */
add r0, r4, #PAGE_OFFSET >> 18
orr r6, r7, #(PHYS_OFFSET & 0xff00)
-   orr r6, r6, #(PHYS_OFFSET & 0x00e0)
+   .if (PHYS_OFFSET & 0x00f0)
+   orr r6, r6, #(PHYS_OFFSET & 0x00f0)
+   .endif
str r6, [r0]
 
 #ifdef CONFIG_DEBUG_LL
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Move syscall saving out of the way of utrace

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5ba6d3febd4978f31b2c523d64d381603923a709
Commit: 5ba6d3febd4978f31b2c523d64d381603923a709
Parent: 40435792525c49cf126ba92d223e877acb5ce021
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 13:56:26 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sun May 6 13:56:26 2007 +0100

[ARM] Move syscall saving out of the way of utrace

utrace removes the ptrace_message field in task_struct.  Move our use
of this field into a new member in thread_info called "syscall"

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/ptrace.c  |6 +++---
 include/asm-arm/thread_info.h |1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index e594b84..13af400 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -779,8 +779,8 @@ long arch_ptrace(struct task_struct *child, long request, 
long addr, long data)
break;
 
case PTRACE_SET_SYSCALL:
+   task_thread_info(child)->syscall = data;
ret = 0;
-   child->ptrace_message = data;
break;
 
 #ifdef CONFIG_CRUNCH
@@ -817,7 +817,7 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, 
int scno)
ip = regs->ARM_ip;
regs->ARM_ip = why;
 
-   current->ptrace_message = scno;
+   current_thread_info()->syscall = scno;
 
/* the 0x80 provides a way for the tracing parent to distinguish
   between a syscall stop and SIGTRAP delivery */
@@ -834,5 +834,5 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, 
int scno)
}
regs->ARM_ip = ip;
 
-   return current->ptrace_message;
+   return current_thread_info()->syscall;
 }
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index 5014794..eae85b0 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -57,6 +57,7 @@ struct thread_info {
__u32   cpu;/* cpu */
__u32   cpu_domain; /* cpu domain */
struct cpu_context_save cpu_context;/* cpu context */
+   __u32   syscall;/* syscall number */
__u8used_cp[16];/* thread used copro */
unsigned long   tp_value;
struct crunch_state crunchstate;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4329/1: fix position of NETX_SYSTEM_REG

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fe7fdb80e9e576e181b189d0fae62d35cb30fe4d
Commit: fe7fdb80e9e576e181b189d0fae62d35cb30fe4d
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Sascha Hauer <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 08:34:41 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 20:22:49 2007 +0100

[ARM] 4329/1: fix position of NETX_SYSTEM_REG

This patch fixes the position of the netx reset control register

Signed-off-by: Sascha Hauer <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-netx/netx-regs.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/asm-arm/arch-netx/netx-regs.h 
b/include/asm-arm/arch-netx/netx-regs.h
index 8ab45be..fc9aa21 100644
--- a/include/asm-arm/arch-netx/netx-regs.h
+++ b/include/asm-arm/arch-netx/netx-regs.h
@@ -121,8 +121,8 @@
 #define NETX_SYSTEM_IOC_MR  NETX_SYSTEM_REG(0x08)
 
 /* FIXME: Docs are not consistent */
-#define NETX_SYSTEM_RES_CR  NETX_SYSTEM_REG(0x08)
-/* #define NETX_SYSTEM_RES_CR  NETX_SYSTEM_REG(0x0c) */
+/* #define NETX_SYSTEM_RES_CR  NETX_SYSTEM_REG(0x08) */
+#define NETX_SYSTEM_RES_CR  NETX_SYSTEM_REG(0x0c)
 
 #define NETX_SYSTEM_PHY_CONTROL NETX_SYSTEM_REG(0x10)
 #define NETX_SYSTEM_REV NETX_SYSTEM_REG(0x34)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4292/1: ns9xxx: Make REGGET consistant with REGSET

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fee64d1b55af57d7dba41f554769db83d7a32fde
Commit: fee64d1b55af57d7dba41f554769db83d7a32fde
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Uwe Kleine-König <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 28 17:18:30 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:50:59 2007 +0100

[ARM] 4292/1: ns9xxx: Make REGGET consistant with REGSET

This implies that REGGET gets a new parameter "var" to allow to hold the 
actual
register value in a variable.

Moreover REGGET was broken because it used "field" instead of
"reg ## _ ## field" which proves that there are no callers to fix :-)

Signed-off-by: Uwe Kleine-König <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-ns9xxx/hardware.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/asm-arm/arch-ns9xxx/hardware.h 
b/include/asm-arm/arch-ns9xxx/hardware.h
index 6819da7..2560055 100644
--- a/include/asm-arm/arch-ns9xxx/hardware.h
+++ b/include/asm-arm/arch-ns9xxx/hardware.h
@@ -51,8 +51,9 @@
   ~(__REGVAL(reg ## _ ## field, value  \
  | (__REGVAL(reg ## _ ## field, value
 
-#  define REGGET(reg, field)   \
-   ((reg & (reg ## _ ## field)) / (field & (-field)))
+#  define REGGET(var, reg, field)  \
+   ((var & (reg ## _ ## field)) /  \
+((reg ## _ ## field) & (-(reg ## _ ## field
 
 #else
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4293/1: ns9xxx: Add bit fields FS and ND to the definition of

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=940089e007e8ed33295ef408b39a53e5ad518ebd
Commit: 940089e007e8ed33295ef408b39a53e5ad518ebd
Parent: fee64d1b55af57d7dba41f554769db83d7a32fde
Author: Uwe Kleine-König <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 28 17:54:22 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:51:05 2007 +0100

[ARM] 4293/1: ns9xxx: Add bit fields FS and ND to the definition of
SYS_PLL register

Signed-off-by: Uwe Kleine-König <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-ns9xxx/regs-sys.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h 
b/include/asm-arm/arch-ns9xxx/regs-sys.h
index 8162a50..a42546a 100644
--- a/include/asm-arm/arch-ns9xxx/regs-sys.h
+++ b/include/asm-arm/arch-ns9xxx/regs-sys.h
@@ -48,6 +48,12 @@
 /* PLL Configuration register */
 #define SYS_PLL__REG(0xa0900188)
 
+/* PLL FS status */
+#define SYS_PLL_FS __REGBITS(24, 23)
+
+/* PLL ND status */
+#define SYS_PLL_ND __REGBITS(20, 16)
+
 /* PLL Configuration register: PLL SW change */
 #define SYS_PLL_SWC__REGBIT(15)
 #define SYS_PLL_SWC_NO __REGVAL(SYS_PLL_SWC, 0)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Add comments marking in-use ptrace numbers

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b11652286a06988f721b506b094d026e8892e2c
Commit: 1b11652286a06988f721b506b094d026e8892e2c
Parent: 5ba6d3febd4978f31b2c523d64d381603923a709
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:49:56 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sun May 6 14:49:56 2007 +0100

[ARM] Add comments marking in-use ptrace numbers

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/ptrace.h |   10 +++---
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 5a8ef78..2d0dad8 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -10,23 +10,19 @@
 #ifndef __ASM_ARM_PTRACE_H
 #define __ASM_ARM_PTRACE_H
 
-
 #define PTRACE_GETREGS 12
 #define PTRACE_SETREGS 13
 #define PTRACE_GETFPREGS   14
 #define PTRACE_SETFPREGS   15
-
+/* PTRACE_ATTACH is 16 */
+/* PTRACE_DETACH is 17 */
 #define PTRACE_GETWMMXREGS 18
 #define PTRACE_SETWMMXREGS 19
-
+/* 20 is unused */
 #define PTRACE_OLDSETOPTIONS   21
-
 #define PTRACE_GET_THREAD_AREA 22
-
 #define PTRACE_SET_SYSCALL 23
-
 /* PTRACE_SYSCALL is 24 */
-
 #define PTRACE_GETCRUNCHREGS   25
 #define PTRACE_SETCRUNCHREGS   26
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4294/1: ns9xxx: Determine system clock from PLL register settings

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f86bd61fd70af02e666a893aaf22653181423e99
Commit: f86bd61fd70af02e666a893aaf22653181423e99
Parent: 940089e007e8ed33295ef408b39a53e5ad518ebd
Author: Uwe Kleine-König <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 28 18:06:41 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:51:11 2007 +0100

[ARM] 4294/1: ns9xxx: Determine system clock from PLL register settings

The function attribute const is abused here as the PLL register is read.  
But I
think this is all right because the PLL register cannot change without a 
reset.

Note: This patch depends on 4293/1

Signed-off-by: Uwe Kleine-König <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-ns9xxx/clock.h |   34 --
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/include/asm-arm/arch-ns9xxx/clock.h 
b/include/asm-arm/arch-ns9xxx/clock.h
index a7c5ab3..bf30cbd 100644
--- a/include/asm-arm/arch-ns9xxx/clock.h
+++ b/include/asm-arm/arch-ns9xxx/clock.h
@@ -11,13 +11,43 @@
 #ifndef __ASM_ARCH_CLOCK_H
 #define __ASM_ARCH_CLOCK_H
 
+#include 
+
+#define CRYSTAL 29491200 /* Hz */
+
+/* The HRM calls this value f_vco */
 static inline u32 ns9xxx_systemclock(void) __attribute__((const));
 static inline u32 ns9xxx_systemclock(void)
 {
+   u32 pll = SYS_PLL;
+
/*
-* This should be a multiple of HZ * TIMERCLOCKSELECT (in time.c)
+* The system clock should be a multiple of HZ * TIMERCLOCKSELECT (in
+* time.c).
+*
+* The following values are given:
+*   - TIMERCLOCKSELECT == 2^i for an i in {0 .. 6}
+*   - CRYSTAL == 29491200 == 2^17 * 3^2 * 5^2
+*   - ND in {0 .. 31}
+*   - FS in {0 .. 3}
+*
+* Assuming the worst, we consider:
+*   - TIMERCLOCKSELECT == 64
+*   - ND == 0
+*   - FS == 3
+*
+* So HZ should be a divisor of:
+*  (CRYSTAL * (ND + 1) >> FS) / TIMERCLOCKSELECT
+*   == (2^17 * 3^2 * 5^2 * 1 >> 3) / 64
+*   == 2^8 * 3^2 * 5^2
+*   == 57600
+*
+* Currently HZ is defined to be 100 for this platform.
+*
+* Fine.
 */
-   return 353894400;
+   return CRYSTAL * (REGGET(pll, SYS_PLL, ND) + 1)
+   >> REGGET(pll, SYS_PLL, FS);
 }
 
 static inline u32 ns9xxx_cpuclock(void) __attribute__((const));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4301/1: add mach type cc9p9360js

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=13ea55b04eaafb60cd7df759c8d92566d1f19351
Commit: 13ea55b04eaafb60cd7df759c8d92566d1f19351
Parent: f86bd61fd70af02e666a893aaf22653181423e99
Author: Uwe Kleine-König <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 2 21:09:31 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:52:30 2007 +0100

[ARM] 4301/1: add mach type cc9p9360js

The support for that machine is not yet complete, but it's enough to
be useful as a test platform for the serial and ethernet driver.

Moreover a typo in the product name is fixed that I missed in the
last patch.

Signed-off-by: Uwe Kleine-König <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-ns9xxx/Kconfig|   15 +--
 arch/arm/mach-ns9xxx/Makefile   |1 +
 arch/arm/mach-ns9xxx/board-jscc9p9360.c |   17 +
 arch/arm/mach-ns9xxx/board-jscc9p9360.h |   13 +
 arch/arm/mach-ns9xxx/mach-cc9p9360js.c  |   29 +
 include/asm-arm/arch-ns9xxx/board.h |2 ++
 include/asm-arm/arch-ns9xxx/processor.h |3 ++-
 7 files changed, 77 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-ns9xxx/Kconfig b/arch/arm/mach-ns9xxx/Kconfig
index 8175ba9..8584ed1 100644
--- a/arch/arm/mach-ns9xxx/Kconfig
+++ b/arch/arm/mach-ns9xxx/Kconfig
@@ -3,19 +3,30 @@ if ARCH_NS9XXX
 menu "NS9xxx Implementations"
 
 config MACH_CC9P9360DEV
-   bool "Connect Core 9P 9360 on an A9M9750 Devboard"
+   bool "ConnectCore 9P 9360 on an A9M9750 Devboard"
select PROCESSOR_NS9360
select BOARD_A9M9750DEV
help
- Say Y here if you are using the Digi Connect Core 9P 9360
+ Say Y here if you are using the Digi ConnectCore 9P 9360
  on an A9M9750 Development Board.
 
+config MACH_CC9P9360JS
+   bool "ConnectCore 9P 9360 on a JSCC9P9360 Devboard"
+   select PROCESSOR_NS9360
+   select BOARD_JSCC9P9360
+   help
+ Say Y here if you are using the Digi ConnectCore 9P 9360
+ on an JSCC9P9360 Development Board.
+
 config PROCESSOR_NS9360
bool
 
 config BOARD_A9M9750DEV
bool
 
+config BOARD_JSCC9P9360
+   bool
+
 endmenu
 
 endif
diff --git a/arch/arm/mach-ns9xxx/Makefile b/arch/arm/mach-ns9xxx/Makefile
index 91e945f..53213a6 100644
--- a/arch/arm/mach-ns9xxx/Makefile
+++ b/arch/arm/mach-ns9xxx/Makefile
@@ -3,3 +3,4 @@ obj-y := irq.o time.o generic.o
 obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o
 
 obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o
+obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o
diff --git a/arch/arm/mach-ns9xxx/board-jscc9p9360.c 
b/arch/arm/mach-ns9xxx/board-jscc9p9360.c
new file mode 100644
index 000..4bd3eec
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/board-jscc9p9360.c
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/mach-ns9xxx/board-jscc9p9360.c
+ *
+ * Copyright (C) 2006,2007 by Digi International Inc.
+ * All rights reserved.
+ *
+ * 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 "board-jscc9p9360.h"
+
+void __init board_jscc9p9360_init_machine(void)
+{
+   /* TODO: reserve GPIOs for push buttons, etc pp */
+}
+
diff --git a/arch/arm/mach-ns9xxx/board-jscc9p9360.h 
b/arch/arm/mach-ns9xxx/board-jscc9p9360.h
new file mode 100644
index 000..1a81a07
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/board-jscc9p9360.h
@@ -0,0 +1,13 @@
+/*
+ * arch/arm/mach-ns9xxx/board-jscc9p9360.h
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * 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 
+
+void __init board_jscc9p9360_init_machine(void);
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c 
b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
new file mode 100644
index 000..d09d5fa
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
@@ -0,0 +1,29 @@
+/*
+ * arch/arm/mach-ns9xxx/mach-cc9p9360js.c
+ *
+ * Copyright (C) 2006 by Digi International Inc.
+ * All rights reserved.
+ *
+ * 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 
+#include 
+
+#include "board-jscc9p9360.h"
+#include "generic.h"
+
+static void __init mach_cc9p9360js_init_machine(void)
+{
+   ns9xxx_init_machine();
+   board_jscc9p9360_init_machine();
+}
+
+MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an JSCC9P9360 
Devboard")
+   .map_io = ns9xxx_map_io,
+   .init_irq = ns9xxx_init_irq,
+   .init_machine = mach_cc9p9360js_init_machine,
+ 

ARM: OMAP: Enable 24xx GPIO autoidling

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14f1c3bf51b78d916a6aff9c9b5e6689e3e006e7
Commit: 14f1c3bf51b78d916a6aff9c9b5e6689e3e006e7
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Juha Yrjola <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:13:48 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:53:45 2007 +0100

ARM: OMAP: Enable 24xx GPIO autoidling

Enable 24xx GPIO autoidling

Signed-off-by: Juha Yrjola <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/gpio.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 8bedc8f..037a493 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1082,6 +1082,10 @@ static int __init _omap_gpio_init(void)
if (bank->method == METHOD_GPIO_24XX) {
__raw_writel(0x, bank->base + 
OMAP24XX_GPIO_IRQENABLE1);
__raw_writel(0x, bank->base + 
OMAP24XX_GPIO_IRQSTATUS1);
+   __raw_writew(0x0015, bank->base + 
OMAP24XX_GPIO_SYSCONFIG);
+
+   /* Initialize interface clock ungated, module enabled */
+   __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
 
gpio_count = 32;
}
@@ -1104,6 +1108,12 @@ static int __init _omap_gpio_init(void)
if (cpu_is_omap16xx())
omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, 
ULPD_CAM_CLK_CTRL);
 
+#ifdef CONFIG_ARCH_OMAP24XX
+   /* Enable autoidle for the OCP interface */
+   if (cpu_is_omap24xx())
+   omap_writel(1 << 0, 0x48019010);
+#endif
+
return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3ac4fa99291a60329e9c9424ac3e67bb4f9564f5
Commit: 3ac4fa99291a60329e9c9424ac3e67bb4f9564f5
Parent: 14f1c3bf51b78d916a6aff9c9b5e6689e3e006e7
Author: Juha Yrjola <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:13:52 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:54:07 2007 +0100

ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon

Some GPIOs on OMAP2420 do not have wakeup capabilities. If these GPIOs
are configured as IRQ sources, spurious interrupts will be generated
each time the core domain enters retention.

Signed-off-by: Juha Yrjola <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/gpio.c |  154 +++-
 1 files changed, 136 insertions(+), 18 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 037a493..ec0e2f1 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -117,8 +117,18 @@ struct gpio_bank {
u16 virtual_irq_start;
int method;
u32 reserved_map;
+#if defined (CONFIG_ARCH_OMAP16XX) || defined (CONFIG_ARCH_OMAP24XX)
u32 suspend_wakeup;
u32 saved_wakeup;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
+   u32 non_wakeup_gpios;
+   u32 enabled_non_wakeup_gpios;
+
+   u32 saved_datain;
+   u32 saved_fallingdetect;
+   u32 saved_risingdetect;
+#endif
spinlock_t lock;
 };
 
@@ -397,8 +407,10 @@ do {   \
__raw_writel(l, base + reg); \
 } while(0)
 
-static inline void set_24xx_gpio_triggering(void __iomem *base, int gpio, int 
trigger)
+#ifdef CONFIG_ARCH_OMAP24XX
+static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, 
int trigger)
 {
+   void __iomem *base = bank->base;
u32 gpio_bit = 1 << gpio;
 
MOD_REG_BIT(OMAP24XX_GPIO_LEVELDETECT0, gpio_bit,
@@ -409,9 +421,21 @@ static inline void set_24xx_gpio_triggering(void __iomem 
*base, int gpio, int tr
trigger & __IRQT_RISEDGE);
MOD_REG_BIT(OMAP24XX_GPIO_FALLINGDETECT, gpio_bit,
trigger & __IRQT_FALEDGE);
+   if (likely(!(bank->non_wakeup_gpios & gpio_bit))) {
+   if (trigger != 0)
+   __raw_writel(1 << gpio, bank->base + 
OMAP24XX_GPIO_SETWKUENA);
+   else
+   __raw_writel(1 << gpio, bank->base + 
OMAP24XX_GPIO_CLEARWKUENA);
+   } else {
+   if (trigger != 0)
+   bank->enabled_non_wakeup_gpios |= gpio_bit;
+   else
+   bank->enabled_non_wakeup_gpios &= ~gpio_bit;
+   }
/* FIXME: Possibly do 'set_irq_handler(j, handle_level_irq)' if only 
level
 * triggering requested. */
 }
+#endif
 
 static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
 {
@@ -439,6 +463,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int 
gpio, int trigger)
else
goto bad;
break;
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
if (gpio & 0x08)
reg += OMAP1610_GPIO_EDGE_CTRL2;
@@ -454,7 +479,14 @@ static int _set_gpio_triggering(struct gpio_bank *bank, 
int gpio, int trigger)
l |= 2 << (gpio << 1);
if (trigger & __IRQT_FALEDGE)
l |= 1 << (gpio << 1);
+   if (trigger)
+   /* Enable wake-up during idle for dynamic tick */
+   __raw_writel(1 << gpio, bank->base + 
OMAP1610_GPIO_SET_WAKEUPENA);
+   else
+   __raw_writel(1 << gpio, bank->base + 
OMAP1610_GPIO_CLEAR_WAKEUPENA);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_INT_CONTROL;
l = __raw_readl(reg);
@@ -465,9 +497,12 @@ static int _set_gpio_triggering(struct gpio_bank *bank, 
int gpio, int trigger)
else
goto bad;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
-   set_24xx_gpio_triggering(reg, gpio, trigger);
+   set_24xx_gpio_triggering(bank, gpio, trigger);
break;
+#endif
default:
BUG();
goto bad;
@@ -651,8 +686,8 @@ static inline void _set_gpio_irqenable(struct gpio_bank 
*bank, int gpio, int ena
 static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 {
switch (bank->method) {
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
-   case METHOD_GPIO_24XX:
spin_lock(&bank->lock);
if (enable)
bank->suspend_wakeup |= (1 << gpio);
@@ 

ARM: OMAP: /sys/kernel/debug/omap_gpio

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9772a220a0d1b1d83b770ed131fa8b090af3681
Commit: b9772a220a0d1b1d83b770ed131fa8b090af3681
Parent: 3ac4fa99291a60329e9c9424ac3e67bb4f9564f5
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:13:53 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:54:23 2007 +0100

ARM: OMAP: /sys/kernel/debug/omap_gpio

Add some GPIO debug support:  /sys/kernel/debug/omap_gpio dumps the state
of all GPIOs that have been claimed, including basic IRQ info if relevant.
Tested on 24xx, 16xx.

Includes minor bugfixes:  recording IRQ trigger mode (this should probably
be a genirq patch), adding missing space to non-wakeup warning

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/gpio.c |  130 -
 1 files changed, 129 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index ec0e2f1..0059f19 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -535,6 +535,10 @@ static int gpio_irq_type(unsigned irq, unsigned type)
bank = get_gpio_bank(gpio);
spin_lock(&bank->lock);
retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
+   if (retval == 0) {
+   irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
+   irq_desc[irq].status |= type;
+   }
spin_unlock(&bank->lock);
return retval;
 }
@@ -701,7 +705,7 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
spin_lock(&bank->lock);
if (enable) {
if (bank->non_wakeup_gpios & (1 << gpio)) {
-   printk(KERN_ERR "Unable to enable wakeup on"
+   printk(KERN_ERR "Unable to enable wakeup on "
"non-wakeup GPIO%d\n",
(bank - gpio_bank) * 32 + gpio);
spin_unlock(&bank->lock);
@@ -1359,3 +1363,127 @@ EXPORT_SYMBOL(omap_set_gpio_dataout);
 EXPORT_SYMBOL(omap_get_gpio_datain);
 
 arch_initcall(omap_gpio_sysinit);
+
+
+#ifdef CONFIG_DEBUG_FS
+
+#include 
+#include 
+
+static int gpio_is_input(struct gpio_bank *bank, int mask)
+{
+   void __iomem *reg = bank->base;
+
+   switch (bank->method) {
+   case METHOD_MPUIO:
+   reg += OMAP_MPUIO_IO_CNTL;
+   break;
+   case METHOD_GPIO_1510:
+   reg += OMAP1510_GPIO_DIR_CONTROL;
+   break;
+   case METHOD_GPIO_1610:
+   reg += OMAP1610_GPIO_DIRECTION;
+   break;
+   case METHOD_GPIO_730:
+   reg += OMAP730_GPIO_DIR_CONTROL;
+   break;
+   case METHOD_GPIO_24XX:
+   reg += OMAP24XX_GPIO_OE;
+   break;
+   }
+   return __raw_readl(reg) & mask;
+}
+
+
+static int dbg_gpio_show(struct seq_file *s, void *unused)
+{
+   unsignedi, j, gpio;
+
+   for (i = 0, gpio = 0; i < gpio_bank_count; i++) {
+   struct gpio_bank*bank = gpio_bank + i;
+   unsignedbankwidth = 16;
+   u32 mask = 1;
+
+   if (!cpu_is_omap24xx() && bank->method == METHOD_MPUIO)
+   gpio = OMAP_MPUIO(0);
+   else if (cpu_is_omap24xx() || cpu_is_omap730())
+   bankwidth = 32;
+
+   for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) {
+   unsignedirq, value, is_in, irqstat;
+
+   if (!(bank->reserved_map & mask))
+   continue;
+
+   irq = bank->virtual_irq_start + j;
+   value = omap_get_gpio_datain(gpio);
+   is_in = gpio_is_input(bank, mask);
+
+   if (!cpu_is_omap24xx() && bank->method == METHOD_MPUIO)
+   seq_printf(s, "MPUIO %2d: ", j);
+   else
+   seq_printf(s, "GPIO %3d: ", gpio);
+   seq_printf(s, "%s %s",
+   is_in ? "in " : "out",
+   value ? "hi"  : "lo");
+
+   irqstat = irq_desc[irq].status;
+   if (is_in && ((bank->suspend_wakeup & mask)
+   || irqstat & IRQ_TYPE_SENSE_MASK)) {
+   char*trigger = NULL;
+
+   switch (irqstat & IRQ_TYPE_SENSE_MASK) {
+   case IRQ_TYPE_EDGE_FALLING:
+   trigger = "fa

ARM: OMAP: gpio object shrinkage, cleanup

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5c56ed3c9caa6ba717af0a5c23e2c7bf5c97a1f
Commit: e5c56ed3c9caa6ba717af0a5c23e2c7bf5c97a1f
Parent: b9772a220a0d1b1d83b770ed131fa8b090af3681
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:13:59 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:56:28 2007 +0100

ARM: OMAP: gpio object shrinkage, cleanup

More GPIO/IRQ cleanup:

  - compile-time removal of much useless code
  * mpuio support on non-OMAP1.
  * 15xx/730/24xx gpio support on 1610
  * 15xx/730/16xx gpio support on 24xx
  * etc

  - remove all BUG() calls, which are always bad news ... replaced some
with normal fault reports for that call, others with WARN_ON(1).

  - small mpuio bugfix:  add missing set_type() method

Oh, and fix a minor merge issue: inode->u.generic_ip is now gone.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/gpio.c |  166 +++--
 1 files changed, 130 insertions(+), 36 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 0059f19..f0a882b 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -267,21 +267,34 @@ static void _set_gpio_direction(struct gpio_bank *bank, 
int gpio, int is_input)
u32 l;
 
switch (bank->method) {
+#ifdef CONFIG_ARCH_OMAP1
case METHOD_MPUIO:
reg += OMAP_MPUIO_IO_CNTL;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP15XX
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_DIR_CONTROL;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
reg += OMAP1610_GPIO_DIRECTION;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_DIR_CONTROL;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
reg += OMAP24XX_GPIO_OE;
break;
+#endif
+   default:
+   WARN_ON(1);
+   return;
}
l = __raw_readl(reg);
if (is_input)
@@ -309,6 +322,7 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
u32 l = 0;
 
switch (bank->method) {
+#ifdef CONFIG_ARCH_OMAP1
case METHOD_MPUIO:
reg += OMAP_MPUIO_OUTPUT;
l = __raw_readl(reg);
@@ -317,6 +331,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
else
l &= ~(1 << gpio);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP15XX
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_DATA_OUTPUT;
l = __raw_readl(reg);
@@ -325,6 +341,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
else
l &= ~(1 << gpio);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP16XX
case METHOD_GPIO_1610:
if (enable)
reg += OMAP1610_GPIO_SET_DATAOUT;
@@ -332,6 +350,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
reg += OMAP1610_GPIO_CLEAR_DATAOUT;
l = 1 << gpio;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP730
case METHOD_GPIO_730:
reg += OMAP730_GPIO_DATA_OUTPUT;
l = __raw_readl(reg);
@@ -340,6 +360,8 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
else
l &= ~(1 << gpio);
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
if (enable)
reg += OMAP24XX_GPIO_SETDATAOUT;
@@ -347,8 +369,9 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int 
gpio, int enable)
reg += OMAP24XX_GPIO_CLEARDATAOUT;
l = 1 << gpio;
break;
+#endif
default:
-   BUG();
+   WARN_ON(1);
return;
}
__raw_writel(l, reg);
@@ -372,28 +395,37 @@ int omap_get_gpio_datain(int gpio)
void __iomem *reg;
 
if (check_gpio(gpio) < 0)
-   return -1;
+   return -EINVAL;
bank = get_gpio_bank(gpio);
reg = bank->base;
switch (bank->method) {
+#ifdef CONFIG_ARCH_OMAP1
case METHOD_MPUIO:
reg += OMAP_MPUIO_INPUT_LATCH;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP15XX
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_DATA_INPUT;
break;
+#endif
+#ifdef CONFIG_ARCH_OMAP16X

ARM: OMAP: plat-omap changes for 2430 SDP

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56a2564185db752d83bbc78be9b1e257bf103444
Commit: 56a2564185db752d83bbc78be9b1e257bf103444
Parent: e5c56ed3c9caa6ba717af0a5c23e2c7bf5c97a1f
Author: Syed Mohammed Khasim <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:14:08 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:56:45 2007 +0100

ARM: OMAP: plat-omap changes for 2430 SDP

This patch adds minimal OMAP2430 support to plat-omap files to
get the kernel booting on 2430SDP.

Signed-off-by: Syed Mohammed Khasim <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/devices.c |6 +++-
 arch/arm/plat-omap/dmtimer.c |2 +
 arch/arm/plat-omap/gpio.c|   76 ++---
 arch/arm/plat-omap/mcbsp.c   |   15 +---
 4 files changed, 80 insertions(+), 19 deletions(-)

diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index dbc3f44..eeb33fe 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -429,6 +429,10 @@ static inline void omap_init_rng(void) {}
  */
 static int __init omap_init_devices(void)
 {
+/*
+ * Need to enable relevant once for 2430 SDP
+ */
+#ifndef CONFIG_MACH_OMAP_2430SDP
/* please keep these calls, and their implementations above,
 * in alphabetical order so they're easier to sort through.
 */
@@ -438,7 +442,7 @@ static int __init omap_init_devices(void)
omap_init_uwire();
omap_init_wdt();
omap_init_rng();
-
+#endif
return 0;
 }
 arch_initcall(omap_init_devices);
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 45f0439..659619f 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -506,6 +506,8 @@ int omap_dm_timer_init(void)
BUG_ON(dm_source_clocks[i] == NULL);
}
 #endif
+   if (cpu_is_omap243x())
+   dm_timers[0].phys_base = 0x49018000;
 
for (i = 0; i < dm_timer_count; i++) {
 #ifdef CONFIG_ARCH_OMAP2
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index f0a882b..1da7a5d 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -85,10 +85,17 @@
 /*
  * omap24xx specific GPIO registers
  */
-#define OMAP24XX_GPIO1_BASE(void __iomem *)0x48018000
-#define OMAP24XX_GPIO2_BASE(void __iomem *)0x4801a000
-#define OMAP24XX_GPIO3_BASE(void __iomem *)0x4801c000
-#define OMAP24XX_GPIO4_BASE(void __iomem *)0x4801e000
+#define OMAP242X_GPIO1_BASE(void __iomem *)0x48018000
+#define OMAP242X_GPIO2_BASE(void __iomem *)0x4801a000
+#define OMAP242X_GPIO3_BASE(void __iomem *)0x4801c000
+#define OMAP242X_GPIO4_BASE(void __iomem *)0x4801e000
+
+#define OMAP243X_GPIO1_BASE(void __iomem *)0x4900C000
+#define OMAP243X_GPIO2_BASE(void __iomem *)0x4900E000
+#define OMAP243X_GPIO3_BASE(void __iomem *)0x4901
+#define OMAP243X_GPIO4_BASE(void __iomem *)0x49012000
+#define OMAP243X_GPIO5_BASE(void __iomem *)0x480B6000
+
 #define OMAP24XX_GPIO_REVISION 0x
 #define OMAP24XX_GPIO_SYSCONFIG0x0010
 #define OMAP24XX_GPIO_SYSSTATUS0x0014
@@ -168,12 +175,22 @@ static struct gpio_bank gpio_bank_730[7] = {
 #endif
 
 #ifdef CONFIG_ARCH_OMAP24XX
-static struct gpio_bank gpio_bank_24xx[4] = {
-   { OMAP24XX_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,   
METHOD_GPIO_24XX },
-   { OMAP24XX_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,  
METHOD_GPIO_24XX },
-   { OMAP24XX_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,  
METHOD_GPIO_24XX },
-   { OMAP24XX_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,  
METHOD_GPIO_24XX },
+
+static struct gpio_bank gpio_bank_242x[4] = {
+   { OMAP242X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,   
METHOD_GPIO_24XX },
+   { OMAP242X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,  
METHOD_GPIO_24XX },
+   { OMAP242X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,  
METHOD_GPIO_24XX },
+   { OMAP242X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,  
METHOD_GPIO_24XX },
 };
+
+static struct gpio_bank gpio_bank_243x[5] = {
+   { OMAP243X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE,   
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32,  
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64,  
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96,  
METHOD_GPIO_24XX },
+   { OMAP243X_GPIO5_BASE, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128, 
METHOD_GPIO_24XX },
+};
+
 #endif
 
 static struct gpio_bank *gpio_bank;
@@ -1113,6 +1130,11 @@ stati

ARM: OMAP: speed up gpio irq handling

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=58781016c3637caf314ca7f579ce0acd1b0378dc
Commit: 58781016c3637caf314ca7f579ce0acd1b0378dc
Parent: 56a2564185db752d83bbc78be9b1e257bf103444
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:14:10 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:57:01 2007 +0100

ARM: OMAP: speed up gpio irq handling

Speedup and shrink GPIO irq handling code, by using a pointer
that's available in the irq_chip structure instead of calling
the get_gpio_bank() function.  On OMAP1 this saves 44 words,
most of which were in IRQ critical path methods.  Hey, every
few instructions help.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/gpio.c |   17 +
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 1da7a5d..14a3f71 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -584,7 +584,7 @@ static int gpio_irq_type(unsigned irq, unsigned type)
&& (type & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH)))
return -EINVAL;
 
-   bank = get_gpio_bank(gpio);
+   bank = get_irq_chip_data(irq);
spin_lock(&bank->lock);
retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
if (retval == 0) {
@@ -823,7 +823,7 @@ static int gpio_wake_enable(unsigned int irq, unsigned int 
enable)
 
if (check_gpio(gpio) < 0)
return -ENODEV;
-   bank = get_gpio_bank(gpio);
+   bank = get_irq_chip_data(irq);
retval = _set_gpio_wakeup(bank, get_gpio_index(gpio), enable);
 
return retval;
@@ -1038,7 +1038,7 @@ static void gpio_irq_handler(unsigned int irq, struct 
irq_desc *desc)
 static void gpio_irq_shutdown(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_reset_gpio(bank, gpio);
 }
@@ -1046,7 +1046,7 @@ static void gpio_irq_shutdown(unsigned int irq)
 static void gpio_ack_irq(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_clear_gpio_irqstatus(bank, gpio);
 }
@@ -1054,7 +1054,7 @@ static void gpio_ack_irq(unsigned int irq)
 static void gpio_mask_irq(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio, 0);
 }
@@ -1063,7 +1063,7 @@ static void gpio_unmask_irq(unsigned int irq)
 {
unsigned int gpio = irq - IH_GPIO_BASE;
unsigned int gpio_idx = get_gpio_index(gpio);
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio_idx, 1);
 }
@@ -1092,7 +1092,7 @@ static void mpuio_ack_irq(unsigned int irq)
 static void mpuio_mask_irq(unsigned int irq)
 {
unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio, 0);
 }
@@ -1100,7 +1100,7 @@ static void mpuio_mask_irq(unsigned int irq)
 static void mpuio_unmask_irq(unsigned int irq)
 {
unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE);
-   struct gpio_bank *bank = get_gpio_bank(gpio);
+   struct gpio_bank *bank = get_irq_chip_data(irq);
 
_set_gpio_irqenable(bank, gpio, 1);
 }
@@ -1275,6 +1275,7 @@ static int __init _omap_gpio_init(void)
 #endif
for (j = bank->virtual_irq_start;
 j < bank->virtual_irq_start + gpio_count; j++) {
+   set_irq_chip_data(j, bank);
if (bank_is_mpuio(bank))
set_irq_chip(j, &mpuio_irq_chip);
else
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ARM: OMAP: MPUIO wake updates

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=11a78b7944963a8b052be46108d07a3ced9e2762
Commit: 11a78b7944963a8b052be46108d07a3ced9e2762
Parent: 58781016c3637caf314ca7f579ce0acd1b0378dc
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 6 17:14:11 2006 -0800
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:57:17 2007 +0100

ARM: OMAP: MPUIO wake updates

GPIO and MPUIO wake updates:

 - Hook MPUIOs into the irq wakeup framework too.  This uses a platform
   device to update irq enables during system sleep states, instead of
   a sys_device, since the latter is no longer needed for such things.

 - Also forward enable/disable irq wake requests to the relevant GPIO
   controller, so the top level IRQ dispatcher can (eventually) handle
   these wakeup events automatically if more than one GPIO pin needs to
   be a wakeup event source.

 - Minor tweak to the 24xx non-wakeup gpio stuff: no need to check such
   read-only data under the spinlock.

This assumes (maybe wrongly?) that only 16xx can do GPIO wakeup; without
a 15xx I can't test such stuff.

Also this expects the top level IRQ dispatcher to properly handle requests
to enable/disable irq wake, which is currently known to be wrong:  omap1
saves the flags but ignores them, omap2 doesn't even save it.  (Wakeup
events are, wrongly, hardwired in the relevant mach-omapX/pm.c file ...)
So MPUIO irqs won't yet trigger system wakeup.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/gpio.c |   93 -
 1 files changed, 83 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 14a3f71..df0ff0f 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -773,29 +773,35 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int 
gpio, int enable)
 {
switch (bank->method) {
 #ifdef CONFIG_ARCH_OMAP16XX
+   case METHOD_MPUIO:
case METHOD_GPIO_1610:
spin_lock(&bank->lock);
-   if (enable)
+   if (enable) {
bank->suspend_wakeup |= (1 << gpio);
-   else
+   enable_irq_wake(bank->irq);
+   } else {
+   disable_irq_wake(bank->irq);
bank->suspend_wakeup &= ~(1 << gpio);
+   }
spin_unlock(&bank->lock);
return 0;
 #endif
 #ifdef CONFIG_ARCH_OMAP24XX
case METHOD_GPIO_24XX:
+   if (bank->non_wakeup_gpios & (1 << gpio)) {
+   printk(KERN_ERR "Unable to modify wakeup on "
+   "non-wakeup GPIO%d\n",
+   (bank - gpio_bank) * 32 + gpio);
+   return -EINVAL;
+   }
spin_lock(&bank->lock);
if (enable) {
-   if (bank->non_wakeup_gpios & (1 << gpio)) {
-   printk(KERN_ERR "Unable to enable wakeup on "
-   "non-wakeup GPIO%d\n",
-   (bank - gpio_bank) * 32 + gpio);
-   spin_unlock(&bank->lock);
-   return -EINVAL;
-   }
bank->suspend_wakeup |= (1 << gpio);
-   } else
+   enable_irq_wake(bank->irq);
+   } else {
+   disable_irq_wake(bank->irq);
bank->suspend_wakeup &= ~(1 << gpio);
+   }
spin_unlock(&bank->lock);
return 0;
 #endif
@@ -,16 +1117,81 @@ static struct irq_chip mpuio_irq_chip = {
.mask   = mpuio_mask_irq,
.unmask = mpuio_unmask_irq,
.set_type   = gpio_irq_type,
+#ifdef CONFIG_ARCH_OMAP16XX
+   /* REVISIT: assuming only 16xx supports MPUIO wake events */
+   .set_wake   = gpio_wake_enable,
+#endif
 };
 
 
 #define bank_is_mpuio(bank)((bank)->method == METHOD_MPUIO)
 
+
+#ifdef CONFIG_ARCH_OMAP16XX
+
+#include 
+
+static int omap_mpuio_suspend_late(struct platform_device *pdev, pm_message_t 
mesg)
+{
+   struct gpio_bank*bank = platform_get_drvdata(pdev);
+   void __iomem*mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT;
+
+   spin_lock(&bank->lock);
+   bank->saved_wakeup = __raw_readl(mask_reg);
+   __raw_writel(0x & ~bank->suspend_wakeup, mask_reg);
+   spin_unlock(&bank->lock);
+
+   return 0;
+}
+
+static int omap_mpuio_resume_early(struct platform_device *pdev)
+{
+   struct gpio_bank  

ARM: OMAP: fix OMAP1 mpuio suspend/resume oops

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fcf126d847c41461d4f034b11541296f3e15d0b2
Commit: fcf126d847c41461d4f034b11541296f3e15d0b2
Parent: 11a78b7944963a8b052be46108d07a3ced9e2762
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 2 12:46:47 2007 -0700
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:57:38 2007 +0100

ARM: OMAP: fix OMAP1 mpuio suspend/resume oops

Fix oops in omap16xx mpuio suspend/resume code; field wasn't initialized

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Tony Lindgren <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-omap/gpio.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index df0ff0f..9dc6d36 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1178,6 +1178,8 @@ static struct platform_device omap_mpuio_device = {
 
 static inline void mpuio_init(void)
 {
+   platform_set_drvdata(&omap_mpuio_device, &gpio_bank_1610[0]);
+
if (platform_driver_register(&omap_mpuio_driver) == 0)
(void) platform_device_register(&omap_mpuio_device);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4236/2: basic {enable,disable}_irq_wake() support for PXA

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4fe4a2bf9a687fc87ea796c234da8c59df763aab
Commit: 4fe4a2bf9a687fc87ea796c234da8c59df763aab
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Philipp Zabel <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 26 01:44:57 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:36:44 2007 +0100

[ARM] 4236/2: basic {enable,disable}_irq_wake() support for PXA

pxa_set_gpio_wake handles GPIOs > 1, so IRQ_TO_GPIO has to be used
instead of just substracting IRQ_GPIO0 from the irq number.
---
 arch/arm/mach-pxa/irq.c |   72 +-
 1 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 9f7499b..4619d5f 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -38,11 +38,33 @@ static void pxa_unmask_low_irq(unsigned int irq)
ICMR |= (1 << (irq + PXA_IRQ_SKIP));
 }
 
+static int pxa_set_wake(unsigned int irq, unsigned int on)
+{
+   u32 mask;
+
+   switch (irq) {
+   case IRQ_RTCAlrm:
+   mask = PWER_RTC;
+   break;
+#ifdef CONFIG_PXA27x
+   /* REVISIT can handle USBH1, USBH2, USB, MSL, USIM, ... */
+#endif
+   default:
+   return -EINVAL;
+   }
+   if (on)
+   PWER |= mask;
+   else
+   PWER &= ~mask;
+   return 0;
+}
+
 static struct irq_chip pxa_internal_chip_low = {
.name   = "SC",
.ack= pxa_mask_low_irq,
.mask   = pxa_mask_low_irq,
.unmask = pxa_unmask_low_irq,
+   .set_wake   = pxa_set_wake,
 };
 
 #if PXA_INTERNAL_IRQS > 32
@@ -70,6 +92,26 @@ static struct irq_chip pxa_internal_chip_high = {
 
 #endif
 
+/* Note that if an input/irq line ever gets changed to an output during
+ * suspend, the relevant PWER, PRER, and PFER bits should be cleared.
+ */
+#ifdef CONFIG_PXA27x
+
+/* PXA27x:  Various gpios can issue wakeup events.  This logic only
+ * handles the simple cases, not the WEMUX2 and WEMUX3 options
+ */
+#define PXA27x_GPIO_NOWAKE_MASK \
+   ((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2))
+#defineWAKEMASK(gpio) \
+   (((gpio) <= 15) \
+   ? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \
+   : ((gpio == 35) ? (1 << 24) : 0))
+#else
+
+/* pxa 210, 250, 255, 26x:  gpios 0..15 can issue wakeups */
+#defineWAKEMASK(gpio) (((gpio) <= 15) ? (1 << (gpio)) : 0)
+#endif
+
 /*
  * PXA GPIO edge detection for IRQs:
  * IRQs are generated on Falling-Edge, Rising-Edge, or both.
@@ -83,9 +125,11 @@ static long GPIO_IRQ_mask[4];
 static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
 {
int gpio, idx;
+   u32 mask;
 
gpio = IRQ_TO_GPIO(irq);
idx = gpio >> 5;
+   mask = WAKEMASK(gpio);
 
if (type == IRQT_PROBE) {
/* Don't mess with enabled GPIOs using preconfigured edges or
@@ -105,14 +149,20 @@ static int pxa_gpio_irq_type(unsigned int irq, unsigned 
int type)
if (type & __IRQT_RISEDGE) {
/* printk("rising "); */
__set_bit (gpio, GPIO_IRQ_rising_edge);
-   } else
+   PRER |= mask;
+   } else {
__clear_bit (gpio, GPIO_IRQ_rising_edge);
+   PRER &= ~mask;
+   }
 
if (type & __IRQT_FALEDGE) {
/* printk("falling "); */
__set_bit (gpio, GPIO_IRQ_falling_edge);
-   } else
+   PFER |= mask;
+   } else {
__clear_bit (gpio, GPIO_IRQ_falling_edge);
+   PFER &= ~mask;
+   }
 
/* printk("edges\n"); */
 
@@ -130,12 +180,29 @@ static void pxa_ack_low_gpio(unsigned int irq)
GEDR0 = (1 << (irq - IRQ_GPIO0));
 }
 
+static int pxa_set_gpio_wake(unsigned int irq, unsigned int on)
+{
+   int gpio = IRQ_TO_GPIO(irq);
+   u32 mask = WAKEMASK(gpio);
+
+   if (!mask)
+   return -EINVAL;
+
+   if (on)
+   PWER |= mask;
+   else
+   PWER &= ~mask;
+   return 0;
+}
+
+
 static struct irq_chip pxa_low_gpio_chip = {
.name   = "GPIO-l",
.ack= pxa_ack_low_gpio,
.mask   = pxa_mask_low_irq,
.unmask = pxa_unmask_low_irq,
.set_type   = pxa_gpio_irq_type,
+   .set_wake   = pxa_set_gpio_wake,
 };
 
 /*
@@ -244,6 +311,7 @@ static struct irq_chip pxa_muxed_gpio_chip = {
.mask   = pxa_mask_muxed_gpio,
.unmask = pxa_unmask_muxed_gpio,
.set_type   = pxa_gpio_irq_type,
+   .set_wake   = pxa_set_gpio_wake,
 };
 
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4246/1: i2c-pxa: add adapter class to platform specific data

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a79220b7633b3926a9bd3527bdac3f04dbe6845c
Commit: a79220b7633b3926a9bd3527bdac3f04dbe6845c
Parent: 4fe4a2bf9a687fc87ea796c234da8c59df763aab
Author: Matej Kenda <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 5 13:06:40 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:36:55 2007 +0100

[ARM] 4246/1: i2c-pxa: add adapter class to platform specific data

Reposted patch for kernel 2.6.21-rc2.

The driver i2c-pxa doesn't set the class member in i2c_adapter, which
is used to register the I2C adapter. The hwmon (sensors) drivers (e.g.
adm1021) that are connected to a i2c-pxa adapter don't attach because
they expect that the adapter supports class I2C_CLASS_HWMON.

This patch adds functionality to allow platforms to set the class and
pass it as platform_data to the i2c-pxa driver. Sample usage in
platform code:

static struct i2c_pxa_platform_data my_i2c_platform_data = {
.class = I2C_CLASS_HWMON
};

static void __init my_platform_init(void)
{
(void) platform_add_devices(devices, ARRAY_SIZE(devices));

pxa_set_i2c_info(&my_i2c_platform_data);
}

Signed-off-by: Matej Kenda <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-pxa.c   |6 --
 include/asm-arm/arch-pxa/i2c.h |1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 14e83d0..11c7477 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -839,9 +839,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 {
struct pxa_i2c *i2c = &i2c_pxa;
struct resource *res;
-#ifdef CONFIG_I2C_PXA_SLAVE
struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
-#endif
int ret;
int irq;
 
@@ -911,6 +909,10 @@ static int i2c_pxa_probe(struct platform_device *dev)
i2c->adap.algo_data = i2c;
i2c->adap.dev.parent = &dev->dev;
 
+   if (plat) {
+   i2c->adap.class = plat->class;
+   }
+
ret = i2c_add_adapter(&i2c->adap);
if (ret < 0) {
printk(KERN_INFO "I2C: Failed to add bus\n");
diff --git a/include/asm-arm/arch-pxa/i2c.h b/include/asm-arm/arch-pxa/i2c.h
index 46ec224..e404b23 100644
--- a/include/asm-arm/arch-pxa/i2c.h
+++ b/include/asm-arm/arch-pxa/i2c.h
@@ -64,6 +64,7 @@ struct i2c_slave_client;
 struct i2c_pxa_platform_data {
unsigned intslave_addr;
struct i2c_slave_client *slave;
+   unsigned intclass;
 };
 
 extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4304/1: removes the unnecessary bit number from CKENnn_XXXX

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7053acbd78336abf5d4bc3d8a875a03624cfb83f
Commit: 7053acbd78336abf5d4bc3d8a875a03624cfb83f
Parent: a79220b7633b3926a9bd3527bdac3f04dbe6845c
Author: Eric Miao <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 5 04:07:20 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 23:14:01 2007 +0100

[ARM] 4304/1: removes the unnecessary bit number from CKENnn_

This patch removes the unnecessary bit number from CKENnn_
definitions for PXA, so that

CKEN0_PWM0 --> CKEN_PWM0
CKEN1_PWM1 --> CKEN_PWM1
...
CKEN24_CAMERA --> CKEN_CAMERA

The reasons for the change of these defitions are:

1. they do not scale - they are currently valid for pxa2xx, but
definitely not valid for pxa3xx, e.g., pxa3xx has bit 3 for camera
instead of bit 24

2. they are unnecessary - the peripheral name within the definition
has already announced its usage, we don't need those bit numbers
to know which peripheral we are going to enable/disable clock for

3. they are inconvenient - think about this: a driver programmer
for pxa has to remember which bit in the CKEN register to turn
on/off

Another change in the patch is to make the definitions equal to its
clock bit index, so that

   #define CKEN_CAMERA  (24)

instead of

   #define CKEN_CAMERA  (1 << 24)

this change, however, will add a run-time bit shift operation in
pxa_set_cken(), but the benefit of this change is that it scales
when bit index exceeds 32, e.g., pxa3xx has two registers CKENA
and CKENB, totally 64 bit for this, suppose CAMERA clock enabling
bit is CKENB:10, one can simply define CKEN_CAMERA to be (32 + 10)
and so that pxa_set_cken() need minimum change to adapt to that.

Signed-off-by: eric miao <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 Documentation/spi/pxa2xx|2 +-
 arch/arm/mach-pxa/generic.c |4 +-
 arch/arm/mach-pxa/lpd270.c  |4 +-
 arch/arm/mach-pxa/lubbock.c |2 +-
 arch/arm/mach-pxa/mainstone.c   |4 +-
 arch/arm/mach-pxa/pxa27x.c  |4 +-
 arch/arm/mach-pxa/ssp.c |   12 +++---
 drivers/i2c/busses/i2c-pxa.c|   12 +++---
 drivers/mmc/pxamci.c|4 +-
 drivers/net/irda/pxaficp_ir.c   |   12 +++---
 drivers/serial/pxa.c|8 ++--
 drivers/usb/gadget/pxa2xx_udc.c |4 +-
 drivers/usb/host/ohci-pxa27x.c  |4 +-
 drivers/video/pxafb.c   |4 +-
 include/asm-arm/arch-pxa/pxa-regs.h |   58 +-
 sound/arm/pxa2xx-ac97.c |   12 +++---
 sound/soc/pxa/pxa2xx-ac97.c |   12 +++---
 sound/soc/pxa/pxa2xx-i2s.c  |4 +-
 18 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx
index f9717fe..215e3b8 100644
--- a/Documentation/spi/pxa2xx
+++ b/Documentation/spi/pxa2xx
@@ -62,7 +62,7 @@ static struct resource pxa_spi_nssp_resources[] = {
 
 static struct pxa2xx_spi_master pxa_nssp_master_info = {
.ssp_type = PXA25x_NSSP, /* Type of SSP */
-   .clock_enable = CKEN9_NSSP, /* NSSP Peripheral clock */
+   .clock_enable = CKEN_NSSP, /* NSSP Peripheral clock */
.num_chipselect = 1, /* Matches the number of chips attached to NSSP */
.enable_dma = 1, /* Enables NSSP DMA */
 };
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index b8cb79f..64b08b7 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -164,9 +164,9 @@ void pxa_set_cken(int clock, int enable)
local_irq_save(flags);
 
if (enable)
-   CKEN |= clock;
+   CKEN |= (1 << clock);
else
-   CKEN &= ~clock;
+   CKEN &= ~(1 << clock);
 
local_irq_restore(flags);
 }
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 8e27a64..e309766 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -234,7 +234,7 @@ static void lpd270_backlight_power(int on)
 {
if (on) {
pxa_gpio_mode(GPIO16_PWM0_MD);
-   pxa_set_cken(CKEN0_PWM0, 1);
+   pxa_set_cken(CKEN_PWM0, 1);
PWM_CTRL0 = 0;
PWM_PWDUTY0 = 0x3ff;
PWM_PERVAL0 = 0x3ff;
@@ -242,7 +242,7 @@ static void lpd270_backlight_power(int on)
PWM_CTRL0 = 0;
PWM_PWDUTY0 = 0x0;
PWM_PERVAL0 = 0x3FF;
-   pxa_set_cken(CKEN0_PWM0, 0);
+   pxa_set_cken(CKEN_PWM0, 0);
}
 }
 
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 055de7f..6377b2e 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ 

[ARM] Set coherent DMA mask for Acorn expansion cards

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69f4f331a0f78470f0bc42ba8db8d6cdd9cae4a9
Commit: 69f4f331a0f78470f0bc42ba8db8d6cdd9cae4a9
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 2 13:53:15 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:16:55 2007 +0100

[ARM] Set coherent DMA mask for Acorn expansion cards

Although expansion cards can't do bus-master DMA, subsystems
want to be able to use coherent memory for DMA purposes to
these cards.  Therefore, set the coherent DMA mask to allow
such memory to be allocated.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/ecard.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index f1c0fb9..6eb80ac 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -825,6 +825,7 @@ static struct expansion_card *__init ecard_alloc_card(int 
type, int slot)
ec->dev.bus = &ecard_bus_type;
ec->dev.dma_mask = &ec->dma_mask;
ec->dma_mask = (u64)0x;
+   ec->dev.coherent_dma_mask = ec->dma_mask;
 
if (slot < 4) {
ec_set_resource(ec, ECARD_RES_MEMC,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Add platform support for PATA on RiscPC

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a17dba8df9848c548912fbe9bf4b28c5a67c5413
Commit: a17dba8df9848c548912fbe9bf4b28c5a67c5413
Parent: 69f4f331a0f78470f0bc42ba8db8d6cdd9cae4a9
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 21 15:55:06 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:16:55 2007 +0100

[ARM] Add platform support for PATA on RiscPC

Add pata_platform device for RiscPC, thereby converting the primary
IDE channel on the machine to PATA.

Acked-by: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-rpc/riscpc.c |   35 +++
 drivers/ata/Kconfig|2 +-
 2 files changed, 36 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 208a2b5..570cf93 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -159,11 +160,45 @@ static struct platform_device serial_device = {
},
 };
 
+static struct pata_platform_info pata_platform_data = {
+   .ioport_shift   = 2,
+};
+
+static struct resource pata_resources[] = {
+   [0] = {
+   .start  = 0x030107c0,
+   .end= 0x030107df,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = 0x03010fd8,
+   .end= 0x03010fdb,
+   .flags  = IORESOURCE_MEM,
+   },
+   [2] = {
+   .start  = IRQ_HARDDISK,
+   .end= IRQ_HARDDISK,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct platform_device pata_device = {
+   .name   = "pata_platform",
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(pata_resources),
+   .resource   = pata_resources,
+   .dev= {
+   .platform_data  = &pata_platform_data,
+   .coherent_dma_mask = ~0,/* grumble */
+   },
+};
+
 static struct platform_device *devs[] __initdata = {
&iomd_device,
&kbd_device,
&serial_device,
&acornfb_device,
+   &pata_device,
 };
 
 static int __init rpc_init(void)
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 7bdbe5a..e0820e8 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -545,7 +545,7 @@ config PATA_WINBOND_VLB
 
 config PATA_PLATFORM
tristate "Generic platform device PATA support"
-   depends on EMBEDDED
+   depends on EMBEDDED || ARCH_RPC
help
  This option enables support for generic directly connected ATA
  devices commonly found on embedded systems.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Add support for ICSIDE interface on RiscPC

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73b6a2be8b29b2067aa3c0f1d6433b6148d88705
Commit: 73b6a2be8b29b2067aa3c0f1d6433b6148d88705
Parent: a17dba8df9848c548912fbe9bf4b28c5a67c5413
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 09:55:52 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:16:56 2007 +0100

[ARM] Add support for ICSIDE interface on RiscPC

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 drivers/ata/Kconfig   |8 +
 drivers/ata/Makefile  |1 +
 drivers/ata/pata_icside.c |  686 +
 3 files changed, 695 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index e0820e8..77846dd 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -552,6 +552,14 @@ config PATA_PLATFORM
 
  If unsure, say N.
 
+config PATA_ICSIDE
+   tristate "Acorn ICS PATA support"
+   depends on ARM && ARCH_ACORN
+   help
+ On Acorn systems, say Y here if you wish to use the ICS PATA
+ interface card.  This is not required for ICS partition support.
+ If you are unsure, say N to this.
+
 config PATA_IXP4XX_CF
tristate "IXP4XX Compact Flash support"
depends on ARCH_IXP4XX
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index 13d7397..cc8798b 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_PATA_TRIFLEX)+= pata_triflex.o
 obj-$(CONFIG_PATA_IXP4XX_CF)   += pata_ixp4xx_cf.o
 obj-$(CONFIG_PATA_SCC) += pata_scc.o
 obj-$(CONFIG_PATA_PLATFORM)+= pata_platform.o
+obj-$(CONFIG_PATA_ICSIDE)  += pata_icside.o
 # Should be last but one libata driver
 obj-$(CONFIG_ATA_GENERIC)  += ata_generic.o
 # Should be last libata driver
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
new file mode 100644
index 000..dbc8ee2
--- /dev/null
+++ b/drivers/ata/pata_icside.c
@@ -0,0 +1,686 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define DRV_NAME   "pata_icside"
+
+#define ICS_IDENT_OFFSET   0x2280
+
+#define ICS_ARCIN_V5_INTRSTAT  0x
+#define ICS_ARCIN_V5_INTROFFSET0x0004
+
+#define ICS_ARCIN_V6_INTROFFSET_1  0x2200
+#define ICS_ARCIN_V6_INTRSTAT_10x2290
+#define ICS_ARCIN_V6_INTROFFSET_2  0x3200
+#define ICS_ARCIN_V6_INTRSTAT_20x3290
+
+struct portinfo {
+   unsigned int dataoffset;
+   unsigned int ctrloffset;
+   unsigned int stepping;
+};
+
+static const struct portinfo pata_icside_portinfo_v5 = {
+   .dataoffset = 0x2800,
+   .ctrloffset = 0x2b80,
+   .stepping   = 6,
+};
+
+static const struct portinfo pata_icside_portinfo_v6_1 = {
+   .dataoffset = 0x2000,
+   .ctrloffset = 0x2380,
+   .stepping   = 6,
+};
+
+static const struct portinfo pata_icside_portinfo_v6_2 = {
+   .dataoffset = 0x3000,
+   .ctrloffset = 0x3380,
+   .stepping   = 6,
+};
+
+#define PATA_ICSIDE_MAX_SG 128
+
+struct pata_icside_state {
+   void __iomem *irq_port;
+   void __iomem *ioc_base;
+   unsigned int type;
+   unsigned int dma;
+   struct {
+   u8 port_sel;
+   u8 disabled;
+   unsigned int speed[ATA_MAX_DEVICES];
+   } port[2];
+   struct scatterlist sg[PATA_ICSIDE_MAX_SG];
+};
+
+#define ICS_TYPE_A3IN  0
+#define ICS_TYPE_A3USER1
+#define ICS_TYPE_V63
+#define ICS_TYPE_V515
+#define ICS_TYPE_NOTYPE((unsigned int)-1)
+
+/*  Version 5 PCB Support Functions - */
+/* Prototype: pata_icside_irqenable_arcin_v5 (struct expansion_card *ec, int 
irqnr)
+ * Purpose  : enable interrupts from card
+ */
+static void pata_icside_irqenable_arcin_v5 (struct expansion_card *ec, int 
irqnr)
+{
+   struct pata_icside_state *state = ec->irq_data;
+
+   writeb(0, state->irq_port + ICS_ARCIN_V5_INTROFFSET);
+}
+
+/* Prototype: pata_icside_irqdisable_arcin_v5 (struct expansion_card *ec, int 
irqnr)
+ * Purpose  : disable interrupts from card
+ */
+static void pata_icside_irqdisable_arcin_v5 (struct expansion_card *ec, int 
irqnr)
+{
+   struct pata_icside_state *state = ec->irq_data;
+
+   readb(state->irq_port + ICS_ARCIN_V5_INTROFFSET);
+}
+
+static const expansioncard_ops_t pata_icside_ops_arcin_v5 = {
+   .irqenable  = pata_icside_irqenable_arcin_v5,
+   .irqdisable = pata_icside_irqdisable_arcin_v5,
+};
+
+
+/*  Version 6 PCB Support Functions - */
+/* Prototype: pata_icside_irqenable_arcin_v6 (struct expansion_card *ec, int 
irqnr)
+ * Purpose  : enable interrupts from card
+ */
+static void pata_icside_irqenable_arcin_v6 (struct expansion_card *ec, int 
irqnr)
+{
+   struct pata_icside_

[ARM] ecard: convert to use the kthread API

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=134c99e907ef2572cdaa148c191984b95d671981
Commit: 134c99e907ef2572cdaa148c191984b95d671981
Parent: 73b6a2be8b29b2067aa3c0f1d6433b6148d88705
Author: Eric W. Biederman <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 00:04:40 2007 -0700
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:16:56 2007 +0100

[ARM] ecard: convert to use the kthread API

This patch modifies the startup of kecardd to use kthread_run not a
kernel_thread combination of kernel_thread and daemonize.  Making the code
slightly simpler and more maintainable.

Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/ecard.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 6eb80ac..869de6d 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -263,8 +264,6 @@ static int ecard_init_mm(void)
 static int
 ecard_task(void * unused)
 {
-   daemonize("kecardd");
-
/*
 * Allocate a mm.  We're not a lazy-TLB kernel task since we need
 * to set page table entries where the user space would be.  Note
@@ -1059,13 +1058,14 @@ ecard_probe(int slot, card_type_t type)
  */
 static int __init ecard_init(void)
 {
-   int slot, irqhw, ret;
+   struct task_struct *task;
+   int slot, irqhw;
 
-   ret = kernel_thread(ecard_task, NULL, CLONE_KERNEL);
-   if (ret < 0) {
+   task = kthread_run(ecard_task, NULL, "kecardd");
+   if (IS_ERR(task)) {
printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n",
-  ret);
-   return ret;
+  PTR_ERR(task));
+   return PTR_ERR(task);
}
 
printk("Probing expansion cards\n");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] ecard: silence new warning caused by previous commit

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e6aeb47da6e02ec9807d30a368d4fc37972b022f
Commit: e6aeb47da6e02ec9807d30a368d4fc37972b022f
Parent: 134c99e907ef2572cdaa148c191984b95d671981
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 10:55:46 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:16:56 2007 +0100

[ARM] ecard: silence new warning caused by previous commit

PTR_ERR()'s type is unsigned long, so formats when printing
must be %ld, not %d.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/ecard.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 869de6d..64d5ba1 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -1063,7 +1063,7 @@ static int __init ecard_init(void)
 
task = kthread_run(ecard_task, NULL, "kecardd");
if (IS_ERR(task)) {
-   printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n",
+   printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n",
   PTR_ERR(task));
return PTR_ERR(task);
}
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] ecard: Move private ecard junk out of asm/ecard.h

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0b04d1b2c427629b2dbe066422a507ad855bf61
Commit: c0b04d1b2c427629b2dbe066422a507ad855bf61
Parent: e6aeb47da6e02ec9807d30a368d4fc37972b022f
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 10:20:47 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:16:56 2007 +0100

[ARM] ecard: Move private ecard junk out of asm/ecard.h

Move ecard.c private junk from asm/ecard.h to a local header file.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/ecard.c |2 +
 arch/arm/kernel/ecard.h |   56 +++
 include/asm-arm/ecard.h |   50 -
 3 files changed, 58 insertions(+), 50 deletions(-)

diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 64d5ba1..85f4db6 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -51,6 +51,8 @@
 #include 
 #include 
 
+#include "ecard.h"
+
 #ifndef CONFIG_ARCH_RPC
 #define HAVE_EXPMASK
 #endif
diff --git a/arch/arm/kernel/ecard.h b/arch/arm/kernel/ecard.h
new file mode 100644
index 000..d7c2dac
--- /dev/null
+++ b/arch/arm/kernel/ecard.h
@@ -0,0 +1,56 @@
+/*
+ *  ecard.h
+ *
+ *  Copyright 2007 Russell King
+ *
+ * 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.
+ */
+
+/* Definitions internal to ecard.c - for it's use only!!
+ *
+ * External expansion card header as read from the card
+ */
+struct ex_ecid {
+   unsigned char   r_irq:1;
+   unsigned char   r_zero:1;
+   unsigned char   r_fiq:1;
+   unsigned char   r_id:4;
+   unsigned char   r_a:1;
+
+   unsigned char   r_cd:1;
+   unsigned char   r_is:1;
+   unsigned char   r_w:2;
+   unsigned char   r_r1:4;
+
+   unsigned char   r_r2:8;
+
+   unsigned char   r_prod[2];
+
+   unsigned char   r_manu[2];
+
+   unsigned char   r_country;
+
+   unsigned char   r_fiqmask;
+   unsigned char   r_fiqoff[3];
+
+   unsigned char   r_irqmask;
+   unsigned char   r_irqoff[3];
+};
+
+/*
+ * Chunk directory entry as read from the card
+ */
+struct ex_chunk_dir {
+   unsigned char r_id;
+   unsigned char r_len[3];
+   unsigned long r_start;
+   union {
+   char string[256];
+   char data[1];
+   } d;
+#define c_id(x)((x)->r_id)
+#define c_len(x)   ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
+#define c_start(x) ((x)->r_start)
+};
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
index a0ae2b9..bd4b576 100644
--- a/include/asm-arm/ecard.h
+++ b/include/asm-arm/ecard.h
@@ -224,56 +224,6 @@ ecard_address(struct expansion_card *ec, card_type_t type, 
card_speed_t speed)
 extern int ecard_request_resources(struct expansion_card *ec);
 extern void ecard_release_resources(struct expansion_card *ec);
 
-#ifdef ECARD_C
-/* Definitions internal to ecard.c - for it's use only!!
- *
- * External expansion card header as read from the card
- */
-struct ex_ecid {
-   unsigned char   r_irq:1;
-   unsigned char   r_zero:1;
-   unsigned char   r_fiq:1;
-   unsigned char   r_id:4;
-   unsigned char   r_a:1;
-
-   unsigned char   r_cd:1;
-   unsigned char   r_is:1;
-   unsigned char   r_w:2;
-   unsigned char   r_r1:4;
-
-   unsigned char   r_r2:8;
-
-   unsigned char   r_prod[2];
-
-   unsigned char   r_manu[2];
-
-   unsigned char   r_country;
-
-   unsigned char   r_fiqmask;
-   unsigned char   r_fiqoff[3];
-
-   unsigned char   r_irqmask;
-   unsigned char   r_irqoff[3];
-};
-
-/*
- * Chunk directory entry as read from the card
- */
-struct ex_chunk_dir {
-   unsigned char r_id;
-   unsigned char r_len[3];
-   unsigned long r_start;
-   union {
-   char string[256];
-   char data[1];
-   } d;
-#define c_id(x)((x)->r_id)
-#define c_len(x)   ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
-#define c_start(x) ((x)->r_start)
-};
-
-#endif
-
 extern struct bus_type ecard_bus_type;
 
 #define ECARD_DEV(_d)  container_of((_d), struct expansion_card, dev)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] ecard: Convert card type enum to a flag

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5559bca8e66f968192a5416d953c88cc3389cb22
Commit: 5559bca8e66f968192a5416d953c88cc3389cb22
Parent: c0b04d1b2c427629b2dbe066422a507ad855bf61
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Thu May 3 10:47:37 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu May 3 14:16:56 2007 +0100

[ARM] ecard: Convert card type enum to a flag

'type' in the struct expansion_card is only used to indicate
whether this card is an EASI card or not.  Therefore, having
it as an enum is wasteful (and introduces additional noise
when we come to remove the enum.)  Convert it to a mere flag
instead.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/ecard.c |   10 +-
 include/asm-arm/ecard.h |2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 85f4db6..bdbd7da 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -126,7 +126,7 @@ static void ecard_task_reset(struct ecard_request *req)
 
res = ec->slot_no == 8
? &ec->resource[ECARD_RES_MEMC]
-   : ec->type == ECARD_EASI
+   : ec->easi
  ? &ec->resource[ECARD_RES_EASI]
  : &ec->resource[ECARD_RES_IOCSYNC];
 
@@ -181,7 +181,7 @@ static void ecard_task_readbytes(struct ecard_request *req)
index += 1;
}
} else {
-   unsigned long base = (ec->type == ECARD_EASI
+   unsigned long base = (ec->easi
 ? &ec->resource[ECARD_RES_EASI]
 : &ec->resource[ECARD_RES_IOCSYNC])->start;
void __iomem *pbase = (void __iomem *)base;
@@ -728,7 +728,7 @@ static int ecard_prints(char *buffer, ecard_t *ec)
char *start = buffer;
 
buffer += sprintf(buffer, "  %d: %s ", ec->slot_no,
- ec->type == ECARD_EASI ? "EASI" : "");
+ ec->easi ? "EASI" : "");
 
if (ec->cid.id == 0) {
struct in_chunk_dir incd;
@@ -815,7 +815,7 @@ static struct expansion_card *__init ecard_alloc_card(int 
type, int slot)
}
 
ec->slot_no = slot;
-   ec->type = type;
+   ec->easi = type == ECARD_EASI;
ec->irq = NO_IRQ;
ec->fiq = NO_IRQ;
ec->dma = NO_DMA;
@@ -909,7 +909,7 @@ static ssize_t ecard_show_device(struct device *dev, struct 
device_attribute *at
 static ssize_t ecard_show_type(struct device *dev, struct device_attribute 
*attr, char *buf)
 {
struct expansion_card *ec = ECARD_DEV(dev);
-   return sprintf(buf, "%s\n", ec->type == ECARD_EASI ? "EASI" : "IOC");
+   return sprintf(buf, "%s\n", ec->easi ? "EASI" : "IOC");
 }
 
 static struct device_attribute ecard_dev_attrs[] = {
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
index bd4b576..3a6d3eb 100644
--- a/include/asm-arm/ecard.h
+++ b/include/asm-arm/ecard.h
@@ -160,6 +160,7 @@ struct expansion_card {
unsigned char   irqmask;/* IRQ mask 
*/
unsigned char   fiqmask;/* FIQ mask 
*/
unsigned char   claimed;/* Card claimed?
*/
+   unsigned char   easi;   /* EASI card
*/
 
void*irq_data;  /* Data for use for IRQ by card 
*/
void*fiq_data;  /* Data for use for FIQ by card 
*/
@@ -169,7 +170,6 @@ struct expansion_card {
CONST unsigned int  dma;/* DMA number (for request_dma) 
*/
CONST unsigned int  irq;/* IRQ number (for request_irq) 
*/
CONST unsigned int  fiq;/* FIQ number (for request_irq) 
*/
-   CONST card_type_t   type;   /* Type of card 
*/
CONST struct in_ecidcid;/* Card Identification  
*/
 
/* Private internal data */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4299/1: S3C AC97 fill in register bit defines

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef08574729bcf65bbd1f0c9ad9b9baa9bbd7a830
Commit: ef08574729bcf65bbd1f0c9ad9b9baa9bbd7a830
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Graeme Gregory <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 2 12:00:33 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:53:08 2007 +0100

[ARM] 4299/1: S3C AC97 fill in register bit defines

Create defines in the same styles as other s3c include files
giving names to bits in registers within the AC97 IO unit.

Signed-off-by: Graeme Gregory <[EMAIL PROTECTED]>
Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-s3c2410/regs-ac97.h |   56 ++---
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/include/asm-arm/arch-s3c2410/regs-ac97.h 
b/include/asm-arm/arch-s3c2410/regs-ac97.h
index bdd6a4f..b004dee 100644
--- a/include/asm-arm/arch-s3c2410/regs-ac97.h
+++ b/include/asm-arm/arch-s3c2410/regs-ac97.h
@@ -13,11 +13,55 @@
 #ifndef __ASM_ARCH_REGS_AC97_H
 #define __ASM_ARCH_REGS_AC97_H __FILE__
 
-#define S3C_AC97_GLBCTRL   (0x00)
-#define S3C_AC97_GLBSTAT   (0x04)
-#define S3C_AC97_CODEC_CMD (0x08)
-#define S3C_AC97_PCM_ADDR  (0x10)
-#define S3C_AC97_PCM_DATA  (0x18)
-#define S3C_AC97_MIC_DATA  (0x1C)
+#define S3C_AC97_GLBCTRL   (0x00)
+
+#define S3C_AC97_GLBCTRL_CODECREADYIE  (1<<22)
+#define S3C_AC97_GLBCTRL_PCMOUTURIE(1<<21)
+#define S3C_AC97_GLBCTRL_PCMINORIE (1<<20)
+#define S3C_AC97_GLBCTRL_MICINORIE (1<<19)
+#define S3C_AC97_GLBCTRL_PCMOUTTIE (1<<18)
+#define S3C_AC97_GLBCTRL_PCMINTIE  (1<<17)
+#define S3C_AC97_GLBCTRL_MICINTIE  (1<<16)
+#define S3C_AC97_GLBCTRL_PCMOUTTM_OFF  (0<<12)
+#define S3C_AC97_GLBCTRL_PCMOUTTM_PIO  (1<<12)
+#define S3C_AC97_GLBCTRL_PCMOUTTM_DMA  (2<<12)
+#define S3C_AC97_GLBCTRL_PCMOUTTM_MASK (3<<12)
+#define S3C_AC97_GLBCTRL_PCMINTM_OFF   (0<<10)
+#define S3C_AC97_GLBCTRL_PCMINTM_PIO   (1<<10)
+#define S3C_AC97_GLBCTRL_PCMINTM_DMA   (2<<10)
+#define S3C_AC97_GLBCTRL_PCMINTM_MASK  (3<<10)
+#define S3C_AC97_GLBCTRL_MICINTM_OFF   (0<<8)
+#define S3C_AC97_GLBCTRL_MICINTM_PIO   (1<<8)
+#define S3C_AC97_GLBCTRL_MICINTM_DMA   (2<<8)
+#define S3C_AC97_GLBCTRL_MICINTM_MASK  (3<<8)
+#define S3C_AC97_GLBCTRL_TRANSFERDATAENABLE(1<<3)
+#define S3C_AC97_GLBCTRL_ACLINKON  (1<<2)
+#define S3C_AC97_GLBCTRL_WARMRESET (1<<1)
+#define S3C_AC97_GLBCTRL_COLDRESET (1<<0)
+
+#define S3C_AC97_GLBSTAT   (0x04)
+
+#define S3C_AC97_GLBSTAT_CODECREADY(1<<22)
+#define S3C_AC97_GLBSTAT_PCMOUTUR  (1<<21)
+#define S3C_AC97_GLBSTAT_PCMINORI  (1<<20)
+#define S3C_AC97_GLBSTAT_MICINORI  (1<<19)
+#define S3C_AC97_GLBSTAT_PCMOUTTI  (1<<18)
+#define S3C_AC97_GLBSTAT_PCMINTI   (1<<17)
+#define S3C_AC97_GLBSTAT_MICINTI   (1<<16)
+#define S3C_AC97_GLBSTAT_MAINSTATE_IDLE(0<<0)
+#define S3C_AC97_GLBSTAT_MAINSTATE_INIT(1<<0)
+#define S3C_AC97_GLBSTAT_MAINSTATE_READY   (2<<0)
+#define S3C_AC97_GLBSTAT_MAINSTATE_ACTIVE  (3<<0)
+#define S3C_AC97_GLBSTAT_MAINSTATE_LP  (4<<0)
+#define S3C_AC97_GLBSTAT_MAINSTATE_WARM(5<<0)
+
+#define S3C_AC97_CODEC_CMD (0x08)
+
+#define S3C_AC97_CODEC_CMD_READ(1<<23)
+
+#define S3C_AC97_STAT  (0x0c)
+#define S3C_AC97_PCM_ADDR  (0x10)
+#define S3C_AC97_PCM_DATA  (0x18)
+#define S3C_AC97_MIC_DATA  (0x1C)
 
 #endif /* __ASM_ARCH_REGS_AC97_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4324/1: S3C24XX: remove clocks from s3c24xx_board

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce89c206ac03dfec700cfa538dcbcc347c0683ce
Commit: ce89c206ac03dfec700cfa538dcbcc347c0683ce
Parent: ef08574729bcf65bbd1f0c9ad9b9baa9bbd7a830
Author: Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 20 11:15:27 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:53:14 2007 +0100

[ARM] 4324/1: S3C24XX: remove clocks from s3c24xx_board

Remove the clocks from the s3c24xx_board as part
of the process of simplifying the initialisation
sequence by removing struct s3c24xx_board.

Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-s3c2410/mach-bast.c|4 ++--
 arch/arm/mach-s3c2410/mach-vr1000.c  |4 ++--
 arch/arm/mach-s3c2440/mach-anubis.c  |4 ++--
 arch/arm/mach-s3c2440/mach-osiris.c  |4 ++--
 arch/arm/plat-s3c24xx/clock.c|   12 
 arch/arm/plat-s3c24xx/cpu.c  |9 -
 include/asm-arm/plat-s3c24xx/clock.h |1 +
 include/asm-arm/plat-s3c24xx/cpu.h   |3 ---
 8 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-bast.c 
b/arch/arm/mach-s3c2410/mach-bast.c
index 7b81296..0bb2e8b 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -467,8 +467,6 @@ static struct clk *bast_clocks[] = {
 static struct s3c24xx_board bast_board __initdata = {
.devices   = bast_devices,
.devices_count = ARRAY_SIZE(bast_devices),
-   .clocks= bast_clocks,
-   .clocks_count  = ARRAY_SIZE(bast_clocks),
 };
 
 static void __init bast_map_io(void)
@@ -486,6 +484,8 @@ static void __init bast_map_io(void)
 
s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+   s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
+
s3c_device_nand.dev.platform_data = &bast_nand_info;
s3c_device_i2c.dev.platform_data = &bast_i2c_info;
 
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c 
b/arch/arm/mach-s3c2410/mach-vr1000.c
index c947c75..9380a13 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -387,8 +387,6 @@ static struct clk *vr1000_clocks[] = {
 static struct s3c24xx_board vr1000_board __initdata = {
.devices   = vr1000_devices,
.devices_count = ARRAY_SIZE(vr1000_devices),
-   .clocks= vr1000_clocks,
-   .clocks_count  = ARRAY_SIZE(vr1000_clocks),
 };
 
 static void vr1000_power_off(void)
@@ -412,6 +410,8 @@ static void __init vr1000_map_io(void)
 
s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+   s3c24xx_register_clocks(vr1000_clocks, ARRAY_SIZE(vr1000_clocks));
+
pm_power_off = vr1000_power_off;
 
s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc));
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c 
b/arch/arm/mach-s3c2440/mach-anubis.c
index 3f0288e..0f4e288 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -284,8 +284,6 @@ static struct clk *anubis_clocks[] = {
 static struct s3c24xx_board anubis_board __initdata = {
.devices   = anubis_devices,
.devices_count = ARRAY_SIZE(anubis_devices),
-   .clocks= anubis_clocks,
-   .clocks_count  = ARRAY_SIZE(anubis_clocks),
 };
 
 static void __init anubis_map_io(void)
@@ -303,6 +301,8 @@ static void __init anubis_map_io(void)
 
s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+   s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks));
+
s3c_device_nand.dev.platform_data = &anubis_nand_info;
 
s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c 
b/arch/arm/mach-s3c2440/mach-osiris.c
index 2ed8e51..c987221 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -254,8 +254,6 @@ static struct clk *osiris_clocks[] = {
 static struct s3c24xx_board osiris_board __initdata = {
.devices   = osiris_devices,
.devices_count = ARRAY_SIZE(osiris_devices),
-   .clocks= osiris_clocks,
-   .clocks_count  = ARRAY_SIZE(osiris_clocks),
 };
 
 static void __init osiris_map_io(void)
@@ -275,6 +273,8 @@ static void __init osiris_map_io(void)
 
s3c24xx_uclk.parent  = &s3c24xx_clkout1;
 
+   s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks));
+
s3c_device_nand.dev.platform_data = &osiris_nand_info;
 
s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
diff --git a/arch/arm/plat-s3c24xx/clock.c b/arch/arm/plat-s3c24xx/clock.c
index d3dc03a..79cda0f 100644
--- a/arch/arm/plat-s3c24xx/clock.c
+++ b/arch/arm/plat-s3c24xx/clock.c
@@ -404,6 +404,18 @@ int s3c24xx_register_clock(struct clk *clk)
return 0;
 }
 
+int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
+{
+   int fails = 0;
+
+   for (; nr_clk

[ARM] 4325/1: S3C24XX: remove s3c24xx_board

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=57e5171c9ff817d56344d8473e484d6870ae2bf3
Commit: 57e5171c9ff817d56344d8473e484d6870ae2bf3
Parent: ce89c206ac03dfec700cfa538dcbcc347c0683ce
Author: Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 20 11:19:16 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:53:19 2007 +0100

[ARM] 4325/1: S3C24XX: remove s3c24xx_board

Remove the use of struct s3c24xx_board as
this is just as easily done by using the
platform device registration functions to
make the initialisation sequence easier.

Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-s3c2410/mach-amlm5900.c |7 +--
 arch/arm/mach-s3c2410/mach-bast.c |8 ++--
 arch/arm/mach-s3c2410/mach-h1940.c|9 ++---
 arch/arm/mach-s3c2410/mach-n30.c  |8 ++--
 arch/arm/mach-s3c2410/mach-otom.c |   12 +---
 arch/arm/mach-s3c2410/mach-qt2410.c   |7 +--
 arch/arm/mach-s3c2410/mach-smdk2410.c |   14 +++---
 arch/arm/mach-s3c2410/mach-vr1000.c   |   12 +---
 arch/arm/mach-s3c2412/mach-smdk2413.c |7 +--
 arch/arm/mach-s3c2412/mach-vstms.c|   12 ++--
 arch/arm/mach-s3c2440/mach-anubis.c   |   13 +++--
 arch/arm/mach-s3c2440/mach-nexcoder.c |   13 ++---
 arch/arm/mach-s3c2440/mach-osiris.c   |   12 ++--
 arch/arm/mach-s3c2440/mach-rx3715.c   |8 +---
 arch/arm/mach-s3c2440/mach-smdk2440.c |7 +--
 arch/arm/mach-s3c2443/mach-smdk2443.c |7 +--
 arch/arm/plat-s3c24xx/cpu.c   |   29 -
 include/asm-arm/plat-s3c24xx/cpu.h|   13 -
 18 files changed, 54 insertions(+), 144 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c 
b/arch/arm/mach-s3c2410/mach-amlm5900.c
index 72f2cc4..bc308ce 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -160,17 +160,11 @@ static struct platform_device *amlm5900_devices[] 
__initdata = {
 #endif
 };
 
-static struct s3c24xx_board amlm5900_board __initdata = {
-   .devices   = amlm5900_devices,
-   .devices_count = ARRAY_SIZE(amlm5900_devices)
-};
-
 void __init amlm5900_map_io(void)
 {
s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc));
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(amlm5900_uartcfgs, ARRAY_SIZE(amlm5900_uartcfgs));
-   s3c24xx_set_board(&amlm5900_board);
 }
 
 #ifdef CONFIG_FB_S3C2410
@@ -247,6 +241,7 @@ static void __init amlm5900_init(void)
 #ifdef CONFIG_FB_S3C2410
s3c24xx_fb_set_platdata(&amlm5900_lcd_info);
 #endif
+   platform_add_devices(amlm5900_devices, ARRAY_SIZE(amlm5900_devices));
 }
 
 MACHINE_START(AML_M5900, "AML_M5900")
diff --git a/arch/arm/mach-s3c2410/mach-bast.c 
b/arch/arm/mach-s3c2410/mach-bast.c
index 0bb2e8b..f01de80 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -464,11 +464,6 @@ static struct clk *bast_clocks[] = {
&s3c24xx_uclk,
 };
 
-static struct s3c24xx_board bast_board __initdata = {
-   .devices   = bast_devices,
-   .devices_count = ARRAY_SIZE(bast_devices),
-};
-
 static void __init bast_map_io(void)
 {
/* initialise the clocks */
@@ -492,13 +487,14 @@ static void __init bast_map_io(void)
s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs));
-   s3c24xx_set_board(&bast_board);
+
usb_simtec_init();
 }
 
 static void __init bast_init(void)
 {
s3c24xx_fb_set_platdata(&bast_lcd_info);
+   platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
 }
 
 MACHINE_START(BAST, "Simtec-BAST")
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c 
b/arch/arm/mach-s3c2410/mach-h1940.c
index d052ab2..5d5f00e 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -129,7 +129,6 @@ static struct s3c2410_udc_mach_info h1940_udc_cfg 
__initdata = {
 };
 
 
-
 /**
  * Set lcd on or off
  **/
@@ -188,17 +187,11 @@ static struct platform_device *h1940_devices[] __initdata 
= {
&s3c_device_leds,
 };
 
-static struct s3c24xx_board h1940_board __initdata = {
-   .devices   = h1940_devices,
-   .devices_count = ARRAY_SIZE(h1940_devices)
-};
-
 static void __init h1940_map_io(void)
 {
s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
s3c24xx_init_clocks(0);
s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
-   s3c24xx_set_board(&h1940_board);
 
/* setup PM */
 
@@ -232,6 +225,8 @@ static void __init h1940_init(void)
  | (0x02 << S3C2410_PLLCON_PDIVSHIFT)
  | (0x03 << S3C2410_PLLCON_SDIVSHIFT);
writel(tmp, S3C2410_UPLLCON);
+
+   platform_add_dev

[ARM] 4326/1: S3C24XX: fix sparse errors in DMA code

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a7717435656c874843b1742383cc37540f5ff91e
Commit: a7717435656c874843b1742383cc37540f5ff91e
Parent: 57e5171c9ff817d56344d8473e484d6870ae2bf3
Author: Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 20 11:39:46 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:53:23 2007 +0100

[ARM] 4326/1: S3C24XX: fix sparse errors in DMA code

Fix the following sparse errors in arch/arm/plat-s3c24xx/dma.c:

dma.c:47:30: warning: symbol 'dma_sel' was not declared. Should it be 
static?
dma.c:883:6: warning: symbol 's3c2410_dma_waitforstop' was not declared. 
Should it be static?
dma.c:961:1: warning: symbol 's3c2410_dma_started' was not declared. Should 
it be static?
dma.c:1283:12: warning: symbol 's3c24xx_dma_sysclass_init' was not 
declared. Should it be static?
dma.c:1295:12: warning: symbol 's3c24xx_dma_sysdev_register' was not 
declared. Should it be static?
dma.c:1399:25: warning: symbol 's3c2410_dma_map_channel' was not declared. 
Should it be static?

The patch makes all the relevant functions static.

Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/plat-s3c24xx/dma.c |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 4540a80..6f03c93 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -44,7 +44,7 @@ static struct kmem_cache *dma_kmem;
 
 static int dma_channels;
 
-struct s3c24xx_dma_selection dma_sel;
+static struct s3c24xx_dma_selection dma_sel;
 
 /* dma channel state information */
 struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
@@ -880,7 +880,7 @@ static int s3c2410_dma_dostop(struct s3c2410_dma_chan *chan)
return 0;
 }
 
-void s3c2410_dma_waitforstop(struct s3c2410_dma_chan *chan)
+static void s3c2410_dma_waitforstop(struct s3c2410_dma_chan *chan)
 {
unsigned long tmp;
unsigned int timeout = 0x1;
@@ -957,8 +957,7 @@ static int s3c2410_dma_flush(struct s3c2410_dma_chan *chan)
return 0;
 }
 
-int
-s3c2410_dma_started(struct s3c2410_dma_chan *chan)
+static int s3c2410_dma_started(struct s3c2410_dma_chan *chan)
 {
unsigned long flags;
 
@@ -1280,7 +1279,7 @@ static void s3c2410_dma_cache_ctor(void *p, struct 
kmem_cache *c, unsigned long
 
 /* initialisation code */
 
-int __init s3c24xx_dma_sysclass_init(void)
+static int __init s3c24xx_dma_sysclass_init(void)
 {
int ret = sysdev_class_register(&dma_sysclass);
 
@@ -1292,7 +1291,7 @@ int __init s3c24xx_dma_sysclass_init(void)
 
 core_initcall(s3c24xx_dma_sysclass_init);
 
-int __init s3c24xx_dma_sysdev_register(void)
+static int __init s3c24xx_dma_sysdev_register(void)
 {
struct s3c2410_dma_chan *cp = s3c2410_chans;
int channel, ret;
@@ -1396,7 +1395,7 @@ static struct s3c24xx_dma_order *dma_order;
  * channel
 */
 
-struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)
+static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)
 {
struct s3c24xx_dma_order_ch *ord = NULL;
struct s3c24xx_dma_map *ch_map;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4319/1: S3C2412: Add kconfig for MACH_SMDK2412

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6f621885feba507d40dd1bba253378ae04f9fe8e
Commit: 6f621885feba507d40dd1bba253378ae04f9fe8e
Parent: a7717435656c874843b1742383cc37540f5ff91e
Author: Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 11 12:42:09 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:53:28 2007 +0100

[ARM] 4319/1: S3C2412: Add kconfig for MACH_SMDK2412

Add Kconfig entry for SMDK2412 to go with the SMDK2413

Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-s3c2412/Kconfig |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index befc5fd..d5be5d0 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -47,6 +47,15 @@ config MACH_S3C2413
  machine_is_s3c2413() will work when MACH_SMDK2413 is
  selected
 
+config MACH_SMDK2412
+   bool "SMDK2412"
+   select MACH_SMDK2413
+   help
+ Say Y here if you are using an SMDK2412
+
+ Note, this shares support with SMDK2413, so will automatically
+ select MACH_SMDK2413.
+
 config MACH_VSTMS
bool "VMSTMS"
select CPU_S3C2412
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4330/1: S3C24XX: add S3C2410_UDC_FUNCADDR_UPDATE

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56fca7cc337752e3d31e107db050f7fff2402e7d
Commit: 56fca7cc337752e3d31e107db050f7fff2402e7d
Parent: 6f621885feba507d40dd1bba253378ae04f9fe8e
Author: Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 12:11:24 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 18:16:28 2007 +0100

[ARM] 4330/1: S3C24XX: add S3C2410_UDC_FUNCADDR_UPDATE

Add definition for S3C2410_UDC_FUNCADDR_UDPATE
register definition for UDC driver.

Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-s3c2410/regs-udc.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h 
b/include/asm-arm/arch-s3c2410/regs-udc.h
index 3c83546..26be920 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/arch-s3c2410/regs-udc.h
@@ -75,7 +75,7 @@
 #define S3C2410_UDC_OUT_FIFO_CNT1_REG  S3C2410_USBDREG(0x0198)
 #define S3C2410_UDC_OUT_FIFO_CNT2_REG  S3C2410_USBDREG(0x019c)
 
-
+#define S3C2410_UDC_FUNCADDR_UPDATE(1<<7)
 
 #define S3C2410_UDC_PWR_ISOUP  (1<<7) // R/W
 #define S3C2410_UDC_PWR_RESET  (1<<3) // R
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4358/1: S3C24XX: mach-qt2410.c: remove linux/mmc/protocol.h header

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4b5bd4b101a8da1fb24a072adde276547462b43
Commit: c4b5bd4b101a8da1fb24a072adde276547462b43
Parent: 56fca7cc337752e3d31e107db050f7fff2402e7d
Author: Arnaud Patard <[EMAIL PROTECTED]>
AuthorDate: Sat May 5 15:12:17 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 21:09:41 2007 +0100

[ARM] 4358/1: S3C24XX: mach-qt2410.c: remove linux/mmc/protocol.h header

linux/mmc/protocol.h header is gone, thus breaking the build of the
mach-qt2410.c file. As this header is not used, I'm removing it. The
right headers may still be added later if needed.

Signed-off-by: Arnaud Patard <[EMAIL PROTECTED]>
Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-s3c2410/mach-qt2410.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c 
b/arch/arm/mach-s3c2410/mach-qt2410.c
index caf6778..9cc4253 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4360/1: S3C24XX: regs-udc.h remove unused macro

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d0fdb5a58e17cf788c76a52a53174dbc8fb58ee9
Commit: d0fdb5a58e17cf788c76a52a53174dbc8fb58ee9
Parent: c4b5bd4b101a8da1fb24a072adde276547462b43
Author: Arnaud Patard <[EMAIL PROTECTED]>
AuthorDate: Sat May 5 15:55:09 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 21:09:42 2007 +0100

[ARM] 4360/1: S3C24XX: regs-udc.h remove unused macro

The S3C2410_UDC_SETIX() macro is not used and won't be used by the udc
driver, so delete it.

Signed-off-by: Arnaud Patard <[EMAIL PROTECTED]>
Signed-off-by: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-s3c2410/regs-udc.h |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h 
b/include/asm-arm/arch-s3c2410/regs-udc.h
index 26be920..e1e9805 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/arch-s3c2410/regs-udc.h
@@ -135,10 +135,6 @@
 #define S3C2410_UDC_OCSR2_ISO  (1<<6) // R/W
 #define S3C2410_UDC_OCSR2_DMAIEN   (1<<5) // R/W
 
-#define S3C2410_UDC_SETIX(base,x)  \
-   writel(S3C2410_UDC_INDEX_ ## x, base+S3C2410_UDC_INDEX_REG);
-
-
 #define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0)
 #define S3C2410_UDC_EP0_CSR_IPKRDY (1<<1)
 #define S3C2410_UDC_EP0_CSR_SENTSTL(1<<2)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] sa1100: use mutexes rather than semaphores

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d0a9d75b9cd9cc8097c746611cc57cc8438b94be
Commit: d0a9d75b9cd9cc8097c746611cc57cc8438b94be
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Russell King <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 22 10:08:58 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sun Apr 22 10:08:58 2007 +0100

[ARM] sa1100: use mutexes rather than semaphores

Use a mutex in the sa1100 clock support rather than a semaphore.
Remove the unused "module" field.

Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-sa1100/clock.c |   24 +---
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c
index b1e8fd7..fc97fe5 100644
--- a/arch/arm/mach-sa1100/clock.c
+++ b/arch/arm/mach-sa1100/clock.c
@@ -9,14 +9,17 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 
+/*
+ * Very simple clock implementation - we only have one clock to
+ * deal with at the moment, so we only match using the "name".
+ */
 struct clk {
struct list_headnode;
unsigned long   rate;
-   struct module   *owner;
const char  *name;
unsigned intenabled;
void(*enable)(void);
@@ -24,21 +27,21 @@ struct clk {
 };
 
 static LIST_HEAD(clocks);
-static DECLARE_MUTEX(clocks_sem);
+static DEFINE_MUTEX(clocks_mutex);
 static DEFINE_SPINLOCK(clocks_lock);
 
 struct clk *clk_get(struct device *dev, const char *id)
 {
struct clk *p, *clk = ERR_PTR(-ENOENT);
 
-   down(&clocks_sem);
+   mutex_lock(&clocks_mutex);
list_for_each_entry(p, &clocks, node) {
-   if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
+   if (strcmp(id, p->name) == 0) {
clk = p;
break;
}
}
-   up(&clocks_sem);
+   mutex_unlock(&clocks_mutex);
 
return clk;
 }
@@ -46,7 +49,6 @@ EXPORT_SYMBOL(clk_get);
 
 void clk_put(struct clk *clk)
 {
-   module_put(clk->owner);
 }
 EXPORT_SYMBOL(clk_put);
 
@@ -109,18 +111,18 @@ static struct clk clk_gpio27 = {
 
 int clk_register(struct clk *clk)
 {
-   down(&clocks_sem);
+   mutex_lock(&clocks_mutex);
list_add(&clk->node, &clocks);
-   up(&clocks_sem);
+   mutex_unlock(&clocks_mutex);
return 0;
 }
 EXPORT_SYMBOL(clk_register);
 
 void clk_unregister(struct clk *clk)
 {
-   down(&clocks_sem);
+   mutex_lock(&clocks_mutex);
list_del(&clk->node);
-   up(&clocks_sem);
+   mutex_unlock(&clocks_mutex);
 }
 EXPORT_SYMBOL(clk_unregister);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4275/1: generic gpio layer for ixp4xx

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25735d10ba477d5128b1e5ccef42062bea429075
Commit: 25735d10ba477d5128b1e5ccef42062bea429075
Parent: 235b185ce47ce64793362bd3ae4bcd8afc6b57b8
Author: Milan Svoboda <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 14:04:08 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:51:42 2007 +0100

[ARM] 4275/1: generic gpio layer for ixp4xx

This patch brings generic gpio layer support to ixp4xx. It creates
functions needed for gpio->irq and irq->gpio translation.

It expects and initial value to be passed to
gpio_direction_output() which has been introduced by
commit 28735a7253a6c24364765e80a5428b4a151fccc2 in Linus git tree.

Generic gpio layer is going to be used by pxa2xx_udc driver.

Signed-off-by: Milan Svoboda <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-ixp4xx/common.c  |   23 +++
 include/asm-arm/arch-ixp4xx/gpio.h |   73 
 2 files changed, 96 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 45068c3..39f2eeb 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -102,6 +102,29 @@ static signed char irq2gpio[32] = {
 7,  8,  9, 10, 11, 12, -1, -1,
 };
 
+int gpio_to_irq(int gpio)
+{
+   int irq;
+
+   for (irq = 0; irq < 32; irq++) {
+   if (irq2gpio[irq] == gpio)
+   return irq;
+   }
+   return -EINVAL;
+}
+EXPORT_SYMBOL(gpio_to_irq);
+
+int irq_to_gpio(int irq)
+{
+   int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL;
+
+   if (gpio == -1)
+   return -EINVAL;
+
+   return gpio;
+}
+EXPORT_SYMBOL(irq_to_gpio);
+
 static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
 {
int line = irq2gpio[irq];
diff --git a/include/asm-arm/arch-ixp4xx/gpio.h 
b/include/asm-arm/arch-ixp4xx/gpio.h
new file mode 100644
index 000..3a4c5b8
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/gpio.h
@@ -0,0 +1,73 @@
+/*
+ * linux/include/asm-arm/arch-ixp4xx/gpio.h
+ *
+ * IXP4XX GPIO wrappers for arch-neutral GPIO calls
+ *
+ * Written by Milan Svoboda <[EMAIL PROTECTED]>
+ * Based on PXA implementation by Philipp Zabel <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ASM_ARCH_IXP4XX_GPIO_H
+#define __ASM_ARCH_IXP4XX_GPIO_H
+
+#include 
+
+static inline int gpio_request(unsigned gpio, const char *label)
+{
+   return 0;
+}
+
+static inline void gpio_free(unsigned gpio)
+{
+   return;
+}
+
+static inline int gpio_direction_input(unsigned gpio)
+{
+   gpio_line_config(gpio, IXP4XX_GPIO_IN);
+   return 0;
+}
+
+static inline int gpio_direction_output(unsigned gpio, int level)
+{
+   gpio_line_set(gpio, level);
+   gpio_line_config(gpio, IXP4XX_GPIO_OUT);
+   return 0;
+}
+
+static inline int gpio_get_value(unsigned gpio)
+{
+   int value;
+
+   gpio_line_get(gpio, &value);
+
+   return value;
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+   gpio_line_set(gpio, value);
+}
+
+#include   /* cansleep wrappers */
+
+extern int gpio_to_irq(int gpio);
+extern int irq_to_gpio(int gpio);
+
+#endif
+
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4311/1: ixp4xx: add KIXRP435 platform

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=45fba0846f5a5a48ed3c394aa4f8ca93699e7655
Commit: 45fba0846f5a5a48ed3c394aa4f8ca93699e7655
Parent: 25735d10ba477d5128b1e5ccef42062bea429075
Author: Ruslan V. Sushko <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 6 15:00:31 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:51:55 2007 +0100

[ARM] 4311/1: ixp4xx: add KIXRP435 platform

Add Intel KIXRP435 Reference Platform based on IXP43x processor.
Fixed after review : access to cp15 removed in identification functions,
used access to global processor_id instead

Signed-off-by: Vladimir Barinov <[EMAIL PROTECTED]>
Signed-off-by: Ruslan  Sushko <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/configs/ixp4xx_defconfig |2 +
 arch/arm/mach-ixp4xx/Kconfig  |   13 +-
 arch/arm/mach-ixp4xx/common-pci.c |4 +-
 arch/arm/mach-ixp4xx/common.c |6 ++--
 arch/arm/mach-ixp4xx/ixdp425-pci.c|2 +-
 arch/arm/mach-ixp4xx/ixdp425-setup.c  |   18 ++
 arch/arm/mm/proc-xscale.S |   28 ++
 include/asm-arm/arch-ixp4xx/entry-macro.S |4 +-
 include/asm-arm/arch-ixp4xx/hardware.h|4 +-
 include/asm-arm/arch-ixp4xx/io.h  |2 +-
 include/asm-arm/arch-ixp4xx/irqs.h|6 ++--
 include/asm-arm/arch-ixp4xx/ixp4xx-regs.h |   36 +---
 12 files changed, 106 insertions(+), 19 deletions(-)

diff --git a/arch/arm/configs/ixp4xx_defconfig 
b/arch/arm/configs/ixp4xx_defconfig
index fabf74c..db850a5 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -117,11 +117,13 @@ CONFIG_ARCH_ADI_COYOTE=y
 CONFIG_ARCH_IXDP425=y
 CONFIG_MACH_IXDPG425=y
 CONFIG_MACH_IXDP465=y
+CONFIG_MACH_KIXRP435=y
 CONFIG_ARCH_IXCDP1100=y
 CONFIG_ARCH_PRPMC1100=y
 CONFIG_MACH_NAS100D=y
 CONFIG_ARCH_IXDP4XX=y
 CONFIG_CPU_IXP46X=y
+CONFIG_CPU_IXP43X=y
 # CONFIG_MACH_GTWX5715 is not set
 
 #
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 8a339cd..dd0fb72 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -62,6 +62,12 @@ config MACH_IXDP465
  IXDP465 Development Platform (Also known as BMP).
  For more information on this platform, see 
.
 
+config MACH_KIXRP435
+   bool "KIXRP435"
+   help
+ Say 'Y' here if you want your kernel to support Intel's
+ KIXRP435 Reference Platform.
+ For more information on this platform, see 
.
 
 #
 # IXCDP1100 is the exact same HW as IXDP425, but with a different machine 
@@ -94,7 +100,7 @@ config MACH_NAS100D
 #
 config ARCH_IXDP4XX
bool
-   depends on ARCH_IXDP425 || MACH_IXDP465
+   depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
default y
 
 #
@@ -105,6 +111,11 @@ config CPU_IXP46X
depends on MACH_IXDP465
default y
 
+config CPU_IXP43X
+   bool
+   depends on MACH_KIXRP435
+   default y
+
 config MACH_GTWX5715
bool "Gemtek WX5715 (Linksys WRV54G)"
depends on ARCH_IXP4XX
diff --git a/arch/arm/mach-ixp4xx/common-pci.c 
b/arch/arm/mach-ixp4xx/common-pci.c
index 9562177..bf04121 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -374,7 +374,7 @@ void __init ixp4xx_pci_preinit(void)
 * Determine which PCI read method to use.
 * Rev 0 IXP425 requires workaround.
 */
-   if (!(processor_id & 0xf) && !cpu_is_ixp46x()) {
+   if (!(processor_id & 0xf) && cpu_is_ixp42x()) {
printk("PCI: IXP42x A0 silicon detected - "
"PCI Non-Prefetch Workaround Enabled\n");
ixp4xx_pci_read = ixp4xx_pci_read_errata;
@@ -480,7 +480,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
res[0].flags = IORESOURCE_IO;
 
res[1].name = "PCI Memory Space";
-   res[1].start = 0x4800;
+   res[1].start = PCIBIOS_MIN_MEM;
 #ifndef CONFIG_IXP4XX_INDIRECT_PCI
res[1].end = 0x4bff;
 #else
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 39f2eeb..030dd75 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -192,7 +192,7 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned 
int type)
 
 static void ixp4xx_irq_mask(unsigned int irq)
 {
-   if (cpu_is_ixp46x() && irq >= 32)
+   if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32)
*IXP4XX_ICMR2 &= ~(1 << (irq - 32));
else
*IXP4XX_ICMR &= ~(1 << irq);
@@ -215,7 +215,7 @@ static void ixp4xx_irq_unmask(unsigned int irq)
if (!(ixp4xx_irq_edge & (1 << irq)))
ixp4xx_irq_ack(irq);
 
-   if (cpu_is_ixp46x() && irq >= 32)
+   if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32)
*IXP

[ARM] 4320/1: ixp4xx: cpu type detection stuff cleanup

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=53b2e01be55f3c140e2704cf8d5f99ddba0ff823
Commit: 53b2e01be55f3c140e2704cf8d5f99ddba0ff823
Parent: 45fba0846f5a5a48ed3c394aa4f8ca93699e7655
Author: Vladimir Barinov <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 11 16:32:46 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat Apr 21 20:52:01 2007 +0100

[ARM] 4320/1: ixp4xx: cpu type detection stuff cleanup

Move IXP4XX cpu detection stuff in a separate include file and remove 
unused definition.

Signed-off-by: Vladimir Barinov <[EMAIL PROTECTED]>
Signed-off-by: Ruslan Sushko <[EMAIL PROTECTED]>
Signed-off-by: Deepak Saxena <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 include/asm-arm/arch-ixp4xx/cpu.h |   31 +
 include/asm-arm/arch-ixp4xx/hardware.h|7 +---
 include/asm-arm/arch-ixp4xx/ixp4xx-regs.h |   43 -
 3 files changed, 33 insertions(+), 48 deletions(-)

diff --git a/include/asm-arm/arch-ixp4xx/cpu.h 
b/include/asm-arm/arch-ixp4xx/cpu.h
new file mode 100644
index 000..d2523b3
--- /dev/null
+++ b/include/asm-arm/arch-ixp4xx/cpu.h
@@ -0,0 +1,31 @@
+/*
+ * include/asm-arm/arch-ixp4xx/cpu.h
+ *
+ * IXP4XX cpu type detection
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __ASM_ARCH_CPU_H__
+#define __ASM_ARCH_CPU_H__
+
+extern unsigned int processor_id;
+/* Processor id value in CP15 Register 0 */
+#define IXP425_PROCESSOR_ID_VALUE  0x690541c0
+#define IXP435_PROCESSOR_ID_VALUE  0x69054040
+#define IXP465_PROCESSOR_ID_VALUE  0x69054200
+#define IXP4XX_PROCESSOR_ID_MASK   0xfff0
+
+#define cpu_is_ixp42x()((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \
+ IXP425_PROCESSOR_ID_VALUE)
+#define cpu_is_ixp43x()((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \
+ IXP435_PROCESSOR_ID_VALUE)
+#define cpu_is_ixp46x()((processor_id & IXP4XX_PROCESSOR_ID_MASK) == \
+ IXP465_PROCESSOR_ID_VALUE)
+
+#endif  /* _ASM_ARCH_CPU_H */
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h 
b/include/asm-arm/arch-ixp4xx/hardware.h
index 24bc588..a0acde3 100644
--- a/include/asm-arm/arch-ixp4xx/hardware.h
+++ b/include/asm-arm/arch-ixp4xx/hardware.h
@@ -27,11 +27,8 @@
 
 #define pcibios_assign_all_busses()1
 
-#if defined(CONFIG_CPU_IXP46X) && !defined(__ASSEMBLY__)
-extern unsigned int processor_id;
-#define cpu_is_ixp465() ((processor_id & 0xffc0) == 0x69054200)
-#else
-#definecpu_is_ixp465() (0)
+#ifndef __ASSEMBLER__
+#include 
 #endif
 
 /* Register locations and bits */
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h 
b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
index deb9899..5d949d7 100644
--- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
+++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
@@ -607,47 +607,4 @@
 
 #define DCMD_LENGTH0x01fff /* length mask (max = 8K - 1) */
 
-/* Processor id value in CP15 Register 0 */
-#define IXP425_PROCESSOR_ID_VALUE  0x690541c0
-#define IXP435_PROCESSOR_ID_VALUE  0x69054040
-#define IXP465_PROCESSOR_ID_VALUE  0x69054200
-#define IXP4XX_PROCESSOR_ID_MASK   0xfff0
-
-#ifndef __ASSEMBLY__
-static inline int cpu_is_ixp42x(void)
-{
-   extern unsigned int processor_id;
-
-   if ((processor_id & IXP4XX_PROCESSOR_ID_MASK) ==
-IXP425_PROCESSOR_ID_VALUE )
-   return 1;
-
-   return 0;
-}
-
-static inline int cpu_is_ixp43x(void)
-{
-#ifdef CONFIG_CPU_IXP43X
-   extern unsigned int processor_id;
-
-   if ((processor_id & IXP4XX_PROCESSOR_ID_MASK) ==
-IXP435_PROCESSOR_ID_VALUE )
-   return 1;
-#endif
-   return 0;
-}
-
-static inline int cpu_is_ixp46x(void)
-{
-#ifdef CONFIG_CPU_IXP46X
-   extern unsigned int processor_id;
-
-   if ((processor_id & IXP4XX_PROCESSOR_ID_MASK) ==
-IXP465_PROCESSOR_ID_VALUE )
-   return 1;
-#endif
-   return 0;
-}
-#endif
-
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 4318/2: DSM-G600 Board Support

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28bd3a0dcce11bea6f99a351cc64053dff00196e
Commit: 28bd3a0dcce11bea6f99a351cc64053dff00196e
Parent: 53b2e01be55f3c140e2704cf8d5f99ddba0ff823
Author: Michael-Luke Jones <[EMAIL PROTECTED]>
AuthorDate: Sat Apr 28 08:31:40 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Sat May 5 10:06:49 2007 +0100

[ARM] 4318/2: DSM-G600 Board Support

This patch adds support for the D-Link DSM-G600 Rev A.
This is an ARM XScale IXP4xx system relatively similar to
the NSLU2 and NAS-100D already supported by mainline. An
important difference is Gigabit Ethernet support using
the Via Velocity chipset.

This patch is the combined work of Michael Westerhof and
Alessandro Zummo, with contributions from Michael-Luke
Jones. This version addresses review comments from rmk
and Deepak Saxena.

Signed-off-by: Michael-Luke Jones <[EMAIL PROTECTED]>
Signed-off-by: Alessandro Zummo <[EMAIL PROTECTED]>
Signed-off-by: Michael Westerhof <[EMAIL PROTECTED]>
Signed-off-by: Deepak Saxena <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-ixp4xx/Kconfig   |9 ++
 arch/arm/mach-ixp4xx/Makefile  |2 +
 arch/arm/mach-ixp4xx/dsmg600-pci.c |   74 ++
 arch/arm/mach-ixp4xx/dsmg600-power.c   |  125 +++
 arch/arm/mach-ixp4xx/dsmg600-setup.c   |  175 
 include/asm-arm/arch-ixp4xx/dsmg600.h  |   57 ++
 include/asm-arm/arch-ixp4xx/hardware.h |1 +
 include/asm-arm/arch-ixp4xx/irqs.h |   10 ++
 8 files changed, 453 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index dd0fb72..9715ef5 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -95,6 +95,15 @@ config MACH_NAS100D
  NAS 100d device. For more information on this platform,
  see http://www.nslu2-linux.org/wiki/NAS100d/HomePage
 
+config MACH_DSMG600
+   bool
+   prompt "D-Link DSM-G600 RevA"
+   select PCI
+   help
+ Say 'Y' here if you want your kernel to support D-Link's
+ DSM-G600 RevA device. For more information on this platform,
+ see http://www.nslu2-linux.org/wiki/DSMG600/HomePage
+
 #
 # Avila and IXDP share the same source for now. Will change in future
 #
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile
index 746e297..3b87c47 100644
--- a/arch/arm/mach-ixp4xx/Makefile
+++ b/arch/arm/mach-ixp4xx/Makefile
@@ -12,6 +12,7 @@ obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o
 obj-pci-$(CONFIG_MACH_GTWX5715)+= gtwx5715-pci.o
 obj-pci-$(CONFIG_MACH_NSLU2)   += nslu2-pci.o
 obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
+obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
 
 obj-y  += common.o
 
@@ -22,5 +23,6 @@ obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o
 obj-$(CONFIG_MACH_GTWX5715)+= gtwx5715-setup.o
 obj-$(CONFIG_MACH_NSLU2)   += nslu2-setup.o nslu2-power.o
 obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
+obj-$(CONFIG_MACH_DSMG600)  += dsmg600-setup.o dsmg600-power.o
 
 obj-$(CONFIG_PCI)  += $(obj-pci-$(CONFIG_PCI)) common-pci.o
diff --git a/arch/arm/mach-ixp4xx/dsmg600-pci.c 
b/arch/arm/mach-ixp4xx/dsmg600-pci.c
new file mode 100644
index 000..9db7e1f
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/dsmg600-pci.c
@@ -0,0 +1,74 @@
+/*
+ * DSM-G600 board-level PCI initialization
+ *
+ * Copyright (C) 2006 Tower Technologies
+ * Author: Alessandro Zummo <[EMAIL PROTECTED]>
+ *
+ * based on ixdp425-pci.c:
+ * Copyright (C) 2002 Intel Corporation.
+ * Copyright (C) 2003-2004 MontaVista Software, Inc.
+ *
+ * Maintainer: http://www.nslu2-linux.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 
+#include 
+#include 
+
+#include 
+#include 
+
+void __init dsmg600_pci_preinit(void)
+{
+   set_irq_type(IRQ_DSMG600_PCI_INTA, IRQT_LOW);
+   set_irq_type(IRQ_DSMG600_PCI_INTB, IRQT_LOW);
+   set_irq_type(IRQ_DSMG600_PCI_INTC, IRQT_LOW);
+   set_irq_type(IRQ_DSMG600_PCI_INTD, IRQT_LOW);
+   set_irq_type(IRQ_DSMG600_PCI_INTE, IRQT_LOW);
+   set_irq_type(IRQ_DSMG600_PCI_INTF, IRQT_LOW);
+
+   ixp4xx_pci_preinit();
+}
+
+static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+{
+   static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] =
+   {
+   { IRQ_DSMG600_PCI_INTE, -1, -1 },
+   { IRQ_DSMG600_PCI_INTA, -1, -1 },
+   { IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, 
IRQ_DSMG600_PCI_INTD },
+   { IRQ_DSMG600_PCI_INTF, -1, -1 },
+   };
+
+   i

KVM: Fix guest register corruption on paravirt hypercall

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9b22bf578332d3e326c349bc8a8789af3d952435
Commit: 9b22bf578332d3e326c349bc8a8789af3d952435
Parent: dc87c3985e9b442c60994308a96f887579addc39
Author: Dor Laor <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 19 16:44:49 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:22 2007 +0300

KVM: Fix guest register corruption on paravirt hypercall

The hypercall code mixes up the ->cache_regs() and ->decache_regs()
callbacks, resulting in guest register corruption.

Signed-off-by: Dor Laor <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index dc7a8c7..ff7c836 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1177,7 +1177,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run 
*run)
 {
unsigned long nr, a0, a1, a2, a3, a4, a5, ret;
 
-   kvm_arch_ops->decache_regs(vcpu);
+   kvm_arch_ops->cache_regs(vcpu);
ret = -KVM_EINVAL;
 #ifdef CONFIG_X86_64
if (is_long_mode(vcpu)) {
@@ -1204,7 +1204,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run 
*run)
;
}
vcpu->regs[VCPU_REGS_RAX] = ret;
-   kvm_arch_ops->cache_regs(vcpu);
+   kvm_arch_ops->decache_regs(vcpu);
return 1;
 }
 EXPORT_SYMBOL_GPL(kvm_hypercall);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Use the generic skip_emulated_instruction() in hypercall code

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=510043da8582ad49d22a1e9a6b211e6ede10cd2e
Commit: 510043da8582ad49d22a1e9a6b211e6ede10cd2e
Parent: 9b22bf578332d3e326c349bc8a8789af3d952435
Author: Dor Laor <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 19 18:25:43 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:22 2007 +0300

KVM: Use the generic skip_emulated_instruction() in hypercall code

Instead of twiddling the rip registers directly, use the
skip_emulated_instruction() function to do that for us.

Signed-off-by: Dor Laor <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/svm.c |3 ++-
 drivers/kvm/vmx.c |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 3d8ea7a..6787f11 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1078,7 +1078,8 @@ static int halt_interception(struct kvm_vcpu *vcpu, 
struct kvm_run *kvm_run)
 
 static int vmmcall_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
-   vcpu->svm->vmcb->save.rip += 3;
+   vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 3;
+   skip_emulated_instruction(vcpu);
return kvm_hypercall(vcpu, kvm_run);
 }
 
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index fbbf9d6..a721b60 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1658,7 +1658,7 @@ static int handle_halt(struct kvm_vcpu *vcpu, struct 
kvm_run *kvm_run)
 
 static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
-   vmcs_writel(GUEST_RIP, vmcs_readl(GUEST_RIP)+3);
+   skip_emulated_instruction(vcpu);
return kvm_hypercall(vcpu, kvm_run);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Use own minor number

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bbe4432e669ab94fc8059e7ab878cafad7b8d123
Commit: bbe4432e669ab94fc8059e7ab878cafad7b8d123
Parent: 510043da8582ad49d22a1e9a6b211e6ede10cd2e
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 13:27:36 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:22 2007 +0300

KVM: Use own minor number

Use the minor number (232) allocated to kvm by lanana.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |2 +-
 include/linux/miscdevice.h |1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index ff7c836..946ed86 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2299,7 +2299,7 @@ static struct file_operations kvm_chardev_ops = {
 };
 
 static struct miscdevice kvm_dev = {
-   MISC_DYNAMIC_MINOR,
+   KVM_MINOR,
"kvm",
&kvm_chardev_ops,
 };
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 326da7d..dff9ea3 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -29,6 +29,7 @@
 
 #define TUN_MINOR   200
 #defineHPET_MINOR   228
+#define KVM_MINOR232
 
 struct device;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Export

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ff42697436ddf5bd026e2cb4f117656b967f0709
Commit: ff42697436ddf5bd026e2cb4f117656b967f0709
Parent: bbe4432e669ab94fc8059e7ab878cafad7b8d123
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 09:29:48 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:22 2007 +0300

KVM: Export 

This allows users to actually build prgrams that use kvm without
the entire source tree.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 include/linux/Kbuild |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4ff0f57..9f05279 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -96,6 +96,7 @@ header-y += iso_fs.h
 header-y += ixjuser.h
 header-y += jffs2.h
 header-y += keyctl.h
+header-y += kvm.h
 header-y += limits.h
 header-y += lock_dlm_plock.h
 header-y += magic.h
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Fix bogus sign extension in mmu mapping audit

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1ea252afcd4b264b71d9c3f55358ff5ba4c04f1b
Commit: 1ea252afcd4b264b71d9c3f55358ff5ba4c04f1b
Parent: ff42697436ddf5bd026e2cb4f117656b967f0709
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 8 11:48:09 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:23 2007 +0300

KVM: Fix bogus sign extension in mmu mapping audit

When auditing a 32-bit guest on a 64-bit host, sign extension of the page
table directory pointer table index caused bogus addresses to be shown on
audit errors.

Fix by declaring the index unsigned.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/mmu.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index cab26f3..2d90577 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -1360,7 +1360,7 @@ static void audit_mappings_page(struct kvm_vcpu *vcpu, 
u64 page_pte,
 
 static void audit_mappings(struct kvm_vcpu *vcpu)
 {
-   int i;
+   unsigned i;
 
if (vcpu->mmu.root_level == 4)
audit_mappings_page(vcpu, vcpu->mmu.root_hpa, 0, 4);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Use a shared page for kernel/user communication when runing a vcpu

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a2bb7f486dc639a1cf2ad803bf2227f0dc0809d
Commit: 9a2bb7f486dc639a1cf2ad803bf2227f0dc0809d
Parent: 1ea252afcd4b264b71d9c3f55358ff5ba4c04f1b
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 22 12:58:31 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:23 2007 +0300

KVM: Use a shared page for kernel/user communication when runing a vcpu

Instead of passing a 'struct kvm_run' back and forth between the kernel and
userspace, allocate a page and allow the user to mmap() it.  This reduces
needless copying and makes the interface expandable by providing lots of
free space.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm.h  |1 +
 drivers/kvm/kvm_main.c |   54 +++
 include/linux/kvm.h|6 ++--
 3 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 0d122bf..901b8d9 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -228,6 +228,7 @@ struct kvm_vcpu {
struct mutex mutex;
int   cpu;
int   launched;
+   struct kvm_run *run;
int interrupt_window_open;
unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
 #define NR_IRQ_WORDS KVM_IRQ_BITMAP_SIZE(unsigned long)
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 946ed86..42be8a8 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -355,6 +355,8 @@ static void kvm_free_vcpu(struct kvm_vcpu *vcpu)
kvm_mmu_destroy(vcpu);
vcpu_put(vcpu);
kvm_arch_ops->vcpu_free(vcpu);
+   free_page((unsigned long)vcpu->run);
+   vcpu->run = NULL;
 }
 
 static void kvm_free_vcpus(struct kvm *kvm)
@@ -1887,6 +1889,33 @@ static int kvm_vcpu_ioctl_debug_guest(struct kvm_vcpu 
*vcpu,
return r;
 }
 
+static struct page *kvm_vcpu_nopage(struct vm_area_struct *vma,
+   unsigned long address,
+   int *type)
+{
+   struct kvm_vcpu *vcpu = vma->vm_file->private_data;
+   unsigned long pgoff;
+   struct page *page;
+
+   *type = VM_FAULT_MINOR;
+   pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
+   if (pgoff != 0)
+   return NOPAGE_SIGBUS;
+   page = virt_to_page(vcpu->run);
+   get_page(page);
+   return page;
+}
+
+static struct vm_operations_struct kvm_vcpu_vm_ops = {
+   .nopage = kvm_vcpu_nopage,
+};
+
+static int kvm_vcpu_mmap(struct file *file, struct vm_area_struct *vma)
+{
+   vma->vm_ops = &kvm_vcpu_vm_ops;
+   return 0;
+}
+
 static int kvm_vcpu_release(struct inode *inode, struct file *filp)
 {
struct kvm_vcpu *vcpu = filp->private_data;
@@ -1899,6 +1928,7 @@ static struct file_operations kvm_vcpu_fops = {
.release= kvm_vcpu_release,
.unlocked_ioctl = kvm_vcpu_ioctl,
.compat_ioctl   = kvm_vcpu_ioctl,
+   .mmap   = kvm_vcpu_mmap,
 };
 
 /*
@@ -1947,6 +1977,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, int 
n)
 {
int r;
struct kvm_vcpu *vcpu;
+   struct page *page;
 
r = -EINVAL;
if (!valid_vcpu(n))
@@ -1961,6 +1992,12 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, int 
n)
return -EEXIST;
}
 
+   page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+   r = -ENOMEM;
+   if (!page)
+   goto out_unlock;
+   vcpu->run = page_address(page);
+
vcpu->host_fx_image = (char*)ALIGN((hva_t)vcpu->fx_buf,
   FX_IMAGE_ALIGN);
vcpu->guest_fx_image = vcpu->host_fx_image + FX_IMAGE_SIZE;
@@ -1990,6 +2027,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, int 
n)
 
 out_free_vcpus:
kvm_free_vcpu(vcpu);
+out_unlock:
mutex_unlock(&vcpu->mutex);
 out:
return r;
@@ -2003,21 +2041,9 @@ static long kvm_vcpu_ioctl(struct file *filp,
int r = -EINVAL;
 
switch (ioctl) {
-   case KVM_RUN: {
-   struct kvm_run kvm_run;
-
-   r = -EFAULT;
-   if (copy_from_user(&kvm_run, argp, sizeof kvm_run))
-   goto out;
-   r = kvm_vcpu_ioctl_run(vcpu, &kvm_run);
-   if (r < 0 &&  r != -EINTR)
-   goto out;
-   if (copy_to_user(argp, &kvm_run, sizeof kvm_run)) {
-   r = -EFAULT;
-   goto out;
-   }
+   case KVM_RUN:
+   r = kvm_vcpu_ioctl_run(vcpu, vcpu->run);
break;
-   }
case KVM_GET_REGS: {
struct kvm_regs kvm_regs;
 
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 275354f..d88e750 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -11,7 +11,7 @@
 #inclu

KVM: Do not communicate to userspace through cpu registers during PIO

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=46fc1477887c41c8e900f2c95485e222b9a54822
Commit: 46fc1477887c41c8e900f2c95485e222b9a54822
Parent: 9a2bb7f486dc639a1cf2ad803bf2227f0dc0809d
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 22 19:39:30 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:23 2007 +0300

KVM: Do not communicate to userspace through cpu registers during PIO

Currently when passing the a PIO emulation request to userspace, we
rely on userspace updating %rax (on 'in' instructions) and %rsi/%rdi/%rcx
(on string instructions).  This (a) requires two extra ioctls for getting
and setting the registers and (b) is unfriendly to non-x86 archs, when
they get kvm ports.

So fix by doing the register fixups in the kernel and passing to userspace
only an abstract description of the PIO to be done.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm.h  |1 +
 drivers/kvm/kvm_main.c |   48 +---
 drivers/kvm/svm.c  |2 ++
 drivers/kvm/vmx.c  |2 ++
 include/linux/kvm.h|6 +++---
 5 files changed, 53 insertions(+), 6 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 901b8d9..59cbc5b 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -274,6 +274,7 @@ struct kvm_vcpu {
int mmio_size;
unsigned char mmio_data[8];
gpa_t mmio_phys_addr;
+   int pio_pending;
 
struct {
int active;
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 42be8a8..ff8bcfe 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1504,6 +1504,44 @@ void save_msrs(struct vmx_msr_entry *e, int n)
 }
 EXPORT_SYMBOL_GPL(save_msrs);
 
+static void complete_pio(struct kvm_vcpu *vcpu)
+{
+   struct kvm_io *io = &vcpu->run->io;
+   long delta;
+
+   kvm_arch_ops->cache_regs(vcpu);
+
+   if (!io->string) {
+   if (io->direction == KVM_EXIT_IO_IN)
+   memcpy(&vcpu->regs[VCPU_REGS_RAX], &io->value,
+  io->size);
+   } else {
+   delta = 1;
+   if (io->rep) {
+   delta *= io->count;
+   /*
+* The size of the register should really depend on
+* current address size.
+*/
+   vcpu->regs[VCPU_REGS_RCX] -= delta;
+   }
+   if (io->string_down)
+   delta = -delta;
+   delta *= io->size;
+   if (io->direction == KVM_EXIT_IO_IN)
+   vcpu->regs[VCPU_REGS_RDI] += delta;
+   else
+   vcpu->regs[VCPU_REGS_RSI] += delta;
+   }
+
+   vcpu->pio_pending = 0;
+   vcpu->run->io_completed = 0;
+
+   kvm_arch_ops->decache_regs(vcpu);
+
+   kvm_arch_ops->skip_emulated_instruction(vcpu);
+}
+
 static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
int r;
@@ -1518,9 +1556,13 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, 
struct kvm_run *kvm_run)
kvm_run->emulated = 0;
}
 
-   if (kvm_run->mmio_completed) {
-   memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
-   vcpu->mmio_read_completed = 1;
+   if (kvm_run->io_completed) {
+   if (vcpu->pio_pending)
+   complete_pio(vcpu);
+   else {
+   memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8);
+   vcpu->mmio_read_completed = 1;
+   }
}
 
vcpu->mmio_needed = 0;
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 6787f11..c35b8c8 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1037,6 +1037,7 @@ static int io_interception(struct kvm_vcpu *vcpu, struct 
kvm_run *kvm_run)
kvm_run->io.size = ((io_info & SVM_IOIO_SIZE_MASK) >> 
SVM_IOIO_SIZE_SHIFT);
kvm_run->io.string = (io_info & SVM_IOIO_STR_MASK) != 0;
kvm_run->io.rep = (io_info & SVM_IOIO_REP_MASK) != 0;
+   kvm_run->io.count = 1;
 
if (kvm_run->io.string) {
unsigned addr_mask;
@@ -1056,6 +1057,7 @@ static int io_interception(struct kvm_vcpu *vcpu, struct 
kvm_run *kvm_run)
}
} else
kvm_run->io.value = vcpu->svm->vmcb->save.rax;
+   vcpu->pio_pending = 1;
return 0;
 }
 
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index a721b60..4d5f40f 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1459,12 +1459,14 @@ static int handle_io(struct kvm_vcpu *vcpu, struct 
kvm_run *kvm_run)
= (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_DF) != 0;
kvm_run->io.rep = (exit_qualification & 32) != 0;
kvm_run->io.port = exit_quali

KVM: Handle cpuid in the kernel instead of punting to userspace

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=06465c5a3aa9948a7b00af49cd22ed8f235cdb0f
Commit: 06465c5a3aa9948a7b00af49cd22ed8f235cdb0f
Parent: 46fc1477887c41c8e900f2c95485e222b9a54822
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 28 20:46:53 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:23 2007 +0300

KVM: Handle cpuid in the kernel instead of punting to userspace

KVM used to handle cpuid by letting userspace decide what values to
return to the guest.  We now handle cpuid completely in the kernel.  We
still let userspace decide which values the guest will see by having
userspace set up the value table beforehand (this is necessary to allow
management software to set the cpu features to the least common denominator,
so that live migration can work).

The motivation for the change is that kvm kernel code can be impacted by
cpuid features, for example the x86 emulator.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm.h  |5 +++
 drivers/kvm/kvm_main.c |   69 
 drivers/kvm/svm.c  |4 +-
 drivers/kvm/vmx.c  |4 +-
 include/linux/kvm.h|   18 -
 5 files changed, 95 insertions(+), 5 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 59cbc5b..be3a0e7 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -55,6 +55,7 @@
 #define KVM_NUM_MMU_PAGES 256
 #define KVM_MIN_FREE_MMU_PAGES 5
 #define KVM_REFILL_PAGES 25
+#define KVM_MAX_CPUID_ENTRIES 40
 
 #define FX_IMAGE_SIZE 512
 #define FX_IMAGE_ALIGN 16
@@ -286,6 +287,9 @@ struct kvm_vcpu {
u32 ar;
} tr, es, ds, fs, gs;
} rmode;
+
+   int cpuid_nent;
+   struct kvm_cpuid_entry cpuid_entries[KVM_MAX_CPUID_ENTRIES];
 };
 
 struct kvm_memory_slot {
@@ -446,6 +450,7 @@ void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, 
unsigned long value,
 
 struct x86_emulate_ctxt;
 
+void kvm_emulate_cpuid(struct kvm_vcpu *vcpu);
 int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address);
 int emulate_clts(struct kvm_vcpu *vcpu);
 int emulator_get_dr(struct x86_emulate_ctxt* ctxt, int dr,
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index ff8bcfe..caec54f 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1504,6 +1504,43 @@ void save_msrs(struct vmx_msr_entry *e, int n)
 }
 EXPORT_SYMBOL_GPL(save_msrs);
 
+void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
+{
+   int i;
+   u32 function;
+   struct kvm_cpuid_entry *e, *best;
+
+   kvm_arch_ops->cache_regs(vcpu);
+   function = vcpu->regs[VCPU_REGS_RAX];
+   vcpu->regs[VCPU_REGS_RAX] = 0;
+   vcpu->regs[VCPU_REGS_RBX] = 0;
+   vcpu->regs[VCPU_REGS_RCX] = 0;
+   vcpu->regs[VCPU_REGS_RDX] = 0;
+   best = NULL;
+   for (i = 0; i < vcpu->cpuid_nent; ++i) {
+   e = &vcpu->cpuid_entries[i];
+   if (e->function == function) {
+   best = e;
+   break;
+   }
+   /*
+* Both basic or both extended?
+*/
+   if (((e->function ^ function) & 0x8000) == 0)
+   if (!best || e->function > best->function)
+   best = e;
+   }
+   if (best) {
+   vcpu->regs[VCPU_REGS_RAX] = best->eax;
+   vcpu->regs[VCPU_REGS_RBX] = best->ebx;
+   vcpu->regs[VCPU_REGS_RCX] = best->ecx;
+   vcpu->regs[VCPU_REGS_RDX] = best->edx;
+   }
+   kvm_arch_ops->decache_regs(vcpu);
+   kvm_arch_ops->skip_emulated_instruction(vcpu);
+}
+EXPORT_SYMBOL_GPL(kvm_emulate_cpuid);
+
 static void complete_pio(struct kvm_vcpu *vcpu)
 {
struct kvm_io *io = &vcpu->run->io;
@@ -2075,6 +2112,26 @@ out:
return r;
 }
 
+static int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
+   struct kvm_cpuid *cpuid,
+   struct kvm_cpuid_entry __user *entries)
+{
+   int r;
+
+   r = -E2BIG;
+   if (cpuid->nent > KVM_MAX_CPUID_ENTRIES)
+   goto out;
+   r = -EFAULT;
+   if (copy_from_user(&vcpu->cpuid_entries, entries,
+  cpuid->nent * sizeof(struct kvm_cpuid_entry)))
+   goto out;
+   vcpu->cpuid_nent = cpuid->nent;
+   return 0;
+
+out:
+   return r;
+}
+
 static long kvm_vcpu_ioctl(struct file *filp,
   unsigned int ioctl, unsigned long arg)
 {
@@ -2181,6 +2238,18 @@ static long kvm_vcpu_ioctl(struct file *filp,
case KVM_SET_MSRS:
r = msr_io(vcpu, argp, do_set_msr, 0);
break;
+   case KVM_SET_CPUID: {
+   struct kvm_cpuid __user *cpuid_arg = argp;
+   struct kvm_cpuid cpuid;
+
+   r = -EFAULT

KVM: Remove the 'emulated' field from the userspace interface

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=106b552b43beac2694df5fbafc8f125a72df5f65
Commit: 106b552b43beac2694df5fbafc8f125a72df5f65
Parent: 06465c5a3aa9948a7b00af49cd22ed8f235cdb0f
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 1 16:20:40 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:23 2007 +0300

KVM: Remove the 'emulated' field from the userspace interface

We no longer emulate single instructions in userspace.  Instead, we service
mmio or pio requests.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |5 -
 include/linux/kvm.h|3 +--
 2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index caec54f..5d24203 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1588,11 +1588,6 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, 
struct kvm_run *kvm_run)
/* re-sync apic's tpr */
vcpu->cr8 = kvm_run->cr8;
 
-   if (kvm_run->emulated) {
-   kvm_arch_ops->skip_emulated_instruction(vcpu);
-   kvm_run->emulated = 0;
-   }
-
if (kvm_run->io_completed) {
if (vcpu->pio_pending)
complete_pio(vcpu);
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 15e23bc..c6dd4a7 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -51,10 +51,9 @@ enum kvm_exit_reason {
 /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
 struct kvm_run {
/* in */
-   __u32 emulated;  /* skip current instruction */
__u32 io_completed; /* mmio/pio request completed */
__u8 request_interrupt_window;
-   __u8 padding1[7];
+   __u8 padding1[3];
 
/* out */
__u32 exit_type;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Remove minor wart from KVM_CREATE_VCPU ioctl

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a4dac3952468157297b81ae0a29815c02ead179
Commit: 2a4dac3952468157297b81ae0a29815c02ead179
Parent: 106b552b43beac2694df5fbafc8f125a72df5f65
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 1 16:47:06 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:23 2007 +0300

KVM: Remove minor wart from KVM_CREATE_VCPU ioctl

That ioctl does not transfer any data, so it should be an _IO rather than an
_IOW.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 include/linux/kvm.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index c6dd4a7..d89189a 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -241,7 +241,7 @@ struct kvm_cpuid {
  * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
  * a vcpu fd.
  */
-#define KVM_CREATE_VCPU   _IOW(KVMIO, 11, int)
+#define KVM_CREATE_VCPU   _IO(KVMIO, 11)
 #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log)
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Renumber ioctls

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=739872c56f3322c38320c7a5a543ef6f56f174bc
Commit: 739872c56f3322c38320c7a5a543ef6f56f174bc
Parent: 2a4dac3952468157297b81ae0a29815c02ead179
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 1 17:20:13 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:23 2007 +0300

KVM: Renumber ioctls

The recent changes have left the ioctl numbers in complete disarray.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 include/linux/kvm.h |   34 +-
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index d89189a..93472da 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -229,34 +229,34 @@ struct kvm_cpuid {
 /*
  * ioctls for /dev/kvm fds:
  */
-#define KVM_GET_API_VERSION   _IO(KVMIO, 1)
-#define KVM_CREATE_VM _IO(KVMIO, 2) /* returns a VM fd */
-#define KVM_GET_MSR_INDEX_LIST_IOWR(KVMIO, 15, struct kvm_msr_list)
+#define KVM_GET_API_VERSION   _IO(KVMIO,   0x00)
+#define KVM_CREATE_VM _IO(KVMIO,   0x01) /* returns a VM fd */
+#define KVM_GET_MSR_INDEX_LIST_IOWR(KVMIO, 0x02, struct kvm_msr_list)
 
 /*
  * ioctls for VM fds
  */
-#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region)
+#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region)
 /*
  * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
  * a vcpu fd.
  */
-#define KVM_CREATE_VCPU   _IO(KVMIO, 11)
-#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log)
+#define KVM_CREATE_VCPU   _IO(KVMIO,  0x41)
+#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log)
 
 /*
  * ioctls for vcpu fds
  */
-#define KVM_RUN   _IO(KVMIO, 16)
-#define KVM_GET_REGS  _IOR(KVMIO, 3, struct kvm_regs)
-#define KVM_SET_REGS  _IOW(KVMIO, 4, struct kvm_regs)
-#define KVM_GET_SREGS _IOR(KVMIO, 5, struct kvm_sregs)
-#define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs)
-#define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation)
-#define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt)
-#define KVM_DEBUG_GUEST   _IOW(KVMIO, 9, struct kvm_debug_guest)
-#define KVM_GET_MSRS  _IOWR(KVMIO, 13, struct kvm_msrs)
-#define KVM_SET_MSRS  _IOW(KVMIO, 14, struct kvm_msrs)
-#define KVM_SET_CPUID _IOW(KVMIO, 17, struct kvm_cpuid)
+#define KVM_RUN   _IO(KVMIO,   0x80)
+#define KVM_GET_REGS  _IOR(KVMIO,  0x81, struct kvm_regs)
+#define KVM_SET_REGS  _IOW(KVMIO,  0x82, struct kvm_regs)
+#define KVM_GET_SREGS _IOR(KVMIO,  0x83, struct kvm_sregs)
+#define KVM_SET_SREGS _IOW(KVMIO,  0x84, struct kvm_sregs)
+#define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation)
+#define KVM_INTERRUPT _IOW(KVMIO,  0x86, struct kvm_interrupt)
+#define KVM_DEBUG_GUEST   _IOW(KVMIO,  0x87, struct kvm_debug_guest)
+#define KVM_GET_MSRS  _IOWR(KVMIO, 0x88, struct kvm_msrs)
+#define KVM_SET_MSRS  _IOW(KVMIO,  0x89, struct kvm_msrs)
+#define KVM_SET_CPUID _IOW(KVMIO,  0x8a, struct kvm_cpuid)
 
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Add method to check for backwards-compatible API extensions

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d308f4550d9dc4c236e08b0377b610b9578577b
Commit: 5d308f4550d9dc4c236e08b0377b610b9578577b
Parent: 739872c56f3322c38320c7a5a543ef6f56f174bc
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 1 17:56:20 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:24 2007 +0300

KVM: Add method to check for backwards-compatible API extensions

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |6 ++
 include/linux/kvm.h|5 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 5d24203..39cf8fd 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2416,6 +2416,12 @@ static long kvm_dev_ioctl(struct file *filp,
r = 0;
break;
}
+   case KVM_CHECK_EXTENSION:
+   /*
+* No extensions defined at present.
+*/
+   r = 0;
+   break;
default:
;
}
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 93472da..c93cf53 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -232,6 +232,11 @@ struct kvm_cpuid {
 #define KVM_GET_API_VERSION   _IO(KVMIO,   0x00)
 #define KVM_CREATE_VM _IO(KVMIO,   0x01) /* returns a VM fd */
 #define KVM_GET_MSR_INDEX_LIST_IOWR(KVMIO, 0x02, struct kvm_msr_list)
+/*
+ * Check if a kvm extension is available.  Argument is extension number,
+ * return is 1 (yes) or 0 (no, sorry).
+ */
+#define KVM_CHECK_EXTENSION   _IO(KVMIO,   0x03)
 
 /*
  * ioctls for VM fds
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Allow userspace to process hypercalls which have no kernel handler

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4e63f560beb187cffdaf706e534a1e2f9effb66
Commit: b4e63f560beb187cffdaf706e534a1e2f9effb66
Parent: 5d308f4550d9dc4c236e08b0377b610b9578577b
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 13:59:30 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:24 2007 +0300

KVM: Allow userspace to process hypercalls which have no kernel handler

This is useful for paravirtualized graphics devices, for example.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |   18 +-
 include/linux/kvm.h|   10 +-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 39cf8fd..de93117 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1203,7 +1203,16 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run 
*run)
}
switch (nr) {
default:
-   ;
+   run->hypercall.args[0] = a0;
+   run->hypercall.args[1] = a1;
+   run->hypercall.args[2] = a2;
+   run->hypercall.args[3] = a3;
+   run->hypercall.args[4] = a4;
+   run->hypercall.args[5] = a5;
+   run->hypercall.ret = ret;
+   run->hypercall.longmode = is_long_mode(vcpu);
+   kvm_arch_ops->decache_regs(vcpu);
+   return 0;
}
vcpu->regs[VCPU_REGS_RAX] = ret;
kvm_arch_ops->decache_regs(vcpu);
@@ -1599,6 +1608,13 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, 
struct kvm_run *kvm_run)
 
vcpu->mmio_needed = 0;
 
+   if (kvm_run->exit_type == KVM_EXIT_TYPE_VM_EXIT
+   && kvm_run->exit_reason == KVM_EXIT_HYPERCALL) {
+   kvm_arch_ops->cache_regs(vcpu);
+   vcpu->regs[VCPU_REGS_RAX] = kvm_run->hypercall.ret;
+   kvm_arch_ops->decache_regs(vcpu);
+   }
+
r = kvm_arch_ops->run(vcpu, kvm_run);
 
vcpu_put(vcpu);
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index c93cf53..9151ebf 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -11,7 +11,7 @@
 #include 
 #include 
 
-#define KVM_API_VERSION 6
+#define KVM_API_VERSION 7
 
 /*
  * Architectural interrupt line count, and the size of the bitmap needed
@@ -41,6 +41,7 @@ enum kvm_exit_reason {
KVM_EXIT_UNKNOWN  = 0,
KVM_EXIT_EXCEPTION= 1,
KVM_EXIT_IO   = 2,
+   KVM_EXIT_HYPERCALL= 3,
KVM_EXIT_DEBUG= 4,
KVM_EXIT_HLT  = 5,
KVM_EXIT_MMIO = 6,
@@ -103,6 +104,13 @@ struct kvm_run {
__u32 len;
__u8  is_write;
} mmio;
+   /* KVM_EXIT_HYPERCALL */
+   struct {
+   __u64 args[6];
+   __u64 ret;
+   __u32 longmode;
+   __u32 pad;
+   } hypercall;
};
 };
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Fold kvm_run::exit_type into kvm_run::exit_reason

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8eb7d334bd8e693340ee198280f7d45035cdab8c
Commit: 8eb7d334bd8e693340ee198280f7d45035cdab8c
Parent: b4e63f560beb187cffdaf706e534a1e2f9effb66
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 14:17:08 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:24 2007 +0300

KVM: Fold kvm_run::exit_type into kvm_run::exit_reason

Currently, userspace is told about the nature of the last exit from the
guest using two fields, exit_type and exit_reason, where exit_type has
just two enumerations (and no need for more).  So fold exit_type into
exit_reason, reducing the complexity of determining what really happened.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |3 +--
 drivers/kvm/svm.c  |7 +++
 drivers/kvm/vmx.c  |7 +++
 include/linux/kvm.h|   15 ---
 4 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index de93117..ac44df5 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1608,8 +1608,7 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, 
struct kvm_run *kvm_run)
 
vcpu->mmio_needed = 0;
 
-   if (kvm_run->exit_type == KVM_EXIT_TYPE_VM_EXIT
-   && kvm_run->exit_reason == KVM_EXIT_HYPERCALL) {
+   if (kvm_run->exit_reason == KVM_EXIT_HYPERCALL) {
kvm_arch_ops->cache_regs(vcpu);
vcpu->regs[VCPU_REGS_RAX] = kvm_run->hypercall.ret;
kvm_arch_ops->decache_regs(vcpu);
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index d4b2936..b09928f 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1298,8 +1298,6 @@ static int handle_exit(struct kvm_vcpu *vcpu, struct 
kvm_run *kvm_run)
 {
u32 exit_code = vcpu->svm->vmcb->control.exit_code;
 
-   kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT;
-
if (is_external_interrupt(vcpu->svm->vmcb->control.exit_int_info) &&
exit_code != SVM_EXIT_EXCP_BASE + PF_VECTOR)
printk(KERN_ERR "%s: unexpected exit_ini_info 0x%x "
@@ -1609,8 +1607,9 @@ again:
vcpu->svm->next_rip = 0;
 
if (vcpu->svm->vmcb->control.exit_code == SVM_EXIT_ERR) {
-   kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY;
-   kvm_run->exit_reason = vcpu->svm->vmcb->control.exit_code;
+   kvm_run->exit_reason = KVM_EXIT_FAIL_ENTRY;
+   kvm_run->fail_entry.hardware_entry_failure_reason
+   = vcpu->svm->vmcb->control.exit_code;
post_kvm_run_save(vcpu, kvm_run);
return 0;
}
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 71410a6..cf9568f 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1922,10 +1922,10 @@ again:
 
asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
 
-   kvm_run->exit_type = 0;
if (fail) {
-   kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY;
-   kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR);
+   kvm_run->exit_reason = KVM_EXIT_FAIL_ENTRY;
+   kvm_run->fail_entry.hardware_entry_failure_reason
+   = vmcs_read32(VM_INSTRUCTION_ERROR);
r = 0;
} else {
/*
@@ -1935,7 +1935,6 @@ again:
profile_hit(KVM_PROFILING, (void 
*)vmcs_readl(GUEST_RIP));
 
vcpu->launched = 1;
-   kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT;
r = kvm_handle_exit(kvm_run, vcpu);
if (r > 0) {
/* Give scheduler a change to reschedule. */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 9151ebf..57f47ef 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -11,7 +11,7 @@
 #include 
 #include 
 
-#define KVM_API_VERSION 7
+#define KVM_API_VERSION 8
 
 /*
  * Architectural interrupt line count, and the size of the bitmap needed
@@ -34,9 +34,6 @@ struct kvm_memory_region {
 #define KVM_MEM_LOG_DIRTY_PAGES  1UL
 
 
-#define KVM_EXIT_TYPE_FAIL_ENTRY 1
-#define KVM_EXIT_TYPE_VM_EXIT2
-
 enum kvm_exit_reason {
KVM_EXIT_UNKNOWN  = 0,
KVM_EXIT_EXCEPTION= 1,
@@ -47,6 +44,7 @@ enum kvm_exit_reason {
KVM_EXIT_MMIO = 6,
KVM_EXIT_IRQ_WINDOW_OPEN  = 7,
KVM_EXIT_SHUTDOWN = 8,
+   KVM_EXIT_FAIL_ENTRY   = 9,
 };
 
 /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
@@ -57,12 +55,11 @@ struct kvm_run {
__u8 padding1[3];
 
/* out */
-   __u32 exit_type;
__u32 exit_reason;
__u32 instruction_length;
__u8 ready_for_interrupt_injection;
__u8 if_flag;
-   __u16 padding2;
+   __u8 padding2[6];
 
/* in (pre_kvm_run), out (post_kvm_run) */
__u64 cr8;
@@ -71,8 +68,12 @@ st

KVM: Add a special exit reason when exiting due to an interrupt

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b19f3e61d7e1edb395dd64bf7d63621a37af8ca
Commit: 1b19f3e61d7e1edb395dd64bf7d63621a37af8ca
Parent: 8eb7d334bd8e693340ee198280f7d45035cdab8c
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 14:24:03 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:24 2007 +0300

KVM: Add a special exit reason when exiting due to an interrupt

This is redundant, as we also return -EINTR from the ioctl, but it
allows us to examine the exit_reason field on resume without seeing
old data.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/svm.c   |2 ++
 drivers/kvm/vmx.c   |2 ++
 include/linux/kvm.h |3 ++-
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index b09928f..0311665 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1619,12 +1619,14 @@ again:
if (signal_pending(current)) {
++kvm_stat.signal_exits;
post_kvm_run_save(vcpu, kvm_run);
+   kvm_run->exit_reason = KVM_EXIT_INTR;
return -EINTR;
}
 
if (dm_request_for_irq_injection(vcpu, kvm_run)) {
++kvm_stat.request_irq_exits;
post_kvm_run_save(vcpu, kvm_run);
+   kvm_run->exit_reason = KVM_EXIT_INTR;
return -EINTR;
}
kvm_resched(vcpu);
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index cf9568f..e69bab6 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1941,12 +1941,14 @@ again:
if (signal_pending(current)) {
++kvm_stat.signal_exits;
post_kvm_run_save(vcpu, kvm_run);
+   kvm_run->exit_reason = KVM_EXIT_INTR;
return -EINTR;
}
 
if (dm_request_for_irq_injection(vcpu, kvm_run)) {
++kvm_stat.request_irq_exits;
post_kvm_run_save(vcpu, kvm_run);
+   kvm_run->exit_reason = KVM_EXIT_INTR;
return -EINTR;
}
 
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 57f47ef..b3af92e 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -11,7 +11,7 @@
 #include 
 #include 
 
-#define KVM_API_VERSION 8
+#define KVM_API_VERSION 9
 
 /*
  * Architectural interrupt line count, and the size of the bitmap needed
@@ -45,6 +45,7 @@ enum kvm_exit_reason {
KVM_EXIT_IRQ_WINDOW_OPEN  = 7,
KVM_EXIT_SHUTDOWN = 8,
KVM_EXIT_FAIL_ENTRY   = 9,
+   KVM_EXIT_INTR = 10,
 };
 
 /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Initialize the apic_base msr on svm too

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6722c51c51518af9581ab6cd9b6aec93774334a6
Commit: 6722c51c51518af9581ab6cd9b6aec93774334a6
Parent: 1b19f3e61d7e1edb395dd64bf7d63621a37af8ca
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 5 17:45:40 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:24 2007 +0300

KVM: Initialize the apic_base msr on svm too

Older userspace didn't care, but newer userspace (with the cpuid changes)
does.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/svm.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index 0311665..2396ada 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -582,6 +582,9 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
init_vmcb(vcpu->svm->vmcb);
 
fx_init(vcpu);
+   vcpu->apic_base = 0xfee0 |
+   /*for vcpu 0*/ MSR_IA32_APICBASE_BSP |
+   MSR_IA32_APICBASE_ENABLE;
 
return 0;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Add guest mode signal mask

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1961d276c877b99f5f16aaf36377c75e0e191c3a
Commit: 1961d276c877b99f5f16aaf36377c75e0e191c3a
Parent: 6722c51c51518af9581ab6cd9b6aec93774334a6
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 5 19:46:05 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:24 2007 +0300

KVM: Add guest mode signal mask

Allow a special signal mask to be used while executing in guest mode.  This
allows signals to be used to interrupt a vcpu without requiring signal
delivery to a userspace handler, which is quite expensive.  Userspace still
receives -EINTR and can get the signal via sigwait().

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm.h  |3 +++
 drivers/kvm/kvm_main.c |   41 +
 include/linux/kvm.h|7 +++
 3 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index be3a0e7..1c4a581 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -277,6 +277,9 @@ struct kvm_vcpu {
gpa_t mmio_phys_addr;
int pio_pending;
 
+   int sigset_active;
+   sigset_t sigset;
+
struct {
int active;
u8 save_iopl;
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index ac44df5..df85f5f 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -1591,9 +1591,13 @@ static void complete_pio(struct kvm_vcpu *vcpu)
 static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
int r;
+   sigset_t sigsaved;
 
vcpu_load(vcpu);
 
+   if (vcpu->sigset_active)
+   sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
+
/* re-sync apic's tpr */
vcpu->cr8 = kvm_run->cr8;
 
@@ -1616,6 +1620,9 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, 
struct kvm_run *kvm_run)
 
r = kvm_arch_ops->run(vcpu, kvm_run);
 
+   if (vcpu->sigset_active)
+   sigprocmask(SIG_SETMASK, &sigsaved, NULL);
+
vcpu_put(vcpu);
return r;
 }
@@ -2142,6 +2149,17 @@ out:
return r;
 }
 
+static int kvm_vcpu_ioctl_set_sigmask(struct kvm_vcpu *vcpu, sigset_t *sigset)
+{
+   if (sigset) {
+   sigdelsetmask(sigset, sigmask(SIGKILL)|sigmask(SIGSTOP));
+   vcpu->sigset_active = 1;
+   vcpu->sigset = *sigset;
+   } else
+   vcpu->sigset_active = 0;
+   return 0;
+}
+
 static long kvm_vcpu_ioctl(struct file *filp,
   unsigned int ioctl, unsigned long arg)
 {
@@ -2260,6 +2278,29 @@ static long kvm_vcpu_ioctl(struct file *filp,
goto out;
break;
}
+   case KVM_SET_SIGNAL_MASK: {
+   struct kvm_signal_mask __user *sigmask_arg = argp;
+   struct kvm_signal_mask kvm_sigmask;
+   sigset_t sigset, *p;
+
+   p = NULL;
+   if (argp) {
+   r = -EFAULT;
+   if (copy_from_user(&kvm_sigmask, argp,
+  sizeof kvm_sigmask))
+   goto out;
+   r = -EINVAL;
+   if (kvm_sigmask.len != sizeof sigset)
+   goto out;
+   r = -EFAULT;
+   if (copy_from_user(&sigset, sigmask_arg->sigset,
+  sizeof sigset))
+   goto out;
+   p = &sigset;
+   }
+   r = kvm_vcpu_ioctl_set_sigmask(vcpu, &sigset);
+   break;
+   }
default:
;
}
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index b3af92e..c0d10cd 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -234,6 +234,12 @@ struct kvm_cpuid {
struct kvm_cpuid_entry entries[0];
 };
 
+/* for KVM_SET_SIGNAL_MASK */
+struct kvm_signal_mask {
+   __u32 len;
+   __u8  sigset[0];
+};
+
 #define KVMIO 0xAE
 
 /*
@@ -273,5 +279,6 @@ struct kvm_cpuid {
 #define KVM_GET_MSRS  _IOWR(KVMIO, 0x88, struct kvm_msrs)
 #define KVM_SET_MSRS  _IOW(KVMIO,  0x89, struct kvm_msrs)
 #define KVM_SET_CPUID _IOW(KVMIO,  0x8a, struct kvm_cpuid)
+#define KVM_SET_SIGNAL_MASK   _IOW(KVMIO,  0x8b, struct kvm_signal_mask)
 
 #endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


KVM: Allow kernel to select size of mmap() buffer

2007-05-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=07c45a366d89f8eaec5d9890e810171b408f9a52
Commit: 07c45a366d89f8eaec5d9890e810171b408f9a52
Parent: 1961d276c877b99f5f16aaf36377c75e0e191c3a
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 13:05:38 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Thu May 3 10:52:24 2007 +0300

KVM: Allow kernel to select size of mmap() buffer

This allows us to store offsets in the kernel/user kvm_run area, and be
sure that userspace has them mapped.  As offsets can be outside the
kvm_run struct, userspace has no way of knowing how much to mmap.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |8 +++-
 include/linux/kvm.h|4 
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index df85f5f..cba0b87 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2436,7 +2436,7 @@ static long kvm_dev_ioctl(struct file *filp,
  unsigned int ioctl, unsigned long arg)
 {
void __user *argp = (void __user *)arg;
-   int r = -EINVAL;
+   long r = -EINVAL;
 
switch (ioctl) {
case KVM_GET_API_VERSION:
@@ -2478,6 +2478,12 @@ static long kvm_dev_ioctl(struct file *filp,
 */
r = 0;
break;
+   case KVM_GET_VCPU_MMAP_SIZE:
+   r = -EINVAL;
+   if (arg)
+   goto out;
+   r = PAGE_SIZE;
+   break;
default:
;
}
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index c0d10cd..dad9081 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -253,6 +253,10 @@ struct kvm_signal_mask {
  * return is 1 (yes) or 0 (no, sorry).
  */
 #define KVM_CHECK_EXTENSION   _IO(KVMIO,   0x03)
+/*
+ * Get size for mmap(vcpu_fd)
+ */
+#define KVM_GET_VCPU_MMAP_SIZE_IO(KVMIO,   0x04) /* in bytes */
 
 /*
  * ioctls for VM fds
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   >