From 47ca43bcb4565a992bf527f68e1ff60fc036fd12 Mon Sep 17 00:00:00 2001 From: Sieu Mun Tang Date: Fri, 9 Jun 2023 23:33:36 +0800 Subject: [PATCH] feat(intel): restructure watchdog This patch is to restructure watchdog. Move platform dependent MACROs to individual platform socfpga_plat_def. Common watchdog code file and header file will remain for those common declaration. Change-Id: Ibb640f08ac313bbad6d9295596cb8ff26e3e626d Signed-off-by: Sieu Mun Tang --- plat/intel/soc/agilex/include/socfpga_plat_def.h | 5 +++++ plat/intel/soc/agilex5/include/socfpga_plat_def.h | 5 +++++ plat/intel/soc/common/drivers/wdt/watchdog.h | 7 ++----- plat/intel/soc/n5x/include/socfpga_plat_def.h | 5 +++++ plat/intel/soc/stratix10/include/socfpga_plat_def.h | 5 +++++ 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/plat/intel/soc/agilex/include/socfpga_plat_def.h b/plat/intel/soc/agilex/include/socfpga_plat_def.h index a744d0935..803e9146e 100644 --- a/plat/intel/soc/agilex/include/socfpga_plat_def.h +++ b/plat/intel/soc/agilex/include/socfpga_plat_def.h @@ -76,6 +76,11 @@ #define PLAT_UART0_BASE (0xFFC02000) #define PLAT_UART1_BASE (0xFFC02100) +/******************************************************************************* + * WDT related constants + ******************************************************************************/ +#define WDT_BASE (0xFFD00200) + /******************************************************************************* * GIC related constants ******************************************************************************/ diff --git a/plat/intel/soc/agilex5/include/socfpga_plat_def.h b/plat/intel/soc/agilex5/include/socfpga_plat_def.h index 8a49d613b..e900016d7 100644 --- a/plat/intel/soc/agilex5/include/socfpga_plat_def.h +++ b/plat/intel/soc/agilex5/include/socfpga_plat_def.h @@ -94,6 +94,11 @@ #define PLAT_UART0_BASE (0x10C02000) #define PLAT_UART1_BASE (0x10C02100) +/******************************************************************************* + * WDT related constants + ******************************************************************************/ +#define WDT_BASE (0x10D00200) + /******************************************************************************* * GIC related constants ******************************************************************************/ diff --git a/plat/intel/soc/common/drivers/wdt/watchdog.h b/plat/intel/soc/common/drivers/wdt/watchdog.h index 4ee4cff57..940ebf39f 100644 --- a/plat/intel/soc/common/drivers/wdt/watchdog.h +++ b/plat/intel/soc/common/drivers/wdt/watchdog.h @@ -7,11 +7,8 @@ #ifndef CAD_WATCHDOG_H #define CAD_WATCHDOG_H -#if PLATFORM_MODEL == PLAT_SOCFPGA_AGILEX5 -#define WDT_BASE (0x10D00200) -#else -#define WDT_BASE (0xFFD00200) -#endif +#include "socfpga_plat_def.h" + #define WDT_REG_SIZE_OFFSET (0x4) #define WDT_MIN_CYCLES (65536) #define WDT_PERIOD (20) diff --git a/plat/intel/soc/n5x/include/socfpga_plat_def.h b/plat/intel/soc/n5x/include/socfpga_plat_def.h index a06bbc4c5..ae0229f86 100644 --- a/plat/intel/soc/n5x/include/socfpga_plat_def.h +++ b/plat/intel/soc/n5x/include/socfpga_plat_def.h @@ -77,6 +77,11 @@ #define PLAT_UART0_BASE (0xFFC02000) #define PLAT_UART1_BASE (0xFFC02100) +/******************************************************************************* + * WDT related constants + ******************************************************************************/ +#define WDT_BASE (0xFFD00200) + /******************************************************************************* * GIC related constants ******************************************************************************/ diff --git a/plat/intel/soc/stratix10/include/socfpga_plat_def.h b/plat/intel/soc/stratix10/include/socfpga_plat_def.h index 7c9f15acf..148cbb9ea 100644 --- a/plat/intel/soc/stratix10/include/socfpga_plat_def.h +++ b/plat/intel/soc/stratix10/include/socfpga_plat_def.h @@ -75,6 +75,11 @@ #define PLAT_UART0_BASE (0xFFC02000) #define PLAT_UART1_BASE (0xFFC02100) +/******************************************************************************* + * WDT related constants + ******************************************************************************/ +#define WDT_BASE (0xFFD00200) + /******************************************************************************* * GIC related constants ******************************************************************************/