aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorManjunathappa, Prakash <prakash.pm@ti.com>2013-06-19 05:15:38 -0400
committerSekhar Nori <nsekhar@ti.com>2013-07-22 06:04:55 -0400
commit19955c3d7453757271d05859958ca1804a5d2d67 (patch)
tree978e156a66db7dae2435c23046a75757958f8e5f /arch/arm
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff)
ARM: davinci: uart: move to devid based clk_get
For modules having single clock, clk_get should be done with dev_id. But current davinci implementation handles multiple instances of the UART devices with single platform_device_register. Hence clk_get is based on con_id rather than dev_id, this is not correct. Do platform_device_register for each instance and clk_get on dev_id. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> [nsekhar@ti.com: actually stop using con_id in clk_get(), squash the patch adding OF aux data into this one] Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-davinci/da830.c8
-rw-r--r--arch/arm/mach-davinci/da850.c8
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c3
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c42
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c37
-rw-r--r--arch/arm/mach-davinci/dm355.c52
-rw-r--r--arch/arm/mach-davinci/dm365.c38
-rw-r--r--arch/arm/mach-davinci/dm644x.c52
-rw-r--r--arch/arm/mach-davinci/dm646x.c52
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h2
-rw-r--r--arch/arm/mach-davinci/serial.c23
-rw-r--r--arch/arm/mach-davinci/tnetv107x.c8
13 files changed, 243 insertions, 84 deletions
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index abbaf0270be6..a3ffd527dbe5 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -395,9 +395,9 @@ static struct clk_lookup da830_clks[] = {
395 CLK(NULL, "tptc0", &tptc0_clk), 395 CLK(NULL, "tptc0", &tptc0_clk),
396 CLK(NULL, "tptc1", &tptc1_clk), 396 CLK(NULL, "tptc1", &tptc1_clk),
397 CLK("da830-mmc.0", NULL, &mmcsd_clk), 397 CLK("da830-mmc.0", NULL, &mmcsd_clk),
398 CLK(NULL, "uart0", &uart0_clk), 398 CLK("serial8250.0", NULL, &uart0_clk),
399 CLK(NULL, "uart1", &uart1_clk), 399 CLK("serial8250.1", NULL, &uart1_clk),
400 CLK(NULL, "uart2", &uart2_clk), 400 CLK("serial8250.2", NULL, &uart2_clk),
401 CLK("spi_davinci.0", NULL, &spi0_clk), 401 CLK("spi_davinci.0", NULL, &spi0_clk),
402 CLK("spi_davinci.1", NULL, &spi1_clk), 402 CLK("spi_davinci.1", NULL, &spi1_clk),
403 CLK(NULL, "ecap0", &ecap0_clk), 403 CLK(NULL, "ecap0", &ecap0_clk),
@@ -1199,7 +1199,7 @@ static struct davinci_soc_info davinci_soc_info_da830 = {
1199 .gpio_base = DA8XX_GPIO_BASE, 1199 .gpio_base = DA8XX_GPIO_BASE,
1200 .gpio_num = 128, 1200 .gpio_num = 128,
1201 .gpio_irq = IRQ_DA8XX_GPIO0, 1201 .gpio_irq = IRQ_DA8XX_GPIO0,
1202 .serial_dev = &da8xx_serial_device, 1202 .serial_dev = da8xx_serial_device,
1203 .emac_pdata = &da8xx_emac_pdata, 1203 .emac_pdata = &da8xx_emac_pdata,
1204}; 1204};
1205 1205
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index a0d4f6038b60..d4274ab5e742 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -451,9 +451,9 @@ static struct clk_lookup da850_clks[] = {
451 CLK(NULL, "tpcc1", &tpcc1_clk), 451 CLK(NULL, "tpcc1", &tpcc1_clk),
452 CLK(NULL, "tptc2", &tptc2_clk), 452 CLK(NULL, "tptc2", &tptc2_clk),
453 CLK("pruss_uio", "pruss", &pruss_clk), 453 CLK("pruss_uio", "pruss", &pruss_clk),
454 CLK(NULL, "uart0", &uart0_clk), 454 CLK("serial8250.0", NULL, &uart0_clk),
455 CLK(NULL, "uart1", &uart1_clk), 455 CLK("serial8250.1", NULL, &uart1_clk),
456 CLK(NULL, "uart2", &uart2_clk), 456 CLK("serial8250.2", NULL, &uart2_clk),
457 CLK(NULL, "aintc", &aintc_clk), 457 CLK(NULL, "aintc", &aintc_clk),
458 CLK(NULL, "gpio", &gpio_clk), 458 CLK(NULL, "gpio", &gpio_clk),
459 CLK("i2c_davinci.2", NULL, &i2c1_clk), 459 CLK("i2c_davinci.2", NULL, &i2c1_clk),
@@ -1301,7 +1301,7 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
1301 .gpio_base = DA8XX_GPIO_BASE, 1301 .gpio_base = DA8XX_GPIO_BASE,
1302 .gpio_num = 144, 1302 .gpio_num = 144,
1303 .gpio_irq = IRQ_DA8XX_GPIO0, 1303 .gpio_irq = IRQ_DA8XX_GPIO0,
1304 .serial_dev = &da8xx_serial_device, 1304 .serial_dev = da8xx_serial_device,
1305 .emac_pdata = &da8xx_emac_pdata, 1305 .emac_pdata = &da8xx_emac_pdata,
1306 .sram_dma = DA8XX_SHARED_RAM_BASE, 1306 .sram_dma = DA8XX_SHARED_RAM_BASE,
1307 .sram_len = SZ_128K, 1307 .sram_len = SZ_128K,
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 961aea8bbad5..e4299455c644 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -47,6 +47,9 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
47 OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL), 47 OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
48 OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL), 48 OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
49 OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL), 49 OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL),
50 OF_DEV_AUXDATA("ns16550a", 0x01c42000, "serial8250.0", NULL),
51 OF_DEV_AUXDATA("ns16550a", 0x01d0c000, "serial8250.1", NULL),
52 OF_DEV_AUXDATA("ns16550a", 0x01d0d000, "serial8250.2", NULL),
50 {} 53 {}
51}; 54};
52 55
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 71a46a348761..280f67df92b5 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -68,7 +68,7 @@
68void __iomem *da8xx_syscfg0_base; 68void __iomem *da8xx_syscfg0_base;
69void __iomem *da8xx_syscfg1_base; 69void __iomem *da8xx_syscfg1_base;
70 70
71static struct plat_serial8250_port da8xx_serial_pdata[] = { 71static struct plat_serial8250_port da8xx_serial0_pdata[] = {
72 { 72 {
73 .mapbase = DA8XX_UART0_BASE, 73 .mapbase = DA8XX_UART0_BASE,
74 .irq = IRQ_DA8XX_UARTINT0, 74 .irq = IRQ_DA8XX_UARTINT0,
@@ -78,6 +78,11 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
78 .regshift = 2, 78 .regshift = 2,
79 }, 79 },
80 { 80 {
81 .flags = 0,
82 }
83};
84static struct plat_serial8250_port da8xx_serial1_pdata[] = {
85 {
81 .mapbase = DA8XX_UART1_BASE, 86 .mapbase = DA8XX_UART1_BASE,
82 .irq = IRQ_DA8XX_UARTINT1, 87 .irq = IRQ_DA8XX_UARTINT1,
83 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 88 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -86,6 +91,11 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
86 .regshift = 2, 91 .regshift = 2,
87 }, 92 },
88 { 93 {
94 .flags = 0,
95 }
96};
97static struct plat_serial8250_port da8xx_serial2_pdata[] = {
98 {
89 .mapbase = DA8XX_UART2_BASE, 99 .mapbase = DA8XX_UART2_BASE,
90 .irq = IRQ_DA8XX_UARTINT2, 100 .irq = IRQ_DA8XX_UARTINT2,
91 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 101 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -95,15 +105,33 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
95 }, 105 },
96 { 106 {
97 .flags = 0, 107 .flags = 0,
98 }, 108 }
99}; 109};
100 110
101struct platform_device da8xx_serial_device = { 111struct platform_device da8xx_serial_device[] = {
102 .name = "serial8250", 112 {
103 .id = PLAT8250_DEV_PLATFORM, 113 .name = "serial8250",
104 .dev = { 114 .id = PLAT8250_DEV_PLATFORM,
105 .platform_data = da8xx_serial_pdata, 115 .dev = {
116 .platform_data = da8xx_serial0_pdata,
117 }
118 },
119 {
120 .name = "serial8250",
121 .id = PLAT8250_DEV_PLATFORM1,
122 .dev = {
123 .platform_data = da8xx_serial1_pdata,
124 }
106 }, 125 },
126 {
127 .name = "serial8250",
128 .id = PLAT8250_DEV_PLATFORM2,
129 .dev = {
130 .platform_data = da8xx_serial2_pdata,
131 }
132 },
133 {
134 }
107}; 135};
108 136
109static s8 da8xx_queue_tc_mapping[][2] = { 137static s8 da8xx_queue_tc_mapping[][2] = {
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
index 128cb9ae80f4..fc4a0feb4a47 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -126,7 +126,7 @@ static struct platform_device edma_device = {
126 .dev.platform_data = tnetv107x_edma_info, 126 .dev.platform_data = tnetv107x_edma_info,
127}; 127};
128 128
129static struct plat_serial8250_port serial_data[] = { 129static struct plat_serial8250_port serial0_platform_data[] = {
130 { 130 {
131 .mapbase = TNETV107X_UART0_BASE, 131 .mapbase = TNETV107X_UART0_BASE,
132 .irq = IRQ_TNETV107X_UART0, 132 .irq = IRQ_TNETV107X_UART0,
@@ -137,6 +137,11 @@ static struct plat_serial8250_port serial_data[] = {
137 .regshift = 2, 137 .regshift = 2,
138 }, 138 },
139 { 139 {
140 .flags = 0,
141 }
142};
143static struct plat_serial8250_port serial1_platform_data[] = {
144 {
140 .mapbase = TNETV107X_UART1_BASE, 145 .mapbase = TNETV107X_UART1_BASE,
141 .irq = IRQ_TNETV107X_UART1, 146 .irq = IRQ_TNETV107X_UART1,
142 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 147 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -146,6 +151,11 @@ static struct plat_serial8250_port serial_data[] = {
146 .regshift = 2, 151 .regshift = 2,
147 }, 152 },
148 { 153 {
154 .flags = 0,
155 }
156};
157static struct plat_serial8250_port serial2_platform_data[] = {
158 {
149 .mapbase = TNETV107X_UART2_BASE, 159 .mapbase = TNETV107X_UART2_BASE,
150 .irq = IRQ_TNETV107X_UART2, 160 .irq = IRQ_TNETV107X_UART2,
151 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 161 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -156,13 +166,28 @@ static struct plat_serial8250_port serial_data[] = {
156 }, 166 },
157 { 167 {
158 .flags = 0, 168 .flags = 0,
159 }, 169 }
160}; 170};
161 171
162struct platform_device tnetv107x_serial_device = { 172
163 .name = "serial8250", 173struct platform_device tnetv107x_serial_device[] = {
164 .id = PLAT8250_DEV_PLATFORM, 174 {
165 .dev.platform_data = serial_data, 175 .name = "serial8250",
176 .id = PLAT8250_DEV_PLATFORM,
177 .dev.platform_data = serial0_platform_data,
178 },
179 {
180 .name = "serial8250",
181 .id = PLAT8250_DEV_PLATFORM1,
182 .dev.platform_data = serial1_platform_data,
183 },
184 {
185 .name = "serial8250",
186 .id = PLAT8250_DEV_PLATFORM2,
187 .dev.platform_data = serial2_platform_data,
188 },
189 {
190 }
166}; 191};
167 192
168static struct resource mmc0_resources[] = { 193static struct resource mmc0_resources[] = {
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 42ef53f62c6c..29fdbae16995 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -357,9 +357,9 @@ static struct clk_lookup dm355_clks[] = {
357 CLK(NULL, "clkout3", &clkout3_clk), 357 CLK(NULL, "clkout3", &clkout3_clk),
358 CLK(NULL, "arm", &arm_clk), 358 CLK(NULL, "arm", &arm_clk),
359 CLK(NULL, "mjcp", &mjcp_clk), 359 CLK(NULL, "mjcp", &mjcp_clk),
360 CLK(NULL, "uart0", &uart0_clk), 360 CLK("serial8250.0", NULL, &uart0_clk),
361 CLK(NULL, "uart1", &uart1_clk), 361 CLK("serial8250.1", NULL, &uart1_clk),
362 CLK(NULL, "uart2", &uart2_clk), 362 CLK("serial8250.2", NULL, &uart2_clk),
363 CLK("i2c_davinci.1", NULL, &i2c_clk), 363 CLK("i2c_davinci.1", NULL, &i2c_clk),
364 CLK("davinci-mcbsp.0", NULL, &asp0_clk), 364 CLK("davinci-mcbsp.0", NULL, &asp0_clk),
365 CLK("davinci-mcbsp.1", NULL, &asp1_clk), 365 CLK("davinci-mcbsp.1", NULL, &asp1_clk),
@@ -922,7 +922,7 @@ static struct davinci_timer_info dm355_timer_info = {
922 .clocksource_id = T0_TOP, 922 .clocksource_id = T0_TOP,
923}; 923};
924 924
925static struct plat_serial8250_port dm355_serial_platform_data[] = { 925static struct plat_serial8250_port dm355_serial0_platform_data[] = {
926 { 926 {
927 .mapbase = DAVINCI_UART0_BASE, 927 .mapbase = DAVINCI_UART0_BASE,
928 .irq = IRQ_UARTINT0, 928 .irq = IRQ_UARTINT0,
@@ -932,6 +932,11 @@ static struct plat_serial8250_port dm355_serial_platform_data[] = {
932 .regshift = 2, 932 .regshift = 2,
933 }, 933 },
934 { 934 {
935 .flags = 0,
936 }
937};
938static struct plat_serial8250_port dm355_serial1_platform_data[] = {
939 {
935 .mapbase = DAVINCI_UART1_BASE, 940 .mapbase = DAVINCI_UART1_BASE,
936 .irq = IRQ_UARTINT1, 941 .irq = IRQ_UARTINT1,
937 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 942 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -940,6 +945,11 @@ static struct plat_serial8250_port dm355_serial_platform_data[] = {
940 .regshift = 2, 945 .regshift = 2,
941 }, 946 },
942 { 947 {
948 .flags = 0,
949 }
950};
951static struct plat_serial8250_port dm355_serial2_platform_data[] = {
952 {
943 .mapbase = DM355_UART2_BASE, 953 .mapbase = DM355_UART2_BASE,
944 .irq = IRQ_DM355_UARTINT2, 954 .irq = IRQ_DM355_UARTINT2,
945 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 955 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -948,16 +958,34 @@ static struct plat_serial8250_port dm355_serial_platform_data[] = {
948 .regshift = 2, 958 .regshift = 2,
949 }, 959 },
950 { 960 {
951 .flags = 0 961 .flags = 0,
952 }, 962 }
953}; 963};
954 964
955static struct platform_device dm355_serial_device = { 965static struct platform_device dm355_serial_device[] = {
956 .name = "serial8250", 966 {
957 .id = PLAT8250_DEV_PLATFORM, 967 .name = "serial8250",
958 .dev = { 968 .id = PLAT8250_DEV_PLATFORM,
959 .platform_data = dm355_serial_platform_data, 969 .dev = {
970 .platform_data = dm355_serial0_platform_data,
971 }
972 },
973 {
974 .name = "serial8250",
975 .id = PLAT8250_DEV_PLATFORM1,
976 .dev = {
977 .platform_data = dm355_serial1_platform_data,
978 }
960 }, 979 },
980 {
981 .name = "serial8250",
982 .id = PLAT8250_DEV_PLATFORM2,
983 .dev = {
984 .platform_data = dm355_serial2_platform_data,
985 }
986 },
987 {
988 }
961}; 989};
962 990
963static struct davinci_soc_info davinci_soc_info_dm355 = { 991static struct davinci_soc_info davinci_soc_info_dm355 = {
@@ -981,7 +1009,7 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
981 .gpio_base = DAVINCI_GPIO_BASE, 1009 .gpio_base = DAVINCI_GPIO_BASE,
982 .gpio_num = 104, 1010 .gpio_num = 104,
983 .gpio_irq = IRQ_DM355_GPIOBNK0, 1011 .gpio_irq = IRQ_DM355_GPIOBNK0,
984 .serial_dev = &dm355_serial_device, 1012 .serial_dev = dm355_serial_device,
985 .sram_dma = 0x00010000, 1013 .sram_dma = 0x00010000,
986 .sram_len = SZ_32K, 1014 .sram_len = SZ_32K,
987}; 1015};
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index fa7af5eda52d..b60118989f0c 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -455,8 +455,8 @@ static struct clk_lookup dm365_clks[] = {
455 CLK("vpss", "master", &vpss_master_clk), 455 CLK("vpss", "master", &vpss_master_clk),
456 CLK("vpss", "slave", &vpss_slave_clk), 456 CLK("vpss", "slave", &vpss_slave_clk),
457 CLK(NULL, "arm", &arm_clk), 457 CLK(NULL, "arm", &arm_clk),
458 CLK(NULL, "uart0", &uart0_clk), 458 CLK("serial8250.0", NULL, &uart0_clk),
459 CLK(NULL, "uart1", &uart1_clk), 459 CLK("serial8250.1", NULL, &uart1_clk),
460 CLK("i2c_davinci.1", NULL, &i2c_clk), 460 CLK("i2c_davinci.1", NULL, &i2c_clk),
461 CLK("da830-mmc.0", NULL, &mmcsd0_clk), 461 CLK("da830-mmc.0", NULL, &mmcsd0_clk),
462 CLK("da830-mmc.1", NULL, &mmcsd1_clk), 462 CLK("da830-mmc.1", NULL, &mmcsd1_clk),
@@ -1041,7 +1041,7 @@ static struct davinci_timer_info dm365_timer_info = {
1041 1041
1042#define DM365_UART1_BASE (IO_PHYS + 0x106000) 1042#define DM365_UART1_BASE (IO_PHYS + 0x106000)
1043 1043
1044static struct plat_serial8250_port dm365_serial_platform_data[] = { 1044static struct plat_serial8250_port dm365_serial0_platform_data[] = {
1045 { 1045 {
1046 .mapbase = DAVINCI_UART0_BASE, 1046 .mapbase = DAVINCI_UART0_BASE,
1047 .irq = IRQ_UARTINT0, 1047 .irq = IRQ_UARTINT0,
@@ -1051,6 +1051,11 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = {
1051 .regshift = 2, 1051 .regshift = 2,
1052 }, 1052 },
1053 { 1053 {
1054 .flags = 0,
1055 }
1056};
1057static struct plat_serial8250_port dm365_serial1_platform_data[] = {
1058 {
1054 .mapbase = DM365_UART1_BASE, 1059 .mapbase = DM365_UART1_BASE,
1055 .irq = IRQ_UARTINT1, 1060 .irq = IRQ_UARTINT1,
1056 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 1061 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -1059,16 +1064,27 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = {
1059 .regshift = 2, 1064 .regshift = 2,
1060 }, 1065 },
1061 { 1066 {
1062 .flags = 0 1067 .flags = 0,
1063 }, 1068 }
1064}; 1069};
1065 1070
1066static struct platform_device dm365_serial_device = { 1071static struct platform_device dm365_serial_device[] = {
1067 .name = "serial8250", 1072 {
1068 .id = PLAT8250_DEV_PLATFORM, 1073 .name = "serial8250",
1069 .dev = { 1074 .id = PLAT8250_DEV_PLATFORM,
1070 .platform_data = dm365_serial_platform_data, 1075 .dev = {
1076 .platform_data = dm365_serial0_platform_data,
1077 }
1078 },
1079 {
1080 .name = "serial8250",
1081 .id = PLAT8250_DEV_PLATFORM1,
1082 .dev = {
1083 .platform_data = dm365_serial1_platform_data,
1084 }
1071 }, 1085 },
1086 {
1087 }
1072}; 1088};
1073 1089
1074static struct davinci_soc_info davinci_soc_info_dm365 = { 1090static struct davinci_soc_info davinci_soc_info_dm365 = {
@@ -1093,7 +1109,7 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
1093 .gpio_num = 104, 1109 .gpio_num = 104,
1094 .gpio_irq = IRQ_DM365_GPIO0, 1110 .gpio_irq = IRQ_DM365_GPIO0,
1095 .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */ 1111 .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */
1096 .serial_dev = &dm365_serial_device, 1112 .serial_dev = dm365_serial_device,
1097 .emac_pdata = &dm365_emac_pdata, 1113 .emac_pdata = &dm365_emac_pdata,
1098 .sram_dma = 0x00010000, 1114 .sram_dma = 0x00010000,
1099 .sram_len = SZ_32K, 1115 .sram_len = SZ_32K,
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index a49d18246fe9..490eb8cd1dd3 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -303,9 +303,9 @@ static struct clk_lookup dm644x_clks[] = {
303 CLK("vpss", "master", &vpss_master_clk), 303 CLK("vpss", "master", &vpss_master_clk),
304 CLK("vpss", "slave", &vpss_slave_clk), 304 CLK("vpss", "slave", &vpss_slave_clk),
305 CLK(NULL, "arm", &arm_clk), 305 CLK(NULL, "arm", &arm_clk),
306 CLK(NULL, "uart0", &uart0_clk), 306 CLK("serial8250.0", NULL, &uart0_clk),
307 CLK(NULL, "uart1", &uart1_clk), 307 CLK("serial8250.1", NULL, &uart1_clk),
308 CLK(NULL, "uart2", &uart2_clk), 308 CLK("serial8250.2", NULL, &uart2_clk),
309 CLK("davinci_emac.1", NULL, &emac_clk), 309 CLK("davinci_emac.1", NULL, &emac_clk),
310 CLK("i2c_davinci.1", NULL, &i2c_clk), 310 CLK("i2c_davinci.1", NULL, &i2c_clk),
311 CLK("palm_bk3710", NULL, &ide_clk), 311 CLK("palm_bk3710", NULL, &ide_clk),
@@ -813,7 +813,7 @@ static struct davinci_timer_info dm644x_timer_info = {
813 .clocksource_id = T0_TOP, 813 .clocksource_id = T0_TOP,
814}; 814};
815 815
816static struct plat_serial8250_port dm644x_serial_platform_data[] = { 816static struct plat_serial8250_port dm644x_serial0_platform_data[] = {
817 { 817 {
818 .mapbase = DAVINCI_UART0_BASE, 818 .mapbase = DAVINCI_UART0_BASE,
819 .irq = IRQ_UARTINT0, 819 .irq = IRQ_UARTINT0,
@@ -823,6 +823,11 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = {
823 .regshift = 2, 823 .regshift = 2,
824 }, 824 },
825 { 825 {
826 .flags = 0,
827 }
828};
829static struct plat_serial8250_port dm644x_serial1_platform_data[] = {
830 {
826 .mapbase = DAVINCI_UART1_BASE, 831 .mapbase = DAVINCI_UART1_BASE,
827 .irq = IRQ_UARTINT1, 832 .irq = IRQ_UARTINT1,
828 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 833 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -831,6 +836,11 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = {
831 .regshift = 2, 836 .regshift = 2,
832 }, 837 },
833 { 838 {
839 .flags = 0,
840 }
841};
842static struct plat_serial8250_port dm644x_serial2_platform_data[] = {
843 {
834 .mapbase = DAVINCI_UART2_BASE, 844 .mapbase = DAVINCI_UART2_BASE,
835 .irq = IRQ_UARTINT2, 845 .irq = IRQ_UARTINT2,
836 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 846 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -839,16 +849,34 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = {
839 .regshift = 2, 849 .regshift = 2,
840 }, 850 },
841 { 851 {
842 .flags = 0 852 .flags = 0,
843 }, 853 }
844}; 854};
845 855
846static struct platform_device dm644x_serial_device = { 856static struct platform_device dm644x_serial_device[] = {
847 .name = "serial8250", 857 {
848 .id = PLAT8250_DEV_PLATFORM, 858 .name = "serial8250",
849 .dev = { 859 .id = PLAT8250_DEV_PLATFORM,
850 .platform_data = dm644x_serial_platform_data, 860 .dev = {
861 .platform_data = dm644x_serial0_platform_data,
862 }
851 }, 863 },
864 {
865 .name = "serial8250",
866 .id = PLAT8250_DEV_PLATFORM1,
867 .dev = {
868 .platform_data = dm644x_serial1_platform_data,
869 }
870 },
871 {
872 .name = "serial8250",
873 .id = PLAT8250_DEV_PLATFORM2,
874 .dev = {
875 .platform_data = dm644x_serial2_platform_data,
876 }
877 },
878 {
879 }
852}; 880};
853 881
854static struct davinci_soc_info davinci_soc_info_dm644x = { 882static struct davinci_soc_info davinci_soc_info_dm644x = {
@@ -872,7 +900,7 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
872 .gpio_base = DAVINCI_GPIO_BASE, 900 .gpio_base = DAVINCI_GPIO_BASE,
873 .gpio_num = 71, 901 .gpio_num = 71,
874 .gpio_irq = IRQ_GPIOBNK0, 902 .gpio_irq = IRQ_GPIOBNK0,
875 .serial_dev = &dm644x_serial_device, 903 .serial_dev = dm644x_serial_device,
876 .emac_pdata = &dm644x_emac_pdata, 904 .emac_pdata = &dm644x_emac_pdata,
877 .sram_dma = 0x00008000, 905 .sram_dma = 0x00008000,
878 .sram_len = SZ_16K, 906 .sram_len = SZ_16K,
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index d1259e80141b..23609b1141fe 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -342,9 +342,9 @@ static struct clk_lookup dm646x_clks[] = {
342 CLK(NULL, "edma_tc1", &edma_tc1_clk), 342 CLK(NULL, "edma_tc1", &edma_tc1_clk),
343 CLK(NULL, "edma_tc2", &edma_tc2_clk), 343 CLK(NULL, "edma_tc2", &edma_tc2_clk),
344 CLK(NULL, "edma_tc3", &edma_tc3_clk), 344 CLK(NULL, "edma_tc3", &edma_tc3_clk),
345 CLK(NULL, "uart0", &uart0_clk), 345 CLK("serial8250.0", NULL, &uart0_clk),
346 CLK(NULL, "uart1", &uart1_clk), 346 CLK("serial8250.1", NULL, &uart1_clk),
347 CLK(NULL, "uart2", &uart2_clk), 347 CLK("serial8250.2", NULL, &uart2_clk),
348 CLK("i2c_davinci.1", NULL, &i2c_clk), 348 CLK("i2c_davinci.1", NULL, &i2c_clk),
349 CLK(NULL, "gpio", &gpio_clk), 349 CLK(NULL, "gpio", &gpio_clk),
350 CLK("davinci-mcasp.0", NULL, &mcasp0_clk), 350 CLK("davinci-mcasp.0", NULL, &mcasp0_clk),
@@ -790,7 +790,7 @@ static struct davinci_timer_info dm646x_timer_info = {
790 .clocksource_id = T0_TOP, 790 .clocksource_id = T0_TOP,
791}; 791};
792 792
793static struct plat_serial8250_port dm646x_serial_platform_data[] = { 793static struct plat_serial8250_port dm646x_serial0_platform_data[] = {
794 { 794 {
795 .mapbase = DAVINCI_UART0_BASE, 795 .mapbase = DAVINCI_UART0_BASE,
796 .irq = IRQ_UARTINT0, 796 .irq = IRQ_UARTINT0,
@@ -800,6 +800,11 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = {
800 .regshift = 2, 800 .regshift = 2,
801 }, 801 },
802 { 802 {
803 .flags = 0,
804 }
805};
806static struct plat_serial8250_port dm646x_serial1_platform_data[] = {
807 {
803 .mapbase = DAVINCI_UART1_BASE, 808 .mapbase = DAVINCI_UART1_BASE,
804 .irq = IRQ_UARTINT1, 809 .irq = IRQ_UARTINT1,
805 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 810 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -808,6 +813,11 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = {
808 .regshift = 2, 813 .regshift = 2,
809 }, 814 },
810 { 815 {
816 .flags = 0,
817 }
818};
819static struct plat_serial8250_port dm646x_serial2_platform_data[] = {
820 {
811 .mapbase = DAVINCI_UART2_BASE, 821 .mapbase = DAVINCI_UART2_BASE,
812 .irq = IRQ_DM646X_UARTINT2, 822 .irq = IRQ_DM646X_UARTINT2,
813 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 823 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
@@ -816,16 +826,34 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = {
816 .regshift = 2, 826 .regshift = 2,
817 }, 827 },
818 { 828 {
819 .flags = 0 829 .flags = 0,
820 }, 830 }
821}; 831};
822 832
823static struct platform_device dm646x_serial_device = { 833static struct platform_device dm646x_serial_device[] = {
824 .name = "serial8250", 834 {
825 .id = PLAT8250_DEV_PLATFORM, 835 .name = "serial8250",
826 .dev = { 836 .id = PLAT8250_DEV_PLATFORM,
827 .platform_data = dm646x_serial_platform_data, 837 .dev = {
838 .platform_data = dm646x_serial0_platform_data,
839 }
840 },
841 {
842 .name = "serial8250",
843 .id = PLAT8250_DEV_PLATFORM1,
844 .dev = {
845 .platform_data = dm646x_serial1_platform_data,
846 }
828 }, 847 },
848 {
849 .name = "serial8250",
850 .id = PLAT8250_DEV_PLATFORM2,
851 .dev = {
852 .platform_data = dm646x_serial2_platform_data,
853 }
854 },
855 {
856 }
829}; 857};
830 858
831static struct davinci_soc_info davinci_soc_info_dm646x = { 859static struct davinci_soc_info davinci_soc_info_dm646x = {
@@ -849,7 +877,7 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
849 .gpio_base = DAVINCI_GPIO_BASE, 877 .gpio_base = DAVINCI_GPIO_BASE,
850 .gpio_num = 43, /* Only 33 usable */ 878 .gpio_num = 43, /* Only 33 usable */
851 .gpio_irq = IRQ_DM646X_GPIOBNK0, 879 .gpio_irq = IRQ_DM646X_GPIOBNK0,
852 .serial_dev = &dm646x_serial_device, 880 .serial_dev = dm646x_serial_device,
853 .emac_pdata = &dm646x_emac_pdata, 881 .emac_pdata = &dm646x_emac_pdata,
854 .sram_dma = 0x10010000, 882 .sram_dma = 0x10010000,
855 .sram_len = SZ_32K, 883 .sram_len = SZ_32K,
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index 7b41a5e9bc31..aae53072c0eb 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -111,7 +111,7 @@ void da8xx_restart(enum reboot_mode mode, const char *cmd);
111void da8xx_rproc_reserve_cma(void); 111void da8xx_rproc_reserve_cma(void);
112int da8xx_register_rproc(void); 112int da8xx_register_rproc(void);
113 113
114extern struct platform_device da8xx_serial_device; 114extern struct platform_device da8xx_serial_device[];
115extern struct emac_platform_data da8xx_emac_pdata; 115extern struct emac_platform_data da8xx_emac_pdata;
116extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; 116extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
117extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; 117extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
index 16314c64f755..beb7c0e9114d 100644
--- a/arch/arm/mach-davinci/include/mach/tnetv107x.h
+++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h
@@ -50,7 +50,7 @@ struct tnetv107x_device_info {
50}; 50};
51 51
52extern struct platform_device tnetv107x_wdt_device; 52extern struct platform_device tnetv107x_wdt_device;
53extern struct platform_device tnetv107x_serial_device; 53extern struct platform_device tnetv107x_serial_device[];
54 54
55extern void tnetv107x_init(void); 55extern void tnetv107x_init(void);
56extern void tnetv107x_devices_init(struct tnetv107x_device_info *); 56extern void tnetv107x_devices_init(struct tnetv107x_device_info *);
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index f2625814c3c9..2bc74c2a8d45 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -73,13 +73,11 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
73/* Enable UART clock and obtain its rate */ 73/* Enable UART clock and obtain its rate */
74int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate) 74int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate)
75{ 75{
76 char name[16];
77 struct clk *clk; 76 struct clk *clk;
78 struct davinci_soc_info *soc_info = &davinci_soc_info; 77 struct davinci_soc_info *soc_info = &davinci_soc_info;
79 struct device *dev = &soc_info->serial_dev->dev; 78 struct device *dev = &soc_info->serial_dev[instance].dev;
80 79
81 sprintf(name, "uart%d", instance); 80 clk = clk_get(dev, NULL);
82 clk = clk_get(dev, name);
83 if (IS_ERR(clk)) { 81 if (IS_ERR(clk)) {
84 pr_err("%s:%d: failed to get UART%d clock\n", 82 pr_err("%s:%d: failed to get UART%d clock\n",
85 __func__, __LINE__, instance); 83 __func__, __LINE__, instance);
@@ -96,19 +94,25 @@ int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate)
96 94
97int __init davinci_serial_init(struct davinci_uart_config *info) 95int __init davinci_serial_init(struct davinci_uart_config *info)
98{ 96{
99 int i, ret; 97 int i, ret = 0;
100 struct davinci_soc_info *soc_info = &davinci_soc_info; 98 struct davinci_soc_info *soc_info = &davinci_soc_info;
101 struct device *dev = &soc_info->serial_dev->dev; 99 struct device *dev;
102 struct plat_serial8250_port *p = dev->platform_data; 100 struct plat_serial8250_port *p;
103 101
104 /* 102 /*
105 * Make sure the serial ports are muxed on at this point. 103 * Make sure the serial ports are muxed on at this point.
106 * You have to mux them off in device drivers later on if not needed. 104 * You have to mux them off in device drivers later on if not needed.
107 */ 105 */
108 for (i = 0; p->flags; i++, p++) { 106 for (i = 0; soc_info->serial_dev[i].dev.platform_data != NULL; i++) {
107 dev = &soc_info->serial_dev[i].dev;
108 p = dev->platform_data;
109 if (!(info->enabled_uarts & (1 << i))) 109 if (!(info->enabled_uarts & (1 << i)))
110 continue; 110 continue;
111 111
112 ret = platform_device_register(&soc_info->serial_dev[i]);
113 if (ret)
114 continue;
115
112 ret = davinci_serial_setup_clk(i, &p->uartclk); 116 ret = davinci_serial_setup_clk(i, &p->uartclk);
113 if (ret) 117 if (ret)
114 continue; 118 continue;
@@ -125,6 +129,5 @@ int __init davinci_serial_init(struct davinci_uart_config *info)
125 if (p->membase && p->type != PORT_AR7) 129 if (p->membase && p->type != PORT_AR7)
126 davinci_serial_reset(p); 130 davinci_serial_reset(p);
127 } 131 }
128 132 return ret;
129 return platform_device_register(soc_info->serial_dev);
130} 133}
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c
index 4545667ecd3c..f4d7fbb24b3b 100644
--- a/arch/arm/mach-davinci/tnetv107x.c
+++ b/arch/arm/mach-davinci/tnetv107x.c
@@ -264,7 +264,7 @@ static struct clk_lookup clks[] = {
264 CLK(NULL, "clk_chipcfg", &clk_chipcfg), 264 CLK(NULL, "clk_chipcfg", &clk_chipcfg),
265 CLK("tnetv107x-ts.0", NULL, &clk_tsc), 265 CLK("tnetv107x-ts.0", NULL, &clk_tsc),
266 CLK(NULL, "clk_rom", &clk_rom), 266 CLK(NULL, "clk_rom", &clk_rom),
267 CLK(NULL, "uart2", &clk_uart2), 267 CLK("serial8250.2", NULL, &clk_uart2),
268 CLK(NULL, "clk_pktsec", &clk_pktsec), 268 CLK(NULL, "clk_pktsec", &clk_pktsec),
269 CLK("tnetv107x-rng.0", NULL, &clk_rng), 269 CLK("tnetv107x-rng.0", NULL, &clk_rng),
270 CLK("tnetv107x-pka.0", NULL, &clk_pka), 270 CLK("tnetv107x-pka.0", NULL, &clk_pka),
@@ -274,8 +274,8 @@ static struct clk_lookup clks[] = {
274 CLK(NULL, "clk_gpio", &clk_gpio), 274 CLK(NULL, "clk_gpio", &clk_gpio),
275 CLK(NULL, "clk_mdio", &clk_mdio), 275 CLK(NULL, "clk_mdio", &clk_mdio),
276 CLK("dm6441-mmc.0", NULL, &clk_sdio0), 276 CLK("dm6441-mmc.0", NULL, &clk_sdio0),
277 CLK(NULL, "uart0", &clk_uart0), 277 CLK("serial8250.0", NULL, &clk_uart0),
278 CLK(NULL, "uart1", &clk_uart1), 278 CLK("serial8250.1", NULL, &clk_uart1),
279 CLK(NULL, "timer0", &clk_timer0), 279 CLK(NULL, "timer0", &clk_timer0),
280 CLK(NULL, "timer1", &clk_timer1), 280 CLK(NULL, "timer1", &clk_timer1),
281 CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm), 281 CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm),
@@ -757,7 +757,7 @@ static struct davinci_soc_info tnetv107x_soc_info = {
757 .gpio_type = GPIO_TYPE_TNETV107X, 757 .gpio_type = GPIO_TYPE_TNETV107X,
758 .gpio_num = TNETV107X_N_GPIO, 758 .gpio_num = TNETV107X_N_GPIO,
759 .timer_info = &timer_info, 759 .timer_info = &timer_info,
760 .serial_dev = &tnetv107x_serial_device, 760 .serial_dev = tnetv107x_serial_device,
761}; 761};
762 762
763void __init tnetv107x_init(void) 763void __init tnetv107x_init(void)