Daniel Walker | 62a6cc5 | 2010-05-05 07:27:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Google, Inc. |
| 3 | * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. |
| 4 | * |
| 5 | * This software is licensed under the terms of the GNU General Public |
| 6 | * License version 2, as published by the Free Software Foundation, and |
| 7 | * may be copied, distributed, and modified under those terms. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/platform_device.h> |
| 18 | |
| 19 | #include <linux/dma-mapping.h> |
| 20 | #include <mach/irqs.h> |
| 21 | #include <mach/msm_iomap.h> |
| 22 | #include <mach/dma.h> |
| 23 | #include <mach/board.h> |
| 24 | |
| 25 | #include "devices.h" |
| 26 | |
| 27 | #include <asm/mach/flash.h> |
| 28 | |
| 29 | #include <mach/mmc.h> |
| 30 | |
| 31 | static struct resource resources_uart3[] = { |
| 32 | { |
| 33 | .start = INT_UART3, |
| 34 | .end = INT_UART3, |
| 35 | .flags = IORESOURCE_IRQ, |
| 36 | }, |
| 37 | { |
| 38 | .start = MSM_UART3_PHYS, |
| 39 | .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, |
| 40 | .flags = IORESOURCE_MEM, |
| 41 | }, |
| 42 | }; |
| 43 | |
| 44 | struct platform_device msm_device_uart3 = { |
| 45 | .name = "msm_serial", |
| 46 | .id = 2, |
| 47 | .num_resources = ARRAY_SIZE(resources_uart3), |
| 48 | .resource = resources_uart3, |
| 49 | }; |
| 50 | |
Niranjana Vishwanathapura | 88b5227 | 2010-10-06 13:52:11 -0700 | [diff] [blame] | 51 | struct platform_device msm_device_smd = { |
| 52 | .name = "msm_smd", |
| 53 | .id = -1, |
| 54 | }; |
| 55 | |
Pavankumar Kondeti | 7032d51 | 2010-12-08 13:37:07 +0530 | [diff] [blame] | 56 | static struct resource resources_otg[] = { |
| 57 | { |
| 58 | .start = MSM_HSUSB_PHYS, |
| 59 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, |
| 60 | .flags = IORESOURCE_MEM, |
| 61 | }, |
| 62 | { |
| 63 | .start = INT_USB_HS, |
| 64 | .end = INT_USB_HS, |
| 65 | .flags = IORESOURCE_IRQ, |
| 66 | }, |
| 67 | }; |
| 68 | |
| 69 | struct platform_device msm_device_otg = { |
| 70 | .name = "msm_otg", |
| 71 | .id = -1, |
| 72 | .num_resources = ARRAY_SIZE(resources_otg), |
| 73 | .resource = resources_otg, |
| 74 | .dev = { |
| 75 | .coherent_dma_mask = 0xffffffff, |
| 76 | }, |
| 77 | }; |
| 78 | |
| 79 | static struct resource resources_hsusb[] = { |
| 80 | { |
| 81 | .start = MSM_HSUSB_PHYS, |
| 82 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, |
| 83 | .flags = IORESOURCE_MEM, |
| 84 | }, |
| 85 | { |
| 86 | .start = INT_USB_HS, |
| 87 | .end = INT_USB_HS, |
| 88 | .flags = IORESOURCE_IRQ, |
| 89 | }, |
| 90 | }; |
| 91 | |
| 92 | struct platform_device msm_device_hsusb = { |
| 93 | .name = "msm_hsusb", |
| 94 | .id = -1, |
| 95 | .num_resources = ARRAY_SIZE(resources_hsusb), |
| 96 | .resource = resources_hsusb, |
| 97 | .dev = { |
| 98 | .coherent_dma_mask = 0xffffffff, |
| 99 | }, |
| 100 | }; |
| 101 | |
| 102 | static u64 dma_mask = 0xffffffffULL; |
| 103 | static struct resource resources_hsusb_host[] = { |
| 104 | { |
| 105 | .start = MSM_HSUSB_PHYS, |
| 106 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, |
| 107 | .flags = IORESOURCE_MEM, |
| 108 | }, |
| 109 | { |
| 110 | .start = INT_USB_HS, |
| 111 | .end = INT_USB_HS, |
| 112 | .flags = IORESOURCE_IRQ, |
| 113 | }, |
| 114 | }; |
| 115 | |
| 116 | struct platform_device msm_device_hsusb_host = { |
| 117 | .name = "msm_hsusb_host", |
| 118 | .id = -1, |
| 119 | .num_resources = ARRAY_SIZE(resources_hsusb_host), |
| 120 | .resource = resources_hsusb_host, |
| 121 | .dev = { |
| 122 | .dma_mask = &dma_mask, |
| 123 | .coherent_dma_mask = 0xffffffffULL, |
| 124 | }, |
| 125 | }; |
| 126 | |
Daniel Walker | 62a6cc5 | 2010-05-05 07:27:16 -0700 | [diff] [blame] | 127 | struct clk msm_clocks_8x50[] = { |
| 128 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), |
| 129 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), |
| 130 | CLK_PCOM("ebi2_clk", EBI2_CLK, NULL, 0), |
| 131 | CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0), |
| 132 | CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX), |
| 133 | CLK_PCOM("gp_clk", GP_CLK, NULL, 0), |
| 134 | CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, 0), |
| 135 | CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), |
| 136 | CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), |
| 137 | CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), |
| 138 | CLK_PCOM("mdc_clk", MDC_CLK, NULL, 0), |
| 139 | CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX), |
| 140 | CLK_PCOM("mdp_clk", MDP_CLK, NULL, OFF), |
| 141 | CLK_PCOM("mdp_lcdc_pclk_clk", MDP_LCDC_PCLK_CLK, NULL, 0), |
| 142 | CLK_PCOM("mdp_lcdc_pad_pclk_clk", MDP_LCDC_PAD_PCLK_CLK, NULL, 0), |
| 143 | CLK_PCOM("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, 0), |
| 144 | CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), |
| 145 | CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), |
| 146 | CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), |
| 147 | CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), |
| 148 | CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), |
| 149 | CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), |
| 150 | CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), |
| 151 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), |
| 152 | CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), |
| 153 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), |
| 154 | CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), |
| 155 | CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), |
| 156 | CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF | CLK_MIN), |
| 157 | CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF), |
| 158 | CLK_PCOM("vfe_mdc_clk", VFE_MDC_CLK, NULL, OFF), |
| 159 | CLK_PCOM("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF), |
| 160 | CLK_PCOM("usb_hs2_clk", USB_HS2_CLK, NULL, OFF), |
| 161 | CLK_PCOM("usb_hs2_pclk", USB_HS2_P_CLK, NULL, OFF), |
| 162 | CLK_PCOM("usb_hs3_clk", USB_HS3_CLK, NULL, OFF), |
| 163 | CLK_PCOM("usb_hs3_pclk", USB_HS3_P_CLK, NULL, OFF), |
| 164 | CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), |
| 165 | }; |
| 166 | |
| 167 | unsigned msm_num_clocks_8x50 = ARRAY_SIZE(msm_clocks_8x50); |
| 168 | |