Skip to content
Newer
Older
100644 103 lines (64 sloc) 2.93 KB
de4e220 @scottellis Using a marked up README
authored
1 overo-irqlat
2 =============
3
4 Overview
5 -------
6
9f2de5f @scottellis Updated comments
authored
7 A linux module to measure gpio irq latency and the time it takes to toggle a
de4e220 @scottellis Using a marked up README
authored
8 gpio pin in an OMAP3 kernel.
d92e87b Initial commit
scott authored
9
9f2de5f @scottellis Updated comments
authored
10 The test requires an oscope to do the actual measurements and two gpio pins
4f7400c @scottellis More comment fixes
authored
11 jumpered together. The pins are assumed to be already mux'd as GPIO and not
9f2de5f @scottellis Updated comments
authored
12 otherwise being used.
d06b42e @scottellis Updated for toggle test
authored
13
b9b5719 @scottellis Rename TEST_PIN to TOGGLE_PIN
authored
14 In the code the pins are labeled TOGGLE_PIN and IRQ_PIN. They are interchangeable.
d06b42e @scottellis Updated for toggle test
authored
15
9f2de5f @scottellis Updated comments
authored
16 The example in the code is using a Gumstix Overo and two convenient pins on the
4f7400c @scottellis More comment fixes
authored
17 expansion board headers. Substitute different pins as needed. The definitions
18 are at the top of the source file.
9f2de5f @scottellis Updated comments
authored
19
f9cf5b3 @scottellis Formatting of README
authored
20 IRQ_PIN - GPIO_146
b9b5719 @scottellis Rename TEST_PIN to TOGGLE_PIN
authored
21 TOGGLE_PIN - GPIO_147
9f2de5f @scottellis Updated comments
authored
22
b9b5719 @scottellis Rename TEST_PIN to TOGGLE_PIN
authored
23 Jumper IRQ_PIN to TOGGLE_PIN and hook an oscope probe to do the measurement
386a487 @scottellis More comments
authored
24 between them.
d92e87b Initial commit
scott authored
25
26
b9b5719 @scottellis Rename TEST_PIN to TOGGLE_PIN
authored
27 IRQ_PIN ---- TP ---- TOGGLE_PIN
f9cf5b3 @scottellis Formatting of README
authored
28 |
29 oscope
d92e87b Initial commit
scott authored
30
31
de4e220 @scottellis Using a marked up README
authored
32 Build
33 -------
34
4f7400c @scottellis More comment fixes
authored
35 There is a file you can source to set up the environment for building using
36 the OE tools configured the standard gumstix way.
de4e220 @scottellis Using a marked up README
authored
37
606055f @scottellis Build instructions in README
authored
38 $ git clone git://github.com/scottellis/overo-irqlat.git
39 $ cd overo-irqlat
40 $ source overo-source-me.txt
41 $ make
de4e220 @scottellis Using a marked up README
authored
42
606055f @scottellis Build instructions in README
authored
43
de4e220 @scottellis Using a marked up README
authored
44 Run
45 -------
4f7400c @scottellis More comment fixes
authored
46
606055f @scottellis Build instructions in README
authored
47 Copy the irqlat.ko module to the board, insert it and then write 1 to do an
48 irq latency test or anything else to do a gpio toggle speed test.
d06b42e @scottellis Updated for toggle test
authored
49
606055f @scottellis Build instructions in README
authored
50 root@overo:~# insmod irqlat.ko
d92e87b Initial commit
scott authored
51
386a487 @scottellis More comments
authored
52 This runs the irq latency test
f9cf5b3 @scottellis Formatting of README
authored
53
606055f @scottellis Build instructions in README
authored
54 root@overo:~# echo 1 > /dev/irqlat
d06b42e @scottellis Updated for toggle test
authored
55
386a487 @scottellis More comments
authored
56 This runs the gpio toggle test
f9cf5b3 @scottellis Formatting of README
authored
57
606055f @scottellis Build instructions in README
authored
58 root@overo:~# echo 2 > /dev/irqlat
d06b42e @scottellis Updated for toggle test
authored
59
d92e87b Initial commit
scott authored
60
d06b42e @scottellis Updated for toggle test
authored
61 Set your scope to trigger on a rising signal.
d92e87b Initial commit
scott authored
62
9f2de5f @scottellis Updated comments
authored
63 The program sets up IRQ_PIN as an input and irq enables it for an
d06b42e @scottellis Updated for toggle test
authored
64 IRQ_TRIGGER_RISING signal.
9f2de5f @scottellis Updated comments
authored
65
de4e220 @scottellis Using a marked up README
authored
66
67 Results
68 -------
69
70 The latest test was with a 2.6.36 kernel and two Overo COMs, one 720 MHz Tide
93e86a0 @scottellis Added screenshots and some more notes in README
authored
71 and one 500 MHz board.
de4e220 @scottellis Using a marked up README
authored
72
73 The same tftp booted kernel, nfs root filesystem and Tobi expansion board was
74 used for both COMs. Only the boot.scr on the SD card specifying the different
75 mpurates was different.
d06b42e @scottellis Updated for toggle test
authored
76
b9b5719 @scottellis Rename TEST_PIN to TOGGLE_PIN
authored
77 For the irq latency test, the program raises TOGGLE_PIN and in the IRQ_PIN irq
78 handler, it lowers TOGGLE_PIN again. The difference between the rise and fall of
79 TOGGLE_PIN is what I am calling the irq latency. This ignores the time the
de4e220 @scottellis Using a marked up README
authored
80 gpio_set() call takes, but you can see from the next test that it is negligble
81 for this measurement.
82
83 I get values in the neighborhood of 8-9 usecs for either board. There is a good
84 amount of variation in this test. It sometimes takes up to 10 usecs for either
85 board, but never under 8 usecs.
93e86a0 @scottellis Added screenshots and some more notes in README
authored
86
87 Refer to the *_gpio-irq-latency.png screenshots.
9f2de5f @scottellis Updated comments
authored
88
89 For the gpio toggle test, the IRQ_PIN irq handler is not enabled and not used
b9b5719 @scottellis Rename TEST_PIN to TOGGLE_PIN
authored
90 in the test. The module just runs a tight loop setting TOGGLE_PIN high then low
9f2de5f @scottellis Updated comments
authored
91 again for 1000 iterations. You can watch with an oscope the time this takes.
93e86a0 @scottellis Added screenshots and some more notes in README
authored
92
93 Refer to the *-gpio-toggle-1000.png screenshots.
94
de4e220 @scottellis Using a marked up README
authored
95 Here are the measurements I get.
96
4a96ad3 @scottellis More formatting of README
authored
97 500 MHz COM: ~420 usecs for 1000 cycles = ~210 nsecs to change state = ~4.76 MHz
98 720 MHz COM: ~290 usecs for 1000 cycles = ~145 nsecs to change state = ~6.90 MHz
93e86a0 @scottellis Added screenshots and some more notes in README
authored
99
d92e87b Initial commit
scott authored
100
d06b42e @scottellis Updated for toggle test
authored
101 See the source code for more details.
d92e87b Initial commit
scott authored
102
Something went wrong with that request. Please try again.