public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: Paul Pham <ppham@MIT.EDU>
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] Samsung register problem
Date: Tue, 23 Jan 2001 07:15:00 -0000	[thread overview]
Message-ID: <20010123092024.A27947@visi.com> (raw)
In-Reply-To: <NEBBLDBMIIDEJLLIEJFBMEIPCAAA.ppham@mit.edu>

> For those of you working on a Samsung chip, I need some help debugging my
> code. The following are excerpts from hal_diag.c
[...]

> void hal_diag_init(void)
> {
>   static int init = 0;
>   char *msg = "\n\rDARPA eCos\n\r";
> 
>   if (init++) return;
> 
>   /* iRDA mode off, 8-N-1. */
>   HAL_WRITE_UINT8 (ULCON, ULCON_IRDA_DISABLE |
> 		          ULCON_PARITY_NONE  |
>                           ULCON_STOP_1_BITS  |
> 		          ULCON_WORD_8_BITS);
>   HAL_WRITE_UINT16 (UBRDIV, UBRDIV_BAUD_RATE(115200));
>   HAL_WRITE_UINT8 (UCON,  UCON_RCV_MODE_INT          |
> 		          UCON_XMT_MODE_INT          |
> 		          UCON_SEND_BREAK_DISABLE    |
> 		          UCON_LOOPBACK_DISABLE      |
> 		          UCON_RCV_STATUS_INT_ENABLE |
> 		          UCON_RCV_TIMEOUT_DISABLE);
>   HAL_WRITE_UINT8 (UFCON, UFCON_ENABLE          |
> 		          UFCON_RCV_RESET           |
> 		          UFCON_XMT_RESET           |
> 		          UFCON_RCV_TRIGGER_4_BYTES |
> 		          UFCON_XMT_TRIGGER_4_BYTES);
> 
>     while (*msg) {
>       hal_diag_write_char(*msg++);
>     }
> }
>
>
> void hal_diag_write_char(char c)
> {
>     hal_diag_init();
>     while (!USTAT_XMT_HOLDING_EMPTY());
> 
>     HAL_WRITE_UINT8 (UTXH_B, c);
>     HAL_IO_BARRIER ();
> #ifdef DEBUG_DIAG
>     diag_buffer[diag_bp++] = c;
>     if (diag_bp == DIAG_BUFSIZE) diag_bp = 0;
> #endif
> }

I use all 32-bit reads/writes when I access the UARTs.

I don't know which part you're using, but in the ks32c5000, all
of the UART registers are 32 bits wide.  They're on 4-byte
address boundaries at e000, e004, e008, e00c, e010, etc.  

For example, the status register is at e008.  If you're in
big-endian mode, doing at 8-bit read at e008 will get you bits
24-31 of the status register (the stuff you want is in bits
0-7).

What are the values of ULCON, UBRDIV, UCON, UFCON, etc.?

-- 
Grant Edwards
grante@visi.com

      reply	other threads:[~2001-01-23  7:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-22 18:05 Paul Pham
2001-01-23  7:15 ` Grant Edwards [this message]

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=20010123092024.A27947@visi.com \
    --to=grante@visi.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=ppham@MIT.EDU \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).