README 1.35 KB
Newer Older
Dennis Rassmann's avatar
Dennis Rassmann committed
1
kcontrol_gpu_tegra
Dennis Rassmann's avatar
Dennis Rassmann committed
2 3 4 5 6 7
================

How to build?
1. Edit the Makefile to point to your kernel source in which you want the module to be inserted.
2. make
3. #done
Dennis Rassmann's avatar
Dennis Rassmann committed
8 9 10 11

How to use:
Kcontrol will insert this module with the appropriate parameters on it's own if found in /system/lib/modules.
All you need for that to work is compile your kernel with CONFIG_KALLSYMS_ALL.
Dennis Rassmann's avatar
Dennis Rassmann committed
12
If you want to test this module on your own without KControl, do this:
Dennis Rassmann's avatar
Dennis Rassmann committed
13 14

echo "0" > /proc/sys/kernel/kptr_restrict
Dennis Rassmann's avatar
Dennis Rassmann committed
15 16 17 18
cat /proc/kallsyms | grep core_dvfs_table | tail -n1
XXXXXXXX d core_dvfs_table
cat /proc/kallsyms | grep " soc_speedo_id" | tail -n1
YYYYYYYY b soc_speedo_id
Dennis Rassmann's avatar
Dennis Rassmann committed
19

Dennis Rassmann's avatar
Dennis Rassmann committed
20
insmod kcontrol_gpu_tegra.ko dvfs_core_table=0xXXXXXXXX soc_speedo_id=0xYYYYYYYY
Dennis Rassmann's avatar
Dennis Rassmann committed
21 22

(If you insert the module without these parameters, the insert will fail and the module will remove itself. No changes will have been done to your kernel.)
Dennis Rassmann's avatar
Dennis Rassmann committed
23

Dennis Rassmann's avatar
Dennis Rassmann committed
24
The sysfs exposeables are in /sys/kernel/kcontrol_gpu_tegra/.
Dennis Rassmann's avatar
Dennis Rassmann committed
25 26

If you plan on extending this module with any functionality beware of changing the kernel memory.
Dennis Rassmann's avatar
Dennis Rassmann committed
27 28 29
As that may result in unexpected behavior, like world war III, a black hole, or some other shit.
This module only reads stuff and if it should write something in the future then I am 99.99999% sure that it is safe.
You should be too if your extension plans to modify a running kernel.
Dennis Rassmann's avatar
Dennis Rassmann committed
30
Otherwise: Don't touch things of which you have no clue.