All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Fuchs <mfuchs@ma-fu.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ppc4xx: Enable auto RS485 mode on PLU405 boards
Date: Sun, 28 Dec 2008 19:23:45 +0100	[thread overview]
Message-ID: <200812281923.45981.mfuchs@ma-fu.de> (raw)

This patch turns on the auto RS485 mode in the 2nd external
uart on PLU405 boards. This is a special mode of the used
Exar XR16C2850 uart. Because these boards only have a 485 physical
layer connected it's a good idea to turn it on by default.

Signed-off-by: Matthias Fuchs <mf@esd.eu>
---
 board/esd/plu405/plu405.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/esd/plu405/plu405.c b/board/esd/plu405/plu405.c
index 61186a8..4a152c3 100644
--- a/board/esd/plu405/plu405.c
+++ b/board/esd/plu405/plu405.c
@@ -104,6 +104,7 @@ int misc_init_r (void)
 	unsigned char *duart0_mcr = (unsigned char *)((ulong)DUART0_BA + 4);
 	unsigned char *duart1_mcr = (unsigned char *)((ulong)DUART1_BA + 4);
 	unsigned char *dst;
+	unsigned char fctr;
 	ulong len = sizeof(fpgadata);
 	int status;
 	int index;
@@ -203,6 +204,15 @@ int misc_init_r (void)
 	out_8(duart0_mcr, 0x08);
 	out_8(duart1_mcr, 0x08);
 
+	/* 
+	 * Enable auto RS485 mode in 2nd external uart 
+	 */
+	out_8((void *)DUART1_BA + 3, 0xbf); /* write LCR */
+	fctr = in_8((void *)DUART1_BA + 1); /* read FCTR */
+	fctr |= 0x08;                       /* enable RS485 mode */
+	out_8((void *)DUART1_BA + 1, fctr); /* write FCTR */
+	out_8((void *)DUART1_BA + 3, 0);    /* write LCR */
+
 	return (0);
 }
 
-- 
1.5.6.3

             reply	other threads:[~2008-12-28 18:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-28 18:23 Matthias Fuchs [this message]
2009-01-02 11:16 ` [U-Boot] [PATCH V2] ppc4xx: Enable auto RS485 mode on PLU405 boards Matthias Fuchs
2009-01-14 10:36   ` Stefan Roese

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=200812281923.45981.mfuchs@ma-fu.de \
    --to=mfuchs@ma-fu.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 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.