tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git tmp
head: 13665f1f8b5d501b40b1bc8448b0a032c7f04cc2
commit: 5ab2e5672de03bce1ddde6842168921ade64e86e [12070/12184] drm/meson: add RDMA module
driver
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable tmp
git checkout 5ab2e5672de03bce1ddde6842168921ade64e86e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/swab.h:5,
from include/uapi/linux/byteorder/big_endian.h:13,
from include/linux/byteorder/big_endian.h:5,
from arch/arm64/include/uapi/asm/byteorder.h:21,
from include/linux/bitfield.h:11,
from drivers/gpu/drm/meson/meson_rdma.c:7:
drivers/gpu/drm/meson/meson_rdma.c: In function 'meson_rdma_init':
> drivers/gpu/drm/meson/meson_rdma.c:38:17: error:
'RDMA_CTRL_SW_RESET' undeclared (first use in this function)
38 |
writel_relaxed(RDMA_CTRL_SW_RESET,
| ^~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:38:2: note: in expansion of macro
'writel_relaxed'
38 | writel_relaxed(RDMA_CTRL_SW_RESET,
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:38:17: note: each undeclared identifier is reported
only once for each function it appears in
38 | writel_relaxed(RDMA_CTRL_SW_RESET,
| ^~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:38:2: note: in expansion of macro
'writel_relaxed'
38 | writel_relaxed(RDMA_CTRL_SW_RESET,
| ^~~~~~~~~~~~~~
> drivers/gpu/drm/meson/meson_rdma.c:40:17: error:
'RDMA_DEFAULT_CONFIG' undeclared (first use in this function)
40 |
writel_relaxed(RDMA_DEFAULT_CONFIG |
| ^~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:40:2: note: in expansion of macro
'writel_relaxed'
40 | writel_relaxed(RDMA_DEFAULT_CONFIG |
| ^~~~~~~~~~~~~~
> drivers/gpu/drm/meson/meson_rdma.c:41:21: error:
'RDMA_CTRL_AHB_WR_BURST' undeclared (first use in this function)
41 |
FIELD_PREP(RDMA_CTRL_AHB_WR_BURST, 3) |
| ^~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:40:2: note: in expansion of macro
'writel_relaxed'
40 | writel_relaxed(RDMA_DEFAULT_CONFIG |
| ^~~~~~~~~~~~~~
include/linux/compiler.h:405:2: note: in expansion of macro
'__compiletime_assert'
405 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:417:2: note: in expansion of macro
'_compiletime_assert'
417 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
81 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:41:10: note: in expansion of macro
'FIELD_PREP'
41 | FIELD_PREP(RDMA_CTRL_AHB_WR_BURST, 3) |
| ^~~~~~~~~~
> drivers/gpu/drm/meson/meson_rdma.c:42:21: error:
'RDMA_CTRL_AHB_RD_BURST' undeclared (first use in this function)
42 |
FIELD_PREP(RDMA_CTRL_AHB_RD_BURST, 0),
| ^~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:40:2: note: in expansion of macro
'writel_relaxed'
40 | writel_relaxed(RDMA_DEFAULT_CONFIG |
| ^~~~~~~~~~~~~~
include/linux/compiler.h:405:2: note: in expansion of macro
'__compiletime_assert'
405 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:417:2: note: in expansion of macro
'_compiletime_assert'
417 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
81 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:42:10: note: in expansion of macro
'FIELD_PREP'
42 | FIELD_PREP(RDMA_CTRL_AHB_RD_BURST, 0),
| ^~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c: In function 'meson_rdma_setup':
> drivers/gpu/drm/meson/meson_rdma.c:65:22: error:
'RDMA_ACCESS_RW_FLAG_CHAN1' undeclared (first use in this function)
65
| writel_bits_relaxed(RDMA_ACCESS_RW_FLAG_CHAN1 |
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:65:2: note: in expansion of macro
'writel_bits_relaxed'
65 | writel_bits_relaxed(RDMA_ACCESS_RW_FLAG_CHAN1 |
| ^~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/meson/meson_rdma.c:66:8: error:
'RDMA_ACCESS_ADDR_INC_CHAN1' undeclared (first use in this function)
66 | RDMA_ACCESS_ADDR_INC_CHAN1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:65:2: note: in expansion of macro
'writel_bits_relaxed'
65 | writel_bits_relaxed(RDMA_ACCESS_RW_FLAG_CHAN1 |
| ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c: In function 'meson_rdma_stop':
> drivers/gpu/drm/meson/meson_rdma.c:73:22: error:
'RDMA_IRQ_CLEAR_CHAN1' undeclared (first use in this function)
73 |
writel_bits_relaxed(RDMA_IRQ_CLEAR_CHAN1,
| ^~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:73:2: note: in expansion of macro
'writel_bits_relaxed'
73 | writel_bits_relaxed(RDMA_IRQ_CLEAR_CHAN1,
| ^~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/meson/meson_rdma.c:78:22: error:
'RDMA_ACCESS_TRIGGER_CHAN1' undeclared (first use in this function)
78
| writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:78:2: note: in expansion of macro
'writel_bits_relaxed'
78 | writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:79:19: error: 'RDMA_ACCESS_ADDR_INC_CHAN1'
undeclared (first use in this function)
79 | FIELD_PREP(RDMA_ACCESS_ADDR_INC_CHAN1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:78:2: note: in expansion of macro
'writel_bits_relaxed'
78 | writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:405:2: note: in expansion of macro
'__compiletime_assert'
405 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:417:2: note: in expansion of macro
'_compiletime_assert'
417 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
81 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:79:8: note: in expansion of macro
'FIELD_PREP'
79 | FIELD_PREP(RDMA_ACCESS_ADDR_INC_CHAN1,
| ^~~~~~~~~~
> drivers/gpu/drm/meson/meson_rdma.c:80:12: error:
'RDMA_ACCESS_TRIGGER_STOP' undeclared (first use in this function)
80
| RDMA_ACCESS_TRIGGER_STOP),
| ^~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:78:2: note: in expansion of macro
'writel_bits_relaxed'
78 | writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:405:2: note: in expansion of macro
'__compiletime_assert'
405 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:417:2: note: in expansion of macro
'_compiletime_assert'
417 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:49:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
49 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
81 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:79:8: note: in expansion of macro
'FIELD_PREP'
79 | FIELD_PREP(RDMA_ACCESS_ADDR_INC_CHAN1,
| ^~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c: In function 'meson_rdma_flush':
drivers/gpu/drm/meson/meson_rdma.c:129:22: error: 'RDMA_ACCESS_TRIGGER_CHAN1'
undeclared (first use in this function)
129 | writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:129:2: note: in expansion of macro
'writel_bits_relaxed'
129 | writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/meson/meson_rdma.c:131:12: error:
'RDMA_ACCESS_TRIGGER_VSYNC' undeclared (first use in this function)
131
| RDMA_ACCESS_TRIGGER_VSYNC),
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:118:32: note: in definition of macro '__swab32'
118 | (__builtin_constant_p((__u32)(x)) ? \
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro
'__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_registers.h:15:2: note: in expansion of macro
'writel_relaxed'
15 | writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)),
addr)
| ^~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:129:2: note: in expansion of macro
'writel_bits_relaxed'
129 | writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:405:2: note: in expansion of macro
'__compiletime_assert'
405 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:417:2: note: in expansion of macro
'_compiletime_assert'
417 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:49:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
49 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:81:3: note: in expansion of macro '__BF_FIELD_CHECK'
81 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~~~~~~~~~~~~~
drivers/gpu/drm/meson/meson_rdma.c:130:8: note: in expansion of macro
'FIELD_PREP'
130 | FIELD_PREP(RDMA_ACCESS_TRIGGER_CHAN1,
| ^~~~~~~~~~
vim +/RDMA_CTRL_SW_RESET +38 drivers/gpu/drm/meson/meson_rdma.c
23
24 int meson_rdma_init(struct meson_drm *priv)
25 {
26 if (!priv->rdma.addr) {
27 /* Allocate a PAGE buffer */
28 priv->rdma.addr =
29 dma_alloc_coherent(priv->dev, SZ_4K,
30 &priv->rdma.addr_phys,
31 GFP_KERNEL);
32 if (!priv->rdma.addr)
33 return -ENOMEM;
34 }
35
36 priv->rdma.offset = 0;
37
38 writel_relaxed(RDMA_CTRL_SW_RESET,
39
priv->io_base + _REG(RDMA_CTRL));
40 writel_relaxed(RDMA_DEFAULT_CONFIG |
41 FIELD_PREP(RDMA_CTRL_AHB_WR_BURST, 3) |
42 FIELD_PREP(RDMA_CTRL_AHB_RD_BURST, 0),
43 priv->io_base
+ _REG(RDMA_CTRL));
44
45 return 0;
46 }
47
48 void meson_rdma_free(struct meson_drm *priv)
49 {
50 if (!priv->rdma.addr && !priv->rdma.addr_phys)
51 return;
52
53 meson_rdma_stop(priv);
54
55 dma_free_coherent(priv->dev, SZ_4K,
56 priv->rdma.addr, priv->rdma.addr_phys);
57
58 priv->rdma.addr = NULL;
59 priv->rdma.addr_phys = (dma_addr_t)NULL;
60 }
61
62 void meson_rdma_setup(struct meson_drm *priv)
63 {
64 /* Channel 1: Write Flag, No Address Increment */
65 writel_bits_relaxed(RDMA_ACCESS_RW_FLAG_CHAN1 |
66 RDMA_ACCESS_ADDR_INC_CHAN1,
67 RDMA_ACCESS_RW_FLAG_CHAN1,
68 priv->io_base + _REG(RDMA_ACCESS_AUTO));
69 }
70
71 void meson_rdma_stop(struct meson_drm *priv)
72 {
73 writel_bits_relaxed(RDMA_IRQ_CLEAR_CHAN1,
74
RDMA_IRQ_CLEAR_CHAN1,
75 priv->io_base + _REG(RDMA_CTRL));
76
77 /* Stop Channel 1 */
78 writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
79
FIELD_PREP(RDMA_ACCESS_ADDR_INC_CHAN1,
80 RDMA_ACCESS_TRIGGER_STOP),
81
priv->io_base + _REG(RDMA_ACCESS_AUTO));
82 }
83
84 void meson_rdma_reset(struct meson_drm *priv)
85 {
86 meson_rdma_stop(priv);
87
88 priv->rdma.offset = 0;
89 }
90
91 static void meson_rdma_writel(struct meson_drm *priv, uint32_t val,
92 uint32_t reg)
93 {
94 if (priv->rdma.offset >= (SZ_4K / RDMA_DESC_SIZE)) {
95 dev_warn_once(priv->dev, "%s: overflow\n", __func__);
96 return;
97 }
98
99 priv->rdma.addr[priv->rdma.offset++] = reg;
100 priv->rdma.addr[priv->rdma.offset++] = val;
101 }
102
103 /*
104 * This will add the register to the RDMA buffer and write it to the
105 * hardware at the same time.
106 * When meson_rdma_flush is called, the RDMA will replay the register
107 * writes in order.
108 */
109 void meson_rdma_writel_sync(struct meson_drm *priv, uint32_t val, uint32_t reg)
110 {
111 meson_rdma_writel(priv, val, reg);
112
113 writel_relaxed(val, priv->io_base + _REG(reg));
114 }
115
116 void meson_rdma_flush(struct meson_drm *priv)
117 {
118 meson_rdma_stop(priv);
119
120 /* Start of Channel 1 register writes buffer */
121 writel(priv->rdma.addr_phys,
122 priv->io_base + _REG(RDMA_AHB_START_ADDR_1));
123
124 /* Last byte on Channel 1 register writes buffer */
125 writel(priv->rdma.addr_phys + (priv->rdma.offset * RDMA_DESC_SIZE) - 1,
126 priv->io_base + _REG(RDMA_AHB_END_ADDR_1));
127
128 /* Trigger Channel 1 on VSYNC event */
129 writel_bits_relaxed(RDMA_ACCESS_TRIGGER_CHAN1,
130 FIELD_PREP(RDMA_ACCESS_TRIGGER_CHAN1,
131 RDMA_ACCESS_TRIGGER_VSYNC),
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org