watchdog: sp5100: Fix definition of EFCH_PM_DECODEEN3
Guenter Roeck
maintainerPATCH 2/2 watchdog: sp5100_tco: Enable watchdog on Family 17h devices if disabled
In reply to Guenter RoeckOn Family 17h (Ryzen) devices, the WatchdogTmrEn bit of PmDecodeEn not only enables watchdog memory decoding at 0xfeb00000, it also enables the watchdog hardware itself. Use this information to enable the watchdog if it is not already enabled.
--- drivers/watchdog/sp5100_tco.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/watchdog/sp5100_tco.c +18 -0
@@ -17,6 +17,12 @@* AMD Publication 51192 "AMD Bolton FCH Register Reference Guide" * AMD Publication 52740 "BIOS and Kernel Developer’s Guide (BKDG) * for AMD Family 16h Models 30h-3Fh Processors" +* AMD Publication 55570-B1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 18h, Revision B1 +* Processors (PUB) +* AMD Publication 55772-A1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 20h, Revision A1 +* Processors (PUB) */ /*
@@ -241,6 +247,18 @@ static int sp5100_tco_setupdevice(struct device *dev,break ;case efch: dev_name =SB800_DEVNAME ; +/* +* On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of +* EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory +* region, it also enables the watchdog itself. +*/ +if (boot_cpu_data.x86 ==0x17 ) { + val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN ); +if (!(val &EFCH_PM_DECODEEN_WDT_TMREN )) { +sp5100_tco_update_pm_reg8 (EFCH_PM_DECODEEN ,0xff , +EFCH_PM_DECODEEN_WDT_TMREN ); + } + } val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN );if (val &EFCH_PM_DECODEEN_WDT_TMREN ) mmio_addr =EFCH_PM_WDT_ADDR ;
Signature · 1 line
2.17.1
Guenter Roeck
maintainerPATCH 1/2 watchdog: sp5100: Fix definition of EFCH_PM_DECODEEN3
EFCH_PM_DECODEEN3 is supposed to access DECODEEN register bits 24..31, in other words the register at byte offset 3.
--- drivers/watchdog/sp5100_tco.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/sp5100_tco.h +1 -1
@@ -70,7 +70,7 @@#define EFCH_PM_DECODEEN_WDT_TMREN BIT(7) -#define EFCH_PM_DECODEEN3 0x00 +#define EFCH_PM_DECODEEN3 0x03#define EFCH_PM_DECODEEN_SECOND_RES GENMASK(1, 0)#define EFCH_PM_WATCHDOG_DISABLE ((u8)GENMASK(3, 2))
Signature · 1 line
2.17.1
Re: [PATCH 2/2] watchdog: sp5100_tco: Enable watchdog on Family 17h devices if disabled
In reply to Guenter RoeckQuoted 58 lines · Guenter Roeck
Hi Jan,
Quoted 45 lines · Jan Kiszka
Quoted 44 lines · Guenter Roeck
On Family 17h (Ryzen) devices, the WatchdogTmrEn bit of PmDecodeEn not only enables watchdog memory decoding at
0xfeb00000, it also enables the watchdog hardware itself. Use this information to enable the watchdog if it is not already enabled.Cc Jan Kiszka <[email protected]>Signed-off-by Guenter Roeck <[email protected]>--- drivers/watchdog/sp5100_tco.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)drivers/watchdog/sp5100_tco.c +18
-0@@ -17,6 +17,12 @@* AMD Publication 51192 "AMD Bolton FCH Register Reference Guide" * AMD Publication 52740 "BIOS and Kernel Developer’s Guide (BKDG) * for AMD Family 16h Models 30h-3Fh Processors" +* AMD Publication 55570-B1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 18h, Revision B1 +* Processors (PUB) +* AMD Publication 55772-A1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 20h, Revision A1 +* Processors (PUB) */ /* @@ -241,6 +247,18 @@ static int sp5100_tco_setupdevice(struct device *dev,break ;case efch: dev_name =SB800_DEVNAME ; +/* +* On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of +* EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory +* region, it also enables the watchdog itself. +*/ +if (boot_cpu_data.x86 ==0x17 ) { + val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN ); +if (!(val &EFCH_PM_DECODEEN_WDT_TMREN )) { +sp5100_tco_update_pm_reg8 (EFCH_PM_DECODEEN ,0xff , +EFCH_PM_DECODEEN_WDT_TMREN ); + } + }Quoted 9 lines
drivers/watchdog/sp5100_tco.c static int sp5100_tco_setupdevice(struct device *dev, · line 264
Quoted 4 lines
drivers/watchdog/sp5100_tco.c +0
-0val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN );if (val &EFCH_PM_DECODEEN_WDT_TMREN ) mmio_addr =EFCH_PM_WDT_ADDR ;Won't that bring us
EFCH_PM_WDT_ADDRas address, rather thanEFCH_PM_ACPI_MMIO_ADDRwhich worked in my case? Or is one an alias of the other.
Quoted 3 lines
Yes, it does use
EFCH_PM_WDT_ADDR.EFCH_PM_ACPI_MMIO_ADDRworks as well, but is meant to be a fallback. Both point to the watchdog memory space.
OK, will test, possibly only on the weekend, and confirm this also on my board.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Guenter Roeck
maintainerRe: [PATCH 2/2] watchdog: sp5100_tco: Enable watchdog on Family 17h devices if disabled
In reply to Jan KiszkaHi Jan,
Quoted 45 lines · Jan Kiszka
Quoted 44 lines · Guenter Roeck
On Family 17h (Ryzen) devices, the WatchdogTmrEn bit of PmDecodeEn not only enables watchdog memory decoding at
0xfeb00000, it also enables the watchdog hardware itself. Use this information to enable the watchdog if it is not already enabled.Cc Jan Kiszka <[email protected]>Signed-off-by Guenter Roeck <[email protected]>--- drivers/watchdog/sp5100_tco.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)drivers/watchdog/sp5100_tco.c +18
-0@@ -17,6 +17,12 @@* AMD Publication 51192 "AMD Bolton FCH Register Reference Guide" * AMD Publication 52740 "BIOS and Kernel Developer’s Guide (BKDG) * for AMD Family 16h Models 30h-3Fh Processors" +* AMD Publication 55570-B1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 18h, Revision B1 +* Processors (PUB) +* AMD Publication 55772-A1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 20h, Revision A1 +* Processors (PUB) */ /* @@ -241,6 +247,18 @@ static int sp5100_tco_setupdevice(struct device *dev,break ;case efch: dev_name =SB800_DEVNAME ; +/* +* On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of +* EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory +* region, it also enables the watchdog itself. +*/ +if (boot_cpu_data.x86 ==0x17 ) { + val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN ); +if (!(val &EFCH_PM_DECODEEN_WDT_TMREN )) { +sp5100_tco_update_pm_reg8 (EFCH_PM_DECODEEN ,0xff , +EFCH_PM_DECODEEN_WDT_TMREN ); + } + }
Quoted 9 lines
drivers/watchdog/sp5100_tco.c static int sp5100_tco_setupdevice(struct device *dev, · line 264
Quoted 4 lines
drivers/watchdog/sp5100_tco.c +0
-0val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN );if (val &EFCH_PM_DECODEEN_WDT_TMREN ) mmio_addr =EFCH_PM_WDT_ADDR ;Won't that bring us
EFCH_PM_WDT_ADDRas address, rather thanEFCH_PM_ACPI_MMIO_ADDRwhich worked in my case? Or is one an alias of the other.
Yes, it does use EFCH_PM_WDT_ADDR. EFCH_PM_ACPI_MMIO_ADDR works as well, but is meant to be a fallback. Both point to the watchdog memory space.
Thanks,
Guenter
Re: [PATCH 2/2] watchdog: sp5100_tco: Enable watchdog on Family 17h devices if disabled
In reply to Guenter RoeckQuoted 38 lines · Guenter Roeck
On Family 17h (Ryzen) devices, the WatchdogTmrEn bit of PmDecodeEn not only enables watchdog memory decoding at
0xfeb00000, it also enables the watchdog hardware itself. Use this information to enable the watchdog if it is not already enabled.Cc Jan Kiszka <[email protected]>Signed-off-by Guenter Roeck <[email protected]>--- drivers/watchdog/sp5100_tco.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)drivers/watchdog/sp5100_tco.c +11
-0@@ -17,6 +17,12 @@* AMD Publication 51192 "AMD Bolton FCH Register Reference Guide" * AMD Publication 52740 "BIOS and Kernel Developer’s Guide (BKDG) * for AMD Family 16h Models 30h-3Fh Processors" +* AMD Publication 55570-B1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 18h, Revision B1 +* Processors (PUB) +* AMD Publication 55772-A1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 20h, Revision A1 +* Processors (PUB) */ /* @@ -241,6 +247,18 @@ static int sp5100_tco_setupdevice(struct device *dev,break ;case efch: dev_name =SB800_DEVNAME ; +/* +* On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of +* EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory +* region, it also enables the watchdog itself. +*/
drivers/watchdog/sp5100_tco.c static int sp5100_tco_setupdevice(struct device *dev, · line 264
Quoted 10 lines
drivers/watchdog/sp5100_tco.c +7
-0+if (boot_cpu_data.x86 ==0x17 ) { + val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN ); +if (!(val &EFCH_PM_DECODEEN_WDT_TMREN )) { +sp5100_tco_update_pm_reg8 (EFCH_PM_DECODEEN ,0xff , +EFCH_PM_DECODEEN_WDT_TMREN ); + } + } val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN );if (val &EFCH_PM_DECODEEN_WDT_TMREN ) mmio_addr =EFCH_PM_WDT_ADDR ;
Won't that bring us EFCH_PM_WDT_ADDR as address, rather than EFCH_PM_ACPI_MMIO_ADDR which worked in my case? Or is one an alias of the other.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Jan Kiszka
Tested-byRe: [PATCH 2/2] watchdog: sp5100_tco: Enable watchdog on Family 17h devices if disabled
In reply to Jan KiszkaQuoted 59 lines · Jan Kiszka
Quoted 58 lines · Guenter Roeck
Hi Jan,
Quoted 54 lines · Jan Kiszka
Quoted 38 lines · Guenter Roeck
On Family 17h (Ryzen) devices, the WatchdogTmrEn bit of PmDecodeEn not only enables watchdog memory decoding at
0xfeb00000, it also enables the watchdog hardware itself. Use this information to enable the watchdog if it is not already enabled.Cc Jan Kiszka <[email protected]>Signed-off-by Guenter Roeck <[email protected]>--- drivers/watchdog/sp5100_tco.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)drivers/watchdog/sp5100_tco.c +11
-0@@ -17,6 +17,12 @@* AMD Publication 51192 "AMD Bolton FCH Register Reference Guide" * AMD Publication 52740 "BIOS and Kernel Developer’s Guide (BKDG) * for AMD Family 16h Models 30h-3Fh Processors" +* AMD Publication 55570-B1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 18h, Revision B1 +* Processors (PUB) +* AMD Publication 55772-A1-PUB "Processor Programming Reference (PPR) +* for AMD Family 17h Model 20h, Revision A1 +* Processors (PUB) */ /* @@ -241,6 +247,18 @@ static int sp5100_tco_setupdevice(struct device *dev,break ;case efch: dev_name =SB800_DEVNAME ; +/* +* On Family 17h devices, the EFCH_PM_DECODEEN_WDT_TMREN bit of +* EFCH_PM_DECODEEN not only enables the EFCH_PM_WDT_ADDR memory +* region, it also enables the watchdog itself. +*/ drivers/watchdog/sp5100_tco.c static int sp5100_tco_setupdevice(struct device *dev, · line 264
Quoted 10 lines
drivers/watchdog/sp5100_tco.c +7
-0+if (boot_cpu_data.x86 ==0x17 ) { + val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN ); +if (!(val &EFCH_PM_DECODEEN_WDT_TMREN )) { +sp5100_tco_update_pm_reg8 (EFCH_PM_DECODEEN ,0xff , +EFCH_PM_DECODEEN_WDT_TMREN ); + } + } val =sp5100_tco_read_pm_reg8 (EFCH_PM_DECODEEN );if (val &EFCH_PM_DECODEEN_WDT_TMREN ) mmio_addr =EFCH_PM_WDT_ADDR ;Won't that bring us
EFCH_PM_WDT_ADDRas address, rather thanEFCH_PM_ACPI_MMIO_ADDRwhich worked in my case? Or is one an alias of the other.
Quoted 9 lines
Quoted 3 lines
Yes, it does use
EFCH_PM_WDT_ADDR.EFCH_PM_ACPI_MMIO_ADDRworks as well, but is meant to be a fallback. Both point to the watchdog memory space.OK, will test, possibly only on the weekend, and confirm this also on my board.
Jan
Both patches now
Thanks,
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux