DTC tools, correct SYSCON LEDs

This commit is contained in:
Ciro Santilli
2017-07-03 08:58:14 +01:00
parent c5e32b60bf
commit e06bf63e08
4 changed files with 26 additions and 13 deletions

View File

@@ -39,3 +39,8 @@ BR2_PACKAGE_TRACE_CMD=y
# GPIO: lsgpio, gpio-event-mon, gpio-hammer
BR2_PACKAGE_LINUX_TOOLS=y
BR2_PACKAGE_LINUX_TOOLS_GPIO=y
# DTC
BR2_PACKAGE_DTC=y
BR2_PACKAGE_DTC_PROGRAMS=y
BR2_PACKAGE_HOST_DTC=y

View File

@@ -58,17 +58,11 @@ CONFIG_TRACER_SNAPSHOT=y
# cat /sys/kernel/debug/kernel_page_tables
CONFIG_X86_PTDUMP=y
# LEDs.
# LEDs. ARM only.
#
# modprobe led-class
# modprobe leds-versatile
# ls /sys/class/leds
#
# 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.
# cd /sys/class/leds/versatile:0
# cat max_brightness
# echo 255 >brightness
#
# 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
# - 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_FLASH=y
CONFIG_LEDS_SYSCON=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_LEDS_TRIGGER_CPU=y
@@ -93,7 +101,6 @@ CONFIG_LEDS_TRIGGER_GPIO=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_ONESHOT=y
CONFIG_LEDS_TRIGGER_TIMER=y
CONFIG_LEDS_VERSATILE=y
CONFIG_NEW_LEDS=y
# GPIO.

View File

@@ -1,4 +1,5 @@
#!/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
set -e
cd /sys/class/gpio

2
run
View File

@@ -41,8 +41,8 @@ env \
O="$outdir" \
BR2_JLEVEL="$(($(nproc) - 2))" \
HOST_QEMU_OPTS="--enable-debug --enable-sdl --extra-cflags='-DDEBUG_PL061=1' --with-sdlabi=2.0" \
host-qemu-reconfigure \
host-qemu-rebuild \
linux-rebuild \
kernel_module-rebuild \
all \
;