The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Question about the Broadcom Always On register panic handling
@ 2022-03-21 16:15 Guilherme G. Piccoli
  2022-03-21 16:32 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Guilherme G. Piccoli @ 2022-03-21 16:15 UTC (permalink / raw)
  To: computersforpeace, f.fainelli
  Cc: gpiccoli, Guilherme G. Piccoli, opendmb, gpowell, justinpopo6,
	mmayer, bcm-kernel-feedback-list, kexec, linux-arm-kernel,
	linux-kernel

Hi Brian and Florian, I'm studying the panic notifiers and found one
added by you in the commit 0b741b8234c ("soc: bcm: brcmstb: Add support
for S2/S3/S5 suspend states (ARM)". Basically, the handler is very
simple and the only thing it does is:

/* from drivers/soc/bcm/brcmstb/pm/aon_defs.h */
#define AON_REG_PANIC		0x20
#define BRCMSTB_PANIC_MAGIC	0x512E115E

/* from drivers/soc/bcm/brcmstb/pm/pm-arm.c*/
brcmstb_pm_panic_notify() {
	writel_relaxed(BRCMSTB_PANIC_MAGIC, ctrl.aon_sram + AON_REG_PANIC);
}

This write happens on panic time, but I couldn't find any
information/documentation about the AON register and what effectively
happens when this write is completed. Does the SoC reboots or anything
like that?

Any information that helps me to document such panic event is very
welcome, and in case you have AON documentation, it'd be also pretty great!

Thanks in advance,


Guilherme

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about the Broadcom Always On register panic handling
  2022-03-21 16:15 Question about the Broadcom Always On register panic handling Guilherme G. Piccoli
@ 2022-03-21 16:32 ` Florian Fainelli
  2022-03-21 18:04   ` Guilherme G. Piccoli
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2022-03-21 16:32 UTC (permalink / raw)
  To: Guilherme G. Piccoli, computersforpeace
  Cc: Guilherme G. Piccoli, opendmb, gpowell, justinpopo6, mmayer,
	bcm-kernel-feedback-list, kexec, linux-arm-kernel, linux-kernel

On 3/21/22 09:15, Guilherme G. Piccoli wrote:
> Hi Brian and Florian, I'm studying the panic notifiers and found one
> added by you in the commit 0b741b8234c ("soc: bcm: brcmstb: Add support
> for S2/S3/S5 suspend states (ARM)". Basically, the handler is very
> simple and the only thing it does is:
> 
> /* from drivers/soc/bcm/brcmstb/pm/aon_defs.h */
> #define AON_REG_PANIC		0x20
> #define BRCMSTB_PANIC_MAGIC	0x512E115E
> 
> /* from drivers/soc/bcm/brcmstb/pm/pm-arm.c*/
> brcmstb_pm_panic_notify() {
> 	writel_relaxed(BRCMSTB_PANIC_MAGIC, ctrl.aon_sram + AON_REG_PANIC);
> }
> 
> This write happens on panic time, but I couldn't find any
> information/documentation about the AON register and what effectively
> happens when this write is completed. Does the SoC reboots or anything
> like that?

The AON (standing for always-on) is a small domain in the SoC that can 
retain its state across various system wide sleep states and specific 
reset conditions. The AON DATA RAM is a small ram of a few words (< 1KB) 
which can store persistent information across such events.

The purpose of this write was initially to help with indicating to the 
boot loader that a panic occurred and so that it should try its best to 
preserve the DRAM contents holding that buffer for recovery by the Linux 
kernel as opposed to wiping out DRAM clean again. I cannot go into the 
mechanics of what happens publicly unfortunately.

> 
> Any information that helps me to document such panic event is very
> welcome, and in case you have AON documentation, it'd be also pretty great!

Why are you asking specifically about this if I may ask? If you are a 
legitimate Broadcom STB customer you can reach out to our support and I 
am sure the question will come back for me to answer.
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about the Broadcom Always On register panic handling
  2022-03-21 16:32 ` Florian Fainelli
@ 2022-03-21 18:04   ` Guilherme G. Piccoli
  0 siblings, 0 replies; 3+ messages in thread
From: Guilherme G. Piccoli @ 2022-03-21 18:04 UTC (permalink / raw)
  To: Florian Fainelli, computersforpeace
  Cc: Guilherme G. Piccoli, opendmb, justinpopo6, mmayer,
	bcm-kernel-feedback-list, kexec, linux-arm-kernel, linux-kernel

On 21/03/2022 13:32, Florian Fainelli wrote:
> [...]
> The AON (standing for always-on) is a small domain in the SoC that can 
> retain its state across various system wide sleep states and specific 
> reset conditions. The AON DATA RAM is a small ram of a few words (< 1KB) 
> which can store persistent information across such events.
> 
> The purpose of this write was initially to help with indicating to the 
> boot loader that a panic occurred and so that it should try its best to 
> preserve the DRAM contents holding that buffer for recovery by the Linux 
> kernel as opposed to wiping out DRAM clean again. I cannot go into the 
> mechanics of what happens publicly unfortunately.
> 

Thanks a lot Florian! This is very good information, it's enough for me
- I'd like to be sure it's not rebooting the board or something
"extreme" like that, so in the end...it's kinda the opposite, it's
preserving the DRAM.


>>
>> Any information that helps me to document such panic event is very
>> welcome, and in case you have AON documentation, it'd be also pretty great!
> 
> Why are you asking specifically about this if I may ask? If you are a 
> legitimate Broadcom STB customer you can reach out to our support and I 
> am sure the question will come back for me to answer.

Oh I'm not a Broadcom STB customer, I'm just working in the panic
notifiers and was curious about this one. When I submit my series (soon)
it's likely that there  will be a small refactor of this notifier plus a
comment, with your great explanation.

Regarding the full AON documentation, I just asked in case it's public
and I couldn't find - it's unfortunate that a lot of code in the kernel
is based on closed specifications, but I understand we can't do much
about that. Your response was very useful, and enough for my work =)

Cheers,


Guilherme

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-21 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-21 16:15 Question about the Broadcom Always On register panic handling Guilherme G. Piccoli
2022-03-21 16:32 ` Florian Fainelli
2022-03-21 18:04   ` Guilherme G. Piccoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox