From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 7/9] Samsung/serial: move the decision about an improved UART into Kconfig
Date: Fri, 20 Jul 2012 21:29:43 +0200 [thread overview]
Message-ID: <1342812585-22017-8-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1342812585-22017-1-git-send-email-jbe@pengutronix.de>
More or less just cosmetic (removing ifdefs!).
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
---
arch/arm/mach-samsung/Kconfig | 5 +++++
arch/arm/mach-samsung/include/mach/s5pcxx-iomap.h | 5 +++--
drivers/serial/serial_s3c.c | 16 ++++++++--------
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-samsung/Kconfig b/arch/arm/mach-samsung/Kconfig
index c60f5ed..37d1aa3 100644
--- a/arch/arm/mach-samsung/Kconfig
+++ b/arch/arm/mach-samsung/Kconfig
@@ -18,6 +18,9 @@ config ARCH_BAREBOX_MAX_BARE_INIT_SIZE
hex
default 0x1ff0 if ARCH_S5PCxx
+config SAMSUNG_IMPROVED_UART
+ bool
+
if ARCH_S3C24xx
config CPU_S3C2410
@@ -87,9 +90,11 @@ endif
if ARCH_S5PCxx
config CPU_S5PC110
+ select SAMSUNG_IMPROVED_UART
bool
config CPU_S5PV210
+ select SAMSUNG_IMPROVED_UART
bool
#choice
diff --git a/arch/arm/mach-samsung/include/mach/s5pcxx-iomap.h b/arch/arm/mach-samsung/include/mach/s5pcxx-iomap.h
index cb05527..448e3b8 100644
--- a/arch/arm/mach-samsung/include/mach/s5pcxx-iomap.h
+++ b/arch/arm/mach-samsung/include/mach/s5pcxx-iomap.h
@@ -45,5 +45,6 @@
#define S3C_UART2_SIZE 0x400
#define S3C_UART3_BASE (S3C_UART_BASE + 0x800)
#define S3C_UART3_SIZE 0x400
-#define S3C_UART_HAS_UBRDIVSLOT
-#define S3C_UART_HAS_UINTM
+
+#define S5P_DMC0_BASE 0xF0000000
+#define S5P_DMC1_BASE 0xF1400000
diff --git a/drivers/serial/serial_s3c.c b/drivers/serial/serial_s3c.c
index 2cb2eef..01f2246 100644
--- a/drivers/serial/serial_s3c.c
+++ b/drivers/serial/serial_s3c.c
@@ -79,10 +79,11 @@ static int s3c_serial_setbaudrate(struct console_device *cdev, int baudrate)
void __iomem *base = priv->regs;
unsigned val;
-#ifdef S3C_UART_HAS_UBRDIVSLOT
- val = s3c_get_arch_uart_input_clock(base) / baudrate;
- writew(udivslot_table[val & 15], base + UBRDIVSLOT);
-#endif
+ if (IS_ENABLED(CONFIG_SAMSUNG_IMPROVED_UART)) {
+ val = s3c_get_arch_uart_input_clock(base) / baudrate;
+ writew(udivslot_table[val & 15], base + UBRDIVSLOT);
+ }
+
val = s3c_get_arch_uart_input_clock(base) / (16 * baudrate) - 1;
writew(val, base + UBRDIV);
@@ -106,10 +107,9 @@ static int s3c_serial_init_port(struct console_device *cdev)
writew(0x0245 | UCON_SET_CLK_SRC(S3C_UART_CLKSEL),
base + UCON);
-#ifdef S3C_UART_HAS_UINTM
- /* 'interrupt or polling mode' for both directions */
- writeb(0xf, base + UINTM);
-#endif
+ if (IS_ENABLED(CONFIG_SAMSUNG_IMPROVED_UART))
+ /* 'interrupt or polling mode' for both directions */
+ writeb(0xf, base + UINTM);
if (IS_ENABLED(CONFIG_DRIVER_SERIAL_S3C_AUTOSYNC))
writeb(0x10, base + UMCON); /* enable auto flow control */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-07-20 19:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 19:29 [PATCH] ARM/Samsung: more clean up Juergen Beisert
2012-07-20 19:29 ` [PATCH 1/9] ARM/Samsung: List only really supported S3C24xx SoCs Juergen Beisert
2012-07-20 19:29 ` [PATCH 2/9] ARM/Samsung: follow the name style of the other source files in this directory Juergen Beisert
2012-07-20 19:29 ` [PATCH 3/9] Samsung/serial: remove more ugly ifdef lines Juergen Beisert
2012-07-20 19:29 ` [PATCH 4/9] Samsung/serial: make the code more readable Juergen Beisert
2012-07-20 19:29 ` [PATCH 5/9] Samsung/serial: there is no need to ifdef these register defines Juergen Beisert
2012-07-20 19:29 ` [PATCH 6/9] Samsung/serial: there is no need to ifdef the slot table Juergen Beisert
2012-07-20 19:29 ` Juergen Beisert [this message]
2012-07-23 6:41 ` [PATCH 7/9] Samsung/serial: move the decision about an improved UART into Kconfig Sascha Hauer
2012-07-24 9:24 ` [PATCH] ARM/Samsung: remaining clean up Juergen Beisert
2012-07-24 9:24 ` [PATCH 1/3] Samsung/serial: move the decision about an improved UART into Kconfig Juergen Beisert
2012-07-24 9:24 ` [PATCH 2/3] Samsung/serial: unify UCON register settings Juergen Beisert
2012-07-24 9:24 ` [PATCH 3/3] Samsung/serial: make the clock source configureable Juergen Beisert
2012-07-25 6:31 ` [PATCH] ARM/Samsung: remaining clean up Sascha Hauer
2012-07-20 19:29 ` [PATCH 8/9] Samsung/serial: unify UCON register settings Juergen Beisert
2012-07-20 19:29 ` [PATCH 9/9] Samsung/serial: make the clock source configureable Juergen Beisert
2012-07-23 22:10 ` [PATCH] ARM/Samsung: more clean up Sascha Hauer
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=1342812585-22017-8-git-send-email-jbe@pengutronix.de \
--to=jbe@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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