Skip to content

Commit 1db536f

Browse files
vwaxgregkh
authored andcommitted
tty: serial: samsung: Add ARTPEC-8 support
Add support for the UART block on the ARTPEC-8 SoC. This is closely related to the variants used on the Exynos chips. The register layout is identical to Exynos850 et al but the fifo size is different (64 bytes in each direction for all instances). Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Link: https://lore.kernel.org/r/20220311094515.3223023-3-vincent.whitchurch@axis.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 02a64ef commit 1db536f

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ config SERIAL_CLPS711X_CONSOLE
237237

238238
config SERIAL_SAMSUNG
239239
tristate "Samsung SoC serial support"
240-
depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_APPLE || COMPILE_TEST
240+
depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || ARCH_APPLE || ARCH_ARTPEC || COMPILE_TEST
241241
select SERIAL_CORE
242242
help
243243
Support for the on-chip UARTs on the Samsung

drivers/tty/serial/samsung_tty.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2825,6 +2825,36 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
28252825
#define S5L_SERIAL_DRV_DATA NULL
28262826
#endif
28272827

2828+
#if defined(CONFIG_ARCH_ARTPEC)
2829+
static const struct s3c24xx_serial_drv_data artpec8_serial_drv_data = {
2830+
.info = {
2831+
.name = "Axis ARTPEC-8 UART",
2832+
.type = TYPE_S3C6400,
2833+
.port_type = PORT_S3C6400,
2834+
.fifosize = 64,
2835+
.has_divslot = 1,
2836+
.rx_fifomask = S5PV210_UFSTAT_RXMASK,
2837+
.rx_fifoshift = S5PV210_UFSTAT_RXSHIFT,
2838+
.rx_fifofull = S5PV210_UFSTAT_RXFULL,
2839+
.tx_fifofull = S5PV210_UFSTAT_TXFULL,
2840+
.tx_fifomask = S5PV210_UFSTAT_TXMASK,
2841+
.tx_fifoshift = S5PV210_UFSTAT_TXSHIFT,
2842+
.def_clk_sel = S3C2410_UCON_CLKSEL0,
2843+
.num_clks = 1,
2844+
.clksel_mask = 0,
2845+
.clksel_shift = 0,
2846+
},
2847+
.def_cfg = {
2848+
.ucon = S5PV210_UCON_DEFAULT,
2849+
.ufcon = S5PV210_UFCON_DEFAULT,
2850+
.has_fracval = 1,
2851+
}
2852+
};
2853+
#define ARTPEC8_SERIAL_DRV_DATA (&artpec8_serial_drv_data)
2854+
#else
2855+
#define ARTPEC8_SERIAL_DRV_DATA (NULL)
2856+
#endif
2857+
28282858
static const struct platform_device_id s3c24xx_serial_driver_ids[] = {
28292859
{
28302860
.name = "s3c2410-uart",
@@ -2853,6 +2883,9 @@ static const struct platform_device_id s3c24xx_serial_driver_ids[] = {
28532883
}, {
28542884
.name = "exynos850-uart",
28552885
.driver_data = (kernel_ulong_t)EXYNOS850_SERIAL_DRV_DATA,
2886+
}, {
2887+
.name = "artpec8-uart",
2888+
.driver_data = (kernel_ulong_t)ARTPEC8_SERIAL_DRV_DATA,
28562889
},
28572890
{ },
28582891
};
@@ -2878,6 +2911,8 @@ static const struct of_device_id s3c24xx_uart_dt_match[] = {
28782911
.data = S5L_SERIAL_DRV_DATA },
28792912
{ .compatible = "samsung,exynos850-uart",
28802913
.data = EXYNOS850_SERIAL_DRV_DATA },
2914+
{ .compatible = "axis,artpec8-uart",
2915+
.data = ARTPEC8_SERIAL_DRV_DATA },
28812916
{},
28822917
};
28832918
MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
@@ -3056,6 +3091,8 @@ OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart",
30563091
s5pv210_early_console_setup);
30573092
OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart",
30583093
s5pv210_early_console_setup);
3094+
OF_EARLYCON_DECLARE(artpec8, "axis,artpec8-uart",
3095+
s5pv210_early_console_setup);
30593096

30603097
/* Apple S5L */
30613098
static int __init apple_s5l_early_console_setup(struct earlycon_device *device,

0 commit comments

Comments
 (0)