Skip to contentSkip to conversation

arm: imx: Add i.mx6q DaSheng COM-9XX SBC board support

PATCH Superseded [email protected] 2 participants 9 messages Apr 14, 2021 – Apr 15, 2021

Subsystems (6)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm: imx: Add i.mx6q DaSheng COM-9XX SBC board support

From: dillon min <[email protected]>

This patchset aims to add kernel support on DaSheng COM-8XX SBC board optimize ov2659 driver to handle xvclk on/off at proper stage to save power

changes based on master branch, since commit id:
89698becf06d341a700913c3d89ce2a914af69a2

The DaSheng Com-9xx is and ARM based signle board computer (SBC) featuring:
- i.MX6Q
- 2GiB LPDDR3 DRAM
- 8GiB eMMC 5.0 FLASH
- 4MiB SPI Flash
- USB 2.0 Host/Device
- Multiple multi-protocol RS232/RS485 Serial ports
- microSD socket
- 5V DC power input
- HDMI1.4a,1080p@60
- RGMIIx1 Gigabit Ethernet
- CSI0x1, connect with ov2659

v2:
- add "[PATCH v2 4/4] dt-bindings: add dasheng vendor prefix" to fix checkpatch.pl warning.

dillon min (4):
dt-bindings: arm: imx: Add i.mx6q DaSheng COM-9XX SBC board dts
support
arm: dts: imx: Add i.mx6q DaSheng COM-9XX SBC board support
media: i2c: ov2659: Add clk_prepare_enable(), clk_disable_unprepare()
to handle xvclk
dt-bindings: add dasheng vendor prefix

 Documentation/devicetree/bindings/arm/fsl.yaml     |   1 +
 .../devicetree/bindings/vendor-prefixes.yaml       |   2 +
 arch/arm/boot/dts/Makefile                         |   1 +
 arch/arm/boot/dts/imx6q-ds.dts                     |  17 +
 arch/arm/boot/dts/imx6qdl-ds.dtsi                  | 465 +++++++++++++++++++++
 drivers/media/i2c/ov2659.c                         |  24 +-
 6 files changed, 504 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/imx6q-ds.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ds.dtsi
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/4 dt-bindings: arm: imx: Add i.mx6q DaSheng COM-9XX SBC board dts support

From: dillon min <[email protected]>

The DaSheng Com-9xx is and ARM based signle board computer (SBC) featuring:
- i.MX6Q
- 2GiB LPDDR3 DRAM
- 8GiB eMMC 5.0 FLASH
- 4MiB SPI Flash
- USB 2.0 Host/Device
- Multiple multi-protocol RS232/RS485 Serial ports
- microSD socket
- 5V DC power input
- HDMI1.4a,1080p@60
- RGMIIx1 Gigabit Ethernet
- CSI0x1, connect with ov2659

Cc Krzysztof Kozlowski <[email protected]>

---
v2: no changes

 Documentation/devicetree/bindings/arm/fsl.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/fsl.yaml +1 -0
index 297c87f45db8..24bdfbd4853f 100644
@@ -206,6 +206,7 @@ properties:
               - fsl,imx6q-sabreauto
               - fsl,imx6q-sabrelite
               - fsl,imx6q-sabresd
+              - ds,imx6q-sbc              # Da Sheng COM-9XX Modules
               - karo,imx6q-tx6q           # Ka-Ro electronics TX6Q Modules
               - kiebackpeter,imx6q-tpc    # K+P i.MX6 Quad TPC Board
               - kontron,imx6q-samx6i      # Kontron i.MX6 Dual/Quad SMARC Module
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH v2 1/4] dt-bindings: arm: imx: Add i.mx6q DaSheng COM-9XX SBC board dts support

Quoted 29 lines · On 14/04/2021 08:51, [email protected] wrote:

From: dillon min <[email protected]>

The DaSheng Com-9xx is and ARM based signle board computer (SBC) featuring:
- i.MX6Q
- 2GiB LPDDR3 DRAM
- 8GiB eMMC 5.0 FLASH
- 4MiB SPI Flash
- USB 2.0 Host/Device
- Multiple multi-protocol RS232/RS485 Serial ports
- microSD socket
- 5V DC power input
- HDMI1.4a,1080p@60
- RGMIIx1 Gigabit Ethernet
- CSI0x1, connect with ov2659

Cc Krzysztof Kozlowski <[email protected]>

---
v2: no changes

 Documentation/devicetree/bindings/arm/fsl.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/fsl.yaml +0 -0
index 297c87f45db8..24bdfbd4853f 100644

Documentation/devicetree/bindings/arm/fsl.yaml properties: · line 209

Quoted 4 lines
Documentation/devicetree/bindings/arm/fsl.yaml +1 -0
@@ -206,6 +206,7 @@ properties:
               - fsl,imx6q-sabreauto
               - fsl,imx6q-sabrelite
               - fsl,imx6q-sabresd
+              - ds,imx6q-sbc              # Da Sheng COM-9XX Modules

You break here the alphabetical order. Should be after dmo,imx6q-edmqmx6.

Best regards,
Krzysztof

author
#3 lore raw

Re: [PATCH v2 1/4] dt-bindings: arm: imx: Add i.mx6q DaSheng COM-9XX SBC board dts support

Quoted 26 lines · Krzysztof Kozlowski
Quoted 24 lines · On 14/04/2021 08:51, [email protected] wrote:

From: dillon min <[email protected]>

The DaSheng Com-9xx is and ARM based signle board computer (SBC) featuring:
- i.MX6Q
- 2GiB LPDDR3 DRAM
- 8GiB eMMC 5.0 FLASH
- 4MiB SPI Flash
- USB 2.0 Host/Device
- Multiple multi-protocol RS232/RS485 Serial ports
- microSD socket
- 5V DC power input
- HDMI1.4a,1080p@60
- RGMIIx1 Gigabit Ethernet
- CSI0x1, connect with ov2659

Cc Krzysztof Kozlowski <[email protected]>

---
v2: no changes

 Documentation/devicetree/bindings/arm/fsl.yaml | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

Documentation/devicetree/bindings/arm/fsl.yaml properties: · line 209

Quoted 9 lines
Documentation/devicetree/bindings/arm/fsl.yaml +1 -0
index 297c87f45db8..24bdfbd4853f 100644
@@ -206,6 +206,7 @@ properties:
               - fsl,imx6q-sabreauto
               - fsl,imx6q-sabrelite
               - fsl,imx6q-sabresd
+              - ds,imx6q-sbc              # Da Sheng COM-9XX Modules

You break here the alphabetical order. Should be after dmo,imx6q-edmqmx6.

Agree, will move to below dmo,imx6q-edmqmx6 in v3, thanks for patient.

Best regards.
Dillon

Quoted 4 lines

Best regards,
Krzysztof

#4 lore raw

PATCH v2 2/4 arm: dts: imx: Add i.mx6q DaSheng COM-9XX SBC board support

In reply to [email protected]

From: dillon min <[email protected]>

The DaSheng Com-9xx is and ARM based signle board computer (SBC) featuring:
- i.MX6Q
- 2GiB LPDDR3 DRAM
- 8GiB eMMC 5.0 FLASH
- 4MiB SPI Flash
- USB 2.0 Host/Device
- Multiple multi-protocol RS232/RS485 Serial ports
- microSD socket
- 5V DC power input
- HDMI1.4a,1080p@60
- RGMIIx1 Gigabit Ethernet
- CSI0x1, connect with ov2659

---
v2: no changes

 arch/arm/boot/dts/Makefile        |   1 +
 arch/arm/boot/dts/imx6q-ds.dts    |  17 ++
 arch/arm/boot/dts/imx6qdl-ds.dtsi | 465 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 483 insertions(+)
 create mode 100644 arch/arm/boot/dts/imx6q-ds.dts
 create mode 100644 arch/arm/boot/dts/imx6qdl-ds.dtsi
arch/arm/boot/dts/Makefile +1 -0
index a19c5ab9df84..ecbac8e5336c 100644
@@ -562,6 +562,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
 	imx6q-sabreauto.dtb \
 	imx6q-sabrelite.dtb \
 	imx6q-sabresd.dtb \
+	imx6q-ds.dtb \
 	imx6q-savageboard.dtb \
 	imx6q-sbc6x.dtb \
 	imx6q-tbs2910.dtb \
arch/arm/boot/dts/imx6q-ds.dts new file +17 -0
new file mode 100644
index 000000000000..b0a63a133977
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright 2021 Dillon Min <[email protected]>
+//
+// Based on imx6qdl-sabresd.dtsi which is:
+// Copyright 2012 Freescale Semiconductor, Inc.
+// Copyright 2011 Linaro Ltd.
+
+/dts-v1/;
+
+#include "imx6q.dtsi"
+#include "imx6qdl-ds.dtsi"
+
+/ {
+	model = "DaSheng i.MX6 Quad Com-9xx Board";
+	compatible = "ds,imx6q-sbc", "fsl,imx6q";
+};
arch/arm/boot/dts/imx6qdl-ds.dtsi new file +465 -0

465 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 3/4 media: i2c: ov2659: Add clk_prepare_enable(), clk_disable_unprepare() to handle xvclk

In reply to [email protected]

From: dillon min <[email protected]>

For power save purpose, xvclk might not be always on. need add clk_prepare_enable(), clk_disable_unprepare() at driver side to set xvclk on/off at proper stage.

Add following changes:
- add 'struct clk *clk' in 'struct ov2659'
- enable xvclk in ov2659_power_on()
- disable xvclk in ov2659_power_off()

---
v2: no changes

 drivers/media/i2c/ov2659.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)
drivers/media/i2c/ov2659.c +18 -6
index 42f64175a6df..fb78a1cedc03 100644
@@ -204,6 +204,7 @@ struct ov2659 {
 	struct i2c_client *client;
 	struct v4l2_ctrl_handler ctrls;
 	struct v4l2_ctrl *link_frequency;
+	struct clk *clk;
 	const struct ov2659_framesize *frame_size;
 	struct sensor_register *format_ctrl_regs;
 	struct ov2659_pll_ctrl pll;
@@ -1270,6 +1271,8 @@ static int ov2659_power_off(struct device *dev)
 
 	gpiod_set_value(ov2659->pwdn_gpio, 1);
 
+	clk_disable_unprepare(ov2659->clk);
+
 	return 0;
 }
 
@@ -1278,9 +1281,17 @@ static int ov2659_power_on(struct device *dev)
 	struct i2c_client *client = to_i2c_client(dev);
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct ov2659 *ov2659 = to_ov2659(sd);
+	int ret;
 
 	dev_dbg(&client->dev, "%s:\n", __func__);
 
+	ret = clk_prepare_enable(ov2659->clk);
+	if (ret) {
+		dev_err(&client->dev, "%s: failed to enable clock\n",
+			__func__);
+		return ret;
+	}
+
 	gpiod_set_value(ov2659->pwdn_gpio, 0);
 
 	if (ov2659->resetb_gpio) {
@@ -1425,7 +1436,6 @@ static int ov2659_probe(struct i2c_client *client)
 	const struct ov2659_platform_data *pdata = ov2659_get_pdata(client);
 	struct v4l2_subdev *sd;
 	struct ov2659 *ov2659;
-	struct clk *clk;
 	int ret;
 
 	if (!pdata) {
@@ -1440,11 +1450,11 @@ static int ov2659_probe(struct i2c_client *client)
 	ov2659->pdata = pdata;
 	ov2659->client = client;
 
-	clk = devm_clk_get(&client->dev, "xvclk");
-	if (IS_ERR(clk))
-		return PTR_ERR(clk);
+	ov2659->clk = devm_clk_get(&client->dev, "xvclk");
+	if (IS_ERR(ov2659->clk))
+		return PTR_ERR(ov2659->clk);
 
-	ov2659->xvclk_frequency = clk_get_rate(clk);
+	ov2659->xvclk_frequency = clk_get_rate(ov2659->clk);
 	if (ov2659->xvclk_frequency < 6000000 ||
 	    ov2659->xvclk_frequency > 27000000)
 		return -EINVAL;
@@ -1506,7 +1516,9 @@ static int ov2659_probe(struct i2c_client *client)
 	ov2659->frame_size = &ov2659_framesizes[2];
 	ov2659->format_ctrl_regs = ov2659_formats[0].format_ctrl_regs;
 
-	ov2659_power_on(&client->dev);
+	ret = ov2659_power_on(&client->dev);
+	if (ret < 0)
+		goto error;
 
 	ret = ov2659_detect(sd);
 	if (ret < 0)
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 4/4 dt-bindings: add dasheng vendor prefix

In reply to [email protected]

From: dillon min <[email protected]>

Add vendor prefix for DaSheng, Inc.

---
v2: new add

 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index f6064d84a424..4ec28488c963 100644
@@ -309,6 +309,8 @@ patternProperties:
     description: DPTechnics
   "^dragino,.*":
     description: Dragino Technology Co., Limited
+  "^ds,.*":
+    description: DaSheng, Inc.
   "^dserve,.*":
     description: dServe Technology B.V.
   "^dynaimage,.*":
Signature · 1 line
2.7.4
Reviewed-by on v2 4/4
#7 lore raw

Re: [PATCH v2 4/4] dt-bindings: add dasheng vendor prefix

Quoted 10 lines · On 14/04/2021 08:51, [email protected] wrote:

From: dillon min <[email protected]>

Add vendor prefix for DaSheng, Inc.

---
v2: new add

 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

This should be the first patch in the series.

Best regards,
Krzysztof

author
#8 lore raw

Re: [PATCH v2 4/4] dt-bindings: add dasheng vendor prefix

Quoted 6 lines · Krzysztof Kozlowski
Quoted 4 lines · On 14/04/2021 08:51, [email protected] wrote:

From: dillon min <[email protected]>

Add vendor prefix for DaSheng, Inc.

Quoted 8 lines
Quoted 6 lines

---
v2: new add

 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

This should be the first patch in the series.

OK, will place this patch at v3's first. thanks

Best regards
Dillon,

Quoted 6 lines

Best regards,
Krzysztof