summaryrefslogtreecommitdiffstats
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
...
* serial: arm_dcc: depend on !CPU_V8Lucas Stach2016-10-041-1/+1
| | | | | | | | The DCC console uses coprocessor registers registers accesses, the implementation of those for ARMv8 is currently missing. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/include-pdata'Sascha Hauer2016-05-091-1/+1
|\
| * include: Move ns16550 serial platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial_auart: make dt awareUwe Kleine-König2016-04-271-0/+9
|/ | | | | | | | This allows to instantiate devices from an oftree and so allows to select the console using /chosen/stdout-path. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/driver'Sascha Hauer2016-03-1114-26/+70
|\
| * driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-0714-26/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: imx: Support DTE modeSascha Hauer2016-02-261-2/+9
|/ | | | | | Based on Kernel commit 20ff2fe60a: serial: imx: add support for DTE mode Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: Set linux_console_nameSascha Hauer2015-08-261-0/+2
| | | | | | | The regular ns16450/ns16550 devices get the console name "ttyS" under Linux. Add this to the driver data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* PPC/MPC52xx: unify header file name for clock APIJuergen Borleis2015-08-031-1/+1
| | | | | | | | In preparation to re-use the i.MX I2C driver for the MPC5200 SoC use clock.h instead of clocks.h for the clock API. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: Fix reading clock-frequency propertySascha Hauer2015-06-261-7/+2
| | | | | | | | | The clock-frequency property is never read because the driver bails out earlier when it is unable to clk_get the clk. Move the clock-frequency read out to the dt setup code which is executed before the driver bails out due to the missing clk. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-06-091-2/+2
|\
| * Abolish cpu_read* and cpu_write* accessorsMasahiro Yamada2015-05-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2e6a88f2101d (add cpu native ordered io accessors) introduced these macros and then commit be57f20cdd7d (Fix big endian MMIO primitives) figured out they are equivalent to __raw_{read,write}*. They turned out unnecessary after all. Anyway, most source files use __raw_read* and __raw_write*. Let's replace a few remaining references and abolish them. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: i.MX: Write settings to a correct registerAndrey Smirnov2015-05-151-2/+2
| | | | | | | | | | | | | | | | Fix what looks like a copy and past error, where settings for USR1 register were being written to USR2. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i.MX: serial: Add baud rate calculation convenience functionsAndrey Smirnov2015-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | Add two functions to calculate values for UBMR and UBIR registers. This way both early serial initalization code and serial_imx.c can use them and not duplicate the code. Singed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | i.MX: Move UART definitions into a separate fileAndrey Smirnov2015-05-071-107/+1
|/ | | | | | | | | Move UART definitions into a separate file to avoid redefinition in <mach/debug_ll.h> and magical constants in low level UART initialization code. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: use 'const void *' for struct of_device_id.dataAntony Pavlov2015-04-303-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2011 barebox' of_device_id struct uses unsigned long type for data field: struct of_device_id { char *compatible; unsigned long data; }; Almost always struct of_device_id.data field are used as pointer and need 'unsigned long' casting. E.g. see 'git grep -A 4 of_device_id drivers/' output: drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { drivers/ata/sata-imx.c- { drivers/ata/sata-imx.c- .compatible = "fsl,imx6q-ahci", drivers/ata/sata-imx.c- .data = (unsigned long)&data_imx6, drivers/ata/sata-imx.c- }, { Here is of_device_id struct in linux kernel v4.0: struct of_device_id { char name[32]; char type[32]; char compatible[128]; const void *data; }; Changing of_device_id.data type to 'const void *data' will increase barebox' linux kernel compatibility and decrease number of 'unsigned long' casts. Part of the patch was done using the 'coccinelle' tool with the following semantic patch: @rule1@ identifier dev; identifier type; identifier func; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type) + dev_get_drvdata(dev, (const void **)&type) ...> } @rule2@ identifier dev; identifier type; identifier func; identifier data; @@ func(...) { <... - dev_get_drvdata(dev, (unsigned long *)&type->data) + dev_get_drvdata(dev, (const void **)&type->data) ...> } Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/raspberry-pi'Sascha Hauer2015-02-041-0/+11
|\
| * amba: pl011: add support for regulatorJean-Christophe PLAGNIOL-VILLARD2015-02-041-0/+11
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mxs'Sascha Hauer2015-02-041-0/+9
|\ \
| * | serial: stm_serial: Add devicetree supportSascha Hauer2015-01-281-0/+9
| |/ | | | | | | | | | | | | | | | | | | This adds device tree support for the stm serial driver. This driver really is a AMBA primecell, so the amba-pl011 could be used. However, the current code tries to get the apb_pclk before the clocks are registered, so this does not work. Use the stm driver instead until a solution is found. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / console: allow to specify the device idJean-Christophe PLAGNIOL-VILLARD2015-01-131-1/+3
|/ | | | | | | so we can use dynamic number id with specific devname Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2015-01-092-2/+0
|\
| * drivers: remove unnecessary mach/imx-regs.h includeSascha Hauer2015-01-052-2/+0
| | | | | | | | | | | | And replace the ones needed with the SoC specific header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: workaroud resource request that conflicts with errno PTRJean-Christophe PLAGNIOL-VILLARD2015-01-081-3/+3
|/ | | | | | | | | | | | | | | | broken since commit ed6e965824303255cacc1c1a195d3684caa26bce Author: Sascha Hauer <s.hauer@pengutronix.de> resource: Let dev_request_mem_region return an error pointer Introduce dev_request_mem_region_err_null only used on platform like at91 where the resource address conflicts with errno PTR. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: i.MX: Use "per" clkSascha Hauer2014-11-271-1/+1
| | | | | | Which is the correct clock for the baud rate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/tegra'Sascha Hauer2014-11-051-0/+12
|\
| * serial: ns16550: add Tegra supportLucas Stach2014-11-041-0/+11
| | | | | | | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * serial: ns16550: enable clock if availableLucas Stach2014-11-041-0/+1
| | | | | | | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: ns16550: Remove unused fields from NS16550_plat structureAlexander Shiyan2014-11-031-4/+1
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let request_ioport_region return an error pointerSascha Hauer2014-09-161-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-167-2/+17
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_get_mem_region return an error pointerSascha Hauer2014-09-161-0/+2
| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* resource: Let dev_get_resource return an error pointerSascha Hauer2014-09-161-4/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: imx: Fix for non-devicetree boardsPhilipp Zabel2014-09-051-3/+5
| | | | | | | | | | | Commit 3843bfd0ab77eaf125ca617922927b61fc8ded74 "serial: imx: Determine device name from device tree" broke this driver for non-devicetree boards, since of_alias_get may not be called with a NULL pointer as first argument. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/efi'Sascha Hauer2014-08-074-116/+493
|\ | | | | | | | | | | | | Conflicts: .gitignore Makefile drivers/serial/Makefile
| * serial: Add EFI stdio driverSascha Hauer2014-07-163-0/+372
| | | | | | | | | | | | | | | | | | This adds a driver which uses the EFI stdin/stdout interfaces to implement a barebox console. Keyboard input should be fairly complete, but not all vt100 needed by barebox work properly. The clear-to-eol escape is missing causing garbled output in the editor. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * serial: ns16550: Add register read/write function pointers to private dataSascha Hauer2014-07-141-114/+120
| | | | | | | | | | | | | | Makes the code a bit cleaner. This also avoids casting from a pointer to a 32bit integer which may produce compiler warnings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * serial: ns16550: Add mmiobase to private dataSascha Hauer2014-07-141-9/+8
| | | | | | | | | | | | | | We have a private data struct, so use it for storing the base address instead of abusing the dev->priv field. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/console'Sascha Hauer2014-08-071-0/+4
|\ \
| * | serial: imx: Determine device name from device treeSascha Hauer2014-07-111-0/+4
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / serial: add driver for Canon DIGIC UARTAntony Pavlov2014-07-293-0/+137
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: imx: Fix buggy transmissions when baudrate mismatchesFabio Estevam2014-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bit 7 of UCR3 is described in the i.MX reference manuals (with the exception of i.MX1) as follows: ADNIMP: Autobaud Detection Not Improved-. Disables new features of autobaud detection (See Baud Rate Automatic Detection Protocol, for more details). 0 Autobaud detection new features selected 1 Keep old autobaud detection mechanism The "new features" mechanism occasionally causes the receiver to get out of sync and continuously produces received characters of '0xff'. In order to reproduce the problem: $ cs0.baudrate=19200 - Change the terminal baudrate to 19200 - Type in the console and it should look good - Change the terminal baudrate back to 115200 - Type 'b' in the console, then a stream of '0xff' is transmitted in loop Setting the ADNIMP bit avoids the transmission of '0xff' in loop. Also rename the bit definition as per the reference manual. Tested on mx6q. Based on a patch from Eric Nelson for U-boot. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ioresource'Sascha Hauer2014-05-051-16/+107
|\
| * x86: ns16550: Rework driver to allow for x86 I/O spaceMichel Stam2014-04-091-16/+107
| | | | | | | | | | | | | | | | | | | | | | | | The current implementation fakes a memory-mapped I/O device at 0x3f8 and 0x2f8, then uses platform read/write functions to do the actual reading and writing. These platform functions only exist for the x86 platform; better to move the I/O routines into the driver and have the driver request I/O ports using request_ioport_region. Signed-off-by: Michel Stam <michel@reverze.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | serial: ns16550: omap: set register shift from codeSascha Hauer2014-04-281-0/+4
|/ | | | | | | | The upstream dts files do not contain the register shift. As we have Omap specific init code anyway we can just set the register shift from there instead of relying on the devicetree properties. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: add Atheros AR933x driverAntony Pavlov2014-03-284-0/+281
| | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: add compatible entry for "ingenic,jz4740-uart"Antony Pavlov2014-03-261-0/+20
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: add compatible entry for "ns16450"Antony Pavlov2014-03-261-0/+16
| | | | | | | "ns16450" uses the same code as "ns16550a" but with FIFO disabled. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: make FCR setup value part of struct ns16550_privAntony Pavlov2014-03-261-6/+7
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: ns16550: fix whitespacesAntony Pavlov2014-03-261-1/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>