blob: 7194c63dcf5f0d436f834394829d8e62268ba682 [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
Kumar Gala0d844062008-06-12 07:53:48 -05005 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070015static inline void cpm_set_brg(int brg, int baud)
16{
17 cpm_setbrg(brg, baud);
18}
19
Scott Woodc1dcfd92007-07-24 15:53:07 -050020static inline void cpm_set_scc_fcr(scc_uart_t __iomem *sup)
Linus Torvalds1da177e2005-04-16 15:20:36 -070021{
Scott Woodc1dcfd92007-07-24 15:53:07 -050022 out_8(&sup->scc_genscc.scc_rfcr, CPMFCR_GBL | CPMFCR_EB);
23 out_8(&sup->scc_genscc.scc_tfcr, CPMFCR_GBL | CPMFCR_EB);
Linus Torvalds1da177e2005-04-16 15:20:36 -070024}
25
Scott Woodc1dcfd92007-07-24 15:53:07 -050026static inline void cpm_set_smc_fcr(smc_uart_t __iomem *up)
Linus Torvalds1da177e2005-04-16 15:20:36 -070027{
Scott Woodc1dcfd92007-07-24 15:53:07 -050028 out_8(&up->smc_rfcr, CPMFCR_GBL | CPMFCR_EB);
29 out_8(&up->smc_tfcr, CPMFCR_GBL | CPMFCR_EB);
Linus Torvalds1da177e2005-04-16 15:20:36 -070030}
31
Scott Woodc1dcfd92007-07-24 15:53:07 -050032#define DPRAM_BASE ((u8 __iomem __force *)cpm_dpram_addr(0))
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
34#endif