media: platform: Add Aspeed Video Engine driver
Subsystems (3)
cover media: platform: Add Aspeed Video Engine driver
The Video Engine (VE) embedded in the Aspeed AST2400 and AST2500 SOCs can capture and compress video data from digital or analog sources. With the Aspeed chip acting as a service processor, the Video Engine can capture the host processor graphics output.
This series adds a V4L2 driver for the VE, providing a read() interface only. The driver triggers the hardware to capture the host graphics output and compress it to JPEG format.
Testing on an AST2500 determined that the videobuf/streaming/mmap interface was significantly slower than the simple read() interface, so I have not included the streaming part.
It's also possible to use an automatic mode for the VE such that re-triggering the HW every frame isn't necessary. However this wasn't reliable on the AST2400, and probably used more CPU anyway due to excessive interrupts. It was approximately 15% faster.
Eddie James (2):
dt-bindings: media: Add Aspeed Video Engine binding documentation
media: platform: Add Aspeed Video Engine driver
.../devicetree/bindings/media/aspeed-video.txt | 25 + drivers/media/platform/Kconfig | 8 + drivers/media/platform/Makefile | 1 + drivers/media/platform/aspeed-video.c | 1307 ++++++++++++++++++++ 4 files changed, 1341 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/aspeed-video.txt create mode 100644 drivers/media/platform/aspeed-video.c
Signature · 1 line
1.8.3.1
RFC 1/2 dt-bindings: media: Add Aspeed Video Engine binding documentation
Document the bindings.
--- .../devicetree/bindings/media/aspeed-video.txt | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/aspeed-video.txt
Documentation/devicetree/bindings/media/aspeed-video.txt new file +25 -0
@@ -0,0 +1,25 @@ +* Device tree bindings for Aspeed Video Engine + +The Video Engine (VE) embedded in the Aspeed AST2400 and AST2500 SOCs can +capture and compress video data from digital or analog sources. + +Required properties: + - compatible: "aspeed,ast2400-video" or "aspeed,ast2500-video" + - reg: contains the offset and length of the VE memory region + - clocks: pointers to the the "vclk" and "eclk" of the syscon + - clock-names: "vclk-gate", "eclk-gate" + - resets: pointer to the VE reset of the syscon + - interrupts: the interrupt associated with the VE on this platform + - reg-scu: pointer to the syscon itself + +Example: + +video: video at 1e700000 { + compatible = "aspeed,ast2500-video"; + reg = <0x1e700000 0x20000>; + clocks = <&syscon ASPEED_CLK_GATE_VCLK>, <&syscon ASPEED_CLK_GATE_ECLK>; + clock-names = "vclk-gate", "eclk-gate"; + resets = <&syscon ASPEED_RESET_VIDEO>; + interrupts = <7>; + reg-scu = <&syscon>; +};
Signature · 1 line
1.8.3.1
RFC 2/2 media: platform: Add Aspeed Video Engine driver
In reply to Eddie JamesThe Video Engine (VE) embedded in the Aspeed AST2400 and AST2500 SOCs can capture and compress video data from digital or analog sources. With the Aspeed chip acting a service processor, the Video Engine can capture the host processor graphics output.
Add a V4L2 driver to capture video data and compress it to JPEG images, making the data available through a standard read interface.
--- drivers/media/platform/Kconfig | 8 + drivers/media/platform/Makefile | 1 + drivers/media/platform/aspeed-video.c | 1307 +++++++++++++++++++++++++++++++++ 3 files changed, 1316 insertions(+) create mode 100644 drivers/media/platform/aspeed-video.c
drivers/media/platform/Kconfig +8 -0
@@ -32,6 +32,14 @@ source "drivers/media/platform/davinci/Kconfig" source "drivers/media/platform/omap/Kconfig" +config VIDEO_ASPEED + tristate "Aspeed AST2400 and AST2500 Video Engine driver" + depends on VIDEO_V4L2 + help + Support for the Aspeed Video Engine (VE) embedded in the Aspeed + AST2400 and AST2500 SOCs. The VE can capture and compress video data + from digital or analog sources. + config VIDEO_SH_VOU tristate "SuperH VOU video output driver" depends on MEDIA_CAMERA_SUPPORT
drivers/media/platform/Makefile +1 -0
@@ -3,6 +3,7 @@ # Makefile for the video capture/playback device drivers. # +obj-$(CONFIG_VIDEO_ASPEED) += aspeed-video.o obj-$(CONFIG_VIDEO_CADENCE) += cadence/ obj-$(CONFIG_VIDEO_VIA_CAMERA) += via-camera.o obj-$(CONFIG_VIDEO_CAFE_CCIC) += marvell-ccic/
drivers/media/platform/aspeed-video.c new file +1307 -0
1,307 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Re: [RFC 1/2] dt-bindings: media: Add Aspeed Video Engine binding documentation
In reply to Eddie JamesQuoted 17 lines · Eddie James
Document the bindings.
Signed-off-by Eddie James <[email protected]>--- .../devicetree/bindings/media/aspeed-video.txt | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+)create mode 100644
Documentation/devicetree/bindings/media/aspeed-video.txtDocumentation/devicetree/bindings/media/aspeed-video.txt new file +3
-0@@ -0,0 +1,25 @@ +* Device tree bindings for Aspeed Video Engine + +The Video Engine (VE) embedded in the Aspeed AST2400 and AST2500 SOCs can
Documentation/devicetree/bindings/media/aspeed-video.txt line 13
Quoted 10 lines
Documentation/devicetree/bindings/media/aspeed-video.txt new file +10
-0+capture and compress video data from digital or analog sources. + +Required properties: + - compatible: "aspeed,ast2400-video" or "aspeed,ast2500-video" + - reg: contains the offset and length of the VE memory region + - clocks: pointers to the the "vclk" and "eclk" of the syscon + - clock-names: "vclk-gate", "eclk-gate" + - resets: pointer to the VE reset of the syscon + - interrupts: the interrupt associated with the VE on this platform + - reg-scu: pointer to the syscon itself
Forgot to remove syscon reference in latest, it's not needed.
Thanks,
Eddie
Quoted 12 lines
Documentation/devicetree/bindings/media/aspeed-video.txt new file +12
-0+ +Example: + +video: video at 1e700000 { + compatible = "aspeed,ast2500-video"; + reg = <0x1e700000 0x20000>; + clocks = <&syscon ASPEED_CLK_GATE_VCLK>, <&syscon ASPEED_CLK_GATE_ECLK>; + clock-names = "vclk-gate", "eclk-gate"; + resets = <&syscon ASPEED_RESET_VIDEO>; + interrupts = <7>; + reg-scu = <&syscon>; +};