ARM: OMAP: hwmod: Use sysc_fields->srst_shift and get rid of hardcoded SYSC_TYPE2_SOFTRESET_MASK
Subsystems (4)
PATCH 1/1 ARM: OMAP: hwmod: Use sysc_fields->srst_shift and get rid of hardcoded SYSC_TYPE2_SOFTRESET_MASK
This is useful when we have broken type2 compliant IPs' where the softreset shift is not the same as SYSC_TYPE2_SOFTRESET_SHIFT and hence is overridden using sysc_fields->srst_shift.
We have atleast one such instance now with onchip keypad on OMAP5 which has a different softreset shift as compared to other type2 IPs'.
---
Paul,
I based the patch on top of your reset/data cleanup series for hwmod. So its based on 'hwmod_data_cleanup_3.4' branch.
regards,
Rajendra
arch/arm/mach-omap2/omap_hwmod.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +5 -3
@@ -1524,7 +1524,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)*/ static int _ocp_softreset (struct omap_hwmod *oh) { -u32 v; +u32 v, softrst_mask;int c =0 ;int ret =0 ;
@@ -1559,11 +1559,13 @@ static int _ocp_softreset(struct omap_hwmod *oh) oh->class->sysc->syss_offs) & SYSS_RESETDONE_MASK), MAX_MODULE_SOFTRESET_WAIT, c); - else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) + else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) { + softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);omap_test_timeout (!(omap_hwmod_read (oh, oh->class->sysc->sysc_offs) - & SYSC_TYPE2_SOFTRESET_MASK), + & softrst_mask),MAX_MODULE_SOFTRESET_WAIT , c); + }if (c ==MAX_MODULE_SOFTRESET_WAIT ) pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",
Signature · 1 line
1.7.1
PATCH 1/1 ARM: OMAP: hwmod: Use sysc_fields->srst_shift and get rid of hardcoded SYSC_TYPE2_SOFTRESET_MASK
Quoted 5 lines · Rajendra Nayak
This is useful when we have broken type2 compliant IPs' where the softreset shift is not the same as
SYSC_TYPE2_SOFTRESET_SHIFTand hence is overridden usingsysc_fields->srst_shift.We have atleast one such instance now with onchip keypad on OMAP5
Nit: space is missing.
Quoted 2 lines
which has a different softreset shift as compared to other type2 IPs'.
A broken IP again :-)
That's anyway a good fix since the srst_shift was already configurable, so having a hard-coded mask was wrong or at least error prone for non standard IP.
Quoted 36 lines
Signed-off-by Rajendra Nayak<[email protected]>Cc Paul Walmsley<[email protected]>Cc Benoit Cousson<[email protected]>Cc Balaji TK<[email protected]>Tested-by Sourav Poddar<[email protected]>---
Paul,I based the patch on top of your reset/data cleanup series for hwmod. So its based on 'hwmod_data_cleanup_3.4' branch.
regards,
Rajendraarch/arm/mach-omap2/omap_hwmod.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)arch/arm/mach-omap2/omap_hwmod.c +2
-2@@ -1524,7 +1524,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)*/ static int _ocp_softreset (struct omap_hwmod *oh) { -u32 v; +u32 v, softrst_mask;int c =0 ;int ret =0 ;@@ -1559,11 +1559,13 @@ static int _ocp_softreset(struct omap_hwmod *oh) oh->class->sysc->syss_offs) & SYSS_RESETDONE_MASK), MAX_MODULE_SOFTRESET_WAIT, c); - else if (oh->class->sysc->sysc_flags& SYSC_HAS_RESET_STATUS) + else if (oh->class->sysc->sysc_flags& SYSC_HAS_RESET_STATUS) {
arch/arm/mach-omap2/omap_hwmod.c static int _ocp_softreset(struct omap_hwmod *oh) · line 1571
Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod.c +3
-1+ softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift);omap_test_timeout (!(omap_hwmod_read (oh, oh->class->sysc->sysc_offs) - &SYSC_TYPE2_SOFTRESET_MASK ), + & softrst_mask),MAX_MODULE_SOFTRESET_WAIT , c); + }if (c ==MAX_MODULE_SOFTRESET_WAIT ) pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n",
Thanks,
Benoit
Paul Walmsley
maintainerPATCH 1/1 ARM: OMAP: hwmod: Use sysc_fields->srst_shift and get rid of hardcoded SYSC_TYPE2_SOFTRESET_MASK
In reply to Rajendra NayakQuoted 13 lines · Rajendra Nayak
This is useful when we have broken type2 compliant IPs' where the softreset shift is not the same as
SYSC_TYPE2_SOFTRESET_SHIFTand hence is overridden usingsysc_fields->srst_shift.We have atleast one such instance now with onchip keypad on OMAP5 which has a different softreset shift as compared to other type2 IPs'.
Signed-off-by Rajendra Nayak <[email protected]>Cc Paul Walmsley <[email protected]>Cc Benoit Cousson <[email protected]>Cc Balaji TK <[email protected]>Tested-by Sourav Poddar <[email protected]>
Quoted 5 lines
---
Paul,I based the patch on top of your reset/data cleanup series for hwmod. So its based on 'hwmod_data_cleanup_3.4' branch.
Thanks, Beno?t's ack added and queued.
- Paul