diff mbox series

[OpenWrt-Devel] phytool: add phytool utility

Message ID 20190616115605.6992-1-chunkeey@gmail.com
State Rejected, archived
Delegated to: Christian Lamparter
Headers show
Series [OpenWrt-Devel] phytool: add phytool utility | expand

Commit Message

Christian Lamparter June 16, 2019, 11:56 a.m. UTC
From the README.md:

phytool is a Linux MDIO register access utility.

Usage:

phytool read  IFACE/ADDR/REG
phytool write IFACE/ADDR/REG <0-0xffff>
phytool print IFACE/ADDR[/REG]

where

ADDR := C22 | C45
C22  := <0-0x1f>
C45  := <0-0x1f>:<0-0x1f>
REG  := <0-0x1f>

Note: Not all MDIO drivers support the port:device
      Clause 45 address format.

The read and write commands are simple register level accessors.
The print command will pretty-print a register. When using the
print command, the register is optional. If left out, the most
common registers will be shown.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
 package/network/utils/phytool/Makefile | 46 ++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 package/network/utils/phytool/Makefile

Comments

Alexander 'lynxis' Couzens June 16, 2019, 4:42 p.m. UTC | #1
Hi Christan,

> phytool is a Linux MDIO register access utility.

thank you. I've looked from time to time for such utility when
debugging network drivers & phys.

Acked-By: Alexander Couzens <lynxis@fe80.eu>

Best,
lynxis
Piotr Dymacz June 16, 2019, 5:08 p.m. UTC | #2
Hi Christian,

On 16.06.2019 13:56, Christian Lamparter wrote:
>  From the README.md:
> 
> phytool is a Linux MDIO register access utility.

Is there any reason to keep it inside the main code base rather than in 
packages feed?
Christian Lamparter June 16, 2019, 6:50 p.m. UTC | #3
Hello Piotr,


On Sun, Jun 16, 2019 at 7:08 PM Piotr Dymacz <pepe2k@gmail.com> wrote:
>
> Hi Christian,
>
> On 16.06.2019 13:56, Christian Lamparter wrote:
> >  From the README.md:
> >
> > phytool is a Linux MDIO register access utility.
>
> Is there any reason to keep it inside the main code base rather than in
> packages feed?
K, I rejected it on patchwork.
Piotr Dymacz June 16, 2019, 7:44 p.m. UTC | #4
Hi Christian,

On 16.06.2019 20:50, Christian Lamparter wrote:
> Hello Piotr,
> 
> 
> On Sun, Jun 16, 2019 at 7:08 PM Piotr Dymacz <pepe2k@gmail.com> wrote:
>>
>> Hi Christian,
>>
>> On 16.06.2019 13:56, Christian Lamparter wrote:
>> >  From the README.md:
>> >
>> > phytool is a Linux MDIO register access utility.
>>
>> Is there any reason to keep it inside the main code base rather than in
>> packages feed?
> K, I rejected it on patchwork.
> 

Just a side note here. During the meetup in Hamburg we discussed about 
having only the required and actually "basic" packages inside the master 
tree and move everything else to packages feed (after reviewing what's 
there). I believe this will be also included in the official summary 
from the meetup and discussed further afterwards.
diff mbox series

Patch

diff --git a/package/network/utils/phytool/Makefile b/package/network/utils/phytool/Makefile
new file mode 100644
index 0000000000..b971c1ad13
--- /dev/null
+++ b/package/network/utils/phytool/Makefile
@@ -0,0 +1,46 @@ 
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=phytool
+PKG_VERSION:=2
+PKG_RELEASE:=1
+
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/wkz/phytool/releases/download/v$(PKG_VERSION)
+PKG_HASH:=9901a14e8c6af02b7333c60b21ff81f50620e8326d54827185e5617ff9b11d21
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_MAINTAINER:=Christian Lamparter <chunkeey@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/phytool
+  SECTION:=net
+  CATEGORY:=Utilities
+  TITLE:=phytool Linux MDIO register access
+  URL:=https://github.com/wkz/phytool.git
+endef
+
+define Package/phytool/description
+   Linux MDIO register access
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+	$(MAKE) -C $(PKG_BUILD_DIR) \
+		CC="$(TARGET_CC)" \
+		CFLAGS="$(TARGET_CFLAGS) -Wall" \
+		LDFLAGS="$(TARGET_LDFLAGS)"
+endef
+
+define Package/phytool/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/phytool $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,phytool))