From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] AT91 Rework
Date: Thu, 05 Nov 2009 18:06:12 +0100 [thread overview]
Message-ID: <20091105170612.4932D3F6EC@gemini.denx.de> (raw)
In-Reply-To: <hcspnl$oud$1@ger.gmane.org>
Dear Jens,
In message <hcspnl$oud$1@ger.gmane.org> you wrote:
>
> what you are mean to the following code snippet
>
> it decrpipts then AT91 timercontroller and lot of TC configuration bits
>
> I am on the right way?
Thanks - yes you are.
Umm... you are quite active for AT91 now - the position of the AT91
is still orphaned; did you ever think about volunteering?
> typedef struct at91_tcc {
> ulong ccr; /* 0x00 Channel Control Register */
> ulong cmr; /* 0x04 Channel Mode Register */
> ulong reserved1[2];
> ulong cv; /* 0x10 Counter Value */
> ulong ra; /* 0x14 Register A */
> ulong rb; /* 0x18 Register B */
> ulong rc; /* 0x1C Register C */
> ulong sr; /* 0x20 Status Register */
> ulong ier; /* 0x24 Interrupt Enable Register */
> ulong idr; /* 0x28 Interrupt Disable Register */
> ulong imr; /* 0x2C Interrupt Mask Register */
> ulong reserved3[4];
> } at91_tcc_t;
I recomment to make this "u32" instead of "ulong".
> #define AT91_TC_CCR_CLKEN ((ulong) 0x00000001)
> #define AT91_TC_CCR_CLKDIS ((ulong) 0x00000002)
> #define AT91_TC_CCR_SWTRG ((ulong) 0x00000004)
These casts should not be needed:
#define AT91_TC_CCR_CLKEN 1
#define AT91_TC_CCR_CLKDIS 2
#define AT91_TC_CCR_SWTRG 4
> typedef struct at91_tc {
> at91_tcc_t tc[3]; /* 0x00 TC Channel 0-2 */
> ulong bcr; /* 0xC0 TC Block Control Register */
> ulong bmr; /* 0xC4 TC Block Mode Register */
> } at91_tc_t;
again, please use "u32" instead of "ulong".
> #define AT91_TC_BMR_TC0XC0S_TCLK0 ((ulong) 0x00000000)
> #define AT91_TC_BMR_TC0XC0S_NONE ((ulong) 0x00000001)
> #define AT91_TC_BMR_TC0XC0S_TIOA1 ((ulong) 0x00000002)
> #define AT91_TC_BMR_TC0XC0S_TIOA2 ((ulong) 0x00000003)
>
> #define AT91_TC_BMR_TC1XC1S_TCLK1 ((ulong) 0x00000000)
> #define AT91_TC_BMR_TC1XC1S_NONE ((ulong) 0x00000004)
> #define AT91_TC_BMR_TC1XC1S_TIOA0 ((ulong) 0x00000008)
> #define AT91_TC_BMR_TC1XC1S_TIOA2 ((ulong) 0x0000000C)
>
> #define AT91_TC_BMR_TC2XC0S_TCLK2 ((ulong) 0x00000000)
> #define AT91_TC_BMR_TC2XC0S_NONE ((ulong) 0x00000010)
> #define AT91_TC_BMR_TC2XC0S_TIOA0 ((ulong) 0x00000020)
> #define AT91_TC_BMR_TC2XC0S_TIOA1 ((ulong) 0x00000030)
again, please drop at least the parens and the casts.
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
To the systems programmer, users and applications serve only to
provide a test load.
next prev parent reply other threads:[~2009-11-05 17:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 19:10 [U-Boot] AT91 Rework Jens Scharsig
2009-11-04 20:58 ` Jens Scharsig
2009-11-05 17:06 ` Wolfgang Denk [this message]
2009-11-05 18:55 ` Jens Scharsig
2009-11-05 20:12 ` Wolfgang Denk
2009-11-07 19:37 ` Jens Scharsig
2009-11-09 21:45 ` 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=20091105170612.4932D3F6EC@gemini.denx.de \
--to=wd@denx.de \
--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