Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232040
b: refs/heads/master
c: b49d81d
h: refs/heads/master
v: v3
  • Loading branch information
Timur Tabi authored and Kumar Gala committed Jan 13, 2011
1 parent 2a03370 commit a5d02e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2e0861e51f2961954330dcafe6d148ee3ab5cff
refs/heads/master: b49d81ded47e9d01f7128fce50d224ccc2150960
21 changes: 15 additions & 6 deletions trunk/arch/powerpc/include/asm/immap_qe.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,22 @@ struct qe_immap {
extern struct qe_immap __iomem *qe_immr;
extern phys_addr_t get_qe_base(void);

static inline unsigned long immrbar_virt_to_phys(void *address)
/*
* Returns the offset within the QE address space of the given pointer.
*
* Note that the QE does not support 36-bit physical addresses, so if
* get_qe_base() returns a number above 4GB, the caller will probably fail.
*/
static inline phys_addr_t immrbar_virt_to_phys(void *address)
{
if ( ((u32)address >= (u32)qe_immr) &&
((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) )
return (unsigned long)(address - (u32)qe_immr +
(u32)get_qe_base());
return (unsigned long)virt_to_phys(address);
void *q = (void *)qe_immr;

/* Is it a MURAM address? */
if ((address >= q) && (address < (q + QE_IMMAP_SIZE)))
return get_qe_base() + (address - q);

/* It's an address returned by kmalloc */
return virt_to_phys(address);
}

#endif /* __KERNEL__ */
Expand Down

0 comments on commit a5d02e6

Please sign in to comment.