diff mbox series

[RFC,net-next,09/10] net: hibmcge: Add a Makefile and update Kconfig for hibmcge

Message ID 20240731094245.1967834-10-shaojijie@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Add support of HIBMCGE Ethernet Driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 42 this patch: 19
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang fail Errors and warnings before: 44 this patch: 36
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 49 this patch: 26
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jijie Shao July 31, 2024, 9:42 a.m. UTC
Add a Makefile and update Kconfig to build hibmcge driver.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/Kconfig          | 17 ++++++++++++++++-
 drivers/net/ethernet/hisilicon/Makefile         |  1 +
 drivers/net/ethernet/hisilicon/hibmcge/Makefile | 10 ++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ethernet/hisilicon/hibmcge/Makefile

Comments

Andrew Lunn Aug. 1, 2024, 1:13 a.m. UTC | #1
On Wed, Jul 31, 2024 at 05:42:44PM +0800, Jijie Shao wrote:
> Add a Makefile and update Kconfig to build hibmcge driver.
> 
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
>  drivers/net/ethernet/hisilicon/Kconfig          | 17 ++++++++++++++++-
>  drivers/net/ethernet/hisilicon/Makefile         |  1 +
>  drivers/net/ethernet/hisilicon/hibmcge/Makefile | 10 ++++++++++
>  3 files changed, 27 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/net/ethernet/hisilicon/hibmcge/Makefile
> 
> diff --git a/drivers/net/ethernet/hisilicon/Kconfig b/drivers/net/ethernet/hisilicon/Kconfig
> index 3312e1d93c3b..372854d15481 100644
> --- a/drivers/net/ethernet/hisilicon/Kconfig
> +++ b/drivers/net/ethernet/hisilicon/Kconfig
> @@ -7,7 +7,7 @@ config NET_VENDOR_HISILICON
>  	bool "Hisilicon devices"
>  	default y
>  	depends on OF || ACPI
> -	depends on ARM || ARM64 || COMPILE_TEST
> +	depends on ARM || ARM64 || COMPILE_TEST || X86_64

It is normal to have COMPILE_TEST last.

Any reason this won't work on S390, PowerPC etc?

> +if ARM || ARM64 || COMPILE_TEST
> +

You would normally express this with a depends on.

	Andrew
Jijie Shao Aug. 1, 2024, 12:15 p.m. UTC | #2
on 2024/8/1 9:13, Andrew Lunn wrote:
> On Wed, Jul 31, 2024 at 05:42:44PM +0800, Jijie Shao wrote:
>> Add a Makefile and update Kconfig to build hibmcge driver.
>>
>> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
>> ---
>>   drivers/net/ethernet/hisilicon/Kconfig          | 17 ++++++++++++++++-
>>   drivers/net/ethernet/hisilicon/Makefile         |  1 +
>>   drivers/net/ethernet/hisilicon/hibmcge/Makefile | 10 ++++++++++
>>   3 files changed, 27 insertions(+), 1 deletion(-)
>>   create mode 100644 drivers/net/ethernet/hisilicon/hibmcge/Makefile
>>
>> diff --git a/drivers/net/ethernet/hisilicon/Kconfig b/drivers/net/ethernet/hisilicon/Kconfig
>> index 3312e1d93c3b..372854d15481 100644
>> --- a/drivers/net/ethernet/hisilicon/Kconfig
>> +++ b/drivers/net/ethernet/hisilicon/Kconfig
>> @@ -7,7 +7,7 @@ config NET_VENDOR_HISILICON
>>   	bool "Hisilicon devices"
>>   	default y
>>   	depends on OF || ACPI
>> -	depends on ARM || ARM64 || COMPILE_TEST
>> +	depends on ARM || ARM64 || COMPILE_TEST || X86_64
> It is normal to have COMPILE_TEST last.

ok,

>
> Any reason this won't work on S390, PowerPC etc?

I have only compiled and tested on arm or x86.
I can't ensure that compile or work ok on other platforms.

>
>> +if ARM || ARM64 || COMPILE_TEST
>> +
> You would normally express this with a depends on.

Sorry, I can't understand how to convert if to depends on?

Thanks,

Jijie shao
Andrew Lunn Aug. 1, 2024, 12:33 p.m. UTC | #3
On Thu, Aug 01, 2024 at 08:15:43PM +0800, Jijie Shao wrote:
> 
> on 2024/8/1 9:13, Andrew Lunn wrote:
> > On Wed, Jul 31, 2024 at 05:42:44PM +0800, Jijie Shao wrote:
> > > Add a Makefile and update Kconfig to build hibmcge driver.
> > > 
> > > Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> > > ---
> > >   drivers/net/ethernet/hisilicon/Kconfig          | 17 ++++++++++++++++-
> > >   drivers/net/ethernet/hisilicon/Makefile         |  1 +
> > >   drivers/net/ethernet/hisilicon/hibmcge/Makefile | 10 ++++++++++
> > >   3 files changed, 27 insertions(+), 1 deletion(-)
> > >   create mode 100644 drivers/net/ethernet/hisilicon/hibmcge/Makefile
> > > 
> > > diff --git a/drivers/net/ethernet/hisilicon/Kconfig b/drivers/net/ethernet/hisilicon/Kconfig
> > > index 3312e1d93c3b..372854d15481 100644
> > > --- a/drivers/net/ethernet/hisilicon/Kconfig
> > > +++ b/drivers/net/ethernet/hisilicon/Kconfig
> > > @@ -7,7 +7,7 @@ config NET_VENDOR_HISILICON
> > >   	bool "Hisilicon devices"
> > >   	default y
> > >   	depends on OF || ACPI
> > > -	depends on ARM || ARM64 || COMPILE_TEST
> > > +	depends on ARM || ARM64 || COMPILE_TEST || X86_64
> > It is normal to have COMPILE_TEST last.
> 
> ok,
> 
> > 
> > Any reason this won't work on S390, PowerPC etc?
> 
> I have only compiled and tested on arm or x86.
> I can't ensure that compile or work ok on other platforms.

It is a sign of quality if it compiles on other platforms. The kernel
APIs should hide away all the differences, if you are using them
correctly. So i would take away all the platform depends at this
level. Toolchains are easy to install apt-get
c-compiler-s390x-linux-gnu etc. And 0-day will build it for you after
a while on various platforms.


> 
> > 
> > > +if ARM || ARM64 || COMPILE_TEST
> > > +
> > You would normally express this with a depends on.
> 
> Sorry, I can't understand how to convert if to depends on?

Kconfig is not my speciality, but cannot you using

	depends on ARM || ARM64 || COMPILE_TEST

inside the symbol?

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/Kconfig b/drivers/net/ethernet/hisilicon/Kconfig
index 3312e1d93c3b..372854d15481 100644
--- a/drivers/net/ethernet/hisilicon/Kconfig
+++ b/drivers/net/ethernet/hisilicon/Kconfig
@@ -7,7 +7,7 @@  config NET_VENDOR_HISILICON
 	bool "Hisilicon devices"
 	default y
 	depends on OF || ACPI
-	depends on ARM || ARM64 || COMPILE_TEST
+	depends on ARM || ARM64 || COMPILE_TEST || X86_64
 	help
 	  If you have a network (Ethernet) card belonging to this class, say Y.
 
@@ -18,6 +18,8 @@  config NET_VENDOR_HISILICON
 
 if NET_VENDOR_HISILICON
 
+if ARM || ARM64 || COMPILE_TEST
+
 config HIX5HD2_GMAC
 	tristate "Hisilicon HIX5HD2 Family Network Device Support"
 	select PHYLIB
@@ -141,4 +143,17 @@  config HNS3_ENET
 
 endif #HNS3
 
+endif # ARM || ARM64 || COMPILE_TEST
+
+config HIBMCGE
+	tristate "Hisilicon BMC Gigabit Ethernet Device Support"
+	default m
+	depends on PCI && PCI_MSI
+	help
+	  If you wish to compile a kernel for a BMC with HIBMC-xx_gmac
+	  then you should answer Y to this. This makes this driver suitable for use
+	  on certain boards such as the HIBMC-210.
+
+	  If you are unsure, say N.
+
 endif # NET_VENDOR_HISILICON
diff --git a/drivers/net/ethernet/hisilicon/Makefile b/drivers/net/ethernet/hisilicon/Makefile
index 7f76d412047a..0e2cadfea8ff 100644
--- a/drivers/net/ethernet/hisilicon/Makefile
+++ b/drivers/net/ethernet/hisilicon/Makefile
@@ -9,3 +9,4 @@  obj-$(CONFIG_HNS_MDIO) += hns_mdio.o
 obj-$(CONFIG_HNS) += hns/
 obj-$(CONFIG_HNS3) += hns3/
 obj-$(CONFIG_HISI_FEMAC) += hisi_femac.o
+obj-$(CONFIG_HIBMCGE) += hibmcge/
diff --git a/drivers/net/ethernet/hisilicon/hibmcge/Makefile b/drivers/net/ethernet/hisilicon/hibmcge/Makefile
new file mode 100644
index 000000000000..ea223b7207af
--- /dev/null
+++ b/drivers/net/ethernet/hisilicon/hibmcge/Makefile
@@ -0,0 +1,10 @@ 
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Makefile for the HISILICON BMC GE network device drivers.
+#
+
+ccflags-y += -I$(src)
+
+obj-$(CONFIG_HIBMCGE) += hibmcge.o
+
+hibmcge-objs = hbg_main.o hbg_hw.o hbg_mdio.o hbg_irq.o hbg_txrx.o hbg_ethtool.o