Destrukto | 3 Dec 2007 08:14
Picon
Picon

Re: AT91SAM9260-EK: Trying to load U-Boot env from NAND


Yes! I get it work, the problem was, that it had a problem to accept the
crc32-Checksum. So I just erased the sequence where this happens. Here the
patchfile:

--- env_nand.c	2007-11-30 14:15:03.000000000 +0100
+++ env_nand.c	2007-11-30 14:16:17.000000000 +0100
 <at>  <at>  -247,13 +247,7  <at>  <at>  void env_relocate_spec (void)
 		crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
 	}

-	if(!crc1_ok && !crc2_ok)
-		return use_default();
-	else if(crc1_ok && !crc2_ok)
-		gd->env_valid = 1;
-	else if(!crc1_ok && crc2_ok)
-		gd->env_valid = 2;
-	else {
+	
 		/* both ok - check serial */
 		if(tmp_env1->flags == 255 && tmp_env2->flags == 0)
 			gd->env_valid = 2;
 <at>  <at>  -266,8 +260,6  <at>  <at>  void env_relocate_spec (void)
 		else /* flags are equal - almost impossible */
 			gd->env_valid = 1;

-	}
-
 	free(env_ptr);
 	if(gd->env_valid == 1) {
(Continue reading)

Ashish Ranjan | 3 Dec 2007 09:18
Favicon

Malloc failed in env_relocate

 
Hi
I am using u-boot-1.1.5 on MIPS32 core SoC. I am getting NULL pointer as return value of malloc from env_relocate() function.

while debugging in mem_malloc_init() I come to know that mem_malloc_start= 0x81f80000 and mem_malloc_end=0xFFFFFFFF. But when i checked both the values in sbrk() which is called from malloc() i got mem_malloc_start=0xFFFFFFFF and mem_malloc_end=0xFFFFFFFF.

How it happened ?? It may be the reason for getting NULL pointer. Please help me out.

One more thing what should be the value of gd->reloc_off at mem_malloc_init().because in mem_malloc_init, mem_malloc_end = CFG_MONITOR_BASE + gd->relo_off and CFG_MONITOR_BASE is base address of Flash. In my case gd-relo_off=0xc23c0000 and CFG_MONITOR_BASE=0xBFC00000 so mem_alloc_end should be 0x181FC0000 but it is of 4byte so here is overflow and it become 0xFFFFFFFF.Is there anything wrong??

Thanks,
Ashish



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Re: Malloc failed in env_relocate

On 08:18 Mon 03 Dec     , Ashish Ranjan wrote:
>   
> Hi
> I am using u-boot-1.1.5 on MIPS32 core SoC. I am getting NULL pointer as return value of malloc from
env_relocate() function.
> 
> while debugging in mem_malloc_init() I come to know that mem_malloc_start= 0x81f80000 and
mem_malloc_end=0xFFFFFFFF. But when i checked both the values in sbrk() which is called from malloc() i
got mem_malloc_start=0xFFFFFFFF and mem_malloc_end=0xFFFFFFFF.
> 
> How it happened ?? It may be the reason for getting NULL pointer. Please help me out.
> 
> One more thing what should be the value of gd->reloc_off at mem_malloc_init().because in
mem_malloc_init, mem_malloc_end = CFG_MONITOR_BASE + gd->relo_off and CFG_MONITOR_BASE is base
address of Flash. In my case gd-relo_off=0xc23c0000 and CFG_MONITOR_BASE=0xBFC00000 so
mem_alloc_end should be 0x181FC0000 but it is of 4byte so here is overflow and it become 0xFFFFFFFF.Is
there anything wrong??

Please upgrade your u-boot to the last release 1.3.0

Best Regards,
J.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Dharmosoth Seetharam | 3 Dec 2007 10:28
Picon
Favicon

Re: AT91SAM9260-EK: Trying to load U-Boot env from NAND


I agree with your comment. !!!!

cool..

Thanks,
Seetharam


Destrukto <simon.bielmann <at> gmx.ch> wrote:

Yes! I get it work, the problem was, that it had a problem to accept the
crc32-Checksum. So I just erased the sequence where this happens. Here the
patchfile:

--- env_nand.c 2007-11-30 14:15:03.000000000 +0100
+++ env_nand.c 2007-11-30 14:16:17.000000000 +0100
<at> <at> -247,13 +247,7 <at> <at> void env_relocate_spec (void)
crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
}

- if(!crc1_ok && !crc2_ok)
- return use_default();
- else if(crc1_ok && !crc2_ok)
- gd->env_valid = 1;
- else if(!crc1_ok && crc2_ok)
- gd->env_valid = 2;
- else {
+
/* both ok - check serial */
if(tmp_env1->flags == 255 && tmp_env2->flags == 0)
gd->env_valid = 2;
<at> <at> -266,8 +260,6 <at> <at> void env_relocate_spec (void)
else /* flags are equal - almost impossible */
gd->env_valid = 1;

- }
-
free(env_ptr);
if(gd->env_valid == 1) {
env_ptr = tmp_env1;

Maybe it isn't the best solution but it works ;)
Thanks for you help!!



Destrukto


Dharmosoth Seetharam wrote:
>
> please Debug the function which i mention earlier.
> If you don't get any clue, please copy the code of your Dataflash_Select()
> here
>
>
> Thanks,
> Seetharam
>
> Destrukto wrote:
> At first thanks for your reply, but could you explain that in detail
> please.
>
> Thanks Destrukto
>
>
> Hi,
>
> If I remember correctly, i got the same issue on
> AT91SAM9263ek.
>
> you please debug the Dataflash_Select() ...
> there u many need to go into the if condition and
> do valid=1;
>
>
> so, please check it once and modify the condition...
>
> u may get the solution ..
>
> Thanks,
> Seetharam
> --
> View this message in context:
> http://www.nabble.com/AT91SAM9260-EK%3A-Trying-to-load-U-Boot-env-from-NAND-tf4896117.html#a14028021
> Sent from the Uboot - Users mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell. From the desktop to the data center, Linux is going
> mainstream. Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
>
>
> ---------------------------------
> 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here.
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell. From the desktop to the data center, Linux is going
> mainstream. Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
>

--
View this message in context: http://www.nabble.com/AT91SAM9260-EK%3A-Trying-to-load-U-Boot-env-from-NAND-tf4896117.html#a14124814
Sent from the Uboot - Users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
.bielmann <at> gmx.ch>

Unlimited freedom, unlimited storage. Get it now
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
Niklaus Giger | 3 Dec 2007 10:48
Picon
Picon

[PATCH] resubmit: PPC440: Add flow control for serial port

Sorry for my mistake in my first submission..

This has been tested on our HCU5 PPC440EPx based board, where we
have only one serial port.

Signed-off-by: Niklaus Giger <niklaus.giger <at> netstal.com>
---
 cpu/ppc4xx/serial.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/cpu/ppc4xx/serial.c b/cpu/ppc4xx/serial.c
index 60712b1..4cba836 100644
--- a/cpu/ppc4xx/serial.c
+++ b/cpu/ppc4xx/serial.c
 <at>  <at>  -490,6 +490,21  <at>  <at>  static void serial_divs (int baudrate, unsigned long *pudiv,
 }
 #endif /* defined(CONFIG_440) && !defined(CFG_EXT_SERIAL_CLK) */

+#if defined(CONFIG_CMD_HWFLOW) && defined(CONFIG_440) && !defined(CONFIG_SERIAL_MULTI)
+int hwflow_onoff(int flow_on)
+{
+	if (flow_on == 1) {
+		out8(UART_BASE + UART_MCR, 0x0b);	/* The OUT2 bit may be written and read
+	                                           but it provides no function */
+	}
+	else
+	{
+		out8(UART_BASE + UART_MCR, 0x00);	/* no modem control DTR RTS */
+	}
+	return 0;
+}
+#endif
+
 /*
  * Minimal serial functions needed to use one of the SMC ports
  * as serial console interface.
 <at>  <at>  -548,7 +563,12  <at>  <at>  int serial_init(void)
 	out8(UART_BASE + UART_DLM, bdiv >> 8);	/* set baudrate divisor */
 	out8(UART_BASE + UART_LCR, 0x03);	/* clear DLAB; set 8 bits, no parity */
 	out8(UART_BASE + UART_FCR, 0x00);	/* disable FIFO */
+#ifdef CONFIG_CMD_HWFLOW
+	out8(UART_BASE + UART_MCR, 0x0b);	/* The OUT2 bit may be written and read
+	                                           but it provides no function */
+#else
 	out8(UART_BASE + UART_MCR, 0x00);	/* no modem control DTR RTS */
+#endif
 	val = in8(UART_BASE + UART_LSR);	/* clear line status */
 	val = in8(UART_BASE + UART_RBR);	/* read receive buffer */
 	out8(UART_BASE + UART_SCR, 0x00);	/* set scratchpad */
--

-- 
1.5.2

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Wolfgang Denk | 3 Dec 2007 10:55
Picon
Picon
Favicon

Re: AT91SAM9260-EK: Trying to load U-Boot env from NAND

In message <14124814.post <at> talk.nabble.com> you wrote:
> 
> Yes! I get it work, the problem was, that it had a problem to accept the
> crc32-Checksum. So I just erased the sequence where this happens. Here the
> patchfile:
> 
> --- env_nand.c	2007-11-30 14:15:03.000000000 +0100
> +++ env_nand.c	2007-11-30 14:16:17.000000000 +0100
>  <at>  <at>  -247,13 +247,7  <at>  <at>  void env_relocate_spec (void)
>  		crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
>  	}
>  
> -	if(!crc1_ok && !crc2_ok)
> -		return use_default();
> -	else if(crc1_ok && !crc2_ok)
> -		gd->env_valid = 1;
> -	else if(!crc1_ok && crc2_ok)
> -		gd->env_valid = 2;
> -	else {
> +	
>  		/* both ok - check serial */

You mean you completely castrated all logic that would verify if the
environment is OK? Arrggghhhh...

> Maybe it isn't the best solution but it works ;)

You THINK it works, but actually it's completely broken.

Don't do that!!!

Best regards,

Wolfgang Denk

--

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd <at> denx.de
"UNIX was not designed to stop you from doing stupid things,  because
that would also stop you from doing clever things."       - Doug Gwyn

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Wolfgang Denk | 3 Dec 2007 10:58
Picon
Picon
Favicon

Re: [PATCH] resubmit: PPC440: Add flow control for serial port

In message <200712031048.54727.niklausgiger <at> gmx.ch> you wrote:
> Sorry for my mistake in my first submission..
> 
> This has been tested on our HCU5 PPC440EPx based board, where we
> have only one serial port.

I object against applying such a patch.

Using hardware flow-control on the only available serial port (= con-
sole port) is fundamentally broken. It is not acceptable that a board
does not come up just because no  console  terminal  is  attached  or
because the console is in the wrong state.

Best regards,

Wolfgang Denk

--

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd <at> denx.de
If it went on at this rate, in several billion  years  he'd  be  rich
beyond his wildest dreams!            - Terry Pratchett, _Soul Music_

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Stefan Roese | 3 Dec 2007 11:45
Picon
Picon
Favicon

Re: [PATCH] resubmit: PPC440: Add flow control for serial port

On Monday 03 December 2007, Wolfgang Denk wrote:
> In message <200712031048.54727.niklausgiger <at> gmx.ch> you wrote:
> > Sorry for my mistake in my first submission..
> >
> > This has been tested on our HCU5 PPC440EPx based board, where we
> > have only one serial port.
>
> I object against applying such a patch.
>
> Using hardware flow-control on the only available serial port (= con-
> sole port) is fundamentally broken. It is not acceptable that a board
> does not come up just because no  console  terminal  is  attached  or
> because the console is in the wrong state.

This patch "only" enables the 4xx UART driver for hardware flow control
and doesn't configure it for the HCU5 board. So that should not be a
problem.

But this patch unfortunately has coding style issues:

> +#if defined(CONFIG_CMD_HWFLOW) && defined(CONFIG_440) &&
> !defined(CONFIG_SERIAL_MULTI) +int hwflow_onoff(int flow_on)
> +{
> +       if (flow_on == 1) {
> +               out8(UART_BASE + UART_MCR, 0x0b);       /* The OUT2 bit
may be written and read
> +                                                  but it provides no function */
> +       } 
> +       else
> +       {
> +               out8(UART_BASE + UART_MCR, 0x00);       /* no modem
control DTR RTS */
> +       } 
> +       return 0;
> +}
> +#endif

Please use something like this:

if defined(CONFIG_CMD_HWFLOW) && defined(CONFIG_440) && \
   !defined(CONFIG_SERIAL_MULTI)
int hwflow_onoff(int flow_on)
{
	if (flow_on == 1) {
		/*
		 * The OUT2 bit may be written and read
		 * but it provides no function
		 */
		out8(UART_BASE + UART_MCR, 0x0b);
	} else {
		/* No modem control DTR RTS */
		out8(UART_BASE + UART_MCR, 0x00);
	}

	return 0;
}
#endif

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office <at> denx.de
=====================================================================

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Midhun A | 3 Dec 2007 12:04
Picon

Re: Help Loading I.MX21

Hi,

> I wanted to ask about the I.MX21 from freescale.
>
> How would I load U-boot onto it, and if anyone has worked with it then if
> possible help me out here.

   Which board are you using? Does it already have a boot loader on
the board? If does not, then you can use the tools from Freescale to
flash the boot loader image. These tools can be found at

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?ProdMetaId=PID%2FDT%2Fi.MX21&isAdvanceSearch=false&showCustomCollateral=false&RELEVANCE=true&fromTrng=false&showAllCategories=false&fpsp=1&fromPSP=true&SelectedAsset=Design%20Tools&assetLocked=false&&leftNavCode=1&assetLockedForNavigation=true&code=i.MX21&componentId=2&fromDAP=false&fromWebPages=false&tab=Design_Tools_Tab&isComparison=false&Design%20Tools=Design%20Tools/010Development%20Tools/070Programmers%20%28Flash%2C%20etc.%29&

Midhun.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Martin Krause | 3 Dec 2007 13:49
Picon

Re: Problems with usb storage devices on MPC5200 /TQM5200

u-boot-users-bounces <at> lists.sourceforge.net wrote on :
> wd <at> denx.de wrote on Monday, November 19, 2007 4:54 PM:
> > In message
> > <47F3F98010FF784EBEE6526EAAB078D1024F87DE <at> tq-mailsrv.tq-net.de> you
> > wrote:
> > > 
> > > I have to admit, that I never tested the TQM5200 (nor any other
> > > MPC5200 board) with the generic OHCI driver before. So I could not
> > > tell, if it worked ever with the generic driver.
> > 
> > We tested it, of course - with the hardware that is available to us.
> > 
> > Which means on pre-Rev. B CPU only. [I wish TQ would finally
> > understand what it means NOT to provide current hardware.]
> > 
> > > For the test with the current U-Boot I used three different memory
> > > sticks, which always worked with the old cpu specific OHCI driver.
> > > None of it worked with the generic driver :(.
> > 
> > I guess you use Rev. B silicon? Could you please try it on an old
> > board?
> 
> I think I tested it on both versions. But I'm not sure. I will
> repeat the test on an old board.

I repeated the test with an old TQM5200 board (v1.2 MPC5200 cpu).
Unfortunately with the same results. USB sticks are not working:

U-Boot 1.3.0 (9a337ddc154a10a26f117fd147b009abcdeba75a)
TQM5200_config

U-Boot 1.3.0 (Dec  3 2007 - 12:57:43)

CPU:   MPC5200 v1.2, Core v1.1 at 396 MHz
       Bus 132 MHz, IPB 132 MHz, PCI 66 MHz
Board: TQM5200 (TQ-Components GmbH)
       on a STK52xx carrier board
I2C:   85 kHz, ready
DRAM:  128 MB
FLASH:  4 MB
In:    serial
Out:   serial
Err:   serial
Net:   FEC ETHERNET
POST i2c PASSED
POST cpu PASSED
IDE:   Bus 0: not available
VGA:   SMI501 (Voyager) with 8 MB
PS/2:  No device found
Kbd:   reset failed, no ACK

Type "run flash_nfs" to mount root filesystem over NFS

Hit any key to stop autoboot:  0
=> usb start
(Re)start USB...
USB:   scanning bus for devices... ERROR: CTL:TIMEOUT

      USB device not responding, giving up (status=20)
2 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
=> usb info
1: Hub,  USB Revision 1.10
 -  OHCI Root Hub
 - Class: Hub
 - PacketSize: 8  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 0.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms

   Configuration: 0
   - Interfaces: 0 Bus Powered 0mA

=> usb reset
(Re)start USB...
USB:   scanning bus for devices... ERROR: CTL:TIMEOUT

      USB device not responding, giving up (status=20)
2 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
=>

I repeated the test with some older U-Boot versions (with the
generic OHCI driver), but on neither USB sticks are working :(

Best Regards,
Martin Krause

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

Gmane