linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] serial: langtiq: Add CCF suppport
@ 2018-09-24 10:27 Songjun Wu
  2018-09-24 10:27 ` [PATCH 01/14] MIPS: dts: Change upper case to lower case Songjun Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Songjun Wu @ 2018-09-24 10:27 UTC (permalink / raw)
  To: yixin.zhu, chuanhua.lei, hauke.mehrtens
  Cc: Songjun Wu, devicetree, linux-serial, James Hogan, linux-mips,
	Jiri Slaby, linux-kernel, Thomas Gleixner, Philippe Ombredanne,
	Paul Burton, Rob Herring, Kate Stewart, Greg Kroah-Hartman,
	Mark Rutland, Ralf Baechle

This patch series is for adding common clock framework support
for langtiq serial driver, mainly includes:
1) Add common clock framework support.
2) Modify the dts file according to the DT conventions.
3) Replace the platform dependent functions with kernel functions


Songjun Wu (14):
  MIPS: dts: Change upper case to lower case
  MIPS: dts: Add aliases node for lantiq danube serial
  serial: lantiq: Get serial id from dts
  serial: lantiq: Change ltq_w32_mask to asc_update_bits
  MIPS: lantiq: Unselect SWAP_IO_SPACE when LANTIQ is selected
  serial: lantiq: Use readl/writel instead of ltq_r32/ltq_w32
  serial: lantiq: Rename fpiclk to freqclk
  serial: lantiq: Replace clk_enable/clk_disable with clk generic API
  serial: lantiq: Add CCF support
  serial: lantiq: Reorder the head files
  include: Add lantiq.h in include/linux/
  serial: lantiq: Replace lantiq_soc.h with lantiq.h
  serial: lantiq: Change init_lqasc to static declaration
  dt-bindings: serial: lantiq: Add optional properties for CCF

 .../devicetree/bindings/serial/lantiq_asc.txt      |  15 +++
 arch/mips/Kconfig                                  |   1 -
 arch/mips/boot/dts/lantiq/danube.dtsi              |  42 +++---
 arch/mips/boot/dts/lantiq/easy50712.dts            |  18 ++-
 drivers/tty/serial/lantiq.c                        | 145 ++++++++++++---------
 include/linux/lantiq.h                             |  23 ++++
 6 files changed, 155 insertions(+), 89 deletions(-)
 create mode 100644 include/linux/lantiq.h

-- 
2.11.0

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

* [PATCH 01/14] MIPS: dts: Change upper case to lower case
  2018-09-24 10:27 [PATCH 00/14] serial: langtiq: Add CCF suppport Songjun Wu
@ 2018-09-24 10:27 ` Songjun Wu
  2018-09-24 10:27 ` [PATCH 02/14] MIPS: dts: Add aliases node for lantiq danube serial Songjun Wu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Songjun Wu @ 2018-09-24 10:27 UTC (permalink / raw)
  To: yixin.zhu, chuanhua.lei, hauke.mehrtens
  Cc: Songjun Wu, devicetree, James Hogan, linux-mips, linux-kernel,
	Thomas Gleixner, Philippe Ombredanne, Paul Burton, Rob Herring,
	Kate Stewart, Greg Kroah-Hartman, Mark Rutland, Ralf Baechle

All the upper case in unit-address and hex constants are
changed to lower case according to the DT conventions.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Songjun Wu <songjun.wu@linux.intel.com>
---

 arch/mips/boot/dts/lantiq/danube.dtsi   | 42 ++++++++++++++++-----------------
 arch/mips/boot/dts/lantiq/easy50712.dts | 14 +++++------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/arch/mips/boot/dts/lantiq/danube.dtsi b/arch/mips/boot/dts/lantiq/danube.dtsi
index 2dd950181f8a..510be63c8bdf 100644
--- a/arch/mips/boot/dts/lantiq/danube.dtsi
+++ b/arch/mips/boot/dts/lantiq/danube.dtsi
@@ -10,12 +10,12 @@
 		};
 	};
 
-	biu@1F800000 {
+	biu@1f800000 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "lantiq,biu", "simple-bus";
-		reg = <0x1F800000 0x800000>;
-		ranges = <0x0 0x1F800000 0x7FFFFF>;
+		reg = <0x1f800000 0x800000>;
+		ranges = <0x0 0x1f800000 0x7fffff>;
 
 		icu0: icu@80200 {
 			#interrupt-cells = <1>;
@@ -24,18 +24,18 @@
 			reg = <0x80200 0x120>;
 		};
 
-		watchdog@803F0 {
+		watchdog@803f0 {
 			compatible = "lantiq,wdt";
-			reg = <0x803F0 0x10>;
+			reg = <0x803f0 0x10>;
 		};
 	};
 
-	sram@1F000000 {
+	sram@1f000000 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "lantiq,sram";
-		reg = <0x1F000000 0x800000>;
-		ranges = <0x0 0x1F000000 0x7FFFFF>;
+		reg = <0x1f000000 0x800000>;
+		ranges = <0x0 0x1f000000 0x7fffff>;
 
 		eiu0: eiu@101000 {
 			#interrupt-cells = <1>;
@@ -66,41 +66,41 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "lantiq,fpi", "simple-bus";
-		ranges = <0x0 0x10000000 0xEEFFFFF>;
-		reg = <0x10000000 0xEF00000>;
+		ranges = <0x0 0x10000000 0xeefffff>;
+		reg = <0x10000000 0xef00000>;
 
-		gptu@E100A00 {
+		gptu@e100a00 {
 			compatible = "lantiq,gptu-xway";
-			reg = <0xE100A00 0x100>;
+			reg = <0xe100a00 0x100>;
 		};
 
-		serial@E100C00 {
+		serial@e100c00 {
 			compatible = "lantiq,asc";
-			reg = <0xE100C00 0x400>;
+			reg = <0xe100c00 0x400>;
 			interrupt-parent = <&icu0>;
 			interrupts = <112 113 114>;
 		};
 
-		dma0: dma@E104100 {
+		dma0: dma@e104100 {
 			compatible = "lantiq,dma-xway";
-			reg = <0xE104100 0x800>;
+			reg = <0xe104100 0x800>;
 		};
 
-		ebu0: ebu@E105300 {
+		ebu0: ebu@e105300 {
 			compatible = "lantiq,ebu-xway";
-			reg = <0xE105300 0x100>;
+			reg = <0xe105300 0x100>;
 		};
 
-		pci0: pci@E105400 {
+		pci0: pci@e105400 {
 			#address-cells = <3>;
 			#size-cells = <2>;
 			#interrupt-cells = <1>;
 			compatible = "lantiq,pci-xway";
 			bus-range = <0x0 0x0>;
 			ranges = <0x2000000 0 0x8000000 0x8000000 0 0x2000000	/* pci memory */
-				  0x1000000 0 0x00000000 0xAE00000 0 0x200000>; /* io space */
+				  0x1000000 0 0x00000000 0xae00000 0 0x200000>; /* io space */
 			reg = <0x7000000 0x8000		/* config space */
-				0xE105400 0x400>;	/* pci bridge */
+				0xe105400 0x400>;	/* pci bridge */
 		};
 	};
 };
diff --git a/arch/mips/boot/dts/lantiq/easy50712.dts b/arch/mips/boot/dts/lantiq/easy50712.dts
index c37a33962f28..1ce20b7d05cb 100644
--- a/arch/mips/boot/dts/lantiq/easy50712.dts
+++ b/arch/mips/boot/dts/lantiq/easy50712.dts
@@ -52,14 +52,14 @@
 			};
 		};
 
-		gpio: pinmux@E100B10 {
+		gpio: pinmux@e100b10 {
 			compatible = "lantiq,danube-pinctrl";
 			pinctrl-names = "default";
 			pinctrl-0 = <&state_default>;
 
 			#gpio-cells = <2>;
 			gpio-controller;
-			reg = <0xE100B10 0xA0>;
+			reg = <0xe100b10 0xa0>;
 
 			state_default: pinmux {
 				stp {
@@ -82,26 +82,26 @@
 			};
 		};
 
-		etop@E180000 {
+		etop@e180000 {
 			compatible = "lantiq,etop-xway";
-			reg = <0xE180000 0x40000>;
+			reg = <0xe180000 0x40000>;
 			interrupt-parent = <&icu0>;
 			interrupts = <73 78>;
 			phy-mode = "rmii";
 			mac-address = [ 00 11 22 33 44 55 ];
 		};
 
-		stp0: stp@E100BB0 {
+		stp0: stp@e100bb0 {
 			#gpio-cells = <2>;
 			compatible = "lantiq,gpio-stp-xway";
 			gpio-controller;
-			reg = <0xE100BB0 0x40>;
+			reg = <0xe100bb0 0x40>;
 
 			lantiq,shadow = <0xfff>;
 			lantiq,groups = <0x3>;
 		};
 
-		pci@E105400 {
+		pci@e105400 {
 			lantiq,bus-clock = <33333333>;
 			interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
 			interrupt-map = <
-- 
2.11.0

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

* [PATCH 02/14] MIPS: dts: Add aliases node for lantiq danube serial
  2018-09-24 10:27 [PATCH 00/14] serial: langtiq: Add CCF suppport Songjun Wu
  2018-09-24 10:27 ` [PATCH 01/14] MIPS: dts: Change upper case to lower case Songjun Wu
@ 2018-09-24 10:27 ` Songjun Wu
  2018-09-24 10:27 ` [PATCH 05/14] MIPS: lantiq: Unselect SWAP_IO_SPACE when LANTIQ is selected Songjun Wu
  2018-10-15 21:58 ` [PATCH 00/14] serial: langtiq: Add CCF suppport Paul Burton
  3 siblings, 0 replies; 6+ messages in thread
From: Songjun Wu @ 2018-09-24 10:27 UTC (permalink / raw)
  To: yixin.zhu, chuanhua.lei, hauke.mehrtens
  Cc: Songjun Wu, devicetree, James Hogan, linux-mips, linux-kernel,
	Philippe Ombredanne, Paul Burton, Rob Herring, Kate Stewart,
	Greg Kroah-Hartman, Mark Rutland, Ralf Baechle

Previous implementation uses a hard-coded register value to check
if the current serial entity is the console entity.
Now the lantiq serial driver uses the aliases for the index of the
serial port.
The lantiq danube serial dts are updated with aliases to support this.

Signed-off-by: Songjun Wu <songjun.wu@linux.intel.com>
---

 arch/mips/boot/dts/lantiq/danube.dtsi   | 2 +-
 arch/mips/boot/dts/lantiq/easy50712.dts | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boot/dts/lantiq/danube.dtsi b/arch/mips/boot/dts/lantiq/danube.dtsi
index 510be63c8bdf..73746d7577d7 100644
--- a/arch/mips/boot/dts/lantiq/danube.dtsi
+++ b/arch/mips/boot/dts/lantiq/danube.dtsi
@@ -74,7 +74,7 @@
 			reg = <0xe100a00 0x100>;
 		};
 
-		serial@e100c00 {
+		asc1: serial@e100c00 {
 			compatible = "lantiq,asc";
 			reg = <0xe100c00 0x400>;
 			interrupt-parent = <&icu0>;
diff --git a/arch/mips/boot/dts/lantiq/easy50712.dts b/arch/mips/boot/dts/lantiq/easy50712.dts
index 1ce20b7d05cb..452860ca1868 100644
--- a/arch/mips/boot/dts/lantiq/easy50712.dts
+++ b/arch/mips/boot/dts/lantiq/easy50712.dts
@@ -4,6 +4,10 @@
 /include/ "danube.dtsi"
 
 / {
+	aliases {
+		serial0 = &asc1;
+	};
+
 	chosen {
 		bootargs = "console=ttyLTQ0,115200 init=/etc/preinit";
 	};
-- 
2.11.0

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

* [PATCH 05/14] MIPS: lantiq: Unselect SWAP_IO_SPACE when LANTIQ is selected
  2018-09-24 10:27 [PATCH 00/14] serial: langtiq: Add CCF suppport Songjun Wu
  2018-09-24 10:27 ` [PATCH 01/14] MIPS: dts: Change upper case to lower case Songjun Wu
  2018-09-24 10:27 ` [PATCH 02/14] MIPS: dts: Add aliases node for lantiq danube serial Songjun Wu
@ 2018-09-24 10:27 ` Songjun Wu
  2018-10-15 21:58 ` [PATCH 00/14] serial: langtiq: Add CCF suppport Paul Burton
  3 siblings, 0 replies; 6+ messages in thread
From: Songjun Wu @ 2018-09-24 10:27 UTC (permalink / raw)
  To: yixin.zhu, chuanhua.lei, hauke.mehrtens
  Cc: Songjun Wu, linux-mips, Ralf Baechle, Paul Burton, James Hogan,
	linux-kernel

SWAP_IO_SPACE macro prevents serial driver /drivers/tty/serial/lantiq.c
to use readl/writel to replace ltq_r32/w32 which are SoC or platform
specific APIs.

readl/writel are used for this serial driver to support multiple
platforms and multiple architectures. The legacy lantiq platform(Danube)
enables SWAP_IO_SPACE for supporting PCI due to some hardware bugs.

It's a little-endian bus plus PCI TX/RX swap enable impacted both data
and control path for MIPS based platforms. But it is better to let PCI
device driver to do endian swap since SWAP_IO_SPACE is a global wide macro
which potentially impacts other peripheral like USB.
ltq_r32/ltq_w32 is not impacted in other device drivers based on MIPS when
SWAP_IO_SPACE is not selected as they use non-byte swapping OS API
(__raw_read/__raw_writel).

Signed-off-by: Songjun Wu <songjun.wu@linux.intel.com>
---

 arch/mips/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 138d60cf19bc..dcc1fd39cbf3 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -406,7 +406,6 @@ config LANTIQ
 	select SYS_SUPPORTS_VPE_LOADER
 	select SYS_HAS_EARLY_PRINTK
 	select GPIOLIB
-	select SWAP_IO_SPACE
 	select BOOT_RAW
 	select CLKDEV_LOOKUP
 	select USE_OF
-- 
2.11.0

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

* Re: [PATCH 00/14] serial: langtiq: Add CCF suppport
  2018-09-24 10:27 [PATCH 00/14] serial: langtiq: Add CCF suppport Songjun Wu
                   ` (2 preceding siblings ...)
  2018-09-24 10:27 ` [PATCH 05/14] MIPS: lantiq: Unselect SWAP_IO_SPACE when LANTIQ is selected Songjun Wu
@ 2018-10-15 21:58 ` Paul Burton
  2018-10-16  9:05   ` Wu, Songjun
  3 siblings, 1 reply; 6+ messages in thread
From: Paul Burton @ 2018-10-15 21:58 UTC (permalink / raw)
  To: Songjun Wu
  Cc: yixin.zhu, chuanhua.lei, hauke.mehrtens, devicetree,
	linux-serial, James Hogan, linux-mips, Jiri Slaby, linux-kernel,
	Thomas Gleixner, Philippe Ombredanne, Rob Herring, Kate Stewart,
	Greg Kroah-Hartman, Mark Rutland, Ralf Baechle

Hi Songjun,

On Mon, Sep 24, 2018 at 06:27:49PM +0800, Songjun Wu wrote:
> This patch series is for adding common clock framework support
> for langtiq serial driver, mainly includes:

s/langtiq/lantiq/ ...

> 1) Add common clock framework support.
> 2) Modify the dts file according to the DT conventions.
> 3) Replace the platform dependent functions with kernel functions
> 
> Songjun Wu (14):
>   MIPS: dts: Change upper case to lower case
>   MIPS: dts: Add aliases node for lantiq danube serial
>   serial: lantiq: Get serial id from dts
>   serial: lantiq: Change ltq_w32_mask to asc_update_bits
>   MIPS: lantiq: Unselect SWAP_IO_SPACE when LANTIQ is selected
>   serial: lantiq: Use readl/writel instead of ltq_r32/ltq_w32
>   serial: lantiq: Rename fpiclk to freqclk
>   serial: lantiq: Replace clk_enable/clk_disable with clk generic API
>   serial: lantiq: Add CCF support
>   serial: lantiq: Reorder the head files
>   include: Add lantiq.h in include/linux/
>   serial: lantiq: Replace lantiq_soc.h with lantiq.h
>   serial: lantiq: Change init_lqasc to static declaration
>   dt-bindings: serial: lantiq: Add optional properties for CCF

It appears that you only copied me on patches 1, 2 & 5. I've applied
patch 1 to mips-next for 4.20, but I have no clue whether your other
patches were deemed acceptable by serial or DT maintainers & I have no
context for the changes being made, so I can neither apply nor ack
patches 2 & 5. Please copy me on the whole series next time.

Thanks,
    Paul

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

* Re: [PATCH 00/14] serial: langtiq: Add CCF suppport
  2018-10-15 21:58 ` [PATCH 00/14] serial: langtiq: Add CCF suppport Paul Burton
@ 2018-10-16  9:05   ` Wu, Songjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wu, Songjun @ 2018-10-16  9:05 UTC (permalink / raw)
  To: Paul Burton
  Cc: yixin.zhu, chuanhua.lei, hauke.mehrtens, devicetree,
	linux-serial, James Hogan, linux-mips, Jiri Slaby, linux-kernel,
	Thomas Gleixner, Philippe Ombredanne, Rob Herring, Kate Stewart,
	Greg Kroah-Hartman, Mark Rutland, Ralf Baechle



On 10/16/2018 5:58 AM, Paul Burton wrote:
> Hi Songjun,
>
> On Mon, Sep 24, 2018 at 06:27:49PM +0800, Songjun Wu wrote:
>> This patch series is for adding common clock framework support
>> for langtiq serial driver, mainly includes:
> s/langtiq/lantiq/ ...
Thanks, it will be fixed.
>> 1) Add common clock framework support.
>> 2) Modify the dts file according to the DT conventions.
>> 3) Replace the platform dependent functions with kernel functions
>>
>> Songjun Wu (14):
>>    MIPS: dts: Change upper case to lower case
>>    MIPS: dts: Add aliases node for lantiq danube serial
>>    serial: lantiq: Get serial id from dts
>>    serial: lantiq: Change ltq_w32_mask to asc_update_bits
>>    MIPS: lantiq: Unselect SWAP_IO_SPACE when LANTIQ is selected
>>    serial: lantiq: Use readl/writel instead of ltq_r32/ltq_w32
>>    serial: lantiq: Rename fpiclk to freqclk
>>    serial: lantiq: Replace clk_enable/clk_disable with clk generic API
>>    serial: lantiq: Add CCF support
>>    serial: lantiq: Reorder the head files
>>    include: Add lantiq.h in include/linux/
>>    serial: lantiq: Replace lantiq_soc.h with lantiq.h
>>    serial: lantiq: Change init_lqasc to static declaration
>>    dt-bindings: serial: lantiq: Add optional properties for CCF
> It appears that you only copied me on patches 1, 2 & 5. I've applied
> patch 1 to mips-next for 4.20, but I have no clue whether your other
> patches were deemed acceptable by serial or DT maintainers & I have no
> context for the changes being made, so I can neither apply nor ack
> patches 2 & 5. Please copy me on the whole series next time.
>
> Thanks,
>      Paul
Thanks.
I will resend the patches and cc all the patches to you.

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

end of thread, other threads:[~2018-10-16  9:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 10:27 [PATCH 00/14] serial: langtiq: Add CCF suppport Songjun Wu
2018-09-24 10:27 ` [PATCH 01/14] MIPS: dts: Change upper case to lower case Songjun Wu
2018-09-24 10:27 ` [PATCH 02/14] MIPS: dts: Add aliases node for lantiq danube serial Songjun Wu
2018-09-24 10:27 ` [PATCH 05/14] MIPS: lantiq: Unselect SWAP_IO_SPACE when LANTIQ is selected Songjun Wu
2018-10-15 21:58 ` [PATCH 00/14] serial: langtiq: Add CCF suppport Paul Burton
2018-10-16  9:05   ` Wu, Songjun

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).