summaryrefslogtreecommitdiff
path: root/target/linux/cns21xx/patches-3.10/101-cns21xx-serial-support.patch
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-09-13 16:39:33 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-09-13 16:39:33 +0000
commit00b34e1dcd7ebabf81f7e96c51e56b5241648934 (patch)
tree0872cb3e4f6dd6f4d7e4c9b51c57efa48419b06f /target/linux/cns21xx/patches-3.10/101-cns21xx-serial-support.patch
parentac718400e0347e4a8872941602c54d88eb46737f (diff)
cns21xx: add support for 3.10
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37971 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/cns21xx/patches-3.10/101-cns21xx-serial-support.patch')
-rw-r--r--target/linux/cns21xx/patches-3.10/101-cns21xx-serial-support.patch103
1 files changed, 103 insertions, 0 deletions
diff --git a/target/linux/cns21xx/patches-3.10/101-cns21xx-serial-support.patch b/target/linux/cns21xx/patches-3.10/101-cns21xx-serial-support.patch
new file mode 100644
index 0000000000..029059a951
--- /dev/null
+++ b/target/linux/cns21xx/patches-3.10/101-cns21xx-serial-support.patch
@@ -0,0 +1,103 @@
+--- a/arch/arm/mach-cns21xx/common.h
++++ b/arch/arm/mach-cns21xx/common.h
+@@ -17,4 +17,7 @@ void cns21xx_timer_init(void);
+
+ extern struct sys_timer cns21xx_timer;
+
++int cns21xx_register_uart0(void);
++int cns21xx_register_uart1(void);
++
+ #endif /* _MACH_CNS21XX_COMMON_H */
+--- /dev/null
++++ b/arch/arm/mach-cns21xx/devices.c
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (c) 2008 Cavium Networks
++ * Copyright (c) 2010-2012 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This file is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License, Version 2, as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/platform_device.h>
++#include <linux/serial_8250.h>
++
++#include <mach/irqs.h>
++#include <mach/hardware.h>
++#include <mach/cns21xx.h>
++#include <mach/cns21xx_misc.h>
++
++#define CNS21XX_UART_CLOCK 24000000
++
++#define CNS21XX_UART_FLAGS (UPF_SKIP_TEST | UPF_FIXED_TYPE | UPF_NO_TXEN_TEST)
++
++static struct plat_serial8250_port cns21xx_uart0_data[] = {
++ {
++ .mapbase = CNS21XX_UART0_BASE,
++ .membase = (void *) CNS21XX_UART0_BASE_VIRT,
++ .irq = CNS21XX_IRQ_UART0,
++ .uartclk = CNS21XX_UART_CLOCK,
++ .regshift = 2,
++ .iotype = UPIO_MEM,
++ .type = PORT_16550A,
++ .flags = CNS21XX_UART_FLAGS,
++ }, {
++ /* terminating entry */
++ },
++};
++
++static struct platform_device cns21xx_uart0_device = {
++ .name = "serial8250",
++ .id = PLAT8250_DEV_PLATFORM,
++ .dev = {
++ .platform_data = cns21xx_uart0_data,
++ },
++};
++
++int __init cns21xx_register_uart0(void)
++{
++ return platform_device_register(&cns21xx_uart0_device);
++}
++
++static struct plat_serial8250_port cns21xx_uart1_data[] = {
++ {
++ .mapbase = CNS21XX_UART1_BASE,
++ .membase = (void *) CNS21XX_UART1_BASE_VIRT,
++ .irq = CNS21XX_IRQ_UART1,
++ .uartclk = CNS21XX_UART_CLOCK,
++ .regshift = 2,
++ .iotype = UPIO_MEM,
++ .type = PORT_16550A,
++ .flags = CNS21XX_UART_FLAGS,
++ }, {
++ /* terminating entry */
++ },
++};
++
++static struct platform_device cns21xx_uart1_device = {
++ .name = "serial8250",
++ .id = PLAT8250_DEV_PLATFORM1,
++ .dev = {
++ .platform_data = cns21xx_uart1_data,
++ },
++};
++
++int __init cns21xx_register_uart1(void)
++{
++ HAL_MISC_ENABLE_UART1_PINS();
++ return platform_device_register(&cns21xx_uart1_device);
++}
+--- a/arch/arm/mach-cns21xx/Makefile
++++ b/arch/arm/mach-cns21xx/Makefile
+@@ -4,7 +4,7 @@
+
+ # Object file lists.
+
+-obj-y := core.o irq.o mm.o time.o idle.o
++obj-y := core.o irq.o mm.o time.o idle.o devices.o
+
+ # machine specific files
+