forked from stroyan/led-drv-f4-220
-
Notifications
You must be signed in to change notification settings - Fork 0
/
led_analysis
71 lines (62 loc) · 2.36 KB
/
led_analysis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
These ioremap_nocache calls look OK.
gpbcon[0] = ioremap_nocache(0xfed0d1b8, 16);
gpbcon[1] = ioremap_nocache(0xfed0d028, 16);
gpbcon[2] = ioremap_nocache(0xfed0d0b8, 16);
gpbcon[3] = ioremap_nocache(0xfed0d0d8, 16);
gpbcon[4] = ioremap_nocache(0xfed0d088, 16);
gpbcon[5] = ioremap_nocache(0xfed0d0a8, 16);
gpbcon[6] = ioremap_nocache(0xfed0d048, 16);
gpbcon[7] = ioremap_nocache(0xfed0d068, 16);
gpbcon[8] = ioremap_nocache(0xfed0d018, 16);
gpbcon[9] = ioremap_nocache(0xfed0d038, 16);
gpbcon[10] = ioremap_nocache(0xfed0d058, 16);
gpbcon[11] = ioremap_nocache(0xfed0d098, 16);
Turning a light on looks like this-
u64 reg;
reg = readq(addr);
reg &= 0x11111101;
writeq(reg, addr);
reg = readq(addr);
reg |= 0x1;
writeq(reg, addr);
reg = readq(addr);
reg |= 0x10;
writeq(reg, addr);
Turning a light off looks like this-
u64 reg;
reg = readq(addr);
reg &= 0x11111101;
writeq(reg, addr);
reg = readq(addr);
reg &= ~0x1ul;
writeq(reg, addr);
reg = readq(addr);
reg |= 0x10;
writeq(reg, addr);
But in practice on and off is not so clear.
Lights 1, 3, 5, 7 turn green leds "off" for "on" for "HD1", "HD2", "HD3" and "HD4".
Lights 2, 4, 6, 8 turn red leds "off" for "off" for "HD1", "HD2", "HD3" and "HD4".
Lights 9 and 10 change nothing.
Light 11 turns a green led "off" for "on" for "LAN1".
mike@b2:~$ sudo modprobe leds-f4-220
mike@b2:~$ sudo bash -c 'echo -n led1off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led1off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led1on > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led3off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led3off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led3on > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led3off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led3off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led1off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led2off > /dev/leds'
mike@b2:~$ sudo bash -c 'echo -n led2on > /dev/leds'
There is a lot of information on RAID status available from /proc/mdstat,
mdadm, and /sys/*.
A mdadm command can monitor for RAID status changes and run a command.
But mdadm and /proc/mdstat don't seem to give good details about which disks
or partitions have a problem.
The /sys files can give more useful and detailed information about status.
The /sys files are documented in "man md" and
"Documentation/md/admin-guide/md.rst .
$ more /sys/block/md*/md/rd*/state
$ ll /sys/block/md*/md/rd*