Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/5200: Add Lite5200 on-board LEDs as devices

The Lite5200 evaluation board has a number of debug LEDs that Linux
doesn't know about yet. This change adds a gpio-leds stanza to the
lite5200 device tree so that the correct driver can get hooked up.

Also, make use of the dtc labels feature to reduce the number of source
lines required to add the gpio-controller property to the general
purpose timer nodes. In addition, the required #gpio-cells properties
are added to the common mpc5200b dtsi include file so that each board
doesn't need to add them explicitly. This still doesn't enable gpio
mode, 'gpio-controller' is required for that, but it means less work
needs to be done by board ports.

Cc: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Grant Likely and committed by
Anatolij Gustschin
4fd0a213 63410b0b

+36 -12
+19 -4
arch/powerpc/boot/dts/lite5200b.dts
··· 12 12 13 13 /include/ "mpc5200b.dtsi" 14 14 15 + &gpt0 { fsl,has-wdt; }; 16 + &gpt2 { gpio-controller; }; 17 + &gpt3 { gpio-controller; }; 18 + 15 19 / { 16 20 model = "fsl,lite5200b"; 17 21 compatible = "fsl,lite5200b"; 22 + 23 + leds { 24 + compatible = "gpio-leds"; 25 + tmr2 { 26 + gpios = <&gpt2 0 1>; 27 + }; 28 + tmr3 { 29 + gpios = <&gpt3 0 1>; 30 + linux,default-trigger = "heartbeat"; 31 + }; 32 + led1 { gpios = <&gpio_wkup 2 1>; }; 33 + led2 { gpios = <&gpio_simple 3 1>; }; 34 + led3 { gpios = <&gpio_wkup 3 1>; }; 35 + led4 { gpios = <&gpio_simple 2 1>; }; 36 + }; 18 37 19 38 memory { 20 39 reg = <0x00000000 0x10000000>; // 256MB 21 40 }; 22 41 23 42 soc5200@f0000000 { 24 - timer@600 { // General Purpose Timer 25 - fsl,has-wdt; 26 - }; 27 - 28 43 psc@2000 { // PSC1 29 44 compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 30 45 cell-index = <0>;
+17 -8
arch/powerpc/boot/dts/mpc5200b.dtsi
··· 64 64 reg = <0x500 0x80>; 65 65 }; 66 66 67 - timer@600 { // General Purpose Timer 67 + gpt0: timer@600 { // General Purpose Timer 68 68 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 69 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 69 70 reg = <0x600 0x10>; 70 71 interrupts = <1 9 0>; 72 + // add 'fsl,has-wdt' to enable watchdog 71 73 }; 72 74 73 - timer@610 { // General Purpose Timer 75 + gpt1: timer@610 { // General Purpose Timer 74 76 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 77 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 75 78 reg = <0x610 0x10>; 76 79 interrupts = <1 10 0>; 77 80 }; 78 81 79 - timer@620 { // General Purpose Timer 82 + gpt2: timer@620 { // General Purpose Timer 80 83 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 84 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 81 85 reg = <0x620 0x10>; 82 86 interrupts = <1 11 0>; 83 87 }; 84 88 85 - timer@630 { // General Purpose Timer 89 + gpt3: timer@630 { // General Purpose Timer 86 90 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 91 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 87 92 reg = <0x630 0x10>; 88 93 interrupts = <1 12 0>; 89 94 }; 90 95 91 - timer@640 { // General Purpose Timer 96 + gpt4: timer@640 { // General Purpose Timer 92 97 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 98 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 93 99 reg = <0x640 0x10>; 94 100 interrupts = <1 13 0>; 95 101 }; 96 102 97 - timer@650 { // General Purpose Timer 103 + gpt5: timer@650 { // General Purpose Timer 98 104 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 105 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 99 106 reg = <0x650 0x10>; 100 107 interrupts = <1 14 0>; 101 108 }; 102 109 103 - timer@660 { // General Purpose Timer 110 + gpt6: timer@660 { // General Purpose Timer 104 111 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 112 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 105 113 reg = <0x660 0x10>; 106 114 interrupts = <1 15 0>; 107 115 }; 108 116 109 - timer@670 { // General Purpose Timer 117 + gpt7: timer@670 { // General Purpose Timer 110 118 compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt"; 119 + #gpio-cells = <2>; // Add 'gpio-controller;' to enable gpio mode 111 120 reg = <0x670 0x10>; 112 121 interrupts = <1 16 0>; 113 122 };