LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Dynamic-ftrace not working in PlayStation3
From: Remis @ 2009-02-01 13:28 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev, Paul Mackerras, Steven Rostedt
In-Reply-To: <200901311125.34755.arnd@arndb.de>

Complementing what Arnd said, we got the dynamic ftrace to work. Just
changed 4 things in the *menuconfig*.
Before these were built as modules (this is the default I guess):
CONFIG_USB=m
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_USB_AUDIO=m

Then got them built into the kernel:
CONFIG_USB=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_USB_AUDIO=y

And everything worked just fine.
In my config when I also tried to build the *CONFIG_SND_PS3* into the
kernel, the kernel did not boot (probably another bug !? :-).

Cheers,
Remis

On Sat, Jan 31, 2009 at 11:25 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Saturday 31 January 2009, Geoff Levand wrote:
>> >
>> > So I take it that the above showed that the code worked for some?
>>
>> In my trials it blows up on the first load_module() call, and for my
>> config that was usbcore:
>
> I looked into it some more with Remis yesterday, and we got ftrace
> working by building usbcore and alsa into the kernel. Incidentally,
> usbcore is the largest module in this installation (~3MB), which
> indicates that it is in some way either related to the size of the
> module.
>
>> This ptr of 5f666f725f726573 seems bogus.  I think this code is not
>> working correctly:
>
> This is an ascii string "_for_res", probably part of
> usb_lock_device_for_reset. We saw the same behaviour, but
> a different string.
>
>        Arnd <><

^ permalink raw reply

* Testing DMA on MPC8555 board
From: wael showair @ 2009-02-01 16:05 UTC (permalink / raw)
  To: linuxppc-dev


Hi All,
i have an evaluation board with MPC8555 processor with kernel 2.6.27
the board contains DMA engine.

I want to test the DMA on my board by transferring data from a source to
destination.

I dont know can i do this using the module of dmatest? i have inserted it
but i did not get any sign that it works correct or not, so i m convinced
that fsldma will achieve my aim.
the problem is that the function of 
fsl_dma_self_test   which is called in the function of 
of_fsl_dma_chan_probe.
& i dont know how to trigger the probe function to work?


-- 
View this message in context: http://www.nabble.com/Testing-DMA-on-MPC8555-board-tp21776812p21776812.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

^ permalink raw reply

* [PATCH] powerpc: Fix oops on some machines due to incorrect pr_debug()
From: Benjamin Herrenschmidt @ 2009-02-01 22:53 UTC (permalink / raw)
  To: linuxppc-dev

Recently, a patch left DEBUG enabled in the powerpc common PCI code,
resulting in an old bug in a pr_debug() statement to show up and cause
a NULL dereference on some machines.

This fixes the pr_debug() statement and reverts to DEBUG not being
force-enabled in that file.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 arch/powerpc/kernel/pci-common.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-work.orig/arch/powerpc/kernel/pci-common.c	2009-01-30 14:32:34.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci-common.c	2009-02-02 09:51:48.000000000 +1100
@@ -16,7 +16,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#define DEBUG
+#undef DEBUG
 
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -258,7 +258,8 @@ int pci_read_irq_line(struct pci_dev *pc
 	} else {
 		pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
 			 oirq.size, oirq.specifier[0], oirq.specifier[1],
-		    oirq.controller->full_name);
+			 oirq.controller ? oirq.controller->full_name :
+			 "<default>");
 
 		virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
 					     oirq.size);

^ permalink raw reply

* [PATCH] powerpc: Rework I$/D$ coherency (v2)
From: Benjamin Herrenschmidt @ 2009-02-02  0:10 UTC (permalink / raw)
  To: linuxppc-dev

This patch reworks the way we do I and D cache coherency on PowerPC.

The "old" way was split in 3 different parts depending on the processor type:

   - Hash with per-page exec support (64-bit and >= POWER4 only) does it
at hashing time, by preventing exec on unclean pages and cleaning pages
on exec faults.

   - Everything without per-page exec support (32-bit hash, 8xx, and
64-bit < POWER4) does it for all page going to user space in update_mmu_cache().

   - Embedded with per-page exec support does it from do_page_fault() on
exec faults, in a way similar to what the hash code does.

That leads to confusion, and bugs. For example, the method using update_mmu_cache()
is racy on SMP where another processor can see the new PTE and hash it in before
we have cleaned the cache, and then blow trying to execute. This is hard to hit but
I think it has bitten us in the past.

Also, it's inefficient for embedded where we always end up having to do at least
one more page fault.

This reworks the whole thing by moving the cache sync into two main call sites,
though we keep different behaviours depending on the HW capability. The call
sites are set_pte_at() which is now made out of line, and ptep_set_access_flags()
which joins the former in pgtable.c

The base idea for Embedded with per-page exec support, is that we now do the
flush at set_pte_at() time when coming from an exec fault, which allows us
to avoid the double fault problem completely (we can even improve the situation
more by implementing TLB preload in update_mmu_cache() but that's for later).

If for some reason we didn't do it there and we try to execute, we'll hit
the page fault, which will do a minor fault, which will hit ptep_set_access_flags()
to do things like update _PAGE_ACCESSED or _PAGE_DIRTY if needed, we just make
this guys also perform the I/D cache sync for exec faults now. This second path
is the catch all for things that weren't cleaned at set_pte_at() time.

For cpus without per-pag exec support, we always do the sync at set_pte_at(),
thus guaranteeing that when the PTE is visible to other processors, the cache
is clean.

For the 64-bit hash with per-page exec support case, we keep the old mechanism
for now. I'll look into changing it later, once I've reworked a bit how we
use _PAGE_EXEC.

This is also a first step for adding _PAGE_EXEC support for embedded platforms

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

v2: Fix duplicate #define spotted by Kumar
    Fix missing _PAGE_EXEC/HWEXEC from the mask of bits filtered out
      by __ptep_set_access_flags() on 32-bit, causing thing not to work
      on processors with HWEXEC support (oops !).

 arch/powerpc/include/asm/highmem.h       |    2 
 arch/powerpc/include/asm/pgtable-ppc32.h |   56 +------------
 arch/powerpc/include/asm/pgtable-ppc64.h |   29 +-----
 arch/powerpc/include/asm/pgtable.h       |   84 +++++++++++++++++++
 arch/powerpc/mm/fault.c                  |   46 +++-------
 arch/powerpc/mm/mem.c                    |   33 -------
 arch/powerpc/mm/pgtable.c                |  133 +++++++++++++++++++++++++++++++
 7 files changed, 247 insertions(+), 136 deletions(-)

--- linux-work.orig/arch/powerpc/include/asm/pgtable-ppc32.h	2009-01-30 15:50:23.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable-ppc32.h	2009-02-02 11:05:34.000000000 +1100
@@ -429,6 +429,8 @@ extern int icache_44x_need_flush;
 #define PMD_PAGE_SIZE(pmd)	bad_call_to_PMD_PAGE_SIZE()
 #endif
 
+#define _PAGE_HPTEFLAGS _PAGE_HASHPTE
+
 #define _PAGE_CHG_MASK	(PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
 
 
@@ -667,44 +669,6 @@ static inline unsigned long long pte_upd
 #endif /* CONFIG_PTE_64BIT */
 
 /*
- * set_pte stores a linux PTE into the linux page table.
- * On machines which use an MMU hash table we avoid changing the
- * _PAGE_HASHPTE bit.
- */
-
-static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
-			      pte_t *ptep, pte_t pte)
-{
-#if (_PAGE_HASHPTE != 0) && defined(CONFIG_SMP) && !defined(CONFIG_PTE_64BIT)
-	pte_update(ptep, ~_PAGE_HASHPTE, pte_val(pte) & ~_PAGE_HASHPTE);
-#elif defined(CONFIG_PTE_64BIT) && defined(CONFIG_SMP)
-#if _PAGE_HASHPTE != 0
-	if (pte_val(*ptep) & _PAGE_HASHPTE)
-		flush_hash_entry(mm, ptep, addr);
-#endif
-	__asm__ __volatile__("\
-		stw%U0%X0 %2,%0\n\
-		eieio\n\
-		stw%U0%X0 %L2,%1"
-	: "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
-	: "r" (pte) : "memory");
-#else
-	*ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
-		      | (pte_val(pte) & ~_PAGE_HASHPTE));
-#endif
-}
-
-
-static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
-			      pte_t *ptep, pte_t pte)
-{
-#if defined(CONFIG_PTE_64BIT) && defined(CONFIG_SMP) && defined(CONFIG_DEBUG_VM)
-	WARN_ON(pte_present(*ptep));
-#endif
-	__set_pte_at(mm, addr, ptep, pte);
-}
-
-/*
  * 2.6 calls this without flushing the TLB entry; this is wrong
  * for our hash-based implementation, we fix that up here.
  */
@@ -744,24 +708,14 @@ static inline void huge_ptep_set_wrprote
 }
 
 
-#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
-static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
+static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
 {
 	unsigned long bits = pte_val(entry) &
-		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW);
+		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW |
+		 _PAGE_HWEXEC | _PAGE_EXEC);
 	pte_update(ptep, 0, bits);
 }
 
-#define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
-({									   \
-	int __changed = !pte_same(*(__ptep), __entry);			   \
-	if (__changed) {						   \
-		__ptep_set_access_flags(__ptep, __entry, __dirty);         \
-		flush_tlb_page_nohash(__vma, __address);		   \
-	}								   \
-	__changed;							   \
-})
-
 #define __HAVE_ARCH_PTE_SAME
 #define pte_same(A,B)	(((pte_val(A) ^ pte_val(B)) & ~_PAGE_HASHPTE) == 0)
 
Index: linux-work/arch/powerpc/include/asm/pgtable-ppc64.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pgtable-ppc64.h	2009-01-30 15:50:23.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable-ppc64.h	2009-02-02 11:07:05.000000000 +1100
@@ -125,6 +125,8 @@
 #define _PTEIDX_SECONDARY	0x8
 #define _PTEIDX_GROUP_IX	0x7
 
+/* To make some generic powerpc code happy */
+#define _PAGE_HWEXEC		0
 
 /*
  * POWER4 and newer have per page execute protection, older chips can only
@@ -285,6 +287,10 @@ static inline unsigned long pte_update(s
 	: "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY)
 	: "cc" );
 
+	/* huge pages use the old page table lock */
+	if (!huge)
+		assert_pte_locked(mm, addr);
+
 	if (old & _PAGE_HASHPTE)
 		hpte_need_flush(mm, addr, ptep, old, huge);
 	return old;
@@ -359,23 +365,11 @@ static inline void pte_clear(struct mm_s
 	pte_update(mm, addr, ptep, ~0UL, 0);
 }
 
-/*
- * set_pte stores a linux PTE into the linux page table.
- */
-static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
-			      pte_t *ptep, pte_t pte)
-{
-	if (pte_present(*ptep))
-		pte_clear(mm, addr, ptep);
-	pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
-	*ptep = pte;
-}
 
 /* Set the dirty and/or accessed bits atomically in a linux PTE, this
  * function doesn't need to flush the hash entry
  */
-#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
-static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
+static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
 {
 	unsigned long bits = pte_val(entry) &
 		(_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
@@ -392,15 +386,6 @@ static inline void __ptep_set_access_fla
 	:"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY)
 	:"cc");
 }
-#define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
-({									   \
-	int __changed = !pte_same(*(__ptep), __entry);			   \
-	if (__changed) {						   \
-		__ptep_set_access_flags(__ptep, __entry, __dirty);    	   \
-		flush_tlb_page_nohash(__vma, __address);		   \
-	}								   \
-	__changed;							   \
-})
 
 #define __HAVE_ARCH_PTE_SAME
 #define pte_same(A,B)	(((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0)
Index: linux-work/arch/powerpc/include/asm/pgtable.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/pgtable.h	2009-01-30 15:50:23.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/pgtable.h	2009-02-02 10:19:54.000000000 +1100
@@ -6,7 +6,17 @@
 #include <asm/processor.h>		/* For TASK_SIZE */
 #include <asm/mmu.h>
 #include <asm/page.h>
+
 struct mm_struct;
+
+#ifdef CONFIG_DEBUG_VM
+extern void assert_pte_locked(struct mm_struct *mm, unsigned long addr);
+#else /* CONFIG_DEBUG_VM */
+static inline void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
+{
+}
+#endif /* !CONFIG_DEBUG_VM */
+
 #endif /* !__ASSEMBLY__ */
 
 #if defined(CONFIG_PPC64)
@@ -17,6 +27,80 @@ struct mm_struct;
 
 #ifndef __ASSEMBLY__
 
+/* Insert a PTE, top-level function is out of line. It uses an inline
+ * low level function in the respective pgtable-* files
+ */
+extern void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
+		       pte_t pte);
+
+/* This low level function performs the actual PTE insertion
+ * Setting the PTE depends on the MMU type and other factors. It's
+ * an horrible mess that I'm not going to try to clean up now but
+ * I'm keeping it in one place rather than spread around
+ */
+static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
+				pte_t *ptep, pte_t pte, int percpu)
+{
+#if defined(CONFIG_PPC_STD_MMU_32) && defined(CONFIG_SMP) && !defined(CONFIG_PTE_64BIT)
+	/* First case is 32-bit Hash MMU in SMP mode with 32-bit PTEs. We use the
+	 * helper pte_update() which does an atomic update. We need to do that
+	 * because a concurrent invalidation can clear _PAGE_HASHPTE. If it's a
+	 * per-CPU PTE such as a kmap_atomic, we do a simple update preserving
+	 * the hash bits instead (ie, same as the non-SMP case)
+	 */
+	if (percpu)
+		*ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
+			      | (pte_val(pte) & ~_PAGE_HASHPTE));
+	else
+		pte_update(ptep, ~_PAGE_HASHPTE, pte_val(pte));
+
+#elif defined(CONFIG_PPC32) && defined(CONFIG_PTE_64BIT) && defined(CONFIG_SMP)
+	/* Second case is 32-bit with 64-bit PTE in SMP mode. In this case, we
+	 * can just store as long as we do the two halves in the right order
+	 * with a barrier in between. This is possible because we take care,
+	 * in the hash code, to pre-invalidate if the PTE was already hashed,
+	 * which synchronizes us with any concurrent invalidation.
+	 * In the percpu case, we also fallback to the simple update preserving
+	 * the hash bits
+	 */
+	if (percpu) {
+		*ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
+			      | (pte_val(pte) & ~_PAGE_HASHPTE));
+		return;
+	}
+#if _PAGE_HASHPTE != 0
+	if (pte_val(*ptep) & _PAGE_HASHPTE)
+		flush_hash_entry(mm, ptep, addr);
+#endif
+	__asm__ __volatile__("\
+		stw%U0%X0 %2,%0\n\
+		eieio\n\
+		stw%U0%X0 %L2,%1"
+	: "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
+	: "r" (pte) : "memory");
+
+#elif defined(CONFIG_PPC_STD_MMU_32)
+	/* Third case is 32-bit hash table in UP mode, we need to preserve
+	 * the _PAGE_HASHPTE bit since we may not have invalidated the previous
+	 * translation in the hash yet (done in a subsequent flush_tlb_xxx())
+	 * and see we need to keep track that this PTE needs invalidating
+	 */
+	*ptep = __pte((pte_val(*ptep) & _PAGE_HASHPTE)
+		      | (pte_val(pte) & ~_PAGE_HASHPTE));
+
+#else
+	/* Anything else just stores the PTE normally. That covers all 64-bit
+	 * cases, and 32-bit non-hash with 64-bit PTEs in UP mode
+	 */
+	*ptep = pte;
+#endif
+}
+
+
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
+				 pte_t *ptep, pte_t entry, int dirty);
+
 /*
  * Macro to mark a page protection value as "uncacheable".
  */
Index: linux-work/arch/powerpc/mm/mem.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/mem.c	2009-02-02 09:46:09.000000000 +1100
+++ linux-work/arch/powerpc/mm/mem.c	2009-02-02 10:19:54.000000000 +1100
@@ -472,40 +472,7 @@ void update_mmu_cache(struct vm_area_str
 {
 #ifdef CONFIG_PPC_STD_MMU
 	unsigned long access = 0, trap;
-#endif
-	unsigned long pfn = pte_pfn(pte);
 
-	/* handle i-cache coherency */
-	if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE) &&
-	    !cpu_has_feature(CPU_FTR_NOEXECUTE) &&
-	    pfn_valid(pfn)) {
-		struct page *page = pfn_to_page(pfn);
-#ifdef CONFIG_8xx
-		/* On 8xx, cache control instructions (particularly
-		 * "dcbst" from flush_dcache_icache) fault as write
-		 * operation if there is an unpopulated TLB entry
-		 * for the address in question. To workaround that,
-		 * we invalidate the TLB here, thus avoiding dcbst
-		 * misbehaviour.
-		 */
-		_tlbil_va(address, 0 /* 8xx doesn't care about PID */);
-#endif
-		/* The _PAGE_USER test should really be _PAGE_EXEC, but
-		 * older glibc versions execute some code from no-exec
-		 * pages, which for now we are supporting.  If exec-only
-		 * pages are ever implemented, this will have to change.
-		 */
-		if (!PageReserved(page) && (pte_val(pte) & _PAGE_USER)
-		    && !test_bit(PG_arch_1, &page->flags)) {
-			if (vma->vm_mm == current->active_mm) {
-				__flush_dcache_icache((void *) address);
-			} else
-				flush_dcache_icache_page(page);
-			set_bit(PG_arch_1, &page->flags);
-		}
-	}
-
-#ifdef CONFIG_PPC_STD_MMU
 	/* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
 	if (!pte_young(pte) || address >= TASK_SIZE)
 		return;
Index: linux-work/arch/powerpc/mm/pgtable.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/pgtable.c	2009-01-30 15:50:23.000000000 +1100
+++ linux-work/arch/powerpc/mm/pgtable.c	2009-02-02 11:05:43.000000000 +1100
@@ -1,5 +1,6 @@
 /*
  * This file contains common routines for dealing with free of page tables
+ * Along with common page table handling code
  *
  *  Derived from arch/powerpc/mm/tlb_64.c:
  *    Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
@@ -115,3 +116,135 @@ void pte_free_finish(void)
 	pte_free_submit(*batchp);
 	*batchp = NULL;
 }
+
+/*
+ * Handle i/d cache flushing, called from set_pte_at() or ptep_set_access_flags()
+ */
+static pte_t do_dcache_icache_coherency(pte_t pte)
+{
+	unsigned long pfn = pte_pfn(pte);
+	struct page *page;
+
+	if (unlikely(!pfn_valid(pfn)))
+		return pte;
+	page = pfn_to_page(pfn);
+
+	if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) {
+		pr_debug("do_dcache_icache_coherency... flushing\n");
+		flush_dcache_icache_page(page);
+		set_bit(PG_arch_1, &page->flags);
+	}
+	else
+		pr_debug("do_dcache_icache_coherency... already clean\n");
+	return __pte(pte_val(pte) | _PAGE_HWEXEC);
+}
+
+
+/* has to be a macro because of include dependencies */
+static inline int is_exec_fault(void)
+{
+	return current->thread.regs && TRAP(current->thread.regs) == 0x400;
+}
+
+/* We only try to do i/d cache coherency on stuff that looks like
+ * reasonably "normal" PTEs. We currently require a PTE to be present
+ * and we avoid _PAGE_SPECIAL and _PAGE_NO_CACHE
+ */
+static inline int pte_looks_normal(pte_t pte)
+{
+	return (pte_val(pte) &
+		(_PAGE_PRESENT | _PAGE_SPECIAL | _PAGE_NO_CACHE)) ==
+		(_PAGE_PRESENT);
+}
+
+#if defined(CONFIG_PPC_STD_MMU)
+/* Server-style MMU handles coherency when hashing if HW exec permission
+ * is supposed per page (currently 64-bit only). Else, we always flush
+ * valid PTEs in set_pte.
+ */
+static inline int pte_need_exec_flush(pte_t pte, int set_pte)
+{
+	return set_pte && pte_looks_normal(pte) &&
+		!(cpu_has_feature(CPU_FTR_COHERENT_ICACHE) ||
+		  cpu_has_feature(CPU_FTR_NOEXECUTE));
+}
+#elif _PAGE_HWEXEC == 0
+/* Embedded type MMU without HW exec support (8xx only so far), we flush
+ * the cache for any present PTE
+ */
+static inline int pte_need_exec_flush(pte_t pte, int set_pte)
+{
+	return set_pte && pte_looks_normal(pte);
+}
+#else
+/* Other embedded CPUs with HW exec support per-page, we flush on exec
+ * fault if HWEXEC is not set
+ */
+static inline int pte_need_exec_flush(pte_t pte, int set_pte)
+{
+	return pte_looks_normal(pte) && is_exec_fault() &&
+		!(pte_val(pte) & _PAGE_HWEXEC);
+}
+#endif
+
+/*
+ * set_pte stores a linux PTE into the linux page table.
+ */
+void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte)
+{
+#ifdef CONFIG_DEBUG_VM
+	WARN_ON(pte_present(*ptep));
+#endif
+	/* Note: mm->context.id might not yet have been assigned as
+	 * this context might not have been activated yet when this
+	 * is called.
+	 */
+	pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
+	if (pte_need_exec_flush(pte, 1))
+		pte = do_dcache_icache_coherency(pte);
+
+	/* Perform the setting of the PTE */
+	__set_pte_at(mm, addr, ptep, pte, 0);
+}
+
+/*
+ * This is called when relaxing access to a PTE. It's also called in the page
+ * fault path when we don't hit any of the major fault cases, ie, a minor
+ * update of _PAGE_ACCESSED, _PAGE_DIRTY, etc... The generic code will have
+ * handled those two for us, we additionally deal with missing execute
+ * permission here on some processors
+ */
+int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
+			  pte_t *ptep, pte_t entry, int dirty)
+{
+	int changed;
+	if (!dirty && pte_need_exec_flush(entry, 0))
+		entry = do_dcache_icache_coherency(entry);
+	changed = !pte_same(*(ptep), entry);
+ 	if (changed) {
+		assert_pte_locked(vma->vm_mm, address);
+		__ptep_set_access_flags(ptep, entry);
+		flush_tlb_page_nohash(vma, address);
+	}
+	return changed;
+}
+
+#ifdef CONFIG_DEBUG_VM
+void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
+{
+	pgd_t *pgd;
+	pud_t *pud;
+	pmd_t *pmd;
+
+	if (mm == &init_mm)
+		return;
+	pgd = mm->pgd + pgd_index(addr);
+	BUG_ON(pgd_none(*pgd));
+	pud = pud_offset(pgd, addr);
+	BUG_ON(pud_none(*pud));
+	pmd = pmd_offset(pud, addr);
+	BUG_ON(!pmd_present(*pmd));
+	BUG_ON(!spin_is_locked(pte_lockptr(mm, pmd)));
+}
+#endif /* CONFIG_DEBUG_VM */
+
Index: linux-work/arch/powerpc/include/asm/highmem.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/highmem.h	2009-01-30 15:50:23.000000000 +1100
+++ linux-work/arch/powerpc/include/asm/highmem.h	2009-02-02 10:19:54.000000000 +1100
@@ -99,7 +99,7 @@ static inline void *kmap_atomic_prot(str
 #ifdef CONFIG_DEBUG_HIGHMEM
 	BUG_ON(!pte_none(*(kmap_pte-idx)));
 #endif
-	__set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
+	__set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot), 1);
 	local_flush_tlb_page(NULL, vaddr);
 
 	return (void*) vaddr;
Index: linux-work/arch/powerpc/mm/fault.c
===================================================================
--- linux-work.orig/arch/powerpc/mm/fault.c	2009-01-30 15:50:23.000000000 +1100
+++ linux-work/arch/powerpc/mm/fault.c	2009-02-02 11:05:57.000000000 +1100
@@ -253,45 +253,33 @@ good_area:
 #endif /* CONFIG_8xx */
 
 	if (is_exec) {
-#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
-		/* protection fault */
+#ifdef CONFIG_PPC_STD_MMU
+		/* Protection fault on exec go straight to failure on
+		 * Hash based MMUs as they either don't support per-page
+		 * execute permission, or if they do, it's handled already
+		 * at the hash level. This test would probably have to
+		 * be removed if we change the way this works to make hash
+		 * processors use the same I/D cache coherency mechanism
+		 * as embedded.
+		 */
 		if (error_code & DSISR_PROTFAULT)
 			goto bad_area;
+#endif /* CONFIG_PPC_STD_MMU */
+
 		/*
 		 * Allow execution from readable areas if the MMU does not
 		 * provide separate controls over reading and executing.
+		 *
+		 * Note: That code used to not be enabled for 4xx/BookE.
+		 * It is now as I/D cache coherency for these is done at
+		 * set_pte_at() time and I see no reason why the test
+		 * below wouldn't be valid on those processors. This -may-
+		 * break programs compiled with a really old ABI though.
 		 */
 		if (!(vma->vm_flags & VM_EXEC) &&
 		    (cpu_has_feature(CPU_FTR_NOEXECUTE) ||
 		     !(vma->vm_flags & (VM_READ | VM_WRITE))))
 			goto bad_area;
-#else
-		pte_t *ptep;
-		pmd_t *pmdp;
-
-		/* Since 4xx/Book-E supports per-page execute permission,
-		 * we lazily flush dcache to icache. */
-		ptep = NULL;
-		if (get_pteptr(mm, address, &ptep, &pmdp)) {
-			spinlock_t *ptl = pte_lockptr(mm, pmdp);
-			spin_lock(ptl);
-			if (pte_present(*ptep)) {
-				struct page *page = pte_page(*ptep);
-
-				if (!test_bit(PG_arch_1, &page->flags)) {
-					flush_dcache_icache_page(page);
-					set_bit(PG_arch_1, &page->flags);
-				}
-				pte_update(ptep, 0, _PAGE_HWEXEC |
-					   _PAGE_ACCESSED);
-				local_flush_tlb_page(vma, address);
-				pte_unmap_unlock(ptep, ptl);
-				up_read(&mm->mmap_sem);
-				return 0;
-			}
-			pte_unmap_unlock(ptep, ptl);
-		}
-#endif
 	/* a write */
 	} else if (is_write) {
 		if (!(vma->vm_flags & VM_WRITE))

^ permalink raw reply

* [PATCH] powerpc/44x: Fix address decoding setup of PCI 2.x cells
From: Benjamin Herrenschmidt @ 2009-02-02  0:24 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linuxppc-dev

The PCI 2.x cells used on some 44x SoCs only let us configure the decode
for the low 32-bit of the incoming PLB addresses. The top 4 bits (this
is a 36-bit bus) are hard wired to different values depending on the
specific SoC in use. Our code used to work "by accident" until I added
support for the ISA memory holes and while at it added more validity
checking of the addresses.

This patch should bring it back to working condition. It still relies
on the device-tree being correct but that's somewhat a pre-requisite
for anything to work anyway.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

This is untested. Geert, can you give it a go on Sequoia and let me
know if it fixes your problem ?

 arch/powerpc/sysdev/ppc4xx_pci.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--- linux-work.orig/arch/powerpc/sysdev/ppc4xx_pci.c	2009-02-02 11:15:35.000000000 +1100
+++ linux-work/arch/powerpc/sysdev/ppc4xx_pci.c	2009-02-02 11:19:03.000000000 +1100
@@ -204,6 +204,23 @@ static int __init ppc4xx_setup_one_pci_P
 {
 	u32 ma, pcila, pciha;
 
+	/* Hack warning ! The "old" PCI 2.x cell only let us configure the low
+	 * 32-bit of incoming PLB addresses. The top 4 bits of the 36-bit
+	 * address are actually hard wired to a value that appears to depend
+	 * on the specific SoC. For example, it's 0 on 440EP and 1 on 440EPx.
+	 *
+	 * The trick here is we just crop those top bits and ignore them when
+	 * programming the chip. That means the device-tree has to be right
+	 * for the specific part used (we don't print a warning if it's wrong
+	 * but on the other hand, you'll crash quickly enough), but at least
+	 * this code should work whatever the hard coded value is
+	 */
+	plb_addr &= 0xffffffffull;
+
+	/* Note: Due to the above hack, the test below doesn't actually test
+	 * if you address is above 4G, but it tests that address and
+	 * (address + size) are both contained in the same 4G
+	 */
 	if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) ||
 	    size < 0x1000 || (plb_addr & (size - 1)) != 0) {
 		printk(KERN_WARNING "%s: Resource out of range\n",

^ permalink raw reply

* Re: [PATCH] ftrace: On PowerPC we don't need frame pointers for CALLER_ADDRs
From: Benjamin Herrenschmidt @ 2009-02-02  0:35 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: linuxppc-dev, Steven Rostedt, Paul Mackerras, Ingo Molnar,
	linux-kernel
In-Reply-To: <20090131190650.GA4284@oksana.dev.rtsoft.ru>

On Sat, 2009-01-31 at 22:06 +0300, Anton Vorontsov wrote:
> According to this discussion:
> 
> http://lkml.org/lkml/2008/7/25/338
> http://lkml.org/lkml/2008/7/26/72
> 
> Frame pointers do nothing useful on PowerPC, so lib/Kconfig.debug
> makes CONFIG_FRAME_POINTER unselectable on PPC targets. But ftrace.h
> requires CONFIG_FRAME_POINTER for CALLER_ADDR macros. Therefore
> tracing is completely useless on PowerPC:

But we need them for -pg which ftrace uses no ? (ie, gcc forces you to
have -fno-omit-frame-pointers with -fpg iirc).

Now, regardless, I agree that on PPC, __builtin_return_address() should
always work with our without that cruft, so we may as well apply that
patch...

> [...]
>   <idle>-0       0X.h3    2us+:      0:140:R   + [000]  1733:120:S mvtsd
>   <idle>-0       0X.h3    9us+: 0 (0)
>   <idle>-0       0X..3   72us : 0 (0)
>   <idle>-0       0X..3   73us :      0:140:R ==> [000]  1733:120:R mvtsd
> 
> On PPC we can safely use __builtin_return_address(1..6) w/o frame
> pointers, and with this patch the trace output looks OK:
> 
> [...]
>   <idle>-0       0X.h3    2us+:      0:140:R   + [000]  1740:120:S mvtsd
>   <idle>-0       0X.h3    9us+: hrtimer_wakeup (__run_hrtimer)
>   <idle>-0       0X..3   87us : cpu_idle (__got2_end)
>   <idle>-0       0X..3   89us :      0:140:R ==> [000]  1740:120:R mvtsd
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> 
> Btw, on PowerPC tracing is also broken w/o "ring-buffer: fix alignment
> problem" patch (currently collecting dust in the -tip tree, commit
> 082605de5f82eb692cc90f7fda071cc01bb5ac34). Any chance the fix go into
> Linus' tree, to not waste other people's time bisecting and debugging
> the problem? ;-)
> 
> For google: tracing, regression, "ring-buffer: move some metadata
> into buffer page", commit abc9b56d66fbd4d93302ef4bf6fa726e1b8255f9,
> answer is here.
> 
>  include/linux/ftrace.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
> index 9c5bc6b..13eba02 100644
> --- a/include/linux/ftrace.h
> +++ b/include/linux/ftrace.h
> @@ -146,7 +146,7 @@ static inline void __ftrace_enabled_restore(int enabled)
>  #endif
>  }
>  
> -#ifdef CONFIG_FRAME_POINTER
> +#if defined(CONFIG_FRAME_POINTER) || defined(CONFIG_PPC)
>  /* TODO: need to fix this for ARM */
>  # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
>  # define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1))

^ permalink raw reply

* [PATCH] powerpc/4xx: Add missing USB and i2c devices to Canyonlands
From: Benjamin Herrenschmidt @ 2009-02-02  2:50 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

This adds the device-tree entries for a handful of devices on the
Canyonlands board, such as the EHCI and OHCI controllers, the real
time clock and the AD7414 thermal monitor.

I also updated the defconfig to enable various options related to
these devices.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 arch/powerpc/boot/dts/canyonlands.dts          |   28 ++
 arch/powerpc/configs/44x/canyonlands_defconfig |  266 ++++++++++++++++++++++++-
 2 files changed, 284 insertions(+), 10 deletions(-)

--- linux-work.orig/arch/powerpc/boot/dts/canyonlands.dts	2009-01-30 15:50:23.000000000 +1100
+++ linux-work/arch/powerpc/boot/dts/canyonlands.dts	2009-02-02 13:48:29.000000000 +1100
@@ -142,6 +142,20 @@
 					/*RXDE*/  0x5 0x4>;
 		};
 
+                USB0: ehci@bffd0400 {
+                        compatible = "ibm,usb-ehci-460ex", "usb-ehci";
+                        interrupt-parent = <&UIC2>;
+                        interrupts = <0x1d 4>;
+                        reg = <4 0xbffd0400 0x90 4 0xbffd0490 0x70>;
+                };
+
+                USB1: usb@bffd0000 {
+                        compatible = "ohci-le";
+                        reg = <4 0xbffd0000 0x60>;
+                        interrupt-parent = <&UIC2>;
+                        interrupts = <0x1e 4>;
+                };
+
 		POB0: opb {
 			compatible = "ibm,opb-460ex", "ibm,opb";
 			#address-cells = <1>;
@@ -245,6 +259,20 @@
 				reg = <0xef600700 0x00000014>;
 				interrupt-parent = <&UIC0>;
 				interrupts = <0x2 0x4>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+                                rtc@68 {
+                                        compatible = "stm,m41t80";
+                                        reg = <0x68>;
+					interrupt-parent = <&UIC2>;
+					interrupts = <0x19 0x8>;
+                                };
+                                sttm@48 {
+                                        compatible = "ad,ad7414";
+                                        reg = <0x48>;
+					interrupt-parent = <&UIC1>;
+					interrupts = <0x14 0x8>;
+                                };
 			};
 
 			IIC1: i2c@ef600800 {
Index: linux-work/arch/powerpc/configs/44x/canyonlands_defconfig
===================================================================
--- linux-work.orig/arch/powerpc/configs/44x/canyonlands_defconfig	2009-02-02 13:44:51.000000000 +1100
+++ linux-work/arch/powerpc/configs/44x/canyonlands_defconfig	2009-02-02 13:44:55.000000000 +1100
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.29-rc2
-# Tue Jan 20 08:22:35 2009
+# Linux kernel version: 2.6.29-rc3
+# Mon Feb  2 13:13:04 2009
 #
 # CONFIG_PPC64 is not set
 
@@ -74,6 +74,15 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
 # CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_GROUP_SCHED is not set
@@ -147,11 +156,6 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
-CONFIG_CLASSIC_RCU=y
-# CONFIG_TREE_RCU is not set
-# CONFIG_PREEMPT_RCU is not set
-# CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_PREEMPT_RCU_TRACE is not set
 # CONFIG_FREEZER is not set
 CONFIG_PPC4xx_PCI_EXPRESS=y
 
@@ -373,6 +377,7 @@ CONFIG_CONNECTOR=y
 CONFIG_PROC_EVENTS=y
 # CONFIG_MTD is not set
 CONFIG_OF_DEVICE=y
+CONFIG_OF_I2C=y
 # CONFIG_PARPORT is not set
 CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_FD is not set
@@ -384,6 +389,7 @@ CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=35000
@@ -466,6 +472,15 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
 #
 # Enable WiMAX (Networking options) to see the WiMAX drivers
 #
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
 # CONFIG_WAN is not set
 # CONFIG_FDDI is not set
 # CONFIG_HIPPI is not set
@@ -533,13 +548,136 @@ CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
-# CONFIG_I2C is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# PC SMBus host controller drivers
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_ISCH is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+CONFIG_I2C_IBM_IIC=y
+# CONFIG_I2C_MPC is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Graphics adapter I2C/DDC channel drivers
+#
+# CONFIG_I2C_VOODOO3 is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 # CONFIG_SPI is not set
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 # CONFIG_GPIOLIB is not set
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
-# CONFIG_HWMON is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+CONFIG_SENSORS_AD7414=y
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_I5K_AMB is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_LTC4245 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_ADS7828 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
 # CONFIG_THERMAL is not set
 # CONFIG_THERMAL_HWMON is not set
 # CONFIG_WATCHDOG is not set
@@ -556,7 +694,12 @@ CONFIG_SSB_POSSIBLE=y
 # CONFIG_MFD_CORE is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_HTC_PASIC3 is not set
+# CONFIG_TWL4030_CORE is not set
 # CONFIG_MFD_TMIO is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
 # CONFIG_REGULATOR is not set
 
 #
@@ -574,6 +717,7 @@ CONFIG_SSB_POSSIBLE=y
 # Multimedia drivers
 #
 CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
 
 #
 # Graphics support
@@ -590,7 +734,109 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
 #
 # CONFIG_DISPLAY_SUPPORT is not set
 # CONFIG_SOUND is not set
-# CONFIG_USB_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_HCD_PPC_OF=y
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PPC_OF=y
+CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
+CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
+CONFIG_USB_OHCI_HCD_PCI=y
+CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
+CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_WHCI_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+
+#
+# see USB_STORAGE Help for more information
+#
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
 # CONFIG_UWB is not set
 # CONFIG_MMC is not set
 # CONFIG_MEMSTICK is not set

^ permalink raw reply

* [PATCH] powerpc/4xx: Enable PCI domains on 4xx
From: Benjamin Herrenschmidt @ 2009-02-02  2:59 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev

4xx chips commonly now have multiple PHBs, there is no reason to not
enable PCI domains on them. The main issue with PCI domains is X but
currently its already somewhat busted for other reasons such as the
36-bit physical address space, which I'm fixing separately.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 arch/powerpc/sysdev/ppc4xx_pci.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-work.orig/arch/powerpc/sysdev/ppc4xx_pci.c	2009-01-05 13:39:26.000000000 +1100
+++ linux-work/arch/powerpc/sysdev/ppc4xx_pci.c	2009-01-14 13:57:48.000000000 +1100
@@ -1822,6 +1822,8 @@ static int __init ppc4xx_pci_find_bridge
 {
 	struct device_node *np;
 
+	ppc_pci_flags |= PPC_PCI_ENABLE_PROC_DOMAINS | PPC_PCI_COMPAT_DOMAIN_0;
+
 #ifdef CONFIG_PPC4xx_PCI_EXPRESS
 	for_each_compatible_node(np, NULL, "ibm,plb-pciex")
 		ppc4xx_probe_pciex_bridge(np);

^ permalink raw reply

* [PATCH] powerpc: Fix oops on some machines due to incorrect pr_debug() (v2)
From: Benjamin Herrenschmidt @ 2009-02-02  3:03 UTC (permalink / raw)
  To: linuxppc-dev

Recently, a patch left DEBUG enabled in the powerpc common PCI code,
resulting in an old bug in a pr_debug() statement to show up and cause
a NULL dereference on some machines.

This fixes the pr_debug() statement and reverts to DEBUG not being
force-enabled in that file.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

v2. Don't #undef DEBUG, just don't define it, so it can still be set
    via the Makefile or other method

 arch/powerpc/kernel/pci-common.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-work.orig/arch/powerpc/kernel/pci-common.c	2009-02-02 12:50:12.000000000 +1100
+++ linux-work/arch/powerpc/kernel/pci-common.c	2009-02-02 14:02:56.000000000 +1100
@@ -16,8 +16,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#define DEBUG
-
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/string.h>
@@ -258,7 +256,8 @@ int pci_read_irq_line(struct pci_dev *pc
 	} else {
 		pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
 			 oirq.size, oirq.specifier[0], oirq.specifier[1],
-		    oirq.controller->full_name);
+			 oirq.controller ? oirq.controller->full_name :
+			 "<default>");
 
 		virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
 					     oirq.size);

^ permalink raw reply

* [PATCH 1/3] drm: Use resource_size_t for drm_get_resource_{start, len}
From: Benjamin Herrenschmidt @ 2009-02-02  5:55 UTC (permalink / raw)
  To: David Airlie; +Cc: linuxppc-dev, dri-devel

The DRM uses its own wrappers to obtain resources from PCI devices,
which currently convert the resource_size_t into an unsigned long.

This is broken on 32-bit platforms with >32-bit physical address
space.

This fixes them, along with a few occurences of unsigned long used
to store such a resource in drivers.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/gpu/drm/drm_bufs.c          |    4 ++--
 drivers/gpu/drm/i915/i915_dma.c     |    2 +-
 drivers/gpu/drm/mga/mga_drv.h       |    4 ++--
 drivers/gpu/drm/radeon/radeon_drv.h |    2 +-
 drivers/gpu/drm/savage/savage_bci.c |    8 ++++----
 include/drm/drmP.h                  |    6 +++---
 include/drm/drm_crtc.h              |    2 +-
 7 files changed, 14 insertions(+), 14 deletions(-)

--- linux-work.orig/drivers/gpu/drm/drm_bufs.c	2009-02-02 14:11:26.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_bufs.c	2009-02-02 14:11:35.000000000 +1100
@@ -36,13 +36,13 @@
 #include <linux/vmalloc.h>
 #include "drmP.h"
 
-unsigned long drm_get_resource_start(struct drm_device *dev, unsigned int resource)
+resource_size_t drm_get_resource_start(struct drm_device *dev, unsigned int resource)
 {
 	return pci_resource_start(dev->pdev, resource);
 }
 EXPORT_SYMBOL(drm_get_resource_start);
 
-unsigned long drm_get_resource_len(struct drm_device *dev, unsigned int resource)
+resource_size_t drm_get_resource_len(struct drm_device *dev, unsigned int resource)
 {
 	return pci_resource_len(dev->pdev, resource);
 }
Index: linux-work/drivers/gpu/drm/i915/i915_dma.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/i915/i915_dma.c	2009-02-02 14:25:44.000000000 +1100
+++ linux-work/drivers/gpu/drm/i915/i915_dma.c	2009-02-02 14:28:19.000000000 +1100
@@ -1051,7 +1051,7 @@ void i915_master_destroy(struct drm_devi
 int i915_driver_load(struct drm_device *dev, unsigned long flags)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	unsigned long base, size;
+	resource_size_t base, size;
 	int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1;
 
 	/* i915 has 4 more counters */
Index: linux-work/drivers/gpu/drm/mga/mga_drv.h
===================================================================
--- linux-work.orig/drivers/gpu/drm/mga/mga_drv.h	2009-02-02 14:18:10.000000000 +1100
+++ linux-work/drivers/gpu/drm/mga/mga_drv.h	2009-02-02 14:18:37.000000000 +1100
@@ -113,8 +113,8 @@ typedef struct drm_mga_private {
 	 * \sa drm_mga_private_t::mmio
 	 */
 	/*@{ */
-	u32 mmio_base;		   /**< Bus address of base of MMIO. */
-	u32 mmio_size;		   /**< Size of the MMIO region. */
+	resource_size_t mmio_base;	   /**< Bus address of base of MMIO. */
+	resource_size_t mmio_size;	   /**< Size of the MMIO region. */
 	/*@} */
 
 	u32 clear_cmd;
Index: linux-work/drivers/gpu/drm/radeon/radeon_drv.h
===================================================================
--- linux-work.orig/drivers/gpu/drm/radeon/radeon_drv.h	2009-02-02 14:13:35.000000000 +1100
+++ linux-work/drivers/gpu/drm/radeon/radeon_drv.h	2009-02-02 14:13:44.000000000 +1100
@@ -316,7 +316,7 @@ typedef struct drm_radeon_private {
 
 	/* starting from here on, data is preserved accross an open */
 	uint32_t flags;		/* see radeon_chip_flags */
-	unsigned long fb_aper_offset;
+	resource_size_t fb_aper_offset;
 
 	int num_gb_pipes;
 	int track_flush;
Index: linux-work/drivers/gpu/drm/savage/savage_bci.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/savage/savage_bci.c	2009-02-02 14:15:43.000000000 +1100
+++ linux-work/drivers/gpu/drm/savage/savage_bci.c	2009-02-02 14:16:04.000000000 +1100
@@ -599,8 +599,8 @@ int savage_driver_firstopen(struct drm_d
 			    drm_mtrr_add(dev_priv->mtrr[2].base,
 					 dev_priv->mtrr[2].size, DRM_MTRR_WC);
 		} else {
-			DRM_ERROR("strange pci_resource_len %08lx\n",
-				  drm_get_resource_len(dev, 0));
+			DRM_ERROR("strange pci_resource_len %08llx\n",
+				  (unsigned long long)drm_get_resource_len(dev, 0));
 		}
 	} else if (dev_priv->chipset != S3_SUPERSAVAGE &&
 		   dev_priv->chipset != S3_SAVAGE2000) {
@@ -620,8 +620,8 @@ int savage_driver_firstopen(struct drm_d
 			    drm_mtrr_add(dev_priv->mtrr[0].base,
 					 dev_priv->mtrr[0].size, DRM_MTRR_WC);
 		} else {
-			DRM_ERROR("strange pci_resource_len %08lx\n",
-				  drm_get_resource_len(dev, 1));
+			DRM_ERROR("strange pci_resource_len %08llx\n",
+				  (unsigned long long)drm_get_resource_len(dev, 1));
 		}
 	} else {
 		mmio_base = drm_get_resource_start(dev, 0);
Index: linux-work/include/drm/drmP.h
===================================================================
--- linux-work.orig/include/drm/drmP.h	2009-02-02 14:16:43.000000000 +1100
+++ linux-work/include/drm/drmP.h	2009-02-02 14:16:57.000000000 +1100
@@ -1173,10 +1173,10 @@ extern int drm_freebufs(struct drm_devic
 extern int drm_mapbufs(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv);
 extern int drm_order(unsigned long size);
-extern unsigned long drm_get_resource_start(struct drm_device *dev,
+extern resource_size_t drm_get_resource_start(struct drm_device *dev,
+					      unsigned int resource);
+extern resource_size_t drm_get_resource_len(struct drm_device *dev,
 					    unsigned int resource);
-extern unsigned long drm_get_resource_len(struct drm_device *dev,
-					  unsigned int resource);
 
 				/* DMA support (drm_dma.h) */
 extern int drm_dma_setup(struct drm_device *dev);
Index: linux-work/include/drm/drm_crtc.h
===================================================================
--- linux-work.orig/include/drm/drm_crtc.h	2009-02-02 14:24:56.000000000 +1100
+++ linux-work/include/drm/drm_crtc.h	2009-02-02 14:25:03.000000000 +1100
@@ -550,7 +550,7 @@ struct drm_mode_config {
 	int min_width, min_height;
 	int max_width, max_height;
 	struct drm_mode_config_funcs *funcs;
-	unsigned long fb_base;
+	resource_size_t fb_base;
 
 	/* pointers to standard properties */
 	struct list_head property_blob_list;

^ permalink raw reply

* [PATCH 2/3] drm: Split drm_map and drm_local_map
From: Benjamin Herrenschmidt @ 2009-02-02  5:55 UTC (permalink / raw)
  To: David Airlie; +Cc: linuxppc-dev, dri-devel

Once upon a time, the DRM made the distinction between the drm_map
data structure exchanged with user space and the drm_local_map used
in the kernel.

For some reasons, while the BSD port still has that "feature", the
linux part abused drm_map for kernel internal usage as the local
map only existed as a typedef of the struct drm_map.

This patch fixes it by declaring struct drm_local_map separately
(though its content is currently identical to the userspace variant),
and changing the kernel code to only use that, except when it's a
user<->kernel interface (ie. ioctl).

This allows subsequent changes to the in-kernel format

I've also replaced the use of drm_local_map_t with struct drm_local_map
in a couple of places. Mostly by accident but they are the same (the
former is a typedef of the later) and I have some remote plans and
half finished patch to completely kill the drm_local_map_t typedef
so I left those bits in.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/gpu/drm/drm_bufs.c      |   46 ++++++++++++++++++++++-----------------
 drivers/gpu/drm/drm_context.c   |    4 +--
 drivers/gpu/drm/drm_drv.c       |    2 -
 drivers/gpu/drm/drm_gem.c       |    2 -
 drivers/gpu/drm/drm_memory.c    |    6 ++---
 drivers/gpu/drm/drm_proc.c      |    2 -
 drivers/gpu/drm/drm_vm.c        |   12 +++++-----
 drivers/gpu/drm/i810/i810_drv.h |    4 +--
 drivers/gpu/drm/i830/i830_drv.h |    4 +--
 drivers/gpu/drm/i915/i915_gem.c |    4 +--
 include/drm/drmP.h              |   47 +++++++++++++++++++++++++---------------
 11 files changed, 76 insertions(+), 57 deletions(-)

--- linux-work.orig/drivers/gpu/drm/drm_bufs.c	2009-02-02 15:27:55.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_bufs.c	2009-02-02 16:00:35.000000000 +1100
@@ -50,7 +50,7 @@ resource_size_t drm_get_resource_len(str
 EXPORT_SYMBOL(drm_get_resource_len);
 
 static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
-					     drm_local_map_t *map)
+						  struct drm_local_map *map)
 {
 	struct drm_map_list *entry;
 	list_for_each_entry(entry, &dev->maplist, head) {
@@ -89,13 +89,8 @@ static int drm_map_handle(struct drm_dev
 }
 
 /**
- * Ioctl to specify a range of memory that is available for mapping by a non-root process.
- *
- * \param inode device inode.
- * \param file_priv DRM file private.
- * \param cmd command.
- * \param arg pointer to a drm_map structure.
- * \return zero on success or a negative value on error.
+ * Core function to create a range of memory available for mapping by a
+ * non-root process.
  *
  * Adjusts the memory offset to its absolute value according to the mapping
  * type.  Adds the map to the map list drm_device::maplist. Adds MTRR's where
@@ -106,7 +101,7 @@ static int drm_addmap_core(struct drm_de
 			   enum drm_map_flags flags,
 			   struct drm_map_list ** maplist)
 {
-	struct drm_map *map;
+	struct drm_local_map *map;
 	struct drm_map_list *list;
 	drm_dma_handle_t *dmah;
 	unsigned long user_token;
@@ -329,7 +324,7 @@ static int drm_addmap_core(struct drm_de
 
 int drm_addmap(struct drm_device * dev, unsigned int offset,
 	       unsigned int size, enum drm_map_type type,
-	       enum drm_map_flags flags, drm_local_map_t ** map_ptr)
+	       enum drm_map_flags flags, struct drm_local_map ** map_ptr)
 {
 	struct drm_map_list *list;
 	int rc;
@@ -342,6 +337,17 @@ int drm_addmap(struct drm_device * dev, 
 
 EXPORT_SYMBOL(drm_addmap);
 
+/**
+ * Ioctl to specify a range of memory that is available for mapping by a
+ * non-root process.
+ *
+ * \param inode device inode.
+ * \param file_priv DRM file private.
+ * \param cmd command.
+ * \param arg pointer to a drm_map structure.
+ * \return zero on success or a negative value on error.
+ *
+ */
 int drm_addmap_ioctl(struct drm_device *dev, void *data,
 		     struct drm_file *file_priv)
 {
@@ -367,19 +373,13 @@ int drm_addmap_ioctl(struct drm_device *
  * Remove a map private from list and deallocate resources if the mapping
  * isn't in use.
  *
- * \param inode device inode.
- * \param file_priv DRM file private.
- * \param cmd command.
- * \param arg pointer to a struct drm_map structure.
- * \return zero on success or a negative value on error.
- *
  * Searches the map on drm_device::maplist, removes it from the list, see if
  * its being used, and free any associate resource (such as MTRR's) if it's not
  * being on use.
  *
  * \sa drm_addmap
  */
-int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map)
+int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
 {
 	struct drm_map_list *r_list = NULL, *list_t;
 	drm_dma_handle_t dmah;
@@ -442,7 +442,7 @@ int drm_rmmap_locked(struct drm_device *
 }
 EXPORT_SYMBOL(drm_rmmap_locked);
 
-int drm_rmmap(struct drm_device *dev, drm_local_map_t *map)
+int drm_rmmap(struct drm_device *dev, struct drm_local_map *map)
 {
 	int ret;
 
@@ -462,12 +462,18 @@ EXPORT_SYMBOL(drm_rmmap);
  * One use case might be after addmap is allowed for normal users for SHM and
  * gets used by drivers that the server doesn't need to care about.  This seems
  * unlikely.
+ *
+ * \param inode device inode.
+ * \param file_priv DRM file private.
+ * \param cmd command.
+ * \param arg pointer to a struct drm_map structure.
+ * \return zero on success or a negative value on error.
  */
 int drm_rmmap_ioctl(struct drm_device *dev, void *data,
 		    struct drm_file *file_priv)
 {
 	struct drm_map *request = data;
-	drm_local_map_t *map = NULL;
+	struct drm_local_map *map = NULL;
 	struct drm_map_list *r_list;
 	int ret;
 
@@ -1534,7 +1540,7 @@ int drm_mapbufs(struct drm_device *dev, 
 			&& (dma->flags & _DRM_DMA_USE_SG))
 		    || (drm_core_check_feature(dev, DRIVER_FB_DMA)
 			&& (dma->flags & _DRM_DMA_USE_FB))) {
-			struct drm_map *map = dev->agp_buffer_map;
+			struct drm_local_map *map = dev->agp_buffer_map;
 			unsigned long token = dev->agp_buffer_token;
 
 			if (!map) {
Index: linux-work/drivers/gpu/drm/drm_context.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_context.c	2009-02-02 15:27:55.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_context.c	2009-02-02 15:29:36.000000000 +1100
@@ -143,7 +143,7 @@ int drm_getsareactx(struct drm_device *d
 		    struct drm_file *file_priv)
 {
 	struct drm_ctx_priv_map *request = data;
-	struct drm_map *map;
+	struct drm_local_map *map;
 	struct drm_map_list *_entry;
 
 	mutex_lock(&dev->struct_mutex);
@@ -186,7 +186,7 @@ int drm_setsareactx(struct drm_device *d
 		    struct drm_file *file_priv)
 {
 	struct drm_ctx_priv_map *request = data;
-	struct drm_map *map = NULL;
+	struct drm_local_map *map = NULL;
 	struct drm_map_list *r_list = NULL;
 
 	mutex_lock(&dev->struct_mutex);
Index: linux-work/drivers/gpu/drm/drm_drv.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_drv.c	2009-02-02 15:27:55.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_drv.c	2009-02-02 15:29:36.000000000 +1100
@@ -530,7 +530,7 @@ int drm_ioctl(struct inode *inode, struc
 
 EXPORT_SYMBOL(drm_ioctl);
 
-drm_local_map_t *drm_getsarea(struct drm_device *dev)
+struct drm_local_map *drm_getsarea(struct drm_device *dev)
 {
 	struct drm_map_list *entry;
 
Index: linux-work/drivers/gpu/drm/drm_gem.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_gem.c	2009-02-02 15:27:55.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_gem.c	2009-02-02 15:29:36.000000000 +1100
@@ -479,7 +479,7 @@ int drm_gem_mmap(struct file *filp, stru
 	struct drm_file *priv = filp->private_data;
 	struct drm_device *dev = priv->minor->dev;
 	struct drm_gem_mm *mm = dev->mm_private;
-	struct drm_map *map = NULL;
+	struct drm_local_map *map = NULL;
 	struct drm_gem_object *obj;
 	struct drm_hash_item *hash;
 	unsigned long prot;
Index: linux-work/drivers/gpu/drm/drm_memory.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_memory.c	2009-02-02 15:27:55.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_memory.c	2009-02-02 15:29:36.000000000 +1100
@@ -159,7 +159,7 @@ static inline void *agp_remap(unsigned l
 
 #endif				/* debug_memory */
 
-void drm_core_ioremap(struct drm_map *map, struct drm_device *dev)
+void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
 {
 	if (drm_core_has_AGP(dev) &&
 	    dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
@@ -169,12 +169,12 @@ void drm_core_ioremap(struct drm_map *ma
 }
 EXPORT_SYMBOL(drm_core_ioremap);
 
-void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev)
+void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev)
 {
 	map->handle = ioremap_wc(map->offset, map->size);
 }
 EXPORT_SYMBOL(drm_core_ioremap_wc);
-void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev)
+void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
 {
 	if (!map->handle || !map->size)
 		return;
Index: linux-work/drivers/gpu/drm/drm_proc.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_proc.c	2009-02-02 15:27:55.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_proc.c	2009-02-02 16:00:35.000000000 +1100
@@ -247,7 +247,7 @@ static int drm__vm_info(char *buf, char 
 	struct drm_minor *minor = (struct drm_minor *) data;
 	struct drm_device *dev = minor->dev;
 	int len = 0;
-	struct drm_map *map;
+	struct drm_local_map *map;
 	struct drm_map_list *r_list;
 
 	/* Hardcoded from _DRM_FRAME_BUFFER,
Index: linux-work/drivers/gpu/drm/drm_vm.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_vm.c	2009-02-02 15:27:55.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_vm.c	2009-02-02 16:00:35.000000000 +1100
@@ -91,7 +91,7 @@ static int drm_do_vm_fault(struct vm_are
 {
 	struct drm_file *priv = vma->vm_file->private_data;
 	struct drm_device *dev = priv->minor->dev;
-	struct drm_map *map = NULL;
+	struct drm_local_map *map = NULL;
 	struct drm_map_list *r_list;
 	struct drm_hash_item *hash;
 
@@ -176,7 +176,7 @@ static int drm_do_vm_fault(struct vm_are
  */
 static int drm_do_vm_shm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-	struct drm_map *map = (struct drm_map *) vma->vm_private_data;
+	struct drm_local_map *map = vma->vm_private_data;
 	unsigned long offset;
 	unsigned long i;
 	struct page *page;
@@ -209,7 +209,7 @@ static void drm_vm_shm_close(struct vm_a
 	struct drm_file *priv = vma->vm_file->private_data;
 	struct drm_device *dev = priv->minor->dev;
 	struct drm_vma_entry *pt, *temp;
-	struct drm_map *map;
+	struct drm_local_map *map;
 	struct drm_map_list *r_list;
 	int found_maps = 0;
 
@@ -322,7 +322,7 @@ static int drm_do_vm_dma_fault(struct vm
  */
 static int drm_do_vm_sg_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-	struct drm_map *map = (struct drm_map *) vma->vm_private_data;
+	struct drm_local_map *map = vma->vm_private_data;
 	struct drm_file *priv = vma->vm_file->private_data;
 	struct drm_device *dev = priv->minor->dev;
 	struct drm_sg_mem *entry = dev->sg;
@@ -512,7 +512,7 @@ static int drm_mmap_dma(struct file *fil
 	return 0;
 }
 
-unsigned long drm_core_get_map_ofs(struct drm_map * map)
+unsigned long drm_core_get_map_ofs(struct drm_local_map * map)
 {
 	return map->offset;
 }
@@ -547,7 +547,7 @@ int drm_mmap_locked(struct file *filp, s
 {
 	struct drm_file *priv = filp->private_data;
 	struct drm_device *dev = priv->minor->dev;
-	struct drm_map *map = NULL;
+	struct drm_local_map *map = NULL;
 	unsigned long offset = 0;
 	struct drm_hash_item *hash;
 
Index: linux-work/include/drm/drmP.h
===================================================================
--- linux-work.orig/include/drm/drmP.h	2009-02-02 15:27:56.000000000 +1100
+++ linux-work/include/drm/drmP.h	2009-02-02 16:00:35.000000000 +1100
@@ -523,19 +523,32 @@ struct drm_mm {
 
 
 /**
+ * Kernel side of a mapping
+ */
+struct drm_local_map {
+	unsigned long offset;	 /**< Requested physical address (0 for SAREA)*/
+	unsigned long size;	 /**< Requested physical size (bytes) */
+	enum drm_map_type type;	 /**< Type of memory to map */
+	enum drm_map_flags flags;	 /**< Flags */
+	void *handle;		 /**< User-space: "Handle" to pass to mmap() */
+				 /**< Kernel-space: kernel-virtual address */
+	int mtrr;		 /**< MTRR slot used */
+};
+
+typedef struct drm_local_map drm_local_map_t;
+
+/**
  * Mappings list
  */
 struct drm_map_list {
 	struct list_head head;		/**< list head */
 	struct drm_hash_item hash;
-	struct drm_map *map;			/**< mapping */
+	struct drm_local_map *map;	/**< mapping */
 	uint64_t user_token;
 	struct drm_master *master;
 	struct drm_mm_node *file_offset_node;	/**< fake offset */
 };
 
-typedef struct drm_map drm_local_map_t;
-
 /**
  * Context handle list
  */
@@ -560,7 +573,7 @@ struct drm_ati_pcigart_info {
 	dma_addr_t bus_addr;
 	dma_addr_t table_mask;
 	struct drm_dma_handle *table_handle;
-	drm_local_map_t mapping;
+	struct drm_local_map mapping;
 	int table_size;
 };
 
@@ -747,7 +760,7 @@ struct drm_driver {
 					struct drm_file *file_priv);
 	void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
 					    struct drm_file *file_priv);
-	unsigned long (*get_map_ofs) (struct drm_map * map);
+	unsigned long (*get_map_ofs) (struct drm_local_map * map);
 	unsigned long (*get_reg_ofs) (struct drm_device *dev);
 	void (*set_version) (struct drm_device *dev,
 			     struct drm_set_version *sv);
@@ -932,7 +945,7 @@ struct drm_device {
 	sigset_t sigmask;
 
 	struct drm_driver *driver;
-	drm_local_map_t *agp_buffer_map;
+	struct drm_local_map *agp_buffer_map;
 	unsigned int agp_buffer_token;
 	struct drm_minor *control;		/**< Control node for card */
 	struct drm_minor *primary;		/**< render type primary screen head */
@@ -1049,7 +1062,7 @@ extern int drm_release(struct inode *ino
 extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
 extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
 extern void drm_vm_open_locked(struct vm_area_struct *vma);
-extern unsigned long drm_core_get_map_ofs(struct drm_map * map);
+extern unsigned long drm_core_get_map_ofs(struct drm_local_map * map);
 extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev);
 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
 
@@ -1155,11 +1168,11 @@ extern int drm_addbufs_agp(struct drm_de
 extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request);
 extern int drm_addmap(struct drm_device *dev, unsigned int offset,
 		      unsigned int size, enum drm_map_type type,
-		      enum drm_map_flags flags, drm_local_map_t ** map_ptr);
+		      enum drm_map_flags flags, struct drm_local_map **map_ptr);
 extern int drm_addmap_ioctl(struct drm_device *dev, void *data,
 			    struct drm_file *file_priv);
-extern int drm_rmmap(struct drm_device *dev, drm_local_map_t *map);
-extern int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map);
+extern int drm_rmmap(struct drm_device *dev, struct drm_local_map *map);
+extern int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map);
 extern int drm_rmmap_ioctl(struct drm_device *dev, void *data,
 			   struct drm_file *file_priv);
 extern int drm_addbufs(struct drm_device *dev, void *data,
@@ -1261,7 +1274,7 @@ extern struct proc_dir_entry *drm_proc_r
 
 extern struct idr drm_minors_idr;
 
-extern drm_local_map_t *drm_getsarea(struct drm_device *dev);
+extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
 
 				/* Proc support (drm_proc.h) */
 extern int drm_proc_init(struct drm_minor *minor, int minor_id,
@@ -1376,12 +1389,12 @@ int drm_gem_open_ioctl(struct drm_device
 void drm_gem_open(struct drm_device *dev, struct drm_file *file_private);
 void drm_gem_release(struct drm_device *dev, struct drm_file *file_private);
 
-extern void drm_core_ioremap(struct drm_map *map, struct drm_device *dev);
-extern void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev);
-extern void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev);
+extern void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev);
+extern void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev);
+extern void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev);
 
-static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev,
-						   unsigned int token)
+static __inline__ struct drm_local_map *drm_core_findmap(struct drm_device *dev,
+							 unsigned int token)
 {
 	struct drm_map_list *_entry;
 	list_for_each_entry(_entry, &dev->maplist, head)
@@ -1408,7 +1421,7 @@ static __inline__ int drm_device_is_pcie
 	return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP);
 }
 
-static __inline__ void drm_core_dropmap(struct drm_map *map)
+static __inline__ void drm_core_dropmap(struct drm_local_map *map)
 {
 }
 
Index: linux-work/drivers/gpu/drm/i810/i810_drv.h
===================================================================
--- linux-work.orig/drivers/gpu/drm/i810/i810_drv.h	2009-02-02 16:00:49.000000000 +1100
+++ linux-work/drivers/gpu/drm/i810/i810_drv.h	2009-02-02 16:00:53.000000000 +1100
@@ -77,8 +77,8 @@ typedef struct _drm_i810_ring_buffer {
 } drm_i810_ring_buffer_t;
 
 typedef struct drm_i810_private {
-	struct drm_map *sarea_map;
-	struct drm_map *mmio_map;
+	struct drm_local_map *sarea_map;
+	struct drm_local_map *mmio_map;
 
 	drm_i810_sarea_t *sarea_priv;
 	drm_i810_ring_buffer_t ring;
Index: linux-work/drivers/gpu/drm/i830/i830_drv.h
===================================================================
--- linux-work.orig/drivers/gpu/drm/i830/i830_drv.h	2009-02-02 16:01:25.000000000 +1100
+++ linux-work/drivers/gpu/drm/i830/i830_drv.h	2009-02-02 16:01:29.000000000 +1100
@@ -84,8 +84,8 @@ typedef struct _drm_i830_ring_buffer {
 } drm_i830_ring_buffer_t;
 
 typedef struct drm_i830_private {
-	struct drm_map *sarea_map;
-	struct drm_map *mmio_map;
+	struct drm_local_map *sarea_map;
+	struct drm_local_map *mmio_map;
 
 	drm_i830_sarea_t *sarea_priv;
 	drm_i830_ring_buffer_t ring;
Index: linux-work/drivers/gpu/drm/i915/i915_gem.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/i915/i915_gem.c	2009-02-02 16:01:58.000000000 +1100
+++ linux-work/drivers/gpu/drm/i915/i915_gem.c	2009-02-02 16:02:09.000000000 +1100
@@ -627,7 +627,7 @@ i915_gem_create_mmap_offset(struct drm_g
 	struct drm_gem_mm *mm = dev->mm_private;
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 	struct drm_map_list *list;
-	struct drm_map *map;
+	struct drm_local_map *map;
 	int ret = 0;
 
 	/* Set the object up for mmap'ing */
@@ -2857,7 +2857,7 @@ void i915_gem_free_object(struct drm_gem
 	struct drm_device *dev = obj->dev;
 	struct drm_gem_mm *mm = dev->mm_private;
 	struct drm_map_list *list;
-	struct drm_map *map;
+	struct drm_local_map *map;
 	struct drm_i915_gem_object *obj_priv = obj->driver_private;
 
 	while (obj_priv->pin_count > 0)

^ permalink raw reply

* [PATCH 3/3] drm: Make drm_local_map use a resource_size_t offset
From: Benjamin Herrenschmidt @ 2009-02-02  5:55 UTC (permalink / raw)
  To: David Airlie; +Cc: linuxppc-dev, dri-devel

This changes drm_local_map to use a resource_size for its "offset"
member instead of an unsigned long, thus allowing 32-bit machines
with a >32-bit physical address space to be able to store there
their register or framebuffer addresses when those are above 4G,
such as when using a PCI video card on a recent AMCC 440 SoC.

This patch isn't as "trivial" as it sounds: A few functions needed
to have some unsigned long/int changed to resource_size_t and a few
printk's had to be adjusted.

But also, because userspace isn't capable of passing such offsets,
I had to modify drm_find_matching_map() to ignore the offset passed
in for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS.

If we ever support multiple _DRM_FRAMEBUFFER or _DRM_REGISTERS maps
for a given device, we might have to change that trick, but I don't
think that happens on any current driver.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/gpu/drm/drm_bufs.c         |   33 ++++++++++++++++++++++++---------
 drivers/gpu/drm/drm_proc.c         |    4 ++--
 drivers/gpu/drm/drm_vm.c           |   22 ++++++++++++----------
 drivers/gpu/drm/mga/mga_dma.c      |   17 +++++++++--------
 drivers/gpu/drm/mga/mga_drv.h      |    4 ++--
 drivers/gpu/drm/r128/r128_cce.c    |    7 ++++---
 drivers/gpu/drm/radeon/radeon_cp.c |    9 +++++----
 include/drm/drmP.h                 |   12 ++++++------
 8 files changed, 64 insertions(+), 44 deletions(-)

--- linux-work.orig/drivers/gpu/drm/drm_bufs.c	2009-02-02 16:29:54.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_bufs.c	2009-02-02 16:29:54.000000000 +1100
@@ -54,11 +54,25 @@ static struct drm_map_list *drm_find_mat
 {
 	struct drm_map_list *entry;
 	list_for_each_entry(entry, &dev->maplist, head) {
-		if (entry->map && (entry->master == dev->primary->master) && (map->type == entry->map->type) &&
-		    ((entry->map->offset == map->offset) ||
-		     ((map->type == _DRM_SHM) && (map->flags&_DRM_CONTAINS_LOCK)))) {
+		/* Due to userspace API breakage, we ignore the map offset
+		 * for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS
+		 */
+		if (!entry->map ||
+		    map->type != entry->map->type ||
+		    entry->master != dev->primary->master)
+			continue;
+		switch (map->type) {
+		case _DRM_SHM:
+			if (map->flags != _DRM_CONTAINS_LOCK)
+				break;
+		case _DRM_REGISTERS:
+		case _DRM_FRAME_BUFFER:
 			return entry;
+		default: /* Make gcc happy */
+			;
 		}
+		if (entry->map->offset == map->offset)
+			return entry;
 	}
 
 	return NULL;
@@ -96,7 +110,7 @@ static int drm_map_handle(struct drm_dev
  * type.  Adds the map to the map list drm_device::maplist. Adds MTRR's where
  * applicable and if supported by the kernel.
  */
-static int drm_addmap_core(struct drm_device * dev, unsigned int offset,
+static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
 			   unsigned int size, enum drm_map_type type,
 			   enum drm_map_flags flags,
 			   struct drm_map_list ** maplist)
@@ -124,9 +138,9 @@ static int drm_addmap_core(struct drm_de
 		drm_free(map, sizeof(*map), DRM_MEM_MAPS);
 		return -EINVAL;
 	}
-	DRM_DEBUG("offset = 0x%08lx, size = 0x%08lx, type = %d\n",
-		  map->offset, map->size, map->type);
-	if ((map->offset & (~PAGE_MASK)) || (map->size & (~PAGE_MASK))) {
+	DRM_DEBUG("offset = 0x%08llx, size = 0x%08lx, type = %d\n",
+		  (unsigned long long)map->offset, map->size, map->type);
+	if ((map->offset & (~(resource_size_t)PAGE_MASK)) || (map->size & (~PAGE_MASK))) {
 		drm_free(map, sizeof(*map), DRM_MEM_MAPS);
 		return -EINVAL;
 	}
@@ -254,7 +268,8 @@ static int drm_addmap_core(struct drm_de
 			drm_free(map, sizeof(*map), DRM_MEM_MAPS);
 			return -EPERM;
 		}
-		DRM_DEBUG("AGP offset = 0x%08lx, size = 0x%08lx\n", map->offset, map->size);
+		DRM_DEBUG("AGP offset = 0x%08llx, size = 0x%08lx\n",
+			  (unsigned long long)map->offset, map->size);
 
 		break;
 	case _DRM_GEM:
@@ -322,7 +337,7 @@ static int drm_addmap_core(struct drm_de
 	return 0;
 	}
 
-int drm_addmap(struct drm_device * dev, unsigned int offset,
+int drm_addmap(struct drm_device * dev, resource_size_t offset,
 	       unsigned int size, enum drm_map_type type,
 	       enum drm_map_flags flags, struct drm_local_map ** map_ptr)
 {
Index: linux-work/drivers/gpu/drm/drm_proc.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_proc.c	2009-02-02 16:29:54.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_proc.c	2009-02-02 16:29:54.000000000 +1100
@@ -276,9 +276,9 @@ static int drm__vm_info(char *buf, char 
 			type = "??";
 		else
 			type = types[map->type];
-		DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s  0x%02x 0x%08lx ",
+		DRM_PROC_PRINT("%4d 0x%08llx 0x%08lx %4.4s  0x%02x 0x%08lx ",
 			       i,
-			       map->offset,
+			       (unsigned long long)map->offset,
 			       map->size, type, map->flags,
 			       (unsigned long) r_list->user_token);
 		if (map->mtrr < 0) {
Index: linux-work/drivers/gpu/drm/drm_vm.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/drm_vm.c	2009-02-02 16:29:54.000000000 +1100
+++ linux-work/drivers/gpu/drm/drm_vm.c	2009-02-02 16:29:54.000000000 +1100
@@ -115,9 +115,9 @@ static int drm_do_vm_fault(struct vm_are
 		 * Using vm_pgoff as a selector forces us to use this unusual
 		 * addressing scheme.
 		 */
-		unsigned long offset = (unsigned long)vmf->virtual_address -
-								vma->vm_start;
-		unsigned long baddr = map->offset + offset;
+		resource_size_t offset = (unsigned long)vmf->virtual_address -
+			vma->vm_start;
+		resource_size_t baddr = map->offset + offset;
 		struct drm_agp_mem *agpmem;
 		struct page *page;
 
@@ -149,8 +149,10 @@ static int drm_do_vm_fault(struct vm_are
 		vmf->page = page;
 
 		DRM_DEBUG
-		    ("baddr = 0x%lx page = 0x%p, offset = 0x%lx, count=%d\n",
-		     baddr, __va(agpmem->memory->memory[offset]), offset,
+		    ("baddr = 0x%llx page = 0x%p, offset = 0x%llx, count=%d\n",
+		     (unsigned long long)baddr,
+		     __va(agpmem->memory->memory[offset]),
+		     (unsigned long long)offset,
 		     page_count(page));
 		return 0;
 	}
@@ -512,14 +514,14 @@ static int drm_mmap_dma(struct file *fil
 	return 0;
 }
 
-unsigned long drm_core_get_map_ofs(struct drm_local_map * map)
+resource_size_t drm_core_get_map_ofs(struct drm_local_map * map)
 {
 	return map->offset;
 }
 
 EXPORT_SYMBOL(drm_core_get_map_ofs);
 
-unsigned long drm_core_get_reg_ofs(struct drm_device *dev)
+resource_size_t drm_core_get_reg_ofs(struct drm_device *dev)
 {
 #ifdef __alpha__
 	return dev->hose->dense_mem_base - dev->hose->mem_space->start;
@@ -548,7 +550,7 @@ int drm_mmap_locked(struct file *filp, s
 	struct drm_file *priv = filp->private_data;
 	struct drm_device *dev = priv->minor->dev;
 	struct drm_local_map *map = NULL;
-	unsigned long offset = 0;
+	resource_size_t offset = 0;
 	struct drm_hash_item *hash;
 
 	DRM_DEBUG("start = 0x%lx, end = 0x%lx, page offset = 0x%lx\n",
@@ -623,9 +625,9 @@ int drm_mmap_locked(struct file *filp, s
 				       vma->vm_page_prot))
 			return -EAGAIN;
 		DRM_DEBUG("   Type = %d; start = 0x%lx, end = 0x%lx,"
-			  " offset = 0x%lx\n",
+			  " offset = 0x%llx\n",
 			  map->type,
-			  vma->vm_start, vma->vm_end, map->offset + offset);
+			  vma->vm_start, vma->vm_end, (unsigned long long)(map->offset + offset));
 		vma->vm_ops = &drm_vm_ops;
 		break;
 	case _DRM_CONSISTENT:
Index: linux-work/drivers/gpu/drm/mga/mga_dma.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/mga/mga_dma.c	2009-02-02 16:29:50.000000000 +1100
+++ linux-work/drivers/gpu/drm/mga/mga_dma.c	2009-02-02 16:29:54.000000000 +1100
@@ -148,8 +148,8 @@ void mga_do_dma_flush(drm_mga_private_t 
 		primary->space = head - tail;
 	}
 
-	DRM_DEBUG("   head = 0x%06lx\n", head - dev_priv->primary->offset);
-	DRM_DEBUG("   tail = 0x%06lx\n", tail - dev_priv->primary->offset);
+	DRM_DEBUG("   head = 0x%06lx\n", (unsigned long)(head - dev_priv->primary->offset));
+	DRM_DEBUG("   tail = 0x%06lx\n", (unsigned long)(tail - dev_priv->primary->offset));
 	DRM_DEBUG("  space = 0x%06x\n", primary->space);
 
 	mga_flush_write_combine();
@@ -187,7 +187,7 @@ void mga_do_dma_wrap_start(drm_mga_priva
 		primary->space = head - dev_priv->primary->offset;
 	}
 
-	DRM_DEBUG("   head = 0x%06lx\n", head - dev_priv->primary->offset);
+	DRM_DEBUG("   head = 0x%06lx\n", (unsigned long)(head - dev_priv->primary->offset));
 	DRM_DEBUG("   tail = 0x%06x\n", primary->tail);
 	DRM_DEBUG("   wrap = %d\n", primary->last_wrap);
 	DRM_DEBUG("  space = 0x%06x\n", primary->space);
@@ -239,7 +239,7 @@ static void mga_freelist_print(struct dr
 	for (entry = dev_priv->head->next; entry; entry = entry->next) {
 		DRM_INFO("   %p   idx=%2d  age=0x%x 0x%06lx\n",
 			 entry, entry->buf->idx, entry->age.head,
-			 entry->age.head - dev_priv->primary->offset);
+			 (unsigned long)(entry->age.head - dev_priv->primary->offset));
 	}
 	DRM_INFO("\n");
 }
@@ -340,10 +340,10 @@ static struct drm_buf *mga_freelist_get(
 
 	DRM_DEBUG("   tail=0x%06lx %d\n",
 		  tail->age.head ?
-		  tail->age.head - dev_priv->primary->offset : 0,
+		  (unsigned long)(tail->age.head - dev_priv->primary->offset) : 0,
 		  tail->age.wrap);
 	DRM_DEBUG("   head=0x%06lx %d\n",
-		  head - dev_priv->primary->offset, wrap);
+		  (unsigned long)(head - dev_priv->primary->offset), wrap);
 
 	if (TEST_AGE(&tail->age, head, wrap)) {
 		prev = dev_priv->tail->prev;
@@ -366,8 +366,9 @@ int mga_freelist_put(struct drm_device *
 	drm_mga_freelist_t *head, *entry, *prev;
 
 	DRM_DEBUG("age=0x%06lx wrap=%d\n",
-		  buf_priv->list_entry->age.head -
-		  dev_priv->primary->offset, buf_priv->list_entry->age.wrap);
+		  (unsigned long)(buf_priv->list_entry->age.head -
+				  dev_priv->primary->offset),
+		  buf_priv->list_entry->age.wrap);
 
 	entry = buf_priv->list_entry;
 	head = dev_priv->head;
Index: linux-work/drivers/gpu/drm/mga/mga_drv.h
===================================================================
--- linux-work.orig/drivers/gpu/drm/mga/mga_drv.h	2009-02-02 16:29:54.000000000 +1100
+++ linux-work/drivers/gpu/drm/mga/mga_drv.h	2009-02-02 16:29:54.000000000 +1100
@@ -317,8 +317,8 @@ do {									\
 		DRM_INFO( "\n" );					\
 		DRM_INFO( "   tail=0x%06x head=0x%06lx\n",		\
 			  dev_priv->prim.tail,				\
-			  MGA_READ( MGA_PRIMADDRESS ) -			\
-			  dev_priv->primary->offset );			\
+			  (unsigned long)(MGA_READ(MGA_PRIMADDRESS) -	\
+					  dev_priv->primary->offset));	\
 	}								\
 	if ( !test_bit( 0, &dev_priv->prim.wrapped ) ) {		\
 		if ( dev_priv->prim.space <				\
Index: linux-work/drivers/gpu/drm/r128/r128_cce.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/r128/r128_cce.c	2009-02-02 16:29:50.000000000 +1100
+++ linux-work/drivers/gpu/drm/r128/r128_cce.c	2009-02-02 16:29:54.000000000 +1100
@@ -525,11 +525,12 @@ static int r128_do_init_cce(struct drm_d
 	} else
 #endif
 	{
-		dev_priv->cce_ring->handle = (void *)dev_priv->cce_ring->offset;
+		dev_priv->cce_ring->handle =
+			(void *)(unsigned long)dev_priv->cce_ring->offset;
 		dev_priv->ring_rptr->handle =
-		    (void *)dev_priv->ring_rptr->offset;
+			(void *)(unsigned long)dev_priv->ring_rptr->offset;
 		dev->agp_buffer_map->handle =
-		    (void *)dev->agp_buffer_map->offset;
+			(void *)(unsigned long)dev->agp_buffer_map->offset;
 	}
 
 #if __OS_HAS_AGP
Index: linux-work/drivers/gpu/drm/radeon/radeon_cp.c
===================================================================
--- linux-work.orig/drivers/gpu/drm/radeon/radeon_cp.c	2009-02-02 16:29:50.000000000 +1100
+++ linux-work/drivers/gpu/drm/radeon/radeon_cp.c	2009-02-02 16:29:54.000000000 +1100
@@ -1052,11 +1052,12 @@ static int radeon_do_init_cp(struct drm_
 	} else
 #endif
 	{
-		dev_priv->cp_ring->handle = (void *)dev_priv->cp_ring->offset;
+		dev_priv->cp_ring->handle =
+			(void *)(unsigned long)dev_priv->cp_ring->offset;
 		dev_priv->ring_rptr->handle =
-		    (void *)dev_priv->ring_rptr->offset;
+			(void *)(unsigned long)dev_priv->ring_rptr->offset;
 		dev->agp_buffer_map->handle =
-		    (void *)dev->agp_buffer_map->offset;
+			(void *)(unsigned long)dev->agp_buffer_map->offset;
 
 		DRM_DEBUG("dev_priv->cp_ring->handle %p\n",
 			  dev_priv->cp_ring->handle);
@@ -1167,7 +1168,7 @@ static int radeon_do_init_cp(struct drm_
 		/* if we have an offset set from userspace */
 		if (dev_priv->pcigart_offset_set) {
 			dev_priv->gart_info.bus_addr =
-			    dev_priv->pcigart_offset + dev_priv->fb_location;
+				(resource_size_t)dev_priv->pcigart_offset + dev_priv->fb_location;
 			dev_priv->gart_info.mapping.offset =
 			    dev_priv->pcigart_offset + dev_priv->fb_aper_offset;
 			dev_priv->gart_info.mapping.size =
Index: linux-work/include/drm/drmP.h
===================================================================
--- linux-work.orig/include/drm/drmP.h	2009-02-02 16:29:54.000000000 +1100
+++ linux-work/include/drm/drmP.h	2009-02-02 16:29:54.000000000 +1100
@@ -526,7 +526,7 @@ struct drm_mm {
  * Kernel side of a mapping
  */
 struct drm_local_map {
-	unsigned long offset;	 /**< Requested physical address (0 for SAREA)*/
+	resource_size_t offset;	 /**< Requested physical address (0 for SAREA)*/
 	unsigned long size;	 /**< Requested physical size (bytes) */
 	enum drm_map_type type;	 /**< Type of memory to map */
 	enum drm_map_flags flags;	 /**< Flags */
@@ -760,8 +760,8 @@ struct drm_driver {
 					struct drm_file *file_priv);
 	void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
 					    struct drm_file *file_priv);
-	unsigned long (*get_map_ofs) (struct drm_local_map * map);
-	unsigned long (*get_reg_ofs) (struct drm_device *dev);
+	resource_size_t (*get_map_ofs) (struct drm_local_map * map);
+	resource_size_t (*get_reg_ofs) (struct drm_device *dev);
 	void (*set_version) (struct drm_device *dev,
 			     struct drm_set_version *sv);
 
@@ -1062,8 +1062,8 @@ extern int drm_release(struct inode *ino
 extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
 extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
 extern void drm_vm_open_locked(struct vm_area_struct *vma);
-extern unsigned long drm_core_get_map_ofs(struct drm_local_map * map);
-extern unsigned long drm_core_get_reg_ofs(struct drm_device *dev);
+extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);
+extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);
 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
 
 				/* Memory management support (drm_memory.h) */
@@ -1166,7 +1166,7 @@ extern int drm_i_have_hw_lock(struct drm
 				/* Buffer management support (drm_bufs.h) */
 extern int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request);
 extern int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request);
-extern int drm_addmap(struct drm_device *dev, unsigned int offset,
+extern int drm_addmap(struct drm_device *dev, resource_size_t offset,
 		      unsigned int size, enum drm_map_type type,
 		      enum drm_map_flags flags, struct drm_local_map **map_ptr);
 extern int drm_addmap_ioctl(struct drm_device *dev, void *data,

^ permalink raw reply

* [git pull] Please pull from powerpc.git next branch
From: Benjamin Herrenschmidt @ 2009-02-02  6:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list

[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]

Hi Linus !

Some updates for 2.6.29. Note the atyfb change. This is a fix shielded
in #ifdef CONFIG_PPC, there is no fbdev maintainer, so Andrew and I
decided to send it via my tree. It's a simple workaround for an ooooold
regression.

The rest is mostly small stuff from Grant who missed -rc2 probably due
to being away (defconfig updates, a small bug fix), a regression fix
in our PCI code and a lost patch in Stephen serie of u64 conversion.

Cheers,
Ben.

The following changes since commit 45c82b5a770be66845687a7d027c8b52946d59af:
  Linus Torvalds (1):
        Merge branch 'header-fixes-for-linus' of git://git.kernel.org/.../tip/linux-2.6-tip

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge

Benjamin Herrenschmidt (1):
      powerpc: Fix oops on some machines due to incorrect pr_debug()

Grant Likely (3):
      powerpc/5200: update defconfigs
      powerpc/5200: Bugfix for PCI mapping of memory and IMMR
      powerpc/5200: update device tree binding documentation

Risto Suominen (1):
      fbdev/atyfb: Fix DSP config on some PowerMacs & PowerBooks

Stephen Rothwell (1):
      powerpc/ps3: Printing fixups for l64 to ll64 convserion drivers/net

 Documentation/powerpc/dts-bindings/fsl/mpc5200.txt |  180 +++++++++++++
 .../powerpc/mpc52xx-device-tree-bindings.txt       |  277 --------------------
 arch/powerpc/configs/52xx/cm5200_defconfig         |   83 +++++--
 arch/powerpc/configs/52xx/lite5200b_defconfig      |   86 +++++--
 arch/powerpc/configs/52xx/motionpro_defconfig      |   85 +++++--
 arch/powerpc/configs/52xx/pcm030_defconfig         |   82 ++++--
 arch/powerpc/configs/52xx/tqm5200_defconfig        |   89 +++++--
 arch/powerpc/configs/mpc5200_defconfig             |  104 ++++++--
 arch/powerpc/kernel/pci-common.c                   |    5 +-
 arch/powerpc/platforms/52xx/mpc52xx_pci.c          |   24 +-
 drivers/net/ps3_gelic_wireless.c                   |    2 +-
 drivers/video/aty/mach64_ct.c                      |   11 +
 12 files changed, 590 insertions(+), 438 deletions(-)
 create mode 100644 Documentation/powerpc/dts-bindings/fsl/mpc5200.txt
 delete mode 100644 Documentation/powerpc/mpc52xx-device-tree-bindings.txt


[-- Attachment #2: Type: text/html, Size: 3373 bytes --]

^ permalink raw reply

* Re: Dynamic-ftrace not working in PlayStation3
From: Geert Uytterhoeven @ 2009-02-02  8:24 UTC (permalink / raw)
  To: Remis; +Cc: linuxppc-dev, Paul Mackerras, Steven Rostedt, Arnd Bergmann
In-Reply-To: <a25370a30902010528l2c11444ch843da0bfd91d05f@mail.gmail.com>

On Sun, 1 Feb 2009, Remis wrote:
> Complementing what Arnd said, we got the dynamic ftrace to work. Just
> changed 4 things in the *menuconfig*.
> Before these were built as modules (this is the default I guess):
> CONFIG_USB=m
> CONFIG_SOUND=m
> CONFIG_SND=m
> CONFIG_SND_USB_AUDIO=m
> 
> Then got them built into the kernel:
> CONFIG_USB=y
> CONFIG_SOUND=y
> CONFIG_SND=y
> CONFIG_SND_USB_AUDIO=y
> 
> And everything worked just fine.
> In my config when I also tried to build the *CONFIG_SND_PS3* into the
> kernel, the kernel did not boot (probably another bug !? :-).

JFYI, I always use CONFIG_SND_PS3=y in my PS3 kernels, so it should work.
Probably it conflicts with something else I have not enabled...

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

^ permalink raw reply

* RE: [PATCH] add gpio to mpc837X rdb
From: Reynes Philippe @ 2009-02-02  9:13 UTC (permalink / raw)
  To: Kumar Gala, avorontsov; +Cc: linuxppc-dev list
In-Reply-To: <0819EFA5-E86A-4D7F-8C60-06721B8072D8@freescale.com>

Signed-off-by: Philippe Reynes <philippe.reynes@isismpp.fr>
---
Index: powerpc/arch/powerpc/boot/dts/mpc8377_rdb.dts
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- powerpc.orig/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ powerpc/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -109,6 +109,24 @@
 			reg =3D <0x200 0x100>;
 		};
=20
+		gpio1: gpio-controller@c00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8377-gpio",
"fsl,mpc8349-gpio";
+			reg =3D <0xc00 0x100>;
+			interrupts =3D <74 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
+		gpio2: gpio-controller@d00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8377-gpio",
"fsl,mpc8349-gpio";
+			reg =3D <0xd00 0x100>;
+			interrupts =3D <75 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
 		i2c@3000 {
 			#address-cells =3D <1>;
 			#size-cells =3D <0>;
Index: powerpc/arch/powerpc/boot/dts/mpc8378_rdb.dts
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- powerpc.orig/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ powerpc/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -109,6 +109,24 @@
 			reg =3D <0x200 0x100>;
 		};
=20
+		gpio1: gpio-controller@c00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8378-gpio",
"fsl,mpc8349-gpio";
+			reg =3D <0xc00 0x100>;
+			interrupts =3D <74 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
+		gpio2: gpio-controller@d00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8378-gpio",
"fsl,mpc8349-gpio";
+			reg =3D <0xd00 0x100>;
+			interrupts =3D <75 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
 		i2c@3000 {
 			#address-cells =3D <1>;
 			#size-cells =3D <0>;
Index: powerpc/arch/powerpc/boot/dts/mpc8379_rdb.dts
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- powerpc.orig/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ powerpc/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -107,6 +107,24 @@
 			reg =3D <0x200 0x100>;
 		};
=20
+		gpio1: gpio-controller@c00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8379-gpio",
"fsl,mpc8349-gpio";
+			reg =3D <0xc00 0x100>;
+			interrupts =3D <74 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
+		gpio2: gpio-controller@d00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8379-gpio",
"fsl,mpc8349-gpio";
+			reg =3D <0xd00 0x100>;
+			interrupts =3D <75 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
 		i2c@3000 {
 			#address-cells =3D <1>;
 			#size-cells =3D <0>;

^ permalink raw reply

* Re: Booting 2.6.29-rc3 on mpc8661d_hpcn failing
From: Martyn Welch @ 2009-02-02  9:36 UTC (permalink / raw)
  To: Becky Bruce; +Cc: linuxppc-dev list
In-Reply-To: <9B0CCADB-C891-42B2-BE94-0927B5715A00@kernel.crashing.org>

Becky Bruce wrote:
> 
> On Jan 30, 2009, at 8:42 AM, Kumar Gala wrote:
> 
>>
>> On Jan 30, 2009, at 6:31 AM, Martyn Welch wrote:
>>
>>> Hi Guys,
>>>
>>> It seems that 2.6.29-rc3 is not booting on the MPC8641 HPCN. I have 
>>> just updated u-boot to the latest git to see if that improved 
>>> matters, however I get stuck at the following. Any ideas?
>>
>> did you update your .dtb as well?

Yup, just double checked it. SOC mapped at ffe00000. If I use the wrong DTB I don't get any serial output...

> 
> We've changed the memory map for that board in the latest u-boot, which 
> is why you need a new .dtb.  If this still failing, let me know, and 
> I'll give it a try on my board and see what's up since this is probably 
> my fault :)
> 

It appears the same problem is affecting our sbc610 as well, the location of the SOC hasn't changed on that board.

Martyn


-- 
Martyn Welch MEng MPhil MIET (Principal Software Engineer)   T:+44(0)1327322748
GE Fanuc Intelligent Platforms Ltd,        |Registered in England and Wales
Tove Valley Business Park, Towcester,      |(3828642) at 100 Barbirolli Square,
Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB  VAT:GB 729849476

^ permalink raw reply

* Re: [PATCH] powerpc/44x: Fix address decoding setup of PCI 2.x cells
From: Geert Uytterhoeven @ 2009-02-02 12:13 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <20090202002429.ADA74DDF43@ozlabs.org>

On Mon, 2 Feb 2009, Benjamin Herrenschmidt wrote:
> The PCI 2.x cells used on some 44x SoCs only let us configure the decode
> for the low 32-bit of the incoming PLB addresses. The top 4 bits (this
> is a 36-bit bus) are hard wired to different values depending on the
> specific SoC in use. Our code used to work "by accident" until I added
> support for the ISA memory holes and while at it added more validity
> checking of the addresses.
> 
> This patch should bring it back to working condition. It still relies
> on the device-tree being correct but that's somewhat a pre-requisite
> for anything to work anyway.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> 
> This is untested. Geert, can you give it a go on Sequoia and let me
> know if it fixes your problem ?

Thanks, it seems to fix the problems.

Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>

| sequoia:~# lspci -v
| 00:00.0 Bridge: IBM Device 027f
|         Subsystem: Applied Micro Circuits Corp. Device cafe
|         Flags: bus master, medium devsel, latency 0, IRQ 16
|         Memory at <unassigned> (32-bit, prefetchable)
                    ^^^^^^^^^^^^
Is this expected?

|         Capabilities: [58] Power Management version 2
| 
| 00:0a.0 USB Controller: NEC Corporation USB (rev 43) (prog-if 10 [OHCI])
|         Subsystem: DTK Computer PTI-205N USB 2.0 Host Controller
|         Flags: bus master, medium devsel, latency 8, IRQ 16
|         Memory at 180000000 (32-bit, non-prefetchable) [size=4K]
|         Capabilities: [40] Power Management version 2
|         Kernel driver in use: ohci_hcd
| 
| 00:0a.1 USB Controller: NEC Corporation USB (rev 43) (prog-if 10 [OHCI])
|         Subsystem: DTK Computer PTI-205N USB 2.0 Host Controller
|         Flags: bus master, medium devsel, latency 8, IRQ 16
|         Memory at 180001000 (32-bit, non-prefetchable) [size=4K]
|         Capabilities: [40] Power Management version 2
|         Kernel driver in use: ohci_hcd
| 
| 00:0a.2 USB Controller: NEC Corporation USB 2.0 (rev 04) (prog-if 20 [EHCI])
|         Subsystem: DTK Computer PTI-205N USB 2.0 Host Controller
|         Flags: bus master, medium devsel, latency 68, IRQ 16
|         Memory at 180002000 (32-bit, non-prefetchable) [size=256]
|         Capabilities: [40] Power Management version 2
|         Kernel driver in use: ehci_hcd
| 
| sequoia:~# 

However, 'lsusb' doesn't detect any USB devices connected to the USB PCI card, except for
the root hubs:

| sequoia:~# lsusb
| Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
| Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
| Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
| sequoia:~# 

An E1000 Ethernet card does work fine now.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010

^ permalink raw reply

* Re: [PATCH] add gpio to mpc837X rdb
From: Peter Korsgaard @ 2009-02-02 12:27 UTC (permalink / raw)
  To: Reynes Philippe; +Cc: linuxppc-dev list, Kumar Gala
In-Reply-To: <761F451C5F17F74DAEE4661DA5ABBC1616C455@factorix.ISISTHIBAUD.local>

>>>>> "Reynes" == Reynes Philippe <philippe.reynes@isismpp.fr> writes:

 Reynes> Signed-off-by: Philippe Reynes <philippe.reynes@isismpp.fr>
 Reynes> ---
 Reynes> Index: powerpc/arch/powerpc/boot/dts/mpc8377_rdb.dts
 Reynes> ===================================================================
 Reynes> --- powerpc.orig/arch/powerpc/boot/dts/mpc8377_rdb.dts
 Reynes> +++ powerpc/arch/powerpc/boot/dts/mpc8377_rdb.dts
 Reynes> @@ -109,6 +109,24 @@
 Reynes>  			reg = <0x200 0x100>;
 Reynes>  		};
 
 Reynes> +		gpio1: gpio-controller@c00 {
 Reynes> +			#gpio-cells = <2>;
 Reynes> +			compatible = "fsl,mpc8377-gpio",
 Reynes> "fsl,mpc8349-gpio";

Still word wrapped. Please try sending the patch to yourself first and
check if you can apply it before sending it to the list.

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH] Add support for the digsy MTC board.
From: Grzegorz Bernacki @ 2009-02-02 12:50 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40901300859t4da76ce3hf943adc48abb9b9c@mail.gmail.com>

Grant Likely wrote:
>> +/dts-v1/;
>> +
>> +/ {
>> +       model = "mtc,digsy";
>> +       compatible = "mtc,digsy";
> 
> This should be something like:  "intercontrol,digsy-mtc".  Compatible
> values should be in the form "<vendor>,<model>".
> 

ok, I will change it

>> +               mpc5200_pic: interrupt-controller@500 {
>> +                       // 5200 interrupts are encoded into two levels;
>> +                       interrupt-controller;
>> +                       #interrupt-cells = <3>;
>> +                       device_type = "interrupt-controller";
> 
> Drop device_type here.

ok, I will drop it

>> +                       compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
>> +                       reg = <0x500 0x80>;
>> +               };
>> +
>> +               timer@600 {     // General Purpose Timer
>> +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
>> +                       cell-index = <0>;
> 
> Drop cell-index on all the timer nodes.  If you compare this file with
> the current cm5200.dts in mainline then you'll see the properties that
> you can drop.
> 
> Otherwise the device tree looks pretty good.
> 
>> diff --git a/arch/powerpc/configs/52xx/digsy_mtc_defconfig b/arch/powerpc/configs/52xx/digsy_mtc_defconfig
>> new file mode 100644
>> index 0000000..ad70d5b
>> --- /dev/null
>> +++ b/arch/powerpc/configs/52xx/digsy_mtc_defconfig

I would like to have support for following devices in defconfig for digsy:
- LXT PHY
- RTC DS1337
- EEPROM AT24
- MTD partitioning based on OF description

If you dont mind I can add them to generic mpc5200 defconfig, otherwise
I think that separate defconfig is needed.

> 
> Do you *really* need your own defconfig for the digsy_mtc.  I've
> grudgingly accepted them for other boards under the argument that the
> defconfig reflects a specific application of the board.  However, I'd
> much rather see the digsy added to the multiplatform
> mpc5200_defconfig, especially considering that the MTC looks like it's
> supposed to be a general purpose platform.

> There is a lot of direct copy/paste from the lite5200.c board file,
> but the big scary warning comment about not duplicating this code was
> deleted in the copy (so I know you saw it).  Is Semihalf responsible
> for the U-Boot port to the digsy-mtc?  If so then please fix the
> port_config and clock settings in u-boot.
> 

I will update port config and clock settings in u-boot and use mpc5200_simple
instead of creating a new file for digsy.

BTW,
I noticed that there are some problems with mounting file system
over NFS on Linux-2.6.29-rc3, I see following messages:
...
[  339.813807] nfs: server 192.168.1.1 not responding, still trying
[  339.832144] nfs: server 192.168.1.1 OK
...

I haven't noticed in on Linux-2.6.29-rc2. Is there any known problem?

regards,
Grzesiek

^ permalink raw reply

* Re: [PATCH 1/3] drm: Use resource_size_t for drm_get_resource_{start, len}
From: Dave Airlie @ 2009-02-02 13:08 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: David Airlie, linuxppc-dev, dri-devel
In-Reply-To: <20090202055557.57CECDDF4A@ozlabs.org>

On Mon, Feb 2, 2009 at 3:55 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> The DRM uses its own wrappers to obtain resources from PCI devices,
> which currently convert the resource_size_t into an unsigned long.
>
> This is broken on 32-bit platforms with >32-bit physical address
> space.
>
> This fixes them, along with a few occurences of unsigned long used
> to store such a resource in drivers.

Looks good, one comment below.

Dave.

>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
>  drivers/gpu/drm/drm_bufs.c          |    4 ++--
>  drivers/gpu/drm/i915/i915_dma.c     |    2 +-
>  drivers/gpu/drm/mga/mga_drv.h       |    4 ++--
>  drivers/gpu/drm/radeon/radeon_drv.h |    2 +-
>  drivers/gpu/drm/savage/savage_bci.c |    8 ++++----
>  include/drm/drmP.h                  |    6 +++---
>  include/drm/drm_crtc.h              |    2 +-
>  7 files changed, 14 insertions(+), 14 deletions(-)
>
> --- linux-work.orig/drivers/gpu/drm/drm_bufs.c  2009-02-02 14:11:26.000000000 +1100
> +++ linux-work/drivers/gpu/drm/drm_bufs.c       2009-02-02 14:11:35.000000000 +1100
> @@ -36,13 +36,13 @@
>  #include <linux/vmalloc.h>
>  #include "drmP.h"
>
> -unsigned long drm_get_resource_start(struct drm_device *dev, unsigned int resource)
> +resource_size_t drm_get_resource_start(struct drm_device *dev, unsigned int resource)
>  {
>        return pci_resource_start(dev->pdev, resource);
>  }
>  EXPORT_SYMBOL(drm_get_resource_start);
>
> -unsigned long drm_get_resource_len(struct drm_device *dev, unsigned int resource)
> +resource_size_t drm_get_resource_len(struct drm_device *dev, unsigned int resource)
>  {
>        return pci_resource_len(dev->pdev, resource);
>  }
> Index: linux-work/drivers/gpu/drm/i915/i915_dma.c
> ===================================================================
> --- linux-work.orig/drivers/gpu/drm/i915/i915_dma.c     2009-02-02 14:25:44.000000000 +1100
> +++ linux-work/drivers/gpu/drm/i915/i915_dma.c  2009-02-02 14:28:19.000000000 +1100
> @@ -1051,7 +1051,7 @@ void i915_master_destroy(struct drm_devi
>  int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  {
>        struct drm_i915_private *dev_priv = dev->dev_private;
> -       unsigned long base, size;
> +       resource_size_t base, size;
>        int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1;
>
>        /* i915 has 4 more counters */
> Index: linux-work/drivers/gpu/drm/mga/mga_drv.h
> ===================================================================
> --- linux-work.orig/drivers/gpu/drm/mga/mga_drv.h       2009-02-02 14:18:10.000000000 +1100
> +++ linux-work/drivers/gpu/drm/mga/mga_drv.h    2009-02-02 14:18:37.000000000 +1100
> @@ -113,8 +113,8 @@ typedef struct drm_mga_private {
>         * \sa drm_mga_private_t::mmio
>         */
>        /*@{ */
> -       u32 mmio_base;             /**< Bus address of base of MMIO. */
> -       u32 mmio_size;             /**< Size of the MMIO region. */
> +       resource_size_t mmio_base;         /**< Bus address of base of MMIO. */
> +       resource_size_t mmio_size;         /**< Size of the MMIO region. */
>        /*@} */
>
>        u32 clear_cmd;
> Index: linux-work/drivers/gpu/drm/radeon/radeon_drv.h
> ===================================================================
> --- linux-work.orig/drivers/gpu/drm/radeon/radeon_drv.h 2009-02-02 14:13:35.000000000 +1100
> +++ linux-work/drivers/gpu/drm/radeon/radeon_drv.h      2009-02-02 14:13:44.000000000 +1100
> @@ -316,7 +316,7 @@ typedef struct drm_radeon_private {
>
>        /* starting from here on, data is preserved accross an open */
>        uint32_t flags;         /* see radeon_chip_flags */
> -       unsigned long fb_aper_offset;
> +       resource_size_t fb_aper_offset;
>
>        int num_gb_pipes;
>        int track_flush;
> Index: linux-work/drivers/gpu/drm/savage/savage_bci.c
> ===================================================================
> --- linux-work.orig/drivers/gpu/drm/savage/savage_bci.c 2009-02-02 14:15:43.000000000 +1100
> +++ linux-work/drivers/gpu/drm/savage/savage_bci.c      2009-02-02 14:16:04.000000000 +1100
> @@ -599,8 +599,8 @@ int savage_driver_firstopen(struct drm_d
>                            drm_mtrr_add(dev_priv->mtrr[2].base,
>                                         dev_priv->mtrr[2].size, DRM_MTRR_WC);
>                } else {
> -                       DRM_ERROR("strange pci_resource_len %08lx\n",
> -                                 drm_get_resource_len(dev, 0));
> +                       DRM_ERROR("strange pci_resource_len %08llx\n",
> +                                 (unsigned long long)drm_get_resource_len(dev, 0));

Don't we have a printk specifier for this now?

>                }
>        } else if (dev_priv->chipset != S3_SUPERSAVAGE &&
>                   dev_priv->chipset != S3_SAVAGE2000) {
> @@ -620,8 +620,8 @@ int savage_driver_firstopen(struct drm_d
>                            drm_mtrr_add(dev_priv->mtrr[0].base,
>                                         dev_priv->mtrr[0].size, DRM_MTRR_WC);
>                } else {
> -                       DRM_ERROR("strange pci_resource_len %08lx\n",
> -                                 drm_get_resource_len(dev, 1));
> +                       DRM_ERROR("strange pci_resource_len %08llx\n",
> +                                 (unsigned long long)drm_get_resource_len(dev, 1));
>                }
>        } else {
>                mmio_base = drm_get_resource_start(dev, 0);
> Index: linux-work/include/drm/drmP.h
> ===================================================================
> --- linux-work.orig/include/drm/drmP.h  2009-02-02 14:16:43.000000000 +1100
> +++ linux-work/include/drm/drmP.h       2009-02-02 14:16:57.000000000 +1100
> @@ -1173,10 +1173,10 @@ extern int drm_freebufs(struct drm_devic
>  extern int drm_mapbufs(struct drm_device *dev, void *data,
>                       struct drm_file *file_priv);
>  extern int drm_order(unsigned long size);
> -extern unsigned long drm_get_resource_start(struct drm_device *dev,
> +extern resource_size_t drm_get_resource_start(struct drm_device *dev,
> +                                             unsigned int resource);
> +extern resource_size_t drm_get_resource_len(struct drm_device *dev,
>                                            unsigned int resource);
> -extern unsigned long drm_get_resource_len(struct drm_device *dev,
> -                                         unsigned int resource);
>
>                                /* DMA support (drm_dma.h) */
>  extern int drm_dma_setup(struct drm_device *dev);
> Index: linux-work/include/drm/drm_crtc.h
> ===================================================================
> --- linux-work.orig/include/drm/drm_crtc.h      2009-02-02 14:24:56.000000000 +1100
> +++ linux-work/include/drm/drm_crtc.h   2009-02-02 14:25:03.000000000 +1100
> @@ -550,7 +550,7 @@ struct drm_mode_config {
>        int min_width, min_height;
>        int max_width, max_height;
>        struct drm_mode_config_funcs *funcs;
> -       unsigned long fb_base;
> +       resource_size_t fb_base;
>
>        /* pointers to standard properties */
>        struct list_head property_blob_list;
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> --
> _______________________________________________
> Dri-devel mailing list
> Dri-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dri-devel
>

^ permalink raw reply

* Re: Internal assembler error for instruction icbt
From: martin1234 @ 2009-02-02 13:09 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <21479519.post@talk.nabble.com>




wael showair wrote:
> 
> hi All,
> i have LTIB version 6.2.2 with which i have built linux kernel 2.6.19-rc5
> for my board where its processor is MPC8555.i built the kernel Image
> successfuly without any problems
> But Now i want to upgrade the linux kernel to 2.6.27 but unfortunately i
> got the following error:
> 
> 
> ************************************************************************
>  Using /home/test/ltib-6.2.2-sv/rpm/BUILD/linux-2.6.27 as source for
> kernel
>   GEN     /home/test/ltib-6.2.2-sv/rpm/BUILD/kbuild/mpc8555amc/Makefile
>   CHK     include/linux/version.h
>   CHK     include/linux/utsrelease.h
>   CALL   
> /home/test/ltib-6.2.2-sv/rpm/BUILD/linux-2.6.27/scripts/checksyscalls.sh
>   CHK     include/linux/compile.h
>   CALL   
> /home/test/ltib-6.2.2-sv/rpm/BUILD/linux-2.6.27/arch/powerpc/kernel/systbl_chk.sh
>   CC      arch/powerpc/kernel/prom_init.o
>   CALL   
> /home/test/ltib-6.2.2-sv/rpm/BUILD/linux-2.6.27/arch/powerpc/kernel/prom_init_check.sh
>   BOOTCC  arch/powerpc/boot/4xx.o
> Assembler messages:
> Error: Internal assembler error for instruction icbt
> Internal error, aborting at
> /usr/src/RPM/BUILD/crosstool/source/binutils-2.15/gas/config/tc-ppc.c line
> 1300 in ppc_setup_opcodes
> Please report this bug.
> make[2]: *** [arch/powerpc/boot/4xx.o] Error 2
> make[1]: *** [zImage] Error 2
> make: *** [sub-make] Error 2
> error: Bad exit status from /home/test/ltib-6.2.2-sv/tmp/rpm-tmp.81042
> (%build)
> 
> 
> RPM build errors:
>     Bad exit status from /home/test/ltib-6.2.2-sv/tmp/rpm-tmp.81042
> (%build)
> Failed building kernel-2.6.27-mpc8555amc
> ************************************************************************
> 
> i think that i have to upgrade the cross toolchain that i m using,
> actually it is version 3.4.3?
> is there a certain version of toolchain that i have to use to build linux
> kernel 2.6.27?
> 
> My last question is how can i upgrade the toolchain i m using?
> 
> thanks in advance for ur help
> 


HI there

Did you ever find out how to update the toolchain that you are using

I'm trying to crosscompile for the powerpc and get the same error, I also
need to update to an newer toolchain,
I'm currently using Suse11.1. Any advise will be wellcome, thanks...
-- 
View this message in context: http://www.nabble.com/Internal-assembler-error-for-instruction-icbt-tp21479519p21789373.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [PATCH] ftrace: On PowerPC we don't need frame pointers for CALLER_ADDRs
From: Steven Rostedt @ 2009-02-02 14:04 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev, Ingo Molnar, Paul Mackerras, linux-kernel
In-Reply-To: <1233534919.18767.69.camel@pasglop>


On Mon, 2009-02-02 at 11:35 +1100, Benjamin Herrenschmidt wrote:
> On Sat, 2009-01-31 at 22:06 +0300, Anton Vorontsov wrote:
> > According to this discussion:
> > 
> > http://lkml.org/lkml/2008/7/25/338
> > http://lkml.org/lkml/2008/7/26/72
> > 
> > Frame pointers do nothing useful on PowerPC, so lib/Kconfig.debug
> > makes CONFIG_FRAME_POINTER unselectable on PPC targets. But ftrace.h
> > requires CONFIG_FRAME_POINTER for CALLER_ADDR macros. Therefore
> > tracing is completely useless on PowerPC:
> 
> But we need them for -pg which ftrace uses no ? (ie, gcc forces you to
> have -fno-omit-frame-pointers with -fpg iirc).

Yes, ftrace function tracing requires -pg which requires FRAME_POINTER
turned on.

> 
> Now, regardless, I agree that on PPC, __builtin_return_address() should
> always work with our without that cruft, so we may as well apply that
> patch...
> 
> > [...]
> >   <idle>-0       0X.h3    2us+:      0:140:R   + [000]  1733:120:S mvtsd
> >   <idle>-0       0X.h3    9us+: 0 (0)
> >   <idle>-0       0X..3   72us : 0 (0)
> >   <idle>-0       0X..3   73us :      0:140:R ==> [000]  1733:120:R mvtsd
> > 
> > On PPC we can safely use __builtin_return_address(1..6) w/o frame
> > pointers, and with this patch the trace output looks OK:
> > 
> > [...]
> >   <idle>-0       0X.h3    2us+:      0:140:R   + [000]  1740:120:S mvtsd
> >   <idle>-0       0X.h3    9us+: hrtimer_wakeup (__run_hrtimer)
> >   <idle>-0       0X..3   87us : cpu_idle (__got2_end)
> >   <idle>-0       0X..3   89us :      0:140:R ==> [000]  1740:120:R mvtsd
> > 
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > ---
> > 
> > Btw, on PowerPC tracing is also broken w/o "ring-buffer: fix alignment
> > problem" patch (currently collecting dust in the -tip tree, commit
> > 082605de5f82eb692cc90f7fda071cc01bb5ac34). Any chance the fix go into
> > Linus' tree, to not waste other people's time bisecting and debugging
> > the problem? ;-)
> > 
> > For google: tracing, regression, "ring-buffer: move some metadata
> > into buffer page", commit abc9b56d66fbd4d93302ef4bf6fa726e1b8255f9,
> > answer is here.
> > 
> >  include/linux/ftrace.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
> > index 9c5bc6b..13eba02 100644
> > --- a/include/linux/ftrace.h
> > +++ b/include/linux/ftrace.h
> > @@ -146,7 +146,7 @@ static inline void __ftrace_enabled_restore(int enabled)
> >  #endif
> >  }
> >  
> > -#ifdef CONFIG_FRAME_POINTER
> > +#if defined(CONFIG_FRAME_POINTER) || defined(CONFIG_PPC)

Perhaps we should add a HAVE_NORMAL_FRAME_POINTERS in 
arch/powerpc/Kconfig under PPC and then we can change the above line to:

#if defined(CONFIG_FRAME_POINTERS) || \
		defined(CONFIG_HAVE_NORMAL_FRAME_POINTERS)

This way when another arch wants to belong to this, we do not need to
have a list of archs here.

-- Steve

> >  /* TODO: need to fix this for ARM */
> >  # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
> >  # define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1))
> 

^ permalink raw reply

* Re: Can not get PATA to work for Compact Flash with 2.6.28 kernel
From: Steven A. Falco @ 2009-02-02 14:59 UTC (permalink / raw)
  To: Lixin Yao; +Cc: linuxppc-dev
In-Reply-To: <03D77CA4AC7F4D48A6AB5DA3F1001B3F10A4B2@exchtxus2.HSTX.global.vpn>

Lixin Yao wrote:
> 
> 
> I use a San Disk compact flash (CF) card on a board with MPC8248
> processor. The CF is connected to data and address bus of the processor
> and operates in TRUE IDE mode. The registers are memory mapped. I can
> read the file system on the CF in u-boot (1.3.4). U-boot can identify
> the CF and mount file system correctly.
> 
> The hardware is known good hardware.
> 
> I use 2.6.28 kernel and configured support for PATA for the CF.

The second register set does not start at register 0.  It starts
at register 6.  We are using 1 chip select from the processor,
and generate two chip selects to the CF that are 0x80 apart (on
a sequoia board).

So here is what I am using on the modified sequoia board.  Note
the 0x00000098 - you might think it should be 0x00000080 as per
the discussion above, but because the second register set starts
at 6, you have to build that into the address.  

pata@1,0 {
compatible = "harris,hydra_temp-pata", "ata-generic";
bank-width = <2>;
reg = <0x00000001 0x00000000 0x00000020 0x00000001 0x00000098 0x00000004>;
reg-shift = <2>;
pio-mode = <6>;
interrupt-parent = <&UIC0>;
interrupts = <0x1b 0x4>;
};

	Steve

^ permalink raw reply

* Re: [PATCH] Add support for the digsy MTC board.
From: Grant Likely @ 2009-02-02 15:00 UTC (permalink / raw)
  To: Grzegorz Bernacki; +Cc: linuxppc-dev
In-Reply-To: <4986EC33.9000600@semihalf.com>

On Mon, Feb 2, 2009 at 5:50 AM, Grzegorz Bernacki <gjb@semihalf.com> wrote:
> Grant Likely wrote:
>>> diff --git a/arch/powerpc/configs/52xx/digsy_mtc_defconfig b/arch/powerpc/configs/52xx/digsy_mtc_defconfig
>>> new file mode 100644
>>> index 0000000..ad70d5b
>>> --- /dev/null
>>> +++ b/arch/powerpc/configs/52xx/digsy_mtc_defconfig
>
> I would like to have support for following devices in defconfig for digsy:
> - LXT PHY
> - RTC DS1337
> - EEPROM AT24
> - MTD partitioning based on OF description
>
> If you dont mind I can add them to generic mpc5200 defconfig, otherwise
> I think that separate defconfig is needed.

No problem, go ahead.

>> Do you *really* need your own defconfig for the digsy_mtc.  I've
>> grudgingly accepted them for other boards under the argument that the
>> defconfig reflects a specific application of the board.  However, I'd
>> much rather see the digsy added to the multiplatform
>> mpc5200_defconfig, especially considering that the MTC looks like it's
>> supposed to be a general purpose platform.
>
>> There is a lot of direct copy/paste from the lite5200.c board file,
>> but the big scary warning comment about not duplicating this code was
>> deleted in the copy (so I know you saw it).  Is Semihalf responsible
>> for the U-Boot port to the digsy-mtc?  If so then please fix the
>> port_config and clock settings in u-boot.
>>
>
> I will update port config and clock settings in u-boot and use mpc5200_simple
> instead of creating a new file for digsy.
>
> BTW,
> I noticed that there are some problems with mounting file system
> over NFS on Linux-2.6.29-rc3, I see following messages:
> ...
> [  339.813807] nfs: server 192.168.1.1 not responding, still trying
> [  339.832144] nfs: server 192.168.1.1 OK
> ...
>
> I haven't noticed in on Linux-2.6.29-rc2. Is there any known problem?

Hmm, I've not seen that problem, but I'll look out for it.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* RE: [PATCH] add gpio to mpc837X rdb
From: Reynes Philippe @ 2009-02-02 14:52 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev list, Kumar Gala
In-Reply-To: <877i49gh1g.fsf@macbook.be.48ers.dk>

Signed-off-by: Philippe Reynes <philippe.reynes@isismpp.fr>
---
Index: powerpc/arch/powerpc/boot/dts/mpc8377_rdb.dts
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- powerpc.orig/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ powerpc/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -109,6 +109,24 @@
 			reg =3D <0x200 0x100>;
 		};
=20
+		gpio1: gpio-controller@c00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8377-gpio", "fsl,mpc8349-gpio";
+			reg =3D <0xc00 0x100>;
+			interrupts =3D <74 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
+		gpio2: gpio-controller@d00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8377-gpio", "fsl,mpc8349-gpio";
+			reg =3D <0xd00 0x100>;
+			interrupts =3D <75 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
 		i2c@3000 {
 			#address-cells =3D <1>;
 			#size-cells =3D <0>;
Index: powerpc/arch/powerpc/boot/dts/mpc8378_rdb.dts
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- powerpc.orig/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ powerpc/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -109,6 +109,24 @@
 			reg =3D <0x200 0x100>;
 		};
=20
+		gpio1: gpio-controller@c00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8378-gpio", "fsl,mpc8349-gpio";
+			reg =3D <0xc00 0x100>;
+			interrupts =3D <74 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
+		gpio2: gpio-controller@d00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8378-gpio", "fsl,mpc8349-gpio";
+			reg =3D <0xd00 0x100>;
+			interrupts =3D <75 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
 		i2c@3000 {
 			#address-cells =3D <1>;
 			#size-cells =3D <0>;
Index: powerpc/arch/powerpc/boot/dts/mpc8379_rdb.dts
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- powerpc.orig/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ powerpc/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -107,6 +107,24 @@
 			reg =3D <0x200 0x100>;
 		};
=20
+		gpio1: gpio-controller@c00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8379-gpio", "fsl,mpc8349-gpio";
+			reg =3D <0xc00 0x100>;
+			interrupts =3D <74 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
+		gpio2: gpio-controller@d00 {
+			#gpio-cells =3D <2>;
+			compatible =3D "fsl,mpc8379-gpio", "fsl,mpc8349-gpio";
+			reg =3D <0xd00 0x100>;
+			interrupts =3D <75 0x8>;
+			interrupt-parent =3D <&ipic>;
+			gpio-controller;
+		};
+
 		i2c@3000 {
 			#address-cells =3D <1>;
 			#size-cells =3D <0>;

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox