mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 21:14:27 +01:00
DTC tools, correct SYSCON LEDs
This commit is contained in:
@@ -39,3 +39,8 @@ BR2_PACKAGE_TRACE_CMD=y
|
|||||||
# GPIO: lsgpio, gpio-event-mon, gpio-hammer
|
# GPIO: lsgpio, gpio-event-mon, gpio-hammer
|
||||||
BR2_PACKAGE_LINUX_TOOLS=y
|
BR2_PACKAGE_LINUX_TOOLS=y
|
||||||
BR2_PACKAGE_LINUX_TOOLS_GPIO=y
|
BR2_PACKAGE_LINUX_TOOLS_GPIO=y
|
||||||
|
|
||||||
|
# DTC
|
||||||
|
BR2_PACKAGE_DTC=y
|
||||||
|
BR2_PACKAGE_DTC_PROGRAMS=y
|
||||||
|
BR2_PACKAGE_HOST_DTC=y
|
||||||
|
|||||||
@@ -58,17 +58,11 @@ CONFIG_TRACER_SNAPSHOT=y
|
|||||||
# cat /sys/kernel/debug/kernel_page_tables
|
# cat /sys/kernel/debug/kernel_page_tables
|
||||||
CONFIG_X86_PTDUMP=y
|
CONFIG_X86_PTDUMP=y
|
||||||
|
|
||||||
# LEDs.
|
# LEDs. ARM only.
|
||||||
#
|
#
|
||||||
# modprobe led-class
|
# cd /sys/class/leds/versatile:0
|
||||||
# modprobe leds-versatile
|
# cat max_brightness
|
||||||
# ls /sys/class/leds
|
# echo 255 >brightness
|
||||||
#
|
|
||||||
# TODO: the LEDs don't appear there. There are some entires under:
|
|
||||||
#
|
|
||||||
# /sys/devices/platform/10000000.core-module/10000000.core-module:led@08.0/
|
|
||||||
#
|
|
||||||
# but they don't have brightness file.
|
|
||||||
#
|
#
|
||||||
# https://raspberrypi.stackexchange.com/questions/697/how-do-i-control-the-system-leds-using-my-software
|
# https://raspberrypi.stackexchange.com/questions/697/how-do-i-control-the-system-leds-using-my-software
|
||||||
#
|
#
|
||||||
@@ -81,10 +75,24 @@ CONFIG_X86_PTDUMP=y
|
|||||||
#
|
#
|
||||||
# - arch/arm/boot/dts/versatile-pb.dts
|
# - arch/arm/boot/dts/versatile-pb.dts
|
||||||
# - drivers/leds/led-class.c
|
# - drivers/leds/led-class.c
|
||||||
# - drivers/leds/leds-versatile.c
|
# - drivers/leds/leds-sysctl.c
|
||||||
#
|
#
|
||||||
|
# Try hacking QEMU's `hw/misc/arm_sysctl.c` with a printf:
|
||||||
|
#
|
||||||
|
# static void arm_sysctl_write(void *opaque, hwaddr offset,
|
||||||
|
# uint64_t val, unsigned size)
|
||||||
|
# {
|
||||||
|
# arm_sysctl_state *s = (arm_sysctl_state *)opaque;
|
||||||
|
#
|
||||||
|
# switch (offset) {
|
||||||
|
# case 0x08: /* LED */
|
||||||
|
# printf("LED val = %llx\n", (unsigned long long)val);
|
||||||
|
#
|
||||||
|
# to obeserve when the callback is made. But beware that one of the LEDs
|
||||||
|
# has a heartbeat trigger by default (specified on dts), so it will produce a lot of output.
|
||||||
CONFIG_LEDS_CLASS=y
|
CONFIG_LEDS_CLASS=y
|
||||||
CONFIG_LEDS_CLASS_FLASH=y
|
CONFIG_LEDS_CLASS_FLASH=y
|
||||||
|
CONFIG_LEDS_SYSCON=y
|
||||||
CONFIG_LEDS_TRIGGERS=y
|
CONFIG_LEDS_TRIGGERS=y
|
||||||
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
|
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
|
||||||
CONFIG_LEDS_TRIGGER_CPU=y
|
CONFIG_LEDS_TRIGGER_CPU=y
|
||||||
@@ -93,7 +101,6 @@ CONFIG_LEDS_TRIGGER_GPIO=y
|
|||||||
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
|
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
|
||||||
CONFIG_LEDS_TRIGGER_ONESHOT=y
|
CONFIG_LEDS_TRIGGER_ONESHOT=y
|
||||||
CONFIG_LEDS_TRIGGER_TIMER=y
|
CONFIG_LEDS_TRIGGER_TIMER=y
|
||||||
CONFIG_LEDS_VERSATILE=y
|
|
||||||
CONFIG_NEW_LEDS=y
|
CONFIG_NEW_LEDS=y
|
||||||
|
|
||||||
# GPIO.
|
# GPIO.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# ARM only.
|
||||||
# https://raspberrypi.stackexchange.com/questions/56373/is-it-possible-to-get-the-state-of-the-leds-and-gpios-in-a-qemu-emulation-like-t/69267#69267
|
# https://raspberrypi.stackexchange.com/questions/56373/is-it-possible-to-get-the-state-of-the-leds-and-gpios-in-a-qemu-emulation-like-t/69267#69267
|
||||||
set -e
|
set -e
|
||||||
cd /sys/class/gpio
|
cd /sys/class/gpio
|
||||||
|
|||||||
2
run
2
run
@@ -41,8 +41,8 @@ env \
|
|||||||
O="$outdir" \
|
O="$outdir" \
|
||||||
BR2_JLEVEL="$(($(nproc) - 2))" \
|
BR2_JLEVEL="$(($(nproc) - 2))" \
|
||||||
HOST_QEMU_OPTS="--enable-debug --enable-sdl --extra-cflags='-DDEBUG_PL061=1' --with-sdlabi=2.0" \
|
HOST_QEMU_OPTS="--enable-debug --enable-sdl --extra-cflags='-DDEBUG_PL061=1' --with-sdlabi=2.0" \
|
||||||
host-qemu-reconfigure \
|
|
||||||
host-qemu-rebuild \
|
host-qemu-rebuild \
|
||||||
|
linux-rebuild \
|
||||||
kernel_module-rebuild \
|
kernel_module-rebuild \
|
||||||
all \
|
all \
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user