Alexander Shiyan | 1d65c0b | 2012-08-25 19:24:19 +0400 | [diff] [blame] | 1 | /* |
| 2 | * NXP (Philips) SCC+++(SCN+++) serial driver |
| 3 | * |
| 4 | * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> |
| 5 | * |
| 6 | * Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de) |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | */ |
| 13 | |
Alexander Shiyan | 463dcc4 | 2012-12-03 22:23:32 +0400 | [diff] [blame] | 14 | #ifndef _PLATFORM_DATA_SERIAL_SCCNXP_H_ |
| 15 | #define _PLATFORM_DATA_SERIAL_SCCNXP_H_ |
Alexander Shiyan | 1d65c0b | 2012-08-25 19:24:19 +0400 | [diff] [blame] | 16 | |
| 17 | #define SCCNXP_MAX_UARTS 2 |
| 18 | |
| 19 | /* Output lines */ |
| 20 | #define LINE_OP0 1 |
| 21 | #define LINE_OP1 2 |
| 22 | #define LINE_OP2 3 |
| 23 | #define LINE_OP3 4 |
| 24 | #define LINE_OP4 5 |
| 25 | #define LINE_OP5 6 |
| 26 | #define LINE_OP6 7 |
| 27 | #define LINE_OP7 8 |
| 28 | |
| 29 | /* Input lines */ |
| 30 | #define LINE_IP0 9 |
| 31 | #define LINE_IP1 10 |
| 32 | #define LINE_IP2 11 |
| 33 | #define LINE_IP3 12 |
| 34 | #define LINE_IP4 13 |
| 35 | #define LINE_IP5 14 |
| 36 | #define LINE_IP6 15 |
| 37 | |
| 38 | /* Signals */ |
| 39 | #define DTR_OP 0 /* DTR */ |
| 40 | #define RTS_OP 4 /* RTS */ |
| 41 | #define DSR_IP 8 /* DSR */ |
| 42 | #define CTS_IP 12 /* CTS */ |
| 43 | #define DCD_IP 16 /* DCD */ |
| 44 | #define RNG_IP 20 /* RNG */ |
| 45 | |
| 46 | #define DIR_OP 24 /* Special signal for control RS-485. |
| 47 | * Goes high when transmit, |
| 48 | * then goes low. |
| 49 | */ |
| 50 | |
| 51 | /* Routing control signal 'sig' to line 'line' */ |
| 52 | #define MCTRL_SIG(sig, line) ((line) << (sig)) |
| 53 | |
| 54 | /* |
| 55 | * Example board initialization data: |
| 56 | * |
| 57 | * static struct resource sc2892_resources[] = { |
| 58 | * DEFINE_RES_MEM(UART_PHYS_START, 0x10), |
| 59 | * DEFINE_RES_IRQ(IRQ_EXT2), |
| 60 | * }; |
| 61 | * |
| 62 | * static struct sccnxp_pdata sc2892_info = { |
Alexander Shiyan | 1d65c0b | 2012-08-25 19:24:19 +0400 | [diff] [blame] | 63 | * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0), |
| 64 | * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1), |
| 65 | * }; |
| 66 | * |
| 67 | * static struct platform_device sc2892 = { |
| 68 | * .name = "sc2892", |
| 69 | * .id = -1, |
| 70 | * .resource = sc2892_resources, |
| 71 | * .num_resources = ARRAY_SIZE(sc2892_resources), |
| 72 | * .dev = { |
| 73 | * .platform_data = &sc2892_info, |
| 74 | * }, |
| 75 | * }; |
| 76 | */ |
| 77 | |
| 78 | /* SCCNXP platform data structure */ |
| 79 | struct sccnxp_pdata { |
Alexander Shiyan | 1d65c0b | 2012-08-25 19:24:19 +0400 | [diff] [blame] | 80 | /* Shift for A0 line */ |
Greg Kroah-Hartman | 461a8ec | 2013-08-02 15:25:19 +0800 | [diff] [blame^] | 81 | const u8 reg_shift; |
Alexander Shiyan | 1d65c0b | 2012-08-25 19:24:19 +0400 | [diff] [blame] | 82 | /* Modem control lines configuration */ |
Greg Kroah-Hartman | 461a8ec | 2013-08-02 15:25:19 +0800 | [diff] [blame^] | 83 | const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; |
Alexander Shiyan | ec06389 | 2012-12-03 22:23:31 +0400 | [diff] [blame] | 84 | /* Timer value for polling mode (usecs) */ |
Greg Kroah-Hartman | 461a8ec | 2013-08-02 15:25:19 +0800 | [diff] [blame^] | 85 | const unsigned int poll_time_us; |
Alexander Shiyan | 1d65c0b | 2012-08-25 19:24:19 +0400 | [diff] [blame] | 86 | }; |
| 87 | |
| 88 | #endif |