Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://codeaurora.org/quic/kernel/davidb/linux-msm

* 'for-linus' of git://codeaurora.org/quic/kernel/davidb/linux-msm: (46 commits)
msm: scm: Check for interruption immediately
msm: scm: Fix improper register assignment
msm: scm: Mark inline asm as volatile
msm: iommu: Enable HTW L2 redirection on MSM8960
msm: iommu: Don't read from write-only registers
msm: iommu: Remove dependency on IDR
msm: iommu: Use ASID tagging instead of VMID tagging
msm: iommu: Rework clock logic and add IOMMU bus clock control
msm: iommu: Clock control for the IOMMU driver
msm: mdp: Set the correct pack pattern for XRGB/ARGB
msm_fb: Fix framebuffer console
msm: mdp: Add support for RGBX 8888 image format.
video: msmfb: Put the partial update magic value into the fix_screen struct.
msm: clock: Migrate to clkdev
msm: clock: Remove references to clk_ops_pcom
msm: headsmp.S: Fix section mismatch
msm: Use explicit GPLv2 licenses
msm: iommu: Enable IOMMU support for MSM8960
msm: iommu: Generalize platform data for multiple targets
msm: iommu: Create a Kconfig item for the IOMMU driver
...

+1994 -1039
+1
arch/arm/Kconfig
··· 626 626 select HAVE_CLK 627 627 select GENERIC_CLOCKEVENTS 628 628 select ARCH_REQUIRE_GPIOLIB 629 + select CLKDEV_LOOKUP 629 630 help 630 631 Support for Qualcomm MSM/QSD based systems. This runs on the 631 632 apps processor of the MSM/QSD and depends on a shared memory
+35 -2
arch/arm/mach-msm/Kconfig
··· 45 45 select CPU_V7 46 46 select MSM_V2_TLMM 47 47 select MSM_GPIOMUX 48 - select IOMMU_API 48 + select MSM_SCM if SMP 49 + 50 + config ARCH_MSM8960 51 + bool "MSM8960" 52 + select ARCH_MSM_SCORPIONMP 53 + select MACH_MSM8960_SIM if (!MACH_MSM8960_RUMI3) 54 + select ARM_GIC 55 + select CPU_V7 56 + select MSM_V2_TLMM 57 + select MSM_GPIOMUX 49 58 select MSM_SCM if SMP 50 59 51 60 endchoice ··· 134 125 help 135 126 Support for the Qualcomm MSM8x60 FFA eval board. 136 127 128 + config MACH_MSM8960_SIM 129 + depends on ARCH_MSM8960 130 + bool "MSM8960 Simulator" 131 + help 132 + Support for the Qualcomm MSM8960 simulator. 133 + 134 + config MACH_MSM8960_RUMI3 135 + depends on ARCH_MSM8960 136 + bool "MSM8960 RUMI3" 137 + help 138 + Support for the Qualcomm MSM8960 RUMI3 emulator. 139 + 137 140 endmenu 141 + 142 + config MSM_IOMMU 143 + bool "MSM IOMMU Support" 144 + depends on ARCH_MSM8X60 || ARCH_MSM8960 145 + select IOMMU_API 146 + default n 147 + help 148 + Support for the IOMMUs found on certain Qualcomm SOCs. 149 + These IOMMUs allow virtualization of the address space used by most 150 + cores within the multimedia subsystem. 151 + 152 + If unsure, say N here. 138 153 139 154 config IOMMU_PGTABLES_L2 140 155 def_bool y 141 - depends on ARCH_MSM8X60 && MMU && SMP && CPU_DCACHE_DISABLE=n 156 + depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n 142 157 143 158 config MSM_DEBUG_UART 144 159 int
+14 -15
arch/arm/mach-msm/Makefile
··· 1 1 obj-y += io.o idle.o timer.o 2 - ifndef CONFIG_ARCH_MSM8X60 3 - obj-y += acpuclock-arm11.o 4 - obj-y += dma.o 5 - endif 2 + obj-y += clock.o 3 + obj-$(CONFIG_DEBUG_FS) += clock-debug.o 6 4 7 - ifdef CONFIG_MSM_VIC 8 - obj-y += irq-vic.o 9 - else 10 - ifndef CONFIG_ARCH_MSM8X60 11 - obj-y += irq.o 12 - endif 13 - endif 5 + obj-$(CONFIG_MSM_VIC) += irq-vic.o 6 + obj-$(CONFIG_MSM_IOMMU) += iommu.o iommu_dev.o devices-iommu.o 14 7 15 - obj-$(CONFIG_ARCH_MSM8X60) += clock-dummy.o iommu.o iommu_dev.o devices-msm8x60-iommu.o 8 + obj-$(CONFIG_ARCH_MSM7X00A) += dma.o irq.o acpuclock-arm11.o 9 + obj-$(CONFIG_ARCH_MSM7X30) += dma.o 10 + obj-$(CONFIG_ARCH_QSD8X50) += dma.o sirc.o 11 + 16 12 obj-$(CONFIG_MSM_PROC_COMM) += proc_comm.o clock-pcom.o vreg.o 17 - obj-$(CONFIG_MSM_PROC_COMM) += clock.o 18 - obj-$(CONFIG_ARCH_QSD8X50) += sirc.o 13 + 19 14 obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o 20 15 obj-$(CONFIG_MSM_SMD) += last_radio_log.o 21 16 obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o ··· 24 29 obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o 25 30 obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o 26 31 obj-$(CONFIG_ARCH_MSM8X60) += board-msm8x60.o 32 + obj-$(CONFIG_ARCH_MSM8960) += board-msm8960.o devices-msm8960.o 27 33 28 - obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-7x30.o gpiomux-v1.o gpiomux.o 34 + obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o 29 35 obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o 30 36 obj-$(CONFIG_ARCH_MSM8X60) += gpiomux-8x60.o gpiomux-v2.o gpiomux.o 31 37 ifdef CONFIG_MSM_V2_TLMM 38 + ifndef CONFIG_ARCH_MSM8960 39 + # TODO: TLMM Mapping issues need to be resolved 32 40 obj-y += gpio-v2.o 41 + endif 33 42 else 34 43 obj-y += gpio.o 35 44 endif
-2
arch/arm/mach-msm/board-halibut.c
··· 93 93 } 94 94 95 95 MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)") 96 - #ifdef CONFIG_MSM_DEBUG_UART 97 - #endif 98 96 .boot_params = 0x10000100, 99 97 .fixup = halibut_fixup, 100 98 .map_io = halibut_map_io,
-2
arch/arm/mach-msm/board-mahimahi.c
··· 74 74 extern struct sys_timer msm_timer; 75 75 76 76 MACHINE_START(MAHIMAHI, "mahimahi") 77 - #ifdef CONFIG_MSM_DEBUG_UART 78 - #endif 79 77 .boot_params = 0x20000100, 80 78 .fixup = mahimahi_fixup, 81 79 .map_io = mahimahi_map_io,
-8
arch/arm/mach-msm/board-msm7x27.c
··· 130 130 } 131 131 132 132 MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF") 133 - #ifdef CONFIG_MSM_DEBUG_UART 134 - #endif 135 133 .boot_params = PLAT_PHYS_OFFSET + 0x100, 136 134 .map_io = msm7x2x_map_io, 137 135 .init_irq = msm7x2x_init_irq, ··· 138 140 MACHINE_END 139 141 140 142 MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA") 141 - #ifdef CONFIG_MSM_DEBUG_UART 142 - #endif 143 143 .boot_params = PLAT_PHYS_OFFSET + 0x100, 144 144 .map_io = msm7x2x_map_io, 145 145 .init_irq = msm7x2x_init_irq, ··· 146 150 MACHINE_END 147 151 148 152 MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF") 149 - #ifdef CONFIG_MSM_DEBUG_UART 150 - #endif 151 153 .boot_params = PLAT_PHYS_OFFSET + 0x100, 152 154 .map_io = msm7x2x_map_io, 153 155 .init_irq = msm7x2x_init_irq, ··· 154 160 MACHINE_END 155 161 156 162 MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA") 157 - #ifdef CONFIG_MSM_DEBUG_UART 158 - #endif 159 163 .boot_params = PLAT_PHYS_OFFSET + 0x100, 160 164 .map_io = msm7x2x_map_io, 161 165 .init_irq = msm7x2x_init_irq,
+23 -6
arch/arm/mach-msm/board-msm7x30.c
··· 23 23 #include <linux/io.h> 24 24 #include <linux/smsc911x.h> 25 25 #include <linux/usb/msm_hsusb.h> 26 + #include <linux/clkdev.h> 26 27 27 28 #include <asm/mach-types.h> 28 29 #include <asm/mach/arch.h> ··· 37 36 38 37 #include <mach/vreg.h> 39 38 #include "devices.h" 39 + #include "gpiomux.h" 40 40 #include "proc_comm.h" 41 41 42 42 extern struct sys_timer msm_timer; ··· 52 50 .phy_init_seq = hsusb_phy_init_seq, 53 51 .mode = USB_PERIPHERAL, 54 52 .otg_control = OTG_PHY_CONTROL, 53 + }; 54 + 55 + struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { 56 + #ifdef CONFIG_SERIAL_MSM_CONSOLE 57 + [49] = { /* UART2 RFR */ 58 + .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 59 + GPIOMUX_FUNC_2 | GPIOMUX_VALID, 60 + }, 61 + [50] = { /* UART2 CTS */ 62 + .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 63 + GPIOMUX_FUNC_2 | GPIOMUX_VALID, 64 + }, 65 + [51] = { /* UART2 RX */ 66 + .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 67 + GPIOMUX_FUNC_2 | GPIOMUX_VALID, 68 + }, 69 + [52] = { /* UART2 TX */ 70 + .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 71 + GPIOMUX_FUNC_2 | GPIOMUX_VALID, 72 + }, 73 + #endif 55 74 }; 56 75 57 76 static struct platform_device *devices[] __initdata = { ··· 106 83 } 107 84 108 85 MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF") 109 - #ifdef CONFIG_MSM_DEBUG_UART 110 - #endif 111 86 .boot_params = PLAT_PHYS_OFFSET + 0x100, 112 87 .map_io = msm7x30_map_io, 113 88 .init_irq = msm7x30_init_irq, ··· 114 93 MACHINE_END 115 94 116 95 MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") 117 - #ifdef CONFIG_MSM_DEBUG_UART 118 - #endif 119 96 .boot_params = PLAT_PHYS_OFFSET + 0x100, 120 97 .map_io = msm7x30_map_io, 121 98 .init_irq = msm7x30_init_irq, ··· 122 103 MACHINE_END 123 104 124 105 MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") 125 - #ifdef CONFIG_MSM_DEBUG_UART 126 - #endif 127 106 .boot_params = PLAT_PHYS_OFFSET + 0x100, 128 107 .map_io = msm7x30_map_io, 129 108 .init_irq = msm7x30_init_irq,
+91
arch/arm/mach-msm/board-msm8960.c
··· 1 + /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. 2 + * 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 6 + * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 11 + * 12 + * You should have received a copy of the GNU General Public License 13 + * along with this program; if not, write to the Free Software 14 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 + * 02110-1301, USA. 16 + * 17 + */ 18 + #include <linux/kernel.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/io.h> 21 + #include <linux/irq.h> 22 + #include <linux/clkdev.h> 23 + 24 + #include <asm/mach-types.h> 25 + #include <asm/mach/arch.h> 26 + #include <asm/hardware/gic.h> 27 + 28 + #include <mach/board.h> 29 + #include <mach/msm_iomap.h> 30 + 31 + #include "devices.h" 32 + 33 + static void __init msm8960_map_io(void) 34 + { 35 + msm_map_msm8960_io(); 36 + } 37 + 38 + static void __init msm8960_init_irq(void) 39 + { 40 + unsigned int i; 41 + gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, 42 + (void *)MSM_QGIC_CPU_BASE); 43 + 44 + /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ 45 + writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); 46 + 47 + if (machine_is_msm8960_rumi3()) 48 + writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); 49 + 50 + /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet 51 + * as they are configured as level, which does not play nice with 52 + * handle_percpu_irq. 53 + */ 54 + for (i = GIC_PPI_START; i < GIC_SPI_START; i++) { 55 + if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE) 56 + set_irq_handler(i, handle_percpu_irq); 57 + } 58 + } 59 + 60 + static struct platform_device *sim_devices[] __initdata = { 61 + &msm8960_device_uart_gsbi2, 62 + }; 63 + 64 + static struct platform_device *rumi3_devices[] __initdata = { 65 + &msm8960_device_uart_gsbi5, 66 + }; 67 + 68 + static void __init msm8960_sim_init(void) 69 + { 70 + platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices)); 71 + } 72 + 73 + static void __init msm8960_rumi3_init(void) 74 + { 75 + platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices)); 76 + } 77 + 78 + MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR") 79 + .map_io = msm8960_map_io, 80 + .init_irq = msm8960_init_irq, 81 + .timer = &msm_timer, 82 + .init_machine = msm8960_sim_init, 83 + MACHINE_END 84 + 85 + MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3") 86 + .map_io = msm8960_map_io, 87 + .init_irq = msm8960_init_irq, 88 + .timer = &msm_timer, 89 + .init_machine = msm8960_rumi3_init, 90 + MACHINE_END 91 +
-4
arch/arm/mach-msm/board-msm8x60.c
··· 28 28 #include <mach/board.h> 29 29 #include <mach/msm_iomap.h> 30 30 31 - unsigned long clk_get_max_axi_khz(void) 32 - { 33 - return 0; 34 - } 35 31 36 32 static void __init msm8x60_map_io(void) 37 33 {
+81 -5
arch/arm/mach-msm/board-qsd8x50.c
··· 1 - /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. 1 + /* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved. 2 2 * 3 3 * This program is free software; you can redistribute it and/or modify 4 4 * it under the terms of the GNU General Public License version 2 and ··· 21 21 #include <linux/platform_device.h> 22 22 #include <linux/delay.h> 23 23 #include <linux/usb/msm_hsusb.h> 24 + #include <linux/err.h> 25 + #include <linux/clkdev.h> 24 26 25 27 #include <asm/mach-types.h> 26 28 #include <asm/mach/arch.h> ··· 33 31 #include <mach/irqs.h> 34 32 #include <mach/sirc.h> 35 33 #include <mach/gpio.h> 34 + #include <mach/vreg.h> 35 + #include <mach/mmc.h> 36 36 37 37 #include "devices.h" 38 38 ··· 99 95 &msm_device_hsusb_host, 100 96 }; 101 97 98 + static struct msm_mmc_gpio sdc1_gpio_cfg[] = { 99 + {51, "sdc1_dat_3"}, 100 + {52, "sdc1_dat_2"}, 101 + {53, "sdc1_dat_1"}, 102 + {54, "sdc1_dat_0"}, 103 + {55, "sdc1_cmd"}, 104 + {56, "sdc1_clk"} 105 + }; 106 + 107 + static struct vreg *vreg_mmc; 108 + static unsigned long vreg_sts; 109 + 110 + static uint32_t msm_sdcc_setup_power(struct device *dv, unsigned int vdd) 111 + { 112 + int rc = 0; 113 + struct platform_device *pdev; 114 + 115 + pdev = container_of(dv, struct platform_device, dev); 116 + 117 + if (vdd == 0) { 118 + if (!vreg_sts) 119 + return 0; 120 + 121 + clear_bit(pdev->id, &vreg_sts); 122 + 123 + if (!vreg_sts) { 124 + rc = vreg_disable(vreg_mmc); 125 + if (rc) 126 + pr_err("vreg_mmc disable failed for slot " 127 + "%d: %d\n", pdev->id, rc); 128 + } 129 + return 0; 130 + } 131 + 132 + if (!vreg_sts) { 133 + rc = vreg_set_level(vreg_mmc, 2900); 134 + if (rc) 135 + pr_err("vreg_mmc set level failed for slot %d: %d\n", 136 + pdev->id, rc); 137 + rc = vreg_enable(vreg_mmc); 138 + if (rc) 139 + pr_err("vreg_mmc enable failed for slot %d: %d\n", 140 + pdev->id, rc); 141 + } 142 + set_bit(pdev->id, &vreg_sts); 143 + return 0; 144 + } 145 + 146 + static struct msm_mmc_gpio_data sdc1_gpio = { 147 + .gpio = sdc1_gpio_cfg, 148 + .size = ARRAY_SIZE(sdc1_gpio_cfg), 149 + }; 150 + 151 + static struct msm_mmc_platform_data qsd8x50_sdc1_data = { 152 + .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, 153 + .translate_vdd = msm_sdcc_setup_power, 154 + .gpio_data = &sdc1_gpio, 155 + }; 156 + 157 + static void __init qsd8x50_init_mmc(void) 158 + { 159 + if (machine_is_qsd8x50_ffa() || machine_is_qsd8x50a_ffa()) 160 + vreg_mmc = vreg_get(NULL, "gp6"); 161 + else 162 + vreg_mmc = vreg_get(NULL, "gp5"); 163 + 164 + if (IS_ERR(vreg_mmc)) { 165 + pr_err("vreg get for vreg_mmc failed (%ld)\n", 166 + PTR_ERR(vreg_mmc)); 167 + return; 168 + } 169 + 170 + msm_add_sdcc(1, &qsd8x50_sdc1_data, 0, 0); 171 + } 172 + 102 173 static void __init qsd8x50_map_io(void) 103 174 { 104 175 msm_map_qsd8x50_io(); ··· 192 113 msm_device_hsusb.dev.parent = &msm_device_otg.dev; 193 114 msm_device_hsusb_host.dev.parent = &msm_device_otg.dev; 194 115 platform_add_devices(devices, ARRAY_SIZE(devices)); 116 + qsd8x50_init_mmc(); 195 117 } 196 118 197 119 MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF") 198 - #ifdef CONFIG_MSM_DEBUG_UART 199 - #endif 200 120 .boot_params = PLAT_PHYS_OFFSET + 0x100, 201 121 .map_io = qsd8x50_map_io, 202 122 .init_irq = qsd8x50_init_irq, ··· 204 126 MACHINE_END 205 127 206 128 MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") 207 - #ifdef CONFIG_MSM_DEBUG_UART 208 - #endif 209 129 .boot_params = PLAT_PHYS_OFFSET + 0x100, 210 130 .map_io = qsd8x50_map_io, 211 131 .init_irq = qsd8x50_init_irq,
-2
arch/arm/mach-msm/board-sapphire.c
··· 105 105 106 106 MACHINE_START(SAPPHIRE, "sapphire") 107 107 /* Maintainer: Brian Swetland <swetland@google.com> */ 108 - #ifdef CONFIG_MSM_DEBUG_UART 109 - #endif 110 108 .boot_params = PLAT_PHYS_OFFSET + 0x100, 111 109 .fixup = sapphire_fixup, 112 110 .map_io = sapphire_map_io,
-2
arch/arm/mach-msm/board-trout-gpio.c
··· 74 74 75 75 static int trout_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 76 76 { 77 - struct msm_gpio_chip *msm_gpio = to_msm_gpio_chip(chip); 78 - 79 77 return TROUT_GPIO_TO_INT(offset + chip->base); 80 78 } 81 79
+1 -2
arch/arm/mach-msm/board-trout.c
··· 17 17 #include <linux/kernel.h> 18 18 #include <linux/init.h> 19 19 #include <linux/platform_device.h> 20 + #include <linux/clkdev.h> 20 21 21 22 #include <asm/mach-types.h> 22 23 #include <asm/mach/arch.h> ··· 93 92 } 94 93 95 94 MACHINE_START(TROUT, "HTC Dream") 96 - #ifdef CONFIG_MSM_DEBUG_UART 97 - #endif 98 95 .boot_params = 0x10000100, 99 96 .fixup = trout_fixup, 100 97 .map_io = trout_map_io,
+24 -37
arch/arm/mach-msm/clock-7x30.h
··· 1 1 /* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 - * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 28 11 */ 29 12 30 13 #ifndef __ARCH_ARM_MACH_MSM_CLOCK_7X30_H ··· 130 147 extern int internal_pwr_rail_ctl_auto(unsigned rail_id, bool enable); 131 148 132 149 #define CLK_7X30(clk_name, clk_id, clk_dev, clk_flags) { \ 133 - .name = clk_name, \ 134 - .id = L_7X30_##clk_id, \ 135 - .remote_id = P_##clk_id, \ 136 - .flags = clk_flags, \ 137 - .dev = clk_dev, \ 138 - .dbg_name = #clk_id, \ 150 + .con_id = clk_name, \ 151 + .dev_id = clk_dev, \ 152 + .clk = &(struct clk){ \ 153 + .id = L_7X30_##clk_id, \ 154 + .remote_id = P_##clk_id, \ 155 + .flags = clk_flags, \ 156 + .dbg_name = #clk_id, \ 157 + }, \ 139 158 } 140 159 141 160 #define CLK_7X30S(clk_name, l_id, r_id, clk_dev, clk_flags) { \ 142 - .name = clk_name, \ 143 - .id = L_7X30_##l_id, \ 144 - .remote_id = P_##r_id, \ 145 - .flags = clk_flags, \ 146 - .dev = clk_dev, \ 147 - .dbg_name = #l_id, \ 161 + .con_id = clk_name, \ 162 + .dev_id = clk_dev, \ 163 + .clk = &(struct clk){ \ 164 + .id = L_7X30_##l_id, \ 165 + .remote_id = P_##r_id, \ 166 + .flags = clk_flags, \ 167 + .dbg_name = #l_id, \ 168 + .ops = &clk_ops_pcom, \ 169 + }, \ 148 170 } 149 171 150 172 #endif 151 -
+130
arch/arm/mach-msm/clock-debug.c
··· 1 + /* 2 + * Copyright (C) 2007 Google, Inc. 3 + * Copyright (c) 2007-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/module.h> 18 + #include <linux/ctype.h> 19 + #include <linux/debugfs.h> 20 + #include <linux/clk.h> 21 + #include "clock.h" 22 + 23 + static int clock_debug_rate_set(void *data, u64 val) 24 + { 25 + struct clk *clock = data; 26 + int ret; 27 + 28 + /* Only increases to max rate will succeed, but that's actually good 29 + * for debugging purposes so we don't check for error. */ 30 + if (clock->flags & CLK_MAX) 31 + clk_set_max_rate(clock, val); 32 + if (clock->flags & CLK_MIN) 33 + ret = clk_set_min_rate(clock, val); 34 + else 35 + ret = clk_set_rate(clock, val); 36 + if (ret != 0) 37 + printk(KERN_ERR "clk_set%s_rate failed (%d)\n", 38 + (clock->flags & CLK_MIN) ? "_min" : "", ret); 39 + return ret; 40 + } 41 + 42 + static int clock_debug_rate_get(void *data, u64 *val) 43 + { 44 + struct clk *clock = data; 45 + *val = clk_get_rate(clock); 46 + return 0; 47 + } 48 + 49 + DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_debug_rate_get, 50 + clock_debug_rate_set, "%llu\n"); 51 + 52 + static int clock_debug_enable_set(void *data, u64 val) 53 + { 54 + struct clk *clock = data; 55 + int rc = 0; 56 + 57 + if (val) 58 + rc = clock->ops->enable(clock->id); 59 + else 60 + clock->ops->disable(clock->id); 61 + 62 + return rc; 63 + } 64 + 65 + static int clock_debug_enable_get(void *data, u64 *val) 66 + { 67 + struct clk *clock = data; 68 + 69 + *val = clock->ops->is_enabled(clock->id); 70 + 71 + return 0; 72 + } 73 + 74 + DEFINE_SIMPLE_ATTRIBUTE(clock_enable_fops, clock_debug_enable_get, 75 + clock_debug_enable_set, "%llu\n"); 76 + 77 + static int clock_debug_local_get(void *data, u64 *val) 78 + { 79 + struct clk *clock = data; 80 + 81 + *val = clock->ops->is_local(clock->id); 82 + 83 + return 0; 84 + } 85 + 86 + DEFINE_SIMPLE_ATTRIBUTE(clock_local_fops, clock_debug_local_get, 87 + NULL, "%llu\n"); 88 + 89 + static struct dentry *debugfs_base; 90 + 91 + int __init clock_debug_init(void) 92 + { 93 + debugfs_base = debugfs_create_dir("clk", NULL); 94 + if (!debugfs_base) 95 + return -ENOMEM; 96 + return 0; 97 + } 98 + 99 + int __init clock_debug_add(struct clk *clock) 100 + { 101 + char temp[50], *ptr; 102 + struct dentry *clk_dir; 103 + 104 + if (!debugfs_base) 105 + return -ENOMEM; 106 + 107 + strncpy(temp, clock->dbg_name, ARRAY_SIZE(temp)-1); 108 + for (ptr = temp; *ptr; ptr++) 109 + *ptr = tolower(*ptr); 110 + 111 + clk_dir = debugfs_create_dir(temp, debugfs_base); 112 + if (!clk_dir) 113 + return -ENOMEM; 114 + 115 + if (!debugfs_create_file("rate", S_IRUGO | S_IWUSR, clk_dir, 116 + clock, &clock_rate_fops)) 117 + goto error; 118 + 119 + if (!debugfs_create_file("enable", S_IRUGO | S_IWUSR, clk_dir, 120 + clock, &clock_enable_fops)) 121 + goto error; 122 + 123 + if (!debugfs_create_file("is_local", S_IRUGO, clk_dir, clock, 124 + &clock_local_fops)) 125 + goto error; 126 + return 0; 127 + error: 128 + debugfs_remove_recursive(clk_dir); 129 + return -ENOMEM; 130 + }
-54
arch/arm/mach-msm/clock-dummy.c
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 2 - * 3 - * This program is free software; you can redistribute it and/or modify 4 - * it under the terms of the GNU General Public License version 2 and 5 - * only version 2 as published by the Free Software Foundation. 6 - * 7 - * This program is distributed in the hope that it will be useful, 8 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 - * GNU General Public License for more details. 11 - * 12 - * You should have received a copy of the GNU General Public License 13 - * along with this program; if not, write to the Free Software 14 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 - * 02110-1301, USA. 16 - * 17 - */ 18 - #include <linux/clk.h> 19 - #include <linux/err.h> 20 - #include <linux/module.h> 21 - 22 - struct clk *clk_get(struct device *dev, const char *id) 23 - { 24 - return ERR_PTR(-ENOENT); 25 - } 26 - EXPORT_SYMBOL(clk_get); 27 - 28 - int clk_enable(struct clk *clk) 29 - { 30 - return -ENOENT; 31 - } 32 - EXPORT_SYMBOL(clk_enable); 33 - 34 - void clk_disable(struct clk *clk) 35 - { 36 - } 37 - EXPORT_SYMBOL(clk_disable); 38 - 39 - unsigned long clk_get_rate(struct clk *clk) 40 - { 41 - return 0; 42 - } 43 - EXPORT_SYMBOL(clk_get_rate); 44 - 45 - int clk_set_rate(struct clk *clk, unsigned long rate) 46 - { 47 - return -ENOENT; 48 - } 49 - EXPORT_SYMBOL(clk_set_rate); 50 - 51 - void clk_put(struct clk *clk) 52 - { 53 - } 54 - EXPORT_SYMBOL(clk_put);
+7
arch/arm/mach-msm/clock-pcom.c
··· 20 20 21 21 #include "proc_comm.h" 22 22 #include "clock.h" 23 + #include "clock-pcom.h" 23 24 24 25 /* 25 26 * glue for the proc_comm interface ··· 117 116 return rate; 118 117 } 119 118 119 + static bool pc_clk_is_local(unsigned id) 120 + { 121 + return false; 122 + } 123 + 120 124 struct clk_ops clk_ops_pcom = { 121 125 .enable = pc_clk_enable, 122 126 .disable = pc_clk_disable, ··· 134 128 .get_rate = pc_clk_get_rate, 135 129 .is_enabled = pc_clk_is_enabled, 136 130 .round_rate = pc_clk_round_rate, 131 + .is_local = pc_clk_is_local, 137 132 };
+19 -32
arch/arm/mach-msm/clock-pcom.h
··· 1 1 /* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 - * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 28 11 */ 29 12 30 13 #ifndef __ARCH_ARM_MACH_MSM_CLOCK_PCOM_H ··· 115 132 #define P_CSI1_P_CLK 97 116 133 #define P_GSBI_CLK 98 117 134 #define P_GSBI_P_CLK 99 135 + #define P_CE_CLK 100 /* Crypto engine */ 136 + #define P_CODEC_SSBI_CLK 101 118 137 119 - #define P_NR_CLKS 100 138 + #define P_NR_CLKS 102 120 139 121 140 struct clk_ops; 122 141 extern struct clk_ops clk_ops_pcom; ··· 126 141 int pc_clk_reset(unsigned id, enum clk_reset_action action); 127 142 128 143 #define CLK_PCOM(clk_name, clk_id, clk_dev, clk_flags) { \ 129 - .name = clk_name, \ 130 - .id = P_##clk_id, \ 131 - .remote_id = P_##clk_id, \ 132 - .ops = &clk_ops_pcom, \ 133 - .flags = clk_flags, \ 134 - .dev = clk_dev, \ 135 - .dbg_name = #clk_id, \ 144 + .con_id = clk_name, \ 145 + .dev_id = clk_dev, \ 146 + .clk = &(struct clk){ \ 147 + .id = P_##clk_id, \ 148 + .remote_id = P_##clk_id, \ 149 + .ops = &clk_ops_pcom, \ 150 + .flags = clk_flags, \ 151 + .dbg_name = #clk_id, \ 152 + }, \ 136 153 } 137 154 138 155 #endif
+13 -179
arch/arm/mach-msm/clock.c
··· 15 15 */ 16 16 17 17 #include <linux/kernel.h> 18 - #include <linux/init.h> 19 - #include <linux/module.h> 20 18 #include <linux/list.h> 21 19 #include <linux/err.h> 22 - #include <linux/clk.h> 23 20 #include <linux/spinlock.h> 24 - #include <linux/debugfs.h> 25 - #include <linux/ctype.h> 26 21 #include <linux/pm_qos_params.h> 27 - #include <mach/clk.h> 22 + #include <linux/mutex.h> 23 + #include <linux/clk.h> 24 + #include <linux/string.h> 25 + #include <linux/module.h> 26 + #include <linux/clkdev.h> 28 27 29 28 #include "clock.h" 30 - #include "proc_comm.h" 31 - #include "clock-7x30.h" 32 29 33 30 static DEFINE_MUTEX(clocks_mutex); 34 31 static DEFINE_SPINLOCK(clocks_lock); 35 32 static LIST_HEAD(clocks); 36 - struct clk *msm_clocks; 37 - unsigned msm_num_clocks; 38 - 39 - /* 40 - * Bitmap of enabled clocks, excluding ACPU which is always 41 - * enabled 42 - */ 43 - static DECLARE_BITMAP(clock_map_enabled, NR_CLKS); 44 - static DEFINE_SPINLOCK(clock_map_lock); 45 33 46 34 /* 47 35 * Standard clock functions defined in include/linux/clk.h 48 36 */ 49 - struct clk *clk_get(struct device *dev, const char *id) 50 - { 51 - struct clk *clk; 52 - 53 - mutex_lock(&clocks_mutex); 54 - 55 - list_for_each_entry(clk, &clocks, list) 56 - if (!strcmp(id, clk->name) && clk->dev == dev) 57 - goto found_it; 58 - 59 - list_for_each_entry(clk, &clocks, list) 60 - if (!strcmp(id, clk->name) && clk->dev == NULL) 61 - goto found_it; 62 - 63 - clk = ERR_PTR(-ENOENT); 64 - found_it: 65 - mutex_unlock(&clocks_mutex); 66 - return clk; 67 - } 68 - EXPORT_SYMBOL(clk_get); 69 - 70 - void clk_put(struct clk *clk) 71 - { 72 - } 73 - EXPORT_SYMBOL(clk_put); 74 - 75 37 int clk_enable(struct clk *clk) 76 38 { 77 39 unsigned long flags; 78 40 spin_lock_irqsave(&clocks_lock, flags); 79 41 clk->count++; 80 - if (clk->count == 1) { 42 + if (clk->count == 1) 81 43 clk->ops->enable(clk->id); 82 - spin_lock(&clock_map_lock); 83 - clock_map_enabled[BIT_WORD(clk->id)] |= BIT_MASK(clk->id); 84 - spin_unlock(&clock_map_lock); 85 - } 86 44 spin_unlock_irqrestore(&clocks_lock, flags); 87 45 return 0; 88 46 } ··· 52 94 spin_lock_irqsave(&clocks_lock, flags); 53 95 BUG_ON(clk->count == 0); 54 96 clk->count--; 55 - if (clk->count == 0) { 97 + if (clk->count == 0) 56 98 clk->ops->disable(clk->id); 57 - spin_lock(&clock_map_lock); 58 - clock_map_enabled[BIT_WORD(clk->id)] &= ~BIT_MASK(clk->id); 59 - spin_unlock(&clock_map_lock); 60 - } 61 99 spin_unlock_irqrestore(&clocks_lock, flags); 62 100 } 63 101 EXPORT_SYMBOL(clk_disable); 64 102 65 103 int clk_reset(struct clk *clk, enum clk_reset_action action) 66 104 { 67 - if (!clk->ops->reset) 68 - clk->ops->reset = &pc_clk_reset; 69 105 return clk->ops->reset(clk->remote_id, action); 70 106 } 71 107 EXPORT_SYMBOL(clk_reset); ··· 136 184 */ 137 185 static struct clk *ebi1_clk; 138 186 139 - static void __init set_clock_ops(struct clk *clk) 140 - { 141 - if (!clk->ops) { 142 - clk->ops = &clk_ops_pcom; 143 - clk->id = clk->remote_id; 144 - } 145 - } 146 - 147 - void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks) 187 + void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks) 148 188 { 149 189 unsigned n; 150 190 151 - spin_lock_init(&clocks_lock); 152 191 mutex_lock(&clocks_mutex); 153 - msm_clocks = clock_tbl; 154 - msm_num_clocks = num_clocks; 155 - for (n = 0; n < msm_num_clocks; n++) { 156 - set_clock_ops(&msm_clocks[n]); 157 - list_add_tail(&msm_clocks[n].list, &clocks); 192 + for (n = 0; n < num_clocks; n++) { 193 + clkdev_add(&clock_tbl[n]); 194 + list_add_tail(&clock_tbl[n].clk->list, &clocks); 158 195 } 159 196 mutex_unlock(&clocks_mutex); 160 197 ··· 151 210 BUG_ON(ebi1_clk == NULL); 152 211 153 212 } 154 - 155 - #if defined(CONFIG_DEBUG_FS) 156 - static struct clk *msm_clock_get_nth(unsigned index) 157 - { 158 - if (index < msm_num_clocks) 159 - return msm_clocks + index; 160 - else 161 - return 0; 162 - } 163 - 164 - static int clock_debug_rate_set(void *data, u64 val) 165 - { 166 - struct clk *clock = data; 167 - int ret; 168 - 169 - /* Only increases to max rate will succeed, but that's actually good 170 - * for debugging purposes. So we don't check for error. */ 171 - if (clock->flags & CLK_MAX) 172 - clk_set_max_rate(clock, val); 173 - if (clock->flags & CLK_MIN) 174 - ret = clk_set_min_rate(clock, val); 175 - else 176 - ret = clk_set_rate(clock, val); 177 - if (ret != 0) 178 - printk(KERN_ERR "clk_set%s_rate failed (%d)\n", 179 - (clock->flags & CLK_MIN) ? "_min" : "", ret); 180 - return ret; 181 - } 182 - 183 - static int clock_debug_rate_get(void *data, u64 *val) 184 - { 185 - struct clk *clock = data; 186 - *val = clk_get_rate(clock); 187 - return 0; 188 - } 189 - 190 - static int clock_debug_enable_set(void *data, u64 val) 191 - { 192 - struct clk *clock = data; 193 - int rc = 0; 194 - 195 - if (val) 196 - rc = clock->ops->enable(clock->id); 197 - else 198 - clock->ops->disable(clock->id); 199 - 200 - return rc; 201 - } 202 - 203 - static int clock_debug_enable_get(void *data, u64 *val) 204 - { 205 - struct clk *clock = data; 206 - 207 - *val = clock->ops->is_enabled(clock->id); 208 - 209 - return 0; 210 - } 211 - 212 - static int clock_debug_local_get(void *data, u64 *val) 213 - { 214 - struct clk *clock = data; 215 - 216 - *val = clock->ops != &clk_ops_pcom; 217 - 218 - return 0; 219 - } 220 - 221 - DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_debug_rate_get, 222 - clock_debug_rate_set, "%llu\n"); 223 - DEFINE_SIMPLE_ATTRIBUTE(clock_enable_fops, clock_debug_enable_get, 224 - clock_debug_enable_set, "%llu\n"); 225 - DEFINE_SIMPLE_ATTRIBUTE(clock_local_fops, clock_debug_local_get, 226 - NULL, "%llu\n"); 227 - 228 - static int __init clock_debug_init(void) 229 - { 230 - struct dentry *dent_rate, *dent_enable, *dent_local; 231 - struct clk *clock; 232 - unsigned n = 0; 233 - char temp[50], *ptr; 234 - 235 - dent_rate = debugfs_create_dir("clk_rate", 0); 236 - if (IS_ERR(dent_rate)) 237 - return PTR_ERR(dent_rate); 238 - 239 - dent_enable = debugfs_create_dir("clk_enable", 0); 240 - if (IS_ERR(dent_enable)) 241 - return PTR_ERR(dent_enable); 242 - 243 - dent_local = debugfs_create_dir("clk_local", NULL); 244 - if (IS_ERR(dent_local)) 245 - return PTR_ERR(dent_local); 246 - 247 - while ((clock = msm_clock_get_nth(n++)) != 0) { 248 - strncpy(temp, clock->dbg_name, ARRAY_SIZE(temp)-1); 249 - for (ptr = temp; *ptr; ptr++) 250 - *ptr = tolower(*ptr); 251 - debugfs_create_file(temp, 0644, dent_rate, 252 - clock, &clock_rate_fops); 253 - debugfs_create_file(temp, 0644, dent_enable, 254 - clock, &clock_enable_fops); 255 - debugfs_create_file(temp, S_IRUGO, dent_local, 256 - clock, &clock_local_fops); 257 - } 258 - return 0; 259 - } 260 - 261 - device_initcall(clock_debug_init); 262 - #endif 263 213 264 214 /* The bootloader and/or AMSS may have left various clocks enabled. 265 215 * Disable any clocks that belong to us (CLKFLAG_AUTO_OFF) but have ··· 162 330 struct clk *clk; 163 331 unsigned count = 0; 164 332 333 + clock_debug_init(); 165 334 mutex_lock(&clocks_mutex); 166 335 list_for_each_entry(clk, &clocks, list) { 336 + clock_debug_add(clk); 167 337 if (clk->flags & CLKFLAG_AUTO_OFF) { 168 338 spin_lock_irqsave(&clocks_lock, flags); 169 339 if (!clk->count) {
+9 -46
arch/arm/mach-msm/clock.h
··· 17 17 #ifndef __ARCH_ARM_MACH_MSM_CLOCK_H 18 18 #define __ARCH_ARM_MACH_MSM_CLOCK_H 19 19 20 + #include <linux/init.h> 20 21 #include <linux/list.h> 21 22 #include <mach/clk.h> 22 - 23 - #include "clock-pcom.h" 24 - #include "clock-7x30.h" 25 23 26 24 #define CLKFLAG_INVERT 0x00000001 27 25 #define CLKFLAG_NOINVERT 0x00000002 ··· 43 45 unsigned (*get_rate)(unsigned id); 44 46 unsigned (*is_enabled)(unsigned id); 45 47 long (*round_rate)(unsigned id, unsigned rate); 48 + bool (*is_local)(unsigned id); 46 49 }; 47 50 48 51 struct clk { ··· 51 52 uint32_t remote_id; 52 53 uint32_t count; 53 54 uint32_t flags; 54 - const char *name; 55 55 struct clk_ops *ops; 56 56 const char *dbg_name; 57 57 struct list_head list; 58 - struct device *dev; 59 58 }; 60 - 61 - #define A11S_CLK_CNTL_ADDR (MSM_CSR_BASE + 0x100) 62 - #define A11S_CLK_SEL_ADDR (MSM_CSR_BASE + 0x104) 63 - #define A11S_VDD_SVS_PLEVEL_ADDR (MSM_CSR_BASE + 0x124) 64 - 65 - #ifdef CONFIG_DEBUG_FS 66 - #define CLOCK_DBG_NAME(x) .dbg_name = x, 67 - #else 68 - #define CLOCK_DBG_NAME(x) 69 - #endif 70 - 71 - #define CLOCK(clk_name, clk_id, clk_dev, clk_flags) { \ 72 - .name = clk_name, \ 73 - .id = clk_id, \ 74 - .flags = clk_flags, \ 75 - .dev = clk_dev, \ 76 - CLOCK_DBG_NAME(#clk_id) \ 77 - } 78 59 79 60 #define OFF CLKFLAG_AUTO_OFF 80 61 #define CLK_MIN CLKFLAG_MIN 81 62 #define CLK_MAX CLKFLAG_MAX 82 63 #define CLK_MINMAX (CLK_MIN | CLK_MAX) 83 - #define NR_CLKS P_NR_CLKS 84 64 85 - enum { 86 - PLL_0 = 0, 87 - PLL_1, 88 - PLL_2, 89 - PLL_3, 90 - PLL_4, 91 - PLL_5, 92 - PLL_6, 93 - NUM_PLL 94 - }; 95 - 96 - enum clkvote_client { 97 - CLKVOTE_ACPUCLK = 0, 98 - CLKVOTE_PMQOS, 99 - CLKVOTE_MAX, 100 - }; 101 - 102 - int msm_clock_require_tcxo(unsigned long *reason, int nbits); 103 - int msm_clock_get_name(uint32_t id, char *name, uint32_t size); 104 - int ebi1_clk_set_min_rate(enum clkvote_client client, unsigned long rate); 105 - unsigned long clk_get_max_axi_khz(void); 106 - 65 + #ifdef CONFIG_DEBUG_FS 66 + int __init clock_debug_init(void); 67 + int __init clock_debug_add(struct clk *clock); 68 + #else 69 + static inline int __init clock_debug_init(void) { return 0; } 70 + static inline int __init clock_debug_add(struct clk *clock) { return 0; } 107 71 #endif 108 72 73 + #endif
+20 -16
arch/arm/mach-msm/devices-msm7x00.c
··· 15 15 16 16 #include <linux/kernel.h> 17 17 #include <linux/platform_device.h> 18 + #include <linux/clkdev.h> 18 19 19 20 #include <mach/irqs.h> 20 21 #include <mach/msm_iomap.h> ··· 25 24 #include <linux/mtd/nand.h> 26 25 #include <linux/mtd/partitions.h> 27 26 28 - 29 27 #include "clock.h" 28 + #include "clock-pcom.h" 30 29 #include <mach/mmc.h> 31 30 32 31 static struct resource resources_uart1[] = { ··· 39 38 .start = MSM_UART1_PHYS, 40 39 .end = MSM_UART1_PHYS + MSM_UART1_SIZE - 1, 41 40 .flags = IORESOURCE_MEM, 41 + .name = "uart_resource" 42 42 }, 43 43 }; 44 44 ··· 53 51 .start = MSM_UART2_PHYS, 54 52 .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1, 55 53 .flags = IORESOURCE_MEM, 54 + .name = "uart_resource" 56 55 }, 57 56 }; 58 57 ··· 67 64 .start = MSM_UART3_PHYS, 68 65 .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, 69 66 .flags = IORESOURCE_MEM, 67 + .name = "uart_resource" 70 68 }, 71 69 }; 72 70 ··· 418 414 .resource = resources_mdp, 419 415 }; 420 416 421 - struct clk msm_clocks_7x01a[] = { 417 + struct clk_lookup msm_clocks_7x01a[] = { 422 418 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), 423 419 CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), 424 420 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, 0), ··· 427 423 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF), 428 424 CLK_PCOM("gp_clk", GP_CLK, NULL, 0), 429 425 CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, OFF), 430 - CLK_PCOM("i2c_clk", I2C_CLK, &msm_device_i2c.dev, 0), 426 + CLK_PCOM("i2c_clk", I2C_CLK, "msm_i2c.0", 0), 431 427 CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), 432 428 CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), 433 429 CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), ··· 437 433 CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), 438 434 CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX), 439 435 CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), 440 - CLK_PCOM("sdc_clk", SDC1_CLK, &msm_device_sdc1.dev, OFF), 441 - CLK_PCOM("sdc_pclk", SDC1_P_CLK, &msm_device_sdc1.dev, OFF), 442 - CLK_PCOM("sdc_clk", SDC2_CLK, &msm_device_sdc2.dev, OFF), 443 - CLK_PCOM("sdc_pclk", SDC2_P_CLK, &msm_device_sdc2.dev, OFF), 444 - CLK_PCOM("sdc_clk", SDC3_CLK, &msm_device_sdc3.dev, OFF), 445 - CLK_PCOM("sdc_pclk", SDC3_P_CLK, &msm_device_sdc3.dev, OFF), 446 - CLK_PCOM("sdc_clk", SDC4_CLK, &msm_device_sdc4.dev, OFF), 447 - CLK_PCOM("sdc_pclk", SDC4_P_CLK, &msm_device_sdc4.dev, OFF), 436 + CLK_PCOM("sdc_clk", SDC1_CLK, "msm_sdcc.1", OFF), 437 + CLK_PCOM("sdc_pclk", SDC1_P_CLK, "msm_sdcc.1", OFF), 438 + CLK_PCOM("sdc_clk", SDC2_CLK, "msm_sdcc.2", OFF), 439 + CLK_PCOM("sdc_pclk", SDC2_P_CLK, "msm_sdcc.2", OFF), 440 + CLK_PCOM("sdc_clk", SDC3_CLK, "msm_sdcc.3", OFF), 441 + CLK_PCOM("sdc_pclk", SDC3_P_CLK, "msm_sdcc.3", OFF), 442 + CLK_PCOM("sdc_clk", SDC4_CLK, "msm_sdcc.4", OFF), 443 + CLK_PCOM("sdc_pclk", SDC4_P_CLK, "msm_sdcc.4", OFF), 448 444 CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), 449 445 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 450 446 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 451 447 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 452 - CLK_PCOM("uart_clk", UART1_CLK, &msm_device_uart1.dev, OFF), 453 - CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), 454 - CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), 448 + CLK_PCOM("uart_clk", UART1_CLK, "msm_serial.0", OFF), 449 + CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), 450 + CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), 455 451 CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF), 456 452 CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0), 457 - CLK_PCOM("usb_hs_clk", USB_HS_CLK, &msm_device_hsusb.dev, OFF), 458 - CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, &msm_device_hsusb.dev, OFF), 453 + CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF), 454 + CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, "msm_hsusb", OFF), 459 455 CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), 460 456 CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF ), 461 457 CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF),
+8 -3
arch/arm/mach-msm/devices-msm7x30.c
··· 1 1 /* 2 2 * Copyright (C) 2008 Google, Inc. 3 - * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 + * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. 4 4 * 5 5 * This software is licensed under the terms of the GNU General Public 6 6 * License version 2, as published by the Free Software Foundation, and ··· 17 17 #include <linux/platform_device.h> 18 18 19 19 #include <linux/dma-mapping.h> 20 + #include <linux/clkdev.h> 20 21 #include <mach/irqs.h> 21 22 #include <mach/msm_iomap.h> 22 23 #include <mach/dma.h> ··· 29 28 #include <asm/mach/flash.h> 30 29 31 30 #include "clock-pcom.h" 31 + #include "clock-7x30.h" 32 32 33 33 #include <mach/mmc.h> 34 34 ··· 43 41 .start = MSM_UART2_PHYS, 44 42 .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1, 45 43 .flags = IORESOURCE_MEM, 44 + .name = "uart_resource" 46 45 }, 47 46 }; 48 47 ··· 130 127 }, 131 128 }; 132 129 133 - struct clk msm_clocks_7x30[] = { 130 + struct clk_lookup msm_clocks_7x30[] = { 134 131 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), 135 132 CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), 136 133 CLK_PCOM("cam_m_clk", CAM_M_CLK, NULL, 0), 137 134 CLK_PCOM("camif_pad_pclk", CAMIF_PAD_P_CLK, NULL, OFF), 135 + CLK_PCOM("ce_clk", CE_CLK, NULL, 0), 136 + CLK_PCOM("codec_ssbi_clk", CODEC_SSBI_CLK, NULL, 0), 138 137 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), 139 138 CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0), 140 139 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX), ··· 182 177 CLK_7X30S("tv_src_clk", TV_CLK, TV_ENC_CLK, NULL, 0), 183 178 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 184 179 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 185 - CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), 180 + CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), 186 181 CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), 187 182 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 188 183 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF),
+85
arch/arm/mach-msm/devices-msm8960.c
··· 1 + /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. 2 + * 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 6 + * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 11 + * 12 + * You should have received a copy of the GNU General Public License 13 + * along with this program; if not, write to the Free Software 14 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 + * 02110-1301, USA. 16 + */ 17 + 18 + #include <linux/kernel.h> 19 + #include <linux/platform_device.h> 20 + 21 + #include <linux/dma-mapping.h> 22 + #include <mach/irqs-8960.h> 23 + #include <mach/board.h> 24 + 25 + #include "devices.h" 26 + 27 + #define MSM_GSBI2_PHYS 0x16100000 28 + #define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000) 29 + 30 + #define MSM_GSBI5_PHYS 0x16400000 31 + #define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000) 32 + 33 + static struct resource resources_uart_gsbi2[] = { 34 + { 35 + .start = GSBI2_UARTDM_IRQ, 36 + .end = GSBI2_UARTDM_IRQ, 37 + .flags = IORESOURCE_IRQ, 38 + }, 39 + { 40 + .start = MSM_UART2DM_PHYS, 41 + .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1, 42 + .name = "uart_resource", 43 + .flags = IORESOURCE_MEM, 44 + }, 45 + { 46 + .start = MSM_GSBI2_PHYS, 47 + .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1, 48 + .name = "gsbi_resource", 49 + .flags = IORESOURCE_MEM, 50 + }, 51 + }; 52 + 53 + struct platform_device msm8960_device_uart_gsbi2 = { 54 + .name = "msm_serial", 55 + .id = 0, 56 + .num_resources = ARRAY_SIZE(resources_uart_gsbi2), 57 + .resource = resources_uart_gsbi2, 58 + }; 59 + 60 + static struct resource resources_uart_gsbi5[] = { 61 + { 62 + .start = GSBI5_UARTDM_IRQ, 63 + .end = GSBI5_UARTDM_IRQ, 64 + .flags = IORESOURCE_IRQ, 65 + }, 66 + { 67 + .start = MSM_UART5DM_PHYS, 68 + .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1, 69 + .name = "uart_resource", 70 + .flags = IORESOURCE_MEM, 71 + }, 72 + { 73 + .start = MSM_GSBI5_PHYS, 74 + .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1, 75 + .name = "gsbi_resource", 76 + .flags = IORESOURCE_MEM, 77 + }, 78 + }; 79 + 80 + struct platform_device msm8960_device_uart_gsbi5 = { 81 + .name = "msm_serial", 82 + .id = 0, 83 + .num_resources = ARRAY_SIZE(resources_uart_gsbi5), 84 + .resource = resources_uart_gsbi5, 85 + };
+45 -40
arch/arm/mach-msm/devices-msm8x60-iommu.c arch/arm/mach-msm/devices-iommu.c
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1 + /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 2 2 * 3 3 * This program is free software; you can redistribute it and/or modify 4 4 * it under the terms of the GNU General Public License version 2 and ··· 18 18 #include <linux/kernel.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/bootmem.h> 21 - 22 - #include <mach/msm_iomap-8x60.h> 23 - #include <mach/irqs-8x60.h> 21 + #include <mach/irqs.h> 24 22 #include <mach/iommu.h> 25 23 26 24 static struct resource msm_iommu_jpegd_resources[] = { 27 25 { 28 - .start = MSM_IOMMU_JPEGD_PHYS, 29 - .end = MSM_IOMMU_JPEGD_PHYS + MSM_IOMMU_JPEGD_SIZE - 1, 26 + .start = 0x07300000, 27 + .end = 0x07300000 + SZ_1M - 1, 30 28 .name = "physbase", 31 29 .flags = IORESOURCE_MEM, 32 30 }, ··· 44 46 45 47 static struct resource msm_iommu_vpe_resources[] = { 46 48 { 47 - .start = MSM_IOMMU_VPE_PHYS, 48 - .end = MSM_IOMMU_VPE_PHYS + MSM_IOMMU_VPE_SIZE - 1, 49 + .start = 0x07400000, 50 + .end = 0x07400000 + SZ_1M - 1, 49 51 .name = "physbase", 50 52 .flags = IORESOURCE_MEM, 51 53 }, ··· 65 67 66 68 static struct resource msm_iommu_mdp0_resources[] = { 67 69 { 68 - .start = MSM_IOMMU_MDP0_PHYS, 69 - .end = MSM_IOMMU_MDP0_PHYS + MSM_IOMMU_MDP0_SIZE - 1, 70 + .start = 0x07500000, 71 + .end = 0x07500000 + SZ_1M - 1, 70 72 .name = "physbase", 71 73 .flags = IORESOURCE_MEM, 72 74 }, ··· 86 88 87 89 static struct resource msm_iommu_mdp1_resources[] = { 88 90 { 89 - .start = MSM_IOMMU_MDP1_PHYS, 90 - .end = MSM_IOMMU_MDP1_PHYS + MSM_IOMMU_MDP1_SIZE - 1, 91 + .start = 0x07600000, 92 + .end = 0x07600000 + SZ_1M - 1, 91 93 .name = "physbase", 92 94 .flags = IORESOURCE_MEM, 93 95 }, ··· 107 109 108 110 static struct resource msm_iommu_rot_resources[] = { 109 111 { 110 - .start = MSM_IOMMU_ROT_PHYS, 111 - .end = MSM_IOMMU_ROT_PHYS + MSM_IOMMU_ROT_SIZE - 1, 112 + .start = 0x07700000, 113 + .end = 0x07700000 + SZ_1M - 1, 112 114 .name = "physbase", 113 115 .flags = IORESOURCE_MEM, 114 116 }, ··· 128 130 129 131 static struct resource msm_iommu_ijpeg_resources[] = { 130 132 { 131 - .start = MSM_IOMMU_IJPEG_PHYS, 132 - .end = MSM_IOMMU_IJPEG_PHYS + MSM_IOMMU_IJPEG_SIZE - 1, 133 + .start = 0x07800000, 134 + .end = 0x07800000 + SZ_1M - 1, 133 135 .name = "physbase", 134 136 .flags = IORESOURCE_MEM, 135 137 }, ··· 149 151 150 152 static struct resource msm_iommu_vfe_resources[] = { 151 153 { 152 - .start = MSM_IOMMU_VFE_PHYS, 153 - .end = MSM_IOMMU_VFE_PHYS + MSM_IOMMU_VFE_SIZE - 1, 154 + .start = 0x07900000, 155 + .end = 0x07900000 + SZ_1M - 1, 154 156 .name = "physbase", 155 157 .flags = IORESOURCE_MEM, 156 158 }, ··· 170 172 171 173 static struct resource msm_iommu_vcodec_a_resources[] = { 172 174 { 173 - .start = MSM_IOMMU_VCODEC_A_PHYS, 174 - .end = MSM_IOMMU_VCODEC_A_PHYS + MSM_IOMMU_VCODEC_A_SIZE - 1, 175 + .start = 0x07A00000, 176 + .end = 0x07A00000 + SZ_1M - 1, 175 177 .name = "physbase", 176 178 .flags = IORESOURCE_MEM, 177 179 }, ··· 191 193 192 194 static struct resource msm_iommu_vcodec_b_resources[] = { 193 195 { 194 - .start = MSM_IOMMU_VCODEC_B_PHYS, 195 - .end = MSM_IOMMU_VCODEC_B_PHYS + MSM_IOMMU_VCODEC_B_SIZE - 1, 196 + .start = 0x07B00000, 197 + .end = 0x07B00000 + SZ_1M - 1, 196 198 .name = "physbase", 197 199 .flags = IORESOURCE_MEM, 198 200 }, ··· 212 214 213 215 static struct resource msm_iommu_gfx3d_resources[] = { 214 216 { 215 - .start = MSM_IOMMU_GFX3D_PHYS, 216 - .end = MSM_IOMMU_GFX3D_PHYS + MSM_IOMMU_GFX3D_SIZE - 1, 217 + .start = 0x07C00000, 218 + .end = 0x07C00000 + SZ_1M - 1, 217 219 .name = "physbase", 218 220 .flags = IORESOURCE_MEM, 219 221 }, ··· 233 235 234 236 static struct resource msm_iommu_gfx2d0_resources[] = { 235 237 { 236 - .start = MSM_IOMMU_GFX2D0_PHYS, 237 - .end = MSM_IOMMU_GFX2D0_PHYS + MSM_IOMMU_GFX2D0_SIZE - 1, 238 + .start = 0x07D00000, 239 + .end = 0x07D00000 + SZ_1M - 1, 238 240 .name = "physbase", 239 241 .flags = IORESOURCE_MEM, 240 242 }, ··· 254 256 255 257 static struct resource msm_iommu_gfx2d1_resources[] = { 256 258 { 257 - .start = MSM_IOMMU_GFX2D1_PHYS, 258 - .end = MSM_IOMMU_GFX2D1_PHYS + MSM_IOMMU_GFX2D1_SIZE - 1, 259 + .start = 0x07E00000, 260 + .end = 0x07E00000 + SZ_1M - 1, 259 261 .name = "physbase", 260 262 .flags = IORESOURCE_MEM, 261 263 }, ··· 280 282 281 283 static struct msm_iommu_dev jpegd_iommu = { 282 284 .name = "jpegd", 283 - .clk_rate = -1 285 + .ncb = 2, 284 286 }; 285 287 286 288 static struct msm_iommu_dev vpe_iommu = { 287 - .name = "vpe" 289 + .name = "vpe", 290 + .ncb = 2, 288 291 }; 289 292 290 293 static struct msm_iommu_dev mdp0_iommu = { 291 - .name = "mdp0" 294 + .name = "mdp0", 295 + .ncb = 2, 292 296 }; 293 297 294 298 static struct msm_iommu_dev mdp1_iommu = { 295 - .name = "mdp1" 299 + .name = "mdp1", 300 + .ncb = 2, 296 301 }; 297 302 298 303 static struct msm_iommu_dev rot_iommu = { 299 - .name = "rot" 304 + .name = "rot", 305 + .ncb = 2, 300 306 }; 301 307 302 308 static struct msm_iommu_dev ijpeg_iommu = { 303 - .name = "ijpeg" 309 + .name = "ijpeg", 310 + .ncb = 2, 304 311 }; 305 312 306 313 static struct msm_iommu_dev vfe_iommu = { 307 314 .name = "vfe", 308 - .clk_rate = -1 315 + .ncb = 2, 309 316 }; 310 317 311 318 static struct msm_iommu_dev vcodec_a_iommu = { 312 - .name = "vcodec_a" 319 + .name = "vcodec_a", 320 + .ncb = 2, 313 321 }; 314 322 315 323 static struct msm_iommu_dev vcodec_b_iommu = { 316 - .name = "vcodec_b" 324 + .name = "vcodec_b", 325 + .ncb = 2, 317 326 }; 318 327 319 328 static struct msm_iommu_dev gfx3d_iommu = { 320 329 .name = "gfx3d", 321 - .clk_rate = 27000000 330 + .ncb = 3, 322 331 }; 323 332 324 333 static struct msm_iommu_dev gfx2d0_iommu = { 325 334 .name = "gfx2d0", 326 - .clk_rate = 27000000 335 + .ncb = 2, 327 336 }; 328 337 329 338 static struct msm_iommu_dev gfx2d1_iommu = { 330 339 .name = "gfx2d1", 331 - .clk_rate = 27000000 340 + .ncb = 2, 332 341 }; 333 342 334 343 static struct platform_device msm_device_iommu_jpegd = {
+209 -4
arch/arm/mach-msm/devices-qsd8x50.c
··· 1 1 /* 2 2 * Copyright (C) 2008 Google, Inc. 3 - * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 + * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. 4 4 * 5 5 * This software is licensed under the terms of the GNU General Public 6 6 * License version 2, as published by the Free Software Foundation, and ··· 15 15 16 16 #include <linux/kernel.h> 17 17 #include <linux/platform_device.h> 18 - 18 + #include <linux/clkdev.h> 19 19 #include <linux/dma-mapping.h> 20 + 20 21 #include <mach/irqs.h> 21 22 #include <mach/msm_iomap.h> 22 23 #include <mach/dma.h> ··· 28 27 #include <asm/mach/flash.h> 29 28 30 29 #include <mach/mmc.h> 30 + #include "clock-pcom.h" 31 31 32 32 static struct resource resources_uart3[] = { 33 33 { ··· 40 38 .start = MSM_UART3_PHYS, 41 39 .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, 42 40 .flags = IORESOURCE_MEM, 41 + .name = "uart_resource" 43 42 }, 44 43 }; 45 44 ··· 127 124 }, 128 125 }; 129 126 130 - struct clk msm_clocks_8x50[] = { 127 + static struct resource resources_sdc1[] = { 128 + { 129 + .start = MSM_SDC1_PHYS, 130 + .end = MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1, 131 + .flags = IORESOURCE_MEM, 132 + }, 133 + { 134 + .start = INT_SDC1_0, 135 + .end = INT_SDC1_0, 136 + .flags = IORESOURCE_IRQ, 137 + .name = "cmd_irq", 138 + }, 139 + { 140 + .start = INT_SDC1_1, 141 + .end = INT_SDC1_1, 142 + .flags = IORESOURCE_IRQ, 143 + .name = "pio_irq", 144 + }, 145 + { 146 + .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, 147 + .name = "status_irq" 148 + }, 149 + { 150 + .start = 8, 151 + .end = 8, 152 + .flags = IORESOURCE_DMA, 153 + }, 154 + }; 155 + 156 + static struct resource resources_sdc2[] = { 157 + { 158 + .start = MSM_SDC2_PHYS, 159 + .end = MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1, 160 + .flags = IORESOURCE_MEM, 161 + }, 162 + { 163 + .start = INT_SDC2_0, 164 + .end = INT_SDC2_0, 165 + .flags = IORESOURCE_IRQ, 166 + .name = "cmd_irq", 167 + }, 168 + { 169 + .start = INT_SDC2_1, 170 + .end = INT_SDC2_1, 171 + .flags = IORESOURCE_IRQ, 172 + .name = "pio_irq", 173 + }, 174 + { 175 + .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, 176 + .name = "status_irq" 177 + }, 178 + { 179 + .start = 8, 180 + .end = 8, 181 + .flags = IORESOURCE_DMA, 182 + }, 183 + }; 184 + 185 + static struct resource resources_sdc3[] = { 186 + { 187 + .start = MSM_SDC3_PHYS, 188 + .end = MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1, 189 + .flags = IORESOURCE_MEM, 190 + }, 191 + { 192 + .start = INT_SDC3_0, 193 + .end = INT_SDC3_0, 194 + .flags = IORESOURCE_IRQ, 195 + .name = "cmd_irq", 196 + }, 197 + { 198 + .start = INT_SDC3_1, 199 + .end = INT_SDC3_1, 200 + .flags = IORESOURCE_IRQ, 201 + .name = "pio_irq", 202 + }, 203 + { 204 + .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, 205 + .name = "status_irq" 206 + }, 207 + { 208 + .start = 8, 209 + .end = 8, 210 + .flags = IORESOURCE_DMA, 211 + }, 212 + }; 213 + 214 + static struct resource resources_sdc4[] = { 215 + { 216 + .start = MSM_SDC4_PHYS, 217 + .end = MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1, 218 + .flags = IORESOURCE_MEM, 219 + }, 220 + { 221 + .start = INT_SDC4_0, 222 + .end = INT_SDC4_0, 223 + .flags = IORESOURCE_IRQ, 224 + .name = "cmd_irq", 225 + }, 226 + { 227 + .start = INT_SDC4_1, 228 + .end = INT_SDC4_1, 229 + .flags = IORESOURCE_IRQ, 230 + .name = "pio_irq", 231 + }, 232 + { 233 + .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED, 234 + .name = "status_irq" 235 + }, 236 + { 237 + .start = 8, 238 + .end = 8, 239 + .flags = IORESOURCE_DMA, 240 + }, 241 + }; 242 + 243 + struct platform_device msm_device_sdc1 = { 244 + .name = "msm_sdcc", 245 + .id = 1, 246 + .num_resources = ARRAY_SIZE(resources_sdc1), 247 + .resource = resources_sdc1, 248 + .dev = { 249 + .coherent_dma_mask = 0xffffffff, 250 + }, 251 + }; 252 + 253 + struct platform_device msm_device_sdc2 = { 254 + .name = "msm_sdcc", 255 + .id = 2, 256 + .num_resources = ARRAY_SIZE(resources_sdc2), 257 + .resource = resources_sdc2, 258 + .dev = { 259 + .coherent_dma_mask = 0xffffffff, 260 + }, 261 + }; 262 + 263 + struct platform_device msm_device_sdc3 = { 264 + .name = "msm_sdcc", 265 + .id = 3, 266 + .num_resources = ARRAY_SIZE(resources_sdc3), 267 + .resource = resources_sdc3, 268 + .dev = { 269 + .coherent_dma_mask = 0xffffffff, 270 + }, 271 + }; 272 + 273 + struct platform_device msm_device_sdc4 = { 274 + .name = "msm_sdcc", 275 + .id = 4, 276 + .num_resources = ARRAY_SIZE(resources_sdc4), 277 + .resource = resources_sdc4, 278 + .dev = { 279 + .coherent_dma_mask = 0xffffffff, 280 + }, 281 + }; 282 + 283 + static struct platform_device *msm_sdcc_devices[] __initdata = { 284 + &msm_device_sdc1, 285 + &msm_device_sdc2, 286 + &msm_device_sdc3, 287 + &msm_device_sdc4, 288 + }; 289 + 290 + int __init msm_add_sdcc(unsigned int controller, 291 + struct msm_mmc_platform_data *plat, 292 + unsigned int stat_irq, unsigned long stat_irq_flags) 293 + { 294 + struct platform_device *pdev; 295 + struct resource *res; 296 + 297 + if (controller < 1 || controller > 4) 298 + return -EINVAL; 299 + 300 + pdev = msm_sdcc_devices[controller-1]; 301 + pdev->dev.platform_data = plat; 302 + 303 + res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq"); 304 + if (!res) 305 + return -EINVAL; 306 + else if (stat_irq) { 307 + res->start = res->end = stat_irq; 308 + res->flags &= ~IORESOURCE_DISABLED; 309 + res->flags |= stat_irq_flags; 310 + } 311 + 312 + return platform_device_register(pdev); 313 + } 314 + 315 + struct clk_lookup msm_clocks_8x50[] = { 131 316 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), 317 + CLK_PCOM("ce_clk", CE_CLK, NULL, 0), 132 318 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), 133 319 CLK_PCOM("ebi2_clk", EBI2_CLK, NULL, 0), 134 320 CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0), 135 321 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX), 136 322 CLK_PCOM("gp_clk", GP_CLK, NULL, 0), 137 323 CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, 0), 324 + CLK_PCOM("i2c_clk", I2C_CLK, NULL, 0), 138 325 CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), 139 326 CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), 140 327 CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), ··· 337 144 CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), 338 145 CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), 339 146 CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), 147 + CLK_PCOM("sdc_clk", SDC1_CLK, "msm_sdcc.1", OFF), 148 + CLK_PCOM("sdc_pclk", SDC1_P_CLK, "msm_sdcc.1", OFF), 149 + CLK_PCOM("sdc_clk", SDC2_CLK, "msm_sdcc.2", OFF), 150 + CLK_PCOM("sdc_pclk", SDC2_P_CLK, "msm_sdcc.2", OFF), 151 + CLK_PCOM("sdc_clk", SDC3_CLK, "msm_sdcc.3", OFF), 152 + CLK_PCOM("sdc_pclk", SDC3_P_CLK, "msm_sdcc.3", OFF), 153 + CLK_PCOM("sdc_clk", SDC4_CLK, "msm_sdcc.4", OFF), 154 + CLK_PCOM("sdc_pclk", SDC4_P_CLK, "msm_sdcc.4", OFF), 340 155 CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), 341 156 CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), 342 157 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 343 158 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 344 159 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 345 - CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), 160 + CLK_PCOM("uart_clk", UART1_CLK, NULL, OFF), 161 + CLK_PCOM("uart_clk", UART2_CLK, NULL, 0), 162 + CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), 163 + CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF), 164 + CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0), 346 165 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 347 166 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), 348 167 CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0),
+8 -3
arch/arm/mach-msm/devices.h
··· 16 16 #ifndef __ARCH_ARM_MACH_MSM_DEVICES_H 17 17 #define __ARCH_ARM_MACH_MSM_DEVICES_H 18 18 19 + #include <linux/clkdev.h> 20 + 19 21 #include "clock.h" 20 22 21 23 extern struct platform_device msm_device_uart1; 22 24 extern struct platform_device msm_device_uart2; 23 25 extern struct platform_device msm_device_uart3; 26 + 27 + extern struct platform_device msm8960_device_uart_gsbi2; 28 + extern struct platform_device msm8960_device_uart_gsbi5; 24 29 25 30 extern struct platform_device msm_device_sdc1; 26 31 extern struct platform_device msm_device_sdc2; ··· 46 41 extern struct platform_device msm_device_mddi1; 47 42 extern struct platform_device msm_device_mdp; 48 43 49 - extern struct clk msm_clocks_7x01a[]; 44 + extern struct clk_lookup msm_clocks_7x01a[]; 50 45 extern unsigned msm_num_clocks_7x01a; 51 46 52 - extern struct clk msm_clocks_7x30[]; 47 + extern struct clk_lookup msm_clocks_7x30[]; 53 48 extern unsigned msm_num_clocks_7x30; 54 49 55 - extern struct clk msm_clocks_8x50[]; 50 + extern struct clk_lookup msm_clocks_8x50[]; 56 51 extern unsigned msm_num_clocks_8x50; 57 52 58 53 #endif
-38
arch/arm/mach-msm/gpiomux-7x30.c
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 2 - * 3 - * This program is free software; you can redistribute it and/or modify 4 - * it under the terms of the GNU General Public License version 2 and 5 - * only version 2 as published by the Free Software Foundation. 6 - * 7 - * This program is distributed in the hope that it will be useful, 8 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 - * GNU General Public License for more details. 11 - * 12 - * You should have received a copy of the GNU General Public License 13 - * along with this program; if not, write to the Free Software 14 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 - * 02110-1301, USA. 16 - */ 17 - #include "gpiomux.h" 18 - 19 - struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { 20 - #ifdef CONFIG_SERIAL_MSM_CONSOLE 21 - [49] = { /* UART2 RFR */ 22 - .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 23 - GPIOMUX_FUNC_2 | GPIOMUX_VALID, 24 - }, 25 - [50] = { /* UART2 CTS */ 26 - .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 27 - GPIOMUX_FUNC_2 | GPIOMUX_VALID, 28 - }, 29 - [51] = { /* UART2 RX */ 30 - .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 31 - GPIOMUX_FUNC_2 | GPIOMUX_VALID, 32 - }, 33 - [52] = { /* UART2 TX */ 34 - .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 35 - GPIOMUX_FUNC_2 | GPIOMUX_VALID, 36 - }, 37 - #endif 38 - };
+23
arch/arm/mach-msm/gpiomux-8x50.c
··· 16 16 */ 17 17 #include "gpiomux.h" 18 18 19 + #if defined(CONFIG_MMC_MSM) || defined(CONFIG_MMC_MSM_MODULE) 20 + #define SDCC_DAT_0_3_CMD_ACTV_CFG (GPIOMUX_VALID | GPIOMUX_PULL_UP\ 21 + | GPIOMUX_FUNC_1 | GPIOMUX_DRV_8MA) 22 + #define SDCC_CLK_ACTV_CFG (GPIOMUX_VALID | GPIOMUX_PULL_NONE\ 23 + | GPIOMUX_FUNC_1 | GPIOMUX_DRV_8MA) 24 + #else 25 + #define SDCC_DAT_0_3_CMD_ACTV_CFG 0 26 + #define SDCC_CLK_ACTV_CFG 0 27 + #endif 28 + 29 + #define SDC1_SUSPEND_CONFIG (GPIOMUX_VALID | GPIOMUX_PULL_DOWN\ 30 + | GPIOMUX_FUNC_GPIO | GPIOMUX_DRV_2MA) 31 + 19 32 struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { 20 33 [86] = { /* UART3 RX */ 21 34 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | ··· 37 24 [87] = { /* UART3 TX */ 38 25 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 39 26 GPIOMUX_FUNC_1 | GPIOMUX_VALID, 27 + }, 28 + /* SDC1 data[3:0] & CMD */ 29 + [51 ... 55] = { 30 + .active = SDCC_DAT_0_3_CMD_ACTV_CFG, 31 + .suspended = SDC1_SUSPEND_CONFIG 32 + }, 33 + /* SDC1 CLK */ 34 + [56] = { 35 + .active = SDCC_CLK_ACTV_CFG, 36 + .suspended = SDC1_SUSPEND_CONFIG 40 37 }, 41 38 };
+1 -1
arch/arm/mach-msm/headsmp.S
··· 11 11 #include <linux/linkage.h> 12 12 #include <linux/init.h> 13 13 14 - __INIT 14 + __CPUINIT 15 15 16 16 /* 17 17 * MSM specific entry point for secondary CPUs. This provides
+2 -2
arch/arm/mach-msm/include/mach/board.h
··· 31 31 unsigned long wait_for_irq_khz; 32 32 }; 33 33 34 - struct clk; 34 + struct clk_lookup; 35 35 36 36 extern struct sys_timer msm_timer; 37 37 ··· 41 41 void __init msm_map_common_io(void); 42 42 void __init msm_init_irq(void); 43 43 void __init msm_init_gpio(void); 44 - void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks); 44 + void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks); 45 45 void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *); 46 46 int __init msm_add_sdcc(unsigned int controller, 47 47 struct msm_mmc_platform_data *plat,
+7 -24
arch/arm/mach-msm/include/mach/clk.h
··· 1 1 /* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 - * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 28 11 */ 29 12 #ifndef __MACH_CLK_H 30 13 #define __MACH_CLK_H
+19
arch/arm/mach-msm/include/mach/clkdev.h
··· 1 + /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. 2 + * 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 6 + * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 11 + */ 12 + #ifndef __ASM_ARCH_MSM_CLKDEV_H 13 + #define __ASM_ARCH_MSM_CLKDEV_H 14 + 15 + struct clk; 16 + 17 + static inline int __clk_get(struct clk *clk) { return 1; } 18 + static inline void __clk_put(struct clk *clk) { } 19 + #endif
+54
arch/arm/mach-msm/include/mach/cpu.h
··· 1 + /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. 2 + * 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 6 + * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 11 + * 12 + * You should have received a copy of the GNU General Public License 13 + * along with this program; if not, write to the Free Software 14 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 15 + * 02110-1301, USA. 16 + */ 17 + 18 + #ifndef __ARCH_ARM_MACH_MSM_CPU_H__ 19 + #define __ARCH_ARM_MACH_MSM_CPU_H__ 20 + 21 + /* TODO: For now, only one CPU can be compiled at a time. */ 22 + 23 + #define cpu_is_msm7x01() 0 24 + #define cpu_is_msm7x30() 0 25 + #define cpu_is_qsd8x50() 0 26 + #define cpu_is_msm8x60() 0 27 + #define cpu_is_msm8960() 0 28 + 29 + #ifdef CONFIG_ARCH_MSM7X00A 30 + # undef cpu_is_msm7x01 31 + # define cpu_is_msm7x01() 1 32 + #endif 33 + 34 + #ifdef CONFIG_ARCH_MSM7X30 35 + # undef cpu_is_msm7x30 36 + # define cpu_is_msm7x30() 1 37 + #endif 38 + 39 + #ifdef CONFIG_ARCH_QSD8X50 40 + # undef cpu_is_qsd8x50 41 + # define cpu_is_qsd8x50() 1 42 + #endif 43 + 44 + #ifdef CONFIG_ARCH_MSM8X60 45 + # undef cpu_is_msm8x60 46 + # define cpu_is_msm8x60() 1 47 + #endif 48 + 49 + #ifdef CONFIG_ARCH_MSM8960 50 + # undef cpu_is_msm8960 51 + # define cpu_is_msm8960() 1 52 + #endif 53 + 54 + #endif
+1
arch/arm/mach-msm/include/mach/io.h
··· 29 29 void msm_map_qsd8x50_io(void); 30 30 void msm_map_msm7x30_io(void); 31 31 void msm_map_msm8x60_io(void); 32 + void msm_map_msm8960_io(void); 32 33 33 34 extern unsigned int msm_shared_ram_phys; 34 35
+11 -7
arch/arm/mach-msm/include/mach/iommu.h
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1 + /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 2 2 * 3 3 * This program is free software; you can redistribute it and/or modify 4 4 * it under the terms of the GNU General Public License version 2 and ··· 19 19 #define MSM_IOMMU_H 20 20 21 21 #include <linux/interrupt.h> 22 + #include <linux/clk.h> 22 23 23 24 /* Sharability attributes of MSM IOMMU mappings */ 24 25 #define MSM_IOMMU_ATTR_NON_SH 0x0 ··· 45 44 /** 46 45 * struct msm_iommu_dev - a single IOMMU hardware instance 47 46 * name Human-readable name given to this IOMMU HW instance 48 - * clk_rate Rate to set for this IOMMU's clock, if applicable to this 49 - * particular IOMMU. 0 means don't set a rate. 50 - * -1 means it is an AXI clock with no valid rate 51 - * 47 + * ncb Number of context banks present on this IOMMU HW instance 52 48 */ 53 49 struct msm_iommu_dev { 54 50 const char *name; 55 - int clk_rate; 51 + int ncb; 56 52 }; 57 53 58 54 /** ··· 71 73 /** 72 74 * struct msm_iommu_drvdata - A single IOMMU hardware instance 73 75 * @base: IOMMU config port base address (VA) 76 + * @ncb The number of contexts on this IOMMU 74 77 * @irq: Interrupt number 75 - * 78 + * @clk: The bus clock for this IOMMU hardware instance 79 + * @pclk: The clock for the IOMMU bus interconnect 80 + * 76 81 * A msm_iommu_drvdata holds the global driver data about a single piece 77 82 * of an IOMMU hardware instance. 78 83 */ 79 84 struct msm_iommu_drvdata { 80 85 void __iomem *base; 81 86 int irq; 87 + int ncb; 88 + struct clk *clk; 89 + struct clk *pclk; 82 90 }; 83 91 84 92 /**
+3 -29
arch/arm/mach-msm/include/mach/iommu_hw-8xxx.h
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1 + /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 2 2 * 3 3 * This program is free software; you can redistribute it and/or modify 4 4 * it under the terms of the GNU General Public License version 2 and ··· 68 68 #define FL_CACHEABLE (1 << 3) 69 69 #define FL_TEX0 (1 << 12) 70 70 #define FL_OFFSET(va) (((va) & 0xFFF00000) >> 20) 71 + #define FL_NG (1 << 17) 71 72 72 73 /* Second-level page table bits */ 73 74 #define SL_BASE_MASK_LARGE 0xFFFF0000 ··· 82 81 #define SL_CACHEABLE (1 << 3) 83 82 #define SL_TEX0 (1 << 6) 84 83 #define SL_OFFSET(va) (((va) & 0xFF000) >> 12) 84 + #define SL_NG (1 << 11) 85 85 86 86 /* Memory type and cache policy attributes */ 87 87 #define MT_SO 0 ··· 625 623 #define SET_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PSR, INDEX, v) 626 624 627 625 628 - /* V2Pxx UW UR PW PR */ 629 - #define SET_V2PUW_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_INDEX, v) 630 - #define SET_V2PUW_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_VA, v) 631 - 632 - #define SET_V2PUR_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_INDEX, v) 633 - #define SET_V2PUR_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_VA, v) 634 - 635 - #define SET_V2PPW_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_INDEX, v) 636 - #define SET_V2PPW_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_VA, v) 637 - 638 - #define SET_V2PPR_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_INDEX, v) 639 - #define SET_V2PPR_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_VA, v) 640 - 641 - 642 626 /* Context Register getters */ 643 627 /* ACTLR */ 644 628 #define GET_CFERE(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, CFERE) ··· 810 822 /* V2PSR */ 811 823 #define GET_HIT(b, c) GET_CONTEXT_FIELD(b, c, V2PSR, HIT) 812 824 #define GET_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PSR, INDEX) 813 - 814 - 815 - /* V2Pxx UW UR PW PR */ 816 - #define GET_V2PUW_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_INDEX) 817 - #define GET_V2PUW_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_VA) 818 - 819 - #define GET_V2PUR_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_INDEX) 820 - #define GET_V2PUR_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_VA) 821 - 822 - #define GET_V2PPW_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_INDEX) 823 - #define GET_V2PPW_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_VA) 824 - 825 - #define GET_V2PPR_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_INDEX) 826 - #define GET_V2PPR_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_VA) 827 825 828 826 829 827 /* Global Registers */
+7 -24
arch/arm/mach-msm/include/mach/irqs-7x30.h
··· 1 1 /* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 - * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 28 11 */ 29 12 30 13 #ifndef __ASM_ARCH_MSM_IRQS_7X30_H
+277
arch/arm/mach-msm/include/mach/irqs-8960.h
··· 1 + /* Copyright (c) 2011 Code Aurora Forum. All rights reserved. 2 + * 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 6 + * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 11 + */ 12 + 13 + #ifndef __ASM_ARCH_MSM_IRQS_8960_H 14 + #define __ASM_ARCH_MSM_IRQS_8960_H 15 + 16 + /* MSM ACPU Interrupt Numbers */ 17 + 18 + /* 0-15: STI/SGI (software triggered/generated interrupts) 19 + 16-31: PPI (private peripheral interrupts) 20 + 32+: SPI (shared peripheral interrupts) */ 21 + 22 + #define GIC_PPI_START 16 23 + #define GIC_SPI_START 32 24 + 25 + #define INT_VGIC (GIC_PPI_START + 0) 26 + #define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 1) 27 + #define INT_GP_TIMER_EXP (GIC_PPI_START + 2) 28 + #define INT_GP_TIMER2_EXP (GIC_PPI_START + 3) 29 + #define WDT0_ACCSCSSNBARK_INT (GIC_PPI_START + 4) 30 + #define WDT1_ACCSCSSNBARK_INT (GIC_PPI_START + 5) 31 + #define AVS_SVICINT (GIC_PPI_START + 6) 32 + #define AVS_SVICINTSWDONE (GIC_PPI_START + 7) 33 + #define CPU_DBGCPUXCOMMRXFULL (GIC_PPI_START + 8) 34 + #define CPU_DBGCPUXCOMMTXEMPTY (GIC_PPI_START + 9) 35 + #define CPU_SICCPUXPERFMONIRPTREQ (GIC_PPI_START + 10) 36 + #define SC_AVSCPUXDOWN (GIC_PPI_START + 11) 37 + #define SC_AVSCPUXUP (GIC_PPI_START + 12) 38 + #define SC_SICCPUXACGIRPTREQ (GIC_PPI_START + 13) 39 + #define SC_SICCPUXEXTFAULTIRPTREQ (GIC_PPI_START + 14) 40 + /* PPI 15 is unused */ 41 + 42 + #define SC_SICMPUIRPTREQ (GIC_SPI_START + 0) 43 + #define SC_SICL2IRPTREQ (GIC_SPI_START + 1) 44 + #define SC_SICL2PERFMONIRPTREQ (GIC_SPI_START + 2) 45 + #define SC_SICAGCIRPTREQ (GIC_SPI_START + 3) 46 + #define TLMM_APCC_DIR_CONN_IRQ_0 (GIC_SPI_START + 4) 47 + #define TLMM_APCC_DIR_CONN_IRQ_1 (GIC_SPI_START + 5) 48 + #define TLMM_APCC_DIR_CONN_IRQ_2 (GIC_SPI_START + 6) 49 + #define TLMM_APCC_DIR_CONN_IRQ_3 (GIC_SPI_START + 7) 50 + #define TLMM_APCC_DIR_CONN_IRQ_4 (GIC_SPI_START + 8) 51 + #define TLMM_APCC_DIR_CONN_IRQ_5 (GIC_SPI_START + 9) 52 + #define TLMM_APCC_DIR_CONN_IRQ_6 (GIC_SPI_START + 10) 53 + #define TLMM_APCC_DIR_CONN_IRQ_7 (GIC_SPI_START + 11) 54 + #define TLMM_APCC_DIR_CONN_IRQ_8 (GIC_SPI_START + 12) 55 + #define TLMM_APCC_DIR_CONN_IRQ_9 (GIC_SPI_START + 13) 56 + #define PM8921_SEC_IRQ_103 (GIC_SPI_START + 14) 57 + #define PM8018_SEC_IRQ_106 (GIC_SPI_START + 15) 58 + #define TLMM_APCC_SUMMARY_IRQ (GIC_SPI_START + 16) 59 + #define SPDM_RT_1_IRQ (GIC_SPI_START + 17) 60 + #define SPDM_DIAG_IRQ (GIC_SPI_START + 18) 61 + #define RPM_APCC_CPU0_GP_HIGH_IRQ (GIC_SPI_START + 19) 62 + #define RPM_APCC_CPU0_GP_MEDIUM_IRQ (GIC_SPI_START + 20) 63 + #define RPM_APCC_CPU0_GP_LOW_IRQ (GIC_SPI_START + 21) 64 + #define RPM_APCC_CPU0_WAKE_UP_IRQ (GIC_SPI_START + 22) 65 + #define RPM_APCC_CPU1_GP_HIGH_IRQ (GIC_SPI_START + 23) 66 + #define RPM_APCC_CPU1_GP_MEDIUM_IRQ (GIC_SPI_START + 24) 67 + #define RPM_APCC_CPU1_GP_LOW_IRQ (GIC_SPI_START + 25) 68 + #define RPM_APCC_CPU1_WAKE_UP_IRQ (GIC_SPI_START + 26) 69 + #define SSBI2_2_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 27) 70 + #define SSBI2_2_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 28) 71 + #define SSBI2_1_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 29) 72 + #define SSBI2_1_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 30) 73 + #define MSMC_SC_SEC_CE_IRQ (GIC_SPI_START + 31) 74 + #define MSMC_SC_PRI_CE_IRQ (GIC_SPI_START + 32) 75 + #define SLIMBUS0_CORE_EE1_IRQ (GIC_SPI_START + 33) 76 + #define SLIMBUS0_BAM_EE1_IRQ (GIC_SPI_START + 34) 77 + #define Q6FW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 35) 78 + #define Q6SW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 36) 79 + #define MSS_TO_APPS_IRQ_0 (GIC_SPI_START + 37) 80 + #define MSS_TO_APPS_IRQ_1 (GIC_SPI_START + 38) 81 + #define MSS_TO_APPS_IRQ_2 (GIC_SPI_START + 39) 82 + #define MSS_TO_APPS_IRQ_3 (GIC_SPI_START + 40) 83 + #define MSS_TO_APPS_IRQ_4 (GIC_SPI_START + 41) 84 + #define MSS_TO_APPS_IRQ_5 (GIC_SPI_START + 42) 85 + #define MSS_TO_APPS_IRQ_6 (GIC_SPI_START + 43) 86 + #define MSS_TO_APPS_IRQ_7 (GIC_SPI_START + 44) 87 + #define MSS_TO_APPS_IRQ_8 (GIC_SPI_START + 45) 88 + #define MSS_TO_APPS_IRQ_9 (GIC_SPI_START + 46) 89 + #define VPE_IRQ (GIC_SPI_START + 47) 90 + #define VFE_IRQ (GIC_SPI_START + 48) 91 + #define VCODEC_IRQ (GIC_SPI_START + 49) 92 + #define TV_ENC_IRQ (GIC_SPI_START + 50) 93 + #define SMMU_VPE_CB_SC_SECURE_IRQ (GIC_SPI_START + 51) 94 + #define SMMU_VPE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 52) 95 + #define SMMU_VFE_CB_SC_SECURE_IRQ (GIC_SPI_START + 53) 96 + #define SMMU_VFE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 54) 97 + #define SMMU_VCODEC_B_CB_SC_SECURE_IRQ (GIC_SPI_START + 55) 98 + #define SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 56) 99 + #define SMMU_VCODEC_A_CB_SC_SECURE_IRQ (GIC_SPI_START + 57) 100 + #define SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 58) 101 + #define SMMU_ROT_CB_SC_SECURE_IRQ (GIC_SPI_START + 59) 102 + #define SMMU_ROT_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 60) 103 + #define SMMU_MDP1_CB_SC_SECURE_IRQ (GIC_SPI_START + 61) 104 + #define SMMU_MDP1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 62) 105 + #define SMMU_MDP0_CB_SC_SECURE_IRQ (GIC_SPI_START + 63) 106 + #define SMMU_MDP0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 64) 107 + #define SMMU_JPEGD_CB_SC_SECURE_IRQ (GIC_SPI_START + 65) 108 + #define SMMU_JPEGD_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 66) 109 + #define SMMU_IJPEG_CB_SC_SECURE_IRQ (GIC_SPI_START + 67) 110 + #define SMMU_IJPEG_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 68) 111 + #define SMMU_GFX3D_CB_SC_SECURE_IRQ (GIC_SPI_START + 69) 112 + #define SMMU_GFX3D_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 70) 113 + #define SMMU_GFX2D0_CB_SC_SECURE_IRQ (GIC_SPI_START + 71) 114 + #define SMMU_GFX2D0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 72) 115 + #define ROT_IRQ (GIC_SPI_START + 73) 116 + #define MMSS_FABRIC_IRQ (GIC_SPI_START + 74) 117 + #define MDP_IRQ (GIC_SPI_START + 75) 118 + #define JPEGD_IRQ (GIC_SPI_START + 76) 119 + #define JPEG_IRQ (GIC_SPI_START + 77) 120 + #define MMSS_IMEM_IRQ (GIC_SPI_START + 78) 121 + #define HDMI_IRQ (GIC_SPI_START + 79) 122 + #define GFX3D_IRQ (GIC_SPI_START + 80) 123 + #define GFX2D0_IRQ (GIC_SPI_START + 81) 124 + #define DSI1_IRQ (GIC_SPI_START + 82) 125 + #define CSI_1_IRQ (GIC_SPI_START + 83) 126 + #define CSI_0_IRQ (GIC_SPI_START + 84) 127 + #define LPASS_SCSS_AUDIO_IF_OUT0_IRQ (GIC_SPI_START + 85) 128 + #define LPASS_SCSS_MIDI_IRQ (GIC_SPI_START + 86) 129 + #define LPASS_Q6SS_WDOG_EXPIRED (GIC_SPI_START + 87) 130 + #define LPASS_SCSS_GP_LOW_IRQ (GIC_SPI_START + 88) 131 + #define LPASS_SCSS_GP_MEDIUM_IRQ (GIC_SPI_START + 89) 132 + #define LPASS_SCSS_GP_HIGH_IRQ (GIC_SPI_START + 90) 133 + #define TOP_IMEM_IRQ (GIC_SPI_START + 91) 134 + #define FABRIC_SYS_IRQ (GIC_SPI_START + 92) 135 + #define FABRIC_APPS_IRQ (GIC_SPI_START + 93) 136 + #define USB1_HS_BAM_IRQ (GIC_SPI_START + 94) 137 + #define SDC4_BAM_IRQ (GIC_SPI_START + 95) 138 + #define SDC3_BAM_IRQ (GIC_SPI_START + 96) 139 + #define SDC2_BAM_IRQ (GIC_SPI_START + 97) 140 + #define SDC1_BAM_IRQ (GIC_SPI_START + 98) 141 + #define FABRIC_SPS_IRQ (GIC_SPI_START + 99) 142 + #define USB1_HS_IRQ (GIC_SPI_START + 100) 143 + #define SDC4_IRQ_0 (GIC_SPI_START + 101) 144 + #define SDC3_IRQ_0 (GIC_SPI_START + 102) 145 + #define SDC2_IRQ_0 (GIC_SPI_START + 103) 146 + #define SDC1_IRQ_0 (GIC_SPI_START + 104) 147 + #define SPS_BAM_DMA_IRQ (GIC_SPI_START + 105) 148 + #define SPS_SEC_VIOL_IRQ (GIC_SPI_START + 106) 149 + #define SPS_MTI_0 (GIC_SPI_START + 107) 150 + #define SPS_MTI_1 (GIC_SPI_START + 108) 151 + #define SPS_MTI_2 (GIC_SPI_START + 109) 152 + #define SPS_MTI_3 (GIC_SPI_START + 110) 153 + #define SPS_MTI_4 (GIC_SPI_START + 111) 154 + #define SPS_MTI_5 (GIC_SPI_START + 112) 155 + #define SPS_MTI_6 (GIC_SPI_START + 113) 156 + #define SPS_MTI_7 (GIC_SPI_START + 114) 157 + #define SPS_MTI_8 (GIC_SPI_START + 115) 158 + #define SPS_MTI_9 (GIC_SPI_START + 116) 159 + #define SPS_MTI_10 (GIC_SPI_START + 117) 160 + #define SPS_MTI_11 (GIC_SPI_START + 118) 161 + #define SPS_MTI_12 (GIC_SPI_START + 119) 162 + #define SPS_MTI_13 (GIC_SPI_START + 120) 163 + #define SPS_MTI_14 (GIC_SPI_START + 121) 164 + #define SPS_MTI_15 (GIC_SPI_START + 122) 165 + #define SPS_MTI_16 (GIC_SPI_START + 123) 166 + #define SPS_MTI_17 (GIC_SPI_START + 124) 167 + #define SPS_MTI_18 (GIC_SPI_START + 125) 168 + #define SPS_MTI_19 (GIC_SPI_START + 126) 169 + #define SPS_MTI_20 (GIC_SPI_START + 127) 170 + #define SPS_MTI_21 (GIC_SPI_START + 128) 171 + #define SPS_MTI_22 (GIC_SPI_START + 129) 172 + #define SPS_MTI_23 (GIC_SPI_START + 130) 173 + #define SPS_MTI_24 (GIC_SPI_START + 131) 174 + #define SPS_MTI_25 (GIC_SPI_START + 132) 175 + #define SPS_MTI_26 (GIC_SPI_START + 133) 176 + #define SPS_MTI_27 (GIC_SPI_START + 134) 177 + #define SPS_MTI_28 (GIC_SPI_START + 135) 178 + #define SPS_MTI_29 (GIC_SPI_START + 136) 179 + #define SPS_MTI_30 (GIC_SPI_START + 137) 180 + #define SPS_MTI_31 (GIC_SPI_START + 138) 181 + #define CSIPHY_4LN_IRQ (GIC_SPI_START + 139) 182 + #define CSIPHY_2LN_IRQ (GIC_SPI_START + 140) 183 + #define USB2_IRQ (GIC_SPI_START + 141) 184 + #define USB1_IRQ (GIC_SPI_START + 142) 185 + #define TSSC_SSBI_IRQ (GIC_SPI_START + 143) 186 + #define TSSC_SAMPLE_IRQ (GIC_SPI_START + 144) 187 + #define TSSC_PENUP_IRQ (GIC_SPI_START + 145) 188 + #define GSBI1_UARTDM_IRQ (GIC_SPI_START + 146) 189 + #define GSBI1_QUP_IRQ (GIC_SPI_START + 147) 190 + #define GSBI2_UARTDM_IRQ (GIC_SPI_START + 148) 191 + #define GSBI2_QUP_IRQ (GIC_SPI_START + 149) 192 + #define GSBI3_UARTDM_IRQ (GIC_SPI_START + 150) 193 + #define GSBI3_QUP_IRQ (GIC_SPI_START + 151) 194 + #define GSBI4_UARTDM_IRQ (GIC_SPI_START + 152) 195 + #define GSBI4_QUP_IRQ (GIC_SPI_START + 153) 196 + #define GSBI5_UARTDM_IRQ (GIC_SPI_START + 154) 197 + #define GSBI5_QUP_IRQ (GIC_SPI_START + 155) 198 + #define GSBI6_UARTDM_IRQ (GIC_SPI_START + 156) 199 + #define GSBI6_QUP_IRQ (GIC_SPI_START + 157) 200 + #define GSBI7_UARTDM_IRQ (GIC_SPI_START + 158) 201 + #define GSBI7_QUP_IRQ (GIC_SPI_START + 159) 202 + #define GSBI8_UARTDM_IRQ (GIC_SPI_START + 160) 203 + #define GSBI8_QUP_IRQ (GIC_SPI_START + 161) 204 + #define TSIF_TSPP_IRQ (GIC_SPI_START + 162) 205 + #define TSIF_BAM_IRQ (GIC_SPI_START + 163) 206 + #define TSIF2_IRQ (GIC_SPI_START + 164) 207 + #define TSIF1_IRQ (GIC_SPI_START + 165) 208 + #define DSI2_IRQ (GIC_SPI_START + 166) 209 + #define ISPIF_IRQ (GIC_SPI_START + 167) 210 + #define MSMC_SC_SEC_TMR_IRQ (GIC_SPI_START + 168) 211 + #define MSMC_SC_SEC_WDOG_BARK_IRQ (GIC_SPI_START + 169) 212 + #define INT_ADM0_SCSS_0_IRQ (GIC_SPI_START + 170) 213 + #define INT_ADM0_SCSS_1_IRQ (GIC_SPI_START + 171) 214 + #define INT_ADM0_SCSS_2_IRQ (GIC_SPI_START + 172) 215 + #define INT_ADM0_SCSS_3_IRQ (GIC_SPI_START + 173) 216 + #define CC_SCSS_WDT1CPU1BITEEXPIRED (GIC_SPI_START + 174) 217 + #define CC_SCSS_WDT1CPU0BITEEXPIRED (GIC_SPI_START + 175) 218 + #define CC_SCSS_WDT0CPU1BITEEXPIRED (GIC_SPI_START + 176) 219 + #define CC_SCSS_WDT0CPU0BITEEXPIRED (GIC_SPI_START + 177) 220 + #define TSENS_UPPER_LOWER_INT (GIC_SPI_START + 178) 221 + #define SSBI2_2_SC_CPU1_SECURE_INT (GIC_SPI_START + 179) 222 + #define SSBI2_2_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 180) 223 + #define SSBI2_1_SC_CPU1_SECURE_INT (GIC_SPI_START + 181) 224 + #define SSBI2_1_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 182) 225 + #define XPU_SUMMARY_IRQ (GIC_SPI_START + 183) 226 + #define BUS_EXCEPTION_SUMMARY_IRQ (GIC_SPI_START + 184) 227 + #define HSDDRX_EBI1CH0_IRQ (GIC_SPI_START + 185) 228 + #define HSDDRX_EBI1CH1_IRQ (GIC_SPI_START + 186) 229 + #define SDC5_BAM_IRQ (GIC_SPI_START + 187) 230 + #define SDC5_IRQ_0 (GIC_SPI_START + 188) 231 + #define GSBI9_UARTDM_IRQ (GIC_SPI_START + 189) 232 + #define GSBI9_QUP_IRQ (GIC_SPI_START + 190) 233 + #define GSBI10_UARTDM_IRQ (GIC_SPI_START + 191) 234 + #define GSBI10_QUP_IRQ (GIC_SPI_START + 192) 235 + #define GSBI11_UARTDM_IRQ (GIC_SPI_START + 193) 236 + #define GSBI11_QUP_IRQ (GIC_SPI_START + 194) 237 + #define GSBI12_UARTDM_IRQ (GIC_SPI_START + 195) 238 + #define GSBI12_QUP_IRQ (GIC_SPI_START + 196) 239 + #define RIVA_APSS_LTECOEX_IRQ (GIC_SPI_START + 197) 240 + #define RIVA_APSS_SPARE_IRQ (GIC_SPI_START + 198) 241 + #define RIVA_APSS_WDOG_BITE_RESET_RDY_IRQ (GIC_SPI_START + 199) 242 + #define RIVA_ASS_RESET_DONE_IRQ (GIC_SPI_START + 200) 243 + #define RIVA_APSS_ASIC_IRQ (GIC_SPI_START + 201) 244 + #define RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ (GIC_SPI_START + 202) 245 + #define RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ (GIC_SPI_START + 203) 246 + #define RIVA_APPS_WLAM_SMSM_IRQ (GIC_SPI_START + 204) 247 + #define RIVA_APPS_LOG_CTRL_IRQ (GIC_SPI_START + 205) 248 + #define RIVA_APPS_FM_CTRL_IRQ (GIC_SPI_START + 206) 249 + #define RIVA_APPS_HCI_IRQ (GIC_SPI_START + 207) 250 + #define RIVA_APPS_WLAN_CTRL_IRQ (GIC_SPI_START + 208) 251 + #define A2_BAM_IRQ (GIC_SPI_START + 209) 252 + #define SMMU_GFX2D1_CB_SC_SECURE_IRQ (GIC_SPI_START + 210) 253 + #define SMMU_GFX2D1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 211) 254 + #define GFX2D1_IRQ (GIC_SPI_START + 212) 255 + #define PPSS_WDOG_TIMER_IRQ (GIC_SPI_START + 213) 256 + #define SPS_SLIMBUS_CORE_EE0_IRQ (GIC_SPI_START + 214) 257 + #define SPS_SLIMBUS_BAM_EE0_IRQ (GIC_SPI_START + 215) 258 + #define QDSS_ETB_IRQ (GIC_SPI_START + 216) 259 + #define QDSS_CTI2KPSS_CPU1_IRQ (GIC_SPI_START + 217) 260 + #define QDSS_CTI2KPSS_CPU0_IRQ (GIC_SPI_START + 218) 261 + #define TLMM_APCC_DIR_CONN_IRQ_16 (GIC_SPI_START + 219) 262 + #define TLMM_APCC_DIR_CONN_IRQ_17 (GIC_SPI_START + 220) 263 + #define TLMM_APCC_DIR_CONN_IRQ_18 (GIC_SPI_START + 221) 264 + #define TLMM_APCC_DIR_CONN_IRQ_19 (GIC_SPI_START + 222) 265 + #define TLMM_APCC_DIR_CONN_IRQ_20 (GIC_SPI_START + 223) 266 + #define TLMM_APCC_DIR_CONN_IRQ_21 (GIC_SPI_START + 224) 267 + #define PM8921_SEC_IRQ_104 (GIC_SPI_START + 225) 268 + #define PM8018_SEC_IRQ_107 (GIC_SPI_START + 226) 269 + 270 + /* For now, use the maximum number of interrupts until a pending GIC issue 271 + * is sorted out */ 272 + #define NR_MSM_IRQS 1020 273 + #define NR_BOARD_IRQS 0 274 + #define NR_GPIO_IRQS 0 275 + 276 + #endif 277 +
+7 -24
arch/arm/mach-msm/include/mach/irqs-8x50.h
··· 1 1 /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 - * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 28 11 */ 29 12 30 13 #ifndef __ASM_ARCH_MSM_IRQS_8XXX_H
+3
arch/arm/mach-msm/include/mach/irqs.h
··· 26 26 #include "sirc.h" 27 27 #elif defined(CONFIG_ARCH_MSM8X60) 28 28 #include "irqs-8x60.h" 29 + #elif defined(CONFIG_ARCH_MSM8960) 30 + /* TODO: Make these not generic. */ 31 + #include "irqs-8960.h" 29 32 #elif defined(CONFIG_ARCH_MSM_ARM11) 30 33 #include "irqs-7x00.h" 31 34 #else
+2
arch/arm/mach-msm/include/mach/memory.h
··· 25 25 #define PLAT_PHYS_OFFSET UL(0x00200000) 26 26 #elif defined(CONFIG_ARCH_MSM8X60) 27 27 #define PLAT_PHYS_OFFSET UL(0x40200000) 28 + #elif defined(CONFIG_ARCH_MSM8960) 29 + #define PLAT_PHYS_OFFSET UL(0x40200000) 28 30 #else 29 31 #define PLAT_PHYS_OFFSET UL(0x10000000) 30 32 #endif
+11
arch/arm/mach-msm/include/mach/mmc.h
··· 15 15 int num_funcs; 16 16 }; 17 17 18 + struct msm_mmc_gpio { 19 + unsigned no; 20 + const char *name; 21 + }; 22 + 23 + struct msm_mmc_gpio_data { 24 + struct msm_mmc_gpio *gpio; 25 + u8 size; 26 + }; 27 + 18 28 struct msm_mmc_platform_data { 19 29 unsigned int ocr_mask; /* available voltages */ 20 30 u32 (*translate_vdd)(struct device *, unsigned int); 21 31 unsigned int (*status)(struct device *); 22 32 struct embedded_sdio_data *embedded_sdio; 23 33 int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id); 34 + struct msm_mmc_gpio_data *gpio_data; 24 35 }; 25 36 26 37 #endif
+3 -13
arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
··· 1 1 /* arch/arm/mach-msm/include/mach/msm_iomap.h 2 2 * 3 3 * Copyright (C) 2007 Google, Inc. 4 + * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 4 5 * Author: Brian Swetland <swetland@google.com> 5 6 * 6 7 * This software is licensed under the terms of the GNU General Public ··· 48 47 #define MSM_VIC_PHYS 0xC0000000 49 48 #define MSM_VIC_SIZE SZ_4K 50 49 51 - #define MSM_CSR_BASE IOMEM(0xE0001000) 52 - #define MSM_CSR_PHYS 0xC0100000 53 - #define MSM_CSR_SIZE SZ_4K 54 - 55 - #define MSM_GPT_PHYS MSM_CSR_PHYS 56 - #define MSM_GPT_BASE MSM_CSR_BASE 57 - #define MSM_GPT_SIZE SZ_4K 50 + #define MSM7X00_CSR_PHYS 0xC0100000 51 + #define MSM7X00_CSR_SIZE SZ_4K 58 52 59 53 #define MSM_DMOV_BASE IOMEM(0xE0002000) 60 54 #define MSM_DMOV_PHYS 0xA9700000 ··· 125 129 #define MSM_AD5_PHYS 0xAC000000 126 130 #define MSM_AD5_SIZE (SZ_1M*13) 127 131 128 - 129 - #if defined(CONFIG_ARCH_MSM7X30) 130 - #define MSM_GCC_BASE IOMEM(0xF8009000) 131 - #define MSM_GCC_PHYS 0xC0182000 132 - #define MSM_GCC_SIZE SZ_4K 133 - #endif 134 132 135 133 #endif
+3 -11
arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
··· 1 1 /* 2 2 * Copyright (C) 2007 Google, Inc. 3 - * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 + * Copyright (c) 2008-2011 Code Aurora Forum. All rights reserved. 4 4 * Author: Brian Swetland <swetland@google.com> 5 5 * 6 6 * This software is licensed under the terms of the GNU General Public ··· 39 39 #define MSM_VIC_PHYS 0xC0080000 40 40 #define MSM_VIC_SIZE SZ_4K 41 41 42 - #define MSM_CSR_BASE IOMEM(0xE0001000) 43 - #define MSM_CSR_PHYS 0xC0100000 44 - #define MSM_CSR_SIZE SZ_4K 45 - 46 - #define MSM_TMR_PHYS MSM_CSR_PHYS 47 - #define MSM_TMR_BASE MSM_CSR_BASE 48 - #define MSM_TMR_SIZE SZ_4K 49 - 50 - #define MSM_GPT_BASE (MSM_TMR_BASE + 0x4) 51 - #define MSM_DGT_BASE (MSM_TMR_BASE + 0x24) 42 + #define MSM7X30_CSR_PHYS 0xC0100000 43 + #define MSM7X30_CSR_SIZE SZ_4K 52 44 53 45 #define MSM_DMOV_BASE IOMEM(0xE0002000) 54 46 #define MSM_DMOV_PHYS 0xAC400000
+48
arch/arm/mach-msm/include/mach/msm_iomap-8960.h
··· 1 + /* 2 + * Copyright (C) 2007 Google, Inc. 3 + * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. 4 + * Author: Brian Swetland <swetland@google.com> 5 + * 6 + * This software is licensed under the terms of the GNU General Public 7 + * License version 2, as published by the Free Software Foundation, and 8 + * may be copied, distributed, and modified under those terms. 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * 16 + * The MSM peripherals are spread all over across 768MB of physical 17 + * space, which makes just having a simple IO_ADDRESS macro to slide 18 + * them into the right virtual location rough. Instead, we will 19 + * provide a master phys->virt mapping for peripherals here. 20 + * 21 + */ 22 + 23 + #ifndef __ASM_ARCH_MSM_IOMAP_8960_H 24 + #define __ASM_ARCH_MSM_IOMAP_8960_H 25 + 26 + /* Physical base address and size of peripherals. 27 + * Ordered by the virtual base addresses they will be mapped at. 28 + * 29 + * If you add or remove entries here, you'll want to edit the 30 + * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your 31 + * changes. 32 + * 33 + */ 34 + 35 + 36 + #define MSM8960_QGIC_DIST_PHYS 0x02000000 37 + #define MSM8960_QGIC_DIST_SIZE SZ_4K 38 + 39 + #define MSM8960_QGIC_CPU_PHYS 0x02002000 40 + #define MSM8960_QGIC_CPU_SIZE SZ_4K 41 + 42 + #define MSM8960_TMR_PHYS 0x0200A000 43 + #define MSM8960_TMR_SIZE SZ_4K 44 + 45 + #define MSM8960_TMR0_PHYS 0x0208A000 46 + #define MSM8960_TMR0_SIZE SZ_4K 47 + 48 + #endif
+7 -15
arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
··· 1 1 /* 2 2 * Copyright (C) 2007 Google, Inc. 3 - * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 + * Copyright (c) 2008-2011 Code Aurora Forum. All rights reserved. 4 4 * Author: Brian Swetland <swetland@google.com> 5 5 * 6 6 * This software is licensed under the terms of the GNU General Public ··· 39 39 #define MSM_VIC_PHYS 0xAC000000 40 40 #define MSM_VIC_SIZE SZ_4K 41 41 42 - #define MSM_CSR_BASE IOMEM(0xE0001000) 43 - #define MSM_CSR_PHYS 0xAC100000 44 - #define MSM_CSR_SIZE SZ_4K 45 - 46 - #define MSM_TMR_PHYS MSM_CSR_PHYS 47 - #define MSM_TMR_BASE MSM_CSR_BASE 48 - #define MSM_TMR_SIZE SZ_4K 49 - 50 - #define MSM_GPT_BASE MSM_TMR_BASE 51 - #define MSM_DGT_BASE (MSM_TMR_BASE + 0x10) 42 + #define QSD8X50_CSR_PHYS 0xAC100000 43 + #define QSD8X50_CSR_SIZE SZ_4K 52 44 53 45 #define MSM_DMOV_BASE IOMEM(0xE0002000) 54 46 #define MSM_DMOV_PHYS 0xA9700000 ··· 124 132 #define MSM_UART2DM_PHYS 0xA0900000 125 133 126 134 127 - #define MSM_SDC1_PHYS 0xA0400000 135 + #define MSM_SDC1_PHYS 0xA0300000 128 136 #define MSM_SDC1_SIZE SZ_4K 129 137 130 - #define MSM_SDC2_PHYS 0xA0500000 138 + #define MSM_SDC2_PHYS 0xA0400000 131 139 #define MSM_SDC2_SIZE SZ_4K 132 140 133 - #define MSM_SDC3_PHYS 0xA0600000 141 + #define MSM_SDC3_PHYS 0xA0500000 134 142 #define MSM_SDC3_SIZE SZ_4K 135 143 136 - #define MSM_SDC4_PHYS 0xA0700000 144 + #define MSM_SDC4_PHYS 0xA0600000 137 145 #define MSM_SDC4_SIZE SZ_4K 138 146 139 147 #endif
+9 -52
arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
··· 1 1 /* 2 2 * Copyright (C) 2007 Google, Inc. 3 - * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 + * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. 4 4 * Author: Brian Swetland <swetland@google.com> 5 5 * 6 6 * This software is licensed under the terms of the GNU General Public ··· 35 35 * 36 36 */ 37 37 38 - #define MSM_QGIC_DIST_BASE IOMEM(0xF0000000) 39 - #define MSM_QGIC_DIST_PHYS 0x02080000 40 - #define MSM_QGIC_DIST_SIZE SZ_4K 38 + #define MSM8X60_QGIC_DIST_PHYS 0x02080000 39 + #define MSM8X60_QGIC_DIST_SIZE SZ_4K 41 40 42 - #define MSM_QGIC_CPU_BASE IOMEM(0xF0001000) 43 - #define MSM_QGIC_CPU_PHYS 0x02081000 44 - #define MSM_QGIC_CPU_SIZE SZ_4K 41 + #define MSM8X60_QGIC_CPU_PHYS 0x02081000 42 + #define MSM8X60_QGIC_CPU_SIZE SZ_4K 45 43 46 44 #define MSM_ACC_BASE IOMEM(0xF0002000) 47 45 #define MSM_ACC_PHYS 0x02001000 ··· 56 58 #define MSM_SHARED_RAM_BASE IOMEM(0xF0100000) 57 59 #define MSM_SHARED_RAM_SIZE SZ_1M 58 60 59 - #define MSM_TMR_BASE IOMEM(0xF0200000) 60 - #define MSM_TMR_PHYS 0x02000000 61 - #define MSM_TMR_SIZE SZ_4K 61 + #define MSM8X60_TMR_PHYS 0x02000000 62 + #define MSM8X60_TMR_SIZE SZ_4K 62 63 63 - #define MSM_TMR0_BASE IOMEM(0xF0201000) 64 - #define MSM_TMR0_PHYS 0x02040000 65 - #define MSM_TMR0_SIZE SZ_4K 66 - 67 - #define MSM_GPT_BASE (MSM_TMR_BASE + 0x4) 68 - #define MSM_DGT_BASE (MSM_TMR_BASE + 0x24) 69 - 70 - #define MSM_IOMMU_JPEGD_PHYS 0x07300000 71 - #define MSM_IOMMU_JPEGD_SIZE SZ_1M 72 - 73 - #define MSM_IOMMU_VPE_PHYS 0x07400000 74 - #define MSM_IOMMU_VPE_SIZE SZ_1M 75 - 76 - #define MSM_IOMMU_MDP0_PHYS 0x07500000 77 - #define MSM_IOMMU_MDP0_SIZE SZ_1M 78 - 79 - #define MSM_IOMMU_MDP1_PHYS 0x07600000 80 - #define MSM_IOMMU_MDP1_SIZE SZ_1M 81 - 82 - #define MSM_IOMMU_ROT_PHYS 0x07700000 83 - #define MSM_IOMMU_ROT_SIZE SZ_1M 84 - 85 - #define MSM_IOMMU_IJPEG_PHYS 0x07800000 86 - #define MSM_IOMMU_IJPEG_SIZE SZ_1M 87 - 88 - #define MSM_IOMMU_VFE_PHYS 0x07900000 89 - #define MSM_IOMMU_VFE_SIZE SZ_1M 90 - 91 - #define MSM_IOMMU_VCODEC_A_PHYS 0x07A00000 92 - #define MSM_IOMMU_VCODEC_A_SIZE SZ_1M 93 - 94 - #define MSM_IOMMU_VCODEC_B_PHYS 0x07B00000 95 - #define MSM_IOMMU_VCODEC_B_SIZE SZ_1M 96 - 97 - #define MSM_IOMMU_GFX3D_PHYS 0x07C00000 98 - #define MSM_IOMMU_GFX3D_SIZE SZ_1M 99 - 100 - #define MSM_IOMMU_GFX2D0_PHYS 0x07D00000 101 - #define MSM_IOMMU_GFX2D0_SIZE SZ_1M 102 - 103 - #define MSM_IOMMU_GFX2D1_PHYS 0x07E00000 104 - #define MSM_IOMMU_GFX2D1_SIZE SZ_1M 64 + #define MSM8X60_TMR0_PHYS 0x02040000 65 + #define MSM8X60_TMR0_SIZE SZ_4K 105 66 106 67 #endif
+8 -1
arch/arm/mach-msm/include/mach/msm_iomap.h
··· 1 1 /* 2 2 * Copyright (C) 2007 Google, Inc. 3 - * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 + * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. 4 4 * Author: Brian Swetland <swetland@google.com> 5 5 * 6 6 * This software is licensed under the terms of the GNU General Public ··· 53 53 #include "msm_iomap-7x00.h" 54 54 #endif 55 55 56 + #include "msm_iomap-8960.h" 56 57 58 + /* Virtual addressses shared across all MSM targets. */ 59 + #define MSM_CSR_BASE IOMEM(0xE0001000) 60 + #define MSM_QGIC_DIST_BASE IOMEM(0xF0000000) 61 + #define MSM_QGIC_CPU_BASE IOMEM(0xF0001000) 62 + #define MSM_TMR_BASE IOMEM(0xF0200000) 63 + #define MSM_TMR0_BASE IOMEM(0xF0201000) 57 64 58 65 #endif
+7 -24
arch/arm/mach-msm/include/mach/sirc.h
··· 1 1 /* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 - * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 28 11 */ 29 12 30 13 #ifndef __ASM_ARCH_MSM_SIRC_H
+7 -23
arch/arm/mach-msm/include/mach/smp.h
··· 1 1 /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are met: 5 - * * Redistributions of source code must retain the above copyright 6 - * notice, this list of conditions and the following disclaimer. 7 - * * Redistributions in binary form must reproduce the above copyright 8 - * notice, this list of conditions and the following disclaimer in the 9 - * documentation and/or other materials provided with the distribution. 10 - * * Neither the name of Code Aurora nor 11 - * the names of its contributors may be used to endorse or promote 12 - * products derived from this software without specific prior written 13 - * permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 14 6 * 15 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 - * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 - * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 - * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 27 11 */ 28 12 29 13 #ifndef __ASM_ARCH_MSM_SMP_H
+27 -14
arch/arm/mach-msm/io.c
··· 3 3 * MSM7K, QSD io support 4 4 * 5 5 * Copyright (C) 2007 Google, Inc. 6 - * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 6 + * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved. 7 7 * Author: Brian Swetland <swetland@google.com> 8 8 * 9 9 * This software is licensed under the terms of the GNU General Public ··· 28 28 29 29 #include <mach/board.h> 30 30 31 - #define MSM_DEVICE(name) { \ 31 + #define MSM_CHIP_DEVICE(name, chip) { \ 32 32 .virtual = (unsigned long) MSM_##name##_BASE, \ 33 - .pfn = __phys_to_pfn(MSM_##name##_PHYS), \ 34 - .length = MSM_##name##_SIZE, \ 33 + .pfn = __phys_to_pfn(chip##_##name##_PHYS), \ 34 + .length = chip##_##name##_SIZE, \ 35 35 .type = MT_DEVICE_NONSHARED, \ 36 36 } 37 + 38 + #define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM) 37 39 38 40 #if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \ 39 41 || defined(CONFIG_ARCH_MSM7X25) 40 42 static struct map_desc msm_io_desc[] __initdata = { 41 43 MSM_DEVICE(VIC), 42 - MSM_DEVICE(CSR), 43 - MSM_DEVICE(GPT), 44 + MSM_CHIP_DEVICE(CSR, MSM7X00), 44 45 MSM_DEVICE(DMOV), 45 46 MSM_DEVICE(GPIO1), 46 47 MSM_DEVICE(GPIO2), ··· 74 73 #ifdef CONFIG_ARCH_QSD8X50 75 74 static struct map_desc qsd8x50_io_desc[] __initdata = { 76 75 MSM_DEVICE(VIC), 77 - MSM_DEVICE(CSR), 78 - MSM_DEVICE(TMR), 76 + MSM_CHIP_DEVICE(CSR, QSD8X50), 79 77 MSM_DEVICE(DMOV), 80 78 MSM_DEVICE(GPIO1), 81 79 MSM_DEVICE(GPIO2), ··· 102 102 103 103 #ifdef CONFIG_ARCH_MSM8X60 104 104 static struct map_desc msm8x60_io_desc[] __initdata = { 105 - MSM_DEVICE(QGIC_DIST), 106 - MSM_DEVICE(QGIC_CPU), 107 - MSM_DEVICE(TMR), 108 - MSM_DEVICE(TMR0), 105 + MSM_CHIP_DEVICE(QGIC_DIST, MSM8X60), 106 + MSM_CHIP_DEVICE(QGIC_CPU, MSM8X60), 107 + MSM_CHIP_DEVICE(TMR, MSM8X60), 108 + MSM_CHIP_DEVICE(TMR0, MSM8X60), 109 109 MSM_DEVICE(ACC), 110 110 MSM_DEVICE(GCC), 111 111 }; ··· 116 116 } 117 117 #endif /* CONFIG_ARCH_MSM8X60 */ 118 118 119 + #ifdef CONFIG_ARCH_MSM8960 120 + static struct map_desc msm8960_io_desc[] __initdata = { 121 + MSM_CHIP_DEVICE(QGIC_DIST, MSM8960), 122 + MSM_CHIP_DEVICE(QGIC_CPU, MSM8960), 123 + MSM_CHIP_DEVICE(TMR, MSM8960), 124 + MSM_CHIP_DEVICE(TMR0, MSM8960), 125 + }; 126 + 127 + void __init msm_map_msm8960_io(void) 128 + { 129 + iotable_init(msm8960_io_desc, ARRAY_SIZE(msm8960_io_desc)); 130 + } 131 + #endif /* CONFIG_ARCH_MSM8960 */ 132 + 119 133 #ifdef CONFIG_ARCH_MSM7X30 120 134 static struct map_desc msm7x30_io_desc[] __initdata = { 121 135 MSM_DEVICE(VIC), 122 - MSM_DEVICE(CSR), 123 - MSM_DEVICE(TMR), 136 + MSM_CHIP_DEVICE(CSR, MSM7X30), 124 137 MSM_DEVICE(DMOV), 125 138 MSM_DEVICE(GPIO1), 126 139 MSM_DEVICE(GPIO2),
+62 -12
arch/arm/mach-msm/iommu.c
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1 + /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 2 2 * 3 3 * This program is free software; you can redistribute it and/or modify 4 4 * it under the terms of the GNU General Public License version 2 and ··· 26 26 #include <linux/spinlock.h> 27 27 #include <linux/slab.h> 28 28 #include <linux/iommu.h> 29 + #include <linux/clk.h> 29 30 30 31 #include <asm/cacheflush.h> 31 32 #include <asm/sizes.h> ··· 50 49 unsigned long *pgtable; 51 50 struct list_head list_attached; 52 51 }; 52 + 53 + static int __enable_clocks(struct msm_iommu_drvdata *drvdata) 54 + { 55 + int ret; 56 + 57 + ret = clk_enable(drvdata->pclk); 58 + if (ret) 59 + goto fail; 60 + 61 + if (drvdata->clk) { 62 + ret = clk_enable(drvdata->clk); 63 + if (ret) 64 + clk_disable(drvdata->pclk); 65 + } 66 + fail: 67 + return ret; 68 + } 69 + 70 + static void __disable_clocks(struct msm_iommu_drvdata *drvdata) 71 + { 72 + if (drvdata->clk) 73 + clk_disable(drvdata->clk); 74 + clk_disable(drvdata->pclk); 75 + } 53 76 54 77 static int __flush_iotlb(struct iommu_domain *domain) 55 78 { ··· 102 77 BUG(); 103 78 104 79 iommu_drvdata = dev_get_drvdata(ctx_drvdata->pdev->dev.parent); 105 - SET_CTX_TLBIALL(iommu_drvdata->base, ctx_drvdata->num, 0); 106 - } 80 + BUG_ON(!iommu_drvdata); 107 81 82 + ret = __enable_clocks(iommu_drvdata); 83 + if (ret) 84 + goto fail; 85 + 86 + SET_CTX_TLBIALL(iommu_drvdata->base, ctx_drvdata->num, 0); 87 + __disable_clocks(iommu_drvdata); 88 + } 89 + fail: 108 90 return ret; 109 91 } 110 92 ··· 137 105 SET_TLBLKCR(base, ctx, 0); 138 106 SET_PRRR(base, ctx, 0); 139 107 SET_NMRR(base, ctx, 0); 140 - SET_CONTEXTIDR(base, ctx, 0); 141 108 } 142 109 143 110 static void __program_context(void __iomem *base, int ctx, phys_addr_t pgtable) ··· 296 265 goto fail; 297 266 } 298 267 268 + ret = __enable_clocks(iommu_drvdata); 269 + if (ret) 270 + goto fail; 271 + 299 272 __program_context(iommu_drvdata->base, ctx_dev->num, 300 273 __pa(priv->pgtable)); 301 274 275 + __disable_clocks(iommu_drvdata); 302 276 list_add(&(ctx_drvdata->attached_elm), &priv->list_attached); 303 277 ret = __flush_iotlb(domain); 304 278 ··· 339 303 if (ret) 340 304 goto fail; 341 305 306 + ret = __enable_clocks(iommu_drvdata); 307 + if (ret) 308 + goto fail; 309 + 342 310 __reset_context(iommu_drvdata->base, ctx_dev->num); 311 + __disable_clocks(iommu_drvdata); 343 312 list_del_init(&ctx_drvdata->attached_elm); 344 313 345 314 fail: ··· 417 376 for (i = 0; i < 16; i++) 418 377 *(fl_pte+i) = (pa & 0xFF000000) | FL_SUPERSECTION | 419 378 FL_AP_READ | FL_AP_WRITE | FL_TYPE_SECT | 420 - FL_SHARED | pgprot; 379 + FL_SHARED | FL_NG | pgprot; 421 380 } 422 381 423 382 if (len == SZ_1M) 424 - *fl_pte = (pa & 0xFFF00000) | FL_AP_READ | FL_AP_WRITE | 383 + *fl_pte = (pa & 0xFFF00000) | FL_AP_READ | FL_AP_WRITE | FL_NG | 425 384 FL_TYPE_SECT | FL_SHARED | pgprot; 426 385 427 386 /* Need a 2nd level table */ ··· 446 405 447 406 448 407 if (len == SZ_4K) 449 - *sl_pte = (pa & SL_BASE_MASK_SMALL) | SL_AP0 | SL_AP1 | 408 + *sl_pte = (pa & SL_BASE_MASK_SMALL) | SL_AP0 | SL_AP1 | SL_NG | 450 409 SL_SHARED | SL_TYPE_SMALL | pgprot; 451 410 452 411 if (len == SZ_64K) { ··· 454 413 455 414 for (i = 0; i < 16; i++) 456 415 *(sl_pte+i) = (pa & SL_BASE_MASK_LARGE) | SL_AP0 | 457 - SL_AP1 | SL_SHARED | SL_TYPE_LARGE | pgprot; 416 + SL_NG | SL_AP1 | SL_SHARED | SL_TYPE_LARGE | pgprot; 458 417 } 459 418 460 419 ret = __flush_iotlb(domain); ··· 573 532 base = iommu_drvdata->base; 574 533 ctx = ctx_drvdata->num; 575 534 535 + ret = __enable_clocks(iommu_drvdata); 536 + if (ret) 537 + goto fail; 538 + 576 539 /* Invalidate context TLB */ 577 540 SET_CTX_TLBIALL(base, ctx, 0); 578 - SET_V2PPR_VA(base, ctx, va >> V2Pxx_VA_SHIFT); 541 + SET_V2PPR(base, ctx, va & V2Pxx_VA); 579 542 580 543 par = GET_PAR(base, ctx); 581 544 ··· 592 547 if (GET_FAULT(base, ctx)) 593 548 ret = 0; 594 549 550 + __disable_clocks(iommu_drvdata); 595 551 fail: 596 552 spin_unlock_irqrestore(&msm_iommu_lock, flags); 597 553 return ret; ··· 636 590 struct msm_iommu_drvdata *drvdata = dev_id; 637 591 void __iomem *base; 638 592 unsigned int fsr; 639 - int ncb, i; 593 + int i, ret; 640 594 641 595 spin_lock(&msm_iommu_lock); 642 596 ··· 650 604 pr_err("Unexpected IOMMU page fault!\n"); 651 605 pr_err("base = %08x\n", (unsigned int) base); 652 606 653 - ncb = GET_NCB(base)+1; 654 - for (i = 0; i < ncb; i++) { 607 + ret = __enable_clocks(drvdata); 608 + if (ret) 609 + goto fail; 610 + 611 + for (i = 0; i < drvdata->ncb; i++) { 655 612 fsr = GET_FSR(base, i); 656 613 if (fsr) { 657 614 pr_err("Fault occurred in context %d.\n", i); ··· 663 614 SET_FSR(base, i, 0x4000000F); 664 615 } 665 616 } 617 + __disable_clocks(drvdata); 666 618 fail: 667 619 spin_unlock(&msm_iommu_lock); 668 620 return 0;
+154 -110
arch/arm/mach-msm/iommu_dev.c
··· 1 - /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1 + /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 2 2 * 3 3 * This program is free software; you can redistribute it and/or modify 4 4 * it under the terms of the GNU General Public License version 2 and ··· 29 29 30 30 #include <mach/iommu_hw-8xxx.h> 31 31 #include <mach/iommu.h> 32 + #include <mach/clk.h> 32 33 33 34 struct iommu_ctx_iter_data { 34 35 /* input */ ··· 85 84 } 86 85 EXPORT_SYMBOL(msm_iommu_get_ctx); 87 86 88 - static void msm_iommu_reset(void __iomem *base) 87 + static void msm_iommu_reset(void __iomem *base, int ncb) 89 88 { 90 - int ctx, ncb; 89 + int ctx; 91 90 92 91 SET_RPUE(base, 0); 93 92 SET_RPUEIE(base, 0); ··· 100 99 SET_GLOBAL_TLBIALL(base, 0); 101 100 SET_RPU_ACR(base, 0); 102 101 SET_TLBLKCRWE(base, 1); 103 - ncb = GET_NCB(base)+1; 104 102 105 103 for (ctx = 0; ctx < ncb; ctx++) { 106 104 SET_BPRCOSH(base, ctx, 0); ··· 130 130 { 131 131 struct resource *r, *r2; 132 132 struct clk *iommu_clk; 133 + struct clk *iommu_pclk; 133 134 struct msm_iommu_drvdata *drvdata; 134 135 struct msm_iommu_dev *iommu_dev = pdev->dev.platform_data; 135 136 void __iomem *regs_base; 136 137 resource_size_t len; 137 - int ret = 0, ncb, nm2v, irq; 138 + int ret, irq, par; 138 139 139 - if (pdev->id != -1) { 140 - drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); 141 - 142 - if (!drvdata) { 143 - ret = -ENOMEM; 144 - goto fail; 145 - } 146 - 147 - if (!iommu_dev) { 148 - ret = -ENODEV; 149 - goto fail; 150 - } 151 - 152 - if (iommu_dev->clk_rate != 0) { 153 - iommu_clk = clk_get(&pdev->dev, "iommu_clk"); 154 - 155 - if (IS_ERR(iommu_clk)) { 156 - ret = -ENODEV; 157 - goto fail; 158 - } 159 - 160 - if (iommu_dev->clk_rate > 0) { 161 - ret = clk_set_rate(iommu_clk, 162 - iommu_dev->clk_rate); 163 - if (ret) { 164 - clk_put(iommu_clk); 165 - goto fail; 166 - } 167 - } 168 - 169 - ret = clk_enable(iommu_clk); 170 - if (ret) { 171 - clk_put(iommu_clk); 172 - goto fail; 173 - } 174 - clk_put(iommu_clk); 175 - } 176 - 177 - r = platform_get_resource_byname(pdev, IORESOURCE_MEM, 178 - "physbase"); 179 - if (!r) { 180 - ret = -ENODEV; 181 - goto fail; 182 - } 183 - 184 - len = r->end - r->start + 1; 185 - 186 - r2 = request_mem_region(r->start, len, r->name); 187 - if (!r2) { 188 - pr_err("Could not request memory region: " 189 - "start=%p, len=%d\n", (void *) r->start, len); 190 - ret = -EBUSY; 191 - goto fail; 192 - } 193 - 194 - regs_base = ioremap(r2->start, len); 195 - 196 - if (!regs_base) { 197 - pr_err("Could not ioremap: start=%p, len=%d\n", 198 - (void *) r2->start, len); 199 - ret = -EBUSY; 200 - goto fail_mem; 201 - } 202 - 203 - irq = platform_get_irq_byname(pdev, "secure_irq"); 204 - if (irq < 0) { 205 - ret = -ENODEV; 206 - goto fail_io; 207 - } 208 - 209 - mb(); 210 - 211 - if (GET_IDR(regs_base) == 0) { 212 - pr_err("Invalid IDR value detected\n"); 213 - ret = -ENODEV; 214 - goto fail_io; 215 - } 216 - 217 - ret = request_irq(irq, msm_iommu_fault_handler, 0, 218 - "msm_iommu_secure_irpt_handler", drvdata); 219 - if (ret) { 220 - pr_err("Request IRQ %d failed with ret=%d\n", irq, ret); 221 - goto fail_io; 222 - } 223 - 224 - msm_iommu_reset(regs_base); 225 - drvdata->base = regs_base; 226 - drvdata->irq = irq; 227 - 228 - nm2v = GET_NM2VCBMT((unsigned long) regs_base); 229 - ncb = GET_NCB((unsigned long) regs_base); 230 - 231 - pr_info("device %s mapped at %p, irq %d with %d ctx banks\n", 232 - iommu_dev->name, regs_base, irq, ncb+1); 233 - 234 - platform_set_drvdata(pdev, drvdata); 235 - } else 140 + if (pdev->id == -1) { 236 141 msm_iommu_root_dev = pdev; 142 + return 0; 143 + } 144 + 145 + drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); 146 + 147 + if (!drvdata) { 148 + ret = -ENOMEM; 149 + goto fail; 150 + } 151 + 152 + if (!iommu_dev) { 153 + ret = -ENODEV; 154 + goto fail; 155 + } 156 + 157 + iommu_pclk = clk_get(NULL, "smmu_pclk"); 158 + if (IS_ERR(iommu_pclk)) { 159 + ret = -ENODEV; 160 + goto fail; 161 + } 162 + 163 + ret = clk_enable(iommu_pclk); 164 + if (ret) 165 + goto fail_enable; 166 + 167 + iommu_clk = clk_get(&pdev->dev, "iommu_clk"); 168 + 169 + if (!IS_ERR(iommu_clk)) { 170 + if (clk_get_rate(iommu_clk) == 0) 171 + clk_set_min_rate(iommu_clk, 1); 172 + 173 + ret = clk_enable(iommu_clk); 174 + if (ret) { 175 + clk_put(iommu_clk); 176 + goto fail_pclk; 177 + } 178 + } else 179 + iommu_clk = NULL; 180 + 181 + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "physbase"); 182 + 183 + if (!r) { 184 + ret = -ENODEV; 185 + goto fail_clk; 186 + } 187 + 188 + len = resource_size(r); 189 + 190 + r2 = request_mem_region(r->start, len, r->name); 191 + if (!r2) { 192 + pr_err("Could not request memory region: start=%p, len=%d\n", 193 + (void *) r->start, len); 194 + ret = -EBUSY; 195 + goto fail_clk; 196 + } 197 + 198 + regs_base = ioremap(r2->start, len); 199 + 200 + if (!regs_base) { 201 + pr_err("Could not ioremap: start=%p, len=%d\n", 202 + (void *) r2->start, len); 203 + ret = -EBUSY; 204 + goto fail_mem; 205 + } 206 + 207 + irq = platform_get_irq_byname(pdev, "secure_irq"); 208 + if (irq < 0) { 209 + ret = -ENODEV; 210 + goto fail_io; 211 + } 212 + 213 + msm_iommu_reset(regs_base, iommu_dev->ncb); 214 + 215 + SET_M(regs_base, 0, 1); 216 + SET_PAR(regs_base, 0, 0); 217 + SET_V2PCFG(regs_base, 0, 1); 218 + SET_V2PPR(regs_base, 0, 0); 219 + par = GET_PAR(regs_base, 0); 220 + SET_V2PCFG(regs_base, 0, 0); 221 + SET_M(regs_base, 0, 0); 222 + 223 + if (!par) { 224 + pr_err("%s: Invalid PAR value detected\n", iommu_dev->name); 225 + ret = -ENODEV; 226 + goto fail_io; 227 + } 228 + 229 + ret = request_irq(irq, msm_iommu_fault_handler, 0, 230 + "msm_iommu_secure_irpt_handler", drvdata); 231 + if (ret) { 232 + pr_err("Request IRQ %d failed with ret=%d\n", irq, ret); 233 + goto fail_io; 234 + } 235 + 236 + 237 + drvdata->pclk = iommu_pclk; 238 + drvdata->clk = iommu_clk; 239 + drvdata->base = regs_base; 240 + drvdata->irq = irq; 241 + drvdata->ncb = iommu_dev->ncb; 242 + 243 + pr_info("device %s mapped at %p, irq %d with %d ctx banks\n", 244 + iommu_dev->name, regs_base, irq, iommu_dev->ncb); 245 + 246 + platform_set_drvdata(pdev, drvdata); 247 + 248 + if (iommu_clk) 249 + clk_disable(iommu_clk); 250 + 251 + clk_disable(iommu_pclk); 237 252 238 253 return 0; 239 - 240 254 fail_io: 241 255 iounmap(regs_base); 242 256 fail_mem: 243 257 release_mem_region(r->start, len); 258 + fail_clk: 259 + if (iommu_clk) { 260 + clk_disable(iommu_clk); 261 + clk_put(iommu_clk); 262 + } 263 + fail_pclk: 264 + clk_disable(iommu_pclk); 265 + fail_enable: 266 + clk_put(iommu_pclk); 244 267 fail: 245 268 kfree(drvdata); 246 269 return ret; ··· 275 252 276 253 drv = platform_get_drvdata(pdev); 277 254 if (drv) { 278 - memset(drv, 0, sizeof(struct msm_iommu_drvdata)); 255 + if (drv->clk) 256 + clk_put(drv->clk); 257 + clk_put(drv->pclk); 258 + memset(drv, 0, sizeof(*drv)); 279 259 kfree(drv); 280 260 platform_set_drvdata(pdev, NULL); 281 261 } ··· 290 264 struct msm_iommu_ctx_dev *c = pdev->dev.platform_data; 291 265 struct msm_iommu_drvdata *drvdata; 292 266 struct msm_iommu_ctx_drvdata *ctx_drvdata = NULL; 293 - int i, ret = 0; 267 + int i, ret; 294 268 if (!c || !pdev->dev.parent) { 295 269 ret = -EINVAL; 296 270 goto fail; ··· 314 288 INIT_LIST_HEAD(&ctx_drvdata->attached_elm); 315 289 platform_set_drvdata(pdev, ctx_drvdata); 316 290 291 + ret = clk_enable(drvdata->pclk); 292 + if (ret) 293 + goto fail; 294 + 295 + if (drvdata->clk) { 296 + ret = clk_enable(drvdata->clk); 297 + if (ret) { 298 + clk_disable(drvdata->pclk); 299 + goto fail; 300 + } 301 + } 302 + 317 303 /* Program the M2V tables for this context */ 318 304 for (i = 0; i < MAX_NUM_MIDS; i++) { 319 305 int mid = c->mids[i]; ··· 335 297 SET_M2VCBR_N(drvdata->base, mid, 0); 336 298 SET_CBACR_N(drvdata->base, c->num, 0); 337 299 338 - /* Set VMID = MID */ 339 - SET_VMID(drvdata->base, mid, mid); 300 + /* Set VMID = 0 */ 301 + SET_VMID(drvdata->base, mid, 0); 340 302 341 303 /* Set the context number for that MID to this context */ 342 304 SET_CBNDX(drvdata->base, mid, c->num); 343 305 344 - /* Set MID associated with this context bank */ 345 - SET_CBVMID(drvdata->base, c->num, mid); 306 + /* Set MID associated with this context bank to 0*/ 307 + SET_CBVMID(drvdata->base, c->num, 0); 308 + 309 + /* Set the ASID for TLB tagging for this context */ 310 + SET_CONTEXTIDR_ASID(drvdata->base, c->num, c->num); 346 311 347 312 /* Set security bit override to be Non-secure */ 348 313 SET_NSCFG(drvdata->base, mid, 3); 349 314 } 350 315 351 - pr_info("context device %s with bank index %d\n", c->name, c->num); 316 + if (drvdata->clk) 317 + clk_disable(drvdata->clk); 318 + clk_disable(drvdata->pclk); 352 319 320 + dev_info(&pdev->dev, "context %s using bank %d\n", c->name, c->num); 353 321 return 0; 354 322 fail: 355 323 kfree(ctx_drvdata);
+7 -23
arch/arm/mach-msm/scm-boot.h
··· 1 1 /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 27 11 */ 28 12 #ifndef __MACH_SCM_BOOT_H 29 13 #define __MACH_SCM_BOOT_H
+32 -26
arch/arm/mach-msm/scm.c
··· 174 174 register u32 r0 asm("r0") = 1; 175 175 register u32 r1 asm("r1") = (u32)&context_id; 176 176 register u32 r2 asm("r2") = cmd_addr; 177 - asm( 178 - __asmeq("%0", "r0") 179 - __asmeq("%1", "r0") 180 - __asmeq("%2", "r1") 181 - __asmeq("%3", "r2") 182 - "smc #0 @ switch to secure world\n" 183 - : "=r" (r0) 184 - : "r" (r0), "r" (r1), "r" (r2) 185 - : "r3"); 177 + do { 178 + asm volatile( 179 + __asmeq("%0", "r0") 180 + __asmeq("%1", "r0") 181 + __asmeq("%2", "r1") 182 + __asmeq("%3", "r2") 183 + "smc #0 @ switch to secure world\n" 184 + : "=r" (r0) 185 + : "r" (r0), "r" (r1), "r" (r2) 186 + : "r3"); 187 + } while (r0 == SCM_INTERRUPTED); 188 + 186 189 return r0; 187 190 } 188 191 ··· 200 197 * side in the buffer. 201 198 */ 202 199 flush_cache_all(); 203 - do { 204 - ret = smc(cmd_addr); 205 - if (ret < 0) { 206 - ret = scm_remap_error(ret); 207 - break; 208 - } 209 - } while (ret == SCM_INTERRUPTED); 200 + ret = smc(cmd_addr); 201 + if (ret < 0) 202 + ret = scm_remap_error(ret); 210 203 211 204 return ret; 212 205 } ··· 263 264 { 264 265 int context_id; 265 266 static u32 version = -1; 266 - register u32 r0 asm("r0") = 0x1 << 8; 267 - register u32 r1 asm("r1") = (u32)&context_id; 267 + register u32 r0 asm("r0"); 268 + register u32 r1 asm("r1"); 268 269 269 270 if (version != -1) 270 271 return version; 271 272 272 273 mutex_lock(&scm_lock); 273 - asm( 274 - __asmeq("%0", "r1") 275 - __asmeq("%1", "r0") 276 - __asmeq("%2", "r1") 277 - "smc #0 @ switch to secure world\n" 278 - : "=r" (r1) 279 - : "r" (r0), "r" (r1) 280 - : "r2", "r3"); 274 + 275 + r0 = 0x1 << 8; 276 + r1 = (u32)&context_id; 277 + do { 278 + asm volatile( 279 + __asmeq("%0", "r0") 280 + __asmeq("%1", "r1") 281 + __asmeq("%2", "r0") 282 + __asmeq("%3", "r1") 283 + "smc #0 @ switch to secure world\n" 284 + : "=r" (r0), "=r" (r1) 285 + : "r" (r0), "r" (r1) 286 + : "r2", "r3"); 287 + } while (r0 == SCM_INTERRUPTED); 288 + 281 289 version = r1; 282 290 mutex_unlock(&scm_lock); 283 291
+7 -23
arch/arm/mach-msm/scm.h
··· 1 1 /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 2 2 * 3 - * Redistribution and use in source and binary forms, with or without 4 - * modification, are permitted provided that the following conditions are 5 - * met: 6 - * * Redistributions of source code must retain the above copyright 7 - * notice, this list of conditions and the following disclaimer. 8 - * * Redistributions in binary form must reproduce the above 9 - * copyright notice, this list of conditions and the following 10 - * disclaimer in the documentation and/or other materials provided 11 - * with the distribution. 12 - * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13 - * contributors may be used to endorse or promote products derived 14 - * from this software without specific prior written permission. 3 + * This program is free software; you can redistribute it and/or modify 4 + * it under the terms of the GNU General Public License version 2 and 5 + * only version 2 as published by the Free Software Foundation. 15 6 * 16 - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 27 11 */ 28 12 #ifndef __MACH_SCM_H 29 13 #define __MACH_SCM_H
+27 -19
arch/arm/mach-msm/timer.c
··· 24 24 25 25 #include <asm/mach/time.h> 26 26 #include <mach/msm_iomap.h> 27 - 28 - #ifndef MSM_DGT_BASE 29 - #define MSM_DGT_BASE (MSM_GPT_BASE + 0x10) 30 - #endif 27 + #include <mach/cpu.h> 31 28 32 29 #define TIMER_MATCH_VAL 0x0000 33 30 #define TIMER_COUNT_VAL 0x0004 ··· 49 52 GLOBAL_TIMER = 1, 50 53 }; 51 54 52 - #ifdef MSM_TMR0_BASE 53 - #define MSM_TMR_GLOBAL (MSM_TMR0_BASE - MSM_TMR_BASE) 54 - #else 55 - #define MSM_TMR_GLOBAL 0 56 - #endif 57 - 58 55 #define MSM_GLOBAL_TIMER MSM_CLOCK_DGT 59 56 57 + /* TODO: Remove these ifdefs */ 60 58 #if defined(CONFIG_ARCH_QSD8X50) 61 59 #define DGT_HZ (19200000 / 4) /* 19.2 MHz / 4 by default */ 62 60 #define MSM_DGT_SHIFT (0) 63 - #elif defined(CONFIG_ARCH_MSM7X30) || defined(CONFIG_ARCH_MSM8X60) 61 + #elif defined(CONFIG_ARCH_MSM7X30) || defined(CONFIG_ARCH_MSM8X60) || \ 62 + defined(CONFIG_ARCH_MSM8960) 64 63 #define DGT_HZ (24576000 / 4) /* 24.576 MHz (LPXO) / 4 by default */ 65 64 #define MSM_DGT_SHIFT (0) 66 65 #else ··· 170 177 .dev_id = &msm_clocks[0].clockevent, 171 178 .irq = INT_GP_TIMER_EXP 172 179 }, 173 - .regbase = MSM_GPT_BASE, 174 180 .freq = GPT_HZ, 175 - .local_counter = MSM_GPT_BASE + TIMER_COUNT_VAL, 176 - .global_counter = MSM_GPT_BASE + TIMER_COUNT_VAL + 177 - MSM_TMR_GLOBAL, 178 181 }, 179 182 [MSM_CLOCK_DGT] = { 180 183 .clockevent = { ··· 195 206 .dev_id = &msm_clocks[1].clockevent, 196 207 .irq = INT_DEBUG_TIMER_EXP 197 208 }, 198 - .regbase = MSM_DGT_BASE, 199 209 .freq = DGT_HZ >> MSM_DGT_SHIFT, 200 210 .shift = MSM_DGT_SHIFT, 201 - .local_counter = MSM_DGT_BASE + TIMER_COUNT_VAL, 202 - .global_counter = MSM_DGT_BASE + TIMER_COUNT_VAL + 203 - MSM_TMR_GLOBAL, 204 211 } 205 212 }; 206 213 ··· 204 219 { 205 220 int i; 206 221 int res; 222 + int global_offset = 0; 223 + 224 + if (cpu_is_msm7x01()) { 225 + msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE; 226 + msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x10; 227 + } else if (cpu_is_msm7x30()) { 228 + msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE + 0x04; 229 + msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x24; 230 + } else if (cpu_is_qsd8x50()) { 231 + msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE; 232 + msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x10; 233 + } else if (cpu_is_msm8x60() || cpu_is_msm8960()) { 234 + msm_clocks[MSM_CLOCK_GPT].regbase = MSM_TMR_BASE + 0x04; 235 + msm_clocks[MSM_CLOCK_DGT].regbase = MSM_TMR_BASE + 0x24; 236 + 237 + /* Use CPU0's timer as the global timer. */ 238 + global_offset = MSM_TMR0_BASE - MSM_TMR_BASE; 239 + } else 240 + BUG(); 207 241 208 242 #ifdef CONFIG_ARCH_MSM_SCORPIONMP 209 243 writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL); ··· 232 228 struct msm_clock *clock = &msm_clocks[i]; 233 229 struct clock_event_device *ce = &clock->clockevent; 234 230 struct clocksource *cs = &clock->clocksource; 231 + 232 + clock->local_counter = clock->regbase + TIMER_COUNT_VAL; 233 + clock->global_counter = clock->local_counter + global_offset; 234 + 235 235 writel(0, clock->regbase + TIMER_ENABLE); 236 236 writel(0, clock->regbase + TIMER_CLEAR); 237 237 writel(~0, clock->regbase + TIMER_MATCH_VAL);
+39 -1
drivers/mmc/host/msm_sdcc.c
··· 36 36 #include <linux/io.h> 37 37 #include <linux/memory.h> 38 38 #include <linux/gfp.h> 39 + #include <linux/gpio.h> 39 40 40 41 #include <asm/cacheflush.h> 41 42 #include <asm/div64.h> ··· 942 941 spin_unlock_irqrestore(&host->lock, flags); 943 942 } 944 943 944 + static void msmsdcc_setup_gpio(struct msmsdcc_host *host, bool enable) 945 + { 946 + struct msm_mmc_gpio_data *curr; 947 + int i, rc = 0; 948 + 949 + if (!host->plat->gpio_data && host->gpio_config_status == enable) 950 + return; 951 + 952 + curr = host->plat->gpio_data; 953 + for (i = 0; i < curr->size; i++) { 954 + if (enable) { 955 + rc = gpio_request(curr->gpio[i].no, 956 + curr->gpio[i].name); 957 + if (rc) { 958 + pr_err("%s: gpio_request(%d, %s) failed %d\n", 959 + mmc_hostname(host->mmc), 960 + curr->gpio[i].no, 961 + curr->gpio[i].name, rc); 962 + goto free_gpios; 963 + } 964 + } else { 965 + gpio_free(curr->gpio[i].no); 966 + } 967 + } 968 + host->gpio_config_status = enable; 969 + return; 970 + 971 + free_gpios: 972 + for (; i >= 0; i--) 973 + gpio_free(curr->gpio[i].no); 974 + } 975 + 945 976 static void 946 977 msmsdcc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) 947 978 { ··· 985 952 spin_lock_irqsave(&host->lock, flags); 986 953 987 954 msmsdcc_enable_clocks(host); 955 + 956 + spin_unlock_irqrestore(&host->lock, flags); 988 957 989 958 if (ios->clock) { 990 959 if (ios->clock != host->clk_rate) { ··· 1014 979 1015 980 switch (ios->power_mode) { 1016 981 case MMC_POWER_OFF: 982 + msmsdcc_setup_gpio(host, false); 1017 983 break; 1018 984 case MMC_POWER_UP: 1019 985 pwr |= MCI_PWR_UP; 986 + msmsdcc_setup_gpio(host, true); 1020 987 break; 1021 988 case MMC_POWER_ON: 1022 989 pwr |= MCI_PWR_ON; ··· 1035 998 msmsdcc_writel(host, pwr, MMCIPOWER); 1036 999 } 1037 1000 #if BUSCLK_PWRSAVE 1001 + spin_lock_irqsave(&host->lock, flags); 1038 1002 msmsdcc_disable_clocks(host, 1); 1039 - #endif 1040 1003 spin_unlock_irqrestore(&host->lock, flags); 1004 + #endif 1041 1005 } 1042 1006 1043 1007 static void msmsdcc_enable_sdio_irq(struct mmc_host *mmc, int enable)
+1
drivers/mmc/host/msm_sdcc.h
··· 243 243 unsigned int cmd_datactrl; 244 244 struct mmc_command *cmd_cmd; 245 245 u32 cmd_c; 246 + bool gpio_config_status; 246 247 247 248 bool prog_scan; 248 249 bool prog_enable;
+247 -39
drivers/tty/serial/msm_serial.c
··· 3 3 * 4 4 * Copyright (C) 2007 Google, Inc. 5 5 * Author: Robert Love <rlove@google.com> 6 + * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 6 7 * 7 8 * This software is licensed under the terms of the GNU General Public 8 9 * License version 2, as published by the Free Software Foundation, and ··· 32 31 #include <linux/serial.h> 33 32 #include <linux/clk.h> 34 33 #include <linux/platform_device.h> 34 + #include <linux/delay.h> 35 35 36 36 #include "msm_serial.h" 37 37 ··· 40 38 struct uart_port uart; 41 39 char name[16]; 42 40 struct clk *clk; 41 + struct clk *pclk; 43 42 unsigned int imr; 43 + unsigned int *gsbi_base; 44 + int is_uartdm; 45 + unsigned int old_snap_state; 44 46 }; 47 + 48 + static inline void wait_for_xmitr(struct uart_port *port, int bits) 49 + { 50 + if (!(msm_read(port, UART_SR) & UART_SR_TX_EMPTY)) 51 + while ((msm_read(port, UART_ISR) & bits) != bits) 52 + cpu_relax(); 53 + } 45 54 46 55 static void msm_stop_tx(struct uart_port *port) 47 56 { ··· 84 71 85 72 msm_port->imr |= UART_IMR_DELTA_CTS; 86 73 msm_write(port, msm_port->imr, UART_IMR); 74 + } 75 + 76 + static void handle_rx_dm(struct uart_port *port, unsigned int misr) 77 + { 78 + struct tty_struct *tty = port->state->port.tty; 79 + unsigned int sr; 80 + int count = 0; 81 + struct msm_port *msm_port = UART_TO_MSM(port); 82 + 83 + if ((msm_read(port, UART_SR) & UART_SR_OVERRUN)) { 84 + port->icount.overrun++; 85 + tty_insert_flip_char(tty, 0, TTY_OVERRUN); 86 + msm_write(port, UART_CR_CMD_RESET_ERR, UART_CR); 87 + } 88 + 89 + if (misr & UART_IMR_RXSTALE) { 90 + count = msm_read(port, UARTDM_RX_TOTAL_SNAP) - 91 + msm_port->old_snap_state; 92 + msm_port->old_snap_state = 0; 93 + } else { 94 + count = 4 * (msm_read(port, UART_RFWR)); 95 + msm_port->old_snap_state += count; 96 + } 97 + 98 + /* TODO: Precise error reporting */ 99 + 100 + port->icount.rx += count; 101 + 102 + while (count > 0) { 103 + unsigned int c; 104 + 105 + sr = msm_read(port, UART_SR); 106 + if ((sr & UART_SR_RX_READY) == 0) { 107 + msm_port->old_snap_state -= count; 108 + break; 109 + } 110 + c = msm_read(port, UARTDM_RF); 111 + if (sr & UART_SR_RX_BREAK) { 112 + port->icount.brk++; 113 + if (uart_handle_break(port)) 114 + continue; 115 + } else if (sr & UART_SR_PAR_FRAME_ERR) 116 + port->icount.frame++; 117 + 118 + /* TODO: handle sysrq */ 119 + tty_insert_flip_string(tty, (char *) &c, 120 + (count > 4) ? 4 : count); 121 + count -= 4; 122 + } 123 + 124 + tty_flip_buffer_push(tty); 125 + if (misr & (UART_IMR_RXSTALE)) 126 + msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR); 127 + msm_write(port, 0xFFFFFF, UARTDM_DMRX); 128 + msm_write(port, UART_CR_CMD_STALE_EVENT_ENABLE, UART_CR); 87 129 } 88 130 89 131 static void handle_rx(struct uart_port *port) ··· 189 121 tty_flip_buffer_push(tty); 190 122 } 191 123 124 + static void reset_dm_count(struct uart_port *port) 125 + { 126 + wait_for_xmitr(port, UART_ISR_TX_READY); 127 + msm_write(port, 1, UARTDM_NCF_TX); 128 + } 129 + 192 130 static void handle_tx(struct uart_port *port) 193 131 { 194 132 struct circ_buf *xmit = &port->state->xmit; ··· 202 128 int sent_tx; 203 129 204 130 if (port->x_char) { 205 - msm_write(port, port->x_char, UART_TF); 131 + if (msm_port->is_uartdm) 132 + reset_dm_count(port); 133 + 134 + msm_write(port, port->x_char, 135 + msm_port->is_uartdm ? UARTDM_TF : UART_TF); 206 136 port->icount.tx++; 207 137 port->x_char = 0; 208 138 } 139 + 140 + if (msm_port->is_uartdm) 141 + reset_dm_count(port); 209 142 210 143 while (msm_read(port, UART_SR) & UART_SR_TX_READY) { 211 144 if (uart_circ_empty(xmit)) { ··· 221 140 msm_write(port, msm_port->imr, UART_IMR); 222 141 break; 223 142 } 143 + msm_write(port, xmit->buf[xmit->tail], 144 + msm_port->is_uartdm ? UARTDM_TF : UART_TF); 224 145 225 - msm_write(port, xmit->buf[xmit->tail], UART_TF); 146 + if (msm_port->is_uartdm) 147 + reset_dm_count(port); 226 148 227 149 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 228 150 port->icount.tx++; ··· 253 169 misr = msm_read(port, UART_MISR); 254 170 msm_write(port, 0, UART_IMR); /* disable interrupt */ 255 171 256 - if (misr & (UART_IMR_RXLEV | UART_IMR_RXSTALE)) 257 - handle_rx(port); 172 + if (misr & (UART_IMR_RXLEV | UART_IMR_RXSTALE)) { 173 + if (msm_port->is_uartdm) 174 + handle_rx_dm(port, misr); 175 + else 176 + handle_rx(port); 177 + } 258 178 if (misr & UART_IMR_TXLEV) 259 179 handle_tx(port); 260 180 if (misr & UART_IMR_DELTA_CTS) ··· 280 192 return TIOCM_CAR | TIOCM_CTS | TIOCM_DSR | TIOCM_RTS; 281 193 } 282 194 283 - static void msm_set_mctrl(struct uart_port *port, unsigned int mctrl) 195 + 196 + static void msm_reset(struct uart_port *port) 197 + { 198 + /* reset everything */ 199 + msm_write(port, UART_CR_CMD_RESET_RX, UART_CR); 200 + msm_write(port, UART_CR_CMD_RESET_TX, UART_CR); 201 + msm_write(port, UART_CR_CMD_RESET_ERR, UART_CR); 202 + msm_write(port, UART_CR_CMD_RESET_BREAK_INT, UART_CR); 203 + msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR); 204 + msm_write(port, UART_CR_CMD_SET_RFR, UART_CR); 205 + } 206 + 207 + void msm_set_mctrl(struct uart_port *port, unsigned int mctrl) 284 208 { 285 209 unsigned int mr; 286 - 287 210 mr = msm_read(port, UART_MR1); 288 211 289 212 if (!(mctrl & TIOCM_RTS)) { ··· 318 219 static int msm_set_baud_rate(struct uart_port *port, unsigned int baud) 319 220 { 320 221 unsigned int baud_code, rxstale, watermark; 222 + struct msm_port *msm_port = UART_TO_MSM(port); 321 223 322 224 switch (baud) { 323 225 case 300: ··· 373 273 break; 374 274 } 375 275 276 + if (msm_port->is_uartdm) 277 + msm_write(port, UART_CR_CMD_RESET_RX, UART_CR); 278 + 376 279 msm_write(port, baud_code, UART_CSR); 377 280 378 281 /* RX stale watermark */ ··· 391 288 /* set TX watermark */ 392 289 msm_write(port, 10, UART_TFWR); 393 290 291 + if (msm_port->is_uartdm) { 292 + msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR); 293 + msm_write(port, 0xFFFFFF, UARTDM_DMRX); 294 + msm_write(port, UART_CR_CMD_STALE_EVENT_ENABLE, UART_CR); 295 + } 296 + 394 297 return baud; 395 298 } 396 299 397 - static void msm_reset(struct uart_port *port) 398 - { 399 - /* reset everything */ 400 - msm_write(port, UART_CR_CMD_RESET_RX, UART_CR); 401 - msm_write(port, UART_CR_CMD_RESET_TX, UART_CR); 402 - msm_write(port, UART_CR_CMD_RESET_ERR, UART_CR); 403 - msm_write(port, UART_CR_CMD_RESET_BREAK_INT, UART_CR); 404 - msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR); 405 - msm_write(port, UART_CR_CMD_SET_RFR, UART_CR); 406 - } 407 300 408 301 static void msm_init_clock(struct uart_port *port) 409 302 { 410 303 struct msm_port *msm_port = UART_TO_MSM(port); 411 304 412 305 clk_enable(msm_port->clk); 306 + if (!IS_ERR(msm_port->pclk)) 307 + clk_enable(msm_port->pclk); 413 308 msm_serial_set_mnd_regs(port); 414 309 } 415 310 ··· 448 347 msm_write(port, data, UART_IPR); 449 348 } 450 349 451 - msm_reset(port); 350 + data = 0; 351 + if (!port->cons || (port->cons && !(port->cons->flags & CON_ENABLED))) { 352 + msm_write(port, UART_CR_CMD_PROTECTION_EN, UART_CR); 353 + msm_reset(port); 354 + data = UART_CR_TX_ENABLE; 355 + } 452 356 453 - msm_write(port, 0x05, UART_CR); /* enable TX & RX */ 357 + data |= UART_CR_RX_ENABLE; 358 + msm_write(port, data, UART_CR); /* enable TX & RX */ 359 + 360 + /* Make sure IPR is not 0 to start with*/ 361 + if (msm_port->is_uartdm) 362 + msm_write(port, UART_IPR_STALE_LSB, UART_IPR); 454 363 455 364 /* turn on RX and CTS interrupts */ 456 365 msm_port->imr = UART_IMR_RXLEV | UART_IMR_RXSTALE | 457 366 UART_IMR_CURRENT_CTS; 458 - msm_write(port, msm_port->imr, UART_IMR); 459 367 368 + if (msm_port->is_uartdm) { 369 + msm_write(port, 0xFFFFFF, UARTDM_DMRX); 370 + msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR); 371 + msm_write(port, UART_CR_CMD_STALE_EVENT_ENABLE, UART_CR); 372 + } 373 + 374 + msm_write(port, msm_port->imr, UART_IMR); 460 375 return 0; 461 376 } 462 377 ··· 501 384 baud = msm_set_baud_rate(port, baud); 502 385 if (tty_termios_baud_rate(termios)) 503 386 tty_termios_encode_baud_rate(termios, baud, baud); 504 - 387 + 505 388 /* calculate parity */ 506 389 mr = msm_read(port, UART_MR2); 507 390 mr &= ~UART_MR2_PARITY_MODE; ··· 571 454 static void msm_release_port(struct uart_port *port) 572 455 { 573 456 struct platform_device *pdev = to_platform_device(port->dev); 574 - struct resource *resource; 457 + struct msm_port *msm_port = UART_TO_MSM(port); 458 + struct resource *uart_resource; 459 + struct resource *gsbi_resource; 575 460 resource_size_t size; 576 461 577 - resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); 578 - if (unlikely(!resource)) 462 + uart_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); 463 + if (unlikely(!uart_resource)) 579 464 return; 580 - size = resource->end - resource->start + 1; 465 + size = resource_size(uart_resource); 581 466 582 467 release_mem_region(port->mapbase, size); 583 468 iounmap(port->membase); 584 469 port->membase = NULL; 470 + 471 + if (msm_port->gsbi_base) { 472 + iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base + 473 + GSBI_CONTROL); 474 + 475 + gsbi_resource = platform_get_resource_byname(pdev, 476 + IORESOURCE_MEM, 477 + "gsbi_resource"); 478 + 479 + if (unlikely(!gsbi_resource)) 480 + return; 481 + 482 + size = resource_size(gsbi_resource); 483 + release_mem_region(gsbi_resource->start, size); 484 + iounmap(msm_port->gsbi_base); 485 + msm_port->gsbi_base = NULL; 486 + } 585 487 } 586 488 587 489 static int msm_request_port(struct uart_port *port) 588 490 { 491 + struct msm_port *msm_port = UART_TO_MSM(port); 589 492 struct platform_device *pdev = to_platform_device(port->dev); 590 - struct resource *resource; 493 + struct resource *uart_resource; 494 + struct resource *gsbi_resource; 591 495 resource_size_t size; 496 + int ret; 592 497 593 - resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); 594 - if (unlikely(!resource)) 498 + uart_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, 499 + "uart_resource"); 500 + if (unlikely(!uart_resource)) 595 501 return -ENXIO; 596 - size = resource->end - resource->start + 1; 597 502 598 - if (unlikely(!request_mem_region(port->mapbase, size, "msm_serial"))) 503 + size = resource_size(uart_resource); 504 + 505 + if (!request_mem_region(port->mapbase, size, "msm_serial")) 599 506 return -EBUSY; 600 507 601 508 port->membase = ioremap(port->mapbase, size); 602 509 if (!port->membase) { 603 - release_mem_region(port->mapbase, size); 604 - return -EBUSY; 510 + ret = -EBUSY; 511 + goto fail_release_port; 512 + } 513 + 514 + gsbi_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, 515 + "gsbi_resource"); 516 + /* Is this a GSBI-based port? */ 517 + if (gsbi_resource) { 518 + size = resource_size(gsbi_resource); 519 + 520 + if (!request_mem_region(gsbi_resource->start, size, 521 + "msm_serial")) { 522 + ret = -EBUSY; 523 + goto fail_release_port; 524 + } 525 + 526 + msm_port->gsbi_base = ioremap(gsbi_resource->start, size); 527 + if (!msm_port->gsbi_base) { 528 + ret = -EBUSY; 529 + goto fail_release_gsbi; 530 + } 605 531 } 606 532 607 533 return 0; 534 + 535 + fail_release_gsbi: 536 + release_mem_region(gsbi_resource->start, size); 537 + fail_release_port: 538 + release_mem_region(port->mapbase, size); 539 + return ret; 608 540 } 609 541 610 542 static void msm_config_port(struct uart_port *port, int flags) 611 543 { 544 + struct msm_port *msm_port = UART_TO_MSM(port); 545 + int ret; 612 546 if (flags & UART_CONFIG_TYPE) { 613 547 port->type = PORT_MSM; 614 - msm_request_port(port); 548 + ret = msm_request_port(port); 549 + if (ret) 550 + return; 615 551 } 552 + 553 + if (msm_port->is_uartdm) 554 + iowrite32(GSBI_PROTOCOL_UART, msm_port->gsbi_base + 555 + GSBI_CONTROL); 616 556 } 617 557 618 558 static int msm_verify_port(struct uart_port *port, struct serial_struct *ser) ··· 689 515 switch (state) { 690 516 case 0: 691 517 clk_enable(msm_port->clk); 518 + if (!IS_ERR(msm_port->pclk)) 519 + clk_enable(msm_port->pclk); 692 520 break; 693 521 case 3: 694 522 clk_disable(msm_port->clk); 523 + if (!IS_ERR(msm_port->pclk)) 524 + clk_disable(msm_port->pclk); 695 525 break; 696 526 default: 697 527 printk(KERN_ERR "msm_serial: Unknown PM state %d\n", state); ··· 728 550 .iotype = UPIO_MEM, 729 551 .ops = &msm_uart_pops, 730 552 .flags = UPF_BOOT_AUTOCONF, 731 - .fifosize = 512, 553 + .fifosize = 64, 732 554 .line = 0, 733 555 }, 734 556 }, ··· 737 559 .iotype = UPIO_MEM, 738 560 .ops = &msm_uart_pops, 739 561 .flags = UPF_BOOT_AUTOCONF, 740 - .fifosize = 512, 562 + .fifosize = 64, 741 563 .line = 1, 742 564 }, 743 565 }, ··· 763 585 764 586 static void msm_console_putchar(struct uart_port *port, int c) 765 587 { 588 + struct msm_port *msm_port = UART_TO_MSM(port); 589 + 590 + if (msm_port->is_uartdm) 591 + reset_dm_count(port); 592 + 766 593 while (!(msm_read(port, UART_SR) & UART_SR_TX_READY)) 767 594 ; 768 - msm_write(port, c, UART_TF); 595 + msm_write(port, c, msm_port->is_uartdm ? UARTDM_TF : UART_TF); 769 596 } 770 597 771 598 static void msm_console_write(struct console *co, const char *s, ··· 792 609 static int __init msm_console_setup(struct console *co, char *options) 793 610 { 794 611 struct uart_port *port; 612 + struct msm_port *msm_port; 795 613 int baud, flow, bits, parity; 796 614 797 615 if (unlikely(co->index >= UART_NR || co->index < 0)) 798 616 return -ENXIO; 799 617 800 618 port = get_port_from_line(co->index); 619 + msm_port = UART_TO_MSM(port); 801 620 802 621 if (unlikely(!port->membase)) 803 622 return -ENXIO; ··· 822 637 msm_set_baud_rate(port, baud); 823 638 824 639 msm_reset(port); 640 + 641 + if (msm_port->is_uartdm) { 642 + msm_write(port, UART_CR_CMD_PROTECTION_EN, UART_CR); 643 + msm_write(port, UART_CR_TX_ENABLE, UART_CR); 644 + } 825 645 826 646 printk(KERN_INFO "msm_serial: console setup on port #%d\n", port->line); 827 647 ··· 875 685 port->dev = &pdev->dev; 876 686 msm_port = UART_TO_MSM(port); 877 687 878 - msm_port->clk = clk_get(&pdev->dev, "uart_clk"); 879 - if (IS_ERR(msm_port->clk)) 880 - return PTR_ERR(msm_port->clk); 688 + if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "gsbi_resource")) 689 + msm_port->is_uartdm = 1; 690 + else 691 + msm_port->is_uartdm = 0; 692 + 693 + if (msm_port->is_uartdm) { 694 + msm_port->clk = clk_get(&pdev->dev, "gsbi_uart_clk"); 695 + msm_port->pclk = clk_get(&pdev->dev, "gsbi_pclk"); 696 + } else { 697 + msm_port->clk = clk_get(&pdev->dev, "uart_clk"); 698 + msm_port->pclk = ERR_PTR(-ENOENT); 699 + } 700 + 701 + if (unlikely(IS_ERR(msm_port->clk) || (IS_ERR(msm_port->pclk) && 702 + msm_port->is_uartdm))) 703 + return PTR_ERR(msm_port->clk); 704 + 705 + if (msm_port->is_uartdm) 706 + clk_set_rate(msm_port->clk, 7372800); 707 + 881 708 port->uartclk = clk_get_rate(msm_port->clk); 882 709 printk(KERN_INFO "uartclk = %d\n", port->uartclk); 883 710 884 711 885 - resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); 712 + resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, 713 + "uart_resource"); 886 714 if (unlikely(!resource)) 887 715 return -ENXIO; 888 716 port->mapbase = resource->start;
+22 -6
drivers/tty/serial/msm_serial.h
··· 3 3 * 4 4 * Copyright (C) 2007 Google, Inc. 5 5 * Author: Robert Love <rlove@google.com> 6 + * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 6 7 * 7 8 * This software is licensed under the terms of the GNU General Public 8 9 * License version 2, as published by the Free Software Foundation, and ··· 55 54 #define UART_CSR_300 0x22 56 55 57 56 #define UART_TF 0x000C 57 + #define UARTDM_TF 0x0070 58 58 59 59 #define UART_CR 0x0010 60 60 #define UART_CR_CMD_NULL (0 << 4) ··· 66 64 #define UART_CR_CMD_START_BREAK (5 << 4) 67 65 #define UART_CR_CMD_STOP_BREAK (6 << 4) 68 66 #define UART_CR_CMD_RESET_CTS (7 << 4) 67 + #define UART_CR_CMD_RESET_STALE_INT (8 << 4) 69 68 #define UART_CR_CMD_PACKET_MODE (9 << 4) 70 69 #define UART_CR_CMD_MODE_RESET (12 << 4) 71 70 #define UART_CR_CMD_SET_RFR (13 << 4) 72 71 #define UART_CR_CMD_RESET_RFR (14 << 4) 72 + #define UART_CR_CMD_PROTECTION_EN (16 << 4) 73 + #define UART_CR_CMD_STALE_EVENT_ENABLE (80 << 4) 73 74 #define UART_CR_TX_DISABLE (1 << 3) 74 - #define UART_CR_TX_ENABLE (1 << 3) 75 - #define UART_CR_RX_DISABLE (1 << 3) 76 - #define UART_CR_RX_ENABLE (1 << 3) 75 + #define UART_CR_TX_ENABLE (1 << 2) 76 + #define UART_CR_RX_DISABLE (1 << 1) 77 + #define UART_CR_RX_ENABLE (1 << 0) 77 78 78 79 #define UART_IMR 0x0014 79 80 #define UART_IMR_TXLEV (1 << 0) ··· 115 110 #define UART_SR_RX_FULL (1 << 1) 116 111 #define UART_SR_RX_READY (1 << 0) 117 112 118 - #define UART_RF 0x000C 119 - #define UART_MISR 0x0010 120 - #define UART_ISR 0x0014 113 + #define UART_RF 0x000C 114 + #define UARTDM_RF 0x0070 115 + #define UART_MISR 0x0010 116 + #define UART_ISR 0x0014 117 + #define UART_ISR_TX_READY (1 << 7) 118 + 119 + #define GSBI_CONTROL 0x0 120 + #define GSBI_PROTOCOL_CODE 0x30 121 + #define GSBI_PROTOCOL_UART 0x40 122 + #define GSBI_PROTOCOL_IDLE 0x0 123 + 124 + #define UARTDM_DMRX 0x34 125 + #define UARTDM_NCF_TX 0x40 126 + #define UARTDM_RX_TOTAL_SNAP 0x38 121 127 122 128 #define UART_TO_MSM(uart_port) ((struct msm_port *) uart_port) 123 129
+9 -2
drivers/video/msm/mdp_hw.h
··· 449 449 #define PPP_CFG_MDP_XRGB_8888(dir) PPP_CFG_MDP_ARGB_8888(dir) 450 450 #define PPP_CFG_MDP_RGBA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir) 451 451 #define PPP_CFG_MDP_BGRA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir) 452 + #define PPP_CFG_MDP_RGBX_8888(dir) PPP_CFG_MDP_ARGB_8888(dir) 452 453 453 454 #define PPP_CFG_MDP_Y_CBCR_H2V2(dir) (PPP_##dir##_C2R_8BIT | \ 454 455 PPP_##dir##_C0G_8BIT | \ ··· 489 488 MDP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8) 490 489 #define PPP_PACK_PATTERN_MDP_RGB_888 PPP_PACK_PATTERN_MDP_RGB_565 491 490 #define PPP_PACK_PATTERN_MDP_XRGB_8888 \ 492 - MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R, CLR_G, CLR_B, 8) 491 + MDP_GET_PACK_PATTERN(CLR_B, CLR_G, CLR_R, CLR_ALPHA, 8) 493 492 #define PPP_PACK_PATTERN_MDP_ARGB_8888 PPP_PACK_PATTERN_MDP_XRGB_8888 494 493 #define PPP_PACK_PATTERN_MDP_RGBA_8888 \ 495 494 MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G, CLR_R, 8) 496 495 #define PPP_PACK_PATTERN_MDP_BGRA_8888 \ 497 496 MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R, CLR_G, CLR_B, 8) 497 + #define PPP_PACK_PATTERN_MDP_RGBX_8888 \ 498 + MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G, CLR_R, 8) 498 499 #define PPP_PACK_PATTERN_MDP_Y_CBCR_H2V1 \ 499 500 MDP_GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8) 500 501 #define PPP_PACK_PATTERN_MDP_Y_CBCR_H2V2 PPP_PACK_PATTERN_MDP_Y_CBCR_H2V1 ··· 512 509 #define PPP_CHROMA_SAMP_MDP_ARGB_8888(dir) PPP_OP_##dir##_CHROMA_RGB 513 510 #define PPP_CHROMA_SAMP_MDP_RGBA_8888(dir) PPP_OP_##dir##_CHROMA_RGB 514 511 #define PPP_CHROMA_SAMP_MDP_BGRA_8888(dir) PPP_OP_##dir##_CHROMA_RGB 512 + #define PPP_CHROMA_SAMP_MDP_RGBX_8888(dir) PPP_OP_##dir##_CHROMA_RGB 515 513 #define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1 516 514 #define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V2(dir) PPP_OP_##dir##_CHROMA_420 517 515 #define PPP_CHROMA_SAMP_MDP_Y_CRCB_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1 ··· 527 523 [MDP_ARGB_8888] = PPP_##name##_MDP_ARGB_8888,\ 528 524 [MDP_RGBA_8888] = PPP_##name##_MDP_RGBA_8888,\ 529 525 [MDP_BGRA_8888] = PPP_##name##_MDP_BGRA_8888,\ 526 + [MDP_RGBX_8888] = PPP_##name##_MDP_RGBX_8888,\ 530 527 [MDP_Y_CBCR_H2V1] = PPP_##name##_MDP_Y_CBCR_H2V1,\ 531 528 [MDP_Y_CBCR_H2V2] = PPP_##name##_MDP_Y_CBCR_H2V2,\ 532 529 [MDP_Y_CRCB_H2V1] = PPP_##name##_MDP_Y_CRCB_H2V1,\ ··· 541 536 [MDP_ARGB_8888] = PPP_##name##_MDP_ARGB_8888(dir),\ 542 537 [MDP_RGBA_8888] = PPP_##name##_MDP_RGBA_8888(dir),\ 543 538 [MDP_BGRA_8888] = PPP_##name##_MDP_BGRA_8888(dir),\ 539 + [MDP_RGBX_8888] = PPP_##name##_MDP_RGBX_8888(dir),\ 544 540 [MDP_Y_CBCR_H2V1] = PPP_##name##_MDP_Y_CBCR_H2V1(dir),\ 545 541 [MDP_Y_CBCR_H2V2] = PPP_##name##_MDP_Y_CBCR_H2V2(dir),\ 546 542 [MDP_Y_CRCB_H2V1] = PPP_##name##_MDP_Y_CRCB_H2V1(dir),\ ··· 553 547 (img == MDP_YCRYCB_H2V1)) 554 548 #define IS_RGB(img) ((img == MDP_RGB_565) | (img == MDP_RGB_888) | \ 555 549 (img == MDP_ARGB_8888) | (img == MDP_RGBA_8888) | \ 556 - (img == MDP_XRGB_8888) | (img == MDP_BGRA_8888)) 550 + (img == MDP_XRGB_8888) | (img == MDP_BGRA_8888) | \ 551 + (img == MDP_RGBX_8888)) 557 552 #define HAS_ALPHA(img) ((img == MDP_ARGB_8888) | (img == MDP_RGBA_8888) | \ 558 553 (img == MDP_BGRA_8888)) 559 554
+1
drivers/video/msm/mdp_ppp.c
··· 69 69 [MDP_ARGB_8888] = 4, 70 70 [MDP_RGBA_8888] = 4, 71 71 [MDP_BGRA_8888] = 4, 72 + [MDP_RGBX_8888] = 4, 72 73 [MDP_Y_CBCR_H2V1] = 1, 73 74 [MDP_Y_CBCR_H2V2] = 1, 74 75 [MDP_Y_CRCB_H2V1] = 1,
+15 -12
drivers/video/msm/msm_fb.c
··· 81 81 spinlock_t update_lock; 82 82 struct mutex panel_init_lock; 83 83 wait_queue_head_t frame_wq; 84 - struct workqueue_struct *resume_workqueue; 85 84 struct work_struct resume_work; 86 85 struct msmfb_callback dma_callback; 87 86 struct msmfb_callback vsync_callback; ··· 110 111 if (msmfb->sleeping == UPDATING && 111 112 msmfb->frame_done == msmfb->update_frame) { 112 113 DLOG(SUSPEND_RESUME, "full update completed\n"); 113 - queue_work(msmfb->resume_workqueue, &msmfb->resume_work); 114 + schedule_work(&msmfb->resume_work); 114 115 } 115 116 spin_unlock_irqrestore(&msmfb->update_lock, irq_flags); 116 117 wake_up(&msmfb->frame_wq); ··· 219 220 220 221 sleeping = msmfb->sleeping; 221 222 /* on a full update, if the last frame has not completed, wait for it */ 222 - if (pan_display && (msmfb->frame_requested != msmfb->frame_done || 223 - sleeping == UPDATING)) { 223 + if ((pan_display && msmfb->frame_requested != msmfb->frame_done) || 224 + sleeping == UPDATING) { 224 225 int ret; 225 226 spin_unlock_irqrestore(&msmfb->update_lock, irq_flags); 226 227 ret = wait_event_interruptible_timeout(msmfb->frame_wq, ··· 469 470 fb_info->var.yoffset = 0; 470 471 471 472 if (msmfb->panel->caps & MSMFB_CAP_PARTIAL_UPDATES) { 473 + /* 474 + * Set the param in the fixed screen, so userspace can't 475 + * change it. This will be used to check for the 476 + * capability. 477 + */ 478 + fb_info->fix.reserved[0] = 0x5444; 479 + fb_info->fix.reserved[1] = 0x5055; 480 + 481 + /* 482 + * This preloads the value so that if userspace doesn't 483 + * change it, it will be a full update 484 + */ 472 485 fb_info->var.reserved[0] = 0x54445055; 473 486 fb_info->var.reserved[1] = 0; 474 487 fb_info->var.reserved[2] = (uint16_t)msmfb->xres | ··· 570 559 spin_lock_init(&msmfb->update_lock); 571 560 mutex_init(&msmfb->panel_init_lock); 572 561 init_waitqueue_head(&msmfb->frame_wq); 573 - msmfb->resume_workqueue = create_workqueue("panel_on"); 574 - if (msmfb->resume_workqueue == NULL) { 575 - printk(KERN_ERR "failed to create panel_on workqueue\n"); 576 - ret = -ENOMEM; 577 - goto error_create_workqueue; 578 - } 579 562 INIT_WORK(&msmfb->resume_work, power_on_panel); 580 563 msmfb->black = kzalloc(msmfb->fb->var.bits_per_pixel*msmfb->xres, 581 564 GFP_KERNEL); ··· 594 589 return 0; 595 590 596 591 error_register_framebuffer: 597 - destroy_workqueue(msmfb->resume_workqueue); 598 - error_create_workqueue: 599 592 iounmap(fb->screen_base); 600 593 error_setup_fbmem: 601 594 framebuffer_release(msmfb->fb);
+1
include/linux/msm_mdp.h
··· 32 32 MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planar w/ Cr is in MSB */ 33 33 MDP_RGBA_8888, /* ARGB 888 */ 34 34 MDP_BGRA_8888, /* ABGR 888 */ 35 + MDP_RGBX_8888, /* RGBX 888 */ 35 36 MDP_IMGTYPE_LIMIT /* Non valid image type after this enum */ 36 37 }; 37 38