Hi Chris,
I tried to track this down and end up by "rewinding" ioremap. Now it
works again. Below is a simple (little brain damaged) kernel patch. Maybe
someone with a better knowledge of the arm kernel memory managment can
supply a better patch.
Ciao,
Peter
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
old mode 100644
new mode 100755
index 4654405..be64237
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -316,6 +316,7 @@ __ioremap_pfn(unsigned long pfn, unsigne
addr = (unsigned long)area->addr;
#ifndef CONFIG_SMP
+#ifndef CONFIG_ARCH_DAVINCI
if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
cpu_is_xsc3()) &&
!((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
@@ -325,6 +326,7 @@ __ioremap_pfn(unsigned long pfn, unsigne
area->flags |= VM_ARM_SECTION_MAPPING;
err = remap_area_sections(addr, pfn, size, flags);
} else
+#endif
#endif
err = remap_area_pages(addr, pfn, size, flags);
On Wed, 6 Dec 2006, Ring, Chris wrote:
> Haven't tried it, but for those interested, the cmem function for
> virt->phys translation is below. Anybody familiar with Linux know if
> anything's changed in recent kernels that would cause this technique to
> fail? Or want to offer up a better way to do this translation?
>
> Can anyone confirm this [mis-]behavior?
>
> Thanks in advance!
>
> ========================================
> /* Traverses the page tables and translates a virtual adress to a
> physical. */
> static unsigned long get_phys(unsigned long virtp)
> {
> pgd_t *pgd;
> pmd_t *pmd;
> pte_t *pte;
> struct mm_struct *mm = current->mm;
>
> pgd = pgd_offset(mm, virtp);
> if (!(pgd_none(*pgd) || pgd_bad(*pgd))) {
> pmd = pmd_offset(pgd, virtp);
>
> if (!(pmd_none(*pmd) || pmd_bad(*pmd))) {
> pte = pte_offset_kernel(pmd, virtp);
>
> if (pte_present(*pte)) {
> return __pa(page_address(pte_page(*pte)) +
> (virtp & ~PAGE_MASK));
> }
> }
> }
>
> return 0;
> }
> ========================================
>
> Chris
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > ] On Behalf Of Peter Wippich
> > Sent: Wednesday, December 06, 2006 12:08 PM
> > To: [email protected]
> > Subject: CMEMK and 2.6.19 Kernel
> >
> >
> > Dear,
> >
> > I'm trying to use a (rebuild) cmemk with the GIT kernel. I
> > can compile and
> > load the module. However, when I try to start the decode demo
> > I get an
> > error message from cmemk that it can not map physical memory.
> > It looks
> > like the problem is with the virt->phyc mapping in cmemk.
> > When I check
> > the proc entry for cmem I get all buffer pools with physical address 0
> > (right after the module load):
> >
> > Pool 0 has 1 buffers of size 3145728 (3145728 requested)
> > Pool 0 busy buffers:
> > Pool 0 free buffers:
> > Buffer id 0 at physical address 0x0
> >
> > Pool 1 has 3 buffers of size 831488 (829440 requested)
> > Pool 1 busy buffers:
> > Pool 1 free buffers:
> > Buffer id 0 at physical address 0x0
> > Buffer id 1 at physical address 0x0
> > Buffer id 2 at physical address 0x0
> >
> > Pool 2 has 1 buffers of size 61440 (61440 requested)
> > Pool 2 busy buffers:
> > Pool 2 free buffers:
> > Buffer id 0 at physical address 0x0
> >
> > Pool 3 has 1 buffers of size 12288 (10240 requested)
> > Pool 3 busy buffers:
> > Pool 3 free buffers:
> > Buffer id 0 at physical address 0x0
> >
> > Any hints ??
> >
> > Thank you and best regards,
> >
> > Peter
> >
> >
> > | Peter Wippich Voice: +49 30
> > 46776411 |
> > | G&W Instruments GmbH fax: +49 30
> > 46776419 |
> > | Gustav-Meyer-Allee 25, Geb. 12 Email:
> > [EMAIL PROTECTED] |
> > | D-13355 Berlin / Germany
> > |
> >
> > _______________________________________________
> > Davinci-linux-open-source mailing list
> > [email protected]
> > http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
> >
>
| Peter Wippich Voice: +49 30 46776411 |
| G&W Instruments GmbH fax: +49 30 46776419 |
| Gustav-Meyer-Allee 25, Geb. 12 Email: [EMAIL PROTECTED] |
| D-13355 Berlin / Germany |
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source