Skip to content

Commit

Permalink
media: xilinx: Add HLS core driver
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
State: pending
  • Loading branch information
Laurent Pinchart authored and Michal Simek committed Apr 15, 2020
1 parent f80d625 commit d494b0c
Show file tree
Hide file tree
Showing 7 changed files with 618 additions and 0 deletions.
64 changes: 64 additions & 0 deletions Documentation/devicetree/bindings/media/xilinx/xlnx,v-hls.txt
@@ -0,0 +1,64 @@
Xilinx High-Level Synthesis Core (HLS)
--------------------------------------

High-Level Synthesis cores are synthesized from a high-level function
description developed by the user. As such their functions vary widely, but
they all share a set of common characteristics that allow them to be described
by common bindings.


Required properties:

- compatible: This property must contain "xlnx,v-hls" to indicate that the
core is compatible with the generic Xilinx HLS DT bindings. It can also
contain a more specific string to identify the HLS core implementation. The
value of those implementation-specific strings is out of scope for these DT
bindings.

- reg: Physical base address and length of the registers sets for the device.
The HLS core has two registers sets, the first one contains the core
standard registers and the second one contains the custom user registers.

- clocks: Reference to the video core clock.

- ports: Video ports, using the DT bindings defined in ../video-interfaces.txt.
The HLS core has one input port (0) and one output port (1).

Required port properties:

- xlnx,video-format: Video format as defined in video.txt.
- xlnx,video-width: Video width as defined in video.txt.

Example:

hls_0: hls@43c00000 {
compatible = "xlnx,v-hls-sobel", "xlnx,v-hls";
reg = <0x43c00000 0x24>, <0x43c00024 0xa0>;
clocks = <&clkc 15>;

ports {
#address-cells = <1>;
#size-cells = <0>;

port@0 {
reg = <0>;

xlnx,video-format = <XVIP_VF_YUV_422>;
xlnx,video-width = <8>;

hls0_in: endpoint {
remote-endpoint = <&vdma_out>;
};
};
port@1 {
reg = <1>;

xlnx,video-format = <XVIP_VF_YUV_422>;
xlnx,video-width = <8>;

hls0_out: endpoint {
remote-endpoint = <&vdma_in>;
};
};
};
};
6 changes: 6 additions & 0 deletions drivers/media/platform/xilinx/Kconfig
Expand Up @@ -24,6 +24,12 @@ config VIDEO_XILINX_CRESAMPLE
---help---
Driver for the Xilinx Chroma Resampler

config VIDEO_XILINX_HLS
tristate "Xilinx Video HLS Core"
depends on VIDEO_XILINX
---help---
Driver for the Xilinx Video HLS Cores

config VIDEO_XILINX_REMAPPER
tristate "Xilinx Video Remapper"
depends on VIDEO_XILINX
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/xilinx/Makefile
Expand Up @@ -5,6 +5,7 @@ xilinx-video-objs += xilinx-dma.o xilinx-vip.o xilinx-vipp.o
obj-$(CONFIG_VIDEO_XILINX) += xilinx-video.o
obj-$(CONFIG_VIDEO_XILINX_CFA) += xilinx-cfa.o
obj-$(CONFIG_VIDEO_XILINX_CRESAMPLE) += xilinx-cresample.o
obj-$(CONFIG_VIDEO_XILINX_HLS) += xilinx-hls.o
obj-$(CONFIG_VIDEO_XILINX_RGB2YUV) += xilinx-rgb2yuv.o
obj-$(CONFIG_VIDEO_XILINX_SCALER) += xilinx-scaler.o
obj-$(CONFIG_VIDEO_XILINX_REMAPPER) += xilinx-remapper.o
Expand Down
36 changes: 36 additions & 0 deletions drivers/media/platform/xilinx/xilinx-hls-common.h
@@ -0,0 +1,36 @@
/*
* Xilinx HLS common header
*
* Copyright (C) 2013-2015 Xilinx, Inc.
*
* Contacts: Radhey Shyam Pandey <radheys@xilinx.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#ifndef __XILINX_HLS_COMMON_H__
#define __XILINX_HLS_COMMON_H__

#include <linux/bitops.h>

#define XHLS_DEF_WIDTH 1920
#define XHLS_DEF_HEIGHT 1080

#define XHLS_REG_CTRL_DONE BIT(1)
#define XHLS_REG_CTRL_IDLE BIT(2)
#define XHLS_REG_CTRL_READY BIT(3)
#define XHLS_REG_CTRL_AUTO_RESTART BIT(7)
#define XHLS_REG_GIE 0x04
#define XHLS_REG_GIE_GIE BIT(0)
#define XHLS_REG_IER 0x08
#define XHLS_REG_IER_DONE BIT(0)
#define XHLS_REG_IER_READY BIT(1)
#define XHLS_REG_ISR 0x0c
#define XHLS_REG_ISR_DONE BIT(0)
#define XHLS_REG_ISR_READY BIT(1)
#define XHLS_REG_ROWS 0x10
#define XHLS_REG_COLS 0x18

#endif /* __XILINX_HLS_COMMON_H__ */

0 comments on commit d494b0c

Please sign in to comment.