Skip to contentSkip to conversation

Omap4 DSS clocks

RFC PATCH In review Christoph Fritz 3 participants 15 messages Mar 14, 2013 – Apr 5, 2013

Subsystems (3)
lore
Share & tools
lore
#1 lore raw
Quoted 10 lines

Hi,

Barebox crashes while reading a DSS register:

  $ md 0x48040000
  unable to handle paging request at address 0x48040000

I suppose this is due to a turned off clock.

Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x48040000-0x48040010

---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw
Quoted 5 lines · Alexander Shiyan
Quoted 5 lines

Barebox crashes while reading a DSS register:

  $ md 0x48040000
  unable to handle paging request at address 0x48040000
Quoted 8 lines
Quoted 3 lines

I suppose this is due to a turned off clock.

Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x48040000-0x48040010

I get the same effect: it crashes.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw
Quoted 8 lines · Alexander Shiyan
Quoted 7 lines
Quoted 7 lines

Barebox crashes while reading a DSS register:

  $ md 0x48040000
  unable to handle paging request at address 0x48040000

I suppose this is due to a turned off clock.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x48040000-0x48040010

I get the same effect: it crashes.

OK. It seems rw_buf not initialized.

So change line:
static char *rw_buf;
to
static char *rw_buf[RW_BUF_SIZE];
in commands/mem.c

---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#4 lore raw
Quoted 15 lines
Quoted 15 lines · Alexander Shiyan
Quoted 13 lines
Quoted 8 lines

Barebox crashes while reading a DSS register:

  $ md 0x48040000
  unable to handle paging request at address 0x48040000

I suppose this is due to a turned off clock.

Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x48040000-0x48040010

Quoted 8 lines
Quoted 1 line

I get the same effect: it crashes.

OK. It seems rw_buf not initialized.

So change line:
static char *rw_buf;
to
static char *rw_buf[RW_BUF_SIZE];

Without asterisk, like:
static char rw_buf[RW_BUF_SIZE];
Sorry.

Quoted 1 line

in commands/mem.c

---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw
Quoted 17 lines · Alexander Shiyan
Quoted 17 lines
Quoted 16 lines · Alexander Shiyan
Quoted 5 lines
Quoted 5 lines

Barebox crashes while reading a DSS register:

  $ md 0x48040000
  unable to handle paging request at address 0x48040000
Quoted 8 lines
Quoted 3 lines

I suppose this is due to a turned off clock.

Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x48040000-0x48040010

I get the same effect: it crashes.

Quoted 8 lines
Quoted 6 lines

OK. It seems rw_buf not initialized.

So change line:
static char *rw_buf;
to
static char *rw_buf[RW_BUF_SIZE];

Without asterisk, like:
static char rw_buf[RW_BUF_SIZE];

malloc expects a pointer:
commands/mem.c:634: error: incompatible types when assigning to type ‘char[4096]’ from type ‘void *’

As you can see below, for a quick test I commented the lines, but barebox still crashes.

Why don't you suppose that this is due to the non functional DSS?

commands/mem.c +6 -6
index 51aa04d..af5cc46 100644
@@ -40,7 +40,7 @@
 #endif
 
 #define RW_BUF_SIZE	4096
-static char *rw_buf;
+static char rw_buf[RW_BUF_SIZE];
 
 static char *DEVMEM = "/dev/mem";
 
@@ -631,11 +631,11 @@ static struct driver_d mem_drv = {
 
 static int mem_init(void)
 {
-	rw_buf = malloc(RW_BUF_SIZE);
-	if(!rw_buf) {
-		printf("%s: Out of memory\n", __FUNCTION__);
-		return -1;
-	}
+//	rw_buf = malloc(RW_BUF_SIZE);
+//	if(!rw_buf) {
+//		printf("%s: Out of memory\n", __FUNCTION__);
+//		return -1;
+//	}
 
 	add_mem_device("mem", 0, ~0, IORESOURCE_MEM_WRITEABLE);
 	platform_driver_register(&mem_drv);

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#6 lore raw
Quoted 27 lines · Christoph Fritz
Quoted 17 lines · Alexander Shiyan
Quoted 17 lines
Quoted 16 lines · Alexander Shiyan
Quoted 5 lines
Quoted 5 lines

Barebox crashes while reading a DSS register:

  $ md 0x48040000
  unable to handle paging request at address 0x48040000
Quoted 8 lines
Quoted 3 lines

I suppose this is due to a turned off clock.

Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x48040000-0x48040010

I get the same effect: it crashes.

Quoted 8 lines
Quoted 6 lines

OK. It seems rw_buf not initialized.

So change line:
static char *rw_buf;
to
static char *rw_buf[RW_BUF_SIZE];

Without asterisk, like:
static char rw_buf[RW_BUF_SIZE];

Quoted 8 lines

malloc expects a pointer:
commands/mem.c:634: error: incompatible types when assigning to type ‘char[4096]’ from type ‘void *’

As you can see below, for a quick test I commented the lines, but barebox still crashes.

Why don't you suppose that this is due to the non functional DSS?

I wouldn't expect a bug in the code. This would have been discovered already.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw
Quoted 32 lines · Sascha Hauer
Quoted 31 lines · Christoph Fritz
Quoted 17 lines · Alexander Shiyan
Quoted 17 lines
Quoted 16 lines · Alexander Shiyan
Quoted 5 lines
Quoted 5 lines

Barebox crashes while reading a DSS register:

  $ md 0x48040000
  unable to handle paging request at address 0x48040000
Quoted 8 lines
Quoted 3 lines

I suppose this is due to a turned off clock.

Any hints?

Probably this is a bug. I reproduced it.

Try to specify start & end address, like:
md -l 0x48040000-0x48040010

I get the same effect: it crashes.

Quoted 8 lines
Quoted 6 lines

OK. It seems rw_buf not initialized.

So change line:
static char *rw_buf;
to
static char *rw_buf[RW_BUF_SIZE];

Without asterisk, like:
static char rw_buf[RW_BUF_SIZE];

malloc expects a pointer:
commands/mem.c:634: error: incompatible types when assigning to type ‘char[4096]’ from type ‘void *’

Quoted 7 lines
Quoted 4 lines

As you can see below, for a quick test I commented the lines, but barebox still crashes.

Why don't you suppose that this is due to the non functional DSS?

I wouldn't expect a bug in the code. This would have been discovered already.

Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the field [17:16] IDLEST reads 0x3 which means "Module is disabled and cannot be accessed". On linux, its 0x2 which means "functional".

Any hints?

Thanks
-- Christoph

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#8 lore raw
Quoted 8 lines · Christoph Fritz
Quoted 2 lines · Sascha Hauer

I wouldn't expect a bug in the code. This would have been discovered already.

Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the field [17:16] IDLEST reads 0x3 which means "Module is disabled and cannot be accessed". On linux, its 0x2 which means "functional".

I already asked about this on the TI E2E Community forum
http://e2e.ti.com/support/omap/f/849/t/251717.aspx but without gaining success.

Overall, isn't it weird that DSS is offline (as indicated by IDLEST)?

I suppose in ./arch/arm/mach-omap/omap4_clock.c this check:

/* Check for DSS Clocks */
while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)

	;

should get extended to also check for correct IDLEST ...which would currently end in an endless loop :)

Thanks
-- Christoph

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#9 lore raw
Quoted 16 lines · Christoph Fritz
Quoted 8 lines · Sascha Hauer
Quoted 3 lines

I wouldn't expect a bug in the code. This would have been discovered already.

Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the field [17:16] IDLEST reads 0x3 which means "Module is disabled and cannot be accessed". On linux, its 0x2 which means "functional".

I already asked about this on the TI E2E Community forum
http://e2e.ti.com/support/omap/f/849/t/251717.aspx but without gaining success.

Overall, isn't it weird that DSS is offline (as indicated by IDLEST)?

Quoted 8 lines

I suppose in ./arch/arm/mach-omap/omap4_clock.c this check:

/* Check for DSS Clocks */
while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)

	;

should get extended to also check for correct IDLEST ...which would currently end in an endless loop :)

I revised commands/mem. All correct in the code, so problem is not here.

About DSS: I cannot help you with this CPU, but here is one point from OMAP4430TRM:
"The main access to all DSS registers is through the L3 interconnect. The access through the L4_PER interconnect is provided for back software compatibility."

Maybe it help you.

---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#10 lore raw
Quoted 9 lines · Alexander Shiyan
Quoted 9 lines · Christoph Fritz
Quoted 8 lines · Sascha Hauer
Quoted 3 lines

I wouldn't expect a bug in the code. This would have been discovered already.

Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the field [17:16] IDLEST reads 0x3 which means "Module is disabled and cannot be accessed". On linux, its 0x2 which means "functional".

Sascha, any comments on this?

Quoted 8 lines
Quoted 8 lines

I already asked about this on the TI E2E Community forum
http://e2e.ti.com/support/omap/f/849/t/251717.aspx but without gaining success.

Overall, isn't it weird that DSS is offline (as indicated by IDLEST)?

I suppose in ./arch/arm/mach-omap/omap4_clock.c this check:

Quoted 8 lines
Quoted 6 lines

/* Check for DSS Clocks */
while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)

	;

should get extended to also check for correct IDLEST ...which would currently end in an endless loop :)

I revised commands/mem. All correct in the code, so problem is not here.

Thanks for pointing this out.

Quoted 5 lines

About DSS: I cannot help you with this CPU, but here is one point from OMAP4430TRM:
"The main access to all DSS registers is through the L3 interconnect. The access through the L4_PER interconnect is provided for back software compatibility."

I stumbled upon these lines too but have no clue what this means for barebox command "md" concrete.

Quoted 1 line

Maybe it help you.

Thanks a lot for trying
-- Christoph

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#11 lore raw
Quoted 32 lines · Alexander Shiyan
Quoted 9 lines
Quoted 9 lines · Christoph Fritz
Quoted 8 lines · Sascha Hauer
Quoted 3 lines

I wouldn't expect a bug in the code. This would have been discovered already.

Register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 and so the field [17:16] IDLEST reads 0x3 which means "Module is disabled and cannot be accessed". On linux, its 0x2 which means "functional".

Sascha, any comments on this?

Quoted 8 lines
Quoted 8 lines

I already asked about this on the TI E2E Community forum
http://e2e.ti.com/support/omap/f/849/t/251717.aspx but without gaining success.

Overall, isn't it weird that DSS is offline (as indicated by IDLEST)?

I suppose in ./arch/arm/mach-omap/omap4_clock.c this check:

Quoted 8 lines
Quoted 6 lines

/* Check for DSS Clocks */
while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)

	;

should get extended to also check for correct IDLEST ...which would currently end in an endless loop :)

I revised commands/mem. All correct in the code, so problem is not here.

Thanks for pointing this out.

Quoted 8 lines
Quoted 5 lines

About DSS: I cannot help you with this CPU, but here is one point from OMAP4430TRM:
"The main access to all DSS registers is through the L3 interconnect. The access through the L4_PER interconnect is provided for back software compatibility."

I stumbled upon these lines too but have no clue what this means for barebox command "md" concrete.

MD command causes an error due to the inability of the reading memory area. Error can be disabled via the option "enable arm exception handling support", but it does not help solve the problem.
OMAP has a memory areas (modules), which are locked, so you need to search this information from datasheet.

---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#12 lore raw

RFC PATCH 1/1 ARM OMAP4: enable DSS by default

Quoted 4 lines · Alexander Shiyan

MD command causes an error due to the inability of the reading memory area. Error can be disabled via the option "enable arm exception handling support", but it does not help solve the problem.
OMAP has a memory areas (modules), which are locked,

This corresponds with my register observations. As noted above, register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 which means: "Module is disabled and cannot be accessed".

Quoted 2 lines

so you need to
search this information from datasheet.

Finnaly I was very wise inspired to do "mw 0x4a009100 2". This disables the HW_AUTO-Mode (Automatic transition) and starts a software forced wake-up (SW_WKUP).

Now even the IDLEST field from CM_DSS_CLKSTCTRL reads 0x0: "Module is fully functional, including INTRCONN" :-)

et la voila:
md 0x48040000+4
48040000: 00000040

What do you think about the patch below?

---
Subject: [PATCH] [RFC] ARM OMAP4: enable DSS by default

This patch removes the anyway default reset setting of HW_AUTO in favour of SW_WKUP. So the DSS Module gets enabled and you gain full register access.

---
 arch/arm/mach-omap/omap4_clock.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap/omap4_clock.c +2 -2
index 0621fd3..72335d9 100644
@@ -375,8 +375,8 @@ void omap4_enable_all_clocks(void)
 	/* Check for DSS Clocks */
 	while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)
 		;
-	/* Set HW_AUTO transition mode */
-	sr32(CM_DSS_CLKSTCTRL, 0, 32, 0x3);
+	/* Set SW_WKUP to enable DSS Module with full register access */
+	sr32(CM_DSS_CLKSTCTRL, 0, 32, 0x2);
 
 	/* Enable SGX clocks */
 	sr32(CM_SGX_CLKSTCTRL, 0, 32, 0x2);
Signature · 9 lines
1.7.10.4




_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#13 lore raw

Re: [PATCH] [RFC] ARM OMAP4: enable DSS by default

Quoted 41 lines · Christoph Fritz
Quoted 4 lines · Alexander Shiyan

MD command causes an error due to the inability of the reading memory area. Error can be disabled via the option "enable arm exception handling support", but it does not help solve the problem.
OMAP has a memory areas (modules), which are locked,

This corresponds with my register observations. As noted above, register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 which means: "Module is disabled and cannot be accessed".

Quoted 2 lines

so you need to
search this information from datasheet.

Finnaly I was very wise inspired to do "mw 0x4a009100 2". This disables the HW_AUTO-Mode (Automatic transition) and starts a software forced wake-up (SW_WKUP).

Now even the IDLEST field from CM_DSS_CLKSTCTRL reads 0x0: "Module is fully functional, including INTRCONN" :-)

et la voila:
md 0x48040000+4
48040000: 00000040

What do you think about the patch below?

---
Subject: [PATCH] [RFC] ARM OMAP4: enable DSS by default

This patch removes the anyway default reset setting of HW_AUTO in favour of SW_WKUP. So the DSS Module gets enabled and you gain full register access.

---
 arch/arm/mach-omap/omap4_clock.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap/omap4_clock.c +0 -0
index 0621fd3..72335d9 100644

arch/arm/mach-omap/omap4_clock.c void omap4_enable_all_clocks(void) · line 382

Quoted 10 lines
arch/arm/mach-omap/omap4_clock.c +2 -2
@@ -375,8 +375,8 @@ void omap4_enable_all_clocks(void)
 	/* Check for DSS Clocks */
 	while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)
 		;
-	/* Set HW_AUTO transition mode */
-	sr32(CM_DSS_CLKSTCTRL, 0, 32, 0x3);
+	/* Set SW_WKUP to enable DSS Module with full register access */
+	sr32(CM_DSS_CLKSTCTRL, 0, 32, 0x2);
 
 	/* Enable SGX clocks */
 	sr32(CM_SGX_CLKSTCTRL, 0, 32, 0x2);

*ping*

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#14 lore raw

Re[2]: [PATCH] [RFC] ARM OMAP4: enable DSS by default

Quoted 50 lines · Christoph Fritz
Quoted 49 lines · Alexander Shiyan
Quoted 5 lines

MD command causes an error due to the inability of the reading memory area. Error can be disabled via the option "enable arm exception handling support", but it does not help solve the problem.
OMAP has a memory areas (modules), which are locked,

This corresponds with my register observations. As noted above, register CM_DSS_DSS_CLKCTRL (0x4a009120) reads 0x00070F02 which means: "Module is disabled and cannot be accessed".

Quoted 2 lines

so you need to
search this information from datasheet.

Finnaly I was very wise inspired to do "mw 0x4a009100 2". This disables the HW_AUTO-Mode (Automatic transition) and starts a software forced wake-up (SW_WKUP).

Now even the IDLEST field from CM_DSS_CLKSTCTRL reads 0x0: "Module is fully functional, including INTRCONN" :-)

et la voila:
md 0x48040000+4
48040000: 00000040

What do you think about the patch below?

---
Subject: [PATCH] [RFC] ARM OMAP4: enable DSS by default

This patch removes the anyway default reset setting of HW_AUTO in favour of SW_WKUP. So the DSS Module gets enabled and you gain full register access.

---
 arch/arm/mach-omap/omap4_clock.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-omap/omap4_clock.c +2 -2
index 0621fd3..72335d9 100644
@@ -375,8 +375,8 @@ void omap4_enable_all_clocks(void)
 	/* Check for DSS Clocks */
 	while ((__raw_readl(0x4A009100) & 0xF00) != 0xE00)
 		;
-	/* Set HW_AUTO transition mode */
-	sr32(CM_DSS_CLKSTCTRL, 0, 32, 0x3);
+	/* Set SW_WKUP to enable DSS Module with full register access */
+	sr32(CM_DSS_CLKSTCTRL, 0, 32, 0x2);
 
Quoted 2 lines

arch/arm/mach-omap/omap4_clock.c void omap4_enable_all_clocks(void) · line 382

Quoted 2 lines
arch/arm/mach-omap/omap4_clock.c +0 -0
 	/* Enable SGX clocks */
 	sr32(CM_SGX_CLKSTCTRL, 0, 32, 0x2);

I do not use OMAP and therefore can not comment on these changes. I think AUTO mode should work by default, and the fact that it does not work suggests that not all operations are performed (power, clocks etc.) ... May be necessary to switch to AUTO back after forcing WKUP.

---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox