From: Remco Poelstra <remco.poelstra@duran-audio.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Strange data behaviour
Date: Wed, 18 Feb 2009 09:19:08 +0100 [thread overview]
Message-ID: <499BC47C.6060601@duran-audio.com> (raw)
In-Reply-To: <20090217191211.5C469832E893@gemini.denx.de>
Wolfgang Denk schreef:
>> U0THR = hex_data[(0xDEADBEEF>>4)&0xF];
>> }
>> }
>> ---------------
>> When I run it likes this I get 8 E's. Which is what I expect. When I run
>> it with the commented-out line, I get back 8 0x0's. So it seems that the
>> output is only correct when it is constant.
>> Does anyone have a clue on why that is?
>
> What exactly is U0THR ?
Hi,
Thanks for your reply.
For my processor, U0THR is defnied as:
#define U0THR (*(volatile unsigned char *)(UART0_BASE_ADDR +
0x00))
UART0_BASE_ADDR is equal to 0xE000C000
The register itself represents the top of the UART0 transmit FIFO.
>
> The only definition I can find in the U-Boot sources is here:
>
> include/asm-arm/arch-lpc2292/lpc2292_registers.h:#define U0THR 0xE000C000
>
> but that is obviously not what you are using.
>
> You probably forget the effects of compiler optimization and/or
> caching here.
>
>
> I bet you are using a plain pointer access without a "volatile",
> which is essential here. Maybe even some form of "sync" is needed. In
> any case, you should use appropriate accessor functions to access
> device registers.
I do not know any accessor functions.
What do you mean with a "sync"?
Kind regards,
Remco Poelstra
next prev parent reply other threads:[~2009-02-18 8:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-17 11:55 [U-Boot] Strange data behaviour Remco Poelstra
2009-02-17 19:12 ` Wolfgang Denk
2009-02-18 8:19 ` Remco Poelstra [this message]
2009-02-19 0:32 ` Kim Phillips
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=499BC47C.6060601@duran-audio.com \
--to=remco.poelstra@duran-audio.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox