mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
ARM: tegra: implement common DMA and resets DT bindings
This series converts the Tegra DTs and drivers to use the common/
standard DMA and reset bindings, rather than custom bindings. It also
adds complete documentation for the Tegra clock bindings without
actually changing any binding definitions.
This conversion relies on a few sets of patches in branches from outside
the Tegra tree:
1) A patch to add an DMA channel request API which allows deferred probe
to be implemented.
2) A patch to implement a common part of the of_xlate function for DMA
controllers.
3) Some ASoC patches (which in turn rely on (1) above), which support
deferred probe during DMA channel allocation.
4) The Tegra clock driver changes for 3.14.
Consequently, this branch is based on a merge of all of those external
branches.
In turn, this branch is or will be pulled into a few places that either
rely on features introduced here, or would otherwise conflict with the
patches:
a) Tegra's own for-3.14/powergate and for-4.14/dt branches, to avoid
conflicts.
b) The DRM tree, which introduces new code that relies on the reset
controller framework introduced in this branch, and to avoid
conflicts.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJSr3AnAAoJEMzrak5tbycxfMwQAMeffTFreJqDiQ4Vj0XmuhSn
RFlXiZQsWtQ6gGgNfKyDsXzDMaz1KDAabcUYRcZwrluxuSCPBcK1JirCj5R8uRY7
LDZFX92CO8zRgiij0mhgokV4zzuEQ56q1uhPxqI3o+wG3v44jlMSMgFHQJUevdET
aKr2Pss8Hb00XDztnpxprs6FUoU/W99NRH0i/5znbBwuHqYFP37zlKe2MRwbqDwR
AMgkrnGoawe85Stz4p/iR9pCLpAMa0dH94V4JrAP4+IQrl0DEKWbrolpQHii4gzh
NCGazMELTqkaZaorC/n1SmczH1kTj4vcjbbmeB8dwS8Vqhr+uf7W1oLlJ46TUOsp
ESO0uD2GfpHKQQwLxEfgjfmwsIUMbdWHef8f2HUuvl6Js+LCpaPkxd52Pt/qL4sU
0sKqTbldRZXzGhvwa0/MK32WhmH4v31s7IZAg5A2YxqDR6yWryl7legWyvrI96C0
OlmVe1C/2NGk0QCfK0G/xTa9V7YzMfj8k4ICSZOgUoF4BeGGj6d3svWvLbKbbrU1
0fVvR7aCm78pRXixI6kURpj9D0mEfqus9Hx7VoWcL0TS4QH2dSYlGI+jDCiliQmj
+kWrZWHsASSvPmUZk4RBNaviCbnGU8/t5nNdJSdFIUM/PIswzZ4GaAu6gdVksIY8
hcx410PyAzTZL2lENamE
=8T7+
-----END PGP SIGNATURE-----
Merge tag 'tegra-for-3.14-dmas-resets-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/cleanup
From Stephen Warren:
ARM: tegra: implement common DMA and resets DT bindings
This series converts the Tegra DTs and drivers to use the common/
standard DMA and reset bindings, rather than custom bindings. It also
adds complete documentation for the Tegra clock bindings without
actually changing any binding definitions.
This conversion relies on a few sets of patches in branches from outside
the Tegra tree:
1) A patch to add an DMA channel request API which allows deferred probe
to be implemented.
2) A patch to implement a common part of the of_xlate function for DMA
controllers.
3) Some ASoC patches (which in turn rely on (1) above), which support
deferred probe during DMA channel allocation.
4) The Tegra clock driver changes for 3.14.
Consequently, this branch is based on a merge of all of those external
branches.
In turn, this branch is or will be pulled into a few places that either
rely on features introduced here, or would otherwise conflict with the
patches:
a) Tegra's own for-3.14/powergate and for-4.14/dt branches, to avoid
conflicts.
b) The DRM tree, which introduces new code that relies on the reset
controller framework introduced in this branch, and to avoid
conflicts.
* tag 'tegra-for-3.14-dmas-resets-rework' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (30 commits)
spi: tegra: checking for ERR_PTR instead of NULL
ASoC: tegra: update module reset list for Tegra124
clk: tegra: remove bogus PCIE_XCLK
clk: tegra: remove legacy reset APIs
ARM: tegra: remove legacy DMA entries from DT
ARM: tegra: remove legacy clock entries from DT
USB: EHCI: tegra: use reset framework
Input: tegra-kbc - use reset framework
serial: tegra: convert to standard DMA DT bindings
serial: tegra: use reset framework
spi: tegra: convert to standard DMA DT bindings
spi: tegra: use reset framework
staging: nvec: use reset framework
i2c: tegra: use reset framework
ASoC: tegra: convert to standard DMA DT bindings
ASoC: tegra: allocate AHUB FIFO during probe() not startup()
ASoC: tegra: call pm_runtime APIs around register accesses
ASoC: tegra: use reset framework
dma: tegra: register as an OF DMA controller
dma: tegra: use reset framework
...
Signed-off-by: Olof Johansson <[email protected]>
This commit is contained in:
commit
e7d248f0e0
74 changed files with 1320 additions and 516 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include <linux/of_device.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/serial_8250.h>
|
||||
#include <linux/serial_core.h>
|
||||
|
|
@ -44,8 +45,6 @@
|
|||
#include <linux/tty.h>
|
||||
#include <linux/tty_flip.h>
|
||||
|
||||
#include <linux/clk/tegra.h>
|
||||
|
||||
#define TEGRA_UART_TYPE "TEGRA_UART"
|
||||
#define TX_EMPTY_STATUS (UART_LSR_TEMT | UART_LSR_THRE)
|
||||
#define BYTES_TO_ALIGN(x) ((unsigned long)(x) & 0x3)
|
||||
|
|
@ -103,6 +102,7 @@ struct tegra_uart_port {
|
|||
const struct tegra_uart_chip_data *cdata;
|
||||
|
||||
struct clk *uart_clk;
|
||||
struct reset_control *rst;
|
||||
unsigned int current_baud;
|
||||
|
||||
/* Register shadow */
|
||||
|
|
@ -120,7 +120,6 @@ struct tegra_uart_port {
|
|||
bool rx_timeout;
|
||||
int rx_in_progress;
|
||||
int symb_bit;
|
||||
int dma_req_sel;
|
||||
|
||||
struct dma_chan *rx_dma_chan;
|
||||
struct dma_chan *tx_dma_chan;
|
||||
|
|
@ -832,9 +831,9 @@ static int tegra_uart_hw_init(struct tegra_uart_port *tup)
|
|||
clk_prepare_enable(tup->uart_clk);
|
||||
|
||||
/* Reset the UART controller to clear all previous status.*/
|
||||
tegra_periph_reset_assert(tup->uart_clk);
|
||||
reset_control_assert(tup->rst);
|
||||
udelay(10);
|
||||
tegra_periph_reset_deassert(tup->uart_clk);
|
||||
reset_control_deassert(tup->rst);
|
||||
|
||||
tup->rx_in_progress = 0;
|
||||
tup->tx_in_progress = 0;
|
||||
|
|
@ -910,15 +909,14 @@ static int tegra_uart_dma_channel_allocate(struct tegra_uart_port *tup,
|
|||
dma_addr_t dma_phys;
|
||||
int ret;
|
||||
struct dma_slave_config dma_sconfig;
|
||||
dma_cap_mask_t mask;
|
||||
|
||||
dma_cap_zero(mask);
|
||||
dma_cap_set(DMA_SLAVE, mask);
|
||||
dma_chan = dma_request_channel(mask, NULL, NULL);
|
||||
if (!dma_chan) {
|
||||
dma_chan = dma_request_slave_channel_reason(tup->uport.dev,
|
||||
dma_to_memory ? "rx" : "tx");
|
||||
if (IS_ERR(dma_chan)) {
|
||||
ret = PTR_ERR(dma_chan);
|
||||
dev_err(tup->uport.dev,
|
||||
"Dma channel is not available, will try later\n");
|
||||
return -EPROBE_DEFER;
|
||||
"DMA channel alloc failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (dma_to_memory) {
|
||||
|
|
@ -938,7 +936,6 @@ static int tegra_uart_dma_channel_allocate(struct tegra_uart_port *tup,
|
|||
dma_buf = tup->uport.state->xmit.buf;
|
||||
}
|
||||
|
||||
dma_sconfig.slave_id = tup->dma_req_sel;
|
||||
if (dma_to_memory) {
|
||||
dma_sconfig.src_addr = tup->uport.mapbase;
|
||||
dma_sconfig.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
|
||||
|
|
@ -1222,17 +1219,8 @@ static int tegra_uart_parse_dt(struct platform_device *pdev,
|
|||
struct tegra_uart_port *tup)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
u32 of_dma[2];
|
||||
int port;
|
||||
|
||||
if (of_property_read_u32_array(np, "nvidia,dma-request-selector",
|
||||
of_dma, 2) >= 0) {
|
||||
tup->dma_req_sel = of_dma[1];
|
||||
} else {
|
||||
dev_err(&pdev->dev, "missing dma requestor in device tree\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
port = of_alias_get_id(np, "serial");
|
||||
if (port < 0) {
|
||||
dev_err(&pdev->dev, "failed to get alias id, errno %d\n", port);
|
||||
|
|
@ -1320,6 +1308,12 @@ static int tegra_uart_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(tup->uart_clk);
|
||||
}
|
||||
|
||||
tup->rst = devm_reset_control_get(&pdev->dev, "serial");
|
||||
if (IS_ERR(tup->rst)) {
|
||||
dev_err(&pdev->dev, "Couldn't get the reset\n");
|
||||
return PTR_ERR(tup->rst);
|
||||
}
|
||||
|
||||
u->iotype = UPIO_MEM32;
|
||||
u->irq = platform_get_irq(pdev, 0);
|
||||
u->regshift = 2;
|
||||
|
|
|
|||
Loading…
Reference in a new issue