Skip to contentSkip to conversation

omap: hwmod: add syss reset done flags to omap2, omap3 hwmods

PATCH In review Avinash.H.M 4 participants 18 messages Feb 24, 2011 – Mar 31, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap: hwmod: add syss reset done flags to omap2, omap3 hwmods

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Cc Rajendra Nayak <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>

---
The patch is based on linux-omap tree, master branch on commit:
e10eed954a2525c5d0b6dc361cdcbb46fea69d50

Testing:
build testing : omap2plus_defconfig
boot testing : 2420h4, 2430sdp.
[ boot test was done on omap-fixes-for-linus branch, commit 1232a185ddd500b61b8dc389ad1a357e6b425548 , since master branch wasn't booting on 2420 and 2430 ].

pm testing : tested core off in cpuidle patch in 3430sdp.
[ kevins 'i2c: OMAP: fix static suspend vs. runtime suspend' fix was needed to have core off working. ]. core off works in cpuidle patch.

below configurations needed for core off in cpuidle:
echo 1 > /debug/pm_debug/sleep_while_idle
echo 1 > /debug/pm_debug/enable_off_mode
echo 5 > /sys/devices/platform/omap/omap_uart.0/sleep_timeout echo 5 > /sys/devices/platform/omap/omap_uart.1/sleep_timeout echo 5 > /sys/devices/platform/omap/omap_uart.2/sleep_timeout echo enabled > /sys/devices/platform/omap/omap_uart.0/tty/ttyO0/power/wakeup echo enabled > /sys/devices/platform/omap/omap_uart.1/tty/ttyO1/power/wakeup echo enabled > /sys/devices/platform/omap/omap_uart.2/tty/ttyO2/power/wakeup

 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   11 ++++++-----
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   12 +++++++-----
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   13 ++++++++-----
 3 files changed, 21 insertions(+), 15 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +6 -5
index b85c630..e8046b4 100644
@@ -308,7 +308,7 @@ static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
 	.sysc_offs	= 0x0010,
 	.syss_offs	= 0x0014,
 	.sysc_flags	= (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
 
@@ -349,7 +349,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = {
 	.syss_offs	= 0x58,
 	.sysc_flags	= (SYSC_HAS_SIDLEMODE |
 			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -475,7 +475,7 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
 	.rev_offs	= 0x00,
 	.sysc_offs	= 0x20,
 	.syss_offs	= 0x10,
-	.sysc_flags	= SYSC_HAS_SOFTRESET,
+	.sysc_flags	= (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
 	.sysc_fields	= &omap_hwmod_sysc_type1,
 };
 
@@ -647,7 +647,8 @@ static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = {
 	.sysc_offs	= 0x0010,
 	.syss_offs	= 0x0014,
 	.sysc_flags	= (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
-			   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
+			   SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -789,7 +790,7 @@ static struct omap_hwmod_class_sysconfig omap2420_dma_sysc = {
 	.syss_offs	= 0x0028,
 	.sysc_flags	= (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
 			   SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
 	.sysc_fields	= &omap_hwmod_sysc_type1,
 };
arch/arm/mach-omap2/omap_hwmod_2430_data.c +7 -5
index 8ecfbcd..115eed5 100644
@@ -307,7 +307,7 @@ static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
 	.sysc_offs	= 0x0010,
 	.syss_offs	= 0x0014,
 	.sysc_flags	= (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
 
@@ -348,7 +348,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = {
 	.syss_offs	= 0x58,
 	.sysc_flags	= (SYSC_HAS_SIDLEMODE |
 			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -474,7 +474,8 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
 	.rev_offs	= 0x00,
 	.sysc_offs	= 0x20,
 	.syss_offs	= 0x10,
-	.sysc_flags	= (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+	.sysc_flags	= (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
+			   SYSS_HAS_RESET_STATUS),
 	.sysc_fields	= &omap_hwmod_sysc_type1,
 };
 
@@ -672,7 +673,8 @@ static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
 	.sysc_offs	= 0x0010,
 	.syss_offs	= 0x0014,
 	.sysc_flags	= (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
-			   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
+			   SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -844,7 +846,7 @@ static struct omap_hwmod_class_sysconfig omap2430_dma_sysc = {
 	.syss_offs	= 0x0028,
 	.sysc_flags	= (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
 			   SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
 	.sysc_fields	= &omap_hwmod_sysc_type1,
 };
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +8 -5
index 8d81813..acf0d54 100644
@@ -447,7 +447,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_wd_timer_sysc = {
 	.syss_offs	= 0x0014,
 	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE |
 			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
-			   SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY),
+			   SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
+			   SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -459,7 +460,7 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
 	.syss_offs	= 0x10,
 	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
 			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -501,7 +502,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = {
 	.syss_offs	= 0x58,
 	.sysc_flags	= (SYSC_HAS_SIDLEMODE |
 			   SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
-			   SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -902,7 +903,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
 	.sysc_offs	= 0x0010,
 	.syss_offs	= 0x0014,
 	.sysc_flags	= (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
-			   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
+			   SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 	.sysc_fields    = &omap_hwmod_sysc_type1,
 };
@@ -1156,7 +1158,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_dma_sysc = {
 	.syss_offs	= 0x0028,
 	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
 			   SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
-			   SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE),
+			   SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE |
+			   SYSS_HAS_RESET_STATUS),
 	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
 			   MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
 	.sysc_fields	= &omap_hwmod_sysc_type1,
Signature · 1 line
1.7.1
maintainer
#1 lore raw
Quoted 6 lines · Avinash.H.M

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Quoted 6 lines
Cc Rajendra Nayak <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>

Thanks, queued for 2.6.39.

- Paul

#2 lore raw
Quoted 8 lines · Paul Walmsley
Quoted 6 lines · Avinash.H.M

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Quoted 8 lines
Quoted 6 lines
Cc Rajendra Nayak <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>

Thanks, queued for 2.6.39.

Thanks very much Paul.

br
- avinash

Quoted 3 lines

- Paul

maintainer
#3 lore raw

Hi Avinash,

Quoted 8 lines
Quoted 8 lines · Avinash.H.M
Quoted 7 lines

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Cc Rajendra Nayak <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>

This patch is causing I2C softreset timeouts in the hwmod layer on OMAP2 and 3. Could you please take a look at this and figure out what is going on?

thanks,

- Paul

#4 lore raw
Quoted 1 line · Paul Walmsley

Hi Avinash,

Hi Paul,

Quoted 16 lines
Quoted 9 lines
Quoted 9 lines · Avinash.H.M
Quoted 7 lines

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Cc Rajendra Nayak <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>
Quoted 3 lines

This patch is causing I2C softreset timeouts in the hwmod layer on OMAP2 and 3. Could you please take a look at this and figure out what is going on?

I ll start looking at this. I have a 3430 ES3.1 SDP, where i will check the difference in behaviour with this patch.

BTW, is there a test case which i should run to produce 'I2C softreset timeouts' ? Can you give more information on how to reproduce the issue ?.

br,

- avinash

Quoted 4 lines

thanks,

- Paul

#5 lore raw
Quoted 1 line · Avinash.H.M.

On Thu, Mar 24, 2011 at 11:38:15PM -0600, Paul Walmsley wrote:

[snip]

Quoted 10 lines

This patch is causing I2C softreset timeouts in the hwmod layer on OMAP2

Quoted 2 lines

and 3. Could you please take a look at this and figure out what is going on?

I ll start looking at this. I have a 3430 ES3.1 SDP, where i will check the difference in behaviour with this patch.

BTW, is there a test case which i should run to produce 'I2C softreset timeouts' ? Can you give more information on how to reproduce the issue ?.

Hi paul,

I am able to reproduce the issue. I am seeing the timeout prints for i2c, gpio during bootup. I ll check why softreset is failing.

[    0.208892] omap_hwmod: i2c1: softreset failed (waited 10000 usec)
[    0.223114] omap_hwmod: i2c2: softreset failed (waited 10000 usec)
[    0.237335] omap_hwmod: i2c3: softreset failed (waited 10000 usec)
[    0.251525] omap_hwmod: gpio2: softreset failed (waited 10000 usec)
[    0.265594] omap_hwmod: gpio3: softreset failed (waited 10000 usec)
[    0.279693] omap_hwmod: gpio4: softreset failed (waited 10000 usec)
[    0.293762] omap_hwmod: gpio5: softreset failed (waited 10000 usec)
[    0.307861] omap_hwmod: gpio6: softreset failed (waited 10000 usec)

br,

- avinash

Quoted 1 line
maintainer
#6 lore raw
Quoted 5 lines · Avinash.H.M.

On Fri, Mar 25, 2011 at 11:56:34AM +0530, Avinash.H.M. wrote:

I am able to reproduce the issue. I am seeing the timeout prints for i2c, gpio during bootup. I ll check why softreset is failing.

Quoted 8 lines
[    0.208892] omap_hwmod: i2c1: softreset failed (waited 10000 usec)
[    0.223114] omap_hwmod: i2c2: softreset failed (waited 10000 usec)
[    0.237335] omap_hwmod: i2c3: softreset failed (waited 10000 usec)
[    0.251525] omap_hwmod: gpio2: softreset failed (waited 10000 usec)
[    0.265594] omap_hwmod: gpio3: softreset failed (waited 10000 usec)
[    0.279693] omap_hwmod: gpio4: softreset failed (waited 10000 usec)
[    0.293762] omap_hwmod: gpio5: softreset failed (waited 10000 usec)
[    0.307861] omap_hwmod: gpio6: softreset failed (waited 10000 usec)

Just FYI, I don't see the gpio softreset failures on my boards here.

- Paul

#7 lore raw
Quoted 16 lines · Paul Walmsley
Quoted 5 lines · Avinash.H.M.

On Fri, Mar 25, 2011 at 11:56:34AM +0530, Avinash.H.M. wrote:

I am able to reproduce the issue. I am seeing the timeout prints for i2c, gpio during bootup. I ll check why softreset is failing.

Quoted 8 lines
[    0.208892] omap_hwmod: i2c1: softreset failed (waited 10000 usec)
[    0.223114] omap_hwmod: i2c2: softreset failed (waited 10000 usec)
[    0.237335] omap_hwmod: i2c3: softreset failed (waited 10000 usec)
[    0.251525] omap_hwmod: gpio2: softreset failed (waited 10000 usec)
[    0.265594] omap_hwmod: gpio3: softreset failed (waited 10000 usec)
[    0.279693] omap_hwmod: gpio4: softreset failed (waited 10000 usec)
[    0.293762] omap_hwmod: gpio5: softreset failed (waited 10000 usec)
[    0.307861] omap_hwmod: gpio6: softreset failed (waited 10000 usec)
Quoted 2 lines

Just FYI, I don't see the gpio softreset failures on my boards here.

Hi Paul,

Which boards are you testing?

To be doubly sure, i ll confirm if the issue is board specific or not, by testing on another 3430 sdp.

- Avinash

Quoted 2 lines

- Paul

maintainer
#8 lore raw
Quoted 1 line · Avinash.H.M.

Which boards are you testing?

GPIO softreset warnings don't show up on either N800 or BeagleBoard 35xx as of commit 4047185.

- Paul

#9 lore raw
In reply to Avinash.H.M.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
[    0.208892] omap_hwmod: i2c1: softreset failed (waited 10000 usec)
[    0.223114] omap_hwmod: i2c2: softreset failed (waited 10000 usec)
[    0.237335] omap_hwmod: i2c3: softreset failed (waited 10000 usec)
[    0.251525] omap_hwmod: gpio2: softreset failed (waited 10000 usec)
[    0.265594] omap_hwmod: gpio3: softreset failed (waited 10000 usec)
[    0.279693] omap_hwmod: gpio4: softreset failed (waited 10000 usec)
[    0.293762] omap_hwmod: gpio5: softreset failed (waited 10000 usec)
[    0.307861] omap_hwmod: gpio6: softreset failed (waited 10000 usec)

Hi Paul,

I tested this on one more board and still got these softreset warnings. So this wasn't a board specific issue and debugged into what is causing these.

The problem is the FCLK isn't enabled for these gpios(2..6) while resetting. So the GPIO's are not resetting properly. Once i enable FCLK for them and then set the SYSCONFIG.SOFTRESET, then they are resetting and it is reflected in RESETDONE bit.

That being said, I was looking for accessing gpio2_fck in the gpio2_hwmod. But i find the structure as below,

static struct omap_hwmod omap3xxx_gpio2_hwmod = {
	.name		= "gpio2",
	.mpu_irqs	= omap3xxx_gpio2_irqs,
	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_gpio2_irqs),
	.main_clk	= "gpio2_ick",

Is there any reason, why 'iclk' is set as the 'main_clk' and not 'fclk'. Also 'fclk' is structured as 'gpio2_dbck' and made as an optional clock. I wasn't very sure, why the name 'dbck'?

Quoted 2 lines
Quoted 2 lines

Just FYI, I don't see the gpio softreset failures on my boards here.

Most likely you aren't seeing this in N800 and beagle because the bootloader may be enabling the clocks.

I am sorry if the above question seems silly. I am fairly new to this frameworks and hence the question :-). Please clarify.

br ,
- avinash

#10 lore raw
Quoted 11 lines · Avinash.H.M.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
[    0.208892] omap_hwmod: i2c1: softreset failed (waited 10000 usec)
[    0.223114] omap_hwmod: i2c2: softreset failed (waited 10000 usec)
[    0.237335] omap_hwmod: i2c3: softreset failed (waited 10000 usec)
[    0.251525] omap_hwmod: gpio2: softreset failed (waited 10000 usec)
[    0.265594] omap_hwmod: gpio3: softreset failed (waited 10000 usec)
[    0.279693] omap_hwmod: gpio4: softreset failed (waited 10000 usec)
[    0.293762] omap_hwmod: gpio5: softreset failed (waited 10000 usec)
[    0.307861] omap_hwmod: gpio6: softreset failed (waited 10000 usec)

Hi Paul,

Quoted 8 lines

I tested this on one more board and still got these softreset warnings. So this wasn't a board specific issue and debugged into what is causing these.

The problem is the FCLK isn't enabled for these gpios(2..6) while resetting. So the GPIO's are not resetting properly. Once i enable FCLK for them and then set the SYSCONFIG.SOFTRESET, then they are resetting and it is reflected in RESETDONE bit.

What do you mean by fclk here. GPIO doesn't have an fclk. The interface clock provides the functional clock, and the optional debounce clock (dbclk) is needed only when GPIO debounce is enabled.

I suggest you look at the "integration" sub chapter of the TRM for the GPIO module.

Quoted 10 lines

That being said, I was looking for accessing gpio2_fck in the gpio2_hwmod. But i find the structure as below,

static struct omap_hwmod omap3xxx_gpio2_hwmod = {
	.name		= "gpio2",
	.mpu_irqs	= omap3xxx_gpio2_irqs,
	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_gpio2_irqs),
	.main_clk	= "gpio2_ick",

Is there any reason, why 'iclk' is set as the 'main_clk' and not 'fclk'.

There are no GPIO fclks.

Quoted 2 lines

Also 'fclk' is structured as 'gpio2_dbck' and made as an optional clock. I wasn't very sure, why the name 'dbck'?

dbck == debounce clock

Kevin

#11 lore raw
Quoted 11 lines
Quoted 4 lines

The problem is the FCLK isn't enabled for these gpios(2..6) while resetting. So the GPIO's are not resetting properly. Once i enable FCLK for them and then set the SYSCONFIG.SOFTRESET, then they are resetting and it is reflected in RESETDONE bit.

What do you mean by fclk here. GPIO doesn't have an fclk. The interface clock provides the functional clock, and the optional debounce clock (dbclk) is needed only when GPIO debounce is enabled.

I suggest you look at the "integration" sub chapter of the TRM for the GPIO module.

Hi Kevin ,

I looked at this section. Now i am clear about the code. I meant fclk as functional clocks which is described by register CM_FCLKEN_PER, bit 12 to bit 17. These bits are described as they control 'GPIO x functional clock'.

Looking at the GPIO chapter, i understood that this is same as the gpio dbck. This was confirmed by section 'PER Power Domain Clock Controls' where he says CM_FCLKEN_PER[12-17] control PER_32K_ALWON_FCLK which is routed as GPIOx_DBCLK.

[...]

Quoted 7 lines

There are no GPIO fclks.

Quoted 2 lines

Also 'fclk' is structured as 'gpio2_dbck' and made as an optional clock. I wasn't very sure, why the name 'dbck'?

dbck == debounce clock

I got it. Thanks for the clarification.

Looks like without this clock, GPIO module isn't resetting even on writing to SYSCONFIG register. Should we provide a seperate reset function for gpio, like the way it was suggested for i2c ?

br ,
- Avinash

Quoted 2 lines

Kevin

#12 lore raw
Quoted 32 lines · Avinash
Quoted 11 lines
Quoted 4 lines

The problem is the FCLK isn't enabled for these gpios(2..6) while resetting. So the GPIO's are not resetting properly. Once i enable FCLK for them and then set the SYSCONFIG.SOFTRESET, then they are resetting and it is reflected in RESETDONE bit.

What do you mean by fclk here. GPIO doesn't have an fclk. The interface clock provides the functional clock, and the optional debounce clock (dbclk) is needed only when GPIO debounce is enabled.

I suggest you look at the "integration" sub chapter of the TRM for the GPIO module.

Hi Kevin ,

I looked at this section. Now i am clear about the code. I meant fclk as functional clocks which is described by register CM_FCLKEN_PER, bit 12 to bit 17. These bits are described as they control 'GPIO x functional clock'.

Looking at the GPIO chapter, i understood that this is same as the gpio dbck. This was confirmed by section 'PER Power Domain Clock Controls' where he says CM_FCLKEN_PER[12-17] control PER_32K_ALWON_FCLK which is routed as GPIOx_DBCLK.

[...]

Quoted 6 lines

There are no GPIO fclks.

Quoted 2 lines

Also 'fclk' is structured as 'gpio2_dbck' and made as an optional clock. I wasn't very sure, why the name 'dbck'?

Quoted 7 lines
Quoted 1 line

dbck == debounce clock

I got it. Thanks for the clarification.

Looks like without this clock, GPIO module isn't resetting even on writing to SYSCONFIG register. Should we provide a seperate reset function for gpio, like the way it was suggested for i2c ?

No need for that, it is already working like that on OMAP4. We have a nice flag that handle that clock during reset.

.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,

Regards,
Benoit

#13 lore raw
Quoted 8 lines
Quoted 3 lines

Looks like without this clock, GPIO module isn't resetting even on writing to SYSCONFIG register. Should we provide a seperate reset function for gpio, like the way it was suggested for i2c ?

No need for that, it is already working like that on OMAP4. We have a nice flag that handle that clock during reset.

.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,

Thanks benoit. I'll use this flag and try resetting GPIO module.

br ,
- avinash

Quoted 8 lines

Regards,
Benoit

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#14 lore raw
In reply to Paul Walmsley

Hi Paul,

Quoted 17 lines · Paul Walmsley

Hi Avinash,

Quoted 8 lines
Quoted 8 lines · Avinash.H.M
Quoted 7 lines

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Cc Rajendra Nayak<[email protected]>
Cc Paul Walmsley<[email protected]>
Cc Benoit Cousson<[email protected]>
Cc Kevin Hilman<[email protected]>
Quoted 3 lines

This patch is causing I2C softreset timeouts in the hwmod layer on OMAP2 and 3. Could you please take a look at this and figure out what is going on?

I think this is probably due to the nasty I2C softreset bug with discussed last year with Paul Brady.

AFAIR, the I2C cannot be reset by just writing to the SYSCONFIG softreset bit. You need to play with other registers too.

Avinash,
You should try to look at 3430 or 3630 errata. You will probably find the bug I'm referring to.

Benoit

maintainer
#15 lore raw

Hi,

Quoted 20 lines · Benoit
Quoted 15 lines · Paul Walmsley
Quoted 8 lines
Quoted 8 lines · Avinash.H.M
Quoted 7 lines

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Cc Rajendra Nayak<[email protected]>
Cc Paul Walmsley<[email protected]>
Cc Benoit Cousson<[email protected]>
Cc Kevin Hilman<[email protected]>
Quoted 3 lines

This patch is causing I2C softreset timeouts in the hwmod layer on OMAP2 and 3. Could you please take a look at this and figure out what is going on?

Quoted 5 lines

I think this is probably due to the nasty I2C softreset bug with discussed last year with Paul Brady.

AFAIR, the I2C cannot be reset by just writing to the SYSCONFIG softreset bit. You need to play with other registers too.

Thanks Benoît.

So then, Avinash, you might need to create a custom hwmod class reset function for the I2C block (viz., struct omap_hwmod_class.reset)

Quoted 3 lines

Avinash,
You should try to look at 3430 or 3630 errata. You will probably find the bug I'm referring to.

- Paul

#16 lore raw
Quoted 29 lines · Paul Walmsley

Hi,

Quoted 25 lines · Benoit
Quoted 15 lines · Paul Walmsley
Quoted 8 lines
Quoted 8 lines · Avinash.H.M
Quoted 7 lines

Some of the omap2, omap3 peripherals support software reset. This can be done through the softreset bit in sysconfig register. The reset status can be checked through resetdone bit of sysstatus register. syss_has_reset_status is added to the hwmod database of peripherals which have resetdone bit in sysstatus register.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Cc Rajendra Nayak<[email protected]>
Cc Paul Walmsley<[email protected]>
Cc Benoit Cousson<[email protected]>
Cc Kevin Hilman<[email protected]>
Quoted 3 lines

This patch is causing I2C softreset timeouts in the hwmod layer on OMAP2 and 3. Could you please take a look at this and figure out what is going on?

I think this is probably due to the nasty I2C softreset bug with discussed last year with Paul Brady.

AFAIR, the I2C cannot be reset by just writing to the SYSCONFIG softreset bit. You need to play with other registers too.

Thanks Benoit. You are right.

The TRM Section '18.3.1.3.2 Software Reset' explains the steps for softresetting I2C. The steps are below:

1. Ensure that the module is disabled (clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
2. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
3. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
4. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to indicate the software reset is complete.

Quoted 5 lines

Thanks Benoît.

So then, Avinash, you might need to create a custom hwmod class reset function for the I2C block (viz., struct omap_hwmod_class.reset)

OK Paul. I'll add the I2C_CON register and follow the above sequence as suggested in the TRM in the custom I2C reset function.

br,

- Avinash

Quoted 7 lines
Quoted 4 lines

Avinash,
You should try to look at 3430 or 3630 errata. You will probably find the bug I'm referring to.

- Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#17 lore raw
Quoted 11 lines

Thanks Benoit. You are right.

The TRM Section '18.3.1.3.2 Software Reset' explains the steps for softresetting I2C. The steps are below:

1. Ensure that the module is disabled (clear the I2Ci.I2C_CON[15] I2C_EN bit to 0).
2. Set the I2Ci.I2C_SYSC[1] SRST bit to 1.
3. Enable the module by setting I2Ci.I2C_CON[15] I2C_EN bit to 1.
4. Check the I2Ci.I2C_SYSS[0] RDONE bit until it is set to 1 to indicate the software reset is complete.

Hi paul,

I have been able to implement the function. It took a while because, even after implementing the above sequence, i was seeing the I2C wasn't resetting.

The issue turned out that i was doing '32 bit data access' which was corrupting the i2c register contents. I missed the TRM section where it tells, "i2c registers are limited to 8-bit or 16-bit access". Special thanks to balaji.t.k for helping me debug this and pointing this was the issue. On correcting this, the function worked cleanly and i2c was reset.

I ll send out the patch tomorrow.

br ,
- avinash

Quoted 10 lines
Quoted 6 lines

Thanks Benoît.

So then, Avinash, you might need to create a custom hwmod class reset function for the I2C block (viz., struct omap_hwmod_class.reset)

OK Paul. I'll add the I2C_CON register and follow the above sequence as suggested in the TRM in the custom I2C reset function.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html