linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake
       [not found] <1463541972-19758-1-git-send-email-jonathan.yong@intel.com>
@ 2016-06-17  0:36 ` Yong, Jonathan
  2016-06-17  0:36   ` [PATCH v2 1/2] watchdog: iTCO-wdt handle 5th variation " Yong, Jonathan
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yong, Jonathan @ 2016-06-17  0:36 UTC (permalink / raw)
  To: linux-watchdog, platform-driver-x86
  Cc: qipeng.zha, linux, dvhart, linux-kernel, jonathan.yong

These patches fix the iTCO watchdog for Apollo Lake.
I changed the watchdog memory io to only use 4 bytes rather
the whole region, I'm not sure if that is the correct way.

The previous 0x30h offset in intel_pmc_ipc.c was for based
on the earlier BXT-M platform. Apollo Lake has it at 0x40h.

Let me know if the patches need changes.
Please CC me as I am not subscribed, thanks.

* Resent, typo in linux-kernel email address

Changes since v1:
	* Watchdog NO_REBOOT bit off-by-one corrected.

Yong, Jonathan (2):
  watchdog: iTCO-wdt handle 5th variation for Apollo Lake
  x86: Fix Apollo Lake Watchdog address in PMC driver

 drivers/platform/x86/intel_pmc_ipc.c | 10 ++++++----
 drivers/watchdog/iTCO_wdt.c          |  2 ++
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.7.3

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

* [PATCH v2 1/2] watchdog: iTCO-wdt handle 5th variation for Apollo Lake
  2016-06-17  0:36 ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
@ 2016-06-17  0:36   ` Yong, Jonathan
  2016-06-17  0:36   ` [PATCH v2 2/2] x86: Fix Apollo Lake Watchdog address in PMC driver Yong, Jonathan
  2016-06-22  4:53   ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
  2 siblings, 0 replies; 7+ messages in thread
From: Yong, Jonathan @ 2016-06-17  0:36 UTC (permalink / raw)
  To: linux-watchdog, platform-driver-x86
  Cc: qipeng.zha, linux, dvhart, linux-kernel, jonathan.yong

The Apollo Lake Watchdog has the no_reboot flag in the 4th bit.

Signed-off-by: Yong, Jonathan <jonathan.yong@intel.com>
---
 drivers/watchdog/iTCO_wdt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index 0acc6c5..54cab18 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -150,6 +150,7 @@ static inline u32 no_reboot_bit(void)
 	u32 enable_bit;
 
 	switch (iTCO_wdt_private.iTCO_version) {
+	case 5:
 	case 3:
 		enable_bit = 0x00000010;
 		break;
@@ -512,6 +513,7 @@ static int iTCO_wdt_probe(struct platform_device *dev)
 
 	/* Clear out the (probably old) status */
 	switch (iTCO_wdt_private.iTCO_version) {
+	case 5:
 	case 4:
 		outw(0x0008, TCO1_STS);	/* Clear the Time Out Status bit */
 		outw(0x0002, TCO2_STS);	/* Clear SECOND_TO_STS bit */
-- 
2.7.3

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

* [PATCH v2 2/2] x86: Fix Apollo Lake Watchdog address in PMC driver
  2016-06-17  0:36 ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
  2016-06-17  0:36   ` [PATCH v2 1/2] watchdog: iTCO-wdt handle 5th variation " Yong, Jonathan
@ 2016-06-17  0:36   ` Yong, Jonathan
  2016-06-22  4:53   ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
  2 siblings, 0 replies; 7+ messages in thread
From: Yong, Jonathan @ 2016-06-17  0:36 UTC (permalink / raw)
  To: linux-watchdog, platform-driver-x86
  Cc: qipeng.zha, linux, dvhart, linux-kernel, jonathan.yong

The TCO I/O base is 40h rather than the usual 30h, and the re_reboot
bit is at ACPIBASE+8.

Signed-off-by: Yong, Jonathan <jonathan.yong@intel.com>
---
 drivers/platform/x86/intel_pmc_ipc.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c
index 6f497e8..b86e1bc 100644
--- a/drivers/platform/x86/intel_pmc_ipc.c
+++ b/drivers/platform/x86/intel_pmc_ipc.c
@@ -85,7 +85,7 @@
  * platform device and to export resources for those functions.
  */
 #define TCO_DEVICE_NAME			"iTCO_wdt"
-#define SMI_EN_OFFSET			0x30
+#define SMI_EN_OFFSET			0x40
 #define SMI_EN_SIZE			4
 #define TCO_BASE_OFFSET			0x60
 #define TCO_REGS_SIZE			16
@@ -94,6 +94,8 @@
 #define TELEM_SSRAM_SIZE		240
 #define TELEM_PMC_SSRAM_OFFSET		0x1B00
 #define TELEM_PUNIT_SSRAM_OFFSET	0x1A00
+#define TCO_PMC_OFFSET			0x8
+#define TCO_PMC_SIZE			0x4
 
 static const int iTCO_version = 3;
 
@@ -502,7 +504,7 @@ static struct resource tco_res[] = {
 
 static struct itco_wdt_platform_data tco_info = {
 	.name = "Apollo Lake SoC",
-	.version = 3,
+	.version = 5,
 };
 
 #define TELEMETRY_RESOURCE_PUNIT_SSRAM	0
@@ -572,8 +574,8 @@ static int ipc_create_tco_device(void)
 	res->end = res->start + SMI_EN_SIZE - 1;
 
 	res = tco_res + TCO_RESOURCE_GCR_MEM;
-	res->start = ipcdev.gcr_base;
-	res->end = res->start + ipcdev.gcr_size - 1;
+	res->start = ipcdev.gcr_base + TCO_PMC_OFFSET;
+	res->end = res->start + TCO_PMC_SIZE - 1;
 
 	ret = platform_device_add_resources(pdev, tco_res, ARRAY_SIZE(tco_res));
 	if (ret) {
-- 
2.7.3

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

* Re: [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake
  2016-06-17  0:36 ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
  2016-06-17  0:36   ` [PATCH v2 1/2] watchdog: iTCO-wdt handle 5th variation " Yong, Jonathan
  2016-06-17  0:36   ` [PATCH v2 2/2] x86: Fix Apollo Lake Watchdog address in PMC driver Yong, Jonathan
@ 2016-06-22  4:53   ` Yong, Jonathan
  2016-06-22  6:01     ` Guenter Roeck
  2 siblings, 1 reply; 7+ messages in thread
From: Yong, Jonathan @ 2016-06-22  4:53 UTC (permalink / raw)
  To: linux-watchdog, platform-driver-x86
  Cc: qipeng.zha, linux, dvhart, linux-kernel

On 06/17/2016 08:36, Yong, Jonathan wrote:
> These patches fix the iTCO watchdog for Apollo Lake.
> I changed the watchdog memory io to only use 4 bytes rather
> the whole region, I'm not sure if that is the correct way.
>
> The previous 0x30h offset in intel_pmc_ipc.c was for based
> on the earlier BXT-M platform. Apollo Lake has it at 0x40h.
>
> Let me know if the patches need changes.
> Please CC me as I am not subscribed, thanks.
>
> * Resent, typo in linux-kernel email address
>
> Changes since v1:
> 	* Watchdog NO_REBOOT bit off-by-one corrected.
>
> Yong, Jonathan (2):
>    watchdog: iTCO-wdt handle 5th variation for Apollo Lake
>    x86: Fix Apollo Lake Watchdog address in PMC driver
>
>   drivers/platform/x86/intel_pmc_ipc.c | 10 ++++++----
>   drivers/watchdog/iTCO_wdt.c          |  2 ++
>   2 files changed, 8 insertions(+), 4 deletions(-)
>

Ping.

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

* Re: [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake
  2016-06-22  4:53   ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
@ 2016-06-22  6:01     ` Guenter Roeck
  2016-06-23  5:02       ` Darren Hart
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2016-06-22  6:01 UTC (permalink / raw)
  To: Yong, Jonathan, linux-watchdog, platform-driver-x86
  Cc: qipeng.zha, dvhart, linux-kernel

On 06/21/2016 09:53 PM, Yong, Jonathan wrote:
> On 06/17/2016 08:36, Yong, Jonathan wrote:
>> These patches fix the iTCO watchdog for Apollo Lake.
>> I changed the watchdog memory io to only use 4 bytes rather
>> the whole region, I'm not sure if that is the correct way.
>>
>> The previous 0x30h offset in intel_pmc_ipc.c was for based
>> on the earlier BXT-M platform. Apollo Lake has it at 0x40h.
>>
>> Let me know if the patches need changes.
>> Please CC me as I am not subscribed, thanks.
>>
>> * Resent, typo in linux-kernel email address
>>
>> Changes since v1:
>>     * Watchdog NO_REBOOT bit off-by-one corrected.
>>
>> Yong, Jonathan (2):
>>    watchdog: iTCO-wdt handle 5th variation for Apollo Lake
>>    x86: Fix Apollo Lake Watchdog address in PMC driver
>>
>>   drivers/platform/x86/intel_pmc_ipc.c | 10 ++++++----
>>   drivers/watchdog/iTCO_wdt.c          |  2 ++
>>   2 files changed, 8 insertions(+), 4 deletions(-)
>>
>
> Ping.
>
>
Waiting for an Ack from Darren.

Guenter

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

* Re: [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake
  2016-06-22  6:01     ` Guenter Roeck
@ 2016-06-23  5:02       ` Darren Hart
  2016-06-23 13:37         ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Darren Hart @ 2016-06-23  5:02 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Yong, Jonathan, linux-watchdog, platform-driver-x86, qipeng.zha,
	linux-kernel

On Tue, Jun 21, 2016 at 11:01:01PM -0700, Guenter Roeck wrote:
> On 06/21/2016 09:53 PM, Yong, Jonathan wrote:
> > On 06/17/2016 08:36, Yong, Jonathan wrote:
> > > These patches fix the iTCO watchdog for Apollo Lake.
> > > I changed the watchdog memory io to only use 4 bytes rather
> > > the whole region, I'm not sure if that is the correct way.
> > > 
> > > The previous 0x30h offset in intel_pmc_ipc.c was for based
> > > on the earlier BXT-M platform. Apollo Lake has it at 0x40h.
> > > 
> > > Let me know if the patches need changes.
> > > Please CC me as I am not subscribed, thanks.
> > > 
> > > * Resent, typo in linux-kernel email address
> > > 
> > > Changes since v1:
> > >     * Watchdog NO_REBOOT bit off-by-one corrected.
> > > 
> > > Yong, Jonathan (2):
> > >    watchdog: iTCO-wdt handle 5th variation for Apollo Lake
> > >    x86: Fix Apollo Lake Watchdog address in PMC driver
> > > 
> > >   drivers/platform/x86/intel_pmc_ipc.c | 10 ++++++----
> > >   drivers/watchdog/iTCO_wdt.c          |  2 ++
> > >   2 files changed, 8 insertions(+), 4 deletions(-)
> > > 
> > 
> > Ping.
> > 
> > 
> Waiting for an Ack from Darren.

Jonathan verified that the change will not break existing external platforms.
I'm happy with it from that perspective.

Guenter, will you take both patches together?

Reviewed-by: Darren Hart <dvhart@linux.intel.com>


-- 
Darren Hart
Intel Open Source Technology Center

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

* Re: [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake
  2016-06-23  5:02       ` Darren Hart
@ 2016-06-23 13:37         ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2016-06-23 13:37 UTC (permalink / raw)
  To: Darren Hart
  Cc: Yong, Jonathan, linux-watchdog, platform-driver-x86, qipeng.zha,
	linux-kernel

On 06/22/2016 10:02 PM, Darren Hart wrote:
> On Tue, Jun 21, 2016 at 11:01:01PM -0700, Guenter Roeck wrote:
>> On 06/21/2016 09:53 PM, Yong, Jonathan wrote:
>>> On 06/17/2016 08:36, Yong, Jonathan wrote:
>>>> These patches fix the iTCO watchdog for Apollo Lake.
>>>> I changed the watchdog memory io to only use 4 bytes rather
>>>> the whole region, I'm not sure if that is the correct way.
>>>>
>>>> The previous 0x30h offset in intel_pmc_ipc.c was for based
>>>> on the earlier BXT-M platform. Apollo Lake has it at 0x40h.
>>>>
>>>> Let me know if the patches need changes.
>>>> Please CC me as I am not subscribed, thanks.
>>>>
>>>> * Resent, typo in linux-kernel email address
>>>>
>>>> Changes since v1:
>>>>      * Watchdog NO_REBOOT bit off-by-one corrected.
>>>>
>>>> Yong, Jonathan (2):
>>>>     watchdog: iTCO-wdt handle 5th variation for Apollo Lake
>>>>     x86: Fix Apollo Lake Watchdog address in PMC driver
>>>>
>>>>    drivers/platform/x86/intel_pmc_ipc.c | 10 ++++++----
>>>>    drivers/watchdog/iTCO_wdt.c          |  2 ++
>>>>    2 files changed, 8 insertions(+), 4 deletions(-)
>>>>
>>>
>>> Ping.
>>>
>>>
>> Waiting for an Ack from Darren.
>
> Jonathan verified that the change will not break existing external platforms.
> I'm happy with it from that perspective.
>
> Guenter, will you take both patches together?
>

Yes, I'll add them to my queue of patches to send to Wim.

Thanks,
Guenter

> Reviewed-by: Darren Hart <dvhart@linux.intel.com>
>
>

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

end of thread, other threads:[~2016-06-23 13:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1463541972-19758-1-git-send-email-jonathan.yong@intel.com>
2016-06-17  0:36 ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
2016-06-17  0:36   ` [PATCH v2 1/2] watchdog: iTCO-wdt handle 5th variation " Yong, Jonathan
2016-06-17  0:36   ` [PATCH v2 2/2] x86: Fix Apollo Lake Watchdog address in PMC driver Yong, Jonathan
2016-06-22  4:53   ` [PATCH v2 0/2] Correct iTCO Watchdog for Apollo Lake Yong, Jonathan
2016-06-22  6:01     ` Guenter Roeck
2016-06-23  5:02       ` Darren Hart
2016-06-23 13:37         ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).