[U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT

2019-07-20 Thread sbabic
> Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
> while the full U-Boot can use rich DM/DT WDT driver.
> Signed-off-by: Marek Vasut 
> Cc: Peng Fan 
> Cc: Stefano Babic 
> Tested-by: Heiko Schocher 
> Tested-by: Suniel Mahesh 

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT

2019-07-11 Thread Suniel Mahesh
On 02/07/19 01:55, Marek Vasut wrote:
> On 7/1/19 8:45 AM, Suniel Mahesh wrote:
>> Hi Marek,
>>
>> May I know if this patch series is still under review ?
> 
> I guess Stefano is taking them for next ... or ?
> 

Hi Marek/Stefano,

Because of this entry "Make SPL_WATCHDOG_SUPPORT imply SPL_WDT if !HW_WATCHDOG",
SPL_WDT is getting enabled by default, when board configuration is done.

For AM335X based beaglebone black, we dont need SPL_WDT, as the built image is 
getting
too big to fit into SRAM.

Is it fine if I disable SPL_WDT in board defconfig file ? used the following 
entry in defconfig
# CONFIG_SPL_WDT is not set (couldn't find a proper place to disable it, except 
in defconfig)

with this the build is fine and board boots.

Tested on the beaglebone black board.

Tested-by: Suniel Mahesh 

Thanks
Sunil
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT

2019-07-08 Thread Suniel Mahesh
On 02/07/19 01:55, Marek Vasut wrote:
> On 7/1/19 8:45 AM, Suniel Mahesh wrote:
>> Hi Marek,
>>
>> May I know if this patch series is still under review ?
> 
> I guess Stefano is taking them for next ... or ?
> 
Hi Marek,

Because of this change set applied to u-boot, this patch might not apply, 
especially
changes in common/board_r.c (please verify)

# 84b2416b6a0531a9ad46a4e445e558f183c50171
board_r: move initr_watchdog to be called after initr_serial

Reported by: Suniel Mahesh 

Thanks and Regards
Sunil
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT

2019-07-01 Thread Marek Vasut
On 7/1/19 8:45 AM, Suniel Mahesh wrote:
> Hi Marek,
> 
> May I know if this patch series is still under review ?

I guess Stefano is taking them for next ... or ?

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT

2019-07-01 Thread Suniel Mahesh
Hi Marek,

May I know if this patch series is still under review ?

I have converted OMAP3 watchdog driver into driver model for TI AM33XX based 
SOC and tested corresponding
patches on BeagleBone Black board.

Because of SPL size constraints, I have to disable driver model for watchdog in 
SPL. Some of the changes I
have done are in agreement with your work and I thought it would be better to 
pause until this change set gets
accepted(avoiding patch duplication), especially changes in :

common/spl/spl.c
drivers/watchdog/Kconfig
drivers/watchdog/Makefile

These changes are tested on AM335X based BeagleBone Black, and they look good.

Regards
-- 
Suniel Mahesh
Embedded Linux, Kernel & U-Boot engineer
https://github.com/sunielmahesh
www.tuxtrons.com
https://github.com/techveda
Hyderabad, India
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT

2019-06-11 Thread Heiko Schocher

Hello Marek,

Am 09.06.2019 um 03:46 schrieb Marek Vasut:

Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
while the full U-Boot can use rich DM/DT WDT driver.

Signed-off-by: Marek Vasut 
Cc: Peng Fan 
Cc: Stefano Babic 
---
V2: - Make SPL_WATCHDOG_SUPPORT imply SPL_WDT if !HW_WATCHDOG
 - Add SPL_WDT Kconfig entry
---
  common/board_r.c  | 2 +-
  common/spl/Kconfig| 1 +
  common/spl/spl.c  | 2 +-
  drivers/watchdog/Kconfig  | 7 +++
  drivers/watchdog/Makefile | 2 +-
  include/asm-generic/global_data.h | 2 +-
  include/wdt.h | 2 +-
  7 files changed, 13 insertions(+), 5 deletions(-)


Tested on the aristainetos board.

Tested-by: Heiko Schocher 

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH V2 1/2] watchdog: Split WDT from SPL_WDT

2019-06-08 Thread Marek Vasut
Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM,
while the full U-Boot can use rich DM/DT WDT driver.

Signed-off-by: Marek Vasut 
Cc: Peng Fan 
Cc: Stefano Babic 
---
V2: - Make SPL_WATCHDOG_SUPPORT imply SPL_WDT if !HW_WATCHDOG
- Add SPL_WDT Kconfig entry
---
 common/board_r.c  | 2 +-
 common/spl/Kconfig| 1 +
 common/spl/spl.c  | 2 +-
 drivers/watchdog/Kconfig  | 7 +++
 drivers/watchdog/Makefile | 2 +-
 include/asm-generic/global_data.h | 2 +-
 include/wdt.h | 2 +-
 7 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 150e8cd424..988e40abb2 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -678,7 +678,7 @@ static init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_DM
initr_dm,
 #endif
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
initr_watchdog,
 #endif
 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index c7cd34449a..09761b1db7 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -876,6 +876,7 @@ endif
 
 config SPL_WATCHDOG_SUPPORT
bool "Support watchdog drivers"
+   imply SPL_WDT if !HW_WATCHDOG
help
  Enable support for watchdog drivers in SPL. A watchdog is
  typically a hardware peripheral which can reset the system when it
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4ddeff9b51..c595697fc5 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -603,7 +603,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
spl_board_init();
 #endif
 
-#if defined(CONFIG_SPL_WATCHDOG_SUPPORT) && defined(CONFIG_WDT)
+#if defined(CONFIG_SPL_WATCHDOG_SUPPORT) && CONFIG_IS_ENABLED(WDT)
initr_watchdog();
 #endif
 
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index b01dbc446d..0330a3b3a1 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -161,4 +161,11 @@ config WDT_MPC8xx
help
   Select this to enable mpc8xx watchdog timer
 
+config SPL_WDT
+   bool "Enable driver model for watchdog timer drivers in SPL"
+   depends on SPL_DM
+   help
+ Enable driver model for watchdog timer in SPL.
+ This is similar to CONFIG_WDT in U-Boot.
+
 endmenu
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 6f20e73810..fe8023bda2 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -16,7 +16,7 @@ obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
 obj-$(CONFIG_TANGIER_WATCHDOG) += tangier_wdt.o
 obj-$(CONFIG_ULP_WATCHDOG) += ulp_wdog.o
-obj-$(CONFIG_WDT) += wdt-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)WDT) += wdt-uclass.o
 obj-$(CONFIG_WDT_SANDBOX) += sandbox_wdt.o
 obj-$(CONFIG_WDT_ARMADA_37XX) += armada-37xx-wdt.o
 obj-$(CONFIG_WDT_ASPEED) += ast_wdt.o
diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index 02a3ed6838..7c2220643b 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -137,7 +137,7 @@ typedef struct global_data {
 #if defined(CONFIG_TRANSLATION_OFFSET)
fdt_addr_t translation_offset;  /* optional translation offset */
 #endif
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
struct udevice *watchdog_dev;
 #endif
 } gd_t;
diff --git a/include/wdt.h b/include/wdt.h
index aa77d3e9b4..5bcff24ab3 100644
--- a/include/wdt.h
+++ b/include/wdt.h
@@ -106,7 +106,7 @@ struct wdt_ops {
int (*expire_now)(struct udevice *dev, ulong flags);
 };
 
-#if defined(CONFIG_WDT)
+#if CONFIG_IS_ENABLED(WDT)
 #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS  (60 * 1000)
 #endif
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot