- 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 12 次提交
-
-
由 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>
-
由 Andre Przywara 提交于
The SBSA UART should not be enabled or disabled (it is always on), and consequently the spec lacks the UART_CR register. Add a vendor specific property to skip disabling or enabling of the UART. This will be used later by the SBSA UART support. 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 提交于
To avoid lines with more than 80 characters and to make the pl011_int() function more readable, move the workaround out into a separate function. 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 PL011 register UART_MIS is actually a bitwise AND of the UART_RIS and the UART_MISC register. Since the SBSA UART does not include the _MIS register, use the two separate registers to get the same behaviour. Since we are inside the spinlock and we read the _IMSC register only once, there should be no race issue. 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 提交于
Currently the pl011_probe() function is relying on some AMBA IDs and a device tree node to initialize the driver and a port. Both features are not necessarily required for the driver: - we lack AMBA IDs in the ARM SBSA generic UART and - we lack a DT node in ACPI systems. So lets refactor the function to ease later reuse. 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 提交于
Split the pl011_set_termios() function into smaller chunks to allow easier reuse later when adding SBSA support. 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 提交于
Split the pl011_shutdown() function into smaller chunks to allow easier reuse later when adding SBSA support. 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 提交于
Split the pl011_startup() function into smaller chunks to allow easier reuse later when adding SBSA support. 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 提交于
Although we care about not unregistering the driver if there are still ports connected during the .remove callback, we do miss this check in the pl011_probe function. So if the current port allocation fails, but there are other ports already registered, we will kill those. So factor out the port removal into a separate function and use that in the probe function, too. 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>
-
由 Dave Martin 提交于
Commit 734745ca serial/amba-pl011: (Activate TX IRQ passively) introduces a race which causes the driver sometimes to attempt to write a character to the TX FIFO when the FIFO is already full. The PL011 does not guarantee its behaviour when the FIFO is overfilled. In practice, this can cause duplicate and/or dropped characters to be output on the wire. The problem is common enough to be readily observable on the ARM Juno platform when the PL011 UART is used as the console and DMA is not in use. This patch fixes this problem by always polling for space before each character is written to the FIFO. This will be amended to a less brute-force approach in a later commit, but this patch should help ensure correct behaviour for now. Signed-off-by: NDave Martin <Dave.Martin@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 20 5月, 2015 1 次提交
-
-
由 Dave Martin 提交于
In commit 02730d3c (Merge 4.1-rc4 into tty-next), git mismerged some lines, reintroducing a reference to the removed field uart_amba_port.tx_irq_seen. This causes a build failure. This patch removes the mismerged lines, restoring the code to what was in tty-next (which was the intention). Signed-off-by: NDave Martin <Dave.Martin@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 10 5月, 2015 1 次提交
-
-
由 Dave Martin 提交于
This reverts commit f2ee6dfa. Jakub Kiciński observed that this patch can cause the pl011 driver to hang if if the only process with a pl011 port open is killed by a signal, pl011_shutdown() can get called with an arbitrary amount of data still in the FIFO. Calling _shutdown() with the TX FIFO non-empty is questionable behaviour and my itself be a bug. Since the affected patch was speculative anyway, and brings limited benefit, the simplest course is to remove the assumption that TXIS will always be left asserted after the port is shut down. Signed-off-by: NDave Martin <Dave.Martin@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 07 5月, 2015 2 次提交
-
-
由 Dave Martin 提交于
Commit 734745ca serial/amba-pl011: Activate TX IRQ passively adds some complexity and overhead in the form of a softirq mechanism for transmitting in the absence of interrupts. This patch simplifies the code flow to reduce the reliance on subtle behaviour and avoid fragility under future maintenance. To this end, the TX softirq mechanism is removed and instead pl011_start_tx() will now simply stuff the FIFO until full (guaranteeing future TX IRQs), or until there are no more chars to write (in which case we don't care whether an IRQ happens). Signed-off-by: NDave Martin <Dave.Martin@arm.com> Signed-off-by: NJakub Kicinski <kubakici@wp.pl> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Dave Martin 提交于
This reverts commit f2ee6dfa. Jakub Kiciński observed that this patch can cause the pl011 driver to hang if if the only process with a pl011 port open is killed by a signal, pl011_shutdown() can get called with an arbitrary amount of data still in the FIFO. Calling _shutdown() with the TX FIFO non-empty is questionable behaviour and my itself be a bug. Since the affected patch was speculative anyway, and brings limited benefit, the simplest course is to remove the assumption that TXIS will always be left asserted after the port is shut down. Signed-off-by: NDave Martin <Dave.Martin@arm.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-