Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'common/serial-rework' into sh-latest

+374 -188
+14
arch/arm/mach-shmobile/setup-sh7367.c
··· 35 35 static struct plat_sci_port scif0_platform_data = { 36 36 .mapbase = 0xe6c40000, 37 37 .flags = UPF_BOOT_AUTOCONF, 38 + .scscr = SCSCR_RE | SCSCR_TE, 39 + .scbrr_algo_id = SCBRR_ALGO_4, 38 40 .type = PORT_SCIF, 39 41 .irqs = { evt2irq(0xc00), evt2irq(0xc00), 40 42 evt2irq(0xc00), evt2irq(0xc00) }, ··· 54 52 static struct plat_sci_port scif1_platform_data = { 55 53 .mapbase = 0xe6c50000, 56 54 .flags = UPF_BOOT_AUTOCONF, 55 + .scscr = SCSCR_RE | SCSCR_TE, 56 + .scbrr_algo_id = SCBRR_ALGO_4, 57 57 .type = PORT_SCIF, 58 58 .irqs = { evt2irq(0xc20), evt2irq(0xc20), 59 59 evt2irq(0xc20), evt2irq(0xc20) }, ··· 73 69 static struct plat_sci_port scif2_platform_data = { 74 70 .mapbase = 0xe6c60000, 75 71 .flags = UPF_BOOT_AUTOCONF, 72 + .scscr = SCSCR_RE | SCSCR_TE, 73 + .scbrr_algo_id = SCBRR_ALGO_4, 76 74 .type = PORT_SCIF, 77 75 .irqs = { evt2irq(0xc40), evt2irq(0xc40), 78 76 evt2irq(0xc40), evt2irq(0xc40) }, ··· 92 86 static struct plat_sci_port scif3_platform_data = { 93 87 .mapbase = 0xe6c70000, 94 88 .flags = UPF_BOOT_AUTOCONF, 89 + .scscr = SCSCR_RE | SCSCR_TE, 90 + .scbrr_algo_id = SCBRR_ALGO_4, 95 91 .type = PORT_SCIF, 96 92 .irqs = { evt2irq(0xc60), evt2irq(0xc60), 97 93 evt2irq(0xc60), evt2irq(0xc60) }, ··· 111 103 static struct plat_sci_port scif4_platform_data = { 112 104 .mapbase = 0xe6c80000, 113 105 .flags = UPF_BOOT_AUTOCONF, 106 + .scscr = SCSCR_RE | SCSCR_TE, 107 + .scbrr_algo_id = SCBRR_ALGO_4, 114 108 .type = PORT_SCIF, 115 109 .irqs = { evt2irq(0xd20), evt2irq(0xd20), 116 110 evt2irq(0xd20), evt2irq(0xd20) }, ··· 130 120 static struct plat_sci_port scif5_platform_data = { 131 121 .mapbase = 0xe6cb0000, 132 122 .flags = UPF_BOOT_AUTOCONF, 123 + .scscr = SCSCR_RE | SCSCR_TE, 124 + .scbrr_algo_id = SCBRR_ALGO_4, 133 125 .type = PORT_SCIF, 134 126 .irqs = { evt2irq(0xd40), evt2irq(0xd40), 135 127 evt2irq(0xd40), evt2irq(0xd40) }, ··· 149 137 static struct plat_sci_port scif6_platform_data = { 150 138 .mapbase = 0xe6c30000, 151 139 .flags = UPF_BOOT_AUTOCONF, 140 + .scscr = SCSCR_RE | SCSCR_TE, 141 + .scbrr_algo_id = SCBRR_ALGO_4, 152 142 .type = PORT_SCIF, 153 143 .irqs = { evt2irq(0xd60), evt2irq(0xd60), 154 144 evt2irq(0xd60), evt2irq(0xd60) },
+14
arch/arm/mach-shmobile/setup-sh7372.c
··· 38 38 static struct plat_sci_port scif0_platform_data = { 39 39 .mapbase = 0xe6c40000, 40 40 .flags = UPF_BOOT_AUTOCONF, 41 + .scscr = SCSCR_RE | SCSCR_TE, 42 + .scbrr_algo_id = SCBRR_ALGO_4, 41 43 .type = PORT_SCIFA, 42 44 .irqs = { evt2irq(0x0c00), evt2irq(0x0c00), 43 45 evt2irq(0x0c00), evt2irq(0x0c00) }, ··· 57 55 static struct plat_sci_port scif1_platform_data = { 58 56 .mapbase = 0xe6c50000, 59 57 .flags = UPF_BOOT_AUTOCONF, 58 + .scscr = SCSCR_RE | SCSCR_TE, 59 + .scbrr_algo_id = SCBRR_ALGO_4, 60 60 .type = PORT_SCIFA, 61 61 .irqs = { evt2irq(0x0c20), evt2irq(0x0c20), 62 62 evt2irq(0x0c20), evt2irq(0x0c20) }, ··· 76 72 static struct plat_sci_port scif2_platform_data = { 77 73 .mapbase = 0xe6c60000, 78 74 .flags = UPF_BOOT_AUTOCONF, 75 + .scscr = SCSCR_RE | SCSCR_TE, 76 + .scbrr_algo_id = SCBRR_ALGO_4, 79 77 .type = PORT_SCIFA, 80 78 .irqs = { evt2irq(0x0c40), evt2irq(0x0c40), 81 79 evt2irq(0x0c40), evt2irq(0x0c40) }, ··· 95 89 static struct plat_sci_port scif3_platform_data = { 96 90 .mapbase = 0xe6c70000, 97 91 .flags = UPF_BOOT_AUTOCONF, 92 + .scscr = SCSCR_RE | SCSCR_TE, 93 + .scbrr_algo_id = SCBRR_ALGO_4, 98 94 .type = PORT_SCIFA, 99 95 .irqs = { evt2irq(0x0c60), evt2irq(0x0c60), 100 96 evt2irq(0x0c60), evt2irq(0x0c60) }, ··· 114 106 static struct plat_sci_port scif4_platform_data = { 115 107 .mapbase = 0xe6c80000, 116 108 .flags = UPF_BOOT_AUTOCONF, 109 + .scscr = SCSCR_RE | SCSCR_TE, 110 + .scbrr_algo_id = SCBRR_ALGO_4, 117 111 .type = PORT_SCIFA, 118 112 .irqs = { evt2irq(0x0d20), evt2irq(0x0d20), 119 113 evt2irq(0x0d20), evt2irq(0x0d20) }, ··· 133 123 static struct plat_sci_port scif5_platform_data = { 134 124 .mapbase = 0xe6cb0000, 135 125 .flags = UPF_BOOT_AUTOCONF, 126 + .scscr = SCSCR_RE | SCSCR_TE, 127 + .scbrr_algo_id = SCBRR_ALGO_4, 136 128 .type = PORT_SCIFA, 137 129 .irqs = { evt2irq(0x0d40), evt2irq(0x0d40), 138 130 evt2irq(0x0d40), evt2irq(0x0d40) }, ··· 152 140 static struct plat_sci_port scif6_platform_data = { 153 141 .mapbase = 0xe6c30000, 154 142 .flags = UPF_BOOT_AUTOCONF, 143 + .scscr = SCSCR_RE | SCSCR_TE, 144 + .scbrr_algo_id = SCBRR_ALGO_4, 155 145 .type = PORT_SCIFB, 156 146 .irqs = { evt2irq(0x0d60), evt2irq(0x0d60), 157 147 evt2irq(0x0d60), evt2irq(0x0d60) },
+16
arch/arm/mach-shmobile/setup-sh7377.c
··· 36 36 static struct plat_sci_port scif0_platform_data = { 37 37 .mapbase = 0xe6c40000, 38 38 .flags = UPF_BOOT_AUTOCONF, 39 + .scscr = SCSCR_RE | SCSCR_TE, 40 + .scbrr_algo_id = SCBRR_ALGO_4, 39 41 .type = PORT_SCIF, 40 42 .irqs = { evt2irq(0xc00), evt2irq(0xc00), 41 43 evt2irq(0xc00), evt2irq(0xc00) }, ··· 55 53 static struct plat_sci_port scif1_platform_data = { 56 54 .mapbase = 0xe6c50000, 57 55 .flags = UPF_BOOT_AUTOCONF, 56 + .scscr = SCSCR_RE | SCSCR_TE, 57 + .scbrr_algo_id = SCBRR_ALGO_4, 58 58 .type = PORT_SCIF, 59 59 .irqs = { evt2irq(0xc20), evt2irq(0xc20), 60 60 evt2irq(0xc20), evt2irq(0xc20) }, ··· 74 70 static struct plat_sci_port scif2_platform_data = { 75 71 .mapbase = 0xe6c60000, 76 72 .flags = UPF_BOOT_AUTOCONF, 73 + .scscr = SCSCR_RE | SCSCR_TE, 74 + .scbrr_algo_id = SCBRR_ALGO_4, 77 75 .type = PORT_SCIF, 78 76 .irqs = { evt2irq(0xc40), evt2irq(0xc40), 79 77 evt2irq(0xc40), evt2irq(0xc40) }, ··· 93 87 static struct plat_sci_port scif3_platform_data = { 94 88 .mapbase = 0xe6c70000, 95 89 .flags = UPF_BOOT_AUTOCONF, 90 + .scscr = SCSCR_RE | SCSCR_TE, 91 + .scbrr_algo_id = SCBRR_ALGO_4, 96 92 .type = PORT_SCIF, 97 93 .irqs = { evt2irq(0xc60), evt2irq(0xc60), 98 94 evt2irq(0xc60), evt2irq(0xc60) }, ··· 112 104 static struct plat_sci_port scif4_platform_data = { 113 105 .mapbase = 0xe6c80000, 114 106 .flags = UPF_BOOT_AUTOCONF, 107 + .scscr = SCSCR_RE | SCSCR_TE, 108 + .scbrr_algo_id = SCBRR_ALGO_4, 115 109 .type = PORT_SCIF, 116 110 .irqs = { evt2irq(0xd20), evt2irq(0xd20), 117 111 evt2irq(0xd20), evt2irq(0xd20) }, ··· 131 121 static struct plat_sci_port scif5_platform_data = { 132 122 .mapbase = 0xe6cb0000, 133 123 .flags = UPF_BOOT_AUTOCONF, 124 + .scscr = SCSCR_RE | SCSCR_TE, 125 + .scbrr_algo_id = SCBRR_ALGO_4, 134 126 .type = PORT_SCIF, 135 127 .irqs = { evt2irq(0xd40), evt2irq(0xd40), 136 128 evt2irq(0xd40), evt2irq(0xd40) }, ··· 150 138 static struct plat_sci_port scif6_platform_data = { 151 139 .mapbase = 0xe6cc0000, 152 140 .flags = UPF_BOOT_AUTOCONF, 141 + .scscr = SCSCR_RE | SCSCR_TE, 142 + .scbrr_algo_id = SCBRR_ALGO_4, 153 143 .type = PORT_SCIF, 154 144 .irqs = { intcs_evt2irq(0x1a80), intcs_evt2irq(0x1a80), 155 145 intcs_evt2irq(0x1a80), intcs_evt2irq(0x1a80) }, ··· 169 155 static struct plat_sci_port scif7_platform_data = { 170 156 .mapbase = 0xe6c30000, 171 157 .flags = UPF_BOOT_AUTOCONF, 158 + .scscr = SCSCR_RE | SCSCR_TE, 159 + .scbrr_algo_id = SCBRR_ALGO_4, 172 160 .type = PORT_SCIF, 173 161 .irqs = { evt2irq(0xd60), evt2irq(0xd60), 174 162 evt2irq(0xd60), evt2irq(0xd60) },
+18
arch/arm/mach-shmobile/setup-sh73a0.c
··· 36 36 static struct plat_sci_port scif0_platform_data = { 37 37 .mapbase = 0xe6c40000, 38 38 .flags = UPF_BOOT_AUTOCONF, 39 + .scscr = SCSCR_RE | SCSCR_TE, 40 + .scbrr_algo_id = SCBRR_ALGO_4, 39 41 .type = PORT_SCIFA, 40 42 .irqs = { gic_spi(72), gic_spi(72), 41 43 gic_spi(72), gic_spi(72) }, ··· 54 52 static struct plat_sci_port scif1_platform_data = { 55 53 .mapbase = 0xe6c50000, 56 54 .flags = UPF_BOOT_AUTOCONF, 55 + .scscr = SCSCR_RE | SCSCR_TE, 56 + .scbrr_algo_id = SCBRR_ALGO_4, 57 57 .type = PORT_SCIFA, 58 58 .irqs = { gic_spi(73), gic_spi(73), 59 59 gic_spi(73), gic_spi(73) }, ··· 72 68 static struct plat_sci_port scif2_platform_data = { 73 69 .mapbase = 0xe6c60000, 74 70 .flags = UPF_BOOT_AUTOCONF, 71 + .scscr = SCSCR_RE | SCSCR_TE, 72 + .scbrr_algo_id = SCBRR_ALGO_4, 75 73 .type = PORT_SCIFA, 76 74 .irqs = { gic_spi(74), gic_spi(74), 77 75 gic_spi(74), gic_spi(74) }, ··· 90 84 static struct plat_sci_port scif3_platform_data = { 91 85 .mapbase = 0xe6c70000, 92 86 .flags = UPF_BOOT_AUTOCONF, 87 + .scscr = SCSCR_RE | SCSCR_TE, 88 + .scbrr_algo_id = SCBRR_ALGO_4, 93 89 .type = PORT_SCIFA, 94 90 .irqs = { gic_spi(75), gic_spi(75), 95 91 gic_spi(75), gic_spi(75) }, ··· 108 100 static struct plat_sci_port scif4_platform_data = { 109 101 .mapbase = 0xe6c80000, 110 102 .flags = UPF_BOOT_AUTOCONF, 103 + .scscr = SCSCR_RE | SCSCR_TE, 104 + .scbrr_algo_id = SCBRR_ALGO_4, 111 105 .type = PORT_SCIFA, 112 106 .irqs = { gic_spi(78), gic_spi(78), 113 107 gic_spi(78), gic_spi(78) }, ··· 126 116 static struct plat_sci_port scif5_platform_data = { 127 117 .mapbase = 0xe6cb0000, 128 118 .flags = UPF_BOOT_AUTOCONF, 119 + .scscr = SCSCR_RE | SCSCR_TE, 120 + .scbrr_algo_id = SCBRR_ALGO_4, 129 121 .type = PORT_SCIFA, 130 122 .irqs = { gic_spi(79), gic_spi(79), 131 123 gic_spi(79), gic_spi(79) }, ··· 144 132 static struct plat_sci_port scif6_platform_data = { 145 133 .mapbase = 0xe6cc0000, 146 134 .flags = UPF_BOOT_AUTOCONF, 135 + .scscr = SCSCR_RE | SCSCR_TE, 136 + .scbrr_algo_id = SCBRR_ALGO_4, 147 137 .type = PORT_SCIFA, 148 138 .irqs = { gic_spi(156), gic_spi(156), 149 139 gic_spi(156), gic_spi(156) }, ··· 162 148 static struct plat_sci_port scif7_platform_data = { 163 149 .mapbase = 0xe6cd0000, 164 150 .flags = UPF_BOOT_AUTOCONF, 151 + .scscr = SCSCR_RE | SCSCR_TE, 152 + .scbrr_algo_id = SCBRR_ALGO_4, 165 153 .type = PORT_SCIFA, 166 154 .irqs = { gic_spi(143), gic_spi(143), 167 155 gic_spi(143), gic_spi(143) }, ··· 180 164 static struct plat_sci_port scif8_platform_data = { 181 165 .mapbase = 0xe6c30000, 182 166 .flags = UPF_BOOT_AUTOCONF, 167 + .scscr = SCSCR_RE | SCSCR_TE, 168 + .scbrr_algo_id = SCBRR_ALGO_4, 183 169 .type = PORT_SCIFB, 184 170 .irqs = { gic_spi(80), gic_spi(80), 185 171 gic_spi(80), gic_spi(80) },
+6
arch/sh/kernel/cpu/sh2/setup-sh7619.c
··· 62 62 static struct plat_sci_port scif0_platform_data = { 63 63 .mapbase = 0xf8400000, 64 64 .flags = UPF_BOOT_AUTOCONF, 65 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 66 + .scbrr_algo_id = SCBRR_ALGO_2, 65 67 .type = PORT_SCIF, 66 68 .irqs = { 88, 88, 88, 88 }, 67 69 }; ··· 79 77 static struct plat_sci_port scif1_platform_data = { 80 78 .mapbase = 0xf8410000, 81 79 .flags = UPF_BOOT_AUTOCONF, 80 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 81 + .scbrr_algo_id = SCBRR_ALGO_2, 82 82 .type = PORT_SCIF, 83 83 .irqs = { 92, 92, 92, 92 }, 84 84 }; ··· 96 92 static struct plat_sci_port scif2_platform_data = { 97 93 .mapbase = 0xf8420000, 98 94 .flags = UPF_BOOT_AUTOCONF, 95 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 96 + .scbrr_algo_id = SCBRR_ALGO_2, 99 97 .type = PORT_SCIF, 100 98 .irqs = { 96, 96, 96, 96 }, 101 99 };
+2
arch/sh/kernel/cpu/sh2a/setup-mxg.c
··· 201 201 static struct plat_sci_port scif0_platform_data = { 202 202 .mapbase = 0xff804000, 203 203 .flags = UPF_BOOT_AUTOCONF, 204 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 205 + .scbrr_algo_id = SCBRR_ALGO_2, 204 206 .type = PORT_SCIF, 205 207 .irqs = { 220, 220, 220, 220 }, 206 208 };
+16
arch/sh/kernel/cpu/sh2a/setup-sh7201.c
··· 180 180 static struct plat_sci_port scif0_platform_data = { 181 181 .mapbase = 0xfffe8000, 182 182 .flags = UPF_BOOT_AUTOCONF, 183 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 184 + .scbrr_algo_id = SCBRR_ALGO_2, 183 185 .type = PORT_SCIF, 184 186 .irqs = { 180, 180, 180, 180 } 185 187 }; ··· 197 195 static struct plat_sci_port scif1_platform_data = { 198 196 .mapbase = 0xfffe8800, 199 197 .flags = UPF_BOOT_AUTOCONF, 198 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 199 + .scbrr_algo_id = SCBRR_ALGO_2, 200 200 .type = PORT_SCIF, 201 201 .irqs = { 184, 184, 184, 184 } 202 202 }; ··· 214 210 static struct plat_sci_port scif2_platform_data = { 215 211 .mapbase = 0xfffe9000, 216 212 .flags = UPF_BOOT_AUTOCONF, 213 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 214 + .scbrr_algo_id = SCBRR_ALGO_2, 217 215 .type = PORT_SCIF, 218 216 .irqs = { 188, 188, 188, 188 } 219 217 }; ··· 231 225 static struct plat_sci_port scif3_platform_data = { 232 226 .mapbase = 0xfffe9800, 233 227 .flags = UPF_BOOT_AUTOCONF, 228 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 229 + .scbrr_algo_id = SCBRR_ALGO_2, 234 230 .type = PORT_SCIF, 235 231 .irqs = { 192, 192, 192, 192 } 236 232 }; ··· 248 240 static struct plat_sci_port scif4_platform_data = { 249 241 .mapbase = 0xfffea000, 250 242 .flags = UPF_BOOT_AUTOCONF, 243 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 244 + .scbrr_algo_id = SCBRR_ALGO_2, 251 245 .type = PORT_SCIF, 252 246 .irqs = { 196, 196, 196, 196 } 253 247 }; ··· 265 255 static struct plat_sci_port scif5_platform_data = { 266 256 .mapbase = 0xfffea800, 267 257 .flags = UPF_BOOT_AUTOCONF, 258 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 259 + .scbrr_algo_id = SCBRR_ALGO_2, 268 260 .type = PORT_SCIF, 269 261 .irqs = { 200, 200, 200, 200 } 270 262 }; ··· 282 270 static struct plat_sci_port scif6_platform_data = { 283 271 .mapbase = 0xfffeb000, 284 272 .flags = UPF_BOOT_AUTOCONF, 273 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 274 + .scbrr_algo_id = SCBRR_ALGO_2, 285 275 .type = PORT_SCIF, 286 276 .irqs = { 204, 204, 204, 204 } 287 277 }; ··· 299 285 static struct plat_sci_port scif7_platform_data = { 300 286 .mapbase = 0xfffeb800, 301 287 .flags = UPF_BOOT_AUTOCONF, 288 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 289 + .scbrr_algo_id = SCBRR_ALGO_2, 302 290 .type = PORT_SCIF, 303 291 .irqs = { 208, 208, 208, 208 } 304 292 };
+8
arch/sh/kernel/cpu/sh2a/setup-sh7203.c
··· 176 176 static struct plat_sci_port scif0_platform_data = { 177 177 .mapbase = 0xfffe8000, 178 178 .flags = UPF_BOOT_AUTOCONF, 179 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 180 + .scbrr_algo_id = SCBRR_ALGO_2, 179 181 .type = PORT_SCIF, 180 182 .irqs = { 192, 192, 192, 192 }, 181 183 }; ··· 193 191 static struct plat_sci_port scif1_platform_data = { 194 192 .mapbase = 0xfffe8800, 195 193 .flags = UPF_BOOT_AUTOCONF, 194 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 195 + .scbrr_algo_id = SCBRR_ALGO_2, 196 196 .type = PORT_SCIF, 197 197 .irqs = { 196, 196, 196, 196 }, 198 198 }; ··· 210 206 static struct plat_sci_port scif2_platform_data = { 211 207 .mapbase = 0xfffe9000, 212 208 .flags = UPF_BOOT_AUTOCONF, 209 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 210 + .scbrr_algo_id = SCBRR_ALGO_2, 213 211 .type = PORT_SCIF, 214 212 .irqs = { 200, 200, 200, 200 }, 215 213 }; ··· 227 221 static struct plat_sci_port scif3_platform_data = { 228 222 .mapbase = 0xfffe9800, 229 223 .flags = UPF_BOOT_AUTOCONF, 224 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 225 + .scbrr_algo_id = SCBRR_ALGO_2, 230 226 .type = PORT_SCIF, 231 227 .irqs = { 204, 204, 204, 204 }, 232 228 };
+8
arch/sh/kernel/cpu/sh2a/setup-sh7206.c
··· 136 136 static struct plat_sci_port scif0_platform_data = { 137 137 .mapbase = 0xfffe8000, 138 138 .flags = UPF_BOOT_AUTOCONF, 139 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 140 + .scbrr_algo_id = SCBRR_ALGO_2, 139 141 .type = PORT_SCIF, 140 142 .irqs = { 240, 240, 240, 240 }, 141 143 }; ··· 153 151 static struct plat_sci_port scif1_platform_data = { 154 152 .mapbase = 0xfffe8800, 155 153 .flags = UPF_BOOT_AUTOCONF, 154 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 155 + .scbrr_algo_id = SCBRR_ALGO_2, 156 156 .type = PORT_SCIF, 157 157 .irqs = { 244, 244, 244, 244 }, 158 158 }; ··· 170 166 static struct plat_sci_port scif2_platform_data = { 171 167 .mapbase = 0xfffe9000, 172 168 .flags = UPF_BOOT_AUTOCONF, 169 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 170 + .scbrr_algo_id = SCBRR_ALGO_2, 173 171 .type = PORT_SCIF, 174 172 .irqs = { 248, 248, 248, 248 }, 175 173 }; ··· 187 181 static struct plat_sci_port scif3_platform_data = { 188 182 .mapbase = 0xfffe9800, 189 183 .flags = UPF_BOOT_AUTOCONF, 184 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 185 + .scbrr_algo_id = SCBRR_ALGO_2, 190 186 .type = PORT_SCIF, 191 187 .irqs = { 252, 252, 252, 252 }, 192 188 };
+5
arch/sh/kernel/cpu/sh3/setup-sh7705.c
··· 70 70 static struct plat_sci_port scif0_platform_data = { 71 71 .mapbase = 0xa4410000, 72 72 .flags = UPF_BOOT_AUTOCONF, 73 + .scscr = SCSCR_TIE | SCSCR_RIE | SCSCR_TE | 74 + SCSCR_RE | SCSCR_CKE1 | SCSCR_CKE0, 75 + .scbrr_algo_id = SCBRR_ALGO_4, 73 76 .type = PORT_SCIF, 74 77 .irqs = { 56, 56, 56 }, 75 78 }; ··· 88 85 static struct plat_sci_port scif1_platform_data = { 89 86 .mapbase = 0xa4400000, 90 87 .flags = UPF_BOOT_AUTOCONF, 88 + .scscr = SCSCR_TIE | SCSCR_RIE | SCSCR_TE | SCSCR_RE, 89 + .scbrr_algo_id = SCBRR_ALGO_4, 91 90 .type = PORT_SCIF, 92 91 .irqs = { 52, 52, 52 }, 93 92 };
+6
arch/sh/kernel/cpu/sh3/setup-sh770x.c
··· 109 109 static struct plat_sci_port scif0_platform_data = { 110 110 .mapbase = 0xfffffe80, 111 111 .flags = UPF_BOOT_AUTOCONF, 112 + .scscr = SCSCR_TE | SCSCR_RE, 113 + .scbrr_algo_id = SCBRR_ALGO_2, 112 114 .type = PORT_SCI, 113 115 .irqs = { 23, 23, 23, 0 }, 114 116 }; ··· 128 126 static struct plat_sci_port scif1_platform_data = { 129 127 .mapbase = 0xa4000150, 130 128 .flags = UPF_BOOT_AUTOCONF, 129 + .scscr = SCSCR_TE | SCSCR_RE, 130 + .scbrr_algo_id = SCBRR_ALGO_2, 131 131 .type = PORT_SCIF, 132 132 .irqs = { 56, 56, 56, 56 }, 133 133 }; ··· 147 143 static struct plat_sci_port scif2_platform_data = { 148 144 .mapbase = 0xa4000140, 149 145 .flags = UPF_BOOT_AUTOCONF, 146 + .scscr = SCSCR_TE | SCSCR_RE, 147 + .scbrr_algo_id = SCBRR_ALGO_2, 150 148 .type = PORT_IRDA, 151 149 .irqs = { 52, 52, 52, 52 }, 152 150 };
+6
arch/sh/kernel/cpu/sh3/setup-sh7710.c
··· 99 99 static struct plat_sci_port scif0_platform_data = { 100 100 .mapbase = 0xa4400000, 101 101 .flags = UPF_BOOT_AUTOCONF, 102 + .scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE | 103 + SCSCR_CKE1 | SCSCR_CKE0, 104 + .scbrr_algo_id = SCBRR_ALGO_2, 102 105 .type = PORT_SCIF, 103 106 .irqs = { 52, 52, 52, 52 }, 104 107 }; ··· 117 114 static struct plat_sci_port scif1_platform_data = { 118 115 .mapbase = 0xa4410000, 119 116 .flags = UPF_BOOT_AUTOCONF, 117 + .scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE | 118 + SCSCR_CKE1 | SCSCR_CKE0, 119 + .scbrr_algo_id = SCBRR_ALGO_2, 120 120 .type = PORT_SCIF, 121 121 .irqs = { 56, 56, 56, 56 }, 122 122 };
+5 -1
arch/sh/kernel/cpu/sh3/setup-sh7720.c
··· 1 1 /* 2 - * SH7720 Setup 2 + * Setup code for SH7720, SH7721. 3 3 * 4 4 * Copyright (C) 2007 Markus Brunner, Mark Jonas 5 5 * Copyright (C) 2009 Paul Mundt ··· 51 51 static struct plat_sci_port scif0_platform_data = { 52 52 .mapbase = 0xa4430000, 53 53 .flags = UPF_BOOT_AUTOCONF, 54 + .scscr = SCSCR_RE | SCSCR_TE, 55 + .scbrr_algo_id = SCBRR_ALGO_4, 54 56 .type = PORT_SCIF, 55 57 .irqs = { 80, 80, 80, 80 }, 56 58 }; ··· 68 66 static struct plat_sci_port scif1_platform_data = { 69 67 .mapbase = 0xa4438000, 70 68 .flags = UPF_BOOT_AUTOCONF, 69 + .scscr = SCSCR_RE | SCSCR_TE, 70 + .scbrr_algo_id = SCBRR_ALGO_4, 71 71 .type = PORT_SCIF, 72 72 .irqs = { 81, 81, 81, 81 }, 73 73 };
+2
arch/sh/kernel/cpu/sh4/setup-sh4-202.c
··· 18 18 static struct plat_sci_port scif0_platform_data = { 19 19 .mapbase = 0xffe80000, 20 20 .flags = UPF_BOOT_AUTOCONF, 21 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 22 + .scbrr_algo_id = SCBRR_ALGO_2, 21 23 .type = PORT_SCIF, 22 24 .irqs = { 40, 41, 43, 42 }, 23 25 };
+26 -10
arch/sh/kernel/cpu/sh4/setup-sh7750.c
··· 14 14 #include <linux/io.h> 15 15 #include <linux/sh_timer.h> 16 16 #include <linux/serial_sci.h> 17 + #include <asm/machtypes.h> 17 18 18 19 static struct resource rtc_resources[] = { 19 20 [0] = { ··· 36 35 .resource = rtc_resources, 37 36 }; 38 37 39 - static struct plat_sci_port scif0_platform_data = { 38 + static struct plat_sci_port sci_platform_data = { 40 39 .mapbase = 0xffe00000, 41 40 .flags = UPF_BOOT_AUTOCONF, 41 + .scscr = SCSCR_TE | SCSCR_RE, 42 + .scbrr_algo_id = SCBRR_ALGO_2, 42 43 .type = PORT_SCI, 43 44 .irqs = { 23, 23, 23, 0 }, 44 45 }; 45 46 46 - static struct platform_device scif0_device = { 47 + static struct platform_device sci_device = { 47 48 .name = "sh-sci", 48 49 .id = 0, 49 50 .dev = { 50 - .platform_data = &scif0_platform_data, 51 + .platform_data = &sci_platform_data, 51 52 }, 52 53 }; 53 54 54 - static struct plat_sci_port scif1_platform_data = { 55 + static struct plat_sci_port scif_platform_data = { 55 56 .mapbase = 0xffe80000, 56 57 .flags = UPF_BOOT_AUTOCONF, 58 + .scscr = SCSCR_TE | SCSCR_RE | SCSCR_REIE, 59 + .scbrr_algo_id = SCBRR_ALGO_2, 57 60 .type = PORT_SCIF, 58 61 .irqs = { 40, 40, 40, 40 }, 59 62 }; 60 63 61 - static struct platform_device scif1_device = { 64 + static struct platform_device scif_device = { 62 65 .name = "sh-sci", 63 66 .id = 1, 64 67 .dev = { 65 - .platform_data = &scif1_platform_data, 68 + .platform_data = &scif_platform_data, 66 69 }, 67 70 }; 68 71 ··· 215 210 #endif 216 211 217 212 static struct platform_device *sh7750_devices[] __initdata = { 218 - &scif0_device, 219 - &scif1_device, 220 213 &rtc_device, 221 214 &tmu0_device, 222 215 &tmu1_device, ··· 229 226 230 227 static int __init sh7750_devices_setup(void) 231 228 { 229 + if (mach_is_rts7751r2d()) { 230 + platform_register_device(&scif_device); 231 + } else { 232 + platform_register_device(&sci_device); 233 + platform_register_device(&scif_device); 234 + } 235 + 232 236 return platform_add_devices(sh7750_devices, 233 237 ARRAY_SIZE(sh7750_devices)); 234 238 } 235 239 arch_initcall(sh7750_devices_setup); 236 240 237 241 static struct platform_device *sh7750_early_devices[] __initdata = { 238 - &scif0_device, 239 - &scif1_device, 240 242 &tmu0_device, 241 243 &tmu1_device, 242 244 &tmu2_device, ··· 255 247 256 248 void __init plat_early_device_setup(void) 257 249 { 250 + if (mach_is_rts7751r2d()) { 251 + scif_platform_data.scscr |= SCSCR_CKE1; 252 + early_platform_add_devices(&scif_device, 1); 253 + } else { 254 + early_platform_add_devices(&sci_device, 1); 255 + early_platform_add_devices(&scif_device, 1); 256 + } 257 + 258 258 early_platform_add_devices(sh7750_early_devices, 259 259 ARRAY_SIZE(sh7750_early_devices)); 260 260 }
+8
arch/sh/kernel/cpu/sh4/setup-sh7760.c
··· 129 129 static struct plat_sci_port scif0_platform_data = { 130 130 .mapbase = 0xfe600000, 131 131 .flags = UPF_BOOT_AUTOCONF, 132 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 133 + .scbrr_algo_id = SCBRR_ALGO_2, 132 134 .type = PORT_SCIF, 133 135 .irqs = { 52, 53, 55, 54 }, 134 136 }; ··· 147 145 .mapbase = 0xfe610000, 148 146 .flags = UPF_BOOT_AUTOCONF, 149 147 .type = PORT_SCIF, 148 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 149 + .scbrr_algo_id = SCBRR_ALGO_2, 150 150 .irqs = { 72, 73, 75, 74 }, 151 151 }; 152 152 ··· 163 159 static struct plat_sci_port scif2_platform_data = { 164 160 .mapbase = 0xfe620000, 165 161 .flags = UPF_BOOT_AUTOCONF, 162 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 163 + .scbrr_algo_id = SCBRR_ALGO_2, 166 164 .type = PORT_SCIF, 167 165 .irqs = { 76, 77, 79, 78 }, 168 166 }; ··· 180 174 static struct plat_sci_port scif3_platform_data = { 181 175 .mapbase = 0xfe480000, 182 176 .flags = UPF_BOOT_AUTOCONF, 177 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 178 + .scbrr_algo_id = SCBRR_ALGO_2, 183 179 .type = PORT_SCI, 184 180 .irqs = { 80, 81, 82, 0 }, 185 181 };
+8
arch/sh/kernel/cpu/sh4a/setup-sh7343.c
··· 19 19 static struct plat_sci_port scif0_platform_data = { 20 20 .mapbase = 0xffe00000, 21 21 .flags = UPF_BOOT_AUTOCONF, 22 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 23 + .scbrr_algo_id = SCBRR_ALGO_2, 22 24 .type = PORT_SCIF, 23 25 .irqs = { 80, 80, 80, 80 }, 24 26 }; ··· 36 34 static struct plat_sci_port scif1_platform_data = { 37 35 .mapbase = 0xffe10000, 38 36 .flags = UPF_BOOT_AUTOCONF, 37 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 38 + .scbrr_algo_id = SCBRR_ALGO_2, 39 39 .type = PORT_SCIF, 40 40 .irqs = { 81, 81, 81, 81 }, 41 41 }; ··· 53 49 static struct plat_sci_port scif2_platform_data = { 54 50 .mapbase = 0xffe20000, 55 51 .flags = UPF_BOOT_AUTOCONF, 52 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 53 + .scbrr_algo_id = SCBRR_ALGO_2, 56 54 .type = PORT_SCIF, 57 55 .irqs = { 82, 82, 82, 82 }, 58 56 }; ··· 70 64 static struct plat_sci_port scif3_platform_data = { 71 65 .mapbase = 0xffe30000, 72 66 .flags = UPF_BOOT_AUTOCONF, 67 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_CKE1, 68 + .scbrr_algo_id = SCBRR_ALGO_2, 73 69 .type = PORT_SCIF, 74 70 .irqs = { 83, 83, 83, 83 }, 75 71 };
+2
arch/sh/kernel/cpu/sh4a/setup-sh7366.c
··· 21 21 static struct plat_sci_port scif0_platform_data = { 22 22 .mapbase = 0xffe00000, 23 23 .flags = UPF_BOOT_AUTOCONF, 24 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 25 + .scbrr_algo_id = SCBRR_ALGO_2, 24 26 .type = PORT_SCIF, 25 27 .irqs = { 80, 80, 80, 80 }, 26 28 };
+6
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
··· 181 181 static struct plat_sci_port scif0_platform_data = { 182 182 .mapbase = 0xffe00000, 183 183 .flags = UPF_BOOT_AUTOCONF, 184 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 185 + .scbrr_algo_id = SCBRR_ALGO_2, 184 186 .type = PORT_SCIF, 185 187 .irqs = { 80, 80, 80, 80 }, 186 188 }; ··· 198 196 static struct plat_sci_port scif1_platform_data = { 199 197 .mapbase = 0xffe10000, 200 198 .flags = UPF_BOOT_AUTOCONF, 199 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 200 + .scbrr_algo_id = SCBRR_ALGO_2, 201 201 .type = PORT_SCIF, 202 202 .irqs = { 81, 81, 81, 81 }, 203 203 }; ··· 215 211 static struct plat_sci_port scif2_platform_data = { 216 212 .mapbase = 0xffe20000, 217 213 .flags = UPF_BOOT_AUTOCONF, 214 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 215 + .scbrr_algo_id = SCBRR_ALGO_2, 218 216 .type = PORT_SCIF, 219 217 .irqs = { 82, 82, 82, 82 }, 220 218 };
+12
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
··· 24 24 static struct plat_sci_port scif0_platform_data = { 25 25 .mapbase = 0xffe00000, 26 26 .flags = UPF_BOOT_AUTOCONF, 27 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 28 + .scbrr_algo_id = SCBRR_ALGO_2, 27 29 .type = PORT_SCIF, 28 30 .irqs = { 80, 80, 80, 80 }, 29 31 }; ··· 41 39 static struct plat_sci_port scif1_platform_data = { 42 40 .mapbase = 0xffe10000, 43 41 .flags = UPF_BOOT_AUTOCONF, 42 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 43 + .scbrr_algo_id = SCBRR_ALGO_2, 44 44 .type = PORT_SCIF, 45 45 .irqs = { 81, 81, 81, 81 }, 46 46 }; ··· 58 54 static struct plat_sci_port scif2_platform_data = { 59 55 .mapbase = 0xffe20000, 60 56 .flags = UPF_BOOT_AUTOCONF, 57 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 58 + .scbrr_algo_id = SCBRR_ALGO_2, 61 59 .type = PORT_SCIF, 62 60 .irqs = { 82, 82, 82, 82 }, 63 61 }; ··· 75 69 static struct plat_sci_port scif3_platform_data = { 76 70 .mapbase = 0xa4e30000, 77 71 .flags = UPF_BOOT_AUTOCONF, 72 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 73 + .scbrr_algo_id = SCBRR_ALGO_3, 78 74 .type = PORT_SCIFA, 79 75 .irqs = { 56, 56, 56, 56 }, 80 76 }; ··· 92 84 static struct plat_sci_port scif4_platform_data = { 93 85 .mapbase = 0xa4e40000, 94 86 .flags = UPF_BOOT_AUTOCONF, 87 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 88 + .scbrr_algo_id = SCBRR_ALGO_3, 95 89 .type = PORT_SCIFA, 96 90 .irqs = { 88, 88, 88, 88 }, 97 91 }; ··· 109 99 static struct plat_sci_port scif5_platform_data = { 110 100 .mapbase = 0xa4e50000, 111 101 .flags = UPF_BOOT_AUTOCONF, 102 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 103 + .scbrr_algo_id = SCBRR_ALGO_3, 112 104 .type = PORT_SCIFA, 113 105 .irqs = { 109, 109, 109, 109 }, 114 106 };
+12
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
··· 257 257 static struct plat_sci_port scif0_platform_data = { 258 258 .mapbase = 0xffe00000, 259 259 .flags = UPF_BOOT_AUTOCONF, 260 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 261 + .scbrr_algo_id = SCBRR_ALGO_2, 260 262 .type = PORT_SCIF, 261 263 .irqs = { 80, 80, 80, 80 }, 262 264 }; ··· 274 272 static struct plat_sci_port scif1_platform_data = { 275 273 .mapbase = 0xffe10000, 276 274 .flags = UPF_BOOT_AUTOCONF, 275 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 276 + .scbrr_algo_id = SCBRR_ALGO_2, 277 277 .type = PORT_SCIF, 278 278 .irqs = { 81, 81, 81, 81 }, 279 279 }; ··· 291 287 static struct plat_sci_port scif2_platform_data = { 292 288 .mapbase = 0xffe20000, 293 289 .flags = UPF_BOOT_AUTOCONF, 290 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 291 + .scbrr_algo_id = SCBRR_ALGO_2, 294 292 .type = PORT_SCIF, 295 293 .irqs = { 82, 82, 82, 82 }, 296 294 }; ··· 308 302 static struct plat_sci_port scif3_platform_data = { 309 303 .mapbase = 0xa4e30000, 310 304 .flags = UPF_BOOT_AUTOCONF, 305 + .scscr = SCSCR_RE | SCSCR_TE, 306 + .scbrr_algo_id = SCBRR_ALGO_3, 311 307 .type = PORT_SCIFA, 312 308 .irqs = { 56, 56, 56, 56 }, 313 309 }; ··· 325 317 static struct plat_sci_port scif4_platform_data = { 326 318 .mapbase = 0xa4e40000, 327 319 .flags = UPF_BOOT_AUTOCONF, 320 + .scscr = SCSCR_RE | SCSCR_TE, 321 + .scbrr_algo_id = SCBRR_ALGO_3, 328 322 .type = PORT_SCIFA, 329 323 .irqs = { 88, 88, 88, 88 }, 330 324 }; ··· 342 332 static struct plat_sci_port scif5_platform_data = { 343 333 .mapbase = 0xa4e50000, 344 334 .flags = UPF_BOOT_AUTOCONF, 335 + .scscr = SCSCR_RE | SCSCR_TE, 336 + .scbrr_algo_id = SCBRR_ALGO_3, 345 337 .type = PORT_SCIFA, 346 338 .irqs = { 109, 109, 109, 109 }, 347 339 };
+6
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
··· 20 20 static struct plat_sci_port scif2_platform_data = { 21 21 .mapbase = 0xfe4b0000, /* SCIF2 */ 22 22 .flags = UPF_BOOT_AUTOCONF, 23 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 24 + .scbrr_algo_id = SCBRR_ALGO_2, 23 25 .type = PORT_SCIF, 24 26 .irqs = { 40, 40, 40, 40 }, 25 27 }; ··· 37 35 static struct plat_sci_port scif3_platform_data = { 38 36 .mapbase = 0xfe4c0000, /* SCIF3 */ 39 37 .flags = UPF_BOOT_AUTOCONF, 38 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 39 + .scbrr_algo_id = SCBRR_ALGO_2, 40 40 .type = PORT_SCIF, 41 41 .irqs = { 76, 76, 76, 76 }, 42 42 }; ··· 54 50 static struct plat_sci_port scif4_platform_data = { 55 51 .mapbase = 0xfe4d0000, /* SCIF4 */ 56 52 .flags = UPF_BOOT_AUTOCONF, 53 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 54 + .scbrr_algo_id = SCBRR_ALGO_2, 57 55 .type = PORT_SCIF, 58 56 .irqs = { 104, 104, 104, 104 }, 59 57 };
+6
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
··· 19 19 static struct plat_sci_port scif0_platform_data = { 20 20 .mapbase = 0xffe00000, 21 21 .flags = UPF_BOOT_AUTOCONF, 22 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 23 + .scbrr_algo_id = SCBRR_ALGO_2, 22 24 .type = PORT_SCIF, 23 25 .irqs = { 40, 40, 40, 40 }, 24 26 }; ··· 36 34 static struct plat_sci_port scif1_platform_data = { 37 35 .mapbase = 0xffe08000, 38 36 .flags = UPF_BOOT_AUTOCONF, 37 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 38 + .scbrr_algo_id = SCBRR_ALGO_2, 39 39 .type = PORT_SCIF, 40 40 .irqs = { 76, 76, 76, 76 }, 41 41 }; ··· 53 49 static struct plat_sci_port scif2_platform_data = { 54 50 .mapbase = 0xffe10000, 55 51 .flags = UPF_BOOT_AUTOCONF, 52 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 53 + .scbrr_algo_id = SCBRR_ALGO_2, 56 54 .type = PORT_SCIF, 57 55 .irqs = { 104, 104, 104, 104 }, 58 56 };
+20
arch/sh/kernel/cpu/sh4a/setup-sh7770.c
··· 17 17 static struct plat_sci_port scif0_platform_data = { 18 18 .mapbase = 0xff923000, 19 19 .flags = UPF_BOOT_AUTOCONF, 20 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 21 + .scbrr_algo_id = SCBRR_ALGO_2, 20 22 .type = PORT_SCIF, 21 23 .irqs = { 61, 61, 61, 61 }, 22 24 }; ··· 34 32 static struct plat_sci_port scif1_platform_data = { 35 33 .mapbase = 0xff924000, 36 34 .flags = UPF_BOOT_AUTOCONF, 35 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 36 + .scbrr_algo_id = SCBRR_ALGO_2, 37 37 .type = PORT_SCIF, 38 38 .irqs = { 62, 62, 62, 62 }, 39 39 }; ··· 51 47 static struct plat_sci_port scif2_platform_data = { 52 48 .mapbase = 0xff925000, 53 49 .flags = UPF_BOOT_AUTOCONF, 50 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 51 + .scbrr_algo_id = SCBRR_ALGO_2, 54 52 .type = PORT_SCIF, 55 53 .irqs = { 63, 63, 63, 63 }, 56 54 }; ··· 68 62 static struct plat_sci_port scif3_platform_data = { 69 63 .mapbase = 0xff926000, 70 64 .flags = UPF_BOOT_AUTOCONF, 65 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 66 + .scbrr_algo_id = SCBRR_ALGO_2, 71 67 .type = PORT_SCIF, 72 68 .irqs = { 64, 64, 64, 64 }, 73 69 }; ··· 85 77 static struct plat_sci_port scif4_platform_data = { 86 78 .mapbase = 0xff927000, 87 79 .flags = UPF_BOOT_AUTOCONF, 80 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 81 + .scbrr_algo_id = SCBRR_ALGO_2, 88 82 .type = PORT_SCIF, 89 83 .irqs = { 65, 65, 65, 65 }, 90 84 }; ··· 102 92 static struct plat_sci_port scif5_platform_data = { 103 93 .mapbase = 0xff928000, 104 94 .flags = UPF_BOOT_AUTOCONF, 95 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 96 + .scbrr_algo_id = SCBRR_ALGO_2, 105 97 .type = PORT_SCIF, 106 98 .irqs = { 66, 66, 66, 66 }, 107 99 }; ··· 119 107 static struct plat_sci_port scif6_platform_data = { 120 108 .mapbase = 0xff929000, 121 109 .flags = UPF_BOOT_AUTOCONF, 110 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 111 + .scbrr_algo_id = SCBRR_ALGO_2, 122 112 .type = PORT_SCIF, 123 113 .irqs = { 67, 67, 67, 67 }, 124 114 }; ··· 136 122 static struct plat_sci_port scif7_platform_data = { 137 123 .mapbase = 0xff92a000, 138 124 .flags = UPF_BOOT_AUTOCONF, 125 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 126 + .scbrr_algo_id = SCBRR_ALGO_2, 139 127 .type = PORT_SCIF, 140 128 .irqs = { 68, 68, 68, 68 }, 141 129 }; ··· 153 137 static struct plat_sci_port scif8_platform_data = { 154 138 .mapbase = 0xff92b000, 155 139 .flags = UPF_BOOT_AUTOCONF, 140 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 141 + .scbrr_algo_id = SCBRR_ALGO_2, 156 142 .type = PORT_SCIF, 157 143 .irqs = { 69, 69, 69, 69 }, 158 144 }; ··· 170 152 static struct plat_sci_port scif9_platform_data = { 171 153 .mapbase = 0xff92c000, 172 154 .flags = UPF_BOOT_AUTOCONF, 155 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_TOIE, 156 + .scbrr_algo_id = SCBRR_ALGO_2, 173 157 .type = PORT_SCIF, 174 158 .irqs = { 70, 70, 70, 70 }, 175 159 };
+12
arch/sh/kernel/cpu/sh4a/setup-sh7780.c
··· 20 20 static struct plat_sci_port scif0_platform_data = { 21 21 .mapbase = 0xffe00000, 22 22 .flags = UPF_BOOT_AUTOCONF, 23 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 24 + .scbrr_algo_id = SCBRR_ALGO_1, 23 25 .type = PORT_SCIF, 24 26 .irqs = { 40, 40, 40, 40 }, 25 27 }; ··· 37 35 static struct plat_sci_port scif1_platform_data = { 38 36 .mapbase = 0xffe10000, 39 37 .flags = UPF_BOOT_AUTOCONF, 38 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 39 + .scbrr_algo_id = SCBRR_ALGO_1, 40 40 .type = PORT_SCIF, 41 41 .irqs = { 76, 76, 76, 76 }, 42 42 }; ··· 383 379 ARRAY_SIZE(sh7780_devices)); 384 380 } 385 381 arch_initcall(sh7780_devices_setup); 382 + 386 383 static struct platform_device *sh7780_early_devices[] __initdata = { 387 384 &scif0_device, 388 385 &scif1_device, ··· 397 392 398 393 void __init plat_early_device_setup(void) 399 394 { 395 + if (mach_is_sh2007()) { 396 + scif0_platform_data.scscr &= ~SCSCR_CKE1; 397 + scif0_platform_data.scbrr_algo_id = SCBRR_ALGO_2; 398 + scif1_platform_data.scscr &= ~SCSCR_CKE1; 399 + scif1_platform_data.scbrr_algo_id = SCBRR_ALGO_2; 400 + } 401 + 400 402 early_platform_add_devices(sh7780_early_devices, 401 403 ARRAY_SIZE(sh7780_early_devices)); 402 404 }
+12
arch/sh/kernel/cpu/sh4a/setup-sh7785.c
··· 23 23 static struct plat_sci_port scif0_platform_data = { 24 24 .mapbase = 0xffea0000, 25 25 .flags = UPF_BOOT_AUTOCONF, 26 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 27 + .scbrr_algo_id = SCBRR_ALGO_1, 26 28 .type = PORT_SCIF, 27 29 .irqs = { 40, 40, 40, 40 }, 28 30 }; ··· 40 38 static struct plat_sci_port scif1_platform_data = { 41 39 .mapbase = 0xffeb0000, 42 40 .flags = UPF_BOOT_AUTOCONF, 41 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 42 + .scbrr_algo_id = SCBRR_ALGO_1, 43 43 .type = PORT_SCIF, 44 44 .irqs = { 44, 44, 44, 44 }, 45 45 }; ··· 57 53 static struct plat_sci_port scif2_platform_data = { 58 54 .mapbase = 0xffec0000, 59 55 .flags = UPF_BOOT_AUTOCONF, 56 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 57 + .scbrr_algo_id = SCBRR_ALGO_1, 60 58 .type = PORT_SCIF, 61 59 .irqs = { 60, 60, 60, 60 }, 62 60 }; ··· 74 68 static struct plat_sci_port scif3_platform_data = { 75 69 .mapbase = 0xffed0000, 76 70 .flags = UPF_BOOT_AUTOCONF, 71 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 72 + .scbrr_algo_id = SCBRR_ALGO_1, 77 73 .type = PORT_SCIF, 78 74 .irqs = { 61, 61, 61, 61 }, 79 75 }; ··· 91 83 static struct plat_sci_port scif4_platform_data = { 92 84 .mapbase = 0xffee0000, 93 85 .flags = UPF_BOOT_AUTOCONF, 86 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 87 + .scbrr_algo_id = SCBRR_ALGO_1, 94 88 .type = PORT_SCIF, 95 89 .irqs = { 62, 62, 62, 62 }, 96 90 }; ··· 108 98 static struct plat_sci_port scif5_platform_data = { 109 99 .mapbase = 0xffef0000, 110 100 .flags = UPF_BOOT_AUTOCONF, 101 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 102 + .scbrr_algo_id = SCBRR_ALGO_1, 111 103 .type = PORT_SCIF, 112 104 .irqs = { 63, 63, 63, 63 }, 113 105 };
+12
arch/sh/kernel/cpu/sh4a/setup-sh7786.c
··· 29 29 static struct plat_sci_port scif0_platform_data = { 30 30 .mapbase = 0xffea0000, 31 31 .flags = UPF_BOOT_AUTOCONF, 32 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 33 + .scbrr_algo_id = SCBRR_ALGO_1, 32 34 .type = PORT_SCIF, 33 35 .irqs = { 40, 41, 43, 42 }, 34 36 }; ··· 49 47 static struct plat_sci_port scif1_platform_data = { 50 48 .mapbase = 0xffeb0000, 51 49 .flags = UPF_BOOT_AUTOCONF, 50 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 51 + .scbrr_algo_id = SCBRR_ALGO_1, 52 52 .type = PORT_SCIF, 53 53 .irqs = { 44, 44, 44, 44 }, 54 54 }; ··· 66 62 static struct plat_sci_port scif2_platform_data = { 67 63 .mapbase = 0xffec0000, 68 64 .flags = UPF_BOOT_AUTOCONF, 65 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 66 + .scbrr_algo_id = SCBRR_ALGO_1, 69 67 .type = PORT_SCIF, 70 68 .irqs = { 50, 50, 50, 50 }, 71 69 }; ··· 83 77 static struct plat_sci_port scif3_platform_data = { 84 78 .mapbase = 0xffed0000, 85 79 .flags = UPF_BOOT_AUTOCONF, 80 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 81 + .scbrr_algo_id = SCBRR_ALGO_1, 86 82 .type = PORT_SCIF, 87 83 .irqs = { 51, 51, 51, 51 }, 88 84 }; ··· 100 92 static struct plat_sci_port scif4_platform_data = { 101 93 .mapbase = 0xffee0000, 102 94 .flags = UPF_BOOT_AUTOCONF, 95 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 96 + .scbrr_algo_id = SCBRR_ALGO_1, 103 97 .type = PORT_SCIF, 104 98 .irqs = { 52, 52, 52, 52 }, 105 99 }; ··· 117 107 static struct plat_sci_port scif5_platform_data = { 118 108 .mapbase = 0xffef0000, 119 109 .flags = UPF_BOOT_AUTOCONF, 110 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE | SCSCR_CKE1, 111 + .scbrr_algo_id = SCBRR_ALGO_1, 120 112 .type = PORT_SCIF, 121 113 .irqs = { 53, 53, 53, 53 }, 122 114 };
+6
arch/sh/kernel/cpu/sh4a/setup-shx3.c
··· 29 29 static struct plat_sci_port scif0_platform_data = { 30 30 .mapbase = 0xffc30000, 31 31 .flags = UPF_BOOT_AUTOCONF, 32 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 33 + .scbrr_algo_id = SCBRR_ALGO_2, 32 34 .type = PORT_SCIF, 33 35 .irqs = { 40, 41, 43, 42 }, 34 36 }; ··· 46 44 static struct plat_sci_port scif1_platform_data = { 47 45 .mapbase = 0xffc40000, 48 46 .flags = UPF_BOOT_AUTOCONF, 47 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 48 + .scbrr_algo_id = SCBRR_ALGO_2, 49 49 .type = PORT_SCIF, 50 50 .irqs = { 44, 45, 47, 46 }, 51 51 }; ··· 63 59 static struct plat_sci_port scif2_platform_data = { 64 60 .mapbase = 0xffc60000, 65 61 .flags = UPF_BOOT_AUTOCONF, 62 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 63 + .scbrr_algo_id = SCBRR_ALGO_2, 66 64 .type = PORT_SCIF, 67 65 .irqs = { 52, 53, 55, 54 }, 68 66 };
+2
arch/sh/kernel/cpu/sh5/setup-sh5.c
··· 19 19 static struct plat_sci_port scif0_platform_data = { 20 20 .mapbase = PHYS_PERIPHERAL_BLOCK + 0x01030000, 21 21 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, 22 + .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, 23 + .scbrr_algo_id = SCBRR_ALGO_2, 22 24 .type = PORT_SCIF, 23 25 .irqs = { 39, 40, 42, 0 }, 24 26 };
+76 -24
drivers/serial/sh-sci.c
··· 3 3 * 4 4 * SuperH on-chip serial module support. (SCI with no FIFO / with FIFO) 5 5 * 6 - * Copyright (C) 2002 - 2008 Paul Mundt 6 + * Copyright (C) 2002 - 2011 Paul Mundt 7 7 * Modified to support SH7720 SCIF. Markus Brunner, Mark Jonas (Jul 2007). 8 8 * 9 9 * based off of the old drivers/char/sh-sci.c by: ··· 81 81 struct timer_list break_timer; 82 82 int break_flag; 83 83 84 + /* SCSCR initialization */ 85 + unsigned int scscr; 86 + 87 + /* SCBRR calculation algo */ 88 + unsigned int scbrr_algo_id; 89 + 84 90 /* Interface clock */ 85 91 struct clk *iclk; 86 92 /* Function clock */ 87 93 struct clk *fclk; 88 94 89 95 struct list_head node; 96 + 90 97 struct dma_chan *chan_tx; 91 98 struct dma_chan *chan_rx; 99 + 92 100 #ifdef CONFIG_SERIAL_SH_SCI_DMA 93 101 struct device *dma_dev; 94 102 unsigned int slave_tx; ··· 423 415 if (!(status & SCxSR_TDxE(port))) { 424 416 ctrl = sci_in(port, SCSCR); 425 417 if (uart_circ_empty(xmit)) 426 - ctrl &= ~SCI_CTRL_FLAGS_TIE; 418 + ctrl &= ~SCSCR_TIE; 427 419 else 428 - ctrl |= SCI_CTRL_FLAGS_TIE; 420 + ctrl |= SCSCR_TIE; 429 421 sci_out(port, SCSCR, ctrl); 430 422 return; 431 423 } ··· 467 459 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 468 460 } 469 461 470 - ctrl |= SCI_CTRL_FLAGS_TIE; 462 + ctrl |= SCSCR_TIE; 471 463 sci_out(port, SCSCR, ctrl); 472 464 } 473 465 } ··· 716 708 disable_irq_nosync(irq); 717 709 scr |= 0x4000; 718 710 } else { 719 - scr &= ~SCI_CTRL_FLAGS_RIE; 711 + scr &= ~SCSCR_RIE; 720 712 } 721 713 sci_out(port, SCSCR, scr); 722 714 /* Clear current interrupt */ ··· 785 777 return IRQ_HANDLED; 786 778 } 787 779 780 + static inline unsigned long port_rx_irq_mask(struct uart_port *port) 781 + { 782 + /* 783 + * Not all ports (such as SCIFA) will support REIE. Rather than 784 + * special-casing the port type, we check the port initialization 785 + * IRQ enable mask to see whether the IRQ is desired at all. If 786 + * it's unset, it's logically inferred that there's no point in 787 + * testing for it. 788 + */ 789 + return SCSCR_RIE | (to_sci_port(port)->scscr & SCSR_REIE); 790 + } 791 + 788 792 static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) 789 793 { 790 794 unsigned short ssr_status, scr_status, err_enabled; ··· 806 786 807 787 ssr_status = sci_in(port, SCxSR); 808 788 scr_status = sci_in(port, SCSCR); 809 - err_enabled = scr_status & (SCI_CTRL_FLAGS_REIE | SCI_CTRL_FLAGS_RIE); 789 + err_enabled = scr_status & port_rx_irq_mask(port); 810 790 811 791 /* Tx Interrupt */ 812 - if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCI_CTRL_FLAGS_TIE) && 792 + if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCSCR_TIE) && 813 793 !s->chan_tx) 814 794 ret = sci_tx_interrupt(irq, ptr); 795 + 815 796 /* 816 797 * Rx Interrupt: if we're using DMA, the DMA controller clears RDF / 817 798 * DR flags 818 799 */ 819 800 if (((ssr_status & SCxSR_RDxF(port)) || s->chan_rx) && 820 - (scr_status & SCI_CTRL_FLAGS_RIE)) 801 + (scr_status & SCSCR_RIE)) 821 802 ret = sci_rx_interrupt(irq, ptr); 803 + 822 804 /* Error Interrupt */ 823 805 if ((ssr_status & SCxSR_ERRORS(port)) && err_enabled) 824 806 ret = sci_er_interrupt(irq, ptr); 807 + 825 808 /* Break Interrupt */ 826 809 if ((ssr_status & SCxSR_BRK(port)) && err_enabled) 827 810 ret = sci_br_interrupt(irq, ptr); ··· 974 951 schedule_work(&s->work_tx); 975 952 } else if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { 976 953 u16 ctrl = sci_in(port, SCSCR); 977 - sci_out(port, SCSCR, ctrl & ~SCI_CTRL_FLAGS_TIE); 954 + sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); 978 955 } 979 956 980 957 spin_unlock_irqrestore(&port->lock, flags); ··· 1237 1214 if (new != scr) 1238 1215 sci_out(port, SCSCR, new); 1239 1216 } 1217 + 1240 1218 if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && 1241 1219 s->cookie_tx < 0) 1242 1220 schedule_work(&s->work_tx); 1243 1221 #endif 1222 + 1244 1223 if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { 1245 1224 /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ 1246 1225 ctrl = sci_in(port, SCSCR); 1247 - sci_out(port, SCSCR, ctrl | SCI_CTRL_FLAGS_TIE); 1226 + sci_out(port, SCSCR, ctrl | SCSCR_TIE); 1248 1227 } 1249 1228 } 1250 1229 ··· 1256 1231 1257 1232 /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */ 1258 1233 ctrl = sci_in(port, SCSCR); 1234 + 1259 1235 if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) 1260 1236 ctrl &= ~0x8000; 1261 - ctrl &= ~SCI_CTRL_FLAGS_TIE; 1237 + 1238 + ctrl &= ~SCSCR_TIE; 1239 + 1262 1240 sci_out(port, SCSCR, ctrl); 1263 1241 } 1264 1242 1265 1243 static void sci_start_rx(struct uart_port *port) 1266 1244 { 1267 - unsigned short ctrl = SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE; 1245 + unsigned short ctrl; 1268 1246 1269 - /* Set RIE (Receive Interrupt Enable) bit in SCSCR */ 1270 - ctrl |= sci_in(port, SCSCR); 1247 + ctrl = sci_in(port, SCSCR) | port_rx_irq_mask(port); 1248 + 1271 1249 if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) 1272 1250 ctrl &= ~0x4000; 1251 + 1273 1252 sci_out(port, SCSCR, ctrl); 1274 1253 } 1275 1254 ··· 1281 1252 { 1282 1253 unsigned short ctrl; 1283 1254 1284 - /* Clear RIE (Receive Interrupt Enable) bit in SCSCR */ 1285 1255 ctrl = sci_in(port, SCSCR); 1256 + 1286 1257 if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) 1287 1258 ctrl &= ~0x4000; 1288 - ctrl &= ~(SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE); 1259 + 1260 + ctrl &= ~port_rx_irq_mask(port); 1261 + 1289 1262 sci_out(port, SCSCR, ctrl); 1290 1263 } 1291 1264 ··· 1327 1296 scr &= ~0x4000; 1328 1297 enable_irq(s->irqs[1]); 1329 1298 } 1330 - sci_out(port, SCSCR, scr | SCI_CTRL_FLAGS_RIE); 1299 + sci_out(port, SCSCR, scr | SCSCR_RIE); 1331 1300 dev_dbg(port->dev, "DMA Rx timed out\n"); 1332 1301 schedule_work(&s->work_rx); 1333 1302 } ··· 1473 1442 s->disable(port); 1474 1443 } 1475 1444 1445 + static unsigned int sci_scbrr_calc(unsigned int algo_id, unsigned int bps, 1446 + unsigned long freq) 1447 + { 1448 + switch (algo_id) { 1449 + case SCBRR_ALGO_1: 1450 + return ((freq + 16 * bps) / (16 * bps) - 1); 1451 + case SCBRR_ALGO_2: 1452 + return ((freq + 16 * bps) / (32 * bps) - 1); 1453 + case SCBRR_ALGO_3: 1454 + return (((freq * 2) + 16 * bps) / (16 * bps) - 1); 1455 + case SCBRR_ALGO_4: 1456 + return (((freq * 2) + 16 * bps) / (32 * bps) - 1); 1457 + case SCBRR_ALGO_5: 1458 + return (((freq * 1000 / 32) / bps) - 1); 1459 + } 1460 + 1461 + /* Warn, but use a safe default */ 1462 + WARN_ON(1); 1463 + return ((freq + 16 * bps) / (32 * bps) - 1); 1464 + } 1465 + 1476 1466 static void sci_set_termios(struct uart_port *port, struct ktermios *termios, 1477 1467 struct ktermios *old) 1478 1468 { 1479 - #ifdef CONFIG_SERIAL_SH_SCI_DMA 1480 1469 struct sci_port *s = to_sci_port(port); 1481 - #endif 1482 1470 unsigned int status, baud, smr_val, max_baud; 1483 1471 int t = -1; 1484 1472 u16 scfcr = 0; ··· 1514 1464 1515 1465 baud = uart_get_baud_rate(port, termios, old, 0, max_baud); 1516 1466 if (likely(baud && port->uartclk)) 1517 - t = SCBRR_VALUE(baud, port->uartclk); 1467 + t = sci_scbrr_calc(s->scbrr_algo_id, baud, port->uartclk); 1518 1468 1519 1469 do { 1520 1470 status = sci_in(port, SCxSR); ··· 1556 1506 sci_init_pins(port, termios->c_cflag); 1557 1507 sci_out(port, SCFCR, scfcr | ((termios->c_cflag & CRTSCTS) ? SCFCR_MCE : 0)); 1558 1508 1559 - sci_out(port, SCSCR, SCSCR_INIT(port)); 1509 + sci_out(port, SCSCR, s->scscr); 1560 1510 1561 1511 #ifdef CONFIG_SERIAL_SH_SCI_DMA 1562 1512 /* ··· 1729 1679 port->mapbase = p->mapbase; 1730 1680 port->membase = p->membase; 1731 1681 1732 - port->irq = p->irqs[SCIx_TXI_IRQ]; 1733 - port->flags = p->flags; 1734 - sci_port->type = port->type = p->type; 1682 + port->irq = p->irqs[SCIx_TXI_IRQ]; 1683 + port->flags = p->flags; 1684 + sci_port->type = port->type = p->type; 1685 + sci_port->scscr = p->scscr; 1686 + sci_port->scbrr_algo_id = p->scbrr_algo_id; 1735 1687 1736 1688 #ifdef CONFIG_SERIAL_SH_SCI_DMA 1737 1689 sci_port->dma_dev = p->dma_dev;
-153
drivers/serial/sh-sci.h
··· 15 15 defined(CONFIG_CPU_SUBTYPE_SH7709) 16 16 # define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */ 17 17 # define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */ 18 - # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ 19 18 #elif defined(CONFIG_CPU_SUBTYPE_SH7705) 20 19 # define SCIF0 0xA4400000 21 20 # define SCIF2 0xA4410000 22 - # define SCSMR_Ir 0xA44A0000 23 - # define IRDA_SCIF SCIF0 24 21 # define SCPCR 0xA4000116 25 22 # define SCPDR 0xA4000136 26 - 27 - /* Set the clock source, 28 - * SCIF2 (0xA4410000) -> External clock, SCK pin used as clock input 29 - * SCIF0 (0xA4400000) -> Internal clock, SCK pin as serial clock output 30 - */ 31 - # define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 32 23 #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 33 24 defined(CONFIG_CPU_SUBTYPE_SH7721) || \ 34 25 defined(CONFIG_ARCH_SH73A0) || \ 35 26 defined(CONFIG_ARCH_SH7367) || \ 36 27 defined(CONFIG_ARCH_SH7377) || \ 37 28 defined(CONFIG_ARCH_SH7372) 38 - # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ 39 29 # define PORT_PTCR 0xA405011EUL 40 30 # define PORT_PVCR 0xA4050122UL 41 31 # define SCIF_ORER 0x0200 /* overrun error bit */ ··· 33 43 # define SCSPTR1 0xFFE0001C /* 8 bit SCIF */ 34 44 # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */ 35 45 # define SCIF_ORER 0x0001 /* overrun error bit */ 36 - # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 37 46 #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ 38 47 defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ 39 48 defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ ··· 42 53 # define SCSPTR1 0xffe0001c /* 8 bit SCI */ 43 54 # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */ 44 55 # define SCIF_ORER 0x0001 /* overrun error bit */ 45 - # define SCSCR_INIT(port) (((port)->type == PORT_SCI) ? \ 46 - 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \ 47 - 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ ) 48 56 #elif defined(CONFIG_CPU_SUBTYPE_SH7760) 49 57 # define SCSPTR0 0xfe600024 /* 16 bit SCIF */ 50 58 # define SCSPTR1 0xfe610024 /* 16 bit SCIF */ 51 59 # define SCSPTR2 0xfe620024 /* 16 bit SCIF */ 52 60 # define SCIF_ORER 0x0001 /* overrun error bit */ 53 - # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 54 61 #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 55 62 # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ 56 63 # define SCIF_ORER 0x0001 /* overrun error bit */ 57 64 # define PACR 0xa4050100 58 65 # define PBCR 0xa4050102 59 - # define SCSCR_INIT(port) 0x3B 60 66 #elif defined(CONFIG_CPU_SUBTYPE_SH7343) 61 67 # define SCSPTR0 0xffe00010 /* 16 bit SCIF */ 62 68 # define SCSPTR1 0xffe10010 /* 16 bit SCIF */ 63 69 # define SCSPTR2 0xffe20010 /* 16 bit SCIF */ 64 70 # define SCSPTR3 0xffe30010 /* 16 bit SCIF */ 65 - # define SCSCR_INIT(port) 0x32 /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */ 66 71 #elif defined(CONFIG_CPU_SUBTYPE_SH7722) 67 72 # define PADR 0xA4050120 68 73 # define PSDR 0xA405013e 69 74 # define PWDR 0xA4050166 70 75 # define PSCR 0xA405011E 71 76 # define SCIF_ORER 0x0001 /* overrun error bit */ 72 - # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 73 77 #elif defined(CONFIG_CPU_SUBTYPE_SH7366) 74 78 # define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */ 75 79 # define SCSPTR0 SCPDR0 76 80 # define SCIF_ORER 0x0001 /* overrun error bit */ 77 - # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 78 81 #elif defined(CONFIG_CPU_SUBTYPE_SH7723) 79 82 # define SCSPTR0 0xa4050160 80 83 # define SCSPTR1 0xa405013e ··· 75 94 # define SCSPTR4 0xa4050128 76 95 # define SCSPTR5 0xa4050128 77 96 # define SCIF_ORER 0x0001 /* overrun error bit */ 78 - # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 79 97 #elif defined(CONFIG_CPU_SUBTYPE_SH7724) 80 98 # define SCIF_ORER 0x0001 /* overrun error bit */ 81 - # define SCSCR_INIT(port) ((port)->type == PORT_SCIFA ? \ 82 - 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \ 83 - 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ ) 84 99 #elif defined(CONFIG_CPU_SUBTYPE_SH4_202) 85 100 # define SCSPTR2 0xffe80020 /* 16 bit SCIF */ 86 101 # define SCIF_ORER 0x0001 /* overrun error bit */ 87 - # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 88 102 #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) 89 - # define SCIF_BASE_ADDR 0x01030000 90 - # define SCIF_ADDR_SH5 PHYS_PERIPHERAL_BLOCK+SCIF_BASE_ADDR 91 103 # define SCIF_PTR2_OFFS 0x0000020 92 - # define SCIF_LSR2_OFFS 0x0000024 93 104 # define SCSPTR2 ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */ 94 - # define SCLSR2 ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */ 95 - # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0, TE=1,RE=1,REIE=1 */ 96 105 #elif defined(CONFIG_H83007) || defined(CONFIG_H83068) 97 - # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ 98 106 # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) 99 107 #elif defined(CONFIG_H8S2678) 100 - # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ 101 108 # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) 102 109 #elif defined(CONFIG_CPU_SUBTYPE_SH7757) 103 110 # define SCSPTR0 0xfe4b0020 104 111 # define SCSPTR1 0xfe4b0020 105 112 # define SCSPTR2 0xfe4b0020 106 113 # define SCIF_ORER 0x0001 107 - # define SCSCR_INIT(port) 0x38 108 114 # define SCIF_ONLY 109 115 #elif defined(CONFIG_CPU_SUBTYPE_SH7763) 110 116 # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ 111 117 # define SCSPTR1 0xffe08024 /* 16 bit SCIF */ 112 118 # define SCSPTR2 0xffe10020 /* 16 bit SCIF/IRDA */ 113 119 # define SCIF_ORER 0x0001 /* overrun error bit */ 114 - # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 115 120 #elif defined(CONFIG_CPU_SUBTYPE_SH7770) 116 121 # define SCSPTR0 0xff923020 /* 16 bit SCIF */ 117 122 # define SCSPTR1 0xff924020 /* 16 bit SCIF */ 118 123 # define SCSPTR2 0xff925020 /* 16 bit SCIF */ 119 124 # define SCIF_ORER 0x0001 /* overrun error bit */ 120 - # define SCSCR_INIT(port) 0x3c /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,cke=2 */ 121 125 #elif defined(CONFIG_CPU_SUBTYPE_SH7780) 122 126 # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ 123 127 # define SCSPTR1 0xffe10024 /* 16 bit SCIF */ 124 128 # define SCIF_ORER 0x0001 /* Overrun error bit */ 125 - 126 - #if defined(CONFIG_SH_SH2007) 127 - /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,CKE1=0 */ 128 - # define SCSCR_INIT(port) 0x38 129 - #else 130 - /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,CKE1=1 */ 131 - # define SCSCR_INIT(port) 0x3a 132 - #endif 133 - 134 129 #elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 135 130 defined(CONFIG_CPU_SUBTYPE_SH7786) 136 131 # define SCSPTR0 0xffea0024 /* 16 bit SCIF */ ··· 116 159 # define SCSPTR4 0xffee0024 /* 16 bit SCIF */ 117 160 # define SCSPTR5 0xffef0024 /* 16 bit SCIF */ 118 161 # define SCIF_ORER 0x0001 /* Overrun error bit */ 119 - # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 120 162 #elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \ 121 163 defined(CONFIG_CPU_SUBTYPE_SH7203) || \ 122 164 defined(CONFIG_CPU_SUBTYPE_SH7206) || \ ··· 130 174 # define SCSPTR6 0xfffeB020 /* 16 bit SCIF */ 131 175 # define SCSPTR7 0xfffeB820 /* 16 bit SCIF */ 132 176 # endif 133 - # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 134 177 #elif defined(CONFIG_CPU_SUBTYPE_SH7619) 135 178 # define SCSPTR0 0xf8400020 /* 16 bit SCIF */ 136 179 # define SCSPTR1 0xf8410020 /* 16 bit SCIF */ 137 180 # define SCSPTR2 0xf8420020 /* 16 bit SCIF */ 138 181 # define SCIF_ORER 0x0001 /* overrun error bit */ 139 - # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 140 182 #elif defined(CONFIG_CPU_SUBTYPE_SHX3) 141 183 # define SCSPTR0 0xffc30020 /* 16 bit SCIF */ 142 184 # define SCSPTR1 0xffc40020 /* 16 bit SCIF */ 143 185 # define SCSPTR2 0xffc50020 /* 16 bit SCIF */ 144 186 # define SCSPTR3 0xffc60020 /* 16 bit SCIF */ 145 187 # define SCIF_ORER 0x0001 /* Overrun error bit */ 146 - # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 147 188 #else 148 189 # error CPU subtype not defined 149 190 #endif 150 - 151 - /* SCSCR */ 152 - #define SCI_CTRL_FLAGS_TIE 0x80 /* all */ 153 - #define SCI_CTRL_FLAGS_RIE 0x40 /* all */ 154 - #define SCI_CTRL_FLAGS_TE 0x20 /* all */ 155 - #define SCI_CTRL_FLAGS_RE 0x10 /* all */ 156 - #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ 157 - defined(CONFIG_CPU_SUBTYPE_SH7091) || \ 158 - defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ 159 - defined(CONFIG_CPU_SUBTYPE_SH7722) || \ 160 - defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ 161 - defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 162 - defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ 163 - defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 164 - defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 165 - defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 166 - defined(CONFIG_CPU_SUBTYPE_SH7786) || \ 167 - defined(CONFIG_CPU_SUBTYPE_SHX3) 168 - #define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */ 169 - #elif defined(CONFIG_CPU_SUBTYPE_SH7724) 170 - #define SCI_CTRL_FLAGS_REIE ((port)->type == PORT_SCIFA ? 0 : 8) 171 - #else 172 - #define SCI_CTRL_FLAGS_REIE 0 173 - #endif 174 - /* SCI_CTRL_FLAGS_MPIE 0x08 * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */ 175 - /* SCI_CTRL_FLAGS_TEIE 0x04 * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */ 176 - /* SCI_CTRL_FLAGS_CKE1 0x02 * all */ 177 - /* SCI_CTRL_FLAGS_CKE0 0x01 * 7707 SCI/SCIF, 7708 SCI, 7709 SCI/SCIF, 7750 SCI */ 178 191 179 192 /* SCxSR SCI */ 180 193 #define SCI_TDRE 0x80 /* 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */ ··· 225 300 /* SCFCR */ 226 301 #define SCFCR_RFRST 0x0002 227 302 #define SCFCR_TFRST 0x0004 228 - #define SCFCR_TCRST 0x4000 229 303 #define SCFCR_MCE 0x0008 230 304 231 305 #define SCI_MAJOR 204 232 306 #define SCI_MINOR_START 8 233 - 234 - /* Generic serial flags */ 235 - #define SCI_RX_THROTTLE 0x0000001 236 - 237 - #define SCI_MAGIC 0xbabeface 238 - 239 - /* 240 - * Events are used to schedule things to happen at timer-interrupt 241 - * time, instead of at rs interrupt time. 242 - */ 243 - #define SCI_EVENT_WRITE_WAKEUP 0 244 307 245 308 #define SCI_IN(size, offset) \ 246 309 if ((size) == 8) { \ ··· 358 445 SCIF_FNS(SCSMR, 0x00, 16) 359 446 SCIF_FNS(SCBRR, 0x04, 8) 360 447 SCIF_FNS(SCSCR, 0x08, 16) 361 - SCIF_FNS(SCTDSR, 0x0c, 8) 362 - SCIF_FNS(SCFER, 0x10, 16) 363 448 SCIF_FNS(SCxSR, 0x14, 16) 364 449 SCIF_FNS(SCFCR, 0x18, 16) 365 450 SCIF_FNS(SCFDR, 0x1c, 16) ··· 387 476 SCIx_FNS(SCxSR, 0x14, 16, 0x10, 16) 388 477 SCIx_FNS(SCxRDR, 0x24, 8, 0x14, 8) 389 478 SCIx_FNS(SCSPTR, 0, 0, 0, 0) 390 - SCIF_FNS(SCTDSR, 0x0c, 8) 391 - SCIF_FNS(SCFER, 0x10, 16) 392 479 SCIF_FNS(SCFCR, 0x18, 16) 393 480 SCIF_FNS(SCFDR, 0x1c, 16) 394 481 SCIF_FNS(SCLSR, 0x24, 16) ··· 412 503 #elif defined(CONFIG_CPU_SUBTYPE_SH7763) 413 504 SCIF_FNS(SCFDR, 0, 0, 0x1C, 16) 414 505 SCIF_FNS(SCSPTR2, 0, 0, 0x20, 16) 415 - SCIF_FNS(SCLSR2, 0, 0, 0x24, 16) 416 506 SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16) 417 507 SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16) 418 508 SCIF_FNS(SCSPTR, 0, 0, 0x24, 16) ··· 504 596 { 505 597 return 1; 506 598 } 507 - #endif 508 - 509 - /* 510 - * Values for the BitRate Register (SCBRR) 511 - * 512 - * The values are actually divisors for a frequency which can 513 - * be internal to the SH3 (14.7456MHz) or derived from an external 514 - * clock source. This driver assumes the internal clock is used; 515 - * to support using an external clock source, config options or 516 - * possibly command-line options would need to be added. 517 - * 518 - * Also, to support speeds below 2400 (why?) the lower 2 bits of 519 - * the SCSMR register would also need to be set to non-zero values. 520 - * 521 - * -- Greg Banks 27Feb2000 522 - * 523 - * Answer: The SCBRR register is only eight bits, and the value in 524 - * it gets larger with lower baud rates. At around 2400 (depending on 525 - * the peripherial module clock) you run out of bits. However the 526 - * lower two bits of SCSMR allow the module clock to be divided down, 527 - * scaling the value which is needed in SCBRR. 528 - * 529 - * -- Stuart Menefy - 23 May 2000 530 - * 531 - * I meant, why would anyone bother with bitrates below 2400. 532 - * 533 - * -- Greg Banks - 7Jul2000 534 - * 535 - * You "speedist"! How will I use my 110bps ASR-33 teletype with paper 536 - * tape reader as a console! 537 - * 538 - * -- Mitch Davis - 15 Jul 2000 539 - */ 540 - 541 - #if (defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 542 - defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 543 - defined(CONFIG_CPU_SUBTYPE_SH7786)) && \ 544 - !defined(CONFIG_SH_SH2007) 545 - #define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1) 546 - #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 547 - defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 548 - defined(CONFIG_CPU_SUBTYPE_SH7721) || \ 549 - defined(CONFIG_ARCH_SH73A0) || \ 550 - defined(CONFIG_ARCH_SH7367) || \ 551 - defined(CONFIG_ARCH_SH7377) || \ 552 - defined(CONFIG_ARCH_SH7372) 553 - #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) 554 - #elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\ 555 - defined(CONFIG_CPU_SUBTYPE_SH7724) 556 - static inline int scbrr_calc(struct uart_port *port, int bps, int clk) 557 - { 558 - if (port->type == PORT_SCIF) 559 - return (clk+16*bps)/(32*bps)-1; 560 - else 561 - return ((clk*2)+16*bps)/(16*bps)-1; 562 - } 563 - #define SCBRR_VALUE(bps, clk) scbrr_calc(port, bps, clk) 564 - #elif defined(__H8300H__) || defined(__H8300S__) 565 - #define SCBRR_VALUE(bps, clk) (((clk*1000/32)/bps)-1) 566 - #else /* Generic SH */ 567 - #define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(32*bps)-1) 568 599 #endif
+22
include/linux/serial_sci.h
··· 8 8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) 9 9 */ 10 10 11 + enum { 12 + SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ 13 + SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ 14 + SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ 15 + SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ 16 + SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ 17 + }; 18 + 19 + #define SCSCR_TIE (1 << 7) 20 + #define SCSCR_RIE (1 << 6) 21 + #define SCSCR_TE (1 << 5) 22 + #define SCSCR_RE (1 << 4) 23 + #define SCSCR_REIE (1 << 3) /* not supported by all parts */ 24 + #define SCSCR_TOIE (1 << 2) /* not supported by all parts */ 25 + #define SCSCR_CKE1 (1 << 1) 26 + #define SCSCR_CKE0 (1 << 0) 27 + 11 28 /* Offsets into the sci_port->irqs array */ 12 29 enum { 13 30 SCIx_ERI_IRQ, ··· 46 29 unsigned int type; /* SCI / SCIF / IRDA */ 47 30 upf_t flags; /* UPF_* flags */ 48 31 char *clk; /* clock string */ 32 + 33 + unsigned int scbrr_algo_id; /* SCBRR calculation algo */ 34 + unsigned int scscr; /* SCSCR initialization */ 35 + 49 36 struct device *dma_dev; 37 + 50 38 #ifdef CONFIG_SERIAL_SH_SCI_DMA 51 39 unsigned int dma_slave_tx; 52 40 unsigned int dma_slave_rx;