Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] package: Add iotools package
@ 2024-09-27 18:34 Andy Shevchenko
  2024-09-28  9:10 ` Andy Yan
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Andy Shevchenko @ 2024-09-27 18:34 UTC (permalink / raw)
  To: buildroot; +Cc: Andy Shevchenko, Andy Yan, Andy Yan

The iotools package provides a set of simple command line tools which
allow access to hardware device registers. Supported register interfaces
include PCI, IO, memory mapped IO, SMBus, CPUID, and MSR. Also included
are some utilities which allow for simple arithmetic, logical, and other
operations.

If you ever have to debug hardware, you could probably use these tools.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

v2: removed explicit strip (Baruch), added to DEVELOPERS

 DEVELOPERS                   |  1 +
 package/Config.in            |  1 +
 package/iotools/Config.in    | 14 ++++++++++++++
 package/iotools/iotools.hash |  3 +++
 package/iotools/iotools.mk   | 20 ++++++++++++++++++++
 5 files changed, 39 insertions(+)
 create mode 100644 package/iotools/Config.in
 create mode 100644 package/iotools/iotools.hash
 create mode 100644 package/iotools/iotools.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index c3b1d66b016b..158313be9335 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -230,6 +230,7 @@ F:	package/sysdig/
 
 N:	Andy Shevchenko <andy.shevchenko@gmail.com>
 F:	package/fb-test-app/
+F:	package/iotools/
 
 N:	Anisse Astier <anisse@astier.eu>
 F:	package/go/
diff --git a/package/Config.in b/package/Config.in
index bfbec1c21d04..08977a3a92db 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -533,6 +533,7 @@ endmenu
 	source "package/i7z/Config.in"
 	source "package/input-event-daemon/Config.in"
 	source "package/intel-microcode/Config.in"
+	source "package/iotools/Config.in"
 	source "package/ipmitool/Config.in"
 	source "package/ipmiutil/Config.in"
 	source "package/irda-utils/Config.in"
diff --git a/package/iotools/Config.in b/package/iotools/Config.in
new file mode 100644
index 000000000000..ffa1a3666738
--- /dev/null
+++ b/package/iotools/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_IOTOOLS
+	bool "iotools"
+	help
+	  Tools for poking all types of IO, supported are:
+	  - CMOS NVRAM (via /dev/nvram)
+	  - CPU ID (x86)
+	  - IO port (x86, PowerPC)
+	  - MMIO
+	  - MSR (x86)
+	  - PCI configuration space
+	  - SCOM (PowerPC)
+	  - SMBus
+
+	  https://github.com/andy-shev/iotools
diff --git a/package/iotools/iotools.hash b/package/iotools/iotools.hash
new file mode 100644
index 000000000000..11d7ffb73e39
--- /dev/null
+++ b/package/iotools/iotools.hash
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  13b8b87c7d1f22b8d8f50c499af09f9414a0879d69c22393f1051ed4bf28f378  iotools-v1.7.tar.gz
+sha256  ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  COPYING
diff --git a/package/iotools/iotools.mk b/package/iotools/iotools.mk
new file mode 100644
index 000000000000..03b87c89e9d0
--- /dev/null
+++ b/package/iotools/iotools.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# iotools
+#
+################################################################################
+
+IOTOOLS_VERSION = v1.7
+IOTOOLS_SITE = $(call github,andy-shev,iotools,$(IOTOOLS_VERSION))
+IOTOOLS_LICENSE = GPL-2.0+
+IOTOOLS_LICENSE_FILES = COPYING
+
+define IOTOOLS_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CROSS_COMPILE=$(TARGET_CROSS) all
+endef
+
+define IOTOOLS_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -t $(TARGET_DIR)/usr/bin -D $(@D)/iotools
+endef
+
+$(eval $(generic-package))
-- 
2.43.0.rc1.1336.g36b5255a03ac

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 18+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] package: Add iotools package
@ 2024-10-14 17:55 Vincent Fazio
  2024-10-16 13:52 ` Andy Shevchenko
  0 siblings, 1 reply; 18+ messages in thread
From: Vincent Fazio @ 2024-10-14 17:55 UTC (permalink / raw)
  To: Aaron Sierra, Andy Shevchenko; +Cc: buildroot, Andy Yan, Andy Yan

Aaron, Andy,

> -----Original Message-----
> From: buildroot <buildroot-bounces@buildroot.org> On Behalf Of Aaron
> Sierra
> Sent: Monday, October 14, 2024 12:01 PM
> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Andy Yan <andyshrk@gmail.com>; Andy Yan <andyshrk@163.com>;
> buildroot <buildroot@buildroot.org>
> Subject: [External] - Re: [Buildroot] [PATCH v2 1/1] package: Add iotools
> package
> 
> ---- On Mon, 14 Oct 2024 10:38:22 -0500 Andy Shevchenko  wrote ---  >  >
> Can this be pulled eventually? Or is there any comment I have to address?
>  >
>  > --
>  > With Best Regards,
>  > Andy Shevchenko
>  >
> 2. It would be nice if the package populated command symlinks in the target
> filesystem. That could be done in a number of way, like using an explicit list of
> commands maintained in the package Makefile (iotools.mk) or adding a host-
> build dependency and leveraging the --list-cmds output to get the list of
> embedded commands for linking.
> 
	
Caveat lector, I have not reviewed your patch or the sources in a while.

WRT to this comment, I have this note from when we ported it:

# we can't run make install because the symlink installation executes the binary
# which isn't guaranteed to work in cross-compile scenarios
define IOTOOLS_INSTALL_TARGET_CMDS
    $(INSTALL) -D -m 0755 $(@D)/iotools $(TARGET_DIR)/usr/sbin/

    for link in $( IOTOOLS_LINKS); do \
        ln -sf iotools $(TARGET_DIR)/usr/sbin/$$link; \
    done
endef


We then earlier in the mk file define the tools per platform, akin to:

# I/O utilities
IOTOOLS_LINKS = \
    cmos_read \
    cmos_write \
    mem_dump \
    mem_load \
    mem_read8 \
    mem_read16 \
    mem_read32 \
    mem_read64 \
    mem_write8 \
    mem_write16 \
    mem_write32 \
    mem_write64 \
    mmio_dump \
    mmio_load \
    mmio_read8 \
    mmio_read16 \
    mmio_read32 \
    mmio_read64 \
    mmio_write8 \
    mmio_write16 \
    mmio_write32 \
    mmio_write64 \
    io_read8 \
    io_read16 \
    io_read32 \
    io_write8 \
    io_write16 \
    io_write32 \
    pci_list \
    pci_read8 \
    pci_read16 \
    pci_read32 \
    pci_write8 \
    pci_write16 \
    pci_write32 \
    smbus_quick \
    smbus_read8 \
    smbus_read16 \
    smbus_readblock \
    smbus_receive_byte \
    smbus_send_byte \
    smbus_write8 \
    smbus_write16 \
    smbus_writeblock

# Bitwise utilities
IOTOOLS_LINKS += \
    and \
    brt \
    bts \
    not \
    or \
    shl \
    shr \
    xor

# Other utilities
IOTOOLS_LINKS += \
    busy_loop \
    cpu_list \
    runon

# Achitecture-specific utilities
ifeq ($(BR2_i386)$(BR2_x86_64),y)
IOTOOLS_LINKS += \
    cpuid \
    rdmsr \
    rdtsc \
    wrmsr
else ifeq ($(BR2_powerpc)$(BR2_powerpc64)$(BR2_powerpcle),y)
IOTOOLS_LINKS += \
    cputochipid \
    cputoex \
    getscom \
    putscom
endif

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-10-31 17:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 18:34 [Buildroot] [PATCH v2 1/1] package: Add iotools package Andy Shevchenko
2024-09-28  9:10 ` Andy Yan
2024-09-30 17:36   ` Andy Shevchenko
2024-10-14 15:38 ` Andy Shevchenko
2024-10-14 17:00   ` Aaron Sierra
2024-10-16 13:54     ` Andy Shevchenko
2024-10-26 12:47 ` Thomas Petazzoni via buildroot
2024-10-28  7:57   ` Andy Shevchenko
2024-10-28  8:26     ` Thomas Petazzoni via buildroot
2024-10-31 17:25       ` Andy Shevchenko
2024-10-31 17:33         ` Thomas Petazzoni via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2024-10-14 17:55 Vincent Fazio
2024-10-16 13:52 ` Andy Shevchenko
     [not found]   ` <1929b27b55e.1242e8abc627480.7414881916261699452@bubbl-tek.com>
2024-10-18 11:52     ` Andy Shevchenko
2024-10-18 11:54       ` Andy Shevchenko
2024-10-21 15:59       ` Aaron Sierra
2024-10-24 20:30         ` Aaron Sierra
2024-10-31 17:25           ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox