Commit 19955c3d7453757271d05859958ca1804a5d2d67
Committed by
Sekhar Nori
1 parent
3b2f64d00c
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>
Showing 13 changed files with 243 additions and 84 deletions Side-by-side Diff
- arch/arm/mach-davinci/da830.c
- arch/arm/mach-davinci/da850.c
- arch/arm/mach-davinci/da8xx-dt.c
- arch/arm/mach-davinci/devices-da8xx.c
- arch/arm/mach-davinci/devices-tnetv107x.c
- arch/arm/mach-davinci/dm355.c
- arch/arm/mach-davinci/dm365.c
- arch/arm/mach-davinci/dm644x.c
- arch/arm/mach-davinci/dm646x.c
- arch/arm/mach-davinci/include/mach/da8xx.h
- arch/arm/mach-davinci/include/mach/tnetv107x.h
- arch/arm/mach-davinci/serial.c
- arch/arm/mach-davinci/tnetv107x.c
arch/arm/mach-davinci/da830.c
... | ... | @@ -395,9 +395,9 @@ |
395 | 395 | CLK(NULL, "tptc0", &tptc0_clk), |
396 | 396 | CLK(NULL, "tptc1", &tptc1_clk), |
397 | 397 | CLK("da830-mmc.0", NULL, &mmcsd_clk), |
398 | - CLK(NULL, "uart0", &uart0_clk), | |
399 | - CLK(NULL, "uart1", &uart1_clk), | |
400 | - CLK(NULL, "uart2", &uart2_clk), | |
398 | + CLK("serial8250.0", NULL, &uart0_clk), | |
399 | + CLK("serial8250.1", NULL, &uart1_clk), | |
400 | + CLK("serial8250.2", NULL, &uart2_clk), | |
401 | 401 | CLK("spi_davinci.0", NULL, &spi0_clk), |
402 | 402 | CLK("spi_davinci.1", NULL, &spi1_clk), |
403 | 403 | CLK(NULL, "ecap0", &ecap0_clk), |
... | ... | @@ -1199,7 +1199,7 @@ |
1199 | 1199 | .gpio_base = DA8XX_GPIO_BASE, |
1200 | 1200 | .gpio_num = 128, |
1201 | 1201 | .gpio_irq = IRQ_DA8XX_GPIO0, |
1202 | - .serial_dev = &da8xx_serial_device, | |
1202 | + .serial_dev = da8xx_serial_device, | |
1203 | 1203 | .emac_pdata = &da8xx_emac_pdata, |
1204 | 1204 | }; |
1205 | 1205 |
arch/arm/mach-davinci/da850.c
... | ... | @@ -451,9 +451,9 @@ |
451 | 451 | CLK(NULL, "tpcc1", &tpcc1_clk), |
452 | 452 | CLK(NULL, "tptc2", &tptc2_clk), |
453 | 453 | CLK("pruss_uio", "pruss", &pruss_clk), |
454 | - CLK(NULL, "uart0", &uart0_clk), | |
455 | - CLK(NULL, "uart1", &uart1_clk), | |
456 | - CLK(NULL, "uart2", &uart2_clk), | |
454 | + CLK("serial8250.0", NULL, &uart0_clk), | |
455 | + CLK("serial8250.1", NULL, &uart1_clk), | |
456 | + CLK("serial8250.2", NULL, &uart2_clk), | |
457 | 457 | CLK(NULL, "aintc", &aintc_clk), |
458 | 458 | CLK(NULL, "gpio", &gpio_clk), |
459 | 459 | CLK("i2c_davinci.2", NULL, &i2c1_clk), |
... | ... | @@ -1301,7 +1301,7 @@ |
1301 | 1301 | .gpio_base = DA8XX_GPIO_BASE, |
1302 | 1302 | .gpio_num = 144, |
1303 | 1303 | .gpio_irq = IRQ_DA8XX_GPIO0, |
1304 | - .serial_dev = &da8xx_serial_device, | |
1304 | + .serial_dev = da8xx_serial_device, | |
1305 | 1305 | .emac_pdata = &da8xx_emac_pdata, |
1306 | 1306 | .sram_dma = DA8XX_SHARED_RAM_BASE, |
1307 | 1307 | .sram_len = SZ_128K, |
arch/arm/mach-davinci/da8xx-dt.c
... | ... | @@ -47,6 +47,9 @@ |
47 | 47 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL), |
48 | 48 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL), |
49 | 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 |
arch/arm/mach-davinci/devices-da8xx.c
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | void __iomem *da8xx_syscfg0_base; |
69 | 69 | void __iomem *da8xx_syscfg1_base; |
70 | 70 | |
71 | -static struct plat_serial8250_port da8xx_serial_pdata[] = { | |
71 | +static struct plat_serial8250_port da8xx_serial0_pdata[] = { | |
72 | 72 | { |
73 | 73 | .mapbase = DA8XX_UART0_BASE, |
74 | 74 | .irq = IRQ_DA8XX_UARTINT0, |
... | ... | @@ -78,6 +78,11 @@ |
78 | 78 | .regshift = 2, |
79 | 79 | }, |
80 | 80 | { |
81 | + .flags = 0, | |
82 | + } | |
83 | +}; | |
84 | +static struct plat_serial8250_port da8xx_serial1_pdata[] = { | |
85 | + { | |
81 | 86 | .mapbase = DA8XX_UART1_BASE, |
82 | 87 | .irq = IRQ_DA8XX_UARTINT1, |
83 | 88 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
... | ... | @@ -86,6 +91,11 @@ |
86 | 91 | .regshift = 2, |
87 | 92 | }, |
88 | 93 | { |
94 | + .flags = 0, | |
95 | + } | |
96 | +}; | |
97 | +static struct plat_serial8250_port da8xx_serial2_pdata[] = { | |
98 | + { | |
89 | 99 | .mapbase = DA8XX_UART2_BASE, |
90 | 100 | .irq = IRQ_DA8XX_UARTINT2, |
91 | 101 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
92 | 102 | |
93 | 103 | |
... | ... | @@ -95,15 +105,33 @@ |
95 | 105 | }, |
96 | 106 | { |
97 | 107 | .flags = 0, |
98 | - }, | |
108 | + } | |
99 | 109 | }; |
100 | 110 | |
101 | -struct platform_device da8xx_serial_device = { | |
102 | - .name = "serial8250", | |
103 | - .id = PLAT8250_DEV_PLATFORM, | |
104 | - .dev = { | |
105 | - .platform_data = da8xx_serial_pdata, | |
111 | +struct platform_device da8xx_serial_device[] = { | |
112 | + { | |
113 | + .name = "serial8250", | |
114 | + .id = PLAT8250_DEV_PLATFORM, | |
115 | + .dev = { | |
116 | + .platform_data = da8xx_serial0_pdata, | |
117 | + } | |
106 | 118 | }, |
119 | + { | |
120 | + .name = "serial8250", | |
121 | + .id = PLAT8250_DEV_PLATFORM1, | |
122 | + .dev = { | |
123 | + .platform_data = da8xx_serial1_pdata, | |
124 | + } | |
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 | |
109 | 137 | static s8 da8xx_queue_tc_mapping[][2] = { |
arch/arm/mach-davinci/devices-tnetv107x.c
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 | .dev.platform_data = tnetv107x_edma_info, |
127 | 127 | }; |
128 | 128 | |
129 | -static struct plat_serial8250_port serial_data[] = { | |
129 | +static struct plat_serial8250_port serial0_platform_data[] = { | |
130 | 130 | { |
131 | 131 | .mapbase = TNETV107X_UART0_BASE, |
132 | 132 | .irq = IRQ_TNETV107X_UART0, |
... | ... | @@ -137,6 +137,11 @@ |
137 | 137 | .regshift = 2, |
138 | 138 | }, |
139 | 139 | { |
140 | + .flags = 0, | |
141 | + } | |
142 | +}; | |
143 | +static struct plat_serial8250_port serial1_platform_data[] = { | |
144 | + { | |
140 | 145 | .mapbase = TNETV107X_UART1_BASE, |
141 | 146 | .irq = IRQ_TNETV107X_UART1, |
142 | 147 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
... | ... | @@ -146,6 +151,11 @@ |
146 | 151 | .regshift = 2, |
147 | 152 | }, |
148 | 153 | { |
154 | + .flags = 0, | |
155 | + } | |
156 | +}; | |
157 | +static struct plat_serial8250_port serial2_platform_data[] = { | |
158 | + { | |
149 | 159 | .mapbase = TNETV107X_UART2_BASE, |
150 | 160 | .irq = IRQ_TNETV107X_UART2, |
151 | 161 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
152 | 162 | |
... | ... | @@ -156,13 +166,28 @@ |
156 | 166 | }, |
157 | 167 | { |
158 | 168 | .flags = 0, |
159 | - }, | |
169 | + } | |
160 | 170 | }; |
161 | 171 | |
162 | -struct platform_device tnetv107x_serial_device = { | |
163 | - .name = "serial8250", | |
164 | - .id = PLAT8250_DEV_PLATFORM, | |
165 | - .dev.platform_data = serial_data, | |
172 | + | |
173 | +struct platform_device tnetv107x_serial_device[] = { | |
174 | + { | |
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 | |
168 | 193 | static struct resource mmc0_resources[] = { |
arch/arm/mach-davinci/dm355.c
... | ... | @@ -357,9 +357,9 @@ |
357 | 357 | CLK(NULL, "clkout3", &clkout3_clk), |
358 | 358 | CLK(NULL, "arm", &arm_clk), |
359 | 359 | CLK(NULL, "mjcp", &mjcp_clk), |
360 | - CLK(NULL, "uart0", &uart0_clk), | |
361 | - CLK(NULL, "uart1", &uart1_clk), | |
362 | - CLK(NULL, "uart2", &uart2_clk), | |
360 | + CLK("serial8250.0", NULL, &uart0_clk), | |
361 | + CLK("serial8250.1", NULL, &uart1_clk), | |
362 | + CLK("serial8250.2", NULL, &uart2_clk), | |
363 | 363 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
364 | 364 | CLK("davinci-mcbsp.0", NULL, &asp0_clk), |
365 | 365 | CLK("davinci-mcbsp.1", NULL, &asp1_clk), |
... | ... | @@ -922,7 +922,7 @@ |
922 | 922 | .clocksource_id = T0_TOP, |
923 | 923 | }; |
924 | 924 | |
925 | -static struct plat_serial8250_port dm355_serial_platform_data[] = { | |
925 | +static struct plat_serial8250_port dm355_serial0_platform_data[] = { | |
926 | 926 | { |
927 | 927 | .mapbase = DAVINCI_UART0_BASE, |
928 | 928 | .irq = IRQ_UARTINT0, |
... | ... | @@ -932,6 +932,11 @@ |
932 | 932 | .regshift = 2, |
933 | 933 | }, |
934 | 934 | { |
935 | + .flags = 0, | |
936 | + } | |
937 | +}; | |
938 | +static struct plat_serial8250_port dm355_serial1_platform_data[] = { | |
939 | + { | |
935 | 940 | .mapbase = DAVINCI_UART1_BASE, |
936 | 941 | .irq = IRQ_UARTINT1, |
937 | 942 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
... | ... | @@ -940,6 +945,11 @@ |
940 | 945 | .regshift = 2, |
941 | 946 | }, |
942 | 947 | { |
948 | + .flags = 0, | |
949 | + } | |
950 | +}; | |
951 | +static struct plat_serial8250_port dm355_serial2_platform_data[] = { | |
952 | + { | |
943 | 953 | .mapbase = DM355_UART2_BASE, |
944 | 954 | .irq = IRQ_DM355_UARTINT2, |
945 | 955 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
946 | 956 | |
947 | 957 | |
... | ... | @@ -948,16 +958,34 @@ |
948 | 958 | .regshift = 2, |
949 | 959 | }, |
950 | 960 | { |
951 | - .flags = 0 | |
952 | - }, | |
961 | + .flags = 0, | |
962 | + } | |
953 | 963 | }; |
954 | 964 | |
955 | -static struct platform_device dm355_serial_device = { | |
956 | - .name = "serial8250", | |
957 | - .id = PLAT8250_DEV_PLATFORM, | |
958 | - .dev = { | |
959 | - .platform_data = dm355_serial_platform_data, | |
965 | +static struct platform_device dm355_serial_device[] = { | |
966 | + { | |
967 | + .name = "serial8250", | |
968 | + .id = PLAT8250_DEV_PLATFORM, | |
969 | + .dev = { | |
970 | + .platform_data = dm355_serial0_platform_data, | |
971 | + } | |
960 | 972 | }, |
973 | + { | |
974 | + .name = "serial8250", | |
975 | + .id = PLAT8250_DEV_PLATFORM1, | |
976 | + .dev = { | |
977 | + .platform_data = dm355_serial1_platform_data, | |
978 | + } | |
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 | |
963 | 991 | static struct davinci_soc_info davinci_soc_info_dm355 = { |
... | ... | @@ -981,7 +1009,7 @@ |
981 | 1009 | .gpio_base = DAVINCI_GPIO_BASE, |
982 | 1010 | .gpio_num = 104, |
983 | 1011 | .gpio_irq = IRQ_DM355_GPIOBNK0, |
984 | - .serial_dev = &dm355_serial_device, | |
1012 | + .serial_dev = dm355_serial_device, | |
985 | 1013 | .sram_dma = 0x00010000, |
986 | 1014 | .sram_len = SZ_32K, |
987 | 1015 | }; |
arch/arm/mach-davinci/dm365.c
... | ... | @@ -455,8 +455,8 @@ |
455 | 455 | CLK("vpss", "master", &vpss_master_clk), |
456 | 456 | CLK("vpss", "slave", &vpss_slave_clk), |
457 | 457 | CLK(NULL, "arm", &arm_clk), |
458 | - CLK(NULL, "uart0", &uart0_clk), | |
459 | - CLK(NULL, "uart1", &uart1_clk), | |
458 | + CLK("serial8250.0", NULL, &uart0_clk), | |
459 | + CLK("serial8250.1", NULL, &uart1_clk), | |
460 | 460 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
461 | 461 | CLK("da830-mmc.0", NULL, &mmcsd0_clk), |
462 | 462 | CLK("da830-mmc.1", NULL, &mmcsd1_clk), |
... | ... | @@ -1041,7 +1041,7 @@ |
1041 | 1041 | |
1042 | 1042 | #define DM365_UART1_BASE (IO_PHYS + 0x106000) |
1043 | 1043 | |
1044 | -static struct plat_serial8250_port dm365_serial_platform_data[] = { | |
1044 | +static struct plat_serial8250_port dm365_serial0_platform_data[] = { | |
1045 | 1045 | { |
1046 | 1046 | .mapbase = DAVINCI_UART0_BASE, |
1047 | 1047 | .irq = IRQ_UARTINT0, |
... | ... | @@ -1051,6 +1051,11 @@ |
1051 | 1051 | .regshift = 2, |
1052 | 1052 | }, |
1053 | 1053 | { |
1054 | + .flags = 0, | |
1055 | + } | |
1056 | +}; | |
1057 | +static struct plat_serial8250_port dm365_serial1_platform_data[] = { | |
1058 | + { | |
1054 | 1059 | .mapbase = DM365_UART1_BASE, |
1055 | 1060 | .irq = IRQ_UARTINT1, |
1056 | 1061 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
1057 | 1062 | |
1058 | 1063 | |
... | ... | @@ -1059,16 +1064,27 @@ |
1059 | 1064 | .regshift = 2, |
1060 | 1065 | }, |
1061 | 1066 | { |
1062 | - .flags = 0 | |
1063 | - }, | |
1067 | + .flags = 0, | |
1068 | + } | |
1064 | 1069 | }; |
1065 | 1070 | |
1066 | -static struct platform_device dm365_serial_device = { | |
1067 | - .name = "serial8250", | |
1068 | - .id = PLAT8250_DEV_PLATFORM, | |
1069 | - .dev = { | |
1070 | - .platform_data = dm365_serial_platform_data, | |
1071 | +static struct platform_device dm365_serial_device[] = { | |
1072 | + { | |
1073 | + .name = "serial8250", | |
1074 | + .id = PLAT8250_DEV_PLATFORM, | |
1075 | + .dev = { | |
1076 | + .platform_data = dm365_serial0_platform_data, | |
1077 | + } | |
1071 | 1078 | }, |
1079 | + { | |
1080 | + .name = "serial8250", | |
1081 | + .id = PLAT8250_DEV_PLATFORM1, | |
1082 | + .dev = { | |
1083 | + .platform_data = dm365_serial1_platform_data, | |
1084 | + } | |
1085 | + }, | |
1086 | + { | |
1087 | + } | |
1072 | 1088 | }; |
1073 | 1089 | |
1074 | 1090 | static struct davinci_soc_info davinci_soc_info_dm365 = { |
... | ... | @@ -1093,7 +1109,7 @@ |
1093 | 1109 | .gpio_num = 104, |
1094 | 1110 | .gpio_irq = IRQ_DM365_GPIO0, |
1095 | 1111 | .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */ |
1096 | - .serial_dev = &dm365_serial_device, | |
1112 | + .serial_dev = dm365_serial_device, | |
1097 | 1113 | .emac_pdata = &dm365_emac_pdata, |
1098 | 1114 | .sram_dma = 0x00010000, |
1099 | 1115 | .sram_len = SZ_32K, |
arch/arm/mach-davinci/dm644x.c
... | ... | @@ -303,9 +303,9 @@ |
303 | 303 | CLK("vpss", "master", &vpss_master_clk), |
304 | 304 | CLK("vpss", "slave", &vpss_slave_clk), |
305 | 305 | CLK(NULL, "arm", &arm_clk), |
306 | - CLK(NULL, "uart0", &uart0_clk), | |
307 | - CLK(NULL, "uart1", &uart1_clk), | |
308 | - CLK(NULL, "uart2", &uart2_clk), | |
306 | + CLK("serial8250.0", NULL, &uart0_clk), | |
307 | + CLK("serial8250.1", NULL, &uart1_clk), | |
308 | + CLK("serial8250.2", NULL, &uart2_clk), | |
309 | 309 | CLK("davinci_emac.1", NULL, &emac_clk), |
310 | 310 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
311 | 311 | CLK("palm_bk3710", NULL, &ide_clk), |
... | ... | @@ -813,7 +813,7 @@ |
813 | 813 | .clocksource_id = T0_TOP, |
814 | 814 | }; |
815 | 815 | |
816 | -static struct plat_serial8250_port dm644x_serial_platform_data[] = { | |
816 | +static struct plat_serial8250_port dm644x_serial0_platform_data[] = { | |
817 | 817 | { |
818 | 818 | .mapbase = DAVINCI_UART0_BASE, |
819 | 819 | .irq = IRQ_UARTINT0, |
... | ... | @@ -823,6 +823,11 @@ |
823 | 823 | .regshift = 2, |
824 | 824 | }, |
825 | 825 | { |
826 | + .flags = 0, | |
827 | + } | |
828 | +}; | |
829 | +static struct plat_serial8250_port dm644x_serial1_platform_data[] = { | |
830 | + { | |
826 | 831 | .mapbase = DAVINCI_UART1_BASE, |
827 | 832 | .irq = IRQ_UARTINT1, |
828 | 833 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
... | ... | @@ -831,6 +836,11 @@ |
831 | 836 | .regshift = 2, |
832 | 837 | }, |
833 | 838 | { |
839 | + .flags = 0, | |
840 | + } | |
841 | +}; | |
842 | +static struct plat_serial8250_port dm644x_serial2_platform_data[] = { | |
843 | + { | |
834 | 844 | .mapbase = DAVINCI_UART2_BASE, |
835 | 845 | .irq = IRQ_UARTINT2, |
836 | 846 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
837 | 847 | |
838 | 848 | |
... | ... | @@ -839,16 +849,34 @@ |
839 | 849 | .regshift = 2, |
840 | 850 | }, |
841 | 851 | { |
842 | - .flags = 0 | |
843 | - }, | |
852 | + .flags = 0, | |
853 | + } | |
844 | 854 | }; |
845 | 855 | |
846 | -static struct platform_device dm644x_serial_device = { | |
847 | - .name = "serial8250", | |
848 | - .id = PLAT8250_DEV_PLATFORM, | |
849 | - .dev = { | |
850 | - .platform_data = dm644x_serial_platform_data, | |
856 | +static struct platform_device dm644x_serial_device[] = { | |
857 | + { | |
858 | + .name = "serial8250", | |
859 | + .id = PLAT8250_DEV_PLATFORM, | |
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 | |
854 | 882 | static struct davinci_soc_info davinci_soc_info_dm644x = { |
... | ... | @@ -872,7 +900,7 @@ |
872 | 900 | .gpio_base = DAVINCI_GPIO_BASE, |
873 | 901 | .gpio_num = 71, |
874 | 902 | .gpio_irq = IRQ_GPIOBNK0, |
875 | - .serial_dev = &dm644x_serial_device, | |
903 | + .serial_dev = dm644x_serial_device, | |
876 | 904 | .emac_pdata = &dm644x_emac_pdata, |
877 | 905 | .sram_dma = 0x00008000, |
878 | 906 | .sram_len = SZ_16K, |
arch/arm/mach-davinci/dm646x.c
... | ... | @@ -342,9 +342,9 @@ |
342 | 342 | CLK(NULL, "edma_tc1", &edma_tc1_clk), |
343 | 343 | CLK(NULL, "edma_tc2", &edma_tc2_clk), |
344 | 344 | CLK(NULL, "edma_tc3", &edma_tc3_clk), |
345 | - CLK(NULL, "uart0", &uart0_clk), | |
346 | - CLK(NULL, "uart1", &uart1_clk), | |
347 | - CLK(NULL, "uart2", &uart2_clk), | |
345 | + CLK("serial8250.0", NULL, &uart0_clk), | |
346 | + CLK("serial8250.1", NULL, &uart1_clk), | |
347 | + CLK("serial8250.2", NULL, &uart2_clk), | |
348 | 348 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
349 | 349 | CLK(NULL, "gpio", &gpio_clk), |
350 | 350 | CLK("davinci-mcasp.0", NULL, &mcasp0_clk), |
... | ... | @@ -790,7 +790,7 @@ |
790 | 790 | .clocksource_id = T0_TOP, |
791 | 791 | }; |
792 | 792 | |
793 | -static struct plat_serial8250_port dm646x_serial_platform_data[] = { | |
793 | +static struct plat_serial8250_port dm646x_serial0_platform_data[] = { | |
794 | 794 | { |
795 | 795 | .mapbase = DAVINCI_UART0_BASE, |
796 | 796 | .irq = IRQ_UARTINT0, |
... | ... | @@ -800,6 +800,11 @@ |
800 | 800 | .regshift = 2, |
801 | 801 | }, |
802 | 802 | { |
803 | + .flags = 0, | |
804 | + } | |
805 | +}; | |
806 | +static struct plat_serial8250_port dm646x_serial1_platform_data[] = { | |
807 | + { | |
803 | 808 | .mapbase = DAVINCI_UART1_BASE, |
804 | 809 | .irq = IRQ_UARTINT1, |
805 | 810 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
... | ... | @@ -808,6 +813,11 @@ |
808 | 813 | .regshift = 2, |
809 | 814 | }, |
810 | 815 | { |
816 | + .flags = 0, | |
817 | + } | |
818 | +}; | |
819 | +static struct plat_serial8250_port dm646x_serial2_platform_data[] = { | |
820 | + { | |
811 | 821 | .mapbase = DAVINCI_UART2_BASE, |
812 | 822 | .irq = IRQ_DM646X_UARTINT2, |
813 | 823 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
814 | 824 | |
815 | 825 | |
... | ... | @@ -816,16 +826,34 @@ |
816 | 826 | .regshift = 2, |
817 | 827 | }, |
818 | 828 | { |
819 | - .flags = 0 | |
820 | - }, | |
829 | + .flags = 0, | |
830 | + } | |
821 | 831 | }; |
822 | 832 | |
823 | -static struct platform_device dm646x_serial_device = { | |
824 | - .name = "serial8250", | |
825 | - .id = PLAT8250_DEV_PLATFORM, | |
826 | - .dev = { | |
827 | - .platform_data = dm646x_serial_platform_data, | |
833 | +static struct platform_device dm646x_serial_device[] = { | |
834 | + { | |
835 | + .name = "serial8250", | |
836 | + .id = PLAT8250_DEV_PLATFORM, | |
837 | + .dev = { | |
838 | + .platform_data = dm646x_serial0_platform_data, | |
839 | + } | |
828 | 840 | }, |
841 | + { | |
842 | + .name = "serial8250", | |
843 | + .id = PLAT8250_DEV_PLATFORM1, | |
844 | + .dev = { | |
845 | + .platform_data = dm646x_serial1_platform_data, | |
846 | + } | |
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 | |
831 | 859 | static struct davinci_soc_info davinci_soc_info_dm646x = { |
... | ... | @@ -849,7 +877,7 @@ |
849 | 877 | .gpio_base = DAVINCI_GPIO_BASE, |
850 | 878 | .gpio_num = 43, /* Only 33 usable */ |
851 | 879 | .gpio_irq = IRQ_DM646X_GPIOBNK0, |
852 | - .serial_dev = &dm646x_serial_device, | |
880 | + .serial_dev = dm646x_serial_device, | |
853 | 881 | .emac_pdata = &dm646x_emac_pdata, |
854 | 882 | .sram_dma = 0x10010000, |
855 | 883 | .sram_len = SZ_32K, |
arch/arm/mach-davinci/include/mach/da8xx.h
... | ... | @@ -111,7 +111,7 @@ |
111 | 111 | void da8xx_rproc_reserve_cma(void); |
112 | 112 | int da8xx_register_rproc(void); |
113 | 113 | |
114 | -extern struct platform_device da8xx_serial_device; | |
114 | +extern struct platform_device da8xx_serial_device[]; | |
115 | 115 | extern struct emac_platform_data da8xx_emac_pdata; |
116 | 116 | extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; |
117 | 117 | extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; |
arch/arm/mach-davinci/include/mach/tnetv107x.h
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | }; |
51 | 51 | |
52 | 52 | extern struct platform_device tnetv107x_wdt_device; |
53 | -extern struct platform_device tnetv107x_serial_device; | |
53 | +extern struct platform_device tnetv107x_serial_device[]; | |
54 | 54 | |
55 | 55 | extern void tnetv107x_init(void); |
56 | 56 | extern void tnetv107x_devices_init(struct tnetv107x_device_info *); |
arch/arm/mach-davinci/serial.c
... | ... | @@ -73,13 +73,11 @@ |
73 | 73 | /* Enable UART clock and obtain its rate */ |
74 | 74 | int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate) |
75 | 75 | { |
76 | - char name[16]; | |
77 | 76 | struct clk *clk; |
78 | 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); | |
82 | - clk = clk_get(dev, name); | |
80 | + clk = clk_get(dev, NULL); | |
83 | 81 | if (IS_ERR(clk)) { |
84 | 82 | pr_err("%s:%d: failed to get UART%d clock\n", |
85 | 83 | __func__, __LINE__, instance); |
86 | 84 | |
87 | 85 | |
88 | 86 | |
... | ... | @@ -96,19 +94,25 @@ |
96 | 94 | |
97 | 95 | int __init davinci_serial_init(struct davinci_uart_config *info) |
98 | 96 | { |
99 | - int i, ret; | |
97 | + int i, ret = 0; | |
100 | 98 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
101 | - struct device *dev = &soc_info->serial_dev->dev; | |
102 | - struct plat_serial8250_port *p = dev->platform_data; | |
99 | + struct device *dev; | |
100 | + struct plat_serial8250_port *p; | |
103 | 101 | |
104 | 102 | /* |
105 | 103 | * Make sure the serial ports are muxed on at this point. |
106 | 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 | 109 | if (!(info->enabled_uarts & (1 << i))) |
110 | 110 | continue; |
111 | 111 | |
112 | + ret = platform_device_register(&soc_info->serial_dev[i]); | |
113 | + if (ret) | |
114 | + continue; | |
115 | + | |
112 | 116 | ret = davinci_serial_setup_clk(i, &p->uartclk); |
113 | 117 | if (ret) |
114 | 118 | continue; |
... | ... | @@ -125,7 +129,6 @@ |
125 | 129 | if (p->membase && p->type != PORT_AR7) |
126 | 130 | davinci_serial_reset(p); |
127 | 131 | } |
128 | - | |
129 | - return platform_device_register(soc_info->serial_dev); | |
132 | + return ret; | |
130 | 133 | } |
arch/arm/mach-davinci/tnetv107x.c
... | ... | @@ -264,7 +264,7 @@ |
264 | 264 | CLK(NULL, "clk_chipcfg", &clk_chipcfg), |
265 | 265 | CLK("tnetv107x-ts.0", NULL, &clk_tsc), |
266 | 266 | CLK(NULL, "clk_rom", &clk_rom), |
267 | - CLK(NULL, "uart2", &clk_uart2), | |
267 | + CLK("serial8250.2", NULL, &clk_uart2), | |
268 | 268 | CLK(NULL, "clk_pktsec", &clk_pktsec), |
269 | 269 | CLK("tnetv107x-rng.0", NULL, &clk_rng), |
270 | 270 | CLK("tnetv107x-pka.0", NULL, &clk_pka), |
... | ... | @@ -274,8 +274,8 @@ |
274 | 274 | CLK(NULL, "clk_gpio", &clk_gpio), |
275 | 275 | CLK(NULL, "clk_mdio", &clk_mdio), |
276 | 276 | CLK("dm6441-mmc.0", NULL, &clk_sdio0), |
277 | - CLK(NULL, "uart0", &clk_uart0), | |
278 | - CLK(NULL, "uart1", &clk_uart1), | |
277 | + CLK("serial8250.0", NULL, &clk_uart0), | |
278 | + CLK("serial8250.1", NULL, &clk_uart1), | |
279 | 279 | CLK(NULL, "timer0", &clk_timer0), |
280 | 280 | CLK(NULL, "timer1", &clk_timer1), |
281 | 281 | CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm), |
... | ... | @@ -757,7 +757,7 @@ |
757 | 757 | .gpio_type = GPIO_TYPE_TNETV107X, |
758 | 758 | .gpio_num = TNETV107X_N_GPIO, |
759 | 759 | .timer_info = &timer_info, |
760 | - .serial_dev = &tnetv107x_serial_device, | |
760 | + .serial_dev = tnetv107x_serial_device, | |
761 | 761 | }; |
762 | 762 | |
763 | 763 | void __init tnetv107x_init(void) |