test-pwm: tested group A 100%
[beagleboard-validation:scripts.git] / test-pwm / Makefile
1 PWM = am33xx_pwm
2 PINS_A = \
3         P9_22 \
4         P9_21 \
5         P9_14 \
6         P9_16 \
7         P8_19 \
8         P8_13 \
9         P9_42 \
10         P9_28 \
11
12 PINS_B = \
13         P9_31 \
14         P9_29 \
15         P8_34 \
16         P8_36 \
17         P8_45 \
18         P8_46 \
19
20 DTBO_FILES_A = $(foreach device,$(PINS_A),bone_pwm_$(device)-00A0.dtbo)
21 DTBO_FILES_B = $(foreach device,$(PINS_B),bone_pwm_$(device)-00A0.dtbo)
22 DTBO_FILES = $(PWM)-00A0.dtbo $(DTBO_FILES_A) $(DTBO_FILES_B)
23 SLOTS=$(shell ls /sys/devices/bone_capemgr.*/slots)
24
25 all:    $(DTBO_FILES)
26
27 clean:
28         rm $(DTBO_FILES)
29
30 load_a:
31         echo $(PWM) > $(SLOTS)
32         for pin in $(PINS_A) ; do \
33                 echo bone_pwm_$$pin > $(SLOTS) ; \
34         done;
35
36 load_b:
37         echo $(PWM) > $(SLOTS)
38         for pin in $(PINS_B) ; do \
39                 echo bone_pwm_$$pin > $(SLOTS) ; \
40         done;
41
42 install:
43         install -m 0644 $(DTBO_FILES) /lib/firmware
44
45 %.dtbo: %.dts
46         dtc -O dtb -o $@ -b 0 -@ $<