diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-03-11 13:24:13 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-04-17 02:01:39 -0400 |
commit | 0b51b02edff2417deff98d8bbf294fa56b765bc6 (patch) | |
tree | 709358fd88085a368795b8d7be068073b5b16180 | |
parent | acaa7aa30a8cdf7276945629f56d6daf30beb157 (diff) |
[POWERPC] QE: implement qe_muram_offset
qe_muram_offset is the reverse of the qe_muram_addr, will be
used for the Freescale QE USB Host Controller driver.
This patch also moves qe_muram_addr into the qe.h header, plus
adds __iomem hints to use with sparse.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe.c | 8 | ||||
-rw-r--r-- | include/asm-powerpc/immap_qe.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/qe.h | 11 |
3 files changed, 12 insertions, 9 deletions
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index cc81fd1141b0..addabcd443a6 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c | |||
@@ -55,7 +55,7 @@ struct qe_snum { | |||
55 | /* We allocate this here because it is used almost exclusively for | 55 | /* We allocate this here because it is used almost exclusively for |
56 | * the communication processor devices. | 56 | * the communication processor devices. |
57 | */ | 57 | */ |
58 | struct qe_immap *qe_immr = NULL; | 58 | struct qe_immap __iomem *qe_immr; |
59 | EXPORT_SYMBOL(qe_immr); | 59 | EXPORT_SYMBOL(qe_immr); |
60 | 60 | ||
61 | static struct qe_snum snums[QE_NUM_OF_SNUM]; /* Dynamically allocated SNUMs */ | 61 | static struct qe_snum snums[QE_NUM_OF_SNUM]; /* Dynamically allocated SNUMs */ |
@@ -415,12 +415,6 @@ void qe_muram_dump(void) | |||
415 | } | 415 | } |
416 | EXPORT_SYMBOL(qe_muram_dump); | 416 | EXPORT_SYMBOL(qe_muram_dump); |
417 | 417 | ||
418 | void *qe_muram_addr(unsigned long offset) | ||
419 | { | ||
420 | return (void *)&qe_immr->muram[offset]; | ||
421 | } | ||
422 | EXPORT_SYMBOL(qe_muram_addr); | ||
423 | |||
424 | /* The maximum number of RISCs we support */ | 418 | /* The maximum number of RISCs we support */ |
425 | #define MAX_QE_RISC 2 | 419 | #define MAX_QE_RISC 2 |
426 | 420 | ||
diff --git a/include/asm-powerpc/immap_qe.h b/include/asm-powerpc/immap_qe.h index 82a452615097..924aefbd6a8e 100644 --- a/include/asm-powerpc/immap_qe.h +++ b/include/asm-powerpc/immap_qe.h | |||
@@ -468,7 +468,7 @@ struct qe_immap { | |||
468 | u8 res18[0xC0000]; /* 0x140000 - 0x200000 */ | 468 | u8 res18[0xC0000]; /* 0x140000 - 0x200000 */ |
469 | } __attribute__ ((packed)); | 469 | } __attribute__ ((packed)); |
470 | 470 | ||
471 | extern struct qe_immap *qe_immr; | 471 | extern struct qe_immap __iomem *qe_immr; |
472 | extern phys_addr_t get_qe_base(void); | 472 | extern phys_addr_t get_qe_base(void); |
473 | 473 | ||
474 | static inline unsigned long immrbar_virt_to_phys(void *address) | 474 | static inline unsigned long immrbar_virt_to_phys(void *address) |
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h index 430dc77b35fc..398534c15cc7 100644 --- a/include/asm-powerpc/qe.h +++ b/include/asm-powerpc/qe.h | |||
@@ -92,7 +92,16 @@ unsigned long qe_muram_alloc(int size, int align); | |||
92 | int qe_muram_free(unsigned long offset); | 92 | int qe_muram_free(unsigned long offset); |
93 | unsigned long qe_muram_alloc_fixed(unsigned long offset, int size); | 93 | unsigned long qe_muram_alloc_fixed(unsigned long offset, int size); |
94 | void qe_muram_dump(void); | 94 | void qe_muram_dump(void); |
95 | void *qe_muram_addr(unsigned long offset); | 95 | |
96 | static inline void __iomem *qe_muram_addr(unsigned long offset) | ||
97 | { | ||
98 | return (void __iomem *)&qe_immr->muram[offset]; | ||
99 | } | ||
100 | |||
101 | static inline unsigned long qe_muram_offset(void __iomem *addr) | ||
102 | { | ||
103 | return addr - (void __iomem *)qe_immr->muram; | ||
104 | } | ||
96 | 105 | ||
97 | /* Structure that defines QE firmware binary files. | 106 | /* Structure that defines QE firmware binary files. |
98 | * | 107 | * |