Commit 6001985f92e4a99504343485bfe2c18940a41011

Authored by Alexander Graf
Committed by Tom Rini
1 parent 958d55f26c

bcm2835_pl011_serial: Add BCM2835 specific serial driver

On bcm2835 we need to ensure we only access serial devices that are
muxed to the serial output pins of the pin header. To achieve this
for the pl011 device, add a bcm2835 specific pl011 wrapper device
that does this check but otherwise behaves like a pl011 device.

Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 6 changed files with 101 additions and 9 deletions Inline Diff

1 Descriptions of section entries: 1 Descriptions of section entries:
2 2
3 P: Person (obsolete) 3 P: Person (obsolete)
4 M: Mail patches to: FullName <address@domain> 4 M: Mail patches to: FullName <address@domain>
5 L: Mailing list that is relevant to this area 5 L: Mailing list that is relevant to this area
6 W: Web-page with status/info 6 W: Web-page with status/info
7 Q: Patchwork web based patch tracking system site 7 Q: Patchwork web based patch tracking system site
8 T: SCM tree type and location. 8 T: SCM tree type and location.
9 Type is one of: git, hg, quilt, stgit, topgit 9 Type is one of: git, hg, quilt, stgit, topgit
10 S: Status, one of the following: 10 S: Status, one of the following:
11 Supported: Someone is actually paid to look after this. 11 Supported: Someone is actually paid to look after this.
12 Maintained: Someone actually looks after it. 12 Maintained: Someone actually looks after it.
13 Odd Fixes: It has a maintainer but they don't have time to do 13 Odd Fixes: It has a maintainer but they don't have time to do
14 much other than throw the odd patch in. See below.. 14 much other than throw the odd patch in. See below..
15 Orphan: No current maintainer [but maybe you could take the 15 Orphan: No current maintainer [but maybe you could take the
16 role as you write your new code]. 16 role as you write your new code].
17 Obsolete: Old code. Something tagged obsolete generally means 17 Obsolete: Old code. Something tagged obsolete generally means
18 it has been replaced by a better system and you 18 it has been replaced by a better system and you
19 should be using that. 19 should be using that.
20 F: Files and directories with wildcard patterns. 20 F: Files and directories with wildcard patterns.
21 A trailing slash includes all files and subdirectory files. 21 A trailing slash includes all files and subdirectory files.
22 F: drivers/net/ all files in and below drivers/net 22 F: drivers/net/ all files in and below drivers/net
23 F: drivers/net/* all files in drivers/net, but not below 23 F: drivers/net/* all files in drivers/net, but not below
24 F: */net/* all files in "any top level directory"/net 24 F: */net/* all files in "any top level directory"/net
25 One pattern per line. Multiple F: lines acceptable. 25 One pattern per line. Multiple F: lines acceptable.
26 N: Files and directories with regex patterns. 26 N: Files and directories with regex patterns.
27 N: [^a-z]tegra all files whose path contains the word tegra 27 N: [^a-z]tegra all files whose path contains the word tegra
28 One pattern per line. Multiple N: lines acceptable. 28 One pattern per line. Multiple N: lines acceptable.
29 scripts/get_maintainer.pl has different behavior for files that 29 scripts/get_maintainer.pl has different behavior for files that
30 match F: pattern and matches of N: patterns. By default, 30 match F: pattern and matches of N: patterns. By default,
31 get_maintainer will not look at git log history when an F: pattern 31 get_maintainer will not look at git log history when an F: pattern
32 match occurs. When an N: match occurs, git log history is used 32 match occurs. When an N: match occurs, git log history is used
33 to also notify the people that have git commit signatures. 33 to also notify the people that have git commit signatures.
34 X: Files and directories that are NOT maintained, same rules as F: 34 X: Files and directories that are NOT maintained, same rules as F:
35 Files exclusions are tested before file matches. 35 Files exclusions are tested before file matches.
36 Can be useful for excluding a specific subdirectory, for instance: 36 Can be useful for excluding a specific subdirectory, for instance:
37 F: net/ 37 F: net/
38 X: net/ipv6/ 38 X: net/ipv6/
39 matches all files in and below net excluding net/ipv6/ 39 matches all files in and below net excluding net/ipv6/
40 K: Keyword perl extended regex pattern to match content in a 40 K: Keyword perl extended regex pattern to match content in a
41 patch or file. For instance: 41 patch or file. For instance:
42 K: of_get_profile 42 K: of_get_profile
43 matches patches or files that contain "of_get_profile" 43 matches patches or files that contain "of_get_profile"
44 K: \b(printk|pr_(info|err))\b 44 K: \b(printk|pr_(info|err))\b
45 matches patches or files that contain one or more of the words 45 matches patches or files that contain one or more of the words
46 printk, pr_info or pr_err 46 printk, pr_info or pr_err
47 One regex pattern per line. Multiple K: lines acceptable. 47 One regex pattern per line. Multiple K: lines acceptable.
48 48
49 Note: For the hard of thinking, this list is meant to remain in alphabetical 49 Note: For the hard of thinking, this list is meant to remain in alphabetical
50 order. If you could add yourselves to it in alphabetical order that would be 50 order. If you could add yourselves to it in alphabetical order that would be
51 so much easier [Ed] 51 so much easier [Ed]
52 52
53 Maintainers List (try to look for most precise areas first) 53 Maintainers List (try to look for most precise areas first)
54 54
55 ----------------------------------- 55 -----------------------------------
56 ARC 56 ARC
57 M: Alexey Brodkin <alexey.brodkin@synopsys.com> 57 M: Alexey Brodkin <alexey.brodkin@synopsys.com>
58 S: Maintained 58 S: Maintained
59 T: git git://git.denx.de/u-boot-arc.git 59 T: git git://git.denx.de/u-boot-arc.git
60 F: arch/arc/ 60 F: arch/arc/
61 61
62 ARC HSDK CREG GPIO 62 ARC HSDK CREG GPIO
63 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> 63 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
64 S: Maintained 64 S: Maintained
65 L: uboot-snps-arc@synopsys.com 65 L: uboot-snps-arc@synopsys.com
66 F: drivers/gpio/hsdk-creg-gpio.c 66 F: drivers/gpio/hsdk-creg-gpio.c
67 67
68 ARC HSDK CGU CLOCK 68 ARC HSDK CGU CLOCK
69 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> 69 M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
70 S: Maintained 70 S: Maintained
71 L: uboot-snps-arc@synopsys.com 71 L: uboot-snps-arc@synopsys.com
72 F: drivers/clk/clk-hsdk-cgu.c 72 F: drivers/clk/clk-hsdk-cgu.c
73 F: include/dt-bindings/clock/snps,hsdk-cgu.h 73 F: include/dt-bindings/clock/snps,hsdk-cgu.h
74 F: doc/device-tree-bindings/clock/snps,hsdk-cgu.txt 74 F: doc/device-tree-bindings/clock/snps,hsdk-cgu.txt
75 75
76 ARM 76 ARM
77 M: Albert Aribaud <albert.u.boot@aribaud.net> 77 M: Albert Aribaud <albert.u.boot@aribaud.net>
78 S: Maintained 78 S: Maintained
79 T: git git://git.denx.de/u-boot-arm.git 79 T: git git://git.denx.de/u-boot-arm.git
80 F: arch/arm/ 80 F: arch/arm/
81 81
82 ARM ALTERA SOCFPGA 82 ARM ALTERA SOCFPGA
83 M: Marek Vasut <marex@denx.de> 83 M: Marek Vasut <marex@denx.de>
84 S: Maintainted 84 S: Maintainted
85 T: git git://git.denx.de/u-boot-socfpga.git 85 T: git git://git.denx.de/u-boot-socfpga.git
86 F: arch/arm/mach-socfpga/ 86 F: arch/arm/mach-socfpga/
87 87
88 ARM ATMEL AT91 88 ARM ATMEL AT91
89 M: Andreas Bießmann <andreas@biessmann.org> 89 M: Andreas Bießmann <andreas@biessmann.org>
90 S: Maintained 90 S: Maintained
91 T: git git://git.denx.de/u-boot-atmel.git 91 T: git git://git.denx.de/u-boot-atmel.git
92 F: arch/arm/mach-at91/ 92 F: arch/arm/mach-at91/
93 93
94 ARM BROADCOM BCM283X 94 ARM BROADCOM BCM283X
95 M: Alexander Graf <agraf@suse.de> 95 M: Alexander Graf <agraf@suse.de>
96 S: Maintained 96 S: Maintained
97 F: arch/arm/mach-bcm283x/ 97 F: arch/arm/mach-bcm283x/
98 F: drivers/gpio/bcm2835_gpio.c 98 F: drivers/gpio/bcm2835_gpio.c
99 F: drivers/mmc/bcm2835_sdhci.c 99 F: drivers/mmc/bcm2835_sdhci.c
100 F: drivers/mmc/bcm2835_sdhost.c 100 F: drivers/mmc/bcm2835_sdhost.c
101 F: drivers/serial/serial_bcm283x_mu.c 101 F: drivers/serial/serial_bcm283x_mu.c
102 F: drivers/serial/serial_bcm283x_pl011.c
102 F: drivers/video/bcm2835.c 103 F: drivers/video/bcm2835.c
103 F: include/dm/platform_data/serial_bcm283x_mu.h 104 F: include/dm/platform_data/serial_bcm283x_mu.h
104 F: drivers/pinctrl/broadcom/ 105 F: drivers/pinctrl/broadcom/
105 106
106 ARM FREESCALE IMX 107 ARM FREESCALE IMX
107 M: Stefano Babic <sbabic@denx.de> 108 M: Stefano Babic <sbabic@denx.de>
108 M: Fabio Estevam <fabio.estevam@nxp.com> 109 M: Fabio Estevam <fabio.estevam@nxp.com>
109 S: Maintained 110 S: Maintained
110 T: git git://git.denx.de/u-boot-imx.git 111 T: git git://git.denx.de/u-boot-imx.git
111 F: arch/arm/cpu/arm1136/mx*/ 112 F: arch/arm/cpu/arm1136/mx*/
112 F: arch/arm/cpu/arm926ejs/mx*/ 113 F: arch/arm/cpu/arm926ejs/mx*/
113 F: arch/arm/cpu/armv7/mx*/ 114 F: arch/arm/cpu/armv7/mx*/
114 F: arch/arm/cpu/armv7/vf610/ 115 F: arch/arm/cpu/armv7/vf610/
115 F: arch/arm/mach-imx/ 116 F: arch/arm/mach-imx/
116 F: arch/arm/include/asm/arch-imx/ 117 F: arch/arm/include/asm/arch-imx/
117 F: arch/arm/include/asm/arch-mx*/ 118 F: arch/arm/include/asm/arch-mx*/
118 F: arch/arm/include/asm/arch-vf610/ 119 F: arch/arm/include/asm/arch-vf610/
119 F: arch/arm/include/asm/mach-imx/ 120 F: arch/arm/include/asm/mach-imx/
120 F: board/freescale/*mx*/ 121 F: board/freescale/*mx*/
121 122
122 ARM HISILICON 123 ARM HISILICON
123 M: Peter Griffin <peter.griffin@linaro.org> 124 M: Peter Griffin <peter.griffin@linaro.org>
124 S: Maintained 125 S: Maintained
125 F: arch/arm/cpu/armv8/hisilicon 126 F: arch/arm/cpu/armv8/hisilicon
126 F: arm/include/asm/arch-hi6220/ 127 F: arm/include/asm/arch-hi6220/
127 128
128 ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X 129 ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X
129 M: Prafulla Wadaskar <prafulla@marvell.com> 130 M: Prafulla Wadaskar <prafulla@marvell.com>
130 M: Luka Perkov <luka.perkov@sartura.hr> 131 M: Luka Perkov <luka.perkov@sartura.hr>
131 M: Stefan Roese <sr@denx.de> 132 M: Stefan Roese <sr@denx.de>
132 S: Maintained 133 S: Maintained
133 T: git git://git.denx.de/u-boot-marvell.git 134 T: git git://git.denx.de/u-boot-marvell.git
134 F: arch/arm/mach-kirkwood/ 135 F: arch/arm/mach-kirkwood/
135 F: arch/arm/mach-mvebu/ 136 F: arch/arm/mach-mvebu/
136 137
137 ARM MARVELL PXA 138 ARM MARVELL PXA
138 M: Marek Vasut <marex@denx.de> 139 M: Marek Vasut <marex@denx.de>
139 S: Maintained 140 S: Maintained
140 T: git git://git.denx.de/u-boot-pxa.git 141 T: git git://git.denx.de/u-boot-pxa.git
141 F: arch/arm/cpu/pxa/ 142 F: arch/arm/cpu/pxa/
142 F: arch/arm/include/asm/arch-pxa/ 143 F: arch/arm/include/asm/arch-pxa/
143 144
144 ARM RENESAS RMOBILE/R-CAR 145 ARM RENESAS RMOBILE/R-CAR
145 M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> 146 M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
146 M: Marek Vasut <marek.vasut+renesas@gmail.com> 147 M: Marek Vasut <marek.vasut+renesas@gmail.com>
147 S: Maintained 148 S: Maintained
148 T: git git://git.denx.de/u-boot-sh.git 149 T: git git://git.denx.de/u-boot-sh.git
149 F: arch/arm/mach-rmobile/ 150 F: arch/arm/mach-rmobile/
150 151
151 ARM ROCKCHIP 152 ARM ROCKCHIP
152 M: Simon Glass <sjg@chromium.org> 153 M: Simon Glass <sjg@chromium.org>
153 M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> 154 M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
154 S: Maintained 155 S: Maintained
155 T: git git://git.denx.de/u-boot-rockchip.git 156 T: git git://git.denx.de/u-boot-rockchip.git
156 F: arch/arm/include/asm/arch-rockchip/ 157 F: arch/arm/include/asm/arch-rockchip/
157 F: arch/arm/mach-rockchip/ 158 F: arch/arm/mach-rockchip/
158 F: board/rockchip/ 159 F: board/rockchip/
159 F: drivers/clk/rockchip/ 160 F: drivers/clk/rockchip/
160 F: drivers/gpio/rk_gpio.c 161 F: drivers/gpio/rk_gpio.c
161 F: drivers/misc/rockchip-efuse.c 162 F: drivers/misc/rockchip-efuse.c
162 F: drivers/pinctrl/rockchip/ 163 F: drivers/pinctrl/rockchip/
163 F: drivers/ram/rockchip/ 164 F: drivers/ram/rockchip/
164 F: drivers/sysreset/sysreset_rockchip.c 165 F: drivers/sysreset/sysreset_rockchip.c
165 F: tools/rkcommon.c 166 F: tools/rkcommon.c
166 F: tools/rkcommon.h 167 F: tools/rkcommon.h
167 F: tools/rkimage.c 168 F: tools/rkimage.c
168 F: tools/rksd.c 169 F: tools/rksd.c
169 F: tools/rkspi.c 170 F: tools/rkspi.c
170 171
171 ARM SAMSUNG 172 ARM SAMSUNG
172 M: Minkyu Kang <mk7.kang@samsung.com> 173 M: Minkyu Kang <mk7.kang@samsung.com>
173 S: Maintained 174 S: Maintained
174 T: git git://git.denx.de/u-boot-samsung.git 175 T: git git://git.denx.de/u-boot-samsung.git
175 F: arch/arm/cpu/arm920t/s3c24x0/ 176 F: arch/arm/cpu/arm920t/s3c24x0/
176 F: arch/arm/mach-exynos/ 177 F: arch/arm/mach-exynos/
177 F: arch/arm/mach-s5pc1xx/ 178 F: arch/arm/mach-s5pc1xx/
178 F: arch/arm/cpu/armv7/s5p-common/ 179 F: arch/arm/cpu/armv7/s5p-common/
179 F: arch/arm/include/asm/arch-s3c24x0/ 180 F: arch/arm/include/asm/arch-s3c24x0/
180 181
181 ARM SNAPDRAGON 182 ARM SNAPDRAGON
182 M: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> 183 M: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
183 S: Maintained 184 S: Maintained
184 F: arch/arm/mach-snapdragon/ 185 F: arch/arm/mach-snapdragon/
185 186
186 ARM STM SPEAR 187 ARM STM SPEAR
187 #M: Vipin Kumar <vipin.kumar@st.com> 188 #M: Vipin Kumar <vipin.kumar@st.com>
188 S: Orphaned (Since 2016-02) 189 S: Orphaned (Since 2016-02)
189 T: git git://git.denx.de/u-boot-stm.git 190 T: git git://git.denx.de/u-boot-stm.git
190 F: arch/arm/cpu/arm926ejs/spear/ 191 F: arch/arm/cpu/arm926ejs/spear/
191 F: arch/arm/include/asm/arch-spear/ 192 F: arch/arm/include/asm/arch-spear/
192 193
193 ARM STM STV0991 194 ARM STM STV0991
194 M: Vikas Manocha <vikas.manocha@st.com> 195 M: Vikas Manocha <vikas.manocha@st.com>
195 S: Maintained 196 S: Maintained
196 F: arch/arm/cpu/armv7/stv0991/ 197 F: arch/arm/cpu/armv7/stv0991/
197 F: arch/arm/include/asm/arch-stv0991/ 198 F: arch/arm/include/asm/arch-stv0991/
198 199
199 ARM STI 200 ARM STI
200 M: Patrice Chotard <patrice.chotard@st.com> 201 M: Patrice Chotard <patrice.chotard@st.com>
201 S: Maintained 202 S: Maintained
202 F: arch/arm/mach-sti/ 203 F: arch/arm/mach-sti/
203 F: arch/arm/include/asm/arch-sti*/ 204 F: arch/arm/include/asm/arch-sti*/
204 205
205 ARM SUNXI 206 ARM SUNXI
206 M: Jagan Teki <jagan@openedev.com> 207 M: Jagan Teki <jagan@openedev.com>
207 M: Maxime Ripard <maxime.ripard@free-electrons.com> 208 M: Maxime Ripard <maxime.ripard@free-electrons.com>
208 S: Maintained 209 S: Maintained
209 T: git git://git.denx.de/u-boot-sunxi.git 210 T: git git://git.denx.de/u-boot-sunxi.git
210 F: arch/arm/cpu/armv7/sunxi/ 211 F: arch/arm/cpu/armv7/sunxi/
211 F: arch/arm/include/asm/arch-sunxi/ 212 F: arch/arm/include/asm/arch-sunxi/
212 F: arch/arm/mach-sunxi/ 213 F: arch/arm/mach-sunxi/
213 F: board/sunxi/ 214 F: board/sunxi/
214 215
215 ARM TEGRA 216 ARM TEGRA
216 M: Tom Warren <twarren@nvidia.com> 217 M: Tom Warren <twarren@nvidia.com>
217 S: Maintained 218 S: Maintained
218 T: git git://git.denx.de/u-boot-tegra.git 219 T: git git://git.denx.de/u-boot-tegra.git
219 F: arch/arm/mach-tegra/ 220 F: arch/arm/mach-tegra/
220 F: arch/arm/include/asm/arch-tegra*/ 221 F: arch/arm/include/asm/arch-tegra*/
221 222
222 ARM TI 223 ARM TI
223 M: Tom Rini <trini@konsulko.com> 224 M: Tom Rini <trini@konsulko.com>
224 S: Maintained 225 S: Maintained
225 T: git git://git.denx.de/u-boot-ti.git 226 T: git git://git.denx.de/u-boot-ti.git
226 F: arch/arm/mach-davinci/ 227 F: arch/arm/mach-davinci/
227 F: arch/arm/mach-keystone/ 228 F: arch/arm/mach-keystone/
228 F: arch/arm/cpu/arm926ejs/omap/ 229 F: arch/arm/cpu/arm926ejs/omap/
229 F: arch/arm/cpu/armv7/omap*/ 230 F: arch/arm/cpu/armv7/omap*/
230 F: arch/arm/include/asm/arch-omap*/ 231 F: arch/arm/include/asm/arch-omap*/
231 F: arch/arm/include/asm/ti-common/ 232 F: arch/arm/include/asm/ti-common/
232 233
233 ARM UNIPHIER 234 ARM UNIPHIER
234 M: Masahiro Yamada <yamada.masahiro@socionext.com> 235 M: Masahiro Yamada <yamada.masahiro@socionext.com>
235 S: Maintained 236 S: Maintained
236 T: git git://git.denx.de/u-boot-uniphier.git 237 T: git git://git.denx.de/u-boot-uniphier.git
237 F: arch/arm/mach-uniphier/ 238 F: arch/arm/mach-uniphier/
238 F: configs/uniphier_*_defconfig 239 F: configs/uniphier_*_defconfig
239 N: uniphier 240 N: uniphier
240 241
241 ARM ZYNQ 242 ARM ZYNQ
242 M: Michal Simek <monstr@monstr.eu> 243 M: Michal Simek <monstr@monstr.eu>
243 S: Maintained 244 S: Maintained
244 F: arch/arm/cpu/armv7/zynq/ 245 F: arch/arm/cpu/armv7/zynq/
245 F: arch/arm/include/asm/arch-zynq/ 246 F: arch/arm/include/asm/arch-zynq/
246 247
247 ARM ZYNQMP 248 ARM ZYNQMP
248 M: Michal Simek <michal.simek@xilinx.com> 249 M: Michal Simek <michal.simek@xilinx.com>
249 S: Maintained 250 S: Maintained
250 F: arch/arm/cpu/armv8/zynqmp/ 251 F: arch/arm/cpu/armv8/zynqmp/
251 F: arch/arm/include/asm/arch-zynqmp/ 252 F: arch/arm/include/asm/arch-zynqmp/
252 253
253 BUILDMAN 254 BUILDMAN
254 M: Simon Glass <sjg@chromium.org> 255 M: Simon Glass <sjg@chromium.org>
255 S: Maintained 256 S: Maintained
256 F: tools/buildman/ 257 F: tools/buildman/
257 258
258 CFI FLASH 259 CFI FLASH
259 M: Stefan Roese <sr@denx.de> 260 M: Stefan Roese <sr@denx.de>
260 S: Maintained 261 S: Maintained
261 T: git git://git.denx.de/u-boot-cfi-flash.git 262 T: git git://git.denx.de/u-boot-cfi-flash.git
262 F: drivers/mtd/cfi_flash.c 263 F: drivers/mtd/cfi_flash.c
263 F: drivers/mtd/jedec_flash.c 264 F: drivers/mtd/jedec_flash.c
264 265
265 COLDFIRE 266 COLDFIRE
266 M: Huan Wang <alison.wang@freescale.com> 267 M: Huan Wang <alison.wang@freescale.com>
267 M: Angelo Dureghello <angelo@sysam.it> 268 M: Angelo Dureghello <angelo@sysam.it>
268 S: Maintained 269 S: Maintained
269 T: git git://git.denx.de/u-boot-coldfire.git 270 T: git git://git.denx.de/u-boot-coldfire.git
270 F: arch/m68k/ 271 F: arch/m68k/
271 272
272 DFU 273 DFU
273 M: Lukasz Majewski <lukma@denx.de> 274 M: Lukasz Majewski <lukma@denx.de>
274 S: Maintained 275 S: Maintained
275 T: git git://git.denx.de/u-boot-dfu.git 276 T: git git://git.denx.de/u-boot-dfu.git
276 F: drivers/dfu/ 277 F: drivers/dfu/
277 F: drivers/usb/gadget/ 278 F: drivers/usb/gadget/
278 279
279 DRIVER MODEL 280 DRIVER MODEL
280 M: Simon Glass <sjg@chromium.org> 281 M: Simon Glass <sjg@chromium.org>
281 S: Maintained 282 S: Maintained
282 T: git git://git.denx.de/u-boot-dm.git 283 T: git git://git.denx.de/u-boot-dm.git
283 F: drivers/core/ 284 F: drivers/core/
284 F: include/dm/ 285 F: include/dm/
285 F: test/dm/ 286 F: test/dm/
286 287
287 EFI PAYLOAD 288 EFI PAYLOAD
288 M: Alexander Graf <agraf@suse.de> 289 M: Alexander Graf <agraf@suse.de>
289 S: Maintained 290 S: Maintained
290 T: git git://github.com/agraf/u-boot.git 291 T: git git://github.com/agraf/u-boot.git
291 F: include/efi* 292 F: include/efi*
292 F: lib/efi*/ 293 F: lib/efi*/
293 F: test/py/tests/test_efi* 294 F: test/py/tests/test_efi*
294 F: cmd/bootefi.c 295 F: cmd/bootefi.c
295 F: tools/file2include.c 296 F: tools/file2include.c
296 297
297 FLATTENED DEVICE TREE 298 FLATTENED DEVICE TREE
298 M: Simon Glass <sjg@chromium.org> 299 M: Simon Glass <sjg@chromium.org>
299 S: Maintained 300 S: Maintained
300 T: git git://git.denx.de/u-boot-fdt.git 301 T: git git://git.denx.de/u-boot-fdt.git
301 F: lib/fdtdec* 302 F: lib/fdtdec*
302 F: lib/libfdt/ 303 F: lib/libfdt/
303 F: include/fdt* 304 F: include/fdt*
304 F: include/libfdt* 305 F: include/libfdt*
305 F: cmd/fdt.c 306 F: cmd/fdt.c
306 F: common/fdt_support.c 307 F: common/fdt_support.c
307 308
308 FREEBSD 309 FREEBSD
309 M: Rafal Jaworowski <raj@semihalf.com> 310 M: Rafal Jaworowski <raj@semihalf.com>
310 S: Maintained 311 S: Maintained
311 T: git git://git.denx.de/u-boot-freebsd.git 312 T: git git://git.denx.de/u-boot-freebsd.git
312 313
313 FREESCALE QORIQ 314 FREESCALE QORIQ
314 M: York Sun <york.sun@nxp.com> 315 M: York Sun <york.sun@nxp.com>
315 S: Maintained 316 S: Maintained
316 T: git git://git.denx.de/u-boot-fsl-qoriq.git 317 T: git git://git.denx.de/u-boot-fsl-qoriq.git
317 318
318 I2C 319 I2C
319 M: Heiko Schocher <hs@denx.de> 320 M: Heiko Schocher <hs@denx.de>
320 S: Maintained 321 S: Maintained
321 T: git git://git.denx.de/u-boot-i2c.git 322 T: git git://git.denx.de/u-boot-i2c.git
322 F: drivers/i2c/ 323 F: drivers/i2c/
323 324
324 LOGGING 325 LOGGING
325 M: Simon Glass <sjg@chromium.org> 326 M: Simon Glass <sjg@chromium.org>
326 S: Maintained 327 S: Maintained
327 T: git git://git.denx.de/u-boot.git 328 T: git git://git.denx.de/u-boot.git
328 F: common/log.c 329 F: common/log.c
329 F: cmd/log.c 330 F: cmd/log.c
330 F: test/log/log_test.c 331 F: test/log/log_test.c
331 F: test/py/tests/test_log.py 332 F: test/py/tests/test_log.py
332 333
333 MICROBLAZE 334 MICROBLAZE
334 M: Michal Simek <monstr@monstr.eu> 335 M: Michal Simek <monstr@monstr.eu>
335 S: Maintained 336 S: Maintained
336 T: git git://git.denx.de/u-boot-microblaze.git 337 T: git git://git.denx.de/u-boot-microblaze.git
337 F: arch/microblaze/ 338 F: arch/microblaze/
338 339
339 MIPS 340 MIPS
340 M: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> 341 M: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
341 S: Maintained 342 S: Maintained
342 T: git git://git.denx.de/u-boot-mips.git 343 T: git git://git.denx.de/u-boot-mips.git
343 F: arch/mips/ 344 F: arch/mips/
344 345
345 MMC 346 MMC
346 M: Jaehoon Chung <jh80.chung@samsung.com> 347 M: Jaehoon Chung <jh80.chung@samsung.com>
347 S: Maintained 348 S: Maintained
348 T: git git://git.denx.de/u-boot-mmc.git 349 T: git git://git.denx.de/u-boot-mmc.git
349 F: drivers/mmc/ 350 F: drivers/mmc/
350 351
351 PATMAN 352 PATMAN
352 M: Simon Glass <sjg@chromium.org> 353 M: Simon Glass <sjg@chromium.org>
353 S: Maintained 354 S: Maintained
354 F: tools/patman/ 355 F: tools/patman/
355 356
356 POWERPC 357 POWERPC
357 M: Wolfgang Denk <wd@denx.de> 358 M: Wolfgang Denk <wd@denx.de>
358 S: Maintained 359 S: Maintained
359 F: arch/powerpc/ 360 F: arch/powerpc/
360 361
361 POWERPC MPC8XX 362 POWERPC MPC8XX
362 M: Christophe Leroy <christophe.leroy@c-s.fr> 363 M: Christophe Leroy <christophe.leroy@c-s.fr>
363 S: Maintained 364 S: Maintained
364 T: git git://git.denx.de/u-boot-mpc8xx.git 365 T: git git://git.denx.de/u-boot-mpc8xx.git
365 F: arch/powerpc/cpu/mpc8xx/ 366 F: arch/powerpc/cpu/mpc8xx/
366 367
367 POWERPC MPC83XX 368 POWERPC MPC83XX
368 M: Mario Six <mario.six@gdsys.cc> 369 M: Mario Six <mario.six@gdsys.cc>
369 S: Maintained 370 S: Maintained
370 T: git git://git.denx.de/u-boot-mpc83xx.git 371 T: git git://git.denx.de/u-boot-mpc83xx.git
371 F: arch/powerpc/cpu/mpc83xx/ 372 F: arch/powerpc/cpu/mpc83xx/
372 F: arch/powerpc/include/asm/arch-mpc83xx/ 373 F: arch/powerpc/include/asm/arch-mpc83xx/
373 374
374 POWERPC MPC85XX 375 POWERPC MPC85XX
375 M: York Sun <york.sun@nxp.com> 376 M: York Sun <york.sun@nxp.com>
376 S: Maintained 377 S: Maintained
377 T: git git://git.denx.de/u-boot-mpc85xx.git 378 T: git git://git.denx.de/u-boot-mpc85xx.git
378 F: arch/powerpc/cpu/mpc85xx/ 379 F: arch/powerpc/cpu/mpc85xx/
379 380
380 POWERPC MPC86XX 381 POWERPC MPC86XX
381 M: York Sun <york.sun@nxp.com> 382 M: York Sun <york.sun@nxp.com>
382 S: Maintained 383 S: Maintained
383 T: git git://git.denx.de/u-boot-mpc86xx.git 384 T: git git://git.denx.de/u-boot-mpc86xx.git
384 F: arch/powerpc/cpu/mpc86xx/ 385 F: arch/powerpc/cpu/mpc86xx/
385 386
386 POWERPC PPC4XX 387 POWERPC PPC4XX
387 M: Stefan Roese <sr@denx.de> 388 M: Stefan Roese <sr@denx.de>
388 S: Maintained 389 S: Maintained
389 T: git git://git.denx.de/u-boot-ppc4xx.git 390 T: git git://git.denx.de/u-boot-ppc4xx.git
390 F: arch/powerpc/cpu/ppc4xx/ 391 F: arch/powerpc/cpu/ppc4xx/
391 392
392 POWER 393 POWER
393 M: Jaehoon Chung <jh80.chung@samsung.com> 394 M: Jaehoon Chung <jh80.chung@samsung.com>
394 S: Maintained 395 S: Maintained
395 T: git git://git.denx.de/u-boot-pmic.git 396 T: git git://git.denx.de/u-boot-pmic.git
396 F: drivers/power/ 397 F: drivers/power/
397 398
398 NETWORK 399 NETWORK
399 M: Joe Hershberger <joe.hershberger@ni.com> 400 M: Joe Hershberger <joe.hershberger@ni.com>
400 S: Maintained 401 S: Maintained
401 T: git git://git.denx.de/u-boot-net.git 402 T: git git://git.denx.de/u-boot-net.git
402 F: drivers/net/ 403 F: drivers/net/
403 F: net/ 404 F: net/
404 405
405 NAND FLASH 406 NAND FLASH
406 M: Scott Wood <oss@buserror.net> 407 M: Scott Wood <oss@buserror.net>
407 S: Maintained 408 S: Maintained
408 T: git git://git.denx.de/u-boot-nand-flash.git 409 T: git git://git.denx.de/u-boot-nand-flash.git
409 F: drivers/mtd/nand/ 410 F: drivers/mtd/nand/
410 411
411 NDS32 412 NDS32
412 M: Macpaul Lin <macpaul@andestech.com> 413 M: Macpaul Lin <macpaul@andestech.com>
413 S: Maintained 414 S: Maintained
414 T: git git://git.denx.de/u-boot-nds32.git 415 T: git git://git.denx.de/u-boot-nds32.git
415 F: arch/nds32/ 416 F: arch/nds32/
416 417
417 NIOS 418 NIOS
418 M: Thomas Chou <thomas@wytron.com.tw> 419 M: Thomas Chou <thomas@wytron.com.tw>
419 S: Maintained 420 S: Maintained
420 T: git git://git.denx.de/u-boot-nios.git 421 T: git git://git.denx.de/u-boot-nios.git
421 F: arch/nios2/ 422 F: arch/nios2/
422 423
423 ONENAND 424 ONENAND
424 #M: Lukasz Majewski <l.majewski@majess.pl> 425 #M: Lukasz Majewski <l.majewski@majess.pl>
425 S: Orphaned (Since 2017-01) 426 S: Orphaned (Since 2017-01)
426 T: git git://git.denx.de/u-boot-onenand.git 427 T: git git://git.denx.de/u-boot-onenand.git
427 F: drivers/mtd/onenand/ 428 F: drivers/mtd/onenand/
428 429
429 RISC-V 430 RISC-V
430 M: Rick Chen <rick@andestech.com> 431 M: Rick Chen <rick@andestech.com>
431 S: Maintained 432 S: Maintained
432 T: git git://git.denx.de/u-boot-riscv.git 433 T: git git://git.denx.de/u-boot-riscv.git
433 F: arch/riscv/ 434 F: arch/riscv/
434 F: tools/prelink-riscv.c 435 F: tools/prelink-riscv.c
435 436
436 SANDBOX 437 SANDBOX
437 M: Simon Glass <sjg@chromium.org> 438 M: Simon Glass <sjg@chromium.org>
438 S: Maintained 439 S: Maintained
439 F: arch/sandbox/ 440 F: arch/sandbox/
440 441
441 SH 442 SH
442 M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> 443 M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
443 S: Maintained 444 S: Maintained
444 T: git git://git.denx.de/u-boot-sh.git 445 T: git git://git.denx.de/u-boot-sh.git
445 F: arch/sh/ 446 F: arch/sh/
446 447
447 SPI 448 SPI
448 M: Jagan Teki <jagan@openedev.com> 449 M: Jagan Teki <jagan@openedev.com>
449 S: Maintained 450 S: Maintained
450 T: git git://git.denx.de/u-boot-spi.git 451 T: git git://git.denx.de/u-boot-spi.git
451 F: drivers/mtd/spi/ 452 F: drivers/mtd/spi/
452 F: drivers/spi/ 453 F: drivers/spi/
453 F: include/spi* 454 F: include/spi*
454 455
455 SPMI 456 SPMI
456 M: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> 457 M: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
457 S: Maintained 458 S: Maintained
458 F: drivers/spmi/ 459 F: drivers/spmi/
459 F: include/spmi/ 460 F: include/spmi/
460 461
461 TI SYSTEM SECURITY 462 TI SYSTEM SECURITY
462 M: Andrew F. Davis <afd@ti.com> 463 M: Andrew F. Davis <afd@ti.com>
463 S: Supported 464 S: Supported
464 F: arch/arm/mach-omap2/omap5/sec_entry_cpu1.S 465 F: arch/arm/mach-omap2/omap5/sec_entry_cpu1.S
465 F: arch/arm/mach-omap2/omap5/sec-fxns.c 466 F: arch/arm/mach-omap2/omap5/sec-fxns.c
466 F: arch/arm/mach-omap2/sec-common.c 467 F: arch/arm/mach-omap2/sec-common.c
467 F: arch/arm/mach-omap2/config_secure.mk 468 F: arch/arm/mach-omap2/config_secure.mk
468 F: configs/am335x_hs_evm_defconfig 469 F: configs/am335x_hs_evm_defconfig
469 F: configs/am335x_hs_evm_uart_defconfig 470 F: configs/am335x_hs_evm_uart_defconfig
470 F: configs/am43xx_hs_evm_defconfig 471 F: configs/am43xx_hs_evm_defconfig
471 F: configs/am57xx_hs_evm_defconfig 472 F: configs/am57xx_hs_evm_defconfig
472 F: configs/dra7xx_hs_evm_defconfig 473 F: configs/dra7xx_hs_evm_defconfig
473 F: configs/k2hk_hs_evm_defconfig 474 F: configs/k2hk_hs_evm_defconfig
474 F: configs/k2e_hs_evm_defconfig 475 F: configs/k2e_hs_evm_defconfig
475 F: configs/k2g_hs_evm_defconfig 476 F: configs/k2g_hs_evm_defconfig
476 477
477 TQ GROUP 478 TQ GROUP
478 #M: Martin Krause <martin.krause@tq-systems.de> 479 #M: Martin Krause <martin.krause@tq-systems.de>
479 S: Orphaned (Since 2016-02) 480 S: Orphaned (Since 2016-02)
480 T: git git://git.denx.de/u-boot-tq-group.git 481 T: git git://git.denx.de/u-boot-tq-group.git
481 482
482 UBI 483 UBI
483 M: Kyungmin Park <kmpark@infradead.org> 484 M: Kyungmin Park <kmpark@infradead.org>
484 M: Heiko Schocher <hs@denx.de> 485 M: Heiko Schocher <hs@denx.de>
485 S: Maintained 486 S: Maintained
486 T: git git://git.denx.de/u-boot-ubi.git 487 T: git git://git.denx.de/u-boot-ubi.git
487 F: drivers/mtd/ubi/ 488 F: drivers/mtd/ubi/
488 489
489 USB 490 USB
490 M: Marek Vasut <marex@denx.de> 491 M: Marek Vasut <marex@denx.de>
491 S: Maintained 492 S: Maintained
492 T: git git://git.denx.de/u-boot-usb.git 493 T: git git://git.denx.de/u-boot-usb.git
493 F: drivers/usb/ 494 F: drivers/usb/
494 495
495 USB xHCI 496 USB xHCI
496 M: Bin Meng <bmeng.cn@gmail.com> 497 M: Bin Meng <bmeng.cn@gmail.com>
497 S: Maintained 498 S: Maintained
498 T: git git://git.denx.de/u-boot-usb.git topic-xhci 499 T: git git://git.denx.de/u-boot-usb.git topic-xhci
499 F: drivers/usb/host/xhci* 500 F: drivers/usb/host/xhci*
500 501
501 ROCKUSB 502 ROCKUSB
502 M: Eddie Cai <eddie.cai.linux@gmail.com> 503 M: Eddie Cai <eddie.cai.linux@gmail.com>
503 S: Maintained 504 S: Maintained
504 F: drivers/usb/gadget/f_rockusb.c 505 F: drivers/usb/gadget/f_rockusb.c
505 F: cmd/rockusb.c 506 F: cmd/rockusb.c
506 F: doc/README.rockusb 507 F: doc/README.rockusb
507 508
508 VIDEO 509 VIDEO
509 M: Anatolij Gustschin <agust@denx.de> 510 M: Anatolij Gustschin <agust@denx.de>
510 S: Maintained 511 S: Maintained
511 T: git git://git.denx.de/u-boot-video.git 512 T: git git://git.denx.de/u-boot-video.git
512 F: drivers/video/ 513 F: drivers/video/
513 F: common/lcd*.c 514 F: common/lcd*.c
514 F: include/lcd*.h 515 F: include/lcd*.h
515 516
516 X86 517 X86
517 M: Simon Glass <sjg@chromium.org> 518 M: Simon Glass <sjg@chromium.org>
518 M: Bin Meng <bmeng.cn@gmail.com> 519 M: Bin Meng <bmeng.cn@gmail.com>
519 S: Maintained 520 S: Maintained
520 T: git git://git.denx.de/u-boot-x86.git 521 T: git git://git.denx.de/u-boot-x86.git
521 F: arch/x86/ 522 F: arch/x86/
522 523
523 XTENSA 524 XTENSA
524 M: Max Filippov <jcmvbkbc@gmail.com> 525 M: Max Filippov <jcmvbkbc@gmail.com>
525 S: Maintained 526 S: Maintained
526 F: arch/xtensa/ 527 F: arch/xtensa/
527 528
528 THE REST 529 THE REST
529 M: Tom Rini <trini@konsulko.com> 530 M: Tom Rini <trini@konsulko.com>
530 L: u-boot@lists.denx.de 531 L: u-boot@lists.denx.de
531 Q: http://patchwork.ozlabs.org/project/uboot/list/ 532 Q: http://patchwork.ozlabs.org/project/uboot/list/
532 S: Maintained 533 S: Maintained
533 T: git git://git.denx.de/u-boot.git 534 T: git git://git.denx.de/u-boot.git
534 F: * 535 F: *
535 F: */ 536 F: */
536 537
drivers/serial/Kconfig
1 # 1 #
2 # Serial device configuration 2 # Serial device configuration
3 # 3 #
4 4
5 menu "Serial drivers" 5 menu "Serial drivers"
6 6
7 config BAUDRATE 7 config BAUDRATE
8 int "Default baudrate" 8 int "Default baudrate"
9 default 115200 9 default 115200
10 help 10 help
11 Select a default baudrate, where "default" has a driver-specific 11 Select a default baudrate, where "default" has a driver-specific
12 meaning of either setting the baudrate for the early debug UART 12 meaning of either setting the baudrate for the early debug UART
13 in the SPL stage (most drivers) or for choosing a default baudrate 13 in the SPL stage (most drivers) or for choosing a default baudrate
14 in the absence of an environment setting (serial_mxc.c). 14 in the absence of an environment setting (serial_mxc.c).
15 15
16 config REQUIRE_SERIAL_CONSOLE 16 config REQUIRE_SERIAL_CONSOLE
17 bool "Require a serial port for console" 17 bool "Require a serial port for console"
18 # Running without a serial console is not supported by the 18 # Running without a serial console is not supported by the
19 # non-dm serial code 19 # non-dm serial code
20 depends on DM_SERIAL 20 depends on DM_SERIAL
21 default y 21 default y
22 help 22 help
23 Require a serial port for the console, and panic if none is found 23 Require a serial port for the console, and panic if none is found
24 during serial port initialization (default y). Set this to n on 24 during serial port initialization (default y). Set this to n on
25 boards which have no debug serial port whatsoever. 25 boards which have no debug serial port whatsoever.
26 26
27 config SERIAL_PRESENT 27 config SERIAL_PRESENT
28 bool "Provide a serial driver" 28 bool "Provide a serial driver"
29 depends on DM_SERIAL 29 depends on DM_SERIAL
30 default y 30 default y
31 help 31 help
32 In very space-constrained devices even the full UART driver is too 32 In very space-constrained devices even the full UART driver is too
33 large. In this case the debug UART can still be used in some cases. 33 large. In this case the debug UART can still be used in some cases.
34 This option enables the full UART in U-Boot, so if is it disabled, 34 This option enables the full UART in U-Boot, so if is it disabled,
35 the full UART driver will be omitted, thus saving space. 35 the full UART driver will be omitted, thus saving space.
36 36
37 config SPL_SERIAL_PRESENT 37 config SPL_SERIAL_PRESENT
38 bool "Provide a serial driver in SPL" 38 bool "Provide a serial driver in SPL"
39 depends on DM_SERIAL 39 depends on DM_SERIAL
40 default y 40 default y
41 help 41 help
42 In very space-constrained devices even the full UART driver is too 42 In very space-constrained devices even the full UART driver is too
43 large. In this case the debug UART can still be used in some cases. 43 large. In this case the debug UART can still be used in some cases.
44 This option enables the full UART in SPL, so if is it disabled, 44 This option enables the full UART in SPL, so if is it disabled,
45 the full UART driver will be omitted, thus saving space. 45 the full UART driver will be omitted, thus saving space.
46 46
47 config CONS_INDEX 47 config CONS_INDEX
48 int "UART used for console" 48 int "UART used for console"
49 depends on ARCH_SUNXI 49 depends on ARCH_SUNXI
50 default 2 if MACH_SUN5I 50 default 2 if MACH_SUN5I
51 default 5 if MACH_SUN8I_A23 || MACH_SUN8I_A33 51 default 5 if MACH_SUN8I_A23 || MACH_SUN8I_A33
52 default 1 52 default 1
53 help 53 help
54 Configures the console index. 54 Configures the console index.
55 For Allwinner SoC., default values are 2 for SUN5I and 5 for A23/A33. 55 For Allwinner SoC., default values are 2 for SUN5I and 5 for A23/A33.
56 Otherwise, the index equals 1. 56 Otherwise, the index equals 1.
57 57
58 config DM_SERIAL 58 config DM_SERIAL
59 bool "Enable Driver Model for serial drivers" 59 bool "Enable Driver Model for serial drivers"
60 depends on DM 60 depends on DM
61 help 61 help
62 Enable driver model for serial. This replaces 62 Enable driver model for serial. This replaces
63 drivers/serial/serial.c with the serial uclass, which 63 drivers/serial/serial.c with the serial uclass, which
64 implements serial_putc() etc. The uclass interface is 64 implements serial_putc() etc. The uclass interface is
65 defined in include/serial.h. 65 defined in include/serial.h.
66 66
67 config SERIAL_RX_BUFFER 67 config SERIAL_RX_BUFFER
68 bool "Enable RX buffer for serial input" 68 bool "Enable RX buffer for serial input"
69 depends on DM_SERIAL 69 depends on DM_SERIAL
70 help 70 help
71 Enable RX buffer support for the serial driver. This enables 71 Enable RX buffer support for the serial driver. This enables
72 pasting longer strings, even when the RX FIFO of the UART is 72 pasting longer strings, even when the RX FIFO of the UART is
73 not big enough (e.g. 16 bytes on the normal NS16550). 73 not big enough (e.g. 16 bytes on the normal NS16550).
74 74
75 config SERIAL_RX_BUFFER_SIZE 75 config SERIAL_RX_BUFFER_SIZE
76 int "RX buffer size" 76 int "RX buffer size"
77 depends on SERIAL_RX_BUFFER 77 depends on SERIAL_RX_BUFFER
78 default 256 78 default 256
79 help 79 help
80 The size of the RX buffer (needs to be power of 2) 80 The size of the RX buffer (needs to be power of 2)
81 81
82 config SPL_DM_SERIAL 82 config SPL_DM_SERIAL
83 bool "Enable Driver Model for serial drivers in SPL" 83 bool "Enable Driver Model for serial drivers in SPL"
84 depends on DM_SERIAL 84 depends on DM_SERIAL
85 default y if SPL && DM_SERIAL 85 default y if SPL && DM_SERIAL
86 help 86 help
87 Enable driver model for serial in SPL. This replaces 87 Enable driver model for serial in SPL. This replaces
88 drivers/serial/serial.c with the serial uclass, which 88 drivers/serial/serial.c with the serial uclass, which
89 implements serial_putc() etc. The uclass interface is 89 implements serial_putc() etc. The uclass interface is
90 defined in include/serial.h. 90 defined in include/serial.h.
91 91
92 config TPL_DM_SERIAL 92 config TPL_DM_SERIAL
93 bool "Enable Driver Model for serial drivers in TPL" 93 bool "Enable Driver Model for serial drivers in TPL"
94 depends on DM_SERIAL 94 depends on DM_SERIAL
95 default y if TPL && DM_SERIAL 95 default y if TPL && DM_SERIAL
96 help 96 help
97 Enable driver model for serial in TPL. This replaces 97 Enable driver model for serial in TPL. This replaces
98 drivers/serial/serial.c with the serial uclass, which 98 drivers/serial/serial.c with the serial uclass, which
99 implements serial_putc() etc. The uclass interface is 99 implements serial_putc() etc. The uclass interface is
100 defined in include/serial.h. 100 defined in include/serial.h.
101 101
102 config DEBUG_UART 102 config DEBUG_UART
103 bool "Enable an early debug UART for debugging" 103 bool "Enable an early debug UART for debugging"
104 help 104 help
105 The debug UART is intended for use very early in U-Boot to debug 105 The debug UART is intended for use very early in U-Boot to debug
106 problems when an ICE or other debug mechanism is not available. 106 problems when an ICE or other debug mechanism is not available.
107 107
108 To use it you should: 108 To use it you should:
109 - Make sure your UART supports this interface 109 - Make sure your UART supports this interface
110 - Enable CONFIG_DEBUG_UART 110 - Enable CONFIG_DEBUG_UART
111 - Enable the CONFIG for your UART to tell it to provide this interface 111 - Enable the CONFIG for your UART to tell it to provide this interface
112 (e.g. CONFIG_DEBUG_UART_NS16550) 112 (e.g. CONFIG_DEBUG_UART_NS16550)
113 - Define the required settings as needed (see below) 113 - Define the required settings as needed (see below)
114 - Call debug_uart_init() before use 114 - Call debug_uart_init() before use
115 - Call debug_uart_putc() to output a character 115 - Call debug_uart_putc() to output a character
116 116
117 Depending on your platform it may be possible to use this UART before 117 Depending on your platform it may be possible to use this UART before
118 a stack is available. 118 a stack is available.
119 119
120 If your UART does not support this interface you can probably add 120 If your UART does not support this interface you can probably add
121 support quite easily. Remember that you cannot use driver model and 121 support quite easily. Remember that you cannot use driver model and
122 it is preferred to use no stack. 122 it is preferred to use no stack.
123 123
124 You must not use this UART once driver model is working and the 124 You must not use this UART once driver model is working and the
125 serial drivers are up and running (done in serial_init()). Otherwise 125 serial drivers are up and running (done in serial_init()). Otherwise
126 the drivers may conflict and you will get strange output. 126 the drivers may conflict and you will get strange output.
127 127
128 choice 128 choice
129 prompt "Select which UART will provide the debug UART" 129 prompt "Select which UART will provide the debug UART"
130 depends on DEBUG_UART 130 depends on DEBUG_UART
131 default DEBUG_UART_NS16550 131 default DEBUG_UART_NS16550
132 132
133 config DEBUG_UART_ALTERA_JTAGUART 133 config DEBUG_UART_ALTERA_JTAGUART
134 bool "Altera JTAG UART" 134 bool "Altera JTAG UART"
135 help 135 help
136 Select this to enable a debug UART using the altera_jtag_uart driver. 136 Select this to enable a debug UART using the altera_jtag_uart driver.
137 You will need to provide parameters to make this work. The driver will 137 You will need to provide parameters to make this work. The driver will
138 be available until the real driver model serial is running. 138 be available until the real driver model serial is running.
139 139
140 config DEBUG_UART_ALTERA_UART 140 config DEBUG_UART_ALTERA_UART
141 bool "Altera UART" 141 bool "Altera UART"
142 help 142 help
143 Select this to enable a debug UART using the altera_uart driver. 143 Select this to enable a debug UART using the altera_uart driver.
144 You will need to provide parameters to make this work. The driver will 144 You will need to provide parameters to make this work. The driver will
145 be available until the real driver model serial is running. 145 be available until the real driver model serial is running.
146 146
147 config DEBUG_UART_AR933X 147 config DEBUG_UART_AR933X
148 bool "QCA/Atheros ar933x" 148 bool "QCA/Atheros ar933x"
149 depends on AR933X_UART 149 depends on AR933X_UART
150 help 150 help
151 Select this to enable a debug UART using the ar933x uart driver. 151 Select this to enable a debug UART using the ar933x uart driver.
152 You will need to provide parameters to make this work. The 152 You will need to provide parameters to make this work. The
153 driver will be available until the real driver model serial is 153 driver will be available until the real driver model serial is
154 running. 154 running.
155 155
156 config DEBUG_UART_ATMEL 156 config DEBUG_UART_ATMEL
157 bool "Atmel USART" 157 bool "Atmel USART"
158 help 158 help
159 Select this to enable a debug UART using the atmel usart driver. You 159 Select this to enable a debug UART using the atmel usart driver. You
160 will need to provide parameters to make this work. The driver will 160 will need to provide parameters to make this work. The driver will
161 be available until the real driver-model serial is running. 161 be available until the real driver-model serial is running.
162 162
163 config DEBUG_UART_BCM6345 163 config DEBUG_UART_BCM6345
164 bool "BCM6345 UART" 164 bool "BCM6345 UART"
165 depends on BCM6345_SERIAL 165 depends on BCM6345_SERIAL
166 help 166 help
167 Select this to enable a debug UART on BCM6345 SoCs. You 167 Select this to enable a debug UART on BCM6345 SoCs. You
168 will need to provide parameters to make this work. The driver will 168 will need to provide parameters to make this work. The driver will
169 be available until the real driver model serial is running. 169 be available until the real driver model serial is running.
170 170
171 config DEBUG_UART_NS16550 171 config DEBUG_UART_NS16550
172 bool "ns16550" 172 bool "ns16550"
173 help 173 help
174 Select this to enable a debug UART using the ns16550 driver. You 174 Select this to enable a debug UART using the ns16550 driver. You
175 will need to provide parameters to make this work. The driver will 175 will need to provide parameters to make this work. The driver will
176 be available until the real driver model serial is running. 176 be available until the real driver model serial is running.
177 177
178 config DEBUG_EFI_CONSOLE 178 config DEBUG_EFI_CONSOLE
179 bool "EFI" 179 bool "EFI"
180 depends on EFI_APP 180 depends on EFI_APP
181 help 181 help
182 Select this to enable a debug console which calls back to EFI to 182 Select this to enable a debug console which calls back to EFI to
183 output to the console. This can be useful for early debugging of 183 output to the console. This can be useful for early debugging of
184 U-Boot when running on top of EFI (Extensive Firmware Interface). 184 U-Boot when running on top of EFI (Extensive Firmware Interface).
185 This is a type of BIOS used by PCs. 185 This is a type of BIOS used by PCs.
186 186
187 config DEBUG_UART_S5P 187 config DEBUG_UART_S5P
188 bool "Samsung S5P" 188 bool "Samsung S5P"
189 help 189 help
190 Select this to enable a debug UART using the serial_s5p driver. You 190 Select this to enable a debug UART using the serial_s5p driver. You
191 will need to provide parameters to make this work. The driver will 191 will need to provide parameters to make this work. The driver will
192 be available until the real driver-model serial is running. 192 be available until the real driver-model serial is running.
193 193
194 config DEBUG_UART_MESON 194 config DEBUG_UART_MESON
195 bool "Amlogic Meson" 195 bool "Amlogic Meson"
196 depends on MESON_SERIAL 196 depends on MESON_SERIAL
197 help 197 help
198 Select this to enable a debug UART using the serial_meson driver. You 198 Select this to enable a debug UART using the serial_meson driver. You
199 will need to provide parameters to make this work. The driver will 199 will need to provide parameters to make this work. The driver will
200 be available until the real driver-model serial is running. 200 be available until the real driver-model serial is running.
201 201
202 config DEBUG_UART_UARTLITE 202 config DEBUG_UART_UARTLITE
203 bool "Xilinx Uartlite" 203 bool "Xilinx Uartlite"
204 help 204 help
205 Select this to enable a debug UART using the serial_uartlite driver. 205 Select this to enable a debug UART using the serial_uartlite driver.
206 You will need to provide parameters to make this work. The driver will 206 You will need to provide parameters to make this work. The driver will
207 be available until the real driver-model serial is running. 207 be available until the real driver-model serial is running.
208 208
209 config DEBUG_UART_ARM_DCC 209 config DEBUG_UART_ARM_DCC
210 bool "ARM DCC" 210 bool "ARM DCC"
211 help 211 help
212 Select this to enable a debug UART using the ARM JTAG DCC port. 212 Select this to enable a debug UART using the ARM JTAG DCC port.
213 The DCC port can be used for very early debugging and doesn't require 213 The DCC port can be used for very early debugging and doesn't require
214 any additional setting like address/baudrate/clock. On systems without 214 any additional setting like address/baudrate/clock. On systems without
215 any serial interface this is the easiest way how to get console. 215 any serial interface this is the easiest way how to get console.
216 Every ARM core has own DCC port which is the part of debug interface. 216 Every ARM core has own DCC port which is the part of debug interface.
217 This port is available at least on ARMv6, ARMv7, ARMv8 and XScale 217 This port is available at least on ARMv6, ARMv7, ARMv8 and XScale
218 architectures. 218 architectures.
219 219
220 config DEBUG_MVEBU_A3700_UART 220 config DEBUG_MVEBU_A3700_UART
221 bool "Marvell Armada 3700" 221 bool "Marvell Armada 3700"
222 help 222 help
223 Select this to enable a debug UART using the serial_mvebu driver. You 223 Select this to enable a debug UART using the serial_mvebu driver. You
224 will need to provide parameters to make this work. The driver will 224 will need to provide parameters to make this work. The driver will
225 be available until the real driver-model serial is running. 225 be available until the real driver-model serial is running.
226 226
227 config DEBUG_UART_ZYNQ 227 config DEBUG_UART_ZYNQ
228 bool "Xilinx Zynq" 228 bool "Xilinx Zynq"
229 help 229 help
230 Select this to enable a debug UART using the serial_zynq driver. You 230 Select this to enable a debug UART using the serial_zynq driver. You
231 will need to provide parameters to make this work. The driver will 231 will need to provide parameters to make this work. The driver will
232 be available until the real driver-model serial is running. 232 be available until the real driver-model serial is running.
233 233
234 config DEBUG_UART_APBUART 234 config DEBUG_UART_APBUART
235 depends on LEON3 235 depends on LEON3
236 bool "Gaisler APBUART" 236 bool "Gaisler APBUART"
237 help 237 help
238 Select this to enable a debug UART using the serial_leon3 driver. You 238 Select this to enable a debug UART using the serial_leon3 driver. You
239 will need to provide parameters to make this work. The driver will 239 will need to provide parameters to make this work. The driver will
240 be available until the real driver model serial is running. 240 be available until the real driver model serial is running.
241 241
242 config DEBUG_UART_PL010 242 config DEBUG_UART_PL010
243 bool "pl010" 243 bool "pl010"
244 help 244 help
245 Select this to enable a debug UART using the pl01x driver with the 245 Select this to enable a debug UART using the pl01x driver with the
246 PL010 UART type. You will need to provide parameters to make this 246 PL010 UART type. You will need to provide parameters to make this
247 work. The driver will be available until the real driver model 247 work. The driver will be available until the real driver model
248 serial is running. 248 serial is running.
249 249
250 config DEBUG_UART_PL011 250 config DEBUG_UART_PL011
251 bool "pl011" 251 bool "pl011"
252 help 252 help
253 Select this to enable a debug UART using the pl01x driver with the 253 Select this to enable a debug UART using the pl01x driver with the
254 PL011 UART type. You will need to provide parameters to make this 254 PL011 UART type. You will need to provide parameters to make this
255 work. The driver will be available until the real driver model 255 work. The driver will be available until the real driver model
256 serial is running. 256 serial is running.
257 257
258 config DEBUG_UART_PIC32 258 config DEBUG_UART_PIC32
259 bool "Microchip PIC32" 259 bool "Microchip PIC32"
260 depends on PIC32_SERIAL 260 depends on PIC32_SERIAL
261 help 261 help
262 Select this to enable a debug UART using the serial_pic32 driver. You 262 Select this to enable a debug UART using the serial_pic32 driver. You
263 will need to provide parameters to make this work. The driver will 263 will need to provide parameters to make this work. The driver will
264 be available until the real driver model serial is running. 264 be available until the real driver model serial is running.
265 265
266 config DEBUG_UART_MXC 266 config DEBUG_UART_MXC
267 bool "IMX Serial port" 267 bool "IMX Serial port"
268 depends on MXC_UART 268 depends on MXC_UART
269 help 269 help
270 Select this to enable a debug UART using the serial_mxc driver. You 270 Select this to enable a debug UART using the serial_mxc driver. You
271 will need to provide parameters to make this work. The driver will 271 will need to provide parameters to make this work. The driver will
272 be available until the real driver model serial is running. 272 be available until the real driver model serial is running.
273 273
274 config DEBUG_UART_UNIPHIER 274 config DEBUG_UART_UNIPHIER
275 bool "UniPhier on-chip UART" 275 bool "UniPhier on-chip UART"
276 depends on ARCH_UNIPHIER 276 depends on ARCH_UNIPHIER
277 help 277 help
278 Select this to enable a debug UART using the UniPhier on-chip UART. 278 Select this to enable a debug UART using the UniPhier on-chip UART.
279 You will need to provide DEBUG_UART_BASE to make this work. The 279 You will need to provide DEBUG_UART_BASE to make this work. The
280 driver will be available until the real driver-model serial is 280 driver will be available until the real driver-model serial is
281 running. 281 running.
282 282
283 config DEBUG_UART_OMAP 283 config DEBUG_UART_OMAP
284 bool "OMAP uart" 284 bool "OMAP uart"
285 help 285 help
286 Select this to enable a debug UART using the omap ns16550 driver. 286 Select this to enable a debug UART using the omap ns16550 driver.
287 You will need to provide parameters to make this work. The driver 287 You will need to provide parameters to make this work. The driver
288 will be available until the real driver model serial is running. 288 will be available until the real driver model serial is running.
289 289
290 endchoice 290 endchoice
291 291
292 config DEBUG_UART_BASE 292 config DEBUG_UART_BASE
293 hex "Base address of UART" 293 hex "Base address of UART"
294 depends on DEBUG_UART 294 depends on DEBUG_UART
295 help 295 help
296 This is the base address of your UART for memory-mapped UARTs. 296 This is the base address of your UART for memory-mapped UARTs.
297 297
298 A default should be provided by your board, but if not you will need 298 A default should be provided by your board, but if not you will need
299 to use the correct value here. 299 to use the correct value here.
300 300
301 config DEBUG_UART_CLOCK 301 config DEBUG_UART_CLOCK
302 int "UART input clock" 302 int "UART input clock"
303 depends on DEBUG_UART 303 depends on DEBUG_UART
304 help 304 help
305 The UART input clock determines the speed of the internal UART 305 The UART input clock determines the speed of the internal UART
306 circuitry. The baud rate is derived from this by dividing the input 306 circuitry. The baud rate is derived from this by dividing the input
307 clock down. 307 clock down.
308 308
309 A default should be provided by your board, but if not you will need 309 A default should be provided by your board, but if not you will need
310 to use the correct value here. 310 to use the correct value here.
311 311
312 config DEBUG_UART_SHIFT 312 config DEBUG_UART_SHIFT
313 int "UART register shift" 313 int "UART register shift"
314 depends on DEBUG_UART 314 depends on DEBUG_UART
315 default 0 if DEBUG_UART 315 default 0 if DEBUG_UART
316 help 316 help
317 Some UARTs (notably ns16550) support different register layouts 317 Some UARTs (notably ns16550) support different register layouts
318 where the registers are spaced either as bytes, words or some other 318 where the registers are spaced either as bytes, words or some other
319 value. Use this value to specify the shift to use, where 0=byte 319 value. Use this value to specify the shift to use, where 0=byte
320 registers, 2=32-bit word registers, etc. 320 registers, 2=32-bit word registers, etc.
321 321
322 config DEBUG_UART_BOARD_INIT 322 config DEBUG_UART_BOARD_INIT
323 bool "Enable board-specific debug UART init" 323 bool "Enable board-specific debug UART init"
324 depends on DEBUG_UART 324 depends on DEBUG_UART
325 help 325 help
326 Some boards need to set things up before the debug UART can be used. 326 Some boards need to set things up before the debug UART can be used.
327 On these boards a call to debug_uart_init() is insufficient. When 327 On these boards a call to debug_uart_init() is insufficient. When
328 this option is enabled, the function board_debug_uart_init() will 328 this option is enabled, the function board_debug_uart_init() will
329 be called when debug_uart_init() is called. You can put any code 329 be called when debug_uart_init() is called. You can put any code
330 here that is needed to set up the UART ready for use, such as set 330 here that is needed to set up the UART ready for use, such as set
331 pin multiplexing or enable clocks. 331 pin multiplexing or enable clocks.
332 332
333 config DEBUG_UART_ANNOUNCE 333 config DEBUG_UART_ANNOUNCE
334 bool "Show a message when the debug UART starts up" 334 bool "Show a message when the debug UART starts up"
335 depends on DEBUG_UART 335 depends on DEBUG_UART
336 help 336 help
337 Enable this option to show a message when the debug UART is ready 337 Enable this option to show a message when the debug UART is ready
338 for use. You will see a message like "<debug_uart> " as soon as 338 for use. You will see a message like "<debug_uart> " as soon as
339 U-Boot has the UART ready for use (i.e. your code calls 339 U-Boot has the UART ready for use (i.e. your code calls
340 debug_uart_init()). This can be useful just as a check that 340 debug_uart_init()). This can be useful just as a check that
341 everything is working. 341 everything is working.
342 342
343 config DEBUG_UART_SKIP_INIT 343 config DEBUG_UART_SKIP_INIT
344 bool "Skip UART initialization" 344 bool "Skip UART initialization"
345 help 345 help
346 Select this if the UART you want to use for debug output is already 346 Select this if the UART you want to use for debug output is already
347 initialized by the time U-Boot starts its execution. 347 initialized by the time U-Boot starts its execution.
348 348
349 config ALTERA_JTAG_UART 349 config ALTERA_JTAG_UART
350 bool "Altera JTAG UART support" 350 bool "Altera JTAG UART support"
351 depends on DM_SERIAL 351 depends on DM_SERIAL
352 help 352 help
353 Select this to enable an JTAG UART for Altera devices.The JTAG UART 353 Select this to enable an JTAG UART for Altera devices.The JTAG UART
354 core implements a method to communicate serial character streams 354 core implements a method to communicate serial character streams
355 between a host PC and a Qsys system on an Altera FPGA. Please find 355 between a host PC and a Qsys system on an Altera FPGA. Please find
356 details on the "Embedded Peripherals IP User Guide" of Altera. 356 details on the "Embedded Peripherals IP User Guide" of Altera.
357 357
358 config ALTERA_JTAG_UART_BYPASS 358 config ALTERA_JTAG_UART_BYPASS
359 bool "Bypass output when no connection" 359 bool "Bypass output when no connection"
360 depends on ALTERA_JTAG_UART 360 depends on ALTERA_JTAG_UART
361 help 361 help
362 Bypass console output and keep going even if there is no JTAG 362 Bypass console output and keep going even if there is no JTAG
363 terminal connection with the host. The console output will resume 363 terminal connection with the host. The console output will resume
364 once the JTAG terminal is connected. Without the bypass, the console 364 once the JTAG terminal is connected. Without the bypass, the console
365 output will wait forever until a JTAG terminal is connected. If you 365 output will wait forever until a JTAG terminal is connected. If you
366 not are sure, say Y. 366 not are sure, say Y.
367 367
368 config ALTERA_UART 368 config ALTERA_UART
369 bool "Altera UART support" 369 bool "Altera UART support"
370 depends on DM_SERIAL 370 depends on DM_SERIAL
371 help 371 help
372 Select this to enable an UART for Altera devices. Please find 372 Select this to enable an UART for Altera devices. Please find
373 details on the "Embedded Peripherals IP User Guide" of Altera. 373 details on the "Embedded Peripherals IP User Guide" of Altera.
374 374
375 config AR933X_UART 375 config AR933X_UART
376 bool "QCA/Atheros ar933x UART support" 376 bool "QCA/Atheros ar933x UART support"
377 depends on DM_SERIAL && SOC_AR933X 377 depends on DM_SERIAL && SOC_AR933X
378 help 378 help
379 Select this to enable UART support for QCA/Atheros ar933x 379 Select this to enable UART support for QCA/Atheros ar933x
380 devices. This driver uses driver model and requires a device 380 devices. This driver uses driver model and requires a device
381 tree binding to operate, please refer to the document at 381 tree binding to operate, please refer to the document at
382 doc/device-tree-bindings/serial/qca,ar9330-uart.txt. 382 doc/device-tree-bindings/serial/qca,ar9330-uart.txt.
383 383
384 config ATMEL_USART 384 config ATMEL_USART
385 bool "Atmel USART support" 385 bool "Atmel USART support"
386 help 386 help
387 Select this to enable USART support for Atmel SoCs. It can be 387 Select this to enable USART support for Atmel SoCs. It can be
388 configured in the device tree, and input clock frequency can 388 configured in the device tree, and input clock frequency can
389 be got from the clk node. 389 be got from the clk node.
390 390
391 config BCM283X_MU_SERIAL 391 config BCM283X_MU_SERIAL
392 bool "Support for BCM283x Mini-UART" 392 bool "Support for BCM283x Mini-UART"
393 depends on DM_SERIAL && ARCH_BCM283X 393 depends on DM_SERIAL && ARCH_BCM283X
394 default y 394 default y
395 help 395 help
396 Select this to enable Mini-UART support on BCM283X family of SoCs. 396 Select this to enable Mini-UART support on BCM283X family of SoCs.
397 397
398 config BCM283X_PL011_SERIAL
399 bool "Support for BCM283x PL011 UART"
400 depends on PL01X_SERIAL && ARCH_BCM283X
401 default y
402 help
403 Select this to enable an overriding PL011 driver for BCM283X SoCs
404 that supports automatic disable, so that it only gets used when
405 the UART is actually muxed.
406
398 config BCM6345_SERIAL 407 config BCM6345_SERIAL
399 bool "Support for BCM6345 UART" 408 bool "Support for BCM6345 UART"
400 depends on DM_SERIAL && ARCH_BMIPS 409 depends on DM_SERIAL && ARCH_BMIPS
401 help 410 help
402 Select this to enable UART on BCM6345 SoCs. 411 Select this to enable UART on BCM6345 SoCs.
403 412
404 config FSL_LPUART 413 config FSL_LPUART
405 bool "Freescale LPUART support" 414 bool "Freescale LPUART support"
406 help 415 help
407 Select this to enable a Low Power UART for Freescale VF610 and 416 Select this to enable a Low Power UART for Freescale VF610 and
408 QorIQ Layerscape devices. 417 QorIQ Layerscape devices.
409 418
410 config MVEBU_A3700_UART 419 config MVEBU_A3700_UART
411 bool "UART support for Armada 3700" 420 bool "UART support for Armada 3700"
412 default n 421 default n
413 help 422 help
414 Choose this option to add support for UART driver on the Marvell 423 Choose this option to add support for UART driver on the Marvell
415 Armada 3700 SoC. The base address is configured via DT. 424 Armada 3700 SoC. The base address is configured via DT.
416 425
417 config MXC_UART 426 config MXC_UART
418 bool "IMX serial port support" 427 bool "IMX serial port support"
419 depends on MX5 || MX6 428 depends on MX5 || MX6
420 help 429 help
421 If you have a machine based on a Motorola IMX CPU you 430 If you have a machine based on a Motorola IMX CPU you
422 can enable its onboard serial port by enabling this option. 431 can enable its onboard serial port by enabling this option.
423 432
424 config NULLDEV_SERIAL 433 config NULLDEV_SERIAL
425 bool "Null serial device" 434 bool "Null serial device"
426 help 435 help
427 Select this to enable null serial device support. A null serial 436 Select this to enable null serial device support. A null serial
428 device merely acts as a placeholder for a serial device and does 437 device merely acts as a placeholder for a serial device and does
429 nothing for all it's operation. 438 nothing for all it's operation.
430 439
431 config PIC32_SERIAL 440 config PIC32_SERIAL
432 bool "Support for Microchip PIC32 on-chip UART" 441 bool "Support for Microchip PIC32 on-chip UART"
433 depends on DM_SERIAL && MACH_PIC32 442 depends on DM_SERIAL && MACH_PIC32
434 default y 443 default y
435 help 444 help
436 Support for the UART found on Microchip PIC32 SoC's. 445 Support for the UART found on Microchip PIC32 SoC's.
437 446
438 config SYS_NS16550 447 config SYS_NS16550
439 bool "NS16550 UART or compatible" 448 bool "NS16550 UART or compatible"
440 help 449 help
441 Support NS16550 UART or compatible. This can be enabled in the 450 Support NS16550 UART or compatible. This can be enabled in the
442 device tree with the correct input clock frequency. If the input 451 device tree with the correct input clock frequency. If the input
443 clock frequency is not defined in the device tree, the macro 452 clock frequency is not defined in the device tree, the macro
444 CONFIG_SYS_NS16550_CLK defined in a legacy board header file will 453 CONFIG_SYS_NS16550_CLK defined in a legacy board header file will
445 be used. It can be a constant or a function to get clock, eg, 454 be used. It can be a constant or a function to get clock, eg,
446 get_serial_clock(). 455 get_serial_clock().
447 456
448 config INTEL_MID_SERIAL 457 config INTEL_MID_SERIAL
449 bool "Intel MID platform UART support" 458 bool "Intel MID platform UART support"
450 depends on DM_SERIAL && OF_CONTROL 459 depends on DM_SERIAL && OF_CONTROL
451 depends on INTEL_MID 460 depends on INTEL_MID
452 select SYS_NS16550 461 select SYS_NS16550
453 help 462 help
454 Select this to enable a UART for Intel MID platforms. 463 Select this to enable a UART for Intel MID platforms.
455 This uses the ns16550 driver as a library. 464 This uses the ns16550 driver as a library.
456 465
457 config PL010_SERIAL 466 config PL010_SERIAL
458 bool "ARM PL010 driver" 467 bool "ARM PL010 driver"
459 depends on !DM_SERIAL 468 depends on !DM_SERIAL
460 help 469 help
461 Select this to enable a UART for platforms using PL010. 470 Select this to enable a UART for platforms using PL010.
462 471
463 config PL011_SERIAL 472 config PL011_SERIAL
464 bool "ARM PL011 driver" 473 bool "ARM PL011 driver"
465 depends on !DM_SERIAL 474 depends on !DM_SERIAL
466 help 475 help
467 Select this to enable a UART for platforms using PL011. 476 Select this to enable a UART for platforms using PL011.
468 477
469 config PL01X_SERIAL 478 config PL01X_SERIAL
470 bool "ARM PL010 and PL011 driver" 479 bool "ARM PL010 and PL011 driver"
471 depends on DM_SERIAL 480 depends on DM_SERIAL
472 help 481 help
473 Select this to enable a UART for platforms using PL010 or PL011. 482 Select this to enable a UART for platforms using PL010 or PL011.
474 483
475 config ROCKCHIP_SERIAL 484 config ROCKCHIP_SERIAL
476 bool "Rockchip on-chip UART support" 485 bool "Rockchip on-chip UART support"
477 depends on DM_SERIAL && SPL_OF_PLATDATA 486 depends on DM_SERIAL && SPL_OF_PLATDATA
478 help 487 help
479 Select this to enable a debug UART for Rockchip devices when using 488 Select this to enable a debug UART for Rockchip devices when using
480 CONFIG_SPL_OF_PLATDATA (i.e. a compiled-in device tree replacemenmt). 489 CONFIG_SPL_OF_PLATDATA (i.e. a compiled-in device tree replacemenmt).
481 This uses the ns16550 driver, converting the platdata from of-platdata 490 This uses the ns16550 driver, converting the platdata from of-platdata
482 to the ns16550 format. 491 to the ns16550 format.
483 492
484 config SANDBOX_SERIAL 493 config SANDBOX_SERIAL
485 bool "Sandbox UART support" 494 bool "Sandbox UART support"
486 depends on SANDBOX 495 depends on SANDBOX
487 help 496 help
488 Select this to enable a seral UART for sandbox. This is required to 497 Select this to enable a seral UART for sandbox. This is required to
489 operate correctly, otherwise you will see no serial output from 498 operate correctly, otherwise you will see no serial output from
490 sandbox. The emulated UART will display to the console and console 499 sandbox. The emulated UART will display to the console and console
491 input will be fed into the UART. This allows you to interact with 500 input will be fed into the UART. This allows you to interact with
492 U-Boot. 501 U-Boot.
493 502
494 The operation of the console is controlled by the -t command-line 503 The operation of the console is controlled by the -t command-line
495 flag. In raw mode, U-Boot sees all characters from the terminal 504 flag. In raw mode, U-Boot sees all characters from the terminal
496 before they are processed, including Ctrl-C. In cooked mode, Ctrl-C 505 before they are processed, including Ctrl-C. In cooked mode, Ctrl-C
497 is processed by the terminal, and terminates U-Boot. Valid options 506 is processed by the terminal, and terminates U-Boot. Valid options
498 are: 507 are:
499 508
500 -t raw-with-sigs Raw mode, Ctrl-C will terminate U-Boot 509 -t raw-with-sigs Raw mode, Ctrl-C will terminate U-Boot
501 -t raw Raw mode, Ctrl-C is processed by U-Boot 510 -t raw Raw mode, Ctrl-C is processed by U-Boot
502 -t cooked Cooked mode, Ctrl-C terminates 511 -t cooked Cooked mode, Ctrl-C terminates
503 512
504 config SCIF_CONSOLE 513 config SCIF_CONSOLE
505 bool "Renesas SCIF UART support" 514 bool "Renesas SCIF UART support"
506 depends on SH || ARCH_RMOBILE 515 depends on SH || ARCH_RMOBILE
507 help 516 help
508 Select this to enable Renesas SCIF UART. To operate serial ports 517 Select this to enable Renesas SCIF UART. To operate serial ports
509 on systems with RCar or SH SoCs, say Y to this option. If unsure, 518 on systems with RCar or SH SoCs, say Y to this option. If unsure,
510 say N. 519 say N.
511 520
512 config UNIPHIER_SERIAL 521 config UNIPHIER_SERIAL
513 bool "Support for UniPhier on-chip UART" 522 bool "Support for UniPhier on-chip UART"
514 depends on ARCH_UNIPHIER 523 depends on ARCH_UNIPHIER
515 default y 524 default y
516 help 525 help
517 If you have a UniPhier based board and want to use the on-chip 526 If you have a UniPhier based board and want to use the on-chip
518 serial ports, say Y to this option. If unsure, say N. 527 serial ports, say Y to this option. If unsure, say N.
519 528
520 config XILINX_UARTLITE 529 config XILINX_UARTLITE
521 bool "Xilinx Uarlite support" 530 bool "Xilinx Uarlite support"
522 depends on DM_SERIAL && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP || 4xx) 531 depends on DM_SERIAL && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP || 4xx)
523 help 532 help
524 If you have a Xilinx based board and want to use the uartlite 533 If you have a Xilinx based board and want to use the uartlite
525 serial ports, say Y to this option. If unsure, say N. 534 serial ports, say Y to this option. If unsure, say N.
526 535
527 config MESON_SERIAL 536 config MESON_SERIAL
528 bool "Support for Amlogic Meson UART" 537 bool "Support for Amlogic Meson UART"
529 depends on DM_SERIAL && ARCH_MESON 538 depends on DM_SERIAL && ARCH_MESON
530 help 539 help
531 If you have an Amlogic Meson based board and want to use the on-chip 540 If you have an Amlogic Meson based board and want to use the on-chip
532 serial ports, say Y to this option. If unsure, say N. 541 serial ports, say Y to this option. If unsure, say N.
533 542
534 config MSM_SERIAL 543 config MSM_SERIAL
535 bool "Qualcomm on-chip UART" 544 bool "Qualcomm on-chip UART"
536 depends on DM_SERIAL 545 depends on DM_SERIAL
537 help 546 help
538 Support Data Mover UART used on Qualcomm Snapdragon SoCs. 547 Support Data Mover UART used on Qualcomm Snapdragon SoCs.
539 It should support all Qualcomm devices with UARTDM version 1.4, 548 It should support all Qualcomm devices with UARTDM version 1.4,
540 for example APQ8016 and MSM8916. 549 for example APQ8016 and MSM8916.
541 Single baudrate is supported in current implementation (115200). 550 Single baudrate is supported in current implementation (115200).
542 551
543 config PXA_SERIAL 552 config PXA_SERIAL
544 bool "PXA serial port support" 553 bool "PXA serial port support"
545 help 554 help
546 If you have a machine based on a Marvell XScale PXA2xx CPU you 555 If you have a machine based on a Marvell XScale PXA2xx CPU you
547 can enable its onboard serial ports by enabling this option. 556 can enable its onboard serial ports by enabling this option.
548 557
549 config STI_ASC_SERIAL 558 config STI_ASC_SERIAL
550 bool "STMicroelectronics on-chip UART" 559 bool "STMicroelectronics on-chip UART"
551 depends on DM_SERIAL && ARCH_STI 560 depends on DM_SERIAL && ARCH_STI
552 help 561 help
553 Select this to enable Asynchronous Serial Controller available 562 Select this to enable Asynchronous Serial Controller available
554 on STiH410 SoC. This is a basic implementation, it supports 563 on STiH410 SoC. This is a basic implementation, it supports
555 following baudrate 9600, 19200, 38400, 57600 and 115200. 564 following baudrate 9600, 19200, 38400, 57600 and 115200.
556 565
557 config STM32_SERIAL 566 config STM32_SERIAL
558 bool "STMicroelectronics STM32 SoCs on-chip UART" 567 bool "STMicroelectronics STM32 SoCs on-chip UART"
559 depends on DM_SERIAL && (STM32F4 || STM32F7 || STM32H7) 568 depends on DM_SERIAL && (STM32F4 || STM32F7 || STM32H7)
560 help 569 help
561 If you have a machine based on a STM32 F4, F7 or H7 SoC you can 570 If you have a machine based on a STM32 F4, F7 or H7 SoC you can
562 enable its onboard serial ports, say Y to this option. 571 enable its onboard serial ports, say Y to this option.
563 If unsure, say N. 572 If unsure, say N.
564 573
565 config ZYNQ_SERIAL 574 config ZYNQ_SERIAL
566 bool "Cadence (Xilinx Zynq) UART support" 575 bool "Cadence (Xilinx Zynq) UART support"
567 depends on DM_SERIAL && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP) 576 depends on DM_SERIAL && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
568 help 577 help
569 This driver supports the Cadence UART. It is found e.g. in Xilinx 578 This driver supports the Cadence UART. It is found e.g. in Xilinx
570 Zynq/ZynqMP. 579 Zynq/ZynqMP.
571 580
572 config MPC8XX_CONS 581 config MPC8XX_CONS
573 bool "Console driver for MPC8XX" 582 bool "Console driver for MPC8XX"
574 depends on 8xx 583 depends on 8xx
575 default y 584 default y
576 585
577 choice 586 choice
578 prompt "Console port" 587 prompt "Console port"
579 default 8xx_CONS_SMC1 588 default 8xx_CONS_SMC1
580 depends on MPC8XX_CONS 589 depends on MPC8XX_CONS
581 help 590 help
582 Depending on board, select one serial port 591 Depending on board, select one serial port
583 (CONFIG_8xx_CONS_SMC1 or CONFIG_8xx_CONS_SMC2) 592 (CONFIG_8xx_CONS_SMC1 or CONFIG_8xx_CONS_SMC2)
584 593
585 config 8xx_CONS_SMC1 594 config 8xx_CONS_SMC1
586 bool "SMC1" 595 bool "SMC1"
587 596
588 config 8xx_CONS_SMC2 597 config 8xx_CONS_SMC2
589 bool "SMC2" 598 bool "SMC2"
590 599
591 endchoice 600 endchoice
592 601
593 config SYS_SMC_RXBUFLEN 602 config SYS_SMC_RXBUFLEN
594 int "Console Rx buffer length" 603 int "Console Rx buffer length"
595 depends on MPC8XX_CONS 604 depends on MPC8XX_CONS
596 default 1 605 default 1
597 help 606 help
598 With CONFIG_SYS_SMC_RXBUFLEN it is possible to define 607 With CONFIG_SYS_SMC_RXBUFLEN it is possible to define
599 the maximum receive buffer length for the SMC. 608 the maximum receive buffer length for the SMC.
600 This option is actual only for 8xx possible. 609 This option is actual only for 8xx possible.
601 If using CONFIG_SYS_SMC_RXBUFLEN also CONFIG_SYS_MAXIDLE 610 If using CONFIG_SYS_SMC_RXBUFLEN also CONFIG_SYS_MAXIDLE
602 must be defined, to setup the maximum idle timeout for 611 must be defined, to setup the maximum idle timeout for
603 the SMC. 612 the SMC.
604 613
605 config SYS_MAXIDLE 614 config SYS_MAXIDLE
606 int "maximum idle timeout" 615 int "maximum idle timeout"
607 depends on MPC8XX_CONS 616 depends on MPC8XX_CONS
608 default 0 617 default 0
609 618
610 config SYS_BRGCLK_PRESCALE 619 config SYS_BRGCLK_PRESCALE
611 int "BRG Clock Prescale" 620 int "BRG Clock Prescale"
612 depends on MPC8XX_CONS 621 depends on MPC8XX_CONS
613 default 1 622 default 1
614 623
615 config SYS_SDSR 624 config SYS_SDSR
616 hex "SDSR Value" 625 hex "SDSR Value"
617 depends on MPC8XX_CONS 626 depends on MPC8XX_CONS
618 default 0x83 627 default 0x83
619 628
620 config SYS_SDMR 629 config SYS_SDMR
621 hex "SDMR Value" 630 hex "SDMR Value"
622 depends on MPC8XX_CONS 631 depends on MPC8XX_CONS
623 default 0 632 default 0
624 633
625 endmenu 634 endmenu
626 635
drivers/serial/Makefile
1 # 1 #
2 # (C) Copyright 2006-2009 2 # (C) Copyright 2006-2009
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 # 4 #
5 # SPDX-License-Identifier: GPL-2.0+ 5 # SPDX-License-Identifier: GPL-2.0+
6 # 6 #
7 7
8 ifdef CONFIG_DM_SERIAL 8 ifdef CONFIG_DM_SERIAL
9 obj-$(CONFIG_$(SPL_TPL_)DM_SERIAL) += serial-uclass.o 9 obj-$(CONFIG_$(SPL_TPL_)DM_SERIAL) += serial-uclass.o
10 obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o 10 obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o
11 else 11 else
12 obj-y += serial.o 12 obj-y += serial.o
13 obj-$(CONFIG_PL010_SERIAL) += serial_pl01x.o 13 obj-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
14 obj-$(CONFIG_PL011_SERIAL) += serial_pl01x.o 14 obj-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
15 obj-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o 15 obj-$(CONFIG_SYS_NS16550_SERIAL) += serial_ns16550.o
16 endif 16 endif
17 17
18 obj-$(CONFIG_ALTERA_UART) += altera_uart.o 18 obj-$(CONFIG_ALTERA_UART) += altera_uart.o
19 obj-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o 19 obj-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
20 obj-$(CONFIG_AR933X_UART) += serial_ar933x.o 20 obj-$(CONFIG_AR933X_UART) += serial_ar933x.o
21 obj-$(CONFIG_ARM_DCC) += arm_dcc.o 21 obj-$(CONFIG_ARM_DCC) += arm_dcc.o
22 obj-$(CONFIG_ATMEL_USART) += atmel_usart.o 22 obj-$(CONFIG_ATMEL_USART) += atmel_usart.o
23 obj-$(CONFIG_BCM6345_SERIAL) += serial_bcm6345.o 23 obj-$(CONFIG_BCM6345_SERIAL) += serial_bcm6345.o
24 obj-$(CONFIG_EFI_APP) += serial_efi.o 24 obj-$(CONFIG_EFI_APP) += serial_efi.o
25 obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o 25 obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
26 obj-$(CONFIG_MCFUART) += mcfuart.o 26 obj-$(CONFIG_MCFUART) += mcfuart.o
27 obj-$(CONFIG_SYS_NS16550) += ns16550.o 27 obj-$(CONFIG_SYS_NS16550) += ns16550.o
28 obj-$(CONFIG_S5P) += serial_s5p.o 28 obj-$(CONFIG_S5P) += serial_s5p.o
29 obj-$(CONFIG_MXC_UART) += serial_mxc.o 29 obj-$(CONFIG_MXC_UART) += serial_mxc.o
30 obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o 30 obj-$(CONFIG_PXA_SERIAL) += serial_pxa.o
31 obj-$(CONFIG_MESON_SERIAL) += serial_meson.o 31 obj-$(CONFIG_MESON_SERIAL) += serial_meson.o
32 obj-$(CONFIG_INTEL_MID_SERIAL) += serial_intel_mid.o 32 obj-$(CONFIG_INTEL_MID_SERIAL) += serial_intel_mid.o
33 ifdef CONFIG_SPL_BUILD 33 ifdef CONFIG_SPL_BUILD
34 obj-$(CONFIG_ROCKCHIP_SERIAL) += serial_rockchip.o 34 obj-$(CONFIG_ROCKCHIP_SERIAL) += serial_rockchip.o
35 endif 35 endif
36 obj-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o 36 obj-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
37 obj-$(CONFIG_SANDBOX_SERIAL) += sandbox.o 37 obj-$(CONFIG_SANDBOX_SERIAL) += sandbox.o
38 obj-$(CONFIG_SCIF_CONSOLE) += serial_sh.o 38 obj-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
39 obj-$(CONFIG_ZYNQ_SERIAL) += serial_zynq.o 39 obj-$(CONFIG_ZYNQ_SERIAL) += serial_zynq.o
40 obj-$(CONFIG_FSL_LPUART) += serial_lpuart.o 40 obj-$(CONFIG_FSL_LPUART) += serial_lpuart.o
41 obj-$(CONFIG_FSL_LINFLEXUART) += serial_linflexuart.o 41 obj-$(CONFIG_FSL_LINFLEXUART) += serial_linflexuart.o
42 obj-$(CONFIG_ARC_SERIAL) += serial_arc.o 42 obj-$(CONFIG_ARC_SERIAL) += serial_arc.o
43 obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o 43 obj-$(CONFIG_UNIPHIER_SERIAL) += serial_uniphier.o
44 obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o 44 obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o
45 obj-$(CONFIG_STI_ASC_SERIAL) += serial_sti_asc.o 45 obj-$(CONFIG_STI_ASC_SERIAL) += serial_sti_asc.o
46 obj-$(CONFIG_PIC32_SERIAL) += serial_pic32.o 46 obj-$(CONFIG_PIC32_SERIAL) += serial_pic32.o
47 obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o 47 obj-$(CONFIG_STM32_SERIAL) += serial_stm32.o
48 obj-$(CONFIG_BCM283X_MU_SERIAL) += serial_bcm283x_mu.o 48 obj-$(CONFIG_BCM283X_MU_SERIAL) += serial_bcm283x_mu.o
49 obj-$(CONFIG_BCM283X_PL011_SERIAL) += serial_bcm283x_pl011.o
49 obj-$(CONFIG_MSM_SERIAL) += serial_msm.o 50 obj-$(CONFIG_MSM_SERIAL) += serial_msm.o
50 obj-$(CONFIG_MVEBU_A3700_UART) += serial_mvebu_a3700.o 51 obj-$(CONFIG_MVEBU_A3700_UART) += serial_mvebu_a3700.o
51 obj-$(CONFIG_MPC8XX_CONS) += serial_mpc8xx.o 52 obj-$(CONFIG_MPC8XX_CONS) += serial_mpc8xx.o
52 obj-$(CONFIG_NULLDEV_SERIAL) += serial_nulldev.o 53 obj-$(CONFIG_NULLDEV_SERIAL) += serial_nulldev.o
53 54
54 ifndef CONFIG_SPL_BUILD 55 ifndef CONFIG_SPL_BUILD
55 obj-$(CONFIG_USB_TTY) += usbtty.o 56 obj-$(CONFIG_USB_TTY) += usbtty.o
56 endif 57 endif
57 58
drivers/serial/serial_bcm283x_pl011.c
File was created 1 /*
2 * Copyright (c) 2018 Alexander Graf <agraf@suse.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7 #include <common.h>
8 #include <dm.h>
9 #include <asm/gpio.h>
10 #include <dm/pinctrl.h>
11 #include <dm/platform_data/serial_pl01x.h>
12 #include "serial_pl01x_internal.h"
13
14 /*
15 * Check if this serial device is muxed
16 *
17 * The serial device will only work properly if it has been muxed to the serial
18 * pins by firmware. Check whether that happened here.
19 *
20 * @return true if serial device is muxed, false if not
21 */
22 static bool bcm283x_is_serial_muxed(void)
23 {
24 int serial_gpio = 15;
25 struct udevice *dev;
26
27 if (uclass_first_device(UCLASS_PINCTRL, &dev) || !dev)
28 return false;
29
30 if (pinctrl_get_gpio_mux(dev, 0, serial_gpio) != BCM2835_GPIO_ALT0)
31 return false;
32
33 return true;
34 }
35
36 static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev)
37 {
38 struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
39 int ret;
40
41 /* Don't spawn the device if it's not muxed */
42 if (!bcm283x_is_serial_muxed())
43 return -ENODEV;
44
45 ret = pl01x_serial_ofdata_to_platdata(dev);
46 if (ret)
47 return ret;
48
49 /*
50 * TODO: Reinitialization doesn't always work for now, just skip
51 * init always - we know we're already initialized
52 */
53 plat->skip_init = true;
54
55 return 0;
56 }
57
58 static const struct udevice_id bcm283x_pl011_serial_id[] = {
59 {.compatible = "brcm,bcm2835-pl011", .data = TYPE_PL011},
60 {}
61 };
62
63 U_BOOT_DRIVER(bcm283x_pl011_uart) = {
64 .name = "bcm283x_pl011",
65 .id = UCLASS_SERIAL,
66 .of_match = of_match_ptr(bcm283x_pl011_serial_id),
67 .ofdata_to_platdata = of_match_ptr(bcm283x_pl011_serial_ofdata_to_platdata),
68 .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata),
69 .probe = pl01x_serial_probe,
70 .ops = &pl01x_serial_ops,
71 .flags = DM_FLAG_PRE_RELOC,
72 .priv_auto_alloc_size = sizeof(struct pl01x_priv),
73 };
74
drivers/serial/serial_pl01x.c
1 /* 1 /*
2 * (C) Copyright 2000 2 * (C) Copyright 2000
3 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com. 3 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
4 * 4 *
5 * (C) Copyright 2004 5 * (C) Copyright 2004
6 * ARM Ltd. 6 * ARM Ltd.
7 * Philippe Robin, <philippe.robin@arm.com> 7 * Philippe Robin, <philippe.robin@arm.com>
8 * 8 *
9 * SPDX-License-Identifier: GPL-2.0+ 9 * SPDX-License-Identifier: GPL-2.0+
10 */ 10 */
11 11
12 /* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */ 12 /* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */
13 13
14 #include <common.h> 14 #include <common.h>
15 #include <dm.h> 15 #include <dm.h>
16 #include <errno.h> 16 #include <errno.h>
17 #include <watchdog.h> 17 #include <watchdog.h>
18 #include <asm/io.h> 18 #include <asm/io.h>
19 #include <serial.h> 19 #include <serial.h>
20 #include <dm/platform_data/serial_pl01x.h> 20 #include <dm/platform_data/serial_pl01x.h>
21 #include <linux/compiler.h> 21 #include <linux/compiler.h>
22 #include "serial_pl01x_internal.h" 22 #include "serial_pl01x_internal.h"
23 23
24 DECLARE_GLOBAL_DATA_PTR; 24 DECLARE_GLOBAL_DATA_PTR;
25 25
26 #ifndef CONFIG_DM_SERIAL 26 #ifndef CONFIG_DM_SERIAL
27 27
28 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS; 28 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
29 static enum pl01x_type pl01x_type __attribute__ ((section(".data"))); 29 static enum pl01x_type pl01x_type __attribute__ ((section(".data")));
30 static struct pl01x_regs *base_regs __attribute__ ((section(".data"))); 30 static struct pl01x_regs *base_regs __attribute__ ((section(".data")));
31 #define NUM_PORTS (sizeof(port)/sizeof(port[0])) 31 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
32 32
33 #endif 33 #endif
34 34
35 static int pl01x_putc(struct pl01x_regs *regs, char c) 35 static int pl01x_putc(struct pl01x_regs *regs, char c)
36 { 36 {
37 /* Wait until there is space in the FIFO */ 37 /* Wait until there is space in the FIFO */
38 if (readl(&regs->fr) & UART_PL01x_FR_TXFF) 38 if (readl(&regs->fr) & UART_PL01x_FR_TXFF)
39 return -EAGAIN; 39 return -EAGAIN;
40 40
41 /* Send the character */ 41 /* Send the character */
42 writel(c, &regs->dr); 42 writel(c, &regs->dr);
43 43
44 return 0; 44 return 0;
45 } 45 }
46 46
47 static int pl01x_getc(struct pl01x_regs *regs) 47 static int pl01x_getc(struct pl01x_regs *regs)
48 { 48 {
49 unsigned int data; 49 unsigned int data;
50 50
51 /* Wait until there is data in the FIFO */ 51 /* Wait until there is data in the FIFO */
52 if (readl(&regs->fr) & UART_PL01x_FR_RXFE) 52 if (readl(&regs->fr) & UART_PL01x_FR_RXFE)
53 return -EAGAIN; 53 return -EAGAIN;
54 54
55 data = readl(&regs->dr); 55 data = readl(&regs->dr);
56 56
57 /* Check for an error flag */ 57 /* Check for an error flag */
58 if (data & 0xFFFFFF00) { 58 if (data & 0xFFFFFF00) {
59 /* Clear the error */ 59 /* Clear the error */
60 writel(0xFFFFFFFF, &regs->ecr); 60 writel(0xFFFFFFFF, &regs->ecr);
61 return -1; 61 return -1;
62 } 62 }
63 63
64 return (int) data; 64 return (int) data;
65 } 65 }
66 66
67 static int pl01x_tstc(struct pl01x_regs *regs) 67 static int pl01x_tstc(struct pl01x_regs *regs)
68 { 68 {
69 WATCHDOG_RESET(); 69 WATCHDOG_RESET();
70 return !(readl(&regs->fr) & UART_PL01x_FR_RXFE); 70 return !(readl(&regs->fr) & UART_PL01x_FR_RXFE);
71 } 71 }
72 72
73 static int pl01x_generic_serial_init(struct pl01x_regs *regs, 73 static int pl01x_generic_serial_init(struct pl01x_regs *regs,
74 enum pl01x_type type) 74 enum pl01x_type type)
75 { 75 {
76 switch (type) { 76 switch (type) {
77 case TYPE_PL010: 77 case TYPE_PL010:
78 /* disable everything */ 78 /* disable everything */
79 writel(0, &regs->pl010_cr); 79 writel(0, &regs->pl010_cr);
80 break; 80 break;
81 case TYPE_PL011: 81 case TYPE_PL011:
82 /* disable everything */ 82 /* disable everything */
83 writel(0, &regs->pl011_cr); 83 writel(0, &regs->pl011_cr);
84 break; 84 break;
85 default: 85 default:
86 return -EINVAL; 86 return -EINVAL;
87 } 87 }
88 88
89 return 0; 89 return 0;
90 } 90 }
91 91
92 static int pl011_set_line_control(struct pl01x_regs *regs) 92 static int pl011_set_line_control(struct pl01x_regs *regs)
93 { 93 {
94 unsigned int lcr; 94 unsigned int lcr;
95 /* 95 /*
96 * Internal update of baud rate register require line 96 * Internal update of baud rate register require line
97 * control register write 97 * control register write
98 */ 98 */
99 lcr = UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN; 99 lcr = UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN;
100 writel(lcr, &regs->pl011_lcrh); 100 writel(lcr, &regs->pl011_lcrh);
101 return 0; 101 return 0;
102 } 102 }
103 103
104 static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type, 104 static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,
105 int clock, int baudrate) 105 int clock, int baudrate)
106 { 106 {
107 switch (type) { 107 switch (type) {
108 case TYPE_PL010: { 108 case TYPE_PL010: {
109 unsigned int divisor; 109 unsigned int divisor;
110 110
111 /* disable everything */ 111 /* disable everything */
112 writel(0, &regs->pl010_cr); 112 writel(0, &regs->pl010_cr);
113 113
114 switch (baudrate) { 114 switch (baudrate) {
115 case 9600: 115 case 9600:
116 divisor = UART_PL010_BAUD_9600; 116 divisor = UART_PL010_BAUD_9600;
117 break; 117 break;
118 case 19200: 118 case 19200:
119 divisor = UART_PL010_BAUD_19200; 119 divisor = UART_PL010_BAUD_19200;
120 break; 120 break;
121 case 38400: 121 case 38400:
122 divisor = UART_PL010_BAUD_38400; 122 divisor = UART_PL010_BAUD_38400;
123 break; 123 break;
124 case 57600: 124 case 57600:
125 divisor = UART_PL010_BAUD_57600; 125 divisor = UART_PL010_BAUD_57600;
126 break; 126 break;
127 case 115200: 127 case 115200:
128 divisor = UART_PL010_BAUD_115200; 128 divisor = UART_PL010_BAUD_115200;
129 break; 129 break;
130 default: 130 default:
131 divisor = UART_PL010_BAUD_38400; 131 divisor = UART_PL010_BAUD_38400;
132 } 132 }
133 133
134 writel((divisor & 0xf00) >> 8, &regs->pl010_lcrm); 134 writel((divisor & 0xf00) >> 8, &regs->pl010_lcrm);
135 writel(divisor & 0xff, &regs->pl010_lcrl); 135 writel(divisor & 0xff, &regs->pl010_lcrl);
136 136
137 /* 137 /*
138 * Set line control for the PL010 to be 8 bits, 1 stop bit, 138 * Set line control for the PL010 to be 8 bits, 1 stop bit,
139 * no parity, fifo enabled 139 * no parity, fifo enabled
140 */ 140 */
141 writel(UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN, 141 writel(UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN,
142 &regs->pl010_lcrh); 142 &regs->pl010_lcrh);
143 /* Finally, enable the UART */ 143 /* Finally, enable the UART */
144 writel(UART_PL010_CR_UARTEN, &regs->pl010_cr); 144 writel(UART_PL010_CR_UARTEN, &regs->pl010_cr);
145 break; 145 break;
146 } 146 }
147 case TYPE_PL011: { 147 case TYPE_PL011: {
148 unsigned int temp; 148 unsigned int temp;
149 unsigned int divider; 149 unsigned int divider;
150 unsigned int remainder; 150 unsigned int remainder;
151 unsigned int fraction; 151 unsigned int fraction;
152 152
153 /* 153 /*
154 * Set baud rate 154 * Set baud rate
155 * 155 *
156 * IBRD = UART_CLK / (16 * BAUD_RATE) 156 * IBRD = UART_CLK / (16 * BAUD_RATE)
157 * FBRD = RND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) 157 * FBRD = RND((64 * MOD(UART_CLK,(16 * BAUD_RATE)))
158 * / (16 * BAUD_RATE)) 158 * / (16 * BAUD_RATE))
159 */ 159 */
160 temp = 16 * baudrate; 160 temp = 16 * baudrate;
161 divider = clock / temp; 161 divider = clock / temp;
162 remainder = clock % temp; 162 remainder = clock % temp;
163 temp = (8 * remainder) / baudrate; 163 temp = (8 * remainder) / baudrate;
164 fraction = (temp >> 1) + (temp & 1); 164 fraction = (temp >> 1) + (temp & 1);
165 165
166 writel(divider, &regs->pl011_ibrd); 166 writel(divider, &regs->pl011_ibrd);
167 writel(fraction, &regs->pl011_fbrd); 167 writel(fraction, &regs->pl011_fbrd);
168 168
169 pl011_set_line_control(regs); 169 pl011_set_line_control(regs);
170 /* Finally, enable the UART */ 170 /* Finally, enable the UART */
171 writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE | 171 writel(UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
172 UART_PL011_CR_RXE | UART_PL011_CR_RTS, &regs->pl011_cr); 172 UART_PL011_CR_RXE | UART_PL011_CR_RTS, &regs->pl011_cr);
173 break; 173 break;
174 } 174 }
175 default: 175 default:
176 return -EINVAL; 176 return -EINVAL;
177 } 177 }
178 178
179 return 0; 179 return 0;
180 } 180 }
181 181
182 #ifndef CONFIG_DM_SERIAL 182 #ifndef CONFIG_DM_SERIAL
183 static void pl01x_serial_init_baud(int baudrate) 183 static void pl01x_serial_init_baud(int baudrate)
184 { 184 {
185 int clock = 0; 185 int clock = 0;
186 186
187 #if defined(CONFIG_PL010_SERIAL) 187 #if defined(CONFIG_PL010_SERIAL)
188 pl01x_type = TYPE_PL010; 188 pl01x_type = TYPE_PL010;
189 #elif defined(CONFIG_PL011_SERIAL) 189 #elif defined(CONFIG_PL011_SERIAL)
190 pl01x_type = TYPE_PL011; 190 pl01x_type = TYPE_PL011;
191 clock = CONFIG_PL011_CLOCK; 191 clock = CONFIG_PL011_CLOCK;
192 #endif 192 #endif
193 base_regs = (struct pl01x_regs *)port[CONFIG_CONS_INDEX]; 193 base_regs = (struct pl01x_regs *)port[CONFIG_CONS_INDEX];
194 194
195 pl01x_generic_serial_init(base_regs, pl01x_type); 195 pl01x_generic_serial_init(base_regs, pl01x_type);
196 pl01x_generic_setbrg(base_regs, pl01x_type, clock, baudrate); 196 pl01x_generic_setbrg(base_regs, pl01x_type, clock, baudrate);
197 } 197 }
198 198
199 /* 199 /*
200 * Integrator AP has two UARTs, we use the first one, at 38400-8-N-1 200 * Integrator AP has two UARTs, we use the first one, at 38400-8-N-1
201 * Integrator CP has two UARTs, use the first one, at 38400-8-N-1 201 * Integrator CP has two UARTs, use the first one, at 38400-8-N-1
202 * Versatile PB has four UARTs. 202 * Versatile PB has four UARTs.
203 */ 203 */
204 int pl01x_serial_init(void) 204 int pl01x_serial_init(void)
205 { 205 {
206 pl01x_serial_init_baud(CONFIG_BAUDRATE); 206 pl01x_serial_init_baud(CONFIG_BAUDRATE);
207 207
208 return 0; 208 return 0;
209 } 209 }
210 210
211 static void pl01x_serial_putc(const char c) 211 static void pl01x_serial_putc(const char c)
212 { 212 {
213 if (c == '\n') 213 if (c == '\n')
214 while (pl01x_putc(base_regs, '\r') == -EAGAIN); 214 while (pl01x_putc(base_regs, '\r') == -EAGAIN);
215 215
216 while (pl01x_putc(base_regs, c) == -EAGAIN); 216 while (pl01x_putc(base_regs, c) == -EAGAIN);
217 } 217 }
218 218
219 static int pl01x_serial_getc(void) 219 static int pl01x_serial_getc(void)
220 { 220 {
221 while (1) { 221 while (1) {
222 int ch = pl01x_getc(base_regs); 222 int ch = pl01x_getc(base_regs);
223 223
224 if (ch == -EAGAIN) { 224 if (ch == -EAGAIN) {
225 WATCHDOG_RESET(); 225 WATCHDOG_RESET();
226 continue; 226 continue;
227 } 227 }
228 228
229 return ch; 229 return ch;
230 } 230 }
231 } 231 }
232 232
233 static int pl01x_serial_tstc(void) 233 static int pl01x_serial_tstc(void)
234 { 234 {
235 return pl01x_tstc(base_regs); 235 return pl01x_tstc(base_regs);
236 } 236 }
237 237
238 static void pl01x_serial_setbrg(void) 238 static void pl01x_serial_setbrg(void)
239 { 239 {
240 /* 240 /*
241 * Flush FIFO and wait for non-busy before changing baudrate to avoid 241 * Flush FIFO and wait for non-busy before changing baudrate to avoid
242 * crap in console 242 * crap in console
243 */ 243 */
244 while (!(readl(&base_regs->fr) & UART_PL01x_FR_TXFE)) 244 while (!(readl(&base_regs->fr) & UART_PL01x_FR_TXFE))
245 WATCHDOG_RESET(); 245 WATCHDOG_RESET();
246 while (readl(&base_regs->fr) & UART_PL01x_FR_BUSY) 246 while (readl(&base_regs->fr) & UART_PL01x_FR_BUSY)
247 WATCHDOG_RESET(); 247 WATCHDOG_RESET();
248 pl01x_serial_init_baud(gd->baudrate); 248 pl01x_serial_init_baud(gd->baudrate);
249 } 249 }
250 250
251 static struct serial_device pl01x_serial_drv = { 251 static struct serial_device pl01x_serial_drv = {
252 .name = "pl01x_serial", 252 .name = "pl01x_serial",
253 .start = pl01x_serial_init, 253 .start = pl01x_serial_init,
254 .stop = NULL, 254 .stop = NULL,
255 .setbrg = pl01x_serial_setbrg, 255 .setbrg = pl01x_serial_setbrg,
256 .putc = pl01x_serial_putc, 256 .putc = pl01x_serial_putc,
257 .puts = default_serial_puts, 257 .puts = default_serial_puts,
258 .getc = pl01x_serial_getc, 258 .getc = pl01x_serial_getc,
259 .tstc = pl01x_serial_tstc, 259 .tstc = pl01x_serial_tstc,
260 }; 260 };
261 261
262 void pl01x_serial_initialize(void) 262 void pl01x_serial_initialize(void)
263 { 263 {
264 serial_register(&pl01x_serial_drv); 264 serial_register(&pl01x_serial_drv);
265 } 265 }
266 266
267 __weak struct serial_device *default_serial_console(void) 267 __weak struct serial_device *default_serial_console(void)
268 { 268 {
269 return &pl01x_serial_drv; 269 return &pl01x_serial_drv;
270 } 270 }
271 271
272 #endif /* nCONFIG_DM_SERIAL */ 272 #endif /* nCONFIG_DM_SERIAL */
273 273
274 #ifdef CONFIG_DM_SERIAL 274 #ifdef CONFIG_DM_SERIAL
275 275
276 struct pl01x_priv {
277 struct pl01x_regs *regs;
278 enum pl01x_type type;
279 };
280
281 static int pl01x_serial_setbrg(struct udevice *dev, int baudrate) 276 static int pl01x_serial_setbrg(struct udevice *dev, int baudrate)
282 { 277 {
283 struct pl01x_serial_platdata *plat = dev_get_platdata(dev); 278 struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
284 struct pl01x_priv *priv = dev_get_priv(dev); 279 struct pl01x_priv *priv = dev_get_priv(dev);
285 280
286 if (!plat->skip_init) { 281 if (!plat->skip_init) {
287 pl01x_generic_setbrg(priv->regs, priv->type, plat->clock, 282 pl01x_generic_setbrg(priv->regs, priv->type, plat->clock,
288 baudrate); 283 baudrate);
289 } 284 }
290 285
291 return 0; 286 return 0;
292 } 287 }
293 288
294 static int pl01x_serial_probe(struct udevice *dev) 289 int pl01x_serial_probe(struct udevice *dev)
295 { 290 {
296 struct pl01x_serial_platdata *plat = dev_get_platdata(dev); 291 struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
297 struct pl01x_priv *priv = dev_get_priv(dev); 292 struct pl01x_priv *priv = dev_get_priv(dev);
298 293
299 priv->regs = (struct pl01x_regs *)plat->base; 294 priv->regs = (struct pl01x_regs *)plat->base;
300 priv->type = plat->type; 295 priv->type = plat->type;
301 if (!plat->skip_init) 296 if (!plat->skip_init)
302 return pl01x_generic_serial_init(priv->regs, priv->type); 297 return pl01x_generic_serial_init(priv->regs, priv->type);
303 else 298 else
304 return 0; 299 return 0;
305 } 300 }
306 301
307 static int pl01x_serial_getc(struct udevice *dev) 302 static int pl01x_serial_getc(struct udevice *dev)
308 { 303 {
309 struct pl01x_priv *priv = dev_get_priv(dev); 304 struct pl01x_priv *priv = dev_get_priv(dev);
310 305
311 return pl01x_getc(priv->regs); 306 return pl01x_getc(priv->regs);
312 } 307 }
313 308
314 static int pl01x_serial_putc(struct udevice *dev, const char ch) 309 static int pl01x_serial_putc(struct udevice *dev, const char ch)
315 { 310 {
316 struct pl01x_priv *priv = dev_get_priv(dev); 311 struct pl01x_priv *priv = dev_get_priv(dev);
317 312
318 return pl01x_putc(priv->regs, ch); 313 return pl01x_putc(priv->regs, ch);
319 } 314 }
320 315
321 static int pl01x_serial_pending(struct udevice *dev, bool input) 316 static int pl01x_serial_pending(struct udevice *dev, bool input)
322 { 317 {
323 struct pl01x_priv *priv = dev_get_priv(dev); 318 struct pl01x_priv *priv = dev_get_priv(dev);
324 unsigned int fr = readl(&priv->regs->fr); 319 unsigned int fr = readl(&priv->regs->fr);
325 320
326 if (input) 321 if (input)
327 return pl01x_tstc(priv->regs); 322 return pl01x_tstc(priv->regs);
328 else 323 else
329 return fr & UART_PL01x_FR_TXFF ? 0 : 1; 324 return fr & UART_PL01x_FR_TXFF ? 0 : 1;
330 } 325 }
331 326
332 static const struct dm_serial_ops pl01x_serial_ops = { 327 const struct dm_serial_ops pl01x_serial_ops = {
333 .putc = pl01x_serial_putc, 328 .putc = pl01x_serial_putc,
334 .pending = pl01x_serial_pending, 329 .pending = pl01x_serial_pending,
335 .getc = pl01x_serial_getc, 330 .getc = pl01x_serial_getc,
336 .setbrg = pl01x_serial_setbrg, 331 .setbrg = pl01x_serial_setbrg,
337 }; 332 };
338 333
339 #if CONFIG_IS_ENABLED(OF_CONTROL) 334 #if CONFIG_IS_ENABLED(OF_CONTROL)
340 static const struct udevice_id pl01x_serial_id[] ={ 335 static const struct udevice_id pl01x_serial_id[] ={
341 {.compatible = "arm,pl011", .data = TYPE_PL011}, 336 {.compatible = "arm,pl011", .data = TYPE_PL011},
342 {.compatible = "arm,pl010", .data = TYPE_PL010}, 337 {.compatible = "arm,pl010", .data = TYPE_PL010},
343 {} 338 {}
344 }; 339 };
345 340
346 static int pl01x_serial_ofdata_to_platdata(struct udevice *dev) 341 int pl01x_serial_ofdata_to_platdata(struct udevice *dev)
347 { 342 {
348 struct pl01x_serial_platdata *plat = dev_get_platdata(dev); 343 struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
349 fdt_addr_t addr; 344 fdt_addr_t addr;
350 345
351 addr = devfdt_get_addr(dev); 346 addr = devfdt_get_addr(dev);
352 if (addr == FDT_ADDR_T_NONE) 347 if (addr == FDT_ADDR_T_NONE)
353 return -EINVAL; 348 return -EINVAL;
354 349
355 plat->base = addr; 350 plat->base = addr;
356 plat->clock = dev_read_u32_default(dev, "clock", 1); 351 plat->clock = dev_read_u32_default(dev, "clock", 1);
357 plat->type = dev_get_driver_data(dev); 352 plat->type = dev_get_driver_data(dev);
358 plat->skip_init = dev_read_bool(dev, "skip-init"); 353 plat->skip_init = dev_read_bool(dev, "skip-init");
359 354
360 return 0; 355 return 0;
361 } 356 }
362 #endif 357 #endif
363 358
364 U_BOOT_DRIVER(serial_pl01x) = { 359 U_BOOT_DRIVER(serial_pl01x) = {
365 .name = "serial_pl01x", 360 .name = "serial_pl01x",
366 .id = UCLASS_SERIAL, 361 .id = UCLASS_SERIAL,
367 .of_match = of_match_ptr(pl01x_serial_id), 362 .of_match = of_match_ptr(pl01x_serial_id),
368 .ofdata_to_platdata = of_match_ptr(pl01x_serial_ofdata_to_platdata), 363 .ofdata_to_platdata = of_match_ptr(pl01x_serial_ofdata_to_platdata),
369 .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata), 364 .platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata),
370 .probe = pl01x_serial_probe, 365 .probe = pl01x_serial_probe,
371 .ops = &pl01x_serial_ops, 366 .ops = &pl01x_serial_ops,
372 .flags = DM_FLAG_PRE_RELOC, 367 .flags = DM_FLAG_PRE_RELOC,
373 .priv_auto_alloc_size = sizeof(struct pl01x_priv), 368 .priv_auto_alloc_size = sizeof(struct pl01x_priv),
374 }; 369 };
375 370
376 #endif 371 #endif
377 372
378 #if defined(CONFIG_DEBUG_UART_PL010) || defined(CONFIG_DEBUG_UART_PL011) 373 #if defined(CONFIG_DEBUG_UART_PL010) || defined(CONFIG_DEBUG_UART_PL011)
379 374
380 #include <debug_uart.h> 375 #include <debug_uart.h>
381 376
382 static void _debug_uart_init(void) 377 static void _debug_uart_init(void)
383 { 378 {
384 #ifndef CONFIG_DEBUG_UART_SKIP_INIT 379 #ifndef CONFIG_DEBUG_UART_SKIP_INIT
385 struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE; 380 struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
386 enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ? 381 enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ?
387 TYPE_PL011 : TYPE_PL010; 382 TYPE_PL011 : TYPE_PL010;
388 383
389 pl01x_generic_serial_init(regs, type); 384 pl01x_generic_serial_init(regs, type);
390 pl01x_generic_setbrg(regs, type, 385 pl01x_generic_setbrg(regs, type,
391 CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE); 386 CONFIG_DEBUG_UART_CLOCK, CONFIG_BAUDRATE);
392 #endif 387 #endif
393 } 388 }
394 389
395 static inline void _debug_uart_putc(int ch) 390 static inline void _debug_uart_putc(int ch)
396 { 391 {
397 struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE; 392 struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
398 393
399 pl01x_putc(regs, ch); 394 pl01x_putc(regs, ch);
400 } 395 }
401 396
402 DEBUG_UART_FUNCS 397 DEBUG_UART_FUNCS
403 398
404 #endif 399 #endif
405 400
drivers/serial/serial_pl01x_internal.h
1 /* 1 /*
2 * (C) Copyright 2003, 2004 2 * (C) Copyright 2003, 2004
3 * ARM Ltd. 3 * ARM Ltd.
4 * Philippe Robin, <philippe.robin@arm.com> 4 * Philippe Robin, <philippe.robin@arm.com>
5 * 5 *
6 * SPDX-License-Identifier: GPL-2.0+ 6 * SPDX-License-Identifier: GPL-2.0+
7 */ 7 */
8 8
9 /* 9 /*
10 * ARM PrimeCell UART's (PL010 & PL011) 10 * ARM PrimeCell UART's (PL010 & PL011)
11 * ------------------------------------ 11 * ------------------------------------
12 * 12 *
13 * Definitions common to both PL010 & PL011 13 * Definitions common to both PL010 & PL011
14 * 14 *
15 */ 15 */
16 16
17 #ifndef __ASSEMBLY__ 17 #ifndef __ASSEMBLY__
18 /* 18 /*
19 * We can use a combined structure for PL010 and PL011, because they overlap 19 * We can use a combined structure for PL010 and PL011, because they overlap
20 * only in common registers. 20 * only in common registers.
21 */ 21 */
22 struct pl01x_regs { 22 struct pl01x_regs {
23 u32 dr; /* 0x00 Data register */ 23 u32 dr; /* 0x00 Data register */
24 u32 ecr; /* 0x04 Error clear register (Write) */ 24 u32 ecr; /* 0x04 Error clear register (Write) */
25 u32 pl010_lcrh; /* 0x08 Line control register, high byte */ 25 u32 pl010_lcrh; /* 0x08 Line control register, high byte */
26 u32 pl010_lcrm; /* 0x0C Line control register, middle byte */ 26 u32 pl010_lcrm; /* 0x0C Line control register, middle byte */
27 u32 pl010_lcrl; /* 0x10 Line control register, low byte */ 27 u32 pl010_lcrl; /* 0x10 Line control register, low byte */
28 u32 pl010_cr; /* 0x14 Control register */ 28 u32 pl010_cr; /* 0x14 Control register */
29 u32 fr; /* 0x18 Flag register (Read only) */ 29 u32 fr; /* 0x18 Flag register (Read only) */
30 #ifdef CONFIG_PL011_SERIAL_RLCR 30 #ifdef CONFIG_PL011_SERIAL_RLCR
31 u32 pl011_rlcr; /* 0x1c Receive line control register */ 31 u32 pl011_rlcr; /* 0x1c Receive line control register */
32 #else 32 #else
33 u32 reserved; 33 u32 reserved;
34 #endif 34 #endif
35 u32 ilpr; /* 0x20 IrDA low-power counter register */ 35 u32 ilpr; /* 0x20 IrDA low-power counter register */
36 u32 pl011_ibrd; /* 0x24 Integer baud rate register */ 36 u32 pl011_ibrd; /* 0x24 Integer baud rate register */
37 u32 pl011_fbrd; /* 0x28 Fractional baud rate register */ 37 u32 pl011_fbrd; /* 0x28 Fractional baud rate register */
38 u32 pl011_lcrh; /* 0x2C Line control register */ 38 u32 pl011_lcrh; /* 0x2C Line control register */
39 u32 pl011_cr; /* 0x30 Control register */ 39 u32 pl011_cr; /* 0x30 Control register */
40 }; 40 };
41 #endif 41
42 #ifdef CONFIG_DM_SERIAL
43
44 int pl01x_serial_ofdata_to_platdata(struct udevice *dev);
45 int pl01x_serial_probe(struct udevice *dev);
46 extern const struct dm_serial_ops pl01x_serial_ops;
47
48 struct pl01x_priv {
49 struct pl01x_regs *regs;
50 enum pl01x_type type;
51 };
52
53 #endif /* CONFIG_DM_SERIAL */
54 #endif /* !__ASSEMBLY__ */
42 55
43 #define UART_PL01x_RSR_OE 0x08 56 #define UART_PL01x_RSR_OE 0x08
44 #define UART_PL01x_RSR_BE 0x04 57 #define UART_PL01x_RSR_BE 0x04
45 #define UART_PL01x_RSR_PE 0x02 58 #define UART_PL01x_RSR_PE 0x02
46 #define UART_PL01x_RSR_FE 0x01 59 #define UART_PL01x_RSR_FE 0x01
47 60
48 #define UART_PL01x_FR_TXFE 0x80 61 #define UART_PL01x_FR_TXFE 0x80
49 #define UART_PL01x_FR_RXFF 0x40 62 #define UART_PL01x_FR_RXFF 0x40
50 #define UART_PL01x_FR_TXFF 0x20 63 #define UART_PL01x_FR_TXFF 0x20
51 #define UART_PL01x_FR_RXFE 0x10 64 #define UART_PL01x_FR_RXFE 0x10
52 #define UART_PL01x_FR_BUSY 0x08 65 #define UART_PL01x_FR_BUSY 0x08
53 #define UART_PL01x_FR_TMSK (UART_PL01x_FR_TXFF + UART_PL01x_FR_BUSY) 66 #define UART_PL01x_FR_TMSK (UART_PL01x_FR_TXFF + UART_PL01x_FR_BUSY)
54 67
55 /* 68 /*
56 * PL010 definitions 69 * PL010 definitions
57 * 70 *
58 */ 71 */
59 #define UART_PL010_CR_LPE (1 << 7) 72 #define UART_PL010_CR_LPE (1 << 7)
60 #define UART_PL010_CR_RTIE (1 << 6) 73 #define UART_PL010_CR_RTIE (1 << 6)
61 #define UART_PL010_CR_TIE (1 << 5) 74 #define UART_PL010_CR_TIE (1 << 5)
62 #define UART_PL010_CR_RIE (1 << 4) 75 #define UART_PL010_CR_RIE (1 << 4)
63 #define UART_PL010_CR_MSIE (1 << 3) 76 #define UART_PL010_CR_MSIE (1 << 3)
64 #define UART_PL010_CR_IIRLP (1 << 2) 77 #define UART_PL010_CR_IIRLP (1 << 2)
65 #define UART_PL010_CR_SIREN (1 << 1) 78 #define UART_PL010_CR_SIREN (1 << 1)
66 #define UART_PL010_CR_UARTEN (1 << 0) 79 #define UART_PL010_CR_UARTEN (1 << 0)
67 80
68 #define UART_PL010_LCRH_WLEN_8 (3 << 5) 81 #define UART_PL010_LCRH_WLEN_8 (3 << 5)
69 #define UART_PL010_LCRH_WLEN_7 (2 << 5) 82 #define UART_PL010_LCRH_WLEN_7 (2 << 5)
70 #define UART_PL010_LCRH_WLEN_6 (1 << 5) 83 #define UART_PL010_LCRH_WLEN_6 (1 << 5)
71 #define UART_PL010_LCRH_WLEN_5 (0 << 5) 84 #define UART_PL010_LCRH_WLEN_5 (0 << 5)
72 #define UART_PL010_LCRH_FEN (1 << 4) 85 #define UART_PL010_LCRH_FEN (1 << 4)
73 #define UART_PL010_LCRH_STP2 (1 << 3) 86 #define UART_PL010_LCRH_STP2 (1 << 3)
74 #define UART_PL010_LCRH_EPS (1 << 2) 87 #define UART_PL010_LCRH_EPS (1 << 2)
75 #define UART_PL010_LCRH_PEN (1 << 1) 88 #define UART_PL010_LCRH_PEN (1 << 1)
76 #define UART_PL010_LCRH_BRK (1 << 0) 89 #define UART_PL010_LCRH_BRK (1 << 0)
77 90
78 91
79 #define UART_PL010_BAUD_460800 1 92 #define UART_PL010_BAUD_460800 1
80 #define UART_PL010_BAUD_230400 3 93 #define UART_PL010_BAUD_230400 3
81 #define UART_PL010_BAUD_115200 7 94 #define UART_PL010_BAUD_115200 7
82 #define UART_PL010_BAUD_57600 15 95 #define UART_PL010_BAUD_57600 15
83 #define UART_PL010_BAUD_38400 23 96 #define UART_PL010_BAUD_38400 23
84 #define UART_PL010_BAUD_19200 47 97 #define UART_PL010_BAUD_19200 47
85 #define UART_PL010_BAUD_14400 63 98 #define UART_PL010_BAUD_14400 63
86 #define UART_PL010_BAUD_9600 95 99 #define UART_PL010_BAUD_9600 95
87 #define UART_PL010_BAUD_4800 191 100 #define UART_PL010_BAUD_4800 191
88 #define UART_PL010_BAUD_2400 383 101 #define UART_PL010_BAUD_2400 383
89 #define UART_PL010_BAUD_1200 767 102 #define UART_PL010_BAUD_1200 767
90 /* 103 /*
91 * PL011 definitions 104 * PL011 definitions
92 * 105 *
93 */ 106 */
94 #define UART_PL011_LCRH_SPS (1 << 7) 107 #define UART_PL011_LCRH_SPS (1 << 7)
95 #define UART_PL011_LCRH_WLEN_8 (3 << 5) 108 #define UART_PL011_LCRH_WLEN_8 (3 << 5)
96 #define UART_PL011_LCRH_WLEN_7 (2 << 5) 109 #define UART_PL011_LCRH_WLEN_7 (2 << 5)
97 #define UART_PL011_LCRH_WLEN_6 (1 << 5) 110 #define UART_PL011_LCRH_WLEN_6 (1 << 5)
98 #define UART_PL011_LCRH_WLEN_5 (0 << 5) 111 #define UART_PL011_LCRH_WLEN_5 (0 << 5)
99 #define UART_PL011_LCRH_FEN (1 << 4) 112 #define UART_PL011_LCRH_FEN (1 << 4)
100 #define UART_PL011_LCRH_STP2 (1 << 3) 113 #define UART_PL011_LCRH_STP2 (1 << 3)
101 #define UART_PL011_LCRH_EPS (1 << 2) 114 #define UART_PL011_LCRH_EPS (1 << 2)
102 #define UART_PL011_LCRH_PEN (1 << 1) 115 #define UART_PL011_LCRH_PEN (1 << 1)
103 #define UART_PL011_LCRH_BRK (1 << 0) 116 #define UART_PL011_LCRH_BRK (1 << 0)
104 117
105 #define UART_PL011_CR_CTSEN (1 << 15) 118 #define UART_PL011_CR_CTSEN (1 << 15)
106 #define UART_PL011_CR_RTSEN (1 << 14) 119 #define UART_PL011_CR_RTSEN (1 << 14)
107 #define UART_PL011_CR_OUT2 (1 << 13) 120 #define UART_PL011_CR_OUT2 (1 << 13)
108 #define UART_PL011_CR_OUT1 (1 << 12) 121 #define UART_PL011_CR_OUT1 (1 << 12)
109 #define UART_PL011_CR_RTS (1 << 11) 122 #define UART_PL011_CR_RTS (1 << 11)
110 #define UART_PL011_CR_DTR (1 << 10) 123 #define UART_PL011_CR_DTR (1 << 10)
111 #define UART_PL011_CR_RXE (1 << 9) 124 #define UART_PL011_CR_RXE (1 << 9)
112 #define UART_PL011_CR_TXE (1 << 8) 125 #define UART_PL011_CR_TXE (1 << 8)
113 #define UART_PL011_CR_LPE (1 << 7) 126 #define UART_PL011_CR_LPE (1 << 7)
114 #define UART_PL011_CR_IIRLP (1 << 2) 127 #define UART_PL011_CR_IIRLP (1 << 2)
115 #define UART_PL011_CR_SIREN (1 << 1) 128 #define UART_PL011_CR_SIREN (1 << 1)
116 #define UART_PL011_CR_UARTEN (1 << 0) 129 #define UART_PL011_CR_UARTEN (1 << 0)
117 130
118 #define UART_PL011_IMSC_OEIM (1 << 10) 131 #define UART_PL011_IMSC_OEIM (1 << 10)
119 #define UART_PL011_IMSC_BEIM (1 << 9) 132 #define UART_PL011_IMSC_BEIM (1 << 9)
120 #define UART_PL011_IMSC_PEIM (1 << 8) 133 #define UART_PL011_IMSC_PEIM (1 << 8)
121 #define UART_PL011_IMSC_FEIM (1 << 7) 134 #define UART_PL011_IMSC_FEIM (1 << 7)
122 #define UART_PL011_IMSC_RTIM (1 << 6) 135 #define UART_PL011_IMSC_RTIM (1 << 6)
123 #define UART_PL011_IMSC_TXIM (1 << 5) 136 #define UART_PL011_IMSC_TXIM (1 << 5)
124 #define UART_PL011_IMSC_RXIM (1 << 4) 137 #define UART_PL011_IMSC_RXIM (1 << 4)
125 #define UART_PL011_IMSC_DSRMIM (1 << 3) 138 #define UART_PL011_IMSC_DSRMIM (1 << 3)
126 #define UART_PL011_IMSC_DCDMIM (1 << 2) 139 #define UART_PL011_IMSC_DCDMIM (1 << 2)
127 #define UART_PL011_IMSC_CTSMIM (1 << 1) 140 #define UART_PL011_IMSC_CTSMIM (1 << 1)
128 #define UART_PL011_IMSC_RIMIM (1 << 0) 141 #define UART_PL011_IMSC_RIMIM (1 << 0)
129 142