diff options
Diffstat (limited to 'arch/arm/mach-davinci')
27 files changed, 275 insertions, 201 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 1332de8c52c9..c4bdc0a1c36e 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -185,10 +185,6 @@ static __init void da830_evm_usb_init(void) | |||
185 | __func__, ret); | 185 | __func__, ret); |
186 | } | 186 | } |
187 | 187 | ||
188 | static struct davinci_uart_config da830_evm_uart_config __initdata = { | ||
189 | .enabled_uarts = 0x7, | ||
190 | }; | ||
191 | |||
192 | static const short da830_evm_mcasp1_pins[] = { | 188 | static const short da830_evm_mcasp1_pins[] = { |
193 | DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1, DA830_AHCLKR1, DA830_AFSR1, | 189 | DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1, DA830_AHCLKR1, DA830_AFSR1, |
194 | DA830_AMUTE1, DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_5, | 190 | DA830_AMUTE1, DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_5, |
@@ -630,7 +626,7 @@ static __init void da830_evm_init(void) | |||
630 | pr_warning("da830_evm_init: watchdog registration failed: %d\n", | 626 | pr_warning("da830_evm_init: watchdog registration failed: %d\n", |
631 | ret); | 627 | ret); |
632 | 628 | ||
633 | davinci_serial_init(&da830_evm_uart_config); | 629 | davinci_serial_init(da8xx_serial_device); |
634 | i2c_register_board_info(1, da830_evm_i2c_devices, | 630 | i2c_register_board_info(1, da830_evm_i2c_devices, |
635 | ARRAY_SIZE(da830_evm_i2c_devices)); | 631 | ARRAY_SIZE(da830_evm_i2c_devices)); |
636 | 632 | ||
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index f5c228190fdd..dd1fb24521aa 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -746,10 +746,6 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { | |||
746 | .bus_delay = 0, /* usec */ | 746 | .bus_delay = 0, /* usec */ |
747 | }; | 747 | }; |
748 | 748 | ||
749 | static struct davinci_uart_config da850_evm_uart_config __initdata = { | ||
750 | .enabled_uarts = 0x7, | ||
751 | }; | ||
752 | |||
753 | /* davinci da850 evm audio machine driver */ | 749 | /* davinci da850 evm audio machine driver */ |
754 | static u8 da850_iis_serializer_direction[] = { | 750 | static u8 da850_iis_serializer_direction[] = { |
755 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, | 751 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, |
@@ -1492,7 +1488,7 @@ static __init void da850_evm_init(void) | |||
1492 | __func__, ret); | 1488 | __func__, ret); |
1493 | } | 1489 | } |
1494 | 1490 | ||
1495 | davinci_serial_init(&da850_evm_uart_config); | 1491 | davinci_serial_init(da8xx_serial_device); |
1496 | 1492 | ||
1497 | i2c_register_board_info(1, da850_evm_i2c_devices, | 1493 | i2c_register_board_info(1, da850_evm_i2c_devices, |
1498 | ARRAY_SIZE(da850_evm_i2c_devices)); | 1494 | ARRAY_SIZE(da850_evm_i2c_devices)); |
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index c2a0a67d09e0..42b23a3194a0 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c | |||
@@ -314,10 +314,6 @@ static struct platform_device *davinci_evm_devices[] __initdata = { | |||
314 | &davinci_nand_device, | 314 | &davinci_nand_device, |
315 | }; | 315 | }; |
316 | 316 | ||
317 | static struct davinci_uart_config uart_config __initdata = { | ||
318 | .enabled_uarts = (1 << 0), | ||
319 | }; | ||
320 | |||
321 | static void __init dm355_evm_map_io(void) | 317 | static void __init dm355_evm_map_io(void) |
322 | { | 318 | { |
323 | dm355_init(); | 319 | dm355_init(); |
@@ -393,7 +389,7 @@ static __init void dm355_evm_init(void) | |||
393 | platform_add_devices(davinci_evm_devices, | 389 | platform_add_devices(davinci_evm_devices, |
394 | ARRAY_SIZE(davinci_evm_devices)); | 390 | ARRAY_SIZE(davinci_evm_devices)); |
395 | evm_init_i2c(); | 391 | evm_init_i2c(); |
396 | davinci_serial_init(&uart_config); | 392 | davinci_serial_init(dm355_serial_device); |
397 | 393 | ||
398 | /* NOTE: NAND flash timings set by the UBL are slower than | 394 | /* NOTE: NAND flash timings set by the UBL are slower than |
399 | * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204 | 395 | * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204 |
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c index 139e42da25f0..65a984c52df6 100644 --- a/arch/arm/mach-davinci/board-dm355-leopard.c +++ b/arch/arm/mach-davinci/board-dm355-leopard.c | |||
@@ -173,10 +173,6 @@ static struct platform_device *davinci_leopard_devices[] __initdata = { | |||
173 | &davinci_nand_device, | 173 | &davinci_nand_device, |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static struct davinci_uart_config uart_config __initdata = { | ||
177 | .enabled_uarts = (1 << 0), | ||
178 | }; | ||
179 | |||
180 | static void __init dm355_leopard_map_io(void) | 176 | static void __init dm355_leopard_map_io(void) |
181 | { | 177 | { |
182 | dm355_init(); | 178 | dm355_init(); |
@@ -252,7 +248,7 @@ static __init void dm355_leopard_init(void) | |||
252 | platform_add_devices(davinci_leopard_devices, | 248 | platform_add_devices(davinci_leopard_devices, |
253 | ARRAY_SIZE(davinci_leopard_devices)); | 249 | ARRAY_SIZE(davinci_leopard_devices)); |
254 | leopard_init_i2c(); | 250 | leopard_init_i2c(); |
255 | davinci_serial_init(&uart_config); | 251 | davinci_serial_init(dm355_serial_device); |
256 | 252 | ||
257 | /* NOTE: NAND flash timings set by the UBL are slower than | 253 | /* NOTE: NAND flash timings set by the UBL are slower than |
258 | * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204 | 254 | * needed by MT29F16G08FAA chips ... EMIF.A1CR is 0x40400204 |
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 4cdb61c54459..92b7f770615a 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -718,10 +718,6 @@ fail: | |||
718 | /* REVISIT export switches: NTSC/PAL (SW5.6), EXTRA1 (SW5.2), etc */ | 718 | /* REVISIT export switches: NTSC/PAL (SW5.6), EXTRA1 (SW5.2), etc */ |
719 | } | 719 | } |
720 | 720 | ||
721 | static struct davinci_uart_config uart_config __initdata = { | ||
722 | .enabled_uarts = (1 << 0), | ||
723 | }; | ||
724 | |||
725 | static void __init dm365_evm_map_io(void) | 721 | static void __init dm365_evm_map_io(void) |
726 | { | 722 | { |
727 | dm365_init(); | 723 | dm365_init(); |
@@ -748,7 +744,7 @@ static struct spi_board_info dm365_evm_spi_info[] __initconst = { | |||
748 | static __init void dm365_evm_init(void) | 744 | static __init void dm365_evm_init(void) |
749 | { | 745 | { |
750 | evm_init_i2c(); | 746 | evm_init_i2c(); |
751 | davinci_serial_init(&uart_config); | 747 | davinci_serial_init(dm365_serial_device); |
752 | 748 | ||
753 | dm365evm_emac_configure(); | 749 | dm365evm_emac_configure(); |
754 | dm365evm_mmc_configure(); | 750 | dm365evm_mmc_configure(); |
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index fa4bfaf952d8..40bb9b5b87e8 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c | |||
@@ -727,10 +727,6 @@ static struct platform_device *davinci_evm_devices[] __initdata = { | |||
727 | &rtc_dev, | 727 | &rtc_dev, |
728 | }; | 728 | }; |
729 | 729 | ||
730 | static struct davinci_uart_config uart_config __initdata = { | ||
731 | .enabled_uarts = (1 << 0), | ||
732 | }; | ||
733 | |||
734 | static void __init | 730 | static void __init |
735 | davinci_evm_map_io(void) | 731 | davinci_evm_map_io(void) |
736 | { | 732 | { |
@@ -792,7 +788,7 @@ static __init void davinci_evm_init(void) | |||
792 | davinci_setup_mmc(0, &dm6446evm_mmc_config); | 788 | davinci_setup_mmc(0, &dm6446evm_mmc_config); |
793 | dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg); | 789 | dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg); |
794 | 790 | ||
795 | davinci_serial_init(&uart_config); | 791 | davinci_serial_init(dm644x_serial_device); |
796 | dm644x_init_asp(&dm644x_evm_snd_data); | 792 | dm644x_init_asp(&dm644x_evm_snd_data); |
797 | 793 | ||
798 | /* irlml6401 switches over 1A, in under 8 msec */ | 794 | /* irlml6401 switches over 1A, in under 8 msec */ |
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 0c005e876cac..2bc3651d56cc 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c | |||
@@ -750,10 +750,6 @@ static void __init davinci_map_io(void) | |||
750 | cdce_clk_init(); | 750 | cdce_clk_init(); |
751 | } | 751 | } |
752 | 752 | ||
753 | static struct davinci_uart_config uart_config __initdata = { | ||
754 | .enabled_uarts = (1 << 0), | ||
755 | }; | ||
756 | |||
757 | #define DM646X_EVM_PHY_ID "davinci_mdio-0:01" | 753 | #define DM646X_EVM_PHY_ID "davinci_mdio-0:01" |
758 | /* | 754 | /* |
759 | * The following EDMA channels/slots are not being used by drivers (for | 755 | * The following EDMA channels/slots are not being used by drivers (for |
@@ -793,7 +789,7 @@ static __init void evm_init(void) | |||
793 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 789 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
794 | 790 | ||
795 | evm_init_i2c(); | 791 | evm_init_i2c(); |
796 | davinci_serial_init(&uart_config); | 792 | davinci_serial_init(dm646x_serial_device); |
797 | dm646x_init_mcasp0(&dm646x_evm_snd_data[0]); | 793 | dm646x_init_mcasp0(&dm646x_evm_snd_data[0]); |
798 | dm646x_init_mcasp1(&dm646x_evm_snd_data[1]); | 794 | dm646x_init_mcasp1(&dm646x_evm_snd_data[1]); |
799 | 795 | ||
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 9549d53aa63f..cd0f58730c2b 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c | |||
@@ -434,10 +434,6 @@ static void __init mityomapl138_setup_nand(void) | |||
434 | ARRAY_SIZE(mityomapl138_devices)); | 434 | ARRAY_SIZE(mityomapl138_devices)); |
435 | } | 435 | } |
436 | 436 | ||
437 | static struct davinci_uart_config mityomapl138_uart_config __initdata = { | ||
438 | .enabled_uarts = 0x7, | ||
439 | }; | ||
440 | |||
441 | static const short mityomap_mii_pins[] = { | 437 | static const short mityomap_mii_pins[] = { |
442 | DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3, | 438 | DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3, |
443 | DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER, | 439 | DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER, |
@@ -517,7 +513,7 @@ static void __init mityomapl138_init(void) | |||
517 | if (ret) | 513 | if (ret) |
518 | pr_warning("watchdog registration failed: %d\n", ret); | 514 | pr_warning("watchdog registration failed: %d\n", ret); |
519 | 515 | ||
520 | davinci_serial_init(&mityomapl138_uart_config); | 516 | davinci_serial_init(da8xx_serial_device); |
521 | 517 | ||
522 | ret = da8xx_register_i2c(0, &mityomap_i2c_0_pdata); | 518 | ret = da8xx_register_i2c(0, &mityomap_i2c_0_pdata); |
523 | if (ret) | 519 | if (ret) |
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index 808233b60e3d..46f336fca803 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c | |||
@@ -154,10 +154,6 @@ static struct platform_device *davinci_ntosd2_devices[] __initdata = { | |||
154 | &ntosd2_leds_dev, | 154 | &ntosd2_leds_dev, |
155 | }; | 155 | }; |
156 | 156 | ||
157 | static struct davinci_uart_config uart_config __initdata = { | ||
158 | .enabled_uarts = (1 << 0), | ||
159 | }; | ||
160 | |||
161 | static void __init davinci_ntosd2_map_io(void) | 157 | static void __init davinci_ntosd2_map_io(void) |
162 | { | 158 | { |
163 | dm644x_init(); | 159 | dm644x_init(); |
@@ -198,7 +194,7 @@ static __init void davinci_ntosd2_init(void) | |||
198 | platform_add_devices(davinci_ntosd2_devices, | 194 | platform_add_devices(davinci_ntosd2_devices, |
199 | ARRAY_SIZE(davinci_ntosd2_devices)); | 195 | ARRAY_SIZE(davinci_ntosd2_devices)); |
200 | 196 | ||
201 | davinci_serial_init(&uart_config); | 197 | davinci_serial_init(dm644x_serial_device); |
202 | dm644x_init_asp(&dm644x_ntosd2_snd_data); | 198 | dm644x_init_asp(&dm644x_ntosd2_snd_data); |
203 | 199 | ||
204 | soc_info->emac_pdata->phy_id = NEUROS_OSD2_PHY_ID; | 200 | soc_info->emac_pdata->phy_id = NEUROS_OSD2_PHY_ID; |
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index b8c20de10ca2..ab98c75cabb4 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c | |||
@@ -286,15 +286,11 @@ usb11_setup_oc_fail: | |||
286 | gpio_free(DA850_USB1_VBUS_PIN); | 286 | gpio_free(DA850_USB1_VBUS_PIN); |
287 | } | 287 | } |
288 | 288 | ||
289 | static struct davinci_uart_config omapl138_hawk_uart_config __initdata = { | ||
290 | .enabled_uarts = 0x7, | ||
291 | }; | ||
292 | |||
293 | static __init void omapl138_hawk_init(void) | 289 | static __init void omapl138_hawk_init(void) |
294 | { | 290 | { |
295 | int ret; | 291 | int ret; |
296 | 292 | ||
297 | davinci_serial_init(&omapl138_hawk_uart_config); | 293 | davinci_serial_init(da8xx_serial_device); |
298 | 294 | ||
299 | omapl138_hawk_config_emac(); | 295 | omapl138_hawk_config_emac(); |
300 | 296 | ||
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c index 513eee14f77d..d84360148100 100644 --- a/arch/arm/mach-davinci/board-sffsdr.c +++ b/arch/arm/mach-davinci/board-sffsdr.c | |||
@@ -125,10 +125,6 @@ static struct platform_device *davinci_sffsdr_devices[] __initdata = { | |||
125 | &davinci_sffsdr_nandflash_device, | 125 | &davinci_sffsdr_nandflash_device, |
126 | }; | 126 | }; |
127 | 127 | ||
128 | static struct davinci_uart_config uart_config __initdata = { | ||
129 | .enabled_uarts = (1 << 0), | ||
130 | }; | ||
131 | |||
132 | static void __init davinci_sffsdr_map_io(void) | 128 | static void __init davinci_sffsdr_map_io(void) |
133 | { | 129 | { |
134 | dm644x_init(); | 130 | dm644x_init(); |
@@ -141,7 +137,7 @@ static __init void davinci_sffsdr_init(void) | |||
141 | platform_add_devices(davinci_sffsdr_devices, | 137 | platform_add_devices(davinci_sffsdr_devices, |
142 | ARRAY_SIZE(davinci_sffsdr_devices)); | 138 | ARRAY_SIZE(davinci_sffsdr_devices)); |
143 | sffsdr_init_i2c(); | 139 | sffsdr_init_i2c(); |
144 | davinci_serial_init(&uart_config); | 140 | davinci_serial_init(dm644x_serial_device); |
145 | soc_info->emac_pdata->phy_id = SFFSDR_PHY_ID; | 141 | soc_info->emac_pdata->phy_id = SFFSDR_PHY_ID; |
146 | davinci_setup_usb(0, 0); /* We support only peripheral mode. */ | 142 | davinci_setup_usb(0, 0); /* We support only peripheral mode. */ |
147 | 143 | ||
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index abbaf0270be6..d6c746e35ad9 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), |
@@ -417,6 +417,7 @@ static struct clk_lookup da830_clks[] = { | |||
417 | CLK(NULL, "aintc", &aintc_clk), | 417 | CLK(NULL, "aintc", &aintc_clk), |
418 | CLK(NULL, "secu_mgr", &secu_mgr_clk), | 418 | CLK(NULL, "secu_mgr", &secu_mgr_clk), |
419 | CLK("davinci_emac.1", NULL, &emac_clk), | 419 | CLK("davinci_emac.1", NULL, &emac_clk), |
420 | CLK("davinci_mdio.0", "fck", &emac_clk), | ||
420 | CLK(NULL, "gpio", &gpio_clk), | 421 | CLK(NULL, "gpio", &gpio_clk), |
421 | CLK("i2c_davinci.2", NULL, &i2c1_clk), | 422 | CLK("i2c_davinci.2", NULL, &i2c1_clk), |
422 | CLK(NULL, "usb11", &usb11_clk), | 423 | CLK(NULL, "usb11", &usb11_clk), |
@@ -1199,7 +1200,6 @@ static struct davinci_soc_info davinci_soc_info_da830 = { | |||
1199 | .gpio_base = DA8XX_GPIO_BASE, | 1200 | .gpio_base = DA8XX_GPIO_BASE, |
1200 | .gpio_num = 128, | 1201 | .gpio_num = 128, |
1201 | .gpio_irq = IRQ_DA8XX_GPIO0, | 1202 | .gpio_irq = IRQ_DA8XX_GPIO0, |
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..f56e5fbfa2fd 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), |
@@ -461,6 +461,7 @@ static struct clk_lookup da850_clks[] = { | |||
461 | CLK(NULL, "arm", &arm_clk), | 461 | CLK(NULL, "arm", &arm_clk), |
462 | CLK(NULL, "rmii", &rmii_clk), | 462 | CLK(NULL, "rmii", &rmii_clk), |
463 | CLK("davinci_emac.1", NULL, &emac_clk), | 463 | CLK("davinci_emac.1", NULL, &emac_clk), |
464 | CLK("davinci_mdio.0", "fck", &emac_clk), | ||
464 | CLK("davinci-mcasp.0", NULL, &mcasp_clk), | 465 | CLK("davinci-mcasp.0", NULL, &mcasp_clk), |
465 | CLK("da8xx_lcdc.0", "fck", &lcdc_clk), | 466 | CLK("da8xx_lcdc.0", "fck", &lcdc_clk), |
466 | CLK("da830-mmc.0", NULL, &mmcsd0_clk), | 467 | CLK("da830-mmc.0", NULL, &mmcsd0_clk), |
@@ -1301,7 +1302,6 @@ static struct davinci_soc_info davinci_soc_info_da850 = { | |||
1301 | .gpio_base = DA8XX_GPIO_BASE, | 1302 | .gpio_base = DA8XX_GPIO_BASE, |
1302 | .gpio_num = 144, | 1303 | .gpio_num = 144, |
1303 | .gpio_irq = IRQ_DA8XX_GPIO0, | 1304 | .gpio_irq = IRQ_DA8XX_GPIO0, |
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..d2bc574ae172 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c | |||
@@ -20,13 +20,6 @@ | |||
20 | 20 | ||
21 | #define DA8XX_NUM_UARTS 3 | 21 | #define DA8XX_NUM_UARTS 3 |
22 | 22 | ||
23 | static void __init da8xx_uart_clk_enable(void) | ||
24 | { | ||
25 | int i; | ||
26 | for (i = 0; i < DA8XX_NUM_UARTS; i++) | ||
27 | davinci_serial_setup_clk(i, NULL); | ||
28 | } | ||
29 | |||
30 | static struct of_device_id da8xx_irq_match[] __initdata = { | 23 | static struct of_device_id da8xx_irq_match[] __initdata = { |
31 | { .compatible = "ti,cp-intc", .data = cp_intc_of_init, }, | 24 | { .compatible = "ti,cp-intc", .data = cp_intc_of_init, }, |
32 | { } | 25 | { } |
@@ -47,6 +40,12 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { | |||
47 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL), | 40 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL), |
48 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL), | 41 | OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL), |
49 | OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL), | 42 | OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL), |
43 | OF_DEV_AUXDATA("ns16550a", 0x01c42000, "serial8250.0", NULL), | ||
44 | OF_DEV_AUXDATA("ns16550a", 0x01d0c000, "serial8250.1", NULL), | ||
45 | OF_DEV_AUXDATA("ns16550a", 0x01d0d000, "serial8250.2", NULL), | ||
46 | OF_DEV_AUXDATA("ti,davinci_mdio", 0x01e24000, "davinci_mdio.0", NULL), | ||
47 | OF_DEV_AUXDATA("ti,davinci-dm6467-emac", 0x01e20000, "davinci_emac.1", | ||
48 | NULL), | ||
50 | {} | 49 | {} |
51 | }; | 50 | }; |
52 | 51 | ||
@@ -57,7 +56,6 @@ static void __init da850_init_machine(void) | |||
57 | of_platform_populate(NULL, of_default_bus_match_table, | 56 | of_platform_populate(NULL, of_default_bus_match_table, |
58 | da850_auxdata_lookup, NULL); | 57 | da850_auxdata_lookup, NULL); |
59 | 58 | ||
60 | da8xx_uart_clk_enable(); | ||
61 | } | 59 | } |
62 | 60 | ||
63 | static const char *da850_boards_compat[] __initdata = { | 61 | static const char *da850_boards_compat[] __initdata = { |
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h index a883043d0820..2ab5d577186f 100644 --- a/arch/arm/mach-davinci/davinci.h +++ b/arch/arm/mach-davinci/davinci.h | |||
@@ -106,4 +106,9 @@ int dm646x_init_edma(struct edma_rsv_info *rsv); | |||
106 | void dm646x_video_init(void); | 106 | void dm646x_video_init(void); |
107 | void dm646x_setup_vpif(struct vpif_display_config *, | 107 | void dm646x_setup_vpif(struct vpif_display_config *, |
108 | struct vpif_capture_config *); | 108 | struct vpif_capture_config *); |
109 | |||
110 | extern struct platform_device dm365_serial_device[]; | ||
111 | extern struct platform_device dm355_serial_device[]; | ||
112 | extern struct platform_device dm644x_serial_device[]; | ||
113 | extern struct platform_device dm646x_serial_device[]; | ||
109 | #endif /*__DAVINCI_H */ | 114 | #endif /*__DAVINCI_H */ |
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 71a46a348761..2e473fefd71e 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
@@ -68,7 +68,7 @@ | |||
68 | void __iomem *da8xx_syscfg0_base; | 68 | void __iomem *da8xx_syscfg0_base; |
69 | void __iomem *da8xx_syscfg1_base; | 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 | .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 | }; | ||
84 | static 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 | }; | ||
97 | static 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 | ||
101 | struct platform_device da8xx_serial_device = { | 111 | struct 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 | } | ||
125 | }, | ||
126 | { | ||
127 | .name = "serial8250", | ||
128 | .id = PLAT8250_DEV_PLATFORM2, | ||
129 | .dev = { | ||
130 | .platform_data = da8xx_serial2_pdata, | ||
131 | } | ||
106 | }, | 132 | }, |
133 | { | ||
134 | } | ||
107 | }; | 135 | }; |
108 | 136 | ||
109 | static s8 da8xx_queue_tc_mapping[][2] = { | 137 | static s8 da8xx_queue_tc_mapping[][2] = { |
@@ -453,12 +481,8 @@ int __init da8xx_register_emac(void) | |||
453 | ret = platform_device_register(&da8xx_mdio_device); | 481 | ret = platform_device_register(&da8xx_mdio_device); |
454 | if (ret < 0) | 482 | if (ret < 0) |
455 | return ret; | 483 | return ret; |
456 | ret = platform_device_register(&da8xx_emac_device); | 484 | |
457 | if (ret < 0) | 485 | return platform_device_register(&da8xx_emac_device); |
458 | return ret; | ||
459 | ret = clk_add_alias(NULL, dev_name(&da8xx_mdio_device.dev), | ||
460 | NULL, &da8xx_emac_device.dev); | ||
461 | return ret; | ||
462 | } | 486 | } |
463 | 487 | ||
464 | static struct resource da830_mcasp1_resources[] = { | 488 | static struct resource da830_mcasp1_resources[] = { |
@@ -828,14 +852,7 @@ static struct platform_device da8xx_rtc_device = { | |||
828 | 852 | ||
829 | int da8xx_register_rtc(void) | 853 | int da8xx_register_rtc(void) |
830 | { | 854 | { |
831 | int ret; | 855 | return platform_device_register(&da8xx_rtc_device); |
832 | |||
833 | ret = platform_device_register(&da8xx_rtc_device); | ||
834 | if (!ret) | ||
835 | /* Atleast on DA850, RTC is a wakeup source */ | ||
836 | device_init_wakeup(&da8xx_rtc_device.dev, true); | ||
837 | |||
838 | return ret; | ||
839 | } | 856 | } |
840 | 857 | ||
841 | static void __iomem *da8xx_ddr2_ctlr_base; | 858 | static void __iomem *da8xx_ddr2_ctlr_base; |
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c index 128cb9ae80f4..01d8686e553c 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 | ||
129 | static struct plat_serial8250_port serial_data[] = { | 129 | static 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 | }; | ||
143 | static 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 | }; | ||
157 | static 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 | ||
162 | struct platform_device tnetv107x_serial_device = { | 172 | |
163 | .name = "serial8250", | 173 | struct 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 | ||
168 | static struct resource mmc0_resources[] = { | 193 | static struct resource mmc0_resources[] = { |
@@ -385,7 +410,7 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) | |||
385 | platform_device_register(&tsc_device); | 410 | platform_device_register(&tsc_device); |
386 | 411 | ||
387 | if (info->serial_config) | 412 | if (info->serial_config) |
388 | davinci_serial_init(info->serial_config); | 413 | davinci_serial_init(tnetv107x_serial_device); |
389 | 414 | ||
390 | for (i = 0; i < 2; i++) | 415 | for (i = 0; i < 2; i++) |
391 | if (info->mmc_config[i]) { | 416 | if (info->mmc_config[i]) { |
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 86100d179694..3eaa5f6b2160 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 | ||
925 | static struct plat_serial8250_port dm355_serial_platform_data[] = { | 925 | static 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 | }; | ||
938 | static 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 | }; | ||
951 | static 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 | ||
955 | static struct platform_device dm355_serial_device = { | 965 | 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 | ||
963 | static struct davinci_soc_info davinci_soc_info_dm355 = { | 991 | static struct davinci_soc_info davinci_soc_info_dm355 = { |
@@ -981,7 +1009,6 @@ 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, | ||
985 | .sram_dma = 0x00010000, | 1012 | .sram_dma = 0x00010000, |
986 | .sram_len = SZ_32K, | 1013 | .sram_len = SZ_32K, |
987 | }; | 1014 | }; |
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index dad28029ba9b..c29e324eb0bb 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), |
@@ -477,6 +477,7 @@ static struct clk_lookup dm365_clks[] = { | |||
477 | CLK(NULL, "timer3", &timer3_clk), | 477 | CLK(NULL, "timer3", &timer3_clk), |
478 | CLK(NULL, "usb", &usb_clk), | 478 | CLK(NULL, "usb", &usb_clk), |
479 | CLK("davinci_emac.1", NULL, &emac_clk), | 479 | CLK("davinci_emac.1", NULL, &emac_clk), |
480 | CLK("davinci_mdio.0", "fck", &emac_clk), | ||
480 | CLK("davinci_voicecodec", NULL, &voicecodec_clk), | 481 | CLK("davinci_voicecodec", NULL, &voicecodec_clk), |
481 | CLK("davinci-mcbsp", NULL, &asp0_clk), | 482 | CLK("davinci-mcbsp", NULL, &asp0_clk), |
482 | CLK(NULL, "rto", &rto_clk), | 483 | CLK(NULL, "rto", &rto_clk), |
@@ -1041,7 +1042,7 @@ static struct davinci_timer_info dm365_timer_info = { | |||
1041 | 1042 | ||
1042 | #define DM365_UART1_BASE (IO_PHYS + 0x106000) | 1043 | #define DM365_UART1_BASE (IO_PHYS + 0x106000) |
1043 | 1044 | ||
1044 | static struct plat_serial8250_port dm365_serial_platform_data[] = { | 1045 | static struct plat_serial8250_port dm365_serial0_platform_data[] = { |
1045 | { | 1046 | { |
1046 | .mapbase = DAVINCI_UART0_BASE, | 1047 | .mapbase = DAVINCI_UART0_BASE, |
1047 | .irq = IRQ_UARTINT0, | 1048 | .irq = IRQ_UARTINT0, |
@@ -1051,6 +1052,11 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = { | |||
1051 | .regshift = 2, | 1052 | .regshift = 2, |
1052 | }, | 1053 | }, |
1053 | { | 1054 | { |
1055 | .flags = 0, | ||
1056 | } | ||
1057 | }; | ||
1058 | static struct plat_serial8250_port dm365_serial1_platform_data[] = { | ||
1059 | { | ||
1054 | .mapbase = DM365_UART1_BASE, | 1060 | .mapbase = DM365_UART1_BASE, |
1055 | .irq = IRQ_UARTINT1, | 1061 | .irq = IRQ_UARTINT1, |
1056 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | 1062 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
@@ -1059,16 +1065,27 @@ static struct plat_serial8250_port dm365_serial_platform_data[] = { | |||
1059 | .regshift = 2, | 1065 | .regshift = 2, |
1060 | }, | 1066 | }, |
1061 | { | 1067 | { |
1062 | .flags = 0 | 1068 | .flags = 0, |
1063 | }, | 1069 | } |
1064 | }; | 1070 | }; |
1065 | 1071 | ||
1066 | static struct platform_device dm365_serial_device = { | 1072 | struct platform_device dm365_serial_device[] = { |
1067 | .name = "serial8250", | 1073 | { |
1068 | .id = PLAT8250_DEV_PLATFORM, | 1074 | .name = "serial8250", |
1069 | .dev = { | 1075 | .id = PLAT8250_DEV_PLATFORM, |
1070 | .platform_data = dm365_serial_platform_data, | 1076 | .dev = { |
1077 | .platform_data = dm365_serial0_platform_data, | ||
1078 | } | ||
1079 | }, | ||
1080 | { | ||
1081 | .name = "serial8250", | ||
1082 | .id = PLAT8250_DEV_PLATFORM1, | ||
1083 | .dev = { | ||
1084 | .platform_data = dm365_serial1_platform_data, | ||
1085 | } | ||
1071 | }, | 1086 | }, |
1087 | { | ||
1088 | } | ||
1072 | }; | 1089 | }; |
1073 | 1090 | ||
1074 | static struct davinci_soc_info davinci_soc_info_dm365 = { | 1091 | static struct davinci_soc_info davinci_soc_info_dm365 = { |
@@ -1093,7 +1110,6 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { | |||
1093 | .gpio_num = 104, | 1110 | .gpio_num = 104, |
1094 | .gpio_irq = IRQ_DM365_GPIO0, | 1111 | .gpio_irq = IRQ_DM365_GPIO0, |
1095 | .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */ | 1112 | .gpio_unbanked = 8, /* really 16 ... skip muxed GPIOs */ |
1096 | .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, |
@@ -1407,8 +1423,6 @@ static int __init dm365_init_devices(void) | |||
1407 | 1423 | ||
1408 | platform_device_register(&dm365_mdio_device); | 1424 | platform_device_register(&dm365_mdio_device); |
1409 | platform_device_register(&dm365_emac_device); | 1425 | platform_device_register(&dm365_emac_device); |
1410 | clk_add_alias(NULL, dev_name(&dm365_mdio_device.dev), | ||
1411 | NULL, &dm365_emac_device.dev); | ||
1412 | 1426 | ||
1413 | return 0; | 1427 | return 0; |
1414 | } | 1428 | } |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index a49d18246fe9..4f74682293d6 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -303,10 +303,11 @@ 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("davinci_mdio.0", "fck", &emac_clk), | ||
310 | CLK("i2c_davinci.1", NULL, &i2c_clk), | 311 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
311 | CLK("palm_bk3710", NULL, &ide_clk), | 312 | CLK("palm_bk3710", NULL, &ide_clk), |
312 | CLK("davinci-mcbsp", NULL, &asp_clk), | 313 | CLK("davinci-mcbsp", NULL, &asp_clk), |
@@ -813,7 +814,7 @@ static struct davinci_timer_info dm644x_timer_info = { | |||
813 | .clocksource_id = T0_TOP, | 814 | .clocksource_id = T0_TOP, |
814 | }; | 815 | }; |
815 | 816 | ||
816 | static struct plat_serial8250_port dm644x_serial_platform_data[] = { | 817 | static struct plat_serial8250_port dm644x_serial0_platform_data[] = { |
817 | { | 818 | { |
818 | .mapbase = DAVINCI_UART0_BASE, | 819 | .mapbase = DAVINCI_UART0_BASE, |
819 | .irq = IRQ_UARTINT0, | 820 | .irq = IRQ_UARTINT0, |
@@ -823,6 +824,11 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = { | |||
823 | .regshift = 2, | 824 | .regshift = 2, |
824 | }, | 825 | }, |
825 | { | 826 | { |
827 | .flags = 0, | ||
828 | } | ||
829 | }; | ||
830 | static struct plat_serial8250_port dm644x_serial1_platform_data[] = { | ||
831 | { | ||
826 | .mapbase = DAVINCI_UART1_BASE, | 832 | .mapbase = DAVINCI_UART1_BASE, |
827 | .irq = IRQ_UARTINT1, | 833 | .irq = IRQ_UARTINT1, |
828 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | 834 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
@@ -831,6 +837,11 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = { | |||
831 | .regshift = 2, | 837 | .regshift = 2, |
832 | }, | 838 | }, |
833 | { | 839 | { |
840 | .flags = 0, | ||
841 | } | ||
842 | }; | ||
843 | static struct plat_serial8250_port dm644x_serial2_platform_data[] = { | ||
844 | { | ||
834 | .mapbase = DAVINCI_UART2_BASE, | 845 | .mapbase = DAVINCI_UART2_BASE, |
835 | .irq = IRQ_UARTINT2, | 846 | .irq = IRQ_UARTINT2, |
836 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | 847 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
@@ -839,16 +850,34 @@ static struct plat_serial8250_port dm644x_serial_platform_data[] = { | |||
839 | .regshift = 2, | 850 | .regshift = 2, |
840 | }, | 851 | }, |
841 | { | 852 | { |
842 | .flags = 0 | 853 | .flags = 0, |
843 | }, | 854 | } |
844 | }; | 855 | }; |
845 | 856 | ||
846 | static struct platform_device dm644x_serial_device = { | 857 | struct platform_device dm644x_serial_device[] = { |
847 | .name = "serial8250", | 858 | { |
848 | .id = PLAT8250_DEV_PLATFORM, | 859 | .name = "serial8250", |
849 | .dev = { | 860 | .id = PLAT8250_DEV_PLATFORM, |
850 | .platform_data = dm644x_serial_platform_data, | 861 | .dev = { |
862 | .platform_data = dm644x_serial0_platform_data, | ||
863 | } | ||
851 | }, | 864 | }, |
865 | { | ||
866 | .name = "serial8250", | ||
867 | .id = PLAT8250_DEV_PLATFORM1, | ||
868 | .dev = { | ||
869 | .platform_data = dm644x_serial1_platform_data, | ||
870 | } | ||
871 | }, | ||
872 | { | ||
873 | .name = "serial8250", | ||
874 | .id = PLAT8250_DEV_PLATFORM2, | ||
875 | .dev = { | ||
876 | .platform_data = dm644x_serial2_platform_data, | ||
877 | } | ||
878 | }, | ||
879 | { | ||
880 | } | ||
852 | }; | 881 | }; |
853 | 882 | ||
854 | static struct davinci_soc_info davinci_soc_info_dm644x = { | 883 | static struct davinci_soc_info davinci_soc_info_dm644x = { |
@@ -872,7 +901,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = { | |||
872 | .gpio_base = DAVINCI_GPIO_BASE, | 901 | .gpio_base = DAVINCI_GPIO_BASE, |
873 | .gpio_num = 71, | 902 | .gpio_num = 71, |
874 | .gpio_irq = IRQ_GPIOBNK0, | 903 | .gpio_irq = IRQ_GPIOBNK0, |
875 | .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, |
@@ -923,8 +951,6 @@ static int __init dm644x_init_devices(void) | |||
923 | 951 | ||
924 | platform_device_register(&dm644x_mdio_device); | 952 | platform_device_register(&dm644x_mdio_device); |
925 | platform_device_register(&dm644x_emac_device); | 953 | platform_device_register(&dm644x_emac_device); |
926 | clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev), | ||
927 | NULL, &dm644x_emac_device.dev); | ||
928 | 954 | ||
929 | return 0; | 955 | return 0; |
930 | } | 956 | } |
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index d1259e80141b..68f8d1f1aca1 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
@@ -342,15 +342,16 @@ 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), |
351 | CLK("davinci-mcasp.1", NULL, &mcasp1_clk), | 351 | CLK("davinci-mcasp.1", NULL, &mcasp1_clk), |
352 | CLK(NULL, "aemif", &aemif_clk), | 352 | CLK(NULL, "aemif", &aemif_clk), |
353 | CLK("davinci_emac.1", NULL, &emac_clk), | 353 | CLK("davinci_emac.1", NULL, &emac_clk), |
354 | CLK("davinci_mdio.0", "fck", &emac_clk), | ||
354 | CLK(NULL, "pwm0", &pwm0_clk), | 355 | CLK(NULL, "pwm0", &pwm0_clk), |
355 | CLK(NULL, "pwm1", &pwm1_clk), | 356 | CLK(NULL, "pwm1", &pwm1_clk), |
356 | CLK(NULL, "timer0", &timer0_clk), | 357 | CLK(NULL, "timer0", &timer0_clk), |
@@ -790,7 +791,7 @@ static struct davinci_timer_info dm646x_timer_info = { | |||
790 | .clocksource_id = T0_TOP, | 791 | .clocksource_id = T0_TOP, |
791 | }; | 792 | }; |
792 | 793 | ||
793 | static struct plat_serial8250_port dm646x_serial_platform_data[] = { | 794 | static struct plat_serial8250_port dm646x_serial0_platform_data[] = { |
794 | { | 795 | { |
795 | .mapbase = DAVINCI_UART0_BASE, | 796 | .mapbase = DAVINCI_UART0_BASE, |
796 | .irq = IRQ_UARTINT0, | 797 | .irq = IRQ_UARTINT0, |
@@ -800,6 +801,11 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = { | |||
800 | .regshift = 2, | 801 | .regshift = 2, |
801 | }, | 802 | }, |
802 | { | 803 | { |
804 | .flags = 0, | ||
805 | } | ||
806 | }; | ||
807 | static struct plat_serial8250_port dm646x_serial1_platform_data[] = { | ||
808 | { | ||
803 | .mapbase = DAVINCI_UART1_BASE, | 809 | .mapbase = DAVINCI_UART1_BASE, |
804 | .irq = IRQ_UARTINT1, | 810 | .irq = IRQ_UARTINT1, |
805 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | 811 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
@@ -808,6 +814,11 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = { | |||
808 | .regshift = 2, | 814 | .regshift = 2, |
809 | }, | 815 | }, |
810 | { | 816 | { |
817 | .flags = 0, | ||
818 | } | ||
819 | }; | ||
820 | static struct plat_serial8250_port dm646x_serial2_platform_data[] = { | ||
821 | { | ||
811 | .mapbase = DAVINCI_UART2_BASE, | 822 | .mapbase = DAVINCI_UART2_BASE, |
812 | .irq = IRQ_DM646X_UARTINT2, | 823 | .irq = IRQ_DM646X_UARTINT2, |
813 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | 824 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
@@ -816,16 +827,34 @@ static struct plat_serial8250_port dm646x_serial_platform_data[] = { | |||
816 | .regshift = 2, | 827 | .regshift = 2, |
817 | }, | 828 | }, |
818 | { | 829 | { |
819 | .flags = 0 | 830 | .flags = 0, |
820 | }, | 831 | } |
821 | }; | 832 | }; |
822 | 833 | ||
823 | static struct platform_device dm646x_serial_device = { | 834 | struct platform_device dm646x_serial_device[] = { |
824 | .name = "serial8250", | 835 | { |
825 | .id = PLAT8250_DEV_PLATFORM, | 836 | .name = "serial8250", |
826 | .dev = { | 837 | .id = PLAT8250_DEV_PLATFORM, |
827 | .platform_data = dm646x_serial_platform_data, | 838 | .dev = { |
839 | .platform_data = dm646x_serial0_platform_data, | ||
840 | } | ||
841 | }, | ||
842 | { | ||
843 | .name = "serial8250", | ||
844 | .id = PLAT8250_DEV_PLATFORM1, | ||
845 | .dev = { | ||
846 | .platform_data = dm646x_serial1_platform_data, | ||
847 | } | ||
828 | }, | 848 | }, |
849 | { | ||
850 | .name = "serial8250", | ||
851 | .id = PLAT8250_DEV_PLATFORM2, | ||
852 | .dev = { | ||
853 | .platform_data = dm646x_serial2_platform_data, | ||
854 | } | ||
855 | }, | ||
856 | { | ||
857 | } | ||
829 | }; | 858 | }; |
830 | 859 | ||
831 | static struct davinci_soc_info davinci_soc_info_dm646x = { | 860 | static struct davinci_soc_info davinci_soc_info_dm646x = { |
@@ -849,7 +878,6 @@ static struct davinci_soc_info davinci_soc_info_dm646x = { | |||
849 | .gpio_base = DAVINCI_GPIO_BASE, | 878 | .gpio_base = DAVINCI_GPIO_BASE, |
850 | .gpio_num = 43, /* Only 33 usable */ | 879 | .gpio_num = 43, /* Only 33 usable */ |
851 | .gpio_irq = IRQ_DM646X_GPIOBNK0, | 880 | .gpio_irq = IRQ_DM646X_GPIOBNK0, |
852 | .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, |
@@ -913,8 +941,6 @@ static int __init dm646x_init_devices(void) | |||
913 | 941 | ||
914 | platform_device_register(&dm646x_mdio_device); | 942 | platform_device_register(&dm646x_mdio_device); |
915 | platform_device_register(&dm646x_emac_device); | 943 | platform_device_register(&dm646x_emac_device); |
916 | clk_add_alias(NULL, dev_name(&dm646x_mdio_device.dev), | ||
917 | NULL, &dm646x_emac_device.dev); | ||
918 | 944 | ||
919 | return 0; | 945 | return 0; |
920 | } | 946 | } |
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index cce316b92c06..0b3c169758ed 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h | |||
@@ -72,7 +72,6 @@ struct davinci_soc_info { | |||
72 | unsigned gpio_unbanked; | 72 | unsigned gpio_unbanked; |
73 | struct davinci_gpio_controller *gpio_ctlrs; | 73 | struct davinci_gpio_controller *gpio_ctlrs; |
74 | int gpio_ctlrs_num; | 74 | int gpio_ctlrs_num; |
75 | struct platform_device *serial_dev; | ||
76 | struct emac_platform_data *emac_pdata; | 75 | struct emac_platform_data *emac_pdata; |
77 | dma_addr_t sram_dma; | 76 | dma_addr_t sram_dma; |
78 | unsigned sram_len; | 77 | unsigned sram_len; |
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); | |||
111 | void da8xx_rproc_reserve_cma(void); | 111 | void da8xx_rproc_reserve_cma(void); |
112 | int da8xx_register_rproc(void); | 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 | extern struct emac_platform_data da8xx_emac_pdata; | 115 | extern struct emac_platform_data da8xx_emac_pdata; |
116 | extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; | 116 | extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; |
117 | extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; | 117 | extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; |
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index 62ad300440f5..52b8571b2e70 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h | |||
@@ -15,6 +15,8 @@ | |||
15 | 15 | ||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
18 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) | 20 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) |
19 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) | 21 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) |
20 | #define DAVINCI_UART2_BASE (IO_PHYS + 0x20800) | 22 | #define DAVINCI_UART2_BASE (IO_PHYS + 0x20800) |
@@ -37,13 +39,7 @@ | |||
37 | #define UART_DM646X_SCR_TX_WATERMARK 0x08 | 39 | #define UART_DM646X_SCR_TX_WATERMARK 0x08 |
38 | 40 | ||
39 | #ifndef __ASSEMBLY__ | 41 | #ifndef __ASSEMBLY__ |
40 | struct davinci_uart_config { | 42 | extern int davinci_serial_init(struct platform_device *); |
41 | /* Bit field of UARTs present; bit 0 --> UART0 */ | ||
42 | unsigned int enabled_uarts; | ||
43 | }; | ||
44 | |||
45 | extern int davinci_serial_init(struct davinci_uart_config *); | ||
46 | extern int davinci_serial_setup_clk(unsigned instance, unsigned int *rate); | ||
47 | #endif | 43 | #endif |
48 | 44 | ||
49 | #endif /* __ASM_ARCH_SERIAL_H */ | 45 | #endif /* __ASM_ARCH_SERIAL_H */ |
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h index 16314c64f755..494fcf5ccfe1 100644 --- a/arch/arm/mach-davinci/include/mach/tnetv107x.h +++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <mach/serial.h> | 42 | #include <mach/serial.h> |
43 | 43 | ||
44 | struct tnetv107x_device_info { | 44 | struct tnetv107x_device_info { |
45 | struct davinci_uart_config *serial_config; | ||
46 | struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ | 45 | struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ |
47 | struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ | 46 | struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ |
48 | struct matrix_keypad_platform_data *keypad_config; | 47 | struct matrix_keypad_platform_data *keypad_config; |
@@ -50,7 +49,7 @@ struct tnetv107x_device_info { | |||
50 | }; | 49 | }; |
51 | 50 | ||
52 | extern struct platform_device tnetv107x_wdt_device; | 51 | extern struct platform_device tnetv107x_wdt_device; |
53 | extern struct platform_device tnetv107x_serial_device; | 52 | extern struct platform_device tnetv107x_serial_device[]; |
54 | 53 | ||
55 | extern void tnetv107x_init(void); | 54 | extern void tnetv107x_init(void); |
56 | extern void tnetv107x_devices_init(struct tnetv107x_device_info *); | 55 | extern 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..5e93a734c858 100644 --- a/arch/arm/mach-davinci/serial.c +++ b/arch/arm/mach-davinci/serial.c | |||
@@ -70,49 +70,36 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p) | |||
70 | UART_DM646X_SCR_TX_WATERMARK); | 70 | UART_DM646X_SCR_TX_WATERMARK); |
71 | } | 71 | } |
72 | 72 | ||
73 | /* Enable UART clock and obtain its rate */ | 73 | int __init davinci_serial_init(struct platform_device *serial_dev) |
74 | int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate) | ||
75 | { | 74 | { |
76 | char name[16]; | 75 | int i, ret = 0; |
76 | struct device *dev; | ||
77 | struct plat_serial8250_port *p; | ||
77 | struct clk *clk; | 78 | struct clk *clk; |
78 | struct davinci_soc_info *soc_info = &davinci_soc_info; | ||
79 | struct device *dev = &soc_info->serial_dev->dev; | ||
80 | |||
81 | sprintf(name, "uart%d", instance); | ||
82 | clk = clk_get(dev, name); | ||
83 | if (IS_ERR(clk)) { | ||
84 | pr_err("%s:%d: failed to get UART%d clock\n", | ||
85 | __func__, __LINE__, instance); | ||
86 | return PTR_ERR(clk); | ||
87 | } | ||
88 | |||
89 | clk_prepare_enable(clk); | ||
90 | |||
91 | if (rate) | ||
92 | *rate = clk_get_rate(clk); | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | int __init davinci_serial_init(struct davinci_uart_config *info) | ||
98 | { | ||
99 | int i, ret; | ||
100 | 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; | ||
103 | 79 | ||
104 | /* | 80 | /* |
105 | * Make sure the serial ports are muxed on at this point. | 81 | * 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. | 82 | * You have to mux them off in device drivers later on if not needed. |
107 | */ | 83 | */ |
108 | for (i = 0; p->flags; i++, p++) { | 84 | for (i = 0; serial_dev[i].dev.platform_data != NULL; i++) { |
109 | if (!(info->enabled_uarts & (1 << i))) | 85 | dev = &serial_dev[i].dev; |
110 | continue; | 86 | p = dev->platform_data; |
111 | 87 | ||
112 | ret = davinci_serial_setup_clk(i, &p->uartclk); | 88 | ret = platform_device_register(&serial_dev[i]); |
113 | if (ret) | 89 | if (ret) |
114 | continue; | 90 | continue; |
115 | 91 | ||
92 | clk = clk_get(dev, NULL); | ||
93 | if (IS_ERR(clk)) { | ||
94 | pr_err("%s:%d: failed to get UART%d clock\n", | ||
95 | __func__, __LINE__, i); | ||
96 | continue; | ||
97 | } | ||
98 | |||
99 | clk_prepare_enable(clk); | ||
100 | |||
101 | p->uartclk = clk_get_rate(clk); | ||
102 | |||
116 | if (!p->membase && p->mapbase) { | 103 | if (!p->membase && p->mapbase) { |
117 | p->membase = ioremap(p->mapbase, SZ_4K); | 104 | p->membase = ioremap(p->mapbase, SZ_4K); |
118 | 105 | ||
@@ -125,6 +112,5 @@ int __init davinci_serial_init(struct davinci_uart_config *info) | |||
125 | if (p->membase && p->type != PORT_AR7) | 112 | if (p->membase && p->type != PORT_AR7) |
126 | davinci_serial_reset(p); | 113 | davinci_serial_reset(p); |
127 | } | 114 | } |
128 | 115 | return ret; | |
129 | return platform_device_register(soc_info->serial_dev); | ||
130 | } | 116 | } |
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 | ||
763 | void __init tnetv107x_init(void) | 763 | void __init tnetv107x_init(void) |