linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [patch v2 0/2]
@ 2017-08-07 14:17 Oleksandr Shamray
  2017-08-09 14:31 ` Andrew Lunn
  2017-08-10 15:18 ` Greg KH
  0 siblings, 2 replies; 9+ messages in thread
From: Oleksandr Shamray @ 2017-08-07 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

When a need raise up to use JTAG interface for system's devices
programming or CPU debugging, it could be done from the external
JTAG master controller.
 
For such purpose, usually the user layer
application implements jtag protocol or using a proprietary
connection to vendor hardware.
This method is slow and not generic.
 
We propose to implement general JTAG interface and infrastructure
to communicate with user layer application. In such way, we can
have the standard JTAG interface core part and separation from
specific HW implementation.
This allow new capability to debug the CPU or program system's 
device via BMC without additional devices nor cost. 

This patch purpose is to add JTAG master core infrastructure by 
defining new JTAG class and provide generic JTAG interface
to allow hardware specific drivers to connect this interface.
This will enable all JTAG drivers to use the common interface
part and will have separate for hardware implementation.

The JTAG (Joint Test Action Group) core driver provides minimal generic
JTAG interface, which can be used by hardware specific JTAG master
controllers. By providing common interface for the JTAG controllers,
user space device programing is hardware independent.
 
Modern SoC which in use for embedded system' equipped with
internal JTAG master interface.
This interface is used for programming and debugging system's
hardware components, like CPLD, FPGA, CPU, voltage and
industrial controllers.
Firmware for such devices can be upgraded through JTAG interface during
Runtime. The JTAG standard support for multiple devices programming,
is in case their lines are daisy-chained together.

For example, systems which equipped with host CPU, BMC SoC or/and 
number of programmable devices are capable to connect a pin and
select system components dynamically for programming and debugging,
This is using by the BMC which is equipped with internal SoC master
controller.
For example:

BMC JTAG master --> pin selected to CPLDs chain for programming (filed
upgrade, production) 
BMC JTAG master --> pin selected to voltage monitors for programming 
(field upgrade, production) 
BMC JTAG master --> pin selected to host CPU (on-site debugging 
and developers debugging)

For example, we can have application in user space which using calls
to JTAG driver executes CPLD programming directly from SVF file
 
The JTAG standard (IEEE 1149.1) defines the next connector pins:
- TDI (Test Data In);
- TDO (Test Data Out);
- TCK (Test Clock);
- TMS (Test Mode Select);
- TRST (Test Reset) (Optional);

The SoC equipped with JTAG master controller, performs
device programming on command or vector level. For example
a file in a standard SVF (Serial Vector Format) that contains
boundary scan vectors, can be used by sending each vector
to the JTAG interface and the JTAG controller will execute
the programming.

Initial version provides the system calls set for:
- SIR (Scan Instruction Register, IEEE 1149.1 Data Register scan);
- SDR (Scan Data Register, IEEE 1149.1 Instruction Register scan);
- RUNTEST (Forces the IEEE 1149.1 bus to a run state for a specified
  number of clocks.

SoC which are not equipped with JTAG master interface, can be built
on top of JTAG core driver infrastructure, by applying bit-banging of
TDI, TDO, TCK and TMS pins within the hardware specific driver.

Oleksandr Shamray (2):
  drivers: jtag: Add JTAG core driver
  drivers: jtag: Add Aspeed SoC 24xx and 25xx families JTAG master
    driver

 .../devicetree/bindings/jtag/aspeed-jtag.txt       |   27 +
 Documentation/ioctl/ioctl-number.txt               |    2 +
 MAINTAINERS                                        |    8 +
 drivers/Kconfig                                    |    2 +
 drivers/Makefile                                   |    1 +
 drivers/jtag/Kconfig                               |   29 +
 drivers/jtag/Makefile                              |    2 +
 drivers/jtag/jtag-aspeed.c                         |  774 ++++++++++++++++++++
 drivers/jtag/jtag.c                                |  313 ++++++++
 include/linux/jtag.h                               |   42 ++
 include/uapi/linux/jtag.h                          |  113 +++
 11 files changed, 1313 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/jtag/aspeed-jtag.txt
 create mode 100644 drivers/jtag/Kconfig
 create mode 100644 drivers/jtag/Makefile
 create mode 100644 drivers/jtag/jtag-aspeed.c
 create mode 100644 drivers/jtag/jtag.c
 create mode 100644 include/linux/jtag.h
 create mode 100644 include/uapi/linux/jtag.h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [patch v2 0/2]
  2017-08-07 14:17 [patch v2 0/2] Oleksandr Shamray
@ 2017-08-09 14:31 ` Andrew Lunn
  2017-08-10 15:18 ` Greg KH
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2017-08-09 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 07, 2017 at 05:17:45PM +0300, Oleksandr Shamray wrote:
> When a need raise up to use JTAG interface for system's devices
> programming or CPU debugging, it could be done from the external
> JTAG master controller.
>  
> For such purpose, usually the user layer
> application implements jtag protocol or using a proprietary
> connection to vendor hardware.
> This method is slow and not generic.
>  
> We propose to implement general JTAG interface and infrastructure
> to communicate with user layer application. 

Hi Oleksandr

You might find this discussion interesting:

https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2017-August/004721.html

You are defining a new ABI here, so linux-abi should be involved in
the discussion of these patches.

    Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [patch v2 0/2]
  2017-08-07 14:17 [patch v2 0/2] Oleksandr Shamray
  2017-08-09 14:31 ` Andrew Lunn
@ 2017-08-10 15:18 ` Greg KH
  1 sibling, 0 replies; 9+ messages in thread
From: Greg KH @ 2017-08-10 15:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 07, 2017 at 05:17:45PM +0300, Oleksandr Shamray wrote:
> When a need raise up to use JTAG interface for system's devices
> programming or CPU debugging, it could be done from the external
> JTAG master controller.

Your subject line is a bit "odd" :(

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 0/2]
@ 2017-08-19 18:03 sean.wang at mediatek.com
  2017-08-19 18:03 ` [PATCH v2 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings sean.wang at mediatek.com
  2017-08-19 18:03 ` [PATCH v2 2/2] serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC sean.wang at mediatek.com
  0 siblings, 2 replies; 9+ messages in thread
From: sean.wang at mediatek.com @ 2017-08-19 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

From: Sean Wang <sean.wang@mediatek.com>

Since v2: 
- reusing 8250_of since the original driver has almost the same logic

This patchset introduces the support for MediaTek BTIF controller.

MediaTek BTIF controller is the serial interface similar to UART but it
works only as the digital device which is mainly used to communicate with
the connectivity module also called CONNSYS inside the SoC which could be
mostly found on those MediaTek SoCs with Bluetooth feature.

And the controller is made as being compatible with the 8250 register
layout so it tends to be integrated with existing 8250 core driver and
have no requirement for the modem configuration additionally such as the
baud rate calculation and assignment.

Sean Wang (2):
  dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
  serial: 8250: of: Add new port type for MediaTek BTIF controller on
    MT7622/23 SoC

 Documentation/devicetree/bindings/serial/8250.txt | 3 +++
 drivers/tty/serial/8250/8250_of.c                 | 2 ++
 drivers/tty/serial/8250/8250_port.c               | 8 ++++++++
 include/uapi/linux/serial_core.h                  | 3 +++
 4 files changed, 16 insertions(+)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
  2017-08-19 18:03 [PATCH v2 0/2] sean.wang at mediatek.com
@ 2017-08-19 18:03 ` sean.wang at mediatek.com
  2017-08-27 19:00   ` [PATCH v2 RESEND " Matthias Brugger
  2017-08-19 18:03 ` [PATCH v2 2/2] serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC sean.wang at mediatek.com
  1 sibling, 1 reply; 9+ messages in thread
From: sean.wang at mediatek.com @ 2017-08-19 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

From: Sean Wang <sean.wang@mediatek.com>

Document the devicetree bindings in 8250.txt for MediaTek BTIF
controller which could be found on MT7622 and MT7623 SoC.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 Documentation/devicetree/bindings/serial/8250.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt
index 419ff6c..7528d90 100644
--- a/Documentation/devicetree/bindings/serial/8250.txt
+++ b/Documentation/devicetree/bindings/serial/8250.txt
@@ -14,6 +14,9 @@ Required properties:
 	  tegra132, or tegra210.
 	- "nxp,lpc3220-uart"
 	- "ralink,rt2880-uart"
+	- For MediaTek MT7623, must contain "mediatek,mt7623-btif"
+	- For other MediaTek SoCs , must contain "mediatek,<chip>-btif",
+	  "mediatek,mt7623-btif" where <chip> is mt7622.
 	- "altr,16550-FIFO32"
 	- "altr,16550-FIFO64"
 	- "altr,16550-FIFO128"
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC
  2017-08-19 18:03 [PATCH v2 0/2] sean.wang at mediatek.com
  2017-08-19 18:03 ` [PATCH v2 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings sean.wang at mediatek.com
@ 2017-08-19 18:03 ` sean.wang at mediatek.com
  1 sibling, 0 replies; 9+ messages in thread
From: sean.wang at mediatek.com @ 2017-08-19 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

From: Sean Wang <sean.wang@mediatek.com>

MediaTek BTIF controller is the serial interface similar to UART but it
works only as the digital device which is mainly used to communicate with
the connectivity module called CONNSYS inside the SoC which could be mostly
found on those MediaTek SoCs with Bluetooth feature such as MT7622 and
MT7623 SoCs.

And the controller is made as being compatible with the 8250 register
layout with extra registers such as DMA enablement so it tends to be
integrated with reusing 8250 OF driver. However, DMA mode is not being
supported yet in the current driver.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_of.c   | 2 ++
 drivers/tty/serial/8250/8250_port.c | 8 ++++++++
 include/uapi/linux/serial_core.h    | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 6c5a8ca..47d4772 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -300,6 +300,8 @@ static const struct of_device_id of_platform_serial_table[] = {
 		.data = (void *)PORT_ALTR_16550_F64, },
 	{ .compatible = "altr,16550-FIFO128",
 		.data = (void *)PORT_ALTR_16550_F128, },
+	{ .compatible = "mediatek,mt7623-btif",
+		.data = (void *)PORT_MTK_BTIF, },
 	{ .compatible = "mrvl,mmp-uart",
 		.data = (void *)PORT_XSCALE, },
 	{ .compatible = "ti,da830-uart", .data = (void *)PORT_DA830, },
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 25aae66..053bb38 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -289,6 +289,14 @@ static const struct serial8250_config uart_config[] = {
 		.rxtrig_bytes	= {1, 4, 8, 14},
 		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
 	},
+	[PORT_MTK_BTIF] = {
+		.name		= "MediaTek BTIF",
+		.fifo_size	= 16,
+		.tx_loadsz	= 16,
+		.fcr		= UART_FCR_ENABLE_FIFO |
+				  UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT,
+		.flags		= UART_CAP_FIFO,
+	},
 };
 
 /* Uart divisor latch read */
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
index 38bea32..cfc07a5 100644
--- a/include/uapi/linux/serial_core.h
+++ b/include/uapi/linux/serial_core.h
@@ -272,4 +272,7 @@
 /* MPS2 UART */
 #define PORT_MPS2UART	116
 
+/* MediaTek BTIF */
+#define PORT_MTK_BTIF	117
+
 #endif /* _UAPILINUX_SERIAL_CORE_H */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 RESEND 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
  2017-08-19 18:03 ` [PATCH v2 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings sean.wang at mediatek.com
@ 2017-08-27 19:00   ` Matthias Brugger
  2017-08-27 19:39     ` Sean Wang
  0 siblings, 1 reply; 9+ messages in thread
From: Matthias Brugger @ 2017-08-27 19:00 UTC (permalink / raw)
  To: linux-arm-kernel



On 08/19/2017 09:06 PM, sean.wang at mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> Document the devicetree bindings in 8250.txt for MediaTek BTIF
> controller which could be found on MT7622 and MT7623 SoC.
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>   Documentation/devicetree/bindings/serial/8250.txt | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt
> index 419ff6c..7528d90 100644
> --- a/Documentation/devicetree/bindings/serial/8250.txt
> +++ b/Documentation/devicetree/bindings/serial/8250.txt
> @@ -14,6 +14,9 @@ Required properties:
>   	  tegra132, or tegra210.
>   	- "nxp,lpc3220-uart"
>   	- "ralink,rt2880-uart"
> +	- For MediaTek MT7623, must contain "mediatek,mt7623-btif"
> +	- For other MediaTek SoCs , must contain "mediatek,<chip>-btif",
> +	  "mediatek,mt7623-btif" where <chip> is mt7622.

Hm, to me that's confusing. What about:
"mediatek,mt7623-btif": for MediaTek MT7623
"mediatek,mt7622-btif", "mediatek,mt7623-btif": for MediaTek MT7622

If in the future we have more SoCs that support the BTIF, we should add them 
like the mt7622 case.

Make sense?

Regards,
Matthias

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 RESEND 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
  2017-08-27 19:00   ` [PATCH v2 RESEND " Matthias Brugger
@ 2017-08-27 19:39     ` Sean Wang
  2017-08-28  5:21       ` Matthias Brugger
  0 siblings, 1 reply; 9+ messages in thread
From: Sean Wang @ 2017-08-27 19:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 2017-08-27 at 22:00 +0300, Matthias Brugger wrote:
> 
> On 08/19/2017 09:06 PM, sean.wang at mediatek.com wrote:
> > From: Sean Wang <sean.wang@mediatek.com>
> > 
> > Document the devicetree bindings in 8250.txt for MediaTek BTIF
> > controller which could be found on MT7622 and MT7623 SoC.
> > 
> > Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > ---
> >   Documentation/devicetree/bindings/serial/8250.txt | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt
> > index 419ff6c..7528d90 100644
> > --- a/Documentation/devicetree/bindings/serial/8250.txt
> > +++ b/Documentation/devicetree/bindings/serial/8250.txt
> > @@ -14,6 +14,9 @@ Required properties:
> >   	  tegra132, or tegra210.
> >   	- "nxp,lpc3220-uart"
> >   	- "ralink,rt2880-uart"
> > +	- For MediaTek MT7623, must contain "mediatek,mt7623-btif"
> > +	- For other MediaTek SoCs , must contain "mediatek,<chip>-btif",
> > +	  "mediatek,mt7623-btif" where <chip> is mt7622.
> 
> Hm, to me that's confusing. What about:
> "mediatek,mt7623-btif": for MediaTek MT7623
> "mediatek,mt7622-btif", "mediatek,mt7623-btif": for MediaTek MT7622
> 
> If in the future we have more SoCs that support the BTIF, we should add them 
> like the mt7622 case.
> 

I had v3, but it should have similar logic and also got ack from Rob

I knew all your logic of adding binding document for all MediaTek
devices, even I alway added MediaTek device in dt-bindings as the way
you mentioned here, but I felt this way is fine for this kind of
dedicated document.

The reason i don't add it as usual is the following. 8250.txt is common
and shared among all uart like devices, so i don't want btif device
occupies too much section and bloat the document when every new MediaTek
SoC is introduced. 

So instead I refer to existing Nvidia device added in 8250.txt  which I
thought its way is simple, elegant and also using pattern I can use to
add btif devices.

	Sean

> Make sense?
> 
> Regards,
> Matthias

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 RESEND 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings
  2017-08-27 19:39     ` Sean Wang
@ 2017-08-28  5:21       ` Matthias Brugger
  0 siblings, 0 replies; 9+ messages in thread
From: Matthias Brugger @ 2017-08-28  5:21 UTC (permalink / raw)
  To: linux-arm-kernel



On 08/27/2017 10:39 PM, Sean Wang wrote:
> On Sun, 2017-08-27 at 22:00 +0300, Matthias Brugger wrote:
>>
>> On 08/19/2017 09:06 PM, sean.wang at mediatek.com wrote:
>>> From: Sean Wang <sean.wang@mediatek.com>
>>>
>>> Document the devicetree bindings in 8250.txt for MediaTek BTIF
>>> controller which could be found on MT7622 and MT7623 SoC.
>>>
>>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
>>> ---
>>>    Documentation/devicetree/bindings/serial/8250.txt | 3 +++
>>>    1 file changed, 3 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/serial/8250.txt b/Documentation/devicetree/bindings/serial/8250.txt
>>> index 419ff6c..7528d90 100644
>>> --- a/Documentation/devicetree/bindings/serial/8250.txt
>>> +++ b/Documentation/devicetree/bindings/serial/8250.txt
>>> @@ -14,6 +14,9 @@ Required properties:
>>>    	  tegra132, or tegra210.
>>>    	- "nxp,lpc3220-uart"
>>>    	- "ralink,rt2880-uart"
>>> +	- For MediaTek MT7623, must contain "mediatek,mt7623-btif"
>>> +	- For other MediaTek SoCs , must contain "mediatek,<chip>-btif",
>>> +	  "mediatek,mt7623-btif" where <chip> is mt7622.
>>
>> Hm, to me that's confusing. What about:
>> "mediatek,mt7623-btif": for MediaTek MT7623
>> "mediatek,mt7622-btif", "mediatek,mt7623-btif": for MediaTek MT7622
>>
>> If in the future we have more SoCs that support the BTIF, we should add them
>> like the mt7622 case.
>>
> 
> I had v3, but it should have similar logic and also got ack from Rob
> 
> I knew all your logic of adding binding document for all MediaTek
> devices, even I alway added MediaTek device in dt-bindings as the way
> you mentioned here, but I felt this way is fine for this kind of
> dedicated document.
> 
> The reason i don't add it as usual is the following. 8250.txt is common
> and shared among all uart like devices, so i don't want btif device
> occupies too much section and bloat the document when every new MediaTek
> SoC is introduced.
> 
> So instead I refer to existing Nvidia device added in 8250.txt  which I
> thought its way is simple, elegant and also using pattern I can use to
> add btif devices.
> 

Working on my email backlog after vactions I didn't see that this was accepted 
by Rob. Sorry for the noise.

Matthias

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-28  5:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-19 18:03 [PATCH v2 0/2] sean.wang at mediatek.com
2017-08-19 18:03 ` [PATCH v2 1/2] dt-bindings: serial: 8250: Add MediaTek BTIF controller bindings sean.wang at mediatek.com
2017-08-27 19:00   ` [PATCH v2 RESEND " Matthias Brugger
2017-08-27 19:39     ` Sean Wang
2017-08-28  5:21       ` Matthias Brugger
2017-08-19 18:03 ` [PATCH v2 2/2] serial: 8250: of: Add new port type for MediaTek BTIF controller on MT7622/23 SoC sean.wang at mediatek.com
  -- strict thread matches above, loose matches on Subject: below --
2017-08-07 14:17 [patch v2 0/2] Oleksandr Shamray
2017-08-09 14:31 ` Andrew Lunn
2017-08-10 15:18 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).