diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-10-06 10:42:46 +0200 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-10-06 10:48:26 +0200 |
commit | d2a491727b47a6b1b322707844b90ed27f2f6b6b (patch) | |
tree | 7a86aa0263ea54ae1662673a0ad366e8c7d16ee9 | |
parent | f11a05c5af61e2e4bbc049e207abd3d00b045770 (diff) | |
download | memtool-d2a491727b47a6b1b322707844b90ed27f2f6b6b.tar.gz memtool-d2a491727b47a6b1b322707844b90ed27f2f6b6b.tar.xz |
README.md: Add a short overview about what memtool actually is
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r-- | README.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..331f52c --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +memtool +======= + +memtool is a program that allows to access memory mapped registers. This is +useful to inspect and modify registers from the command line. + +By default memtool uses `/dev/mem` to operate. So to actually work you need to +have `DEVMEM` enabled in the kernel. Note that depending on further kernel +configuration you can only access unused io-memory, see the kernel +configuration knobs `IO_STRICT_DEVMEM` and `STRICT_DEVMEM`. Also note that +there might be further restrictions. E.g. on several i.MX ARM SoCs register +access is not possible from user mode for certain areas unless configured +otherwise. + +memtool can also operate on plain files, and access PHY registers (via the +`ioctl`s `SIOCSMIIREG` and `SIOCGMIIREG`). + +Examples +--------- + + * Write a 32-bit wide 0 to register at address 0x73f00040 + + ```sh + # memtool mw -l 0x73f00040 0 + ``` + + * Read the first two registers of the default PHY attached to network device + `eth0`: + + ```sh + # memtool md -s mdio:eth0. -w 0+4 + ``` + + * Place a (usually red) dot on the framebuffer: + + ```sh + # memtool mw -d /dev/fb0 -w 0 0xfc00 + ``` + |