* [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol
@ 2014-10-01 16:42 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-01 16:42 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: linux-samsung-soc, gregkh, arnd, kgene.kim, tomasz.figa
Remove usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol from platform
specific code.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
---
Changes in v2:
- Re-ordered the patches
- Added a define for number of uart ports in arch/arm/plat-samsung/init.c
- Removed CONFIG_SERIAL_SAMSUNG #ifdef in arch/arm/plat-samsung/init.c
Build tested using s3c2410_defconfig, s3c6400_defconfig, exynos_defconfig
and arm64's defconfig with and without the serial driver enabled. Boot tested
on Exynos5420 and Exynos7.
arch/arm/mach-s3c64xx/irq-pm.c | 6 +++---
arch/arm/plat-samsung/init.c | 7 ++-----
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index ae4ea76..b20024e 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -55,10 +55,10 @@ static struct irq_grp_save {
u32 mask;
} eint_grp_save[5];
-#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
-#define SERIAL_SAMSUNG_UARTS 0
+#ifndef CONFIG_SERIAL_SAMSUNG
+#define SERIAL_SAMSUNG_UARTS 0
#else
-#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
+#define SERIAL_SAMSUNG_UARTS 4
#endif
static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index 11fbbc2..6114942 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -92,10 +92,9 @@ void __init s3c24xx_init_clocks(int xtal)
/* uart management */
#if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
static int nr_uarts __initdata = 0;
+#define MAX_UART_PORTS 4
-#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
-static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
-#endif
+static struct s3c2410_uartcfg uart_cfgs[MAX_UART_PORTS];
/* s3c24xx_init_uartdevs
*
@@ -110,7 +109,6 @@ void __init s3c24xx_init_uartdevs(char *name,
struct s3c24xx_uart_resources *res,
struct s3c2410_uartcfg *cfg, int no)
{
-#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
struct platform_device *platdev;
struct s3c2410_uartcfg *cfgptr = uart_cfgs;
struct s3c24xx_uart_resources *resp;
@@ -133,7 +131,6 @@ void __init s3c24xx_init_uartdevs(char *name,
}
nr_uarts = no;
-#endif
}
void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol
@ 2014-10-01 16:42 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-01 16:42 UTC (permalink / raw)
To: linux-arm-kernel
Remove usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol from platform
specific code.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
---
Changes in v2:
- Re-ordered the patches
- Added a define for number of uart ports in arch/arm/plat-samsung/init.c
- Removed CONFIG_SERIAL_SAMSUNG #ifdef in arch/arm/plat-samsung/init.c
Build tested using s3c2410_defconfig, s3c6400_defconfig, exynos_defconfig
and arm64's defconfig with and without the serial driver enabled. Boot tested
on Exynos5420 and Exynos7.
arch/arm/mach-s3c64xx/irq-pm.c | 6 +++---
arch/arm/plat-samsung/init.c | 7 ++-----
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index ae4ea76..b20024e 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -55,10 +55,10 @@ static struct irq_grp_save {
u32 mask;
} eint_grp_save[5];
-#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
-#define SERIAL_SAMSUNG_UARTS 0
+#ifndef CONFIG_SERIAL_SAMSUNG
+#define SERIAL_SAMSUNG_UARTS 0
#else
-#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
+#define SERIAL_SAMSUNG_UARTS 4
#endif
static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index 11fbbc2..6114942 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -92,10 +92,9 @@ void __init s3c24xx_init_clocks(int xtal)
/* uart management */
#if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
static int nr_uarts __initdata = 0;
+#define MAX_UART_PORTS 4
-#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
-static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
-#endif
+static struct s3c2410_uartcfg uart_cfgs[MAX_UART_PORTS];
/* s3c24xx_init_uartdevs
*
@@ -110,7 +109,6 @@ void __init s3c24xx_init_uartdevs(char *name,
struct s3c24xx_uart_resources *res,
struct s3c2410_uartcfg *cfg, int no)
{
-#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
struct platform_device *platdev;
struct s3c2410_uartcfg *cfgptr = uart_cfgs;
struct s3c24xx_uart_resources *resp;
@@ -133,7 +131,6 @@ void __init s3c24xx_init_uartdevs(char *name,
}
nr_uarts = no;
-#endif
}
void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-10-01 16:42 ` Abhilash Kesavan
@ 2014-10-01 16:42 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-01 16:42 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: linux-samsung-soc, gregkh, arnd, kgene.kim, tomasz.figa
Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
select the number of UART ports available on the SoC. Replace the usage
of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
UART ports possible. Removal of these symbols also helps in Exynos7
serial enablement.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/Kconfig | 16 ----------------
drivers/tty/serial/samsung.c | 11 +++--------
drivers/tty/serial/samsung.h | 5 ++++-
3 files changed, 7 insertions(+), 25 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 81f6ee7..9fc9092 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
provide all of these ports, depending on how the serial port
pins are configured.
-config SERIAL_SAMSUNG_UARTS_4
- bool
- depends on PLAT_SAMSUNG
- default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
- help
- Internal node for the common case of 4 Samsung compatible UARTs
-
-config SERIAL_SAMSUNG_UARTS
- int
- depends on PLAT_SAMSUNG
- default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
- default 3
- help
- Select the number of available UART ports for the Samsung S3C
- serial driver
-
config SERIAL_SAMSUNG_DEBUG
bool "Samsung SoC serial debug"
depends on SERIAL_SAMSUNG && DEBUG_LL
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c78f43a..ba04c6d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
static struct uart_driver s3c24xx_uart_drv = {
.owner = THIS_MODULE,
.driver_name = "s3c2410_serial",
- .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
+ .nr = MAX_SAMSUNG_UARTS,
.cons = S3C24XX_SERIAL_CONSOLE,
.dev_name = S3C24XX_SERIAL_NAME,
.major = S3C24XX_SERIAL_MAJOR,
.minor = S3C24XX_SERIAL_MINOR,
};
-static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
+static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
[0] = {
.port = {
.lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
@@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line = 1,
}
},
-#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
-
[2] = {
.port = {
.lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
@@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line = 2,
}
},
-#endif
-#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
[3] = {
.port = {
.lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
@@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line = 3,
}
}
-#endif
};
/* s3c24xx_serial_resetport
@@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
/* is this a valid port */
- if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
+ if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
co->index = 0;
port = &s3c24xx_serial_ports[co->index].port;
diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
index eb071dd..484b49e 100644
--- a/drivers/tty/serial/samsung.h
+++ b/drivers/tty/serial/samsung.h
@@ -1,6 +1,9 @@
#ifndef __SAMSUNG_H
#define __SAMSUNG_H
+/* Maximum UART ports available */
+#define MAX_SAMSUNG_UARTS 4
+
/*
* Driver for Samsung SoC onboard UARTs.
*
@@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
struct s3c24xx_serial_drv_data {
struct s3c24xx_uart_info *info;
struct s3c2410_uartcfg *def_cfg;
- unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
+ unsigned int fifosize[MAX_SAMSUNG_UARTS];
};
struct s3c24xx_uart_port {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-10-01 16:42 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-01 16:42 UTC (permalink / raw)
To: linux-arm-kernel
Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
select the number of UART ports available on the SoC. Replace the usage
of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
UART ports possible. Removal of these symbols also helps in Exynos7
serial enablement.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/Kconfig | 16 ----------------
drivers/tty/serial/samsung.c | 11 +++--------
drivers/tty/serial/samsung.h | 5 ++++-
3 files changed, 7 insertions(+), 25 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 81f6ee7..9fc9092 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
provide all of these ports, depending on how the serial port
pins are configured.
-config SERIAL_SAMSUNG_UARTS_4
- bool
- depends on PLAT_SAMSUNG
- default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
- help
- Internal node for the common case of 4 Samsung compatible UARTs
-
-config SERIAL_SAMSUNG_UARTS
- int
- depends on PLAT_SAMSUNG
- default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
- default 3
- help
- Select the number of available UART ports for the Samsung S3C
- serial driver
-
config SERIAL_SAMSUNG_DEBUG
bool "Samsung SoC serial debug"
depends on SERIAL_SAMSUNG && DEBUG_LL
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c78f43a..ba04c6d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
static struct uart_driver s3c24xx_uart_drv = {
.owner = THIS_MODULE,
.driver_name = "s3c2410_serial",
- .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
+ .nr = MAX_SAMSUNG_UARTS,
.cons = S3C24XX_SERIAL_CONSOLE,
.dev_name = S3C24XX_SERIAL_NAME,
.major = S3C24XX_SERIAL_MAJOR,
.minor = S3C24XX_SERIAL_MINOR,
};
-static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
+static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
[0] = {
.port = {
.lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
@@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line = 1,
}
},
-#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
-
[2] = {
.port = {
.lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
@@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line = 2,
}
},
-#endif
-#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
[3] = {
.port = {
.lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
@@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
.line = 3,
}
}
-#endif
};
/* s3c24xx_serial_resetport
@@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
/* is this a valid port */
- if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
+ if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
co->index = 0;
port = &s3c24xx_serial_ports[co->index].port;
diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
index eb071dd..484b49e 100644
--- a/drivers/tty/serial/samsung.h
+++ b/drivers/tty/serial/samsung.h
@@ -1,6 +1,9 @@
#ifndef __SAMSUNG_H
#define __SAMSUNG_H
+/* Maximum UART ports available */
+#define MAX_SAMSUNG_UARTS 4
+
/*
* Driver for Samsung SoC onboard UARTs.
*
@@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
struct s3c24xx_serial_drv_data {
struct s3c24xx_uart_info *info;
struct s3c2410_uartcfg *def_cfg;
- unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
+ unsigned int fifosize[MAX_SAMSUNG_UARTS];
};
struct s3c24xx_uart_port {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol
2014-10-01 16:42 ` Abhilash Kesavan
@ 2014-10-20 13:41 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-20 13:41 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-samsung-soc, gregkh, Arnd Bergmann, Kukjin Kim, Tomasz Figa
Hi Kukjin,
On Wed, Oct 1, 2014 at 10:12 PM, Abhilash Kesavan <a.kesavan@samsung.com> wrote:
> Remove usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol from platform
> specific code.
>
> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Can you please pick this up if it looks OK ?
Abhilash
> ---
> Changes in v2:
> - Re-ordered the patches
> - Added a define for number of uart ports in arch/arm/plat-samsung/init.c
> - Removed CONFIG_SERIAL_SAMSUNG #ifdef in arch/arm/plat-samsung/init.c
>
> Build tested using s3c2410_defconfig, s3c6400_defconfig, exynos_defconfig
> and arm64's defconfig with and without the serial driver enabled. Boot tested
> on Exynos5420 and Exynos7.
>
> arch/arm/mach-s3c64xx/irq-pm.c | 6 +++---
> arch/arm/plat-samsung/init.c | 7 ++-----
> 2 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
> index ae4ea76..b20024e 100644
> --- a/arch/arm/mach-s3c64xx/irq-pm.c
> +++ b/arch/arm/mach-s3c64xx/irq-pm.c
> @@ -55,10 +55,10 @@ static struct irq_grp_save {
> u32 mask;
> } eint_grp_save[5];
>
> -#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
> -#define SERIAL_SAMSUNG_UARTS 0
> +#ifndef CONFIG_SERIAL_SAMSUNG
> +#define SERIAL_SAMSUNG_UARTS 0
> #else
> -#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
> +#define SERIAL_SAMSUNG_UARTS 4
> #endif
>
> static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
> diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
> index 11fbbc2..6114942 100644
> --- a/arch/arm/plat-samsung/init.c
> +++ b/arch/arm/plat-samsung/init.c
> @@ -92,10 +92,9 @@ void __init s3c24xx_init_clocks(int xtal)
> /* uart management */
> #if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
> static int nr_uarts __initdata = 0;
> +#define MAX_UART_PORTS 4
>
> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
> -static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
> -#endif
> +static struct s3c2410_uartcfg uart_cfgs[MAX_UART_PORTS];
>
> /* s3c24xx_init_uartdevs
> *
> @@ -110,7 +109,6 @@ void __init s3c24xx_init_uartdevs(char *name,
> struct s3c24xx_uart_resources *res,
> struct s3c2410_uartcfg *cfg, int no)
> {
> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
> struct platform_device *platdev;
> struct s3c2410_uartcfg *cfgptr = uart_cfgs;
> struct s3c24xx_uart_resources *resp;
> @@ -133,7 +131,6 @@ void __init s3c24xx_init_uartdevs(char *name,
> }
>
> nr_uarts = no;
> -#endif
> }
>
> void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol
@ 2014-10-20 13:41 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-20 13:41 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kukjin,
On Wed, Oct 1, 2014 at 10:12 PM, Abhilash Kesavan <a.kesavan@samsung.com> wrote:
> Remove usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol from platform
> specific code.
>
> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Can you please pick this up if it looks OK ?
Abhilash
> ---
> Changes in v2:
> - Re-ordered the patches
> - Added a define for number of uart ports in arch/arm/plat-samsung/init.c
> - Removed CONFIG_SERIAL_SAMSUNG #ifdef in arch/arm/plat-samsung/init.c
>
> Build tested using s3c2410_defconfig, s3c6400_defconfig, exynos_defconfig
> and arm64's defconfig with and without the serial driver enabled. Boot tested
> on Exynos5420 and Exynos7.
>
> arch/arm/mach-s3c64xx/irq-pm.c | 6 +++---
> arch/arm/plat-samsung/init.c | 7 ++-----
> 2 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
> index ae4ea76..b20024e 100644
> --- a/arch/arm/mach-s3c64xx/irq-pm.c
> +++ b/arch/arm/mach-s3c64xx/irq-pm.c
> @@ -55,10 +55,10 @@ static struct irq_grp_save {
> u32 mask;
> } eint_grp_save[5];
>
> -#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
> -#define SERIAL_SAMSUNG_UARTS 0
> +#ifndef CONFIG_SERIAL_SAMSUNG
> +#define SERIAL_SAMSUNG_UARTS 0
> #else
> -#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
> +#define SERIAL_SAMSUNG_UARTS 4
> #endif
>
> static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
> diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
> index 11fbbc2..6114942 100644
> --- a/arch/arm/plat-samsung/init.c
> +++ b/arch/arm/plat-samsung/init.c
> @@ -92,10 +92,9 @@ void __init s3c24xx_init_clocks(int xtal)
> /* uart management */
> #if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
> static int nr_uarts __initdata = 0;
> +#define MAX_UART_PORTS 4
>
> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
> -static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
> -#endif
> +static struct s3c2410_uartcfg uart_cfgs[MAX_UART_PORTS];
>
> /* s3c24xx_init_uartdevs
> *
> @@ -110,7 +109,6 @@ void __init s3c24xx_init_uartdevs(char *name,
> struct s3c24xx_uart_resources *res,
> struct s3c2410_uartcfg *cfg, int no)
> {
> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
> struct platform_device *platdev;
> struct s3c2410_uartcfg *cfgptr = uart_cfgs;
> struct s3c24xx_uart_resources *resp;
> @@ -133,7 +131,6 @@ void __init s3c24xx_init_uartdevs(char *name,
> }
>
> nr_uarts = no;
> -#endif
> }
>
> void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol
2014-10-20 13:41 ` Abhilash Kesavan
@ 2014-10-28 6:54 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-28 6:54 UTC (permalink / raw)
To: linux-arm-kernel
Cc: linux-samsung-soc, gregkh, Arnd Bergmann, Kukjin Kim, Tomasz Figa
Hi Kukjin,
On Mon, Oct 20, 2014 at 7:11 PM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hi Kukjin,
>
> On Wed, Oct 1, 2014 at 10:12 PM, Abhilash Kesavan <a.kesavan@samsung.com> wrote:
>> Remove usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol from platform
>> specific code.
>>
>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>
> Can you please pick this up if it looks OK ?
A gentle reminder on these 2 patches.
Abhilash
>
> Abhilash
>> ---
>> Changes in v2:
>> - Re-ordered the patches
>> - Added a define for number of uart ports in arch/arm/plat-samsung/init.c
>> - Removed CONFIG_SERIAL_SAMSUNG #ifdef in arch/arm/plat-samsung/init.c
>>
>> Build tested using s3c2410_defconfig, s3c6400_defconfig, exynos_defconfig
>> and arm64's defconfig with and without the serial driver enabled. Boot tested
>> on Exynos5420 and Exynos7.
>>
>> arch/arm/mach-s3c64xx/irq-pm.c | 6 +++---
>> arch/arm/plat-samsung/init.c | 7 ++-----
>> 2 files changed, 5 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
>> index ae4ea76..b20024e 100644
>> --- a/arch/arm/mach-s3c64xx/irq-pm.c
>> +++ b/arch/arm/mach-s3c64xx/irq-pm.c
>> @@ -55,10 +55,10 @@ static struct irq_grp_save {
>> u32 mask;
>> } eint_grp_save[5];
>>
>> -#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
>> -#define SERIAL_SAMSUNG_UARTS 0
>> +#ifndef CONFIG_SERIAL_SAMSUNG
>> +#define SERIAL_SAMSUNG_UARTS 0
>> #else
>> -#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
>> +#define SERIAL_SAMSUNG_UARTS 4
>> #endif
>>
>> static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
>> diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
>> index 11fbbc2..6114942 100644
>> --- a/arch/arm/plat-samsung/init.c
>> +++ b/arch/arm/plat-samsung/init.c
>> @@ -92,10 +92,9 @@ void __init s3c24xx_init_clocks(int xtal)
>> /* uart management */
>> #if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
>> static int nr_uarts __initdata = 0;
>> +#define MAX_UART_PORTS 4
>>
>> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
>> -static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
>> -#endif
>> +static struct s3c2410_uartcfg uart_cfgs[MAX_UART_PORTS];
>>
>> /* s3c24xx_init_uartdevs
>> *
>> @@ -110,7 +109,6 @@ void __init s3c24xx_init_uartdevs(char *name,
>> struct s3c24xx_uart_resources *res,
>> struct s3c2410_uartcfg *cfg, int no)
>> {
>> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
>> struct platform_device *platdev;
>> struct s3c2410_uartcfg *cfgptr = uart_cfgs;
>> struct s3c24xx_uart_resources *resp;
>> @@ -133,7 +131,6 @@ void __init s3c24xx_init_uartdevs(char *name,
>> }
>>
>> nr_uarts = no;
>> -#endif
>> }
>>
>> void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
>> --
>> 1.7.9.5
>>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol
@ 2014-10-28 6:54 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-28 6:54 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kukjin,
On Mon, Oct 20, 2014 at 7:11 PM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hi Kukjin,
>
> On Wed, Oct 1, 2014 at 10:12 PM, Abhilash Kesavan <a.kesavan@samsung.com> wrote:
>> Remove usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol from platform
>> specific code.
>>
>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>
> Can you please pick this up if it looks OK ?
A gentle reminder on these 2 patches.
Abhilash
>
> Abhilash
>> ---
>> Changes in v2:
>> - Re-ordered the patches
>> - Added a define for number of uart ports in arch/arm/plat-samsung/init.c
>> - Removed CONFIG_SERIAL_SAMSUNG #ifdef in arch/arm/plat-samsung/init.c
>>
>> Build tested using s3c2410_defconfig, s3c6400_defconfig, exynos_defconfig
>> and arm64's defconfig with and without the serial driver enabled. Boot tested
>> on Exynos5420 and Exynos7.
>>
>> arch/arm/mach-s3c64xx/irq-pm.c | 6 +++---
>> arch/arm/plat-samsung/init.c | 7 ++-----
>> 2 files changed, 5 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
>> index ae4ea76..b20024e 100644
>> --- a/arch/arm/mach-s3c64xx/irq-pm.c
>> +++ b/arch/arm/mach-s3c64xx/irq-pm.c
>> @@ -55,10 +55,10 @@ static struct irq_grp_save {
>> u32 mask;
>> } eint_grp_save[5];
>>
>> -#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
>> -#define SERIAL_SAMSUNG_UARTS 0
>> +#ifndef CONFIG_SERIAL_SAMSUNG
>> +#define SERIAL_SAMSUNG_UARTS 0
>> #else
>> -#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
>> +#define SERIAL_SAMSUNG_UARTS 4
>> #endif
>>
>> static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
>> diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
>> index 11fbbc2..6114942 100644
>> --- a/arch/arm/plat-samsung/init.c
>> +++ b/arch/arm/plat-samsung/init.c
>> @@ -92,10 +92,9 @@ void __init s3c24xx_init_clocks(int xtal)
>> /* uart management */
>> #if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
>> static int nr_uarts __initdata = 0;
>> +#define MAX_UART_PORTS 4
>>
>> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
>> -static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
>> -#endif
>> +static struct s3c2410_uartcfg uart_cfgs[MAX_UART_PORTS];
>>
>> /* s3c24xx_init_uartdevs
>> *
>> @@ -110,7 +109,6 @@ void __init s3c24xx_init_uartdevs(char *name,
>> struct s3c24xx_uart_resources *res,
>> struct s3c2410_uartcfg *cfg, int no)
>> {
>> -#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
>> struct platform_device *platdev;
>> struct s3c2410_uartcfg *cfgptr = uart_cfgs;
>> struct s3c24xx_uart_resources *resp;
>> @@ -133,7 +131,6 @@ void __init s3c24xx_init_uartdevs(char *name,
>> }
>>
>> nr_uarts = no;
>> -#endif
>> }
>>
>> void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
>> --
>> 1.7.9.5
>>
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-10-01 16:42 ` Abhilash Kesavan
@ 2014-10-28 10:31 ` Kukjin Kim
-1 siblings, 0 replies; 22+ messages in thread
From: Kukjin Kim @ 2014-10-28 10:31 UTC (permalink / raw)
To: 'Abhilash Kesavan', linux-arm-kernel
Cc: linux-samsung-soc, gregkh, arnd, tomasz.figa
Abhilash Kesavan wrote:
>
Hi,
Sorry for late response.
> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
> select the number of UART ports available on the SoC. Replace the usage
> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
Well, as you know the number of uart ports are different on each Samsung SoCs
so I don't think just using maximum number of uart ports are possible for new
exynos7 SoC at this moment.
> UART ports possible. Removal of these symbols also helps in Exynos7
> serial enablement.
>
> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/tty/serial/Kconfig | 16 ----------------
> drivers/tty/serial/samsung.c | 11 +++--------
> drivers/tty/serial/samsung.h | 5 ++++-
> 3 files changed, 7 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 81f6ee7..9fc9092 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
> provide all of these ports, depending on how the serial port
> pins are configured.
>
> -config SERIAL_SAMSUNG_UARTS_4
> - bool
> - depends on PLAT_SAMSUNG
> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
> - help
> - Internal node for the common case of 4 Samsung compatible UARTs
> -
> -config SERIAL_SAMSUNG_UARTS
> - int
> - depends on PLAT_SAMSUNG
> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
> - default 3
> - help
> - Select the number of available UART ports for the Samsung S3C
> - serial driver
> -
> config SERIAL_SAMSUNG_DEBUG
> bool "Samsung SoC serial debug"
> depends on SERIAL_SAMSUNG && DEBUG_LL
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c78f43a..ba04c6d 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
> static struct uart_driver s3c24xx_uart_drv = {
> .owner = THIS_MODULE,
> .driver_name = "s3c2410_serial",
> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
> + .nr = MAX_SAMSUNG_UARTS,
> .cons = S3C24XX_SERIAL_CONSOLE,
> .dev_name = S3C24XX_SERIAL_NAME,
> .major = S3C24XX_SERIAL_MAJOR,
> .minor = S3C24XX_SERIAL_MINOR,
> };
>
> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
> [0] = {
> .port = {
> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
> .line = 1,
> }
> },
> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
> -
> [2] = {
> .port = {
> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
> .line = 2,
> }
> },
> -#endif
> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
> [3] = {
> .port = {
> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
> .line = 3,
> }
> }
> -#endif
> };
>
> /* s3c24xx_serial_resetport
> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>
> /* is this a valid port */
>
> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
If we use max number, second condition is not required...
> co->index = 0;
>
> port = &s3c24xx_serial_ports[co->index].port;
> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
> index eb071dd..484b49e 100644
> --- a/drivers/tty/serial/samsung.h
> +++ b/drivers/tty/serial/samsung.h
> @@ -1,6 +1,9 @@
> #ifndef __SAMSUNG_H
> #define __SAMSUNG_H
>
> +/* Maximum UART ports available */
> +#define MAX_SAMSUNG_UARTS 4
If there is a Samsung SoC having 5 UARTS, we need to update?
And hmm...maybe we need to keep the useless array sometimes...
> +
> /*
> * Driver for Samsung SoC onboard UARTs.
> *
> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
> struct s3c24xx_serial_drv_data {
> struct s3c24xx_uart_info *info;
> struct s3c2410_uartcfg *def_cfg;
> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
> };
>
> struct s3c24xx_uart_port {
> --
> 1.7.9.5
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-10-28 10:31 ` Kukjin Kim
0 siblings, 0 replies; 22+ messages in thread
From: Kukjin Kim @ 2014-10-28 10:31 UTC (permalink / raw)
To: linux-arm-kernel
Abhilash Kesavan wrote:
>
Hi,
Sorry for late response.
> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
> select the number of UART ports available on the SoC. Replace the usage
> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
Well, as you know the number of uart ports are different on each Samsung SoCs
so I don't think just using maximum number of uart ports are possible for new
exynos7 SoC at this moment.
> UART ports possible. Removal of these symbols also helps in Exynos7
> serial enablement.
>
> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/tty/serial/Kconfig | 16 ----------------
> drivers/tty/serial/samsung.c | 11 +++--------
> drivers/tty/serial/samsung.h | 5 ++++-
> 3 files changed, 7 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> index 81f6ee7..9fc9092 100644
> --- a/drivers/tty/serial/Kconfig
> +++ b/drivers/tty/serial/Kconfig
> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
> provide all of these ports, depending on how the serial port
> pins are configured.
>
> -config SERIAL_SAMSUNG_UARTS_4
> - bool
> - depends on PLAT_SAMSUNG
> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
> - help
> - Internal node for the common case of 4 Samsung compatible UARTs
> -
> -config SERIAL_SAMSUNG_UARTS
> - int
> - depends on PLAT_SAMSUNG
> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
> - default 3
> - help
> - Select the number of available UART ports for the Samsung S3C
> - serial driver
> -
> config SERIAL_SAMSUNG_DEBUG
> bool "Samsung SoC serial debug"
> depends on SERIAL_SAMSUNG && DEBUG_LL
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c78f43a..ba04c6d 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
> static struct uart_driver s3c24xx_uart_drv = {
> .owner = THIS_MODULE,
> .driver_name = "s3c2410_serial",
> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
> + .nr = MAX_SAMSUNG_UARTS,
> .cons = S3C24XX_SERIAL_CONSOLE,
> .dev_name = S3C24XX_SERIAL_NAME,
> .major = S3C24XX_SERIAL_MAJOR,
> .minor = S3C24XX_SERIAL_MINOR,
> };
>
> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
> [0] = {
> .port = {
> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
> .line = 1,
> }
> },
> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
> -
> [2] = {
> .port = {
> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
> .line = 2,
> }
> },
> -#endif
> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
> [3] = {
> .port = {
> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
> .line = 3,
> }
> }
> -#endif
> };
>
> /* s3c24xx_serial_resetport
> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>
> /* is this a valid port */
>
> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
If we use max number, second condition is not required...
> co->index = 0;
>
> port = &s3c24xx_serial_ports[co->index].port;
> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
> index eb071dd..484b49e 100644
> --- a/drivers/tty/serial/samsung.h
> +++ b/drivers/tty/serial/samsung.h
> @@ -1,6 +1,9 @@
> #ifndef __SAMSUNG_H
> #define __SAMSUNG_H
>
> +/* Maximum UART ports available */
> +#define MAX_SAMSUNG_UARTS 4
If there is a Samsung SoC having 5 UARTS, we need to update?
And hmm...maybe we need to keep the useless array sometimes...
> +
> /*
> * Driver for Samsung SoC onboard UARTs.
> *
> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
> struct s3c24xx_serial_drv_data {
> struct s3c24xx_uart_info *info;
> struct s3c2410_uartcfg *def_cfg;
> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
> };
>
> struct s3c24xx_uart_port {
> --
> 1.7.9.5
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-10-28 10:31 ` Kukjin Kim
@ 2014-10-28 12:26 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-28 12:26 UTC (permalink / raw)
To: Kukjin Kim
Cc: linux-arm-kernel, gregkh, linux-samsung-soc, Tomasz Figa, Arnd Bergmann
Hi Kukjin
On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
> Abhilash Kesavan wrote:
>>
> Hi,
>
> Sorry for late response.
>
>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>> select the number of UART ports available on the SoC. Replace the usage
>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>
> Well, as you know the number of uart ports are different on each Samsung SoCs
> so I don't think just using maximum number of uart ports are possible for new
> exynos7 SoC at this moment.
Thanks for the review.
The main reason for me sending this patch was so that we may be able
to re-use the serial driver on arm64 based Exynos7 too. The two
symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
initially sent a patch which changed the dependency to SERIAL_SAMSUNG
for these 2 symbols. However, Tomasz suggested that a clean-up of
these two symbols would be a better option.
Please see the discussion of the previous version here:
https://lkml.org/lkml/2014/9/29/702
Can you please let me know if the previous version is acceptable ?
>
>> UART ports possible. Removal of these symbols also helps in Exynos7
>> serial enablement.
>>
>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> ---
>> drivers/tty/serial/Kconfig | 16 ----------------
>> drivers/tty/serial/samsung.c | 11 +++--------
>> drivers/tty/serial/samsung.h | 5 ++++-
>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>> index 81f6ee7..9fc9092 100644
>> --- a/drivers/tty/serial/Kconfig
>> +++ b/drivers/tty/serial/Kconfig
>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>> provide all of these ports, depending on how the serial port
>> pins are configured.
>>
>> -config SERIAL_SAMSUNG_UARTS_4
>> - bool
>> - depends on PLAT_SAMSUNG
>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>> - help
>> - Internal node for the common case of 4 Samsung compatible UARTs
>> -
>> -config SERIAL_SAMSUNG_UARTS
>> - int
>> - depends on PLAT_SAMSUNG
>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>> - default 3
>> - help
>> - Select the number of available UART ports for the Samsung S3C
>> - serial driver
>> -
>> config SERIAL_SAMSUNG_DEBUG
>> bool "Samsung SoC serial debug"
>> depends on SERIAL_SAMSUNG && DEBUG_LL
>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>> index c78f43a..ba04c6d 100644
>> --- a/drivers/tty/serial/samsung.c
>> +++ b/drivers/tty/serial/samsung.c
>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>> static struct uart_driver s3c24xx_uart_drv = {
>> .owner = THIS_MODULE,
>> .driver_name = "s3c2410_serial",
>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>> + .nr = MAX_SAMSUNG_UARTS,
>> .cons = S3C24XX_SERIAL_CONSOLE,
>> .dev_name = S3C24XX_SERIAL_NAME,
>> .major = S3C24XX_SERIAL_MAJOR,
>> .minor = S3C24XX_SERIAL_MINOR,
>> };
>>
>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>> [0] = {
>> .port = {
>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>> .line = 1,
>> }
>> },
>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>> -
>> [2] = {
>> .port = {
>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>> .line = 2,
>> }
>> },
>> -#endif
>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>> [3] = {
>> .port = {
>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>> .line = 3,
>> }
>> }
>> -#endif
>> };
>>
>> /* s3c24xx_serial_resetport
>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>
>> /* is this a valid port */
>>
>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>
> If we use max number, second condition is not required...
>
>> co->index = 0;
>>
>> port = &s3c24xx_serial_ports[co->index].port;
>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>> index eb071dd..484b49e 100644
>> --- a/drivers/tty/serial/samsung.h
>> +++ b/drivers/tty/serial/samsung.h
>> @@ -1,6 +1,9 @@
>> #ifndef __SAMSUNG_H
>> #define __SAMSUNG_H
>>
>> +/* Maximum UART ports available */
>> +#define MAX_SAMSUNG_UARTS 4
>
> If there is a Samsung SoC having 5 UARTS, we need to update?
Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
SoC with 5 uart ports but even without this patch we would have to
modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>
> And hmm...maybe we need to keep the useless array sometimes...
Yes, for the 24xx series with 3 uart ports we would.
Regards,
Abhilash
>
>> +
>> /*
>> * Driver for Samsung SoC onboard UARTs.
>> *
>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>> struct s3c24xx_serial_drv_data {
>> struct s3c24xx_uart_info *info;
>> struct s3c2410_uartcfg *def_cfg;
>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>> };
>>
>> struct s3c24xx_uart_port {
>> --
>> 1.7.9.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-10-28 12:26 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-28 12:26 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kukjin
On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
> Abhilash Kesavan wrote:
>>
> Hi,
>
> Sorry for late response.
>
>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>> select the number of UART ports available on the SoC. Replace the usage
>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>
> Well, as you know the number of uart ports are different on each Samsung SoCs
> so I don't think just using maximum number of uart ports are possible for new
> exynos7 SoC at this moment.
Thanks for the review.
The main reason for me sending this patch was so that we may be able
to re-use the serial driver on arm64 based Exynos7 too. The two
symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
initially sent a patch which changed the dependency to SERIAL_SAMSUNG
for these 2 symbols. However, Tomasz suggested that a clean-up of
these two symbols would be a better option.
Please see the discussion of the previous version here:
https://lkml.org/lkml/2014/9/29/702
Can you please let me know if the previous version is acceptable ?
>
>> UART ports possible. Removal of these symbols also helps in Exynos7
>> serial enablement.
>>
>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> ---
>> drivers/tty/serial/Kconfig | 16 ----------------
>> drivers/tty/serial/samsung.c | 11 +++--------
>> drivers/tty/serial/samsung.h | 5 ++++-
>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>> index 81f6ee7..9fc9092 100644
>> --- a/drivers/tty/serial/Kconfig
>> +++ b/drivers/tty/serial/Kconfig
>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>> provide all of these ports, depending on how the serial port
>> pins are configured.
>>
>> -config SERIAL_SAMSUNG_UARTS_4
>> - bool
>> - depends on PLAT_SAMSUNG
>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>> - help
>> - Internal node for the common case of 4 Samsung compatible UARTs
>> -
>> -config SERIAL_SAMSUNG_UARTS
>> - int
>> - depends on PLAT_SAMSUNG
>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>> - default 3
>> - help
>> - Select the number of available UART ports for the Samsung S3C
>> - serial driver
>> -
>> config SERIAL_SAMSUNG_DEBUG
>> bool "Samsung SoC serial debug"
>> depends on SERIAL_SAMSUNG && DEBUG_LL
>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>> index c78f43a..ba04c6d 100644
>> --- a/drivers/tty/serial/samsung.c
>> +++ b/drivers/tty/serial/samsung.c
>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>> static struct uart_driver s3c24xx_uart_drv = {
>> .owner = THIS_MODULE,
>> .driver_name = "s3c2410_serial",
>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>> + .nr = MAX_SAMSUNG_UARTS,
>> .cons = S3C24XX_SERIAL_CONSOLE,
>> .dev_name = S3C24XX_SERIAL_NAME,
>> .major = S3C24XX_SERIAL_MAJOR,
>> .minor = S3C24XX_SERIAL_MINOR,
>> };
>>
>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>> [0] = {
>> .port = {
>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>> .line = 1,
>> }
>> },
>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>> -
>> [2] = {
>> .port = {
>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>> .line = 2,
>> }
>> },
>> -#endif
>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>> [3] = {
>> .port = {
>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>> .line = 3,
>> }
>> }
>> -#endif
>> };
>>
>> /* s3c24xx_serial_resetport
>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>
>> /* is this a valid port */
>>
>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>
> If we use max number, second condition is not required...
>
>> co->index = 0;
>>
>> port = &s3c24xx_serial_ports[co->index].port;
>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>> index eb071dd..484b49e 100644
>> --- a/drivers/tty/serial/samsung.h
>> +++ b/drivers/tty/serial/samsung.h
>> @@ -1,6 +1,9 @@
>> #ifndef __SAMSUNG_H
>> #define __SAMSUNG_H
>>
>> +/* Maximum UART ports available */
>> +#define MAX_SAMSUNG_UARTS 4
>
> If there is a Samsung SoC having 5 UARTS, we need to update?
Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
SoC with 5 uart ports but even without this patch we would have to
modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>
> And hmm...maybe we need to keep the useless array sometimes...
Yes, for the 24xx series with 3 uart ports we would.
Regards,
Abhilash
>
>> +
>> /*
>> * Driver for Samsung SoC onboard UARTs.
>> *
>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>> struct s3c24xx_serial_drv_data {
>> struct s3c24xx_uart_info *info;
>> struct s3c2410_uartcfg *def_cfg;
>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>> };
>>
>> struct s3c24xx_uart_port {
>> --
>> 1.7.9.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-10-28 12:26 ` Abhilash Kesavan
@ 2014-10-31 2:36 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-31 2:36 UTC (permalink / raw)
To: Kukjin Kim, Kukjin Kim
Cc: linux-arm-kernel, gregkh, linux-samsung-soc, Tomasz Figa, Arnd Bergmann
Hi Kukjin,
On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hi Kukjin
>
> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>> Abhilash Kesavan wrote:
>>>
>> Hi,
>>
>> Sorry for late response.
>>
>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>>> select the number of UART ports available on the SoC. Replace the usage
>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>>
>> Well, as you know the number of uart ports are different on each Samsung SoCs
>> so I don't think just using maximum number of uart ports are possible for new
>> exynos7 SoC at this moment.
>
> Thanks for the review.
> The main reason for me sending this patch was so that we may be able
> to re-use the serial driver on arm64 based Exynos7 too. The two
> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
> for these 2 symbols. However, Tomasz suggested that a clean-up of
> these two symbols would be a better option.
>
> Please see the discussion of the previous version here:
> https://lkml.org/lkml/2014/9/29/702
>
> Can you please let me know if the previous version is acceptable ?
Kukjin, can you please indicate the approach you would like me to
take. Without this serial support is blocked on Exynos7.
Thanks,
Abhilash
>
>>
>>> UART ports possible. Removal of these symbols also helps in Exynos7
>>> serial enablement.
>>>
>>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> ---
>>> drivers/tty/serial/Kconfig | 16 ----------------
>>> drivers/tty/serial/samsung.c | 11 +++--------
>>> drivers/tty/serial/samsung.h | 5 ++++-
>>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>>> index 81f6ee7..9fc9092 100644
>>> --- a/drivers/tty/serial/Kconfig
>>> +++ b/drivers/tty/serial/Kconfig
>>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>>> provide all of these ports, depending on how the serial port
>>> pins are configured.
>>>
>>> -config SERIAL_SAMSUNG_UARTS_4
>>> - bool
>>> - depends on PLAT_SAMSUNG
>>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>>> - help
>>> - Internal node for the common case of 4 Samsung compatible UARTs
>>> -
>>> -config SERIAL_SAMSUNG_UARTS
>>> - int
>>> - depends on PLAT_SAMSUNG
>>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>>> - default 3
>>> - help
>>> - Select the number of available UART ports for the Samsung S3C
>>> - serial driver
>>> -
>>> config SERIAL_SAMSUNG_DEBUG
>>> bool "Samsung SoC serial debug"
>>> depends on SERIAL_SAMSUNG && DEBUG_LL
>>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>>> index c78f43a..ba04c6d 100644
>>> --- a/drivers/tty/serial/samsung.c
>>> +++ b/drivers/tty/serial/samsung.c
>>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>>> static struct uart_driver s3c24xx_uart_drv = {
>>> .owner = THIS_MODULE,
>>> .driver_name = "s3c2410_serial",
>>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>>> + .nr = MAX_SAMSUNG_UARTS,
>>> .cons = S3C24XX_SERIAL_CONSOLE,
>>> .dev_name = S3C24XX_SERIAL_NAME,
>>> .major = S3C24XX_SERIAL_MAJOR,
>>> .minor = S3C24XX_SERIAL_MINOR,
>>> };
>>>
>>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>>> [0] = {
>>> .port = {
>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>> .line = 1,
>>> }
>>> },
>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>>> -
>>> [2] = {
>>> .port = {
>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>> .line = 2,
>>> }
>>> },
>>> -#endif
>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>>> [3] = {
>>> .port = {
>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>> .line = 3,
>>> }
>>> }
>>> -#endif
>>> };
>>>
>>> /* s3c24xx_serial_resetport
>>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>>
>>> /* is this a valid port */
>>>
>>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>>
>> If we use max number, second condition is not required...
>>
>>> co->index = 0;
>>>
>>> port = &s3c24xx_serial_ports[co->index].port;
>>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>>> index eb071dd..484b49e 100644
>>> --- a/drivers/tty/serial/samsung.h
>>> +++ b/drivers/tty/serial/samsung.h
>>> @@ -1,6 +1,9 @@
>>> #ifndef __SAMSUNG_H
>>> #define __SAMSUNG_H
>>>
>>> +/* Maximum UART ports available */
>>> +#define MAX_SAMSUNG_UARTS 4
>>
>> If there is a Samsung SoC having 5 UARTS, we need to update?
>
> Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
> SoC with 5 uart ports but even without this patch we would have to
> modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>>
>> And hmm...maybe we need to keep the useless array sometimes...
>
> Yes, for the 24xx series with 3 uart ports we would.
>
> Regards,
> Abhilash
>>
>>> +
>>> /*
>>> * Driver for Samsung SoC onboard UARTs.
>>> *
>>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>>> struct s3c24xx_serial_drv_data {
>>> struct s3c24xx_uart_info *info;
>>> struct s3c2410_uartcfg *def_cfg;
>>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>>> };
>>>
>>> struct s3c24xx_uart_port {
>>> --
>>> 1.7.9.5
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-10-31 2:36 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-10-31 2:36 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kukjin,
On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hi Kukjin
>
> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>> Abhilash Kesavan wrote:
>>>
>> Hi,
>>
>> Sorry for late response.
>>
>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>>> select the number of UART ports available on the SoC. Replace the usage
>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>>
>> Well, as you know the number of uart ports are different on each Samsung SoCs
>> so I don't think just using maximum number of uart ports are possible for new
>> exynos7 SoC at this moment.
>
> Thanks for the review.
> The main reason for me sending this patch was so that we may be able
> to re-use the serial driver on arm64 based Exynos7 too. The two
> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
> for these 2 symbols. However, Tomasz suggested that a clean-up of
> these two symbols would be a better option.
>
> Please see the discussion of the previous version here:
> https://lkml.org/lkml/2014/9/29/702
>
> Can you please let me know if the previous version is acceptable ?
Kukjin, can you please indicate the approach you would like me to
take. Without this serial support is blocked on Exynos7.
Thanks,
Abhilash
>
>>
>>> UART ports possible. Removal of these symbols also helps in Exynos7
>>> serial enablement.
>>>
>>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> ---
>>> drivers/tty/serial/Kconfig | 16 ----------------
>>> drivers/tty/serial/samsung.c | 11 +++--------
>>> drivers/tty/serial/samsung.h | 5 ++++-
>>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>>> index 81f6ee7..9fc9092 100644
>>> --- a/drivers/tty/serial/Kconfig
>>> +++ b/drivers/tty/serial/Kconfig
>>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>>> provide all of these ports, depending on how the serial port
>>> pins are configured.
>>>
>>> -config SERIAL_SAMSUNG_UARTS_4
>>> - bool
>>> - depends on PLAT_SAMSUNG
>>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>>> - help
>>> - Internal node for the common case of 4 Samsung compatible UARTs
>>> -
>>> -config SERIAL_SAMSUNG_UARTS
>>> - int
>>> - depends on PLAT_SAMSUNG
>>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>>> - default 3
>>> - help
>>> - Select the number of available UART ports for the Samsung S3C
>>> - serial driver
>>> -
>>> config SERIAL_SAMSUNG_DEBUG
>>> bool "Samsung SoC serial debug"
>>> depends on SERIAL_SAMSUNG && DEBUG_LL
>>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>>> index c78f43a..ba04c6d 100644
>>> --- a/drivers/tty/serial/samsung.c
>>> +++ b/drivers/tty/serial/samsung.c
>>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>>> static struct uart_driver s3c24xx_uart_drv = {
>>> .owner = THIS_MODULE,
>>> .driver_name = "s3c2410_serial",
>>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>>> + .nr = MAX_SAMSUNG_UARTS,
>>> .cons = S3C24XX_SERIAL_CONSOLE,
>>> .dev_name = S3C24XX_SERIAL_NAME,
>>> .major = S3C24XX_SERIAL_MAJOR,
>>> .minor = S3C24XX_SERIAL_MINOR,
>>> };
>>>
>>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>>> [0] = {
>>> .port = {
>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>> .line = 1,
>>> }
>>> },
>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>>> -
>>> [2] = {
>>> .port = {
>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>> .line = 2,
>>> }
>>> },
>>> -#endif
>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>>> [3] = {
>>> .port = {
>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>> .line = 3,
>>> }
>>> }
>>> -#endif
>>> };
>>>
>>> /* s3c24xx_serial_resetport
>>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>>
>>> /* is this a valid port */
>>>
>>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>>
>> If we use max number, second condition is not required...
>>
>>> co->index = 0;
>>>
>>> port = &s3c24xx_serial_ports[co->index].port;
>>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>>> index eb071dd..484b49e 100644
>>> --- a/drivers/tty/serial/samsung.h
>>> +++ b/drivers/tty/serial/samsung.h
>>> @@ -1,6 +1,9 @@
>>> #ifndef __SAMSUNG_H
>>> #define __SAMSUNG_H
>>>
>>> +/* Maximum UART ports available */
>>> +#define MAX_SAMSUNG_UARTS 4
>>
>> If there is a Samsung SoC having 5 UARTS, we need to update?
>
> Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
> SoC with 5 uart ports but even without this patch we would have to
> modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>>
>> And hmm...maybe we need to keep the useless array sometimes...
>
> Yes, for the 24xx series with 3 uart ports we would.
>
> Regards,
> Abhilash
>>
>>> +
>>> /*
>>> * Driver for Samsung SoC onboard UARTs.
>>> *
>>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>>> struct s3c24xx_serial_drv_data {
>>> struct s3c24xx_uart_info *info;
>>> struct s3c2410_uartcfg *def_cfg;
>>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>>> };
>>>
>>> struct s3c24xx_uart_port {
>>> --
>>> 1.7.9.5
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-10-31 2:36 ` Abhilash Kesavan
@ 2014-11-03 8:21 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-11-03 8:21 UTC (permalink / raw)
To: Kukjin Kim, Kukjin Kim
Cc: linux-arm-kernel, gregkh, linux-samsung-soc, Tomasz Figa, Arnd Bergmann
Hello Kukjin,
On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hi Kukjin,
>
> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
> <kesavan.abhilash@gmail.com> wrote:
>> Hi Kukjin
>>
>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>>> Abhilash Kesavan wrote:
>>>>
>>> Hi,
>>>
>>> Sorry for late response.
>>>
>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>>>> select the number of UART ports available on the SoC. Replace the usage
>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>>>
>>> Well, as you know the number of uart ports are different on each Samsung SoCs
>>> so I don't think just using maximum number of uart ports are possible for new
>>> exynos7 SoC at this moment.
>>
>> Thanks for the review.
>> The main reason for me sending this patch was so that we may be able
>> to re-use the serial driver on arm64 based Exynos7 too. The two
>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
>> for these 2 symbols. However, Tomasz suggested that a clean-up of
>> these two symbols would be a better option.
>>
>> Please see the discussion of the previous version here:
>> https://lkml.org/lkml/2014/9/29/702
>>
>> Can you please let me know if the previous version is acceptable ?
>
> Kukjin, can you please indicate the approach you would like me to
> take. Without this serial support is blocked on Exynos7.
Gentle reminder on this.
Abhilash
>
> Thanks,
> Abhilash
>>
>>>
>>>> UART ports possible. Removal of these symbols also helps in Exynos7
>>>> serial enablement.
>>>>
>>>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>>>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>> ---
>>>> drivers/tty/serial/Kconfig | 16 ----------------
>>>> drivers/tty/serial/samsung.c | 11 +++--------
>>>> drivers/tty/serial/samsung.h | 5 ++++-
>>>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>>>
>>>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>>>> index 81f6ee7..9fc9092 100644
>>>> --- a/drivers/tty/serial/Kconfig
>>>> +++ b/drivers/tty/serial/Kconfig
>>>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>>>> provide all of these ports, depending on how the serial port
>>>> pins are configured.
>>>>
>>>> -config SERIAL_SAMSUNG_UARTS_4
>>>> - bool
>>>> - depends on PLAT_SAMSUNG
>>>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>>>> - help
>>>> - Internal node for the common case of 4 Samsung compatible UARTs
>>>> -
>>>> -config SERIAL_SAMSUNG_UARTS
>>>> - int
>>>> - depends on PLAT_SAMSUNG
>>>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>>>> - default 3
>>>> - help
>>>> - Select the number of available UART ports for the Samsung S3C
>>>> - serial driver
>>>> -
>>>> config SERIAL_SAMSUNG_DEBUG
>>>> bool "Samsung SoC serial debug"
>>>> depends on SERIAL_SAMSUNG && DEBUG_LL
>>>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>>>> index c78f43a..ba04c6d 100644
>>>> --- a/drivers/tty/serial/samsung.c
>>>> +++ b/drivers/tty/serial/samsung.c
>>>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>>>> static struct uart_driver s3c24xx_uart_drv = {
>>>> .owner = THIS_MODULE,
>>>> .driver_name = "s3c2410_serial",
>>>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>>>> + .nr = MAX_SAMSUNG_UARTS,
>>>> .cons = S3C24XX_SERIAL_CONSOLE,
>>>> .dev_name = S3C24XX_SERIAL_NAME,
>>>> .major = S3C24XX_SERIAL_MAJOR,
>>>> .minor = S3C24XX_SERIAL_MINOR,
>>>> };
>>>>
>>>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>>>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>>>> [0] = {
>>>> .port = {
>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>>>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>> .line = 1,
>>>> }
>>>> },
>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>>>> -
>>>> [2] = {
>>>> .port = {
>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>>>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>> .line = 2,
>>>> }
>>>> },
>>>> -#endif
>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>>>> [3] = {
>>>> .port = {
>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>>>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>> .line = 3,
>>>> }
>>>> }
>>>> -#endif
>>>> };
>>>>
>>>> /* s3c24xx_serial_resetport
>>>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>>>
>>>> /* is this a valid port */
>>>>
>>>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>>>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>>>
>>> If we use max number, second condition is not required...
>>>
>>>> co->index = 0;
>>>>
>>>> port = &s3c24xx_serial_ports[co->index].port;
>>>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>>>> index eb071dd..484b49e 100644
>>>> --- a/drivers/tty/serial/samsung.h
>>>> +++ b/drivers/tty/serial/samsung.h
>>>> @@ -1,6 +1,9 @@
>>>> #ifndef __SAMSUNG_H
>>>> #define __SAMSUNG_H
>>>>
>>>> +/* Maximum UART ports available */
>>>> +#define MAX_SAMSUNG_UARTS 4
>>>
>>> If there is a Samsung SoC having 5 UARTS, we need to update?
>>
>> Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
>> SoC with 5 uart ports but even without this patch we would have to
>> modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>>>
>>> And hmm...maybe we need to keep the useless array sometimes...
>>
>> Yes, for the 24xx series with 3 uart ports we would.
>>
>> Regards,
>> Abhilash
>>>
>>>> +
>>>> /*
>>>> * Driver for Samsung SoC onboard UARTs.
>>>> *
>>>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>>>> struct s3c24xx_serial_drv_data {
>>>> struct s3c24xx_uart_info *info;
>>>> struct s3c2410_uartcfg *def_cfg;
>>>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>>>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>>>> };
>>>>
>>>> struct s3c24xx_uart_port {
>>>> --
>>>> 1.7.9.5
>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-11-03 8:21 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-11-03 8:21 UTC (permalink / raw)
To: linux-arm-kernel
Hello Kukjin,
On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hi Kukjin,
>
> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
> <kesavan.abhilash@gmail.com> wrote:
>> Hi Kukjin
>>
>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>>> Abhilash Kesavan wrote:
>>>>
>>> Hi,
>>>
>>> Sorry for late response.
>>>
>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>>>> select the number of UART ports available on the SoC. Replace the usage
>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>>>
>>> Well, as you know the number of uart ports are different on each Samsung SoCs
>>> so I don't think just using maximum number of uart ports are possible for new
>>> exynos7 SoC at this moment.
>>
>> Thanks for the review.
>> The main reason for me sending this patch was so that we may be able
>> to re-use the serial driver on arm64 based Exynos7 too. The two
>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
>> for these 2 symbols. However, Tomasz suggested that a clean-up of
>> these two symbols would be a better option.
>>
>> Please see the discussion of the previous version here:
>> https://lkml.org/lkml/2014/9/29/702
>>
>> Can you please let me know if the previous version is acceptable ?
>
> Kukjin, can you please indicate the approach you would like me to
> take. Without this serial support is blocked on Exynos7.
Gentle reminder on this.
Abhilash
>
> Thanks,
> Abhilash
>>
>>>
>>>> UART ports possible. Removal of these symbols also helps in Exynos7
>>>> serial enablement.
>>>>
>>>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>>>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>> ---
>>>> drivers/tty/serial/Kconfig | 16 ----------------
>>>> drivers/tty/serial/samsung.c | 11 +++--------
>>>> drivers/tty/serial/samsung.h | 5 ++++-
>>>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>>>
>>>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>>>> index 81f6ee7..9fc9092 100644
>>>> --- a/drivers/tty/serial/Kconfig
>>>> +++ b/drivers/tty/serial/Kconfig
>>>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>>>> provide all of these ports, depending on how the serial port
>>>> pins are configured.
>>>>
>>>> -config SERIAL_SAMSUNG_UARTS_4
>>>> - bool
>>>> - depends on PLAT_SAMSUNG
>>>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>>>> - help
>>>> - Internal node for the common case of 4 Samsung compatible UARTs
>>>> -
>>>> -config SERIAL_SAMSUNG_UARTS
>>>> - int
>>>> - depends on PLAT_SAMSUNG
>>>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>>>> - default 3
>>>> - help
>>>> - Select the number of available UART ports for the Samsung S3C
>>>> - serial driver
>>>> -
>>>> config SERIAL_SAMSUNG_DEBUG
>>>> bool "Samsung SoC serial debug"
>>>> depends on SERIAL_SAMSUNG && DEBUG_LL
>>>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>>>> index c78f43a..ba04c6d 100644
>>>> --- a/drivers/tty/serial/samsung.c
>>>> +++ b/drivers/tty/serial/samsung.c
>>>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>>>> static struct uart_driver s3c24xx_uart_drv = {
>>>> .owner = THIS_MODULE,
>>>> .driver_name = "s3c2410_serial",
>>>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>>>> + .nr = MAX_SAMSUNG_UARTS,
>>>> .cons = S3C24XX_SERIAL_CONSOLE,
>>>> .dev_name = S3C24XX_SERIAL_NAME,
>>>> .major = S3C24XX_SERIAL_MAJOR,
>>>> .minor = S3C24XX_SERIAL_MINOR,
>>>> };
>>>>
>>>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>>>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>>>> [0] = {
>>>> .port = {
>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>>>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>> .line = 1,
>>>> }
>>>> },
>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>>>> -
>>>> [2] = {
>>>> .port = {
>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>>>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>> .line = 2,
>>>> }
>>>> },
>>>> -#endif
>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>>>> [3] = {
>>>> .port = {
>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>>>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>> .line = 3,
>>>> }
>>>> }
>>>> -#endif
>>>> };
>>>>
>>>> /* s3c24xx_serial_resetport
>>>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>>>
>>>> /* is this a valid port */
>>>>
>>>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>>>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>>>
>>> If we use max number, second condition is not required...
>>>
>>>> co->index = 0;
>>>>
>>>> port = &s3c24xx_serial_ports[co->index].port;
>>>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>>>> index eb071dd..484b49e 100644
>>>> --- a/drivers/tty/serial/samsung.h
>>>> +++ b/drivers/tty/serial/samsung.h
>>>> @@ -1,6 +1,9 @@
>>>> #ifndef __SAMSUNG_H
>>>> #define __SAMSUNG_H
>>>>
>>>> +/* Maximum UART ports available */
>>>> +#define MAX_SAMSUNG_UARTS 4
>>>
>>> If there is a Samsung SoC having 5 UARTS, we need to update?
>>
>> Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
>> SoC with 5 uart ports but even without this patch we would have to
>> modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>>>
>>> And hmm...maybe we need to keep the useless array sometimes...
>>
>> Yes, for the 24xx series with 3 uart ports we would.
>>
>> Regards,
>> Abhilash
>>>
>>>> +
>>>> /*
>>>> * Driver for Samsung SoC onboard UARTs.
>>>> *
>>>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>>>> struct s3c24xx_serial_drv_data {
>>>> struct s3c24xx_uart_info *info;
>>>> struct s3c2410_uartcfg *def_cfg;
>>>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>>>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>>>> };
>>>>
>>>> struct s3c24xx_uart_port {
>>>> --
>>>> 1.7.9.5
>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-11-03 8:21 ` Abhilash Kesavan
@ 2014-11-09 4:19 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-11-09 4:19 UTC (permalink / raw)
To: Kukjin Kim, Kukjin Kim
Cc: linux-arm-kernel, gregkh, linux-samsung-soc, Tomasz Figa, Arnd Bergmann
On Mon, Nov 3, 2014 at 1:51 PM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hello Kukjin,
>
> On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
> <kesavan.abhilash@gmail.com> wrote:
>> Hi Kukjin,
>>
>> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
>> <kesavan.abhilash@gmail.com> wrote:
>>> Hi Kukjin
>>>
>>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>>>> Abhilash Kesavan wrote:
>>>>>
>>>> Hi,
>>>>
>>>> Sorry for late response.
>>>>
>>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>>>>> select the number of UART ports available on the SoC. Replace the usage
>>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>>>>
>>>> Well, as you know the number of uart ports are different on each Samsung SoCs
>>>> so I don't think just using maximum number of uart ports are possible for new
>>>> exynos7 SoC at this moment.
>>>
>>> Thanks for the review.
>>> The main reason for me sending this patch was so that we may be able
>>> to re-use the serial driver on arm64 based Exynos7 too. The two
>>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
>>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
>>> for these 2 symbols. However, Tomasz suggested that a clean-up of
>>> these two symbols would be a better option.
>>>
>>> Please see the discussion of the previous version here:
>>> https://lkml.org/lkml/2014/9/29/702
>>>
>>> Can you please let me know if the previous version is acceptable ?
>>
>> Kukjin, can you please indicate the approach you would like me to
>> take. Without this serial support is blocked on Exynos7.
>
> Gentle reminder on this.
Hi Kukjin,
I don't mean to nag, but this another reminder to review this.
Please let me know if you are too busy to have a look at this or
require some more inputs from me.
Regards,
Abhilash
>
> Abhilash
>>
>> Thanks,
>> Abhilash
>>>
>>>>
>>>>> UART ports possible. Removal of these symbols also helps in Exynos7
>>>>> serial enablement.
>>>>>
>>>>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>>>>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>>> ---
>>>>> drivers/tty/serial/Kconfig | 16 ----------------
>>>>> drivers/tty/serial/samsung.c | 11 +++--------
>>>>> drivers/tty/serial/samsung.h | 5 ++++-
>>>>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>>>>
>>>>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>>>>> index 81f6ee7..9fc9092 100644
>>>>> --- a/drivers/tty/serial/Kconfig
>>>>> +++ b/drivers/tty/serial/Kconfig
>>>>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>>>>> provide all of these ports, depending on how the serial port
>>>>> pins are configured.
>>>>>
>>>>> -config SERIAL_SAMSUNG_UARTS_4
>>>>> - bool
>>>>> - depends on PLAT_SAMSUNG
>>>>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>>>>> - help
>>>>> - Internal node for the common case of 4 Samsung compatible UARTs
>>>>> -
>>>>> -config SERIAL_SAMSUNG_UARTS
>>>>> - int
>>>>> - depends on PLAT_SAMSUNG
>>>>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>>>>> - default 3
>>>>> - help
>>>>> - Select the number of available UART ports for the Samsung S3C
>>>>> - serial driver
>>>>> -
>>>>> config SERIAL_SAMSUNG_DEBUG
>>>>> bool "Samsung SoC serial debug"
>>>>> depends on SERIAL_SAMSUNG && DEBUG_LL
>>>>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>>>>> index c78f43a..ba04c6d 100644
>>>>> --- a/drivers/tty/serial/samsung.c
>>>>> +++ b/drivers/tty/serial/samsung.c
>>>>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>>>>> static struct uart_driver s3c24xx_uart_drv = {
>>>>> .owner = THIS_MODULE,
>>>>> .driver_name = "s3c2410_serial",
>>>>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>>>>> + .nr = MAX_SAMSUNG_UARTS,
>>>>> .cons = S3C24XX_SERIAL_CONSOLE,
>>>>> .dev_name = S3C24XX_SERIAL_NAME,
>>>>> .major = S3C24XX_SERIAL_MAJOR,
>>>>> .minor = S3C24XX_SERIAL_MINOR,
>>>>> };
>>>>>
>>>>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>>>>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>>>>> [0] = {
>>>>> .port = {
>>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>>>>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>>> .line = 1,
>>>>> }
>>>>> },
>>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>>>>> -
>>>>> [2] = {
>>>>> .port = {
>>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>>>>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>>> .line = 2,
>>>>> }
>>>>> },
>>>>> -#endif
>>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>>>>> [3] = {
>>>>> .port = {
>>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>>>>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>>> .line = 3,
>>>>> }
>>>>> }
>>>>> -#endif
>>>>> };
>>>>>
>>>>> /* s3c24xx_serial_resetport
>>>>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>>>>
>>>>> /* is this a valid port */
>>>>>
>>>>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>>>>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>>>>
>>>> If we use max number, second condition is not required...
>>>>
>>>>> co->index = 0;
>>>>>
>>>>> port = &s3c24xx_serial_ports[co->index].port;
>>>>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>>>>> index eb071dd..484b49e 100644
>>>>> --- a/drivers/tty/serial/samsung.h
>>>>> +++ b/drivers/tty/serial/samsung.h
>>>>> @@ -1,6 +1,9 @@
>>>>> #ifndef __SAMSUNG_H
>>>>> #define __SAMSUNG_H
>>>>>
>>>>> +/* Maximum UART ports available */
>>>>> +#define MAX_SAMSUNG_UARTS 4
>>>>
>>>> If there is a Samsung SoC having 5 UARTS, we need to update?
>>>
>>> Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
>>> SoC with 5 uart ports but even without this patch we would have to
>>> modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>>>>
>>>> And hmm...maybe we need to keep the useless array sometimes...
>>>
>>> Yes, for the 24xx series with 3 uart ports we would.
>>>
>>> Regards,
>>> Abhilash
>>>>
>>>>> +
>>>>> /*
>>>>> * Driver for Samsung SoC onboard UARTs.
>>>>> *
>>>>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>>>>> struct s3c24xx_serial_drv_data {
>>>>> struct s3c24xx_uart_info *info;
>>>>> struct s3c2410_uartcfg *def_cfg;
>>>>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>>>>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>>>>> };
>>>>>
>>>>> struct s3c24xx_uart_port {
>>>>> --
>>>>> 1.7.9.5
>>>>
>>>>
>>>> _______________________________________________
>>>> linux-arm-kernel mailing list
>>>> linux-arm-kernel@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-11-09 4:19 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-11-09 4:19 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 3, 2014 at 1:51 PM, Abhilash Kesavan
<kesavan.abhilash@gmail.com> wrote:
> Hello Kukjin,
>
> On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
> <kesavan.abhilash@gmail.com> wrote:
>> Hi Kukjin,
>>
>> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
>> <kesavan.abhilash@gmail.com> wrote:
>>> Hi Kukjin
>>>
>>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>>>> Abhilash Kesavan wrote:
>>>>>
>>>> Hi,
>>>>
>>>> Sorry for late response.
>>>>
>>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>>>>> select the number of UART ports available on the SoC. Replace the usage
>>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>>>>
>>>> Well, as you know the number of uart ports are different on each Samsung SoCs
>>>> so I don't think just using maximum number of uart ports are possible for new
>>>> exynos7 SoC at this moment.
>>>
>>> Thanks for the review.
>>> The main reason for me sending this patch was so that we may be able
>>> to re-use the serial driver on arm64 based Exynos7 too. The two
>>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
>>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
>>> for these 2 symbols. However, Tomasz suggested that a clean-up of
>>> these two symbols would be a better option.
>>>
>>> Please see the discussion of the previous version here:
>>> https://lkml.org/lkml/2014/9/29/702
>>>
>>> Can you please let me know if the previous version is acceptable ?
>>
>> Kukjin, can you please indicate the approach you would like me to
>> take. Without this serial support is blocked on Exynos7.
>
> Gentle reminder on this.
Hi Kukjin,
I don't mean to nag, but this another reminder to review this.
Please let me know if you are too busy to have a look at this or
require some more inputs from me.
Regards,
Abhilash
>
> Abhilash
>>
>> Thanks,
>> Abhilash
>>>
>>>>
>>>>> UART ports possible. Removal of these symbols also helps in Exynos7
>>>>> serial enablement.
>>>>>
>>>>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
>>>>> Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
>>>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>>>> ---
>>>>> drivers/tty/serial/Kconfig | 16 ----------------
>>>>> drivers/tty/serial/samsung.c | 11 +++--------
>>>>> drivers/tty/serial/samsung.h | 5 ++++-
>>>>> 3 files changed, 7 insertions(+), 25 deletions(-)
>>>>>
>>>>> diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
>>>>> index 81f6ee7..9fc9092 100644
>>>>> --- a/drivers/tty/serial/Kconfig
>>>>> +++ b/drivers/tty/serial/Kconfig
>>>>> @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG
>>>>> provide all of these ports, depending on how the serial port
>>>>> pins are configured.
>>>>>
>>>>> -config SERIAL_SAMSUNG_UARTS_4
>>>>> - bool
>>>>> - depends on PLAT_SAMSUNG
>>>>> - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
>>>>> - help
>>>>> - Internal node for the common case of 4 Samsung compatible UARTs
>>>>> -
>>>>> -config SERIAL_SAMSUNG_UARTS
>>>>> - int
>>>>> - depends on PLAT_SAMSUNG
>>>>> - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
>>>>> - default 3
>>>>> - help
>>>>> - Select the number of available UART ports for the Samsung S3C
>>>>> - serial driver
>>>>> -
>>>>> config SERIAL_SAMSUNG_DEBUG
>>>>> bool "Samsung SoC serial debug"
>>>>> depends on SERIAL_SAMSUNG && DEBUG_LL
>>>>> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
>>>>> index c78f43a..ba04c6d 100644
>>>>> --- a/drivers/tty/serial/samsung.c
>>>>> +++ b/drivers/tty/serial/samsung.c
>>>>> @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = {
>>>>> static struct uart_driver s3c24xx_uart_drv = {
>>>>> .owner = THIS_MODULE,
>>>>> .driver_name = "s3c2410_serial",
>>>>> - .nr = CONFIG_SERIAL_SAMSUNG_UARTS,
>>>>> + .nr = MAX_SAMSUNG_UARTS,
>>>>> .cons = S3C24XX_SERIAL_CONSOLE,
>>>>> .dev_name = S3C24XX_SERIAL_NAME,
>>>>> .major = S3C24XX_SERIAL_MAJOR,
>>>>> .minor = S3C24XX_SERIAL_MINOR,
>>>>> };
>>>>>
>>>>> -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = {
>>>>> +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = {
>>>>> [0] = {
>>>>> .port = {
>>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock),
>>>>> @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>>> .line = 1,
>>>>> }
>>>>> },
>>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>>>>> -
>>>>> [2] = {
>>>>> .port = {
>>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock),
>>>>> @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>>> .line = 2,
>>>>> }
>>>>> },
>>>>> -#endif
>>>>> -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>>>>> [3] = {
>>>>> .port = {
>>>>> .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock),
>>>>> @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS
>>>>> .line = 3,
>>>>> }
>>>>> }
>>>>> -#endif
>>>>> };
>>>>>
>>>>> /* s3c24xx_serial_resetport
>>>>> @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
>>>>>
>>>>> /* is this a valid port */
>>>>>
>>>>> - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS)
>>>>> + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS)
>>>>
>>>> If we use max number, second condition is not required...
>>>>
>>>>> co->index = 0;
>>>>>
>>>>> port = &s3c24xx_serial_ports[co->index].port;
>>>>> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
>>>>> index eb071dd..484b49e 100644
>>>>> --- a/drivers/tty/serial/samsung.h
>>>>> +++ b/drivers/tty/serial/samsung.h
>>>>> @@ -1,6 +1,9 @@
>>>>> #ifndef __SAMSUNG_H
>>>>> #define __SAMSUNG_H
>>>>>
>>>>> +/* Maximum UART ports available */
>>>>> +#define MAX_SAMSUNG_UARTS 4
>>>>
>>>> If there is a Samsung SoC having 5 UARTS, we need to update?
>>>
>>> Yes, we would need to update the MAX_SAMSUNG_UARTS define for a newer
>>> SoC with 5 uart ports but even without this patch we would have to
>>> modify the SERIAL_SAMSUNG_UARTS symbol to handle 5 ports.
>>>>
>>>> And hmm...maybe we need to keep the useless array sometimes...
>>>
>>> Yes, for the 24xx series with 3 uart ports we would.
>>>
>>> Regards,
>>> Abhilash
>>>>
>>>>> +
>>>>> /*
>>>>> * Driver for Samsung SoC onboard UARTs.
>>>>> *
>>>>> @@ -38,7 +41,7 @@ struct s3c24xx_uart_info {
>>>>> struct s3c24xx_serial_drv_data {
>>>>> struct s3c24xx_uart_info *info;
>>>>> struct s3c2410_uartcfg *def_cfg;
>>>>> - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>>>>> + unsigned int fifosize[MAX_SAMSUNG_UARTS];
>>>>> };
>>>>>
>>>>> struct s3c24xx_uart_port {
>>>>> --
>>>>> 1.7.9.5
>>>>
>>>>
>>>> _______________________________________________
>>>> linux-arm-kernel mailing list
>>>> linux-arm-kernel at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-11-09 4:19 ` Abhilash Kesavan
@ 2014-11-09 4:39 ` Kukjin Kim
-1 siblings, 0 replies; 22+ messages in thread
From: Kukjin Kim @ 2014-11-09 4:39 UTC (permalink / raw)
To: 'Abhilash Kesavan', 'Kukjin Kim'
Cc: 'linux-arm-kernel', gregkh, 'linux-samsung-soc',
'Tomasz Figa', 'Arnd Bergmann'
Abhilash Kesavan wrote:
>
> On Mon, Nov 3, 2014 at 1:51 PM, Abhilash Kesavan
> <kesavan.abhilash@gmail.com> wrote:
> > Hello Kukjin,
> >
> > On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
> > <kesavan.abhilash@gmail.com> wrote:
> >> Hi Kukjin,
> >>
> >> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
> >> <kesavan.abhilash@gmail.com> wrote:
> >>> Hi Kukjin
> >>>
> >>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
> >>>> Abhilash Kesavan wrote:
> >>>>>
> >>>> Hi,
> >>>>
> >>>> Sorry for late response.
> >>>>
> >>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
> >>>>> select the number of UART ports available on the SoC. Replace the usage
> >>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
> >>>>
> >>>> Well, as you know the number of uart ports are different on each Samsung SoCs
> >>>> so I don't think just using maximum number of uart ports are possible for new
> >>>> exynos7 SoC at this moment.
> >>>
> >>> Thanks for the review.
> >>> The main reason for me sending this patch was so that we may be able
> >>> to re-use the serial driver on arm64 based Exynos7 too. The two
> >>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
> >>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
> >>> for these 2 symbols. However, Tomasz suggested that a clean-up of
> >>> these two symbols would be a better option.
> >>>
> >>> Please see the discussion of the previous version here:
> >>> https://lkml.org/lkml/2014/9/29/702
> >>>
> >>> Can you please let me know if the previous version is acceptable ?
> >>
> >> Kukjin, can you please indicate the approach you would like me to
> >> take. Without this serial support is blocked on Exynos7.
> >
> > Gentle reminder on this.
>
> Hi Kukjin,
>
Hi Abhilash,
> I don't mean to nag, but this another reminder to review this.
Yeah, it's no problem for me ;)
> Please let me know if you are too busy to have a look at this or
> require some more inputs from me.
>
Since I'm still having some objection on 2nd version, how about keeping current
config options for serial for now and changing the dependency to SERIAL_SAMSUNG?
And if required later, we can look into removal these config options later.
Thanks,
Kukjin
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-11-09 4:39 ` Kukjin Kim
0 siblings, 0 replies; 22+ messages in thread
From: Kukjin Kim @ 2014-11-09 4:39 UTC (permalink / raw)
To: linux-arm-kernel
Abhilash Kesavan wrote:
>
> On Mon, Nov 3, 2014 at 1:51 PM, Abhilash Kesavan
> <kesavan.abhilash@gmail.com> wrote:
> > Hello Kukjin,
> >
> > On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
> > <kesavan.abhilash@gmail.com> wrote:
> >> Hi Kukjin,
> >>
> >> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
> >> <kesavan.abhilash@gmail.com> wrote:
> >>> Hi Kukjin
> >>>
> >>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
> >>>> Abhilash Kesavan wrote:
> >>>>>
> >>>> Hi,
> >>>>
> >>>> Sorry for late response.
> >>>>
> >>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
> >>>>> select the number of UART ports available on the SoC. Replace the usage
> >>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
> >>>>
> >>>> Well, as you know the number of uart ports are different on each Samsung SoCs
> >>>> so I don't think just using maximum number of uart ports are possible for new
> >>>> exynos7 SoC at this moment.
> >>>
> >>> Thanks for the review.
> >>> The main reason for me sending this patch was so that we may be able
> >>> to re-use the serial driver on arm64 based Exynos7 too. The two
> >>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
> >>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
> >>> for these 2 symbols. However, Tomasz suggested that a clean-up of
> >>> these two symbols would be a better option.
> >>>
> >>> Please see the discussion of the previous version here:
> >>> https://lkml.org/lkml/2014/9/29/702
> >>>
> >>> Can you please let me know if the previous version is acceptable ?
> >>
> >> Kukjin, can you please indicate the approach you would like me to
> >> take. Without this serial support is blocked on Exynos7.
> >
> > Gentle reminder on this.
>
> Hi Kukjin,
>
Hi Abhilash,
> I don't mean to nag, but this another reminder to review this.
Yeah, it's no problem for me ;)
> Please let me know if you are too busy to have a look at this or
> require some more inputs from me.
>
Since I'm still having some objection on 2nd version, how about keeping current
config options for serial for now and changing the dependency to SERIAL_SAMSUNG?
And if required later, we can look into removal these config options later.
Thanks,
Kukjin
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
2014-11-09 4:39 ` Kukjin Kim
@ 2014-11-10 8:14 ` Abhilash Kesavan
-1 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-11-10 8:14 UTC (permalink / raw)
To: Kukjin Kim, Kukjin Kim, Kukjin Kim
Cc: linux-arm-kernel, gregkh, linux-samsung-soc, Tomasz Figa, Arnd Bergmann
Hi Kukjin,
On Sun, Nov 9, 2014 at 10:09 AM, Kukjin Kim <kgene@kernel.org> wrote:
> Abhilash Kesavan wrote:
>>
>> On Mon, Nov 3, 2014 at 1:51 PM, Abhilash Kesavan
>> <kesavan.abhilash@gmail.com> wrote:
>> > Hello Kukjin,
>> >
>> > On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
>> > <kesavan.abhilash@gmail.com> wrote:
>> >> Hi Kukjin,
>> >>
>> >> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
>> >> <kesavan.abhilash@gmail.com> wrote:
>> >>> Hi Kukjin
>> >>>
>> >>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>> >>>> Abhilash Kesavan wrote:
>> >>>>>
>> >>>> Hi,
>> >>>>
>> >>>> Sorry for late response.
>> >>>>
>> >>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>> >>>>> select the number of UART ports available on the SoC. Replace the usage
>> >>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>> >>>>
>> >>>> Well, as you know the number of uart ports are different on each Samsung SoCs
>> >>>> so I don't think just using maximum number of uart ports are possible for new
>> >>>> exynos7 SoC at this moment.
>> >>>
>> >>> Thanks for the review.
>> >>> The main reason for me sending this patch was so that we may be able
>> >>> to re-use the serial driver on arm64 based Exynos7 too. The two
>> >>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
>> >>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
>> >>> for these 2 symbols. However, Tomasz suggested that a clean-up of
>> >>> these two symbols would be a better option.
>> >>>
>> >>> Please see the discussion of the previous version here:
>> >>> https://lkml.org/lkml/2014/9/29/702
>> >>>
>> >>> Can you please let me know if the previous version is acceptable ?
>> >>
>> >> Kukjin, can you please indicate the approach you would like me to
>> >> take. Without this serial support is blocked on Exynos7.
>> >
>> > Gentle reminder on this.
>>
>> Hi Kukjin,
>>
> Hi Abhilash,
>
>> I don't mean to nag, but this another reminder to review this.
>
> Yeah, it's no problem for me ;)
>
>> Please let me know if you are too busy to have a look at this or
>> require some more inputs from me.
>>
> Since I'm still having some objection on 2nd version, how about keeping current
> config options for serial for now and changing the dependency to SERIAL_SAMSUNG?
> And if required later, we can look into removal these config options later.
OK, thanks. My earlier patch [1] which does this still applies cleanly
on linux-next. I will request Greg to review the patch.
I had a question regarding the merging of pending exynos7 patches.
The clock exynos7 support will go through your tree (according to [2])
and so must the exynos7 arch/dts support [3] due to the related
dependencies. As part of the arch/dts support we are enabling the
samsung serial driver in arm64 defconfig. This will cause build
breakages without [1] being applied. So, I assume all 3 patch-sets
will go through your tree once they have been ack'ed or is there some
other way ?
[1] serial: samsung: Fix serial config dependencies for exynos7
https://patchwork.kernel.org/patch/4993521/
[2] GIT PULL] Samsung clock changes for 3.19
http://www.spinics.net/lists/arm-kernel/msg373962.html
[3] [PATCH v7 0/7] Enable support for Samsung Exynos7 SoC
http://www.spinics.net/lists/arm-kernel/msg375961.html
>
> Thanks,
> Kukjin
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs
@ 2014-11-10 8:14 ` Abhilash Kesavan
0 siblings, 0 replies; 22+ messages in thread
From: Abhilash Kesavan @ 2014-11-10 8:14 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kukjin,
On Sun, Nov 9, 2014 at 10:09 AM, Kukjin Kim <kgene@kernel.org> wrote:
> Abhilash Kesavan wrote:
>>
>> On Mon, Nov 3, 2014 at 1:51 PM, Abhilash Kesavan
>> <kesavan.abhilash@gmail.com> wrote:
>> > Hello Kukjin,
>> >
>> > On Fri, Oct 31, 2014 at 8:06 AM, Abhilash Kesavan
>> > <kesavan.abhilash@gmail.com> wrote:
>> >> Hi Kukjin,
>> >>
>> >> On Tue, Oct 28, 2014 at 5:56 PM, Abhilash Kesavan
>> >> <kesavan.abhilash@gmail.com> wrote:
>> >>> Hi Kukjin
>> >>>
>> >>> On Tue, Oct 28, 2014 at 4:01 PM, Kukjin Kim <kgene@kernel.org> wrote:
>> >>>> Abhilash Kesavan wrote:
>> >>>>>
>> >>>> Hi,
>> >>>>
>> >>>> Sorry for late response.
>> >>>>
>> >>>>> Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which
>> >>>>> select the number of UART ports available on the SoC. Replace the usage
>> >>>>> of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of
>> >>>>
>> >>>> Well, as you know the number of uart ports are different on each Samsung SoCs
>> >>>> so I don't think just using maximum number of uart ports are possible for new
>> >>>> exynos7 SoC at this moment.
>> >>>
>> >>> Thanks for the review.
>> >>> The main reason for me sending this patch was so that we may be able
>> >>> to re-use the serial driver on arm64 based Exynos7 too. The two
>> >>> symbols mentioned above which depend on PLAT_SAMSUNG prevent this. I
>> >>> initially sent a patch which changed the dependency to SERIAL_SAMSUNG
>> >>> for these 2 symbols. However, Tomasz suggested that a clean-up of
>> >>> these two symbols would be a better option.
>> >>>
>> >>> Please see the discussion of the previous version here:
>> >>> https://lkml.org/lkml/2014/9/29/702
>> >>>
>> >>> Can you please let me know if the previous version is acceptable ?
>> >>
>> >> Kukjin, can you please indicate the approach you would like me to
>> >> take. Without this serial support is blocked on Exynos7.
>> >
>> > Gentle reminder on this.
>>
>> Hi Kukjin,
>>
> Hi Abhilash,
>
>> I don't mean to nag, but this another reminder to review this.
>
> Yeah, it's no problem for me ;)
>
>> Please let me know if you are too busy to have a look at this or
>> require some more inputs from me.
>>
> Since I'm still having some objection on 2nd version, how about keeping current
> config options for serial for now and changing the dependency to SERIAL_SAMSUNG?
> And if required later, we can look into removal these config options later.
OK, thanks. My earlier patch [1] which does this still applies cleanly
on linux-next. I will request Greg to review the patch.
I had a question regarding the merging of pending exynos7 patches.
The clock exynos7 support will go through your tree (according to [2])
and so must the exynos7 arch/dts support [3] due to the related
dependencies. As part of the arch/dts support we are enabling the
samsung serial driver in arm64 defconfig. This will cause build
breakages without [1] being applied. So, I assume all 3 patch-sets
will go through your tree once they have been ack'ed or is there some
other way ?
[1] serial: samsung: Fix serial config dependencies for exynos7
https://patchwork.kernel.org/patch/4993521/
[2] GIT PULL] Samsung clock changes for 3.19
http://www.spinics.net/lists/arm-kernel/msg373962.html
[3] [PATCH v7 0/7] Enable support for Samsung Exynos7 SoC
http://www.spinics.net/lists/arm-kernel/msg375961.html
>
> Thanks,
> Kukjin
>
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2014-11-10 8:14 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01 16:42 [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol Abhilash Kesavan
2014-10-01 16:42 ` Abhilash Kesavan
2014-10-01 16:42 ` [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs Abhilash Kesavan
2014-10-01 16:42 ` Abhilash Kesavan
2014-10-28 10:31 ` Kukjin Kim
2014-10-28 10:31 ` Kukjin Kim
2014-10-28 12:26 ` Abhilash Kesavan
2014-10-28 12:26 ` Abhilash Kesavan
2014-10-31 2:36 ` Abhilash Kesavan
2014-10-31 2:36 ` Abhilash Kesavan
2014-11-03 8:21 ` Abhilash Kesavan
2014-11-03 8:21 ` Abhilash Kesavan
2014-11-09 4:19 ` Abhilash Kesavan
2014-11-09 4:19 ` Abhilash Kesavan
2014-11-09 4:39 ` Kukjin Kim
2014-11-09 4:39 ` Kukjin Kim
2014-11-10 8:14 ` Abhilash Kesavan
2014-11-10 8:14 ` Abhilash Kesavan
2014-10-20 13:41 ` [PATCH v2 1/2] arch: arm: samsung: Clean-up usage of CONFIG_SERIAL_SAMSUNG_UARTS symbol Abhilash Kesavan
2014-10-20 13:41 ` Abhilash Kesavan
2014-10-28 6:54 ` Abhilash Kesavan
2014-10-28 6:54 ` Abhilash Kesavan
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.