aboutsummaryrefslogtreecommitdiff
path: root/kernel/dtm/README.md
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-09-12 22:37:29 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-12-05 16:02:50 +0100
commit5876d0ade10d53abe4e9c6666c5117ca73a211f6 (patch)
tree533837fc527858e7540c5e064a3acec91f0e27b5 /kernel/dtm/README.md
parent432436797bedf396ad698477a19f9d2e13147621 (diff)
downloadfarga-5876d0ade10d53abe4e9c6666c5117ca73a211f6.tar.gz
farga-5876d0ade10d53abe4e9c6666c5117ca73a211f6.zip
kernel/dtm: Add an example on the kernel DT API
This comes in the form of a simple kernel module which iterates over CPUs and prints the contents of some device tree nodes. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'kernel/dtm/README.md')
-rw-r--r--kernel/dtm/README.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/kernel/dtm/README.md b/kernel/dtm/README.md
new file mode 100644
index 0000000..593c1d2
--- /dev/null
+++ b/kernel/dtm/README.md
@@ -0,0 +1,29 @@
+# Device Tree Module
+
+This is a simple kernel module which show cases some of the kernel API functions
+for manipulating device tree nodes.
+
+In order to build this module you need either a local build of the Linux kernel,
+or the the source that you can get from your Linux distribution (e.g.
+`kernel-source` on openSUSE). For the former you will need to specify the path
+to your local development tree with the `KERNEL` variable. So:
+
+```
+$ make KERNEL=<path/to/development/tree>
+```
+
+This will produce a `dtm.ko` file, which you will need to `insmod` on your
+target machine. Then you will get this output from `dmesg`:
+
+```
+[ 571.298548] [ T813] dtm: loading out-of-tree module taints kernel.
+[ 571.305842] [ T813] Inside of VisionFive2
+[ 571.309945] [ T813] RISC-V ISA for 'cpu@1': rv64imafdc_zba_zbb
+[ 571.315826] [ T813] parent: cpus
+[ 571.319091] [ T813] RISC-V ISA for 'cpu@2': rv64imafdc_zba_zbb
+[ 571.324962] [ T813] parent: cpus
+[ 571.328224] [ T813] RISC-V ISA for 'cpu@3': rv64imafdc_zba_zbb
+[ 571.334092] [ T813] parent: cpus
+[ 571.337354] [ T813] RISC-V ISA for 'cpu@4': rv64imafdc_zba_zbb
+[ 571.343228] [ T813] parent: cpus
+```