From: weirongguang <weirongguang@kylinos.cn>
To: sergio.paracuellos@gmail.com
Cc: linux-mediatek@lists.infradead.org,
weirongguang <weirongguang@kylinos.cn>
Subject: [PATCH] PCI: mt7621: Fix the compile error in cross complication
Date: Thu, 30 Dec 2021 13:47:13 +0800 [thread overview]
Message-ID: <20211230054713.1562260-1-weirongguang@kylinos.cn> (raw)
When I was compile the latest kernel in x86 platform and
the build environment like this:
Compiler: gcc
Compiler version: 10
Compiler string: mips-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110
Cross-compile: mips-linux-gnu-
It make a compile error:
drivers/pci/controller/pcie-mt7621.c: In function 'setup_cm_memory_region':
drivers/pci/controller/pcie-mt7621.c:224:6: error: implicit declaration of function 'mips_cps_numiocu' [-Werror=implicit-function-declaration]
224 | if (mips_cps_numiocu(0)) {
| ^~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-mt7621.c:232:3: error: implicit declaration of function 'write_gcr_reg1_base'; did you mean 'write_gc0_ebase'? [-Werror=implicit-function-declaration]
232 | write_gcr_reg1_base(entry->res->start);
| ^~~~~~~~~~~~~~~~~~~
| write_gc0_ebase
drivers/pci/controller/pcie-mt7621.c:233:3: error: implicit declaration of function 'write_gcr_reg1_mask'; did you mean 'write_gc0_pagemask'? [-Werror=implicit-function-declaration]
233 | write_gcr_reg1_mask(mask | CM_GCR_REGn_MASK_CMTGT_IOCU0);
| ^~~~~~~~~~~~~~~~~~~
| write_gc0_pagemask
drivers/pci/controller/pcie-mt7621.c:233:30: error: 'CM_GCR_REGn_MASK_CMTGT_IOCU0' undeclared (first use in this function)
233 | write_gcr_reg1_mask(mask | CM_GCR_REGn_MASK_CMTGT_IOCU0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-mt7621.c:233:30: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./include/linux/device.h:15,
from ./include/linux/of_platform.h:9,
from drivers/pci/controller/pcie-mt7621.c:26:
drivers/pci/controller/pcie-mt7621.c:235:25: error: implicit declaration of function 'read_gcr_reg1_base'; did you mean 'read_gc0_ebase'? [-Werror=implicit-function-declaration]
235 | (unsigned long long)read_gcr_reg1_base(),
| ^~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:110:23: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/pci/controller/pcie-mt7621.c:234:3: note: in expansion of macro 'dev_info'
234 | dev_info(dev, "PCI coherence region base: 0x%08llx, mask/settings: 0x%08llx\n",
| ^~~~~~~~
drivers/pci/controller/pcie-mt7621.c:236:25: error: implicit declaration of function 'read_gcr_reg1_mask'; did you mean 'read_gc0_pagemask'? [-Werror=implicit-function-declaration]
236 | (unsigned long long)read_gcr_reg1_mask());
| ^~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:110:23: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/pci/controller/pcie-mt7621.c:234:3: note: in expansion of macro 'dev_info'
234 | dev_info(dev, "PCI coherence region base: 0x%08llx, mask/settings: 0x%08llx\n",
| ^~~~~~~~
cc1: all warnings being treated as errors
The problem is that the <asm/mips-cps.h> head file was missing
and it can resolved when include the file.
Fix: <2bdd5238e756> ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver")
Signed-off-by: weirongguang <weirongguang@kylinos.cn>
---
drivers/pci/controller/pcie-mt7621.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/controller/pcie-mt7621.c b/drivers/pci/controller/pcie-mt7621.c
index b60dfb45ef7b..8a009e427a25 100644
--- a/drivers/pci/controller/pcie-mt7621.c
+++ b/drivers/pci/controller/pcie-mt7621.c
@@ -29,6 +29,7 @@
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/sys_soc.h>
+#include <asm/mips-cps.h>
/* MediaTek-specific configuration registers */
#define PCIE_FTS_NUM 0x70c
--
2.25.1
No virus found
Checked by Hillstone Network AntiVirus
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
next reply other threads:[~2021-12-30 7:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-30 5:47 weirongguang [this message]
2021-12-30 7:46 ` [PATCH] PCI: mt7621: Fix the compile error in cross complication Sergio Paracuellos
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=20211230054713.1562260-1-weirongguang@kylinos.cn \
--to=weirongguang@kylinos.cn \
--cc=linux-mediatek@lists.infradead.org \
--cc=sergio.paracuellos@gmail.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;
as well as URLs for NNTP newsgroup(s).