summaryrefslogtreecommitdiffstats
path: root/board/trab/rs485.c
diff options
context:
space:
mode:
authorC Nauman <cnauman@diagraph.com>2010-10-26 23:04:31 +0900
committerMinkyu Kang <mk7.kang@samsung.com>2010-10-28 15:35:56 +0900
commitd9abba8254c3e6b9a1d5c2e52c2d8088bbeb520f (patch)
tree7f97ab2012dfa882e65290138379e22de31bf227 /board/trab/rs485.c
parent1628cfc4fe4b2c3caa7e9d5622f0665c54e8ba6e (diff)
downloadtalos-obmc-uboot-d9abba8254c3e6b9a1d5c2e52c2d8088bbeb520f.tar.gz
talos-obmc-uboot-d9abba8254c3e6b9a1d5c2e52c2d8088bbeb520f.zip
Add generic support for samsung s3c2440
This patch adds generic support for the Samsung s3c2440 processor. Global s3c24x0 changes to struct members converting from upper case to lower case. Signed-off-by: Craig Nauman <cnauman@diagraph.com> Cc: kevin.morfitt@fearnside-systems.co.uk Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'board/trab/rs485.c')
-rw-r--r--board/trab/rs485.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/board/trab/rs485.c b/board/trab/rs485.c
index 6a3a4cda9c..30336f262c 100644
--- a/board/trab/rs485.c
+++ b/board/trab/rs485.c
@@ -51,16 +51,16 @@ static void rs485_setbrg (void)
reg = (33000000 / (16 * 38400)) - 1;
/* FIFO enable, Tx/Rx FIFO clear */
- uart->UFCON = 0x07;
- uart->UMCON = 0x0;
+ uart->ufcon = 0x07;
+ uart->umcon = 0x0;
/* Normal,No parity,1 stop,8 bit */
- uart->ULCON = 0x3;
+ uart->ulcon = 0x3;
/*
* tx=level,rx=edge,disable timeout int.,enable rx error int.,
* normal,interrupt or polling
*/
- uart->UCON = 0x245;
- uart->UBRDIV = reg;
+ uart->ucon = 0x245;
+ uart->ubrdiv = reg;
for (i = 0; i < 100; i++);
}
@@ -69,16 +69,16 @@ static void rs485_cfgio (void)
{
struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- gpio->PFCON &= ~(0x3 << 2);
- gpio->PFCON |= (0x2 << 2); /* configure GPF1 as RXD1 */
+ gpio->pfcon &= ~(0x3 << 2);
+ gpio->pfcon |= (0x2 << 2); /* configure GPF1 as RXD1 */
- gpio->PFCON &= ~(0x3 << 6);
- gpio->PFCON |= (0x2 << 6); /* configure GPF3 as TXD1 */
+ gpio->pfcon &= ~(0x3 << 6);
+ gpio->pfcon |= (0x2 << 6); /* configure GPF3 as TXD1 */
- gpio->PFUP |= (1 << 1); /* disable pullup on GPF1 */
- gpio->PFUP |= (1 << 3); /* disable pullup on GPF3 */
+ gpio->pfup |= (1 << 1); /* disable pullup on GPF1 */
+ gpio->pfup |= (1 << 3); /* disable pullup on GPF3 */
- gpio->PACON &= ~(1 << 11); /* set GPA11 (RS485_DE) to output */
+ gpio->pacon &= ~(1 << 11); /* set GPA11 (RS485_DE) to output */
}
/*
@@ -104,9 +104,10 @@ int rs485_getc (void)
struct s3c24x0_uart * const uart = s3c24x0_get_base_uart(UART_NR);
/* wait for character to arrive */
- while (!(uart->UTRSTAT & 0x1));
+ while (!(uart->utrstat & 0x1))
+ ;
- return uart->URXH & 0xff;
+ return uart->urxh & 0xff;
}
/*
@@ -117,9 +118,10 @@ void rs485_putc (const char c)
struct s3c24x0_uart * const uart = s3c24x0_get_base_uart(UART_NR);
/* wait for room in the tx FIFO */
- while (!(uart->UTRSTAT & 0x2));
+ while (!(uart->utrstat & 0x2))
+ ;
- uart->UTXH = c;
+ uart->utxh = c;
/* If \n, also do \r */
if (c == '\n')
@@ -133,7 +135,7 @@ int rs485_tstc (void)
{
struct s3c24x0_uart * const uart = s3c24x0_get_base_uart(UART_NR);
- return uart->UTRSTAT & 0x1;
+ return uart->utrstat & 0x1;
}
void rs485_puts (const char *s)
@@ -172,9 +174,9 @@ static void set_rs485de(unsigned char rs485de_state)
/* This is on PORT A bit 11 */
if(rs485de_state)
- gpio->PADAT |= (1 << 11);
+ gpio->padat |= (1 << 11);
else
- gpio->PADAT &= ~(1 << 11);
+ gpio->padat &= ~(1 << 11);
}
OpenPOWER on IntegriCloud