diff options
478 files changed, 11795 insertions, 5586 deletions
diff --git a/.gitignore b/.gitignore index 8faa6c02b39e..5d56a3fd0de6 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -28,6 +28,7 @@ modules.builtin | |||
| 28 | *.gz | 28 | *.gz |
| 29 | *.bz2 | 29 | *.bz2 |
| 30 | *.lzma | 30 | *.lzma |
| 31 | *.xz | ||
| 31 | *.lzo | 32 | *.lzo |
| 32 | *.patch | 33 | *.patch |
| 33 | *.gcno | 34 | *.gcno |
diff --git a/Documentation/DocBook/filesystems.tmpl b/Documentation/DocBook/filesystems.tmpl index 5e87ad58c0b5..f51f28531b8d 100644 --- a/Documentation/DocBook/filesystems.tmpl +++ b/Documentation/DocBook/filesystems.tmpl | |||
| @@ -82,6 +82,11 @@ | |||
| 82 | </sect1> | 82 | </sect1> |
| 83 | </chapter> | 83 | </chapter> |
| 84 | 84 | ||
| 85 | <chapter id="fs_events"> | ||
| 86 | <title>Events based on file descriptors</title> | ||
| 87 | !Efs/eventfd.c | ||
| 88 | </chapter> | ||
| 89 | |||
| 85 | <chapter id="sysfs"> | 90 | <chapter id="sysfs"> |
| 86 | <title>The Filesystem for Exporting Kernel Objects</title> | 91 | <title>The Filesystem for Exporting Kernel Objects</title> |
| 87 | !Efs/sysfs/file.c | 92 | !Efs/sysfs/file.c |
diff --git a/Documentation/hwmon/jc42 b/Documentation/hwmon/jc42 index 0e76ef12e4c6..a22ecf48f255 100644 --- a/Documentation/hwmon/jc42 +++ b/Documentation/hwmon/jc42 | |||
| @@ -51,7 +51,8 @@ Supported chips: | |||
| 51 | * JEDEC JC 42.4 compliant temperature sensor chips | 51 | * JEDEC JC 42.4 compliant temperature sensor chips |
| 52 | Prefix: 'jc42' | 52 | Prefix: 'jc42' |
| 53 | Addresses scanned: I2C 0x18 - 0x1f | 53 | Addresses scanned: I2C 0x18 - 0x1f |
| 54 | Datasheet: - | 54 | Datasheet: |
| 55 | http://www.jedec.org/sites/default/files/docs/4_01_04R19.pdf | ||
| 55 | 56 | ||
| 56 | Author: | 57 | Author: |
| 57 | Guenter Roeck <guenter.roeck@ericsson.com> | 58 | Guenter Roeck <guenter.roeck@ericsson.com> |
| @@ -60,7 +61,11 @@ Author: | |||
| 60 | Description | 61 | Description |
| 61 | ----------- | 62 | ----------- |
| 62 | 63 | ||
| 63 | This driver implements support for JEDEC JC 42.4 compliant temperature sensors. | 64 | This driver implements support for JEDEC JC 42.4 compliant temperature sensors, |
| 65 | which are used on many DDR3 memory modules for mobile devices and servers. Some | ||
| 66 | systems use the sensor to prevent memory overheating by automatically throttling | ||
| 67 | the memory controller. | ||
| 68 | |||
| 64 | The driver auto-detects the chips listed above, but can be manually instantiated | 69 | The driver auto-detects the chips listed above, but can be manually instantiated |
| 65 | to support other JC 42.4 compliant chips. | 70 | to support other JC 42.4 compliant chips. |
| 66 | 71 | ||
| @@ -81,15 +86,19 @@ limits. The chip supports only a single register to configure the hysteresis, | |||
| 81 | which applies to all limits. This register can be written by writing into | 86 | which applies to all limits. This register can be written by writing into |
| 82 | temp1_crit_hyst. Other hysteresis attributes are read-only. | 87 | temp1_crit_hyst. Other hysteresis attributes are read-only. |
| 83 | 88 | ||
| 89 | If the BIOS has configured the sensor for automatic temperature management, it | ||
| 90 | is likely that it has locked the registers, i.e., that the temperature limits | ||
| 91 | cannot be changed. | ||
| 92 | |||
| 84 | Sysfs entries | 93 | Sysfs entries |
| 85 | ------------- | 94 | ------------- |
| 86 | 95 | ||
| 87 | temp1_input Temperature (RO) | 96 | temp1_input Temperature (RO) |
| 88 | temp1_min Minimum temperature (RW) | 97 | temp1_min Minimum temperature (RO or RW) |
| 89 | temp1_max Maximum temperature (RW) | 98 | temp1_max Maximum temperature (RO or RW) |
| 90 | temp1_crit Critical high temperature (RW) | 99 | temp1_crit Critical high temperature (RO or RW) |
| 91 | 100 | ||
| 92 | temp1_crit_hyst Critical hysteresis temperature (RW) | 101 | temp1_crit_hyst Critical hysteresis temperature (RO or RW) |
| 93 | temp1_max_hyst Maximum hysteresis temperature (RO) | 102 | temp1_max_hyst Maximum hysteresis temperature (RO) |
| 94 | 103 | ||
| 95 | temp1_min_alarm Temperature low alarm | 104 | temp1_min_alarm Temperature low alarm |
diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp index 6526eee525a6..d2b56a4fd1f5 100644 --- a/Documentation/hwmon/k10temp +++ b/Documentation/hwmon/k10temp | |||
| @@ -9,6 +9,8 @@ Supported chips: | |||
| 9 | Socket S1G3: Athlon II, Sempron, Turion II | 9 | Socket S1G3: Athlon II, Sempron, Turion II |
| 10 | * AMD Family 11h processors: | 10 | * AMD Family 11h processors: |
| 11 | Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) | 11 | Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) |
| 12 | * AMD Family 12h processors: "Llano" | ||
| 13 | * AMD Family 14h processors: "Brazos" (C/E/G-Series) | ||
| 12 | 14 | ||
| 13 | Prefix: 'k10temp' | 15 | Prefix: 'k10temp' |
| 14 | Addresses scanned: PCI space | 16 | Addresses scanned: PCI space |
| @@ -17,10 +19,14 @@ Supported chips: | |||
| 17 | http://support.amd.com/us/Processor_TechDocs/31116.pdf | 19 | http://support.amd.com/us/Processor_TechDocs/31116.pdf |
| 18 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: | 20 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 11h Processors: |
| 19 | http://support.amd.com/us/Processor_TechDocs/41256.pdf | 21 | http://support.amd.com/us/Processor_TechDocs/41256.pdf |
| 22 | BIOS and Kernel Developer's Guide (BKDG) for AMD Family 14h Models 00h-0Fh Processors: | ||
| 23 | http://support.amd.com/us/Processor_TechDocs/43170.pdf | ||
| 20 | Revision Guide for AMD Family 10h Processors: | 24 | Revision Guide for AMD Family 10h Processors: |
| 21 | http://support.amd.com/us/Processor_TechDocs/41322.pdf | 25 | http://support.amd.com/us/Processor_TechDocs/41322.pdf |
| 22 | Revision Guide for AMD Family 11h Processors: | 26 | Revision Guide for AMD Family 11h Processors: |
| 23 | http://support.amd.com/us/Processor_TechDocs/41788.pdf | 27 | http://support.amd.com/us/Processor_TechDocs/41788.pdf |
| 28 | Revision Guide for AMD Family 14h Models 00h-0Fh Processors: | ||
| 29 | http://support.amd.com/us/Processor_TechDocs/47534.pdf | ||
| 24 | AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: | 30 | AMD Family 11h Processor Power and Thermal Data Sheet for Notebooks: |
| 25 | http://support.amd.com/us/Processor_TechDocs/43373.pdf | 31 | http://support.amd.com/us/Processor_TechDocs/43373.pdf |
| 26 | AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet: | 32 | AMD Family 10h Server and Workstation Processor Power and Thermal Data Sheet: |
| @@ -34,7 +40,7 @@ Description | |||
| 34 | ----------- | 40 | ----------- |
| 35 | 41 | ||
| 36 | This driver permits reading of the internal temperature sensor of AMD | 42 | This driver permits reading of the internal temperature sensor of AMD |
| 37 | Family 10h and 11h processors. | 43 | Family 10h/11h/12h/14h processors. |
| 38 | 44 | ||
| 39 | All these processors have a sensor, but on those for Socket F or AM2+, | 45 | All these processors have a sensor, but on those for Socket F or AM2+, |
| 40 | the sensor may return inconsistent values (erratum 319). The driver | 46 | the sensor may return inconsistent values (erratum 319). The driver |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 89835a4766a6..f4a04c0c7edc 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -144,6 +144,11 @@ a fixed number of characters. This limit depends on the architecture | |||
| 144 | and is between 256 and 4096 characters. It is defined in the file | 144 | and is between 256 and 4096 characters. It is defined in the file |
| 145 | ./include/asm/setup.h as COMMAND_LINE_SIZE. | 145 | ./include/asm/setup.h as COMMAND_LINE_SIZE. |
| 146 | 146 | ||
| 147 | Finally, the [KMG] suffix is commonly described after a number of kernel | ||
| 148 | parameter values. These 'K', 'M', and 'G' letters represent the _binary_ | ||
| 149 | multipliers 'Kilo', 'Mega', and 'Giga', equalling 2^10, 2^20, and 2^30 | ||
| 150 | bytes respectively. Such letter suffixes can also be entirely omitted. | ||
| 151 | |||
| 147 | 152 | ||
| 148 | acpi= [HW,ACPI,X86] | 153 | acpi= [HW,ACPI,X86] |
| 149 | Advanced Configuration and Power Interface | 154 | Advanced Configuration and Power Interface |
| @@ -545,16 +550,20 @@ and is between 256 and 4096 characters. It is defined in the file | |||
| 545 | Format: | 550 | Format: |
| 546 | <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] | 551 | <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>] |
| 547 | 552 | ||
| 548 | crashkernel=nn[KMG]@ss[KMG] | 553 | crashkernel=size[KMG][@offset[KMG]] |
| 549 | [KNL] Reserve a chunk of physical memory to | 554 | [KNL] Using kexec, Linux can switch to a 'crash kernel' |
| 550 | hold a kernel to switch to with kexec on panic. | 555 | upon panic. This parameter reserves the physical |
| 556 | memory region [offset, offset + size] for that kernel | ||
| 557 | image. If '@offset' is omitted, then a suitable offset | ||
| 558 | is selected automatically. Check | ||
| 559 | Documentation/kdump/kdump.txt for further details. | ||
| 551 | 560 | ||
| 552 | crashkernel=range1:size1[,range2:size2,...][@offset] | 561 | crashkernel=range1:size1[,range2:size2,...][@offset] |
| 553 | [KNL] Same as above, but depends on the memory | 562 | [KNL] Same as above, but depends on the memory |
| 554 | in the running system. The syntax of range is | 563 | in the running system. The syntax of range is |
| 555 | start-[end] where start and end are both | 564 | start-[end] where start and end are both |
| 556 | a memory unit (amount[KMG]). See also | 565 | a memory unit (amount[KMG]). See also |
| 557 | Documentation/kdump/kdump.txt for a example. | 566 | Documentation/kdump/kdump.txt for an example. |
| 558 | 567 | ||
| 559 | cs89x0_dma= [HW,NET] | 568 | cs89x0_dma= [HW,NET] |
| 560 | Format: <dma> | 569 | Format: <dma> |
| @@ -1262,10 +1271,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
| 1262 | 6 (KERN_INFO) informational | 1271 | 6 (KERN_INFO) informational |
| 1263 | 7 (KERN_DEBUG) debug-level messages | 1272 | 7 (KERN_DEBUG) debug-level messages |
| 1264 | 1273 | ||
| 1265 | log_buf_len=n Sets the size of the printk ring buffer, in bytes. | 1274 | log_buf_len=n[KMG] Sets the size of the printk ring buffer, |
| 1266 | Format: { n | nk | nM } | 1275 | in bytes. n must be a power of two. The default |
| 1267 | n must be a power of two. The default size | 1276 | size is set in the kernel config file. |
| 1268 | is set in the kernel config file. | ||
| 1269 | 1277 | ||
| 1270 | logo.nologo [FB] Disables display of the built-in Linux logo. | 1278 | logo.nologo [FB] Disables display of the built-in Linux logo. |
| 1271 | This may be used to provide more screen space for | 1279 | This may be used to provide more screen space for |
diff --git a/Documentation/networking/Makefile b/Documentation/networking/Makefile index 5aba7a33aeeb..24c308dd3fd1 100644 --- a/Documentation/networking/Makefile +++ b/Documentation/networking/Makefile | |||
| @@ -4,6 +4,8 @@ obj- := dummy.o | |||
| 4 | # List of programs to build | 4 | # List of programs to build |
| 5 | hostprogs-y := ifenslave | 5 | hostprogs-y := ifenslave |
| 6 | 6 | ||
| 7 | HOSTCFLAGS_ifenslave.o += -I$(objtree)/usr/include | ||
| 8 | |||
| 7 | # Tell kbuild to always build the programs | 9 | # Tell kbuild to always build the programs |
| 8 | always := $(hostprogs-y) | 10 | always := $(hostprogs-y) |
| 9 | 11 | ||
diff --git a/Documentation/workqueue.txt b/Documentation/workqueue.txt index 996a27d9b8db..01c513fac40e 100644 --- a/Documentation/workqueue.txt +++ b/Documentation/workqueue.txt | |||
| @@ -190,9 +190,9 @@ resources, scheduled and executed. | |||
| 190 | * Long running CPU intensive workloads which can be better | 190 | * Long running CPU intensive workloads which can be better |
| 191 | managed by the system scheduler. | 191 | managed by the system scheduler. |
| 192 | 192 | ||
| 193 | WQ_FREEZEABLE | 193 | WQ_FREEZABLE |
| 194 | 194 | ||
| 195 | A freezeable wq participates in the freeze phase of the system | 195 | A freezable wq participates in the freeze phase of the system |
| 196 | suspend operations. Work items on the wq are drained and no | 196 | suspend operations. Work items on the wq are drained and no |
| 197 | new work item starts execution until thawed. | 197 | new work item starts execution until thawed. |
| 198 | 198 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 5dd6c751e6a6..04ed9565ad85 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -885,7 +885,7 @@ S: Supported | |||
| 885 | 885 | ||
| 886 | ARM/QUALCOMM MSM MACHINE SUPPORT | 886 | ARM/QUALCOMM MSM MACHINE SUPPORT |
| 887 | M: David Brown <davidb@codeaurora.org> | 887 | M: David Brown <davidb@codeaurora.org> |
| 888 | M: Daniel Walker <dwalker@codeaurora.org> | 888 | M: Daniel Walker <dwalker@fifo99.com> |
| 889 | M: Bryan Huntsman <bryanh@codeaurora.org> | 889 | M: Bryan Huntsman <bryanh@codeaurora.org> |
| 890 | L: linux-arm-msm@vger.kernel.org | 890 | L: linux-arm-msm@vger.kernel.org |
| 891 | F: arch/arm/mach-msm/ | 891 | F: arch/arm/mach-msm/ |
| @@ -1692,6 +1692,13 @@ M: Andy Whitcroft <apw@canonical.com> | |||
| 1692 | S: Supported | 1692 | S: Supported |
| 1693 | F: scripts/checkpatch.pl | 1693 | F: scripts/checkpatch.pl |
| 1694 | 1694 | ||
| 1695 | CHINESE DOCUMENTATION | ||
| 1696 | M: Harry Wei <harryxiyou@gmail.com> | ||
| 1697 | L: xiyoulinuxkernelgroup@googlegroups.com | ||
| 1698 | L: linux-kernel@zh-kernel.org (moderated for non-subscribers) | ||
| 1699 | S: Maintained | ||
| 1700 | F: Documentation/zh_CN/ | ||
| 1701 | |||
| 1695 | CISCO VIC ETHERNET NIC DRIVER | 1702 | CISCO VIC ETHERNET NIC DRIVER |
| 1696 | M: Vasanthy Kolluri <vkolluri@cisco.com> | 1703 | M: Vasanthy Kolluri <vkolluri@cisco.com> |
| 1697 | M: Roopa Prabhu <roprabhu@cisco.com> | 1704 | M: Roopa Prabhu <roprabhu@cisco.com> |
| @@ -2873,7 +2880,6 @@ M: Guenter Roeck <guenter.roeck@ericsson.com> | |||
| 2873 | L: lm-sensors@lm-sensors.org | 2880 | L: lm-sensors@lm-sensors.org |
| 2874 | W: http://www.lm-sensors.org/ | 2881 | W: http://www.lm-sensors.org/ |
| 2875 | T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/ | 2882 | T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/ |
| 2876 | T: quilt kernel.org/pub/linux/kernel/people/groeck/linux-staging/ | ||
| 2877 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git | 2883 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git |
| 2878 | S: Maintained | 2884 | S: Maintained |
| 2879 | F: Documentation/hwmon/ | 2885 | F: Documentation/hwmon/ |
| @@ -4490,6 +4496,16 @@ L: linux-omap@vger.kernel.org | |||
| 4490 | S: Maintained | 4496 | S: Maintained |
| 4491 | F: arch/arm/*omap*/*pm* | 4497 | F: arch/arm/*omap*/*pm* |
| 4492 | 4498 | ||
| 4499 | OMAP POWERDOMAIN/CLOCKDOMAIN SOC ADAPTATION LAYER SUPPORT | ||
| 4500 | M: Rajendra Nayak <rnayak@ti.com> | ||
| 4501 | M: Paul Walmsley <paul@pwsan.com> | ||
| 4502 | L: linux-omap@vger.kernel.org | ||
| 4503 | S: Maintained | ||
| 4504 | F: arch/arm/mach-omap2/powerdomain2xxx_3xxx.c | ||
| 4505 | F: arch/arm/mach-omap2/powerdomain44xx.c | ||
| 4506 | F: arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | ||
| 4507 | F: arch/arm/mach-omap2/clockdomain44xx.c | ||
| 4508 | |||
| 4493 | OMAP AUDIO SUPPORT | 4509 | OMAP AUDIO SUPPORT |
| 4494 | M: Jarkko Nikula <jhnikula@gmail.com> | 4510 | M: Jarkko Nikula <jhnikula@gmail.com> |
| 4495 | L: alsa-devel@alsa-project.org (subscribers-only) | 4511 | L: alsa-devel@alsa-project.org (subscribers-only) |
| @@ -5267,7 +5283,7 @@ S: Maintained | |||
| 5267 | F: drivers/net/wireless/rtl818x/rtl8180/ | 5283 | F: drivers/net/wireless/rtl818x/rtl8180/ |
| 5268 | 5284 | ||
| 5269 | RTL8187 WIRELESS DRIVER | 5285 | RTL8187 WIRELESS DRIVER |
| 5270 | M: Herton Ronaldo Krzesinski <herton@mandriva.com.br> | 5286 | M: Herton Ronaldo Krzesinski <herton@canonical.com> |
| 5271 | M: Hin-Tak Leung <htl10@users.sourceforge.net> | 5287 | M: Hin-Tak Leung <htl10@users.sourceforge.net> |
| 5272 | M: Larry Finger <Larry.Finger@lwfinger.net> | 5288 | M: Larry Finger <Larry.Finger@lwfinger.net> |
| 5273 | L: linux-wireless@vger.kernel.org | 5289 | L: linux-wireless@vger.kernel.org |
| @@ -6105,7 +6121,7 @@ S: Maintained | |||
| 6105 | F: security/tomoyo/ | 6121 | F: security/tomoyo/ |
| 6106 | 6122 | ||
| 6107 | TOPSTAR LAPTOP EXTRAS DRIVER | 6123 | TOPSTAR LAPTOP EXTRAS DRIVER |
| 6108 | M: Herton Ronaldo Krzesinski <herton@mandriva.com.br> | 6124 | M: Herton Ronaldo Krzesinski <herton@canonical.com> |
| 6109 | L: platform-driver-x86@vger.kernel.org | 6125 | L: platform-driver-x86@vger.kernel.org |
| 6110 | S: Maintained | 6126 | S: Maintained |
| 6111 | F: drivers/platform/x86/topstar-laptop.c | 6127 | F: drivers/platform/x86/topstar-laptop.c |
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 2 | 1 | VERSION = 2 |
| 2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
| 3 | SUBLEVEL = 38 | 3 | SUBLEVEL = 38 |
| 4 | EXTRAVERSION = -rc5 | 4 | EXTRAVERSION = -rc7 |
| 5 | NAME = Flesh-Eating Bats with Fangs | 5 | NAME = Flesh-Eating Bats with Fangs |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 26d45e5b636b..166efa2a19cd 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -1177,6 +1177,31 @@ config ARM_ERRATA_743622 | |||
| 1177 | visible impact on the overall performance or power consumption of the | 1177 | visible impact on the overall performance or power consumption of the |
| 1178 | processor. | 1178 | processor. |
| 1179 | 1179 | ||
| 1180 | config ARM_ERRATA_751472 | ||
| 1181 | bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation" | ||
| 1182 | depends on CPU_V7 && SMP | ||
| 1183 | help | ||
| 1184 | This option enables the workaround for the 751472 Cortex-A9 (prior | ||
| 1185 | to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the | ||
| 1186 | completion of a following broadcasted operation if the second | ||
| 1187 | operation is received by a CPU before the ICIALLUIS has completed, | ||
| 1188 | potentially leading to corrupted entries in the cache or TLB. | ||
| 1189 | |||
| 1190 | config ARM_ERRATA_753970 | ||
| 1191 | bool "ARM errata: cache sync operation may be faulty" | ||
| 1192 | depends on CACHE_PL310 | ||
| 1193 | help | ||
| 1194 | This option enables the workaround for the 753970 PL310 (r3p0) erratum. | ||
| 1195 | |||
| 1196 | Under some condition the effect of cache sync operation on | ||
| 1197 | the store buffer still remains when the operation completes. | ||
| 1198 | This means that the store buffer is always asked to drain and | ||
| 1199 | this prevents it from merging any further writes. The workaround | ||
| 1200 | is to replace the normal offset of cache sync operation (0x730) | ||
| 1201 | by another offset targeting an unmapped PL310 register 0x740. | ||
| 1202 | This has the same effect as the cache sync operation: store buffer | ||
| 1203 | drain and waiting for all buffers empty. | ||
| 1204 | |||
| 1180 | endmenu | 1205 | endmenu |
| 1181 | 1206 | ||
| 1182 | source "arch/arm/common/Kconfig" | 1207 | source "arch/arm/common/Kconfig" |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c22c1adfedd6..6f7b29294c80 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
| @@ -15,7 +15,7 @@ ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) | |||
| 15 | LDFLAGS_vmlinux += --be8 | 15 | LDFLAGS_vmlinux += --be8 |
| 16 | endif | 16 | endif |
| 17 | 17 | ||
| 18 | OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S | 18 | OBJCOPYFLAGS :=-O binary -R .comment -S |
| 19 | GZFLAGS :=-9 | 19 | GZFLAGS :=-9 |
| 20 | #KBUILD_CFLAGS +=-pipe | 20 | #KBUILD_CFLAGS +=-pipe |
| 21 | # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: | 21 | # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: |
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore index ab204db594d3..c6028967d336 100644 --- a/arch/arm/boot/compressed/.gitignore +++ b/arch/arm/boot/compressed/.gitignore | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | font.c | 1 | font.c |
| 2 | piggy.gz | 2 | lib1funcs.S |
| 3 | piggy.gzip | ||
| 4 | piggy.lzo | ||
| 5 | piggy.lzma | ||
| 6 | vmlinux | ||
| 3 | vmlinux.lds | 7 | vmlinux.lds |
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index ae890caa17a7..019fb7c67dc3 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig | |||
| @@ -58,6 +58,7 @@ CONFIG_ARM_ERRATA_411920=y | |||
| 58 | CONFIG_NO_HZ=y | 58 | CONFIG_NO_HZ=y |
| 59 | CONFIG_HIGH_RES_TIMERS=y | 59 | CONFIG_HIGH_RES_TIMERS=y |
| 60 | CONFIG_SMP=y | 60 | CONFIG_SMP=y |
| 61 | CONFIG_NR_CPUS=2 | ||
| 61 | # CONFIG_LOCAL_TIMERS is not set | 62 | # CONFIG_LOCAL_TIMERS is not set |
| 62 | CONFIG_AEABI=y | 63 | CONFIG_AEABI=y |
| 63 | CONFIG_LEDS=y | 64 | CONFIG_LEDS=y |
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index 5aeec1e1735c..16bd48031583 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #define L2X0_RAW_INTR_STAT 0x21C | 36 | #define L2X0_RAW_INTR_STAT 0x21C |
| 37 | #define L2X0_INTR_CLEAR 0x220 | 37 | #define L2X0_INTR_CLEAR 0x220 |
| 38 | #define L2X0_CACHE_SYNC 0x730 | 38 | #define L2X0_CACHE_SYNC 0x730 |
| 39 | #define L2X0_DUMMY_REG 0x740 | ||
| 39 | #define L2X0_INV_LINE_PA 0x770 | 40 | #define L2X0_INV_LINE_PA 0x770 |
| 40 | #define L2X0_INV_WAY 0x77C | 41 | #define L2X0_INV_WAY 0x77C |
| 41 | #define L2X0_CLEAN_LINE_PA 0x7B0 | 42 | #define L2X0_CLEAN_LINE_PA 0x7B0 |
diff --git a/arch/arm/include/asm/hardware/sp810.h b/arch/arm/include/asm/hardware/sp810.h index 721847dc68ab..e0d1c0cfa548 100644 --- a/arch/arm/include/asm/hardware/sp810.h +++ b/arch/arm/include/asm/hardware/sp810.h | |||
| @@ -58,6 +58,9 @@ | |||
| 58 | 58 | ||
| 59 | static inline void sysctl_soft_reset(void __iomem *base) | 59 | static inline void sysctl_soft_reset(void __iomem *base) |
| 60 | { | 60 | { |
| 61 | /* switch to slow mode */ | ||
| 62 | writel(0x2, base + SCCTRL); | ||
| 63 | |||
| 61 | /* writing any value to SCSYSSTAT reg will reset system */ | 64 | /* writing any value to SCSYSSTAT reg will reset system */ |
| 62 | writel(0, base + SCSYSSTAT); | 65 | writel(0, base + SCSYSSTAT); |
| 63 | } | 66 | } |
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h index f41a6f57cd12..82dfe5d0c41e 100644 --- a/arch/arm/include/asm/tlb.h +++ b/arch/arm/include/asm/tlb.h | |||
| @@ -18,16 +18,34 @@ | |||
| 18 | #define __ASMARM_TLB_H | 18 | #define __ASMARM_TLB_H |
| 19 | 19 | ||
| 20 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
| 21 | #include <asm/tlbflush.h> | ||
| 22 | 21 | ||
| 23 | #ifndef CONFIG_MMU | 22 | #ifndef CONFIG_MMU |
| 24 | 23 | ||
| 25 | #include <linux/pagemap.h> | 24 | #include <linux/pagemap.h> |
| 25 | |||
| 26 | #define tlb_flush(tlb) ((void) tlb) | ||
| 27 | |||
| 26 | #include <asm-generic/tlb.h> | 28 | #include <asm-generic/tlb.h> |
| 27 | 29 | ||
| 28 | #else /* !CONFIG_MMU */ | 30 | #else /* !CONFIG_MMU */ |
| 29 | 31 | ||
| 32 | #include <linux/swap.h> | ||
| 30 | #include <asm/pgalloc.h> | 33 | #include <asm/pgalloc.h> |
| 34 | #include <asm/tlbflush.h> | ||
| 35 | |||
| 36 | /* | ||
| 37 | * We need to delay page freeing for SMP as other CPUs can access pages | ||
| 38 | * which have been removed but not yet had their TLB entries invalidated. | ||
| 39 | * Also, as ARMv7 speculative prefetch can drag new entries into the TLB, | ||
| 40 | * we need to apply this same delaying tactic to ensure correct operation. | ||
| 41 | */ | ||
| 42 | #if defined(CONFIG_SMP) || defined(CONFIG_CPU_32v7) | ||
| 43 | #define tlb_fast_mode(tlb) 0 | ||
| 44 | #define FREE_PTE_NR 500 | ||
| 45 | #else | ||
| 46 | #define tlb_fast_mode(tlb) 1 | ||
| 47 | #define FREE_PTE_NR 0 | ||
| 48 | #endif | ||
| 31 | 49 | ||
| 32 | /* | 50 | /* |
| 33 | * TLB handling. This allows us to remove pages from the page | 51 | * TLB handling. This allows us to remove pages from the page |
| @@ -36,12 +54,58 @@ | |||
| 36 | struct mmu_gather { | 54 | struct mmu_gather { |
| 37 | struct mm_struct *mm; | 55 | struct mm_struct *mm; |
| 38 | unsigned int fullmm; | 56 | unsigned int fullmm; |
| 57 | struct vm_area_struct *vma; | ||
| 39 | unsigned long range_start; | 58 | unsigned long range_start; |
| 40 | unsigned long range_end; | 59 | unsigned long range_end; |
| 60 | unsigned int nr; | ||
| 61 | struct page *pages[FREE_PTE_NR]; | ||
| 41 | }; | 62 | }; |
| 42 | 63 | ||
| 43 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | 64 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); |
| 44 | 65 | ||
| 66 | /* | ||
| 67 | * This is unnecessarily complex. There's three ways the TLB shootdown | ||
| 68 | * code is used: | ||
| 69 | * 1. Unmapping a range of vmas. See zap_page_range(), unmap_region(). | ||
| 70 | * tlb->fullmm = 0, and tlb_start_vma/tlb_end_vma will be called. | ||
| 71 | * tlb->vma will be non-NULL. | ||
| 72 | * 2. Unmapping all vmas. See exit_mmap(). | ||
| 73 | * tlb->fullmm = 1, and tlb_start_vma/tlb_end_vma will be called. | ||
| 74 | * tlb->vma will be non-NULL. Additionally, page tables will be freed. | ||
| 75 | * 3. Unmapping argument pages. See shift_arg_pages(). | ||
| 76 | * tlb->fullmm = 0, but tlb_start_vma/tlb_end_vma will not be called. | ||
| 77 | * tlb->vma will be NULL. | ||
| 78 | */ | ||
| 79 | static inline void tlb_flush(struct mmu_gather *tlb) | ||
| 80 | { | ||
| 81 | if (tlb->fullmm || !tlb->vma) | ||
| 82 | flush_tlb_mm(tlb->mm); | ||
| 83 | else if (tlb->range_end > 0) { | ||
| 84 | flush_tlb_range(tlb->vma, tlb->range_start, tlb->range_end); | ||
| 85 | tlb->range_start = TASK_SIZE; | ||
| 86 | tlb->range_end = 0; | ||
| 87 | } | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr) | ||
| 91 | { | ||
| 92 | if (!tlb->fullmm) { | ||
| 93 | if (addr < tlb->range_start) | ||
| 94 | tlb->range_start = addr; | ||
| 95 | if (addr + PAGE_SIZE > tlb->range_end) | ||
| 96 | tlb->range_end = addr + PAGE_SIZE; | ||
| 97 | } | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | ||
| 101 | { | ||
| 102 | tlb_flush(tlb); | ||
| 103 | if (!tlb_fast_mode(tlb)) { | ||
| 104 | free_pages_and_swap_cache(tlb->pages, tlb->nr); | ||
| 105 | tlb->nr = 0; | ||
| 106 | } | ||
| 107 | } | ||
| 108 | |||
| 45 | static inline struct mmu_gather * | 109 | static inline struct mmu_gather * |
| 46 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 110 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) |
| 47 | { | 111 | { |
| @@ -49,6 +113,8 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | |||
| 49 | 113 | ||
| 50 | tlb->mm = mm; | 114 | tlb->mm = mm; |
| 51 | tlb->fullmm = full_mm_flush; | 115 | tlb->fullmm = full_mm_flush; |
| 116 | tlb->vma = NULL; | ||
| 117 | tlb->nr = 0; | ||
| 52 | 118 | ||
| 53 | return tlb; | 119 | return tlb; |
| 54 | } | 120 | } |
| @@ -56,8 +122,7 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | |||
| 56 | static inline void | 122 | static inline void |
| 57 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | 123 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) |
| 58 | { | 124 | { |
| 59 | if (tlb->fullmm) | 125 | tlb_flush_mmu(tlb); |
| 60 | flush_tlb_mm(tlb->mm); | ||
| 61 | 126 | ||
| 62 | /* keep the page table cache within bounds */ | 127 | /* keep the page table cache within bounds */ |
| 63 | check_pgt_cache(); | 128 | check_pgt_cache(); |
| @@ -71,12 +136,7 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | |||
| 71 | static inline void | 136 | static inline void |
| 72 | tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr) | 137 | tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr) |
| 73 | { | 138 | { |
| 74 | if (!tlb->fullmm) { | 139 | tlb_add_flush(tlb, addr); |
| 75 | if (addr < tlb->range_start) | ||
| 76 | tlb->range_start = addr; | ||
| 77 | if (addr + PAGE_SIZE > tlb->range_end) | ||
| 78 | tlb->range_end = addr + PAGE_SIZE; | ||
| 79 | } | ||
| 80 | } | 140 | } |
| 81 | 141 | ||
| 82 | /* | 142 | /* |
| @@ -89,6 +149,7 @@ tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | |||
| 89 | { | 149 | { |
| 90 | if (!tlb->fullmm) { | 150 | if (!tlb->fullmm) { |
| 91 | flush_cache_range(vma, vma->vm_start, vma->vm_end); | 151 | flush_cache_range(vma, vma->vm_start, vma->vm_end); |
| 152 | tlb->vma = vma; | ||
| 92 | tlb->range_start = TASK_SIZE; | 153 | tlb->range_start = TASK_SIZE; |
| 93 | tlb->range_end = 0; | 154 | tlb->range_end = 0; |
| 94 | } | 155 | } |
| @@ -97,12 +158,30 @@ tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | |||
| 97 | static inline void | 158 | static inline void |
| 98 | tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | 159 | tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) |
| 99 | { | 160 | { |
| 100 | if (!tlb->fullmm && tlb->range_end > 0) | 161 | if (!tlb->fullmm) |
| 101 | flush_tlb_range(vma, tlb->range_start, tlb->range_end); | 162 | tlb_flush(tlb); |
| 163 | } | ||
| 164 | |||
| 165 | static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | ||
| 166 | { | ||
| 167 | if (tlb_fast_mode(tlb)) { | ||
| 168 | free_page_and_swap_cache(page); | ||
| 169 | } else { | ||
| 170 | tlb->pages[tlb->nr++] = page; | ||
| 171 | if (tlb->nr >= FREE_PTE_NR) | ||
| 172 | tlb_flush_mmu(tlb); | ||
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 176 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, | ||
| 177 | unsigned long addr) | ||
| 178 | { | ||
| 179 | pgtable_page_dtor(pte); | ||
| 180 | tlb_add_flush(tlb, addr); | ||
| 181 | tlb_remove_page(tlb, pte); | ||
| 102 | } | 182 | } |
| 103 | 183 | ||
| 104 | #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) | 184 | #define pte_free_tlb(tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr) |
| 105 | #define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep) | ||
| 106 | #define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp) | 185 | #define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp) |
| 107 | 186 | ||
| 108 | #define tlb_migrate_finish(mm) do { } while (0) | 187 | #define tlb_migrate_finish(mm) do { } while (0) |
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h index ce7378ea15a2..d2005de383b8 100644 --- a/arch/arm/include/asm/tlbflush.h +++ b/arch/arm/include/asm/tlbflush.h | |||
| @@ -10,12 +10,7 @@ | |||
| 10 | #ifndef _ASMARM_TLBFLUSH_H | 10 | #ifndef _ASMARM_TLBFLUSH_H |
| 11 | #define _ASMARM_TLBFLUSH_H | 11 | #define _ASMARM_TLBFLUSH_H |
| 12 | 12 | ||
| 13 | 13 | #ifdef CONFIG_MMU | |
| 14 | #ifndef CONFIG_MMU | ||
| 15 | |||
| 16 | #define tlb_flush(tlb) ((void) tlb) | ||
| 17 | |||
| 18 | #else /* CONFIG_MMU */ | ||
| 19 | 14 | ||
| 20 | #include <asm/glue.h> | 15 | #include <asm/glue.h> |
| 21 | 16 | ||
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c index 2c1f0050c9c4..8f6ed43861f1 100644 --- a/arch/arm/kernel/kprobes-decode.c +++ b/arch/arm/kernel/kprobes-decode.c | |||
| @@ -1437,7 +1437,7 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi) | |||
| 1437 | 1437 | ||
| 1438 | return space_cccc_1100_010x(insn, asi); | 1438 | return space_cccc_1100_010x(insn, asi); |
| 1439 | 1439 | ||
| 1440 | } else if ((insn & 0x0e000000) == 0x0c400000) { | 1440 | } else if ((insn & 0x0e000000) == 0x0c000000) { |
| 1441 | 1441 | ||
| 1442 | return space_cccc_110x(insn, asi); | 1442 | return space_cccc_110x(insn, asi); |
| 1443 | 1443 | ||
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c index b8af96ea62e6..2c79eec19262 100644 --- a/arch/arm/kernel/pmu.c +++ b/arch/arm/kernel/pmu.c | |||
| @@ -97,28 +97,34 @@ set_irq_affinity(int irq, | |||
| 97 | irq, cpu); | 97 | irq, cpu); |
| 98 | return err; | 98 | return err; |
| 99 | #else | 99 | #else |
| 100 | return 0; | 100 | return -EINVAL; |
| 101 | #endif | 101 | #endif |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | static int | 104 | static int |
| 105 | init_cpu_pmu(void) | 105 | init_cpu_pmu(void) |
| 106 | { | 106 | { |
| 107 | int i, err = 0; | 107 | int i, irqs, err = 0; |
| 108 | struct platform_device *pdev = pmu_devices[ARM_PMU_DEVICE_CPU]; | 108 | struct platform_device *pdev = pmu_devices[ARM_PMU_DEVICE_CPU]; |
| 109 | 109 | ||
| 110 | if (!pdev) { | 110 | if (!pdev) |
| 111 | err = -ENODEV; | 111 | return -ENODEV; |
| 112 | goto out; | 112 | |
| 113 | } | 113 | irqs = pdev->num_resources; |
| 114 | |||
| 115 | /* | ||
| 116 | * If we have a single PMU interrupt that we can't shift, assume that | ||
| 117 | * we're running on a uniprocessor machine and continue. | ||
| 118 | */ | ||
| 119 | if (irqs == 1 && !irq_can_set_affinity(platform_get_irq(pdev, 0))) | ||
| 120 | return 0; | ||
| 114 | 121 | ||
| 115 | for (i = 0; i < pdev->num_resources; ++i) { | 122 | for (i = 0; i < irqs; ++i) { |
| 116 | err = set_irq_affinity(platform_get_irq(pdev, i), i); | 123 | err = set_irq_affinity(platform_get_irq(pdev, i), i); |
| 117 | if (err) | 124 | if (err) |
| 118 | break; | 125 | break; |
| 119 | } | 126 | } |
| 120 | 127 | ||
| 121 | out: | ||
| 122 | return err; | 128 | return err; |
| 123 | } | 129 | } |
| 124 | 130 | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 420b8d6485d6..5ea4fb718b97 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
| @@ -226,8 +226,8 @@ int cpu_architecture(void) | |||
| 226 | * Register 0 and check for VMSAv7 or PMSAv7 */ | 226 | * Register 0 and check for VMSAv7 or PMSAv7 */ |
| 227 | asm("mrc p15, 0, %0, c0, c1, 4" | 227 | asm("mrc p15, 0, %0, c0, c1, 4" |
| 228 | : "=r" (mmfr0)); | 228 | : "=r" (mmfr0)); |
| 229 | if ((mmfr0 & 0x0000000f) == 0x00000003 || | 229 | if ((mmfr0 & 0x0000000f) >= 0x00000003 || |
| 230 | (mmfr0 & 0x000000f0) == 0x00000030) | 230 | (mmfr0 & 0x000000f0) >= 0x00000030) |
| 231 | cpu_arch = CPU_ARCH_ARMv7; | 231 | cpu_arch = CPU_ARCH_ARMv7; |
| 232 | else if ((mmfr0 & 0x0000000f) == 0x00000002 || | 232 | else if ((mmfr0 & 0x0000000f) == 0x00000002 || |
| 233 | (mmfr0 & 0x000000f0) == 0x00000020) | 233 | (mmfr0 & 0x000000f0) == 0x00000020) |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 907d5a620bca..abaf8445ce25 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
| @@ -474,7 +474,9 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka, | |||
| 474 | unsigned long handler = (unsigned long)ka->sa.sa_handler; | 474 | unsigned long handler = (unsigned long)ka->sa.sa_handler; |
| 475 | unsigned long retcode; | 475 | unsigned long retcode; |
| 476 | int thumb = 0; | 476 | int thumb = 0; |
| 477 | unsigned long cpsr = regs->ARM_cpsr & ~PSR_f; | 477 | unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT); |
| 478 | |||
| 479 | cpsr |= PSR_ENDSTATE; | ||
| 478 | 480 | ||
| 479 | /* | 481 | /* |
| 480 | * Maybe we need to deliver a 32-bit signal to a 26-bit task. | 482 | * Maybe we need to deliver a 32-bit signal to a 26-bit task. |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 86b66f3f2031..61462790757f 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
| @@ -21,6 +21,12 @@ | |||
| 21 | #define ARM_CPU_KEEP(x) | 21 | #define ARM_CPU_KEEP(x) |
| 22 | #endif | 22 | #endif |
| 23 | 23 | ||
| 24 | #if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK) | ||
| 25 | #define ARM_EXIT_KEEP(x) x | ||
| 26 | #else | ||
| 27 | #define ARM_EXIT_KEEP(x) | ||
| 28 | #endif | ||
| 29 | |||
| 24 | OUTPUT_ARCH(arm) | 30 | OUTPUT_ARCH(arm) |
| 25 | ENTRY(stext) | 31 | ENTRY(stext) |
| 26 | 32 | ||
| @@ -43,6 +49,7 @@ SECTIONS | |||
| 43 | _sinittext = .; | 49 | _sinittext = .; |
| 44 | HEAD_TEXT | 50 | HEAD_TEXT |
| 45 | INIT_TEXT | 51 | INIT_TEXT |
| 52 | ARM_EXIT_KEEP(EXIT_TEXT) | ||
| 46 | _einittext = .; | 53 | _einittext = .; |
| 47 | ARM_CPU_DISCARD(PROC_INFO) | 54 | ARM_CPU_DISCARD(PROC_INFO) |
| 48 | __arch_info_begin = .; | 55 | __arch_info_begin = .; |
| @@ -67,6 +74,7 @@ SECTIONS | |||
| 67 | #ifndef CONFIG_XIP_KERNEL | 74 | #ifndef CONFIG_XIP_KERNEL |
| 68 | __init_begin = _stext; | 75 | __init_begin = _stext; |
| 69 | INIT_DATA | 76 | INIT_DATA |
| 77 | ARM_EXIT_KEEP(EXIT_DATA) | ||
| 70 | #endif | 78 | #endif |
| 71 | } | 79 | } |
| 72 | 80 | ||
| @@ -162,6 +170,7 @@ SECTIONS | |||
| 162 | . = ALIGN(PAGE_SIZE); | 170 | . = ALIGN(PAGE_SIZE); |
| 163 | __init_begin = .; | 171 | __init_begin = .; |
| 164 | INIT_DATA | 172 | INIT_DATA |
| 173 | ARM_EXIT_KEEP(EXIT_DATA) | ||
| 165 | . = ALIGN(PAGE_SIZE); | 174 | . = ALIGN(PAGE_SIZE); |
| 166 | __init_end = .; | 175 | __init_end = .; |
| 167 | #endif | 176 | #endif |
| @@ -247,6 +256,8 @@ SECTIONS | |||
| 247 | } | 256 | } |
| 248 | #endif | 257 | #endif |
| 249 | 258 | ||
| 259 | NOTES | ||
| 260 | |||
| 250 | BSS_SECTION(0, 0, 0) | 261 | BSS_SECTION(0, 0, 0) |
| 251 | _end = .; | 262 | _end = .; |
| 252 | 263 | ||
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index 820973666f34..d9af9811dedd 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | * | 10 | * |
| 11 | * Multichannel mode not supported. | 11 | * Multichannel mode not supported. |
| 12 | */ | 12 | */ |
| 13 | #include <linux/ioport.h> | ||
| 13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 15 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
| @@ -78,100 +79,294 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = { | |||
| 78 | }; | 79 | }; |
| 79 | 80 | ||
| 80 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) | 81 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
| 82 | struct resource omap7xx_mcbsp_res[][6] = { | ||
| 83 | { | ||
| 84 | { | ||
| 85 | .start = OMAP7XX_MCBSP1_BASE, | ||
| 86 | .end = OMAP7XX_MCBSP1_BASE + SZ_256, | ||
| 87 | .flags = IORESOURCE_MEM, | ||
| 88 | }, | ||
| 89 | { | ||
| 90 | .name = "rx", | ||
| 91 | .start = INT_7XX_McBSP1RX, | ||
| 92 | .flags = IORESOURCE_IRQ, | ||
| 93 | }, | ||
| 94 | { | ||
| 95 | .name = "tx", | ||
| 96 | .start = INT_7XX_McBSP1TX, | ||
| 97 | .flags = IORESOURCE_IRQ, | ||
| 98 | }, | ||
| 99 | { | ||
| 100 | .name = "rx", | ||
| 101 | .start = OMAP_DMA_MCBSP1_RX, | ||
| 102 | .flags = IORESOURCE_DMA, | ||
| 103 | }, | ||
| 104 | { | ||
| 105 | .name = "tx", | ||
| 106 | .start = OMAP_DMA_MCBSP1_TX, | ||
| 107 | .flags = IORESOURCE_DMA, | ||
| 108 | }, | ||
| 109 | }, | ||
| 110 | { | ||
| 111 | { | ||
| 112 | .start = OMAP7XX_MCBSP2_BASE, | ||
| 113 | .end = OMAP7XX_MCBSP2_BASE + SZ_256, | ||
| 114 | .flags = IORESOURCE_MEM, | ||
| 115 | }, | ||
| 116 | { | ||
| 117 | .name = "rx", | ||
| 118 | .start = INT_7XX_McBSP2RX, | ||
| 119 | .flags = IORESOURCE_IRQ, | ||
| 120 | }, | ||
| 121 | { | ||
| 122 | .name = "tx", | ||
| 123 | .start = INT_7XX_McBSP2TX, | ||
| 124 | .flags = IORESOURCE_IRQ, | ||
| 125 | }, | ||
| 126 | { | ||
| 127 | .name = "rx", | ||
| 128 | .start = OMAP_DMA_MCBSP3_RX, | ||
| 129 | .flags = IORESOURCE_DMA, | ||
| 130 | }, | ||
| 131 | { | ||
| 132 | .name = "tx", | ||
| 133 | .start = OMAP_DMA_MCBSP3_TX, | ||
| 134 | .flags = IORESOURCE_DMA, | ||
| 135 | }, | ||
| 136 | }, | ||
| 137 | }; | ||
| 138 | |||
| 139 | #define omap7xx_mcbsp_res_0 omap7xx_mcbsp_res[0] | ||
| 140 | |||
| 81 | static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = { | 141 | static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = { |
| 82 | { | 142 | { |
| 83 | .phys_base = OMAP7XX_MCBSP1_BASE, | ||
| 84 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, | ||
| 85 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, | ||
| 86 | .rx_irq = INT_7XX_McBSP1RX, | ||
| 87 | .tx_irq = INT_7XX_McBSP1TX, | ||
| 88 | .ops = &omap1_mcbsp_ops, | 143 | .ops = &omap1_mcbsp_ops, |
| 89 | }, | 144 | }, |
| 90 | { | 145 | { |
| 91 | .phys_base = OMAP7XX_MCBSP2_BASE, | ||
| 92 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, | ||
| 93 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, | ||
| 94 | .rx_irq = INT_7XX_McBSP2RX, | ||
| 95 | .tx_irq = INT_7XX_McBSP2TX, | ||
| 96 | .ops = &omap1_mcbsp_ops, | 146 | .ops = &omap1_mcbsp_ops, |
| 97 | }, | 147 | }, |
| 98 | }; | 148 | }; |
| 99 | #define OMAP7XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap7xx_mcbsp_pdata) | 149 | #define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1]) |
| 100 | #define OMAP7XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) | 150 | #define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res) |
| 101 | #else | 151 | #else |
| 152 | #define omap7xx_mcbsp_res_0 NULL | ||
| 102 | #define omap7xx_mcbsp_pdata NULL | 153 | #define omap7xx_mcbsp_pdata NULL |
| 103 | #define OMAP7XX_MCBSP_PDATA_SZ 0 | 154 | #define OMAP7XX_MCBSP_RES_SZ 0 |
| 104 | #define OMAP7XX_MCBSP_REG_NUM 0 | 155 | #define OMAP7XX_MCBSP_COUNT 0 |
| 105 | #endif | 156 | #endif |
| 106 | 157 | ||
| 107 | #ifdef CONFIG_ARCH_OMAP15XX | 158 | #ifdef CONFIG_ARCH_OMAP15XX |
| 159 | struct resource omap15xx_mcbsp_res[][6] = { | ||
| 160 | { | ||
| 161 | { | ||
| 162 | .start = OMAP1510_MCBSP1_BASE, | ||
| 163 | .end = OMAP1510_MCBSP1_BASE + SZ_256, | ||
| 164 | .flags = IORESOURCE_MEM, | ||
| 165 | }, | ||
| 166 | { | ||
| 167 | .name = "rx", | ||
| 168 | .start = INT_McBSP1RX, | ||
| 169 | .flags = IORESOURCE_IRQ, | ||
| 170 | }, | ||
| 171 | { | ||
| 172 | .name = "tx", | ||
| 173 | .start = INT_McBSP1TX, | ||
| 174 | .flags = IORESOURCE_IRQ, | ||
| 175 | }, | ||
| 176 | { | ||
| 177 | .name = "rx", | ||
| 178 | .start = OMAP_DMA_MCBSP1_RX, | ||
| 179 | .flags = IORESOURCE_DMA, | ||
| 180 | }, | ||
| 181 | { | ||
| 182 | .name = "tx", | ||
| 183 | .start = OMAP_DMA_MCBSP1_TX, | ||
| 184 | .flags = IORESOURCE_DMA, | ||
| 185 | }, | ||
| 186 | }, | ||
| 187 | { | ||
| 188 | { | ||
| 189 | .start = OMAP1510_MCBSP2_BASE, | ||
| 190 | .end = OMAP1510_MCBSP2_BASE + SZ_256, | ||
| 191 | .flags = IORESOURCE_MEM, | ||
| 192 | }, | ||
| 193 | { | ||
| 194 | .name = "rx", | ||
| 195 | .start = INT_1510_SPI_RX, | ||
| 196 | .flags = IORESOURCE_IRQ, | ||
| 197 | }, | ||
| 198 | { | ||
| 199 | .name = "tx", | ||
| 200 | .start = INT_1510_SPI_TX, | ||
| 201 | .flags = IORESOURCE_IRQ, | ||
| 202 | }, | ||
| 203 | { | ||
| 204 | .name = "rx", | ||
| 205 | .start = OMAP_DMA_MCBSP2_RX, | ||
| 206 | .flags = IORESOURCE_DMA, | ||
| 207 | }, | ||
| 208 | { | ||
| 209 | .name = "tx", | ||
| 210 | .start = OMAP_DMA_MCBSP2_TX, | ||
| 211 | .flags = IORESOURCE_DMA, | ||
| 212 | }, | ||
| 213 | }, | ||
| 214 | { | ||
| 215 | { | ||
| 216 | .start = OMAP1510_MCBSP3_BASE, | ||
| 217 | .end = OMAP1510_MCBSP3_BASE + SZ_256, | ||
| 218 | .flags = IORESOURCE_MEM, | ||
| 219 | }, | ||
| 220 | { | ||
| 221 | .name = "rx", | ||
| 222 | .start = INT_McBSP3RX, | ||
| 223 | .flags = IORESOURCE_IRQ, | ||
| 224 | }, | ||
| 225 | { | ||
| 226 | .name = "tx", | ||
| 227 | .start = INT_McBSP3TX, | ||
| 228 | .flags = IORESOURCE_IRQ, | ||
| 229 | }, | ||
| 230 | { | ||
| 231 | .name = "rx", | ||
| 232 | .start = OMAP_DMA_MCBSP3_RX, | ||
| 233 | .flags = IORESOURCE_DMA, | ||
| 234 | }, | ||
| 235 | { | ||
| 236 | .name = "tx", | ||
| 237 | .start = OMAP_DMA_MCBSP3_TX, | ||
| 238 | .flags = IORESOURCE_DMA, | ||
| 239 | }, | ||
| 240 | }, | ||
| 241 | }; | ||
| 242 | |||
| 243 | #define omap15xx_mcbsp_res_0 omap15xx_mcbsp_res[0] | ||
| 244 | |||
| 108 | static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | 245 | static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { |
| 109 | { | 246 | { |
| 110 | .phys_base = OMAP1510_MCBSP1_BASE, | ||
| 111 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, | ||
| 112 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, | ||
| 113 | .rx_irq = INT_McBSP1RX, | ||
| 114 | .tx_irq = INT_McBSP1TX, | ||
| 115 | .ops = &omap1_mcbsp_ops, | 247 | .ops = &omap1_mcbsp_ops, |
| 116 | }, | 248 | }, |
| 117 | { | 249 | { |
| 118 | .phys_base = OMAP1510_MCBSP2_BASE, | ||
| 119 | .dma_rx_sync = OMAP_DMA_MCBSP2_RX, | ||
| 120 | .dma_tx_sync = OMAP_DMA_MCBSP2_TX, | ||
| 121 | .rx_irq = INT_1510_SPI_RX, | ||
| 122 | .tx_irq = INT_1510_SPI_TX, | ||
| 123 | .ops = &omap1_mcbsp_ops, | 250 | .ops = &omap1_mcbsp_ops, |
| 124 | }, | 251 | }, |
| 125 | { | 252 | { |
| 126 | .phys_base = OMAP1510_MCBSP3_BASE, | ||
| 127 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, | ||
| 128 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, | ||
| 129 | .rx_irq = INT_McBSP3RX, | ||
| 130 | .tx_irq = INT_McBSP3TX, | ||
| 131 | .ops = &omap1_mcbsp_ops, | 253 | .ops = &omap1_mcbsp_ops, |
| 132 | }, | 254 | }, |
| 133 | }; | 255 | }; |
| 134 | #define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) | 256 | #define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1]) |
| 135 | #define OMAP15XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) | 257 | #define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res) |
| 136 | #else | 258 | #else |
| 259 | #define omap15xx_mcbsp_res_0 NULL | ||
| 137 | #define omap15xx_mcbsp_pdata NULL | 260 | #define omap15xx_mcbsp_pdata NULL |
| 138 | #define OMAP15XX_MCBSP_PDATA_SZ 0 | 261 | #define OMAP15XX_MCBSP_RES_SZ 0 |
| 139 | #define OMAP15XX_MCBSP_REG_NUM 0 | 262 | #define OMAP15XX_MCBSP_COUNT 0 |
| 140 | #endif | 263 | #endif |
| 141 | 264 | ||
| 142 | #ifdef CONFIG_ARCH_OMAP16XX | 265 | #ifdef CONFIG_ARCH_OMAP16XX |
| 266 | struct resource omap16xx_mcbsp_res[][6] = { | ||
| 267 | { | ||
| 268 | { | ||
| 269 | .start = OMAP1610_MCBSP1_BASE, | ||
| 270 | .end = OMAP1610_MCBSP1_BASE + SZ_256, | ||
| 271 | .flags = IORESOURCE_MEM, | ||
| 272 | }, | ||
| 273 | { | ||
| 274 | .name = "rx", | ||
| 275 | .start = INT_McBSP1RX, | ||
| 276 | .flags = IORESOURCE_IRQ, | ||
| 277 | }, | ||
| 278 | { | ||
| 279 | .name = "tx", | ||
| 280 | .start = INT_McBSP1TX, | ||
| 281 | .flags = IORESOURCE_IRQ, | ||
| 282 | }, | ||
| 283 | { | ||
| 284 | .name = "rx", | ||
| 285 | .start = OMAP_DMA_MCBSP1_RX, | ||
| 286 | .flags = IORESOURCE_DMA, | ||
| 287 | }, | ||
| 288 | { | ||
| 289 | .name = "tx", | ||
| 290 | .start = OMAP_DMA_MCBSP1_TX, | ||
| 291 | .flags = IORESOURCE_DMA, | ||
| 292 | }, | ||
| 293 | }, | ||
| 294 | { | ||
| 295 | { | ||
| 296 | .start = OMAP1610_MCBSP2_BASE, | ||
| 297 | .end = OMAP1610_MCBSP2_BASE + SZ_256, | ||
| 298 | .flags = IORESOURCE_MEM, | ||
| 299 | }, | ||
| 300 | { | ||
| 301 | .name = "rx", | ||
| 302 | .start = INT_1610_McBSP2_RX, | ||
| 303 | .flags = IORESOURCE_IRQ, | ||
| 304 | }, | ||
| 305 | { | ||
| 306 | .name = "tx", | ||
| 307 | .start = INT_1610_McBSP2_TX, | ||
| 308 | .flags = IORESOURCE_IRQ, | ||
| 309 | }, | ||
| 310 | { | ||
| 311 | .name = "rx", | ||
| 312 | .start = OMAP_DMA_MCBSP2_RX, | ||
| 313 | .flags = IORESOURCE_DMA, | ||
| 314 | }, | ||
| 315 | { | ||
| 316 | .name = "tx", | ||
| 317 | .start = OMAP_DMA_MCBSP2_TX, | ||
| 318 | .flags = IORESOURCE_DMA, | ||
| 319 | }, | ||
| 320 | }, | ||
| 321 | { | ||
| 322 | { | ||
| 323 | .start = OMAP1610_MCBSP3_BASE, | ||
| 324 | .end = OMAP1610_MCBSP3_BASE + SZ_256, | ||
| 325 | .flags = IORESOURCE_MEM, | ||
| 326 | }, | ||
| 327 | { | ||
| 328 | .name = "rx", | ||
| 329 | .start = INT_McBSP3RX, | ||
| 330 | .flags = IORESOURCE_IRQ, | ||
| 331 | }, | ||
| 332 | { | ||
| 333 | .name = "tx", | ||
| 334 | .start = INT_McBSP3TX, | ||
| 335 | .flags = IORESOURCE_IRQ, | ||
| 336 | }, | ||
| 337 | { | ||
| 338 | .name = "rx", | ||
| 339 | .start = OMAP_DMA_MCBSP3_RX, | ||
| 340 | .flags = IORESOURCE_DMA, | ||
| 341 | }, | ||
| 342 | { | ||
| 343 | .name = "tx", | ||
| 344 | .start = OMAP_DMA_MCBSP3_TX, | ||
| 345 | .flags = IORESOURCE_DMA, | ||
| 346 | }, | ||
| 347 | }, | ||
| 348 | }; | ||
| 349 | |||
| 350 | #define omap16xx_mcbsp_res_0 omap16xx_mcbsp_res[0] | ||
| 351 | |||
| 143 | static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { | 352 | static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { |
| 144 | { | 353 | { |
| 145 | .phys_base = OMAP1610_MCBSP1_BASE, | ||
| 146 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, | ||
| 147 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, | ||
| 148 | .rx_irq = INT_McBSP1RX, | ||
| 149 | .tx_irq = INT_McBSP1TX, | ||
| 150 | .ops = &omap1_mcbsp_ops, | 354 | .ops = &omap1_mcbsp_ops, |
| 151 | }, | 355 | }, |
| 152 | { | 356 | { |
| 153 | .phys_base = OMAP1610_MCBSP2_BASE, | ||
| 154 | .dma_rx_sync = OMAP_DMA_MCBSP2_RX, | ||
| 155 | .dma_tx_sync = OMAP_DMA_MCBSP2_TX, | ||
| 156 | .rx_irq = INT_1610_McBSP2_RX, | ||
| 157 | .tx_irq = INT_1610_McBSP2_TX, | ||
| 158 | .ops = &omap1_mcbsp_ops, | 357 | .ops = &omap1_mcbsp_ops, |
| 159 | }, | 358 | }, |
| 160 | { | 359 | { |
| 161 | .phys_base = OMAP1610_MCBSP3_BASE, | ||
| 162 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, | ||
| 163 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, | ||
| 164 | .rx_irq = INT_McBSP3RX, | ||
| 165 | .tx_irq = INT_McBSP3TX, | ||
| 166 | .ops = &omap1_mcbsp_ops, | 360 | .ops = &omap1_mcbsp_ops, |
| 167 | }, | 361 | }, |
| 168 | }; | 362 | }; |
| 169 | #define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) | 363 | #define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1]) |
| 170 | #define OMAP16XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) | 364 | #define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res) |
| 171 | #else | 365 | #else |
| 366 | #define omap16xx_mcbsp_res_0 NULL | ||
| 172 | #define omap16xx_mcbsp_pdata NULL | 367 | #define omap16xx_mcbsp_pdata NULL |
| 173 | #define OMAP16XX_MCBSP_PDATA_SZ 0 | 368 | #define OMAP16XX_MCBSP_RES_SZ 0 |
| 174 | #define OMAP16XX_MCBSP_REG_NUM 0 | 369 | #define OMAP16XX_MCBSP_COUNT 0 |
| 175 | #endif | 370 | #endif |
| 176 | 371 | ||
| 177 | static int __init omap1_mcbsp_init(void) | 372 | static int __init omap1_mcbsp_init(void) |
| @@ -179,16 +374,12 @@ static int __init omap1_mcbsp_init(void) | |||
| 179 | if (!cpu_class_is_omap1()) | 374 | if (!cpu_class_is_omap1()) |
| 180 | return -ENODEV; | 375 | return -ENODEV; |
| 181 | 376 | ||
| 182 | if (cpu_is_omap7xx()) { | 377 | if (cpu_is_omap7xx()) |
| 183 | omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ; | 378 | omap_mcbsp_count = OMAP7XX_MCBSP_COUNT; |
| 184 | omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16); | 379 | else if (cpu_is_omap15xx()) |
| 185 | } else if (cpu_is_omap15xx()) { | 380 | omap_mcbsp_count = OMAP15XX_MCBSP_COUNT; |
| 186 | omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; | 381 | else if (cpu_is_omap16xx()) |
| 187 | omap_mcbsp_cache_size = OMAP15XX_MCBSP_REG_NUM * sizeof(u16); | 382 | omap_mcbsp_count = OMAP16XX_MCBSP_COUNT; |
| 188 | } else if (cpu_is_omap16xx()) { | ||
| 189 | omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ; | ||
| 190 | omap_mcbsp_cache_size = OMAP16XX_MCBSP_REG_NUM * sizeof(u16); | ||
| 191 | } | ||
| 192 | 383 | ||
| 193 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 384 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
| 194 | GFP_KERNEL); | 385 | GFP_KERNEL); |
| @@ -196,16 +387,22 @@ static int __init omap1_mcbsp_init(void) | |||
| 196 | return -ENOMEM; | 387 | return -ENOMEM; |
| 197 | 388 | ||
| 198 | if (cpu_is_omap7xx()) | 389 | if (cpu_is_omap7xx()) |
| 199 | omap_mcbsp_register_board_cfg(omap7xx_mcbsp_pdata, | 390 | omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res_0, |
| 200 | OMAP7XX_MCBSP_PDATA_SZ); | 391 | OMAP7XX_MCBSP_RES_SZ, |
| 392 | omap7xx_mcbsp_pdata, | ||
| 393 | OMAP7XX_MCBSP_COUNT); | ||
| 201 | 394 | ||
| 202 | if (cpu_is_omap15xx()) | 395 | if (cpu_is_omap15xx()) |
| 203 | omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, | 396 | omap_mcbsp_register_board_cfg(omap15xx_mcbsp_res_0, |
| 204 | OMAP15XX_MCBSP_PDATA_SZ); | 397 | OMAP15XX_MCBSP_RES_SZ, |
| 398 | omap15xx_mcbsp_pdata, | ||
| 399 | OMAP15XX_MCBSP_COUNT); | ||
| 205 | 400 | ||
| 206 | if (cpu_is_omap16xx()) | 401 | if (cpu_is_omap16xx()) |
| 207 | omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, | 402 | omap_mcbsp_register_board_cfg(omap16xx_mcbsp_res_0, |
| 208 | OMAP16XX_MCBSP_PDATA_SZ); | 403 | OMAP16XX_MCBSP_RES_SZ, |
| 404 | omap16xx_mcbsp_pdata, | ||
| 405 | OMAP16XX_MCBSP_COUNT); | ||
| 209 | 406 | ||
| 210 | return omap_mcbsp_init(); | 407 | return omap_mcbsp_init(); |
| 211 | } | 408 | } |
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 9b4e78fe3d1c..b9d8a7b2a862 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
| @@ -310,6 +310,7 @@ config MACH_OMAP_4430SDP | |||
| 310 | depends on ARCH_OMAP4 | 310 | depends on ARCH_OMAP4 |
| 311 | select OMAP_PACKAGE_CBL | 311 | select OMAP_PACKAGE_CBL |
| 312 | select OMAP_PACKAGE_CBS | 312 | select OMAP_PACKAGE_CBS |
| 313 | select REGULATOR_FIXED_VOLTAGE | ||
| 313 | 314 | ||
| 314 | config MACH_OMAP4_PANDA | 315 | config MACH_OMAP4_PANDA |
| 315 | bool "OMAP4 Panda Board" | 316 | bool "OMAP4 Panda Board" |
| @@ -317,6 +318,7 @@ config MACH_OMAP4_PANDA | |||
| 317 | depends on ARCH_OMAP4 | 318 | depends on ARCH_OMAP4 |
| 318 | select OMAP_PACKAGE_CBL | 319 | select OMAP_PACKAGE_CBL |
| 319 | select OMAP_PACKAGE_CBS | 320 | select OMAP_PACKAGE_CBS |
| 321 | select REGULATOR_FIXED_VOLTAGE | ||
| 320 | 322 | ||
| 321 | config OMAP3_EMU | 323 | config OMAP3_EMU |
| 322 | bool "OMAP3 debugging peripherals" | 324 | bool "OMAP3 debugging peripherals" |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 10c3c8f16eaa..534d89a60dd9 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
| @@ -110,20 +110,23 @@ obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ | |||
| 110 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ | 110 | obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ |
| 111 | clockdomain44xx.o \ | 111 | clockdomain44xx.o \ |
| 112 | clockdomains44xx_data.o | 112 | clockdomains44xx_data.o |
| 113 | |||
| 113 | # Clock framework | 114 | # Clock framework |
| 114 | obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ | 115 | obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ |
| 115 | clkt2xxx_sys.o \ | 116 | clkt2xxx_sys.o \ |
| 116 | clkt2xxx_dpllcore.o \ | 117 | clkt2xxx_dpllcore.o \ |
| 117 | clkt2xxx_virt_prcm_set.o \ | 118 | clkt2xxx_virt_prcm_set.o \ |
| 118 | clkt2xxx_apll.o clkt2xxx_osc.o | 119 | clkt2xxx_apll.o clkt2xxx_osc.o \ |
| 120 | clkt2xxx_dpll.o clkt_iclk.o | ||
| 119 | obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o | 121 | obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o |
| 120 | obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o | 122 | obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o |
| 121 | obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \ | 123 | obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \ |
| 122 | clock34xx.o clkt34xx_dpll3m2.o \ | 124 | clock34xx.o clkt34xx_dpll3m2.o \ |
| 123 | clock3517.o clock36xx.o \ | 125 | clock3517.o clock36xx.o \ |
| 124 | dpll3xxx.o clock3xxx_data.o | 126 | dpll3xxx.o clock3xxx_data.o \ |
| 127 | clkt_iclk.o | ||
| 125 | obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \ | 128 | obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \ |
| 126 | dpll3xxx.o | 129 | dpll3xxx.o dpll44xx.o |
| 127 | 130 | ||
| 128 | # OMAP2 clock rate set data (old "OPP" data) | 131 | # OMAP2 clock rate set data (old "OPP" data) |
| 129 | obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o | 132 | obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o |
| @@ -138,6 +141,10 @@ obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o | |||
| 138 | # EMU peripherals | 141 | # EMU peripherals |
| 139 | obj-$(CONFIG_OMAP3_EMU) += emu.o | 142 | obj-$(CONFIG_OMAP3_EMU) += emu.o |
| 140 | 143 | ||
| 144 | # L3 interconnect | ||
| 145 | obj-$(CONFIG_ARCH_OMAP3) += omap_l3_smx.o | ||
| 146 | obj-$(CONFIG_ARCH_OMAP4) += omap_l3_noc.o | ||
| 147 | |||
| 141 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o | 148 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o |
| 142 | mailbox_mach-objs := mailbox.o | 149 | mailbox_mach-objs := mailbox.o |
| 143 | 150 | ||
| @@ -248,3 +255,6 @@ obj-y += $(smc91x-m) $(smc91x-y) | |||
| 248 | smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o | 255 | smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o |
| 249 | obj-y += $(smsc911x-m) $(smsc911x-y) | 256 | obj-y += $(smsc911x-m) $(smsc911x-y) |
| 250 | obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o | 257 | obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o |
| 258 | |||
| 259 | disp-$(CONFIG_OMAP2_DSS) := display.o | ||
| 260 | obj-y += $(disp-m) $(disp-y) | ||
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index ec74c0f2051c..1fa6bb896f41 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/mmc/host.h> | 22 | #include <linux/mmc/host.h> |
| 23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
| 24 | #include <linux/i2c/twl.h> | 24 | #include <linux/i2c/twl.h> |
| 25 | #include <linux/regulator/machine.h> | ||
| 25 | #include <linux/err.h> | 26 | #include <linux/err.h> |
| 26 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
| 27 | #include <linux/io.h> | 28 | #include <linux/io.h> |
| @@ -141,12 +142,29 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = { | |||
| 141 | 142 | ||
| 142 | static void __init omap_2430sdp_init_early(void) | 143 | static void __init omap_2430sdp_init_early(void) |
| 143 | { | 144 | { |
| 144 | omap_board_config = sdp2430_config; | ||
| 145 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); | ||
| 146 | omap2_init_common_infrastructure(); | 145 | omap2_init_common_infrastructure(); |
| 147 | omap2_init_common_devices(NULL, NULL); | 146 | omap2_init_common_devices(NULL, NULL); |
| 148 | } | 147 | } |
| 149 | 148 | ||
| 149 | static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = { | ||
| 150 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | ||
| 151 | }; | ||
| 152 | |||
| 153 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | ||
| 154 | static struct regulator_init_data sdp2430_vmmc1 = { | ||
| 155 | .constraints = { | ||
| 156 | .min_uV = 1850000, | ||
| 157 | .max_uV = 3150000, | ||
| 158 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
| 159 | | REGULATOR_MODE_STANDBY, | ||
| 160 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
| 161 | | REGULATOR_CHANGE_MODE | ||
| 162 | | REGULATOR_CHANGE_STATUS, | ||
| 163 | }, | ||
| 164 | .num_consumer_supplies = ARRAY_SIZE(sdp2430_vmmc1_supplies), | ||
| 165 | .consumer_supplies = &sdp2430_vmmc1_supplies[0], | ||
| 166 | }; | ||
| 167 | |||
| 150 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { | 168 | static struct twl4030_gpio_platform_data sdp2430_gpio_data = { |
| 151 | .gpio_base = OMAP_MAX_GPIO_LINES, | 169 | .gpio_base = OMAP_MAX_GPIO_LINES, |
| 152 | .irq_base = TWL4030_GPIO_IRQ_BASE, | 170 | .irq_base = TWL4030_GPIO_IRQ_BASE, |
| @@ -159,6 +177,7 @@ static struct twl4030_platform_data sdp2430_twldata = { | |||
| 159 | 177 | ||
| 160 | /* platform_data for children goes here */ | 178 | /* platform_data for children goes here */ |
| 161 | .gpio = &sdp2430_gpio_data, | 179 | .gpio = &sdp2430_gpio_data, |
| 180 | .vmmc1 = &sdp2430_vmmc1, | ||
| 162 | }; | 181 | }; |
| 163 | 182 | ||
| 164 | static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = { | 183 | static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = { |
| @@ -225,6 +244,9 @@ static void __init omap_2430sdp_init(void) | |||
| 225 | 244 | ||
| 226 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 245 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); |
| 227 | 246 | ||
| 247 | omap_board_config = sdp2430_config; | ||
| 248 | omap_board_config_size = ARRAY_SIZE(sdp2430_config); | ||
| 249 | |||
| 228 | omap2430_i2c_init(); | 250 | omap2430_i2c_init(); |
| 229 | 251 | ||
| 230 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 252 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 31085883199e..5464bec156ad 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
| @@ -307,31 +307,14 @@ static struct omap_dss_board_info sdp3430_dss_data = { | |||
| 307 | .default_device = &sdp3430_lcd_device, | 307 | .default_device = &sdp3430_lcd_device, |
| 308 | }; | 308 | }; |
| 309 | 309 | ||
| 310 | static struct platform_device sdp3430_dss_device = { | 310 | static struct regulator_consumer_supply sdp3430_vdda_dac_supply = |
| 311 | .name = "omapdss", | 311 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
| 312 | .id = -1, | ||
| 313 | .dev = { | ||
| 314 | .platform_data = &sdp3430_dss_data, | ||
| 315 | }, | ||
| 316 | }; | ||
| 317 | |||
| 318 | static struct regulator_consumer_supply sdp3430_vdda_dac_supply = { | ||
| 319 | .supply = "vdda_dac", | ||
| 320 | .dev = &sdp3430_dss_device.dev, | ||
| 321 | }; | ||
| 322 | |||
| 323 | static struct platform_device *sdp3430_devices[] __initdata = { | ||
| 324 | &sdp3430_dss_device, | ||
| 325 | }; | ||
| 326 | 312 | ||
| 327 | static struct omap_board_config_kernel sdp3430_config[] __initdata = { | 313 | static struct omap_board_config_kernel sdp3430_config[] __initdata = { |
| 328 | }; | 314 | }; |
| 329 | 315 | ||
| 330 | static void __init omap_3430sdp_init_early(void) | 316 | static void __init omap_3430sdp_init_early(void) |
| 331 | { | 317 | { |
| 332 | omap_board_config = sdp3430_config; | ||
| 333 | omap_board_config_size = ARRAY_SIZE(sdp3430_config); | ||
| 334 | omap3_pm_init_cpuidle(omap3_cpuidle_params_table); | ||
| 335 | omap2_init_common_infrastructure(); | 318 | omap2_init_common_infrastructure(); |
| 336 | omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); | 319 | omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); |
| 337 | } | 320 | } |
| @@ -369,18 +352,6 @@ static struct omap2_hsmmc_info mmc[] = { | |||
| 369 | {} /* Terminator */ | 352 | {} /* Terminator */ |
| 370 | }; | 353 | }; |
| 371 | 354 | ||
| 372 | static struct regulator_consumer_supply sdp3430_vmmc1_supply = { | ||
| 373 | .supply = "vmmc", | ||
| 374 | }; | ||
| 375 | |||
| 376 | static struct regulator_consumer_supply sdp3430_vsim_supply = { | ||
| 377 | .supply = "vmmc_aux", | ||
| 378 | }; | ||
| 379 | |||
| 380 | static struct regulator_consumer_supply sdp3430_vmmc2_supply = { | ||
| 381 | .supply = "vmmc", | ||
| 382 | }; | ||
| 383 | |||
| 384 | static int sdp3430_twl_gpio_setup(struct device *dev, | 355 | static int sdp3430_twl_gpio_setup(struct device *dev, |
| 385 | unsigned gpio, unsigned ngpio) | 356 | unsigned gpio, unsigned ngpio) |
| 386 | { | 357 | { |
| @@ -391,13 +362,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev, | |||
| 391 | mmc[1].gpio_cd = gpio + 1; | 362 | mmc[1].gpio_cd = gpio + 1; |
| 392 | omap2_hsmmc_init(mmc); | 363 | omap2_hsmmc_init(mmc); |
| 393 | 364 | ||
| 394 | /* link regulators to MMC adapters ... we "know" the | ||
| 395 | * regulators will be set up only *after* we return. | ||
| 396 | */ | ||
| 397 | sdp3430_vmmc1_supply.dev = mmc[0].dev; | ||
| 398 | sdp3430_vsim_supply.dev = mmc[0].dev; | ||
| 399 | sdp3430_vmmc2_supply.dev = mmc[1].dev; | ||
| 400 | |||
| 401 | /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ | 365 | /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ |
| 402 | gpio_request(gpio + 7, "sub_lcd_en_bkl"); | 366 | gpio_request(gpio + 7, "sub_lcd_en_bkl"); |
| 403 | gpio_direction_output(gpio + 7, 0); | 367 | gpio_direction_output(gpio + 7, 0); |
| @@ -426,6 +390,34 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = { | |||
| 426 | .irq_line = 1, | 390 | .irq_line = 1, |
| 427 | }; | 391 | }; |
| 428 | 392 | ||
| 393 | /* regulator consumer mappings */ | ||
| 394 | |||
| 395 | /* ads7846 on SPI */ | ||
| 396 | static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = { | ||
| 397 | REGULATOR_SUPPLY("vcc", "spi1.0"), | ||
| 398 | }; | ||
| 399 | |||
| 400 | static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = { | ||
| 401 | REGULATOR_SUPPLY("vdda_dac", "omapdss"), | ||
| 402 | }; | ||
| 403 | |||
| 404 | /* VPLL2 for digital video outputs */ | ||
| 405 | static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = { | ||
| 406 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), | ||
| 407 | }; | ||
| 408 | |||
| 409 | static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = { | ||
| 410 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), | ||
| 411 | }; | ||
| 412 | |||
| 413 | static struct regulator_consumer_supply sdp3430_vsim_supplies[] = { | ||
| 414 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), | ||
| 415 | }; | ||
| 416 | |||
| 417 | static struct regulator_consumer_supply sdp3430_vmmc2_supplies[] = { | ||
| 418 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), | ||
| 419 | }; | ||
| 420 | |||
| 429 | /* | 421 | /* |
| 430 | * Apply all the fixed voltages since most versions of U-Boot | 422 | * Apply all the fixed voltages since most versions of U-Boot |
| 431 | * don't bother with that initialization. | 423 | * don't bother with that initialization. |
| @@ -468,6 +460,8 @@ static struct regulator_init_data sdp3430_vaux3 = { | |||
| 468 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 460 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 469 | | REGULATOR_CHANGE_STATUS, | 461 | | REGULATOR_CHANGE_STATUS, |
| 470 | }, | 462 | }, |
| 463 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux3_supplies), | ||
| 464 | .consumer_supplies = sdp3430_vaux3_supplies, | ||
| 471 | }; | 465 | }; |
| 472 | 466 | ||
| 473 | /* VAUX4 for OMAP VDD_CSI2 (camera) */ | 467 | /* VAUX4 for OMAP VDD_CSI2 (camera) */ |
| @@ -494,8 +488,8 @@ static struct regulator_init_data sdp3430_vmmc1 = { | |||
| 494 | | REGULATOR_CHANGE_MODE | 488 | | REGULATOR_CHANGE_MODE |
| 495 | | REGULATOR_CHANGE_STATUS, | 489 | | REGULATOR_CHANGE_STATUS, |
| 496 | }, | 490 | }, |
| 497 | .num_consumer_supplies = 1, | 491 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc1_supplies), |
| 498 | .consumer_supplies = &sdp3430_vmmc1_supply, | 492 | .consumer_supplies = sdp3430_vmmc1_supplies, |
| 499 | }; | 493 | }; |
| 500 | 494 | ||
| 501 | /* VMMC2 for MMC2 card */ | 495 | /* VMMC2 for MMC2 card */ |
| @@ -509,8 +503,8 @@ static struct regulator_init_data sdp3430_vmmc2 = { | |||
| 509 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 503 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 510 | | REGULATOR_CHANGE_STATUS, | 504 | | REGULATOR_CHANGE_STATUS, |
| 511 | }, | 505 | }, |
| 512 | .num_consumer_supplies = 1, | 506 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc2_supplies), |
| 513 | .consumer_supplies = &sdp3430_vmmc2_supply, | 507 | .consumer_supplies = sdp3430_vmmc2_supplies, |
| 514 | }; | 508 | }; |
| 515 | 509 | ||
| 516 | /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ | 510 | /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ |
| @@ -524,8 +518,8 @@ static struct regulator_init_data sdp3430_vsim = { | |||
| 524 | | REGULATOR_CHANGE_MODE | 518 | | REGULATOR_CHANGE_MODE |
| 525 | | REGULATOR_CHANGE_STATUS, | 519 | | REGULATOR_CHANGE_STATUS, |
| 526 | }, | 520 | }, |
| 527 | .num_consumer_supplies = 1, | 521 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vsim_supplies), |
| 528 | .consumer_supplies = &sdp3430_vsim_supply, | 522 | .consumer_supplies = sdp3430_vsim_supplies, |
| 529 | }; | 523 | }; |
| 530 | 524 | ||
| 531 | /* VDAC for DSS driving S-Video */ | 525 | /* VDAC for DSS driving S-Video */ |
| @@ -539,16 +533,8 @@ static struct regulator_init_data sdp3430_vdac = { | |||
| 539 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 533 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| 540 | | REGULATOR_CHANGE_STATUS, | 534 | | REGULATOR_CHANGE_STATUS, |
| 541 | }, | 535 | }, |
| 542 | .num_consumer_supplies = 1, | 536 | .num_consumer_supplies = ARRAY_SIZE(sdp3430_vdda_dac_supplies), |
| 543 | .consumer_supplies = &sdp3430_vdda_dac_supply, | 537 | .consumer_supplies = sdp3430_vdda_dac_supplies, |
| 544 | }; | ||
| 545 | |||
| 546 | /* VPLL2 for digital video outputs */ | ||
| 547 | static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = { | ||
| 548 | { | ||
| 549 | .supply = "vdds_dsi", | ||
| 550 | .dev = &sdp3430_dss_device.dev, | ||
| 551 | } | ||
| 552 | }; | 538 | }; |
| 553 | 539 | ||
| 554 | static struct regulator_init_data sdp3430_vpll2 = { | 540 | static struct regulator_init_data sdp3430_vpll2 = { |
| @@ -566,9 +552,7 @@ static struct regulator_init_data sdp3430_vpll2 = { | |||
| 566 | .consumer_supplies = sdp3430_vpll2_supplies, | 552 | .consumer_supplies = sdp3430_vpll2_supplies, |
| 567 | }; | 553 | }; |
| 568 | 554 | ||
| 569 | static struct twl4030_codec_audio_data sdp3430_audio = { | 555 | static struct twl4030_codec_audio_data sdp3430_audio; |
| 570 | .audio_mclk = 26000000, | ||
| 571 | }; | ||
| 572 | 556 | ||
| 573 | static struct twl4030_codec_data sdp3430_codec = { | 557 | static struct twl4030_codec_data sdp3430_codec = { |
| 574 | .audio_mclk = 26000000, | 558 | .audio_mclk = 26000000, |
| @@ -799,8 +783,11 @@ static struct omap_musb_board_data musb_board_data = { | |||
| 799 | static void __init omap_3430sdp_init(void) | 783 | static void __init omap_3430sdp_init(void) |
| 800 | { | 784 | { |
| 801 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 785 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 786 | omap_board_config = sdp3430_config; | ||
| 787 | omap_board_config_size = ARRAY_SIZE(sdp3430_config); | ||
| 788 | omap3_pm_init_cpuidle(omap3_cpuidle_params_table); | ||
| 802 | omap3430_i2c_init(); | 789 | omap3430_i2c_init(); |
| 803 | platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices)); | 790 | omap_display_init(&sdp3430_dss_data); |
| 804 | if (omap_rev() > OMAP3430_REV_ES1_0) | 791 | if (omap_rev() > OMAP3430_REV_ES1_0) |
| 805 | ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; | 792 | ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; |
| 806 | else | 793 | else |
| @@ -812,7 +799,7 @@ static void __init omap_3430sdp_init(void) | |||
| 812 | omap_serial_init(); | 799 | omap_serial_init(); |
| 813 | usb_musb_init(&musb_board_data); | 800 | usb_musb_init(&musb_board_data); |
| 814 | board_smc91x_init(); | 801 | board_smc91x_init(); |
| 815 | board_flash_init(sdp_flash_partitions, chip_sel_3430); | 802 | board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); |
| 816 | sdp3430_display_init(); | 803 | sdp3430_display_init(); |
| 817 | enable_board_wakeup_source(); | 804 | enable_board_wakeup_source(); |
| 818 | usb_ehci_init(&ehci_pdata); | 805 | usb_ehci_init(&ehci_pdata); |
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index 16538757291a..c4e22b32e47f 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
| 12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
| 13 | #include <linux/gpio.h> | 13 | #include <linux/gpio.h> |
| 14 | #include <linux/mtd/nand.h> | ||
| 14 | 15 | ||
| 15 | #include <asm/mach-types.h> | 16 | #include <asm/mach-types.h> |
| 16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
| @@ -71,8 +72,6 @@ static struct omap_board_config_kernel sdp_config[] __initdata = { | |||
| 71 | 72 | ||
| 72 | static void __init omap_sdp_init_early(void) | 73 | static void __init omap_sdp_init_early(void) |
| 73 | { | 74 | { |
| 74 | omap_board_config = sdp_config; | ||
| 75 | omap_board_config_size = ARRAY_SIZE(sdp_config); | ||
| 76 | omap2_init_common_infrastructure(); | 75 | omap2_init_common_infrastructure(); |
| 77 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, | 76 | omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, |
| 78 | h8mbx00u0mer0em_sdrc_params); | 77 | h8mbx00u0mer0em_sdrc_params); |
| @@ -205,10 +204,12 @@ static struct flash_partitions sdp_flash_partitions[] = { | |||
| 205 | static void __init omap_sdp_init(void) | 204 | static void __init omap_sdp_init(void) |
| 206 | { | 205 | { |
| 207 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); | 206 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
| 207 | omap_board_config = sdp_config; | ||
| 208 | omap_board_config_size = ARRAY_SIZE(sdp_config); | ||
| 208 | zoom_peripherals_init(); | 209 | zoom_peripherals_init(); |
| 209 | zoom_display_init(); | 210 | zoom_display_init(); |
| 210 | board_smc91x_init(); | 211 | board_smc91x_init(); |
| 211 | board_flash_init(sdp_flash_partitions, chip_sel_sdp); | 212 | board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16); |
| 212 | enable_board_wakeup_source(); | 213 | enable_board_wakeup_source(); |
| 213 | usb_ehci_init(&ehci_pdata); | 214 | usb_ehci_init(&ehci_pdata); |
| 214 | } | 215 | } |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index bf8268438d00..85805d432e38 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <plat/common.h> | 35 | #include <plat/common.h> |
| 36 | #include <plat/usb.h> | 36 | #include <plat/usb.h> |
| 37 | #include <plat/mmc.h> | 37 | #include <plat/mmc.h> |
| 38 | #include <plat/omap4-keypad.h> | ||
| 38 | 39 | ||
| 39 | #include "mux.h" | 40 | #include "mux.h" |
| 40 | #include "hsmmc.h" | 41 | #include "hsmmc.h" |
| @@ -47,6 +48,90 @@ | |||
| 47 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 | 48 | #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 |
| 48 | #define OMAP4_SFH7741_ENABLE_GPIO 188 | 49 | #define OMAP4_SFH7741_ENABLE_GPIO 188 |
| 49 | 50 | ||
| 51 | static const int sdp4430_keymap[] = { | ||
| 52 | KEY(0, 0, KEY_E), | ||
| 53 | KEY(0, 1, KEY_R), | ||
| 54 | KEY(0, 2, KEY_T), | ||
| 55 | KEY(0, 3, KEY_HOME), | ||
| 56 | KEY(0, 4, KEY_F5), | ||
| 57 | KEY(0, 5, KEY_UNKNOWN), | ||
| 58 | KEY(0, 6, KEY_I), | ||
| 59 | KEY(0, 7, KEY_LEFTSHIFT), | ||
| 60 | |||
| 61 | KEY(1, 0, KEY_D), | ||
| 62 | KEY(1, 1, KEY_F), | ||
| 63 | KEY(1, 2, KEY_G), | ||
| 64 | KEY(1, 3, KEY_SEND), | ||
| 65 | KEY(1, 4, KEY_F6), | ||
| 66 | KEY(1, 5, KEY_UNKNOWN), | ||
| 67 | KEY(1, 6, KEY_K), | ||
| 68 | KEY(1, 7, KEY_ENTER), | ||
| 69 | |||
| 70 | KEY(2, 0, KEY_X), | ||
| 71 | KEY(2, 1, KEY_C), | ||
| 72 | KEY(2, 2, KEY_V), | ||
| 73 | KEY(2, 3, KEY_END), | ||
| 74 | KEY(2, 4, KEY_F7), | ||
| 75 | KEY(2, 5, KEY_UNKNOWN), | ||
| 76 | KEY(2, 6, KEY_DOT), | ||
| 77 | KEY(2, 7, KEY_CAPSLOCK), | ||
| 78 | |||
| 79 | KEY(3, 0, KEY_Z), | ||
| 80 | KEY(3, 1, KEY_KPPLUS), | ||
| 81 | KEY(3, 2, KEY_B), | ||
| 82 | KEY(3, 3, KEY_F1), | ||
| 83 | KEY(3, 4, KEY_F8), | ||
| 84 | KEY(3, 5, KEY_UNKNOWN), | ||
| 85 | KEY(3, 6, KEY_O), | ||
| 86 | KEY(3, 7, KEY_SPACE), | ||
| 87 | |||
| 88 | KEY(4, 0, KEY_W), | ||
| 89 | KEY(4, 1, KEY_Y), | ||
| 90 | KEY(4, 2, KEY_U), | ||
| 91 | KEY(4, 3, KEY_F2), | ||
| 92 | KEY(4, 4, KEY_VOLUMEUP), | ||
| 93 | KEY(4, 5, KEY_UNKNOWN), | ||
| 94 | KEY(4, 6, KEY_L), | ||
| 95 | KEY(4, 7, KEY_LEFT), | ||
| 96 | |||
| 97 | KEY(5, 0, KEY_S), | ||
| 98 | KEY(5, 1, KEY_H), | ||
| 99 | KEY(5, 2, KEY_J), | ||
| 100 | KEY(5, 3, KEY_F3), | ||
| 101 | KEY(5, 4, KEY_F9), | ||
| 102 | KEY(5, 5, KEY_VOLUMEDOWN), | ||
| 103 | KEY(5, 6, KEY_M), | ||
| 104 | KEY(5, 7, KEY_RIGHT), | ||
| 105 | |||
| 106 | KEY(6, 0, KEY_Q), | ||
| 107 | KEY(6, 1, KEY_A), | ||
| 108 | KEY(6, 2, KEY_N), | ||
| 109 | KEY(6, 3, KEY_BACK), | ||
| 110 | KEY(6, 4, KEY_BACKSPACE), | ||
| 111 | KEY(6, 5, KEY_UNKNOWN), | ||
| 112 | KEY(6, 6, KEY_P), | ||
| 113 | KEY(6, 7, KEY_UP), | ||
| 114 | |||
| 115 | KEY(7, 0, KEY_PROG1), | ||
| 116 | KEY(7, 1, KEY_PROG2), | ||
| 117 | KEY(7, 2, KEY_PROG3), | ||
| 118 | KEY(7, 3, KEY_PROG4), | ||
| 119 | KEY(7, 4, KEY_F4), | ||
| 120 | KEY(7, 5, KEY_UNKNOWN), | ||
| 121 | KEY(7, 6, KEY_OK), | ||
| 122 | KEY(7, 7, KEY_DOWN), | ||
| 123 | }; | ||
| 124 | |||
| 125 | static struct matrix_keymap_data sdp4430_keymap_data = { | ||
| 126 | .keymap = sdp4430_keymap, | ||
| 127 | .keymap_size = ARRAY_SIZE(sdp4430_keymap), | ||
| 128 | }; | ||
| 129 | |||
| 130 | static struct omap4_keypad_platform_data sdp4430_keypad_data = { | ||
| 131 | .keymap_data = &sdp4430_keymap_data, | ||
| 132 | .rows = 8, | ||
| 133 | .cols = 8, | ||
| 134 | }; | ||
| 50 | static struct gpio_led sdp4430_gpio_leds[] = { | 135 | static struct gpio_led sdp4430_gpio_leds[] = { |
| 51 | { | 136 | { |
| 52 | .name = "omap4:green:debug0", | 137 | .name = "omap4:green:debug0", |
| @@ -240,8 +325,6 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = { | |||
| 240 | 325 | ||
| 241 | static void __init omap_4430sdp_init_early(void) | 326 | static void __init omap_4430sdp_init_early(void) |
| 242 | { | 327 | { |
| 243 | omap_board_config = sdp4430_config; | ||
| 244 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); | ||
| 245 | omap2_init_common_infrastructure(); | 328 | omap2_init_common_infrastructure(); |
| 246 | omap2_init_common_devices(NULL, NULL); | 329 | omap2_init_common_devices(NULL, NULL); |
| 247 | #ifdef CONFIG_OMAP_32K_TIMER | 330 | #ifdef CONFIG_OMAP_32K_TIMER |
| @@ -264,11 +347,6 @@ static struct twl4030_usb_data omap4_usbphy_data = { | |||
| 264 | 347 | ||
| 265 | static struct omap2_hsmmc_info mmc[] = { | 348 | static struct omap2_hsmmc_info mmc[] = { |
| 266 | { | 349 | { |
| 267 | .mmc = 1, | ||
| 268 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
| 269 | .gpio_wp = -EINVAL, | ||
| 270 | }, | ||
| 271 | { | ||
| 272 | .mmc = 2, | 350 | .mmc = 2, |
| 273 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | 351 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, |
| 274 | .gpio_cd = -EINVAL, | 352 | .gpio_cd = -EINVAL, |
| @@ -276,19 +354,24 @@ static struct omap2_hsmmc_info mmc[] = { | |||
| 276 | .nonremovable = true, | 354 | .nonremovable = true, |
| 277 | .ocr_mask = MMC_VDD_29_30, | 355 | .ocr_mask = MMC_VDD_29_30, |
| 278 | }, | 356 | }, |
| 357 | { | ||
| 358 | .mmc = 1, | ||
| 359 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | ||
| 360 | .gpio_wp = -EINVAL, | ||
| 361 | }, | ||
| 279 | {} /* Terminator */ | 362 | {} /* Terminator */ |
| 280 | }; | 363 | }; |
| 281 | 364 | ||
| 282 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { | 365 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { |
| 283 | { | 366 | { |
| 284 | .supply = "vmmc", | 367 | .supply = "vmmc", |
| 285 | .dev_name = "mmci-omap-hs.1", | 368 | .dev_name = "omap_hsmmc.1", |
| 286 | }, | 369 | }, |
| 287 | }; | 370 | }; |
| 288 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | 371 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { |
| 289 | { | 372 | { |
| 290 | .supply = "vmmc", | 373 | .supply = "vmmc", |
| 291 | .dev_name = "mmci-omap-hs.0", | 374 | .dev_name = "omap_hsmmc.0", |
| 292 | }, | 375 | }, |
| 293 | }; | 376 | }; |
| 294 | 377 | ||
| @@ -422,7 +505,6 @@ static struct regulator_init_data sdp4430_vana = { | |||
| 422 | .constraints = { | 505 | .constraints = { |
| 423 | .min_uV = 2100000, | 506 | .min_uV = 2100000, |
| 424 | .max_uV = 2100000, | 507 | .max_uV = 2100000, |
| 425 | .apply_uV = true, | ||
| 426 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 508 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 427 | | REGULATOR_MODE_STANDBY, | 509 | | REGULATOR_MODE_STANDBY, |
| 428 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 510 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| @@ -434,7 +516,6 @@ static struct regulator_init_data sdp4430_vcxio = { | |||
| 434 | .constraints = { | 516 | .constraints = { |
| 435 | .min_uV = 1800000, | 517 | .min_uV = 1800000, |
| 436 | .max_uV = 1800000, | 518 | .max_uV = 1800000, |
| 437 | .apply_uV = true, | ||
| 438 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 519 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 439 | | REGULATOR_MODE_STANDBY, | 520 | | REGULATOR_MODE_STANDBY, |
| 440 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 521 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| @@ -446,7 +527,6 @@ static struct regulator_init_data sdp4430_vdac = { | |||
| 446 | .constraints = { | 527 | .constraints = { |
| 447 | .min_uV = 1800000, | 528 | .min_uV = 1800000, |
| 448 | .max_uV = 1800000, | 529 | .max_uV = 1800000, |
| 449 | .apply_uV = true, | ||
| 450 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 530 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 451 | | REGULATOR_MODE_STANDBY, | 531 | | REGULATOR_MODE_STANDBY, |
| 452 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 532 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| @@ -558,6 +638,9 @@ static void __init omap_4430sdp_init(void) | |||
| 558 | package = OMAP_PACKAGE_CBL; | 638 | package = OMAP_PACKAGE_CBL; |
| 559 | omap4_mux_init(board_mux, package); | 639 | omap4_mux_init(board_mux, package); |
| 560 | 640 | ||
| 641 | omap_board_config = sdp4430_config; | ||
| 642 | omap_board_config_size = ARRAY_SIZE(sdp4430_config); | ||
| 643 | |||
| 561 | omap4_i2c_init(); | 644 | omap4_i2c_init(); |
| 562 | omap_sfh7741prox_init(); | 645 | omap_sfh7741prox_init(); |
| 563 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 646 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
| @@ -574,6 +657,10 @@ static void __init omap_4430sdp_init(void) | |||
| 574 | spi_register_board_info(sdp4430_spi_board_info, | 657 | spi_register_board_info(sdp4430_spi_board_info, |
| 575 | ARRAY_SIZE(sdp4430_spi_board_info)); | 658 | ARRAY_SIZE(sdp4430_spi_board_info)); |
| 576 | } | 659 | } |
| 660 | |||
| 661 | status = omap4_keyboard_init(&sdp4430_keypad_data); | ||
| 662 | if (status) | ||
| 663 | pr_err("Keypad initialization failed: %d\n", status); | ||
| 577 | } | 664 | } |
| 578 | 665 | ||
| 579 | static void __init omap_4430sdp_map_io(void) | 666 | static void __init omap_4430sdp_map_io(void) |
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c index ae3a83d47dab..f53bbb2c3478 100644 --- a/arch/arm/mach-omap2/board-am3517crane.c +++ b/arch/arm/mach-omap2/board-am3517crane.c | |||
| @@ -51,9 +51,6 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
| 51 | 51 | ||
| 52 | static void __init am3517_crane_init_early(void) | 52 | static void __init am3517_crane_init_early(void) |
| 53 | { | 53 | { |
| 54 | omap_board_config = am3517_crane_config; | ||
| 55 | omap_board_config_size = ARRAY_SIZE(am3517_crane_config); | ||
| 56 | |||
| 57 | omap2_init_common_infrastructure(); | 54 | omap2_init_common_infrastructure(); |
| 58 | omap2_init_common_devices(NULL, NULL); | 55 | omap2_init_common_devices(NULL, NULL); |
| 59 | } | 56 | } |
| @@ -76,6 +73,9 @@ static void __init am3517_crane_init(void) | |||
| 76 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 73 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 77 | omap_serial_init(); | 74 | omap_serial_init(); |
| 78 | 75 | ||
| 76 | omap_board_config = am3517_crane_config; | ||
| 77 | omap_board_config_size = ARRAY_SIZE(am3517_crane_config); | ||
| 78 | |||
| 79 | /* Configure GPIO for EHCI port */ | 79 | /* Configure GPIO for EHCI port */ |
| 80 | if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { | 80 | if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { |
| 81 | pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", | 81 | pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", |
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 8532d6e0d53a..77541cf59bd4 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
| @@ -200,6 +200,9 @@ static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = { | |||
| 200 | }; | 200 | }; |
| 201 | static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { | 201 | static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { |
| 202 | { | 202 | { |
| 203 | I2C_BOARD_INFO("tlv320aic23", 0x1A), | ||
| 204 | }, | ||
| 205 | { | ||
| 203 | I2C_BOARD_INFO("tca6416", 0x21), | 206 | I2C_BOARD_INFO("tca6416", 0x21), |
| 204 | .platform_data = &am3517evm_gpio_expander_info_0, | 207 | .platform_data = &am3517evm_gpio_expander_info_0, |
| 205 | }, | 208 | }, |
| @@ -378,28 +381,11 @@ static struct omap_dss_board_info am3517_evm_dss_data = { | |||
| 378 | .default_device = &am3517_evm_lcd_device, | 381 | .default_device = &am3517_evm_lcd_device, |
| 379 | }; | 382 | }; |
| 380 | 383 | ||
| 381 | static struct platform_device am3517_evm_dss_device = { | ||
| 382 | .name = "omapdss", | ||
| 383 | .id = -1, | ||
| 384 | .dev = { | ||
| 385 | .platform_data = &am3517_evm_dss_data, | ||
| 386 | }, | ||
| 387 | }; | ||
| 388 | |||
| 389 | /* | 384 | /* |
| 390 | * Board initialization | 385 | * Board initialization |
| 391 | */ | 386 | */ |
| 392 | static struct omap_board_config_kernel am3517_evm_config[] __initdata = { | ||
| 393 | }; | ||
| 394 | |||
| 395 | static struct platform_device *am3517_evm_devices[] __initdata = { | ||
| 396 | &am3517_evm_dss_device, | ||
| 397 | }; | ||
| 398 | |||
| 399 | static void __init am3517_evm_init_early(void) | 387 | static void __init am3517_evm_init_early(void) |
| 400 | { | 388 | { |
| 401 | omap_board_config = am3517_evm_config; | ||
| 402 | omap_board_config_size = ARRAY_SIZE(am3517_evm_config); | ||
| 403 | omap2_init_common_infrastructure(); | 389 | omap2_init_common_infrastructure(); |
| 404 | omap2_init_common_devices(NULL, NULL); | 390 | omap2_init_common_devices(NULL, NULL); |
| 405 | } | 391 | } |
| @@ -493,14 +479,17 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata) | |||
| 493 | platform_device_register(&am3517_hecc_device); | 479 | platform_device_register(&am3517_hecc_device); |
| 494 | } | 480 | } |
| 495 | 481 | ||
| 482 | static struct omap_board_config_kernel am3517_evm_config[] __initdata = { | ||
| 483 | }; | ||
| 484 | |||
| 496 | static void __init am3517_evm_init(void) | 485 | static void __init am3517_evm_init(void) |
| 497 | { | 486 | { |
| 487 | omap_board_config = am3517_evm_config; | ||
| 488 | omap_board_config_size = ARRAY_SIZE(am3517_evm_config); | ||
| 498 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 489 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 499 | 490 | ||
| 500 | am3517_evm_i2c_init(); | 491 | am3517_evm_i2c_init(); |
| 501 | platform_add_devices(am3517_evm_devices, | 492 | omap_display_init(&am3517_evm_dss_data); |
| 502 | ARRAY_SIZE(am3517_evm_devices)); | ||
| 503 | |||
| 504 | omap_serial_init(); | 493 | omap_serial_init(); |
| 505 | 494 | ||
| 506 | /* Configure GPIO for EHCI port */ | 495 | /* Configure GPIO for EHCI port */ |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 4ef4aad4e719..f4f8374a0298 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
| @@ -276,8 +276,6 @@ static struct omap_board_config_kernel apollon_config[] __initdata = { | |||
| 276 | 276 | ||
| 277 | static void __init omap_apollon_init_early(void) | 277 | static void __init omap_apollon_init_early(void) |
| 278 | { | 278 | { |
| 279 | omap_board_config = apollon_config; | ||
| 280 | omap_board_config_size = ARRAY_SIZE(apollon_config); | ||
| 281 | omap2_init_common_infrastructure(); | 279 | omap2_init_common_infrastructure(); |
| 282 | omap2_init_common_devices(NULL, NULL); | 280 | omap2_init_common_devices(NULL, NULL); |
| 283 | } | 281 | } |
| @@ -319,6 +317,8 @@ static void __init omap_apollon_init(void) | |||
| 319 | u32 v; | 317 | u32 v; |
| 320 | 318 | ||
| 321 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); | 319 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); |
| 320 | omap_board_config = apollon_config; | ||
| 321 | omap_board_config_size = ARRAY_SIZE(apollon_config); | ||
| 322 | 322 | ||
| 323 | apollon_init_smc91x(); | 323 | apollon_init_smc91x(); |
| 324 | apollon_led_init(); | 324 | apollon_led_init(); |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 9e4de92a5798..27bea540ccbb 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
| @@ -401,14 +401,6 @@ static struct omap_dss_board_info cm_t35_dss_data = { | |||
| 401 | .default_device = &cm_t35_dvi_device, | 401 | .default_device = &cm_t35_dvi_device, |
| 402 | }; | 402 | }; |
| 403 | 403 | ||
| 404 | static struct platform_device cm_t35_dss_device = { | ||
| 405 | .name = "omapdss", | ||
| 406 | .id = -1, | ||
| 407 | .dev = { | ||
| 408 | .platform_data = &cm_t35_dss_data, | ||
| 409 | }, | ||
| 410 | }; | ||
| 411 | |||
| 412 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { | 404 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { |
| 413 | .turbo_mode = 0, | 405 | .turbo_mode = 0, |
| 414 | .single_channel = 1, /* 0: slave, 1: master */ | 406 | .single_channel = 1, /* 0: slave, 1: master */ |
| @@ -468,7 +460,7 @@ static void __init cm_t35_init_display(void) | |||
| 468 | msleep(50); | 460 | msleep(50); |
| 469 | gpio_set_value(lcd_en_gpio, 1); | 461 | gpio_set_value(lcd_en_gpio, 1); |
| 470 | 462 | ||
| 471 | err = platform_device_register(&cm_t35_dss_device); | 463 | err = omap_display_init(&cm_t35_dss_data); |
| 472 | if (err) { | 464 | if (err) { |
| 473 | pr_err("CM-T35: failed to register DSS device\n"); | 465 | pr_err("CM-T35: failed to register DSS device\n"); |
| 474 | goto err_dev_reg; | 466 | goto err_dev_reg; |
| @@ -495,15 +487,11 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = { | |||
| 495 | .supply = "vmmc_aux", | 487 | .supply = "vmmc_aux", |
| 496 | }; | 488 | }; |
| 497 | 489 | ||
| 498 | static struct regulator_consumer_supply cm_t35_vdac_supply = { | 490 | static struct regulator_consumer_supply cm_t35_vdac_supply = |
| 499 | .supply = "vdda_dac", | 491 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
| 500 | .dev = &cm_t35_dss_device.dev, | ||
| 501 | }; | ||
| 502 | 492 | ||
| 503 | static struct regulator_consumer_supply cm_t35_vdvi_supply = { | 493 | static struct regulator_consumer_supply cm_t35_vdvi_supply = |
| 504 | .supply = "vdvi", | 494 | REGULATOR_SUPPLY("vdvi", "omapdss"); |
| 505 | .dev = &cm_t35_dss_device.dev, | ||
| 506 | }; | ||
| 507 | 495 | ||
| 508 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 496 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
| 509 | static struct regulator_init_data cm_t35_vmmc1 = { | 497 | static struct regulator_init_data cm_t35_vmmc1 = { |
| @@ -680,14 +668,8 @@ static void __init cm_t35_init_i2c(void) | |||
| 680 | ARRAY_SIZE(cm_t35_i2c_boardinfo)); | 668 | ARRAY_SIZE(cm_t35_i2c_boardinfo)); |
| 681 | } | 669 | } |
| 682 | 670 | ||
| 683 | static struct omap_board_config_kernel cm_t35_config[] __initdata = { | ||
| 684 | }; | ||
| 685 | |||
| 686 | static void __init cm_t35_init_early(void) | 671 | static void __init cm_t35_init_early(void) |
| 687 | { | 672 | { |
| 688 | omap_board_config = cm_t35_config; | ||
| 689 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | ||
| 690 | |||
| 691 | omap2_init_common_infrastructure(); | 673 | omap2_init_common_infrastructure(); |
| 692 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 674 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
| 693 | mt46h32m32lf6_sdrc_params); | 675 | mt46h32m32lf6_sdrc_params); |
| @@ -797,8 +779,13 @@ static struct omap_musb_board_data musb_board_data = { | |||
| 797 | .power = 100, | 779 | .power = 100, |
| 798 | }; | 780 | }; |
| 799 | 781 | ||
| 782 | static struct omap_board_config_kernel cm_t35_config[] __initdata = { | ||
| 783 | }; | ||
| 784 | |||
| 800 | static void __init cm_t35_init(void) | 785 | static void __init cm_t35_init(void) |
| 801 | { | 786 | { |
| 787 | omap_board_config = cm_t35_config; | ||
| 788 | omap_board_config_size = ARRAY_SIZE(cm_t35_config); | ||
| 802 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 789 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
| 803 | omap_serial_init(); | 790 | omap_serial_init(); |
| 804 | cm_t35_init_i2c(); | 791 | cm_t35_init_i2c(); |
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index 38bef6d004c9..9da6e8240e8b 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c | |||
| @@ -256,9 +256,6 @@ static struct omap_board_config_kernel cm_t3517_config[] __initdata = { | |||
| 256 | 256 | ||
| 257 | static void __init cm_t3517_init_early(void) | 257 | static void __init cm_t3517_init_early(void) |
| 258 | { | 258 | { |
| 259 | omap_board_config = cm_t3517_config; | ||
| 260 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | ||
| 261 | |||
| 262 | omap2_init_common_infrastructure(); | 259 | omap2_init_common_infrastructure(); |
| 263 | omap2_init_common_devices(NULL, NULL); | 260 | omap2_init_common_devices(NULL, NULL); |
| 264 | } | 261 | } |
| @@ -293,6 +290,8 @@ static void __init cm_t3517_init(void) | |||
| 293 | { | 290 | { |
| 294 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 291 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 295 | omap_serial_init(); | 292 | omap_serial_init(); |
| 293 | omap_board_config = cm_t3517_config; | ||
| 294 | omap_board_config_size = ARRAY_SIZE(cm_t3517_config); | ||
| 296 | cm_t3517_init_leds(); | 295 | cm_t3517_init_leds(); |
| 297 | cm_t3517_init_nand(); | 296 | cm_t3517_init_nand(); |
| 298 | cm_t3517_init_rtc(); | 297 | cm_t3517_init_rtc(); |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index af742887e834..728f27c5bcb1 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
| @@ -140,7 +140,7 @@ static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) | |||
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = | 142 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = |
| 143 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 143 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
| 144 | 144 | ||
| 145 | 145 | ||
| 146 | /* ads7846 on SPI */ | 146 | /* ads7846 on SPI */ |
| @@ -195,14 +195,6 @@ static struct omap_dss_board_info devkit8000_dss_data = { | |||
| 195 | .default_device = &devkit8000_lcd_device, | 195 | .default_device = &devkit8000_lcd_device, |
| 196 | }; | 196 | }; |
| 197 | 197 | ||
| 198 | static struct platform_device devkit8000_dss_device = { | ||
| 199 | .name = "omapdss", | ||
| 200 | .id = -1, | ||
| 201 | .dev = { | ||
| 202 | .platform_data = &devkit8000_dss_data, | ||
| 203 | }, | ||
| 204 | }; | ||
| 205 | |||
| 206 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = | 198 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = |
| 207 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | 199 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
| 208 | 200 | ||
| @@ -350,9 +342,7 @@ static struct twl4030_usb_data devkit8000_usb_data = { | |||
| 350 | .usb_mode = T2_USB_MODE_ULPI, | 342 | .usb_mode = T2_USB_MODE_ULPI, |
| 351 | }; | 343 | }; |
| 352 | 344 | ||
| 353 | static struct twl4030_codec_audio_data devkit8000_audio_data = { | 345 | static struct twl4030_codec_audio_data devkit8000_audio_data; |
| 354 | .audio_mclk = 26000000, | ||
| 355 | }; | ||
| 356 | 346 | ||
| 357 | static struct twl4030_codec_data devkit8000_codec_data = { | 347 | static struct twl4030_codec_data devkit8000_codec_data = { |
| 358 | .audio_mclk = 26000000, | 348 | .audio_mclk = 26000000, |
| @@ -579,7 +569,6 @@ static void __init omap_dm9000_init(void) | |||
| 579 | } | 569 | } |
| 580 | 570 | ||
| 581 | static struct platform_device *devkit8000_devices[] __initdata = { | 571 | static struct platform_device *devkit8000_devices[] __initdata = { |
| 582 | &devkit8000_dss_device, | ||
| 583 | &leds_gpio, | 572 | &leds_gpio, |
| 584 | &keys_gpio, | 573 | &keys_gpio, |
| 585 | &omap_dm9000_dev, | 574 | &omap_dm9000_dev, |
| @@ -801,6 +790,7 @@ static void __init devkit8000_init(void) | |||
| 801 | platform_add_devices(devkit8000_devices, | 790 | platform_add_devices(devkit8000_devices, |
| 802 | ARRAY_SIZE(devkit8000_devices)); | 791 | ARRAY_SIZE(devkit8000_devices)); |
| 803 | 792 | ||
| 793 | omap_display_init(&devkit8000_dss_data); | ||
| 804 | spi_register_board_info(devkit8000_spi_board_info, | 794 | spi_register_board_info(devkit8000_spi_board_info, |
| 805 | ARRAY_SIZE(devkit8000_spi_board_info)); | 795 | ARRAY_SIZE(devkit8000_spi_board_info)); |
| 806 | 796 | ||
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index fd38c05bb47f..729892fdcf2e 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * board-sdp-flash.c | 2 | * board-flash.c |
| 3 | * Modified from mach-omap2/board-3430sdp-flash.c | 3 | * Modified from mach-omap2/board-3430sdp-flash.c |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2009 Nokia Corporation | 5 | * Copyright (C) 2009 Nokia Corporation |
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 17 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
| 18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
| 19 | #include <plat/irqs.h> | ||
| 19 | 20 | ||
| 20 | #include <plat/gpmc.h> | 21 | #include <plat/gpmc.h> |
| 21 | #include <plat/nand.h> | 22 | #include <plat/nand.h> |
| @@ -73,11 +74,11 @@ __init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) | |||
| 73 | + FLASH_SIZE_SDPV1 - 1; | 74 | + FLASH_SIZE_SDPV1 - 1; |
| 74 | } | 75 | } |
| 75 | if (err < 0) { | 76 | if (err < 0) { |
| 76 | printk(KERN_ERR "NOR: Can't request GPMC CS\n"); | 77 | pr_err("NOR: Can't request GPMC CS\n"); |
| 77 | return; | 78 | return; |
| 78 | } | 79 | } |
| 79 | if (platform_device_register(&board_nor_device) < 0) | 80 | if (platform_device_register(&board_nor_device) < 0) |
| 80 | printk(KERN_ERR "Unable to register NOR device\n"); | 81 | pr_err("Unable to register NOR device\n"); |
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | 84 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ |
| @@ -139,17 +140,21 @@ static struct omap_nand_platform_data board_nand_data = { | |||
| 139 | }; | 140 | }; |
| 140 | 141 | ||
| 141 | void | 142 | void |
| 142 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) | 143 | __init board_nand_init(struct mtd_partition *nand_parts, |
| 144 | u8 nr_parts, u8 cs, int nand_type) | ||
| 143 | { | 145 | { |
| 144 | board_nand_data.cs = cs; | 146 | board_nand_data.cs = cs; |
| 145 | board_nand_data.parts = nand_parts; | 147 | board_nand_data.parts = nand_parts; |
| 146 | board_nand_data.nr_parts = nr_parts; | 148 | board_nand_data.nr_parts = nr_parts; |
| 149 | board_nand_data.devsize = nand_type; | ||
| 147 | 150 | ||
| 151 | board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; | ||
| 152 | board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs; | ||
| 148 | gpmc_nand_init(&board_nand_data); | 153 | gpmc_nand_init(&board_nand_data); |
| 149 | } | 154 | } |
| 150 | #else | 155 | #else |
| 151 | void | 156 | void |
| 152 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) | 157 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, int nand_type) |
| 153 | { | 158 | { |
| 154 | } | 159 | } |
| 155 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ | 160 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ |
| @@ -189,12 +194,12 @@ unmap: | |||
| 189 | } | 194 | } |
| 190 | 195 | ||
| 191 | /** | 196 | /** |
| 192 | * sdp3430_flash_init - Identify devices connected to GPMC and register. | 197 | * board_flash_init - Identify devices connected to GPMC and register. |
| 193 | * | 198 | * |
| 194 | * @return - void. | 199 | * @return - void. |
| 195 | */ | 200 | */ |
| 196 | void board_flash_init(struct flash_partitions partition_info[], | 201 | void board_flash_init(struct flash_partitions partition_info[], |
| 197 | char chip_sel_board[][GPMC_CS_NUM]) | 202 | char chip_sel_board[][GPMC_CS_NUM], int nand_type) |
| 198 | { | 203 | { |
| 199 | u8 cs = 0; | 204 | u8 cs = 0; |
| 200 | u8 norcs = GPMC_CS_NUM + 1; | 205 | u8 norcs = GPMC_CS_NUM + 1; |
| @@ -208,7 +213,7 @@ void board_flash_init(struct flash_partitions partition_info[], | |||
| 208 | */ | 213 | */ |
| 209 | idx = get_gpmc0_type(); | 214 | idx = get_gpmc0_type(); |
| 210 | if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { | 215 | if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { |
| 211 | printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); | 216 | pr_err("%s: Invalid chip select: %d\n", __func__, cs); |
| 212 | return; | 217 | return; |
| 213 | } | 218 | } |
| 214 | config_sel = (unsigned char *)(chip_sel_board[idx]); | 219 | config_sel = (unsigned char *)(chip_sel_board[idx]); |
| @@ -232,23 +237,20 @@ void board_flash_init(struct flash_partitions partition_info[], | |||
| 232 | } | 237 | } |
| 233 | 238 | ||
| 234 | if (norcs > GPMC_CS_NUM) | 239 | if (norcs > GPMC_CS_NUM) |
| 235 | printk(KERN_INFO "NOR: Unable to find configuration " | 240 | pr_err("NOR: Unable to find configuration in GPMC\n"); |
| 236 | "in GPMC\n"); | ||
| 237 | else | 241 | else |
| 238 | board_nor_init(partition_info[0].parts, | 242 | board_nor_init(partition_info[0].parts, |
| 239 | partition_info[0].nr_parts, norcs); | 243 | partition_info[0].nr_parts, norcs); |
| 240 | 244 | ||
| 241 | if (onenandcs > GPMC_CS_NUM) | 245 | if (onenandcs > GPMC_CS_NUM) |
| 242 | printk(KERN_INFO "OneNAND: Unable to find configuration " | 246 | pr_err("OneNAND: Unable to find configuration in GPMC\n"); |
| 243 | "in GPMC\n"); | ||
| 244 | else | 247 | else |
| 245 | board_onenand_init(partition_info[1].parts, | 248 | board_onenand_init(partition_info[1].parts, |
| 246 | partition_info[1].nr_parts, onenandcs); | 249 | partition_info[1].nr_parts, onenandcs); |
| 247 | 250 | ||
| 248 | if (nandcs > GPMC_CS_NUM) | 251 | if (nandcs > GPMC_CS_NUM) |
| 249 | printk(KERN_INFO "NAND: Unable to find configuration " | 252 | pr_err("NAND: Unable to find configuration in GPMC\n"); |
| 250 | "in GPMC\n"); | ||
| 251 | else | 253 | else |
| 252 | board_nand_init(partition_info[2].parts, | 254 | board_nand_init(partition_info[2].parts, |
| 253 | partition_info[2].nr_parts, nandcs); | 255 | partition_info[2].nr_parts, nandcs, nand_type); |
| 254 | } | 256 | } |
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h index 69befe00dd2f..c240a3f8d163 100644 --- a/arch/arm/mach-omap2/board-flash.h +++ b/arch/arm/mach-omap2/board-flash.h | |||
| @@ -25,6 +25,6 @@ struct flash_partitions { | |||
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | extern void board_flash_init(struct flash_partitions [], | 27 | extern void board_flash_init(struct flash_partitions [], |
| 28 | char chip_sel[][GPMC_CS_NUM]); | 28 | char chip_sel[][GPMC_CS_NUM], int nand_type); |
| 29 | extern void board_nand_init(struct mtd_partition *nand_parts, | 29 | extern void board_nand_init(struct mtd_partition *nand_parts, |
| 30 | u8 nr_parts, u8 cs); | 30 | u8 nr_parts, u8 cs, int nand_type); |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 682da9251db6..73e3c31e8508 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
| @@ -35,8 +35,6 @@ static struct omap_board_config_kernel generic_config[] = { | |||
| 35 | 35 | ||
| 36 | static void __init omap_generic_init_early(void) | 36 | static void __init omap_generic_init_early(void) |
| 37 | { | 37 | { |
| 38 | omap_board_config = generic_config; | ||
| 39 | omap_board_config_size = ARRAY_SIZE(generic_config); | ||
| 40 | omap2_init_common_infrastructure(); | 38 | omap2_init_common_infrastructure(); |
| 41 | omap2_init_common_devices(NULL, NULL); | 39 | omap2_init_common_devices(NULL, NULL); |
| 42 | } | 40 | } |
| @@ -44,6 +42,8 @@ static void __init omap_generic_init_early(void) | |||
| 44 | static void __init omap_generic_init(void) | 42 | static void __init omap_generic_init(void) |
| 45 | { | 43 | { |
| 46 | omap_serial_init(); | 44 | omap_serial_init(); |
| 45 | omap_board_config = generic_config; | ||
| 46 | omap_board_config_size = ARRAY_SIZE(generic_config); | ||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | static void __init omap_generic_map_io(void) | 49 | static void __init omap_generic_map_io(void) |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index f6a3872f72fa..7e6bf4fa1535 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
| @@ -292,8 +292,6 @@ static struct omap_board_config_kernel h4_config[] __initdata = { | |||
| 292 | 292 | ||
| 293 | static void __init omap_h4_init_early(void) | 293 | static void __init omap_h4_init_early(void) |
| 294 | { | 294 | { |
| 295 | omap_board_config = h4_config; | ||
| 296 | omap_board_config_size = ARRAY_SIZE(h4_config); | ||
| 297 | omap2_init_common_infrastructure(); | 295 | omap2_init_common_infrastructure(); |
| 298 | omap2_init_common_devices(NULL, NULL); | 296 | omap2_init_common_devices(NULL, NULL); |
| 299 | } | 297 | } |
| @@ -334,6 +332,9 @@ static void __init omap_h4_init(void) | |||
| 334 | { | 332 | { |
| 335 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); | 333 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); |
| 336 | 334 | ||
| 335 | omap_board_config = h4_config; | ||
| 336 | omap_board_config_size = ARRAY_SIZE(h4_config); | ||
| 337 | |||
| 337 | /* | 338 | /* |
| 338 | * Make sure the serial ports are muxed on at this point. | 339 | * Make sure the serial ports are muxed on at this point. |
| 339 | * You have to mux them off in device drivers later on | 340 | * You have to mux them off in device drivers later on |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index dd0b1ac3b662..c4b3c1c47ec6 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
| @@ -250,7 +250,7 @@ static inline void __init igep2_init_smsc911x(void) { } | |||
| 250 | #endif | 250 | #endif |
| 251 | 251 | ||
| 252 | static struct regulator_consumer_supply igep2_vmmc1_supply = | 252 | static struct regulator_consumer_supply igep2_vmmc1_supply = |
| 253 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 253 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
| 254 | 254 | ||
| 255 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 255 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
| 256 | static struct regulator_init_data igep2_vmmc1 = { | 256 | static struct regulator_init_data igep2_vmmc1 = { |
| @@ -268,7 +268,7 @@ static struct regulator_init_data igep2_vmmc1 = { | |||
| 268 | }; | 268 | }; |
| 269 | 269 | ||
| 270 | static struct regulator_consumer_supply igep2_vio_supply = | 270 | static struct regulator_consumer_supply igep2_vio_supply = |
| 271 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | 271 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); |
| 272 | 272 | ||
| 273 | static struct regulator_init_data igep2_vio = { | 273 | static struct regulator_init_data igep2_vio = { |
| 274 | .constraints = { | 274 | .constraints = { |
| @@ -286,7 +286,7 @@ static struct regulator_init_data igep2_vio = { | |||
| 286 | }; | 286 | }; |
| 287 | 287 | ||
| 288 | static struct regulator_consumer_supply igep2_vmmc2_supply = | 288 | static struct regulator_consumer_supply igep2_vmmc2_supply = |
| 289 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 289 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
| 290 | 290 | ||
| 291 | static struct regulator_init_data igep2_vmmc2 = { | 291 | static struct regulator_init_data igep2_vmmc2 = { |
| 292 | .constraints = { | 292 | .constraints = { |
| @@ -485,18 +485,8 @@ static struct omap_dss_board_info igep2_dss_data = { | |||
| 485 | .default_device = &igep2_dvi_device, | 485 | .default_device = &igep2_dvi_device, |
| 486 | }; | 486 | }; |
| 487 | 487 | ||
| 488 | static struct platform_device igep2_dss_device = { | 488 | static struct regulator_consumer_supply igep2_vpll2_supply = |
| 489 | .name = "omapdss", | 489 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"); |
| 490 | .id = -1, | ||
| 491 | .dev = { | ||
| 492 | .platform_data = &igep2_dss_data, | ||
| 493 | }, | ||
| 494 | }; | ||
| 495 | |||
| 496 | static struct regulator_consumer_supply igep2_vpll2_supply = { | ||
| 497 | .supply = "vdds_dsi", | ||
| 498 | .dev = &igep2_dss_device.dev, | ||
| 499 | }; | ||
| 500 | 490 | ||
| 501 | static struct regulator_init_data igep2_vpll2 = { | 491 | static struct regulator_init_data igep2_vpll2 = { |
| 502 | .constraints = { | 492 | .constraints = { |
| @@ -521,7 +511,6 @@ static void __init igep2_display_init(void) | |||
| 521 | } | 511 | } |
| 522 | 512 | ||
| 523 | static struct platform_device *igep2_devices[] __initdata = { | 513 | static struct platform_device *igep2_devices[] __initdata = { |
| 524 | &igep2_dss_device, | ||
| 525 | &igep2_vwlan_device, | 514 | &igep2_vwlan_device, |
| 526 | }; | 515 | }; |
| 527 | 516 | ||
| @@ -532,9 +521,7 @@ static void __init igep2_init_early(void) | |||
| 532 | m65kxxxxam_sdrc_params); | 521 | m65kxxxxam_sdrc_params); |
| 533 | } | 522 | } |
| 534 | 523 | ||
| 535 | static struct twl4030_codec_audio_data igep2_audio_data = { | 524 | static struct twl4030_codec_audio_data igep2_audio_data; |
| 536 | .audio_mclk = 26000000, | ||
| 537 | }; | ||
| 538 | 525 | ||
| 539 | static struct twl4030_codec_data igep2_codec_data = { | 526 | static struct twl4030_codec_data igep2_codec_data = { |
| 540 | .audio_mclk = 26000000, | 527 | .audio_mclk = 26000000, |
| @@ -696,6 +683,7 @@ static void __init igep2_init(void) | |||
| 696 | /* Register I2C busses and drivers */ | 683 | /* Register I2C busses and drivers */ |
| 697 | igep2_i2c_init(); | 684 | igep2_i2c_init(); |
| 698 | platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); | 685 | platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); |
| 686 | omap_display_init(&igep2_dss_data); | ||
| 699 | omap_serial_init(); | 687 | omap_serial_init(); |
| 700 | usb_musb_init(&musb_board_data); | 688 | usb_musb_init(&musb_board_data); |
| 701 | usb_ehci_init(&ehci_pdata); | 689 | usb_ehci_init(&ehci_pdata); |
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c index d75028e48f5d..4273d0672ef6 100644 --- a/arch/arm/mach-omap2/board-igep0030.c +++ b/arch/arm/mach-omap2/board-igep0030.c | |||
| @@ -142,7 +142,7 @@ static void __init igep3_flash_init(void) {} | |||
| 142 | #endif | 142 | #endif |
| 143 | 143 | ||
| 144 | static struct regulator_consumer_supply igep3_vmmc1_supply = | 144 | static struct regulator_consumer_supply igep3_vmmc1_supply = |
| 145 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 145 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
| 146 | 146 | ||
| 147 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 147 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
| 148 | static struct regulator_init_data igep3_vmmc1 = { | 148 | static struct regulator_init_data igep3_vmmc1 = { |
| @@ -160,7 +160,7 @@ static struct regulator_init_data igep3_vmmc1 = { | |||
| 160 | }; | 160 | }; |
| 161 | 161 | ||
| 162 | static struct regulator_consumer_supply igep3_vio_supply = | 162 | static struct regulator_consumer_supply igep3_vio_supply = |
| 163 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | 163 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); |
| 164 | 164 | ||
| 165 | static struct regulator_init_data igep3_vio = { | 165 | static struct regulator_init_data igep3_vio = { |
| 166 | .constraints = { | 166 | .constraints = { |
| @@ -178,7 +178,7 @@ static struct regulator_init_data igep3_vio = { | |||
| 178 | }; | 178 | }; |
| 179 | 179 | ||
| 180 | static struct regulator_consumer_supply igep3_vmmc2_supply = | 180 | static struct regulator_consumer_supply igep3_vmmc2_supply = |
| 181 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 181 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
| 182 | 182 | ||
| 183 | static struct regulator_init_data igep3_vmmc2 = { | 183 | static struct regulator_init_data igep3_vmmc2 = { |
| 184 | .constraints = { | 184 | .constraints = { |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index d8eb2cb7cbc7..e2ba77957a8c 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
| @@ -290,8 +290,6 @@ static struct omap_board_config_kernel ldp_config[] __initdata = { | |||
| 290 | 290 | ||
| 291 | static void __init omap_ldp_init_early(void) | 291 | static void __init omap_ldp_init_early(void) |
| 292 | { | 292 | { |
| 293 | omap_board_config = ldp_config; | ||
| 294 | omap_board_config_size = ARRAY_SIZE(ldp_config); | ||
| 295 | omap2_init_common_infrastructure(); | 293 | omap2_init_common_infrastructure(); |
| 296 | omap2_init_common_devices(NULL, NULL); | 294 | omap2_init_common_devices(NULL, NULL); |
| 297 | } | 295 | } |
| @@ -329,6 +327,26 @@ static struct regulator_init_data ldp_vmmc1 = { | |||
| 329 | .consumer_supplies = &ldp_vmmc1_supply, | 327 | .consumer_supplies = &ldp_vmmc1_supply, |
| 330 | }; | 328 | }; |
| 331 | 329 | ||
| 330 | /* ads7846 on SPI */ | ||
| 331 | static struct regulator_consumer_supply ldp_vaux1_supplies[] = { | ||
| 332 | REGULATOR_SUPPLY("vcc", "spi1.0"), | ||
| 333 | }; | ||
| 334 | |||
| 335 | /* VAUX1 */ | ||
| 336 | static struct regulator_init_data ldp_vaux1 = { | ||
| 337 | .constraints = { | ||
| 338 | .min_uV = 3000000, | ||
| 339 | .max_uV = 3000000, | ||
| 340 | .apply_uV = true, | ||
| 341 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
| 342 | | REGULATOR_MODE_STANDBY, | ||
| 343 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
| 344 | | REGULATOR_CHANGE_STATUS, | ||
| 345 | }, | ||
| 346 | .num_consumer_supplies = ARRAY_SIZE(ldp_vaux1_supplies), | ||
| 347 | .consumer_supplies = ldp_vaux1_supplies, | ||
| 348 | }; | ||
| 349 | |||
| 332 | static struct twl4030_platform_data ldp_twldata = { | 350 | static struct twl4030_platform_data ldp_twldata = { |
| 333 | .irq_base = TWL4030_IRQ_BASE, | 351 | .irq_base = TWL4030_IRQ_BASE, |
| 334 | .irq_end = TWL4030_IRQ_END, | 352 | .irq_end = TWL4030_IRQ_END, |
| @@ -337,6 +355,7 @@ static struct twl4030_platform_data ldp_twldata = { | |||
| 337 | .madc = &ldp_madc_data, | 355 | .madc = &ldp_madc_data, |
| 338 | .usb = &ldp_usb_data, | 356 | .usb = &ldp_usb_data, |
| 339 | .vmmc1 = &ldp_vmmc1, | 357 | .vmmc1 = &ldp_vmmc1, |
| 358 | .vaux1 = &ldp_vaux1, | ||
| 340 | .gpio = &ldp_gpio_data, | 359 | .gpio = &ldp_gpio_data, |
| 341 | .keypad = &ldp_kp_twl4030_data, | 360 | .keypad = &ldp_kp_twl4030_data, |
| 342 | }; | 361 | }; |
| @@ -422,6 +441,8 @@ static struct mtd_partition ldp_nand_partitions[] = { | |||
| 422 | static void __init omap_ldp_init(void) | 441 | static void __init omap_ldp_init(void) |
| 423 | { | 442 | { |
| 424 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 443 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 444 | omap_board_config = ldp_config; | ||
| 445 | omap_board_config_size = ARRAY_SIZE(ldp_config); | ||
| 425 | ldp_init_smsc911x(); | 446 | ldp_init_smsc911x(); |
| 426 | omap_i2c_init(); | 447 | omap_i2c_init(); |
| 427 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); | 448 | platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); |
| @@ -433,7 +454,7 @@ static void __init omap_ldp_init(void) | |||
| 433 | omap_serial_init(); | 454 | omap_serial_init(); |
| 434 | usb_musb_init(&musb_board_data); | 455 | usb_musb_init(&musb_board_data); |
| 435 | board_nand_init(ldp_nand_partitions, | 456 | board_nand_init(ldp_nand_partitions, |
| 436 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS); | 457 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); |
| 437 | 458 | ||
| 438 | omap2_hsmmc_init(mmc); | 459 | omap2_hsmmc_init(mmc); |
| 439 | /* link regulators to MMC adapters */ | 460 | /* link regulators to MMC adapters */ |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index b36cbd21e2d0..e710cd9e079b 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
| @@ -536,7 +536,7 @@ static void __init n8x0_mmc_init(void) | |||
| 536 | } | 536 | } |
| 537 | 537 | ||
| 538 | mmc_data[0] = &mmc1_data; | 538 | mmc_data[0] = &mmc1_data; |
| 539 | omap2_init_mmc(mmc_data, OMAP24XX_NR_MMC); | 539 | omap242x_init_mmc(mmc_data); |
| 540 | } | 540 | } |
| 541 | #else | 541 | #else |
| 542 | 542 | ||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 19bcd004d604..b6752ac5b97e 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
| @@ -228,14 +228,6 @@ static struct omap_dss_board_info beagle_dss_data = { | |||
| 228 | .default_device = &beagle_dvi_device, | 228 | .default_device = &beagle_dvi_device, |
| 229 | }; | 229 | }; |
| 230 | 230 | ||
| 231 | static struct platform_device beagle_dss_device = { | ||
| 232 | .name = "omapdss", | ||
| 233 | .id = -1, | ||
| 234 | .dev = { | ||
| 235 | .platform_data = &beagle_dss_data, | ||
| 236 | }, | ||
| 237 | }; | ||
| 238 | |||
| 239 | static struct regulator_consumer_supply beagle_vdac_supply = | 231 | static struct regulator_consumer_supply beagle_vdac_supply = |
| 240 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | 232 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
| 241 | 233 | ||
| @@ -435,9 +427,7 @@ static struct twl4030_usb_data beagle_usb_data = { | |||
| 435 | .usb_mode = T2_USB_MODE_ULPI, | 427 | .usb_mode = T2_USB_MODE_ULPI, |
| 436 | }; | 428 | }; |
| 437 | 429 | ||
| 438 | static struct twl4030_codec_audio_data beagle_audio_data = { | 430 | static struct twl4030_codec_audio_data beagle_audio_data; |
| 439 | .audio_mclk = 26000000, | ||
| 440 | }; | ||
| 441 | 431 | ||
| 442 | static struct twl4030_codec_data beagle_codec_data = { | 432 | static struct twl4030_codec_data beagle_codec_data = { |
| 443 | .audio_mclk = 26000000, | 433 | .audio_mclk = 26000000, |
| @@ -554,7 +544,6 @@ static void __init omap3_beagle_init_irq(void) | |||
| 554 | static struct platform_device *omap3_beagle_devices[] __initdata = { | 544 | static struct platform_device *omap3_beagle_devices[] __initdata = { |
| 555 | &leds_gpio, | 545 | &leds_gpio, |
| 556 | &keys_gpio, | 546 | &keys_gpio, |
| 557 | &beagle_dss_device, | ||
| 558 | }; | 547 | }; |
| 559 | 548 | ||
| 560 | static void __init omap3beagle_flash_init(void) | 549 | static void __init omap3beagle_flash_init(void) |
| @@ -621,6 +610,7 @@ static void __init omap3_beagle_init(void) | |||
| 621 | omap3_beagle_i2c_init(); | 610 | omap3_beagle_i2c_init(); |
| 622 | platform_add_devices(omap3_beagle_devices, | 611 | platform_add_devices(omap3_beagle_devices, |
| 623 | ARRAY_SIZE(omap3_beagle_devices)); | 612 | ARRAY_SIZE(omap3_beagle_devices)); |
| 613 | omap_display_init(&beagle_dss_data); | ||
| 624 | omap_serial_init(); | 614 | omap_serial_init(); |
| 625 | 615 | ||
| 626 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); | 616 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index c2a0fca4aa53..b65848c59e1d 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #include <linux/usb/otg.h> | 30 | #include <linux/usb/otg.h> |
| 31 | #include <linux/smsc911x.h> | 31 | #include <linux/smsc911x.h> |
| 32 | 32 | ||
| 33 | #include <linux/wl12xx.h> | ||
| 34 | #include <linux/regulator/fixed.h> | ||
| 33 | #include <linux/regulator/machine.h> | 35 | #include <linux/regulator/machine.h> |
| 34 | #include <linux/mmc/host.h> | 36 | #include <linux/mmc/host.h> |
| 35 | 37 | ||
| @@ -58,6 +60,13 @@ | |||
| 58 | #define OMAP3EVM_ETHR_ID_REV 0x50 | 60 | #define OMAP3EVM_ETHR_ID_REV 0x50 |
| 59 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 | 61 | #define OMAP3EVM_ETHR_GPIO_IRQ 176 |
| 60 | #define OMAP3EVM_SMSC911X_CS 5 | 62 | #define OMAP3EVM_SMSC911X_CS 5 |
| 63 | /* | ||
| 64 | * Eth Reset signal | ||
| 65 | * 64 = Generation 1 (<=RevD) | ||
| 66 | * 7 = Generation 2 (>=RevE) | ||
| 67 | */ | ||
| 68 | #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64 | ||
| 69 | #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7 | ||
| 61 | 70 | ||
| 62 | static u8 omap3_evm_version; | 71 | static u8 omap3_evm_version; |
| 63 | 72 | ||
| @@ -124,10 +133,15 @@ static struct platform_device omap3evm_smsc911x_device = { | |||
| 124 | 133 | ||
| 125 | static inline void __init omap3evm_init_smsc911x(void) | 134 | static inline void __init omap3evm_init_smsc911x(void) |
| 126 | { | 135 | { |
| 127 | int eth_cs; | 136 | int eth_cs, eth_rst; |
| 128 | struct clk *l3ck; | 137 | struct clk *l3ck; |
| 129 | unsigned int rate; | 138 | unsigned int rate; |
| 130 | 139 | ||
| 140 | if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) | ||
| 141 | eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST; | ||
| 142 | else | ||
| 143 | eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST; | ||
| 144 | |||
| 131 | eth_cs = OMAP3EVM_SMSC911X_CS; | 145 | eth_cs = OMAP3EVM_SMSC911X_CS; |
| 132 | 146 | ||
| 133 | l3ck = clk_get(NULL, "l3_ck"); | 147 | l3ck = clk_get(NULL, "l3_ck"); |
| @@ -136,6 +150,27 @@ static inline void __init omap3evm_init_smsc911x(void) | |||
| 136 | else | 150 | else |
| 137 | rate = clk_get_rate(l3ck); | 151 | rate = clk_get_rate(l3ck); |
| 138 | 152 | ||
| 153 | /* Configure ethernet controller reset gpio */ | ||
| 154 | if (cpu_is_omap3430()) { | ||
| 155 | if (gpio_request(eth_rst, "SMSC911x gpio") < 0) { | ||
| 156 | pr_err(KERN_ERR "Failed to request %d for smsc911x\n", | ||
| 157 | eth_rst); | ||
| 158 | return; | ||
| 159 | } | ||
| 160 | |||
| 161 | if (gpio_direction_output(eth_rst, 1) < 0) { | ||
| 162 | pr_err(KERN_ERR "Failed to set direction of %d for" \ | ||
| 163 | " smsc911x\n", eth_rst); | ||
| 164 | return; | ||
| 165 | } | ||
| 166 | /* reset pulse to ethernet controller*/ | ||
| 167 | usleep_range(150, 220); | ||
| 168 | gpio_set_value(eth_rst, 0); | ||
| 169 | usleep_range(150, 220); | ||
| 170 | gpio_set_value(eth_rst, 1); | ||
| 171 | usleep_range(1, 2); | ||
| 172 | } | ||
| 173 | |||
| 139 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { | 174 | if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { |
| 140 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", | 175 | printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", |
| 141 | OMAP3EVM_ETHR_GPIO_IRQ); | 176 | OMAP3EVM_ETHR_GPIO_IRQ); |
| @@ -235,9 +270,9 @@ static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) | |||
| 235 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); | 270 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); |
| 236 | 271 | ||
| 237 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | 272 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
| 238 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | 273 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
| 239 | else | 274 | else |
| 240 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | 275 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
| 241 | 276 | ||
| 242 | lcd_enabled = 1; | 277 | lcd_enabled = 1; |
| 243 | return 0; | 278 | return 0; |
| @@ -248,9 +283,9 @@ static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) | |||
| 248 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); | 283 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); |
| 249 | 284 | ||
| 250 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | 285 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
| 251 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | 286 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); |
| 252 | else | 287 | else |
| 253 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | 288 | gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); |
| 254 | 289 | ||
| 255 | lcd_enabled = 0; | 290 | lcd_enabled = 0; |
| 256 | } | 291 | } |
| @@ -289,7 +324,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | |||
| 289 | return -EINVAL; | 324 | return -EINVAL; |
| 290 | } | 325 | } |
| 291 | 326 | ||
| 292 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); | 327 | gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); |
| 293 | 328 | ||
| 294 | dvi_enabled = 1; | 329 | dvi_enabled = 1; |
| 295 | return 0; | 330 | return 0; |
| @@ -297,7 +332,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | |||
| 297 | 332 | ||
| 298 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) | 333 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) |
| 299 | { | 334 | { |
| 300 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); | 335 | gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); |
| 301 | 336 | ||
| 302 | dvi_enabled = 0; | 337 | dvi_enabled = 0; |
| 303 | } | 338 | } |
| @@ -328,14 +363,6 @@ static struct omap_dss_board_info omap3_evm_dss_data = { | |||
| 328 | .default_device = &omap3_evm_lcd_device, | 363 | .default_device = &omap3_evm_lcd_device, |
| 329 | }; | 364 | }; |
| 330 | 365 | ||
| 331 | static struct platform_device omap3_evm_dss_device = { | ||
| 332 | .name = "omapdss", | ||
| 333 | .id = -1, | ||
| 334 | .dev = { | ||
| 335 | .platform_data = &omap3_evm_dss_data, | ||
| 336 | }, | ||
| 337 | }; | ||
| 338 | |||
| 339 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { | 366 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { |
| 340 | .supply = "vmmc", | 367 | .supply = "vmmc", |
| 341 | }; | 368 | }; |
| @@ -381,6 +408,16 @@ static struct omap2_hsmmc_info mmc[] = { | |||
| 381 | .gpio_cd = -EINVAL, | 408 | .gpio_cd = -EINVAL, |
| 382 | .gpio_wp = 63, | 409 | .gpio_wp = 63, |
| 383 | }, | 410 | }, |
| 411 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
| 412 | { | ||
| 413 | .name = "wl1271", | ||
| 414 | .mmc = 2, | ||
| 415 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, | ||
| 416 | .gpio_wp = -EINVAL, | ||
| 417 | .gpio_cd = -EINVAL, | ||
| 418 | .nonremovable = true, | ||
| 419 | }, | ||
| 420 | #endif | ||
| 384 | {} /* Terminator */ | 421 | {} /* Terminator */ |
| 385 | }; | 422 | }; |
| 386 | 423 | ||
| @@ -411,6 +448,8 @@ static struct platform_device leds_gpio = { | |||
| 411 | static int omap3evm_twl_gpio_setup(struct device *dev, | 448 | static int omap3evm_twl_gpio_setup(struct device *dev, |
| 412 | unsigned gpio, unsigned ngpio) | 449 | unsigned gpio, unsigned ngpio) |
| 413 | { | 450 | { |
| 451 | int r; | ||
| 452 | |||
| 414 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 453 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
| 415 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); | 454 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); |
| 416 | mmc[0].gpio_cd = gpio + 0; | 455 | mmc[0].gpio_cd = gpio + 0; |
| @@ -426,8 +465,12 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
| 426 | */ | 465 | */ |
| 427 | 466 | ||
| 428 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ | 467 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ |
| 429 | gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); | 468 | r = gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); |
| 430 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | 469 | if (!r) |
| 470 | r = gpio_direction_output(gpio + TWL4030_GPIO_MAX, | ||
| 471 | (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) ? 1 : 0); | ||
| 472 | if (r) | ||
| 473 | printk(KERN_ERR "failed to get/set lcd_bkl gpio\n"); | ||
| 431 | 474 | ||
| 432 | /* gpio + 7 == DVI Enable */ | 475 | /* gpio + 7 == DVI Enable */ |
| 433 | gpio_request(gpio + 7, "EN_DVI"); | 476 | gpio_request(gpio + 7, "EN_DVI"); |
| @@ -491,19 +534,15 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = { | |||
| 491 | .irq_line = 1, | 534 | .irq_line = 1, |
| 492 | }; | 535 | }; |
| 493 | 536 | ||
| 494 | static struct twl4030_codec_audio_data omap3evm_audio_data = { | 537 | static struct twl4030_codec_audio_data omap3evm_audio_data; |
| 495 | .audio_mclk = 26000000, | ||
| 496 | }; | ||
| 497 | 538 | ||
| 498 | static struct twl4030_codec_data omap3evm_codec_data = { | 539 | static struct twl4030_codec_data omap3evm_codec_data = { |
| 499 | .audio_mclk = 26000000, | 540 | .audio_mclk = 26000000, |
| 500 | .audio = &omap3evm_audio_data, | 541 | .audio = &omap3evm_audio_data, |
| 501 | }; | 542 | }; |
| 502 | 543 | ||
| 503 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { | 544 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = |
| 504 | .supply = "vdda_dac", | 545 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
| 505 | .dev = &omap3_evm_dss_device.dev, | ||
| 506 | }; | ||
| 507 | 546 | ||
| 508 | /* VDAC for DSS driving S-Video */ | 547 | /* VDAC for DSS driving S-Video */ |
| 509 | static struct regulator_init_data omap3_evm_vdac = { | 548 | static struct regulator_init_data omap3_evm_vdac = { |
| @@ -538,6 +577,66 @@ static struct regulator_init_data omap3_evm_vpll2 = { | |||
| 538 | .consumer_supplies = &omap3_evm_vpll2_supply, | 577 | .consumer_supplies = &omap3_evm_vpll2_supply, |
| 539 | }; | 578 | }; |
| 540 | 579 | ||
| 580 | /* ads7846 on SPI */ | ||
| 581 | static struct regulator_consumer_supply omap3evm_vio_supply = | ||
| 582 | REGULATOR_SUPPLY("vcc", "spi1.0"); | ||
| 583 | |||
| 584 | /* VIO for ads7846 */ | ||
| 585 | static struct regulator_init_data omap3evm_vio = { | ||
| 586 | .constraints = { | ||
| 587 | .min_uV = 1800000, | ||
| 588 | .max_uV = 1800000, | ||
| 589 | .apply_uV = true, | ||
| 590 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
| 591 | | REGULATOR_MODE_STANDBY, | ||
| 592 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
| 593 | | REGULATOR_CHANGE_STATUS, | ||
| 594 | }, | ||
| 595 | .num_consumer_supplies = 1, | ||
| 596 | .consumer_supplies = &omap3evm_vio_supply, | ||
| 597 | }; | ||
| 598 | |||
| 599 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
| 600 | |||
| 601 | #define OMAP3EVM_WLAN_PMENA_GPIO (150) | ||
| 602 | #define OMAP3EVM_WLAN_IRQ_GPIO (149) | ||
| 603 | |||
| 604 | static struct regulator_consumer_supply omap3evm_vmmc2_supply = | ||
| 605 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); | ||
| 606 | |||
| 607 | /* VMMC2 for driving the WL12xx module */ | ||
| 608 | static struct regulator_init_data omap3evm_vmmc2 = { | ||
| 609 | .constraints = { | ||
| 610 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
| 611 | }, | ||
| 612 | .num_consumer_supplies = 1, | ||
| 613 | .consumer_supplies = &omap3evm_vmmc2_supply, | ||
| 614 | }; | ||
| 615 | |||
| 616 | static struct fixed_voltage_config omap3evm_vwlan = { | ||
| 617 | .supply_name = "vwl1271", | ||
| 618 | .microvolts = 1800000, /* 1.80V */ | ||
| 619 | .gpio = OMAP3EVM_WLAN_PMENA_GPIO, | ||
| 620 | .startup_delay = 70000, /* 70ms */ | ||
| 621 | .enable_high = 1, | ||
| 622 | .enabled_at_boot = 0, | ||
| 623 | .init_data = &omap3evm_vmmc2, | ||
| 624 | }; | ||
| 625 | |||
| 626 | static struct platform_device omap3evm_wlan_regulator = { | ||
| 627 | .name = "reg-fixed-voltage", | ||
| 628 | .id = 1, | ||
| 629 | .dev = { | ||
| 630 | .platform_data = &omap3evm_vwlan, | ||
| 631 | }, | ||
| 632 | }; | ||
| 633 | |||
| 634 | struct wl12xx_platform_data omap3evm_wlan_data __initdata = { | ||
| 635 | .irq = OMAP_GPIO_IRQ(OMAP3EVM_WLAN_IRQ_GPIO), | ||
| 636 | .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */ | ||
| 637 | }; | ||
| 638 | #endif | ||
| 639 | |||
| 541 | static struct twl4030_platform_data omap3evm_twldata = { | 640 | static struct twl4030_platform_data omap3evm_twldata = { |
| 542 | .irq_base = TWL4030_IRQ_BASE, | 641 | .irq_base = TWL4030_IRQ_BASE, |
| 543 | .irq_end = TWL4030_IRQ_END, | 642 | .irq_end = TWL4030_IRQ_END, |
| @@ -550,6 +649,7 @@ static struct twl4030_platform_data omap3evm_twldata = { | |||
| 550 | .codec = &omap3evm_codec_data, | 649 | .codec = &omap3evm_codec_data, |
| 551 | .vdac = &omap3_evm_vdac, | 650 | .vdac = &omap3_evm_vdac, |
| 552 | .vpll2 = &omap3_evm_vpll2, | 651 | .vpll2 = &omap3_evm_vpll2, |
| 652 | .vio = &omap3evm_vio, | ||
| 553 | }; | 653 | }; |
| 554 | 654 | ||
| 555 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { | 655 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { |
| @@ -627,16 +727,10 @@ static struct omap_board_config_kernel omap3_evm_config[] __initdata = { | |||
| 627 | 727 | ||
| 628 | static void __init omap3_evm_init_early(void) | 728 | static void __init omap3_evm_init_early(void) |
| 629 | { | 729 | { |
| 630 | omap_board_config = omap3_evm_config; | ||
| 631 | omap_board_config_size = ARRAY_SIZE(omap3_evm_config); | ||
| 632 | omap2_init_common_infrastructure(); | 730 | omap2_init_common_infrastructure(); |
| 633 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); | 731 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); |
| 634 | } | 732 | } |
| 635 | 733 | ||
| 636 | static struct platform_device *omap3_evm_devices[] __initdata = { | ||
| 637 | &omap3_evm_dss_device, | ||
| 638 | }; | ||
| 639 | |||
| 640 | static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { | 734 | static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { |
| 641 | 735 | ||
| 642 | .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, | 736 | .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, |
| @@ -651,14 +745,76 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { | |||
| 651 | }; | 745 | }; |
| 652 | 746 | ||
| 653 | #ifdef CONFIG_OMAP_MUX | 747 | #ifdef CONFIG_OMAP_MUX |
| 654 | static struct omap_board_mux board_mux[] __initdata = { | 748 | static struct omap_board_mux omap35x_board_mux[] __initdata = { |
| 655 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | | 749 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | |
| 656 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | | 750 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | |
| 657 | OMAP_PIN_OFF_WAKEUPENABLE), | 751 | OMAP_PIN_OFF_WAKEUPENABLE), |
| 658 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | 752 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | |
| 659 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), | 753 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | |
| 754 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
| 755 | OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
| 756 | OMAP_PIN_OFF_NONE), | ||
| 757 | OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
| 758 | OMAP_PIN_OFF_NONE), | ||
| 759 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
| 760 | /* WLAN IRQ - GPIO 149 */ | ||
| 761 | OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
| 762 | |||
| 763 | /* WLAN POWER ENABLE - GPIO 150 */ | ||
| 764 | OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
| 765 | |||
| 766 | /* MMC2 SDIO pin muxes for WL12xx */ | ||
| 767 | OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 768 | OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 769 | OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 770 | OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 771 | OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 772 | OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 773 | #endif | ||
| 660 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 774 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 661 | }; | 775 | }; |
| 776 | |||
| 777 | static struct omap_board_mux omap36x_board_mux[] __initdata = { | ||
| 778 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | | ||
| 779 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | | ||
| 780 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
| 781 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
| 782 | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | | ||
| 783 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
| 784 | /* AM/DM37x EVM: DSS data bus muxed with sys_boot */ | ||
| 785 | OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 786 | OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 787 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 788 | OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 789 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 790 | OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 791 | OMAP3_MUX(SYS_BOOT0, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 792 | OMAP3_MUX(SYS_BOOT1, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 793 | OMAP3_MUX(SYS_BOOT3, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 794 | OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 795 | OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 796 | OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), | ||
| 797 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
| 798 | /* WLAN IRQ - GPIO 149 */ | ||
| 799 | OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
| 800 | |||
| 801 | /* WLAN POWER ENABLE - GPIO 150 */ | ||
| 802 | OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
| 803 | |||
| 804 | /* MMC2 SDIO pin muxes for WL12xx */ | ||
| 805 | OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 806 | OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 807 | OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 808 | OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 809 | OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 810 | OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 811 | #endif | ||
| 812 | |||
| 813 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
| 814 | }; | ||
| 815 | #else | ||
| 816 | #define omap35x_board_mux NULL | ||
| 817 | #define omap36x_board_mux NULL | ||
| 662 | #endif | 818 | #endif |
| 663 | 819 | ||
| 664 | static struct omap_musb_board_data musb_board_data = { | 820 | static struct omap_musb_board_data musb_board_data = { |
| @@ -670,11 +826,18 @@ static struct omap_musb_board_data musb_board_data = { | |||
| 670 | static void __init omap3_evm_init(void) | 826 | static void __init omap3_evm_init(void) |
| 671 | { | 827 | { |
| 672 | omap3_evm_get_revision(); | 828 | omap3_evm_get_revision(); |
| 673 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 829 | |
| 830 | if (cpu_is_omap3630()) | ||
| 831 | omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB); | ||
| 832 | else | ||
| 833 | omap3_mux_init(omap35x_board_mux, OMAP_PACKAGE_CBB); | ||
| 834 | |||
| 835 | omap_board_config = omap3_evm_config; | ||
| 836 | omap_board_config_size = ARRAY_SIZE(omap3_evm_config); | ||
| 674 | 837 | ||
| 675 | omap3_evm_i2c_init(); | 838 | omap3_evm_i2c_init(); |
| 676 | 839 | ||
| 677 | platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); | 840 | omap_display_init(&omap3_evm_dss_data); |
| 678 | 841 | ||
| 679 | spi_register_board_info(omap3evm_spi_board_info, | 842 | spi_register_board_info(omap3evm_spi_board_info, |
| 680 | ARRAY_SIZE(omap3evm_spi_board_info)); | 843 | ARRAY_SIZE(omap3evm_spi_board_info)); |
| @@ -714,6 +877,13 @@ static void __init omap3_evm_init(void) | |||
| 714 | ads7846_dev_init(); | 877 | ads7846_dev_init(); |
| 715 | omap3evm_init_smsc911x(); | 878 | omap3evm_init_smsc911x(); |
| 716 | omap3_evm_display_init(); | 879 | omap3_evm_display_init(); |
| 880 | |||
| 881 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
| 882 | /* WL12xx WLAN Init */ | ||
| 883 | if (wl12xx_set_platform_data(&omap3evm_wlan_data)) | ||
| 884 | pr_err("error setting wl12xx data\n"); | ||
| 885 | platform_device_register(&omap3evm_wlan_regulator); | ||
| 886 | #endif | ||
| 717 | } | 887 | } |
| 718 | 888 | ||
| 719 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") | 889 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index b91f74ce3a9f..5386a8190ea1 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
| @@ -253,14 +253,6 @@ static struct omap_dss_board_info pandora_dss_data = { | |||
| 253 | .default_device = &pandora_lcd_device, | 253 | .default_device = &pandora_lcd_device, |
| 254 | }; | 254 | }; |
| 255 | 255 | ||
| 256 | static struct platform_device pandora_dss_device = { | ||
| 257 | .name = "omapdss", | ||
| 258 | .id = -1, | ||
| 259 | .dev = { | ||
| 260 | .platform_data = &pandora_dss_data, | ||
| 261 | }, | ||
| 262 | }; | ||
| 263 | |||
| 264 | static void pandora_wl1251_init_card(struct mmc_card *card) | 256 | static void pandora_wl1251_init_card(struct mmc_card *card) |
| 265 | { | 257 | { |
| 266 | /* | 258 | /* |
| @@ -341,13 +333,13 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | |||
| 341 | }; | 333 | }; |
| 342 | 334 | ||
| 343 | static struct regulator_consumer_supply pandora_vmmc1_supply = | 335 | static struct regulator_consumer_supply pandora_vmmc1_supply = |
| 344 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 336 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
| 345 | 337 | ||
| 346 | static struct regulator_consumer_supply pandora_vmmc2_supply = | 338 | static struct regulator_consumer_supply pandora_vmmc2_supply = |
| 347 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 339 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
| 348 | 340 | ||
| 349 | static struct regulator_consumer_supply pandora_vmmc3_supply = | 341 | static struct regulator_consumer_supply pandora_vmmc3_supply = |
| 350 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2"); | 342 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"); |
| 351 | 343 | ||
| 352 | static struct regulator_consumer_supply pandora_vdda_dac_supply = | 344 | static struct regulator_consumer_supply pandora_vdda_dac_supply = |
| 353 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | 345 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
| @@ -524,9 +516,7 @@ static struct twl4030_usb_data omap3pandora_usb_data = { | |||
| 524 | .usb_mode = T2_USB_MODE_ULPI, | 516 | .usb_mode = T2_USB_MODE_ULPI, |
| 525 | }; | 517 | }; |
| 526 | 518 | ||
| 527 | static struct twl4030_codec_audio_data omap3pandora_audio_data = { | 519 | static struct twl4030_codec_audio_data omap3pandora_audio_data; |
| 528 | .audio_mclk = 26000000, | ||
| 529 | }; | ||
| 530 | 520 | ||
| 531 | static struct twl4030_codec_data omap3pandora_codec_data = { | 521 | static struct twl4030_codec_data omap3pandora_codec_data = { |
| 532 | .audio_mclk = 26000000, | 522 | .audio_mclk = 26000000, |
| @@ -676,7 +666,6 @@ fail: | |||
| 676 | static struct platform_device *omap3pandora_devices[] __initdata = { | 666 | static struct platform_device *omap3pandora_devices[] __initdata = { |
| 677 | &pandora_leds_gpio, | 667 | &pandora_leds_gpio, |
| 678 | &pandora_keys_gpio, | 668 | &pandora_keys_gpio, |
| 679 | &pandora_dss_device, | ||
| 680 | &pandora_vwlan_device, | 669 | &pandora_vwlan_device, |
| 681 | }; | 670 | }; |
| 682 | 671 | ||
| @@ -711,6 +700,7 @@ static void __init omap3pandora_init(void) | |||
| 711 | pandora_wl1251_init(); | 700 | pandora_wl1251_init(); |
| 712 | platform_add_devices(omap3pandora_devices, | 701 | platform_add_devices(omap3pandora_devices, |
| 713 | ARRAY_SIZE(omap3pandora_devices)); | 702 | ARRAY_SIZE(omap3pandora_devices)); |
| 703 | omap_display_init(&pandora_dss_data); | ||
| 714 | omap_serial_init(); | 704 | omap_serial_init(); |
| 715 | spi_register_board_info(omap3pandora_spi_board_info, | 705 | spi_register_board_info(omap3pandora_spi_board_info, |
| 716 | ARRAY_SIZE(omap3pandora_spi_board_info)); | 706 | ARRAY_SIZE(omap3pandora_spi_board_info)); |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index 5d1ccef69164..15ede8b49815 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
| @@ -240,14 +240,6 @@ static struct omap_dss_board_info omap3_stalker_dss_data = { | |||
| 240 | .default_device = &omap3_stalker_dvi_device, | 240 | .default_device = &omap3_stalker_dvi_device, |
| 241 | }; | 241 | }; |
| 242 | 242 | ||
| 243 | static struct platform_device omap3_stalker_dss_device = { | ||
| 244 | .name = "omapdss", | ||
| 245 | .id = -1, | ||
| 246 | .dev = { | ||
| 247 | .platform_data = &omap3_stalker_dss_data, | ||
| 248 | }, | ||
| 249 | }; | ||
| 250 | |||
| 251 | static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { | 243 | static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { |
| 252 | .supply = "vmmc", | 244 | .supply = "vmmc", |
| 253 | }; | 245 | }; |
| @@ -439,19 +431,15 @@ static struct twl4030_madc_platform_data omap3stalker_madc_data = { | |||
| 439 | .irq_line = 1, | 431 | .irq_line = 1, |
| 440 | }; | 432 | }; |
| 441 | 433 | ||
| 442 | static struct twl4030_codec_audio_data omap3stalker_audio_data = { | 434 | static struct twl4030_codec_audio_data omap3stalker_audio_data; |
| 443 | .audio_mclk = 26000000, | ||
| 444 | }; | ||
| 445 | 435 | ||
| 446 | static struct twl4030_codec_data omap3stalker_codec_data = { | 436 | static struct twl4030_codec_data omap3stalker_codec_data = { |
| 447 | .audio_mclk = 26000000, | 437 | .audio_mclk = 26000000, |
| 448 | .audio = &omap3stalker_audio_data, | 438 | .audio = &omap3stalker_audio_data, |
| 449 | }; | 439 | }; |
| 450 | 440 | ||
| 451 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = { | 441 | static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = |
| 452 | .supply = "vdda_dac", | 442 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
| 453 | .dev = &omap3_stalker_dss_device.dev, | ||
| 454 | }; | ||
| 455 | 443 | ||
| 456 | /* VDAC for DSS driving S-Video */ | 444 | /* VDAC for DSS driving S-Video */ |
| 457 | static struct regulator_init_data omap3_stalker_vdac = { | 445 | static struct regulator_init_data omap3_stalker_vdac = { |
| @@ -469,10 +457,8 @@ static struct regulator_init_data omap3_stalker_vdac = { | |||
| 469 | }; | 457 | }; |
| 470 | 458 | ||
| 471 | /* VPLL2 for digital video outputs */ | 459 | /* VPLL2 for digital video outputs */ |
| 472 | static struct regulator_consumer_supply omap3_stalker_vpll2_supply = { | 460 | static struct regulator_consumer_supply omap3_stalker_vpll2_supply = |
| 473 | .supply = "vdds_dsi", | 461 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"); |
| 474 | .dev = &omap3_stalker_lcd_device.dev, | ||
| 475 | }; | ||
| 476 | 462 | ||
| 477 | static struct regulator_init_data omap3_stalker_vpll2 = { | 463 | static struct regulator_init_data omap3_stalker_vpll2 = { |
| 478 | .constraints = { | 464 | .constraints = { |
| @@ -593,8 +579,6 @@ static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { | |||
| 593 | 579 | ||
| 594 | static void __init omap3_stalker_init_early(void) | 580 | static void __init omap3_stalker_init_early(void) |
| 595 | { | 581 | { |
| 596 | omap_board_config = omap3_stalker_config; | ||
| 597 | omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); | ||
| 598 | omap2_init_common_infrastructure(); | 582 | omap2_init_common_infrastructure(); |
| 599 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); | 583 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); |
| 600 | } | 584 | } |
| @@ -608,7 +592,6 @@ static void __init omap3_stalker_init_irq(void) | |||
| 608 | } | 592 | } |
| 609 | 593 | ||
| 610 | static struct platform_device *omap3_stalker_devices[] __initdata = { | 594 | static struct platform_device *omap3_stalker_devices[] __initdata = { |
| 611 | &omap3_stalker_dss_device, | ||
| 612 | &keys_gpio, | 595 | &keys_gpio, |
| 613 | }; | 596 | }; |
| 614 | 597 | ||
| @@ -642,12 +625,15 @@ static struct omap_musb_board_data musb_board_data = { | |||
| 642 | static void __init omap3_stalker_init(void) | 625 | static void __init omap3_stalker_init(void) |
| 643 | { | 626 | { |
| 644 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 627 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
| 628 | omap_board_config = omap3_stalker_config; | ||
| 629 | omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); | ||
| 645 | 630 | ||
| 646 | omap3_stalker_i2c_init(); | 631 | omap3_stalker_i2c_init(); |
| 647 | 632 | ||
| 648 | platform_add_devices(omap3_stalker_devices, | 633 | platform_add_devices(omap3_stalker_devices, |
| 649 | ARRAY_SIZE(omap3_stalker_devices)); | 634 | ARRAY_SIZE(omap3_stalker_devices)); |
| 650 | 635 | ||
| 636 | omap_display_init(&omap3_stalker_dss_data); | ||
| 651 | spi_register_board_info(omap3stalker_spi_board_info, | 637 | spi_register_board_info(omap3stalker_spi_board_info, |
| 652 | ARRAY_SIZE(omap3stalker_spi_board_info)); | 638 | ARRAY_SIZE(omap3stalker_spi_board_info)); |
| 653 | 639 | ||
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 6a60f79dcccb..5554f5814aa4 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
| @@ -252,9 +252,7 @@ static struct twl4030_usb_data touchbook_usb_data = { | |||
| 252 | .usb_mode = T2_USB_MODE_ULPI, | 252 | .usb_mode = T2_USB_MODE_ULPI, |
| 253 | }; | 253 | }; |
| 254 | 254 | ||
| 255 | static struct twl4030_codec_audio_data touchbook_audio_data = { | 255 | static struct twl4030_codec_audio_data touchbook_audio_data; |
| 256 | .audio_mclk = 26000000, | ||
| 257 | }; | ||
| 258 | 256 | ||
| 259 | static struct twl4030_codec_data touchbook_codec_data = { | 257 | static struct twl4030_codec_data touchbook_codec_data = { |
| 260 | .audio_mclk = 26000000, | 258 | .audio_mclk = 26000000, |
| @@ -417,9 +415,6 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
| 417 | 415 | ||
| 418 | static void __init omap3_touchbook_init_early(void) | 416 | static void __init omap3_touchbook_init_early(void) |
| 419 | { | 417 | { |
| 420 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | ||
| 421 | omap_board_config = omap3_touchbook_config; | ||
| 422 | omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); | ||
| 423 | omap2_init_common_infrastructure(); | 418 | omap2_init_common_infrastructure(); |
| 424 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 419 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
| 425 | mt46h32m32lf6_sdrc_params); | 420 | mt46h32m32lf6_sdrc_params); |
| @@ -514,6 +509,10 @@ static struct omap_musb_board_data musb_board_data = { | |||
| 514 | 509 | ||
| 515 | static void __init omap3_touchbook_init(void) | 510 | static void __init omap3_touchbook_init(void) |
| 516 | { | 511 | { |
| 512 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | ||
| 513 | omap_board_config = omap3_touchbook_config; | ||
| 514 | omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); | ||
| 515 | |||
| 517 | pm_power_off = omap3_touchbook_poweroff; | 516 | pm_power_off = omap3_touchbook_poweroff; |
| 518 | 517 | ||
| 519 | omap3_touchbook_i2c_init(); | 518 | omap3_touchbook_i2c_init(); |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index fca5b9e80c18..a94ce07be72f 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
| @@ -26,6 +26,8 @@ | |||
| 26 | #include <linux/usb/otg.h> | 26 | #include <linux/usb/otg.h> |
| 27 | #include <linux/i2c/twl.h> | 27 | #include <linux/i2c/twl.h> |
| 28 | #include <linux/regulator/machine.h> | 28 | #include <linux/regulator/machine.h> |
| 29 | #include <linux/regulator/fixed.h> | ||
| 30 | #include <linux/wl12xx.h> | ||
| 29 | 31 | ||
| 30 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
| 31 | #include <mach/omap4-common.h> | 33 | #include <mach/omap4-common.h> |
| @@ -45,6 +47,18 @@ | |||
| 45 | 47 | ||
| 46 | #define GPIO_HUB_POWER 1 | 48 | #define GPIO_HUB_POWER 1 |
| 47 | #define GPIO_HUB_NRESET 62 | 49 | #define GPIO_HUB_NRESET 62 |
| 50 | #define GPIO_WIFI_PMENA 43 | ||
| 51 | #define GPIO_WIFI_IRQ 53 | ||
| 52 | |||
| 53 | /* wl127x BT, FM, GPS connectivity chip */ | ||
| 54 | static int wl1271_gpios[] = {46, -1, -1}; | ||
| 55 | static struct platform_device wl1271_device = { | ||
| 56 | .name = "kim", | ||
| 57 | .id = -1, | ||
| 58 | .dev = { | ||
| 59 | .platform_data = &wl1271_gpios, | ||
| 60 | }, | ||
| 61 | }; | ||
| 48 | 62 | ||
| 49 | static struct gpio_led gpio_leds[] = { | 63 | static struct gpio_led gpio_leds[] = { |
| 50 | { | 64 | { |
| @@ -74,6 +88,7 @@ static struct platform_device leds_gpio = { | |||
| 74 | 88 | ||
| 75 | static struct platform_device *panda_devices[] __initdata = { | 89 | static struct platform_device *panda_devices[] __initdata = { |
| 76 | &leds_gpio, | 90 | &leds_gpio, |
| 91 | &wl1271_device, | ||
| 77 | }; | 92 | }; |
| 78 | 93 | ||
| 79 | static void __init omap4_panda_init_early(void) | 94 | static void __init omap4_panda_init_early(void) |
| @@ -161,16 +176,62 @@ static struct omap2_hsmmc_info mmc[] = { | |||
| 161 | .gpio_wp = -EINVAL, | 176 | .gpio_wp = -EINVAL, |
| 162 | .gpio_cd = -EINVAL, | 177 | .gpio_cd = -EINVAL, |
| 163 | }, | 178 | }, |
| 179 | { | ||
| 180 | .name = "wl1271", | ||
| 181 | .mmc = 5, | ||
| 182 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, | ||
| 183 | .gpio_wp = -EINVAL, | ||
| 184 | .gpio_cd = -EINVAL, | ||
| 185 | .ocr_mask = MMC_VDD_165_195, | ||
| 186 | .nonremovable = true, | ||
| 187 | }, | ||
| 164 | {} /* Terminator */ | 188 | {} /* Terminator */ |
| 165 | }; | 189 | }; |
| 166 | 190 | ||
| 167 | static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { | 191 | static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { |
| 168 | { | 192 | { |
| 169 | .supply = "vmmc", | 193 | .supply = "vmmc", |
| 170 | .dev_name = "mmci-omap-hs.0", | 194 | .dev_name = "omap_hsmmc.0", |
| 195 | }, | ||
| 196 | }; | ||
| 197 | |||
| 198 | static struct regulator_consumer_supply omap4_panda_vmmc5_supply = { | ||
| 199 | .supply = "vmmc", | ||
| 200 | .dev_name = "omap_hsmmc.4", | ||
| 201 | }; | ||
| 202 | |||
| 203 | static struct regulator_init_data panda_vmmc5 = { | ||
| 204 | .constraints = { | ||
| 205 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
| 206 | }, | ||
| 207 | .num_consumer_supplies = 1, | ||
| 208 | .consumer_supplies = &omap4_panda_vmmc5_supply, | ||
| 209 | }; | ||
| 210 | |||
| 211 | static struct fixed_voltage_config panda_vwlan = { | ||
| 212 | .supply_name = "vwl1271", | ||
| 213 | .microvolts = 1800000, /* 1.8V */ | ||
| 214 | .gpio = GPIO_WIFI_PMENA, | ||
| 215 | .startup_delay = 70000, /* 70msec */ | ||
| 216 | .enable_high = 1, | ||
| 217 | .enabled_at_boot = 0, | ||
| 218 | .init_data = &panda_vmmc5, | ||
| 219 | }; | ||
| 220 | |||
| 221 | static struct platform_device omap_vwlan_device = { | ||
| 222 | .name = "reg-fixed-voltage", | ||
| 223 | .id = 1, | ||
| 224 | .dev = { | ||
| 225 | .platform_data = &panda_vwlan, | ||
| 171 | }, | 226 | }, |
| 172 | }; | 227 | }; |
| 173 | 228 | ||
| 229 | struct wl12xx_platform_data omap_panda_wlan_data __initdata = { | ||
| 230 | .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ), | ||
| 231 | /* PANDA ref clock is 38.4 MHz */ | ||
| 232 | .board_ref_clock = 2, | ||
| 233 | }; | ||
| 234 | |||
| 174 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | 235 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) |
| 175 | { | 236 | { |
| 176 | int ret = 0; | 237 | int ret = 0; |
| @@ -304,7 +365,6 @@ static struct regulator_init_data omap4_panda_vana = { | |||
| 304 | .constraints = { | 365 | .constraints = { |
| 305 | .min_uV = 2100000, | 366 | .min_uV = 2100000, |
| 306 | .max_uV = 2100000, | 367 | .max_uV = 2100000, |
| 307 | .apply_uV = true, | ||
| 308 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 368 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 309 | | REGULATOR_MODE_STANDBY, | 369 | | REGULATOR_MODE_STANDBY, |
| 310 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 370 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| @@ -316,7 +376,6 @@ static struct regulator_init_data omap4_panda_vcxio = { | |||
| 316 | .constraints = { | 376 | .constraints = { |
| 317 | .min_uV = 1800000, | 377 | .min_uV = 1800000, |
| 318 | .max_uV = 1800000, | 378 | .max_uV = 1800000, |
| 319 | .apply_uV = true, | ||
| 320 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 379 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 321 | | REGULATOR_MODE_STANDBY, | 380 | | REGULATOR_MODE_STANDBY, |
| 322 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 381 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| @@ -328,7 +387,6 @@ static struct regulator_init_data omap4_panda_vdac = { | |||
| 328 | .constraints = { | 387 | .constraints = { |
| 329 | .min_uV = 1800000, | 388 | .min_uV = 1800000, |
| 330 | .max_uV = 1800000, | 389 | .max_uV = 1800000, |
| 331 | .apply_uV = true, | ||
| 332 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 390 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
| 333 | | REGULATOR_MODE_STANDBY, | 391 | | REGULATOR_MODE_STANDBY, |
| 334 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 392 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
| @@ -390,6 +448,19 @@ static int __init omap4_panda_i2c_init(void) | |||
| 390 | 448 | ||
| 391 | #ifdef CONFIG_OMAP_MUX | 449 | #ifdef CONFIG_OMAP_MUX |
| 392 | static struct omap_board_mux board_mux[] __initdata = { | 450 | static struct omap_board_mux board_mux[] __initdata = { |
| 451 | /* WLAN IRQ - GPIO 53 */ | ||
| 452 | OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT), | ||
| 453 | /* WLAN POWER ENABLE - GPIO 43 */ | ||
| 454 | OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT), | ||
| 455 | /* WLAN SDIO: MMC5 CMD */ | ||
| 456 | OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 457 | /* WLAN SDIO: MMC5 CLK */ | ||
| 458 | OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 459 | /* WLAN SDIO: MMC5 DAT[0-3] */ | ||
| 460 | OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 461 | OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 462 | OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 463 | OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), | ||
| 393 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 464 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 394 | }; | 465 | }; |
| 395 | #else | 466 | #else |
| @@ -404,8 +475,12 @@ static void __init omap4_panda_init(void) | |||
| 404 | package = OMAP_PACKAGE_CBL; | 475 | package = OMAP_PACKAGE_CBL; |
| 405 | omap4_mux_init(board_mux, package); | 476 | omap4_mux_init(board_mux, package); |
| 406 | 477 | ||
| 478 | if (wl12xx_set_platform_data(&omap_panda_wlan_data)) | ||
| 479 | pr_err("error setting wl12xx data\n"); | ||
| 480 | |||
| 407 | omap4_panda_i2c_init(); | 481 | omap4_panda_i2c_init(); |
| 408 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); | 482 | platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); |
| 483 | platform_device_register(&omap_vwlan_device); | ||
| 409 | omap_serial_init(); | 484 | omap_serial_init(); |
| 410 | omap4_twl6030_hsmmc_init(mmc); | 485 | omap4_twl6030_hsmmc_init(mmc); |
| 411 | omap4_ehci_init(); | 486 | omap4_ehci_init(); |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index a33ec0edec13..60f8db31763c 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
| @@ -358,9 +358,7 @@ static struct regulator_init_data overo_vmmc1 = { | |||
| 358 | .consumer_supplies = &overo_vmmc1_supply, | 358 | .consumer_supplies = &overo_vmmc1_supply, |
| 359 | }; | 359 | }; |
| 360 | 360 | ||
| 361 | static struct twl4030_codec_audio_data overo_audio_data = { | 361 | static struct twl4030_codec_audio_data overo_audio_data; |
| 362 | .audio_mclk = 26000000, | ||
| 363 | }; | ||
| 364 | 362 | ||
| 365 | static struct twl4030_codec_data overo_codec_data = { | 363 | static struct twl4030_codec_data overo_codec_data = { |
| 366 | .audio_mclk = 26000000, | 364 | .audio_mclk = 26000000, |
| @@ -411,8 +409,6 @@ static struct omap_board_config_kernel overo_config[] __initdata = { | |||
| 411 | 409 | ||
| 412 | static void __init overo_init_early(void) | 410 | static void __init overo_init_early(void) |
| 413 | { | 411 | { |
| 414 | omap_board_config = overo_config; | ||
| 415 | omap_board_config_size = ARRAY_SIZE(overo_config); | ||
| 416 | omap2_init_common_infrastructure(); | 412 | omap2_init_common_infrastructure(); |
| 417 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, | 413 | omap2_init_common_devices(mt46h32m32lf6_sdrc_params, |
| 418 | mt46h32m32lf6_sdrc_params); | 414 | mt46h32m32lf6_sdrc_params); |
| @@ -448,6 +444,8 @@ static struct omap_musb_board_data musb_board_data = { | |||
| 448 | static void __init overo_init(void) | 444 | static void __init overo_init(void) |
| 449 | { | 445 | { |
| 450 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 446 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 447 | omap_board_config = overo_config; | ||
| 448 | omap_board_config_size = ARRAY_SIZE(overo_config); | ||
| 451 | overo_i2c_init(); | 449 | overo_i2c_init(); |
| 452 | platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); | 450 | platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); |
| 453 | omap_serial_init(); | 451 | omap_serial_init(); |
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c index bdebcb7328e6..2af8b05e786d 100644 --- a/arch/arm/mach-omap2/board-rm680.c +++ b/arch/arm/mach-omap2/board-rm680.c | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | #include "sdram-nokia.h" | 33 | #include "sdram-nokia.h" |
| 34 | 34 | ||
| 35 | static struct regulator_consumer_supply rm680_vemmc_consumers[] = { | 35 | static struct regulator_consumer_supply rm680_vemmc_consumers[] = { |
| 36 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), | 36 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | /* Fixed regulator for internal eMMC */ | 39 | /* Fixed regulator for internal eMMC */ |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index e75e240cad67..5f1900c532ec 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
| @@ -36,6 +36,8 @@ | |||
| 36 | 36 | ||
| 37 | #include <sound/tlv320aic3x.h> | 37 | #include <sound/tlv320aic3x.h> |
| 38 | #include <sound/tpa6130a2-plat.h> | 38 | #include <sound/tpa6130a2-plat.h> |
| 39 | #include <media/radio-si4713.h> | ||
| 40 | #include <media/si4713.h> | ||
| 39 | 41 | ||
| 40 | #include <../drivers/staging/iio/light/tsl2563.h> | 42 | #include <../drivers/staging/iio/light/tsl2563.h> |
| 41 | 43 | ||
| @@ -47,6 +49,8 @@ | |||
| 47 | 49 | ||
| 48 | #define RX51_WL1251_POWER_GPIO 87 | 50 | #define RX51_WL1251_POWER_GPIO 87 |
| 49 | #define RX51_WL1251_IRQ_GPIO 42 | 51 | #define RX51_WL1251_IRQ_GPIO 42 |
| 52 | #define RX51_FMTX_RESET_GPIO 163 | ||
| 53 | #define RX51_FMTX_IRQ 53 | ||
| 50 | 54 | ||
| 51 | /* list all spi devices here */ | 55 | /* list all spi devices here */ |
| 52 | enum { | 56 | enum { |
| @@ -331,13 +335,13 @@ static struct omap2_hsmmc_info mmc[] __initdata = { | |||
| 331 | }; | 335 | }; |
| 332 | 336 | ||
| 333 | static struct regulator_consumer_supply rx51_vmmc1_supply = | 337 | static struct regulator_consumer_supply rx51_vmmc1_supply = |
| 334 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | 338 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); |
| 335 | 339 | ||
| 336 | static struct regulator_consumer_supply rx51_vaux3_supply = | 340 | static struct regulator_consumer_supply rx51_vaux3_supply = |
| 337 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | 341 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); |
| 338 | 342 | ||
| 339 | static struct regulator_consumer_supply rx51_vsim_supply = | 343 | static struct regulator_consumer_supply rx51_vsim_supply = |
| 340 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); | 344 | REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); |
| 341 | 345 | ||
| 342 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { | 346 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { |
| 343 | /* tlv320aic3x analog supplies */ | 347 | /* tlv320aic3x analog supplies */ |
| @@ -348,7 +352,7 @@ static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { | |||
| 348 | /* tpa6130a2 */ | 352 | /* tpa6130a2 */ |
| 349 | REGULATOR_SUPPLY("Vdd", "2-0060"), | 353 | REGULATOR_SUPPLY("Vdd", "2-0060"), |
| 350 | /* Keep vmmc as last item. It is not iterated for newer boards */ | 354 | /* Keep vmmc as last item. It is not iterated for newer boards */ |
| 351 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), | 355 | REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), |
| 352 | }; | 356 | }; |
| 353 | 357 | ||
| 354 | static struct regulator_consumer_supply rx51_vio_supplies[] = { | 358 | static struct regulator_consumer_supply rx51_vio_supplies[] = { |
| @@ -357,10 +361,14 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = { | |||
| 357 | REGULATOR_SUPPLY("DVDD", "2-0018"), | 361 | REGULATOR_SUPPLY("DVDD", "2-0018"), |
| 358 | REGULATOR_SUPPLY("IOVDD", "2-0019"), | 362 | REGULATOR_SUPPLY("IOVDD", "2-0019"), |
| 359 | REGULATOR_SUPPLY("DVDD", "2-0019"), | 363 | REGULATOR_SUPPLY("DVDD", "2-0019"), |
| 364 | /* Si4713 IO supply */ | ||
| 365 | REGULATOR_SUPPLY("vio", "2-0063"), | ||
| 360 | }; | 366 | }; |
| 361 | 367 | ||
| 362 | static struct regulator_consumer_supply rx51_vaux1_consumers[] = { | 368 | static struct regulator_consumer_supply rx51_vaux1_consumers[] = { |
| 363 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), | 369 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), |
| 370 | /* Si4713 supply */ | ||
| 371 | REGULATOR_SUPPLY("vdd", "2-0063"), | ||
| 364 | }; | 372 | }; |
| 365 | 373 | ||
| 366 | static struct regulator_consumer_supply rx51_vdac_supply[] = { | 374 | static struct regulator_consumer_supply rx51_vdac_supply[] = { |
| @@ -511,6 +519,41 @@ static struct regulator_init_data rx51_vio = { | |||
| 511 | .consumer_supplies = rx51_vio_supplies, | 519 | .consumer_supplies = rx51_vio_supplies, |
| 512 | }; | 520 | }; |
| 513 | 521 | ||
| 522 | static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = { | ||
| 523 | .gpio_reset = RX51_FMTX_RESET_GPIO, | ||
| 524 | }; | ||
| 525 | |||
| 526 | static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = { | ||
| 527 | I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH), | ||
| 528 | .platform_data = &rx51_si4713_i2c_data, | ||
| 529 | }; | ||
| 530 | |||
| 531 | static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = { | ||
| 532 | .i2c_bus = 2, | ||
| 533 | .subdev_board_info = &rx51_si4713_board_info, | ||
| 534 | }; | ||
| 535 | |||
| 536 | static struct platform_device rx51_si4713_dev __initdata_or_module = { | ||
| 537 | .name = "radio-si4713", | ||
| 538 | .id = -1, | ||
| 539 | .dev = { | ||
| 540 | .platform_data = &rx51_si4713_data, | ||
| 541 | }, | ||
| 542 | }; | ||
| 543 | |||
| 544 | static __init void rx51_init_si4713(void) | ||
| 545 | { | ||
| 546 | int err; | ||
| 547 | |||
| 548 | err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq"); | ||
| 549 | if (err) { | ||
| 550 | printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err); | ||
| 551 | return; | ||
| 552 | } | ||
| 553 | rx51_si4713_board_info.irq = gpio_to_irq(RX51_FMTX_IRQ); | ||
| 554 | platform_device_register(&rx51_si4713_dev); | ||
| 555 | } | ||
| 556 | |||
| 514 | static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) | 557 | static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) |
| 515 | { | 558 | { |
| 516 | /* FIXME this gpio setup is just a placeholder for now */ | 559 | /* FIXME this gpio setup is just a placeholder for now */ |
| @@ -699,6 +742,14 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = { | |||
| 699 | .resource_config = twl4030_rconfig, | 742 | .resource_config = twl4030_rconfig, |
| 700 | }; | 743 | }; |
| 701 | 744 | ||
| 745 | struct twl4030_codec_vibra_data rx51_vibra_data __initdata = { | ||
| 746 | .coexist = 0, | ||
| 747 | }; | ||
| 748 | |||
| 749 | struct twl4030_codec_data rx51_codec_data __initdata = { | ||
| 750 | .audio_mclk = 26000000, | ||
| 751 | .vibra = &rx51_vibra_data, | ||
| 752 | }; | ||
| 702 | 753 | ||
| 703 | static struct twl4030_platform_data rx51_twldata __initdata = { | 754 | static struct twl4030_platform_data rx51_twldata __initdata = { |
| 704 | .irq_base = TWL4030_IRQ_BASE, | 755 | .irq_base = TWL4030_IRQ_BASE, |
| @@ -710,6 +761,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = { | |||
| 710 | .madc = &rx51_madc_data, | 761 | .madc = &rx51_madc_data, |
| 711 | .usb = &rx51_usb_data, | 762 | .usb = &rx51_usb_data, |
| 712 | .power = &rx51_t2scripts_data, | 763 | .power = &rx51_t2scripts_data, |
| 764 | .codec = &rx51_codec_data, | ||
| 713 | 765 | ||
| 714 | .vaux1 = &rx51_vaux1, | 766 | .vaux1 = &rx51_vaux1, |
| 715 | .vaux2 = &rx51_vaux2, | 767 | .vaux2 = &rx51_vaux2, |
| @@ -921,6 +973,7 @@ void __init rx51_peripherals_init(void) | |||
| 921 | board_smc91x_init(); | 973 | board_smc91x_init(); |
| 922 | rx51_add_gpio_keys(); | 974 | rx51_add_gpio_keys(); |
| 923 | rx51_init_wl1251(); | 975 | rx51_init_wl1251(); |
| 976 | rx51_init_si4713(); | ||
| 924 | spi_register_board_info(rx51_peripherals_spi_board_info, | 977 | spi_register_board_info(rx51_peripherals_spi_board_info, |
| 925 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); | 978 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); |
| 926 | 979 | ||
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c index acd670054d9a..89a66db8b77d 100644 --- a/arch/arm/mach-omap2/board-rx51-video.c +++ b/arch/arm/mach-omap2/board-rx51-video.c | |||
| @@ -66,18 +66,6 @@ static struct omap_dss_board_info rx51_dss_board_info = { | |||
| 66 | .default_device = &rx51_lcd_device, | 66 | .default_device = &rx51_lcd_device, |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | struct platform_device rx51_display_device = { | ||
| 70 | .name = "omapdss", | ||
| 71 | .id = -1, | ||
| 72 | .dev = { | ||
| 73 | .platform_data = &rx51_dss_board_info, | ||
| 74 | }, | ||
| 75 | }; | ||
| 76 | |||
| 77 | static struct platform_device *rx51_video_devices[] __initdata = { | ||
| 78 | &rx51_display_device, | ||
| 79 | }; | ||
| 80 | |||
| 81 | static int __init rx51_video_init(void) | 69 | static int __init rx51_video_init(void) |
| 82 | { | 70 | { |
| 83 | if (!machine_is_nokia_rx51()) | 71 | if (!machine_is_nokia_rx51()) |
| @@ -95,8 +83,7 @@ static int __init rx51_video_init(void) | |||
| 95 | 83 | ||
| 96 | gpio_direction_output(RX51_LCD_RESET_GPIO, 1); | 84 | gpio_direction_output(RX51_LCD_RESET_GPIO, 1); |
| 97 | 85 | ||
| 98 | platform_add_devices(rx51_video_devices, | 86 | omap_display_init(&rx51_dss_board_info); |
| 99 | ARRAY_SIZE(rx51_video_devices)); | ||
| 100 | return 0; | 87 | return 0; |
| 101 | } | 88 | } |
| 102 | 89 | ||
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 3cf72fe6d75b..e964895b80e8 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
| @@ -102,9 +102,6 @@ static void __init rx51_init_early(void) | |||
| 102 | { | 102 | { |
| 103 | struct omap_sdrc_params *sdrc_params; | 103 | struct omap_sdrc_params *sdrc_params; |
| 104 | 104 | ||
| 105 | omap_board_config = rx51_config; | ||
| 106 | omap_board_config_size = ARRAY_SIZE(rx51_config); | ||
| 107 | omap3_pm_init_cpuidle(rx51_cpuidle_params); | ||
| 108 | omap2_init_common_infrastructure(); | 105 | omap2_init_common_infrastructure(); |
| 109 | sdrc_params = nokia_get_sdram_timings(); | 106 | sdrc_params = nokia_get_sdram_timings(); |
| 110 | omap2_init_common_devices(sdrc_params, sdrc_params); | 107 | omap2_init_common_devices(sdrc_params, sdrc_params); |
| @@ -127,6 +124,9 @@ static struct omap_musb_board_data musb_board_data = { | |||
| 127 | static void __init rx51_init(void) | 124 | static void __init rx51_init(void) |
| 128 | { | 125 | { |
| 129 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 126 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 127 | omap_board_config = rx51_config; | ||
| 128 | omap_board_config_size = ARRAY_SIZE(rx51_config); | ||
| 129 | omap3_pm_init_cpuidle(rx51_cpuidle_params); | ||
| 130 | omap_serial_init(); | 130 | omap_serial_init(); |
| 131 | usb_musb_init(&musb_board_data); | 131 | usb_musb_init(&musb_board_data); |
| 132 | rx51_peripherals_init(); | 132 | rx51_peripherals_init(); |
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c index f2b097190e07..09fa7bfff8d6 100644 --- a/arch/arm/mach-omap2/board-ti8168evm.c +++ b/arch/arm/mach-omap2/board-ti8168evm.c | |||
| @@ -29,8 +29,6 @@ static struct omap_board_config_kernel ti8168_evm_config[] __initdata = { | |||
| 29 | 29 | ||
| 30 | static void __init ti8168_init_early(void) | 30 | static void __init ti8168_init_early(void) |
| 31 | { | 31 | { |
| 32 | omap_board_config = ti8168_evm_config; | ||
| 33 | omap_board_config_size = ARRAY_SIZE(ti8168_evm_config); | ||
| 34 | omap2_init_common_infrastructure(); | 32 | omap2_init_common_infrastructure(); |
| 35 | omap2_init_common_devices(NULL, NULL); | 33 | omap2_init_common_devices(NULL, NULL); |
| 36 | } | 34 | } |
| @@ -43,6 +41,8 @@ static void __init ti8168_evm_init_irq(void) | |||
| 43 | static void __init ti8168_evm_init(void) | 41 | static void __init ti8168_evm_init(void) |
| 44 | { | 42 | { |
| 45 | omap_serial_init(); | 43 | omap_serial_init(); |
| 44 | omap_board_config = ti8168_evm_config; | ||
| 45 | omap_board_config_size = ARRAY_SIZE(ti8168_evm_config); | ||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | static void __init ti8168_evm_map_io(void) | 48 | static void __init ti8168_evm_map_io(void) |
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c index 6bcd43657aed..37b84c2b850f 100644 --- a/arch/arm/mach-omap2/board-zoom-display.c +++ b/arch/arm/mach-omap2/board-zoom-display.c | |||
| @@ -130,14 +130,6 @@ static struct omap_dss_board_info zoom_dss_data = { | |||
| 130 | .default_device = &zoom_lcd_device, | 130 | .default_device = &zoom_lcd_device, |
| 131 | }; | 131 | }; |
| 132 | 132 | ||
| 133 | static struct platform_device zoom_dss_device = { | ||
| 134 | .name = "omapdss", | ||
| 135 | .id = -1, | ||
| 136 | .dev = { | ||
| 137 | .platform_data = &zoom_dss_data, | ||
| 138 | }, | ||
| 139 | }; | ||
| 140 | |||
| 141 | static struct omap2_mcspi_device_config dss_lcd_mcspi_config = { | 133 | static struct omap2_mcspi_device_config dss_lcd_mcspi_config = { |
| 142 | .turbo_mode = 1, | 134 | .turbo_mode = 1, |
| 143 | .single_channel = 1, /* 0: slave, 1: master */ | 135 | .single_channel = 1, /* 0: slave, 1: master */ |
| @@ -153,14 +145,9 @@ static struct spi_board_info nec_8048_spi_board_info[] __initdata = { | |||
| 153 | }, | 145 | }, |
| 154 | }; | 146 | }; |
| 155 | 147 | ||
| 156 | static struct platform_device *zoom_display_devices[] __initdata = { | ||
| 157 | &zoom_dss_device, | ||
| 158 | }; | ||
| 159 | |||
| 160 | void __init zoom_display_init(void) | 148 | void __init zoom_display_init(void) |
| 161 | { | 149 | { |
| 162 | platform_add_devices(zoom_display_devices, | 150 | omap_display_init(&zoom_dss_data); |
| 163 | ARRAY_SIZE(zoom_display_devices)); | ||
| 164 | spi_register_board_info(nec_8048_spi_board_info, | 151 | spi_register_board_info(nec_8048_spi_board_info, |
| 165 | ARRAY_SIZE(nec_8048_spi_board_info)); | 152 | ARRAY_SIZE(nec_8048_spi_board_info)); |
| 166 | zoom_lcd_panel_init(); | 153 | zoom_lcd_panel_init(); |
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index e0e040f34c68..448ab60195d5 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
| @@ -118,7 +118,7 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = { | |||
| 118 | 118 | ||
| 119 | static struct regulator_consumer_supply zoom_vmmc3_supply = { | 119 | static struct regulator_consumer_supply zoom_vmmc3_supply = { |
| 120 | .supply = "vmmc", | 120 | .supply = "vmmc", |
| 121 | .dev_name = "mmci-omap-hs.2", | 121 | .dev_name = "omap_hsmmc.2", |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 124 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
| @@ -322,9 +322,7 @@ static struct twl4030_madc_platform_data zoom_madc_data = { | |||
| 322 | .irq_line = 1, | 322 | .irq_line = 1, |
| 323 | }; | 323 | }; |
| 324 | 324 | ||
| 325 | static struct twl4030_codec_audio_data zoom_audio_data = { | 325 | static struct twl4030_codec_audio_data zoom_audio_data; |
| 326 | .audio_mclk = 26000000, | ||
| 327 | }; | ||
| 328 | 326 | ||
| 329 | static struct twl4030_codec_data zoom_codec_data = { | 327 | static struct twl4030_codec_data zoom_codec_data = { |
| 330 | .audio_mclk = 26000000, | 328 | .audio_mclk = 26000000, |
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c index 85d4170f30ab..7e3f1595d77b 100644 --- a/arch/arm/mach-omap2/board-zoom.c +++ b/arch/arm/mach-omap2/board-zoom.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
| 17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
| 18 | #include <linux/i2c/twl.h> | 18 | #include <linux/i2c/twl.h> |
| 19 | #include <linux/mtd/nand.h> | ||
| 19 | 20 | ||
| 20 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
| 21 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
| @@ -124,8 +125,8 @@ static void __init omap_zoom_init(void) | |||
| 124 | usb_ehci_init(&ehci_pdata); | 125 | usb_ehci_init(&ehci_pdata); |
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | board_nand_init(zoom_nand_partitions, | 128 | board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions), |
| 128 | ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); | 129 | ZOOM_NAND_CS, NAND_BUSWIDTH_16); |
| 129 | zoom_debugboard_init(); | 130 | zoom_debugboard_init(); |
| 130 | zoom_peripherals_init(); | 131 | zoom_peripherals_init(); |
| 131 | zoom_display_init(); | 132 | zoom_display_init(); |
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c index f51cffd1fc53..b19a1f7234ae 100644 --- a/arch/arm/mach-omap2/clkt2xxx_apll.c +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c | |||
| @@ -78,6 +78,26 @@ static int omap2_clk_apll54_enable(struct clk *clk) | |||
| 78 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK); | 78 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static void _apll96_allow_idle(struct clk *clk) | ||
| 82 | { | ||
| 83 | omap2xxx_cm_set_apll96_auto_low_power_stop(); | ||
| 84 | } | ||
| 85 | |||
| 86 | static void _apll96_deny_idle(struct clk *clk) | ||
| 87 | { | ||
| 88 | omap2xxx_cm_set_apll96_disable_autoidle(); | ||
| 89 | } | ||
| 90 | |||
| 91 | static void _apll54_allow_idle(struct clk *clk) | ||
| 92 | { | ||
| 93 | omap2xxx_cm_set_apll54_auto_low_power_stop(); | ||
| 94 | } | ||
| 95 | |||
| 96 | static void _apll54_deny_idle(struct clk *clk) | ||
| 97 | { | ||
| 98 | omap2xxx_cm_set_apll54_disable_autoidle(); | ||
| 99 | } | ||
| 100 | |||
| 81 | /* Stop APLL */ | 101 | /* Stop APLL */ |
| 82 | static void omap2_clk_apll_disable(struct clk *clk) | 102 | static void omap2_clk_apll_disable(struct clk *clk) |
| 83 | { | 103 | { |
| @@ -93,11 +113,15 @@ static void omap2_clk_apll_disable(struct clk *clk) | |||
| 93 | const struct clkops clkops_apll96 = { | 113 | const struct clkops clkops_apll96 = { |
| 94 | .enable = omap2_clk_apll96_enable, | 114 | .enable = omap2_clk_apll96_enable, |
| 95 | .disable = omap2_clk_apll_disable, | 115 | .disable = omap2_clk_apll_disable, |
| 116 | .allow_idle = _apll96_allow_idle, | ||
| 117 | .deny_idle = _apll96_deny_idle, | ||
| 96 | }; | 118 | }; |
| 97 | 119 | ||
| 98 | const struct clkops clkops_apll54 = { | 120 | const struct clkops clkops_apll54 = { |
| 99 | .enable = omap2_clk_apll54_enable, | 121 | .enable = omap2_clk_apll54_enable, |
| 100 | .disable = omap2_clk_apll_disable, | 122 | .disable = omap2_clk_apll_disable, |
| 123 | .allow_idle = _apll54_allow_idle, | ||
| 124 | .deny_idle = _apll54_deny_idle, | ||
| 101 | }; | 125 | }; |
| 102 | 126 | ||
| 103 | /* Public functions */ | 127 | /* Public functions */ |
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpll.c b/arch/arm/mach-omap2/clkt2xxx_dpll.c new file mode 100644 index 000000000000..1502a7bc20bb --- /dev/null +++ b/arch/arm/mach-omap2/clkt2xxx_dpll.c | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * OMAP2-specific DPLL control functions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Nokia Corporation | ||
| 5 | * Paul Walmsley | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/errno.h> | ||
| 14 | #include <linux/clk.h> | ||
| 15 | #include <linux/io.h> | ||
| 16 | |||
| 17 | #include <plat/clock.h> | ||
| 18 | |||
| 19 | #include "clock.h" | ||
| 20 | #include "cm2xxx_3xxx.h" | ||
| 21 | #include "cm-regbits-24xx.h" | ||
| 22 | |||
| 23 | /* Private functions */ | ||
| 24 | |||
| 25 | /** | ||
| 26 | * _allow_idle - enable DPLL autoidle bits | ||
| 27 | * @clk: struct clk * of the DPLL to operate on | ||
| 28 | * | ||
| 29 | * Enable DPLL automatic idle control. The DPLL will enter low-power | ||
| 30 | * stop when its downstream clocks are gated. No return value. | ||
| 31 | * REVISIT: DPLL can optionally enter low-power bypass by writing 0x1 | ||
| 32 | * instead. Add some mechanism to optionally enter this mode. | ||
| 33 | */ | ||
| 34 | static void _allow_idle(struct clk *clk) | ||
| 35 | { | ||
| 36 | if (!clk || !clk->dpll_data) | ||
| 37 | return; | ||
| 38 | |||
| 39 | omap2xxx_cm_set_dpll_auto_low_power_stop(); | ||
| 40 | } | ||
| 41 | |||
| 42 | /** | ||
| 43 | * _deny_idle - prevent DPLL from automatically idling | ||
| 44 | * @clk: struct clk * of the DPLL to operate on | ||
| 45 | * | ||
| 46 | * Disable DPLL automatic idle control. No return value. | ||
| 47 | */ | ||
| 48 | static void _deny_idle(struct clk *clk) | ||
| 49 | { | ||
| 50 | if (!clk || !clk->dpll_data) | ||
| 51 | return; | ||
| 52 | |||
| 53 | omap2xxx_cm_set_dpll_disable_autoidle(); | ||
| 54 | } | ||
| 55 | |||
| 56 | |||
| 57 | /* Public data */ | ||
| 58 | |||
| 59 | const struct clkops clkops_omap2xxx_dpll_ops = { | ||
| 60 | .allow_idle = _allow_idle, | ||
| 61 | .deny_idle = _deny_idle, | ||
| 62 | }; | ||
| 63 | |||
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c index df7b80506483..c3460928b5e0 100644 --- a/arch/arm/mach-omap2/clkt2xxx_osc.c +++ b/arch/arm/mach-omap2/clkt2xxx_osc.c | |||
| @@ -30,6 +30,13 @@ | |||
| 30 | #include "prm2xxx_3xxx.h" | 30 | #include "prm2xxx_3xxx.h" |
| 31 | #include "prm-regbits-24xx.h" | 31 | #include "prm-regbits-24xx.h" |
| 32 | 32 | ||
| 33 | /* | ||
| 34 | * XXX This does not actually enable the osc_ck, since the osc_ck must | ||
| 35 | * be running for this function to be called. Instead, this function | ||
| 36 | * is used to disable an autoidle mode on the osc_ck. The existing | ||
| 37 | * clk_enable/clk_disable()-based usecounting for osc_ck should be | ||
| 38 | * replaced with autoidle-based usecounting. | ||
| 39 | */ | ||
| 33 | static int omap2_enable_osc_ck(struct clk *clk) | 40 | static int omap2_enable_osc_ck(struct clk *clk) |
| 34 | { | 41 | { |
| 35 | u32 pcc; | 42 | u32 pcc; |
| @@ -41,6 +48,13 @@ static int omap2_enable_osc_ck(struct clk *clk) | |||
| 41 | return 0; | 48 | return 0; |
| 42 | } | 49 | } |
| 43 | 50 | ||
| 51 | /* | ||
| 52 | * XXX This does not actually disable the osc_ck, since doing so would | ||
| 53 | * immediately halt the system. Instead, this function is used to | ||
| 54 | * enable an autoidle mode on the osc_ck. The existing | ||
| 55 | * clk_enable/clk_disable()-based usecounting for osc_ck should be | ||
| 56 | * replaced with autoidle-based usecounting. | ||
| 57 | */ | ||
| 44 | static void omap2_disable_osc_ck(struct clk *clk) | 58 | static void omap2_disable_osc_ck(struct clk *clk) |
| 45 | { | 59 | { |
| 46 | u32 pcc; | 60 | u32 pcc; |
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c index a781cd6795a4..e25364de028a 100644 --- a/arch/arm/mach-omap2/clkt_clksel.c +++ b/arch/arm/mach-omap2/clkt_clksel.c | |||
| @@ -97,7 +97,7 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk, | |||
| 97 | u32 *field_val) | 97 | u32 *field_val) |
| 98 | { | 98 | { |
| 99 | const struct clksel *clks; | 99 | const struct clksel *clks; |
| 100 | const struct clksel_rate *clkr, *max_clkr; | 100 | const struct clksel_rate *clkr, *max_clkr = NULL; |
| 101 | u8 max_div = 0; | 101 | u8 max_div = 0; |
| 102 | 102 | ||
| 103 | clks = _get_clksel_by_parent(clk, src_clk); | 103 | clks = _get_clksel_by_parent(clk, src_clk); |
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 337392c3f549..bcffee001bfa 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
| @@ -77,7 +77,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n) | |||
| 77 | dd = clk->dpll_data; | 77 | dd = clk->dpll_data; |
| 78 | 78 | ||
| 79 | /* DPLL divider must result in a valid jitter correction val */ | 79 | /* DPLL divider must result in a valid jitter correction val */ |
| 80 | fint = clk->parent->rate / (n + 1); | 80 | fint = clk->parent->rate / n; |
| 81 | if (fint < DPLL_FINT_BAND1_MIN) { | 81 | if (fint < DPLL_FINT_BAND1_MIN) { |
| 82 | 82 | ||
| 83 | pr_debug("rejecting n=%d due to Fint failure, " | 83 | pr_debug("rejecting n=%d due to Fint failure, " |
| @@ -178,12 +178,11 @@ void omap2_init_dpll_parent(struct clk *clk) | |||
| 178 | if (!dd) | 178 | if (!dd) |
| 179 | return; | 179 | return; |
| 180 | 180 | ||
| 181 | /* Return bypass rate if DPLL is bypassed */ | ||
| 182 | v = __raw_readl(dd->control_reg); | 181 | v = __raw_readl(dd->control_reg); |
| 183 | v &= dd->enable_mask; | 182 | v &= dd->enable_mask; |
| 184 | v >>= __ffs(dd->enable_mask); | 183 | v >>= __ffs(dd->enable_mask); |
| 185 | 184 | ||
| 186 | /* Reparent in case the dpll is in bypass */ | 185 | /* Reparent the struct clk in case the dpll is in bypass */ |
| 187 | if (cpu_is_omap24xx()) { | 186 | if (cpu_is_omap24xx()) { |
| 188 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | 187 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || |
| 189 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | 188 | v == OMAP2XXX_EN_DPLL_FRBYPASS) |
| @@ -260,50 +259,22 @@ u32 omap2_get_dpll_rate(struct clk *clk) | |||
| 260 | /* DPLL rate rounding code */ | 259 | /* DPLL rate rounding code */ |
| 261 | 260 | ||
| 262 | /** | 261 | /** |
| 263 | * omap2_dpll_set_rate_tolerance: set the error tolerance during rate rounding | ||
| 264 | * @clk: struct clk * of the DPLL | ||
| 265 | * @tolerance: maximum rate error tolerance | ||
| 266 | * | ||
| 267 | * Set the maximum DPLL rate error tolerance for the rate rounding | ||
| 268 | * algorithm. The rate tolerance is an attempt to balance DPLL power | ||
| 269 | * saving (the least divider value "n") vs. rate fidelity (the least | ||
| 270 | * difference between the desired DPLL target rate and the rounded | ||
| 271 | * rate out of the algorithm). So, increasing the tolerance is likely | ||
| 272 | * to decrease DPLL power consumption and increase DPLL rate error. | ||
| 273 | * Returns -EINVAL if provided a null clock ptr or a clk that is not a | ||
| 274 | * DPLL; or 0 upon success. | ||
| 275 | */ | ||
| 276 | int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance) | ||
| 277 | { | ||
| 278 | if (!clk || !clk->dpll_data) | ||
| 279 | return -EINVAL; | ||
| 280 | |||
| 281 | clk->dpll_data->rate_tolerance = tolerance; | ||
| 282 | |||
| 283 | return 0; | ||
| 284 | } | ||
| 285 | |||
| 286 | /** | ||
| 287 | * omap2_dpll_round_rate - round a target rate for an OMAP DPLL | 262 | * omap2_dpll_round_rate - round a target rate for an OMAP DPLL |
| 288 | * @clk: struct clk * for a DPLL | 263 | * @clk: struct clk * for a DPLL |
| 289 | * @target_rate: desired DPLL clock rate | 264 | * @target_rate: desired DPLL clock rate |
| 290 | * | 265 | * |
| 291 | * Given a DPLL, a desired target rate, and a rate tolerance, round | 266 | * Given a DPLL and a desired target rate, round the target rate to a |
| 292 | * the target rate to a possible, programmable rate for this DPLL. | 267 | * possible, programmable rate for this DPLL. Attempts to select the |
| 293 | * Rate tolerance is assumed to be set by the caller before this | 268 | * minimum possible n. Stores the computed (m, n) in the DPLL's |
| 294 | * function is called. Attempts to select the minimum possible n | 269 | * dpll_data structure so set_rate() will not need to call this |
| 295 | * within the tolerance to reduce power consumption. Stores the | 270 | * (expensive) function again. Returns ~0 if the target rate cannot |
| 296 | * computed (m, n) in the DPLL's dpll_data structure so set_rate() | 271 | * be rounded, or the rounded rate upon success. |
| 297 | * will not need to call this (expensive) function again. Returns ~0 | ||
| 298 | * if the target rate cannot be rounded, either because the rate is | ||
| 299 | * too low or because the rate tolerance is set too tightly; or the | ||
| 300 | * rounded rate upon success. | ||
| 301 | */ | 272 | */ |
| 302 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | 273 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) |
| 303 | { | 274 | { |
| 304 | int m, n, r, e, scaled_max_m; | 275 | int m, n, r, scaled_max_m; |
| 305 | unsigned long scaled_rt_rp, new_rate; | 276 | unsigned long scaled_rt_rp; |
| 306 | int min_e = -1, min_e_m = -1, min_e_n = -1; | 277 | unsigned long new_rate = 0; |
| 307 | struct dpll_data *dd; | 278 | struct dpll_data *dd; |
| 308 | 279 | ||
| 309 | if (!clk || !clk->dpll_data) | 280 | if (!clk || !clk->dpll_data) |
| @@ -311,8 +282,8 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | |||
| 311 | 282 | ||
| 312 | dd = clk->dpll_data; | 283 | dd = clk->dpll_data; |
| 313 | 284 | ||
| 314 | pr_debug("clock: starting DPLL round_rate for clock %s, target rate " | 285 | pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n", |
| 315 | "%ld\n", clk->name, target_rate); | 286 | clk->name, target_rate); |
| 316 | 287 | ||
| 317 | scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); | 288 | scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); |
| 318 | scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; | 289 | scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; |
| @@ -347,39 +318,23 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | |||
| 347 | if (r == DPLL_MULT_UNDERFLOW) | 318 | if (r == DPLL_MULT_UNDERFLOW) |
| 348 | continue; | 319 | continue; |
| 349 | 320 | ||
| 350 | e = target_rate - new_rate; | 321 | pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n", |
| 351 | pr_debug("clock: n = %d: m = %d: rate error is %d " | 322 | clk->name, m, n, new_rate); |
| 352 | "(new_rate = %ld)\n", n, m, e, new_rate); | ||
| 353 | |||
| 354 | if (min_e == -1 || | ||
| 355 | min_e >= (int)(abs(e) - dd->rate_tolerance)) { | ||
| 356 | min_e = e; | ||
| 357 | min_e_m = m; | ||
| 358 | min_e_n = n; | ||
| 359 | |||
| 360 | pr_debug("clock: found new least error %d\n", min_e); | ||
| 361 | 323 | ||
| 362 | /* We found good settings -- bail out now */ | 324 | if (target_rate == new_rate) { |
| 363 | if (min_e <= dd->rate_tolerance) | 325 | dd->last_rounded_m = m; |
| 364 | break; | 326 | dd->last_rounded_n = n; |
| 327 | dd->last_rounded_rate = target_rate; | ||
| 328 | break; | ||
| 365 | } | 329 | } |
| 366 | } | 330 | } |
| 367 | 331 | ||
| 368 | if (min_e < 0) { | 332 | if (target_rate != new_rate) { |
| 369 | pr_debug("clock: error: target rate or tolerance too low\n"); | 333 | pr_debug("clock: %s: cannot round to rate %ld\n", clk->name, |
| 334 | target_rate); | ||
| 370 | return ~0; | 335 | return ~0; |
| 371 | } | 336 | } |
| 372 | 337 | ||
| 373 | dd->last_rounded_m = min_e_m; | 338 | return target_rate; |
| 374 | dd->last_rounded_n = min_e_n; | ||
| 375 | dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate, | ||
| 376 | min_e_m, min_e_n); | ||
| 377 | |||
| 378 | pr_debug("clock: final least error: e = %d, m = %d, n = %d\n", | ||
| 379 | min_e, min_e_m, min_e_n); | ||
| 380 | pr_debug("clock: final rate: %ld (target rate: %ld)\n", | ||
| 381 | dd->last_rounded_rate, target_rate); | ||
| 382 | |||
| 383 | return dd->last_rounded_rate; | ||
| 384 | } | 339 | } |
| 385 | 340 | ||
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c new file mode 100644 index 000000000000..3d43fba2542f --- /dev/null +++ b/arch/arm/mach-omap2/clkt_iclk.c | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | /* | ||
| 2 | * OMAP2/3 interface clock control | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Nokia Corporation | ||
| 5 | * Paul Walmsley | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | #undef DEBUG | ||
| 12 | |||
| 13 | #include <linux/kernel.h> | ||
| 14 | #include <linux/clk.h> | ||
| 15 | #include <linux/io.h> | ||
| 16 | |||
| 17 | #include <plat/clock.h> | ||
| 18 | #include <plat/prcm.h> | ||
| 19 | |||
| 20 | #include "clock.h" | ||
| 21 | #include "clock2xxx.h" | ||
| 22 | #include "cm2xxx_3xxx.h" | ||
| 23 | #include "cm-regbits-24xx.h" | ||
| 24 | |||
| 25 | /* Private functions */ | ||
| 26 | |||
| 27 | /* XXX */ | ||
| 28 | void omap2_clkt_iclk_allow_idle(struct clk *clk) | ||
| 29 | { | ||
| 30 | u32 v, r; | ||
| 31 | |||
| 32 | r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); | ||
| 33 | |||
| 34 | v = __raw_readl((__force void __iomem *)r); | ||
| 35 | v |= (1 << clk->enable_bit); | ||
| 36 | __raw_writel(v, (__force void __iomem *)r); | ||
| 37 | } | ||
| 38 | |||
| 39 | /* XXX */ | ||
| 40 | void omap2_clkt_iclk_deny_idle(struct clk *clk) | ||
| 41 | { | ||
| 42 | u32 v, r; | ||
| 43 | |||
| 44 | r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN)); | ||
| 45 | |||
| 46 | v = __raw_readl((__force void __iomem *)r); | ||
| 47 | v &= ~(1 << clk->enable_bit); | ||
| 48 | __raw_writel(v, (__force void __iomem *)r); | ||
| 49 | } | ||
| 50 | |||
| 51 | /* Public data */ | ||
| 52 | |||
| 53 | const struct clkops clkops_omap2_iclk_dflt_wait = { | ||
| 54 | .enable = omap2_dflt_clk_enable, | ||
| 55 | .disable = omap2_dflt_clk_disable, | ||
| 56 | .find_companion = omap2_clk_dflt_find_companion, | ||
| 57 | .find_idlest = omap2_clk_dflt_find_idlest, | ||
| 58 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 59 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 60 | }; | ||
| 61 | |||
| 62 | const struct clkops clkops_omap2_iclk_dflt = { | ||
| 63 | .enable = omap2_dflt_clk_enable, | ||
| 64 | .disable = omap2_dflt_clk_disable, | ||
| 65 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 66 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 67 | }; | ||
| 68 | |||
| 69 | const struct clkops clkops_omap2_iclk_idle_only = { | ||
| 70 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 71 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 72 | }; | ||
| 73 | |||
| 74 | const struct clkops clkops_omap2_mdmclk_dflt_wait = { | ||
| 75 | .enable = omap2_dflt_clk_enable, | ||
| 76 | .disable = omap2_dflt_clk_disable, | ||
| 77 | .find_companion = omap2_clk_dflt_find_companion, | ||
| 78 | .find_idlest = omap2_clk_dflt_find_idlest, | ||
| 79 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 80 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 81 | }; | ||
| 82 | |||
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index e9625fcf6390..46d03ccc2806 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
| @@ -261,7 +261,8 @@ void omap2_clk_disable(struct clk *clk) | |||
| 261 | 261 | ||
| 262 | pr_debug("clock: %s: disabling in hardware\n", clk->name); | 262 | pr_debug("clock: %s: disabling in hardware\n", clk->name); |
| 263 | 263 | ||
| 264 | clk->ops->disable(clk); | 264 | if (clk->ops && clk->ops->disable) |
| 265 | clk->ops->disable(clk); | ||
| 265 | 266 | ||
| 266 | if (clk->clkdm) | 267 | if (clk->clkdm) |
| 267 | clkdm_clk_disable(clk->clkdm, clk); | 268 | clkdm_clk_disable(clk->clkdm, clk); |
| @@ -312,10 +313,13 @@ int omap2_clk_enable(struct clk *clk) | |||
| 312 | } | 313 | } |
| 313 | } | 314 | } |
| 314 | 315 | ||
| 315 | ret = clk->ops->enable(clk); | 316 | if (clk->ops && clk->ops->enable) { |
| 316 | if (ret) { | 317 | ret = clk->ops->enable(clk); |
| 317 | WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); | 318 | if (ret) { |
| 318 | goto oce_err3; | 319 | WARN(1, "clock: %s: could not enable: %d\n", |
| 320 | clk->name, ret); | ||
| 321 | goto oce_err3; | ||
| 322 | } | ||
| 319 | } | 323 | } |
| 320 | 324 | ||
| 321 | return 0; | 325 | return 0; |
| @@ -373,10 +377,16 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | |||
| 373 | const struct clkops clkops_omap3_noncore_dpll_ops = { | 377 | const struct clkops clkops_omap3_noncore_dpll_ops = { |
| 374 | .enable = omap3_noncore_dpll_enable, | 378 | .enable = omap3_noncore_dpll_enable, |
| 375 | .disable = omap3_noncore_dpll_disable, | 379 | .disable = omap3_noncore_dpll_disable, |
| 380 | .allow_idle = omap3_dpll_allow_idle, | ||
| 381 | .deny_idle = omap3_dpll_deny_idle, | ||
| 376 | }; | 382 | }; |
| 377 | 383 | ||
| 378 | #endif | 384 | const struct clkops clkops_omap3_core_dpll_ops = { |
| 385 | .allow_idle = omap3_dpll_allow_idle, | ||
| 386 | .deny_idle = omap3_dpll_deny_idle, | ||
| 387 | }; | ||
| 379 | 388 | ||
| 389 | #endif | ||
| 380 | 390 | ||
| 381 | /* | 391 | /* |
| 382 | * OMAP2+ clock reset and init functions | 392 | * OMAP2+ clock reset and init functions |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 896584e3c4ab..e10ff2b54844 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * linux/arch/arm/mach-omap2/clock.h | 2 | * linux/arch/arm/mach-omap2/clock.h |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2004-2009 Nokia Corporation | 5 | * Copyright (C) 2004-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Contacts: | 7 | * Contacts: |
| 8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
| @@ -18,9 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | #include <plat/clock.h> | 19 | #include <plat/clock.h> |
| 20 | 20 | ||
| 21 | /* The maximum error between a target DPLL rate and the rounded rate in Hz */ | ||
| 22 | #define DEFAULT_DPLL_RATE_TOLERANCE 50000 | ||
| 23 | |||
| 24 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ | 21 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ |
| 25 | #define CORE_CLK_SRC_32K 0x0 | 22 | #define CORE_CLK_SRC_32K 0x0 |
| 26 | #define CORE_CLK_SRC_DPLL 0x1 | 23 | #define CORE_CLK_SRC_DPLL 0x1 |
| @@ -55,7 +52,6 @@ void omap2_clk_disable(struct clk *clk); | |||
| 55 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); | 52 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); |
| 56 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate); | 53 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate); |
| 57 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); | 54 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); |
| 58 | int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance); | ||
| 59 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); | 55 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); |
| 60 | unsigned long omap3_dpll_recalc(struct clk *clk); | 56 | unsigned long omap3_dpll_recalc(struct clk *clk); |
| 61 | unsigned long omap3_clkoutx2_recalc(struct clk *clk); | 57 | unsigned long omap3_clkoutx2_recalc(struct clk *clk); |
| @@ -65,6 +61,9 @@ u32 omap3_dpll_autoidle_read(struct clk *clk); | |||
| 65 | int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate); | 61 | int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate); |
| 66 | int omap3_noncore_dpll_enable(struct clk *clk); | 62 | int omap3_noncore_dpll_enable(struct clk *clk); |
| 67 | void omap3_noncore_dpll_disable(struct clk *clk); | 63 | void omap3_noncore_dpll_disable(struct clk *clk); |
| 64 | int omap4_dpllmx_gatectrl_read(struct clk *clk); | ||
| 65 | void omap4_dpllmx_allow_gatectrl(struct clk *clk); | ||
| 66 | void omap4_dpllmx_deny_gatectrl(struct clk *clk); | ||
| 68 | 67 | ||
| 69 | #ifdef CONFIG_OMAP_RESET_CLOCKS | 68 | #ifdef CONFIG_OMAP_RESET_CLOCKS |
| 70 | void omap2_clk_disable_unused(struct clk *clk); | 69 | void omap2_clk_disable_unused(struct clk *clk); |
| @@ -83,6 +82,10 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); | |||
| 83 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); | 82 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); |
| 84 | int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent); | 83 | int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent); |
| 85 | 84 | ||
| 85 | /* clkt_iclk.c public functions */ | ||
| 86 | extern void omap2_clkt_iclk_allow_idle(struct clk *clk); | ||
| 87 | extern void omap2_clkt_iclk_deny_idle(struct clk *clk); | ||
| 88 | |||
| 86 | u32 omap2_get_dpll_rate(struct clk *clk); | 89 | u32 omap2_get_dpll_rate(struct clk *clk); |
| 87 | void omap2_init_dpll_parent(struct clk *clk); | 90 | void omap2_init_dpll_parent(struct clk *clk); |
| 88 | 91 | ||
| @@ -136,6 +139,7 @@ extern struct clk *vclk, *sclk; | |||
| 136 | extern const struct clksel_rate gpt_32k_rates[]; | 139 | extern const struct clksel_rate gpt_32k_rates[]; |
| 137 | extern const struct clksel_rate gpt_sys_rates[]; | 140 | extern const struct clksel_rate gpt_sys_rates[]; |
| 138 | extern const struct clksel_rate gfx_l3_rates[]; | 141 | extern const struct clksel_rate gfx_l3_rates[]; |
| 142 | extern const struct clksel_rate dsp_ick_rates[]; | ||
| 139 | 143 | ||
| 140 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ) | 144 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ) |
| 141 | extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | 145 | extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); |
| @@ -145,6 +149,13 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) | |||
| 145 | #define omap2_clk_exit_cpufreq_table 0 | 149 | #define omap2_clk_exit_cpufreq_table 0 |
| 146 | #endif | 150 | #endif |
| 147 | 151 | ||
| 152 | extern const struct clkops clkops_omap2_iclk_dflt_wait; | ||
| 153 | extern const struct clkops clkops_omap2_iclk_dflt; | ||
| 154 | extern const struct clkops clkops_omap2_iclk_idle_only; | ||
| 155 | extern const struct clkops clkops_omap2_mdmclk_dflt_wait; | ||
| 156 | extern const struct clkops clkops_omap2xxx_dpll_ops; | ||
| 148 | extern const struct clkops clkops_omap3_noncore_dpll_ops; | 157 | extern const struct clkops clkops_omap3_noncore_dpll_ops; |
| 158 | extern const struct clkops clkops_omap3_core_dpll_ops; | ||
| 159 | extern const struct clkops clkops_omap4_dpllmx_ops; | ||
| 149 | 160 | ||
| 150 | #endif | 161 | #endif |
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index 0a992bc8d0d8..b6f65d4ac97d 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/clock2420_data.c | 2 | * OMAP2420 clock data |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2004-2010 Nokia Corporation | 5 | * Copyright (C) 2004-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Contacts: | 7 | * Contacts: |
| 8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
| 9 | * Paul Walmsley | 9 | * Paul Walmsley |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
| @@ -34,18 +34,15 @@ | |||
| 34 | /* | 34 | /* |
| 35 | * 2420 clock tree. | 35 | * 2420 clock tree. |
| 36 | * | 36 | * |
| 37 | * NOTE:In many cases here we are assigning a 'default' parent. In many | 37 | * NOTE:In many cases here we are assigning a 'default' parent. In |
| 38 | * cases the parent is selectable. The get/set parent calls will also | 38 | * many cases the parent is selectable. The set parent calls will |
| 39 | * switch sources. | 39 | * also switch sources. |
| 40 | * | ||
| 41 | * Many some clocks say always_enabled, but they can be auto idled for | ||
| 42 | * power savings. They will always be available upon clock request. | ||
| 43 | * | 40 | * |
| 44 | * Several sources are given initial rates which may be wrong, this will | 41 | * Several sources are given initial rates which may be wrong, this will |
| 45 | * be fixed up in the init func. | 42 | * be fixed up in the init func. |
| 46 | * | 43 | * |
| 47 | * Things are broadly separated below by clock domains. It is | 44 | * Things are broadly separated below by clock domains. It is |
| 48 | * noteworthy that most periferals have dependencies on multiple clock | 45 | * noteworthy that most peripherals have dependencies on multiple clock |
| 49 | * domains. Many get their interface clocks from the L4 domain, but get | 46 | * domains. Many get their interface clocks from the L4 domain, but get |
| 50 | * functional clocks from fixed sources or other core domain derived | 47 | * functional clocks from fixed sources or other core domain derived |
| 51 | * clocks. | 48 | * clocks. |
| @@ -55,7 +52,7 @@ | |||
| 55 | static struct clk func_32k_ck = { | 52 | static struct clk func_32k_ck = { |
| 56 | .name = "func_32k_ck", | 53 | .name = "func_32k_ck", |
| 57 | .ops = &clkops_null, | 54 | .ops = &clkops_null, |
| 58 | .rate = 32000, | 55 | .rate = 32768, |
| 59 | .clkdm_name = "wkup_clkdm", | 56 | .clkdm_name = "wkup_clkdm", |
| 60 | }; | 57 | }; |
| 61 | 58 | ||
| @@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = { | |||
| 116 | .max_multiplier = 1023, | 113 | .max_multiplier = 1023, |
| 117 | .min_divider = 1, | 114 | .min_divider = 1, |
| 118 | .max_divider = 16, | 115 | .max_divider = 16, |
| 119 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
| 120 | }; | 116 | }; |
| 121 | 117 | ||
| 122 | /* | 118 | /* |
| @@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = { | |||
| 125 | */ | 121 | */ |
| 126 | static struct clk dpll_ck = { | 122 | static struct clk dpll_ck = { |
| 127 | .name = "dpll_ck", | 123 | .name = "dpll_ck", |
| 128 | .ops = &clkops_null, | 124 | .ops = &clkops_omap2xxx_dpll_ops, |
| 129 | .parent = &sys_ck, /* Can be func_32k also */ | 125 | .parent = &sys_ck, /* Can be func_32k also */ |
| 130 | .dpll_data = &dpll_dd, | 126 | .dpll_data = &dpll_dd, |
| 131 | .clkdm_name = "wkup_clkdm", | 127 | .clkdm_name = "wkup_clkdm", |
| @@ -455,36 +451,22 @@ static struct clk dsp_fck = { | |||
| 455 | .recalc = &omap2_clksel_recalc, | 451 | .recalc = &omap2_clksel_recalc, |
| 456 | }; | 452 | }; |
| 457 | 453 | ||
| 458 | /* DSP interface clock */ | 454 | static const struct clksel dsp_ick_clksel[] = { |
| 459 | static const struct clksel_rate dsp_irate_ick_rates[] = { | 455 | { .parent = &dsp_fck, .rates = dsp_ick_rates }, |
| 460 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
| 461 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
| 462 | { .div = 0 }, | ||
| 463 | }; | ||
| 464 | |||
| 465 | static const struct clksel dsp_irate_ick_clksel[] = { | ||
| 466 | { .parent = &dsp_fck, .rates = dsp_irate_ick_rates }, | ||
| 467 | { .parent = NULL } | 456 | { .parent = NULL } |
| 468 | }; | 457 | }; |
| 469 | 458 | ||
| 470 | /* This clock does not exist as such in the TRM. */ | ||
| 471 | static struct clk dsp_irate_ick = { | ||
| 472 | .name = "dsp_irate_ick", | ||
| 473 | .ops = &clkops_null, | ||
| 474 | .parent = &dsp_fck, | ||
| 475 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
| 476 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
| 477 | .clksel = dsp_irate_ick_clksel, | ||
| 478 | .recalc = &omap2_clksel_recalc, | ||
| 479 | }; | ||
| 480 | |||
| 481 | /* 2420 only */ | ||
| 482 | static struct clk dsp_ick = { | 459 | static struct clk dsp_ick = { |
| 483 | .name = "dsp_ick", /* apparently ipi and isp */ | 460 | .name = "dsp_ick", /* apparently ipi and isp */ |
| 484 | .ops = &clkops_omap2_dflt_wait, | 461 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 485 | .parent = &dsp_irate_ick, | 462 | .parent = &dsp_fck, |
| 463 | .clkdm_name = "dsp_clkdm", | ||
| 486 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), | 464 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), |
| 487 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ | 465 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ |
| 466 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
| 467 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
| 468 | .clksel = dsp_ick_clksel, | ||
| 469 | .recalc = &omap2_clksel_recalc, | ||
| 488 | }; | 470 | }; |
| 489 | 471 | ||
| 490 | /* | 472 | /* |
| @@ -579,7 +561,7 @@ static const struct clksel usb_l4_ick_clksel[] = { | |||
| 579 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ | 561 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ |
| 580 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ | 562 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ |
| 581 | .name = "usb_l4_ick", | 563 | .name = "usb_l4_ick", |
| 582 | .ops = &clkops_omap2_dflt_wait, | 564 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 583 | .parent = &core_l3_ck, | 565 | .parent = &core_l3_ck, |
| 584 | .clkdm_name = "core_l4_clkdm", | 566 | .clkdm_name = "core_l4_clkdm", |
| 585 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 567 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -661,7 +643,7 @@ static struct clk ssi_ssr_sst_fck = { | |||
| 661 | */ | 643 | */ |
| 662 | static struct clk ssi_l4_ick = { | 644 | static struct clk ssi_l4_ick = { |
| 663 | .name = "ssi_l4_ick", | 645 | .name = "ssi_l4_ick", |
| 664 | .ops = &clkops_omap2_dflt_wait, | 646 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 665 | .parent = &l4_ck, | 647 | .parent = &l4_ck, |
| 666 | .clkdm_name = "core_l4_clkdm", | 648 | .clkdm_name = "core_l4_clkdm", |
| 667 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 649 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -716,6 +698,7 @@ static struct clk gfx_2d_fck = { | |||
| 716 | .recalc = &omap2_clksel_recalc, | 698 | .recalc = &omap2_clksel_recalc, |
| 717 | }; | 699 | }; |
| 718 | 700 | ||
| 701 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
| 719 | static struct clk gfx_ick = { | 702 | static struct clk gfx_ick = { |
| 720 | .name = "gfx_ick", /* From l3 */ | 703 | .name = "gfx_ick", /* From l3 */ |
| 721 | .ops = &clkops_omap2_dflt_wait, | 704 | .ops = &clkops_omap2_dflt_wait, |
| @@ -763,7 +746,7 @@ static const struct clksel dss1_fck_clksel[] = { | |||
| 763 | 746 | ||
| 764 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ | 747 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ |
| 765 | .name = "dss_ick", | 748 | .name = "dss_ick", |
| 766 | .ops = &clkops_omap2_dflt, | 749 | .ops = &clkops_omap2_iclk_dflt, |
| 767 | .parent = &l4_ck, /* really both l3 and l4 */ | 750 | .parent = &l4_ck, /* really both l3 and l4 */ |
| 768 | .clkdm_name = "dss_clkdm", | 751 | .clkdm_name = "dss_clkdm", |
| 769 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 752 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -825,6 +808,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */ | |||
| 825 | .recalc = &followparent_recalc, | 808 | .recalc = &followparent_recalc, |
| 826 | }; | 809 | }; |
| 827 | 810 | ||
| 811 | static struct clk wu_l4_ick = { | ||
| 812 | .name = "wu_l4_ick", | ||
| 813 | .ops = &clkops_null, | ||
| 814 | .parent = &sys_ck, | ||
| 815 | .clkdm_name = "wkup_clkdm", | ||
| 816 | .recalc = &followparent_recalc, | ||
| 817 | }; | ||
| 818 | |||
| 828 | /* | 819 | /* |
| 829 | * CORE power domain ICLK & FCLK defines. | 820 | * CORE power domain ICLK & FCLK defines. |
| 830 | * Many of the these can have more than one possible parent. Entries | 821 | * Many of the these can have more than one possible parent. Entries |
| @@ -845,9 +836,9 @@ static const struct clksel omap24xx_gpt_clksel[] = { | |||
| 845 | 836 | ||
| 846 | static struct clk gpt1_ick = { | 837 | static struct clk gpt1_ick = { |
| 847 | .name = "gpt1_ick", | 838 | .name = "gpt1_ick", |
| 848 | .ops = &clkops_omap2_dflt_wait, | 839 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 849 | .parent = &l4_ck, | 840 | .parent = &wu_l4_ick, |
| 850 | .clkdm_name = "core_l4_clkdm", | 841 | .clkdm_name = "wkup_clkdm", |
| 851 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 842 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 852 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | 843 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
| 853 | .recalc = &followparent_recalc, | 844 | .recalc = &followparent_recalc, |
| @@ -871,7 +862,7 @@ static struct clk gpt1_fck = { | |||
| 871 | 862 | ||
| 872 | static struct clk gpt2_ick = { | 863 | static struct clk gpt2_ick = { |
| 873 | .name = "gpt2_ick", | 864 | .name = "gpt2_ick", |
| 874 | .ops = &clkops_omap2_dflt_wait, | 865 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 875 | .parent = &l4_ck, | 866 | .parent = &l4_ck, |
| 876 | .clkdm_name = "core_l4_clkdm", | 867 | .clkdm_name = "core_l4_clkdm", |
| 877 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 868 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -895,7 +886,7 @@ static struct clk gpt2_fck = { | |||
| 895 | 886 | ||
| 896 | static struct clk gpt3_ick = { | 887 | static struct clk gpt3_ick = { |
| 897 | .name = "gpt3_ick", | 888 | .name = "gpt3_ick", |
| 898 | .ops = &clkops_omap2_dflt_wait, | 889 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 899 | .parent = &l4_ck, | 890 | .parent = &l4_ck, |
| 900 | .clkdm_name = "core_l4_clkdm", | 891 | .clkdm_name = "core_l4_clkdm", |
| 901 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 892 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -919,7 +910,7 @@ static struct clk gpt3_fck = { | |||
| 919 | 910 | ||
| 920 | static struct clk gpt4_ick = { | 911 | static struct clk gpt4_ick = { |
| 921 | .name = "gpt4_ick", | 912 | .name = "gpt4_ick", |
| 922 | .ops = &clkops_omap2_dflt_wait, | 913 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 923 | .parent = &l4_ck, | 914 | .parent = &l4_ck, |
| 924 | .clkdm_name = "core_l4_clkdm", | 915 | .clkdm_name = "core_l4_clkdm", |
| 925 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 916 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -943,7 +934,7 @@ static struct clk gpt4_fck = { | |||
| 943 | 934 | ||
| 944 | static struct clk gpt5_ick = { | 935 | static struct clk gpt5_ick = { |
| 945 | .name = "gpt5_ick", | 936 | .name = "gpt5_ick", |
| 946 | .ops = &clkops_omap2_dflt_wait, | 937 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 947 | .parent = &l4_ck, | 938 | .parent = &l4_ck, |
| 948 | .clkdm_name = "core_l4_clkdm", | 939 | .clkdm_name = "core_l4_clkdm", |
| 949 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 940 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -967,7 +958,7 @@ static struct clk gpt5_fck = { | |||
| 967 | 958 | ||
| 968 | static struct clk gpt6_ick = { | 959 | static struct clk gpt6_ick = { |
| 969 | .name = "gpt6_ick", | 960 | .name = "gpt6_ick", |
| 970 | .ops = &clkops_omap2_dflt_wait, | 961 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 971 | .parent = &l4_ck, | 962 | .parent = &l4_ck, |
| 972 | .clkdm_name = "core_l4_clkdm", | 963 | .clkdm_name = "core_l4_clkdm", |
| 973 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 964 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -991,8 +982,9 @@ static struct clk gpt6_fck = { | |||
| 991 | 982 | ||
| 992 | static struct clk gpt7_ick = { | 983 | static struct clk gpt7_ick = { |
| 993 | .name = "gpt7_ick", | 984 | .name = "gpt7_ick", |
| 994 | .ops = &clkops_omap2_dflt_wait, | 985 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 995 | .parent = &l4_ck, | 986 | .parent = &l4_ck, |
| 987 | .clkdm_name = "core_l4_clkdm", | ||
| 996 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 988 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 997 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | 989 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
| 998 | .recalc = &followparent_recalc, | 990 | .recalc = &followparent_recalc, |
| @@ -1014,7 +1006,7 @@ static struct clk gpt7_fck = { | |||
| 1014 | 1006 | ||
| 1015 | static struct clk gpt8_ick = { | 1007 | static struct clk gpt8_ick = { |
| 1016 | .name = "gpt8_ick", | 1008 | .name = "gpt8_ick", |
| 1017 | .ops = &clkops_omap2_dflt_wait, | 1009 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1018 | .parent = &l4_ck, | 1010 | .parent = &l4_ck, |
| 1019 | .clkdm_name = "core_l4_clkdm", | 1011 | .clkdm_name = "core_l4_clkdm", |
| 1020 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1012 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1038,7 +1030,7 @@ static struct clk gpt8_fck = { | |||
| 1038 | 1030 | ||
| 1039 | static struct clk gpt9_ick = { | 1031 | static struct clk gpt9_ick = { |
| 1040 | .name = "gpt9_ick", | 1032 | .name = "gpt9_ick", |
| 1041 | .ops = &clkops_omap2_dflt_wait, | 1033 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1042 | .parent = &l4_ck, | 1034 | .parent = &l4_ck, |
| 1043 | .clkdm_name = "core_l4_clkdm", | 1035 | .clkdm_name = "core_l4_clkdm", |
| 1044 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1036 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1062,7 +1054,7 @@ static struct clk gpt9_fck = { | |||
| 1062 | 1054 | ||
| 1063 | static struct clk gpt10_ick = { | 1055 | static struct clk gpt10_ick = { |
| 1064 | .name = "gpt10_ick", | 1056 | .name = "gpt10_ick", |
| 1065 | .ops = &clkops_omap2_dflt_wait, | 1057 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1066 | .parent = &l4_ck, | 1058 | .parent = &l4_ck, |
| 1067 | .clkdm_name = "core_l4_clkdm", | 1059 | .clkdm_name = "core_l4_clkdm", |
| 1068 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1060 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1086,7 +1078,7 @@ static struct clk gpt10_fck = { | |||
| 1086 | 1078 | ||
| 1087 | static struct clk gpt11_ick = { | 1079 | static struct clk gpt11_ick = { |
| 1088 | .name = "gpt11_ick", | 1080 | .name = "gpt11_ick", |
| 1089 | .ops = &clkops_omap2_dflt_wait, | 1081 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1090 | .parent = &l4_ck, | 1082 | .parent = &l4_ck, |
| 1091 | .clkdm_name = "core_l4_clkdm", | 1083 | .clkdm_name = "core_l4_clkdm", |
| 1092 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1084 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1110,7 +1102,7 @@ static struct clk gpt11_fck = { | |||
| 1110 | 1102 | ||
| 1111 | static struct clk gpt12_ick = { | 1103 | static struct clk gpt12_ick = { |
| 1112 | .name = "gpt12_ick", | 1104 | .name = "gpt12_ick", |
| 1113 | .ops = &clkops_omap2_dflt_wait, | 1105 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1114 | .parent = &l4_ck, | 1106 | .parent = &l4_ck, |
| 1115 | .clkdm_name = "core_l4_clkdm", | 1107 | .clkdm_name = "core_l4_clkdm", |
| 1116 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1108 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1134,7 +1126,7 @@ static struct clk gpt12_fck = { | |||
| 1134 | 1126 | ||
| 1135 | static struct clk mcbsp1_ick = { | 1127 | static struct clk mcbsp1_ick = { |
| 1136 | .name = "mcbsp1_ick", | 1128 | .name = "mcbsp1_ick", |
| 1137 | .ops = &clkops_omap2_dflt_wait, | 1129 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1138 | .parent = &l4_ck, | 1130 | .parent = &l4_ck, |
| 1139 | .clkdm_name = "core_l4_clkdm", | 1131 | .clkdm_name = "core_l4_clkdm", |
| 1140 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1132 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1174,7 +1166,7 @@ static struct clk mcbsp1_fck = { | |||
| 1174 | 1166 | ||
| 1175 | static struct clk mcbsp2_ick = { | 1167 | static struct clk mcbsp2_ick = { |
| 1176 | .name = "mcbsp2_ick", | 1168 | .name = "mcbsp2_ick", |
| 1177 | .ops = &clkops_omap2_dflt_wait, | 1169 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1178 | .parent = &l4_ck, | 1170 | .parent = &l4_ck, |
| 1179 | .clkdm_name = "core_l4_clkdm", | 1171 | .clkdm_name = "core_l4_clkdm", |
| 1180 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1172 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1198,7 +1190,7 @@ static struct clk mcbsp2_fck = { | |||
| 1198 | 1190 | ||
| 1199 | static struct clk mcspi1_ick = { | 1191 | static struct clk mcspi1_ick = { |
| 1200 | .name = "mcspi1_ick", | 1192 | .name = "mcspi1_ick", |
| 1201 | .ops = &clkops_omap2_dflt_wait, | 1193 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1202 | .parent = &l4_ck, | 1194 | .parent = &l4_ck, |
| 1203 | .clkdm_name = "core_l4_clkdm", | 1195 | .clkdm_name = "core_l4_clkdm", |
| 1204 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1196 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1218,7 +1210,7 @@ static struct clk mcspi1_fck = { | |||
| 1218 | 1210 | ||
| 1219 | static struct clk mcspi2_ick = { | 1211 | static struct clk mcspi2_ick = { |
| 1220 | .name = "mcspi2_ick", | 1212 | .name = "mcspi2_ick", |
| 1221 | .ops = &clkops_omap2_dflt_wait, | 1213 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1222 | .parent = &l4_ck, | 1214 | .parent = &l4_ck, |
| 1223 | .clkdm_name = "core_l4_clkdm", | 1215 | .clkdm_name = "core_l4_clkdm", |
| 1224 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1216 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1238,7 +1230,7 @@ static struct clk mcspi2_fck = { | |||
| 1238 | 1230 | ||
| 1239 | static struct clk uart1_ick = { | 1231 | static struct clk uart1_ick = { |
| 1240 | .name = "uart1_ick", | 1232 | .name = "uart1_ick", |
| 1241 | .ops = &clkops_omap2_dflt_wait, | 1233 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1242 | .parent = &l4_ck, | 1234 | .parent = &l4_ck, |
| 1243 | .clkdm_name = "core_l4_clkdm", | 1235 | .clkdm_name = "core_l4_clkdm", |
| 1244 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1236 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1258,7 +1250,7 @@ static struct clk uart1_fck = { | |||
| 1258 | 1250 | ||
| 1259 | static struct clk uart2_ick = { | 1251 | static struct clk uart2_ick = { |
| 1260 | .name = "uart2_ick", | 1252 | .name = "uart2_ick", |
| 1261 | .ops = &clkops_omap2_dflt_wait, | 1253 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1262 | .parent = &l4_ck, | 1254 | .parent = &l4_ck, |
| 1263 | .clkdm_name = "core_l4_clkdm", | 1255 | .clkdm_name = "core_l4_clkdm", |
| 1264 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1256 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1278,7 +1270,7 @@ static struct clk uart2_fck = { | |||
| 1278 | 1270 | ||
| 1279 | static struct clk uart3_ick = { | 1271 | static struct clk uart3_ick = { |
| 1280 | .name = "uart3_ick", | 1272 | .name = "uart3_ick", |
| 1281 | .ops = &clkops_omap2_dflt_wait, | 1273 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1282 | .parent = &l4_ck, | 1274 | .parent = &l4_ck, |
| 1283 | .clkdm_name = "core_l4_clkdm", | 1275 | .clkdm_name = "core_l4_clkdm", |
| 1284 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1276 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1298,9 +1290,9 @@ static struct clk uart3_fck = { | |||
| 1298 | 1290 | ||
| 1299 | static struct clk gpios_ick = { | 1291 | static struct clk gpios_ick = { |
| 1300 | .name = "gpios_ick", | 1292 | .name = "gpios_ick", |
| 1301 | .ops = &clkops_omap2_dflt_wait, | 1293 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1302 | .parent = &l4_ck, | 1294 | .parent = &wu_l4_ick, |
| 1303 | .clkdm_name = "core_l4_clkdm", | 1295 | .clkdm_name = "wkup_clkdm", |
| 1304 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1296 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1305 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | 1297 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
| 1306 | .recalc = &followparent_recalc, | 1298 | .recalc = &followparent_recalc, |
| @@ -1318,9 +1310,9 @@ static struct clk gpios_fck = { | |||
| 1318 | 1310 | ||
| 1319 | static struct clk mpu_wdt_ick = { | 1311 | static struct clk mpu_wdt_ick = { |
| 1320 | .name = "mpu_wdt_ick", | 1312 | .name = "mpu_wdt_ick", |
| 1321 | .ops = &clkops_omap2_dflt_wait, | 1313 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1322 | .parent = &l4_ck, | 1314 | .parent = &wu_l4_ick, |
| 1323 | .clkdm_name = "core_l4_clkdm", | 1315 | .clkdm_name = "wkup_clkdm", |
| 1324 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1316 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1325 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | 1317 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
| 1326 | .recalc = &followparent_recalc, | 1318 | .recalc = &followparent_recalc, |
| @@ -1338,10 +1330,10 @@ static struct clk mpu_wdt_fck = { | |||
| 1338 | 1330 | ||
| 1339 | static struct clk sync_32k_ick = { | 1331 | static struct clk sync_32k_ick = { |
| 1340 | .name = "sync_32k_ick", | 1332 | .name = "sync_32k_ick", |
| 1341 | .ops = &clkops_omap2_dflt_wait, | 1333 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1342 | .parent = &l4_ck, | 1334 | .parent = &wu_l4_ick, |
| 1335 | .clkdm_name = "wkup_clkdm", | ||
| 1343 | .flags = ENABLE_ON_INIT, | 1336 | .flags = ENABLE_ON_INIT, |
| 1344 | .clkdm_name = "core_l4_clkdm", | ||
| 1345 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1337 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1346 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, | 1338 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, |
| 1347 | .recalc = &followparent_recalc, | 1339 | .recalc = &followparent_recalc, |
| @@ -1349,9 +1341,9 @@ static struct clk sync_32k_ick = { | |||
| 1349 | 1341 | ||
| 1350 | static struct clk wdt1_ick = { | 1342 | static struct clk wdt1_ick = { |
| 1351 | .name = "wdt1_ick", | 1343 | .name = "wdt1_ick", |
| 1352 | .ops = &clkops_omap2_dflt_wait, | 1344 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1353 | .parent = &l4_ck, | 1345 | .parent = &wu_l4_ick, |
| 1354 | .clkdm_name = "core_l4_clkdm", | 1346 | .clkdm_name = "wkup_clkdm", |
| 1355 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1347 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1356 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, | 1348 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, |
| 1357 | .recalc = &followparent_recalc, | 1349 | .recalc = &followparent_recalc, |
| @@ -1359,10 +1351,10 @@ static struct clk wdt1_ick = { | |||
| 1359 | 1351 | ||
| 1360 | static struct clk omapctrl_ick = { | 1352 | static struct clk omapctrl_ick = { |
| 1361 | .name = "omapctrl_ick", | 1353 | .name = "omapctrl_ick", |
| 1362 | .ops = &clkops_omap2_dflt_wait, | 1354 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1363 | .parent = &l4_ck, | 1355 | .parent = &wu_l4_ick, |
| 1356 | .clkdm_name = "wkup_clkdm", | ||
| 1364 | .flags = ENABLE_ON_INIT, | 1357 | .flags = ENABLE_ON_INIT, |
| 1365 | .clkdm_name = "core_l4_clkdm", | ||
| 1366 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1358 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1367 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, | 1359 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, |
| 1368 | .recalc = &followparent_recalc, | 1360 | .recalc = &followparent_recalc, |
| @@ -1370,7 +1362,7 @@ static struct clk omapctrl_ick = { | |||
| 1370 | 1362 | ||
| 1371 | static struct clk cam_ick = { | 1363 | static struct clk cam_ick = { |
| 1372 | .name = "cam_ick", | 1364 | .name = "cam_ick", |
| 1373 | .ops = &clkops_omap2_dflt, | 1365 | .ops = &clkops_omap2_iclk_dflt, |
| 1374 | .parent = &l4_ck, | 1366 | .parent = &l4_ck, |
| 1375 | .clkdm_name = "core_l4_clkdm", | 1367 | .clkdm_name = "core_l4_clkdm", |
| 1376 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1368 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1395,7 +1387,7 @@ static struct clk cam_fck = { | |||
| 1395 | 1387 | ||
| 1396 | static struct clk mailboxes_ick = { | 1388 | static struct clk mailboxes_ick = { |
| 1397 | .name = "mailboxes_ick", | 1389 | .name = "mailboxes_ick", |
| 1398 | .ops = &clkops_omap2_dflt_wait, | 1390 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1399 | .parent = &l4_ck, | 1391 | .parent = &l4_ck, |
| 1400 | .clkdm_name = "core_l4_clkdm", | 1392 | .clkdm_name = "core_l4_clkdm", |
| 1401 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1393 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1405,7 +1397,7 @@ static struct clk mailboxes_ick = { | |||
| 1405 | 1397 | ||
| 1406 | static struct clk wdt4_ick = { | 1398 | static struct clk wdt4_ick = { |
| 1407 | .name = "wdt4_ick", | 1399 | .name = "wdt4_ick", |
| 1408 | .ops = &clkops_omap2_dflt_wait, | 1400 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1409 | .parent = &l4_ck, | 1401 | .parent = &l4_ck, |
| 1410 | .clkdm_name = "core_l4_clkdm", | 1402 | .clkdm_name = "core_l4_clkdm", |
| 1411 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1403 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1425,7 +1417,7 @@ static struct clk wdt4_fck = { | |||
| 1425 | 1417 | ||
| 1426 | static struct clk wdt3_ick = { | 1418 | static struct clk wdt3_ick = { |
| 1427 | .name = "wdt3_ick", | 1419 | .name = "wdt3_ick", |
| 1428 | .ops = &clkops_omap2_dflt_wait, | 1420 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1429 | .parent = &l4_ck, | 1421 | .parent = &l4_ck, |
| 1430 | .clkdm_name = "core_l4_clkdm", | 1422 | .clkdm_name = "core_l4_clkdm", |
| 1431 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1423 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1445,7 +1437,7 @@ static struct clk wdt3_fck = { | |||
| 1445 | 1437 | ||
| 1446 | static struct clk mspro_ick = { | 1438 | static struct clk mspro_ick = { |
| 1447 | .name = "mspro_ick", | 1439 | .name = "mspro_ick", |
| 1448 | .ops = &clkops_omap2_dflt_wait, | 1440 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1449 | .parent = &l4_ck, | 1441 | .parent = &l4_ck, |
| 1450 | .clkdm_name = "core_l4_clkdm", | 1442 | .clkdm_name = "core_l4_clkdm", |
| 1451 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1443 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1465,7 +1457,7 @@ static struct clk mspro_fck = { | |||
| 1465 | 1457 | ||
| 1466 | static struct clk mmc_ick = { | 1458 | static struct clk mmc_ick = { |
| 1467 | .name = "mmc_ick", | 1459 | .name = "mmc_ick", |
| 1468 | .ops = &clkops_omap2_dflt_wait, | 1460 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1469 | .parent = &l4_ck, | 1461 | .parent = &l4_ck, |
| 1470 | .clkdm_name = "core_l4_clkdm", | 1462 | .clkdm_name = "core_l4_clkdm", |
| 1471 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1463 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1485,7 +1477,7 @@ static struct clk mmc_fck = { | |||
| 1485 | 1477 | ||
| 1486 | static struct clk fac_ick = { | 1478 | static struct clk fac_ick = { |
| 1487 | .name = "fac_ick", | 1479 | .name = "fac_ick", |
| 1488 | .ops = &clkops_omap2_dflt_wait, | 1480 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1489 | .parent = &l4_ck, | 1481 | .parent = &l4_ck, |
| 1490 | .clkdm_name = "core_l4_clkdm", | 1482 | .clkdm_name = "core_l4_clkdm", |
| 1491 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1483 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1505,7 +1497,7 @@ static struct clk fac_fck = { | |||
| 1505 | 1497 | ||
| 1506 | static struct clk eac_ick = { | 1498 | static struct clk eac_ick = { |
| 1507 | .name = "eac_ick", | 1499 | .name = "eac_ick", |
| 1508 | .ops = &clkops_omap2_dflt_wait, | 1500 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1509 | .parent = &l4_ck, | 1501 | .parent = &l4_ck, |
| 1510 | .clkdm_name = "core_l4_clkdm", | 1502 | .clkdm_name = "core_l4_clkdm", |
| 1511 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1503 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1525,7 +1517,7 @@ static struct clk eac_fck = { | |||
| 1525 | 1517 | ||
| 1526 | static struct clk hdq_ick = { | 1518 | static struct clk hdq_ick = { |
| 1527 | .name = "hdq_ick", | 1519 | .name = "hdq_ick", |
| 1528 | .ops = &clkops_omap2_dflt_wait, | 1520 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1529 | .parent = &l4_ck, | 1521 | .parent = &l4_ck, |
| 1530 | .clkdm_name = "core_l4_clkdm", | 1522 | .clkdm_name = "core_l4_clkdm", |
| 1531 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1523 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1545,7 +1537,7 @@ static struct clk hdq_fck = { | |||
| 1545 | 1537 | ||
| 1546 | static struct clk i2c2_ick = { | 1538 | static struct clk i2c2_ick = { |
| 1547 | .name = "i2c2_ick", | 1539 | .name = "i2c2_ick", |
| 1548 | .ops = &clkops_omap2_dflt_wait, | 1540 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1549 | .parent = &l4_ck, | 1541 | .parent = &l4_ck, |
| 1550 | .clkdm_name = "core_l4_clkdm", | 1542 | .clkdm_name = "core_l4_clkdm", |
| 1551 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1543 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1565,7 +1557,7 @@ static struct clk i2c2_fck = { | |||
| 1565 | 1557 | ||
| 1566 | static struct clk i2c1_ick = { | 1558 | static struct clk i2c1_ick = { |
| 1567 | .name = "i2c1_ick", | 1559 | .name = "i2c1_ick", |
| 1568 | .ops = &clkops_omap2_dflt_wait, | 1560 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1569 | .parent = &l4_ck, | 1561 | .parent = &l4_ck, |
| 1570 | .clkdm_name = "core_l4_clkdm", | 1562 | .clkdm_name = "core_l4_clkdm", |
| 1571 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1563 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1583,12 +1575,18 @@ static struct clk i2c1_fck = { | |||
| 1583 | .recalc = &followparent_recalc, | 1575 | .recalc = &followparent_recalc, |
| 1584 | }; | 1576 | }; |
| 1585 | 1577 | ||
| 1578 | /* | ||
| 1579 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
| 1580 | * accesses derived from this data. | ||
| 1581 | */ | ||
| 1586 | static struct clk gpmc_fck = { | 1582 | static struct clk gpmc_fck = { |
| 1587 | .name = "gpmc_fck", | 1583 | .name = "gpmc_fck", |
| 1588 | .ops = &clkops_null, /* RMK: missing? */ | 1584 | .ops = &clkops_omap2_iclk_idle_only, |
| 1589 | .parent = &core_l3_ck, | 1585 | .parent = &core_l3_ck, |
| 1590 | .flags = ENABLE_ON_INIT, | 1586 | .flags = ENABLE_ON_INIT, |
| 1591 | .clkdm_name = "core_l3_clkdm", | 1587 | .clkdm_name = "core_l3_clkdm", |
| 1588 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
| 1589 | .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT, | ||
| 1592 | .recalc = &followparent_recalc, | 1590 | .recalc = &followparent_recalc, |
| 1593 | }; | 1591 | }; |
| 1594 | 1592 | ||
| @@ -1600,17 +1598,38 @@ static struct clk sdma_fck = { | |||
| 1600 | .recalc = &followparent_recalc, | 1598 | .recalc = &followparent_recalc, |
| 1601 | }; | 1599 | }; |
| 1602 | 1600 | ||
| 1601 | /* | ||
| 1602 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
| 1603 | * accesses derived from this data. | ||
| 1604 | */ | ||
| 1603 | static struct clk sdma_ick = { | 1605 | static struct clk sdma_ick = { |
| 1604 | .name = "sdma_ick", | 1606 | .name = "sdma_ick", |
| 1605 | .ops = &clkops_null, /* RMK: missing? */ | 1607 | .ops = &clkops_omap2_iclk_idle_only, |
| 1606 | .parent = &l4_ck, | 1608 | .parent = &core_l3_ck, |
| 1609 | .clkdm_name = "core_l3_clkdm", | ||
| 1610 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
| 1611 | .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT, | ||
| 1612 | .recalc = &followparent_recalc, | ||
| 1613 | }; | ||
| 1614 | |||
| 1615 | /* | ||
| 1616 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
| 1617 | * accesses derived from this data. | ||
| 1618 | */ | ||
| 1619 | static struct clk sdrc_ick = { | ||
| 1620 | .name = "sdrc_ick", | ||
| 1621 | .ops = &clkops_omap2_iclk_idle_only, | ||
| 1622 | .parent = &core_l3_ck, | ||
| 1623 | .flags = ENABLE_ON_INIT, | ||
| 1607 | .clkdm_name = "core_l3_clkdm", | 1624 | .clkdm_name = "core_l3_clkdm", |
| 1625 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
| 1626 | .enable_bit = OMAP24XX_AUTO_SDRC_SHIFT, | ||
| 1608 | .recalc = &followparent_recalc, | 1627 | .recalc = &followparent_recalc, |
| 1609 | }; | 1628 | }; |
| 1610 | 1629 | ||
| 1611 | static struct clk vlynq_ick = { | 1630 | static struct clk vlynq_ick = { |
| 1612 | .name = "vlynq_ick", | 1631 | .name = "vlynq_ick", |
| 1613 | .ops = &clkops_omap2_dflt_wait, | 1632 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1614 | .parent = &core_l3_ck, | 1633 | .parent = &core_l3_ck, |
| 1615 | .clkdm_name = "core_l3_clkdm", | 1634 | .clkdm_name = "core_l3_clkdm", |
| 1616 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1635 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1659,7 +1678,7 @@ static struct clk vlynq_fck = { | |||
| 1659 | 1678 | ||
| 1660 | static struct clk des_ick = { | 1679 | static struct clk des_ick = { |
| 1661 | .name = "des_ick", | 1680 | .name = "des_ick", |
| 1662 | .ops = &clkops_omap2_dflt_wait, | 1681 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1663 | .parent = &l4_ck, | 1682 | .parent = &l4_ck, |
| 1664 | .clkdm_name = "core_l4_clkdm", | 1683 | .clkdm_name = "core_l4_clkdm", |
| 1665 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1684 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1669,7 +1688,7 @@ static struct clk des_ick = { | |||
| 1669 | 1688 | ||
| 1670 | static struct clk sha_ick = { | 1689 | static struct clk sha_ick = { |
| 1671 | .name = "sha_ick", | 1690 | .name = "sha_ick", |
| 1672 | .ops = &clkops_omap2_dflt_wait, | 1691 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1673 | .parent = &l4_ck, | 1692 | .parent = &l4_ck, |
| 1674 | .clkdm_name = "core_l4_clkdm", | 1693 | .clkdm_name = "core_l4_clkdm", |
| 1675 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1694 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1679,7 +1698,7 @@ static struct clk sha_ick = { | |||
| 1679 | 1698 | ||
| 1680 | static struct clk rng_ick = { | 1699 | static struct clk rng_ick = { |
| 1681 | .name = "rng_ick", | 1700 | .name = "rng_ick", |
| 1682 | .ops = &clkops_omap2_dflt_wait, | 1701 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1683 | .parent = &l4_ck, | 1702 | .parent = &l4_ck, |
| 1684 | .clkdm_name = "core_l4_clkdm", | 1703 | .clkdm_name = "core_l4_clkdm", |
| 1685 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1704 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1689,7 +1708,7 @@ static struct clk rng_ick = { | |||
| 1689 | 1708 | ||
| 1690 | static struct clk aes_ick = { | 1709 | static struct clk aes_ick = { |
| 1691 | .name = "aes_ick", | 1710 | .name = "aes_ick", |
| 1692 | .ops = &clkops_omap2_dflt_wait, | 1711 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1693 | .parent = &l4_ck, | 1712 | .parent = &l4_ck, |
| 1694 | .clkdm_name = "core_l4_clkdm", | 1713 | .clkdm_name = "core_l4_clkdm", |
| 1695 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1714 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1699,7 +1718,7 @@ static struct clk aes_ick = { | |||
| 1699 | 1718 | ||
| 1700 | static struct clk pka_ick = { | 1719 | static struct clk pka_ick = { |
| 1701 | .name = "pka_ick", | 1720 | .name = "pka_ick", |
| 1702 | .ops = &clkops_omap2_dflt_wait, | 1721 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1703 | .parent = &l4_ck, | 1722 | .parent = &l4_ck, |
| 1704 | .clkdm_name = "core_l4_clkdm", | 1723 | .clkdm_name = "core_l4_clkdm", |
| 1705 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1724 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1777,7 +1796,6 @@ static struct omap_clk omap2420_clks[] = { | |||
| 1777 | CLK(NULL, "mpu_ck", &mpu_ck, CK_242X), | 1796 | CLK(NULL, "mpu_ck", &mpu_ck, CK_242X), |
| 1778 | /* dsp domain clocks */ | 1797 | /* dsp domain clocks */ |
| 1779 | CLK(NULL, "dsp_fck", &dsp_fck, CK_242X), | 1798 | CLK(NULL, "dsp_fck", &dsp_fck, CK_242X), |
| 1780 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_242X), | ||
| 1781 | CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), | 1799 | CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), |
| 1782 | CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), | 1800 | CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), |
| 1783 | CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), | 1801 | CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), |
| @@ -1797,6 +1815,7 @@ static struct omap_clk omap2420_clks[] = { | |||
| 1797 | /* L4 domain clocks */ | 1815 | /* L4 domain clocks */ |
| 1798 | CLK(NULL, "l4_ck", &l4_ck, CK_242X), | 1816 | CLK(NULL, "l4_ck", &l4_ck, CK_242X), |
| 1799 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), | 1817 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), |
| 1818 | CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_242X), | ||
| 1800 | /* virtual meta-group clock */ | 1819 | /* virtual meta-group clock */ |
| 1801 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), | 1820 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), |
| 1802 | /* general l4 interface ck, multi-parent functional clk */ | 1821 | /* general l4 interface ck, multi-parent functional clk */ |
| @@ -1869,6 +1888,7 @@ static struct omap_clk omap2420_clks[] = { | |||
| 1869 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), | 1888 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), |
| 1870 | CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), | 1889 | CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), |
| 1871 | CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), | 1890 | CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), |
| 1891 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_242X), | ||
| 1872 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), | 1892 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), |
| 1873 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), | 1893 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), |
| 1874 | CLK(NULL, "des_ick", &des_ick, CK_242X), | 1894 | CLK(NULL, "des_ick", &des_ick, CK_242X), |
| @@ -1913,6 +1933,9 @@ int __init omap2420_clk_init(void) | |||
| 1913 | omap2_init_clk_clkdm(c->lk.clk); | 1933 | omap2_init_clk_clkdm(c->lk.clk); |
| 1914 | } | 1934 | } |
| 1915 | 1935 | ||
| 1936 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
| 1937 | omap_clk_disable_autoidle_all(); | ||
| 1938 | |||
| 1916 | /* Check the MPU rate set by bootloader */ | 1939 | /* Check the MPU rate set by bootloader */ |
| 1917 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); | 1940 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); |
| 1918 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 1941 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index c047dcd007e5..bba018331a71 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/clock2430_data.c | 2 | * OMAP2430 clock data |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2004-2010 Nokia Corporation | 5 | * Copyright (C) 2004-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Contacts: | 7 | * Contacts: |
| 8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
| 9 | * Paul Walmsley | 9 | * Paul Walmsley |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as | 12 | * it under the terms of the GNU General Public License version 2 as |
| @@ -34,18 +34,15 @@ | |||
| 34 | /* | 34 | /* |
| 35 | * 2430 clock tree. | 35 | * 2430 clock tree. |
| 36 | * | 36 | * |
| 37 | * NOTE:In many cases here we are assigning a 'default' parent. In many | 37 | * NOTE:In many cases here we are assigning a 'default' parent. In |
| 38 | * cases the parent is selectable. The get/set parent calls will also | 38 | * many cases the parent is selectable. The set parent calls will |
| 39 | * switch sources. | 39 | * also switch sources. |
| 40 | * | ||
| 41 | * Many some clocks say always_enabled, but they can be auto idled for | ||
| 42 | * power savings. They will always be available upon clock request. | ||
| 43 | * | 40 | * |
| 44 | * Several sources are given initial rates which may be wrong, this will | 41 | * Several sources are given initial rates which may be wrong, this will |
| 45 | * be fixed up in the init func. | 42 | * be fixed up in the init func. |
| 46 | * | 43 | * |
| 47 | * Things are broadly separated below by clock domains. It is | 44 | * Things are broadly separated below by clock domains. It is |
| 48 | * noteworthy that most periferals have dependencies on multiple clock | 45 | * noteworthy that most peripherals have dependencies on multiple clock |
| 49 | * domains. Many get their interface clocks from the L4 domain, but get | 46 | * domains. Many get their interface clocks from the L4 domain, but get |
| 50 | * functional clocks from fixed sources or other core domain derived | 47 | * functional clocks from fixed sources or other core domain derived |
| 51 | * clocks. | 48 | * clocks. |
| @@ -55,7 +52,7 @@ | |||
| 55 | static struct clk func_32k_ck = { | 52 | static struct clk func_32k_ck = { |
| 56 | .name = "func_32k_ck", | 53 | .name = "func_32k_ck", |
| 57 | .ops = &clkops_null, | 54 | .ops = &clkops_null, |
| 58 | .rate = 32000, | 55 | .rate = 32768, |
| 59 | .clkdm_name = "wkup_clkdm", | 56 | .clkdm_name = "wkup_clkdm", |
| 60 | }; | 57 | }; |
| 61 | 58 | ||
| @@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = { | |||
| 116 | .max_multiplier = 1023, | 113 | .max_multiplier = 1023, |
| 117 | .min_divider = 1, | 114 | .min_divider = 1, |
| 118 | .max_divider = 16, | 115 | .max_divider = 16, |
| 119 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
| 120 | }; | 116 | }; |
| 121 | 117 | ||
| 122 | /* | 118 | /* |
| @@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = { | |||
| 125 | */ | 121 | */ |
| 126 | static struct clk dpll_ck = { | 122 | static struct clk dpll_ck = { |
| 127 | .name = "dpll_ck", | 123 | .name = "dpll_ck", |
| 128 | .ops = &clkops_null, | 124 | .ops = &clkops_omap2xxx_dpll_ops, |
| 129 | .parent = &sys_ck, /* Can be func_32k also */ | 125 | .parent = &sys_ck, /* Can be func_32k also */ |
| 130 | .dpll_data = &dpll_dd, | 126 | .dpll_data = &dpll_dd, |
| 131 | .clkdm_name = "wkup_clkdm", | 127 | .clkdm_name = "wkup_clkdm", |
| @@ -434,37 +430,23 @@ static struct clk dsp_fck = { | |||
| 434 | .recalc = &omap2_clksel_recalc, | 430 | .recalc = &omap2_clksel_recalc, |
| 435 | }; | 431 | }; |
| 436 | 432 | ||
| 437 | /* DSP interface clock */ | 433 | static const struct clksel dsp_ick_clksel[] = { |
| 438 | static const struct clksel_rate dsp_irate_ick_rates[] = { | 434 | { .parent = &dsp_fck, .rates = dsp_ick_rates }, |
| 439 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
| 440 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
| 441 | { .div = 3, .val = 3, .flags = RATE_IN_243X }, | ||
| 442 | { .div = 0 }, | ||
| 443 | }; | ||
| 444 | |||
| 445 | static const struct clksel dsp_irate_ick_clksel[] = { | ||
| 446 | { .parent = &dsp_fck, .rates = dsp_irate_ick_rates }, | ||
| 447 | { .parent = NULL } | 435 | { .parent = NULL } |
| 448 | }; | 436 | }; |
| 449 | 437 | ||
| 450 | /* This clock does not exist as such in the TRM. */ | ||
| 451 | static struct clk dsp_irate_ick = { | ||
| 452 | .name = "dsp_irate_ick", | ||
| 453 | .ops = &clkops_null, | ||
| 454 | .parent = &dsp_fck, | ||
| 455 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
| 456 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
| 457 | .clksel = dsp_irate_ick_clksel, | ||
| 458 | .recalc = &omap2_clksel_recalc, | ||
| 459 | }; | ||
| 460 | |||
| 461 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ | 438 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ |
| 462 | static struct clk iva2_1_ick = { | 439 | static struct clk iva2_1_ick = { |
| 463 | .name = "iva2_1_ick", | 440 | .name = "iva2_1_ick", |
| 464 | .ops = &clkops_omap2_dflt_wait, | 441 | .ops = &clkops_omap2_dflt_wait, |
| 465 | .parent = &dsp_irate_ick, | 442 | .parent = &dsp_fck, |
| 443 | .clkdm_name = "dsp_clkdm", | ||
| 466 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 444 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
| 467 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, | 445 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
| 446 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
| 447 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
| 448 | .clksel = dsp_ick_clksel, | ||
| 449 | .recalc = &omap2_clksel_recalc, | ||
| 468 | }; | 450 | }; |
| 469 | 451 | ||
| 470 | /* | 452 | /* |
| @@ -525,7 +507,7 @@ static const struct clksel usb_l4_ick_clksel[] = { | |||
| 525 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ | 507 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ |
| 526 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ | 508 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ |
| 527 | .name = "usb_l4_ick", | 509 | .name = "usb_l4_ick", |
| 528 | .ops = &clkops_omap2_dflt_wait, | 510 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 529 | .parent = &core_l3_ck, | 511 | .parent = &core_l3_ck, |
| 530 | .clkdm_name = "core_l4_clkdm", | 512 | .clkdm_name = "core_l4_clkdm", |
| 531 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 513 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -606,7 +588,7 @@ static struct clk ssi_ssr_sst_fck = { | |||
| 606 | */ | 588 | */ |
| 607 | static struct clk ssi_l4_ick = { | 589 | static struct clk ssi_l4_ick = { |
| 608 | .name = "ssi_l4_ick", | 590 | .name = "ssi_l4_ick", |
| 609 | .ops = &clkops_omap2_dflt_wait, | 591 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 610 | .parent = &l4_ck, | 592 | .parent = &l4_ck, |
| 611 | .clkdm_name = "core_l4_clkdm", | 593 | .clkdm_name = "core_l4_clkdm", |
| 612 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 594 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -661,6 +643,7 @@ static struct clk gfx_2d_fck = { | |||
| 661 | .recalc = &omap2_clksel_recalc, | 643 | .recalc = &omap2_clksel_recalc, |
| 662 | }; | 644 | }; |
| 663 | 645 | ||
| 646 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
| 664 | static struct clk gfx_ick = { | 647 | static struct clk gfx_ick = { |
| 665 | .name = "gfx_ick", /* From l3 */ | 648 | .name = "gfx_ick", /* From l3 */ |
| 666 | .ops = &clkops_omap2_dflt_wait, | 649 | .ops = &clkops_omap2_dflt_wait, |
| @@ -693,7 +676,7 @@ static const struct clksel mdm_ick_clksel[] = { | |||
| 693 | 676 | ||
| 694 | static struct clk mdm_ick = { /* used both as a ick and fck */ | 677 | static struct clk mdm_ick = { /* used both as a ick and fck */ |
| 695 | .name = "mdm_ick", | 678 | .name = "mdm_ick", |
| 696 | .ops = &clkops_omap2_dflt_wait, | 679 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 697 | .parent = &core_ck, | 680 | .parent = &core_ck, |
| 698 | .clkdm_name = "mdm_clkdm", | 681 | .clkdm_name = "mdm_clkdm", |
| 699 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), | 682 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), |
| @@ -706,7 +689,7 @@ static struct clk mdm_ick = { /* used both as a ick and fck */ | |||
| 706 | 689 | ||
| 707 | static struct clk mdm_osc_ck = { | 690 | static struct clk mdm_osc_ck = { |
| 708 | .name = "mdm_osc_ck", | 691 | .name = "mdm_osc_ck", |
| 709 | .ops = &clkops_omap2_dflt_wait, | 692 | .ops = &clkops_omap2_mdmclk_dflt_wait, |
| 710 | .parent = &osc_ck, | 693 | .parent = &osc_ck, |
| 711 | .clkdm_name = "mdm_clkdm", | 694 | .clkdm_name = "mdm_clkdm", |
| 712 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), | 695 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), |
| @@ -751,7 +734,7 @@ static const struct clksel dss1_fck_clksel[] = { | |||
| 751 | 734 | ||
| 752 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ | 735 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ |
| 753 | .name = "dss_ick", | 736 | .name = "dss_ick", |
| 754 | .ops = &clkops_omap2_dflt, | 737 | .ops = &clkops_omap2_iclk_dflt, |
| 755 | .parent = &l4_ck, /* really both l3 and l4 */ | 738 | .parent = &l4_ck, /* really both l3 and l4 */ |
| 756 | .clkdm_name = "dss_clkdm", | 739 | .clkdm_name = "dss_clkdm", |
| 757 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 740 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -813,6 +796,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */ | |||
| 813 | .recalc = &followparent_recalc, | 796 | .recalc = &followparent_recalc, |
| 814 | }; | 797 | }; |
| 815 | 798 | ||
| 799 | static struct clk wu_l4_ick = { | ||
| 800 | .name = "wu_l4_ick", | ||
| 801 | .ops = &clkops_null, | ||
| 802 | .parent = &sys_ck, | ||
| 803 | .clkdm_name = "wkup_clkdm", | ||
| 804 | .recalc = &followparent_recalc, | ||
| 805 | }; | ||
| 806 | |||
| 816 | /* | 807 | /* |
| 817 | * CORE power domain ICLK & FCLK defines. | 808 | * CORE power domain ICLK & FCLK defines. |
| 818 | * Many of the these can have more than one possible parent. Entries | 809 | * Many of the these can have more than one possible parent. Entries |
| @@ -833,9 +824,9 @@ static const struct clksel omap24xx_gpt_clksel[] = { | |||
| 833 | 824 | ||
| 834 | static struct clk gpt1_ick = { | 825 | static struct clk gpt1_ick = { |
| 835 | .name = "gpt1_ick", | 826 | .name = "gpt1_ick", |
| 836 | .ops = &clkops_omap2_dflt_wait, | 827 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 837 | .parent = &l4_ck, | 828 | .parent = &wu_l4_ick, |
| 838 | .clkdm_name = "core_l4_clkdm", | 829 | .clkdm_name = "wkup_clkdm", |
| 839 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 830 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 840 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | 831 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
| 841 | .recalc = &followparent_recalc, | 832 | .recalc = &followparent_recalc, |
| @@ -859,7 +850,7 @@ static struct clk gpt1_fck = { | |||
| 859 | 850 | ||
| 860 | static struct clk gpt2_ick = { | 851 | static struct clk gpt2_ick = { |
| 861 | .name = "gpt2_ick", | 852 | .name = "gpt2_ick", |
| 862 | .ops = &clkops_omap2_dflt_wait, | 853 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 863 | .parent = &l4_ck, | 854 | .parent = &l4_ck, |
| 864 | .clkdm_name = "core_l4_clkdm", | 855 | .clkdm_name = "core_l4_clkdm", |
| 865 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 856 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -883,7 +874,7 @@ static struct clk gpt2_fck = { | |||
| 883 | 874 | ||
| 884 | static struct clk gpt3_ick = { | 875 | static struct clk gpt3_ick = { |
| 885 | .name = "gpt3_ick", | 876 | .name = "gpt3_ick", |
| 886 | .ops = &clkops_omap2_dflt_wait, | 877 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 887 | .parent = &l4_ck, | 878 | .parent = &l4_ck, |
| 888 | .clkdm_name = "core_l4_clkdm", | 879 | .clkdm_name = "core_l4_clkdm", |
| 889 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 880 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -907,7 +898,7 @@ static struct clk gpt3_fck = { | |||
| 907 | 898 | ||
| 908 | static struct clk gpt4_ick = { | 899 | static struct clk gpt4_ick = { |
| 909 | .name = "gpt4_ick", | 900 | .name = "gpt4_ick", |
| 910 | .ops = &clkops_omap2_dflt_wait, | 901 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 911 | .parent = &l4_ck, | 902 | .parent = &l4_ck, |
| 912 | .clkdm_name = "core_l4_clkdm", | 903 | .clkdm_name = "core_l4_clkdm", |
| 913 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 904 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -931,7 +922,7 @@ static struct clk gpt4_fck = { | |||
| 931 | 922 | ||
| 932 | static struct clk gpt5_ick = { | 923 | static struct clk gpt5_ick = { |
| 933 | .name = "gpt5_ick", | 924 | .name = "gpt5_ick", |
| 934 | .ops = &clkops_omap2_dflt_wait, | 925 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 935 | .parent = &l4_ck, | 926 | .parent = &l4_ck, |
| 936 | .clkdm_name = "core_l4_clkdm", | 927 | .clkdm_name = "core_l4_clkdm", |
| 937 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 928 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -955,7 +946,7 @@ static struct clk gpt5_fck = { | |||
| 955 | 946 | ||
| 956 | static struct clk gpt6_ick = { | 947 | static struct clk gpt6_ick = { |
| 957 | .name = "gpt6_ick", | 948 | .name = "gpt6_ick", |
| 958 | .ops = &clkops_omap2_dflt_wait, | 949 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 959 | .parent = &l4_ck, | 950 | .parent = &l4_ck, |
| 960 | .clkdm_name = "core_l4_clkdm", | 951 | .clkdm_name = "core_l4_clkdm", |
| 961 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 952 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -979,8 +970,9 @@ static struct clk gpt6_fck = { | |||
| 979 | 970 | ||
| 980 | static struct clk gpt7_ick = { | 971 | static struct clk gpt7_ick = { |
| 981 | .name = "gpt7_ick", | 972 | .name = "gpt7_ick", |
| 982 | .ops = &clkops_omap2_dflt_wait, | 973 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 983 | .parent = &l4_ck, | 974 | .parent = &l4_ck, |
| 975 | .clkdm_name = "core_l4_clkdm", | ||
| 984 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 976 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 985 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | 977 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
| 986 | .recalc = &followparent_recalc, | 978 | .recalc = &followparent_recalc, |
| @@ -1002,7 +994,7 @@ static struct clk gpt7_fck = { | |||
| 1002 | 994 | ||
| 1003 | static struct clk gpt8_ick = { | 995 | static struct clk gpt8_ick = { |
| 1004 | .name = "gpt8_ick", | 996 | .name = "gpt8_ick", |
| 1005 | .ops = &clkops_omap2_dflt_wait, | 997 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1006 | .parent = &l4_ck, | 998 | .parent = &l4_ck, |
| 1007 | .clkdm_name = "core_l4_clkdm", | 999 | .clkdm_name = "core_l4_clkdm", |
| 1008 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1000 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1026,7 +1018,7 @@ static struct clk gpt8_fck = { | |||
| 1026 | 1018 | ||
| 1027 | static struct clk gpt9_ick = { | 1019 | static struct clk gpt9_ick = { |
| 1028 | .name = "gpt9_ick", | 1020 | .name = "gpt9_ick", |
| 1029 | .ops = &clkops_omap2_dflt_wait, | 1021 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1030 | .parent = &l4_ck, | 1022 | .parent = &l4_ck, |
| 1031 | .clkdm_name = "core_l4_clkdm", | 1023 | .clkdm_name = "core_l4_clkdm", |
| 1032 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1024 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1050,7 +1042,7 @@ static struct clk gpt9_fck = { | |||
| 1050 | 1042 | ||
| 1051 | static struct clk gpt10_ick = { | 1043 | static struct clk gpt10_ick = { |
| 1052 | .name = "gpt10_ick", | 1044 | .name = "gpt10_ick", |
| 1053 | .ops = &clkops_omap2_dflt_wait, | 1045 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1054 | .parent = &l4_ck, | 1046 | .parent = &l4_ck, |
| 1055 | .clkdm_name = "core_l4_clkdm", | 1047 | .clkdm_name = "core_l4_clkdm", |
| 1056 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1048 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1074,7 +1066,7 @@ static struct clk gpt10_fck = { | |||
| 1074 | 1066 | ||
| 1075 | static struct clk gpt11_ick = { | 1067 | static struct clk gpt11_ick = { |
| 1076 | .name = "gpt11_ick", | 1068 | .name = "gpt11_ick", |
| 1077 | .ops = &clkops_omap2_dflt_wait, | 1069 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1078 | .parent = &l4_ck, | 1070 | .parent = &l4_ck, |
| 1079 | .clkdm_name = "core_l4_clkdm", | 1071 | .clkdm_name = "core_l4_clkdm", |
| 1080 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1072 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1098,7 +1090,7 @@ static struct clk gpt11_fck = { | |||
| 1098 | 1090 | ||
| 1099 | static struct clk gpt12_ick = { | 1091 | static struct clk gpt12_ick = { |
| 1100 | .name = "gpt12_ick", | 1092 | .name = "gpt12_ick", |
| 1101 | .ops = &clkops_omap2_dflt_wait, | 1093 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1102 | .parent = &l4_ck, | 1094 | .parent = &l4_ck, |
| 1103 | .clkdm_name = "core_l4_clkdm", | 1095 | .clkdm_name = "core_l4_clkdm", |
| 1104 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1096 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1122,7 +1114,7 @@ static struct clk gpt12_fck = { | |||
| 1122 | 1114 | ||
| 1123 | static struct clk mcbsp1_ick = { | 1115 | static struct clk mcbsp1_ick = { |
| 1124 | .name = "mcbsp1_ick", | 1116 | .name = "mcbsp1_ick", |
| 1125 | .ops = &clkops_omap2_dflt_wait, | 1117 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1126 | .parent = &l4_ck, | 1118 | .parent = &l4_ck, |
| 1127 | .clkdm_name = "core_l4_clkdm", | 1119 | .clkdm_name = "core_l4_clkdm", |
| 1128 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1120 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1162,7 +1154,7 @@ static struct clk mcbsp1_fck = { | |||
| 1162 | 1154 | ||
| 1163 | static struct clk mcbsp2_ick = { | 1155 | static struct clk mcbsp2_ick = { |
| 1164 | .name = "mcbsp2_ick", | 1156 | .name = "mcbsp2_ick", |
| 1165 | .ops = &clkops_omap2_dflt_wait, | 1157 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1166 | .parent = &l4_ck, | 1158 | .parent = &l4_ck, |
| 1167 | .clkdm_name = "core_l4_clkdm", | 1159 | .clkdm_name = "core_l4_clkdm", |
| 1168 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1160 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1186,7 +1178,7 @@ static struct clk mcbsp2_fck = { | |||
| 1186 | 1178 | ||
| 1187 | static struct clk mcbsp3_ick = { | 1179 | static struct clk mcbsp3_ick = { |
| 1188 | .name = "mcbsp3_ick", | 1180 | .name = "mcbsp3_ick", |
| 1189 | .ops = &clkops_omap2_dflt_wait, | 1181 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1190 | .parent = &l4_ck, | 1182 | .parent = &l4_ck, |
| 1191 | .clkdm_name = "core_l4_clkdm", | 1183 | .clkdm_name = "core_l4_clkdm", |
| 1192 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1184 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1210,7 +1202,7 @@ static struct clk mcbsp3_fck = { | |||
| 1210 | 1202 | ||
| 1211 | static struct clk mcbsp4_ick = { | 1203 | static struct clk mcbsp4_ick = { |
| 1212 | .name = "mcbsp4_ick", | 1204 | .name = "mcbsp4_ick", |
| 1213 | .ops = &clkops_omap2_dflt_wait, | 1205 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1214 | .parent = &l4_ck, | 1206 | .parent = &l4_ck, |
| 1215 | .clkdm_name = "core_l4_clkdm", | 1207 | .clkdm_name = "core_l4_clkdm", |
| 1216 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1208 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1234,7 +1226,7 @@ static struct clk mcbsp4_fck = { | |||
| 1234 | 1226 | ||
| 1235 | static struct clk mcbsp5_ick = { | 1227 | static struct clk mcbsp5_ick = { |
| 1236 | .name = "mcbsp5_ick", | 1228 | .name = "mcbsp5_ick", |
| 1237 | .ops = &clkops_omap2_dflt_wait, | 1229 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1238 | .parent = &l4_ck, | 1230 | .parent = &l4_ck, |
| 1239 | .clkdm_name = "core_l4_clkdm", | 1231 | .clkdm_name = "core_l4_clkdm", |
| 1240 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1232 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1258,7 +1250,7 @@ static struct clk mcbsp5_fck = { | |||
| 1258 | 1250 | ||
| 1259 | static struct clk mcspi1_ick = { | 1251 | static struct clk mcspi1_ick = { |
| 1260 | .name = "mcspi1_ick", | 1252 | .name = "mcspi1_ick", |
| 1261 | .ops = &clkops_omap2_dflt_wait, | 1253 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1262 | .parent = &l4_ck, | 1254 | .parent = &l4_ck, |
| 1263 | .clkdm_name = "core_l4_clkdm", | 1255 | .clkdm_name = "core_l4_clkdm", |
| 1264 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1256 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1278,7 +1270,7 @@ static struct clk mcspi1_fck = { | |||
| 1278 | 1270 | ||
| 1279 | static struct clk mcspi2_ick = { | 1271 | static struct clk mcspi2_ick = { |
| 1280 | .name = "mcspi2_ick", | 1272 | .name = "mcspi2_ick", |
| 1281 | .ops = &clkops_omap2_dflt_wait, | 1273 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1282 | .parent = &l4_ck, | 1274 | .parent = &l4_ck, |
| 1283 | .clkdm_name = "core_l4_clkdm", | 1275 | .clkdm_name = "core_l4_clkdm", |
| 1284 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1276 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1298,7 +1290,7 @@ static struct clk mcspi2_fck = { | |||
| 1298 | 1290 | ||
| 1299 | static struct clk mcspi3_ick = { | 1291 | static struct clk mcspi3_ick = { |
| 1300 | .name = "mcspi3_ick", | 1292 | .name = "mcspi3_ick", |
| 1301 | .ops = &clkops_omap2_dflt_wait, | 1293 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1302 | .parent = &l4_ck, | 1294 | .parent = &l4_ck, |
| 1303 | .clkdm_name = "core_l4_clkdm", | 1295 | .clkdm_name = "core_l4_clkdm", |
| 1304 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1296 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1318,7 +1310,7 @@ static struct clk mcspi3_fck = { | |||
| 1318 | 1310 | ||
| 1319 | static struct clk uart1_ick = { | 1311 | static struct clk uart1_ick = { |
| 1320 | .name = "uart1_ick", | 1312 | .name = "uart1_ick", |
| 1321 | .ops = &clkops_omap2_dflt_wait, | 1313 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1322 | .parent = &l4_ck, | 1314 | .parent = &l4_ck, |
| 1323 | .clkdm_name = "core_l4_clkdm", | 1315 | .clkdm_name = "core_l4_clkdm", |
| 1324 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1316 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1338,7 +1330,7 @@ static struct clk uart1_fck = { | |||
| 1338 | 1330 | ||
| 1339 | static struct clk uart2_ick = { | 1331 | static struct clk uart2_ick = { |
| 1340 | .name = "uart2_ick", | 1332 | .name = "uart2_ick", |
| 1341 | .ops = &clkops_omap2_dflt_wait, | 1333 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1342 | .parent = &l4_ck, | 1334 | .parent = &l4_ck, |
| 1343 | .clkdm_name = "core_l4_clkdm", | 1335 | .clkdm_name = "core_l4_clkdm", |
| 1344 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1336 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1358,7 +1350,7 @@ static struct clk uart2_fck = { | |||
| 1358 | 1350 | ||
| 1359 | static struct clk uart3_ick = { | 1351 | static struct clk uart3_ick = { |
| 1360 | .name = "uart3_ick", | 1352 | .name = "uart3_ick", |
| 1361 | .ops = &clkops_omap2_dflt_wait, | 1353 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1362 | .parent = &l4_ck, | 1354 | .parent = &l4_ck, |
| 1363 | .clkdm_name = "core_l4_clkdm", | 1355 | .clkdm_name = "core_l4_clkdm", |
| 1364 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1356 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1378,9 +1370,9 @@ static struct clk uart3_fck = { | |||
| 1378 | 1370 | ||
| 1379 | static struct clk gpios_ick = { | 1371 | static struct clk gpios_ick = { |
| 1380 | .name = "gpios_ick", | 1372 | .name = "gpios_ick", |
| 1381 | .ops = &clkops_omap2_dflt_wait, | 1373 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1382 | .parent = &l4_ck, | 1374 | .parent = &wu_l4_ick, |
| 1383 | .clkdm_name = "core_l4_clkdm", | 1375 | .clkdm_name = "wkup_clkdm", |
| 1384 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1376 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1385 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | 1377 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
| 1386 | .recalc = &followparent_recalc, | 1378 | .recalc = &followparent_recalc, |
| @@ -1398,9 +1390,9 @@ static struct clk gpios_fck = { | |||
| 1398 | 1390 | ||
| 1399 | static struct clk mpu_wdt_ick = { | 1391 | static struct clk mpu_wdt_ick = { |
| 1400 | .name = "mpu_wdt_ick", | 1392 | .name = "mpu_wdt_ick", |
| 1401 | .ops = &clkops_omap2_dflt_wait, | 1393 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1402 | .parent = &l4_ck, | 1394 | .parent = &wu_l4_ick, |
| 1403 | .clkdm_name = "core_l4_clkdm", | 1395 | .clkdm_name = "wkup_clkdm", |
| 1404 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1396 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1405 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | 1397 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
| 1406 | .recalc = &followparent_recalc, | 1398 | .recalc = &followparent_recalc, |
| @@ -1418,10 +1410,10 @@ static struct clk mpu_wdt_fck = { | |||
| 1418 | 1410 | ||
| 1419 | static struct clk sync_32k_ick = { | 1411 | static struct clk sync_32k_ick = { |
| 1420 | .name = "sync_32k_ick", | 1412 | .name = "sync_32k_ick", |
| 1421 | .ops = &clkops_omap2_dflt_wait, | 1413 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1422 | .parent = &l4_ck, | ||
| 1423 | .flags = ENABLE_ON_INIT, | 1414 | .flags = ENABLE_ON_INIT, |
| 1424 | .clkdm_name = "core_l4_clkdm", | 1415 | .parent = &wu_l4_ick, |
| 1416 | .clkdm_name = "wkup_clkdm", | ||
| 1425 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1417 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1426 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, | 1418 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, |
| 1427 | .recalc = &followparent_recalc, | 1419 | .recalc = &followparent_recalc, |
| @@ -1429,9 +1421,9 @@ static struct clk sync_32k_ick = { | |||
| 1429 | 1421 | ||
| 1430 | static struct clk wdt1_ick = { | 1422 | static struct clk wdt1_ick = { |
| 1431 | .name = "wdt1_ick", | 1423 | .name = "wdt1_ick", |
| 1432 | .ops = &clkops_omap2_dflt_wait, | 1424 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1433 | .parent = &l4_ck, | 1425 | .parent = &wu_l4_ick, |
| 1434 | .clkdm_name = "core_l4_clkdm", | 1426 | .clkdm_name = "wkup_clkdm", |
| 1435 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1427 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1436 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, | 1428 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, |
| 1437 | .recalc = &followparent_recalc, | 1429 | .recalc = &followparent_recalc, |
| @@ -1439,10 +1431,10 @@ static struct clk wdt1_ick = { | |||
| 1439 | 1431 | ||
| 1440 | static struct clk omapctrl_ick = { | 1432 | static struct clk omapctrl_ick = { |
| 1441 | .name = "omapctrl_ick", | 1433 | .name = "omapctrl_ick", |
| 1442 | .ops = &clkops_omap2_dflt_wait, | 1434 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1443 | .parent = &l4_ck, | ||
| 1444 | .flags = ENABLE_ON_INIT, | 1435 | .flags = ENABLE_ON_INIT, |
| 1445 | .clkdm_name = "core_l4_clkdm", | 1436 | .parent = &wu_l4_ick, |
| 1437 | .clkdm_name = "wkup_clkdm", | ||
| 1446 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1438 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1447 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, | 1439 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, |
| 1448 | .recalc = &followparent_recalc, | 1440 | .recalc = &followparent_recalc, |
| @@ -1450,9 +1442,9 @@ static struct clk omapctrl_ick = { | |||
| 1450 | 1442 | ||
| 1451 | static struct clk icr_ick = { | 1443 | static struct clk icr_ick = { |
| 1452 | .name = "icr_ick", | 1444 | .name = "icr_ick", |
| 1453 | .ops = &clkops_omap2_dflt_wait, | 1445 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1454 | .parent = &l4_ck, | 1446 | .parent = &wu_l4_ick, |
| 1455 | .clkdm_name = "core_l4_clkdm", | 1447 | .clkdm_name = "wkup_clkdm", |
| 1456 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 1448 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1457 | .enable_bit = OMAP2430_EN_ICR_SHIFT, | 1449 | .enable_bit = OMAP2430_EN_ICR_SHIFT, |
| 1458 | .recalc = &followparent_recalc, | 1450 | .recalc = &followparent_recalc, |
| @@ -1460,7 +1452,7 @@ static struct clk icr_ick = { | |||
| 1460 | 1452 | ||
| 1461 | static struct clk cam_ick = { | 1453 | static struct clk cam_ick = { |
| 1462 | .name = "cam_ick", | 1454 | .name = "cam_ick", |
| 1463 | .ops = &clkops_omap2_dflt, | 1455 | .ops = &clkops_omap2_iclk_dflt, |
| 1464 | .parent = &l4_ck, | 1456 | .parent = &l4_ck, |
| 1465 | .clkdm_name = "core_l4_clkdm", | 1457 | .clkdm_name = "core_l4_clkdm", |
| 1466 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1458 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1485,7 +1477,7 @@ static struct clk cam_fck = { | |||
| 1485 | 1477 | ||
| 1486 | static struct clk mailboxes_ick = { | 1478 | static struct clk mailboxes_ick = { |
| 1487 | .name = "mailboxes_ick", | 1479 | .name = "mailboxes_ick", |
| 1488 | .ops = &clkops_omap2_dflt_wait, | 1480 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1489 | .parent = &l4_ck, | 1481 | .parent = &l4_ck, |
| 1490 | .clkdm_name = "core_l4_clkdm", | 1482 | .clkdm_name = "core_l4_clkdm", |
| 1491 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1483 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1495,7 +1487,7 @@ static struct clk mailboxes_ick = { | |||
| 1495 | 1487 | ||
| 1496 | static struct clk wdt4_ick = { | 1488 | static struct clk wdt4_ick = { |
| 1497 | .name = "wdt4_ick", | 1489 | .name = "wdt4_ick", |
| 1498 | .ops = &clkops_omap2_dflt_wait, | 1490 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1499 | .parent = &l4_ck, | 1491 | .parent = &l4_ck, |
| 1500 | .clkdm_name = "core_l4_clkdm", | 1492 | .clkdm_name = "core_l4_clkdm", |
| 1501 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1493 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1515,7 +1507,7 @@ static struct clk wdt4_fck = { | |||
| 1515 | 1507 | ||
| 1516 | static struct clk mspro_ick = { | 1508 | static struct clk mspro_ick = { |
| 1517 | .name = "mspro_ick", | 1509 | .name = "mspro_ick", |
| 1518 | .ops = &clkops_omap2_dflt_wait, | 1510 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1519 | .parent = &l4_ck, | 1511 | .parent = &l4_ck, |
| 1520 | .clkdm_name = "core_l4_clkdm", | 1512 | .clkdm_name = "core_l4_clkdm", |
| 1521 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1513 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1535,7 +1527,7 @@ static struct clk mspro_fck = { | |||
| 1535 | 1527 | ||
| 1536 | static struct clk fac_ick = { | 1528 | static struct clk fac_ick = { |
| 1537 | .name = "fac_ick", | 1529 | .name = "fac_ick", |
| 1538 | .ops = &clkops_omap2_dflt_wait, | 1530 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1539 | .parent = &l4_ck, | 1531 | .parent = &l4_ck, |
| 1540 | .clkdm_name = "core_l4_clkdm", | 1532 | .clkdm_name = "core_l4_clkdm", |
| 1541 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1533 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1555,7 +1547,7 @@ static struct clk fac_fck = { | |||
| 1555 | 1547 | ||
| 1556 | static struct clk hdq_ick = { | 1548 | static struct clk hdq_ick = { |
| 1557 | .name = "hdq_ick", | 1549 | .name = "hdq_ick", |
| 1558 | .ops = &clkops_omap2_dflt_wait, | 1550 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1559 | .parent = &l4_ck, | 1551 | .parent = &l4_ck, |
| 1560 | .clkdm_name = "core_l4_clkdm", | 1552 | .clkdm_name = "core_l4_clkdm", |
| 1561 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1553 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1579,7 +1571,7 @@ static struct clk hdq_fck = { | |||
| 1579 | */ | 1571 | */ |
| 1580 | static struct clk i2c2_ick = { | 1572 | static struct clk i2c2_ick = { |
| 1581 | .name = "i2c2_ick", | 1573 | .name = "i2c2_ick", |
| 1582 | .ops = &clkops_omap2_dflt_wait, | 1574 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1583 | .parent = &l4_ck, | 1575 | .parent = &l4_ck, |
| 1584 | .clkdm_name = "core_l4_clkdm", | 1576 | .clkdm_name = "core_l4_clkdm", |
| 1585 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1577 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1603,7 +1595,7 @@ static struct clk i2chs2_fck = { | |||
| 1603 | */ | 1595 | */ |
| 1604 | static struct clk i2c1_ick = { | 1596 | static struct clk i2c1_ick = { |
| 1605 | .name = "i2c1_ick", | 1597 | .name = "i2c1_ick", |
| 1606 | .ops = &clkops_omap2_dflt_wait, | 1598 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1607 | .parent = &l4_ck, | 1599 | .parent = &l4_ck, |
| 1608 | .clkdm_name = "core_l4_clkdm", | 1600 | .clkdm_name = "core_l4_clkdm", |
| 1609 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1601 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -1621,12 +1613,18 @@ static struct clk i2chs1_fck = { | |||
| 1621 | .recalc = &followparent_recalc, | 1613 | .recalc = &followparent_recalc, |
| 1622 | }; | 1614 | }; |
| 1623 | 1615 | ||
| 1616 | /* | ||
| 1617 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
| 1618 | * accesses derived from this data. | ||
| 1619 | */ | ||
| 1624 | static struct clk gpmc_fck = { | 1620 | static struct clk gpmc_fck = { |
| 1625 | .name = "gpmc_fck", | 1621 | .name = "gpmc_fck", |
| 1626 | .ops = &clkops_null, /* RMK: missing? */ | 1622 | .ops = &clkops_omap2_iclk_idle_only, |
| 1627 | .parent = &core_l3_ck, | 1623 | .parent = &core_l3_ck, |
| 1628 | .flags = ENABLE_ON_INIT, | 1624 | .flags = ENABLE_ON_INIT, |
| 1629 | .clkdm_name = "core_l3_clkdm", | 1625 | .clkdm_name = "core_l3_clkdm", |
| 1626 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
| 1627 | .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT, | ||
| 1630 | .recalc = &followparent_recalc, | 1628 | .recalc = &followparent_recalc, |
| 1631 | }; | 1629 | }; |
| 1632 | 1630 | ||
| @@ -1638,20 +1636,26 @@ static struct clk sdma_fck = { | |||
| 1638 | .recalc = &followparent_recalc, | 1636 | .recalc = &followparent_recalc, |
| 1639 | }; | 1637 | }; |
| 1640 | 1638 | ||
| 1639 | /* | ||
| 1640 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE | ||
| 1641 | * accesses derived from this data. | ||
| 1642 | */ | ||
| 1641 | static struct clk sdma_ick = { | 1643 | static struct clk sdma_ick = { |
| 1642 | .name = "sdma_ick", | 1644 | .name = "sdma_ick", |
| 1643 | .ops = &clkops_null, /* RMK: missing? */ | 1645 | .ops = &clkops_omap2_iclk_idle_only, |
| 1644 | .parent = &l4_ck, | 1646 | .parent = &core_l3_ck, |
| 1645 | .clkdm_name = "core_l3_clkdm", | 1647 | .clkdm_name = "core_l3_clkdm", |
| 1648 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | ||
| 1649 | .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT, | ||
| 1646 | .recalc = &followparent_recalc, | 1650 | .recalc = &followparent_recalc, |
| 1647 | }; | 1651 | }; |
| 1648 | 1652 | ||
| 1649 | static struct clk sdrc_ick = { | 1653 | static struct clk sdrc_ick = { |
| 1650 | .name = "sdrc_ick", | 1654 | .name = "sdrc_ick", |
| 1651 | .ops = &clkops_omap2_dflt_wait, | 1655 | .ops = &clkops_omap2_iclk_idle_only, |
| 1652 | .parent = &l4_ck, | 1656 | .parent = &core_l3_ck, |
| 1653 | .flags = ENABLE_ON_INIT, | 1657 | .flags = ENABLE_ON_INIT, |
| 1654 | .clkdm_name = "core_l4_clkdm", | 1658 | .clkdm_name = "core_l3_clkdm", |
| 1655 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 1659 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
| 1656 | .enable_bit = OMAP2430_EN_SDRC_SHIFT, | 1660 | .enable_bit = OMAP2430_EN_SDRC_SHIFT, |
| 1657 | .recalc = &followparent_recalc, | 1661 | .recalc = &followparent_recalc, |
| @@ -1659,7 +1663,7 @@ static struct clk sdrc_ick = { | |||
| 1659 | 1663 | ||
| 1660 | static struct clk des_ick = { | 1664 | static struct clk des_ick = { |
| 1661 | .name = "des_ick", | 1665 | .name = "des_ick", |
| 1662 | .ops = &clkops_omap2_dflt_wait, | 1666 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1663 | .parent = &l4_ck, | 1667 | .parent = &l4_ck, |
| 1664 | .clkdm_name = "core_l4_clkdm", | 1668 | .clkdm_name = "core_l4_clkdm", |
| 1665 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1669 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1669,7 +1673,7 @@ static struct clk des_ick = { | |||
| 1669 | 1673 | ||
| 1670 | static struct clk sha_ick = { | 1674 | static struct clk sha_ick = { |
| 1671 | .name = "sha_ick", | 1675 | .name = "sha_ick", |
| 1672 | .ops = &clkops_omap2_dflt_wait, | 1676 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1673 | .parent = &l4_ck, | 1677 | .parent = &l4_ck, |
| 1674 | .clkdm_name = "core_l4_clkdm", | 1678 | .clkdm_name = "core_l4_clkdm", |
| 1675 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1679 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1679,7 +1683,7 @@ static struct clk sha_ick = { | |||
| 1679 | 1683 | ||
| 1680 | static struct clk rng_ick = { | 1684 | static struct clk rng_ick = { |
| 1681 | .name = "rng_ick", | 1685 | .name = "rng_ick", |
| 1682 | .ops = &clkops_omap2_dflt_wait, | 1686 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1683 | .parent = &l4_ck, | 1687 | .parent = &l4_ck, |
| 1684 | .clkdm_name = "core_l4_clkdm", | 1688 | .clkdm_name = "core_l4_clkdm", |
| 1685 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1689 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1689,7 +1693,7 @@ static struct clk rng_ick = { | |||
| 1689 | 1693 | ||
| 1690 | static struct clk aes_ick = { | 1694 | static struct clk aes_ick = { |
| 1691 | .name = "aes_ick", | 1695 | .name = "aes_ick", |
| 1692 | .ops = &clkops_omap2_dflt_wait, | 1696 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1693 | .parent = &l4_ck, | 1697 | .parent = &l4_ck, |
| 1694 | .clkdm_name = "core_l4_clkdm", | 1698 | .clkdm_name = "core_l4_clkdm", |
| 1695 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1699 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1699,7 +1703,7 @@ static struct clk aes_ick = { | |||
| 1699 | 1703 | ||
| 1700 | static struct clk pka_ick = { | 1704 | static struct clk pka_ick = { |
| 1701 | .name = "pka_ick", | 1705 | .name = "pka_ick", |
| 1702 | .ops = &clkops_omap2_dflt_wait, | 1706 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1703 | .parent = &l4_ck, | 1707 | .parent = &l4_ck, |
| 1704 | .clkdm_name = "core_l4_clkdm", | 1708 | .clkdm_name = "core_l4_clkdm", |
| 1705 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | 1709 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| @@ -1719,7 +1723,7 @@ static struct clk usb_fck = { | |||
| 1719 | 1723 | ||
| 1720 | static struct clk usbhs_ick = { | 1724 | static struct clk usbhs_ick = { |
| 1721 | .name = "usbhs_ick", | 1725 | .name = "usbhs_ick", |
| 1722 | .ops = &clkops_omap2_dflt_wait, | 1726 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1723 | .parent = &core_l3_ck, | 1727 | .parent = &core_l3_ck, |
| 1724 | .clkdm_name = "core_l3_clkdm", | 1728 | .clkdm_name = "core_l3_clkdm", |
| 1725 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1729 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1729,7 +1733,7 @@ static struct clk usbhs_ick = { | |||
| 1729 | 1733 | ||
| 1730 | static struct clk mmchs1_ick = { | 1734 | static struct clk mmchs1_ick = { |
| 1731 | .name = "mmchs1_ick", | 1735 | .name = "mmchs1_ick", |
| 1732 | .ops = &clkops_omap2_dflt_wait, | 1736 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1733 | .parent = &l4_ck, | 1737 | .parent = &l4_ck, |
| 1734 | .clkdm_name = "core_l4_clkdm", | 1738 | .clkdm_name = "core_l4_clkdm", |
| 1735 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1739 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1741,7 +1745,7 @@ static struct clk mmchs1_fck = { | |||
| 1741 | .name = "mmchs1_fck", | 1745 | .name = "mmchs1_fck", |
| 1742 | .ops = &clkops_omap2_dflt_wait, | 1746 | .ops = &clkops_omap2_dflt_wait, |
| 1743 | .parent = &func_96m_ck, | 1747 | .parent = &func_96m_ck, |
| 1744 | .clkdm_name = "core_l3_clkdm", | 1748 | .clkdm_name = "core_l4_clkdm", |
| 1745 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1749 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1746 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, | 1750 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, |
| 1747 | .recalc = &followparent_recalc, | 1751 | .recalc = &followparent_recalc, |
| @@ -1749,7 +1753,7 @@ static struct clk mmchs1_fck = { | |||
| 1749 | 1753 | ||
| 1750 | static struct clk mmchs2_ick = { | 1754 | static struct clk mmchs2_ick = { |
| 1751 | .name = "mmchs2_ick", | 1755 | .name = "mmchs2_ick", |
| 1752 | .ops = &clkops_omap2_dflt_wait, | 1756 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1753 | .parent = &l4_ck, | 1757 | .parent = &l4_ck, |
| 1754 | .clkdm_name = "core_l4_clkdm", | 1758 | .clkdm_name = "core_l4_clkdm", |
| 1755 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1759 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1761,6 +1765,7 @@ static struct clk mmchs2_fck = { | |||
| 1761 | .name = "mmchs2_fck", | 1765 | .name = "mmchs2_fck", |
| 1762 | .ops = &clkops_omap2_dflt_wait, | 1766 | .ops = &clkops_omap2_dflt_wait, |
| 1763 | .parent = &func_96m_ck, | 1767 | .parent = &func_96m_ck, |
| 1768 | .clkdm_name = "core_l4_clkdm", | ||
| 1764 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1769 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1765 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, | 1770 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, |
| 1766 | .recalc = &followparent_recalc, | 1771 | .recalc = &followparent_recalc, |
| @@ -1768,7 +1773,7 @@ static struct clk mmchs2_fck = { | |||
| 1768 | 1773 | ||
| 1769 | static struct clk gpio5_ick = { | 1774 | static struct clk gpio5_ick = { |
| 1770 | .name = "gpio5_ick", | 1775 | .name = "gpio5_ick", |
| 1771 | .ops = &clkops_omap2_dflt_wait, | 1776 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1772 | .parent = &l4_ck, | 1777 | .parent = &l4_ck, |
| 1773 | .clkdm_name = "core_l4_clkdm", | 1778 | .clkdm_name = "core_l4_clkdm", |
| 1774 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1779 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1788,7 +1793,7 @@ static struct clk gpio5_fck = { | |||
| 1788 | 1793 | ||
| 1789 | static struct clk mdm_intc_ick = { | 1794 | static struct clk mdm_intc_ick = { |
| 1790 | .name = "mdm_intc_ick", | 1795 | .name = "mdm_intc_ick", |
| 1791 | .ops = &clkops_omap2_dflt_wait, | 1796 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1792 | .parent = &l4_ck, | 1797 | .parent = &l4_ck, |
| 1793 | .clkdm_name = "core_l4_clkdm", | 1798 | .clkdm_name = "core_l4_clkdm", |
| 1794 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1799 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| @@ -1880,7 +1885,6 @@ static struct omap_clk omap2430_clks[] = { | |||
| 1880 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), | 1885 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), |
| 1881 | /* dsp domain clocks */ | 1886 | /* dsp domain clocks */ |
| 1882 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), | 1887 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), |
| 1883 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X), | ||
| 1884 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), | 1888 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), |
| 1885 | /* GFX domain clocks */ | 1889 | /* GFX domain clocks */ |
| 1886 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), | 1890 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), |
| @@ -1901,6 +1905,7 @@ static struct omap_clk omap2430_clks[] = { | |||
| 1901 | /* L4 domain clocks */ | 1905 | /* L4 domain clocks */ |
| 1902 | CLK(NULL, "l4_ck", &l4_ck, CK_243X), | 1906 | CLK(NULL, "l4_ck", &l4_ck, CK_243X), |
| 1903 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), | 1907 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), |
| 1908 | CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X), | ||
| 1904 | /* virtual meta-group clock */ | 1909 | /* virtual meta-group clock */ |
| 1905 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), | 1910 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), |
| 1906 | /* general l4 interface ck, multi-parent functional clk */ | 1911 | /* general l4 interface ck, multi-parent functional clk */ |
| @@ -1984,15 +1989,15 @@ static struct omap_clk omap2430_clks[] = { | |||
| 1984 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), | 1989 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), |
| 1985 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), | 1990 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), |
| 1986 | CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), | 1991 | CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), |
| 1987 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), | 1992 | CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X), |
| 1988 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), | 1993 | CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_243X), |
| 1989 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X), | 1994 | CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X), |
| 1990 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X), | 1995 | CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_243X), |
| 1991 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), | 1996 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), |
| 1992 | CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), | 1997 | CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), |
| 1993 | CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), | 1998 | CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), |
| 1994 | CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), | 1999 | CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), |
| 1995 | CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), | 2000 | CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), |
| 1996 | }; | 2001 | }; |
| 1997 | 2002 | ||
| 1998 | /* | 2003 | /* |
| @@ -2028,6 +2033,9 @@ int __init omap2430_clk_init(void) | |||
| 2028 | omap2_init_clk_clkdm(c->lk.clk); | 2033 | omap2_init_clk_clkdm(c->lk.clk); |
| 2029 | } | 2034 | } |
| 2030 | 2035 | ||
| 2036 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
| 2037 | omap_clk_disable_autoidle_all(); | ||
| 2038 | |||
| 2031 | /* Check the MPU rate set by bootloader */ | 2039 | /* Check the MPU rate set by bootloader */ |
| 2032 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); | 2040 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); |
| 2033 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | 2041 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
diff --git a/arch/arm/mach-omap2/clock2xxx.h b/arch/arm/mach-omap2/clock2xxx.h index cc5c8d422c5b..cb6df8ca9e4a 100644 --- a/arch/arm/mach-omap2/clock2xxx.h +++ b/arch/arm/mach-omap2/clock2xxx.h | |||
| @@ -23,13 +23,13 @@ void omap2xxx_clk_prepare_for_reboot(void); | |||
| 23 | #ifdef CONFIG_SOC_OMAP2420 | 23 | #ifdef CONFIG_SOC_OMAP2420 |
| 24 | int omap2420_clk_init(void); | 24 | int omap2420_clk_init(void); |
| 25 | #else | 25 | #else |
| 26 | #define omap2420_clk_init() 0 | 26 | #define omap2420_clk_init() do { } while(0) |
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | #ifdef CONFIG_SOC_OMAP2430 | 29 | #ifdef CONFIG_SOC_OMAP2430 |
| 30 | int omap2430_clk_init(void); | 30 | int omap2430_clk_init(void); |
| 31 | #else | 31 | #else |
| 32 | #define omap2430_clk_init() 0 | 32 | #define omap2430_clk_init() do { } while(0) |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; | 35 | extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; |
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index 287abc480924..1fc96b9ee330 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP3-specific clock framework functions | 2 | * OMAP3-specific clock framework functions |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Paul Walmsley | 7 | * Paul Walmsley |
| 8 | * Jouni Högander | 8 | * Jouni Högander |
| @@ -59,6 +59,15 @@ const struct clkops clkops_omap3430es2_ssi_wait = { | |||
| 59 | .find_companion = omap2_clk_dflt_find_companion, | 59 | .find_companion = omap2_clk_dflt_find_companion, |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | const struct clkops clkops_omap3430es2_iclk_ssi_wait = { | ||
| 63 | .enable = omap2_dflt_clk_enable, | ||
| 64 | .disable = omap2_dflt_clk_disable, | ||
| 65 | .find_idlest = omap3430es2_clk_ssi_find_idlest, | ||
| 66 | .find_companion = omap2_clk_dflt_find_companion, | ||
| 67 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 68 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 69 | }; | ||
| 70 | |||
| 62 | /** | 71 | /** |
| 63 | * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST | 72 | * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST |
| 64 | * @clk: struct clk * being enabled | 73 | * @clk: struct clk * being enabled |
| @@ -94,6 +103,15 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | |||
| 94 | .find_companion = omap2_clk_dflt_find_companion, | 103 | .find_companion = omap2_clk_dflt_find_companion, |
| 95 | }; | 104 | }; |
| 96 | 105 | ||
| 106 | const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait = { | ||
| 107 | .enable = omap2_dflt_clk_enable, | ||
| 108 | .disable = omap2_dflt_clk_disable, | ||
| 109 | .find_idlest = omap3430es2_clk_dss_usbhost_find_idlest, | ||
| 110 | .find_companion = omap2_clk_dflt_find_companion, | ||
| 111 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 112 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 113 | }; | ||
| 114 | |||
| 97 | /** | 115 | /** |
| 98 | * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB | 116 | * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB |
| 99 | * @clk: struct clk * being enabled | 117 | * @clk: struct clk * being enabled |
| @@ -124,3 +142,12 @@ const struct clkops clkops_omap3430es2_hsotgusb_wait = { | |||
| 124 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, | 142 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, |
| 125 | .find_companion = omap2_clk_dflt_find_companion, | 143 | .find_companion = omap2_clk_dflt_find_companion, |
| 126 | }; | 144 | }; |
| 145 | |||
| 146 | const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait = { | ||
| 147 | .enable = omap2_dflt_clk_enable, | ||
| 148 | .disable = omap2_dflt_clk_disable, | ||
| 149 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, | ||
| 150 | .find_companion = omap2_clk_dflt_find_companion, | ||
| 151 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 152 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 153 | }; | ||
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index 628e8de57680..084ba71b2b31 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
| @@ -2,14 +2,17 @@ | |||
| 2 | * OMAP34xx clock function prototypes and macros | 2 | * OMAP34xx clock function prototypes and macros |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H | 8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H |
| 9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H | 9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H |
| 10 | 10 | ||
| 11 | extern const struct clkops clkops_omap3430es2_ssi_wait; | 11 | extern const struct clkops clkops_omap3430es2_ssi_wait; |
| 12 | extern const struct clkops clkops_omap3430es2_iclk_ssi_wait; | ||
| 12 | extern const struct clkops clkops_omap3430es2_hsotgusb_wait; | 13 | extern const struct clkops clkops_omap3430es2_hsotgusb_wait; |
| 14 | extern const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait; | ||
| 13 | extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; | 15 | extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; |
| 16 | extern const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait; | ||
| 14 | 17 | ||
| 15 | #endif | 18 | #endif |
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c index 74116a3cf099..2e97d08f0e56 100644 --- a/arch/arm/mach-omap2/clock3517.c +++ b/arch/arm/mach-omap2/clock3517.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP3517/3505-specific clock framework functions | 2 | * OMAP3517/3505-specific clock framework functions |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2010 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2010 Nokia Corporation | 5 | * Copyright (C) 2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Ranjith Lohithakshan | 7 | * Ranjith Lohithakshan |
| 8 | * Paul Walmsley | 8 | * Paul Walmsley |
| @@ -119,6 +119,8 @@ const struct clkops clkops_am35xx_ipss_wait = { | |||
| 119 | .disable = omap2_dflt_clk_disable, | 119 | .disable = omap2_dflt_clk_disable, |
| 120 | .find_idlest = am35xx_clk_ipss_find_idlest, | 120 | .find_idlest = am35xx_clk_ipss_find_idlest, |
| 121 | .find_companion = omap2_clk_dflt_find_companion, | 121 | .find_companion = omap2_clk_dflt_find_companion, |
| 122 | .allow_idle = omap2_clkt_iclk_allow_idle, | ||
| 123 | .deny_idle = omap2_clkt_iclk_deny_idle, | ||
| 122 | }; | 124 | }; |
| 123 | 125 | ||
| 124 | 126 | ||
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c index e9f66b6dec18..952c3e01c9eb 100644 --- a/arch/arm/mach-omap2/clock3xxx.c +++ b/arch/arm/mach-omap2/clock3xxx.c | |||
| @@ -65,9 +65,6 @@ void __init omap3_clk_lock_dpll5(void) | |||
| 65 | clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); | 65 | clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); |
| 66 | clk_enable(dpll5_clk); | 66 | clk_enable(dpll5_clk); |
| 67 | 67 | ||
| 68 | /* Enable autoidle to allow it to enter low power bypass */ | ||
| 69 | omap3_dpll_allow_idle(dpll5_clk); | ||
| 70 | |||
| 71 | /* Program dpll5_m2_clk divider for no division */ | 68 | /* Program dpll5_m2_clk divider for no division */ |
| 72 | dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); | 69 | dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); |
| 73 | clk_enable(dpll5_m2_clk); | 70 | clk_enable(dpll5_m2_clk); |
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index f14d986f0b5d..d905ecc7989a 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP3 clock data | 2 | * OMAP3 clock data |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
| 8 | * With many device clock fixes by Kevin Hilman and Jouni Högander | 8 | * With many device clock fixes by Kevin Hilman and Jouni Högander |
| @@ -291,12 +291,11 @@ static struct dpll_data dpll1_dd = { | |||
| 291 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 291 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
| 292 | .min_divider = 1, | 292 | .min_divider = 1, |
| 293 | .max_divider = OMAP3_MAX_DPLL_DIV, | 293 | .max_divider = OMAP3_MAX_DPLL_DIV, |
| 294 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
| 295 | }; | 294 | }; |
| 296 | 295 | ||
| 297 | static struct clk dpll1_ck = { | 296 | static struct clk dpll1_ck = { |
| 298 | .name = "dpll1_ck", | 297 | .name = "dpll1_ck", |
| 299 | .ops = &clkops_null, | 298 | .ops = &clkops_omap3_noncore_dpll_ops, |
| 300 | .parent = &sys_ck, | 299 | .parent = &sys_ck, |
| 301 | .dpll_data = &dpll1_dd, | 300 | .dpll_data = &dpll1_dd, |
| 302 | .round_rate = &omap2_dpll_round_rate, | 301 | .round_rate = &omap2_dpll_round_rate, |
| @@ -364,7 +363,6 @@ static struct dpll_data dpll2_dd = { | |||
| 364 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 363 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
| 365 | .min_divider = 1, | 364 | .min_divider = 1, |
| 366 | .max_divider = OMAP3_MAX_DPLL_DIV, | 365 | .max_divider = OMAP3_MAX_DPLL_DIV, |
| 367 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
| 368 | }; | 366 | }; |
| 369 | 367 | ||
| 370 | static struct clk dpll2_ck = { | 368 | static struct clk dpll2_ck = { |
| @@ -424,12 +422,11 @@ static struct dpll_data dpll3_dd = { | |||
| 424 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 422 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
| 425 | .min_divider = 1, | 423 | .min_divider = 1, |
| 426 | .max_divider = OMAP3_MAX_DPLL_DIV, | 424 | .max_divider = OMAP3_MAX_DPLL_DIV, |
| 427 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
| 428 | }; | 425 | }; |
| 429 | 426 | ||
| 430 | static struct clk dpll3_ck = { | 427 | static struct clk dpll3_ck = { |
| 431 | .name = "dpll3_ck", | 428 | .name = "dpll3_ck", |
| 432 | .ops = &clkops_null, | 429 | .ops = &clkops_omap3_core_dpll_ops, |
| 433 | .parent = &sys_ck, | 430 | .parent = &sys_ck, |
| 434 | .dpll_data = &dpll3_dd, | 431 | .dpll_data = &dpll3_dd, |
| 435 | .round_rate = &omap2_dpll_round_rate, | 432 | .round_rate = &omap2_dpll_round_rate, |
| @@ -583,7 +580,6 @@ static struct dpll_data dpll4_dd_34xx __initdata = { | |||
| 583 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 580 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
| 584 | .min_divider = 1, | 581 | .min_divider = 1, |
| 585 | .max_divider = OMAP3_MAX_DPLL_DIV, | 582 | .max_divider = OMAP3_MAX_DPLL_DIV, |
| 586 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
| 587 | }; | 583 | }; |
| 588 | 584 | ||
| 589 | static struct dpll_data dpll4_dd_3630 __initdata = { | 585 | static struct dpll_data dpll4_dd_3630 __initdata = { |
| @@ -607,7 +603,6 @@ static struct dpll_data dpll4_dd_3630 __initdata = { | |||
| 607 | .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, | 603 | .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, |
| 608 | .min_divider = 1, | 604 | .min_divider = 1, |
| 609 | .max_divider = OMAP3_MAX_DPLL_DIV, | 605 | .max_divider = OMAP3_MAX_DPLL_DIV, |
| 610 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE, | ||
| 611 | .flags = DPLL_J_TYPE | 606 | .flags = DPLL_J_TYPE |
| 612 | }; | 607 | }; |
| 613 | 608 | ||
| @@ -939,7 +934,6 @@ static struct dpll_data dpll5_dd = { | |||
| 939 | .max_multiplier = OMAP3_MAX_DPLL_MULT, | 934 | .max_multiplier = OMAP3_MAX_DPLL_MULT, |
| 940 | .min_divider = 1, | 935 | .min_divider = 1, |
| 941 | .max_divider = OMAP3_MAX_DPLL_DIV, | 936 | .max_divider = OMAP3_MAX_DPLL_DIV, |
| 942 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
| 943 | }; | 937 | }; |
| 944 | 938 | ||
| 945 | static struct clk dpll5_ck = { | 939 | static struct clk dpll5_ck = { |
| @@ -1205,7 +1199,10 @@ static const struct clksel gfx_l3_clksel[] = { | |||
| 1205 | { .parent = NULL } | 1199 | { .parent = NULL } |
| 1206 | }; | 1200 | }; |
| 1207 | 1201 | ||
| 1208 | /* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */ | 1202 | /* |
| 1203 | * Virtual parent clock for gfx_l3_ick and gfx_l3_fck | ||
| 1204 | * This interface clock does not have a CM_AUTOIDLE bit | ||
| 1205 | */ | ||
| 1209 | static struct clk gfx_l3_ck = { | 1206 | static struct clk gfx_l3_ck = { |
| 1210 | .name = "gfx_l3_ck", | 1207 | .name = "gfx_l3_ck", |
| 1211 | .ops = &clkops_omap2_dflt_wait, | 1208 | .ops = &clkops_omap2_dflt_wait, |
| @@ -1304,6 +1301,7 @@ static struct clk sgx_fck = { | |||
| 1304 | .round_rate = &omap2_clksel_round_rate | 1301 | .round_rate = &omap2_clksel_round_rate |
| 1305 | }; | 1302 | }; |
| 1306 | 1303 | ||
| 1304 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
| 1307 | static struct clk sgx_ick = { | 1305 | static struct clk sgx_ick = { |
| 1308 | .name = "sgx_ick", | 1306 | .name = "sgx_ick", |
| 1309 | .ops = &clkops_omap2_dflt_wait, | 1307 | .ops = &clkops_omap2_dflt_wait, |
| @@ -1328,7 +1326,7 @@ static struct clk d2d_26m_fck = { | |||
| 1328 | 1326 | ||
| 1329 | static struct clk modem_fck = { | 1327 | static struct clk modem_fck = { |
| 1330 | .name = "modem_fck", | 1328 | .name = "modem_fck", |
| 1331 | .ops = &clkops_omap2_dflt_wait, | 1329 | .ops = &clkops_omap2_mdmclk_dflt_wait, |
| 1332 | .parent = &sys_ck, | 1330 | .parent = &sys_ck, |
| 1333 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1331 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1334 | .enable_bit = OMAP3430_EN_MODEM_SHIFT, | 1332 | .enable_bit = OMAP3430_EN_MODEM_SHIFT, |
| @@ -1338,7 +1336,7 @@ static struct clk modem_fck = { | |||
| 1338 | 1336 | ||
| 1339 | static struct clk sad2d_ick = { | 1337 | static struct clk sad2d_ick = { |
| 1340 | .name = "sad2d_ick", | 1338 | .name = "sad2d_ick", |
| 1341 | .ops = &clkops_omap2_dflt_wait, | 1339 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1342 | .parent = &l3_ick, | 1340 | .parent = &l3_ick, |
| 1343 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1341 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1344 | .enable_bit = OMAP3430_EN_SAD2D_SHIFT, | 1342 | .enable_bit = OMAP3430_EN_SAD2D_SHIFT, |
| @@ -1348,7 +1346,7 @@ static struct clk sad2d_ick = { | |||
| 1348 | 1346 | ||
| 1349 | static struct clk mad2d_ick = { | 1347 | static struct clk mad2d_ick = { |
| 1350 | .name = "mad2d_ick", | 1348 | .name = "mad2d_ick", |
| 1351 | .ops = &clkops_omap2_dflt_wait, | 1349 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1352 | .parent = &l3_ick, | 1350 | .parent = &l3_ick, |
| 1353 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 1351 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
| 1354 | .enable_bit = OMAP3430_EN_MAD2D_SHIFT, | 1352 | .enable_bit = OMAP3430_EN_MAD2D_SHIFT, |
| @@ -1718,7 +1716,7 @@ static struct clk core_l3_ick = { | |||
| 1718 | 1716 | ||
| 1719 | static struct clk hsotgusb_ick_3430es1 = { | 1717 | static struct clk hsotgusb_ick_3430es1 = { |
| 1720 | .name = "hsotgusb_ick", | 1718 | .name = "hsotgusb_ick", |
| 1721 | .ops = &clkops_omap2_dflt, | 1719 | .ops = &clkops_omap2_iclk_dflt, |
| 1722 | .parent = &core_l3_ick, | 1720 | .parent = &core_l3_ick, |
| 1723 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1721 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1724 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | 1722 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, |
| @@ -1728,7 +1726,7 @@ static struct clk hsotgusb_ick_3430es1 = { | |||
| 1728 | 1726 | ||
| 1729 | static struct clk hsotgusb_ick_3430es2 = { | 1727 | static struct clk hsotgusb_ick_3430es2 = { |
| 1730 | .name = "hsotgusb_ick", | 1728 | .name = "hsotgusb_ick", |
| 1731 | .ops = &clkops_omap3430es2_hsotgusb_wait, | 1729 | .ops = &clkops_omap3430es2_iclk_hsotgusb_wait, |
| 1732 | .parent = &core_l3_ick, | 1730 | .parent = &core_l3_ick, |
| 1733 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1731 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1734 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, | 1732 | .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, |
| @@ -1736,6 +1734,7 @@ static struct clk hsotgusb_ick_3430es2 = { | |||
| 1736 | .recalc = &followparent_recalc, | 1734 | .recalc = &followparent_recalc, |
| 1737 | }; | 1735 | }; |
| 1738 | 1736 | ||
| 1737 | /* This interface clock does not have a CM_AUTOIDLE bit */ | ||
| 1739 | static struct clk sdrc_ick = { | 1738 | static struct clk sdrc_ick = { |
| 1740 | .name = "sdrc_ick", | 1739 | .name = "sdrc_ick", |
| 1741 | .ops = &clkops_omap2_dflt_wait, | 1740 | .ops = &clkops_omap2_dflt_wait, |
| @@ -1767,7 +1766,7 @@ static struct clk security_l3_ick = { | |||
| 1767 | 1766 | ||
| 1768 | static struct clk pka_ick = { | 1767 | static struct clk pka_ick = { |
| 1769 | .name = "pka_ick", | 1768 | .name = "pka_ick", |
| 1770 | .ops = &clkops_omap2_dflt_wait, | 1769 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1771 | .parent = &security_l3_ick, | 1770 | .parent = &security_l3_ick, |
| 1772 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1771 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1773 | .enable_bit = OMAP3430_EN_PKA_SHIFT, | 1772 | .enable_bit = OMAP3430_EN_PKA_SHIFT, |
| @@ -1786,7 +1785,7 @@ static struct clk core_l4_ick = { | |||
| 1786 | 1785 | ||
| 1787 | static struct clk usbtll_ick = { | 1786 | static struct clk usbtll_ick = { |
| 1788 | .name = "usbtll_ick", | 1787 | .name = "usbtll_ick", |
| 1789 | .ops = &clkops_omap2_dflt_wait, | 1788 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1790 | .parent = &core_l4_ick, | 1789 | .parent = &core_l4_ick, |
| 1791 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), | 1790 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
| 1792 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | 1791 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, |
| @@ -1796,7 +1795,7 @@ static struct clk usbtll_ick = { | |||
| 1796 | 1795 | ||
| 1797 | static struct clk mmchs3_ick = { | 1796 | static struct clk mmchs3_ick = { |
| 1798 | .name = "mmchs3_ick", | 1797 | .name = "mmchs3_ick", |
| 1799 | .ops = &clkops_omap2_dflt_wait, | 1798 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1800 | .parent = &core_l4_ick, | 1799 | .parent = &core_l4_ick, |
| 1801 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1800 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1802 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, | 1801 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, |
| @@ -1807,7 +1806,7 @@ static struct clk mmchs3_ick = { | |||
| 1807 | /* Intersystem Communication Registers - chassis mode only */ | 1806 | /* Intersystem Communication Registers - chassis mode only */ |
| 1808 | static struct clk icr_ick = { | 1807 | static struct clk icr_ick = { |
| 1809 | .name = "icr_ick", | 1808 | .name = "icr_ick", |
| 1810 | .ops = &clkops_omap2_dflt_wait, | 1809 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1811 | .parent = &core_l4_ick, | 1810 | .parent = &core_l4_ick, |
| 1812 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1811 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1813 | .enable_bit = OMAP3430_EN_ICR_SHIFT, | 1812 | .enable_bit = OMAP3430_EN_ICR_SHIFT, |
| @@ -1817,7 +1816,7 @@ static struct clk icr_ick = { | |||
| 1817 | 1816 | ||
| 1818 | static struct clk aes2_ick = { | 1817 | static struct clk aes2_ick = { |
| 1819 | .name = "aes2_ick", | 1818 | .name = "aes2_ick", |
| 1820 | .ops = &clkops_omap2_dflt_wait, | 1819 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1821 | .parent = &core_l4_ick, | 1820 | .parent = &core_l4_ick, |
| 1822 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1821 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1823 | .enable_bit = OMAP3430_EN_AES2_SHIFT, | 1822 | .enable_bit = OMAP3430_EN_AES2_SHIFT, |
| @@ -1827,7 +1826,7 @@ static struct clk aes2_ick = { | |||
| 1827 | 1826 | ||
| 1828 | static struct clk sha12_ick = { | 1827 | static struct clk sha12_ick = { |
| 1829 | .name = "sha12_ick", | 1828 | .name = "sha12_ick", |
| 1830 | .ops = &clkops_omap2_dflt_wait, | 1829 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1831 | .parent = &core_l4_ick, | 1830 | .parent = &core_l4_ick, |
| 1832 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1831 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1833 | .enable_bit = OMAP3430_EN_SHA12_SHIFT, | 1832 | .enable_bit = OMAP3430_EN_SHA12_SHIFT, |
| @@ -1837,7 +1836,7 @@ static struct clk sha12_ick = { | |||
| 1837 | 1836 | ||
| 1838 | static struct clk des2_ick = { | 1837 | static struct clk des2_ick = { |
| 1839 | .name = "des2_ick", | 1838 | .name = "des2_ick", |
| 1840 | .ops = &clkops_omap2_dflt_wait, | 1839 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1841 | .parent = &core_l4_ick, | 1840 | .parent = &core_l4_ick, |
| 1842 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1841 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1843 | .enable_bit = OMAP3430_EN_DES2_SHIFT, | 1842 | .enable_bit = OMAP3430_EN_DES2_SHIFT, |
| @@ -1847,7 +1846,7 @@ static struct clk des2_ick = { | |||
| 1847 | 1846 | ||
| 1848 | static struct clk mmchs2_ick = { | 1847 | static struct clk mmchs2_ick = { |
| 1849 | .name = "mmchs2_ick", | 1848 | .name = "mmchs2_ick", |
| 1850 | .ops = &clkops_omap2_dflt_wait, | 1849 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1851 | .parent = &core_l4_ick, | 1850 | .parent = &core_l4_ick, |
| 1852 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1851 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1853 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, | 1852 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, |
| @@ -1857,7 +1856,7 @@ static struct clk mmchs2_ick = { | |||
| 1857 | 1856 | ||
| 1858 | static struct clk mmchs1_ick = { | 1857 | static struct clk mmchs1_ick = { |
| 1859 | .name = "mmchs1_ick", | 1858 | .name = "mmchs1_ick", |
| 1860 | .ops = &clkops_omap2_dflt_wait, | 1859 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1861 | .parent = &core_l4_ick, | 1860 | .parent = &core_l4_ick, |
| 1862 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1861 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1863 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, | 1862 | .enable_bit = OMAP3430_EN_MMC1_SHIFT, |
| @@ -1867,7 +1866,7 @@ static struct clk mmchs1_ick = { | |||
| 1867 | 1866 | ||
| 1868 | static struct clk mspro_ick = { | 1867 | static struct clk mspro_ick = { |
| 1869 | .name = "mspro_ick", | 1868 | .name = "mspro_ick", |
| 1870 | .ops = &clkops_omap2_dflt_wait, | 1869 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1871 | .parent = &core_l4_ick, | 1870 | .parent = &core_l4_ick, |
| 1872 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1871 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1873 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, | 1872 | .enable_bit = OMAP3430_EN_MSPRO_SHIFT, |
| @@ -1877,7 +1876,7 @@ static struct clk mspro_ick = { | |||
| 1877 | 1876 | ||
| 1878 | static struct clk hdq_ick = { | 1877 | static struct clk hdq_ick = { |
| 1879 | .name = "hdq_ick", | 1878 | .name = "hdq_ick", |
| 1880 | .ops = &clkops_omap2_dflt_wait, | 1879 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1881 | .parent = &core_l4_ick, | 1880 | .parent = &core_l4_ick, |
| 1882 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1881 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1883 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, | 1882 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, |
| @@ -1887,7 +1886,7 @@ static struct clk hdq_ick = { | |||
| 1887 | 1886 | ||
| 1888 | static struct clk mcspi4_ick = { | 1887 | static struct clk mcspi4_ick = { |
| 1889 | .name = "mcspi4_ick", | 1888 | .name = "mcspi4_ick", |
| 1890 | .ops = &clkops_omap2_dflt_wait, | 1889 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1891 | .parent = &core_l4_ick, | 1890 | .parent = &core_l4_ick, |
| 1892 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1891 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1893 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, | 1892 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, |
| @@ -1897,7 +1896,7 @@ static struct clk mcspi4_ick = { | |||
| 1897 | 1896 | ||
| 1898 | static struct clk mcspi3_ick = { | 1897 | static struct clk mcspi3_ick = { |
| 1899 | .name = "mcspi3_ick", | 1898 | .name = "mcspi3_ick", |
| 1900 | .ops = &clkops_omap2_dflt_wait, | 1899 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1901 | .parent = &core_l4_ick, | 1900 | .parent = &core_l4_ick, |
| 1902 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1901 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1903 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, | 1902 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, |
| @@ -1907,7 +1906,7 @@ static struct clk mcspi3_ick = { | |||
| 1907 | 1906 | ||
| 1908 | static struct clk mcspi2_ick = { | 1907 | static struct clk mcspi2_ick = { |
| 1909 | .name = "mcspi2_ick", | 1908 | .name = "mcspi2_ick", |
| 1910 | .ops = &clkops_omap2_dflt_wait, | 1909 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1911 | .parent = &core_l4_ick, | 1910 | .parent = &core_l4_ick, |
| 1912 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1911 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1913 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, | 1912 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, |
| @@ -1917,7 +1916,7 @@ static struct clk mcspi2_ick = { | |||
| 1917 | 1916 | ||
| 1918 | static struct clk mcspi1_ick = { | 1917 | static struct clk mcspi1_ick = { |
| 1919 | .name = "mcspi1_ick", | 1918 | .name = "mcspi1_ick", |
| 1920 | .ops = &clkops_omap2_dflt_wait, | 1919 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1921 | .parent = &core_l4_ick, | 1920 | .parent = &core_l4_ick, |
| 1922 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1921 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1923 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, | 1922 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, |
| @@ -1927,7 +1926,7 @@ static struct clk mcspi1_ick = { | |||
| 1927 | 1926 | ||
| 1928 | static struct clk i2c3_ick = { | 1927 | static struct clk i2c3_ick = { |
| 1929 | .name = "i2c3_ick", | 1928 | .name = "i2c3_ick", |
| 1930 | .ops = &clkops_omap2_dflt_wait, | 1929 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1931 | .parent = &core_l4_ick, | 1930 | .parent = &core_l4_ick, |
| 1932 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1931 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1933 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, | 1932 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, |
| @@ -1937,7 +1936,7 @@ static struct clk i2c3_ick = { | |||
| 1937 | 1936 | ||
| 1938 | static struct clk i2c2_ick = { | 1937 | static struct clk i2c2_ick = { |
| 1939 | .name = "i2c2_ick", | 1938 | .name = "i2c2_ick", |
| 1940 | .ops = &clkops_omap2_dflt_wait, | 1939 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1941 | .parent = &core_l4_ick, | 1940 | .parent = &core_l4_ick, |
| 1942 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1941 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1943 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, | 1942 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, |
| @@ -1947,7 +1946,7 @@ static struct clk i2c2_ick = { | |||
| 1947 | 1946 | ||
| 1948 | static struct clk i2c1_ick = { | 1947 | static struct clk i2c1_ick = { |
| 1949 | .name = "i2c1_ick", | 1948 | .name = "i2c1_ick", |
| 1950 | .ops = &clkops_omap2_dflt_wait, | 1949 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1951 | .parent = &core_l4_ick, | 1950 | .parent = &core_l4_ick, |
| 1952 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1951 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1953 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, | 1952 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, |
| @@ -1957,7 +1956,7 @@ static struct clk i2c1_ick = { | |||
| 1957 | 1956 | ||
| 1958 | static struct clk uart2_ick = { | 1957 | static struct clk uart2_ick = { |
| 1959 | .name = "uart2_ick", | 1958 | .name = "uart2_ick", |
| 1960 | .ops = &clkops_omap2_dflt_wait, | 1959 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1961 | .parent = &core_l4_ick, | 1960 | .parent = &core_l4_ick, |
| 1962 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1961 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1963 | .enable_bit = OMAP3430_EN_UART2_SHIFT, | 1962 | .enable_bit = OMAP3430_EN_UART2_SHIFT, |
| @@ -1967,7 +1966,7 @@ static struct clk uart2_ick = { | |||
| 1967 | 1966 | ||
| 1968 | static struct clk uart1_ick = { | 1967 | static struct clk uart1_ick = { |
| 1969 | .name = "uart1_ick", | 1968 | .name = "uart1_ick", |
| 1970 | .ops = &clkops_omap2_dflt_wait, | 1969 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1971 | .parent = &core_l4_ick, | 1970 | .parent = &core_l4_ick, |
| 1972 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1971 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1973 | .enable_bit = OMAP3430_EN_UART1_SHIFT, | 1972 | .enable_bit = OMAP3430_EN_UART1_SHIFT, |
| @@ -1977,7 +1976,7 @@ static struct clk uart1_ick = { | |||
| 1977 | 1976 | ||
| 1978 | static struct clk gpt11_ick = { | 1977 | static struct clk gpt11_ick = { |
| 1979 | .name = "gpt11_ick", | 1978 | .name = "gpt11_ick", |
| 1980 | .ops = &clkops_omap2_dflt_wait, | 1979 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1981 | .parent = &core_l4_ick, | 1980 | .parent = &core_l4_ick, |
| 1982 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1981 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1983 | .enable_bit = OMAP3430_EN_GPT11_SHIFT, | 1982 | .enable_bit = OMAP3430_EN_GPT11_SHIFT, |
| @@ -1987,7 +1986,7 @@ static struct clk gpt11_ick = { | |||
| 1987 | 1986 | ||
| 1988 | static struct clk gpt10_ick = { | 1987 | static struct clk gpt10_ick = { |
| 1989 | .name = "gpt10_ick", | 1988 | .name = "gpt10_ick", |
| 1990 | .ops = &clkops_omap2_dflt_wait, | 1989 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 1991 | .parent = &core_l4_ick, | 1990 | .parent = &core_l4_ick, |
| 1992 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1991 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1993 | .enable_bit = OMAP3430_EN_GPT10_SHIFT, | 1992 | .enable_bit = OMAP3430_EN_GPT10_SHIFT, |
| @@ -1997,7 +1996,7 @@ static struct clk gpt10_ick = { | |||
| 1997 | 1996 | ||
| 1998 | static struct clk mcbsp5_ick = { | 1997 | static struct clk mcbsp5_ick = { |
| 1999 | .name = "mcbsp5_ick", | 1998 | .name = "mcbsp5_ick", |
| 2000 | .ops = &clkops_omap2_dflt_wait, | 1999 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2001 | .parent = &core_l4_ick, | 2000 | .parent = &core_l4_ick, |
| 2002 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2001 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 2003 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, | 2002 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, |
| @@ -2007,7 +2006,7 @@ static struct clk mcbsp5_ick = { | |||
| 2007 | 2006 | ||
| 2008 | static struct clk mcbsp1_ick = { | 2007 | static struct clk mcbsp1_ick = { |
| 2009 | .name = "mcbsp1_ick", | 2008 | .name = "mcbsp1_ick", |
| 2010 | .ops = &clkops_omap2_dflt_wait, | 2009 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2011 | .parent = &core_l4_ick, | 2010 | .parent = &core_l4_ick, |
| 2012 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2011 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 2013 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, | 2012 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, |
| @@ -2017,7 +2016,7 @@ static struct clk mcbsp1_ick = { | |||
| 2017 | 2016 | ||
| 2018 | static struct clk fac_ick = { | 2017 | static struct clk fac_ick = { |
| 2019 | .name = "fac_ick", | 2018 | .name = "fac_ick", |
| 2020 | .ops = &clkops_omap2_dflt_wait, | 2019 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2021 | .parent = &core_l4_ick, | 2020 | .parent = &core_l4_ick, |
| 2022 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2021 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 2023 | .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, | 2022 | .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, |
| @@ -2027,7 +2026,7 @@ static struct clk fac_ick = { | |||
| 2027 | 2026 | ||
| 2028 | static struct clk mailboxes_ick = { | 2027 | static struct clk mailboxes_ick = { |
| 2029 | .name = "mailboxes_ick", | 2028 | .name = "mailboxes_ick", |
| 2030 | .ops = &clkops_omap2_dflt_wait, | 2029 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2031 | .parent = &core_l4_ick, | 2030 | .parent = &core_l4_ick, |
| 2032 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2031 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 2033 | .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, | 2032 | .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, |
| @@ -2037,7 +2036,7 @@ static struct clk mailboxes_ick = { | |||
| 2037 | 2036 | ||
| 2038 | static struct clk omapctrl_ick = { | 2037 | static struct clk omapctrl_ick = { |
| 2039 | .name = "omapctrl_ick", | 2038 | .name = "omapctrl_ick", |
| 2040 | .ops = &clkops_omap2_dflt_wait, | 2039 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2041 | .parent = &core_l4_ick, | 2040 | .parent = &core_l4_ick, |
| 2042 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2041 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 2043 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, | 2042 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, |
| @@ -2057,7 +2056,7 @@ static struct clk ssi_l4_ick = { | |||
| 2057 | 2056 | ||
| 2058 | static struct clk ssi_ick_3430es1 = { | 2057 | static struct clk ssi_ick_3430es1 = { |
| 2059 | .name = "ssi_ick", | 2058 | .name = "ssi_ick", |
| 2060 | .ops = &clkops_omap2_dflt, | 2059 | .ops = &clkops_omap2_iclk_dflt, |
| 2061 | .parent = &ssi_l4_ick, | 2060 | .parent = &ssi_l4_ick, |
| 2062 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2061 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 2063 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | 2062 | .enable_bit = OMAP3430_EN_SSI_SHIFT, |
| @@ -2067,7 +2066,7 @@ static struct clk ssi_ick_3430es1 = { | |||
| 2067 | 2066 | ||
| 2068 | static struct clk ssi_ick_3430es2 = { | 2067 | static struct clk ssi_ick_3430es2 = { |
| 2069 | .name = "ssi_ick", | 2068 | .name = "ssi_ick", |
| 2070 | .ops = &clkops_omap3430es2_ssi_wait, | 2069 | .ops = &clkops_omap3430es2_iclk_ssi_wait, |
| 2071 | .parent = &ssi_l4_ick, | 2070 | .parent = &ssi_l4_ick, |
| 2072 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2071 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 2073 | .enable_bit = OMAP3430_EN_SSI_SHIFT, | 2072 | .enable_bit = OMAP3430_EN_SSI_SHIFT, |
| @@ -2085,7 +2084,7 @@ static const struct clksel usb_l4_clksel[] = { | |||
| 2085 | 2084 | ||
| 2086 | static struct clk usb_l4_ick = { | 2085 | static struct clk usb_l4_ick = { |
| 2087 | .name = "usb_l4_ick", | 2086 | .name = "usb_l4_ick", |
| 2088 | .ops = &clkops_omap2_dflt_wait, | 2087 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2089 | .parent = &l4_ick, | 2088 | .parent = &l4_ick, |
| 2090 | .init = &omap2_init_clksel_parent, | 2089 | .init = &omap2_init_clksel_parent, |
| 2091 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2090 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| @@ -2107,7 +2106,7 @@ static struct clk security_l4_ick2 = { | |||
| 2107 | 2106 | ||
| 2108 | static struct clk aes1_ick = { | 2107 | static struct clk aes1_ick = { |
| 2109 | .name = "aes1_ick", | 2108 | .name = "aes1_ick", |
| 2110 | .ops = &clkops_omap2_dflt_wait, | 2109 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2111 | .parent = &security_l4_ick2, | 2110 | .parent = &security_l4_ick2, |
| 2112 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2111 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 2113 | .enable_bit = OMAP3430_EN_AES1_SHIFT, | 2112 | .enable_bit = OMAP3430_EN_AES1_SHIFT, |
| @@ -2116,7 +2115,7 @@ static struct clk aes1_ick = { | |||
| 2116 | 2115 | ||
| 2117 | static struct clk rng_ick = { | 2116 | static struct clk rng_ick = { |
| 2118 | .name = "rng_ick", | 2117 | .name = "rng_ick", |
| 2119 | .ops = &clkops_omap2_dflt_wait, | 2118 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2120 | .parent = &security_l4_ick2, | 2119 | .parent = &security_l4_ick2, |
| 2121 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2120 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 2122 | .enable_bit = OMAP3430_EN_RNG_SHIFT, | 2121 | .enable_bit = OMAP3430_EN_RNG_SHIFT, |
| @@ -2125,7 +2124,7 @@ static struct clk rng_ick = { | |||
| 2125 | 2124 | ||
| 2126 | static struct clk sha11_ick = { | 2125 | static struct clk sha11_ick = { |
| 2127 | .name = "sha11_ick", | 2126 | .name = "sha11_ick", |
| 2128 | .ops = &clkops_omap2_dflt_wait, | 2127 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2129 | .parent = &security_l4_ick2, | 2128 | .parent = &security_l4_ick2, |
| 2130 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2129 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 2131 | .enable_bit = OMAP3430_EN_SHA11_SHIFT, | 2130 | .enable_bit = OMAP3430_EN_SHA11_SHIFT, |
| @@ -2134,7 +2133,7 @@ static struct clk sha11_ick = { | |||
| 2134 | 2133 | ||
| 2135 | static struct clk des1_ick = { | 2134 | static struct clk des1_ick = { |
| 2136 | .name = "des1_ick", | 2135 | .name = "des1_ick", |
| 2137 | .ops = &clkops_omap2_dflt_wait, | 2136 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2138 | .parent = &security_l4_ick2, | 2137 | .parent = &security_l4_ick2, |
| 2139 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 2138 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 2140 | .enable_bit = OMAP3430_EN_DES1_SHIFT, | 2139 | .enable_bit = OMAP3430_EN_DES1_SHIFT, |
| @@ -2195,7 +2194,7 @@ static struct clk dss2_alwon_fck = { | |||
| 2195 | static struct clk dss_ick_3430es1 = { | 2194 | static struct clk dss_ick_3430es1 = { |
| 2196 | /* Handles both L3 and L4 clocks */ | 2195 | /* Handles both L3 and L4 clocks */ |
| 2197 | .name = "dss_ick", | 2196 | .name = "dss_ick", |
| 2198 | .ops = &clkops_omap2_dflt, | 2197 | .ops = &clkops_omap2_iclk_dflt, |
| 2199 | .parent = &l4_ick, | 2198 | .parent = &l4_ick, |
| 2200 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), | 2199 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), |
| 2201 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, | 2200 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, |
| @@ -2206,7 +2205,7 @@ static struct clk dss_ick_3430es1 = { | |||
| 2206 | static struct clk dss_ick_3430es2 = { | 2205 | static struct clk dss_ick_3430es2 = { |
| 2207 | /* Handles both L3 and L4 clocks */ | 2206 | /* Handles both L3 and L4 clocks */ |
| 2208 | .name = "dss_ick", | 2207 | .name = "dss_ick", |
| 2209 | .ops = &clkops_omap3430es2_dss_usbhost_wait, | 2208 | .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait, |
| 2210 | .parent = &l4_ick, | 2209 | .parent = &l4_ick, |
| 2211 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), | 2210 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), |
| 2212 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, | 2211 | .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, |
| @@ -2229,7 +2228,7 @@ static struct clk cam_mclk = { | |||
| 2229 | static struct clk cam_ick = { | 2228 | static struct clk cam_ick = { |
| 2230 | /* Handles both L3 and L4 clocks */ | 2229 | /* Handles both L3 and L4 clocks */ |
| 2231 | .name = "cam_ick", | 2230 | .name = "cam_ick", |
| 2232 | .ops = &clkops_omap2_dflt, | 2231 | .ops = &clkops_omap2_iclk_dflt, |
| 2233 | .parent = &l4_ick, | 2232 | .parent = &l4_ick, |
| 2234 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), | 2233 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), |
| 2235 | .enable_bit = OMAP3430_EN_CAM_SHIFT, | 2234 | .enable_bit = OMAP3430_EN_CAM_SHIFT, |
| @@ -2272,7 +2271,7 @@ static struct clk usbhost_48m_fck = { | |||
| 2272 | static struct clk usbhost_ick = { | 2271 | static struct clk usbhost_ick = { |
| 2273 | /* Handles both L3 and L4 clocks */ | 2272 | /* Handles both L3 and L4 clocks */ |
| 2274 | .name = "usbhost_ick", | 2273 | .name = "usbhost_ick", |
| 2275 | .ops = &clkops_omap3430es2_dss_usbhost_wait, | 2274 | .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait, |
| 2276 | .parent = &l4_ick, | 2275 | .parent = &l4_ick, |
| 2277 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), | 2276 | .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), |
| 2278 | .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, | 2277 | .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, |
| @@ -2372,7 +2371,7 @@ static struct clk wkup_l4_ick = { | |||
| 2372 | /* Never specifically named in the TRM, so we have to infer a likely name */ | 2371 | /* Never specifically named in the TRM, so we have to infer a likely name */ |
| 2373 | static struct clk usim_ick = { | 2372 | static struct clk usim_ick = { |
| 2374 | .name = "usim_ick", | 2373 | .name = "usim_ick", |
| 2375 | .ops = &clkops_omap2_dflt_wait, | 2374 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2376 | .parent = &wkup_l4_ick, | 2375 | .parent = &wkup_l4_ick, |
| 2377 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2376 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 2378 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, | 2377 | .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, |
| @@ -2382,7 +2381,7 @@ static struct clk usim_ick = { | |||
| 2382 | 2381 | ||
| 2383 | static struct clk wdt2_ick = { | 2382 | static struct clk wdt2_ick = { |
| 2384 | .name = "wdt2_ick", | 2383 | .name = "wdt2_ick", |
| 2385 | .ops = &clkops_omap2_dflt_wait, | 2384 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2386 | .parent = &wkup_l4_ick, | 2385 | .parent = &wkup_l4_ick, |
| 2387 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2386 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 2388 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, | 2387 | .enable_bit = OMAP3430_EN_WDT2_SHIFT, |
| @@ -2392,7 +2391,7 @@ static struct clk wdt2_ick = { | |||
| 2392 | 2391 | ||
| 2393 | static struct clk wdt1_ick = { | 2392 | static struct clk wdt1_ick = { |
| 2394 | .name = "wdt1_ick", | 2393 | .name = "wdt1_ick", |
| 2395 | .ops = &clkops_omap2_dflt_wait, | 2394 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2396 | .parent = &wkup_l4_ick, | 2395 | .parent = &wkup_l4_ick, |
| 2397 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2396 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 2398 | .enable_bit = OMAP3430_EN_WDT1_SHIFT, | 2397 | .enable_bit = OMAP3430_EN_WDT1_SHIFT, |
| @@ -2402,7 +2401,7 @@ static struct clk wdt1_ick = { | |||
| 2402 | 2401 | ||
| 2403 | static struct clk gpio1_ick = { | 2402 | static struct clk gpio1_ick = { |
| 2404 | .name = "gpio1_ick", | 2403 | .name = "gpio1_ick", |
| 2405 | .ops = &clkops_omap2_dflt_wait, | 2404 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2406 | .parent = &wkup_l4_ick, | 2405 | .parent = &wkup_l4_ick, |
| 2407 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2406 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 2408 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, | 2407 | .enable_bit = OMAP3430_EN_GPIO1_SHIFT, |
| @@ -2412,7 +2411,7 @@ static struct clk gpio1_ick = { | |||
| 2412 | 2411 | ||
| 2413 | static struct clk omap_32ksync_ick = { | 2412 | static struct clk omap_32ksync_ick = { |
| 2414 | .name = "omap_32ksync_ick", | 2413 | .name = "omap_32ksync_ick", |
| 2415 | .ops = &clkops_omap2_dflt_wait, | 2414 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2416 | .parent = &wkup_l4_ick, | 2415 | .parent = &wkup_l4_ick, |
| 2417 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2416 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 2418 | .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, | 2417 | .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, |
| @@ -2423,7 +2422,7 @@ static struct clk omap_32ksync_ick = { | |||
| 2423 | /* XXX This clock no longer exists in 3430 TRM rev F */ | 2422 | /* XXX This clock no longer exists in 3430 TRM rev F */ |
| 2424 | static struct clk gpt12_ick = { | 2423 | static struct clk gpt12_ick = { |
| 2425 | .name = "gpt12_ick", | 2424 | .name = "gpt12_ick", |
| 2426 | .ops = &clkops_omap2_dflt_wait, | 2425 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2427 | .parent = &wkup_l4_ick, | 2426 | .parent = &wkup_l4_ick, |
| 2428 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2427 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 2429 | .enable_bit = OMAP3430_EN_GPT12_SHIFT, | 2428 | .enable_bit = OMAP3430_EN_GPT12_SHIFT, |
| @@ -2433,7 +2432,7 @@ static struct clk gpt12_ick = { | |||
| 2433 | 2432 | ||
| 2434 | static struct clk gpt1_ick = { | 2433 | static struct clk gpt1_ick = { |
| 2435 | .name = "gpt1_ick", | 2434 | .name = "gpt1_ick", |
| 2436 | .ops = &clkops_omap2_dflt_wait, | 2435 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2437 | .parent = &wkup_l4_ick, | 2436 | .parent = &wkup_l4_ick, |
| 2438 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | 2437 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 2439 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, | 2438 | .enable_bit = OMAP3430_EN_GPT1_SHIFT, |
| @@ -2663,7 +2662,7 @@ static struct clk per_l4_ick = { | |||
| 2663 | 2662 | ||
| 2664 | static struct clk gpio6_ick = { | 2663 | static struct clk gpio6_ick = { |
| 2665 | .name = "gpio6_ick", | 2664 | .name = "gpio6_ick", |
| 2666 | .ops = &clkops_omap2_dflt_wait, | 2665 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2667 | .parent = &per_l4_ick, | 2666 | .parent = &per_l4_ick, |
| 2668 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2667 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2669 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, | 2668 | .enable_bit = OMAP3430_EN_GPIO6_SHIFT, |
| @@ -2673,7 +2672,7 @@ static struct clk gpio6_ick = { | |||
| 2673 | 2672 | ||
| 2674 | static struct clk gpio5_ick = { | 2673 | static struct clk gpio5_ick = { |
| 2675 | .name = "gpio5_ick", | 2674 | .name = "gpio5_ick", |
| 2676 | .ops = &clkops_omap2_dflt_wait, | 2675 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2677 | .parent = &per_l4_ick, | 2676 | .parent = &per_l4_ick, |
| 2678 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2677 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2679 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, | 2678 | .enable_bit = OMAP3430_EN_GPIO5_SHIFT, |
| @@ -2683,7 +2682,7 @@ static struct clk gpio5_ick = { | |||
| 2683 | 2682 | ||
| 2684 | static struct clk gpio4_ick = { | 2683 | static struct clk gpio4_ick = { |
| 2685 | .name = "gpio4_ick", | 2684 | .name = "gpio4_ick", |
| 2686 | .ops = &clkops_omap2_dflt_wait, | 2685 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2687 | .parent = &per_l4_ick, | 2686 | .parent = &per_l4_ick, |
| 2688 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2687 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2689 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, | 2688 | .enable_bit = OMAP3430_EN_GPIO4_SHIFT, |
| @@ -2693,7 +2692,7 @@ static struct clk gpio4_ick = { | |||
| 2693 | 2692 | ||
| 2694 | static struct clk gpio3_ick = { | 2693 | static struct clk gpio3_ick = { |
| 2695 | .name = "gpio3_ick", | 2694 | .name = "gpio3_ick", |
| 2696 | .ops = &clkops_omap2_dflt_wait, | 2695 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2697 | .parent = &per_l4_ick, | 2696 | .parent = &per_l4_ick, |
| 2698 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2697 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2699 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, | 2698 | .enable_bit = OMAP3430_EN_GPIO3_SHIFT, |
| @@ -2703,7 +2702,7 @@ static struct clk gpio3_ick = { | |||
| 2703 | 2702 | ||
| 2704 | static struct clk gpio2_ick = { | 2703 | static struct clk gpio2_ick = { |
| 2705 | .name = "gpio2_ick", | 2704 | .name = "gpio2_ick", |
| 2706 | .ops = &clkops_omap2_dflt_wait, | 2705 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2707 | .parent = &per_l4_ick, | 2706 | .parent = &per_l4_ick, |
| 2708 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2707 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2709 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, | 2708 | .enable_bit = OMAP3430_EN_GPIO2_SHIFT, |
| @@ -2713,7 +2712,7 @@ static struct clk gpio2_ick = { | |||
| 2713 | 2712 | ||
| 2714 | static struct clk wdt3_ick = { | 2713 | static struct clk wdt3_ick = { |
| 2715 | .name = "wdt3_ick", | 2714 | .name = "wdt3_ick", |
| 2716 | .ops = &clkops_omap2_dflt_wait, | 2715 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2717 | .parent = &per_l4_ick, | 2716 | .parent = &per_l4_ick, |
| 2718 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2717 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2719 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, | 2718 | .enable_bit = OMAP3430_EN_WDT3_SHIFT, |
| @@ -2723,7 +2722,7 @@ static struct clk wdt3_ick = { | |||
| 2723 | 2722 | ||
| 2724 | static struct clk uart3_ick = { | 2723 | static struct clk uart3_ick = { |
| 2725 | .name = "uart3_ick", | 2724 | .name = "uart3_ick", |
| 2726 | .ops = &clkops_omap2_dflt_wait, | 2725 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2727 | .parent = &per_l4_ick, | 2726 | .parent = &per_l4_ick, |
| 2728 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2727 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2729 | .enable_bit = OMAP3430_EN_UART3_SHIFT, | 2728 | .enable_bit = OMAP3430_EN_UART3_SHIFT, |
| @@ -2733,7 +2732,7 @@ static struct clk uart3_ick = { | |||
| 2733 | 2732 | ||
| 2734 | static struct clk uart4_ick = { | 2733 | static struct clk uart4_ick = { |
| 2735 | .name = "uart4_ick", | 2734 | .name = "uart4_ick", |
| 2736 | .ops = &clkops_omap2_dflt_wait, | 2735 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2737 | .parent = &per_l4_ick, | 2736 | .parent = &per_l4_ick, |
| 2738 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2737 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2739 | .enable_bit = OMAP3630_EN_UART4_SHIFT, | 2738 | .enable_bit = OMAP3630_EN_UART4_SHIFT, |
| @@ -2743,7 +2742,7 @@ static struct clk uart4_ick = { | |||
| 2743 | 2742 | ||
| 2744 | static struct clk gpt9_ick = { | 2743 | static struct clk gpt9_ick = { |
| 2745 | .name = "gpt9_ick", | 2744 | .name = "gpt9_ick", |
| 2746 | .ops = &clkops_omap2_dflt_wait, | 2745 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2747 | .parent = &per_l4_ick, | 2746 | .parent = &per_l4_ick, |
| 2748 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2747 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2749 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, | 2748 | .enable_bit = OMAP3430_EN_GPT9_SHIFT, |
| @@ -2753,7 +2752,7 @@ static struct clk gpt9_ick = { | |||
| 2753 | 2752 | ||
| 2754 | static struct clk gpt8_ick = { | 2753 | static struct clk gpt8_ick = { |
| 2755 | .name = "gpt8_ick", | 2754 | .name = "gpt8_ick", |
| 2756 | .ops = &clkops_omap2_dflt_wait, | 2755 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2757 | .parent = &per_l4_ick, | 2756 | .parent = &per_l4_ick, |
| 2758 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2757 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2759 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, | 2758 | .enable_bit = OMAP3430_EN_GPT8_SHIFT, |
| @@ -2763,7 +2762,7 @@ static struct clk gpt8_ick = { | |||
| 2763 | 2762 | ||
| 2764 | static struct clk gpt7_ick = { | 2763 | static struct clk gpt7_ick = { |
| 2765 | .name = "gpt7_ick", | 2764 | .name = "gpt7_ick", |
| 2766 | .ops = &clkops_omap2_dflt_wait, | 2765 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2767 | .parent = &per_l4_ick, | 2766 | .parent = &per_l4_ick, |
| 2768 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2767 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2769 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, | 2768 | .enable_bit = OMAP3430_EN_GPT7_SHIFT, |
| @@ -2773,7 +2772,7 @@ static struct clk gpt7_ick = { | |||
| 2773 | 2772 | ||
| 2774 | static struct clk gpt6_ick = { | 2773 | static struct clk gpt6_ick = { |
| 2775 | .name = "gpt6_ick", | 2774 | .name = "gpt6_ick", |
| 2776 | .ops = &clkops_omap2_dflt_wait, | 2775 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2777 | .parent = &per_l4_ick, | 2776 | .parent = &per_l4_ick, |
| 2778 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2777 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2779 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, | 2778 | .enable_bit = OMAP3430_EN_GPT6_SHIFT, |
| @@ -2783,7 +2782,7 @@ static struct clk gpt6_ick = { | |||
| 2783 | 2782 | ||
| 2784 | static struct clk gpt5_ick = { | 2783 | static struct clk gpt5_ick = { |
| 2785 | .name = "gpt5_ick", | 2784 | .name = "gpt5_ick", |
| 2786 | .ops = &clkops_omap2_dflt_wait, | 2785 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2787 | .parent = &per_l4_ick, | 2786 | .parent = &per_l4_ick, |
| 2788 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2787 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2789 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, | 2788 | .enable_bit = OMAP3430_EN_GPT5_SHIFT, |
| @@ -2793,7 +2792,7 @@ static struct clk gpt5_ick = { | |||
| 2793 | 2792 | ||
| 2794 | static struct clk gpt4_ick = { | 2793 | static struct clk gpt4_ick = { |
| 2795 | .name = "gpt4_ick", | 2794 | .name = "gpt4_ick", |
| 2796 | .ops = &clkops_omap2_dflt_wait, | 2795 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2797 | .parent = &per_l4_ick, | 2796 | .parent = &per_l4_ick, |
| 2798 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2797 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2799 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, | 2798 | .enable_bit = OMAP3430_EN_GPT4_SHIFT, |
| @@ -2803,7 +2802,7 @@ static struct clk gpt4_ick = { | |||
| 2803 | 2802 | ||
| 2804 | static struct clk gpt3_ick = { | 2803 | static struct clk gpt3_ick = { |
| 2805 | .name = "gpt3_ick", | 2804 | .name = "gpt3_ick", |
| 2806 | .ops = &clkops_omap2_dflt_wait, | 2805 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2807 | .parent = &per_l4_ick, | 2806 | .parent = &per_l4_ick, |
| 2808 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2807 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2809 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, | 2808 | .enable_bit = OMAP3430_EN_GPT3_SHIFT, |
| @@ -2813,7 +2812,7 @@ static struct clk gpt3_ick = { | |||
| 2813 | 2812 | ||
| 2814 | static struct clk gpt2_ick = { | 2813 | static struct clk gpt2_ick = { |
| 2815 | .name = "gpt2_ick", | 2814 | .name = "gpt2_ick", |
| 2816 | .ops = &clkops_omap2_dflt_wait, | 2815 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2817 | .parent = &per_l4_ick, | 2816 | .parent = &per_l4_ick, |
| 2818 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2817 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2819 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, | 2818 | .enable_bit = OMAP3430_EN_GPT2_SHIFT, |
| @@ -2823,7 +2822,7 @@ static struct clk gpt2_ick = { | |||
| 2823 | 2822 | ||
| 2824 | static struct clk mcbsp2_ick = { | 2823 | static struct clk mcbsp2_ick = { |
| 2825 | .name = "mcbsp2_ick", | 2824 | .name = "mcbsp2_ick", |
| 2826 | .ops = &clkops_omap2_dflt_wait, | 2825 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2827 | .parent = &per_l4_ick, | 2826 | .parent = &per_l4_ick, |
| 2828 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2827 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2829 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, | 2828 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, |
| @@ -2833,7 +2832,7 @@ static struct clk mcbsp2_ick = { | |||
| 2833 | 2832 | ||
| 2834 | static struct clk mcbsp3_ick = { | 2833 | static struct clk mcbsp3_ick = { |
| 2835 | .name = "mcbsp3_ick", | 2834 | .name = "mcbsp3_ick", |
| 2836 | .ops = &clkops_omap2_dflt_wait, | 2835 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2837 | .parent = &per_l4_ick, | 2836 | .parent = &per_l4_ick, |
| 2838 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2837 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2839 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, | 2838 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, |
| @@ -2843,7 +2842,7 @@ static struct clk mcbsp3_ick = { | |||
| 2843 | 2842 | ||
| 2844 | static struct clk mcbsp4_ick = { | 2843 | static struct clk mcbsp4_ick = { |
| 2845 | .name = "mcbsp4_ick", | 2844 | .name = "mcbsp4_ick", |
| 2846 | .ops = &clkops_omap2_dflt_wait, | 2845 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 2847 | .parent = &per_l4_ick, | 2846 | .parent = &per_l4_ick, |
| 2848 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2847 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
| 2849 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, | 2848 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, |
| @@ -3186,7 +3185,7 @@ static struct clk vpfe_fck = { | |||
| 3186 | */ | 3185 | */ |
| 3187 | static struct clk uart4_ick_am35xx = { | 3186 | static struct clk uart4_ick_am35xx = { |
| 3188 | .name = "uart4_ick", | 3187 | .name = "uart4_ick", |
| 3189 | .ops = &clkops_omap2_dflt_wait, | 3188 | .ops = &clkops_omap2_iclk_dflt_wait, |
| 3190 | .parent = &core_l4_ick, | 3189 | .parent = &core_l4_ick, |
| 3191 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 3190 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 3192 | .enable_bit = AM35XX_EN_UART4_SHIFT, | 3191 | .enable_bit = AM35XX_EN_UART4_SHIFT, |
| @@ -3290,10 +3289,10 @@ static struct omap_clk omap3xxx_clks[] = { | |||
| 3290 | CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), | 3289 | CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), |
| 3291 | CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), | 3290 | CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), |
| 3292 | CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), | 3291 | CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), |
| 3293 | CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3292 | CLK("omap_hsmmc.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
| 3294 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX), | 3293 | CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_3XXX), |
| 3295 | CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX), | 3294 | CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX), |
| 3296 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX), | 3295 | CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_3XXX), |
| 3297 | CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), | 3296 | CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), |
| 3298 | CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), | 3297 | CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), |
| 3299 | CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX), | 3298 | CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX), |
| @@ -3323,13 +3322,13 @@ static struct omap_clk omap3xxx_clks[] = { | |||
| 3323 | CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), | 3322 | CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), |
| 3324 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3323 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
| 3325 | CLK("ehci-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3324 | CLK("ehci-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
| 3326 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3325 | CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
| 3327 | CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), | 3326 | CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), |
| 3328 | CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), | 3327 | CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), |
| 3329 | CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), | 3328 | CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), |
| 3330 | CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), | 3329 | CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), |
| 3331 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), | 3330 | CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX), |
| 3332 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), | 3331 | CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX), |
| 3333 | CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), | 3332 | CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), |
| 3334 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), | 3333 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), |
| 3335 | CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), | 3334 | CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), |
| @@ -3538,6 +3537,9 @@ int __init omap3xxx_clk_init(void) | |||
| 3538 | omap2_init_clk_clkdm(c->lk.clk); | 3537 | omap2_init_clk_clkdm(c->lk.clk); |
| 3539 | } | 3538 | } |
| 3540 | 3539 | ||
| 3540 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
| 3541 | omap_clk_disable_autoidle_all(); | ||
| 3542 | |||
| 3541 | recalculate_root_clocks(); | 3543 | recalculate_root_clocks(); |
| 3542 | 3544 | ||
| 3543 | pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", | 3545 | pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", |
| @@ -3551,7 +3553,8 @@ int __init omap3xxx_clk_init(void) | |||
| 3551 | clk_enable_init_clocks(); | 3553 | clk_enable_init_clocks(); |
| 3552 | 3554 | ||
| 3553 | /* | 3555 | /* |
| 3554 | * Lock DPLL5 and put it in autoidle. | 3556 | * Lock DPLL5 -- here only until other device init code can |
| 3557 | * handle this | ||
| 3555 | */ | 3558 | */ |
| 3556 | if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0)) | 3559 | if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0)) |
| 3557 | omap3_clk_lock_dpll5(); | 3560 | omap3_clk_lock_dpll5(); |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index de9ec8ddd2ae..f1fedb71ae08 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
| @@ -278,8 +278,10 @@ static struct clk dpll_abe_ck = { | |||
| 278 | static struct clk dpll_abe_x2_ck = { | 278 | static struct clk dpll_abe_x2_ck = { |
| 279 | .name = "dpll_abe_x2_ck", | 279 | .name = "dpll_abe_x2_ck", |
| 280 | .parent = &dpll_abe_ck, | 280 | .parent = &dpll_abe_ck, |
| 281 | .ops = &clkops_null, | 281 | .flags = CLOCK_CLKOUTX2, |
| 282 | .ops = &clkops_omap4_dpllmx_ops, | ||
| 282 | .recalc = &omap3_clkoutx2_recalc, | 283 | .recalc = &omap3_clkoutx2_recalc, |
| 284 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, | ||
| 283 | }; | 285 | }; |
| 284 | 286 | ||
| 285 | static const struct clksel_rate div31_1to31_rates[] = { | 287 | static const struct clksel_rate div31_1to31_rates[] = { |
| @@ -328,7 +330,7 @@ static struct clk dpll_abe_m2x2_ck = { | |||
| 328 | .clksel = dpll_abe_m2x2_div, | 330 | .clksel = dpll_abe_m2x2_div, |
| 329 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, | 331 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, |
| 330 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 332 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
| 331 | .ops = &clkops_null, | 333 | .ops = &clkops_omap4_dpllmx_ops, |
| 332 | .recalc = &omap2_clksel_recalc, | 334 | .recalc = &omap2_clksel_recalc, |
| 333 | .round_rate = &omap2_clksel_round_rate, | 335 | .round_rate = &omap2_clksel_round_rate, |
| 334 | .set_rate = &omap2_clksel_set_rate, | 336 | .set_rate = &omap2_clksel_set_rate, |
| @@ -395,7 +397,7 @@ static struct clk dpll_abe_m3x2_ck = { | |||
| 395 | .clksel = dpll_abe_m2x2_div, | 397 | .clksel = dpll_abe_m2x2_div, |
| 396 | .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, | 398 | .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, |
| 397 | .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, | 399 | .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, |
| 398 | .ops = &clkops_null, | 400 | .ops = &clkops_omap4_dpllmx_ops, |
| 399 | .recalc = &omap2_clksel_recalc, | 401 | .recalc = &omap2_clksel_recalc, |
| 400 | .round_rate = &omap2_clksel_round_rate, | 402 | .round_rate = &omap2_clksel_round_rate, |
| 401 | .set_rate = &omap2_clksel_set_rate, | 403 | .set_rate = &omap2_clksel_set_rate, |
| @@ -443,13 +445,14 @@ static struct clk dpll_core_ck = { | |||
| 443 | .parent = &sys_clkin_ck, | 445 | .parent = &sys_clkin_ck, |
| 444 | .dpll_data = &dpll_core_dd, | 446 | .dpll_data = &dpll_core_dd, |
| 445 | .init = &omap2_init_dpll_parent, | 447 | .init = &omap2_init_dpll_parent, |
| 446 | .ops = &clkops_null, | 448 | .ops = &clkops_omap3_core_dpll_ops, |
| 447 | .recalc = &omap3_dpll_recalc, | 449 | .recalc = &omap3_dpll_recalc, |
| 448 | }; | 450 | }; |
| 449 | 451 | ||
| 450 | static struct clk dpll_core_x2_ck = { | 452 | static struct clk dpll_core_x2_ck = { |
| 451 | .name = "dpll_core_x2_ck", | 453 | .name = "dpll_core_x2_ck", |
| 452 | .parent = &dpll_core_ck, | 454 | .parent = &dpll_core_ck, |
| 455 | .flags = CLOCK_CLKOUTX2, | ||
| 453 | .ops = &clkops_null, | 456 | .ops = &clkops_null, |
| 454 | .recalc = &omap3_clkoutx2_recalc, | 457 | .recalc = &omap3_clkoutx2_recalc, |
| 455 | }; | 458 | }; |
| @@ -465,7 +468,7 @@ static struct clk dpll_core_m6x2_ck = { | |||
| 465 | .clksel = dpll_core_m6x2_div, | 468 | .clksel = dpll_core_m6x2_div, |
| 466 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, | 469 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, |
| 467 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, | 470 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, |
| 468 | .ops = &clkops_null, | 471 | .ops = &clkops_omap4_dpllmx_ops, |
| 469 | .recalc = &omap2_clksel_recalc, | 472 | .recalc = &omap2_clksel_recalc, |
| 470 | .round_rate = &omap2_clksel_round_rate, | 473 | .round_rate = &omap2_clksel_round_rate, |
| 471 | .set_rate = &omap2_clksel_set_rate, | 474 | .set_rate = &omap2_clksel_set_rate, |
| @@ -495,7 +498,7 @@ static struct clk dpll_core_m2_ck = { | |||
| 495 | .clksel = dpll_core_m2_div, | 498 | .clksel = dpll_core_m2_div, |
| 496 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, | 499 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, |
| 497 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 500 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
| 498 | .ops = &clkops_null, | 501 | .ops = &clkops_omap4_dpllmx_ops, |
| 499 | .recalc = &omap2_clksel_recalc, | 502 | .recalc = &omap2_clksel_recalc, |
| 500 | .round_rate = &omap2_clksel_round_rate, | 503 | .round_rate = &omap2_clksel_round_rate, |
| 501 | .set_rate = &omap2_clksel_set_rate, | 504 | .set_rate = &omap2_clksel_set_rate, |
| @@ -515,7 +518,7 @@ static struct clk dpll_core_m5x2_ck = { | |||
| 515 | .clksel = dpll_core_m6x2_div, | 518 | .clksel = dpll_core_m6x2_div, |
| 516 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, | 519 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, |
| 517 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, | 520 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, |
| 518 | .ops = &clkops_null, | 521 | .ops = &clkops_omap4_dpllmx_ops, |
| 519 | .recalc = &omap2_clksel_recalc, | 522 | .recalc = &omap2_clksel_recalc, |
| 520 | .round_rate = &omap2_clksel_round_rate, | 523 | .round_rate = &omap2_clksel_round_rate, |
| 521 | .set_rate = &omap2_clksel_set_rate, | 524 | .set_rate = &omap2_clksel_set_rate, |
| @@ -581,7 +584,7 @@ static struct clk dpll_core_m4x2_ck = { | |||
| 581 | .clksel = dpll_core_m6x2_div, | 584 | .clksel = dpll_core_m6x2_div, |
| 582 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, | 585 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, |
| 583 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, | 586 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, |
| 584 | .ops = &clkops_null, | 587 | .ops = &clkops_omap4_dpllmx_ops, |
| 585 | .recalc = &omap2_clksel_recalc, | 588 | .recalc = &omap2_clksel_recalc, |
| 586 | .round_rate = &omap2_clksel_round_rate, | 589 | .round_rate = &omap2_clksel_round_rate, |
| 587 | .set_rate = &omap2_clksel_set_rate, | 590 | .set_rate = &omap2_clksel_set_rate, |
| @@ -606,7 +609,7 @@ static struct clk dpll_abe_m2_ck = { | |||
| 606 | .clksel = dpll_abe_m2_div, | 609 | .clksel = dpll_abe_m2_div, |
| 607 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, | 610 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, |
| 608 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 611 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
| 609 | .ops = &clkops_null, | 612 | .ops = &clkops_omap4_dpllmx_ops, |
| 610 | .recalc = &omap2_clksel_recalc, | 613 | .recalc = &omap2_clksel_recalc, |
| 611 | .round_rate = &omap2_clksel_round_rate, | 614 | .round_rate = &omap2_clksel_round_rate, |
| 612 | .set_rate = &omap2_clksel_set_rate, | 615 | .set_rate = &omap2_clksel_set_rate, |
| @@ -632,7 +635,7 @@ static struct clk dpll_core_m7x2_ck = { | |||
| 632 | .clksel = dpll_core_m6x2_div, | 635 | .clksel = dpll_core_m6x2_div, |
| 633 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, | 636 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, |
| 634 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, | 637 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, |
| 635 | .ops = &clkops_null, | 638 | .ops = &clkops_omap4_dpllmx_ops, |
| 636 | .recalc = &omap2_clksel_recalc, | 639 | .recalc = &omap2_clksel_recalc, |
| 637 | .round_rate = &omap2_clksel_round_rate, | 640 | .round_rate = &omap2_clksel_round_rate, |
| 638 | .set_rate = &omap2_clksel_set_rate, | 641 | .set_rate = &omap2_clksel_set_rate, |
| @@ -689,6 +692,7 @@ static struct clk dpll_iva_ck = { | |||
| 689 | static struct clk dpll_iva_x2_ck = { | 692 | static struct clk dpll_iva_x2_ck = { |
| 690 | .name = "dpll_iva_x2_ck", | 693 | .name = "dpll_iva_x2_ck", |
| 691 | .parent = &dpll_iva_ck, | 694 | .parent = &dpll_iva_ck, |
| 695 | .flags = CLOCK_CLKOUTX2, | ||
| 692 | .ops = &clkops_null, | 696 | .ops = &clkops_null, |
| 693 | .recalc = &omap3_clkoutx2_recalc, | 697 | .recalc = &omap3_clkoutx2_recalc, |
| 694 | }; | 698 | }; |
| @@ -704,7 +708,7 @@ static struct clk dpll_iva_m4x2_ck = { | |||
| 704 | .clksel = dpll_iva_m4x2_div, | 708 | .clksel = dpll_iva_m4x2_div, |
| 705 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, | 709 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, |
| 706 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, | 710 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, |
| 707 | .ops = &clkops_null, | 711 | .ops = &clkops_omap4_dpllmx_ops, |
| 708 | .recalc = &omap2_clksel_recalc, | 712 | .recalc = &omap2_clksel_recalc, |
| 709 | .round_rate = &omap2_clksel_round_rate, | 713 | .round_rate = &omap2_clksel_round_rate, |
| 710 | .set_rate = &omap2_clksel_set_rate, | 714 | .set_rate = &omap2_clksel_set_rate, |
| @@ -716,7 +720,7 @@ static struct clk dpll_iva_m5x2_ck = { | |||
| 716 | .clksel = dpll_iva_m4x2_div, | 720 | .clksel = dpll_iva_m4x2_div, |
| 717 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, | 721 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, |
| 718 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, | 722 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, |
| 719 | .ops = &clkops_null, | 723 | .ops = &clkops_omap4_dpllmx_ops, |
| 720 | .recalc = &omap2_clksel_recalc, | 724 | .recalc = &omap2_clksel_recalc, |
| 721 | .round_rate = &omap2_clksel_round_rate, | 725 | .round_rate = &omap2_clksel_round_rate, |
| 722 | .set_rate = &omap2_clksel_set_rate, | 726 | .set_rate = &omap2_clksel_set_rate, |
| @@ -764,7 +768,7 @@ static struct clk dpll_mpu_m2_ck = { | |||
| 764 | .clksel = dpll_mpu_m2_div, | 768 | .clksel = dpll_mpu_m2_div, |
| 765 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU, | 769 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU, |
| 766 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 770 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
| 767 | .ops = &clkops_null, | 771 | .ops = &clkops_omap4_dpllmx_ops, |
| 768 | .recalc = &omap2_clksel_recalc, | 772 | .recalc = &omap2_clksel_recalc, |
| 769 | .round_rate = &omap2_clksel_round_rate, | 773 | .round_rate = &omap2_clksel_round_rate, |
| 770 | .set_rate = &omap2_clksel_set_rate, | 774 | .set_rate = &omap2_clksel_set_rate, |
| @@ -837,7 +841,7 @@ static struct clk dpll_per_m2_ck = { | |||
| 837 | .clksel = dpll_per_m2_div, | 841 | .clksel = dpll_per_m2_div, |
| 838 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, | 842 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, |
| 839 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 843 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
| 840 | .ops = &clkops_null, | 844 | .ops = &clkops_omap4_dpllmx_ops, |
| 841 | .recalc = &omap2_clksel_recalc, | 845 | .recalc = &omap2_clksel_recalc, |
| 842 | .round_rate = &omap2_clksel_round_rate, | 846 | .round_rate = &omap2_clksel_round_rate, |
| 843 | .set_rate = &omap2_clksel_set_rate, | 847 | .set_rate = &omap2_clksel_set_rate, |
| @@ -846,8 +850,10 @@ static struct clk dpll_per_m2_ck = { | |||
| 846 | static struct clk dpll_per_x2_ck = { | 850 | static struct clk dpll_per_x2_ck = { |
| 847 | .name = "dpll_per_x2_ck", | 851 | .name = "dpll_per_x2_ck", |
| 848 | .parent = &dpll_per_ck, | 852 | .parent = &dpll_per_ck, |
| 849 | .ops = &clkops_null, | 853 | .flags = CLOCK_CLKOUTX2, |
| 854 | .ops = &clkops_omap4_dpllmx_ops, | ||
| 850 | .recalc = &omap3_clkoutx2_recalc, | 855 | .recalc = &omap3_clkoutx2_recalc, |
| 856 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, | ||
| 851 | }; | 857 | }; |
| 852 | 858 | ||
| 853 | static const struct clksel dpll_per_m2x2_div[] = { | 859 | static const struct clksel dpll_per_m2x2_div[] = { |
| @@ -861,7 +867,7 @@ static struct clk dpll_per_m2x2_ck = { | |||
| 861 | .clksel = dpll_per_m2x2_div, | 867 | .clksel = dpll_per_m2x2_div, |
| 862 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, | 868 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, |
| 863 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 869 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
| 864 | .ops = &clkops_null, | 870 | .ops = &clkops_omap4_dpllmx_ops, |
| 865 | .recalc = &omap2_clksel_recalc, | 871 | .recalc = &omap2_clksel_recalc, |
| 866 | .round_rate = &omap2_clksel_round_rate, | 872 | .round_rate = &omap2_clksel_round_rate, |
| 867 | .set_rate = &omap2_clksel_set_rate, | 873 | .set_rate = &omap2_clksel_set_rate, |
| @@ -887,7 +893,7 @@ static struct clk dpll_per_m4x2_ck = { | |||
| 887 | .clksel = dpll_per_m2x2_div, | 893 | .clksel = dpll_per_m2x2_div, |
| 888 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, | 894 | .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, |
| 889 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, | 895 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, |
| 890 | .ops = &clkops_null, | 896 | .ops = &clkops_omap4_dpllmx_ops, |
| 891 | .recalc = &omap2_clksel_recalc, | 897 | .recalc = &omap2_clksel_recalc, |
| 892 | .round_rate = &omap2_clksel_round_rate, | 898 | .round_rate = &omap2_clksel_round_rate, |
| 893 | .set_rate = &omap2_clksel_set_rate, | 899 | .set_rate = &omap2_clksel_set_rate, |
| @@ -899,7 +905,7 @@ static struct clk dpll_per_m5x2_ck = { | |||
| 899 | .clksel = dpll_per_m2x2_div, | 905 | .clksel = dpll_per_m2x2_div, |
| 900 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, | 906 | .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, |
| 901 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, | 907 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, |
| 902 | .ops = &clkops_null, | 908 | .ops = &clkops_omap4_dpllmx_ops, |
| 903 | .recalc = &omap2_clksel_recalc, | 909 | .recalc = &omap2_clksel_recalc, |
| 904 | .round_rate = &omap2_clksel_round_rate, | 910 | .round_rate = &omap2_clksel_round_rate, |
| 905 | .set_rate = &omap2_clksel_set_rate, | 911 | .set_rate = &omap2_clksel_set_rate, |
| @@ -911,7 +917,7 @@ static struct clk dpll_per_m6x2_ck = { | |||
| 911 | .clksel = dpll_per_m2x2_div, | 917 | .clksel = dpll_per_m2x2_div, |
| 912 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, | 918 | .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, |
| 913 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, | 919 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, |
| 914 | .ops = &clkops_null, | 920 | .ops = &clkops_omap4_dpllmx_ops, |
| 915 | .recalc = &omap2_clksel_recalc, | 921 | .recalc = &omap2_clksel_recalc, |
| 916 | .round_rate = &omap2_clksel_round_rate, | 922 | .round_rate = &omap2_clksel_round_rate, |
| 917 | .set_rate = &omap2_clksel_set_rate, | 923 | .set_rate = &omap2_clksel_set_rate, |
| @@ -923,7 +929,7 @@ static struct clk dpll_per_m7x2_ck = { | |||
| 923 | .clksel = dpll_per_m2x2_div, | 929 | .clksel = dpll_per_m2x2_div, |
| 924 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, | 930 | .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, |
| 925 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, | 931 | .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, |
| 926 | .ops = &clkops_null, | 932 | .ops = &clkops_omap4_dpllmx_ops, |
| 927 | .recalc = &omap2_clksel_recalc, | 933 | .recalc = &omap2_clksel_recalc, |
| 928 | .round_rate = &omap2_clksel_round_rate, | 934 | .round_rate = &omap2_clksel_round_rate, |
| 929 | .set_rate = &omap2_clksel_set_rate, | 935 | .set_rate = &omap2_clksel_set_rate, |
| @@ -964,6 +970,7 @@ static struct clk dpll_unipro_ck = { | |||
| 964 | static struct clk dpll_unipro_x2_ck = { | 970 | static struct clk dpll_unipro_x2_ck = { |
| 965 | .name = "dpll_unipro_x2_ck", | 971 | .name = "dpll_unipro_x2_ck", |
| 966 | .parent = &dpll_unipro_ck, | 972 | .parent = &dpll_unipro_ck, |
| 973 | .flags = CLOCK_CLKOUTX2, | ||
| 967 | .ops = &clkops_null, | 974 | .ops = &clkops_null, |
| 968 | .recalc = &omap3_clkoutx2_recalc, | 975 | .recalc = &omap3_clkoutx2_recalc, |
| 969 | }; | 976 | }; |
| @@ -979,7 +986,7 @@ static struct clk dpll_unipro_m2x2_ck = { | |||
| 979 | .clksel = dpll_unipro_m2x2_div, | 986 | .clksel = dpll_unipro_m2x2_div, |
| 980 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, | 987 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, |
| 981 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, | 988 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, |
| 982 | .ops = &clkops_null, | 989 | .ops = &clkops_omap4_dpllmx_ops, |
| 983 | .recalc = &omap2_clksel_recalc, | 990 | .recalc = &omap2_clksel_recalc, |
| 984 | .round_rate = &omap2_clksel_round_rate, | 991 | .round_rate = &omap2_clksel_round_rate, |
| 985 | .set_rate = &omap2_clksel_set_rate, | 992 | .set_rate = &omap2_clksel_set_rate, |
| @@ -1028,7 +1035,8 @@ static struct clk dpll_usb_ck = { | |||
| 1028 | static struct clk dpll_usb_clkdcoldo_ck = { | 1035 | static struct clk dpll_usb_clkdcoldo_ck = { |
| 1029 | .name = "dpll_usb_clkdcoldo_ck", | 1036 | .name = "dpll_usb_clkdcoldo_ck", |
| 1030 | .parent = &dpll_usb_ck, | 1037 | .parent = &dpll_usb_ck, |
| 1031 | .ops = &clkops_null, | 1038 | .ops = &clkops_omap4_dpllmx_ops, |
| 1039 | .clksel_reg = OMAP4430_CM_CLKDCOLDO_DPLL_USB, | ||
| 1032 | .recalc = &followparent_recalc, | 1040 | .recalc = &followparent_recalc, |
| 1033 | }; | 1041 | }; |
| 1034 | 1042 | ||
| @@ -1043,7 +1051,7 @@ static struct clk dpll_usb_m2_ck = { | |||
| 1043 | .clksel = dpll_usb_m2_div, | 1051 | .clksel = dpll_usb_m2_div, |
| 1044 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB, | 1052 | .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB, |
| 1045 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK, | 1053 | .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK, |
| 1046 | .ops = &clkops_null, | 1054 | .ops = &clkops_omap4_dpllmx_ops, |
| 1047 | .recalc = &omap2_clksel_recalc, | 1055 | .recalc = &omap2_clksel_recalc, |
| 1048 | .round_rate = &omap2_clksel_round_rate, | 1056 | .round_rate = &omap2_clksel_round_rate, |
| 1049 | .set_rate = &omap2_clksel_set_rate, | 1057 | .set_rate = &omap2_clksel_set_rate, |
| @@ -3158,11 +3166,11 @@ static struct omap_clk omap44xx_clks[] = { | |||
| 3158 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), | 3166 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), |
| 3159 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), | 3167 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), |
| 3160 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), | 3168 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), |
| 3161 | CLK("mmci-omap-hs.0", "fck", &mmc1_fck, CK_443X), | 3169 | CLK("omap_hsmmc.0", "fck", &mmc1_fck, CK_443X), |
| 3162 | CLK("mmci-omap-hs.1", "fck", &mmc2_fck, CK_443X), | 3170 | CLK("omap_hsmmc.1", "fck", &mmc2_fck, CK_443X), |
| 3163 | CLK("mmci-omap-hs.2", "fck", &mmc3_fck, CK_443X), | 3171 | CLK("omap_hsmmc.2", "fck", &mmc3_fck, CK_443X), |
| 3164 | CLK("mmci-omap-hs.3", "fck", &mmc4_fck, CK_443X), | 3172 | CLK("omap_hsmmc.3", "fck", &mmc4_fck, CK_443X), |
| 3165 | CLK("mmci-omap-hs.4", "fck", &mmc5_fck, CK_443X), | 3173 | CLK("omap_hsmmc.4", "fck", &mmc5_fck, CK_443X), |
| 3166 | CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), | 3174 | CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), |
| 3167 | CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), | 3175 | CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), |
| 3168 | CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), | 3176 | CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), |
| @@ -3245,11 +3253,11 @@ static struct omap_clk omap44xx_clks[] = { | |||
| 3245 | CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), | 3253 | CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), |
| 3246 | CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), | 3254 | CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), |
| 3247 | CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X), | 3255 | CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X), |
| 3248 | CLK("mmci-omap-hs.0", "ick", &dummy_ck, CK_443X), | 3256 | CLK("omap_hsmmc.0", "ick", &dummy_ck, CK_443X), |
| 3249 | CLK("mmci-omap-hs.1", "ick", &dummy_ck, CK_443X), | 3257 | CLK("omap_hsmmc.1", "ick", &dummy_ck, CK_443X), |
| 3250 | CLK("mmci-omap-hs.2", "ick", &dummy_ck, CK_443X), | 3258 | CLK("omap_hsmmc.2", "ick", &dummy_ck, CK_443X), |
| 3251 | CLK("mmci-omap-hs.3", "ick", &dummy_ck, CK_443X), | 3259 | CLK("omap_hsmmc.3", "ick", &dummy_ck, CK_443X), |
| 3252 | CLK("mmci-omap-hs.4", "ick", &dummy_ck, CK_443X), | 3260 | CLK("omap_hsmmc.4", "ick", &dummy_ck, CK_443X), |
| 3253 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X), | 3261 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X), |
| 3254 | CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X), | 3262 | CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X), |
| 3255 | CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X), | 3263 | CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X), |
| @@ -3301,6 +3309,9 @@ int __init omap4xxx_clk_init(void) | |||
| 3301 | omap2_init_clk_clkdm(c->lk.clk); | 3309 | omap2_init_clk_clkdm(c->lk.clk); |
| 3302 | } | 3310 | } |
| 3303 | 3311 | ||
| 3312 | /* Disable autoidle on all clocks; let the PM code enable it later */ | ||
| 3313 | omap_clk_disable_autoidle_all(); | ||
| 3314 | |||
| 3304 | recalculate_root_clocks(); | 3315 | recalculate_root_clocks(); |
| 3305 | 3316 | ||
| 3306 | /* | 3317 | /* |
diff --git a/arch/arm/mach-omap2/clock_common_data.c b/arch/arm/mach-omap2/clock_common_data.c index 1cf8131205fa..6424d46be14a 100644 --- a/arch/arm/mach-omap2/clock_common_data.c +++ b/arch/arm/mach-omap2/clock_common_data.c | |||
| @@ -37,3 +37,9 @@ const struct clksel_rate gfx_l3_rates[] = { | |||
| 37 | { .div = 0 } | 37 | { .div = 0 } |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | const struct clksel_rate dsp_ick_rates[] = { | ||
| 41 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
| 42 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
| 43 | { .div = 3, .val = 3, .flags = RATE_IN_243X }, | ||
| 44 | { .div = 0 }, | ||
| 45 | }; | ||
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index a0341dee1c3a..ab878545bd9b 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
| @@ -173,7 +173,7 @@ void _clkdm_add_autodeps(struct clockdomain *clkdm) | |||
| 173 | { | 173 | { |
| 174 | struct clkdm_autodep *autodep; | 174 | struct clkdm_autodep *autodep; |
| 175 | 175 | ||
| 176 | if (!autodeps) | 176 | if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS) |
| 177 | return; | 177 | return; |
| 178 | 178 | ||
| 179 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { | 179 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { |
| @@ -207,7 +207,7 @@ void _clkdm_del_autodeps(struct clockdomain *clkdm) | |||
| 207 | { | 207 | { |
| 208 | struct clkdm_autodep *autodep; | 208 | struct clkdm_autodep *autodep; |
| 209 | 209 | ||
| 210 | if (!autodeps) | 210 | if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS) |
| 211 | return; | 211 | return; |
| 212 | 212 | ||
| 213 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { | 213 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { |
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h index de52f059f9e2..85b3dce65640 100644 --- a/arch/arm/mach-omap2/clockdomain.h +++ b/arch/arm/mach-omap2/clockdomain.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * OMAP2/3 clockdomain framework functions | 4 | * OMAP2/3 clockdomain framework functions |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2008 Texas Instruments, Inc. | 6 | * Copyright (C) 2008 Texas Instruments, Inc. |
| 7 | * Copyright (C) 2008-2010 Nokia Corporation | 7 | * Copyright (C) 2008-2011 Nokia Corporation |
| 8 | * | 8 | * |
| 9 | * Paul Walmsley | 9 | * Paul Walmsley |
| 10 | * | 10 | * |
| @@ -22,11 +22,19 @@ | |||
| 22 | #include <plat/clock.h> | 22 | #include <plat/clock.h> |
| 23 | #include <plat/cpu.h> | 23 | #include <plat/cpu.h> |
| 24 | 24 | ||
| 25 | /* Clockdomain capability flags */ | 25 | /* |
| 26 | * Clockdomain flags | ||
| 27 | * | ||
| 28 | * XXX Document CLKDM_CAN_* flags | ||
| 29 | * | ||
| 30 | * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this | ||
| 31 | * clockdomain. (Currently, this applies to OMAP3 clockdomains only.) | ||
| 32 | */ | ||
| 26 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) | 33 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) |
| 27 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) | 34 | #define CLKDM_CAN_FORCE_WAKEUP (1 << 1) |
| 28 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) | 35 | #define CLKDM_CAN_ENABLE_AUTO (1 << 2) |
| 29 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) | 36 | #define CLKDM_CAN_DISABLE_AUTO (1 << 3) |
| 37 | #define CLKDM_NO_AUTODEPS (1 << 4) | ||
| 30 | 38 | ||
| 31 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) | 39 | #define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) |
| 32 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) | 40 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) |
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c index ffdfe54f3264..13bde95b6790 100644 --- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c | |||
| @@ -89,6 +89,8 @@ static struct clkdm_dep gfx_sgx_wkdeps[] = { | |||
| 89 | 89 | ||
| 90 | /* 24XX-specific possible dependencies */ | 90 | /* 24XX-specific possible dependencies */ |
| 91 | 91 | ||
| 92 | #ifdef CONFIG_ARCH_OMAP2 | ||
| 93 | |||
| 92 | /* Wakeup dependency source arrays */ | 94 | /* Wakeup dependency source arrays */ |
| 93 | 95 | ||
| 94 | /* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ | 96 | /* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ |
| @@ -168,6 +170,7 @@ static struct clkdm_dep core_24xx_wkdeps[] = { | |||
| 168 | { NULL }, | 170 | { NULL }, |
| 169 | }; | 171 | }; |
| 170 | 172 | ||
| 173 | #endif /* CONFIG_ARCH_OMAP2 */ | ||
| 171 | 174 | ||
| 172 | /* 2430-specific possible wakeup dependencies */ | 175 | /* 2430-specific possible wakeup dependencies */ |
| 173 | 176 | ||
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index f53258acd1da..a607ec196e8b 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
| @@ -514,7 +514,7 @@ static struct clockdomain mpu0_44xx_clkdm = { | |||
| 514 | .pwrdm = { .name = "cpu0_pwrdm" }, | 514 | .pwrdm = { .name = "cpu0_pwrdm" }, |
| 515 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, | 515 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
| 516 | .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, | 516 | .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, |
| 517 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS, | 517 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS, |
| 518 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 518 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
| 519 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 519 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
| 520 | }; | 520 | }; |
| @@ -524,7 +524,7 @@ static struct clockdomain mpu1_44xx_clkdm = { | |||
| 524 | .pwrdm = { .name = "cpu1_pwrdm" }, | 524 | .pwrdm = { .name = "cpu1_pwrdm" }, |
| 525 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, | 525 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
| 526 | .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, | 526 | .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, |
| 527 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS, | 527 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS, |
| 528 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 528 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
| 529 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 529 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
| 530 | }; | 530 | }; |
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h index d70660e82fe6..686290437568 100644 --- a/arch/arm/mach-omap2/cm-regbits-24xx.h +++ b/arch/arm/mach-omap2/cm-regbits-24xx.h | |||
| @@ -210,8 +210,11 @@ | |||
| 210 | #define OMAP24XX_AUTO_USB_MASK (1 << 0) | 210 | #define OMAP24XX_AUTO_USB_MASK (1 << 0) |
| 211 | 211 | ||
| 212 | /* CM_AUTOIDLE3_CORE */ | 212 | /* CM_AUTOIDLE3_CORE */ |
| 213 | #define OMAP24XX_AUTO_SDRC_SHIFT 2 | ||
| 213 | #define OMAP24XX_AUTO_SDRC_MASK (1 << 2) | 214 | #define OMAP24XX_AUTO_SDRC_MASK (1 << 2) |
| 215 | #define OMAP24XX_AUTO_GPMC_SHIFT 1 | ||
| 214 | #define OMAP24XX_AUTO_GPMC_MASK (1 << 1) | 216 | #define OMAP24XX_AUTO_GPMC_MASK (1 << 1) |
| 217 | #define OMAP24XX_AUTO_SDMA_SHIFT 0 | ||
| 215 | #define OMAP24XX_AUTO_SDMA_MASK (1 << 0) | 218 | #define OMAP24XX_AUTO_SDMA_MASK (1 << 0) |
| 216 | 219 | ||
| 217 | /* CM_AUTOIDLE4_CORE */ | 220 | /* CM_AUTOIDLE4_CORE */ |
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c index 96954aa48671..9d0dec806e92 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c | |||
| @@ -25,6 +25,14 @@ | |||
| 25 | #include "cm-regbits-24xx.h" | 25 | #include "cm-regbits-24xx.h" |
| 26 | #include "cm-regbits-34xx.h" | 26 | #include "cm-regbits-34xx.h" |
| 27 | 27 | ||
| 28 | /* CM_AUTOIDLE_PLL.AUTO_* bit values for DPLLs */ | ||
| 29 | #define DPLL_AUTOIDLE_DISABLE 0x0 | ||
| 30 | #define OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP 0x3 | ||
| 31 | |||
| 32 | /* CM_AUTOIDLE_PLL.AUTO_* bit values for APLLs (OMAP2xxx only) */ | ||
| 33 | #define OMAP2XXX_APLL_AUTOIDLE_DISABLE 0x0 | ||
| 34 | #define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3 | ||
| 35 | |||
| 28 | static const u8 cm_idlest_offs[] = { | 36 | static const u8 cm_idlest_offs[] = { |
| 29 | CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 | 37 | CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 |
| 30 | }; | 38 | }; |
| @@ -125,6 +133,67 @@ void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask) | |||
| 125 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask); | 133 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask); |
| 126 | } | 134 | } |
| 127 | 135 | ||
| 136 | /* | ||
| 137 | * DPLL autoidle control | ||
| 138 | */ | ||
| 139 | |||
| 140 | static void _omap2xxx_set_dpll_autoidle(u8 m) | ||
| 141 | { | ||
| 142 | u32 v; | ||
| 143 | |||
| 144 | v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); | ||
| 145 | v &= ~OMAP24XX_AUTO_DPLL_MASK; | ||
| 146 | v |= m << OMAP24XX_AUTO_DPLL_SHIFT; | ||
| 147 | omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE); | ||
| 148 | } | ||
| 149 | |||
| 150 | void omap2xxx_cm_set_dpll_disable_autoidle(void) | ||
| 151 | { | ||
| 152 | _omap2xxx_set_dpll_autoidle(OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP); | ||
| 153 | } | ||
| 154 | |||
| 155 | void omap2xxx_cm_set_dpll_auto_low_power_stop(void) | ||
| 156 | { | ||
| 157 | _omap2xxx_set_dpll_autoidle(DPLL_AUTOIDLE_DISABLE); | ||
| 158 | } | ||
| 159 | |||
| 160 | /* | ||
| 161 | * APLL autoidle control | ||
| 162 | */ | ||
| 163 | |||
| 164 | static void _omap2xxx_set_apll_autoidle(u8 m, u32 mask) | ||
| 165 | { | ||
| 166 | u32 v; | ||
| 167 | |||
| 168 | v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); | ||
| 169 | v &= ~mask; | ||
| 170 | v |= m << __ffs(mask); | ||
| 171 | omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE); | ||
| 172 | } | ||
| 173 | |||
| 174 | void omap2xxx_cm_set_apll54_disable_autoidle(void) | ||
| 175 | { | ||
| 176 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, | ||
| 177 | OMAP24XX_AUTO_54M_MASK); | ||
| 178 | } | ||
| 179 | |||
| 180 | void omap2xxx_cm_set_apll54_auto_low_power_stop(void) | ||
| 181 | { | ||
| 182 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, | ||
| 183 | OMAP24XX_AUTO_54M_MASK); | ||
| 184 | } | ||
| 185 | |||
| 186 | void omap2xxx_cm_set_apll96_disable_autoidle(void) | ||
| 187 | { | ||
| 188 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, | ||
| 189 | OMAP24XX_AUTO_96M_MASK); | ||
| 190 | } | ||
| 191 | |||
| 192 | void omap2xxx_cm_set_apll96_auto_low_power_stop(void) | ||
| 193 | { | ||
| 194 | _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, | ||
| 195 | OMAP24XX_AUTO_96M_MASK); | ||
| 196 | } | ||
| 128 | 197 | ||
| 129 | /* | 198 | /* |
| 130 | * | 199 | * |
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h index 5e9ea5bd60b9..088bbad73db5 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.h +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h | |||
| @@ -122,6 +122,14 @@ extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask); | |||
| 122 | extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask); | 122 | extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask); |
| 123 | extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask); | 123 | extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask); |
| 124 | 124 | ||
| 125 | extern void omap2xxx_cm_set_dpll_disable_autoidle(void); | ||
| 126 | extern void omap2xxx_cm_set_dpll_auto_low_power_stop(void); | ||
| 127 | |||
| 128 | extern void omap2xxx_cm_set_apll54_disable_autoidle(void); | ||
| 129 | extern void omap2xxx_cm_set_apll54_auto_low_power_stop(void); | ||
| 130 | extern void omap2xxx_cm_set_apll96_disable_autoidle(void); | ||
| 131 | extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void); | ||
| 132 | |||
| 125 | #endif | 133 | #endif |
| 126 | 134 | ||
| 127 | /* CM register bits shared between 24XX and 3430 */ | 135 | /* CM register bits shared between 24XX and 3430 */ |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 71f099b85e7c..0d2d6a9c303c 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
| @@ -31,10 +31,75 @@ | |||
| 31 | #include <plat/dma.h> | 31 | #include <plat/dma.h> |
| 32 | #include <plat/omap_hwmod.h> | 32 | #include <plat/omap_hwmod.h> |
| 33 | #include <plat/omap_device.h> | 33 | #include <plat/omap_device.h> |
| 34 | #include <plat/omap4-keypad.h> | ||
| 34 | 35 | ||
| 35 | #include "mux.h" | 36 | #include "mux.h" |
| 36 | #include "control.h" | 37 | #include "control.h" |
| 37 | 38 | ||
| 39 | #define L3_MODULES_MAX_LEN 12 | ||
| 40 | #define L3_MODULES 3 | ||
| 41 | |||
| 42 | static int __init omap3_l3_init(void) | ||
| 43 | { | ||
| 44 | int l; | ||
| 45 | struct omap_hwmod *oh; | ||
| 46 | struct omap_device *od; | ||
| 47 | char oh_name[L3_MODULES_MAX_LEN]; | ||
| 48 | |||
| 49 | /* | ||
| 50 | * To avoid code running on other OMAPs in | ||
| 51 | * multi-omap builds | ||
| 52 | */ | ||
| 53 | if (!(cpu_is_omap34xx())) | ||
| 54 | return -ENODEV; | ||
| 55 | |||
| 56 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main"); | ||
| 57 | |||
| 58 | oh = omap_hwmod_lookup(oh_name); | ||
| 59 | |||
| 60 | if (!oh) | ||
| 61 | pr_err("could not look up %s\n", oh_name); | ||
| 62 | |||
| 63 | od = omap_device_build("omap_l3_smx", 0, oh, NULL, 0, | ||
| 64 | NULL, 0, 0); | ||
| 65 | |||
| 66 | WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); | ||
| 67 | |||
| 68 | return PTR_ERR(od); | ||
| 69 | } | ||
| 70 | postcore_initcall(omap3_l3_init); | ||
| 71 | |||
| 72 | static int __init omap4_l3_init(void) | ||
| 73 | { | ||
| 74 | int l, i; | ||
| 75 | struct omap_hwmod *oh[3]; | ||
| 76 | struct omap_device *od; | ||
| 77 | char oh_name[L3_MODULES_MAX_LEN]; | ||
| 78 | |||
| 79 | /* | ||
| 80 | * To avoid code running on other OMAPs in | ||
| 81 | * multi-omap builds | ||
| 82 | */ | ||
| 83 | if (!(cpu_is_omap44xx())) | ||
| 84 | return -ENODEV; | ||
| 85 | |||
| 86 | for (i = 0; i < L3_MODULES; i++) { | ||
| 87 | l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1); | ||
| 88 | |||
| 89 | oh[i] = omap_hwmod_lookup(oh_name); | ||
| 90 | if (!(oh[i])) | ||
| 91 | pr_err("could not look up %s\n", oh_name); | ||
| 92 | } | ||
| 93 | |||
| 94 | od = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, | ||
| 95 | 0, NULL, 0, 0); | ||
| 96 | |||
| 97 | WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); | ||
| 98 | |||
| 99 | return PTR_ERR(od); | ||
| 100 | } | ||
| 101 | postcore_initcall(omap4_l3_init); | ||
| 102 | |||
| 38 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) | 103 | #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) |
| 39 | 104 | ||
| 40 | static struct resource cam_resources[] = { | 105 | static struct resource cam_resources[] = { |
| @@ -142,96 +207,70 @@ static inline void omap_init_camera(void) | |||
| 142 | } | 207 | } |
| 143 | #endif | 208 | #endif |
| 144 | 209 | ||
| 145 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) | 210 | struct omap_device_pm_latency omap_keyboard_latency[] = { |
| 146 | |||
| 147 | #define MBOX_REG_SIZE 0x120 | ||
| 148 | |||
| 149 | #ifdef CONFIG_ARCH_OMAP2 | ||
| 150 | static struct resource omap2_mbox_resources[] = { | ||
| 151 | { | 211 | { |
| 152 | .start = OMAP24XX_MAILBOX_BASE, | 212 | .deactivate_func = omap_device_idle_hwmods, |
| 153 | .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, | 213 | .activate_func = omap_device_enable_hwmods, |
| 154 | .flags = IORESOURCE_MEM, | 214 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, |
| 155 | }, | ||
| 156 | { | ||
| 157 | .start = INT_24XX_MAIL_U0_MPU, | ||
| 158 | .flags = IORESOURCE_IRQ, | ||
| 159 | .name = "dsp", | ||
| 160 | }, | ||
| 161 | { | ||
| 162 | .start = INT_24XX_MAIL_U3_MPU, | ||
| 163 | .flags = IORESOURCE_IRQ, | ||
| 164 | .name = "iva", | ||
| 165 | }, | 215 | }, |
| 166 | }; | 216 | }; |
| 167 | static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources); | ||
| 168 | #else | ||
| 169 | #define omap2_mbox_resources NULL | ||
| 170 | #define omap2_mbox_resources_sz 0 | ||
| 171 | #endif | ||
| 172 | 217 | ||
| 173 | #ifdef CONFIG_ARCH_OMAP3 | 218 | int __init omap4_keyboard_init(struct omap4_keypad_platform_data |
| 174 | static struct resource omap3_mbox_resources[] = { | 219 | *sdp4430_keypad_data) |
| 175 | { | 220 | { |
| 176 | .start = OMAP34XX_MAILBOX_BASE, | 221 | struct omap_device *od; |
| 177 | .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, | 222 | struct omap_hwmod *oh; |
| 178 | .flags = IORESOURCE_MEM, | 223 | struct omap4_keypad_platform_data *keypad_data; |
| 179 | }, | 224 | unsigned int id = -1; |
| 180 | { | 225 | char *oh_name = "kbd"; |
| 181 | .start = INT_24XX_MAIL_U0_MPU, | 226 | char *name = "omap4-keypad"; |
| 182 | .flags = IORESOURCE_IRQ, | ||
| 183 | .name = "dsp", | ||
| 184 | }, | ||
| 185 | }; | ||
| 186 | static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources); | ||
| 187 | #else | ||
| 188 | #define omap3_mbox_resources NULL | ||
| 189 | #define omap3_mbox_resources_sz 0 | ||
| 190 | #endif | ||
| 191 | 227 | ||
| 192 | #ifdef CONFIG_ARCH_OMAP4 | 228 | oh = omap_hwmod_lookup(oh_name); |
| 229 | if (!oh) { | ||
| 230 | pr_err("Could not look up %s\n", oh_name); | ||
| 231 | return -ENODEV; | ||
| 232 | } | ||
| 193 | 233 | ||
| 194 | #define OMAP4_MBOX_REG_SIZE 0x130 | 234 | keypad_data = sdp4430_keypad_data; |
| 195 | static struct resource omap4_mbox_resources[] = { | ||
| 196 | { | ||
| 197 | .start = OMAP44XX_MAILBOX_BASE, | ||
| 198 | .end = OMAP44XX_MAILBOX_BASE + | ||
| 199 | OMAP4_MBOX_REG_SIZE - 1, | ||
| 200 | .flags = IORESOURCE_MEM, | ||
| 201 | }, | ||
| 202 | { | ||
| 203 | .start = OMAP44XX_IRQ_MAIL_U0, | ||
| 204 | .flags = IORESOURCE_IRQ, | ||
| 205 | .name = "mbox", | ||
| 206 | }, | ||
| 207 | }; | ||
| 208 | static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources); | ||
| 209 | #else | ||
| 210 | #define omap4_mbox_resources NULL | ||
| 211 | #define omap4_mbox_resources_sz 0 | ||
| 212 | #endif | ||
| 213 | 235 | ||
| 214 | static struct platform_device mbox_device = { | 236 | od = omap_device_build(name, id, oh, keypad_data, |
| 215 | .name = "omap-mailbox", | 237 | sizeof(struct omap4_keypad_platform_data), |
| 216 | .id = -1, | 238 | omap_keyboard_latency, |
| 239 | ARRAY_SIZE(omap_keyboard_latency), 0); | ||
| 240 | |||
| 241 | if (IS_ERR(od)) { | ||
| 242 | WARN(1, "Cant build omap_device for %s:%s.\n", | ||
| 243 | name, oh->name); | ||
| 244 | return PTR_ERR(od); | ||
| 245 | } | ||
| 246 | |||
| 247 | return 0; | ||
| 248 | } | ||
| 249 | |||
| 250 | #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) | ||
| 251 | static struct omap_device_pm_latency mbox_latencies[] = { | ||
| 252 | [0] = { | ||
| 253 | .activate_func = omap_device_enable_hwmods, | ||
| 254 | .deactivate_func = omap_device_idle_hwmods, | ||
| 255 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
| 256 | }, | ||
| 217 | }; | 257 | }; |
| 218 | 258 | ||
| 219 | static inline void omap_init_mbox(void) | 259 | static inline void omap_init_mbox(void) |
| 220 | { | 260 | { |
| 221 | if (cpu_is_omap24xx()) { | 261 | struct omap_hwmod *oh; |
| 222 | mbox_device.resource = omap2_mbox_resources; | 262 | struct omap_device *od; |
| 223 | mbox_device.num_resources = omap2_mbox_resources_sz; | 263 | |
| 224 | } else if (cpu_is_omap34xx()) { | 264 | oh = omap_hwmod_lookup("mailbox"); |
| 225 | mbox_device.resource = omap3_mbox_resources; | 265 | if (!oh) { |
| 226 | mbox_device.num_resources = omap3_mbox_resources_sz; | 266 | pr_err("%s: unable to find hwmod\n", __func__); |
| 227 | } else if (cpu_is_omap44xx()) { | ||
| 228 | mbox_device.resource = omap4_mbox_resources; | ||
| 229 | mbox_device.num_resources = omap4_mbox_resources_sz; | ||
| 230 | } else { | ||
| 231 | pr_err("%s: platform not supported\n", __func__); | ||
| 232 | return; | 267 | return; |
| 233 | } | 268 | } |
| 234 | platform_device_register(&mbox_device); | 269 | |
| 270 | od = omap_device_build("omap-mailbox", -1, oh, NULL, 0, | ||
| 271 | mbox_latencies, ARRAY_SIZE(mbox_latencies), 0); | ||
| 272 | WARN(IS_ERR(od), "%s: could not build device, err %ld\n", | ||
| 273 | __func__, PTR_ERR(od)); | ||
| 235 | } | 274 | } |
| 236 | #else | 275 | #else |
| 237 | static inline void omap_init_mbox(void) { } | 276 | static inline void omap_init_mbox(void) { } |
| @@ -503,117 +542,10 @@ static inline void omap_init_aes(void) { } | |||
| 503 | 542 | ||
| 504 | /*-------------------------------------------------------------------------*/ | 543 | /*-------------------------------------------------------------------------*/ |
| 505 | 544 | ||
| 506 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | 545 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) |
| 507 | |||
| 508 | #define MMCHS_SYSCONFIG 0x0010 | ||
| 509 | #define MMCHS_SYSCONFIG_SWRESET (1 << 1) | ||
| 510 | #define MMCHS_SYSSTATUS 0x0014 | ||
| 511 | #define MMCHS_SYSSTATUS_RESETDONE (1 << 0) | ||
| 512 | |||
| 513 | static struct platform_device dummy_pdev = { | ||
| 514 | .dev = { | ||
| 515 | .bus = &platform_bus_type, | ||
| 516 | }, | ||
| 517 | }; | ||
| 518 | |||
| 519 | /** | ||
| 520 | * omap_hsmmc_reset() - Full reset of each HS-MMC controller | ||
| 521 | * | ||
| 522 | * Ensure that each MMC controller is fully reset. Controllers | ||
| 523 | * left in an unknown state (by bootloader) may prevent retention | ||
| 524 | * or OFF-mode. This is especially important in cases where the | ||
| 525 | * MMC driver is not enabled, _or_ built as a module. | ||
| 526 | * | ||
| 527 | * In order for reset to work, interface, functional and debounce | ||
| 528 | * clocks must be enabled. The debounce clock comes from func_32k_clk | ||
| 529 | * and is not under SW control, so we only enable i- and f-clocks. | ||
| 530 | **/ | ||
| 531 | static void __init omap_hsmmc_reset(void) | ||
| 532 | { | ||
| 533 | u32 i, nr_controllers; | ||
| 534 | struct clk *iclk, *fclk; | ||
| 535 | |||
| 536 | if (cpu_is_omap242x()) | ||
| 537 | return; | ||
| 538 | |||
| 539 | nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC : | ||
| 540 | (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC); | ||
| 541 | |||
| 542 | for (i = 0; i < nr_controllers; i++) { | ||
| 543 | u32 v, base = 0; | ||
| 544 | struct device *dev = &dummy_pdev.dev; | ||
| 545 | |||
| 546 | switch (i) { | ||
| 547 | case 0: | ||
| 548 | base = OMAP2_MMC1_BASE; | ||
| 549 | break; | ||
| 550 | case 1: | ||
| 551 | base = OMAP2_MMC2_BASE; | ||
| 552 | break; | ||
| 553 | case 2: | ||
| 554 | base = OMAP3_MMC3_BASE; | ||
| 555 | break; | ||
| 556 | case 3: | ||
| 557 | if (!cpu_is_omap44xx()) | ||
| 558 | return; | ||
| 559 | base = OMAP4_MMC4_BASE; | ||
| 560 | break; | ||
| 561 | case 4: | ||
| 562 | if (!cpu_is_omap44xx()) | ||
| 563 | return; | ||
| 564 | base = OMAP4_MMC5_BASE; | ||
| 565 | break; | ||
| 566 | } | ||
| 567 | |||
| 568 | if (cpu_is_omap44xx()) | ||
| 569 | base += OMAP4_MMC_REG_OFFSET; | ||
| 570 | |||
| 571 | dummy_pdev.id = i; | ||
| 572 | dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i); | ||
| 573 | iclk = clk_get(dev, "ick"); | ||
| 574 | if (IS_ERR(iclk)) | ||
| 575 | goto err1; | ||
| 576 | if (clk_enable(iclk)) | ||
| 577 | goto err2; | ||
| 578 | |||
| 579 | fclk = clk_get(dev, "fck"); | ||
| 580 | if (IS_ERR(fclk)) | ||
| 581 | goto err3; | ||
| 582 | if (clk_enable(fclk)) | ||
| 583 | goto err4; | ||
| 584 | |||
| 585 | omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG); | ||
| 586 | v = omap_readl(base + MMCHS_SYSSTATUS); | ||
| 587 | while (!(omap_readl(base + MMCHS_SYSSTATUS) & | ||
| 588 | MMCHS_SYSSTATUS_RESETDONE)) | ||
| 589 | cpu_relax(); | ||
| 590 | |||
| 591 | clk_disable(fclk); | ||
| 592 | clk_put(fclk); | ||
| 593 | clk_disable(iclk); | ||
| 594 | clk_put(iclk); | ||
| 595 | } | ||
| 596 | return; | ||
| 597 | |||
| 598 | err4: | ||
| 599 | clk_put(fclk); | ||
| 600 | err3: | ||
| 601 | clk_disable(iclk); | ||
| 602 | err2: | ||
| 603 | clk_put(iclk); | ||
| 604 | err1: | ||
| 605 | printk(KERN_WARNING "%s: Unable to enable clocks for MMC%d, " | ||
| 606 | "cannot reset.\n", __func__, i); | ||
| 607 | } | ||
| 608 | #else | ||
| 609 | static inline void omap_hsmmc_reset(void) {} | ||
| 610 | #endif | ||
| 611 | |||
| 612 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ | ||
| 613 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | ||
| 614 | 546 | ||
| 615 | static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, | 547 | static inline void omap242x_mmc_mux(struct omap_mmc_platform_data |
| 616 | int controller_nr) | 548 | *mmc_controller) |
| 617 | { | 549 | { |
| 618 | if ((mmc_controller->slots[0].switch_pin > 0) && \ | 550 | if ((mmc_controller->slots[0].switch_pin > 0) && \ |
| 619 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) | 551 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) |
| @@ -624,163 +556,44 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, | |||
| 624 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, | 556 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, |
| 625 | OMAP_PIN_INPUT_PULLUP); | 557 | OMAP_PIN_INPUT_PULLUP); |
| 626 | 558 | ||
| 627 | if (cpu_is_omap2420() && controller_nr == 0) { | 559 | omap_mux_init_signal("sdmmc_cmd", 0); |
| 628 | omap_mux_init_signal("sdmmc_cmd", 0); | 560 | omap_mux_init_signal("sdmmc_clki", 0); |
| 629 | omap_mux_init_signal("sdmmc_clki", 0); | 561 | omap_mux_init_signal("sdmmc_clko", 0); |
| 630 | omap_mux_init_signal("sdmmc_clko", 0); | 562 | omap_mux_init_signal("sdmmc_dat0", 0); |
| 631 | omap_mux_init_signal("sdmmc_dat0", 0); | 563 | omap_mux_init_signal("sdmmc_dat_dir0", 0); |
| 632 | omap_mux_init_signal("sdmmc_dat_dir0", 0); | 564 | omap_mux_init_signal("sdmmc_cmd_dir", 0); |
| 633 | omap_mux_init_signal("sdmmc_cmd_dir", 0); | 565 | if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { |
| 634 | if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { | 566 | omap_mux_init_signal("sdmmc_dat1", 0); |
| 635 | omap_mux_init_signal("sdmmc_dat1", 0); | 567 | omap_mux_init_signal("sdmmc_dat2", 0); |
| 636 | omap_mux_init_signal("sdmmc_dat2", 0); | 568 | omap_mux_init_signal("sdmmc_dat3", 0); |
| 637 | omap_mux_init_signal("sdmmc_dat3", 0); | 569 | omap_mux_init_signal("sdmmc_dat_dir1", 0); |
| 638 | omap_mux_init_signal("sdmmc_dat_dir1", 0); | 570 | omap_mux_init_signal("sdmmc_dat_dir2", 0); |
| 639 | omap_mux_init_signal("sdmmc_dat_dir2", 0); | 571 | omap_mux_init_signal("sdmmc_dat_dir3", 0); |
| 640 | omap_mux_init_signal("sdmmc_dat_dir3", 0); | ||
| 641 | } | ||
| 642 | |||
| 643 | /* | ||
| 644 | * Use internal loop-back in MMC/SDIO Module Input Clock | ||
| 645 | * selection | ||
| 646 | */ | ||
| 647 | if (mmc_controller->slots[0].internal_clock) { | ||
| 648 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
| 649 | v |= (1 << 24); | ||
| 650 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); | ||
| 651 | } | ||
| 652 | } | 572 | } |
| 653 | 573 | ||
| 654 | if (cpu_is_omap34xx()) { | 574 | /* |
| 655 | if (controller_nr == 0) { | 575 | * Use internal loop-back in MMC/SDIO Module Input Clock |
| 656 | omap_mux_init_signal("sdmmc1_clk", | 576 | * selection |
| 657 | OMAP_PIN_INPUT_PULLUP); | 577 | */ |
| 658 | omap_mux_init_signal("sdmmc1_cmd", | 578 | if (mmc_controller->slots[0].internal_clock) { |
| 659 | OMAP_PIN_INPUT_PULLUP); | 579 | u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); |
| 660 | omap_mux_init_signal("sdmmc1_dat0", | 580 | v |= (1 << 24); |
| 661 | OMAP_PIN_INPUT_PULLUP); | 581 | omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0); |
| 662 | if (mmc_controller->slots[0].caps & | ||
| 663 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
| 664 | omap_mux_init_signal("sdmmc1_dat1", | ||
| 665 | OMAP_PIN_INPUT_PULLUP); | ||
| 666 | omap_mux_init_signal("sdmmc1_dat2", | ||
| 667 | OMAP_PIN_INPUT_PULLUP); | ||
| 668 | omap_mux_init_signal("sdmmc1_dat3", | ||
| 669 | OMAP_PIN_INPUT_PULLUP); | ||
| 670 | } | ||
| 671 | if (mmc_controller->slots[0].caps & | ||
| 672 | MMC_CAP_8_BIT_DATA) { | ||
| 673 | omap_mux_init_signal("sdmmc1_dat4", | ||
| 674 | OMAP_PIN_INPUT_PULLUP); | ||
| 675 | omap_mux_init_signal("sdmmc1_dat5", | ||
| 676 | OMAP_PIN_INPUT_PULLUP); | ||
| 677 | omap_mux_init_signal("sdmmc1_dat6", | ||
| 678 | OMAP_PIN_INPUT_PULLUP); | ||
| 679 | omap_mux_init_signal("sdmmc1_dat7", | ||
| 680 | OMAP_PIN_INPUT_PULLUP); | ||
| 681 | } | ||
| 682 | } | ||
| 683 | if (controller_nr == 1) { | ||
| 684 | /* MMC2 */ | ||
| 685 | omap_mux_init_signal("sdmmc2_clk", | ||
| 686 | OMAP_PIN_INPUT_PULLUP); | ||
| 687 | omap_mux_init_signal("sdmmc2_cmd", | ||
| 688 | OMAP_PIN_INPUT_PULLUP); | ||
| 689 | omap_mux_init_signal("sdmmc2_dat0", | ||
| 690 | OMAP_PIN_INPUT_PULLUP); | ||
| 691 | |||
| 692 | /* | ||
| 693 | * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed | ||
| 694 | * in the board-*.c files | ||
| 695 | */ | ||
| 696 | if (mmc_controller->slots[0].caps & | ||
| 697 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
| 698 | omap_mux_init_signal("sdmmc2_dat1", | ||
| 699 | OMAP_PIN_INPUT_PULLUP); | ||
| 700 | omap_mux_init_signal("sdmmc2_dat2", | ||
| 701 | OMAP_PIN_INPUT_PULLUP); | ||
| 702 | omap_mux_init_signal("sdmmc2_dat3", | ||
| 703 | OMAP_PIN_INPUT_PULLUP); | ||
| 704 | } | ||
| 705 | if (mmc_controller->slots[0].caps & | ||
| 706 | MMC_CAP_8_BIT_DATA) { | ||
| 707 | omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", | ||
| 708 | OMAP_PIN_INPUT_PULLUP); | ||
| 709 | omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", | ||
| 710 | OMAP_PIN_INPUT_PULLUP); | ||
| 711 | omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6", | ||
| 712 | OMAP_PIN_INPUT_PULLUP); | ||
| 713 | omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7", | ||
| 714 | OMAP_PIN_INPUT_PULLUP); | ||
| 715 | } | ||
| 716 | } | ||
| 717 | |||
| 718 | /* | ||
| 719 | * For MMC3 the pins need to be muxed in the board-*.c files | ||
| 720 | */ | ||
| 721 | } | 582 | } |
| 722 | } | 583 | } |
| 723 | 584 | ||
| 724 | void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | 585 | void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) |
| 725 | int nr_controllers) | ||
| 726 | { | 586 | { |
| 727 | int i; | 587 | char *name = "mmci-omap"; |
| 728 | char *name; | ||
| 729 | |||
| 730 | for (i = 0; i < nr_controllers; i++) { | ||
| 731 | unsigned long base, size; | ||
| 732 | unsigned int irq = 0; | ||
| 733 | 588 | ||
| 734 | if (!mmc_data[i]) | 589 | if (!mmc_data[0]) { |
| 735 | continue; | 590 | pr_err("%s fails: Incomplete platform data\n", __func__); |
| 736 | 591 | return; | |
| 737 | omap2_mmc_mux(mmc_data[i], i); | 592 | } |
| 738 | 593 | ||
| 739 | switch (i) { | 594 | omap242x_mmc_mux(mmc_data[0]); |
| 740 | case 0: | 595 | omap_mmc_add(name, 0, OMAP2_MMC1_BASE, OMAP2420_MMC_SIZE, |
| 741 | base = OMAP2_MMC1_BASE; | 596 | INT_24XX_MMC_IRQ, mmc_data[0]); |
| 742 | irq = INT_24XX_MMC_IRQ; | ||
| 743 | break; | ||
| 744 | case 1: | ||
| 745 | base = OMAP2_MMC2_BASE; | ||
| 746 | irq = INT_24XX_MMC2_IRQ; | ||
| 747 | break; | ||
| 748 | case 2: | ||
| 749 | if (!cpu_is_omap44xx() && !cpu_is_omap34xx()) | ||
| 750 | return; | ||
| 751 | base = OMAP3_MMC3_BASE; | ||
| 752 | irq = INT_34XX_MMC3_IRQ; | ||
| 753 | break; | ||
| 754 | case 3: | ||
| 755 | if (!cpu_is_omap44xx()) | ||
| 756 | return; | ||
| 757 | base = OMAP4_MMC4_BASE; | ||
| 758 | irq = OMAP44XX_IRQ_MMC4; | ||
| 759 | break; | ||
| 760 | case 4: | ||
| 761 | if (!cpu_is_omap44xx()) | ||
| 762 | return; | ||
| 763 | base = OMAP4_MMC5_BASE; | ||
| 764 | irq = OMAP44XX_IRQ_MMC5; | ||
| 765 | break; | ||
| 766 | default: | ||
| 767 | continue; | ||
| 768 | } | ||
| 769 | |||
| 770 | if (cpu_is_omap2420()) { | ||
| 771 | size = OMAP2420_MMC_SIZE; | ||
| 772 | name = "mmci-omap"; | ||
| 773 | } else if (cpu_is_omap44xx()) { | ||
| 774 | if (i < 3) | ||
| 775 | irq += OMAP44XX_IRQ_GIC_START; | ||
| 776 | size = OMAP4_HSMMC_SIZE; | ||
| 777 | name = "mmci-omap-hs"; | ||
| 778 | } else { | ||
| 779 | size = OMAP3_HSMMC_SIZE; | ||
| 780 | name = "mmci-omap-hs"; | ||
| 781 | } | ||
| 782 | omap_mmc_add(name, i, base, size, irq, mmc_data[i]); | ||
| 783 | }; | ||
| 784 | } | 597 | } |
| 785 | 598 | ||
| 786 | #endif | 599 | #endif |
| @@ -854,7 +667,6 @@ static int __init omap2_init_devices(void) | |||
| 854 | * please keep these calls, and their implementations above, | 667 | * please keep these calls, and their implementations above, |
| 855 | * in alphabetical order so they're easier to sort through. | 668 | * in alphabetical order so they're easier to sort through. |
| 856 | */ | 669 | */ |
| 857 | omap_hsmmc_reset(); | ||
| 858 | omap_init_audio(); | 670 | omap_init_audio(); |
| 859 | omap_init_camera(); | 671 | omap_init_camera(); |
| 860 | omap_init_mbox(); | 672 | omap_init_mbox(); |
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c new file mode 100644 index 000000000000..b18db84b0349 --- /dev/null +++ b/arch/arm/mach-omap2/display.c | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * OMAP2plus display device setup / initialization. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ | ||
| 5 | * Senthilvadivu Guruswamy | ||
| 6 | * Sumit Semwal | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
| 13 | * kind, whether express or implied; without even the implied warranty | ||
| 14 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include <linux/kernel.h> | ||
| 19 | #include <linux/init.h> | ||
| 20 | #include <linux/platform_device.h> | ||
| 21 | #include <linux/io.h> | ||
| 22 | #include <linux/clk.h> | ||
| 23 | #include <linux/err.h> | ||
| 24 | |||
| 25 | #include <plat/display.h> | ||
| 26 | |||
| 27 | static struct platform_device omap_display_device = { | ||
| 28 | .name = "omapdss", | ||
| 29 | .id = -1, | ||
| 30 | .dev = { | ||
| 31 | .platform_data = NULL, | ||
| 32 | }, | ||
| 33 | }; | ||
| 34 | |||
| 35 | int __init omap_display_init(struct omap_dss_board_info *board_data) | ||
| 36 | { | ||
| 37 | int r = 0; | ||
| 38 | omap_display_device.dev.platform_data = board_data; | ||
| 39 | |||
| 40 | r = platform_device_register(&omap_display_device); | ||
| 41 | if (r < 0) | ||
| 42 | printk(KERN_ERR "Unable to register OMAP-Display device\n"); | ||
| 43 | |||
| 44 | return r; | ||
| 45 | } | ||
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c new file mode 100644 index 000000000000..4e4da6160d05 --- /dev/null +++ b/arch/arm/mach-omap2/dpll44xx.c | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* | ||
| 2 | * OMAP4-specific DPLL control functions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
| 5 | * Rajendra Nayak | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/errno.h> | ||
| 14 | #include <linux/clk.h> | ||
| 15 | #include <linux/io.h> | ||
| 16 | #include <linux/bitops.h> | ||
| 17 | |||
| 18 | #include <plat/cpu.h> | ||
| 19 | #include <plat/clock.h> | ||
| 20 | |||
| 21 | #include "clock.h" | ||
| 22 | #include "cm-regbits-44xx.h" | ||
| 23 | |||
| 24 | /* Supported only on OMAP4 */ | ||
| 25 | int omap4_dpllmx_gatectrl_read(struct clk *clk) | ||
| 26 | { | ||
| 27 | u32 v; | ||
| 28 | u32 mask; | ||
| 29 | |||
| 30 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | ||
| 31 | return -EINVAL; | ||
| 32 | |||
| 33 | mask = clk->flags & CLOCK_CLKOUTX2 ? | ||
| 34 | OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : | ||
| 35 | OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; | ||
| 36 | |||
| 37 | v = __raw_readl(clk->clksel_reg); | ||
| 38 | v &= mask; | ||
| 39 | v >>= __ffs(mask); | ||
| 40 | |||
| 41 | return v; | ||
| 42 | } | ||
| 43 | |||
| 44 | void omap4_dpllmx_allow_gatectrl(struct clk *clk) | ||
| 45 | { | ||
| 46 | u32 v; | ||
| 47 | u32 mask; | ||
| 48 | |||
| 49 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | ||
| 50 | return; | ||
| 51 | |||
| 52 | mask = clk->flags & CLOCK_CLKOUTX2 ? | ||
| 53 | OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : | ||
| 54 | OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; | ||
| 55 | |||
| 56 | v = __raw_readl(clk->clksel_reg); | ||
| 57 | /* Clear the bit to allow gatectrl */ | ||
| 58 | v &= ~mask; | ||
| 59 | __raw_writel(v, clk->clksel_reg); | ||
| 60 | } | ||
| 61 | |||
| 62 | void omap4_dpllmx_deny_gatectrl(struct clk *clk) | ||
| 63 | { | ||
| 64 | u32 v; | ||
| 65 | u32 mask; | ||
| 66 | |||
| 67 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | ||
| 68 | return; | ||
| 69 | |||
| 70 | mask = clk->flags & CLOCK_CLKOUTX2 ? | ||
| 71 | OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK : | ||
| 72 | OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK; | ||
| 73 | |||
| 74 | v = __raw_readl(clk->clksel_reg); | ||
| 75 | /* Set the bit to deny gatectrl */ | ||
| 76 | v |= mask; | ||
| 77 | __raw_writel(v, clk->clksel_reg); | ||
| 78 | } | ||
| 79 | |||
| 80 | const struct clkops clkops_omap4_dpllmx_ops = { | ||
| 81 | .allow_idle = omap4_dpllmx_allow_gatectrl, | ||
| 82 | .deny_idle = omap4_dpllmx_deny_gatectrl, | ||
| 83 | }; | ||
| 84 | |||
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 2bb29c160702..c1791d08ae56 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
| 15 | #include <linux/mtd/nand.h> | ||
| 15 | 16 | ||
| 16 | #include <asm/mach/flash.h> | 17 | #include <asm/mach/flash.h> |
| 17 | 18 | ||
| @@ -69,8 +70,10 @@ static int omap2_nand_gpmc_retime(void) | |||
| 69 | t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); | 70 | t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); |
| 70 | 71 | ||
| 71 | /* Configure GPMC */ | 72 | /* Configure GPMC */ |
| 72 | gpmc_cs_configure(gpmc_nand_data->cs, | 73 | if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) |
| 73 | GPMC_CONFIG_DEV_SIZE, gpmc_nand_data->devsize); | 74 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1); |
| 75 | else | ||
| 76 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0); | ||
| 74 | gpmc_cs_configure(gpmc_nand_data->cs, | 77 | gpmc_cs_configure(gpmc_nand_data->cs, |
| 75 | GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); | 78 | GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); |
| 76 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); | 79 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); |
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index 3a7d25fb00ef..d776ded9830d 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c | |||
| @@ -94,7 +94,7 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) | |||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | static void set_onenand_cfg(void __iomem *onenand_base, int latency, | 96 | static void set_onenand_cfg(void __iomem *onenand_base, int latency, |
| 97 | int sync_read, int sync_write, int hf) | 97 | int sync_read, int sync_write, int hf, int vhf) |
| 98 | { | 98 | { |
| 99 | u32 reg; | 99 | u32 reg; |
| 100 | 100 | ||
| @@ -114,12 +114,57 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency, | |||
| 114 | reg |= ONENAND_SYS_CFG1_HF; | 114 | reg |= ONENAND_SYS_CFG1_HF; |
| 115 | else | 115 | else |
| 116 | reg &= ~ONENAND_SYS_CFG1_HF; | 116 | reg &= ~ONENAND_SYS_CFG1_HF; |
| 117 | if (vhf) | ||
| 118 | reg |= ONENAND_SYS_CFG1_VHF; | ||
| 119 | else | ||
| 120 | reg &= ~ONENAND_SYS_CFG1_VHF; | ||
| 117 | writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); | 121 | writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); |
| 118 | } | 122 | } |
| 119 | 123 | ||
| 124 | static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg, | ||
| 125 | void __iomem *onenand_base, bool *clk_dep) | ||
| 126 | { | ||
| 127 | u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID); | ||
| 128 | int freq = 0; | ||
| 129 | |||
| 130 | if (cfg->get_freq) { | ||
| 131 | struct onenand_freq_info fi; | ||
| 132 | |||
| 133 | fi.maf_id = readw(onenand_base + ONENAND_REG_MANUFACTURER_ID); | ||
| 134 | fi.dev_id = readw(onenand_base + ONENAND_REG_DEVICE_ID); | ||
| 135 | fi.ver_id = ver; | ||
| 136 | freq = cfg->get_freq(&fi, clk_dep); | ||
| 137 | if (freq) | ||
| 138 | return freq; | ||
| 139 | } | ||
| 140 | |||
| 141 | switch ((ver >> 4) & 0xf) { | ||
| 142 | case 0: | ||
| 143 | freq = 40; | ||
| 144 | break; | ||
| 145 | case 1: | ||
| 146 | freq = 54; | ||
| 147 | break; | ||
| 148 | case 2: | ||
| 149 | freq = 66; | ||
| 150 | break; | ||
| 151 | case 3: | ||
| 152 | freq = 83; | ||
| 153 | break; | ||
| 154 | case 4: | ||
| 155 | freq = 104; | ||
| 156 | break; | ||
| 157 | default: | ||
| 158 | freq = 54; | ||
| 159 | break; | ||
| 160 | } | ||
| 161 | |||
| 162 | return freq; | ||
| 163 | } | ||
| 164 | |||
| 120 | static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | 165 | static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, |
| 121 | void __iomem *onenand_base, | 166 | void __iomem *onenand_base, |
| 122 | int freq) | 167 | int *freq_ptr) |
| 123 | { | 168 | { |
| 124 | struct gpmc_timings t; | 169 | struct gpmc_timings t; |
| 125 | const int t_cer = 15; | 170 | const int t_cer = 15; |
| @@ -130,10 +175,11 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
| 130 | const int t_wph = 30; | 175 | const int t_wph = 30; |
| 131 | int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; | 176 | int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; |
| 132 | int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; | 177 | int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; |
| 133 | int first_time = 0, hf = 0, sync_read = 0, sync_write = 0; | 178 | int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0; |
| 134 | int err, ticks_cez; | 179 | int err, ticks_cez; |
| 135 | int cs = cfg->cs; | 180 | int cs = cfg->cs, freq = *freq_ptr; |
| 136 | u32 reg; | 181 | u32 reg; |
| 182 | bool clk_dep = false; | ||
| 137 | 183 | ||
| 138 | if (cfg->flags & ONENAND_SYNC_READ) { | 184 | if (cfg->flags & ONENAND_SYNC_READ) { |
| 139 | sync_read = 1; | 185 | sync_read = 1; |
| @@ -148,27 +194,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
| 148 | err = omap2_onenand_set_async_mode(cs, onenand_base); | 194 | err = omap2_onenand_set_async_mode(cs, onenand_base); |
| 149 | if (err) | 195 | if (err) |
| 150 | return err; | 196 | return err; |
| 151 | reg = readw(onenand_base + ONENAND_REG_VERSION_ID); | 197 | freq = omap2_onenand_get_freq(cfg, onenand_base, &clk_dep); |
| 152 | switch ((reg >> 4) & 0xf) { | ||
| 153 | case 0: | ||
| 154 | freq = 40; | ||
| 155 | break; | ||
| 156 | case 1: | ||
| 157 | freq = 54; | ||
| 158 | break; | ||
| 159 | case 2: | ||
| 160 | freq = 66; | ||
| 161 | break; | ||
| 162 | case 3: | ||
| 163 | freq = 83; | ||
| 164 | break; | ||
| 165 | case 4: | ||
| 166 | freq = 104; | ||
| 167 | break; | ||
| 168 | default: | ||
| 169 | freq = 54; | ||
| 170 | break; | ||
| 171 | } | ||
| 172 | first_time = 1; | 198 | first_time = 1; |
| 173 | } | 199 | } |
| 174 | 200 | ||
| @@ -180,7 +206,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
| 180 | t_avdh = 2; | 206 | t_avdh = 2; |
| 181 | t_ach = 3; | 207 | t_ach = 3; |
| 182 | t_aavdh = 6; | 208 | t_aavdh = 6; |
| 183 | t_rdyo = 9; | 209 | t_rdyo = 6; |
| 184 | break; | 210 | break; |
| 185 | case 83: | 211 | case 83: |
| 186 | min_gpmc_clk_period = 12000; /* 83 MHz */ | 212 | min_gpmc_clk_period = 12000; /* 83 MHz */ |
| @@ -217,16 +243,36 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
| 217 | gpmc_clk_ns = gpmc_ticks_to_ns(div); | 243 | gpmc_clk_ns = gpmc_ticks_to_ns(div); |
| 218 | if (gpmc_clk_ns < 15) /* >66Mhz */ | 244 | if (gpmc_clk_ns < 15) /* >66Mhz */ |
| 219 | hf = 1; | 245 | hf = 1; |
| 220 | if (hf) | 246 | if (gpmc_clk_ns < 12) /* >83Mhz */ |
| 247 | vhf = 1; | ||
| 248 | if (vhf) | ||
| 249 | latency = 8; | ||
| 250 | else if (hf) | ||
| 221 | latency = 6; | 251 | latency = 6; |
| 222 | else if (gpmc_clk_ns >= 25) /* 40 MHz*/ | 252 | else if (gpmc_clk_ns >= 25) /* 40 MHz*/ |
| 223 | latency = 3; | 253 | latency = 3; |
| 224 | else | 254 | else |
| 225 | latency = 4; | 255 | latency = 4; |
| 226 | 256 | ||
| 257 | if (clk_dep) { | ||
| 258 | if (gpmc_clk_ns < 12) { /* >83Mhz */ | ||
| 259 | t_ces = 3; | ||
| 260 | t_avds = 4; | ||
| 261 | } else if (gpmc_clk_ns < 15) { /* >66Mhz */ | ||
| 262 | t_ces = 5; | ||
| 263 | t_avds = 4; | ||
| 264 | } else if (gpmc_clk_ns < 25) { /* >40Mhz */ | ||
| 265 | t_ces = 6; | ||
| 266 | t_avds = 5; | ||
| 267 | } else { | ||
| 268 | t_ces = 7; | ||
| 269 | t_avds = 7; | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 227 | if (first_time) | 273 | if (first_time) |
| 228 | set_onenand_cfg(onenand_base, latency, | 274 | set_onenand_cfg(onenand_base, latency, |
| 229 | sync_read, sync_write, hf); | 275 | sync_read, sync_write, hf, vhf); |
| 230 | 276 | ||
| 231 | if (div == 1) { | 277 | if (div == 1) { |
| 232 | reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); | 278 | reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); |
| @@ -264,6 +310,9 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
| 264 | /* Read */ | 310 | /* Read */ |
| 265 | t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh)); | 311 | t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh)); |
| 266 | t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach)); | 312 | t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach)); |
| 313 | /* Force at least 1 clk between AVD High to OE Low */ | ||
| 314 | if (t.oe_on <= t.adv_rd_off) | ||
| 315 | t.oe_on = t.adv_rd_off + gpmc_round_ns_to_ticks(1); | ||
| 267 | t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div); | 316 | t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div); |
| 268 | t.oe_off = t.access + gpmc_round_ns_to_ticks(1); | 317 | t.oe_off = t.access + gpmc_round_ns_to_ticks(1); |
| 269 | t.cs_rd_off = t.oe_off; | 318 | t.cs_rd_off = t.oe_off; |
| @@ -317,18 +366,20 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
| 317 | if (err) | 366 | if (err) |
| 318 | return err; | 367 | return err; |
| 319 | 368 | ||
| 320 | set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf); | 369 | set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf); |
| 370 | |||
| 371 | *freq_ptr = freq; | ||
| 321 | 372 | ||
| 322 | return 0; | 373 | return 0; |
| 323 | } | 374 | } |
| 324 | 375 | ||
| 325 | static int gpmc_onenand_setup(void __iomem *onenand_base, int freq) | 376 | static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) |
| 326 | { | 377 | { |
| 327 | struct device *dev = &gpmc_onenand_device.dev; | 378 | struct device *dev = &gpmc_onenand_device.dev; |
| 328 | 379 | ||
| 329 | /* Set sync timings in GPMC */ | 380 | /* Set sync timings in GPMC */ |
| 330 | if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, | 381 | if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, |
| 331 | freq) < 0) { | 382 | freq_ptr) < 0) { |
| 332 | dev_err(dev, "Unable to set synchronous mode\n"); | 383 | dev_err(dev, "Unable to set synchronous mode\n"); |
| 333 | return -EINVAL; | 384 | return -EINVAL; |
| 334 | } | 385 | } |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 1b7b3e7d02f7..674174365f78 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | #undef DEBUG | 15 | #undef DEBUG |
| 16 | 16 | ||
| 17 | #include <linux/irq.h> | ||
| 17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 19 | #include <linux/err.h> | 20 | #include <linux/err.h> |
| @@ -22,6 +23,7 @@ | |||
| 22 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
| 23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
| 24 | #include <linux/module.h> | 25 | #include <linux/module.h> |
| 26 | #include <linux/interrupt.h> | ||
| 25 | 27 | ||
| 26 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
| 27 | #include <plat/gpmc.h> | 29 | #include <plat/gpmc.h> |
| @@ -58,7 +60,6 @@ | |||
| 58 | #define GPMC_CHUNK_SHIFT 24 /* 16 MB */ | 60 | #define GPMC_CHUNK_SHIFT 24 /* 16 MB */ |
| 59 | #define GPMC_SECTION_SHIFT 28 /* 128 MB */ | 61 | #define GPMC_SECTION_SHIFT 28 /* 128 MB */ |
| 60 | 62 | ||
| 61 | #define PREFETCH_FIFOTHRESHOLD (0x40 << 8) | ||
| 62 | #define CS_NUM_SHIFT 24 | 63 | #define CS_NUM_SHIFT 24 |
| 63 | #define ENABLE_PREFETCH (0x1 << 7) | 64 | #define ENABLE_PREFETCH (0x1 << 7) |
| 64 | #define DMA_MPU_MODE 2 | 65 | #define DMA_MPU_MODE 2 |
| @@ -100,6 +101,8 @@ static void __iomem *gpmc_base; | |||
| 100 | 101 | ||
| 101 | static struct clk *gpmc_l3_clk; | 102 | static struct clk *gpmc_l3_clk; |
| 102 | 103 | ||
| 104 | static irqreturn_t gpmc_handle_irq(int irq, void *dev); | ||
| 105 | |||
| 103 | static void gpmc_write_reg(int idx, u32 val) | 106 | static void gpmc_write_reg(int idx, u32 val) |
| 104 | { | 107 | { |
| 105 | __raw_writel(val, gpmc_base + idx); | 108 | __raw_writel(val, gpmc_base + idx); |
| @@ -497,6 +500,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval) | |||
| 497 | u32 regval = 0; | 500 | u32 regval = 0; |
| 498 | 501 | ||
| 499 | switch (cmd) { | 502 | switch (cmd) { |
| 503 | case GPMC_ENABLE_IRQ: | ||
| 504 | gpmc_write_reg(GPMC_IRQENABLE, wval); | ||
| 505 | break; | ||
| 506 | |||
| 500 | case GPMC_SET_IRQ_STATUS: | 507 | case GPMC_SET_IRQ_STATUS: |
| 501 | gpmc_write_reg(GPMC_IRQSTATUS, wval); | 508 | gpmc_write_reg(GPMC_IRQSTATUS, wval); |
| 502 | break; | 509 | break; |
| @@ -598,15 +605,19 @@ EXPORT_SYMBOL(gpmc_nand_write); | |||
| 598 | /** | 605 | /** |
| 599 | * gpmc_prefetch_enable - configures and starts prefetch transfer | 606 | * gpmc_prefetch_enable - configures and starts prefetch transfer |
| 600 | * @cs: cs (chip select) number | 607 | * @cs: cs (chip select) number |
| 608 | * @fifo_th: fifo threshold to be used for read/ write | ||
| 601 | * @dma_mode: dma mode enable (1) or disable (0) | 609 | * @dma_mode: dma mode enable (1) or disable (0) |
| 602 | * @u32_count: number of bytes to be transferred | 610 | * @u32_count: number of bytes to be transferred |
| 603 | * @is_write: prefetch read(0) or write post(1) mode | 611 | * @is_write: prefetch read(0) or write post(1) mode |
| 604 | */ | 612 | */ |
| 605 | int gpmc_prefetch_enable(int cs, int dma_mode, | 613 | int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode, |
| 606 | unsigned int u32_count, int is_write) | 614 | unsigned int u32_count, int is_write) |
| 607 | { | 615 | { |
| 608 | 616 | ||
| 609 | if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { | 617 | if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) { |
| 618 | pr_err("gpmc: fifo threshold is not supported\n"); | ||
| 619 | return -1; | ||
| 620 | } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { | ||
| 610 | /* Set the amount of bytes to be prefetched */ | 621 | /* Set the amount of bytes to be prefetched */ |
| 611 | gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); | 622 | gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); |
| 612 | 623 | ||
| @@ -614,7 +625,7 @@ int gpmc_prefetch_enable(int cs, int dma_mode, | |||
| 614 | * enable the engine. Set which cs is has requested for. | 625 | * enable the engine. Set which cs is has requested for. |
| 615 | */ | 626 | */ |
| 616 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | | 627 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | |
| 617 | PREFETCH_FIFOTHRESHOLD | | 628 | PREFETCH_FIFOTHRESHOLD(fifo_th) | |
| 618 | ENABLE_PREFETCH | | 629 | ENABLE_PREFETCH | |
| 619 | (dma_mode << DMA_MPU_MODE) | | 630 | (dma_mode << DMA_MPU_MODE) | |
| 620 | (0x1 & is_write))); | 631 | (0x1 & is_write))); |
| @@ -678,9 +689,10 @@ static void __init gpmc_mem_init(void) | |||
| 678 | } | 689 | } |
| 679 | } | 690 | } |
| 680 | 691 | ||
| 681 | void __init gpmc_init(void) | 692 | static int __init gpmc_init(void) |
| 682 | { | 693 | { |
| 683 | u32 l; | 694 | u32 l, irq; |
| 695 | int cs, ret = -EINVAL; | ||
| 684 | char *ck = NULL; | 696 | char *ck = NULL; |
| 685 | 697 | ||
| 686 | if (cpu_is_omap24xx()) { | 698 | if (cpu_is_omap24xx()) { |
| @@ -698,7 +710,7 @@ void __init gpmc_init(void) | |||
| 698 | } | 710 | } |
| 699 | 711 | ||
| 700 | if (WARN_ON(!ck)) | 712 | if (WARN_ON(!ck)) |
| 701 | return; | 713 | return ret; |
| 702 | 714 | ||
| 703 | gpmc_l3_clk = clk_get(NULL, ck); | 715 | gpmc_l3_clk = clk_get(NULL, ck); |
| 704 | if (IS_ERR(gpmc_l3_clk)) { | 716 | if (IS_ERR(gpmc_l3_clk)) { |
| @@ -723,6 +735,36 @@ void __init gpmc_init(void) | |||
| 723 | l |= (0x02 << 3) | (1 << 0); | 735 | l |= (0x02 << 3) | (1 << 0); |
| 724 | gpmc_write_reg(GPMC_SYSCONFIG, l); | 736 | gpmc_write_reg(GPMC_SYSCONFIG, l); |
| 725 | gpmc_mem_init(); | 737 | gpmc_mem_init(); |
| 738 | |||
| 739 | /* initalize the irq_chained */ | ||
| 740 | irq = OMAP_GPMC_IRQ_BASE; | ||
| 741 | for (cs = 0; cs < GPMC_CS_NUM; cs++) { | ||
| 742 | set_irq_handler(irq, handle_simple_irq); | ||
| 743 | set_irq_flags(irq, IRQF_VALID); | ||
| 744 | irq++; | ||
| 745 | } | ||
| 746 | |||
| 747 | ret = request_irq(INT_34XX_GPMC_IRQ, | ||
| 748 | gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base); | ||
| 749 | if (ret) | ||
| 750 | pr_err("gpmc: irq-%d could not claim: err %d\n", | ||
| 751 | INT_34XX_GPMC_IRQ, ret); | ||
| 752 | return ret; | ||
| 753 | } | ||
| 754 | postcore_initcall(gpmc_init); | ||
| 755 | |||
| 756 | static irqreturn_t gpmc_handle_irq(int irq, void *dev) | ||
| 757 | { | ||
| 758 | u8 cs; | ||
| 759 | |||
| 760 | if (irq != INT_34XX_GPMC_IRQ) | ||
| 761 | return IRQ_HANDLED; | ||
| 762 | /* check cs to invoke the irq */ | ||
| 763 | cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7; | ||
| 764 | if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END) | ||
| 765 | generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs); | ||
| 766 | |||
| 767 | return IRQ_HANDLED; | ||
| 726 | } | 768 | } |
| 727 | 769 | ||
| 728 | #ifdef CONFIG_ARCH_OMAP3 | 770 | #ifdef CONFIG_ARCH_OMAP3 |
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 34272e4863fd..137e1a5f3d85 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
| @@ -16,7 +16,10 @@ | |||
| 16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
| 17 | #include <plat/mmc.h> | 17 | #include <plat/mmc.h> |
| 18 | #include <plat/omap-pm.h> | 18 | #include <plat/omap-pm.h> |
| 19 | #include <plat/mux.h> | ||
| 20 | #include <plat/omap_device.h> | ||
| 19 | 21 | ||
| 22 | #include "mux.h" | ||
| 20 | #include "hsmmc.h" | 23 | #include "hsmmc.h" |
| 21 | #include "control.h" | 24 | #include "control.h" |
| 22 | 25 | ||
| @@ -28,10 +31,6 @@ static u16 control_mmc1; | |||
| 28 | 31 | ||
| 29 | #define HSMMC_NAME_LEN 9 | 32 | #define HSMMC_NAME_LEN 9 |
| 30 | 33 | ||
| 31 | static struct hsmmc_controller { | ||
| 32 | char name[HSMMC_NAME_LEN + 1]; | ||
| 33 | } hsmmc[OMAP34XX_NR_MMC]; | ||
| 34 | |||
| 35 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | 34 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) |
| 36 | 35 | ||
| 37 | static int hsmmc_get_context_loss(struct device *dev) | 36 | static int hsmmc_get_context_loss(struct device *dev) |
| @@ -204,174 +203,312 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on, | |||
| 204 | return 0; | 203 | return 0; |
| 205 | } | 204 | } |
| 206 | 205 | ||
| 207 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; | 206 | static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller, |
| 208 | 207 | int controller_nr) | |
| 209 | void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
| 210 | { | 208 | { |
| 211 | struct omap2_hsmmc_info *c; | 209 | if ((mmc_controller->slots[0].switch_pin > 0) && \ |
| 212 | int nr_hsmmc = ARRAY_SIZE(hsmmc_data); | 210 | (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) |
| 213 | int i; | 211 | omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, |
| 214 | u32 reg; | 212 | OMAP_PIN_INPUT_PULLUP); |
| 215 | 213 | if ((mmc_controller->slots[0].gpio_wp > 0) && \ | |
| 216 | if (!cpu_is_omap44xx()) { | 214 | (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) |
| 217 | if (cpu_is_omap2430()) { | 215 | omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, |
| 218 | control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; | 216 | OMAP_PIN_INPUT_PULLUP); |
| 219 | control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; | 217 | if (cpu_is_omap34xx()) { |
| 220 | } else { | 218 | if (controller_nr == 0) { |
| 221 | control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; | 219 | omap_mux_init_signal("sdmmc1_clk", |
| 222 | control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; | 220 | OMAP_PIN_INPUT_PULLUP); |
| 223 | } | 221 | omap_mux_init_signal("sdmmc1_cmd", |
| 224 | } else { | 222 | OMAP_PIN_INPUT_PULLUP); |
| 225 | control_pbias_offset = | 223 | omap_mux_init_signal("sdmmc1_dat0", |
| 226 | OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; | 224 | OMAP_PIN_INPUT_PULLUP); |
| 227 | control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; | 225 | if (mmc_controller->slots[0].caps & |
| 228 | reg = omap4_ctrl_pad_readl(control_mmc1); | 226 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { |
| 229 | reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | | 227 | omap_mux_init_signal("sdmmc1_dat1", |
| 230 | OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); | 228 | OMAP_PIN_INPUT_PULLUP); |
| 231 | reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | | 229 | omap_mux_init_signal("sdmmc1_dat2", |
| 232 | OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); | 230 | OMAP_PIN_INPUT_PULLUP); |
| 233 | reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK| | 231 | omap_mux_init_signal("sdmmc1_dat3", |
| 234 | OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | | 232 | OMAP_PIN_INPUT_PULLUP); |
| 235 | OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); | 233 | } |
| 236 | omap4_ctrl_pad_writel(reg, control_mmc1); | 234 | if (mmc_controller->slots[0].caps & |
| 237 | } | 235 | MMC_CAP_8_BIT_DATA) { |
| 238 | 236 | omap_mux_init_signal("sdmmc1_dat4", | |
| 239 | for (c = controllers; c->mmc; c++) { | 237 | OMAP_PIN_INPUT_PULLUP); |
| 240 | struct hsmmc_controller *hc = hsmmc + c->mmc - 1; | 238 | omap_mux_init_signal("sdmmc1_dat5", |
| 241 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | 239 | OMAP_PIN_INPUT_PULLUP); |
| 242 | 240 | omap_mux_init_signal("sdmmc1_dat6", | |
| 243 | if (!c->mmc || c->mmc > nr_hsmmc) { | 241 | OMAP_PIN_INPUT_PULLUP); |
| 244 | pr_debug("MMC%d: no such controller\n", c->mmc); | 242 | omap_mux_init_signal("sdmmc1_dat7", |
| 245 | continue; | 243 | OMAP_PIN_INPUT_PULLUP); |
| 246 | } | 244 | } |
| 247 | if (mmc) { | ||
| 248 | pr_debug("MMC%d: already configured\n", c->mmc); | ||
| 249 | continue; | ||
| 250 | } | 245 | } |
| 251 | 246 | if (controller_nr == 1) { | |
| 252 | mmc = kzalloc(sizeof(struct omap_mmc_platform_data), | 247 | /* MMC2 */ |
| 253 | GFP_KERNEL); | 248 | omap_mux_init_signal("sdmmc2_clk", |
| 254 | if (!mmc) { | 249 | OMAP_PIN_INPUT_PULLUP); |
| 255 | pr_err("Cannot allocate memory for mmc device!\n"); | 250 | omap_mux_init_signal("sdmmc2_cmd", |
| 256 | goto done; | 251 | OMAP_PIN_INPUT_PULLUP); |
| 252 | omap_mux_init_signal("sdmmc2_dat0", | ||
| 253 | OMAP_PIN_INPUT_PULLUP); | ||
| 254 | |||
| 255 | /* | ||
| 256 | * For 8 wire configurations, Lines DAT4, 5, 6 and 7 | ||
| 257 | * need to be muxed in the board-*.c files | ||
| 258 | */ | ||
| 259 | if (mmc_controller->slots[0].caps & | ||
| 260 | (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { | ||
| 261 | omap_mux_init_signal("sdmmc2_dat1", | ||
| 262 | OMAP_PIN_INPUT_PULLUP); | ||
| 263 | omap_mux_init_signal("sdmmc2_dat2", | ||
| 264 | OMAP_PIN_INPUT_PULLUP); | ||
| 265 | omap_mux_init_signal("sdmmc2_dat3", | ||
| 266 | OMAP_PIN_INPUT_PULLUP); | ||
| 267 | } | ||
| 268 | if (mmc_controller->slots[0].caps & | ||
| 269 | MMC_CAP_8_BIT_DATA) { | ||
| 270 | omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4", | ||
| 271 | OMAP_PIN_INPUT_PULLUP); | ||
| 272 | omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5", | ||
| 273 | OMAP_PIN_INPUT_PULLUP); | ||
| 274 | omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6", | ||
| 275 | OMAP_PIN_INPUT_PULLUP); | ||
| 276 | omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7", | ||
| 277 | OMAP_PIN_INPUT_PULLUP); | ||
| 278 | } | ||
| 257 | } | 279 | } |
| 258 | 280 | ||
| 259 | if (c->name) | 281 | /* |
| 260 | strncpy(hc->name, c->name, HSMMC_NAME_LEN); | 282 | * For MMC3 the pins need to be muxed in the board-*.c files |
| 261 | else | 283 | */ |
| 262 | snprintf(hc->name, ARRAY_SIZE(hc->name), | 284 | } |
| 263 | "mmc%islot%i", c->mmc, 1); | 285 | } |
| 264 | mmc->slots[0].name = hc->name; | ||
| 265 | mmc->nr_slots = 1; | ||
| 266 | mmc->slots[0].caps = c->caps; | ||
| 267 | mmc->slots[0].internal_clock = !c->ext_clock; | ||
| 268 | mmc->dma_mask = 0xffffffff; | ||
| 269 | if (cpu_is_omap44xx()) | ||
| 270 | mmc->reg_offset = OMAP4_MMC_REG_OFFSET; | ||
| 271 | else | ||
| 272 | mmc->reg_offset = 0; | ||
| 273 | 286 | ||
| 274 | mmc->get_context_loss_count = hsmmc_get_context_loss; | 287 | static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, |
| 288 | struct omap_mmc_platform_data *mmc) | ||
| 289 | { | ||
| 290 | char *hc_name; | ||
| 275 | 291 | ||
| 276 | mmc->slots[0].switch_pin = c->gpio_cd; | 292 | hc_name = kzalloc(sizeof(char) * (HSMMC_NAME_LEN + 1), GFP_KERNEL); |
| 277 | mmc->slots[0].gpio_wp = c->gpio_wp; | 293 | if (!hc_name) { |
| 294 | pr_err("Cannot allocate memory for controller slot name\n"); | ||
| 295 | kfree(hc_name); | ||
| 296 | return -ENOMEM; | ||
| 297 | } | ||
| 278 | 298 | ||
| 279 | mmc->slots[0].remux = c->remux; | 299 | if (c->name) |
| 280 | mmc->slots[0].init_card = c->init_card; | 300 | strncpy(hc_name, c->name, HSMMC_NAME_LEN); |
| 301 | else | ||
| 302 | snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", | ||
| 303 | c->mmc, 1); | ||
| 304 | mmc->slots[0].name = hc_name; | ||
| 305 | mmc->nr_slots = 1; | ||
| 306 | mmc->slots[0].caps = c->caps; | ||
| 307 | mmc->slots[0].internal_clock = !c->ext_clock; | ||
| 308 | mmc->dma_mask = 0xffffffff; | ||
| 309 | if (cpu_is_omap44xx()) | ||
| 310 | mmc->reg_offset = OMAP4_MMC_REG_OFFSET; | ||
| 311 | else | ||
| 312 | mmc->reg_offset = 0; | ||
| 281 | 313 | ||
| 282 | if (c->cover_only) | 314 | mmc->get_context_loss_count = hsmmc_get_context_loss; |
| 283 | mmc->slots[0].cover = 1; | ||
| 284 | 315 | ||
| 285 | if (c->nonremovable) | 316 | mmc->slots[0].switch_pin = c->gpio_cd; |
| 286 | mmc->slots[0].nonremovable = 1; | 317 | mmc->slots[0].gpio_wp = c->gpio_wp; |
| 287 | 318 | ||
| 288 | if (c->power_saving) | 319 | mmc->slots[0].remux = c->remux; |
| 289 | mmc->slots[0].power_saving = 1; | 320 | mmc->slots[0].init_card = c->init_card; |
| 290 | 321 | ||
| 291 | if (c->no_off) | 322 | if (c->cover_only) |
| 292 | mmc->slots[0].no_off = 1; | 323 | mmc->slots[0].cover = 1; |
| 293 | 324 | ||
| 294 | if (c->vcc_aux_disable_is_sleep) | 325 | if (c->nonremovable) |
| 295 | mmc->slots[0].vcc_aux_disable_is_sleep = 1; | 326 | mmc->slots[0].nonremovable = 1; |
| 296 | 327 | ||
| 297 | /* NOTE: MMC slots should have a Vcc regulator set up. | 328 | if (c->power_saving) |
| 298 | * This may be from a TWL4030-family chip, another | 329 | mmc->slots[0].power_saving = 1; |
| 299 | * controllable regulator, or a fixed supply. | ||
| 300 | * | ||
| 301 | * temporary HACK: ocr_mask instead of fixed supply | ||
| 302 | */ | ||
| 303 | mmc->slots[0].ocr_mask = c->ocr_mask; | ||
| 304 | 330 | ||
| 305 | if (cpu_is_omap3517() || cpu_is_omap3505()) | 331 | if (c->no_off) |
| 306 | mmc->slots[0].set_power = nop_mmc_set_power; | 332 | mmc->slots[0].no_off = 1; |
| 307 | else | ||
| 308 | mmc->slots[0].features |= HSMMC_HAS_PBIAS; | ||
| 309 | 333 | ||
| 310 | if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) | 334 | if (c->vcc_aux_disable_is_sleep) |
| 311 | mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; | 335 | mmc->slots[0].vcc_aux_disable_is_sleep = 1; |
| 312 | 336 | ||
| 313 | switch (c->mmc) { | 337 | /* |
| 314 | case 1: | 338 | * NOTE: MMC slots should have a Vcc regulator set up. |
| 315 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | 339 | * This may be from a TWL4030-family chip, another |
| 316 | /* on-chip level shifting via PBIAS0/PBIAS1 */ | 340 | * controllable regulator, or a fixed supply. |
| 317 | if (cpu_is_omap44xx()) { | 341 | * |
| 318 | mmc->slots[0].before_set_reg = | 342 | * temporary HACK: ocr_mask instead of fixed supply |
| 343 | */ | ||
| 344 | mmc->slots[0].ocr_mask = c->ocr_mask; | ||
| 345 | |||
| 346 | if (cpu_is_omap3517() || cpu_is_omap3505()) | ||
| 347 | mmc->slots[0].set_power = nop_mmc_set_power; | ||
| 348 | else | ||
| 349 | mmc->slots[0].features |= HSMMC_HAS_PBIAS; | ||
| 350 | |||
| 351 | if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) | ||
| 352 | mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; | ||
| 353 | |||
| 354 | switch (c->mmc) { | ||
| 355 | case 1: | ||
| 356 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | ||
| 357 | /* on-chip level shifting via PBIAS0/PBIAS1 */ | ||
| 358 | if (cpu_is_omap44xx()) { | ||
| 359 | mmc->slots[0].before_set_reg = | ||
| 319 | omap4_hsmmc1_before_set_reg; | 360 | omap4_hsmmc1_before_set_reg; |
| 320 | mmc->slots[0].after_set_reg = | 361 | mmc->slots[0].after_set_reg = |
| 321 | omap4_hsmmc1_after_set_reg; | 362 | omap4_hsmmc1_after_set_reg; |
| 322 | } else { | 363 | } else { |
| 323 | mmc->slots[0].before_set_reg = | 364 | mmc->slots[0].before_set_reg = |
| 324 | omap_hsmmc1_before_set_reg; | 365 | omap_hsmmc1_before_set_reg; |
| 325 | mmc->slots[0].after_set_reg = | 366 | mmc->slots[0].after_set_reg = |
| 326 | omap_hsmmc1_after_set_reg; | 367 | omap_hsmmc1_after_set_reg; |
| 327 | } | ||
| 328 | } | 368 | } |
| 369 | } | ||
| 329 | 370 | ||
| 330 | /* Omap3630 HSMMC1 supports only 4-bit */ | 371 | /* OMAP3630 HSMMC1 supports only 4-bit */ |
| 331 | if (cpu_is_omap3630() && | 372 | if (cpu_is_omap3630() && |
| 332 | (c->caps & MMC_CAP_8_BIT_DATA)) { | 373 | (c->caps & MMC_CAP_8_BIT_DATA)) { |
| 333 | c->caps &= ~MMC_CAP_8_BIT_DATA; | 374 | c->caps &= ~MMC_CAP_8_BIT_DATA; |
| 334 | c->caps |= MMC_CAP_4_BIT_DATA; | 375 | c->caps |= MMC_CAP_4_BIT_DATA; |
| 335 | mmc->slots[0].caps = c->caps; | 376 | mmc->slots[0].caps = c->caps; |
| 336 | } | 377 | } |
| 337 | break; | 378 | break; |
| 338 | case 2: | 379 | case 2: |
| 339 | if (c->ext_clock) | 380 | if (c->ext_clock) |
| 340 | c->transceiver = 1; | 381 | c->transceiver = 1; |
| 341 | if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { | 382 | if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { |
| 342 | c->caps &= ~MMC_CAP_8_BIT_DATA; | 383 | c->caps &= ~MMC_CAP_8_BIT_DATA; |
| 343 | c->caps |= MMC_CAP_4_BIT_DATA; | 384 | c->caps |= MMC_CAP_4_BIT_DATA; |
| 344 | } | ||
| 345 | /* FALLTHROUGH */ | ||
| 346 | case 3: | ||
| 347 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | ||
| 348 | /* off-chip level shifting, or none */ | ||
| 349 | mmc->slots[0].before_set_reg = hsmmc23_before_set_reg; | ||
| 350 | mmc->slots[0].after_set_reg = NULL; | ||
| 351 | } | ||
| 352 | break; | ||
| 353 | default: | ||
| 354 | pr_err("MMC%d configuration not supported!\n", c->mmc); | ||
| 355 | kfree(mmc); | ||
| 356 | continue; | ||
| 357 | } | 385 | } |
| 358 | hsmmc_data[c->mmc - 1] = mmc; | 386 | /* FALLTHROUGH */ |
| 387 | case 3: | ||
| 388 | if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { | ||
| 389 | /* off-chip level shifting, or none */ | ||
| 390 | mmc->slots[0].before_set_reg = hsmmc23_before_set_reg; | ||
| 391 | mmc->slots[0].after_set_reg = NULL; | ||
| 392 | } | ||
| 393 | break; | ||
| 394 | case 4: | ||
| 395 | case 5: | ||
| 396 | mmc->slots[0].before_set_reg = NULL; | ||
| 397 | mmc->slots[0].after_set_reg = NULL; | ||
| 398 | break; | ||
| 399 | default: | ||
| 400 | pr_err("MMC%d configuration not supported!\n", c->mmc); | ||
| 401 | kfree(hc_name); | ||
| 402 | return -ENODEV; | ||
| 403 | } | ||
| 404 | return 0; | ||
| 405 | } | ||
| 406 | |||
| 407 | static struct omap_device_pm_latency omap_hsmmc_latency[] = { | ||
| 408 | [0] = { | ||
| 409 | .deactivate_func = omap_device_idle_hwmods, | ||
| 410 | .activate_func = omap_device_enable_hwmods, | ||
| 411 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, | ||
| 412 | }, | ||
| 413 | /* | ||
| 414 | * XXX There should also be an entry here to power off/on the | ||
| 415 | * MMC regulators/PBIAS cells, etc. | ||
| 416 | */ | ||
| 417 | }; | ||
| 418 | |||
| 419 | #define MAX_OMAP_MMC_HWMOD_NAME_LEN 16 | ||
| 420 | |||
| 421 | void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr) | ||
| 422 | { | ||
| 423 | struct omap_hwmod *oh; | ||
| 424 | struct omap_device *od; | ||
| 425 | struct omap_device_pm_latency *ohl; | ||
| 426 | char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN]; | ||
| 427 | struct omap_mmc_platform_data *mmc_data; | ||
| 428 | struct omap_mmc_dev_attr *mmc_dev_attr; | ||
| 429 | char *name; | ||
| 430 | int l; | ||
| 431 | int ohl_cnt = 0; | ||
| 432 | |||
| 433 | mmc_data = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL); | ||
| 434 | if (!mmc_data) { | ||
| 435 | pr_err("Cannot allocate memory for mmc device!\n"); | ||
| 436 | goto done; | ||
| 359 | } | 437 | } |
| 360 | 438 | ||
| 361 | omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); | 439 | if (omap_hsmmc_pdata_init(hsmmcinfo, mmc_data) < 0) { |
| 440 | pr_err("%s fails!\n", __func__); | ||
| 441 | goto done; | ||
| 442 | } | ||
| 443 | omap_hsmmc_mux(mmc_data, (ctrl_nr - 1)); | ||
| 444 | |||
| 445 | name = "omap_hsmmc"; | ||
| 446 | ohl = omap_hsmmc_latency; | ||
| 447 | ohl_cnt = ARRAY_SIZE(omap_hsmmc_latency); | ||
| 448 | |||
| 449 | l = snprintf(oh_name, MAX_OMAP_MMC_HWMOD_NAME_LEN, | ||
| 450 | "mmc%d", ctrl_nr); | ||
| 451 | WARN(l >= MAX_OMAP_MMC_HWMOD_NAME_LEN, | ||
| 452 | "String buffer overflow in MMC%d device setup\n", ctrl_nr); | ||
| 453 | oh = omap_hwmod_lookup(oh_name); | ||
| 454 | if (!oh) { | ||
| 455 | pr_err("Could not look up %s\n", oh_name); | ||
| 456 | kfree(mmc_data->slots[0].name); | ||
| 457 | goto done; | ||
| 458 | } | ||
| 362 | 459 | ||
| 363 | /* pass the device nodes back to board setup code */ | 460 | if (oh->dev_attr != NULL) { |
| 364 | for (c = controllers; c->mmc; c++) { | 461 | mmc_dev_attr = oh->dev_attr; |
| 365 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | 462 | mmc_data->controller_flags = mmc_dev_attr->flags; |
| 463 | } | ||
| 366 | 464 | ||
| 367 | if (!c->mmc || c->mmc > nr_hsmmc) | 465 | od = omap_device_build(name, ctrl_nr - 1, oh, mmc_data, |
| 368 | continue; | 466 | sizeof(struct omap_mmc_platform_data), ohl, ohl_cnt, false); |
| 369 | c->dev = mmc->dev; | 467 | if (IS_ERR(od)) { |
| 468 | WARN(1, "Cant build omap_device for %s:%s.\n", name, oh->name); | ||
| 469 | kfree(mmc_data->slots[0].name); | ||
| 470 | goto done; | ||
| 370 | } | 471 | } |
| 472 | /* | ||
| 473 | * return device handle to board setup code | ||
| 474 | * required to populate for regulator framework structure | ||
| 475 | */ | ||
| 476 | hsmmcinfo->dev = &od->pdev.dev; | ||
| 371 | 477 | ||
| 372 | done: | 478 | done: |
| 373 | for (i = 0; i < nr_hsmmc; i++) | 479 | kfree(mmc_data); |
| 374 | kfree(hsmmc_data[i]); | 480 | } |
| 481 | |||
| 482 | void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
| 483 | { | ||
| 484 | u32 reg; | ||
| 485 | |||
| 486 | if (!cpu_is_omap44xx()) { | ||
| 487 | if (cpu_is_omap2430()) { | ||
| 488 | control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; | ||
| 489 | control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; | ||
| 490 | } else { | ||
| 491 | control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; | ||
| 492 | control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; | ||
| 493 | } | ||
| 494 | } else { | ||
| 495 | control_pbias_offset = | ||
| 496 | OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; | ||
| 497 | control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; | ||
| 498 | reg = omap4_ctrl_pad_readl(control_mmc1); | ||
| 499 | reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | | ||
| 500 | OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); | ||
| 501 | reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | | ||
| 502 | OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); | ||
| 503 | reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK| | ||
| 504 | OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | | ||
| 505 | OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); | ||
| 506 | omap4_ctrl_pad_writel(reg, control_mmc1); | ||
| 507 | } | ||
| 508 | |||
| 509 | for (; controllers->mmc; controllers++) | ||
| 510 | omap_init_hsmmc(controllers, controllers->mmc); | ||
| 511 | |||
| 375 | } | 512 | } |
| 376 | 513 | ||
| 377 | #endif | 514 | #endif |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 5c25f1b55235..3168b17bc264 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * Copyright (C) 2005 Nokia Corporation | 6 | * Copyright (C) 2005 Nokia Corporation |
| 7 | * Written by Tony Lindgren <tony@atomide.com> | 7 | * Written by Tony Lindgren <tony@atomide.com> |
| 8 | * | 8 | * |
| 9 | * Copyright (C) 2009 Texas Instruments | 9 | * Copyright (C) 2009-11 Texas Instruments |
| 10 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> | 10 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> |
| 11 | * | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
| @@ -328,7 +328,7 @@ static void __init omap4_check_revision(void) | |||
| 328 | */ | 328 | */ |
| 329 | idcode = read_tap_reg(OMAP_TAP_IDCODE); | 329 | idcode = read_tap_reg(OMAP_TAP_IDCODE); |
| 330 | hawkeye = (idcode >> 12) & 0xffff; | 330 | hawkeye = (idcode >> 12) & 0xffff; |
| 331 | rev = (idcode >> 28) & 0xff; | 331 | rev = (idcode >> 28) & 0xf; |
| 332 | 332 | ||
| 333 | /* | 333 | /* |
| 334 | * Few initial ES2.0 samples IDCODE is same as ES1.0 | 334 | * Few initial ES2.0 samples IDCODE is same as ES1.0 |
| @@ -347,22 +347,31 @@ static void __init omap4_check_revision(void) | |||
| 347 | omap_chip.oc |= CHIP_IS_OMAP4430ES1; | 347 | omap_chip.oc |= CHIP_IS_OMAP4430ES1; |
| 348 | break; | 348 | break; |
| 349 | case 1: | 349 | case 1: |
| 350 | default: | ||
| 350 | omap_revision = OMAP4430_REV_ES2_0; | 351 | omap_revision = OMAP4430_REV_ES2_0; |
| 351 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; | 352 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; |
| 353 | } | ||
| 354 | break; | ||
| 355 | case 0xb95c: | ||
| 356 | switch (rev) { | ||
| 357 | case 3: | ||
| 358 | omap_revision = OMAP4430_REV_ES2_1; | ||
| 359 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_1; | ||
| 352 | break; | 360 | break; |
| 361 | case 4: | ||
| 353 | default: | 362 | default: |
| 354 | omap_revision = OMAP4430_REV_ES2_0; | 363 | omap_revision = OMAP4430_REV_ES2_2; |
| 355 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; | 364 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_2; |
| 356 | } | 365 | } |
| 357 | break; | 366 | break; |
| 358 | default: | 367 | default: |
| 359 | /* Unknown default to latest silicon rev as default*/ | 368 | /* Unknown default to latest silicon rev as default */ |
| 360 | omap_revision = OMAP4430_REV_ES2_0; | 369 | omap_revision = OMAP4430_REV_ES2_2; |
| 361 | omap_chip.oc |= CHIP_IS_OMAP4430ES2; | 370 | omap_chip.oc |= CHIP_IS_OMAP4430ES2_2; |
| 362 | } | 371 | } |
| 363 | 372 | ||
| 364 | pr_info("OMAP%04x ES%d.0\n", | 373 | pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, |
| 365 | omap_rev() >> 16, ((omap_rev() >> 12) & 0xf) + 1); | 374 | ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf)); |
| 366 | } | 375 | } |
| 367 | 376 | ||
| 368 | #define OMAP3_SHOW_FEATURE(feat) \ | 377 | #define OMAP3_SHOW_FEATURE(feat) \ |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 03f71ec3cd82..441e79d043a7 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | 30 | ||
| 31 | #include <plat/sram.h> | 31 | #include <plat/sram.h> |
| 32 | #include <plat/sdrc.h> | 32 | #include <plat/sdrc.h> |
| 33 | #include <plat/gpmc.h> | ||
| 34 | #include <plat/serial.h> | 33 | #include <plat/serial.h> |
| 35 | 34 | ||
| 36 | #include "clock2xxx.h" | 35 | #include "clock2xxx.h" |
| @@ -422,7 +421,6 @@ void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, | |||
| 422 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); | 421 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); |
| 423 | _omap2_init_reprogram_sdrc(); | 422 | _omap2_init_reprogram_sdrc(); |
| 424 | } | 423 | } |
| 425 | gpmc_init(); | ||
| 426 | 424 | ||
| 427 | omap_irq_base_init(); | 425 | omap_irq_base_init(); |
| 428 | } | 426 | } |
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index 14ee686b6492..adb083e41acd 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c | |||
| @@ -145,35 +145,32 @@ static void omap2_iommu_set_twl(struct iommu *obj, bool on) | |||
| 145 | 145 | ||
| 146 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) | 146 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) |
| 147 | { | 147 | { |
| 148 | int i; | ||
| 149 | u32 stat, da; | 148 | u32 stat, da; |
| 150 | const char *err_msg[] = { | 149 | u32 errs = 0; |
| 151 | "tlb miss", | ||
| 152 | "translation fault", | ||
| 153 | "emulation miss", | ||
| 154 | "table walk fault", | ||
| 155 | "multi hit fault", | ||
| 156 | }; | ||
| 157 | 150 | ||
| 158 | stat = iommu_read_reg(obj, MMU_IRQSTATUS); | 151 | stat = iommu_read_reg(obj, MMU_IRQSTATUS); |
| 159 | stat &= MMU_IRQ_MASK; | 152 | stat &= MMU_IRQ_MASK; |
| 160 | if (!stat) | 153 | if (!stat) { |
| 154 | *ra = 0; | ||
| 161 | return 0; | 155 | return 0; |
| 156 | } | ||
| 162 | 157 | ||
| 163 | da = iommu_read_reg(obj, MMU_FAULT_AD); | 158 | da = iommu_read_reg(obj, MMU_FAULT_AD); |
| 164 | *ra = da; | 159 | *ra = da; |
| 165 | 160 | ||
| 166 | dev_err(obj->dev, "%s:\tda:%08x ", __func__, da); | 161 | if (stat & MMU_IRQ_TLBMISS) |
| 167 | 162 | errs |= OMAP_IOMMU_ERR_TLB_MISS; | |
| 168 | for (i = 0; i < ARRAY_SIZE(err_msg); i++) { | 163 | if (stat & MMU_IRQ_TRANSLATIONFAULT) |
| 169 | if (stat & (1 << i)) | 164 | errs |= OMAP_IOMMU_ERR_TRANS_FAULT; |
| 170 | printk("%s ", err_msg[i]); | 165 | if (stat & MMU_IRQ_EMUMISS) |
| 171 | } | 166 | errs |= OMAP_IOMMU_ERR_EMU_MISS; |
| 172 | printk("\n"); | 167 | if (stat & MMU_IRQ_TABLEWALKFAULT) |
| 173 | 168 | errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT; | |
| 169 | if (stat & MMU_IRQ_MULTIHITFAULT) | ||
| 170 | errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT; | ||
| 174 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); | 171 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); |
| 175 | 172 | ||
| 176 | return stat; | 173 | return errs; |
| 177 | } | 174 | } |
| 178 | 175 | ||
| 179 | static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) | 176 | static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) |
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 29b9dc3917af..6e15e3d7c65e 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c | |||
| @@ -14,12 +14,11 @@ | |||
| 14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
| 15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
| 17 | #include <linux/pm_runtime.h> | ||
| 17 | #include <plat/mailbox.h> | 18 | #include <plat/mailbox.h> |
| 18 | #include <mach/irqs.h> | 19 | #include <mach/irqs.h> |
| 19 | 20 | ||
| 20 | #define MAILBOX_REVISION 0x000 | 21 | #define MAILBOX_REVISION 0x000 |
| 21 | #define MAILBOX_SYSCONFIG 0x010 | ||
| 22 | #define MAILBOX_SYSSTATUS 0x014 | ||
| 23 | #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) | 22 | #define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) |
| 24 | #define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) | 23 | #define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) |
| 25 | #define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) | 24 | #define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) |
| @@ -33,17 +32,6 @@ | |||
| 33 | #define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m))) | 32 | #define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m))) |
| 34 | #define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1)) | 33 | #define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1)) |
| 35 | 34 | ||
| 36 | /* SYSCONFIG: register bit definition */ | ||
| 37 | #define AUTOIDLE (1 << 0) | ||
| 38 | #define SOFTRESET (1 << 1) | ||
| 39 | #define SMARTIDLE (2 << 3) | ||
| 40 | #define OMAP4_SOFTRESET (1 << 0) | ||
| 41 | #define OMAP4_NOIDLE (1 << 2) | ||
| 42 | #define OMAP4_SMARTIDLE (2 << 2) | ||
| 43 | |||
| 44 | /* SYSSTATUS: register bit definition */ | ||
| 45 | #define RESETDONE (1 << 0) | ||
| 46 | |||
| 47 | #define MBOX_REG_SIZE 0x120 | 35 | #define MBOX_REG_SIZE 0x120 |
| 48 | 36 | ||
| 49 | #define OMAP4_MBOX_REG_SIZE 0x130 | 37 | #define OMAP4_MBOX_REG_SIZE 0x130 |
| @@ -70,8 +58,6 @@ struct omap_mbox2_priv { | |||
| 70 | unsigned long irqdisable; | 58 | unsigned long irqdisable; |
| 71 | }; | 59 | }; |
| 72 | 60 | ||
| 73 | static struct clk *mbox_ick_handle; | ||
| 74 | |||
| 75 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, | 61 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, |
| 76 | omap_mbox_type_t irq); | 62 | omap_mbox_type_t irq); |
| 77 | 63 | ||
| @@ -89,53 +75,13 @@ static inline void mbox_write_reg(u32 val, size_t ofs) | |||
| 89 | static int omap2_mbox_startup(struct omap_mbox *mbox) | 75 | static int omap2_mbox_startup(struct omap_mbox *mbox) |
| 90 | { | 76 | { |
| 91 | u32 l; | 77 | u32 l; |
| 92 | unsigned long timeout; | ||
| 93 | 78 | ||
| 94 | mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); | 79 | pm_runtime_enable(mbox->dev->parent); |
| 95 | if (IS_ERR(mbox_ick_handle)) { | 80 | pm_runtime_get_sync(mbox->dev->parent); |
| 96 | printk(KERN_ERR "Could not get mailboxes_ick: %ld\n", | ||
| 97 | PTR_ERR(mbox_ick_handle)); | ||
| 98 | return PTR_ERR(mbox_ick_handle); | ||
| 99 | } | ||
| 100 | clk_enable(mbox_ick_handle); | ||
| 101 | |||
| 102 | if (cpu_is_omap44xx()) { | ||
| 103 | mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG); | ||
| 104 | timeout = jiffies + msecs_to_jiffies(20); | ||
| 105 | do { | ||
| 106 | l = mbox_read_reg(MAILBOX_SYSCONFIG); | ||
| 107 | if (!(l & OMAP4_SOFTRESET)) | ||
| 108 | break; | ||
| 109 | } while (!time_after(jiffies, timeout)); | ||
| 110 | |||
| 111 | if (l & OMAP4_SOFTRESET) { | ||
| 112 | pr_err("Can't take mailbox out of reset\n"); | ||
| 113 | return -ENODEV; | ||
| 114 | } | ||
| 115 | } else { | ||
| 116 | mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG); | ||
| 117 | timeout = jiffies + msecs_to_jiffies(20); | ||
| 118 | do { | ||
| 119 | l = mbox_read_reg(MAILBOX_SYSSTATUS); | ||
| 120 | if (l & RESETDONE) | ||
| 121 | break; | ||
| 122 | } while (!time_after(jiffies, timeout)); | ||
| 123 | |||
| 124 | if (!(l & RESETDONE)) { | ||
| 125 | pr_err("Can't take mailbox out of reset\n"); | ||
| 126 | return -ENODEV; | ||
| 127 | } | ||
| 128 | } | ||
| 129 | 81 | ||
| 130 | l = mbox_read_reg(MAILBOX_REVISION); | 82 | l = mbox_read_reg(MAILBOX_REVISION); |
| 131 | pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); | 83 | pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); |
| 132 | 84 | ||
| 133 | if (cpu_is_omap44xx()) | ||
| 134 | l = OMAP4_SMARTIDLE; | ||
| 135 | else | ||
| 136 | l = SMARTIDLE | AUTOIDLE; | ||
| 137 | mbox_write_reg(l, MAILBOX_SYSCONFIG); | ||
| 138 | |||
| 139 | omap2_mbox_enable_irq(mbox, IRQ_RX); | 85 | omap2_mbox_enable_irq(mbox, IRQ_RX); |
| 140 | 86 | ||
| 141 | return 0; | 87 | return 0; |
| @@ -143,9 +89,8 @@ static int omap2_mbox_startup(struct omap_mbox *mbox) | |||
| 143 | 89 | ||
| 144 | static void omap2_mbox_shutdown(struct omap_mbox *mbox) | 90 | static void omap2_mbox_shutdown(struct omap_mbox *mbox) |
| 145 | { | 91 | { |
| 146 | clk_disable(mbox_ick_handle); | 92 | pm_runtime_put_sync(mbox->dev->parent); |
| 147 | clk_put(mbox_ick_handle); | 93 | pm_runtime_disable(mbox->dev->parent); |
| 148 | mbox_ick_handle = NULL; | ||
| 149 | } | 94 | } |
| 150 | 95 | ||
| 151 | /* Mailbox FIFO handle functions */ | 96 | /* Mailbox FIFO handle functions */ |
| @@ -334,7 +279,7 @@ static struct omap_mbox mbox_iva_info = { | |||
| 334 | .priv = &omap2_mbox_iva_priv, | 279 | .priv = &omap2_mbox_iva_priv, |
| 335 | }; | 280 | }; |
| 336 | 281 | ||
| 337 | struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL }; | 282 | struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL }; |
| 338 | #endif | 283 | #endif |
| 339 | 284 | ||
| 340 | #if defined(CONFIG_ARCH_OMAP4) | 285 | #if defined(CONFIG_ARCH_OMAP4) |
| @@ -398,14 +343,14 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev) | |||
| 398 | else if (cpu_is_omap34xx()) { | 343 | else if (cpu_is_omap34xx()) { |
| 399 | list = omap3_mboxes; | 344 | list = omap3_mboxes; |
| 400 | 345 | ||
| 401 | list[0]->irq = platform_get_irq_byname(pdev, "dsp"); | 346 | list[0]->irq = platform_get_irq(pdev, 0); |
| 402 | } | 347 | } |
| 403 | #endif | 348 | #endif |
| 404 | #if defined(CONFIG_ARCH_OMAP2) | 349 | #if defined(CONFIG_ARCH_OMAP2) |
| 405 | else if (cpu_is_omap2430()) { | 350 | else if (cpu_is_omap2430()) { |
| 406 | list = omap2_mboxes; | 351 | list = omap2_mboxes; |
| 407 | 352 | ||
| 408 | list[0]->irq = platform_get_irq_byname(pdev, "dsp"); | 353 | list[0]->irq = platform_get_irq(pdev, 0); |
| 409 | } else if (cpu_is_omap2420()) { | 354 | } else if (cpu_is_omap2420()) { |
| 410 | list = omap2_mboxes; | 355 | list = omap2_mboxes; |
| 411 | 356 | ||
| @@ -417,8 +362,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev) | |||
| 417 | else if (cpu_is_omap44xx()) { | 362 | else if (cpu_is_omap44xx()) { |
| 418 | list = omap4_mboxes; | 363 | list = omap4_mboxes; |
| 419 | 364 | ||
| 420 | list[0]->irq = list[1]->irq = | 365 | list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0); |
| 421 | platform_get_irq_byname(pdev, "mbox"); | ||
| 422 | } | 366 | } |
| 423 | #endif | 367 | #endif |
| 424 | else { | 368 | else { |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 0526b758bdcc..565b9064a328 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
| @@ -22,10 +22,11 @@ | |||
| 22 | #include <plat/dma.h> | 22 | #include <plat/dma.h> |
| 23 | #include <plat/cpu.h> | 23 | #include <plat/cpu.h> |
| 24 | #include <plat/mcbsp.h> | 24 | #include <plat/mcbsp.h> |
| 25 | #include <plat/omap_device.h> | ||
| 26 | #include <linux/pm_runtime.h> | ||
| 25 | 27 | ||
| 26 | #include "control.h" | 28 | #include "control.h" |
| 27 | 29 | ||
| 28 | |||
| 29 | /* McBSP internal signal muxing functions */ | 30 | /* McBSP internal signal muxing functions */ |
| 30 | 31 | ||
| 31 | void omap2_mcbsp1_mux_clkr_src(u8 mux) | 32 | void omap2_mcbsp1_mux_clkr_src(u8 mux) |
| @@ -83,7 +84,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id) | |||
| 83 | return -EINVAL; | 84 | return -EINVAL; |
| 84 | } | 85 | } |
| 85 | 86 | ||
| 86 | clk_disable(mcbsp->fclk); | 87 | pm_runtime_put_sync(mcbsp->dev); |
| 87 | 88 | ||
| 88 | r = clk_set_parent(mcbsp->fclk, fck_src); | 89 | r = clk_set_parent(mcbsp->fclk, fck_src); |
| 89 | if (IS_ERR_VALUE(r)) { | 90 | if (IS_ERR_VALUE(r)) { |
| @@ -93,7 +94,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id) | |||
| 93 | return -EINVAL; | 94 | return -EINVAL; |
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | clk_enable(mcbsp->fclk); | 97 | pm_runtime_get_sync(mcbsp->dev); |
| 97 | 98 | ||
| 98 | clk_put(fck_src); | 99 | clk_put(fck_src); |
| 99 | 100 | ||
| @@ -101,196 +102,70 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id) | |||
| 101 | } | 102 | } |
| 102 | EXPORT_SYMBOL(omap2_mcbsp_set_clks_src); | 103 | EXPORT_SYMBOL(omap2_mcbsp_set_clks_src); |
| 103 | 104 | ||
| 104 | 105 | struct omap_device_pm_latency omap2_mcbsp_latency[] = { | |
| 105 | /* Platform data */ | ||
| 106 | |||
| 107 | #ifdef CONFIG_SOC_OMAP2420 | ||
| 108 | static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { | ||
| 109 | { | 106 | { |
| 110 | .phys_base = OMAP24XX_MCBSP1_BASE, | 107 | .deactivate_func = omap_device_idle_hwmods, |
| 111 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | 108 | .activate_func = omap_device_enable_hwmods, |
| 112 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | 109 | .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, |
| 113 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | ||
| 114 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | ||
| 115 | }, | ||
| 116 | { | ||
| 117 | .phys_base = OMAP24XX_MCBSP2_BASE, | ||
| 118 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | ||
| 119 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | ||
| 120 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | ||
| 121 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | ||
| 122 | }, | 110 | }, |
| 123 | }; | 111 | }; |
| 124 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) | ||
| 125 | #define OMAP2420_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
| 126 | #else | ||
| 127 | #define omap2420_mcbsp_pdata NULL | ||
| 128 | #define OMAP2420_MCBSP_PDATA_SZ 0 | ||
| 129 | #define OMAP2420_MCBSP_REG_NUM 0 | ||
| 130 | #endif | ||
| 131 | 112 | ||
| 132 | #ifdef CONFIG_SOC_OMAP2430 | 113 | static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) |
| 133 | static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | 114 | { |
| 134 | { | 115 | int id, count = 1; |
| 135 | .phys_base = OMAP24XX_MCBSP1_BASE, | 116 | char *name = "omap-mcbsp"; |
| 136 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | 117 | struct omap_hwmod *oh_device[2]; |
| 137 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | 118 | struct omap_mcbsp_platform_data *pdata = NULL; |
| 138 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | 119 | struct omap_device *od; |
| 139 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | .phys_base = OMAP24XX_MCBSP2_BASE, | ||
| 143 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | ||
| 144 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | ||
| 145 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | ||
| 146 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | ||
| 147 | }, | ||
| 148 | { | ||
| 149 | .phys_base = OMAP2430_MCBSP3_BASE, | ||
| 150 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, | ||
| 151 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, | ||
| 152 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | ||
| 153 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, | ||
| 154 | }, | ||
| 155 | { | ||
| 156 | .phys_base = OMAP2430_MCBSP4_BASE, | ||
| 157 | .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX, | ||
| 158 | .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX, | ||
| 159 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, | ||
| 160 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, | ||
| 161 | }, | ||
| 162 | { | ||
| 163 | .phys_base = OMAP2430_MCBSP5_BASE, | ||
| 164 | .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX, | ||
| 165 | .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX, | ||
| 166 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, | ||
| 167 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, | ||
| 168 | }, | ||
| 169 | }; | ||
| 170 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) | ||
| 171 | #define OMAP2430_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
| 172 | #else | ||
| 173 | #define omap2430_mcbsp_pdata NULL | ||
| 174 | #define OMAP2430_MCBSP_PDATA_SZ 0 | ||
| 175 | #define OMAP2430_MCBSP_REG_NUM 0 | ||
| 176 | #endif | ||
| 177 | 120 | ||
| 178 | #ifdef CONFIG_ARCH_OMAP3 | 121 | sscanf(oh->name, "mcbsp%d", &id); |
| 179 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | ||
| 180 | { | ||
| 181 | .phys_base = OMAP34XX_MCBSP1_BASE, | ||
| 182 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | ||
| 183 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | ||
| 184 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | ||
| 185 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | ||
| 186 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
| 187 | }, | ||
| 188 | { | ||
| 189 | .phys_base = OMAP34XX_MCBSP2_BASE, | ||
| 190 | .phys_base_st = OMAP34XX_MCBSP2_ST_BASE, | ||
| 191 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | ||
| 192 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | ||
| 193 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | ||
| 194 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | ||
| 195 | .buffer_size = 0x500, /* The FIFO has 1024 + 256 locations */ | ||
| 196 | }, | ||
| 197 | { | ||
| 198 | .phys_base = OMAP34XX_MCBSP3_BASE, | ||
| 199 | .phys_base_st = OMAP34XX_MCBSP3_ST_BASE, | ||
| 200 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, | ||
| 201 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, | ||
| 202 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | ||
| 203 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, | ||
| 204 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
| 205 | }, | ||
| 206 | { | ||
| 207 | .phys_base = OMAP34XX_MCBSP4_BASE, | ||
| 208 | .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX, | ||
| 209 | .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX, | ||
| 210 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, | ||
| 211 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, | ||
| 212 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
| 213 | }, | ||
| 214 | { | ||
| 215 | .phys_base = OMAP34XX_MCBSP5_BASE, | ||
| 216 | .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX, | ||
| 217 | .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX, | ||
| 218 | .rx_irq = INT_24XX_MCBSP5_IRQ_RX, | ||
| 219 | .tx_irq = INT_24XX_MCBSP5_IRQ_TX, | ||
| 220 | .buffer_size = 0x80, /* The FIFO has 128 locations */ | ||
| 221 | }, | ||
| 222 | }; | ||
| 223 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) | ||
| 224 | #define OMAP34XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
| 225 | #else | ||
| 226 | #define omap34xx_mcbsp_pdata NULL | ||
| 227 | #define OMAP34XX_MCBSP_PDATA_SZ 0 | ||
| 228 | #define OMAP34XX_MCBSP_REG_NUM 0 | ||
| 229 | #endif | ||
| 230 | 122 | ||
| 231 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | 123 | pdata = kzalloc(sizeof(struct omap_mcbsp_platform_data), GFP_KERNEL); |
| 232 | { | 124 | if (!pdata) { |
| 233 | .phys_base = OMAP44XX_MCBSP1_BASE, | 125 | pr_err("%s: No memory for mcbsp\n", __func__); |
| 234 | .dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX, | 126 | return -ENOMEM; |
| 235 | .dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX, | 127 | } |
| 236 | .tx_irq = OMAP44XX_IRQ_MCBSP1, | 128 | |
| 237 | }, | 129 | pdata->mcbsp_config_type = oh->class->rev; |
| 238 | { | 130 | |
| 239 | .phys_base = OMAP44XX_MCBSP2_BASE, | 131 | if (oh->class->rev == MCBSP_CONFIG_TYPE3) { |
| 240 | .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX, | 132 | if (id == 2) |
| 241 | .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX, | 133 | /* The FIFO has 1024 + 256 locations */ |
| 242 | .tx_irq = OMAP44XX_IRQ_MCBSP2, | 134 | pdata->buffer_size = 0x500; |
| 243 | }, | 135 | else |
| 244 | { | 136 | /* The FIFO has 128 locations */ |
| 245 | .phys_base = OMAP44XX_MCBSP3_BASE, | 137 | pdata->buffer_size = 0x80; |
| 246 | .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX, | 138 | } |
| 247 | .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX, | 139 | |
| 248 | .tx_irq = OMAP44XX_IRQ_MCBSP3, | 140 | oh_device[0] = oh; |
| 249 | }, | 141 | |
| 250 | { | 142 | if (oh->dev_attr) { |
| 251 | .phys_base = OMAP44XX_MCBSP4_BASE, | 143 | oh_device[1] = omap_hwmod_lookup(( |
| 252 | .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX, | 144 | (struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone); |
| 253 | .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX, | 145 | count++; |
| 254 | .tx_irq = OMAP44XX_IRQ_MCBSP4, | 146 | } |
| 255 | }, | 147 | od = omap_device_build_ss(name, id, oh_device, count, pdata, |
| 256 | }; | 148 | sizeof(*pdata), omap2_mcbsp_latency, |
| 257 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) | 149 | ARRAY_SIZE(omap2_mcbsp_latency), false); |
| 258 | #define OMAP44XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | 150 | kfree(pdata); |
| 151 | if (IS_ERR(od)) { | ||
| 152 | pr_err("%s: Cant build omap_device for %s:%s.\n", __func__, | ||
| 153 | name, oh->name); | ||
| 154 | return PTR_ERR(od); | ||
| 155 | } | ||
| 156 | omap_mcbsp_count++; | ||
| 157 | return 0; | ||
| 158 | } | ||
| 259 | 159 | ||
| 260 | static int __init omap2_mcbsp_init(void) | 160 | static int __init omap2_mcbsp_init(void) |
| 261 | { | 161 | { |
| 262 | if (cpu_is_omap2420()) { | 162 | omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL); |
| 263 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; | ||
| 264 | omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16); | ||
| 265 | } else if (cpu_is_omap2430()) { | ||
| 266 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; | ||
| 267 | omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32); | ||
| 268 | } else if (cpu_is_omap34xx()) { | ||
| 269 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; | ||
| 270 | omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32); | ||
| 271 | } else if (cpu_is_omap44xx()) { | ||
| 272 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; | ||
| 273 | omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32); | ||
| 274 | } | ||
| 275 | 163 | ||
| 276 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 164 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
| 277 | GFP_KERNEL); | 165 | GFP_KERNEL); |
| 278 | if (!mcbsp_ptr) | 166 | if (!mcbsp_ptr) |
| 279 | return -ENOMEM; | 167 | return -ENOMEM; |
| 280 | 168 | ||
| 281 | if (cpu_is_omap2420()) | ||
| 282 | omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata, | ||
| 283 | OMAP2420_MCBSP_PDATA_SZ); | ||
| 284 | if (cpu_is_omap2430()) | ||
| 285 | omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata, | ||
| 286 | OMAP2430_MCBSP_PDATA_SZ); | ||
| 287 | if (cpu_is_omap34xx()) | ||
| 288 | omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata, | ||
| 289 | OMAP34XX_MCBSP_PDATA_SZ); | ||
| 290 | if (cpu_is_omap44xx()) | ||
| 291 | omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata, | ||
| 292 | OMAP44XX_MCBSP_PDATA_SZ); | ||
| 293 | |||
| 294 | return omap_mcbsp_init(); | 169 | return omap_mcbsp_init(); |
| 295 | } | 170 | } |
| 296 | arch_initcall(omap2_mcbsp_init); | 171 | arch_initcall(omap2_mcbsp_init); |
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 98148b6c36e9..6c84659cf846 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
| @@ -605,7 +605,7 @@ static void __init omap_mux_dbg_create_entry( | |||
| 605 | list_for_each_entry(e, &partition->muxmodes, node) { | 605 | list_for_each_entry(e, &partition->muxmodes, node) { |
| 606 | struct omap_mux *m = &e->mux; | 606 | struct omap_mux *m = &e->mux; |
| 607 | 607 | ||
| 608 | (void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir, | 608 | (void)debugfs_create_file(m->muxnames[0], S_IWUSR, mux_dbg_dir, |
| 609 | m, &omap_mux_dbg_signal_fops); | 609 | m, &omap_mux_dbg_signal_fops); |
| 610 | } | 610 | } |
| 611 | } | 611 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 9e89a58711b7..e39772beaedd 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * omap_hwmod implementation for OMAP2/3/4 | 2 | * omap_hwmod implementation for OMAP2/3/4 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 Nokia Corporation | 4 | * Copyright (C) 2009-2011 Nokia Corporation |
| 5 | * | 5 | * |
| 6 | * Paul Walmsley, Benoît Cousson, Kevin Hilman | 6 | * Paul Walmsley, Benoît Cousson, Kevin Hilman |
| 7 | * | 7 | * |
| @@ -162,9 +162,6 @@ static LIST_HEAD(omap_hwmod_list); | |||
| 162 | /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ | 162 | /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ |
| 163 | static struct omap_hwmod *mpu_oh; | 163 | static struct omap_hwmod *mpu_oh; |
| 164 | 164 | ||
| 165 | /* inited: 0 if omap_hwmod_init() has not yet been called; 1 otherwise */ | ||
| 166 | static u8 inited; | ||
| 167 | |||
| 168 | 165 | ||
| 169 | /* Private functions */ | 166 | /* Private functions */ |
| 170 | 167 | ||
| @@ -460,14 +457,18 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v) | |||
| 460 | * will be accessed by a particular initiator (e.g., if a module will | 457 | * will be accessed by a particular initiator (e.g., if a module will |
| 461 | * be accessed by the IVA, there should be a sleepdep between the IVA | 458 | * be accessed by the IVA, there should be a sleepdep between the IVA |
| 462 | * initiator and the module). Only applies to modules in smart-idle | 459 | * initiator and the module). Only applies to modules in smart-idle |
| 463 | * mode. Returns -EINVAL upon error or passes along | 460 | * mode. If the clockdomain is marked as not needing autodeps, return |
| 464 | * clkdm_add_sleepdep() value upon success. | 461 | * 0 without doing anything. Otherwise, returns -EINVAL upon error or |
| 462 | * passes along clkdm_add_sleepdep() value upon success. | ||
| 465 | */ | 463 | */ |
| 466 | static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | 464 | static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) |
| 467 | { | 465 | { |
| 468 | if (!oh->_clk) | 466 | if (!oh->_clk) |
| 469 | return -EINVAL; | 467 | return -EINVAL; |
| 470 | 468 | ||
| 469 | if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) | ||
| 470 | return 0; | ||
| 471 | |||
| 471 | return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); | 472 | return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); |
| 472 | } | 473 | } |
| 473 | 474 | ||
| @@ -480,14 +481,18 @@ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | |||
| 480 | * be accessed by a particular initiator (e.g., if a module will not | 481 | * be accessed by a particular initiator (e.g., if a module will not |
| 481 | * be accessed by the IVA, there should be no sleepdep between the IVA | 482 | * be accessed by the IVA, there should be no sleepdep between the IVA |
| 482 | * initiator and the module). Only applies to modules in smart-idle | 483 | * initiator and the module). Only applies to modules in smart-idle |
| 483 | * mode. Returns -EINVAL upon error or passes along | 484 | * mode. If the clockdomain is marked as not needing autodeps, return |
| 484 | * clkdm_del_sleepdep() value upon success. | 485 | * 0 without doing anything. Returns -EINVAL upon error or passes |
| 486 | * along clkdm_del_sleepdep() value upon success. | ||
| 485 | */ | 487 | */ |
| 486 | static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | 488 | static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) |
| 487 | { | 489 | { |
| 488 | if (!oh->_clk) | 490 | if (!oh->_clk) |
| 489 | return -EINVAL; | 491 | return -EINVAL; |
| 490 | 492 | ||
| 493 | if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS) | ||
| 494 | return 0; | ||
| 495 | |||
| 491 | return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); | 496 | return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); |
| 492 | } | 497 | } |
| 493 | 498 | ||
| @@ -904,18 +909,16 @@ static struct omap_hwmod *_lookup(const char *name) | |||
| 904 | * @oh: struct omap_hwmod * | 909 | * @oh: struct omap_hwmod * |
| 905 | * @data: not used; pass NULL | 910 | * @data: not used; pass NULL |
| 906 | * | 911 | * |
| 907 | * Called by omap_hwmod_late_init() (after omap2_clk_init()). | 912 | * Called by omap_hwmod_setup_*() (after omap2_clk_init()). |
| 908 | * Resolves all clock names embedded in the hwmod. Returns -EINVAL if | 913 | * Resolves all clock names embedded in the hwmod. Returns 0 on |
| 909 | * the omap_hwmod has not yet been registered or if the clocks have | 914 | * success, or a negative error code on failure. |
| 910 | * already been initialized, 0 on success, or a non-zero error on | ||
| 911 | * failure. | ||
| 912 | */ | 915 | */ |
| 913 | static int _init_clocks(struct omap_hwmod *oh, void *data) | 916 | static int _init_clocks(struct omap_hwmod *oh, void *data) |
| 914 | { | 917 | { |
| 915 | int ret = 0; | 918 | int ret = 0; |
| 916 | 919 | ||
| 917 | if (!oh || (oh->_state != _HWMOD_STATE_REGISTERED)) | 920 | if (oh->_state != _HWMOD_STATE_REGISTERED) |
| 918 | return -EINVAL; | 921 | return 0; |
| 919 | 922 | ||
| 920 | pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name); | 923 | pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name); |
| 921 | 924 | ||
| @@ -1288,6 +1291,42 @@ static int _idle(struct omap_hwmod *oh) | |||
| 1288 | } | 1291 | } |
| 1289 | 1292 | ||
| 1290 | /** | 1293 | /** |
| 1294 | * omap_hwmod_set_ocp_autoidle - set the hwmod's OCP autoidle bit | ||
| 1295 | * @oh: struct omap_hwmod * | ||
| 1296 | * @autoidle: desired AUTOIDLE bitfield value (0 or 1) | ||
| 1297 | * | ||
| 1298 | * Sets the IP block's OCP autoidle bit in hardware, and updates our | ||
| 1299 | * local copy. Intended to be used by drivers that require | ||
| 1300 | * direct manipulation of the AUTOIDLE bits. | ||
| 1301 | * Returns -EINVAL if @oh is null or is not in the ENABLED state, or passes | ||
| 1302 | * along the return value from _set_module_autoidle(). | ||
| 1303 | * | ||
| 1304 | * Any users of this function should be scrutinized carefully. | ||
| 1305 | */ | ||
| 1306 | int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle) | ||
| 1307 | { | ||
| 1308 | u32 v; | ||
| 1309 | int retval = 0; | ||
| 1310 | unsigned long flags; | ||
| 1311 | |||
| 1312 | if (!oh || oh->_state != _HWMOD_STATE_ENABLED) | ||
| 1313 | return -EINVAL; | ||
| 1314 | |||
| 1315 | spin_lock_irqsave(&oh->_lock, flags); | ||
| 1316 | |||
| 1317 | v = oh->_sysc_cache; | ||
| 1318 | |||
| 1319 | retval = _set_module_autoidle(oh, autoidle, &v); | ||
| 1320 | |||
| 1321 | if (!retval) | ||
| 1322 | _write_sysconfig(v, oh); | ||
| 1323 | |||
| 1324 | spin_unlock_irqrestore(&oh->_lock, flags); | ||
| 1325 | |||
| 1326 | return retval; | ||
| 1327 | } | ||
| 1328 | |||
| 1329 | /** | ||
| 1291 | * _shutdown - shutdown an omap_hwmod | 1330 | * _shutdown - shutdown an omap_hwmod |
| 1292 | * @oh: struct omap_hwmod * | 1331 | * @oh: struct omap_hwmod * |
| 1293 | * | 1332 | * |
| @@ -1354,14 +1393,16 @@ static int _shutdown(struct omap_hwmod *oh) | |||
| 1354 | * @oh: struct omap_hwmod * | 1393 | * @oh: struct omap_hwmod * |
| 1355 | * | 1394 | * |
| 1356 | * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh | 1395 | * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh |
| 1357 | * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the | 1396 | * OCP_SYSCONFIG register. Returns 0. |
| 1358 | * wrong state or returns 0. | ||
| 1359 | */ | 1397 | */ |
| 1360 | static int _setup(struct omap_hwmod *oh, void *data) | 1398 | static int _setup(struct omap_hwmod *oh, void *data) |
| 1361 | { | 1399 | { |
| 1362 | int i, r; | 1400 | int i, r; |
| 1363 | u8 postsetup_state; | 1401 | u8 postsetup_state; |
| 1364 | 1402 | ||
| 1403 | if (oh->_state != _HWMOD_STATE_CLKS_INITED) | ||
| 1404 | return 0; | ||
| 1405 | |||
| 1365 | /* Set iclk autoidle mode */ | 1406 | /* Set iclk autoidle mode */ |
| 1366 | if (oh->slaves_cnt > 0) { | 1407 | if (oh->slaves_cnt > 0) { |
| 1367 | for (i = 0; i < oh->slaves_cnt; i++) { | 1408 | for (i = 0; i < oh->slaves_cnt; i++) { |
| @@ -1455,7 +1496,7 @@ static int _setup(struct omap_hwmod *oh, void *data) | |||
| 1455 | */ | 1496 | */ |
| 1456 | static int __init _register(struct omap_hwmod *oh) | 1497 | static int __init _register(struct omap_hwmod *oh) |
| 1457 | { | 1498 | { |
| 1458 | int ret, ms_id; | 1499 | int ms_id; |
| 1459 | 1500 | ||
| 1460 | if (!oh || !oh->name || !oh->class || !oh->class->name || | 1501 | if (!oh || !oh->name || !oh->class || !oh->class->name || |
| 1461 | (oh->_state != _HWMOD_STATE_UNKNOWN)) | 1502 | (oh->_state != _HWMOD_STATE_UNKNOWN)) |
| @@ -1478,9 +1519,14 @@ static int __init _register(struct omap_hwmod *oh) | |||
| 1478 | 1519 | ||
| 1479 | oh->_state = _HWMOD_STATE_REGISTERED; | 1520 | oh->_state = _HWMOD_STATE_REGISTERED; |
| 1480 | 1521 | ||
| 1481 | ret = 0; | 1522 | /* |
| 1523 | * XXX Rather than doing a strcmp(), this should test a flag | ||
| 1524 | * set in the hwmod data, inserted by the autogenerator code. | ||
| 1525 | */ | ||
| 1526 | if (!strcmp(oh->name, MPU_INITIATOR_NAME)) | ||
| 1527 | mpu_oh = oh; | ||
| 1482 | 1528 | ||
| 1483 | return ret; | 1529 | return 0; |
| 1484 | } | 1530 | } |
| 1485 | 1531 | ||
| 1486 | 1532 | ||
| @@ -1583,38 +1629,30 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), | |||
| 1583 | return ret; | 1629 | return ret; |
| 1584 | } | 1630 | } |
| 1585 | 1631 | ||
| 1586 | |||
| 1587 | /** | 1632 | /** |
| 1588 | * omap_hwmod_init - init omap_hwmod code and register hwmods | 1633 | * omap_hwmod_register - register an array of hwmods |
| 1589 | * @ohs: pointer to an array of omap_hwmods to register | 1634 | * @ohs: pointer to an array of omap_hwmods to register |
| 1590 | * | 1635 | * |
| 1591 | * Intended to be called early in boot before the clock framework is | 1636 | * Intended to be called early in boot before the clock framework is |
| 1592 | * initialized. If @ohs is not null, will register all omap_hwmods | 1637 | * initialized. If @ohs is not null, will register all omap_hwmods |
| 1593 | * listed in @ohs that are valid for this chip. Returns -EINVAL if | 1638 | * listed in @ohs that are valid for this chip. Returns 0. |
| 1594 | * omap_hwmod_init() has already been called or 0 otherwise. | ||
| 1595 | */ | 1639 | */ |
| 1596 | int __init omap_hwmod_init(struct omap_hwmod **ohs) | 1640 | int __init omap_hwmod_register(struct omap_hwmod **ohs) |
| 1597 | { | 1641 | { |
| 1598 | struct omap_hwmod *oh; | 1642 | int r, i; |
| 1599 | int r; | ||
| 1600 | |||
| 1601 | if (inited) | ||
| 1602 | return -EINVAL; | ||
| 1603 | |||
| 1604 | inited = 1; | ||
| 1605 | 1643 | ||
| 1606 | if (!ohs) | 1644 | if (!ohs) |
| 1607 | return 0; | 1645 | return 0; |
| 1608 | 1646 | ||
| 1609 | oh = *ohs; | 1647 | i = 0; |
| 1610 | while (oh) { | 1648 | do { |
| 1611 | if (omap_chip_is(oh->omap_chip)) { | 1649 | if (!omap_chip_is(ohs[i]->omap_chip)) |
| 1612 | r = _register(oh); | 1650 | continue; |
| 1613 | WARN(r, "omap_hwmod: %s: _register returned " | 1651 | |
| 1614 | "%d\n", oh->name, r); | 1652 | r = _register(ohs[i]); |
| 1615 | } | 1653 | WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name, |
| 1616 | oh = *++ohs; | 1654 | r); |
| 1617 | } | 1655 | } while (ohs[++i]); |
| 1618 | 1656 | ||
| 1619 | return 0; | 1657 | return 0; |
| 1620 | } | 1658 | } |
| @@ -1622,12 +1660,14 @@ int __init omap_hwmod_init(struct omap_hwmod **ohs) | |||
| 1622 | /* | 1660 | /* |
| 1623 | * _populate_mpu_rt_base - populate the virtual address for a hwmod | 1661 | * _populate_mpu_rt_base - populate the virtual address for a hwmod |
| 1624 | * | 1662 | * |
| 1625 | * Must be called only from omap_hwmod_late_init so ioremap works properly. | 1663 | * Must be called only from omap_hwmod_setup_*() so ioremap works properly. |
| 1626 | * Assumes the caller takes care of locking if needed. | 1664 | * Assumes the caller takes care of locking if needed. |
| 1627 | * | ||
| 1628 | */ | 1665 | */ |
| 1629 | static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data) | 1666 | static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data) |
| 1630 | { | 1667 | { |
| 1668 | if (oh->_state != _HWMOD_STATE_REGISTERED) | ||
| 1669 | return 0; | ||
| 1670 | |||
| 1631 | if (oh->_int_flags & _HWMOD_NO_MPU_PORT) | 1671 | if (oh->_int_flags & _HWMOD_NO_MPU_PORT) |
| 1632 | return 0; | 1672 | return 0; |
| 1633 | 1673 | ||
| @@ -1640,31 +1680,81 @@ static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data) | |||
| 1640 | } | 1680 | } |
| 1641 | 1681 | ||
| 1642 | /** | 1682 | /** |
| 1643 | * omap_hwmod_late_init - do some post-clock framework initialization | 1683 | * omap_hwmod_setup_one - set up a single hwmod |
| 1684 | * @oh_name: const char * name of the already-registered hwmod to set up | ||
| 1685 | * | ||
| 1686 | * Must be called after omap2_clk_init(). Resolves the struct clk | ||
| 1687 | * names to struct clk pointers for each registered omap_hwmod. Also | ||
| 1688 | * calls _setup() on each hwmod. Returns -EINVAL upon error or 0 upon | ||
| 1689 | * success. | ||
| 1690 | */ | ||
| 1691 | int __init omap_hwmod_setup_one(const char *oh_name) | ||
| 1692 | { | ||
| 1693 | struct omap_hwmod *oh; | ||
| 1694 | int r; | ||
| 1695 | |||
| 1696 | pr_debug("omap_hwmod: %s: %s\n", oh_name, __func__); | ||
| 1697 | |||
| 1698 | if (!mpu_oh) { | ||
| 1699 | pr_err("omap_hwmod: %s: cannot setup_one: MPU initiator hwmod %s not yet registered\n", | ||
| 1700 | oh_name, MPU_INITIATOR_NAME); | ||
| 1701 | return -EINVAL; | ||
| 1702 | } | ||
| 1703 | |||
| 1704 | oh = _lookup(oh_name); | ||
| 1705 | if (!oh) { | ||
| 1706 | WARN(1, "omap_hwmod: %s: hwmod not yet registered\n", oh_name); | ||
| 1707 | return -EINVAL; | ||
| 1708 | } | ||
| 1709 | |||
| 1710 | if (mpu_oh->_state == _HWMOD_STATE_REGISTERED && oh != mpu_oh) | ||
| 1711 | omap_hwmod_setup_one(MPU_INITIATOR_NAME); | ||
| 1712 | |||
| 1713 | r = _populate_mpu_rt_base(oh, NULL); | ||
| 1714 | if (IS_ERR_VALUE(r)) { | ||
| 1715 | WARN(1, "omap_hwmod: %s: couldn't set mpu_rt_base\n", oh_name); | ||
| 1716 | return -EINVAL; | ||
| 1717 | } | ||
| 1718 | |||
| 1719 | r = _init_clocks(oh, NULL); | ||
| 1720 | if (IS_ERR_VALUE(r)) { | ||
| 1721 | WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh_name); | ||
| 1722 | return -EINVAL; | ||
| 1723 | } | ||
| 1724 | |||
| 1725 | _setup(oh, NULL); | ||
| 1726 | |||
| 1727 | return 0; | ||
| 1728 | } | ||
| 1729 | |||
| 1730 | /** | ||
| 1731 | * omap_hwmod_setup - do some post-clock framework initialization | ||
| 1644 | * | 1732 | * |
| 1645 | * Must be called after omap2_clk_init(). Resolves the struct clk names | 1733 | * Must be called after omap2_clk_init(). Resolves the struct clk names |
| 1646 | * to struct clk pointers for each registered omap_hwmod. Also calls | 1734 | * to struct clk pointers for each registered omap_hwmod. Also calls |
| 1647 | * _setup() on each hwmod. Returns 0. | 1735 | * _setup() on each hwmod. Returns 0 upon success. |
| 1648 | */ | 1736 | */ |
| 1649 | static int __init omap_hwmod_late_init(void) | 1737 | static int __init omap_hwmod_setup_all(void) |
| 1650 | { | 1738 | { |
| 1651 | int r; | 1739 | int r; |
| 1652 | 1740 | ||
| 1741 | if (!mpu_oh) { | ||
| 1742 | pr_err("omap_hwmod: %s: MPU initiator hwmod %s not yet registered\n", | ||
| 1743 | __func__, MPU_INITIATOR_NAME); | ||
| 1744 | return -EINVAL; | ||
| 1745 | } | ||
| 1746 | |||
| 1653 | r = omap_hwmod_for_each(_populate_mpu_rt_base, NULL); | 1747 | r = omap_hwmod_for_each(_populate_mpu_rt_base, NULL); |
| 1654 | 1748 | ||
| 1655 | /* XXX check return value */ | ||
| 1656 | r = omap_hwmod_for_each(_init_clocks, NULL); | 1749 | r = omap_hwmod_for_each(_init_clocks, NULL); |
| 1657 | WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n"); | 1750 | WARN(IS_ERR_VALUE(r), |
| 1658 | 1751 | "omap_hwmod: %s: _init_clocks failed\n", __func__); | |
| 1659 | mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME); | ||
| 1660 | WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", | ||
| 1661 | MPU_INITIATOR_NAME); | ||
| 1662 | 1752 | ||
| 1663 | omap_hwmod_for_each(_setup, NULL); | 1753 | omap_hwmod_for_each(_setup, NULL); |
| 1664 | 1754 | ||
| 1665 | return 0; | 1755 | return 0; |
| 1666 | } | 1756 | } |
| 1667 | core_initcall(omap_hwmod_late_init); | 1757 | core_initcall(omap_hwmod_setup_all); |
| 1668 | 1758 | ||
| 1669 | /** | 1759 | /** |
| 1670 | * omap_hwmod_enable - enable an omap_hwmod | 1760 | * omap_hwmod_enable - enable an omap_hwmod |
| @@ -1883,6 +1973,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) | |||
| 1883 | os = oh->slaves[i]; | 1973 | os = oh->slaves[i]; |
| 1884 | 1974 | ||
| 1885 | for (j = 0; j < os->addr_cnt; j++) { | 1975 | for (j = 0; j < os->addr_cnt; j++) { |
| 1976 | (res + r)->name = (os->addr + j)->name; | ||
| 1886 | (res + r)->start = (os->addr + j)->pa_start; | 1977 | (res + r)->start = (os->addr + j)->pa_start; |
| 1887 | (res + r)->end = (os->addr + j)->pa_end; | 1978 | (res + r)->end = (os->addr + j)->pa_end; |
| 1888 | (res + r)->flags = IORESOURCE_MEM; | 1979 | (res + r)->flags = IORESOURCE_MEM; |
| @@ -2183,11 +2274,11 @@ int omap_hwmod_for_each_by_class(const char *classname, | |||
| 2183 | * @oh: struct omap_hwmod * | 2274 | * @oh: struct omap_hwmod * |
| 2184 | * @state: state that _setup() should leave the hwmod in | 2275 | * @state: state that _setup() should leave the hwmod in |
| 2185 | * | 2276 | * |
| 2186 | * Sets the hwmod state that @oh will enter at the end of _setup() (called by | 2277 | * Sets the hwmod state that @oh will enter at the end of _setup() |
| 2187 | * omap_hwmod_late_init()). Only valid to call between calls to | 2278 | * (called by omap_hwmod_setup_*()). Only valid to call between |
| 2188 | * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or | 2279 | * calling omap_hwmod_register() and omap_hwmod_setup_*(). Returns |
| 2189 | * -EINVAL if there is a problem with the arguments or if the hwmod is | 2280 | * 0 upon success or -EINVAL if there is a problem with the arguments |
| 2190 | * in the wrong state. | 2281 | * or if the hwmod is in the wrong state. |
| 2191 | */ | 2282 | */ |
| 2192 | int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) | 2283 | int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) |
| 2193 | { | 2284 | { |
| @@ -2239,3 +2330,29 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh) | |||
| 2239 | 2330 | ||
| 2240 | return ret; | 2331 | return ret; |
| 2241 | } | 2332 | } |
| 2333 | |||
| 2334 | /** | ||
| 2335 | * omap_hwmod_no_setup_reset - prevent a hwmod from being reset upon setup | ||
| 2336 | * @oh: struct omap_hwmod * | ||
| 2337 | * | ||
| 2338 | * Prevent the hwmod @oh from being reset during the setup process. | ||
| 2339 | * Intended for use by board-*.c files on boards with devices that | ||
| 2340 | * cannot tolerate being reset. Must be called before the hwmod has | ||
| 2341 | * been set up. Returns 0 upon success or negative error code upon | ||
| 2342 | * failure. | ||
| 2343 | */ | ||
| 2344 | int omap_hwmod_no_setup_reset(struct omap_hwmod *oh) | ||
| 2345 | { | ||
| 2346 | if (!oh) | ||
| 2347 | return -EINVAL; | ||
| 2348 | |||
| 2349 | if (oh->_state != _HWMOD_STATE_REGISTERED) { | ||
| 2350 | pr_err("omap_hwmod: %s: cannot prevent setup reset; in wrong state\n", | ||
| 2351 | oh->name); | ||
| 2352 | return -EINVAL; | ||
| 2353 | } | ||
| 2354 | |||
| 2355 | oh->flags |= HWMOD_INIT_NO_RESET; | ||
| 2356 | |||
| 2357 | return 0; | ||
| 2358 | } | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index f323c6bb22de..61e58bd27aec 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <plat/i2c.h> | 19 | #include <plat/i2c.h> |
| 20 | #include <plat/gpio.h> | 20 | #include <plat/gpio.h> |
| 21 | #include <plat/mcspi.h> | 21 | #include <plat/mcspi.h> |
| 22 | #include <plat/dmtimer.h> | ||
| 22 | #include <plat/l3_2xxx.h> | 23 | #include <plat/l3_2xxx.h> |
| 23 | #include <plat/l4_2xxx.h> | 24 | #include <plat/l4_2xxx.h> |
| 24 | 25 | ||
| @@ -109,6 +110,8 @@ static struct omap_hwmod omap2420_uart2_hwmod; | |||
| 109 | static struct omap_hwmod omap2420_uart3_hwmod; | 110 | static struct omap_hwmod omap2420_uart3_hwmod; |
| 110 | static struct omap_hwmod omap2420_i2c1_hwmod; | 111 | static struct omap_hwmod omap2420_i2c1_hwmod; |
| 111 | static struct omap_hwmod omap2420_i2c2_hwmod; | 112 | static struct omap_hwmod omap2420_i2c2_hwmod; |
| 113 | static struct omap_hwmod omap2420_mcbsp1_hwmod; | ||
| 114 | static struct omap_hwmod omap2420_mcbsp2_hwmod; | ||
| 112 | 115 | ||
| 113 | /* l4 core -> mcspi1 interface */ | 116 | /* l4 core -> mcspi1 interface */ |
| 114 | static struct omap_hwmod_addr_space omap2420_mcspi1_addr_space[] = { | 117 | static struct omap_hwmod_addr_space omap2420_mcspi1_addr_space[] = { |
| @@ -337,6 +340,625 @@ static struct omap_hwmod omap2420_iva_hwmod = { | |||
| 337 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | 340 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) |
| 338 | }; | 341 | }; |
| 339 | 342 | ||
| 343 | /* Timer Common */ | ||
| 344 | static struct omap_hwmod_class_sysconfig omap2420_timer_sysc = { | ||
| 345 | .rev_offs = 0x0000, | ||
| 346 | .sysc_offs = 0x0010, | ||
| 347 | .syss_offs = 0x0014, | ||
| 348 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
| 349 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
| 350 | SYSC_HAS_AUTOIDLE), | ||
| 351 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 352 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 353 | }; | ||
| 354 | |||
| 355 | static struct omap_hwmod_class omap2420_timer_hwmod_class = { | ||
| 356 | .name = "timer", | ||
| 357 | .sysc = &omap2420_timer_sysc, | ||
| 358 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
| 359 | }; | ||
| 360 | |||
| 361 | /* timer1 */ | ||
| 362 | static struct omap_hwmod omap2420_timer1_hwmod; | ||
| 363 | static struct omap_hwmod_irq_info omap2420_timer1_mpu_irqs[] = { | ||
| 364 | { .irq = 37, }, | ||
| 365 | }; | ||
| 366 | |||
| 367 | static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = { | ||
| 368 | { | ||
| 369 | .pa_start = 0x48028000, | ||
| 370 | .pa_end = 0x48028000 + SZ_1K - 1, | ||
| 371 | .flags = ADDR_TYPE_RT | ||
| 372 | }, | ||
| 373 | }; | ||
| 374 | |||
| 375 | /* l4_wkup -> timer1 */ | ||
| 376 | static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = { | ||
| 377 | .master = &omap2420_l4_wkup_hwmod, | ||
| 378 | .slave = &omap2420_timer1_hwmod, | ||
| 379 | .clk = "gpt1_ick", | ||
| 380 | .addr = omap2420_timer1_addrs, | ||
| 381 | .addr_cnt = ARRAY_SIZE(omap2420_timer1_addrs), | ||
| 382 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 383 | }; | ||
| 384 | |||
| 385 | /* timer1 slave port */ | ||
| 386 | static struct omap_hwmod_ocp_if *omap2420_timer1_slaves[] = { | ||
| 387 | &omap2420_l4_wkup__timer1, | ||
| 388 | }; | ||
| 389 | |||
| 390 | /* timer1 hwmod */ | ||
| 391 | static struct omap_hwmod omap2420_timer1_hwmod = { | ||
| 392 | .name = "timer1", | ||
| 393 | .mpu_irqs = omap2420_timer1_mpu_irqs, | ||
| 394 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer1_mpu_irqs), | ||
| 395 | .main_clk = "gpt1_fck", | ||
| 396 | .prcm = { | ||
| 397 | .omap2 = { | ||
| 398 | .prcm_reg_id = 1, | ||
| 399 | .module_bit = OMAP24XX_EN_GPT1_SHIFT, | ||
| 400 | .module_offs = WKUP_MOD, | ||
| 401 | .idlest_reg_id = 1, | ||
| 402 | .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, | ||
| 403 | }, | ||
| 404 | }, | ||
| 405 | .slaves = omap2420_timer1_slaves, | ||
| 406 | .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves), | ||
| 407 | .class = &omap2420_timer_hwmod_class, | ||
| 408 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 409 | }; | ||
| 410 | |||
| 411 | /* timer2 */ | ||
| 412 | static struct omap_hwmod omap2420_timer2_hwmod; | ||
| 413 | static struct omap_hwmod_irq_info omap2420_timer2_mpu_irqs[] = { | ||
| 414 | { .irq = 38, }, | ||
| 415 | }; | ||
| 416 | |||
| 417 | static struct omap_hwmod_addr_space omap2420_timer2_addrs[] = { | ||
| 418 | { | ||
| 419 | .pa_start = 0x4802a000, | ||
| 420 | .pa_end = 0x4802a000 + SZ_1K - 1, | ||
| 421 | .flags = ADDR_TYPE_RT | ||
| 422 | }, | ||
| 423 | }; | ||
| 424 | |||
| 425 | /* l4_core -> timer2 */ | ||
| 426 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer2 = { | ||
| 427 | .master = &omap2420_l4_core_hwmod, | ||
| 428 | .slave = &omap2420_timer2_hwmod, | ||
| 429 | .clk = "gpt2_ick", | ||
| 430 | .addr = omap2420_timer2_addrs, | ||
| 431 | .addr_cnt = ARRAY_SIZE(omap2420_timer2_addrs), | ||
| 432 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 433 | }; | ||
| 434 | |||
| 435 | /* timer2 slave port */ | ||
| 436 | static struct omap_hwmod_ocp_if *omap2420_timer2_slaves[] = { | ||
| 437 | &omap2420_l4_core__timer2, | ||
| 438 | }; | ||
| 439 | |||
| 440 | /* timer2 hwmod */ | ||
| 441 | static struct omap_hwmod omap2420_timer2_hwmod = { | ||
| 442 | .name = "timer2", | ||
| 443 | .mpu_irqs = omap2420_timer2_mpu_irqs, | ||
| 444 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer2_mpu_irqs), | ||
| 445 | .main_clk = "gpt2_fck", | ||
| 446 | .prcm = { | ||
| 447 | .omap2 = { | ||
| 448 | .prcm_reg_id = 1, | ||
| 449 | .module_bit = OMAP24XX_EN_GPT2_SHIFT, | ||
| 450 | .module_offs = CORE_MOD, | ||
| 451 | .idlest_reg_id = 1, | ||
| 452 | .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT, | ||
| 453 | }, | ||
| 454 | }, | ||
| 455 | .slaves = omap2420_timer2_slaves, | ||
| 456 | .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves), | ||
| 457 | .class = &omap2420_timer_hwmod_class, | ||
| 458 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 459 | }; | ||
| 460 | |||
| 461 | /* timer3 */ | ||
| 462 | static struct omap_hwmod omap2420_timer3_hwmod; | ||
| 463 | static struct omap_hwmod_irq_info omap2420_timer3_mpu_irqs[] = { | ||
| 464 | { .irq = 39, }, | ||
| 465 | }; | ||
| 466 | |||
| 467 | static struct omap_hwmod_addr_space omap2420_timer3_addrs[] = { | ||
| 468 | { | ||
| 469 | .pa_start = 0x48078000, | ||
| 470 | .pa_end = 0x48078000 + SZ_1K - 1, | ||
| 471 | .flags = ADDR_TYPE_RT | ||
| 472 | }, | ||
| 473 | }; | ||
| 474 | |||
| 475 | /* l4_core -> timer3 */ | ||
| 476 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer3 = { | ||
| 477 | .master = &omap2420_l4_core_hwmod, | ||
| 478 | .slave = &omap2420_timer3_hwmod, | ||
| 479 | .clk = "gpt3_ick", | ||
| 480 | .addr = omap2420_timer3_addrs, | ||
| 481 | .addr_cnt = ARRAY_SIZE(omap2420_timer3_addrs), | ||
| 482 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 483 | }; | ||
| 484 | |||
| 485 | /* timer3 slave port */ | ||
| 486 | static struct omap_hwmod_ocp_if *omap2420_timer3_slaves[] = { | ||
| 487 | &omap2420_l4_core__timer3, | ||
| 488 | }; | ||
| 489 | |||
| 490 | /* timer3 hwmod */ | ||
| 491 | static struct omap_hwmod omap2420_timer3_hwmod = { | ||
| 492 | .name = "timer3", | ||
| 493 | .mpu_irqs = omap2420_timer3_mpu_irqs, | ||
| 494 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer3_mpu_irqs), | ||
| 495 | .main_clk = "gpt3_fck", | ||
| 496 | .prcm = { | ||
| 497 | .omap2 = { | ||
| 498 | .prcm_reg_id = 1, | ||
| 499 | .module_bit = OMAP24XX_EN_GPT3_SHIFT, | ||
| 500 | .module_offs = CORE_MOD, | ||
| 501 | .idlest_reg_id = 1, | ||
| 502 | .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT, | ||
| 503 | }, | ||
| 504 | }, | ||
| 505 | .slaves = omap2420_timer3_slaves, | ||
| 506 | .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves), | ||
| 507 | .class = &omap2420_timer_hwmod_class, | ||
| 508 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 509 | }; | ||
| 510 | |||
| 511 | /* timer4 */ | ||
| 512 | static struct omap_hwmod omap2420_timer4_hwmod; | ||
| 513 | static struct omap_hwmod_irq_info omap2420_timer4_mpu_irqs[] = { | ||
| 514 | { .irq = 40, }, | ||
| 515 | }; | ||
| 516 | |||
| 517 | static struct omap_hwmod_addr_space omap2420_timer4_addrs[] = { | ||
| 518 | { | ||
| 519 | .pa_start = 0x4807a000, | ||
| 520 | .pa_end = 0x4807a000 + SZ_1K - 1, | ||
| 521 | .flags = ADDR_TYPE_RT | ||
| 522 | }, | ||
| 523 | }; | ||
| 524 | |||
| 525 | /* l4_core -> timer4 */ | ||
| 526 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer4 = { | ||
| 527 | .master = &omap2420_l4_core_hwmod, | ||
| 528 | .slave = &omap2420_timer4_hwmod, | ||
| 529 | .clk = "gpt4_ick", | ||
| 530 | .addr = omap2420_timer4_addrs, | ||
| 531 | .addr_cnt = ARRAY_SIZE(omap2420_timer4_addrs), | ||
| 532 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 533 | }; | ||
| 534 | |||
| 535 | /* timer4 slave port */ | ||
| 536 | static struct omap_hwmod_ocp_if *omap2420_timer4_slaves[] = { | ||
| 537 | &omap2420_l4_core__timer4, | ||
| 538 | }; | ||
| 539 | |||
| 540 | /* timer4 hwmod */ | ||
| 541 | static struct omap_hwmod omap2420_timer4_hwmod = { | ||
| 542 | .name = "timer4", | ||
| 543 | .mpu_irqs = omap2420_timer4_mpu_irqs, | ||
| 544 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer4_mpu_irqs), | ||
| 545 | .main_clk = "gpt4_fck", | ||
| 546 | .prcm = { | ||
| 547 | .omap2 = { | ||
| 548 | .prcm_reg_id = 1, | ||
| 549 | .module_bit = OMAP24XX_EN_GPT4_SHIFT, | ||
| 550 | .module_offs = CORE_MOD, | ||
| 551 | .idlest_reg_id = 1, | ||
| 552 | .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT, | ||
| 553 | }, | ||
| 554 | }, | ||
| 555 | .slaves = omap2420_timer4_slaves, | ||
| 556 | .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves), | ||
| 557 | .class = &omap2420_timer_hwmod_class, | ||
| 558 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 559 | }; | ||
| 560 | |||
| 561 | /* timer5 */ | ||
| 562 | static struct omap_hwmod omap2420_timer5_hwmod; | ||
| 563 | static struct omap_hwmod_irq_info omap2420_timer5_mpu_irqs[] = { | ||
| 564 | { .irq = 41, }, | ||
| 565 | }; | ||
| 566 | |||
| 567 | static struct omap_hwmod_addr_space omap2420_timer5_addrs[] = { | ||
| 568 | { | ||
| 569 | .pa_start = 0x4807c000, | ||
| 570 | .pa_end = 0x4807c000 + SZ_1K - 1, | ||
| 571 | .flags = ADDR_TYPE_RT | ||
| 572 | }, | ||
| 573 | }; | ||
| 574 | |||
| 575 | /* l4_core -> timer5 */ | ||
| 576 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer5 = { | ||
| 577 | .master = &omap2420_l4_core_hwmod, | ||
| 578 | .slave = &omap2420_timer5_hwmod, | ||
| 579 | .clk = "gpt5_ick", | ||
| 580 | .addr = omap2420_timer5_addrs, | ||
| 581 | .addr_cnt = ARRAY_SIZE(omap2420_timer5_addrs), | ||
| 582 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 583 | }; | ||
| 584 | |||
| 585 | /* timer5 slave port */ | ||
| 586 | static struct omap_hwmod_ocp_if *omap2420_timer5_slaves[] = { | ||
| 587 | &omap2420_l4_core__timer5, | ||
| 588 | }; | ||
| 589 | |||
| 590 | /* timer5 hwmod */ | ||
| 591 | static struct omap_hwmod omap2420_timer5_hwmod = { | ||
| 592 | .name = "timer5", | ||
| 593 | .mpu_irqs = omap2420_timer5_mpu_irqs, | ||
| 594 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer5_mpu_irqs), | ||
| 595 | .main_clk = "gpt5_fck", | ||
| 596 | .prcm = { | ||
| 597 | .omap2 = { | ||
| 598 | .prcm_reg_id = 1, | ||
| 599 | .module_bit = OMAP24XX_EN_GPT5_SHIFT, | ||
| 600 | .module_offs = CORE_MOD, | ||
| 601 | .idlest_reg_id = 1, | ||
| 602 | .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, | ||
| 603 | }, | ||
| 604 | }, | ||
| 605 | .slaves = omap2420_timer5_slaves, | ||
| 606 | .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves), | ||
| 607 | .class = &omap2420_timer_hwmod_class, | ||
| 608 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 609 | }; | ||
| 610 | |||
| 611 | |||
| 612 | /* timer6 */ | ||
| 613 | static struct omap_hwmod omap2420_timer6_hwmod; | ||
| 614 | static struct omap_hwmod_irq_info omap2420_timer6_mpu_irqs[] = { | ||
| 615 | { .irq = 42, }, | ||
| 616 | }; | ||
| 617 | |||
| 618 | static struct omap_hwmod_addr_space omap2420_timer6_addrs[] = { | ||
| 619 | { | ||
| 620 | .pa_start = 0x4807e000, | ||
| 621 | .pa_end = 0x4807e000 + SZ_1K - 1, | ||
| 622 | .flags = ADDR_TYPE_RT | ||
| 623 | }, | ||
| 624 | }; | ||
| 625 | |||
| 626 | /* l4_core -> timer6 */ | ||
| 627 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer6 = { | ||
| 628 | .master = &omap2420_l4_core_hwmod, | ||
| 629 | .slave = &omap2420_timer6_hwmod, | ||
| 630 | .clk = "gpt6_ick", | ||
| 631 | .addr = omap2420_timer6_addrs, | ||
| 632 | .addr_cnt = ARRAY_SIZE(omap2420_timer6_addrs), | ||
| 633 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 634 | }; | ||
| 635 | |||
| 636 | /* timer6 slave port */ | ||
| 637 | static struct omap_hwmod_ocp_if *omap2420_timer6_slaves[] = { | ||
| 638 | &omap2420_l4_core__timer6, | ||
| 639 | }; | ||
| 640 | |||
| 641 | /* timer6 hwmod */ | ||
| 642 | static struct omap_hwmod omap2420_timer6_hwmod = { | ||
| 643 | .name = "timer6", | ||
| 644 | .mpu_irqs = omap2420_timer6_mpu_irqs, | ||
| 645 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer6_mpu_irqs), | ||
| 646 | .main_clk = "gpt6_fck", | ||
| 647 | .prcm = { | ||
| 648 | .omap2 = { | ||
| 649 | .prcm_reg_id = 1, | ||
| 650 | .module_bit = OMAP24XX_EN_GPT6_SHIFT, | ||
| 651 | .module_offs = CORE_MOD, | ||
| 652 | .idlest_reg_id = 1, | ||
| 653 | .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, | ||
| 654 | }, | ||
| 655 | }, | ||
| 656 | .slaves = omap2420_timer6_slaves, | ||
| 657 | .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves), | ||
| 658 | .class = &omap2420_timer_hwmod_class, | ||
| 659 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 660 | }; | ||
| 661 | |||
| 662 | /* timer7 */ | ||
| 663 | static struct omap_hwmod omap2420_timer7_hwmod; | ||
| 664 | static struct omap_hwmod_irq_info omap2420_timer7_mpu_irqs[] = { | ||
| 665 | { .irq = 43, }, | ||
| 666 | }; | ||
| 667 | |||
| 668 | static struct omap_hwmod_addr_space omap2420_timer7_addrs[] = { | ||
| 669 | { | ||
| 670 | .pa_start = 0x48080000, | ||
| 671 | .pa_end = 0x48080000 + SZ_1K - 1, | ||
| 672 | .flags = ADDR_TYPE_RT | ||
| 673 | }, | ||
| 674 | }; | ||
| 675 | |||
| 676 | /* l4_core -> timer7 */ | ||
| 677 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer7 = { | ||
| 678 | .master = &omap2420_l4_core_hwmod, | ||
| 679 | .slave = &omap2420_timer7_hwmod, | ||
| 680 | .clk = "gpt7_ick", | ||
| 681 | .addr = omap2420_timer7_addrs, | ||
| 682 | .addr_cnt = ARRAY_SIZE(omap2420_timer7_addrs), | ||
| 683 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 684 | }; | ||
| 685 | |||
| 686 | /* timer7 slave port */ | ||
| 687 | static struct omap_hwmod_ocp_if *omap2420_timer7_slaves[] = { | ||
| 688 | &omap2420_l4_core__timer7, | ||
| 689 | }; | ||
| 690 | |||
| 691 | /* timer7 hwmod */ | ||
| 692 | static struct omap_hwmod omap2420_timer7_hwmod = { | ||
| 693 | .name = "timer7", | ||
| 694 | .mpu_irqs = omap2420_timer7_mpu_irqs, | ||
| 695 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer7_mpu_irqs), | ||
| 696 | .main_clk = "gpt7_fck", | ||
| 697 | .prcm = { | ||
| 698 | .omap2 = { | ||
| 699 | .prcm_reg_id = 1, | ||
| 700 | .module_bit = OMAP24XX_EN_GPT7_SHIFT, | ||
| 701 | .module_offs = CORE_MOD, | ||
| 702 | .idlest_reg_id = 1, | ||
| 703 | .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, | ||
| 704 | }, | ||
| 705 | }, | ||
| 706 | .slaves = omap2420_timer7_slaves, | ||
| 707 | .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves), | ||
| 708 | .class = &omap2420_timer_hwmod_class, | ||
| 709 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 710 | }; | ||
| 711 | |||
| 712 | /* timer8 */ | ||
| 713 | static struct omap_hwmod omap2420_timer8_hwmod; | ||
| 714 | static struct omap_hwmod_irq_info omap2420_timer8_mpu_irqs[] = { | ||
| 715 | { .irq = 44, }, | ||
| 716 | }; | ||
| 717 | |||
| 718 | static struct omap_hwmod_addr_space omap2420_timer8_addrs[] = { | ||
| 719 | { | ||
| 720 | .pa_start = 0x48082000, | ||
| 721 | .pa_end = 0x48082000 + SZ_1K - 1, | ||
| 722 | .flags = ADDR_TYPE_RT | ||
| 723 | }, | ||
| 724 | }; | ||
| 725 | |||
| 726 | /* l4_core -> timer8 */ | ||
| 727 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer8 = { | ||
| 728 | .master = &omap2420_l4_core_hwmod, | ||
| 729 | .slave = &omap2420_timer8_hwmod, | ||
| 730 | .clk = "gpt8_ick", | ||
| 731 | .addr = omap2420_timer8_addrs, | ||
| 732 | .addr_cnt = ARRAY_SIZE(omap2420_timer8_addrs), | ||
| 733 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 734 | }; | ||
| 735 | |||
| 736 | /* timer8 slave port */ | ||
| 737 | static struct omap_hwmod_ocp_if *omap2420_timer8_slaves[] = { | ||
| 738 | &omap2420_l4_core__timer8, | ||
| 739 | }; | ||
| 740 | |||
| 741 | /* timer8 hwmod */ | ||
| 742 | static struct omap_hwmod omap2420_timer8_hwmod = { | ||
| 743 | .name = "timer8", | ||
| 744 | .mpu_irqs = omap2420_timer8_mpu_irqs, | ||
| 745 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer8_mpu_irqs), | ||
| 746 | .main_clk = "gpt8_fck", | ||
| 747 | .prcm = { | ||
| 748 | .omap2 = { | ||
| 749 | .prcm_reg_id = 1, | ||
| 750 | .module_bit = OMAP24XX_EN_GPT8_SHIFT, | ||
| 751 | .module_offs = CORE_MOD, | ||
| 752 | .idlest_reg_id = 1, | ||
| 753 | .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, | ||
| 754 | }, | ||
| 755 | }, | ||
| 756 | .slaves = omap2420_timer8_slaves, | ||
| 757 | .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves), | ||
| 758 | .class = &omap2420_timer_hwmod_class, | ||
| 759 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 760 | }; | ||
| 761 | |||
| 762 | /* timer9 */ | ||
| 763 | static struct omap_hwmod omap2420_timer9_hwmod; | ||
| 764 | static struct omap_hwmod_irq_info omap2420_timer9_mpu_irqs[] = { | ||
| 765 | { .irq = 45, }, | ||
| 766 | }; | ||
| 767 | |||
| 768 | static struct omap_hwmod_addr_space omap2420_timer9_addrs[] = { | ||
| 769 | { | ||
| 770 | .pa_start = 0x48084000, | ||
| 771 | .pa_end = 0x48084000 + SZ_1K - 1, | ||
| 772 | .flags = ADDR_TYPE_RT | ||
| 773 | }, | ||
| 774 | }; | ||
| 775 | |||
| 776 | /* l4_core -> timer9 */ | ||
| 777 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer9 = { | ||
| 778 | .master = &omap2420_l4_core_hwmod, | ||
| 779 | .slave = &omap2420_timer9_hwmod, | ||
| 780 | .clk = "gpt9_ick", | ||
| 781 | .addr = omap2420_timer9_addrs, | ||
| 782 | .addr_cnt = ARRAY_SIZE(omap2420_timer9_addrs), | ||
| 783 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 784 | }; | ||
| 785 | |||
| 786 | /* timer9 slave port */ | ||
| 787 | static struct omap_hwmod_ocp_if *omap2420_timer9_slaves[] = { | ||
| 788 | &omap2420_l4_core__timer9, | ||
| 789 | }; | ||
| 790 | |||
| 791 | /* timer9 hwmod */ | ||
| 792 | static struct omap_hwmod omap2420_timer9_hwmod = { | ||
| 793 | .name = "timer9", | ||
| 794 | .mpu_irqs = omap2420_timer9_mpu_irqs, | ||
| 795 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer9_mpu_irqs), | ||
| 796 | .main_clk = "gpt9_fck", | ||
| 797 | .prcm = { | ||
| 798 | .omap2 = { | ||
| 799 | .prcm_reg_id = 1, | ||
| 800 | .module_bit = OMAP24XX_EN_GPT9_SHIFT, | ||
| 801 | .module_offs = CORE_MOD, | ||
| 802 | .idlest_reg_id = 1, | ||
| 803 | .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT, | ||
| 804 | }, | ||
| 805 | }, | ||
| 806 | .slaves = omap2420_timer9_slaves, | ||
| 807 | .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves), | ||
| 808 | .class = &omap2420_timer_hwmod_class, | ||
| 809 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 810 | }; | ||
| 811 | |||
| 812 | /* timer10 */ | ||
| 813 | static struct omap_hwmod omap2420_timer10_hwmod; | ||
| 814 | static struct omap_hwmod_irq_info omap2420_timer10_mpu_irqs[] = { | ||
| 815 | { .irq = 46, }, | ||
| 816 | }; | ||
| 817 | |||
| 818 | static struct omap_hwmod_addr_space omap2420_timer10_addrs[] = { | ||
| 819 | { | ||
| 820 | .pa_start = 0x48086000, | ||
| 821 | .pa_end = 0x48086000 + SZ_1K - 1, | ||
| 822 | .flags = ADDR_TYPE_RT | ||
| 823 | }, | ||
| 824 | }; | ||
| 825 | |||
| 826 | /* l4_core -> timer10 */ | ||
| 827 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer10 = { | ||
| 828 | .master = &omap2420_l4_core_hwmod, | ||
| 829 | .slave = &omap2420_timer10_hwmod, | ||
| 830 | .clk = "gpt10_ick", | ||
| 831 | .addr = omap2420_timer10_addrs, | ||
| 832 | .addr_cnt = ARRAY_SIZE(omap2420_timer10_addrs), | ||
| 833 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 834 | }; | ||
| 835 | |||
| 836 | /* timer10 slave port */ | ||
| 837 | static struct omap_hwmod_ocp_if *omap2420_timer10_slaves[] = { | ||
| 838 | &omap2420_l4_core__timer10, | ||
| 839 | }; | ||
| 840 | |||
| 841 | /* timer10 hwmod */ | ||
| 842 | static struct omap_hwmod omap2420_timer10_hwmod = { | ||
| 843 | .name = "timer10", | ||
| 844 | .mpu_irqs = omap2420_timer10_mpu_irqs, | ||
| 845 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer10_mpu_irqs), | ||
| 846 | .main_clk = "gpt10_fck", | ||
| 847 | .prcm = { | ||
| 848 | .omap2 = { | ||
| 849 | .prcm_reg_id = 1, | ||
| 850 | .module_bit = OMAP24XX_EN_GPT10_SHIFT, | ||
| 851 | .module_offs = CORE_MOD, | ||
| 852 | .idlest_reg_id = 1, | ||
| 853 | .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, | ||
| 854 | }, | ||
| 855 | }, | ||
| 856 | .slaves = omap2420_timer10_slaves, | ||
| 857 | .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves), | ||
| 858 | .class = &omap2420_timer_hwmod_class, | ||
| 859 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 860 | }; | ||
| 861 | |||
| 862 | /* timer11 */ | ||
| 863 | static struct omap_hwmod omap2420_timer11_hwmod; | ||
| 864 | static struct omap_hwmod_irq_info omap2420_timer11_mpu_irqs[] = { | ||
| 865 | { .irq = 47, }, | ||
| 866 | }; | ||
| 867 | |||
| 868 | static struct omap_hwmod_addr_space omap2420_timer11_addrs[] = { | ||
| 869 | { | ||
| 870 | .pa_start = 0x48088000, | ||
| 871 | .pa_end = 0x48088000 + SZ_1K - 1, | ||
| 872 | .flags = ADDR_TYPE_RT | ||
| 873 | }, | ||
| 874 | }; | ||
| 875 | |||
| 876 | /* l4_core -> timer11 */ | ||
| 877 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer11 = { | ||
| 878 | .master = &omap2420_l4_core_hwmod, | ||
| 879 | .slave = &omap2420_timer11_hwmod, | ||
| 880 | .clk = "gpt11_ick", | ||
| 881 | .addr = omap2420_timer11_addrs, | ||
| 882 | .addr_cnt = ARRAY_SIZE(omap2420_timer11_addrs), | ||
| 883 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 884 | }; | ||
| 885 | |||
| 886 | /* timer11 slave port */ | ||
| 887 | static struct omap_hwmod_ocp_if *omap2420_timer11_slaves[] = { | ||
| 888 | &omap2420_l4_core__timer11, | ||
| 889 | }; | ||
| 890 | |||
| 891 | /* timer11 hwmod */ | ||
| 892 | static struct omap_hwmod omap2420_timer11_hwmod = { | ||
| 893 | .name = "timer11", | ||
| 894 | .mpu_irqs = omap2420_timer11_mpu_irqs, | ||
| 895 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer11_mpu_irqs), | ||
| 896 | .main_clk = "gpt11_fck", | ||
| 897 | .prcm = { | ||
| 898 | .omap2 = { | ||
| 899 | .prcm_reg_id = 1, | ||
| 900 | .module_bit = OMAP24XX_EN_GPT11_SHIFT, | ||
| 901 | .module_offs = CORE_MOD, | ||
| 902 | .idlest_reg_id = 1, | ||
| 903 | .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT, | ||
| 904 | }, | ||
| 905 | }, | ||
| 906 | .slaves = omap2420_timer11_slaves, | ||
| 907 | .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves), | ||
| 908 | .class = &omap2420_timer_hwmod_class, | ||
| 909 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 910 | }; | ||
| 911 | |||
| 912 | /* timer12 */ | ||
| 913 | static struct omap_hwmod omap2420_timer12_hwmod; | ||
| 914 | static struct omap_hwmod_irq_info omap2420_timer12_mpu_irqs[] = { | ||
| 915 | { .irq = 48, }, | ||
| 916 | }; | ||
| 917 | |||
| 918 | static struct omap_hwmod_addr_space omap2420_timer12_addrs[] = { | ||
| 919 | { | ||
| 920 | .pa_start = 0x4808a000, | ||
| 921 | .pa_end = 0x4808a000 + SZ_1K - 1, | ||
| 922 | .flags = ADDR_TYPE_RT | ||
| 923 | }, | ||
| 924 | }; | ||
| 925 | |||
| 926 | /* l4_core -> timer12 */ | ||
| 927 | static struct omap_hwmod_ocp_if omap2420_l4_core__timer12 = { | ||
| 928 | .master = &omap2420_l4_core_hwmod, | ||
| 929 | .slave = &omap2420_timer12_hwmod, | ||
| 930 | .clk = "gpt12_ick", | ||
| 931 | .addr = omap2420_timer12_addrs, | ||
| 932 | .addr_cnt = ARRAY_SIZE(omap2420_timer12_addrs), | ||
| 933 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 934 | }; | ||
| 935 | |||
| 936 | /* timer12 slave port */ | ||
| 937 | static struct omap_hwmod_ocp_if *omap2420_timer12_slaves[] = { | ||
| 938 | &omap2420_l4_core__timer12, | ||
| 939 | }; | ||
| 940 | |||
| 941 | /* timer12 hwmod */ | ||
| 942 | static struct omap_hwmod omap2420_timer12_hwmod = { | ||
| 943 | .name = "timer12", | ||
| 944 | .mpu_irqs = omap2420_timer12_mpu_irqs, | ||
| 945 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer12_mpu_irqs), | ||
| 946 | .main_clk = "gpt12_fck", | ||
| 947 | .prcm = { | ||
| 948 | .omap2 = { | ||
| 949 | .prcm_reg_id = 1, | ||
| 950 | .module_bit = OMAP24XX_EN_GPT12_SHIFT, | ||
| 951 | .module_offs = CORE_MOD, | ||
| 952 | .idlest_reg_id = 1, | ||
| 953 | .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, | ||
| 954 | }, | ||
| 955 | }, | ||
| 956 | .slaves = omap2420_timer12_slaves, | ||
| 957 | .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves), | ||
| 958 | .class = &omap2420_timer_hwmod_class, | ||
| 959 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) | ||
| 960 | }; | ||
| 961 | |||
| 340 | /* l4_wkup -> wd_timer2 */ | 962 | /* l4_wkup -> wd_timer2 */ |
| 341 | static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = { | 963 | static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = { |
| 342 | { | 964 | { |
| @@ -788,6 +1410,7 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = { | |||
| 788 | .flags = OMAP_FIREWALL_L4, | 1410 | .flags = OMAP_FIREWALL_L4, |
| 789 | } | 1411 | } |
| 790 | }, | 1412 | }, |
| 1413 | .flags = OCPIF_SWSUP_IDLE, | ||
| 791 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 1414 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 792 | }; | 1415 | }; |
| 793 | 1416 | ||
| @@ -1208,6 +1831,76 @@ static struct omap_hwmod omap2420_dma_system_hwmod = { | |||
| 1208 | }; | 1831 | }; |
| 1209 | 1832 | ||
| 1210 | /* | 1833 | /* |
| 1834 | * 'mailbox' class | ||
| 1835 | * mailbox module allowing communication between the on-chip processors | ||
| 1836 | * using a queued mailbox-interrupt mechanism. | ||
| 1837 | */ | ||
| 1838 | |||
| 1839 | static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = { | ||
| 1840 | .rev_offs = 0x000, | ||
| 1841 | .sysc_offs = 0x010, | ||
| 1842 | .syss_offs = 0x014, | ||
| 1843 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
| 1844 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
| 1845 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 1846 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 1847 | }; | ||
| 1848 | |||
| 1849 | static struct omap_hwmod_class omap2420_mailbox_hwmod_class = { | ||
| 1850 | .name = "mailbox", | ||
| 1851 | .sysc = &omap2420_mailbox_sysc, | ||
| 1852 | }; | ||
| 1853 | |||
| 1854 | /* mailbox */ | ||
| 1855 | static struct omap_hwmod omap2420_mailbox_hwmod; | ||
| 1856 | static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { | ||
| 1857 | { .name = "dsp", .irq = 26 }, | ||
| 1858 | { .name = "iva", .irq = 34 }, | ||
| 1859 | }; | ||
| 1860 | |||
| 1861 | static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = { | ||
| 1862 | { | ||
| 1863 | .pa_start = 0x48094000, | ||
| 1864 | .pa_end = 0x480941ff, | ||
| 1865 | .flags = ADDR_TYPE_RT, | ||
| 1866 | }, | ||
| 1867 | }; | ||
| 1868 | |||
| 1869 | /* l4_core -> mailbox */ | ||
| 1870 | static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = { | ||
| 1871 | .master = &omap2420_l4_core_hwmod, | ||
| 1872 | .slave = &omap2420_mailbox_hwmod, | ||
| 1873 | .addr = omap2420_mailbox_addrs, | ||
| 1874 | .addr_cnt = ARRAY_SIZE(omap2420_mailbox_addrs), | ||
| 1875 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 1876 | }; | ||
| 1877 | |||
| 1878 | /* mailbox slave ports */ | ||
| 1879 | static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = { | ||
| 1880 | &omap2420_l4_core__mailbox, | ||
| 1881 | }; | ||
| 1882 | |||
| 1883 | static struct omap_hwmod omap2420_mailbox_hwmod = { | ||
| 1884 | .name = "mailbox", | ||
| 1885 | .class = &omap2420_mailbox_hwmod_class, | ||
| 1886 | .mpu_irqs = omap2420_mailbox_irqs, | ||
| 1887 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mailbox_irqs), | ||
| 1888 | .main_clk = "mailboxes_ick", | ||
| 1889 | .prcm = { | ||
| 1890 | .omap2 = { | ||
| 1891 | .prcm_reg_id = 1, | ||
| 1892 | .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT, | ||
| 1893 | .module_offs = CORE_MOD, | ||
| 1894 | .idlest_reg_id = 1, | ||
| 1895 | .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, | ||
| 1896 | }, | ||
| 1897 | }, | ||
| 1898 | .slaves = omap2420_mailbox_slaves, | ||
| 1899 | .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves), | ||
| 1900 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
| 1901 | }; | ||
| 1902 | |||
| 1903 | /* | ||
| 1211 | * 'mcspi' class | 1904 | * 'mcspi' class |
| 1212 | * multichannel serial port interface (mcspi) / master/slave synchronous serial | 1905 | * multichannel serial port interface (mcspi) / master/slave synchronous serial |
| 1213 | * bus | 1906 | * bus |
| @@ -1320,12 +2013,149 @@ static struct omap_hwmod omap2420_mcspi2_hwmod = { | |||
| 1320 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 2013 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
| 1321 | }; | 2014 | }; |
| 1322 | 2015 | ||
| 2016 | /* | ||
| 2017 | * 'mcbsp' class | ||
| 2018 | * multi channel buffered serial port controller | ||
| 2019 | */ | ||
| 2020 | |||
| 2021 | static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = { | ||
| 2022 | .name = "mcbsp", | ||
| 2023 | }; | ||
| 2024 | |||
| 2025 | /* mcbsp1 */ | ||
| 2026 | static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = { | ||
| 2027 | { .name = "tx", .irq = 59 }, | ||
| 2028 | { .name = "rx", .irq = 60 }, | ||
| 2029 | }; | ||
| 2030 | |||
| 2031 | static struct omap_hwmod_dma_info omap2420_mcbsp1_sdma_chs[] = { | ||
| 2032 | { .name = "rx", .dma_req = 32 }, | ||
| 2033 | { .name = "tx", .dma_req = 31 }, | ||
| 2034 | }; | ||
| 2035 | |||
| 2036 | static struct omap_hwmod_addr_space omap2420_mcbsp1_addrs[] = { | ||
| 2037 | { | ||
| 2038 | .name = "mpu", | ||
| 2039 | .pa_start = 0x48074000, | ||
| 2040 | .pa_end = 0x480740ff, | ||
| 2041 | .flags = ADDR_TYPE_RT | ||
| 2042 | }, | ||
| 2043 | }; | ||
| 2044 | |||
| 2045 | /* l4_core -> mcbsp1 */ | ||
| 2046 | static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = { | ||
| 2047 | .master = &omap2420_l4_core_hwmod, | ||
| 2048 | .slave = &omap2420_mcbsp1_hwmod, | ||
| 2049 | .clk = "mcbsp1_ick", | ||
| 2050 | .addr = omap2420_mcbsp1_addrs, | ||
| 2051 | .addr_cnt = ARRAY_SIZE(omap2420_mcbsp1_addrs), | ||
| 2052 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2053 | }; | ||
| 2054 | |||
| 2055 | /* mcbsp1 slave ports */ | ||
| 2056 | static struct omap_hwmod_ocp_if *omap2420_mcbsp1_slaves[] = { | ||
| 2057 | &omap2420_l4_core__mcbsp1, | ||
| 2058 | }; | ||
| 2059 | |||
| 2060 | static struct omap_hwmod omap2420_mcbsp1_hwmod = { | ||
| 2061 | .name = "mcbsp1", | ||
| 2062 | .class = &omap2420_mcbsp_hwmod_class, | ||
| 2063 | .mpu_irqs = omap2420_mcbsp1_irqs, | ||
| 2064 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_irqs), | ||
| 2065 | .sdma_reqs = omap2420_mcbsp1_sdma_chs, | ||
| 2066 | .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_sdma_chs), | ||
| 2067 | .main_clk = "mcbsp1_fck", | ||
| 2068 | .prcm = { | ||
| 2069 | .omap2 = { | ||
| 2070 | .prcm_reg_id = 1, | ||
| 2071 | .module_bit = OMAP24XX_EN_MCBSP1_SHIFT, | ||
| 2072 | .module_offs = CORE_MOD, | ||
| 2073 | .idlest_reg_id = 1, | ||
| 2074 | .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT, | ||
| 2075 | }, | ||
| 2076 | }, | ||
| 2077 | .slaves = omap2420_mcbsp1_slaves, | ||
| 2078 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves), | ||
| 2079 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
| 2080 | }; | ||
| 2081 | |||
| 2082 | /* mcbsp2 */ | ||
| 2083 | static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = { | ||
| 2084 | { .name = "tx", .irq = 62 }, | ||
| 2085 | { .name = "rx", .irq = 63 }, | ||
| 2086 | }; | ||
| 2087 | |||
| 2088 | static struct omap_hwmod_dma_info omap2420_mcbsp2_sdma_chs[] = { | ||
| 2089 | { .name = "rx", .dma_req = 34 }, | ||
| 2090 | { .name = "tx", .dma_req = 33 }, | ||
| 2091 | }; | ||
| 2092 | |||
| 2093 | static struct omap_hwmod_addr_space omap2420_mcbsp2_addrs[] = { | ||
| 2094 | { | ||
| 2095 | .name = "mpu", | ||
| 2096 | .pa_start = 0x48076000, | ||
| 2097 | .pa_end = 0x480760ff, | ||
| 2098 | .flags = ADDR_TYPE_RT | ||
| 2099 | }, | ||
| 2100 | }; | ||
| 2101 | |||
| 2102 | /* l4_core -> mcbsp2 */ | ||
| 2103 | static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = { | ||
| 2104 | .master = &omap2420_l4_core_hwmod, | ||
| 2105 | .slave = &omap2420_mcbsp2_hwmod, | ||
| 2106 | .clk = "mcbsp2_ick", | ||
| 2107 | .addr = omap2420_mcbsp2_addrs, | ||
| 2108 | .addr_cnt = ARRAY_SIZE(omap2420_mcbsp2_addrs), | ||
| 2109 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2110 | }; | ||
| 2111 | |||
| 2112 | /* mcbsp2 slave ports */ | ||
| 2113 | static struct omap_hwmod_ocp_if *omap2420_mcbsp2_slaves[] = { | ||
| 2114 | &omap2420_l4_core__mcbsp2, | ||
| 2115 | }; | ||
| 2116 | |||
| 2117 | static struct omap_hwmod omap2420_mcbsp2_hwmod = { | ||
| 2118 | .name = "mcbsp2", | ||
| 2119 | .class = &omap2420_mcbsp_hwmod_class, | ||
| 2120 | .mpu_irqs = omap2420_mcbsp2_irqs, | ||
| 2121 | .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_irqs), | ||
| 2122 | .sdma_reqs = omap2420_mcbsp2_sdma_chs, | ||
| 2123 | .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_sdma_chs), | ||
| 2124 | .main_clk = "mcbsp2_fck", | ||
| 2125 | .prcm = { | ||
| 2126 | .omap2 = { | ||
| 2127 | .prcm_reg_id = 1, | ||
| 2128 | .module_bit = OMAP24XX_EN_MCBSP2_SHIFT, | ||
| 2129 | .module_offs = CORE_MOD, | ||
| 2130 | .idlest_reg_id = 1, | ||
| 2131 | .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT, | ||
| 2132 | }, | ||
| 2133 | }, | ||
| 2134 | .slaves = omap2420_mcbsp2_slaves, | ||
| 2135 | .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves), | ||
| 2136 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
| 2137 | }; | ||
| 2138 | |||
| 1323 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { | 2139 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { |
| 1324 | &omap2420_l3_main_hwmod, | 2140 | &omap2420_l3_main_hwmod, |
| 1325 | &omap2420_l4_core_hwmod, | 2141 | &omap2420_l4_core_hwmod, |
| 1326 | &omap2420_l4_wkup_hwmod, | 2142 | &omap2420_l4_wkup_hwmod, |
| 1327 | &omap2420_mpu_hwmod, | 2143 | &omap2420_mpu_hwmod, |
| 1328 | &omap2420_iva_hwmod, | 2144 | &omap2420_iva_hwmod, |
| 2145 | |||
| 2146 | &omap2420_timer1_hwmod, | ||
| 2147 | &omap2420_timer2_hwmod, | ||
| 2148 | &omap2420_timer3_hwmod, | ||
| 2149 | &omap2420_timer4_hwmod, | ||
| 2150 | &omap2420_timer5_hwmod, | ||
| 2151 | &omap2420_timer6_hwmod, | ||
| 2152 | &omap2420_timer7_hwmod, | ||
| 2153 | &omap2420_timer8_hwmod, | ||
| 2154 | &omap2420_timer9_hwmod, | ||
| 2155 | &omap2420_timer10_hwmod, | ||
| 2156 | &omap2420_timer11_hwmod, | ||
| 2157 | &omap2420_timer12_hwmod, | ||
| 2158 | |||
| 1329 | &omap2420_wd_timer2_hwmod, | 2159 | &omap2420_wd_timer2_hwmod, |
| 1330 | &omap2420_uart1_hwmod, | 2160 | &omap2420_uart1_hwmod, |
| 1331 | &omap2420_uart2_hwmod, | 2161 | &omap2420_uart2_hwmod, |
| @@ -1348,6 +2178,13 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = { | |||
| 1348 | /* dma_system class*/ | 2178 | /* dma_system class*/ |
| 1349 | &omap2420_dma_system_hwmod, | 2179 | &omap2420_dma_system_hwmod, |
| 1350 | 2180 | ||
| 2181 | /* mailbox class */ | ||
| 2182 | &omap2420_mailbox_hwmod, | ||
| 2183 | |||
| 2184 | /* mcbsp class */ | ||
| 2185 | &omap2420_mcbsp1_hwmod, | ||
| 2186 | &omap2420_mcbsp2_hwmod, | ||
| 2187 | |||
| 1351 | /* mcspi class */ | 2188 | /* mcspi class */ |
| 1352 | &omap2420_mcspi1_hwmod, | 2189 | &omap2420_mcspi1_hwmod, |
| 1353 | &omap2420_mcspi2_hwmod, | 2190 | &omap2420_mcspi2_hwmod, |
| @@ -1356,5 +2193,5 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = { | |||
| 1356 | 2193 | ||
| 1357 | int __init omap2420_hwmod_init(void) | 2194 | int __init omap2420_hwmod_init(void) |
| 1358 | { | 2195 | { |
| 1359 | return omap_hwmod_init(omap2420_hwmods); | 2196 | return omap_hwmod_register(omap2420_hwmods); |
| 1360 | } | 2197 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index de0015d38433..490789a6bed0 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
| @@ -18,7 +18,10 @@ | |||
| 18 | #include <plat/serial.h> | 18 | #include <plat/serial.h> |
| 19 | #include <plat/i2c.h> | 19 | #include <plat/i2c.h> |
| 20 | #include <plat/gpio.h> | 20 | #include <plat/gpio.h> |
| 21 | #include <plat/mcbsp.h> | ||
| 21 | #include <plat/mcspi.h> | 22 | #include <plat/mcspi.h> |
| 23 | #include <plat/dmtimer.h> | ||
| 24 | #include <plat/mmc.h> | ||
| 22 | #include <plat/l3_2xxx.h> | 25 | #include <plat/l3_2xxx.h> |
| 23 | 26 | ||
| 24 | #include "omap_hwmod_common_data.h" | 27 | #include "omap_hwmod_common_data.h" |
| @@ -51,9 +54,16 @@ static struct omap_hwmod omap2430_gpio3_hwmod; | |||
| 51 | static struct omap_hwmod omap2430_gpio4_hwmod; | 54 | static struct omap_hwmod omap2430_gpio4_hwmod; |
| 52 | static struct omap_hwmod omap2430_gpio5_hwmod; | 55 | static struct omap_hwmod omap2430_gpio5_hwmod; |
| 53 | static struct omap_hwmod omap2430_dma_system_hwmod; | 56 | static struct omap_hwmod omap2430_dma_system_hwmod; |
| 57 | static struct omap_hwmod omap2430_mcbsp1_hwmod; | ||
| 58 | static struct omap_hwmod omap2430_mcbsp2_hwmod; | ||
| 59 | static struct omap_hwmod omap2430_mcbsp3_hwmod; | ||
| 60 | static struct omap_hwmod omap2430_mcbsp4_hwmod; | ||
| 61 | static struct omap_hwmod omap2430_mcbsp5_hwmod; | ||
| 54 | static struct omap_hwmod omap2430_mcspi1_hwmod; | 62 | static struct omap_hwmod omap2430_mcspi1_hwmod; |
| 55 | static struct omap_hwmod omap2430_mcspi2_hwmod; | 63 | static struct omap_hwmod omap2430_mcspi2_hwmod; |
| 56 | static struct omap_hwmod omap2430_mcspi3_hwmod; | 64 | static struct omap_hwmod omap2430_mcspi3_hwmod; |
| 65 | static struct omap_hwmod omap2430_mmc1_hwmod; | ||
| 66 | static struct omap_hwmod omap2430_mmc2_hwmod; | ||
| 57 | 67 | ||
| 58 | /* L3 -> L4_CORE interface */ | 68 | /* L3 -> L4_CORE interface */ |
| 59 | static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { | 69 | static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { |
| @@ -250,6 +260,42 @@ static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = { | |||
| 250 | &omap2430_l4_core__usbhsotg, | 260 | &omap2430_l4_core__usbhsotg, |
| 251 | }; | 261 | }; |
| 252 | 262 | ||
| 263 | /* L4 CORE -> MMC1 interface */ | ||
| 264 | static struct omap_hwmod_addr_space omap2430_mmc1_addr_space[] = { | ||
| 265 | { | ||
| 266 | .pa_start = 0x4809c000, | ||
| 267 | .pa_end = 0x4809c1ff, | ||
| 268 | .flags = ADDR_TYPE_RT, | ||
| 269 | }, | ||
| 270 | }; | ||
| 271 | |||
| 272 | static struct omap_hwmod_ocp_if omap2430_l4_core__mmc1 = { | ||
| 273 | .master = &omap2430_l4_core_hwmod, | ||
| 274 | .slave = &omap2430_mmc1_hwmod, | ||
| 275 | .clk = "mmchs1_ick", | ||
| 276 | .addr = omap2430_mmc1_addr_space, | ||
| 277 | .addr_cnt = ARRAY_SIZE(omap2430_mmc1_addr_space), | ||
| 278 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 279 | }; | ||
| 280 | |||
| 281 | /* L4 CORE -> MMC2 interface */ | ||
| 282 | static struct omap_hwmod_addr_space omap2430_mmc2_addr_space[] = { | ||
| 283 | { | ||
| 284 | .pa_start = 0x480b4000, | ||
| 285 | .pa_end = 0x480b41ff, | ||
| 286 | .flags = ADDR_TYPE_RT, | ||
| 287 | }, | ||
| 288 | }; | ||
| 289 | |||
| 290 | static struct omap_hwmod_ocp_if omap2430_l4_core__mmc2 = { | ||
| 291 | .master = &omap2430_l4_core_hwmod, | ||
| 292 | .slave = &omap2430_mmc2_hwmod, | ||
| 293 | .addr = omap2430_mmc2_addr_space, | ||
| 294 | .clk = "mmchs2_ick", | ||
| 295 | .addr_cnt = ARRAY_SIZE(omap2430_mmc2_addr_space), | ||
| 296 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 297 | }; | ||
| 298 | |||
| 253 | /* Slave interfaces on the L4_CORE interconnect */ | 299 | /* Slave interfaces on the L4_CORE interconnect */ |
| 254 | static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { | 300 | static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { |
| 255 | &omap2430_l3_main__l4_core, | 301 | &omap2430_l3_main__l4_core, |
| @@ -258,6 +304,8 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { | |||
| 258 | /* Master interfaces on the L4_CORE interconnect */ | 304 | /* Master interfaces on the L4_CORE interconnect */ |
| 259 | static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { | 305 | static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { |
| 260 | &omap2430_l4_core__l4_wkup, | 306 | &omap2430_l4_core__l4_wkup, |
| 307 | &omap2430_l4_core__mmc1, | ||
| 308 | &omap2430_l4_core__mmc2, | ||
| 261 | }; | 309 | }; |
| 262 | 310 | ||
| 263 | /* L4 CORE */ | 311 | /* L4 CORE */ |
| @@ -393,6 +441,624 @@ static struct omap_hwmod omap2430_iva_hwmod = { | |||
| 393 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | 441 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) |
| 394 | }; | 442 | }; |
| 395 | 443 | ||
| 444 | /* Timer Common */ | ||
| 445 | static struct omap_hwmod_class_sysconfig omap2430_timer_sysc = { | ||
| 446 | .rev_offs = 0x0000, | ||
| 447 | .sysc_offs = 0x0010, | ||
| 448 | .syss_offs = 0x0014, | ||
| 449 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
| 450 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
| 451 | SYSC_HAS_AUTOIDLE), | ||
| 452 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 453 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 454 | }; | ||
| 455 | |||
| 456 | static struct omap_hwmod_class omap2430_timer_hwmod_class = { | ||
| 457 | .name = "timer", | ||
| 458 | .sysc = &omap2430_timer_sysc, | ||
| 459 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
| 460 | }; | ||
| 461 | |||
| 462 | /* timer1 */ | ||
| 463 | static struct omap_hwmod omap2430_timer1_hwmod; | ||
| 464 | static struct omap_hwmod_irq_info omap2430_timer1_mpu_irqs[] = { | ||
| 465 | { .irq = 37, }, | ||
| 466 | }; | ||
| 467 | |||
| 468 | static struct omap_hwmod_addr_space omap2430_timer1_addrs[] = { | ||
| 469 | { | ||
| 470 | .pa_start = 0x49018000, | ||
| 471 | .pa_end = 0x49018000 + SZ_1K - 1, | ||
| 472 | .flags = ADDR_TYPE_RT | ||
| 473 | }, | ||
| 474 | }; | ||
| 475 | |||
| 476 | /* l4_wkup -> timer1 */ | ||
| 477 | static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = { | ||
| 478 | .master = &omap2430_l4_wkup_hwmod, | ||
| 479 | .slave = &omap2430_timer1_hwmod, | ||
| 480 | .clk = "gpt1_ick", | ||
| 481 | .addr = omap2430_timer1_addrs, | ||
| 482 | .addr_cnt = ARRAY_SIZE(omap2430_timer1_addrs), | ||
| 483 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 484 | }; | ||
| 485 | |||
| 486 | /* timer1 slave port */ | ||
| 487 | static struct omap_hwmod_ocp_if *omap2430_timer1_slaves[] = { | ||
| 488 | &omap2430_l4_wkup__timer1, | ||
| 489 | }; | ||
| 490 | |||
| 491 | /* timer1 hwmod */ | ||
| 492 | static struct omap_hwmod omap2430_timer1_hwmod = { | ||
| 493 | .name = "timer1", | ||
| 494 | .mpu_irqs = omap2430_timer1_mpu_irqs, | ||
| 495 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer1_mpu_irqs), | ||
| 496 | .main_clk = "gpt1_fck", | ||
| 497 | .prcm = { | ||
| 498 | .omap2 = { | ||
| 499 | .prcm_reg_id = 1, | ||
| 500 | .module_bit = OMAP24XX_EN_GPT1_SHIFT, | ||
| 501 | .module_offs = WKUP_MOD, | ||
| 502 | .idlest_reg_id = 1, | ||
| 503 | .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, | ||
| 504 | }, | ||
| 505 | }, | ||
| 506 | .slaves = omap2430_timer1_slaves, | ||
| 507 | .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves), | ||
| 508 | .class = &omap2430_timer_hwmod_class, | ||
| 509 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 510 | }; | ||
| 511 | |||
| 512 | /* timer2 */ | ||
| 513 | static struct omap_hwmod omap2430_timer2_hwmod; | ||
| 514 | static struct omap_hwmod_irq_info omap2430_timer2_mpu_irqs[] = { | ||
| 515 | { .irq = 38, }, | ||
| 516 | }; | ||
| 517 | |||
| 518 | static struct omap_hwmod_addr_space omap2430_timer2_addrs[] = { | ||
| 519 | { | ||
| 520 | .pa_start = 0x4802a000, | ||
| 521 | .pa_end = 0x4802a000 + SZ_1K - 1, | ||
| 522 | .flags = ADDR_TYPE_RT | ||
| 523 | }, | ||
| 524 | }; | ||
| 525 | |||
| 526 | /* l4_core -> timer2 */ | ||
| 527 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer2 = { | ||
| 528 | .master = &omap2430_l4_core_hwmod, | ||
| 529 | .slave = &omap2430_timer2_hwmod, | ||
| 530 | .clk = "gpt2_ick", | ||
| 531 | .addr = omap2430_timer2_addrs, | ||
| 532 | .addr_cnt = ARRAY_SIZE(omap2430_timer2_addrs), | ||
| 533 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 534 | }; | ||
| 535 | |||
| 536 | /* timer2 slave port */ | ||
| 537 | static struct omap_hwmod_ocp_if *omap2430_timer2_slaves[] = { | ||
| 538 | &omap2430_l4_core__timer2, | ||
| 539 | }; | ||
| 540 | |||
| 541 | /* timer2 hwmod */ | ||
| 542 | static struct omap_hwmod omap2430_timer2_hwmod = { | ||
| 543 | .name = "timer2", | ||
| 544 | .mpu_irqs = omap2430_timer2_mpu_irqs, | ||
| 545 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer2_mpu_irqs), | ||
| 546 | .main_clk = "gpt2_fck", | ||
| 547 | .prcm = { | ||
| 548 | .omap2 = { | ||
| 549 | .prcm_reg_id = 1, | ||
| 550 | .module_bit = OMAP24XX_EN_GPT2_SHIFT, | ||
| 551 | .module_offs = CORE_MOD, | ||
| 552 | .idlest_reg_id = 1, | ||
| 553 | .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT, | ||
| 554 | }, | ||
| 555 | }, | ||
| 556 | .slaves = omap2430_timer2_slaves, | ||
| 557 | .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves), | ||
| 558 | .class = &omap2430_timer_hwmod_class, | ||
| 559 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 560 | }; | ||
| 561 | |||
| 562 | /* timer3 */ | ||
| 563 | static struct omap_hwmod omap2430_timer3_hwmod; | ||
| 564 | static struct omap_hwmod_irq_info omap2430_timer3_mpu_irqs[] = { | ||
| 565 | { .irq = 39, }, | ||
| 566 | }; | ||
| 567 | |||
| 568 | static struct omap_hwmod_addr_space omap2430_timer3_addrs[] = { | ||
| 569 | { | ||
| 570 | .pa_start = 0x48078000, | ||
| 571 | .pa_end = 0x48078000 + SZ_1K - 1, | ||
| 572 | .flags = ADDR_TYPE_RT | ||
| 573 | }, | ||
| 574 | }; | ||
| 575 | |||
| 576 | /* l4_core -> timer3 */ | ||
| 577 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer3 = { | ||
| 578 | .master = &omap2430_l4_core_hwmod, | ||
| 579 | .slave = &omap2430_timer3_hwmod, | ||
| 580 | .clk = "gpt3_ick", | ||
| 581 | .addr = omap2430_timer3_addrs, | ||
| 582 | .addr_cnt = ARRAY_SIZE(omap2430_timer3_addrs), | ||
| 583 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 584 | }; | ||
| 585 | |||
| 586 | /* timer3 slave port */ | ||
| 587 | static struct omap_hwmod_ocp_if *omap2430_timer3_slaves[] = { | ||
| 588 | &omap2430_l4_core__timer3, | ||
| 589 | }; | ||
| 590 | |||
| 591 | /* timer3 hwmod */ | ||
| 592 | static struct omap_hwmod omap2430_timer3_hwmod = { | ||
| 593 | .name = "timer3", | ||
| 594 | .mpu_irqs = omap2430_timer3_mpu_irqs, | ||
| 595 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer3_mpu_irqs), | ||
| 596 | .main_clk = "gpt3_fck", | ||
| 597 | .prcm = { | ||
| 598 | .omap2 = { | ||
| 599 | .prcm_reg_id = 1, | ||
| 600 | .module_bit = OMAP24XX_EN_GPT3_SHIFT, | ||
| 601 | .module_offs = CORE_MOD, | ||
| 602 | .idlest_reg_id = 1, | ||
| 603 | .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT, | ||
| 604 | }, | ||
| 605 | }, | ||
| 606 | .slaves = omap2430_timer3_slaves, | ||
| 607 | .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves), | ||
| 608 | .class = &omap2430_timer_hwmod_class, | ||
| 609 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 610 | }; | ||
| 611 | |||
| 612 | /* timer4 */ | ||
| 613 | static struct omap_hwmod omap2430_timer4_hwmod; | ||
| 614 | static struct omap_hwmod_irq_info omap2430_timer4_mpu_irqs[] = { | ||
| 615 | { .irq = 40, }, | ||
| 616 | }; | ||
| 617 | |||
| 618 | static struct omap_hwmod_addr_space omap2430_timer4_addrs[] = { | ||
| 619 | { | ||
| 620 | .pa_start = 0x4807a000, | ||
| 621 | .pa_end = 0x4807a000 + SZ_1K - 1, | ||
| 622 | .flags = ADDR_TYPE_RT | ||
| 623 | }, | ||
| 624 | }; | ||
| 625 | |||
| 626 | /* l4_core -> timer4 */ | ||
| 627 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer4 = { | ||
| 628 | .master = &omap2430_l4_core_hwmod, | ||
| 629 | .slave = &omap2430_timer4_hwmod, | ||
| 630 | .clk = "gpt4_ick", | ||
| 631 | .addr = omap2430_timer4_addrs, | ||
| 632 | .addr_cnt = ARRAY_SIZE(omap2430_timer4_addrs), | ||
| 633 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 634 | }; | ||
| 635 | |||
| 636 | /* timer4 slave port */ | ||
| 637 | static struct omap_hwmod_ocp_if *omap2430_timer4_slaves[] = { | ||
| 638 | &omap2430_l4_core__timer4, | ||
| 639 | }; | ||
| 640 | |||
| 641 | /* timer4 hwmod */ | ||
| 642 | static struct omap_hwmod omap2430_timer4_hwmod = { | ||
| 643 | .name = "timer4", | ||
| 644 | .mpu_irqs = omap2430_timer4_mpu_irqs, | ||
| 645 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer4_mpu_irqs), | ||
| 646 | .main_clk = "gpt4_fck", | ||
| 647 | .prcm = { | ||
| 648 | .omap2 = { | ||
| 649 | .prcm_reg_id = 1, | ||
| 650 | .module_bit = OMAP24XX_EN_GPT4_SHIFT, | ||
| 651 | .module_offs = CORE_MOD, | ||
| 652 | .idlest_reg_id = 1, | ||
| 653 | .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT, | ||
| 654 | }, | ||
| 655 | }, | ||
| 656 | .slaves = omap2430_timer4_slaves, | ||
| 657 | .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves), | ||
| 658 | .class = &omap2430_timer_hwmod_class, | ||
| 659 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 660 | }; | ||
| 661 | |||
| 662 | /* timer5 */ | ||
| 663 | static struct omap_hwmod omap2430_timer5_hwmod; | ||
| 664 | static struct omap_hwmod_irq_info omap2430_timer5_mpu_irqs[] = { | ||
| 665 | { .irq = 41, }, | ||
| 666 | }; | ||
| 667 | |||
| 668 | static struct omap_hwmod_addr_space omap2430_timer5_addrs[] = { | ||
| 669 | { | ||
| 670 | .pa_start = 0x4807c000, | ||
| 671 | .pa_end = 0x4807c000 + SZ_1K - 1, | ||
| 672 | .flags = ADDR_TYPE_RT | ||
| 673 | }, | ||
| 674 | }; | ||
| 675 | |||
| 676 | /* l4_core -> timer5 */ | ||
| 677 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer5 = { | ||
| 678 | .master = &omap2430_l4_core_hwmod, | ||
| 679 | .slave = &omap2430_timer5_hwmod, | ||
| 680 | .clk = "gpt5_ick", | ||
| 681 | .addr = omap2430_timer5_addrs, | ||
| 682 | .addr_cnt = ARRAY_SIZE(omap2430_timer5_addrs), | ||
| 683 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 684 | }; | ||
| 685 | |||
| 686 | /* timer5 slave port */ | ||
| 687 | static struct omap_hwmod_ocp_if *omap2430_timer5_slaves[] = { | ||
| 688 | &omap2430_l4_core__timer5, | ||
| 689 | }; | ||
| 690 | |||
| 691 | /* timer5 hwmod */ | ||
| 692 | static struct omap_hwmod omap2430_timer5_hwmod = { | ||
| 693 | .name = "timer5", | ||
| 694 | .mpu_irqs = omap2430_timer5_mpu_irqs, | ||
| 695 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer5_mpu_irqs), | ||
| 696 | .main_clk = "gpt5_fck", | ||
| 697 | .prcm = { | ||
| 698 | .omap2 = { | ||
| 699 | .prcm_reg_id = 1, | ||
| 700 | .module_bit = OMAP24XX_EN_GPT5_SHIFT, | ||
| 701 | .module_offs = CORE_MOD, | ||
| 702 | .idlest_reg_id = 1, | ||
| 703 | .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, | ||
| 704 | }, | ||
| 705 | }, | ||
| 706 | .slaves = omap2430_timer5_slaves, | ||
| 707 | .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves), | ||
| 708 | .class = &omap2430_timer_hwmod_class, | ||
| 709 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 710 | }; | ||
| 711 | |||
| 712 | /* timer6 */ | ||
| 713 | static struct omap_hwmod omap2430_timer6_hwmod; | ||
| 714 | static struct omap_hwmod_irq_info omap2430_timer6_mpu_irqs[] = { | ||
| 715 | { .irq = 42, }, | ||
| 716 | }; | ||
| 717 | |||
| 718 | static struct omap_hwmod_addr_space omap2430_timer6_addrs[] = { | ||
| 719 | { | ||
| 720 | .pa_start = 0x4807e000, | ||
| 721 | .pa_end = 0x4807e000 + SZ_1K - 1, | ||
| 722 | .flags = ADDR_TYPE_RT | ||
| 723 | }, | ||
| 724 | }; | ||
| 725 | |||
| 726 | /* l4_core -> timer6 */ | ||
| 727 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer6 = { | ||
| 728 | .master = &omap2430_l4_core_hwmod, | ||
| 729 | .slave = &omap2430_timer6_hwmod, | ||
| 730 | .clk = "gpt6_ick", | ||
| 731 | .addr = omap2430_timer6_addrs, | ||
| 732 | .addr_cnt = ARRAY_SIZE(omap2430_timer6_addrs), | ||
| 733 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 734 | }; | ||
| 735 | |||
| 736 | /* timer6 slave port */ | ||
| 737 | static struct omap_hwmod_ocp_if *omap2430_timer6_slaves[] = { | ||
| 738 | &omap2430_l4_core__timer6, | ||
| 739 | }; | ||
| 740 | |||
| 741 | /* timer6 hwmod */ | ||
| 742 | static struct omap_hwmod omap2430_timer6_hwmod = { | ||
| 743 | .name = "timer6", | ||
| 744 | .mpu_irqs = omap2430_timer6_mpu_irqs, | ||
| 745 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer6_mpu_irqs), | ||
| 746 | .main_clk = "gpt6_fck", | ||
| 747 | .prcm = { | ||
| 748 | .omap2 = { | ||
| 749 | .prcm_reg_id = 1, | ||
| 750 | .module_bit = OMAP24XX_EN_GPT6_SHIFT, | ||
| 751 | .module_offs = CORE_MOD, | ||
| 752 | .idlest_reg_id = 1, | ||
| 753 | .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, | ||
| 754 | }, | ||
| 755 | }, | ||
| 756 | .slaves = omap2430_timer6_slaves, | ||
| 757 | .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves), | ||
| 758 | .class = &omap2430_timer_hwmod_class, | ||
| 759 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 760 | }; | ||
| 761 | |||
| 762 | /* timer7 */ | ||
| 763 | static struct omap_hwmod omap2430_timer7_hwmod; | ||
| 764 | static struct omap_hwmod_irq_info omap2430_timer7_mpu_irqs[] = { | ||
| 765 | { .irq = 43, }, | ||
| 766 | }; | ||
| 767 | |||
| 768 | static struct omap_hwmod_addr_space omap2430_timer7_addrs[] = { | ||
| 769 | { | ||
| 770 | .pa_start = 0x48080000, | ||
| 771 | .pa_end = 0x48080000 + SZ_1K - 1, | ||
| 772 | .flags = ADDR_TYPE_RT | ||
| 773 | }, | ||
| 774 | }; | ||
| 775 | |||
| 776 | /* l4_core -> timer7 */ | ||
| 777 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer7 = { | ||
| 778 | .master = &omap2430_l4_core_hwmod, | ||
| 779 | .slave = &omap2430_timer7_hwmod, | ||
| 780 | .clk = "gpt7_ick", | ||
| 781 | .addr = omap2430_timer7_addrs, | ||
| 782 | .addr_cnt = ARRAY_SIZE(omap2430_timer7_addrs), | ||
| 783 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 784 | }; | ||
| 785 | |||
| 786 | /* timer7 slave port */ | ||
| 787 | static struct omap_hwmod_ocp_if *omap2430_timer7_slaves[] = { | ||
| 788 | &omap2430_l4_core__timer7, | ||
| 789 | }; | ||
| 790 | |||
| 791 | /* timer7 hwmod */ | ||
| 792 | static struct omap_hwmod omap2430_timer7_hwmod = { | ||
| 793 | .name = "timer7", | ||
| 794 | .mpu_irqs = omap2430_timer7_mpu_irqs, | ||
| 795 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer7_mpu_irqs), | ||
| 796 | .main_clk = "gpt7_fck", | ||
| 797 | .prcm = { | ||
| 798 | .omap2 = { | ||
| 799 | .prcm_reg_id = 1, | ||
| 800 | .module_bit = OMAP24XX_EN_GPT7_SHIFT, | ||
| 801 | .module_offs = CORE_MOD, | ||
| 802 | .idlest_reg_id = 1, | ||
| 803 | .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, | ||
| 804 | }, | ||
| 805 | }, | ||
| 806 | .slaves = omap2430_timer7_slaves, | ||
| 807 | .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves), | ||
| 808 | .class = &omap2430_timer_hwmod_class, | ||
| 809 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 810 | }; | ||
| 811 | |||
| 812 | /* timer8 */ | ||
| 813 | static struct omap_hwmod omap2430_timer8_hwmod; | ||
| 814 | static struct omap_hwmod_irq_info omap2430_timer8_mpu_irqs[] = { | ||
| 815 | { .irq = 44, }, | ||
| 816 | }; | ||
| 817 | |||
| 818 | static struct omap_hwmod_addr_space omap2430_timer8_addrs[] = { | ||
| 819 | { | ||
| 820 | .pa_start = 0x48082000, | ||
| 821 | .pa_end = 0x48082000 + SZ_1K - 1, | ||
| 822 | .flags = ADDR_TYPE_RT | ||
| 823 | }, | ||
| 824 | }; | ||
| 825 | |||
| 826 | /* l4_core -> timer8 */ | ||
| 827 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer8 = { | ||
| 828 | .master = &omap2430_l4_core_hwmod, | ||
| 829 | .slave = &omap2430_timer8_hwmod, | ||
| 830 | .clk = "gpt8_ick", | ||
| 831 | .addr = omap2430_timer8_addrs, | ||
| 832 | .addr_cnt = ARRAY_SIZE(omap2430_timer8_addrs), | ||
| 833 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 834 | }; | ||
| 835 | |||
| 836 | /* timer8 slave port */ | ||
| 837 | static struct omap_hwmod_ocp_if *omap2430_timer8_slaves[] = { | ||
| 838 | &omap2430_l4_core__timer8, | ||
| 839 | }; | ||
| 840 | |||
| 841 | /* timer8 hwmod */ | ||
| 842 | static struct omap_hwmod omap2430_timer8_hwmod = { | ||
| 843 | .name = "timer8", | ||
| 844 | .mpu_irqs = omap2430_timer8_mpu_irqs, | ||
| 845 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer8_mpu_irqs), | ||
| 846 | .main_clk = "gpt8_fck", | ||
| 847 | .prcm = { | ||
| 848 | .omap2 = { | ||
| 849 | .prcm_reg_id = 1, | ||
| 850 | .module_bit = OMAP24XX_EN_GPT8_SHIFT, | ||
| 851 | .module_offs = CORE_MOD, | ||
| 852 | .idlest_reg_id = 1, | ||
| 853 | .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, | ||
| 854 | }, | ||
| 855 | }, | ||
| 856 | .slaves = omap2430_timer8_slaves, | ||
| 857 | .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves), | ||
| 858 | .class = &omap2430_timer_hwmod_class, | ||
| 859 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 860 | }; | ||
| 861 | |||
| 862 | /* timer9 */ | ||
| 863 | static struct omap_hwmod omap2430_timer9_hwmod; | ||
| 864 | static struct omap_hwmod_irq_info omap2430_timer9_mpu_irqs[] = { | ||
| 865 | { .irq = 45, }, | ||
| 866 | }; | ||
| 867 | |||
| 868 | static struct omap_hwmod_addr_space omap2430_timer9_addrs[] = { | ||
| 869 | { | ||
| 870 | .pa_start = 0x48084000, | ||
| 871 | .pa_end = 0x48084000 + SZ_1K - 1, | ||
| 872 | .flags = ADDR_TYPE_RT | ||
| 873 | }, | ||
| 874 | }; | ||
| 875 | |||
| 876 | /* l4_core -> timer9 */ | ||
| 877 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer9 = { | ||
| 878 | .master = &omap2430_l4_core_hwmod, | ||
| 879 | .slave = &omap2430_timer9_hwmod, | ||
| 880 | .clk = "gpt9_ick", | ||
| 881 | .addr = omap2430_timer9_addrs, | ||
| 882 | .addr_cnt = ARRAY_SIZE(omap2430_timer9_addrs), | ||
| 883 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 884 | }; | ||
| 885 | |||
| 886 | /* timer9 slave port */ | ||
| 887 | static struct omap_hwmod_ocp_if *omap2430_timer9_slaves[] = { | ||
| 888 | &omap2430_l4_core__timer9, | ||
| 889 | }; | ||
| 890 | |||
| 891 | /* timer9 hwmod */ | ||
| 892 | static struct omap_hwmod omap2430_timer9_hwmod = { | ||
| 893 | .name = "timer9", | ||
| 894 | .mpu_irqs = omap2430_timer9_mpu_irqs, | ||
| 895 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer9_mpu_irqs), | ||
| 896 | .main_clk = "gpt9_fck", | ||
| 897 | .prcm = { | ||
| 898 | .omap2 = { | ||
| 899 | .prcm_reg_id = 1, | ||
| 900 | .module_bit = OMAP24XX_EN_GPT9_SHIFT, | ||
| 901 | .module_offs = CORE_MOD, | ||
| 902 | .idlest_reg_id = 1, | ||
| 903 | .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT, | ||
| 904 | }, | ||
| 905 | }, | ||
| 906 | .slaves = omap2430_timer9_slaves, | ||
| 907 | .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves), | ||
| 908 | .class = &omap2430_timer_hwmod_class, | ||
| 909 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 910 | }; | ||
| 911 | |||
| 912 | /* timer10 */ | ||
| 913 | static struct omap_hwmod omap2430_timer10_hwmod; | ||
| 914 | static struct omap_hwmod_irq_info omap2430_timer10_mpu_irqs[] = { | ||
| 915 | { .irq = 46, }, | ||
| 916 | }; | ||
| 917 | |||
| 918 | static struct omap_hwmod_addr_space omap2430_timer10_addrs[] = { | ||
| 919 | { | ||
| 920 | .pa_start = 0x48086000, | ||
| 921 | .pa_end = 0x48086000 + SZ_1K - 1, | ||
| 922 | .flags = ADDR_TYPE_RT | ||
| 923 | }, | ||
| 924 | }; | ||
| 925 | |||
| 926 | /* l4_core -> timer10 */ | ||
| 927 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer10 = { | ||
| 928 | .master = &omap2430_l4_core_hwmod, | ||
| 929 | .slave = &omap2430_timer10_hwmod, | ||
| 930 | .clk = "gpt10_ick", | ||
| 931 | .addr = omap2430_timer10_addrs, | ||
| 932 | .addr_cnt = ARRAY_SIZE(omap2430_timer10_addrs), | ||
| 933 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 934 | }; | ||
| 935 | |||
| 936 | /* timer10 slave port */ | ||
| 937 | static struct omap_hwmod_ocp_if *omap2430_timer10_slaves[] = { | ||
| 938 | &omap2430_l4_core__timer10, | ||
| 939 | }; | ||
| 940 | |||
| 941 | /* timer10 hwmod */ | ||
| 942 | static struct omap_hwmod omap2430_timer10_hwmod = { | ||
| 943 | .name = "timer10", | ||
| 944 | .mpu_irqs = omap2430_timer10_mpu_irqs, | ||
| 945 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer10_mpu_irqs), | ||
| 946 | .main_clk = "gpt10_fck", | ||
| 947 | .prcm = { | ||
| 948 | .omap2 = { | ||
| 949 | .prcm_reg_id = 1, | ||
| 950 | .module_bit = OMAP24XX_EN_GPT10_SHIFT, | ||
| 951 | .module_offs = CORE_MOD, | ||
| 952 | .idlest_reg_id = 1, | ||
| 953 | .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, | ||
| 954 | }, | ||
| 955 | }, | ||
| 956 | .slaves = omap2430_timer10_slaves, | ||
| 957 | .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves), | ||
| 958 | .class = &omap2430_timer_hwmod_class, | ||
| 959 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 960 | }; | ||
| 961 | |||
| 962 | /* timer11 */ | ||
| 963 | static struct omap_hwmod omap2430_timer11_hwmod; | ||
| 964 | static struct omap_hwmod_irq_info omap2430_timer11_mpu_irqs[] = { | ||
| 965 | { .irq = 47, }, | ||
| 966 | }; | ||
| 967 | |||
| 968 | static struct omap_hwmod_addr_space omap2430_timer11_addrs[] = { | ||
| 969 | { | ||
| 970 | .pa_start = 0x48088000, | ||
| 971 | .pa_end = 0x48088000 + SZ_1K - 1, | ||
| 972 | .flags = ADDR_TYPE_RT | ||
| 973 | }, | ||
| 974 | }; | ||
| 975 | |||
| 976 | /* l4_core -> timer11 */ | ||
| 977 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer11 = { | ||
| 978 | .master = &omap2430_l4_core_hwmod, | ||
| 979 | .slave = &omap2430_timer11_hwmod, | ||
| 980 | .clk = "gpt11_ick", | ||
| 981 | .addr = omap2430_timer11_addrs, | ||
| 982 | .addr_cnt = ARRAY_SIZE(omap2430_timer11_addrs), | ||
| 983 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 984 | }; | ||
| 985 | |||
| 986 | /* timer11 slave port */ | ||
| 987 | static struct omap_hwmod_ocp_if *omap2430_timer11_slaves[] = { | ||
| 988 | &omap2430_l4_core__timer11, | ||
| 989 | }; | ||
| 990 | |||
| 991 | /* timer11 hwmod */ | ||
| 992 | static struct omap_hwmod omap2430_timer11_hwmod = { | ||
| 993 | .name = "timer11", | ||
| 994 | .mpu_irqs = omap2430_timer11_mpu_irqs, | ||
| 995 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer11_mpu_irqs), | ||
| 996 | .main_clk = "gpt11_fck", | ||
| 997 | .prcm = { | ||
| 998 | .omap2 = { | ||
| 999 | .prcm_reg_id = 1, | ||
| 1000 | .module_bit = OMAP24XX_EN_GPT11_SHIFT, | ||
| 1001 | .module_offs = CORE_MOD, | ||
| 1002 | .idlest_reg_id = 1, | ||
| 1003 | .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT, | ||
| 1004 | }, | ||
| 1005 | }, | ||
| 1006 | .slaves = omap2430_timer11_slaves, | ||
| 1007 | .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves), | ||
| 1008 | .class = &omap2430_timer_hwmod_class, | ||
| 1009 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 1010 | }; | ||
| 1011 | |||
| 1012 | /* timer12 */ | ||
| 1013 | static struct omap_hwmod omap2430_timer12_hwmod; | ||
| 1014 | static struct omap_hwmod_irq_info omap2430_timer12_mpu_irqs[] = { | ||
| 1015 | { .irq = 48, }, | ||
| 1016 | }; | ||
| 1017 | |||
| 1018 | static struct omap_hwmod_addr_space omap2430_timer12_addrs[] = { | ||
| 1019 | { | ||
| 1020 | .pa_start = 0x4808a000, | ||
| 1021 | .pa_end = 0x4808a000 + SZ_1K - 1, | ||
| 1022 | .flags = ADDR_TYPE_RT | ||
| 1023 | }, | ||
| 1024 | }; | ||
| 1025 | |||
| 1026 | /* l4_core -> timer12 */ | ||
| 1027 | static struct omap_hwmod_ocp_if omap2430_l4_core__timer12 = { | ||
| 1028 | .master = &omap2430_l4_core_hwmod, | ||
| 1029 | .slave = &omap2430_timer12_hwmod, | ||
| 1030 | .clk = "gpt12_ick", | ||
| 1031 | .addr = omap2430_timer12_addrs, | ||
| 1032 | .addr_cnt = ARRAY_SIZE(omap2430_timer12_addrs), | ||
| 1033 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 1034 | }; | ||
| 1035 | |||
| 1036 | /* timer12 slave port */ | ||
| 1037 | static struct omap_hwmod_ocp_if *omap2430_timer12_slaves[] = { | ||
| 1038 | &omap2430_l4_core__timer12, | ||
| 1039 | }; | ||
| 1040 | |||
| 1041 | /* timer12 hwmod */ | ||
| 1042 | static struct omap_hwmod omap2430_timer12_hwmod = { | ||
| 1043 | .name = "timer12", | ||
| 1044 | .mpu_irqs = omap2430_timer12_mpu_irqs, | ||
| 1045 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer12_mpu_irqs), | ||
| 1046 | .main_clk = "gpt12_fck", | ||
| 1047 | .prcm = { | ||
| 1048 | .omap2 = { | ||
| 1049 | .prcm_reg_id = 1, | ||
| 1050 | .module_bit = OMAP24XX_EN_GPT12_SHIFT, | ||
| 1051 | .module_offs = CORE_MOD, | ||
| 1052 | .idlest_reg_id = 1, | ||
| 1053 | .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, | ||
| 1054 | }, | ||
| 1055 | }, | ||
| 1056 | .slaves = omap2430_timer12_slaves, | ||
| 1057 | .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves), | ||
| 1058 | .class = &omap2430_timer_hwmod_class, | ||
| 1059 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
| 1060 | }; | ||
| 1061 | |||
| 396 | /* l4_wkup -> wd_timer2 */ | 1062 | /* l4_wkup -> wd_timer2 */ |
| 397 | static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { | 1063 | static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { |
| 398 | { | 1064 | { |
| @@ -819,6 +1485,7 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = { | |||
| 819 | .clk = "dss_54m_fck", | 1485 | .clk = "dss_54m_fck", |
| 820 | .addr = omap2430_dss_venc_addrs, | 1486 | .addr = omap2430_dss_venc_addrs, |
| 821 | .addr_cnt = ARRAY_SIZE(omap2430_dss_venc_addrs), | 1487 | .addr_cnt = ARRAY_SIZE(omap2430_dss_venc_addrs), |
| 1488 | .flags = OCPIF_SWSUP_IDLE, | ||
| 822 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 1489 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 823 | }; | 1490 | }; |
| 824 | 1491 | ||
| @@ -1295,6 +1962,75 @@ static struct omap_hwmod omap2430_dma_system_hwmod = { | |||
| 1295 | }; | 1962 | }; |
| 1296 | 1963 | ||
| 1297 | /* | 1964 | /* |
| 1965 | * 'mailbox' class | ||
| 1966 | * mailbox module allowing communication between the on-chip processors | ||
| 1967 | * using a queued mailbox-interrupt mechanism. | ||
| 1968 | */ | ||
| 1969 | |||
| 1970 | static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = { | ||
| 1971 | .rev_offs = 0x000, | ||
| 1972 | .sysc_offs = 0x010, | ||
| 1973 | .syss_offs = 0x014, | ||
| 1974 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
| 1975 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
| 1976 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 1977 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 1978 | }; | ||
| 1979 | |||
| 1980 | static struct omap_hwmod_class omap2430_mailbox_hwmod_class = { | ||
| 1981 | .name = "mailbox", | ||
| 1982 | .sysc = &omap2430_mailbox_sysc, | ||
| 1983 | }; | ||
| 1984 | |||
| 1985 | /* mailbox */ | ||
| 1986 | static struct omap_hwmod omap2430_mailbox_hwmod; | ||
| 1987 | static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { | ||
| 1988 | { .irq = 26 }, | ||
| 1989 | }; | ||
| 1990 | |||
| 1991 | static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = { | ||
| 1992 | { | ||
| 1993 | .pa_start = 0x48094000, | ||
| 1994 | .pa_end = 0x480941ff, | ||
| 1995 | .flags = ADDR_TYPE_RT, | ||
| 1996 | }, | ||
| 1997 | }; | ||
| 1998 | |||
| 1999 | /* l4_core -> mailbox */ | ||
| 2000 | static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = { | ||
| 2001 | .master = &omap2430_l4_core_hwmod, | ||
| 2002 | .slave = &omap2430_mailbox_hwmod, | ||
| 2003 | .addr = omap2430_mailbox_addrs, | ||
| 2004 | .addr_cnt = ARRAY_SIZE(omap2430_mailbox_addrs), | ||
| 2005 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2006 | }; | ||
| 2007 | |||
| 2008 | /* mailbox slave ports */ | ||
| 2009 | static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = { | ||
| 2010 | &omap2430_l4_core__mailbox, | ||
| 2011 | }; | ||
| 2012 | |||
| 2013 | static struct omap_hwmod omap2430_mailbox_hwmod = { | ||
| 2014 | .name = "mailbox", | ||
| 2015 | .class = &omap2430_mailbox_hwmod_class, | ||
| 2016 | .mpu_irqs = omap2430_mailbox_irqs, | ||
| 2017 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mailbox_irqs), | ||
| 2018 | .main_clk = "mailboxes_ick", | ||
| 2019 | .prcm = { | ||
| 2020 | .omap2 = { | ||
| 2021 | .prcm_reg_id = 1, | ||
| 2022 | .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT, | ||
| 2023 | .module_offs = CORE_MOD, | ||
| 2024 | .idlest_reg_id = 1, | ||
| 2025 | .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, | ||
| 2026 | }, | ||
| 2027 | }, | ||
| 2028 | .slaves = omap2430_mailbox_slaves, | ||
| 2029 | .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves), | ||
| 2030 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2031 | }; | ||
| 2032 | |||
| 2033 | /* | ||
| 1298 | * 'mcspi' class | 2034 | * 'mcspi' class |
| 1299 | * multichannel serial port interface (mcspi) / master/slave synchronous serial | 2035 | * multichannel serial port interface (mcspi) / master/slave synchronous serial |
| 1300 | * bus | 2036 | * bus |
| @@ -1506,7 +2242,425 @@ static struct omap_hwmod omap2430_usbhsotg_hwmod = { | |||
| 1506 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | 2242 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) |
| 1507 | }; | 2243 | }; |
| 1508 | 2244 | ||
| 2245 | /* | ||
| 2246 | * 'mcbsp' class | ||
| 2247 | * multi channel buffered serial port controller | ||
| 2248 | */ | ||
| 2249 | |||
| 2250 | static struct omap_hwmod_class_sysconfig omap2430_mcbsp_sysc = { | ||
| 2251 | .rev_offs = 0x007C, | ||
| 2252 | .sysc_offs = 0x008C, | ||
| 2253 | .sysc_flags = (SYSC_HAS_SOFTRESET), | ||
| 2254 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 2255 | }; | ||
| 1509 | 2256 | ||
| 2257 | static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = { | ||
| 2258 | .name = "mcbsp", | ||
| 2259 | .sysc = &omap2430_mcbsp_sysc, | ||
| 2260 | .rev = MCBSP_CONFIG_TYPE2, | ||
| 2261 | }; | ||
| 2262 | |||
| 2263 | /* mcbsp1 */ | ||
| 2264 | static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = { | ||
| 2265 | { .name = "tx", .irq = 59 }, | ||
| 2266 | { .name = "rx", .irq = 60 }, | ||
| 2267 | { .name = "ovr", .irq = 61 }, | ||
| 2268 | { .name = "common", .irq = 64 }, | ||
| 2269 | }; | ||
| 2270 | |||
| 2271 | static struct omap_hwmod_dma_info omap2430_mcbsp1_sdma_chs[] = { | ||
| 2272 | { .name = "rx", .dma_req = 32 }, | ||
| 2273 | { .name = "tx", .dma_req = 31 }, | ||
| 2274 | }; | ||
| 2275 | |||
| 2276 | static struct omap_hwmod_addr_space omap2430_mcbsp1_addrs[] = { | ||
| 2277 | { | ||
| 2278 | .name = "mpu", | ||
| 2279 | .pa_start = 0x48074000, | ||
| 2280 | .pa_end = 0x480740ff, | ||
| 2281 | .flags = ADDR_TYPE_RT | ||
| 2282 | }, | ||
| 2283 | }; | ||
| 2284 | |||
| 2285 | /* l4_core -> mcbsp1 */ | ||
| 2286 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = { | ||
| 2287 | .master = &omap2430_l4_core_hwmod, | ||
| 2288 | .slave = &omap2430_mcbsp1_hwmod, | ||
| 2289 | .clk = "mcbsp1_ick", | ||
| 2290 | .addr = omap2430_mcbsp1_addrs, | ||
| 2291 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp1_addrs), | ||
| 2292 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2293 | }; | ||
| 2294 | |||
| 2295 | /* mcbsp1 slave ports */ | ||
| 2296 | static struct omap_hwmod_ocp_if *omap2430_mcbsp1_slaves[] = { | ||
| 2297 | &omap2430_l4_core__mcbsp1, | ||
| 2298 | }; | ||
| 2299 | |||
| 2300 | static struct omap_hwmod omap2430_mcbsp1_hwmod = { | ||
| 2301 | .name = "mcbsp1", | ||
| 2302 | .class = &omap2430_mcbsp_hwmod_class, | ||
| 2303 | .mpu_irqs = omap2430_mcbsp1_irqs, | ||
| 2304 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_irqs), | ||
| 2305 | .sdma_reqs = omap2430_mcbsp1_sdma_chs, | ||
| 2306 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_sdma_chs), | ||
| 2307 | .main_clk = "mcbsp1_fck", | ||
| 2308 | .prcm = { | ||
| 2309 | .omap2 = { | ||
| 2310 | .prcm_reg_id = 1, | ||
| 2311 | .module_bit = OMAP24XX_EN_MCBSP1_SHIFT, | ||
| 2312 | .module_offs = CORE_MOD, | ||
| 2313 | .idlest_reg_id = 1, | ||
| 2314 | .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT, | ||
| 2315 | }, | ||
| 2316 | }, | ||
| 2317 | .slaves = omap2430_mcbsp1_slaves, | ||
| 2318 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves), | ||
| 2319 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2320 | }; | ||
| 2321 | |||
| 2322 | /* mcbsp2 */ | ||
| 2323 | static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { | ||
| 2324 | { .name = "tx", .irq = 62 }, | ||
| 2325 | { .name = "rx", .irq = 63 }, | ||
| 2326 | { .name = "common", .irq = 16 }, | ||
| 2327 | }; | ||
| 2328 | |||
| 2329 | static struct omap_hwmod_dma_info omap2430_mcbsp2_sdma_chs[] = { | ||
| 2330 | { .name = "rx", .dma_req = 34 }, | ||
| 2331 | { .name = "tx", .dma_req = 33 }, | ||
| 2332 | }; | ||
| 2333 | |||
| 2334 | static struct omap_hwmod_addr_space omap2430_mcbsp2_addrs[] = { | ||
| 2335 | { | ||
| 2336 | .name = "mpu", | ||
| 2337 | .pa_start = 0x48076000, | ||
| 2338 | .pa_end = 0x480760ff, | ||
| 2339 | .flags = ADDR_TYPE_RT | ||
| 2340 | }, | ||
| 2341 | }; | ||
| 2342 | |||
| 2343 | /* l4_core -> mcbsp2 */ | ||
| 2344 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = { | ||
| 2345 | .master = &omap2430_l4_core_hwmod, | ||
| 2346 | .slave = &omap2430_mcbsp2_hwmod, | ||
| 2347 | .clk = "mcbsp2_ick", | ||
| 2348 | .addr = omap2430_mcbsp2_addrs, | ||
| 2349 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp2_addrs), | ||
| 2350 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2351 | }; | ||
| 2352 | |||
| 2353 | /* mcbsp2 slave ports */ | ||
| 2354 | static struct omap_hwmod_ocp_if *omap2430_mcbsp2_slaves[] = { | ||
| 2355 | &omap2430_l4_core__mcbsp2, | ||
| 2356 | }; | ||
| 2357 | |||
| 2358 | static struct omap_hwmod omap2430_mcbsp2_hwmod = { | ||
| 2359 | .name = "mcbsp2", | ||
| 2360 | .class = &omap2430_mcbsp_hwmod_class, | ||
| 2361 | .mpu_irqs = omap2430_mcbsp2_irqs, | ||
| 2362 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_irqs), | ||
| 2363 | .sdma_reqs = omap2430_mcbsp2_sdma_chs, | ||
| 2364 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_sdma_chs), | ||
| 2365 | .main_clk = "mcbsp2_fck", | ||
| 2366 | .prcm = { | ||
| 2367 | .omap2 = { | ||
| 2368 | .prcm_reg_id = 1, | ||
| 2369 | .module_bit = OMAP24XX_EN_MCBSP2_SHIFT, | ||
| 2370 | .module_offs = CORE_MOD, | ||
| 2371 | .idlest_reg_id = 1, | ||
| 2372 | .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT, | ||
| 2373 | }, | ||
| 2374 | }, | ||
| 2375 | .slaves = omap2430_mcbsp2_slaves, | ||
| 2376 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves), | ||
| 2377 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2378 | }; | ||
| 2379 | |||
| 2380 | /* mcbsp3 */ | ||
| 2381 | static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = { | ||
| 2382 | { .name = "tx", .irq = 89 }, | ||
| 2383 | { .name = "rx", .irq = 90 }, | ||
| 2384 | { .name = "common", .irq = 17 }, | ||
| 2385 | }; | ||
| 2386 | |||
| 2387 | static struct omap_hwmod_dma_info omap2430_mcbsp3_sdma_chs[] = { | ||
| 2388 | { .name = "rx", .dma_req = 18 }, | ||
| 2389 | { .name = "tx", .dma_req = 17 }, | ||
| 2390 | }; | ||
| 2391 | |||
| 2392 | static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = { | ||
| 2393 | { | ||
| 2394 | .name = "mpu", | ||
| 2395 | .pa_start = 0x4808C000, | ||
| 2396 | .pa_end = 0x4808C0ff, | ||
| 2397 | .flags = ADDR_TYPE_RT | ||
| 2398 | }, | ||
| 2399 | }; | ||
| 2400 | |||
| 2401 | /* l4_core -> mcbsp3 */ | ||
| 2402 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = { | ||
| 2403 | .master = &omap2430_l4_core_hwmod, | ||
| 2404 | .slave = &omap2430_mcbsp3_hwmod, | ||
| 2405 | .clk = "mcbsp3_ick", | ||
| 2406 | .addr = omap2430_mcbsp3_addrs, | ||
| 2407 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp3_addrs), | ||
| 2408 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2409 | }; | ||
| 2410 | |||
| 2411 | /* mcbsp3 slave ports */ | ||
| 2412 | static struct omap_hwmod_ocp_if *omap2430_mcbsp3_slaves[] = { | ||
| 2413 | &omap2430_l4_core__mcbsp3, | ||
| 2414 | }; | ||
| 2415 | |||
| 2416 | static struct omap_hwmod omap2430_mcbsp3_hwmod = { | ||
| 2417 | .name = "mcbsp3", | ||
| 2418 | .class = &omap2430_mcbsp_hwmod_class, | ||
| 2419 | .mpu_irqs = omap2430_mcbsp3_irqs, | ||
| 2420 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_irqs), | ||
| 2421 | .sdma_reqs = omap2430_mcbsp3_sdma_chs, | ||
| 2422 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_sdma_chs), | ||
| 2423 | .main_clk = "mcbsp3_fck", | ||
| 2424 | .prcm = { | ||
| 2425 | .omap2 = { | ||
| 2426 | .prcm_reg_id = 1, | ||
| 2427 | .module_bit = OMAP2430_EN_MCBSP3_SHIFT, | ||
| 2428 | .module_offs = CORE_MOD, | ||
| 2429 | .idlest_reg_id = 2, | ||
| 2430 | .idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT, | ||
| 2431 | }, | ||
| 2432 | }, | ||
| 2433 | .slaves = omap2430_mcbsp3_slaves, | ||
| 2434 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves), | ||
| 2435 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2436 | }; | ||
| 2437 | |||
| 2438 | /* mcbsp4 */ | ||
| 2439 | static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = { | ||
| 2440 | { .name = "tx", .irq = 54 }, | ||
| 2441 | { .name = "rx", .irq = 55 }, | ||
| 2442 | { .name = "common", .irq = 18 }, | ||
| 2443 | }; | ||
| 2444 | |||
| 2445 | static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = { | ||
| 2446 | { .name = "rx", .dma_req = 20 }, | ||
| 2447 | { .name = "tx", .dma_req = 19 }, | ||
| 2448 | }; | ||
| 2449 | |||
| 2450 | static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = { | ||
| 2451 | { | ||
| 2452 | .name = "mpu", | ||
| 2453 | .pa_start = 0x4808E000, | ||
| 2454 | .pa_end = 0x4808E0ff, | ||
| 2455 | .flags = ADDR_TYPE_RT | ||
| 2456 | }, | ||
| 2457 | }; | ||
| 2458 | |||
| 2459 | /* l4_core -> mcbsp4 */ | ||
| 2460 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = { | ||
| 2461 | .master = &omap2430_l4_core_hwmod, | ||
| 2462 | .slave = &omap2430_mcbsp4_hwmod, | ||
| 2463 | .clk = "mcbsp4_ick", | ||
| 2464 | .addr = omap2430_mcbsp4_addrs, | ||
| 2465 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp4_addrs), | ||
| 2466 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2467 | }; | ||
| 2468 | |||
| 2469 | /* mcbsp4 slave ports */ | ||
| 2470 | static struct omap_hwmod_ocp_if *omap2430_mcbsp4_slaves[] = { | ||
| 2471 | &omap2430_l4_core__mcbsp4, | ||
| 2472 | }; | ||
| 2473 | |||
| 2474 | static struct omap_hwmod omap2430_mcbsp4_hwmod = { | ||
| 2475 | .name = "mcbsp4", | ||
| 2476 | .class = &omap2430_mcbsp_hwmod_class, | ||
| 2477 | .mpu_irqs = omap2430_mcbsp4_irqs, | ||
| 2478 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_irqs), | ||
| 2479 | .sdma_reqs = omap2430_mcbsp4_sdma_chs, | ||
| 2480 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_sdma_chs), | ||
| 2481 | .main_clk = "mcbsp4_fck", | ||
| 2482 | .prcm = { | ||
| 2483 | .omap2 = { | ||
| 2484 | .prcm_reg_id = 1, | ||
| 2485 | .module_bit = OMAP2430_EN_MCBSP4_SHIFT, | ||
| 2486 | .module_offs = CORE_MOD, | ||
| 2487 | .idlest_reg_id = 2, | ||
| 2488 | .idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT, | ||
| 2489 | }, | ||
| 2490 | }, | ||
| 2491 | .slaves = omap2430_mcbsp4_slaves, | ||
| 2492 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves), | ||
| 2493 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2494 | }; | ||
| 2495 | |||
| 2496 | /* mcbsp5 */ | ||
| 2497 | static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = { | ||
| 2498 | { .name = "tx", .irq = 81 }, | ||
| 2499 | { .name = "rx", .irq = 82 }, | ||
| 2500 | { .name = "common", .irq = 19 }, | ||
| 2501 | }; | ||
| 2502 | |||
| 2503 | static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = { | ||
| 2504 | { .name = "rx", .dma_req = 22 }, | ||
| 2505 | { .name = "tx", .dma_req = 21 }, | ||
| 2506 | }; | ||
| 2507 | |||
| 2508 | static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = { | ||
| 2509 | { | ||
| 2510 | .name = "mpu", | ||
| 2511 | .pa_start = 0x48096000, | ||
| 2512 | .pa_end = 0x480960ff, | ||
| 2513 | .flags = ADDR_TYPE_RT | ||
| 2514 | }, | ||
| 2515 | }; | ||
| 2516 | |||
| 2517 | /* l4_core -> mcbsp5 */ | ||
| 2518 | static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = { | ||
| 2519 | .master = &omap2430_l4_core_hwmod, | ||
| 2520 | .slave = &omap2430_mcbsp5_hwmod, | ||
| 2521 | .clk = "mcbsp5_ick", | ||
| 2522 | .addr = omap2430_mcbsp5_addrs, | ||
| 2523 | .addr_cnt = ARRAY_SIZE(omap2430_mcbsp5_addrs), | ||
| 2524 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2525 | }; | ||
| 2526 | |||
| 2527 | /* mcbsp5 slave ports */ | ||
| 2528 | static struct omap_hwmod_ocp_if *omap2430_mcbsp5_slaves[] = { | ||
| 2529 | &omap2430_l4_core__mcbsp5, | ||
| 2530 | }; | ||
| 2531 | |||
| 2532 | static struct omap_hwmod omap2430_mcbsp5_hwmod = { | ||
| 2533 | .name = "mcbsp5", | ||
| 2534 | .class = &omap2430_mcbsp_hwmod_class, | ||
| 2535 | .mpu_irqs = omap2430_mcbsp5_irqs, | ||
| 2536 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_irqs), | ||
| 2537 | .sdma_reqs = omap2430_mcbsp5_sdma_chs, | ||
| 2538 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_sdma_chs), | ||
| 2539 | .main_clk = "mcbsp5_fck", | ||
| 2540 | .prcm = { | ||
| 2541 | .omap2 = { | ||
| 2542 | .prcm_reg_id = 1, | ||
| 2543 | .module_bit = OMAP2430_EN_MCBSP5_SHIFT, | ||
| 2544 | .module_offs = CORE_MOD, | ||
| 2545 | .idlest_reg_id = 2, | ||
| 2546 | .idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT, | ||
| 2547 | }, | ||
| 2548 | }, | ||
| 2549 | .slaves = omap2430_mcbsp5_slaves, | ||
| 2550 | .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves), | ||
| 2551 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2552 | }; | ||
| 2553 | |||
| 2554 | /* MMC/SD/SDIO common */ | ||
| 2555 | |||
| 2556 | static struct omap_hwmod_class_sysconfig omap2430_mmc_sysc = { | ||
| 2557 | .rev_offs = 0x1fc, | ||
| 2558 | .sysc_offs = 0x10, | ||
| 2559 | .syss_offs = 0x14, | ||
| 2560 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
| 2561 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
| 2562 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), | ||
| 2563 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 2564 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 2565 | }; | ||
| 2566 | |||
| 2567 | static struct omap_hwmod_class omap2430_mmc_class = { | ||
| 2568 | .name = "mmc", | ||
| 2569 | .sysc = &omap2430_mmc_sysc, | ||
| 2570 | }; | ||
| 2571 | |||
| 2572 | /* MMC/SD/SDIO1 */ | ||
| 2573 | |||
| 2574 | static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = { | ||
| 2575 | { .irq = 83 }, | ||
| 2576 | }; | ||
| 2577 | |||
| 2578 | static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = { | ||
| 2579 | { .name = "tx", .dma_req = 61 }, /* DMA_MMC1_TX */ | ||
| 2580 | { .name = "rx", .dma_req = 62 }, /* DMA_MMC1_RX */ | ||
| 2581 | }; | ||
| 2582 | |||
| 2583 | static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = { | ||
| 2584 | { .role = "dbck", .clk = "mmchsdb1_fck" }, | ||
| 2585 | }; | ||
| 2586 | |||
| 2587 | static struct omap_hwmod_ocp_if *omap2430_mmc1_slaves[] = { | ||
| 2588 | &omap2430_l4_core__mmc1, | ||
| 2589 | }; | ||
| 2590 | |||
| 2591 | static struct omap_mmc_dev_attr mmc1_dev_attr = { | ||
| 2592 | .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, | ||
| 2593 | }; | ||
| 2594 | |||
| 2595 | static struct omap_hwmod omap2430_mmc1_hwmod = { | ||
| 2596 | .name = "mmc1", | ||
| 2597 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | ||
| 2598 | .mpu_irqs = omap2430_mmc1_mpu_irqs, | ||
| 2599 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc1_mpu_irqs), | ||
| 2600 | .sdma_reqs = omap2430_mmc1_sdma_reqs, | ||
| 2601 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc1_sdma_reqs), | ||
| 2602 | .opt_clks = omap2430_mmc1_opt_clks, | ||
| 2603 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks), | ||
| 2604 | .main_clk = "mmchs1_fck", | ||
| 2605 | .prcm = { | ||
| 2606 | .omap2 = { | ||
| 2607 | .module_offs = CORE_MOD, | ||
| 2608 | .prcm_reg_id = 2, | ||
| 2609 | .module_bit = OMAP2430_EN_MMCHS1_SHIFT, | ||
| 2610 | .idlest_reg_id = 2, | ||
| 2611 | .idlest_idle_bit = OMAP2430_ST_MMCHS1_SHIFT, | ||
| 2612 | }, | ||
| 2613 | }, | ||
| 2614 | .dev_attr = &mmc1_dev_attr, | ||
| 2615 | .slaves = omap2430_mmc1_slaves, | ||
| 2616 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves), | ||
| 2617 | .class = &omap2430_mmc_class, | ||
| 2618 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2619 | }; | ||
| 2620 | |||
| 2621 | /* MMC/SD/SDIO2 */ | ||
| 2622 | |||
| 2623 | static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = { | ||
| 2624 | { .irq = 86 }, | ||
| 2625 | }; | ||
| 2626 | |||
| 2627 | static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = { | ||
| 2628 | { .name = "tx", .dma_req = 47 }, /* DMA_MMC2_TX */ | ||
| 2629 | { .name = "rx", .dma_req = 48 }, /* DMA_MMC2_RX */ | ||
| 2630 | }; | ||
| 2631 | |||
| 2632 | static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = { | ||
| 2633 | { .role = "dbck", .clk = "mmchsdb2_fck" }, | ||
| 2634 | }; | ||
| 2635 | |||
| 2636 | static struct omap_hwmod_ocp_if *omap2430_mmc2_slaves[] = { | ||
| 2637 | &omap2430_l4_core__mmc2, | ||
| 2638 | }; | ||
| 2639 | |||
| 2640 | static struct omap_hwmod omap2430_mmc2_hwmod = { | ||
| 2641 | .name = "mmc2", | ||
| 2642 | .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, | ||
| 2643 | .mpu_irqs = omap2430_mmc2_mpu_irqs, | ||
| 2644 | .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc2_mpu_irqs), | ||
| 2645 | .sdma_reqs = omap2430_mmc2_sdma_reqs, | ||
| 2646 | .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc2_sdma_reqs), | ||
| 2647 | .opt_clks = omap2430_mmc2_opt_clks, | ||
| 2648 | .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks), | ||
| 2649 | .main_clk = "mmchs2_fck", | ||
| 2650 | .prcm = { | ||
| 2651 | .omap2 = { | ||
| 2652 | .module_offs = CORE_MOD, | ||
| 2653 | .prcm_reg_id = 2, | ||
| 2654 | .module_bit = OMAP2430_EN_MMCHS2_SHIFT, | ||
| 2655 | .idlest_reg_id = 2, | ||
| 2656 | .idlest_idle_bit = OMAP2430_ST_MMCHS2_SHIFT, | ||
| 2657 | }, | ||
| 2658 | }, | ||
| 2659 | .slaves = omap2430_mmc2_slaves, | ||
| 2660 | .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves), | ||
| 2661 | .class = &omap2430_mmc_class, | ||
| 2662 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | ||
| 2663 | }; | ||
| 1510 | 2664 | ||
| 1511 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { | 2665 | static __initdata struct omap_hwmod *omap2430_hwmods[] = { |
| 1512 | &omap2430_l3_main_hwmod, | 2666 | &omap2430_l3_main_hwmod, |
| @@ -1514,6 +2668,20 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = { | |||
| 1514 | &omap2430_l4_wkup_hwmod, | 2668 | &omap2430_l4_wkup_hwmod, |
| 1515 | &omap2430_mpu_hwmod, | 2669 | &omap2430_mpu_hwmod, |
| 1516 | &omap2430_iva_hwmod, | 2670 | &omap2430_iva_hwmod, |
| 2671 | |||
| 2672 | &omap2430_timer1_hwmod, | ||
| 2673 | &omap2430_timer2_hwmod, | ||
| 2674 | &omap2430_timer3_hwmod, | ||
| 2675 | &omap2430_timer4_hwmod, | ||
| 2676 | &omap2430_timer5_hwmod, | ||
| 2677 | &omap2430_timer6_hwmod, | ||
| 2678 | &omap2430_timer7_hwmod, | ||
| 2679 | &omap2430_timer8_hwmod, | ||
| 2680 | &omap2430_timer9_hwmod, | ||
| 2681 | &omap2430_timer10_hwmod, | ||
| 2682 | &omap2430_timer11_hwmod, | ||
| 2683 | &omap2430_timer12_hwmod, | ||
| 2684 | |||
| 1517 | &omap2430_wd_timer2_hwmod, | 2685 | &omap2430_wd_timer2_hwmod, |
| 1518 | &omap2430_uart1_hwmod, | 2686 | &omap2430_uart1_hwmod, |
| 1519 | &omap2430_uart2_hwmod, | 2687 | &omap2430_uart2_hwmod, |
| @@ -1526,6 +2694,8 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = { | |||
| 1526 | /* i2c class */ | 2694 | /* i2c class */ |
| 1527 | &omap2430_i2c1_hwmod, | 2695 | &omap2430_i2c1_hwmod, |
| 1528 | &omap2430_i2c2_hwmod, | 2696 | &omap2430_i2c2_hwmod, |
| 2697 | &omap2430_mmc1_hwmod, | ||
| 2698 | &omap2430_mmc2_hwmod, | ||
| 1529 | 2699 | ||
| 1530 | /* gpio class */ | 2700 | /* gpio class */ |
| 1531 | &omap2430_gpio1_hwmod, | 2701 | &omap2430_gpio1_hwmod, |
| @@ -1537,6 +2707,16 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = { | |||
| 1537 | /* dma_system class*/ | 2707 | /* dma_system class*/ |
| 1538 | &omap2430_dma_system_hwmod, | 2708 | &omap2430_dma_system_hwmod, |
| 1539 | 2709 | ||
| 2710 | /* mcbsp class */ | ||
| 2711 | &omap2430_mcbsp1_hwmod, | ||
| 2712 | &omap2430_mcbsp2_hwmod, | ||
| 2713 | &omap2430_mcbsp3_hwmod, | ||
| 2714 | &omap2430_mcbsp4_hwmod, | ||
| 2715 | &omap2430_mcbsp5_hwmod, | ||
| 2716 | |||
| 2717 | /* mailbox class */ | ||
| 2718 | &omap2430_mailbox_hwmod, | ||
| 2719 | |||
| 1540 | /* mcspi class */ | 2720 | /* mcspi class */ |
| 1541 | &omap2430_mcspi1_hwmod, | 2721 | &omap2430_mcspi1_hwmod, |
| 1542 | &omap2430_mcspi2_hwmod, | 2722 | &omap2430_mcspi2_hwmod, |
| @@ -1550,5 +2730,5 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = { | |||
| 1550 | 2730 | ||
| 1551 | int __init omap2430_hwmod_init(void) | 2731 | int __init omap2430_hwmod_init(void) |
| 1552 | { | 2732 | { |
| 1553 | return omap_hwmod_init(omap2430_hwmods); | 2733 | return omap_hwmod_register(omap2430_hwmods); |
| 1554 | } | 2734 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index e9d001228568..2e275cbcd654 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
| @@ -22,8 +22,11 @@ | |||
| 22 | #include <plat/l4_3xxx.h> | 22 | #include <plat/l4_3xxx.h> |
| 23 | #include <plat/i2c.h> | 23 | #include <plat/i2c.h> |
| 24 | #include <plat/gpio.h> | 24 | #include <plat/gpio.h> |
| 25 | #include <plat/mmc.h> | ||
| 25 | #include <plat/smartreflex.h> | 26 | #include <plat/smartreflex.h> |
| 27 | #include <plat/mcbsp.h> | ||
| 26 | #include <plat/mcspi.h> | 28 | #include <plat/mcspi.h> |
| 29 | #include <plat/dmtimer.h> | ||
| 27 | 30 | ||
| 28 | #include "omap_hwmod_common_data.h" | 31 | #include "omap_hwmod_common_data.h" |
| 29 | 32 | ||
| @@ -68,10 +71,21 @@ static struct omap_hwmod omap34xx_mcspi1; | |||
| 68 | static struct omap_hwmod omap34xx_mcspi2; | 71 | static struct omap_hwmod omap34xx_mcspi2; |
| 69 | static struct omap_hwmod omap34xx_mcspi3; | 72 | static struct omap_hwmod omap34xx_mcspi3; |
| 70 | static struct omap_hwmod omap34xx_mcspi4; | 73 | static struct omap_hwmod omap34xx_mcspi4; |
| 74 | static struct omap_hwmod omap3xxx_mmc1_hwmod; | ||
| 75 | static struct omap_hwmod omap3xxx_mmc2_hwmod; | ||
| 76 | static struct omap_hwmod omap3xxx_mmc3_hwmod; | ||
| 71 | static struct omap_hwmod am35xx_usbhsotg_hwmod; | 77 | static struct omap_hwmod am35xx_usbhsotg_hwmod; |
| 72 | 78 | ||
| 73 | static struct omap_hwmod omap3xxx_dma_system_hwmod; | 79 | static struct omap_hwmod omap3xxx_dma_system_hwmod; |
| 74 | 80 | ||
| 81 | static struct omap_hwmod omap3xxx_mcbsp1_hwmod; | ||
| 82 | static struct omap_hwmod omap3xxx_mcbsp2_hwmod; | ||
| 83 | static struct omap_hwmod omap3xxx_mcbsp3_hwmod; | ||
| 84 | static struct omap_hwmod omap3xxx_mcbsp4_hwmod; | ||
| 85 | static struct omap_hwmod omap3xxx_mcbsp5_hwmod; | ||
| 86 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod; | ||
| 87 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod; | ||
| 88 | |||
| 75 | /* L3 -> L4_CORE interface */ | 89 | /* L3 -> L4_CORE interface */ |
| 76 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { | 90 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { |
| 77 | .master = &omap3xxx_l3_main_hwmod, | 91 | .master = &omap3xxx_l3_main_hwmod, |
| @@ -86,10 +100,26 @@ static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_per = { | |||
| 86 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 100 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 87 | }; | 101 | }; |
| 88 | 102 | ||
| 103 | /* L3 taret configuration and error log registers */ | ||
| 104 | static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = { | ||
| 105 | { .irq = INT_34XX_L3_DBG_IRQ }, | ||
| 106 | { .irq = INT_34XX_L3_APP_IRQ }, | ||
| 107 | }; | ||
| 108 | |||
| 109 | static struct omap_hwmod_addr_space omap3xxx_l3_main_addrs[] = { | ||
| 110 | { | ||
| 111 | .pa_start = 0x68000000, | ||
| 112 | .pa_end = 0x6800ffff, | ||
| 113 | .flags = ADDR_TYPE_RT, | ||
| 114 | }, | ||
| 115 | }; | ||
| 116 | |||
| 89 | /* MPU -> L3 interface */ | 117 | /* MPU -> L3 interface */ |
| 90 | static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = { | 118 | static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = { |
| 91 | .master = &omap3xxx_mpu_hwmod, | 119 | .master = &omap3xxx_mpu_hwmod, |
| 92 | .slave = &omap3xxx_l3_main_hwmod, | 120 | .slave = &omap3xxx_l3_main_hwmod, |
| 121 | .addr = omap3xxx_l3_main_addrs, | ||
| 122 | .addr_cnt = ARRAY_SIZE(omap3xxx_l3_main_addrs), | ||
| 93 | .user = OCP_USER_MPU, | 123 | .user = OCP_USER_MPU, |
| 94 | }; | 124 | }; |
| 95 | 125 | ||
| @@ -121,6 +151,8 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { | |||
| 121 | static struct omap_hwmod omap3xxx_l3_main_hwmod = { | 151 | static struct omap_hwmod omap3xxx_l3_main_hwmod = { |
| 122 | .name = "l3_main", | 152 | .name = "l3_main", |
| 123 | .class = &l3_hwmod_class, | 153 | .class = &l3_hwmod_class, |
| 154 | .mpu_irqs = omap3xxx_l3_main_irqs, | ||
| 155 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_l3_main_irqs), | ||
| 124 | .masters = omap3xxx_l3_main_masters, | 156 | .masters = omap3xxx_l3_main_masters, |
| 125 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), | 157 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), |
| 126 | .slaves = omap3xxx_l3_main_slaves, | 158 | .slaves = omap3xxx_l3_main_slaves, |
| @@ -158,6 +190,63 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { | |||
| 158 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 190 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 159 | }; | 191 | }; |
| 160 | 192 | ||
| 193 | /* L4 CORE -> MMC1 interface */ | ||
| 194 | static struct omap_hwmod_addr_space omap3xxx_mmc1_addr_space[] = { | ||
| 195 | { | ||
| 196 | .pa_start = 0x4809c000, | ||
| 197 | .pa_end = 0x4809c1ff, | ||
| 198 | .flags = ADDR_TYPE_RT, | ||
| 199 | }, | ||
| 200 | }; | ||
| 201 | |||
| 202 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc1 = { | ||
| 203 | .master = &omap3xxx_l4_core_hwmod, | ||
| 204 | .slave = &omap3xxx_mmc1_hwmod, | ||
| 205 | .clk = "mmchs1_ick", | ||
| 206 | .addr = omap3xxx_mmc1_addr_space, | ||
| 207 | .addr_cnt = ARRAY_SIZE(omap3xxx_mmc1_addr_space), | ||
| 208 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 209 | .flags = OMAP_FIREWALL_L4 | ||
| 210 | }; | ||
| 211 | |||
| 212 | /* L4 CORE -> MMC2 interface */ | ||
| 213 | static struct omap_hwmod_addr_space omap3xxx_mmc2_addr_space[] = { | ||
| 214 | { | ||
| 215 | .pa_start = 0x480b4000, | ||
| 216 | .pa_end = 0x480b41ff, | ||
| 217 | .flags = ADDR_TYPE_RT, | ||
| 218 | }, | ||
| 219 | }; | ||
| 220 | |||
| 221 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc2 = { | ||
| 222 | .master = &omap3xxx_l4_core_hwmod, | ||
| 223 | .slave = &omap3xxx_mmc2_hwmod, | ||
| 224 | .clk = "mmchs2_ick", | ||
| 225 | .addr = omap3xxx_mmc2_addr_space, | ||
| 226 | .addr_cnt = ARRAY_SIZE(omap3xxx_mmc2_addr_space), | ||
| 227 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 228 | .flags = OMAP_FIREWALL_L4 | ||
| 229 | }; | ||
| 230 | |||
| 231 | /* L4 CORE -> MMC3 interface */ | ||
| 232 | static struct omap_hwmod_addr_space omap3xxx_mmc3_addr_space[] = { | ||
| 233 | { | ||
| 234 | .pa_start = 0x480ad000, | ||
| 235 | .pa_end = 0x480ad1ff, | ||
| 236 | .flags = ADDR_TYPE_RT, | ||
| 237 | }, | ||
| 238 | }; | ||
| 239 | |||
| 240 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc3 = { | ||
| 241 | .master = &omap3xxx_l4_core_hwmod, | ||
| 242 | .slave = &omap3xxx_mmc3_hwmod, | ||
| 243 | .clk = "mmchs3_ick", | ||
| 244 | .addr = omap3xxx_mmc3_addr_space, | ||
| 245 | .addr_cnt = ARRAY_SIZE(omap3xxx_mmc3_addr_space), | ||
| 246 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 247 | .flags = OMAP_FIREWALL_L4 | ||
| 248 | }; | ||
| 249 | |||
| 161 | /* L4 CORE -> UART1 interface */ | 250 | /* L4 CORE -> UART1 interface */ |
| 162 | static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = { | 251 | static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = { |
| 163 | { | 252 | { |
| @@ -402,26 +491,12 @@ static struct omap_hwmod_ocp_if *am35xx_usbhsotg_slaves[] = { | |||
| 402 | /* Slave interfaces on the L4_CORE interconnect */ | 491 | /* Slave interfaces on the L4_CORE interconnect */ |
| 403 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { | 492 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { |
| 404 | &omap3xxx_l3_main__l4_core, | 493 | &omap3xxx_l3_main__l4_core, |
| 405 | &omap3_l4_core__sr1, | ||
| 406 | &omap3_l4_core__sr2, | ||
| 407 | }; | ||
| 408 | |||
| 409 | /* Master interfaces on the L4_CORE interconnect */ | ||
| 410 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = { | ||
| 411 | &omap3xxx_l4_core__l4_wkup, | ||
| 412 | &omap3_l4_core__uart1, | ||
| 413 | &omap3_l4_core__uart2, | ||
| 414 | &omap3_l4_core__i2c1, | ||
| 415 | &omap3_l4_core__i2c2, | ||
| 416 | &omap3_l4_core__i2c3, | ||
| 417 | }; | 494 | }; |
| 418 | 495 | ||
| 419 | /* L4 CORE */ | 496 | /* L4 CORE */ |
| 420 | static struct omap_hwmod omap3xxx_l4_core_hwmod = { | 497 | static struct omap_hwmod omap3xxx_l4_core_hwmod = { |
| 421 | .name = "l4_core", | 498 | .name = "l4_core", |
| 422 | .class = &l4_hwmod_class, | 499 | .class = &l4_hwmod_class, |
| 423 | .masters = omap3xxx_l4_core_masters, | ||
| 424 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters), | ||
| 425 | .slaves = omap3xxx_l4_core_slaves, | 500 | .slaves = omap3xxx_l4_core_slaves, |
| 426 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), | 501 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), |
| 427 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 502 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| @@ -433,18 +508,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = { | |||
| 433 | &omap3xxx_l3_main__l4_per, | 508 | &omap3xxx_l3_main__l4_per, |
| 434 | }; | 509 | }; |
| 435 | 510 | ||
| 436 | /* Master interfaces on the L4_PER interconnect */ | ||
| 437 | static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = { | ||
| 438 | &omap3_l4_per__uart3, | ||
| 439 | &omap3_l4_per__uart4, | ||
| 440 | }; | ||
| 441 | |||
| 442 | /* L4 PER */ | 511 | /* L4 PER */ |
| 443 | static struct omap_hwmod omap3xxx_l4_per_hwmod = { | 512 | static struct omap_hwmod omap3xxx_l4_per_hwmod = { |
| 444 | .name = "l4_per", | 513 | .name = "l4_per", |
| 445 | .class = &l4_hwmod_class, | 514 | .class = &l4_hwmod_class, |
| 446 | .masters = omap3xxx_l4_per_masters, | ||
| 447 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters), | ||
| 448 | .slaves = omap3xxx_l4_per_slaves, | 515 | .slaves = omap3xxx_l4_per_slaves, |
| 449 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), | 516 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), |
| 450 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 517 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| @@ -456,16 +523,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_slaves[] = { | |||
| 456 | &omap3xxx_l4_core__l4_wkup, | 523 | &omap3xxx_l4_core__l4_wkup, |
| 457 | }; | 524 | }; |
| 458 | 525 | ||
| 459 | /* Master interfaces on the L4_WKUP interconnect */ | ||
| 460 | static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = { | ||
| 461 | }; | ||
| 462 | |||
| 463 | /* L4 WKUP */ | 526 | /* L4 WKUP */ |
| 464 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { | 527 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { |
| 465 | .name = "l4_wkup", | 528 | .name = "l4_wkup", |
| 466 | .class = &l4_hwmod_class, | 529 | .class = &l4_hwmod_class, |
| 467 | .masters = omap3xxx_l4_wkup_masters, | ||
| 468 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters), | ||
| 469 | .slaves = omap3xxx_l4_wkup_slaves, | 530 | .slaves = omap3xxx_l4_wkup_slaves, |
| 470 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), | 531 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), |
| 471 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 532 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| @@ -515,6 +576,640 @@ static struct omap_hwmod omap3xxx_iva_hwmod = { | |||
| 515 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 576 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
| 516 | }; | 577 | }; |
| 517 | 578 | ||
| 579 | /* timer class */ | ||
| 580 | static struct omap_hwmod_class_sysconfig omap3xxx_timer_1ms_sysc = { | ||
| 581 | .rev_offs = 0x0000, | ||
| 582 | .sysc_offs = 0x0010, | ||
| 583 | .syss_offs = 0x0014, | ||
| 584 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY | | ||
| 585 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
| 586 | SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE), | ||
| 587 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 588 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 589 | }; | ||
| 590 | |||
| 591 | static struct omap_hwmod_class omap3xxx_timer_1ms_hwmod_class = { | ||
| 592 | .name = "timer", | ||
| 593 | .sysc = &omap3xxx_timer_1ms_sysc, | ||
| 594 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
| 595 | }; | ||
| 596 | |||
| 597 | static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = { | ||
| 598 | .rev_offs = 0x0000, | ||
| 599 | .sysc_offs = 0x0010, | ||
| 600 | .syss_offs = 0x0014, | ||
| 601 | .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP | | ||
| 602 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
| 603 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 604 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 605 | }; | ||
| 606 | |||
| 607 | static struct omap_hwmod_class omap3xxx_timer_hwmod_class = { | ||
| 608 | .name = "timer", | ||
| 609 | .sysc = &omap3xxx_timer_sysc, | ||
| 610 | .rev = OMAP_TIMER_IP_VERSION_1, | ||
| 611 | }; | ||
| 612 | |||
| 613 | /* timer1 */ | ||
| 614 | static struct omap_hwmod omap3xxx_timer1_hwmod; | ||
| 615 | static struct omap_hwmod_irq_info omap3xxx_timer1_mpu_irqs[] = { | ||
| 616 | { .irq = 37, }, | ||
| 617 | }; | ||
| 618 | |||
| 619 | static struct omap_hwmod_addr_space omap3xxx_timer1_addrs[] = { | ||
| 620 | { | ||
| 621 | .pa_start = 0x48318000, | ||
| 622 | .pa_end = 0x48318000 + SZ_1K - 1, | ||
| 623 | .flags = ADDR_TYPE_RT | ||
| 624 | }, | ||
| 625 | }; | ||
| 626 | |||
| 627 | /* l4_wkup -> timer1 */ | ||
| 628 | static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__timer1 = { | ||
| 629 | .master = &omap3xxx_l4_wkup_hwmod, | ||
| 630 | .slave = &omap3xxx_timer1_hwmod, | ||
| 631 | .clk = "gpt1_ick", | ||
| 632 | .addr = omap3xxx_timer1_addrs, | ||
| 633 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer1_addrs), | ||
| 634 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 635 | }; | ||
| 636 | |||
| 637 | /* timer1 slave port */ | ||
| 638 | static struct omap_hwmod_ocp_if *omap3xxx_timer1_slaves[] = { | ||
| 639 | &omap3xxx_l4_wkup__timer1, | ||
| 640 | }; | ||
| 641 | |||
| 642 | /* timer1 hwmod */ | ||
| 643 | static struct omap_hwmod omap3xxx_timer1_hwmod = { | ||
| 644 | .name = "timer1", | ||
| 645 | .mpu_irqs = omap3xxx_timer1_mpu_irqs, | ||
| 646 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer1_mpu_irqs), | ||
| 647 | .main_clk = "gpt1_fck", | ||
| 648 | .prcm = { | ||
| 649 | .omap2 = { | ||
| 650 | .prcm_reg_id = 1, | ||
| 651 | .module_bit = OMAP3430_EN_GPT1_SHIFT, | ||
| 652 | .module_offs = WKUP_MOD, | ||
| 653 | .idlest_reg_id = 1, | ||
| 654 | .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT, | ||
| 655 | }, | ||
| 656 | }, | ||
| 657 | .slaves = omap3xxx_timer1_slaves, | ||
| 658 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves), | ||
| 659 | .class = &omap3xxx_timer_1ms_hwmod_class, | ||
| 660 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 661 | }; | ||
| 662 | |||
| 663 | /* timer2 */ | ||
| 664 | static struct omap_hwmod omap3xxx_timer2_hwmod; | ||
| 665 | static struct omap_hwmod_irq_info omap3xxx_timer2_mpu_irqs[] = { | ||
| 666 | { .irq = 38, }, | ||
| 667 | }; | ||
| 668 | |||
| 669 | static struct omap_hwmod_addr_space omap3xxx_timer2_addrs[] = { | ||
| 670 | { | ||
| 671 | .pa_start = 0x49032000, | ||
| 672 | .pa_end = 0x49032000 + SZ_1K - 1, | ||
| 673 | .flags = ADDR_TYPE_RT | ||
| 674 | }, | ||
| 675 | }; | ||
| 676 | |||
| 677 | /* l4_per -> timer2 */ | ||
| 678 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer2 = { | ||
| 679 | .master = &omap3xxx_l4_per_hwmod, | ||
| 680 | .slave = &omap3xxx_timer2_hwmod, | ||
| 681 | .clk = "gpt2_ick", | ||
| 682 | .addr = omap3xxx_timer2_addrs, | ||
| 683 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer2_addrs), | ||
| 684 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 685 | }; | ||
| 686 | |||
| 687 | /* timer2 slave port */ | ||
| 688 | static struct omap_hwmod_ocp_if *omap3xxx_timer2_slaves[] = { | ||
| 689 | &omap3xxx_l4_per__timer2, | ||
| 690 | }; | ||
| 691 | |||
| 692 | /* timer2 hwmod */ | ||
| 693 | static struct omap_hwmod omap3xxx_timer2_hwmod = { | ||
| 694 | .name = "timer2", | ||
| 695 | .mpu_irqs = omap3xxx_timer2_mpu_irqs, | ||
| 696 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer2_mpu_irqs), | ||
| 697 | .main_clk = "gpt2_fck", | ||
| 698 | .prcm = { | ||
| 699 | .omap2 = { | ||
| 700 | .prcm_reg_id = 1, | ||
| 701 | .module_bit = OMAP3430_EN_GPT2_SHIFT, | ||
| 702 | .module_offs = OMAP3430_PER_MOD, | ||
| 703 | .idlest_reg_id = 1, | ||
| 704 | .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT, | ||
| 705 | }, | ||
| 706 | }, | ||
| 707 | .slaves = omap3xxx_timer2_slaves, | ||
| 708 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves), | ||
| 709 | .class = &omap3xxx_timer_1ms_hwmod_class, | ||
| 710 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 711 | }; | ||
| 712 | |||
| 713 | /* timer3 */ | ||
| 714 | static struct omap_hwmod omap3xxx_timer3_hwmod; | ||
| 715 | static struct omap_hwmod_irq_info omap3xxx_timer3_mpu_irqs[] = { | ||
| 716 | { .irq = 39, }, | ||
| 717 | }; | ||
| 718 | |||
| 719 | static struct omap_hwmod_addr_space omap3xxx_timer3_addrs[] = { | ||
| 720 | { | ||
| 721 | .pa_start = 0x49034000, | ||
| 722 | .pa_end = 0x49034000 + SZ_1K - 1, | ||
| 723 | .flags = ADDR_TYPE_RT | ||
| 724 | }, | ||
| 725 | }; | ||
| 726 | |||
| 727 | /* l4_per -> timer3 */ | ||
| 728 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer3 = { | ||
| 729 | .master = &omap3xxx_l4_per_hwmod, | ||
| 730 | .slave = &omap3xxx_timer3_hwmod, | ||
| 731 | .clk = "gpt3_ick", | ||
| 732 | .addr = omap3xxx_timer3_addrs, | ||
| 733 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer3_addrs), | ||
| 734 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 735 | }; | ||
| 736 | |||
| 737 | /* timer3 slave port */ | ||
| 738 | static struct omap_hwmod_ocp_if *omap3xxx_timer3_slaves[] = { | ||
| 739 | &omap3xxx_l4_per__timer3, | ||
| 740 | }; | ||
| 741 | |||
| 742 | /* timer3 hwmod */ | ||
| 743 | static struct omap_hwmod omap3xxx_timer3_hwmod = { | ||
| 744 | .name = "timer3", | ||
| 745 | .mpu_irqs = omap3xxx_timer3_mpu_irqs, | ||
| 746 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer3_mpu_irqs), | ||
| 747 | .main_clk = "gpt3_fck", | ||
| 748 | .prcm = { | ||
| 749 | .omap2 = { | ||
| 750 | .prcm_reg_id = 1, | ||
| 751 | .module_bit = OMAP3430_EN_GPT3_SHIFT, | ||
| 752 | .module_offs = OMAP3430_PER_MOD, | ||
| 753 | .idlest_reg_id = 1, | ||
| 754 | .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT, | ||
| 755 | }, | ||
| 756 | }, | ||
| 757 | .slaves = omap3xxx_timer3_slaves, | ||
| 758 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves), | ||
| 759 | .class = &omap3xxx_timer_hwmod_class, | ||
| 760 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 761 | }; | ||
| 762 | |||
| 763 | /* timer4 */ | ||
| 764 | static struct omap_hwmod omap3xxx_timer4_hwmod; | ||
| 765 | static struct omap_hwmod_irq_info omap3xxx_timer4_mpu_irqs[] = { | ||
| 766 | { .irq = 40, }, | ||
| 767 | }; | ||
| 768 | |||
| 769 | static struct omap_hwmod_addr_space omap3xxx_timer4_addrs[] = { | ||
| 770 | { | ||
| 771 | .pa_start = 0x49036000, | ||
| 772 | .pa_end = 0x49036000 + SZ_1K - 1, | ||
| 773 | .flags = ADDR_TYPE_RT | ||
| 774 | }, | ||
| 775 | }; | ||
| 776 | |||
| 777 | /* l4_per -> timer4 */ | ||
| 778 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer4 = { | ||
| 779 | .master = &omap3xxx_l4_per_hwmod, | ||
| 780 | .slave = &omap3xxx_timer4_hwmod, | ||
| 781 | .clk = "gpt4_ick", | ||
| 782 | .addr = omap3xxx_timer4_addrs, | ||
| 783 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer4_addrs), | ||
| 784 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 785 | }; | ||
| 786 | |||
| 787 | /* timer4 slave port */ | ||
| 788 | static struct omap_hwmod_ocp_if *omap3xxx_timer4_slaves[] = { | ||
| 789 | &omap3xxx_l4_per__timer4, | ||
| 790 | }; | ||
| 791 | |||
| 792 | /* timer4 hwmod */ | ||
| 793 | static struct omap_hwmod omap3xxx_timer4_hwmod = { | ||
| 794 | .name = "timer4", | ||
| 795 | .mpu_irqs = omap3xxx_timer4_mpu_irqs, | ||
| 796 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer4_mpu_irqs), | ||
| 797 | .main_clk = "gpt4_fck", | ||
| 798 | .prcm = { | ||
| 799 | .omap2 = { | ||
| 800 | .prcm_reg_id = 1, | ||
| 801 | .module_bit = OMAP3430_EN_GPT4_SHIFT, | ||
| 802 | .module_offs = OMAP3430_PER_MOD, | ||
| 803 | .idlest_reg_id = 1, | ||
| 804 | .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT, | ||
| 805 | }, | ||
| 806 | }, | ||
| 807 | .slaves = omap3xxx_timer4_slaves, | ||
| 808 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves), | ||
| 809 | .class = &omap3xxx_timer_hwmod_class, | ||
| 810 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 811 | }; | ||
| 812 | |||
| 813 | /* timer5 */ | ||
| 814 | static struct omap_hwmod omap3xxx_timer5_hwmod; | ||
| 815 | static struct omap_hwmod_irq_info omap3xxx_timer5_mpu_irqs[] = { | ||
| 816 | { .irq = 41, }, | ||
| 817 | }; | ||
| 818 | |||
| 819 | static struct omap_hwmod_addr_space omap3xxx_timer5_addrs[] = { | ||
| 820 | { | ||
| 821 | .pa_start = 0x49038000, | ||
| 822 | .pa_end = 0x49038000 + SZ_1K - 1, | ||
| 823 | .flags = ADDR_TYPE_RT | ||
| 824 | }, | ||
| 825 | }; | ||
| 826 | |||
| 827 | /* l4_per -> timer5 */ | ||
| 828 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer5 = { | ||
| 829 | .master = &omap3xxx_l4_per_hwmod, | ||
| 830 | .slave = &omap3xxx_timer5_hwmod, | ||
| 831 | .clk = "gpt5_ick", | ||
| 832 | .addr = omap3xxx_timer5_addrs, | ||
| 833 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer5_addrs), | ||
| 834 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 835 | }; | ||
| 836 | |||
| 837 | /* timer5 slave port */ | ||
| 838 | static struct omap_hwmod_ocp_if *omap3xxx_timer5_slaves[] = { | ||
| 839 | &omap3xxx_l4_per__timer5, | ||
| 840 | }; | ||
| 841 | |||
| 842 | /* timer5 hwmod */ | ||
| 843 | static struct omap_hwmod omap3xxx_timer5_hwmod = { | ||
| 844 | .name = "timer5", | ||
| 845 | .mpu_irqs = omap3xxx_timer5_mpu_irqs, | ||
| 846 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer5_mpu_irqs), | ||
| 847 | .main_clk = "gpt5_fck", | ||
| 848 | .prcm = { | ||
| 849 | .omap2 = { | ||
| 850 | .prcm_reg_id = 1, | ||
| 851 | .module_bit = OMAP3430_EN_GPT5_SHIFT, | ||
| 852 | .module_offs = OMAP3430_PER_MOD, | ||
| 853 | .idlest_reg_id = 1, | ||
| 854 | .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, | ||
| 855 | }, | ||
| 856 | }, | ||
| 857 | .slaves = omap3xxx_timer5_slaves, | ||
| 858 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves), | ||
| 859 | .class = &omap3xxx_timer_hwmod_class, | ||
| 860 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 861 | }; | ||
| 862 | |||
| 863 | /* timer6 */ | ||
| 864 | static struct omap_hwmod omap3xxx_timer6_hwmod; | ||
| 865 | static struct omap_hwmod_irq_info omap3xxx_timer6_mpu_irqs[] = { | ||
| 866 | { .irq = 42, }, | ||
| 867 | }; | ||
| 868 | |||
| 869 | static struct omap_hwmod_addr_space omap3xxx_timer6_addrs[] = { | ||
| 870 | { | ||
| 871 | .pa_start = 0x4903A000, | ||
| 872 | .pa_end = 0x4903A000 + SZ_1K - 1, | ||
| 873 | .flags = ADDR_TYPE_RT | ||
| 874 | }, | ||
| 875 | }; | ||
| 876 | |||
| 877 | /* l4_per -> timer6 */ | ||
| 878 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer6 = { | ||
| 879 | .master = &omap3xxx_l4_per_hwmod, | ||
| 880 | .slave = &omap3xxx_timer6_hwmod, | ||
| 881 | .clk = "gpt6_ick", | ||
| 882 | .addr = omap3xxx_timer6_addrs, | ||
| 883 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer6_addrs), | ||
| 884 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 885 | }; | ||
| 886 | |||
| 887 | /* timer6 slave port */ | ||
| 888 | static struct omap_hwmod_ocp_if *omap3xxx_timer6_slaves[] = { | ||
| 889 | &omap3xxx_l4_per__timer6, | ||
| 890 | }; | ||
| 891 | |||
| 892 | /* timer6 hwmod */ | ||
| 893 | static struct omap_hwmod omap3xxx_timer6_hwmod = { | ||
| 894 | .name = "timer6", | ||
| 895 | .mpu_irqs = omap3xxx_timer6_mpu_irqs, | ||
| 896 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer6_mpu_irqs), | ||
| 897 | .main_clk = "gpt6_fck", | ||
| 898 | .prcm = { | ||
| 899 | .omap2 = { | ||
| 900 | .prcm_reg_id = 1, | ||
| 901 | .module_bit = OMAP3430_EN_GPT6_SHIFT, | ||
| 902 | .module_offs = OMAP3430_PER_MOD, | ||
| 903 | .idlest_reg_id = 1, | ||
| 904 | .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, | ||
| 905 | }, | ||
| 906 | }, | ||
| 907 | .slaves = omap3xxx_timer6_slaves, | ||
| 908 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves), | ||
| 909 | .class = &omap3xxx_timer_hwmod_class, | ||
| 910 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 911 | }; | ||
| 912 | |||
| 913 | /* timer7 */ | ||
| 914 | static struct omap_hwmod omap3xxx_timer7_hwmod; | ||
| 915 | static struct omap_hwmod_irq_info omap3xxx_timer7_mpu_irqs[] = { | ||
| 916 | { .irq = 43, }, | ||
| 917 | }; | ||
| 918 | |||
| 919 | static struct omap_hwmod_addr_space omap3xxx_timer7_addrs[] = { | ||
| 920 | { | ||
| 921 | .pa_start = 0x4903C000, | ||
| 922 | .pa_end = 0x4903C000 + SZ_1K - 1, | ||
| 923 | .flags = ADDR_TYPE_RT | ||
| 924 | }, | ||
| 925 | }; | ||
| 926 | |||
| 927 | /* l4_per -> timer7 */ | ||
| 928 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer7 = { | ||
| 929 | .master = &omap3xxx_l4_per_hwmod, | ||
| 930 | .slave = &omap3xxx_timer7_hwmod, | ||
| 931 | .clk = "gpt7_ick", | ||
| 932 | .addr = omap3xxx_timer7_addrs, | ||
| 933 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer7_addrs), | ||
| 934 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 935 | }; | ||
| 936 | |||
| 937 | /* timer7 slave port */ | ||
| 938 | static struct omap_hwmod_ocp_if *omap3xxx_timer7_slaves[] = { | ||
| 939 | &omap3xxx_l4_per__timer7, | ||
| 940 | }; | ||
| 941 | |||
| 942 | /* timer7 hwmod */ | ||
| 943 | static struct omap_hwmod omap3xxx_timer7_hwmod = { | ||
| 944 | .name = "timer7", | ||
| 945 | .mpu_irqs = omap3xxx_timer7_mpu_irqs, | ||
| 946 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer7_mpu_irqs), | ||
| 947 | .main_clk = "gpt7_fck", | ||
| 948 | .prcm = { | ||
| 949 | .omap2 = { | ||
| 950 | .prcm_reg_id = 1, | ||
| 951 | .module_bit = OMAP3430_EN_GPT7_SHIFT, | ||
| 952 | .module_offs = OMAP3430_PER_MOD, | ||
| 953 | .idlest_reg_id = 1, | ||
| 954 | .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, | ||
| 955 | }, | ||
| 956 | }, | ||
| 957 | .slaves = omap3xxx_timer7_slaves, | ||
| 958 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves), | ||
| 959 | .class = &omap3xxx_timer_hwmod_class, | ||
| 960 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 961 | }; | ||
| 962 | |||
| 963 | /* timer8 */ | ||
| 964 | static struct omap_hwmod omap3xxx_timer8_hwmod; | ||
| 965 | static struct omap_hwmod_irq_info omap3xxx_timer8_mpu_irqs[] = { | ||
| 966 | { .irq = 44, }, | ||
| 967 | }; | ||
| 968 | |||
| 969 | static struct omap_hwmod_addr_space omap3xxx_timer8_addrs[] = { | ||
| 970 | { | ||
| 971 | .pa_start = 0x4903E000, | ||
| 972 | .pa_end = 0x4903E000 + SZ_1K - 1, | ||
| 973 | .flags = ADDR_TYPE_RT | ||
| 974 | }, | ||
| 975 | }; | ||
| 976 | |||
| 977 | /* l4_per -> timer8 */ | ||
| 978 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer8 = { | ||
| 979 | .master = &omap3xxx_l4_per_hwmod, | ||
| 980 | .slave = &omap3xxx_timer8_hwmod, | ||
| 981 | .clk = "gpt8_ick", | ||
| 982 | .addr = omap3xxx_timer8_addrs, | ||
| 983 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer8_addrs), | ||
| 984 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 985 | }; | ||
| 986 | |||
| 987 | /* timer8 slave port */ | ||
| 988 | static struct omap_hwmod_ocp_if *omap3xxx_timer8_slaves[] = { | ||
| 989 | &omap3xxx_l4_per__timer8, | ||
| 990 | }; | ||
| 991 | |||
| 992 | /* timer8 hwmod */ | ||
| 993 | static struct omap_hwmod omap3xxx_timer8_hwmod = { | ||
| 994 | .name = "timer8", | ||
| 995 | .mpu_irqs = omap3xxx_timer8_mpu_irqs, | ||
| 996 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer8_mpu_irqs), | ||
| 997 | .main_clk = "gpt8_fck", | ||
| 998 | .prcm = { | ||
| 999 | .omap2 = { | ||
| 1000 | .prcm_reg_id = 1, | ||
| 1001 | .module_bit = OMAP3430_EN_GPT8_SHIFT, | ||
| 1002 | .module_offs = OMAP3430_PER_MOD, | ||
| 1003 | .idlest_reg_id = 1, | ||
| 1004 | .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT, | ||
| 1005 | }, | ||
| 1006 | }, | ||
| 1007 | .slaves = omap3xxx_timer8_slaves, | ||
| 1008 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves), | ||
| 1009 | .class = &omap3xxx_timer_hwmod_class, | ||
| 1010 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 1011 | }; | ||
| 1012 | |||
| 1013 | /* timer9 */ | ||
| 1014 | static struct omap_hwmod omap3xxx_timer9_hwmod; | ||
| 1015 | static struct omap_hwmod_irq_info omap3xxx_timer9_mpu_irqs[] = { | ||
| 1016 | { .irq = 45, }, | ||
| 1017 | }; | ||
| 1018 | |||
| 1019 | static struct omap_hwmod_addr_space omap3xxx_timer9_addrs[] = { | ||
| 1020 | { | ||
| 1021 | .pa_start = 0x49040000, | ||
| 1022 | .pa_end = 0x49040000 + SZ_1K - 1, | ||
| 1023 | .flags = ADDR_TYPE_RT | ||
| 1024 | }, | ||
| 1025 | }; | ||
| 1026 | |||
| 1027 | /* l4_per -> timer9 */ | ||
| 1028 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer9 = { | ||
| 1029 | .master = &omap3xxx_l4_per_hwmod, | ||
| 1030 | .slave = &omap3xxx_timer9_hwmod, | ||
| 1031 | .clk = "gpt9_ick", | ||
| 1032 | .addr = omap3xxx_timer9_addrs, | ||
| 1033 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer9_addrs), | ||
| 1034 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 1035 | }; | ||
| 1036 | |||
| 1037 | /* timer9 slave port */ | ||
| 1038 | static struct omap_hwmod_ocp_if *omap3xxx_timer9_slaves[] = { | ||
| 1039 | &omap3xxx_l4_per__timer9, | ||
| 1040 | }; | ||
| 1041 | |||
| 1042 | /* timer9 hwmod */ | ||
| 1043 | static struct omap_hwmod omap3xxx_timer9_hwmod = { | ||
| 1044 | .name = "timer9", | ||
| 1045 | .mpu_irqs = omap3xxx_timer9_mpu_irqs, | ||
| 1046 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer9_mpu_irqs), | ||
| 1047 | .main_clk = "gpt9_fck", | ||
| 1048 | .prcm = { | ||
| 1049 | .omap2 = { | ||
| 1050 | .prcm_reg_id = 1, | ||
| 1051 | .module_bit = OMAP3430_EN_GPT9_SHIFT, | ||
| 1052 | .module_offs = OMAP3430_PER_MOD, | ||
| 1053 | .idlest_reg_id = 1, | ||
| 1054 | .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT, | ||
| 1055 | }, | ||
| 1056 | }, | ||
| 1057 | .slaves = omap3xxx_timer9_slaves, | ||
| 1058 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves), | ||
| 1059 | .class = &omap3xxx_timer_hwmod_class, | ||
| 1060 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 1061 | }; | ||
| 1062 | |||
| 1063 | /* timer10 */ | ||
| 1064 | static struct omap_hwmod omap3xxx_timer10_hwmod; | ||
| 1065 | static struct omap_hwmod_irq_info omap3xxx_timer10_mpu_irqs[] = { | ||
| 1066 | { .irq = 46, }, | ||
| 1067 | }; | ||
| 1068 | |||
| 1069 | static struct omap_hwmod_addr_space omap3xxx_timer10_addrs[] = { | ||
| 1070 | { | ||
| 1071 | .pa_start = 0x48086000, | ||
| 1072 | .pa_end = 0x48086000 + SZ_1K - 1, | ||
| 1073 | .flags = ADDR_TYPE_RT | ||
| 1074 | }, | ||
| 1075 | }; | ||
| 1076 | |||
| 1077 | /* l4_core -> timer10 */ | ||
| 1078 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer10 = { | ||
| 1079 | .master = &omap3xxx_l4_core_hwmod, | ||
| 1080 | .slave = &omap3xxx_timer10_hwmod, | ||
| 1081 | .clk = "gpt10_ick", | ||
| 1082 | .addr = omap3xxx_timer10_addrs, | ||
| 1083 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer10_addrs), | ||
| 1084 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 1085 | }; | ||
| 1086 | |||
| 1087 | /* timer10 slave port */ | ||
| 1088 | static struct omap_hwmod_ocp_if *omap3xxx_timer10_slaves[] = { | ||
| 1089 | &omap3xxx_l4_core__timer10, | ||
| 1090 | }; | ||
| 1091 | |||
| 1092 | /* timer10 hwmod */ | ||
| 1093 | static struct omap_hwmod omap3xxx_timer10_hwmod = { | ||
| 1094 | .name = "timer10", | ||
| 1095 | .mpu_irqs = omap3xxx_timer10_mpu_irqs, | ||
| 1096 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer10_mpu_irqs), | ||
| 1097 | .main_clk = "gpt10_fck", | ||
| 1098 | .prcm = { | ||
| 1099 | .omap2 = { | ||
| 1100 | .prcm_reg_id = 1, | ||
| 1101 | .module_bit = OMAP3430_EN_GPT10_SHIFT, | ||
| 1102 | .module_offs = CORE_MOD, | ||
| 1103 | .idlest_reg_id = 1, | ||
| 1104 | .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT, | ||
| 1105 | }, | ||
| 1106 | }, | ||
| 1107 | .slaves = omap3xxx_timer10_slaves, | ||
| 1108 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves), | ||
| 1109 | .class = &omap3xxx_timer_1ms_hwmod_class, | ||
| 1110 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 1111 | }; | ||
| 1112 | |||
| 1113 | /* timer11 */ | ||
| 1114 | static struct omap_hwmod omap3xxx_timer11_hwmod; | ||
| 1115 | static struct omap_hwmod_irq_info omap3xxx_timer11_mpu_irqs[] = { | ||
| 1116 | { .irq = 47, }, | ||
| 1117 | }; | ||
| 1118 | |||
| 1119 | static struct omap_hwmod_addr_space omap3xxx_timer11_addrs[] = { | ||
| 1120 | { | ||
| 1121 | .pa_start = 0x48088000, | ||
| 1122 | .pa_end = 0x48088000 + SZ_1K - 1, | ||
| 1123 | .flags = ADDR_TYPE_RT | ||
| 1124 | }, | ||
| 1125 | }; | ||
| 1126 | |||
| 1127 | /* l4_core -> timer11 */ | ||
| 1128 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer11 = { | ||
| 1129 | .master = &omap3xxx_l4_core_hwmod, | ||
| 1130 | .slave = &omap3xxx_timer11_hwmod, | ||
| 1131 | .clk = "gpt11_ick", | ||
| 1132 | .addr = omap3xxx_timer11_addrs, | ||
| 1133 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer11_addrs), | ||
| 1134 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 1135 | }; | ||
| 1136 | |||
| 1137 | /* timer11 slave port */ | ||
| 1138 | static struct omap_hwmod_ocp_if *omap3xxx_timer11_slaves[] = { | ||
| 1139 | &omap3xxx_l4_core__timer11, | ||
| 1140 | }; | ||
| 1141 | |||
| 1142 | /* timer11 hwmod */ | ||
| 1143 | static struct omap_hwmod omap3xxx_timer11_hwmod = { | ||
| 1144 | .name = "timer11", | ||
| 1145 | .mpu_irqs = omap3xxx_timer11_mpu_irqs, | ||
| 1146 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer11_mpu_irqs), | ||
| 1147 | .main_clk = "gpt11_fck", | ||
| 1148 | .prcm = { | ||
| 1149 | .omap2 = { | ||
| 1150 | .prcm_reg_id = 1, | ||
| 1151 | .module_bit = OMAP3430_EN_GPT11_SHIFT, | ||
| 1152 | .module_offs = CORE_MOD, | ||
| 1153 | .idlest_reg_id = 1, | ||
| 1154 | .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT, | ||
| 1155 | }, | ||
| 1156 | }, | ||
| 1157 | .slaves = omap3xxx_timer11_slaves, | ||
| 1158 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves), | ||
| 1159 | .class = &omap3xxx_timer_hwmod_class, | ||
| 1160 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 1161 | }; | ||
| 1162 | |||
| 1163 | /* timer12*/ | ||
| 1164 | static struct omap_hwmod omap3xxx_timer12_hwmod; | ||
| 1165 | static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = { | ||
| 1166 | { .irq = 95, }, | ||
| 1167 | }; | ||
| 1168 | |||
| 1169 | static struct omap_hwmod_addr_space omap3xxx_timer12_addrs[] = { | ||
| 1170 | { | ||
| 1171 | .pa_start = 0x48304000, | ||
| 1172 | .pa_end = 0x48304000 + SZ_1K - 1, | ||
| 1173 | .flags = ADDR_TYPE_RT | ||
| 1174 | }, | ||
| 1175 | }; | ||
| 1176 | |||
| 1177 | /* l4_core -> timer12 */ | ||
| 1178 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer12 = { | ||
| 1179 | .master = &omap3xxx_l4_core_hwmod, | ||
| 1180 | .slave = &omap3xxx_timer12_hwmod, | ||
| 1181 | .clk = "gpt12_ick", | ||
| 1182 | .addr = omap3xxx_timer12_addrs, | ||
| 1183 | .addr_cnt = ARRAY_SIZE(omap3xxx_timer12_addrs), | ||
| 1184 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 1185 | }; | ||
| 1186 | |||
| 1187 | /* timer12 slave port */ | ||
| 1188 | static struct omap_hwmod_ocp_if *omap3xxx_timer12_slaves[] = { | ||
| 1189 | &omap3xxx_l4_core__timer12, | ||
| 1190 | }; | ||
| 1191 | |||
| 1192 | /* timer12 hwmod */ | ||
| 1193 | static struct omap_hwmod omap3xxx_timer12_hwmod = { | ||
| 1194 | .name = "timer12", | ||
| 1195 | .mpu_irqs = omap3xxx_timer12_mpu_irqs, | ||
| 1196 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer12_mpu_irqs), | ||
| 1197 | .main_clk = "gpt12_fck", | ||
| 1198 | .prcm = { | ||
| 1199 | .omap2 = { | ||
| 1200 | .prcm_reg_id = 1, | ||
| 1201 | .module_bit = OMAP3430_EN_GPT12_SHIFT, | ||
| 1202 | .module_offs = WKUP_MOD, | ||
| 1203 | .idlest_reg_id = 1, | ||
| 1204 | .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT, | ||
| 1205 | }, | ||
| 1206 | }, | ||
| 1207 | .slaves = omap3xxx_timer12_slaves, | ||
| 1208 | .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves), | ||
| 1209 | .class = &omap3xxx_timer_hwmod_class, | ||
| 1210 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
| 1211 | }; | ||
| 1212 | |||
| 518 | /* l4_wkup -> wd_timer2 */ | 1213 | /* l4_wkup -> wd_timer2 */ |
| 519 | static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = { | 1214 | static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = { |
| 520 | { | 1215 | { |
| @@ -589,6 +1284,11 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = { | |||
| 589 | .slaves = omap3xxx_wd_timer2_slaves, | 1284 | .slaves = omap3xxx_wd_timer2_slaves, |
| 590 | .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), | 1285 | .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), |
| 591 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 1286 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 1287 | /* | ||
| 1288 | * XXX: Use software supervised mode, HW supervised smartidle seems to | ||
| 1289 | * block CORE power domain idle transitions. Maybe a HW bug in wdt2? | ||
| 1290 | */ | ||
| 1291 | .flags = HWMOD_SWSUP_SIDLE, | ||
| 592 | }; | 1292 | }; |
| 593 | 1293 | ||
| 594 | /* UART common */ | 1294 | /* UART common */ |
| @@ -1139,6 +1839,7 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = { | |||
| 1139 | .flags = OMAP_FIREWALL_L4, | 1839 | .flags = OMAP_FIREWALL_L4, |
| 1140 | } | 1840 | } |
| 1141 | }, | 1841 | }, |
| 1842 | .flags = OCPIF_SWSUP_IDLE, | ||
| 1142 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 1843 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 1143 | }; | 1844 | }; |
| 1144 | 1845 | ||
| @@ -1729,6 +2430,437 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = { | |||
| 1729 | .flags = HWMOD_NO_IDLEST, | 2430 | .flags = HWMOD_NO_IDLEST, |
| 1730 | }; | 2431 | }; |
| 1731 | 2432 | ||
| 2433 | /* | ||
| 2434 | * 'mcbsp' class | ||
| 2435 | * multi channel buffered serial port controller | ||
| 2436 | */ | ||
| 2437 | |||
| 2438 | static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sysc = { | ||
| 2439 | .sysc_offs = 0x008c, | ||
| 2440 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP | | ||
| 2441 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), | ||
| 2442 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 2443 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 2444 | .clockact = 0x2, | ||
| 2445 | }; | ||
| 2446 | |||
| 2447 | static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = { | ||
| 2448 | .name = "mcbsp", | ||
| 2449 | .sysc = &omap3xxx_mcbsp_sysc, | ||
| 2450 | .rev = MCBSP_CONFIG_TYPE3, | ||
| 2451 | }; | ||
| 2452 | |||
| 2453 | /* mcbsp1 */ | ||
| 2454 | static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { | ||
| 2455 | { .name = "irq", .irq = 16 }, | ||
| 2456 | { .name = "tx", .irq = 59 }, | ||
| 2457 | { .name = "rx", .irq = 60 }, | ||
| 2458 | }; | ||
| 2459 | |||
| 2460 | static struct omap_hwmod_dma_info omap3xxx_mcbsp1_sdma_chs[] = { | ||
| 2461 | { .name = "rx", .dma_req = 32 }, | ||
| 2462 | { .name = "tx", .dma_req = 31 }, | ||
| 2463 | }; | ||
| 2464 | |||
| 2465 | static struct omap_hwmod_addr_space omap3xxx_mcbsp1_addrs[] = { | ||
| 2466 | { | ||
| 2467 | .name = "mpu", | ||
| 2468 | .pa_start = 0x48074000, | ||
| 2469 | .pa_end = 0x480740ff, | ||
| 2470 | .flags = ADDR_TYPE_RT | ||
| 2471 | }, | ||
| 2472 | }; | ||
| 2473 | |||
| 2474 | /* l4_core -> mcbsp1 */ | ||
| 2475 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp1 = { | ||
| 2476 | .master = &omap3xxx_l4_core_hwmod, | ||
| 2477 | .slave = &omap3xxx_mcbsp1_hwmod, | ||
| 2478 | .clk = "mcbsp1_ick", | ||
| 2479 | .addr = omap3xxx_mcbsp1_addrs, | ||
| 2480 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_addrs), | ||
| 2481 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2482 | }; | ||
| 2483 | |||
| 2484 | /* mcbsp1 slave ports */ | ||
| 2485 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp1_slaves[] = { | ||
| 2486 | &omap3xxx_l4_core__mcbsp1, | ||
| 2487 | }; | ||
| 2488 | |||
| 2489 | static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { | ||
| 2490 | .name = "mcbsp1", | ||
| 2491 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
| 2492 | .mpu_irqs = omap3xxx_mcbsp1_irqs, | ||
| 2493 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_irqs), | ||
| 2494 | .sdma_reqs = omap3xxx_mcbsp1_sdma_chs, | ||
| 2495 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_sdma_chs), | ||
| 2496 | .main_clk = "mcbsp1_fck", | ||
| 2497 | .prcm = { | ||
| 2498 | .omap2 = { | ||
| 2499 | .prcm_reg_id = 1, | ||
| 2500 | .module_bit = OMAP3430_EN_MCBSP1_SHIFT, | ||
| 2501 | .module_offs = CORE_MOD, | ||
| 2502 | .idlest_reg_id = 1, | ||
| 2503 | .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT, | ||
| 2504 | }, | ||
| 2505 | }, | ||
| 2506 | .slaves = omap3xxx_mcbsp1_slaves, | ||
| 2507 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves), | ||
| 2508 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 2509 | }; | ||
| 2510 | |||
| 2511 | /* mcbsp2 */ | ||
| 2512 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = { | ||
| 2513 | { .name = "irq", .irq = 17 }, | ||
| 2514 | { .name = "tx", .irq = 62 }, | ||
| 2515 | { .name = "rx", .irq = 63 }, | ||
| 2516 | }; | ||
| 2517 | |||
| 2518 | static struct omap_hwmod_dma_info omap3xxx_mcbsp2_sdma_chs[] = { | ||
| 2519 | { .name = "rx", .dma_req = 34 }, | ||
| 2520 | { .name = "tx", .dma_req = 33 }, | ||
| 2521 | }; | ||
| 2522 | |||
| 2523 | static struct omap_hwmod_addr_space omap3xxx_mcbsp2_addrs[] = { | ||
| 2524 | { | ||
| 2525 | .name = "mpu", | ||
| 2526 | .pa_start = 0x49022000, | ||
| 2527 | .pa_end = 0x490220ff, | ||
| 2528 | .flags = ADDR_TYPE_RT | ||
| 2529 | }, | ||
| 2530 | }; | ||
| 2531 | |||
| 2532 | /* l4_per -> mcbsp2 */ | ||
| 2533 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2 = { | ||
| 2534 | .master = &omap3xxx_l4_per_hwmod, | ||
| 2535 | .slave = &omap3xxx_mcbsp2_hwmod, | ||
| 2536 | .clk = "mcbsp2_ick", | ||
| 2537 | .addr = omap3xxx_mcbsp2_addrs, | ||
| 2538 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_addrs), | ||
| 2539 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2540 | }; | ||
| 2541 | |||
| 2542 | /* mcbsp2 slave ports */ | ||
| 2543 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_slaves[] = { | ||
| 2544 | &omap3xxx_l4_per__mcbsp2, | ||
| 2545 | }; | ||
| 2546 | |||
| 2547 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = { | ||
| 2548 | .sidetone = "mcbsp2_sidetone", | ||
| 2549 | }; | ||
| 2550 | |||
| 2551 | static struct omap_hwmod omap3xxx_mcbsp2_hwmod = { | ||
| 2552 | .name = "mcbsp2", | ||
| 2553 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
| 2554 | .mpu_irqs = omap3xxx_mcbsp2_irqs, | ||
| 2555 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_irqs), | ||
| 2556 | .sdma_reqs = omap3xxx_mcbsp2_sdma_chs, | ||
| 2557 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sdma_chs), | ||
| 2558 | .main_clk = "mcbsp2_fck", | ||
| 2559 | .prcm = { | ||
| 2560 | .omap2 = { | ||
| 2561 | .prcm_reg_id = 1, | ||
| 2562 | .module_bit = OMAP3430_EN_MCBSP2_SHIFT, | ||
| 2563 | .module_offs = OMAP3430_PER_MOD, | ||
| 2564 | .idlest_reg_id = 1, | ||
| 2565 | .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, | ||
| 2566 | }, | ||
| 2567 | }, | ||
| 2568 | .slaves = omap3xxx_mcbsp2_slaves, | ||
| 2569 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves), | ||
| 2570 | .dev_attr = &omap34xx_mcbsp2_dev_attr, | ||
| 2571 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 2572 | }; | ||
| 2573 | |||
| 2574 | /* mcbsp3 */ | ||
| 2575 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = { | ||
| 2576 | { .name = "irq", .irq = 22 }, | ||
| 2577 | { .name = "tx", .irq = 89 }, | ||
| 2578 | { .name = "rx", .irq = 90 }, | ||
| 2579 | }; | ||
| 2580 | |||
| 2581 | static struct omap_hwmod_dma_info omap3xxx_mcbsp3_sdma_chs[] = { | ||
| 2582 | { .name = "rx", .dma_req = 18 }, | ||
| 2583 | { .name = "tx", .dma_req = 17 }, | ||
| 2584 | }; | ||
| 2585 | |||
| 2586 | static struct omap_hwmod_addr_space omap3xxx_mcbsp3_addrs[] = { | ||
| 2587 | { | ||
| 2588 | .name = "mpu", | ||
| 2589 | .pa_start = 0x49024000, | ||
| 2590 | .pa_end = 0x490240ff, | ||
| 2591 | .flags = ADDR_TYPE_RT | ||
| 2592 | }, | ||
| 2593 | }; | ||
| 2594 | |||
| 2595 | /* l4_per -> mcbsp3 */ | ||
| 2596 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3 = { | ||
| 2597 | .master = &omap3xxx_l4_per_hwmod, | ||
| 2598 | .slave = &omap3xxx_mcbsp3_hwmod, | ||
| 2599 | .clk = "mcbsp3_ick", | ||
| 2600 | .addr = omap3xxx_mcbsp3_addrs, | ||
| 2601 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_addrs), | ||
| 2602 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2603 | }; | ||
| 2604 | |||
| 2605 | /* mcbsp3 slave ports */ | ||
| 2606 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_slaves[] = { | ||
| 2607 | &omap3xxx_l4_per__mcbsp3, | ||
| 2608 | }; | ||
| 2609 | |||
| 2610 | static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = { | ||
| 2611 | .sidetone = "mcbsp3_sidetone", | ||
| 2612 | }; | ||
| 2613 | |||
| 2614 | static struct omap_hwmod omap3xxx_mcbsp3_hwmod = { | ||
| 2615 | .name = "mcbsp3", | ||
| 2616 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
| 2617 | .mpu_irqs = omap3xxx_mcbsp3_irqs, | ||
| 2618 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_irqs), | ||
| 2619 | .sdma_reqs = omap3xxx_mcbsp3_sdma_chs, | ||
| 2620 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sdma_chs), | ||
| 2621 | .main_clk = "mcbsp3_fck", | ||
| 2622 | .prcm = { | ||
| 2623 | .omap2 = { | ||
| 2624 | .prcm_reg_id = 1, | ||
| 2625 | .module_bit = OMAP3430_EN_MCBSP3_SHIFT, | ||
| 2626 | .module_offs = OMAP3430_PER_MOD, | ||
| 2627 | .idlest_reg_id = 1, | ||
| 2628 | .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, | ||
| 2629 | }, | ||
| 2630 | }, | ||
| 2631 | .slaves = omap3xxx_mcbsp3_slaves, | ||
| 2632 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves), | ||
| 2633 | .dev_attr = &omap34xx_mcbsp3_dev_attr, | ||
| 2634 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 2635 | }; | ||
| 2636 | |||
| 2637 | /* mcbsp4 */ | ||
| 2638 | static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = { | ||
| 2639 | { .name = "irq", .irq = 23 }, | ||
| 2640 | { .name = "tx", .irq = 54 }, | ||
| 2641 | { .name = "rx", .irq = 55 }, | ||
| 2642 | }; | ||
| 2643 | |||
| 2644 | static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = { | ||
| 2645 | { .name = "rx", .dma_req = 20 }, | ||
| 2646 | { .name = "tx", .dma_req = 19 }, | ||
| 2647 | }; | ||
| 2648 | |||
| 2649 | static struct omap_hwmod_addr_space omap3xxx_mcbsp4_addrs[] = { | ||
| 2650 | { | ||
| 2651 | .name = "mpu", | ||
| 2652 | .pa_start = 0x49026000, | ||
| 2653 | .pa_end = 0x490260ff, | ||
| 2654 | .flags = ADDR_TYPE_RT | ||
| 2655 | }, | ||
| 2656 | }; | ||
| 2657 | |||
| 2658 | /* l4_per -> mcbsp4 */ | ||
| 2659 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp4 = { | ||
| 2660 | .master = &omap3xxx_l4_per_hwmod, | ||
| 2661 | .slave = &omap3xxx_mcbsp4_hwmod, | ||
| 2662 | .clk = "mcbsp4_ick", | ||
| 2663 | .addr = omap3xxx_mcbsp4_addrs, | ||
| 2664 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_addrs), | ||
| 2665 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2666 | }; | ||
| 2667 | |||
| 2668 | /* mcbsp4 slave ports */ | ||
| 2669 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp4_slaves[] = { | ||
| 2670 | &omap3xxx_l4_per__mcbsp4, | ||
| 2671 | }; | ||
| 2672 | |||
| 2673 | static struct omap_hwmod omap3xxx_mcbsp4_hwmod = { | ||
| 2674 | .name = "mcbsp4", | ||
| 2675 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
| 2676 | .mpu_irqs = omap3xxx_mcbsp4_irqs, | ||
| 2677 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_irqs), | ||
| 2678 | .sdma_reqs = omap3xxx_mcbsp4_sdma_chs, | ||
| 2679 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_sdma_chs), | ||
| 2680 | .main_clk = "mcbsp4_fck", | ||
| 2681 | .prcm = { | ||
| 2682 | .omap2 = { | ||
| 2683 | .prcm_reg_id = 1, | ||
| 2684 | .module_bit = OMAP3430_EN_MCBSP4_SHIFT, | ||
| 2685 | .module_offs = OMAP3430_PER_MOD, | ||
| 2686 | .idlest_reg_id = 1, | ||
| 2687 | .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT, | ||
| 2688 | }, | ||
| 2689 | }, | ||
| 2690 | .slaves = omap3xxx_mcbsp4_slaves, | ||
| 2691 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves), | ||
| 2692 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 2693 | }; | ||
| 2694 | |||
| 2695 | /* mcbsp5 */ | ||
| 2696 | static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = { | ||
| 2697 | { .name = "irq", .irq = 27 }, | ||
| 2698 | { .name = "tx", .irq = 81 }, | ||
| 2699 | { .name = "rx", .irq = 82 }, | ||
| 2700 | }; | ||
| 2701 | |||
| 2702 | static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = { | ||
| 2703 | { .name = "rx", .dma_req = 22 }, | ||
| 2704 | { .name = "tx", .dma_req = 21 }, | ||
| 2705 | }; | ||
| 2706 | |||
| 2707 | static struct omap_hwmod_addr_space omap3xxx_mcbsp5_addrs[] = { | ||
| 2708 | { | ||
| 2709 | .name = "mpu", | ||
| 2710 | .pa_start = 0x48096000, | ||
| 2711 | .pa_end = 0x480960ff, | ||
| 2712 | .flags = ADDR_TYPE_RT | ||
| 2713 | }, | ||
| 2714 | }; | ||
| 2715 | |||
| 2716 | /* l4_core -> mcbsp5 */ | ||
| 2717 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp5 = { | ||
| 2718 | .master = &omap3xxx_l4_core_hwmod, | ||
| 2719 | .slave = &omap3xxx_mcbsp5_hwmod, | ||
| 2720 | .clk = "mcbsp5_ick", | ||
| 2721 | .addr = omap3xxx_mcbsp5_addrs, | ||
| 2722 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_addrs), | ||
| 2723 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 2724 | }; | ||
| 2725 | |||
| 2726 | /* mcbsp5 slave ports */ | ||
| 2727 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp5_slaves[] = { | ||
| 2728 | &omap3xxx_l4_core__mcbsp5, | ||
| 2729 | }; | ||
| 2730 | |||
| 2731 | static struct omap_hwmod omap3xxx_mcbsp5_hwmod = { | ||
| 2732 | .name = "mcbsp5", | ||
| 2733 | .class = &omap3xxx_mcbsp_hwmod_class, | ||
| 2734 | .mpu_irqs = omap3xxx_mcbsp5_irqs, | ||
| 2735 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_irqs), | ||
| 2736 | .sdma_reqs = omap3xxx_mcbsp5_sdma_chs, | ||
| 2737 | .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_sdma_chs), | ||
| 2738 | .main_clk = "mcbsp5_fck", | ||
| 2739 | .prcm = { | ||
| 2740 | .omap2 = { | ||
| 2741 | .prcm_reg_id = 1, | ||
| 2742 | .module_bit = OMAP3430_EN_MCBSP5_SHIFT, | ||
| 2743 | .module_offs = CORE_MOD, | ||
| 2744 | .idlest_reg_id = 1, | ||
| 2745 | .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT, | ||
| 2746 | }, | ||
| 2747 | }, | ||
| 2748 | .slaves = omap3xxx_mcbsp5_slaves, | ||
| 2749 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves), | ||
| 2750 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 2751 | }; | ||
| 2752 | /* 'mcbsp sidetone' class */ | ||
| 2753 | |||
| 2754 | static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sidetone_sysc = { | ||
| 2755 | .sysc_offs = 0x0010, | ||
| 2756 | .sysc_flags = SYSC_HAS_AUTOIDLE, | ||
| 2757 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 2758 | }; | ||
| 2759 | |||
| 2760 | static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = { | ||
| 2761 | .name = "mcbsp_sidetone", | ||
| 2762 | .sysc = &omap3xxx_mcbsp_sidetone_sysc, | ||
| 2763 | }; | ||
| 2764 | |||
| 2765 | /* mcbsp2_sidetone */ | ||
| 2766 | static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = { | ||
| 2767 | { .name = "irq", .irq = 4 }, | ||
| 2768 | }; | ||
| 2769 | |||
| 2770 | static struct omap_hwmod_addr_space omap3xxx_mcbsp2_sidetone_addrs[] = { | ||
| 2771 | { | ||
| 2772 | .name = "sidetone", | ||
| 2773 | .pa_start = 0x49028000, | ||
| 2774 | .pa_end = 0x490280ff, | ||
| 2775 | .flags = ADDR_TYPE_RT | ||
| 2776 | }, | ||
| 2777 | }; | ||
| 2778 | |||
| 2779 | /* l4_per -> mcbsp2_sidetone */ | ||
| 2780 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2_sidetone = { | ||
| 2781 | .master = &omap3xxx_l4_per_hwmod, | ||
| 2782 | .slave = &omap3xxx_mcbsp2_sidetone_hwmod, | ||
| 2783 | .clk = "mcbsp2_ick", | ||
| 2784 | .addr = omap3xxx_mcbsp2_sidetone_addrs, | ||
| 2785 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_addrs), | ||
| 2786 | .user = OCP_USER_MPU, | ||
| 2787 | }; | ||
| 2788 | |||
| 2789 | /* mcbsp2_sidetone slave ports */ | ||
| 2790 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_sidetone_slaves[] = { | ||
| 2791 | &omap3xxx_l4_per__mcbsp2_sidetone, | ||
| 2792 | }; | ||
| 2793 | |||
| 2794 | static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { | ||
| 2795 | .name = "mcbsp2_sidetone", | ||
| 2796 | .class = &omap3xxx_mcbsp_sidetone_hwmod_class, | ||
| 2797 | .mpu_irqs = omap3xxx_mcbsp2_sidetone_irqs, | ||
| 2798 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_irqs), | ||
| 2799 | .main_clk = "mcbsp2_fck", | ||
| 2800 | .prcm = { | ||
| 2801 | .omap2 = { | ||
| 2802 | .prcm_reg_id = 1, | ||
| 2803 | .module_bit = OMAP3430_EN_MCBSP2_SHIFT, | ||
| 2804 | .module_offs = OMAP3430_PER_MOD, | ||
| 2805 | .idlest_reg_id = 1, | ||
| 2806 | .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, | ||
| 2807 | }, | ||
| 2808 | }, | ||
| 2809 | .slaves = omap3xxx_mcbsp2_sidetone_slaves, | ||
| 2810 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves), | ||
| 2811 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 2812 | }; | ||
| 2813 | |||
| 2814 | /* mcbsp3_sidetone */ | ||
| 2815 | static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = { | ||
| 2816 | { .name = "irq", .irq = 5 }, | ||
| 2817 | }; | ||
| 2818 | |||
| 2819 | static struct omap_hwmod_addr_space omap3xxx_mcbsp3_sidetone_addrs[] = { | ||
| 2820 | { | ||
| 2821 | .name = "sidetone", | ||
| 2822 | .pa_start = 0x4902A000, | ||
| 2823 | .pa_end = 0x4902A0ff, | ||
| 2824 | .flags = ADDR_TYPE_RT | ||
| 2825 | }, | ||
| 2826 | }; | ||
| 2827 | |||
| 2828 | /* l4_per -> mcbsp3_sidetone */ | ||
| 2829 | static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = { | ||
| 2830 | .master = &omap3xxx_l4_per_hwmod, | ||
| 2831 | .slave = &omap3xxx_mcbsp3_sidetone_hwmod, | ||
| 2832 | .clk = "mcbsp3_ick", | ||
| 2833 | .addr = omap3xxx_mcbsp3_sidetone_addrs, | ||
| 2834 | .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_addrs), | ||
| 2835 | .user = OCP_USER_MPU, | ||
| 2836 | }; | ||
| 2837 | |||
| 2838 | /* mcbsp3_sidetone slave ports */ | ||
| 2839 | static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_sidetone_slaves[] = { | ||
| 2840 | &omap3xxx_l4_per__mcbsp3_sidetone, | ||
| 2841 | }; | ||
| 2842 | |||
| 2843 | static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { | ||
| 2844 | .name = "mcbsp3_sidetone", | ||
| 2845 | .class = &omap3xxx_mcbsp_sidetone_hwmod_class, | ||
| 2846 | .mpu_irqs = omap3xxx_mcbsp3_sidetone_irqs, | ||
| 2847 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_irqs), | ||
| 2848 | .main_clk = "mcbsp3_fck", | ||
| 2849 | .prcm = { | ||
| 2850 | .omap2 = { | ||
| 2851 | .prcm_reg_id = 1, | ||
| 2852 | .module_bit = OMAP3430_EN_MCBSP3_SHIFT, | ||
| 2853 | .module_offs = OMAP3430_PER_MOD, | ||
| 2854 | .idlest_reg_id = 1, | ||
| 2855 | .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, | ||
| 2856 | }, | ||
| 2857 | }, | ||
| 2858 | .slaves = omap3xxx_mcbsp3_sidetone_slaves, | ||
| 2859 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves), | ||
| 2860 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 2861 | }; | ||
| 2862 | |||
| 2863 | |||
| 1732 | /* SR common */ | 2864 | /* SR common */ |
| 1733 | static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { | 2865 | static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { |
| 1734 | .clkact_shift = 20, | 2866 | .clkact_shift = 20, |
| @@ -1858,6 +2990,74 @@ static struct omap_hwmod omap36xx_sr2_hwmod = { | |||
| 1858 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), | 2990 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), |
| 1859 | }; | 2991 | }; |
| 1860 | 2992 | ||
| 2993 | /* | ||
| 2994 | * 'mailbox' class | ||
| 2995 | * mailbox module allowing communication between the on-chip processors | ||
| 2996 | * using a queued mailbox-interrupt mechanism. | ||
| 2997 | */ | ||
| 2998 | |||
| 2999 | static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = { | ||
| 3000 | .rev_offs = 0x000, | ||
| 3001 | .sysc_offs = 0x010, | ||
| 3002 | .syss_offs = 0x014, | ||
| 3003 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
| 3004 | SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), | ||
| 3005 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 3006 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 3007 | }; | ||
| 3008 | |||
| 3009 | static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = { | ||
| 3010 | .name = "mailbox", | ||
| 3011 | .sysc = &omap3xxx_mailbox_sysc, | ||
| 3012 | }; | ||
| 3013 | |||
| 3014 | static struct omap_hwmod omap3xxx_mailbox_hwmod; | ||
| 3015 | static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { | ||
| 3016 | { .irq = 26 }, | ||
| 3017 | }; | ||
| 3018 | |||
| 3019 | static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = { | ||
| 3020 | { | ||
| 3021 | .pa_start = 0x48094000, | ||
| 3022 | .pa_end = 0x480941ff, | ||
| 3023 | .flags = ADDR_TYPE_RT, | ||
| 3024 | }, | ||
| 3025 | }; | ||
| 3026 | |||
| 3027 | /* l4_core -> mailbox */ | ||
| 3028 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = { | ||
| 3029 | .master = &omap3xxx_l4_core_hwmod, | ||
| 3030 | .slave = &omap3xxx_mailbox_hwmod, | ||
| 3031 | .addr = omap3xxx_mailbox_addrs, | ||
| 3032 | .addr_cnt = ARRAY_SIZE(omap3xxx_mailbox_addrs), | ||
| 3033 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
| 3034 | }; | ||
| 3035 | |||
| 3036 | /* mailbox slave ports */ | ||
| 3037 | static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = { | ||
| 3038 | &omap3xxx_l4_core__mailbox, | ||
| 3039 | }; | ||
| 3040 | |||
| 3041 | static struct omap_hwmod omap3xxx_mailbox_hwmod = { | ||
| 3042 | .name = "mailbox", | ||
| 3043 | .class = &omap3xxx_mailbox_hwmod_class, | ||
| 3044 | .mpu_irqs = omap3xxx_mailbox_irqs, | ||
| 3045 | .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mailbox_irqs), | ||
| 3046 | .main_clk = "mailboxes_ick", | ||
| 3047 | .prcm = { | ||
| 3048 | .omap2 = { | ||
| 3049 | .prcm_reg_id = 1, | ||
| 3050 | .module_bit = OMAP3430_EN_MAILBOXES_SHIFT, | ||
| 3051 | .module_offs = CORE_MOD, | ||
| 3052 | .idlest_reg_id = 1, | ||
| 3053 | .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT, | ||
| 3054 | }, | ||
| 3055 | }, | ||
| 3056 | .slaves = omap3xxx_mailbox_slaves, | ||
| 3057 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves), | ||
| 3058 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 3059 | }; | ||
| 3060 | |||
| 1861 | /* l4 core -> mcspi1 interface */ | 3061 | /* l4 core -> mcspi1 interface */ |
| 1862 | static struct omap_hwmod_addr_space omap34xx_mcspi1_addr_space[] = { | 3062 | static struct omap_hwmod_addr_space omap34xx_mcspi1_addr_space[] = { |
| 1863 | { | 3063 | { |
| @@ -2212,13 +3412,181 @@ static struct omap_hwmod am35xx_usbhsotg_hwmod = { | |||
| 2212 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1) | 3412 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1) |
| 2213 | }; | 3413 | }; |
| 2214 | 3414 | ||
| 3415 | /* MMC/SD/SDIO common */ | ||
| 3416 | |||
| 3417 | static struct omap_hwmod_class_sysconfig omap34xx_mmc_sysc = { | ||
| 3418 | .rev_offs = 0x1fc, | ||
| 3419 | .sysc_offs = 0x10, | ||
| 3420 | .syss_offs = 0x14, | ||
| 3421 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
| 3422 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
| 3423 | SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), | ||
| 3424 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
| 3425 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
| 3426 | }; | ||
| 3427 | |||
| 3428 | static struct omap_hwmod_class omap34xx_mmc_class = { | ||
| 3429 | .name = "mmc", | ||
| 3430 | .sysc = &omap34xx_mmc_sysc, | ||
| 3431 | }; | ||
| 3432 | |||
| 3433 | /* MMC/SD/SDIO1 */ | ||
| 3434 | |||
| 3435 | static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = { | ||
| 3436 | { .irq = 83, }, | ||
| 3437 | }; | ||
| 3438 | |||
| 3439 | static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = { | ||
| 3440 | { .name = "tx", .dma_req = 61, }, | ||
| 3441 | { .name = "rx", .dma_req = 62, }, | ||
| 3442 | }; | ||
| 3443 | |||
| 3444 | static struct omap_hwmod_opt_clk omap34xx_mmc1_opt_clks[] = { | ||
| 3445 | { .role = "dbck", .clk = "omap_32k_fck", }, | ||
| 3446 | }; | ||
| 3447 | |||
| 3448 | static struct omap_hwmod_ocp_if *omap3xxx_mmc1_slaves[] = { | ||
| 3449 | &omap3xxx_l4_core__mmc1, | ||
| 3450 | }; | ||
| 3451 | |||
| 3452 | static struct omap_mmc_dev_attr mmc1_dev_attr = { | ||
| 3453 | .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, | ||
| 3454 | }; | ||
| 3455 | |||
| 3456 | static struct omap_hwmod omap3xxx_mmc1_hwmod = { | ||
| 3457 | .name = "mmc1", | ||
| 3458 | .mpu_irqs = omap34xx_mmc1_mpu_irqs, | ||
| 3459 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc1_mpu_irqs), | ||
| 3460 | .sdma_reqs = omap34xx_mmc1_sdma_reqs, | ||
| 3461 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc1_sdma_reqs), | ||
| 3462 | .opt_clks = omap34xx_mmc1_opt_clks, | ||
| 3463 | .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks), | ||
| 3464 | .main_clk = "mmchs1_fck", | ||
| 3465 | .prcm = { | ||
| 3466 | .omap2 = { | ||
| 3467 | .module_offs = CORE_MOD, | ||
| 3468 | .prcm_reg_id = 1, | ||
| 3469 | .module_bit = OMAP3430_EN_MMC1_SHIFT, | ||
| 3470 | .idlest_reg_id = 1, | ||
| 3471 | .idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT, | ||
| 3472 | }, | ||
| 3473 | }, | ||
| 3474 | .dev_attr = &mmc1_dev_attr, | ||
| 3475 | .slaves = omap3xxx_mmc1_slaves, | ||
| 3476 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves), | ||
| 3477 | .class = &omap34xx_mmc_class, | ||
| 3478 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 3479 | }; | ||
| 3480 | |||
| 3481 | /* MMC/SD/SDIO2 */ | ||
| 3482 | |||
| 3483 | static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = { | ||
| 3484 | { .irq = INT_24XX_MMC2_IRQ, }, | ||
| 3485 | }; | ||
| 3486 | |||
| 3487 | static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = { | ||
| 3488 | { .name = "tx", .dma_req = 47, }, | ||
| 3489 | { .name = "rx", .dma_req = 48, }, | ||
| 3490 | }; | ||
| 3491 | |||
| 3492 | static struct omap_hwmod_opt_clk omap34xx_mmc2_opt_clks[] = { | ||
| 3493 | { .role = "dbck", .clk = "omap_32k_fck", }, | ||
| 3494 | }; | ||
| 3495 | |||
| 3496 | static struct omap_hwmod_ocp_if *omap3xxx_mmc2_slaves[] = { | ||
| 3497 | &omap3xxx_l4_core__mmc2, | ||
| 3498 | }; | ||
| 3499 | |||
| 3500 | static struct omap_hwmod omap3xxx_mmc2_hwmod = { | ||
| 3501 | .name = "mmc2", | ||
| 3502 | .mpu_irqs = omap34xx_mmc2_mpu_irqs, | ||
| 3503 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc2_mpu_irqs), | ||
| 3504 | .sdma_reqs = omap34xx_mmc2_sdma_reqs, | ||
| 3505 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc2_sdma_reqs), | ||
| 3506 | .opt_clks = omap34xx_mmc2_opt_clks, | ||
| 3507 | .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks), | ||
| 3508 | .main_clk = "mmchs2_fck", | ||
| 3509 | .prcm = { | ||
| 3510 | .omap2 = { | ||
| 3511 | .module_offs = CORE_MOD, | ||
| 3512 | .prcm_reg_id = 1, | ||
| 3513 | .module_bit = OMAP3430_EN_MMC2_SHIFT, | ||
| 3514 | .idlest_reg_id = 1, | ||
| 3515 | .idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT, | ||
| 3516 | }, | ||
| 3517 | }, | ||
| 3518 | .slaves = omap3xxx_mmc2_slaves, | ||
| 3519 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves), | ||
| 3520 | .class = &omap34xx_mmc_class, | ||
| 3521 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 3522 | }; | ||
| 3523 | |||
| 3524 | /* MMC/SD/SDIO3 */ | ||
| 3525 | |||
| 3526 | static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = { | ||
| 3527 | { .irq = 94, }, | ||
| 3528 | }; | ||
| 3529 | |||
| 3530 | static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = { | ||
| 3531 | { .name = "tx", .dma_req = 77, }, | ||
| 3532 | { .name = "rx", .dma_req = 78, }, | ||
| 3533 | }; | ||
| 3534 | |||
| 3535 | static struct omap_hwmod_opt_clk omap34xx_mmc3_opt_clks[] = { | ||
| 3536 | { .role = "dbck", .clk = "omap_32k_fck", }, | ||
| 3537 | }; | ||
| 3538 | |||
| 3539 | static struct omap_hwmod_ocp_if *omap3xxx_mmc3_slaves[] = { | ||
| 3540 | &omap3xxx_l4_core__mmc3, | ||
| 3541 | }; | ||
| 3542 | |||
| 3543 | static struct omap_hwmod omap3xxx_mmc3_hwmod = { | ||
| 3544 | .name = "mmc3", | ||
| 3545 | .mpu_irqs = omap34xx_mmc3_mpu_irqs, | ||
| 3546 | .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc3_mpu_irqs), | ||
| 3547 | .sdma_reqs = omap34xx_mmc3_sdma_reqs, | ||
| 3548 | .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc3_sdma_reqs), | ||
| 3549 | .opt_clks = omap34xx_mmc3_opt_clks, | ||
| 3550 | .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc3_opt_clks), | ||
| 3551 | .main_clk = "mmchs3_fck", | ||
| 3552 | .prcm = { | ||
| 3553 | .omap2 = { | ||
| 3554 | .prcm_reg_id = 1, | ||
| 3555 | .module_bit = OMAP3430_EN_MMC3_SHIFT, | ||
| 3556 | .idlest_reg_id = 1, | ||
| 3557 | .idlest_idle_bit = OMAP3430_ST_MMC3_SHIFT, | ||
| 3558 | }, | ||
| 3559 | }, | ||
| 3560 | .slaves = omap3xxx_mmc3_slaves, | ||
| 3561 | .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves), | ||
| 3562 | .class = &omap34xx_mmc_class, | ||
| 3563 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
| 3564 | }; | ||
| 3565 | |||
| 2215 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | 3566 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { |
| 2216 | &omap3xxx_l3_main_hwmod, | 3567 | &omap3xxx_l3_main_hwmod, |
| 2217 | &omap3xxx_l4_core_hwmod, | 3568 | &omap3xxx_l4_core_hwmod, |
| 2218 | &omap3xxx_l4_per_hwmod, | 3569 | &omap3xxx_l4_per_hwmod, |
| 2219 | &omap3xxx_l4_wkup_hwmod, | 3570 | &omap3xxx_l4_wkup_hwmod, |
| 3571 | &omap3xxx_mmc1_hwmod, | ||
| 3572 | &omap3xxx_mmc2_hwmod, | ||
| 3573 | &omap3xxx_mmc3_hwmod, | ||
| 2220 | &omap3xxx_mpu_hwmod, | 3574 | &omap3xxx_mpu_hwmod, |
| 2221 | &omap3xxx_iva_hwmod, | 3575 | &omap3xxx_iva_hwmod, |
| 3576 | |||
| 3577 | &omap3xxx_timer1_hwmod, | ||
| 3578 | &omap3xxx_timer2_hwmod, | ||
| 3579 | &omap3xxx_timer3_hwmod, | ||
| 3580 | &omap3xxx_timer4_hwmod, | ||
| 3581 | &omap3xxx_timer5_hwmod, | ||
| 3582 | &omap3xxx_timer6_hwmod, | ||
| 3583 | &omap3xxx_timer7_hwmod, | ||
| 3584 | &omap3xxx_timer8_hwmod, | ||
| 3585 | &omap3xxx_timer9_hwmod, | ||
| 3586 | &omap3xxx_timer10_hwmod, | ||
| 3587 | &omap3xxx_timer11_hwmod, | ||
| 3588 | &omap3xxx_timer12_hwmod, | ||
| 3589 | |||
| 2222 | &omap3xxx_wd_timer2_hwmod, | 3590 | &omap3xxx_wd_timer2_hwmod, |
| 2223 | &omap3xxx_uart1_hwmod, | 3591 | &omap3xxx_uart1_hwmod, |
| 2224 | &omap3xxx_uart2_hwmod, | 3592 | &omap3xxx_uart2_hwmod, |
| @@ -2253,6 +3621,18 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
| 2253 | /* dma_system class*/ | 3621 | /* dma_system class*/ |
| 2254 | &omap3xxx_dma_system_hwmod, | 3622 | &omap3xxx_dma_system_hwmod, |
| 2255 | 3623 | ||
| 3624 | /* mcbsp class */ | ||
| 3625 | &omap3xxx_mcbsp1_hwmod, | ||
| 3626 | &omap3xxx_mcbsp2_hwmod, | ||
| 3627 | &omap3xxx_mcbsp3_hwmod, | ||
| 3628 | &omap3xxx_mcbsp4_hwmod, | ||
| 3629 | &omap3xxx_mcbsp5_hwmod, | ||
| 3630 | &omap3xxx_mcbsp2_sidetone_hwmod, | ||
| 3631 | &omap3xxx_mcbsp3_sidetone_hwmod, | ||
| 3632 | |||
| 3633 | /* mailbox class */ | ||
| 3634 | &omap3xxx_mailbox_hwmod, | ||
| 3635 | |||
| 2256 | /* mcspi class */ | 3636 | /* mcspi class */ |
| 2257 | &omap34xx_mcspi1, | 3637 | &omap34xx_mcspi1, |
| 2258 | &omap34xx_mcspi2, | 3638 | &omap34xx_mcspi2, |
| @@ -2270,5 +3650,5 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
| 2270 | 3650 | ||
| 2271 | int __init omap3xxx_hwmod_init(void) | 3651 | int __init omap3xxx_hwmod_init(void) |
| 2272 | { | 3652 | { |
| 2273 | return omap_hwmod_init(omap3xxx_hwmods); | 3653 | return omap_hwmod_register(omap3xxx_hwmods); |
| 2274 | } | 3654 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 79a860178913..3e88dd3f8ef3 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | #include <plat/gpio.h> | 25 | #include <plat/gpio.h> |
| 26 | #include <plat/dma.h> | 26 | #include <plat/dma.h> |
| 27 | #include <plat/mcspi.h> | 27 | #include <plat/mcspi.h> |
| 28 | #include <plat/mcbsp.h> | ||
| 29 | #include <plat/mmc.h> | ||
| 28 | 30 | ||
| 29 | #include "omap_hwmod_common_data.h" | 31 | #include "omap_hwmod_common_data.h" |
| 30 | 32 | ||
| @@ -262,11 +264,27 @@ static struct omap_hwmod_ocp_if omap44xx_mmc2__l3_main_1 = { | |||
| 262 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 264 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 263 | }; | 265 | }; |
| 264 | 266 | ||
| 267 | /* L3 target configuration and error log registers */ | ||
| 268 | static struct omap_hwmod_irq_info omap44xx_l3_targ_irqs[] = { | ||
| 269 | { .irq = 9 + OMAP44XX_IRQ_GIC_START }, | ||
| 270 | { .irq = 10 + OMAP44XX_IRQ_GIC_START }, | ||
| 271 | }; | ||
| 272 | |||
| 273 | static struct omap_hwmod_addr_space omap44xx_l3_main_1_addrs[] = { | ||
| 274 | { | ||
| 275 | .pa_start = 0x44000000, | ||
| 276 | .pa_end = 0x44000fff, | ||
| 277 | .flags = ADDR_TYPE_RT, | ||
| 278 | }, | ||
| 279 | }; | ||
| 280 | |||
| 265 | /* mpu -> l3_main_1 */ | 281 | /* mpu -> l3_main_1 */ |
| 266 | static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = { | 282 | static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = { |
| 267 | .master = &omap44xx_mpu_hwmod, | 283 | .master = &omap44xx_mpu_hwmod, |
| 268 | .slave = &omap44xx_l3_main_1_hwmod, | 284 | .slave = &omap44xx_l3_main_1_hwmod, |
| 269 | .clk = "l3_div_ck", | 285 | .clk = "l3_div_ck", |
| 286 | .addr = omap44xx_l3_main_1_addrs, | ||
| 287 | .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_1_addrs), | ||
| 270 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 288 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 271 | }; | 289 | }; |
| 272 | 290 | ||
| @@ -284,6 +302,8 @@ static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { | |||
| 284 | static struct omap_hwmod omap44xx_l3_main_1_hwmod = { | 302 | static struct omap_hwmod omap44xx_l3_main_1_hwmod = { |
| 285 | .name = "l3_main_1", | 303 | .name = "l3_main_1", |
| 286 | .class = &omap44xx_l3_hwmod_class, | 304 | .class = &omap44xx_l3_hwmod_class, |
| 305 | .mpu_irqs = omap44xx_l3_targ_irqs, | ||
| 306 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_l3_targ_irqs), | ||
| 287 | .slaves = omap44xx_l3_main_1_slaves, | 307 | .slaves = omap44xx_l3_main_1_slaves, |
| 288 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), | 308 | .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), |
| 289 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 309 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
| @@ -330,11 +350,21 @@ static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = { | |||
| 330 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 350 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 331 | }; | 351 | }; |
| 332 | 352 | ||
| 353 | static struct omap_hwmod_addr_space omap44xx_l3_main_2_addrs[] = { | ||
| 354 | { | ||
| 355 | .pa_start = 0x44800000, | ||
| 356 | .pa_end = 0x44801fff, | ||
| 357 | .flags = ADDR_TYPE_RT, | ||
| 358 | }, | ||
| 359 | }; | ||
| 360 | |||
| 333 | /* l3_main_1 -> l3_main_2 */ | 361 | /* l3_main_1 -> l3_main_2 */ |
| 334 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { | 362 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { |
| 335 | .master = &omap44xx_l3_main_1_hwmod, | 363 | .master = &omap44xx_l3_main_1_hwmod, |
| 336 | .slave = &omap44xx_l3_main_2_hwmod, | 364 | .slave = &omap44xx_l3_main_2_hwmod, |
| 337 | .clk = "l3_div_ck", | 365 | .clk = "l3_div_ck", |
| 366 | .addr = omap44xx_l3_main_2_addrs, | ||
| 367 | .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_2_addrs), | ||
| 338 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 368 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 339 | }; | 369 | }; |
| 340 | 370 | ||
| @@ -375,11 +405,21 @@ static struct omap_hwmod omap44xx_l3_main_2_hwmod = { | |||
| 375 | }; | 405 | }; |
| 376 | 406 | ||
| 377 | /* l3_main_3 interface data */ | 407 | /* l3_main_3 interface data */ |
| 408 | static struct omap_hwmod_addr_space omap44xx_l3_main_3_addrs[] = { | ||
| 409 | { | ||
| 410 | .pa_start = 0x45000000, | ||
| 411 | .pa_end = 0x45000fff, | ||
| 412 | .flags = ADDR_TYPE_RT, | ||
| 413 | }, | ||
| 414 | }; | ||
| 415 | |||
| 378 | /* l3_main_1 -> l3_main_3 */ | 416 | /* l3_main_1 -> l3_main_3 */ |
| 379 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = { | 417 | static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = { |
| 380 | .master = &omap44xx_l3_main_1_hwmod, | 418 | .master = &omap44xx_l3_main_1_hwmod, |
| 381 | .slave = &omap44xx_l3_main_3_hwmod, | 419 | .slave = &omap44xx_l3_main_3_hwmod, |
| 382 | .clk = "l3_div_ck", | 420 | .clk = "l3_div_ck", |
| 421 | .addr = omap44xx_l3_main_3_addrs, | ||
| 422 | .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_3_addrs), | ||
| 383 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 423 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
| 384 | }; | 424 | }; |
| 385 | 425 | ||
| @@ -2737,6 +2777,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_mcbsp_sysc = { | |||
| 2737 | static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = { | 2777 | static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = { |
| 2738 | .name = "mcbsp", | 2778 | .name = "mcbsp", |
| 2739 | .sysc = &omap44xx_mcbsp_sysc, | 2779 | .sysc = &omap44xx_mcbsp_sysc, |
| 2780 | .rev = MCBSP_CONFIG_TYPE4, | ||
| 2740 | }; | 2781 | }; |
| 2741 | 2782 | ||
| 2742 | /* mcbsp1 */ | 2783 | /* mcbsp1 */ |
| @@ -2752,6 +2793,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = { | |||
| 2752 | 2793 | ||
| 2753 | static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = { | 2794 | static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = { |
| 2754 | { | 2795 | { |
| 2796 | .name = "mpu", | ||
| 2755 | .pa_start = 0x40122000, | 2797 | .pa_start = 0x40122000, |
| 2756 | .pa_end = 0x401220ff, | 2798 | .pa_end = 0x401220ff, |
| 2757 | .flags = ADDR_TYPE_RT | 2799 | .flags = ADDR_TYPE_RT |
| @@ -2770,6 +2812,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1 = { | |||
| 2770 | 2812 | ||
| 2771 | static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = { | 2813 | static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = { |
| 2772 | { | 2814 | { |
| 2815 | .name = "dma", | ||
| 2773 | .pa_start = 0x49022000, | 2816 | .pa_start = 0x49022000, |
| 2774 | .pa_end = 0x490220ff, | 2817 | .pa_end = 0x490220ff, |
| 2775 | .flags = ADDR_TYPE_RT | 2818 | .flags = ADDR_TYPE_RT |
| @@ -2823,6 +2866,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = { | |||
| 2823 | 2866 | ||
| 2824 | static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = { | 2867 | static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = { |
| 2825 | { | 2868 | { |
| 2869 | .name = "mpu", | ||
| 2826 | .pa_start = 0x40124000, | 2870 | .pa_start = 0x40124000, |
| 2827 | .pa_end = 0x401240ff, | 2871 | .pa_end = 0x401240ff, |
| 2828 | .flags = ADDR_TYPE_RT | 2872 | .flags = ADDR_TYPE_RT |
| @@ -2841,6 +2885,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2 = { | |||
| 2841 | 2885 | ||
| 2842 | static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = { | 2886 | static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = { |
| 2843 | { | 2887 | { |
| 2888 | .name = "dma", | ||
| 2844 | .pa_start = 0x49024000, | 2889 | .pa_start = 0x49024000, |
| 2845 | .pa_end = 0x490240ff, | 2890 | .pa_end = 0x490240ff, |
| 2846 | .flags = ADDR_TYPE_RT | 2891 | .flags = ADDR_TYPE_RT |
| @@ -2894,6 +2939,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = { | |||
| 2894 | 2939 | ||
| 2895 | static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = { | 2940 | static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = { |
| 2896 | { | 2941 | { |
| 2942 | .name = "mpu", | ||
| 2897 | .pa_start = 0x40126000, | 2943 | .pa_start = 0x40126000, |
| 2898 | .pa_end = 0x401260ff, | 2944 | .pa_end = 0x401260ff, |
| 2899 | .flags = ADDR_TYPE_RT | 2945 | .flags = ADDR_TYPE_RT |
| @@ -2912,6 +2958,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3 = { | |||
| 2912 | 2958 | ||
| 2913 | static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = { | 2959 | static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = { |
| 2914 | { | 2960 | { |
| 2961 | .name = "dma", | ||
| 2915 | .pa_start = 0x49026000, | 2962 | .pa_start = 0x49026000, |
| 2916 | .pa_end = 0x490260ff, | 2963 | .pa_end = 0x490260ff, |
| 2917 | .flags = ADDR_TYPE_RT | 2964 | .flags = ADDR_TYPE_RT |
| @@ -3383,6 +3430,7 @@ static struct omap_hwmod_class omap44xx_mmc_hwmod_class = { | |||
| 3383 | }; | 3430 | }; |
| 3384 | 3431 | ||
| 3385 | /* mmc1 */ | 3432 | /* mmc1 */ |
| 3433 | |||
| 3386 | static struct omap_hwmod_irq_info omap44xx_mmc1_irqs[] = { | 3434 | static struct omap_hwmod_irq_info omap44xx_mmc1_irqs[] = { |
| 3387 | { .irq = 83 + OMAP44XX_IRQ_GIC_START }, | 3435 | { .irq = 83 + OMAP44XX_IRQ_GIC_START }, |
| 3388 | }; | 3436 | }; |
| @@ -3420,6 +3468,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mmc1_slaves[] = { | |||
| 3420 | &omap44xx_l4_per__mmc1, | 3468 | &omap44xx_l4_per__mmc1, |
| 3421 | }; | 3469 | }; |
| 3422 | 3470 | ||
| 3471 | /* mmc1 dev_attr */ | ||
| 3472 | static struct omap_mmc_dev_attr mmc1_dev_attr = { | ||
| 3473 | .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, | ||
| 3474 | }; | ||
| 3475 | |||
| 3423 | static struct omap_hwmod omap44xx_mmc1_hwmod = { | 3476 | static struct omap_hwmod omap44xx_mmc1_hwmod = { |
| 3424 | .name = "mmc1", | 3477 | .name = "mmc1", |
| 3425 | .class = &omap44xx_mmc_hwmod_class, | 3478 | .class = &omap44xx_mmc_hwmod_class, |
| @@ -3433,6 +3486,7 @@ static struct omap_hwmod omap44xx_mmc1_hwmod = { | |||
| 3433 | .clkctrl_reg = OMAP4430_CM_L3INIT_MMC1_CLKCTRL, | 3486 | .clkctrl_reg = OMAP4430_CM_L3INIT_MMC1_CLKCTRL, |
| 3434 | }, | 3487 | }, |
| 3435 | }, | 3488 | }, |
| 3489 | .dev_attr = &mmc1_dev_attr, | ||
| 3436 | .slaves = omap44xx_mmc1_slaves, | 3490 | .slaves = omap44xx_mmc1_slaves, |
| 3437 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves), | 3491 | .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves), |
| 3438 | .masters = omap44xx_mmc1_masters, | 3492 | .masters = omap44xx_mmc1_masters, |
| @@ -3989,7 +4043,6 @@ static struct omap_hwmod_ocp_if *omap44xx_timer1_slaves[] = { | |||
| 3989 | static struct omap_hwmod omap44xx_timer1_hwmod = { | 4043 | static struct omap_hwmod omap44xx_timer1_hwmod = { |
| 3990 | .name = "timer1", | 4044 | .name = "timer1", |
| 3991 | .class = &omap44xx_timer_1ms_hwmod_class, | 4045 | .class = &omap44xx_timer_1ms_hwmod_class, |
| 3992 | .flags = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET, | ||
| 3993 | .mpu_irqs = omap44xx_timer1_irqs, | 4046 | .mpu_irqs = omap44xx_timer1_irqs, |
| 3994 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer1_irqs), | 4047 | .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer1_irqs), |
| 3995 | .main_clk = "timer1_fck", | 4048 | .main_clk = "timer1_fck", |
| @@ -5077,11 +5130,11 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | |||
| 5077 | &omap44xx_mcspi4_hwmod, | 5130 | &omap44xx_mcspi4_hwmod, |
| 5078 | 5131 | ||
| 5079 | /* mmc class */ | 5132 | /* mmc class */ |
| 5080 | /* &omap44xx_mmc1_hwmod, */ | 5133 | &omap44xx_mmc1_hwmod, |
| 5081 | /* &omap44xx_mmc2_hwmod, */ | 5134 | &omap44xx_mmc2_hwmod, |
| 5082 | /* &omap44xx_mmc3_hwmod, */ | 5135 | &omap44xx_mmc3_hwmod, |
| 5083 | /* &omap44xx_mmc4_hwmod, */ | 5136 | &omap44xx_mmc4_hwmod, |
| 5084 | /* &omap44xx_mmc5_hwmod, */ | 5137 | &omap44xx_mmc5_hwmod, |
| 5085 | 5138 | ||
| 5086 | /* mpu class */ | 5139 | /* mpu class */ |
| 5087 | &omap44xx_mpu_hwmod, | 5140 | &omap44xx_mpu_hwmod, |
| @@ -5125,6 +5178,6 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { | |||
| 5125 | 5178 | ||
| 5126 | int __init omap44xx_hwmod_init(void) | 5179 | int __init omap44xx_hwmod_init(void) |
| 5127 | { | 5180 | { |
| 5128 | return omap_hwmod_init(omap44xx_hwmods); | 5181 | return omap_hwmod_register(omap44xx_hwmods); |
| 5129 | } | 5182 | } |
| 5130 | 5183 | ||
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c new file mode 100644 index 000000000000..82632c24076f --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_noc.c | |||
| @@ -0,0 +1,253 @@ | |||
| 1 | /* | ||
| 2 | * OMAP4XXX L3 Interconnect error handling driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Corporation | ||
| 5 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 6 | * Sricharan <r.sricharan@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
| 21 | * USA | ||
| 22 | */ | ||
| 23 | #include <linux/init.h> | ||
| 24 | #include <linux/io.h> | ||
| 25 | #include <linux/platform_device.h> | ||
| 26 | #include <linux/interrupt.h> | ||
| 27 | #include <linux/kernel.h> | ||
| 28 | #include <linux/slab.h> | ||
| 29 | |||
| 30 | #include "omap_l3_noc.h" | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Interrupt Handler for L3 error detection. | ||
| 34 | * 1) Identify the L3 clockdomain partition to which the error belongs to. | ||
| 35 | * 2) Identify the slave where the error information is logged | ||
| 36 | * 3) Print the logged information. | ||
| 37 | * 4) Add dump stack to provide kernel trace. | ||
| 38 | * | ||
| 39 | * Two Types of errors : | ||
| 40 | * 1) Custom errors in L3 : | ||
| 41 | * Target like DMM/FW/EMIF generates SRESP=ERR error | ||
| 42 | * 2) Standard L3 error: | ||
| 43 | * - Unsupported CMD. | ||
| 44 | * L3 tries to access target while it is idle | ||
| 45 | * - OCP disconnect. | ||
| 46 | * - Address hole error: | ||
| 47 | * If DSS/ISS/FDIF/USBHOSTFS access a target where they | ||
| 48 | * do not have connectivity, the error is logged in | ||
| 49 | * their default target which is DMM2. | ||
| 50 | * | ||
| 51 | * On High Secure devices, firewall errors are possible and those | ||
| 52 | * can be trapped as well. But the trapping is implemented as part | ||
| 53 | * secure software and hence need not be implemented here. | ||
| 54 | */ | ||
| 55 | static irqreturn_t l3_interrupt_handler(int irq, void *_l3) | ||
| 56 | { | ||
| 57 | |||
| 58 | struct omap4_l3 *l3 = _l3; | ||
| 59 | int inttype, i, j; | ||
| 60 | int err_src = 0; | ||
| 61 | u32 std_err_main_addr, std_err_main, err_reg; | ||
| 62 | u32 base, slave_addr, clear; | ||
| 63 | char *source_name; | ||
| 64 | |||
| 65 | /* Get the Type of interrupt */ | ||
| 66 | if (irq == l3->app_irq) | ||
| 67 | inttype = L3_APPLICATION_ERROR; | ||
| 68 | else | ||
| 69 | inttype = L3_DEBUG_ERROR; | ||
| 70 | |||
| 71 | for (i = 0; i < L3_MODULES; i++) { | ||
| 72 | /* | ||
| 73 | * Read the regerr register of the clock domain | ||
| 74 | * to determine the source | ||
| 75 | */ | ||
| 76 | base = (u32)l3->l3_base[i]; | ||
| 77 | err_reg = readl(base + l3_flagmux[i] + (inttype << 3)); | ||
| 78 | |||
| 79 | /* Get the corresponding error and analyse */ | ||
| 80 | if (err_reg) { | ||
| 81 | /* Identify the source from control status register */ | ||
| 82 | for (j = 0; !(err_reg & (1 << j)); j++) | ||
| 83 | ; | ||
| 84 | |||
| 85 | err_src = j; | ||
| 86 | /* Read the stderrlog_main_source from clk domain */ | ||
| 87 | std_err_main_addr = base + (*(l3_targ[i] + err_src)); | ||
| 88 | std_err_main = readl(std_err_main_addr); | ||
| 89 | |||
| 90 | switch ((std_err_main & CUSTOM_ERROR)) { | ||
| 91 | case STANDARD_ERROR: | ||
| 92 | source_name = | ||
| 93 | l3_targ_stderrlog_main_name[i][err_src]; | ||
| 94 | |||
| 95 | slave_addr = std_err_main_addr + | ||
| 96 | L3_SLAVE_ADDRESS_OFFSET; | ||
| 97 | WARN(true, "L3 standard error: SOURCE:%s at address 0x%x\n", | ||
| 98 | source_name, readl(slave_addr)); | ||
| 99 | /* clear the std error log*/ | ||
| 100 | clear = std_err_main | CLEAR_STDERR_LOG; | ||
| 101 | writel(clear, std_err_main_addr); | ||
| 102 | break; | ||
| 103 | |||
| 104 | case CUSTOM_ERROR: | ||
| 105 | source_name = | ||
| 106 | l3_targ_stderrlog_main_name[i][err_src]; | ||
| 107 | |||
| 108 | WARN(true, "CUSTOM SRESP error with SOURCE:%s\n", | ||
| 109 | source_name); | ||
| 110 | /* clear the std error log*/ | ||
| 111 | clear = std_err_main | CLEAR_STDERR_LOG; | ||
| 112 | writel(clear, std_err_main_addr); | ||
| 113 | break; | ||
| 114 | |||
| 115 | default: | ||
| 116 | /* Nothing to be handled here as of now */ | ||
| 117 | break; | ||
| 118 | } | ||
| 119 | /* Error found so break the for loop */ | ||
| 120 | break; | ||
| 121 | } | ||
| 122 | } | ||
| 123 | return IRQ_HANDLED; | ||
| 124 | } | ||
| 125 | |||
| 126 | static int __init omap4_l3_probe(struct platform_device *pdev) | ||
| 127 | { | ||
| 128 | static struct omap4_l3 *l3; | ||
| 129 | struct resource *res; | ||
| 130 | int ret; | ||
| 131 | int irq; | ||
| 132 | |||
| 133 | l3 = kzalloc(sizeof(*l3), GFP_KERNEL); | ||
| 134 | if (!l3) | ||
| 135 | ret = -ENOMEM; | ||
| 136 | |||
| 137 | platform_set_drvdata(pdev, l3); | ||
| 138 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 139 | if (!res) { | ||
| 140 | dev_err(&pdev->dev, "couldn't find resource 0\n"); | ||
| 141 | ret = -ENODEV; | ||
| 142 | goto err1; | ||
| 143 | } | ||
| 144 | |||
| 145 | l3->l3_base[0] = ioremap(res->start, resource_size(res)); | ||
| 146 | if (!(l3->l3_base[0])) { | ||
| 147 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
| 148 | ret = -ENOMEM; | ||
| 149 | goto err2; | ||
| 150 | } | ||
| 151 | |||
| 152 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | ||
| 153 | if (!res) { | ||
| 154 | dev_err(&pdev->dev, "couldn't find resource 1\n"); | ||
| 155 | ret = -ENODEV; | ||
| 156 | goto err3; | ||
| 157 | } | ||
| 158 | |||
| 159 | l3->l3_base[1] = ioremap(res->start, resource_size(res)); | ||
| 160 | if (!(l3->l3_base[1])) { | ||
| 161 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
| 162 | ret = -ENOMEM; | ||
| 163 | goto err4; | ||
| 164 | } | ||
| 165 | |||
| 166 | res = platform_get_resource(pdev, IORESOURCE_MEM, 2); | ||
| 167 | if (!res) { | ||
| 168 | dev_err(&pdev->dev, "couldn't find resource 2\n"); | ||
| 169 | ret = -ENODEV; | ||
| 170 | goto err5; | ||
| 171 | } | ||
| 172 | |||
| 173 | l3->l3_base[2] = ioremap(res->start, resource_size(res)); | ||
| 174 | if (!(l3->l3_base[2])) { | ||
| 175 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
| 176 | ret = -ENOMEM; | ||
| 177 | goto err6; | ||
| 178 | } | ||
| 179 | |||
| 180 | /* | ||
| 181 | * Setup interrupt Handlers | ||
| 182 | */ | ||
| 183 | irq = platform_get_irq(pdev, 0); | ||
| 184 | ret = request_irq(irq, | ||
| 185 | l3_interrupt_handler, | ||
| 186 | IRQF_DISABLED, "l3-dbg-irq", l3); | ||
| 187 | if (ret) { | ||
| 188 | pr_crit("L3: request_irq failed to register for 0x%x\n", | ||
| 189 | OMAP44XX_IRQ_L3_DBG); | ||
| 190 | goto err7; | ||
| 191 | } | ||
| 192 | l3->debug_irq = irq; | ||
| 193 | |||
| 194 | irq = platform_get_irq(pdev, 1); | ||
| 195 | ret = request_irq(irq, | ||
| 196 | l3_interrupt_handler, | ||
| 197 | IRQF_DISABLED, "l3-app-irq", l3); | ||
| 198 | if (ret) { | ||
| 199 | pr_crit("L3: request_irq failed to register for 0x%x\n", | ||
| 200 | OMAP44XX_IRQ_L3_APP); | ||
| 201 | goto err8; | ||
| 202 | } | ||
| 203 | l3->app_irq = irq; | ||
| 204 | |||
| 205 | goto err0; | ||
| 206 | err8: | ||
| 207 | err7: | ||
| 208 | iounmap(l3->l3_base[2]); | ||
| 209 | err6: | ||
| 210 | err5: | ||
| 211 | iounmap(l3->l3_base[1]); | ||
| 212 | err4: | ||
| 213 | err3: | ||
| 214 | iounmap(l3->l3_base[0]); | ||
| 215 | err2: | ||
| 216 | err1: | ||
| 217 | kfree(l3); | ||
| 218 | err0: | ||
| 219 | return ret; | ||
| 220 | } | ||
| 221 | |||
| 222 | static int __exit omap4_l3_remove(struct platform_device *pdev) | ||
| 223 | { | ||
| 224 | struct omap4_l3 *l3 = platform_get_drvdata(pdev); | ||
| 225 | |||
| 226 | free_irq(l3->app_irq, l3); | ||
| 227 | free_irq(l3->debug_irq, l3); | ||
| 228 | iounmap(l3->l3_base[0]); | ||
| 229 | iounmap(l3->l3_base[1]); | ||
| 230 | iounmap(l3->l3_base[2]); | ||
| 231 | kfree(l3); | ||
| 232 | |||
| 233 | return 0; | ||
| 234 | } | ||
| 235 | |||
| 236 | static struct platform_driver omap4_l3_driver = { | ||
| 237 | .remove = __exit_p(omap4_l3_remove), | ||
| 238 | .driver = { | ||
| 239 | .name = "omap_l3_noc", | ||
| 240 | }, | ||
| 241 | }; | ||
| 242 | |||
| 243 | static int __init omap4_l3_init(void) | ||
| 244 | { | ||
| 245 | return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe); | ||
| 246 | } | ||
| 247 | postcore_initcall_sync(omap4_l3_init); | ||
| 248 | |||
| 249 | static void __exit omap4_l3_exit(void) | ||
| 250 | { | ||
| 251 | platform_driver_unregister(&omap4_l3_driver); | ||
| 252 | } | ||
| 253 | module_exit(omap4_l3_exit); | ||
diff --git a/arch/arm/mach-omap2/omap_l3_noc.h b/arch/arm/mach-omap2/omap_l3_noc.h new file mode 100644 index 000000000000..359b83348aed --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_noc.h | |||
| @@ -0,0 +1,132 @@ | |||
| 1 | /* | ||
| 2 | * OMAP4XXX L3 Interconnect error handling driver header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Corporation | ||
| 5 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 6 | * sricharan <r.sricharan@ti.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
| 21 | * USA | ||
| 22 | */ | ||
| 23 | #ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
| 24 | #define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
| 25 | |||
| 26 | /* | ||
| 27 | * L3 register offsets | ||
| 28 | */ | ||
| 29 | #define L3_MODULES 3 | ||
| 30 | #define CLEAR_STDERR_LOG (1 << 31) | ||
| 31 | #define CUSTOM_ERROR 0x2 | ||
| 32 | #define STANDARD_ERROR 0x0 | ||
| 33 | #define INBAND_ERROR 0x0 | ||
| 34 | #define EMIF_KERRLOG_OFFSET 0x10 | ||
| 35 | #define L3_SLAVE_ADDRESS_OFFSET 0x14 | ||
| 36 | #define LOGICAL_ADDR_ERRORLOG 0x4 | ||
| 37 | #define L3_APPLICATION_ERROR 0x0 | ||
| 38 | #define L3_DEBUG_ERROR 0x1 | ||
| 39 | |||
| 40 | u32 l3_flagmux[L3_MODULES] = { | ||
| 41 | 0x50C, | ||
| 42 | 0x100C, | ||
| 43 | 0X020C | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* | ||
| 47 | * L3 Target standard Error register offsets | ||
| 48 | */ | ||
| 49 | u32 l3_targ_stderrlog_main_clk1[] = { | ||
| 50 | 0x148, /* DMM1 */ | ||
| 51 | 0x248, /* DMM2 */ | ||
| 52 | 0x348, /* ABE */ | ||
| 53 | 0x448, /* L4CFG */ | ||
| 54 | 0x648 /* CLK2 PWR DISC */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | u32 l3_targ_stderrlog_main_clk2[] = { | ||
| 58 | 0x548, /* CORTEX M3 */ | ||
| 59 | 0x348, /* DSS */ | ||
| 60 | 0x148, /* GPMC */ | ||
| 61 | 0x448, /* ISS */ | ||
| 62 | 0x748, /* IVAHD */ | ||
| 63 | 0xD48, /* missing in TRM corresponds to AES1*/ | ||
| 64 | 0x948, /* L4 PER0*/ | ||
| 65 | 0x248, /* OCMRAM */ | ||
| 66 | 0x148, /* missing in TRM corresponds to GPMC sERROR*/ | ||
| 67 | 0x648, /* SGX */ | ||
| 68 | 0x848, /* SL2 */ | ||
| 69 | 0x1648, /* C2C */ | ||
| 70 | 0x1148, /* missing in TRM corresponds PWR DISC CLK1*/ | ||
| 71 | 0xF48, /* missing in TRM corrsponds to SHA1*/ | ||
| 72 | 0xE48, /* missing in TRM corresponds to AES2*/ | ||
| 73 | 0xC48, /* L4 PER3 */ | ||
| 74 | 0xA48, /* L4 PER1*/ | ||
| 75 | 0xB48 /* L4 PER2*/ | ||
| 76 | }; | ||
| 77 | |||
| 78 | u32 l3_targ_stderrlog_main_clk3[] = { | ||
| 79 | 0x0148 /* EMUSS */ | ||
| 80 | }; | ||
| 81 | |||
| 82 | char *l3_targ_stderrlog_main_name[L3_MODULES][18] = { | ||
| 83 | { | ||
| 84 | "DMM1", | ||
| 85 | "DMM2", | ||
| 86 | "ABE", | ||
| 87 | "L4CFG", | ||
| 88 | "CLK2 PWR DISC", | ||
| 89 | }, | ||
| 90 | { | ||
| 91 | "CORTEX M3" , | ||
| 92 | "DSS ", | ||
| 93 | "GPMC ", | ||
| 94 | "ISS ", | ||
| 95 | "IVAHD ", | ||
| 96 | "AES1", | ||
| 97 | "L4 PER0", | ||
| 98 | "OCMRAM ", | ||
| 99 | "GPMC sERROR", | ||
| 100 | "SGX ", | ||
| 101 | "SL2 ", | ||
| 102 | "C2C ", | ||
| 103 | "PWR DISC CLK1", | ||
| 104 | "SHA1", | ||
| 105 | "AES2", | ||
| 106 | "L4 PER3", | ||
| 107 | "L4 PER1", | ||
| 108 | "L4 PER2", | ||
| 109 | }, | ||
| 110 | { | ||
| 111 | "EMUSS", | ||
| 112 | }, | ||
| 113 | }; | ||
| 114 | |||
| 115 | u32 *l3_targ[L3_MODULES] = { | ||
| 116 | l3_targ_stderrlog_main_clk1, | ||
| 117 | l3_targ_stderrlog_main_clk2, | ||
| 118 | l3_targ_stderrlog_main_clk3, | ||
| 119 | }; | ||
| 120 | |||
| 121 | struct omap4_l3 { | ||
| 122 | struct device *dev; | ||
| 123 | struct clk *ick; | ||
| 124 | |||
| 125 | /* memory base */ | ||
| 126 | void __iomem *l3_base[4]; | ||
| 127 | |||
| 128 | int debug_irq; | ||
| 129 | int app_irq; | ||
| 130 | }; | ||
| 131 | |||
| 132 | #endif | ||
diff --git a/arch/arm/mach-omap2/omap_l3_smx.c b/arch/arm/mach-omap2/omap_l3_smx.c new file mode 100644 index 000000000000..265bff3acb9e --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_smx.c | |||
| @@ -0,0 +1,314 @@ | |||
| 1 | /* | ||
| 2 | * OMAP3XXX L3 Interconnect Driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Corporation | ||
| 5 | * Felipe Balbi <balbi@ti.com> | ||
| 6 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 7 | * Sricharan <r.sricharan@ti.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
| 22 | * USA | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include <linux/kernel.h> | ||
| 26 | #include <linux/slab.h> | ||
| 27 | #include <linux/platform_device.h> | ||
| 28 | #include <linux/interrupt.h> | ||
| 29 | #include <linux/io.h> | ||
| 30 | #include "omap_l3_smx.h" | ||
| 31 | |||
| 32 | static inline u64 omap3_l3_readll(void __iomem *base, u16 reg) | ||
| 33 | { | ||
| 34 | return __raw_readll(base + reg); | ||
| 35 | } | ||
| 36 | |||
| 37 | static inline void omap3_l3_writell(void __iomem *base, u16 reg, u64 value) | ||
| 38 | { | ||
| 39 | __raw_writell(value, base + reg); | ||
| 40 | } | ||
| 41 | |||
| 42 | static inline enum omap3_l3_code omap3_l3_decode_error_code(u64 error) | ||
| 43 | { | ||
| 44 | return (error & 0x0f000000) >> L3_ERROR_LOG_CODE; | ||
| 45 | } | ||
| 46 | |||
| 47 | static inline u32 omap3_l3_decode_addr(u64 error_addr) | ||
| 48 | { | ||
| 49 | return error_addr & 0xffffffff; | ||
| 50 | } | ||
| 51 | |||
| 52 | static inline unsigned omap3_l3_decode_cmd(u64 error) | ||
| 53 | { | ||
| 54 | return (error & 0x07) >> L3_ERROR_LOG_CMD; | ||
| 55 | } | ||
| 56 | |||
| 57 | static inline enum omap3_l3_initiator_id omap3_l3_decode_initid(u64 error) | ||
| 58 | { | ||
| 59 | return (error & 0xff00) >> L3_ERROR_LOG_INITID; | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline unsigned omap3_l3_decode_req_info(u64 error) | ||
| 63 | { | ||
| 64 | return (error >> 32) & 0xffff; | ||
| 65 | } | ||
| 66 | |||
| 67 | static char *omap3_l3_code_string(u8 code) | ||
| 68 | { | ||
| 69 | switch (code) { | ||
| 70 | case OMAP_L3_CODE_NOERROR: | ||
| 71 | return "No Error"; | ||
| 72 | case OMAP_L3_CODE_UNSUP_CMD: | ||
| 73 | return "Unsupported Command"; | ||
| 74 | case OMAP_L3_CODE_ADDR_HOLE: | ||
| 75 | return "Address Hole"; | ||
| 76 | case OMAP_L3_CODE_PROTECT_VIOLATION: | ||
| 77 | return "Protection Violation"; | ||
| 78 | case OMAP_L3_CODE_IN_BAND_ERR: | ||
| 79 | return "In-band Error"; | ||
| 80 | case OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT: | ||
| 81 | return "Request Timeout Not Accepted"; | ||
| 82 | case OMAP_L3_CODE_REQ_TOUT_NO_RESP: | ||
| 83 | return "Request Timeout, no response"; | ||
| 84 | default: | ||
| 85 | return "UNKNOWN error"; | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | static char *omap3_l3_initiator_string(u8 initid) | ||
| 90 | { | ||
| 91 | switch (initid) { | ||
| 92 | case OMAP_L3_LCD: | ||
| 93 | return "LCD"; | ||
| 94 | case OMAP_L3_SAD2D: | ||
| 95 | return "SAD2D"; | ||
| 96 | case OMAP_L3_IA_MPU_SS_1: | ||
| 97 | case OMAP_L3_IA_MPU_SS_2: | ||
| 98 | case OMAP_L3_IA_MPU_SS_3: | ||
| 99 | case OMAP_L3_IA_MPU_SS_4: | ||
| 100 | case OMAP_L3_IA_MPU_SS_5: | ||
| 101 | return "MPU"; | ||
| 102 | case OMAP_L3_IA_IVA_SS_1: | ||
| 103 | case OMAP_L3_IA_IVA_SS_2: | ||
| 104 | case OMAP_L3_IA_IVA_SS_3: | ||
| 105 | return "IVA_SS"; | ||
| 106 | case OMAP_L3_IA_IVA_SS_DMA_1: | ||
| 107 | case OMAP_L3_IA_IVA_SS_DMA_2: | ||
| 108 | case OMAP_L3_IA_IVA_SS_DMA_3: | ||
| 109 | case OMAP_L3_IA_IVA_SS_DMA_4: | ||
| 110 | case OMAP_L3_IA_IVA_SS_DMA_5: | ||
| 111 | case OMAP_L3_IA_IVA_SS_DMA_6: | ||
| 112 | return "IVA_SS_DMA"; | ||
| 113 | case OMAP_L3_IA_SGX: | ||
| 114 | return "SGX"; | ||
| 115 | case OMAP_L3_IA_CAM_1: | ||
| 116 | case OMAP_L3_IA_CAM_2: | ||
| 117 | case OMAP_L3_IA_CAM_3: | ||
| 118 | return "CAM"; | ||
| 119 | case OMAP_L3_IA_DAP: | ||
| 120 | return "DAP"; | ||
| 121 | case OMAP_L3_SDMA_WR_1: | ||
| 122 | case OMAP_L3_SDMA_WR_2: | ||
| 123 | return "SDMA_WR"; | ||
| 124 | case OMAP_L3_SDMA_RD_1: | ||
| 125 | case OMAP_L3_SDMA_RD_2: | ||
| 126 | case OMAP_L3_SDMA_RD_3: | ||
| 127 | case OMAP_L3_SDMA_RD_4: | ||
| 128 | return "SDMA_RD"; | ||
| 129 | case OMAP_L3_USBOTG: | ||
| 130 | return "USB_OTG"; | ||
| 131 | case OMAP_L3_USBHOST: | ||
| 132 | return "USB_HOST"; | ||
| 133 | default: | ||
| 134 | return "UNKNOWN Initiator"; | ||
| 135 | } | ||
| 136 | } | ||
| 137 | |||
| 138 | /** | ||
| 139 | * omap3_l3_block_irq - handles a register block's irq | ||
| 140 | * @l3: struct omap3_l3 * | ||
| 141 | * @base: register block base address | ||
| 142 | * @error: L3_ERROR_LOG register of our block | ||
| 143 | * | ||
| 144 | * Called in hard-irq context. Caller should take care of locking | ||
| 145 | * | ||
| 146 | * OMAP36xx TRM gives, on page 2001, Figure 9-10, the Typical Error | ||
| 147 | * Analysis Sequence, we are following that sequence here, please | ||
| 148 | * refer to that Figure for more information on the subject. | ||
| 149 | */ | ||
| 150 | static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3, | ||
| 151 | u64 error, int error_addr) | ||
| 152 | { | ||
| 153 | u8 code = omap3_l3_decode_error_code(error); | ||
| 154 | u8 initid = omap3_l3_decode_initid(error); | ||
| 155 | u8 multi = error & L3_ERROR_LOG_MULTI; | ||
| 156 | u32 address = omap3_l3_decode_addr(error_addr); | ||
| 157 | |||
| 158 | WARN(true, "%s Error seen by %s %s at address %x\n", | ||
| 159 | omap3_l3_code_string(code), | ||
| 160 | omap3_l3_initiator_string(initid), | ||
| 161 | multi ? "Multiple Errors" : "", | ||
| 162 | address); | ||
| 163 | |||
| 164 | return IRQ_HANDLED; | ||
| 165 | } | ||
| 166 | |||
| 167 | static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) | ||
| 168 | { | ||
| 169 | struct omap3_l3 *l3 = _l3; | ||
| 170 | |||
| 171 | u64 status, clear; | ||
| 172 | u64 error; | ||
| 173 | u64 error_addr; | ||
| 174 | u64 err_source = 0; | ||
| 175 | void __iomem *base; | ||
| 176 | int int_type; | ||
| 177 | |||
| 178 | irqreturn_t ret = IRQ_NONE; | ||
| 179 | |||
| 180 | if (irq == l3->app_irq) | ||
| 181 | int_type = L3_APPLICATION_ERROR; | ||
| 182 | else | ||
| 183 | int_type = L3_DEBUG_ERROR; | ||
| 184 | |||
| 185 | if (!int_type) { | ||
| 186 | status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0); | ||
| 187 | /* | ||
| 188 | * if we have a timeout error, there's nothing we can | ||
| 189 | * do besides rebooting the board. So let's BUG on any | ||
| 190 | * of such errors and handle the others. timeout error | ||
| 191 | * is severe and not expected to occur. | ||
| 192 | */ | ||
| 193 | BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK); | ||
| 194 | } else { | ||
| 195 | status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1); | ||
| 196 | /* No timeout error for debug sources */ | ||
| 197 | } | ||
| 198 | |||
| 199 | base = ((l3->rt) + (*(omap3_l3_bases[int_type] + err_source))); | ||
| 200 | |||
| 201 | /* identify the error source */ | ||
| 202 | for (err_source = 0; !(status & (1 << err_source)); err_source++) | ||
| 203 | ; | ||
| 204 | error = omap3_l3_readll(base, L3_ERROR_LOG); | ||
| 205 | |||
| 206 | if (error) { | ||
| 207 | error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR); | ||
| 208 | |||
| 209 | ret |= omap3_l3_block_irq(l3, error, error_addr); | ||
| 210 | } | ||
| 211 | |||
| 212 | /* Clear the status register */ | ||
| 213 | clear = ((L3_AGENT_STATUS_CLEAR_IA << int_type) | | ||
| 214 | (L3_AGENT_STATUS_CLEAR_TA)); | ||
| 215 | |||
| 216 | omap3_l3_writell(base, L3_AGENT_STATUS, clear); | ||
| 217 | |||
| 218 | /* clear the error log register */ | ||
| 219 | omap3_l3_writell(base, L3_ERROR_LOG, error); | ||
| 220 | |||
| 221 | return ret; | ||
| 222 | } | ||
| 223 | |||
| 224 | static int __init omap3_l3_probe(struct platform_device *pdev) | ||
| 225 | { | ||
| 226 | struct omap3_l3 *l3; | ||
| 227 | struct resource *res; | ||
| 228 | int ret; | ||
| 229 | int irq; | ||
| 230 | |||
| 231 | l3 = kzalloc(sizeof(*l3), GFP_KERNEL); | ||
| 232 | if (!l3) { | ||
| 233 | ret = -ENOMEM; | ||
| 234 | goto err0; | ||
| 235 | } | ||
| 236 | |||
| 237 | platform_set_drvdata(pdev, l3); | ||
| 238 | |||
| 239 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 240 | if (!res) { | ||
| 241 | dev_err(&pdev->dev, "couldn't find resource\n"); | ||
| 242 | ret = -ENODEV; | ||
| 243 | goto err1; | ||
| 244 | } | ||
| 245 | l3->rt = ioremap(res->start, resource_size(res)); | ||
| 246 | if (!(l3->rt)) { | ||
| 247 | dev_err(&pdev->dev, "ioremap failed\n"); | ||
| 248 | ret = -ENOMEM; | ||
| 249 | goto err2; | ||
| 250 | } | ||
| 251 | |||
| 252 | irq = platform_get_irq(pdev, 0); | ||
| 253 | ret = request_irq(irq, omap3_l3_app_irq, | ||
| 254 | IRQF_DISABLED | IRQF_TRIGGER_RISING, | ||
| 255 | "l3-debug-irq", l3); | ||
| 256 | if (ret) { | ||
| 257 | dev_err(&pdev->dev, "couldn't request debug irq\n"); | ||
| 258 | goto err3; | ||
| 259 | } | ||
| 260 | l3->debug_irq = irq; | ||
| 261 | |||
| 262 | irq = platform_get_irq(pdev, 1); | ||
| 263 | ret = request_irq(irq, omap3_l3_app_irq, | ||
| 264 | IRQF_DISABLED | IRQF_TRIGGER_RISING, | ||
| 265 | "l3-app-irq", l3); | ||
| 266 | |||
| 267 | if (ret) { | ||
| 268 | dev_err(&pdev->dev, "couldn't request app irq\n"); | ||
| 269 | goto err4; | ||
| 270 | } | ||
| 271 | |||
| 272 | l3->app_irq = irq; | ||
| 273 | goto err0; | ||
| 274 | |||
| 275 | err4: | ||
| 276 | err3: | ||
| 277 | iounmap(l3->rt); | ||
| 278 | err2: | ||
| 279 | err1: | ||
| 280 | kfree(l3); | ||
| 281 | err0: | ||
| 282 | return ret; | ||
| 283 | } | ||
| 284 | |||
| 285 | static int __exit omap3_l3_remove(struct platform_device *pdev) | ||
| 286 | { | ||
| 287 | struct omap3_l3 *l3 = platform_get_drvdata(pdev); | ||
| 288 | |||
| 289 | free_irq(l3->app_irq, l3); | ||
| 290 | free_irq(l3->debug_irq, l3); | ||
| 291 | iounmap(l3->rt); | ||
| 292 | kfree(l3); | ||
| 293 | |||
| 294 | return 0; | ||
| 295 | } | ||
| 296 | |||
| 297 | static struct platform_driver omap3_l3_driver = { | ||
| 298 | .remove = __exit_p(omap3_l3_remove), | ||
| 299 | .driver = { | ||
| 300 | .name = "omap_l3_smx", | ||
| 301 | }, | ||
| 302 | }; | ||
| 303 | |||
| 304 | static int __init omap3_l3_init(void) | ||
| 305 | { | ||
| 306 | return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe); | ||
| 307 | } | ||
| 308 | postcore_initcall_sync(omap3_l3_init); | ||
| 309 | |||
| 310 | static void __exit omap3_l3_exit(void) | ||
| 311 | { | ||
| 312 | platform_driver_unregister(&omap3_l3_driver); | ||
| 313 | } | ||
| 314 | module_exit(omap3_l3_exit); | ||
diff --git a/arch/arm/mach-omap2/omap_l3_smx.h b/arch/arm/mach-omap2/omap_l3_smx.h new file mode 100644 index 000000000000..ba2ed9a850cc --- /dev/null +++ b/arch/arm/mach-omap2/omap_l3_smx.h | |||
| @@ -0,0 +1,338 @@ | |||
| 1 | /* | ||
| 2 | * OMAP3XXX L3 Interconnect Driver header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 Texas Corporation | ||
| 5 | * Felipe Balbi <balbi@ti.com> | ||
| 6 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 7 | * sricharan <r.sricharan@ti.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | ||
| 22 | * USA | ||
| 23 | */ | ||
| 24 | #ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
| 25 | #define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H | ||
| 26 | |||
| 27 | /* Register definitions. All 64-bit wide */ | ||
| 28 | #define L3_COMPONENT 0x000 | ||
| 29 | #define L3_CORE 0x018 | ||
| 30 | #define L3_AGENT_CONTROL 0x020 | ||
| 31 | #define L3_AGENT_STATUS 0x028 | ||
| 32 | #define L3_ERROR_LOG 0x058 | ||
| 33 | |||
| 34 | #define L3_ERROR_LOG_MULTI (1 << 31) | ||
| 35 | #define L3_ERROR_LOG_SECONDARY (1 << 30) | ||
| 36 | |||
| 37 | #define L3_ERROR_LOG_ADDR 0x060 | ||
| 38 | |||
| 39 | /* Register definitions for Sideband Interconnect */ | ||
| 40 | #define L3_SI_CONTROL 0x020 | ||
| 41 | #define L3_SI_FLAG_STATUS_0 0x510 | ||
| 42 | |||
| 43 | const u64 shift = 1; | ||
| 44 | |||
| 45 | #define L3_STATUS_0_MPUIA_BRST (shift << 0) | ||
| 46 | #define L3_STATUS_0_MPUIA_RSP (shift << 1) | ||
| 47 | #define L3_STATUS_0_MPUIA_INBAND (shift << 2) | ||
| 48 | #define L3_STATUS_0_IVAIA_BRST (shift << 6) | ||
| 49 | #define L3_STATUS_0_IVAIA_RSP (shift << 7) | ||
| 50 | #define L3_STATUS_0_IVAIA_INBAND (shift << 8) | ||
| 51 | #define L3_STATUS_0_SGXIA_BRST (shift << 9) | ||
| 52 | #define L3_STATUS_0_SGXIA_RSP (shift << 10) | ||
| 53 | #define L3_STATUS_0_SGXIA_MERROR (shift << 11) | ||
| 54 | #define L3_STATUS_0_CAMIA_BRST (shift << 12) | ||
| 55 | #define L3_STATUS_0_CAMIA_RSP (shift << 13) | ||
| 56 | #define L3_STATUS_0_CAMIA_INBAND (shift << 14) | ||
| 57 | #define L3_STATUS_0_DISPIA_BRST (shift << 15) | ||
| 58 | #define L3_STATUS_0_DISPIA_RSP (shift << 16) | ||
| 59 | #define L3_STATUS_0_DMARDIA_BRST (shift << 18) | ||
| 60 | #define L3_STATUS_0_DMARDIA_RSP (shift << 19) | ||
| 61 | #define L3_STATUS_0_DMAWRIA_BRST (shift << 21) | ||
| 62 | #define L3_STATUS_0_DMAWRIA_RSP (shift << 22) | ||
| 63 | #define L3_STATUS_0_USBOTGIA_BRST (shift << 24) | ||
| 64 | #define L3_STATUS_0_USBOTGIA_RSP (shift << 25) | ||
| 65 | #define L3_STATUS_0_USBOTGIA_INBAND (shift << 26) | ||
| 66 | #define L3_STATUS_0_USBHOSTIA_BRST (shift << 27) | ||
| 67 | #define L3_STATUS_0_USBHOSTIA_INBAND (shift << 28) | ||
| 68 | #define L3_STATUS_0_SMSTA_REQ (shift << 48) | ||
| 69 | #define L3_STATUS_0_GPMCTA_REQ (shift << 49) | ||
| 70 | #define L3_STATUS_0_OCMRAMTA_REQ (shift << 50) | ||
| 71 | #define L3_STATUS_0_OCMROMTA_REQ (shift << 51) | ||
| 72 | #define L3_STATUS_0_IVATA_REQ (shift << 54) | ||
| 73 | #define L3_STATUS_0_SGXTA_REQ (shift << 55) | ||
| 74 | #define L3_STATUS_0_SGXTA_SERROR (shift << 56) | ||
| 75 | #define L3_STATUS_0_GPMCTA_SERROR (shift << 57) | ||
| 76 | #define L3_STATUS_0_L4CORETA_REQ (shift << 58) | ||
| 77 | #define L3_STATUS_0_L4PERTA_REQ (shift << 59) | ||
| 78 | #define L3_STATUS_0_L4EMUTA_REQ (shift << 60) | ||
| 79 | #define L3_STATUS_0_MAD2DTA_REQ (shift << 61) | ||
| 80 | |||
| 81 | #define L3_STATUS_0_TIMEOUT_MASK (L3_STATUS_0_MPUIA_BRST \ | ||
| 82 | | L3_STATUS_0_MPUIA_RSP \ | ||
| 83 | | L3_STATUS_0_IVAIA_BRST \ | ||
| 84 | | L3_STATUS_0_IVAIA_RSP \ | ||
| 85 | | L3_STATUS_0_SGXIA_BRST \ | ||
| 86 | | L3_STATUS_0_SGXIA_RSP \ | ||
| 87 | | L3_STATUS_0_CAMIA_BRST \ | ||
| 88 | | L3_STATUS_0_CAMIA_RSP \ | ||
| 89 | | L3_STATUS_0_DISPIA_BRST \ | ||
| 90 | | L3_STATUS_0_DISPIA_RSP \ | ||
| 91 | | L3_STATUS_0_DMARDIA_BRST \ | ||
| 92 | | L3_STATUS_0_DMARDIA_RSP \ | ||
| 93 | | L3_STATUS_0_DMAWRIA_BRST \ | ||
| 94 | | L3_STATUS_0_DMAWRIA_RSP \ | ||
| 95 | | L3_STATUS_0_USBOTGIA_BRST \ | ||
| 96 | | L3_STATUS_0_USBOTGIA_RSP \ | ||
| 97 | | L3_STATUS_0_USBHOSTIA_BRST \ | ||
| 98 | | L3_STATUS_0_SMSTA_REQ \ | ||
| 99 | | L3_STATUS_0_GPMCTA_REQ \ | ||
| 100 | | L3_STATUS_0_OCMRAMTA_REQ \ | ||
| 101 | | L3_STATUS_0_OCMROMTA_REQ \ | ||
| 102 | | L3_STATUS_0_IVATA_REQ \ | ||
| 103 | | L3_STATUS_0_SGXTA_REQ \ | ||
| 104 | | L3_STATUS_0_L4CORETA_REQ \ | ||
| 105 | | L3_STATUS_0_L4PERTA_REQ \ | ||
| 106 | | L3_STATUS_0_L4EMUTA_REQ \ | ||
| 107 | | L3_STATUS_0_MAD2DTA_REQ) | ||
| 108 | |||
| 109 | #define L3_SI_FLAG_STATUS_1 0x530 | ||
| 110 | |||
| 111 | #define L3_STATUS_1_MPU_DATAIA (1 << 0) | ||
| 112 | #define L3_STATUS_1_DAPIA0 (1 << 3) | ||
| 113 | #define L3_STATUS_1_DAPIA1 (1 << 4) | ||
| 114 | #define L3_STATUS_1_IVAIA (1 << 6) | ||
| 115 | |||
| 116 | #define L3_PM_ERROR_LOG 0x020 | ||
| 117 | #define L3_PM_CONTROL 0x028 | ||
| 118 | #define L3_PM_ERROR_CLEAR_SINGLE 0x030 | ||
| 119 | #define L3_PM_ERROR_CLEAR_MULTI 0x038 | ||
| 120 | #define L3_PM_REQ_INFO_PERMISSION(n) (0x048 + (0x020 * n)) | ||
| 121 | #define L3_PM_READ_PERMISSION(n) (0x050 + (0x020 * n)) | ||
| 122 | #define L3_PM_WRITE_PERMISSION(n) (0x058 + (0x020 * n)) | ||
| 123 | #define L3_PM_ADDR_MATCH(n) (0x060 + (0x020 * n)) | ||
| 124 | |||
| 125 | /* L3 error log bit fields. Common for IA and TA */ | ||
| 126 | #define L3_ERROR_LOG_CODE 24 | ||
| 127 | #define L3_ERROR_LOG_INITID 8 | ||
| 128 | #define L3_ERROR_LOG_CMD 0 | ||
| 129 | |||
| 130 | /* L3 agent status bit fields. */ | ||
| 131 | #define L3_AGENT_STATUS_CLEAR_IA 0x10000000 | ||
| 132 | #define L3_AGENT_STATUS_CLEAR_TA 0x01000000 | ||
| 133 | |||
| 134 | #define OMAP34xx_IRQ_L3_APP 10 | ||
| 135 | #define L3_APPLICATION_ERROR 0x0 | ||
| 136 | #define L3_DEBUG_ERROR 0x1 | ||
| 137 | |||
| 138 | enum omap3_l3_initiator_id { | ||
| 139 | /* LCD has 1 ID */ | ||
| 140 | OMAP_L3_LCD = 29, | ||
| 141 | /* SAD2D has 1 ID */ | ||
| 142 | OMAP_L3_SAD2D = 28, | ||
| 143 | /* MPU has 5 IDs */ | ||
| 144 | OMAP_L3_IA_MPU_SS_1 = 27, | ||
| 145 | OMAP_L3_IA_MPU_SS_2 = 26, | ||
| 146 | OMAP_L3_IA_MPU_SS_3 = 25, | ||
| 147 | OMAP_L3_IA_MPU_SS_4 = 24, | ||
| 148 | OMAP_L3_IA_MPU_SS_5 = 23, | ||
| 149 | /* IVA2.2 SS has 3 IDs*/ | ||
| 150 | OMAP_L3_IA_IVA_SS_1 = 22, | ||
| 151 | OMAP_L3_IA_IVA_SS_2 = 21, | ||
| 152 | OMAP_L3_IA_IVA_SS_3 = 20, | ||
| 153 | /* IVA 2.2 SS DMA has 6 IDS */ | ||
| 154 | OMAP_L3_IA_IVA_SS_DMA_1 = 19, | ||
| 155 | OMAP_L3_IA_IVA_SS_DMA_2 = 18, | ||
| 156 | OMAP_L3_IA_IVA_SS_DMA_3 = 17, | ||
| 157 | OMAP_L3_IA_IVA_SS_DMA_4 = 16, | ||
| 158 | OMAP_L3_IA_IVA_SS_DMA_5 = 15, | ||
| 159 | OMAP_L3_IA_IVA_SS_DMA_6 = 14, | ||
| 160 | /* SGX has 1 ID */ | ||
| 161 | OMAP_L3_IA_SGX = 13, | ||
| 162 | /* CAM has 3 ID */ | ||
| 163 | OMAP_L3_IA_CAM_1 = 12, | ||
| 164 | OMAP_L3_IA_CAM_2 = 11, | ||
| 165 | OMAP_L3_IA_CAM_3 = 10, | ||
| 166 | /* DAP has 1 ID */ | ||
| 167 | OMAP_L3_IA_DAP = 9, | ||
| 168 | /* SDMA WR has 2 IDs */ | ||
| 169 | OMAP_L3_SDMA_WR_1 = 8, | ||
| 170 | OMAP_L3_SDMA_WR_2 = 7, | ||
| 171 | /* SDMA RD has 4 IDs */ | ||
| 172 | OMAP_L3_SDMA_RD_1 = 6, | ||
| 173 | OMAP_L3_SDMA_RD_2 = 5, | ||
| 174 | OMAP_L3_SDMA_RD_3 = 4, | ||
| 175 | OMAP_L3_SDMA_RD_4 = 3, | ||
| 176 | /* HSUSB OTG has 1 ID */ | ||
| 177 | OMAP_L3_USBOTG = 2, | ||
| 178 | /* HSUSB HOST has 1 ID */ | ||
| 179 | OMAP_L3_USBHOST = 1, | ||
| 180 | }; | ||
| 181 | |||
| 182 | enum omap3_l3_code { | ||
| 183 | OMAP_L3_CODE_NOERROR = 0, | ||
| 184 | OMAP_L3_CODE_UNSUP_CMD = 1, | ||
| 185 | OMAP_L3_CODE_ADDR_HOLE = 2, | ||
| 186 | OMAP_L3_CODE_PROTECT_VIOLATION = 3, | ||
| 187 | OMAP_L3_CODE_IN_BAND_ERR = 4, | ||
| 188 | /* codes 5 and 6 are reserved */ | ||
| 189 | OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT = 7, | ||
| 190 | OMAP_L3_CODE_REQ_TOUT_NO_RESP = 8, | ||
| 191 | /* codes 9 - 15 are also reserved */ | ||
| 192 | }; | ||
| 193 | |||
| 194 | struct omap3_l3 { | ||
| 195 | struct device *dev; | ||
| 196 | struct clk *ick; | ||
| 197 | |||
| 198 | /* memory base*/ | ||
| 199 | void __iomem *rt; | ||
| 200 | |||
| 201 | int debug_irq; | ||
| 202 | int app_irq; | ||
| 203 | |||
| 204 | /* true when and inband functional error occurs */ | ||
| 205 | unsigned inband:1; | ||
| 206 | }; | ||
| 207 | |||
| 208 | /* offsets for l3 agents in order with the Flag status register */ | ||
| 209 | unsigned int __iomem omap3_l3_app_bases[] = { | ||
| 210 | /* MPU IA */ | ||
| 211 | 0x1400, | ||
| 212 | 0x1400, | ||
| 213 | 0x1400, | ||
| 214 | /* RESERVED */ | ||
| 215 | 0, | ||
| 216 | 0, | ||
| 217 | 0, | ||
| 218 | /* IVA 2.2 IA */ | ||
| 219 | 0x1800, | ||
| 220 | 0x1800, | ||
| 221 | 0x1800, | ||
| 222 | /* SGX IA */ | ||
| 223 | 0x1c00, | ||
| 224 | 0x1c00, | ||
| 225 | /* RESERVED */ | ||
| 226 | 0, | ||
| 227 | /* CAMERA IA */ | ||
| 228 | 0x5800, | ||
| 229 | 0x5800, | ||
| 230 | 0x5800, | ||
| 231 | /* DISPLAY IA */ | ||
| 232 | 0x5400, | ||
| 233 | 0x5400, | ||
| 234 | /* RESERVED */ | ||
| 235 | 0, | ||
| 236 | /*SDMA RD IA */ | ||
| 237 | 0x4c00, | ||
| 238 | 0x4c00, | ||
| 239 | /* RESERVED */ | ||
| 240 | 0, | ||
| 241 | /* SDMA WR IA */ | ||
| 242 | 0x5000, | ||
| 243 | 0x5000, | ||
| 244 | /* RESERVED */ | ||
| 245 | 0, | ||
| 246 | /* USB OTG IA */ | ||
| 247 | 0x4400, | ||
| 248 | 0x4400, | ||
| 249 | 0x4400, | ||
| 250 | /* USB HOST IA */ | ||
| 251 | 0x4000, | ||
| 252 | 0x4000, | ||
| 253 | /* RESERVED */ | ||
| 254 | 0, | ||
| 255 | 0, | ||
| 256 | 0, | ||
| 257 | 0, | ||
| 258 | /* SAD2D IA */ | ||
| 259 | 0x3000, | ||
| 260 | 0x3000, | ||
| 261 | 0x3000, | ||
| 262 | /* RESERVED */ | ||
| 263 | 0, | ||
| 264 | 0, | ||
| 265 | 0, | ||
| 266 | 0, | ||
| 267 | 0, | ||
| 268 | 0, | ||
| 269 | 0, | ||
| 270 | 0, | ||
| 271 | 0, | ||
| 272 | 0, | ||
| 273 | 0, | ||
| 274 | 0, | ||
| 275 | /* SMA TA */ | ||
| 276 | 0x2000, | ||
| 277 | /* GPMC TA */ | ||
| 278 | 0x2400, | ||
| 279 | /* OCM RAM TA */ | ||
| 280 | 0x2800, | ||
| 281 | /* OCM ROM TA */ | ||
| 282 | 0x2C00, | ||
| 283 | /* L4 CORE TA */ | ||
| 284 | 0x6800, | ||
| 285 | /* L4 PER TA */ | ||
| 286 | 0x6c00, | ||
| 287 | /* IVA 2.2 TA */ | ||
| 288 | 0x6000, | ||
| 289 | /* SGX TA */ | ||
| 290 | 0x6400, | ||
| 291 | /* L4 EMU TA */ | ||
| 292 | 0x7000, | ||
| 293 | /* GPMC TA */ | ||
| 294 | 0x2400, | ||
| 295 | /* L4 CORE TA */ | ||
| 296 | 0x6800, | ||
| 297 | /* L4 PER TA */ | ||
| 298 | 0x6c00, | ||
| 299 | /* L4 EMU TA */ | ||
| 300 | 0x7000, | ||
| 301 | /* MAD2D TA */ | ||
| 302 | 0x3400, | ||
| 303 | /* RESERVED */ | ||
| 304 | 0, | ||
| 305 | 0, | ||
| 306 | }; | ||
| 307 | |||
| 308 | unsigned int __iomem omap3_l3_debug_bases[] = { | ||
| 309 | /* MPU DATA IA */ | ||
| 310 | 0x1400, | ||
| 311 | /* RESERVED */ | ||
| 312 | 0, | ||
| 313 | 0, | ||
| 314 | /* DAP IA */ | ||
| 315 | 0x5c00, | ||
| 316 | 0x5c00, | ||
| 317 | /* RESERVED */ | ||
| 318 | 0, | ||
| 319 | /* IVA 2.2 IA */ | ||
| 320 | 0x1800, | ||
| 321 | /* REST RESERVED */ | ||
| 322 | }; | ||
| 323 | |||
| 324 | u32 *omap3_l3_bases[] = { | ||
| 325 | omap3_l3_app_bases, | ||
| 326 | omap3_l3_debug_bases, | ||
| 327 | }; | ||
| 328 | |||
| 329 | /* | ||
| 330 | * REVISIT define __raw_readll/__raw_writell here, but move them to | ||
| 331 | * <asm/io.h> at some point | ||
| 332 | */ | ||
| 333 | #define __raw_writell(v, a) (__chk_io_ptr(a), \ | ||
| 334 | *(volatile u64 __force *)(a) = (v)) | ||
| 335 | #define __raw_readll(a) (__chk_io_ptr(a), \ | ||
| 336 | *(volatile u64 __force *)(a)) | ||
| 337 | |||
| 338 | #endif | ||
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 125f56591fb5..a5a83b358ddd 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c | |||
| @@ -637,14 +637,14 @@ static int __init pm_dbg_init(void) | |||
| 637 | 637 | ||
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d, | 640 | (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d, |
| 641 | &enable_off_mode, &pm_dbg_option_fops); | 641 | &enable_off_mode, &pm_dbg_option_fops); |
| 642 | (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d, | 642 | (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d, |
| 643 | &sleep_while_idle, &pm_dbg_option_fops); | 643 | &sleep_while_idle, &pm_dbg_option_fops); |
| 644 | (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d, | 644 | (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d, |
| 645 | &wakeup_timer_seconds, &pm_dbg_option_fops); | 645 | &wakeup_timer_seconds, &pm_dbg_option_fops); |
| 646 | (void) debugfs_create_file("wakeup_timer_milliseconds", | 646 | (void) debugfs_create_file("wakeup_timer_milliseconds", |
| 647 | S_IRUGO | S_IWUGO, d, &wakeup_timer_milliseconds, | 647 | S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds, |
| 648 | &pm_dbg_option_fops); | 648 | &pm_dbg_option_fops); |
| 649 | pm_dbg_init_done = 1; | 649 | pm_dbg_init_done = 1; |
| 650 | 650 | ||
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index e983c8301f55..96907da1910a 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
| @@ -379,7 +379,10 @@ static void __init prcm_setup_regs(void) | |||
| 379 | int i, num_mem_banks; | 379 | int i, num_mem_banks; |
| 380 | struct powerdomain *pwrdm; | 380 | struct powerdomain *pwrdm; |
| 381 | 381 | ||
| 382 | /* Enable autoidle */ | 382 | /* |
| 383 | * Enable autoidle | ||
| 384 | * XXX This should be handled by hwmod code or PRCM init code | ||
| 385 | */ | ||
| 383 | omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, | 386 | omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, |
| 384 | OMAP2_PRCM_SYSCONFIG_OFFSET); | 387 | OMAP2_PRCM_SYSCONFIG_OFFSET); |
| 385 | 388 | ||
| @@ -418,70 +421,6 @@ static void __init prcm_setup_regs(void) | |||
| 418 | clkdm_for_each(clkdms_setup, NULL); | 421 | clkdm_for_each(clkdms_setup, NULL); |
| 419 | clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); | 422 | clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); |
| 420 | 423 | ||
| 421 | /* Enable clock autoidle for all domains */ | ||
| 422 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK | | ||
| 423 | OMAP24XX_AUTO_MAILBOXES_MASK | | ||
| 424 | OMAP24XX_AUTO_WDT4_MASK | | ||
| 425 | OMAP2420_AUTO_WDT3_MASK | | ||
| 426 | OMAP24XX_AUTO_MSPRO_MASK | | ||
| 427 | OMAP2420_AUTO_MMC_MASK | | ||
| 428 | OMAP24XX_AUTO_FAC_MASK | | ||
| 429 | OMAP2420_AUTO_EAC_MASK | | ||
| 430 | OMAP24XX_AUTO_HDQ_MASK | | ||
| 431 | OMAP24XX_AUTO_UART2_MASK | | ||
| 432 | OMAP24XX_AUTO_UART1_MASK | | ||
| 433 | OMAP24XX_AUTO_I2C2_MASK | | ||
| 434 | OMAP24XX_AUTO_I2C1_MASK | | ||
| 435 | OMAP24XX_AUTO_MCSPI2_MASK | | ||
| 436 | OMAP24XX_AUTO_MCSPI1_MASK | | ||
| 437 | OMAP24XX_AUTO_MCBSP2_MASK | | ||
| 438 | OMAP24XX_AUTO_MCBSP1_MASK | | ||
| 439 | OMAP24XX_AUTO_GPT12_MASK | | ||
| 440 | OMAP24XX_AUTO_GPT11_MASK | | ||
| 441 | OMAP24XX_AUTO_GPT10_MASK | | ||
| 442 | OMAP24XX_AUTO_GPT9_MASK | | ||
| 443 | OMAP24XX_AUTO_GPT8_MASK | | ||
| 444 | OMAP24XX_AUTO_GPT7_MASK | | ||
| 445 | OMAP24XX_AUTO_GPT6_MASK | | ||
| 446 | OMAP24XX_AUTO_GPT5_MASK | | ||
| 447 | OMAP24XX_AUTO_GPT4_MASK | | ||
| 448 | OMAP24XX_AUTO_GPT3_MASK | | ||
| 449 | OMAP24XX_AUTO_GPT2_MASK | | ||
| 450 | OMAP2420_AUTO_VLYNQ_MASK | | ||
| 451 | OMAP24XX_AUTO_DSS_MASK, | ||
| 452 | CORE_MOD, CM_AUTOIDLE1); | ||
| 453 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK | | ||
| 454 | OMAP24XX_AUTO_SSI_MASK | | ||
| 455 | OMAP24XX_AUTO_USB_MASK, | ||
| 456 | CORE_MOD, CM_AUTOIDLE2); | ||
| 457 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK | | ||
| 458 | OMAP24XX_AUTO_GPMC_MASK | | ||
| 459 | OMAP24XX_AUTO_SDMA_MASK, | ||
| 460 | CORE_MOD, CM_AUTOIDLE3); | ||
| 461 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK | | ||
| 462 | OMAP24XX_AUTO_AES_MASK | | ||
| 463 | OMAP24XX_AUTO_RNG_MASK | | ||
| 464 | OMAP24XX_AUTO_SHA_MASK | | ||
| 465 | OMAP24XX_AUTO_DES_MASK, | ||
| 466 | CORE_MOD, OMAP24XX_CM_AUTOIDLE4); | ||
| 467 | |||
| 468 | omap2_cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD, | ||
| 469 | CM_AUTOIDLE); | ||
| 470 | |||
| 471 | /* Put DPLL and both APLLs into autoidle mode */ | ||
| 472 | omap2_cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) | | ||
| 473 | (0x03 << OMAP24XX_AUTO_96M_SHIFT) | | ||
| 474 | (0x03 << OMAP24XX_AUTO_54M_SHIFT), | ||
| 475 | PLL_MOD, CM_AUTOIDLE); | ||
| 476 | |||
| 477 | omap2_cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK | | ||
| 478 | OMAP24XX_AUTO_WDT1_MASK | | ||
| 479 | OMAP24XX_AUTO_MPU_WDT_MASK | | ||
| 480 | OMAP24XX_AUTO_GPIOS_MASK | | ||
| 481 | OMAP24XX_AUTO_32KSYNC_MASK | | ||
| 482 | OMAP24XX_AUTO_GPT1_MASK, | ||
| 483 | WKUP_MOD, CM_AUTOIDLE); | ||
| 484 | |||
| 485 | /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk | 424 | /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk |
| 486 | * stabilisation */ | 425 | * stabilisation */ |
| 487 | omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, | 426 | omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index eda9a4e99a89..3d6a00e07a5b 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
| @@ -688,14 +688,11 @@ static void __init omap3_d2d_idle(void) | |||
| 688 | 688 | ||
| 689 | static void __init prcm_setup_regs(void) | 689 | static void __init prcm_setup_regs(void) |
| 690 | { | 690 | { |
| 691 | u32 omap3630_auto_uart4_mask = cpu_is_omap3630() ? | ||
| 692 | OMAP3630_AUTO_UART4_MASK : 0; | ||
| 693 | u32 omap3630_en_uart4_mask = cpu_is_omap3630() ? | 691 | u32 omap3630_en_uart4_mask = cpu_is_omap3630() ? |
| 694 | OMAP3630_EN_UART4_MASK : 0; | 692 | OMAP3630_EN_UART4_MASK : 0; |
| 695 | u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ? | 693 | u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ? |
| 696 | OMAP3630_GRPSEL_UART4_MASK : 0; | 694 | OMAP3630_GRPSEL_UART4_MASK : 0; |
| 697 | 695 | ||
| 698 | |||
| 699 | /* XXX Reset all wkdeps. This should be done when initializing | 696 | /* XXX Reset all wkdeps. This should be done when initializing |
| 700 | * powerdomains */ | 697 | * powerdomains */ |
| 701 | omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP); | 698 | omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP); |
| @@ -710,127 +707,10 @@ static void __init prcm_setup_regs(void) | |||
| 710 | } else | 707 | } else |
| 711 | omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP); | 708 | omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP); |
| 712 | 709 | ||
| 713 | /* | 710 | /* XXX This should be handled by hwmod code or SCM init code */ |
| 714 | * Enable interface clock autoidle for all modules. | ||
| 715 | * Note that in the long run this should be done by clockfw | ||
| 716 | */ | ||
| 717 | omap2_cm_write_mod_reg( | ||
| 718 | OMAP3430_AUTO_MODEM_MASK | | ||
| 719 | OMAP3430ES2_AUTO_MMC3_MASK | | ||
| 720 | OMAP3430ES2_AUTO_ICR_MASK | | ||
| 721 | OMAP3430_AUTO_AES2_MASK | | ||
| 722 | OMAP3430_AUTO_SHA12_MASK | | ||
| 723 | OMAP3430_AUTO_DES2_MASK | | ||
| 724 | OMAP3430_AUTO_MMC2_MASK | | ||
| 725 | OMAP3430_AUTO_MMC1_MASK | | ||
| 726 | OMAP3430_AUTO_MSPRO_MASK | | ||
| 727 | OMAP3430_AUTO_HDQ_MASK | | ||
| 728 | OMAP3430_AUTO_MCSPI4_MASK | | ||
| 729 | OMAP3430_AUTO_MCSPI3_MASK | | ||
| 730 | OMAP3430_AUTO_MCSPI2_MASK | | ||
| 731 | OMAP3430_AUTO_MCSPI1_MASK | | ||
| 732 | OMAP3430_AUTO_I2C3_MASK | | ||
| 733 | OMAP3430_AUTO_I2C2_MASK | | ||
| 734 | OMAP3430_AUTO_I2C1_MASK | | ||
| 735 | OMAP3430_AUTO_UART2_MASK | | ||
| 736 | OMAP3430_AUTO_UART1_MASK | | ||
| 737 | OMAP3430_AUTO_GPT11_MASK | | ||
| 738 | OMAP3430_AUTO_GPT10_MASK | | ||
| 739 | OMAP3430_AUTO_MCBSP5_MASK | | ||
| 740 | OMAP3430_AUTO_MCBSP1_MASK | | ||
| 741 | OMAP3430ES1_AUTO_FAC_MASK | /* This is es1 only */ | ||
| 742 | OMAP3430_AUTO_MAILBOXES_MASK | | ||
| 743 | OMAP3430_AUTO_OMAPCTRL_MASK | | ||
| 744 | OMAP3430ES1_AUTO_FSHOSTUSB_MASK | | ||
| 745 | OMAP3430_AUTO_HSOTGUSB_MASK | | ||
| 746 | OMAP3430_AUTO_SAD2D_MASK | | ||
| 747 | OMAP3430_AUTO_SSI_MASK, | ||
| 748 | CORE_MOD, CM_AUTOIDLE1); | ||
| 749 | |||
| 750 | omap2_cm_write_mod_reg( | ||
| 751 | OMAP3430_AUTO_PKA_MASK | | ||
| 752 | OMAP3430_AUTO_AES1_MASK | | ||
| 753 | OMAP3430_AUTO_RNG_MASK | | ||
| 754 | OMAP3430_AUTO_SHA11_MASK | | ||
| 755 | OMAP3430_AUTO_DES1_MASK, | ||
| 756 | CORE_MOD, CM_AUTOIDLE2); | ||
| 757 | |||
| 758 | if (omap_rev() > OMAP3430_REV_ES1_0) { | ||
| 759 | omap2_cm_write_mod_reg( | ||
| 760 | OMAP3430_AUTO_MAD2D_MASK | | ||
| 761 | OMAP3430ES2_AUTO_USBTLL_MASK, | ||
| 762 | CORE_MOD, CM_AUTOIDLE3); | ||
| 763 | } | ||
| 764 | |||
| 765 | omap2_cm_write_mod_reg( | ||
| 766 | OMAP3430_AUTO_WDT2_MASK | | ||
| 767 | OMAP3430_AUTO_WDT1_MASK | | ||
| 768 | OMAP3430_AUTO_GPIO1_MASK | | ||
| 769 | OMAP3430_AUTO_32KSYNC_MASK | | ||
| 770 | OMAP3430_AUTO_GPT12_MASK | | ||
| 771 | OMAP3430_AUTO_GPT1_MASK, | ||
| 772 | WKUP_MOD, CM_AUTOIDLE); | ||
| 773 | |||
| 774 | omap2_cm_write_mod_reg( | ||
| 775 | OMAP3430_AUTO_DSS_MASK, | ||
| 776 | OMAP3430_DSS_MOD, | ||
| 777 | CM_AUTOIDLE); | ||
| 778 | |||
| 779 | omap2_cm_write_mod_reg( | ||
| 780 | OMAP3430_AUTO_CAM_MASK, | ||
| 781 | OMAP3430_CAM_MOD, | ||
| 782 | CM_AUTOIDLE); | ||
| 783 | |||
| 784 | omap2_cm_write_mod_reg( | ||
| 785 | omap3630_auto_uart4_mask | | ||
| 786 | OMAP3430_AUTO_GPIO6_MASK | | ||
| 787 | OMAP3430_AUTO_GPIO5_MASK | | ||
| 788 | OMAP3430_AUTO_GPIO4_MASK | | ||
| 789 | OMAP3430_AUTO_GPIO3_MASK | | ||
| 790 | OMAP3430_AUTO_GPIO2_MASK | | ||
| 791 | OMAP3430_AUTO_WDT3_MASK | | ||
| 792 | OMAP3430_AUTO_UART3_MASK | | ||
| 793 | OMAP3430_AUTO_GPT9_MASK | | ||
| 794 | OMAP3430_AUTO_GPT8_MASK | | ||
| 795 | OMAP3430_AUTO_GPT7_MASK | | ||
| 796 | OMAP3430_AUTO_GPT6_MASK | | ||
| 797 | OMAP3430_AUTO_GPT5_MASK | | ||
| 798 | OMAP3430_AUTO_GPT4_MASK | | ||
| 799 | OMAP3430_AUTO_GPT3_MASK | | ||
| 800 | OMAP3430_AUTO_GPT2_MASK | | ||
| 801 | OMAP3430_AUTO_MCBSP4_MASK | | ||
| 802 | OMAP3430_AUTO_MCBSP3_MASK | | ||
| 803 | OMAP3430_AUTO_MCBSP2_MASK, | ||
| 804 | OMAP3430_PER_MOD, | ||
| 805 | CM_AUTOIDLE); | ||
| 806 | |||
| 807 | if (omap_rev() > OMAP3430_REV_ES1_0) { | ||
| 808 | omap2_cm_write_mod_reg( | ||
| 809 | OMAP3430ES2_AUTO_USBHOST_MASK, | ||
| 810 | OMAP3430ES2_USBHOST_MOD, | ||
| 811 | CM_AUTOIDLE); | ||
| 812 | } | ||
| 813 | |||
| 814 | omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); | 711 | omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); |
| 815 | 712 | ||
| 816 | /* | 713 | /* |
| 817 | * Set all plls to autoidle. This is needed until autoidle is | ||
| 818 | * enabled by clockfw | ||
| 819 | */ | ||
| 820 | omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT, | ||
| 821 | OMAP3430_IVA2_MOD, CM_AUTOIDLE2); | ||
| 822 | omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT, | ||
| 823 | MPU_MOD, | ||
| 824 | CM_AUTOIDLE2); | ||
| 825 | omap2_cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) | | ||
| 826 | (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT), | ||
| 827 | PLL_MOD, | ||
| 828 | CM_AUTOIDLE); | ||
| 829 | omap2_cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT, | ||
| 830 | PLL_MOD, | ||
| 831 | CM_AUTOIDLE2); | ||
| 832 | |||
| 833 | /* | ||
| 834 | * Enable control of expternal oscillator through | 714 | * Enable control of expternal oscillator through |
| 835 | * sys_clkreq. In the long run clock framework should | 715 | * sys_clkreq. In the long run clock framework should |
| 836 | * take care of this. | 716 | * take care of this. |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index eaed0df16699..a11be81997c5 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP powerdomain control | 2 | * OMAP powerdomain control |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2009 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
| 8 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> | 8 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> |
| @@ -938,3 +938,44 @@ u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) | |||
| 938 | 938 | ||
| 939 | return count; | 939 | return count; |
| 940 | } | 940 | } |
| 941 | |||
| 942 | /** | ||
| 943 | * pwrdm_can_ever_lose_context - can this powerdomain ever lose context? | ||
| 944 | * @pwrdm: struct powerdomain * | ||
| 945 | * | ||
| 946 | * Given a struct powerdomain * @pwrdm, returns 1 if the powerdomain | ||
| 947 | * can lose either memory or logic context or if @pwrdm is invalid, or | ||
| 948 | * returns 0 otherwise. This function is not concerned with how the | ||
| 949 | * powerdomain registers are programmed (i.e., to go off or not); it's | ||
| 950 | * concerned with whether it's ever possible for this powerdomain to | ||
| 951 | * go off while some other part of the chip is active. This function | ||
| 952 | * assumes that every powerdomain can go to either ON or INACTIVE. | ||
| 953 | */ | ||
| 954 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm) | ||
| 955 | { | ||
| 956 | int i; | ||
| 957 | |||
| 958 | if (IS_ERR_OR_NULL(pwrdm)) { | ||
| 959 | pr_debug("powerdomain: %s: invalid powerdomain pointer\n", | ||
| 960 | __func__); | ||
| 961 | return 1; | ||
| 962 | } | ||
| 963 | |||
| 964 | if (pwrdm->pwrsts & PWRSTS_OFF) | ||
| 965 | return 1; | ||
| 966 | |||
| 967 | if (pwrdm->pwrsts & PWRSTS_RET) { | ||
| 968 | if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF) | ||
| 969 | return 1; | ||
| 970 | |||
| 971 | for (i = 0; i < pwrdm->banks; i++) | ||
| 972 | if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF) | ||
| 973 | return 1; | ||
| 974 | } | ||
| 975 | |||
| 976 | for (i = 0; i < pwrdm->banks; i++) | ||
| 977 | if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF) | ||
| 978 | return 1; | ||
| 979 | |||
| 980 | return 0; | ||
| 981 | } | ||
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index 0b7a357cb38e..027f40bd235d 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP2/3/4 powerdomain control | 2 | * OMAP2/3/4 powerdomain control |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Paul Walmsley | 7 | * Paul Walmsley |
| 8 | * | 8 | * |
| @@ -34,17 +34,14 @@ | |||
| 34 | 34 | ||
| 35 | /* Powerdomain allowable state bitfields */ | 35 | /* Powerdomain allowable state bitfields */ |
| 36 | #define PWRSTS_ON (1 << PWRDM_POWER_ON) | 36 | #define PWRSTS_ON (1 << PWRDM_POWER_ON) |
| 37 | #define PWRSTS_INACTIVE (1 << PWRDM_POWER_INACTIVE) | ||
| 38 | #define PWRSTS_RET (1 << PWRDM_POWER_RET) | ||
| 37 | #define PWRSTS_OFF (1 << PWRDM_POWER_OFF) | 39 | #define PWRSTS_OFF (1 << PWRDM_POWER_OFF) |
| 38 | #define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \ | ||
| 39 | (1 << PWRDM_POWER_ON)) | ||
| 40 | 40 | ||
| 41 | #define PWRSTS_OFF_RET ((1 << PWRDM_POWER_OFF) | \ | 41 | #define PWRSTS_OFF_ON (PWRSTS_OFF | PWRSTS_ON) |
| 42 | (1 << PWRDM_POWER_RET)) | 42 | #define PWRSTS_OFF_RET (PWRSTS_OFF | PWRSTS_RET) |
| 43 | 43 | #define PWRSTS_RET_ON (PWRSTS_RET | PWRSTS_ON) | |
| 44 | #define PWRSTS_RET_ON ((1 << PWRDM_POWER_RET) | \ | 44 | #define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON) |
| 45 | (1 << PWRDM_POWER_ON)) | ||
| 46 | |||
| 47 | #define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | (1 << PWRDM_POWER_ON)) | ||
| 48 | 45 | ||
| 49 | 46 | ||
| 50 | /* Powerdomain flags */ | 47 | /* Powerdomain flags */ |
| @@ -211,6 +208,7 @@ int pwrdm_pre_transition(void); | |||
| 211 | int pwrdm_post_transition(void); | 208 | int pwrdm_post_transition(void); |
| 212 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); | 209 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); |
| 213 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); | 210 | u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); |
| 211 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); | ||
| 214 | 212 | ||
| 215 | extern void omap2xxx_powerdomains_init(void); | 213 | extern void omap2xxx_powerdomains_init(void); |
| 216 | extern void omap3xxx_powerdomains_init(void); | 214 | extern void omap3xxx_powerdomains_init(void); |
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c index 5b4dd971320a..4210c3399769 100644 --- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP2/3 common powerdomain definitions | 2 | * OMAP2/3 common powerdomain definitions |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
| 8 | * | 8 | * |
| @@ -62,13 +62,13 @@ struct powerdomain gfx_omap2_pwrdm = { | |||
| 62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | 62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | |
| 63 | CHIP_IS_OMAP3430ES1), | 63 | CHIP_IS_OMAP3430ES1), |
| 64 | .pwrsts = PWRSTS_OFF_RET_ON, | 64 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 65 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 65 | .pwrsts_logic_ret = PWRSTS_RET, |
| 66 | .banks = 1, | 66 | .banks = 1, |
| 67 | .pwrsts_mem_ret = { | 67 | .pwrsts_mem_ret = { |
| 68 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 68 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
| 69 | }, | 69 | }, |
| 70 | .pwrsts_mem_on = { | 70 | .pwrsts_mem_on = { |
| 71 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 71 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
| 72 | }, | 72 | }, |
| 73 | }; | 73 | }; |
| 74 | 74 | ||
| @@ -76,4 +76,5 @@ struct powerdomain wkup_omap2_pwrdm = { | |||
| 76 | .name = "wkup_pwrdm", | 76 | .name = "wkup_pwrdm", |
| 77 | .prcm_offs = WKUP_MOD, | 77 | .prcm_offs = WKUP_MOD, |
| 78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | 78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), |
| 79 | .pwrsts = PWRSTS_ON, | ||
| 79 | }; | 80 | }; |
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c index 78739e10f5b9..cc389fb2005d 100644 --- a/arch/arm/mach-omap2/powerdomains2xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP2XXX powerdomain definitions | 2 | * OMAP2XXX powerdomain definitions |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
| 8 | * | 8 | * |
| @@ -30,13 +30,13 @@ static struct powerdomain dsp_pwrdm = { | |||
| 30 | .prcm_offs = OMAP24XX_DSP_MOD, | 30 | .prcm_offs = OMAP24XX_DSP_MOD, |
| 31 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 31 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
| 32 | .pwrsts = PWRSTS_OFF_RET_ON, | 32 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 33 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 33 | .pwrsts_logic_ret = PWRSTS_RET, |
| 34 | .banks = 1, | 34 | .banks = 1, |
| 35 | .pwrsts_mem_ret = { | 35 | .pwrsts_mem_ret = { |
| 36 | [0] = PWRDM_POWER_RET, | 36 | [0] = PWRSTS_RET, |
| 37 | }, | 37 | }, |
| 38 | .pwrsts_mem_on = { | 38 | .pwrsts_mem_on = { |
| 39 | [0] = PWRDM_POWER_ON, | 39 | [0] = PWRSTS_ON, |
| 40 | }, | 40 | }, |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| @@ -48,10 +48,10 @@ static struct powerdomain mpu_24xx_pwrdm = { | |||
| 48 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 48 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 49 | .banks = 1, | 49 | .banks = 1, |
| 50 | .pwrsts_mem_ret = { | 50 | .pwrsts_mem_ret = { |
| 51 | [0] = PWRDM_POWER_RET, | 51 | [0] = PWRSTS_RET, |
| 52 | }, | 52 | }, |
| 53 | .pwrsts_mem_on = { | 53 | .pwrsts_mem_on = { |
| 54 | [0] = PWRDM_POWER_ON, | 54 | [0] = PWRSTS_ON, |
| 55 | }, | 55 | }, |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| @@ -87,13 +87,13 @@ static struct powerdomain mdm_pwrdm = { | |||
| 87 | .prcm_offs = OMAP2430_MDM_MOD, | 87 | .prcm_offs = OMAP2430_MDM_MOD, |
| 88 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 88 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
| 89 | .pwrsts = PWRSTS_OFF_RET_ON, | 89 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 90 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 90 | .pwrsts_logic_ret = PWRSTS_RET, |
| 91 | .banks = 1, | 91 | .banks = 1, |
| 92 | .pwrsts_mem_ret = { | 92 | .pwrsts_mem_ret = { |
| 93 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 93 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
| 94 | }, | 94 | }, |
| 95 | .pwrsts_mem_on = { | 95 | .pwrsts_mem_on = { |
| 96 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 96 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
| 97 | }, | 97 | }, |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c index e1bec562625b..9c9c113788b9 100644 --- a/arch/arm/mach-omap2/powerdomains3xxx_data.c +++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP3 powerdomain definitions | 2 | * OMAP3 powerdomain definitions |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2007-2010 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Paul Walmsley, Jouni Högander | 7 | * Paul Walmsley, Jouni Högander |
| 8 | * | 8 | * |
| @@ -47,10 +47,10 @@ static struct powerdomain iva2_pwrdm = { | |||
| 47 | [3] = PWRSTS_OFF_RET, | 47 | [3] = PWRSTS_OFF_RET, |
| 48 | }, | 48 | }, |
| 49 | .pwrsts_mem_on = { | 49 | .pwrsts_mem_on = { |
| 50 | [0] = PWRDM_POWER_ON, | 50 | [0] = PWRSTS_ON, |
| 51 | [1] = PWRDM_POWER_ON, | 51 | [1] = PWRSTS_ON, |
| 52 | [2] = PWRSTS_OFF_ON, | 52 | [2] = PWRSTS_OFF_ON, |
| 53 | [3] = PWRDM_POWER_ON, | 53 | [3] = PWRSTS_ON, |
| 54 | }, | 54 | }, |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| @@ -128,13 +128,13 @@ static struct powerdomain dss_pwrdm = { | |||
| 128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 129 | .prcm_offs = OMAP3430_DSS_MOD, | 129 | .prcm_offs = OMAP3430_DSS_MOD, |
| 130 | .pwrsts = PWRSTS_OFF_RET_ON, | 130 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 131 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 131 | .pwrsts_logic_ret = PWRSTS_RET, |
| 132 | .banks = 1, | 132 | .banks = 1, |
| 133 | .pwrsts_mem_ret = { | 133 | .pwrsts_mem_ret = { |
| 134 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 134 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
| 135 | }, | 135 | }, |
| 136 | .pwrsts_mem_on = { | 136 | .pwrsts_mem_on = { |
| 137 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 137 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
| 138 | }, | 138 | }, |
| 139 | }; | 139 | }; |
| 140 | 140 | ||
| @@ -149,13 +149,13 @@ static struct powerdomain sgx_pwrdm = { | |||
| 149 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 149 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
| 150 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ | 150 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ |
| 151 | .pwrsts = PWRSTS_OFF_ON, | 151 | .pwrsts = PWRSTS_OFF_ON, |
| 152 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 152 | .pwrsts_logic_ret = PWRSTS_RET, |
| 153 | .banks = 1, | 153 | .banks = 1, |
| 154 | .pwrsts_mem_ret = { | 154 | .pwrsts_mem_ret = { |
| 155 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 155 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
| 156 | }, | 156 | }, |
| 157 | .pwrsts_mem_on = { | 157 | .pwrsts_mem_on = { |
| 158 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 158 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
| 159 | }, | 159 | }, |
| 160 | }; | 160 | }; |
| 161 | 161 | ||
| @@ -164,13 +164,13 @@ static struct powerdomain cam_pwrdm = { | |||
| 164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 165 | .prcm_offs = OMAP3430_CAM_MOD, | 165 | .prcm_offs = OMAP3430_CAM_MOD, |
| 166 | .pwrsts = PWRSTS_OFF_RET_ON, | 166 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 167 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 167 | .pwrsts_logic_ret = PWRSTS_RET, |
| 168 | .banks = 1, | 168 | .banks = 1, |
| 169 | .pwrsts_mem_ret = { | 169 | .pwrsts_mem_ret = { |
| 170 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 170 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
| 171 | }, | 171 | }, |
| 172 | .pwrsts_mem_on = { | 172 | .pwrsts_mem_on = { |
| 173 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 173 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
| 174 | }, | 174 | }, |
| 175 | }; | 175 | }; |
| 176 | 176 | ||
| @@ -182,10 +182,10 @@ static struct powerdomain per_pwrdm = { | |||
| 182 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 182 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 183 | .banks = 1, | 183 | .banks = 1, |
| 184 | .pwrsts_mem_ret = { | 184 | .pwrsts_mem_ret = { |
| 185 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 185 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
| 186 | }, | 186 | }, |
| 187 | .pwrsts_mem_on = { | 187 | .pwrsts_mem_on = { |
| 188 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 188 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
| 189 | }, | 189 | }, |
| 190 | }; | 190 | }; |
| 191 | 191 | ||
| @@ -200,7 +200,7 @@ static struct powerdomain neon_pwrdm = { | |||
| 200 | .prcm_offs = OMAP3430_NEON_MOD, | 200 | .prcm_offs = OMAP3430_NEON_MOD, |
| 201 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 201 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
| 202 | .pwrsts = PWRSTS_OFF_RET_ON, | 202 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 203 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 203 | .pwrsts_logic_ret = PWRSTS_RET, |
| 204 | }; | 204 | }; |
| 205 | 205 | ||
| 206 | static struct powerdomain usbhost_pwrdm = { | 206 | static struct powerdomain usbhost_pwrdm = { |
| @@ -208,7 +208,7 @@ static struct powerdomain usbhost_pwrdm = { | |||
| 208 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, | 208 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, |
| 209 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 209 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
| 210 | .pwrsts = PWRSTS_OFF_RET_ON, | 210 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 211 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 211 | .pwrsts_logic_ret = PWRSTS_RET, |
| 212 | /* | 212 | /* |
| 213 | * REVISIT: Enabling usb host save and restore mechanism seems to | 213 | * REVISIT: Enabling usb host save and restore mechanism seems to |
| 214 | * leave the usb host domain permanently in ACTIVE mode after | 214 | * leave the usb host domain permanently in ACTIVE mode after |
| @@ -218,10 +218,10 @@ static struct powerdomain usbhost_pwrdm = { | |||
| 218 | /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */ | 218 | /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */ |
| 219 | .banks = 1, | 219 | .banks = 1, |
| 220 | .pwrsts_mem_ret = { | 220 | .pwrsts_mem_ret = { |
| 221 | [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ | 221 | [0] = PWRSTS_RET, /* MEMRETSTATE */ |
| 222 | }, | 222 | }, |
| 223 | .pwrsts_mem_on = { | 223 | .pwrsts_mem_on = { |
| 224 | [0] = PWRDM_POWER_ON, /* MEMONSTATE */ | 224 | [0] = PWRSTS_ON, /* MEMONSTATE */ |
| 225 | }, | 225 | }, |
| 226 | }; | 226 | }; |
| 227 | 227 | ||
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c index 26d7641076d7..c4222c7036a5 100644 --- a/arch/arm/mach-omap2/powerdomains44xx_data.c +++ b/arch/arm/mach-omap2/powerdomains44xx_data.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * OMAP4 Power domains framework | 2 | * OMAP4 Power domains framework |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2009-2010 Nokia Corporation | 5 | * Copyright (C) 2009-2011 Nokia Corporation |
| 6 | * | 6 | * |
| 7 | * Abhijit Pagare (abhijitpagare@ti.com) | 7 | * Abhijit Pagare (abhijitpagare@ti.com) |
| 8 | * Benoit Cousson (b-cousson@ti.com) | 8 | * Benoit Cousson (b-cousson@ti.com) |
| @@ -40,18 +40,18 @@ static struct powerdomain core_44xx_pwrdm = { | |||
| 40 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 40 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 41 | .banks = 5, | 41 | .banks = 5, |
| 42 | .pwrsts_mem_ret = { | 42 | .pwrsts_mem_ret = { |
| 43 | [0] = PWRDM_POWER_OFF, /* core_nret_bank */ | 43 | [0] = PWRSTS_OFF, /* core_nret_bank */ |
| 44 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ | 44 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ |
| 45 | [2] = PWRDM_POWER_RET, /* core_other_bank */ | 45 | [2] = PWRSTS_RET, /* core_other_bank */ |
| 46 | [3] = PWRSTS_OFF_RET, /* ducati_l2ram */ | 46 | [3] = PWRSTS_OFF_RET, /* ducati_l2ram */ |
| 47 | [4] = PWRSTS_OFF_RET, /* ducati_unicache */ | 47 | [4] = PWRSTS_OFF_RET, /* ducati_unicache */ |
| 48 | }, | 48 | }, |
| 49 | .pwrsts_mem_on = { | 49 | .pwrsts_mem_on = { |
| 50 | [0] = PWRDM_POWER_ON, /* core_nret_bank */ | 50 | [0] = PWRSTS_ON, /* core_nret_bank */ |
| 51 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ | 51 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ |
| 52 | [2] = PWRDM_POWER_ON, /* core_other_bank */ | 52 | [2] = PWRSTS_ON, /* core_other_bank */ |
| 53 | [3] = PWRDM_POWER_ON, /* ducati_l2ram */ | 53 | [3] = PWRSTS_ON, /* ducati_l2ram */ |
| 54 | [4] = PWRDM_POWER_ON, /* ducati_unicache */ | 54 | [4] = PWRSTS_ON, /* ducati_unicache */ |
| 55 | }, | 55 | }, |
| 56 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 56 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 57 | }; | 57 | }; |
| @@ -65,10 +65,10 @@ static struct powerdomain gfx_44xx_pwrdm = { | |||
| 65 | .pwrsts = PWRSTS_OFF_ON, | 65 | .pwrsts = PWRSTS_OFF_ON, |
| 66 | .banks = 1, | 66 | .banks = 1, |
| 67 | .pwrsts_mem_ret = { | 67 | .pwrsts_mem_ret = { |
| 68 | [0] = PWRDM_POWER_OFF, /* gfx_mem */ | 68 | [0] = PWRSTS_OFF, /* gfx_mem */ |
| 69 | }, | 69 | }, |
| 70 | .pwrsts_mem_on = { | 70 | .pwrsts_mem_on = { |
| 71 | [0] = PWRDM_POWER_ON, /* gfx_mem */ | 71 | [0] = PWRSTS_ON, /* gfx_mem */ |
| 72 | }, | 72 | }, |
| 73 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 73 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 74 | }; | 74 | }; |
| @@ -80,15 +80,15 @@ static struct powerdomain abe_44xx_pwrdm = { | |||
| 80 | .prcm_partition = OMAP4430_PRM_PARTITION, | 80 | .prcm_partition = OMAP4430_PRM_PARTITION, |
| 81 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 81 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
| 82 | .pwrsts = PWRSTS_OFF_RET_ON, | 82 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 83 | .pwrsts_logic_ret = PWRDM_POWER_OFF, | 83 | .pwrsts_logic_ret = PWRSTS_OFF, |
| 84 | .banks = 2, | 84 | .banks = 2, |
| 85 | .pwrsts_mem_ret = { | 85 | .pwrsts_mem_ret = { |
| 86 | [0] = PWRDM_POWER_RET, /* aessmem */ | 86 | [0] = PWRSTS_RET, /* aessmem */ |
| 87 | [1] = PWRDM_POWER_OFF, /* periphmem */ | 87 | [1] = PWRSTS_OFF, /* periphmem */ |
| 88 | }, | 88 | }, |
| 89 | .pwrsts_mem_on = { | 89 | .pwrsts_mem_on = { |
| 90 | [0] = PWRDM_POWER_ON, /* aessmem */ | 90 | [0] = PWRSTS_ON, /* aessmem */ |
| 91 | [1] = PWRDM_POWER_ON, /* periphmem */ | 91 | [1] = PWRSTS_ON, /* periphmem */ |
| 92 | }, | 92 | }, |
| 93 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 93 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 94 | }; | 94 | }; |
| @@ -103,10 +103,10 @@ static struct powerdomain dss_44xx_pwrdm = { | |||
| 103 | .pwrsts_logic_ret = PWRSTS_OFF, | 103 | .pwrsts_logic_ret = PWRSTS_OFF, |
| 104 | .banks = 1, | 104 | .banks = 1, |
| 105 | .pwrsts_mem_ret = { | 105 | .pwrsts_mem_ret = { |
| 106 | [0] = PWRDM_POWER_OFF, /* dss_mem */ | 106 | [0] = PWRSTS_OFF, /* dss_mem */ |
| 107 | }, | 107 | }, |
| 108 | .pwrsts_mem_on = { | 108 | .pwrsts_mem_on = { |
| 109 | [0] = PWRDM_POWER_ON, /* dss_mem */ | 109 | [0] = PWRSTS_ON, /* dss_mem */ |
| 110 | }, | 110 | }, |
| 111 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 111 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 112 | }; | 112 | }; |
| @@ -121,14 +121,14 @@ static struct powerdomain tesla_44xx_pwrdm = { | |||
| 121 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 121 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 122 | .banks = 3, | 122 | .banks = 3, |
| 123 | .pwrsts_mem_ret = { | 123 | .pwrsts_mem_ret = { |
| 124 | [0] = PWRDM_POWER_RET, /* tesla_edma */ | 124 | [0] = PWRSTS_RET, /* tesla_edma */ |
| 125 | [1] = PWRSTS_OFF_RET, /* tesla_l1 */ | 125 | [1] = PWRSTS_OFF_RET, /* tesla_l1 */ |
| 126 | [2] = PWRSTS_OFF_RET, /* tesla_l2 */ | 126 | [2] = PWRSTS_OFF_RET, /* tesla_l2 */ |
| 127 | }, | 127 | }, |
| 128 | .pwrsts_mem_on = { | 128 | .pwrsts_mem_on = { |
| 129 | [0] = PWRDM_POWER_ON, /* tesla_edma */ | 129 | [0] = PWRSTS_ON, /* tesla_edma */ |
| 130 | [1] = PWRDM_POWER_ON, /* tesla_l1 */ | 130 | [1] = PWRSTS_ON, /* tesla_l1 */ |
| 131 | [2] = PWRDM_POWER_ON, /* tesla_l2 */ | 131 | [2] = PWRSTS_ON, /* tesla_l2 */ |
| 132 | }, | 132 | }, |
| 133 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 133 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 134 | }; | 134 | }; |
| @@ -142,10 +142,10 @@ static struct powerdomain wkup_44xx_pwrdm = { | |||
| 142 | .pwrsts = PWRSTS_ON, | 142 | .pwrsts = PWRSTS_ON, |
| 143 | .banks = 1, | 143 | .banks = 1, |
| 144 | .pwrsts_mem_ret = { | 144 | .pwrsts_mem_ret = { |
| 145 | [0] = PWRDM_POWER_OFF, /* wkup_bank */ | 145 | [0] = PWRSTS_OFF, /* wkup_bank */ |
| 146 | }, | 146 | }, |
| 147 | .pwrsts_mem_on = { | 147 | .pwrsts_mem_on = { |
| 148 | [0] = PWRDM_POWER_ON, /* wkup_bank */ | 148 | [0] = PWRSTS_ON, /* wkup_bank */ |
| 149 | }, | 149 | }, |
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| @@ -162,7 +162,7 @@ static struct powerdomain cpu0_44xx_pwrdm = { | |||
| 162 | [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ | 162 | [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ |
| 163 | }, | 163 | }, |
| 164 | .pwrsts_mem_on = { | 164 | .pwrsts_mem_on = { |
| 165 | [0] = PWRDM_POWER_ON, /* cpu0_l1 */ | 165 | [0] = PWRSTS_ON, /* cpu0_l1 */ |
| 166 | }, | 166 | }, |
| 167 | }; | 167 | }; |
| 168 | 168 | ||
| @@ -179,7 +179,7 @@ static struct powerdomain cpu1_44xx_pwrdm = { | |||
| 179 | [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ | 179 | [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ |
| 180 | }, | 180 | }, |
| 181 | .pwrsts_mem_on = { | 181 | .pwrsts_mem_on = { |
| 182 | [0] = PWRDM_POWER_ON, /* cpu1_l1 */ | 182 | [0] = PWRSTS_ON, /* cpu1_l1 */ |
| 183 | }, | 183 | }, |
| 184 | }; | 184 | }; |
| 185 | 185 | ||
| @@ -192,10 +192,10 @@ static struct powerdomain emu_44xx_pwrdm = { | |||
| 192 | .pwrsts = PWRSTS_OFF_ON, | 192 | .pwrsts = PWRSTS_OFF_ON, |
| 193 | .banks = 1, | 193 | .banks = 1, |
| 194 | .pwrsts_mem_ret = { | 194 | .pwrsts_mem_ret = { |
| 195 | [0] = PWRDM_POWER_OFF, /* emu_bank */ | 195 | [0] = PWRSTS_OFF, /* emu_bank */ |
| 196 | }, | 196 | }, |
| 197 | .pwrsts_mem_on = { | 197 | .pwrsts_mem_on = { |
| 198 | [0] = PWRDM_POWER_ON, /* emu_bank */ | 198 | [0] = PWRSTS_ON, /* emu_bank */ |
| 199 | }, | 199 | }, |
| 200 | }; | 200 | }; |
| 201 | 201 | ||
| @@ -211,12 +211,12 @@ static struct powerdomain mpu_44xx_pwrdm = { | |||
| 211 | .pwrsts_mem_ret = { | 211 | .pwrsts_mem_ret = { |
| 212 | [0] = PWRSTS_OFF_RET, /* mpu_l1 */ | 212 | [0] = PWRSTS_OFF_RET, /* mpu_l1 */ |
| 213 | [1] = PWRSTS_OFF_RET, /* mpu_l2 */ | 213 | [1] = PWRSTS_OFF_RET, /* mpu_l2 */ |
| 214 | [2] = PWRDM_POWER_RET, /* mpu_ram */ | 214 | [2] = PWRSTS_RET, /* mpu_ram */ |
| 215 | }, | 215 | }, |
| 216 | .pwrsts_mem_on = { | 216 | .pwrsts_mem_on = { |
| 217 | [0] = PWRDM_POWER_ON, /* mpu_l1 */ | 217 | [0] = PWRSTS_ON, /* mpu_l1 */ |
| 218 | [1] = PWRDM_POWER_ON, /* mpu_l2 */ | 218 | [1] = PWRSTS_ON, /* mpu_l2 */ |
| 219 | [2] = PWRDM_POWER_ON, /* mpu_ram */ | 219 | [2] = PWRSTS_ON, /* mpu_ram */ |
| 220 | }, | 220 | }, |
| 221 | }; | 221 | }; |
| 222 | 222 | ||
| @@ -227,19 +227,19 @@ static struct powerdomain ivahd_44xx_pwrdm = { | |||
| 227 | .prcm_partition = OMAP4430_PRM_PARTITION, | 227 | .prcm_partition = OMAP4430_PRM_PARTITION, |
| 228 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 228 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
| 229 | .pwrsts = PWRSTS_OFF_RET_ON, | 229 | .pwrsts = PWRSTS_OFF_RET_ON, |
| 230 | .pwrsts_logic_ret = PWRDM_POWER_OFF, | 230 | .pwrsts_logic_ret = PWRSTS_OFF, |
| 231 | .banks = 4, | 231 | .banks = 4, |
| 232 | .pwrsts_mem_ret = { | 232 | .pwrsts_mem_ret = { |
| 233 | [0] = PWRDM_POWER_OFF, /* hwa_mem */ | 233 | [0] = PWRSTS_OFF, /* hwa_mem */ |
| 234 | [1] = PWRSTS_OFF_RET, /* sl2_mem */ | 234 | [1] = PWRSTS_OFF_RET, /* sl2_mem */ |
| 235 | [2] = PWRSTS_OFF_RET, /* tcm1_mem */ | 235 | [2] = PWRSTS_OFF_RET, /* tcm1_mem */ |
| 236 | [3] = PWRSTS_OFF_RET, /* tcm2_mem */ | 236 | [3] = PWRSTS_OFF_RET, /* tcm2_mem */ |
| 237 | }, | 237 | }, |
| 238 | .pwrsts_mem_on = { | 238 | .pwrsts_mem_on = { |
| 239 | [0] = PWRDM_POWER_ON, /* hwa_mem */ | 239 | [0] = PWRSTS_ON, /* hwa_mem */ |
| 240 | [1] = PWRDM_POWER_ON, /* sl2_mem */ | 240 | [1] = PWRSTS_ON, /* sl2_mem */ |
| 241 | [2] = PWRDM_POWER_ON, /* tcm1_mem */ | 241 | [2] = PWRSTS_ON, /* tcm1_mem */ |
| 242 | [3] = PWRDM_POWER_ON, /* tcm2_mem */ | 242 | [3] = PWRSTS_ON, /* tcm2_mem */ |
| 243 | }, | 243 | }, |
| 244 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 244 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 245 | }; | 245 | }; |
| @@ -253,10 +253,10 @@ static struct powerdomain cam_44xx_pwrdm = { | |||
| 253 | .pwrsts = PWRSTS_OFF_ON, | 253 | .pwrsts = PWRSTS_OFF_ON, |
| 254 | .banks = 1, | 254 | .banks = 1, |
| 255 | .pwrsts_mem_ret = { | 255 | .pwrsts_mem_ret = { |
| 256 | [0] = PWRDM_POWER_OFF, /* cam_mem */ | 256 | [0] = PWRSTS_OFF, /* cam_mem */ |
| 257 | }, | 257 | }, |
| 258 | .pwrsts_mem_on = { | 258 | .pwrsts_mem_on = { |
| 259 | [0] = PWRDM_POWER_ON, /* cam_mem */ | 259 | [0] = PWRSTS_ON, /* cam_mem */ |
| 260 | }, | 260 | }, |
| 261 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 261 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 262 | }; | 262 | }; |
| @@ -271,10 +271,10 @@ static struct powerdomain l3init_44xx_pwrdm = { | |||
| 271 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 271 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 272 | .banks = 1, | 272 | .banks = 1, |
| 273 | .pwrsts_mem_ret = { | 273 | .pwrsts_mem_ret = { |
| 274 | [0] = PWRDM_POWER_OFF, /* l3init_bank1 */ | 274 | [0] = PWRSTS_OFF, /* l3init_bank1 */ |
| 275 | }, | 275 | }, |
| 276 | .pwrsts_mem_on = { | 276 | .pwrsts_mem_on = { |
| 277 | [0] = PWRDM_POWER_ON, /* l3init_bank1 */ | 277 | [0] = PWRSTS_ON, /* l3init_bank1 */ |
| 278 | }, | 278 | }, |
| 279 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 279 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 280 | }; | 280 | }; |
| @@ -289,12 +289,12 @@ static struct powerdomain l4per_44xx_pwrdm = { | |||
| 289 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 289 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
| 290 | .banks = 2, | 290 | .banks = 2, |
| 291 | .pwrsts_mem_ret = { | 291 | .pwrsts_mem_ret = { |
| 292 | [0] = PWRDM_POWER_OFF, /* nonretained_bank */ | 292 | [0] = PWRSTS_OFF, /* nonretained_bank */ |
| 293 | [1] = PWRDM_POWER_RET, /* retained_bank */ | 293 | [1] = PWRSTS_RET, /* retained_bank */ |
| 294 | }, | 294 | }, |
| 295 | .pwrsts_mem_on = { | 295 | .pwrsts_mem_on = { |
| 296 | [0] = PWRDM_POWER_ON, /* nonretained_bank */ | 296 | [0] = PWRSTS_ON, /* nonretained_bank */ |
| 297 | [1] = PWRDM_POWER_ON, /* retained_bank */ | 297 | [1] = PWRSTS_ON, /* retained_bank */ |
| 298 | }, | 298 | }, |
| 299 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, | 299 | .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, |
| 300 | }; | 300 | }; |
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 87486f559784..0363dcb0ef93 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
| @@ -121,6 +121,10 @@ | |||
| 121 | #define OMAP24XX_ST_MCSPI2_MASK (1 << 18) | 121 | #define OMAP24XX_ST_MCSPI2_MASK (1 << 18) |
| 122 | #define OMAP24XX_ST_MCSPI1_SHIFT 17 | 122 | #define OMAP24XX_ST_MCSPI1_SHIFT 17 |
| 123 | #define OMAP24XX_ST_MCSPI1_MASK (1 << 17) | 123 | #define OMAP24XX_ST_MCSPI1_MASK (1 << 17) |
| 124 | #define OMAP24XX_ST_MCBSP2_SHIFT 16 | ||
| 125 | #define OMAP24XX_ST_MCBSP2_MASK (1 << 16) | ||
| 126 | #define OMAP24XX_ST_MCBSP1_SHIFT 15 | ||
| 127 | #define OMAP24XX_ST_MCBSP1_MASK (1 << 15) | ||
| 124 | #define OMAP24XX_ST_GPT12_SHIFT 14 | 128 | #define OMAP24XX_ST_GPT12_SHIFT 14 |
| 125 | #define OMAP24XX_ST_GPT12_MASK (1 << 14) | 129 | #define OMAP24XX_ST_GPT12_MASK (1 << 14) |
| 126 | #define OMAP24XX_ST_GPT11_SHIFT 13 | 130 | #define OMAP24XX_ST_GPT11_SHIFT 13 |
| @@ -191,6 +195,8 @@ | |||
| 191 | #define OMAP3430_AUTOIDLE_MASK (1 << 0) | 195 | #define OMAP3430_AUTOIDLE_MASK (1 << 0) |
| 192 | 196 | ||
| 193 | /* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ | 197 | /* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ |
| 198 | #define OMAP3430_EN_MMC3_MASK (1 << 30) | ||
| 199 | #define OMAP3430_EN_MMC3_SHIFT 30 | ||
| 194 | #define OMAP3430_EN_MMC2_MASK (1 << 25) | 200 | #define OMAP3430_EN_MMC2_MASK (1 << 25) |
| 195 | #define OMAP3430_EN_MMC2_SHIFT 25 | 201 | #define OMAP3430_EN_MMC2_SHIFT 25 |
| 196 | #define OMAP3430_EN_MMC1_MASK (1 << 24) | 202 | #define OMAP3430_EN_MMC1_MASK (1 << 24) |
| @@ -231,6 +237,8 @@ | |||
| 231 | #define OMAP3430_EN_HSOTGUSB_SHIFT 4 | 237 | #define OMAP3430_EN_HSOTGUSB_SHIFT 4 |
| 232 | 238 | ||
| 233 | /* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ | 239 | /* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ |
| 240 | #define OMAP3430_ST_MMC3_SHIFT 30 | ||
| 241 | #define OMAP3430_ST_MMC3_MASK (1 << 30) | ||
| 234 | #define OMAP3430_ST_MMC2_SHIFT 25 | 242 | #define OMAP3430_ST_MMC2_SHIFT 25 |
| 235 | #define OMAP3430_ST_MMC2_MASK (1 << 25) | 243 | #define OMAP3430_ST_MMC2_MASK (1 << 25) |
| 236 | #define OMAP3430_ST_MMC1_SHIFT 24 | 244 | #define OMAP3430_ST_MMC1_SHIFT 24 |
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h index 729a644ce852..d22d1b43bccd 100644 --- a/arch/arm/mach-omap2/prcm_mpu44xx.h +++ b/arch/arm/mach-omap2/prcm_mpu44xx.h | |||
| @@ -38,8 +38,8 @@ | |||
| 38 | #define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 | 38 | #define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 |
| 39 | 39 | ||
| 40 | /* PRCM_MPU clockdomain register offsets (from instance start) */ | 40 | /* PRCM_MPU clockdomain register offsets (from instance start) */ |
| 41 | #define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0000 | 41 | #define OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS 0x0018 |
| 42 | #define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0000 | 42 | #define OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS 0x0018 |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | /* | 45 | /* |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 47eef48b8830..1ac361b7b8cb 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
| @@ -680,7 +680,7 @@ static int __init omap_serial_early_init(void) | |||
| 680 | num_uarts++; | 680 | num_uarts++; |
| 681 | 681 | ||
| 682 | /* | 682 | /* |
| 683 | * NOTE: omap_hwmod_init() has not yet been called, | 683 | * NOTE: omap_hwmod_setup*() has not yet been called, |
| 684 | * so no hwmod functions will work yet. | 684 | * so no hwmod functions will work yet. |
| 685 | */ | 685 | */ |
| 686 | 686 | ||
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index c37e823266d3..95ac336fe3f7 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c | |||
| @@ -900,7 +900,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
| 900 | return PTR_ERR(dbg_dir); | 900 | return PTR_ERR(dbg_dir); |
| 901 | } | 901 | } |
| 902 | 902 | ||
| 903 | (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir, | 903 | (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir, |
| 904 | (void *)sr_info, &pm_sr_fops); | 904 | (void *)sr_info, &pm_sr_fops); |
| 905 | (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir, | 905 | (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir, |
| 906 | &sr_info->err_weight); | 906 | &sr_info->err_weight); |
| @@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) | |||
| 939 | strcpy(name, "volt_"); | 939 | strcpy(name, "volt_"); |
| 940 | sprintf(volt_name, "%d", volt_data[i].volt_nominal); | 940 | sprintf(volt_name, "%d", volt_data[i].volt_nominal); |
| 941 | strcat(name, volt_name); | 941 | strcat(name, volt_name); |
| 942 | (void) debugfs_create_x32(name, S_IRUGO | S_IWUGO, nvalue_dir, | 942 | (void) debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir, |
| 943 | &(sr_info->nvalue_table[i].nvalue)); | 943 | &(sr_info->nvalue_table[i].nvalue)); |
| 944 | } | 944 | } |
| 945 | 945 | ||
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index 7b7c2683ae7b..3b9cf85f4bb9 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
| @@ -39,10 +39,12 @@ | |||
| 39 | #include <asm/mach/time.h> | 39 | #include <asm/mach/time.h> |
| 40 | #include <plat/dmtimer.h> | 40 | #include <plat/dmtimer.h> |
| 41 | #include <asm/localtimer.h> | 41 | #include <asm/localtimer.h> |
| 42 | #include <asm/sched_clock.h> | ||
| 43 | #include <plat/common.h> | ||
| 44 | #include <plat/omap_hwmod.h> | ||
| 42 | 45 | ||
| 43 | #include "timer-gp.h" | 46 | #include "timer-gp.h" |
| 44 | 47 | ||
| 45 | #include <plat/common.h> | ||
| 46 | 48 | ||
| 47 | /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ | 49 | /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ |
| 48 | #define MAX_GPTIMER_ID 12 | 50 | #define MAX_GPTIMER_ID 12 |
| @@ -132,9 +134,13 @@ static void __init omap2_gp_clockevent_init(void) | |||
| 132 | { | 134 | { |
| 133 | u32 tick_rate; | 135 | u32 tick_rate; |
| 134 | int src; | 136 | int src; |
| 137 | char clockevent_hwmod_name[8]; /* 8 = sizeof("timerXX0") */ | ||
| 135 | 138 | ||
| 136 | inited = 1; | 139 | inited = 1; |
| 137 | 140 | ||
| 141 | sprintf(clockevent_hwmod_name, "timer%d", gptimer_id); | ||
| 142 | omap_hwmod_setup_one(clockevent_hwmod_name); | ||
| 143 | |||
| 138 | gptimer = omap_dm_timer_request_specific(gptimer_id); | 144 | gptimer = omap_dm_timer_request_specific(gptimer_id); |
| 139 | BUG_ON(gptimer == NULL); | 145 | BUG_ON(gptimer == NULL); |
| 140 | gptimer_wakeup = gptimer; | 146 | gptimer_wakeup = gptimer; |
| @@ -190,6 +196,7 @@ static void __init omap2_gp_clocksource_init(void) | |||
| 190 | /* | 196 | /* |
| 191 | * clocksource | 197 | * clocksource |
| 192 | */ | 198 | */ |
| 199 | static DEFINE_CLOCK_DATA(cd); | ||
| 193 | static struct omap_dm_timer *gpt_clocksource; | 200 | static struct omap_dm_timer *gpt_clocksource; |
| 194 | static cycle_t clocksource_read_cycles(struct clocksource *cs) | 201 | static cycle_t clocksource_read_cycles(struct clocksource *cs) |
| 195 | { | 202 | { |
| @@ -204,6 +211,15 @@ static struct clocksource clocksource_gpt = { | |||
| 204 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 211 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
| 205 | }; | 212 | }; |
| 206 | 213 | ||
| 214 | static void notrace dmtimer_update_sched_clock(void) | ||
| 215 | { | ||
| 216 | u32 cyc; | ||
| 217 | |||
| 218 | cyc = omap_dm_timer_read_counter(gpt_clocksource); | ||
| 219 | |||
| 220 | update_sched_clock(&cd, cyc, (u32)~0); | ||
| 221 | } | ||
| 222 | |||
| 207 | /* Setup free-running counter for clocksource */ | 223 | /* Setup free-running counter for clocksource */ |
| 208 | static void __init omap2_gp_clocksource_init(void) | 224 | static void __init omap2_gp_clocksource_init(void) |
| 209 | { | 225 | { |
| @@ -224,6 +240,8 @@ static void __init omap2_gp_clocksource_init(void) | |||
| 224 | 240 | ||
| 225 | omap_dm_timer_set_load_start(gpt, 1, 0); | 241 | omap_dm_timer_set_load_start(gpt, 1, 0); |
| 226 | 242 | ||
| 243 | init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate); | ||
| 244 | |||
| 227 | if (clocksource_register_hz(&clocksource_gpt, tick_rate)) | 245 | if (clocksource_register_hz(&clocksource_gpt, tick_rate)) |
| 228 | printk(err2, clocksource_gpt.name); | 246 | printk(err2, clocksource_gpt.name); |
| 229 | } | 247 | } |
diff --git a/arch/arm/mach-s5p6442/include/mach/map.h b/arch/arm/mach-s5p6442/include/mach/map.h index 203dd5a18bd5..058dab4482a1 100644 --- a/arch/arm/mach-s5p6442/include/mach/map.h +++ b/arch/arm/mach-s5p6442/include/mach/map.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* linux/arch/arm/mach-s5p6442/include/mach/map.h | 1 | /* linux/arch/arm/mach-s5p6442/include/mach/map.h |
| 2 | * | 2 | * |
| 3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | 3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com/ | 4 | * http://www.samsung.com/ |
| 5 | * | 5 | * |
| 6 | * S5P6442 - Memory map definitions | 6 | * S5P6442 - Memory map definitions |
| @@ -16,56 +16,61 @@ | |||
| 16 | #include <plat/map-base.h> | 16 | #include <plat/map-base.h> |
| 17 | #include <plat/map-s5p.h> | 17 | #include <plat/map-s5p.h> |
| 18 | 18 | ||
| 19 | #define S5P6442_PA_CHIPID (0xE0000000) | 19 | #define S5P6442_PA_SDRAM 0x20000000 |
| 20 | #define S5P_PA_CHIPID S5P6442_PA_CHIPID | ||
| 21 | 20 | ||
| 22 | #define S5P6442_PA_SYSCON (0xE0100000) | 21 | #define S5P6442_PA_I2S0 0xC0B00000 |
| 23 | #define S5P_PA_SYSCON S5P6442_PA_SYSCON | 22 | #define S5P6442_PA_I2S1 0xF2200000 |
| 24 | 23 | ||
| 25 | #define S5P6442_PA_GPIO (0xE0200000) | 24 | #define S5P6442_PA_CHIPID 0xE0000000 |
| 26 | 25 | ||
| 27 | #define S5P6442_PA_VIC0 (0xE4000000) | 26 | #define S5P6442_PA_SYSCON 0xE0100000 |
| 28 | #define S5P6442_PA_VIC1 (0xE4100000) | ||
| 29 | #define S5P6442_PA_VIC2 (0xE4200000) | ||
| 30 | 27 | ||
| 31 | #define S5P6442_PA_SROMC (0xE7000000) | 28 | #define S5P6442_PA_GPIO 0xE0200000 |
| 32 | #define S5P_PA_SROMC S5P6442_PA_SROMC | ||
| 33 | 29 | ||
| 34 | #define S5P6442_PA_MDMA 0xE8000000 | 30 | #define S5P6442_PA_VIC0 0xE4000000 |
| 35 | #define S5P6442_PA_PDMA 0xE9000000 | 31 | #define S5P6442_PA_VIC1 0xE4100000 |
| 32 | #define S5P6442_PA_VIC2 0xE4200000 | ||
| 36 | 33 | ||
| 37 | #define S5P6442_PA_TIMER (0xEA000000) | 34 | #define S5P6442_PA_SROMC 0xE7000000 |
| 38 | #define S5P_PA_TIMER S5P6442_PA_TIMER | ||
| 39 | 35 | ||
| 40 | #define S5P6442_PA_SYSTIMER (0xEA100000) | 36 | #define S5P6442_PA_MDMA 0xE8000000 |
| 37 | #define S5P6442_PA_PDMA 0xE9000000 | ||
| 41 | 38 | ||
| 42 | #define S5P6442_PA_WATCHDOG (0xEA200000) | 39 | #define S5P6442_PA_TIMER 0xEA000000 |
| 43 | 40 | ||
| 44 | #define S5P6442_PA_UART (0xEC000000) | 41 | #define S5P6442_PA_SYSTIMER 0xEA100000 |
| 45 | 42 | ||
| 46 | #define S5P_PA_UART0 (S5P6442_PA_UART + 0x0) | 43 | #define S5P6442_PA_WATCHDOG 0xEA200000 |
| 47 | #define S5P_PA_UART1 (S5P6442_PA_UART + 0x400) | ||
| 48 | #define S5P_PA_UART2 (S5P6442_PA_UART + 0x800) | ||
| 49 | #define S5P_SZ_UART SZ_256 | ||
| 50 | 44 | ||
| 51 | #define S5P6442_PA_IIC0 (0xEC100000) | 45 | #define S5P6442_PA_UART 0xEC000000 |
| 52 | 46 | ||
| 53 | #define S5P6442_PA_SDRAM (0x20000000) | 47 | #define S5P6442_PA_IIC0 0xEC100000 |
| 54 | #define S5P_PA_SDRAM S5P6442_PA_SDRAM | ||
| 55 | 48 | ||
| 56 | #define S5P6442_PA_SPI 0xEC300000 | 49 | #define S5P6442_PA_SPI 0xEC300000 |
| 57 | 50 | ||
| 58 | /* I2S */ | ||
| 59 | #define S5P6442_PA_I2S0 0xC0B00000 | ||
| 60 | #define S5P6442_PA_I2S1 0xF2200000 | ||
| 61 | |||
| 62 | /* PCM */ | ||
| 63 | #define S5P6442_PA_PCM0 0xF2400000 | 51 | #define S5P6442_PA_PCM0 0xF2400000 |
| 64 | #define S5P6442_PA_PCM1 0xF2500000 | 52 | #define S5P6442_PA_PCM1 0xF2500000 |
| 65 | 53 | ||
| 66 | /* compatibiltiy defines. */ | 54 | /* Compatibiltiy Defines */ |
| 55 | |||
| 56 | #define S3C_PA_IIC S5P6442_PA_IIC0 | ||
| 67 | #define S3C_PA_WDT S5P6442_PA_WATCHDOG | 57 | #define S3C_PA_WDT S5P6442_PA_WATCHDOG |
| 58 | |||
| 59 | #define S5P_PA_CHIPID S5P6442_PA_CHIPID | ||
| 60 | #define S5P_PA_SDRAM S5P6442_PA_SDRAM | ||
| 61 | #define S5P_PA_SROMC S5P6442_PA_SROMC | ||
| 62 | #define S5P_PA_SYSCON S5P6442_PA_SYSCON | ||
| 63 | #define S5P_PA_TIMER S5P6442_PA_TIMER | ||
| 64 | |||
| 65 | /* UART */ | ||
| 66 | |||
| 68 | #define S3C_PA_UART S5P6442_PA_UART | 67 | #define S3C_PA_UART S5P6442_PA_UART |
| 69 | #define S3C_PA_IIC S5P6442_PA_IIC0 | 68 | |
| 69 | #define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET)) | ||
| 70 | #define S5P_PA_UART0 S5P_PA_UART(0) | ||
| 71 | #define S5P_PA_UART1 S5P_PA_UART(1) | ||
| 72 | #define S5P_PA_UART2 S5P_PA_UART(2) | ||
| 73 | |||
| 74 | #define S5P_SZ_UART SZ_256 | ||
| 70 | 75 | ||
| 71 | #endif /* __ASM_ARCH_MAP_H */ | 76 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h b/arch/arm/mach-s5p64x0/include/mach/map.h index a9365e5ba614..95c91257c7ca 100644 --- a/arch/arm/mach-s5p64x0/include/mach/map.h +++ b/arch/arm/mach-s5p64x0/include/mach/map.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* linux/arch/arm/mach-s5p64x0/include/mach/map.h | 1 | /* linux/arch/arm/mach-s5p64x0/include/mach/map.h |
| 2 | * | 2 | * |
| 3 | * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. | 3 | * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com | 4 | * http://www.samsung.com |
| 5 | * | 5 | * |
| 6 | * S5P64X0 - Memory map definitions | 6 | * S5P64X0 - Memory map definitions |
| @@ -16,64 +16,46 @@ | |||
| 16 | #include <plat/map-base.h> | 16 | #include <plat/map-base.h> |
| 17 | #include <plat/map-s5p.h> | 17 | #include <plat/map-s5p.h> |
| 18 | 18 | ||
| 19 | #define S5P64X0_PA_SDRAM (0x20000000) | 19 | #define S5P64X0_PA_SDRAM 0x20000000 |
| 20 | 20 | ||
| 21 | #define S5P64X0_PA_CHIPID (0xE0000000) | 21 | #define S5P64X0_PA_CHIPID 0xE0000000 |
| 22 | #define S5P_PA_CHIPID S5P64X0_PA_CHIPID | ||
| 23 | |||
| 24 | #define S5P64X0_PA_SYSCON (0xE0100000) | ||
| 25 | #define S5P_PA_SYSCON S5P64X0_PA_SYSCON | ||
| 26 | |||
| 27 | #define S5P64X0_PA_GPIO (0xE0308000) | ||
| 28 | |||
| 29 | #define S5P64X0_PA_VIC0 (0xE4000000) | ||
| 30 | #define S5P64X0_PA_VIC1 (0xE4100000) | ||
| 31 | 22 | ||
| 32 | #define S5P64X0_PA_SROMC (0xE7000000) | 23 | #define S5P64X0_PA_SYSCON 0xE0100000 |
| 33 | #define S5P_PA_SROMC S5P64X0_PA_SROMC | ||
| 34 | |||
| 35 | #define S5P64X0_PA_PDMA (0xE9000000) | ||
| 36 | |||
| 37 | #define S5P64X0_PA_TIMER (0xEA000000) | ||
| 38 | #define S5P_PA_TIMER S5P64X0_PA_TIMER | ||
| 39 | 24 | ||
| 40 | #define S5P64X0_PA_RTC (0xEA100000) | 25 | #define S5P64X0_PA_GPIO 0xE0308000 |
| 41 | 26 | ||
| 42 | #define S5P64X0_PA_WDT (0xEA200000) | 27 | #define S5P64X0_PA_VIC0 0xE4000000 |
| 28 | #define S5P64X0_PA_VIC1 0xE4100000 | ||
| 43 | 29 | ||
| 44 | #define S5P6440_PA_UART(x) (0xEC000000 + ((x) * S3C_UART_OFFSET)) | 30 | #define S5P64X0_PA_SROMC 0xE7000000 |
| 45 | #define S5P6450_PA_UART(x) ((x < 5) ? (0xEC800000 + ((x) * S3C_UART_OFFSET)) : (0xEC000000)) | ||
| 46 | 31 | ||
| 47 | #define S5P_PA_UART0 S5P6450_PA_UART(0) | 32 | #define S5P64X0_PA_PDMA 0xE9000000 |
| 48 | #define S5P_PA_UART1 S5P6450_PA_UART(1) | ||
| 49 | #define S5P_PA_UART2 S5P6450_PA_UART(2) | ||
| 50 | #define S5P_PA_UART3 S5P6450_PA_UART(3) | ||
| 51 | #define S5P_PA_UART4 S5P6450_PA_UART(4) | ||
| 52 | #define S5P_PA_UART5 S5P6450_PA_UART(5) | ||
| 53 | 33 | ||
| 54 | #define S5P_SZ_UART SZ_256 | 34 | #define S5P64X0_PA_TIMER 0xEA000000 |
| 35 | #define S5P64X0_PA_RTC 0xEA100000 | ||
| 36 | #define S5P64X0_PA_WDT 0xEA200000 | ||
| 55 | 37 | ||
| 56 | #define S5P6440_PA_IIC0 (0xEC104000) | 38 | #define S5P6440_PA_IIC0 0xEC104000 |
| 57 | #define S5P6440_PA_IIC1 (0xEC20F000) | 39 | #define S5P6440_PA_IIC1 0xEC20F000 |
| 58 | #define S5P6450_PA_IIC0 (0xEC100000) | 40 | #define S5P6450_PA_IIC0 0xEC100000 |
| 59 | #define S5P6450_PA_IIC1 (0xEC200000) | 41 | #define S5P6450_PA_IIC1 0xEC200000 |
| 60 | 42 | ||
| 61 | #define S5P64X0_PA_SPI0 (0xEC400000) | 43 | #define S5P64X0_PA_SPI0 0xEC400000 |
| 62 | #define S5P64X0_PA_SPI1 (0xEC500000) | 44 | #define S5P64X0_PA_SPI1 0xEC500000 |
| 63 | 45 | ||
| 64 | #define S5P64X0_PA_HSOTG (0xED100000) | 46 | #define S5P64X0_PA_HSOTG 0xED100000 |
| 65 | 47 | ||
| 66 | #define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) | 48 | #define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) |
| 67 | 49 | ||
| 68 | #define S5P64X0_PA_I2S (0xF2000000) | 50 | #define S5P64X0_PA_I2S 0xF2000000 |
| 69 | #define S5P6450_PA_I2S1 0xF2800000 | 51 | #define S5P6450_PA_I2S1 0xF2800000 |
| 70 | #define S5P6450_PA_I2S2 0xF2900000 | 52 | #define S5P6450_PA_I2S2 0xF2900000 |
| 71 | 53 | ||
| 72 | #define S5P64X0_PA_PCM (0xF2100000) | 54 | #define S5P64X0_PA_PCM 0xF2100000 |
| 73 | 55 | ||
| 74 | #define S5P64X0_PA_ADC (0xF3000000) | 56 | #define S5P64X0_PA_ADC 0xF3000000 |
| 75 | 57 | ||
| 76 | /* compatibiltiy defines. */ | 58 | /* Compatibiltiy Defines */ |
| 77 | 59 | ||
| 78 | #define S3C_PA_HSMMC0 S5P64X0_PA_HSMMC(0) | 60 | #define S3C_PA_HSMMC0 S5P64X0_PA_HSMMC(0) |
| 79 | #define S3C_PA_HSMMC1 S5P64X0_PA_HSMMC(1) | 61 | #define S3C_PA_HSMMC1 S5P64X0_PA_HSMMC(1) |
| @@ -83,6 +65,25 @@ | |||
| 83 | #define S3C_PA_RTC S5P64X0_PA_RTC | 65 | #define S3C_PA_RTC S5P64X0_PA_RTC |
| 84 | #define S3C_PA_WDT S5P64X0_PA_WDT | 66 | #define S3C_PA_WDT S5P64X0_PA_WDT |
| 85 | 67 | ||
| 68 | #define S5P_PA_CHIPID S5P64X0_PA_CHIPID | ||
| 69 | #define S5P_PA_SROMC S5P64X0_PA_SROMC | ||
| 70 | #define S5P_PA_SYSCON S5P64X0_PA_SYSCON | ||
| 71 | #define S5P_PA_TIMER S5P64X0_PA_TIMER | ||
| 72 | |||
| 86 | #define SAMSUNG_PA_ADC S5P64X0_PA_ADC | 73 | #define SAMSUNG_PA_ADC S5P64X0_PA_ADC |
| 87 | 74 | ||
| 75 | /* UART */ | ||
| 76 | |||
| 77 | #define S5P6440_PA_UART(x) (0xEC000000 + ((x) * S3C_UART_OFFSET)) | ||
| 78 | #define S5P6450_PA_UART(x) ((x < 5) ? (0xEC800000 + ((x) * S3C_UART_OFFSET)) : (0xEC000000)) | ||
| 79 | |||
| 80 | #define S5P_PA_UART0 S5P6450_PA_UART(0) | ||
| 81 | #define S5P_PA_UART1 S5P6450_PA_UART(1) | ||
| 82 | #define S5P_PA_UART2 S5P6450_PA_UART(2) | ||
| 83 | #define S5P_PA_UART3 S5P6450_PA_UART(3) | ||
| 84 | #define S5P_PA_UART4 S5P6450_PA_UART(4) | ||
| 85 | #define S5P_PA_UART5 S5P6450_PA_UART(5) | ||
| 86 | |||
| 87 | #define S5P_SZ_UART SZ_256 | ||
| 88 | |||
| 88 | #endif /* __ASM_ARCH_MAP_H */ | 89 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h index 328467b346aa..ccbe6b767f7d 100644 --- a/arch/arm/mach-s5pc100/include/mach/map.h +++ b/arch/arm/mach-s5pc100/include/mach/map.h | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | /* linux/arch/arm/mach-s5pc100/include/mach/map.h | 1 | /* linux/arch/arm/mach-s5pc100/include/mach/map.h |
| 2 | * | 2 | * |
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
| 4 | * http://www.samsung.com/ | ||
| 5 | * | ||
| 3 | * Copyright 2009 Samsung Electronics Co. | 6 | * Copyright 2009 Samsung Electronics Co. |
| 4 | * Byungho Min <bhmin@samsung.com> | 7 | * Byungho Min <bhmin@samsung.com> |
| 5 | * | 8 | * |
| @@ -16,145 +19,115 @@ | |||
| 16 | #include <plat/map-base.h> | 19 | #include <plat/map-base.h> |
| 17 | #include <plat/map-s5p.h> | 20 | #include <plat/map-s5p.h> |
| 18 | 21 | ||
| 19 | /* | 22 | #define S5PC100_PA_SDRAM 0x20000000 |
| 20 | * map-base.h has already defined virtual memory address | 23 | |
| 21 | * S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s) | 24 | #define S5PC100_PA_ONENAND 0xE7100000 |
| 22 | * S3C_VA_SYS S3C_ADDR(0x00100000) system control | 25 | #define S5PC100_PA_ONENAND_BUF 0xB0000000 |
| 23 | * S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used) | 26 | |
| 24 | * S3C_VA_TIMER S3C_ADDR(0x00300000) timer block | 27 | #define S5PC100_PA_CHIPID 0xE0000000 |
| 25 | * S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog | ||
| 26 | * S3C_VA_UART S3C_ADDR(0x01000000) UART | ||
| 27 | * | ||
| 28 | * S5PC100 specific virtual memory address can be defined here | ||
| 29 | * S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO | ||
| 30 | * | ||
| 31 | */ | ||
| 32 | 28 | ||
| 33 | #define S5PC100_PA_ONENAND_BUF (0xB0000000) | 29 | #define S5PC100_PA_SYSCON 0xE0100000 |
| 34 | #define S5PC100_SZ_ONENAND_BUF (SZ_256M - SZ_32M) | ||
| 35 | 30 | ||
| 36 | /* Chip ID */ | 31 | #define S5PC100_PA_OTHERS 0xE0200000 |
| 37 | 32 | ||
| 38 | #define S5PC100_PA_CHIPID (0xE0000000) | 33 | #define S5PC100_PA_GPIO 0xE0300000 |
| 39 | #define S5P_PA_CHIPID S5PC100_PA_CHIPID | ||
| 40 | 34 | ||
| 41 | #define S5PC100_PA_SYSCON (0xE0100000) | 35 | #define S5PC100_PA_VIC0 0xE4000000 |
| 42 | #define S5P_PA_SYSCON S5PC100_PA_SYSCON | 36 | #define S5PC100_PA_VIC1 0xE4100000 |
| 37 | #define S5PC100_PA_VIC2 0xE4200000 | ||
| 43 | 38 | ||
| 44 | #define S5PC100_PA_OTHERS (0xE0200000) | 39 | #define S5PC100_PA_SROMC 0xE7000000 |
| 45 | #define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000) | ||
| 46 | 40 | ||
| 47 | #define S5PC100_PA_GPIO (0xE0300000) | 41 | #define S5PC100_PA_CFCON 0xE7800000 |
| 48 | #define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) | ||
| 49 | 42 | ||
| 50 | /* Interrupt */ | 43 | #define S5PC100_PA_MDMA 0xE8100000 |
| 51 | #define S5PC100_PA_VIC0 (0xE4000000) | 44 | #define S5PC100_PA_PDMA0 0xE9000000 |
| 52 | #define S5PC100_PA_VIC1 (0xE4100000) | 45 | #define S5PC100_PA_PDMA1 0xE9200000 |
| 53 | #define S5PC100_PA_VIC2 (0xE4200000) | ||
| 54 | #define S5PC100_VA_VIC S3C_VA_IRQ | ||
| 55 | #define S5PC100_VA_VIC_OFFSET 0x10000 | ||
| 56 | #define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) | ||
| 57 | 46 | ||
| 58 | #define S5PC100_PA_SROMC (0xE7000000) | 47 | #define S5PC100_PA_TIMER 0xEA000000 |
| 59 | #define S5P_PA_SROMC S5PC100_PA_SROMC | 48 | #define S5PC100_PA_SYSTIMER 0xEA100000 |
| 49 | #define S5PC100_PA_WATCHDOG 0xEA200000 | ||
| 50 | #define S5PC100_PA_RTC 0xEA300000 | ||
| 60 | 51 | ||
| 61 | #define S5PC100_PA_ONENAND (0xE7100000) | 52 | #define S5PC100_PA_UART 0xEC000000 |
| 62 | 53 | ||
| 63 | #define S5PC100_PA_CFCON (0xE7800000) | 54 | #define S5PC100_PA_IIC0 0xEC100000 |
| 55 | #define S5PC100_PA_IIC1 0xEC200000 | ||
| 64 | 56 | ||
| 65 | /* DMA */ | 57 | #define S5PC100_PA_SPI0 0xEC300000 |
| 66 | #define S5PC100_PA_MDMA (0xE8100000) | 58 | #define S5PC100_PA_SPI1 0xEC400000 |
| 67 | #define S5PC100_PA_PDMA0 (0xE9000000) | 59 | #define S5PC100_PA_SPI2 0xEC500000 |
| 68 | #define S5PC100_PA_PDMA1 (0xE9200000) | ||
| 69 | 60 | ||
| 70 | /* Timer */ | 61 | #define S5PC100_PA_USB_HSOTG 0xED200000 |
| 71 | #define S5PC100_PA_TIMER (0xEA000000) | 62 | #define S5PC100_PA_USB_HSPHY 0xED300000 |
| 72 | #define S5P_PA_TIMER S5PC100_PA_TIMER | ||
| 73 | 63 | ||
| 74 | #define S5PC100_PA_SYSTIMER (0xEA100000) | 64 | #define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) |
| 75 | 65 | ||
| 76 | #define S5PC100_PA_WATCHDOG (0xEA200000) | 66 | #define S5PC100_PA_FB 0xEE000000 |
| 77 | #define S5PC100_PA_RTC (0xEA300000) | ||
| 78 | 67 | ||
| 79 | #define S5PC100_PA_UART (0xEC000000) | 68 | #define S5PC100_PA_FIMC0 0xEE200000 |
| 69 | #define S5PC100_PA_FIMC1 0xEE300000 | ||
| 70 | #define S5PC100_PA_FIMC2 0xEE400000 | ||
| 80 | 71 | ||
| 81 | #define S5P_PA_UART0 (S5PC100_PA_UART + 0x0) | 72 | #define S5PC100_PA_I2S0 0xF2000000 |
| 82 | #define S5P_PA_UART1 (S5PC100_PA_UART + 0x400) | 73 | #define S5PC100_PA_I2S1 0xF2100000 |
| 83 | #define S5P_PA_UART2 (S5PC100_PA_UART + 0x800) | 74 | #define S5PC100_PA_I2S2 0xF2200000 |
| 84 | #define S5P_PA_UART3 (S5PC100_PA_UART + 0xC00) | ||
| 85 | #define S5P_SZ_UART SZ_256 | ||
| 86 | 75 | ||
| 87 | #define S5PC100_PA_IIC0 (0xEC100000) | 76 | #define S5PC100_PA_AC97 0xF2300000 |
| 88 | #define S5PC100_PA_IIC1 (0xEC200000) | ||
| 89 | 77 | ||
| 90 | /* SPI */ | 78 | #define S5PC100_PA_PCM0 0xF2400000 |
| 91 | #define S5PC100_PA_SPI0 0xEC300000 | 79 | #define S5PC100_PA_PCM1 0xF2500000 |
| 92 | #define S5PC100_PA_SPI1 0xEC400000 | ||
| 93 | #define S5PC100_PA_SPI2 0xEC500000 | ||
| 94 | 80 | ||
| 95 | /* USB HS OTG */ | 81 | #define S5PC100_PA_SPDIF 0xF2600000 |
| 96 | #define S5PC100_PA_USB_HSOTG (0xED200000) | ||
| 97 | #define S5PC100_PA_USB_HSPHY (0xED300000) | ||
| 98 | 82 | ||
| 99 | #define S5PC100_PA_FB (0xEE000000) | 83 | #define S5PC100_PA_TSADC 0xF3000000 |
| 100 | 84 | ||
| 101 | #define S5PC100_PA_FIMC0 (0xEE200000) | 85 | #define S5PC100_PA_KEYPAD 0xF3100000 |
| 102 | #define S5PC100_PA_FIMC1 (0xEE300000) | ||
| 103 | #define S5PC100_PA_FIMC2 (0xEE400000) | ||
| 104 | 86 | ||
| 105 | #define S5PC100_PA_I2S0 (0xF2000000) | 87 | /* Compatibiltiy Defines */ |
| 106 | #define S5PC100_PA_I2S1 (0xF2100000) | ||
| 107 | #define S5PC100_PA_I2S2 (0xF2200000) | ||
| 108 | 88 | ||
| 109 | #define S5PC100_PA_AC97 0xF2300000 | 89 | #define S3C_PA_FB S5PC100_PA_FB |
| 90 | #define S3C_PA_HSMMC0 S5PC100_PA_HSMMC(0) | ||
| 91 | #define S3C_PA_HSMMC1 S5PC100_PA_HSMMC(1) | ||
| 92 | #define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2) | ||
| 93 | #define S3C_PA_IIC S5PC100_PA_IIC0 | ||
| 94 | #define S3C_PA_IIC1 S5PC100_PA_IIC1 | ||
| 95 | #define S3C_PA_KEYPAD S5PC100_PA_KEYPAD | ||
| 96 | #define S3C_PA_ONENAND S5PC100_PA_ONENAND | ||
| 97 | #define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF | ||
| 98 | #define S3C_PA_RTC S5PC100_PA_RTC | ||
| 99 | #define S3C_PA_TSADC S5PC100_PA_TSADC | ||
| 100 | #define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG | ||
| 101 | #define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY | ||
| 102 | #define S3C_PA_WDT S5PC100_PA_WATCHDOG | ||
| 110 | 103 | ||
| 111 | /* PCM */ | 104 | #define S5P_PA_CHIPID S5PC100_PA_CHIPID |
| 112 | #define S5PC100_PA_PCM0 0xF2400000 | 105 | #define S5P_PA_FIMC0 S5PC100_PA_FIMC0 |
| 113 | #define S5PC100_PA_PCM1 0xF2500000 | 106 | #define S5P_PA_FIMC1 S5PC100_PA_FIMC1 |
| 107 | #define S5P_PA_FIMC2 S5PC100_PA_FIMC2 | ||
| 108 | #define S5P_PA_SDRAM S5PC100_PA_SDRAM | ||
| 109 | #define S5P_PA_SROMC S5PC100_PA_SROMC | ||
| 110 | #define S5P_PA_SYSCON S5PC100_PA_SYSCON | ||
| 111 | #define S5P_PA_TIMER S5PC100_PA_TIMER | ||
| 114 | 112 | ||
| 115 | #define S5PC100_PA_SPDIF 0xF2600000 | 113 | #define SAMSUNG_PA_ADC S5PC100_PA_TSADC |
| 114 | #define SAMSUNG_PA_CFCON S5PC100_PA_CFCON | ||
| 115 | #define SAMSUNG_PA_KEYPAD S5PC100_PA_KEYPAD | ||
| 116 | 116 | ||
| 117 | #define S5PC100_PA_TSADC (0xF3000000) | 117 | #define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000) |
| 118 | 118 | ||
| 119 | /* KEYPAD */ | 119 | #define S3C_SZ_ONENAND_BUF (SZ_256M - SZ_32M) |
| 120 | #define S5PC100_PA_KEYPAD (0xF3100000) | ||
| 121 | 120 | ||
| 122 | #define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) | 121 | /* UART */ |
| 123 | 122 | ||
| 124 | #define S5PC100_PA_SDRAM (0x20000000) | 123 | #define S3C_PA_UART S5PC100_PA_UART |
| 125 | #define S5P_PA_SDRAM S5PC100_PA_SDRAM | ||
| 126 | 124 | ||
| 127 | /* compatibiltiy defines. */ | 125 | #define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET)) |
| 128 | #define S3C_PA_UART S5PC100_PA_UART | 126 | #define S5P_PA_UART0 S5P_PA_UART(0) |
| 129 | #define S3C_PA_IIC S5PC100_PA_IIC0 | 127 | #define S5P_PA_UART1 S5P_PA_UART(1) |
| 130 | #define S3C_PA_IIC1 S5PC100_PA_IIC1 | 128 | #define S5P_PA_UART2 S5P_PA_UART(2) |
| 131 | #define S3C_PA_FB S5PC100_PA_FB | 129 | #define S5P_PA_UART3 S5P_PA_UART(3) |
| 132 | #define S3C_PA_G2D S5PC100_PA_G2D | ||
| 133 | #define S3C_PA_G3D S5PC100_PA_G3D | ||
| 134 | #define S3C_PA_JPEG S5PC100_PA_JPEG | ||
| 135 | #define S3C_PA_ROTATOR S5PC100_PA_ROTATOR | ||
| 136 | #define S5P_VA_VIC0 S5PC1XX_VA_VIC(0) | ||
| 137 | #define S5P_VA_VIC1 S5PC1XX_VA_VIC(1) | ||
| 138 | #define S5P_VA_VIC2 S5PC1XX_VA_VIC(2) | ||
| 139 | #define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG | ||
| 140 | #define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY | ||
| 141 | #define S3C_PA_HSMMC0 S5PC100_PA_HSMMC(0) | ||
| 142 | #define S3C_PA_HSMMC1 S5PC100_PA_HSMMC(1) | ||
| 143 | #define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2) | ||
| 144 | #define S3C_PA_KEYPAD S5PC100_PA_KEYPAD | ||
| 145 | #define S3C_PA_WDT S5PC100_PA_WATCHDOG | ||
| 146 | #define S3C_PA_TSADC S5PC100_PA_TSADC | ||
| 147 | #define S3C_PA_ONENAND S5PC100_PA_ONENAND | ||
| 148 | #define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF | ||
| 149 | #define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF | ||
| 150 | #define S3C_PA_RTC S5PC100_PA_RTC | ||
| 151 | |||
| 152 | #define SAMSUNG_PA_ADC S5PC100_PA_TSADC | ||
| 153 | #define SAMSUNG_PA_CFCON S5PC100_PA_CFCON | ||
| 154 | #define SAMSUNG_PA_KEYPAD S5PC100_PA_KEYPAD | ||
| 155 | 130 | ||
| 156 | #define S5P_PA_FIMC0 S5PC100_PA_FIMC0 | 131 | #define S5P_SZ_UART SZ_256 |
| 157 | #define S5P_PA_FIMC1 S5PC100_PA_FIMC1 | ||
| 158 | #define S5P_PA_FIMC2 S5PC100_PA_FIMC2 | ||
| 159 | 132 | ||
| 160 | #endif /* __ASM_ARCH_C100_MAP_H */ | 133 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h index 3611492ad681..1dd58836fd4f 100644 --- a/arch/arm/mach-s5pv210/include/mach/map.h +++ b/arch/arm/mach-s5pv210/include/mach/map.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* linux/arch/arm/mach-s5pv210/include/mach/map.h | 1 | /* linux/arch/arm/mach-s5pv210/include/mach/map.h |
| 2 | * | 2 | * |
| 3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | 3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com/ | 4 | * http://www.samsung.com/ |
| 5 | * | 5 | * |
| 6 | * S5PV210 - Memory map definitions | 6 | * S5PV210 - Memory map definitions |
| @@ -16,122 +16,120 @@ | |||
| 16 | #include <plat/map-base.h> | 16 | #include <plat/map-base.h> |
| 17 | #include <plat/map-s5p.h> | 17 | #include <plat/map-s5p.h> |
| 18 | 18 | ||
| 19 | #define S5PV210_PA_SROM_BANK5 (0xA8000000) | 19 | #define S5PV210_PA_SDRAM 0x20000000 |
| 20 | 20 | ||
| 21 | #define S5PC110_PA_ONENAND (0xB0000000) | 21 | #define S5PV210_PA_SROM_BANK5 0xA8000000 |
| 22 | #define S5P_PA_ONENAND S5PC110_PA_ONENAND | ||
| 23 | 22 | ||
| 24 | #define S5PC110_PA_ONENAND_DMA (0xB0600000) | 23 | #define S5PC110_PA_ONENAND 0xB0000000 |
| 25 | #define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA | 24 | #define S5PC110_PA_ONENAND_DMA 0xB0600000 |
| 26 | 25 | ||
| 27 | #define S5PV210_PA_CHIPID (0xE0000000) | 26 | #define S5PV210_PA_CHIPID 0xE0000000 |
| 28 | #define S5P_PA_CHIPID S5PV210_PA_CHIPID | ||
| 29 | 27 | ||
| 30 | #define S5PV210_PA_SYSCON (0xE0100000) | 28 | #define S5PV210_PA_SYSCON 0xE0100000 |
| 31 | #define S5P_PA_SYSCON S5PV210_PA_SYSCON | ||
| 32 | 29 | ||
| 33 | #define S5PV210_PA_GPIO (0xE0200000) | 30 | #define S5PV210_PA_GPIO 0xE0200000 |
| 34 | 31 | ||
| 35 | /* SPI */ | 32 | #define S5PV210_PA_SPDIF 0xE1100000 |
| 36 | #define S5PV210_PA_SPI0 0xE1300000 | ||
| 37 | #define S5PV210_PA_SPI1 0xE1400000 | ||
| 38 | 33 | ||
| 39 | #define S5PV210_PA_KEYPAD (0xE1600000) | 34 | #define S5PV210_PA_SPI0 0xE1300000 |
| 35 | #define S5PV210_PA_SPI1 0xE1400000 | ||
| 40 | 36 | ||
| 41 | #define S5PV210_PA_IIC0 (0xE1800000) | 37 | #define S5PV210_PA_KEYPAD 0xE1600000 |
| 42 | #define S5PV210_PA_IIC1 (0xFAB00000) | ||
| 43 | #define S5PV210_PA_IIC2 (0xE1A00000) | ||
| 44 | 38 | ||
| 45 | #define S5PV210_PA_TIMER (0xE2500000) | 39 | #define S5PV210_PA_ADC 0xE1700000 |
| 46 | #define S5P_PA_TIMER S5PV210_PA_TIMER | ||
| 47 | 40 | ||
| 48 | #define S5PV210_PA_SYSTIMER (0xE2600000) | 41 | #define S5PV210_PA_IIC0 0xE1800000 |
| 42 | #define S5PV210_PA_IIC1 0xFAB00000 | ||
| 43 | #define S5PV210_PA_IIC2 0xE1A00000 | ||
| 49 | 44 | ||
| 50 | #define S5PV210_PA_WATCHDOG (0xE2700000) | 45 | #define S5PV210_PA_AC97 0xE2200000 |
| 51 | 46 | ||
| 52 | #define S5PV210_PA_RTC (0xE2800000) | 47 | #define S5PV210_PA_PCM0 0xE2300000 |
| 53 | #define S5PV210_PA_UART (0xE2900000) | 48 | #define S5PV210_PA_PCM1 0xE1200000 |
| 49 | #define S5PV210_PA_PCM2 0xE2B00000 | ||
| 54 | 50 | ||
| 55 | #define S5P_PA_UART0 (S5PV210_PA_UART + 0x0) | 51 | #define S5PV210_PA_TIMER 0xE2500000 |
| 56 | #define S5P_PA_UART1 (S5PV210_PA_UART + 0x400) | 52 | #define S5PV210_PA_SYSTIMER 0xE2600000 |
| 57 | #define S5P_PA_UART2 (S5PV210_PA_UART + 0x800) | 53 | #define S5PV210_PA_WATCHDOG 0xE2700000 |
| 58 | #define S5P_PA_UART3 (S5PV210_PA_UART + 0xC00) | 54 | #define S5PV210_PA_RTC 0xE2800000 |
| 59 | 55 | ||
| 60 | #define S5P_SZ_UART SZ_256 | 56 | #define S5PV210_PA_UART 0xE2900000 |
| 61 | 57 | ||
| 62 | #define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) | 58 | #define S5PV210_PA_SROMC 0xE8000000 |
| 63 | 59 | ||
| 64 | #define S5PV210_PA_SROMC (0xE8000000) | 60 | #define S5PV210_PA_CFCON 0xE8200000 |
| 65 | #define S5P_PA_SROMC S5PV210_PA_SROMC | ||
| 66 | 61 | ||
| 67 | #define S5PV210_PA_CFCON (0xE8200000) | 62 | #define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000)) |
| 68 | 63 | ||
| 69 | #define S5PV210_PA_MDMA 0xFA200000 | 64 | #define S5PV210_PA_HSOTG 0xEC000000 |
| 70 | #define S5PV210_PA_PDMA0 0xE0900000 | 65 | #define S5PV210_PA_HSPHY 0xEC100000 |
| 71 | #define S5PV210_PA_PDMA1 0xE0A00000 | ||
| 72 | 66 | ||
| 73 | #define S5PV210_PA_FB (0xF8000000) | 67 | #define S5PV210_PA_IIS0 0xEEE30000 |
| 68 | #define S5PV210_PA_IIS1 0xE2100000 | ||
| 69 | #define S5PV210_PA_IIS2 0xE2A00000 | ||
| 74 | 70 | ||
| 75 | #define S5PV210_PA_FIMC0 (0xFB200000) | 71 | #define S5PV210_PA_DMC0 0xF0000000 |
| 76 | #define S5PV210_PA_FIMC1 (0xFB300000) | 72 | #define S5PV210_PA_DMC1 0xF1400000 |
| 77 | #define S5PV210_PA_FIMC2 (0xFB400000) | ||
| 78 | 73 | ||
| 79 | #define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000)) | 74 | #define S5PV210_PA_VIC0 0xF2000000 |
| 75 | #define S5PV210_PA_VIC1 0xF2100000 | ||
| 76 | #define S5PV210_PA_VIC2 0xF2200000 | ||
| 77 | #define S5PV210_PA_VIC3 0xF2300000 | ||
| 80 | 78 | ||
| 81 | #define S5PV210_PA_HSOTG (0xEC000000) | 79 | #define S5PV210_PA_FB 0xF8000000 |
| 82 | #define S5PV210_PA_HSPHY (0xEC100000) | ||
| 83 | 80 | ||
| 84 | #define S5PV210_PA_VIC0 (0xF2000000) | 81 | #define S5PV210_PA_MDMA 0xFA200000 |
| 85 | #define S5PV210_PA_VIC1 (0xF2100000) | 82 | #define S5PV210_PA_PDMA0 0xE0900000 |
| 86 | #define S5PV210_PA_VIC2 (0xF2200000) | 83 | #define S5PV210_PA_PDMA1 0xE0A00000 |
| 87 | #define S5PV210_PA_VIC3 (0xF2300000) | ||
| 88 | 84 | ||
| 89 | #define S5PV210_PA_SDRAM (0x20000000) | 85 | #define S5PV210_PA_MIPI_CSIS 0xFA600000 |
| 90 | #define S5P_PA_SDRAM S5PV210_PA_SDRAM | ||
| 91 | 86 | ||
| 92 | /* S/PDIF */ | 87 | #define S5PV210_PA_FIMC0 0xFB200000 |
| 93 | #define S5PV210_PA_SPDIF 0xE1100000 | 88 | #define S5PV210_PA_FIMC1 0xFB300000 |
| 89 | #define S5PV210_PA_FIMC2 0xFB400000 | ||
| 94 | 90 | ||
| 95 | /* I2S */ | 91 | /* Compatibiltiy Defines */ |
| 96 | #define S5PV210_PA_IIS0 0xEEE30000 | ||
| 97 | #define S5PV210_PA_IIS1 0xE2100000 | ||
| 98 | #define S5PV210_PA_IIS2 0xE2A00000 | ||
| 99 | 92 | ||
| 100 | /* PCM */ | 93 | #define S3C_PA_FB S5PV210_PA_FB |
| 101 | #define S5PV210_PA_PCM0 0xE2300000 | 94 | #define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0) |
| 102 | #define S5PV210_PA_PCM1 0xE1200000 | 95 | #define S3C_PA_HSMMC1 S5PV210_PA_HSMMC(1) |
| 103 | #define S5PV210_PA_PCM2 0xE2B00000 | 96 | #define S3C_PA_HSMMC2 S5PV210_PA_HSMMC(2) |
| 97 | #define S3C_PA_HSMMC3 S5PV210_PA_HSMMC(3) | ||
| 98 | #define S3C_PA_IIC S5PV210_PA_IIC0 | ||
| 99 | #define S3C_PA_IIC1 S5PV210_PA_IIC1 | ||
| 100 | #define S3C_PA_IIC2 S5PV210_PA_IIC2 | ||
| 101 | #define S3C_PA_RTC S5PV210_PA_RTC | ||
| 102 | #define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG | ||
| 103 | #define S3C_PA_WDT S5PV210_PA_WATCHDOG | ||
| 104 | 104 | ||
| 105 | /* AC97 */ | 105 | #define S5P_PA_CHIPID S5PV210_PA_CHIPID |
| 106 | #define S5PV210_PA_AC97 0xE2200000 | 106 | #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 |
| 107 | #define S5P_PA_FIMC1 S5PV210_PA_FIMC1 | ||
| 108 | #define S5P_PA_FIMC2 S5PV210_PA_FIMC2 | ||
| 109 | #define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS | ||
| 110 | #define S5P_PA_ONENAND S5PC110_PA_ONENAND | ||
| 111 | #define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA | ||
| 112 | #define S5P_PA_SDRAM S5PV210_PA_SDRAM | ||
| 113 | #define S5P_PA_SROMC S5PV210_PA_SROMC | ||
| 114 | #define S5P_PA_SYSCON S5PV210_PA_SYSCON | ||
| 115 | #define S5P_PA_TIMER S5PV210_PA_TIMER | ||
| 107 | 116 | ||
| 108 | #define S5PV210_PA_ADC (0xE1700000) | 117 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC |
| 118 | #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON | ||
| 119 | #define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD | ||
| 109 | 120 | ||
| 110 | #define S5PV210_PA_DMC0 (0xF0000000) | 121 | /* UART */ |
| 111 | #define S5PV210_PA_DMC1 (0xF1400000) | ||
| 112 | 122 | ||
| 113 | #define S5PV210_PA_MIPI_CSIS 0xFA600000 | 123 | #define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) |
| 114 | 124 | ||
| 115 | /* compatibiltiy defines. */ | 125 | #define S3C_PA_UART S5PV210_PA_UART |
| 116 | #define S3C_PA_UART S5PV210_PA_UART | ||
| 117 | #define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0) | ||
| 118 | #define S3C_PA_HSMMC1 S5PV210_PA_HSMMC(1) | ||
| 119 | #define S3C_PA_HSMMC2 S5PV210_PA_HSMMC(2) | ||
| 120 | #define S3C_PA_HSMMC3 S5PV210_PA_HSMMC(3) | ||
| 121 | #define S3C_PA_IIC S5PV210_PA_IIC0 | ||
| 122 | #define S3C_PA_IIC1 S5PV210_PA_IIC1 | ||
| 123 | #define S3C_PA_IIC2 S5PV210_PA_IIC2 | ||
| 124 | #define S3C_PA_FB S5PV210_PA_FB | ||
| 125 | #define S3C_PA_RTC S5PV210_PA_RTC | ||
| 126 | #define S3C_PA_WDT S5PV210_PA_WATCHDOG | ||
| 127 | #define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG | ||
| 128 | #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 | ||
| 129 | #define S5P_PA_FIMC1 S5PV210_PA_FIMC1 | ||
| 130 | #define S5P_PA_FIMC2 S5PV210_PA_FIMC2 | ||
| 131 | #define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS | ||
| 132 | 126 | ||
| 133 | #define SAMSUNG_PA_ADC S5PV210_PA_ADC | 127 | #define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET)) |
| 134 | #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON | 128 | #define S5P_PA_UART0 S5P_PA_UART(0) |
| 135 | #define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD | 129 | #define S5P_PA_UART1 S5P_PA_UART(1) |
| 130 | #define S5P_PA_UART2 S5P_PA_UART(2) | ||
| 131 | #define S5P_PA_UART3 S5P_PA_UART(3) | ||
| 132 | |||
| 133 | #define S5P_SZ_UART SZ_256 | ||
| 136 | 134 | ||
| 137 | #endif /* __ASM_ARCH_MAP_H */ | 135 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c index 461aa035afc0..557add4fc56c 100644 --- a/arch/arm/mach-s5pv210/mach-aquila.c +++ b/arch/arm/mach-s5pv210/mach-aquila.c | |||
| @@ -149,7 +149,7 @@ static struct regulator_init_data aquila_ldo2_data = { | |||
| 149 | 149 | ||
| 150 | static struct regulator_init_data aquila_ldo3_data = { | 150 | static struct regulator_init_data aquila_ldo3_data = { |
| 151 | .constraints = { | 151 | .constraints = { |
| 152 | .name = "VUSB/MIPI_1.1V", | 152 | .name = "VUSB+MIPI_1.1V", |
| 153 | .min_uV = 1100000, | 153 | .min_uV = 1100000, |
| 154 | .max_uV = 1100000, | 154 | .max_uV = 1100000, |
| 155 | .apply_uV = 1, | 155 | .apply_uV = 1, |
| @@ -197,7 +197,7 @@ static struct regulator_init_data aquila_ldo7_data = { | |||
| 197 | 197 | ||
| 198 | static struct regulator_init_data aquila_ldo8_data = { | 198 | static struct regulator_init_data aquila_ldo8_data = { |
| 199 | .constraints = { | 199 | .constraints = { |
| 200 | .name = "VUSB/VADC_3.3V", | 200 | .name = "VUSB+VADC_3.3V", |
| 201 | .min_uV = 3300000, | 201 | .min_uV = 3300000, |
| 202 | .max_uV = 3300000, | 202 | .max_uV = 3300000, |
| 203 | .apply_uV = 1, | 203 | .apply_uV = 1, |
| @@ -207,7 +207,7 @@ static struct regulator_init_data aquila_ldo8_data = { | |||
| 207 | 207 | ||
| 208 | static struct regulator_init_data aquila_ldo9_data = { | 208 | static struct regulator_init_data aquila_ldo9_data = { |
| 209 | .constraints = { | 209 | .constraints = { |
| 210 | .name = "VCC/VCAM_2.8V", | 210 | .name = "VCC+VCAM_2.8V", |
| 211 | .min_uV = 2800000, | 211 | .min_uV = 2800000, |
| 212 | .max_uV = 2800000, | 212 | .max_uV = 2800000, |
| 213 | .apply_uV = 1, | 213 | .apply_uV = 1, |
| @@ -381,9 +381,12 @@ static struct max8998_platform_data aquila_max8998_pdata = { | |||
| 381 | .buck1_set1 = S5PV210_GPH0(3), | 381 | .buck1_set1 = S5PV210_GPH0(3), |
| 382 | .buck1_set2 = S5PV210_GPH0(4), | 382 | .buck1_set2 = S5PV210_GPH0(4), |
| 383 | .buck2_set3 = S5PV210_GPH0(5), | 383 | .buck2_set3 = S5PV210_GPH0(5), |
| 384 | .buck1_max_voltage1 = 1200000, | 384 | .buck1_voltage1 = 1200000, |
| 385 | .buck1_max_voltage2 = 1200000, | 385 | .buck1_voltage2 = 1200000, |
| 386 | .buck2_max_voltage = 1200000, | 386 | .buck1_voltage3 = 1200000, |
| 387 | .buck1_voltage4 = 1200000, | ||
| 388 | .buck2_voltage1 = 1200000, | ||
| 389 | .buck2_voltage2 = 1200000, | ||
| 387 | }; | 390 | }; |
| 388 | #endif | 391 | #endif |
| 389 | 392 | ||
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index e22d5112fd44..056f5c769b0a 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c | |||
| @@ -288,7 +288,7 @@ static struct regulator_init_data goni_ldo2_data = { | |||
| 288 | 288 | ||
| 289 | static struct regulator_init_data goni_ldo3_data = { | 289 | static struct regulator_init_data goni_ldo3_data = { |
| 290 | .constraints = { | 290 | .constraints = { |
| 291 | .name = "VUSB/MIPI_1.1V", | 291 | .name = "VUSB+MIPI_1.1V", |
| 292 | .min_uV = 1100000, | 292 | .min_uV = 1100000, |
| 293 | .max_uV = 1100000, | 293 | .max_uV = 1100000, |
| 294 | .apply_uV = 1, | 294 | .apply_uV = 1, |
| @@ -337,7 +337,7 @@ static struct regulator_init_data goni_ldo7_data = { | |||
| 337 | 337 | ||
| 338 | static struct regulator_init_data goni_ldo8_data = { | 338 | static struct regulator_init_data goni_ldo8_data = { |
| 339 | .constraints = { | 339 | .constraints = { |
| 340 | .name = "VUSB/VADC_3.3V", | 340 | .name = "VUSB+VADC_3.3V", |
| 341 | .min_uV = 3300000, | 341 | .min_uV = 3300000, |
| 342 | .max_uV = 3300000, | 342 | .max_uV = 3300000, |
| 343 | .apply_uV = 1, | 343 | .apply_uV = 1, |
| @@ -347,7 +347,7 @@ static struct regulator_init_data goni_ldo8_data = { | |||
| 347 | 347 | ||
| 348 | static struct regulator_init_data goni_ldo9_data = { | 348 | static struct regulator_init_data goni_ldo9_data = { |
| 349 | .constraints = { | 349 | .constraints = { |
| 350 | .name = "VCC/VCAM_2.8V", | 350 | .name = "VCC+VCAM_2.8V", |
| 351 | .min_uV = 2800000, | 351 | .min_uV = 2800000, |
| 352 | .max_uV = 2800000, | 352 | .max_uV = 2800000, |
| 353 | .apply_uV = 1, | 353 | .apply_uV = 1, |
| @@ -521,9 +521,12 @@ static struct max8998_platform_data goni_max8998_pdata = { | |||
| 521 | .buck1_set1 = S5PV210_GPH0(3), | 521 | .buck1_set1 = S5PV210_GPH0(3), |
| 522 | .buck1_set2 = S5PV210_GPH0(4), | 522 | .buck1_set2 = S5PV210_GPH0(4), |
| 523 | .buck2_set3 = S5PV210_GPH0(5), | 523 | .buck2_set3 = S5PV210_GPH0(5), |
| 524 | .buck1_max_voltage1 = 1200000, | 524 | .buck1_voltage1 = 1200000, |
| 525 | .buck1_max_voltage2 = 1200000, | 525 | .buck1_voltage2 = 1200000, |
| 526 | .buck2_max_voltage = 1200000, | 526 | .buck1_voltage3 = 1200000, |
| 527 | .buck1_voltage4 = 1200000, | ||
| 528 | .buck2_voltage1 = 1200000, | ||
| 529 | .buck2_voltage2 = 1200000, | ||
| 527 | }; | 530 | }; |
| 528 | #endif | 531 | #endif |
| 529 | 532 | ||
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h index 3060f78e12ab..901657fa7a12 100644 --- a/arch/arm/mach-s5pv310/include/mach/map.h +++ b/arch/arm/mach-s5pv310/include/mach/map.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* linux/arch/arm/mach-s5pv310/include/mach/map.h | 1 | /* linux/arch/arm/mach-s5pv310/include/mach/map.h |
| 2 | * | 2 | * |
| 3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | 3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. |
| 4 | * http://www.samsung.com/ | 4 | * http://www.samsung.com/ |
| 5 | * | 5 | * |
| 6 | * S5PV310 - Memory map definitions | 6 | * S5PV310 - Memory map definitions |
| @@ -23,90 +23,43 @@ | |||
| 23 | 23 | ||
| 24 | #include <plat/map-s5p.h> | 24 | #include <plat/map-s5p.h> |
| 25 | 25 | ||
| 26 | #define S5PV310_PA_SYSRAM (0x02025000) | 26 | #define S5PV310_PA_SYSRAM 0x02025000 |
| 27 | 27 | ||
| 28 | #define S5PV310_PA_SROM_BANK(x) (0x04000000 + ((x) * 0x01000000)) | 28 | #define S5PV310_PA_I2S0 0x03830000 |
| 29 | 29 | #define S5PV310_PA_I2S1 0xE3100000 | |
| 30 | #define S5PC210_PA_ONENAND (0x0C000000) | 30 | #define S5PV310_PA_I2S2 0xE2A00000 |
| 31 | #define S5P_PA_ONENAND S5PC210_PA_ONENAND | ||
| 32 | |||
| 33 | #define S5PC210_PA_ONENAND_DMA (0x0C600000) | ||
| 34 | #define S5P_PA_ONENAND_DMA S5PC210_PA_ONENAND_DMA | ||
| 35 | |||
| 36 | #define S5PV310_PA_CHIPID (0x10000000) | ||
| 37 | #define S5P_PA_CHIPID S5PV310_PA_CHIPID | ||
| 38 | |||
| 39 | #define S5PV310_PA_SYSCON (0x10010000) | ||
| 40 | #define S5P_PA_SYSCON S5PV310_PA_SYSCON | ||
| 41 | 31 | ||
| 42 | #define S5PV310_PA_PMU (0x10020000) | 32 | #define S5PV310_PA_PCM0 0x03840000 |
| 33 | #define S5PV310_PA_PCM1 0x13980000 | ||
| 34 | #define S5PV310_PA_PCM2 0x13990000 | ||
| 43 | 35 | ||
| 44 | #define S5PV310_PA_CMU (0x10030000) | 36 | #define S5PV310_PA_SROM_BANK(x) (0x04000000 + ((x) * 0x01000000)) |
| 45 | |||
| 46 | #define S5PV310_PA_WATCHDOG (0x10060000) | ||
| 47 | #define S5PV310_PA_RTC (0x10070000) | ||
| 48 | |||
| 49 | #define S5PV310_PA_DMC0 (0x10400000) | ||
| 50 | |||
| 51 | #define S5PV310_PA_COMBINER (0x10448000) | ||
| 52 | |||
| 53 | #define S5PV310_PA_COREPERI (0x10500000) | ||
| 54 | #define S5PV310_PA_GIC_CPU (0x10500100) | ||
| 55 | #define S5PV310_PA_TWD (0x10500600) | ||
| 56 | #define S5PV310_PA_GIC_DIST (0x10501000) | ||
| 57 | #define S5PV310_PA_L2CC (0x10502000) | ||
| 58 | |||
| 59 | /* DMA */ | ||
| 60 | #define S5PV310_PA_MDMA 0x10810000 | ||
| 61 | #define S5PV310_PA_PDMA0 0x12680000 | ||
| 62 | #define S5PV310_PA_PDMA1 0x12690000 | ||
| 63 | |||
| 64 | #define S5PV310_PA_GPIO1 (0x11400000) | ||
| 65 | #define S5PV310_PA_GPIO2 (0x11000000) | ||
| 66 | #define S5PV310_PA_GPIO3 (0x03860000) | ||
| 67 | |||
| 68 | #define S5PV310_PA_MIPI_CSIS0 0x11880000 | ||
| 69 | #define S5PV310_PA_MIPI_CSIS1 0x11890000 | ||
| 70 | 37 | ||
| 71 | #define S5PV310_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) | 38 | #define S5PC210_PA_ONENAND 0x0C000000 |
| 39 | #define S5PC210_PA_ONENAND_DMA 0x0C600000 | ||
| 72 | 40 | ||
| 73 | #define S5PV310_PA_SROMC (0x12570000) | 41 | #define S5PV310_PA_CHIPID 0x10000000 |
| 74 | #define S5P_PA_SROMC S5PV310_PA_SROMC | ||
| 75 | 42 | ||
| 76 | /* S/PDIF */ | 43 | #define S5PV310_PA_SYSCON 0x10010000 |
| 77 | #define S5PV310_PA_SPDIF 0xE1100000 | 44 | #define S5PV310_PA_PMU 0x10020000 |
| 45 | #define S5PV310_PA_CMU 0x10030000 | ||
| 78 | 46 | ||
| 79 | /* I2S */ | 47 | #define S5PV310_PA_WATCHDOG 0x10060000 |
| 80 | #define S5PV310_PA_I2S0 0x03830000 | 48 | #define S5PV310_PA_RTC 0x10070000 |
| 81 | #define S5PV310_PA_I2S1 0xE3100000 | ||
| 82 | #define S5PV310_PA_I2S2 0xE2A00000 | ||
| 83 | 49 | ||
| 84 | /* PCM */ | 50 | #define S5PV310_PA_DMC0 0x10400000 |
| 85 | #define S5PV310_PA_PCM0 0x03840000 | ||
| 86 | #define S5PV310_PA_PCM1 0x13980000 | ||
| 87 | #define S5PV310_PA_PCM2 0x13990000 | ||
| 88 | 51 | ||
| 89 | /* AC97 */ | 52 | #define S5PV310_PA_COMBINER 0x10448000 |
| 90 | #define S5PV310_PA_AC97 0x139A0000 | ||
| 91 | 53 | ||
| 92 | #define S5PV310_PA_UART (0x13800000) | 54 | #define S5PV310_PA_COREPERI 0x10500000 |
| 55 | #define S5PV310_PA_GIC_CPU 0x10500100 | ||
| 56 | #define S5PV310_PA_TWD 0x10500600 | ||
| 57 | #define S5PV310_PA_GIC_DIST 0x10501000 | ||
| 58 | #define S5PV310_PA_L2CC 0x10502000 | ||
| 93 | 59 | ||
| 94 | #define S5P_PA_UART(x) (S5PV310_PA_UART + ((x) * S3C_UART_OFFSET)) | 60 | #define S5PV310_PA_MDMA 0x10810000 |
| 95 | #define S5P_PA_UART0 S5P_PA_UART(0) | 61 | #define S5PV310_PA_PDMA0 0x12680000 |
| 96 | #define S5P_PA_UART1 S5P_PA_UART(1) | 62 | #define S5PV310_PA_PDMA1 0x12690000 |
| 97 | #define S5P_PA_UART2 S5P_PA_UART(2) | ||
| 98 | #define S5P_PA_UART3 S5P_PA_UART(3) | ||
| 99 | #define S5P_PA_UART4 S5P_PA_UART(4) | ||
| 100 | |||
| 101 | #define S5P_SZ_UART SZ_256 | ||
| 102 | |||
| 103 | #define S5PV310_PA_IIC(x) (0x13860000 + ((x) * 0x10000)) | ||
| 104 | |||
| 105 | #define S5PV310_PA_TIMER (0x139D0000) | ||
| 106 | #define S5P_PA_TIMER S5PV310_PA_TIMER | ||
| 107 | |||
| 108 | #define S5PV310_PA_SDRAM (0x40000000) | ||
| 109 | #define S5P_PA_SDRAM S5PV310_PA_SDRAM | ||
| 110 | 63 | ||
| 111 | #define S5PV310_PA_SYSMMU_MDMA 0x10A40000 | 64 | #define S5PV310_PA_SYSMMU_MDMA 0x10A40000 |
| 112 | #define S5PV310_PA_SYSMMU_SSS 0x10A50000 | 65 | #define S5PV310_PA_SYSMMU_SSS 0x10A50000 |
| @@ -125,8 +78,31 @@ | |||
| 125 | #define S5PV310_PA_SYSMMU_MFC_L 0x13620000 | 78 | #define S5PV310_PA_SYSMMU_MFC_L 0x13620000 |
| 126 | #define S5PV310_PA_SYSMMU_MFC_R 0x13630000 | 79 | #define S5PV310_PA_SYSMMU_MFC_R 0x13630000 |
| 127 | 80 | ||
| 128 | /* compatibiltiy defines. */ | 81 | #define S5PV310_PA_GPIO1 0x11400000 |
| 129 | #define S3C_PA_UART S5PV310_PA_UART | 82 | #define S5PV310_PA_GPIO2 0x11000000 |
| 83 | #define S5PV310_PA_GPIO3 0x03860000 | ||
| 84 | |||
| 85 | #define S5PV310_PA_MIPI_CSIS0 0x11880000 | ||
| 86 | #define S5PV310_PA_MIPI_CSIS1 0x11890000 | ||
| 87 | |||
| 88 | #define S5PV310_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) | ||
| 89 | |||
| 90 | #define S5PV310_PA_SROMC 0x12570000 | ||
| 91 | |||
| 92 | #define S5PV310_PA_UART 0x13800000 | ||
| 93 | |||
| 94 | #define S5PV310_PA_IIC(x) (0x13860000 + ((x) * 0x10000)) | ||
| 95 | |||
| 96 | #define S5PV310_PA_AC97 0x139A0000 | ||
| 97 | |||
| 98 | #define S5PV310_PA_TIMER 0x139D0000 | ||
| 99 | |||
| 100 | #define S5PV310_PA_SDRAM 0x40000000 | ||
| 101 | |||
| 102 | #define S5PV310_PA_SPDIF 0xE1100000 | ||
| 103 | |||
| 104 | /* Compatibiltiy Defines */ | ||
| 105 | |||
| 130 | #define S3C_PA_HSMMC0 S5PV310_PA_HSMMC(0) | 106 | #define S3C_PA_HSMMC0 S5PV310_PA_HSMMC(0) |
| 131 | #define S3C_PA_HSMMC1 S5PV310_PA_HSMMC(1) | 107 | #define S3C_PA_HSMMC1 S5PV310_PA_HSMMC(1) |
| 132 | #define S3C_PA_HSMMC2 S5PV310_PA_HSMMC(2) | 108 | #define S3C_PA_HSMMC2 S5PV310_PA_HSMMC(2) |
| @@ -141,7 +117,28 @@ | |||
| 141 | #define S3C_PA_IIC7 S5PV310_PA_IIC(7) | 117 | #define S3C_PA_IIC7 S5PV310_PA_IIC(7) |
| 142 | #define S3C_PA_RTC S5PV310_PA_RTC | 118 | #define S3C_PA_RTC S5PV310_PA_RTC |
| 143 | #define S3C_PA_WDT S5PV310_PA_WATCHDOG | 119 | #define S3C_PA_WDT S5PV310_PA_WATCHDOG |
| 120 | |||
| 121 | #define S5P_PA_CHIPID S5PV310_PA_CHIPID | ||
| 144 | #define S5P_PA_MIPI_CSIS0 S5PV310_PA_MIPI_CSIS0 | 122 | #define S5P_PA_MIPI_CSIS0 S5PV310_PA_MIPI_CSIS0 |
| 145 | #define S5P_PA_MIPI_CSIS1 S5PV310_PA_MIPI_CSIS1 | 123 | #define S5P_PA_MIPI_CSIS1 S5PV310_PA_MIPI_CSIS1 |
| 124 | #define S5P_PA_ONENAND S5PC210_PA_ONENAND | ||
| 125 | #define S5P_PA_ONENAND_DMA S5PC210_PA_ONENAND_DMA | ||
| 126 | #define S5P_PA_SDRAM S5PV310_PA_SDRAM | ||
| 127 | #define S5P_PA_SROMC S5PV310_PA_SROMC | ||
| 128 | #define S5P_PA_SYSCON S5PV310_PA_SYSCON | ||
| 129 | #define S5P_PA_TIMER S5PV310_PA_TIMER | ||
| 130 | |||
| 131 | /* UART */ | ||
| 132 | |||
| 133 | #define S3C_PA_UART S5PV310_PA_UART | ||
| 134 | |||
| 135 | #define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET)) | ||
| 136 | #define S5P_PA_UART0 S5P_PA_UART(0) | ||
| 137 | #define S5P_PA_UART1 S5P_PA_UART(1) | ||
| 138 | #define S5P_PA_UART2 S5P_PA_UART(2) | ||
| 139 | #define S5P_PA_UART3 S5P_PA_UART(3) | ||
| 140 | #define S5P_PA_UART4 S5P_PA_UART(4) | ||
| 141 | |||
| 142 | #define S5P_SZ_UART SZ_256 | ||
| 146 | 143 | ||
| 147 | #endif /* __ASM_ARCH_MAP_H */ | 144 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-spear3xx/include/mach/spear320.h b/arch/arm/mach-spear3xx/include/mach/spear320.h index cacf17a958cd..53677e464d4b 100644 --- a/arch/arm/mach-spear3xx/include/mach/spear320.h +++ b/arch/arm/mach-spear3xx/include/mach/spear320.h | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | #define SPEAR320_SMII1_BASE 0xAB000000 | 62 | #define SPEAR320_SMII1_BASE 0xAB000000 |
| 63 | #define SPEAR320_SMII1_SIZE 0x01000000 | 63 | #define SPEAR320_SMII1_SIZE 0x01000000 |
| 64 | 64 | ||
| 65 | #define SPEAR320_SOC_CONFIG_BASE 0xB4000000 | 65 | #define SPEAR320_SOC_CONFIG_BASE 0xB3000000 |
| 66 | #define SPEAR320_SOC_CONFIG_SIZE 0x00000070 | 66 | #define SPEAR320_SOC_CONFIG_SIZE 0x00000070 |
| 67 | /* Interrupt registers offsets and masks */ | 67 | /* Interrupt registers offsets and masks */ |
| 68 | #define INT_STS_MASK_REG 0x04 | 68 | #define INT_STS_MASK_REG 0x04 |
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h index 66ad2760c621..04c779832c78 100644 --- a/arch/arm/mach-tegra/include/mach/kbc.h +++ b/arch/arm/mach-tegra/include/mach/kbc.h | |||
| @@ -57,5 +57,6 @@ struct tegra_kbc_platform_data { | |||
| 57 | const struct matrix_keymap_data *keymap_data; | 57 | const struct matrix_keymap_data *keymap_data; |
| 58 | 58 | ||
| 59 | bool wakeup; | 59 | bool wakeup; |
| 60 | bool use_fn_map; | ||
| 60 | }; | 61 | }; |
| 61 | #endif | 62 | #endif |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 170c9bb95866..f2ce38e085d2 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
| @@ -49,7 +49,13 @@ static inline void cache_wait(void __iomem *reg, unsigned long mask) | |||
| 49 | static inline void cache_sync(void) | 49 | static inline void cache_sync(void) |
| 50 | { | 50 | { |
| 51 | void __iomem *base = l2x0_base; | 51 | void __iomem *base = l2x0_base; |
| 52 | |||
| 53 | #ifdef CONFIG_ARM_ERRATA_753970 | ||
| 54 | /* write to an unmmapped register */ | ||
| 55 | writel_relaxed(0, base + L2X0_DUMMY_REG); | ||
| 56 | #else | ||
| 52 | writel_relaxed(0, base + L2X0_CACHE_SYNC); | 57 | writel_relaxed(0, base + L2X0_CACHE_SYNC); |
| 58 | #endif | ||
| 53 | cache_wait(base + L2X0_CACHE_SYNC, 1); | 59 | cache_wait(base + L2X0_CACHE_SYNC, 1); |
| 54 | } | 60 | } |
| 55 | 61 | ||
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 0c1172b56b4e..8e3356239136 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
| @@ -264,6 +264,12 @@ __v7_setup: | |||
| 264 | orreq r10, r10, #1 << 6 @ set bit #6 | 264 | orreq r10, r10, #1 << 6 @ set bit #6 |
| 265 | mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register | 265 | mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register |
| 266 | #endif | 266 | #endif |
| 267 | #ifdef CONFIG_ARM_ERRATA_751472 | ||
| 268 | cmp r6, #0x30 @ present prior to r3p0 | ||
| 269 | mrclt p15, 0, r10, c15, c0, 1 @ read diagnostic register | ||
| 270 | orrlt r10, r10, #1 << 11 @ set bit #11 | ||
| 271 | mcrlt p15, 0, r10, c15, c0, 1 @ write diagnostic register | ||
| 272 | #endif | ||
| 267 | 273 | ||
| 268 | 3: mov r10, #0 | 274 | 3: mov r10, #0 |
| 269 | #ifdef HARVARD_CACHE | 275 | #ifdef HARVARD_CACHE |
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index fc62fb5fc20b..c9122dd6ee8d 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
| @@ -37,14 +37,16 @@ static struct clk_functions *arch_clock; | |||
| 37 | int clk_enable(struct clk *clk) | 37 | int clk_enable(struct clk *clk) |
| 38 | { | 38 | { |
| 39 | unsigned long flags; | 39 | unsigned long flags; |
| 40 | int ret = 0; | 40 | int ret; |
| 41 | 41 | ||
| 42 | if (clk == NULL || IS_ERR(clk)) | 42 | if (clk == NULL || IS_ERR(clk)) |
| 43 | return -EINVAL; | 43 | return -EINVAL; |
| 44 | 44 | ||
| 45 | if (!arch_clock || !arch_clock->clk_enable) | ||
| 46 | return -EINVAL; | ||
| 47 | |||
| 45 | spin_lock_irqsave(&clockfw_lock, flags); | 48 | spin_lock_irqsave(&clockfw_lock, flags); |
| 46 | if (arch_clock->clk_enable) | 49 | ret = arch_clock->clk_enable(clk); |
| 47 | ret = arch_clock->clk_enable(clk); | ||
| 48 | spin_unlock_irqrestore(&clockfw_lock, flags); | 50 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| 49 | 51 | ||
| 50 | return ret; | 52 | return ret; |
| @@ -58,6 +60,9 @@ void clk_disable(struct clk *clk) | |||
| 58 | if (clk == NULL || IS_ERR(clk)) | 60 | if (clk == NULL || IS_ERR(clk)) |
| 59 | return; | 61 | return; |
| 60 | 62 | ||
| 63 | if (!arch_clock || !arch_clock->clk_disable) | ||
| 64 | return; | ||
| 65 | |||
| 61 | spin_lock_irqsave(&clockfw_lock, flags); | 66 | spin_lock_irqsave(&clockfw_lock, flags); |
| 62 | if (clk->usecount == 0) { | 67 | if (clk->usecount == 0) { |
| 63 | pr_err("Trying disable clock %s with 0 usecount\n", | 68 | pr_err("Trying disable clock %s with 0 usecount\n", |
| @@ -66,8 +71,7 @@ void clk_disable(struct clk *clk) | |||
| 66 | goto out; | 71 | goto out; |
| 67 | } | 72 | } |
| 68 | 73 | ||
| 69 | if (arch_clock->clk_disable) | 74 | arch_clock->clk_disable(clk); |
| 70 | arch_clock->clk_disable(clk); | ||
| 71 | 75 | ||
| 72 | out: | 76 | out: |
| 73 | spin_unlock_irqrestore(&clockfw_lock, flags); | 77 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| @@ -77,7 +81,7 @@ EXPORT_SYMBOL(clk_disable); | |||
| 77 | unsigned long clk_get_rate(struct clk *clk) | 81 | unsigned long clk_get_rate(struct clk *clk) |
| 78 | { | 82 | { |
| 79 | unsigned long flags; | 83 | unsigned long flags; |
| 80 | unsigned long ret = 0; | 84 | unsigned long ret; |
| 81 | 85 | ||
| 82 | if (clk == NULL || IS_ERR(clk)) | 86 | if (clk == NULL || IS_ERR(clk)) |
| 83 | return 0; | 87 | return 0; |
| @@ -97,14 +101,16 @@ EXPORT_SYMBOL(clk_get_rate); | |||
| 97 | long clk_round_rate(struct clk *clk, unsigned long rate) | 101 | long clk_round_rate(struct clk *clk, unsigned long rate) |
| 98 | { | 102 | { |
| 99 | unsigned long flags; | 103 | unsigned long flags; |
| 100 | long ret = 0; | 104 | long ret; |
| 101 | 105 | ||
| 102 | if (clk == NULL || IS_ERR(clk)) | 106 | if (clk == NULL || IS_ERR(clk)) |
| 103 | return ret; | 107 | return 0; |
| 108 | |||
| 109 | if (!arch_clock || !arch_clock->clk_round_rate) | ||
| 110 | return 0; | ||
| 104 | 111 | ||
| 105 | spin_lock_irqsave(&clockfw_lock, flags); | 112 | spin_lock_irqsave(&clockfw_lock, flags); |
| 106 | if (arch_clock->clk_round_rate) | 113 | ret = arch_clock->clk_round_rate(clk, rate); |
| 107 | ret = arch_clock->clk_round_rate(clk, rate); | ||
| 108 | spin_unlock_irqrestore(&clockfw_lock, flags); | 114 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| 109 | 115 | ||
| 110 | return ret; | 116 | return ret; |
| @@ -119,14 +125,13 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
| 119 | if (clk == NULL || IS_ERR(clk)) | 125 | if (clk == NULL || IS_ERR(clk)) |
| 120 | return ret; | 126 | return ret; |
| 121 | 127 | ||
| 128 | if (!arch_clock || !arch_clock->clk_set_rate) | ||
| 129 | return ret; | ||
| 130 | |||
| 122 | spin_lock_irqsave(&clockfw_lock, flags); | 131 | spin_lock_irqsave(&clockfw_lock, flags); |
| 123 | if (arch_clock->clk_set_rate) | 132 | ret = arch_clock->clk_set_rate(clk, rate); |
| 124 | ret = arch_clock->clk_set_rate(clk, rate); | 133 | if (ret == 0) |
| 125 | if (ret == 0) { | ||
| 126 | if (clk->recalc) | ||
| 127 | clk->rate = clk->recalc(clk); | ||
| 128 | propagate_rate(clk); | 134 | propagate_rate(clk); |
| 129 | } | ||
| 130 | spin_unlock_irqrestore(&clockfw_lock, flags); | 135 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| 131 | 136 | ||
| 132 | return ret; | 137 | return ret; |
| @@ -141,15 +146,14 @@ int clk_set_parent(struct clk *clk, struct clk *parent) | |||
| 141 | if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) | 146 | if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) |
| 142 | return ret; | 147 | return ret; |
| 143 | 148 | ||
| 149 | if (!arch_clock || !arch_clock->clk_set_parent) | ||
| 150 | return ret; | ||
| 151 | |||
| 144 | spin_lock_irqsave(&clockfw_lock, flags); | 152 | spin_lock_irqsave(&clockfw_lock, flags); |
| 145 | if (clk->usecount == 0) { | 153 | if (clk->usecount == 0) { |
| 146 | if (arch_clock->clk_set_parent) | 154 | ret = arch_clock->clk_set_parent(clk, parent); |
| 147 | ret = arch_clock->clk_set_parent(clk, parent); | 155 | if (ret == 0) |
| 148 | if (ret == 0) { | ||
| 149 | if (clk->recalc) | ||
| 150 | clk->rate = clk->recalc(clk); | ||
| 151 | propagate_rate(clk); | 156 | propagate_rate(clk); |
| 152 | } | ||
| 153 | } else | 157 | } else |
| 154 | ret = -EBUSY; | 158 | ret = -EBUSY; |
| 155 | spin_unlock_irqrestore(&clockfw_lock, flags); | 159 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| @@ -335,6 +339,38 @@ struct clk *omap_clk_get_by_name(const char *name) | |||
| 335 | return ret; | 339 | return ret; |
| 336 | } | 340 | } |
| 337 | 341 | ||
| 342 | int omap_clk_enable_autoidle_all(void) | ||
| 343 | { | ||
| 344 | struct clk *c; | ||
| 345 | unsigned long flags; | ||
| 346 | |||
| 347 | spin_lock_irqsave(&clockfw_lock, flags); | ||
| 348 | |||
| 349 | list_for_each_entry(c, &clocks, node) | ||
| 350 | if (c->ops->allow_idle) | ||
| 351 | c->ops->allow_idle(c); | ||
| 352 | |||
| 353 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
| 354 | |||
| 355 | return 0; | ||
| 356 | } | ||
| 357 | |||
| 358 | int omap_clk_disable_autoidle_all(void) | ||
| 359 | { | ||
| 360 | struct clk *c; | ||
| 361 | unsigned long flags; | ||
| 362 | |||
| 363 | spin_lock_irqsave(&clockfw_lock, flags); | ||
| 364 | |||
| 365 | list_for_each_entry(c, &clocks, node) | ||
| 366 | if (c->ops->deny_idle) | ||
| 367 | c->ops->deny_idle(c); | ||
| 368 | |||
| 369 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
| 370 | |||
| 371 | return 0; | ||
| 372 | } | ||
| 373 | |||
| 338 | /* | 374 | /* |
| 339 | * Low level helpers | 375 | * Low level helpers |
| 340 | */ | 376 | */ |
| @@ -367,9 +403,11 @@ void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | |||
| 367 | { | 403 | { |
| 368 | unsigned long flags; | 404 | unsigned long flags; |
| 369 | 405 | ||
| 406 | if (!arch_clock || !arch_clock->clk_init_cpufreq_table) | ||
| 407 | return; | ||
| 408 | |||
| 370 | spin_lock_irqsave(&clockfw_lock, flags); | 409 | spin_lock_irqsave(&clockfw_lock, flags); |
| 371 | if (arch_clock->clk_init_cpufreq_table) | 410 | arch_clock->clk_init_cpufreq_table(table); |
| 372 | arch_clock->clk_init_cpufreq_table(table); | ||
| 373 | spin_unlock_irqrestore(&clockfw_lock, flags); | 411 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| 374 | } | 412 | } |
| 375 | 413 | ||
| @@ -377,9 +415,11 @@ void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) | |||
| 377 | { | 415 | { |
| 378 | unsigned long flags; | 416 | unsigned long flags; |
| 379 | 417 | ||
| 418 | if (!arch_clock || !arch_clock->clk_exit_cpufreq_table) | ||
| 419 | return; | ||
| 420 | |||
| 380 | spin_lock_irqsave(&clockfw_lock, flags); | 421 | spin_lock_irqsave(&clockfw_lock, flags); |
| 381 | if (arch_clock->clk_exit_cpufreq_table) | 422 | arch_clock->clk_exit_cpufreq_table(table); |
| 382 | arch_clock->clk_exit_cpufreq_table(table); | ||
| 383 | spin_unlock_irqrestore(&clockfw_lock, flags); | 423 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| 384 | } | 424 | } |
| 385 | #endif | 425 | #endif |
| @@ -397,6 +437,9 @@ static int __init clk_disable_unused(void) | |||
| 397 | struct clk *ck; | 437 | struct clk *ck; |
| 398 | unsigned long flags; | 438 | unsigned long flags; |
| 399 | 439 | ||
| 440 | if (!arch_clock || !arch_clock->clk_disable_unused) | ||
| 441 | return 0; | ||
| 442 | |||
| 400 | pr_info("clock: disabling unused clocks to save power\n"); | 443 | pr_info("clock: disabling unused clocks to save power\n"); |
| 401 | list_for_each_entry(ck, &clocks, node) { | 444 | list_for_each_entry(ck, &clocks, node) { |
| 402 | if (ck->ops == &clkops_null) | 445 | if (ck->ops == &clkops_null) |
| @@ -406,14 +449,14 @@ static int __init clk_disable_unused(void) | |||
| 406 | continue; | 449 | continue; |
| 407 | 450 | ||
| 408 | spin_lock_irqsave(&clockfw_lock, flags); | 451 | spin_lock_irqsave(&clockfw_lock, flags); |
| 409 | if (arch_clock->clk_disable_unused) | 452 | arch_clock->clk_disable_unused(ck); |
| 410 | arch_clock->clk_disable_unused(ck); | ||
| 411 | spin_unlock_irqrestore(&clockfw_lock, flags); | 453 | spin_unlock_irqrestore(&clockfw_lock, flags); |
| 412 | } | 454 | } |
| 413 | 455 | ||
| 414 | return 0; | 456 | return 0; |
| 415 | } | 457 | } |
| 416 | late_initcall(clk_disable_unused); | 458 | late_initcall(clk_disable_unused); |
| 459 | late_initcall(omap_clk_enable_autoidle_all); | ||
| 417 | #endif | 460 | #endif |
| 418 | 461 | ||
| 419 | int __init clk_init(struct clk_functions * custom_clocks) | 462 | int __init clk_init(struct clk_functions * custom_clocks) |
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c index 11c54ec8d47f..da4f68dbba1d 100644 --- a/arch/arm/plat-omap/cpu-omap.c +++ b/arch/arm/plat-omap/cpu-omap.c | |||
| @@ -101,7 +101,7 @@ static int omap_target(struct cpufreq_policy *policy, | |||
| 101 | return ret; | 101 | return ret; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | static int __init omap_cpu_init(struct cpufreq_policy *policy) | 104 | static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) |
| 105 | { | 105 | { |
| 106 | int result = 0; | 106 | int result = 0; |
| 107 | 107 | ||
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index 10245b837c10..7d9f815cedec 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
| @@ -35,8 +35,8 @@ | |||
| 35 | 35 | ||
| 36 | static struct platform_device **omap_mcbsp_devices; | 36 | static struct platform_device **omap_mcbsp_devices; |
| 37 | 37 | ||
| 38 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | 38 | void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, |
| 39 | int size) | 39 | struct omap_mcbsp_platform_data *config, int size) |
| 40 | { | 40 | { |
| 41 | int i; | 41 | int i; |
| 42 | 42 | ||
| @@ -54,6 +54,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | |||
| 54 | new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1); | 54 | new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1); |
| 55 | if (!new_mcbsp) | 55 | if (!new_mcbsp) |
| 56 | continue; | 56 | continue; |
| 57 | platform_device_add_resources(new_mcbsp, &res[i * res_count], | ||
| 58 | res_count); | ||
| 57 | new_mcbsp->dev.platform_data = &config[i]; | 59 | new_mcbsp->dev.platform_data = &config[i]; |
| 58 | ret = platform_device_add(new_mcbsp); | 60 | ret = platform_device_add(new_mcbsp); |
| 59 | if (ret) { | 61 | if (ret) { |
| @@ -65,8 +67,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | |||
| 65 | } | 67 | } |
| 66 | 68 | ||
| 67 | #else | 69 | #else |
| 68 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | 70 | void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, |
| 69 | int size) | 71 | struct omap_mcbsp_platform_data *config, int size) |
| 70 | { } | 72 | { } |
| 71 | #endif | 73 | #endif |
| 72 | 74 | ||
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 1d706cf63ca0..ee9f6ebba29b 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
| @@ -342,6 +342,10 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer) | |||
| 342 | l |= 0x02 << 3; /* Set to smart-idle mode */ | 342 | l |= 0x02 << 3; /* Set to smart-idle mode */ |
| 343 | l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ | 343 | l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ |
| 344 | 344 | ||
| 345 | /* Enable autoidle on OMAP2 / OMAP3 */ | ||
| 346 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) | ||
| 347 | l |= 0x1 << 0; | ||
| 348 | |||
| 345 | /* | 349 | /* |
| 346 | * Enable wake-up on OMAP2 CPUs. | 350 | * Enable wake-up on OMAP2 CPUs. |
| 347 | */ | 351 | */ |
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h index d43e6234dbbb..006e599c6613 100644 --- a/arch/arm/plat-omap/include/plat/clock.h +++ b/arch/arm/plat-omap/include/plat/clock.h | |||
| @@ -25,6 +25,8 @@ struct clockdomain; | |||
| 25 | * @disable: fn ptr that enables the current clock in hardware | 25 | * @disable: fn ptr that enables the current clock in hardware |
| 26 | * @find_idlest: function returning the IDLEST register for the clock's IP blk | 26 | * @find_idlest: function returning the IDLEST register for the clock's IP blk |
| 27 | * @find_companion: function returning the "companion" clk reg for the clock | 27 | * @find_companion: function returning the "companion" clk reg for the clock |
| 28 | * @allow_idle: fn ptr that enables autoidle for the current clock in hardware | ||
| 29 | * @deny_idle: fn ptr that disables autoidle for the current clock in hardware | ||
| 28 | * | 30 | * |
| 29 | * A "companion" clk is an accompanying clock to the one being queried | 31 | * A "companion" clk is an accompanying clock to the one being queried |
| 30 | * that must be enabled for the IP module connected to the clock to | 32 | * that must be enabled for the IP module connected to the clock to |
| @@ -42,6 +44,8 @@ struct clkops { | |||
| 42 | u8 *, u8 *); | 44 | u8 *, u8 *); |
| 43 | void (*find_companion)(struct clk *, void __iomem **, | 45 | void (*find_companion)(struct clk *, void __iomem **, |
| 44 | u8 *); | 46 | u8 *); |
| 47 | void (*allow_idle)(struct clk *); | ||
| 48 | void (*deny_idle)(struct clk *); | ||
| 45 | }; | 49 | }; |
| 46 | 50 | ||
| 47 | #ifdef CONFIG_ARCH_OMAP2PLUS | 51 | #ifdef CONFIG_ARCH_OMAP2PLUS |
| @@ -105,7 +109,6 @@ struct clksel { | |||
| 105 | * @clk_ref: struct clk pointer to the clock's reference clock input | 109 | * @clk_ref: struct clk pointer to the clock's reference clock input |
| 106 | * @control_reg: register containing the DPLL mode bitfield | 110 | * @control_reg: register containing the DPLL mode bitfield |
| 107 | * @enable_mask: mask of the DPLL mode bitfield in @control_reg | 111 | * @enable_mask: mask of the DPLL mode bitfield in @control_reg |
| 108 | * @rate_tolerance: maximum variance allowed from target rate (in Hz) | ||
| 109 | * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() | 112 | * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() |
| 110 | * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() | 113 | * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() |
| 111 | * @max_multiplier: maximum valid non-bypass multiplier value (actual) | 114 | * @max_multiplier: maximum valid non-bypass multiplier value (actual) |
| @@ -131,12 +134,9 @@ struct clksel { | |||
| 131 | * XXX Some DPLLs have multiple bypass inputs, so it's not technically | 134 | * XXX Some DPLLs have multiple bypass inputs, so it's not technically |
| 132 | * correct to only have one @clk_bypass pointer. | 135 | * correct to only have one @clk_bypass pointer. |
| 133 | * | 136 | * |
| 134 | * XXX @rate_tolerance should probably be deprecated - currently there | ||
| 135 | * don't seem to be any usecases for DPLL rounding that is not exact. | ||
| 136 | * | ||
| 137 | * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m, | 137 | * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m, |
| 138 | * @last_rounded_n) should be separated from the runtime-fixed fields | 138 | * @last_rounded_n) should be separated from the runtime-fixed fields |
| 139 | * and placed into a differenct structure, so that the runtime-fixed data | 139 | * and placed into a different structure, so that the runtime-fixed data |
| 140 | * can be placed into read-only space. | 140 | * can be placed into read-only space. |
| 141 | */ | 141 | */ |
| 142 | struct dpll_data { | 142 | struct dpll_data { |
| @@ -147,7 +147,6 @@ struct dpll_data { | |||
| 147 | struct clk *clk_ref; | 147 | struct clk *clk_ref; |
| 148 | void __iomem *control_reg; | 148 | void __iomem *control_reg; |
| 149 | u32 enable_mask; | 149 | u32 enable_mask; |
| 150 | unsigned int rate_tolerance; | ||
| 151 | unsigned long last_rounded_rate; | 150 | unsigned long last_rounded_rate; |
| 152 | u16 last_rounded_m; | 151 | u16 last_rounded_m; |
| 153 | u16 max_multiplier; | 152 | u16 max_multiplier; |
| @@ -172,12 +171,24 @@ struct dpll_data { | |||
| 172 | 171 | ||
| 173 | #endif | 172 | #endif |
| 174 | 173 | ||
| 175 | /* struct clk.flags possibilities */ | 174 | /* |
| 175 | * struct clk.flags possibilities | ||
| 176 | * | ||
| 177 | * XXX document the rest of the clock flags here | ||
| 178 | * | ||
| 179 | * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL | ||
| 180 | * bits share the same register. This flag allows the | ||
| 181 | * omap4_dpllmx*() code to determine which GATE_CTRL bit field | ||
| 182 | * should be used. This is a temporary solution - a better approach | ||
| 183 | * would be to associate clock type-specific data with the clock, | ||
| 184 | * similar to the struct dpll_data approach. | ||
| 185 | */ | ||
| 176 | #define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ | 186 | #define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ |
| 177 | #define CLOCK_IDLE_CONTROL (1 << 1) | 187 | #define CLOCK_IDLE_CONTROL (1 << 1) |
| 178 | #define CLOCK_NO_IDLE_PARENT (1 << 2) | 188 | #define CLOCK_NO_IDLE_PARENT (1 << 2) |
| 179 | #define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ | 189 | #define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ |
| 180 | #define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ | 190 | #define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ |
| 191 | #define CLOCK_CLKOUTX2 (1 << 5) | ||
| 181 | 192 | ||
| 182 | /** | 193 | /** |
| 183 | * struct clk - OMAP struct clk | 194 | * struct clk - OMAP struct clk |
| @@ -293,6 +304,8 @@ extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | |||
| 293 | extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); | 304 | extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); |
| 294 | #endif | 305 | #endif |
| 295 | extern struct clk *omap_clk_get_by_name(const char *name); | 306 | extern struct clk *omap_clk_get_by_name(const char *name); |
| 307 | extern int omap_clk_enable_autoidle_all(void); | ||
| 308 | extern int omap_clk_disable_autoidle_all(void); | ||
| 296 | 309 | ||
| 297 | extern const struct clkops clkops_null; | 310 | extern const struct clkops clkops_null; |
| 298 | 311 | ||
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index be99438d385e..8198bb6cdb5e 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2004, 2008 Nokia Corporation | 6 | * Copyright (C) 2004, 2008 Nokia Corporation |
| 7 | * | 7 | * |
| 8 | * Copyright (C) 2009 Texas Instruments. | 8 | * Copyright (C) 2009-11 Texas Instruments. |
| 9 | * | 9 | * |
| 10 | * Written by Tony Lindgren <tony.lindgren@nokia.com> | 10 | * Written by Tony Lindgren <tony.lindgren@nokia.com> |
| 11 | * | 11 | * |
| @@ -405,8 +405,10 @@ IS_OMAP_TYPE(3517, 0x3517) | |||
| 405 | #define TI8168_REV_ES1_1 (TI816X_CLASS | (OMAP_REVBITS_01 << 8)) | 405 | #define TI8168_REV_ES1_1 (TI816X_CLASS | (OMAP_REVBITS_01 << 8)) |
| 406 | 406 | ||
| 407 | #define OMAP443X_CLASS 0x44300044 | 407 | #define OMAP443X_CLASS 0x44300044 |
| 408 | #define OMAP4430_REV_ES1_0 OMAP443X_CLASS | 408 | #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) |
| 409 | #define OMAP4430_REV_ES2_0 0x44301044 | 409 | #define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8)) |
| 410 | #define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8)) | ||
| 411 | #define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8)) | ||
| 410 | 412 | ||
| 411 | /* | 413 | /* |
| 412 | * omap_chip bits | 414 | * omap_chip bits |
| @@ -434,12 +436,16 @@ IS_OMAP_TYPE(3517, 0x3517) | |||
| 434 | #define CHIP_IS_OMAP3630ES1_1 (1 << 9) | 436 | #define CHIP_IS_OMAP3630ES1_1 (1 << 9) |
| 435 | #define CHIP_IS_OMAP3630ES1_2 (1 << 10) | 437 | #define CHIP_IS_OMAP3630ES1_2 (1 << 10) |
| 436 | #define CHIP_IS_OMAP4430ES2 (1 << 11) | 438 | #define CHIP_IS_OMAP4430ES2 (1 << 11) |
| 439 | #define CHIP_IS_OMAP4430ES2_1 (1 << 12) | ||
| 440 | #define CHIP_IS_OMAP4430ES2_2 (1 << 13) | ||
| 437 | #define CHIP_IS_TI816X (1 << 14) | 441 | #define CHIP_IS_TI816X (1 << 14) |
| 438 | 442 | ||
| 439 | #define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) | 443 | #define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) |
| 440 | 444 | ||
| 441 | #define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \ | 445 | #define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \ |
| 442 | CHIP_IS_OMAP4430ES2) | 446 | CHIP_IS_OMAP4430ES2 | \ |
| 447 | CHIP_IS_OMAP4430ES2_1 | \ | ||
| 448 | CHIP_IS_OMAP4430ES2_2) | ||
| 443 | 449 | ||
| 444 | /* | 450 | /* |
| 445 | * "GE" here represents "greater than or equal to" in terms of ES | 451 | * "GE" here represents "greater than or equal to" in terms of ES |
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index 537f4e449f50..0f140ecedb01 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
| 24 | #include <linux/kobject.h> | 24 | #include <linux/kobject.h> |
| 25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
| 26 | #include <linux/platform_device.h> | ||
| 26 | #include <asm/atomic.h> | 27 | #include <asm/atomic.h> |
| 27 | 28 | ||
| 28 | #define DISPC_IRQ_FRAMEDONE (1 << 0) | 29 | #define DISPC_IRQ_FRAMEDONE (1 << 0) |
| @@ -226,6 +227,16 @@ struct omap_dss_board_info { | |||
| 226 | struct omap_dss_device *default_device; | 227 | struct omap_dss_device *default_device; |
| 227 | }; | 228 | }; |
| 228 | 229 | ||
| 230 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) | ||
| 231 | /* Init with the board info */ | ||
| 232 | extern int omap_display_init(struct omap_dss_board_info *board_data); | ||
| 233 | #else | ||
| 234 | static inline int omap_display_init(struct omap_dss_board_info *board_data) | ||
| 235 | { | ||
| 236 | return 0; | ||
| 237 | } | ||
| 238 | #endif | ||
| 239 | |||
| 229 | struct omap_video_timings { | 240 | struct omap_video_timings { |
| 230 | /* Unit: pixels */ | 241 | /* Unit: pixels */ |
| 231 | u16 x_res; | 242 | u16 x_res; |
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h index dfa3aff9761b..d6c70d2f4030 100644 --- a/arch/arm/plat-omap/include/plat/dmtimer.h +++ b/arch/arm/plat-omap/include/plat/dmtimer.h | |||
| @@ -3,6 +3,12 @@ | |||
| 3 | * | 3 | * |
| 4 | * OMAP Dual-Mode Timers | 4 | * OMAP Dual-Mode Timers |
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ | ||
| 7 | * Tarun Kanti DebBarma <tarun.kanti@ti.com> | ||
| 8 | * Thara Gopinath <thara@ti.com> | ||
| 9 | * | ||
| 10 | * Platform device conversion and hwmod support. | ||
| 11 | * | ||
| 6 | * Copyright (C) 2005 Nokia Corporation | 12 | * Copyright (C) 2005 Nokia Corporation |
| 7 | * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com> | 13 | * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com> |
| 8 | * PWM and clock framwork support by Timo Teras. | 14 | * PWM and clock framwork support by Timo Teras. |
| @@ -44,6 +50,11 @@ | |||
| 44 | #define OMAP_TIMER_TRIGGER_OVERFLOW 0x01 | 50 | #define OMAP_TIMER_TRIGGER_OVERFLOW 0x01 |
| 45 | #define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02 | 51 | #define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02 |
| 46 | 52 | ||
| 53 | /* | ||
| 54 | * IP revision identifier so that Highlander IP | ||
| 55 | * in OMAP4 can be distinguished. | ||
| 56 | */ | ||
| 57 | #define OMAP_TIMER_IP_VERSION_1 0x1 | ||
| 47 | struct omap_dm_timer; | 58 | struct omap_dm_timer; |
| 48 | extern struct omap_dm_timer *gptimer_wakeup; | 59 | extern struct omap_dm_timer *gptimer_wakeup; |
| 49 | extern struct sys_timer omap_timer; | 60 | extern struct sys_timer omap_timer; |
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h index 85ded598853e..12b316165037 100644 --- a/arch/arm/plat-omap/include/plat/gpmc.h +++ b/arch/arm/plat-omap/include/plat/gpmc.h | |||
| @@ -41,6 +41,8 @@ | |||
| 41 | #define GPMC_NAND_ADDRESS 0x0000000b | 41 | #define GPMC_NAND_ADDRESS 0x0000000b |
| 42 | #define GPMC_NAND_DATA 0x0000000c | 42 | #define GPMC_NAND_DATA 0x0000000c |
| 43 | 43 | ||
| 44 | #define GPMC_ENABLE_IRQ 0x0000000d | ||
| 45 | |||
| 44 | /* ECC commands */ | 46 | /* ECC commands */ |
| 45 | #define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */ | 47 | #define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */ |
| 46 | #define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */ | 48 | #define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */ |
| @@ -78,6 +80,19 @@ | |||
| 78 | #define WR_RD_PIN_MONITORING 0x00600000 | 80 | #define WR_RD_PIN_MONITORING 0x00600000 |
| 79 | #define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F) | 81 | #define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F) |
| 80 | #define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) | 82 | #define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) |
| 83 | #define GPMC_IRQ_FIFOEVENTENABLE 0x01 | ||
| 84 | #define GPMC_IRQ_COUNT_EVENT 0x02 | ||
| 85 | |||
| 86 | #define PREFETCH_FIFOTHRESHOLD_MAX 0x40 | ||
| 87 | #define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8) | ||
| 88 | |||
| 89 | enum omap_ecc { | ||
| 90 | /* 1-bit ecc: stored at end of spare area */ | ||
| 91 | OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ | ||
| 92 | OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ | ||
| 93 | /* 1-bit ecc: stored at begining of spare area as romcode */ | ||
| 94 | OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ | ||
| 95 | }; | ||
| 81 | 96 | ||
| 82 | /* | 97 | /* |
| 83 | * Note that all values in this struct are in nanoseconds except sync_clk | 98 | * Note that all values in this struct are in nanoseconds except sync_clk |
| @@ -130,12 +145,11 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); | |||
| 130 | extern void gpmc_cs_free(int cs); | 145 | extern void gpmc_cs_free(int cs); |
| 131 | extern int gpmc_cs_set_reserved(int cs, int reserved); | 146 | extern int gpmc_cs_set_reserved(int cs, int reserved); |
| 132 | extern int gpmc_cs_reserved(int cs); | 147 | extern int gpmc_cs_reserved(int cs); |
| 133 | extern int gpmc_prefetch_enable(int cs, int dma_mode, | 148 | extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode, |
| 134 | unsigned int u32_count, int is_write); | 149 | unsigned int u32_count, int is_write); |
| 135 | extern int gpmc_prefetch_reset(int cs); | 150 | extern int gpmc_prefetch_reset(int cs); |
| 136 | extern void omap3_gpmc_save_context(void); | 151 | extern void omap3_gpmc_save_context(void); |
| 137 | extern void omap3_gpmc_restore_context(void); | 152 | extern void omap3_gpmc_restore_context(void); |
| 138 | extern void gpmc_init(void); | ||
| 139 | extern int gpmc_read_status(int cmd); | 153 | extern int gpmc_read_status(int cmd); |
| 140 | extern int gpmc_cs_configure(int cs, int cmd, int wval); | 154 | extern int gpmc_cs_configure(int cs, int cmd, int wval); |
| 141 | extern int gpmc_nand_read(int cs, int cmd); | 155 | extern int gpmc_nand_read(int cs, int cmd); |
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h index 69230d685538..174f1b9c8c03 100644 --- a/arch/arm/plat-omap/include/plat/iommu.h +++ b/arch/arm/plat-omap/include/plat/iommu.h | |||
| @@ -31,6 +31,7 @@ struct iommu { | |||
| 31 | struct clk *clk; | 31 | struct clk *clk; |
| 32 | void __iomem *regbase; | 32 | void __iomem *regbase; |
| 33 | struct device *dev; | 33 | struct device *dev; |
| 34 | void *isr_priv; | ||
| 34 | 35 | ||
| 35 | unsigned int refcount; | 36 | unsigned int refcount; |
| 36 | struct mutex iommu_lock; /* global for this whole object */ | 37 | struct mutex iommu_lock; /* global for this whole object */ |
| @@ -47,7 +48,7 @@ struct iommu { | |||
| 47 | struct list_head mmap; | 48 | struct list_head mmap; |
| 48 | struct mutex mmap_lock; /* protect mmap */ | 49 | struct mutex mmap_lock; /* protect mmap */ |
| 49 | 50 | ||
| 50 | int (*isr)(struct iommu *obj); | 51 | int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs, void *priv); |
| 51 | 52 | ||
| 52 | void *ctx; /* iommu context: registres saved area */ | 53 | void *ctx; /* iommu context: registres saved area */ |
| 53 | u32 da_start; | 54 | u32 da_start; |
| @@ -109,6 +110,13 @@ struct iommu_platform_data { | |||
| 109 | u32 da_end; | 110 | u32 da_end; |
| 110 | }; | 111 | }; |
| 111 | 112 | ||
| 113 | /* IOMMU errors */ | ||
| 114 | #define OMAP_IOMMU_ERR_TLB_MISS (1 << 0) | ||
| 115 | #define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1) | ||
| 116 | #define OMAP_IOMMU_ERR_EMU_MISS (1 << 2) | ||
| 117 | #define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3) | ||
| 118 | #define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4) | ||
| 119 | |||
| 112 | #if defined(CONFIG_ARCH_OMAP1) | 120 | #if defined(CONFIG_ARCH_OMAP1) |
| 113 | #error "iommu for this processor not implemented yet" | 121 | #error "iommu for this processor not implemented yet" |
| 114 | #else | 122 | #else |
| @@ -154,11 +162,17 @@ extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end); | |||
| 154 | extern void flush_iotlb_all(struct iommu *obj); | 162 | extern void flush_iotlb_all(struct iommu *obj); |
| 155 | 163 | ||
| 156 | extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e); | 164 | extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e); |
| 165 | extern void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd, | ||
| 166 | u32 **ppte); | ||
| 157 | extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova); | 167 | extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova); |
| 158 | 168 | ||
| 159 | extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end); | 169 | extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end); |
| 160 | extern struct iommu *iommu_get(const char *name); | 170 | extern struct iommu *iommu_get(const char *name); |
| 161 | extern void iommu_put(struct iommu *obj); | 171 | extern void iommu_put(struct iommu *obj); |
| 172 | extern int iommu_set_isr(const char *name, | ||
| 173 | int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs, | ||
| 174 | void *priv), | ||
| 175 | void *isr_priv); | ||
| 162 | 176 | ||
| 163 | extern void iommu_save_ctx(struct iommu *obj); | 177 | extern void iommu_save_ctx(struct iommu *obj); |
| 164 | extern void iommu_restore_ctx(struct iommu *obj); | 178 | extern void iommu_restore_ctx(struct iommu *obj); |
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h index 2910de921c52..d77928370463 100644 --- a/arch/arm/plat-omap/include/plat/irqs.h +++ b/arch/arm/plat-omap/include/plat/irqs.h | |||
| @@ -315,9 +315,12 @@ | |||
| 315 | #define INT_34XX_SSM_ABORT_IRQ 6 | 315 | #define INT_34XX_SSM_ABORT_IRQ 6 |
| 316 | #define INT_34XX_SYS_NIRQ 7 | 316 | #define INT_34XX_SYS_NIRQ 7 |
| 317 | #define INT_34XX_D2D_FW_IRQ 8 | 317 | #define INT_34XX_D2D_FW_IRQ 8 |
| 318 | #define INT_34XX_L3_DBG_IRQ 9 | ||
| 319 | #define INT_34XX_L3_APP_IRQ 10 | ||
| 318 | #define INT_34XX_PRCM_MPU_IRQ 11 | 320 | #define INT_34XX_PRCM_MPU_IRQ 11 |
| 319 | #define INT_34XX_MCBSP1_IRQ 16 | 321 | #define INT_34XX_MCBSP1_IRQ 16 |
| 320 | #define INT_34XX_MCBSP2_IRQ 17 | 322 | #define INT_34XX_MCBSP2_IRQ 17 |
| 323 | #define INT_34XX_GPMC_IRQ 20 | ||
| 321 | #define INT_34XX_MCBSP3_IRQ 22 | 324 | #define INT_34XX_MCBSP3_IRQ 22 |
| 322 | #define INT_34XX_MCBSP4_IRQ 23 | 325 | #define INT_34XX_MCBSP4_IRQ 23 |
| 323 | #define INT_34XX_CAM_IRQ 24 | 326 | #define INT_34XX_CAM_IRQ 24 |
| @@ -411,7 +414,13 @@ | |||
| 411 | #define TWL_IRQ_END TWL6030_IRQ_END | 414 | #define TWL_IRQ_END TWL6030_IRQ_END |
| 412 | #endif | 415 | #endif |
| 413 | 416 | ||
| 414 | #define NR_IRQS TWL_IRQ_END | 417 | /* GPMC related */ |
| 418 | #define OMAP_GPMC_IRQ_BASE (TWL_IRQ_END) | ||
| 419 | #define OMAP_GPMC_NR_IRQS 7 | ||
| 420 | #define OMAP_GPMC_IRQ_END (OMAP_GPMC_IRQ_BASE + OMAP_GPMC_NR_IRQS) | ||
| 421 | |||
| 422 | |||
| 423 | #define NR_IRQS OMAP_GPMC_IRQ_END | ||
| 415 | 424 | ||
| 416 | #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) | 425 | #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) |
| 417 | 426 | ||
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index 6ecf1051e5f4..f8f690ab2997 100644 --- a/arch/arm/plat-omap/include/plat/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h | |||
| @@ -37,6 +37,10 @@ static struct platform_device omap_mcbsp##port_nr = { \ | |||
| 37 | .id = OMAP_MCBSP##port_nr, \ | 37 | .id = OMAP_MCBSP##port_nr, \ |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | #define MCBSP_CONFIG_TYPE2 0x2 | ||
| 41 | #define MCBSP_CONFIG_TYPE3 0x3 | ||
| 42 | #define MCBSP_CONFIG_TYPE4 0x4 | ||
| 43 | |||
| 40 | #define OMAP7XX_MCBSP1_BASE 0xfffb1000 | 44 | #define OMAP7XX_MCBSP1_BASE 0xfffb1000 |
| 41 | #define OMAP7XX_MCBSP2_BASE 0xfffb1800 | 45 | #define OMAP7XX_MCBSP2_BASE 0xfffb1800 |
| 42 | 46 | ||
| @@ -48,32 +52,14 @@ static struct platform_device omap_mcbsp##port_nr = { \ | |||
| 48 | #define OMAP1610_MCBSP2_BASE 0xfffb1000 | 52 | #define OMAP1610_MCBSP2_BASE 0xfffb1000 |
| 49 | #define OMAP1610_MCBSP3_BASE 0xe1017000 | 53 | #define OMAP1610_MCBSP3_BASE 0xe1017000 |
| 50 | 54 | ||
| 51 | #define OMAP24XX_MCBSP1_BASE 0x48074000 | 55 | #ifdef CONFIG_ARCH_OMAP1 |
| 52 | #define OMAP24XX_MCBSP2_BASE 0x48076000 | ||
| 53 | #define OMAP2430_MCBSP3_BASE 0x4808c000 | ||
| 54 | #define OMAP2430_MCBSP4_BASE 0x4808e000 | ||
| 55 | #define OMAP2430_MCBSP5_BASE 0x48096000 | ||
| 56 | |||
| 57 | #define OMAP34XX_MCBSP1_BASE 0x48074000 | ||
| 58 | #define OMAP34XX_MCBSP2_BASE 0x49022000 | ||
| 59 | #define OMAP34XX_MCBSP2_ST_BASE 0x49028000 | ||
| 60 | #define OMAP34XX_MCBSP3_BASE 0x49024000 | ||
| 61 | #define OMAP34XX_MCBSP3_ST_BASE 0x4902A000 | ||
| 62 | #define OMAP34XX_MCBSP3_BASE 0x49024000 | ||
| 63 | #define OMAP34XX_MCBSP4_BASE 0x49026000 | ||
| 64 | #define OMAP34XX_MCBSP5_BASE 0x48096000 | ||
| 65 | |||
| 66 | #define OMAP44XX_MCBSP1_BASE 0x49022000 | ||
| 67 | #define OMAP44XX_MCBSP2_BASE 0x49024000 | ||
| 68 | #define OMAP44XX_MCBSP3_BASE 0x49026000 | ||
| 69 | #define OMAP44XX_MCBSP4_BASE 0x48096000 | ||
| 70 | |||
| 71 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) | ||
| 72 | 56 | ||
| 73 | #define OMAP_MCBSP_REG_DRR2 0x00 | 57 | #define OMAP_MCBSP_REG_DRR2 0x00 |
| 74 | #define OMAP_MCBSP_REG_DRR1 0x02 | 58 | #define OMAP_MCBSP_REG_DRR1 0x02 |
| 75 | #define OMAP_MCBSP_REG_DXR2 0x04 | 59 | #define OMAP_MCBSP_REG_DXR2 0x04 |
| 76 | #define OMAP_MCBSP_REG_DXR1 0x06 | 60 | #define OMAP_MCBSP_REG_DXR1 0x06 |
| 61 | #define OMAP_MCBSP_REG_DRR 0x02 | ||
| 62 | #define OMAP_MCBSP_REG_DXR 0x06 | ||
| 77 | #define OMAP_MCBSP_REG_SPCR2 0x08 | 63 | #define OMAP_MCBSP_REG_SPCR2 0x08 |
| 78 | #define OMAP_MCBSP_REG_SPCR1 0x0a | 64 | #define OMAP_MCBSP_REG_SPCR1 0x0a |
| 79 | #define OMAP_MCBSP_REG_RCR2 0x0c | 65 | #define OMAP_MCBSP_REG_RCR2 0x0c |
| @@ -414,8 +400,9 @@ struct omap_mcbsp_platform_data { | |||
| 414 | #ifdef CONFIG_ARCH_OMAP3 | 400 | #ifdef CONFIG_ARCH_OMAP3 |
| 415 | /* Sidetone block for McBSP 2 and 3 */ | 401 | /* Sidetone block for McBSP 2 and 3 */ |
| 416 | unsigned long phys_base_st; | 402 | unsigned long phys_base_st; |
| 417 | u16 buffer_size; | ||
| 418 | #endif | 403 | #endif |
| 404 | u16 buffer_size; | ||
| 405 | unsigned int mcbsp_config_type; | ||
| 419 | }; | 406 | }; |
| 420 | 407 | ||
| 421 | struct omap_mcbsp_st_data { | 408 | struct omap_mcbsp_st_data { |
| @@ -431,6 +418,7 @@ struct omap_mcbsp_st_data { | |||
| 431 | struct omap_mcbsp { | 418 | struct omap_mcbsp { |
| 432 | struct device *dev; | 419 | struct device *dev; |
| 433 | unsigned long phys_base; | 420 | unsigned long phys_base; |
| 421 | unsigned long phys_dma_base; | ||
| 434 | void __iomem *io_base; | 422 | void __iomem *io_base; |
| 435 | u8 id; | 423 | u8 id; |
| 436 | u8 free; | 424 | u8 free; |
| @@ -457,7 +445,6 @@ struct omap_mcbsp { | |||
| 457 | /* Protect the field .free, while checking if the mcbsp is in use */ | 445 | /* Protect the field .free, while checking if the mcbsp is in use */ |
| 458 | spinlock_t lock; | 446 | spinlock_t lock; |
| 459 | struct omap_mcbsp_platform_data *pdata; | 447 | struct omap_mcbsp_platform_data *pdata; |
| 460 | struct clk *iclk; | ||
| 461 | struct clk *fclk; | 448 | struct clk *fclk; |
| 462 | #ifdef CONFIG_ARCH_OMAP3 | 449 | #ifdef CONFIG_ARCH_OMAP3 |
| 463 | struct omap_mcbsp_st_data *st_data; | 450 | struct omap_mcbsp_st_data *st_data; |
| @@ -466,7 +453,17 @@ struct omap_mcbsp { | |||
| 466 | u16 max_rx_thres; | 453 | u16 max_rx_thres; |
| 467 | #endif | 454 | #endif |
| 468 | void *reg_cache; | 455 | void *reg_cache; |
| 456 | unsigned int mcbsp_config_type; | ||
| 469 | }; | 457 | }; |
| 458 | |||
| 459 | /** | ||
| 460 | * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod | ||
| 461 | * @sidetone: name of the sidetone device | ||
| 462 | */ | ||
| 463 | struct omap_mcbsp_dev_attr { | ||
| 464 | const char *sidetone; | ||
| 465 | }; | ||
| 466 | |||
| 470 | extern struct omap_mcbsp **mcbsp_ptr; | 467 | extern struct omap_mcbsp **mcbsp_ptr; |
| 471 | extern int omap_mcbsp_count, omap_mcbsp_cache_size; | 468 | extern int omap_mcbsp_count, omap_mcbsp_cache_size; |
| 472 | 469 | ||
| @@ -474,8 +471,8 @@ extern int omap_mcbsp_count, omap_mcbsp_cache_size; | |||
| 474 | #define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; | 471 | #define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; |
| 475 | 472 | ||
| 476 | int omap_mcbsp_init(void); | 473 | int omap_mcbsp_init(void); |
| 477 | void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | 474 | void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, |
| 478 | int size); | 475 | struct omap_mcbsp_platform_data *config, int size); |
| 479 | void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); | 476 | void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); |
| 480 | #ifdef CONFIG_ARCH_OMAP3 | 477 | #ifdef CONFIG_ARCH_OMAP3 |
| 481 | void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold); | 478 | void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold); |
| @@ -525,6 +522,9 @@ int omap_mcbsp_set_io_type(unsigned int id, omap_mcbsp_io_type_t io_type); | |||
| 525 | void omap2_mcbsp1_mux_clkr_src(u8 mux); | 522 | void omap2_mcbsp1_mux_clkr_src(u8 mux); |
| 526 | void omap2_mcbsp1_mux_fsr_src(u8 mux); | 523 | void omap2_mcbsp1_mux_fsr_src(u8 mux); |
| 527 | 524 | ||
| 525 | int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream); | ||
| 526 | int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream); | ||
| 527 | |||
| 528 | #ifdef CONFIG_ARCH_OMAP3 | 528 | #ifdef CONFIG_ARCH_OMAP3 |
| 529 | /* Sidetone specific API */ | 529 | /* Sidetone specific API */ |
| 530 | int omap_st_set_chgain(unsigned int id, int channel, s16 chgain); | 530 | int omap_st_set_chgain(unsigned int id, int channel, s16 chgain); |
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h index f57f36abb07e..f38fef9f1310 100644 --- a/arch/arm/plat-omap/include/plat/mmc.h +++ b/arch/arm/plat-omap/include/plat/mmc.h | |||
| @@ -24,25 +24,19 @@ | |||
| 24 | #define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */ | 24 | #define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */ |
| 25 | 25 | ||
| 26 | #define OMAP24XX_NR_MMC 2 | 26 | #define OMAP24XX_NR_MMC 2 |
| 27 | #define OMAP34XX_NR_MMC 3 | ||
| 28 | #define OMAP44XX_NR_MMC 5 | ||
| 29 | #define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE | 27 | #define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE |
| 30 | #define OMAP3_HSMMC_SIZE 0x200 | ||
| 31 | #define OMAP4_HSMMC_SIZE 0x1000 | ||
| 32 | #define OMAP2_MMC1_BASE 0x4809c000 | 28 | #define OMAP2_MMC1_BASE 0x4809c000 |
| 33 | #define OMAP2_MMC2_BASE 0x480b4000 | 29 | |
| 34 | #define OMAP3_MMC3_BASE 0x480ad000 | ||
| 35 | #define OMAP4_MMC4_BASE 0x480d1000 | ||
| 36 | #define OMAP4_MMC5_BASE 0x480d5000 | ||
| 37 | #define OMAP4_MMC_REG_OFFSET 0x100 | 30 | #define OMAP4_MMC_REG_OFFSET 0x100 |
| 38 | #define HSMMC5 (1 << 4) | ||
| 39 | #define HSMMC4 (1 << 3) | ||
| 40 | #define HSMMC3 (1 << 2) | ||
| 41 | #define HSMMC2 (1 << 1) | ||
| 42 | #define HSMMC1 (1 << 0) | ||
| 43 | 31 | ||
| 44 | #define OMAP_MMC_MAX_SLOTS 2 | 32 | #define OMAP_MMC_MAX_SLOTS 2 |
| 45 | 33 | ||
| 34 | #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(1) | ||
| 35 | |||
| 36 | struct omap_mmc_dev_attr { | ||
| 37 | u8 flags; | ||
| 38 | }; | ||
| 39 | |||
| 46 | struct omap_mmc_platform_data { | 40 | struct omap_mmc_platform_data { |
| 47 | /* back-link to device */ | 41 | /* back-link to device */ |
| 48 | struct device *dev; | 42 | struct device *dev; |
| @@ -71,6 +65,9 @@ struct omap_mmc_platform_data { | |||
| 71 | 65 | ||
| 72 | u64 dma_mask; | 66 | u64 dma_mask; |
| 73 | 67 | ||
| 68 | /* Integrating attributes from the omap_hwmod layer */ | ||
| 69 | u8 controller_flags; | ||
| 70 | |||
| 74 | /* Register offset deviation */ | 71 | /* Register offset deviation */ |
| 75 | u16 reg_offset; | 72 | u16 reg_offset; |
| 76 | 73 | ||
| @@ -159,8 +156,7 @@ extern void omap_mmc_notify_cover_event(struct device *dev, int slot, | |||
| 159 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | 156 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) |
| 160 | void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, | 157 | void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, |
| 161 | int nr_controllers); | 158 | int nr_controllers); |
| 162 | void omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | 159 | void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data); |
| 163 | int nr_controllers); | ||
| 164 | int omap_mmc_add(const char *name, int id, unsigned long base, | 160 | int omap_mmc_add(const char *name, int id, unsigned long base, |
| 165 | unsigned long size, unsigned int irq, | 161 | unsigned long size, unsigned int irq, |
| 166 | struct omap_mmc_platform_data *data); | 162 | struct omap_mmc_platform_data *data); |
| @@ -169,8 +165,7 @@ static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
| 169 | int nr_controllers) | 165 | int nr_controllers) |
| 170 | { | 166 | { |
| 171 | } | 167 | } |
| 172 | static inline void omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | 168 | static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data) |
| 173 | int nr_controllers) | ||
| 174 | { | 169 | { |
| 175 | } | 170 | } |
| 176 | static inline int omap_mmc_add(const char *name, int id, unsigned long base, | 171 | static inline int omap_mmc_add(const char *name, int id, unsigned long base, |
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h index 6562cd082bb1..d86d1ecf0068 100644 --- a/arch/arm/plat-omap/include/plat/nand.h +++ b/arch/arm/plat-omap/include/plat/nand.h | |||
| @@ -8,8 +8,16 @@ | |||
| 8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <plat/gpmc.h> | ||
| 11 | #include <linux/mtd/partitions.h> | 12 | #include <linux/mtd/partitions.h> |
| 12 | 13 | ||
| 14 | enum nand_io { | ||
| 15 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ | ||
| 16 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ | ||
| 17 | NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */ | ||
| 18 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ | ||
| 19 | }; | ||
| 20 | |||
| 13 | struct omap_nand_platform_data { | 21 | struct omap_nand_platform_data { |
| 14 | unsigned int options; | 22 | unsigned int options; |
| 15 | int cs; | 23 | int cs; |
| @@ -20,8 +28,11 @@ struct omap_nand_platform_data { | |||
| 20 | int (*nand_setup)(void); | 28 | int (*nand_setup)(void); |
| 21 | int (*dev_ready)(struct omap_nand_platform_data *); | 29 | int (*dev_ready)(struct omap_nand_platform_data *); |
| 22 | int dma_channel; | 30 | int dma_channel; |
| 31 | int gpmc_irq; | ||
| 32 | enum nand_io xfer_type; | ||
| 23 | unsigned long phys_base; | 33 | unsigned long phys_base; |
| 24 | int devsize; | 34 | int devsize; |
| 35 | enum omap_ecc ecc_opt; | ||
| 25 | }; | 36 | }; |
| 26 | 37 | ||
| 27 | /* minimum size for IO mapping */ | 38 | /* minimum size for IO mapping */ |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index fedd82971c9e..8a1368fbbbd3 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * omap_hwmod macros, structures | 2 | * omap_hwmod macros, structures |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 Nokia Corporation | 4 | * Copyright (C) 2009-2011 Nokia Corporation |
| 5 | * Paul Walmsley | 5 | * Paul Walmsley |
| 6 | * | 6 | * |
| 7 | * Created in collaboration with (alphabetical order): Benoît Cousson, | 7 | * Created in collaboration with (alphabetical order): Benoît Cousson, |
| @@ -30,6 +30,7 @@ | |||
| 30 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H | 30 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H |
| 31 | 31 | ||
| 32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
| 33 | #include <linux/init.h> | ||
| 33 | #include <linux/list.h> | 34 | #include <linux/list.h> |
| 34 | #include <linux/ioport.h> | 35 | #include <linux/ioport.h> |
| 35 | #include <linux/spinlock.h> | 36 | #include <linux/spinlock.h> |
| @@ -178,7 +179,8 @@ struct omap_hwmod_omap2_firewall { | |||
| 178 | #define ADDR_TYPE_RT (1 << 1) | 179 | #define ADDR_TYPE_RT (1 << 1) |
| 179 | 180 | ||
| 180 | /** | 181 | /** |
| 181 | * struct omap_hwmod_addr_space - MPU address space handled by the hwmod | 182 | * struct omap_hwmod_addr_space - address space handled by the hwmod |
| 183 | * @name: name of the address space | ||
| 182 | * @pa_start: starting physical address | 184 | * @pa_start: starting physical address |
| 183 | * @pa_end: ending physical address | 185 | * @pa_end: ending physical address |
| 184 | * @flags: (see omap_hwmod_addr_space.flags macros above) | 186 | * @flags: (see omap_hwmod_addr_space.flags macros above) |
| @@ -187,6 +189,7 @@ struct omap_hwmod_omap2_firewall { | |||
| 187 | * structure. GPMC is one example. | 189 | * structure. GPMC is one example. |
| 188 | */ | 190 | */ |
| 189 | struct omap_hwmod_addr_space { | 191 | struct omap_hwmod_addr_space { |
| 192 | const char *name; | ||
| 190 | u32 pa_start; | 193 | u32 pa_start; |
| 191 | u32 pa_end; | 194 | u32 pa_end; |
| 192 | u8 flags; | 195 | u8 flags; |
| @@ -370,8 +373,10 @@ struct omap_hwmod_omap4_prcm { | |||
| 370 | * of standby, rather than relying on module smart-standby | 373 | * of standby, rather than relying on module smart-standby |
| 371 | * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for | 374 | * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for |
| 372 | * SDRAM controller, etc. XXX probably belongs outside the main hwmod file | 375 | * SDRAM controller, etc. XXX probably belongs outside the main hwmod file |
| 376 | * XXX Should be HWMOD_SETUP_NO_RESET | ||
| 373 | * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM | 377 | * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM |
| 374 | * controller, etc. XXX probably belongs outside the main hwmod file | 378 | * controller, etc. XXX probably belongs outside the main hwmod file |
| 379 | * XXX Should be HWMOD_SETUP_NO_IDLE | ||
| 375 | * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE) | 380 | * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE) |
| 376 | * when module is enabled, rather than the default, which is to | 381 | * when module is enabled, rather than the default, which is to |
| 377 | * enable autoidle | 382 | * enable autoidle |
| @@ -535,11 +540,13 @@ struct omap_hwmod { | |||
| 535 | const struct omap_chip_id omap_chip; | 540 | const struct omap_chip_id omap_chip; |
| 536 | }; | 541 | }; |
| 537 | 542 | ||
| 538 | int omap_hwmod_init(struct omap_hwmod **ohs); | 543 | int omap_hwmod_register(struct omap_hwmod **ohs); |
| 539 | struct omap_hwmod *omap_hwmod_lookup(const char *name); | 544 | struct omap_hwmod *omap_hwmod_lookup(const char *name); |
| 540 | int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), | 545 | int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), |
| 541 | void *data); | 546 | void *data); |
| 542 | 547 | ||
| 548 | int __init omap_hwmod_setup_one(const char *name); | ||
| 549 | |||
| 543 | int omap_hwmod_enable(struct omap_hwmod *oh); | 550 | int omap_hwmod_enable(struct omap_hwmod *oh); |
| 544 | int _omap_hwmod_enable(struct omap_hwmod *oh); | 551 | int _omap_hwmod_enable(struct omap_hwmod *oh); |
| 545 | int omap_hwmod_idle(struct omap_hwmod *oh); | 552 | int omap_hwmod_idle(struct omap_hwmod *oh); |
| @@ -554,6 +561,7 @@ int omap_hwmod_enable_clocks(struct omap_hwmod *oh); | |||
| 554 | int omap_hwmod_disable_clocks(struct omap_hwmod *oh); | 561 | int omap_hwmod_disable_clocks(struct omap_hwmod *oh); |
| 555 | 562 | ||
| 556 | int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode); | 563 | int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode); |
| 564 | int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle); | ||
| 557 | 565 | ||
| 558 | int omap_hwmod_reset(struct omap_hwmod *oh); | 566 | int omap_hwmod_reset(struct omap_hwmod *oh); |
| 559 | void omap_hwmod_ocp_barrier(struct omap_hwmod *oh); | 567 | void omap_hwmod_ocp_barrier(struct omap_hwmod *oh); |
| @@ -588,6 +596,8 @@ int omap_hwmod_for_each_by_class(const char *classname, | |||
| 588 | int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state); | 596 | int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state); |
| 589 | u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh); | 597 | u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh); |
| 590 | 598 | ||
| 599 | int omap_hwmod_no_setup_reset(struct omap_hwmod *oh); | ||
| 600 | |||
| 591 | /* | 601 | /* |
| 592 | * Chip variant-specific hwmod init routines - XXX should be converted | 602 | * Chip variant-specific hwmod init routines - XXX should be converted |
| 593 | * to use initcalls once the initial boot ordering is straightened out | 603 | * to use initcalls once the initial boot ordering is straightened out |
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h index affe87e9ece7..cbe897ca7f9e 100644 --- a/arch/arm/plat-omap/include/plat/onenand.h +++ b/arch/arm/plat-omap/include/plat/onenand.h | |||
| @@ -15,12 +15,20 @@ | |||
| 15 | #define ONENAND_SYNC_READ (1 << 0) | 15 | #define ONENAND_SYNC_READ (1 << 0) |
| 16 | #define ONENAND_SYNC_READWRITE (1 << 1) | 16 | #define ONENAND_SYNC_READWRITE (1 << 1) |
| 17 | 17 | ||
| 18 | struct onenand_freq_info { | ||
| 19 | u16 maf_id; | ||
| 20 | u16 dev_id; | ||
| 21 | u16 ver_id; | ||
| 22 | }; | ||
| 23 | |||
| 18 | struct omap_onenand_platform_data { | 24 | struct omap_onenand_platform_data { |
| 19 | int cs; | 25 | int cs; |
| 20 | int gpio_irq; | 26 | int gpio_irq; |
| 21 | struct mtd_partition *parts; | 27 | struct mtd_partition *parts; |
| 22 | int nr_parts; | 28 | int nr_parts; |
| 23 | int (*onenand_setup)(void __iomem *, int freq); | 29 | int (*onenand_setup)(void __iomem *, int *freq_ptr); |
| 30 | int (*get_freq)(const struct onenand_freq_info *freq_info, | ||
| 31 | bool *clk_dep); | ||
| 24 | int dma_channel; | 32 | int dma_channel; |
| 25 | u8 flags; | 33 | u8 flags; |
| 26 | u8 regulator_can_sleep; | 34 | u8 regulator_can_sleep; |
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h index efd87c8dda69..925b12b500dc 100644 --- a/arch/arm/plat-omap/include/plat/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h | |||
| @@ -124,8 +124,14 @@ struct omap_sdrc_params { | |||
| 124 | u32 mr; | 124 | u32 mr; |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | 127 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
| 128 | void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | ||
| 128 | struct omap_sdrc_params *sdrc_cs1); | 129 | struct omap_sdrc_params *sdrc_cs1); |
| 130 | #else | ||
| 131 | static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | ||
| 132 | struct omap_sdrc_params *sdrc_cs1) {}; | ||
| 133 | #endif | ||
| 134 | |||
| 129 | int omap2_sdrc_get_params(unsigned long r, | 135 | int omap2_sdrc_get_params(unsigned long r, |
| 130 | struct omap_sdrc_params **sdrc_cs0, | 136 | struct omap_sdrc_params **sdrc_cs0, |
| 131 | struct omap_sdrc_params **sdrc_cs1); | 137 | struct omap_sdrc_params **sdrc_cs1); |
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index b1107c08da56..e3eb0380090a 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
| @@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj) | |||
| 104 | if (!obj) | 104 | if (!obj) |
| 105 | return -EINVAL; | 105 | return -EINVAL; |
| 106 | 106 | ||
| 107 | if (!arch_iommu) | ||
| 108 | return -ENODEV; | ||
| 109 | |||
| 107 | clk_enable(obj->clk); | 110 | clk_enable(obj->clk); |
| 108 | 111 | ||
| 109 | err = arch_iommu->enable(obj); | 112 | err = arch_iommu->enable(obj); |
| @@ -780,25 +783,19 @@ static void iopgtable_clear_entry_all(struct iommu *obj) | |||
| 780 | */ | 783 | */ |
| 781 | static irqreturn_t iommu_fault_handler(int irq, void *data) | 784 | static irqreturn_t iommu_fault_handler(int irq, void *data) |
| 782 | { | 785 | { |
| 783 | u32 stat, da; | 786 | u32 da, errs; |
| 784 | u32 *iopgd, *iopte; | 787 | u32 *iopgd, *iopte; |
| 785 | int err = -EIO; | ||
| 786 | struct iommu *obj = data; | 788 | struct iommu *obj = data; |
| 787 | 789 | ||
| 788 | if (!obj->refcount) | 790 | if (!obj->refcount) |
| 789 | return IRQ_NONE; | 791 | return IRQ_NONE; |
| 790 | 792 | ||
| 791 | /* Dynamic loading TLB or PTE */ | ||
| 792 | if (obj->isr) | ||
| 793 | err = obj->isr(obj); | ||
| 794 | |||
| 795 | if (!err) | ||
| 796 | return IRQ_HANDLED; | ||
| 797 | |||
| 798 | clk_enable(obj->clk); | 793 | clk_enable(obj->clk); |
| 799 | stat = iommu_report_fault(obj, &da); | 794 | errs = iommu_report_fault(obj, &da); |
| 800 | clk_disable(obj->clk); | 795 | clk_disable(obj->clk); |
| 801 | if (!stat) | 796 | |
| 797 | /* Fault callback or TLB/PTE Dynamic loading */ | ||
| 798 | if (obj->isr && !obj->isr(obj, da, errs, obj->isr_priv)) | ||
| 802 | return IRQ_HANDLED; | 799 | return IRQ_HANDLED; |
| 803 | 800 | ||
| 804 | iommu_disable(obj); | 801 | iommu_disable(obj); |
| @@ -806,15 +803,16 @@ static irqreturn_t iommu_fault_handler(int irq, void *data) | |||
| 806 | iopgd = iopgd_offset(obj, da); | 803 | iopgd = iopgd_offset(obj, da); |
| 807 | 804 | ||
| 808 | if (!iopgd_is_table(*iopgd)) { | 805 | if (!iopgd_is_table(*iopgd)) { |
| 809 | dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__, | 806 | dev_err(obj->dev, "%s: errs:0x%08x da:0x%08x pgd:0x%p " |
| 810 | da, iopgd, *iopgd); | 807 | "*pgd:px%08x\n", obj->name, errs, da, iopgd, *iopgd); |
| 811 | return IRQ_NONE; | 808 | return IRQ_NONE; |
| 812 | } | 809 | } |
| 813 | 810 | ||
| 814 | iopte = iopte_offset(iopgd, da); | 811 | iopte = iopte_offset(iopgd, da); |
| 815 | 812 | ||
| 816 | dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n", | 813 | dev_err(obj->dev, "%s: errs:0x%08x da:0x%08x pgd:0x%p *pgd:0x%08x " |
| 817 | __func__, da, iopgd, *iopgd, iopte, *iopte); | 814 | "pte:0x%p *pte:0x%08x\n", obj->name, errs, da, iopgd, *iopgd, |
| 815 | iopte, *iopte); | ||
| 818 | 816 | ||
| 819 | return IRQ_NONE; | 817 | return IRQ_NONE; |
| 820 | } | 818 | } |
| @@ -917,6 +915,33 @@ void iommu_put(struct iommu *obj) | |||
| 917 | } | 915 | } |
| 918 | EXPORT_SYMBOL_GPL(iommu_put); | 916 | EXPORT_SYMBOL_GPL(iommu_put); |
| 919 | 917 | ||
| 918 | int iommu_set_isr(const char *name, | ||
| 919 | int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs, | ||
| 920 | void *priv), | ||
| 921 | void *isr_priv) | ||
| 922 | { | ||
| 923 | struct device *dev; | ||
| 924 | struct iommu *obj; | ||
| 925 | |||
| 926 | dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name, | ||
| 927 | device_match_by_alias); | ||
| 928 | if (!dev) | ||
| 929 | return -ENODEV; | ||
| 930 | |||
| 931 | obj = to_iommu(dev); | ||
| 932 | mutex_lock(&obj->iommu_lock); | ||
| 933 | if (obj->refcount != 0) { | ||
| 934 | mutex_unlock(&obj->iommu_lock); | ||
| 935 | return -EBUSY; | ||
| 936 | } | ||
| 937 | obj->isr = isr; | ||
| 938 | obj->isr_priv = isr_priv; | ||
| 939 | mutex_unlock(&obj->iommu_lock); | ||
| 940 | |||
| 941 | return 0; | ||
| 942 | } | ||
| 943 | EXPORT_SYMBOL_GPL(iommu_set_isr); | ||
| 944 | |||
| 920 | /* | 945 | /* |
| 921 | * OMAP Device MMU(IOMMU) detection | 946 | * OMAP Device MMU(IOMMU) detection |
| 922 | */ | 947 | */ |
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 459b319a9fad..49d3208793e5 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c | |||
| @@ -322,15 +322,18 @@ static void omap_mbox_fini(struct omap_mbox *mbox) | |||
| 322 | 322 | ||
| 323 | struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb) | 323 | struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb) |
| 324 | { | 324 | { |
| 325 | struct omap_mbox *mbox; | 325 | struct omap_mbox *_mbox, *mbox = NULL; |
| 326 | int ret; | 326 | int i, ret; |
| 327 | 327 | ||
| 328 | if (!mboxes) | 328 | if (!mboxes) |
| 329 | return ERR_PTR(-EINVAL); | 329 | return ERR_PTR(-EINVAL); |
| 330 | 330 | ||
| 331 | for (mbox = *mboxes; mbox; mbox++) | 331 | for (i = 0; (_mbox = mboxes[i]); i++) { |
| 332 | if (!strcmp(mbox->name, name)) | 332 | if (!strcmp(_mbox->name, name)) { |
| 333 | mbox = _mbox; | ||
| 333 | break; | 334 | break; |
| 335 | } | ||
| 336 | } | ||
| 334 | 337 | ||
| 335 | if (!mbox) | 338 | if (!mbox) |
| 336 | return ERR_PTR(-ENOENT); | 339 | return ERR_PTR(-ENOENT); |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index b5a6e178a7f9..d598d9fd65ac 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
| @@ -27,6 +27,8 @@ | |||
| 27 | 27 | ||
| 28 | #include <plat/dma.h> | 28 | #include <plat/dma.h> |
| 29 | #include <plat/mcbsp.h> | 29 | #include <plat/mcbsp.h> |
| 30 | #include <plat/omap_device.h> | ||
| 31 | #include <linux/pm_runtime.h> | ||
| 30 | 32 | ||
| 31 | /* XXX These "sideways" includes are a sign that something is wrong */ | 33 | /* XXX These "sideways" includes are a sign that something is wrong */ |
| 32 | #include "../mach-omap2/cm2xxx_3xxx.h" | 34 | #include "../mach-omap2/cm2xxx_3xxx.h" |
| @@ -227,10 +229,83 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config) | |||
| 227 | } | 229 | } |
| 228 | EXPORT_SYMBOL(omap_mcbsp_config); | 230 | EXPORT_SYMBOL(omap_mcbsp_config); |
| 229 | 231 | ||
| 232 | /** | ||
| 233 | * omap_mcbsp_dma_params - returns the dma channel number | ||
| 234 | * @id - mcbsp id | ||
| 235 | * @stream - indicates the direction of data flow (rx or tx) | ||
| 236 | * | ||
| 237 | * Returns the dma channel number for the rx channel or tx channel | ||
| 238 | * based on the value of @stream for the requested mcbsp given by @id | ||
| 239 | */ | ||
| 240 | int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream) | ||
| 241 | { | ||
| 242 | struct omap_mcbsp *mcbsp; | ||
| 243 | |||
| 244 | if (!omap_mcbsp_check_valid_id(id)) { | ||
| 245 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
| 246 | return -ENODEV; | ||
| 247 | } | ||
| 248 | mcbsp = id_to_mcbsp_ptr(id); | ||
| 249 | |||
| 250 | if (stream) | ||
| 251 | return mcbsp->dma_rx_sync; | ||
| 252 | else | ||
| 253 | return mcbsp->dma_tx_sync; | ||
| 254 | } | ||
| 255 | EXPORT_SYMBOL(omap_mcbsp_dma_ch_params); | ||
| 256 | |||
| 257 | /** | ||
| 258 | * omap_mcbsp_dma_reg_params - returns the address of mcbsp data register | ||
| 259 | * @id - mcbsp id | ||
| 260 | * @stream - indicates the direction of data flow (rx or tx) | ||
| 261 | * | ||
| 262 | * Returns the address of mcbsp data transmit register or data receive register | ||
| 263 | * to be used by DMA for transferring/receiving data based on the value of | ||
| 264 | * @stream for the requested mcbsp given by @id | ||
| 265 | */ | ||
| 266 | int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream) | ||
| 267 | { | ||
| 268 | struct omap_mcbsp *mcbsp; | ||
| 269 | int data_reg; | ||
| 270 | |||
| 271 | if (!omap_mcbsp_check_valid_id(id)) { | ||
| 272 | printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); | ||
| 273 | return -ENODEV; | ||
| 274 | } | ||
| 275 | mcbsp = id_to_mcbsp_ptr(id); | ||
| 276 | |||
| 277 | data_reg = mcbsp->phys_dma_base; | ||
| 278 | |||
| 279 | if (mcbsp->mcbsp_config_type < MCBSP_CONFIG_TYPE2) { | ||
| 280 | if (stream) | ||
| 281 | data_reg += OMAP_MCBSP_REG_DRR1; | ||
| 282 | else | ||
| 283 | data_reg += OMAP_MCBSP_REG_DXR1; | ||
| 284 | } else { | ||
| 285 | if (stream) | ||
| 286 | data_reg += OMAP_MCBSP_REG_DRR; | ||
| 287 | else | ||
| 288 | data_reg += OMAP_MCBSP_REG_DXR; | ||
| 289 | } | ||
| 290 | |||
| 291 | return data_reg; | ||
| 292 | } | ||
| 293 | EXPORT_SYMBOL(omap_mcbsp_dma_reg_params); | ||
| 294 | |||
| 230 | #ifdef CONFIG_ARCH_OMAP3 | 295 | #ifdef CONFIG_ARCH_OMAP3 |
| 296 | static struct omap_device *find_omap_device_by_dev(struct device *dev) | ||
| 297 | { | ||
| 298 | struct platform_device *pdev = container_of(dev, | ||
| 299 | struct platform_device, dev); | ||
| 300 | return container_of(pdev, struct omap_device, pdev); | ||
| 301 | } | ||
| 302 | |||
| 231 | static void omap_st_on(struct omap_mcbsp *mcbsp) | 303 | static void omap_st_on(struct omap_mcbsp *mcbsp) |
| 232 | { | 304 | { |
| 233 | unsigned int w; | 305 | unsigned int w; |
| 306 | struct omap_device *od; | ||
| 307 | |||
| 308 | od = find_omap_device_by_dev(mcbsp->dev); | ||
| 234 | 309 | ||
| 235 | /* | 310 | /* |
| 236 | * Sidetone uses McBSP ICLK - which must not idle when sidetones | 311 | * Sidetone uses McBSP ICLK - which must not idle when sidetones |
| @@ -244,9 +319,6 @@ static void omap_st_on(struct omap_mcbsp *mcbsp) | |||
| 244 | w = MCBSP_READ(mcbsp, SSELCR); | 319 | w = MCBSP_READ(mcbsp, SSELCR); |
| 245 | MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN); | 320 | MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN); |
| 246 | 321 | ||
| 247 | w = MCBSP_ST_READ(mcbsp, SYSCONFIG); | ||
| 248 | MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w & ~(ST_AUTOIDLE)); | ||
| 249 | |||
| 250 | /* Enable Sidetone from Sidetone Core */ | 322 | /* Enable Sidetone from Sidetone Core */ |
| 251 | w = MCBSP_ST_READ(mcbsp, SSELCR); | 323 | w = MCBSP_ST_READ(mcbsp, SSELCR); |
| 252 | MCBSP_ST_WRITE(mcbsp, SSELCR, w | ST_SIDETONEEN); | 324 | MCBSP_ST_WRITE(mcbsp, SSELCR, w | ST_SIDETONEEN); |
| @@ -255,13 +327,13 @@ static void omap_st_on(struct omap_mcbsp *mcbsp) | |||
| 255 | static void omap_st_off(struct omap_mcbsp *mcbsp) | 327 | static void omap_st_off(struct omap_mcbsp *mcbsp) |
| 256 | { | 328 | { |
| 257 | unsigned int w; | 329 | unsigned int w; |
| 330 | struct omap_device *od; | ||
| 331 | |||
| 332 | od = find_omap_device_by_dev(mcbsp->dev); | ||
| 258 | 333 | ||
| 259 | w = MCBSP_ST_READ(mcbsp, SSELCR); | 334 | w = MCBSP_ST_READ(mcbsp, SSELCR); |
| 260 | MCBSP_ST_WRITE(mcbsp, SSELCR, w & ~(ST_SIDETONEEN)); | 335 | MCBSP_ST_WRITE(mcbsp, SSELCR, w & ~(ST_SIDETONEEN)); |
| 261 | 336 | ||
| 262 | w = MCBSP_ST_READ(mcbsp, SYSCONFIG); | ||
| 263 | MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w | ST_AUTOIDLE); | ||
| 264 | |||
| 265 | w = MCBSP_READ(mcbsp, SSELCR); | 337 | w = MCBSP_READ(mcbsp, SSELCR); |
| 266 | MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN)); | 338 | MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN)); |
| 267 | 339 | ||
| @@ -273,9 +345,9 @@ static void omap_st_off(struct omap_mcbsp *mcbsp) | |||
| 273 | static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir) | 345 | static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir) |
| 274 | { | 346 | { |
| 275 | u16 val, i; | 347 | u16 val, i; |
| 348 | struct omap_device *od; | ||
| 276 | 349 | ||
| 277 | val = MCBSP_ST_READ(mcbsp, SYSCONFIG); | 350 | od = find_omap_device_by_dev(mcbsp->dev); |
| 278 | MCBSP_ST_WRITE(mcbsp, SYSCONFIG, val & ~(ST_AUTOIDLE)); | ||
| 279 | 351 | ||
| 280 | val = MCBSP_ST_READ(mcbsp, SSELCR); | 352 | val = MCBSP_ST_READ(mcbsp, SSELCR); |
| 281 | 353 | ||
| @@ -303,9 +375,9 @@ static void omap_st_chgain(struct omap_mcbsp *mcbsp) | |||
| 303 | { | 375 | { |
| 304 | u16 w; | 376 | u16 w; |
| 305 | struct omap_mcbsp_st_data *st_data = mcbsp->st_data; | 377 | struct omap_mcbsp_st_data *st_data = mcbsp->st_data; |
| 378 | struct omap_device *od; | ||
| 306 | 379 | ||
| 307 | w = MCBSP_ST_READ(mcbsp, SYSCONFIG); | 380 | od = find_omap_device_by_dev(mcbsp->dev); |
| 308 | MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w & ~(ST_AUTOIDLE)); | ||
| 309 | 381 | ||
| 310 | w = MCBSP_ST_READ(mcbsp, SSELCR); | 382 | w = MCBSP_ST_READ(mcbsp, SSELCR); |
| 311 | 383 | ||
| @@ -648,48 +720,33 @@ EXPORT_SYMBOL(omap_mcbsp_get_dma_op_mode); | |||
| 648 | 720 | ||
| 649 | static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) | 721 | static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) |
| 650 | { | 722 | { |
| 723 | struct omap_device *od; | ||
| 724 | |||
| 725 | od = find_omap_device_by_dev(mcbsp->dev); | ||
| 651 | /* | 726 | /* |
| 652 | * Enable wakup behavior, smart idle and all wakeups | 727 | * Enable wakup behavior, smart idle and all wakeups |
| 653 | * REVISIT: some wakeups may be unnecessary | 728 | * REVISIT: some wakeups may be unnecessary |
| 654 | */ | 729 | */ |
| 655 | if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | 730 | if (cpu_is_omap34xx() || cpu_is_omap44xx()) { |
| 656 | u16 syscon; | 731 | MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN); |
| 657 | |||
| 658 | syscon = MCBSP_READ(mcbsp, SYSCON); | ||
| 659 | syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03)); | ||
| 660 | |||
| 661 | if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) { | ||
| 662 | syscon |= (ENAWAKEUP | SIDLEMODE(0x02) | | ||
| 663 | CLOCKACTIVITY(0x02)); | ||
| 664 | MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN); | ||
| 665 | } else { | ||
| 666 | syscon |= SIDLEMODE(0x01); | ||
| 667 | } | ||
| 668 | |||
| 669 | MCBSP_WRITE(mcbsp, SYSCON, syscon); | ||
| 670 | } | 732 | } |
| 671 | } | 733 | } |
| 672 | 734 | ||
| 673 | static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) | 735 | static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) |
| 674 | { | 736 | { |
| 737 | struct omap_device *od; | ||
| 738 | |||
| 739 | od = find_omap_device_by_dev(mcbsp->dev); | ||
| 740 | |||
| 675 | /* | 741 | /* |
| 676 | * Disable wakup behavior, smart idle and all wakeups | 742 | * Disable wakup behavior, smart idle and all wakeups |
| 677 | */ | 743 | */ |
| 678 | if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | 744 | if (cpu_is_omap34xx() || cpu_is_omap44xx()) { |
| 679 | u16 syscon; | ||
| 680 | |||
| 681 | syscon = MCBSP_READ(mcbsp, SYSCON); | ||
| 682 | syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03)); | ||
| 683 | /* | 745 | /* |
| 684 | * HW bug workaround - If no_idle mode is taken, we need to | 746 | * HW bug workaround - If no_idle mode is taken, we need to |
| 685 | * go to smart_idle before going to always_idle, or the | 747 | * go to smart_idle before going to always_idle, or the |
| 686 | * device will not hit retention anymore. | 748 | * device will not hit retention anymore. |
| 687 | */ | 749 | */ |
| 688 | syscon |= SIDLEMODE(0x02); | ||
| 689 | MCBSP_WRITE(mcbsp, SYSCON, syscon); | ||
| 690 | |||
| 691 | syscon &= ~(SIDLEMODE(0x03)); | ||
| 692 | MCBSP_WRITE(mcbsp, SYSCON, syscon); | ||
| 693 | 750 | ||
| 694 | MCBSP_WRITE(mcbsp, WAKEUPEN, 0); | 751 | MCBSP_WRITE(mcbsp, WAKEUPEN, 0); |
| 695 | } | 752 | } |
| @@ -764,8 +821,7 @@ int omap_mcbsp_request(unsigned int id) | |||
| 764 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request) | 821 | if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request) |
| 765 | mcbsp->pdata->ops->request(id); | 822 | mcbsp->pdata->ops->request(id); |
| 766 | 823 | ||
| 767 | clk_enable(mcbsp->iclk); | 824 | pm_runtime_get_sync(mcbsp->dev); |
| 768 | clk_enable(mcbsp->fclk); | ||
| 769 | 825 | ||
| 770 | /* Do procedure specific to omap34xx arch, if applicable */ | 826 | /* Do procedure specific to omap34xx arch, if applicable */ |
| 771 | omap34xx_mcbsp_request(mcbsp); | 827 | omap34xx_mcbsp_request(mcbsp); |
| @@ -813,8 +869,7 @@ err_clk_disable: | |||
| 813 | /* Do procedure specific to omap34xx arch, if applicable */ | 869 | /* Do procedure specific to omap34xx arch, if applicable */ |
| 814 | omap34xx_mcbsp_free(mcbsp); | 870 | omap34xx_mcbsp_free(mcbsp); |
| 815 | 871 | ||
| 816 | clk_disable(mcbsp->fclk); | 872 | pm_runtime_put_sync(mcbsp->dev); |
| 817 | clk_disable(mcbsp->iclk); | ||
| 818 | 873 | ||
| 819 | spin_lock(&mcbsp->lock); | 874 | spin_lock(&mcbsp->lock); |
| 820 | mcbsp->free = true; | 875 | mcbsp->free = true; |
| @@ -844,8 +899,7 @@ void omap_mcbsp_free(unsigned int id) | |||
| 844 | /* Do procedure specific to omap34xx arch, if applicable */ | 899 | /* Do procedure specific to omap34xx arch, if applicable */ |
| 845 | omap34xx_mcbsp_free(mcbsp); | 900 | omap34xx_mcbsp_free(mcbsp); |
| 846 | 901 | ||
| 847 | clk_disable(mcbsp->fclk); | 902 | pm_runtime_put_sync(mcbsp->dev); |
| 848 | clk_disable(mcbsp->iclk); | ||
| 849 | 903 | ||
| 850 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { | 904 | if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { |
| 851 | /* Free IRQs */ | 905 | /* Free IRQs */ |
| @@ -1649,7 +1703,8 @@ static const struct attribute_group sidetone_attr_group = { | |||
| 1649 | 1703 | ||
| 1650 | static int __devinit omap_st_add(struct omap_mcbsp *mcbsp) | 1704 | static int __devinit omap_st_add(struct omap_mcbsp *mcbsp) |
| 1651 | { | 1705 | { |
| 1652 | struct omap_mcbsp_platform_data *pdata = mcbsp->pdata; | 1706 | struct platform_device *pdev; |
| 1707 | struct resource *res; | ||
| 1653 | struct omap_mcbsp_st_data *st_data; | 1708 | struct omap_mcbsp_st_data *st_data; |
| 1654 | int err; | 1709 | int err; |
| 1655 | 1710 | ||
| @@ -1659,7 +1714,10 @@ static int __devinit omap_st_add(struct omap_mcbsp *mcbsp) | |||
| 1659 | goto err1; | 1714 | goto err1; |
| 1660 | } | 1715 | } |
| 1661 | 1716 | ||
| 1662 | st_data->io_base_st = ioremap(pdata->phys_base_st, SZ_4K); | 1717 | pdev = container_of(mcbsp->dev, struct platform_device, dev); |
| 1718 | |||
| 1719 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sidetone"); | ||
| 1720 | st_data->io_base_st = ioremap(res->start, resource_size(res)); | ||
| 1663 | if (!st_data->io_base_st) { | 1721 | if (!st_data->io_base_st) { |
| 1664 | err = -ENOMEM; | 1722 | err = -ENOMEM; |
| 1665 | goto err2; | 1723 | goto err2; |
| @@ -1748,6 +1806,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev) | |||
| 1748 | struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; | 1806 | struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; |
| 1749 | struct omap_mcbsp *mcbsp; | 1807 | struct omap_mcbsp *mcbsp; |
| 1750 | int id = pdev->id - 1; | 1808 | int id = pdev->id - 1; |
| 1809 | struct resource *res; | ||
| 1751 | int ret = 0; | 1810 | int ret = 0; |
| 1752 | 1811 | ||
| 1753 | if (!pdata) { | 1812 | if (!pdata) { |
| @@ -1777,47 +1836,78 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev) | |||
| 1777 | mcbsp->dma_tx_lch = -1; | 1836 | mcbsp->dma_tx_lch = -1; |
| 1778 | mcbsp->dma_rx_lch = -1; | 1837 | mcbsp->dma_rx_lch = -1; |
| 1779 | 1838 | ||
| 1780 | mcbsp->phys_base = pdata->phys_base; | 1839 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); |
| 1781 | mcbsp->io_base = ioremap(pdata->phys_base, SZ_4K); | 1840 | if (!res) { |
| 1841 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 1842 | if (!res) { | ||
| 1843 | dev_err(&pdev->dev, "%s:mcbsp%d has invalid memory" | ||
| 1844 | "resource\n", __func__, pdev->id); | ||
| 1845 | ret = -ENOMEM; | ||
| 1846 | goto exit; | ||
| 1847 | } | ||
| 1848 | } | ||
| 1849 | mcbsp->phys_base = res->start; | ||
| 1850 | omap_mcbsp_cache_size = resource_size(res); | ||
| 1851 | mcbsp->io_base = ioremap(res->start, resource_size(res)); | ||
| 1782 | if (!mcbsp->io_base) { | 1852 | if (!mcbsp->io_base) { |
| 1783 | ret = -ENOMEM; | 1853 | ret = -ENOMEM; |
| 1784 | goto err_ioremap; | 1854 | goto err_ioremap; |
| 1785 | } | 1855 | } |
| 1786 | 1856 | ||
| 1857 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); | ||
| 1858 | if (!res) | ||
| 1859 | mcbsp->phys_dma_base = mcbsp->phys_base; | ||
| 1860 | else | ||
| 1861 | mcbsp->phys_dma_base = res->start; | ||
| 1862 | |||
| 1787 | /* Default I/O is IRQ based */ | 1863 | /* Default I/O is IRQ based */ |
| 1788 | mcbsp->io_type = OMAP_MCBSP_IRQ_IO; | 1864 | mcbsp->io_type = OMAP_MCBSP_IRQ_IO; |
| 1789 | mcbsp->tx_irq = pdata->tx_irq; | ||
| 1790 | mcbsp->rx_irq = pdata->rx_irq; | ||
| 1791 | mcbsp->dma_rx_sync = pdata->dma_rx_sync; | ||
| 1792 | mcbsp->dma_tx_sync = pdata->dma_tx_sync; | ||
| 1793 | 1865 | ||
| 1794 | mcbsp->iclk = clk_get(&pdev->dev, "ick"); | 1866 | mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx"); |
| 1795 | if (IS_ERR(mcbsp->iclk)) { | 1867 | mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx"); |
| 1796 | ret = PTR_ERR(mcbsp->iclk); | 1868 | |
| 1797 | dev_err(&pdev->dev, "unable to get ick: %d\n", ret); | 1869 | /* From OMAP4 there will be a single irq line */ |
| 1798 | goto err_iclk; | 1870 | if (mcbsp->tx_irq == -ENXIO) |
| 1871 | mcbsp->tx_irq = platform_get_irq(pdev, 0); | ||
| 1872 | |||
| 1873 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); | ||
| 1874 | if (!res) { | ||
| 1875 | dev_err(&pdev->dev, "%s:mcbsp%d has invalid rx DMA channel\n", | ||
| 1876 | __func__, pdev->id); | ||
| 1877 | ret = -ENODEV; | ||
| 1878 | goto err_res; | ||
| 1879 | } | ||
| 1880 | mcbsp->dma_rx_sync = res->start; | ||
| 1881 | |||
| 1882 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); | ||
| 1883 | if (!res) { | ||
| 1884 | dev_err(&pdev->dev, "%s:mcbsp%d has invalid tx DMA channel\n", | ||
| 1885 | __func__, pdev->id); | ||
| 1886 | ret = -ENODEV; | ||
| 1887 | goto err_res; | ||
| 1799 | } | 1888 | } |
| 1889 | mcbsp->dma_tx_sync = res->start; | ||
| 1800 | 1890 | ||
| 1801 | mcbsp->fclk = clk_get(&pdev->dev, "fck"); | 1891 | mcbsp->fclk = clk_get(&pdev->dev, "fck"); |
| 1802 | if (IS_ERR(mcbsp->fclk)) { | 1892 | if (IS_ERR(mcbsp->fclk)) { |
| 1803 | ret = PTR_ERR(mcbsp->fclk); | 1893 | ret = PTR_ERR(mcbsp->fclk); |
| 1804 | dev_err(&pdev->dev, "unable to get fck: %d\n", ret); | 1894 | dev_err(&pdev->dev, "unable to get fck: %d\n", ret); |
| 1805 | goto err_fclk; | 1895 | goto err_res; |
| 1806 | } | 1896 | } |
| 1807 | 1897 | ||
| 1808 | mcbsp->pdata = pdata; | 1898 | mcbsp->pdata = pdata; |
| 1809 | mcbsp->dev = &pdev->dev; | 1899 | mcbsp->dev = &pdev->dev; |
| 1810 | mcbsp_ptr[id] = mcbsp; | 1900 | mcbsp_ptr[id] = mcbsp; |
| 1901 | mcbsp->mcbsp_config_type = pdata->mcbsp_config_type; | ||
| 1811 | platform_set_drvdata(pdev, mcbsp); | 1902 | platform_set_drvdata(pdev, mcbsp); |
| 1903 | pm_runtime_enable(mcbsp->dev); | ||
| 1812 | 1904 | ||
| 1813 | /* Initialize mcbsp properties for OMAP34XX if needed / applicable */ | 1905 | /* Initialize mcbsp properties for OMAP34XX if needed / applicable */ |
| 1814 | omap34xx_device_init(mcbsp); | 1906 | omap34xx_device_init(mcbsp); |
| 1815 | 1907 | ||
| 1816 | return 0; | 1908 | return 0; |
| 1817 | 1909 | ||
| 1818 | err_fclk: | 1910 | err_res: |
| 1819 | clk_put(mcbsp->iclk); | ||
| 1820 | err_iclk: | ||
| 1821 | iounmap(mcbsp->io_base); | 1911 | iounmap(mcbsp->io_base); |
| 1822 | err_ioremap: | 1912 | err_ioremap: |
| 1823 | kfree(mcbsp); | 1913 | kfree(mcbsp); |
| @@ -1839,7 +1929,6 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev) | |||
| 1839 | omap34xx_device_exit(mcbsp); | 1929 | omap34xx_device_exit(mcbsp); |
| 1840 | 1930 | ||
| 1841 | clk_put(mcbsp->fclk); | 1931 | clk_put(mcbsp->fclk); |
| 1842 | clk_put(mcbsp->iclk); | ||
| 1843 | 1932 | ||
| 1844 | iounmap(mcbsp->io_base); | 1933 | iounmap(mcbsp->io_base); |
| 1845 | kfree(mcbsp); | 1934 | kfree(mcbsp); |
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 57adb270767b..9bbda9acb73b 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
| @@ -83,9 +83,11 @@ | |||
| 83 | #include <linux/err.h> | 83 | #include <linux/err.h> |
| 84 | #include <linux/io.h> | 84 | #include <linux/io.h> |
| 85 | #include <linux/clk.h> | 85 | #include <linux/clk.h> |
| 86 | #include <linux/clkdev.h> | ||
| 86 | 87 | ||
| 87 | #include <plat/omap_device.h> | 88 | #include <plat/omap_device.h> |
| 88 | #include <plat/omap_hwmod.h> | 89 | #include <plat/omap_hwmod.h> |
| 90 | #include <plat/clock.h> | ||
| 89 | 91 | ||
| 90 | /* These parameters are passed to _omap_device_{de,}activate() */ | 92 | /* These parameters are passed to _omap_device_{de,}activate() */ |
| 91 | #define USE_WAKEUP_LAT 0 | 93 | #define USE_WAKEUP_LAT 0 |
| @@ -239,12 +241,12 @@ static inline struct omap_device *_find_by_pdev(struct platform_device *pdev) | |||
| 239 | } | 241 | } |
| 240 | 242 | ||
| 241 | /** | 243 | /** |
| 242 | * _add_optional_clock_alias - Add clock alias for hwmod optional clocks | 244 | * _add_optional_clock_clkdev - Add clkdev entry for hwmod optional clocks |
| 243 | * @od: struct omap_device *od | 245 | * @od: struct omap_device *od |
| 244 | * | 246 | * |
| 245 | * For every optional clock present per hwmod per omap_device, this function | 247 | * For every optional clock present per hwmod per omap_device, this function |
| 246 | * adds an entry in the clocks list of the form <dev-id=dev_name, con-id=role> | 248 | * adds an entry in the clkdev table of the form <dev-id=dev_name, con-id=role> |
| 247 | * if an entry is already present in it with the form <dev-id=NULL, con-id=role> | 249 | * if it does not exist already. |
| 248 | * | 250 | * |
| 249 | * The function is called from inside omap_device_build_ss(), after | 251 | * The function is called from inside omap_device_build_ss(), after |
| 250 | * omap_device_register. | 252 | * omap_device_register. |
| @@ -254,25 +256,39 @@ static inline struct omap_device *_find_by_pdev(struct platform_device *pdev) | |||
| 254 | * | 256 | * |
| 255 | * No return value. | 257 | * No return value. |
| 256 | */ | 258 | */ |
| 257 | static void _add_optional_clock_alias(struct omap_device *od, | 259 | static void _add_optional_clock_clkdev(struct omap_device *od, |
| 258 | struct omap_hwmod *oh) | 260 | struct omap_hwmod *oh) |
| 259 | { | 261 | { |
| 260 | int i; | 262 | int i; |
| 261 | 263 | ||
| 262 | for (i = 0; i < oh->opt_clks_cnt; i++) { | 264 | for (i = 0; i < oh->opt_clks_cnt; i++) { |
| 263 | struct omap_hwmod_opt_clk *oc; | 265 | struct omap_hwmod_opt_clk *oc; |
| 264 | int r; | 266 | struct clk *r; |
| 267 | struct clk_lookup *l; | ||
| 265 | 268 | ||
| 266 | oc = &oh->opt_clks[i]; | 269 | oc = &oh->opt_clks[i]; |
| 267 | 270 | ||
| 268 | if (!oc->_clk) | 271 | if (!oc->_clk) |
| 269 | continue; | 272 | continue; |
| 270 | 273 | ||
| 271 | r = clk_add_alias(oc->role, dev_name(&od->pdev.dev), | 274 | r = clk_get_sys(dev_name(&od->pdev.dev), oc->role); |
| 272 | (char *)oc->clk, &od->pdev.dev); | 275 | if (!IS_ERR(r)) |
| 273 | if (r) | 276 | continue; /* clkdev entry exists */ |
| 274 | pr_err("omap_device: %s: clk_add_alias for %s failed\n", | 277 | |
| 278 | r = omap_clk_get_by_name((char *)oc->clk); | ||
| 279 | if (IS_ERR(r)) { | ||
| 280 | pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n", | ||
| 281 | dev_name(&od->pdev.dev), oc->clk); | ||
| 282 | continue; | ||
| 283 | } | ||
| 284 | |||
| 285 | l = clkdev_alloc(r, oc->role, dev_name(&od->pdev.dev)); | ||
| 286 | if (!l) { | ||
| 287 | pr_err("omap_device: %s: clkdev_alloc for %s failed\n", | ||
| 275 | dev_name(&od->pdev.dev), oc->role); | 288 | dev_name(&od->pdev.dev), oc->role); |
| 289 | return; | ||
| 290 | } | ||
| 291 | clkdev_add(l); | ||
| 276 | } | 292 | } |
| 277 | } | 293 | } |
| 278 | 294 | ||
| @@ -480,7 +496,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id, | |||
| 480 | 496 | ||
| 481 | for (i = 0; i < oh_cnt; i++) { | 497 | for (i = 0; i < oh_cnt; i++) { |
| 482 | hwmods[i]->od = od; | 498 | hwmods[i]->od = od; |
| 483 | _add_optional_clock_alias(od, hwmods[i]); | 499 | _add_optional_clock_clkdev(od, hwmods[i]); |
| 484 | } | 500 | } |
| 485 | 501 | ||
| 486 | if (ret) | 502 | if (ret) |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index aedcb3be4e66..9d80064e979b 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
| @@ -405,20 +405,6 @@ static inline int omap34xx_sram_init(void) | |||
| 405 | } | 405 | } |
| 406 | #endif | 406 | #endif |
| 407 | 407 | ||
| 408 | #ifdef CONFIG_ARCH_OMAP4 | ||
| 409 | static int __init omap44xx_sram_init(void) | ||
| 410 | { | ||
| 411 | printk(KERN_ERR "FIXME: %s not implemented\n", __func__); | ||
| 412 | |||
| 413 | return -ENODEV; | ||
| 414 | } | ||
| 415 | #else | ||
| 416 | static inline int omap44xx_sram_init(void) | ||
| 417 | { | ||
| 418 | return 0; | ||
| 419 | } | ||
| 420 | #endif | ||
| 421 | |||
| 422 | int __init omap_sram_init(void) | 408 | int __init omap_sram_init(void) |
| 423 | { | 409 | { |
| 424 | omap_detect_sram(); | 410 | omap_detect_sram(); |
| @@ -432,8 +418,6 @@ int __init omap_sram_init(void) | |||
| 432 | omap243x_sram_init(); | 418 | omap243x_sram_init(); |
| 433 | else if (cpu_is_omap34xx()) | 419 | else if (cpu_is_omap34xx()) |
| 434 | omap34xx_sram_init(); | 420 | omap34xx_sram_init(); |
| 435 | else if (cpu_is_omap44xx()) | ||
| 436 | omap44xx_sram_init(); | ||
| 437 | 421 | ||
| 438 | return 0; | 422 | return 0; |
| 439 | } | 423 | } |
diff --git a/arch/arm/plat-s5p/dev-uart.c b/arch/arm/plat-s5p/dev-uart.c index 6a7342886171..afaf87fdb93e 100644 --- a/arch/arm/plat-s5p/dev-uart.c +++ b/arch/arm/plat-s5p/dev-uart.c | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | static struct resource s5p_uart0_resource[] = { | 28 | static struct resource s5p_uart0_resource[] = { |
| 29 | [0] = { | 29 | [0] = { |
| 30 | .start = S5P_PA_UART0, | 30 | .start = S5P_PA_UART0, |
| 31 | .end = S5P_PA_UART0 + S5P_SZ_UART, | 31 | .end = S5P_PA_UART0 + S5P_SZ_UART - 1, |
| 32 | .flags = IORESOURCE_MEM, | 32 | .flags = IORESOURCE_MEM, |
| 33 | }, | 33 | }, |
| 34 | [1] = { | 34 | [1] = { |
| @@ -51,7 +51,7 @@ static struct resource s5p_uart0_resource[] = { | |||
| 51 | static struct resource s5p_uart1_resource[] = { | 51 | static struct resource s5p_uart1_resource[] = { |
| 52 | [0] = { | 52 | [0] = { |
| 53 | .start = S5P_PA_UART1, | 53 | .start = S5P_PA_UART1, |
| 54 | .end = S5P_PA_UART1 + S5P_SZ_UART, | 54 | .end = S5P_PA_UART1 + S5P_SZ_UART - 1, |
| 55 | .flags = IORESOURCE_MEM, | 55 | .flags = IORESOURCE_MEM, |
| 56 | }, | 56 | }, |
| 57 | [1] = { | 57 | [1] = { |
| @@ -74,7 +74,7 @@ static struct resource s5p_uart1_resource[] = { | |||
| 74 | static struct resource s5p_uart2_resource[] = { | 74 | static struct resource s5p_uart2_resource[] = { |
| 75 | [0] = { | 75 | [0] = { |
| 76 | .start = S5P_PA_UART2, | 76 | .start = S5P_PA_UART2, |
| 77 | .end = S5P_PA_UART2 + S5P_SZ_UART, | 77 | .end = S5P_PA_UART2 + S5P_SZ_UART - 1, |
| 78 | .flags = IORESOURCE_MEM, | 78 | .flags = IORESOURCE_MEM, |
| 79 | }, | 79 | }, |
| 80 | [1] = { | 80 | [1] = { |
| @@ -98,7 +98,7 @@ static struct resource s5p_uart3_resource[] = { | |||
| 98 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 3 | 98 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 3 |
| 99 | [0] = { | 99 | [0] = { |
| 100 | .start = S5P_PA_UART3, | 100 | .start = S5P_PA_UART3, |
| 101 | .end = S5P_PA_UART3 + S5P_SZ_UART, | 101 | .end = S5P_PA_UART3 + S5P_SZ_UART - 1, |
| 102 | .flags = IORESOURCE_MEM, | 102 | .flags = IORESOURCE_MEM, |
| 103 | }, | 103 | }, |
| 104 | [1] = { | 104 | [1] = { |
| @@ -123,7 +123,7 @@ static struct resource s5p_uart4_resource[] = { | |||
| 123 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 4 | 123 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 4 |
| 124 | [0] = { | 124 | [0] = { |
| 125 | .start = S5P_PA_UART4, | 125 | .start = S5P_PA_UART4, |
| 126 | .end = S5P_PA_UART4 + S5P_SZ_UART, | 126 | .end = S5P_PA_UART4 + S5P_SZ_UART - 1, |
| 127 | .flags = IORESOURCE_MEM, | 127 | .flags = IORESOURCE_MEM, |
| 128 | }, | 128 | }, |
| 129 | [1] = { | 129 | [1] = { |
| @@ -148,7 +148,7 @@ static struct resource s5p_uart5_resource[] = { | |||
| 148 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 5 | 148 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 5 |
| 149 | [0] = { | 149 | [0] = { |
| 150 | .start = S5P_PA_UART5, | 150 | .start = S5P_PA_UART5, |
| 151 | .end = S5P_PA_UART5 + S5P_SZ_UART, | 151 | .end = S5P_PA_UART5 + S5P_SZ_UART - 1, |
| 152 | .flags = IORESOURCE_MEM, | 152 | .flags = IORESOURCE_MEM, |
| 153 | }, | 153 | }, |
| 154 | [1] = { | 154 | [1] = { |
diff --git a/arch/arm/plat-samsung/dev-ts.c b/arch/arm/plat-samsung/dev-ts.c index 236ef8427d7d..3e4bd8147bf4 100644 --- a/arch/arm/plat-samsung/dev-ts.c +++ b/arch/arm/plat-samsung/dev-ts.c | |||
| @@ -58,4 +58,3 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd) | |||
| 58 | 58 | ||
| 59 | s3c_device_ts.dev.platform_data = npd; | 59 | s3c_device_ts.dev.platform_data = npd; |
| 60 | } | 60 | } |
| 61 | EXPORT_SYMBOL(s3c24xx_ts_set_platdata); | ||
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h index 99ba6789cc97..6dd455bafdfd 100644 --- a/arch/arm/plat-spear/include/plat/uncompress.h +++ b/arch/arm/plat-spear/include/plat/uncompress.h | |||
| @@ -24,10 +24,10 @@ static inline void putc(int c) | |||
| 24 | { | 24 | { |
| 25 | void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE; | 25 | void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE; |
| 26 | 26 | ||
| 27 | while (readl(base + UART01x_FR) & UART01x_FR_TXFF) | 27 | while (readl_relaxed(base + UART01x_FR) & UART01x_FR_TXFF) |
| 28 | barrier(); | 28 | barrier(); |
| 29 | 29 | ||
| 30 | writel(c, base + UART01x_DR); | 30 | writel_relaxed(c, base + UART01x_DR); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | static inline void flush(void) | 33 | static inline void flush(void) |
diff --git a/arch/arm/plat-spear/include/plat/vmalloc.h b/arch/arm/plat-spear/include/plat/vmalloc.h index 09e9372aea21..8c8b24d07046 100644 --- a/arch/arm/plat-spear/include/plat/vmalloc.h +++ b/arch/arm/plat-spear/include/plat/vmalloc.h | |||
| @@ -14,6 +14,6 @@ | |||
| 14 | #ifndef __PLAT_VMALLOC_H | 14 | #ifndef __PLAT_VMALLOC_H |
| 15 | #define __PLAT_VMALLOC_H | 15 | #define __PLAT_VMALLOC_H |
| 16 | 16 | ||
| 17 | #define VMALLOC_END 0xF0000000 | 17 | #define VMALLOC_END 0xF0000000UL |
| 18 | 18 | ||
| 19 | #endif /* __PLAT_VMALLOC_H */ | 19 | #endif /* __PLAT_VMALLOC_H */ |
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S index 442218980db0..c49be845f96a 100644 --- a/arch/cris/kernel/vmlinux.lds.S +++ b/arch/cris/kernel/vmlinux.lds.S | |||
| @@ -72,11 +72,6 @@ SECTIONS | |||
| 72 | INIT_TEXT_SECTION(PAGE_SIZE) | 72 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 73 | .init.data : { INIT_DATA } | 73 | .init.data : { INIT_DATA } |
| 74 | .init.setup : { INIT_SETUP(16) } | 74 | .init.setup : { INIT_SETUP(16) } |
| 75 | #ifdef CONFIG_ETRAX_ARCH_V32 | ||
| 76 | __start___param = .; | ||
| 77 | __param : { *(__param) } | ||
| 78 | __stop___param = .; | ||
| 79 | #endif | ||
| 80 | .initcall.init : { | 75 | .initcall.init : { |
| 81 | INIT_CALLS | 76 | INIT_CALLS |
| 82 | } | 77 | } |
diff --git a/arch/s390/boot/compressed/misc.c b/arch/s390/boot/compressed/misc.c index 0851eb1e919e..2751b3a8a66f 100644 --- a/arch/s390/boot/compressed/misc.c +++ b/arch/s390/boot/compressed/misc.c | |||
| @@ -133,11 +133,12 @@ unsigned long decompress_kernel(void) | |||
| 133 | unsigned long output_addr; | 133 | unsigned long output_addr; |
| 134 | unsigned char *output; | 134 | unsigned char *output; |
| 135 | 135 | ||
| 136 | check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start); | 136 | output_addr = ((unsigned long) &_end + HEAP_SIZE + 4095UL) & -4096UL; |
| 137 | check_ipl_parmblock((void *) 0, output_addr + SZ__bss_start); | ||
| 137 | memset(&_bss, 0, &_ebss - &_bss); | 138 | memset(&_bss, 0, &_ebss - &_bss); |
| 138 | free_mem_ptr = (unsigned long)&_end; | 139 | free_mem_ptr = (unsigned long)&_end; |
| 139 | free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; | 140 | free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; |
| 140 | output = (unsigned char *) ((free_mem_end_ptr + 4095UL) & -4096UL); | 141 | output = (unsigned char *) output_addr; |
| 141 | 142 | ||
| 142 | #ifdef CONFIG_BLK_DEV_INITRD | 143 | #ifdef CONFIG_BLK_DEV_INITRD |
| 143 | /* | 144 | /* |
diff --git a/arch/s390/crypto/sha_common.c b/arch/s390/crypto/sha_common.c index f42dbabc0d30..48884f89ab92 100644 --- a/arch/s390/crypto/sha_common.c +++ b/arch/s390/crypto/sha_common.c | |||
| @@ -38,6 +38,7 @@ int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len) | |||
| 38 | BUG_ON(ret != bsize); | 38 | BUG_ON(ret != bsize); |
| 39 | data += bsize - index; | 39 | data += bsize - index; |
| 40 | len -= bsize - index; | 40 | len -= bsize - index; |
| 41 | index = 0; | ||
| 41 | } | 42 | } |
| 42 | 43 | ||
| 43 | /* process as many blocks as possible */ | 44 | /* process as many blocks as possible */ |
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h index 76daea117181..5c5ba10384c2 100644 --- a/arch/s390/include/asm/atomic.h +++ b/arch/s390/include/asm/atomic.h | |||
| @@ -36,14 +36,19 @@ | |||
| 36 | 36 | ||
| 37 | static inline int atomic_read(const atomic_t *v) | 37 | static inline int atomic_read(const atomic_t *v) |
| 38 | { | 38 | { |
| 39 | barrier(); | 39 | int c; |
| 40 | return v->counter; | 40 | |
| 41 | asm volatile( | ||
| 42 | " l %0,%1\n" | ||
| 43 | : "=d" (c) : "Q" (v->counter)); | ||
| 44 | return c; | ||
| 41 | } | 45 | } |
| 42 | 46 | ||
| 43 | static inline void atomic_set(atomic_t *v, int i) | 47 | static inline void atomic_set(atomic_t *v, int i) |
| 44 | { | 48 | { |
| 45 | v->counter = i; | 49 | asm volatile( |
| 46 | barrier(); | 50 | " st %1,%0\n" |
| 51 | : "=Q" (v->counter) : "d" (i)); | ||
| 47 | } | 52 | } |
| 48 | 53 | ||
| 49 | static inline int atomic_add_return(int i, atomic_t *v) | 54 | static inline int atomic_add_return(int i, atomic_t *v) |
| @@ -128,14 +133,19 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) | |||
| 128 | 133 | ||
| 129 | static inline long long atomic64_read(const atomic64_t *v) | 134 | static inline long long atomic64_read(const atomic64_t *v) |
| 130 | { | 135 | { |
| 131 | barrier(); | 136 | long long c; |
| 132 | return v->counter; | 137 | |
| 138 | asm volatile( | ||
| 139 | " lg %0,%1\n" | ||
| 140 | : "=d" (c) : "Q" (v->counter)); | ||
| 141 | return c; | ||
| 133 | } | 142 | } |
| 134 | 143 | ||
| 135 | static inline void atomic64_set(atomic64_t *v, long long i) | 144 | static inline void atomic64_set(atomic64_t *v, long long i) |
| 136 | { | 145 | { |
| 137 | v->counter = i; | 146 | asm volatile( |
| 138 | barrier(); | 147 | " stg %1,%0\n" |
| 148 | : "=Q" (v->counter) : "d" (i)); | ||
| 139 | } | 149 | } |
| 140 | 150 | ||
| 141 | static inline long long atomic64_add_return(long long i, atomic64_t *v) | 151 | static inline long long atomic64_add_return(long long i, atomic64_t *v) |
diff --git a/arch/s390/include/asm/cache.h b/arch/s390/include/asm/cache.h index 24aafa68b643..2a30d5ac0667 100644 --- a/arch/s390/include/asm/cache.h +++ b/arch/s390/include/asm/cache.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | #define L1_CACHE_BYTES 256 | 14 | #define L1_CACHE_BYTES 256 |
| 15 | #define L1_CACHE_SHIFT 8 | 15 | #define L1_CACHE_SHIFT 8 |
| 16 | #define NET_SKB_PAD 32 | ||
| 16 | 17 | ||
| 17 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) | 18 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
| 18 | 19 | ||
diff --git a/arch/sparc/include/asm/pcr.h b/arch/sparc/include/asm/pcr.h index a2f5c61f924e..843e4faf6a50 100644 --- a/arch/sparc/include/asm/pcr.h +++ b/arch/sparc/include/asm/pcr.h | |||
| @@ -43,4 +43,6 @@ static inline u64 picl_value(unsigned int nmi_hz) | |||
| 43 | 43 | ||
| 44 | extern u64 pcr_enable; | 44 | extern u64 pcr_enable; |
| 45 | 45 | ||
| 46 | extern int pcr_arch_init(void); | ||
| 47 | |||
| 46 | #endif /* __PCR_H */ | 48 | #endif /* __PCR_H */ |
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index 47977a77f6c6..72509d0e34be 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c | |||
| @@ -255,10 +255,9 @@ static inline iopte_t *alloc_npages(struct device *dev, struct iommu *iommu, | |||
| 255 | static int iommu_alloc_ctx(struct iommu *iommu) | 255 | static int iommu_alloc_ctx(struct iommu *iommu) |
| 256 | { | 256 | { |
| 257 | int lowest = iommu->ctx_lowest_free; | 257 | int lowest = iommu->ctx_lowest_free; |
| 258 | int sz = IOMMU_NUM_CTXS - lowest; | 258 | int n = find_next_zero_bit(iommu->ctx_bitmap, IOMMU_NUM_CTXS, lowest); |
| 259 | int n = find_next_zero_bit(iommu->ctx_bitmap, sz, lowest); | ||
| 260 | 259 | ||
| 261 | if (unlikely(n == sz)) { | 260 | if (unlikely(n == IOMMU_NUM_CTXS)) { |
| 262 | n = find_next_zero_bit(iommu->ctx_bitmap, lowest, 1); | 261 | n = find_next_zero_bit(iommu->ctx_bitmap, lowest, 1); |
| 263 | if (unlikely(n == lowest)) { | 262 | if (unlikely(n == lowest)) { |
| 264 | printk(KERN_WARNING "IOMMU: Ran out of contexts.\n"); | 263 | printk(KERN_WARNING "IOMMU: Ran out of contexts.\n"); |
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index ae96cf52a955..7c2ced612b8f 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c | |||
| @@ -167,5 +167,3 @@ out_unregister: | |||
| 167 | unregister_perf_hsvc(); | 167 | unregister_perf_hsvc(); |
| 168 | return err; | 168 | return err; |
| 169 | } | 169 | } |
| 170 | |||
| 171 | early_initcall(pcr_arch_init); | ||
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index b6a2b8f47040..555a76d1f4a1 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | #include <asm/mdesc.h> | 49 | #include <asm/mdesc.h> |
| 50 | #include <asm/ldc.h> | 50 | #include <asm/ldc.h> |
| 51 | #include <asm/hypervisor.h> | 51 | #include <asm/hypervisor.h> |
| 52 | #include <asm/pcr.h> | ||
| 52 | 53 | ||
| 53 | #include "cpumap.h" | 54 | #include "cpumap.h" |
| 54 | 55 | ||
| @@ -1358,6 +1359,7 @@ void __cpu_die(unsigned int cpu) | |||
| 1358 | 1359 | ||
| 1359 | void __init smp_cpus_done(unsigned int max_cpus) | 1360 | void __init smp_cpus_done(unsigned int max_cpus) |
| 1360 | { | 1361 | { |
| 1362 | pcr_arch_init(); | ||
| 1361 | } | 1363 | } |
| 1362 | 1364 | ||
| 1363 | void smp_send_reschedule(int cpu) | 1365 | void smp_send_reschedule(int cpu) |
diff --git a/arch/sparc/kernel/una_asm_32.S b/arch/sparc/kernel/una_asm_32.S index 8cc03458eb7e..8f096e84a937 100644 --- a/arch/sparc/kernel/una_asm_32.S +++ b/arch/sparc/kernel/una_asm_32.S | |||
| @@ -24,9 +24,9 @@ retl_efault: | |||
| 24 | .globl __do_int_store | 24 | .globl __do_int_store |
| 25 | __do_int_store: | 25 | __do_int_store: |
| 26 | ld [%o2], %g1 | 26 | ld [%o2], %g1 |
| 27 | cmp %1, 2 | 27 | cmp %o1, 2 |
| 28 | be 2f | 28 | be 2f |
| 29 | cmp %1, 4 | 29 | cmp %o1, 4 |
| 30 | be 1f | 30 | be 1f |
| 31 | srl %g1, 24, %g2 | 31 | srl %g1, 24, %g2 |
| 32 | srl %g1, 16, %g7 | 32 | srl %g1, 16, %g7 |
diff --git a/arch/sparc/lib/bitext.c b/arch/sparc/lib/bitext.c index 764b3eb7b604..48d00e72ce15 100644 --- a/arch/sparc/lib/bitext.c +++ b/arch/sparc/lib/bitext.c | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
| 13 | #include <linux/bitops.h> | 13 | #include <linux/bitmap.h> |
| 14 | 14 | ||
| 15 | #include <asm/bitext.h> | 15 | #include <asm/bitext.h> |
| 16 | 16 | ||
| @@ -80,8 +80,7 @@ int bit_map_string_get(struct bit_map *t, int len, int align) | |||
| 80 | while (test_bit(offset + i, t->map) == 0) { | 80 | while (test_bit(offset + i, t->map) == 0) { |
| 81 | i++; | 81 | i++; |
| 82 | if (i == len) { | 82 | if (i == len) { |
| 83 | for (i = 0; i < len; i++) | 83 | bitmap_set(t->map, offset, len); |
| 84 | __set_bit(offset + i, t->map); | ||
| 85 | if (offset == t->first_free) | 84 | if (offset == t->first_free) |
| 86 | t->first_free = find_next_zero_bit | 85 | t->first_free = find_next_zero_bit |
| 87 | (t->map, t->size, | 86 | (t->map, t->size, |
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index 211ca3f7fd16..4ea15ca89b2b 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h | |||
| @@ -88,6 +88,7 @@ extern int acpi_disabled; | |||
| 88 | extern int acpi_pci_disabled; | 88 | extern int acpi_pci_disabled; |
| 89 | extern int acpi_skip_timer_override; | 89 | extern int acpi_skip_timer_override; |
| 90 | extern int acpi_use_timer_override; | 90 | extern int acpi_use_timer_override; |
| 91 | extern int acpi_fix_pin2_polarity; | ||
| 91 | 92 | ||
| 92 | extern u8 acpi_sci_flags; | 93 | extern u8 acpi_sci_flags; |
| 93 | extern int acpi_sci_override_gsi; | 94 | extern int acpi_sci_override_gsi; |
diff --git a/arch/x86/include/asm/perf_event_p4.h b/arch/x86/include/asm/perf_event_p4.h index e2f6a99f14ab..cc29086e30cd 100644 --- a/arch/x86/include/asm/perf_event_p4.h +++ b/arch/x86/include/asm/perf_event_p4.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | #define ARCH_P4_CNTRVAL_BITS (40) | 23 | #define ARCH_P4_CNTRVAL_BITS (40) |
| 24 | #define ARCH_P4_CNTRVAL_MASK ((1ULL << ARCH_P4_CNTRVAL_BITS) - 1) | 24 | #define ARCH_P4_CNTRVAL_MASK ((1ULL << ARCH_P4_CNTRVAL_BITS) - 1) |
| 25 | #define ARCH_P4_UNFLAGGED_BIT ((1ULL) << (ARCH_P4_CNTRVAL_BITS - 1)) | ||
| 25 | 26 | ||
| 26 | #define P4_ESCR_EVENT_MASK 0x7e000000U | 27 | #define P4_ESCR_EVENT_MASK 0x7e000000U |
| 27 | #define P4_ESCR_EVENT_SHIFT 25 | 28 | #define P4_ESCR_EVENT_SHIFT 25 |
diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h index 6c22bf353f26..725b77831993 100644 --- a/arch/x86/include/asm/smpboot_hooks.h +++ b/arch/x86/include/asm/smpboot_hooks.h | |||
| @@ -34,7 +34,7 @@ static inline void smpboot_restore_warm_reset_vector(void) | |||
| 34 | */ | 34 | */ |
| 35 | CMOS_WRITE(0, 0xf); | 35 | CMOS_WRITE(0, 0xf); |
| 36 | 36 | ||
| 37 | *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0; | 37 | *((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | static inline void __init smpboot_setup_io_apic(void) | 40 | static inline void __init smpboot_setup_io_apic(void) |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index b3a71137983a..3e6e2d68f761 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -72,6 +72,7 @@ u8 acpi_sci_flags __initdata; | |||
| 72 | int acpi_sci_override_gsi __initdata; | 72 | int acpi_sci_override_gsi __initdata; |
| 73 | int acpi_skip_timer_override __initdata; | 73 | int acpi_skip_timer_override __initdata; |
| 74 | int acpi_use_timer_override __initdata; | 74 | int acpi_use_timer_override __initdata; |
| 75 | int acpi_fix_pin2_polarity __initdata; | ||
| 75 | 76 | ||
| 76 | #ifdef CONFIG_X86_LOCAL_APIC | 77 | #ifdef CONFIG_X86_LOCAL_APIC |
| 77 | static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; | 78 | static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; |
| @@ -415,10 +416,15 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header, | |||
| 415 | return 0; | 416 | return 0; |
| 416 | } | 417 | } |
| 417 | 418 | ||
| 418 | if (acpi_skip_timer_override && | 419 | if (intsrc->source_irq == 0 && intsrc->global_irq == 2) { |
| 419 | intsrc->source_irq == 0 && intsrc->global_irq == 2) { | 420 | if (acpi_skip_timer_override) { |
| 420 | printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); | 421 | printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); |
| 421 | return 0; | 422 | return 0; |
| 423 | } | ||
| 424 | if (acpi_fix_pin2_polarity && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) { | ||
| 425 | intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK; | ||
| 426 | printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n"); | ||
| 427 | } | ||
| 422 | } | 428 | } |
| 423 | 429 | ||
| 424 | mp_override_legacy_irq(intsrc->source_irq, | 430 | mp_override_legacy_irq(intsrc->source_irq, |
diff --git a/arch/x86/kernel/apb_timer.c b/arch/x86/kernel/apb_timer.c index 51ef31a89be9..51d4e1663066 100644 --- a/arch/x86/kernel/apb_timer.c +++ b/arch/x86/kernel/apb_timer.c | |||
| @@ -284,7 +284,7 @@ static int __init apbt_clockevent_register(void) | |||
| 284 | memcpy(&adev->evt, &apbt_clockevent, sizeof(struct clock_event_device)); | 284 | memcpy(&adev->evt, &apbt_clockevent, sizeof(struct clock_event_device)); |
| 285 | 285 | ||
| 286 | if (mrst_timer_options == MRST_TIMER_LAPIC_APBT) { | 286 | if (mrst_timer_options == MRST_TIMER_LAPIC_APBT) { |
| 287 | apbt_clockevent.rating = APBT_CLOCKEVENT_RATING - 100; | 287 | adev->evt.rating = APBT_CLOCKEVENT_RATING - 100; |
| 288 | global_clock_event = &adev->evt; | 288 | global_clock_event = &adev->evt; |
| 289 | printk(KERN_DEBUG "%s clockevent registered as global\n", | 289 | printk(KERN_DEBUG "%s clockevent registered as global\n", |
| 290 | global_clock_event->name); | 290 | global_clock_event->name); |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index f7a0993c1e7c..ff751a9f182b 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
| @@ -770,9 +770,14 @@ static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc) | |||
| 770 | return 1; | 770 | return 1; |
| 771 | } | 771 | } |
| 772 | 772 | ||
| 773 | /* it might be unflagged overflow */ | 773 | /* |
| 774 | rdmsrl(hwc->event_base + hwc->idx, v); | 774 | * In some circumstances the overflow might issue an NMI but did |
| 775 | if (!(v & ARCH_P4_CNTRVAL_MASK)) | 775 | * not set P4_CCCR_OVF bit. Because a counter holds a negative value |
| 776 | * we simply check for high bit being set, if it's cleared it means | ||
| 777 | * the counter has reached zero value and continued counting before | ||
| 778 | * real NMI signal was received: | ||
| 779 | */ | ||
| 780 | if (!(v & ARCH_P4_UNFLAGGED_BIT)) | ||
| 776 | return 1; | 781 | return 1; |
| 777 | 782 | ||
| 778 | return 0; | 783 | return 0; |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 76b8cd953dee..9efbdcc56425 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
| @@ -143,15 +143,10 @@ static void __init ati_bugs(int num, int slot, int func) | |||
| 143 | 143 | ||
| 144 | static u32 __init ati_sbx00_rev(int num, int slot, int func) | 144 | static u32 __init ati_sbx00_rev(int num, int slot, int func) |
| 145 | { | 145 | { |
| 146 | u32 old, d; | 146 | u32 d; |
| 147 | 147 | ||
| 148 | d = read_pci_config(num, slot, func, 0x70); | ||
| 149 | old = d; | ||
| 150 | d &= ~(1<<8); | ||
| 151 | write_pci_config(num, slot, func, 0x70, d); | ||
| 152 | d = read_pci_config(num, slot, func, 0x8); | 148 | d = read_pci_config(num, slot, func, 0x8); |
| 153 | d &= 0xff; | 149 | d &= 0xff; |
| 154 | write_pci_config(num, slot, func, 0x70, old); | ||
| 155 | 150 | ||
| 156 | return d; | 151 | return d; |
| 157 | } | 152 | } |
| @@ -160,13 +155,16 @@ static void __init ati_bugs_contd(int num, int slot, int func) | |||
| 160 | { | 155 | { |
| 161 | u32 d, rev; | 156 | u32 d, rev; |
| 162 | 157 | ||
| 163 | if (acpi_use_timer_override) | ||
| 164 | return; | ||
| 165 | |||
| 166 | rev = ati_sbx00_rev(num, slot, func); | 158 | rev = ati_sbx00_rev(num, slot, func); |
| 159 | if (rev >= 0x40) | ||
| 160 | acpi_fix_pin2_polarity = 1; | ||
| 161 | |||
| 167 | if (rev > 0x13) | 162 | if (rev > 0x13) |
| 168 | return; | 163 | return; |
| 169 | 164 | ||
| 165 | if (acpi_use_timer_override) | ||
| 166 | return; | ||
| 167 | |||
| 170 | /* check for IRQ0 interrupt swap */ | 168 | /* check for IRQ0 interrupt swap */ |
| 171 | d = read_pci_config(num, slot, func, 0x64); | 169 | d = read_pci_config(num, slot, func, 0x64); |
| 172 | if (!(d & (1<<14))) | 170 | if (!(d & (1<<14))) |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index fc7aae1e2bc7..715037caeb43 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -285,6 +285,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
| 285 | DMI_MATCH(DMI_BOARD_NAME, "P4S800"), | 285 | DMI_MATCH(DMI_BOARD_NAME, "P4S800"), |
| 286 | }, | 286 | }, |
| 287 | }, | 287 | }, |
| 288 | { /* Handle problems with rebooting on VersaLogic Menlow boards */ | ||
| 289 | .callback = set_bios_reboot, | ||
| 290 | .ident = "VersaLogic Menlow based board", | ||
| 291 | .matches = { | ||
| 292 | DMI_MATCH(DMI_BOARD_VENDOR, "VersaLogic Corporation"), | ||
| 293 | DMI_MATCH(DMI_BOARD_NAME, "VersaLogic Menlow board"), | ||
| 294 | }, | ||
| 295 | }, | ||
| 288 | { } | 296 | { } |
| 289 | }; | 297 | }; |
| 290 | 298 | ||
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 54ce246a383e..63fec1531e89 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -2777,6 +2777,8 @@ static int dr_interception(struct vcpu_svm *svm) | |||
| 2777 | kvm_register_write(&svm->vcpu, reg, val); | 2777 | kvm_register_write(&svm->vcpu, reg, val); |
| 2778 | } | 2778 | } |
| 2779 | 2779 | ||
| 2780 | skip_emulated_instruction(&svm->vcpu); | ||
| 2781 | |||
| 2780 | return 1; | 2782 | return 1; |
| 2781 | } | 2783 | } |
| 2782 | 2784 | ||
diff --git a/block/genhd.c b/block/genhd.c index 6a5b772aa201..cbf1112a885c 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
| @@ -1355,7 +1355,7 @@ int invalidate_partition(struct gendisk *disk, int partno) | |||
| 1355 | struct block_device *bdev = bdget_disk(disk, partno); | 1355 | struct block_device *bdev = bdget_disk(disk, partno); |
| 1356 | if (bdev) { | 1356 | if (bdev) { |
| 1357 | fsync_bdev(bdev); | 1357 | fsync_bdev(bdev); |
| 1358 | res = __invalidate_device(bdev); | 1358 | res = __invalidate_device(bdev, true); |
| 1359 | bdput(bdev); | 1359 | bdput(bdev); |
| 1360 | } | 1360 | } |
| 1361 | return res; | 1361 | return res; |
diff --git a/block/ioctl.c b/block/ioctl.c index 9049d460fa89..1124cd297263 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
| @@ -294,9 +294,11 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, | |||
| 294 | return -EINVAL; | 294 | return -EINVAL; |
| 295 | if (get_user(n, (int __user *) arg)) | 295 | if (get_user(n, (int __user *) arg)) |
| 296 | return -EFAULT; | 296 | return -EFAULT; |
| 297 | if (!(mode & FMODE_EXCL) && | 297 | if (!(mode & FMODE_EXCL)) { |
| 298 | blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0) | 298 | bdgrab(bdev); |
| 299 | return -EBUSY; | 299 | if (blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0) |
| 300 | return -EBUSY; | ||
| 301 | } | ||
| 300 | ret = set_blocksize(bdev, n); | 302 | ret = set_blocksize(bdev, n); |
| 301 | if (!(mode & FMODE_EXCL)) | 303 | if (!(mode & FMODE_EXCL)) |
| 302 | blkdev_put(bdev, mode | FMODE_EXCL); | 304 | blkdev_put(bdev, mode | FMODE_EXCL); |
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 73fb1c4f4cd4..25ef1a4556e6 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
| @@ -866,8 +866,9 @@ static int popen(struct atm_vcc *vcc) | |||
| 866 | } | 866 | } |
| 867 | 867 | ||
| 868 | skb = alloc_skb(sizeof(*header), GFP_ATOMIC); | 868 | skb = alloc_skb(sizeof(*header), GFP_ATOMIC); |
| 869 | if (!skb && net_ratelimit()) { | 869 | if (!skb) { |
| 870 | dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n"); | 870 | if (net_ratelimit()) |
| 871 | dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n"); | ||
| 871 | return -ENOMEM; | 872 | return -ENOMEM; |
| 872 | } | 873 | } |
| 873 | header = (void *)skb_put(skb, sizeof(*header)); | 874 | header = (void *)skb_put(skb, sizeof(*header)); |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index b9ba04fc2b34..77fc76f8aea9 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
| @@ -3281,7 +3281,7 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g, | |||
| 3281 | struct block_device *bdev = opened_bdev[cnt]; | 3281 | struct block_device *bdev = opened_bdev[cnt]; |
| 3282 | if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) | 3282 | if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) |
| 3283 | continue; | 3283 | continue; |
| 3284 | __invalidate_device(bdev); | 3284 | __invalidate_device(bdev, true); |
| 3285 | } | 3285 | } |
| 3286 | mutex_unlock(&open_lock); | 3286 | mutex_unlock(&open_lock); |
| 3287 | } else { | 3287 | } else { |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index a126e614601f..6dcd55a74c0a 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
| @@ -39,6 +39,11 @@ static struct usb_device_id ath3k_table[] = { | |||
| 39 | /* Atheros AR3011 with sflash firmware*/ | 39 | /* Atheros AR3011 with sflash firmware*/ |
| 40 | { USB_DEVICE(0x0CF3, 0x3002) }, | 40 | { USB_DEVICE(0x0CF3, 0x3002) }, |
| 41 | 41 | ||
| 42 | /* Atheros AR9285 Malbec with sflash firmware */ | ||
| 43 | { USB_DEVICE(0x03F0, 0x311D) }, | ||
| 44 | |||
| 45 | /* Atheros AR5BBU12 with sflash firmware */ | ||
| 46 | { USB_DEVICE(0x0489, 0xE02C) }, | ||
| 42 | { } /* Terminating entry */ | 47 | { } /* Terminating entry */ |
| 43 | }; | 48 | }; |
| 44 | 49 | ||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 1da773f899a2..700a3840fddc 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -102,6 +102,12 @@ static struct usb_device_id blacklist_table[] = { | |||
| 102 | /* Atheros 3011 with sflash firmware */ | 102 | /* Atheros 3011 with sflash firmware */ |
| 103 | { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, | 103 | { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, |
| 104 | 104 | ||
| 105 | /* Atheros AR9285 Malbec with sflash firmware */ | ||
| 106 | { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, | ||
| 107 | |||
| 108 | /* Atheros AR5BBU12 with sflash firmware */ | ||
| 109 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, | ||
| 110 | |||
| 105 | /* Broadcom BCM2035 */ | 111 | /* Broadcom BCM2035 */ |
| 106 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, | 112 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, |
| 107 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, | 113 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, |
| @@ -826,7 +832,7 @@ static void btusb_work(struct work_struct *work) | |||
| 826 | 832 | ||
| 827 | if (hdev->conn_hash.sco_num > 0) { | 833 | if (hdev->conn_hash.sco_num > 0) { |
| 828 | if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) { | 834 | if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) { |
| 829 | err = usb_autopm_get_interface(data->isoc); | 835 | err = usb_autopm_get_interface(data->isoc ? data->isoc : data->intf); |
| 830 | if (err < 0) { | 836 | if (err < 0) { |
| 831 | clear_bit(BTUSB_ISOC_RUNNING, &data->flags); | 837 | clear_bit(BTUSB_ISOC_RUNNING, &data->flags); |
| 832 | usb_kill_anchored_urbs(&data->isoc_anchor); | 838 | usb_kill_anchored_urbs(&data->isoc_anchor); |
| @@ -855,7 +861,7 @@ static void btusb_work(struct work_struct *work) | |||
| 855 | 861 | ||
| 856 | __set_isoc_interface(hdev, 0); | 862 | __set_isoc_interface(hdev, 0); |
| 857 | if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) | 863 | if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) |
| 858 | usb_autopm_put_interface(data->isoc); | 864 | usb_autopm_put_interface(data->isoc ? data->isoc : data->intf); |
| 859 | } | 865 | } |
| 860 | } | 866 | } |
| 861 | 867 | ||
| @@ -1038,8 +1044,6 @@ static int btusb_probe(struct usb_interface *intf, | |||
| 1038 | 1044 | ||
| 1039 | usb_set_intfdata(intf, data); | 1045 | usb_set_intfdata(intf, data); |
| 1040 | 1046 | ||
| 1041 | usb_enable_autosuspend(interface_to_usbdev(intf)); | ||
| 1042 | |||
| 1043 | return 0; | 1047 | return 0; |
| 1044 | } | 1048 | } |
| 1045 | 1049 | ||
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 9252e85706ef..780498d76581 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
| @@ -773,18 +773,23 @@ int __init agp_amd64_init(void) | |||
| 773 | #else | 773 | #else |
| 774 | printk(KERN_INFO PFX "You can boot with agp=try_unsupported\n"); | 774 | printk(KERN_INFO PFX "You can boot with agp=try_unsupported\n"); |
| 775 | #endif | 775 | #endif |
| 776 | pci_unregister_driver(&agp_amd64_pci_driver); | ||
| 776 | return -ENODEV; | 777 | return -ENODEV; |
| 777 | } | 778 | } |
| 778 | 779 | ||
| 779 | /* First check that we have at least one AMD64 NB */ | 780 | /* First check that we have at least one AMD64 NB */ |
| 780 | if (!pci_dev_present(amd_nb_misc_ids)) | 781 | if (!pci_dev_present(amd_nb_misc_ids)) { |
| 782 | pci_unregister_driver(&agp_amd64_pci_driver); | ||
| 781 | return -ENODEV; | 783 | return -ENODEV; |
| 784 | } | ||
| 782 | 785 | ||
| 783 | /* Look for any AGP bridge */ | 786 | /* Look for any AGP bridge */ |
| 784 | agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table; | 787 | agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table; |
| 785 | err = driver_attach(&agp_amd64_pci_driver.driver); | 788 | err = driver_attach(&agp_amd64_pci_driver.driver); |
| 786 | if (err == 0 && agp_bridges_found == 0) | 789 | if (err == 0 && agp_bridges_found == 0) { |
| 790 | pci_unregister_driver(&agp_amd64_pci_driver); | ||
| 787 | err = -ENODEV; | 791 | err = -ENODEV; |
| 792 | } | ||
| 788 | } | 793 | } |
| 789 | return err; | 794 | return err; |
| 790 | } | 795 | } |
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h index c195bfeade11..5feebe2800e9 100644 --- a/drivers/char/agp/intel-agp.h +++ b/drivers/char/agp/intel-agp.h | |||
| @@ -130,6 +130,7 @@ | |||
| 130 | #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) | 130 | #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) |
| 131 | 131 | ||
| 132 | #define I915_IFPADDR 0x60 | 132 | #define I915_IFPADDR 0x60 |
| 133 | #define I830_HIC 0x70 | ||
| 133 | 134 | ||
| 134 | /* Intel 965G registers */ | 135 | /* Intel 965G registers */ |
| 135 | #define I965_MSAC 0x62 | 136 | #define I965_MSAC 0x62 |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index fab3d3265adb..0d09b537bb9a 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/pagemap.h> | 22 | #include <linux/pagemap.h> |
| 23 | #include <linux/agp_backend.h> | 23 | #include <linux/agp_backend.h> |
| 24 | #include <linux/delay.h> | ||
| 24 | #include <asm/smp.h> | 25 | #include <asm/smp.h> |
| 25 | #include "agp.h" | 26 | #include "agp.h" |
| 26 | #include "intel-agp.h" | 27 | #include "intel-agp.h" |
| @@ -70,12 +71,8 @@ static struct _intel_private { | |||
| 70 | u32 __iomem *gtt; /* I915G */ | 71 | u32 __iomem *gtt; /* I915G */ |
| 71 | bool clear_fake_agp; /* on first access via agp, fill with scratch */ | 72 | bool clear_fake_agp; /* on first access via agp, fill with scratch */ |
| 72 | int num_dcache_entries; | 73 | int num_dcache_entries; |
| 73 | union { | 74 | void __iomem *i9xx_flush_page; |
| 74 | void __iomem *i9xx_flush_page; | ||
| 75 | void *i8xx_flush_page; | ||
| 76 | }; | ||
| 77 | char *i81x_gtt_table; | 75 | char *i81x_gtt_table; |
| 78 | struct page *i8xx_page; | ||
| 79 | struct resource ifp_resource; | 76 | struct resource ifp_resource; |
| 80 | int resource_valid; | 77 | int resource_valid; |
| 81 | struct page *scratch_page; | 78 | struct page *scratch_page; |
| @@ -722,28 +719,6 @@ static int intel_fake_agp_fetch_size(void) | |||
| 722 | 719 | ||
| 723 | static void i830_cleanup(void) | 720 | static void i830_cleanup(void) |
| 724 | { | 721 | { |
| 725 | if (intel_private.i8xx_flush_page) { | ||
| 726 | kunmap(intel_private.i8xx_flush_page); | ||
| 727 | intel_private.i8xx_flush_page = NULL; | ||
| 728 | } | ||
| 729 | |||
| 730 | __free_page(intel_private.i8xx_page); | ||
| 731 | intel_private.i8xx_page = NULL; | ||
| 732 | } | ||
| 733 | |||
| 734 | static void intel_i830_setup_flush(void) | ||
| 735 | { | ||
| 736 | /* return if we've already set the flush mechanism up */ | ||
| 737 | if (intel_private.i8xx_page) | ||
| 738 | return; | ||
| 739 | |||
| 740 | intel_private.i8xx_page = alloc_page(GFP_KERNEL); | ||
| 741 | if (!intel_private.i8xx_page) | ||
| 742 | return; | ||
| 743 | |||
| 744 | intel_private.i8xx_flush_page = kmap(intel_private.i8xx_page); | ||
| 745 | if (!intel_private.i8xx_flush_page) | ||
| 746 | i830_cleanup(); | ||
| 747 | } | 722 | } |
| 748 | 723 | ||
| 749 | /* The chipset_flush interface needs to get data that has already been | 724 | /* The chipset_flush interface needs to get data that has already been |
| @@ -758,14 +733,27 @@ static void intel_i830_setup_flush(void) | |||
| 758 | */ | 733 | */ |
| 759 | static void i830_chipset_flush(void) | 734 | static void i830_chipset_flush(void) |
| 760 | { | 735 | { |
| 761 | unsigned int *pg = intel_private.i8xx_flush_page; | 736 | unsigned long timeout = jiffies + msecs_to_jiffies(1000); |
| 737 | |||
| 738 | /* Forcibly evict everything from the CPU write buffers. | ||
| 739 | * clflush appears to be insufficient. | ||
| 740 | */ | ||
| 741 | wbinvd_on_all_cpus(); | ||
| 742 | |||
| 743 | /* Now we've only seen documents for this magic bit on 855GM, | ||
| 744 | * we hope it exists for the other gen2 chipsets... | ||
| 745 | * | ||
| 746 | * Also works as advertised on my 845G. | ||
| 747 | */ | ||
| 748 | writel(readl(intel_private.registers+I830_HIC) | (1<<31), | ||
| 749 | intel_private.registers+I830_HIC); | ||
| 762 | 750 | ||
| 763 | memset(pg, 0, 1024); | 751 | while (readl(intel_private.registers+I830_HIC) & (1<<31)) { |
| 752 | if (time_after(jiffies, timeout)) | ||
| 753 | break; | ||
| 764 | 754 | ||
| 765 | if (cpu_has_clflush) | 755 | udelay(50); |
| 766 | clflush_cache_range(pg, 1024); | 756 | } |
| 767 | else if (wbinvd_on_all_cpus() != 0) | ||
| 768 | printk(KERN_ERR "Timed out waiting for cache flush.\n"); | ||
| 769 | } | 757 | } |
| 770 | 758 | ||
| 771 | static void i830_write_entry(dma_addr_t addr, unsigned int entry, | 759 | static void i830_write_entry(dma_addr_t addr, unsigned int entry, |
| @@ -849,8 +837,6 @@ static int i830_setup(void) | |||
| 849 | 837 | ||
| 850 | intel_private.gtt_bus_addr = reg_addr + I810_PTE_BASE; | 838 | intel_private.gtt_bus_addr = reg_addr + I810_PTE_BASE; |
| 851 | 839 | ||
| 852 | intel_i830_setup_flush(); | ||
| 853 | |||
| 854 | return 0; | 840 | return 0; |
| 855 | } | 841 | } |
| 856 | 842 | ||
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 777181a2e603..bcbbc71febb7 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
| @@ -830,8 +830,7 @@ static void monitor_card(unsigned long p) | |||
| 830 | test_bit(IS_ANY_T1, &dev->flags))) { | 830 | test_bit(IS_ANY_T1, &dev->flags))) { |
| 831 | DEBUGP(4, dev, "Perform AUTOPPS\n"); | 831 | DEBUGP(4, dev, "Perform AUTOPPS\n"); |
| 832 | set_bit(IS_AUTOPPS_ACT, &dev->flags); | 832 | set_bit(IS_AUTOPPS_ACT, &dev->flags); |
| 833 | ptsreq.protocol = ptsreq.protocol = | 833 | ptsreq.protocol = (0x01 << dev->proto); |
| 834 | (0x01 << dev->proto); | ||
| 835 | ptsreq.flags = 0x01; | 834 | ptsreq.flags = 0x01; |
| 836 | ptsreq.pts1 = 0x00; | 835 | ptsreq.pts1 = 0x00; |
| 837 | ptsreq.pts2 = 0x00; | 836 | ptsreq.pts2 = 0x00; |
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c index 94b8eb4d691d..444155a305ae 100644 --- a/drivers/char/pcmcia/ipwireless/main.c +++ b/drivers/char/pcmcia/ipwireless/main.c | |||
| @@ -78,7 +78,6 @@ static void signalled_reboot_callback(void *callback_data) | |||
| 78 | static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data) | 78 | static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data) |
| 79 | { | 79 | { |
| 80 | struct ipw_dev *ipw = priv_data; | 80 | struct ipw_dev *ipw = priv_data; |
| 81 | struct resource *io_resource; | ||
| 82 | int ret; | 81 | int ret; |
| 83 | 82 | ||
| 84 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; | 83 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
| @@ -92,9 +91,12 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data) | |||
| 92 | if (ret) | 91 | if (ret) |
| 93 | return ret; | 92 | return ret; |
| 94 | 93 | ||
| 95 | io_resource = request_region(p_dev->resource[0]->start, | 94 | if (!request_region(p_dev->resource[0]->start, |
| 96 | resource_size(p_dev->resource[0]), | 95 | resource_size(p_dev->resource[0]), |
| 97 | IPWIRELESS_PCCARD_NAME); | 96 | IPWIRELESS_PCCARD_NAME)) { |
| 97 | ret = -EBUSY; | ||
| 98 | goto exit; | ||
| 99 | } | ||
| 98 | 100 | ||
| 99 | p_dev->resource[2]->flags |= | 101 | p_dev->resource[2]->flags |= |
| 100 | WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; | 102 | WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; |
| @@ -105,22 +107,25 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data) | |||
| 105 | 107 | ||
| 106 | ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], p_dev->card_addr); | 108 | ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], p_dev->card_addr); |
| 107 | if (ret != 0) | 109 | if (ret != 0) |
| 108 | goto exit2; | 110 | goto exit1; |
| 109 | 111 | ||
| 110 | ipw->is_v2_card = resource_size(p_dev->resource[2]) == 0x100; | 112 | ipw->is_v2_card = resource_size(p_dev->resource[2]) == 0x100; |
| 111 | 113 | ||
| 112 | ipw->attr_memory = ioremap(p_dev->resource[2]->start, | 114 | ipw->common_memory = ioremap(p_dev->resource[2]->start, |
| 113 | resource_size(p_dev->resource[2])); | 115 | resource_size(p_dev->resource[2])); |
| 114 | request_mem_region(p_dev->resource[2]->start, | 116 | if (!request_mem_region(p_dev->resource[2]->start, |
| 115 | resource_size(p_dev->resource[2]), | 117 | resource_size(p_dev->resource[2]), |
| 116 | IPWIRELESS_PCCARD_NAME); | 118 | IPWIRELESS_PCCARD_NAME)) { |
| 119 | ret = -EBUSY; | ||
| 120 | goto exit2; | ||
| 121 | } | ||
| 117 | 122 | ||
| 118 | p_dev->resource[3]->flags |= WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | | 123 | p_dev->resource[3]->flags |= WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | |
| 119 | WIN_ENABLE; | 124 | WIN_ENABLE; |
| 120 | p_dev->resource[3]->end = 0; /* this used to be 0x1000 */ | 125 | p_dev->resource[3]->end = 0; /* this used to be 0x1000 */ |
| 121 | ret = pcmcia_request_window(p_dev, p_dev->resource[3], 0); | 126 | ret = pcmcia_request_window(p_dev, p_dev->resource[3], 0); |
| 122 | if (ret != 0) | 127 | if (ret != 0) |
| 123 | goto exit2; | 128 | goto exit3; |
| 124 | 129 | ||
| 125 | ret = pcmcia_map_mem_page(p_dev, p_dev->resource[3], 0); | 130 | ret = pcmcia_map_mem_page(p_dev, p_dev->resource[3], 0); |
| 126 | if (ret != 0) | 131 | if (ret != 0) |
| @@ -128,23 +133,28 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data) | |||
| 128 | 133 | ||
| 129 | ipw->attr_memory = ioremap(p_dev->resource[3]->start, | 134 | ipw->attr_memory = ioremap(p_dev->resource[3]->start, |
| 130 | resource_size(p_dev->resource[3])); | 135 | resource_size(p_dev->resource[3])); |
| 131 | request_mem_region(p_dev->resource[3]->start, | 136 | if (!request_mem_region(p_dev->resource[3]->start, |
| 132 | resource_size(p_dev->resource[3]), | 137 | resource_size(p_dev->resource[3]), |
| 133 | IPWIRELESS_PCCARD_NAME); | 138 | IPWIRELESS_PCCARD_NAME)) { |
| 139 | ret = -EBUSY; | ||
| 140 | goto exit4; | ||
| 141 | } | ||
| 134 | 142 | ||
| 135 | return 0; | 143 | return 0; |
| 136 | 144 | ||
| 145 | exit4: | ||
| 146 | iounmap(ipw->attr_memory); | ||
| 137 | exit3: | 147 | exit3: |
| 148 | release_mem_region(p_dev->resource[2]->start, | ||
| 149 | resource_size(p_dev->resource[2])); | ||
| 138 | exit2: | 150 | exit2: |
| 139 | if (ipw->common_memory) { | 151 | iounmap(ipw->common_memory); |
| 140 | release_mem_region(p_dev->resource[2]->start, | ||
| 141 | resource_size(p_dev->resource[2])); | ||
| 142 | iounmap(ipw->common_memory); | ||
| 143 | } | ||
| 144 | exit1: | 152 | exit1: |
| 145 | release_resource(io_resource); | 153 | release_region(p_dev->resource[0]->start, |
| 154 | resource_size(p_dev->resource[0])); | ||
| 155 | exit: | ||
| 146 | pcmcia_disable_device(p_dev); | 156 | pcmcia_disable_device(p_dev); |
| 147 | return -1; | 157 | return ret; |
| 148 | } | 158 | } |
| 149 | 159 | ||
| 150 | static int config_ipwireless(struct ipw_dev *ipw) | 160 | static int config_ipwireless(struct ipw_dev *ipw) |
| @@ -219,6 +229,8 @@ exit: | |||
| 219 | 229 | ||
| 220 | static void release_ipwireless(struct ipw_dev *ipw) | 230 | static void release_ipwireless(struct ipw_dev *ipw) |
| 221 | { | 231 | { |
| 232 | release_region(ipw->link->resource[0]->start, | ||
| 233 | resource_size(ipw->link->resource[0])); | ||
| 222 | if (ipw->common_memory) { | 234 | if (ipw->common_memory) { |
| 223 | release_mem_region(ipw->link->resource[2]->start, | 235 | release_mem_region(ipw->link->resource[2]->start, |
| 224 | resource_size(ipw->link->resource[2])); | 236 | resource_size(ipw->link->resource[2])); |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index faf5a2c65926..1f46f1cd9225 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
| @@ -364,14 +364,12 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, | |||
| 364 | tpm_protected_ordinal_duration[ordinal & | 364 | tpm_protected_ordinal_duration[ordinal & |
| 365 | TPM_PROTECTED_ORDINAL_MASK]; | 365 | TPM_PROTECTED_ORDINAL_MASK]; |
| 366 | 366 | ||
| 367 | if (duration_idx != TPM_UNDEFINED) { | 367 | if (duration_idx != TPM_UNDEFINED) |
| 368 | duration = chip->vendor.duration[duration_idx]; | 368 | duration = chip->vendor.duration[duration_idx]; |
| 369 | /* if duration is 0, it's because chip->vendor.duration wasn't */ | 369 | if (duration <= 0) |
| 370 | /* filled yet, so we set the lowest timeout just to give enough */ | ||
| 371 | /* time for tpm_get_timeouts() to succeed */ | ||
| 372 | return (duration <= 0 ? HZ : duration); | ||
| 373 | } else | ||
| 374 | return 2 * 60 * HZ; | 370 | return 2 * 60 * HZ; |
| 371 | else | ||
| 372 | return duration; | ||
| 375 | } | 373 | } |
| 376 | EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); | 374 | EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); |
| 377 | 375 | ||
| @@ -577,11 +575,9 @@ duration: | |||
| 577 | if (rc) | 575 | if (rc) |
| 578 | return; | 576 | return; |
| 579 | 577 | ||
| 580 | if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 || | 578 | if (be32_to_cpu(tpm_cmd.header.out.return_code) |
| 581 | be32_to_cpu(tpm_cmd.header.out.length) | 579 | != 3 * sizeof(u32)) |
| 582 | != sizeof(tpm_cmd.header.out) + sizeof(u32) + 3 * sizeof(u32)) | ||
| 583 | return; | 580 | return; |
| 584 | |||
| 585 | duration_cap = &tpm_cmd.params.getcap_out.cap.duration; | 581 | duration_cap = &tpm_cmd.params.getcap_out.cap.duration; |
| 586 | chip->vendor.duration[TPM_SHORT] = | 582 | chip->vendor.duration[TPM_SHORT] = |
| 587 | usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_short)); | 583 | usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_short)); |
| @@ -941,18 +937,6 @@ ssize_t tpm_show_caps_1_2(struct device * dev, | |||
| 941 | } | 937 | } |
| 942 | EXPORT_SYMBOL_GPL(tpm_show_caps_1_2); | 938 | EXPORT_SYMBOL_GPL(tpm_show_caps_1_2); |
| 943 | 939 | ||
| 944 | ssize_t tpm_show_timeouts(struct device *dev, struct device_attribute *attr, | ||
| 945 | char *buf) | ||
| 946 | { | ||
| 947 | struct tpm_chip *chip = dev_get_drvdata(dev); | ||
| 948 | |||
| 949 | return sprintf(buf, "%d %d %d\n", | ||
| 950 | jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]), | ||
| 951 | jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]), | ||
| 952 | jiffies_to_usecs(chip->vendor.duration[TPM_LONG])); | ||
| 953 | } | ||
| 954 | EXPORT_SYMBOL_GPL(tpm_show_timeouts); | ||
| 955 | |||
| 956 | ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, | 940 | ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, |
| 957 | const char *buf, size_t count) | 941 | const char *buf, size_t count) |
| 958 | { | 942 | { |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index d84ff772c26f..72ddb031b69a 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
| @@ -56,8 +56,6 @@ extern ssize_t tpm_show_owned(struct device *, struct device_attribute *attr, | |||
| 56 | char *); | 56 | char *); |
| 57 | extern ssize_t tpm_show_temp_deactivated(struct device *, | 57 | extern ssize_t tpm_show_temp_deactivated(struct device *, |
| 58 | struct device_attribute *attr, char *); | 58 | struct device_attribute *attr, char *); |
| 59 | extern ssize_t tpm_show_timeouts(struct device *, | ||
| 60 | struct device_attribute *attr, char *); | ||
| 61 | 59 | ||
| 62 | struct tpm_chip; | 60 | struct tpm_chip; |
| 63 | 61 | ||
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 0d1d38e5f266..dd21df55689d 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
| @@ -376,7 +376,6 @@ static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, | |||
| 376 | NULL); | 376 | NULL); |
| 377 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); | 377 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); |
| 378 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | 378 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); |
| 379 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); | ||
| 380 | 379 | ||
| 381 | static struct attribute *tis_attrs[] = { | 380 | static struct attribute *tis_attrs[] = { |
| 382 | &dev_attr_pubek.attr, | 381 | &dev_attr_pubek.attr, |
| @@ -386,8 +385,7 @@ static struct attribute *tis_attrs[] = { | |||
| 386 | &dev_attr_owned.attr, | 385 | &dev_attr_owned.attr, |
| 387 | &dev_attr_temp_deactivated.attr, | 386 | &dev_attr_temp_deactivated.attr, |
| 388 | &dev_attr_caps.attr, | 387 | &dev_attr_caps.attr, |
| 389 | &dev_attr_cancel.attr, | 388 | &dev_attr_cancel.attr, NULL, |
| 390 | &dev_attr_timeouts.attr, NULL, | ||
| 391 | }; | 389 | }; |
| 392 | 390 | ||
| 393 | static struct attribute_group tis_attr_grp = { | 391 | static struct attribute_group tis_attr_grp = { |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 3dadfa2a8528..28d1d3c24d65 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -164,8 +164,10 @@ static void vblank_disable_and_save(struct drm_device *dev, int crtc) | |||
| 164 | * available. In that case we can't account for this and just | 164 | * available. In that case we can't account for this and just |
| 165 | * hope for the best. | 165 | * hope for the best. |
| 166 | */ | 166 | */ |
| 167 | if ((vblrc > 0) && (abs(diff_ns) > 1000000)) | 167 | if ((vblrc > 0) && (abs64(diff_ns) > 1000000)) { |
| 168 | atomic_inc(&dev->_vblank_count[crtc]); | 168 | atomic_inc(&dev->_vblank_count[crtc]); |
| 169 | smp_mb__after_atomic_inc(); | ||
| 170 | } | ||
| 169 | 171 | ||
| 170 | /* Invalidate all timestamps while vblank irq's are off. */ | 172 | /* Invalidate all timestamps while vblank irq's are off. */ |
| 171 | clear_vblank_timestamps(dev, crtc); | 173 | clear_vblank_timestamps(dev, crtc); |
| @@ -491,6 +493,12 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc) | |||
| 491 | /* Dot clock in Hz: */ | 493 | /* Dot clock in Hz: */ |
| 492 | dotclock = (u64) crtc->hwmode.clock * 1000; | 494 | dotclock = (u64) crtc->hwmode.clock * 1000; |
| 493 | 495 | ||
| 496 | /* Fields of interlaced scanout modes are only halve a frame duration. | ||
| 497 | * Double the dotclock to get halve the frame-/line-/pixelduration. | ||
| 498 | */ | ||
| 499 | if (crtc->hwmode.flags & DRM_MODE_FLAG_INTERLACE) | ||
| 500 | dotclock *= 2; | ||
| 501 | |||
| 494 | /* Valid dotclock? */ | 502 | /* Valid dotclock? */ |
| 495 | if (dotclock > 0) { | 503 | if (dotclock > 0) { |
| 496 | /* Convert scanline length in pixels and video dot clock to | 504 | /* Convert scanline length in pixels and video dot clock to |
| @@ -603,14 +611,6 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, | |||
| 603 | return -EAGAIN; | 611 | return -EAGAIN; |
| 604 | } | 612 | } |
| 605 | 613 | ||
| 606 | /* Don't know yet how to handle interlaced or | ||
| 607 | * double scan modes. Just no-op for now. | ||
| 608 | */ | ||
| 609 | if (mode->flags & (DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLSCAN)) { | ||
| 610 | DRM_DEBUG("crtc %d: Noop due to unsupported mode.\n", crtc); | ||
| 611 | return -ENOTSUPP; | ||
| 612 | } | ||
| 613 | |||
| 614 | /* Get current scanout position with system timestamp. | 614 | /* Get current scanout position with system timestamp. |
| 615 | * Repeat query up to DRM_TIMESTAMP_MAXRETRIES times | 615 | * Repeat query up to DRM_TIMESTAMP_MAXRETRIES times |
| 616 | * if single query takes longer than max_error nanoseconds. | 616 | * if single query takes longer than max_error nanoseconds. |
| @@ -858,10 +858,11 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc) | |||
| 858 | if (rc) { | 858 | if (rc) { |
| 859 | tslot = atomic_read(&dev->_vblank_count[crtc]) + diff; | 859 | tslot = atomic_read(&dev->_vblank_count[crtc]) + diff; |
| 860 | vblanktimestamp(dev, crtc, tslot) = t_vblank; | 860 | vblanktimestamp(dev, crtc, tslot) = t_vblank; |
| 861 | smp_wmb(); | ||
| 862 | } | 861 | } |
| 863 | 862 | ||
| 863 | smp_mb__before_atomic_inc(); | ||
| 864 | atomic_add(diff, &dev->_vblank_count[crtc]); | 864 | atomic_add(diff, &dev->_vblank_count[crtc]); |
| 865 | smp_mb__after_atomic_inc(); | ||
| 865 | } | 866 | } |
| 866 | 867 | ||
| 867 | /** | 868 | /** |
| @@ -1011,7 +1012,8 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, | |||
| 1011 | struct drm_file *file_priv) | 1012 | struct drm_file *file_priv) |
| 1012 | { | 1013 | { |
| 1013 | struct drm_modeset_ctl *modeset = data; | 1014 | struct drm_modeset_ctl *modeset = data; |
| 1014 | int crtc, ret = 0; | 1015 | int ret = 0; |
| 1016 | unsigned int crtc; | ||
| 1015 | 1017 | ||
| 1016 | /* If drm_vblank_init() hasn't been called yet, just no-op */ | 1018 | /* If drm_vblank_init() hasn't been called yet, just no-op */ |
| 1017 | if (!dev->num_crtcs) | 1019 | if (!dev->num_crtcs) |
| @@ -1293,15 +1295,16 @@ bool drm_handle_vblank(struct drm_device *dev, int crtc) | |||
| 1293 | * e.g., due to spurious vblank interrupts. We need to | 1295 | * e.g., due to spurious vblank interrupts. We need to |
| 1294 | * ignore those for accounting. | 1296 | * ignore those for accounting. |
| 1295 | */ | 1297 | */ |
| 1296 | if (abs(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) { | 1298 | if (abs64(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) { |
| 1297 | /* Store new timestamp in ringbuffer. */ | 1299 | /* Store new timestamp in ringbuffer. */ |
| 1298 | vblanktimestamp(dev, crtc, vblcount + 1) = tvblank; | 1300 | vblanktimestamp(dev, crtc, vblcount + 1) = tvblank; |
| 1299 | smp_wmb(); | ||
| 1300 | 1301 | ||
| 1301 | /* Increment cooked vblank count. This also atomically commits | 1302 | /* Increment cooked vblank count. This also atomically commits |
| 1302 | * the timestamp computed above. | 1303 | * the timestamp computed above. |
| 1303 | */ | 1304 | */ |
| 1305 | smp_mb__before_atomic_inc(); | ||
| 1304 | atomic_inc(&dev->_vblank_count[crtc]); | 1306 | atomic_inc(&dev->_vblank_count[crtc]); |
| 1307 | smp_mb__after_atomic_inc(); | ||
| 1305 | } else { | 1308 | } else { |
| 1306 | DRM_DEBUG("crtc %d: Redundant vblirq ignored. diff_ns = %d\n", | 1309 | DRM_DEBUG("crtc %d: Redundant vblirq ignored. diff_ns = %d\n", |
| 1307 | crtc, (int) diff_ns); | 1310 | crtc, (int) diff_ns); |
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 22a32b9932c5..79a04fde69b5 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
| @@ -184,7 +184,7 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev) | |||
| 184 | static bool | 184 | static bool |
| 185 | i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) | 185 | i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) |
| 186 | { | 186 | { |
| 187 | int tile_width; | 187 | int tile_width, tile_height; |
| 188 | 188 | ||
| 189 | /* Linear is always fine */ | 189 | /* Linear is always fine */ |
| 190 | if (tiling_mode == I915_TILING_NONE) | 190 | if (tiling_mode == I915_TILING_NONE) |
| @@ -215,6 +215,20 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) | |||
| 215 | } | 215 | } |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | if (IS_GEN2(dev) || | ||
| 219 | (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))) | ||
| 220 | tile_height = 32; | ||
| 221 | else | ||
| 222 | tile_height = 8; | ||
| 223 | /* i8xx is strange: It has 2 interleaved rows of tiles, so needs an even | ||
| 224 | * number of tile rows. */ | ||
| 225 | if (IS_GEN2(dev)) | ||
| 226 | tile_height *= 2; | ||
| 227 | |||
| 228 | /* Size needs to be aligned to a full tile row */ | ||
| 229 | if (size & (tile_height * stride - 1)) | ||
| 230 | return false; | ||
| 231 | |||
| 218 | /* 965+ just needs multiples of tile width */ | 232 | /* 965+ just needs multiples of tile width */ |
| 219 | if (INTEL_INFO(dev)->gen >= 4) { | 233 | if (INTEL_INFO(dev)->gen >= 4) { |
| 220 | if (stride & (tile_width - 1)) | 234 | if (stride & (tile_width - 1)) |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 97f946dcc1aa..8a9e08bf1cf7 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
| @@ -316,6 +316,8 @@ static void i915_hotplug_work_func(struct work_struct *work) | |||
| 316 | struct drm_mode_config *mode_config = &dev->mode_config; | 316 | struct drm_mode_config *mode_config = &dev->mode_config; |
| 317 | struct intel_encoder *encoder; | 317 | struct intel_encoder *encoder; |
| 318 | 318 | ||
| 319 | DRM_DEBUG_KMS("running encoder hotplug functions\n"); | ||
| 320 | |||
| 319 | list_for_each_entry(encoder, &mode_config->encoder_list, base.head) | 321 | list_for_each_entry(encoder, &mode_config->encoder_list, base.head) |
| 320 | if (encoder->hot_plug) | 322 | if (encoder->hot_plug) |
| 321 | encoder->hot_plug(encoder); | 323 | encoder->hot_plug(encoder); |
| @@ -1649,9 +1651,7 @@ static int ironlake_irq_postinstall(struct drm_device *dev) | |||
| 1649 | } else { | 1651 | } else { |
| 1650 | hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | | 1652 | hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | |
| 1651 | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; | 1653 | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; |
| 1652 | hotplug_mask |= SDE_AUX_MASK | SDE_FDI_MASK | SDE_TRANS_MASK; | 1654 | hotplug_mask |= SDE_AUX_MASK; |
| 1653 | I915_WRITE(FDI_RXA_IMR, 0); | ||
| 1654 | I915_WRITE(FDI_RXB_IMR, 0); | ||
| 1655 | } | 1655 | } |
| 1656 | 1656 | ||
| 1657 | dev_priv->pch_irq_mask = ~hotplug_mask; | 1657 | dev_priv->pch_irq_mask = ~hotplug_mask; |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 15d94c63918c..729d4233b763 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -1553,17 +1553,7 @@ | |||
| 1553 | 1553 | ||
| 1554 | /* Backlight control */ | 1554 | /* Backlight control */ |
| 1555 | #define BLC_PWM_CTL 0x61254 | 1555 | #define BLC_PWM_CTL 0x61254 |
| 1556 | #define BACKLIGHT_MODULATION_FREQ_SHIFT (17) | ||
| 1557 | #define BLC_PWM_CTL2 0x61250 /* 965+ only */ | 1556 | #define BLC_PWM_CTL2 0x61250 /* 965+ only */ |
| 1558 | #define BLM_COMBINATION_MODE (1 << 30) | ||
| 1559 | /* | ||
| 1560 | * This is the most significant 15 bits of the number of backlight cycles in a | ||
| 1561 | * complete cycle of the modulated backlight control. | ||
| 1562 | * | ||
| 1563 | * The actual value is this field multiplied by two. | ||
| 1564 | */ | ||
| 1565 | #define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17) | ||
| 1566 | #define BLM_LEGACY_MODE (1 << 16) | ||
| 1567 | /* | 1557 | /* |
| 1568 | * This is the number of cycles out of the backlight modulation cycle for which | 1558 | * This is the number of cycles out of the backlight modulation cycle for which |
| 1569 | * the backlight is on. | 1559 | * the backlight is on. |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3b006536b3d2..e79b25bbee6c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -1630,19 +1630,19 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
| 1630 | struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj; | 1630 | struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj; |
| 1631 | 1631 | ||
| 1632 | wait_event(dev_priv->pending_flip_queue, | 1632 | wait_event(dev_priv->pending_flip_queue, |
| 1633 | atomic_read(&dev_priv->mm.wedged) || | ||
| 1633 | atomic_read(&obj->pending_flip) == 0); | 1634 | atomic_read(&obj->pending_flip) == 0); |
| 1634 | 1635 | ||
| 1635 | /* Big Hammer, we also need to ensure that any pending | 1636 | /* Big Hammer, we also need to ensure that any pending |
| 1636 | * MI_WAIT_FOR_EVENT inside a user batch buffer on the | 1637 | * MI_WAIT_FOR_EVENT inside a user batch buffer on the |
| 1637 | * current scanout is retired before unpinning the old | 1638 | * current scanout is retired before unpinning the old |
| 1638 | * framebuffer. | 1639 | * framebuffer. |
| 1640 | * | ||
| 1641 | * This should only fail upon a hung GPU, in which case we | ||
| 1642 | * can safely continue. | ||
| 1639 | */ | 1643 | */ |
| 1640 | ret = i915_gem_object_flush_gpu(obj, false); | 1644 | ret = i915_gem_object_flush_gpu(obj, false); |
| 1641 | if (ret) { | 1645 | (void) ret; |
| 1642 | i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj); | ||
| 1643 | mutex_unlock(&dev->struct_mutex); | ||
| 1644 | return ret; | ||
| 1645 | } | ||
| 1646 | } | 1646 | } |
| 1647 | 1647 | ||
| 1648 | ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y, | 1648 | ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y, |
| @@ -2045,6 +2045,31 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) | |||
| 2045 | atomic_read(&obj->pending_flip) == 0); | 2045 | atomic_read(&obj->pending_flip) == 0); |
| 2046 | } | 2046 | } |
| 2047 | 2047 | ||
| 2048 | static bool intel_crtc_driving_pch(struct drm_crtc *crtc) | ||
| 2049 | { | ||
| 2050 | struct drm_device *dev = crtc->dev; | ||
| 2051 | struct drm_mode_config *mode_config = &dev->mode_config; | ||
| 2052 | struct intel_encoder *encoder; | ||
| 2053 | |||
| 2054 | /* | ||
| 2055 | * If there's a non-PCH eDP on this crtc, it must be DP_A, and that | ||
| 2056 | * must be driven by its own crtc; no sharing is possible. | ||
| 2057 | */ | ||
| 2058 | list_for_each_entry(encoder, &mode_config->encoder_list, base.head) { | ||
| 2059 | if (encoder->base.crtc != crtc) | ||
| 2060 | continue; | ||
| 2061 | |||
| 2062 | switch (encoder->type) { | ||
| 2063 | case INTEL_OUTPUT_EDP: | ||
| 2064 | if (!intel_encoder_is_pch_edp(&encoder->base)) | ||
| 2065 | return false; | ||
| 2066 | continue; | ||
| 2067 | } | ||
| 2068 | } | ||
| 2069 | |||
| 2070 | return true; | ||
| 2071 | } | ||
| 2072 | |||
| 2048 | static void ironlake_crtc_enable(struct drm_crtc *crtc) | 2073 | static void ironlake_crtc_enable(struct drm_crtc *crtc) |
| 2049 | { | 2074 | { |
| 2050 | struct drm_device *dev = crtc->dev; | 2075 | struct drm_device *dev = crtc->dev; |
| @@ -2053,6 +2078,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) | |||
| 2053 | int pipe = intel_crtc->pipe; | 2078 | int pipe = intel_crtc->pipe; |
| 2054 | int plane = intel_crtc->plane; | 2079 | int plane = intel_crtc->plane; |
| 2055 | u32 reg, temp; | 2080 | u32 reg, temp; |
| 2081 | bool is_pch_port = false; | ||
| 2056 | 2082 | ||
| 2057 | if (intel_crtc->active) | 2083 | if (intel_crtc->active) |
| 2058 | return; | 2084 | return; |
| @@ -2066,7 +2092,56 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) | |||
| 2066 | I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN); | 2092 | I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN); |
| 2067 | } | 2093 | } |
| 2068 | 2094 | ||
| 2069 | ironlake_fdi_enable(crtc); | 2095 | is_pch_port = intel_crtc_driving_pch(crtc); |
| 2096 | |||
| 2097 | if (is_pch_port) | ||
| 2098 | ironlake_fdi_enable(crtc); | ||
| 2099 | else { | ||
| 2100 | /* disable CPU FDI tx and PCH FDI rx */ | ||
| 2101 | reg = FDI_TX_CTL(pipe); | ||
| 2102 | temp = I915_READ(reg); | ||
| 2103 | I915_WRITE(reg, temp & ~FDI_TX_ENABLE); | ||
| 2104 | POSTING_READ(reg); | ||
| 2105 | |||
| 2106 | reg = FDI_RX_CTL(pipe); | ||
| 2107 | temp = I915_READ(reg); | ||
| 2108 | temp &= ~(0x7 << 16); | ||
| 2109 | temp |= (I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK) << 11; | ||
| 2110 | I915_WRITE(reg, temp & ~FDI_RX_ENABLE); | ||
| 2111 | |||
| 2112 | POSTING_READ(reg); | ||
| 2113 | udelay(100); | ||
| 2114 | |||
| 2115 | /* Ironlake workaround, disable clock pointer after downing FDI */ | ||
| 2116 | if (HAS_PCH_IBX(dev)) | ||
| 2117 | I915_WRITE(FDI_RX_CHICKEN(pipe), | ||
| 2118 | I915_READ(FDI_RX_CHICKEN(pipe) & | ||
| 2119 | ~FDI_RX_PHASE_SYNC_POINTER_ENABLE)); | ||
| 2120 | |||
| 2121 | /* still set train pattern 1 */ | ||
| 2122 | reg = FDI_TX_CTL(pipe); | ||
| 2123 | temp = I915_READ(reg); | ||
| 2124 | temp &= ~FDI_LINK_TRAIN_NONE; | ||
| 2125 | temp |= FDI_LINK_TRAIN_PATTERN_1; | ||
| 2126 | I915_WRITE(reg, temp); | ||
| 2127 | |||
| 2128 | reg = FDI_RX_CTL(pipe); | ||
| 2129 | temp = I915_READ(reg); | ||
| 2130 | if (HAS_PCH_CPT(dev)) { | ||
| 2131 | temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT; | ||
| 2132 | temp |= FDI_LINK_TRAIN_PATTERN_1_CPT; | ||
| 2133 | } else { | ||
| 2134 | temp &= ~FDI_LINK_TRAIN_NONE; | ||
| 2135 | temp |= FDI_LINK_TRAIN_PATTERN_1; | ||
| 2136 | } | ||
| 2137 | /* BPC in FDI rx is consistent with that in PIPECONF */ | ||
| 2138 | temp &= ~(0x07 << 16); | ||
| 2139 | temp |= (I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK) << 11; | ||
| 2140 | I915_WRITE(reg, temp); | ||
| 2141 | |||
| 2142 | POSTING_READ(reg); | ||
| 2143 | udelay(100); | ||
| 2144 | } | ||
| 2070 | 2145 | ||
| 2071 | /* Enable panel fitting for LVDS */ | 2146 | /* Enable panel fitting for LVDS */ |
| 2072 | if (dev_priv->pch_pf_size && | 2147 | if (dev_priv->pch_pf_size && |
| @@ -2100,6 +2175,10 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) | |||
| 2100 | intel_flush_display_plane(dev, plane); | 2175 | intel_flush_display_plane(dev, plane); |
| 2101 | } | 2176 | } |
| 2102 | 2177 | ||
| 2178 | /* Skip the PCH stuff if possible */ | ||
| 2179 | if (!is_pch_port) | ||
| 2180 | goto done; | ||
| 2181 | |||
| 2103 | /* For PCH output, training FDI link */ | 2182 | /* For PCH output, training FDI link */ |
| 2104 | if (IS_GEN6(dev)) | 2183 | if (IS_GEN6(dev)) |
| 2105 | gen6_fdi_link_train(crtc); | 2184 | gen6_fdi_link_train(crtc); |
| @@ -2184,7 +2263,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) | |||
| 2184 | I915_WRITE(reg, temp | TRANS_ENABLE); | 2263 | I915_WRITE(reg, temp | TRANS_ENABLE); |
| 2185 | if (wait_for(I915_READ(reg) & TRANS_STATE_ENABLE, 100)) | 2264 | if (wait_for(I915_READ(reg) & TRANS_STATE_ENABLE, 100)) |
| 2186 | DRM_ERROR("failed to enable transcoder %d\n", pipe); | 2265 | DRM_ERROR("failed to enable transcoder %d\n", pipe); |
| 2187 | 2266 | done: | |
| 2188 | intel_crtc_load_lut(crtc); | 2267 | intel_crtc_load_lut(crtc); |
| 2189 | intel_update_fbc(dev); | 2268 | intel_update_fbc(dev); |
| 2190 | intel_crtc_update_cursor(crtc, true); | 2269 | intel_crtc_update_cursor(crtc, true); |
| @@ -6496,7 +6575,7 @@ static void ironlake_disable_rc6(struct drm_device *dev) | |||
| 6496 | POSTING_READ(RSTDBYCTL); | 6575 | POSTING_READ(RSTDBYCTL); |
| 6497 | } | 6576 | } |
| 6498 | 6577 | ||
| 6499 | ironlake_disable_rc6(dev); | 6578 | ironlake_teardown_rc6(dev); |
| 6500 | } | 6579 | } |
| 6501 | 6580 | ||
| 6502 | static int ironlake_setup_rc6(struct drm_device *dev) | 6581 | static int ironlake_setup_rc6(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index c65992df458d..d860abeda70f 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
| @@ -30,8 +30,6 @@ | |||
| 30 | 30 | ||
| 31 | #include "intel_drv.h" | 31 | #include "intel_drv.h" |
| 32 | 32 | ||
| 33 | #define PCI_LBPC 0xf4 /* legacy/combination backlight modes */ | ||
| 34 | |||
| 35 | void | 33 | void |
| 36 | intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, | 34 | intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, |
| 37 | struct drm_display_mode *adjusted_mode) | 35 | struct drm_display_mode *adjusted_mode) |
| @@ -112,19 +110,6 @@ done: | |||
| 112 | dev_priv->pch_pf_size = (width << 16) | height; | 110 | dev_priv->pch_pf_size = (width << 16) | height; |
| 113 | } | 111 | } |
| 114 | 112 | ||
| 115 | static int is_backlight_combination_mode(struct drm_device *dev) | ||
| 116 | { | ||
| 117 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 118 | |||
| 119 | if (INTEL_INFO(dev)->gen >= 4) | ||
| 120 | return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE; | ||
| 121 | |||
| 122 | if (IS_GEN2(dev)) | ||
| 123 | return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE; | ||
| 124 | |||
| 125 | return 0; | ||
| 126 | } | ||
| 127 | |||
| 128 | static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv) | 113 | static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv) |
| 129 | { | 114 | { |
| 130 | u32 val; | 115 | u32 val; |
| @@ -181,9 +166,6 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev) | |||
| 181 | if (INTEL_INFO(dev)->gen < 4) | 166 | if (INTEL_INFO(dev)->gen < 4) |
| 182 | max &= ~1; | 167 | max &= ~1; |
| 183 | } | 168 | } |
| 184 | |||
| 185 | if (is_backlight_combination_mode(dev)) | ||
| 186 | max *= 0xff; | ||
| 187 | } | 169 | } |
| 188 | 170 | ||
| 189 | DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max); | 171 | DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max); |
| @@ -201,15 +183,6 @@ u32 intel_panel_get_backlight(struct drm_device *dev) | |||
| 201 | val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; | 183 | val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK; |
| 202 | if (IS_PINEVIEW(dev)) | 184 | if (IS_PINEVIEW(dev)) |
| 203 | val >>= 1; | 185 | val >>= 1; |
| 204 | |||
| 205 | if (is_backlight_combination_mode(dev)){ | ||
| 206 | u8 lbpc; | ||
| 207 | |||
| 208 | val &= ~1; | ||
| 209 | pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc); | ||
| 210 | val *= lbpc; | ||
| 211 | val >>= 1; | ||
| 212 | } | ||
| 213 | } | 186 | } |
| 214 | 187 | ||
| 215 | DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); | 188 | DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); |
| @@ -232,16 +205,6 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level) | |||
| 232 | 205 | ||
| 233 | if (HAS_PCH_SPLIT(dev)) | 206 | if (HAS_PCH_SPLIT(dev)) |
| 234 | return intel_pch_panel_set_backlight(dev, level); | 207 | return intel_pch_panel_set_backlight(dev, level); |
| 235 | |||
| 236 | if (is_backlight_combination_mode(dev)){ | ||
| 237 | u32 max = intel_panel_get_max_backlight(dev); | ||
| 238 | u8 lpbc; | ||
| 239 | |||
| 240 | lpbc = level * 0xfe / max + 1; | ||
| 241 | level /= lpbc; | ||
| 242 | pci_write_config_byte(dev->pdev, PCI_LBPC, lpbc); | ||
| 243 | } | ||
| 244 | |||
| 245 | tmp = I915_READ(BLC_PWM_CTL); | 208 | tmp = I915_READ(BLC_PWM_CTL); |
| 246 | if (IS_PINEVIEW(dev)) { | 209 | if (IS_PINEVIEW(dev)) { |
| 247 | tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); | 210 | tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 49e5e99917e2..6bdab891c64e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
| @@ -6228,7 +6228,7 @@ parse_dcb15_entry(struct drm_device *dev, struct dcb_table *dcb, | |||
| 6228 | entry->tvconf.has_component_output = false; | 6228 | entry->tvconf.has_component_output = false; |
| 6229 | break; | 6229 | break; |
| 6230 | case OUTPUT_LVDS: | 6230 | case OUTPUT_LVDS: |
| 6231 | if ((conn & 0x00003f00) != 0x10) | 6231 | if ((conn & 0x00003f00) >> 8 != 0x10) |
| 6232 | entry->lvdsconf.use_straps_for_mode = true; | 6232 | entry->lvdsconf.use_straps_for_mode = true; |
| 6233 | entry->lvdsconf.use_power_scripts = true; | 6233 | entry->lvdsconf.use_power_scripts = true; |
| 6234 | break; | 6234 | break; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index a7fae26f4654..a52184007f5f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
| @@ -49,7 +49,10 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo) | |||
| 49 | DRM_ERROR("bo %p still attached to GEM object\n", bo); | 49 | DRM_ERROR("bo %p still attached to GEM object\n", bo); |
| 50 | 50 | ||
| 51 | nv10_mem_put_tile_region(dev, nvbo->tile, NULL); | 51 | nv10_mem_put_tile_region(dev, nvbo->tile, NULL); |
| 52 | nouveau_vm_put(&nvbo->vma); | 52 | if (nvbo->vma.node) { |
| 53 | nouveau_vm_unmap(&nvbo->vma); | ||
| 54 | nouveau_vm_put(&nvbo->vma); | ||
| 55 | } | ||
| 53 | kfree(nvbo); | 56 | kfree(nvbo); |
| 54 | } | 57 | } |
| 55 | 58 | ||
| @@ -128,6 +131,7 @@ nouveau_bo_new(struct drm_device *dev, struct nouveau_channel *chan, | |||
| 128 | } | 131 | } |
| 129 | } | 132 | } |
| 130 | 133 | ||
| 134 | nvbo->bo.mem.num_pages = size >> PAGE_SHIFT; | ||
| 131 | nouveau_bo_placement_set(nvbo, flags, 0); | 135 | nouveau_bo_placement_set(nvbo, flags, 0); |
| 132 | 136 | ||
| 133 | nvbo->channel = chan; | 137 | nvbo->channel = chan; |
| @@ -166,17 +170,17 @@ static void | |||
| 166 | set_placement_range(struct nouveau_bo *nvbo, uint32_t type) | 170 | set_placement_range(struct nouveau_bo *nvbo, uint32_t type) |
| 167 | { | 171 | { |
| 168 | struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev); | 172 | struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev); |
| 173 | int vram_pages = dev_priv->vram_size >> PAGE_SHIFT; | ||
| 169 | 174 | ||
| 170 | if (dev_priv->card_type == NV_10 && | 175 | if (dev_priv->card_type == NV_10 && |
| 171 | nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM)) { | 176 | nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM) && |
| 177 | nvbo->bo.mem.num_pages < vram_pages / 2) { | ||
| 172 | /* | 178 | /* |
| 173 | * Make sure that the color and depth buffers are handled | 179 | * Make sure that the color and depth buffers are handled |
| 174 | * by independent memory controller units. Up to a 9x | 180 | * by independent memory controller units. Up to a 9x |
| 175 | * speed up when alpha-blending and depth-test are enabled | 181 | * speed up when alpha-blending and depth-test are enabled |
| 176 | * at the same time. | 182 | * at the same time. |
| 177 | */ | 183 | */ |
| 178 | int vram_pages = dev_priv->vram_size >> PAGE_SHIFT; | ||
| 179 | |||
| 180 | if (nvbo->tile_flags & NOUVEAU_GEM_TILE_ZETA) { | 184 | if (nvbo->tile_flags & NOUVEAU_GEM_TILE_ZETA) { |
| 181 | nvbo->placement.fpfn = vram_pages / 2; | 185 | nvbo->placement.fpfn = vram_pages / 2; |
| 182 | nvbo->placement.lpfn = ~0; | 186 | nvbo->placement.lpfn = ~0; |
| @@ -785,7 +789,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr, | |||
| 785 | if (ret) | 789 | if (ret) |
| 786 | goto out; | 790 | goto out; |
| 787 | 791 | ||
| 788 | ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); | 792 | ret = ttm_bo_move_ttm(bo, true, no_wait_reserve, no_wait_gpu, new_mem); |
| 789 | out: | 793 | out: |
| 790 | ttm_bo_mem_put(bo, &tmp_mem); | 794 | ttm_bo_mem_put(bo, &tmp_mem); |
| 791 | return ret; | 795 | return ret; |
| @@ -811,11 +815,11 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr, | |||
| 811 | if (ret) | 815 | if (ret) |
| 812 | return ret; | 816 | return ret; |
| 813 | 817 | ||
| 814 | ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, &tmp_mem); | 818 | ret = ttm_bo_move_ttm(bo, true, no_wait_reserve, no_wait_gpu, &tmp_mem); |
| 815 | if (ret) | 819 | if (ret) |
| 816 | goto out; | 820 | goto out; |
| 817 | 821 | ||
| 818 | ret = nouveau_bo_move_m2mf(bo, evict, intr, no_wait_reserve, no_wait_gpu, new_mem); | 822 | ret = nouveau_bo_move_m2mf(bo, true, intr, no_wait_reserve, no_wait_gpu, new_mem); |
| 819 | if (ret) | 823 | if (ret) |
| 820 | goto out; | 824 | goto out; |
| 821 | 825 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index a21e00076839..390d82c3c4b0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c | |||
| @@ -507,6 +507,7 @@ nouveau_connector_native_mode(struct drm_connector *connector) | |||
| 507 | int high_w = 0, high_h = 0, high_v = 0; | 507 | int high_w = 0, high_h = 0, high_v = 0; |
| 508 | 508 | ||
| 509 | list_for_each_entry(mode, &nv_connector->base.probed_modes, head) { | 509 | list_for_each_entry(mode, &nv_connector->base.probed_modes, head) { |
| 510 | mode->vrefresh = drm_mode_vrefresh(mode); | ||
| 510 | if (helper->mode_valid(connector, mode) != MODE_OK || | 511 | if (helper->mode_valid(connector, mode) != MODE_OK || |
| 511 | (mode->flags & DRM_MODE_FLAG_INTERLACE)) | 512 | (mode->flags & DRM_MODE_FLAG_INTERLACE)) |
| 512 | continue; | 513 | continue; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index f05c0cddfeca..4399e2f34db4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c | |||
| @@ -543,7 +543,7 @@ nouveau_pm_resume(struct drm_device *dev) | |||
| 543 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 543 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
| 544 | struct nouveau_pm_level *perflvl; | 544 | struct nouveau_pm_level *perflvl; |
| 545 | 545 | ||
| 546 | if (pm->cur == &pm->boot) | 546 | if (!pm->cur || pm->cur == &pm->boot) |
| 547 | return; | 547 | return; |
| 548 | 548 | ||
| 549 | perflvl = pm->cur; | 549 | perflvl = pm->cur; |
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c index ef23550407b5..c82db37d9f41 100644 --- a/drivers/gpu/drm/nouveau/nv04_dfp.c +++ b/drivers/gpu/drm/nouveau/nv04_dfp.c | |||
| @@ -342,8 +342,8 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder, | |||
| 342 | if (nv_encoder->dcb->type == OUTPUT_LVDS) { | 342 | if (nv_encoder->dcb->type == OUTPUT_LVDS) { |
| 343 | bool duallink, dummy; | 343 | bool duallink, dummy; |
| 344 | 344 | ||
| 345 | nouveau_bios_parse_lvds_table(dev, nv_connector->native_mode-> | 345 | nouveau_bios_parse_lvds_table(dev, output_mode->clock, |
| 346 | clock, &duallink, &dummy); | 346 | &duallink, &dummy); |
| 347 | if (duallink) | 347 | if (duallink) |
| 348 | regp->fp_control |= (8 << 28); | 348 | regp->fp_control |= (8 << 28); |
| 349 | } else | 349 | } else |
| @@ -518,8 +518,6 @@ static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 518 | return; | 518 | return; |
| 519 | 519 | ||
| 520 | if (nv_encoder->dcb->lvdsconf.use_power_scripts) { | 520 | if (nv_encoder->dcb->lvdsconf.use_power_scripts) { |
| 521 | struct nouveau_connector *nv_connector = nouveau_encoder_connector_get(nv_encoder); | ||
| 522 | |||
| 523 | /* when removing an output, crtc may not be set, but PANEL_OFF | 521 | /* when removing an output, crtc may not be set, but PANEL_OFF |
| 524 | * must still be run | 522 | * must still be run |
| 525 | */ | 523 | */ |
| @@ -527,12 +525,8 @@ static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 527 | nv04_dfp_get_bound_head(dev, nv_encoder->dcb); | 525 | nv04_dfp_get_bound_head(dev, nv_encoder->dcb); |
| 528 | 526 | ||
| 529 | if (mode == DRM_MODE_DPMS_ON) { | 527 | if (mode == DRM_MODE_DPMS_ON) { |
| 530 | if (!nv_connector->native_mode) { | ||
| 531 | NV_ERROR(dev, "Not turning on LVDS without native mode\n"); | ||
| 532 | return; | ||
| 533 | } | ||
| 534 | call_lvds_script(dev, nv_encoder->dcb, head, | 528 | call_lvds_script(dev, nv_encoder->dcb, head, |
| 535 | LVDS_PANEL_ON, nv_connector->native_mode->clock); | 529 | LVDS_PANEL_ON, nv_encoder->mode.clock); |
| 536 | } else | 530 | } else |
| 537 | /* pxclk of 0 is fine for PANEL_OFF, and for a | 531 | /* pxclk of 0 is fine for PANEL_OFF, and for a |
| 538 | * disconnected LVDS encoder there is no native_mode | 532 | * disconnected LVDS encoder there is no native_mode |
diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c b/drivers/gpu/drm/nouveau/nv40_graph.c index 8870d72388c8..18d30c2c1aa6 100644 --- a/drivers/gpu/drm/nouveau/nv40_graph.c +++ b/drivers/gpu/drm/nouveau/nv40_graph.c | |||
| @@ -211,18 +211,32 @@ nv40_graph_set_tile_region(struct drm_device *dev, int i) | |||
| 211 | struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; | 211 | struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; |
| 212 | 212 | ||
| 213 | switch (dev_priv->chipset) { | 213 | switch (dev_priv->chipset) { |
| 214 | case 0x40: | ||
| 215 | case 0x41: /* guess */ | ||
| 216 | case 0x42: | ||
| 217 | case 0x43: | ||
| 218 | case 0x45: /* guess */ | ||
| 219 | case 0x4e: | ||
| 220 | nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); | ||
| 221 | nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); | ||
| 222 | nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); | ||
| 223 | nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); | ||
| 224 | nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); | ||
| 225 | nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); | ||
| 226 | break; | ||
| 214 | case 0x44: | 227 | case 0x44: |
| 215 | case 0x4a: | 228 | case 0x4a: |
| 216 | case 0x4e: | ||
| 217 | nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); | 229 | nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); |
| 218 | nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); | 230 | nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); |
| 219 | nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); | 231 | nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); |
| 220 | break; | 232 | break; |
| 221 | |||
| 222 | case 0x46: | 233 | case 0x46: |
| 223 | case 0x47: | 234 | case 0x47: |
| 224 | case 0x49: | 235 | case 0x49: |
| 225 | case 0x4b: | 236 | case 0x4b: |
| 237 | case 0x4c: | ||
| 238 | case 0x67: | ||
| 239 | default: | ||
| 226 | nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch); | 240 | nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch); |
| 227 | nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit); | 241 | nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit); |
| 228 | nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr); | 242 | nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr); |
| @@ -230,15 +244,6 @@ nv40_graph_set_tile_region(struct drm_device *dev, int i) | |||
| 230 | nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); | 244 | nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); |
| 231 | nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); | 245 | nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); |
| 232 | break; | 246 | break; |
| 233 | |||
| 234 | default: | ||
| 235 | nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); | ||
| 236 | nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); | ||
| 237 | nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); | ||
| 238 | nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch); | ||
| 239 | nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit); | ||
| 240 | nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr); | ||
| 241 | break; | ||
| 242 | } | 247 | } |
| 243 | } | 248 | } |
| 244 | 249 | ||
| @@ -396,17 +401,20 @@ nv40_graph_init(struct drm_device *dev) | |||
| 396 | break; | 401 | break; |
| 397 | default: | 402 | default: |
| 398 | switch (dev_priv->chipset) { | 403 | switch (dev_priv->chipset) { |
| 399 | case 0x46: | 404 | case 0x41: |
| 400 | case 0x47: | 405 | case 0x42: |
| 401 | case 0x49: | 406 | case 0x43: |
| 402 | case 0x4b: | 407 | case 0x45: |
| 403 | nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0)); | 408 | case 0x4e: |
| 404 | nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1)); | 409 | case 0x44: |
| 405 | break; | 410 | case 0x4a: |
| 406 | default: | ||
| 407 | nv_wr32(dev, 0x4009F0, nv_rd32(dev, NV04_PFB_CFG0)); | 411 | nv_wr32(dev, 0x4009F0, nv_rd32(dev, NV04_PFB_CFG0)); |
| 408 | nv_wr32(dev, 0x4009F4, nv_rd32(dev, NV04_PFB_CFG1)); | 412 | nv_wr32(dev, 0x4009F4, nv_rd32(dev, NV04_PFB_CFG1)); |
| 409 | break; | 413 | break; |
| 414 | default: | ||
| 415 | nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0)); | ||
| 416 | nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1)); | ||
| 417 | break; | ||
| 410 | } | 418 | } |
| 411 | nv_wr32(dev, 0x4069F0, nv_rd32(dev, NV04_PFB_CFG0)); | 419 | nv_wr32(dev, 0x4069F0, nv_rd32(dev, NV04_PFB_CFG0)); |
| 412 | nv_wr32(dev, 0x4069F4, nv_rd32(dev, NV04_PFB_CFG1)); | 420 | nv_wr32(dev, 0x4069F4, nv_rd32(dev, NV04_PFB_CFG1)); |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 095bc507fb16..a4e5e53e0a62 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -557,9 +557,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 557 | 557 | ||
| 558 | /* use recommended ref_div for ss */ | 558 | /* use recommended ref_div for ss */ |
| 559 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { | 559 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
| 560 | pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; | ||
| 561 | if (ss_enabled) { | 560 | if (ss_enabled) { |
| 562 | if (ss->refdiv) { | 561 | if (ss->refdiv) { |
| 562 | pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; | ||
| 563 | pll->flags |= RADEON_PLL_USE_REF_DIV; | 563 | pll->flags |= RADEON_PLL_USE_REF_DIV; |
| 564 | pll->reference_div = ss->refdiv; | 564 | pll->reference_div = ss->refdiv; |
| 565 | if (ASIC_IS_AVIVO(rdev)) | 565 | if (ASIC_IS_AVIVO(rdev)) |
| @@ -662,10 +662,12 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 662 | index, (uint32_t *)&args); | 662 | index, (uint32_t *)&args); |
| 663 | adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10; | 663 | adjusted_clock = le32_to_cpu(args.v3.sOutput.ulDispPllFreq) * 10; |
| 664 | if (args.v3.sOutput.ucRefDiv) { | 664 | if (args.v3.sOutput.ucRefDiv) { |
| 665 | pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; | ||
| 665 | pll->flags |= RADEON_PLL_USE_REF_DIV; | 666 | pll->flags |= RADEON_PLL_USE_REF_DIV; |
| 666 | pll->reference_div = args.v3.sOutput.ucRefDiv; | 667 | pll->reference_div = args.v3.sOutput.ucRefDiv; |
| 667 | } | 668 | } |
| 668 | if (args.v3.sOutput.ucPostDiv) { | 669 | if (args.v3.sOutput.ucPostDiv) { |
| 670 | pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; | ||
| 669 | pll->flags |= RADEON_PLL_USE_POST_DIV; | 671 | pll->flags |= RADEON_PLL_USE_POST_DIV; |
| 670 | pll->post_div = args.v3.sOutput.ucPostDiv; | 672 | pll->post_div = args.v3.sOutput.ucPostDiv; |
| 671 | } | 673 | } |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 56deae5bf02e..93fa735c8c1a 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -3490,7 +3490,7 @@ void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track | |||
| 3490 | track->num_texture = 16; | 3490 | track->num_texture = 16; |
| 3491 | track->maxy = 4096; | 3491 | track->maxy = 4096; |
| 3492 | track->separate_cube = 0; | 3492 | track->separate_cube = 0; |
| 3493 | track->aaresolve = true; | 3493 | track->aaresolve = false; |
| 3494 | track->aa.robj = NULL; | 3494 | track->aa.robj = NULL; |
| 3495 | } | 3495 | } |
| 3496 | 3496 | ||
| @@ -3801,8 +3801,6 @@ static int r100_startup(struct radeon_device *rdev) | |||
| 3801 | r100_mc_program(rdev); | 3801 | r100_mc_program(rdev); |
| 3802 | /* Resume clock */ | 3802 | /* Resume clock */ |
| 3803 | r100_clock_startup(rdev); | 3803 | r100_clock_startup(rdev); |
| 3804 | /* Initialize GPU configuration (# pipes, ...) */ | ||
| 3805 | // r100_gpu_init(rdev); | ||
| 3806 | /* Initialize GART (initialize after TTM so we can allocate | 3804 | /* Initialize GART (initialize after TTM so we can allocate |
| 3807 | * memory through TTM but finalize after TTM) */ | 3805 | * memory through TTM but finalize after TTM) */ |
| 3808 | r100_enable_bm(rdev); | 3806 | r100_enable_bm(rdev); |
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 768c60ee4ab6..069efa8c8ecf 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
| @@ -910,6 +910,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
| 910 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; | 910 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; |
| 911 | break; | 911 | break; |
| 912 | case R300_TX_FORMAT_X16: | 912 | case R300_TX_FORMAT_X16: |
| 913 | case R300_TX_FORMAT_FL_I16: | ||
| 913 | case R300_TX_FORMAT_Y8X8: | 914 | case R300_TX_FORMAT_Y8X8: |
| 914 | case R300_TX_FORMAT_Z5Y6X5: | 915 | case R300_TX_FORMAT_Z5Y6X5: |
| 915 | case R300_TX_FORMAT_Z6Y5X5: | 916 | case R300_TX_FORMAT_Z6Y5X5: |
| @@ -922,6 +923,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
| 922 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; | 923 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; |
| 923 | break; | 924 | break; |
| 924 | case R300_TX_FORMAT_Y16X16: | 925 | case R300_TX_FORMAT_Y16X16: |
| 926 | case R300_TX_FORMAT_FL_I16A16: | ||
| 925 | case R300_TX_FORMAT_Z11Y11X10: | 927 | case R300_TX_FORMAT_Z11Y11X10: |
| 926 | case R300_TX_FORMAT_Z10Y11X11: | 928 | case R300_TX_FORMAT_Z10Y11X11: |
| 927 | case R300_TX_FORMAT_W8Z8Y8X8: | 929 | case R300_TX_FORMAT_W8Z8Y8X8: |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 0e657095de7c..3e7e7f9eb781 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
| @@ -971,7 +971,7 @@ void radeon_compute_pll_legacy(struct radeon_pll *pll, | |||
| 971 | max_fractional_feed_div = pll->max_frac_feedback_div; | 971 | max_fractional_feed_div = pll->max_frac_feedback_div; |
| 972 | } | 972 | } |
| 973 | 973 | ||
| 974 | for (post_div = min_post_div; post_div <= max_post_div; ++post_div) { | 974 | for (post_div = max_post_div; post_div >= min_post_div; --post_div) { |
| 975 | uint32_t ref_div; | 975 | uint32_t ref_div; |
| 976 | 976 | ||
| 977 | if ((pll->flags & RADEON_PLL_NO_ODD_POST_DIV) && (post_div & 1)) | 977 | if ((pll->flags & RADEON_PLL_NO_ODD_POST_DIV) && (post_div & 1)) |
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 66324b5bb5ba..cc44bdfec80f 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c | |||
| @@ -113,11 +113,14 @@ static int radeonfb_create_pinned_object(struct radeon_fbdev *rfbdev, | |||
| 113 | u32 tiling_flags = 0; | 113 | u32 tiling_flags = 0; |
| 114 | int ret; | 114 | int ret; |
| 115 | int aligned_size, size; | 115 | int aligned_size, size; |
| 116 | int height = mode_cmd->height; | ||
| 116 | 117 | ||
| 117 | /* need to align pitch with crtc limits */ | 118 | /* need to align pitch with crtc limits */ |
| 118 | mode_cmd->pitch = radeon_align_pitch(rdev, mode_cmd->width, mode_cmd->bpp, fb_tiled) * ((mode_cmd->bpp + 1) / 8); | 119 | mode_cmd->pitch = radeon_align_pitch(rdev, mode_cmd->width, mode_cmd->bpp, fb_tiled) * ((mode_cmd->bpp + 1) / 8); |
| 119 | 120 | ||
| 120 | size = mode_cmd->pitch * mode_cmd->height; | 121 | if (rdev->family >= CHIP_R600) |
| 122 | height = ALIGN(mode_cmd->height, 8); | ||
| 123 | size = mode_cmd->pitch * height; | ||
| 121 | aligned_size = ALIGN(size, PAGE_SIZE); | 124 | aligned_size = ALIGN(size, PAGE_SIZE); |
| 122 | ret = radeon_gem_object_create(rdev, aligned_size, 0, | 125 | ret = radeon_gem_object_create(rdev, aligned_size, 0, |
| 123 | RADEON_GEM_DOMAIN_VRAM, | 126 | RADEON_GEM_DOMAIN_VRAM, |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 773e484f1646..297bc9a7d6e6 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
| @@ -238,13 +238,13 @@ config SENSORS_K8TEMP | |||
| 238 | will be called k8temp. | 238 | will be called k8temp. |
| 239 | 239 | ||
| 240 | config SENSORS_K10TEMP | 240 | config SENSORS_K10TEMP |
| 241 | tristate "AMD Phenom/Sempron/Turion/Opteron temperature sensor" | 241 | tristate "AMD Family 10h/11h/12h/14h temperature sensor" |
| 242 | depends on X86 && PCI | 242 | depends on X86 && PCI |
| 243 | help | 243 | help |
| 244 | If you say yes here you get support for the temperature | 244 | If you say yes here you get support for the temperature |
| 245 | sensor(s) inside your CPU. Supported are later revisions of | 245 | sensor(s) inside your CPU. Supported are later revisions of |
| 246 | the AMD Family 10h and all revisions of the AMD Family 11h | 246 | the AMD Family 10h and all revisions of the AMD Family 11h, |
| 247 | microarchitectures. | 247 | 12h (Llano), and 14h (Brazos) microarchitectures. |
| 248 | 248 | ||
| 249 | This driver can also be built as a module. If so, the module | 249 | This driver can also be built as a module. If so, the module |
| 250 | will be called k10temp. | 250 | will be called k10temp. |
| @@ -455,13 +455,14 @@ config SENSORS_JZ4740 | |||
| 455 | called jz4740-hwmon. | 455 | called jz4740-hwmon. |
| 456 | 456 | ||
| 457 | config SENSORS_JC42 | 457 | config SENSORS_JC42 |
| 458 | tristate "JEDEC JC42.4 compliant temperature sensors" | 458 | tristate "JEDEC JC42.4 compliant memory module temperature sensors" |
| 459 | depends on I2C | 459 | depends on I2C |
| 460 | help | 460 | help |
| 461 | If you say yes here you get support for Jedec JC42.4 compliant | 461 | If you say yes here, you get support for JEDEC JC42.4 compliant |
| 462 | temperature sensors. Support will include, but not be limited to, | 462 | temperature sensors, which are used on many DDR3 memory modules for |
| 463 | ADT7408, CAT34TS02,, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243, | 463 | mobile devices and servers. Support will include, but not be limited |
| 464 | MCP9843, SE97, SE98, STTS424, TSE2002B3, and TS3000B3. | 464 | to, ADT7408, CAT34TS02, CAT6095, MAX6604, MCP9805, MCP98242, MCP98243, |
| 465 | MCP9843, SE97, SE98, STTS424(E), TSE2002B3, and TS3000B3. | ||
| 465 | 466 | ||
| 466 | This driver can also be built as a module. If so, the module | 467 | This driver can also be built as a module. If so, the module |
| 467 | will be called jc42. | 468 | will be called jc42. |
| @@ -574,7 +575,7 @@ config SENSORS_LM85 | |||
| 574 | help | 575 | help |
| 575 | If you say yes here you get support for National Semiconductor LM85 | 576 | If you say yes here you get support for National Semiconductor LM85 |
| 576 | sensor chips and clones: ADM1027, ADT7463, ADT7468, EMC6D100, | 577 | sensor chips and clones: ADM1027, ADT7463, ADT7468, EMC6D100, |
| 577 | EMC6D101 and EMC6D102. | 578 | EMC6D101, EMC6D102, and EMC6D103. |
| 578 | 579 | ||
| 579 | This driver can also be built as a module. If so, the module | 580 | This driver can also be built as a module. If so, the module |
| 580 | will be called lm85. | 581 | will be called lm85. |
diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c index 86d822aa9bbf..d46c0c758ddf 100644 --- a/drivers/hwmon/ad7414.c +++ b/drivers/hwmon/ad7414.c | |||
| @@ -242,6 +242,7 @@ static const struct i2c_device_id ad7414_id[] = { | |||
| 242 | { "ad7414", 0 }, | 242 | { "ad7414", 0 }, |
| 243 | {} | 243 | {} |
| 244 | }; | 244 | }; |
| 245 | MODULE_DEVICE_TABLE(i2c, ad7414_id); | ||
| 245 | 246 | ||
| 246 | static struct i2c_driver ad7414_driver = { | 247 | static struct i2c_driver ad7414_driver = { |
| 247 | .driver = { | 248 | .driver = { |
diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c index f13c843a2964..5cc3e3784b42 100644 --- a/drivers/hwmon/adt7411.c +++ b/drivers/hwmon/adt7411.c | |||
| @@ -334,6 +334,7 @@ static const struct i2c_device_id adt7411_id[] = { | |||
| 334 | { "adt7411", 0 }, | 334 | { "adt7411", 0 }, |
| 335 | { } | 335 | { } |
| 336 | }; | 336 | }; |
| 337 | MODULE_DEVICE_TABLE(i2c, adt7411_id); | ||
| 337 | 338 | ||
| 338 | static struct i2c_driver adt7411_driver = { | 339 | static struct i2c_driver adt7411_driver = { |
| 339 | .driver = { | 340 | .driver = { |
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c index 340fc78c8dde..934991237061 100644 --- a/drivers/hwmon/jc42.c +++ b/drivers/hwmon/jc42.c | |||
| @@ -53,6 +53,8 @@ static const unsigned short normal_i2c[] = { | |||
| 53 | 53 | ||
| 54 | /* Configuration register defines */ | 54 | /* Configuration register defines */ |
| 55 | #define JC42_CFG_CRIT_ONLY (1 << 2) | 55 | #define JC42_CFG_CRIT_ONLY (1 << 2) |
| 56 | #define JC42_CFG_TCRIT_LOCK (1 << 6) | ||
| 57 | #define JC42_CFG_EVENT_LOCK (1 << 7) | ||
| 56 | #define JC42_CFG_SHUTDOWN (1 << 8) | 58 | #define JC42_CFG_SHUTDOWN (1 << 8) |
| 57 | #define JC42_CFG_HYST_SHIFT 9 | 59 | #define JC42_CFG_HYST_SHIFT 9 |
| 58 | #define JC42_CFG_HYST_MASK 0x03 | 60 | #define JC42_CFG_HYST_MASK 0x03 |
| @@ -332,7 +334,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev, | |||
| 332 | { | 334 | { |
| 333 | struct i2c_client *client = to_i2c_client(dev); | 335 | struct i2c_client *client = to_i2c_client(dev); |
| 334 | struct jc42_data *data = i2c_get_clientdata(client); | 336 | struct jc42_data *data = i2c_get_clientdata(client); |
| 335 | long val; | 337 | unsigned long val; |
| 336 | int diff, hyst; | 338 | int diff, hyst; |
| 337 | int err; | 339 | int err; |
| 338 | int ret = count; | 340 | int ret = count; |
| @@ -380,14 +382,14 @@ static ssize_t show_alarm(struct device *dev, | |||
| 380 | 382 | ||
| 381 | static DEVICE_ATTR(temp1_input, S_IRUGO, | 383 | static DEVICE_ATTR(temp1_input, S_IRUGO, |
| 382 | show_temp_input, NULL); | 384 | show_temp_input, NULL); |
| 383 | static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO, | 385 | static DEVICE_ATTR(temp1_crit, S_IRUGO, |
| 384 | show_temp_crit, set_temp_crit); | 386 | show_temp_crit, set_temp_crit); |
| 385 | static DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO, | 387 | static DEVICE_ATTR(temp1_min, S_IRUGO, |
| 386 | show_temp_min, set_temp_min); | 388 | show_temp_min, set_temp_min); |
| 387 | static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, | 389 | static DEVICE_ATTR(temp1_max, S_IRUGO, |
| 388 | show_temp_max, set_temp_max); | 390 | show_temp_max, set_temp_max); |
| 389 | 391 | ||
| 390 | static DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO, | 392 | static DEVICE_ATTR(temp1_crit_hyst, S_IRUGO, |
| 391 | show_temp_crit_hyst, set_temp_crit_hyst); | 393 | show_temp_crit_hyst, set_temp_crit_hyst); |
| 392 | static DEVICE_ATTR(temp1_max_hyst, S_IRUGO, | 394 | static DEVICE_ATTR(temp1_max_hyst, S_IRUGO, |
| 393 | show_temp_max_hyst, NULL); | 395 | show_temp_max_hyst, NULL); |
| @@ -412,8 +414,31 @@ static struct attribute *jc42_attributes[] = { | |||
| 412 | NULL | 414 | NULL |
| 413 | }; | 415 | }; |
| 414 | 416 | ||
| 417 | static mode_t jc42_attribute_mode(struct kobject *kobj, | ||
| 418 | struct attribute *attr, int index) | ||
| 419 | { | ||
| 420 | struct device *dev = container_of(kobj, struct device, kobj); | ||
| 421 | struct i2c_client *client = to_i2c_client(dev); | ||
| 422 | struct jc42_data *data = i2c_get_clientdata(client); | ||
| 423 | unsigned int config = data->config; | ||
| 424 | bool readonly; | ||
| 425 | |||
| 426 | if (attr == &dev_attr_temp1_crit.attr) | ||
| 427 | readonly = config & JC42_CFG_TCRIT_LOCK; | ||
| 428 | else if (attr == &dev_attr_temp1_min.attr || | ||
| 429 | attr == &dev_attr_temp1_max.attr) | ||
| 430 | readonly = config & JC42_CFG_EVENT_LOCK; | ||
| 431 | else if (attr == &dev_attr_temp1_crit_hyst.attr) | ||
| 432 | readonly = config & (JC42_CFG_EVENT_LOCK | JC42_CFG_TCRIT_LOCK); | ||
| 433 | else | ||
| 434 | readonly = true; | ||
| 435 | |||
| 436 | return S_IRUGO | (readonly ? 0 : S_IWUSR); | ||
| 437 | } | ||
| 438 | |||
| 415 | static const struct attribute_group jc42_group = { | 439 | static const struct attribute_group jc42_group = { |
| 416 | .attrs = jc42_attributes, | 440 | .attrs = jc42_attributes, |
| 441 | .is_visible = jc42_attribute_mode, | ||
| 417 | }; | 442 | }; |
| 418 | 443 | ||
| 419 | /* Return 0 if detection is successful, -ENODEV otherwise */ | 444 | /* Return 0 if detection is successful, -ENODEV otherwise */ |
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index da5a2404cd3e..82bf65aa2968 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * k10temp.c - AMD Family 10h/11h processor hardware monitoring | 2 | * k10temp.c - AMD Family 10h/11h/12h/14h processor hardware monitoring |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2009 Clemens Ladisch <clemens@ladisch.de> | 4 | * Copyright (c) 2009 Clemens Ladisch <clemens@ladisch.de> |
| 5 | * | 5 | * |
| @@ -25,7 +25,7 @@ | |||
| 25 | #include <linux/pci.h> | 25 | #include <linux/pci.h> |
| 26 | #include <asm/processor.h> | 26 | #include <asm/processor.h> |
| 27 | 27 | ||
| 28 | MODULE_DESCRIPTION("AMD Family 10h/11h CPU core temperature monitor"); | 28 | MODULE_DESCRIPTION("AMD Family 10h/11h/12h/14h CPU core temperature monitor"); |
| 29 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); | 29 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
| 30 | MODULE_LICENSE("GPL"); | 30 | MODULE_LICENSE("GPL"); |
| 31 | 31 | ||
| @@ -208,6 +208,7 @@ static void __devexit k10temp_remove(struct pci_dev *pdev) | |||
| 208 | static const struct pci_device_id k10temp_id_table[] = { | 208 | static const struct pci_device_id k10temp_id_table[] = { |
| 209 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, | 209 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, |
| 210 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, | 210 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, |
| 211 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, | ||
| 211 | {} | 212 | {} |
| 212 | }; | 213 | }; |
| 213 | MODULE_DEVICE_TABLE(pci, k10temp_id_table); | 214 | MODULE_DEVICE_TABLE(pci, k10temp_id_table); |
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index 1e229847f37a..d2cc28660816 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c | |||
| @@ -41,7 +41,7 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; | |||
| 41 | enum chips { | 41 | enum chips { |
| 42 | any_chip, lm85b, lm85c, | 42 | any_chip, lm85b, lm85c, |
| 43 | adm1027, adt7463, adt7468, | 43 | adm1027, adt7463, adt7468, |
| 44 | emc6d100, emc6d102 | 44 | emc6d100, emc6d102, emc6d103 |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | /* The LM85 registers */ | 47 | /* The LM85 registers */ |
| @@ -90,6 +90,9 @@ enum chips { | |||
| 90 | #define LM85_VERSTEP_EMC6D100_A0 0x60 | 90 | #define LM85_VERSTEP_EMC6D100_A0 0x60 |
| 91 | #define LM85_VERSTEP_EMC6D100_A1 0x61 | 91 | #define LM85_VERSTEP_EMC6D100_A1 0x61 |
| 92 | #define LM85_VERSTEP_EMC6D102 0x65 | 92 | #define LM85_VERSTEP_EMC6D102 0x65 |
| 93 | #define LM85_VERSTEP_EMC6D103_A0 0x68 | ||
| 94 | #define LM85_VERSTEP_EMC6D103_A1 0x69 | ||
| 95 | #define LM85_VERSTEP_EMC6D103S 0x6A /* Also known as EMC6D103:A2 */ | ||
| 93 | 96 | ||
| 94 | #define LM85_REG_CONFIG 0x40 | 97 | #define LM85_REG_CONFIG 0x40 |
| 95 | 98 | ||
| @@ -348,6 +351,7 @@ static const struct i2c_device_id lm85_id[] = { | |||
| 348 | { "emc6d100", emc6d100 }, | 351 | { "emc6d100", emc6d100 }, |
| 349 | { "emc6d101", emc6d100 }, | 352 | { "emc6d101", emc6d100 }, |
| 350 | { "emc6d102", emc6d102 }, | 353 | { "emc6d102", emc6d102 }, |
| 354 | { "emc6d103", emc6d103 }, | ||
| 351 | { } | 355 | { } |
| 352 | }; | 356 | }; |
| 353 | MODULE_DEVICE_TABLE(i2c, lm85_id); | 357 | MODULE_DEVICE_TABLE(i2c, lm85_id); |
| @@ -1250,6 +1254,20 @@ static int lm85_detect(struct i2c_client *client, struct i2c_board_info *info) | |||
| 1250 | case LM85_VERSTEP_EMC6D102: | 1254 | case LM85_VERSTEP_EMC6D102: |
| 1251 | type_name = "emc6d102"; | 1255 | type_name = "emc6d102"; |
| 1252 | break; | 1256 | break; |
| 1257 | case LM85_VERSTEP_EMC6D103_A0: | ||
| 1258 | case LM85_VERSTEP_EMC6D103_A1: | ||
| 1259 | type_name = "emc6d103"; | ||
| 1260 | break; | ||
| 1261 | /* | ||
| 1262 | * Registers apparently missing in EMC6D103S/EMC6D103:A2 | ||
| 1263 | * compared to EMC6D103:A0, EMC6D103:A1, and EMC6D102 | ||
| 1264 | * (according to the data sheets), but used unconditionally | ||
| 1265 | * in the driver: 62[5:7], 6D[0:7], and 6E[0:7]. | ||
| 1266 | * So skip EMC6D103S for now. | ||
| 1267 | case LM85_VERSTEP_EMC6D103S: | ||
| 1268 | type_name = "emc6d103s"; | ||
| 1269 | break; | ||
| 1270 | */ | ||
| 1253 | } | 1271 | } |
| 1254 | } else { | 1272 | } else { |
| 1255 | dev_dbg(&adapter->dev, | 1273 | dev_dbg(&adapter->dev, |
| @@ -1283,6 +1301,7 @@ static int lm85_probe(struct i2c_client *client, | |||
| 1283 | case adt7468: | 1301 | case adt7468: |
| 1284 | case emc6d100: | 1302 | case emc6d100: |
| 1285 | case emc6d102: | 1303 | case emc6d102: |
| 1304 | case emc6d103: | ||
| 1286 | data->freq_map = adm1027_freq_map; | 1305 | data->freq_map = adm1027_freq_map; |
| 1287 | break; | 1306 | break; |
| 1288 | default: | 1307 | default: |
| @@ -1468,7 +1487,7 @@ static struct lm85_data *lm85_update_device(struct device *dev) | |||
| 1468 | /* More alarm bits */ | 1487 | /* More alarm bits */ |
| 1469 | data->alarms |= lm85_read_value(client, | 1488 | data->alarms |= lm85_read_value(client, |
| 1470 | EMC6D100_REG_ALARM3) << 16; | 1489 | EMC6D100_REG_ALARM3) << 16; |
| 1471 | } else if (data->type == emc6d102) { | 1490 | } else if (data->type == emc6d102 || data->type == emc6d103) { |
| 1472 | /* Have to read LSB bits after the MSB ones because | 1491 | /* Have to read LSB bits after the MSB ones because |
| 1473 | the reading of the MSB bits has frozen the | 1492 | the reading of the MSB bits has frozen the |
| 1474 | LSBs (backward from the ADM1027). | 1493 | LSBs (backward from the ADM1027). |
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index b605ff3a1fa0..829a2a1029f7 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
| @@ -847,11 +847,15 @@ complete: | |||
| 847 | dev_err(dev->dev, "Arbitration lost\n"); | 847 | dev_err(dev->dev, "Arbitration lost\n"); |
| 848 | err |= OMAP_I2C_STAT_AL; | 848 | err |= OMAP_I2C_STAT_AL; |
| 849 | } | 849 | } |
| 850 | /* | ||
| 851 | * ProDB0017052: Clear ARDY bit twice | ||
| 852 | */ | ||
| 850 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | | 853 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | |
| 851 | OMAP_I2C_STAT_AL)) { | 854 | OMAP_I2C_STAT_AL)) { |
| 852 | omap_i2c_ack_stat(dev, stat & | 855 | omap_i2c_ack_stat(dev, stat & |
| 853 | (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | | 856 | (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | |
| 854 | OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); | 857 | OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR | |
| 858 | OMAP_I2C_STAT_ARDY)); | ||
| 855 | omap_i2c_complete_cmd(dev, err); | 859 | omap_i2c_complete_cmd(dev, err); |
| 856 | return IRQ_HANDLED; | 860 | return IRQ_HANDLED; |
| 857 | } | 861 | } |
| @@ -1137,12 +1141,41 @@ omap_i2c_remove(struct platform_device *pdev) | |||
| 1137 | return 0; | 1141 | return 0; |
| 1138 | } | 1142 | } |
| 1139 | 1143 | ||
| 1144 | #ifdef CONFIG_SUSPEND | ||
| 1145 | static int omap_i2c_suspend(struct device *dev) | ||
| 1146 | { | ||
| 1147 | if (!pm_runtime_suspended(dev)) | ||
| 1148 | if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend) | ||
| 1149 | dev->bus->pm->runtime_suspend(dev); | ||
| 1150 | |||
| 1151 | return 0; | ||
| 1152 | } | ||
| 1153 | |||
| 1154 | static int omap_i2c_resume(struct device *dev) | ||
| 1155 | { | ||
| 1156 | if (!pm_runtime_suspended(dev)) | ||
| 1157 | if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_resume) | ||
| 1158 | dev->bus->pm->runtime_resume(dev); | ||
| 1159 | |||
| 1160 | return 0; | ||
| 1161 | } | ||
| 1162 | |||
| 1163 | static struct dev_pm_ops omap_i2c_pm_ops = { | ||
| 1164 | .suspend = omap_i2c_suspend, | ||
| 1165 | .resume = omap_i2c_resume, | ||
| 1166 | }; | ||
| 1167 | #define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops) | ||
| 1168 | #else | ||
| 1169 | #define OMAP_I2C_PM_OPS NULL | ||
| 1170 | #endif | ||
| 1171 | |||
| 1140 | static struct platform_driver omap_i2c_driver = { | 1172 | static struct platform_driver omap_i2c_driver = { |
| 1141 | .probe = omap_i2c_probe, | 1173 | .probe = omap_i2c_probe, |
| 1142 | .remove = omap_i2c_remove, | 1174 | .remove = omap_i2c_remove, |
| 1143 | .driver = { | 1175 | .driver = { |
| 1144 | .name = "omap_i2c", | 1176 | .name = "omap_i2c", |
| 1145 | .owner = THIS_MODULE, | 1177 | .owner = THIS_MODULE, |
| 1178 | .pm = OMAP_I2C_PM_OPS, | ||
| 1146 | }, | 1179 | }, |
| 1147 | }; | 1180 | }; |
| 1148 | 1181 | ||
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index 495be451d326..266135ddf7fa 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c | |||
| @@ -942,7 +942,7 @@ stu300_probe(struct platform_device *pdev) | |||
| 942 | adap->owner = THIS_MODULE; | 942 | adap->owner = THIS_MODULE; |
| 943 | /* DDC class but actually often used for more generic I2C */ | 943 | /* DDC class but actually often used for more generic I2C */ |
| 944 | adap->class = I2C_CLASS_DDC; | 944 | adap->class = I2C_CLASS_DDC; |
| 945 | strncpy(adap->name, "ST Microelectronics DDC I2C adapter", | 945 | strlcpy(adap->name, "ST Microelectronics DDC I2C adapter", |
| 946 | sizeof(adap->name)); | 946 | sizeof(adap->name)); |
| 947 | adap->nr = bus_nr; | 947 | adap->nr = bus_nr; |
| 948 | adap->algo = &stu300_algo; | 948 | adap->algo = &stu300_algo; |
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index 8b606fd64022..08c194861af5 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c | |||
| @@ -2610,9 +2610,11 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number) | |||
| 2610 | netif_carrier_on(nesvnic->netdev); | 2610 | netif_carrier_on(nesvnic->netdev); |
| 2611 | 2611 | ||
| 2612 | spin_lock(&nesvnic->port_ibevent_lock); | 2612 | spin_lock(&nesvnic->port_ibevent_lock); |
| 2613 | if (nesdev->iw_status == 0) { | 2613 | if (nesvnic->of_device_registered) { |
| 2614 | nesdev->iw_status = 1; | 2614 | if (nesdev->iw_status == 0) { |
| 2615 | nes_port_ibevent(nesvnic); | 2615 | nesdev->iw_status = 1; |
| 2616 | nes_port_ibevent(nesvnic); | ||
| 2617 | } | ||
| 2616 | } | 2618 | } |
| 2617 | spin_unlock(&nesvnic->port_ibevent_lock); | 2619 | spin_unlock(&nesvnic->port_ibevent_lock); |
| 2618 | } | 2620 | } |
| @@ -2642,9 +2644,11 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number) | |||
| 2642 | netif_carrier_off(nesvnic->netdev); | 2644 | netif_carrier_off(nesvnic->netdev); |
| 2643 | 2645 | ||
| 2644 | spin_lock(&nesvnic->port_ibevent_lock); | 2646 | spin_lock(&nesvnic->port_ibevent_lock); |
| 2645 | if (nesdev->iw_status == 1) { | 2647 | if (nesvnic->of_device_registered) { |
| 2646 | nesdev->iw_status = 0; | 2648 | if (nesdev->iw_status == 1) { |
| 2647 | nes_port_ibevent(nesvnic); | 2649 | nesdev->iw_status = 0; |
| 2650 | nes_port_ibevent(nesvnic); | ||
| 2651 | } | ||
| 2648 | } | 2652 | } |
| 2649 | spin_unlock(&nesvnic->port_ibevent_lock); | 2653 | spin_unlock(&nesvnic->port_ibevent_lock); |
| 2650 | } | 2654 | } |
| @@ -2703,9 +2707,11 @@ void nes_recheck_link_status(struct work_struct *work) | |||
| 2703 | netif_carrier_on(nesvnic->netdev); | 2707 | netif_carrier_on(nesvnic->netdev); |
| 2704 | 2708 | ||
| 2705 | spin_lock(&nesvnic->port_ibevent_lock); | 2709 | spin_lock(&nesvnic->port_ibevent_lock); |
| 2706 | if (nesdev->iw_status == 0) { | 2710 | if (nesvnic->of_device_registered) { |
| 2707 | nesdev->iw_status = 1; | 2711 | if (nesdev->iw_status == 0) { |
| 2708 | nes_port_ibevent(nesvnic); | 2712 | nesdev->iw_status = 1; |
| 2713 | nes_port_ibevent(nesvnic); | ||
| 2714 | } | ||
| 2709 | } | 2715 | } |
| 2710 | spin_unlock(&nesvnic->port_ibevent_lock); | 2716 | spin_unlock(&nesvnic->port_ibevent_lock); |
| 2711 | } | 2717 | } |
| @@ -2723,9 +2729,11 @@ void nes_recheck_link_status(struct work_struct *work) | |||
| 2723 | netif_carrier_off(nesvnic->netdev); | 2729 | netif_carrier_off(nesvnic->netdev); |
| 2724 | 2730 | ||
| 2725 | spin_lock(&nesvnic->port_ibevent_lock); | 2731 | spin_lock(&nesvnic->port_ibevent_lock); |
| 2726 | if (nesdev->iw_status == 1) { | 2732 | if (nesvnic->of_device_registered) { |
| 2727 | nesdev->iw_status = 0; | 2733 | if (nesdev->iw_status == 1) { |
| 2728 | nes_port_ibevent(nesvnic); | 2734 | nesdev->iw_status = 0; |
| 2735 | nes_port_ibevent(nesvnic); | ||
| 2736 | } | ||
| 2729 | } | 2737 | } |
| 2730 | spin_unlock(&nesvnic->port_ibevent_lock); | 2738 | spin_unlock(&nesvnic->port_ibevent_lock); |
| 2731 | } | 2739 | } |
diff --git a/drivers/infiniband/hw/qib/qib_rc.c b/drivers/infiniband/hw/qib/qib_rc.c index 8245237b67ce..eca0c41f1226 100644 --- a/drivers/infiniband/hw/qib/qib_rc.c +++ b/drivers/infiniband/hw/qib/qib_rc.c | |||
| @@ -1005,7 +1005,8 @@ void qib_rc_send_complete(struct qib_qp *qp, struct qib_ib_header *hdr) | |||
| 1005 | * there are still requests that haven't been acked. | 1005 | * there are still requests that haven't been acked. |
| 1006 | */ | 1006 | */ |
| 1007 | if ((psn & IB_BTH_REQ_ACK) && qp->s_acked != qp->s_tail && | 1007 | if ((psn & IB_BTH_REQ_ACK) && qp->s_acked != qp->s_tail && |
| 1008 | !(qp->s_flags & (QIB_S_TIMER | QIB_S_WAIT_RNR | QIB_S_WAIT_PSN))) | 1008 | !(qp->s_flags & (QIB_S_TIMER | QIB_S_WAIT_RNR | QIB_S_WAIT_PSN)) && |
| 1009 | (ib_qib_state_ops[qp->state] & QIB_PROCESS_RECV_OK)) | ||
| 1009 | start_timer(qp); | 1010 | start_timer(qp); |
| 1010 | 1011 | ||
| 1011 | while (qp->s_last != qp->s_acked) { | 1012 | while (qp->s_last != qp->s_acked) { |
| @@ -1439,6 +1440,8 @@ static void qib_rc_rcv_resp(struct qib_ibport *ibp, | |||
| 1439 | } | 1440 | } |
| 1440 | 1441 | ||
| 1441 | spin_lock_irqsave(&qp->s_lock, flags); | 1442 | spin_lock_irqsave(&qp->s_lock, flags); |
| 1443 | if (!(ib_qib_state_ops[qp->state] & QIB_PROCESS_RECV_OK)) | ||
| 1444 | goto ack_done; | ||
| 1442 | 1445 | ||
| 1443 | /* Ignore invalid responses. */ | 1446 | /* Ignore invalid responses. */ |
| 1444 | if (qib_cmp24(psn, qp->s_next_psn) >= 0) | 1447 | if (qib_cmp24(psn, qp->s_next_psn) >= 0) |
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index 23cf8fc933ec..5b8f59d6c3e8 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c | |||
| @@ -360,7 +360,7 @@ static int gameport_queue_event(void *object, struct module *owner, | |||
| 360 | event->owner = owner; | 360 | event->owner = owner; |
| 361 | 361 | ||
| 362 | list_add_tail(&event->node, &gameport_event_list); | 362 | list_add_tail(&event->node, &gameport_event_list); |
| 363 | schedule_work(&gameport_event_work); | 363 | queue_work(system_long_wq, &gameport_event_work); |
| 364 | 364 | ||
| 365 | out: | 365 | out: |
| 366 | spin_unlock_irqrestore(&gameport_event_lock, flags); | 366 | spin_unlock_irqrestore(&gameport_event_lock, flags); |
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index ac471b77c18e..99ce9032d08c 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c | |||
| @@ -71,8 +71,9 @@ struct tegra_kbc { | |||
| 71 | spinlock_t lock; | 71 | spinlock_t lock; |
| 72 | unsigned int repoll_dly; | 72 | unsigned int repoll_dly; |
| 73 | unsigned long cp_dly_jiffies; | 73 | unsigned long cp_dly_jiffies; |
| 74 | bool use_fn_map; | ||
| 74 | const struct tegra_kbc_platform_data *pdata; | 75 | const struct tegra_kbc_platform_data *pdata; |
| 75 | unsigned short keycode[KBC_MAX_KEY]; | 76 | unsigned short keycode[KBC_MAX_KEY * 2]; |
| 76 | unsigned short current_keys[KBC_MAX_KPENT]; | 77 | unsigned short current_keys[KBC_MAX_KPENT]; |
| 77 | unsigned int num_pressed_keys; | 78 | unsigned int num_pressed_keys; |
| 78 | struct timer_list timer; | 79 | struct timer_list timer; |
| @@ -178,6 +179,40 @@ static const u32 tegra_kbc_default_keymap[] = { | |||
| 178 | KEY(15, 5, KEY_F2), | 179 | KEY(15, 5, KEY_F2), |
| 179 | KEY(15, 6, KEY_CAPSLOCK), | 180 | KEY(15, 6, KEY_CAPSLOCK), |
| 180 | KEY(15, 7, KEY_F6), | 181 | KEY(15, 7, KEY_F6), |
| 182 | |||
| 183 | /* Software Handled Function Keys */ | ||
| 184 | KEY(20, 0, KEY_KP7), | ||
| 185 | |||
| 186 | KEY(21, 0, KEY_KP9), | ||
| 187 | KEY(21, 1, KEY_KP8), | ||
| 188 | KEY(21, 2, KEY_KP4), | ||
| 189 | KEY(21, 4, KEY_KP1), | ||
| 190 | |||
| 191 | KEY(22, 1, KEY_KPSLASH), | ||
| 192 | KEY(22, 2, KEY_KP6), | ||
| 193 | KEY(22, 3, KEY_KP5), | ||
| 194 | KEY(22, 4, KEY_KP3), | ||
| 195 | KEY(22, 5, KEY_KP2), | ||
| 196 | KEY(22, 7, KEY_KP0), | ||
| 197 | |||
| 198 | KEY(27, 1, KEY_KPASTERISK), | ||
| 199 | KEY(27, 3, KEY_KPMINUS), | ||
| 200 | KEY(27, 4, KEY_KPPLUS), | ||
| 201 | KEY(27, 5, KEY_KPDOT), | ||
| 202 | |||
| 203 | KEY(28, 5, KEY_VOLUMEUP), | ||
| 204 | |||
| 205 | KEY(29, 3, KEY_HOME), | ||
| 206 | KEY(29, 4, KEY_END), | ||
| 207 | KEY(29, 5, KEY_BRIGHTNESSDOWN), | ||
| 208 | KEY(29, 6, KEY_VOLUMEDOWN), | ||
| 209 | KEY(29, 7, KEY_BRIGHTNESSUP), | ||
| 210 | |||
| 211 | KEY(30, 0, KEY_NUMLOCK), | ||
| 212 | KEY(30, 1, KEY_SCROLLLOCK), | ||
| 213 | KEY(30, 2, KEY_MUTE), | ||
| 214 | |||
| 215 | KEY(31, 4, KEY_HELP), | ||
| 181 | }; | 216 | }; |
| 182 | 217 | ||
| 183 | static const struct matrix_keymap_data tegra_kbc_default_keymap_data = { | 218 | static const struct matrix_keymap_data tegra_kbc_default_keymap_data = { |
| @@ -224,6 +259,7 @@ static void tegra_kbc_report_keys(struct tegra_kbc *kbc) | |||
| 224 | unsigned int i; | 259 | unsigned int i; |
| 225 | unsigned int num_down = 0; | 260 | unsigned int num_down = 0; |
| 226 | unsigned long flags; | 261 | unsigned long flags; |
| 262 | bool fn_keypress = false; | ||
| 227 | 263 | ||
| 228 | spin_lock_irqsave(&kbc->lock, flags); | 264 | spin_lock_irqsave(&kbc->lock, flags); |
| 229 | for (i = 0; i < KBC_MAX_KPENT; i++) { | 265 | for (i = 0; i < KBC_MAX_KPENT; i++) { |
| @@ -237,11 +273,28 @@ static void tegra_kbc_report_keys(struct tegra_kbc *kbc) | |||
| 237 | MATRIX_SCAN_CODE(row, col, KBC_ROW_SHIFT); | 273 | MATRIX_SCAN_CODE(row, col, KBC_ROW_SHIFT); |
| 238 | 274 | ||
| 239 | scancodes[num_down] = scancode; | 275 | scancodes[num_down] = scancode; |
| 240 | keycodes[num_down++] = kbc->keycode[scancode]; | 276 | keycodes[num_down] = kbc->keycode[scancode]; |
| 277 | /* If driver uses Fn map, do not report the Fn key. */ | ||
| 278 | if ((keycodes[num_down] == KEY_FN) && kbc->use_fn_map) | ||
| 279 | fn_keypress = true; | ||
| 280 | else | ||
| 281 | num_down++; | ||
| 241 | } | 282 | } |
| 242 | 283 | ||
| 243 | val >>= 8; | 284 | val >>= 8; |
| 244 | } | 285 | } |
| 286 | |||
| 287 | /* | ||
| 288 | * If the platform uses Fn keymaps, translate keys on a Fn keypress. | ||
| 289 | * Function keycodes are KBC_MAX_KEY apart from the plain keycodes. | ||
| 290 | */ | ||
| 291 | if (fn_keypress) { | ||
| 292 | for (i = 0; i < num_down; i++) { | ||
| 293 | scancodes[i] += KBC_MAX_KEY; | ||
| 294 | keycodes[i] = kbc->keycode[scancodes[i]]; | ||
| 295 | } | ||
| 296 | } | ||
| 297 | |||
| 245 | spin_unlock_irqrestore(&kbc->lock, flags); | 298 | spin_unlock_irqrestore(&kbc->lock, flags); |
| 246 | 299 | ||
| 247 | tegra_kbc_report_released_keys(kbc->idev, | 300 | tegra_kbc_report_released_keys(kbc->idev, |
| @@ -594,8 +647,11 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev) | |||
| 594 | 647 | ||
| 595 | input_dev->keycode = kbc->keycode; | 648 | input_dev->keycode = kbc->keycode; |
| 596 | input_dev->keycodesize = sizeof(kbc->keycode[0]); | 649 | input_dev->keycodesize = sizeof(kbc->keycode[0]); |
| 597 | input_dev->keycodemax = ARRAY_SIZE(kbc->keycode); | 650 | input_dev->keycodemax = KBC_MAX_KEY; |
| 651 | if (pdata->use_fn_map) | ||
| 652 | input_dev->keycodemax *= 2; | ||
| 598 | 653 | ||
| 654 | kbc->use_fn_map = pdata->use_fn_map; | ||
| 599 | keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data; | 655 | keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data; |
| 600 | matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT, | 656 | matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT, |
| 601 | input_dev->keycode, input_dev->keybit); | 657 | input_dev->keycode, input_dev->keybit); |
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 25e5d042a72c..7453938bf5ef 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
| @@ -51,6 +51,29 @@ | |||
| 51 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) | 51 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) |
| 52 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) | 52 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) |
| 53 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) | 53 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) |
| 54 | |||
| 55 | /* | ||
| 56 | * The following describes response for the 0x0c query. | ||
| 57 | * | ||
| 58 | * byte mask name meaning | ||
| 59 | * ---- ---- ------- ------------ | ||
| 60 | * 1 0x01 adjustable threshold capacitive button sensitivity | ||
| 61 | * can be adjusted | ||
| 62 | * 1 0x02 report max query 0x0d gives max coord reported | ||
| 63 | * 1 0x04 clearpad sensor is ClearPad product | ||
| 64 | * 1 0x08 advanced gesture not particularly meaningful | ||
| 65 | * 1 0x10 clickpad bit 0 1-button ClickPad | ||
| 66 | * 1 0x60 multifinger mode identifies firmware finger counting | ||
| 67 | * (not reporting!) algorithm. | ||
| 68 | * Not particularly meaningful | ||
| 69 | * 1 0x80 covered pad W clipped to 14, 15 == pad mostly covered | ||
| 70 | * 2 0x01 clickpad bit 1 2-button ClickPad | ||
| 71 | * 2 0x02 deluxe LED controls touchpad support LED commands | ||
| 72 | * ala multimedia control bar | ||
| 73 | * 2 0x04 reduced filtering firmware does less filtering on | ||
| 74 | * position data, driver should watch | ||
| 75 | * for noise. | ||
| 76 | */ | ||
| 54 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ | 77 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ |
| 55 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ | 78 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ |
| 56 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) | 79 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 7c38d1fbabf2..ba70058e2be3 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
| @@ -299,7 +299,7 @@ static int serio_queue_event(void *object, struct module *owner, | |||
| 299 | event->owner = owner; | 299 | event->owner = owner; |
| 300 | 300 | ||
| 301 | list_add_tail(&event->node, &serio_event_list); | 301 | list_add_tail(&event->node, &serio_event_list); |
| 302 | schedule_work(&serio_event_work); | 302 | queue_work(system_long_wq, &serio_event_work); |
| 303 | 303 | ||
| 304 | out: | 304 | out: |
| 305 | spin_unlock_irqrestore(&serio_event_lock, flags); | 305 | spin_unlock_irqrestore(&serio_event_lock, flags); |
diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index 0858791978d8..cfff0c41d298 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c | |||
| @@ -1247,10 +1247,10 @@ static void | |||
| 1247 | l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) | 1247 | l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) |
| 1248 | { | 1248 | { |
| 1249 | struct PStack *st = fi->userdata; | 1249 | struct PStack *st = fi->userdata; |
| 1250 | struct sk_buff *skb, *oskb; | 1250 | struct sk_buff *skb; |
| 1251 | struct Layer2 *l2 = &st->l2; | 1251 | struct Layer2 *l2 = &st->l2; |
| 1252 | u_char header[MAX_HEADER_LEN]; | 1252 | u_char header[MAX_HEADER_LEN]; |
| 1253 | int i; | 1253 | int i, hdr_space_needed; |
| 1254 | int unsigned p1; | 1254 | int unsigned p1; |
| 1255 | u_long flags; | 1255 | u_long flags; |
| 1256 | 1256 | ||
| @@ -1261,6 +1261,16 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) | |||
| 1261 | if (!skb) | 1261 | if (!skb) |
| 1262 | return; | 1262 | return; |
| 1263 | 1263 | ||
| 1264 | hdr_space_needed = l2headersize(l2, 0); | ||
| 1265 | if (hdr_space_needed > skb_headroom(skb)) { | ||
| 1266 | struct sk_buff *orig_skb = skb; | ||
| 1267 | |||
| 1268 | skb = skb_realloc_headroom(skb, hdr_space_needed); | ||
| 1269 | if (!skb) { | ||
| 1270 | dev_kfree_skb(orig_skb); | ||
| 1271 | return; | ||
| 1272 | } | ||
| 1273 | } | ||
| 1264 | spin_lock_irqsave(&l2->lock, flags); | 1274 | spin_lock_irqsave(&l2->lock, flags); |
| 1265 | if(test_bit(FLG_MOD128, &l2->flag)) | 1275 | if(test_bit(FLG_MOD128, &l2->flag)) |
| 1266 | p1 = (l2->vs - l2->va) % 128; | 1276 | p1 = (l2->vs - l2->va) % 128; |
| @@ -1285,19 +1295,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) | |||
| 1285 | l2->vs = (l2->vs + 1) % 8; | 1295 | l2->vs = (l2->vs + 1) % 8; |
| 1286 | } | 1296 | } |
| 1287 | spin_unlock_irqrestore(&l2->lock, flags); | 1297 | spin_unlock_irqrestore(&l2->lock, flags); |
| 1288 | p1 = skb->data - skb->head; | 1298 | memcpy(skb_push(skb, i), header, i); |
| 1289 | if (p1 >= i) | ||
| 1290 | memcpy(skb_push(skb, i), header, i); | ||
| 1291 | else { | ||
| 1292 | printk(KERN_WARNING | ||
| 1293 | "isdl2 pull_iqueue skb header(%d/%d) too short\n", i, p1); | ||
| 1294 | oskb = skb; | ||
| 1295 | skb = alloc_skb(oskb->len + i, GFP_ATOMIC); | ||
| 1296 | memcpy(skb_put(skb, i), header, i); | ||
| 1297 | skb_copy_from_linear_data(oskb, | ||
| 1298 | skb_put(skb, oskb->len), oskb->len); | ||
| 1299 | dev_kfree_skb(oskb); | ||
| 1300 | } | ||
| 1301 | st->l2.l2l1(st, PH_PULL | INDICATION, skb); | 1299 | st->l2.l2l1(st, PH_PULL | INDICATION, skb); |
| 1302 | test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); | 1300 | test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); |
| 1303 | if (!test_and_set_bit(FLG_T200_RUN, &st->l2.flag)) { | 1301 | if (!test_and_set_bit(FLG_T200_RUN, &st->l2.flag)) { |
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 8a2f767f26d8..0ed7f6bc2a7f 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
| @@ -216,7 +216,6 @@ static int linear_run (mddev_t *mddev) | |||
| 216 | 216 | ||
| 217 | if (md_check_no_bitmap(mddev)) | 217 | if (md_check_no_bitmap(mddev)) |
| 218 | return -EINVAL; | 218 | return -EINVAL; |
| 219 | mddev->queue->queue_lock = &mddev->queue->__queue_lock; | ||
| 220 | conf = linear_conf(mddev, mddev->raid_disks); | 219 | conf = linear_conf(mddev, mddev->raid_disks); |
| 221 | 220 | ||
| 222 | if (!conf) | 221 | if (!conf) |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 0cc30ecda4c1..818313e277e7 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -553,6 +553,9 @@ static mddev_t * mddev_find(dev_t unit) | |||
| 553 | { | 553 | { |
| 554 | mddev_t *mddev, *new = NULL; | 554 | mddev_t *mddev, *new = NULL; |
| 555 | 555 | ||
| 556 | if (unit && MAJOR(unit) != MD_MAJOR) | ||
| 557 | unit &= ~((1<<MdpMinorShift)-1); | ||
| 558 | |||
| 556 | retry: | 559 | retry: |
| 557 | spin_lock(&all_mddevs_lock); | 560 | spin_lock(&all_mddevs_lock); |
| 558 | 561 | ||
| @@ -4138,10 +4141,10 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len) | |||
| 4138 | } | 4141 | } |
| 4139 | 4142 | ||
| 4140 | mddev->array_sectors = sectors; | 4143 | mddev->array_sectors = sectors; |
| 4141 | set_capacity(mddev->gendisk, mddev->array_sectors); | 4144 | if (mddev->pers) { |
| 4142 | if (mddev->pers) | 4145 | set_capacity(mddev->gendisk, mddev->array_sectors); |
| 4143 | revalidate_disk(mddev->gendisk); | 4146 | revalidate_disk(mddev->gendisk); |
| 4144 | 4147 | } | |
| 4145 | return len; | 4148 | return len; |
| 4146 | } | 4149 | } |
| 4147 | 4150 | ||
| @@ -4624,6 +4627,7 @@ static int do_md_run(mddev_t *mddev) | |||
| 4624 | } | 4627 | } |
| 4625 | set_capacity(mddev->gendisk, mddev->array_sectors); | 4628 | set_capacity(mddev->gendisk, mddev->array_sectors); |
| 4626 | revalidate_disk(mddev->gendisk); | 4629 | revalidate_disk(mddev->gendisk); |
| 4630 | mddev->changed = 1; | ||
| 4627 | kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); | 4631 | kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); |
| 4628 | out: | 4632 | out: |
| 4629 | return err; | 4633 | return err; |
| @@ -4712,6 +4716,7 @@ static void md_clean(mddev_t *mddev) | |||
| 4712 | mddev->sync_speed_min = mddev->sync_speed_max = 0; | 4716 | mddev->sync_speed_min = mddev->sync_speed_max = 0; |
| 4713 | mddev->recovery = 0; | 4717 | mddev->recovery = 0; |
| 4714 | mddev->in_sync = 0; | 4718 | mddev->in_sync = 0; |
| 4719 | mddev->changed = 0; | ||
| 4715 | mddev->degraded = 0; | 4720 | mddev->degraded = 0; |
| 4716 | mddev->safemode = 0; | 4721 | mddev->safemode = 0; |
| 4717 | mddev->bitmap_info.offset = 0; | 4722 | mddev->bitmap_info.offset = 0; |
| @@ -4827,6 +4832,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
| 4827 | 4832 | ||
| 4828 | set_capacity(disk, 0); | 4833 | set_capacity(disk, 0); |
| 4829 | mutex_unlock(&mddev->open_mutex); | 4834 | mutex_unlock(&mddev->open_mutex); |
| 4835 | mddev->changed = 1; | ||
| 4830 | revalidate_disk(disk); | 4836 | revalidate_disk(disk); |
| 4831 | 4837 | ||
| 4832 | if (mddev->ro) | 4838 | if (mddev->ro) |
| @@ -6011,7 +6017,7 @@ static int md_open(struct block_device *bdev, fmode_t mode) | |||
| 6011 | atomic_inc(&mddev->openers); | 6017 | atomic_inc(&mddev->openers); |
| 6012 | mutex_unlock(&mddev->open_mutex); | 6018 | mutex_unlock(&mddev->open_mutex); |
| 6013 | 6019 | ||
| 6014 | check_disk_size_change(mddev->gendisk, bdev); | 6020 | check_disk_change(bdev); |
| 6015 | out: | 6021 | out: |
| 6016 | return err; | 6022 | return err; |
| 6017 | } | 6023 | } |
| @@ -6026,6 +6032,21 @@ static int md_release(struct gendisk *disk, fmode_t mode) | |||
| 6026 | 6032 | ||
| 6027 | return 0; | 6033 | return 0; |
| 6028 | } | 6034 | } |
| 6035 | |||
| 6036 | static int md_media_changed(struct gendisk *disk) | ||
| 6037 | { | ||
| 6038 | mddev_t *mddev = disk->private_data; | ||
| 6039 | |||
| 6040 | return mddev->changed; | ||
| 6041 | } | ||
| 6042 | |||
| 6043 | static int md_revalidate(struct gendisk *disk) | ||
| 6044 | { | ||
| 6045 | mddev_t *mddev = disk->private_data; | ||
| 6046 | |||
| 6047 | mddev->changed = 0; | ||
| 6048 | return 0; | ||
| 6049 | } | ||
| 6029 | static const struct block_device_operations md_fops = | 6050 | static const struct block_device_operations md_fops = |
| 6030 | { | 6051 | { |
| 6031 | .owner = THIS_MODULE, | 6052 | .owner = THIS_MODULE, |
| @@ -6036,6 +6057,8 @@ static const struct block_device_operations md_fops = | |||
| 6036 | .compat_ioctl = md_compat_ioctl, | 6057 | .compat_ioctl = md_compat_ioctl, |
| 6037 | #endif | 6058 | #endif |
| 6038 | .getgeo = md_getgeo, | 6059 | .getgeo = md_getgeo, |
| 6060 | .media_changed = md_media_changed, | ||
| 6061 | .revalidate_disk= md_revalidate, | ||
| 6039 | }; | 6062 | }; |
| 6040 | 6063 | ||
| 6041 | static int md_thread(void * arg) | 6064 | static int md_thread(void * arg) |
diff --git a/drivers/md/md.h b/drivers/md/md.h index 7e90b8593b2a..12215d437fcc 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
| @@ -274,6 +274,8 @@ struct mddev_s | |||
| 274 | atomic_t active; /* general refcount */ | 274 | atomic_t active; /* general refcount */ |
| 275 | atomic_t openers; /* number of active opens */ | 275 | atomic_t openers; /* number of active opens */ |
| 276 | 276 | ||
| 277 | int changed; /* True if we might need to | ||
| 278 | * reread partition info */ | ||
| 277 | int degraded; /* whether md should consider | 279 | int degraded; /* whether md should consider |
| 278 | * adding a spare | 280 | * adding a spare |
| 279 | */ | 281 | */ |
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 6d7ddf32ef2e..3a62d440e27b 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
| @@ -435,7 +435,6 @@ static int multipath_run (mddev_t *mddev) | |||
| 435 | * bookkeeping area. [whatever we allocate in multipath_run(), | 435 | * bookkeeping area. [whatever we allocate in multipath_run(), |
| 436 | * should be freed in multipath_stop()] | 436 | * should be freed in multipath_stop()] |
| 437 | */ | 437 | */ |
| 438 | mddev->queue->queue_lock = &mddev->queue->__queue_lock; | ||
| 439 | 438 | ||
| 440 | conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL); | 439 | conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL); |
| 441 | mddev->private = conf; | 440 | mddev->private = conf; |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 637a96855edb..c0ac457f1218 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
| @@ -361,7 +361,6 @@ static int raid0_run(mddev_t *mddev) | |||
| 361 | if (md_check_no_bitmap(mddev)) | 361 | if (md_check_no_bitmap(mddev)) |
| 362 | return -EINVAL; | 362 | return -EINVAL; |
| 363 | blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors); | 363 | blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors); |
| 364 | mddev->queue->queue_lock = &mddev->queue->__queue_lock; | ||
| 365 | 364 | ||
| 366 | /* if private is not null, we are here after takeover */ | 365 | /* if private is not null, we are here after takeover */ |
| 367 | if (mddev->private == NULL) { | 366 | if (mddev->private == NULL) { |
| @@ -670,6 +669,7 @@ static void *raid0_takeover_raid1(mddev_t *mddev) | |||
| 670 | mddev->new_layout = 0; | 669 | mddev->new_layout = 0; |
| 671 | mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */ | 670 | mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */ |
| 672 | mddev->delta_disks = 1 - mddev->raid_disks; | 671 | mddev->delta_disks = 1 - mddev->raid_disks; |
| 672 | mddev->raid_disks = 1; | ||
| 673 | /* make sure it will be not marked as dirty */ | 673 | /* make sure it will be not marked as dirty */ |
| 674 | mddev->recovery_cp = MaxSector; | 674 | mddev->recovery_cp = MaxSector; |
| 675 | 675 | ||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a23ffa397ba9..06cd712807d0 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
| @@ -593,7 +593,10 @@ static int flush_pending_writes(conf_t *conf) | |||
| 593 | if (conf->pending_bio_list.head) { | 593 | if (conf->pending_bio_list.head) { |
| 594 | struct bio *bio; | 594 | struct bio *bio; |
| 595 | bio = bio_list_get(&conf->pending_bio_list); | 595 | bio = bio_list_get(&conf->pending_bio_list); |
| 596 | /* Only take the spinlock to quiet a warning */ | ||
| 597 | spin_lock(conf->mddev->queue->queue_lock); | ||
| 596 | blk_remove_plug(conf->mddev->queue); | 598 | blk_remove_plug(conf->mddev->queue); |
| 599 | spin_unlock(conf->mddev->queue->queue_lock); | ||
| 597 | spin_unlock_irq(&conf->device_lock); | 600 | spin_unlock_irq(&conf->device_lock); |
| 598 | /* flush any pending bitmap writes to | 601 | /* flush any pending bitmap writes to |
| 599 | * disk before proceeding w/ I/O */ | 602 | * disk before proceeding w/ I/O */ |
| @@ -959,7 +962,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) | |||
| 959 | atomic_inc(&r1_bio->remaining); | 962 | atomic_inc(&r1_bio->remaining); |
| 960 | spin_lock_irqsave(&conf->device_lock, flags); | 963 | spin_lock_irqsave(&conf->device_lock, flags); |
| 961 | bio_list_add(&conf->pending_bio_list, mbio); | 964 | bio_list_add(&conf->pending_bio_list, mbio); |
| 962 | blk_plug_device(mddev->queue); | 965 | blk_plug_device_unlocked(mddev->queue); |
| 963 | spin_unlock_irqrestore(&conf->device_lock, flags); | 966 | spin_unlock_irqrestore(&conf->device_lock, flags); |
| 964 | } | 967 | } |
| 965 | r1_bio_write_done(r1_bio, bio->bi_vcnt, behind_pages, behind_pages != NULL); | 968 | r1_bio_write_done(r1_bio, bio->bi_vcnt, behind_pages, behind_pages != NULL); |
| @@ -2021,7 +2024,6 @@ static int run(mddev_t *mddev) | |||
| 2021 | if (IS_ERR(conf)) | 2024 | if (IS_ERR(conf)) |
| 2022 | return PTR_ERR(conf); | 2025 | return PTR_ERR(conf); |
| 2023 | 2026 | ||
| 2024 | mddev->queue->queue_lock = &conf->device_lock; | ||
| 2025 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 2027 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
| 2026 | disk_stack_limits(mddev->gendisk, rdev->bdev, | 2028 | disk_stack_limits(mddev->gendisk, rdev->bdev, |
| 2027 | rdev->data_offset << 9); | 2029 | rdev->data_offset << 9); |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 3b607b28741b..747d061d8e05 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
| @@ -662,7 +662,10 @@ static int flush_pending_writes(conf_t *conf) | |||
| 662 | if (conf->pending_bio_list.head) { | 662 | if (conf->pending_bio_list.head) { |
| 663 | struct bio *bio; | 663 | struct bio *bio; |
| 664 | bio = bio_list_get(&conf->pending_bio_list); | 664 | bio = bio_list_get(&conf->pending_bio_list); |
| 665 | /* Spinlock only taken to quiet a warning */ | ||
| 666 | spin_lock(conf->mddev->queue->queue_lock); | ||
| 665 | blk_remove_plug(conf->mddev->queue); | 667 | blk_remove_plug(conf->mddev->queue); |
| 668 | spin_unlock(conf->mddev->queue->queue_lock); | ||
| 666 | spin_unlock_irq(&conf->device_lock); | 669 | spin_unlock_irq(&conf->device_lock); |
| 667 | /* flush any pending bitmap writes to disk | 670 | /* flush any pending bitmap writes to disk |
| 668 | * before proceeding w/ I/O */ | 671 | * before proceeding w/ I/O */ |
| @@ -971,7 +974,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) | |||
| 971 | atomic_inc(&r10_bio->remaining); | 974 | atomic_inc(&r10_bio->remaining); |
| 972 | spin_lock_irqsave(&conf->device_lock, flags); | 975 | spin_lock_irqsave(&conf->device_lock, flags); |
| 973 | bio_list_add(&conf->pending_bio_list, mbio); | 976 | bio_list_add(&conf->pending_bio_list, mbio); |
| 974 | blk_plug_device(mddev->queue); | 977 | blk_plug_device_unlocked(mddev->queue); |
| 975 | spin_unlock_irqrestore(&conf->device_lock, flags); | 978 | spin_unlock_irqrestore(&conf->device_lock, flags); |
| 976 | } | 979 | } |
| 977 | 980 | ||
| @@ -2304,8 +2307,6 @@ static int run(mddev_t *mddev) | |||
| 2304 | if (!conf) | 2307 | if (!conf) |
| 2305 | goto out; | 2308 | goto out; |
| 2306 | 2309 | ||
| 2307 | mddev->queue->queue_lock = &conf->device_lock; | ||
| 2308 | |||
| 2309 | mddev->thread = conf->thread; | 2310 | mddev->thread = conf->thread; |
| 2310 | conf->thread = NULL; | 2311 | conf->thread = NULL; |
| 2311 | 2312 | ||
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 702812824195..78536fdbd87f 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
| @@ -5204,7 +5204,6 @@ static int run(mddev_t *mddev) | |||
| 5204 | 5204 | ||
| 5205 | mddev->queue->backing_dev_info.congested_data = mddev; | 5205 | mddev->queue->backing_dev_info.congested_data = mddev; |
| 5206 | mddev->queue->backing_dev_info.congested_fn = raid5_congested; | 5206 | mddev->queue->backing_dev_info.congested_fn = raid5_congested; |
| 5207 | mddev->queue->queue_lock = &conf->device_lock; | ||
| 5208 | mddev->queue->unplug_fn = raid5_unplug_queue; | 5207 | mddev->queue->unplug_fn = raid5_unplug_queue; |
| 5209 | 5208 | ||
| 5210 | chunk_size = mddev->chunk_sectors << 9; | 5209 | chunk_size = mddev->chunk_sectors << 9; |
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index e9a3eab7b0cf..8c1d85e27be4 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c | |||
| @@ -621,7 +621,7 @@ static int __init memstick_init(void) | |||
| 621 | { | 621 | { |
| 622 | int rc; | 622 | int rc; |
| 623 | 623 | ||
| 624 | workqueue = create_freezeable_workqueue("kmemstick"); | 624 | workqueue = create_freezable_workqueue("kmemstick"); |
| 625 | if (!workqueue) | 625 | if (!workqueue) |
| 626 | return -ENOMEM; | 626 | return -ENOMEM; |
| 627 | 627 | ||
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index f71f22948477..1735c84ff757 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
| @@ -76,8 +76,8 @@ | |||
| 76 | #define COPYRIGHT "Copyright (c) 1999-2008 " MODULEAUTHOR | 76 | #define COPYRIGHT "Copyright (c) 1999-2008 " MODULEAUTHOR |
| 77 | #endif | 77 | #endif |
| 78 | 78 | ||
| 79 | #define MPT_LINUX_VERSION_COMMON "3.04.17" | 79 | #define MPT_LINUX_VERSION_COMMON "3.04.18" |
| 80 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.17" | 80 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.18" |
| 81 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" | 81 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" |
| 82 | 82 | ||
| 83 | #define show_mptmod_ver(s,ver) \ | 83 | #define show_mptmod_ver(s,ver) \ |
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index a3856ed90aef..e8deb8ed0499 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c | |||
| @@ -597,6 +597,13 @@ mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) | |||
| 597 | } | 597 | } |
| 598 | 598 | ||
| 599 | static int | 599 | static int |
| 600 | mptctl_release(struct inode *inode, struct file *filep) | ||
| 601 | { | ||
| 602 | fasync_helper(-1, filep, 0, &async_queue); | ||
| 603 | return 0; | ||
| 604 | } | ||
| 605 | |||
| 606 | static int | ||
| 600 | mptctl_fasync(int fd, struct file *filep, int mode) | 607 | mptctl_fasync(int fd, struct file *filep, int mode) |
| 601 | { | 608 | { |
| 602 | MPT_ADAPTER *ioc; | 609 | MPT_ADAPTER *ioc; |
| @@ -2815,6 +2822,7 @@ static const struct file_operations mptctl_fops = { | |||
| 2815 | .llseek = no_llseek, | 2822 | .llseek = no_llseek, |
| 2816 | .fasync = mptctl_fasync, | 2823 | .fasync = mptctl_fasync, |
| 2817 | .unlocked_ioctl = mptctl_ioctl, | 2824 | .unlocked_ioctl = mptctl_ioctl, |
| 2825 | .release = mptctl_release, | ||
| 2818 | #ifdef CONFIG_COMPAT | 2826 | #ifdef CONFIG_COMPAT |
| 2819 | .compat_ioctl = compat_mpctl_ioctl, | 2827 | .compat_ioctl = compat_mpctl_ioctl, |
| 2820 | #endif | 2828 | #endif |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 59b8f53d1ece..0d9b82a44540 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
| @@ -1873,8 +1873,9 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) | |||
| 1873 | } | 1873 | } |
| 1874 | 1874 | ||
| 1875 | out: | 1875 | out: |
| 1876 | printk(MYIOC_s_INFO_FMT "task abort: %s (sc=%p)\n", | 1876 | printk(MYIOC_s_INFO_FMT "task abort: %s (rv=%04x) (sc=%p) (sn=%ld)\n", |
| 1877 | ioc->name, ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), SCpnt); | 1877 | ioc->name, ((retval == SUCCESS) ? "SUCCESS" : "FAILED"), retval, |
| 1878 | SCpnt, SCpnt->serial_number); | ||
| 1878 | 1879 | ||
| 1879 | return retval; | 1880 | return retval; |
| 1880 | } | 1881 | } |
| @@ -1911,7 +1912,7 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) | |||
| 1911 | 1912 | ||
| 1912 | vdevice = SCpnt->device->hostdata; | 1913 | vdevice = SCpnt->device->hostdata; |
| 1913 | if (!vdevice || !vdevice->vtarget) { | 1914 | if (!vdevice || !vdevice->vtarget) { |
| 1914 | retval = SUCCESS; | 1915 | retval = 0; |
| 1915 | goto out; | 1916 | goto out; |
| 1916 | } | 1917 | } |
| 1917 | 1918 | ||
diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c index 5f6852dff40b..44d4475a09dd 100644 --- a/drivers/misc/tifm_core.c +++ b/drivers/misc/tifm_core.c | |||
| @@ -329,7 +329,7 @@ static int __init tifm_init(void) | |||
| 329 | { | 329 | { |
| 330 | int rc; | 330 | int rc; |
| 331 | 331 | ||
| 332 | workqueue = create_freezeable_workqueue("tifm"); | 332 | workqueue = create_freezable_workqueue("tifm"); |
| 333 | if (!workqueue) | 333 | if (!workqueue) |
| 334 | return -ENOMEM; | 334 | return -ENOMEM; |
| 335 | 335 | ||
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 4d2ea8e80140..6df5a55da110 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c | |||
| @@ -785,7 +785,7 @@ static int __init vmballoon_init(void) | |||
| 785 | if (x86_hyper != &x86_hyper_vmware) | 785 | if (x86_hyper != &x86_hyper_vmware) |
| 786 | return -ENODEV; | 786 | return -ENODEV; |
| 787 | 787 | ||
| 788 | vmballoon_wq = create_freezeable_workqueue("vmmemctl"); | 788 | vmballoon_wq = create_freezable_workqueue("vmmemctl"); |
| 789 | if (!vmballoon_wq) { | 789 | if (!vmballoon_wq) { |
| 790 | pr_err("failed to create workqueue\n"); | 790 | pr_err("failed to create workqueue\n"); |
| 791 | return -ENOMEM; | 791 | return -ENOMEM; |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 078fdf11af03..158c0ee53b2c 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
| @@ -118,7 +118,7 @@ | |||
| 118 | 118 | ||
| 119 | #define MMC_TIMEOUT_MS 20 | 119 | #define MMC_TIMEOUT_MS 20 |
| 120 | #define OMAP_MMC_MASTER_CLOCK 96000000 | 120 | #define OMAP_MMC_MASTER_CLOCK 96000000 |
| 121 | #define DRIVER_NAME "mmci-omap-hs" | 121 | #define DRIVER_NAME "omap_hsmmc" |
| 122 | 122 | ||
| 123 | /* Timeouts for entering power saving states on inactivity, msec */ | 123 | /* Timeouts for entering power saving states on inactivity, msec */ |
| 124 | #define OMAP_MMC_DISABLED_TIMEOUT 100 | 124 | #define OMAP_MMC_DISABLED_TIMEOUT 100 |
| @@ -260,7 +260,7 @@ static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on, | |||
| 260 | return ret; | 260 | return ret; |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on, | 263 | static int omap_hsmmc_235_set_power(struct device *dev, int slot, int power_on, |
| 264 | int vdd) | 264 | int vdd) |
| 265 | { | 265 | { |
| 266 | struct omap_hsmmc_host *host = | 266 | struct omap_hsmmc_host *host = |
| @@ -316,6 +316,12 @@ static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on, | |||
| 316 | return ret; | 316 | return ret; |
| 317 | } | 317 | } |
| 318 | 318 | ||
| 319 | static int omap_hsmmc_4_set_power(struct device *dev, int slot, int power_on, | ||
| 320 | int vdd) | ||
| 321 | { | ||
| 322 | return 0; | ||
| 323 | } | ||
| 324 | |||
| 319 | static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep, | 325 | static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep, |
| 320 | int vdd, int cardsleep) | 326 | int vdd, int cardsleep) |
| 321 | { | 327 | { |
| @@ -326,7 +332,7 @@ static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep, | |||
| 326 | return regulator_set_mode(host->vcc, mode); | 332 | return regulator_set_mode(host->vcc, mode); |
| 327 | } | 333 | } |
| 328 | 334 | ||
| 329 | static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep, | 335 | static int omap_hsmmc_235_set_sleep(struct device *dev, int slot, int sleep, |
| 330 | int vdd, int cardsleep) | 336 | int vdd, int cardsleep) |
| 331 | { | 337 | { |
| 332 | struct omap_hsmmc_host *host = | 338 | struct omap_hsmmc_host *host = |
| @@ -365,6 +371,12 @@ static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep, | |||
| 365 | return regulator_enable(host->vcc_aux); | 371 | return regulator_enable(host->vcc_aux); |
| 366 | } | 372 | } |
| 367 | 373 | ||
| 374 | static int omap_hsmmc_4_set_sleep(struct device *dev, int slot, int sleep, | ||
| 375 | int vdd, int cardsleep) | ||
| 376 | { | ||
| 377 | return 0; | ||
| 378 | } | ||
| 379 | |||
| 368 | static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) | 380 | static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) |
| 369 | { | 381 | { |
| 370 | struct regulator *reg; | 382 | struct regulator *reg; |
| @@ -379,10 +391,14 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) | |||
| 379 | break; | 391 | break; |
| 380 | case OMAP_MMC2_DEVID: | 392 | case OMAP_MMC2_DEVID: |
| 381 | case OMAP_MMC3_DEVID: | 393 | case OMAP_MMC3_DEVID: |
| 394 | case OMAP_MMC5_DEVID: | ||
| 382 | /* Off-chip level shifting, or none */ | 395 | /* Off-chip level shifting, or none */ |
| 383 | mmc_slot(host).set_power = omap_hsmmc_23_set_power; | 396 | mmc_slot(host).set_power = omap_hsmmc_235_set_power; |
| 384 | mmc_slot(host).set_sleep = omap_hsmmc_23_set_sleep; | 397 | mmc_slot(host).set_sleep = omap_hsmmc_235_set_sleep; |
| 385 | break; | 398 | break; |
| 399 | case OMAP_MMC4_DEVID: | ||
| 400 | mmc_slot(host).set_power = omap_hsmmc_4_set_power; | ||
| 401 | mmc_slot(host).set_sleep = omap_hsmmc_4_set_sleep; | ||
| 386 | default: | 402 | default: |
| 387 | pr_err("MMC%d configuration not supported!\n", host->id); | 403 | pr_err("MMC%d configuration not supported!\n", host->id); |
| 388 | return -EINVAL; | 404 | return -EINVAL; |
| @@ -1555,7 +1571,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
| 1555 | break; | 1571 | break; |
| 1556 | } | 1572 | } |
| 1557 | 1573 | ||
| 1558 | if (host->id == OMAP_MMC1_DEVID) { | 1574 | if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) { |
| 1559 | /* Only MMC1 can interface at 3V without some flavor | 1575 | /* Only MMC1 can interface at 3V without some flavor |
| 1560 | * of external transceiver; but they all handle 1.8V. | 1576 | * of external transceiver; but they all handle 1.8V. |
| 1561 | */ | 1577 | */ |
| @@ -1647,7 +1663,7 @@ static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host) | |||
| 1647 | u32 hctl, capa, value; | 1663 | u32 hctl, capa, value; |
| 1648 | 1664 | ||
| 1649 | /* Only MMC1 supports 3.0V */ | 1665 | /* Only MMC1 supports 3.0V */ |
| 1650 | if (host->id == OMAP_MMC1_DEVID) { | 1666 | if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) { |
| 1651 | hctl = SDVS30; | 1667 | hctl = SDVS30; |
| 1652 | capa = VS30 | VS18; | 1668 | capa = VS30 | VS18; |
| 1653 | } else { | 1669 | } else { |
| @@ -2101,14 +2117,14 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 2101 | /* we start off in DISABLED state */ | 2117 | /* we start off in DISABLED state */ |
| 2102 | host->dpm_state = DISABLED; | 2118 | host->dpm_state = DISABLED; |
| 2103 | 2119 | ||
| 2104 | if (mmc_host_enable(host->mmc) != 0) { | 2120 | if (clk_enable(host->iclk) != 0) { |
| 2105 | clk_put(host->iclk); | 2121 | clk_put(host->iclk); |
| 2106 | clk_put(host->fclk); | 2122 | clk_put(host->fclk); |
| 2107 | goto err1; | 2123 | goto err1; |
| 2108 | } | 2124 | } |
| 2109 | 2125 | ||
| 2110 | if (clk_enable(host->iclk) != 0) { | 2126 | if (mmc_host_enable(host->mmc) != 0) { |
| 2111 | mmc_host_disable(host->mmc); | 2127 | clk_disable(host->iclk); |
| 2112 | clk_put(host->iclk); | 2128 | clk_put(host->iclk); |
| 2113 | clk_put(host->fclk); | 2129 | clk_put(host->fclk); |
| 2114 | goto err1; | 2130 | goto err1; |
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index c89592239bc7..178e2006063d 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
| @@ -106,23 +106,6 @@ config MTD_NAND_OMAP2 | |||
| 106 | help | 106 | help |
| 107 | Support for NAND flash on Texas Instruments OMAP2 and OMAP3 platforms. | 107 | Support for NAND flash on Texas Instruments OMAP2 and OMAP3 platforms. |
| 108 | 108 | ||
| 109 | config MTD_NAND_OMAP_PREFETCH | ||
| 110 | bool "GPMC prefetch support for NAND Flash device" | ||
| 111 | depends on MTD_NAND_OMAP2 | ||
| 112 | default y | ||
| 113 | help | ||
| 114 | The NAND device can be accessed for Read/Write using GPMC PREFETCH engine | ||
| 115 | to improve the performance. | ||
| 116 | |||
| 117 | config MTD_NAND_OMAP_PREFETCH_DMA | ||
| 118 | depends on MTD_NAND_OMAP_PREFETCH | ||
| 119 | bool "DMA mode" | ||
| 120 | default n | ||
| 121 | help | ||
| 122 | The GPMC PREFETCH engine can be configured eigther in MPU interrupt mode | ||
| 123 | or in DMA interrupt mode. | ||
| 124 | Say y for DMA mode or MPU mode will be used | ||
| 125 | |||
| 126 | config MTD_NAND_IDS | 109 | config MTD_NAND_IDS |
| 127 | tristate | 110 | tristate |
| 128 | 111 | ||
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 15682ec8530e..4e33972ad17a 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
| 12 | #include <linux/dma-mapping.h> | 12 | #include <linux/dma-mapping.h> |
| 13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
| 14 | #include <linux/interrupt.h> | ||
| 14 | #include <linux/jiffies.h> | 15 | #include <linux/jiffies.h> |
| 15 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 16 | #include <linux/mtd/mtd.h> | 17 | #include <linux/mtd/mtd.h> |
| @@ -24,6 +25,7 @@ | |||
| 24 | #include <plat/nand.h> | 25 | #include <plat/nand.h> |
| 25 | 26 | ||
| 26 | #define DRIVER_NAME "omap2-nand" | 27 | #define DRIVER_NAME "omap2-nand" |
| 28 | #define OMAP_NAND_TIMEOUT_MS 5000 | ||
| 27 | 29 | ||
| 28 | #define NAND_Ecc_P1e (1 << 0) | 30 | #define NAND_Ecc_P1e (1 << 0) |
| 29 | #define NAND_Ecc_P2e (1 << 1) | 31 | #define NAND_Ecc_P2e (1 << 1) |
| @@ -96,26 +98,19 @@ | |||
| 96 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 98 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
| 97 | #endif | 99 | #endif |
| 98 | 100 | ||
| 99 | #ifdef CONFIG_MTD_NAND_OMAP_PREFETCH | 101 | /* oob info generated runtime depending on ecc algorithm and layout selected */ |
| 100 | static int use_prefetch = 1; | 102 | static struct nand_ecclayout omap_oobinfo; |
| 101 | 103 | /* Define some generic bad / good block scan pattern which are used | |
| 102 | /* "modprobe ... use_prefetch=0" etc */ | 104 | * while scanning a device for factory marked good / bad blocks |
| 103 | module_param(use_prefetch, bool, 0); | 105 | */ |
| 104 | MODULE_PARM_DESC(use_prefetch, "enable/disable use of PREFETCH"); | 106 | static uint8_t scan_ff_pattern[] = { 0xff }; |
| 105 | 107 | static struct nand_bbt_descr bb_descrip_flashbased = { | |
| 106 | #ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA | 108 | .options = NAND_BBT_SCANEMPTY | NAND_BBT_SCANALLPAGES, |
| 107 | static int use_dma = 1; | 109 | .offs = 0, |
| 110 | .len = 1, | ||
| 111 | .pattern = scan_ff_pattern, | ||
| 112 | }; | ||
| 108 | 113 | ||
| 109 | /* "modprobe ... use_dma=0" etc */ | ||
| 110 | module_param(use_dma, bool, 0); | ||
| 111 | MODULE_PARM_DESC(use_dma, "enable/disable use of DMA"); | ||
| 112 | #else | ||
| 113 | static const int use_dma; | ||
| 114 | #endif | ||
| 115 | #else | ||
| 116 | const int use_prefetch; | ||
| 117 | static const int use_dma; | ||
| 118 | #endif | ||
| 119 | 114 | ||
| 120 | struct omap_nand_info { | 115 | struct omap_nand_info { |
| 121 | struct nand_hw_control controller; | 116 | struct nand_hw_control controller; |
| @@ -129,6 +124,13 @@ struct omap_nand_info { | |||
| 129 | unsigned long phys_base; | 124 | unsigned long phys_base; |
| 130 | struct completion comp; | 125 | struct completion comp; |
| 131 | int dma_ch; | 126 | int dma_ch; |
| 127 | int gpmc_irq; | ||
| 128 | enum { | ||
| 129 | OMAP_NAND_IO_READ = 0, /* read */ | ||
| 130 | OMAP_NAND_IO_WRITE, /* write */ | ||
| 131 | } iomode; | ||
| 132 | u_char *buf; | ||
| 133 | int buf_len; | ||
| 132 | }; | 134 | }; |
| 133 | 135 | ||
| 134 | /** | 136 | /** |
| @@ -256,7 +258,8 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
| 256 | } | 258 | } |
| 257 | 259 | ||
| 258 | /* configure and start prefetch transfer */ | 260 | /* configure and start prefetch transfer */ |
| 259 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); | 261 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
| 262 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0); | ||
| 260 | if (ret) { | 263 | if (ret) { |
| 261 | /* PFPW engine is busy, use cpu copy method */ | 264 | /* PFPW engine is busy, use cpu copy method */ |
| 262 | if (info->nand.options & NAND_BUSWIDTH_16) | 265 | if (info->nand.options & NAND_BUSWIDTH_16) |
| @@ -288,9 +291,10 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
| 288 | { | 291 | { |
| 289 | struct omap_nand_info *info = container_of(mtd, | 292 | struct omap_nand_info *info = container_of(mtd, |
| 290 | struct omap_nand_info, mtd); | 293 | struct omap_nand_info, mtd); |
| 291 | uint32_t pref_count = 0, w_count = 0; | 294 | uint32_t w_count = 0; |
| 292 | int i = 0, ret = 0; | 295 | int i = 0, ret = 0; |
| 293 | u16 *p; | 296 | u16 *p; |
| 297 | unsigned long tim, limit; | ||
| 294 | 298 | ||
| 295 | /* take care of subpage writes */ | 299 | /* take care of subpage writes */ |
| 296 | if (len % 2 != 0) { | 300 | if (len % 2 != 0) { |
| @@ -300,7 +304,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
| 300 | } | 304 | } |
| 301 | 305 | ||
| 302 | /* configure and start prefetch transfer */ | 306 | /* configure and start prefetch transfer */ |
| 303 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x1); | 307 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
| 308 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1); | ||
| 304 | if (ret) { | 309 | if (ret) { |
| 305 | /* PFPW engine is busy, use cpu copy method */ | 310 | /* PFPW engine is busy, use cpu copy method */ |
| 306 | if (info->nand.options & NAND_BUSWIDTH_16) | 311 | if (info->nand.options & NAND_BUSWIDTH_16) |
| @@ -316,15 +321,17 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
| 316 | iowrite16(*p++, info->nand.IO_ADDR_W); | 321 | iowrite16(*p++, info->nand.IO_ADDR_W); |
| 317 | } | 322 | } |
| 318 | /* wait for data to flushed-out before reset the prefetch */ | 323 | /* wait for data to flushed-out before reset the prefetch */ |
| 319 | do { | 324 | tim = 0; |
| 320 | pref_count = gpmc_read_status(GPMC_PREFETCH_COUNT); | 325 | limit = (loops_per_jiffy * |
| 321 | } while (pref_count); | 326 | msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); |
| 327 | while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit)) | ||
| 328 | cpu_relax(); | ||
| 329 | |||
| 322 | /* disable and stop the PFPW engine */ | 330 | /* disable and stop the PFPW engine */ |
| 323 | gpmc_prefetch_reset(info->gpmc_cs); | 331 | gpmc_prefetch_reset(info->gpmc_cs); |
| 324 | } | 332 | } |
| 325 | } | 333 | } |
| 326 | 334 | ||
| 327 | #ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA | ||
| 328 | /* | 335 | /* |
| 329 | * omap_nand_dma_cb: callback on the completion of dma transfer | 336 | * omap_nand_dma_cb: callback on the completion of dma transfer |
| 330 | * @lch: logical channel | 337 | * @lch: logical channel |
| @@ -348,14 +355,15 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
| 348 | { | 355 | { |
| 349 | struct omap_nand_info *info = container_of(mtd, | 356 | struct omap_nand_info *info = container_of(mtd, |
| 350 | struct omap_nand_info, mtd); | 357 | struct omap_nand_info, mtd); |
| 351 | uint32_t prefetch_status = 0; | ||
| 352 | enum dma_data_direction dir = is_write ? DMA_TO_DEVICE : | 358 | enum dma_data_direction dir = is_write ? DMA_TO_DEVICE : |
| 353 | DMA_FROM_DEVICE; | 359 | DMA_FROM_DEVICE; |
| 354 | dma_addr_t dma_addr; | 360 | dma_addr_t dma_addr; |
| 355 | int ret; | 361 | int ret; |
| 362 | unsigned long tim, limit; | ||
| 356 | 363 | ||
| 357 | /* The fifo depth is 64 bytes. We have a sync at each frame and frame | 364 | /* The fifo depth is 64 bytes max. |
| 358 | * length is 64 bytes. | 365 | * But configure the FIFO-threahold to 32 to get a sync at each frame |
| 366 | * and frame length is 32 bytes. | ||
| 359 | */ | 367 | */ |
| 360 | int buf_len = len >> 6; | 368 | int buf_len = len >> 6; |
| 361 | 369 | ||
| @@ -396,9 +404,10 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
| 396 | OMAP24XX_DMA_GPMC, OMAP_DMA_SRC_SYNC); | 404 | OMAP24XX_DMA_GPMC, OMAP_DMA_SRC_SYNC); |
| 397 | } | 405 | } |
| 398 | /* configure and start prefetch transfer */ | 406 | /* configure and start prefetch transfer */ |
| 399 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x1, len, is_write); | 407 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
| 408 | PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write); | ||
| 400 | if (ret) | 409 | if (ret) |
| 401 | /* PFPW engine is busy, use cpu copy methode */ | 410 | /* PFPW engine is busy, use cpu copy method */ |
| 402 | goto out_copy; | 411 | goto out_copy; |
| 403 | 412 | ||
| 404 | init_completion(&info->comp); | 413 | init_completion(&info->comp); |
| @@ -407,10 +416,11 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
| 407 | 416 | ||
| 408 | /* setup and start DMA using dma_addr */ | 417 | /* setup and start DMA using dma_addr */ |
| 409 | wait_for_completion(&info->comp); | 418 | wait_for_completion(&info->comp); |
| 419 | tim = 0; | ||
| 420 | limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); | ||
| 421 | while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit)) | ||
| 422 | cpu_relax(); | ||
| 410 | 423 | ||
| 411 | do { | ||
| 412 | prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT); | ||
| 413 | } while (prefetch_status); | ||
| 414 | /* disable and stop the PFPW engine */ | 424 | /* disable and stop the PFPW engine */ |
| 415 | gpmc_prefetch_reset(info->gpmc_cs); | 425 | gpmc_prefetch_reset(info->gpmc_cs); |
| 416 | 426 | ||
| @@ -426,14 +436,6 @@ out_copy: | |||
| 426 | : omap_write_buf8(mtd, (u_char *) addr, len); | 436 | : omap_write_buf8(mtd, (u_char *) addr, len); |
| 427 | return 0; | 437 | return 0; |
| 428 | } | 438 | } |
| 429 | #else | ||
| 430 | static void omap_nand_dma_cb(int lch, u16 ch_status, void *data) {} | ||
| 431 | static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | ||
| 432 | unsigned int len, int is_write) | ||
| 433 | { | ||
| 434 | return 0; | ||
| 435 | } | ||
| 436 | #endif | ||
| 437 | 439 | ||
| 438 | /** | 440 | /** |
| 439 | * omap_read_buf_dma_pref - read data from NAND controller into buffer | 441 | * omap_read_buf_dma_pref - read data from NAND controller into buffer |
| @@ -466,6 +468,157 @@ static void omap_write_buf_dma_pref(struct mtd_info *mtd, | |||
| 466 | omap_nand_dma_transfer(mtd, (u_char *) buf, len, 0x1); | 468 | omap_nand_dma_transfer(mtd, (u_char *) buf, len, 0x1); |
| 467 | } | 469 | } |
| 468 | 470 | ||
| 471 | /* | ||
| 472 | * omap_nand_irq - GMPC irq handler | ||
| 473 | * @this_irq: gpmc irq number | ||
| 474 | * @dev: omap_nand_info structure pointer is passed here | ||
| 475 | */ | ||
| 476 | static irqreturn_t omap_nand_irq(int this_irq, void *dev) | ||
| 477 | { | ||
| 478 | struct omap_nand_info *info = (struct omap_nand_info *) dev; | ||
| 479 | u32 bytes; | ||
| 480 | u32 irq_stat; | ||
| 481 | |||
| 482 | irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS); | ||
| 483 | bytes = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT); | ||
| 484 | bytes = bytes & 0xFFFC; /* io in multiple of 4 bytes */ | ||
| 485 | if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */ | ||
| 486 | if (irq_stat & 0x2) | ||
| 487 | goto done; | ||
| 488 | |||
| 489 | if (info->buf_len && (info->buf_len < bytes)) | ||
| 490 | bytes = info->buf_len; | ||
| 491 | else if (!info->buf_len) | ||
| 492 | bytes = 0; | ||
| 493 | iowrite32_rep(info->nand.IO_ADDR_W, | ||
| 494 | (u32 *)info->buf, bytes >> 2); | ||
| 495 | info->buf = info->buf + bytes; | ||
| 496 | info->buf_len -= bytes; | ||
| 497 | |||
| 498 | } else { | ||
| 499 | ioread32_rep(info->nand.IO_ADDR_R, | ||
| 500 | (u32 *)info->buf, bytes >> 2); | ||
| 501 | info->buf = info->buf + bytes; | ||
| 502 | |||
| 503 | if (irq_stat & 0x2) | ||
| 504 | goto done; | ||
| 505 | } | ||
| 506 | gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat); | ||
| 507 | |||
| 508 | return IRQ_HANDLED; | ||
| 509 | |||
| 510 | done: | ||
| 511 | complete(&info->comp); | ||
| 512 | /* disable irq */ | ||
| 513 | gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, 0); | ||
| 514 | |||
| 515 | /* clear status */ | ||
| 516 | gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat); | ||
| 517 | |||
| 518 | return IRQ_HANDLED; | ||
| 519 | } | ||
| 520 | |||
| 521 | /* | ||
| 522 | * omap_read_buf_irq_pref - read data from NAND controller into buffer | ||
| 523 | * @mtd: MTD device structure | ||
| 524 | * @buf: buffer to store date | ||
| 525 | * @len: number of bytes to read | ||
| 526 | */ | ||
| 527 | static void omap_read_buf_irq_pref(struct mtd_info *mtd, u_char *buf, int len) | ||
| 528 | { | ||
| 529 | struct omap_nand_info *info = container_of(mtd, | ||
| 530 | struct omap_nand_info, mtd); | ||
| 531 | int ret = 0; | ||
| 532 | |||
| 533 | if (len <= mtd->oobsize) { | ||
| 534 | omap_read_buf_pref(mtd, buf, len); | ||
| 535 | return; | ||
| 536 | } | ||
| 537 | |||
| 538 | info->iomode = OMAP_NAND_IO_READ; | ||
| 539 | info->buf = buf; | ||
| 540 | init_completion(&info->comp); | ||
| 541 | |||
| 542 | /* configure and start prefetch transfer */ | ||
| 543 | ret = gpmc_prefetch_enable(info->gpmc_cs, | ||
| 544 | PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0); | ||
| 545 | if (ret) | ||
| 546 | /* PFPW engine is busy, use cpu copy method */ | ||
| 547 | goto out_copy; | ||
| 548 | |||
| 549 | info->buf_len = len; | ||
| 550 | /* enable irq */ | ||
| 551 | gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, | ||
| 552 | (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT)); | ||
| 553 | |||
| 554 | /* waiting for read to complete */ | ||
| 555 | wait_for_completion(&info->comp); | ||
| 556 | |||
| 557 | /* disable and stop the PFPW engine */ | ||
| 558 | gpmc_prefetch_reset(info->gpmc_cs); | ||
| 559 | return; | ||
| 560 | |||
| 561 | out_copy: | ||
| 562 | if (info->nand.options & NAND_BUSWIDTH_16) | ||
| 563 | omap_read_buf16(mtd, buf, len); | ||
| 564 | else | ||
| 565 | omap_read_buf8(mtd, buf, len); | ||
| 566 | } | ||
| 567 | |||
| 568 | /* | ||
| 569 | * omap_write_buf_irq_pref - write buffer to NAND controller | ||
| 570 | * @mtd: MTD device structure | ||
| 571 | * @buf: data buffer | ||
| 572 | * @len: number of bytes to write | ||
| 573 | */ | ||
| 574 | static void omap_write_buf_irq_pref(struct mtd_info *mtd, | ||
| 575 | const u_char *buf, int len) | ||
| 576 | { | ||
| 577 | struct omap_nand_info *info = container_of(mtd, | ||
| 578 | struct omap_nand_info, mtd); | ||
| 579 | int ret = 0; | ||
| 580 | unsigned long tim, limit; | ||
| 581 | |||
| 582 | if (len <= mtd->oobsize) { | ||
| 583 | omap_write_buf_pref(mtd, buf, len); | ||
| 584 | return; | ||
| 585 | } | ||
| 586 | |||
| 587 | info->iomode = OMAP_NAND_IO_WRITE; | ||
| 588 | info->buf = (u_char *) buf; | ||
| 589 | init_completion(&info->comp); | ||
| 590 | |||
| 591 | /* configure and start prefetch transfer : size=24 */ | ||
| 592 | ret = gpmc_prefetch_enable(info->gpmc_cs, | ||
| 593 | (PREFETCH_FIFOTHRESHOLD_MAX * 3) / 8, 0x0, len, 0x1); | ||
| 594 | if (ret) | ||
| 595 | /* PFPW engine is busy, use cpu copy method */ | ||
| 596 | goto out_copy; | ||
| 597 | |||
| 598 | info->buf_len = len; | ||
| 599 | /* enable irq */ | ||
| 600 | gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, | ||
| 601 | (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT)); | ||
| 602 | |||
| 603 | /* waiting for write to complete */ | ||
| 604 | wait_for_completion(&info->comp); | ||
| 605 | /* wait for data to flushed-out before reset the prefetch */ | ||
| 606 | tim = 0; | ||
| 607 | limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS)); | ||
| 608 | while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit)) | ||
| 609 | cpu_relax(); | ||
| 610 | |||
| 611 | /* disable and stop the PFPW engine */ | ||
| 612 | gpmc_prefetch_reset(info->gpmc_cs); | ||
| 613 | return; | ||
| 614 | |||
| 615 | out_copy: | ||
| 616 | if (info->nand.options & NAND_BUSWIDTH_16) | ||
| 617 | omap_write_buf16(mtd, buf, len); | ||
| 618 | else | ||
| 619 | omap_write_buf8(mtd, buf, len); | ||
| 620 | } | ||
| 621 | |||
| 469 | /** | 622 | /** |
| 470 | * omap_verify_buf - Verify chip data against buffer | 623 | * omap_verify_buf - Verify chip data against buffer |
| 471 | * @mtd: MTD device structure | 624 | * @mtd: MTD device structure |
| @@ -487,8 +640,6 @@ static int omap_verify_buf(struct mtd_info *mtd, const u_char * buf, int len) | |||
| 487 | return 0; | 640 | return 0; |
| 488 | } | 641 | } |
| 489 | 642 | ||
| 490 | #ifdef CONFIG_MTD_NAND_OMAP_HWECC | ||
| 491 | |||
| 492 | /** | 643 | /** |
| 493 | * gen_true_ecc - This function will generate true ECC value | 644 | * gen_true_ecc - This function will generate true ECC value |
| 494 | * @ecc_buf: buffer to store ecc code | 645 | * @ecc_buf: buffer to store ecc code |
| @@ -708,8 +859,6 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int mode) | |||
| 708 | gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size); | 859 | gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size); |
| 709 | } | 860 | } |
| 710 | 861 | ||
| 711 | #endif | ||
| 712 | |||
| 713 | /** | 862 | /** |
| 714 | * omap_wait - wait until the command is done | 863 | * omap_wait - wait until the command is done |
| 715 | * @mtd: MTD device structure | 864 | * @mtd: MTD device structure |
| @@ -779,6 +928,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 779 | struct omap_nand_info *info; | 928 | struct omap_nand_info *info; |
| 780 | struct omap_nand_platform_data *pdata; | 929 | struct omap_nand_platform_data *pdata; |
| 781 | int err; | 930 | int err; |
| 931 | int i, offset; | ||
| 782 | 932 | ||
| 783 | pdata = pdev->dev.platform_data; | 933 | pdata = pdev->dev.platform_data; |
| 784 | if (pdata == NULL) { | 934 | if (pdata == NULL) { |
| @@ -804,7 +954,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 804 | info->mtd.name = dev_name(&pdev->dev); | 954 | info->mtd.name = dev_name(&pdev->dev); |
| 805 | info->mtd.owner = THIS_MODULE; | 955 | info->mtd.owner = THIS_MODULE; |
| 806 | 956 | ||
| 807 | info->nand.options |= pdata->devsize ? NAND_BUSWIDTH_16 : 0; | 957 | info->nand.options = pdata->devsize; |
| 808 | info->nand.options |= NAND_SKIP_BBTSCAN; | 958 | info->nand.options |= NAND_SKIP_BBTSCAN; |
| 809 | 959 | ||
| 810 | /* NAND write protect off */ | 960 | /* NAND write protect off */ |
| @@ -842,28 +992,13 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 842 | info->nand.chip_delay = 50; | 992 | info->nand.chip_delay = 50; |
| 843 | } | 993 | } |
| 844 | 994 | ||
| 845 | if (use_prefetch) { | 995 | switch (pdata->xfer_type) { |
| 846 | 996 | case NAND_OMAP_PREFETCH_POLLED: | |
| 847 | info->nand.read_buf = omap_read_buf_pref; | 997 | info->nand.read_buf = omap_read_buf_pref; |
| 848 | info->nand.write_buf = omap_write_buf_pref; | 998 | info->nand.write_buf = omap_write_buf_pref; |
| 849 | if (use_dma) { | 999 | break; |
| 850 | err = omap_request_dma(OMAP24XX_DMA_GPMC, "NAND", | 1000 | |
| 851 | omap_nand_dma_cb, &info->comp, &info->dma_ch); | 1001 | case NAND_OMAP_POLLED: |
| 852 | if (err < 0) { | ||
| 853 | info->dma_ch = -1; | ||
| 854 | printk(KERN_WARNING "DMA request failed." | ||
| 855 | " Non-dma data transfer mode\n"); | ||
| 856 | } else { | ||
| 857 | omap_set_dma_dest_burst_mode(info->dma_ch, | ||
| 858 | OMAP_DMA_DATA_BURST_16); | ||
| 859 | omap_set_dma_src_burst_mode(info->dma_ch, | ||
| 860 | OMAP_DMA_DATA_BURST_16); | ||
| 861 | |||
| 862 | info->nand.read_buf = omap_read_buf_dma_pref; | ||
| 863 | info->nand.write_buf = omap_write_buf_dma_pref; | ||
| 864 | } | ||
| 865 | } | ||
| 866 | } else { | ||
| 867 | if (info->nand.options & NAND_BUSWIDTH_16) { | 1002 | if (info->nand.options & NAND_BUSWIDTH_16) { |
| 868 | info->nand.read_buf = omap_read_buf16; | 1003 | info->nand.read_buf = omap_read_buf16; |
| 869 | info->nand.write_buf = omap_write_buf16; | 1004 | info->nand.write_buf = omap_write_buf16; |
| @@ -871,20 +1006,61 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 871 | info->nand.read_buf = omap_read_buf8; | 1006 | info->nand.read_buf = omap_read_buf8; |
| 872 | info->nand.write_buf = omap_write_buf8; | 1007 | info->nand.write_buf = omap_write_buf8; |
| 873 | } | 1008 | } |
| 1009 | break; | ||
| 1010 | |||
| 1011 | case NAND_OMAP_PREFETCH_DMA: | ||
| 1012 | err = omap_request_dma(OMAP24XX_DMA_GPMC, "NAND", | ||
| 1013 | omap_nand_dma_cb, &info->comp, &info->dma_ch); | ||
| 1014 | if (err < 0) { | ||
| 1015 | info->dma_ch = -1; | ||
| 1016 | dev_err(&pdev->dev, "DMA request failed!\n"); | ||
| 1017 | goto out_release_mem_region; | ||
| 1018 | } else { | ||
| 1019 | omap_set_dma_dest_burst_mode(info->dma_ch, | ||
| 1020 | OMAP_DMA_DATA_BURST_16); | ||
| 1021 | omap_set_dma_src_burst_mode(info->dma_ch, | ||
| 1022 | OMAP_DMA_DATA_BURST_16); | ||
| 1023 | |||
| 1024 | info->nand.read_buf = omap_read_buf_dma_pref; | ||
| 1025 | info->nand.write_buf = omap_write_buf_dma_pref; | ||
| 1026 | } | ||
| 1027 | break; | ||
| 1028 | |||
| 1029 | case NAND_OMAP_PREFETCH_IRQ: | ||
| 1030 | err = request_irq(pdata->gpmc_irq, | ||
| 1031 | omap_nand_irq, IRQF_SHARED, "gpmc-nand", info); | ||
| 1032 | if (err) { | ||
| 1033 | dev_err(&pdev->dev, "requesting irq(%d) error:%d", | ||
| 1034 | pdata->gpmc_irq, err); | ||
| 1035 | goto out_release_mem_region; | ||
| 1036 | } else { | ||
| 1037 | info->gpmc_irq = pdata->gpmc_irq; | ||
| 1038 | info->nand.read_buf = omap_read_buf_irq_pref; | ||
| 1039 | info->nand.write_buf = omap_write_buf_irq_pref; | ||
| 1040 | } | ||
| 1041 | break; | ||
| 1042 | |||
| 1043 | default: | ||
| 1044 | dev_err(&pdev->dev, | ||
| 1045 | "xfer_type(%d) not supported!\n", pdata->xfer_type); | ||
| 1046 | err = -EINVAL; | ||
| 1047 | goto out_release_mem_region; | ||
| 874 | } | 1048 | } |
| 875 | info->nand.verify_buf = omap_verify_buf; | ||
| 876 | 1049 | ||
| 877 | #ifdef CONFIG_MTD_NAND_OMAP_HWECC | 1050 | info->nand.verify_buf = omap_verify_buf; |
| 878 | info->nand.ecc.bytes = 3; | ||
| 879 | info->nand.ecc.size = 512; | ||
| 880 | info->nand.ecc.calculate = omap_calculate_ecc; | ||
| 881 | info->nand.ecc.hwctl = omap_enable_hwecc; | ||
| 882 | info->nand.ecc.correct = omap_correct_data; | ||
| 883 | info->nand.ecc.mode = NAND_ECC_HW; | ||
| 884 | 1051 | ||
| 885 | #else | 1052 | /* selsect the ecc type */ |
| 886 | info->nand.ecc.mode = NAND_ECC_SOFT; | 1053 | if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_DEFAULT) |
| 887 | #endif | 1054 | info->nand.ecc.mode = NAND_ECC_SOFT; |
| 1055 | else if ((pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW) || | ||
| 1056 | (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE)) { | ||
| 1057 | info->nand.ecc.bytes = 3; | ||
| 1058 | info->nand.ecc.size = 512; | ||
| 1059 | info->nand.ecc.calculate = omap_calculate_ecc; | ||
| 1060 | info->nand.ecc.hwctl = omap_enable_hwecc; | ||
| 1061 | info->nand.ecc.correct = omap_correct_data; | ||
| 1062 | info->nand.ecc.mode = NAND_ECC_HW; | ||
| 1063 | } | ||
| 888 | 1064 | ||
| 889 | /* DIP switches on some boards change between 8 and 16 bit | 1065 | /* DIP switches on some boards change between 8 and 16 bit |
| 890 | * bus widths for flash. Try the other width if the first try fails. | 1066 | * bus widths for flash. Try the other width if the first try fails. |
| @@ -897,6 +1073,26 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 897 | } | 1073 | } |
| 898 | } | 1074 | } |
| 899 | 1075 | ||
| 1076 | /* rom code layout */ | ||
| 1077 | if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE) { | ||
| 1078 | |||
| 1079 | if (info->nand.options & NAND_BUSWIDTH_16) | ||
| 1080 | offset = 2; | ||
| 1081 | else { | ||
| 1082 | offset = 1; | ||
| 1083 | info->nand.badblock_pattern = &bb_descrip_flashbased; | ||
| 1084 | } | ||
| 1085 | omap_oobinfo.eccbytes = 3 * (info->mtd.oobsize/16); | ||
| 1086 | for (i = 0; i < omap_oobinfo.eccbytes; i++) | ||
| 1087 | omap_oobinfo.eccpos[i] = i+offset; | ||
| 1088 | |||
| 1089 | omap_oobinfo.oobfree->offset = offset + omap_oobinfo.eccbytes; | ||
| 1090 | omap_oobinfo.oobfree->length = info->mtd.oobsize - | ||
| 1091 | (offset + omap_oobinfo.eccbytes); | ||
| 1092 | |||
| 1093 | info->nand.ecc.layout = &omap_oobinfo; | ||
| 1094 | } | ||
| 1095 | |||
| 900 | #ifdef CONFIG_MTD_PARTITIONS | 1096 | #ifdef CONFIG_MTD_PARTITIONS |
| 901 | err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); | 1097 | err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); |
| 902 | if (err > 0) | 1098 | if (err > 0) |
| @@ -926,9 +1122,12 @@ static int omap_nand_remove(struct platform_device *pdev) | |||
| 926 | mtd); | 1122 | mtd); |
| 927 | 1123 | ||
| 928 | platform_set_drvdata(pdev, NULL); | 1124 | platform_set_drvdata(pdev, NULL); |
| 929 | if (use_dma) | 1125 | if (info->dma_ch != -1) |
| 930 | omap_free_dma(info->dma_ch); | 1126 | omap_free_dma(info->dma_ch); |
| 931 | 1127 | ||
| 1128 | if (info->gpmc_irq) | ||
| 1129 | free_irq(info->gpmc_irq, info); | ||
| 1130 | |||
| 932 | /* Release NAND device, its internal structures and partitions */ | 1131 | /* Release NAND device, its internal structures and partitions */ |
| 933 | nand_release(&info->mtd); | 1132 | nand_release(&info->mtd); |
| 934 | iounmap(info->nand.IO_ADDR_R); | 1133 | iounmap(info->nand.IO_ADDR_R); |
| @@ -947,16 +1146,8 @@ static struct platform_driver omap_nand_driver = { | |||
| 947 | 1146 | ||
| 948 | static int __init omap_nand_init(void) | 1147 | static int __init omap_nand_init(void) |
| 949 | { | 1148 | { |
| 950 | printk(KERN_INFO "%s driver initializing\n", DRIVER_NAME); | 1149 | pr_info("%s driver initializing\n", DRIVER_NAME); |
| 951 | 1150 | ||
| 952 | /* This check is required if driver is being | ||
| 953 | * loaded run time as a module | ||
| 954 | */ | ||
| 955 | if ((1 == use_dma) && (0 == use_prefetch)) { | ||
| 956 | printk(KERN_INFO"Wrong parameters: 'use_dma' can not be 1 " | ||
| 957 | "without use_prefetch'. Prefetch will not be" | ||
| 958 | " used in either mode (mpu or dma)\n"); | ||
| 959 | } | ||
| 960 | return platform_driver_register(&omap_nand_driver); | 1151 | return platform_driver_register(&omap_nand_driver); |
| 961 | } | 1152 | } |
| 962 | 1153 | ||
diff --git a/drivers/mtd/nand/r852.c b/drivers/mtd/nand/r852.c index d9d7efbc77cc..6322d1fb5d62 100644 --- a/drivers/mtd/nand/r852.c +++ b/drivers/mtd/nand/r852.c | |||
| @@ -930,7 +930,7 @@ int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | |||
| 930 | 930 | ||
| 931 | init_completion(&dev->dma_done); | 931 | init_completion(&dev->dma_done); |
| 932 | 932 | ||
| 933 | dev->card_workqueue = create_freezeable_workqueue(DRV_NAME); | 933 | dev->card_workqueue = create_freezable_workqueue(DRV_NAME); |
| 934 | 934 | ||
| 935 | if (!dev->card_workqueue) | 935 | if (!dev->card_workqueue) |
| 936 | goto error9; | 936 | goto error9; |
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index ac31f461cc1c..ec26399e3cf2 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c | |||
| @@ -63,7 +63,7 @@ struct omap2_onenand { | |||
| 63 | struct completion dma_done; | 63 | struct completion dma_done; |
| 64 | int dma_channel; | 64 | int dma_channel; |
| 65 | int freq; | 65 | int freq; |
| 66 | int (*setup)(void __iomem *base, int freq); | 66 | int (*setup)(void __iomem *base, int *freq_ptr); |
| 67 | struct regulator *regulator; | 67 | struct regulator *regulator; |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| @@ -148,11 +148,9 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state) | |||
| 148 | wait_err("controller error", state, ctrl, intr); | 148 | wait_err("controller error", state, ctrl, intr); |
| 149 | return -EIO; | 149 | return -EIO; |
| 150 | } | 150 | } |
| 151 | if ((intr & intr_flags) != intr_flags) { | 151 | if ((intr & intr_flags) == intr_flags) |
| 152 | wait_err("timeout", state, ctrl, intr); | 152 | return 0; |
| 153 | return -EIO; | 153 | /* Continue in wait for interrupt branch */ |
| 154 | } | ||
| 155 | return 0; | ||
| 156 | } | 154 | } |
| 157 | 155 | ||
| 158 | if (state != FL_READING) { | 156 | if (state != FL_READING) { |
| @@ -581,7 +579,7 @@ static int __adjust_timing(struct device *dev, void *data) | |||
| 581 | 579 | ||
| 582 | /* DMA is not in use so this is all that is needed */ | 580 | /* DMA is not in use so this is all that is needed */ |
| 583 | /* Revisit for OMAP3! */ | 581 | /* Revisit for OMAP3! */ |
| 584 | ret = c->setup(c->onenand.base, c->freq); | 582 | ret = c->setup(c->onenand.base, &c->freq); |
| 585 | 583 | ||
| 586 | return ret; | 584 | return ret; |
| 587 | } | 585 | } |
| @@ -673,7 +671,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
| 673 | } | 671 | } |
| 674 | 672 | ||
| 675 | if (pdata->onenand_setup != NULL) { | 673 | if (pdata->onenand_setup != NULL) { |
| 676 | r = pdata->onenand_setup(c->onenand.base, c->freq); | 674 | r = pdata->onenand_setup(c->onenand.base, &c->freq); |
| 677 | if (r < 0) { | 675 | if (r < 0) { |
| 678 | dev_err(&pdev->dev, "Onenand platform setup failed: " | 676 | dev_err(&pdev->dev, "Onenand platform setup failed: " |
| 679 | "%d\n", r); | 677 | "%d\n", r); |
| @@ -718,8 +716,8 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
| 718 | } | 716 | } |
| 719 | 717 | ||
| 720 | dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual " | 718 | dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual " |
| 721 | "base %p\n", c->gpmc_cs, c->phys_base, | 719 | "base %p, freq %d MHz\n", c->gpmc_cs, c->phys_base, |
| 722 | c->onenand.base); | 720 | c->onenand.base, c->freq); |
| 723 | 721 | ||
| 724 | c->pdev = pdev; | 722 | c->pdev = pdev; |
| 725 | c->mtd.name = dev_name(&pdev->dev); | 723 | c->mtd.name = dev_name(&pdev->dev); |
| @@ -754,24 +752,6 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) | |||
| 754 | if ((r = onenand_scan(&c->mtd, 1)) < 0) | 752 | if ((r = onenand_scan(&c->mtd, 1)) < 0) |
| 755 | goto err_release_regulator; | 753 | goto err_release_regulator; |
| 756 | 754 | ||
| 757 | switch ((c->onenand.version_id >> 4) & 0xf) { | ||
| 758 | case 0: | ||
| 759 | c->freq = 40; | ||
| 760 | break; | ||
| 761 | case 1: | ||
| 762 | c->freq = 54; | ||
| 763 | break; | ||
| 764 | case 2: | ||
| 765 | c->freq = 66; | ||
| 766 | break; | ||
| 767 | case 3: | ||
| 768 | c->freq = 83; | ||
| 769 | break; | ||
| 770 | case 4: | ||
| 771 | c->freq = 104; | ||
| 772 | break; | ||
| 773 | } | ||
| 774 | |||
| 775 | #ifdef CONFIG_MTD_PARTITIONS | 755 | #ifdef CONFIG_MTD_PARTITIONS |
| 776 | r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0); | 756 | r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0); |
| 777 | if (r > 0) | 757 | if (r > 0) |
diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index 67822cf6c025..ac0d6a8613b5 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c | |||
| @@ -1258,7 +1258,7 @@ static struct mtd_blktrans_ops sm_ftl_ops = { | |||
| 1258 | static __init int sm_module_init(void) | 1258 | static __init int sm_module_init(void) |
| 1259 | { | 1259 | { |
| 1260 | int error = 0; | 1260 | int error = 0; |
| 1261 | cache_flush_workqueue = create_freezeable_workqueue("smflush"); | 1261 | cache_flush_workqueue = create_freezable_workqueue("smflush"); |
| 1262 | 1262 | ||
| 1263 | if (IS_ERR(cache_flush_workqueue)) | 1263 | if (IS_ERR(cache_flush_workqueue)) |
| 1264 | return PTR_ERR(cache_flush_workqueue); | 1264 | return PTR_ERR(cache_flush_workqueue); |
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c index 7ab534aee452..7513c4523ac4 100644 --- a/drivers/net/can/mcp251x.c +++ b/drivers/net/can/mcp251x.c | |||
| @@ -940,7 +940,7 @@ static int mcp251x_open(struct net_device *net) | |||
| 940 | goto open_unlock; | 940 | goto open_unlock; |
| 941 | } | 941 | } |
| 942 | 942 | ||
| 943 | priv->wq = create_freezeable_workqueue("mcp251x_wq"); | 943 | priv->wq = create_freezable_workqueue("mcp251x_wq"); |
| 944 | INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler); | 944 | INIT_WORK(&priv->tx_work, mcp251x_tx_work_handler); |
| 945 | INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler); | 945 | INIT_WORK(&priv->restart_work, mcp251x_restart_work_handler); |
| 946 | 946 | ||
diff --git a/drivers/net/can/softing/Kconfig b/drivers/net/can/softing/Kconfig index 8ba81b3ddd90..5de46a9a77bb 100644 --- a/drivers/net/can/softing/Kconfig +++ b/drivers/net/can/softing/Kconfig | |||
| @@ -18,7 +18,7 @@ config CAN_SOFTING | |||
| 18 | config CAN_SOFTING_CS | 18 | config CAN_SOFTING_CS |
| 19 | tristate "Softing Gmbh CAN pcmcia cards" | 19 | tristate "Softing Gmbh CAN pcmcia cards" |
| 20 | depends on PCMCIA | 20 | depends on PCMCIA |
| 21 | select CAN_SOFTING | 21 | depends on CAN_SOFTING |
| 22 | ---help--- | 22 | ---help--- |
| 23 | Support for PCMCIA cards from Softing Gmbh & some cards | 23 | Support for PCMCIA cards from Softing Gmbh & some cards |
| 24 | from Vector Gmbh. | 24 | from Vector Gmbh. |
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index 56166ae2059f..6aad64df4dcb 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c | |||
| @@ -2040,7 +2040,7 @@ static int __devinit setup_debugfs(struct adapter *adapter) | |||
| 2040 | { | 2040 | { |
| 2041 | int i; | 2041 | int i; |
| 2042 | 2042 | ||
| 2043 | BUG_ON(adapter->debugfs_root == NULL); | 2043 | BUG_ON(IS_ERR_OR_NULL(adapter->debugfs_root)); |
| 2044 | 2044 | ||
| 2045 | /* | 2045 | /* |
| 2046 | * Debugfs support is best effort. | 2046 | * Debugfs support is best effort. |
| @@ -2061,7 +2061,7 @@ static int __devinit setup_debugfs(struct adapter *adapter) | |||
| 2061 | */ | 2061 | */ |
| 2062 | static void cleanup_debugfs(struct adapter *adapter) | 2062 | static void cleanup_debugfs(struct adapter *adapter) |
| 2063 | { | 2063 | { |
| 2064 | BUG_ON(adapter->debugfs_root == NULL); | 2064 | BUG_ON(IS_ERR_OR_NULL(adapter->debugfs_root)); |
| 2065 | 2065 | ||
| 2066 | /* | 2066 | /* |
| 2067 | * Unlike our sister routine cleanup_proc(), we don't need to remove | 2067 | * Unlike our sister routine cleanup_proc(), we don't need to remove |
| @@ -2489,17 +2489,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, | |||
| 2489 | struct net_device *netdev; | 2489 | struct net_device *netdev; |
| 2490 | 2490 | ||
| 2491 | /* | 2491 | /* |
| 2492 | * Vet our module parameters. | ||
| 2493 | */ | ||
| 2494 | if (msi != MSI_MSIX && msi != MSI_MSI) { | ||
| 2495 | dev_err(&pdev->dev, "bad module parameter msi=%d; must be %d" | ||
| 2496 | " (MSI-X or MSI) or %d (MSI)\n", msi, MSI_MSIX, | ||
| 2497 | MSI_MSI); | ||
| 2498 | err = -EINVAL; | ||
| 2499 | goto err_out; | ||
| 2500 | } | ||
| 2501 | |||
| 2502 | /* | ||
| 2503 | * Print our driver banner the first time we're called to initialize a | 2492 | * Print our driver banner the first time we're called to initialize a |
| 2504 | * device. | 2493 | * device. |
| 2505 | */ | 2494 | */ |
| @@ -2711,11 +2700,11 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, | |||
| 2711 | /* | 2700 | /* |
| 2712 | * Set up our debugfs entries. | 2701 | * Set up our debugfs entries. |
| 2713 | */ | 2702 | */ |
| 2714 | if (cxgb4vf_debugfs_root) { | 2703 | if (!IS_ERR_OR_NULL(cxgb4vf_debugfs_root)) { |
| 2715 | adapter->debugfs_root = | 2704 | adapter->debugfs_root = |
| 2716 | debugfs_create_dir(pci_name(pdev), | 2705 | debugfs_create_dir(pci_name(pdev), |
| 2717 | cxgb4vf_debugfs_root); | 2706 | cxgb4vf_debugfs_root); |
| 2718 | if (adapter->debugfs_root == NULL) | 2707 | if (IS_ERR_OR_NULL(adapter->debugfs_root)) |
| 2719 | dev_warn(&pdev->dev, "could not create debugfs" | 2708 | dev_warn(&pdev->dev, "could not create debugfs" |
| 2720 | " directory"); | 2709 | " directory"); |
| 2721 | else | 2710 | else |
| @@ -2770,7 +2759,7 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, | |||
| 2770 | */ | 2759 | */ |
| 2771 | 2760 | ||
| 2772 | err_free_debugfs: | 2761 | err_free_debugfs: |
| 2773 | if (adapter->debugfs_root) { | 2762 | if (!IS_ERR_OR_NULL(adapter->debugfs_root)) { |
| 2774 | cleanup_debugfs(adapter); | 2763 | cleanup_debugfs(adapter); |
| 2775 | debugfs_remove_recursive(adapter->debugfs_root); | 2764 | debugfs_remove_recursive(adapter->debugfs_root); |
| 2776 | } | 2765 | } |
| @@ -2802,7 +2791,6 @@ err_release_regions: | |||
| 2802 | err_disable_device: | 2791 | err_disable_device: |
| 2803 | pci_disable_device(pdev); | 2792 | pci_disable_device(pdev); |
| 2804 | 2793 | ||
| 2805 | err_out: | ||
| 2806 | return err; | 2794 | return err; |
| 2807 | } | 2795 | } |
| 2808 | 2796 | ||
| @@ -2840,7 +2828,7 @@ static void __devexit cxgb4vf_pci_remove(struct pci_dev *pdev) | |||
| 2840 | /* | 2828 | /* |
| 2841 | * Tear down our debugfs entries. | 2829 | * Tear down our debugfs entries. |
| 2842 | */ | 2830 | */ |
| 2843 | if (adapter->debugfs_root) { | 2831 | if (!IS_ERR_OR_NULL(adapter->debugfs_root)) { |
| 2844 | cleanup_debugfs(adapter); | 2832 | cleanup_debugfs(adapter); |
| 2845 | debugfs_remove_recursive(adapter->debugfs_root); | 2833 | debugfs_remove_recursive(adapter->debugfs_root); |
| 2846 | } | 2834 | } |
| @@ -2874,6 +2862,46 @@ static void __devexit cxgb4vf_pci_remove(struct pci_dev *pdev) | |||
| 2874 | } | 2862 | } |
| 2875 | 2863 | ||
| 2876 | /* | 2864 | /* |
| 2865 | * "Shutdown" quiesce the device, stopping Ingress Packet and Interrupt | ||
| 2866 | * delivery. | ||
| 2867 | */ | ||
| 2868 | static void __devexit cxgb4vf_pci_shutdown(struct pci_dev *pdev) | ||
| 2869 | { | ||
| 2870 | struct adapter *adapter; | ||
| 2871 | int pidx; | ||
| 2872 | |||
| 2873 | adapter = pci_get_drvdata(pdev); | ||
| 2874 | if (!adapter) | ||
| 2875 | return; | ||
| 2876 | |||
| 2877 | /* | ||
| 2878 | * Disable all Virtual Interfaces. This will shut down the | ||
| 2879 | * delivery of all ingress packets into the chip for these | ||
| 2880 | * Virtual Interfaces. | ||
| 2881 | */ | ||
| 2882 | for_each_port(adapter, pidx) { | ||
| 2883 | struct net_device *netdev; | ||
| 2884 | struct port_info *pi; | ||
| 2885 | |||
| 2886 | if (!test_bit(pidx, &adapter->registered_device_map)) | ||
| 2887 | continue; | ||
| 2888 | |||
| 2889 | netdev = adapter->port[pidx]; | ||
| 2890 | if (!netdev) | ||
| 2891 | continue; | ||
| 2892 | |||
| 2893 | pi = netdev_priv(netdev); | ||
| 2894 | t4vf_enable_vi(adapter, pi->viid, false, false); | ||
| 2895 | } | ||
| 2896 | |||
| 2897 | /* | ||
| 2898 | * Free up all Queues which will prevent further DMA and | ||
| 2899 | * Interrupts allowing various internal pathways to drain. | ||
| 2900 | */ | ||
| 2901 | t4vf_free_sge_resources(adapter); | ||
| 2902 | } | ||
| 2903 | |||
| 2904 | /* | ||
| 2877 | * PCI Device registration data structures. | 2905 | * PCI Device registration data structures. |
| 2878 | */ | 2906 | */ |
| 2879 | #define CH_DEVICE(devid, idx) \ | 2907 | #define CH_DEVICE(devid, idx) \ |
| @@ -2906,6 +2934,7 @@ static struct pci_driver cxgb4vf_driver = { | |||
| 2906 | .id_table = cxgb4vf_pci_tbl, | 2934 | .id_table = cxgb4vf_pci_tbl, |
| 2907 | .probe = cxgb4vf_pci_probe, | 2935 | .probe = cxgb4vf_pci_probe, |
| 2908 | .remove = __devexit_p(cxgb4vf_pci_remove), | 2936 | .remove = __devexit_p(cxgb4vf_pci_remove), |
| 2937 | .shutdown = __devexit_p(cxgb4vf_pci_shutdown), | ||
| 2909 | }; | 2938 | }; |
| 2910 | 2939 | ||
| 2911 | /* | 2940 | /* |
| @@ -2915,14 +2944,25 @@ static int __init cxgb4vf_module_init(void) | |||
| 2915 | { | 2944 | { |
| 2916 | int ret; | 2945 | int ret; |
| 2917 | 2946 | ||
| 2947 | /* | ||
| 2948 | * Vet our module parameters. | ||
| 2949 | */ | ||
| 2950 | if (msi != MSI_MSIX && msi != MSI_MSI) { | ||
| 2951 | printk(KERN_WARNING KBUILD_MODNAME | ||
| 2952 | ": bad module parameter msi=%d; must be %d" | ||
| 2953 | " (MSI-X or MSI) or %d (MSI)\n", | ||
| 2954 | msi, MSI_MSIX, MSI_MSI); | ||
| 2955 | return -EINVAL; | ||
| 2956 | } | ||
| 2957 | |||
| 2918 | /* Debugfs support is optional, just warn if this fails */ | 2958 | /* Debugfs support is optional, just warn if this fails */ |
| 2919 | cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); | 2959 | cxgb4vf_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL); |
| 2920 | if (!cxgb4vf_debugfs_root) | 2960 | if (IS_ERR_OR_NULL(cxgb4vf_debugfs_root)) |
| 2921 | printk(KERN_WARNING KBUILD_MODNAME ": could not create" | 2961 | printk(KERN_WARNING KBUILD_MODNAME ": could not create" |
| 2922 | " debugfs entry, continuing\n"); | 2962 | " debugfs entry, continuing\n"); |
| 2923 | 2963 | ||
| 2924 | ret = pci_register_driver(&cxgb4vf_driver); | 2964 | ret = pci_register_driver(&cxgb4vf_driver); |
| 2925 | if (ret < 0) | 2965 | if (ret < 0 && !IS_ERR_OR_NULL(cxgb4vf_debugfs_root)) |
| 2926 | debugfs_remove(cxgb4vf_debugfs_root); | 2966 | debugfs_remove(cxgb4vf_debugfs_root); |
| 2927 | return ret; | 2967 | return ret; |
| 2928 | } | 2968 | } |
diff --git a/drivers/net/cxgb4vf/t4vf_hw.c b/drivers/net/cxgb4vf/t4vf_hw.c index 0f51c80475ce..192db226ec7f 100644 --- a/drivers/net/cxgb4vf/t4vf_hw.c +++ b/drivers/net/cxgb4vf/t4vf_hw.c | |||
| @@ -171,7 +171,7 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size, | |||
| 171 | delay_idx = 0; | 171 | delay_idx = 0; |
| 172 | ms = delay[0]; | 172 | ms = delay[0]; |
| 173 | 173 | ||
| 174 | for (i = 0; i < 500; i += ms) { | 174 | for (i = 0; i < FW_CMD_MAX_TIMEOUT; i += ms) { |
| 175 | if (sleep_ok) { | 175 | if (sleep_ok) { |
| 176 | ms = delay[delay_idx]; | 176 | ms = delay[delay_idx]; |
| 177 | if (delay_idx < ARRAY_SIZE(delay) - 1) | 177 | if (delay_idx < ARRAY_SIZE(delay) - 1) |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 2d4c4fc1d900..461dd6f905f7 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
| @@ -802,10 +802,7 @@ dm9000_init_dm9000(struct net_device *dev) | |||
| 802 | /* Checksum mode */ | 802 | /* Checksum mode */ |
| 803 | dm9000_set_rx_csum_unlocked(dev, db->rx_csum); | 803 | dm9000_set_rx_csum_unlocked(dev, db->rx_csum); |
| 804 | 804 | ||
| 805 | /* GPIO0 on pre-activate PHY */ | ||
| 806 | iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ | ||
| 807 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ | 805 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ |
| 808 | iow(db, DM9000_GPR, 0); /* Enable PHY */ | ||
| 809 | 806 | ||
| 810 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; | 807 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; |
| 811 | 808 | ||
| @@ -852,8 +849,8 @@ static void dm9000_timeout(struct net_device *dev) | |||
| 852 | unsigned long flags; | 849 | unsigned long flags; |
| 853 | 850 | ||
| 854 | /* Save previous register address */ | 851 | /* Save previous register address */ |
| 855 | reg_save = readb(db->io_addr); | ||
| 856 | spin_lock_irqsave(&db->lock, flags); | 852 | spin_lock_irqsave(&db->lock, flags); |
| 853 | reg_save = readb(db->io_addr); | ||
| 857 | 854 | ||
| 858 | netif_stop_queue(dev); | 855 | netif_stop_queue(dev); |
| 859 | dm9000_reset(db); | 856 | dm9000_reset(db); |
| @@ -1194,6 +1191,10 @@ dm9000_open(struct net_device *dev) | |||
| 1194 | if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev)) | 1191 | if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev)) |
| 1195 | return -EAGAIN; | 1192 | return -EAGAIN; |
| 1196 | 1193 | ||
| 1194 | /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */ | ||
| 1195 | iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ | ||
| 1196 | mdelay(1); /* delay needs by DM9000B */ | ||
| 1197 | |||
| 1197 | /* Initialize DM9000 board */ | 1198 | /* Initialize DM9000 board */ |
| 1198 | dm9000_reset(db); | 1199 | dm9000_reset(db); |
| 1199 | dm9000_init_dm9000(dev); | 1200 | dm9000_init_dm9000(dev); |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 3065870cf2a7..3fa110ddb041 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
| @@ -937,6 +937,9 @@ static void e1000_print_hw_hang(struct work_struct *work) | |||
| 937 | u16 phy_status, phy_1000t_status, phy_ext_status; | 937 | u16 phy_status, phy_1000t_status, phy_ext_status; |
| 938 | u16 pci_status; | 938 | u16 pci_status; |
| 939 | 939 | ||
| 940 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
| 941 | return; | ||
| 942 | |||
| 940 | e1e_rphy(hw, PHY_STATUS, &phy_status); | 943 | e1e_rphy(hw, PHY_STATUS, &phy_status); |
| 941 | e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status); | 944 | e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status); |
| 942 | e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status); | 945 | e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status); |
| @@ -1506,6 +1509,9 @@ static void e1000e_downshift_workaround(struct work_struct *work) | |||
| 1506 | struct e1000_adapter *adapter = container_of(work, | 1509 | struct e1000_adapter *adapter = container_of(work, |
| 1507 | struct e1000_adapter, downshift_task); | 1510 | struct e1000_adapter, downshift_task); |
| 1508 | 1511 | ||
| 1512 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
| 1513 | return; | ||
| 1514 | |||
| 1509 | e1000e_gig_downshift_workaround_ich8lan(&adapter->hw); | 1515 | e1000e_gig_downshift_workaround_ich8lan(&adapter->hw); |
| 1510 | } | 1516 | } |
| 1511 | 1517 | ||
| @@ -3338,6 +3344,21 @@ int e1000e_up(struct e1000_adapter *adapter) | |||
| 3338 | return 0; | 3344 | return 0; |
| 3339 | } | 3345 | } |
| 3340 | 3346 | ||
| 3347 | static void e1000e_flush_descriptors(struct e1000_adapter *adapter) | ||
| 3348 | { | ||
| 3349 | struct e1000_hw *hw = &adapter->hw; | ||
| 3350 | |||
| 3351 | if (!(adapter->flags2 & FLAG2_DMA_BURST)) | ||
| 3352 | return; | ||
| 3353 | |||
| 3354 | /* flush pending descriptor writebacks to memory */ | ||
| 3355 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); | ||
| 3356 | ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD); | ||
| 3357 | |||
| 3358 | /* execute the writes immediately */ | ||
| 3359 | e1e_flush(); | ||
| 3360 | } | ||
| 3361 | |||
| 3341 | void e1000e_down(struct e1000_adapter *adapter) | 3362 | void e1000e_down(struct e1000_adapter *adapter) |
| 3342 | { | 3363 | { |
| 3343 | struct net_device *netdev = adapter->netdev; | 3364 | struct net_device *netdev = adapter->netdev; |
| @@ -3377,6 +3398,9 @@ void e1000e_down(struct e1000_adapter *adapter) | |||
| 3377 | 3398 | ||
| 3378 | if (!pci_channel_offline(adapter->pdev)) | 3399 | if (!pci_channel_offline(adapter->pdev)) |
| 3379 | e1000e_reset(adapter); | 3400 | e1000e_reset(adapter); |
| 3401 | |||
| 3402 | e1000e_flush_descriptors(adapter); | ||
| 3403 | |||
| 3380 | e1000_clean_tx_ring(adapter); | 3404 | e1000_clean_tx_ring(adapter); |
| 3381 | e1000_clean_rx_ring(adapter); | 3405 | e1000_clean_rx_ring(adapter); |
| 3382 | 3406 | ||
| @@ -3765,6 +3789,10 @@ static void e1000e_update_phy_task(struct work_struct *work) | |||
| 3765 | { | 3789 | { |
| 3766 | struct e1000_adapter *adapter = container_of(work, | 3790 | struct e1000_adapter *adapter = container_of(work, |
| 3767 | struct e1000_adapter, update_phy_task); | 3791 | struct e1000_adapter, update_phy_task); |
| 3792 | |||
| 3793 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
| 3794 | return; | ||
| 3795 | |||
| 3768 | e1000_get_phy_info(&adapter->hw); | 3796 | e1000_get_phy_info(&adapter->hw); |
| 3769 | } | 3797 | } |
| 3770 | 3798 | ||
| @@ -3775,6 +3803,10 @@ static void e1000e_update_phy_task(struct work_struct *work) | |||
| 3775 | static void e1000_update_phy_info(unsigned long data) | 3803 | static void e1000_update_phy_info(unsigned long data) |
| 3776 | { | 3804 | { |
| 3777 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 3805 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; |
| 3806 | |||
| 3807 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
| 3808 | return; | ||
| 3809 | |||
| 3778 | schedule_work(&adapter->update_phy_task); | 3810 | schedule_work(&adapter->update_phy_task); |
| 3779 | } | 3811 | } |
| 3780 | 3812 | ||
| @@ -4149,6 +4181,9 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
| 4149 | u32 link, tctl; | 4181 | u32 link, tctl; |
| 4150 | int tx_pending = 0; | 4182 | int tx_pending = 0; |
| 4151 | 4183 | ||
| 4184 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
| 4185 | return; | ||
| 4186 | |||
| 4152 | link = e1000e_has_link(adapter); | 4187 | link = e1000e_has_link(adapter); |
| 4153 | if ((netif_carrier_ok(netdev)) && link) { | 4188 | if ((netif_carrier_ok(netdev)) && link) { |
| 4154 | /* Cancel scheduled suspend requests. */ | 4189 | /* Cancel scheduled suspend requests. */ |
| @@ -4337,19 +4372,12 @@ link_up: | |||
| 4337 | else | 4372 | else |
| 4338 | ew32(ICS, E1000_ICS_RXDMT0); | 4373 | ew32(ICS, E1000_ICS_RXDMT0); |
| 4339 | 4374 | ||
| 4375 | /* flush pending descriptors to memory before detecting Tx hang */ | ||
| 4376 | e1000e_flush_descriptors(adapter); | ||
| 4377 | |||
| 4340 | /* Force detection of hung controller every watchdog period */ | 4378 | /* Force detection of hung controller every watchdog period */ |
| 4341 | adapter->detect_tx_hung = 1; | 4379 | adapter->detect_tx_hung = 1; |
| 4342 | 4380 | ||
| 4343 | /* flush partial descriptors to memory before detecting Tx hang */ | ||
| 4344 | if (adapter->flags2 & FLAG2_DMA_BURST) { | ||
| 4345 | ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); | ||
| 4346 | ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD); | ||
| 4347 | /* | ||
| 4348 | * no need to flush the writes because the timeout code does | ||
| 4349 | * an er32 first thing | ||
| 4350 | */ | ||
| 4351 | } | ||
| 4352 | |||
| 4353 | /* | 4381 | /* |
| 4354 | * With 82571 controllers, LAA may be overwritten due to controller | 4382 | * With 82571 controllers, LAA may be overwritten due to controller |
| 4355 | * reset from the other port. Set the appropriate LAA in RAR[0] | 4383 | * reset from the other port. Set the appropriate LAA in RAR[0] |
| @@ -4887,6 +4915,10 @@ static void e1000_reset_task(struct work_struct *work) | |||
| 4887 | struct e1000_adapter *adapter; | 4915 | struct e1000_adapter *adapter; |
| 4888 | adapter = container_of(work, struct e1000_adapter, reset_task); | 4916 | adapter = container_of(work, struct e1000_adapter, reset_task); |
| 4889 | 4917 | ||
| 4918 | /* don't run the task if already down */ | ||
| 4919 | if (test_bit(__E1000_DOWN, &adapter->state)) | ||
| 4920 | return; | ||
| 4921 | |||
| 4890 | if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) && | 4922 | if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) && |
| 4891 | (adapter->flags & FLAG_RX_RESTART_NOW))) { | 4923 | (adapter->flags & FLAG_RX_RESTART_NOW))) { |
| 4892 | e1000e_dump(adapter); | 4924 | e1000e_dump(adapter); |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index af09296ef0dd..9c0b1bac6af6 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
| @@ -5645,6 +5645,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
| 5645 | goto out_error; | 5645 | goto out_error; |
| 5646 | } | 5646 | } |
| 5647 | 5647 | ||
| 5648 | netif_carrier_off(dev); | ||
| 5649 | |||
| 5648 | dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n", | 5650 | dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n", |
| 5649 | dev->name, np->phy_oui, np->phyaddr, dev->dev_addr); | 5651 | dev->name, np->phy_oui, np->phyaddr, dev->dev_addr); |
| 5650 | 5652 | ||
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index 8753980668c7..c54a88274d51 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
| @@ -159,7 +159,7 @@ int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid, | |||
| 159 | struct scatterlist *sg; | 159 | struct scatterlist *sg; |
| 160 | unsigned int i, j, dmacount; | 160 | unsigned int i, j, dmacount; |
| 161 | unsigned int len; | 161 | unsigned int len; |
| 162 | static const unsigned int bufflen = 4096; | 162 | static const unsigned int bufflen = IXGBE_FCBUFF_MIN; |
| 163 | unsigned int firstoff = 0; | 163 | unsigned int firstoff = 0; |
| 164 | unsigned int lastsize; | 164 | unsigned int lastsize; |
| 165 | unsigned int thisoff = 0; | 165 | unsigned int thisoff = 0; |
| @@ -254,6 +254,24 @@ int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid, | |||
| 254 | /* only the last buffer may have non-full bufflen */ | 254 | /* only the last buffer may have non-full bufflen */ |
| 255 | lastsize = thisoff + thislen; | 255 | lastsize = thisoff + thislen; |
| 256 | 256 | ||
| 257 | /* | ||
| 258 | * lastsize can not be buffer len. | ||
| 259 | * If it is then adding another buffer with lastsize = 1. | ||
| 260 | */ | ||
| 261 | if (lastsize == bufflen) { | ||
| 262 | if (j >= IXGBE_BUFFCNT_MAX) { | ||
| 263 | e_err(drv, "xid=%x:%d,%d,%d:addr=%llx " | ||
| 264 | "not enough user buffers. We need an extra " | ||
| 265 | "buffer because lastsize is bufflen.\n", | ||
| 266 | xid, i, j, dmacount, (u64)addr); | ||
| 267 | goto out_noddp_free; | ||
| 268 | } | ||
| 269 | |||
| 270 | ddp->udl[j] = (u64)(fcoe->extra_ddp_buffer_dma); | ||
| 271 | j++; | ||
| 272 | lastsize = 1; | ||
| 273 | } | ||
| 274 | |||
| 257 | fcbuff = (IXGBE_FCBUFF_4KB << IXGBE_FCBUFF_BUFFSIZE_SHIFT); | 275 | fcbuff = (IXGBE_FCBUFF_4KB << IXGBE_FCBUFF_BUFFSIZE_SHIFT); |
| 258 | fcbuff |= ((j & 0xff) << IXGBE_FCBUFF_BUFFCNT_SHIFT); | 276 | fcbuff |= ((j & 0xff) << IXGBE_FCBUFF_BUFFCNT_SHIFT); |
| 259 | fcbuff |= (firstoff << IXGBE_FCBUFF_OFFSET_SHIFT); | 277 | fcbuff |= (firstoff << IXGBE_FCBUFF_OFFSET_SHIFT); |
| @@ -532,6 +550,24 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter) | |||
| 532 | e_err(drv, "failed to allocated FCoE DDP pool\n"); | 550 | e_err(drv, "failed to allocated FCoE DDP pool\n"); |
| 533 | 551 | ||
| 534 | spin_lock_init(&fcoe->lock); | 552 | spin_lock_init(&fcoe->lock); |
| 553 | |||
| 554 | /* Extra buffer to be shared by all DDPs for HW work around */ | ||
| 555 | fcoe->extra_ddp_buffer = kmalloc(IXGBE_FCBUFF_MIN, GFP_ATOMIC); | ||
| 556 | if (fcoe->extra_ddp_buffer == NULL) { | ||
| 557 | e_err(drv, "failed to allocated extra DDP buffer\n"); | ||
| 558 | goto out_extra_ddp_buffer_alloc; | ||
| 559 | } | ||
| 560 | |||
| 561 | fcoe->extra_ddp_buffer_dma = | ||
| 562 | dma_map_single(&adapter->pdev->dev, | ||
| 563 | fcoe->extra_ddp_buffer, | ||
| 564 | IXGBE_FCBUFF_MIN, | ||
| 565 | DMA_FROM_DEVICE); | ||
| 566 | if (dma_mapping_error(&adapter->pdev->dev, | ||
| 567 | fcoe->extra_ddp_buffer_dma)) { | ||
| 568 | e_err(drv, "failed to map extra DDP buffer\n"); | ||
| 569 | goto out_extra_ddp_buffer_dma; | ||
| 570 | } | ||
| 535 | } | 571 | } |
| 536 | 572 | ||
| 537 | /* Enable L2 eth type filter for FCoE */ | 573 | /* Enable L2 eth type filter for FCoE */ |
| @@ -581,6 +617,14 @@ void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter) | |||
| 581 | } | 617 | } |
| 582 | } | 618 | } |
| 583 | #endif | 619 | #endif |
| 620 | |||
| 621 | return; | ||
| 622 | |||
| 623 | out_extra_ddp_buffer_dma: | ||
| 624 | kfree(fcoe->extra_ddp_buffer); | ||
| 625 | out_extra_ddp_buffer_alloc: | ||
| 626 | pci_pool_destroy(fcoe->pool); | ||
| 627 | fcoe->pool = NULL; | ||
| 584 | } | 628 | } |
| 585 | 629 | ||
| 586 | /** | 630 | /** |
| @@ -600,6 +644,11 @@ void ixgbe_cleanup_fcoe(struct ixgbe_adapter *adapter) | |||
| 600 | if (fcoe->pool) { | 644 | if (fcoe->pool) { |
| 601 | for (i = 0; i < IXGBE_FCOE_DDP_MAX; i++) | 645 | for (i = 0; i < IXGBE_FCOE_DDP_MAX; i++) |
| 602 | ixgbe_fcoe_ddp_put(adapter->netdev, i); | 646 | ixgbe_fcoe_ddp_put(adapter->netdev, i); |
| 647 | dma_unmap_single(&adapter->pdev->dev, | ||
| 648 | fcoe->extra_ddp_buffer_dma, | ||
| 649 | IXGBE_FCBUFF_MIN, | ||
| 650 | DMA_FROM_DEVICE); | ||
| 651 | kfree(fcoe->extra_ddp_buffer); | ||
| 603 | pci_pool_destroy(fcoe->pool); | 652 | pci_pool_destroy(fcoe->pool); |
| 604 | fcoe->pool = NULL; | 653 | fcoe->pool = NULL; |
| 605 | } | 654 | } |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.h b/drivers/net/ixgbe/ixgbe_fcoe.h index 4bc2c551c8db..65cc8fb14fe7 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.h +++ b/drivers/net/ixgbe/ixgbe_fcoe.h | |||
| @@ -70,6 +70,8 @@ struct ixgbe_fcoe { | |||
| 70 | spinlock_t lock; | 70 | spinlock_t lock; |
| 71 | struct pci_pool *pool; | 71 | struct pci_pool *pool; |
| 72 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX]; | 72 | struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX]; |
| 73 | unsigned char *extra_ddp_buffer; | ||
| 74 | dma_addr_t extra_ddp_buffer_dma; | ||
| 73 | }; | 75 | }; |
| 74 | 76 | ||
| 75 | #endif /* _IXGBE_FCOE_H */ | 77 | #endif /* _IXGBE_FCOE_H */ |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index fbae703b46d7..30f9ccfb4f87 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -3728,7 +3728,8 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter) | |||
| 3728 | * We need to try and force an autonegotiation | 3728 | * We need to try and force an autonegotiation |
| 3729 | * session, then bring up link. | 3729 | * session, then bring up link. |
| 3730 | */ | 3730 | */ |
| 3731 | hw->mac.ops.setup_sfp(hw); | 3731 | if (hw->mac.ops.setup_sfp) |
| 3732 | hw->mac.ops.setup_sfp(hw); | ||
| 3732 | if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK)) | 3733 | if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK)) |
| 3733 | schedule_work(&adapter->multispeed_fiber_task); | 3734 | schedule_work(&adapter->multispeed_fiber_task); |
| 3734 | } else { | 3735 | } else { |
| @@ -5968,7 +5969,8 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) | |||
| 5968 | unregister_netdev(adapter->netdev); | 5969 | unregister_netdev(adapter->netdev); |
| 5969 | return; | 5970 | return; |
| 5970 | } | 5971 | } |
| 5971 | hw->mac.ops.setup_sfp(hw); | 5972 | if (hw->mac.ops.setup_sfp) |
| 5973 | hw->mac.ops.setup_sfp(hw); | ||
| 5972 | 5974 | ||
| 5973 | if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK)) | 5975 | if (!(adapter->flags & IXGBE_FLAG_IN_SFP_LINK_TASK)) |
| 5974 | /* This will also work for DA Twinax connections */ | 5976 | /* This will also work for DA Twinax connections */ |
diff --git a/drivers/net/pch_gbe/pch_gbe.h b/drivers/net/pch_gbe/pch_gbe.h index a0c26a99520f..e1e33c80fb25 100644 --- a/drivers/net/pch_gbe/pch_gbe.h +++ b/drivers/net/pch_gbe/pch_gbe.h | |||
| @@ -73,7 +73,7 @@ struct pch_gbe_regs { | |||
| 73 | struct pch_gbe_regs_mac_adr mac_adr[16]; | 73 | struct pch_gbe_regs_mac_adr mac_adr[16]; |
| 74 | u32 ADDR_MASK; | 74 | u32 ADDR_MASK; |
| 75 | u32 MIIM; | 75 | u32 MIIM; |
| 76 | u32 reserve2; | 76 | u32 MAC_ADDR_LOAD; |
| 77 | u32 RGMII_ST; | 77 | u32 RGMII_ST; |
| 78 | u32 RGMII_CTRL; | 78 | u32 RGMII_CTRL; |
| 79 | u32 reserve3[3]; | 79 | u32 reserve3[3]; |
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c index 4c9a7d4f3fca..b99e90aca37d 100644 --- a/drivers/net/pch_gbe/pch_gbe_main.c +++ b/drivers/net/pch_gbe/pch_gbe_main.c | |||
| @@ -29,6 +29,7 @@ const char pch_driver_version[] = DRV_VERSION; | |||
| 29 | #define PCH_GBE_SHORT_PKT 64 | 29 | #define PCH_GBE_SHORT_PKT 64 |
| 30 | #define DSC_INIT16 0xC000 | 30 | #define DSC_INIT16 0xC000 |
| 31 | #define PCH_GBE_DMA_ALIGN 0 | 31 | #define PCH_GBE_DMA_ALIGN 0 |
| 32 | #define PCH_GBE_DMA_PADDING 2 | ||
| 32 | #define PCH_GBE_WATCHDOG_PERIOD (1 * HZ) /* watchdog time */ | 33 | #define PCH_GBE_WATCHDOG_PERIOD (1 * HZ) /* watchdog time */ |
| 33 | #define PCH_GBE_COPYBREAK_DEFAULT 256 | 34 | #define PCH_GBE_COPYBREAK_DEFAULT 256 |
| 34 | #define PCH_GBE_PCI_BAR 1 | 35 | #define PCH_GBE_PCI_BAR 1 |
| @@ -88,6 +89,12 @@ static unsigned int copybreak __read_mostly = PCH_GBE_COPYBREAK_DEFAULT; | |||
| 88 | static int pch_gbe_mdio_read(struct net_device *netdev, int addr, int reg); | 89 | static int pch_gbe_mdio_read(struct net_device *netdev, int addr, int reg); |
| 89 | static void pch_gbe_mdio_write(struct net_device *netdev, int addr, int reg, | 90 | static void pch_gbe_mdio_write(struct net_device *netdev, int addr, int reg, |
| 90 | int data); | 91 | int data); |
| 92 | |||
| 93 | inline void pch_gbe_mac_load_mac_addr(struct pch_gbe_hw *hw) | ||
| 94 | { | ||
| 95 | iowrite32(0x01, &hw->reg->MAC_ADDR_LOAD); | ||
| 96 | } | ||
| 97 | |||
| 91 | /** | 98 | /** |
| 92 | * pch_gbe_mac_read_mac_addr - Read MAC address | 99 | * pch_gbe_mac_read_mac_addr - Read MAC address |
| 93 | * @hw: Pointer to the HW structure | 100 | * @hw: Pointer to the HW structure |
| @@ -1365,16 +1372,13 @@ pch_gbe_clean_rx(struct pch_gbe_adapter *adapter, | |||
| 1365 | struct pch_gbe_buffer *buffer_info; | 1372 | struct pch_gbe_buffer *buffer_info; |
| 1366 | struct pch_gbe_rx_desc *rx_desc; | 1373 | struct pch_gbe_rx_desc *rx_desc; |
| 1367 | u32 length; | 1374 | u32 length; |
| 1368 | unsigned char tmp_packet[ETH_HLEN]; | ||
| 1369 | unsigned int i; | 1375 | unsigned int i; |
| 1370 | unsigned int cleaned_count = 0; | 1376 | unsigned int cleaned_count = 0; |
| 1371 | bool cleaned = false; | 1377 | bool cleaned = false; |
| 1372 | struct sk_buff *skb; | 1378 | struct sk_buff *skb, *new_skb; |
| 1373 | u8 dma_status; | 1379 | u8 dma_status; |
| 1374 | u16 gbec_status; | 1380 | u16 gbec_status; |
| 1375 | u32 tcp_ip_status; | 1381 | u32 tcp_ip_status; |
| 1376 | u8 skb_copy_flag = 0; | ||
| 1377 | u8 skb_padding_flag = 0; | ||
| 1378 | 1382 | ||
| 1379 | i = rx_ring->next_to_clean; | 1383 | i = rx_ring->next_to_clean; |
| 1380 | 1384 | ||
| @@ -1418,55 +1422,70 @@ pch_gbe_clean_rx(struct pch_gbe_adapter *adapter, | |||
| 1418 | pr_err("Receive CRC Error\n"); | 1422 | pr_err("Receive CRC Error\n"); |
| 1419 | } else { | 1423 | } else { |
| 1420 | /* get receive length */ | 1424 | /* get receive length */ |
| 1421 | /* length convert[-3], padding[-2] */ | 1425 | /* length convert[-3] */ |
| 1422 | length = (rx_desc->rx_words_eob) - 3 - 2; | 1426 | length = (rx_desc->rx_words_eob) - 3; |
| 1423 | 1427 | ||
| 1424 | /* Decide the data conversion method */ | 1428 | /* Decide the data conversion method */ |
| 1425 | if (!adapter->rx_csum) { | 1429 | if (!adapter->rx_csum) { |
| 1426 | /* [Header:14][payload] */ | 1430 | /* [Header:14][payload] */ |
| 1427 | skb_padding_flag = 0; | 1431 | if (NET_IP_ALIGN) { |
| 1428 | skb_copy_flag = 1; | 1432 | /* Because alignment differs, |
| 1433 | * the new_skb is newly allocated, | ||
| 1434 | * and data is copied to new_skb.*/ | ||
| 1435 | new_skb = netdev_alloc_skb(netdev, | ||
| 1436 | length + NET_IP_ALIGN); | ||
| 1437 | if (!new_skb) { | ||
| 1438 | /* dorrop error */ | ||
| 1439 | pr_err("New skb allocation " | ||
| 1440 | "Error\n"); | ||
| 1441 | goto dorrop; | ||
| 1442 | } | ||
| 1443 | skb_reserve(new_skb, NET_IP_ALIGN); | ||
| 1444 | memcpy(new_skb->data, skb->data, | ||
| 1445 | length); | ||
| 1446 | skb = new_skb; | ||
| 1447 | } else { | ||
| 1448 | /* DMA buffer is used as SKB as it is.*/ | ||
| 1449 | buffer_info->skb = NULL; | ||
| 1450 | } | ||
| 1429 | } else { | 1451 | } else { |
| 1430 | /* [Header:14][padding:2][payload] */ | 1452 | /* [Header:14][padding:2][payload] */ |
| 1431 | skb_padding_flag = 1; | 1453 | /* The length includes padding length */ |
| 1432 | if (length < copybreak) | 1454 | length = length - PCH_GBE_DMA_PADDING; |
| 1433 | skb_copy_flag = 1; | 1455 | if ((length < copybreak) || |
| 1434 | else | 1456 | (NET_IP_ALIGN != PCH_GBE_DMA_PADDING)) { |
| 1435 | skb_copy_flag = 0; | 1457 | /* Because alignment differs, |
| 1436 | } | 1458 | * the new_skb is newly allocated, |
| 1437 | 1459 | * and data is copied to new_skb. | |
| 1438 | /* Data conversion */ | 1460 | * Padding data is deleted |
| 1439 | if (skb_copy_flag) { /* recycle skb */ | 1461 | * at the time of a copy.*/ |
| 1440 | struct sk_buff *new_skb; | 1462 | new_skb = netdev_alloc_skb(netdev, |
| 1441 | new_skb = | 1463 | length + NET_IP_ALIGN); |
| 1442 | netdev_alloc_skb(netdev, | 1464 | if (!new_skb) { |
| 1443 | length + NET_IP_ALIGN); | 1465 | /* dorrop error */ |
| 1444 | if (new_skb) { | 1466 | pr_err("New skb allocation " |
| 1445 | if (!skb_padding_flag) { | 1467 | "Error\n"); |
| 1446 | skb_reserve(new_skb, | 1468 | goto dorrop; |
| 1447 | NET_IP_ALIGN); | ||
| 1448 | } | 1469 | } |
| 1470 | skb_reserve(new_skb, NET_IP_ALIGN); | ||
| 1449 | memcpy(new_skb->data, skb->data, | 1471 | memcpy(new_skb->data, skb->data, |
| 1450 | length); | 1472 | ETH_HLEN); |
| 1451 | /* save the skb | 1473 | memcpy(&new_skb->data[ETH_HLEN], |
| 1452 | * in buffer_info as good */ | 1474 | &skb->data[ETH_HLEN + |
| 1475 | PCH_GBE_DMA_PADDING], | ||
| 1476 | length - ETH_HLEN); | ||
| 1453 | skb = new_skb; | 1477 | skb = new_skb; |
| 1454 | } else if (!skb_padding_flag) { | 1478 | } else { |
| 1455 | /* dorrop error */ | 1479 | /* Padding data is deleted |
| 1456 | pr_err("New skb allocation Error\n"); | 1480 | * by moving header data.*/ |
| 1457 | goto dorrop; | 1481 | memmove(&skb->data[PCH_GBE_DMA_PADDING], |
| 1482 | &skb->data[0], ETH_HLEN); | ||
| 1483 | skb_reserve(skb, NET_IP_ALIGN); | ||
| 1484 | buffer_info->skb = NULL; | ||
| 1458 | } | 1485 | } |
| 1459 | } else { | ||
| 1460 | buffer_info->skb = NULL; | ||
| 1461 | } | 1486 | } |
| 1462 | if (skb_padding_flag) { | 1487 | /* The length includes FCS length */ |
| 1463 | memcpy(&tmp_packet[0], &skb->data[0], ETH_HLEN); | 1488 | length = length - ETH_FCS_LEN; |
| 1464 | memcpy(&skb->data[NET_IP_ALIGN], &tmp_packet[0], | ||
| 1465 | ETH_HLEN); | ||
| 1466 | skb_reserve(skb, NET_IP_ALIGN); | ||
| 1467 | |||
| 1468 | } | ||
| 1469 | |||
| 1470 | /* update status of driver */ | 1489 | /* update status of driver */ |
| 1471 | adapter->stats.rx_bytes += length; | 1490 | adapter->stats.rx_bytes += length; |
| 1472 | adapter->stats.rx_packets++; | 1491 | adapter->stats.rx_packets++; |
| @@ -2318,6 +2337,7 @@ static int pch_gbe_probe(struct pci_dev *pdev, | |||
| 2318 | netdev->features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_GRO; | 2337 | netdev->features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_GRO; |
| 2319 | pch_gbe_set_ethtool_ops(netdev); | 2338 | pch_gbe_set_ethtool_ops(netdev); |
| 2320 | 2339 | ||
| 2340 | pch_gbe_mac_load_mac_addr(&adapter->hw); | ||
| 2321 | pch_gbe_mac_reset_hw(&adapter->hw); | 2341 | pch_gbe_mac_reset_hw(&adapter->hw); |
| 2322 | 2342 | ||
| 2323 | /* setup the private structure */ | 2343 | /* setup the private structure */ |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 59ccf0c5c610..ef2133b16f8c 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -617,8 +617,9 @@ static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data) | |||
| 617 | } | 617 | } |
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd) | 620 | static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd) |
| 621 | { | 621 | { |
| 622 | void __iomem *ioaddr = tp->mmio_addr; | ||
| 622 | int i; | 623 | int i; |
| 623 | 624 | ||
| 624 | RTL_W8(ERIDR, cmd); | 625 | RTL_W8(ERIDR, cmd); |
| @@ -630,7 +631,7 @@ static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd) | |||
| 630 | break; | 631 | break; |
| 631 | } | 632 | } |
| 632 | 633 | ||
| 633 | ocp_write(ioaddr, 0x1, 0x30, 0x00000001); | 634 | ocp_write(tp, 0x1, 0x30, 0x00000001); |
| 634 | } | 635 | } |
| 635 | 636 | ||
| 636 | #define OOB_CMD_RESET 0x00 | 637 | #define OOB_CMD_RESET 0x00 |
| @@ -2868,8 +2869,11 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) | |||
| 2868 | { | 2869 | { |
| 2869 | void __iomem *ioaddr = tp->mmio_addr; | 2870 | void __iomem *ioaddr = tp->mmio_addr; |
| 2870 | 2871 | ||
| 2871 | if (tp->mac_version == RTL_GIGA_MAC_VER_27) | 2872 | if (((tp->mac_version == RTL_GIGA_MAC_VER_27) || |
| 2873 | (tp->mac_version == RTL_GIGA_MAC_VER_28)) && | ||
| 2874 | (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) { | ||
| 2872 | return; | 2875 | return; |
| 2876 | } | ||
| 2873 | 2877 | ||
| 2874 | if (((tp->mac_version == RTL_GIGA_MAC_VER_23) || | 2878 | if (((tp->mac_version == RTL_GIGA_MAC_VER_23) || |
| 2875 | (tp->mac_version == RTL_GIGA_MAC_VER_24)) && | 2879 | (tp->mac_version == RTL_GIGA_MAC_VER_24)) && |
| @@ -2891,6 +2895,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) | |||
| 2891 | switch (tp->mac_version) { | 2895 | switch (tp->mac_version) { |
| 2892 | case RTL_GIGA_MAC_VER_25: | 2896 | case RTL_GIGA_MAC_VER_25: |
| 2893 | case RTL_GIGA_MAC_VER_26: | 2897 | case RTL_GIGA_MAC_VER_26: |
| 2898 | case RTL_GIGA_MAC_VER_27: | ||
| 2899 | case RTL_GIGA_MAC_VER_28: | ||
| 2894 | RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80); | 2900 | RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80); |
| 2895 | break; | 2901 | break; |
| 2896 | } | 2902 | } |
| @@ -2900,12 +2906,17 @@ static void r8168_pll_power_up(struct rtl8169_private *tp) | |||
| 2900 | { | 2906 | { |
| 2901 | void __iomem *ioaddr = tp->mmio_addr; | 2907 | void __iomem *ioaddr = tp->mmio_addr; |
| 2902 | 2908 | ||
| 2903 | if (tp->mac_version == RTL_GIGA_MAC_VER_27) | 2909 | if (((tp->mac_version == RTL_GIGA_MAC_VER_27) || |
| 2910 | (tp->mac_version == RTL_GIGA_MAC_VER_28)) && | ||
| 2911 | (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) { | ||
| 2904 | return; | 2912 | return; |
| 2913 | } | ||
| 2905 | 2914 | ||
| 2906 | switch (tp->mac_version) { | 2915 | switch (tp->mac_version) { |
| 2907 | case RTL_GIGA_MAC_VER_25: | 2916 | case RTL_GIGA_MAC_VER_25: |
| 2908 | case RTL_GIGA_MAC_VER_26: | 2917 | case RTL_GIGA_MAC_VER_26: |
| 2918 | case RTL_GIGA_MAC_VER_27: | ||
| 2919 | case RTL_GIGA_MAC_VER_28: | ||
| 2909 | RTL_W8(PMCH, RTL_R8(PMCH) | 0x80); | 2920 | RTL_W8(PMCH, RTL_R8(PMCH) | 0x80); |
| 2910 | break; | 2921 | break; |
| 2911 | } | 2922 | } |
| @@ -3042,7 +3053,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 3042 | goto err_out_mwi_2; | 3053 | goto err_out_mwi_2; |
| 3043 | } | 3054 | } |
| 3044 | 3055 | ||
| 3045 | tp->cp_cmd = PCIMulRW | RxChkSum; | 3056 | tp->cp_cmd = RxChkSum; |
| 3046 | 3057 | ||
| 3047 | if ((sizeof(dma_addr_t) > 4) && | 3058 | if ((sizeof(dma_addr_t) > 4) && |
| 3048 | !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) { | 3059 | !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) { |
| @@ -3190,6 +3201,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 3190 | if (pci_dev_run_wake(pdev)) | 3201 | if (pci_dev_run_wake(pdev)) |
| 3191 | pm_runtime_put_noidle(&pdev->dev); | 3202 | pm_runtime_put_noidle(&pdev->dev); |
| 3192 | 3203 | ||
| 3204 | netif_carrier_off(dev); | ||
| 3205 | |||
| 3193 | out: | 3206 | out: |
| 3194 | return rc; | 3207 | return rc; |
| 3195 | 3208 | ||
| @@ -3316,7 +3329,8 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp) | |||
| 3316 | /* Disable interrupts */ | 3329 | /* Disable interrupts */ |
| 3317 | rtl8169_irq_mask_and_ack(ioaddr); | 3330 | rtl8169_irq_mask_and_ack(ioaddr); |
| 3318 | 3331 | ||
| 3319 | if (tp->mac_version == RTL_GIGA_MAC_VER_28) { | 3332 | if (tp->mac_version == RTL_GIGA_MAC_VER_27 || |
| 3333 | tp->mac_version == RTL_GIGA_MAC_VER_28) { | ||
| 3320 | while (RTL_R8(TxPoll) & NPQ) | 3334 | while (RTL_R8(TxPoll) & NPQ) |
| 3321 | udelay(20); | 3335 | udelay(20); |
| 3322 | 3336 | ||
| @@ -3845,8 +3859,7 @@ static void rtl_hw_start_8168(struct net_device *dev) | |||
| 3845 | Cxpl_dbg_sel | \ | 3859 | Cxpl_dbg_sel | \ |
| 3846 | ASF | \ | 3860 | ASF | \ |
| 3847 | PktCntrDisable | \ | 3861 | PktCntrDisable | \ |
| 3848 | PCIDAC | \ | 3862 | Mac_dbgo_sel) |
| 3849 | PCIMulRW) | ||
| 3850 | 3863 | ||
| 3851 | static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) | 3864 | static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) |
| 3852 | { | 3865 | { |
| @@ -3876,8 +3889,6 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) | |||
| 3876 | if ((cfg1 & LEDS0) && (cfg1 & LEDS1)) | 3889 | if ((cfg1 & LEDS0) && (cfg1 & LEDS1)) |
| 3877 | RTL_W8(Config1, cfg1 & ~LEDS0); | 3890 | RTL_W8(Config1, cfg1 & ~LEDS0); |
| 3878 | 3891 | ||
| 3879 | RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK); | ||
| 3880 | |||
| 3881 | rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1)); | 3892 | rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1)); |
| 3882 | } | 3893 | } |
| 3883 | 3894 | ||
| @@ -3889,8 +3900,6 @@ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev) | |||
| 3889 | 3900 | ||
| 3890 | RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable); | 3901 | RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable); |
| 3891 | RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); | 3902 | RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); |
| 3892 | |||
| 3893 | RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK); | ||
| 3894 | } | 3903 | } |
| 3895 | 3904 | ||
| 3896 | static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev) | 3905 | static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev) |
| @@ -3916,6 +3925,8 @@ static void rtl_hw_start_8101(struct net_device *dev) | |||
| 3916 | } | 3925 | } |
| 3917 | } | 3926 | } |
| 3918 | 3927 | ||
| 3928 | RTL_W8(Cfg9346, Cfg9346_Unlock); | ||
| 3929 | |||
| 3919 | switch (tp->mac_version) { | 3930 | switch (tp->mac_version) { |
| 3920 | case RTL_GIGA_MAC_VER_07: | 3931 | case RTL_GIGA_MAC_VER_07: |
| 3921 | rtl_hw_start_8102e_1(ioaddr, pdev); | 3932 | rtl_hw_start_8102e_1(ioaddr, pdev); |
| @@ -3930,14 +3941,13 @@ static void rtl_hw_start_8101(struct net_device *dev) | |||
| 3930 | break; | 3941 | break; |
| 3931 | } | 3942 | } |
| 3932 | 3943 | ||
| 3933 | RTL_W8(Cfg9346, Cfg9346_Unlock); | 3944 | RTL_W8(Cfg9346, Cfg9346_Lock); |
| 3934 | 3945 | ||
| 3935 | RTL_W8(MaxTxPacketSize, TxPacketMax); | 3946 | RTL_W8(MaxTxPacketSize, TxPacketMax); |
| 3936 | 3947 | ||
| 3937 | rtl_set_rx_max_size(ioaddr, rx_buf_sz); | 3948 | rtl_set_rx_max_size(ioaddr, rx_buf_sz); |
| 3938 | 3949 | ||
| 3939 | tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; | 3950 | tp->cp_cmd &= ~R810X_CPCMD_QUIRK_MASK; |
| 3940 | |||
| 3941 | RTL_W16(CPlusCmd, tp->cp_cmd); | 3951 | RTL_W16(CPlusCmd, tp->cp_cmd); |
| 3942 | 3952 | ||
| 3943 | RTL_W16(IntrMitigate, 0x0000); | 3953 | RTL_W16(IntrMitigate, 0x0000); |
| @@ -3947,14 +3957,10 @@ static void rtl_hw_start_8101(struct net_device *dev) | |||
| 3947 | RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); | 3957 | RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); |
| 3948 | rtl_set_rx_tx_config_registers(tp); | 3958 | rtl_set_rx_tx_config_registers(tp); |
| 3949 | 3959 | ||
| 3950 | RTL_W8(Cfg9346, Cfg9346_Lock); | ||
| 3951 | |||
| 3952 | RTL_R8(IntrMask); | 3960 | RTL_R8(IntrMask); |
| 3953 | 3961 | ||
| 3954 | rtl_set_rx_mode(dev); | 3962 | rtl_set_rx_mode(dev); |
| 3955 | 3963 | ||
| 3956 | RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); | ||
| 3957 | |||
| 3958 | RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000); | 3964 | RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000); |
| 3959 | 3965 | ||
| 3960 | RTL_W16(IntrMask, tp->intr_event); | 3966 | RTL_W16(IntrMask, tp->intr_event); |
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 0e8bb19ed60d..ca886d98bdc7 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
| @@ -569,9 +569,14 @@ static void efx_ethtool_self_test(struct net_device *net_dev, | |||
| 569 | struct ethtool_test *test, u64 *data) | 569 | struct ethtool_test *test, u64 *data) |
| 570 | { | 570 | { |
| 571 | struct efx_nic *efx = netdev_priv(net_dev); | 571 | struct efx_nic *efx = netdev_priv(net_dev); |
| 572 | struct efx_self_tests efx_tests; | 572 | struct efx_self_tests *efx_tests; |
| 573 | int already_up; | 573 | int already_up; |
| 574 | int rc; | 574 | int rc = -ENOMEM; |
| 575 | |||
| 576 | efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL); | ||
| 577 | if (!efx_tests) | ||
| 578 | goto fail; | ||
| 579 | |||
| 575 | 580 | ||
| 576 | ASSERT_RTNL(); | 581 | ASSERT_RTNL(); |
| 577 | if (efx->state != STATE_RUNNING) { | 582 | if (efx->state != STATE_RUNNING) { |
| @@ -589,13 +594,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev, | |||
| 589 | if (rc) { | 594 | if (rc) { |
| 590 | netif_err(efx, drv, efx->net_dev, | 595 | netif_err(efx, drv, efx->net_dev, |
| 591 | "failed opening device.\n"); | 596 | "failed opening device.\n"); |
| 592 | goto fail2; | 597 | goto fail1; |
| 593 | } | 598 | } |
| 594 | } | 599 | } |
| 595 | 600 | ||
| 596 | memset(&efx_tests, 0, sizeof(efx_tests)); | 601 | rc = efx_selftest(efx, efx_tests, test->flags); |
| 597 | |||
| 598 | rc = efx_selftest(efx, &efx_tests, test->flags); | ||
| 599 | 602 | ||
| 600 | if (!already_up) | 603 | if (!already_up) |
| 601 | dev_close(efx->net_dev); | 604 | dev_close(efx->net_dev); |
| @@ -604,10 +607,11 @@ static void efx_ethtool_self_test(struct net_device *net_dev, | |||
| 604 | rc == 0 ? "passed" : "failed", | 607 | rc == 0 ? "passed" : "failed", |
| 605 | (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on"); | 608 | (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on"); |
| 606 | 609 | ||
| 607 | fail2: | 610 | fail1: |
| 608 | fail1: | ||
| 609 | /* Fill ethtool results structures */ | 611 | /* Fill ethtool results structures */ |
| 610 | efx_ethtool_fill_self_tests(efx, &efx_tests, NULL, data); | 612 | efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data); |
| 613 | kfree(efx_tests); | ||
| 614 | fail: | ||
| 611 | if (rc) | 615 | if (rc) |
| 612 | test->flags |= ETH_TEST_FL_FAILED; | 616 | test->flags |= ETH_TEST_FL_FAILED; |
| 613 | } | 617 | } |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 34a0af3837f9..0e5f03135b50 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
| @@ -1560,8 +1560,10 @@ static int stmmac_mac_device_setup(struct net_device *dev) | |||
| 1560 | 1560 | ||
| 1561 | priv->hw = device; | 1561 | priv->hw = device; |
| 1562 | 1562 | ||
| 1563 | if (device_can_wakeup(priv->device)) | 1563 | if (device_can_wakeup(priv->device)) { |
| 1564 | priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */ | 1564 | priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */ |
| 1565 | enable_irq_wake(dev->irq); | ||
| 1566 | } | ||
| 1565 | 1567 | ||
| 1566 | return 0; | 1568 | return 0; |
| 1567 | } | 1569 | } |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 93b32d366611..06c0e5033656 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
| @@ -11158,7 +11158,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
| 11158 | if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) | 11158 | if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) |
| 11159 | break; /* We have no PHY */ | 11159 | break; /* We have no PHY */ |
| 11160 | 11160 | ||
| 11161 | if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) | 11161 | if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) || |
| 11162 | ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) && | ||
| 11163 | !netif_running(dev))) | ||
| 11162 | return -EAGAIN; | 11164 | return -EAGAIN; |
| 11163 | 11165 | ||
| 11164 | spin_lock_bh(&tp->lock); | 11166 | spin_lock_bh(&tp->lock); |
| @@ -11174,7 +11176,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
| 11174 | if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) | 11176 | if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) |
| 11175 | break; /* We have no PHY */ | 11177 | break; /* We have no PHY */ |
| 11176 | 11178 | ||
| 11177 | if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) | 11179 | if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) || |
| 11180 | ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) && | ||
| 11181 | !netif_running(dev))) | ||
| 11178 | return -EAGAIN; | 11182 | return -EAGAIN; |
| 11179 | 11183 | ||
| 11180 | spin_lock_bh(&tp->lock); | 11184 | spin_lock_bh(&tp->lock); |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 02b622e3b9fb..5002f5be47be 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
| @@ -651,6 +651,10 @@ static const struct usb_device_id products[] = { | |||
| 651 | .driver_info = (unsigned long)&dm9601_info, | 651 | .driver_info = (unsigned long)&dm9601_info, |
| 652 | }, | 652 | }, |
| 653 | { | 653 | { |
| 654 | USB_DEVICE(0x0fe6, 0x9700), /* DM9601 USB to Fast Ethernet Adapter */ | ||
| 655 | .driver_info = (unsigned long)&dm9601_info, | ||
| 656 | }, | ||
| 657 | { | ||
| 654 | USB_DEVICE(0x0a46, 0x9000), /* DM9000E */ | 658 | USB_DEVICE(0x0a46, 0x9000), /* DM9000E */ |
| 655 | .driver_info = (unsigned long)&dm9601_info, | 659 | .driver_info = (unsigned long)&dm9601_info, |
| 656 | }, | 660 | }, |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index bed8fcedff49..6d83812603b6 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -2628,15 +2628,15 @@ exit: | |||
| 2628 | 2628 | ||
| 2629 | static void hso_free_tiomget(struct hso_serial *serial) | 2629 | static void hso_free_tiomget(struct hso_serial *serial) |
| 2630 | { | 2630 | { |
| 2631 | struct hso_tiocmget *tiocmget = serial->tiocmget; | 2631 | struct hso_tiocmget *tiocmget; |
| 2632 | if (!serial) | ||
| 2633 | return; | ||
| 2634 | tiocmget = serial->tiocmget; | ||
| 2632 | if (tiocmget) { | 2635 | if (tiocmget) { |
| 2633 | if (tiocmget->urb) { | 2636 | usb_free_urb(tiocmget->urb); |
| 2634 | usb_free_urb(tiocmget->urb); | 2637 | tiocmget->urb = NULL; |
| 2635 | tiocmget->urb = NULL; | ||
| 2636 | } | ||
| 2637 | serial->tiocmget = NULL; | 2638 | serial->tiocmget = NULL; |
| 2638 | kfree(tiocmget); | 2639 | kfree(tiocmget); |
| 2639 | |||
| 2640 | } | 2640 | } |
| 2641 | } | 2641 | } |
| 2642 | 2642 | ||
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index ed9a41643ff4..95c41d56631c 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
| @@ -931,8 +931,10 @@ fail_halt: | |||
| 931 | if (urb != NULL) { | 931 | if (urb != NULL) { |
| 932 | clear_bit (EVENT_RX_MEMORY, &dev->flags); | 932 | clear_bit (EVENT_RX_MEMORY, &dev->flags); |
| 933 | status = usb_autopm_get_interface(dev->intf); | 933 | status = usb_autopm_get_interface(dev->intf); |
| 934 | if (status < 0) | 934 | if (status < 0) { |
| 935 | usb_free_urb(urb); | ||
| 935 | goto fail_lowmem; | 936 | goto fail_lowmem; |
| 937 | } | ||
| 936 | if (rx_submit (dev, urb, GFP_KERNEL) == -ENOLINK) | 938 | if (rx_submit (dev, urb, GFP_KERNEL) == -ENOLINK) |
| 937 | resched = 0; | 939 | resched = 0; |
| 938 | usb_autopm_put_interface(dev->intf); | 940 | usb_autopm_put_interface(dev->intf); |
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 78c26fdccad1..62ce2f4e8605 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
| @@ -282,6 +282,34 @@ int ath5k_hw_phy_disable(struct ath5k_hw *ah) | |||
| 282 | return 0; | 282 | return 0; |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | /* | ||
| 286 | * Wait for synth to settle | ||
| 287 | */ | ||
| 288 | static void ath5k_hw_wait_for_synth(struct ath5k_hw *ah, | ||
| 289 | struct ieee80211_channel *channel) | ||
| 290 | { | ||
| 291 | /* | ||
| 292 | * On 5211+ read activation -> rx delay | ||
| 293 | * and use it (100ns steps). | ||
| 294 | */ | ||
| 295 | if (ah->ah_version != AR5K_AR5210) { | ||
| 296 | u32 delay; | ||
| 297 | delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) & | ||
| 298 | AR5K_PHY_RX_DELAY_M; | ||
| 299 | delay = (channel->hw_value & CHANNEL_CCK) ? | ||
| 300 | ((delay << 2) / 22) : (delay / 10); | ||
| 301 | if (ah->ah_bwmode == AR5K_BWMODE_10MHZ) | ||
| 302 | delay = delay << 1; | ||
| 303 | if (ah->ah_bwmode == AR5K_BWMODE_5MHZ) | ||
| 304 | delay = delay << 2; | ||
| 305 | /* XXX: /2 on turbo ? Let's be safe | ||
| 306 | * for now */ | ||
| 307 | udelay(100 + delay); | ||
| 308 | } else { | ||
| 309 | mdelay(1); | ||
| 310 | } | ||
| 311 | } | ||
| 312 | |||
| 285 | 313 | ||
| 286 | /**********************\ | 314 | /**********************\ |
| 287 | * RF Gain optimization * | 315 | * RF Gain optimization * |
| @@ -1253,6 +1281,7 @@ static int ath5k_hw_channel(struct ath5k_hw *ah, | |||
| 1253 | case AR5K_RF5111: | 1281 | case AR5K_RF5111: |
| 1254 | ret = ath5k_hw_rf5111_channel(ah, channel); | 1282 | ret = ath5k_hw_rf5111_channel(ah, channel); |
| 1255 | break; | 1283 | break; |
| 1284 | case AR5K_RF2317: | ||
| 1256 | case AR5K_RF2425: | 1285 | case AR5K_RF2425: |
| 1257 | ret = ath5k_hw_rf2425_channel(ah, channel); | 1286 | ret = ath5k_hw_rf2425_channel(ah, channel); |
| 1258 | break; | 1287 | break; |
| @@ -3237,6 +3266,13 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, | |||
| 3237 | /* Failed */ | 3266 | /* Failed */ |
| 3238 | if (i >= 100) | 3267 | if (i >= 100) |
| 3239 | return -EIO; | 3268 | return -EIO; |
| 3269 | |||
| 3270 | /* Set channel and wait for synth */ | ||
| 3271 | ret = ath5k_hw_channel(ah, channel); | ||
| 3272 | if (ret) | ||
| 3273 | return ret; | ||
| 3274 | |||
| 3275 | ath5k_hw_wait_for_synth(ah, channel); | ||
| 3240 | } | 3276 | } |
| 3241 | 3277 | ||
| 3242 | /* | 3278 | /* |
| @@ -3251,13 +3287,53 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, | |||
| 3251 | if (ret) | 3287 | if (ret) |
| 3252 | return ret; | 3288 | return ret; |
| 3253 | 3289 | ||
| 3290 | /* Write OFDM timings on 5212*/ | ||
| 3291 | if (ah->ah_version == AR5K_AR5212 && | ||
| 3292 | channel->hw_value & CHANNEL_OFDM) { | ||
| 3293 | |||
| 3294 | ret = ath5k_hw_write_ofdm_timings(ah, channel); | ||
| 3295 | if (ret) | ||
| 3296 | return ret; | ||
| 3297 | |||
| 3298 | /* Spur info is available only from EEPROM versions | ||
| 3299 | * greater than 5.3, but the EEPROM routines will use | ||
| 3300 | * static values for older versions */ | ||
| 3301 | if (ah->ah_mac_srev >= AR5K_SREV_AR5424) | ||
| 3302 | ath5k_hw_set_spur_mitigation_filter(ah, | ||
| 3303 | channel); | ||
| 3304 | } | ||
| 3305 | |||
| 3306 | /* If we used fast channel switching | ||
| 3307 | * we are done, release RF bus and | ||
| 3308 | * fire up NF calibration. | ||
| 3309 | * | ||
| 3310 | * Note: Only NF calibration due to | ||
| 3311 | * channel change, not AGC calibration | ||
| 3312 | * since AGC is still running ! | ||
| 3313 | */ | ||
| 3314 | if (fast) { | ||
| 3315 | /* | ||
| 3316 | * Release RF Bus grant | ||
| 3317 | */ | ||
| 3318 | AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ, | ||
| 3319 | AR5K_PHY_RFBUS_REQ_REQUEST); | ||
| 3320 | |||
| 3321 | /* | ||
| 3322 | * Start NF calibration | ||
| 3323 | */ | ||
| 3324 | AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL, | ||
| 3325 | AR5K_PHY_AGCCTL_NF); | ||
| 3326 | |||
| 3327 | return ret; | ||
| 3328 | } | ||
| 3329 | |||
| 3254 | /* | 3330 | /* |
| 3255 | * For 5210 we do all initialization using | 3331 | * For 5210 we do all initialization using |
| 3256 | * initvals, so we don't have to modify | 3332 | * initvals, so we don't have to modify |
| 3257 | * any settings (5210 also only supports | 3333 | * any settings (5210 also only supports |
| 3258 | * a/aturbo modes) | 3334 | * a/aturbo modes) |
| 3259 | */ | 3335 | */ |
| 3260 | if ((ah->ah_version != AR5K_AR5210) && !fast) { | 3336 | if (ah->ah_version != AR5K_AR5210) { |
| 3261 | 3337 | ||
| 3262 | /* | 3338 | /* |
| 3263 | * Write initial RF gain settings | 3339 | * Write initial RF gain settings |
| @@ -3276,22 +3352,6 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, | |||
| 3276 | if (ret) | 3352 | if (ret) |
| 3277 | return ret; | 3353 | return ret; |
| 3278 | 3354 | ||
| 3279 | /* Write OFDM timings on 5212*/ | ||
| 3280 | if (ah->ah_version == AR5K_AR5212 && | ||
| 3281 | channel->hw_value & CHANNEL_OFDM) { | ||
| 3282 | |||
| 3283 | ret = ath5k_hw_write_ofdm_timings(ah, channel); | ||
| 3284 | if (ret) | ||
| 3285 | return ret; | ||
| 3286 | |||
| 3287 | /* Spur info is available only from EEPROM versions | ||
| 3288 | * greater than 5.3, but the EEPROM routines will use | ||
| 3289 | * static values for older versions */ | ||
| 3290 | if (ah->ah_mac_srev >= AR5K_SREV_AR5424) | ||
| 3291 | ath5k_hw_set_spur_mitigation_filter(ah, | ||
| 3292 | channel); | ||
| 3293 | } | ||
| 3294 | |||
| 3295 | /*Enable/disable 802.11b mode on 5111 | 3355 | /*Enable/disable 802.11b mode on 5111 |
| 3296 | (enable 2111 frequency converter + CCK)*/ | 3356 | (enable 2111 frequency converter + CCK)*/ |
| 3297 | if (ah->ah_radio == AR5K_RF5111) { | 3357 | if (ah->ah_radio == AR5K_RF5111) { |
| @@ -3322,47 +3382,20 @@ int ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, | |||
| 3322 | */ | 3382 | */ |
| 3323 | ath5k_hw_reg_write(ah, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ACT); | 3383 | ath5k_hw_reg_write(ah, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ACT); |
| 3324 | 3384 | ||
| 3385 | ath5k_hw_wait_for_synth(ah, channel); | ||
| 3386 | |||
| 3325 | /* | 3387 | /* |
| 3326 | * On 5211+ read activation -> rx delay | 3388 | * Perform ADC test to see if baseband is ready |
| 3327 | * and use it. | 3389 | * Set tx hold and check adc test register |
| 3328 | */ | 3390 | */ |
| 3329 | if (ah->ah_version != AR5K_AR5210) { | 3391 | phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1); |
| 3330 | u32 delay; | 3392 | ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1); |
| 3331 | delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) & | 3393 | for (i = 0; i <= 20; i++) { |
| 3332 | AR5K_PHY_RX_DELAY_M; | 3394 | if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10)) |
| 3333 | delay = (channel->hw_value & CHANNEL_CCK) ? | 3395 | break; |
| 3334 | ((delay << 2) / 22) : (delay / 10); | 3396 | udelay(200); |
| 3335 | if (ah->ah_bwmode == AR5K_BWMODE_10MHZ) | ||
| 3336 | delay = delay << 1; | ||
| 3337 | if (ah->ah_bwmode == AR5K_BWMODE_5MHZ) | ||
| 3338 | delay = delay << 2; | ||
| 3339 | /* XXX: /2 on turbo ? Let's be safe | ||
| 3340 | * for now */ | ||
| 3341 | udelay(100 + delay); | ||
| 3342 | } else { | ||
| 3343 | mdelay(1); | ||
| 3344 | } | ||
| 3345 | |||
| 3346 | if (fast) | ||
| 3347 | /* | ||
| 3348 | * Release RF Bus grant | ||
| 3349 | */ | ||
| 3350 | AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ, | ||
| 3351 | AR5K_PHY_RFBUS_REQ_REQUEST); | ||
| 3352 | else { | ||
| 3353 | /* | ||
| 3354 | * Perform ADC test to see if baseband is ready | ||
| 3355 | * Set tx hold and check adc test register | ||
| 3356 | */ | ||
| 3357 | phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1); | ||
| 3358 | ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1); | ||
| 3359 | for (i = 0; i <= 20; i++) { | ||
| 3360 | if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10)) | ||
| 3361 | break; | ||
| 3362 | udelay(200); | ||
| 3363 | } | ||
| 3364 | ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1); | ||
| 3365 | } | 3397 | } |
| 3398 | ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1); | ||
| 3366 | 3399 | ||
| 3367 | /* | 3400 | /* |
| 3368 | * Start automatic gain control calibration | 3401 | * Start automatic gain control calibration |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 23838e37d45f..1a7fa6ea4cf5 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
| 22 | #include <linux/leds.h> | 22 | #include <linux/leds.h> |
| 23 | #include <linux/completion.h> | 23 | #include <linux/completion.h> |
| 24 | #include <linux/pm_qos_params.h> | ||
| 25 | 24 | ||
| 26 | #include "debug.h" | 25 | #include "debug.h" |
| 27 | #include "common.h" | 26 | #include "common.h" |
| @@ -57,8 +56,6 @@ struct ath_node; | |||
| 57 | 56 | ||
| 58 | #define A_MAX(a, b) ((a) > (b) ? (a) : (b)) | 57 | #define A_MAX(a, b) ((a) > (b) ? (a) : (b)) |
| 59 | 58 | ||
| 60 | #define ATH9K_PM_QOS_DEFAULT_VALUE 55 | ||
| 61 | |||
| 62 | #define TSF_TO_TU(_h,_l) \ | 59 | #define TSF_TO_TU(_h,_l) \ |
| 63 | ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) | 60 | ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) |
| 64 | 61 | ||
| @@ -633,8 +630,6 @@ struct ath_softc { | |||
| 633 | struct ath_descdma txsdma; | 630 | struct ath_descdma txsdma; |
| 634 | 631 | ||
| 635 | struct ath_ant_comb ant_comb; | 632 | struct ath_ant_comb ant_comb; |
| 636 | |||
| 637 | struct pm_qos_request_list pm_qos_req; | ||
| 638 | }; | 633 | }; |
| 639 | 634 | ||
| 640 | struct ath_wiphy { | 635 | struct ath_wiphy { |
| @@ -666,7 +661,6 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) | |||
| 666 | extern struct ieee80211_ops ath9k_ops; | 661 | extern struct ieee80211_ops ath9k_ops; |
| 667 | extern int ath9k_modparam_nohwcrypt; | 662 | extern int ath9k_modparam_nohwcrypt; |
| 668 | extern int led_blink; | 663 | extern int led_blink; |
| 669 | extern int ath9k_pm_qos_value; | ||
| 670 | extern bool is_ath9k_unloaded; | 664 | extern bool is_ath9k_unloaded; |
| 671 | 665 | ||
| 672 | irqreturn_t ath_isr(int irq, void *dev); | 666 | irqreturn_t ath_isr(int irq, void *dev); |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 087a6a95edd5..a033d01bf8a0 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
| @@ -41,10 +41,6 @@ static int ath9k_btcoex_enable; | |||
| 41 | module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); | 41 | module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); |
| 42 | MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); | 42 | MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); |
| 43 | 43 | ||
| 44 | int ath9k_pm_qos_value = ATH9K_PM_QOS_DEFAULT_VALUE; | ||
| 45 | module_param_named(pmqos, ath9k_pm_qos_value, int, S_IRUSR | S_IRGRP | S_IROTH); | ||
| 46 | MODULE_PARM_DESC(pmqos, "User specified PM-QOS value"); | ||
| 47 | |||
| 48 | bool is_ath9k_unloaded; | 44 | bool is_ath9k_unloaded; |
| 49 | /* We use the hw_value as an index into our private channel structure */ | 45 | /* We use the hw_value as an index into our private channel structure */ |
| 50 | 46 | ||
| @@ -762,9 +758,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
| 762 | ath_init_leds(sc); | 758 | ath_init_leds(sc); |
| 763 | ath_start_rfkill_poll(sc); | 759 | ath_start_rfkill_poll(sc); |
| 764 | 760 | ||
| 765 | pm_qos_add_request(&sc->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, | ||
| 766 | PM_QOS_DEFAULT_VALUE); | ||
| 767 | |||
| 768 | return 0; | 761 | return 0; |
| 769 | 762 | ||
| 770 | error_world: | 763 | error_world: |
| @@ -831,7 +824,6 @@ void ath9k_deinit_device(struct ath_softc *sc) | |||
| 831 | } | 824 | } |
| 832 | 825 | ||
| 833 | ieee80211_unregister_hw(hw); | 826 | ieee80211_unregister_hw(hw); |
| 834 | pm_qos_remove_request(&sc->pm_qos_req); | ||
| 835 | ath_rx_cleanup(sc); | 827 | ath_rx_cleanup(sc); |
| 836 | ath_tx_cleanup(sc); | 828 | ath_tx_cleanup(sc); |
| 837 | ath9k_deinit_softc(sc); | 829 | ath9k_deinit_softc(sc); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index da5c64597c1f..a09d15f7aa6e 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
| @@ -1173,12 +1173,6 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
| 1173 | ath9k_btcoex_timer_resume(sc); | 1173 | ath9k_btcoex_timer_resume(sc); |
| 1174 | } | 1174 | } |
| 1175 | 1175 | ||
| 1176 | /* User has the option to provide pm-qos value as a module | ||
| 1177 | * parameter rather than using the default value of | ||
| 1178 | * 'ATH9K_PM_QOS_DEFAULT_VALUE'. | ||
| 1179 | */ | ||
| 1180 | pm_qos_update_request(&sc->pm_qos_req, ath9k_pm_qos_value); | ||
| 1181 | |||
| 1182 | if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en) | 1176 | if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en) |
| 1183 | common->bus_ops->extn_synch_en(common); | 1177 | common->bus_ops->extn_synch_en(common); |
| 1184 | 1178 | ||
| @@ -1345,8 +1339,6 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
| 1345 | 1339 | ||
| 1346 | sc->sc_flags |= SC_OP_INVALID; | 1340 | sc->sc_flags |= SC_OP_INVALID; |
| 1347 | 1341 | ||
| 1348 | pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE); | ||
| 1349 | |||
| 1350 | mutex_unlock(&sc->mutex); | 1342 | mutex_unlock(&sc->mutex); |
| 1351 | 1343 | ||
| 1352 | ath_dbg(common, ATH_DBG_CONFIG, "Driver halt\n"); | 1344 | ath_dbg(common, ATH_DBG_CONFIG, "Driver halt\n"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index a9b852be4509..39b6f16c87fa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
| @@ -402,72 +402,6 @@ static void iwl3945_accumulative_statistics(struct iwl_priv *priv, | |||
| 402 | } | 402 | } |
| 403 | #endif | 403 | #endif |
| 404 | 404 | ||
| 405 | /** | ||
| 406 | * iwl3945_good_plcp_health - checks for plcp error. | ||
| 407 | * | ||
| 408 | * When the plcp error is exceeding the thresholds, reset the radio | ||
| 409 | * to improve the throughput. | ||
| 410 | */ | ||
| 411 | static bool iwl3945_good_plcp_health(struct iwl_priv *priv, | ||
| 412 | struct iwl_rx_packet *pkt) | ||
| 413 | { | ||
| 414 | bool rc = true; | ||
| 415 | struct iwl3945_notif_statistics current_stat; | ||
| 416 | int combined_plcp_delta; | ||
| 417 | unsigned int plcp_msec; | ||
| 418 | unsigned long plcp_received_jiffies; | ||
| 419 | |||
| 420 | if (priv->cfg->base_params->plcp_delta_threshold == | ||
| 421 | IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE) { | ||
| 422 | IWL_DEBUG_RADIO(priv, "plcp_err check disabled\n"); | ||
| 423 | return rc; | ||
| 424 | } | ||
| 425 | memcpy(¤t_stat, pkt->u.raw, sizeof(struct | ||
| 426 | iwl3945_notif_statistics)); | ||
| 427 | /* | ||
| 428 | * check for plcp_err and trigger radio reset if it exceeds | ||
| 429 | * the plcp error threshold plcp_delta. | ||
| 430 | */ | ||
| 431 | plcp_received_jiffies = jiffies; | ||
| 432 | plcp_msec = jiffies_to_msecs((long) plcp_received_jiffies - | ||
| 433 | (long) priv->plcp_jiffies); | ||
| 434 | priv->plcp_jiffies = plcp_received_jiffies; | ||
| 435 | /* | ||
| 436 | * check to make sure plcp_msec is not 0 to prevent division | ||
| 437 | * by zero. | ||
| 438 | */ | ||
| 439 | if (plcp_msec) { | ||
| 440 | combined_plcp_delta = | ||
| 441 | (le32_to_cpu(current_stat.rx.ofdm.plcp_err) - | ||
| 442 | le32_to_cpu(priv->_3945.statistics.rx.ofdm.plcp_err)); | ||
| 443 | |||
| 444 | if ((combined_plcp_delta > 0) && | ||
| 445 | ((combined_plcp_delta * 100) / plcp_msec) > | ||
| 446 | priv->cfg->base_params->plcp_delta_threshold) { | ||
| 447 | /* | ||
| 448 | * if plcp_err exceed the threshold, the following | ||
| 449 | * data is printed in csv format: | ||
| 450 | * Text: plcp_err exceeded %d, | ||
| 451 | * Received ofdm.plcp_err, | ||
| 452 | * Current ofdm.plcp_err, | ||
| 453 | * combined_plcp_delta, | ||
| 454 | * plcp_msec | ||
| 455 | */ | ||
| 456 | IWL_DEBUG_RADIO(priv, "plcp_err exceeded %u, " | ||
| 457 | "%u, %d, %u mSecs\n", | ||
| 458 | priv->cfg->base_params->plcp_delta_threshold, | ||
| 459 | le32_to_cpu(current_stat.rx.ofdm.plcp_err), | ||
| 460 | combined_plcp_delta, plcp_msec); | ||
| 461 | /* | ||
| 462 | * Reset the RF radio due to the high plcp | ||
| 463 | * error rate | ||
| 464 | */ | ||
| 465 | rc = false; | ||
| 466 | } | ||
| 467 | } | ||
| 468 | return rc; | ||
| 469 | } | ||
| 470 | |||
| 471 | void iwl3945_hw_rx_statistics(struct iwl_priv *priv, | 405 | void iwl3945_hw_rx_statistics(struct iwl_priv *priv, |
| 472 | struct iwl_rx_mem_buffer *rxb) | 406 | struct iwl_rx_mem_buffer *rxb) |
| 473 | { | 407 | { |
| @@ -2734,7 +2668,6 @@ static struct iwl_lib_ops iwl3945_lib = { | |||
| 2734 | .isr_ops = { | 2668 | .isr_ops = { |
| 2735 | .isr = iwl_isr_legacy, | 2669 | .isr = iwl_isr_legacy, |
| 2736 | }, | 2670 | }, |
| 2737 | .check_plcp_health = iwl3945_good_plcp_health, | ||
| 2738 | 2671 | ||
| 2739 | .debugfs_ops = { | 2672 | .debugfs_ops = { |
| 2740 | .rx_stats_read = iwl3945_ucode_rx_stats_read, | 2673 | .rx_stats_read = iwl3945_ucode_rx_stats_read, |
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index 1eacba4daa5b..0494d7b102d4 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
| @@ -199,6 +199,7 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index, | |||
| 199 | while (i != idx) { | 199 | while (i != idx) { |
| 200 | u16 len; | 200 | u16 len; |
| 201 | struct sk_buff *skb; | 201 | struct sk_buff *skb; |
| 202 | dma_addr_t dma_addr; | ||
| 202 | desc = &ring[i]; | 203 | desc = &ring[i]; |
| 203 | len = le16_to_cpu(desc->len); | 204 | len = le16_to_cpu(desc->len); |
| 204 | skb = rx_buf[i]; | 205 | skb = rx_buf[i]; |
| @@ -216,17 +217,20 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index, | |||
| 216 | 217 | ||
| 217 | len = priv->common.rx_mtu; | 218 | len = priv->common.rx_mtu; |
| 218 | } | 219 | } |
| 220 | dma_addr = le32_to_cpu(desc->host_addr); | ||
| 221 | pci_dma_sync_single_for_cpu(priv->pdev, dma_addr, | ||
| 222 | priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE); | ||
| 219 | skb_put(skb, len); | 223 | skb_put(skb, len); |
| 220 | 224 | ||
| 221 | if (p54_rx(dev, skb)) { | 225 | if (p54_rx(dev, skb)) { |
| 222 | pci_unmap_single(priv->pdev, | 226 | pci_unmap_single(priv->pdev, dma_addr, |
| 223 | le32_to_cpu(desc->host_addr), | 227 | priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE); |
| 224 | priv->common.rx_mtu + 32, | ||
| 225 | PCI_DMA_FROMDEVICE); | ||
| 226 | rx_buf[i] = NULL; | 228 | rx_buf[i] = NULL; |
| 227 | desc->host_addr = 0; | 229 | desc->host_addr = cpu_to_le32(0); |
| 228 | } else { | 230 | } else { |
| 229 | skb_trim(skb, 0); | 231 | skb_trim(skb, 0); |
| 232 | pci_dma_sync_single_for_device(priv->pdev, dma_addr, | ||
| 233 | priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE); | ||
| 230 | desc->len = cpu_to_le16(priv->common.rx_mtu + 32); | 234 | desc->len = cpu_to_le16(priv->common.rx_mtu + 32); |
| 231 | } | 235 | } |
| 232 | 236 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index aa97971a38af..3b3f1e45ab3e 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
| @@ -652,6 +652,12 @@ static void rt2800pci_fill_rxdone(struct queue_entry *entry, | |||
| 652 | */ | 652 | */ |
| 653 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; | 653 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; |
| 654 | 654 | ||
| 655 | /* | ||
| 656 | * The hardware has already checked the Michael Mic and has | ||
| 657 | * stripped it from the frame. Signal this to mac80211. | ||
| 658 | */ | ||
| 659 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; | ||
| 660 | |||
| 655 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) | 661 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) |
| 656 | rxdesc->flags |= RX_FLAG_DECRYPTED; | 662 | rxdesc->flags |= RX_FLAG_DECRYPTED; |
| 657 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) | 663 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) |
| @@ -1065,6 +1071,8 @@ static DEFINE_PCI_DEVICE_TABLE(rt2800pci_device_table) = { | |||
| 1065 | { PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) }, | 1071 | { PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) }, |
| 1066 | #endif | 1072 | #endif |
| 1067 | #ifdef CONFIG_RT2800PCI_RT35XX | 1073 | #ifdef CONFIG_RT2800PCI_RT35XX |
| 1074 | { PCI_DEVICE(0x1432, 0x7711), PCI_DEVICE_DATA(&rt2800pci_ops) }, | ||
| 1075 | { PCI_DEVICE(0x1432, 0x7722), PCI_DEVICE_DATA(&rt2800pci_ops) }, | ||
| 1068 | { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) }, | 1076 | { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) }, |
| 1069 | { PCI_DEVICE(0x1814, 0x3062), PCI_DEVICE_DATA(&rt2800pci_ops) }, | 1077 | { PCI_DEVICE(0x1814, 0x3062), PCI_DEVICE_DATA(&rt2800pci_ops) }, |
| 1070 | { PCI_DEVICE(0x1814, 0x3562), PCI_DEVICE_DATA(&rt2800pci_ops) }, | 1078 | { PCI_DEVICE(0x1814, 0x3562), PCI_DEVICE_DATA(&rt2800pci_ops) }, |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index b97a4a54ff4c..197a36c05fda 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
| @@ -486,6 +486,12 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, | |||
| 486 | */ | 486 | */ |
| 487 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; | 487 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; |
| 488 | 488 | ||
| 489 | /* | ||
| 490 | * The hardware has already checked the Michael Mic and has | ||
| 491 | * stripped it from the frame. Signal this to mac80211. | ||
| 492 | */ | ||
| 493 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; | ||
| 494 | |||
| 489 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) | 495 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) |
| 490 | rxdesc->flags |= RX_FLAG_DECRYPTED; | 496 | rxdesc->flags |= RX_FLAG_DECRYPTED; |
| 491 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) | 497 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) |
diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig index ffedfd492754..ea1580085347 100644 --- a/drivers/nfc/Kconfig +++ b/drivers/nfc/Kconfig | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | menuconfig NFC_DEVICES | 5 | menuconfig NFC_DEVICES |
| 6 | bool "NFC devices" | 6 | bool "Near Field Communication (NFC) devices" |
| 7 | default n | 7 | default n |
| 8 | ---help--- | 8 | ---help--- |
| 9 | You'll have to say Y if your computer contains an NFC device that | 9 | You'll have to say Y if your computer contains an NFC device that |
diff --git a/drivers/nfc/pn544.c b/drivers/nfc/pn544.c index bae647264dd6..724f65d8f9e4 100644 --- a/drivers/nfc/pn544.c +++ b/drivers/nfc/pn544.c | |||
| @@ -60,7 +60,7 @@ enum pn544_irq { | |||
| 60 | struct pn544_info { | 60 | struct pn544_info { |
| 61 | struct miscdevice miscdev; | 61 | struct miscdevice miscdev; |
| 62 | struct i2c_client *i2c_dev; | 62 | struct i2c_client *i2c_dev; |
| 63 | struct regulator_bulk_data regs[2]; | 63 | struct regulator_bulk_data regs[3]; |
| 64 | 64 | ||
| 65 | enum pn544_state state; | 65 | enum pn544_state state; |
| 66 | wait_queue_head_t read_wait; | 66 | wait_queue_head_t read_wait; |
| @@ -74,6 +74,7 @@ struct pn544_info { | |||
| 74 | 74 | ||
| 75 | static const char reg_vdd_io[] = "Vdd_IO"; | 75 | static const char reg_vdd_io[] = "Vdd_IO"; |
| 76 | static const char reg_vbat[] = "VBat"; | 76 | static const char reg_vbat[] = "VBat"; |
| 77 | static const char reg_vsim[] = "VSim"; | ||
| 77 | 78 | ||
| 78 | /* sysfs interface */ | 79 | /* sysfs interface */ |
| 79 | static ssize_t pn544_test(struct device *dev, | 80 | static ssize_t pn544_test(struct device *dev, |
| @@ -740,6 +741,7 @@ static int __devinit pn544_probe(struct i2c_client *client, | |||
| 740 | 741 | ||
| 741 | info->regs[0].supply = reg_vdd_io; | 742 | info->regs[0].supply = reg_vdd_io; |
| 742 | info->regs[1].supply = reg_vbat; | 743 | info->regs[1].supply = reg_vbat; |
| 744 | info->regs[2].supply = reg_vsim; | ||
| 743 | r = regulator_bulk_get(&client->dev, ARRAY_SIZE(info->regs), | 745 | r = regulator_bulk_get(&client->dev, ARRAY_SIZE(info->regs), |
| 744 | info->regs); | 746 | info->regs); |
| 745 | if (r < 0) | 747 | if (r < 0) |
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 0bdda5b3ed55..42fbf1a75576 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
| @@ -518,6 +518,8 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev) | |||
| 518 | flags |= CONF_ENABLE_IOCARD; | 518 | flags |= CONF_ENABLE_IOCARD; |
| 519 | if (flags & CONF_ENABLE_IOCARD) | 519 | if (flags & CONF_ENABLE_IOCARD) |
| 520 | s->socket.flags |= SS_IOCARD; | 520 | s->socket.flags |= SS_IOCARD; |
| 521 | if (flags & CONF_ENABLE_ZVCARD) | ||
| 522 | s->socket.flags |= SS_ZVCARD | SS_IOCARD; | ||
| 521 | if (flags & CONF_ENABLE_SPKR) { | 523 | if (flags & CONF_ENABLE_SPKR) { |
| 522 | s->socket.flags |= SS_SPKR_ENA; | 524 | s->socket.flags |= SS_SPKR_ENA; |
| 523 | status = CCSR_AUDIO_ENA; | 525 | status = CCSR_AUDIO_ENA; |
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 3755e7c8c715..2c540542b5af 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
| @@ -215,7 +215,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
| 215 | } | 215 | } |
| 216 | #endif | 216 | #endif |
| 217 | 217 | ||
| 218 | static void pxa2xx_configure_sockets(struct device *dev) | 218 | void pxa2xx_configure_sockets(struct device *dev) |
| 219 | { | 219 | { |
| 220 | struct pcmcia_low_level *ops = dev->platform_data; | 220 | struct pcmcia_low_level *ops = dev->platform_data; |
| 221 | /* | 221 | /* |
diff --git a/drivers/pcmcia/pxa2xx_base.h b/drivers/pcmcia/pxa2xx_base.h index bb62ea87b8f9..b609b45469ed 100644 --- a/drivers/pcmcia/pxa2xx_base.h +++ b/drivers/pcmcia/pxa2xx_base.h | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt); | 1 | int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt); |
| 2 | void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops); | 2 | void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops); |
| 3 | void pxa2xx_configure_sockets(struct device *dev); | ||
| 3 | 4 | ||
diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c index b9f8c8fb42bd..25afe637c657 100644 --- a/drivers/pcmcia/pxa2xx_lubbock.c +++ b/drivers/pcmcia/pxa2xx_lubbock.c | |||
| @@ -226,6 +226,7 @@ int pcmcia_lubbock_init(struct sa1111_dev *sadev) | |||
| 226 | lubbock_set_misc_wr((1 << 15) | (1 << 14), 0); | 226 | lubbock_set_misc_wr((1 << 15) | (1 << 14), 0); |
| 227 | 227 | ||
| 228 | pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops); | 228 | pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops); |
| 229 | pxa2xx_configure_sockets(&sadev->dev); | ||
| 229 | ret = sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops, | 230 | ret = sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops, |
| 230 | pxa2xx_drv_pcmcia_add_one); | 231 | pxa2xx_drv_pcmcia_add_one); |
| 231 | } | 232 | } |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index d163bc2e2b9e..a59af5b24f0a 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
| @@ -227,7 +227,7 @@ config SONYPI_COMPAT | |||
| 227 | config IDEAPAD_LAPTOP | 227 | config IDEAPAD_LAPTOP |
| 228 | tristate "Lenovo IdeaPad Laptop Extras" | 228 | tristate "Lenovo IdeaPad Laptop Extras" |
| 229 | depends on ACPI | 229 | depends on ACPI |
| 230 | depends on RFKILL | 230 | depends on RFKILL && INPUT |
| 231 | select INPUT_SPARSEKMAP | 231 | select INPUT_SPARSEKMAP |
| 232 | help | 232 | help |
| 233 | This is a driver for the rfkill switches on Lenovo IdeaPad netbooks. | 233 | This is a driver for the rfkill switches on Lenovo IdeaPad netbooks. |
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index c5c4b8c32eb8..38b34a73866a 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c | |||
| @@ -84,7 +84,7 @@ MODULE_LICENSE("GPL"); | |||
| 84 | */ | 84 | */ |
| 85 | #define AMW0_GUID1 "67C3371D-95A3-4C37-BB61-DD47B491DAAB" | 85 | #define AMW0_GUID1 "67C3371D-95A3-4C37-BB61-DD47B491DAAB" |
| 86 | #define AMW0_GUID2 "431F16ED-0C2B-444C-B267-27DEB140CF9C" | 86 | #define AMW0_GUID2 "431F16ED-0C2B-444C-B267-27DEB140CF9C" |
| 87 | #define WMID_GUID1 "6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3" | 87 | #define WMID_GUID1 "6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3" |
| 88 | #define WMID_GUID2 "95764E09-FB56-4e83-B31A-37761F60994A" | 88 | #define WMID_GUID2 "95764E09-FB56-4e83-B31A-37761F60994A" |
| 89 | #define WMID_GUID3 "61EF69EA-865C-4BC3-A502-A0DEBA0CB531" | 89 | #define WMID_GUID3 "61EF69EA-865C-4BC3-A502-A0DEBA0CB531" |
| 90 | 90 | ||
| @@ -1280,7 +1280,7 @@ static ssize_t set_bool_threeg(struct device *dev, | |||
| 1280 | return -EINVAL; | 1280 | return -EINVAL; |
| 1281 | return count; | 1281 | return count; |
| 1282 | } | 1282 | } |
| 1283 | static DEVICE_ATTR(threeg, S_IWUGO | S_IRUGO | S_IWUSR, show_bool_threeg, | 1283 | static DEVICE_ATTR(threeg, S_IRUGO | S_IWUSR, show_bool_threeg, |
| 1284 | set_bool_threeg); | 1284 | set_bool_threeg); |
| 1285 | 1285 | ||
| 1286 | static ssize_t show_interface(struct device *dev, struct device_attribute *attr, | 1286 | static ssize_t show_interface(struct device *dev, struct device_attribute *attr, |
diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c index 4633fd8532cc..fe495939c307 100644 --- a/drivers/platform/x86/asus_acpi.c +++ b/drivers/platform/x86/asus_acpi.c | |||
| @@ -1081,14 +1081,8 @@ static int asus_hotk_add_fs(struct acpi_device *device) | |||
| 1081 | struct proc_dir_entry *proc; | 1081 | struct proc_dir_entry *proc; |
| 1082 | mode_t mode; | 1082 | mode_t mode; |
| 1083 | 1083 | ||
| 1084 | /* | ||
| 1085 | * If parameter uid or gid is not changed, keep the default setting for | ||
| 1086 | * our proc entries (-rw-rw-rw-) else, it means we care about security, | ||
| 1087 | * and then set to -rw-rw---- | ||
| 1088 | */ | ||
| 1089 | |||
| 1090 | if ((asus_uid == 0) && (asus_gid == 0)) { | 1084 | if ((asus_uid == 0) && (asus_gid == 0)) { |
| 1091 | mode = S_IFREG | S_IRUGO | S_IWUGO; | 1085 | mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP; |
| 1092 | } else { | 1086 | } else { |
| 1093 | mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP; | 1087 | mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP; |
| 1094 | printk(KERN_WARNING " asus_uid and asus_gid parameters are " | 1088 | printk(KERN_WARNING " asus_uid and asus_gid parameters are " |
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 34657f96b5a5..ad24ef36f9f7 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c | |||
| @@ -290,9 +290,12 @@ static int dell_rfkill_set(void *data, bool blocked) | |||
| 290 | dell_send_request(buffer, 17, 11); | 290 | dell_send_request(buffer, 17, 11); |
| 291 | 291 | ||
| 292 | /* If the hardware switch controls this radio, and the hardware | 292 | /* If the hardware switch controls this radio, and the hardware |
| 293 | switch is disabled, don't allow changing the software state */ | 293 | switch is disabled, don't allow changing the software state. |
| 294 | If the hardware switch is reported as not supported, always | ||
| 295 | fire the SMI to toggle the killswitch. */ | ||
| 294 | if ((hwswitch_state & BIT(hwswitch_bit)) && | 296 | if ((hwswitch_state & BIT(hwswitch_bit)) && |
| 295 | !(buffer->output[1] & BIT(16))) { | 297 | !(buffer->output[1] & BIT(16)) && |
| 298 | (buffer->output[1] & BIT(0))) { | ||
| 296 | ret = -EINVAL; | 299 | ret = -EINVAL; |
| 297 | goto out; | 300 | goto out; |
| 298 | } | 301 | } |
| @@ -398,6 +401,23 @@ static const struct file_operations dell_debugfs_fops = { | |||
| 398 | 401 | ||
| 399 | static void dell_update_rfkill(struct work_struct *ignored) | 402 | static void dell_update_rfkill(struct work_struct *ignored) |
| 400 | { | 403 | { |
| 404 | int status; | ||
| 405 | |||
| 406 | get_buffer(); | ||
| 407 | dell_send_request(buffer, 17, 11); | ||
| 408 | status = buffer->output[1]; | ||
| 409 | release_buffer(); | ||
| 410 | |||
| 411 | /* if hardware rfkill is not supported, set it explicitly */ | ||
| 412 | if (!(status & BIT(0))) { | ||
| 413 | if (wifi_rfkill) | ||
| 414 | dell_rfkill_set((void *)1, !((status & BIT(17)) >> 17)); | ||
| 415 | if (bluetooth_rfkill) | ||
| 416 | dell_rfkill_set((void *)2, !((status & BIT(18)) >> 18)); | ||
| 417 | if (wwan_rfkill) | ||
| 418 | dell_rfkill_set((void *)3, !((status & BIT(19)) >> 19)); | ||
| 419 | } | ||
| 420 | |||
| 401 | if (wifi_rfkill) | 421 | if (wifi_rfkill) |
| 402 | dell_rfkill_query(wifi_rfkill, (void *)1); | 422 | dell_rfkill_query(wifi_rfkill, (void *)1); |
| 403 | if (bluetooth_rfkill) | 423 | if (bluetooth_rfkill) |
diff --git a/drivers/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c index 930e62762365..61433d492862 100644 --- a/drivers/platform/x86/intel_pmic_gpio.c +++ b/drivers/platform/x86/intel_pmic_gpio.c | |||
| @@ -60,69 +60,20 @@ enum pmic_gpio_register { | |||
| 60 | #define GPOSW_DOU 0x08 | 60 | #define GPOSW_DOU 0x08 |
| 61 | #define GPOSW_RDRV 0x30 | 61 | #define GPOSW_RDRV 0x30 |
| 62 | 62 | ||
| 63 | #define GPIO_UPDATE_TYPE 0x80000000 | ||
| 63 | 64 | ||
| 64 | #define NUM_GPIO 24 | 65 | #define NUM_GPIO 24 |
| 65 | 66 | ||
| 66 | struct pmic_gpio_irq { | ||
| 67 | spinlock_t lock; | ||
| 68 | u32 trigger[NUM_GPIO]; | ||
| 69 | u32 dirty; | ||
| 70 | struct work_struct work; | ||
| 71 | }; | ||
| 72 | |||
| 73 | |||
| 74 | struct pmic_gpio { | 67 | struct pmic_gpio { |
| 68 | struct mutex buslock; | ||
| 75 | struct gpio_chip chip; | 69 | struct gpio_chip chip; |
| 76 | struct pmic_gpio_irq irqtypes; | ||
| 77 | void *gpiointr; | 70 | void *gpiointr; |
| 78 | int irq; | 71 | int irq; |
| 79 | unsigned irq_base; | 72 | unsigned irq_base; |
| 73 | unsigned int update_type; | ||
| 74 | u32 trigger_type; | ||
| 80 | }; | 75 | }; |
| 81 | 76 | ||
| 82 | static void pmic_program_irqtype(int gpio, int type) | ||
| 83 | { | ||
| 84 | if (type & IRQ_TYPE_EDGE_RISING) | ||
| 85 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x20, 0x20); | ||
| 86 | else | ||
| 87 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x00, 0x20); | ||
| 88 | |||
| 89 | if (type & IRQ_TYPE_EDGE_FALLING) | ||
| 90 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x10, 0x10); | ||
| 91 | else | ||
| 92 | intel_scu_ipc_update_register(GPIO0 + gpio, 0x00, 0x10); | ||
| 93 | }; | ||
| 94 | |||
| 95 | static void pmic_irqtype_work(struct work_struct *work) | ||
| 96 | { | ||
| 97 | struct pmic_gpio_irq *t = | ||
| 98 | container_of(work, struct pmic_gpio_irq, work); | ||
| 99 | unsigned long flags; | ||
| 100 | int i; | ||
| 101 | u16 type; | ||
| 102 | |||
| 103 | spin_lock_irqsave(&t->lock, flags); | ||
| 104 | /* As we drop the lock, we may need multiple scans if we race the | ||
| 105 | pmic_irq_type function */ | ||
| 106 | while (t->dirty) { | ||
| 107 | /* | ||
| 108 | * For each pin that has the dirty bit set send an IPC | ||
| 109 | * message to configure the hardware via the PMIC | ||
| 110 | */ | ||
| 111 | for (i = 0; i < NUM_GPIO; i++) { | ||
| 112 | if (!(t->dirty & (1 << i))) | ||
| 113 | continue; | ||
| 114 | t->dirty &= ~(1 << i); | ||
| 115 | /* We can't trust the array entry or dirty | ||
| 116 | once the lock is dropped */ | ||
| 117 | type = t->trigger[i]; | ||
| 118 | spin_unlock_irqrestore(&t->lock, flags); | ||
| 119 | pmic_program_irqtype(i, type); | ||
| 120 | spin_lock_irqsave(&t->lock, flags); | ||
| 121 | } | ||
| 122 | } | ||
| 123 | spin_unlock_irqrestore(&t->lock, flags); | ||
| 124 | } | ||
| 125 | |||
| 126 | static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 77 | static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
| 127 | { | 78 | { |
| 128 | if (offset > 8) { | 79 | if (offset > 8) { |
| @@ -190,25 +141,24 @@ static void pmic_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | |||
| 190 | 1 << (offset - 16)); | 141 | 1 << (offset - 16)); |
| 191 | } | 142 | } |
| 192 | 143 | ||
| 193 | static int pmic_irq_type(unsigned irq, unsigned type) | 144 | /* |
| 145 | * This is called from genirq with pg->buslock locked and | ||
| 146 | * irq_desc->lock held. We can not access the scu bus here, so we | ||
| 147 | * store the change and update in the bus_sync_unlock() function below | ||
| 148 | */ | ||
| 149 | static int pmic_irq_type(struct irq_data *data, unsigned type) | ||
| 194 | { | 150 | { |
| 195 | struct pmic_gpio *pg = get_irq_chip_data(irq); | 151 | struct pmic_gpio *pg = irq_data_get_irq_chip_data(data); |
| 196 | u32 gpio = irq - pg->irq_base; | 152 | u32 gpio = data->irq - pg->irq_base; |
| 197 | unsigned long flags; | ||
| 198 | 153 | ||
| 199 | if (gpio >= pg->chip.ngpio) | 154 | if (gpio >= pg->chip.ngpio) |
| 200 | return -EINVAL; | 155 | return -EINVAL; |
| 201 | 156 | ||
| 202 | spin_lock_irqsave(&pg->irqtypes.lock, flags); | 157 | pg->trigger_type = type; |
| 203 | pg->irqtypes.trigger[gpio] = type; | 158 | pg->update_type = gpio | GPIO_UPDATE_TYPE; |
| 204 | pg->irqtypes.dirty |= (1 << gpio); | ||
| 205 | spin_unlock_irqrestore(&pg->irqtypes.lock, flags); | ||
| 206 | schedule_work(&pg->irqtypes.work); | ||
| 207 | return 0; | 159 | return 0; |
| 208 | } | 160 | } |
| 209 | 161 | ||
| 210 | |||
| 211 | |||
| 212 | static int pmic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | 162 | static int pmic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) |
| 213 | { | 163 | { |
| 214 | struct pmic_gpio *pg = container_of(chip, struct pmic_gpio, chip); | 164 | struct pmic_gpio *pg = container_of(chip, struct pmic_gpio, chip); |
| @@ -217,38 +167,32 @@ static int pmic_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | |||
| 217 | } | 167 | } |
| 218 | 168 | ||
| 219 | /* the gpiointr register is read-clear, so just do nothing. */ | 169 | /* the gpiointr register is read-clear, so just do nothing. */ |
| 220 | static void pmic_irq_unmask(unsigned irq) | 170 | static void pmic_irq_unmask(struct irq_data *data) { } |
| 221 | { | ||
| 222 | }; | ||
| 223 | 171 | ||
| 224 | static void pmic_irq_mask(unsigned irq) | 172 | static void pmic_irq_mask(struct irq_data *data) { } |
| 225 | { | ||
| 226 | }; | ||
| 227 | 173 | ||
| 228 | static struct irq_chip pmic_irqchip = { | 174 | static struct irq_chip pmic_irqchip = { |
| 229 | .name = "PMIC-GPIO", | 175 | .name = "PMIC-GPIO", |
| 230 | .mask = pmic_irq_mask, | 176 | .irq_mask = pmic_irq_mask, |
| 231 | .unmask = pmic_irq_unmask, | 177 | .irq_unmask = pmic_irq_unmask, |
| 232 | .set_type = pmic_irq_type, | 178 | .irq_set_type = pmic_irq_type, |
| 233 | }; | 179 | }; |
| 234 | 180 | ||
| 235 | static void pmic_irq_handler(unsigned irq, struct irq_desc *desc) | 181 | static irqreturn_t pmic_irq_handler(int irq, void *data) |
| 236 | { | 182 | { |
| 237 | struct pmic_gpio *pg = (struct pmic_gpio *)get_irq_data(irq); | 183 | struct pmic_gpio *pg = data; |
| 238 | u8 intsts = *((u8 *)pg->gpiointr + 4); | 184 | u8 intsts = *((u8 *)pg->gpiointr + 4); |
| 239 | int gpio; | 185 | int gpio; |
| 186 | irqreturn_t ret = IRQ_NONE; | ||
| 240 | 187 | ||
| 241 | for (gpio = 0; gpio < 8; gpio++) { | 188 | for (gpio = 0; gpio < 8; gpio++) { |
| 242 | if (intsts & (1 << gpio)) { | 189 | if (intsts & (1 << gpio)) { |
| 243 | pr_debug("pmic pin %d triggered\n", gpio); | 190 | pr_debug("pmic pin %d triggered\n", gpio); |
| 244 | generic_handle_irq(pg->irq_base + gpio); | 191 | generic_handle_irq(pg->irq_base + gpio); |
| 192 | ret = IRQ_HANDLED; | ||
| 245 | } | 193 | } |
| 246 | } | 194 | } |
| 247 | 195 | return ret; | |
| 248 | if (desc->chip->irq_eoi) | ||
| 249 | desc->chip->irq_eoi(irq_get_irq_data(irq)); | ||
| 250 | else | ||
| 251 | dev_warn(pg->chip.dev, "missing EOI handler for irq %d\n", irq); | ||
| 252 | } | 196 | } |
| 253 | 197 | ||
| 254 | static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) | 198 | static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) |
| @@ -297,8 +241,7 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) | |||
| 297 | pg->chip.can_sleep = 1; | 241 | pg->chip.can_sleep = 1; |
| 298 | pg->chip.dev = dev; | 242 | pg->chip.dev = dev; |
| 299 | 243 | ||
| 300 | INIT_WORK(&pg->irqtypes.work, pmic_irqtype_work); | 244 | mutex_init(&pg->buslock); |
| 301 | spin_lock_init(&pg->irqtypes.lock); | ||
| 302 | 245 | ||
| 303 | pg->chip.dev = dev; | 246 | pg->chip.dev = dev; |
| 304 | retval = gpiochip_add(&pg->chip); | 247 | retval = gpiochip_add(&pg->chip); |
| @@ -306,8 +249,13 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) | |||
| 306 | printk(KERN_ERR "%s: Can not add pmic gpio chip.\n", __func__); | 249 | printk(KERN_ERR "%s: Can not add pmic gpio chip.\n", __func__); |
| 307 | goto err; | 250 | goto err; |
| 308 | } | 251 | } |
| 309 | set_irq_data(pg->irq, pg); | 252 | |
| 310 | set_irq_chained_handler(pg->irq, pmic_irq_handler); | 253 | retval = request_irq(pg->irq, pmic_irq_handler, 0, "pmic", pg); |
| 254 | if (retval) { | ||
| 255 | printk(KERN_WARNING "pmic: Interrupt request failed\n"); | ||
| 256 | goto err; | ||
| 257 | } | ||
| 258 | |||
| 311 | for (i = 0; i < 8; i++) { | 259 | for (i = 0; i < 8; i++) { |
| 312 | set_irq_chip_and_handler_name(i + pg->irq_base, &pmic_irqchip, | 260 | set_irq_chip_and_handler_name(i + pg->irq_base, &pmic_irqchip, |
| 313 | handle_simple_irq, "demux"); | 261 | handle_simple_irq, "demux"); |
diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c index 1fe0f1feff71..865ef78d6f1a 100644 --- a/drivers/platform/x86/tc1100-wmi.c +++ b/drivers/platform/x86/tc1100-wmi.c | |||
| @@ -162,7 +162,7 @@ set_bool_##value(struct device *dev, struct device_attribute *attr, \ | |||
| 162 | return -EINVAL; \ | 162 | return -EINVAL; \ |
| 163 | return count; \ | 163 | return count; \ |
| 164 | } \ | 164 | } \ |
| 165 | static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \ | 165 | static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \ |
| 166 | show_bool_##value, set_bool_##value); | 166 | show_bool_##value, set_bool_##value); |
| 167 | 167 | ||
| 168 | show_set_bool(wireless, TC1100_INSTANCE_WIRELESS); | 168 | show_set_bool(wireless, TC1100_INSTANCE_WIRELESS); |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index dd599585c6a9..eb9922385ef8 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
| @@ -2275,16 +2275,12 @@ static void tpacpi_input_send_key(const unsigned int scancode) | |||
| 2275 | if (keycode != KEY_RESERVED) { | 2275 | if (keycode != KEY_RESERVED) { |
| 2276 | mutex_lock(&tpacpi_inputdev_send_mutex); | 2276 | mutex_lock(&tpacpi_inputdev_send_mutex); |
| 2277 | 2277 | ||
| 2278 | input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode); | ||
| 2278 | input_report_key(tpacpi_inputdev, keycode, 1); | 2279 | input_report_key(tpacpi_inputdev, keycode, 1); |
| 2279 | if (keycode == KEY_UNKNOWN) | ||
| 2280 | input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, | ||
| 2281 | scancode); | ||
| 2282 | input_sync(tpacpi_inputdev); | 2280 | input_sync(tpacpi_inputdev); |
| 2283 | 2281 | ||
| 2282 | input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode); | ||
| 2284 | input_report_key(tpacpi_inputdev, keycode, 0); | 2283 | input_report_key(tpacpi_inputdev, keycode, 0); |
| 2285 | if (keycode == KEY_UNKNOWN) | ||
| 2286 | input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, | ||
| 2287 | scancode); | ||
| 2288 | input_sync(tpacpi_inputdev); | 2284 | input_sync(tpacpi_inputdev); |
| 2289 | 2285 | ||
| 2290 | mutex_unlock(&tpacpi_inputdev_send_mutex); | 2286 | mutex_unlock(&tpacpi_inputdev_send_mutex); |
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c index cba1b43f7519..a4e8eb9fece6 100644 --- a/drivers/pps/kapi.c +++ b/drivers/pps/kapi.c | |||
| @@ -168,7 +168,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event, | |||
| 168 | { | 168 | { |
| 169 | unsigned long flags; | 169 | unsigned long flags; |
| 170 | int captured = 0; | 170 | int captured = 0; |
| 171 | struct pps_ktime ts_real; | 171 | struct pps_ktime ts_real = { .sec = 0, .nsec = 0, .flags = 0 }; |
| 172 | 172 | ||
| 173 | /* check event type */ | 173 | /* check event type */ |
| 174 | BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); | 174 | BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); |
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c index 76b41853a877..1269fbd2deca 100644 --- a/drivers/rapidio/rio-sysfs.c +++ b/drivers/rapidio/rio-sysfs.c | |||
| @@ -77,9 +77,9 @@ rio_read_config(struct file *filp, struct kobject *kobj, | |||
| 77 | 77 | ||
| 78 | /* Several chips lock up trying to read undefined config space */ | 78 | /* Several chips lock up trying to read undefined config space */ |
| 79 | if (capable(CAP_SYS_ADMIN)) | 79 | if (capable(CAP_SYS_ADMIN)) |
| 80 | size = 0x200000; | 80 | size = RIO_MAINT_SPACE_SZ; |
| 81 | 81 | ||
| 82 | if (off > size) | 82 | if (off >= size) |
| 83 | return 0; | 83 | return 0; |
| 84 | if (off + count > size) { | 84 | if (off + count > size) { |
| 85 | size -= off; | 85 | size -= off; |
| @@ -147,10 +147,10 @@ rio_write_config(struct file *filp, struct kobject *kobj, | |||
| 147 | loff_t init_off = off; | 147 | loff_t init_off = off; |
| 148 | u8 *data = (u8 *) buf; | 148 | u8 *data = (u8 *) buf; |
| 149 | 149 | ||
| 150 | if (off > 0x200000) | 150 | if (off >= RIO_MAINT_SPACE_SZ) |
| 151 | return 0; | 151 | return 0; |
| 152 | if (off + count > 0x200000) { | 152 | if (off + count > RIO_MAINT_SPACE_SZ) { |
| 153 | size = 0x200000 - off; | 153 | size = RIO_MAINT_SPACE_SZ - off; |
| 154 | count = size; | 154 | count = size; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| @@ -200,7 +200,7 @@ static struct bin_attribute rio_config_attr = { | |||
| 200 | .name = "config", | 200 | .name = "config", |
| 201 | .mode = S_IRUGO | S_IWUSR, | 201 | .mode = S_IRUGO | S_IWUSR, |
| 202 | }, | 202 | }, |
| 203 | .size = 0x200000, | 203 | .size = RIO_MAINT_SPACE_SZ, |
| 204 | .read = rio_read_config, | 204 | .read = rio_read_config, |
| 205 | .write = rio_write_config, | 205 | .write = rio_write_config, |
| 206 | }; | 206 | }; |
diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c index f53d31b950d4..2bb5de1f2421 100644 --- a/drivers/regulator/mc13xxx-regulator-core.c +++ b/drivers/regulator/mc13xxx-regulator-core.c | |||
| @@ -174,7 +174,7 @@ static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev) | |||
| 174 | 174 | ||
| 175 | dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val); | 175 | dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val); |
| 176 | 176 | ||
| 177 | BUG_ON(val < 0 || val > mc13xxx_regulators[id].desc.n_voltages); | 177 | BUG_ON(val > mc13xxx_regulators[id].desc.n_voltages); |
| 178 | 178 | ||
| 179 | return mc13xxx_regulators[id].voltages[val]; | 179 | return mc13xxx_regulators[id].voltages[val]; |
| 180 | } | 180 | } |
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 8b0d2c4bde91..06df898842c0 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c | |||
| @@ -120,6 +120,7 @@ static unsigned int wm831x_dcdc_get_mode(struct regulator_dev *rdev) | |||
| 120 | return REGULATOR_MODE_IDLE; | 120 | return REGULATOR_MODE_IDLE; |
| 121 | default: | 121 | default: |
| 122 | BUG(); | 122 | BUG(); |
| 123 | return -EINVAL; | ||
| 123 | } | 124 | } |
| 124 | } | 125 | } |
| 125 | 126 | ||
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index cdd97192dc69..4941cade319f 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
| @@ -97,6 +97,18 @@ config RTC_INTF_DEV | |||
| 97 | 97 | ||
| 98 | If unsure, say Y. | 98 | If unsure, say Y. |
| 99 | 99 | ||
| 100 | config RTC_INTF_DEV_UIE_EMUL | ||
| 101 | bool "RTC UIE emulation on dev interface" | ||
| 102 | depends on RTC_INTF_DEV | ||
| 103 | help | ||
| 104 | Provides an emulation for RTC_UIE if the underlying rtc chip | ||
| 105 | driver does not expose RTC_UIE ioctls. Those requests generate | ||
| 106 | once-per-second update interrupts, used for synchronization. | ||
| 107 | |||
| 108 | The emulation code will read the time from the hardware | ||
| 109 | clock several times per second, please enable this option | ||
| 110 | only if you know that you really need it. | ||
| 111 | |||
| 100 | config RTC_DRV_TEST | 112 | config RTC_DRV_TEST |
| 101 | tristate "Test driver/device" | 113 | tristate "Test driver/device" |
| 102 | help | 114 | help |
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index a0c01967244d..cb2f0728fd70 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
| @@ -209,9 +209,8 @@ int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled) | |||
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | if (err) | 211 | if (err) |
| 212 | return err; | 212 | /* nothing */; |
| 213 | 213 | else if (!rtc->ops) | |
| 214 | if (!rtc->ops) | ||
| 215 | err = -ENODEV; | 214 | err = -ENODEV; |
| 216 | else if (!rtc->ops->alarm_irq_enable) | 215 | else if (!rtc->ops->alarm_irq_enable) |
| 217 | err = -EINVAL; | 216 | err = -EINVAL; |
| @@ -229,6 +228,12 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) | |||
| 229 | if (err) | 228 | if (err) |
| 230 | return err; | 229 | return err; |
| 231 | 230 | ||
| 231 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | ||
| 232 | if (enabled == 0 && rtc->uie_irq_active) { | ||
| 233 | mutex_unlock(&rtc->ops_lock); | ||
| 234 | return rtc_dev_update_irq_enable_emul(rtc, 0); | ||
| 235 | } | ||
| 236 | #endif | ||
| 232 | /* make sure we're changing state */ | 237 | /* make sure we're changing state */ |
| 233 | if (rtc->uie_rtctimer.enabled == enabled) | 238 | if (rtc->uie_rtctimer.enabled == enabled) |
| 234 | goto out; | 239 | goto out; |
| @@ -248,6 +253,16 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) | |||
| 248 | 253 | ||
| 249 | out: | 254 | out: |
| 250 | mutex_unlock(&rtc->ops_lock); | 255 | mutex_unlock(&rtc->ops_lock); |
| 256 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | ||
| 257 | /* | ||
| 258 | * Enable emulation if the driver did not provide | ||
| 259 | * the update_irq_enable function pointer or if returned | ||
| 260 | * -EINVAL to signal that it has been configured without | ||
| 261 | * interrupts or that are not available at the moment. | ||
| 262 | */ | ||
| 263 | if (err == -EINVAL) | ||
| 264 | err = rtc_dev_update_irq_enable_emul(rtc, enabled); | ||
| 265 | #endif | ||
| 251 | return err; | 266 | return err; |
| 252 | 267 | ||
| 253 | } | 268 | } |
| @@ -263,7 +278,7 @@ EXPORT_SYMBOL_GPL(rtc_update_irq_enable); | |||
| 263 | * | 278 | * |
| 264 | * Triggers the registered irq_task function callback. | 279 | * Triggers the registered irq_task function callback. |
| 265 | */ | 280 | */ |
| 266 | static void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode) | 281 | void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode) |
| 267 | { | 282 | { |
| 268 | unsigned long flags; | 283 | unsigned long flags; |
| 269 | 284 | ||
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c index c36749e4c926..5469c52cba3d 100644 --- a/drivers/rtc/rtc-at91sam9.c +++ b/drivers/rtc/rtc-at91sam9.c | |||
| @@ -309,7 +309,7 @@ static const struct rtc_class_ops at91_rtc_ops = { | |||
| 309 | .read_alarm = at91_rtc_readalarm, | 309 | .read_alarm = at91_rtc_readalarm, |
| 310 | .set_alarm = at91_rtc_setalarm, | 310 | .set_alarm = at91_rtc_setalarm, |
| 311 | .proc = at91_rtc_proc, | 311 | .proc = at91_rtc_proc, |
| 312 | .alarm_irq_enabled = at91_rtc_alarm_irq_enable, | 312 | .alarm_irq_enable = at91_rtc_alarm_irq_enable, |
| 313 | }; | 313 | }; |
| 314 | 314 | ||
| 315 | /* | 315 | /* |
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 37c3cc1b3dd5..d0e06edb14c5 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
| @@ -46,6 +46,105 @@ static int rtc_dev_open(struct inode *inode, struct file *file) | |||
| 46 | return err; | 46 | return err; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | ||
| 50 | /* | ||
| 51 | * Routine to poll RTC seconds field for change as often as possible, | ||
| 52 | * after first RTC_UIE use timer to reduce polling | ||
| 53 | */ | ||
| 54 | static void rtc_uie_task(struct work_struct *work) | ||
| 55 | { | ||
| 56 | struct rtc_device *rtc = | ||
| 57 | container_of(work, struct rtc_device, uie_task); | ||
| 58 | struct rtc_time tm; | ||
| 59 | int num = 0; | ||
| 60 | int err; | ||
| 61 | |||
| 62 | err = rtc_read_time(rtc, &tm); | ||
| 63 | |||
| 64 | spin_lock_irq(&rtc->irq_lock); | ||
| 65 | if (rtc->stop_uie_polling || err) { | ||
| 66 | rtc->uie_task_active = 0; | ||
| 67 | } else if (rtc->oldsecs != tm.tm_sec) { | ||
| 68 | num = (tm.tm_sec + 60 - rtc->oldsecs) % 60; | ||
| 69 | rtc->oldsecs = tm.tm_sec; | ||
| 70 | rtc->uie_timer.expires = jiffies + HZ - (HZ/10); | ||
| 71 | rtc->uie_timer_active = 1; | ||
| 72 | rtc->uie_task_active = 0; | ||
| 73 | add_timer(&rtc->uie_timer); | ||
| 74 | } else if (schedule_work(&rtc->uie_task) == 0) { | ||
| 75 | rtc->uie_task_active = 0; | ||
| 76 | } | ||
| 77 | spin_unlock_irq(&rtc->irq_lock); | ||
| 78 | if (num) | ||
| 79 | rtc_handle_legacy_irq(rtc, num, RTC_UF); | ||
| 80 | } | ||
| 81 | static void rtc_uie_timer(unsigned long data) | ||
| 82 | { | ||
| 83 | struct rtc_device *rtc = (struct rtc_device *)data; | ||
| 84 | unsigned long flags; | ||
| 85 | |||
| 86 | spin_lock_irqsave(&rtc->irq_lock, flags); | ||
| 87 | rtc->uie_timer_active = 0; | ||
| 88 | rtc->uie_task_active = 1; | ||
| 89 | if ((schedule_work(&rtc->uie_task) == 0)) | ||
| 90 | rtc->uie_task_active = 0; | ||
| 91 | spin_unlock_irqrestore(&rtc->irq_lock, flags); | ||
| 92 | } | ||
| 93 | |||
| 94 | static int clear_uie(struct rtc_device *rtc) | ||
| 95 | { | ||
| 96 | spin_lock_irq(&rtc->irq_lock); | ||
| 97 | if (rtc->uie_irq_active) { | ||
| 98 | rtc->stop_uie_polling = 1; | ||
| 99 | if (rtc->uie_timer_active) { | ||
| 100 | spin_unlock_irq(&rtc->irq_lock); | ||
| 101 | del_timer_sync(&rtc->uie_timer); | ||
| 102 | spin_lock_irq(&rtc->irq_lock); | ||
| 103 | rtc->uie_timer_active = 0; | ||
| 104 | } | ||
| 105 | if (rtc->uie_task_active) { | ||
| 106 | spin_unlock_irq(&rtc->irq_lock); | ||
| 107 | flush_scheduled_work(); | ||
| 108 | spin_lock_irq(&rtc->irq_lock); | ||
| 109 | } | ||
| 110 | rtc->uie_irq_active = 0; | ||
| 111 | } | ||
| 112 | spin_unlock_irq(&rtc->irq_lock); | ||
| 113 | return 0; | ||
| 114 | } | ||
| 115 | |||
| 116 | static int set_uie(struct rtc_device *rtc) | ||
| 117 | { | ||
| 118 | struct rtc_time tm; | ||
| 119 | int err; | ||
| 120 | |||
| 121 | err = rtc_read_time(rtc, &tm); | ||
| 122 | if (err) | ||
| 123 | return err; | ||
| 124 | spin_lock_irq(&rtc->irq_lock); | ||
| 125 | if (!rtc->uie_irq_active) { | ||
| 126 | rtc->uie_irq_active = 1; | ||
| 127 | rtc->stop_uie_polling = 0; | ||
| 128 | rtc->oldsecs = tm.tm_sec; | ||
| 129 | rtc->uie_task_active = 1; | ||
| 130 | if (schedule_work(&rtc->uie_task) == 0) | ||
| 131 | rtc->uie_task_active = 0; | ||
| 132 | } | ||
| 133 | rtc->irq_data = 0; | ||
| 134 | spin_unlock_irq(&rtc->irq_lock); | ||
| 135 | return 0; | ||
| 136 | } | ||
| 137 | |||
| 138 | int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, unsigned int enabled) | ||
| 139 | { | ||
| 140 | if (enabled) | ||
| 141 | return set_uie(rtc); | ||
| 142 | else | ||
| 143 | return clear_uie(rtc); | ||
| 144 | } | ||
| 145 | EXPORT_SYMBOL(rtc_dev_update_irq_enable_emul); | ||
| 146 | |||
| 147 | #endif /* CONFIG_RTC_INTF_DEV_UIE_EMUL */ | ||
| 49 | 148 | ||
| 50 | static ssize_t | 149 | static ssize_t |
| 51 | rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | 150 | rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) |
| @@ -387,6 +486,11 @@ void rtc_dev_prepare(struct rtc_device *rtc) | |||
| 387 | 486 | ||
| 388 | rtc->dev.devt = MKDEV(MAJOR(rtc_devt), rtc->id); | 487 | rtc->dev.devt = MKDEV(MAJOR(rtc_devt), rtc->id); |
| 389 | 488 | ||
| 489 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | ||
| 490 | INIT_WORK(&rtc->uie_task, rtc_uie_task); | ||
| 491 | setup_timer(&rtc->uie_timer, rtc_uie_timer, (unsigned long)rtc); | ||
| 492 | #endif | ||
| 493 | |||
| 390 | cdev_init(&rtc->char_dev, &rtc_dev_fops); | 494 | cdev_init(&rtc->char_dev, &rtc_dev_fops); |
| 391 | rtc->char_dev.owner = rtc->owner; | 495 | rtc->char_dev.owner = rtc->owner; |
| 392 | } | 496 | } |
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 23a9ee19764c..950735415a7c 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * RTC client/driver for the Maxim/Dallas DS3232 Real-Time Clock over I2C | 2 | * RTC client/driver for the Maxim/Dallas DS3232 Real-Time Clock over I2C |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2009-2010 Freescale Semiconductor. | 4 | * Copyright (C) 2009-2011 Freescale Semiconductor. |
| 5 | * Author: Jack Lan <jack.lan@freescale.com> | 5 | * Author: Jack Lan <jack.lan@freescale.com> |
| 6 | * | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
| @@ -141,9 +141,11 @@ static int ds3232_read_time(struct device *dev, struct rtc_time *time) | |||
| 141 | time->tm_hour = bcd2bin(hour); | 141 | time->tm_hour = bcd2bin(hour); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | time->tm_wday = bcd2bin(week); | 144 | /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */ |
| 145 | time->tm_wday = bcd2bin(week) - 1; | ||
| 145 | time->tm_mday = bcd2bin(day); | 146 | time->tm_mday = bcd2bin(day); |
| 146 | time->tm_mon = bcd2bin(month & 0x7F); | 147 | /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */ |
| 148 | time->tm_mon = bcd2bin(month & 0x7F) - 1; | ||
| 147 | if (century) | 149 | if (century) |
| 148 | add_century = 100; | 150 | add_century = 100; |
| 149 | 151 | ||
| @@ -162,9 +164,11 @@ static int ds3232_set_time(struct device *dev, struct rtc_time *time) | |||
| 162 | buf[0] = bin2bcd(time->tm_sec); | 164 | buf[0] = bin2bcd(time->tm_sec); |
| 163 | buf[1] = bin2bcd(time->tm_min); | 165 | buf[1] = bin2bcd(time->tm_min); |
| 164 | buf[2] = bin2bcd(time->tm_hour); | 166 | buf[2] = bin2bcd(time->tm_hour); |
| 165 | buf[3] = bin2bcd(time->tm_wday); /* Day of the week */ | 167 | /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */ |
| 168 | buf[3] = bin2bcd(time->tm_wday + 1); | ||
| 166 | buf[4] = bin2bcd(time->tm_mday); /* Date */ | 169 | buf[4] = bin2bcd(time->tm_mday); /* Date */ |
| 167 | buf[5] = bin2bcd(time->tm_mon); | 170 | /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */ |
| 171 | buf[5] = bin2bcd(time->tm_mon + 1); | ||
| 168 | if (time->tm_year >= 100) { | 172 | if (time->tm_year >= 100) { |
| 169 | buf[5] |= 0x80; | 173 | buf[5] |= 0x80; |
| 170 | buf[6] = bin2bcd(time->tm_year - 100); | 174 | buf[6] = bin2bcd(time->tm_year - 100); |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 318672d05563..a9fe23d5bd0f 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
| @@ -72,7 +72,7 @@ static struct dasd_discipline dasd_eckd_discipline; | |||
| 72 | static struct ccw_device_id dasd_eckd_ids[] = { | 72 | static struct ccw_device_id dasd_eckd_ids[] = { |
| 73 | { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), .driver_info = 0x1}, | 73 | { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), .driver_info = 0x1}, |
| 74 | { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), .driver_info = 0x2}, | 74 | { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), .driver_info = 0x2}, |
| 75 | { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3390, 0), .driver_info = 0x3}, | 75 | { CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3380, 0), .driver_info = 0x3}, |
| 76 | { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), .driver_info = 0x4}, | 76 | { CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3380, 0), .driver_info = 0x4}, |
| 77 | { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), .driver_info = 0x5}, | 77 | { CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3380, 0), .driver_info = 0x5}, |
| 78 | { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), .driver_info = 0x6}, | 78 | { CCW_DEVICE_DEVTYPE (0x9343, 0, 0x9345, 0), .driver_info = 0x6}, |
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 44578b56ad0a..d3e58d763b43 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
| @@ -1561,6 +1561,7 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) | |||
| 1561 | { | 1561 | { |
| 1562 | struct Scsi_Host *host = rport_to_shost(rport); | 1562 | struct Scsi_Host *host = rport_to_shost(rport); |
| 1563 | fc_port_t *fcport = *(fc_port_t **)rport->dd_data; | 1563 | fc_port_t *fcport = *(fc_port_t **)rport->dd_data; |
| 1564 | unsigned long flags; | ||
| 1564 | 1565 | ||
| 1565 | if (!fcport) | 1566 | if (!fcport) |
| 1566 | return; | 1567 | return; |
| @@ -1573,10 +1574,10 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) | |||
| 1573 | * Transport has effectively 'deleted' the rport, clear | 1574 | * Transport has effectively 'deleted' the rport, clear |
| 1574 | * all local references. | 1575 | * all local references. |
| 1575 | */ | 1576 | */ |
| 1576 | spin_lock_irq(host->host_lock); | 1577 | spin_lock_irqsave(host->host_lock, flags); |
| 1577 | fcport->rport = fcport->drport = NULL; | 1578 | fcport->rport = fcport->drport = NULL; |
| 1578 | *((fc_port_t **)rport->dd_data) = NULL; | 1579 | *((fc_port_t **)rport->dd_data) = NULL; |
| 1579 | spin_unlock_irq(host->host_lock); | 1580 | spin_unlock_irqrestore(host->host_lock, flags); |
| 1580 | 1581 | ||
| 1581 | if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) | 1582 | if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) |
| 1582 | return; | 1583 | return; |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index f948e1a73aec..d9479c3fe5f8 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
| @@ -2505,11 +2505,12 @@ qla2x00_rport_del(void *data) | |||
| 2505 | { | 2505 | { |
| 2506 | fc_port_t *fcport = data; | 2506 | fc_port_t *fcport = data; |
| 2507 | struct fc_rport *rport; | 2507 | struct fc_rport *rport; |
| 2508 | unsigned long flags; | ||
| 2508 | 2509 | ||
| 2509 | spin_lock_irq(fcport->vha->host->host_lock); | 2510 | spin_lock_irqsave(fcport->vha->host->host_lock, flags); |
| 2510 | rport = fcport->drport ? fcport->drport: fcport->rport; | 2511 | rport = fcport->drport ? fcport->drport: fcport->rport; |
| 2511 | fcport->drport = NULL; | 2512 | fcport->drport = NULL; |
| 2512 | spin_unlock_irq(fcport->vha->host->host_lock); | 2513 | spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); |
| 2513 | if (rport) | 2514 | if (rport) |
| 2514 | fc_remote_port_delete(rport); | 2515 | fc_remote_port_delete(rport); |
| 2515 | } | 2516 | } |
| @@ -2879,6 +2880,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
| 2879 | struct fc_rport_identifiers rport_ids; | 2880 | struct fc_rport_identifiers rport_ids; |
| 2880 | struct fc_rport *rport; | 2881 | struct fc_rport *rport; |
| 2881 | struct qla_hw_data *ha = vha->hw; | 2882 | struct qla_hw_data *ha = vha->hw; |
| 2883 | unsigned long flags; | ||
| 2882 | 2884 | ||
| 2883 | qla2x00_rport_del(fcport); | 2885 | qla2x00_rport_del(fcport); |
| 2884 | 2886 | ||
| @@ -2893,9 +2895,9 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
| 2893 | "Unable to allocate fc remote port!\n"); | 2895 | "Unable to allocate fc remote port!\n"); |
| 2894 | return; | 2896 | return; |
| 2895 | } | 2897 | } |
| 2896 | spin_lock_irq(fcport->vha->host->host_lock); | 2898 | spin_lock_irqsave(fcport->vha->host->host_lock, flags); |
| 2897 | *((fc_port_t **)rport->dd_data) = fcport; | 2899 | *((fc_port_t **)rport->dd_data) = fcport; |
| 2898 | spin_unlock_irq(fcport->vha->host->host_lock); | 2900 | spin_unlock_irqrestore(fcport->vha->host->host_lock, flags); |
| 2899 | 2901 | ||
| 2900 | rport->supported_classes = fcport->supported_classes; | 2902 | rport->supported_classes = fcport->supported_classes; |
| 2901 | 2903 | ||
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index c194c23ca1fb..f27724d76cf6 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
| @@ -562,7 +562,6 @@ qla2xxx_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *) | |||
| 562 | } | 562 | } |
| 563 | if (atomic_read(&fcport->state) != FCS_ONLINE) { | 563 | if (atomic_read(&fcport->state) != FCS_ONLINE) { |
| 564 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || | 564 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || |
| 565 | atomic_read(&fcport->state) == FCS_DEVICE_LOST || | ||
| 566 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { | 565 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { |
| 567 | cmd->result = DID_NO_CONNECT << 16; | 566 | cmd->result = DID_NO_CONNECT << 16; |
| 568 | goto qc24_fail_command; | 567 | goto qc24_fail_command; |
| @@ -2513,6 +2512,7 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
| 2513 | { | 2512 | { |
| 2514 | struct fc_rport *rport; | 2513 | struct fc_rport *rport; |
| 2515 | scsi_qla_host_t *base_vha; | 2514 | scsi_qla_host_t *base_vha; |
| 2515 | unsigned long flags; | ||
| 2516 | 2516 | ||
| 2517 | if (!fcport->rport) | 2517 | if (!fcport->rport) |
| 2518 | return; | 2518 | return; |
| @@ -2520,9 +2520,9 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
| 2520 | rport = fcport->rport; | 2520 | rport = fcport->rport; |
| 2521 | if (defer) { | 2521 | if (defer) { |
| 2522 | base_vha = pci_get_drvdata(vha->hw->pdev); | 2522 | base_vha = pci_get_drvdata(vha->hw->pdev); |
| 2523 | spin_lock_irq(vha->host->host_lock); | 2523 | spin_lock_irqsave(vha->host->host_lock, flags); |
| 2524 | fcport->drport = rport; | 2524 | fcport->drport = rport; |
| 2525 | spin_unlock_irq(vha->host->host_lock); | 2525 | spin_unlock_irqrestore(vha->host->host_lock, flags); |
| 2526 | set_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags); | 2526 | set_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags); |
| 2527 | qla2xxx_wake_dpc(base_vha); | 2527 | qla2xxx_wake_dpc(base_vha); |
| 2528 | } else | 2528 | } else |
| @@ -3282,10 +3282,10 @@ qla2x00_do_dpc(void *data) | |||
| 3282 | 3282 | ||
| 3283 | set_user_nice(current, -20); | 3283 | set_user_nice(current, -20); |
| 3284 | 3284 | ||
| 3285 | set_current_state(TASK_INTERRUPTIBLE); | ||
| 3285 | while (!kthread_should_stop()) { | 3286 | while (!kthread_should_stop()) { |
| 3286 | DEBUG3(printk("qla2x00: DPC handler sleeping\n")); | 3287 | DEBUG3(printk("qla2x00: DPC handler sleeping\n")); |
| 3287 | 3288 | ||
| 3288 | set_current_state(TASK_INTERRUPTIBLE); | ||
| 3289 | schedule(); | 3289 | schedule(); |
| 3290 | __set_current_state(TASK_RUNNING); | 3290 | __set_current_state(TASK_RUNNING); |
| 3291 | 3291 | ||
| @@ -3454,7 +3454,9 @@ qla2x00_do_dpc(void *data) | |||
| 3454 | qla2x00_do_dpc_all_vps(base_vha); | 3454 | qla2x00_do_dpc_all_vps(base_vha); |
| 3455 | 3455 | ||
| 3456 | ha->dpc_active = 0; | 3456 | ha->dpc_active = 0; |
| 3457 | set_current_state(TASK_INTERRUPTIBLE); | ||
| 3457 | } /* End of while(1) */ | 3458 | } /* End of while(1) */ |
| 3459 | __set_current_state(TASK_RUNNING); | ||
| 3458 | 3460 | ||
| 3459 | DEBUG(printk("scsi(%ld): DPC handler exiting\n", base_vha->host_no)); | 3461 | DEBUG(printk("scsi(%ld): DPC handler exiting\n", base_vha->host_no)); |
| 3460 | 3462 | ||
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 7b310934efed..a6b2d72022fc 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
| @@ -1671,7 +1671,7 @@ static int do_device_access(struct scsi_cmnd *scmd, | |||
| 1671 | unsigned long long lba, unsigned int num, int write) | 1671 | unsigned long long lba, unsigned int num, int write) |
| 1672 | { | 1672 | { |
| 1673 | int ret; | 1673 | int ret; |
| 1674 | unsigned int block, rest = 0; | 1674 | unsigned long long block, rest = 0; |
| 1675 | int (*func)(struct scsi_cmnd *, unsigned char *, int); | 1675 | int (*func)(struct scsi_cmnd *, unsigned char *, int); |
| 1676 | 1676 | ||
| 1677 | func = write ? fetch_to_dev_buffer : fill_from_dev_buffer; | 1677 | func = write ? fetch_to_dev_buffer : fill_from_dev_buffer; |
diff --git a/drivers/spi/pxa2xx_spi_pci.c b/drivers/spi/pxa2xx_spi_pci.c index 351d8a375b57..19752b09e155 100644 --- a/drivers/spi/pxa2xx_spi_pci.c +++ b/drivers/spi/pxa2xx_spi_pci.c | |||
| @@ -7,10 +7,9 @@ | |||
| 7 | #include <linux/of_device.h> | 7 | #include <linux/of_device.h> |
| 8 | #include <linux/spi/pxa2xx_spi.h> | 8 | #include <linux/spi/pxa2xx_spi.h> |
| 9 | 9 | ||
| 10 | struct awesome_struct { | 10 | struct ce4100_info { |
| 11 | struct ssp_device ssp; | 11 | struct ssp_device ssp; |
| 12 | struct platform_device spi_pdev; | 12 | struct platform_device *spi_pdev; |
| 13 | struct pxa2xx_spi_master spi_pdata; | ||
| 14 | }; | 13 | }; |
| 15 | 14 | ||
| 16 | static DEFINE_MUTEX(ssp_lock); | 15 | static DEFINE_MUTEX(ssp_lock); |
| @@ -51,23 +50,15 @@ void pxa_ssp_free(struct ssp_device *ssp) | |||
| 51 | } | 50 | } |
| 52 | EXPORT_SYMBOL_GPL(pxa_ssp_free); | 51 | EXPORT_SYMBOL_GPL(pxa_ssp_free); |
| 53 | 52 | ||
| 54 | static void plat_dev_release(struct device *dev) | ||
| 55 | { | ||
| 56 | struct awesome_struct *as = container_of(dev, | ||
| 57 | struct awesome_struct, spi_pdev.dev); | ||
| 58 | |||
| 59 | of_device_node_put(&as->spi_pdev.dev); | ||
| 60 | } | ||
| 61 | |||
| 62 | static int __devinit ce4100_spi_probe(struct pci_dev *dev, | 53 | static int __devinit ce4100_spi_probe(struct pci_dev *dev, |
| 63 | const struct pci_device_id *ent) | 54 | const struct pci_device_id *ent) |
| 64 | { | 55 | { |
| 65 | int ret; | 56 | int ret; |
| 66 | resource_size_t phys_beg; | 57 | resource_size_t phys_beg; |
| 67 | resource_size_t phys_len; | 58 | resource_size_t phys_len; |
| 68 | struct awesome_struct *spi_info; | 59 | struct ce4100_info *spi_info; |
| 69 | struct platform_device *pdev; | 60 | struct platform_device *pdev; |
| 70 | struct pxa2xx_spi_master *spi_pdata; | 61 | struct pxa2xx_spi_master spi_pdata; |
| 71 | struct ssp_device *ssp; | 62 | struct ssp_device *ssp; |
| 72 | 63 | ||
| 73 | ret = pci_enable_device(dev); | 64 | ret = pci_enable_device(dev); |
| @@ -84,33 +75,30 @@ static int __devinit ce4100_spi_probe(struct pci_dev *dev, | |||
| 84 | return ret; | 75 | return ret; |
| 85 | } | 76 | } |
| 86 | 77 | ||
| 78 | pdev = platform_device_alloc("pxa2xx-spi", dev->devfn); | ||
| 87 | spi_info = kzalloc(sizeof(*spi_info), GFP_KERNEL); | 79 | spi_info = kzalloc(sizeof(*spi_info), GFP_KERNEL); |
| 88 | if (!spi_info) { | 80 | if (!pdev || !spi_info ) { |
| 89 | ret = -ENOMEM; | 81 | ret = -ENOMEM; |
| 90 | goto err_kz; | 82 | goto err_nomem; |
| 91 | } | 83 | } |
| 92 | ssp = &spi_info->ssp; | 84 | memset(&spi_pdata, 0, sizeof(spi_pdata)); |
| 93 | pdev = &spi_info->spi_pdev; | 85 | spi_pdata.num_chipselect = dev->devfn; |
| 94 | spi_pdata = &spi_info->spi_pdata; | ||
| 95 | 86 | ||
| 96 | pdev->name = "pxa2xx-spi"; | 87 | ret = platform_device_add_data(pdev, &spi_pdata, sizeof(spi_pdata)); |
| 97 | pdev->id = dev->devfn; | 88 | if (ret) |
| 98 | pdev->dev.parent = &dev->dev; | 89 | goto err_nomem; |
| 99 | pdev->dev.platform_data = &spi_info->spi_pdata; | ||
| 100 | 90 | ||
| 91 | pdev->dev.parent = &dev->dev; | ||
| 101 | #ifdef CONFIG_OF | 92 | #ifdef CONFIG_OF |
| 102 | pdev->dev.of_node = dev->dev.of_node; | 93 | pdev->dev.of_node = dev->dev.of_node; |
| 103 | #endif | 94 | #endif |
| 104 | pdev->dev.release = plat_dev_release; | 95 | ssp = &spi_info->ssp; |
| 105 | |||
| 106 | spi_pdata->num_chipselect = dev->devfn; | ||
| 107 | |||
| 108 | ssp->phys_base = pci_resource_start(dev, 0); | 96 | ssp->phys_base = pci_resource_start(dev, 0); |
| 109 | ssp->mmio_base = ioremap(phys_beg, phys_len); | 97 | ssp->mmio_base = ioremap(phys_beg, phys_len); |
| 110 | if (!ssp->mmio_base) { | 98 | if (!ssp->mmio_base) { |
| 111 | dev_err(&pdev->dev, "failed to ioremap() registers\n"); | 99 | dev_err(&pdev->dev, "failed to ioremap() registers\n"); |
| 112 | ret = -EIO; | 100 | ret = -EIO; |
| 113 | goto err_remap; | 101 | goto err_nomem; |
| 114 | } | 102 | } |
| 115 | ssp->irq = dev->irq; | 103 | ssp->irq = dev->irq; |
| 116 | ssp->port_id = pdev->id; | 104 | ssp->port_id = pdev->id; |
| @@ -122,7 +110,7 @@ static int __devinit ce4100_spi_probe(struct pci_dev *dev, | |||
| 122 | 110 | ||
| 123 | pci_set_drvdata(dev, spi_info); | 111 | pci_set_drvdata(dev, spi_info); |
| 124 | 112 | ||
| 125 | ret = platform_device_register(pdev); | 113 | ret = platform_device_add(pdev); |
| 126 | if (ret) | 114 | if (ret) |
| 127 | goto err_dev_add; | 115 | goto err_dev_add; |
| 128 | 116 | ||
| @@ -135,27 +123,21 @@ err_dev_add: | |||
| 135 | mutex_unlock(&ssp_lock); | 123 | mutex_unlock(&ssp_lock); |
| 136 | iounmap(ssp->mmio_base); | 124 | iounmap(ssp->mmio_base); |
| 137 | 125 | ||
| 138 | err_remap: | 126 | err_nomem: |
| 139 | kfree(spi_info); | ||
| 140 | |||
| 141 | err_kz: | ||
| 142 | release_mem_region(phys_beg, phys_len); | 127 | release_mem_region(phys_beg, phys_len); |
| 143 | 128 | platform_device_put(pdev); | |
| 129 | kfree(spi_info); | ||
| 144 | return ret; | 130 | return ret; |
| 145 | } | 131 | } |
| 146 | 132 | ||
| 147 | static void __devexit ce4100_spi_remove(struct pci_dev *dev) | 133 | static void __devexit ce4100_spi_remove(struct pci_dev *dev) |
| 148 | { | 134 | { |
| 149 | struct awesome_struct *spi_info; | 135 | struct ce4100_info *spi_info; |
| 150 | struct platform_device *pdev; | ||
| 151 | struct ssp_device *ssp; | 136 | struct ssp_device *ssp; |
| 152 | 137 | ||
| 153 | spi_info = pci_get_drvdata(dev); | 138 | spi_info = pci_get_drvdata(dev); |
| 154 | |||
| 155 | ssp = &spi_info->ssp; | 139 | ssp = &spi_info->ssp; |
| 156 | pdev = &spi_info->spi_pdev; | 140 | platform_device_unregister(spi_info->spi_pdev); |
| 157 | |||
| 158 | platform_device_unregister(pdev); | ||
| 159 | 141 | ||
| 160 | iounmap(ssp->mmio_base); | 142 | iounmap(ssp->mmio_base); |
| 161 | release_mem_region(pci_resource_start(dev, 0), | 143 | release_mem_region(pci_resource_start(dev, 0), |
| @@ -171,7 +153,6 @@ static void __devexit ce4100_spi_remove(struct pci_dev *dev) | |||
| 171 | } | 153 | } |
| 172 | 154 | ||
| 173 | static struct pci_device_id ce4100_spi_devices[] __devinitdata = { | 155 | static struct pci_device_id ce4100_spi_devices[] __devinitdata = { |
| 174 | |||
| 175 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e6a) }, | 156 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e6a) }, |
| 176 | { }, | 157 | { }, |
| 177 | }; | 158 | }; |
diff --git a/drivers/target/Makefile b/drivers/target/Makefile index 5cfd70819f08..973bb190ef57 100644 --- a/drivers/target/Makefile +++ b/drivers/target/Makefile | |||
| @@ -13,8 +13,7 @@ target_core_mod-y := target_core_configfs.o \ | |||
| 13 | target_core_transport.o \ | 13 | target_core_transport.o \ |
| 14 | target_core_cdb.o \ | 14 | target_core_cdb.o \ |
| 15 | target_core_ua.o \ | 15 | target_core_ua.o \ |
| 16 | target_core_rd.o \ | 16 | target_core_rd.o |
| 17 | target_core_mib.o | ||
| 18 | 17 | ||
| 19 | obj-$(CONFIG_TARGET_CORE) += target_core_mod.o | 18 | obj-$(CONFIG_TARGET_CORE) += target_core_mod.o |
| 20 | 19 | ||
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 2764510798b0..caf8dc18ee0a 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
| @@ -37,7 +37,6 @@ | |||
| 37 | #include <linux/parser.h> | 37 | #include <linux/parser.h> |
| 38 | #include <linux/syscalls.h> | 38 | #include <linux/syscalls.h> |
| 39 | #include <linux/configfs.h> | 39 | #include <linux/configfs.h> |
| 40 | #include <linux/proc_fs.h> | ||
| 41 | 40 | ||
| 42 | #include <target/target_core_base.h> | 41 | #include <target/target_core_base.h> |
| 43 | #include <target/target_core_device.h> | 42 | #include <target/target_core_device.h> |
| @@ -1971,13 +1970,35 @@ static void target_core_dev_release(struct config_item *item) | |||
| 1971 | { | 1970 | { |
| 1972 | struct se_subsystem_dev *se_dev = container_of(to_config_group(item), | 1971 | struct se_subsystem_dev *se_dev = container_of(to_config_group(item), |
| 1973 | struct se_subsystem_dev, se_dev_group); | 1972 | struct se_subsystem_dev, se_dev_group); |
| 1974 | struct config_group *dev_cg; | 1973 | struct se_hba *hba = item_to_hba(&se_dev->se_dev_hba->hba_group.cg_item); |
| 1975 | 1974 | struct se_subsystem_api *t = hba->transport; | |
| 1976 | if (!(se_dev)) | 1975 | struct config_group *dev_cg = &se_dev->se_dev_group; |
| 1977 | return; | ||
| 1978 | 1976 | ||
| 1979 | dev_cg = &se_dev->se_dev_group; | ||
| 1980 | kfree(dev_cg->default_groups); | 1977 | kfree(dev_cg->default_groups); |
| 1978 | /* | ||
| 1979 | * This pointer will set when the storage is enabled with: | ||
| 1980 | *`echo 1 > $CONFIGFS/core/$HBA/$DEV/dev_enable` | ||
| 1981 | */ | ||
| 1982 | if (se_dev->se_dev_ptr) { | ||
| 1983 | printk(KERN_INFO "Target_Core_ConfigFS: Calling se_free_" | ||
| 1984 | "virtual_device() for se_dev_ptr: %p\n", | ||
| 1985 | se_dev->se_dev_ptr); | ||
| 1986 | |||
| 1987 | se_free_virtual_device(se_dev->se_dev_ptr, hba); | ||
| 1988 | } else { | ||
| 1989 | /* | ||
| 1990 | * Release struct se_subsystem_dev->se_dev_su_ptr.. | ||
| 1991 | */ | ||
| 1992 | printk(KERN_INFO "Target_Core_ConfigFS: Calling t->free_" | ||
| 1993 | "device() for se_dev_su_ptr: %p\n", | ||
| 1994 | se_dev->se_dev_su_ptr); | ||
| 1995 | |||
| 1996 | t->free_device(se_dev->se_dev_su_ptr); | ||
| 1997 | } | ||
| 1998 | |||
| 1999 | printk(KERN_INFO "Target_Core_ConfigFS: Deallocating se_subsystem" | ||
| 2000 | "_dev_t: %p\n", se_dev); | ||
| 2001 | kfree(se_dev); | ||
| 1981 | } | 2002 | } |
| 1982 | 2003 | ||
| 1983 | static ssize_t target_core_dev_show(struct config_item *item, | 2004 | static ssize_t target_core_dev_show(struct config_item *item, |
| @@ -2140,7 +2161,16 @@ static struct configfs_attribute *target_core_alua_lu_gp_attrs[] = { | |||
| 2140 | NULL, | 2161 | NULL, |
| 2141 | }; | 2162 | }; |
| 2142 | 2163 | ||
| 2164 | static void target_core_alua_lu_gp_release(struct config_item *item) | ||
| 2165 | { | ||
| 2166 | struct t10_alua_lu_gp *lu_gp = container_of(to_config_group(item), | ||
| 2167 | struct t10_alua_lu_gp, lu_gp_group); | ||
| 2168 | |||
| 2169 | core_alua_free_lu_gp(lu_gp); | ||
| 2170 | } | ||
| 2171 | |||
| 2143 | static struct configfs_item_operations target_core_alua_lu_gp_ops = { | 2172 | static struct configfs_item_operations target_core_alua_lu_gp_ops = { |
| 2173 | .release = target_core_alua_lu_gp_release, | ||
| 2144 | .show_attribute = target_core_alua_lu_gp_attr_show, | 2174 | .show_attribute = target_core_alua_lu_gp_attr_show, |
| 2145 | .store_attribute = target_core_alua_lu_gp_attr_store, | 2175 | .store_attribute = target_core_alua_lu_gp_attr_store, |
| 2146 | }; | 2176 | }; |
| @@ -2191,9 +2221,11 @@ static void target_core_alua_drop_lu_gp( | |||
| 2191 | printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Logical Unit" | 2221 | printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Logical Unit" |
| 2192 | " Group: core/alua/lu_gps/%s, ID: %hu\n", | 2222 | " Group: core/alua/lu_gps/%s, ID: %hu\n", |
| 2193 | config_item_name(item), lu_gp->lu_gp_id); | 2223 | config_item_name(item), lu_gp->lu_gp_id); |
| 2194 | 2224 | /* | |
| 2225 | * core_alua_free_lu_gp() is called from target_core_alua_lu_gp_ops->release() | ||
| 2226 | * -> target_core_alua_lu_gp_release() | ||
| 2227 | */ | ||
| 2195 | config_item_put(item); | 2228 | config_item_put(item); |
| 2196 | core_alua_free_lu_gp(lu_gp); | ||
| 2197 | } | 2229 | } |
| 2198 | 2230 | ||
| 2199 | static struct configfs_group_operations target_core_alua_lu_gps_group_ops = { | 2231 | static struct configfs_group_operations target_core_alua_lu_gps_group_ops = { |
| @@ -2549,7 +2581,16 @@ static struct configfs_attribute *target_core_alua_tg_pt_gp_attrs[] = { | |||
| 2549 | NULL, | 2581 | NULL, |
| 2550 | }; | 2582 | }; |
| 2551 | 2583 | ||
| 2584 | static void target_core_alua_tg_pt_gp_release(struct config_item *item) | ||
| 2585 | { | ||
| 2586 | struct t10_alua_tg_pt_gp *tg_pt_gp = container_of(to_config_group(item), | ||
| 2587 | struct t10_alua_tg_pt_gp, tg_pt_gp_group); | ||
| 2588 | |||
| 2589 | core_alua_free_tg_pt_gp(tg_pt_gp); | ||
| 2590 | } | ||
| 2591 | |||
| 2552 | static struct configfs_item_operations target_core_alua_tg_pt_gp_ops = { | 2592 | static struct configfs_item_operations target_core_alua_tg_pt_gp_ops = { |
| 2593 | .release = target_core_alua_tg_pt_gp_release, | ||
| 2553 | .show_attribute = target_core_alua_tg_pt_gp_attr_show, | 2594 | .show_attribute = target_core_alua_tg_pt_gp_attr_show, |
| 2554 | .store_attribute = target_core_alua_tg_pt_gp_attr_store, | 2595 | .store_attribute = target_core_alua_tg_pt_gp_attr_store, |
| 2555 | }; | 2596 | }; |
| @@ -2602,9 +2643,11 @@ static void target_core_alua_drop_tg_pt_gp( | |||
| 2602 | printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Target Port" | 2643 | printk(KERN_INFO "Target_Core_ConfigFS: Releasing ALUA Target Port" |
| 2603 | " Group: alua/tg_pt_gps/%s, ID: %hu\n", | 2644 | " Group: alua/tg_pt_gps/%s, ID: %hu\n", |
| 2604 | config_item_name(item), tg_pt_gp->tg_pt_gp_id); | 2645 | config_item_name(item), tg_pt_gp->tg_pt_gp_id); |
| 2605 | 2646 | /* | |
| 2647 | * core_alua_free_tg_pt_gp() is called from target_core_alua_tg_pt_gp_ops->release() | ||
| 2648 | * -> target_core_alua_tg_pt_gp_release(). | ||
| 2649 | */ | ||
| 2606 | config_item_put(item); | 2650 | config_item_put(item); |
| 2607 | core_alua_free_tg_pt_gp(tg_pt_gp); | ||
| 2608 | } | 2651 | } |
| 2609 | 2652 | ||
| 2610 | static struct configfs_group_operations target_core_alua_tg_pt_gps_group_ops = { | 2653 | static struct configfs_group_operations target_core_alua_tg_pt_gps_group_ops = { |
| @@ -2771,13 +2814,11 @@ static void target_core_drop_subdev( | |||
| 2771 | struct se_subsystem_api *t; | 2814 | struct se_subsystem_api *t; |
| 2772 | struct config_item *df_item; | 2815 | struct config_item *df_item; |
| 2773 | struct config_group *dev_cg, *tg_pt_gp_cg; | 2816 | struct config_group *dev_cg, *tg_pt_gp_cg; |
| 2774 | int i, ret; | 2817 | int i; |
| 2775 | 2818 | ||
| 2776 | hba = item_to_hba(&se_dev->se_dev_hba->hba_group.cg_item); | 2819 | hba = item_to_hba(&se_dev->se_dev_hba->hba_group.cg_item); |
| 2777 | 2820 | ||
| 2778 | if (mutex_lock_interruptible(&hba->hba_access_mutex)) | 2821 | mutex_lock(&hba->hba_access_mutex); |
| 2779 | goto out; | ||
| 2780 | |||
| 2781 | t = hba->transport; | 2822 | t = hba->transport; |
| 2782 | 2823 | ||
| 2783 | spin_lock(&se_global->g_device_lock); | 2824 | spin_lock(&se_global->g_device_lock); |
| @@ -2791,7 +2832,10 @@ static void target_core_drop_subdev( | |||
| 2791 | config_item_put(df_item); | 2832 | config_item_put(df_item); |
| 2792 | } | 2833 | } |
| 2793 | kfree(tg_pt_gp_cg->default_groups); | 2834 | kfree(tg_pt_gp_cg->default_groups); |
| 2794 | core_alua_free_tg_pt_gp(T10_ALUA(se_dev)->default_tg_pt_gp); | 2835 | /* |
| 2836 | * core_alua_free_tg_pt_gp() is called from ->default_tg_pt_gp | ||
| 2837 | * directly from target_core_alua_tg_pt_gp_release(). | ||
| 2838 | */ | ||
| 2795 | T10_ALUA(se_dev)->default_tg_pt_gp = NULL; | 2839 | T10_ALUA(se_dev)->default_tg_pt_gp = NULL; |
| 2796 | 2840 | ||
| 2797 | dev_cg = &se_dev->se_dev_group; | 2841 | dev_cg = &se_dev->se_dev_group; |
| @@ -2800,38 +2844,12 @@ static void target_core_drop_subdev( | |||
| 2800 | dev_cg->default_groups[i] = NULL; | 2844 | dev_cg->default_groups[i] = NULL; |
| 2801 | config_item_put(df_item); | 2845 | config_item_put(df_item); |
| 2802 | } | 2846 | } |
| 2803 | |||
| 2804 | config_item_put(item); | ||
| 2805 | /* | 2847 | /* |
| 2806 | * This pointer will set when the storage is enabled with: | 2848 | * The releasing of se_dev and associated se_dev->se_dev_ptr is done |
| 2807 | * `echo 1 > $CONFIGFS/core/$HBA/$DEV/dev_enable` | 2849 | * from target_core_dev_item_ops->release() ->target_core_dev_release(). |
| 2808 | */ | 2850 | */ |
| 2809 | if (se_dev->se_dev_ptr) { | 2851 | config_item_put(item); |
| 2810 | printk(KERN_INFO "Target_Core_ConfigFS: Calling se_free_" | ||
| 2811 | "virtual_device() for se_dev_ptr: %p\n", | ||
| 2812 | se_dev->se_dev_ptr); | ||
| 2813 | |||
| 2814 | ret = se_free_virtual_device(se_dev->se_dev_ptr, hba); | ||
| 2815 | if (ret < 0) | ||
| 2816 | goto hba_out; | ||
| 2817 | } else { | ||
| 2818 | /* | ||
| 2819 | * Release struct se_subsystem_dev->se_dev_su_ptr.. | ||
| 2820 | */ | ||
| 2821 | printk(KERN_INFO "Target_Core_ConfigFS: Calling t->free_" | ||
| 2822 | "device() for se_dev_su_ptr: %p\n", | ||
| 2823 | se_dev->se_dev_su_ptr); | ||
| 2824 | |||
| 2825 | t->free_device(se_dev->se_dev_su_ptr); | ||
| 2826 | } | ||
| 2827 | |||
| 2828 | printk(KERN_INFO "Target_Core_ConfigFS: Deallocating se_subsystem" | ||
| 2829 | "_dev_t: %p\n", se_dev); | ||
| 2830 | |||
| 2831 | hba_out: | ||
| 2832 | mutex_unlock(&hba->hba_access_mutex); | 2852 | mutex_unlock(&hba->hba_access_mutex); |
| 2833 | out: | ||
| 2834 | kfree(se_dev); | ||
| 2835 | } | 2853 | } |
| 2836 | 2854 | ||
| 2837 | static struct configfs_group_operations target_core_hba_group_ops = { | 2855 | static struct configfs_group_operations target_core_hba_group_ops = { |
| @@ -2914,6 +2932,13 @@ SE_HBA_ATTR(hba_mode, S_IRUGO | S_IWUSR); | |||
| 2914 | 2932 | ||
| 2915 | CONFIGFS_EATTR_OPS(target_core_hba, se_hba, hba_group); | 2933 | CONFIGFS_EATTR_OPS(target_core_hba, se_hba, hba_group); |
| 2916 | 2934 | ||
| 2935 | static void target_core_hba_release(struct config_item *item) | ||
| 2936 | { | ||
| 2937 | struct se_hba *hba = container_of(to_config_group(item), | ||
| 2938 | struct se_hba, hba_group); | ||
| 2939 | core_delete_hba(hba); | ||
| 2940 | } | ||
| 2941 | |||
| 2917 | static struct configfs_attribute *target_core_hba_attrs[] = { | 2942 | static struct configfs_attribute *target_core_hba_attrs[] = { |
| 2918 | &target_core_hba_hba_info.attr, | 2943 | &target_core_hba_hba_info.attr, |
| 2919 | &target_core_hba_hba_mode.attr, | 2944 | &target_core_hba_hba_mode.attr, |
| @@ -2921,6 +2946,7 @@ static struct configfs_attribute *target_core_hba_attrs[] = { | |||
| 2921 | }; | 2946 | }; |
| 2922 | 2947 | ||
| 2923 | static struct configfs_item_operations target_core_hba_item_ops = { | 2948 | static struct configfs_item_operations target_core_hba_item_ops = { |
| 2949 | .release = target_core_hba_release, | ||
| 2924 | .show_attribute = target_core_hba_attr_show, | 2950 | .show_attribute = target_core_hba_attr_show, |
| 2925 | .store_attribute = target_core_hba_attr_store, | 2951 | .store_attribute = target_core_hba_attr_store, |
| 2926 | }; | 2952 | }; |
| @@ -2997,10 +3023,11 @@ static void target_core_call_delhbafromtarget( | |||
| 2997 | struct config_group *group, | 3023 | struct config_group *group, |
| 2998 | struct config_item *item) | 3024 | struct config_item *item) |
| 2999 | { | 3025 | { |
| 3000 | struct se_hba *hba = item_to_hba(item); | 3026 | /* |
| 3001 | 3027 | * core_delete_hba() is called from target_core_hba_item_ops->release() | |
| 3028 | * -> target_core_hba_release() | ||
| 3029 | */ | ||
| 3002 | config_item_put(item); | 3030 | config_item_put(item); |
| 3003 | core_delete_hba(hba); | ||
| 3004 | } | 3031 | } |
| 3005 | 3032 | ||
| 3006 | static struct configfs_group_operations target_core_group_ops = { | 3033 | static struct configfs_group_operations target_core_group_ops = { |
| @@ -3022,7 +3049,6 @@ static int target_core_init_configfs(void) | |||
| 3022 | struct config_group *target_cg, *hba_cg = NULL, *alua_cg = NULL; | 3049 | struct config_group *target_cg, *hba_cg = NULL, *alua_cg = NULL; |
| 3023 | struct config_group *lu_gp_cg = NULL; | 3050 | struct config_group *lu_gp_cg = NULL; |
| 3024 | struct configfs_subsystem *subsys; | 3051 | struct configfs_subsystem *subsys; |
| 3025 | struct proc_dir_entry *scsi_target_proc = NULL; | ||
| 3026 | struct t10_alua_lu_gp *lu_gp; | 3052 | struct t10_alua_lu_gp *lu_gp; |
| 3027 | int ret; | 3053 | int ret; |
| 3028 | 3054 | ||
| @@ -3128,21 +3154,10 @@ static int target_core_init_configfs(void) | |||
| 3128 | if (core_dev_setup_virtual_lun0() < 0) | 3154 | if (core_dev_setup_virtual_lun0() < 0) |
| 3129 | goto out; | 3155 | goto out; |
| 3130 | 3156 | ||
| 3131 | scsi_target_proc = proc_mkdir("scsi_target", 0); | ||
| 3132 | if (!(scsi_target_proc)) { | ||
| 3133 | printk(KERN_ERR "proc_mkdir(scsi_target, 0) failed\n"); | ||
| 3134 | goto out; | ||
| 3135 | } | ||
| 3136 | ret = init_scsi_target_mib(); | ||
| 3137 | if (ret < 0) | ||
| 3138 | goto out; | ||
| 3139 | |||
| 3140 | return 0; | 3157 | return 0; |
| 3141 | 3158 | ||
| 3142 | out: | 3159 | out: |
| 3143 | configfs_unregister_subsystem(subsys); | 3160 | configfs_unregister_subsystem(subsys); |
| 3144 | if (scsi_target_proc) | ||
| 3145 | remove_proc_entry("scsi_target", 0); | ||
| 3146 | core_dev_release_virtual_lun0(); | 3161 | core_dev_release_virtual_lun0(); |
| 3147 | rd_module_exit(); | 3162 | rd_module_exit(); |
| 3148 | out_global: | 3163 | out_global: |
| @@ -3178,8 +3193,7 @@ static void target_core_exit_configfs(void) | |||
| 3178 | config_item_put(item); | 3193 | config_item_put(item); |
| 3179 | } | 3194 | } |
| 3180 | kfree(lu_gp_cg->default_groups); | 3195 | kfree(lu_gp_cg->default_groups); |
| 3181 | core_alua_free_lu_gp(se_global->default_lu_gp); | 3196 | lu_gp_cg->default_groups = NULL; |
| 3182 | se_global->default_lu_gp = NULL; | ||
| 3183 | 3197 | ||
| 3184 | alua_cg = &se_global->alua_group; | 3198 | alua_cg = &se_global->alua_group; |
| 3185 | for (i = 0; alua_cg->default_groups[i]; i++) { | 3199 | for (i = 0; alua_cg->default_groups[i]; i++) { |
| @@ -3188,6 +3202,7 @@ static void target_core_exit_configfs(void) | |||
| 3188 | config_item_put(item); | 3202 | config_item_put(item); |
| 3189 | } | 3203 | } |
| 3190 | kfree(alua_cg->default_groups); | 3204 | kfree(alua_cg->default_groups); |
| 3205 | alua_cg->default_groups = NULL; | ||
| 3191 | 3206 | ||
| 3192 | hba_cg = &se_global->target_core_hbagroup; | 3207 | hba_cg = &se_global->target_core_hbagroup; |
| 3193 | for (i = 0; hba_cg->default_groups[i]; i++) { | 3208 | for (i = 0; hba_cg->default_groups[i]; i++) { |
| @@ -3196,20 +3211,20 @@ static void target_core_exit_configfs(void) | |||
| 3196 | config_item_put(item); | 3211 | config_item_put(item); |
| 3197 | } | 3212 | } |
| 3198 | kfree(hba_cg->default_groups); | 3213 | kfree(hba_cg->default_groups); |
| 3199 | 3214 | hba_cg->default_groups = NULL; | |
| 3200 | for (i = 0; subsys->su_group.default_groups[i]; i++) { | 3215 | /* |
| 3201 | item = &subsys->su_group.default_groups[i]->cg_item; | 3216 | * We expect subsys->su_group.default_groups to be released |
| 3202 | subsys->su_group.default_groups[i] = NULL; | 3217 | * by configfs subsystem provider logic.. |
| 3203 | config_item_put(item); | 3218 | */ |
| 3204 | } | 3219 | configfs_unregister_subsystem(subsys); |
| 3205 | kfree(subsys->su_group.default_groups); | 3220 | kfree(subsys->su_group.default_groups); |
| 3206 | 3221 | ||
| 3207 | configfs_unregister_subsystem(subsys); | 3222 | core_alua_free_lu_gp(se_global->default_lu_gp); |
| 3223 | se_global->default_lu_gp = NULL; | ||
| 3224 | |||
| 3208 | printk(KERN_INFO "TARGET_CORE[0]: Released ConfigFS Fabric" | 3225 | printk(KERN_INFO "TARGET_CORE[0]: Released ConfigFS Fabric" |
| 3209 | " Infrastructure\n"); | 3226 | " Infrastructure\n"); |
| 3210 | 3227 | ||
| 3211 | remove_scsi_target_mib(); | ||
| 3212 | remove_proc_entry("scsi_target", 0); | ||
| 3213 | core_dev_release_virtual_lun0(); | 3228 | core_dev_release_virtual_lun0(); |
| 3214 | rd_module_exit(); | 3229 | rd_module_exit(); |
| 3215 | release_se_global(); | 3230 | release_se_global(); |
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 317ce58d426d..5da051a07fa3 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
| @@ -373,11 +373,11 @@ int core_update_device_list_for_node( | |||
| 373 | /* | 373 | /* |
| 374 | * deve->se_lun_acl will be NULL for demo-mode created LUNs | 374 | * deve->se_lun_acl will be NULL for demo-mode created LUNs |
| 375 | * that have not been explictly concerted to MappedLUNs -> | 375 | * that have not been explictly concerted to MappedLUNs -> |
| 376 | * struct se_lun_acl. | 376 | * struct se_lun_acl, but we remove deve->alua_port_list from |
| 377 | * port->sep_alua_list. This also means that active UAs and | ||
| 378 | * NodeACL context specific PR metadata for demo-mode | ||
| 379 | * MappedLUN *deve will be released below.. | ||
| 377 | */ | 380 | */ |
| 378 | if (!(deve->se_lun_acl)) | ||
| 379 | return 0; | ||
| 380 | |||
| 381 | spin_lock_bh(&port->sep_alua_lock); | 381 | spin_lock_bh(&port->sep_alua_lock); |
| 382 | list_del(&deve->alua_port_list); | 382 | list_del(&deve->alua_port_list); |
| 383 | spin_unlock_bh(&port->sep_alua_lock); | 383 | spin_unlock_bh(&port->sep_alua_lock); |
| @@ -395,12 +395,14 @@ int core_update_device_list_for_node( | |||
| 395 | printk(KERN_ERR "struct se_dev_entry->se_lun_acl" | 395 | printk(KERN_ERR "struct se_dev_entry->se_lun_acl" |
| 396 | " already set for demo mode -> explict" | 396 | " already set for demo mode -> explict" |
| 397 | " LUN ACL transition\n"); | 397 | " LUN ACL transition\n"); |
| 398 | spin_unlock_irq(&nacl->device_list_lock); | ||
| 398 | return -1; | 399 | return -1; |
| 399 | } | 400 | } |
| 400 | if (deve->se_lun != lun) { | 401 | if (deve->se_lun != lun) { |
| 401 | printk(KERN_ERR "struct se_dev_entry->se_lun does" | 402 | printk(KERN_ERR "struct se_dev_entry->se_lun does" |
| 402 | " match passed struct se_lun for demo mode" | 403 | " match passed struct se_lun for demo mode" |
| 403 | " -> explict LUN ACL transition\n"); | 404 | " -> explict LUN ACL transition\n"); |
| 405 | spin_unlock_irq(&nacl->device_list_lock); | ||
| 404 | return -1; | 406 | return -1; |
| 405 | } | 407 | } |
| 406 | deve->se_lun_acl = lun_acl; | 408 | deve->se_lun_acl = lun_acl; |
| @@ -865,9 +867,6 @@ static void se_dev_stop(struct se_device *dev) | |||
| 865 | } | 867 | } |
| 866 | } | 868 | } |
| 867 | spin_unlock(&hba->device_lock); | 869 | spin_unlock(&hba->device_lock); |
| 868 | |||
| 869 | while (atomic_read(&hba->dev_mib_access_count)) | ||
| 870 | cpu_relax(); | ||
| 871 | } | 870 | } |
| 872 | 871 | ||
| 873 | int se_dev_check_online(struct se_device *dev) | 872 | int se_dev_check_online(struct se_device *dev) |
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index 32b148d7e261..b65d1c8e7740 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c | |||
| @@ -214,12 +214,22 @@ TCM_MAPPEDLUN_ATTR(write_protect, S_IRUGO | S_IWUSR); | |||
| 214 | 214 | ||
| 215 | CONFIGFS_EATTR_OPS(target_fabric_mappedlun, se_lun_acl, se_lun_group); | 215 | CONFIGFS_EATTR_OPS(target_fabric_mappedlun, se_lun_acl, se_lun_group); |
| 216 | 216 | ||
| 217 | static void target_fabric_mappedlun_release(struct config_item *item) | ||
| 218 | { | ||
| 219 | struct se_lun_acl *lacl = container_of(to_config_group(item), | ||
| 220 | struct se_lun_acl, se_lun_group); | ||
| 221 | struct se_portal_group *se_tpg = lacl->se_lun_nacl->se_tpg; | ||
| 222 | |||
| 223 | core_dev_free_initiator_node_lun_acl(se_tpg, lacl); | ||
| 224 | } | ||
| 225 | |||
| 217 | static struct configfs_attribute *target_fabric_mappedlun_attrs[] = { | 226 | static struct configfs_attribute *target_fabric_mappedlun_attrs[] = { |
| 218 | &target_fabric_mappedlun_write_protect.attr, | 227 | &target_fabric_mappedlun_write_protect.attr, |
| 219 | NULL, | 228 | NULL, |
| 220 | }; | 229 | }; |
| 221 | 230 | ||
| 222 | static struct configfs_item_operations target_fabric_mappedlun_item_ops = { | 231 | static struct configfs_item_operations target_fabric_mappedlun_item_ops = { |
| 232 | .release = target_fabric_mappedlun_release, | ||
| 223 | .show_attribute = target_fabric_mappedlun_attr_show, | 233 | .show_attribute = target_fabric_mappedlun_attr_show, |
| 224 | .store_attribute = target_fabric_mappedlun_attr_store, | 234 | .store_attribute = target_fabric_mappedlun_attr_store, |
| 225 | .allow_link = target_fabric_mappedlun_link, | 235 | .allow_link = target_fabric_mappedlun_link, |
| @@ -337,15 +347,21 @@ static void target_fabric_drop_mappedlun( | |||
| 337 | struct config_group *group, | 347 | struct config_group *group, |
| 338 | struct config_item *item) | 348 | struct config_item *item) |
| 339 | { | 349 | { |
| 340 | struct se_lun_acl *lacl = container_of(to_config_group(item), | ||
| 341 | struct se_lun_acl, se_lun_group); | ||
| 342 | struct se_portal_group *se_tpg = lacl->se_lun_nacl->se_tpg; | ||
| 343 | |||
| 344 | config_item_put(item); | 350 | config_item_put(item); |
| 345 | core_dev_free_initiator_node_lun_acl(se_tpg, lacl); | 351 | } |
| 352 | |||
| 353 | static void target_fabric_nacl_base_release(struct config_item *item) | ||
| 354 | { | ||
| 355 | struct se_node_acl *se_nacl = container_of(to_config_group(item), | ||
| 356 | struct se_node_acl, acl_group); | ||
| 357 | struct se_portal_group *se_tpg = se_nacl->se_tpg; | ||
| 358 | struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf; | ||
| 359 | |||
| 360 | tf->tf_ops.fabric_drop_nodeacl(se_nacl); | ||
| 346 | } | 361 | } |
| 347 | 362 | ||
| 348 | static struct configfs_item_operations target_fabric_nacl_base_item_ops = { | 363 | static struct configfs_item_operations target_fabric_nacl_base_item_ops = { |
| 364 | .release = target_fabric_nacl_base_release, | ||
| 349 | .show_attribute = target_fabric_nacl_base_attr_show, | 365 | .show_attribute = target_fabric_nacl_base_attr_show, |
| 350 | .store_attribute = target_fabric_nacl_base_attr_store, | 366 | .store_attribute = target_fabric_nacl_base_attr_store, |
| 351 | }; | 367 | }; |
| @@ -404,9 +420,6 @@ static void target_fabric_drop_nodeacl( | |||
| 404 | struct config_group *group, | 420 | struct config_group *group, |
| 405 | struct config_item *item) | 421 | struct config_item *item) |
| 406 | { | 422 | { |
| 407 | struct se_portal_group *se_tpg = container_of(group, | ||
| 408 | struct se_portal_group, tpg_acl_group); | ||
| 409 | struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf; | ||
| 410 | struct se_node_acl *se_nacl = container_of(to_config_group(item), | 423 | struct se_node_acl *se_nacl = container_of(to_config_group(item), |
| 411 | struct se_node_acl, acl_group); | 424 | struct se_node_acl, acl_group); |
| 412 | struct config_item *df_item; | 425 | struct config_item *df_item; |
| @@ -419,9 +432,10 @@ static void target_fabric_drop_nodeacl( | |||
| 419 | nacl_cg->default_groups[i] = NULL; | 432 | nacl_cg->default_groups[i] = NULL; |
| 420 | config_item_put(df_item); | 433 | config_item_put(df_item); |
| 421 | } | 434 | } |
| 422 | 435 | /* | |
| 436 | * struct se_node_acl free is done in target_fabric_nacl_base_release() | ||
| 437 | */ | ||
| 423 | config_item_put(item); | 438 | config_item_put(item); |
| 424 | tf->tf_ops.fabric_drop_nodeacl(se_nacl); | ||
| 425 | } | 439 | } |
| 426 | 440 | ||
| 427 | static struct configfs_group_operations target_fabric_nacl_group_ops = { | 441 | static struct configfs_group_operations target_fabric_nacl_group_ops = { |
| @@ -437,7 +451,18 @@ TF_CIT_SETUP(tpg_nacl, NULL, &target_fabric_nacl_group_ops, NULL); | |||
| 437 | 451 | ||
| 438 | CONFIGFS_EATTR_OPS(target_fabric_np_base, se_tpg_np, tpg_np_group); | 452 | CONFIGFS_EATTR_OPS(target_fabric_np_base, se_tpg_np, tpg_np_group); |
| 439 | 453 | ||
| 454 | static void target_fabric_np_base_release(struct config_item *item) | ||
| 455 | { | ||
| 456 | struct se_tpg_np *se_tpg_np = container_of(to_config_group(item), | ||
| 457 | struct se_tpg_np, tpg_np_group); | ||
| 458 | struct se_portal_group *se_tpg = se_tpg_np->tpg_np_parent; | ||
| 459 | struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf; | ||
| 460 | |||
| 461 | tf->tf_ops.fabric_drop_np(se_tpg_np); | ||
| 462 | } | ||
| 463 | |||
| 440 | static struct configfs_item_operations target_fabric_np_base_item_ops = { | 464 | static struct configfs_item_operations target_fabric_np_base_item_ops = { |
| 465 | .release = target_fabric_np_base_release, | ||
| 441 | .show_attribute = target_fabric_np_base_attr_show, | 466 | .show_attribute = target_fabric_np_base_attr_show, |
| 442 | .store_attribute = target_fabric_np_base_attr_store, | 467 | .store_attribute = target_fabric_np_base_attr_store, |
| 443 | }; | 468 | }; |
| @@ -466,6 +491,7 @@ static struct config_group *target_fabric_make_np( | |||
| 466 | if (!(se_tpg_np) || IS_ERR(se_tpg_np)) | 491 | if (!(se_tpg_np) || IS_ERR(se_tpg_np)) |
| 467 | return ERR_PTR(-EINVAL); | 492 | return ERR_PTR(-EINVAL); |
| 468 | 493 | ||
| 494 | se_tpg_np->tpg_np_parent = se_tpg; | ||
| 469 | config_group_init_type_name(&se_tpg_np->tpg_np_group, name, | 495 | config_group_init_type_name(&se_tpg_np->tpg_np_group, name, |
| 470 | &TF_CIT_TMPL(tf)->tfc_tpg_np_base_cit); | 496 | &TF_CIT_TMPL(tf)->tfc_tpg_np_base_cit); |
| 471 | 497 | ||
| @@ -476,14 +502,10 @@ static void target_fabric_drop_np( | |||
| 476 | struct config_group *group, | 502 | struct config_group *group, |
| 477 | struct config_item *item) | 503 | struct config_item *item) |
| 478 | { | 504 | { |
| 479 | struct se_portal_group *se_tpg = container_of(group, | 505 | /* |
| 480 | struct se_portal_group, tpg_np_group); | 506 | * struct se_tpg_np is released via target_fabric_np_base_release() |
| 481 | struct target_fabric_configfs *tf = se_tpg->se_tpg_wwn->wwn_tf; | 507 | */ |
| 482 | struct se_tpg_np *se_tpg_np = container_of(to_config_group(item), | ||
| 483 | struct se_tpg_np, tpg_np_group); | ||
| 484 | |||
| 485 | config_item_put(item); | 508 | config_item_put(item); |
| 486 | tf->tf_ops.fabric_drop_np(se_tpg_np); | ||
| 487 | } | 509 | } |
| 488 | 510 | ||
| 489 | static struct configfs_group_operations target_fabric_np_group_ops = { | 511 | static struct configfs_group_operations target_fabric_np_group_ops = { |
| @@ -814,7 +836,18 @@ TF_CIT_SETUP(tpg_param, &target_fabric_tpg_param_item_ops, NULL, NULL); | |||
| 814 | */ | 836 | */ |
| 815 | CONFIGFS_EATTR_OPS(target_fabric_tpg, se_portal_group, tpg_group); | 837 | CONFIGFS_EATTR_OPS(target_fabric_tpg, se_portal_group, tpg_group); |
| 816 | 838 | ||
| 839 | static void target_fabric_tpg_release(struct config_item *item) | ||
| 840 | { | ||
| 841 | struct se_portal_group *se_tpg = container_of(to_config_group(item), | ||
| 842 | struct se_portal_group, tpg_group); | ||
| 843 | struct se_wwn *wwn = se_tpg->se_tpg_wwn; | ||
| 844 | struct target_fabric_configfs *tf = wwn->wwn_tf; | ||
| 845 | |||
| 846 | tf->tf_ops.fabric_drop_tpg(se_tpg); | ||
| 847 | } | ||
| 848 | |||
| 817 | static struct configfs_item_operations target_fabric_tpg_base_item_ops = { | 849 | static struct configfs_item_operations target_fabric_tpg_base_item_ops = { |
| 850 | .release = target_fabric_tpg_release, | ||
| 818 | .show_attribute = target_fabric_tpg_attr_show, | 851 | .show_attribute = target_fabric_tpg_attr_show, |
| 819 | .store_attribute = target_fabric_tpg_attr_store, | 852 | .store_attribute = target_fabric_tpg_attr_store, |
| 820 | }; | 853 | }; |
| @@ -872,8 +905,6 @@ static void target_fabric_drop_tpg( | |||
| 872 | struct config_group *group, | 905 | struct config_group *group, |
| 873 | struct config_item *item) | 906 | struct config_item *item) |
| 874 | { | 907 | { |
| 875 | struct se_wwn *wwn = container_of(group, struct se_wwn, wwn_group); | ||
| 876 | struct target_fabric_configfs *tf = wwn->wwn_tf; | ||
| 877 | struct se_portal_group *se_tpg = container_of(to_config_group(item), | 908 | struct se_portal_group *se_tpg = container_of(to_config_group(item), |
| 878 | struct se_portal_group, tpg_group); | 909 | struct se_portal_group, tpg_group); |
| 879 | struct config_group *tpg_cg = &se_tpg->tpg_group; | 910 | struct config_group *tpg_cg = &se_tpg->tpg_group; |
| @@ -890,15 +921,28 @@ static void target_fabric_drop_tpg( | |||
| 890 | } | 921 | } |
| 891 | 922 | ||
| 892 | config_item_put(item); | 923 | config_item_put(item); |
| 893 | tf->tf_ops.fabric_drop_tpg(se_tpg); | ||
| 894 | } | 924 | } |
| 895 | 925 | ||
| 926 | static void target_fabric_release_wwn(struct config_item *item) | ||
| 927 | { | ||
| 928 | struct se_wwn *wwn = container_of(to_config_group(item), | ||
| 929 | struct se_wwn, wwn_group); | ||
| 930 | struct target_fabric_configfs *tf = wwn->wwn_tf; | ||
| 931 | |||
| 932 | tf->tf_ops.fabric_drop_wwn(wwn); | ||
| 933 | } | ||
| 934 | |||
| 935 | static struct configfs_item_operations target_fabric_tpg_item_ops = { | ||
| 936 | .release = target_fabric_release_wwn, | ||
| 937 | }; | ||
| 938 | |||
| 896 | static struct configfs_group_operations target_fabric_tpg_group_ops = { | 939 | static struct configfs_group_operations target_fabric_tpg_group_ops = { |
| 897 | .make_group = target_fabric_make_tpg, | 940 | .make_group = target_fabric_make_tpg, |
| 898 | .drop_item = target_fabric_drop_tpg, | 941 | .drop_item = target_fabric_drop_tpg, |
| 899 | }; | 942 | }; |
| 900 | 943 | ||
| 901 | TF_CIT_SETUP(tpg, NULL, &target_fabric_tpg_group_ops, NULL); | 944 | TF_CIT_SETUP(tpg, &target_fabric_tpg_item_ops, &target_fabric_tpg_group_ops, |
| 945 | NULL); | ||
| 902 | 946 | ||
| 903 | /* End of tfc_tpg_cit */ | 947 | /* End of tfc_tpg_cit */ |
| 904 | 948 | ||
| @@ -932,13 +976,7 @@ static void target_fabric_drop_wwn( | |||
| 932 | struct config_group *group, | 976 | struct config_group *group, |
| 933 | struct config_item *item) | 977 | struct config_item *item) |
| 934 | { | 978 | { |
| 935 | struct target_fabric_configfs *tf = container_of(group, | ||
| 936 | struct target_fabric_configfs, tf_group); | ||
| 937 | struct se_wwn *wwn = container_of(to_config_group(item), | ||
| 938 | struct se_wwn, wwn_group); | ||
| 939 | |||
| 940 | config_item_put(item); | 979 | config_item_put(item); |
| 941 | tf->tf_ops.fabric_drop_wwn(wwn); | ||
| 942 | } | 980 | } |
| 943 | 981 | ||
| 944 | static struct configfs_group_operations target_fabric_wwn_group_ops = { | 982 | static struct configfs_group_operations target_fabric_wwn_group_ops = { |
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index c6e0d757e76e..67f0c09983c8 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c | |||
| @@ -154,7 +154,7 @@ static struct se_device *iblock_create_virtdevice( | |||
| 154 | 154 | ||
| 155 | bd = blkdev_get_by_path(ib_dev->ibd_udev_path, | 155 | bd = blkdev_get_by_path(ib_dev->ibd_udev_path, |
| 156 | FMODE_WRITE|FMODE_READ|FMODE_EXCL, ib_dev); | 156 | FMODE_WRITE|FMODE_READ|FMODE_EXCL, ib_dev); |
| 157 | if (!(bd)) | 157 | if (IS_ERR(bd)) |
| 158 | goto failed; | 158 | goto failed; |
| 159 | /* | 159 | /* |
| 160 | * Setup the local scope queue_limits from struct request_queue->limits | 160 | * Setup the local scope queue_limits from struct request_queue->limits |
| @@ -220,8 +220,10 @@ static void iblock_free_device(void *p) | |||
| 220 | { | 220 | { |
| 221 | struct iblock_dev *ib_dev = p; | 221 | struct iblock_dev *ib_dev = p; |
| 222 | 222 | ||
| 223 | blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL); | 223 | if (ib_dev->ibd_bd != NULL) |
| 224 | bioset_free(ib_dev->ibd_bio_set); | 224 | blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL); |
| 225 | if (ib_dev->ibd_bio_set != NULL) | ||
| 226 | bioset_free(ib_dev->ibd_bio_set); | ||
| 225 | kfree(ib_dev); | 227 | kfree(ib_dev); |
| 226 | } | 228 | } |
| 227 | 229 | ||
diff --git a/drivers/target/target_core_mib.c b/drivers/target/target_core_mib.c deleted file mode 100644 index d5a48aa0d2d1..000000000000 --- a/drivers/target/target_core_mib.c +++ /dev/null | |||
| @@ -1,1078 +0,0 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Filename: target_core_mib.c | ||
| 3 | * | ||
| 4 | * Copyright (c) 2006-2007 SBE, Inc. All Rights Reserved. | ||
| 5 | * Copyright (c) 2007-2010 Rising Tide Systems | ||
| 6 | * Copyright (c) 2008-2010 Linux-iSCSI.org | ||
| 7 | * | ||
| 8 | * Nicholas A. Bellinger <nab@linux-iscsi.org> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, | ||
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | * GNU General Public License for more details. | ||
| 19 | * | ||
| 20 | * You should have received a copy of the GNU General Public License | ||
| 21 | * along with this program; if not, write to the Free Software | ||
| 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 23 | * | ||
| 24 | ******************************************************************************/ | ||
| 25 | |||
| 26 | |||
| 27 | #include <linux/kernel.h> | ||
| 28 | #include <linux/module.h> | ||
| 29 | #include <linux/delay.h> | ||
| 30 | #include <linux/timer.h> | ||
| 31 | #include <linux/string.h> | ||
| 32 | #include <linux/version.h> | ||
| 33 | #include <generated/utsrelease.h> | ||
| 34 | #include <linux/utsname.h> | ||
| 35 | #include <linux/proc_fs.h> | ||
| 36 | #include <linux/seq_file.h> | ||
| 37 | #include <linux/blkdev.h> | ||
| 38 | #include <scsi/scsi.h> | ||
| 39 | #include <scsi/scsi_device.h> | ||
| 40 | #include <scsi/scsi_host.h> | ||
| 41 | |||
| 42 | #include <target/target_core_base.h> | ||
| 43 | #include <target/target_core_transport.h> | ||
| 44 | #include <target/target_core_fabric_ops.h> | ||
| 45 | #include <target/target_core_configfs.h> | ||
| 46 | |||
| 47 | #include "target_core_hba.h" | ||
| 48 | #include "target_core_mib.h" | ||
| 49 | |||
| 50 | /* SCSI mib table index */ | ||
| 51 | static struct scsi_index_table scsi_index_table; | ||
| 52 | |||
| 53 | #ifndef INITIAL_JIFFIES | ||
| 54 | #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ)) | ||
| 55 | #endif | ||
| 56 | |||
| 57 | /* SCSI Instance Table */ | ||
| 58 | #define SCSI_INST_SW_INDEX 1 | ||
| 59 | #define SCSI_TRANSPORT_INDEX 1 | ||
| 60 | |||
| 61 | #define NONE "None" | ||
| 62 | #define ISPRINT(a) ((a >= ' ') && (a <= '~')) | ||
| 63 | |||
| 64 | static inline int list_is_first(const struct list_head *list, | ||
| 65 | const struct list_head *head) | ||
| 66 | { | ||
| 67 | return list->prev == head; | ||
| 68 | } | ||
| 69 | |||
| 70 | static void *locate_hba_start( | ||
| 71 | struct seq_file *seq, | ||
| 72 | loff_t *pos) | ||
| 73 | { | ||
| 74 | spin_lock(&se_global->g_device_lock); | ||
| 75 | return seq_list_start(&se_global->g_se_dev_list, *pos); | ||
| 76 | } | ||
| 77 | |||
| 78 | static void *locate_hba_next( | ||
| 79 | struct seq_file *seq, | ||
| 80 | void *v, | ||
| 81 | loff_t *pos) | ||
| 82 | { | ||
| 83 | return seq_list_next(v, &se_global->g_se_dev_list, pos); | ||
| 84 | } | ||
| 85 | |||
| 86 | static void locate_hba_stop(struct seq_file *seq, void *v) | ||
| 87 | { | ||
| 88 | spin_unlock(&se_global->g_device_lock); | ||
| 89 | } | ||
| 90 | |||
| 91 | /**************************************************************************** | ||
| 92 | * SCSI MIB Tables | ||
| 93 | ****************************************************************************/ | ||
| 94 | |||
| 95 | /* | ||
| 96 | * SCSI Instance Table | ||
| 97 | */ | ||
| 98 | static void *scsi_inst_seq_start( | ||
| 99 | struct seq_file *seq, | ||
| 100 | loff_t *pos) | ||
| 101 | { | ||
| 102 | spin_lock(&se_global->hba_lock); | ||
| 103 | return seq_list_start(&se_global->g_hba_list, *pos); | ||
| 104 | } | ||
| 105 | |||
| 106 | static void *scsi_inst_seq_next( | ||
| 107 | struct seq_file *seq, | ||
| 108 | void *v, | ||
| 109 | loff_t *pos) | ||
| 110 | { | ||
| 111 | return seq_list_next(v, &se_global->g_hba_list, pos); | ||
| 112 | } | ||
| 113 | |||
| 114 | static void scsi_inst_seq_stop(struct seq_file *seq, void *v) | ||
| 115 | { | ||
| 116 | spin_unlock(&se_global->hba_lock); | ||
| 117 | } | ||
| 118 | |||
| 119 | static int scsi_inst_seq_show(struct seq_file *seq, void *v) | ||
| 120 | { | ||
| 121 | struct se_hba *hba = list_entry(v, struct se_hba, hba_list); | ||
| 122 | |||
| 123 | if (list_is_first(&hba->hba_list, &se_global->g_hba_list)) | ||
| 124 | seq_puts(seq, "inst sw_indx\n"); | ||
| 125 | |||
| 126 | seq_printf(seq, "%u %u\n", hba->hba_index, SCSI_INST_SW_INDEX); | ||
| 127 | seq_printf(seq, "plugin: %s version: %s\n", | ||
| 128 | hba->transport->name, TARGET_CORE_VERSION); | ||
| 129 | |||
| 130 | return 0; | ||
| 131 | } | ||
| 132 | |||
| 133 | static const struct seq_operations scsi_inst_seq_ops = { | ||
| 134 | .start = scsi_inst_seq_start, | ||
| 135 | .next = scsi_inst_seq_next, | ||
| 136 | .stop = scsi_inst_seq_stop, | ||
| 137 | .show = scsi_inst_seq_show | ||
| 138 | }; | ||
| 139 | |||
| 140 | static int scsi_inst_seq_open(struct inode *inode, struct file *file) | ||
| 141 | { | ||
| 142 | return seq_open(file, &scsi_inst_seq_ops); | ||
| 143 | } | ||
| 144 | |||
| 145 | static const struct file_operations scsi_inst_seq_fops = { | ||
| 146 | .owner = THIS_MODULE, | ||
| 147 | .open = scsi_inst_seq_open, | ||
| 148 | .read = seq_read, | ||
| 149 | .llseek = seq_lseek, | ||
| 150 | .release = seq_release, | ||
| 151 | }; | ||
| 152 | |||
| 153 | /* | ||
| 154 | * SCSI Device Table | ||
| 155 | */ | ||
| 156 | static void *scsi_dev_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 157 | { | ||
| 158 | return locate_hba_start(seq, pos); | ||
| 159 | } | ||
| 160 | |||
| 161 | static void *scsi_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) | ||
| 162 | { | ||
| 163 | return locate_hba_next(seq, v, pos); | ||
| 164 | } | ||
| 165 | |||
| 166 | static void scsi_dev_seq_stop(struct seq_file *seq, void *v) | ||
| 167 | { | ||
| 168 | locate_hba_stop(seq, v); | ||
| 169 | } | ||
| 170 | |||
| 171 | static int scsi_dev_seq_show(struct seq_file *seq, void *v) | ||
| 172 | { | ||
| 173 | struct se_hba *hba; | ||
| 174 | struct se_subsystem_dev *se_dev = list_entry(v, struct se_subsystem_dev, | ||
| 175 | g_se_dev_list); | ||
| 176 | struct se_device *dev = se_dev->se_dev_ptr; | ||
| 177 | char str[28]; | ||
| 178 | int k; | ||
| 179 | |||
| 180 | if (list_is_first(&se_dev->g_se_dev_list, &se_global->g_se_dev_list)) | ||
| 181 | seq_puts(seq, "inst indx role ports\n"); | ||
| 182 | |||
| 183 | if (!(dev)) | ||
| 184 | return 0; | ||
| 185 | |||
| 186 | hba = dev->se_hba; | ||
| 187 | if (!(hba)) { | ||
| 188 | /* Log error ? */ | ||
| 189 | return 0; | ||
| 190 | } | ||
| 191 | |||
| 192 | seq_printf(seq, "%u %u %s %u\n", hba->hba_index, | ||
| 193 | dev->dev_index, "Target", dev->dev_port_count); | ||
| 194 | |||
| 195 | memcpy(&str[0], (void *)DEV_T10_WWN(dev), 28); | ||
| 196 | |||
| 197 | /* vendor */ | ||
| 198 | for (k = 0; k < 8; k++) | ||
| 199 | str[k] = ISPRINT(DEV_T10_WWN(dev)->vendor[k]) ? | ||
| 200 | DEV_T10_WWN(dev)->vendor[k] : 0x20; | ||
| 201 | str[k] = 0x20; | ||
| 202 | |||
| 203 | /* model */ | ||
| 204 | for (k = 0; k < 16; k++) | ||
| 205 | str[k+9] = ISPRINT(DEV_T10_WWN(dev)->model[k]) ? | ||
| 206 | DEV_T10_WWN(dev)->model[k] : 0x20; | ||
| 207 | str[k + 9] = 0; | ||
| 208 | |||
| 209 | seq_printf(seq, "dev_alias: %s\n", str); | ||
| 210 | |||
| 211 | return 0; | ||
| 212 | } | ||
| 213 | |||
| 214 | static const struct seq_operations scsi_dev_seq_ops = { | ||
| 215 | .start = scsi_dev_seq_start, | ||
| 216 | .next = scsi_dev_seq_next, | ||
| 217 | .stop = scsi_dev_seq_stop, | ||
| 218 | .show = scsi_dev_seq_show | ||
| 219 | }; | ||
| 220 | |||
| 221 | static int scsi_dev_seq_open(struct inode *inode, struct file *file) | ||
| 222 | { | ||
| 223 | return seq_open(file, &scsi_dev_seq_ops); | ||
| 224 | } | ||
| 225 | |||
| 226 | static const struct file_operations scsi_dev_seq_fops = { | ||
| 227 | .owner = THIS_MODULE, | ||
| 228 | .open = scsi_dev_seq_open, | ||
| 229 | .read = seq_read, | ||
| 230 | .llseek = seq_lseek, | ||
| 231 | .release = seq_release, | ||
| 232 | }; | ||
| 233 | |||
| 234 | /* | ||
| 235 | * SCSI Port Table | ||
| 236 | */ | ||
| 237 | static void *scsi_port_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 238 | { | ||
| 239 | return locate_hba_start(seq, pos); | ||
| 240 | } | ||
| 241 | |||
| 242 | static void *scsi_port_seq_next(struct seq_file *seq, void *v, loff_t *pos) | ||
| 243 | { | ||
| 244 | return locate_hba_next(seq, v, pos); | ||
| 245 | } | ||
| 246 | |||
| 247 | static void scsi_port_seq_stop(struct seq_file *seq, void *v) | ||
| 248 | { | ||
| 249 | locate_hba_stop(seq, v); | ||
| 250 | } | ||
| 251 | |||
| 252 | static int scsi_port_seq_show(struct seq_file *seq, void *v) | ||
| 253 | { | ||
| 254 | struct se_hba *hba; | ||
| 255 | struct se_subsystem_dev *se_dev = list_entry(v, struct se_subsystem_dev, | ||
| 256 | g_se_dev_list); | ||
| 257 | struct se_device *dev = se_dev->se_dev_ptr; | ||
| 258 | struct se_port *sep, *sep_tmp; | ||
| 259 | |||
| 260 | if (list_is_first(&se_dev->g_se_dev_list, &se_global->g_se_dev_list)) | ||
| 261 | seq_puts(seq, "inst device indx role busy_count\n"); | ||
| 262 | |||
| 263 | if (!(dev)) | ||
| 264 | return 0; | ||
| 265 | |||
| 266 | hba = dev->se_hba; | ||
| 267 | if (!(hba)) { | ||
| 268 | /* Log error ? */ | ||
| 269 | return 0; | ||
| 270 | } | ||
| 271 | |||
| 272 | /* FIXME: scsiPortBusyStatuses count */ | ||
| 273 | spin_lock(&dev->se_port_lock); | ||
| 274 | list_for_each_entry_safe(sep, sep_tmp, &dev->dev_sep_list, sep_list) { | ||
| 275 | seq_printf(seq, "%u %u %u %s%u %u\n", hba->hba_index, | ||
| 276 | dev->dev_index, sep->sep_index, "Device", | ||
| 277 | dev->dev_index, 0); | ||
| 278 | } | ||
| 279 | spin_unlock(&dev->se_port_lock); | ||
| 280 | |||
| 281 | return 0; | ||
| 282 | } | ||
| 283 | |||
| 284 | static const struct seq_operations scsi_port_seq_ops = { | ||
| 285 | .start = scsi_port_seq_start, | ||
| 286 | .next = scsi_port_seq_next, | ||
| 287 | .stop = scsi_port_seq_stop, | ||
| 288 | .show = scsi_port_seq_show | ||
| 289 | }; | ||
| 290 | |||
| 291 | static int scsi_port_seq_open(struct inode *inode, struct file *file) | ||
| 292 | { | ||
| 293 | return seq_open(file, &scsi_port_seq_ops); | ||
| 294 | } | ||
| 295 | |||
| 296 | static const struct file_operations scsi_port_seq_fops = { | ||
| 297 | .owner = THIS_MODULE, | ||
| 298 | .open = scsi_port_seq_open, | ||
| 299 | .read = seq_read, | ||
| 300 | .llseek = seq_lseek, | ||
| 301 | .release = seq_release, | ||
| 302 | }; | ||
| 303 | |||
| 304 | /* | ||
| 305 | * SCSI Transport Table | ||
| 306 | */ | ||
| 307 | static void *scsi_transport_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 308 | { | ||
| 309 | return locate_hba_start(seq, pos); | ||
| 310 | } | ||
| 311 | |||
| 312 | static void *scsi_transport_seq_next(struct seq_file *seq, void *v, loff_t *pos) | ||
| 313 | { | ||
| 314 | return locate_hba_next(seq, v, pos); | ||
| 315 | } | ||
| 316 | |||
| 317 | static void scsi_transport_seq_stop(struct seq_file *seq, void *v) | ||
| 318 | { | ||
| 319 | locate_hba_stop(seq, v); | ||
| 320 | } | ||
| 321 | |||
| 322 | static int scsi_transport_seq_show(struct seq_file *seq, void *v) | ||
| 323 | { | ||
| 324 | struct se_hba *hba; | ||
| 325 | struct se_subsystem_dev *se_dev = list_entry(v, struct se_subsystem_dev, | ||
| 326 | g_se_dev_list); | ||
| 327 | struct se_device *dev = se_dev->se_dev_ptr; | ||
| 328 | struct se_port *se, *se_tmp; | ||
| 329 | struct se_portal_group *tpg; | ||
| 330 | struct t10_wwn *wwn; | ||
| 331 | char buf[64]; | ||
| 332 | |||
| 333 | if (list_is_first(&se_dev->g_se_dev_list, &se_global->g_se_dev_list)) | ||
| 334 | seq_puts(seq, "inst device indx dev_name\n"); | ||
| 335 | |||
| 336 | if (!(dev)) | ||
| 337 | return 0; | ||
| 338 | |||
| 339 | hba = dev->se_hba; | ||
| 340 | if (!(hba)) { | ||
| 341 | /* Log error ? */ | ||
| 342 | return 0; | ||
| 343 | } | ||
| 344 | |||
| 345 | wwn = DEV_T10_WWN(dev); | ||
| 346 | |||
| 347 | spin_lock(&dev->se_port_lock); | ||
| 348 | list_for_each_entry_safe(se, se_tmp, &dev->dev_sep_list, sep_list) { | ||
| 349 | tpg = se->sep_tpg; | ||
| 350 | sprintf(buf, "scsiTransport%s", | ||
| 351 | TPG_TFO(tpg)->get_fabric_name()); | ||
| 352 | |||
| 353 | seq_printf(seq, "%u %s %u %s+%s\n", | ||
| 354 | hba->hba_index, /* scsiTransportIndex */ | ||
| 355 | buf, /* scsiTransportType */ | ||
| 356 | (TPG_TFO(tpg)->tpg_get_inst_index != NULL) ? | ||
| 357 | TPG_TFO(tpg)->tpg_get_inst_index(tpg) : | ||
| 358 | 0, | ||
| 359 | TPG_TFO(tpg)->tpg_get_wwn(tpg), | ||
| 360 | (strlen(wwn->unit_serial)) ? | ||
| 361 | /* scsiTransportDevName */ | ||
| 362 | wwn->unit_serial : wwn->vendor); | ||
| 363 | } | ||
| 364 | spin_unlock(&dev->se_port_lock); | ||
| 365 | |||
| 366 | return 0; | ||
| 367 | } | ||
| 368 | |||
| 369 | static const struct seq_operations scsi_transport_seq_ops = { | ||
| 370 | .start = scsi_transport_seq_start, | ||
| 371 | .next = scsi_transport_seq_next, | ||
| 372 | .stop = scsi_transport_seq_stop, | ||
| 373 | .show = scsi_transport_seq_show | ||
| 374 | }; | ||
| 375 | |||
| 376 | static int scsi_transport_seq_open(struct inode *inode, struct file *file) | ||
| 377 | { | ||
| 378 | return seq_open(file, &scsi_transport_seq_ops); | ||
| 379 | } | ||
| 380 | |||
| 381 | static const struct file_operations scsi_transport_seq_fops = { | ||
| 382 | .owner = THIS_MODULE, | ||
| 383 | .open = scsi_transport_seq_open, | ||
| 384 | .read = seq_read, | ||
| 385 | .llseek = seq_lseek, | ||
| 386 | .release = seq_release, | ||
| 387 | }; | ||
| 388 | |||
| 389 | /* | ||
| 390 | * SCSI Target Device Table | ||
| 391 | */ | ||
| 392 | static void *scsi_tgt_dev_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 393 | { | ||
| 394 | return locate_hba_start(seq, pos); | ||
| 395 | } | ||
| 396 | |||
| 397 | static void *scsi_tgt_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) | ||
| 398 | { | ||
| 399 | return locate_hba_next(seq, v, pos); | ||
| 400 | } | ||
| 401 | |||
| 402 | static void scsi_tgt_dev_seq_stop(struct seq_file *seq, void *v) | ||
| 403 | { | ||
| 404 | locate_hba_stop(seq, v); | ||
| 405 | } | ||
| 406 | |||
| 407 | |||
| 408 | #define LU_COUNT 1 /* for now */ | ||
| 409 | static int scsi_tgt_dev_seq_show(struct seq_file *seq, void *v) | ||
| 410 | { | ||
| 411 | struct se_hba *hba; | ||
| 412 | struct se_subsystem_dev *se_dev = list_entry(v, struct se_subsystem_dev, | ||
| 413 | g_se_dev_list); | ||
| 414 | struct se_device *dev = se_dev->se_dev_ptr; | ||
| 415 | int non_accessible_lus = 0; | ||
| 416 | char status[16]; | ||
| 417 | |||
| 418 | if (list_is_first(&se_dev->g_se_dev_list, &se_global->g_se_dev_list)) | ||
| 419 | seq_puts(seq, "inst indx num_LUs status non_access_LUs" | ||
| 420 | " resets\n"); | ||
| 421 | |||
| 422 | if (!(dev)) | ||
| 423 | return 0; | ||
| 424 | |||
| 425 | hba = dev->se_hba; | ||
| 426 | if (!(hba)) { | ||
| 427 | /* Log error ? */ | ||
| 428 | return 0; | ||
| 429 | } | ||
| 430 | |||
| 431 | switch (dev->dev_status) { | ||
| 432 | case TRANSPORT_DEVICE_ACTIVATED: | ||
| 433 | strcpy(status, "activated"); | ||
| 434 | break; | ||
| 435 | case TRANSPORT_DEVICE_DEACTIVATED: | ||
| 436 | strcpy(status, "deactivated"); | ||
| 437 | non_accessible_lus = 1; | ||
| 438 | break; | ||
| 439 | case TRANSPORT_DEVICE_SHUTDOWN: | ||
| 440 | strcpy(status, "shutdown"); | ||
| 441 | non_accessible_lus = 1; | ||
| 442 | break; | ||
| 443 | case TRANSPORT_DEVICE_OFFLINE_ACTIVATED: | ||
| 444 | case TRANSPORT_DEVICE_OFFLINE_DEACTIVATED: | ||
| 445 | strcpy(status, "offline"); | ||
| 446 | non_accessible_lus = 1; | ||
| 447 | break; | ||
| 448 | default: | ||
| 449 | sprintf(status, "unknown(%d)", dev->dev_status); | ||
| 450 | non_accessible_lus = 1; | ||
| 451 | } | ||
| 452 | |||
| 453 | seq_printf(seq, "%u %u %u %s %u %u\n", | ||
| 454 | hba->hba_index, dev->dev_index, LU_COUNT, | ||
| 455 | status, non_accessible_lus, dev->num_resets); | ||
| 456 | |||
| 457 | return 0; | ||
| 458 | } | ||
| 459 | |||
| 460 | static const struct seq_operations scsi_tgt_dev_seq_ops = { | ||
| 461 | .start = scsi_tgt_dev_seq_start, | ||
| 462 | .next = scsi_tgt_dev_seq_next, | ||
| 463 | .stop = scsi_tgt_dev_seq_stop, | ||
| 464 | .show = scsi_tgt_dev_seq_show | ||
| 465 | }; | ||
| 466 | |||
| 467 | static int scsi_tgt_dev_seq_open(struct inode *inode, struct file *file) | ||
| 468 | { | ||
| 469 | return seq_open(file, &scsi_tgt_dev_seq_ops); | ||
| 470 | } | ||
| 471 | |||
| 472 | static const struct file_operations scsi_tgt_dev_seq_fops = { | ||
| 473 | .owner = THIS_MODULE, | ||
| 474 | .open = scsi_tgt_dev_seq_open, | ||
| 475 | .read = seq_read, | ||
| 476 | .llseek = seq_lseek, | ||
| 477 | .release = seq_release, | ||
| 478 | }; | ||
| 479 | |||
| 480 | /* | ||
| 481 | * SCSI Target Port Table | ||
| 482 | */ | ||
| 483 | static void *scsi_tgt_port_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 484 | { | ||
| 485 | return locate_hba_start(seq, pos); | ||
| 486 | } | ||
| 487 | |||
| 488 | static void *scsi_tgt_port_seq_next(struct seq_file *seq, void *v, loff_t *pos) | ||
| 489 | { | ||
| 490 | return locate_hba_next(seq, v, pos); | ||
| 491 | } | ||
| 492 | |||
| 493 | static void scsi_tgt_port_seq_stop(struct seq_file *seq, void *v) | ||
| 494 | { | ||
| 495 | locate_hba_stop(seq, v); | ||
| 496 | } | ||
| 497 | |||
| 498 | static int scsi_tgt_port_seq_show(struct seq_file *seq, void *v) | ||
| 499 | { | ||
| 500 | struct se_hba *hba; | ||
| 501 | struct se_subsystem_dev *se_dev = list_entry(v, struct se_subsystem_dev, | ||
| 502 | g_se_dev_list); | ||
| 503 | struct se_device *dev = se_dev->se_dev_ptr; | ||
| 504 | struct se_port *sep, *sep_tmp; | ||
| 505 | struct se_portal_group *tpg; | ||
| 506 | u32 rx_mbytes, tx_mbytes; | ||
| 507 | unsigned long long num_cmds; | ||
| 508 | char buf[64]; | ||
| 509 | |||
| 510 | if (list_is_first(&se_dev->g_se_dev_list, &se_global->g_se_dev_list)) | ||
| 511 | seq_puts(seq, "inst device indx name port_index in_cmds" | ||
| 512 | " write_mbytes read_mbytes hs_in_cmds\n"); | ||
| 513 | |||
| 514 | if (!(dev)) | ||
| 515 | return 0; | ||
| 516 | |||
| 517 | hba = dev->se_hba; | ||
| 518 | if (!(hba)) { | ||
| 519 | /* Log error ? */ | ||
| 520 | return 0; | ||
| 521 | } | ||
| 522 | |||
| 523 | spin_lock(&dev->se_port_lock); | ||
| 524 | list_for_each_entry_safe(sep, sep_tmp, &dev->dev_sep_list, sep_list) { | ||
| 525 | tpg = sep->sep_tpg; | ||
| 526 | sprintf(buf, "%sPort#", | ||
| 527 | TPG_TFO(tpg)->get_fabric_name()); | ||
| 528 | |||
| 529 | seq_printf(seq, "%u %u %u %s%d %s%s%d ", | ||
| 530 | hba->hba_index, | ||
| 531 | dev->dev_index, | ||
| 532 | sep->sep_index, | ||
| 533 | buf, sep->sep_index, | ||
| 534 | TPG_TFO(tpg)->tpg_get_wwn(tpg), "+t+", | ||
| 535 | TPG_TFO(tpg)->tpg_get_tag(tpg)); | ||
| 536 | |||
| 537 | spin_lock(&sep->sep_lun->lun_sep_lock); | ||
| 538 | num_cmds = sep->sep_stats.cmd_pdus; | ||
| 539 | rx_mbytes = (sep->sep_stats.rx_data_octets >> 20); | ||
| 540 | tx_mbytes = (sep->sep_stats.tx_data_octets >> 20); | ||
| 541 | spin_unlock(&sep->sep_lun->lun_sep_lock); | ||
| 542 | |||
| 543 | seq_printf(seq, "%llu %u %u %u\n", num_cmds, | ||
| 544 | rx_mbytes, tx_mbytes, 0); | ||
| 545 | } | ||
| 546 | spin_unlock(&dev->se_port_lock); | ||
| 547 | |||
| 548 | return 0; | ||
| 549 | } | ||
| 550 | |||
| 551 | static const struct seq_operations scsi_tgt_port_seq_ops = { | ||
| 552 | .start = scsi_tgt_port_seq_start, | ||
| 553 | .next = scsi_tgt_port_seq_next, | ||
| 554 | .stop = scsi_tgt_port_seq_stop, | ||
| 555 | .show = scsi_tgt_port_seq_show | ||
| 556 | }; | ||
| 557 | |||
| 558 | static int scsi_tgt_port_seq_open(struct inode *inode, struct file *file) | ||
| 559 | { | ||
| 560 | return seq_open(file, &scsi_tgt_port_seq_ops); | ||
| 561 | } | ||
| 562 | |||
| 563 | static const struct file_operations scsi_tgt_port_seq_fops = { | ||
| 564 | .owner = THIS_MODULE, | ||
| 565 | .open = scsi_tgt_port_seq_open, | ||
| 566 | .read = seq_read, | ||
| 567 | .llseek = seq_lseek, | ||
| 568 | .release = seq_release, | ||
| 569 | }; | ||
| 570 | |||
| 571 | /* | ||
| 572 | * SCSI Authorized Initiator Table: | ||
| 573 | * It contains the SCSI Initiators authorized to be attached to one of the | ||
| 574 | * local Target ports. | ||
| 575 | * Iterates through all active TPGs and extracts the info from the ACLs | ||
| 576 | */ | ||
| 577 | static void *scsi_auth_intr_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 578 | { | ||
| 579 | spin_lock_bh(&se_global->se_tpg_lock); | ||
| 580 | return seq_list_start(&se_global->g_se_tpg_list, *pos); | ||
| 581 | } | ||
| 582 | |||
| 583 | static void *scsi_auth_intr_seq_next(struct seq_file *seq, void *v, | ||
| 584 | loff_t *pos) | ||
| 585 | { | ||
| 586 | return seq_list_next(v, &se_global->g_se_tpg_list, pos); | ||
| 587 | } | ||
| 588 | |||
| 589 | static void scsi_auth_intr_seq_stop(struct seq_file *seq, void *v) | ||
| 590 | { | ||
| 591 | spin_unlock_bh(&se_global->se_tpg_lock); | ||
| 592 | } | ||
| 593 | |||
| 594 | static int scsi_auth_intr_seq_show(struct seq_file *seq, void *v) | ||
| 595 | { | ||
| 596 | struct se_portal_group *se_tpg = list_entry(v, struct se_portal_group, | ||
| 597 | se_tpg_list); | ||
| 598 | struct se_dev_entry *deve; | ||
| 599 | struct se_lun *lun; | ||
| 600 | struct se_node_acl *se_nacl; | ||
| 601 | int j; | ||
| 602 | |||
| 603 | if (list_is_first(&se_tpg->se_tpg_list, | ||
| 604 | &se_global->g_se_tpg_list)) | ||
| 605 | seq_puts(seq, "inst dev port indx dev_or_port intr_name " | ||
| 606 | "map_indx att_count num_cmds read_mbytes " | ||
| 607 | "write_mbytes hs_num_cmds creation_time row_status\n"); | ||
| 608 | |||
| 609 | if (!(se_tpg)) | ||
| 610 | return 0; | ||
| 611 | |||
| 612 | spin_lock(&se_tpg->acl_node_lock); | ||
| 613 | list_for_each_entry(se_nacl, &se_tpg->acl_node_list, acl_list) { | ||
| 614 | |||
| 615 | atomic_inc(&se_nacl->mib_ref_count); | ||
| 616 | smp_mb__after_atomic_inc(); | ||
| 617 | spin_unlock(&se_tpg->acl_node_lock); | ||
| 618 | |||
| 619 | spin_lock_irq(&se_nacl->device_list_lock); | ||
| 620 | for (j = 0; j < TRANSPORT_MAX_LUNS_PER_TPG; j++) { | ||
| 621 | deve = &se_nacl->device_list[j]; | ||
| 622 | if (!(deve->lun_flags & | ||
| 623 | TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) || | ||
| 624 | (!deve->se_lun)) | ||
| 625 | continue; | ||
| 626 | lun = deve->se_lun; | ||
| 627 | if (!lun->lun_se_dev) | ||
| 628 | continue; | ||
| 629 | |||
| 630 | seq_printf(seq, "%u %u %u %u %u %s %u %u %u %u %u %u" | ||
| 631 | " %u %s\n", | ||
| 632 | /* scsiInstIndex */ | ||
| 633 | (TPG_TFO(se_tpg)->tpg_get_inst_index != NULL) ? | ||
| 634 | TPG_TFO(se_tpg)->tpg_get_inst_index(se_tpg) : | ||
| 635 | 0, | ||
| 636 | /* scsiDeviceIndex */ | ||
| 637 | lun->lun_se_dev->dev_index, | ||
| 638 | /* scsiAuthIntrTgtPortIndex */ | ||
| 639 | TPG_TFO(se_tpg)->tpg_get_tag(se_tpg), | ||
| 640 | /* scsiAuthIntrIndex */ | ||
| 641 | se_nacl->acl_index, | ||
| 642 | /* scsiAuthIntrDevOrPort */ | ||
| 643 | 1, | ||
| 644 | /* scsiAuthIntrName */ | ||
| 645 | se_nacl->initiatorname[0] ? | ||
| 646 | se_nacl->initiatorname : NONE, | ||
| 647 | /* FIXME: scsiAuthIntrLunMapIndex */ | ||
| 648 | 0, | ||
| 649 | /* scsiAuthIntrAttachedTimes */ | ||
| 650 | deve->attach_count, | ||
| 651 | /* scsiAuthIntrOutCommands */ | ||
| 652 | deve->total_cmds, | ||
| 653 | /* scsiAuthIntrReadMegaBytes */ | ||
| 654 | (u32)(deve->read_bytes >> 20), | ||
| 655 | /* scsiAuthIntrWrittenMegaBytes */ | ||
| 656 | (u32)(deve->write_bytes >> 20), | ||
| 657 | /* FIXME: scsiAuthIntrHSOutCommands */ | ||
| 658 | 0, | ||
| 659 | /* scsiAuthIntrLastCreation */ | ||
| 660 | (u32)(((u32)deve->creation_time - | ||
| 661 | INITIAL_JIFFIES) * 100 / HZ), | ||
| 662 | /* FIXME: scsiAuthIntrRowStatus */ | ||
| 663 | "Ready"); | ||
| 664 | } | ||
| 665 | spin_unlock_irq(&se_nacl->device_list_lock); | ||
| 666 | |||
| 667 | spin_lock(&se_tpg->acl_node_lock); | ||
| 668 | atomic_dec(&se_nacl->mib_ref_count); | ||
| 669 | smp_mb__after_atomic_dec(); | ||
| 670 | } | ||
| 671 | spin_unlock(&se_tpg->acl_node_lock); | ||
| 672 | |||
| 673 | return 0; | ||
| 674 | } | ||
| 675 | |||
| 676 | static const struct seq_operations scsi_auth_intr_seq_ops = { | ||
| 677 | .start = scsi_auth_intr_seq_start, | ||
| 678 | .next = scsi_auth_intr_seq_next, | ||
| 679 | .stop = scsi_auth_intr_seq_stop, | ||
| 680 | .show = scsi_auth_intr_seq_show | ||
| 681 | }; | ||
| 682 | |||
| 683 | static int scsi_auth_intr_seq_open(struct inode *inode, struct file *file) | ||
| 684 | { | ||
| 685 | return seq_open(file, &scsi_auth_intr_seq_ops); | ||
| 686 | } | ||
| 687 | |||
| 688 | static const struct file_operations scsi_auth_intr_seq_fops = { | ||
| 689 | .owner = THIS_MODULE, | ||
| 690 | .open = scsi_auth_intr_seq_open, | ||
| 691 | .read = seq_read, | ||
| 692 | .llseek = seq_lseek, | ||
| 693 | .release = seq_release, | ||
| 694 | }; | ||
| 695 | |||
| 696 | /* | ||
| 697 | * SCSI Attached Initiator Port Table: | ||
| 698 | * It lists the SCSI Initiators attached to one of the local Target ports. | ||
| 699 | * Iterates through all active TPGs and use active sessions from each TPG | ||
| 700 | * to list the info fo this table. | ||
| 701 | */ | ||
| 702 | static void *scsi_att_intr_port_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 703 | { | ||
| 704 | spin_lock_bh(&se_global->se_tpg_lock); | ||
| 705 | return seq_list_start(&se_global->g_se_tpg_list, *pos); | ||
| 706 | } | ||
| 707 | |||
| 708 | static void *scsi_att_intr_port_seq_next(struct seq_file *seq, void *v, | ||
| 709 | loff_t *pos) | ||
| 710 | { | ||
| 711 | return seq_list_next(v, &se_global->g_se_tpg_list, pos); | ||
| 712 | } | ||
| 713 | |||
| 714 | static void scsi_att_intr_port_seq_stop(struct seq_file *seq, void *v) | ||
| 715 | { | ||
| 716 | spin_unlock_bh(&se_global->se_tpg_lock); | ||
| 717 | } | ||
| 718 | |||
| 719 | static int scsi_att_intr_port_seq_show(struct seq_file *seq, void *v) | ||
| 720 | { | ||
| 721 | struct se_portal_group *se_tpg = list_entry(v, struct se_portal_group, | ||
| 722 | se_tpg_list); | ||
| 723 | struct se_dev_entry *deve; | ||
| 724 | struct se_lun *lun; | ||
| 725 | struct se_node_acl *se_nacl; | ||
| 726 | struct se_session *se_sess; | ||
| 727 | unsigned char buf[64]; | ||
| 728 | int j; | ||
| 729 | |||
| 730 | if (list_is_first(&se_tpg->se_tpg_list, | ||
| 731 | &se_global->g_se_tpg_list)) | ||
| 732 | seq_puts(seq, "inst dev port indx port_auth_indx port_name" | ||
| 733 | " port_ident\n"); | ||
| 734 | |||
| 735 | if (!(se_tpg)) | ||
| 736 | return 0; | ||
| 737 | |||
| 738 | spin_lock(&se_tpg->session_lock); | ||
| 739 | list_for_each_entry(se_sess, &se_tpg->tpg_sess_list, sess_list) { | ||
| 740 | if ((TPG_TFO(se_tpg)->sess_logged_in(se_sess)) || | ||
| 741 | (!se_sess->se_node_acl) || | ||
| 742 | (!se_sess->se_node_acl->device_list)) | ||
| 743 | continue; | ||
| 744 | |||
| 745 | atomic_inc(&se_sess->mib_ref_count); | ||
| 746 | smp_mb__after_atomic_inc(); | ||
| 747 | se_nacl = se_sess->se_node_acl; | ||
| 748 | atomic_inc(&se_nacl->mib_ref_count); | ||
| 749 | smp_mb__after_atomic_inc(); | ||
| 750 | spin_unlock(&se_tpg->session_lock); | ||
| 751 | |||
| 752 | spin_lock_irq(&se_nacl->device_list_lock); | ||
| 753 | for (j = 0; j < TRANSPORT_MAX_LUNS_PER_TPG; j++) { | ||
| 754 | deve = &se_nacl->device_list[j]; | ||
| 755 | if (!(deve->lun_flags & | ||
| 756 | TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) || | ||
| 757 | (!deve->se_lun)) | ||
| 758 | continue; | ||
| 759 | |||
| 760 | lun = deve->se_lun; | ||
| 761 | if (!lun->lun_se_dev) | ||
| 762 | continue; | ||
| 763 | |||
| 764 | memset(buf, 0, 64); | ||
| 765 | if (TPG_TFO(se_tpg)->sess_get_initiator_sid != NULL) | ||
| 766 | TPG_TFO(se_tpg)->sess_get_initiator_sid( | ||
| 767 | se_sess, (unsigned char *)&buf[0], 64); | ||
| 768 | |||
| 769 | seq_printf(seq, "%u %u %u %u %u %s+i+%s\n", | ||
| 770 | /* scsiInstIndex */ | ||
| 771 | (TPG_TFO(se_tpg)->tpg_get_inst_index != NULL) ? | ||
| 772 | TPG_TFO(se_tpg)->tpg_get_inst_index(se_tpg) : | ||
| 773 | 0, | ||
| 774 | /* scsiDeviceIndex */ | ||
| 775 | lun->lun_se_dev->dev_index, | ||
| 776 | /* scsiPortIndex */ | ||
| 777 | TPG_TFO(se_tpg)->tpg_get_tag(se_tpg), | ||
| 778 | /* scsiAttIntrPortIndex */ | ||
| 779 | (TPG_TFO(se_tpg)->sess_get_index != NULL) ? | ||
| 780 | TPG_TFO(se_tpg)->sess_get_index(se_sess) : | ||
| 781 | 0, | ||
| 782 | /* scsiAttIntrPortAuthIntrIdx */ | ||
| 783 | se_nacl->acl_index, | ||
| 784 | /* scsiAttIntrPortName */ | ||
| 785 | se_nacl->initiatorname[0] ? | ||
| 786 | se_nacl->initiatorname : NONE, | ||
| 787 | /* scsiAttIntrPortIdentifier */ | ||
| 788 | buf); | ||
| 789 | } | ||
| 790 | spin_unlock_irq(&se_nacl->device_list_lock); | ||
| 791 | |||
| 792 | spin_lock(&se_tpg->session_lock); | ||
| 793 | atomic_dec(&se_nacl->mib_ref_count); | ||
| 794 | smp_mb__after_atomic_dec(); | ||
| 795 | atomic_dec(&se_sess->mib_ref_count); | ||
| 796 | smp_mb__after_atomic_dec(); | ||
| 797 | } | ||
| 798 | spin_unlock(&se_tpg->session_lock); | ||
| 799 | |||
| 800 | return 0; | ||
| 801 | } | ||
| 802 | |||
| 803 | static const struct seq_operations scsi_att_intr_port_seq_ops = { | ||
| 804 | .start = scsi_att_intr_port_seq_start, | ||
| 805 | .next = scsi_att_intr_port_seq_next, | ||
| 806 | .stop = scsi_att_intr_port_seq_stop, | ||
| 807 | .show = scsi_att_intr_port_seq_show | ||
| 808 | }; | ||
| 809 | |||
| 810 | static int scsi_att_intr_port_seq_open(struct inode *inode, struct file *file) | ||
| 811 | { | ||
| 812 | return seq_open(file, &scsi_att_intr_port_seq_ops); | ||
| 813 | } | ||
| 814 | |||
| 815 | static const struct file_operations scsi_att_intr_port_seq_fops = { | ||
| 816 | .owner = THIS_MODULE, | ||
| 817 | .open = scsi_att_intr_port_seq_open, | ||
| 818 | .read = seq_read, | ||
| 819 | .llseek = seq_lseek, | ||
| 820 | .release = seq_release, | ||
| 821 | }; | ||
| 822 | |||
| 823 | /* | ||
| 824 | * SCSI Logical Unit Table | ||
| 825 | */ | ||
| 826 | static void *scsi_lu_seq_start(struct seq_file *seq, loff_t *pos) | ||
| 827 | { | ||
| 828 | return locate_hba_start(seq, pos); | ||
| 829 | } | ||
| 830 | |||
| 831 | static void *scsi_lu_seq_next(struct seq_file *seq, void *v, loff_t *pos) | ||
| 832 | { | ||
| 833 | return locate_hba_next(seq, v, pos); | ||
| 834 | } | ||
| 835 | |||
| 836 | static void scsi_lu_seq_stop(struct seq_file *seq, void *v) | ||
| 837 | { | ||
| 838 | locate_hba_stop(seq, v); | ||
| 839 | } | ||
| 840 | |||
| 841 | #define SCSI_LU_INDEX 1 | ||
| 842 | static int scsi_lu_seq_show(struct seq_file *seq, void *v) | ||
| 843 | { | ||
| 844 | struct se_hba *hba; | ||
| 845 | struct se_subsystem_dev *se_dev = list_entry(v, struct se_subsystem_dev, | ||
| 846 | g_se_dev_list); | ||
| 847 | struct se_device *dev = se_dev->se_dev_ptr; | ||
| 848 | int j; | ||
| 849 | char str[28]; | ||
| 850 | |||
| 851 | if (list_is_first(&se_dev->g_se_dev_list, &se_global->g_se_dev_list)) | ||
| 852 | seq_puts(seq, "inst dev indx LUN lu_name vend prod rev" | ||
| 853 | " dev_type status state-bit num_cmds read_mbytes" | ||
| 854 | " write_mbytes resets full_stat hs_num_cmds creation_time\n"); | ||
| 855 | |||
| 856 | if (!(dev)) | ||
| 857 | return 0; | ||
| 858 | |||
| 859 | hba = dev->se_hba; | ||
| 860 | if (!(hba)) { | ||
| 861 | /* Log error ? */ | ||
| 862 | return 0; | ||
| 863 | } | ||
| 864 | |||
| 865 | /* Fix LU state, if we can read it from the device */ | ||
| 866 | seq_printf(seq, "%u %u %u %llu %s", hba->hba_index, | ||
| 867 | dev->dev_index, SCSI_LU_INDEX, | ||
| 868 | (unsigned long long)0, /* FIXME: scsiLuDefaultLun */ | ||
| 869 | (strlen(DEV_T10_WWN(dev)->unit_serial)) ? | ||
| 870 | /* scsiLuWwnName */ | ||
| 871 | (char *)&DEV_T10_WWN(dev)->unit_serial[0] : | ||
| 872 | "None"); | ||
| 873 | |||
| 874 | memcpy(&str[0], (void *)DEV_T10_WWN(dev), 28); | ||
| 875 | /* scsiLuVendorId */ | ||
| 876 | for (j = 0; j < 8; j++) | ||
| 877 | str[j] = ISPRINT(DEV_T10_WWN(dev)->vendor[j]) ? | ||
| 878 | DEV_T10_WWN(dev)->vendor[j] : 0x20; | ||
| 879 | str[8] = 0; | ||
| 880 | seq_printf(seq, " %s", str); | ||
| 881 | |||
| 882 | /* scsiLuProductId */ | ||
| 883 | for (j = 0; j < 16; j++) | ||
| 884 | str[j] = ISPRINT(DEV_T10_WWN(dev)->model[j]) ? | ||
| 885 | DEV_T10_WWN(dev)->model[j] : 0x20; | ||
| 886 | str[16] = 0; | ||
| 887 | seq_printf(seq, " %s", str); | ||
| 888 | |||
| 889 | /* scsiLuRevisionId */ | ||
| 890 | for (j = 0; j < 4; j++) | ||
| 891 | str[j] = ISPRINT(DEV_T10_WWN(dev)->revision[j]) ? | ||
| 892 | DEV_T10_WWN(dev)->revision[j] : 0x20; | ||
| 893 | str[4] = 0; | ||
| 894 | seq_printf(seq, " %s", str); | ||
| 895 | |||
| 896 | seq_printf(seq, " %u %s %s %llu %u %u %u %u %u %u\n", | ||
| 897 | /* scsiLuPeripheralType */ | ||
| 898 | TRANSPORT(dev)->get_device_type(dev), | ||
| 899 | (dev->dev_status == TRANSPORT_DEVICE_ACTIVATED) ? | ||
| 900 | "available" : "notavailable", /* scsiLuStatus */ | ||
| 901 | "exposed", /* scsiLuState */ | ||
| 902 | (unsigned long long)dev->num_cmds, | ||
| 903 | /* scsiLuReadMegaBytes */ | ||
| 904 | (u32)(dev->read_bytes >> 20), | ||
| 905 | /* scsiLuWrittenMegaBytes */ | ||
| 906 | (u32)(dev->write_bytes >> 20), | ||
| 907 | dev->num_resets, /* scsiLuInResets */ | ||
| 908 | 0, /* scsiLuOutTaskSetFullStatus */ | ||
| 909 | 0, /* scsiLuHSInCommands */ | ||
| 910 | (u32)(((u32)dev->creation_time - INITIAL_JIFFIES) * | ||
| 911 | 100 / HZ)); | ||
| 912 | |||
| 913 | return 0; | ||
| 914 | } | ||
| 915 | |||
| 916 | static const struct seq_operations scsi_lu_seq_ops = { | ||
| 917 | .start = scsi_lu_seq_start, | ||
| 918 | .next = scsi_lu_seq_next, | ||
| 919 | .stop = scsi_lu_seq_stop, | ||
| 920 | .show = scsi_lu_seq_show | ||
| 921 | }; | ||
| 922 | |||
| 923 | static int scsi_lu_seq_open(struct inode *inode, struct file *file) | ||
| 924 | { | ||
| 925 | return seq_open(file, &scsi_lu_seq_ops); | ||
| 926 | } | ||
| 927 | |||
| 928 | static const struct file_operations scsi_lu_seq_fops = { | ||
| 929 | .owner = THIS_MODULE, | ||
| 930 | .open = scsi_lu_seq_open, | ||
| 931 | .read = seq_read, | ||
| 932 | .llseek = seq_lseek, | ||
| 933 | .release = seq_release, | ||
| 934 | }; | ||
| 935 | |||
| 936 | /****************************************************************************/ | ||
| 937 | |||
| 938 | /* | ||
| 939 | * Remove proc fs entries | ||
| 940 | */ | ||
| 941 | void remove_scsi_target_mib(void) | ||
| 942 | { | ||
| 943 | remove_proc_entry("scsi_target/mib/scsi_inst", NULL); | ||
| 944 | remove_proc_entry("scsi_target/mib/scsi_dev", NULL); | ||
| 945 | remove_proc_entry("scsi_target/mib/scsi_port", NULL); | ||
| 946 | remove_proc_entry("scsi_target/mib/scsi_transport", NULL); | ||
| 947 | remove_proc_entry("scsi_target/mib/scsi_tgt_dev", NULL); | ||
| 948 | remove_proc_entry("scsi_target/mib/scsi_tgt_port", NULL); | ||
| 949 | remove_proc_entry("scsi_target/mib/scsi_auth_intr", NULL); | ||
| 950 | remove_proc_entry("scsi_target/mib/scsi_att_intr_port", NULL); | ||
| 951 | remove_proc_entry("scsi_target/mib/scsi_lu", NULL); | ||
| 952 | remove_proc_entry("scsi_target/mib", NULL); | ||
| 953 | } | ||
| 954 | |||
| 955 | /* | ||
| 956 | * Create proc fs entries for the mib tables | ||
| 957 | */ | ||
| 958 | int init_scsi_target_mib(void) | ||
| 959 | { | ||
| 960 | struct proc_dir_entry *dir_entry; | ||
| 961 | struct proc_dir_entry *scsi_inst_entry; | ||
| 962 | struct proc_dir_entry *scsi_dev_entry; | ||
| 963 | struct proc_dir_entry *scsi_port_entry; | ||
| 964 | struct proc_dir_entry *scsi_transport_entry; | ||
| 965 | struct proc_dir_entry *scsi_tgt_dev_entry; | ||
| 966 | struct proc_dir_entry *scsi_tgt_port_entry; | ||
| 967 | struct proc_dir_entry *scsi_auth_intr_entry; | ||
| 968 | struct proc_dir_entry *scsi_att_intr_port_entry; | ||
| 969 | struct proc_dir_entry *scsi_lu_entry; | ||
| 970 | |||
| 971 | dir_entry = proc_mkdir("scsi_target/mib", NULL); | ||
| 972 | if (!(dir_entry)) { | ||
| 973 | printk(KERN_ERR "proc_mkdir() failed.\n"); | ||
| 974 | return -1; | ||
| 975 | } | ||
| 976 | |||
| 977 | scsi_inst_entry = | ||
| 978 | create_proc_entry("scsi_target/mib/scsi_inst", 0, NULL); | ||
| 979 | if (scsi_inst_entry) | ||
| 980 | scsi_inst_entry->proc_fops = &scsi_inst_seq_fops; | ||
| 981 | else | ||
| 982 | goto error; | ||
| 983 | |||
| 984 | scsi_dev_entry = | ||
| 985 | create_proc_entry("scsi_target/mib/scsi_dev", 0, NULL); | ||
| 986 | if (scsi_dev_entry) | ||
| 987 | scsi_dev_entry->proc_fops = &scsi_dev_seq_fops; | ||
| 988 | else | ||
| 989 | goto error; | ||
| 990 | |||
| 991 | scsi_port_entry = | ||
| 992 | create_proc_entry("scsi_target/mib/scsi_port", 0, NULL); | ||
| 993 | if (scsi_port_entry) | ||
| 994 | scsi_port_entry->proc_fops = &scsi_port_seq_fops; | ||
| 995 | else | ||
| 996 | goto error; | ||
| 997 | |||
| 998 | scsi_transport_entry = | ||
| 999 | create_proc_entry("scsi_target/mib/scsi_transport", 0, NULL); | ||
| 1000 | if (scsi_transport_entry) | ||
| 1001 | scsi_transport_entry->proc_fops = &scsi_transport_seq_fops; | ||
| 1002 | else | ||
| 1003 | goto error; | ||
| 1004 | |||
| 1005 | scsi_tgt_dev_entry = | ||
| 1006 | create_proc_entry("scsi_target/mib/scsi_tgt_dev", 0, NULL); | ||
| 1007 | if (scsi_tgt_dev_entry) | ||
| 1008 | scsi_tgt_dev_entry->proc_fops = &scsi_tgt_dev_seq_fops; | ||
| 1009 | else | ||
| 1010 | goto error; | ||
| 1011 | |||
| 1012 | scsi_tgt_port_entry = | ||
| 1013 | create_proc_entry("scsi_target/mib/scsi_tgt_port", 0, NULL); | ||
| 1014 | if (scsi_tgt_port_entry) | ||
| 1015 | scsi_tgt_port_entry->proc_fops = &scsi_tgt_port_seq_fops; | ||
| 1016 | else | ||
| 1017 | goto error; | ||
| 1018 | |||
| 1019 | scsi_auth_intr_entry = | ||
| 1020 | create_proc_entry("scsi_target/mib/scsi_auth_intr", 0, NULL); | ||
| 1021 | if (scsi_auth_intr_entry) | ||
| 1022 | scsi_auth_intr_entry->proc_fops = &scsi_auth_intr_seq_fops; | ||
| 1023 | else | ||
| 1024 | goto error; | ||
| 1025 | |||
| 1026 | scsi_att_intr_port_entry = | ||
| 1027 | create_proc_entry("scsi_target/mib/scsi_att_intr_port", 0, NULL); | ||
| 1028 | if (scsi_att_intr_port_entry) | ||
| 1029 | scsi_att_intr_port_entry->proc_fops = | ||
| 1030 | &scsi_att_intr_port_seq_fops; | ||
| 1031 | else | ||
| 1032 | goto error; | ||
| 1033 | |||
| 1034 | scsi_lu_entry = create_proc_entry("scsi_target/mib/scsi_lu", 0, NULL); | ||
| 1035 | if (scsi_lu_entry) | ||
| 1036 | scsi_lu_entry->proc_fops = &scsi_lu_seq_fops; | ||
| 1037 | else | ||
| 1038 | goto error; | ||
| 1039 | |||
| 1040 | return 0; | ||
| 1041 | |||
| 1042 | error: | ||
| 1043 | printk(KERN_ERR "create_proc_entry() failed.\n"); | ||
| 1044 | remove_scsi_target_mib(); | ||
| 1045 | return -1; | ||
| 1046 | } | ||
| 1047 | |||
| 1048 | /* | ||
| 1049 | * Initialize the index table for allocating unique row indexes to various mib | ||
| 1050 | * tables | ||
| 1051 | */ | ||
| 1052 | void init_scsi_index_table(void) | ||
| 1053 | { | ||
| 1054 | memset(&scsi_index_table, 0, sizeof(struct scsi_index_table)); | ||
| 1055 | spin_lock_init(&scsi_index_table.lock); | ||
| 1056 | } | ||
| 1057 | |||
| 1058 | /* | ||
| 1059 | * Allocate a new row index for the entry type specified | ||
| 1060 | */ | ||
| 1061 | u32 scsi_get_new_index(scsi_index_t type) | ||
| 1062 | { | ||
| 1063 | u32 new_index; | ||
| 1064 | |||
| 1065 | if ((type < 0) || (type >= SCSI_INDEX_TYPE_MAX)) { | ||
| 1066 | printk(KERN_ERR "Invalid index type %d\n", type); | ||
| 1067 | return -1; | ||
| 1068 | } | ||
| 1069 | |||
| 1070 | spin_lock(&scsi_index_table.lock); | ||
| 1071 | new_index = ++scsi_index_table.scsi_mib_index[type]; | ||
| 1072 | if (new_index == 0) | ||
| 1073 | new_index = ++scsi_index_table.scsi_mib_index[type]; | ||
| 1074 | spin_unlock(&scsi_index_table.lock); | ||
| 1075 | |||
| 1076 | return new_index; | ||
| 1077 | } | ||
| 1078 | EXPORT_SYMBOL(scsi_get_new_index); | ||
diff --git a/drivers/target/target_core_mib.h b/drivers/target/target_core_mib.h deleted file mode 100644 index 277204633850..000000000000 --- a/drivers/target/target_core_mib.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | #ifndef TARGET_CORE_MIB_H | ||
| 2 | #define TARGET_CORE_MIB_H | ||
| 3 | |||
| 4 | typedef enum { | ||
| 5 | SCSI_INST_INDEX, | ||
| 6 | SCSI_DEVICE_INDEX, | ||
| 7 | SCSI_AUTH_INTR_INDEX, | ||
| 8 | SCSI_INDEX_TYPE_MAX | ||
| 9 | } scsi_index_t; | ||
| 10 | |||
| 11 | struct scsi_index_table { | ||
| 12 | spinlock_t lock; | ||
| 13 | u32 scsi_mib_index[SCSI_INDEX_TYPE_MAX]; | ||
| 14 | } ____cacheline_aligned; | ||
| 15 | |||
| 16 | /* SCSI Port stats */ | ||
| 17 | struct scsi_port_stats { | ||
| 18 | u64 cmd_pdus; | ||
| 19 | u64 tx_data_octets; | ||
| 20 | u64 rx_data_octets; | ||
| 21 | } ____cacheline_aligned; | ||
| 22 | |||
| 23 | extern int init_scsi_target_mib(void); | ||
| 24 | extern void remove_scsi_target_mib(void); | ||
| 25 | extern void init_scsi_index_table(void); | ||
| 26 | extern u32 scsi_get_new_index(scsi_index_t); | ||
| 27 | |||
| 28 | #endif /*** TARGET_CORE_MIB_H ***/ | ||
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 742d24609a9b..f2a08477a68c 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
| @@ -462,8 +462,8 @@ static struct se_device *pscsi_create_type_disk( | |||
| 462 | */ | 462 | */ |
| 463 | bd = blkdev_get_by_path(se_dev->se_dev_udev_path, | 463 | bd = blkdev_get_by_path(se_dev->se_dev_udev_path, |
| 464 | FMODE_WRITE|FMODE_READ|FMODE_EXCL, pdv); | 464 | FMODE_WRITE|FMODE_READ|FMODE_EXCL, pdv); |
| 465 | if (!(bd)) { | 465 | if (IS_ERR(bd)) { |
| 466 | printk("pSCSI: blkdev_get_by_path() failed\n"); | 466 | printk(KERN_ERR "pSCSI: blkdev_get_by_path() failed\n"); |
| 467 | scsi_device_put(sd); | 467 | scsi_device_put(sd); |
| 468 | return NULL; | 468 | return NULL; |
| 469 | } | 469 | } |
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index abfa81a57115..c26f67467623 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c | |||
| @@ -275,7 +275,6 @@ struct se_node_acl *core_tpg_check_initiator_node_acl( | |||
| 275 | spin_lock_init(&acl->device_list_lock); | 275 | spin_lock_init(&acl->device_list_lock); |
| 276 | spin_lock_init(&acl->nacl_sess_lock); | 276 | spin_lock_init(&acl->nacl_sess_lock); |
| 277 | atomic_set(&acl->acl_pr_ref_count, 0); | 277 | atomic_set(&acl->acl_pr_ref_count, 0); |
| 278 | atomic_set(&acl->mib_ref_count, 0); | ||
| 279 | acl->queue_depth = TPG_TFO(tpg)->tpg_get_default_depth(tpg); | 278 | acl->queue_depth = TPG_TFO(tpg)->tpg_get_default_depth(tpg); |
| 280 | snprintf(acl->initiatorname, TRANSPORT_IQN_LEN, "%s", initiatorname); | 279 | snprintf(acl->initiatorname, TRANSPORT_IQN_LEN, "%s", initiatorname); |
| 281 | acl->se_tpg = tpg; | 280 | acl->se_tpg = tpg; |
| @@ -318,12 +317,6 @@ void core_tpg_wait_for_nacl_pr_ref(struct se_node_acl *nacl) | |||
| 318 | cpu_relax(); | 317 | cpu_relax(); |
| 319 | } | 318 | } |
| 320 | 319 | ||
| 321 | void core_tpg_wait_for_mib_ref(struct se_node_acl *nacl) | ||
| 322 | { | ||
| 323 | while (atomic_read(&nacl->mib_ref_count) != 0) | ||
| 324 | cpu_relax(); | ||
| 325 | } | ||
| 326 | |||
| 327 | void core_tpg_clear_object_luns(struct se_portal_group *tpg) | 320 | void core_tpg_clear_object_luns(struct se_portal_group *tpg) |
| 328 | { | 321 | { |
| 329 | int i, ret; | 322 | int i, ret; |
| @@ -480,7 +473,6 @@ int core_tpg_del_initiator_node_acl( | |||
| 480 | spin_unlock_bh(&tpg->session_lock); | 473 | spin_unlock_bh(&tpg->session_lock); |
| 481 | 474 | ||
| 482 | core_tpg_wait_for_nacl_pr_ref(acl); | 475 | core_tpg_wait_for_nacl_pr_ref(acl); |
| 483 | core_tpg_wait_for_mib_ref(acl); | ||
| 484 | core_clear_initiator_node_from_tpg(acl, tpg); | 476 | core_clear_initiator_node_from_tpg(acl, tpg); |
| 485 | core_free_device_list_for_node(acl, tpg); | 477 | core_free_device_list_for_node(acl, tpg); |
| 486 | 478 | ||
| @@ -701,6 +693,8 @@ EXPORT_SYMBOL(core_tpg_register); | |||
| 701 | 693 | ||
| 702 | int core_tpg_deregister(struct se_portal_group *se_tpg) | 694 | int core_tpg_deregister(struct se_portal_group *se_tpg) |
| 703 | { | 695 | { |
| 696 | struct se_node_acl *nacl, *nacl_tmp; | ||
| 697 | |||
| 704 | printk(KERN_INFO "TARGET_CORE[%s]: Deallocating %s struct se_portal_group" | 698 | printk(KERN_INFO "TARGET_CORE[%s]: Deallocating %s struct se_portal_group" |
| 705 | " for endpoint: %s Portal Tag %u\n", | 699 | " for endpoint: %s Portal Tag %u\n", |
| 706 | (se_tpg->se_tpg_type == TRANSPORT_TPG_TYPE_NORMAL) ? | 700 | (se_tpg->se_tpg_type == TRANSPORT_TPG_TYPE_NORMAL) ? |
| @@ -714,6 +708,25 @@ int core_tpg_deregister(struct se_portal_group *se_tpg) | |||
| 714 | 708 | ||
| 715 | while (atomic_read(&se_tpg->tpg_pr_ref_count) != 0) | 709 | while (atomic_read(&se_tpg->tpg_pr_ref_count) != 0) |
| 716 | cpu_relax(); | 710 | cpu_relax(); |
| 711 | /* | ||
| 712 | * Release any remaining demo-mode generated se_node_acl that have | ||
| 713 | * not been released because of TFO->tpg_check_demo_mode_cache() == 1 | ||
| 714 | * in transport_deregister_session(). | ||
| 715 | */ | ||
| 716 | spin_lock_bh(&se_tpg->acl_node_lock); | ||
| 717 | list_for_each_entry_safe(nacl, nacl_tmp, &se_tpg->acl_node_list, | ||
| 718 | acl_list) { | ||
| 719 | list_del(&nacl->acl_list); | ||
| 720 | se_tpg->num_node_acls--; | ||
| 721 | spin_unlock_bh(&se_tpg->acl_node_lock); | ||
| 722 | |||
| 723 | core_tpg_wait_for_nacl_pr_ref(nacl); | ||
| 724 | core_free_device_list_for_node(nacl, se_tpg); | ||
| 725 | TPG_TFO(se_tpg)->tpg_release_fabric_acl(se_tpg, nacl); | ||
| 726 | |||
| 727 | spin_lock_bh(&se_tpg->acl_node_lock); | ||
| 728 | } | ||
| 729 | spin_unlock_bh(&se_tpg->acl_node_lock); | ||
| 717 | 730 | ||
| 718 | if (se_tpg->se_tpg_type == TRANSPORT_TPG_TYPE_NORMAL) | 731 | if (se_tpg->se_tpg_type == TRANSPORT_TPG_TYPE_NORMAL) |
| 719 | core_tpg_release_virtual_lun0(se_tpg); | 732 | core_tpg_release_virtual_lun0(se_tpg); |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 28b6292ff298..236e22d8cfae 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
| @@ -379,6 +379,40 @@ void release_se_global(void) | |||
| 379 | se_global = NULL; | 379 | se_global = NULL; |
| 380 | } | 380 | } |
| 381 | 381 | ||
| 382 | /* SCSI statistics table index */ | ||
| 383 | static struct scsi_index_table scsi_index_table; | ||
| 384 | |||
| 385 | /* | ||
| 386 | * Initialize the index table for allocating unique row indexes to various mib | ||
| 387 | * tables. | ||
| 388 | */ | ||
| 389 | void init_scsi_index_table(void) | ||
| 390 | { | ||
| 391 | memset(&scsi_index_table, 0, sizeof(struct scsi_index_table)); | ||
| 392 | spin_lock_init(&scsi_index_table.lock); | ||
| 393 | } | ||
| 394 | |||
| 395 | /* | ||
| 396 | * Allocate a new row index for the entry type specified | ||
| 397 | */ | ||
| 398 | u32 scsi_get_new_index(scsi_index_t type) | ||
| 399 | { | ||
| 400 | u32 new_index; | ||
| 401 | |||
| 402 | if ((type < 0) || (type >= SCSI_INDEX_TYPE_MAX)) { | ||
| 403 | printk(KERN_ERR "Invalid index type %d\n", type); | ||
| 404 | return -EINVAL; | ||
| 405 | } | ||
| 406 | |||
| 407 | spin_lock(&scsi_index_table.lock); | ||
| 408 | new_index = ++scsi_index_table.scsi_mib_index[type]; | ||
| 409 | if (new_index == 0) | ||
| 410 | new_index = ++scsi_index_table.scsi_mib_index[type]; | ||
| 411 | spin_unlock(&scsi_index_table.lock); | ||
| 412 | |||
| 413 | return new_index; | ||
| 414 | } | ||
| 415 | |||
| 382 | void transport_init_queue_obj(struct se_queue_obj *qobj) | 416 | void transport_init_queue_obj(struct se_queue_obj *qobj) |
| 383 | { | 417 | { |
| 384 | atomic_set(&qobj->queue_cnt, 0); | 418 | atomic_set(&qobj->queue_cnt, 0); |
| @@ -437,7 +471,6 @@ struct se_session *transport_init_session(void) | |||
| 437 | } | 471 | } |
| 438 | INIT_LIST_HEAD(&se_sess->sess_list); | 472 | INIT_LIST_HEAD(&se_sess->sess_list); |
| 439 | INIT_LIST_HEAD(&se_sess->sess_acl_list); | 473 | INIT_LIST_HEAD(&se_sess->sess_acl_list); |
| 440 | atomic_set(&se_sess->mib_ref_count, 0); | ||
| 441 | 474 | ||
| 442 | return se_sess; | 475 | return se_sess; |
| 443 | } | 476 | } |
| @@ -546,12 +579,6 @@ void transport_deregister_session(struct se_session *se_sess) | |||
| 546 | transport_free_session(se_sess); | 579 | transport_free_session(se_sess); |
| 547 | return; | 580 | return; |
| 548 | } | 581 | } |
| 549 | /* | ||
| 550 | * Wait for possible reference in drivers/target/target_core_mib.c: | ||
| 551 | * scsi_att_intr_port_seq_show() | ||
| 552 | */ | ||
| 553 | while (atomic_read(&se_sess->mib_ref_count) != 0) | ||
| 554 | cpu_relax(); | ||
| 555 | 582 | ||
| 556 | spin_lock_bh(&se_tpg->session_lock); | 583 | spin_lock_bh(&se_tpg->session_lock); |
| 557 | list_del(&se_sess->sess_list); | 584 | list_del(&se_sess->sess_list); |
| @@ -574,7 +601,6 @@ void transport_deregister_session(struct se_session *se_sess) | |||
| 574 | spin_unlock_bh(&se_tpg->acl_node_lock); | 601 | spin_unlock_bh(&se_tpg->acl_node_lock); |
| 575 | 602 | ||
| 576 | core_tpg_wait_for_nacl_pr_ref(se_nacl); | 603 | core_tpg_wait_for_nacl_pr_ref(se_nacl); |
| 577 | core_tpg_wait_for_mib_ref(se_nacl); | ||
| 578 | core_free_device_list_for_node(se_nacl, se_tpg); | 604 | core_free_device_list_for_node(se_nacl, se_tpg); |
| 579 | TPG_TFO(se_tpg)->tpg_release_fabric_acl(se_tpg, | 605 | TPG_TFO(se_tpg)->tpg_release_fabric_acl(se_tpg, |
| 580 | se_nacl); | 606 | se_nacl); |
| @@ -4827,6 +4853,8 @@ static int transport_do_se_mem_map( | |||
| 4827 | 4853 | ||
| 4828 | return ret; | 4854 | return ret; |
| 4829 | } | 4855 | } |
| 4856 | |||
| 4857 | BUG_ON(list_empty(se_mem_list)); | ||
| 4830 | /* | 4858 | /* |
| 4831 | * This is the normal path for all normal non BIDI and BIDI-COMMAND | 4859 | * This is the normal path for all normal non BIDI and BIDI-COMMAND |
| 4832 | * WRITE payloads.. If we need to do BIDI READ passthrough for | 4860 | * WRITE payloads.. If we need to do BIDI READ passthrough for |
| @@ -5008,7 +5036,9 @@ transport_map_control_cmd_to_task(struct se_cmd *cmd) | |||
| 5008 | struct se_mem *se_mem = NULL, *se_mem_lout = NULL; | 5036 | struct se_mem *se_mem = NULL, *se_mem_lout = NULL; |
| 5009 | u32 se_mem_cnt = 0, task_offset = 0; | 5037 | u32 se_mem_cnt = 0, task_offset = 0; |
| 5010 | 5038 | ||
| 5011 | BUG_ON(list_empty(cmd->t_task->t_mem_list)); | 5039 | if (!list_empty(T_TASK(cmd)->t_mem_list)) |
| 5040 | se_mem = list_entry(T_TASK(cmd)->t_mem_list->next, | ||
| 5041 | struct se_mem, se_list); | ||
| 5012 | 5042 | ||
| 5013 | ret = transport_do_se_mem_map(dev, task, | 5043 | ret = transport_do_se_mem_map(dev, task, |
| 5014 | cmd->t_task->t_mem_list, NULL, se_mem, | 5044 | cmd->t_task->t_mem_list, NULL, se_mem, |
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index f7a5dba3ca23..bf7c687519ef 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | menuconfig THERMAL | 5 | menuconfig THERMAL |
| 6 | tristate "Generic Thermal sysfs driver" | 6 | tristate "Generic Thermal sysfs driver" |
| 7 | depends on NET | ||
| 8 | help | 7 | help |
| 9 | Generic Thermal Sysfs driver offers a generic mechanism for | 8 | Generic Thermal Sysfs driver offers a generic mechanism for |
| 10 | thermal management. Usually it's made up of one or more thermal | 9 | thermal management. Usually it's made up of one or more thermal |
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 7d0e63c79280..713b7ea4a607 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
| @@ -62,20 +62,6 @@ static DEFINE_MUTEX(thermal_list_lock); | |||
| 62 | 62 | ||
| 63 | static unsigned int thermal_event_seqnum; | 63 | static unsigned int thermal_event_seqnum; |
| 64 | 64 | ||
| 65 | static struct genl_family thermal_event_genl_family = { | ||
| 66 | .id = GENL_ID_GENERATE, | ||
| 67 | .name = THERMAL_GENL_FAMILY_NAME, | ||
| 68 | .version = THERMAL_GENL_VERSION, | ||
| 69 | .maxattr = THERMAL_GENL_ATTR_MAX, | ||
| 70 | }; | ||
| 71 | |||
| 72 | static struct genl_multicast_group thermal_event_mcgrp = { | ||
| 73 | .name = THERMAL_GENL_MCAST_GROUP_NAME, | ||
| 74 | }; | ||
| 75 | |||
| 76 | static int genetlink_init(void); | ||
| 77 | static void genetlink_exit(void); | ||
| 78 | |||
| 79 | static int get_idr(struct idr *idr, struct mutex *lock, int *id) | 65 | static int get_idr(struct idr *idr, struct mutex *lock, int *id) |
| 80 | { | 66 | { |
| 81 | int err; | 67 | int err; |
| @@ -1225,6 +1211,18 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) | |||
| 1225 | 1211 | ||
| 1226 | EXPORT_SYMBOL(thermal_zone_device_unregister); | 1212 | EXPORT_SYMBOL(thermal_zone_device_unregister); |
| 1227 | 1213 | ||
| 1214 | #ifdef CONFIG_NET | ||
| 1215 | static struct genl_family thermal_event_genl_family = { | ||
| 1216 | .id = GENL_ID_GENERATE, | ||
| 1217 | .name = THERMAL_GENL_FAMILY_NAME, | ||
| 1218 | .version = THERMAL_GENL_VERSION, | ||
| 1219 | .maxattr = THERMAL_GENL_ATTR_MAX, | ||
| 1220 | }; | ||
| 1221 | |||
| 1222 | static struct genl_multicast_group thermal_event_mcgrp = { | ||
| 1223 | .name = THERMAL_GENL_MCAST_GROUP_NAME, | ||
| 1224 | }; | ||
| 1225 | |||
| 1228 | int generate_netlink_event(u32 orig, enum events event) | 1226 | int generate_netlink_event(u32 orig, enum events event) |
| 1229 | { | 1227 | { |
| 1230 | struct sk_buff *skb; | 1228 | struct sk_buff *skb; |
| @@ -1301,6 +1299,15 @@ static int genetlink_init(void) | |||
| 1301 | return result; | 1299 | return result; |
| 1302 | } | 1300 | } |
| 1303 | 1301 | ||
| 1302 | static void genetlink_exit(void) | ||
| 1303 | { | ||
| 1304 | genl_unregister_family(&thermal_event_genl_family); | ||
| 1305 | } | ||
| 1306 | #else /* !CONFIG_NET */ | ||
| 1307 | static inline int genetlink_init(void) { return 0; } | ||
| 1308 | static inline void genetlink_exit(void) {} | ||
| 1309 | #endif /* !CONFIG_NET */ | ||
| 1310 | |||
| 1304 | static int __init thermal_init(void) | 1311 | static int __init thermal_init(void) |
| 1305 | { | 1312 | { |
| 1306 | int result = 0; | 1313 | int result = 0; |
| @@ -1316,11 +1323,6 @@ static int __init thermal_init(void) | |||
| 1316 | return result; | 1323 | return result; |
| 1317 | } | 1324 | } |
| 1318 | 1325 | ||
| 1319 | static void genetlink_exit(void) | ||
| 1320 | { | ||
| 1321 | genl_unregister_family(&thermal_event_genl_family); | ||
| 1322 | } | ||
| 1323 | |||
| 1324 | static void __exit thermal_exit(void) | 1326 | static void __exit thermal_exit(void) |
| 1325 | { | 1327 | { |
| 1326 | class_unregister(&thermal_class); | 1328 | class_unregister(&thermal_class); |
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index beb1afa27d8d..7b951adac54b 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c | |||
| @@ -601,7 +601,7 @@ static int max3100_startup(struct uart_port *port) | |||
| 601 | s->rts = 0; | 601 | s->rts = 0; |
| 602 | 602 | ||
| 603 | sprintf(b, "max3100-%d", s->minor); | 603 | sprintf(b, "max3100-%d", s->minor); |
| 604 | s->workqueue = create_freezeable_workqueue(b); | 604 | s->workqueue = create_freezable_workqueue(b); |
| 605 | if (!s->workqueue) { | 605 | if (!s->workqueue) { |
| 606 | dev_warn(&s->spi->dev, "cannot create workqueue\n"); | 606 | dev_warn(&s->spi->dev, "cannot create workqueue\n"); |
| 607 | return -EBUSY; | 607 | return -EBUSY; |
diff --git a/drivers/tty/serial/max3107.c b/drivers/tty/serial/max3107.c index 910870edf708..750b4f627315 100644 --- a/drivers/tty/serial/max3107.c +++ b/drivers/tty/serial/max3107.c | |||
| @@ -833,7 +833,7 @@ static int max3107_startup(struct uart_port *port) | |||
| 833 | struct max3107_port *s = container_of(port, struct max3107_port, port); | 833 | struct max3107_port *s = container_of(port, struct max3107_port, port); |
| 834 | 834 | ||
| 835 | /* Initialize work queue */ | 835 | /* Initialize work queue */ |
| 836 | s->workqueue = create_freezeable_workqueue("max3107"); | 836 | s->workqueue = create_freezable_workqueue("max3107"); |
| 837 | if (!s->workqueue) { | 837 | if (!s->workqueue) { |
| 838 | dev_err(&s->spi->dev, "Workqueue creation failed\n"); | 838 | dev_err(&s->spi->dev, "Workqueue creation failed\n"); |
| 839 | return -EBUSY; | 839 | return -EBUSY; |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d041c6826e43..0f299b7aad60 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -2681,17 +2681,13 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, | |||
| 2681 | 2681 | ||
| 2682 | mutex_lock(&usb_address0_mutex); | 2682 | mutex_lock(&usb_address0_mutex); |
| 2683 | 2683 | ||
| 2684 | if (!udev->config && oldspeed == USB_SPEED_SUPER) { | 2684 | /* Reset the device; full speed may morph to high speed */ |
| 2685 | /* Don't reset USB 3.0 devices during an initial setup */ | 2685 | /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */ |
| 2686 | usb_set_device_state(udev, USB_STATE_DEFAULT); | 2686 | retval = hub_port_reset(hub, port1, udev, delay); |
| 2687 | } else { | 2687 | if (retval < 0) /* error or disconnect */ |
| 2688 | /* Reset the device; full speed may morph to high speed */ | 2688 | goto fail; |
| 2689 | /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */ | 2689 | /* success, speed is known */ |
| 2690 | retval = hub_port_reset(hub, port1, udev, delay); | 2690 | |
| 2691 | if (retval < 0) /* error or disconnect */ | ||
| 2692 | goto fail; | ||
| 2693 | /* success, speed is known */ | ||
| 2694 | } | ||
| 2695 | retval = -ENODEV; | 2691 | retval = -ENODEV; |
| 2696 | 2692 | ||
| 2697 | if (oldspeed != USB_SPEED_UNKNOWN && oldspeed != udev->speed) { | 2693 | if (oldspeed != USB_SPEED_UNKNOWN && oldspeed != udev->speed) { |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 44c595432d6f..81ce6a8e1d94 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
| @@ -48,6 +48,10 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
| 48 | { USB_DEVICE(0x04b4, 0x0526), .driver_info = | 48 | { USB_DEVICE(0x04b4, 0x0526), .driver_info = |
| 49 | USB_QUIRK_CONFIG_INTF_STRINGS }, | 49 | USB_QUIRK_CONFIG_INTF_STRINGS }, |
| 50 | 50 | ||
| 51 | /* Samsung Android phone modem - ID conflict with SPH-I500 */ | ||
| 52 | { USB_DEVICE(0x04e8, 0x6601), .driver_info = | ||
| 53 | USB_QUIRK_CONFIG_INTF_STRINGS }, | ||
| 54 | |||
| 51 | /* Roland SC-8820 */ | 55 | /* Roland SC-8820 */ |
| 52 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, | 56 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, |
| 53 | 57 | ||
| @@ -68,6 +72,10 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
| 68 | /* M-Systems Flash Disk Pioneers */ | 72 | /* M-Systems Flash Disk Pioneers */ |
| 69 | { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, | 73 | { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, |
| 70 | 74 | ||
| 75 | /* Keytouch QWERTY Panel keyboard */ | ||
| 76 | { USB_DEVICE(0x0926, 0x3333), .driver_info = | ||
| 77 | USB_QUIRK_CONFIG_INTF_STRINGS }, | ||
| 78 | |||
| 71 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ | 79 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ |
| 72 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, | 80 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, |
| 73 | 81 | ||
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c index fcbf4abbf381..0231814a97a5 100644 --- a/drivers/usb/host/xhci-dbg.c +++ b/drivers/usb/host/xhci-dbg.c | |||
| @@ -169,9 +169,10 @@ static void xhci_print_ports(struct xhci_hcd *xhci) | |||
| 169 | } | 169 | } |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num) | 172 | void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num) |
| 173 | { | 173 | { |
| 174 | void *addr; | 174 | struct xhci_intr_reg __iomem *ir_set = &xhci->run_regs->ir_set[set_num]; |
| 175 | void __iomem *addr; | ||
| 175 | u32 temp; | 176 | u32 temp; |
| 176 | u64 temp_64; | 177 | u64 temp_64; |
| 177 | 178 | ||
| @@ -449,7 +450,7 @@ char *xhci_get_slot_state(struct xhci_hcd *xhci, | |||
| 449 | } | 450 | } |
| 450 | } | 451 | } |
| 451 | 452 | ||
| 452 | void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) | 453 | static void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) |
| 453 | { | 454 | { |
| 454 | /* Fields are 32 bits wide, DMA addresses are in bytes */ | 455 | /* Fields are 32 bits wide, DMA addresses are in bytes */ |
| 455 | int field_size = 32 / 8; | 456 | int field_size = 32 / 8; |
| @@ -488,7 +489,7 @@ void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) | |||
| 488 | dbg_rsvd64(xhci, (u64 *)slot_ctx, dma); | 489 | dbg_rsvd64(xhci, (u64 *)slot_ctx, dma); |
| 489 | } | 490 | } |
| 490 | 491 | ||
| 491 | void xhci_dbg_ep_ctx(struct xhci_hcd *xhci, | 492 | static void xhci_dbg_ep_ctx(struct xhci_hcd *xhci, |
| 492 | struct xhci_container_ctx *ctx, | 493 | struct xhci_container_ctx *ctx, |
| 493 | unsigned int last_ep) | 494 | unsigned int last_ep) |
| 494 | { | 495 | { |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 1d0f45f0e7a6..a9534396e85b 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
| @@ -307,7 +307,7 @@ struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, | |||
| 307 | 307 | ||
| 308 | /***************** Streams structures manipulation *************************/ | 308 | /***************** Streams structures manipulation *************************/ |
| 309 | 309 | ||
| 310 | void xhci_free_stream_ctx(struct xhci_hcd *xhci, | 310 | static void xhci_free_stream_ctx(struct xhci_hcd *xhci, |
| 311 | unsigned int num_stream_ctxs, | 311 | unsigned int num_stream_ctxs, |
| 312 | struct xhci_stream_ctx *stream_ctx, dma_addr_t dma) | 312 | struct xhci_stream_ctx *stream_ctx, dma_addr_t dma) |
| 313 | { | 313 | { |
| @@ -335,7 +335,7 @@ void xhci_free_stream_ctx(struct xhci_hcd *xhci, | |||
| 335 | * The stream context array must be a power of 2, and can be as small as | 335 | * The stream context array must be a power of 2, and can be as small as |
| 336 | * 64 bytes or as large as 1MB. | 336 | * 64 bytes or as large as 1MB. |
| 337 | */ | 337 | */ |
| 338 | struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, | 338 | static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, |
| 339 | unsigned int num_stream_ctxs, dma_addr_t *dma, | 339 | unsigned int num_stream_ctxs, dma_addr_t *dma, |
| 340 | gfp_t mem_flags) | 340 | gfp_t mem_flags) |
| 341 | { | 341 | { |
| @@ -1900,11 +1900,11 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
| 1900 | val &= DBOFF_MASK; | 1900 | val &= DBOFF_MASK; |
| 1901 | xhci_dbg(xhci, "// Doorbell array is located at offset 0x%x" | 1901 | xhci_dbg(xhci, "// Doorbell array is located at offset 0x%x" |
| 1902 | " from cap regs base addr\n", val); | 1902 | " from cap regs base addr\n", val); |
| 1903 | xhci->dba = (void *) xhci->cap_regs + val; | 1903 | xhci->dba = (void __iomem *) xhci->cap_regs + val; |
| 1904 | xhci_dbg_regs(xhci); | 1904 | xhci_dbg_regs(xhci); |
| 1905 | xhci_print_run_regs(xhci); | 1905 | xhci_print_run_regs(xhci); |
| 1906 | /* Set ir_set to interrupt register set 0 */ | 1906 | /* Set ir_set to interrupt register set 0 */ |
| 1907 | xhci->ir_set = (void *) xhci->run_regs->ir_set; | 1907 | xhci->ir_set = &xhci->run_regs->ir_set[0]; |
| 1908 | 1908 | ||
| 1909 | /* | 1909 | /* |
| 1910 | * Event ring setup: Allocate a normal ring, but also setup | 1910 | * Event ring setup: Allocate a normal ring, but also setup |
| @@ -1961,7 +1961,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
| 1961 | /* Set the event ring dequeue address */ | 1961 | /* Set the event ring dequeue address */ |
| 1962 | xhci_set_hc_event_deq(xhci); | 1962 | xhci_set_hc_event_deq(xhci); |
| 1963 | xhci_dbg(xhci, "Wrote ERST address to ir_set 0.\n"); | 1963 | xhci_dbg(xhci, "Wrote ERST address to ir_set 0.\n"); |
| 1964 | xhci_print_ir_set(xhci, xhci->ir_set, 0); | 1964 | xhci_print_ir_set(xhci, 0); |
| 1965 | 1965 | ||
| 1966 | /* | 1966 | /* |
| 1967 | * XXX: Might need to set the Interrupter Moderation Register to | 1967 | * XXX: Might need to set the Interrupter Moderation Register to |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 3e8211c1ce5a..3289bf4832c9 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
| @@ -474,8 +474,11 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, | |||
| 474 | state->new_deq_seg = find_trb_seg(cur_td->start_seg, | 474 | state->new_deq_seg = find_trb_seg(cur_td->start_seg, |
| 475 | dev->eps[ep_index].stopped_trb, | 475 | dev->eps[ep_index].stopped_trb, |
| 476 | &state->new_cycle_state); | 476 | &state->new_cycle_state); |
| 477 | if (!state->new_deq_seg) | 477 | if (!state->new_deq_seg) { |
| 478 | BUG(); | 478 | WARN_ON(1); |
| 479 | return; | ||
| 480 | } | ||
| 481 | |||
| 479 | /* Dig out the cycle state saved by the xHC during the stop ep cmd */ | 482 | /* Dig out the cycle state saved by the xHC during the stop ep cmd */ |
| 480 | xhci_dbg(xhci, "Finding endpoint context\n"); | 483 | xhci_dbg(xhci, "Finding endpoint context\n"); |
| 481 | ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); | 484 | ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); |
| @@ -486,8 +489,10 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, | |||
| 486 | state->new_deq_seg = find_trb_seg(state->new_deq_seg, | 489 | state->new_deq_seg = find_trb_seg(state->new_deq_seg, |
| 487 | state->new_deq_ptr, | 490 | state->new_deq_ptr, |
| 488 | &state->new_cycle_state); | 491 | &state->new_cycle_state); |
| 489 | if (!state->new_deq_seg) | 492 | if (!state->new_deq_seg) { |
| 490 | BUG(); | 493 | WARN_ON(1); |
| 494 | return; | ||
| 495 | } | ||
| 491 | 496 | ||
| 492 | trb = &state->new_deq_ptr->generic; | 497 | trb = &state->new_deq_ptr->generic; |
| 493 | if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) && | 498 | if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) && |
| @@ -2363,12 +2368,13 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb) | |||
| 2363 | 2368 | ||
| 2364 | /* Scatter gather list entries may cross 64KB boundaries */ | 2369 | /* Scatter gather list entries may cross 64KB boundaries */ |
| 2365 | running_total = TRB_MAX_BUFF_SIZE - | 2370 | running_total = TRB_MAX_BUFF_SIZE - |
| 2366 | (sg_dma_address(sg) & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); | 2371 | (sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1)); |
| 2372 | running_total &= TRB_MAX_BUFF_SIZE - 1; | ||
| 2367 | if (running_total != 0) | 2373 | if (running_total != 0) |
| 2368 | num_trbs++; | 2374 | num_trbs++; |
| 2369 | 2375 | ||
| 2370 | /* How many more 64KB chunks to transfer, how many more TRBs? */ | 2376 | /* How many more 64KB chunks to transfer, how many more TRBs? */ |
| 2371 | while (running_total < sg_dma_len(sg)) { | 2377 | while (running_total < sg_dma_len(sg) && running_total < temp) { |
| 2372 | num_trbs++; | 2378 | num_trbs++; |
| 2373 | running_total += TRB_MAX_BUFF_SIZE; | 2379 | running_total += TRB_MAX_BUFF_SIZE; |
| 2374 | } | 2380 | } |
| @@ -2394,11 +2400,11 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb) | |||
| 2394 | static void check_trb_math(struct urb *urb, int num_trbs, int running_total) | 2400 | static void check_trb_math(struct urb *urb, int num_trbs, int running_total) |
| 2395 | { | 2401 | { |
| 2396 | if (num_trbs != 0) | 2402 | if (num_trbs != 0) |
| 2397 | dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated number of " | 2403 | dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated number of " |
| 2398 | "TRBs, %d left\n", __func__, | 2404 | "TRBs, %d left\n", __func__, |
| 2399 | urb->ep->desc.bEndpointAddress, num_trbs); | 2405 | urb->ep->desc.bEndpointAddress, num_trbs); |
| 2400 | if (running_total != urb->transfer_buffer_length) | 2406 | if (running_total != urb->transfer_buffer_length) |
| 2401 | dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, " | 2407 | dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, " |
| 2402 | "queued %#x (%d), asked for %#x (%d)\n", | 2408 | "queued %#x (%d), asked for %#x (%d)\n", |
| 2403 | __func__, | 2409 | __func__, |
| 2404 | urb->ep->desc.bEndpointAddress, | 2410 | urb->ep->desc.bEndpointAddress, |
| @@ -2533,8 +2539,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2533 | sg = urb->sg; | 2539 | sg = urb->sg; |
| 2534 | addr = (u64) sg_dma_address(sg); | 2540 | addr = (u64) sg_dma_address(sg); |
| 2535 | this_sg_len = sg_dma_len(sg); | 2541 | this_sg_len = sg_dma_len(sg); |
| 2536 | trb_buff_len = TRB_MAX_BUFF_SIZE - | 2542 | trb_buff_len = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1)); |
| 2537 | (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); | ||
| 2538 | trb_buff_len = min_t(int, trb_buff_len, this_sg_len); | 2543 | trb_buff_len = min_t(int, trb_buff_len, this_sg_len); |
| 2539 | if (trb_buff_len > urb->transfer_buffer_length) | 2544 | if (trb_buff_len > urb->transfer_buffer_length) |
| 2540 | trb_buff_len = urb->transfer_buffer_length; | 2545 | trb_buff_len = urb->transfer_buffer_length; |
| @@ -2572,7 +2577,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2572 | (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), | 2577 | (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), |
| 2573 | (unsigned int) addr + trb_buff_len); | 2578 | (unsigned int) addr + trb_buff_len); |
| 2574 | if (TRB_MAX_BUFF_SIZE - | 2579 | if (TRB_MAX_BUFF_SIZE - |
| 2575 | (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)) < trb_buff_len) { | 2580 | (addr & (TRB_MAX_BUFF_SIZE - 1)) < trb_buff_len) { |
| 2576 | xhci_warn(xhci, "WARN: sg dma xfer crosses 64KB boundaries!\n"); | 2581 | xhci_warn(xhci, "WARN: sg dma xfer crosses 64KB boundaries!\n"); |
| 2577 | xhci_dbg(xhci, "Next boundary at %#x, end dma = %#x\n", | 2582 | xhci_dbg(xhci, "Next boundary at %#x, end dma = %#x\n", |
| 2578 | (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), | 2583 | (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), |
| @@ -2616,7 +2621,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2616 | } | 2621 | } |
| 2617 | 2622 | ||
| 2618 | trb_buff_len = TRB_MAX_BUFF_SIZE - | 2623 | trb_buff_len = TRB_MAX_BUFF_SIZE - |
| 2619 | (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); | 2624 | (addr & (TRB_MAX_BUFF_SIZE - 1)); |
| 2620 | trb_buff_len = min_t(int, trb_buff_len, this_sg_len); | 2625 | trb_buff_len = min_t(int, trb_buff_len, this_sg_len); |
| 2621 | if (running_total + trb_buff_len > urb->transfer_buffer_length) | 2626 | if (running_total + trb_buff_len > urb->transfer_buffer_length) |
| 2622 | trb_buff_len = | 2627 | trb_buff_len = |
| @@ -2656,7 +2661,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2656 | num_trbs = 0; | 2661 | num_trbs = 0; |
| 2657 | /* How much data is (potentially) left before the 64KB boundary? */ | 2662 | /* How much data is (potentially) left before the 64KB boundary? */ |
| 2658 | running_total = TRB_MAX_BUFF_SIZE - | 2663 | running_total = TRB_MAX_BUFF_SIZE - |
| 2659 | (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); | 2664 | (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1)); |
| 2665 | running_total &= TRB_MAX_BUFF_SIZE - 1; | ||
| 2660 | 2666 | ||
| 2661 | /* If there's some data on this 64KB chunk, or we have to send a | 2667 | /* If there's some data on this 64KB chunk, or we have to send a |
| 2662 | * zero-length transfer, we need at least one TRB | 2668 | * zero-length transfer, we need at least one TRB |
| @@ -2700,8 +2706,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, | |||
| 2700 | /* How much data is in the first TRB? */ | 2706 | /* How much data is in the first TRB? */ |
| 2701 | addr = (u64) urb->transfer_dma; | 2707 | addr = (u64) urb->transfer_dma; |
| 2702 | trb_buff_len = TRB_MAX_BUFF_SIZE - | 2708 | trb_buff_len = TRB_MAX_BUFF_SIZE - |
| 2703 | (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); | 2709 | (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1)); |
| 2704 | if (urb->transfer_buffer_length < trb_buff_len) | 2710 | if (trb_buff_len > urb->transfer_buffer_length) |
| 2705 | trb_buff_len = urb->transfer_buffer_length; | 2711 | trb_buff_len = urb->transfer_buffer_length; |
| 2706 | 2712 | ||
| 2707 | first_trb = true; | 2713 | first_trb = true; |
| @@ -2879,8 +2885,8 @@ static int count_isoc_trbs_needed(struct xhci_hcd *xhci, | |||
| 2879 | addr = (u64) (urb->transfer_dma + urb->iso_frame_desc[i].offset); | 2885 | addr = (u64) (urb->transfer_dma + urb->iso_frame_desc[i].offset); |
| 2880 | td_len = urb->iso_frame_desc[i].length; | 2886 | td_len = urb->iso_frame_desc[i].length; |
| 2881 | 2887 | ||
| 2882 | running_total = TRB_MAX_BUFF_SIZE - | 2888 | running_total = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1)); |
| 2883 | (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); | 2889 | running_total &= TRB_MAX_BUFF_SIZE - 1; |
| 2884 | if (running_total != 0) | 2890 | if (running_total != 0) |
| 2885 | num_trbs++; | 2891 | num_trbs++; |
| 2886 | 2892 | ||
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 34cf4e165877..2083fc2179b2 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -109,7 +109,7 @@ int xhci_halt(struct xhci_hcd *xhci) | |||
| 109 | /* | 109 | /* |
| 110 | * Set the run bit and wait for the host to be running. | 110 | * Set the run bit and wait for the host to be running. |
| 111 | */ | 111 | */ |
| 112 | int xhci_start(struct xhci_hcd *xhci) | 112 | static int xhci_start(struct xhci_hcd *xhci) |
| 113 | { | 113 | { |
| 114 | u32 temp; | 114 | u32 temp; |
| 115 | int ret; | 115 | int ret; |
| @@ -329,7 +329,7 @@ int xhci_init(struct usb_hcd *hcd) | |||
| 329 | 329 | ||
| 330 | 330 | ||
| 331 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING | 331 | #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING |
| 332 | void xhci_event_ring_work(unsigned long arg) | 332 | static void xhci_event_ring_work(unsigned long arg) |
| 333 | { | 333 | { |
| 334 | unsigned long flags; | 334 | unsigned long flags; |
| 335 | int temp; | 335 | int temp; |
| @@ -473,7 +473,7 @@ int xhci_run(struct usb_hcd *hcd) | |||
| 473 | xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp)); | 473 | xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp)); |
| 474 | xhci_writel(xhci, ER_IRQ_ENABLE(temp), | 474 | xhci_writel(xhci, ER_IRQ_ENABLE(temp), |
| 475 | &xhci->ir_set->irq_pending); | 475 | &xhci->ir_set->irq_pending); |
| 476 | xhci_print_ir_set(xhci, xhci->ir_set, 0); | 476 | xhci_print_ir_set(xhci, 0); |
| 477 | 477 | ||
| 478 | if (NUM_TEST_NOOPS > 0) | 478 | if (NUM_TEST_NOOPS > 0) |
| 479 | doorbell = xhci_setup_one_noop(xhci); | 479 | doorbell = xhci_setup_one_noop(xhci); |
| @@ -528,7 +528,7 @@ void xhci_stop(struct usb_hcd *hcd) | |||
| 528 | temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); | 528 | temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); |
| 529 | xhci_writel(xhci, ER_IRQ_DISABLE(temp), | 529 | xhci_writel(xhci, ER_IRQ_DISABLE(temp), |
| 530 | &xhci->ir_set->irq_pending); | 530 | &xhci->ir_set->irq_pending); |
| 531 | xhci_print_ir_set(xhci, xhci->ir_set, 0); | 531 | xhci_print_ir_set(xhci, 0); |
| 532 | 532 | ||
| 533 | xhci_dbg(xhci, "cleaning up memory\n"); | 533 | xhci_dbg(xhci, "cleaning up memory\n"); |
| 534 | xhci_mem_cleanup(xhci); | 534 | xhci_mem_cleanup(xhci); |
| @@ -755,7 +755,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
| 755 | temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); | 755 | temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); |
| 756 | xhci_writel(xhci, ER_IRQ_DISABLE(temp), | 756 | xhci_writel(xhci, ER_IRQ_DISABLE(temp), |
| 757 | &xhci->ir_set->irq_pending); | 757 | &xhci->ir_set->irq_pending); |
| 758 | xhci_print_ir_set(xhci, xhci->ir_set, 0); | 758 | xhci_print_ir_set(xhci, 0); |
| 759 | 759 | ||
| 760 | xhci_dbg(xhci, "cleaning up memory\n"); | 760 | xhci_dbg(xhci, "cleaning up memory\n"); |
| 761 | xhci_mem_cleanup(xhci); | 761 | xhci_mem_cleanup(xhci); |
| @@ -857,7 +857,7 @@ unsigned int xhci_last_valid_endpoint(u32 added_ctxs) | |||
| 857 | /* Returns 1 if the arguments are OK; | 857 | /* Returns 1 if the arguments are OK; |
| 858 | * returns 0 this is a root hub; returns -EINVAL for NULL pointers. | 858 | * returns 0 this is a root hub; returns -EINVAL for NULL pointers. |
| 859 | */ | 859 | */ |
| 860 | int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, | 860 | static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, |
| 861 | struct usb_host_endpoint *ep, int check_ep, bool check_virt_dev, | 861 | struct usb_host_endpoint *ep, int check_ep, bool check_virt_dev, |
| 862 | const char *func) { | 862 | const char *func) { |
| 863 | struct xhci_hcd *xhci; | 863 | struct xhci_hcd *xhci; |
| @@ -1693,7 +1693,7 @@ static void xhci_setup_input_ctx_for_config_ep(struct xhci_hcd *xhci, | |||
| 1693 | xhci_dbg_ctx(xhci, in_ctx, xhci_last_valid_endpoint(add_flags)); | 1693 | xhci_dbg_ctx(xhci, in_ctx, xhci_last_valid_endpoint(add_flags)); |
| 1694 | } | 1694 | } |
| 1695 | 1695 | ||
| 1696 | void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, | 1696 | static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, |
| 1697 | unsigned int slot_id, unsigned int ep_index, | 1697 | unsigned int slot_id, unsigned int ep_index, |
| 1698 | struct xhci_dequeue_state *deq_state) | 1698 | struct xhci_dequeue_state *deq_state) |
| 1699 | { | 1699 | { |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 7f236fd22015..7f127df6dd55 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -1348,7 +1348,7 @@ static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci) | |||
| 1348 | } | 1348 | } |
| 1349 | 1349 | ||
| 1350 | /* xHCI debugging */ | 1350 | /* xHCI debugging */ |
| 1351 | void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num); | 1351 | void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num); |
| 1352 | void xhci_print_registers(struct xhci_hcd *xhci); | 1352 | void xhci_print_registers(struct xhci_hcd *xhci); |
| 1353 | void xhci_dbg_regs(struct xhci_hcd *xhci); | 1353 | void xhci_dbg_regs(struct xhci_hcd *xhci); |
| 1354 | void xhci_print_run_regs(struct xhci_hcd *xhci); | 1354 | void xhci_print_run_regs(struct xhci_hcd *xhci); |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 538fafa05b46..e550f35eff0f 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
| @@ -1864,6 +1864,7 @@ allocate_instance(struct device *dev, | |||
| 1864 | INIT_LIST_HEAD(&musb->out_bulk); | 1864 | INIT_LIST_HEAD(&musb->out_bulk); |
| 1865 | 1865 | ||
| 1866 | hcd->uses_new_polling = 1; | 1866 | hcd->uses_new_polling = 1; |
| 1867 | hcd->has_tt = 1; | ||
| 1867 | 1868 | ||
| 1868 | musb->vbuserr_retry = VBUSERR_RETRY_COUNT; | 1869 | musb->vbuserr_retry = VBUSERR_RETRY_COUNT; |
| 1869 | musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; | 1870 | musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 07075c39a3d5..3fb617ef9e72 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
| @@ -488,6 +488,15 @@ struct musb { | |||
| 488 | unsigned set_address:1; | 488 | unsigned set_address:1; |
| 489 | unsigned test_mode:1; | 489 | unsigned test_mode:1; |
| 490 | unsigned softconnect:1; | 490 | unsigned softconnect:1; |
| 491 | |||
| 492 | u8 address; | ||
| 493 | u8 test_mode_nr; | ||
| 494 | u16 ackpend; /* ep0 */ | ||
| 495 | enum musb_g_ep0_state ep0_state; | ||
| 496 | struct usb_gadget g; /* the gadget */ | ||
| 497 | struct usb_gadget_driver *gadget_driver; /* its driver */ | ||
| 498 | #endif | ||
| 499 | |||
| 491 | /* | 500 | /* |
| 492 | * FIXME: Remove this flag. | 501 | * FIXME: Remove this flag. |
| 493 | * | 502 | * |
| @@ -501,14 +510,6 @@ struct musb { | |||
| 501 | */ | 510 | */ |
| 502 | unsigned double_buffer_not_ok:1 __deprecated; | 511 | unsigned double_buffer_not_ok:1 __deprecated; |
| 503 | 512 | ||
| 504 | u8 address; | ||
| 505 | u8 test_mode_nr; | ||
| 506 | u16 ackpend; /* ep0 */ | ||
| 507 | enum musb_g_ep0_state ep0_state; | ||
| 508 | struct usb_gadget g; /* the gadget */ | ||
| 509 | struct usb_gadget_driver *gadget_driver; /* its driver */ | ||
| 510 | #endif | ||
| 511 | |||
| 512 | struct musb_hdrc_config *config; | 513 | struct musb_hdrc_config *config; |
| 513 | 514 | ||
| 514 | #ifdef MUSB_CONFIG_PROC_FS | 515 | #ifdef MUSB_CONFIG_PROC_FS |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index a3f12333fc41..bc8badd16897 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
| @@ -362,6 +362,7 @@ static int omap2430_musb_init(struct musb *musb) | |||
| 362 | 362 | ||
| 363 | static int omap2430_musb_exit(struct musb *musb) | 363 | static int omap2430_musb_exit(struct musb *musb) |
| 364 | { | 364 | { |
| 365 | del_timer_sync(&musb_idle_timer); | ||
| 365 | 366 | ||
| 366 | omap2430_low_level_exit(musb); | 367 | omap2430_low_level_exit(musb); |
| 367 | otg_put_transceiver(musb->xceiv); | 368 | otg_put_transceiver(musb->xceiv); |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 7481ff8a49e4..0457813eebee 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
| @@ -301,6 +301,9 @@ static const struct usb_device_id id_table[] = { | |||
| 301 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ | 301 | { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ |
| 302 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | 302 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist |
| 303 | }, | 303 | }, |
| 304 | { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ | ||
| 305 | .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist | ||
| 306 | }, | ||
| 304 | { USB_DEVICE(0x413C, 0x08133) }, /* Dell Computer Corp. Wireless 5720 VZW Mobile Broadband (EVDO Rev-A) Minicard GPS Port */ | 307 | { USB_DEVICE(0x413C, 0x08133) }, /* Dell Computer Corp. Wireless 5720 VZW Mobile Broadband (EVDO Rev-A) Minicard GPS Port */ |
| 305 | 308 | ||
| 306 | { } | 309 | { } |
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index b004b2a485c3..9c014e2ecd68 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c | |||
| @@ -295,12 +295,15 @@ static void usb_wwan_indat_callback(struct urb *urb) | |||
| 295 | __func__, status, endpoint); | 295 | __func__, status, endpoint); |
| 296 | } else { | 296 | } else { |
| 297 | tty = tty_port_tty_get(&port->port); | 297 | tty = tty_port_tty_get(&port->port); |
| 298 | if (urb->actual_length) { | 298 | if (tty) { |
| 299 | tty_insert_flip_string(tty, data, urb->actual_length); | 299 | if (urb->actual_length) { |
| 300 | tty_flip_buffer_push(tty); | 300 | tty_insert_flip_string(tty, data, |
| 301 | } else | 301 | urb->actual_length); |
| 302 | dbg("%s: empty read urb received", __func__); | 302 | tty_flip_buffer_push(tty); |
| 303 | tty_kref_put(tty); | 303 | } else |
| 304 | dbg("%s: empty read urb received", __func__); | ||
| 305 | tty_kref_put(tty); | ||
| 306 | } | ||
| 304 | 307 | ||
| 305 | /* Resubmit urb so we continue receiving */ | 308 | /* Resubmit urb so we continue receiving */ |
| 306 | if (status != -ESHUTDOWN) { | 309 | if (status != -ESHUTDOWN) { |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 15a5d89b7f39..1c11959a7d58 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/uaccess.h> | 27 | #include <linux/uaccess.h> |
| 28 | #include <linux/usb.h> | 28 | #include <linux/usb.h> |
| 29 | #include <linux/usb/serial.h> | 29 | #include <linux/usb/serial.h> |
| 30 | #include <linux/usb/cdc.h> | ||
| 30 | #include "visor.h" | 31 | #include "visor.h" |
| 31 | 32 | ||
| 32 | /* | 33 | /* |
| @@ -479,6 +480,17 @@ static int visor_probe(struct usb_serial *serial, | |||
| 479 | 480 | ||
| 480 | dbg("%s", __func__); | 481 | dbg("%s", __func__); |
| 481 | 482 | ||
| 483 | /* | ||
| 484 | * some Samsung Android phones in modem mode have the same ID | ||
| 485 | * as SPH-I500, but they are ACM devices, so dont bind to them | ||
| 486 | */ | ||
| 487 | if (id->idVendor == SAMSUNG_VENDOR_ID && | ||
| 488 | id->idProduct == SAMSUNG_SPH_I500_ID && | ||
| 489 | serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM && | ||
| 490 | serial->dev->descriptor.bDeviceSubClass == | ||
| 491 | USB_CDC_SUBCLASS_ACM) | ||
| 492 | return -ENODEV; | ||
| 493 | |||
| 482 | if (serial->dev->actconfig->desc.bConfigurationValue != 1) { | 494 | if (serial->dev->actconfig->desc.bConfigurationValue != 1) { |
| 483 | dev_err(&serial->dev->dev, "active config #%d != 1 ??\n", | 495 | dev_err(&serial->dev->dev, "active config #%d != 1 ??\n", |
| 484 | serial->dev->actconfig->desc.bConfigurationValue); | 496 | serial->dev->actconfig->desc.bConfigurationValue); |
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 3dd4971160ef..2b4acb86c191 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
| @@ -124,6 +124,8 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev) | |||
| 124 | u32 pre_margin = GET_WLDR_VAL(timer_margin); | 124 | u32 pre_margin = GET_WLDR_VAL(timer_margin); |
| 125 | void __iomem *base = wdev->base; | 125 | void __iomem *base = wdev->base; |
| 126 | 126 | ||
| 127 | pm_runtime_get_sync(wdev->dev); | ||
| 128 | |||
| 127 | /* just count up at 32 KHz */ | 129 | /* just count up at 32 KHz */ |
| 128 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) | 130 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) |
| 129 | cpu_relax(); | 131 | cpu_relax(); |
| @@ -131,6 +133,8 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev) | |||
| 131 | __raw_writel(pre_margin, base + OMAP_WATCHDOG_LDR); | 133 | __raw_writel(pre_margin, base + OMAP_WATCHDOG_LDR); |
| 132 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) | 134 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) |
| 133 | cpu_relax(); | 135 | cpu_relax(); |
| 136 | |||
| 137 | pm_runtime_put_sync(wdev->dev); | ||
| 134 | } | 138 | } |
| 135 | 139 | ||
| 136 | /* | 140 | /* |
| @@ -160,6 +164,8 @@ static int omap_wdt_open(struct inode *inode, struct file *file) | |||
| 160 | omap_wdt_ping(wdev); /* trigger loading of new timeout value */ | 164 | omap_wdt_ping(wdev); /* trigger loading of new timeout value */ |
| 161 | omap_wdt_enable(wdev); | 165 | omap_wdt_enable(wdev); |
| 162 | 166 | ||
| 167 | pm_runtime_put_sync(wdev->dev); | ||
| 168 | |||
| 163 | return nonseekable_open(inode, file); | 169 | return nonseekable_open(inode, file); |
| 164 | } | 170 | } |
| 165 | 171 | ||
| @@ -171,6 +177,7 @@ static int omap_wdt_release(struct inode *inode, struct file *file) | |||
| 171 | * Shut off the timer unless NOWAYOUT is defined. | 177 | * Shut off the timer unless NOWAYOUT is defined. |
| 172 | */ | 178 | */ |
| 173 | #ifndef CONFIG_WATCHDOG_NOWAYOUT | 179 | #ifndef CONFIG_WATCHDOG_NOWAYOUT |
| 180 | pm_runtime_get_sync(wdev->dev); | ||
| 174 | 181 | ||
| 175 | omap_wdt_disable(wdev); | 182 | omap_wdt_disable(wdev); |
| 176 | 183 | ||
| @@ -190,9 +197,11 @@ static ssize_t omap_wdt_write(struct file *file, const char __user *data, | |||
| 190 | 197 | ||
| 191 | /* Refresh LOAD_TIME. */ | 198 | /* Refresh LOAD_TIME. */ |
| 192 | if (len) { | 199 | if (len) { |
| 200 | pm_runtime_get_sync(wdev->dev); | ||
| 193 | spin_lock(&wdt_lock); | 201 | spin_lock(&wdt_lock); |
| 194 | omap_wdt_ping(wdev); | 202 | omap_wdt_ping(wdev); |
| 195 | spin_unlock(&wdt_lock); | 203 | spin_unlock(&wdt_lock); |
| 204 | pm_runtime_put_sync(wdev->dev); | ||
| 196 | } | 205 | } |
| 197 | return len; | 206 | return len; |
| 198 | } | 207 | } |
| @@ -224,15 +233,18 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | |||
| 224 | return put_user(omap_prcm_get_reset_sources(), | 233 | return put_user(omap_prcm_get_reset_sources(), |
| 225 | (int __user *)arg); | 234 | (int __user *)arg); |
| 226 | case WDIOC_KEEPALIVE: | 235 | case WDIOC_KEEPALIVE: |
| 236 | pm_runtime_get_sync(wdev->dev); | ||
| 227 | spin_lock(&wdt_lock); | 237 | spin_lock(&wdt_lock); |
| 228 | omap_wdt_ping(wdev); | 238 | omap_wdt_ping(wdev); |
| 229 | spin_unlock(&wdt_lock); | 239 | spin_unlock(&wdt_lock); |
| 240 | pm_runtime_put_sync(wdev->dev); | ||
| 230 | return 0; | 241 | return 0; |
| 231 | case WDIOC_SETTIMEOUT: | 242 | case WDIOC_SETTIMEOUT: |
| 232 | if (get_user(new_margin, (int __user *)arg)) | 243 | if (get_user(new_margin, (int __user *)arg)) |
| 233 | return -EFAULT; | 244 | return -EFAULT; |
| 234 | omap_wdt_adjust_timeout(new_margin); | 245 | omap_wdt_adjust_timeout(new_margin); |
| 235 | 246 | ||
| 247 | pm_runtime_get_sync(wdev->dev); | ||
| 236 | spin_lock(&wdt_lock); | 248 | spin_lock(&wdt_lock); |
| 237 | omap_wdt_disable(wdev); | 249 | omap_wdt_disable(wdev); |
| 238 | omap_wdt_set_timeout(wdev); | 250 | omap_wdt_set_timeout(wdev); |
| @@ -240,6 +252,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | |||
| 240 | 252 | ||
| 241 | omap_wdt_ping(wdev); | 253 | omap_wdt_ping(wdev); |
| 242 | spin_unlock(&wdt_lock); | 254 | spin_unlock(&wdt_lock); |
| 255 | pm_runtime_put_sync(wdev->dev); | ||
| 243 | /* Fall */ | 256 | /* Fall */ |
| 244 | case WDIOC_GETTIMEOUT: | 257 | case WDIOC_GETTIMEOUT: |
| 245 | return put_user(timer_margin, (int __user *)arg); | 258 | return put_user(timer_margin, (int __user *)arg); |
| @@ -345,8 +358,11 @@ static void omap_wdt_shutdown(struct platform_device *pdev) | |||
| 345 | { | 358 | { |
| 346 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 359 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); |
| 347 | 360 | ||
| 348 | if (wdev->omap_wdt_users) | 361 | if (wdev->omap_wdt_users) { |
| 362 | pm_runtime_get_sync(wdev->dev); | ||
| 349 | omap_wdt_disable(wdev); | 363 | omap_wdt_disable(wdev); |
| 364 | pm_runtime_put_sync(wdev->dev); | ||
| 365 | } | ||
| 350 | } | 366 | } |
| 351 | 367 | ||
| 352 | static int __devexit omap_wdt_remove(struct platform_device *pdev) | 368 | static int __devexit omap_wdt_remove(struct platform_device *pdev) |
| @@ -381,8 +397,11 @@ static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 381 | { | 397 | { |
| 382 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 398 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); |
| 383 | 399 | ||
| 384 | if (wdev->omap_wdt_users) | 400 | if (wdev->omap_wdt_users) { |
| 401 | pm_runtime_get_sync(wdev->dev); | ||
| 385 | omap_wdt_disable(wdev); | 402 | omap_wdt_disable(wdev); |
| 403 | pm_runtime_put_sync(wdev->dev); | ||
| 404 | } | ||
| 386 | 405 | ||
| 387 | return 0; | 406 | return 0; |
| 388 | } | 407 | } |
| @@ -392,8 +411,10 @@ static int omap_wdt_resume(struct platform_device *pdev) | |||
| 392 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 411 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); |
| 393 | 412 | ||
| 394 | if (wdev->omap_wdt_users) { | 413 | if (wdev->omap_wdt_users) { |
| 414 | pm_runtime_get_sync(wdev->dev); | ||
| 395 | omap_wdt_enable(wdev); | 415 | omap_wdt_enable(wdev); |
| 396 | omap_wdt_ping(wdev); | 416 | omap_wdt_ping(wdev); |
| 417 | pm_runtime_put_sync(wdev->dev); | ||
| 397 | } | 418 | } |
| 398 | 419 | ||
| 399 | return 0; | 420 | return 0; |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index db8c4c4ac880..24177272bcb8 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
| @@ -37,11 +37,19 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID; | |||
| 37 | #ifdef CONFIG_PM_SLEEP | 37 | #ifdef CONFIG_PM_SLEEP |
| 38 | static int xen_hvm_suspend(void *data) | 38 | static int xen_hvm_suspend(void *data) |
| 39 | { | 39 | { |
| 40 | int err; | ||
| 40 | struct sched_shutdown r = { .reason = SHUTDOWN_suspend }; | 41 | struct sched_shutdown r = { .reason = SHUTDOWN_suspend }; |
| 41 | int *cancelled = data; | 42 | int *cancelled = data; |
| 42 | 43 | ||
| 43 | BUG_ON(!irqs_disabled()); | 44 | BUG_ON(!irqs_disabled()); |
| 44 | 45 | ||
| 46 | err = sysdev_suspend(PMSG_SUSPEND); | ||
| 47 | if (err) { | ||
| 48 | printk(KERN_ERR "xen_hvm_suspend: sysdev_suspend failed: %d\n", | ||
| 49 | err); | ||
| 50 | return err; | ||
| 51 | } | ||
| 52 | |||
| 45 | *cancelled = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); | 53 | *cancelled = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); |
| 46 | 54 | ||
| 47 | xen_hvm_post_suspend(*cancelled); | 55 | xen_hvm_post_suspend(*cancelled); |
| @@ -53,6 +61,8 @@ static int xen_hvm_suspend(void *data) | |||
| 53 | xen_timer_resume(); | 61 | xen_timer_resume(); |
| 54 | } | 62 | } |
| 55 | 63 | ||
| 64 | sysdev_resume(); | ||
| 65 | |||
| 56 | return 0; | 66 | return 0; |
| 57 | } | 67 | } |
| 58 | 68 | ||
diff --git a/fs/afs/write.c b/fs/afs/write.c index 15690bb1d3b5..789b3afb3423 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c | |||
| @@ -140,6 +140,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping, | |||
| 140 | candidate->first = candidate->last = index; | 140 | candidate->first = candidate->last = index; |
| 141 | candidate->offset_first = from; | 141 | candidate->offset_first = from; |
| 142 | candidate->to_last = to; | 142 | candidate->to_last = to; |
| 143 | INIT_LIST_HEAD(&candidate->link); | ||
| 143 | candidate->usage = 1; | 144 | candidate->usage = 1; |
| 144 | candidate->state = AFS_WBACK_PENDING; | 145 | candidate->state = AFS_WBACK_PENDING; |
| 145 | init_waitqueue_head(&candidate->waitq); | 146 | init_waitqueue_head(&candidate->waitq); |
| @@ -239,15 +239,23 @@ static void __put_ioctx(struct kioctx *ctx) | |||
| 239 | call_rcu(&ctx->rcu_head, ctx_rcu_free); | 239 | call_rcu(&ctx->rcu_head, ctx_rcu_free); |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | #define get_ioctx(kioctx) do { \ | 242 | static inline void get_ioctx(struct kioctx *kioctx) |
| 243 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ | 243 | { |
| 244 | atomic_inc(&(kioctx)->users); \ | 244 | BUG_ON(atomic_read(&kioctx->users) <= 0); |
| 245 | } while (0) | 245 | atomic_inc(&kioctx->users); |
| 246 | #define put_ioctx(kioctx) do { \ | 246 | } |
| 247 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ | 247 | |
| 248 | if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ | 248 | static inline int try_get_ioctx(struct kioctx *kioctx) |
| 249 | __put_ioctx(kioctx); \ | 249 | { |
| 250 | } while (0) | 250 | return atomic_inc_not_zero(&kioctx->users); |
| 251 | } | ||
| 252 | |||
| 253 | static inline void put_ioctx(struct kioctx *kioctx) | ||
| 254 | { | ||
| 255 | BUG_ON(atomic_read(&kioctx->users) <= 0); | ||
| 256 | if (unlikely(atomic_dec_and_test(&kioctx->users))) | ||
| 257 | __put_ioctx(kioctx); | ||
| 258 | } | ||
| 251 | 259 | ||
| 252 | /* ioctx_alloc | 260 | /* ioctx_alloc |
| 253 | * Allocates and initializes an ioctx. Returns an ERR_PTR if it failed. | 261 | * Allocates and initializes an ioctx. Returns an ERR_PTR if it failed. |
| @@ -601,8 +609,13 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id) | |||
| 601 | rcu_read_lock(); | 609 | rcu_read_lock(); |
| 602 | 610 | ||
| 603 | hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) { | 611 | hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) { |
| 604 | if (ctx->user_id == ctx_id && !ctx->dead) { | 612 | /* |
| 605 | get_ioctx(ctx); | 613 | * RCU protects us against accessing freed memory but |
| 614 | * we have to be careful not to get a reference when the | ||
| 615 | * reference count already dropped to 0 (ctx->dead test | ||
| 616 | * is unreliable because of races). | ||
| 617 | */ | ||
| 618 | if (ctx->user_id == ctx_id && !ctx->dead && try_get_ioctx(ctx)){ | ||
| 606 | ret = ctx; | 619 | ret = ctx; |
| 607 | break; | 620 | break; |
| 608 | } | 621 | } |
| @@ -1629,6 +1642,23 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
| 1629 | goto out_put_req; | 1642 | goto out_put_req; |
| 1630 | 1643 | ||
| 1631 | spin_lock_irq(&ctx->ctx_lock); | 1644 | spin_lock_irq(&ctx->ctx_lock); |
| 1645 | /* | ||
| 1646 | * We could have raced with io_destroy() and are currently holding a | ||
| 1647 | * reference to ctx which should be destroyed. We cannot submit IO | ||
| 1648 | * since ctx gets freed as soon as io_submit() puts its reference. The | ||
| 1649 | * check here is reliable: io_destroy() sets ctx->dead before waiting | ||
| 1650 | * for outstanding IO and the barrier between these two is realized by | ||
| 1651 | * unlock of mm->ioctx_lock and lock of ctx->ctx_lock. Analogously we | ||
| 1652 | * increment ctx->reqs_active before checking for ctx->dead and the | ||
| 1653 | * barrier is realized by unlock and lock of ctx->ctx_lock. Thus if we | ||
| 1654 | * don't see ctx->dead set here, io_destroy() waits for our IO to | ||
| 1655 | * finish. | ||
| 1656 | */ | ||
| 1657 | if (ctx->dead) { | ||
| 1658 | spin_unlock_irq(&ctx->ctx_lock); | ||
| 1659 | ret = -EINVAL; | ||
| 1660 | goto out_put_req; | ||
| 1661 | } | ||
| 1632 | aio_run_iocb(req); | 1662 | aio_run_iocb(req); |
| 1633 | if (!list_empty(&ctx->run_list)) { | 1663 | if (!list_empty(&ctx->run_list)) { |
| 1634 | /* drain the run list */ | 1664 | /* drain the run list */ |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 333a7bb4cb9c..889287019599 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
| @@ -873,6 +873,11 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) | |||
| 873 | ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); | 873 | ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); |
| 874 | if (ret) | 874 | if (ret) |
| 875 | goto out_del; | 875 | goto out_del; |
| 876 | /* | ||
| 877 | * bdev could be deleted beneath us which would implicitly destroy | ||
| 878 | * the holder directory. Hold on to it. | ||
| 879 | */ | ||
| 880 | kobject_get(bdev->bd_part->holder_dir); | ||
| 876 | 881 | ||
| 877 | list_add(&holder->list, &bdev->bd_holder_disks); | 882 | list_add(&holder->list, &bdev->bd_holder_disks); |
| 878 | goto out_unlock; | 883 | goto out_unlock; |
| @@ -909,6 +914,7 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) | |||
| 909 | del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); | 914 | del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); |
| 910 | del_symlink(bdev->bd_part->holder_dir, | 915 | del_symlink(bdev->bd_part->holder_dir, |
| 911 | &disk_to_dev(disk)->kobj); | 916 | &disk_to_dev(disk)->kobj); |
| 917 | kobject_put(bdev->bd_part->holder_dir); | ||
| 912 | list_del_init(&holder->list); | 918 | list_del_init(&holder->list); |
| 913 | kfree(holder); | 919 | kfree(holder); |
| 914 | } | 920 | } |
| @@ -922,14 +928,15 @@ EXPORT_SYMBOL_GPL(bd_unlink_disk_holder); | |||
| 922 | * flush_disk - invalidates all buffer-cache entries on a disk | 928 | * flush_disk - invalidates all buffer-cache entries on a disk |
| 923 | * | 929 | * |
| 924 | * @bdev: struct block device to be flushed | 930 | * @bdev: struct block device to be flushed |
| 931 | * @kill_dirty: flag to guide handling of dirty inodes | ||
| 925 | * | 932 | * |
| 926 | * Invalidates all buffer-cache entries on a disk. It should be called | 933 | * Invalidates all buffer-cache entries on a disk. It should be called |
| 927 | * when a disk has been changed -- either by a media change or online | 934 | * when a disk has been changed -- either by a media change or online |
| 928 | * resize. | 935 | * resize. |
| 929 | */ | 936 | */ |
| 930 | static void flush_disk(struct block_device *bdev) | 937 | static void flush_disk(struct block_device *bdev, bool kill_dirty) |
| 931 | { | 938 | { |
| 932 | if (__invalidate_device(bdev)) { | 939 | if (__invalidate_device(bdev, kill_dirty)) { |
| 933 | char name[BDEVNAME_SIZE] = ""; | 940 | char name[BDEVNAME_SIZE] = ""; |
| 934 | 941 | ||
| 935 | if (bdev->bd_disk) | 942 | if (bdev->bd_disk) |
| @@ -966,7 +973,7 @@ void check_disk_size_change(struct gendisk *disk, struct block_device *bdev) | |||
| 966 | "%s: detected capacity change from %lld to %lld\n", | 973 | "%s: detected capacity change from %lld to %lld\n", |
| 967 | name, bdev_size, disk_size); | 974 | name, bdev_size, disk_size); |
| 968 | i_size_write(bdev->bd_inode, disk_size); | 975 | i_size_write(bdev->bd_inode, disk_size); |
| 969 | flush_disk(bdev); | 976 | flush_disk(bdev, false); |
| 970 | } | 977 | } |
| 971 | } | 978 | } |
| 972 | EXPORT_SYMBOL(check_disk_size_change); | 979 | EXPORT_SYMBOL(check_disk_size_change); |
| @@ -1019,7 +1026,7 @@ int check_disk_change(struct block_device *bdev) | |||
| 1019 | if (!(events & DISK_EVENT_MEDIA_CHANGE)) | 1026 | if (!(events & DISK_EVENT_MEDIA_CHANGE)) |
| 1020 | return 0; | 1027 | return 0; |
| 1021 | 1028 | ||
| 1022 | flush_disk(bdev); | 1029 | flush_disk(bdev, true); |
| 1023 | if (bdops->revalidate_disk) | 1030 | if (bdops->revalidate_disk) |
| 1024 | bdops->revalidate_disk(bdev->bd_disk); | 1031 | bdops->revalidate_disk(bdev->bd_disk); |
| 1025 | return 1; | 1032 | return 1; |
| @@ -1215,12 +1222,6 @@ int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder) | |||
| 1215 | 1222 | ||
| 1216 | res = __blkdev_get(bdev, mode, 0); | 1223 | res = __blkdev_get(bdev, mode, 0); |
| 1217 | 1224 | ||
| 1218 | /* __blkdev_get() may alter read only status, check it afterwards */ | ||
| 1219 | if (!res && (mode & FMODE_WRITE) && bdev_read_only(bdev)) { | ||
| 1220 | __blkdev_put(bdev, mode, 0); | ||
| 1221 | res = -EACCES; | ||
| 1222 | } | ||
| 1223 | |||
| 1224 | if (whole) { | 1225 | if (whole) { |
| 1225 | /* finish claiming */ | 1226 | /* finish claiming */ |
| 1226 | mutex_lock(&bdev->bd_mutex); | 1227 | mutex_lock(&bdev->bd_mutex); |
| @@ -1298,6 +1299,11 @@ struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, | |||
| 1298 | if (err) | 1299 | if (err) |
| 1299 | return ERR_PTR(err); | 1300 | return ERR_PTR(err); |
| 1300 | 1301 | ||
| 1302 | if ((mode & FMODE_WRITE) && bdev_read_only(bdev)) { | ||
| 1303 | blkdev_put(bdev, mode); | ||
| 1304 | return ERR_PTR(-EACCES); | ||
| 1305 | } | ||
| 1306 | |||
| 1301 | return bdev; | 1307 | return bdev; |
| 1302 | } | 1308 | } |
| 1303 | EXPORT_SYMBOL(blkdev_get_by_path); | 1309 | EXPORT_SYMBOL(blkdev_get_by_path); |
| @@ -1601,7 +1607,7 @@ fail: | |||
| 1601 | } | 1607 | } |
| 1602 | EXPORT_SYMBOL(lookup_bdev); | 1608 | EXPORT_SYMBOL(lookup_bdev); |
| 1603 | 1609 | ||
| 1604 | int __invalidate_device(struct block_device *bdev) | 1610 | int __invalidate_device(struct block_device *bdev, bool kill_dirty) |
| 1605 | { | 1611 | { |
| 1606 | struct super_block *sb = get_super(bdev); | 1612 | struct super_block *sb = get_super(bdev); |
| 1607 | int res = 0; | 1613 | int res = 0; |
| @@ -1614,7 +1620,7 @@ int __invalidate_device(struct block_device *bdev) | |||
| 1614 | * hold). | 1620 | * hold). |
| 1615 | */ | 1621 | */ |
| 1616 | shrink_dcache_sb(sb); | 1622 | shrink_dcache_sb(sb); |
| 1617 | res = invalidate_inodes(sb); | 1623 | res = invalidate_inodes(sb, kill_dirty); |
| 1618 | drop_super(sb); | 1624 | drop_super(sb); |
| 1619 | } | 1625 | } |
| 1620 | invalidate_bdev(bdev); | 1626 | invalidate_bdev(bdev); |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 2c98b3af6052..6f820fa23df4 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
| @@ -1254,6 +1254,7 @@ struct btrfs_root { | |||
| 1254 | #define BTRFS_MOUNT_SPACE_CACHE (1 << 12) | 1254 | #define BTRFS_MOUNT_SPACE_CACHE (1 << 12) |
| 1255 | #define BTRFS_MOUNT_CLEAR_CACHE (1 << 13) | 1255 | #define BTRFS_MOUNT_CLEAR_CACHE (1 << 13) |
| 1256 | #define BTRFS_MOUNT_USER_SUBVOL_RM_ALLOWED (1 << 14) | 1256 | #define BTRFS_MOUNT_USER_SUBVOL_RM_ALLOWED (1 << 14) |
| 1257 | #define BTRFS_MOUNT_ENOSPC_DEBUG (1 << 15) | ||
| 1257 | 1258 | ||
| 1258 | #define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt) | 1259 | #define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt) |
| 1259 | #define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt) | 1260 | #define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt) |
| @@ -2218,6 +2219,8 @@ int btrfs_error_unpin_extent_range(struct btrfs_root *root, | |||
| 2218 | u64 start, u64 end); | 2219 | u64 start, u64 end); |
| 2219 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, | 2220 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, |
| 2220 | u64 num_bytes); | 2221 | u64 num_bytes); |
| 2222 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, | ||
| 2223 | struct btrfs_root *root, u64 type); | ||
| 2221 | 2224 | ||
| 2222 | /* ctree.c */ | 2225 | /* ctree.c */ |
| 2223 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, | 2226 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index f3c96fc01439..588ff9849873 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -5376,7 +5376,7 @@ again: | |||
| 5376 | num_bytes, data, 1); | 5376 | num_bytes, data, 1); |
| 5377 | goto again; | 5377 | goto again; |
| 5378 | } | 5378 | } |
| 5379 | if (ret == -ENOSPC) { | 5379 | if (ret == -ENOSPC && btrfs_test_opt(root, ENOSPC_DEBUG)) { |
| 5380 | struct btrfs_space_info *sinfo; | 5380 | struct btrfs_space_info *sinfo; |
| 5381 | 5381 | ||
| 5382 | sinfo = __find_space_info(root->fs_info, data); | 5382 | sinfo = __find_space_info(root->fs_info, data); |
| @@ -8065,6 +8065,13 @@ out: | |||
| 8065 | return ret; | 8065 | return ret; |
| 8066 | } | 8066 | } |
| 8067 | 8067 | ||
| 8068 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, | ||
| 8069 | struct btrfs_root *root, u64 type) | ||
| 8070 | { | ||
| 8071 | u64 alloc_flags = get_alloc_profile(root, type); | ||
| 8072 | return do_chunk_alloc(trans, root, 2 * 1024 * 1024, alloc_flags, 1); | ||
| 8073 | } | ||
| 8074 | |||
| 8068 | /* | 8075 | /* |
| 8069 | * helper to account the unused space of all the readonly block group in the | 8076 | * helper to account the unused space of all the readonly block group in the |
| 8070 | * list. takes mirrors into account. | 8077 | * list. takes mirrors into account. |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 92ac5192c518..fd3f172e94e6 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
| @@ -1433,12 +1433,13 @@ int extent_clear_unlock_delalloc(struct inode *inode, | |||
| 1433 | */ | 1433 | */ |
| 1434 | u64 count_range_bits(struct extent_io_tree *tree, | 1434 | u64 count_range_bits(struct extent_io_tree *tree, |
| 1435 | u64 *start, u64 search_end, u64 max_bytes, | 1435 | u64 *start, u64 search_end, u64 max_bytes, |
| 1436 | unsigned long bits) | 1436 | unsigned long bits, int contig) |
| 1437 | { | 1437 | { |
| 1438 | struct rb_node *node; | 1438 | struct rb_node *node; |
| 1439 | struct extent_state *state; | 1439 | struct extent_state *state; |
| 1440 | u64 cur_start = *start; | 1440 | u64 cur_start = *start; |
| 1441 | u64 total_bytes = 0; | 1441 | u64 total_bytes = 0; |
| 1442 | u64 last = 0; | ||
| 1442 | int found = 0; | 1443 | int found = 0; |
| 1443 | 1444 | ||
| 1444 | if (search_end <= cur_start) { | 1445 | if (search_end <= cur_start) { |
| @@ -1463,7 +1464,9 @@ u64 count_range_bits(struct extent_io_tree *tree, | |||
| 1463 | state = rb_entry(node, struct extent_state, rb_node); | 1464 | state = rb_entry(node, struct extent_state, rb_node); |
| 1464 | if (state->start > search_end) | 1465 | if (state->start > search_end) |
| 1465 | break; | 1466 | break; |
| 1466 | if (state->end >= cur_start && (state->state & bits)) { | 1467 | if (contig && found && state->start > last + 1) |
| 1468 | break; | ||
| 1469 | if (state->end >= cur_start && (state->state & bits) == bits) { | ||
| 1467 | total_bytes += min(search_end, state->end) + 1 - | 1470 | total_bytes += min(search_end, state->end) + 1 - |
| 1468 | max(cur_start, state->start); | 1471 | max(cur_start, state->start); |
| 1469 | if (total_bytes >= max_bytes) | 1472 | if (total_bytes >= max_bytes) |
| @@ -1472,6 +1475,9 @@ u64 count_range_bits(struct extent_io_tree *tree, | |||
| 1472 | *start = state->start; | 1475 | *start = state->start; |
| 1473 | found = 1; | 1476 | found = 1; |
| 1474 | } | 1477 | } |
| 1478 | last = state->end; | ||
| 1479 | } else if (contig && found) { | ||
| 1480 | break; | ||
| 1475 | } | 1481 | } |
| 1476 | node = rb_next(node); | 1482 | node = rb_next(node); |
| 1477 | if (!node) | 1483 | if (!node) |
| @@ -2912,6 +2918,46 @@ out: | |||
| 2912 | return sector; | 2918 | return sector; |
| 2913 | } | 2919 | } |
| 2914 | 2920 | ||
| 2921 | /* | ||
| 2922 | * helper function for fiemap, which doesn't want to see any holes. | ||
| 2923 | * This maps until we find something past 'last' | ||
| 2924 | */ | ||
| 2925 | static struct extent_map *get_extent_skip_holes(struct inode *inode, | ||
| 2926 | u64 offset, | ||
| 2927 | u64 last, | ||
| 2928 | get_extent_t *get_extent) | ||
| 2929 | { | ||
| 2930 | u64 sectorsize = BTRFS_I(inode)->root->sectorsize; | ||
| 2931 | struct extent_map *em; | ||
| 2932 | u64 len; | ||
| 2933 | |||
| 2934 | if (offset >= last) | ||
| 2935 | return NULL; | ||
| 2936 | |||
| 2937 | while(1) { | ||
| 2938 | len = last - offset; | ||
| 2939 | if (len == 0) | ||
| 2940 | break; | ||
| 2941 | len = (len + sectorsize - 1) & ~(sectorsize - 1); | ||
| 2942 | em = get_extent(inode, NULL, 0, offset, len, 0); | ||
| 2943 | if (!em || IS_ERR(em)) | ||
| 2944 | return em; | ||
| 2945 | |||
| 2946 | /* if this isn't a hole return it */ | ||
| 2947 | if (!test_bit(EXTENT_FLAG_VACANCY, &em->flags) && | ||
| 2948 | em->block_start != EXTENT_MAP_HOLE) { | ||
| 2949 | return em; | ||
| 2950 | } | ||
| 2951 | |||
| 2952 | /* this is a hole, advance to the next extent */ | ||
| 2953 | offset = extent_map_end(em); | ||
| 2954 | free_extent_map(em); | ||
| 2955 | if (offset >= last) | ||
| 2956 | break; | ||
| 2957 | } | ||
| 2958 | return NULL; | ||
| 2959 | } | ||
| 2960 | |||
| 2915 | int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | 2961 | int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
| 2916 | __u64 start, __u64 len, get_extent_t *get_extent) | 2962 | __u64 start, __u64 len, get_extent_t *get_extent) |
| 2917 | { | 2963 | { |
| @@ -2921,16 +2967,19 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
| 2921 | u32 flags = 0; | 2967 | u32 flags = 0; |
| 2922 | u32 found_type; | 2968 | u32 found_type; |
| 2923 | u64 last; | 2969 | u64 last; |
| 2970 | u64 last_for_get_extent = 0; | ||
| 2924 | u64 disko = 0; | 2971 | u64 disko = 0; |
| 2972 | u64 isize = i_size_read(inode); | ||
| 2925 | struct btrfs_key found_key; | 2973 | struct btrfs_key found_key; |
| 2926 | struct extent_map *em = NULL; | 2974 | struct extent_map *em = NULL; |
| 2927 | struct extent_state *cached_state = NULL; | 2975 | struct extent_state *cached_state = NULL; |
| 2928 | struct btrfs_path *path; | 2976 | struct btrfs_path *path; |
| 2929 | struct btrfs_file_extent_item *item; | 2977 | struct btrfs_file_extent_item *item; |
| 2930 | int end = 0; | 2978 | int end = 0; |
| 2931 | u64 em_start = 0, em_len = 0; | 2979 | u64 em_start = 0; |
| 2980 | u64 em_len = 0; | ||
| 2981 | u64 em_end = 0; | ||
| 2932 | unsigned long emflags; | 2982 | unsigned long emflags; |
| 2933 | int hole = 0; | ||
| 2934 | 2983 | ||
| 2935 | if (len == 0) | 2984 | if (len == 0) |
| 2936 | return -EINVAL; | 2985 | return -EINVAL; |
| @@ -2940,6 +2989,10 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
| 2940 | return -ENOMEM; | 2989 | return -ENOMEM; |
| 2941 | path->leave_spinning = 1; | 2990 | path->leave_spinning = 1; |
| 2942 | 2991 | ||
| 2992 | /* | ||
| 2993 | * lookup the last file extent. We're not using i_size here | ||
| 2994 | * because there might be preallocation past i_size | ||
| 2995 | */ | ||
| 2943 | ret = btrfs_lookup_file_extent(NULL, BTRFS_I(inode)->root, | 2996 | ret = btrfs_lookup_file_extent(NULL, BTRFS_I(inode)->root, |
| 2944 | path, inode->i_ino, -1, 0); | 2997 | path, inode->i_ino, -1, 0); |
| 2945 | if (ret < 0) { | 2998 | if (ret < 0) { |
| @@ -2953,18 +3006,38 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
| 2953 | btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); | 3006 | btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); |
| 2954 | found_type = btrfs_key_type(&found_key); | 3007 | found_type = btrfs_key_type(&found_key); |
| 2955 | 3008 | ||
| 2956 | /* No extents, just return */ | 3009 | /* No extents, but there might be delalloc bits */ |
| 2957 | if (found_key.objectid != inode->i_ino || | 3010 | if (found_key.objectid != inode->i_ino || |
| 2958 | found_type != BTRFS_EXTENT_DATA_KEY) { | 3011 | found_type != BTRFS_EXTENT_DATA_KEY) { |
| 2959 | btrfs_free_path(path); | 3012 | /* have to trust i_size as the end */ |
| 2960 | return 0; | 3013 | last = (u64)-1; |
| 3014 | last_for_get_extent = isize; | ||
| 3015 | } else { | ||
| 3016 | /* | ||
| 3017 | * remember the start of the last extent. There are a | ||
| 3018 | * bunch of different factors that go into the length of the | ||
| 3019 | * extent, so its much less complex to remember where it started | ||
| 3020 | */ | ||
| 3021 | last = found_key.offset; | ||
| 3022 | last_for_get_extent = last + 1; | ||
| 2961 | } | 3023 | } |
| 2962 | last = found_key.offset; | ||
| 2963 | btrfs_free_path(path); | 3024 | btrfs_free_path(path); |
| 2964 | 3025 | ||
| 3026 | /* | ||
| 3027 | * we might have some extents allocated but more delalloc past those | ||
| 3028 | * extents. so, we trust isize unless the start of the last extent is | ||
| 3029 | * beyond isize | ||
| 3030 | */ | ||
| 3031 | if (last < isize) { | ||
| 3032 | last = (u64)-1; | ||
| 3033 | last_for_get_extent = isize; | ||
| 3034 | } | ||
| 3035 | |||
| 2965 | lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len, 0, | 3036 | lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len, 0, |
| 2966 | &cached_state, GFP_NOFS); | 3037 | &cached_state, GFP_NOFS); |
| 2967 | em = get_extent(inode, NULL, 0, off, max - off, 0); | 3038 | |
| 3039 | em = get_extent_skip_holes(inode, off, last_for_get_extent, | ||
| 3040 | get_extent); | ||
| 2968 | if (!em) | 3041 | if (!em) |
| 2969 | goto out; | 3042 | goto out; |
| 2970 | if (IS_ERR(em)) { | 3043 | if (IS_ERR(em)) { |
| @@ -2973,19 +3046,14 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
| 2973 | } | 3046 | } |
| 2974 | 3047 | ||
| 2975 | while (!end) { | 3048 | while (!end) { |
| 2976 | hole = 0; | 3049 | off = extent_map_end(em); |
| 2977 | off = em->start + em->len; | ||
| 2978 | if (off >= max) | 3050 | if (off >= max) |
| 2979 | end = 1; | 3051 | end = 1; |
| 2980 | 3052 | ||
| 2981 | if (em->block_start == EXTENT_MAP_HOLE) { | ||
| 2982 | hole = 1; | ||
| 2983 | goto next; | ||
| 2984 | } | ||
| 2985 | |||
| 2986 | em_start = em->start; | 3053 | em_start = em->start; |
| 2987 | em_len = em->len; | 3054 | em_len = em->len; |
| 2988 | 3055 | em_end = extent_map_end(em); | |
| 3056 | emflags = em->flags; | ||
| 2989 | disko = 0; | 3057 | disko = 0; |
| 2990 | flags = 0; | 3058 | flags = 0; |
| 2991 | 3059 | ||
| @@ -3004,37 +3072,29 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | |||
| 3004 | if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) | 3072 | if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) |
| 3005 | flags |= FIEMAP_EXTENT_ENCODED; | 3073 | flags |= FIEMAP_EXTENT_ENCODED; |
| 3006 | 3074 | ||
| 3007 | next: | ||
| 3008 | emflags = em->flags; | ||
| 3009 | free_extent_map(em); | 3075 | free_extent_map(em); |
| 3010 | em = NULL; | 3076 | em = NULL; |
| 3011 | if (!end) { | 3077 | if ((em_start >= last) || em_len == (u64)-1 || |
| 3012 | em = get_extent(inode, NULL, 0, off, max - off, 0); | 3078 | (last == (u64)-1 && isize <= em_end)) { |
| 3013 | if (!em) | ||
| 3014 | goto out; | ||
| 3015 | if (IS_ERR(em)) { | ||
| 3016 | ret = PTR_ERR(em); | ||
| 3017 | goto out; | ||
| 3018 | } | ||
| 3019 | emflags = em->flags; | ||
| 3020 | } | ||
| 3021 | |||
| 3022 | if (test_bit(EXTENT_FLAG_VACANCY, &emflags)) { | ||
| 3023 | flags |= FIEMAP_EXTENT_LAST; | 3079 | flags |= FIEMAP_EXTENT_LAST; |
| 3024 | end = 1; | 3080 | end = 1; |
| 3025 | } | 3081 | } |
| 3026 | 3082 | ||
| 3027 | if (em_start == last) { | 3083 | /* now scan forward to see if this is really the last extent. */ |
| 3084 | em = get_extent_skip_holes(inode, off, last_for_get_extent, | ||
| 3085 | get_extent); | ||
| 3086 | if (IS_ERR(em)) { | ||
| 3087 | ret = PTR_ERR(em); | ||
| 3088 | goto out; | ||
| 3089 | } | ||
| 3090 | if (!em) { | ||
| 3028 | flags |= FIEMAP_EXTENT_LAST; | 3091 | flags |= FIEMAP_EXTENT_LAST; |
| 3029 | end = 1; | 3092 | end = 1; |
| 3030 | } | 3093 | } |
| 3031 | 3094 | ret = fiemap_fill_next_extent(fieinfo, em_start, disko, | |
| 3032 | if (!hole) { | 3095 | em_len, flags); |
| 3033 | ret = fiemap_fill_next_extent(fieinfo, em_start, disko, | 3096 | if (ret) |
| 3034 | em_len, flags); | 3097 | goto out_free; |
| 3035 | if (ret) | ||
| 3036 | goto out_free; | ||
| 3037 | } | ||
| 3038 | } | 3098 | } |
| 3039 | out_free: | 3099 | out_free: |
| 3040 | free_extent_map(em); | 3100 | free_extent_map(em); |
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 7083cfafd061..9318dfefd59c 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
| @@ -191,7 +191,7 @@ void extent_io_exit(void); | |||
| 191 | 191 | ||
| 192 | u64 count_range_bits(struct extent_io_tree *tree, | 192 | u64 count_range_bits(struct extent_io_tree *tree, |
| 193 | u64 *start, u64 search_end, | 193 | u64 *start, u64 search_end, |
| 194 | u64 max_bytes, unsigned long bits); | 194 | u64 max_bytes, unsigned long bits, int contig); |
| 195 | 195 | ||
| 196 | void free_extent_state(struct extent_state *state); | 196 | void free_extent_state(struct extent_state *state); |
| 197 | int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, | 197 | int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index fb9bd7832b6d..0efdb65953c5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -1913,7 +1913,7 @@ static int btrfs_clean_io_failures(struct inode *inode, u64 start) | |||
| 1913 | 1913 | ||
| 1914 | private = 0; | 1914 | private = 0; |
| 1915 | if (count_range_bits(&BTRFS_I(inode)->io_failure_tree, &private, | 1915 | if (count_range_bits(&BTRFS_I(inode)->io_failure_tree, &private, |
| 1916 | (u64)-1, 1, EXTENT_DIRTY)) { | 1916 | (u64)-1, 1, EXTENT_DIRTY, 0)) { |
| 1917 | ret = get_state_private(&BTRFS_I(inode)->io_failure_tree, | 1917 | ret = get_state_private(&BTRFS_I(inode)->io_failure_tree, |
| 1918 | start, &private_failure); | 1918 | start, &private_failure); |
| 1919 | if (ret == 0) { | 1919 | if (ret == 0) { |
| @@ -5280,6 +5280,128 @@ out: | |||
| 5280 | return em; | 5280 | return em; |
| 5281 | } | 5281 | } |
| 5282 | 5282 | ||
| 5283 | struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page, | ||
| 5284 | size_t pg_offset, u64 start, u64 len, | ||
| 5285 | int create) | ||
| 5286 | { | ||
| 5287 | struct extent_map *em; | ||
| 5288 | struct extent_map *hole_em = NULL; | ||
| 5289 | u64 range_start = start; | ||
| 5290 | u64 end; | ||
| 5291 | u64 found; | ||
| 5292 | u64 found_end; | ||
| 5293 | int err = 0; | ||
| 5294 | |||
| 5295 | em = btrfs_get_extent(inode, page, pg_offset, start, len, create); | ||
| 5296 | if (IS_ERR(em)) | ||
| 5297 | return em; | ||
| 5298 | if (em) { | ||
| 5299 | /* | ||
| 5300 | * if our em maps to a hole, there might | ||
| 5301 | * actually be delalloc bytes behind it | ||
| 5302 | */ | ||
| 5303 | if (em->block_start != EXTENT_MAP_HOLE) | ||
| 5304 | return em; | ||
| 5305 | else | ||
| 5306 | hole_em = em; | ||
| 5307 | } | ||
| 5308 | |||
| 5309 | /* check to see if we've wrapped (len == -1 or similar) */ | ||
| 5310 | end = start + len; | ||
| 5311 | if (end < start) | ||
| 5312 | end = (u64)-1; | ||
| 5313 | else | ||
| 5314 | end -= 1; | ||
| 5315 | |||
| 5316 | em = NULL; | ||
| 5317 | |||
| 5318 | /* ok, we didn't find anything, lets look for delalloc */ | ||
| 5319 | found = count_range_bits(&BTRFS_I(inode)->io_tree, &range_start, | ||
| 5320 | end, len, EXTENT_DELALLOC, 1); | ||
| 5321 | found_end = range_start + found; | ||
| 5322 | if (found_end < range_start) | ||
| 5323 | found_end = (u64)-1; | ||
| 5324 | |||
| 5325 | /* | ||
| 5326 | * we didn't find anything useful, return | ||
| 5327 | * the original results from get_extent() | ||
| 5328 | */ | ||
| 5329 | if (range_start > end || found_end <= start) { | ||
| 5330 | em = hole_em; | ||
| 5331 | hole_em = NULL; | ||
| 5332 | goto out; | ||
| 5333 | } | ||
| 5334 | |||
| 5335 | /* adjust the range_start to make sure it doesn't | ||
| 5336 | * go backwards from the start they passed in | ||
| 5337 | */ | ||
| 5338 | range_start = max(start,range_start); | ||
| 5339 | found = found_end - range_start; | ||
| 5340 | |||
| 5341 | if (found > 0) { | ||
| 5342 | u64 hole_start = start; | ||
| 5343 | u64 hole_len = len; | ||
| 5344 | |||
| 5345 | em = alloc_extent_map(GFP_NOFS); | ||
| 5346 | if (!em) { | ||
| 5347 | err = -ENOMEM; | ||
| 5348 | goto out; | ||
| 5349 | } | ||
| 5350 | /* | ||
| 5351 | * when btrfs_get_extent can't find anything it | ||
| 5352 | * returns one huge hole | ||
| 5353 | * | ||
| 5354 | * make sure what it found really fits our range, and | ||
| 5355 | * adjust to make sure it is based on the start from | ||
| 5356 | * the caller | ||
| 5357 | */ | ||
| 5358 | if (hole_em) { | ||
| 5359 | u64 calc_end = extent_map_end(hole_em); | ||
| 5360 | |||
| 5361 | if (calc_end <= start || (hole_em->start > end)) { | ||
| 5362 | free_extent_map(hole_em); | ||
| 5363 | hole_em = NULL; | ||
| 5364 | } else { | ||
| 5365 | hole_start = max(hole_em->start, start); | ||
| 5366 | hole_len = calc_end - hole_start; | ||
| 5367 | } | ||
| 5368 | } | ||
| 5369 | em->bdev = NULL; | ||
| 5370 | if (hole_em && range_start > hole_start) { | ||
| 5371 | /* our hole starts before our delalloc, so we | ||
| 5372 | * have to return just the parts of the hole | ||
| 5373 | * that go until the delalloc starts | ||
| 5374 | */ | ||
| 5375 | em->len = min(hole_len, | ||
| 5376 | range_start - hole_start); | ||
| 5377 | em->start = hole_start; | ||
| 5378 | em->orig_start = hole_start; | ||
| 5379 | /* | ||
| 5380 | * don't adjust block start at all, | ||
| 5381 | * it is fixed at EXTENT_MAP_HOLE | ||
| 5382 | */ | ||
| 5383 | em->block_start = hole_em->block_start; | ||
| 5384 | em->block_len = hole_len; | ||
| 5385 | } else { | ||
| 5386 | em->start = range_start; | ||
| 5387 | em->len = found; | ||
| 5388 | em->orig_start = range_start; | ||
| 5389 | em->block_start = EXTENT_MAP_DELALLOC; | ||
| 5390 | em->block_len = found; | ||
| 5391 | } | ||
| 5392 | } else if (hole_em) { | ||
| 5393 | return hole_em; | ||
| 5394 | } | ||
| 5395 | out: | ||
| 5396 | |||
| 5397 | free_extent_map(hole_em); | ||
| 5398 | if (err) { | ||
| 5399 | free_extent_map(em); | ||
| 5400 | return ERR_PTR(err); | ||
| 5401 | } | ||
| 5402 | return em; | ||
| 5403 | } | ||
| 5404 | |||
| 5283 | static struct extent_map *btrfs_new_extent_direct(struct inode *inode, | 5405 | static struct extent_map *btrfs_new_extent_direct(struct inode *inode, |
| 5284 | u64 start, u64 len) | 5406 | u64 start, u64 len) |
| 5285 | { | 5407 | { |
| @@ -6102,7 +6224,7 @@ out: | |||
| 6102 | static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | 6224 | static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
| 6103 | __u64 start, __u64 len) | 6225 | __u64 start, __u64 len) |
| 6104 | { | 6226 | { |
| 6105 | return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent); | 6227 | return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent_fiemap); |
| 6106 | } | 6228 | } |
| 6107 | 6229 | ||
| 6108 | int btrfs_readpage(struct file *file, struct page *page) | 6230 | int btrfs_readpage(struct file *file, struct page *page) |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index be2d4f6aaa5e..5fdb2abc4fa7 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
| @@ -1071,12 +1071,15 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file, | |||
| 1071 | if (copy_from_user(&flags, arg, sizeof(flags))) | 1071 | if (copy_from_user(&flags, arg, sizeof(flags))) |
| 1072 | return -EFAULT; | 1072 | return -EFAULT; |
| 1073 | 1073 | ||
| 1074 | if (flags & ~BTRFS_SUBVOL_CREATE_ASYNC) | 1074 | if (flags & BTRFS_SUBVOL_CREATE_ASYNC) |
| 1075 | return -EINVAL; | 1075 | return -EINVAL; |
| 1076 | 1076 | ||
| 1077 | if (flags & ~BTRFS_SUBVOL_RDONLY) | 1077 | if (flags & ~BTRFS_SUBVOL_RDONLY) |
| 1078 | return -EOPNOTSUPP; | 1078 | return -EOPNOTSUPP; |
| 1079 | 1079 | ||
| 1080 | if (!is_owner_or_cap(inode)) | ||
| 1081 | return -EACCES; | ||
| 1082 | |||
| 1080 | down_write(&root->fs_info->subvol_sem); | 1083 | down_write(&root->fs_info->subvol_sem); |
| 1081 | 1084 | ||
| 1082 | /* nothing to do */ | 1085 | /* nothing to do */ |
| @@ -1097,7 +1100,7 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file, | |||
| 1097 | goto out_reset; | 1100 | goto out_reset; |
| 1098 | } | 1101 | } |
| 1099 | 1102 | ||
| 1100 | ret = btrfs_update_root(trans, root, | 1103 | ret = btrfs_update_root(trans, root->fs_info->tree_root, |
| 1101 | &root->root_key, &root->root_item); | 1104 | &root->root_key, &root->root_item); |
| 1102 | 1105 | ||
| 1103 | btrfs_commit_transaction(trans, root); | 1106 | btrfs_commit_transaction(trans, root); |
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c index cc9b450399df..a178f5ebea78 100644 --- a/fs/btrfs/lzo.c +++ b/fs/btrfs/lzo.c | |||
| @@ -280,6 +280,7 @@ static int lzo_decompress_biovec(struct list_head *ws, | |||
| 280 | unsigned long tot_out; | 280 | unsigned long tot_out; |
| 281 | unsigned long tot_len; | 281 | unsigned long tot_len; |
| 282 | char *buf; | 282 | char *buf; |
| 283 | bool may_late_unmap, need_unmap; | ||
| 283 | 284 | ||
| 284 | data_in = kmap(pages_in[0]); | 285 | data_in = kmap(pages_in[0]); |
| 285 | tot_len = read_compress_length(data_in); | 286 | tot_len = read_compress_length(data_in); |
| @@ -300,11 +301,13 @@ static int lzo_decompress_biovec(struct list_head *ws, | |||
| 300 | 301 | ||
| 301 | tot_in += in_len; | 302 | tot_in += in_len; |
| 302 | working_bytes = in_len; | 303 | working_bytes = in_len; |
| 304 | may_late_unmap = need_unmap = false; | ||
| 303 | 305 | ||
| 304 | /* fast path: avoid using the working buffer */ | 306 | /* fast path: avoid using the working buffer */ |
| 305 | if (in_page_bytes_left >= in_len) { | 307 | if (in_page_bytes_left >= in_len) { |
| 306 | buf = data_in + in_offset; | 308 | buf = data_in + in_offset; |
| 307 | bytes = in_len; | 309 | bytes = in_len; |
| 310 | may_late_unmap = true; | ||
| 308 | goto cont; | 311 | goto cont; |
| 309 | } | 312 | } |
| 310 | 313 | ||
| @@ -329,14 +332,17 @@ cont: | |||
| 329 | if (working_bytes == 0 && tot_in >= tot_len) | 332 | if (working_bytes == 0 && tot_in >= tot_len) |
| 330 | break; | 333 | break; |
| 331 | 334 | ||
| 332 | kunmap(pages_in[page_in_index]); | 335 | if (page_in_index + 1 >= total_pages_in) { |
| 333 | page_in_index++; | ||
| 334 | if (page_in_index >= total_pages_in) { | ||
| 335 | ret = -1; | 336 | ret = -1; |
| 336 | data_in = NULL; | ||
| 337 | goto done; | 337 | goto done; |
| 338 | } | 338 | } |
| 339 | data_in = kmap(pages_in[page_in_index]); | 339 | |
| 340 | if (may_late_unmap) | ||
| 341 | need_unmap = true; | ||
| 342 | else | ||
| 343 | kunmap(pages_in[page_in_index]); | ||
| 344 | |||
| 345 | data_in = kmap(pages_in[++page_in_index]); | ||
| 340 | 346 | ||
| 341 | in_page_bytes_left = PAGE_CACHE_SIZE; | 347 | in_page_bytes_left = PAGE_CACHE_SIZE; |
| 342 | in_offset = 0; | 348 | in_offset = 0; |
| @@ -346,6 +352,8 @@ cont: | |||
| 346 | out_len = lzo1x_worst_compress(PAGE_CACHE_SIZE); | 352 | out_len = lzo1x_worst_compress(PAGE_CACHE_SIZE); |
| 347 | ret = lzo1x_decompress_safe(buf, in_len, workspace->buf, | 353 | ret = lzo1x_decompress_safe(buf, in_len, workspace->buf, |
| 348 | &out_len); | 354 | &out_len); |
| 355 | if (need_unmap) | ||
| 356 | kunmap(pages_in[page_in_index - 1]); | ||
| 349 | if (ret != LZO_E_OK) { | 357 | if (ret != LZO_E_OK) { |
| 350 | printk(KERN_WARNING "btrfs decompress failed\n"); | 358 | printk(KERN_WARNING "btrfs decompress failed\n"); |
| 351 | ret = -1; | 359 | ret = -1; |
| @@ -363,8 +371,7 @@ cont: | |||
| 363 | break; | 371 | break; |
| 364 | } | 372 | } |
| 365 | done: | 373 | done: |
| 366 | if (data_in) | 374 | kunmap(pages_in[page_in_index]); |
| 367 | kunmap(pages_in[page_in_index]); | ||
| 368 | return ret; | 375 | return ret; |
| 369 | } | 376 | } |
| 370 | 377 | ||
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 0825e4ed9447..31ade5802ae8 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
| @@ -3654,6 +3654,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) | |||
| 3654 | u32 item_size; | 3654 | u32 item_size; |
| 3655 | int ret; | 3655 | int ret; |
| 3656 | int err = 0; | 3656 | int err = 0; |
| 3657 | int progress = 0; | ||
| 3657 | 3658 | ||
| 3658 | path = btrfs_alloc_path(); | 3659 | path = btrfs_alloc_path(); |
| 3659 | if (!path) | 3660 | if (!path) |
| @@ -3666,9 +3667,10 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) | |||
| 3666 | } | 3667 | } |
| 3667 | 3668 | ||
| 3668 | while (1) { | 3669 | while (1) { |
| 3670 | progress++; | ||
| 3669 | trans = btrfs_start_transaction(rc->extent_root, 0); | 3671 | trans = btrfs_start_transaction(rc->extent_root, 0); |
| 3670 | BUG_ON(IS_ERR(trans)); | 3672 | BUG_ON(IS_ERR(trans)); |
| 3671 | 3673 | restart: | |
| 3672 | if (update_backref_cache(trans, &rc->backref_cache)) { | 3674 | if (update_backref_cache(trans, &rc->backref_cache)) { |
| 3673 | btrfs_end_transaction(trans, rc->extent_root); | 3675 | btrfs_end_transaction(trans, rc->extent_root); |
| 3674 | continue; | 3676 | continue; |
| @@ -3781,6 +3783,15 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) | |||
| 3781 | } | 3783 | } |
| 3782 | } | 3784 | } |
| 3783 | } | 3785 | } |
| 3786 | if (trans && progress && err == -ENOSPC) { | ||
| 3787 | ret = btrfs_force_chunk_alloc(trans, rc->extent_root, | ||
| 3788 | rc->block_group->flags); | ||
| 3789 | if (ret == 0) { | ||
| 3790 | err = 0; | ||
| 3791 | progress = 0; | ||
| 3792 | goto restart; | ||
| 3793 | } | ||
| 3794 | } | ||
| 3784 | 3795 | ||
| 3785 | btrfs_release_path(rc->extent_root, path); | 3796 | btrfs_release_path(rc->extent_root, path); |
| 3786 | clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, | 3797 | clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index a004008f7d28..d39a9895d932 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
| @@ -155,7 +155,8 @@ enum { | |||
| 155 | Opt_nossd, Opt_ssd_spread, Opt_thread_pool, Opt_noacl, Opt_compress, | 155 | Opt_nossd, Opt_ssd_spread, Opt_thread_pool, Opt_noacl, Opt_compress, |
| 156 | Opt_compress_type, Opt_compress_force, Opt_compress_force_type, | 156 | Opt_compress_type, Opt_compress_force, Opt_compress_force_type, |
| 157 | Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard, | 157 | Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard, |
| 158 | Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed, Opt_err, | 158 | Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed, |
| 159 | Opt_enospc_debug, Opt_err, | ||
| 159 | }; | 160 | }; |
| 160 | 161 | ||
| 161 | static match_table_t tokens = { | 162 | static match_table_t tokens = { |
| @@ -184,6 +185,7 @@ static match_table_t tokens = { | |||
| 184 | {Opt_space_cache, "space_cache"}, | 185 | {Opt_space_cache, "space_cache"}, |
| 185 | {Opt_clear_cache, "clear_cache"}, | 186 | {Opt_clear_cache, "clear_cache"}, |
| 186 | {Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"}, | 187 | {Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"}, |
| 188 | {Opt_enospc_debug, "enospc_debug"}, | ||
| 187 | {Opt_err, NULL}, | 189 | {Opt_err, NULL}, |
| 188 | }; | 190 | }; |
| 189 | 191 | ||
| @@ -358,6 +360,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) | |||
| 358 | case Opt_user_subvol_rm_allowed: | 360 | case Opt_user_subvol_rm_allowed: |
| 359 | btrfs_set_opt(info->mount_opt, USER_SUBVOL_RM_ALLOWED); | 361 | btrfs_set_opt(info->mount_opt, USER_SUBVOL_RM_ALLOWED); |
| 360 | break; | 362 | break; |
| 363 | case Opt_enospc_debug: | ||
| 364 | btrfs_set_opt(info->mount_opt, ENOSPC_DEBUG); | ||
| 365 | break; | ||
| 361 | case Opt_err: | 366 | case Opt_err: |
| 362 | printk(KERN_INFO "btrfs: unrecognized mount option " | 367 | printk(KERN_INFO "btrfs: unrecognized mount option " |
| 363 | "'%s'\n", p); | 368 | "'%s'\n", p); |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index af7dbca15276..dd13eb81ee40 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
| @@ -1338,11 +1338,11 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) | |||
| 1338 | 1338 | ||
| 1339 | ret = btrfs_shrink_device(device, 0); | 1339 | ret = btrfs_shrink_device(device, 0); |
| 1340 | if (ret) | 1340 | if (ret) |
| 1341 | goto error_brelse; | 1341 | goto error_undo; |
| 1342 | 1342 | ||
| 1343 | ret = btrfs_rm_dev_item(root->fs_info->chunk_root, device); | 1343 | ret = btrfs_rm_dev_item(root->fs_info->chunk_root, device); |
| 1344 | if (ret) | 1344 | if (ret) |
| 1345 | goto error_brelse; | 1345 | goto error_undo; |
| 1346 | 1346 | ||
| 1347 | device->in_fs_metadata = 0; | 1347 | device->in_fs_metadata = 0; |
| 1348 | 1348 | ||
| @@ -1416,6 +1416,13 @@ out: | |||
| 1416 | mutex_unlock(&root->fs_info->volume_mutex); | 1416 | mutex_unlock(&root->fs_info->volume_mutex); |
| 1417 | mutex_unlock(&uuid_mutex); | 1417 | mutex_unlock(&uuid_mutex); |
| 1418 | return ret; | 1418 | return ret; |
| 1419 | error_undo: | ||
| 1420 | if (device->writeable) { | ||
| 1421 | list_add(&device->dev_alloc_list, | ||
| 1422 | &root->fs_info->fs_devices->alloc_list); | ||
| 1423 | root->fs_info->fs_devices->rw_devices++; | ||
| 1424 | } | ||
| 1425 | goto error_brelse; | ||
| 1419 | } | 1426 | } |
| 1420 | 1427 | ||
| 1421 | /* | 1428 | /* |
| @@ -1633,7 +1640,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) | |||
| 1633 | device->dev_root = root->fs_info->dev_root; | 1640 | device->dev_root = root->fs_info->dev_root; |
| 1634 | device->bdev = bdev; | 1641 | device->bdev = bdev; |
| 1635 | device->in_fs_metadata = 1; | 1642 | device->in_fs_metadata = 1; |
| 1636 | device->mode = 0; | 1643 | device->mode = FMODE_EXCL; |
| 1637 | set_blocksize(device->bdev, 4096); | 1644 | set_blocksize(device->bdev, 4096); |
| 1638 | 1645 | ||
| 1639 | if (seeding_dev) { | 1646 | if (seeding_dev) { |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 0bc68de8edd7..f0aef787a102 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
| @@ -60,6 +60,7 @@ int ceph_init_dentry(struct dentry *dentry) | |||
| 60 | } | 60 | } |
| 61 | di->dentry = dentry; | 61 | di->dentry = dentry; |
| 62 | di->lease_session = NULL; | 62 | di->lease_session = NULL; |
| 63 | di->parent_inode = igrab(dentry->d_parent->d_inode); | ||
| 63 | dentry->d_fsdata = di; | 64 | dentry->d_fsdata = di; |
| 64 | dentry->d_time = jiffies; | 65 | dentry->d_time = jiffies; |
| 65 | ceph_dentry_lru_add(dentry); | 66 | ceph_dentry_lru_add(dentry); |
| @@ -1033,7 +1034,7 @@ static void ceph_dentry_release(struct dentry *dentry) | |||
| 1033 | u64 snapid = CEPH_NOSNAP; | 1034 | u64 snapid = CEPH_NOSNAP; |
| 1034 | 1035 | ||
| 1035 | if (!IS_ROOT(dentry)) { | 1036 | if (!IS_ROOT(dentry)) { |
| 1036 | parent_inode = dentry->d_parent->d_inode; | 1037 | parent_inode = di->parent_inode; |
| 1037 | if (parent_inode) | 1038 | if (parent_inode) |
| 1038 | snapid = ceph_snap(parent_inode); | 1039 | snapid = ceph_snap(parent_inode); |
| 1039 | } | 1040 | } |
| @@ -1058,6 +1059,8 @@ static void ceph_dentry_release(struct dentry *dentry) | |||
| 1058 | kmem_cache_free(ceph_dentry_cachep, di); | 1059 | kmem_cache_free(ceph_dentry_cachep, di); |
| 1059 | dentry->d_fsdata = NULL; | 1060 | dentry->d_fsdata = NULL; |
| 1060 | } | 1061 | } |
| 1062 | if (parent_inode) | ||
| 1063 | iput(parent_inode); | ||
| 1061 | } | 1064 | } |
| 1062 | 1065 | ||
| 1063 | static int ceph_snapdir_d_revalidate(struct dentry *dentry, | 1066 | static int ceph_snapdir_d_revalidate(struct dentry *dentry, |
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 39c243acd062..f40b9139e437 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c | |||
| @@ -584,10 +584,14 @@ static void queue_realm_cap_snaps(struct ceph_snap_realm *realm) | |||
| 584 | if (lastinode) | 584 | if (lastinode) |
| 585 | iput(lastinode); | 585 | iput(lastinode); |
| 586 | 586 | ||
| 587 | dout("queue_realm_cap_snaps %p %llx children\n", realm, realm->ino); | 587 | list_for_each_entry(child, &realm->children, child_item) { |
| 588 | list_for_each_entry(child, &realm->children, child_item) | 588 | dout("queue_realm_cap_snaps %p %llx queue child %p %llx\n", |
| 589 | queue_realm_cap_snaps(child); | 589 | realm, realm->ino, child, child->ino); |
| 590 | list_del_init(&child->dirty_item); | ||
| 591 | list_add(&child->dirty_item, &realm->dirty_item); | ||
| 592 | } | ||
| 590 | 593 | ||
| 594 | list_del_init(&realm->dirty_item); | ||
| 591 | dout("queue_realm_cap_snaps %p %llx done\n", realm, realm->ino); | 595 | dout("queue_realm_cap_snaps %p %llx done\n", realm, realm->ino); |
| 592 | } | 596 | } |
| 593 | 597 | ||
| @@ -683,7 +687,9 @@ more: | |||
| 683 | * queue cap snaps _after_ we've built the new snap contexts, | 687 | * queue cap snaps _after_ we've built the new snap contexts, |
| 684 | * so that i_head_snapc can be set appropriately. | 688 | * so that i_head_snapc can be set appropriately. |
| 685 | */ | 689 | */ |
| 686 | list_for_each_entry(realm, &dirty_realms, dirty_item) { | 690 | while (!list_empty(&dirty_realms)) { |
| 691 | realm = list_first_entry(&dirty_realms, struct ceph_snap_realm, | ||
| 692 | dirty_item); | ||
| 687 | queue_realm_cap_snaps(realm); | 693 | queue_realm_cap_snaps(realm); |
| 688 | } | 694 | } |
| 689 | 695 | ||
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 20b907d76ae2..88fcaa21b801 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
| @@ -207,6 +207,7 @@ struct ceph_dentry_info { | |||
| 207 | struct dentry *dentry; | 207 | struct dentry *dentry; |
| 208 | u64 time; | 208 | u64 time; |
| 209 | u64 offset; | 209 | u64 offset; |
| 210 | struct inode *parent_inode; | ||
| 210 | }; | 211 | }; |
| 211 | 212 | ||
| 212 | struct ceph_inode_xattrs_info { | 213 | struct ceph_inode_xattrs_info { |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 4a3330235d55..a9371b6578c0 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
| @@ -127,5 +127,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); | |||
| 127 | extern const struct export_operations cifs_export_ops; | 127 | extern const struct export_operations cifs_export_ops; |
| 128 | #endif /* EXPERIMENTAL */ | 128 | #endif /* EXPERIMENTAL */ |
| 129 | 129 | ||
| 130 | #define CIFS_VERSION "1.70" | 130 | #define CIFS_VERSION "1.71" |
| 131 | #endif /* _CIFSFS_H */ | 131 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 8d9189f64477..79f641eeda30 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
| @@ -170,7 +170,7 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len) | |||
| 170 | { | 170 | { |
| 171 | int rc, alen, slen; | 171 | int rc, alen, slen; |
| 172 | const char *pct; | 172 | const char *pct; |
| 173 | char *endp, scope_id[13]; | 173 | char scope_id[13]; |
| 174 | struct sockaddr_in *s4 = (struct sockaddr_in *) dst; | 174 | struct sockaddr_in *s4 = (struct sockaddr_in *) dst; |
| 175 | struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst; | 175 | struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst; |
| 176 | 176 | ||
| @@ -197,9 +197,9 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len) | |||
| 197 | memcpy(scope_id, pct + 1, slen); | 197 | memcpy(scope_id, pct + 1, slen); |
| 198 | scope_id[slen] = '\0'; | 198 | scope_id[slen] = '\0'; |
| 199 | 199 | ||
| 200 | s6->sin6_scope_id = (u32) simple_strtoul(pct, &endp, 0); | 200 | rc = strict_strtoul(scope_id, 0, |
| 201 | if (endp != scope_id + slen) | 201 | (unsigned long *)&s6->sin6_scope_id); |
| 202 | return 0; | 202 | rc = (rc == 0) ? 1 : 0; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | return rc; | 205 | return rc; |
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 1adc9625a344..16765703131b 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
| @@ -656,13 +656,13 @@ ssetup_ntlmssp_authenticate: | |||
| 656 | 656 | ||
| 657 | if (type == LANMAN) { | 657 | if (type == LANMAN) { |
| 658 | #ifdef CONFIG_CIFS_WEAK_PW_HASH | 658 | #ifdef CONFIG_CIFS_WEAK_PW_HASH |
| 659 | char lnm_session_key[CIFS_SESS_KEY_SIZE]; | 659 | char lnm_session_key[CIFS_AUTH_RESP_SIZE]; |
| 660 | 660 | ||
| 661 | pSMB->req.hdr.Flags2 &= ~SMBFLG2_UNICODE; | 661 | pSMB->req.hdr.Flags2 &= ~SMBFLG2_UNICODE; |
| 662 | 662 | ||
| 663 | /* no capabilities flags in old lanman negotiation */ | 663 | /* no capabilities flags in old lanman negotiation */ |
| 664 | 664 | ||
| 665 | pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE); | 665 | pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE); |
| 666 | 666 | ||
| 667 | /* Calculate hash with password and copy into bcc_ptr. | 667 | /* Calculate hash with password and copy into bcc_ptr. |
| 668 | * Encryption Key (stored as in cryptkey) gets used if the | 668 | * Encryption Key (stored as in cryptkey) gets used if the |
| @@ -675,8 +675,8 @@ ssetup_ntlmssp_authenticate: | |||
| 675 | true : false, lnm_session_key); | 675 | true : false, lnm_session_key); |
| 676 | 676 | ||
| 677 | ses->flags |= CIFS_SES_LANMAN; | 677 | ses->flags |= CIFS_SES_LANMAN; |
| 678 | memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_SESS_KEY_SIZE); | 678 | memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE); |
| 679 | bcc_ptr += CIFS_SESS_KEY_SIZE; | 679 | bcc_ptr += CIFS_AUTH_RESP_SIZE; |
| 680 | 680 | ||
| 681 | /* can not sign if LANMAN negotiated so no need | 681 | /* can not sign if LANMAN negotiated so no need |
| 682 | to calculate signing key? but what if server | 682 | to calculate signing key? but what if server |
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index 6fc4f319b550..534c1d46e69e 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c | |||
| @@ -46,24 +46,28 @@ static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
| 46 | { | 46 | { |
| 47 | struct dentry *lower_dentry; | 47 | struct dentry *lower_dentry; |
| 48 | struct vfsmount *lower_mnt; | 48 | struct vfsmount *lower_mnt; |
| 49 | struct dentry *dentry_save; | 49 | struct dentry *dentry_save = NULL; |
| 50 | struct vfsmount *vfsmount_save; | 50 | struct vfsmount *vfsmount_save = NULL; |
| 51 | int rc = 1; | 51 | int rc = 1; |
| 52 | 52 | ||
| 53 | if (nd->flags & LOOKUP_RCU) | 53 | if (nd && nd->flags & LOOKUP_RCU) |
| 54 | return -ECHILD; | 54 | return -ECHILD; |
| 55 | 55 | ||
| 56 | lower_dentry = ecryptfs_dentry_to_lower(dentry); | 56 | lower_dentry = ecryptfs_dentry_to_lower(dentry); |
| 57 | lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); | 57 | lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); |
| 58 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) | 58 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) |
| 59 | goto out; | 59 | goto out; |
| 60 | dentry_save = nd->path.dentry; | 60 | if (nd) { |
| 61 | vfsmount_save = nd->path.mnt; | 61 | dentry_save = nd->path.dentry; |
| 62 | nd->path.dentry = lower_dentry; | 62 | vfsmount_save = nd->path.mnt; |
| 63 | nd->path.mnt = lower_mnt; | 63 | nd->path.dentry = lower_dentry; |
| 64 | nd->path.mnt = lower_mnt; | ||
| 65 | } | ||
| 64 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, nd); | 66 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, nd); |
| 65 | nd->path.dentry = dentry_save; | 67 | if (nd) { |
| 66 | nd->path.mnt = vfsmount_save; | 68 | nd->path.dentry = dentry_save; |
| 69 | nd->path.mnt = vfsmount_save; | ||
| 70 | } | ||
| 67 | if (dentry->d_inode) { | 71 | if (dentry->d_inode) { |
| 68 | struct inode *lower_inode = | 72 | struct inode *lower_inode = |
| 69 | ecryptfs_inode_to_lower(dentry->d_inode); | 73 | ecryptfs_inode_to_lower(dentry->d_inode); |
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index dbc84ed96336..e00753496e3e 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
| @@ -632,8 +632,7 @@ int ecryptfs_interpose(struct dentry *hidden_dentry, | |||
| 632 | u32 flags); | 632 | u32 flags); |
| 633 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | 633 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, |
| 634 | struct dentry *lower_dentry, | 634 | struct dentry *lower_dentry, |
| 635 | struct inode *ecryptfs_dir_inode, | 635 | struct inode *ecryptfs_dir_inode); |
| 636 | struct nameidata *ecryptfs_nd); | ||
| 637 | int ecryptfs_decode_and_decrypt_filename(char **decrypted_name, | 636 | int ecryptfs_decode_and_decrypt_filename(char **decrypted_name, |
| 638 | size_t *decrypted_name_size, | 637 | size_t *decrypted_name_size, |
| 639 | struct dentry *ecryptfs_dentry, | 638 | struct dentry *ecryptfs_dentry, |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 81e10e6a9443..7d1050e254f9 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
| @@ -317,6 +317,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
| 317 | 317 | ||
| 318 | const struct file_operations ecryptfs_dir_fops = { | 318 | const struct file_operations ecryptfs_dir_fops = { |
| 319 | .readdir = ecryptfs_readdir, | 319 | .readdir = ecryptfs_readdir, |
| 320 | .read = generic_read_dir, | ||
| 320 | .unlocked_ioctl = ecryptfs_unlocked_ioctl, | 321 | .unlocked_ioctl = ecryptfs_unlocked_ioctl, |
| 321 | #ifdef CONFIG_COMPAT | 322 | #ifdef CONFIG_COMPAT |
| 322 | .compat_ioctl = ecryptfs_compat_ioctl, | 323 | .compat_ioctl = ecryptfs_compat_ioctl, |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index bd33f87a1907..b592938a84bc 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
| @@ -74,16 +74,20 @@ ecryptfs_create_underlying_file(struct inode *lower_dir_inode, | |||
| 74 | unsigned int flags_save; | 74 | unsigned int flags_save; |
| 75 | int rc; | 75 | int rc; |
| 76 | 76 | ||
| 77 | dentry_save = nd->path.dentry; | 77 | if (nd) { |
| 78 | vfsmount_save = nd->path.mnt; | 78 | dentry_save = nd->path.dentry; |
| 79 | flags_save = nd->flags; | 79 | vfsmount_save = nd->path.mnt; |
| 80 | nd->path.dentry = lower_dentry; | 80 | flags_save = nd->flags; |
| 81 | nd->path.mnt = lower_mnt; | 81 | nd->path.dentry = lower_dentry; |
| 82 | nd->flags &= ~LOOKUP_OPEN; | 82 | nd->path.mnt = lower_mnt; |
| 83 | nd->flags &= ~LOOKUP_OPEN; | ||
| 84 | } | ||
| 83 | rc = vfs_create(lower_dir_inode, lower_dentry, mode, nd); | 85 | rc = vfs_create(lower_dir_inode, lower_dentry, mode, nd); |
| 84 | nd->path.dentry = dentry_save; | 86 | if (nd) { |
| 85 | nd->path.mnt = vfsmount_save; | 87 | nd->path.dentry = dentry_save; |
| 86 | nd->flags = flags_save; | 88 | nd->path.mnt = vfsmount_save; |
| 89 | nd->flags = flags_save; | ||
| 90 | } | ||
| 87 | return rc; | 91 | return rc; |
| 88 | } | 92 | } |
| 89 | 93 | ||
| @@ -241,8 +245,7 @@ out: | |||
| 241 | */ | 245 | */ |
| 242 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | 246 | int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, |
| 243 | struct dentry *lower_dentry, | 247 | struct dentry *lower_dentry, |
| 244 | struct inode *ecryptfs_dir_inode, | 248 | struct inode *ecryptfs_dir_inode) |
| 245 | struct nameidata *ecryptfs_nd) | ||
| 246 | { | 249 | { |
| 247 | struct dentry *lower_dir_dentry; | 250 | struct dentry *lower_dir_dentry; |
| 248 | struct vfsmount *lower_mnt; | 251 | struct vfsmount *lower_mnt; |
| @@ -290,8 +293,6 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, | |||
| 290 | goto out; | 293 | goto out; |
| 291 | if (special_file(lower_inode->i_mode)) | 294 | if (special_file(lower_inode->i_mode)) |
| 292 | goto out; | 295 | goto out; |
| 293 | if (!ecryptfs_nd) | ||
| 294 | goto out; | ||
| 295 | /* Released in this function */ | 296 | /* Released in this function */ |
| 296 | page_virt = kmem_cache_zalloc(ecryptfs_header_cache_2, GFP_USER); | 297 | page_virt = kmem_cache_zalloc(ecryptfs_header_cache_2, GFP_USER); |
| 297 | if (!page_virt) { | 298 | if (!page_virt) { |
| @@ -349,75 +350,6 @@ out: | |||
| 349 | } | 350 | } |
| 350 | 351 | ||
| 351 | /** | 352 | /** |
| 352 | * ecryptfs_new_lower_dentry | ||
| 353 | * @name: The name of the new dentry. | ||
| 354 | * @lower_dir_dentry: Parent directory of the new dentry. | ||
| 355 | * @nd: nameidata from last lookup. | ||
| 356 | * | ||
| 357 | * Create a new dentry or get it from lower parent dir. | ||
| 358 | */ | ||
| 359 | static struct dentry * | ||
| 360 | ecryptfs_new_lower_dentry(struct qstr *name, struct dentry *lower_dir_dentry, | ||
| 361 | struct nameidata *nd) | ||
| 362 | { | ||
| 363 | struct dentry *new_dentry; | ||
| 364 | struct dentry *tmp; | ||
| 365 | struct inode *lower_dir_inode; | ||
| 366 | |||
| 367 | lower_dir_inode = lower_dir_dentry->d_inode; | ||
| 368 | |||
| 369 | tmp = d_alloc(lower_dir_dentry, name); | ||
| 370 | if (!tmp) | ||
| 371 | return ERR_PTR(-ENOMEM); | ||
| 372 | |||
| 373 | mutex_lock(&lower_dir_inode->i_mutex); | ||
| 374 | new_dentry = lower_dir_inode->i_op->lookup(lower_dir_inode, tmp, nd); | ||
| 375 | mutex_unlock(&lower_dir_inode->i_mutex); | ||
| 376 | |||
| 377 | if (!new_dentry) | ||
| 378 | new_dentry = tmp; | ||
| 379 | else | ||
| 380 | dput(tmp); | ||
| 381 | |||
| 382 | return new_dentry; | ||
| 383 | } | ||
| 384 | |||
| 385 | |||
| 386 | /** | ||
| 387 | * ecryptfs_lookup_one_lower | ||
| 388 | * @ecryptfs_dentry: The eCryptfs dentry that we are looking up | ||
| 389 | * @lower_dir_dentry: lower parent directory | ||
| 390 | * @name: lower file name | ||
| 391 | * | ||
| 392 | * Get the lower dentry from vfs. If lower dentry does not exist yet, | ||
| 393 | * create it. | ||
| 394 | */ | ||
| 395 | static struct dentry * | ||
| 396 | ecryptfs_lookup_one_lower(struct dentry *ecryptfs_dentry, | ||
| 397 | struct dentry *lower_dir_dentry, struct qstr *name) | ||
| 398 | { | ||
| 399 | struct nameidata nd; | ||
| 400 | struct vfsmount *lower_mnt; | ||
| 401 | int err; | ||
| 402 | |||
| 403 | lower_mnt = mntget(ecryptfs_dentry_to_lower_mnt( | ||
| 404 | ecryptfs_dentry->d_parent)); | ||
| 405 | err = vfs_path_lookup(lower_dir_dentry, lower_mnt, name->name , 0, &nd); | ||
| 406 | mntput(lower_mnt); | ||
| 407 | |||
| 408 | if (!err) { | ||
| 409 | /* we dont need the mount */ | ||
| 410 | mntput(nd.path.mnt); | ||
| 411 | return nd.path.dentry; | ||
| 412 | } | ||
| 413 | if (err != -ENOENT) | ||
| 414 | return ERR_PTR(err); | ||
| 415 | |||
| 416 | /* create a new lower dentry */ | ||
| 417 | return ecryptfs_new_lower_dentry(name, lower_dir_dentry, &nd); | ||
| 418 | } | ||
| 419 | |||
| 420 | /** | ||
| 421 | * ecryptfs_lookup | 353 | * ecryptfs_lookup |
| 422 | * @ecryptfs_dir_inode: The eCryptfs directory inode | 354 | * @ecryptfs_dir_inode: The eCryptfs directory inode |
| 423 | * @ecryptfs_dentry: The eCryptfs dentry that we are looking up | 355 | * @ecryptfs_dentry: The eCryptfs dentry that we are looking up |
| @@ -434,7 +366,6 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
| 434 | size_t encrypted_and_encoded_name_size; | 366 | size_t encrypted_and_encoded_name_size; |
| 435 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL; | 367 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL; |
| 436 | struct dentry *lower_dir_dentry, *lower_dentry; | 368 | struct dentry *lower_dir_dentry, *lower_dentry; |
| 437 | struct qstr lower_name; | ||
| 438 | int rc = 0; | 369 | int rc = 0; |
| 439 | 370 | ||
| 440 | if ((ecryptfs_dentry->d_name.len == 1 | 371 | if ((ecryptfs_dentry->d_name.len == 1 |
| @@ -444,20 +375,14 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
| 444 | goto out_d_drop; | 375 | goto out_d_drop; |
| 445 | } | 376 | } |
| 446 | lower_dir_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry->d_parent); | 377 | lower_dir_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry->d_parent); |
| 447 | lower_name.name = ecryptfs_dentry->d_name.name; | 378 | mutex_lock(&lower_dir_dentry->d_inode->i_mutex); |
| 448 | lower_name.len = ecryptfs_dentry->d_name.len; | 379 | lower_dentry = lookup_one_len(ecryptfs_dentry->d_name.name, |
| 449 | lower_name.hash = ecryptfs_dentry->d_name.hash; | 380 | lower_dir_dentry, |
| 450 | if (lower_dir_dentry->d_op && lower_dir_dentry->d_op->d_hash) { | 381 | ecryptfs_dentry->d_name.len); |
| 451 | rc = lower_dir_dentry->d_op->d_hash(lower_dir_dentry, | 382 | mutex_unlock(&lower_dir_dentry->d_inode->i_mutex); |
| 452 | lower_dir_dentry->d_inode, &lower_name); | ||
| 453 | if (rc < 0) | ||
| 454 | goto out_d_drop; | ||
| 455 | } | ||
| 456 | lower_dentry = ecryptfs_lookup_one_lower(ecryptfs_dentry, | ||
| 457 | lower_dir_dentry, &lower_name); | ||
| 458 | if (IS_ERR(lower_dentry)) { | 383 | if (IS_ERR(lower_dentry)) { |
| 459 | rc = PTR_ERR(lower_dentry); | 384 | rc = PTR_ERR(lower_dentry); |
| 460 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_lower() returned " | 385 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned " |
| 461 | "[%d] on lower_dentry = [%s]\n", __func__, rc, | 386 | "[%d] on lower_dentry = [%s]\n", __func__, rc, |
| 462 | encrypted_and_encoded_name); | 387 | encrypted_and_encoded_name); |
| 463 | goto out_d_drop; | 388 | goto out_d_drop; |
| @@ -479,28 +404,21 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
| 479 | "filename; rc = [%d]\n", __func__, rc); | 404 | "filename; rc = [%d]\n", __func__, rc); |
| 480 | goto out_d_drop; | 405 | goto out_d_drop; |
| 481 | } | 406 | } |
| 482 | lower_name.name = encrypted_and_encoded_name; | 407 | mutex_lock(&lower_dir_dentry->d_inode->i_mutex); |
| 483 | lower_name.len = encrypted_and_encoded_name_size; | 408 | lower_dentry = lookup_one_len(encrypted_and_encoded_name, |
| 484 | lower_name.hash = full_name_hash(lower_name.name, lower_name.len); | 409 | lower_dir_dentry, |
| 485 | if (lower_dir_dentry->d_op && lower_dir_dentry->d_op->d_hash) { | 410 | encrypted_and_encoded_name_size); |
| 486 | rc = lower_dir_dentry->d_op->d_hash(lower_dir_dentry, | 411 | mutex_unlock(&lower_dir_dentry->d_inode->i_mutex); |
| 487 | lower_dir_dentry->d_inode, &lower_name); | ||
| 488 | if (rc < 0) | ||
| 489 | goto out_d_drop; | ||
| 490 | } | ||
| 491 | lower_dentry = ecryptfs_lookup_one_lower(ecryptfs_dentry, | ||
| 492 | lower_dir_dentry, &lower_name); | ||
| 493 | if (IS_ERR(lower_dentry)) { | 412 | if (IS_ERR(lower_dentry)) { |
| 494 | rc = PTR_ERR(lower_dentry); | 413 | rc = PTR_ERR(lower_dentry); |
| 495 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_lower() returned " | 414 | ecryptfs_printk(KERN_DEBUG, "%s: lookup_one_len() returned " |
| 496 | "[%d] on lower_dentry = [%s]\n", __func__, rc, | 415 | "[%d] on lower_dentry = [%s]\n", __func__, rc, |
| 497 | encrypted_and_encoded_name); | 416 | encrypted_and_encoded_name); |
| 498 | goto out_d_drop; | 417 | goto out_d_drop; |
| 499 | } | 418 | } |
| 500 | lookup_and_interpose: | 419 | lookup_and_interpose: |
| 501 | rc = ecryptfs_lookup_and_interpose_lower(ecryptfs_dentry, lower_dentry, | 420 | rc = ecryptfs_lookup_and_interpose_lower(ecryptfs_dentry, lower_dentry, |
| 502 | ecryptfs_dir_inode, | 421 | ecryptfs_dir_inode); |
| 503 | ecryptfs_nd); | ||
| 504 | goto out; | 422 | goto out; |
| 505 | out_d_drop: | 423 | out_d_drop: |
| 506 | d_drop(ecryptfs_dentry); | 424 | d_drop(ecryptfs_dentry); |
| @@ -1092,6 +1010,8 @@ int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry, | |||
| 1092 | rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry), | 1010 | rc = vfs_getattr(ecryptfs_dentry_to_lower_mnt(dentry), |
| 1093 | ecryptfs_dentry_to_lower(dentry), &lower_stat); | 1011 | ecryptfs_dentry_to_lower(dentry), &lower_stat); |
| 1094 | if (!rc) { | 1012 | if (!rc) { |
| 1013 | fsstack_copy_attr_all(dentry->d_inode, | ||
| 1014 | ecryptfs_inode_to_lower(dentry->d_inode)); | ||
| 1095 | generic_fillattr(dentry->d_inode, stat); | 1015 | generic_fillattr(dentry->d_inode, stat); |
| 1096 | stat->blocks = lower_stat.blocks; | 1016 | stat->blocks = lower_stat.blocks; |
| 1097 | } | 1017 | } |
diff --git a/fs/eventfd.c b/fs/eventfd.c index e0194b3e14d6..d9a591773919 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c | |||
| @@ -99,7 +99,7 @@ EXPORT_SYMBOL_GPL(eventfd_ctx_get); | |||
| 99 | * @ctx: [in] Pointer to eventfd context. | 99 | * @ctx: [in] Pointer to eventfd context. |
| 100 | * | 100 | * |
| 101 | * The eventfd context reference must have been previously acquired either | 101 | * The eventfd context reference must have been previously acquired either |
| 102 | * with eventfd_ctx_get() or eventfd_ctx_fdget()). | 102 | * with eventfd_ctx_get() or eventfd_ctx_fdget(). |
| 103 | */ | 103 | */ |
| 104 | void eventfd_ctx_put(struct eventfd_ctx *ctx) | 104 | void eventfd_ctx_put(struct eventfd_ctx *ctx) |
| 105 | { | 105 | { |
| @@ -146,9 +146,9 @@ static void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt) | |||
| 146 | * eventfd_ctx_remove_wait_queue - Read the current counter and removes wait queue. | 146 | * eventfd_ctx_remove_wait_queue - Read the current counter and removes wait queue. |
| 147 | * @ctx: [in] Pointer to eventfd context. | 147 | * @ctx: [in] Pointer to eventfd context. |
| 148 | * @wait: [in] Wait queue to be removed. | 148 | * @wait: [in] Wait queue to be removed. |
| 149 | * @cnt: [out] Pointer to the 64bit conter value. | 149 | * @cnt: [out] Pointer to the 64-bit counter value. |
| 150 | * | 150 | * |
| 151 | * Returns zero if successful, or the following error codes: | 151 | * Returns %0 if successful, or the following error codes: |
| 152 | * | 152 | * |
| 153 | * -EAGAIN : The operation would have blocked. | 153 | * -EAGAIN : The operation would have blocked. |
| 154 | * | 154 | * |
| @@ -175,11 +175,11 @@ EXPORT_SYMBOL_GPL(eventfd_ctx_remove_wait_queue); | |||
| 175 | * eventfd_ctx_read - Reads the eventfd counter or wait if it is zero. | 175 | * eventfd_ctx_read - Reads the eventfd counter or wait if it is zero. |
| 176 | * @ctx: [in] Pointer to eventfd context. | 176 | * @ctx: [in] Pointer to eventfd context. |
| 177 | * @no_wait: [in] Different from zero if the operation should not block. | 177 | * @no_wait: [in] Different from zero if the operation should not block. |
| 178 | * @cnt: [out] Pointer to the 64bit conter value. | 178 | * @cnt: [out] Pointer to the 64-bit counter value. |
| 179 | * | 179 | * |
| 180 | * Returns zero if successful, or the following error codes: | 180 | * Returns %0 if successful, or the following error codes: |
| 181 | * | 181 | * |
| 182 | * -EAGAIN : The operation would have blocked but @no_wait was nonzero. | 182 | * -EAGAIN : The operation would have blocked but @no_wait was non-zero. |
| 183 | * -ERESTARTSYS : A signal interrupted the wait operation. | 183 | * -ERESTARTSYS : A signal interrupted the wait operation. |
| 184 | * | 184 | * |
| 185 | * If @no_wait is zero, the function might sleep until the eventfd internal | 185 | * If @no_wait is zero, the function might sleep until the eventfd internal |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 267d0ada4541..4a09af9e9a63 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
| @@ -63,6 +63,13 @@ | |||
| 63 | * cleanup path and it is also acquired by eventpoll_release_file() | 63 | * cleanup path and it is also acquired by eventpoll_release_file() |
| 64 | * if a file has been pushed inside an epoll set and it is then | 64 | * if a file has been pushed inside an epoll set and it is then |
| 65 | * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL). | 65 | * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL). |
| 66 | * It is also acquired when inserting an epoll fd onto another epoll | ||
| 67 | * fd. We do this so that we walk the epoll tree and ensure that this | ||
| 68 | * insertion does not create a cycle of epoll file descriptors, which | ||
| 69 | * could lead to deadlock. We need a global mutex to prevent two | ||
| 70 | * simultaneous inserts (A into B and B into A) from racing and | ||
| 71 | * constructing a cycle without either insert observing that it is | ||
| 72 | * going to. | ||
| 66 | * It is possible to drop the "ep->mtx" and to use the global | 73 | * It is possible to drop the "ep->mtx" and to use the global |
| 67 | * mutex "epmutex" (together with "ep->lock") to have it working, | 74 | * mutex "epmutex" (together with "ep->lock") to have it working, |
| 68 | * but having "ep->mtx" will make the interface more scalable. | 75 | * but having "ep->mtx" will make the interface more scalable. |
| @@ -224,6 +231,9 @@ static long max_user_watches __read_mostly; | |||
| 224 | */ | 231 | */ |
| 225 | static DEFINE_MUTEX(epmutex); | 232 | static DEFINE_MUTEX(epmutex); |
| 226 | 233 | ||
| 234 | /* Used to check for epoll file descriptor inclusion loops */ | ||
| 235 | static struct nested_calls poll_loop_ncalls; | ||
| 236 | |||
| 227 | /* Used for safe wake up implementation */ | 237 | /* Used for safe wake up implementation */ |
| 228 | static struct nested_calls poll_safewake_ncalls; | 238 | static struct nested_calls poll_safewake_ncalls; |
| 229 | 239 | ||
| @@ -1198,6 +1208,62 @@ retry: | |||
| 1198 | return res; | 1208 | return res; |
| 1199 | } | 1209 | } |
| 1200 | 1210 | ||
| 1211 | /** | ||
| 1212 | * ep_loop_check_proc - Callback function to be passed to the @ep_call_nested() | ||
| 1213 | * API, to verify that adding an epoll file inside another | ||
| 1214 | * epoll structure, does not violate the constraints, in | ||
| 1215 | * terms of closed loops, or too deep chains (which can | ||
| 1216 | * result in excessive stack usage). | ||
| 1217 | * | ||
| 1218 | * @priv: Pointer to the epoll file to be currently checked. | ||
| 1219 | * @cookie: Original cookie for this call. This is the top-of-the-chain epoll | ||
| 1220 | * data structure pointer. | ||
| 1221 | * @call_nests: Current dept of the @ep_call_nested() call stack. | ||
| 1222 | * | ||
| 1223 | * Returns: Returns zero if adding the epoll @file inside current epoll | ||
| 1224 | * structure @ep does not violate the constraints, or -1 otherwise. | ||
| 1225 | */ | ||
| 1226 | static int ep_loop_check_proc(void *priv, void *cookie, int call_nests) | ||
| 1227 | { | ||
| 1228 | int error = 0; | ||
| 1229 | struct file *file = priv; | ||
| 1230 | struct eventpoll *ep = file->private_data; | ||
| 1231 | struct rb_node *rbp; | ||
| 1232 | struct epitem *epi; | ||
| 1233 | |||
| 1234 | mutex_lock(&ep->mtx); | ||
| 1235 | for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) { | ||
| 1236 | epi = rb_entry(rbp, struct epitem, rbn); | ||
| 1237 | if (unlikely(is_file_epoll(epi->ffd.file))) { | ||
| 1238 | error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, | ||
| 1239 | ep_loop_check_proc, epi->ffd.file, | ||
| 1240 | epi->ffd.file->private_data, current); | ||
| 1241 | if (error != 0) | ||
| 1242 | break; | ||
| 1243 | } | ||
| 1244 | } | ||
| 1245 | mutex_unlock(&ep->mtx); | ||
| 1246 | |||
| 1247 | return error; | ||
| 1248 | } | ||
| 1249 | |||
| 1250 | /** | ||
| 1251 | * ep_loop_check - Performs a check to verify that adding an epoll file (@file) | ||
| 1252 | * another epoll file (represented by @ep) does not create | ||
| 1253 | * closed loops or too deep chains. | ||
| 1254 | * | ||
| 1255 | * @ep: Pointer to the epoll private data structure. | ||
| 1256 | * @file: Pointer to the epoll file to be checked. | ||
| 1257 | * | ||
| 1258 | * Returns: Returns zero if adding the epoll @file inside current epoll | ||
| 1259 | * structure @ep does not violate the constraints, or -1 otherwise. | ||
| 1260 | */ | ||
| 1261 | static int ep_loop_check(struct eventpoll *ep, struct file *file) | ||
| 1262 | { | ||
| 1263 | return ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, | ||
| 1264 | ep_loop_check_proc, file, ep, current); | ||
| 1265 | } | ||
| 1266 | |||
| 1201 | /* | 1267 | /* |
| 1202 | * Open an eventpoll file descriptor. | 1268 | * Open an eventpoll file descriptor. |
| 1203 | */ | 1269 | */ |
| @@ -1246,6 +1312,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | |||
| 1246 | struct epoll_event __user *, event) | 1312 | struct epoll_event __user *, event) |
| 1247 | { | 1313 | { |
| 1248 | int error; | 1314 | int error; |
| 1315 | int did_lock_epmutex = 0; | ||
| 1249 | struct file *file, *tfile; | 1316 | struct file *file, *tfile; |
| 1250 | struct eventpoll *ep; | 1317 | struct eventpoll *ep; |
| 1251 | struct epitem *epi; | 1318 | struct epitem *epi; |
| @@ -1287,6 +1354,25 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | |||
| 1287 | */ | 1354 | */ |
| 1288 | ep = file->private_data; | 1355 | ep = file->private_data; |
| 1289 | 1356 | ||
| 1357 | /* | ||
| 1358 | * When we insert an epoll file descriptor, inside another epoll file | ||
| 1359 | * descriptor, there is the change of creating closed loops, which are | ||
| 1360 | * better be handled here, than in more critical paths. | ||
| 1361 | * | ||
| 1362 | * We hold epmutex across the loop check and the insert in this case, in | ||
| 1363 | * order to prevent two separate inserts from racing and each doing the | ||
| 1364 | * insert "at the same time" such that ep_loop_check passes on both | ||
| 1365 | * before either one does the insert, thereby creating a cycle. | ||
| 1366 | */ | ||
| 1367 | if (unlikely(is_file_epoll(tfile) && op == EPOLL_CTL_ADD)) { | ||
| 1368 | mutex_lock(&epmutex); | ||
| 1369 | did_lock_epmutex = 1; | ||
| 1370 | error = -ELOOP; | ||
| 1371 | if (ep_loop_check(ep, tfile) != 0) | ||
| 1372 | goto error_tgt_fput; | ||
| 1373 | } | ||
| 1374 | |||
| 1375 | |||
| 1290 | mutex_lock(&ep->mtx); | 1376 | mutex_lock(&ep->mtx); |
| 1291 | 1377 | ||
| 1292 | /* | 1378 | /* |
| @@ -1322,6 +1408,9 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, | |||
| 1322 | mutex_unlock(&ep->mtx); | 1408 | mutex_unlock(&ep->mtx); |
| 1323 | 1409 | ||
| 1324 | error_tgt_fput: | 1410 | error_tgt_fput: |
| 1411 | if (unlikely(did_lock_epmutex)) | ||
| 1412 | mutex_unlock(&epmutex); | ||
| 1413 | |||
| 1325 | fput(tfile); | 1414 | fput(tfile); |
| 1326 | error_fput: | 1415 | error_fput: |
| 1327 | fput(file); | 1416 | fput(file); |
| @@ -1441,6 +1530,12 @@ static int __init eventpoll_init(void) | |||
| 1441 | EP_ITEM_COST; | 1530 | EP_ITEM_COST; |
| 1442 | BUG_ON(max_user_watches < 0); | 1531 | BUG_ON(max_user_watches < 0); |
| 1443 | 1532 | ||
| 1533 | /* | ||
| 1534 | * Initialize the structure used to perform epoll file descriptor | ||
| 1535 | * inclusion loops checks. | ||
| 1536 | */ | ||
| 1537 | ep_nested_calls_init(&poll_loop_ncalls); | ||
| 1538 | |||
| 1444 | /* Initialize the structure used to perform safe poll wait head wake ups */ | 1539 | /* Initialize the structure used to perform safe poll wait head wake ups */ |
| 1445 | ep_nested_calls_init(&poll_safewake_ncalls); | 1540 | ep_nested_calls_init(&poll_safewake_ncalls); |
| 1446 | 1541 | ||
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index bfed8447ed80..83543b5ff941 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
| @@ -1283,8 +1283,11 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, | |||
| 1283 | if (err) | 1283 | if (err) |
| 1284 | return err; | 1284 | return err; |
| 1285 | 1285 | ||
| 1286 | if ((attr->ia_valid & ATTR_OPEN) && fc->atomic_o_trunc) | 1286 | if (attr->ia_valid & ATTR_OPEN) { |
| 1287 | return 0; | 1287 | if (fc->atomic_o_trunc) |
| 1288 | return 0; | ||
| 1289 | file = NULL; | ||
| 1290 | } | ||
| 1288 | 1291 | ||
| 1289 | if (attr->ia_valid & ATTR_SIZE) | 1292 | if (attr->ia_valid & ATTR_SIZE) |
| 1290 | is_truncate = true; | 1293 | is_truncate = true; |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 95da1bc1c826..9e0832dbb1e3 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
| @@ -86,18 +86,52 @@ struct fuse_file *fuse_file_get(struct fuse_file *ff) | |||
| 86 | return ff; | 86 | return ff; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | static void fuse_release_async(struct work_struct *work) | ||
| 90 | { | ||
| 91 | struct fuse_req *req; | ||
| 92 | struct fuse_conn *fc; | ||
| 93 | struct path path; | ||
| 94 | |||
| 95 | req = container_of(work, struct fuse_req, misc.release.work); | ||
| 96 | path = req->misc.release.path; | ||
| 97 | fc = get_fuse_conn(path.dentry->d_inode); | ||
| 98 | |||
| 99 | fuse_put_request(fc, req); | ||
| 100 | path_put(&path); | ||
| 101 | } | ||
| 102 | |||
| 89 | static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) | 103 | static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) |
| 90 | { | 104 | { |
| 91 | path_put(&req->misc.release.path); | 105 | if (fc->destroy_req) { |
| 106 | /* | ||
| 107 | * If this is a fuseblk mount, then it's possible that | ||
| 108 | * releasing the path will result in releasing the | ||
| 109 | * super block and sending the DESTROY request. If | ||
| 110 | * the server is single threaded, this would hang. | ||
| 111 | * For this reason do the path_put() in a separate | ||
| 112 | * thread. | ||
| 113 | */ | ||
| 114 | atomic_inc(&req->count); | ||
| 115 | INIT_WORK(&req->misc.release.work, fuse_release_async); | ||
| 116 | schedule_work(&req->misc.release.work); | ||
| 117 | } else { | ||
| 118 | path_put(&req->misc.release.path); | ||
| 119 | } | ||
| 92 | } | 120 | } |
| 93 | 121 | ||
| 94 | static void fuse_file_put(struct fuse_file *ff) | 122 | static void fuse_file_put(struct fuse_file *ff, bool sync) |
| 95 | { | 123 | { |
| 96 | if (atomic_dec_and_test(&ff->count)) { | 124 | if (atomic_dec_and_test(&ff->count)) { |
| 97 | struct fuse_req *req = ff->reserved_req; | 125 | struct fuse_req *req = ff->reserved_req; |
| 98 | 126 | ||
| 99 | req->end = fuse_release_end; | 127 | if (sync) { |
| 100 | fuse_request_send_background(ff->fc, req); | 128 | fuse_request_send(ff->fc, req); |
| 129 | path_put(&req->misc.release.path); | ||
| 130 | fuse_put_request(ff->fc, req); | ||
| 131 | } else { | ||
| 132 | req->end = fuse_release_end; | ||
| 133 | fuse_request_send_background(ff->fc, req); | ||
| 134 | } | ||
| 101 | kfree(ff); | 135 | kfree(ff); |
| 102 | } | 136 | } |
| 103 | } | 137 | } |
| @@ -219,8 +253,12 @@ void fuse_release_common(struct file *file, int opcode) | |||
| 219 | * Normally this will send the RELEASE request, however if | 253 | * Normally this will send the RELEASE request, however if |
| 220 | * some asynchronous READ or WRITE requests are outstanding, | 254 | * some asynchronous READ or WRITE requests are outstanding, |
| 221 | * the sending will be delayed. | 255 | * the sending will be delayed. |
| 256 | * | ||
| 257 | * Make the release synchronous if this is a fuseblk mount, | ||
| 258 | * synchronous RELEASE is allowed (and desirable) in this case | ||
| 259 | * because the server can be trusted not to screw up. | ||
| 222 | */ | 260 | */ |
| 223 | fuse_file_put(ff); | 261 | fuse_file_put(ff, ff->fc->destroy_req != NULL); |
| 224 | } | 262 | } |
| 225 | 263 | ||
| 226 | static int fuse_open(struct inode *inode, struct file *file) | 264 | static int fuse_open(struct inode *inode, struct file *file) |
| @@ -558,7 +596,7 @@ static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req) | |||
| 558 | page_cache_release(page); | 596 | page_cache_release(page); |
| 559 | } | 597 | } |
| 560 | if (req->ff) | 598 | if (req->ff) |
| 561 | fuse_file_put(req->ff); | 599 | fuse_file_put(req->ff, false); |
| 562 | } | 600 | } |
| 563 | 601 | ||
| 564 | static void fuse_send_readpages(struct fuse_req *req, struct file *file) | 602 | static void fuse_send_readpages(struct fuse_req *req, struct file *file) |
| @@ -1137,7 +1175,7 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf, | |||
| 1137 | static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) | 1175 | static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) |
| 1138 | { | 1176 | { |
| 1139 | __free_page(req->pages[0]); | 1177 | __free_page(req->pages[0]); |
| 1140 | fuse_file_put(req->ff); | 1178 | fuse_file_put(req->ff, false); |
| 1141 | } | 1179 | } |
| 1142 | 1180 | ||
| 1143 | static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req) | 1181 | static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req) |
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index ae5744a2f9e9..d4286947bc2c 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/rwsem.h> | 21 | #include <linux/rwsem.h> |
| 22 | #include <linux/rbtree.h> | 22 | #include <linux/rbtree.h> |
| 23 | #include <linux/poll.h> | 23 | #include <linux/poll.h> |
| 24 | #include <linux/workqueue.h> | ||
| 24 | 25 | ||
| 25 | /** Max number of pages that can be used in a single read request */ | 26 | /** Max number of pages that can be used in a single read request */ |
| 26 | #define FUSE_MAX_PAGES_PER_REQ 32 | 27 | #define FUSE_MAX_PAGES_PER_REQ 32 |
| @@ -262,7 +263,10 @@ struct fuse_req { | |||
| 262 | /** Data for asynchronous requests */ | 263 | /** Data for asynchronous requests */ |
| 263 | union { | 264 | union { |
| 264 | struct { | 265 | struct { |
| 265 | struct fuse_release_in in; | 266 | union { |
| 267 | struct fuse_release_in in; | ||
| 268 | struct work_struct work; | ||
| 269 | }; | ||
| 266 | struct path path; | 270 | struct path path; |
| 267 | } release; | 271 | } release; |
| 268 | struct fuse_init_in init_in; | 272 | struct fuse_init_in init_in; |
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 08a8beb152e6..7cd9a5a68d59 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
| @@ -1779,11 +1779,11 @@ int __init gfs2_glock_init(void) | |||
| 1779 | #endif | 1779 | #endif |
| 1780 | 1780 | ||
| 1781 | glock_workqueue = alloc_workqueue("glock_workqueue", WQ_MEM_RECLAIM | | 1781 | glock_workqueue = alloc_workqueue("glock_workqueue", WQ_MEM_RECLAIM | |
| 1782 | WQ_HIGHPRI | WQ_FREEZEABLE, 0); | 1782 | WQ_HIGHPRI | WQ_FREEZABLE, 0); |
| 1783 | if (IS_ERR(glock_workqueue)) | 1783 | if (IS_ERR(glock_workqueue)) |
| 1784 | return PTR_ERR(glock_workqueue); | 1784 | return PTR_ERR(glock_workqueue); |
| 1785 | gfs2_delete_workqueue = alloc_workqueue("delete_workqueue", | 1785 | gfs2_delete_workqueue = alloc_workqueue("delete_workqueue", |
| 1786 | WQ_MEM_RECLAIM | WQ_FREEZEABLE, | 1786 | WQ_MEM_RECLAIM | WQ_FREEZABLE, |
| 1787 | 0); | 1787 | 0); |
| 1788 | if (IS_ERR(gfs2_delete_workqueue)) { | 1788 | if (IS_ERR(gfs2_delete_workqueue)) { |
| 1789 | destroy_workqueue(glock_workqueue); | 1789 | destroy_workqueue(glock_workqueue); |
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index ebef7ab6e17e..72c31a315d96 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c | |||
| @@ -59,14 +59,7 @@ static void gfs2_init_gl_aspace_once(void *foo) | |||
| 59 | struct address_space *mapping = (struct address_space *)(gl + 1); | 59 | struct address_space *mapping = (struct address_space *)(gl + 1); |
| 60 | 60 | ||
| 61 | gfs2_init_glock_once(gl); | 61 | gfs2_init_glock_once(gl); |
| 62 | memset(mapping, 0, sizeof(*mapping)); | 62 | address_space_init_once(mapping); |
| 63 | INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); | ||
| 64 | spin_lock_init(&mapping->tree_lock); | ||
| 65 | spin_lock_init(&mapping->i_mmap_lock); | ||
| 66 | INIT_LIST_HEAD(&mapping->private_list); | ||
| 67 | spin_lock_init(&mapping->private_lock); | ||
| 68 | INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); | ||
| 69 | INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); | ||
| 70 | } | 63 | } |
| 71 | 64 | ||
| 72 | /** | 65 | /** |
| @@ -144,7 +137,7 @@ static int __init init_gfs2_fs(void) | |||
| 144 | 137 | ||
| 145 | error = -ENOMEM; | 138 | error = -ENOMEM; |
| 146 | gfs_recovery_wq = alloc_workqueue("gfs_recovery", | 139 | gfs_recovery_wq = alloc_workqueue("gfs_recovery", |
| 147 | WQ_MEM_RECLAIM | WQ_FREEZEABLE, 0); | 140 | WQ_MEM_RECLAIM | WQ_FREEZABLE, 0); |
| 148 | if (!gfs_recovery_wq) | 141 | if (!gfs_recovery_wq) |
| 149 | goto fail_wq; | 142 | goto fail_wq; |
| 150 | 143 | ||
diff --git a/fs/inode.c b/fs/inode.c index da85e56378f3..0647d80accf6 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
| @@ -295,6 +295,20 @@ static void destroy_inode(struct inode *inode) | |||
| 295 | call_rcu(&inode->i_rcu, i_callback); | 295 | call_rcu(&inode->i_rcu, i_callback); |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | void address_space_init_once(struct address_space *mapping) | ||
| 299 | { | ||
| 300 | memset(mapping, 0, sizeof(*mapping)); | ||
| 301 | INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); | ||
| 302 | spin_lock_init(&mapping->tree_lock); | ||
| 303 | spin_lock_init(&mapping->i_mmap_lock); | ||
| 304 | INIT_LIST_HEAD(&mapping->private_list); | ||
| 305 | spin_lock_init(&mapping->private_lock); | ||
| 306 | INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); | ||
| 307 | INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); | ||
| 308 | mutex_init(&mapping->unmap_mutex); | ||
| 309 | } | ||
| 310 | EXPORT_SYMBOL(address_space_init_once); | ||
| 311 | |||
| 298 | /* | 312 | /* |
| 299 | * These are initializations that only need to be done | 313 | * These are initializations that only need to be done |
| 300 | * once, because the fields are idempotent across use | 314 | * once, because the fields are idempotent across use |
| @@ -308,13 +322,7 @@ void inode_init_once(struct inode *inode) | |||
| 308 | INIT_LIST_HEAD(&inode->i_devices); | 322 | INIT_LIST_HEAD(&inode->i_devices); |
| 309 | INIT_LIST_HEAD(&inode->i_wb_list); | 323 | INIT_LIST_HEAD(&inode->i_wb_list); |
| 310 | INIT_LIST_HEAD(&inode->i_lru); | 324 | INIT_LIST_HEAD(&inode->i_lru); |
| 311 | INIT_RADIX_TREE(&inode->i_data.page_tree, GFP_ATOMIC); | 325 | address_space_init_once(&inode->i_data); |
| 312 | spin_lock_init(&inode->i_data.tree_lock); | ||
| 313 | spin_lock_init(&inode->i_data.i_mmap_lock); | ||
| 314 | INIT_LIST_HEAD(&inode->i_data.private_list); | ||
| 315 | spin_lock_init(&inode->i_data.private_lock); | ||
| 316 | INIT_RAW_PRIO_TREE_ROOT(&inode->i_data.i_mmap); | ||
| 317 | INIT_LIST_HEAD(&inode->i_data.i_mmap_nonlinear); | ||
| 318 | i_size_ordered_init(inode); | 326 | i_size_ordered_init(inode); |
| 319 | #ifdef CONFIG_FSNOTIFY | 327 | #ifdef CONFIG_FSNOTIFY |
| 320 | INIT_HLIST_HEAD(&inode->i_fsnotify_marks); | 328 | INIT_HLIST_HEAD(&inode->i_fsnotify_marks); |
| @@ -540,11 +548,14 @@ void evict_inodes(struct super_block *sb) | |||
| 540 | /** | 548 | /** |
| 541 | * invalidate_inodes - attempt to free all inodes on a superblock | 549 | * invalidate_inodes - attempt to free all inodes on a superblock |
| 542 | * @sb: superblock to operate on | 550 | * @sb: superblock to operate on |
| 551 | * @kill_dirty: flag to guide handling of dirty inodes | ||
| 543 | * | 552 | * |
| 544 | * Attempts to free all inodes for a given superblock. If there were any | 553 | * Attempts to free all inodes for a given superblock. If there were any |
| 545 | * busy inodes return a non-zero value, else zero. | 554 | * busy inodes return a non-zero value, else zero. |
| 555 | * If @kill_dirty is set, discard dirty inodes too, otherwise treat | ||
| 556 | * them as busy. | ||
| 546 | */ | 557 | */ |
| 547 | int invalidate_inodes(struct super_block *sb) | 558 | int invalidate_inodes(struct super_block *sb, bool kill_dirty) |
| 548 | { | 559 | { |
| 549 | int busy = 0; | 560 | int busy = 0; |
| 550 | struct inode *inode, *next; | 561 | struct inode *inode, *next; |
| @@ -556,6 +567,10 @@ int invalidate_inodes(struct super_block *sb) | |||
| 556 | list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { | 567 | list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { |
| 557 | if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) | 568 | if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) |
| 558 | continue; | 569 | continue; |
| 570 | if (inode->i_state & I_DIRTY && !kill_dirty) { | ||
| 571 | busy = 1; | ||
| 572 | continue; | ||
| 573 | } | ||
| 559 | if (atomic_read(&inode->i_count)) { | 574 | if (atomic_read(&inode->i_count)) { |
| 560 | busy = 1; | 575 | busy = 1; |
| 561 | continue; | 576 | continue; |
diff --git a/fs/internal.h b/fs/internal.h index 0663568b1247..9b976b57d7fe 100644 --- a/fs/internal.h +++ b/fs/internal.h | |||
| @@ -112,4 +112,4 @@ extern void release_open_intent(struct nameidata *); | |||
| 112 | */ | 112 | */ |
| 113 | extern int get_nr_dirty_inodes(void); | 113 | extern int get_nr_dirty_inodes(void); |
| 114 | extern void evict_inodes(struct super_block *); | 114 | extern void evict_inodes(struct super_block *); |
| 115 | extern int invalidate_inodes(struct super_block *); | 115 | extern int invalidate_inodes(struct super_block *, bool); |
diff --git a/fs/namei.c b/fs/namei.c index 9e701e28a329..0087cf9c2c6b 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
| @@ -795,7 +795,7 @@ __do_follow_link(const struct path *link, struct nameidata *nd, void **p) | |||
| 795 | * Without that kind of total limit, nasty chains of consecutive | 795 | * Without that kind of total limit, nasty chains of consecutive |
| 796 | * symlinks can cause almost arbitrarily long lookups. | 796 | * symlinks can cause almost arbitrarily long lookups. |
| 797 | */ | 797 | */ |
| 798 | static inline int do_follow_link(struct path *path, struct nameidata *nd) | 798 | static inline int do_follow_link(struct inode *inode, struct path *path, struct nameidata *nd) |
| 799 | { | 799 | { |
| 800 | void *cookie; | 800 | void *cookie; |
| 801 | int err = -ELOOP; | 801 | int err = -ELOOP; |
| @@ -803,6 +803,7 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd) | |||
| 803 | /* We drop rcu-walk here */ | 803 | /* We drop rcu-walk here */ |
| 804 | if (nameidata_dentry_drop_rcu_maybe(nd, path->dentry)) | 804 | if (nameidata_dentry_drop_rcu_maybe(nd, path->dentry)) |
| 805 | return -ECHILD; | 805 | return -ECHILD; |
| 806 | BUG_ON(inode != path->dentry->d_inode); | ||
| 806 | 807 | ||
| 807 | if (current->link_count >= MAX_NESTED_LINKS) | 808 | if (current->link_count >= MAX_NESTED_LINKS) |
| 808 | goto loop; | 809 | goto loop; |
| @@ -1413,8 +1414,7 @@ exec_again: | |||
| 1413 | goto out_dput; | 1414 | goto out_dput; |
| 1414 | 1415 | ||
| 1415 | if (inode->i_op->follow_link) { | 1416 | if (inode->i_op->follow_link) { |
| 1416 | BUG_ON(inode != next.dentry->d_inode); | 1417 | err = do_follow_link(inode, &next, nd); |
| 1417 | err = do_follow_link(&next, nd); | ||
| 1418 | if (err) | 1418 | if (err) |
| 1419 | goto return_err; | 1419 | goto return_err; |
| 1420 | nd->inode = nd->path.dentry->d_inode; | 1420 | nd->inode = nd->path.dentry->d_inode; |
| @@ -1458,8 +1458,7 @@ last_component: | |||
| 1458 | break; | 1458 | break; |
| 1459 | if (inode && unlikely(inode->i_op->follow_link) && | 1459 | if (inode && unlikely(inode->i_op->follow_link) && |
| 1460 | (lookup_flags & LOOKUP_FOLLOW)) { | 1460 | (lookup_flags & LOOKUP_FOLLOW)) { |
| 1461 | BUG_ON(inode != next.dentry->d_inode); | 1461 | err = do_follow_link(inode, &next, nd); |
| 1462 | err = do_follow_link(&next, nd); | ||
| 1463 | if (err) | 1462 | if (err) |
| 1464 | goto return_err; | 1463 | goto return_err; |
| 1465 | nd->inode = nd->path.dentry->d_inode; | 1464 | nd->inode = nd->path.dentry->d_inode; |
diff --git a/fs/namespace.c b/fs/namespace.c index 7b0b95371696..d1edf26025dc 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
| @@ -1244,7 +1244,7 @@ static int do_umount(struct vfsmount *mnt, int flags) | |||
| 1244 | */ | 1244 | */ |
| 1245 | br_write_lock(vfsmount_lock); | 1245 | br_write_lock(vfsmount_lock); |
| 1246 | if (mnt_get_count(mnt) != 2) { | 1246 | if (mnt_get_count(mnt) != 2) { |
| 1247 | br_write_lock(vfsmount_lock); | 1247 | br_write_unlock(vfsmount_lock); |
| 1248 | return -EBUSY; | 1248 | return -EBUSY; |
| 1249 | } | 1249 | } |
| 1250 | br_write_unlock(vfsmount_lock); | 1250 | br_write_unlock(vfsmount_lock); |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 956629b9cdc9..1275b8655070 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
| @@ -317,8 +317,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
| 317 | READ_BUF(dummy32); | 317 | READ_BUF(dummy32); |
| 318 | len += (XDR_QUADLEN(dummy32) << 2); | 318 | len += (XDR_QUADLEN(dummy32) << 2); |
| 319 | READMEM(buf, dummy32); | 319 | READMEM(buf, dummy32); |
| 320 | if ((host_err = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid))) | 320 | if ((status = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid))) |
| 321 | goto out_nfserr; | 321 | return status; |
| 322 | iattr->ia_valid |= ATTR_UID; | 322 | iattr->ia_valid |= ATTR_UID; |
| 323 | } | 323 | } |
| 324 | if (bmval[1] & FATTR4_WORD1_OWNER_GROUP) { | 324 | if (bmval[1] & FATTR4_WORD1_OWNER_GROUP) { |
| @@ -328,8 +328,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
| 328 | READ_BUF(dummy32); | 328 | READ_BUF(dummy32); |
| 329 | len += (XDR_QUADLEN(dummy32) << 2); | 329 | len += (XDR_QUADLEN(dummy32) << 2); |
| 330 | READMEM(buf, dummy32); | 330 | READMEM(buf, dummy32); |
| 331 | if ((host_err = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid))) | 331 | if ((status = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid))) |
| 332 | goto out_nfserr; | 332 | return status; |
| 333 | iattr->ia_valid |= ATTR_GID; | 333 | iattr->ia_valid |= ATTR_GID; |
| 334 | } | 334 | } |
| 335 | if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) { | 335 | if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) { |
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c index 388e9e8f5286..85f7baa15f5d 100644 --- a/fs/nilfs2/btnode.c +++ b/fs/nilfs2/btnode.c | |||
| @@ -35,11 +35,6 @@ | |||
| 35 | #include "btnode.h" | 35 | #include "btnode.h" |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | void nilfs_btnode_cache_init_once(struct address_space *btnc) | ||
| 39 | { | ||
| 40 | nilfs_mapping_init_once(btnc); | ||
| 41 | } | ||
| 42 | |||
| 43 | static const struct address_space_operations def_btnode_aops = { | 38 | static const struct address_space_operations def_btnode_aops = { |
| 44 | .sync_page = block_sync_page, | 39 | .sync_page = block_sync_page, |
| 45 | }; | 40 | }; |
diff --git a/fs/nilfs2/btnode.h b/fs/nilfs2/btnode.h index 79037494f1e0..1b8ebd888c28 100644 --- a/fs/nilfs2/btnode.h +++ b/fs/nilfs2/btnode.h | |||
| @@ -37,7 +37,6 @@ struct nilfs_btnode_chkey_ctxt { | |||
| 37 | struct buffer_head *newbh; | 37 | struct buffer_head *newbh; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | void nilfs_btnode_cache_init_once(struct address_space *); | ||
| 41 | void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *); | 40 | void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *); |
| 42 | void nilfs_btnode_cache_clear(struct address_space *); | 41 | void nilfs_btnode_cache_clear(struct address_space *); |
| 43 | struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc, | 42 | struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc, |
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index 6a0e2a189f60..a0babd2bff6a 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c | |||
| @@ -454,9 +454,9 @@ int nilfs_mdt_setup_shadow_map(struct inode *inode, | |||
| 454 | struct backing_dev_info *bdi = inode->i_sb->s_bdi; | 454 | struct backing_dev_info *bdi = inode->i_sb->s_bdi; |
| 455 | 455 | ||
| 456 | INIT_LIST_HEAD(&shadow->frozen_buffers); | 456 | INIT_LIST_HEAD(&shadow->frozen_buffers); |
| 457 | nilfs_mapping_init_once(&shadow->frozen_data); | 457 | address_space_init_once(&shadow->frozen_data); |
| 458 | nilfs_mapping_init(&shadow->frozen_data, bdi, &shadow_map_aops); | 458 | nilfs_mapping_init(&shadow->frozen_data, bdi, &shadow_map_aops); |
| 459 | nilfs_mapping_init_once(&shadow->frozen_btnodes); | 459 | address_space_init_once(&shadow->frozen_btnodes); |
| 460 | nilfs_mapping_init(&shadow->frozen_btnodes, bdi, &shadow_map_aops); | 460 | nilfs_mapping_init(&shadow->frozen_btnodes, bdi, &shadow_map_aops); |
| 461 | mi->mi_shadow = shadow; | 461 | mi->mi_shadow = shadow; |
| 462 | return 0; | 462 | return 0; |
diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index 0c432416cfef..a585b35fd6bc 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c | |||
| @@ -492,19 +492,6 @@ unsigned nilfs_page_count_clean_buffers(struct page *page, | |||
| 492 | return nc; | 492 | return nc; |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | void nilfs_mapping_init_once(struct address_space *mapping) | ||
| 496 | { | ||
| 497 | memset(mapping, 0, sizeof(*mapping)); | ||
| 498 | INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); | ||
| 499 | spin_lock_init(&mapping->tree_lock); | ||
| 500 | INIT_LIST_HEAD(&mapping->private_list); | ||
| 501 | spin_lock_init(&mapping->private_lock); | ||
| 502 | |||
| 503 | spin_lock_init(&mapping->i_mmap_lock); | ||
| 504 | INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); | ||
| 505 | INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); | ||
| 506 | } | ||
| 507 | |||
| 508 | void nilfs_mapping_init(struct address_space *mapping, | 495 | void nilfs_mapping_init(struct address_space *mapping, |
| 509 | struct backing_dev_info *bdi, | 496 | struct backing_dev_info *bdi, |
| 510 | const struct address_space_operations *aops) | 497 | const struct address_space_operations *aops) |
diff --git a/fs/nilfs2/page.h b/fs/nilfs2/page.h index 622df27cd891..2a00953ebd5f 100644 --- a/fs/nilfs2/page.h +++ b/fs/nilfs2/page.h | |||
| @@ -61,7 +61,6 @@ void nilfs_free_private_page(struct page *); | |||
| 61 | int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); | 61 | int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); |
| 62 | void nilfs_copy_back_pages(struct address_space *, struct address_space *); | 62 | void nilfs_copy_back_pages(struct address_space *, struct address_space *); |
| 63 | void nilfs_clear_dirty_pages(struct address_space *); | 63 | void nilfs_clear_dirty_pages(struct address_space *); |
| 64 | void nilfs_mapping_init_once(struct address_space *mapping); | ||
| 65 | void nilfs_mapping_init(struct address_space *mapping, | 64 | void nilfs_mapping_init(struct address_space *mapping, |
| 66 | struct backing_dev_info *bdi, | 65 | struct backing_dev_info *bdi, |
| 67 | const struct address_space_operations *aops); | 66 | const struct address_space_operations *aops); |
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 58fd707174e1..1673b3d99842 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
| @@ -1279,7 +1279,7 @@ static void nilfs_inode_init_once(void *obj) | |||
| 1279 | #ifdef CONFIG_NILFS_XATTR | 1279 | #ifdef CONFIG_NILFS_XATTR |
| 1280 | init_rwsem(&ii->xattr_sem); | 1280 | init_rwsem(&ii->xattr_sem); |
| 1281 | #endif | 1281 | #endif |
| 1282 | nilfs_btnode_cache_init_once(&ii->i_btnode_cache); | 1282 | address_space_init_once(&ii->i_btnode_cache); |
| 1283 | ii->i_bmap = &ii->i_bmap_data; | 1283 | ii->i_bmap = &ii->i_bmap_data; |
| 1284 | inode_init_once(&ii->vfs_inode); | 1284 | inode_init_once(&ii->vfs_inode); |
| 1285 | } | 1285 | } |
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 43e56b97f9c0..6180da1e37e6 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h | |||
| @@ -405,9 +405,9 @@ static inline int ocfs2_remove_extent_credits(struct super_block *sb) | |||
| 405 | ocfs2_quota_trans_credits(sb); | 405 | ocfs2_quota_trans_credits(sb); |
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | /* data block for new dir/symlink, 2 for bitmap updates (bitmap fe + | 408 | /* data block for new dir/symlink, allocation of directory block, dx_root |
| 409 | * bitmap block for the new bit) dx_root update for free list */ | 409 | * update for free list */ |
| 410 | #define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2 + 1) | 410 | #define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + OCFS2_SUBALLOC_ALLOC + 1) |
| 411 | 411 | ||
| 412 | static inline int ocfs2_add_dir_index_credits(struct super_block *sb) | 412 | static inline int ocfs2_add_dir_index_credits(struct super_block *sb) |
| 413 | { | 413 | { |
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index b5f9160e93e9..19ebc5aad391 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
| @@ -3228,7 +3228,7 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, | |||
| 3228 | u32 num_clusters, unsigned int e_flags) | 3228 | u32 num_clusters, unsigned int e_flags) |
| 3229 | { | 3229 | { |
| 3230 | int ret, delete, index, credits = 0; | 3230 | int ret, delete, index, credits = 0; |
| 3231 | u32 new_bit, new_len; | 3231 | u32 new_bit, new_len, orig_num_clusters; |
| 3232 | unsigned int set_len; | 3232 | unsigned int set_len; |
| 3233 | struct ocfs2_super *osb = OCFS2_SB(sb); | 3233 | struct ocfs2_super *osb = OCFS2_SB(sb); |
| 3234 | handle_t *handle; | 3234 | handle_t *handle; |
| @@ -3261,6 +3261,8 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, | |||
| 3261 | goto out; | 3261 | goto out; |
| 3262 | } | 3262 | } |
| 3263 | 3263 | ||
| 3264 | orig_num_clusters = num_clusters; | ||
| 3265 | |||
| 3264 | while (num_clusters) { | 3266 | while (num_clusters) { |
| 3265 | ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh, | 3267 | ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh, |
| 3266 | p_cluster, num_clusters, | 3268 | p_cluster, num_clusters, |
| @@ -3348,7 +3350,8 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, | |||
| 3348 | * in write-back mode. | 3350 | * in write-back mode. |
| 3349 | */ | 3351 | */ |
| 3350 | if (context->get_clusters == ocfs2_di_get_clusters) { | 3352 | if (context->get_clusters == ocfs2_di_get_clusters) { |
| 3351 | ret = ocfs2_cow_sync_writeback(sb, context, cpos, num_clusters); | 3353 | ret = ocfs2_cow_sync_writeback(sb, context, cpos, |
| 3354 | orig_num_clusters); | ||
| 3352 | if (ret) | 3355 | if (ret) |
| 3353 | mlog_errno(ret); | 3356 | mlog_errno(ret); |
| 3354 | } | 3357 | } |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 38f986d2447e..36c423fb0635 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
| @@ -1316,7 +1316,7 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
| 1316 | struct mount_options *mopt, | 1316 | struct mount_options *mopt, |
| 1317 | int is_remount) | 1317 | int is_remount) |
| 1318 | { | 1318 | { |
| 1319 | int status; | 1319 | int status, user_stack = 0; |
| 1320 | char *p; | 1320 | char *p; |
| 1321 | u32 tmp; | 1321 | u32 tmp; |
| 1322 | 1322 | ||
| @@ -1459,6 +1459,15 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
| 1459 | memcpy(mopt->cluster_stack, args[0].from, | 1459 | memcpy(mopt->cluster_stack, args[0].from, |
| 1460 | OCFS2_STACK_LABEL_LEN); | 1460 | OCFS2_STACK_LABEL_LEN); |
| 1461 | mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; | 1461 | mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; |
| 1462 | /* | ||
| 1463 | * Open code the memcmp here as we don't have | ||
| 1464 | * an osb to pass to | ||
| 1465 | * ocfs2_userspace_stack(). | ||
| 1466 | */ | ||
| 1467 | if (memcmp(mopt->cluster_stack, | ||
| 1468 | OCFS2_CLASSIC_CLUSTER_STACK, | ||
| 1469 | OCFS2_STACK_LABEL_LEN)) | ||
| 1470 | user_stack = 1; | ||
| 1462 | break; | 1471 | break; |
| 1463 | case Opt_inode64: | 1472 | case Opt_inode64: |
| 1464 | mopt->mount_opt |= OCFS2_MOUNT_INODE64; | 1473 | mopt->mount_opt |= OCFS2_MOUNT_INODE64; |
| @@ -1514,13 +1523,16 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
| 1514 | } | 1523 | } |
| 1515 | } | 1524 | } |
| 1516 | 1525 | ||
| 1517 | /* Ensure only one heartbeat mode */ | 1526 | if (user_stack == 0) { |
| 1518 | tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL | | 1527 | /* Ensure only one heartbeat mode */ |
| 1519 | OCFS2_MOUNT_HB_NONE); | 1528 | tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | |
| 1520 | if (hweight32(tmp) != 1) { | 1529 | OCFS2_MOUNT_HB_GLOBAL | |
| 1521 | mlog(ML_ERROR, "Invalid heartbeat mount options\n"); | 1530 | OCFS2_MOUNT_HB_NONE); |
| 1522 | status = 0; | 1531 | if (hweight32(tmp) != 1) { |
| 1523 | goto bail; | 1532 | mlog(ML_ERROR, "Invalid heartbeat mount options\n"); |
| 1533 | status = 0; | ||
| 1534 | goto bail; | ||
| 1535 | } | ||
| 1524 | } | 1536 | } |
| 1525 | 1537 | ||
| 1526 | status = 1; | 1538 | status = 1; |
diff --git a/fs/partitions/ldm.c b/fs/partitions/ldm.c index 789c625c7aa5..b10e3540d5b7 100644 --- a/fs/partitions/ldm.c +++ b/fs/partitions/ldm.c | |||
| @@ -251,6 +251,11 @@ static bool ldm_parse_vmdb (const u8 *data, struct vmdb *vm) | |||
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | vm->vblk_size = get_unaligned_be32(data + 0x08); | 253 | vm->vblk_size = get_unaligned_be32(data + 0x08); |
| 254 | if (vm->vblk_size == 0) { | ||
| 255 | ldm_error ("Illegal VBLK size"); | ||
| 256 | return false; | ||
| 257 | } | ||
| 258 | |||
| 254 | vm->vblk_offset = get_unaligned_be32(data + 0x0C); | 259 | vm->vblk_offset = get_unaligned_be32(data + 0x0C); |
| 255 | vm->last_vblk_seq = get_unaligned_be32(data + 0x04); | 260 | vm->last_vblk_seq = get_unaligned_be32(data + 0x04); |
| 256 | 261 | ||
diff --git a/fs/partitions/mac.c b/fs/partitions/mac.c index 68d6a216ee79..11f688bd76c5 100644 --- a/fs/partitions/mac.c +++ b/fs/partitions/mac.c | |||
| @@ -29,10 +29,9 @@ static inline void mac_fix_string(char *stg, int len) | |||
| 29 | 29 | ||
| 30 | int mac_partition(struct parsed_partitions *state) | 30 | int mac_partition(struct parsed_partitions *state) |
| 31 | { | 31 | { |
| 32 | int slot = 1; | ||
| 33 | Sector sect; | 32 | Sector sect; |
| 34 | unsigned char *data; | 33 | unsigned char *data; |
| 35 | int blk, blocks_in_map; | 34 | int slot, blocks_in_map; |
| 36 | unsigned secsize; | 35 | unsigned secsize; |
| 37 | #ifdef CONFIG_PPC_PMAC | 36 | #ifdef CONFIG_PPC_PMAC |
| 38 | int found_root = 0; | 37 | int found_root = 0; |
| @@ -59,10 +58,14 @@ int mac_partition(struct parsed_partitions *state) | |||
| 59 | put_dev_sector(sect); | 58 | put_dev_sector(sect); |
| 60 | return 0; /* not a MacOS disk */ | 59 | return 0; /* not a MacOS disk */ |
| 61 | } | 60 | } |
| 62 | strlcat(state->pp_buf, " [mac]", PAGE_SIZE); | ||
| 63 | blocks_in_map = be32_to_cpu(part->map_count); | 61 | blocks_in_map = be32_to_cpu(part->map_count); |
| 64 | for (blk = 1; blk <= blocks_in_map; ++blk) { | 62 | if (blocks_in_map < 0 || blocks_in_map >= DISK_MAX_PARTS) { |
| 65 | int pos = blk * secsize; | 63 | put_dev_sector(sect); |
| 64 | return 0; | ||
| 65 | } | ||
| 66 | strlcat(state->pp_buf, " [mac]", PAGE_SIZE); | ||
| 67 | for (slot = 1; slot <= blocks_in_map; ++slot) { | ||
| 68 | int pos = slot * secsize; | ||
| 66 | put_dev_sector(sect); | 69 | put_dev_sector(sect); |
| 67 | data = read_part_sector(state, pos/512, §); | 70 | data = read_part_sector(state, pos/512, §); |
| 68 | if (!data) | 71 | if (!data) |
| @@ -113,13 +116,11 @@ int mac_partition(struct parsed_partitions *state) | |||
| 113 | } | 116 | } |
| 114 | 117 | ||
| 115 | if (goodness > found_root_goodness) { | 118 | if (goodness > found_root_goodness) { |
| 116 | found_root = blk; | 119 | found_root = slot; |
| 117 | found_root_goodness = goodness; | 120 | found_root_goodness = goodness; |
| 118 | } | 121 | } |
| 119 | } | 122 | } |
| 120 | #endif /* CONFIG_PPC_PMAC */ | 123 | #endif /* CONFIG_PPC_PMAC */ |
| 121 | |||
| 122 | ++slot; | ||
| 123 | } | 124 | } |
| 124 | #ifdef CONFIG_PPC_PMAC | 125 | #ifdef CONFIG_PPC_PMAC |
| 125 | if (found_root_goodness) | 126 | if (found_root_goodness) |
diff --git a/fs/xfs/linux-2.6/xfs_discard.c b/fs/xfs/linux-2.6/xfs_discard.c index 05201ae719e5..d61611c88012 100644 --- a/fs/xfs/linux-2.6/xfs_discard.c +++ b/fs/xfs/linux-2.6/xfs_discard.c | |||
| @@ -152,6 +152,8 @@ xfs_ioc_trim( | |||
| 152 | 152 | ||
| 153 | if (!capable(CAP_SYS_ADMIN)) | 153 | if (!capable(CAP_SYS_ADMIN)) |
| 154 | return -XFS_ERROR(EPERM); | 154 | return -XFS_ERROR(EPERM); |
| 155 | if (!blk_queue_discard(q)) | ||
| 156 | return -XFS_ERROR(EOPNOTSUPP); | ||
| 155 | if (copy_from_user(&range, urange, sizeof(range))) | 157 | if (copy_from_user(&range, urange, sizeof(range))) |
| 156 | return -XFS_ERROR(EFAULT); | 158 | return -XFS_ERROR(EFAULT); |
| 157 | 159 | ||
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index cec89dd5d7d2..85668efb3e3e 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c | |||
| @@ -53,6 +53,9 @@ xfs_fs_geometry( | |||
| 53 | xfs_fsop_geom_t *geo, | 53 | xfs_fsop_geom_t *geo, |
| 54 | int new_version) | 54 | int new_version) |
| 55 | { | 55 | { |
| 56 | |||
| 57 | memset(geo, 0, sizeof(*geo)); | ||
| 58 | |||
| 56 | geo->blocksize = mp->m_sb.sb_blocksize; | 59 | geo->blocksize = mp->m_sb.sb_blocksize; |
| 57 | geo->rtextsize = mp->m_sb.sb_rextsize; | 60 | geo->rtextsize = mp->m_sb.sb_rextsize; |
| 58 | geo->agblocks = mp->m_sb.sb_agblocks; | 61 | geo->agblocks = mp->m_sb.sb_agblocks; |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 31b6188df221..b4bfe338ea0e 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
| 5 | #ifdef CONFIG_MMU | 5 | #ifdef CONFIG_MMU |
| 6 | 6 | ||
| 7 | #include <linux/mm_types.h> | ||
| 8 | |||
| 7 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS | 9 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
| 8 | extern int ptep_set_access_flags(struct vm_area_struct *vma, | 10 | extern int ptep_set_access_flags(struct vm_area_struct *vma, |
| 9 | unsigned long address, pte_t *ptep, | 11 | unsigned long address, pte_t *ptep, |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index fe29aadb129d..348843b80150 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -1101,7 +1101,7 @@ struct drm_device { | |||
| 1101 | struct platform_device *platformdev; /**< Platform device struture */ | 1101 | struct platform_device *platformdev; /**< Platform device struture */ |
| 1102 | 1102 | ||
| 1103 | struct drm_sg_mem *sg; /**< Scatter gather memory */ | 1103 | struct drm_sg_mem *sg; /**< Scatter gather memory */ |
| 1104 | int num_crtcs; /**< Number of CRTCs on this device */ | 1104 | unsigned int num_crtcs; /**< Number of CRTCs on this device */ |
| 1105 | void *dev_private; /**< device private data */ | 1105 | void *dev_private; /**< device private data */ |
| 1106 | void *mm_private; | 1106 | void *mm_private; |
| 1107 | struct address_space *dev_mapping; | 1107 | struct address_space *dev_mapping; |
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index 68cd248f6d3e..66900e3c6eb1 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h | |||
| @@ -101,8 +101,8 @@ struct ieee_pfc { | |||
| 101 | */ | 101 | */ |
| 102 | struct dcb_app { | 102 | struct dcb_app { |
| 103 | __u8 selector; | 103 | __u8 selector; |
| 104 | __u32 protocol; | ||
| 105 | __u8 priority; | 104 | __u8 priority; |
| 105 | __u16 protocol; | ||
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | struct dcbmsg { | 108 | struct dcbmsg { |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index da7e52b099f3..1effc8b56b4e 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -109,7 +109,7 @@ static inline void freezer_count(void) | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | /* | 111 | /* |
| 112 | * Check if the task should be counted as freezeable by the freezer | 112 | * Check if the task should be counted as freezable by the freezer |
| 113 | */ | 113 | */ |
| 114 | static inline int freezer_should_skip(struct task_struct *p) | 114 | static inline int freezer_should_skip(struct task_struct *p) |
| 115 | { | 115 | { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index bd3215940c37..e38b50a4b9d2 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -649,6 +649,7 @@ struct address_space { | |||
| 649 | spinlock_t private_lock; /* for use by the address_space */ | 649 | spinlock_t private_lock; /* for use by the address_space */ |
| 650 | struct list_head private_list; /* ditto */ | 650 | struct list_head private_list; /* ditto */ |
| 651 | struct address_space *assoc_mapping; /* ditto */ | 651 | struct address_space *assoc_mapping; /* ditto */ |
| 652 | struct mutex unmap_mutex; /* to protect unmapping */ | ||
| 652 | } __attribute__((aligned(sizeof(long)))); | 653 | } __attribute__((aligned(sizeof(long)))); |
| 653 | /* | 654 | /* |
| 654 | * On most architectures that alignment is already the case; but | 655 | * On most architectures that alignment is already the case; but |
| @@ -2139,7 +2140,7 @@ extern void check_disk_size_change(struct gendisk *disk, | |||
| 2139 | struct block_device *bdev); | 2140 | struct block_device *bdev); |
| 2140 | extern int revalidate_disk(struct gendisk *); | 2141 | extern int revalidate_disk(struct gendisk *); |
| 2141 | extern int check_disk_change(struct block_device *); | 2142 | extern int check_disk_change(struct block_device *); |
| 2142 | extern int __invalidate_device(struct block_device *); | 2143 | extern int __invalidate_device(struct block_device *, bool); |
| 2143 | extern int invalidate_partition(struct gendisk *, int); | 2144 | extern int invalidate_partition(struct gendisk *, int); |
| 2144 | #endif | 2145 | #endif |
| 2145 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2146 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
| @@ -2225,6 +2226,7 @@ extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | |||
| 2225 | 2226 | ||
| 2226 | extern int inode_init_always(struct super_block *, struct inode *); | 2227 | extern int inode_init_always(struct super_block *, struct inode *); |
| 2227 | extern void inode_init_once(struct inode *); | 2228 | extern void inode_init_once(struct inode *); |
| 2229 | extern void address_space_init_once(struct address_space *mapping); | ||
| 2228 | extern void ihold(struct inode * inode); | 2230 | extern void ihold(struct inode * inode); |
| 2229 | extern void iput(struct inode *); | 2231 | extern void iput(struct inode *); |
| 2230 | extern struct inode * igrab(struct inode *); | 2232 | extern struct inode * igrab(struct inode *); |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 61b9609e55f2..9d88b717111a 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -637,7 +637,6 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | |||
| 637 | extern int twl4030_remove_script(u8 flags); | 637 | extern int twl4030_remove_script(u8 flags); |
| 638 | 638 | ||
| 639 | struct twl4030_codec_audio_data { | 639 | struct twl4030_codec_audio_data { |
| 640 | unsigned int audio_mclk; /* not used, will be removed */ | ||
| 641 | unsigned int digimic_delay; /* in ms */ | 640 | unsigned int digimic_delay; /* in ms */ |
| 642 | unsigned int ramp_delay_value; | 641 | unsigned int ramp_delay_value; |
| 643 | unsigned int offset_cncl_path; | 642 | unsigned int offset_cncl_path; |
| @@ -648,7 +647,6 @@ struct twl4030_codec_audio_data { | |||
| 648 | }; | 647 | }; |
| 649 | 648 | ||
| 650 | struct twl4030_codec_vibra_data { | 649 | struct twl4030_codec_vibra_data { |
| 651 | unsigned int audio_mclk; | ||
| 652 | unsigned int coexist; | 650 | unsigned int coexist; |
| 653 | }; | 651 | }; |
| 654 | 652 | ||
diff --git a/include/linux/list.h b/include/linux/list.h index 9a5f8a71810c..3a54266a1e85 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -96,6 +96,11 @@ static inline void __list_del(struct list_head * prev, struct list_head * next) | |||
| 96 | * in an undefined state. | 96 | * in an undefined state. |
| 97 | */ | 97 | */ |
| 98 | #ifndef CONFIG_DEBUG_LIST | 98 | #ifndef CONFIG_DEBUG_LIST |
| 99 | static inline void __list_del_entry(struct list_head *entry) | ||
| 100 | { | ||
| 101 | __list_del(entry->prev, entry->next); | ||
| 102 | } | ||
| 103 | |||
| 99 | static inline void list_del(struct list_head *entry) | 104 | static inline void list_del(struct list_head *entry) |
| 100 | { | 105 | { |
| 101 | __list_del(entry->prev, entry->next); | 106 | __list_del(entry->prev, entry->next); |
| @@ -103,6 +108,7 @@ static inline void list_del(struct list_head *entry) | |||
| 103 | entry->prev = LIST_POISON2; | 108 | entry->prev = LIST_POISON2; |
| 104 | } | 109 | } |
| 105 | #else | 110 | #else |
| 111 | extern void __list_del_entry(struct list_head *entry); | ||
| 106 | extern void list_del(struct list_head *entry); | 112 | extern void list_del(struct list_head *entry); |
| 107 | #endif | 113 | #endif |
| 108 | 114 | ||
| @@ -135,7 +141,7 @@ static inline void list_replace_init(struct list_head *old, | |||
| 135 | */ | 141 | */ |
| 136 | static inline void list_del_init(struct list_head *entry) | 142 | static inline void list_del_init(struct list_head *entry) |
| 137 | { | 143 | { |
| 138 | __list_del(entry->prev, entry->next); | 144 | __list_del_entry(entry); |
| 139 | INIT_LIST_HEAD(entry); | 145 | INIT_LIST_HEAD(entry); |
| 140 | } | 146 | } |
| 141 | 147 | ||
| @@ -146,7 +152,7 @@ static inline void list_del_init(struct list_head *entry) | |||
| 146 | */ | 152 | */ |
| 147 | static inline void list_move(struct list_head *list, struct list_head *head) | 153 | static inline void list_move(struct list_head *list, struct list_head *head) |
| 148 | { | 154 | { |
| 149 | __list_del(list->prev, list->next); | 155 | __list_del_entry(list); |
| 150 | list_add(list, head); | 156 | list_add(list, head); |
| 151 | } | 157 | } |
| 152 | 158 | ||
| @@ -158,7 +164,7 @@ static inline void list_move(struct list_head *list, struct list_head *head) | |||
| 158 | static inline void list_move_tail(struct list_head *list, | 164 | static inline void list_move_tail(struct list_head *list, |
| 159 | struct list_head *head) | 165 | struct list_head *head) |
| 160 | { | 166 | { |
| 161 | __list_del(list->prev, list->next); | 167 | __list_del_entry(list); |
| 162 | list_add_tail(list, head); | 168 | list_add_tail(list, head); |
| 163 | } | 169 | } |
| 164 | 170 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index 9bdf27c7615b..5de42043dff0 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -62,7 +62,7 @@ struct module_version_attribute { | |||
| 62 | struct module_attribute mattr; | 62 | struct module_attribute mattr; |
| 63 | const char *module_name; | 63 | const char *module_name; |
| 64 | const char *version; | 64 | const char *version; |
| 65 | }; | 65 | } __attribute__ ((__aligned__(sizeof(void *)))); |
| 66 | 66 | ||
| 67 | struct module_kobject | 67 | struct module_kobject |
| 68 | { | 68 | { |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index cd6f3b431195..d60130f88eed 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
| @@ -168,6 +168,7 @@ | |||
| 168 | #define ONENAND_SYS_CFG1_INT (1 << 6) | 168 | #define ONENAND_SYS_CFG1_INT (1 << 6) |
| 169 | #define ONENAND_SYS_CFG1_IOBE (1 << 5) | 169 | #define ONENAND_SYS_CFG1_IOBE (1 << 5) |
| 170 | #define ONENAND_SYS_CFG1_RDY_CONF (1 << 4) | 170 | #define ONENAND_SYS_CFG1_RDY_CONF (1 << 4) |
| 171 | #define ONENAND_SYS_CFG1_VHF (1 << 3) | ||
| 171 | #define ONENAND_SYS_CFG1_HF (1 << 2) | 172 | #define ONENAND_SYS_CFG1_HF (1 << 2) |
| 172 | #define ONENAND_SYS_CFG1_SYNC_WRITE (1 << 1) | 173 | #define ONENAND_SYS_CFG1_SYNC_WRITE (1 << 1) |
| 173 | 174 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index dd9c7ab38270..21415cc91cbb 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -431,6 +431,8 @@ struct dev_pm_info { | |||
| 431 | struct list_head entry; | 431 | struct list_head entry; |
| 432 | struct completion completion; | 432 | struct completion completion; |
| 433 | struct wakeup_source *wakeup; | 433 | struct wakeup_source *wakeup; |
| 434 | #else | ||
| 435 | unsigned int should_wakeup:1; | ||
| 434 | #endif | 436 | #endif |
| 435 | #ifdef CONFIG_PM_RUNTIME | 437 | #ifdef CONFIG_PM_RUNTIME |
| 436 | struct timer_list suspend_timer; | 438 | struct timer_list suspend_timer; |
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 9cff00dd6b63..03a67db03d01 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
| @@ -109,11 +109,6 @@ static inline bool device_can_wakeup(struct device *dev) | |||
| 109 | return dev->power.can_wakeup; | 109 | return dev->power.can_wakeup; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static inline bool device_may_wakeup(struct device *dev) | ||
| 113 | { | ||
| 114 | return false; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline struct wakeup_source *wakeup_source_create(const char *name) | 112 | static inline struct wakeup_source *wakeup_source_create(const char *name) |
| 118 | { | 113 | { |
| 119 | return NULL; | 114 | return NULL; |
| @@ -134,24 +129,32 @@ static inline void wakeup_source_unregister(struct wakeup_source *ws) {} | |||
| 134 | 129 | ||
| 135 | static inline int device_wakeup_enable(struct device *dev) | 130 | static inline int device_wakeup_enable(struct device *dev) |
| 136 | { | 131 | { |
| 137 | return -EINVAL; | 132 | dev->power.should_wakeup = true; |
| 133 | return 0; | ||
| 138 | } | 134 | } |
| 139 | 135 | ||
| 140 | static inline int device_wakeup_disable(struct device *dev) | 136 | static inline int device_wakeup_disable(struct device *dev) |
| 141 | { | 137 | { |
| 138 | dev->power.should_wakeup = false; | ||
| 142 | return 0; | 139 | return 0; |
| 143 | } | 140 | } |
| 144 | 141 | ||
| 145 | static inline int device_init_wakeup(struct device *dev, bool val) | 142 | static inline int device_set_wakeup_enable(struct device *dev, bool enable) |
| 146 | { | 143 | { |
| 147 | dev->power.can_wakeup = val; | 144 | dev->power.should_wakeup = enable; |
| 148 | return val ? -EINVAL : 0; | 145 | return 0; |
| 149 | } | 146 | } |
| 150 | 147 | ||
| 148 | static inline int device_init_wakeup(struct device *dev, bool val) | ||
| 149 | { | ||
| 150 | device_set_wakeup_capable(dev, val); | ||
| 151 | device_set_wakeup_enable(dev, val); | ||
| 152 | return 0; | ||
| 153 | } | ||
| 151 | 154 | ||
| 152 | static inline int device_set_wakeup_enable(struct device *dev, bool enable) | 155 | static inline bool device_may_wakeup(struct device *dev) |
| 153 | { | 156 | { |
| 154 | return -EINVAL; | 157 | return dev->power.can_wakeup && dev->power.should_wakeup; |
| 155 | } | 158 | } |
| 156 | 159 | ||
| 157 | static inline void __pm_stay_awake(struct wakeup_source *ws) {} | 160 | static inline void __pm_stay_awake(struct wakeup_source *ws) {} |
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h index d63dcbaea169..9026b30238f3 100644 --- a/include/linux/rio_regs.h +++ b/include/linux/rio_regs.h | |||
| @@ -14,10 +14,12 @@ | |||
| 14 | #define LINUX_RIO_REGS_H | 14 | #define LINUX_RIO_REGS_H |
| 15 | 15 | ||
| 16 | /* | 16 | /* |
| 17 | * In RapidIO, each device has a 2MB configuration space that is | 17 | * In RapidIO, each device has a 16MB configuration space that is |
| 18 | * accessed via maintenance transactions. Portions of configuration | 18 | * accessed via maintenance transactions. Portions of configuration |
| 19 | * space are standardized and/or reserved. | 19 | * space are standardized and/or reserved. |
| 20 | */ | 20 | */ |
| 21 | #define RIO_MAINT_SPACE_SZ 0x1000000 /* 16MB of RapidIO mainenance space */ | ||
| 22 | |||
| 21 | #define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */ | 23 | #define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */ |
| 22 | #define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */ | 24 | #define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */ |
| 23 | #define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */ | 25 | #define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */ |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index a0b639f8e805..89c3e5182991 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
| @@ -203,6 +203,18 @@ struct rtc_device | |||
| 203 | struct hrtimer pie_timer; /* sub second exp, so needs hrtimer */ | 203 | struct hrtimer pie_timer; /* sub second exp, so needs hrtimer */ |
| 204 | int pie_enabled; | 204 | int pie_enabled; |
| 205 | struct work_struct irqwork; | 205 | struct work_struct irqwork; |
| 206 | |||
| 207 | |||
| 208 | #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL | ||
| 209 | struct work_struct uie_task; | ||
| 210 | struct timer_list uie_timer; | ||
| 211 | /* Those fields are protected by rtc->irq_lock */ | ||
| 212 | unsigned int oldsecs; | ||
| 213 | unsigned int uie_irq_active:1; | ||
| 214 | unsigned int stop_uie_polling:1; | ||
| 215 | unsigned int uie_task_active:1; | ||
| 216 | unsigned int uie_timer_active:1; | ||
| 217 | #endif | ||
| 206 | }; | 218 | }; |
| 207 | #define to_rtc_device(d) container_of(d, struct rtc_device, dev) | 219 | #define to_rtc_device(d) container_of(d, struct rtc_device, dev) |
| 208 | 220 | ||
| @@ -235,7 +247,10 @@ extern int rtc_irq_set_freq(struct rtc_device *rtc, | |||
| 235 | struct rtc_task *task, int freq); | 247 | struct rtc_task *task, int freq); |
| 236 | extern int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled); | 248 | extern int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled); |
| 237 | extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled); | 249 | extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled); |
| 250 | extern int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, | ||
| 251 | unsigned int enabled); | ||
| 238 | 252 | ||
| 253 | void rtc_handle_legacy_irq(struct rtc_device *rtc, int num, int mode); | ||
| 239 | void rtc_aie_update_irq(void *private); | 254 | void rtc_aie_update_irq(void *private); |
| 240 | void rtc_uie_update_irq(void *private); | 255 | void rtc_uie_update_irq(void *private); |
| 241 | enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer); | 256 | enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index d747f948b34e..777d8a5ed06b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1744,7 +1744,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
| 1744 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ | 1744 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ |
| 1745 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 1745 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
| 1746 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1746 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
| 1747 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ | 1747 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ |
| 1748 | #define PF_FREEZER_NOSIG 0x80000000 /* Freezer won't send signals to it */ | 1748 | #define PF_FREEZER_NOSIG 0x80000000 /* Freezer won't send signals to it */ |
| 1749 | 1749 | ||
| 1750 | /* | 1750 | /* |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 8651556dbd52..d3ec89fb4122 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
| @@ -172,6 +172,14 @@ void thermal_zone_device_update(struct thermal_zone_device *); | |||
| 172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
| 173 | const struct thermal_cooling_device_ops *); | 173 | const struct thermal_cooling_device_ops *); |
| 174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
| 175 | |||
| 176 | #ifdef CONFIG_NET | ||
| 175 | extern int generate_netlink_event(u32 orig, enum events event); | 177 | extern int generate_netlink_event(u32 orig, enum events event); |
| 178 | #else | ||
| 179 | static inline int generate_netlink_event(u32 orig, enum events event) | ||
| 180 | { | ||
| 181 | return 0; | ||
| 182 | } | ||
| 183 | #endif | ||
| 176 | 184 | ||
| 177 | #endif /* __THERMAL_H__ */ | 185 | #endif /* __THERMAL_H__ */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 1ac11586a2f5..f7998a3bf020 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -250,7 +250,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } | |||
| 250 | enum { | 250 | enum { |
| 251 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ | 251 | WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ |
| 252 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ | 252 | WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ |
| 253 | WQ_FREEZEABLE = 1 << 2, /* freeze during suspend */ | 253 | WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ |
| 254 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ | 254 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ |
| 255 | WQ_HIGHPRI = 1 << 4, /* high priority */ | 255 | WQ_HIGHPRI = 1 << 4, /* high priority */ |
| 256 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 256 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
| @@ -318,7 +318,7 @@ __alloc_workqueue_key(const char *name, unsigned int flags, int max_active, | |||
| 318 | /** | 318 | /** |
| 319 | * alloc_ordered_workqueue - allocate an ordered workqueue | 319 | * alloc_ordered_workqueue - allocate an ordered workqueue |
| 320 | * @name: name of the workqueue | 320 | * @name: name of the workqueue |
| 321 | * @flags: WQ_* flags (only WQ_FREEZEABLE and WQ_MEM_RECLAIM are meaningful) | 321 | * @flags: WQ_* flags (only WQ_FREEZABLE and WQ_MEM_RECLAIM are meaningful) |
| 322 | * | 322 | * |
| 323 | * Allocate an ordered workqueue. An ordered workqueue executes at | 323 | * Allocate an ordered workqueue. An ordered workqueue executes at |
| 324 | * most one work item at any given time in the queued order. They are | 324 | * most one work item at any given time in the queued order. They are |
| @@ -335,8 +335,8 @@ alloc_ordered_workqueue(const char *name, unsigned int flags) | |||
| 335 | 335 | ||
| 336 | #define create_workqueue(name) \ | 336 | #define create_workqueue(name) \ |
| 337 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) | 337 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) |
| 338 | #define create_freezeable_workqueue(name) \ | 338 | #define create_freezable_workqueue(name) \ |
| 339 | alloc_workqueue((name), WQ_FREEZEABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 339 | alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
| 340 | #define create_singlethread_workqueue(name) \ | 340 | #define create_singlethread_workqueue(name) \ |
| 341 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) | 341 | alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) |
| 342 | 342 | ||
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 4a3cd2cd2f5e..96e50e0ce3ca 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -89,6 +89,18 @@ | |||
| 89 | #define IPV6_ADDR_SCOPE_GLOBAL 0x0e | 89 | #define IPV6_ADDR_SCOPE_GLOBAL 0x0e |
| 90 | 90 | ||
| 91 | /* | 91 | /* |
| 92 | * Addr flags | ||
| 93 | */ | ||
| 94 | #ifdef __KERNEL__ | ||
| 95 | #define IPV6_ADDR_MC_FLAG_TRANSIENT(a) \ | ||
| 96 | ((a)->s6_addr[1] & 0x10) | ||
| 97 | #define IPV6_ADDR_MC_FLAG_PREFIX(a) \ | ||
| 98 | ((a)->s6_addr[1] & 0x20) | ||
| 99 | #define IPV6_ADDR_MC_FLAG_RENDEZVOUS(a) \ | ||
| 100 | ((a)->s6_addr[1] & 0x40) | ||
| 101 | #endif | ||
| 102 | |||
| 103 | /* | ||
| 92 | * fragmentation header | 104 | * fragmentation header |
| 93 | */ | 105 | */ |
| 94 | 106 | ||
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h index cd85b3bc8327..e505358d8999 100644 --- a/include/net/netfilter/nf_tproxy_core.h +++ b/include/net/netfilter/nf_tproxy_core.h | |||
| @@ -201,18 +201,8 @@ nf_tproxy_get_sock_v6(struct net *net, const u8 protocol, | |||
| 201 | } | 201 | } |
| 202 | #endif | 202 | #endif |
| 203 | 203 | ||
| 204 | static inline void | ||
| 205 | nf_tproxy_put_sock(struct sock *sk) | ||
| 206 | { | ||
| 207 | /* TIME_WAIT inet sockets have to be handled differently */ | ||
| 208 | if ((sk->sk_protocol == IPPROTO_TCP) && (sk->sk_state == TCP_TIME_WAIT)) | ||
| 209 | inet_twsk_put(inet_twsk(sk)); | ||
| 210 | else | ||
| 211 | sock_put(sk); | ||
| 212 | } | ||
| 213 | |||
| 214 | /* assign a socket to the skb -- consumes sk */ | 204 | /* assign a socket to the skb -- consumes sk */ |
| 215 | int | 205 | void |
| 216 | nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk); | 206 | nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk); |
| 217 | 207 | ||
| 218 | #endif | 208 | #endif |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 160a407c1963..04f8556313d5 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -199,7 +199,7 @@ struct tcf_proto { | |||
| 199 | 199 | ||
| 200 | struct qdisc_skb_cb { | 200 | struct qdisc_skb_cb { |
| 201 | unsigned int pkt_len; | 201 | unsigned int pkt_len; |
| 202 | char data[]; | 202 | long data[]; |
| 203 | }; | 203 | }; |
| 204 | 204 | ||
| 205 | static inline int qdisc_qlen(struct Qdisc *q) | 205 | static inline int qdisc_qlen(struct Qdisc *q) |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8479b66c067b..3fd5064dd43a 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
| @@ -261,6 +261,7 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev); | |||
| 261 | #define CONF_ENABLE_ESR 0x0008 | 261 | #define CONF_ENABLE_ESR 0x0008 |
| 262 | #define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ | 262 | #define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ |
| 263 | * (CONF_ENABLE_IRQ) in use */ | 263 | * (CONF_ENABLE_IRQ) in use */ |
| 264 | #define CONF_ENABLE_ZVCARD 0x0020 | ||
| 264 | 265 | ||
| 265 | /* flags used by pcmcia_loop_config() autoconfiguration */ | 266 | /* flags used by pcmcia_loop_config() autoconfiguration */ |
| 266 | #define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */ | 267 | #define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */ |
diff --git a/include/sound/wm8903.h b/include/sound/wm8903.h index b4a0db2307ef..1eeebd534f7e 100644 --- a/include/sound/wm8903.h +++ b/include/sound/wm8903.h | |||
| @@ -17,13 +17,9 @@ | |||
| 17 | /* | 17 | /* |
| 18 | * R6 (0x06) - Mic Bias Control 0 | 18 | * R6 (0x06) - Mic Bias Control 0 |
| 19 | */ | 19 | */ |
| 20 | #define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ | 20 | #define WM8903_MICDET_THR_MASK 0x0030 /* MICDET_THR - [5:4] */ |
| 21 | #define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ | 21 | #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [5:4] */ |
| 22 | #define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ | 22 | #define WM8903_MICDET_THR_WIDTH 2 /* MICDET_THR - [5:4] */ |
| 23 | #define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */ | ||
| 24 | #define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ | ||
| 25 | #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ | ||
| 26 | #define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ | ||
| 27 | #define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ | 23 | #define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ |
| 28 | #define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ | 24 | #define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ |
| 29 | #define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ | 25 | #define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */ |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 07fdfb6b9a9a..0828b6c8610a 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include <scsi/scsi_cmnd.h> | 8 | #include <scsi/scsi_cmnd.h> |
| 9 | #include <net/sock.h> | 9 | #include <net/sock.h> |
| 10 | #include <net/tcp.h> | 10 | #include <net/tcp.h> |
| 11 | #include "target_core_mib.h" | ||
| 12 | 11 | ||
| 13 | #define TARGET_CORE_MOD_VERSION "v4.0.0-rc6" | 12 | #define TARGET_CORE_MOD_VERSION "v4.0.0-rc6" |
| 14 | #define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT)) | 13 | #define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT)) |
| @@ -195,6 +194,21 @@ typedef enum { | |||
| 195 | SAM_TASK_ATTR_EMULATED | 194 | SAM_TASK_ATTR_EMULATED |
| 196 | } t10_task_attr_index_t; | 195 | } t10_task_attr_index_t; |
| 197 | 196 | ||
| 197 | /* | ||
| 198 | * Used for target SCSI statistics | ||
| 199 | */ | ||
| 200 | typedef enum { | ||
| 201 | SCSI_INST_INDEX, | ||
| 202 | SCSI_DEVICE_INDEX, | ||
| 203 | SCSI_AUTH_INTR_INDEX, | ||
| 204 | SCSI_INDEX_TYPE_MAX | ||
| 205 | } scsi_index_t; | ||
| 206 | |||
| 207 | struct scsi_index_table { | ||
| 208 | spinlock_t lock; | ||
| 209 | u32 scsi_mib_index[SCSI_INDEX_TYPE_MAX]; | ||
| 210 | } ____cacheline_aligned; | ||
| 211 | |||
| 198 | struct se_cmd; | 212 | struct se_cmd; |
| 199 | 213 | ||
| 200 | struct t10_alua { | 214 | struct t10_alua { |
| @@ -578,8 +592,6 @@ struct se_node_acl { | |||
| 578 | spinlock_t stats_lock; | 592 | spinlock_t stats_lock; |
| 579 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ | 593 | /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ |
| 580 | atomic_t acl_pr_ref_count; | 594 | atomic_t acl_pr_ref_count; |
| 581 | /* Used for MIB access */ | ||
| 582 | atomic_t mib_ref_count; | ||
| 583 | struct se_dev_entry *device_list; | 595 | struct se_dev_entry *device_list; |
| 584 | struct se_session *nacl_sess; | 596 | struct se_session *nacl_sess; |
| 585 | struct se_portal_group *se_tpg; | 597 | struct se_portal_group *se_tpg; |
| @@ -595,8 +607,6 @@ struct se_node_acl { | |||
| 595 | } ____cacheline_aligned; | 607 | } ____cacheline_aligned; |
| 596 | 608 | ||
| 597 | struct se_session { | 609 | struct se_session { |
| 598 | /* Used for MIB access */ | ||
| 599 | atomic_t mib_ref_count; | ||
| 600 | u64 sess_bin_isid; | 610 | u64 sess_bin_isid; |
| 601 | struct se_node_acl *se_node_acl; | 611 | struct se_node_acl *se_node_acl; |
| 602 | struct se_portal_group *se_tpg; | 612 | struct se_portal_group *se_tpg; |
| @@ -806,7 +816,6 @@ struct se_hba { | |||
| 806 | /* Virtual iSCSI devices attached. */ | 816 | /* Virtual iSCSI devices attached. */ |
| 807 | u32 dev_count; | 817 | u32 dev_count; |
| 808 | u32 hba_index; | 818 | u32 hba_index; |
| 809 | atomic_t dev_mib_access_count; | ||
| 810 | atomic_t load_balance_queue; | 819 | atomic_t load_balance_queue; |
| 811 | atomic_t left_queue_depth; | 820 | atomic_t left_queue_depth; |
| 812 | /* Maximum queue depth the HBA can handle. */ | 821 | /* Maximum queue depth the HBA can handle. */ |
| @@ -845,6 +854,12 @@ struct se_lun { | |||
| 845 | 854 | ||
| 846 | #define SE_LUN(c) ((struct se_lun *)(c)->se_lun) | 855 | #define SE_LUN(c) ((struct se_lun *)(c)->se_lun) |
| 847 | 856 | ||
| 857 | struct scsi_port_stats { | ||
| 858 | u64 cmd_pdus; | ||
| 859 | u64 tx_data_octets; | ||
| 860 | u64 rx_data_octets; | ||
| 861 | } ____cacheline_aligned; | ||
| 862 | |||
| 848 | struct se_port { | 863 | struct se_port { |
| 849 | /* RELATIVE TARGET PORT IDENTIFER */ | 864 | /* RELATIVE TARGET PORT IDENTIFER */ |
| 850 | u16 sep_rtpi; | 865 | u16 sep_rtpi; |
| @@ -867,6 +882,7 @@ struct se_port { | |||
| 867 | } ____cacheline_aligned; | 882 | } ____cacheline_aligned; |
| 868 | 883 | ||
| 869 | struct se_tpg_np { | 884 | struct se_tpg_np { |
| 885 | struct se_portal_group *tpg_np_parent; | ||
| 870 | struct config_group tpg_np_group; | 886 | struct config_group tpg_np_group; |
| 871 | } ____cacheline_aligned; | 887 | } ____cacheline_aligned; |
| 872 | 888 | ||
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index 66f44e56eb80..246940511579 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h | |||
| @@ -111,6 +111,8 @@ struct se_subsystem_api; | |||
| 111 | 111 | ||
| 112 | extern int init_se_global(void); | 112 | extern int init_se_global(void); |
| 113 | extern void release_se_global(void); | 113 | extern void release_se_global(void); |
| 114 | extern void init_scsi_index_table(void); | ||
| 115 | extern u32 scsi_get_new_index(scsi_index_t); | ||
| 114 | extern void transport_init_queue_obj(struct se_queue_obj *); | 116 | extern void transport_init_queue_obj(struct se_queue_obj *); |
| 115 | extern int transport_subsystem_check_init(void); | 117 | extern int transport_subsystem_check_init(void); |
| 116 | extern int transport_subsystem_register(struct se_subsystem_api *); | 118 | extern int transport_subsystem_register(struct se_subsystem_api *); |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index 4571ae7e085a..99c3bc8a6fb4 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
| @@ -3,6 +3,12 @@ | |||
| 3 | */ | 3 | */ |
| 4 | #include <linux/irqdesc.h> | 4 | #include <linux/irqdesc.h> |
| 5 | 5 | ||
| 6 | #ifdef CONFIG_SPARSE_IRQ | ||
| 7 | # define IRQ_BITMAP_BITS (NR_IRQS + 8196) | ||
| 8 | #else | ||
| 9 | # define IRQ_BITMAP_BITS NR_IRQS | ||
| 10 | #endif | ||
| 11 | |||
| 6 | extern int noirqdebug; | 12 | extern int noirqdebug; |
| 7 | 13 | ||
| 8 | #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data) | 14 | #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data) |
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 282f20230e67..2039bea31bdf 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
| @@ -94,7 +94,7 @@ int nr_irqs = NR_IRQS; | |||
| 94 | EXPORT_SYMBOL_GPL(nr_irqs); | 94 | EXPORT_SYMBOL_GPL(nr_irqs); |
| 95 | 95 | ||
| 96 | static DEFINE_MUTEX(sparse_irq_lock); | 96 | static DEFINE_MUTEX(sparse_irq_lock); |
| 97 | static DECLARE_BITMAP(allocated_irqs, NR_IRQS); | 97 | static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS); |
| 98 | 98 | ||
| 99 | #ifdef CONFIG_SPARSE_IRQ | 99 | #ifdef CONFIG_SPARSE_IRQ |
| 100 | 100 | ||
| @@ -217,6 +217,15 @@ int __init early_irq_init(void) | |||
| 217 | initcnt = arch_probe_nr_irqs(); | 217 | initcnt = arch_probe_nr_irqs(); |
| 218 | printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt); | 218 | printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt); |
| 219 | 219 | ||
| 220 | if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS)) | ||
| 221 | nr_irqs = IRQ_BITMAP_BITS; | ||
| 222 | |||
| 223 | if (WARN_ON(initcnt > IRQ_BITMAP_BITS)) | ||
| 224 | initcnt = IRQ_BITMAP_BITS; | ||
| 225 | |||
| 226 | if (initcnt > nr_irqs) | ||
| 227 | nr_irqs = initcnt; | ||
| 228 | |||
| 220 | for (i = 0; i < initcnt; i++) { | 229 | for (i = 0; i < initcnt; i++) { |
| 221 | desc = alloc_desc(i, node); | 230 | desc = alloc_desc(i, node); |
| 222 | set_bit(i, allocated_irqs); | 231 | set_bit(i, allocated_irqs); |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 0caa59f747dd..9033c1c70828 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -1100,7 +1100,7 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler, | |||
| 1100 | if (retval) | 1100 | if (retval) |
| 1101 | kfree(action); | 1101 | kfree(action); |
| 1102 | 1102 | ||
| 1103 | #ifdef CONFIG_DEBUG_SHIRQ | 1103 | #ifdef CONFIG_DEBUG_SHIRQ_FIXME |
| 1104 | if (!retval && (irqflags & IRQF_SHARED)) { | 1104 | if (!retval && (irqflags & IRQF_SHARED)) { |
| 1105 | /* | 1105 | /* |
| 1106 | * It's a shared IRQ -- the driver ought to be prepared for it | 1106 | * It's a shared IRQ -- the driver ought to be prepared for it |
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c index 891115a929aa..dc49358b73fa 100644 --- a/kernel/irq/resend.c +++ b/kernel/irq/resend.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #ifdef CONFIG_HARDIRQS_SW_RESEND | 23 | #ifdef CONFIG_HARDIRQS_SW_RESEND |
| 24 | 24 | ||
| 25 | /* Bitmap to handle software resend of interrupts: */ | 25 | /* Bitmap to handle software resend of interrupts: */ |
| 26 | static DECLARE_BITMAP(irqs_resend, NR_IRQS); | 26 | static DECLARE_BITMAP(irqs_resend, IRQ_BITMAP_BITS); |
| 27 | 27 | ||
| 28 | /* | 28 | /* |
| 29 | * Run software resends of IRQ's | 29 | * Run software resends of IRQ's |
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 999835b6112b..656222fcf767 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
| @@ -782,6 +782,10 @@ retry: | |||
| 782 | raw_spin_unlock_irq(&ctx->lock); | 782 | raw_spin_unlock_irq(&ctx->lock); |
| 783 | } | 783 | } |
| 784 | 784 | ||
| 785 | #define MAX_INTERRUPTS (~0ULL) | ||
| 786 | |||
| 787 | static void perf_log_throttle(struct perf_event *event, int enable); | ||
| 788 | |||
| 785 | static int | 789 | static int |
| 786 | event_sched_in(struct perf_event *event, | 790 | event_sched_in(struct perf_event *event, |
| 787 | struct perf_cpu_context *cpuctx, | 791 | struct perf_cpu_context *cpuctx, |
| @@ -794,6 +798,17 @@ event_sched_in(struct perf_event *event, | |||
| 794 | 798 | ||
| 795 | event->state = PERF_EVENT_STATE_ACTIVE; | 799 | event->state = PERF_EVENT_STATE_ACTIVE; |
| 796 | event->oncpu = smp_processor_id(); | 800 | event->oncpu = smp_processor_id(); |
| 801 | |||
| 802 | /* | ||
| 803 | * Unthrottle events, since we scheduled we might have missed several | ||
| 804 | * ticks already, also for a heavily scheduling task there is little | ||
| 805 | * guarantee it'll get a tick in a timely manner. | ||
| 806 | */ | ||
| 807 | if (unlikely(event->hw.interrupts == MAX_INTERRUPTS)) { | ||
| 808 | perf_log_throttle(event, 1); | ||
| 809 | event->hw.interrupts = 0; | ||
| 810 | } | ||
| 811 | |||
| 797 | /* | 812 | /* |
| 798 | * The new state must be visible before we turn it on in the hardware: | 813 | * The new state must be visible before we turn it on in the hardware: |
| 799 | */ | 814 | */ |
| @@ -1596,10 +1611,6 @@ void __perf_event_task_sched_in(struct task_struct *task) | |||
| 1596 | } | 1611 | } |
| 1597 | } | 1612 | } |
| 1598 | 1613 | ||
| 1599 | #define MAX_INTERRUPTS (~0ULL) | ||
| 1600 | |||
| 1601 | static void perf_log_throttle(struct perf_event *event, int enable); | ||
| 1602 | |||
| 1603 | static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count) | 1614 | static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count) |
| 1604 | { | 1615 | { |
| 1605 | u64 frequency = event->attr.sample_freq; | 1616 | u64 frequency = event->attr.sample_freq; |
diff --git a/kernel/power/main.c b/kernel/power/main.c index 7b5db6a8561e..701853042c28 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -326,7 +326,7 @@ EXPORT_SYMBOL_GPL(pm_wq); | |||
| 326 | 326 | ||
| 327 | static int __init pm_start_workqueue(void) | 327 | static int __init pm_start_workqueue(void) |
| 328 | { | 328 | { |
| 329 | pm_wq = alloc_workqueue("pm", WQ_FREEZEABLE, 0); | 329 | pm_wq = alloc_workqueue("pm", WQ_FREEZABLE, 0); |
| 330 | 330 | ||
| 331 | return pm_wq ? 0 : -ENOMEM; | 331 | return pm_wq ? 0 : -ENOMEM; |
| 332 | } | 332 | } |
diff --git a/kernel/power/process.c b/kernel/power/process.c index d6d2a10320e0..0cf3a27a6c9d 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | */ | 22 | */ |
| 23 | #define TIMEOUT (20 * HZ) | 23 | #define TIMEOUT (20 * HZ) |
| 24 | 24 | ||
| 25 | static inline int freezeable(struct task_struct * p) | 25 | static inline int freezable(struct task_struct * p) |
| 26 | { | 26 | { |
| 27 | if ((p == current) || | 27 | if ((p == current) || |
| 28 | (p->flags & PF_NOFREEZE) || | 28 | (p->flags & PF_NOFREEZE) || |
| @@ -53,7 +53,7 @@ static int try_to_freeze_tasks(bool sig_only) | |||
| 53 | todo = 0; | 53 | todo = 0; |
| 54 | read_lock(&tasklist_lock); | 54 | read_lock(&tasklist_lock); |
| 55 | do_each_thread(g, p) { | 55 | do_each_thread(g, p) { |
| 56 | if (frozen(p) || !freezeable(p)) | 56 | if (frozen(p) || !freezable(p)) |
| 57 | continue; | 57 | continue; |
| 58 | 58 | ||
| 59 | if (!freeze_task(p, sig_only)) | 59 | if (!freeze_task(p, sig_only)) |
| @@ -167,7 +167,7 @@ static void thaw_tasks(bool nosig_only) | |||
| 167 | 167 | ||
| 168 | read_lock(&tasklist_lock); | 168 | read_lock(&tasklist_lock); |
| 169 | do_each_thread(g, p) { | 169 | do_each_thread(g, p) { |
| 170 | if (!freezeable(p)) | 170 | if (!freezable(p)) |
| 171 | continue; | 171 | continue; |
| 172 | 172 | ||
| 173 | if (nosig_only && should_send_signal(p)) | 173 | if (nosig_only && should_send_signal(p)) |
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index 0dac75ea4456..64db648ff911 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
| @@ -1519,11 +1519,8 @@ static int | |||
| 1519 | swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, | 1519 | swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, |
| 1520 | unsigned int nr_pages, unsigned int nr_highmem) | 1520 | unsigned int nr_pages, unsigned int nr_highmem) |
| 1521 | { | 1521 | { |
| 1522 | int error = 0; | ||
| 1523 | |||
| 1524 | if (nr_highmem > 0) { | 1522 | if (nr_highmem > 0) { |
| 1525 | error = get_highmem_buffer(PG_ANY); | 1523 | if (get_highmem_buffer(PG_ANY)) |
| 1526 | if (error) | ||
| 1527 | goto err_out; | 1524 | goto err_out; |
| 1528 | if (nr_highmem > alloc_highmem) { | 1525 | if (nr_highmem > alloc_highmem) { |
| 1529 | nr_highmem -= alloc_highmem; | 1526 | nr_highmem -= alloc_highmem; |
| @@ -1546,7 +1543,7 @@ swsusp_alloc(struct memory_bitmap *orig_bm, struct memory_bitmap *copy_bm, | |||
| 1546 | 1543 | ||
| 1547 | err_out: | 1544 | err_out: |
| 1548 | swsusp_free(); | 1545 | swsusp_free(); |
| 1549 | return error; | 1546 | return -ENOMEM; |
| 1550 | } | 1547 | } |
| 1551 | 1548 | ||
| 1552 | asmlinkage int swsusp_save(void) | 1549 | asmlinkage int swsusp_save(void) |
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 48b2761b5668..a3b5aff62606 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
| @@ -600,4 +600,14 @@ int tick_broadcast_oneshot_active(void) | |||
| 600 | return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT; | 600 | return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT; |
| 601 | } | 601 | } |
| 602 | 602 | ||
| 603 | /* | ||
| 604 | * Check whether the broadcast device supports oneshot. | ||
| 605 | */ | ||
| 606 | bool tick_broadcast_oneshot_available(void) | ||
| 607 | { | ||
| 608 | struct clock_event_device *bc = tick_broadcast_device.evtdev; | ||
| 609 | |||
| 610 | return bc ? bc->features & CLOCK_EVT_FEAT_ONESHOT : false; | ||
| 611 | } | ||
| 612 | |||
| 603 | #endif | 613 | #endif |
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 051bc80a0c43..ed228ef6f6b8 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
| @@ -51,7 +51,11 @@ int tick_is_oneshot_available(void) | |||
| 51 | { | 51 | { |
| 52 | struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev); | 52 | struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev); |
| 53 | 53 | ||
| 54 | return dev && (dev->features & CLOCK_EVT_FEAT_ONESHOT); | 54 | if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT)) |
| 55 | return 0; | ||
| 56 | if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) | ||
| 57 | return 1; | ||
| 58 | return tick_broadcast_oneshot_available(); | ||
| 55 | } | 59 | } |
| 56 | 60 | ||
| 57 | /* | 61 | /* |
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index 290eefbc1f60..f65d3a723a64 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h | |||
| @@ -36,6 +36,7 @@ extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup); | |||
| 36 | extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); | 36 | extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); |
| 37 | extern int tick_broadcast_oneshot_active(void); | 37 | extern int tick_broadcast_oneshot_active(void); |
| 38 | extern void tick_check_oneshot_broadcast(int cpu); | 38 | extern void tick_check_oneshot_broadcast(int cpu); |
| 39 | bool tick_broadcast_oneshot_available(void); | ||
| 39 | # else /* BROADCAST */ | 40 | # else /* BROADCAST */ |
| 40 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) | 41 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) |
| 41 | { | 42 | { |
| @@ -46,6 +47,7 @@ static inline void tick_broadcast_switch_to_oneshot(void) { } | |||
| 46 | static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } | 47 | static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } |
| 47 | static inline int tick_broadcast_oneshot_active(void) { return 0; } | 48 | static inline int tick_broadcast_oneshot_active(void) { return 0; } |
| 48 | static inline void tick_check_oneshot_broadcast(int cpu) { } | 49 | static inline void tick_check_oneshot_broadcast(int cpu) { } |
| 50 | static inline bool tick_broadcast_oneshot_available(void) { return true; } | ||
| 49 | # endif /* !BROADCAST */ | 51 | # endif /* !BROADCAST */ |
| 50 | 52 | ||
| 51 | #else /* !ONESHOT */ | 53 | #else /* !ONESHOT */ |
| @@ -76,6 +78,7 @@ static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc) | |||
| 76 | return 0; | 78 | return 0; |
| 77 | } | 79 | } |
| 78 | static inline int tick_broadcast_oneshot_active(void) { return 0; } | 80 | static inline int tick_broadcast_oneshot_active(void) { return 0; } |
| 81 | static inline bool tick_broadcast_oneshot_available(void) { return false; } | ||
| 79 | #endif /* !TICK_ONESHOT */ | 82 | #endif /* !TICK_ONESHOT */ |
| 80 | 83 | ||
| 81 | /* | 84 | /* |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 11869faa6819..ee6578b578ad 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -79,7 +79,9 @@ enum { | |||
| 79 | MAX_IDLE_WORKERS_RATIO = 4, /* 1/4 of busy can be idle */ | 79 | MAX_IDLE_WORKERS_RATIO = 4, /* 1/4 of busy can be idle */ |
| 80 | IDLE_WORKER_TIMEOUT = 300 * HZ, /* keep idle ones for 5 mins */ | 80 | IDLE_WORKER_TIMEOUT = 300 * HZ, /* keep idle ones for 5 mins */ |
| 81 | 81 | ||
| 82 | MAYDAY_INITIAL_TIMEOUT = HZ / 100, /* call for help after 10ms */ | 82 | MAYDAY_INITIAL_TIMEOUT = HZ / 100 >= 2 ? HZ / 100 : 2, |
| 83 | /* call for help after 10ms | ||
| 84 | (min two ticks) */ | ||
| 83 | MAYDAY_INTERVAL = HZ / 10, /* and then every 100ms */ | 85 | MAYDAY_INTERVAL = HZ / 10, /* and then every 100ms */ |
| 84 | CREATE_COOLDOWN = HZ, /* time to breath after fail */ | 86 | CREATE_COOLDOWN = HZ, /* time to breath after fail */ |
| 85 | TRUSTEE_COOLDOWN = HZ / 10, /* for trustee draining */ | 87 | TRUSTEE_COOLDOWN = HZ / 10, /* for trustee draining */ |
| @@ -2047,6 +2049,15 @@ repeat: | |||
| 2047 | move_linked_works(work, scheduled, &n); | 2049 | move_linked_works(work, scheduled, &n); |
| 2048 | 2050 | ||
| 2049 | process_scheduled_works(rescuer); | 2051 | process_scheduled_works(rescuer); |
| 2052 | |||
| 2053 | /* | ||
| 2054 | * Leave this gcwq. If keep_working() is %true, notify a | ||
| 2055 | * regular worker; otherwise, we end up with 0 concurrency | ||
| 2056 | * and stalling the execution. | ||
| 2057 | */ | ||
| 2058 | if (keep_working(gcwq)) | ||
| 2059 | wake_up_worker(gcwq); | ||
| 2060 | |||
| 2050 | spin_unlock_irq(&gcwq->lock); | 2061 | spin_unlock_irq(&gcwq->lock); |
| 2051 | } | 2062 | } |
| 2052 | 2063 | ||
| @@ -2956,7 +2967,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *name, | |||
| 2956 | */ | 2967 | */ |
| 2957 | spin_lock(&workqueue_lock); | 2968 | spin_lock(&workqueue_lock); |
| 2958 | 2969 | ||
| 2959 | if (workqueue_freezing && wq->flags & WQ_FREEZEABLE) | 2970 | if (workqueue_freezing && wq->flags & WQ_FREEZABLE) |
| 2960 | for_each_cwq_cpu(cpu, wq) | 2971 | for_each_cwq_cpu(cpu, wq) |
| 2961 | get_cwq(cpu, wq)->max_active = 0; | 2972 | get_cwq(cpu, wq)->max_active = 0; |
| 2962 | 2973 | ||
| @@ -3068,7 +3079,7 @@ void workqueue_set_max_active(struct workqueue_struct *wq, int max_active) | |||
| 3068 | 3079 | ||
| 3069 | spin_lock_irq(&gcwq->lock); | 3080 | spin_lock_irq(&gcwq->lock); |
| 3070 | 3081 | ||
| 3071 | if (!(wq->flags & WQ_FREEZEABLE) || | 3082 | if (!(wq->flags & WQ_FREEZABLE) || |
| 3072 | !(gcwq->flags & GCWQ_FREEZING)) | 3083 | !(gcwq->flags & GCWQ_FREEZING)) |
| 3073 | get_cwq(gcwq->cpu, wq)->max_active = max_active; | 3084 | get_cwq(gcwq->cpu, wq)->max_active = max_active; |
| 3074 | 3085 | ||
| @@ -3318,7 +3329,7 @@ static int __cpuinit trustee_thread(void *__gcwq) | |||
| 3318 | * want to get it over with ASAP - spam rescuers, wake up as | 3329 | * want to get it over with ASAP - spam rescuers, wake up as |
| 3319 | * many idlers as necessary and create new ones till the | 3330 | * many idlers as necessary and create new ones till the |
| 3320 | * worklist is empty. Note that if the gcwq is frozen, there | 3331 | * worklist is empty. Note that if the gcwq is frozen, there |
| 3321 | * may be frozen works in freezeable cwqs. Don't declare | 3332 | * may be frozen works in freezable cwqs. Don't declare |
| 3322 | * completion while frozen. | 3333 | * completion while frozen. |
| 3323 | */ | 3334 | */ |
| 3324 | while (gcwq->nr_workers != gcwq->nr_idle || | 3335 | while (gcwq->nr_workers != gcwq->nr_idle || |
| @@ -3576,9 +3587,9 @@ EXPORT_SYMBOL_GPL(work_on_cpu); | |||
| 3576 | /** | 3587 | /** |
| 3577 | * freeze_workqueues_begin - begin freezing workqueues | 3588 | * freeze_workqueues_begin - begin freezing workqueues |
| 3578 | * | 3589 | * |
| 3579 | * Start freezing workqueues. After this function returns, all | 3590 | * Start freezing workqueues. After this function returns, all freezable |
| 3580 | * freezeable workqueues will queue new works to their frozen_works | 3591 | * workqueues will queue new works to their frozen_works list instead of |
| 3581 | * list instead of gcwq->worklist. | 3592 | * gcwq->worklist. |
| 3582 | * | 3593 | * |
| 3583 | * CONTEXT: | 3594 | * CONTEXT: |
| 3584 | * Grabs and releases workqueue_lock and gcwq->lock's. | 3595 | * Grabs and releases workqueue_lock and gcwq->lock's. |
| @@ -3604,7 +3615,7 @@ void freeze_workqueues_begin(void) | |||
| 3604 | list_for_each_entry(wq, &workqueues, list) { | 3615 | list_for_each_entry(wq, &workqueues, list) { |
| 3605 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); | 3616 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); |
| 3606 | 3617 | ||
| 3607 | if (cwq && wq->flags & WQ_FREEZEABLE) | 3618 | if (cwq && wq->flags & WQ_FREEZABLE) |
| 3608 | cwq->max_active = 0; | 3619 | cwq->max_active = 0; |
| 3609 | } | 3620 | } |
| 3610 | 3621 | ||
| @@ -3615,7 +3626,7 @@ void freeze_workqueues_begin(void) | |||
| 3615 | } | 3626 | } |
| 3616 | 3627 | ||
| 3617 | /** | 3628 | /** |
| 3618 | * freeze_workqueues_busy - are freezeable workqueues still busy? | 3629 | * freeze_workqueues_busy - are freezable workqueues still busy? |
| 3619 | * | 3630 | * |
| 3620 | * Check whether freezing is complete. This function must be called | 3631 | * Check whether freezing is complete. This function must be called |
| 3621 | * between freeze_workqueues_begin() and thaw_workqueues(). | 3632 | * between freeze_workqueues_begin() and thaw_workqueues(). |
| @@ -3624,8 +3635,8 @@ void freeze_workqueues_begin(void) | |||
| 3624 | * Grabs and releases workqueue_lock. | 3635 | * Grabs and releases workqueue_lock. |
| 3625 | * | 3636 | * |
| 3626 | * RETURNS: | 3637 | * RETURNS: |
| 3627 | * %true if some freezeable workqueues are still busy. %false if | 3638 | * %true if some freezable workqueues are still busy. %false if freezing |
| 3628 | * freezing is complete. | 3639 | * is complete. |
| 3629 | */ | 3640 | */ |
| 3630 | bool freeze_workqueues_busy(void) | 3641 | bool freeze_workqueues_busy(void) |
| 3631 | { | 3642 | { |
| @@ -3645,7 +3656,7 @@ bool freeze_workqueues_busy(void) | |||
| 3645 | list_for_each_entry(wq, &workqueues, list) { | 3656 | list_for_each_entry(wq, &workqueues, list) { |
| 3646 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); | 3657 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); |
| 3647 | 3658 | ||
| 3648 | if (!cwq || !(wq->flags & WQ_FREEZEABLE)) | 3659 | if (!cwq || !(wq->flags & WQ_FREEZABLE)) |
| 3649 | continue; | 3660 | continue; |
| 3650 | 3661 | ||
| 3651 | BUG_ON(cwq->nr_active < 0); | 3662 | BUG_ON(cwq->nr_active < 0); |
| @@ -3690,7 +3701,7 @@ void thaw_workqueues(void) | |||
| 3690 | list_for_each_entry(wq, &workqueues, list) { | 3701 | list_for_each_entry(wq, &workqueues, list) { |
| 3691 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); | 3702 | struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); |
| 3692 | 3703 | ||
| 3693 | if (!cwq || !(wq->flags & WQ_FREEZEABLE)) | 3704 | if (!cwq || !(wq->flags & WQ_FREEZABLE)) |
| 3694 | continue; | 3705 | continue; |
| 3695 | 3706 | ||
| 3696 | /* restore max_active and repopulate worklist */ | 3707 | /* restore max_active and repopulate worklist */ |
diff --git a/lib/list_debug.c b/lib/list_debug.c index 344c710d16ca..b8029a5583ff 100644 --- a/lib/list_debug.c +++ b/lib/list_debug.c | |||
| @@ -35,6 +35,31 @@ void __list_add(struct list_head *new, | |||
| 35 | } | 35 | } |
| 36 | EXPORT_SYMBOL(__list_add); | 36 | EXPORT_SYMBOL(__list_add); |
| 37 | 37 | ||
| 38 | void __list_del_entry(struct list_head *entry) | ||
| 39 | { | ||
| 40 | struct list_head *prev, *next; | ||
| 41 | |||
| 42 | prev = entry->prev; | ||
| 43 | next = entry->next; | ||
| 44 | |||
| 45 | if (WARN(next == LIST_POISON1, | ||
| 46 | "list_del corruption, %p->next is LIST_POISON1 (%p)\n", | ||
| 47 | entry, LIST_POISON1) || | ||
| 48 | WARN(prev == LIST_POISON2, | ||
| 49 | "list_del corruption, %p->prev is LIST_POISON2 (%p)\n", | ||
| 50 | entry, LIST_POISON2) || | ||
| 51 | WARN(prev->next != entry, | ||
| 52 | "list_del corruption. prev->next should be %p, " | ||
| 53 | "but was %p\n", entry, prev->next) || | ||
| 54 | WARN(next->prev != entry, | ||
| 55 | "list_del corruption. next->prev should be %p, " | ||
| 56 | "but was %p\n", entry, next->prev)) | ||
| 57 | return; | ||
| 58 | |||
| 59 | __list_del(prev, next); | ||
| 60 | } | ||
| 61 | EXPORT_SYMBOL(__list_del_entry); | ||
| 62 | |||
| 38 | /** | 63 | /** |
| 39 | * list_del - deletes entry from list. | 64 | * list_del - deletes entry from list. |
| 40 | * @entry: the element to delete from the list. | 65 | * @entry: the element to delete from the list. |
| @@ -43,19 +68,7 @@ EXPORT_SYMBOL(__list_add); | |||
| 43 | */ | 68 | */ |
| 44 | void list_del(struct list_head *entry) | 69 | void list_del(struct list_head *entry) |
| 45 | { | 70 | { |
| 46 | WARN(entry->next == LIST_POISON1, | 71 | __list_del_entry(entry); |
| 47 | "list_del corruption, next is LIST_POISON1 (%p)\n", | ||
| 48 | LIST_POISON1); | ||
| 49 | WARN(entry->next != LIST_POISON1 && entry->prev == LIST_POISON2, | ||
| 50 | "list_del corruption, prev is LIST_POISON2 (%p)\n", | ||
| 51 | LIST_POISON2); | ||
| 52 | WARN(entry->prev->next != entry, | ||
| 53 | "list_del corruption. prev->next should be %p, " | ||
| 54 | "but was %p\n", entry, entry->prev->next); | ||
| 55 | WARN(entry->next->prev != entry, | ||
| 56 | "list_del corruption. next->prev should be %p, " | ||
| 57 | "but was %p\n", entry, entry->next->prev); | ||
| 58 | __list_del(entry->prev, entry->next); | ||
| 59 | entry->next = LIST_POISON1; | 72 | entry->next = LIST_POISON1; |
| 60 | entry->prev = LIST_POISON2; | 73 | entry->prev = LIST_POISON2; |
| 61 | } | 74 | } |
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index c47bbe11b804..93ca08b8a451 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
| @@ -686,8 +686,10 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, | |||
| 686 | /* | 686 | /* |
| 687 | * Ensure that the address returned is DMA'ble | 687 | * Ensure that the address returned is DMA'ble |
| 688 | */ | 688 | */ |
| 689 | if (!dma_capable(dev, dev_addr, size)) | 689 | if (!dma_capable(dev, dev_addr, size)) { |
| 690 | panic("map_single: bounce buffer is not DMA'ble"); | 690 | swiotlb_tbl_unmap_single(dev, map, size, dir); |
| 691 | dev_addr = swiotlb_virt_to_bus(dev, io_tlb_overflow_buffer); | ||
| 692 | } | ||
| 691 | 693 | ||
| 692 | return dev_addr; | 694 | return dev_addr; |
| 693 | } | 695 | } |
diff --git a/mm/memory.c b/mm/memory.c index 8e8c18324863..5823698c2b71 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
| @@ -2648,6 +2648,7 @@ void unmap_mapping_range(struct address_space *mapping, | |||
| 2648 | details.last_index = ULONG_MAX; | 2648 | details.last_index = ULONG_MAX; |
| 2649 | details.i_mmap_lock = &mapping->i_mmap_lock; | 2649 | details.i_mmap_lock = &mapping->i_mmap_lock; |
| 2650 | 2650 | ||
| 2651 | mutex_lock(&mapping->unmap_mutex); | ||
| 2651 | spin_lock(&mapping->i_mmap_lock); | 2652 | spin_lock(&mapping->i_mmap_lock); |
| 2652 | 2653 | ||
| 2653 | /* Protect against endless unmapping loops */ | 2654 | /* Protect against endless unmapping loops */ |
| @@ -2664,6 +2665,7 @@ void unmap_mapping_range(struct address_space *mapping, | |||
| 2664 | if (unlikely(!list_empty(&mapping->i_mmap_nonlinear))) | 2665 | if (unlikely(!list_empty(&mapping->i_mmap_nonlinear))) |
| 2665 | unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details); | 2666 | unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details); |
| 2666 | spin_unlock(&mapping->i_mmap_lock); | 2667 | spin_unlock(&mapping->i_mmap_lock); |
| 2668 | mutex_unlock(&mapping->unmap_mutex); | ||
| 2667 | } | 2669 | } |
| 2668 | EXPORT_SYMBOL(unmap_mapping_range); | 2670 | EXPORT_SYMBOL(unmap_mapping_range); |
| 2669 | 2671 | ||
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 368fc9d23610..49355a970be2 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
| @@ -1830,7 +1830,7 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, | |||
| 1830 | if (unlikely(pol->mode == MPOL_INTERLEAVE)) { | 1830 | if (unlikely(pol->mode == MPOL_INTERLEAVE)) { |
| 1831 | unsigned nid; | 1831 | unsigned nid; |
| 1832 | 1832 | ||
| 1833 | nid = interleave_nid(pol, vma, addr, PAGE_SHIFT); | 1833 | nid = interleave_nid(pol, vma, addr, PAGE_SHIFT + order); |
| 1834 | mpol_cond_put(pol); | 1834 | mpol_cond_put(pol); |
| 1835 | page = alloc_page_interleave(gfp, order, nid); | 1835 | page = alloc_page_interleave(gfp, order, nid); |
| 1836 | put_mems_allowed(); | 1836 | put_mems_allowed(); |
diff --git a/mm/migrate.c b/mm/migrate.c index 766115253807..352de555626c 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
| @@ -1287,14 +1287,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, | |||
| 1287 | return -EPERM; | 1287 | return -EPERM; |
| 1288 | 1288 | ||
| 1289 | /* Find the mm_struct */ | 1289 | /* Find the mm_struct */ |
| 1290 | read_lock(&tasklist_lock); | 1290 | rcu_read_lock(); |
| 1291 | task = pid ? find_task_by_vpid(pid) : current; | 1291 | task = pid ? find_task_by_vpid(pid) : current; |
| 1292 | if (!task) { | 1292 | if (!task) { |
| 1293 | read_unlock(&tasklist_lock); | 1293 | rcu_read_unlock(); |
| 1294 | return -ESRCH; | 1294 | return -ESRCH; |
| 1295 | } | 1295 | } |
| 1296 | mm = get_task_mm(task); | 1296 | mm = get_task_mm(task); |
| 1297 | read_unlock(&tasklist_lock); | 1297 | rcu_read_unlock(); |
| 1298 | 1298 | ||
| 1299 | if (!mm) | 1299 | if (!mm) |
| 1300 | return -EINVAL; | 1300 | return -EINVAL; |
diff --git a/mm/mremap.c b/mm/mremap.c index 9925b6391b80..1de98d492ddc 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
| @@ -94,9 +94,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, | |||
| 94 | */ | 94 | */ |
| 95 | mapping = vma->vm_file->f_mapping; | 95 | mapping = vma->vm_file->f_mapping; |
| 96 | spin_lock(&mapping->i_mmap_lock); | 96 | spin_lock(&mapping->i_mmap_lock); |
| 97 | if (new_vma->vm_truncate_count && | 97 | new_vma->vm_truncate_count = 0; |
| 98 | new_vma->vm_truncate_count != vma->vm_truncate_count) | ||
| 99 | new_vma->vm_truncate_count = 0; | ||
| 100 | } | 98 | } |
| 101 | 99 | ||
| 102 | /* | 100 | /* |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a873e61e312e..cdef1d4b4e47 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -5376,10 +5376,9 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count) | |||
| 5376 | for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) { | 5376 | for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) { |
| 5377 | unsigned long check = pfn + iter; | 5377 | unsigned long check = pfn + iter; |
| 5378 | 5378 | ||
| 5379 | if (!pfn_valid_within(check)) { | 5379 | if (!pfn_valid_within(check)) |
| 5380 | iter++; | ||
| 5381 | continue; | 5380 | continue; |
| 5382 | } | 5381 | |
| 5383 | page = pfn_to_page(check); | 5382 | page = pfn_to_page(check); |
| 5384 | if (!page_count(page)) { | 5383 | if (!page_count(page)) { |
| 5385 | if (PageBuddy(page)) | 5384 | if (PageBuddy(page)) |
diff --git a/mm/swapfile.c b/mm/swapfile.c index 07a458d72fa8..0341c5700e34 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
| @@ -1940,7 +1940,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) | |||
| 1940 | 1940 | ||
| 1941 | error = -EINVAL; | 1941 | error = -EINVAL; |
| 1942 | if (S_ISBLK(inode->i_mode)) { | 1942 | if (S_ISBLK(inode->i_mode)) { |
| 1943 | bdev = I_BDEV(inode); | 1943 | bdev = bdgrab(I_BDEV(inode)); |
| 1944 | error = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, | 1944 | error = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, |
| 1945 | sys_swapon); | 1945 | sys_swapon); |
| 1946 | if (error < 0) { | 1946 | if (error < 0) { |
diff --git a/mm/truncate.c b/mm/truncate.c index 49feb46e77b8..d64296be00d3 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
| @@ -225,6 +225,7 @@ void truncate_inode_pages_range(struct address_space *mapping, | |||
| 225 | next = start; | 225 | next = start; |
| 226 | while (next <= end && | 226 | while (next <= end && |
| 227 | pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) { | 227 | pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) { |
| 228 | mem_cgroup_uncharge_start(); | ||
| 228 | for (i = 0; i < pagevec_count(&pvec); i++) { | 229 | for (i = 0; i < pagevec_count(&pvec); i++) { |
| 229 | struct page *page = pvec.pages[i]; | 230 | struct page *page = pvec.pages[i]; |
| 230 | pgoff_t page_index = page->index; | 231 | pgoff_t page_index = page->index; |
| @@ -247,6 +248,7 @@ void truncate_inode_pages_range(struct address_space *mapping, | |||
| 247 | unlock_page(page); | 248 | unlock_page(page); |
| 248 | } | 249 | } |
| 249 | pagevec_release(&pvec); | 250 | pagevec_release(&pvec); |
| 251 | mem_cgroup_uncharge_end(); | ||
| 250 | cond_resched(); | 252 | cond_resched(); |
| 251 | } | 253 | } |
| 252 | 254 | ||
diff --git a/mm/vmscan.c b/mm/vmscan.c index 17497d0cd8b9..6771ea70bfe7 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -1841,16 +1841,28 @@ static inline bool should_continue_reclaim(struct zone *zone, | |||
| 1841 | if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION)) | 1841 | if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION)) |
| 1842 | return false; | 1842 | return false; |
| 1843 | 1843 | ||
| 1844 | /* | 1844 | /* Consider stopping depending on scan and reclaim activity */ |
| 1845 | * If we failed to reclaim and have scanned the full list, stop. | 1845 | if (sc->gfp_mask & __GFP_REPEAT) { |
| 1846 | * NOTE: Checking just nr_reclaimed would exit reclaim/compaction far | 1846 | /* |
| 1847 | * faster but obviously would be less likely to succeed | 1847 | * For __GFP_REPEAT allocations, stop reclaiming if the |
| 1848 | * allocation. If this is desirable, use GFP_REPEAT to decide | 1848 | * full LRU list has been scanned and we are still failing |
| 1849 | * if both reclaimed and scanned should be checked or just | 1849 | * to reclaim pages. This full LRU scan is potentially |
| 1850 | * reclaimed | 1850 | * expensive but a __GFP_REPEAT caller really wants to succeed |
| 1851 | */ | 1851 | */ |
| 1852 | if (!nr_reclaimed && !nr_scanned) | 1852 | if (!nr_reclaimed && !nr_scanned) |
| 1853 | return false; | 1853 | return false; |
| 1854 | } else { | ||
| 1855 | /* | ||
| 1856 | * For non-__GFP_REPEAT allocations which can presumably | ||
| 1857 | * fail without consequence, stop if we failed to reclaim | ||
| 1858 | * any pages from the last SWAP_CLUSTER_MAX number of | ||
| 1859 | * pages that were scanned. This will return to the | ||
| 1860 | * caller faster at the risk reclaim/compaction and | ||
| 1861 | * the resulting allocation attempt fails | ||
| 1862 | */ | ||
| 1863 | if (!nr_reclaimed) | ||
| 1864 | return false; | ||
| 1865 | } | ||
| 1854 | 1866 | ||
| 1855 | /* | 1867 | /* |
| 1856 | * If we have not reclaimed enough pages for compaction and the | 1868 | * If we have not reclaimed enough pages for compaction and the |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 7550abb0c96a..675614e38e14 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
| @@ -859,6 +859,7 @@ static void __l2cap_sock_close(struct sock *sk, int reason) | |||
| 859 | result = L2CAP_CR_SEC_BLOCK; | 859 | result = L2CAP_CR_SEC_BLOCK; |
| 860 | else | 860 | else |
| 861 | result = L2CAP_CR_BAD_PSM; | 861 | result = L2CAP_CR_BAD_PSM; |
| 862 | sk->sk_state = BT_DISCONN; | ||
| 862 | 863 | ||
| 863 | rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid); | 864 | rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid); |
| 864 | rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid); | 865 | rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid); |
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 2575c2db6404..d7b9af4703d0 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
| @@ -727,7 +727,9 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
| 727 | break; | 727 | break; |
| 728 | } | 728 | } |
| 729 | 729 | ||
| 730 | tty_unlock(); | ||
| 730 | schedule(); | 731 | schedule(); |
| 732 | tty_lock(); | ||
| 731 | } | 733 | } |
| 732 | set_current_state(TASK_RUNNING); | 734 | set_current_state(TASK_RUNNING); |
| 733 | remove_wait_queue(&dev->wait, &wait); | 735 | remove_wait_queue(&dev->wait, &wait); |
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 6f6d8e1b776f..88e4aa9cb1f9 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
| @@ -80,7 +80,7 @@ int br_handle_frame_finish(struct sk_buff *skb) | |||
| 80 | if (is_multicast_ether_addr(dest)) { | 80 | if (is_multicast_ether_addr(dest)) { |
| 81 | mdst = br_mdb_get(br, skb); | 81 | mdst = br_mdb_get(br, skb); |
| 82 | if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) { | 82 | if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) { |
| 83 | if ((mdst && !hlist_unhashed(&mdst->mglist)) || | 83 | if ((mdst && mdst->mglist) || |
| 84 | br_multicast_is_router(br)) | 84 | br_multicast_is_router(br)) |
| 85 | skb2 = skb; | 85 | skb2 = skb; |
| 86 | br_multicast_forward(mdst, skb, skb2); | 86 | br_multicast_forward(mdst, skb, skb2); |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index f701a21acb34..030a002ff8ee 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
| @@ -37,10 +37,9 @@ | |||
| 37 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) | 37 | rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) |
| 38 | 38 | ||
| 39 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 39 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 40 | static inline int ipv6_is_local_multicast(const struct in6_addr *addr) | 40 | static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) |
| 41 | { | 41 | { |
| 42 | if (ipv6_addr_is_multicast(addr) && | 42 | if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr)) |
| 43 | IPV6_ADDR_MC_SCOPE(addr) <= IPV6_ADDR_SCOPE_LINKLOCAL) | ||
| 44 | return 1; | 43 | return 1; |
| 45 | return 0; | 44 | return 0; |
| 46 | } | 45 | } |
| @@ -232,8 +231,7 @@ static void br_multicast_group_expired(unsigned long data) | |||
| 232 | if (!netif_running(br->dev) || timer_pending(&mp->timer)) | 231 | if (!netif_running(br->dev) || timer_pending(&mp->timer)) |
| 233 | goto out; | 232 | goto out; |
| 234 | 233 | ||
| 235 | if (!hlist_unhashed(&mp->mglist)) | 234 | mp->mglist = false; |
| 236 | hlist_del_init(&mp->mglist); | ||
| 237 | 235 | ||
| 238 | if (mp->ports) | 236 | if (mp->ports) |
| 239 | goto out; | 237 | goto out; |
| @@ -276,7 +274,7 @@ static void br_multicast_del_pg(struct net_bridge *br, | |||
| 276 | del_timer(&p->query_timer); | 274 | del_timer(&p->query_timer); |
| 277 | call_rcu_bh(&p->rcu, br_multicast_free_pg); | 275 | call_rcu_bh(&p->rcu, br_multicast_free_pg); |
| 278 | 276 | ||
| 279 | if (!mp->ports && hlist_unhashed(&mp->mglist) && | 277 | if (!mp->ports && !mp->mglist && |
| 280 | netif_running(br->dev)) | 278 | netif_running(br->dev)) |
| 281 | mod_timer(&mp->timer, jiffies); | 279 | mod_timer(&mp->timer, jiffies); |
| 282 | 280 | ||
| @@ -436,7 +434,6 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, | |||
| 436 | eth = eth_hdr(skb); | 434 | eth = eth_hdr(skb); |
| 437 | 435 | ||
| 438 | memcpy(eth->h_source, br->dev->dev_addr, 6); | 436 | memcpy(eth->h_source, br->dev->dev_addr, 6); |
| 439 | ipv6_eth_mc_map(group, eth->h_dest); | ||
| 440 | eth->h_proto = htons(ETH_P_IPV6); | 437 | eth->h_proto = htons(ETH_P_IPV6); |
| 441 | skb_put(skb, sizeof(*eth)); | 438 | skb_put(skb, sizeof(*eth)); |
| 442 | 439 | ||
| @@ -448,8 +445,10 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, | |||
| 448 | ip6h->payload_len = htons(8 + sizeof(*mldq)); | 445 | ip6h->payload_len = htons(8 + sizeof(*mldq)); |
| 449 | ip6h->nexthdr = IPPROTO_HOPOPTS; | 446 | ip6h->nexthdr = IPPROTO_HOPOPTS; |
| 450 | ip6h->hop_limit = 1; | 447 | ip6h->hop_limit = 1; |
| 451 | ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0); | 448 | ipv6_dev_get_saddr(dev_net(br->dev), br->dev, &ip6h->daddr, 0, |
| 449 | &ip6h->saddr); | ||
| 452 | ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1)); | 450 | ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1)); |
| 451 | ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest); | ||
| 453 | 452 | ||
| 454 | hopopt = (u8 *)(ip6h + 1); | 453 | hopopt = (u8 *)(ip6h + 1); |
| 455 | hopopt[0] = IPPROTO_ICMPV6; /* next hdr */ | 454 | hopopt[0] = IPPROTO_ICMPV6; /* next hdr */ |
| @@ -528,7 +527,7 @@ static void br_multicast_group_query_expired(unsigned long data) | |||
| 528 | struct net_bridge *br = mp->br; | 527 | struct net_bridge *br = mp->br; |
| 529 | 528 | ||
| 530 | spin_lock(&br->multicast_lock); | 529 | spin_lock(&br->multicast_lock); |
| 531 | if (!netif_running(br->dev) || hlist_unhashed(&mp->mglist) || | 530 | if (!netif_running(br->dev) || !mp->mglist || |
| 532 | mp->queries_sent >= br->multicast_last_member_count) | 531 | mp->queries_sent >= br->multicast_last_member_count) |
| 533 | goto out; | 532 | goto out; |
| 534 | 533 | ||
| @@ -719,7 +718,7 @@ static int br_multicast_add_group(struct net_bridge *br, | |||
| 719 | goto err; | 718 | goto err; |
| 720 | 719 | ||
| 721 | if (!port) { | 720 | if (!port) { |
| 722 | hlist_add_head(&mp->mglist, &br->mglist); | 721 | mp->mglist = true; |
| 723 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | 722 | mod_timer(&mp->timer, now + br->multicast_membership_interval); |
| 724 | goto out; | 723 | goto out; |
| 725 | } | 724 | } |
| @@ -781,11 +780,11 @@ static int br_ip6_multicast_add_group(struct net_bridge *br, | |||
| 781 | { | 780 | { |
| 782 | struct br_ip br_group; | 781 | struct br_ip br_group; |
| 783 | 782 | ||
| 784 | if (ipv6_is_local_multicast(group)) | 783 | if (!ipv6_is_transient_multicast(group)) |
| 785 | return 0; | 784 | return 0; |
| 786 | 785 | ||
| 787 | ipv6_addr_copy(&br_group.u.ip6, group); | 786 | ipv6_addr_copy(&br_group.u.ip6, group); |
| 788 | br_group.proto = htons(ETH_P_IP); | 787 | br_group.proto = htons(ETH_P_IPV6); |
| 789 | 788 | ||
| 790 | return br_multicast_add_group(br, port, &br_group); | 789 | return br_multicast_add_group(br, port, &br_group); |
| 791 | } | 790 | } |
| @@ -1014,18 +1013,19 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, | |||
| 1014 | 1013 | ||
| 1015 | nsrcs = skb_header_pointer(skb, | 1014 | nsrcs = skb_header_pointer(skb, |
| 1016 | len + offsetof(struct mld2_grec, | 1015 | len + offsetof(struct mld2_grec, |
| 1017 | grec_mca), | 1016 | grec_nsrcs), |
| 1018 | sizeof(_nsrcs), &_nsrcs); | 1017 | sizeof(_nsrcs), &_nsrcs); |
| 1019 | if (!nsrcs) | 1018 | if (!nsrcs) |
| 1020 | return -EINVAL; | 1019 | return -EINVAL; |
| 1021 | 1020 | ||
| 1022 | if (!pskb_may_pull(skb, | 1021 | if (!pskb_may_pull(skb, |
| 1023 | len + sizeof(*grec) + | 1022 | len + sizeof(*grec) + |
| 1024 | sizeof(struct in6_addr) * (*nsrcs))) | 1023 | sizeof(struct in6_addr) * ntohs(*nsrcs))) |
| 1025 | return -EINVAL; | 1024 | return -EINVAL; |
| 1026 | 1025 | ||
| 1027 | grec = (struct mld2_grec *)(skb->data + len); | 1026 | grec = (struct mld2_grec *)(skb->data + len); |
| 1028 | len += sizeof(*grec) + sizeof(struct in6_addr) * (*nsrcs); | 1027 | len += sizeof(*grec) + |
| 1028 | sizeof(struct in6_addr) * ntohs(*nsrcs); | ||
| 1029 | 1029 | ||
| 1030 | /* We treat these as MLDv1 reports for now. */ | 1030 | /* We treat these as MLDv1 reports for now. */ |
| 1031 | switch (grec->grec_type) { | 1031 | switch (grec->grec_type) { |
| @@ -1165,7 +1165,7 @@ static int br_ip4_multicast_query(struct net_bridge *br, | |||
| 1165 | 1165 | ||
| 1166 | max_delay *= br->multicast_last_member_count; | 1166 | max_delay *= br->multicast_last_member_count; |
| 1167 | 1167 | ||
| 1168 | if (!hlist_unhashed(&mp->mglist) && | 1168 | if (mp->mglist && |
| 1169 | (timer_pending(&mp->timer) ? | 1169 | (timer_pending(&mp->timer) ? |
| 1170 | time_after(mp->timer.expires, now + max_delay) : | 1170 | time_after(mp->timer.expires, now + max_delay) : |
| 1171 | try_to_del_timer_sync(&mp->timer) >= 0)) | 1171 | try_to_del_timer_sync(&mp->timer) >= 0)) |
| @@ -1177,7 +1177,7 @@ static int br_ip4_multicast_query(struct net_bridge *br, | |||
| 1177 | if (timer_pending(&p->timer) ? | 1177 | if (timer_pending(&p->timer) ? |
| 1178 | time_after(p->timer.expires, now + max_delay) : | 1178 | time_after(p->timer.expires, now + max_delay) : |
| 1179 | try_to_del_timer_sync(&p->timer) >= 0) | 1179 | try_to_del_timer_sync(&p->timer) >= 0) |
| 1180 | mod_timer(&mp->timer, now + max_delay); | 1180 | mod_timer(&p->timer, now + max_delay); |
| 1181 | } | 1181 | } |
| 1182 | 1182 | ||
| 1183 | out: | 1183 | out: |
| @@ -1236,7 +1236,7 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
| 1236 | goto out; | 1236 | goto out; |
| 1237 | 1237 | ||
| 1238 | max_delay *= br->multicast_last_member_count; | 1238 | max_delay *= br->multicast_last_member_count; |
| 1239 | if (!hlist_unhashed(&mp->mglist) && | 1239 | if (mp->mglist && |
| 1240 | (timer_pending(&mp->timer) ? | 1240 | (timer_pending(&mp->timer) ? |
| 1241 | time_after(mp->timer.expires, now + max_delay) : | 1241 | time_after(mp->timer.expires, now + max_delay) : |
| 1242 | try_to_del_timer_sync(&mp->timer) >= 0)) | 1242 | try_to_del_timer_sync(&mp->timer) >= 0)) |
| @@ -1248,7 +1248,7 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
| 1248 | if (timer_pending(&p->timer) ? | 1248 | if (timer_pending(&p->timer) ? |
| 1249 | time_after(p->timer.expires, now + max_delay) : | 1249 | time_after(p->timer.expires, now + max_delay) : |
| 1250 | try_to_del_timer_sync(&p->timer) >= 0) | 1250 | try_to_del_timer_sync(&p->timer) >= 0) |
| 1251 | mod_timer(&mp->timer, now + max_delay); | 1251 | mod_timer(&p->timer, now + max_delay); |
| 1252 | } | 1252 | } |
| 1253 | 1253 | ||
| 1254 | out: | 1254 | out: |
| @@ -1283,7 +1283,7 @@ static void br_multicast_leave_group(struct net_bridge *br, | |||
| 1283 | br->multicast_last_member_interval; | 1283 | br->multicast_last_member_interval; |
| 1284 | 1284 | ||
| 1285 | if (!port) { | 1285 | if (!port) { |
| 1286 | if (!hlist_unhashed(&mp->mglist) && | 1286 | if (mp->mglist && |
| 1287 | (timer_pending(&mp->timer) ? | 1287 | (timer_pending(&mp->timer) ? |
| 1288 | time_after(mp->timer.expires, time) : | 1288 | time_after(mp->timer.expires, time) : |
| 1289 | try_to_del_timer_sync(&mp->timer) >= 0)) { | 1289 | try_to_del_timer_sync(&mp->timer) >= 0)) { |
| @@ -1341,7 +1341,7 @@ static void br_ip6_multicast_leave_group(struct net_bridge *br, | |||
| 1341 | { | 1341 | { |
| 1342 | struct br_ip br_group; | 1342 | struct br_ip br_group; |
| 1343 | 1343 | ||
| 1344 | if (ipv6_is_local_multicast(group)) | 1344 | if (!ipv6_is_transient_multicast(group)) |
| 1345 | return; | 1345 | return; |
| 1346 | 1346 | ||
| 1347 | ipv6_addr_copy(&br_group.u.ip6, group); | 1347 | ipv6_addr_copy(&br_group.u.ip6, group); |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 84aac7734bfc..4e1b620b6be6 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
| @@ -84,13 +84,13 @@ struct net_bridge_port_group { | |||
| 84 | struct net_bridge_mdb_entry | 84 | struct net_bridge_mdb_entry |
| 85 | { | 85 | { |
| 86 | struct hlist_node hlist[2]; | 86 | struct hlist_node hlist[2]; |
| 87 | struct hlist_node mglist; | ||
| 88 | struct net_bridge *br; | 87 | struct net_bridge *br; |
| 89 | struct net_bridge_port_group __rcu *ports; | 88 | struct net_bridge_port_group __rcu *ports; |
| 90 | struct rcu_head rcu; | 89 | struct rcu_head rcu; |
| 91 | struct timer_list timer; | 90 | struct timer_list timer; |
| 92 | struct timer_list query_timer; | 91 | struct timer_list query_timer; |
| 93 | struct br_ip addr; | 92 | struct br_ip addr; |
| 93 | bool mglist; | ||
| 94 | u32 queries_sent; | 94 | u32 queries_sent; |
| 95 | }; | 95 | }; |
| 96 | 96 | ||
| @@ -238,7 +238,6 @@ struct net_bridge | |||
| 238 | spinlock_t multicast_lock; | 238 | spinlock_t multicast_lock; |
| 239 | struct net_bridge_mdb_htable __rcu *mdb; | 239 | struct net_bridge_mdb_htable __rcu *mdb; |
| 240 | struct hlist_head router_list; | 240 | struct hlist_head router_list; |
| 241 | struct hlist_head mglist; | ||
| 242 | 241 | ||
| 243 | struct timer_list multicast_router_timer; | 242 | struct timer_list multicast_router_timer; |
| 244 | struct timer_list multicast_querier_timer; | 243 | struct timer_list multicast_querier_timer; |
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index dff633d62e5b..35b36b86d762 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
| @@ -252,8 +252,12 @@ static int ceph_tcp_recvmsg(struct socket *sock, void *buf, size_t len) | |||
| 252 | { | 252 | { |
| 253 | struct kvec iov = {buf, len}; | 253 | struct kvec iov = {buf, len}; |
| 254 | struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL }; | 254 | struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL }; |
| 255 | int r; | ||
| 255 | 256 | ||
| 256 | return kernel_recvmsg(sock, &msg, &iov, 1, len, msg.msg_flags); | 257 | r = kernel_recvmsg(sock, &msg, &iov, 1, len, msg.msg_flags); |
| 258 | if (r == -EAGAIN) | ||
| 259 | r = 0; | ||
| 260 | return r; | ||
| 257 | } | 261 | } |
| 258 | 262 | ||
| 259 | /* | 263 | /* |
| @@ -264,13 +268,17 @@ static int ceph_tcp_sendmsg(struct socket *sock, struct kvec *iov, | |||
| 264 | size_t kvlen, size_t len, int more) | 268 | size_t kvlen, size_t len, int more) |
| 265 | { | 269 | { |
| 266 | struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL }; | 270 | struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL }; |
| 271 | int r; | ||
| 267 | 272 | ||
| 268 | if (more) | 273 | if (more) |
| 269 | msg.msg_flags |= MSG_MORE; | 274 | msg.msg_flags |= MSG_MORE; |
| 270 | else | 275 | else |
| 271 | msg.msg_flags |= MSG_EOR; /* superfluous, but what the hell */ | 276 | msg.msg_flags |= MSG_EOR; /* superfluous, but what the hell */ |
| 272 | 277 | ||
| 273 | return kernel_sendmsg(sock, &msg, iov, kvlen, len); | 278 | r = kernel_sendmsg(sock, &msg, iov, kvlen, len); |
| 279 | if (r == -EAGAIN) | ||
| 280 | r = 0; | ||
| 281 | return r; | ||
| 274 | } | 282 | } |
| 275 | 283 | ||
| 276 | 284 | ||
| @@ -847,6 +855,8 @@ static int write_partial_msg_pages(struct ceph_connection *con) | |||
| 847 | (msg->pages || msg->pagelist || msg->bio || in_trail)) | 855 | (msg->pages || msg->pagelist || msg->bio || in_trail)) |
| 848 | kunmap(page); | 856 | kunmap(page); |
| 849 | 857 | ||
| 858 | if (ret == -EAGAIN) | ||
| 859 | ret = 0; | ||
| 850 | if (ret <= 0) | 860 | if (ret <= 0) |
| 851 | goto out; | 861 | goto out; |
| 852 | 862 | ||
| @@ -1737,16 +1747,12 @@ more_kvec: | |||
| 1737 | if (con->out_skip) { | 1747 | if (con->out_skip) { |
| 1738 | ret = write_partial_skip(con); | 1748 | ret = write_partial_skip(con); |
| 1739 | if (ret <= 0) | 1749 | if (ret <= 0) |
| 1740 | goto done; | 1750 | goto out; |
| 1741 | if (ret < 0) { | ||
| 1742 | dout("try_write write_partial_skip err %d\n", ret); | ||
| 1743 | goto done; | ||
| 1744 | } | ||
| 1745 | } | 1751 | } |
| 1746 | if (con->out_kvec_left) { | 1752 | if (con->out_kvec_left) { |
| 1747 | ret = write_partial_kvec(con); | 1753 | ret = write_partial_kvec(con); |
| 1748 | if (ret <= 0) | 1754 | if (ret <= 0) |
| 1749 | goto done; | 1755 | goto out; |
| 1750 | } | 1756 | } |
| 1751 | 1757 | ||
| 1752 | /* msg pages? */ | 1758 | /* msg pages? */ |
| @@ -1761,11 +1767,11 @@ more_kvec: | |||
| 1761 | if (ret == 1) | 1767 | if (ret == 1) |
| 1762 | goto more_kvec; /* we need to send the footer, too! */ | 1768 | goto more_kvec; /* we need to send the footer, too! */ |
| 1763 | if (ret == 0) | 1769 | if (ret == 0) |
| 1764 | goto done; | 1770 | goto out; |
| 1765 | if (ret < 0) { | 1771 | if (ret < 0) { |
| 1766 | dout("try_write write_partial_msg_pages err %d\n", | 1772 | dout("try_write write_partial_msg_pages err %d\n", |
| 1767 | ret); | 1773 | ret); |
| 1768 | goto done; | 1774 | goto out; |
| 1769 | } | 1775 | } |
| 1770 | } | 1776 | } |
| 1771 | 1777 | ||
| @@ -1789,10 +1795,9 @@ do_next: | |||
| 1789 | /* Nothing to do! */ | 1795 | /* Nothing to do! */ |
| 1790 | clear_bit(WRITE_PENDING, &con->state); | 1796 | clear_bit(WRITE_PENDING, &con->state); |
| 1791 | dout("try_write nothing else to write.\n"); | 1797 | dout("try_write nothing else to write.\n"); |
| 1792 | done: | ||
| 1793 | ret = 0; | 1798 | ret = 0; |
| 1794 | out: | 1799 | out: |
| 1795 | dout("try_write done on %p\n", con); | 1800 | dout("try_write done on %p ret %d\n", con, ret); |
| 1796 | return ret; | 1801 | return ret; |
| 1797 | } | 1802 | } |
| 1798 | 1803 | ||
| @@ -1821,19 +1826,17 @@ more: | |||
| 1821 | dout("try_read connecting\n"); | 1826 | dout("try_read connecting\n"); |
| 1822 | ret = read_partial_banner(con); | 1827 | ret = read_partial_banner(con); |
| 1823 | if (ret <= 0) | 1828 | if (ret <= 0) |
| 1824 | goto done; | ||
| 1825 | if (process_banner(con) < 0) { | ||
| 1826 | ret = -1; | ||
| 1827 | goto out; | 1829 | goto out; |
| 1828 | } | 1830 | ret = process_banner(con); |
| 1831 | if (ret < 0) | ||
| 1832 | goto out; | ||
| 1829 | } | 1833 | } |
| 1830 | ret = read_partial_connect(con); | 1834 | ret = read_partial_connect(con); |
| 1831 | if (ret <= 0) | 1835 | if (ret <= 0) |
| 1832 | goto done; | ||
| 1833 | if (process_connect(con) < 0) { | ||
| 1834 | ret = -1; | ||
| 1835 | goto out; | 1836 | goto out; |
| 1836 | } | 1837 | ret = process_connect(con); |
| 1838 | if (ret < 0) | ||
| 1839 | goto out; | ||
| 1837 | goto more; | 1840 | goto more; |
| 1838 | } | 1841 | } |
| 1839 | 1842 | ||
| @@ -1848,7 +1851,7 @@ more: | |||
| 1848 | dout("skipping %d / %d bytes\n", skip, -con->in_base_pos); | 1851 | dout("skipping %d / %d bytes\n", skip, -con->in_base_pos); |
| 1849 | ret = ceph_tcp_recvmsg(con->sock, buf, skip); | 1852 | ret = ceph_tcp_recvmsg(con->sock, buf, skip); |
| 1850 | if (ret <= 0) | 1853 | if (ret <= 0) |
| 1851 | goto done; | 1854 | goto out; |
| 1852 | con->in_base_pos += ret; | 1855 | con->in_base_pos += ret; |
| 1853 | if (con->in_base_pos) | 1856 | if (con->in_base_pos) |
| 1854 | goto more; | 1857 | goto more; |
| @@ -1859,7 +1862,7 @@ more: | |||
| 1859 | */ | 1862 | */ |
| 1860 | ret = ceph_tcp_recvmsg(con->sock, &con->in_tag, 1); | 1863 | ret = ceph_tcp_recvmsg(con->sock, &con->in_tag, 1); |
| 1861 | if (ret <= 0) | 1864 | if (ret <= 0) |
| 1862 | goto done; | 1865 | goto out; |
| 1863 | dout("try_read got tag %d\n", (int)con->in_tag); | 1866 | dout("try_read got tag %d\n", (int)con->in_tag); |
| 1864 | switch (con->in_tag) { | 1867 | switch (con->in_tag) { |
| 1865 | case CEPH_MSGR_TAG_MSG: | 1868 | case CEPH_MSGR_TAG_MSG: |
| @@ -1870,7 +1873,7 @@ more: | |||
| 1870 | break; | 1873 | break; |
| 1871 | case CEPH_MSGR_TAG_CLOSE: | 1874 | case CEPH_MSGR_TAG_CLOSE: |
| 1872 | set_bit(CLOSED, &con->state); /* fixme */ | 1875 | set_bit(CLOSED, &con->state); /* fixme */ |
| 1873 | goto done; | 1876 | goto out; |
| 1874 | default: | 1877 | default: |
| 1875 | goto bad_tag; | 1878 | goto bad_tag; |
| 1876 | } | 1879 | } |
| @@ -1882,13 +1885,12 @@ more: | |||
| 1882 | case -EBADMSG: | 1885 | case -EBADMSG: |
| 1883 | con->error_msg = "bad crc"; | 1886 | con->error_msg = "bad crc"; |
| 1884 | ret = -EIO; | 1887 | ret = -EIO; |
| 1885 | goto out; | 1888 | break; |
| 1886 | case -EIO: | 1889 | case -EIO: |
| 1887 | con->error_msg = "io error"; | 1890 | con->error_msg = "io error"; |
| 1888 | goto out; | 1891 | break; |
| 1889 | default: | ||
| 1890 | goto done; | ||
| 1891 | } | 1892 | } |
| 1893 | goto out; | ||
| 1892 | } | 1894 | } |
| 1893 | if (con->in_tag == CEPH_MSGR_TAG_READY) | 1895 | if (con->in_tag == CEPH_MSGR_TAG_READY) |
| 1894 | goto more; | 1896 | goto more; |
| @@ -1898,15 +1900,13 @@ more: | |||
| 1898 | if (con->in_tag == CEPH_MSGR_TAG_ACK) { | 1900 | if (con->in_tag == CEPH_MSGR_TAG_ACK) { |
| 1899 | ret = read_partial_ack(con); | 1901 | ret = read_partial_ack(con); |
| 1900 | if (ret <= 0) | 1902 | if (ret <= 0) |
| 1901 | goto done; | 1903 | goto out; |
| 1902 | process_ack(con); | 1904 | process_ack(con); |
| 1903 | goto more; | 1905 | goto more; |
| 1904 | } | 1906 | } |
| 1905 | 1907 | ||
| 1906 | done: | ||
| 1907 | ret = 0; | ||
| 1908 | out: | 1908 | out: |
| 1909 | dout("try_read done on %p\n", con); | 1909 | dout("try_read done on %p ret %d\n", con, ret); |
| 1910 | return ret; | 1910 | return ret; |
| 1911 | 1911 | ||
| 1912 | bad_tag: | 1912 | bad_tag: |
diff --git a/net/core/dev.c b/net/core/dev.c index 8e726cb47ed7..8ae6631abcc2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -1280,10 +1280,13 @@ static int __dev_close_many(struct list_head *head) | |||
| 1280 | 1280 | ||
| 1281 | static int __dev_close(struct net_device *dev) | 1281 | static int __dev_close(struct net_device *dev) |
| 1282 | { | 1282 | { |
| 1283 | int retval; | ||
| 1283 | LIST_HEAD(single); | 1284 | LIST_HEAD(single); |
| 1284 | 1285 | ||
| 1285 | list_add(&dev->unreg_list, &single); | 1286 | list_add(&dev->unreg_list, &single); |
| 1286 | return __dev_close_many(&single); | 1287 | retval = __dev_close_many(&single); |
| 1288 | list_del(&single); | ||
| 1289 | return retval; | ||
| 1287 | } | 1290 | } |
| 1288 | 1291 | ||
| 1289 | int dev_close_many(struct list_head *head) | 1292 | int dev_close_many(struct list_head *head) |
| @@ -1325,7 +1328,7 @@ int dev_close(struct net_device *dev) | |||
| 1325 | 1328 | ||
| 1326 | list_add(&dev->unreg_list, &single); | 1329 | list_add(&dev->unreg_list, &single); |
| 1327 | dev_close_many(&single); | 1330 | dev_close_many(&single); |
| 1328 | 1331 | list_del(&single); | |
| 1329 | return 0; | 1332 | return 0; |
| 1330 | } | 1333 | } |
| 1331 | EXPORT_SYMBOL(dev_close); | 1334 | EXPORT_SYMBOL(dev_close); |
| @@ -5063,6 +5066,7 @@ static void rollback_registered(struct net_device *dev) | |||
| 5063 | 5066 | ||
| 5064 | list_add(&dev->unreg_list, &single); | 5067 | list_add(&dev->unreg_list, &single); |
| 5065 | rollback_registered_many(&single); | 5068 | rollback_registered_many(&single); |
| 5069 | list_del(&single); | ||
| 5066 | } | 5070 | } |
| 5067 | 5071 | ||
| 5068 | unsigned long netdev_fix_features(unsigned long features, const char *name) | 5072 | unsigned long netdev_fix_features(unsigned long features, const char *name) |
| @@ -6216,6 +6220,7 @@ static void __net_exit default_device_exit_batch(struct list_head *net_list) | |||
| 6216 | } | 6220 | } |
| 6217 | } | 6221 | } |
| 6218 | unregister_netdevice_many(&dev_kill_list); | 6222 | unregister_netdevice_many(&dev_kill_list); |
| 6223 | list_del(&dev_kill_list); | ||
| 6219 | rtnl_unlock(); | 6224 | rtnl_unlock(); |
| 6220 | } | 6225 | } |
| 6221 | 6226 | ||
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 6b03f561caec..d5074a567289 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c | |||
| @@ -626,6 +626,9 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb, | |||
| 626 | dcb->cmd = DCB_CMD_GAPP; | 626 | dcb->cmd = DCB_CMD_GAPP; |
| 627 | 627 | ||
| 628 | app_nest = nla_nest_start(dcbnl_skb, DCB_ATTR_APP); | 628 | app_nest = nla_nest_start(dcbnl_skb, DCB_ATTR_APP); |
| 629 | if (!app_nest) | ||
| 630 | goto out_cancel; | ||
| 631 | |||
| 629 | ret = nla_put_u8(dcbnl_skb, DCB_APP_ATTR_IDTYPE, idtype); | 632 | ret = nla_put_u8(dcbnl_skb, DCB_APP_ATTR_IDTYPE, idtype); |
| 630 | if (ret) | 633 | if (ret) |
| 631 | goto out_cancel; | 634 | goto out_cancel; |
| @@ -1613,6 +1616,10 @@ EXPORT_SYMBOL(dcb_getapp); | |||
| 1613 | u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) | 1616 | u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) |
| 1614 | { | 1617 | { |
| 1615 | struct dcb_app_type *itr; | 1618 | struct dcb_app_type *itr; |
| 1619 | struct dcb_app_type event; | ||
| 1620 | |||
| 1621 | memcpy(&event.name, dev->name, sizeof(event.name)); | ||
| 1622 | memcpy(&event.app, new, sizeof(event.app)); | ||
| 1616 | 1623 | ||
| 1617 | spin_lock(&dcb_lock); | 1624 | spin_lock(&dcb_lock); |
| 1618 | /* Search for existing match and replace */ | 1625 | /* Search for existing match and replace */ |
| @@ -1644,7 +1651,7 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) | |||
| 1644 | } | 1651 | } |
| 1645 | out: | 1652 | out: |
| 1646 | spin_unlock(&dcb_lock); | 1653 | spin_unlock(&dcb_lock); |
| 1647 | call_dcbevent_notifiers(DCB_APP_EVENT, new); | 1654 | call_dcbevent_notifiers(DCB_APP_EVENT, &event); |
| 1648 | return 0; | 1655 | return 0; |
| 1649 | } | 1656 | } |
| 1650 | EXPORT_SYMBOL(dcb_setapp); | 1657 | EXPORT_SYMBOL(dcb_setapp); |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 748cb5b337bd..df4616fce929 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
| @@ -1030,6 +1030,21 @@ static inline bool inetdev_valid_mtu(unsigned mtu) | |||
| 1030 | return mtu >= 68; | 1030 | return mtu >= 68; |
| 1031 | } | 1031 | } |
| 1032 | 1032 | ||
| 1033 | static void inetdev_send_gratuitous_arp(struct net_device *dev, | ||
| 1034 | struct in_device *in_dev) | ||
| 1035 | |||
| 1036 | { | ||
| 1037 | struct in_ifaddr *ifa = in_dev->ifa_list; | ||
| 1038 | |||
| 1039 | if (!ifa) | ||
| 1040 | return; | ||
| 1041 | |||
| 1042 | arp_send(ARPOP_REQUEST, ETH_P_ARP, | ||
| 1043 | ifa->ifa_address, dev, | ||
| 1044 | ifa->ifa_address, NULL, | ||
| 1045 | dev->dev_addr, NULL); | ||
| 1046 | } | ||
| 1047 | |||
| 1033 | /* Called only under RTNL semaphore */ | 1048 | /* Called only under RTNL semaphore */ |
| 1034 | 1049 | ||
| 1035 | static int inetdev_event(struct notifier_block *this, unsigned long event, | 1050 | static int inetdev_event(struct notifier_block *this, unsigned long event, |
| @@ -1082,18 +1097,13 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
| 1082 | } | 1097 | } |
| 1083 | ip_mc_up(in_dev); | 1098 | ip_mc_up(in_dev); |
| 1084 | /* fall through */ | 1099 | /* fall through */ |
| 1085 | case NETDEV_NOTIFY_PEERS: | ||
| 1086 | case NETDEV_CHANGEADDR: | 1100 | case NETDEV_CHANGEADDR: |
| 1101 | if (!IN_DEV_ARP_NOTIFY(in_dev)) | ||
| 1102 | break; | ||
| 1103 | /* fall through */ | ||
| 1104 | case NETDEV_NOTIFY_PEERS: | ||
| 1087 | /* Send gratuitous ARP to notify of link change */ | 1105 | /* Send gratuitous ARP to notify of link change */ |
| 1088 | if (IN_DEV_ARP_NOTIFY(in_dev)) { | 1106 | inetdev_send_gratuitous_arp(dev, in_dev); |
| 1089 | struct in_ifaddr *ifa = in_dev->ifa_list; | ||
| 1090 | |||
| 1091 | if (ifa) | ||
| 1092 | arp_send(ARPOP_REQUEST, ETH_P_ARP, | ||
| 1093 | ifa->ifa_address, dev, | ||
| 1094 | ifa->ifa_address, NULL, | ||
| 1095 | dev->dev_addr, NULL); | ||
| 1096 | } | ||
| 1097 | break; | 1107 | break; |
| 1098 | case NETDEV_DOWN: | 1108 | case NETDEV_DOWN: |
| 1099 | ip_mc_down(in_dev); | 1109 | ip_mc_down(in_dev); |
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index c5af909cf701..3c8dfa16614d 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
| @@ -505,7 +505,9 @@ restart: | |||
| 505 | } | 505 | } |
| 506 | 506 | ||
| 507 | rcu_read_unlock(); | 507 | rcu_read_unlock(); |
| 508 | local_bh_disable(); | ||
| 508 | inet_twsk_deschedule(tw, twdr); | 509 | inet_twsk_deschedule(tw, twdr); |
| 510 | local_bh_enable(); | ||
| 509 | inet_twsk_put(tw); | 511 | inet_twsk_put(tw); |
| 510 | goto restart_rcu; | 512 | goto restart_rcu; |
| 511 | } | 513 | } |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index eb68a0e34e49..6613edfac28c 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
| @@ -775,6 +775,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
| 775 | .fl4_dst = dst, | 775 | .fl4_dst = dst, |
| 776 | .fl4_src = tiph->saddr, | 776 | .fl4_src = tiph->saddr, |
| 777 | .fl4_tos = RT_TOS(tos), | 777 | .fl4_tos = RT_TOS(tos), |
| 778 | .proto = IPPROTO_GRE, | ||
| 778 | .fl_gre_key = tunnel->parms.o_key | 779 | .fl_gre_key = tunnel->parms.o_key |
| 779 | }; | 780 | }; |
| 780 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { | 781 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 788a3e74834e..6ed6603c2f6d 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -2722,6 +2722,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = { | |||
| 2722 | .destroy = ipv4_dst_destroy, | 2722 | .destroy = ipv4_dst_destroy, |
| 2723 | .check = ipv4_blackhole_dst_check, | 2723 | .check = ipv4_blackhole_dst_check, |
| 2724 | .default_mtu = ipv4_blackhole_default_mtu, | 2724 | .default_mtu = ipv4_blackhole_default_mtu, |
| 2725 | .default_advmss = ipv4_default_advmss, | ||
| 2725 | .update_pmtu = ipv4_rt_blackhole_update_pmtu, | 2726 | .update_pmtu = ipv4_rt_blackhole_update_pmtu, |
| 2726 | }; | 2727 | }; |
| 2727 | 2728 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index eb7f82ebf4a3..65f6c0406245 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -1222,7 +1222,7 @@ static int tcp_check_dsack(struct sock *sk, struct sk_buff *ack_skb, | |||
| 1222 | } | 1222 | } |
| 1223 | 1223 | ||
| 1224 | /* D-SACK for already forgotten data... Do dumb counting. */ | 1224 | /* D-SACK for already forgotten data... Do dumb counting. */ |
| 1225 | if (dup_sack && | 1225 | if (dup_sack && tp->undo_marker && tp->undo_retrans && |
| 1226 | !after(end_seq_0, prior_snd_una) && | 1226 | !after(end_seq_0, prior_snd_una) && |
| 1227 | after(end_seq_0, tp->undo_marker)) | 1227 | after(end_seq_0, tp->undo_marker)) |
| 1228 | tp->undo_retrans--; | 1228 | tp->undo_retrans--; |
| @@ -1299,7 +1299,8 @@ static u8 tcp_sacktag_one(struct sk_buff *skb, struct sock *sk, | |||
| 1299 | 1299 | ||
| 1300 | /* Account D-SACK for retransmitted packet. */ | 1300 | /* Account D-SACK for retransmitted packet. */ |
| 1301 | if (dup_sack && (sacked & TCPCB_RETRANS)) { | 1301 | if (dup_sack && (sacked & TCPCB_RETRANS)) { |
| 1302 | if (after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) | 1302 | if (tp->undo_marker && tp->undo_retrans && |
| 1303 | after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) | ||
| 1303 | tp->undo_retrans--; | 1304 | tp->undo_retrans--; |
| 1304 | if (sacked & TCPCB_SACKED_ACKED) | 1305 | if (sacked & TCPCB_SACKED_ACKED) |
| 1305 | state->reord = min(fack_count, state->reord); | 1306 | state->reord = min(fack_count, state->reord); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 406f320336e6..dfa5beb0c1c8 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -2162,7 +2162,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
| 2162 | if (!tp->retrans_stamp) | 2162 | if (!tp->retrans_stamp) |
| 2163 | tp->retrans_stamp = TCP_SKB_CB(skb)->when; | 2163 | tp->retrans_stamp = TCP_SKB_CB(skb)->when; |
| 2164 | 2164 | ||
| 2165 | tp->undo_retrans++; | 2165 | tp->undo_retrans += tcp_skb_pcount(skb); |
| 2166 | 2166 | ||
| 2167 | /* snd_nxt is stored to detect loss of retransmitted segment, | 2167 | /* snd_nxt is stored to detect loss of retransmitted segment, |
| 2168 | * see tcp_input.c tcp_sacktag_write_queue(). | 2168 | * see tcp_input.c tcp_sacktag_write_queue(). |
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index 09c88891a753..de338037a736 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
| @@ -410,7 +410,7 @@ fallback: | |||
| 410 | if (p != NULL) { | 410 | if (p != NULL) { |
| 411 | sb_add(m, "%02x", *p++); | 411 | sb_add(m, "%02x", *p++); |
| 412 | for (i = 1; i < len; i++) | 412 | for (i = 1; i < len; i++) |
| 413 | sb_add(m, ":%02x", p[i]); | 413 | sb_add(m, ":%02x", *p++); |
| 414 | } | 414 | } |
| 415 | sb_add(m, " "); | 415 | sb_add(m, " "); |
| 416 | 416 | ||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1c29f95695de..a998db6e7895 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -128,6 +128,7 @@ static struct dst_ops ip6_dst_blackhole_ops = { | |||
| 128 | .destroy = ip6_dst_destroy, | 128 | .destroy = ip6_dst_destroy, |
| 129 | .check = ip6_dst_check, | 129 | .check = ip6_dst_check, |
| 130 | .default_mtu = ip6_blackhole_default_mtu, | 130 | .default_mtu = ip6_blackhole_default_mtu, |
| 131 | .default_advmss = ip6_default_advmss, | ||
| 131 | .update_pmtu = ip6_rt_blackhole_update_pmtu, | 132 | .update_pmtu = ip6_rt_blackhole_update_pmtu, |
| 132 | }; | 133 | }; |
| 133 | 134 | ||
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 8acba456744e..7a10a8d1b2d0 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
| @@ -1229,6 +1229,7 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) | |||
| 1229 | } | 1229 | } |
| 1230 | mutex_unlock(&local->iflist_mtx); | 1230 | mutex_unlock(&local->iflist_mtx); |
| 1231 | unregister_netdevice_many(&unreg_list); | 1231 | unregister_netdevice_many(&unreg_list); |
| 1232 | list_del(&unreg_list); | ||
| 1232 | } | 1233 | } |
| 1233 | 1234 | ||
| 1234 | static u32 ieee80211_idle_off(struct ieee80211_local *local, | 1235 | static u32 ieee80211_idle_off(struct ieee80211_local *local, |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 45fbb9e33746..c9ceb4d57ab0 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -1033,6 +1033,12 @@ void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, | |||
| 1033 | if (is_multicast_ether_addr(hdr->addr1)) | 1033 | if (is_multicast_ether_addr(hdr->addr1)) |
| 1034 | return; | 1034 | return; |
| 1035 | 1035 | ||
| 1036 | /* | ||
| 1037 | * In case we receive frames after disassociation. | ||
| 1038 | */ | ||
| 1039 | if (!sdata->u.mgd.associated) | ||
| 1040 | return; | ||
| 1041 | |||
| 1036 | ieee80211_sta_reset_conn_monitor(sdata); | 1042 | ieee80211_sta_reset_conn_monitor(sdata); |
| 1037 | } | 1043 | } |
| 1038 | 1044 | ||
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index cf68700abffa..d036597aabbe 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
| @@ -1210,7 +1210,9 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
| 1210 | switch (sdata->vif.type) { | 1210 | switch (sdata->vif.type) { |
| 1211 | case NL80211_IFTYPE_STATION: | 1211 | case NL80211_IFTYPE_STATION: |
| 1212 | changed |= BSS_CHANGED_ASSOC; | 1212 | changed |= BSS_CHANGED_ASSOC; |
| 1213 | mutex_lock(&sdata->u.mgd.mtx); | ||
| 1213 | ieee80211_bss_info_change_notify(sdata, changed); | 1214 | ieee80211_bss_info_change_notify(sdata, changed); |
| 1215 | mutex_unlock(&sdata->u.mgd.mtx); | ||
| 1214 | break; | 1216 | break; |
| 1215 | case NL80211_IFTYPE_ADHOC: | 1217 | case NL80211_IFTYPE_ADHOC: |
| 1216 | changed |= BSS_CHANGED_IBSS; | 1218 | changed |= BSS_CHANGED_IBSS; |
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 32fcbe290c04..4aa614b8a96a 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c | |||
| @@ -133,6 +133,7 @@ unsigned int nf_iterate(struct list_head *head, | |||
| 133 | 133 | ||
| 134 | /* Optimization: we don't need to hold module | 134 | /* Optimization: we don't need to hold module |
| 135 | reference here, since function can't sleep. --RR */ | 135 | reference here, since function can't sleep. --RR */ |
| 136 | repeat: | ||
| 136 | verdict = elem->hook(hook, skb, indev, outdev, okfn); | 137 | verdict = elem->hook(hook, skb, indev, outdev, okfn); |
| 137 | if (verdict != NF_ACCEPT) { | 138 | if (verdict != NF_ACCEPT) { |
| 138 | #ifdef CONFIG_NETFILTER_DEBUG | 139 | #ifdef CONFIG_NETFILTER_DEBUG |
| @@ -145,7 +146,7 @@ unsigned int nf_iterate(struct list_head *head, | |||
| 145 | #endif | 146 | #endif |
| 146 | if (verdict != NF_REPEAT) | 147 | if (verdict != NF_REPEAT) |
| 147 | return verdict; | 148 | return verdict; |
| 148 | *i = (*i)->prev; | 149 | goto repeat; |
| 149 | } | 150 | } |
| 150 | } | 151 | } |
| 151 | return NF_ACCEPT; | 152 | return NF_ACCEPT; |
diff --git a/net/netfilter/nf_tproxy_core.c b/net/netfilter/nf_tproxy_core.c index 4d87befb04c0..474d621cbc2e 100644 --- a/net/netfilter/nf_tproxy_core.c +++ b/net/netfilter/nf_tproxy_core.c | |||
| @@ -28,26 +28,23 @@ nf_tproxy_destructor(struct sk_buff *skb) | |||
| 28 | skb->destructor = NULL; | 28 | skb->destructor = NULL; |
| 29 | 29 | ||
| 30 | if (sk) | 30 | if (sk) |
| 31 | nf_tproxy_put_sock(sk); | 31 | sock_put(sk); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | /* consumes sk */ | 34 | /* consumes sk */ |
| 35 | int | 35 | void |
| 36 | nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) | 36 | nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) |
| 37 | { | 37 | { |
| 38 | bool transparent = (sk->sk_state == TCP_TIME_WAIT) ? | 38 | /* assigning tw sockets complicates things; most |
| 39 | inet_twsk(sk)->tw_transparent : | 39 | * skb->sk->X checks would have to test sk->sk_state first */ |
| 40 | inet_sk(sk)->transparent; | 40 | if (sk->sk_state == TCP_TIME_WAIT) { |
| 41 | 41 | inet_twsk_put(inet_twsk(sk)); | |
| 42 | if (transparent) { | 42 | return; |
| 43 | skb_orphan(skb); | 43 | } |
| 44 | skb->sk = sk; | 44 | |
| 45 | skb->destructor = nf_tproxy_destructor; | 45 | skb_orphan(skb); |
| 46 | return 1; | 46 | skb->sk = sk; |
| 47 | } else | 47 | skb->destructor = nf_tproxy_destructor; |
| 48 | nf_tproxy_put_sock(sk); | ||
| 49 | |||
| 50 | return 0; | ||
| 51 | } | 48 | } |
| 52 | EXPORT_SYMBOL_GPL(nf_tproxy_assign_sock); | 49 | EXPORT_SYMBOL_GPL(nf_tproxy_assign_sock); |
| 53 | 50 | ||
diff --git a/net/netfilter/xt_TPROXY.c b/net/netfilter/xt_TPROXY.c index 640678f47a2a..dcfd57eb9d02 100644 --- a/net/netfilter/xt_TPROXY.c +++ b/net/netfilter/xt_TPROXY.c | |||
| @@ -33,6 +33,20 @@ | |||
| 33 | #include <net/netfilter/nf_tproxy_core.h> | 33 | #include <net/netfilter/nf_tproxy_core.h> |
| 34 | #include <linux/netfilter/xt_TPROXY.h> | 34 | #include <linux/netfilter/xt_TPROXY.h> |
| 35 | 35 | ||
| 36 | static bool tproxy_sk_is_transparent(struct sock *sk) | ||
| 37 | { | ||
| 38 | if (sk->sk_state != TCP_TIME_WAIT) { | ||
| 39 | if (inet_sk(sk)->transparent) | ||
| 40 | return true; | ||
| 41 | sock_put(sk); | ||
| 42 | } else { | ||
| 43 | if (inet_twsk(sk)->tw_transparent) | ||
| 44 | return true; | ||
| 45 | inet_twsk_put(inet_twsk(sk)); | ||
| 46 | } | ||
| 47 | return false; | ||
| 48 | } | ||
| 49 | |||
| 36 | static inline __be32 | 50 | static inline __be32 |
| 37 | tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr) | 51 | tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr) |
| 38 | { | 52 | { |
| @@ -141,7 +155,7 @@ tproxy_tg4(struct sk_buff *skb, __be32 laddr, __be16 lport, | |||
| 141 | skb->dev, NFT_LOOKUP_LISTENER); | 155 | skb->dev, NFT_LOOKUP_LISTENER); |
| 142 | 156 | ||
| 143 | /* NOTE: assign_sock consumes our sk reference */ | 157 | /* NOTE: assign_sock consumes our sk reference */ |
| 144 | if (sk && nf_tproxy_assign_sock(skb, sk)) { | 158 | if (sk && tproxy_sk_is_transparent(sk)) { |
| 145 | /* This should be in a separate target, but we don't do multiple | 159 | /* This should be in a separate target, but we don't do multiple |
| 146 | targets on the same rule yet */ | 160 | targets on the same rule yet */ |
| 147 | skb->mark = (skb->mark & ~mark_mask) ^ mark_value; | 161 | skb->mark = (skb->mark & ~mark_mask) ^ mark_value; |
| @@ -149,6 +163,8 @@ tproxy_tg4(struct sk_buff *skb, __be32 laddr, __be16 lport, | |||
| 149 | pr_debug("redirecting: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n", | 163 | pr_debug("redirecting: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n", |
| 150 | iph->protocol, &iph->daddr, ntohs(hp->dest), | 164 | iph->protocol, &iph->daddr, ntohs(hp->dest), |
| 151 | &laddr, ntohs(lport), skb->mark); | 165 | &laddr, ntohs(lport), skb->mark); |
| 166 | |||
| 167 | nf_tproxy_assign_sock(skb, sk); | ||
| 152 | return NF_ACCEPT; | 168 | return NF_ACCEPT; |
| 153 | } | 169 | } |
| 154 | 170 | ||
| @@ -306,7 +322,7 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par) | |||
| 306 | par->in, NFT_LOOKUP_LISTENER); | 322 | par->in, NFT_LOOKUP_LISTENER); |
| 307 | 323 | ||
| 308 | /* NOTE: assign_sock consumes our sk reference */ | 324 | /* NOTE: assign_sock consumes our sk reference */ |
| 309 | if (sk && nf_tproxy_assign_sock(skb, sk)) { | 325 | if (sk && tproxy_sk_is_transparent(sk)) { |
| 310 | /* This should be in a separate target, but we don't do multiple | 326 | /* This should be in a separate target, but we don't do multiple |
| 311 | targets on the same rule yet */ | 327 | targets on the same rule yet */ |
| 312 | skb->mark = (skb->mark & ~tgi->mark_mask) ^ tgi->mark_value; | 328 | skb->mark = (skb->mark & ~tgi->mark_mask) ^ tgi->mark_value; |
| @@ -314,6 +330,8 @@ tproxy_tg6_v1(struct sk_buff *skb, const struct xt_action_param *par) | |||
| 314 | pr_debug("redirecting: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n", | 330 | pr_debug("redirecting: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n", |
| 315 | tproto, &iph->saddr, ntohs(hp->source), | 331 | tproto, &iph->saddr, ntohs(hp->source), |
| 316 | laddr, ntohs(lport), skb->mark); | 332 | laddr, ntohs(lport), skb->mark); |
| 333 | |||
| 334 | nf_tproxy_assign_sock(skb, sk); | ||
| 317 | return NF_ACCEPT; | 335 | return NF_ACCEPT; |
| 318 | } | 336 | } |
| 319 | 337 | ||
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c index 00d6ae838303..9cc46356b577 100644 --- a/net/netfilter/xt_socket.c +++ b/net/netfilter/xt_socket.c | |||
| @@ -35,6 +35,15 @@ | |||
| 35 | #include <net/netfilter/nf_conntrack.h> | 35 | #include <net/netfilter/nf_conntrack.h> |
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
| 38 | static void | ||
| 39 | xt_socket_put_sk(struct sock *sk) | ||
| 40 | { | ||
| 41 | if (sk->sk_state == TCP_TIME_WAIT) | ||
| 42 | inet_twsk_put(inet_twsk(sk)); | ||
| 43 | else | ||
| 44 | sock_put(sk); | ||
| 45 | } | ||
| 46 | |||
| 38 | static int | 47 | static int |
| 39 | extract_icmp4_fields(const struct sk_buff *skb, | 48 | extract_icmp4_fields(const struct sk_buff *skb, |
| 40 | u8 *protocol, | 49 | u8 *protocol, |
| @@ -164,7 +173,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par, | |||
| 164 | (sk->sk_state == TCP_TIME_WAIT && | 173 | (sk->sk_state == TCP_TIME_WAIT && |
| 165 | inet_twsk(sk)->tw_transparent)); | 174 | inet_twsk(sk)->tw_transparent)); |
| 166 | 175 | ||
| 167 | nf_tproxy_put_sock(sk); | 176 | xt_socket_put_sk(sk); |
| 168 | 177 | ||
| 169 | if (wildcard || !transparent) | 178 | if (wildcard || !transparent) |
| 170 | sk = NULL; | 179 | sk = NULL; |
| @@ -298,7 +307,7 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par) | |||
| 298 | (sk->sk_state == TCP_TIME_WAIT && | 307 | (sk->sk_state == TCP_TIME_WAIT && |
| 299 | inet_twsk(sk)->tw_transparent)); | 308 | inet_twsk(sk)->tw_transparent)); |
| 300 | 309 | ||
| 301 | nf_tproxy_put_sock(sk); | 310 | xt_socket_put_sk(sk); |
| 302 | 311 | ||
| 303 | if (wildcard || !transparent) | 312 | if (wildcard || !transparent) |
| 304 | sk = NULL; | 313 | sk = NULL; |
diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c index 5ee16f0353fe..d763793d39de 100644 --- a/net/rxrpc/ar-key.c +++ b/net/rxrpc/ar-key.c | |||
| @@ -89,11 +89,11 @@ static int rxrpc_instantiate_xdr_rxkad(struct key *key, const __be32 *xdr, | |||
| 89 | return ret; | 89 | return ret; |
| 90 | 90 | ||
| 91 | plen -= sizeof(*token); | 91 | plen -= sizeof(*token); |
| 92 | token = kmalloc(sizeof(*token), GFP_KERNEL); | 92 | token = kzalloc(sizeof(*token), GFP_KERNEL); |
| 93 | if (!token) | 93 | if (!token) |
| 94 | return -ENOMEM; | 94 | return -ENOMEM; |
| 95 | 95 | ||
| 96 | token->kad = kmalloc(plen, GFP_KERNEL); | 96 | token->kad = kzalloc(plen, GFP_KERNEL); |
| 97 | if (!token->kad) { | 97 | if (!token->kad) { |
| 98 | kfree(token); | 98 | kfree(token); |
| 99 | return -ENOMEM; | 99 | return -ENOMEM; |
| @@ -731,10 +731,10 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen) | |||
| 731 | goto error; | 731 | goto error; |
| 732 | 732 | ||
| 733 | ret = -ENOMEM; | 733 | ret = -ENOMEM; |
| 734 | token = kmalloc(sizeof(*token), GFP_KERNEL); | 734 | token = kzalloc(sizeof(*token), GFP_KERNEL); |
| 735 | if (!token) | 735 | if (!token) |
| 736 | goto error; | 736 | goto error; |
| 737 | token->kad = kmalloc(plen, GFP_KERNEL); | 737 | token->kad = kzalloc(plen, GFP_KERNEL); |
| 738 | if (!token->kad) | 738 | if (!token->kad) |
| 739 | goto error_free; | 739 | goto error_free; |
| 740 | 740 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 34dc598440a2..1bc698039ae2 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
| @@ -839,6 +839,7 @@ void dev_deactivate(struct net_device *dev) | |||
| 839 | 839 | ||
| 840 | list_add(&dev->unreg_list, &single); | 840 | list_add(&dev->unreg_list, &single); |
| 841 | dev_deactivate_many(&single); | 841 | dev_deactivate_many(&single); |
| 842 | list_del(&single); | ||
| 842 | } | 843 | } |
| 843 | 844 | ||
| 844 | static void dev_init_scheduler_queue(struct net_device *dev, | 845 | static void dev_init_scheduler_queue(struct net_device *dev, |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 2cc46f0962ca..b23428f3c0dd 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
| @@ -2029,11 +2029,11 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc, | |||
| 2029 | *errp = sctp_make_op_error_fixed(asoc, chunk); | 2029 | *errp = sctp_make_op_error_fixed(asoc, chunk); |
| 2030 | 2030 | ||
| 2031 | if (*errp) { | 2031 | if (*errp) { |
| 2032 | sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, | 2032 | if (!sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, |
| 2033 | WORD_ROUND(ntohs(param.p->length))); | 2033 | WORD_ROUND(ntohs(param.p->length)))) |
| 2034 | sctp_addto_chunk_fixed(*errp, | 2034 | sctp_addto_chunk_fixed(*errp, |
| 2035 | WORD_ROUND(ntohs(param.p->length)), | 2035 | WORD_ROUND(ntohs(param.p->length)), |
| 2036 | param.v); | 2036 | param.v); |
| 2037 | } else { | 2037 | } else { |
| 2038 | /* If there is no memory for generating the ERROR | 2038 | /* If there is no memory for generating the ERROR |
| 2039 | * report as specified, an ABORT will be triggered | 2039 | * report as specified, an ABORT will be triggered |
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 3e5dbd4e4cd5..d112f038edf0 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
| @@ -802,11 +802,11 @@ int cfg80211_wext_siwfreq(struct net_device *dev, | |||
| 802 | return freq; | 802 | return freq; |
| 803 | if (freq == 0) | 803 | if (freq == 0) |
| 804 | return -EINVAL; | 804 | return -EINVAL; |
| 805 | wdev_lock(wdev); | ||
| 806 | mutex_lock(&rdev->devlist_mtx); | 805 | mutex_lock(&rdev->devlist_mtx); |
| 806 | wdev_lock(wdev); | ||
| 807 | err = cfg80211_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT); | 807 | err = cfg80211_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT); |
| 808 | mutex_unlock(&rdev->devlist_mtx); | ||
| 809 | wdev_unlock(wdev); | 808 | wdev_unlock(wdev); |
| 809 | mutex_unlock(&rdev->devlist_mtx); | ||
| 810 | return err; | 810 | return err; |
| 811 | default: | 811 | default: |
| 812 | return -EOPNOTSUPP; | 812 | return -EOPNOTSUPP; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 8b3ef404c794..6459588befc3 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -1340,10 +1340,13 @@ static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family) | |||
| 1340 | default: | 1340 | default: |
| 1341 | BUG(); | 1341 | BUG(); |
| 1342 | } | 1342 | } |
| 1343 | xdst = dst_alloc(dst_ops) ?: ERR_PTR(-ENOBUFS); | 1343 | xdst = dst_alloc(dst_ops); |
| 1344 | xfrm_policy_put_afinfo(afinfo); | 1344 | xfrm_policy_put_afinfo(afinfo); |
| 1345 | 1345 | ||
| 1346 | xdst->flo.ops = &xfrm_bundle_fc_ops; | 1346 | if (likely(xdst)) |
| 1347 | xdst->flo.ops = &xfrm_bundle_fc_ops; | ||
| 1348 | else | ||
| 1349 | xdst = ERR_PTR(-ENOBUFS); | ||
| 1347 | 1350 | ||
| 1348 | return xdst; | 1351 | return xdst; |
| 1349 | } | 1352 | } |
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index c9a16abacab4..6c94c6ce2925 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
| @@ -315,6 +315,7 @@ static void parse_dep_file(void *map, size_t len) | |||
| 315 | char *end = m + len; | 315 | char *end = m + len; |
| 316 | char *p; | 316 | char *p; |
| 317 | char s[PATH_MAX]; | 317 | char s[PATH_MAX]; |
| 318 | int first; | ||
| 318 | 319 | ||
| 319 | p = strchr(m, ':'); | 320 | p = strchr(m, ':'); |
| 320 | if (!p) { | 321 | if (!p) { |
| @@ -327,6 +328,7 @@ static void parse_dep_file(void *map, size_t len) | |||
| 327 | 328 | ||
| 328 | clear_config(); | 329 | clear_config(); |
| 329 | 330 | ||
| 331 | first = 1; | ||
| 330 | while (m < end) { | 332 | while (m < end) { |
| 331 | while (m < end && (*m == ' ' || *m == '\\' || *m == '\n')) | 333 | while (m < end && (*m == ' ' || *m == '\\' || *m == '\n')) |
| 332 | m++; | 334 | m++; |
| @@ -340,9 +342,17 @@ static void parse_dep_file(void *map, size_t len) | |||
| 340 | if (strrcmp(s, "include/generated/autoconf.h") && | 342 | if (strrcmp(s, "include/generated/autoconf.h") && |
| 341 | strrcmp(s, "arch/um/include/uml-config.h") && | 343 | strrcmp(s, "arch/um/include/uml-config.h") && |
| 342 | strrcmp(s, ".ver")) { | 344 | strrcmp(s, ".ver")) { |
| 343 | printf(" %s \\\n", s); | 345 | /* |
| 346 | * Do not output the first dependency (the | ||
| 347 | * source file), so that kbuild is not confused | ||
| 348 | * if a .c file is rewritten into .S or vice | ||
| 349 | * versa. | ||
| 350 | */ | ||
| 351 | if (!first) | ||
| 352 | printf(" %s \\\n", s); | ||
| 344 | do_config_file(s); | 353 | do_config_file(s); |
| 345 | } | 354 | } |
| 355 | first = 0; | ||
| 346 | m = p + 1; | 356 | m = p + 1; |
| 347 | } | 357 | } |
| 348 | printf("\n%s: $(deps_%s)\n\n", target, target); | 358 | printf("\n%s: $(deps_%s)\n\n", target, target); |
diff --git a/sound/core/jack.c b/sound/core/jack.c index 4902ae568730..53b53e97c896 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c | |||
| @@ -141,6 +141,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, | |||
| 141 | 141 | ||
| 142 | fail_input: | 142 | fail_input: |
| 143 | input_free_device(jack->input_dev); | 143 | input_free_device(jack->input_dev); |
| 144 | kfree(jack->id); | ||
| 144 | kfree(jack); | 145 | kfree(jack); |
| 145 | return err; | 146 | return err; |
| 146 | } | 147 | } |
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 23f49f356e0f..16c0bdfbb164 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c | |||
| @@ -1252,11 +1252,19 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) { | |||
| 1252 | static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma) | 1252 | static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma) |
| 1253 | { | 1253 | { |
| 1254 | stream_t *dma = &vortex->dma_adb[adbdma]; | 1254 | stream_t *dma = &vortex->dma_adb[adbdma]; |
| 1255 | int temp; | 1255 | int temp, page, delta; |
| 1256 | 1256 | ||
| 1257 | temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); | 1257 | temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); |
| 1258 | temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1)); | 1258 | page = (temp & ADB_SUBBUF_MASK) >> ADB_SUBBUF_SHIFT; |
| 1259 | return temp; | 1259 | if (dma->nr_periods >= 4) |
| 1260 | delta = (page - dma->period_real) & 3; | ||
| 1261 | else { | ||
| 1262 | delta = (page - dma->period_real); | ||
| 1263 | if (delta < 0) | ||
| 1264 | delta += dma->nr_periods; | ||
| 1265 | } | ||
| 1266 | return (dma->period_virt + delta) * dma->period_bytes | ||
| 1267 | + (temp & (dma->period_bytes - 1)); | ||
| 1260 | } | 1268 | } |
| 1261 | 1269 | ||
| 1262 | static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma) | 1270 | static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma) |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 0baffcdee8f9..fcedad9a5fef 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
| @@ -2308,6 +2308,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { | |||
| 2308 | SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), | 2308 | SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), |
| 2309 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), | 2309 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB), |
| 2310 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), | 2310 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB), |
| 2311 | SND_PCI_QUIRK(0x1043, 0x8410, "ASUS", POS_FIX_LPIB), | ||
| 2311 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), | 2312 | SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB), |
| 2312 | SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), | 2313 | SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), |
| 2313 | SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB), | 2314 | SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB), |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index fbe97d32140d..4d5004e693f0 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
| @@ -3114,6 +3114,8 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
| 3114 | SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), | 3114 | SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), |
| 3115 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), | 3115 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), |
| 3116 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), | 3116 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), |
| 3117 | SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD), | ||
| 3118 | SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD), | ||
| 3117 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), | 3119 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), |
| 3118 | SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), | 3120 | SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), |
| 3119 | SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), | 3121 | SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), |
| @@ -3410,7 +3412,7 @@ static void cx_auto_parse_output(struct hda_codec *codec) | |||
| 3410 | } | 3412 | } |
| 3411 | } | 3413 | } |
| 3412 | spec->multiout.dac_nids = spec->private_dac_nids; | 3414 | spec->multiout.dac_nids = spec->private_dac_nids; |
| 3413 | spec->multiout.max_channels = nums * 2; | 3415 | spec->multiout.max_channels = spec->multiout.num_dacs * 2; |
| 3414 | 3416 | ||
| 3415 | if (cfg->hp_outs > 0) | 3417 | if (cfg->hp_outs > 0) |
| 3416 | spec->auto_mute = 1; | 3418 | spec->auto_mute = 1; |
| @@ -3729,9 +3731,9 @@ static int cx_auto_init(struct hda_codec *codec) | |||
| 3729 | return 0; | 3731 | return 0; |
| 3730 | } | 3732 | } |
| 3731 | 3733 | ||
| 3732 | static int cx_auto_add_volume(struct hda_codec *codec, const char *basename, | 3734 | static int cx_auto_add_volume_idx(struct hda_codec *codec, const char *basename, |
| 3733 | const char *dir, int cidx, | 3735 | const char *dir, int cidx, |
| 3734 | hda_nid_t nid, int hda_dir) | 3736 | hda_nid_t nid, int hda_dir, int amp_idx) |
| 3735 | { | 3737 | { |
| 3736 | static char name[32]; | 3738 | static char name[32]; |
| 3737 | static struct snd_kcontrol_new knew[] = { | 3739 | static struct snd_kcontrol_new knew[] = { |
| @@ -3743,7 +3745,8 @@ static int cx_auto_add_volume(struct hda_codec *codec, const char *basename, | |||
| 3743 | 3745 | ||
| 3744 | for (i = 0; i < 2; i++) { | 3746 | for (i = 0; i < 2; i++) { |
| 3745 | struct snd_kcontrol *kctl; | 3747 | struct snd_kcontrol *kctl; |
| 3746 | knew[i].private_value = HDA_COMPOSE_AMP_VAL(nid, 3, 0, hda_dir); | 3748 | knew[i].private_value = HDA_COMPOSE_AMP_VAL(nid, 3, amp_idx, |
| 3749 | hda_dir); | ||
| 3747 | knew[i].subdevice = HDA_SUBDEV_AMP_FLAG; | 3750 | knew[i].subdevice = HDA_SUBDEV_AMP_FLAG; |
| 3748 | knew[i].index = cidx; | 3751 | knew[i].index = cidx; |
| 3749 | snprintf(name, sizeof(name), "%s%s %s", basename, dir, sfx[i]); | 3752 | snprintf(name, sizeof(name), "%s%s %s", basename, dir, sfx[i]); |
| @@ -3759,6 +3762,9 @@ static int cx_auto_add_volume(struct hda_codec *codec, const char *basename, | |||
| 3759 | return 0; | 3762 | return 0; |
| 3760 | } | 3763 | } |
| 3761 | 3764 | ||
| 3765 | #define cx_auto_add_volume(codec, str, dir, cidx, nid, hda_dir) \ | ||
| 3766 | cx_auto_add_volume_idx(codec, str, dir, cidx, nid, hda_dir, 0) | ||
| 3767 | |||
| 3762 | #define cx_auto_add_pb_volume(codec, nid, str, idx) \ | 3768 | #define cx_auto_add_pb_volume(codec, nid, str, idx) \ |
| 3763 | cx_auto_add_volume(codec, str, " Playback", idx, nid, HDA_OUTPUT) | 3769 | cx_auto_add_volume(codec, str, " Playback", idx, nid, HDA_OUTPUT) |
| 3764 | 3770 | ||
| @@ -3808,29 +3814,60 @@ static int cx_auto_build_input_controls(struct hda_codec *codec) | |||
| 3808 | struct conexant_spec *spec = codec->spec; | 3814 | struct conexant_spec *spec = codec->spec; |
| 3809 | struct auto_pin_cfg *cfg = &spec->autocfg; | 3815 | struct auto_pin_cfg *cfg = &spec->autocfg; |
| 3810 | static const char *prev_label; | 3816 | static const char *prev_label; |
| 3811 | int i, err, cidx; | 3817 | int i, err, cidx, conn_len; |
| 3818 | hda_nid_t conn[HDA_MAX_CONNECTIONS]; | ||
| 3819 | |||
| 3820 | int multi_adc_volume = 0; /* If the ADC nid has several input volumes */ | ||
| 3821 | int adc_nid = spec->adc_nids[0]; | ||
| 3822 | |||
| 3823 | conn_len = snd_hda_get_connections(codec, adc_nid, conn, | ||
| 3824 | HDA_MAX_CONNECTIONS); | ||
| 3825 | if (conn_len < 0) | ||
| 3826 | return conn_len; | ||
| 3827 | |||
| 3828 | multi_adc_volume = cfg->num_inputs > 1 && conn_len > 1; | ||
| 3829 | if (!multi_adc_volume) { | ||
| 3830 | err = cx_auto_add_volume(codec, "Capture", "", 0, adc_nid, | ||
| 3831 | HDA_INPUT); | ||
| 3832 | if (err < 0) | ||
| 3833 | return err; | ||
| 3834 | } | ||
| 3812 | 3835 | ||
| 3813 | err = cx_auto_add_volume(codec, "Capture", "", 0, spec->adc_nids[0], | ||
| 3814 | HDA_INPUT); | ||
| 3815 | if (err < 0) | ||
| 3816 | return err; | ||
| 3817 | prev_label = NULL; | 3836 | prev_label = NULL; |
| 3818 | cidx = 0; | 3837 | cidx = 0; |
| 3819 | for (i = 0; i < cfg->num_inputs; i++) { | 3838 | for (i = 0; i < cfg->num_inputs; i++) { |
| 3820 | hda_nid_t nid = cfg->inputs[i].pin; | 3839 | hda_nid_t nid = cfg->inputs[i].pin; |
| 3821 | const char *label; | 3840 | const char *label; |
| 3822 | if (!(get_wcaps(codec, nid) & AC_WCAP_IN_AMP)) | 3841 | int j; |
| 3842 | int pin_amp = get_wcaps(codec, nid) & AC_WCAP_IN_AMP; | ||
| 3843 | if (!pin_amp && !multi_adc_volume) | ||
| 3823 | continue; | 3844 | continue; |
| 3845 | |||
| 3824 | label = hda_get_autocfg_input_label(codec, cfg, i); | 3846 | label = hda_get_autocfg_input_label(codec, cfg, i); |
| 3825 | if (label == prev_label) | 3847 | if (label == prev_label) |
| 3826 | cidx++; | 3848 | cidx++; |
| 3827 | else | 3849 | else |
| 3828 | cidx = 0; | 3850 | cidx = 0; |
| 3829 | prev_label = label; | 3851 | prev_label = label; |
| 3830 | err = cx_auto_add_volume(codec, label, " Capture", cidx, | 3852 | |
| 3831 | nid, HDA_INPUT); | 3853 | if (pin_amp) { |
| 3832 | if (err < 0) | 3854 | err = cx_auto_add_volume(codec, label, " Boost", cidx, |
| 3833 | return err; | 3855 | nid, HDA_INPUT); |
| 3856 | if (err < 0) | ||
| 3857 | return err; | ||
| 3858 | } | ||
| 3859 | |||
| 3860 | if (!multi_adc_volume) | ||
| 3861 | continue; | ||
| 3862 | for (j = 0; j < conn_len; j++) { | ||
| 3863 | if (conn[j] == nid) { | ||
| 3864 | err = cx_auto_add_volume_idx(codec, label, | ||
| 3865 | " Capture", cidx, adc_nid, HDA_INPUT, j); | ||
| 3866 | if (err < 0) | ||
| 3867 | return err; | ||
| 3868 | break; | ||
| 3869 | } | ||
| 3870 | } | ||
| 3834 | } | 3871 | } |
| 3835 | return 0; | 3872 | return 0; |
| 3836 | } | 3873 | } |
| @@ -3902,6 +3939,8 @@ static struct hda_codec_preset snd_hda_preset_conexant[] = { | |||
| 3902 | .patch = patch_cxt5066 }, | 3939 | .patch = patch_cxt5066 }, |
| 3903 | { .id = 0x14f15069, .name = "CX20585", | 3940 | { .id = 0x14f15069, .name = "CX20585", |
| 3904 | .patch = patch_cxt5066 }, | 3941 | .patch = patch_cxt5066 }, |
| 3942 | { .id = 0x14f1506e, .name = "CX20590", | ||
| 3943 | .patch = patch_cxt5066 }, | ||
| 3905 | { .id = 0x14f15097, .name = "CX20631", | 3944 | { .id = 0x14f15097, .name = "CX20631", |
| 3906 | .patch = patch_conexant_auto }, | 3945 | .patch = patch_conexant_auto }, |
| 3907 | { .id = 0x14f15098, .name = "CX20632", | 3946 | { .id = 0x14f15098, .name = "CX20632", |
| @@ -3928,6 +3967,7 @@ MODULE_ALIAS("snd-hda-codec-id:14f15066"); | |||
| 3928 | MODULE_ALIAS("snd-hda-codec-id:14f15067"); | 3967 | MODULE_ALIAS("snd-hda-codec-id:14f15067"); |
| 3929 | MODULE_ALIAS("snd-hda-codec-id:14f15068"); | 3968 | MODULE_ALIAS("snd-hda-codec-id:14f15068"); |
| 3930 | MODULE_ALIAS("snd-hda-codec-id:14f15069"); | 3969 | MODULE_ALIAS("snd-hda-codec-id:14f15069"); |
| 3970 | MODULE_ALIAS("snd-hda-codec-id:14f1506e"); | ||
| 3931 | MODULE_ALIAS("snd-hda-codec-id:14f15097"); | 3971 | MODULE_ALIAS("snd-hda-codec-id:14f15097"); |
| 3932 | MODULE_ALIAS("snd-hda-codec-id:14f15098"); | 3972 | MODULE_ALIAS("snd-hda-codec-id:14f15098"); |
| 3933 | MODULE_ALIAS("snd-hda-codec-id:14f150a1"); | 3973 | MODULE_ALIAS("snd-hda-codec-id:14f150a1"); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 9ea48b425d0b..bd7b123f6440 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -586,7 +586,12 @@ static hda_nid_t stac92hd83xxx_pin_nids[10] = { | |||
| 586 | 0x0f, 0x10, 0x11, 0x1f, 0x20, | 586 | 0x0f, 0x10, 0x11, 0x1f, 0x20, |
| 587 | }; | 587 | }; |
| 588 | 588 | ||
| 589 | static hda_nid_t stac92hd88xxx_pin_nids[10] = { | 589 | static hda_nid_t stac92hd87xxx_pin_nids[6] = { |
| 590 | 0x0a, 0x0b, 0x0c, 0x0d, | ||
| 591 | 0x0f, 0x11, | ||
| 592 | }; | ||
| 593 | |||
| 594 | static hda_nid_t stac92hd88xxx_pin_nids[8] = { | ||
| 590 | 0x0a, 0x0b, 0x0c, 0x0d, | 595 | 0x0a, 0x0b, 0x0c, 0x0d, |
| 591 | 0x0f, 0x11, 0x1f, 0x20, | 596 | 0x0f, 0x11, 0x1f, 0x20, |
| 592 | }; | 597 | }; |
| @@ -5430,12 +5435,13 @@ again: | |||
| 5430 | switch (codec->vendor_id) { | 5435 | switch (codec->vendor_id) { |
| 5431 | case 0x111d76d1: | 5436 | case 0x111d76d1: |
| 5432 | case 0x111d76d9: | 5437 | case 0x111d76d9: |
| 5438 | case 0x111d76e5: | ||
| 5433 | spec->dmic_nids = stac92hd87b_dmic_nids; | 5439 | spec->dmic_nids = stac92hd87b_dmic_nids; |
| 5434 | spec->num_dmics = stac92xx_connected_ports(codec, | 5440 | spec->num_dmics = stac92xx_connected_ports(codec, |
| 5435 | stac92hd87b_dmic_nids, | 5441 | stac92hd87b_dmic_nids, |
| 5436 | STAC92HD87B_NUM_DMICS); | 5442 | STAC92HD87B_NUM_DMICS); |
| 5437 | spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids); | 5443 | spec->num_pins = ARRAY_SIZE(stac92hd87xxx_pin_nids); |
| 5438 | spec->pin_nids = stac92hd88xxx_pin_nids; | 5444 | spec->pin_nids = stac92hd87xxx_pin_nids; |
| 5439 | spec->mono_nid = 0; | 5445 | spec->mono_nid = 0; |
| 5440 | spec->num_pwrs = 0; | 5446 | spec->num_pwrs = 0; |
| 5441 | break; | 5447 | break; |
| @@ -5443,6 +5449,7 @@ again: | |||
| 5443 | case 0x111d7667: | 5449 | case 0x111d7667: |
| 5444 | case 0x111d7668: | 5450 | case 0x111d7668: |
| 5445 | case 0x111d7669: | 5451 | case 0x111d7669: |
| 5452 | case 0x111d76e3: | ||
| 5446 | spec->num_dmics = stac92xx_connected_ports(codec, | 5453 | spec->num_dmics = stac92xx_connected_ports(codec, |
| 5447 | stac92hd88xxx_dmic_nids, | 5454 | stac92hd88xxx_dmic_nids, |
| 5448 | STAC92HD88XXX_NUM_DMICS); | 5455 | STAC92HD88XXX_NUM_DMICS); |
| @@ -6387,6 +6394,8 @@ static struct hda_codec_preset snd_hda_preset_sigmatel[] = { | |||
| 6387 | { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx }, | 6394 | { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx }, |
| 6388 | { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx }, | 6395 | { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx }, |
| 6389 | { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx}, | 6396 | { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx}, |
| 6397 | { .id = 0x111d76e3, .name = "92HD98BXX", .patch = patch_stac92hd83xxx}, | ||
| 6398 | { .id = 0x111d76e5, .name = "92HD99BXX", .patch = patch_stac92hd83xxx}, | ||
| 6390 | { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx}, | 6399 | { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx}, |
| 6391 | {} /* terminator */ | 6400 | {} /* terminator */ |
| 6392 | }; | 6401 | }; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index a76c3260d941..63b0054200a8 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
| @@ -567,7 +567,7 @@ static void via_auto_init_analog_input(struct hda_codec *codec) | |||
| 567 | hda_nid_t nid = cfg->inputs[i].pin; | 567 | hda_nid_t nid = cfg->inputs[i].pin; |
| 568 | if (spec->smart51_enabled && is_smart51_pins(spec, nid)) | 568 | if (spec->smart51_enabled && is_smart51_pins(spec, nid)) |
| 569 | ctl = PIN_OUT; | 569 | ctl = PIN_OUT; |
| 570 | else if (i == AUTO_PIN_MIC) | 570 | else if (cfg->inputs[i].type == AUTO_PIN_MIC) |
| 571 | ctl = PIN_VREF50; | 571 | ctl = PIN_VREF50; |
| 572 | else | 572 | else |
| 573 | ctl = PIN_IN; | 573 | ctl = PIN_IN; |
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index bb4bf65b9e7e..0bb424af956f 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c | |||
| @@ -367,7 +367,7 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) | |||
| 367 | return 0; | 367 | return 0; |
| 368 | } | 368 | } |
| 369 | 369 | ||
| 370 | static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC; | 370 | static const u8 cx20442_reg; |
| 371 | 371 | ||
| 372 | static struct snd_soc_codec_driver cx20442_codec_dev = { | 372 | static struct snd_soc_codec_driver cx20442_codec_dev = { |
| 373 | .probe = cx20442_codec_probe, | 373 | .probe = cx20442_codec_probe, |
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 987476a5895f..017d99ceb42e 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
| @@ -1482,7 +1482,7 @@ int wm8903_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack, | |||
| 1482 | WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, | 1482 | WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, |
| 1483 | irq_mask); | 1483 | irq_mask); |
| 1484 | 1484 | ||
| 1485 | if (det && shrt) { | 1485 | if (det || shrt) { |
| 1486 | /* Enable mic detection, this may not have been set through | 1486 | /* Enable mic detection, this may not have been set through |
| 1487 | * platform data (eg, if the defaults are OK). */ | 1487 | * platform data (eg, if the defaults are OK). */ |
| 1488 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, | 1488 | snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0, |
diff --git a/sound/soc/codecs/wm8903.h b/sound/soc/codecs/wm8903.h index e8490f3edd03..e3ec2433b215 100644 --- a/sound/soc/codecs/wm8903.h +++ b/sound/soc/codecs/wm8903.h | |||
| @@ -165,7 +165,7 @@ extern int wm8903_mic_detect(struct snd_soc_codec *codec, | |||
| 165 | 165 | ||
| 166 | #define WM8903_VMID_RES_50K 2 | 166 | #define WM8903_VMID_RES_50K 2 |
| 167 | #define WM8903_VMID_RES_250K 3 | 167 | #define WM8903_VMID_RES_250K 3 |
| 168 | #define WM8903_VMID_RES_5K 4 | 168 | #define WM8903_VMID_RES_5K 6 |
| 169 | 169 | ||
| 170 | /* | 170 | /* |
| 171 | * R8 (0x08) - Analogue DAC 0 | 171 | * R8 (0x08) - Analogue DAC 0 |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 37b8aa8a680f..ebaee5ca7434 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
| @@ -107,6 +107,9 @@ struct wm8994_priv { | |||
| 107 | 107 | ||
| 108 | int revision; | 108 | int revision; |
| 109 | struct wm8994_pdata *pdata; | 109 | struct wm8994_pdata *pdata; |
| 110 | |||
| 111 | unsigned int aif1clk_enable:1; | ||
| 112 | unsigned int aif2clk_enable:1; | ||
| 110 | }; | 113 | }; |
| 111 | 114 | ||
| 112 | static int wm8994_readable(unsigned int reg) | 115 | static int wm8994_readable(unsigned int reg) |
| @@ -1004,6 +1007,93 @@ static void wm8994_update_class_w(struct snd_soc_codec *codec) | |||
| 1004 | } | 1007 | } |
| 1005 | } | 1008 | } |
| 1006 | 1009 | ||
| 1010 | static int late_enable_ev(struct snd_soc_dapm_widget *w, | ||
| 1011 | struct snd_kcontrol *kcontrol, int event) | ||
| 1012 | { | ||
| 1013 | struct snd_soc_codec *codec = w->codec; | ||
| 1014 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1015 | |||
| 1016 | switch (event) { | ||
| 1017 | case SND_SOC_DAPM_PRE_PMU: | ||
| 1018 | if (wm8994->aif1clk_enable) | ||
| 1019 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, | ||
| 1020 | WM8994_AIF1CLK_ENA_MASK, | ||
| 1021 | WM8994_AIF1CLK_ENA); | ||
| 1022 | if (wm8994->aif2clk_enable) | ||
| 1023 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, | ||
| 1024 | WM8994_AIF2CLK_ENA_MASK, | ||
| 1025 | WM8994_AIF2CLK_ENA); | ||
| 1026 | break; | ||
| 1027 | } | ||
| 1028 | |||
| 1029 | return 0; | ||
| 1030 | } | ||
| 1031 | |||
| 1032 | static int late_disable_ev(struct snd_soc_dapm_widget *w, | ||
| 1033 | struct snd_kcontrol *kcontrol, int event) | ||
| 1034 | { | ||
| 1035 | struct snd_soc_codec *codec = w->codec; | ||
| 1036 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1037 | |||
| 1038 | switch (event) { | ||
| 1039 | case SND_SOC_DAPM_POST_PMD: | ||
| 1040 | if (wm8994->aif1clk_enable) { | ||
| 1041 | snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, | ||
| 1042 | WM8994_AIF1CLK_ENA_MASK, 0); | ||
| 1043 | wm8994->aif1clk_enable = 0; | ||
| 1044 | } | ||
| 1045 | if (wm8994->aif2clk_enable) { | ||
| 1046 | snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, | ||
| 1047 | WM8994_AIF2CLK_ENA_MASK, 0); | ||
| 1048 | wm8994->aif2clk_enable = 0; | ||
| 1049 | } | ||
| 1050 | break; | ||
| 1051 | } | ||
| 1052 | |||
| 1053 | return 0; | ||
| 1054 | } | ||
| 1055 | |||
| 1056 | static int aif1clk_ev(struct snd_soc_dapm_widget *w, | ||
| 1057 | struct snd_kcontrol *kcontrol, int event) | ||
| 1058 | { | ||
| 1059 | struct snd_soc_codec *codec = w->codec; | ||
| 1060 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1061 | |||
| 1062 | switch (event) { | ||
| 1063 | case SND_SOC_DAPM_PRE_PMU: | ||
| 1064 | wm8994->aif1clk_enable = 1; | ||
| 1065 | break; | ||
| 1066 | } | ||
| 1067 | |||
| 1068 | return 0; | ||
| 1069 | } | ||
| 1070 | |||
| 1071 | static int aif2clk_ev(struct snd_soc_dapm_widget *w, | ||
| 1072 | struct snd_kcontrol *kcontrol, int event) | ||
| 1073 | { | ||
| 1074 | struct snd_soc_codec *codec = w->codec; | ||
| 1075 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | ||
| 1076 | |||
| 1077 | switch (event) { | ||
| 1078 | case SND_SOC_DAPM_PRE_PMU: | ||
| 1079 | wm8994->aif2clk_enable = 1; | ||
| 1080 | break; | ||
| 1081 | } | ||
| 1082 | |||
| 1083 | return 0; | ||
| 1084 | } | ||
| 1085 | |||
| 1086 | static int dac_ev(struct snd_soc_dapm_widget *w, | ||
| 1087 | struct snd_kcontrol *kcontrol, int event) | ||
| 1088 | { | ||
| 1089 | struct snd_soc_codec *codec = w->codec; | ||
| 1090 | unsigned int mask = 1 << w->shift; | ||
| 1091 | |||
| 1092 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | ||
| 1093 | mask, mask); | ||
| 1094 | return 0; | ||
| 1095 | } | ||
| 1096 | |||
| 1007 | static const char *hp_mux_text[] = { | 1097 | static const char *hp_mux_text[] = { |
| 1008 | "Mixer", | 1098 | "Mixer", |
| 1009 | "DAC", | 1099 | "DAC", |
| @@ -1272,6 +1362,47 @@ static const struct soc_enum aif2dacr_src_enum = | |||
| 1272 | static const struct snd_kcontrol_new aif2dacr_src_mux = | 1362 | static const struct snd_kcontrol_new aif2dacr_src_mux = |
| 1273 | SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); | 1363 | SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); |
| 1274 | 1364 | ||
| 1365 | static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = { | ||
| 1366 | SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev, | ||
| 1367 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | ||
| 1368 | SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev, | ||
| 1369 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | ||
| 1370 | |||
| 1371 | SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1372 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1373 | SND_SOC_DAPM_PGA_E("Late DAC1R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1374 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1375 | SND_SOC_DAPM_PGA_E("Late DAC2L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1376 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1377 | SND_SOC_DAPM_PGA_E("Late DAC2R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, | ||
| 1378 | late_enable_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1379 | |||
| 1380 | SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev) | ||
| 1381 | }; | ||
| 1382 | |||
| 1383 | static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { | ||
| 1384 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), | ||
| 1385 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0) | ||
| 1386 | }; | ||
| 1387 | |||
| 1388 | static const struct snd_soc_dapm_widget wm8994_dac_revd_widgets[] = { | ||
| 1389 | SND_SOC_DAPM_DAC_E("DAC2L", NULL, SND_SOC_NOPM, 3, 0, | ||
| 1390 | dac_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1391 | SND_SOC_DAPM_DAC_E("DAC2R", NULL, SND_SOC_NOPM, 2, 0, | ||
| 1392 | dac_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1393 | SND_SOC_DAPM_DAC_E("DAC1L", NULL, SND_SOC_NOPM, 1, 0, | ||
| 1394 | dac_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1395 | SND_SOC_DAPM_DAC_E("DAC1R", NULL, SND_SOC_NOPM, 0, 0, | ||
| 1396 | dac_ev, SND_SOC_DAPM_PRE_PMU), | ||
| 1397 | }; | ||
| 1398 | |||
| 1399 | static const struct snd_soc_dapm_widget wm8994_dac_widgets[] = { | ||
| 1400 | SND_SOC_DAPM_DAC("DAC2L", NULL, WM8994_POWER_MANAGEMENT_5, 3, 0), | ||
| 1401 | SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 2, 0), | ||
| 1402 | SND_SOC_DAPM_DAC("DAC1L", NULL, WM8994_POWER_MANAGEMENT_5, 1, 0), | ||
| 1403 | SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), | ||
| 1404 | }; | ||
| 1405 | |||
| 1275 | static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { | 1406 | static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { |
| 1276 | SND_SOC_DAPM_INPUT("DMIC1DAT"), | 1407 | SND_SOC_DAPM_INPUT("DMIC1DAT"), |
| 1277 | SND_SOC_DAPM_INPUT("DMIC2DAT"), | 1408 | SND_SOC_DAPM_INPUT("DMIC2DAT"), |
| @@ -1284,9 +1415,6 @@ SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0), | |||
| 1284 | SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0), | 1415 | SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0), |
| 1285 | SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0), | 1416 | SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0), |
| 1286 | 1417 | ||
| 1287 | SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), | ||
| 1288 | SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), | ||
| 1289 | |||
| 1290 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL, | 1418 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL, |
| 1291 | 0, WM8994_POWER_MANAGEMENT_4, 9, 0), | 1419 | 0, WM8994_POWER_MANAGEMENT_4, 9, 0), |
| 1292 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL, | 1420 | SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL, |
| @@ -1372,11 +1500,6 @@ SND_SOC_DAPM_ADC("ADCR", NULL, SND_SOC_NOPM, 0, 0), | |||
| 1372 | SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), | 1500 | SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), |
| 1373 | SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), | 1501 | SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), |
| 1374 | 1502 | ||
| 1375 | SND_SOC_DAPM_DAC("DAC2L", NULL, WM8994_POWER_MANAGEMENT_5, 3, 0), | ||
| 1376 | SND_SOC_DAPM_DAC("DAC2R", NULL, WM8994_POWER_MANAGEMENT_5, 2, 0), | ||
| 1377 | SND_SOC_DAPM_DAC("DAC1L", NULL, WM8994_POWER_MANAGEMENT_5, 1, 0), | ||
| 1378 | SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), | ||
| 1379 | |||
| 1380 | SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, &hpl_mux), | 1503 | SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, &hpl_mux), |
| 1381 | SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, &hpr_mux), | 1504 | SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, &hpr_mux), |
| 1382 | 1505 | ||
| @@ -1516,14 +1639,12 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
| 1516 | { "AIF2ADC Mux", "AIF3DACDAT", "AIF3ADCDAT" }, | 1639 | { "AIF2ADC Mux", "AIF3DACDAT", "AIF3ADCDAT" }, |
| 1517 | 1640 | ||
| 1518 | /* DAC1 inputs */ | 1641 | /* DAC1 inputs */ |
| 1519 | { "DAC1L", NULL, "DAC1L Mixer" }, | ||
| 1520 | { "DAC1L Mixer", "AIF2 Switch", "AIF2DACL" }, | 1642 | { "DAC1L Mixer", "AIF2 Switch", "AIF2DACL" }, |
| 1521 | { "DAC1L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, | 1643 | { "DAC1L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, |
| 1522 | { "DAC1L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, | 1644 | { "DAC1L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, |
| 1523 | { "DAC1L Mixer", "Left Sidetone Switch", "Left Sidetone" }, | 1645 | { "DAC1L Mixer", "Left Sidetone Switch", "Left Sidetone" }, |
| 1524 | { "DAC1L Mixer", "Right Sidetone Switch", "Right Sidetone" }, | 1646 | { "DAC1L Mixer", "Right Sidetone Switch", "Right Sidetone" }, |
| 1525 | 1647 | ||
| 1526 | { "DAC1R", NULL, "DAC1R Mixer" }, | ||
| 1527 | { "DAC1R Mixer", "AIF2 Switch", "AIF2DACR" }, | 1648 | { "DAC1R Mixer", "AIF2 Switch", "AIF2DACR" }, |
| 1528 | { "DAC1R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, | 1649 | { "DAC1R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, |
| 1529 | { "DAC1R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, | 1650 | { "DAC1R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, |
| @@ -1532,7 +1653,6 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
| 1532 | 1653 | ||
| 1533 | /* DAC2/AIF2 outputs */ | 1654 | /* DAC2/AIF2 outputs */ |
| 1534 | { "AIF2ADCL", NULL, "AIF2DAC2L Mixer" }, | 1655 | { "AIF2ADCL", NULL, "AIF2DAC2L Mixer" }, |
| 1535 | { "DAC2L", NULL, "AIF2DAC2L Mixer" }, | ||
| 1536 | { "AIF2DAC2L Mixer", "AIF2 Switch", "AIF2DACL" }, | 1656 | { "AIF2DAC2L Mixer", "AIF2 Switch", "AIF2DACL" }, |
| 1537 | { "AIF2DAC2L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, | 1657 | { "AIF2DAC2L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, |
| 1538 | { "AIF2DAC2L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, | 1658 | { "AIF2DAC2L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, |
| @@ -1540,7 +1660,6 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
| 1540 | { "AIF2DAC2L Mixer", "Right Sidetone Switch", "Right Sidetone" }, | 1660 | { "AIF2DAC2L Mixer", "Right Sidetone Switch", "Right Sidetone" }, |
| 1541 | 1661 | ||
| 1542 | { "AIF2ADCR", NULL, "AIF2DAC2R Mixer" }, | 1662 | { "AIF2ADCR", NULL, "AIF2DAC2R Mixer" }, |
| 1543 | { "DAC2R", NULL, "AIF2DAC2R Mixer" }, | ||
| 1544 | { "AIF2DAC2R Mixer", "AIF2 Switch", "AIF2DACR" }, | 1663 | { "AIF2DAC2R Mixer", "AIF2 Switch", "AIF2DACR" }, |
| 1545 | { "AIF2DAC2R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, | 1664 | { "AIF2DAC2R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, |
| 1546 | { "AIF2DAC2R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, | 1665 | { "AIF2DAC2R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, |
| @@ -1584,6 +1703,24 @@ static const struct snd_soc_dapm_route intercon[] = { | |||
| 1584 | { "Right Headphone Mux", "DAC", "DAC1R" }, | 1703 | { "Right Headphone Mux", "DAC", "DAC1R" }, |
| 1585 | }; | 1704 | }; |
| 1586 | 1705 | ||
| 1706 | static const struct snd_soc_dapm_route wm8994_lateclk_revd_intercon[] = { | ||
| 1707 | { "DAC1L", NULL, "Late DAC1L Enable PGA" }, | ||
| 1708 | { "Late DAC1L Enable PGA", NULL, "DAC1L Mixer" }, | ||
| 1709 | { "DAC1R", NULL, "Late DAC1R Enable PGA" }, | ||
| 1710 | { "Late DAC1R Enable PGA", NULL, "DAC1R Mixer" }, | ||
| 1711 | { "DAC2L", NULL, "Late DAC2L Enable PGA" }, | ||
| 1712 | { "Late DAC2L Enable PGA", NULL, "AIF2DAC2L Mixer" }, | ||
| 1713 | { "DAC2R", NULL, "Late DAC2R Enable PGA" }, | ||
| 1714 | { "Late DAC2R Enable PGA", NULL, "AIF2DAC2R Mixer" } | ||
| 1715 | }; | ||
| 1716 | |||
| 1717 | static const struct snd_soc_dapm_route wm8994_lateclk_intercon[] = { | ||
| 1718 | { "DAC1L", NULL, "DAC1L Mixer" }, | ||
| 1719 | { "DAC1R", NULL, "DAC1R Mixer" }, | ||
| 1720 | { "DAC2L", NULL, "AIF2DAC2L Mixer" }, | ||
| 1721 | { "DAC2R", NULL, "AIF2DAC2R Mixer" }, | ||
| 1722 | }; | ||
| 1723 | |||
| 1587 | static const struct snd_soc_dapm_route wm8994_revd_intercon[] = { | 1724 | static const struct snd_soc_dapm_route wm8994_revd_intercon[] = { |
| 1588 | { "AIF1DACDAT", NULL, "AIF2DACDAT" }, | 1725 | { "AIF1DACDAT", NULL, "AIF2DACDAT" }, |
| 1589 | { "AIF2DACDAT", NULL, "AIF1DACDAT" }, | 1726 | { "AIF2DACDAT", NULL, "AIF1DACDAT" }, |
| @@ -2514,6 +2651,22 @@ static int wm8994_resume(struct snd_soc_codec *codec) | |||
| 2514 | { | 2651 | { |
| 2515 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); | 2652 | struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); |
| 2516 | int i, ret; | 2653 | int i, ret; |
| 2654 | unsigned int val, mask; | ||
| 2655 | |||
| 2656 | if (wm8994->revision < 4) { | ||
| 2657 | /* force a HW read */ | ||
| 2658 | val = wm8994_reg_read(codec->control_data, | ||
| 2659 | WM8994_POWER_MANAGEMENT_5); | ||
| 2660 | |||
| 2661 | /* modify the cache only */ | ||
| 2662 | codec->cache_only = 1; | ||
| 2663 | mask = WM8994_DAC1R_ENA | WM8994_DAC1L_ENA | | ||
| 2664 | WM8994_DAC2R_ENA | WM8994_DAC2L_ENA; | ||
| 2665 | val &= mask; | ||
| 2666 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | ||
| 2667 | mask, val); | ||
| 2668 | codec->cache_only = 0; | ||
| 2669 | } | ||
| 2517 | 2670 | ||
| 2518 | /* Restore the registers */ | 2671 | /* Restore the registers */ |
| 2519 | ret = snd_soc_cache_sync(codec); | 2672 | ret = snd_soc_cache_sync(codec); |
| @@ -2847,11 +3000,10 @@ static void wm8958_default_micdet(u16 status, void *data) | |||
| 2847 | report |= SND_JACK_BTN_5; | 3000 | report |= SND_JACK_BTN_5; |
| 2848 | 3001 | ||
| 2849 | done: | 3002 | done: |
| 2850 | snd_soc_jack_report(wm8994->micdet[0].jack, | 3003 | snd_soc_jack_report(wm8994->micdet[0].jack, report, |
| 2851 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | | 3004 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | |
| 2852 | SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5 | | 3005 | SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5 | |
| 2853 | SND_JACK_MICROPHONE | SND_JACK_VIDEOOUT, | 3006 | SND_JACK_MICROPHONE | SND_JACK_VIDEOOUT); |
| 2854 | report); | ||
| 2855 | } | 3007 | } |
| 2856 | 3008 | ||
| 2857 | /** | 3009 | /** |
| @@ -3125,6 +3277,17 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
| 3125 | case WM8994: | 3277 | case WM8994: |
| 3126 | snd_soc_dapm_new_controls(dapm, wm8994_specific_dapm_widgets, | 3278 | snd_soc_dapm_new_controls(dapm, wm8994_specific_dapm_widgets, |
| 3127 | ARRAY_SIZE(wm8994_specific_dapm_widgets)); | 3279 | ARRAY_SIZE(wm8994_specific_dapm_widgets)); |
| 3280 | if (wm8994->revision < 4) { | ||
| 3281 | snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets, | ||
| 3282 | ARRAY_SIZE(wm8994_lateclk_revd_widgets)); | ||
| 3283 | snd_soc_dapm_new_controls(dapm, wm8994_dac_revd_widgets, | ||
| 3284 | ARRAY_SIZE(wm8994_dac_revd_widgets)); | ||
| 3285 | } else { | ||
| 3286 | snd_soc_dapm_new_controls(dapm, wm8994_lateclk_widgets, | ||
| 3287 | ARRAY_SIZE(wm8994_lateclk_widgets)); | ||
| 3288 | snd_soc_dapm_new_controls(dapm, wm8994_dac_widgets, | ||
| 3289 | ARRAY_SIZE(wm8994_dac_widgets)); | ||
| 3290 | } | ||
| 3128 | break; | 3291 | break; |
| 3129 | case WM8958: | 3292 | case WM8958: |
| 3130 | snd_soc_add_controls(codec, wm8958_snd_controls, | 3293 | snd_soc_add_controls(codec, wm8958_snd_controls, |
| @@ -3143,10 +3306,15 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
| 3143 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, | 3306 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, |
| 3144 | ARRAY_SIZE(wm8994_intercon)); | 3307 | ARRAY_SIZE(wm8994_intercon)); |
| 3145 | 3308 | ||
| 3146 | if (wm8994->revision < 4) | 3309 | if (wm8994->revision < 4) { |
| 3147 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, | 3310 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, |
| 3148 | ARRAY_SIZE(wm8994_revd_intercon)); | 3311 | ARRAY_SIZE(wm8994_revd_intercon)); |
| 3149 | 3312 | snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, | |
| 3313 | ARRAY_SIZE(wm8994_lateclk_revd_intercon)); | ||
| 3314 | } else { | ||
| 3315 | snd_soc_dapm_add_routes(dapm, wm8994_lateclk_intercon, | ||
| 3316 | ARRAY_SIZE(wm8994_lateclk_intercon)); | ||
| 3317 | } | ||
| 3150 | break; | 3318 | break; |
| 3151 | case WM8958: | 3319 | case WM8958: |
| 3152 | snd_soc_dapm_add_routes(dapm, wm8958_intercon, | 3320 | snd_soc_dapm_add_routes(dapm, wm8958_intercon, |
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 613df5db0b32..516892706063 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
| @@ -674,6 +674,9 @@ SND_SOC_DAPM_OUTPUT("LINEOUT2N"), | |||
| 674 | }; | 674 | }; |
| 675 | 675 | ||
| 676 | static const struct snd_soc_dapm_route analogue_routes[] = { | 676 | static const struct snd_soc_dapm_route analogue_routes[] = { |
| 677 | { "MICBIAS1", NULL, "CLK_SYS" }, | ||
| 678 | { "MICBIAS2", NULL, "CLK_SYS" }, | ||
| 679 | |||
| 677 | { "IN1L PGA", "IN1LP Switch", "IN1LP" }, | 680 | { "IN1L PGA", "IN1LP Switch", "IN1LP" }, |
| 678 | { "IN1L PGA", "IN1LN Switch", "IN1LN" }, | 681 | { "IN1L PGA", "IN1LN Switch", "IN1LN" }, |
| 679 | 682 | ||
diff --git a/sound/soc/imx/eukrea-tlv320.c b/sound/soc/imx/eukrea-tlv320.c index e20c9e1457c0..1e9bccae4e80 100644 --- a/sound/soc/imx/eukrea-tlv320.c +++ b/sound/soc/imx/eukrea-tlv320.c | |||
| @@ -79,7 +79,7 @@ static struct snd_soc_dai_link eukrea_tlv320_dai = { | |||
| 79 | .name = "tlv320aic23", | 79 | .name = "tlv320aic23", |
| 80 | .stream_name = "TLV320AIC23", | 80 | .stream_name = "TLV320AIC23", |
| 81 | .codec_dai_name = "tlv320aic23-hifi", | 81 | .codec_dai_name = "tlv320aic23-hifi", |
| 82 | .platform_name = "imx-pcm-audio.0", | 82 | .platform_name = "imx-fiq-pcm-audio.0", |
| 83 | .codec_name = "tlv320aic23-codec.0-001a", | 83 | .codec_name = "tlv320aic23-codec.0-001a", |
| 84 | .cpu_dai_name = "imx-ssi.0", | 84 | .cpu_dai_name = "imx-ssi.0", |
| 85 | .ops = &eukrea_tlv320_snd_ops, | 85 | .ops = &eukrea_tlv320_snd_ops, |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index ede6afde7d2f..2175f09e57b6 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
| @@ -69,110 +69,6 @@ static struct omap_mcbsp_data mcbsp_data[NUM_LINKS]; | |||
| 69 | */ | 69 | */ |
| 70 | static struct omap_pcm_dma_data omap_mcbsp_dai_dma_params[NUM_LINKS][2]; | 70 | static struct omap_pcm_dma_data omap_mcbsp_dai_dma_params[NUM_LINKS][2]; |
| 71 | 71 | ||
| 72 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) | ||
| 73 | static const int omap1_dma_reqs[][2] = { | ||
| 74 | { OMAP_DMA_MCBSP1_TX, OMAP_DMA_MCBSP1_RX }, | ||
| 75 | { OMAP_DMA_MCBSP2_TX, OMAP_DMA_MCBSP2_RX }, | ||
| 76 | { OMAP_DMA_MCBSP3_TX, OMAP_DMA_MCBSP3_RX }, | ||
| 77 | }; | ||
| 78 | static const unsigned long omap1_mcbsp_port[][2] = { | ||
| 79 | { OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1, | ||
| 80 | OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1 }, | ||
| 81 | { OMAP1510_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1, | ||
| 82 | OMAP1510_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1 }, | ||
| 83 | { OMAP1510_MCBSP3_BASE + OMAP_MCBSP_REG_DXR1, | ||
| 84 | OMAP1510_MCBSP3_BASE + OMAP_MCBSP_REG_DRR1 }, | ||
| 85 | }; | ||
| 86 | #else | ||
| 87 | static const int omap1_dma_reqs[][2] = {}; | ||
| 88 | static const unsigned long omap1_mcbsp_port[][2] = {}; | ||
| 89 | #endif | ||
| 90 | |||
| 91 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | ||
| 92 | static const int omap24xx_dma_reqs[][2] = { | ||
| 93 | { OMAP24XX_DMA_MCBSP1_TX, OMAP24XX_DMA_MCBSP1_RX }, | ||
| 94 | { OMAP24XX_DMA_MCBSP2_TX, OMAP24XX_DMA_MCBSP2_RX }, | ||
| 95 | #if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_ARCH_OMAP3) | ||
| 96 | { OMAP24XX_DMA_MCBSP3_TX, OMAP24XX_DMA_MCBSP3_RX }, | ||
| 97 | { OMAP24XX_DMA_MCBSP4_TX, OMAP24XX_DMA_MCBSP4_RX }, | ||
| 98 | { OMAP24XX_DMA_MCBSP5_TX, OMAP24XX_DMA_MCBSP5_RX }, | ||
| 99 | #endif | ||
| 100 | }; | ||
| 101 | #else | ||
| 102 | static const int omap24xx_dma_reqs[][2] = {}; | ||
| 103 | #endif | ||
| 104 | |||
| 105 | #if defined(CONFIG_ARCH_OMAP4) | ||
| 106 | static const int omap44xx_dma_reqs[][2] = { | ||
| 107 | { OMAP44XX_DMA_MCBSP1_TX, OMAP44XX_DMA_MCBSP1_RX }, | ||
| 108 | { OMAP44XX_DMA_MCBSP2_TX, OMAP44XX_DMA_MCBSP2_RX }, | ||
| 109 | { OMAP44XX_DMA_MCBSP3_TX, OMAP44XX_DMA_MCBSP3_RX }, | ||
| 110 | { OMAP44XX_DMA_MCBSP4_TX, OMAP44XX_DMA_MCBSP4_RX }, | ||
| 111 | }; | ||
| 112 | #else | ||
| 113 | static const int omap44xx_dma_reqs[][2] = {}; | ||
| 114 | #endif | ||
| 115 | |||
| 116 | #if defined(CONFIG_SOC_OMAP2420) | ||
| 117 | static const unsigned long omap2420_mcbsp_port[][2] = { | ||
| 118 | { OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1, | ||
| 119 | OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1 }, | ||
| 120 | { OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1, | ||
| 121 | OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1 }, | ||
| 122 | }; | ||
| 123 | #else | ||
| 124 | static const unsigned long omap2420_mcbsp_port[][2] = {}; | ||
| 125 | #endif | ||
| 126 | |||
| 127 | #if defined(CONFIG_SOC_OMAP2430) | ||
| 128 | static const unsigned long omap2430_mcbsp_port[][2] = { | ||
| 129 | { OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR, | ||
| 130 | OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 131 | { OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR, | ||
| 132 | OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 133 | { OMAP2430_MCBSP3_BASE + OMAP_MCBSP_REG_DXR, | ||
| 134 | OMAP2430_MCBSP3_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 135 | { OMAP2430_MCBSP4_BASE + OMAP_MCBSP_REG_DXR, | ||
| 136 | OMAP2430_MCBSP4_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 137 | { OMAP2430_MCBSP5_BASE + OMAP_MCBSP_REG_DXR, | ||
| 138 | OMAP2430_MCBSP5_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 139 | }; | ||
| 140 | #else | ||
| 141 | static const unsigned long omap2430_mcbsp_port[][2] = {}; | ||
| 142 | #endif | ||
| 143 | |||
| 144 | #if defined(CONFIG_ARCH_OMAP3) | ||
| 145 | static const unsigned long omap34xx_mcbsp_port[][2] = { | ||
| 146 | { OMAP34XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR, | ||
| 147 | OMAP34XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 148 | { OMAP34XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR, | ||
| 149 | OMAP34XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 150 | { OMAP34XX_MCBSP3_BASE + OMAP_MCBSP_REG_DXR, | ||
| 151 | OMAP34XX_MCBSP3_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 152 | { OMAP34XX_MCBSP4_BASE + OMAP_MCBSP_REG_DXR, | ||
| 153 | OMAP34XX_MCBSP4_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 154 | { OMAP34XX_MCBSP5_BASE + OMAP_MCBSP_REG_DXR, | ||
| 155 | OMAP34XX_MCBSP5_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 156 | }; | ||
| 157 | #else | ||
| 158 | static const unsigned long omap34xx_mcbsp_port[][2] = {}; | ||
| 159 | #endif | ||
| 160 | |||
| 161 | #if defined(CONFIG_ARCH_OMAP4) | ||
| 162 | static const unsigned long omap44xx_mcbsp_port[][2] = { | ||
| 163 | { OMAP44XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR, | ||
| 164 | OMAP44XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 165 | { OMAP44XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR, | ||
| 166 | OMAP44XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 167 | { OMAP44XX_MCBSP3_BASE + OMAP_MCBSP_REG_DXR, | ||
| 168 | OMAP44XX_MCBSP3_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 169 | { OMAP44XX_MCBSP4_BASE + OMAP_MCBSP_REG_DXR, | ||
| 170 | OMAP44XX_MCBSP4_BASE + OMAP_MCBSP_REG_DRR }, | ||
| 171 | }; | ||
| 172 | #else | ||
| 173 | static const unsigned long omap44xx_mcbsp_port[][2] = {}; | ||
| 174 | #endif | ||
| 175 | |||
| 176 | static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream) | 72 | static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream) |
| 177 | { | 73 | { |
| 178 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 74 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| @@ -346,24 +242,10 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, | |||
| 346 | unsigned int format, div, framesize, master; | 242 | unsigned int format, div, framesize, master; |
| 347 | 243 | ||
| 348 | dma_data = &omap_mcbsp_dai_dma_params[cpu_dai->id][substream->stream]; | 244 | dma_data = &omap_mcbsp_dai_dma_params[cpu_dai->id][substream->stream]; |
| 349 | if (cpu_class_is_omap1()) { | 245 | |
| 350 | dma = omap1_dma_reqs[bus_id][substream->stream]; | 246 | dma = omap_mcbsp_dma_ch_params(bus_id, substream->stream); |
| 351 | port = omap1_mcbsp_port[bus_id][substream->stream]; | 247 | port = omap_mcbsp_dma_reg_params(bus_id, substream->stream); |
| 352 | } else if (cpu_is_omap2420()) { | 248 | |
| 353 | dma = omap24xx_dma_reqs[bus_id][substream->stream]; | ||
| 354 | port = omap2420_mcbsp_port[bus_id][substream->stream]; | ||
| 355 | } else if (cpu_is_omap2430()) { | ||
| 356 | dma = omap24xx_dma_reqs[bus_id][substream->stream]; | ||
| 357 | port = omap2430_mcbsp_port[bus_id][substream->stream]; | ||
| 358 | } else if (cpu_is_omap343x()) { | ||
| 359 | dma = omap24xx_dma_reqs[bus_id][substream->stream]; | ||
| 360 | port = omap34xx_mcbsp_port[bus_id][substream->stream]; | ||
| 361 | } else if (cpu_is_omap44xx()) { | ||
| 362 | dma = omap44xx_dma_reqs[bus_id][substream->stream]; | ||
| 363 | port = omap44xx_mcbsp_port[bus_id][substream->stream]; | ||
| 364 | } else { | ||
| 365 | return -ENODEV; | ||
| 366 | } | ||
| 367 | switch (params_format(params)) { | 249 | switch (params_format(params)) { |
| 368 | case SNDRV_PCM_FORMAT_S16_LE: | 250 | case SNDRV_PCM_FORMAT_S16_LE: |
| 369 | dma_data->data_type = OMAP_DMA_DATA_TYPE_S16; | 251 | dma_data->data_type = OMAP_DMA_DATA_TYPE_S16; |
diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index 28333e7d9c50..dc65650a6fa1 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c | |||
| @@ -117,7 +117,7 @@ static struct snd_soc_dai_link e740_dai[] = { | |||
| 117 | { | 117 | { |
| 118 | .name = "AC97", | 118 | .name = "AC97", |
| 119 | .stream_name = "AC97 HiFi", | 119 | .stream_name = "AC97 HiFi", |
| 120 | .cpu_dai_name = "pxa-ac97.0", | 120 | .cpu_dai_name = "pxa2xx-ac97", |
| 121 | .codec_dai_name = "wm9705-hifi", | 121 | .codec_dai_name = "wm9705-hifi", |
| 122 | .platform_name = "pxa-pcm-audio", | 122 | .platform_name = "pxa-pcm-audio", |
| 123 | .codec_name = "wm9705-codec", | 123 | .codec_name = "wm9705-codec", |
| @@ -126,7 +126,7 @@ static struct snd_soc_dai_link e740_dai[] = { | |||
| 126 | { | 126 | { |
| 127 | .name = "AC97 Aux", | 127 | .name = "AC97 Aux", |
| 128 | .stream_name = "AC97 Aux", | 128 | .stream_name = "AC97 Aux", |
| 129 | .cpu_dai_name = "pxa-ac97.1", | 129 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 130 | .codec_dai_name = "wm9705-aux", | 130 | .codec_dai_name = "wm9705-aux", |
| 131 | .platform_name = "pxa-pcm-audio", | 131 | .platform_name = "pxa-pcm-audio", |
| 132 | .codec_name = "wm9705-codec", | 132 | .codec_name = "wm9705-codec", |
diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c index 01bf31675c55..51897fcd911b 100644 --- a/sound/soc/pxa/e750_wm9705.c +++ b/sound/soc/pxa/e750_wm9705.c | |||
| @@ -99,7 +99,7 @@ static struct snd_soc_dai_link e750_dai[] = { | |||
| 99 | { | 99 | { |
| 100 | .name = "AC97", | 100 | .name = "AC97", |
| 101 | .stream_name = "AC97 HiFi", | 101 | .stream_name = "AC97 HiFi", |
| 102 | .cpu_dai_name = "pxa-ac97.0", | 102 | .cpu_dai_name = "pxa2xx-ac97", |
| 103 | .codec_dai_name = "wm9705-hifi", | 103 | .codec_dai_name = "wm9705-hifi", |
| 104 | .platform_name = "pxa-pcm-audio", | 104 | .platform_name = "pxa-pcm-audio", |
| 105 | .codec_name = "wm9705-codec", | 105 | .codec_name = "wm9705-codec", |
| @@ -109,7 +109,7 @@ static struct snd_soc_dai_link e750_dai[] = { | |||
| 109 | { | 109 | { |
| 110 | .name = "AC97 Aux", | 110 | .name = "AC97 Aux", |
| 111 | .stream_name = "AC97 Aux", | 111 | .stream_name = "AC97 Aux", |
| 112 | .cpu_dai_name = "pxa-ac97.1", | 112 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 113 | .codec_dai_name ="wm9705-aux", | 113 | .codec_dai_name ="wm9705-aux", |
| 114 | .platform_name = "pxa-pcm-audio", | 114 | .platform_name = "pxa-pcm-audio", |
| 115 | .codec_name = "wm9705-codec", | 115 | .codec_name = "wm9705-codec", |
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index c6a37c6ef23b..053ed208e59f 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c | |||
| @@ -89,7 +89,7 @@ static struct snd_soc_dai_link e800_dai[] = { | |||
| 89 | { | 89 | { |
| 90 | .name = "AC97", | 90 | .name = "AC97", |
| 91 | .stream_name = "AC97 HiFi", | 91 | .stream_name = "AC97 HiFi", |
| 92 | .cpu_dai_name = "pxa-ac97.0", | 92 | .cpu_dai_name = "pxa2xx-ac97", |
| 93 | .codec_dai_name = "wm9712-hifi", | 93 | .codec_dai_name = "wm9712-hifi", |
| 94 | .platform_name = "pxa-pcm-audio", | 94 | .platform_name = "pxa-pcm-audio", |
| 95 | .codec_name = "wm9712-codec", | 95 | .codec_name = "wm9712-codec", |
| @@ -98,7 +98,7 @@ static struct snd_soc_dai_link e800_dai[] = { | |||
| 98 | { | 98 | { |
| 99 | .name = "AC97 Aux", | 99 | .name = "AC97 Aux", |
| 100 | .stream_name = "AC97 Aux", | 100 | .stream_name = "AC97 Aux", |
| 101 | .cpu_dai_name = "pxa-ac97.1", | 101 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 102 | .codec_dai_name ="wm9712-aux", | 102 | .codec_dai_name ="wm9712-aux", |
| 103 | .platform_name = "pxa-pcm-audio", | 103 | .platform_name = "pxa-pcm-audio", |
| 104 | .codec_name = "wm9712-codec", | 104 | .codec_name = "wm9712-codec", |
diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c index fc22e6eefc98..b13a4252812d 100644 --- a/sound/soc/pxa/em-x270.c +++ b/sound/soc/pxa/em-x270.c | |||
| @@ -37,7 +37,7 @@ static struct snd_soc_dai_link em_x270_dai[] = { | |||
| 37 | { | 37 | { |
| 38 | .name = "AC97", | 38 | .name = "AC97", |
| 39 | .stream_name = "AC97 HiFi", | 39 | .stream_name = "AC97 HiFi", |
| 40 | .cpu_dai_name = "pxa-ac97.0", | 40 | .cpu_dai_name = "pxa2xx-ac97", |
| 41 | .codec_dai_name = "wm9712-hifi", | 41 | .codec_dai_name = "wm9712-hifi", |
| 42 | .platform_name = "pxa-pcm-audio", | 42 | .platform_name = "pxa-pcm-audio", |
| 43 | .codec_name = "wm9712-codec", | 43 | .codec_name = "wm9712-codec", |
| @@ -45,7 +45,7 @@ static struct snd_soc_dai_link em_x270_dai[] = { | |||
| 45 | { | 45 | { |
| 46 | .name = "AC97 Aux", | 46 | .name = "AC97 Aux", |
| 47 | .stream_name = "AC97 Aux", | 47 | .stream_name = "AC97 Aux", |
| 48 | .cpu_dai_name = "pxa-ac97.1", | 48 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 49 | .codec_dai_name ="wm9712-aux", | 49 | .codec_dai_name ="wm9712-aux", |
| 50 | .platform_name = "pxa-pcm-audio", | 50 | .platform_name = "pxa-pcm-audio", |
| 51 | .codec_name = "wm9712-codec", | 51 | .codec_name = "wm9712-codec", |
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 0d70fc8c12bd..38ca6759907e 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c | |||
| @@ -162,7 +162,7 @@ static struct snd_soc_dai_link mioa701_dai[] = { | |||
| 162 | { | 162 | { |
| 163 | .name = "AC97", | 163 | .name = "AC97", |
| 164 | .stream_name = "AC97 HiFi", | 164 | .stream_name = "AC97 HiFi", |
| 165 | .cpu_dai_name = "pxa-ac97.0", | 165 | .cpu_dai_name = "pxa2xx-ac97", |
| 166 | .codec_dai_name = "wm9713-hifi", | 166 | .codec_dai_name = "wm9713-hifi", |
| 167 | .codec_name = "wm9713-codec", | 167 | .codec_name = "wm9713-codec", |
| 168 | .init = mioa701_wm9713_init, | 168 | .init = mioa701_wm9713_init, |
| @@ -172,7 +172,7 @@ static struct snd_soc_dai_link mioa701_dai[] = { | |||
| 172 | { | 172 | { |
| 173 | .name = "AC97 Aux", | 173 | .name = "AC97 Aux", |
| 174 | .stream_name = "AC97 Aux", | 174 | .stream_name = "AC97 Aux", |
| 175 | .cpu_dai_name = "pxa-ac97.1", | 175 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 176 | .codec_dai_name ="wm9713-aux", | 176 | .codec_dai_name ="wm9713-aux", |
| 177 | .codec_name = "wm9713-codec", | 177 | .codec_name = "wm9713-codec", |
| 178 | .platform_name = "pxa-pcm-audio", | 178 | .platform_name = "pxa-pcm-audio", |
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index 857db96d4a4f..504e4004f004 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c | |||
| @@ -132,7 +132,7 @@ static struct snd_soc_dai_link palm27x_dai[] = { | |||
| 132 | { | 132 | { |
| 133 | .name = "AC97 HiFi", | 133 | .name = "AC97 HiFi", |
| 134 | .stream_name = "AC97 HiFi", | 134 | .stream_name = "AC97 HiFi", |
| 135 | .cpu_dai_name = "pxa-ac97.0", | 135 | .cpu_dai_name = "pxa2xx-ac97", |
| 136 | .codec_dai_name = "wm9712-hifi", | 136 | .codec_dai_name = "wm9712-hifi", |
| 137 | .codec_name = "wm9712-codec", | 137 | .codec_name = "wm9712-codec", |
| 138 | .platform_name = "pxa-pcm-audio", | 138 | .platform_name = "pxa-pcm-audio", |
| @@ -141,7 +141,7 @@ static struct snd_soc_dai_link palm27x_dai[] = { | |||
| 141 | { | 141 | { |
| 142 | .name = "AC97 Aux", | 142 | .name = "AC97 Aux", |
| 143 | .stream_name = "AC97 Aux", | 143 | .stream_name = "AC97 Aux", |
| 144 | .cpu_dai_name = "pxa-ac97.1", | 144 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 145 | .codec_dai_name = "wm9712-aux", | 145 | .codec_dai_name = "wm9712-aux", |
| 146 | .codec_name = "wm9712-codec", | 146 | .codec_name = "wm9712-codec", |
| 147 | .platform_name = "pxa-pcm-audio", | 147 | .platform_name = "pxa-pcm-audio", |
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index f75804ef0897..4b6e5d608b42 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c | |||
| @@ -219,7 +219,7 @@ static struct snd_soc_dai_link tosa_dai[] = { | |||
| 219 | { | 219 | { |
| 220 | .name = "AC97", | 220 | .name = "AC97", |
| 221 | .stream_name = "AC97 HiFi", | 221 | .stream_name = "AC97 HiFi", |
| 222 | .cpu_dai_name = "pxa-ac97.0", | 222 | .cpu_dai_name = "pxa2xx-ac97", |
| 223 | .codec_dai_name = "wm9712-hifi", | 223 | .codec_dai_name = "wm9712-hifi", |
| 224 | .platform_name = "pxa-pcm-audio", | 224 | .platform_name = "pxa-pcm-audio", |
| 225 | .codec_name = "wm9712-codec", | 225 | .codec_name = "wm9712-codec", |
| @@ -229,7 +229,7 @@ static struct snd_soc_dai_link tosa_dai[] = { | |||
| 229 | { | 229 | { |
| 230 | .name = "AC97 Aux", | 230 | .name = "AC97 Aux", |
| 231 | .stream_name = "AC97 Aux", | 231 | .stream_name = "AC97 Aux", |
| 232 | .cpu_dai_name = "pxa-ac97.1", | 232 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 233 | .codec_dai_name = "wm9712-aux", | 233 | .codec_dai_name = "wm9712-aux", |
| 234 | .platform_name = "pxa-pcm-audio", | 234 | .platform_name = "pxa-pcm-audio", |
| 235 | .codec_name = "wm9712-codec", | 235 | .codec_name = "wm9712-codec", |
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c index b222a7d72027..25bba108fea3 100644 --- a/sound/soc/pxa/zylonite.c +++ b/sound/soc/pxa/zylonite.c | |||
| @@ -166,7 +166,7 @@ static struct snd_soc_dai_link zylonite_dai[] = { | |||
| 166 | .stream_name = "AC97 HiFi", | 166 | .stream_name = "AC97 HiFi", |
| 167 | .codec_name = "wm9713-codec", | 167 | .codec_name = "wm9713-codec", |
| 168 | .platform_name = "pxa-pcm-audio", | 168 | .platform_name = "pxa-pcm-audio", |
| 169 | .cpu_dai_name = "pxa-ac97.0", | 169 | .cpu_dai_name = "pxa2xx-ac97", |
| 170 | .codec_name = "wm9713-hifi", | 170 | .codec_name = "wm9713-hifi", |
| 171 | .init = zylonite_wm9713_init, | 171 | .init = zylonite_wm9713_init, |
| 172 | }, | 172 | }, |
| @@ -175,7 +175,7 @@ static struct snd_soc_dai_link zylonite_dai[] = { | |||
| 175 | .stream_name = "AC97 Aux", | 175 | .stream_name = "AC97 Aux", |
| 176 | .codec_name = "wm9713-codec", | 176 | .codec_name = "wm9713-codec", |
| 177 | .platform_name = "pxa-pcm-audio", | 177 | .platform_name = "pxa-pcm-audio", |
| 178 | .cpu_dai_name = "pxa-ac97.1", | 178 | .cpu_dai_name = "pxa2xx-ac97-aux", |
| 179 | .codec_name = "wm9713-aux", | 179 | .codec_name = "wm9713-aux", |
| 180 | }, | 180 | }, |
| 181 | { | 181 | { |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 8194f150bab7..25e54230cc6a 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
| @@ -712,7 +712,15 @@ static int dapm_supply_check_power(struct snd_soc_dapm_widget *w) | |||
| 712 | !path->connected(path->source, path->sink)) | 712 | !path->connected(path->source, path->sink)) |
| 713 | continue; | 713 | continue; |
| 714 | 714 | ||
| 715 | if (path->sink && path->sink->power_check && | 715 | if (!path->sink) |
| 716 | continue; | ||
| 717 | |||
| 718 | if (path->sink->force) { | ||
| 719 | power = 1; | ||
| 720 | break; | ||
| 721 | } | ||
| 722 | |||
| 723 | if (path->sink->power_check && | ||
| 716 | path->sink->power_check(path->sink)) { | 724 | path->sink->power_check(path->sink)) { |
| 717 | power = 1; | 725 | power = 1; |
| 718 | break; | 726 | break; |
| @@ -1627,6 +1635,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_add_routes); | |||
| 1627 | int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) | 1635 | int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) |
| 1628 | { | 1636 | { |
| 1629 | struct snd_soc_dapm_widget *w; | 1637 | struct snd_soc_dapm_widget *w; |
| 1638 | unsigned int val; | ||
| 1630 | 1639 | ||
| 1631 | list_for_each_entry(w, &dapm->card->widgets, list) | 1640 | list_for_each_entry(w, &dapm->card->widgets, list) |
| 1632 | { | 1641 | { |
| @@ -1675,6 +1684,18 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) | |||
| 1675 | case snd_soc_dapm_post: | 1684 | case snd_soc_dapm_post: |
| 1676 | break; | 1685 | break; |
| 1677 | } | 1686 | } |
| 1687 | |||
| 1688 | /* Read the initial power state from the device */ | ||
| 1689 | if (w->reg >= 0) { | ||
| 1690 | val = snd_soc_read(w->codec, w->reg); | ||
| 1691 | val &= 1 << w->shift; | ||
| 1692 | if (w->invert) | ||
| 1693 | val = !val; | ||
| 1694 | |||
| 1695 | if (val) | ||
| 1696 | w->power = 1; | ||
| 1697 | } | ||
| 1698 | |||
| 1678 | w->new = 1; | 1699 | w->new = 1; |
| 1679 | } | 1700 | } |
| 1680 | 1701 | ||
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 68b97477577b..66eabafb1c24 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c | |||
| @@ -785,7 +785,7 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *dev) | |||
| 785 | } | 785 | } |
| 786 | 786 | ||
| 787 | dev->pcm->private_data = dev; | 787 | dev->pcm->private_data = dev; |
| 788 | strcpy(dev->pcm->name, dev->product_name); | 788 | strlcpy(dev->pcm->name, dev->product_name, sizeof(dev->pcm->name)); |
| 789 | 789 | ||
| 790 | memset(dev->sub_playback, 0, sizeof(dev->sub_playback)); | 790 | memset(dev->sub_playback, 0, sizeof(dev->sub_playback)); |
| 791 | memset(dev->sub_capture, 0, sizeof(dev->sub_capture)); | 791 | memset(dev->sub_capture, 0, sizeof(dev->sub_capture)); |
diff --git a/sound/usb/caiaq/midi.c b/sound/usb/caiaq/midi.c index 2f218c77fff2..a1a47088fd0c 100644 --- a/sound/usb/caiaq/midi.c +++ b/sound/usb/caiaq/midi.c | |||
| @@ -136,7 +136,7 @@ int snd_usb_caiaq_midi_init(struct snd_usb_caiaqdev *device) | |||
| 136 | if (ret < 0) | 136 | if (ret < 0) |
| 137 | return ret; | 137 | return ret; |
| 138 | 138 | ||
| 139 | strcpy(rmidi->name, device->product_name); | 139 | strlcpy(rmidi->name, device->product_name, sizeof(rmidi->name)); |
| 140 | 140 | ||
| 141 | rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX; | 141 | rmidi->info_flags = SNDRV_RAWMIDI_INFO_DUPLEX; |
| 142 | rmidi->private_data = device; | 142 | rmidi->private_data = device; |
diff --git a/sound/usb/card.c b/sound/usb/card.c index 800f7cb4f251..c0f8270bc199 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
| @@ -323,6 +323,7 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, | |||
| 323 | return -ENOMEM; | 323 | return -ENOMEM; |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | mutex_init(&chip->shutdown_mutex); | ||
| 326 | chip->index = idx; | 327 | chip->index = idx; |
| 327 | chip->dev = dev; | 328 | chip->dev = dev; |
| 328 | chip->card = card; | 329 | chip->card = card; |
| @@ -531,6 +532,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) | |||
| 531 | chip = ptr; | 532 | chip = ptr; |
| 532 | card = chip->card; | 533 | card = chip->card; |
| 533 | mutex_lock(®ister_mutex); | 534 | mutex_lock(®ister_mutex); |
| 535 | mutex_lock(&chip->shutdown_mutex); | ||
| 534 | chip->shutdown = 1; | 536 | chip->shutdown = 1; |
| 535 | chip->num_interfaces--; | 537 | chip->num_interfaces--; |
| 536 | if (chip->num_interfaces <= 0) { | 538 | if (chip->num_interfaces <= 0) { |
| @@ -548,9 +550,11 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) | |||
| 548 | snd_usb_mixer_disconnect(p); | 550 | snd_usb_mixer_disconnect(p); |
| 549 | } | 551 | } |
| 550 | usb_chip[chip->index] = NULL; | 552 | usb_chip[chip->index] = NULL; |
| 553 | mutex_unlock(&chip->shutdown_mutex); | ||
| 551 | mutex_unlock(®ister_mutex); | 554 | mutex_unlock(®ister_mutex); |
| 552 | snd_card_free_when_closed(card); | 555 | snd_card_free_when_closed(card); |
| 553 | } else { | 556 | } else { |
| 557 | mutex_unlock(&chip->shutdown_mutex); | ||
| 554 | mutex_unlock(®ister_mutex); | 558 | mutex_unlock(®ister_mutex); |
| 555 | } | 559 | } |
| 556 | } | 560 | } |
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 4132522ac90f..e3f680526cb5 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c | |||
| @@ -361,6 +361,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, | |||
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | if (changed) { | 363 | if (changed) { |
| 364 | mutex_lock(&subs->stream->chip->shutdown_mutex); | ||
| 364 | /* format changed */ | 365 | /* format changed */ |
| 365 | snd_usb_release_substream_urbs(subs, 0); | 366 | snd_usb_release_substream_urbs(subs, 0); |
| 366 | /* influenced: period_bytes, channels, rate, format, */ | 367 | /* influenced: period_bytes, channels, rate, format, */ |
| @@ -368,6 +369,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, | |||
| 368 | params_rate(hw_params), | 369 | params_rate(hw_params), |
| 369 | snd_pcm_format_physical_width(params_format(hw_params)) * | 370 | snd_pcm_format_physical_width(params_format(hw_params)) * |
| 370 | params_channels(hw_params)); | 371 | params_channels(hw_params)); |
| 372 | mutex_unlock(&subs->stream->chip->shutdown_mutex); | ||
| 371 | } | 373 | } |
| 372 | 374 | ||
| 373 | return ret; | 375 | return ret; |
| @@ -385,8 +387,9 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream) | |||
| 385 | subs->cur_audiofmt = NULL; | 387 | subs->cur_audiofmt = NULL; |
| 386 | subs->cur_rate = 0; | 388 | subs->cur_rate = 0; |
| 387 | subs->period_bytes = 0; | 389 | subs->period_bytes = 0; |
| 388 | if (!subs->stream->chip->shutdown) | 390 | mutex_lock(&subs->stream->chip->shutdown_mutex); |
| 389 | snd_usb_release_substream_urbs(subs, 0); | 391 | snd_usb_release_substream_urbs(subs, 0); |
| 392 | mutex_unlock(&subs->stream->chip->shutdown_mutex); | ||
| 390 | return snd_pcm_lib_free_vmalloc_buffer(substream); | 393 | return snd_pcm_lib_free_vmalloc_buffer(substream); |
| 391 | } | 394 | } |
| 392 | 395 | ||
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index db3eb21627ee..6e66fffe87f5 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
| @@ -36,6 +36,7 @@ struct snd_usb_audio { | |||
| 36 | struct snd_card *card; | 36 | struct snd_card *card; |
| 37 | u32 usb_id; | 37 | u32 usb_id; |
| 38 | int shutdown; | 38 | int shutdown; |
| 39 | struct mutex shutdown_mutex; | ||
| 39 | unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ | 40 | unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ |
| 40 | int num_interfaces; | 41 | int num_interfaces; |
| 41 | int num_suspended_intf; | 42 | int num_suspended_intf; |
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 746cf03cb05d..0ace786e83e0 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
| @@ -264,9 +264,6 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end) | |||
| 264 | c->start_time = start; | 264 | c->start_time = start; |
| 265 | if (p->start_time == 0 || p->start_time > start) | 265 | if (p->start_time == 0 || p->start_time > start) |
| 266 | p->start_time = start; | 266 | p->start_time = start; |
| 267 | |||
| 268 | if (cpu > numcpus) | ||
| 269 | numcpus = cpu; | ||
| 270 | } | 267 | } |
| 271 | 268 | ||
| 272 | #define MAX_CPUS 4096 | 269 | #define MAX_CPUS 4096 |
| @@ -511,6 +508,9 @@ static int process_sample_event(event_t *event __used, | |||
| 511 | if (!event_str) | 508 | if (!event_str) |
| 512 | return 0; | 509 | return 0; |
| 513 | 510 | ||
| 511 | if (sample->cpu > numcpus) | ||
| 512 | numcpus = sample->cpu; | ||
| 513 | |||
| 514 | if (strcmp(event_str, "power:cpu_idle") == 0) { | 514 | if (strcmp(event_str, "power:cpu_idle") == 0) { |
| 515 | struct power_processor_entry *ppe = (void *)te; | 515 | struct power_processor_entry *ppe = (void *)te; |
| 516 | if (ppe->state == (u32)PWR_EVENT_EXIT) | 516 | if (ppe->state == (u32)PWR_EVENT_EXIT) |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 32f4f1f2f6e4..df51560f16f7 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -585,6 +585,7 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, | |||
| 585 | { | 585 | { |
| 586 | struct sort_entry *se; | 586 | struct sort_entry *se; |
| 587 | u64 period, total, period_sys, period_us, period_guest_sys, period_guest_us; | 587 | u64 period, total, period_sys, period_us, period_guest_sys, period_guest_us; |
| 588 | u64 nr_events; | ||
| 588 | const char *sep = symbol_conf.field_sep; | 589 | const char *sep = symbol_conf.field_sep; |
| 589 | int ret; | 590 | int ret; |
| 590 | 591 | ||
| @@ -593,6 +594,7 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, | |||
| 593 | 594 | ||
| 594 | if (pair_hists) { | 595 | if (pair_hists) { |
| 595 | period = self->pair ? self->pair->period : 0; | 596 | period = self->pair ? self->pair->period : 0; |
| 597 | nr_events = self->pair ? self->pair->nr_events : 0; | ||
| 596 | total = pair_hists->stats.total_period; | 598 | total = pair_hists->stats.total_period; |
| 597 | period_sys = self->pair ? self->pair->period_sys : 0; | 599 | period_sys = self->pair ? self->pair->period_sys : 0; |
| 598 | period_us = self->pair ? self->pair->period_us : 0; | 600 | period_us = self->pair ? self->pair->period_us : 0; |
| @@ -600,6 +602,7 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, | |||
| 600 | period_guest_us = self->pair ? self->pair->period_guest_us : 0; | 602 | period_guest_us = self->pair ? self->pair->period_guest_us : 0; |
| 601 | } else { | 603 | } else { |
| 602 | period = self->period; | 604 | period = self->period; |
| 605 | nr_events = self->nr_events; | ||
| 603 | total = session_total; | 606 | total = session_total; |
| 604 | period_sys = self->period_sys; | 607 | period_sys = self->period_sys; |
| 605 | period_us = self->period_us; | 608 | period_us = self->period_us; |
| @@ -640,9 +643,9 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, | |||
| 640 | 643 | ||
| 641 | if (symbol_conf.show_nr_samples) { | 644 | if (symbol_conf.show_nr_samples) { |
| 642 | if (sep) | 645 | if (sep) |
| 643 | ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period); | 646 | ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, nr_events); |
| 644 | else | 647 | else |
| 645 | ret += snprintf(s + ret, size - ret, "%11" PRIu64, period); | 648 | ret += snprintf(s + ret, size - ret, "%11" PRIu64, nr_events); |
| 646 | } | 649 | } |
| 647 | 650 | ||
| 648 | if (pair_hists) { | 651 | if (pair_hists) { |
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index fb737fe9be91..96c866045d60 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c | |||
| @@ -456,9 +456,9 @@ void svg_legenda(void) | |||
| 456 | return; | 456 | return; |
| 457 | 457 | ||
| 458 | svg_legenda_box(0, "Running", "sample"); | 458 | svg_legenda_box(0, "Running", "sample"); |
| 459 | svg_legenda_box(100, "Idle","rect.c1"); | 459 | svg_legenda_box(100, "Idle","c1"); |
| 460 | svg_legenda_box(200, "Deeper Idle", "rect.c3"); | 460 | svg_legenda_box(200, "Deeper Idle", "c3"); |
| 461 | svg_legenda_box(350, "Deepest Idle", "rect.c6"); | 461 | svg_legenda_box(350, "Deepest Idle", "c6"); |
| 462 | svg_legenda_box(550, "Sleeping", "process2"); | 462 | svg_legenda_box(550, "Sleeping", "process2"); |
| 463 | svg_legenda_box(650, "Waiting for cpu", "waiting"); | 463 | svg_legenda_box(650, "Waiting for cpu", "waiting"); |
| 464 | svg_legenda_box(800, "Blocked on IO", "blocked"); | 464 | svg_legenda_box(800, "Blocked on IO", "blocked"); |
