Skip to contentSkip to conversation

package/mdio-tools: new package

PATCH Superseded Robert Marko 2 participants 3 messages Sep 28, 2022 – Oct 1, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mdio-tools: new package

mdio-tools are kernel module and accompanying tools for low-level debugging of devices attached on MDIO bus like PHY-s, switches etc.

Userspace tools provide C22 or C45 reads and writes, benchmarking and even dedicated Marvell Link Street tools via the included kernel module.

---
 package/Config.in                  |  1 +
 package/mdio-tools/Config.in       |  9 +++++++++
 package/mdio-tools/mdio-tools.hash |  3 +++
 package/mdio-tools/mdio-tools.mk   | 16 ++++++++++++++++
 4 files changed, 29 insertions(+)
 create mode 100644 package/mdio-tools/Config.in
 create mode 100644 package/mdio-tools/mdio-tools.hash
 create mode 100644 package/mdio-tools/mdio-tools.mk
package/Config.in +1 -0
index e3a34d6e97..ed41e8bdd4 100644
@@ -536,6 +536,7 @@ endmenu
 	source "package/mbpfan/Config.in"
 	source "package/mdadm/Config.in"
 	source "package/mdevd/Config.in"
+	source "package/mdio-tools/Config.in"
 	source "package/memtest86/Config.in"
 	source "package/memtester/Config.in"
 	source "package/memtool/Config.in"
package/mdio-tools/Config.in new file +9 -0
new file mode 100644
index 0000000000..feb1e825ac
@@ -0,0 +1,9 @@
+comment "mdio-tools needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_MDIO_TOOLS
+	bool "mdio-tools"
+	depends on BR2_LINUX_KERNEL
+	select BR2_PACKAGE_LIBMNL
+	help
+	  Low-level debug tools for MDIO devices
package/mdio-tools/mdio-tools.hash new file +3 -0
new file mode 100644
index 0000000000..0111165f27
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  c5e17431c62392f6c1da1ba4fb0a6f5918521509a377af74485851f93ff2a106  mdio-tools-1.2.0.tar.gz
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
package/mdio-tools/mdio-tools.mk new file +16 -0
new file mode 100644
index 0000000000..e4ea6f8224
@@ -0,0 +1,16 @@
+################################################################################
+#
+# mdio-tools
+#
+################################################################################
+
+MDIO_TOOLS_VERSION = 1.2.0
+MDIO_TOOLS_SITE = https://github.com/wkz/mdio-tools/releases/download/$(MDIO_TOOLS_VERSION)
+MDIO_TOOLS_LICENSE = GPL-2.0-only
+MDIO_TOOLS_LICENSE_FILES = COPYING
+MDIO_TOOLS_DEPENDENCIES = libmnl
+
+MDIO_TOOLS_MODULE_SUBDIRS = kernel
+
+$(eval $(kernel-module))
+$(eval $(autotools-package))
Signature · 6 lines
2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Robert, All,

On 2022-09-28 21:23 +0200, Robert Marko spake thusly:

Quoted 9 lines

mdio-tools are kernel module and accompanying tools for low-level debugging of devices attached on MDIO bus like PHY-s, switches etc.

Userspace tools provide C22 or C45 reads and writes, benchmarking and even dedicated Marvell Link Street tools via the included kernel module.

---

[--SNIP--]

Quoted 6 lines
package/mdio-tools/mdio-tools.mk new file +0 -0
new file mode 100644
index 0000000000..e4ea6f8224

package/mdio-tools/mdio-tools.mk line 9

Quoted 9 lines
package/mdio-tools/mdio-tools.mk new file +9 -0
@@ -0,0 +1,16 @@
+################################################################################
+#
+# mdio-tools
+#
+################################################################################
+
+MDIO_TOOLS_VERSION = 1.2.0
+MDIO_TOOLS_SITE = https://github.com/wkz/mdio-tools/releases/download/$(MDIO_TOOLS_VERSION)
+MDIO_TOOLS_LICENSE = GPL-2.0-only

We do not strictly follow the SPDX nomenclature (because we somewhat predate it), so for consistency, this should be just 'GPL-2.0'.

package/mdio-tools/mdio-tools.mk line 11

Quoted 2 lines
package/mdio-tools/mdio-tools.mk new file +2 -0
+MDIO_TOOLS_LICENSE_FILES = COPYING
+MDIO_TOOLS_DEPENDENCIES = libmnl

mdio-tools uses pkg-config to look for libmnl, so you also need to add host-pkgconf to the _DEPENDENCES.

package/mdio-tools/mdio-tools.mk line 13

Quoted 1 line
package/mdio-tools/mdio-tools.mk new file +1 -0
+MDIO_TOOLS_MODULE_SUBDIRS = kernel

I did not have a thorough look, but doesn't mdio-tools need some kernel options to always be enabled? IF so, you can do so with:

    define MDIO_TOOLS_LINUX_CONFIG_FIXUPS
        $(call KCONFIG_ENABLE_OPT,CONFIG_MDIO)
    endef

(given the package name, it should at least require that, I'd guess, but adapt as needed.)

If there had been only the license and host-pkgconf issues, I'd have fixed those when applying. But the kernel options are a bit more involved, and requie someone who actually knows and uses mdio-tools, to come up with the required options. Can you look into that, please?

Regards,
Yann E. MORIN.

Quoted 9 lines
package/mdio-tools/mdio-tools.mk new file +2 -0
+$(eval $(kernel-module))
+$(eval $(autotools-package))
Signature · 6 lines
2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 24 lines · Yann E. MORIN

Robert, All,

On 2022-09-28 21:23 +0200, Robert Marko spake thusly:

Quoted 9 lines

mdio-tools are kernel module and accompanying tools for low-level debugging of devices attached on MDIO bus like PHY-s, switches etc.

Userspace tools provide C22 or C45 reads and writes, benchmarking and even dedicated Marvell Link Street tools via the included kernel module.

---

[--SNIP--]

Quoted 10 lines
package/mdio-tools/mdio-tools.mk new file +4 -0
new file mode 100644
index 0000000000..e4ea6f8224
@@ -0,0 +1,16 @@
+################################################################################
+#
+# mdio-tools
+#
Quoted 8 lines

package/mdio-tools/mdio-tools.mk line 9

Quoted 5 lines
package/mdio-tools/mdio-tools.mk new file +5 -0
+################################################################################
+
+MDIO_TOOLS_VERSION = 1.2.0
+MDIO_TOOLS_SITE = https://github.com/wkz/mdio-tools/releases/download/$(MDIO_TOOLS_VERSION)
+MDIO_TOOLS_LICENSE = GPL-2.0-only

We do not strictly follow the SPDX nomenclature (because we somewhat predate it), so for consistency, this should be just 'GPL-2.0'.

Hi,
I will change it, wasn't really sure what was appropriate so I went with SPDX.

Quoted 6 lines

package/mdio-tools/mdio-tools.mk line 11

Quoted 3 lines
package/mdio-tools/mdio-tools.mk new file +2 -0
+MDIO_TOOLS_LICENSE_FILES = COPYING
+MDIO_TOOLS_DEPENDENCIES = libmnl

mdio-tools uses pkg-config to look for libmnl, so you also need to add host-pkgconf to the _DEPENDENCES.

Will fixup in v2.

Quoted 6 lines

package/mdio-tools/mdio-tools.mk line 13

Quoted 2 lines
package/mdio-tools/mdio-tools.mk new file +1 -0
+MDIO_TOOLS_MODULE_SUBDIRS = kernel

I did not have a thorough look, but doesn't mdio-tools need some kernel options to always be enabled? IF so, you can do so with:

Quoted 6 lines
    define MDIO_TOOLS_LINUX_CONFIG_FIXUPS
        $(call KCONFIG_ENABLE_OPT,CONFIG_MDIO)
    endef

(given the package name, it should at least require that, I'd guess, but adapt as needed.)

Thanks for reminding me of this, haven't really though of that, but as far as I can tell it basically needs generic netlink which gets compiled if CONFIG_NET is set, that is minimum.

CONFIG_MDIO_DEVICE is then required so that mdio buses actually can be used.

Quoted 5 lines

If there had been only the license and host-pkgconf issues, I'd have fixed those when applying. But the kernel options are a bit more involved, and requie someone who actually knows and uses mdio-tools, to come up with the required options. Can you look into that, please?

Will fix this up v2, thanks for the review.
Regards,
Robert

Quoted 14 lines

Regards,
Yann E. MORIN.

Quoted 9 lines
package/mdio-tools/mdio-tools.mk new file +2 -1
+$(eval $(kernel-module))
+$(eval $(autotools-package))
--

2.37.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Quoted 7 lines

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot