* [U-Boot] 405EP U-boot/Linux Question (CFG_OCM_DATA_ADDR)
@ 2009-01-28 21:32 Pawel Pastuszak
2009-01-29 5:02 ` Stefan Roese
0 siblings, 1 reply; 2+ messages in thread
From: Pawel Pastuszak @ 2009-01-28 21:32 UTC (permalink / raw)
To: u-boot
Hi guys,
I was wondering if some one could give me an hand with OCM for PPC405EP
So my goal is to Access *CFG_BOOTCOUNT_ADDR *value in Linux based on
http://www.denx.de/wiki/view/DULG/UBootBootCountLimit
In u-boot it works fine but ... but how to i talk to this memory range in
linux.
I tried the following but no luck.
ulong * save_addr = ioremap( (CFG_OCM_DATA_ADDR + CFG_BOOTCOUNT_ADDR),8
);
if (save_addr[1] != BOOTCOUNT_MAGIC)
return 0;
else
return save_addr[0];
u-boot config file setting:
#define *CFG_OCM_DATA_ADDR* 0xF8000000
#define CFG_OCM_DATA_SIZE 0x1000
#define CFG_INIT_RAM_ADDR CFG_OCM_DATA_ADDR /* inside of OCM */
#define CFG_INIT_RAM_END CFG_OCM_DATA_SIZE /* End of used area in RAM
*/
#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data
*/
#define CFG_GBL_DATA_OFFSET (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
/* reserve some memory for POST and BOOT limit info */
#define CFG_INIT_SP_OFFSET (CFG_GBL_DATA_OFFSET - 24)
/* extra data in OCM */
#define CFG_POST_WORD_ADDR (CFG_GBL_DATA_OFFSET - 4)
#define CFG_POST_MAGIC (CFG_OCM_DATA_ADDR + CFG_GBL_DATA_OFFSET - 8)
#define CFG_POST_VAL (CFG_OCM_DATA_ADDR + CFG_GBL_DATA_OFFSET - 12)
#ifdef CONFIG_BOOTCOUNT_LIMIT /* reserve 2 word for bootcount limit */
#define CFG_BOOTCOUNT_ADDR (CFG_GBL_DATA_OFFSET - 24)
//#define *CFG_BOOTCOUNT_ADDR* (CFG_OCM_DATA_ADDR + CFG_GBL_DATA_OFFSET -
16)
#endif
Any suggestion?
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot] 405EP U-boot/Linux Question (CFG_OCM_DATA_ADDR)
2009-01-28 21:32 [U-Boot] 405EP U-boot/Linux Question (CFG_OCM_DATA_ADDR) Pawel Pastuszak
@ 2009-01-29 5:02 ` Stefan Roese
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2009-01-29 5:02 UTC (permalink / raw)
To: u-boot
On Wednesday 28 January 2009, Pawel Pastuszak wrote:
> I was wondering if some one could give me an hand with OCM for PPC405EP
>
> So my goal is to Access *CFG_BOOTCOUNT_ADDR *value in Linux based on
> http://www.denx.de/wiki/view/DULG/UBootBootCountLimit
Please note that its CONFIG_SYS_BOOTCOUNT_ADDR now.
> In u-boot it works fine but ... but how to i talk to this memory range in
> linux.
>
> I tried the following but no luck.
> ulong * save_addr = ioremap( (CFG_OCM_DATA_ADDR + CFG_BOOTCOUNT_ADDR),8
> );
>
> if (save_addr[1] != BOOTCOUNT_MAGIC)
> return 0;
> else
> return save_addr[0];
And what's the result of the above code? Do you get an exception? Or some
unreasonable values?
Which kernel version are you using?
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
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-29 5:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28 21:32 [U-Boot] 405EP U-boot/Linux Question (CFG_OCM_DATA_ADDR) Pawel Pastuszak
2009-01-29 5:02 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox