aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/qe.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/qe.h')
-rw-r--r--arch/powerpc/include/asm/qe.h43
1 files changed, 40 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index f388f0ab193f..0947b36e534c 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -87,7 +87,7 @@ extern spinlock_t cmxgcr_lock;
87 87
88/* Export QE common operations */ 88/* Export QE common operations */
89#ifdef CONFIG_QUICC_ENGINE 89#ifdef CONFIG_QUICC_ENGINE
90extern void __init qe_reset(void); 90extern void qe_reset(void);
91#else 91#else
92static inline void qe_reset(void) {} 92static inline void qe_reset(void) {}
93#endif 93#endif
@@ -145,8 +145,17 @@ static inline void qe_pin_set_gpio(struct qe_pin *qe_pin) {}
145static inline void qe_pin_set_dedicated(struct qe_pin *pin) {} 145static inline void qe_pin_set_dedicated(struct qe_pin *pin) {}
146#endif /* CONFIG_QE_GPIO */ 146#endif /* CONFIG_QE_GPIO */
147 147
148/* QE internal API */ 148#ifdef CONFIG_QUICC_ENGINE
149int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input); 149int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
150#else
151static inline int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol,
152 u32 cmd_input)
153{
154 return -ENOSYS;
155}
156#endif /* CONFIG_QUICC_ENGINE */
157
158/* QE internal API */
150enum qe_clock qe_clock_source(const char *source); 159enum qe_clock qe_clock_source(const char *source);
151unsigned int qe_get_brg_clk(void); 160unsigned int qe_get_brg_clk(void);
152int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); 161int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
@@ -154,7 +163,28 @@ int qe_get_snum(void);
154void qe_put_snum(u8 snum); 163void qe_put_snum(u8 snum);
155unsigned int qe_get_num_of_risc(void); 164unsigned int qe_get_num_of_risc(void);
156unsigned int qe_get_num_of_snums(void); 165unsigned int qe_get_num_of_snums(void);
157int qe_alive_during_sleep(void); 166
167static inline int qe_alive_during_sleep(void)
168{
169 /*
170 * MPC8568E reference manual says:
171 *
172 * "...power down sequence waits for all I/O interfaces to become idle.
173 * In some applications this may happen eventually without actively
174 * shutting down interfaces, but most likely, software will have to
175 * take steps to shut down the eTSEC, QUICC Engine Block, and PCI
176 * interfaces before issuing the command (either the write to the core
177 * MSR[WE] as described above or writing to POWMGTCSR) to put the
178 * device into sleep state."
179 *
180 * MPC8569E reference manual has a similar paragraph.
181 */
182#ifdef CONFIG_PPC_85xx
183 return 0;
184#else
185 return 1;
186#endif
187}
158 188
159/* we actually use cpm_muram implementation, define this for convenience */ 189/* we actually use cpm_muram implementation, define this for convenience */
160#define qe_muram_init cpm_muram_init 190#define qe_muram_init cpm_muram_init
@@ -210,8 +240,15 @@ struct qe_firmware_info {
210 u64 extended_modes; /* Extended modes */ 240 u64 extended_modes; /* Extended modes */
211}; 241};
212 242
243#ifdef CONFIG_QUICC_ENGINE
213/* Upload a firmware to the QE */ 244/* Upload a firmware to the QE */
214int qe_upload_firmware(const struct qe_firmware *firmware); 245int qe_upload_firmware(const struct qe_firmware *firmware);
246#else
247static inline int qe_upload_firmware(const struct qe_firmware *firmware)
248{
249 return -ENOSYS;
250}
251#endif /* CONFIG_QUICC_ENGINE */
215 252
216/* Obtain information on the uploaded firmware */ 253/* Obtain information on the uploaded firmware */
217struct qe_firmware_info *qe_get_firmware_info(void); 254struct qe_firmware_info *qe_get_firmware_info(void);