mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Christoph Fritz <chf.fritz@googlemail.com>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: barebox@lists.infradead.org
Subject: Re: Re[3]: Omap4 DSS clocks
Date: Thu, 14 Mar 2013 14:23:56 +0100	[thread overview]
Message-ID: <1363267436.4022.44.camel@mars> (raw)
In-Reply-To: <1363266661.151779822@f2.mail.ru>

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);




_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-03-14 13:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 12:19 Christoph Fritz
2013-03-14 12:48 ` Alexander Shiyan
2013-03-14 12:51   ` Christoph Fritz
2013-03-14 13:02     ` Re[2]: " Alexander Shiyan
2013-03-14 13:11       ` Re[3]: " Alexander Shiyan
2013-03-14 13:23         ` Christoph Fritz [this message]
2013-03-14 13:33           ` Sascha Hauer
2013-03-14 13:46             ` Christoph Fritz
2013-03-14 15:06               ` Christoph Fritz
2013-03-14 16:29                 ` Re[5]: " Alexander Shiyan
2013-03-15  8:20                   ` Christoph Fritz
2013-03-15  8:40                     ` Re[7]: " Alexander Shiyan
2013-03-15 13:39                       ` [PATCH] [RFC] ARM OMAP4: enable DSS by default Christoph Fritz
2013-04-04  6:42                         ` Christoph Fritz
2013-04-05  6:39                           ` Re[2]: " Alexander Shiyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363267436.4022.44.camel@mars \
    --to=chf.fritz@googlemail.com \
    --cc=barebox@lists.infradead.org \
    --cc=shc_work@mail.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox