All of lore.kernel.org
 help / color / mirror / Atom feed
From: llandre <r&d2@dave-tech.it>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] simple_strtoul overwrites bd_info field
Date: Tue, 29 Aug 2006 17:44:45 +0200	[thread overview]
Message-ID: <44F460ED.2070006@dave-tech.it> (raw)

I'm experiencing the following problem when building U-Boot with GCC 
4.0.0 provided by ELDK 4.0 ARM.
My struct bd_info looks like this:

typedef struct bd_info {
     int			bi_baudrate;	/* serial console baudrate */
     unsigned long	bi_ip_addr;	/* IP Address */
     unsigned char	bi_enetaddr[6]; /* Ethernet adress */
     struct environment_s	       *bi_env;
     ulong	        bi_arch_number;	/* unique id for this board */
     ulong	        bi_boot_params;	/* where this board expects params */
#if defined(CONFIG_ZEFEER_DZA) || defined(CONFIG_ZEFEER_DZB) || \
	defined(CONFIG_ZEFEER_DZG) || defined(CONFIG_ZEFEER_DZN) || 
defined(CONFIG_ZEFEER_DZQ)
     struct				/* RAM configuration */
     {
	ulong start;
	ulong size;
     } 			bi_dram[CONFIG_MAX_NR_DRAM_BANKS];
     unsigned char nr_dram_bank;
#else
     struct				/* RAM configuration */
     {
	ulong start;
	ulong size;
     } 			bi_dram[CONFIG_NR_DRAM_BANKS];
#endif
#ifdef CONFIG_HAS_ETH1
     /* second onboard ethernet port */
     unsigned char   bi_enet1addr[6];
#endif
} bd_t;


The SDRAM detection algorithm finds how many SDRAM blocks are and how 
big they are. It fills the following fields accordingly.

     struct				/* RAM configuration */
     {
	ulong start;
	ulong size;
     } 			bi_dram[CONFIG_MAX_NR_DRAM_BANKS];
     unsigned char nr_dram_bank;

When start_armboot invokes simple_strtoul to fill the bi_enetaddr field, 
the bi_dram[1].start field gets overwritten with a spurious value. Is it 
actually a GCC-related problem? Any suggestions?



TIA,
llandre

DAVE Electronics System House - R&D Department
web:   http://www.dave-tech.it
email: r&d2 at dave-tech.it

             reply	other threads:[~2006-08-29 15:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 15:44 llandre [this message]
2006-08-29 16:04 ` [U-Boot-Users] simple_strtoul overwrites bd_info field Wolfgang Denk
2006-08-30  7:58   ` llandre
2006-08-30  8:14     ` Wolfgang Denk
2006-08-30  8:38       ` llandre
2006-08-30  8:52         ` llandre
2006-08-30 10:13         ` Wolfgang Denk
2006-08-31 11:15           ` llandre
2006-08-31 12:26             ` Wolfgang Denk

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=44F460ED.2070006@dave-tech.it \
    --to=r&d2@dave-tech.it \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.