Skip to content

Commit 48a78e5

Browse files
committed
Merge branch 'at91-4.14-trunk/vdec' into linux-4.14-at91
2 parents 8889a6b + cccb1eb commit 48a78e5

8 files changed

Lines changed: 959 additions & 0 deletions

File tree

arch/arm/mach-at91/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ config SOC_SAMA5D4
5959
help
6060
Select this if you are using one of Atmel's SAMA5D4 family SoC.
6161

62+
config AT91_VDEC_G1
63+
bool "Video Decoder for SAMA5D4"
64+
depends on SOC_SAMA5D4
65+
help
66+
Select this if you are using the G1 video decoder embedded in SAMA5D4
67+
SoC family.
68+
6269
config SOC_AT91RM9200
6370
bool "AT91RM9200"
6471
depends on ARCH_MULTI_V4T

arch/arm/mach-at91/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ obj-$(CONFIG_SOC_AT91RM9200) += at91rm9200.o
88
obj-$(CONFIG_SOC_AT91SAM9) += at91sam9.o
99
obj-$(CONFIG_SOC_SAMA5) += sama5.o
1010
obj-$(CONFIG_SOC_SAMV7) += samv7.o
11+
obj-$(CONFIG_AT91_VDEC_G1) += memalloc.o vdec_g1.o
1112

1213
# Power Management
1314
obj-$(CONFIG_ATMEL_PM) += pm.o pm_suspend.o

arch/arm/mach-at91/at91_vdec.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Video Decoder (VDEC) - System peripherals registers.
3+
*
4+
* Copyright (C) 2009 Hantro Products Oy.
5+
*
6+
* Based on SAMA5D4 datasheet.
7+
*
8+
* This program is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU General Public License
10+
* as published by the Free Software Foundation; either version 2
11+
* of the License, or (at your option) any later version.
12+
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program; if not, write to the Free Software
20+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21+
*/
22+
23+
#ifndef AT91_VDEC_H
24+
#define AT91_VDEC_H
25+
26+
#define VDEC_IDR 0x00 /* ID Register (read-only) */
27+
#define VDEC_IDR_BUILD_VER 0xf /* Build Version is 0x02. */
28+
#define VDEC_IDR_MINOR_VER (0xff << 4) /* Minor Version is 0x88. */
29+
#define VDEC_IDR_MAJOR_VER (0xf << 12) /* Major Version is 0x08. */
30+
#define VDEC_IDR_PROD_ID (0xffff << 16) /* Product ID is 0x6731. */
31+
32+
#define VDEC_DIR 0x04 /* Decoder Interrupt Register */
33+
#define VDEC_DIR_DE 1 /* 1: Enable decoder; 0: Disable decoder. */
34+
#define VDEC_DIR_ID 0x10 /* 1: Disable interrupts for decoder; 0: Enable interrupts. */
35+
#define VDEC_DIR_ABORT 0x20
36+
#define VDEC_DIR_ISET 0x100 /* Decoder Interrupt Set. 0: Clears the Decoder Interrupt. */
37+
38+
#define VDEC_PPIR 0xF0 /* Post Processor Interrupt Register */
39+
#define VDEC_PPIR_PPE 1 /* 1: Enable post-processor; 0: Disable post-processor */
40+
#define VDEC_PPIR_ID 0x10 /* 1: Disable interrupts for post-processor; 0: Enable interrupts. */
41+
#define VDEC_PPIR_ISET 0x100 /* Post-processor Interrupt Set. 0: Clears the post-processor Interrupt. */
42+
43+
#endif

arch/arm/mach-at91/hx170dec.h

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Decoder device driver (kernel module headers)
3+
*
4+
* Copyright (C) 2009 Hantro Products Oy.
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU General Public License
8+
* as published by the Free Software Foundation; either version 2
9+
* of the License, or (at your option) any later version.
10+
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program; if not, write to the Free Software
18+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
21+
#ifndef _HX170DEC_H_
22+
#define _HX170DEC_H_
23+
24+
#include <linux/ioctl.h>
25+
#include <linux/types.h>
26+
27+
struct core_desc
28+
{
29+
__u32 id; /* id of the core */
30+
__u32 *regs; /* pointer to user registers */
31+
__u32 size; /* size of register space */
32+
};
33+
34+
/* Use 'k' as magic number */
35+
#define HX170DEC_IOC_MAGIC 'k'
36+
/*
37+
* S means "Set" through a ptr,
38+
* T means "Tell" directly with the argument value
39+
* G means "Get": reply by setting through a pointer
40+
* Q means "Query": response is on the return value
41+
* X means "eXchange": G and S atomically
42+
* H means "sHift": T and Q atomically
43+
*/
44+
45+
#define HX170DEC_IOCGHWOFFSET _IOR(HX170DEC_IOC_MAGIC, 3, unsigned long *)
46+
#define HX170DEC_IOCGHWIOSIZE _IOR(HX170DEC_IOC_MAGIC, 4, unsigned int *)
47+
48+
#define HX170DEC_IOC_MC_OFFSETS _IOR(HX170DEC_IOC_MAGIC, 7, unsigned long *)
49+
#define HX170DEC_IOC_MC_CORES _IOR(HX170DEC_IOC_MAGIC, 8, unsigned int *)
50+
#define HX170DEC_IOCS_DEC_PUSH_REG _IOW(HX170DEC_IOC_MAGIC, 9, struct core_desc *)
51+
#define HX170DEC_IOCS_PP_PUSH_REG _IOW(HX170DEC_IOC_MAGIC, 10, struct core_desc *)
52+
#define HX170DEC_IOCH_DEC_RESERVE _IO(HX170DEC_IOC_MAGIC, 11)
53+
#define HX170DEC_IOCT_DEC_RELEASE _IO(HX170DEC_IOC_MAGIC, 12)
54+
#define HX170DEC_IOCQ_PP_RESERVE _IO(HX170DEC_IOC_MAGIC, 13)
55+
#define HX170DEC_IOCT_PP_RELEASE _IO(HX170DEC_IOC_MAGIC, 14)
56+
#define HX170DEC_IOCX_DEC_WAIT _IOWR(HX170DEC_IOC_MAGIC, 15, struct core_desc *)
57+
#define HX170DEC_IOCX_PP_WAIT _IOWR(HX170DEC_IOC_MAGIC, 16, struct core_desc *)
58+
#define HX170DEC_IOCS_DEC_PULL_REG _IOWR(HX170DEC_IOC_MAGIC, 17, struct core_desc *)
59+
#define HX170DEC_IOCS_PP_PULL_REG _IOWR(HX170DEC_IOC_MAGIC, 18, struct core_desc *)
60+
61+
#define HX170DEC_IOX_ASIC_ID _IOWR(HX170DEC_IOC_MAGIC, 20, __u32 *)
62+
63+
/*
64+
* Following are not used yet:
65+
*
66+
* #define HX170DEC_PP_INSTANCE _IO(HX170DEC_IOC_MAGIC, 1)
67+
* #define HX170DEC_HW_PERFORMANCE _IO(HX170DEC_IOC_MAGIC, 2)
68+
* #define HX170DEC_IOC_CLI _IO(HX170DEC_IOC_MAGIC, 5)
69+
* #define HX170DEC_IOC_STI _IO(HX170DEC_IOC_MAGIC, 6)
70+
* #define HX170DEC_IOCG_CORE_WAIT _IOR(HX170DEC_IOC_MAGIC, 19, int *)
71+
* #define HX170DEC_DEBUG_STATUS _IO(HX170DEC_IOC_MAGIC, 29)
72+
*/
73+
74+
#define HX170DEC_IOC_MAXNR 29
75+
76+
#endif /* !_HX170DEC_H_ */

0 commit comments

Comments
 (0)