Re: [PATCH 5/7] soc: aspeed: Add eSPI flash channel support

kernel test robot
2026-03-20T04:21:16Z

Hi aspeedyh,

kernel test robot noticed the following build errors:

[auto build test ERROR on 0257f64bdac7fdca30fa3cae0df8b9ecbec7733a]

url: https://github.com/intel-lab-lkp/linux/commits/aspeedyh/dt-bindings-soc-aspeed-Add-AST2600-eSPI-controller/20260315-101647
base: 0257f64bdac7fdca30fa3cae0df8b9ecbec7733a
patch link: https://lore.kernel.org/r/20260313-upstream_espi-v1-5-9504428e1f43%40aspeedtech.com
patch subject: [PATCH 5/7] soc: aspeed: Add eSPI flash channel support
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20260320/202603201234.n0spXcAN-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260320/202603201234.n0spXcAN-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603201234.n0spXcAN-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/soc/aspeed/espi/ast2600-espi.c:137:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
reg |= FIELD_PREP(ESPI_CTRL_FLASH_TAFS_MODE, flash->tafs.mode);
^
drivers/soc/aspeed/espi/ast2600-espi.c:172:28: warning: variable 'flash' set but not used [-Wunused-but-set-variable]
struct aspeed_espi_flash *flash;
^
>> drivers/soc/aspeed/espi/ast2600-espi.c:194:13: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
hdr->cyc = FIELD_GET(ESPI_FLASH_RX_CTRL_CYC, reg);
^
drivers/soc/aspeed/espi/ast2600-espi.c:243:8: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
reg = FIELD_PREP(ESPI_FLASH_TX_CTRL_CYC, cyc) |
^
1 warning and 3 errors generated.

vim +/FIELD_PREP +137 drivers/soc/aspeed/espi/ast2600-espi.c

111
112 static void ast2600_espi_flash_reset(struct aspeed_espi *espi)
113 {
114 struct aspeed_espi_flash *flash;
115 u32 reg;
116
117 flash = &espi->flash;
118
119 writel(ESPI_INT_EN_FLASH, espi->regs + ESPI_INT_EN_CLR);
120 writel(ESPI_INT_STS_FLASH, espi->regs + ESPI_INT_STS);
121
122 reg = readl(espi->regs + ESPI_CTRL);
123 reg &= ~(ESPI_CTRL_FLASH_TX_SW_RST
124 | ESPI_CTRL_FLASH_RX_SW_RST
125 | ESPI_CTRL_FLASH_TX_DMA_EN
126 | ESPI_CTRL_FLASH_RX_DMA_EN
127 | ESPI_CTRL_FLASH_SW_RDY);
128 writel(reg, espi->regs + ESPI_CTRL);
129
130 udelay(1);
131
132 reg |= (ESPI_CTRL_FLASH_TX_SW_RST | ESPI_CTRL_FLASH_RX_SW_RST);
133 writel(reg, espi->regs + ESPI_CTRL);
134
135 flash->tafs.mode = TAFS_MODE_SW;
136 reg = readl(espi->regs + ESPI_CTRL) & ~ESPI_CTRL_FLASH_TAFS_MODE;
> 137 reg |= FIELD_PREP(ESPI_CTRL_FLASH_TAFS_MODE, flash->tafs.mode);
138 writel(reg, espi->regs + ESPI_CTRL);
139
140 if (flash->dma.enable) {
141 writel(flash->dma.tx_addr, espi->regs + ESPI_FLASH_TX_DMA);
142 writel(flash->dma.rx_addr, espi->regs + ESPI_FLASH_RX_DMA);
143
144 reg = readl(espi->regs + ESPI_CTRL)
145 | ESPI_CTRL_FLASH_TX_DMA_EN
146 | ESPI_CTRL_FLASH_RX_DMA_EN;
147 writel(reg, espi->regs + ESPI_CTRL);
148 }
149
150 writel(ESPI_INT_EN_FLASH_RX_CMPLT, espi->regs + ESPI_INT_EN);
151
152 reg = readl(espi->regs + ESPI_CTRL) | ESPI_CTRL_FLASH_SW_RDY;
153 writel(reg, espi->regs + ESPI_CTRL);
154 }
155
156 int ast2600_espi_flash_probe(struct aspeed_espi *espi)
157 {
158 u32 regs;
159
160 regs = readl(espi->regs + ESPI_STS);
161 if (regs & (ESPI_STS_FLASH_TX_BUSY | ESPI_STS_FLASH_RX_BUSY)) {
162 dev_warn(espi->dev, "eSPI flash channel is busy, deferring...\n");
163 return -EPROBE_DEFER;
164 }
165
166 ast2600_espi_flash_reset(espi);
167 return 0;
168 }
169
170 int ast2600_espi_flash_remove(struct aspeed_espi *espi)
171 {
172 struct aspeed_espi_flash *flash;
173 u32 reg;
174
175 flash = &espi->flash;
176
177 writel(ESPI_INT_EN_FLASH, espi->regs + ESPI_INT_EN_CLR);
178
179 reg = readl(espi->regs + ESPI_CTRL);
180 reg &= ~(ESPI_CTRL_FLASH_TX_DMA_EN
181 | ESPI_CTRL_FLASH_RX_DMA_EN
182 | ESPI_CTRL_FLASH_SW_RDY);
183 writel(reg, espi->regs + ESPI_CTRL);
184
185 return 0;
186 }
187
188 int ast2600_espi_flash_get_hdr(struct aspeed_espi *espi,
189 struct espi_comm_hdr *hdr)
190 {
191 u32 reg, len;
192
193 reg = readl(espi->regs + ESPI_FLASH_RX_CTRL);
> 194 hdr->cyc = FIELD_GET(ESPI_FLASH_RX_CTRL_CYC, reg);
195 hdr->tag = FIELD_GET(ESPI_FLASH_RX_CTRL_TAG, reg);
196 len = FIELD_GET(ESPI_FLASH_RX_CTRL_LEN, reg);
197 hdr->len_h = (len >> 8) & 0xff;
198 hdr->len_l = len & 0xff;
199
200 return 0;
201 }
202

--
0-DAY CI Kernel Test Service