From: kernel test robot <lkp@intel.com>
To: Albert Yang <yangzh0906@thundersoft.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Ge Gordon <gordon.ge@bst.ai>
Cc: oe-kbuild-all@lists.linux.dev,
BST Linux Kernel Upstream Group <bst-upstream@bstai.top>,
linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Victor Shih <victor.shih@genesyslogic.com.tw>,
Shan-Chun Hung <shanchun1218@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Peter Robinson <pbrobinson@gmail.com>,
Ben Chuang <ben.chuang@genesyslogic.com.tw>,
Albert Yang <yangzh0906@thundersoft.com>
Subject: Re: [PATCH v1 5/9] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
Date: Thu, 29 May 2025 06:56:31 +0800 [thread overview]
Message-ID: <202505290615.GZzN5rNL-lkp@intel.com> (raw)
In-Reply-To: <20250528085453.481320-1-yangzh0906@thundersoft.com>
Hi Albert,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on arm64/for-next/core soc/for-next krzk/for-next krzk-dt/for-next krzk-mem-ctrl/for-next linus/master v6.15 next-20250528]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Albert-Yang/dt-bindings-vendor-prefixes-Add-Black-Sesame-Technologies-Co-Ltd/20250528-190614
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20250528085453.481320-1-yangzh0906%40thundersoft.com
patch subject: [PATCH v1 5/9] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
config: i386-randconfig-002-20250529 (https://download.01.org/0day-ci/archive/20250529/202505290615.GZzN5rNL-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250529/202505290615.GZzN5rNL-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/202505290615.GZzN5rNL-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/mmc/host/sdhci-of-bst-c1200.c:64:6: warning: no previous prototype for 'sdhci_bst_print_vendor' [-Wmissing-prototypes]
64 | void sdhci_bst_print_vendor(struct sdhci_host *host)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-of-bst-c1200.c:153:6: warning: no previous prototype for 'sdhci_enable_bst_clk' [-Wmissing-prototypes]
153 | void sdhci_enable_bst_clk(struct sdhci_host *host, unsigned int clk)
| ^~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-of-bst-c1200.c:245:6: warning: no previous prototype for 'sdhci_set_bst_clock' [-Wmissing-prototypes]
245 | void sdhci_set_bst_clock(struct sdhci_host *host, unsigned int clock)
| ^~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-of-bst-c1200.c: In function 'bst_sdhci_execute_tuning':
>> drivers/mmc/host/sdhci-of-bst-c1200.c:323:13: warning: unused variable 'val' [-Wunused-variable]
323 | u32 val;
| ^~~
drivers/mmc/host/sdhci-of-bst-c1200.c: At top level:
>> drivers/mmc/host/sdhci-of-bst-c1200.c:507:5: warning: no previous prototype for 'bst_sdhci_setup_host' [-Wmissing-prototypes]
507 | int bst_sdhci_setup_host(struct sdhci_host *host)
| ^~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-of-bst-c1200.c: In function 'bst_sdhci_setup_host':
>> drivers/mmc/host/sdhci-of-bst-c1200.c:515:14: warning: variable 'enable_vqmmc' set but not used [-Wunused-but-set-variable]
515 | bool enable_vqmmc = false;
| ^~~~~~~~~~~~
>> drivers/mmc/host/sdhci-of-bst-c1200.c:513:13: warning: variable 'max_clk' set but not used [-Wunused-but-set-variable]
513 | u32 max_clk;
| ^~~~~~~
vim +/sdhci_bst_print_vendor +64 drivers/mmc/host/sdhci-of-bst-c1200.c
63
> 64 void sdhci_bst_print_vendor(struct sdhci_host *host)
65 {
66 SDHCI_DUMP_BST("============ SDHCI VENDOR REGISTER DUMP ===========\n");
67
68 SDHCI_DUMP_BST("VER_ID: 0x%08x | VER_TPYE: 0x%08x\n",
69 sdhci_readl(host, SDHC_MHSC_VER_ID_R),
70 sdhci_readl(host, SDHC_MHSC_VER_TPYE_R));
71 SDHCI_DUMP_BST("MHSC_CTRL: 0x%08x | MBIU_CTRL: 0x%08x\n",
72 sdhci_readw(host, SDHC_MHSC_CTRL_R),
73 sdhci_readw(host, SDHC_MBIU_CTRL_R));
74 SDHCI_DUMP_BST("EMMC_CTRL: 0x%08x | BOOT_CTRL: 0x%08x\n",
75 sdhci_readl(host, SDHC_EMMC_CTRL_R),
76 sdhci_readw(host, SDHC_BOOT_CTRL_R));
77 SDHCI_DUMP_BST("GP_IN: 0x%08x | GP_OUT: 0x%08x\n",
78 sdhci_readl(host, SDHC_GP_IN_R),
79 sdhci_readb(host, SDHC_GP_OUT_R));
80 SDHCI_DUMP_BST("AT_CTRL: 0x%08x | AT_STAT: 0x%08x\n",
81 sdhci_readb(host, SDHC_AT_CTRL_R),
82 sdhci_readb(host, SDHC_AT_STAT_R));
83 }
84 EXPORT_SYMBOL_GPL(sdhci_bst_print_vendor);
85
86 static u32 bst_read_phys_bst(u32 phys_addr)
87 {
88 u32 phys_addr_page = phys_addr & 0xFFFFE000;
89 u32 phys_offset = phys_addr & 0x00001FFF;
90 u32 map_size = phys_offset + sizeof(u32);
91 u32 ret = 0xDEADBEEF;
92 void *mem_mapped = ioremap(phys_addr_page, map_size);
93
94 if (mem_mapped) {
95 ret = (u32)ioread32(((u8 *)mem_mapped) + phys_offset);
96 iounmap(mem_mapped);
97 }
98
99 return ret;
100 }
101
102 static void bst_write_phys_bst(u32 phys_addr, u32 value)
103 {
104 u32 phys_addr_page = phys_addr & 0xFFFFE000;
105 u32 phys_offset = phys_addr & 0x00001FFF;
106 u32 map_size = phys_offset + sizeof(u32);
107 void *mem_mapped = ioremap(phys_addr_page, map_size);
108
109 if (mem_mapped) {
110 iowrite32(value, ((u8 *)mem_mapped) + phys_offset);
111 iounmap(mem_mapped);
112 }
113 }
114
115 static unsigned int bst_get_max_clock(struct sdhci_host *host)
116 {
117 return host->mmc->f_max;
118 }
119
120 static unsigned int bst_get_min_clock(struct sdhci_host *host)
121 {
122 return host->mmc->f_min;
123 }
124
125 struct rx_ctrl {
126 struct {
127 u32 rx_revert:1;
128 u32 rx_clk_sel_sec:1;
129 u32 rx_clk_div:4;
130 u32 rx_clk_phase_inner:2;
131 u32 rx_clk_sel_first:1;
132 u32 rx_clk_phase_out:2;
133 u32 rx_clk_en:1;
134 u32 res0:20;
135 } bit;
136 u32 reg;
137 };
138
139 struct sdmmc_iocfg {
140 struct {
141 u32 res0:16;
142 u32 SC_SDMMC0_PVDD18POCSD0:2;
143 u32 SC_SDMMC0_PVDD18POCSD1:2;
144 u32 SC_SDMMC0_PVDD18POCSD2:2;
145 u32 SC_SDMMC1_PVDD18POCSD0:2;
146 u32 SC_SDMMC1_PVDD18POCSD1:2;
147 u32 SC_SDMMC1_PVDD18POCSD2:2;
148 u32 res1:4;
149 } bit;
150 u32 reg;
151 };
152
> 153 void sdhci_enable_bst_clk(struct sdhci_host *host, unsigned int clk)
154 {
155 struct sdhci_pltfm_host *pltfm_host;
156 struct dwcmshc_priv *priv;
157 unsigned int div;
158 u32 val;
159 struct rx_ctrl rx_reg;
160
161 pltfm_host = sdhci_priv(host);
162 priv = sdhci_pltfm_priv(pltfm_host);
163 if (clk == 0) {
164 div = clk;
165 } else if (clk > default_max_freq) {
166 div = clk / 1000;
167 div = default_max_freq / div;
168 } else if (clk < 1500) {
169 div = clk;
170 } else {
171 div = default_max_freq * 100;
172 div = div / clk;
173 div /= 100;
174 }
175
176 clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
177 clk &= ~SDHCI_CLOCK_CARD_EN;
178 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
179
180 clk &= ~SDHCI_CLOCK_PLL_EN;
181 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
182
183 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_TIMER_DIV_CTRL);
184 val &= ~(1 << 8);
185 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_TIMER_DIV_CTRL, val);
186
187 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_TIMER_DIV_CTRL);
188 val &= ~(0xff);
189 val |= 0x20;
190 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_TIMER_DIV_CTRL, val);
191
192 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_TIMER_DIV_CTRL);
193 val |= 1 << 8;
194 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_TIMER_DIV_CTRL, val);
195
196 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_RX_CLK_CTRL);
197 val &= ~(1 << 11);
198 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_RX_CLK_CTRL, val);
199
200 rx_reg.reg = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_RX_CLK_CTRL);
201
202 rx_reg.bit.rx_revert = 0;
203 rx_reg.bit.rx_clk_sel_sec = 1;
204 rx_reg.bit.rx_clk_div = 4;
205 rx_reg.bit.rx_clk_phase_inner = 2;
206 rx_reg.bit.rx_clk_sel_first = 0;
207 rx_reg.bit.rx_clk_phase_out = 2;
208
209 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_RX_CLK_CTRL, rx_reg.reg);
210
211 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_RX_CLK_CTRL);
212 val |= 1 << 11;
213 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_RX_CLK_CTRL, val);
214
215 /* Disable clock first */
216 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_BCLK_DIV_CTRL);
217 val &= ~0x0400;
218 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_BCLK_DIV_CTRL, val);
219
220 /* Setup clock divider */
221 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_BCLK_DIV_CTRL);
222 val &= ~0x03ff;
223 val |= div;
224 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_BCLK_DIV_CTRL, val);
225
226 /* Enable clock */
227 val = bst_read_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_BCLK_DIV_CTRL);
228 val |= 0x0400;
229 bst_write_phys_bst(priv->phy_crm_reg_base + SDEMMC_CRM_BCLK_DIV_CTRL, val);
230
231 sdhci_writew(host, (div & 0xff) << 8, SDHCI_CLOCK_CONTROL);
232
233 sdhci_writew(host, (div & 0xff) << 8, SDHCI_CLOCK_CONTROL);
234 clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
235 clk |= SDHCI_CLOCK_PLL_EN;
236 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
237
238 clk |= SDHCI_CLOCK_CARD_EN;
239 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
240
241 clk |= SDHCI_CLOCK_INT_EN;
242 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
243 }
244
> 245 void sdhci_set_bst_clock(struct sdhci_host *host, unsigned int clock)
246 {
247 if (clock == 0)
248 return;
249 sdhci_enable_bst_clk(host, clock);
250 }
251
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-05-28 22:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 8:54 [PATCH v1 5/9] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver Albert Yang
2025-05-28 9:06 ` Geert Uytterhoeven
2025-05-28 22:56 ` kernel test robot [this message]
2025-05-29 1:22 ` kernel test robot
2025-06-16 11:19 ` Adrian Hunter
[not found] ` <202506271822530452465@thundersoft.com>
2025-06-27 13:19 ` Adrian Hunter
2025-06-27 13:43 ` Arnd Bergmann
[not found] ` <202507021657587315993@thundersoft.com>
2025-07-02 9:51 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202505290615.GZzN5rNL-lkp@intel.com \
--to=lkp@intel.com \
--cc=adrian.hunter@intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=arnd@arndb.de \
--cc=ben.chuang@genesyslogic.com.tw \
--cc=bst-upstream@bstai.top \
--cc=geert+renesas@glider.be \
--cc=gordon.ge@bst.ai \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pbrobinson@gmail.com \
--cc=shanchun1218@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=victor.shih@genesyslogic.com.tw \
--cc=yangzh0906@thundersoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox