From: Russell King <rmk+kernel@arm.linux.org.uk> To: linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Peter Hurley <peter@hurleysoftware.com>, Andre Przywara <andre.przywara@arm.com>, Linus Walleij <linus.walleij@linaro.org>, Andrew.Jackson@arm.com, Timur Tabi <timur@tabi.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jslaby@suse.com>, Jun Nie <jun.nie@linaro.org> Subject: [PATCH 06/11] tty: amba-pl011: add register offset table to vendor data Date: Tue, 03 Nov 2015 14:51:24 +0000 [thread overview] Message-ID: <E1Ztcvk-0007CV-8Z@rmk-PC.arm.linux.org.uk> (raw) In-Reply-To: <20151103134349.GV8644@n2100.arm.linux.org.uk> Add the register offset table to the vendor data, allowing vendor differences to be described in this table. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> --- drivers/tty/serial/amba-pl011.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 6269eb9907bd..b912220bf13e 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -103,6 +103,7 @@ static u16 pl011_std_offsets[REG_ARRAY_SIZE] = { /* There is by now at least one vendor with differing details, so handle it */ struct vendor_data { + const u16 *reg_offset; unsigned int ifls; unsigned int lcrh_tx; unsigned int lcrh_rx; @@ -121,6 +122,7 @@ static unsigned int get_fifosize_arm(struct amba_device *dev) } static struct vendor_data vendor_arm = { + .reg_offset = pl011_std_offsets, .ifls = UART011_IFLS_RX4_8|UART011_IFLS_TX4_8, .lcrh_tx = REG_LCRH, .lcrh_rx = REG_LCRH, @@ -133,6 +135,7 @@ static struct vendor_data vendor_arm = { }; static struct vendor_data vendor_sbsa = { + .reg_offset = pl011_std_offsets, .oversampling = false, .dma_threshold = false, .cts_event_workaround = false, @@ -146,6 +149,7 @@ static unsigned int get_fifosize_st(struct amba_device *dev) } static struct vendor_data vendor_st = { + .reg_offset = pl011_std_offsets, .ifls = UART011_IFLS_RX_HALF|UART011_IFLS_TX_HALF, .lcrh_tx = REG_ST_LCRH_TX, .lcrh_rx = REG_ST_LCRH_RX, @@ -2426,7 +2430,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) if (IS_ERR(uap->clk)) return PTR_ERR(uap->clk); - uap->reg_offset = pl011_std_offsets; + uap->reg_offset = vendor->reg_offset; uap->vendor = vendor; uap->lcrh_rx = vendor->lcrh_rx; uap->lcrh_tx = vendor->lcrh_tx; @@ -2508,7 +2512,7 @@ static int sbsa_uart_probe(struct platform_device *pdev) if (!uap) return -ENOMEM; - uap->reg_offset = pl011_std_offsets; + uap->reg_offset = vendor_sbsa.reg_offset; uap->vendor = &vendor_sbsa; uap->fifosize = 32; uap->port.irq = platform_get_irq(pdev, 0); -- 2.1.0
WARNING: multiple messages have this Message-ID (diff)
From: rmk+kernel@arm.linux.org.uk (Russell King) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/11] tty: amba-pl011: add register offset table to vendor data Date: Tue, 03 Nov 2015 14:51:24 +0000 [thread overview] Message-ID: <E1Ztcvk-0007CV-8Z@rmk-PC.arm.linux.org.uk> (raw) In-Reply-To: <20151103134349.GV8644@n2100.arm.linux.org.uk> Add the register offset table to the vendor data, allowing vendor differences to be described in this table. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> --- drivers/tty/serial/amba-pl011.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 6269eb9907bd..b912220bf13e 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -103,6 +103,7 @@ static u16 pl011_std_offsets[REG_ARRAY_SIZE] = { /* There is by now at least one vendor with differing details, so handle it */ struct vendor_data { + const u16 *reg_offset; unsigned int ifls; unsigned int lcrh_tx; unsigned int lcrh_rx; @@ -121,6 +122,7 @@ static unsigned int get_fifosize_arm(struct amba_device *dev) } static struct vendor_data vendor_arm = { + .reg_offset = pl011_std_offsets, .ifls = UART011_IFLS_RX4_8|UART011_IFLS_TX4_8, .lcrh_tx = REG_LCRH, .lcrh_rx = REG_LCRH, @@ -133,6 +135,7 @@ static struct vendor_data vendor_arm = { }; static struct vendor_data vendor_sbsa = { + .reg_offset = pl011_std_offsets, .oversampling = false, .dma_threshold = false, .cts_event_workaround = false, @@ -146,6 +149,7 @@ static unsigned int get_fifosize_st(struct amba_device *dev) } static struct vendor_data vendor_st = { + .reg_offset = pl011_std_offsets, .ifls = UART011_IFLS_RX_HALF|UART011_IFLS_TX_HALF, .lcrh_tx = REG_ST_LCRH_TX, .lcrh_rx = REG_ST_LCRH_RX, @@ -2426,7 +2430,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) if (IS_ERR(uap->clk)) return PTR_ERR(uap->clk); - uap->reg_offset = pl011_std_offsets; + uap->reg_offset = vendor->reg_offset; uap->vendor = vendor; uap->lcrh_rx = vendor->lcrh_rx; uap->lcrh_tx = vendor->lcrh_tx; @@ -2508,7 +2512,7 @@ static int sbsa_uart_probe(struct platform_device *pdev) if (!uap) return -ENOMEM; - uap->reg_offset = pl011_std_offsets; + uap->reg_offset = vendor_sbsa.reg_offset; uap->vendor = &vendor_sbsa; uap->fifosize = 32; uap->port.irq = platform_get_irq(pdev, 0); -- 2.1.0
next prev parent reply other threads:[~2015-11-03 14:51 UTC|newest] Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-11-02 12:24 [PATCH DRAFT 0/2] Sketch for ZTE ZX296702 UART integration Andre Przywara 2015-11-02 12:24 ` Andre Przywara 2015-11-02 12:24 ` [PATCH DRAFT 1/2] drivers: serial: PL011: refactor register access Andre Przywara 2015-11-02 12:24 ` Andre Przywara 2015-11-02 13:27 ` Timur Tabi 2015-11-02 13:27 ` Timur Tabi 2015-11-02 13:40 ` Andre Przywara 2015-11-02 13:40 ` Andre Przywara 2015-11-02 13:44 ` Timur Tabi 2015-11-02 13:44 ` Timur Tabi 2015-11-02 12:24 ` [PATCH DRAFT 2/2] drivers: serial: PL011: [DRAFT] implement register diverson for ZTE UART Andre Przywara 2015-11-02 12:24 ` Andre Przywara 2015-11-03 13:46 ` Russell King - ARM Linux 2015-11-03 13:46 ` Russell King - ARM Linux 2015-11-03 13:57 ` Andre Przywara 2015-11-03 13:57 ` Andre Przywara 2015-11-05 9:54 ` Jun Nie 2015-11-05 9:54 ` Jun Nie 2015-11-03 14:23 ` Russell King - ARM Linux 2015-11-03 14:23 ` Russell King - ARM Linux 2015-11-03 14:30 ` Andre Przywara 2015-11-03 14:30 ` Andre Przywara 2015-11-03 13:43 ` [PATCH DRAFT 0/2] Sketch for ZTE ZX296702 UART integration Russell King - ARM Linux 2015-11-03 13:43 ` Russell King - ARM Linux 2015-11-03 14:48 ` Russell King - ARM Linux 2015-11-03 14:48 ` Russell King - ARM Linux 2015-11-03 14:50 ` [PATCH 01/11] tty: amba-pl011: add register accessor functions Russell King 2015-11-03 14:50 ` Russell King 2015-11-03 14:53 ` Timur Tabi 2015-11-03 14:53 ` Timur Tabi 2015-11-03 15:18 ` Russell King - ARM Linux 2015-11-03 15:18 ` Russell King - ARM Linux 2015-11-03 14:51 ` [PATCH 02/11] tty: amba-pl011: convert accessor functions to take uart_amba_port Russell King 2015-11-03 14:51 ` Russell King 2015-11-03 14:51 ` [PATCH 03/11] tty: amba-pl011: add helper to detect split LCRH register Russell King 2015-11-03 14:51 ` Russell King 2015-11-03 14:51 ` [PATCH 04/11] tty: amba-pl011: prepare REG_* register indexes Russell King 2015-11-03 14:51 ` Russell King 2015-11-03 14:51 ` [PATCH 05/11] tty: amba-pl011: add register lookup table Russell King 2015-11-03 14:51 ` Russell King 2015-11-06 0:00 ` Timur Tabi 2015-11-06 0:00 ` Timur Tabi 2015-11-06 0:24 ` Russell King - ARM Linux 2015-11-06 0:24 ` Russell King - ARM Linux 2015-11-06 0:27 ` Timur Tabi 2015-11-06 0:27 ` Timur Tabi 2015-12-13 6:03 ` Greg Kroah-Hartman 2015-12-13 6:03 ` Greg Kroah-Hartman 2015-11-03 14:51 ` Russell King [this message] 2015-11-03 14:51 ` [PATCH 06/11] tty: amba-pl011: add register offset table to vendor data Russell King 2015-11-03 14:51 ` [PATCH 07/11] tty: amba-pl011: add ST register offset table Russell King 2015-11-03 14:51 ` Russell King 2015-11-03 14:51 ` [PATCH 08/11] tty: amba-pl011: clean up LCR register offsets Russell King 2015-11-03 14:51 ` Russell King 2015-11-03 14:51 ` [PATCH 09/11] tty: amba-pl011: remove ST micro registers from standard table Russell King 2015-11-03 14:51 ` Russell King 2015-11-03 14:51 ` [PATCH 10/11] tty: amba-pl011: add support for 32-bit register access Russell King 2015-11-03 14:51 ` Russell King 2015-11-03 14:57 ` Timur Tabi 2015-11-03 14:57 ` Timur Tabi 2015-11-03 16:19 ` Russell King - ARM Linux 2015-11-03 16:19 ` Russell King - ARM Linux 2015-11-05 4:46 ` Peter Hurley 2015-11-05 4:46 ` Peter Hurley 2015-11-03 14:51 ` [PATCH 11/11] tty: amba-pl011: add support for ZTE UART (EXPERIMENTAL) Russell King 2015-11-03 14:51 ` Russell King 2015-11-05 8:28 ` Linus Walleij 2015-11-05 8:28 ` Linus Walleij 2015-11-05 9:27 ` Russell King - ARM Linux 2015-11-05 9:27 ` Russell King - ARM Linux 2015-11-05 9:54 ` Linus Walleij 2015-11-05 9:54 ` Linus Walleij
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=E1Ztcvk-0007CV-8Z@rmk-PC.arm.linux.org.uk \ --to=rmk+kernel@arm.linux.org.uk \ --cc=Andrew.Jackson@arm.com \ --cc=andre.przywara@arm.com \ --cc=gregkh@linuxfoundation.org \ --cc=jslaby@suse.com \ --cc=jun.nie@linaro.org \ --cc=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-serial@vger.kernel.org \ --cc=peter@hurleysoftware.com \ --cc=timur@tabi.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.