aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm365.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/dm365.c')
-rw-r--r--arch/arm/mach-davinci/dm365.c107
1 files changed, 102 insertions, 5 deletions
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index e81517434703..2ec619ec1657 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -12,7 +12,6 @@
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 */ 14 */
15#include <linux/kernel.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/clk.h> 16#include <linux/clk.h>
18#include <linux/serial_8250.h> 17#include <linux/serial_8250.h>
@@ -23,7 +22,6 @@
23#include <asm/mach/map.h> 22#include <asm/mach/map.h>
24 23
25#include <mach/dm365.h> 24#include <mach/dm365.h>
26#include <mach/clock.h>
27#include <mach/cputype.h> 25#include <mach/cputype.h>
28#include <mach/edma.h> 26#include <mach/edma.h>
29#include <mach/psc.h> 27#include <mach/psc.h>
@@ -32,6 +30,8 @@
32#include <mach/time.h> 30#include <mach/time.h>
33#include <mach/serial.h> 31#include <mach/serial.h>
34#include <mach/common.h> 32#include <mach/common.h>
33#include <mach/asp.h>
34#include <mach/keyscan.h>
35 35
36#include "clock.h" 36#include "clock.h"
37#include "mux.h" 37#include "mux.h"
@@ -369,7 +369,7 @@ static struct clk timer3_clk = {
369 369
370static struct clk usb_clk = { 370static struct clk usb_clk = {
371 .name = "usb", 371 .name = "usb",
372 .parent = &pll2_sysclk1, 372 .parent = &pll1_aux_clk,
373 .lpsc = DAVINCI_LPSC_USB, 373 .lpsc = DAVINCI_LPSC_USB,
374}; 374};
375 375
@@ -456,7 +456,7 @@ static struct davinci_clk dm365_clks[] = {
456 CLK(NULL, "usb", &usb_clk), 456 CLK(NULL, "usb", &usb_clk),
457 CLK("davinci_emac.1", NULL, &emac_clk), 457 CLK("davinci_emac.1", NULL, &emac_clk),
458 CLK("voice_codec", NULL, &voicecodec_clk), 458 CLK("voice_codec", NULL, &voicecodec_clk),
459 CLK("soc-audio.0", NULL, &asp0_clk), 459 CLK("davinci-asp.0", NULL, &asp0_clk),
460 CLK(NULL, "rto", &rto_clk), 460 CLK(NULL, "rto", &rto_clk),
461 CLK(NULL, "mjcp", &mjcp_clk), 461 CLK(NULL, "mjcp", &mjcp_clk),
462 CLK(NULL, NULL, NULL), 462 CLK(NULL, NULL, NULL),
@@ -531,7 +531,7 @@ MUX_CFG(DM365, EMAC_CRS, 3, 2, 1, 1, false)
531MUX_CFG(DM365, EMAC_MDIO, 3, 1, 1, 1, false) 531MUX_CFG(DM365, EMAC_MDIO, 3, 1, 1, 1, false)
532MUX_CFG(DM365, EMAC_MDCLK, 3, 0, 1, 1, false) 532MUX_CFG(DM365, EMAC_MDCLK, 3, 0, 1, 1, false)
533 533
534MUX_CFG(DM365, KEYPAD, 2, 0, 0x3f, 0x3f, false) 534MUX_CFG(DM365, KEYSCAN, 2, 0, 0x3f, 0x3f, false)
535 535
536MUX_CFG(DM365, PWM0, 1, 0, 3, 2, false) 536MUX_CFG(DM365, PWM0, 1, 0, 3, 2, false)
537MUX_CFG(DM365, PWM0_G23, 3, 26, 3, 3, false) 537MUX_CFG(DM365, PWM0_G23, 3, 26, 3, 3, false)
@@ -603,6 +603,9 @@ INT_CFG(DM365, INT_IMX1_ENABLE, 24, 1, 1, false)
603INT_CFG(DM365, INT_IMX1_DISABLE, 24, 1, 0, false) 603INT_CFG(DM365, INT_IMX1_DISABLE, 24, 1, 0, false)
604INT_CFG(DM365, INT_NSF_ENABLE, 25, 1, 1, false) 604INT_CFG(DM365, INT_NSF_ENABLE, 25, 1, 1, false)
605INT_CFG(DM365, INT_NSF_DISABLE, 25, 1, 0, false) 605INT_CFG(DM365, INT_NSF_DISABLE, 25, 1, 0, false)
606
607EVT_CFG(DM365, EVT2_ASP_TX, 0, 1, 0, false)
608EVT_CFG(DM365, EVT3_ASP_RX, 1, 1, 0, false)
606#endif 609#endif
607}; 610};
608 611
@@ -696,6 +699,7 @@ static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = {
696 [IRQ_I2C] = 3, 699 [IRQ_I2C] = 3,
697 [IRQ_UARTINT0] = 3, 700 [IRQ_UARTINT0] = 3,
698 [IRQ_UARTINT1] = 3, 701 [IRQ_UARTINT1] = 3,
702 [IRQ_DM365_RTCINT] = 3,
699 [IRQ_DM365_SPIINT0_0] = 3, 703 [IRQ_DM365_SPIINT0_0] = 3,
700 [IRQ_DM365_SPIINT3_0] = 3, 704 [IRQ_DM365_SPIINT3_0] = 3,
701 [IRQ_DM365_GPIO0] = 3, 705 [IRQ_DM365_GPIO0] = 3,
@@ -806,6 +810,50 @@ static struct platform_device dm365_edma_device = {
806 .resource = edma_resources, 810 .resource = edma_resources,
807}; 811};
808 812
813static struct resource dm365_asp_resources[] = {
814 {
815 .start = DAVINCI_DM365_ASP0_BASE,
816 .end = DAVINCI_DM365_ASP0_BASE + SZ_8K - 1,
817 .flags = IORESOURCE_MEM,
818 },
819 {
820 .start = DAVINCI_DMA_ASP0_TX,
821 .end = DAVINCI_DMA_ASP0_TX,
822 .flags = IORESOURCE_DMA,
823 },
824 {
825 .start = DAVINCI_DMA_ASP0_RX,
826 .end = DAVINCI_DMA_ASP0_RX,
827 .flags = IORESOURCE_DMA,
828 },
829};
830
831static struct platform_device dm365_asp_device = {
832 .name = "davinci-asp",
833 .id = 0,
834 .num_resources = ARRAY_SIZE(dm365_asp_resources),
835 .resource = dm365_asp_resources,
836};
837
838static struct resource dm365_rtc_resources[] = {
839 {
840 .start = DM365_RTC_BASE,
841 .end = DM365_RTC_BASE + SZ_1K - 1,
842 .flags = IORESOURCE_MEM,
843 },
844 {
845 .start = IRQ_DM365_RTCINT,
846 .flags = IORESOURCE_IRQ,
847 },
848};
849
850static struct platform_device dm365_rtc_device = {
851 .name = "rtc_davinci",
852 .id = 0,
853 .num_resources = ARRAY_SIZE(dm365_rtc_resources),
854 .resource = dm365_rtc_resources,
855};
856
809static struct map_desc dm365_io_desc[] = { 857static struct map_desc dm365_io_desc[] = {
810 { 858 {
811 .virtual = IO_VIRT, 859 .virtual = IO_VIRT,
@@ -822,6 +870,28 @@ static struct map_desc dm365_io_desc[] = {
822 }, 870 },
823}; 871};
824 872
873static struct resource dm365_ks_resources[] = {
874 {
875 /* registers */
876 .start = DM365_KEYSCAN_BASE,
877 .end = DM365_KEYSCAN_BASE + SZ_1K - 1,
878 .flags = IORESOURCE_MEM,
879 },
880 {
881 /* interrupt */
882 .start = IRQ_DM365_KEYINT,
883 .end = IRQ_DM365_KEYINT,
884 .flags = IORESOURCE_IRQ,
885 },
886};
887
888static struct platform_device dm365_ks_device = {
889 .name = "davinci_keyscan",
890 .id = 0,
891 .num_resources = ARRAY_SIZE(dm365_ks_resources),
892 .resource = dm365_ks_resources,
893};
894
825/* Contents of JTAG ID register used to identify exact cpu type */ 895/* Contents of JTAG ID register used to identify exact cpu type */
826static struct davinci_id dm365_ids[] = { 896static struct davinci_id dm365_ids[] = {
827 { 897 {
@@ -907,6 +977,33 @@ static struct davinci_soc_info davinci_soc_info_dm365 = {
907 .sram_len = SZ_32K, 977 .sram_len = SZ_32K,
908}; 978};
909 979
980void __init dm365_init_asp(struct snd_platform_data *pdata)
981{
982 davinci_cfg_reg(DM365_MCBSP0_BDX);
983 davinci_cfg_reg(DM365_MCBSP0_X);
984 davinci_cfg_reg(DM365_MCBSP0_BFSX);
985 davinci_cfg_reg(DM365_MCBSP0_BDR);
986 davinci_cfg_reg(DM365_MCBSP0_R);
987 davinci_cfg_reg(DM365_MCBSP0_BFSR);
988 davinci_cfg_reg(DM365_EVT2_ASP_TX);
989 davinci_cfg_reg(DM365_EVT3_ASP_RX);
990 dm365_asp_device.dev.platform_data = pdata;
991 platform_device_register(&dm365_asp_device);
992}
993
994void __init dm365_init_ks(struct davinci_ks_platform_data *pdata)
995{
996 davinci_cfg_reg(DM365_KEYSCAN);
997 dm365_ks_device.dev.platform_data = pdata;
998 platform_device_register(&dm365_ks_device);
999}
1000
1001void __init dm365_init_rtc(void)
1002{
1003 davinci_cfg_reg(DM365_INT_PRTCSS);
1004 platform_device_register(&dm365_rtc_device);
1005}
1006
910void __init dm365_init(void) 1007void __init dm365_init(void)
911{ 1008{
912 davinci_common_init(&davinci_soc_info_dm365); 1009 davinci_common_init(&davinci_soc_info_dm365);