blob: 40006a7dce4693b0353d2ed2f9409dcac6b1e138 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Uwe Zeisbergerf30c2262006-10-03 23:01:26 +02002 * linux/drivers/serial/cpm_uart/cpm_uart_cpm2.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Driver for CPM (SCC/SMC) serial ports
5 *
6 * definitions for cpm2
7 *
8 */
9
10#ifndef CPM_UART_CPM2_H
11#define CPM_UART_CPM2_H
12
13#include <asm/cpm2.h>
14
15/* defines for IRQs */
Scott Wood7ae87032007-07-17 17:59:06 -050016#ifndef CONFIG_PPC_CPM_NEW_BINDING
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#define SMC1_IRQ SIU_INT_SMC1
18#define SMC2_IRQ SIU_INT_SMC2
19#define SCC1_IRQ SIU_INT_SCC1
20#define SCC2_IRQ SIU_INT_SCC2
21#define SCC3_IRQ SIU_INT_SCC3
22#define SCC4_IRQ SIU_INT_SCC4
Scott Wood7ae87032007-07-17 17:59:06 -050023#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
Linus Torvalds1da177e2005-04-16 15:20:36 -070025static inline void cpm_set_brg(int brg, int baud)
26{
27 cpm_setbrg(brg, baud);
28}
29
Scott Woodc1dcfd92007-07-24 15:53:07 -050030static inline void cpm_set_scc_fcr(scc_uart_t __iomem *sup)
Linus Torvalds1da177e2005-04-16 15:20:36 -070031{
Scott Woodc1dcfd92007-07-24 15:53:07 -050032 out_8(&sup->scc_genscc.scc_rfcr, CPMFCR_GBL | CPMFCR_EB);
33 out_8(&sup->scc_genscc.scc_tfcr, CPMFCR_GBL | CPMFCR_EB);
Linus Torvalds1da177e2005-04-16 15:20:36 -070034}
35
Scott Woodc1dcfd92007-07-24 15:53:07 -050036static inline void cpm_set_smc_fcr(smc_uart_t __iomem *up)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037{
Scott Woodc1dcfd92007-07-24 15:53:07 -050038 out_8(&up->smc_rfcr, CPMFCR_GBL | CPMFCR_EB);
39 out_8(&up->smc_tfcr, CPMFCR_GBL | CPMFCR_EB);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040}
41
Scott Woodc1dcfd92007-07-24 15:53:07 -050042#define DPRAM_BASE ((u8 __iomem __force *)cpm_dpram_addr(0))
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
44#endif