summaryrefslogtreecommitdiff
path: root/nuttx/arch
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch')
-rw-r--r--nuttx/arch/arm/src/c5471/c5471_serial.c8
-rw-r--r--nuttx/arch/arm/src/common/up_internal.h2
-rw-r--r--nuttx/arch/arm/src/dm320/dm320_serial.c12
-rw-r--r--nuttx/arch/c5471/src/up_internal.h2
-rw-r--r--nuttx/arch/c5471/src/up_serial.c8
-rw-r--r--nuttx/arch/dm320/src/up_internal.h2
-rw-r--r--nuttx/arch/dm320/src/up_serial.c12
7 files changed, 25 insertions, 21 deletions
diff --git a/nuttx/arch/arm/src/c5471/c5471_serial.c b/nuttx/arch/arm/src/c5471/c5471_serial.c
index 9ff5b5be9..375bacd81 100644
--- a/nuttx/arch/arm/src/c5471/c5471_serial.c
+++ b/nuttx/arch/arm/src/c5471/c5471_serial.c
@@ -409,16 +409,18 @@ static int up_setup(struct uart_dev_s *dev)
up_disablebreaks(priv);
- priv->regs.fcr = (priv->regs.fcr & 0xffffffcf) | (val & 0x30);
+ /* Set the RX and TX trigger levels to the minimum */
+
+ priv->regs.fcr = (priv->regs.fcr & 0xffffffcf) | UART_FCR_FTL;
up_serialout(priv, UART_RFCR_OFFS, priv->regs.fcr);
- priv->regs.fcr = (priv->regs.fcr & 0xffffff3f) | (val & 0xc0);
+ priv->regs.fcr = (priv->regs.fcr & 0xffffff3f) | UART_FCR_FTL;
up_serialout(priv, UART_RFCR_OFFS, priv->regs.fcr);
up_setrate(priv, priv->baud);
priv->regs.lcr &= 0xffffffe0; /* clear original field, and... */
- priv->regs.lcr |= (uint32)mode; /* Set new bits in that field. */
+ priv->regs.lcr |= (uint32)cval; /* Set new bits in that field. */
up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr);
#ifdef CONFIG_UART_HWFLOWCONTROL
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h
index a2be035ff..4d84f2cdd 100644
--- a/nuttx/arch/arm/src/common/up_internal.h
+++ b/nuttx/arch/arm/src/common/up_internal.h
@@ -52,7 +52,7 @@
#undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
-#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
+#define CONFIG_SUPPRESS_UART_CONFIG 1 /* Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* Dump task state on exit */
/****************************************************************************
diff --git a/nuttx/arch/arm/src/dm320/dm320_serial.c b/nuttx/arch/arm/src/dm320/dm320_serial.c
index 4f90fd5d3..be32d269b 100644
--- a/nuttx/arch/arm/src/dm320/dm320_serial.c
+++ b/nuttx/arch/arm/src/dm320/dm320_serial.c
@@ -292,13 +292,13 @@ static int up_setup(struct uart_dev_s *dev)
/* Clear fifos */
- up_serialout(priv, UART_DM320_RFCR, 0x8000);
- up_serialout(priv, UART_DM320_TFCR, 0x8000);
+ up_serialout(priv, UART_RFCR, 0x8000);
+ up_serialout(priv, UART_TFCR, 0x8000);
/* Set rx and tx triggers */
- up_serialout(priv, UART_DM320_RFCR, UART_RFCR_RTL_1);
- up_serialout(priv, UART_DM320_TFCR, UART_TFCR_TTL_16);
+ up_serialout(priv, UART_RFCR, UART_RFCR_RTL_1);
+ up_serialout(priv, UART_TFCR, UART_TFCR_TTL_16);
/* Set up the MSR */
@@ -336,7 +336,7 @@ static int up_setup(struct uart_dev_s *dev)
/* Set up the BRSR */
- switch (dev->baud)
+ switch (priv->baud)
{
case 2400:
brsr = UART_BAUD_2400;
@@ -380,7 +380,7 @@ static int up_setup(struct uart_dev_s *dev)
/* Setup the new UART configuration */
up_serialout(priv,UART_MSR, priv->msr);
- up_serialout(priv, UART_DM320_BRSR, brsr);
+ up_serialout(priv, UART_BRSR, brsr);
up_enablebreaks(priv, FALSE);
#endif
return OK;
diff --git a/nuttx/arch/c5471/src/up_internal.h b/nuttx/arch/c5471/src/up_internal.h
index c032fa543..fc3333bf9 100644
--- a/nuttx/arch/c5471/src/up_internal.h
+++ b/nuttx/arch/c5471/src/up_internal.h
@@ -60,7 +60,7 @@
#undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
-#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
+#define CONFIG_SUPPRESS_UART_CONFIG 1 /* Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* Dump task state on exit */
/************************************************************
diff --git a/nuttx/arch/c5471/src/up_serial.c b/nuttx/arch/c5471/src/up_serial.c
index 3cba4a2d8..7b2b9a24e 100644
--- a/nuttx/arch/c5471/src/up_serial.c
+++ b/nuttx/arch/c5471/src/up_serial.c
@@ -406,16 +406,18 @@ static int up_setup(struct uart_dev_s *dev)
up_disablebreaks(priv);
- priv->regs.fcr = (priv->regs.fcr & 0xffffffcf) | (val & 0x30);
+ /* Set the RX and TX trigger levels to the minimum */
+
+ priv->regs.fcr = (priv->regs.fcr & 0xffffffcf) | UART_FCR_FTL;
up_serialout(priv, UART_RFCR_OFFS, priv->regs.fcr);
- priv->regs.fcr = (priv->regs.fcr & 0xffffff3f) | (val & 0xc0);
+ priv->regs.fcr = (priv->regs.fcr & 0xffffff3f) | UART_FCR_FTL;
up_serialout(priv, UART_RFCR_OFFS, priv->regs.fcr);
up_setrate(priv, priv->baud);
priv->regs.lcr &= 0xffffffe0; /* clear original field, and... */
- priv->regs.lcr |= (uint32)mode; /* Set new bits in that field. */
+ priv->regs.lcr |= (uint32)cval; /* Set new bits in that field. */
up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr);
#ifdef CONFIG_UART_HWFLOWCONTROL
diff --git a/nuttx/arch/dm320/src/up_internal.h b/nuttx/arch/dm320/src/up_internal.h
index 6360d552b..16112d980 100644
--- a/nuttx/arch/dm320/src/up_internal.h
+++ b/nuttx/arch/dm320/src/up_internal.h
@@ -52,7 +52,7 @@
#undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
-#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
+#define CONFIG_SUPPRESS_UART_CONFIG 1 /* Do not reconfig UART */
#define CONFIG_DUMP_ON_EXIT 1 /* Dump task state on exit */
/************************************************************
diff --git a/nuttx/arch/dm320/src/up_serial.c b/nuttx/arch/dm320/src/up_serial.c
index 3d7c09837..bf6560f1c 100644
--- a/nuttx/arch/dm320/src/up_serial.c
+++ b/nuttx/arch/dm320/src/up_serial.c
@@ -287,13 +287,13 @@ static int up_setup(struct uart_dev_s *dev)
/* Clear fifos */
- up_serialout(priv, UART_DM320_RFCR, 0x8000);
- up_serialout(priv, UART_DM320_TFCR, 0x8000);
+ up_serialout(priv, UART_RFCR, 0x8000);
+ up_serialout(priv, UART_TFCR, 0x8000);
/* Set rx and tx triggers */
- up_serialout(priv, UART_DM320_RFCR, UART_RFCR_RTL_1);
- up_serialout(priv, UART_DM320_TFCR, UART_TFCR_TTL_16);
+ up_serialout(priv, UART_RFCR, UART_RFCR_RTL_1);
+ up_serialout(priv, UART_TFCR, UART_TFCR_TTL_16);
/* Set up the MSR */
@@ -331,7 +331,7 @@ static int up_setup(struct uart_dev_s *dev)
/* Set up the BRSR */
- switch (dev->baud)
+ switch (priv->baud)
{
case 2400:
brsr = UART_BAUD_2400;
@@ -375,7 +375,7 @@ static int up_setup(struct uart_dev_s *dev)
/* Setup the new UART configuration */
up_serialout(priv,UART_MSR, priv->msr);
- up_serialout(priv, UART_DM320_BRSR, brsr);
+ up_serialout(priv, UART_BRSR, brsr);
up_enablebreaks(priv, FALSE);
#endif
return OK;