Omap4 DSS clocks

Christoph Fritz chf.fritz at googlemail.com
Thu Mar 14 09:23:56 EDT 2013


On Thu, 2013-03-14 at 17:11 +0400, Alexander Shiyan wrote:
> > > On Thu, 2013-03-14 at 16:48 +0400, Alexander Shiyan wrote:
> > > > >  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
> > > 
> > > 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]; 

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?

diff --git a/commands/mem.c b/commands/mem.c
index 51aa04d..af5cc46 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -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);






More information about the barebox mailing list