Skip to contentSkip to conversation

ARM: S3C2412: SoC has the fractional baud rate register

PATCH New Michel Pollet 2 participants 7 messages Jan 27, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ARM: S3C2412: SoC has the fractional baud rate register

So add it's flag to the UART definition to allow generation of more precise baud rates for the various clock combinations.

---
 drivers/serial/s3c2412.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/serial/s3c2412.c +1 -0
index ce75e28..1700b1a 100644
@@ -102,6 +102,7 @@ static struct s3c24xx_uart_info s3c2412_uart_inf = {
 	.name		= "Samsung S3C2412 UART",
 	.type		= PORT_S3C2412,
 	.fifosize	= 64,
+	.has_divslot	= 1,
 	.rx_fifomask	= S3C2440_UFSTAT_RXMASK,
 	.rx_fifoshift	= S3C2440_UFSTAT_RXSHIFT,
 	.rx_fifofull	= S3C2440_UFSTAT_RXFULL,
Signature · 1 line
1.6.6
#1 lore raw

PATCH 2/3 ARM: S3C: Configuration override for UART names

S3C UART devices are named s3c2410_serialX and it is inconsistent with the kernel at boot time (console=ttySACx) This patch allows the config file to override this and use the standard name instead.

---
 drivers/serial/samsung.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/serial/samsung.c +8 -1
index 52e3df1..e3dd135 100644
@@ -55,7 +55,14 @@
 
 /* UART name and device definitions */
 
+#ifdef CONFIG_S3C_STD_UART_NAMES
+/* All other SoC use this naming sheme, 
+   including the kernel earlier at boot time */
 #define S3C24XX_SERIAL_NAME	"ttySAC"
+#else
+/* Legacy option */
+#define S3C24XX_SERIAL_NAME	"s3c2410_serial"
+#endif
 #define S3C24XX_SERIAL_MAJOR	204
 #define S3C24XX_SERIAL_MINOR	64
 
@@ -878,7 +885,7 @@ static struct uart_ops s3c24xx_serial_ops = {
 
 static struct uart_driver s3c24xx_uart_drv = {
 	.owner		= THIS_MODULE,
-	.dev_name	= "s3c2410_serial",
+	.dev_name	= S3C24XX_SERIAL_NAME,
 	.nr		= CONFIG_SERIAL_SAMSUNG_UARTS,
 	.cons		= S3C24XX_SERIAL_CONSOLE,
 	.driver_name	= S3C24XX_SERIAL_NAME,
Signature · 1 line
1.6.6
#2 lore raw

PATCH 3/3 ARM: S3C: Kconfig option related to UART dev names

S3C UART devices are named s3c2410_serialX and it is inconsistent with the kernel at boot time (console=ttySACx) This patch allows the config file to override this and use the standard name instead.

---
 arch/arm/plat-s3c/Kconfig |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/plat-s3c/Kconfig +9 -0
index 9e9d028..158257a 100644
@@ -113,6 +113,15 @@ config S3C_LOWLEVEL_UART_PORT
 	  this configuration should be between zero and two. The port
 	  must have been initialised by the boot-loader before use.
 
+config S3C_STD_UART_NAMES
+	bool "Name S3C UART device files as ttySACx"
+	default n
+	help
+	  The kernel and most other SoC use the ttySACx naming scheme
+	  for UART device file naming. The default for S3C is to use
+	  s3c2410_serialX, and it confuses a lot of distros; it is also
+	  inconsistent with the console= kernel parameter.
+
 # options for gpiolib support
 
 config S3C_GPIO_SPACE
Signature · 1 line
1.6.6
#3 lore raw

PATCH 3/3 ARM: S3C: Kconfig option related to UART dev names

Quoted 4 lines · Michel Pollet

S3C UART devices are named s3c2410_serialX and it is inconsistent with the kernel at boot time (console=ttySACx) This patch allows the config file to override this and use the standard name instead.

Please merge ?#2 and #3 together.

Quoted 28 lines
---
 arch/arm/plat-s3c/Kconfig |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/plat-s3c/Kconfig +9 -0
index 9e9d028..158257a 100644
@@ -113,6 +113,15 @@ config S3C_LOWLEVEL_UART_PORT
 	  this configuration should be between zero and two. The port
 	  must have been initialised by the boot-loader before use.
 
+config S3C_STD_UART_NAMES
+	bool "Name S3C UART device files as ttySACx"
+	default n
+	help
+	  The kernel and most other SoC use the ttySACx naming scheme
+	  for UART device file naming. The default for S3C is to use
+	  s3c2410_serialX, and it confuses a lot of distros; it is also
+	  inconsistent with the console= kernel parameter.
+
 # options for gpiolib support
 
 config S3C_GPIO_SPACE
Signature · 1 line
1.6.6
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#4 lore raw

PATCH 2/3 ARM: S3C: Configuration override for UART names

In reply to Michel Pollet
Quoted 4 lines · Michel Pollet

S3C UART devices are named s3c2410_serialX and it is inconsistent with the kernel at boot time (console=ttySACx) This patch allows the config file to override this and use the standard name instead.

Is this fixing an actual problem? if so what problem?

Quoted 36 lines
---
 drivers/serial/samsung.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/serial/samsung.c +8 -1
index 52e3df1..e3dd135 100644
@@ -55,7 +55,14 @@
 
 /* UART name and device definitions */
 
+#ifdef CONFIG_S3C_STD_UART_NAMES
+/* All other SoC use this naming sheme, 
+   including the kernel earlier at boot time */
 #define S3C24XX_SERIAL_NAME	"ttySAC"
+#else
+/* Legacy option */
+#define S3C24XX_SERIAL_NAME	"s3c2410_serial"
+#endif
 #define S3C24XX_SERIAL_MAJOR	204
 #define S3C24XX_SERIAL_MINOR	64
 
@@ -878,7 +885,7 @@ static struct uart_ops s3c24xx_serial_ops = {
 
 static struct uart_driver s3c24xx_uart_drv = {
 	.owner		= THIS_MODULE,
-	.dev_name	= "s3c2410_serial",
+	.dev_name	= S3C24XX_SERIAL_NAME,
 	.nr		= CONFIG_SERIAL_SAMSUNG_UARTS,
 	.cons		= S3C24XX_SERIAL_CONSOLE,
 	.driver_name	= S3C24XX_SERIAL_NAME,
Signature · 1 line
1.6.6
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
author
#5 lore raw

PATCH 2/3 ARM: S3C: Configuration override for UART names

Quoted 7 lines · Ben Dooks
Quoted 4 lines · Michel Pollet

S3C UART devices ?are named s3c2410_serialX and it is inconsistent with the kernel at boot time (console=ttySACx) This patch allows the config file to override this and use the standard name instead.

Is this fixing an actual problem? if so what problem?

Boot with console=ttySAC0,xxx and you never find the /dev/ttySAC0 in /dev afterward. OpenWRT get fooled, Angstrom/OE gets fooled and so forth. In most case you spend some entertaining time trying to figure out why you can't get a console running even tho it appears to have booted properly.

+ Is there something sufficiently different about the s3c2410_serial that it needs a reminder in the filename ? Do you have another case of an UART named "ppc_serial" or "omap_serial" ? (regardless of the fact that in many case, it's not even running on an s3c2410 proper)
+ Why have a different name than the one used by the console= parameter ?

Michel

Quoted 45 lines
Quoted 34 lines

---
?drivers/serial/samsung.c | ? ?9 ++++++++-
?1 files changed, 8 insertions(+), 1 deletions(-)

drivers/serial/samsung.c +0 -0
index 52e3df1..e3dd135 100644
@@ -55,7 +55,14 @@
 

?/* UART name and device definitions */

drivers/serial/samsung.c +3 -0
+#ifdef CONFIG_S3C_STD_UART_NAMES
+/* All other SoC use this naming sheme,
+ ? including the kernel earlier at boot time */

?#define S3C24XX_SERIAL_NAME ?"ttySAC"

drivers/serial/samsung.c +4 -0
+#else
+/* Legacy option */
+#define S3C24XX_SERIAL_NAME ?"s3c2410_serial"
+#endif

?#define S3C24XX_SERIAL_MAJOR 204
?#define S3C24XX_SERIAL_MINOR 64

drivers/serial/samsung.c +1 -2
@@ -878,7 +885,7 @@ static struct uart_ops s3c24xx_serial_ops = {
 
 ?static struct uart_driver s3c24xx_uart_drv = {
 ? ? ? .owner ? ? ? ? ?= THIS_MODULE,
- ? ? .dev_name ? ? ? = "s3c2410_serial",
+ ? ? .dev_name ? ? ? = S3C24XX_SERIAL_NAME,
 ? ? ? .nr ? ? ? ? ? ? = CONFIG_SERIAL_SAMSUNG_UARTS,
 ? ? ? .cons ? ? ? ? ? = S3C24XX_SERIAL_CONSOLE,
 ? ? ? .driver_name ? ?= S3C24XX_SERIAL_NAME,
--
Quoted 2 lines

1.6.6

--
--
Ben

Q: ? ? ?What's a light-year?
A: ? ? ?One-third less calories than a regular year.

#6 lore raw

PATCH 1/3 ARM: S3C2412: SoC has the fractional baud rate register

In reply to Michel Pollet
Quoted 3 lines · Michel Pollet

So add it's flag to the UART definition to allow generation of more precise baud rates for the various clock combinations.

Firstly, I'd like to see this read better by placing the subject at the front of this description

Secondly, it would be nice to re-wrap it to closer to 77 chars/line.

Quoted 20 lines
---
 drivers/serial/s3c2412.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/serial/s3c2412.c +1 -0
index ce75e28..1700b1a 100644
@@ -102,6 +102,7 @@ static struct s3c24xx_uart_info s3c2412_uart_inf = {
 	.name		= "Samsung S3C2412 UART",
 	.type		= PORT_S3C2412,
 	.fifosize	= 64,
+	.has_divslot	= 1,
 	.rx_fifomask	= S3C2440_UFSTAT_RXMASK,
 	.rx_fifoshift	= S3C2440_UFSTAT_RXSHIFT,
 	.rx_fifofull	= S3C2440_UFSTAT_RXFULL,
Signature · 1 line
1.6.6
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.