Subject: Re: little endian page mapping on PQ3

From: David Hawkins <[email-masked]>
Date: Fri, 24 Aug 2007 08:49:46 -0700

Hi Jose,

> I want to do using an mmap() entry point in a driver, in order to map 
> this to the user. Of course in that case ioremap() does not work.
> 
> Any Clue ?
> 

I used the little-endian flag on the Yosemite board (440EP)
to test what the flag did.

http://www.ovro.caltech.edu/~dwh/correlator/pdf/LNX-762-Hawkins.pdf
http://www.ovro.caltech.edu/~dwh/correlator/software/driver_design.tar.gz

Look at the mmap function in pci_io.c.

	/* PowerPC endian control
	 * - default is cleared, big-endian
	 */
#ifdef _PAGE_ENDIAN
	if (bar->little_endian) {
		pgprot_val(vma->vm_page_prot) |= _PAGE_ENDIAN;
	} else {
		pgprot_val(vma->vm_page_prot) &= ~_PAGE_ENDIAN;
	}
	if (pgprot_val(vma->vm_page_prot) & _PAGE_ENDIAN) {
		LOG_DEBUG("_PAGE_ENDIAN is set\n");
	} else {
		LOG_DEBUG("_PAGE_ENDIAN is not set\n");
	}
#endif

It might be the same for the PQ3 ... at least it'll be
pretty similar.

Dave