Skip to contentSkip to conversation

arm64: juno: Add APB registers and LEDs using syscon

PATCH New Linus Walleij 5 participants 12 messages Feb 25, 2015 – Mar 9, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

This defines the Juno "APB system registers" as a syscon device, and all the LEDs controlled by the APB system registers right below it using the syscon LEDs driver on top of syscon. Define LED0 for heartbeat, LED1 for MMC0 activity and the following four LEDs indicating CPU activity using the Linux-specific DT bindings for triggers.

This is the pattern and same drivers as used on the legacy platform device trees for the ARM Integrators and the RealView PB1176.

Cc Arnd Bergmann <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Robin Murphy <[email protected]>
---
 arch/arm64/boot/dts/arm/juno-motherboard.dtsi | 68 +++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
arch/arm64/boot/dts/arm/juno-motherboard.dtsi +68 -0
index c138b95a8356..08d32d6dd955 100644
@@ -66,6 +66,74 @@
 				#size-cells = <1>;
 				ranges = <0 3 0 0x200000>;
 
+				apbregs at 010000 {
+					compatible = "syscon";
+					reg = <0x010000 0x1000>;
+
+					led at 08.0 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x01>;
+						label = "vexpress:0";
+						linux,default-trigger = "heartbeat";
+						default-state = "on";
+					};
+					led at 08.1 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x02>;
+						label = "vexpress:1";
+						linux,default-trigger = "mmc0";
+						default-state = "off";
+					};
+					led at 08.2 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x04>;
+						label = "vexpress:2";
+						linux,default-trigger = "cpu0";
+						default-state = "off";
+					};
+					led at 08.3 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x08>;
+						label = "vexpress:3";
+						linux,default-trigger = "cpu1";
+						default-state = "off";
+					};
+					led at 08.4 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x10>;
+						label = "vexpress:4";
+						linux,default-trigger = "cpu2";
+						default-state = "off";
+					};
+					led at 08.5 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x20>;
+						label = "vexpress:5";
+						linux,default-trigger = "cpu3";
+						default-state = "off";
+					};
+					led at 08.6 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x40>;
+						label = "vexpress:6";
+						default-state = "off";
+					};
+					led at 08.7 {
+						compatible = "register-bit-led";
+						offset = <0x08>;
+						mask = <0x80>;
+						label = "vexpress:7";
+						default-state = "off";
+					};
+				};
+
 				mmci at 050000 {
 					compatible = "arm,pl180", "arm,primecell";
 					reg = <0x050000 0x1000>;
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 10 lines · Linus Walleij

This defines the Juno "APB system registers" as a syscon device, and all the LEDs controlled by the APB system registers right below it using the syscon LEDs driver on top of syscon. Define LED0 for heartbeat, LED1 for MMC0 activity and the following four LEDs indicating CPU activity using the Linux-specific DT bindings for triggers.

This is the pattern and same drivers as used on the legacy platform device trees for the ARM Integrators and the RealView PB1176.

Stupid question, but where are these LEDs located on the platform? I tried enabling this, but all it seemed to do was make hackbench slightly slower :)

Will

maintainer
#2 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 8 lines · Will Deacon
Quoted 7 lines · Linus Walleij

This defines the Juno "APB system registers" as a syscon device, and all the LEDs controlled by the APB system registers right below it using the syscon LEDs driver on top of syscon. Define LED0 for heartbeat, LED1 for MMC0 activity and the following four LEDs indicating CPU activity using the Linux-specific DT bindings for triggers.

Quoted 6 lines
Quoted 3 lines

This is the pattern and same drivers as used on the legacy platform device trees for the ARM Integrators and the RealView PB1176.

Stupid question, but where are these LEDs located on the platform? I tried enabling this, but all it seemed to do was make hackbench slightly slower :)

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0524c/deb1353593789871.html

Section 1.3, look at the left hand side, above the user push buttons.

Best regards,
Liviu

Quoted 3 lines

Will

Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ?\_(?)_/?
#3 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 13 lines · Liviu Dudau
Quoted 12 lines · Will Deacon
Quoted 10 lines · Linus Walleij

This defines the Juno "APB system registers" as a syscon device, and all the LEDs controlled by the APB system registers right below it using the syscon LEDs driver on top of syscon. Define LED0 for heartbeat, LED1 for MMC0 activity and the following four LEDs indicating CPU activity using the Linux-specific DT bindings for triggers.

This is the pattern and same drivers as used on the legacy platform device trees for the ARM Integrators and the RealView PB1176.

Quoted 6 lines
Quoted 2 lines

Stupid question, but where are these LEDs located on the platform? I tried enabling this, but all it seemed to do was make hackbench slightly slower :)

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0524c/deb1353593789871.html

Section 1.3, look at the left hand side, above the user push buttons.

Right, so these LEDs are *inside* the case. Is that really something worth enabling for defconfig?

Will

maintainer
#4 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 17 lines · Will Deacon
Quoted 16 lines · Liviu Dudau
Quoted 14 lines · Will Deacon
Quoted 10 lines · Linus Walleij

This defines the Juno "APB system registers" as a syscon device, and all the LEDs controlled by the APB system registers right below it using the syscon LEDs driver on top of syscon. Define LED0 for heartbeat, LED1 for MMC0 activity and the following four LEDs indicating CPU activity using the Linux-specific DT bindings for triggers.

This is the pattern and same drivers as used on the legacy platform device trees for the ARM Integrators and the RealView PB1176.

Stupid question, but where are these LEDs located on the platform? I tried enabling this, but all it seemed to do was make hackbench slightly slower :)

Quoted 6 lines
Quoted 3 lines

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0524c/deb1353593789871.html

Section 1.3, look at the left hand side, above the user push buttons.

Right, so these LEDs are *inside* the case. Is that really something worth enabling for defconfig?

Depends on the case :) You might have a nice cutout in the plastic of the VExpress box, or have your own custom acrylic box.

Maybe Linus can explain to us why he thinks this functionality is useful given that quite a lot of people tend to use the Juno boards inside the original boxes for fear of ESD accidents.

Best regards,
Liviu

Quoted 3 lines

Will

Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ?\_(?)_/?
#5 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 20 lines · Liviu Dudau
Quoted 19 lines · Will Deacon
Quoted 18 lines · Liviu Dudau
Quoted 8 lines · Will Deacon
Quoted 7 lines · Linus Walleij

This defines the Juno "APB system registers" as a syscon device, and all the LEDs controlled by the APB system registers right below it using the syscon LEDs driver on top of syscon. Define LED0 for heartbeat, LED1 for MMC0 activity and the following four LEDs indicating CPU activity using the Linux-specific DT bindings for triggers.

Quoted 6 lines
Quoted 3 lines

This is the pattern and same drivers as used on the legacy platform device trees for the ARM Integrators and the RealView PB1176.

Stupid question, but where are these LEDs located on the platform? I tried enabling this, but all it seemed to do was make hackbench slightly slower :)

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0524c/deb1353593789871.html

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Section 1.3, look at the left hand side, above the user push buttons.

Right, so these LEDs are *inside* the case. Is that really something worth enabling for defconfig?

Depends on the case :) You might have a nice cutout in the plastic of the VExpress box, or have your own custom acrylic box.

Of course I take off the lid, who doesn't want to see the nice electronics. This is analogous to using some other naked ARM reference design like the Versatile or the RealView PB1176 where you can just put your fingers on the board if you like.

Quoted 3 lines

Maybe Linus can explain to us why he thinks this functionality is useful given that quite a lot of people tend to use the Juno boards inside the original boxes for fear of ESD accidents.

Wut? Ask the guy who designed the box.

Notice that the SD card slot is *ALSO* inside the box, do you mean we should then also delete the uSD card support added in commit 71f867ec130e3cc8e692366fdf8941ded27c727e
by yourself because the SD card slot is not reachable? Notice that to access that card slot you even have to remove the nice blue ARM boilerplate.

The board is obviously designed to be reachable and the top part of the case is obviously designed to be taken off by professional users.

Yours,
Linus Walleij

maintainer
#6 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 38 lines · Linus Walleij
Quoted 20 lines · Liviu Dudau
Quoted 19 lines · Will Deacon
Quoted 18 lines · Liviu Dudau
Quoted 8 lines · Will Deacon
Quoted 7 lines · Linus Walleij

This defines the Juno "APB system registers" as a syscon device, and all the LEDs controlled by the APB system registers right below it using the syscon LEDs driver on top of syscon. Define LED0 for heartbeat, LED1 for MMC0 activity and the following four LEDs indicating CPU activity using the Linux-specific DT bindings for triggers.

Quoted 6 lines
Quoted 3 lines

This is the pattern and same drivers as used on the legacy platform device trees for the ARM Integrators and the RealView PB1176.

Stupid question, but where are these LEDs located on the platform? I tried enabling this, but all it seemed to do was make hackbench slightly slower :)

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0524c/deb1353593789871.html

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Section 1.3, look at the left hand side, above the user push buttons.

Right, so these LEDs are *inside* the case. Is that really something worth enabling for defconfig?

Depends on the case :) You might have a nice cutout in the plastic of the VExpress box, or have your own custom acrylic box.

Of course I take off the lid, who doesn't want to see the nice electronics. This is analogous to using some other naked ARM reference design like the Versatile or the RealView PB1176 where you can just put your fingers on the board if you like.

Quoted 3 lines

Maybe Linus can explain to us why he thinks this functionality is useful given that quite a lot of people tend to use the Juno boards inside the original boxes for fear of ESD accidents.

Quoted 8 lines

Wut? Ask the guy who designed the box.

Notice that the SD card slot is *ALSO* inside the box, do you mean we should then also delete the uSD card support added in commit 71f867ec130e3cc8e692366fdf8941ded27c727e
by yourself because the SD card slot is not reachable? Notice that to access that card slot you even have to remove the nice blue ARM boilerplate.

That's not my view. I have a mobile phone with an uSD card slot, but I have to take the cover off (and the battery) to access it. It doesn't mean I should not be able to use it from kernel side because of that, only that the designer of the phone (and of the Juno board + box by extension) did not expect people to use it with covers off all the time.

<virtual-tongue-in-cheek-on>
I fail to see why you need to remove the SD card all the time. Surely opening the case once to put the uSD card in is enough? ;) </virtual-tongue-in-cheek-on>

Quoted 4 lines

The board is obviously designed to be reachable and the top part of the case is obviously designed to be taken off by professional users.

I'm mostly on your side, Linus, I was just looking for more use cases. Like I've said, most of our customers seem to keep the case closed (or at least that is what they tell us :) ) so I'm looking for explanations on how you use the LEDs (visual debugging for big-LITTLE was how Lorenzo was using them on TC2 for example).

Best regards,
Liviu

Quoted 4 lines

Yours,
Linus Walleij

Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ?\_(?)_/?
#7 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 21 lines · Liviu Dudau
Quoted 6 lines · Linus Walleij

Notice that the SD card slot is *ALSO* inside the box, do you mean we should then also delete the uSD card support added in commit 71f867ec130e3cc8e692366fdf8941ded27c727e
by yourself because the SD card slot is not reachable? Notice that to access that card slot you even have to remove the nice blue ARM boilerplate.

That's not my view. I have a mobile phone with an uSD card slot, but I have to take the cover off (and the battery) to access it. It doesn't mean I should not be able to use it from kernel side because of that, only that the designer of the phone (and of the Juno board + box by extension) did not expect people to use it with covers off all the time.

<virtual-tongue-in-cheek-on>
I fail to see why you need to remove the SD card all the time. Surely opening the case once to put the uSD card in is enough? ;) </virtual-tongue-in-cheek-on>

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

The board is obviously designed to be reachable and the top part of the case is obviously designed to be taken off by professional users.

I'm mostly on your side, Linus, I was just looking for more use cases. Like I've said, most of our customers seem to keep the case closed (or at least that is what they tell us :) ) so I'm looking for explanations on how you use the LEDs (visual debugging for big-LITTLE was how Lorenzo was using them on TC2 for example).

OK now I feel bad and maybe I was not in such a good mood that day.

The LEDs I added are really useful on the other ARM reference designs, the heartbeat gives a sign that the system is alive even if your console is not working and that's what I appreaciate a lot about it (the heartbeat intensity
also indicates system load).

The MMC read/write LED is as useful as the hard disk activity LED on some older PCs, kinda nice if you want to know something is going on.

The rest of the LEDs show which CPU cores are active. This was the original use of the LEDs on the RealView PB11MPcore and it was appreciated by the multicore developers who could see the different CPUs being busy with tasks.

LEDs on development boards are real nice, simply, and I think also some deployed ARM64 server systems will have them.

Yours,
Linus Walleij

maintainer
#8 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 22 lines · Linus Walleij
Quoted 21 lines · Liviu Dudau
Quoted 6 lines · Linus Walleij

Notice that the SD card slot is *ALSO* inside the box, do you mean we should then also delete the uSD card support added in commit 71f867ec130e3cc8e692366fdf8941ded27c727e
by yourself because the SD card slot is not reachable? Notice that to access that card slot you even have to remove the nice blue ARM boilerplate.

That's not my view. I have a mobile phone with an uSD card slot, but I have to take the cover off (and the battery) to access it. It doesn't mean I should not be able to use it from kernel side because of that, only that the designer of the phone (and of the Juno board + box by extension) did not expect people to use it with covers off all the time.

<virtual-tongue-in-cheek-on>
I fail to see why you need to remove the SD card all the time. Surely opening the case once to put the uSD card in is enough? ;) </virtual-tongue-in-cheek-on>

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

The board is obviously designed to be reachable and the top part of the case is obviously designed to be taken off by professional users.

I'm mostly on your side, Linus, I was just looking for more use cases. Like I've said, most of our customers seem to keep the case closed (or at least that is what they tell us :) ) so I'm looking for explanations on how you use the LEDs (visual debugging for big-LITTLE was how Lorenzo was using them on TC2 for example).

Linus,

Quoted 2 lines

OK now I feel bad and maybe I was not in such a good mood that day.

Don't worry, I actually found it amusing.

Quoted 7 lines

The LEDs I added are really useful on the other ARM reference designs, the heartbeat gives a sign that the system is alive even if your console is not working and that's what I appreaciate a lot about it (the heartbeat intensity
also indicates system load).

Quoted 7 lines

The MMC read/write LED is as useful as the hard disk activity LED on some older PCs, kinda nice if you want to know something is going on.

The rest of the LEDs show which CPU cores are active. This was the original use of the LEDs on the RealView PB11MPcore and it was appreciated by the multicore developers who could see the different CPUs being busy with tasks.

In that case you might want to use the remaining 2 leds for cpus 4 and 5, as Juno has a total of 6 cores. Your current patch leaves two LEDs unassigned.

Quoted 3 lines

LEDs on development boards are real nice, simply, and I think also some deployed ARM64 server systems will have them.

Agree on LEDs being nice. I'm guessing that on server side if you want blinking lights you need ACPI? ;)

Best regards,
Liviu

Quoted 4 lines

Yours,
Linus Walleij

Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ?\_(?)_/?
#9 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

In reply to Liviu Dudau
Quoted 2 lines · Liviu Dudau
Quoted 1 line · Linus Walleij

On Wed, Feb 25, 2015 at 4:11 PM, Liviu Dudau <[email protected]> wrote:

[...]

Quoted 5 lines

I'm mostly on your side, Linus, I was just looking for more use cases. Like I've said, most of our customers seem to keep the case closed (or at least that is what they tell us :) ) so I'm looking for explanations on how you use the LEDs (visual debugging for big-LITTLE was how Lorenzo was using them on TC2 for example).

Just to clarify:

IIUC all VExpress platforms has these LEDs on the motherboard. The one you are referring is on the TC2 core-tile which are completely controlled by the firmware. The main advantage of that was to know if the OSPM request is accepted by the firmware.

But the LEDs being referred here are under OS control and gives only the OS view of the state which is good enough but not exactly what we had on TC2.

Regards,
Sudeep

#10 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 15 lines · Sudeep Holla
Quoted 2 lines · Liviu Dudau
Quoted 1 line · Linus Walleij

On Wed, Feb 25, 2015 at 4:11 PM, Liviu Dudau <[email protected]> wrote:

[...]

Quoted 5 lines

I'm mostly on your side, Linus, I was just looking for more use cases. Like I've said, most of our customers seem to keep the case closed (or at least that is what they tell us :) ) so I'm looking for explanations on how you use the LEDs (visual debugging for big-LITTLE was how Lorenzo was using them on TC2 for example).

Just to clarify:

Quoted 8 lines

IIUC all VExpress platforms has these LEDs on the motherboard. The one you are referring is on the TC2 core-tile which are completely controlled by the firmware. The main advantage of that was to know if the OSPM request is accepted by the firmware.

But the LEDs being referred here are under OS control and gives only the OS view of the state which is good enough but not exactly what we had on TC2.

Well, when a TC2 CoreTile is plugged into the Versatile Express motherboard you get those LEDs as well and can see what the OS thinks is the state of the CPU's. I've found this useful in the past for debugging problems caused by a mismatch between the OS's and firmware's view of the world.

Signature · 1 line
Tixy
#11 lore raw

PATCH 1/2 arm64: juno: Add APB registers and LEDs using syscon

Quoted 25 lines · Jon Medhurst (Tixy)
Quoted 15 lines · Sudeep Holla
Quoted 2 lines · Liviu Dudau
Quoted 1 line · Linus Walleij

On Wed, Feb 25, 2015 at 4:11 PM, Liviu Dudau <[email protected]> wrote:

[...]

Quoted 5 lines

I'm mostly on your side, Linus, I was just looking for more use cases. Like I've said, most of our customers seem to keep the case closed (or at least that is what they tell us :) ) so I'm looking for explanations on how you use the LEDs (visual debugging for big-LITTLE was how Lorenzo was using them on TC2 for example).

Just to clarify:

Quoted 8 lines

IIUC all VExpress platforms has these LEDs on the motherboard. The one you are referring is on the TC2 core-tile which are completely controlled by the firmware. The main advantage of that was to know if the OSPM request is accepted by the firmware.

But the LEDs being referred here are under OS control and gives only the OS view of the state which is good enough but not exactly what we had on TC2.

Quoted 6 lines

Well, when a TC2 CoreTile is plugged into the Versatile Express motherboard you get those LEDs as well and can see what the OS thinks is the state of the CPU's. I've found this useful in the past for debugging problems caused by a mismatch between the OS's and firmware's view of the world.

I agree, I just wanted to clarify that the LEDs that were more useful while debugging PM on TC2 were those on the coretile rather than the one on the motherboard and that there are managed by firmware.

Regards,
Sudeep