2022-05-13 14:29:45

by Marvin Lin

[permalink] [raw]
Subject: [PATCH v1 0/5] Support Nuvoton NPCM Video Capture/Encode Engine

This patch series add DTS node, dt-bindings document and drivers for Video
Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE)
present on Nuvoton NPCM SoCs.

VCD can capture/differentiate video data from digital or analog sources,
then ECE will compress the data into HEXTILE format.

HEXTILE compressed format is defined in Remote Framebuffer Protocol (RFC
6143) and is used by VNC features, so we also add a patch to support it.

Marvin Lin (5):
arm: dts: Add node for NPCM Video Capture/Encode Engine
dt-bindings: media: Add dt-bindings for NPCM Video Capture/Encode
Engine
dt-bindings: arm/npcm: Add dt-bindings for Graphics Core Information
media: Add HEXTILE compressed format
drivers: media: platform: Add NPCM Video Capture/Encode Engine driver

.../bindings/arm/npcm/nuvoton,gfxi.yaml | 41 +
.../bindings/media/nuvoton,npcm-video.yaml | 87 +
MAINTAINERS | 1 +
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 19 +
drivers/media/platform/Kconfig | 1 +
drivers/media/platform/Makefile | 1 +
drivers/media/platform/nuvoton/Kconfig | 12 +
drivers/media/platform/nuvoton/Makefile | 2 +
drivers/media/platform/nuvoton/npcm-video.c | 2074 +++++++++++++++++
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
11 files changed, 2240 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml
create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml
create mode 100644 drivers/media/platform/nuvoton/Kconfig
create mode 100644 drivers/media/platform/nuvoton/Makefile
create mode 100644 drivers/media/platform/nuvoton/npcm-video.c

--
2.17.1



2022-05-13 14:32:23

by Marvin Lin

[permalink] [raw]
Subject: [PATCH v1 2/5] dt-bindings: media: Add dt-bindings for NPCM Video Capture/Encode Engine

Add dt-bindings document for NPCM Video Capture/Encode Engine.

Signed-off-by: Marvin Lin <[email protected]>
---
.../bindings/media/nuvoton,npcm-video.yaml | 87 +++++++++++++++++++
1 file changed, 87 insertions(+)
create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml

diff --git a/Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml b/Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml
new file mode 100644
index 000000000000..b5be7ef09038
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/nuvoton,npcm-video.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM Video Capture/Encode Engine Device Tree Bindings
+
+maintainers:
+ - Joseph Liu <[email protected]>
+ - Marvin Lin <[email protected]>
+
+description: |
+ Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine
+ (ECE) present on Nuvoton NPCM SoCs.
+
+properties:
+ compatible:
+ enum:
+ - nuvoton,npcm750-video
+ - nuvoton,npcm845-video
+
+ reg:
+ items:
+ - description: VCD registers
+ - description: ECE registers
+
+ reg-names:
+ items:
+ - const: vcd
+ - const: ece
+
+ interrupts:
+ maxItems: 1
+
+ resets:
+ items:
+ - description: VCD reset control
+ - description: ECE reset control
+
+ reset-names:
+ items:
+ - const: vcd
+ - const: ece
+
+ nuvoton,syscon-gcr:
+ $ref: /schemas/types.yaml#definitions/phandle
+ description: Phandle to the Global Control Register DT node
+
+ nuvoton,syscon-gfxi:
+ $ref: /schemas/types.yaml#definitions/phandle
+ description: Phandle to the Graphics Core Information DT node
+
+ memory-region:
+ description:
+ CMA pool to use for buffers allocation instead of the default CMA pool.
+
+required:
+ - compatible
+ - reg
+ - reg-names
+ - interrupts
+ - resets
+ - reset-names
+ - nuvoton,syscon-gcr
+ - nuvoton,syscon-gfxi
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/reset/nuvoton,npcm7xx-reset.h>
+
+ video: video@f0810000 {
+ compatible = "nuvoton,npcm750-video";
+ reg = <0xf0810000 0x10000>,
+ <0xf0820000 0x2000>;
+ reg-names = "vcd", "ece";
+ interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_VCD>,
+ <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_ECE>;
+ reset-names = "vcd", "ece";
+ nuvoton,syscon-gcr = <&gcr>;
+ nuvoton,syscon-gfxi = <&gfxi>;
+ };
--
2.17.1


2022-05-14 00:24:08

by Marvin Lin

[permalink] [raw]
Subject: [PATCH v1 3/5] dt-bindings: arm/npcm: Add dt-bindings for Graphics Core Information

Add dt-bindings document for Graphics Core Information (GFXI) node. It is
necessary for the NPCM Video Capture/Encode Engine driver to retrieve
Graphics core information.

Signed-off-by: Marvin Lin <[email protected]>
---
.../bindings/arm/npcm/nuvoton,gfxi.yaml | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml

diff --git a/Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml b/Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml
new file mode 100644
index 000000000000..5b785bda5739
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/npcm/nuvoton,gfxi.yaml
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/npcm/nuvoton,gfxi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Graphics Core Information block in Nuvoton SoCs
+
+maintainers:
+ - Joseph Liu <[email protected]>
+ - Marvin Lin <[email protected]>
+
+description:
+ The Graphics Core Information (GFXI) are a block of registers in Nuvoton SoCs
+ that analyzes Graphics core behavior and provides inforomation in registers.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - nuvoton,npcm750-gfxi
+ - nuvoton,npcm845-gfxi
+ - const: syscon
+ - const: simple-mfd
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ gfxi: gfxi@e000 {
+ compatible = "nuvoton,npcm750-gfxi", "syscon", "simple-mfd";
+ reg = <0xe000 0x100>;
+ };
--
2.17.1


2022-05-14 00:31:38

by Marvin Lin

[permalink] [raw]
Subject: [PATCH v1 1/5] arm: dts: Add node for NPCM Video Capture/Encode Engine

Add node for Video Capture/Differentiation Engine (VCD) and Encoding
Compression Engine (ECE) present on Nuvoton NPCM SoCs.

Signed-off-by: Marvin Lin <[email protected]>
---
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi b/arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi
index 3696980a3da1..0d2df74974bf 100644
--- a/arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi
+++ b/arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi
@@ -178,6 +178,19 @@
status = "disabled";
};

+ video: video@f0810000 {
+ compatible = "nuvoton,npcm750-video";
+ reg = <0xf0810000 0x10000>, <0xf0820000 0x2000>;
+ reg-names = "vcd", "ece";
+ interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+ resets = <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_VCD>,
+ <&rstc NPCM7XX_RESET_IPSRST2 NPCM7XX_RESET_ECE>;
+ reset-names = "vcd", "ece";
+ nuvoton,syscon-gcr = <&gcr>;
+ nuvoton,syscon-gfxi = <&gfxi>;
+ status = "disabled";
+ };
+
apb {
#address-cells = <1>;
#size-cells = <1>;
@@ -553,6 +566,12 @@
pinctrl-0 = <&smb15_pins>;
status = "disabled";
};
+
+ gfxi: gfxi@e000 {
+ compatible = "nuvoton,npcm750-gfxi", "syscon",
+ "simple-mfd";
+ reg = <0xe000 0x100>;
+ };
};
};

--
2.17.1


2022-05-17 19:29:34

by Jonathan Neuschäfer

[permalink] [raw]
Subject: Re: [PATCH v1 2/5] dt-bindings: media: Add dt-bindings for NPCM Video Capture/Encode Engine

Hi,

since the WPCM450 also includes a VCD block, I'd be interested in
reusing the same bindings and driver there.

On Thu, May 12, 2022 at 03:27:19PM +0800, Marvin Lin wrote:
> Add dt-bindings document for NPCM Video Capture/Encode Engine.
>
> Signed-off-by: Marvin Lin <[email protected]>
> ---
> .../bindings/media/nuvoton,npcm-video.yaml | 87 +++++++++++++++++++
> 1 file changed, 87 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml
>
> diff --git a/Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml b/Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml
> new file mode 100644
> index 000000000000..b5be7ef09038
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/nuvoton,npcm-video.yaml
> @@ -0,0 +1,87 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/nuvoton,npcm-video.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Nuvoton NPCM Video Capture/Encode Engine Device Tree Bindings
> +
> +maintainers:
> + - Joseph Liu <[email protected]>
> + - Marvin Lin <[email protected]>
> +
> +description: |
> + Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine
> + (ECE) present on Nuvoton NPCM SoCs.
> +
> +properties:
> + compatible:
> + enum:
> + - nuvoton,npcm750-video
> + - nuvoton,npcm845-video
> +
> + reg:
> + items:
> + - description: VCD registers
> + - description: ECE registers

I'd somewhat prefer if these were actually two separate devicetree
nodes, since there are two hardware blocks and two register ranges.

This would make reuse of the VCD binding easier on WPCM450, because it
doesn't have an ECE block.


Best regards,
Jonathan


Attachments:
(No filename) (1.83 kB)
signature.asc (849.00 B)
Download all attachments