tree:
https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: d2945e83762685e27b20286924d8e59daa10233f
commit: 61b770b79cf297ed40010e74b8fc1b55ab1e2aaa [9991/9999] UPSTREAM: ASoC: SOF:
mediatek: Add mt8195 hardware support
config: nios2-allyesconfig
(
https://download.01.org/0day-ci/archive/20220118/202201181032.4rx9gA6K-lk...)
compiler: nios2-linux-gcc (GCC) 11.2.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
git remote add chrome-os
https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout 61b770b79cf297ed40010e74b8fc1b55ab1e2aaa
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir
ARCH=nios2 SHELL=/bin/bash sound/soc/sof/mediatek/mt8195/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/printk.h:409,
from include/linux/kernel.h:16,
from include/linux/delay.h:22,
from sound/soc/sof/mediatek/mt8195/mt8195.c:12:
sound/soc/sof/mediatek/mt8195/mt8195.c: In function 'platform_parse_resource':
> sound/soc/sof/mediatek/mt8195/mt8195.c:50:22: warning: format
'%llx' expects argument of type 'long long unsigned int', but argument 4
has type 'unsigned int' [-Wformat=]
50 | dev_dbg(dev,
"DMA pbase=0x%llx, size=0x%llx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:129:29: note: in definition of macro
'__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:9: note: in expansion of macro
'_dynamic_func_call'
161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:9: note: in expansion of macro
'dynamic_dev_dbg'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:30: note: in expansion of macro 'dev_fmt'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:50:9: note: in expansion of macro
'dev_dbg'
50 | dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:50:38: note: format string is defined here
50 | dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/printk.h:409,
from include/linux/kernel.h:16,
from include/linux/delay.h:22,
from sound/soc/sof/mediatek/mt8195/mt8195.c:12:
> sound/soc/sof/mediatek/mt8195/mt8195.c:50:22: warning: format
'%llx' expects argument of type 'long long unsigned int', but argument 5
has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
50
| dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:129:29: note: in definition of macro
'__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:9: note: in expansion of macro
'_dynamic_func_call'
161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:9: note: in expansion of macro
'dynamic_dev_dbg'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:30: note: in expansion of macro 'dev_fmt'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:50:9: note: in expansion of macro
'dev_dbg'
50 | dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:50:51: note: format string is defined here
50 | dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/printk.h:409,
from include/linux/kernel.h:16,
from include/linux/delay.h:22,
from sound/soc/sof/mediatek/mt8195/mt8195.c:12:
sound/soc/sof/mediatek/mt8195/mt8195.c: In function 'adsp_memory_remap_init':
> sound/soc/sof/mediatek/mt8195/mt8195.c:166:22: warning: format
'%llx' expects argument of type 'long long unsigned int', but argument 4
has type 'phys_addr_t' {aka 'unsigned int'} [-Wformat=]
166 |
dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram,
offset);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:129:29: note: in definition of macro
'__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:9: note: in expansion of macro
'_dynamic_func_call'
161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:9: note: in expansion of macro
'dynamic_dev_dbg'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:30: note: in expansion of macro 'dev_fmt'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:166:9: note: in expansion of macro
'dev_dbg'
166 | dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n",
adsp->pa_dram, offset);
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:166:40: note: format string is defined here
166 | dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n",
adsp->pa_dram, offset);
| ~~~^
| |
| long long unsigned int
| %x
In file included from include/linux/printk.h:409,
from include/linux/kernel.h:16,
from include/linux/delay.h:22,
from sound/soc/sof/mediatek/mt8195/mt8195.c:12:
sound/soc/sof/mediatek/mt8195/mt8195.c: In function
'adsp_shared_base_ioremap':
sound/soc/sof/mediatek/mt8195/mt8195.c:195:22: warning: format '%llx' expects
argument of type 'long long unsigned int', but argument 5 has type
'phys_addr_t' {aka 'unsigned int'} [-Wformat=]
195 | dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx,
size=%#x\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:129:29: note: in definition of macro
'__dynamic_func_call'
129 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/dynamic_debug.h:161:9: note: in expansion of macro
'_dynamic_func_call'
161 | _dynamic_func_call(fmt,__dynamic_dev_dbg, \
| ^~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:9: note: in expansion of macro
'dynamic_dev_dbg'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~
include/linux/dev_printk.h:123:30: note: in expansion of macro 'dev_fmt'
123 | dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:195:9: note: in expansion of macro
'dev_dbg'
195 | dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx,
size=%#x\n",
| ^~~~~~~
sound/soc/sof/mediatek/mt8195/mt8195.c:195:58: note: format string is defined here
195 | dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx,
size=%#x\n",
| ~~~^
| |
| long long unsigned
int
| %x
vim +50 sound/soc/sof/mediatek/mt8195/mt8195.c
28
29 static int platform_parse_resource(struct platform_device *pdev, void *data)
30 {
31 struct resource *mmio;
32 struct resource res;
33 struct device_node *mem_region;
34 struct device *dev = &pdev->dev;
35 struct mtk_adsp_chip_info *adsp = data;
36 int ret;
37
38 mem_region = of_parse_phandle(dev->of_node, "memory-region", 0);
39 if (!mem_region) {
40 dev_err(dev, "no dma memory-region phandle\n");
41 return -ENODEV;
42 }
43
44 ret = of_address_to_resource(mem_region, 0, &res);
45 if (ret) {
46 dev_err(dev, "of_address_to_resource dma failed\n");
47 return ret;
48 }
49
50 dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
51 (phys_addr_t)res.start, resource_size(&res));
52
53 ret = of_reserved_mem_device_init(dev);
54 if (ret) {
55 dev_err(dev, "of_reserved_mem_device_init failed\n");
56 return ret;
57 }
58
59 mem_region = of_parse_phandle(dev->of_node, "memory-region", 1);
60 if (!mem_region) {
61 dev_err(dev, "no memory-region sysmem phandle\n");
62 return -ENODEV;
63 }
64
65 ret = of_address_to_resource(mem_region, 0, &res);
66 if (ret) {
67 dev_err(dev, "of_address_to_resource sysmem failed\n");
68 return ret;
69 }
70
71 adsp->pa_dram = (phys_addr_t)res.start;
72 adsp->dramsize = resource_size(&res);
73 if (adsp->pa_dram & DRAM_REMAP_MASK) {
74 dev_err(dev, "adsp memory(%#x) is not 4K-aligned\n",
75 (u32)adsp->pa_dram);
76 return -EINVAL;
77 }
78
79 if (adsp->dramsize < TOTAL_SIZE_SHARED_DRAM_FROM_TAIL) {
80 dev_err(dev, "adsp memory(%#x) is not enough for share\n",
81 adsp->dramsize);
82 return -EINVAL;
83 }
84
85 dev_dbg(dev, "dram pbase=%pa, dramsize=%#x\n",
86 &adsp->pa_dram, adsp->dramsize);
87
88 /* Parse CFG base */
89 mmio = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg");
90 if (!mmio) {
91 dev_err(dev, "no ADSP-CFG register resource\n");
92 return -ENXIO;
93 }
94 /* remap for DSP register accessing */
95 adsp->va_cfgreg = devm_ioremap_resource(dev, mmio);
96 if (IS_ERR(adsp->va_cfgreg))
97 return PTR_ERR(adsp->va_cfgreg);
98
99 adsp->pa_cfgreg = (phys_addr_t)mmio->start;
100 adsp->cfgregsize = resource_size(mmio);
101
102 dev_dbg(dev, "cfgreg-vbase=%p, cfgregsize=%#x\n",
103 adsp->va_cfgreg, adsp->cfgregsize);
104
105 /* Parse SRAM */
106 mmio = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram");
107 if (!mmio) {
108 dev_err(dev, "no SRAM resource\n");
109 return -ENXIO;
110 }
111
112 adsp->pa_sram = (phys_addr_t)mmio->start;
113 adsp->sramsize = resource_size(mmio);
114 if (adsp->sramsize < TOTAL_SIZE_SHARED_SRAM_FROM_TAIL) {
115 dev_err(dev, "adsp SRAM(%#x) is not enough for share\n",
116 adsp->sramsize);
117 return -EINVAL;
118 }
119
120 dev_dbg(dev, "sram pbase=%pa,%#x\n", &adsp->pa_sram,
adsp->sramsize);
121
122 return ret;
123 }
124
125 static int adsp_sram_power_on(struct device *dev, bool on)
126 {
127 void __iomem *va_dspsysreg;
128 u32 srampool_con;
129
130 va_dspsysreg = ioremap(ADSP_SRAM_POOL_CON, 0x4);
131 if (!va_dspsysreg) {
132 dev_err(dev, "failed to ioremap sram pool base %#x\n",
133 ADSP_SRAM_POOL_CON);
134 return -ENOMEM;
135 }
136
137 srampool_con = readl(va_dspsysreg);
138 if (on)
139 writel(srampool_con & ~DSP_SRAM_POOL_PD_MASK, va_dspsysreg);
140 else
141 writel(srampool_con | DSP_SRAM_POOL_PD_MASK, va_dspsysreg);
142
143 iounmap(va_dspsysreg);
144 return 0;
145 }
146
147 /* Init the basic DSP DRAM address */
148 static int adsp_memory_remap_init(struct device *dev, struct mtk_adsp_chip_info
*adsp)
149 {
150 void __iomem *vaddr_emi_map;
151 int offset;
152
153 if (!adsp)
154 return -ENXIO;
155
156 vaddr_emi_map = devm_ioremap(dev, DSP_EMI_MAP_ADDR, 0x4);
157 if (!vaddr_emi_map) {
158 dev_err(dev, "failed to ioremap emi map base %#x\n",
159 DSP_EMI_MAP_ADDR);
160 return -ENOMEM;
161 }
162
163 offset = adsp->pa_dram - DRAM_PHYS_BASE_FROM_DSP_VIEW;
164 adsp->dram_offset = offset;
165 offset >>= DRAM_REMAP_SHIFT;
166 dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n",
adsp->pa_dram, offset);
167 writel(offset, vaddr_emi_map);
168 if (offset != readl(vaddr_emi_map)) {
169 dev_err(dev, "write emi map fail : %#x\n", readl(vaddr_emi_map));
170 return -EIO;
171 }
172
173 return 0;
174 }
175
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org