- 31 8月, 2016 3 次提交
-
-
由 Shawn Guo 提交于
There is no Peripheral Identification Registers on ZTE PL011 device, so although the driver amba-pl011 is ready to work for ZTE device, the device cannot be probed by the driver at all. With arm,primecell-periphid DT bindings (bindings/arm/primecell.txt) in place, it should be the cleanest the way to use a pseudo-ID to probe the device from AMBA bus. We create an unofficial vendor number AMBA_VENDOR_LINUX, which will practically never become an official vendor ID, and takes Configuration, Revision number, and Part number as input to compose a pseudo-ID for ZTE device. Also, since we start using vendor_zte to probe ZTE device, the __maybe_unused for vendor_zte is removed. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NShawn Guo <shawn.guo@linaro.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Shawn Guo 提交于
ZTE PL011 device has a fixed FIFO size 16. Let's add a .get_fifosize hook for it. Signed-off-by: NShawn Guo <shawn.guo@linaro.org> Acked-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Shawn Guo 提交于
For some reason we do not really understand, ZTE hardware designers choose to define PL011 Flag Register bit positions differently from standard ones as below. Bit Standard ZTE ----------------------------------- CTS 0 1 DSR 1 3 BUSY 3 8 RI 8 0 Let's define these bits into vendor data and get ZTE PL011 supported properly. Signed-off-by: NShawn Guo <shawn.guo@linaro.org> Acked-by: NRussell King <rmk+kernel@armlinux.org.uk> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 26 6月, 2016 1 次提交
-
-
由 Jiri Slaby 提交于
platform_get_irq can fail, so we should handle negative value when returned. [v2] platform_get_irq can actually return zero on some platforms. So do not remove checks for irq == 0 there. Signed-off-by: NJiri Slaby <jslaby@suse.cz> Cc: Russell King <linux@arm.linux.org.uk> Cc: "Uwe Kleine-König" <kernel@pengutronix.de> Cc: Russell King <linux@armlinux.org.uk> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-tegra@vger.kernel.org Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 28 5月, 2016 1 次提交
-
-
由 Arnd Bergmann 提交于
Most users of IS_ERR_VALUE() in the kernel are wrong, as they pass an 'int' into a function that takes an 'unsigned long' argument. This happens to work because the type is sign-extended on 64-bit architectures before it gets converted into an unsigned type. However, anything that passes an 'unsigned short' or 'unsigned int' argument into IS_ERR_VALUE() is guaranteed to be broken, as are 8-bit integers and types that are wider than 'unsigned long'. Andrzej Hajda has already fixed a lot of the worst abusers that were causing actual bugs, but it would be nice to prevent any users that are not passing 'unsigned long' arguments. This patch changes all users of IS_ERR_VALUE() that I could find on 32-bit ARM randconfig builds and x86 allmodconfig. For the moment, this doesn't change the definition of IS_ERR_VALUE() because there are probably still architecture specific users elsewhere. Almost all the warnings I got are for files that are better off using 'if (err)' or 'if (err < 0)'. The only legitimate user I could find that we get a warning for is the (32-bit only) freescale fman driver, so I did not remove the IS_ERR_VALUE() there but changed the type to 'unsigned long'. For 9pfs, I just worked around one user whose calling conventions are so obscure that I did not dare change the behavior. I was using this definition for testing: #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \ unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO)) which ends up making all 16-bit or wider types work correctly with the most plausible interpretation of what IS_ERR_VALUE() was supposed to return according to its users, but also causes a compile-time warning for any users that do not pass an 'unsigned long' argument. I suggested this approach earlier this year, but back then we ended up deciding to just fix the users that are obviously broken. After the initial warning that caused me to get involved in the discussion (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus asked me to send the whole thing again. [ Updated the 9p parts as per Al Viro - Linus ] Signed-off-by: NArnd Bergmann <arnd@arndb.de> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Andrew Morton <akpm@linux-foundation.org> Link: https://lkml.org/lkml/2016/1/7/363 Link: https://lkml.org/lkml/2016/5/27/486 Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 01 5月, 2016 1 次提交
-
-
由 Christopher Covington 提交于
Version 2 of the Server Base System Architecture (SBSAv2) describes UART hardware registers as 32 bits wide, giving no guidance on access sizes. The SBSA UART driver previously assumed partial-length 16 and 8 bit accesses would work. But the SBSAv2 UART hardware on the Qualcomm Technologies QDF2432 only supports full-length 32 bit register accesses, so use those exclusively. This is compatible with SBSAv3, which explicitly requires UART hardware support 32 (and 16 and sometimes 8) bit accesses. Tested on Juno, Midway, QDF2432, Seattle, and X-Gene 1. Tested-by: NMark Langsdorf <mlangsdo@redhat.com> Tested-by: NAndre Przywara <andre.przywara@arm.com> Acked-by: NAndre Przywara <andre.przywara@arm.com> Signed-off-by: NChristopher Covington <cov@codeaurora.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 08 3月, 2016 2 次提交
-
-
由 Ed Spiridonov 提交于
PL011 UART has hardware mark/space parity ability, this trivial patch adds support for it. Tested on Raspberry Pi v1, v2 (BCM2835 and BCM2836) Signed-off-by: NEd Spiridonov <edo.rus@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Robin Murphy 提交于
When only a TX DMA channel is specified in DT, pl011_dma_probe() falls back to looking for the optional RX channel in platform data. What it doesn't do is check whether that platform data actually exists... Add the missing check to avoid crashing the kernel. Signed-off-by: NRobin Murphy <robin.murphy@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 07 2月, 2016 3 次提交
-
-
由 Arnd Bergmann 提交于
The pl011 driver has gone back and forth on the definition of the ZTE specific variation of the hardware definitions, but the current state is that the vendor definition is left in place yet unused: drivers/tty/serial/amba-pl011.c:190:27: warning: 'vendor_zte' defined but not used [-Wunused-variable] I don't know what the plan forward is to get this code to work, but the current behavior is a bit annoying as we get a warning whenever we build this driver. This patch does not help us to make it work, but at least shuts up the warning. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Fixes: 7ec75871 ("tty: amba-pl011: add support for ZTE UART (EXPERIMENTAL)") Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Timur Tabi 提交于
Busy loops that poll on a register should call cpu_relax(). On some architectures, it can lower CPU power consumption or yield to a hyperthreaded twin processor. It also serves as a compiler barrier, so it can replace barrier() calls. Signed-off-by: NTimur Tabi <timur@codeaurora.org> Reviewed-by: NDave Martin <Dave.Martin@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Peter Hurley 提交于
Use a single common table of struct earlycon_id for both command line and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a unique earlycon declaration (the declaration is only guaranteed to be unique within a compilation unit; separate compilation units must still use unique earlycon names). The semantics of OF_EARLYCON_DECLARE() is different; it declares an earlycon which can matched either on the command line or by devicetree. EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon which is matched by command line only. Remove redundant instances of EARLYCON_DECLARE(). This enables all earlycons to properly initialize struct console with the appropriate name and index, which improves diagnostics and enables direct earlycon-to-console handoff. Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 07 1月, 2016 2 次提交
-
-
由 Timur Tabi 提交于
Instead of defining a new field in the uart_amba_port structure, use the existing iotype field of the uart_port structure, which is intended for this purpose. If we need to use 32-bit register access, we set iotype to UPIO_MEM32, otherwise we set it to UPIO_MEM. For early console, specify the "mmio32" option on the kernel command-line. Example: earlycon=pl011,mmio32,0x3ced1000 Signed-off-by: NTimur Tabi <timur@codeaurora.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
The REG_x macros are indices into a table, not register offsets. Since earlycon does not have access to the vendor data, we can currently only support standard ARM PL011 devices. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Tested-by: NHuang Shijie <shijie.huang@arm.com> Signed-off-by: NTimur Tabi <timur@codeaurora.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 14 12月, 2015 12 次提交
-
-
由 Russell King 提交于
Using relaxed IO accessors allows GCC to better optimise this code as we eliminate the heavy memory barriers - for example, GCC can now cache the address of a register across a read-modify-write sequence, rather than reloading the base address, offset and access size flag. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Add (incomplete) support for the ZTE UART to the AMBA PL011 driver. This is similar to the ARM and ST variants, except it has a different register address layout, and requires 32-bit accesses to the registers. Use the newly introduced register tables and access size support to cope with these differences. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Add support for 32-bit register accesses to the AMBA PL011 UART. This is needed for ZTE UARTs, which require 32-bit accesses as opposed to the more normal 16-bit accesses. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Remove the ST micro registers from the standard table. These registers should never be accessed in non-ST micro variants. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
As we can detect when the LCR register is split between TX and RX, we don't need three entries in the table to deal with this. Reduce this down to two entries by converting the REG_ST_LCRH_* entries to standard REG_LCRH_* and remove REG_LCRH. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Add the ST variant register offset table to the driver. Currently, this is an identical copy of the standard version, but this will be modified in the following changes. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Add the register offset table to the vendor data, allowing vendor differences to be described in this table. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Add a register lookup table, which allows the register offsets to be adjusted on a per-port basis. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Prepare for REG_* register accessors. This change involves introducing pl011_reg_to_offset() to convert REG_* to the hardware register offset, and converting all call sites to use REG_* names. We need to fix up locations where we check for equivalence of register offsets as well. Much of this change was made via these sed expressions: s/ST_UART01[1x]\(_[^_]*\|_LCRH_[TR]X\)\>/REG_ST\1/ s/UART01[1x]_\(DR\|RSR\|ECR\|FR\|ILPR\|[IF]BRD\|LCRH\|CR\|IFLS\|IMSC\|RIS\|MIS\|ICR\|DMACR\)\>/REG_\1/g Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Add a helper to detect the split LCRH register found on ST variants. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Convert the new accessor functions to take the uart_amba_port instead of the port base address. Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Russell King 提交于
Add register accessor functions to amba-pl011. Much of this transformation was done using the sed expression below, with any left-overs fixed up manually afterwards, and code formatted to remain within coding style. s/readw(\(uap->port.membase\|regs\|port->membase\) +/pl011_read(\1,/g s/writew(\(.*\) +/pl011_write(\1,/g Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 18 10月, 2015 1 次提交
-
-
由 Timur Tabi 提交于
The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small to hold that value. The result is that UART_DUMMY_DR_RX is never passed to uart_insert_char(). This means that we're always accepting characters, even when CREAD (in termios) is not set. Signed-off-by: NTimur Tabi <timur@codeaurora.org> Reviewed-by: NDave Martin <Dave.Martin@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 05 9月, 2015 5 次提交
-
-
由 Greg Kroah-Hartman 提交于
This reverts commit 534e14e2 as with this patch the serial console is broken on lots of platforms. Reported-by: NMarc Zyngier <marc.zyngier@arm.com> Cc: Jun Nie <jun.nie@linaro.org> Acked-by: NWill Deacon <will.deacon@arm.com> Tested-by: NWill Deacon <will.deacon@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Greg Kroah-Hartman 提交于
This reverts commit 7b753f31 as with this patch the serial console is broken on lots of platforms. Reported-by: NMarc Zyngier <marc.zyngier@arm.com> Cc: Jun Nie <jun.nie@linaro.org> Acked-by: NWill Deacon <will.deacon@arm.com> Tested-by: NWill Deacon <will.deacon@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Greg Kroah-Hartman 提交于
This reverts commit 2c096a9e as with this patch the serial console is broken on lots of platforms. Reported-by: NMarc Zyngier <marc.zyngier@arm.com> Cc: Jun Nie <jun.nie@linaro.org> Acked-by: NWill Deacon <will.deacon@arm.com> Tested-by: NWill Deacon <will.deacon@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Greg Kroah-Hartman 提交于
This reverts commit 09dcc7df as with this patch the serial console is broken on lots of platforms. Reported-by: NMarc Zyngier <marc.zyngier@arm.com> Cc: Jun Nie <jun.nie@linaro.org> Acked-by: NWill Deacon <will.deacon@arm.com> Tested-by: NWill Deacon <will.deacon@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Greg Kroah-Hartman 提交于
This reverts commit 8cd90e50 as with this patch the serial console is broken on lots of platforms. Reported-by: NMarc Zyngier <marc.zyngier@arm.com> Cc: Jun Nie <jun.nie@linaro.org> Acked-by: NWill Deacon <will.deacon@arm.com> Tested-by: NWill Deacon <will.deacon@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 05 8月, 2015 5 次提交
-
-
由 Jun Nie 提交于
Support ZTE uart with some registers differing offset. Probe as platform device for not AMBA IP ID is available on ZTE uart. Signed-off-by: NJun Nie <jun.nie@linaro.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jun Nie 提交于
Improve LCRH register access decision as ARM PL011 lcrh register serve as both TX and RX, while other SOC may implement TX and RX function with separated register. Signed-off-by: NJun Nie <jun.nie@linaro.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jun Nie 提交于
Introduce register look up table as different SOC venders may have different register offset for the some register. Signed-off-by: NJun Nie <jun.nie@linaro.org> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jun Nie 提交于
Introduce register accessor to ease loop up table access in later patch. Signed-off-by: NJun Nie <jun.nie@linaro.org> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Jun Nie 提交于
Rename regs with enumeration to generalize register names. Signed-off-by: NJun Nie <jun.nie@linaro.org> Reviewed-by: NPeter Hurley <peter@hurleysoftware.com> Signed-off-by: NJun Nie <jun.nie@linaro.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 24 7月, 2015 1 次提交
-
-
由 Krzysztof Kozlowski 提交于
Value returned by devm_ioremap_resource() was checked for non-NULL but devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of error this could lead to dereference of ERR_PTR. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski.k@gmail.com> Cc: <stable@vger.kernel.org> Fixes: 3873e2d7 ("drivers: PL011: refactor pl011_probe()") Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 25 5月, 2015 3 次提交
-
-
由 Graeme Gregory 提交于
Add the necessary driver boilerplate to let the driver be used when the respective ACPI table is discovered by the ACPI subsystem. [Andre: change table name, add MODULE_DEVICE_TABLE entry and improve commit message] Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org> Signed-off-by: NGraeme Gregory <graeme.gregory@linaro.org> Tested-by: NMark Langsdorf <mlangsdo@redhat.com> Tested-by: NNaresh Bhat <nbhat@cavium.com> Signed-off-by: NAndre Przywara <andre.przywara@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Andre Przywara 提交于
The ARM Server Base System Architecture[1] document describes a generic UART which is a subset of the PL011 UART. It lacks DMA support, baud rate control and modem status line control, among other things. The idea is to move the UART initialization and setup into the firmware (which does this job today already) and let the kernel just use the UART for sending and receiving characters. We use the recent refactoring to build a new struct uart_ops variable which points to some new functions avoiding access to the missing registers. We reuse as much existing PL011 code as possible. In contrast to the PL011 the SBSA UART does not define any AMBA or PrimeCell relations, so we go with a pretty generic probe function which only uses platform device functions. A DT binding is provided with this patch, ACPI support is added in a separate one. Signed-off-by: NAndre Przywara <andre.przywara@arm.com> Tested-by: NMark Langsdorf <mlangsdo@redhat.com> Tested-by: NNaresh Bhat <nbhat@cavium.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Andre Przywara 提交于
The SBSA UART has a fixed baud rate and flow control setting, which cannot be changed or queried by software. Add a vendor specific property to always return fixed values when trying to read the console options. Signed-off-by: NAndre Przywara <andre.przywara@arm.com> Tested-by: NMark Langsdorf <mlangsdo@redhat.com> Tested-by: NNaresh Bhat <nbhat@cavium.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-