Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  NXP (Philips) SCC+++(SCN+++) serial driver
0004  *
0005  *  Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
0006  *
0007  *  Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de)
0008  */
0009 
0010 #ifndef _PLATFORM_DATA_SERIAL_SCCNXP_H_
0011 #define _PLATFORM_DATA_SERIAL_SCCNXP_H_
0012 
0013 #define SCCNXP_MAX_UARTS    2
0014 
0015 /* Output lines */
0016 #define LINE_OP0        1
0017 #define LINE_OP1        2
0018 #define LINE_OP2        3
0019 #define LINE_OP3        4
0020 #define LINE_OP4        5
0021 #define LINE_OP5        6
0022 #define LINE_OP6        7
0023 #define LINE_OP7        8
0024 
0025 /* Input lines */
0026 #define LINE_IP0        9
0027 #define LINE_IP1        10
0028 #define LINE_IP2        11
0029 #define LINE_IP3        12
0030 #define LINE_IP4        13
0031 #define LINE_IP5        14
0032 #define LINE_IP6        15
0033 
0034 /* Signals */
0035 #define DTR_OP          0   /* DTR */
0036 #define RTS_OP          4   /* RTS */
0037 #define DSR_IP          8   /* DSR */
0038 #define CTS_IP          12  /* CTS */
0039 #define DCD_IP          16  /* DCD */
0040 #define RNG_IP          20  /* RNG */
0041 
0042 #define DIR_OP          24  /* Special signal for control RS-485.
0043                      * Goes high when transmit,
0044                      * then goes low.
0045                      */
0046 
0047 /* Routing control signal 'sig' to line 'line' */
0048 #define MCTRL_SIG(sig, line)    ((line) << (sig))
0049 
0050 /*
0051  * Example board initialization data:
0052  *
0053  * static struct resource sc2892_resources[] = {
0054  *  DEFINE_RES_MEM(UART_PHYS_START, 0x10),
0055  *  DEFINE_RES_IRQ(IRQ_EXT2),
0056  * };
0057  *
0058  * static struct sccnxp_pdata sc2892_info = {
0059  *  .mctrl_cfg[0]   = MCTRL_SIG(DIR_OP, LINE_OP0),
0060  *  .mctrl_cfg[1]   = MCTRL_SIG(DIR_OP, LINE_OP1),
0061  * };
0062  *
0063  * static struct platform_device sc2892 = {
0064  *  .name       = "sc2892",
0065  *  .id     = -1,
0066  *  .resource   = sc2892_resources,
0067  *  .num_resources  = ARRAY_SIZE(sc2892_resources),
0068  *  .dev = {
0069  *      .platform_data  = &sc2892_info,
0070  *  },
0071  * };
0072  */
0073 
0074 /* SCCNXP platform data structure */
0075 struct sccnxp_pdata {
0076     /* Shift for A0 line */
0077     const u8        reg_shift;
0078     /* Modem control lines configuration */
0079     const u32       mctrl_cfg[SCCNXP_MAX_UARTS];
0080     /* Timer value for polling mode (usecs) */
0081     const unsigned int  poll_time_us;
0082 };
0083 
0084 #endif