diff options
289 files changed, 6687 insertions, 3062 deletions
diff --git a/Documentation/credentials.txt b/Documentation/credentials.txt index a2db35287003..995baf379c07 100644 --- a/Documentation/credentials.txt +++ b/Documentation/credentials.txt | |||
@@ -417,6 +417,9 @@ reference on them using: | |||
417 | This does all the RCU magic inside of it. The caller must call put_cred() on | 417 | This does all the RCU magic inside of it. The caller must call put_cred() on |
418 | the credentials so obtained when they're finished with. | 418 | the credentials so obtained when they're finished with. |
419 | 419 | ||
420 | [*] Note: The result of __task_cred() should not be passed directly to | ||
421 | get_cred() as this may race with commit_cred(). | ||
422 | |||
420 | There are a couple of convenience functions to access bits of another task's | 423 | There are a couple of convenience functions to access bits of another task's |
421 | credentials, hiding the RCU magic from the caller: | 424 | credentials, hiding the RCU magic from the caller: |
422 | 425 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index c268783bc4e7..1571c0c83dba 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -647,3 +647,10 @@ Who: Stefan Richter <stefanr@s5r6.in-berlin.de> | |||
647 | 647 | ||
648 | ---------------------------- | 648 | ---------------------------- |
649 | 649 | ||
650 | What: The acpi_sleep=s4_nonvs command line option | ||
651 | When: 2.6.37 | ||
652 | Files: arch/x86/kernel/acpi/sleep.c | ||
653 | Why: superseded by acpi_sleep=nonvs | ||
654 | Who: Rafael J. Wysocki <rjw@sisk.pl> | ||
655 | |||
656 | ---------------------------- | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4ddb58df081e..2b2407d9a6d0 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -254,8 +254,8 @@ and is between 256 and 4096 characters. It is defined in the file | |||
254 | control method, with respect to putting devices into | 254 | control method, with respect to putting devices into |
255 | low power states, to be enforced (the ACPI 2.0 ordering | 255 | low power states, to be enforced (the ACPI 2.0 ordering |
256 | of _PTS is used by default). | 256 | of _PTS is used by default). |
257 | s4_nonvs prevents the kernel from saving/restoring the | 257 | nonvs prevents the kernel from saving/restoring the |
258 | ACPI NVS memory during hibernation. | 258 | ACPI NVS memory during suspend/hibernation and resume. |
259 | sci_force_enable causes the kernel to set SCI_EN directly | 259 | sci_force_enable causes the kernel to set SCI_EN directly |
260 | on resume from S1/S3 (which is against the ACPI spec, | 260 | on resume from S1/S3 (which is against the ACPI spec, |
261 | but some broken systems don't work without it). | 261 | but some broken systems don't work without it). |
diff --git a/MAINTAINERS b/MAINTAINERS index db3d0f5061f9..02f75fccac20 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -6243,6 +6243,8 @@ F: drivers/mmc/host/wbsd.* | |||
6243 | 6243 | ||
6244 | WATCHDOG DEVICE DRIVERS | 6244 | WATCHDOG DEVICE DRIVERS |
6245 | M: Wim Van Sebroeck <wim@iguana.be> | 6245 | M: Wim Van Sebroeck <wim@iguana.be> |
6246 | L: linux-watchdog@vger.kernel.org | ||
6247 | W: http://www.linux-watchdog.org/ | ||
6246 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git | 6248 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git |
6247 | S: Maintained | 6249 | S: Maintained |
6248 | F: Documentation/watchdog/ | 6250 | F: Documentation/watchdog/ |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 35 | 3 | SUBLEVEL = 35 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = |
5 | NAME = Sheep on Meth | 5 | NAME = Sheep on Meth |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 53faa9063a03..864a002137fe 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -71,6 +71,9 @@ targets := vmlinux vmlinux.lds \ | |||
71 | piggy.$(suffix_y) piggy.$(suffix_y).o \ | 71 | piggy.$(suffix_y) piggy.$(suffix_y).o \ |
72 | font.o font.c head.o misc.o $(OBJS) | 72 | font.o font.c head.o misc.o $(OBJS) |
73 | 73 | ||
74 | # Make sure files are removed during clean | ||
75 | extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S | ||
76 | |||
74 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | 77 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
75 | ORIG_CFLAGS := $(KBUILD_CFLAGS) | 78 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
76 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 79 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 6f80665f477e..9eaf65f43642 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
@@ -1028,13 +1028,12 @@ static int sa1111_remove(struct platform_device *pdev) | |||
1028 | struct sa1111 *sachip = platform_get_drvdata(pdev); | 1028 | struct sa1111 *sachip = platform_get_drvdata(pdev); |
1029 | 1029 | ||
1030 | if (sachip) { | 1030 | if (sachip) { |
1031 | __sa1111_remove(sachip); | ||
1032 | platform_set_drvdata(pdev, NULL); | ||
1033 | |||
1034 | #ifdef CONFIG_PM | 1031 | #ifdef CONFIG_PM |
1035 | kfree(sachip->saved_state); | 1032 | kfree(sachip->saved_state); |
1036 | sachip->saved_state = NULL; | 1033 | sachip->saved_state = NULL; |
1037 | #endif | 1034 | #endif |
1035 | __sa1111_remove(sachip); | ||
1036 | platform_set_drvdata(pdev, NULL); | ||
1038 | } | 1037 | } |
1039 | 1038 | ||
1040 | return 0; | 1039 | return 0; |
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index c980156f3263..1261b1f928d9 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <asm/byteorder.h> | 27 | #include <asm/byteorder.h> |
28 | #include <asm/memory.h> | 28 | #include <asm/memory.h> |
29 | #include <asm/system.h> | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 32 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
@@ -179,25 +180,38 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
179 | * IO port primitives for more information. | 180 | * IO port primitives for more information. |
180 | */ | 181 | */ |
181 | #ifdef __mem_pci | 182 | #ifdef __mem_pci |
182 | #define readb(c) ({ __u8 __v = __raw_readb(__mem_pci(c)); __v; }) | 183 | #define readb_relaxed(c) ({ u8 __v = __raw_readb(__mem_pci(c)); __v; }) |
183 | #define readw(c) ({ __u16 __v = le16_to_cpu((__force __le16) \ | 184 | #define readw_relaxed(c) ({ u16 __v = le16_to_cpu((__force __le16) \ |
184 | __raw_readw(__mem_pci(c))); __v; }) | 185 | __raw_readw(__mem_pci(c))); __v; }) |
185 | #define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \ | 186 | #define readl_relaxed(c) ({ u32 __v = le32_to_cpu((__force __le32) \ |
186 | __raw_readl(__mem_pci(c))); __v; }) | 187 | __raw_readl(__mem_pci(c))); __v; }) |
187 | #define readb_relaxed(addr) readb(addr) | 188 | |
188 | #define readw_relaxed(addr) readw(addr) | 189 | #define writeb_relaxed(v,c) ((void)__raw_writeb(v,__mem_pci(c))) |
189 | #define readl_relaxed(addr) readl(addr) | 190 | #define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \ |
191 | cpu_to_le16(v),__mem_pci(c))) | ||
192 | #define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \ | ||
193 | cpu_to_le32(v),__mem_pci(c))) | ||
194 | |||
195 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE | ||
196 | #define __iormb() rmb() | ||
197 | #define __iowmb() wmb() | ||
198 | #else | ||
199 | #define __iormb() do { } while (0) | ||
200 | #define __iowmb() do { } while (0) | ||
201 | #endif | ||
202 | |||
203 | #define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) | ||
204 | #define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; }) | ||
205 | #define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; }) | ||
206 | |||
207 | #define writeb(v,c) ({ __iowmb(); writeb_relaxed(v,c); }) | ||
208 | #define writew(v,c) ({ __iowmb(); writew_relaxed(v,c); }) | ||
209 | #define writel(v,c) ({ __iowmb(); writel_relaxed(v,c); }) | ||
190 | 210 | ||
191 | #define readsb(p,d,l) __raw_readsb(__mem_pci(p),d,l) | 211 | #define readsb(p,d,l) __raw_readsb(__mem_pci(p),d,l) |
192 | #define readsw(p,d,l) __raw_readsw(__mem_pci(p),d,l) | 212 | #define readsw(p,d,l) __raw_readsw(__mem_pci(p),d,l) |
193 | #define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l) | 213 | #define readsl(p,d,l) __raw_readsl(__mem_pci(p),d,l) |
194 | 214 | ||
195 | #define writeb(v,c) __raw_writeb(v,__mem_pci(c)) | ||
196 | #define writew(v,c) __raw_writew((__force __u16) \ | ||
197 | cpu_to_le16(v),__mem_pci(c)) | ||
198 | #define writel(v,c) __raw_writel((__force __u32) \ | ||
199 | cpu_to_le32(v),__mem_pci(c)) | ||
200 | |||
201 | #define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l) | 215 | #define writesb(p,d,l) __raw_writesb(__mem_pci(p),d,l) |
202 | #define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l) | 216 | #define writesw(p,d,l) __raw_writesw(__mem_pci(p),d,l) |
203 | #define writesl(p,d,l) __raw_writesl(__mem_pci(p),d,l) | 217 | #define writesl(p,d,l) __raw_writesl(__mem_pci(p),d,l) |
@@ -244,13 +258,13 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
244 | * io{read,write}{8,16,32} macros | 258 | * io{read,write}{8,16,32} macros |
245 | */ | 259 | */ |
246 | #ifndef ioread8 | 260 | #ifndef ioread8 |
247 | #define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; }) | 261 | #define ioread8(p) ({ unsigned int __v = __raw_readb(p); __iormb(); __v; }) |
248 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __v; }) | 262 | #define ioread16(p) ({ unsigned int __v = le16_to_cpu((__force __le16)__raw_readw(p)); __iormb(); __v; }) |
249 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __v; }) | 263 | #define ioread32(p) ({ unsigned int __v = le32_to_cpu((__force __le32)__raw_readl(p)); __iormb(); __v; }) |
250 | 264 | ||
251 | #define iowrite8(v,p) __raw_writeb(v, p) | 265 | #define iowrite8(v,p) ({ __iowmb(); (void)__raw_writeb(v, p); }) |
252 | #define iowrite16(v,p) __raw_writew((__force __u16)cpu_to_le16(v), p) | 266 | #define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); }) |
253 | #define iowrite32(v,p) __raw_writel((__force __u32)cpu_to_le32(v), p) | 267 | #define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); }) |
254 | 268 | ||
255 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) | 269 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) |
256 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) | 270 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) |
diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S index 59ff6fdc1e63..7d08b43d2c0e 100644 --- a/arch/arm/lib/csumpartialcopyuser.S +++ b/arch/arm/lib/csumpartialcopyuser.S | |||
@@ -71,7 +71,7 @@ | |||
71 | .pushsection .fixup,"ax" | 71 | .pushsection .fixup,"ax" |
72 | .align 4 | 72 | .align 4 |
73 | 9001: mov r4, #-EFAULT | 73 | 9001: mov r4, #-EFAULT |
74 | ldr r5, [fp, #4] @ *err_ptr | 74 | ldr r5, [sp, #8*4] @ *err_ptr |
75 | str r4, [r5] | 75 | str r4, [r5] |
76 | ldmia sp, {r1, r2} @ retrieve dst, len | 76 | ldmia sp, {r1, r2} @ retrieve dst, len |
77 | add r2, r2, r1 | 77 | add r2, r2, r1 |
diff --git a/arch/arm/mach-clps711x/include/mach/debug-macro.S b/arch/arm/mach-clps711x/include/mach/debug-macro.S index fedd8076a689..072cc6b61ba3 100644 --- a/arch/arm/mach-clps711x/include/mach/debug-macro.S +++ b/arch/arm/mach-clps711x/include/mach/debug-macro.S | |||
@@ -11,6 +11,7 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <mach/hardware.h> | ||
14 | #include <asm/hardware/clps7111.h> | 15 | #include <asm/hardware/clps7111.h> |
15 | 16 | ||
16 | .macro addruart, rx, tmp | 17 | .macro addruart, rx, tmp |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 2ec3095ffb7b..b280efb1fa12 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/mtd/partitions.h> | 25 | #include <linux/mtd/partitions.h> |
26 | #include <linux/mtd/physmap.h> | 26 | #include <linux/mtd/physmap.h> |
27 | #include <linux/regulator/machine.h> | 27 | #include <linux/regulator/machine.h> |
28 | #include <linux/regulator/tps6507x.h> | ||
28 | #include <linux/mfd/tps6507x.h> | 29 | #include <linux/mfd/tps6507x.h> |
29 | #include <linux/input/tps6507x-ts.h> | 30 | #include <linux/input/tps6507x-ts.h> |
30 | 31 | ||
@@ -469,6 +470,11 @@ struct regulator_consumer_supply tps65070_ldo2_consumers[] = { | |||
469 | }, | 470 | }, |
470 | }; | 471 | }; |
471 | 472 | ||
473 | /* We take advantage of the fact that both defdcdc{2,3} are tied high */ | ||
474 | static struct tps6507x_reg_platform_data tps6507x_platform_data = { | ||
475 | .defdcdc_default = true, | ||
476 | }; | ||
477 | |||
472 | struct regulator_init_data tps65070_regulator_data[] = { | 478 | struct regulator_init_data tps65070_regulator_data[] = { |
473 | /* dcdc1 */ | 479 | /* dcdc1 */ |
474 | { | 480 | { |
@@ -494,6 +500,7 @@ struct regulator_init_data tps65070_regulator_data[] = { | |||
494 | }, | 500 | }, |
495 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers), | 501 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers), |
496 | .consumer_supplies = tps65070_dcdc2_consumers, | 502 | .consumer_supplies = tps65070_dcdc2_consumers, |
503 | .driver_data = &tps6507x_platform_data, | ||
497 | }, | 504 | }, |
498 | 505 | ||
499 | /* dcdc3 */ | 506 | /* dcdc3 */ |
@@ -507,6 +514,7 @@ struct regulator_init_data tps65070_regulator_data[] = { | |||
507 | }, | 514 | }, |
508 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers), | 515 | .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers), |
509 | .consumer_supplies = tps65070_dcdc3_consumers, | 516 | .consumer_supplies = tps65070_dcdc3_consumers, |
517 | .driver_data = &tps6507x_platform_data, | ||
510 | }, | 518 | }, |
511 | 519 | ||
512 | /* ldo1 */ | 520 | /* ldo1 */ |
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c index e3bc3f6f6b10..88b3dd89be89 100644 --- a/arch/arm/mach-footbridge/common.c +++ b/arch/arm/mach-footbridge/common.c | |||
@@ -232,7 +232,7 @@ EXPORT_SYMBOL(__bus_to_virt); | |||
232 | 232 | ||
233 | unsigned long __pfn_to_bus(unsigned long pfn) | 233 | unsigned long __pfn_to_bus(unsigned long pfn) |
234 | { | 234 | { |
235 | return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET)); | 235 | return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET); |
236 | } | 236 | } |
237 | EXPORT_SYMBOL(__pfn_to_bus); | 237 | EXPORT_SYMBOL(__pfn_to_bus); |
238 | 238 | ||
diff --git a/arch/arm/mach-h720x/include/mach/debug-macro.S b/arch/arm/mach-h720x/include/mach/debug-macro.S index a9ee8f0d48b7..27cafd12f033 100644 --- a/arch/arm/mach-h720x/include/mach/debug-macro.S +++ b/arch/arm/mach-h720x/include/mach/debug-macro.S | |||
@@ -11,8 +11,10 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | .equ io_virt, IO_BASE | 14 | #include <mach/hardware.h> |
15 | .equ io_phys, IO_START | 15 | |
16 | .equ io_virt, IO_VIRT | ||
17 | .equ io_phys, IO_PHYS | ||
16 | 18 | ||
17 | .macro addruart, rx, tmp | 19 | .macro addruart, rx, tmp |
18 | mrc p15, 0, \rx, c1, c0 | 20 | mrc p15, 0, \rx, c1, c0 |
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c index 7221c20b2afa..f781164e623f 100644 --- a/arch/arm/mach-kirkwood/tsx1x-common.c +++ b/arch/arm/mach-kirkwood/tsx1x-common.c | |||
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = { | |||
77 | }, | 77 | }, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | void qnap_tsx1x_register_flash(void) | 80 | void __init qnap_tsx1x_register_flash(void) |
81 | { | 81 | { |
82 | spi_register_board_info(qnap_tsx1x_spi_slave_info, | 82 | spi_register_board_info(qnap_tsx1x_spi_slave_info, |
83 | ARRAY_SIZE(qnap_tsx1x_spi_slave_info)); | 83 | ARRAY_SIZE(qnap_tsx1x_spi_slave_info)); |
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h index 9a592962a6ea..7fa037361b55 100644 --- a/arch/arm/mach-kirkwood/tsx1x-common.h +++ b/arch/arm/mach-kirkwood/tsx1x-common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H | 1 | #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H |
2 | #define __ARCH_KIRKWOOD_TSX1X_COMMON_H | 2 | #define __ARCH_KIRKWOOD_TSX1X_COMMON_H |
3 | 3 | ||
4 | extern void qnap_tsx1x_register_flash(void); | 4 | extern void __init qnap_tsx1x_register_flash(void); |
5 | extern void qnap_tsx1x_power_off(void); | 5 | extern void qnap_tsx1x_power_off(void); |
6 | 6 | ||
7 | #endif | 7 | #endif |
diff --git a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S index 0859336a8e6d..5c934bdb7158 100644 --- a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S +++ b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S | |||
@@ -8,6 +8,7 @@ | |||
8 | * the Free Software Foundation. | 8 | * the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include <asm/memory.h> | ||
11 | 12 | ||
12 | #include <mach/regs-board-a9m9750dev.h> | 13 | #include <mach/regs-board-a9m9750dev.h> |
13 | 14 | ||
diff --git a/arch/arm/mach-ns9xxx/include/mach/uncompress.h b/arch/arm/mach-ns9xxx/include/mach/uncompress.h index 1b12d324b087..770a68c46e81 100644 --- a/arch/arm/mach-ns9xxx/include/mach/uncompress.h +++ b/arch/arm/mach-ns9xxx/include/mach/uncompress.h | |||
@@ -20,50 +20,49 @@ static void putc_dummy(char c, void __iomem *base) | |||
20 | /* nothing */ | 20 | /* nothing */ |
21 | } | 21 | } |
22 | 22 | ||
23 | static int timeout; | ||
24 | |||
23 | static void putc_ns9360(char c, void __iomem *base) | 25 | static void putc_ns9360(char c, void __iomem *base) |
24 | { | 26 | { |
25 | static int t = 0x10000; | ||
26 | do { | 27 | do { |
27 | if (t) | 28 | if (timeout) |
28 | --t; | 29 | --timeout; |
29 | 30 | ||
30 | if (__raw_readl(base + 8) & (1 << 3)) { | 31 | if (__raw_readl(base + 8) & (1 << 3)) { |
31 | __raw_writeb(c, base + 16); | 32 | __raw_writeb(c, base + 16); |
32 | t = 0x10000; | 33 | timeout = 0x10000; |
33 | break; | 34 | break; |
34 | } | 35 | } |
35 | } while (t); | 36 | } while (timeout); |
36 | } | 37 | } |
37 | 38 | ||
38 | static void putc_a9m9750dev(char c, void __iomem *base) | 39 | static void putc_a9m9750dev(char c, void __iomem *base) |
39 | { | 40 | { |
40 | static int t = 0x10000; | ||
41 | do { | 41 | do { |
42 | if (t) | 42 | if (timeout) |
43 | --t; | 43 | --timeout; |
44 | 44 | ||
45 | if (__raw_readb(base + 5) & (1 << 5)) { | 45 | if (__raw_readb(base + 5) & (1 << 5)) { |
46 | __raw_writeb(c, base); | 46 | __raw_writeb(c, base); |
47 | t = 0x10000; | 47 | timeout = 0x10000; |
48 | break; | 48 | break; |
49 | } | 49 | } |
50 | } while (t); | 50 | } while (timeout); |
51 | 51 | ||
52 | } | 52 | } |
53 | 53 | ||
54 | static void putc_ns921x(char c, void __iomem *base) | 54 | static void putc_ns921x(char c, void __iomem *base) |
55 | { | 55 | { |
56 | static int t = 0x10000; | ||
57 | do { | 56 | do { |
58 | if (t) | 57 | if (timeout) |
59 | --t; | 58 | --timeout; |
60 | 59 | ||
61 | if (!(__raw_readl(base) & (1 << 11))) { | 60 | if (!(__raw_readl(base) & (1 << 11))) { |
62 | __raw_writeb(c, base + 0x0028); | 61 | __raw_writeb(c, base + 0x0028); |
63 | t = 0x10000; | 62 | timeout = 0x10000; |
64 | break; | 63 | break; |
65 | } | 64 | } |
66 | } while (t); | 65 | } while (timeout); |
67 | } | 66 | } |
68 | 67 | ||
69 | #define MSCS __REG(0xA0900184) | 68 | #define MSCS __REG(0xA0900184) |
@@ -89,6 +88,7 @@ static void putc_ns921x(char c, void __iomem *base) | |||
89 | 88 | ||
90 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) | 89 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) |
91 | { | 90 | { |
91 | timeout = 0x10000; | ||
92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { | 92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { |
93 | /* ns9360 or ns9750 */ | 93 | /* ns9360 or ns9750 */ |
94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { | 94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { |
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index b9f0c4c46bbb..3b02d3b944af 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig | |||
@@ -1,3 +1,7 @@ | |||
1 | if ARCH_OMAP1 | ||
2 | |||
3 | menu "TI OMAP1 specific features" | ||
4 | |||
1 | comment "OMAP Core Type" | 5 | comment "OMAP Core Type" |
2 | depends on ARCH_OMAP1 | 6 | depends on ARCH_OMAP1 |
3 | 7 | ||
@@ -243,3 +247,6 @@ config OMAP_ARM_30MHZ | |||
243 | help | 247 | help |
244 | Enable 30MHz clock for OMAP CPU. If unsure, say N. | 248 | Enable 30MHz clock for OMAP CPU. If unsure, say N. |
245 | 249 | ||
250 | endmenu | ||
251 | |||
252 | endif | ||
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index ea231c7a550a..facfaeb1ae5c 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile | |||
@@ -23,6 +23,9 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y) | |||
23 | 23 | ||
24 | led-y := leds.o | 24 | led-y := leds.o |
25 | 25 | ||
26 | usb-fs-$(CONFIG_USB) := usb.o | ||
27 | obj-y += $(usb-fs-m) $(usb-fs-y) | ||
28 | |||
26 | # Specific board support | 29 | # Specific board support |
27 | obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o | 30 | obj-$(CONFIG_MACH_OMAP_H2) += board-h2.o board-h2-mmc.o |
28 | obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o | 31 | obj-$(CONFIG_MACH_OMAP_INNOVATOR) += board-innovator.o |
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index fdd1dd53fa9c..c6a81ff8c0d8 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -235,7 +235,7 @@ static void __init ams_delta_init(void) | |||
235 | /* Clear latch2 (NAND, LCD, modem enable) */ | 235 | /* Clear latch2 (NAND, LCD, modem enable) */ |
236 | ams_delta_latch2_write(~0, 0); | 236 | ams_delta_latch2_write(~0, 0); |
237 | 237 | ||
238 | omap_usb_init(&ams_delta_usb_config); | 238 | omap1_usb_init(&ams_delta_usb_config); |
239 | platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); | 239 | platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); |
240 | 240 | ||
241 | #ifdef CONFIG_AMS_DELTA_FIQ | 241 | #ifdef CONFIG_AMS_DELTA_FIQ |
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 096f2ed102cb..405ff7a3b82d 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c | |||
@@ -292,6 +292,18 @@ static void __init omap_fsample_init(void) | |||
292 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 292 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
293 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 293 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
294 | 294 | ||
295 | /* Mux pins for keypad */ | ||
296 | omap_cfg_reg(E2_7XX_KBR0); | ||
297 | omap_cfg_reg(J7_7XX_KBR1); | ||
298 | omap_cfg_reg(E1_7XX_KBR2); | ||
299 | omap_cfg_reg(F3_7XX_KBR3); | ||
300 | omap_cfg_reg(D2_7XX_KBR4); | ||
301 | omap_cfg_reg(C2_7XX_KBC0); | ||
302 | omap_cfg_reg(D3_7XX_KBC1); | ||
303 | omap_cfg_reg(E4_7XX_KBC2); | ||
304 | omap_cfg_reg(F4_7XX_KBC3); | ||
305 | omap_cfg_reg(E3_7XX_KBC4); | ||
306 | |||
295 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 307 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
296 | 308 | ||
297 | omap_board_config = fsample_config; | 309 | omap_board_config = fsample_config; |
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c index e1195a3467b8..e9ed8bff1ce3 100644 --- a/arch/arm/mach-omap1/board-generic.c +++ b/arch/arm/mach-omap1/board-generic.c | |||
@@ -72,12 +72,12 @@ static void __init omap_generic_init(void) | |||
72 | omap_cfg_reg(UART3_TX); | 72 | omap_cfg_reg(UART3_TX); |
73 | omap_cfg_reg(UART3_RX); | 73 | omap_cfg_reg(UART3_RX); |
74 | 74 | ||
75 | omap_usb_init(&generic1510_usb_config); | 75 | omap1_usb_init(&generic1510_usb_config); |
76 | } | 76 | } |
77 | #endif | 77 | #endif |
78 | #if defined(CONFIG_ARCH_OMAP16XX) | 78 | #if defined(CONFIG_ARCH_OMAP16XX) |
79 | if (!cpu_is_omap1510()) { | 79 | if (!cpu_is_omap1510()) { |
80 | omap_usb_init(&generic1610_usb_config); | 80 | omap1_usb_init(&generic1610_usb_config); |
81 | } | 81 | } |
82 | #endif | 82 | #endif |
83 | 83 | ||
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index d1100e4f65ac..2efa4272d2e3 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -292,15 +292,6 @@ static struct platform_device h2_kp_device = { | |||
292 | 292 | ||
293 | #define H2_IRDA_FIRSEL_GPIO_PIN 17 | 293 | #define H2_IRDA_FIRSEL_GPIO_PIN 17 |
294 | 294 | ||
295 | #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) | ||
296 | static int h2_transceiver_mode(struct device *dev, int state) | ||
297 | { | ||
298 | /* SIR when low, else MIR/FIR when HIGH */ | ||
299 | gpio_set_value(H2_IRDA_FIRSEL_GPIO_PIN, !(state & IR_SIRMODE)); | ||
300 | return 0; | ||
301 | } | ||
302 | #endif | ||
303 | |||
304 | static struct omap_irda_config h2_irda_data = { | 295 | static struct omap_irda_config h2_irda_data = { |
305 | .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, | 296 | .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE, |
306 | .rx_channel = OMAP_DMA_UART3_RX, | 297 | .rx_channel = OMAP_DMA_UART3_RX, |
@@ -437,14 +428,18 @@ static void __init h2_init(void) | |||
437 | /* omap_cfg_reg(U19_ARMIO1); */ /* CD */ | 428 | /* omap_cfg_reg(U19_ARMIO1); */ /* CD */ |
438 | omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ | 429 | omap_cfg_reg(BALLOUT_V8_ARMIO3); /* WP */ |
439 | 430 | ||
440 | /* Irda */ | 431 | /* Mux pins for keypad */ |
441 | #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) | 432 | omap_cfg_reg(F18_1610_KBC0); |
442 | omap_writel(omap_readl(FUNC_MUX_CTRL_A) | 7, FUNC_MUX_CTRL_A); | 433 | omap_cfg_reg(D20_1610_KBC1); |
443 | if (gpio_request(H2_IRDA_FIRSEL_GPIO_PIN, "IRDA mode") < 0) | 434 | omap_cfg_reg(D19_1610_KBC2); |
444 | BUG(); | 435 | omap_cfg_reg(E18_1610_KBC3); |
445 | gpio_direction_output(H2_IRDA_FIRSEL_GPIO_PIN, 0); | 436 | omap_cfg_reg(C21_1610_KBC4); |
446 | h2_irda_data.transceiver_mode = h2_transceiver_mode; | 437 | omap_cfg_reg(G18_1610_KBR0); |
447 | #endif | 438 | omap_cfg_reg(F19_1610_KBR1); |
439 | omap_cfg_reg(H14_1610_KBR2); | ||
440 | omap_cfg_reg(E20_1610_KBR3); | ||
441 | omap_cfg_reg(E19_1610_KBR4); | ||
442 | omap_cfg_reg(N19_1610_KBR5); | ||
448 | 443 | ||
449 | platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); | 444 | platform_add_devices(h2_devices, ARRAY_SIZE(h2_devices)); |
450 | omap_board_config = h2_config; | 445 | omap_board_config = h2_config; |
@@ -452,7 +447,7 @@ static void __init h2_init(void) | |||
452 | omap_serial_init(); | 447 | omap_serial_init(); |
453 | omap_register_i2c_bus(1, 100, h2_i2c_board_info, | 448 | omap_register_i2c_bus(1, 100, h2_i2c_board_info, |
454 | ARRAY_SIZE(h2_i2c_board_info)); | 449 | ARRAY_SIZE(h2_i2c_board_info)); |
455 | omap_usb_init(&h2_usb_config); | 450 | omap1_usb_init(&h2_usb_config); |
456 | h2_mmc_init(); | 451 | h2_mmc_init(); |
457 | } | 452 | } |
458 | 453 | ||
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index a53ab8297d25..a228e9d6eb7b 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -397,6 +397,19 @@ static void __init h3_init(void) | |||
397 | /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ | 397 | /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ |
398 | omap_cfg_reg(V2_1710_GPIO10); | 398 | omap_cfg_reg(V2_1710_GPIO10); |
399 | 399 | ||
400 | /* Mux pins for keypad */ | ||
401 | omap_cfg_reg(F18_1610_KBC0); | ||
402 | omap_cfg_reg(D20_1610_KBC1); | ||
403 | omap_cfg_reg(D19_1610_KBC2); | ||
404 | omap_cfg_reg(E18_1610_KBC3); | ||
405 | omap_cfg_reg(C21_1610_KBC4); | ||
406 | omap_cfg_reg(G18_1610_KBR0); | ||
407 | omap_cfg_reg(F19_1610_KBR1); | ||
408 | omap_cfg_reg(H14_1610_KBR2); | ||
409 | omap_cfg_reg(E20_1610_KBR3); | ||
410 | omap_cfg_reg(E19_1610_KBR4); | ||
411 | omap_cfg_reg(N19_1610_KBR5); | ||
412 | |||
400 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 413 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
401 | spi_register_board_info(h3_spi_board_info, | 414 | spi_register_board_info(h3_spi_board_info, |
402 | ARRAY_SIZE(h3_spi_board_info)); | 415 | ARRAY_SIZE(h3_spi_board_info)); |
@@ -405,7 +418,7 @@ static void __init h3_init(void) | |||
405 | omap_serial_init(); | 418 | omap_serial_init(); |
406 | omap_register_i2c_bus(1, 100, h3_i2c_board_info, | 419 | omap_register_i2c_bus(1, 100, h3_i2c_board_info, |
407 | ARRAY_SIZE(h3_i2c_board_info)); | 420 | ARRAY_SIZE(h3_i2c_board_info)); |
408 | omap_usb_init(&h3_usb_config); | 421 | omap1_usb_init(&h3_usb_config); |
409 | h3_mmc_init(); | 422 | h3_mmc_init(); |
410 | } | 423 | } |
411 | 424 | ||
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c index 8e313b4b99a9..736e4c2064f6 100644 --- a/arch/arm/mach-omap1/board-htcherald.c +++ b/arch/arm/mach-omap1/board-htcherald.c | |||
@@ -287,7 +287,7 @@ static void __init htcherald_init(void) | |||
287 | htcherald_disable_watchdog(); | 287 | htcherald_disable_watchdog(); |
288 | 288 | ||
289 | htcherald_usb_enable(); | 289 | htcherald_usb_enable(); |
290 | omap_usb_init(&htcherald_usb_config); | 290 | omap1_usb_init(&htcherald_usb_config); |
291 | } | 291 | } |
292 | 292 | ||
293 | static void __init htcherald_init_irq(void) | 293 | static void __init htcherald_init_irq(void) |
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index 5d12fd35681b..3c04e90fb85a 100644 --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c | |||
@@ -422,13 +422,13 @@ static void __init innovator_init(void) | |||
422 | 422 | ||
423 | #ifdef CONFIG_ARCH_OMAP15XX | 423 | #ifdef CONFIG_ARCH_OMAP15XX |
424 | if (cpu_is_omap1510()) { | 424 | if (cpu_is_omap1510()) { |
425 | omap_usb_init(&innovator1510_usb_config); | 425 | omap1_usb_init(&innovator1510_usb_config); |
426 | innovator_config[1].data = &innovator1510_lcd_config; | 426 | innovator_config[1].data = &innovator1510_lcd_config; |
427 | } | 427 | } |
428 | #endif | 428 | #endif |
429 | #ifdef CONFIG_ARCH_OMAP16XX | 429 | #ifdef CONFIG_ARCH_OMAP16XX |
430 | if (cpu_is_omap1610()) { | 430 | if (cpu_is_omap1610()) { |
431 | omap_usb_init(&h2_usb_config); | 431 | omap1_usb_init(&h2_usb_config); |
432 | innovator_config[1].data = &innovator1610_lcd_config; | 432 | innovator_config[1].data = &innovator1610_lcd_config; |
433 | } | 433 | } |
434 | #endif | 434 | #endif |
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 71e1a3fad0ea..5224b67f7f1c 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <plat/board.h> | 32 | #include <plat/board.h> |
33 | #include <plat/keypad.h> | 33 | #include <plat/keypad.h> |
34 | #include <plat/common.h> | 34 | #include <plat/common.h> |
35 | #include <plat/dsp_common.h> | ||
36 | #include <plat/hwa742.h> | 35 | #include <plat/hwa742.h> |
37 | #include <plat/lcd_mipid.h> | 36 | #include <plat/lcd_mipid.h> |
38 | #include <plat/mmc.h> | 37 | #include <plat/mmc.h> |
@@ -242,138 +241,6 @@ static inline void nokia770_mmc_init(void) | |||
242 | } | 241 | } |
243 | #endif | 242 | #endif |
244 | 243 | ||
245 | #if defined(CONFIG_OMAP_DSP) | ||
246 | /* | ||
247 | * audio power control | ||
248 | */ | ||
249 | #define HEADPHONE_GPIO 14 | ||
250 | #define AMPLIFIER_CTRL_GPIO 58 | ||
251 | |||
252 | static struct clk *dspxor_ck; | ||
253 | static DEFINE_MUTEX(audio_pwr_lock); | ||
254 | /* | ||
255 | * audio_pwr_state | ||
256 | * +--+-------------------------+---------------------------------------+ | ||
257 | * |-1|down |power-up request -> 0 | | ||
258 | * +--+-------------------------+---------------------------------------+ | ||
259 | * | 0|up |power-down(1) request -> 1 | | ||
260 | * | | |power-down(2) request -> (ignore) | | ||
261 | * +--+-------------------------+---------------------------------------+ | ||
262 | * | 1|up, |power-up request -> 0 | | ||
263 | * | |received down(1) request |power-down(2) request -> -1 | | ||
264 | * +--+-------------------------+---------------------------------------+ | ||
265 | */ | ||
266 | static int audio_pwr_state = -1; | ||
267 | |||
268 | static inline void aic23_power_up(void) | ||
269 | { | ||
270 | } | ||
271 | static inline void aic23_power_down(void) | ||
272 | { | ||
273 | } | ||
274 | |||
275 | /* | ||
276 | * audio_pwr_up / down should be called under audio_pwr_lock | ||
277 | */ | ||
278 | static void nokia770_audio_pwr_up(void) | ||
279 | { | ||
280 | clk_enable(dspxor_ck); | ||
281 | |||
282 | /* Turn on codec */ | ||
283 | aic23_power_up(); | ||
284 | |||
285 | if (gpio_get_value(HEADPHONE_GPIO)) | ||
286 | /* HP not connected, turn on amplifier */ | ||
287 | gpio_set_value(AMPLIFIER_CTRL_GPIO, 1); | ||
288 | else | ||
289 | /* HP connected, do not turn on amplifier */ | ||
290 | printk("HP connected\n"); | ||
291 | } | ||
292 | |||
293 | static void codec_delayed_power_down(struct work_struct *work) | ||
294 | { | ||
295 | mutex_lock(&audio_pwr_lock); | ||
296 | if (audio_pwr_state == -1) | ||
297 | aic23_power_down(); | ||
298 | clk_disable(dspxor_ck); | ||
299 | mutex_unlock(&audio_pwr_lock); | ||
300 | } | ||
301 | |||
302 | static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down); | ||
303 | |||
304 | static void nokia770_audio_pwr_down(void) | ||
305 | { | ||
306 | /* Turn off amplifier */ | ||
307 | gpio_set_value(AMPLIFIER_CTRL_GPIO, 0); | ||
308 | |||
309 | /* Turn off codec: schedule delayed work */ | ||
310 | schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ | ||
311 | } | ||
312 | |||
313 | static int | ||
314 | nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage) | ||
315 | { | ||
316 | mutex_lock(&audio_pwr_lock); | ||
317 | if (audio_pwr_state == -1) | ||
318 | nokia770_audio_pwr_up(); | ||
319 | /* force audio_pwr_state = 0, even if it was 1. */ | ||
320 | audio_pwr_state = 0; | ||
321 | mutex_unlock(&audio_pwr_lock); | ||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | static int | ||
326 | nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage) | ||
327 | { | ||
328 | mutex_lock(&audio_pwr_lock); | ||
329 | switch (stage) { | ||
330 | case 1: | ||
331 | if (audio_pwr_state == 0) | ||
332 | audio_pwr_state = 1; | ||
333 | break; | ||
334 | case 2: | ||
335 | if (audio_pwr_state == 1) { | ||
336 | nokia770_audio_pwr_down(); | ||
337 | audio_pwr_state = -1; | ||
338 | } | ||
339 | break; | ||
340 | } | ||
341 | mutex_unlock(&audio_pwr_lock); | ||
342 | return 0; | ||
343 | } | ||
344 | |||
345 | static struct dsp_kfunc_device nokia770_audio_device = { | ||
346 | .name = "audio", | ||
347 | .type = DSP_KFUNC_DEV_TYPE_AUDIO, | ||
348 | .enable = nokia770_audio_pwr_up_request, | ||
349 | .disable = nokia770_audio_pwr_down_request, | ||
350 | }; | ||
351 | |||
352 | static __init int omap_dsp_init(void) | ||
353 | { | ||
354 | int ret; | ||
355 | |||
356 | dspxor_ck = clk_get(0, "dspxor_ck"); | ||
357 | if (IS_ERR(dspxor_ck)) { | ||
358 | printk(KERN_ERR "couldn't acquire dspxor_ck\n"); | ||
359 | return PTR_ERR(dspxor_ck); | ||
360 | } | ||
361 | |||
362 | ret = dsp_kfunc_device_register(&nokia770_audio_device); | ||
363 | if (ret) { | ||
364 | printk(KERN_ERR | ||
365 | "KFUNC device registration faild: %s\n", | ||
366 | nokia770_audio_device.name); | ||
367 | goto out; | ||
368 | } | ||
369 | return 0; | ||
370 | out: | ||
371 | return ret; | ||
372 | } | ||
373 | #else | ||
374 | #define omap_dsp_init() do {} while (0) | ||
375 | #endif /* CONFIG_OMAP_DSP */ | ||
376 | |||
377 | static void __init omap_nokia770_init(void) | 244 | static void __init omap_nokia770_init(void) |
378 | { | 245 | { |
379 | platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); | 246 | platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); |
@@ -382,11 +249,10 @@ static void __init omap_nokia770_init(void) | |||
382 | omap_gpio_init(); | 249 | omap_gpio_init(); |
383 | omap_serial_init(); | 250 | omap_serial_init(); |
384 | omap_register_i2c_bus(1, 100, NULL, 0); | 251 | omap_register_i2c_bus(1, 100, NULL, 0); |
385 | omap_dsp_init(); | ||
386 | hwa742_dev_init(); | 252 | hwa742_dev_init(); |
387 | ads7846_dev_init(); | 253 | ads7846_dev_init(); |
388 | mipid_dev_init(); | 254 | mipid_dev_init(); |
389 | omap_usb_init(&nokia770_usb_config); | 255 | omap1_usb_init(&nokia770_usb_config); |
390 | nokia770_mmc_init(); | 256 | nokia770_mmc_init(); |
391 | } | 257 | } |
392 | 258 | ||
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 80d862001def..b28c46a9ecce 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -560,7 +560,7 @@ static void __init osk_init(void) | |||
560 | l |= (3 << 1); | 560 | l |= (3 << 1); |
561 | omap_writel(l, USB_TRANSCEIVER_CTRL); | 561 | omap_writel(l, USB_TRANSCEIVER_CTRL); |
562 | 562 | ||
563 | omap_usb_init(&osk_usb_config); | 563 | omap1_usb_init(&osk_usb_config); |
564 | 564 | ||
565 | /* irq for tps65010 chip */ | 565 | /* irq for tps65010 chip */ |
566 | /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */ | 566 | /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */ |
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index 569b4c9085cd..514564f1df22 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c | |||
@@ -213,90 +213,6 @@ static struct omap_lcd_config palmte_lcd_config __initdata = { | |||
213 | .ctrl_name = "internal", | 213 | .ctrl_name = "internal", |
214 | }; | 214 | }; |
215 | 215 | ||
216 | #ifdef CONFIG_APM | ||
217 | /* | ||
218 | * Values measured in 10 minute intervals averaged over 10 samples. | ||
219 | * May differ slightly from device to device but should be accurate | ||
220 | * enough to give basic idea of battery life left and trigger | ||
221 | * potential alerts. | ||
222 | */ | ||
223 | static const int palmte_battery_sample[] = { | ||
224 | 2194, 2157, 2138, 2120, | ||
225 | 2104, 2089, 2075, 2061, | ||
226 | 2048, 2038, 2026, 2016, | ||
227 | 2008, 1998, 1989, 1980, | ||
228 | 1970, 1958, 1945, 1928, | ||
229 | 1910, 1888, 1860, 1827, | ||
230 | 1791, 1751, 1709, 1656, | ||
231 | }; | ||
232 | |||
233 | #define INTERVAL 10 | ||
234 | #define BATTERY_HIGH_TRESHOLD 66 | ||
235 | #define BATTERY_LOW_TRESHOLD 33 | ||
236 | |||
237 | static void palmte_get_power_status(struct apm_power_info *info, int *battery) | ||
238 | { | ||
239 | int charging, batt, hi, lo, mid; | ||
240 | |||
241 | charging = !gpio_get_value(PALMTE_DC_GPIO); | ||
242 | batt = battery[0]; | ||
243 | if (charging) | ||
244 | batt -= 60; | ||
245 | |||
246 | hi = ARRAY_SIZE(palmte_battery_sample); | ||
247 | lo = 0; | ||
248 | |||
249 | info->battery_flag = 0; | ||
250 | info->units = APM_UNITS_MINS; | ||
251 | |||
252 | if (batt > palmte_battery_sample[lo]) { | ||
253 | info->battery_life = 100; | ||
254 | info->time = INTERVAL * ARRAY_SIZE(palmte_battery_sample); | ||
255 | } else if (batt <= palmte_battery_sample[hi - 1]) { | ||
256 | info->battery_life = 0; | ||
257 | info->time = 0; | ||
258 | } else { | ||
259 | while (hi > lo + 1) { | ||
260 | mid = (hi + lo) >> 1; | ||
261 | if (batt <= palmte_battery_sample[mid]) | ||
262 | lo = mid; | ||
263 | else | ||
264 | hi = mid; | ||
265 | } | ||
266 | |||
267 | mid = palmte_battery_sample[lo] - palmte_battery_sample[hi]; | ||
268 | hi = palmte_battery_sample[lo] - batt; | ||
269 | info->battery_life = 100 - (100 * lo + 100 * hi / mid) / | ||
270 | ARRAY_SIZE(palmte_battery_sample); | ||
271 | info->time = INTERVAL * (ARRAY_SIZE(palmte_battery_sample) - | ||
272 | lo) - INTERVAL * hi / mid; | ||
273 | } | ||
274 | |||
275 | if (charging) { | ||
276 | info->ac_line_status = APM_AC_ONLINE; | ||
277 | info->battery_status = APM_BATTERY_STATUS_CHARGING; | ||
278 | info->battery_flag |= APM_BATTERY_FLAG_CHARGING; | ||
279 | } else { | ||
280 | info->ac_line_status = APM_AC_OFFLINE; | ||
281 | if (info->battery_life > BATTERY_HIGH_TRESHOLD) | ||
282 | info->battery_status = APM_BATTERY_STATUS_HIGH; | ||
283 | else if (info->battery_life > BATTERY_LOW_TRESHOLD) | ||
284 | info->battery_status = APM_BATTERY_STATUS_LOW; | ||
285 | else | ||
286 | info->battery_status = APM_BATTERY_STATUS_CRITICAL; | ||
287 | } | ||
288 | |||
289 | if (info->battery_life > BATTERY_HIGH_TRESHOLD) | ||
290 | info->battery_flag |= APM_BATTERY_FLAG_HIGH; | ||
291 | else if (info->battery_life > BATTERY_LOW_TRESHOLD) | ||
292 | info->battery_flag |= APM_BATTERY_FLAG_LOW; | ||
293 | else | ||
294 | info->battery_flag |= APM_BATTERY_FLAG_CRITICAL; | ||
295 | } | ||
296 | #else | ||
297 | #define palmte_get_power_status NULL | ||
298 | #endif | ||
299 | |||
300 | static struct omap_board_config_kernel palmte_config[] __initdata = { | 216 | static struct omap_board_config_kernel palmte_config[] __initdata = { |
301 | { OMAP_TAG_LCD, &palmte_lcd_config }, | 217 | { OMAP_TAG_LCD, &palmte_lcd_config }, |
302 | }; | 218 | }; |
@@ -359,7 +275,7 @@ static void __init omap_palmte_init(void) | |||
359 | spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); | 275 | spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); |
360 | palmte_misc_gpio_setup(); | 276 | palmte_misc_gpio_setup(); |
361 | omap_serial_init(); | 277 | omap_serial_init(); |
362 | omap_usb_init(&palmte_usb_config); | 278 | omap1_usb_init(&palmte_usb_config); |
363 | omap_register_i2c_bus(1, 100, NULL, 0); | 279 | omap_register_i2c_bus(1, 100, NULL, 0); |
364 | } | 280 | } |
365 | 281 | ||
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index 6ad49a2cc1a0..c0bcfc6119db 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c | |||
@@ -307,7 +307,7 @@ static void __init omap_palmtt_init(void) | |||
307 | 307 | ||
308 | spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo)); | 308 | spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo)); |
309 | omap_serial_init(); | 309 | omap_serial_init(); |
310 | omap_usb_init(&palmtt_usb_config); | 310 | omap1_usb_init(&palmtt_usb_config); |
311 | omap_register_i2c_bus(1, 100, NULL, 0); | 311 | omap_register_i2c_bus(1, 100, NULL, 0); |
312 | } | 312 | } |
313 | 313 | ||
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index 6641de9257ef..f431b44a71e3 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c | |||
@@ -325,7 +325,7 @@ omap_palmz71_init(void) | |||
325 | 325 | ||
326 | spi_register_board_info(palmz71_boardinfo, | 326 | spi_register_board_info(palmz71_boardinfo, |
327 | ARRAY_SIZE(palmz71_boardinfo)); | 327 | ARRAY_SIZE(palmz71_boardinfo)); |
328 | omap_usb_init(&palmz71_usb_config); | 328 | omap1_usb_init(&palmz71_usb_config); |
329 | omap_serial_init(); | 329 | omap_serial_init(); |
330 | omap_register_i2c_bus(1, 100, NULL, 0); | 330 | omap_register_i2c_bus(1, 100, NULL, 0); |
331 | palmz71_gpio_setup(0); | 331 | palmz71_gpio_setup(0); |
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index e854d5741c88..50690347c7b4 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c | |||
@@ -260,6 +260,18 @@ static void __init omap_perseus2_init(void) | |||
260 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 260 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
261 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 261 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
262 | 262 | ||
263 | /* Mux pins for keypad */ | ||
264 | omap_cfg_reg(E2_7XX_KBR0); | ||
265 | omap_cfg_reg(J7_7XX_KBR1); | ||
266 | omap_cfg_reg(E1_7XX_KBR2); | ||
267 | omap_cfg_reg(F3_7XX_KBR3); | ||
268 | omap_cfg_reg(D2_7XX_KBR4); | ||
269 | omap_cfg_reg(C2_7XX_KBC0); | ||
270 | omap_cfg_reg(D3_7XX_KBC1); | ||
271 | omap_cfg_reg(E4_7XX_KBC2); | ||
272 | omap_cfg_reg(F4_7XX_KBC3); | ||
273 | omap_cfg_reg(E3_7XX_KBC4); | ||
274 | |||
263 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 275 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
264 | 276 | ||
265 | omap_board_config = perseus2_config; | 277 | omap_board_config = perseus2_config; |
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 2fb1e5f8e2ec..7b21190a914a 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c | |||
@@ -392,7 +392,7 @@ static void __init omap_sx1_init(void) | |||
392 | omap_board_config_size = ARRAY_SIZE(sx1_config); | 392 | omap_board_config_size = ARRAY_SIZE(sx1_config); |
393 | omap_serial_init(); | 393 | omap_serial_init(); |
394 | omap_register_i2c_bus(1, 100, NULL, 0); | 394 | omap_register_i2c_bus(1, 100, NULL, 0); |
395 | omap_usb_init(&sx1_usb_config); | 395 | omap1_usb_init(&sx1_usb_config); |
396 | sx1_mmc_init(); | 396 | sx1_mmc_init(); |
397 | 397 | ||
398 | /* turn on USB power */ | 398 | /* turn on USB power */ |
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index 87b9436fe7c0..78107543d59b 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c | |||
@@ -198,7 +198,7 @@ static void __init voiceblue_init(void) | |||
198 | omap_board_config = voiceblue_config; | 198 | omap_board_config = voiceblue_config; |
199 | omap_board_config_size = ARRAY_SIZE(voiceblue_config); | 199 | omap_board_config_size = ARRAY_SIZE(voiceblue_config); |
200 | omap_serial_init(); | 200 | omap_serial_init(); |
201 | omap_usb_init(&voiceblue_usb_config); | 201 | omap1_usb_init(&voiceblue_usb_config); |
202 | omap_register_i2c_bus(1, 100, NULL, 0); | 202 | omap_register_i2c_bus(1, 100, NULL, 0); |
203 | 203 | ||
204 | /* There is a good chance board is going up, so enable power LED | 204 | /* There is a good chance board is going up, so enable power LED |
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index ca4bd862033c..af54114b8f08 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c | |||
@@ -551,6 +551,24 @@ static struct clk usb_dc_ck7xx = { | |||
551 | .enable_bit = SOFT_USB_OTG_DPLL_REQ_SHIFT, | 551 | .enable_bit = SOFT_USB_OTG_DPLL_REQ_SHIFT, |
552 | }; | 552 | }; |
553 | 553 | ||
554 | static struct clk uart1_7xx = { | ||
555 | .name = "uart1_ck", | ||
556 | .ops = &clkops_generic, | ||
557 | /* Direct from ULPD, no parent */ | ||
558 | .rate = 12000000, | ||
559 | .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG), | ||
560 | .enable_bit = 9, | ||
561 | }; | ||
562 | |||
563 | static struct clk uart2_7xx = { | ||
564 | .name = "uart2_ck", | ||
565 | .ops = &clkops_generic, | ||
566 | /* Direct from ULPD, no parent */ | ||
567 | .rate = 12000000, | ||
568 | .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG), | ||
569 | .enable_bit = 11, | ||
570 | }; | ||
571 | |||
554 | static struct clk mclk_1510 = { | 572 | static struct clk mclk_1510 = { |
555 | .name = "mclk", | 573 | .name = "mclk", |
556 | .ops = &clkops_generic, | 574 | .ops = &clkops_generic, |
@@ -697,7 +715,9 @@ static struct omap_clk omap_clks[] = { | |||
697 | /* ULPD clocks */ | 715 | /* ULPD clocks */ |
698 | CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310), | 716 | CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310), |
699 | CLK(NULL, "uart1_ck", &uart1_16xx.clk, CK_16XX), | 717 | CLK(NULL, "uart1_ck", &uart1_16xx.clk, CK_16XX), |
718 | CLK(NULL, "uart1_ck", &uart1_7xx, CK_7XX), | ||
700 | CLK(NULL, "uart2_ck", &uart2_ck, CK_16XX | CK_1510 | CK_310), | 719 | CLK(NULL, "uart2_ck", &uart2_ck, CK_16XX | CK_1510 | CK_310), |
720 | CLK(NULL, "uart2_ck", &uart2_7xx, CK_7XX), | ||
701 | CLK(NULL, "uart3_ck", &uart3_1510, CK_1510 | CK_310), | 721 | CLK(NULL, "uart3_ck", &uart3_1510, CK_1510 | CK_310), |
702 | CLK(NULL, "uart3_ck", &uart3_16xx.clk, CK_16XX), | 722 | CLK(NULL, "uart3_ck", &uart3_16xx.clk, CK_16XX), |
703 | CLK(NULL, "usb_clko", &usb_clko, CK_16XX | CK_1510 | CK_310), | 723 | CLK(NULL, "usb_clko", &usb_clko, CK_16XX | CK_1510 | CK_310), |
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index 379100c17639..aa0725608fb1 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c | |||
@@ -63,44 +63,7 @@ static void omap_init_rtc(void) | |||
63 | static inline void omap_init_rtc(void) {} | 63 | static inline void omap_init_rtc(void) {} |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) | ||
67 | |||
68 | #if defined(CONFIG_ARCH_OMAP15XX) | ||
69 | # define OMAP1_MBOX_SIZE 0x23 | ||
70 | # define INT_DSP_MAILBOX1 INT_1510_DSP_MAILBOX1 | ||
71 | #elif defined(CONFIG_ARCH_OMAP16XX) | ||
72 | # define OMAP1_MBOX_SIZE 0x2f | ||
73 | # define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1 | ||
74 | #endif | ||
75 | |||
76 | #define OMAP1_MBOX_BASE OMAP16XX_MAILBOX_BASE | ||
77 | |||
78 | static struct resource mbox_resources[] = { | ||
79 | { | ||
80 | .start = OMAP1_MBOX_BASE, | ||
81 | .end = OMAP1_MBOX_BASE + OMAP1_MBOX_SIZE, | ||
82 | .flags = IORESOURCE_MEM, | ||
83 | }, | ||
84 | { | ||
85 | .start = INT_DSP_MAILBOX1, | ||
86 | .flags = IORESOURCE_IRQ, | ||
87 | }, | ||
88 | }; | ||
89 | |||
90 | static struct platform_device mbox_device = { | ||
91 | .name = "omap1-mailbox", | ||
92 | .id = -1, | ||
93 | .num_resources = ARRAY_SIZE(mbox_resources), | ||
94 | .resource = mbox_resources, | ||
95 | }; | ||
96 | |||
97 | static inline void omap_init_mbox(void) | ||
98 | { | ||
99 | platform_device_register(&mbox_device); | ||
100 | } | ||
101 | #else | ||
102 | static inline void omap_init_mbox(void) { } | 66 | static inline void omap_init_mbox(void) { } |
103 | #endif | ||
104 | 67 | ||
105 | /*-------------------------------------------------------------------------*/ | 68 | /*-------------------------------------------------------------------------*/ |
106 | 69 | ||
@@ -230,42 +193,7 @@ static inline void omap_init_spi100k(void) | |||
230 | 193 | ||
231 | /*-------------------------------------------------------------------------*/ | 194 | /*-------------------------------------------------------------------------*/ |
232 | 195 | ||
233 | #if defined(CONFIG_OMAP_STI) | ||
234 | |||
235 | #define OMAP1_STI_BASE 0xfffea000 | ||
236 | #define OMAP1_STI_CHANNEL_BASE (OMAP1_STI_BASE + 0x400) | ||
237 | |||
238 | static struct resource sti_resources[] = { | ||
239 | { | ||
240 | .start = OMAP1_STI_BASE, | ||
241 | .end = OMAP1_STI_BASE + SZ_1K - 1, | ||
242 | .flags = IORESOURCE_MEM, | ||
243 | }, | ||
244 | { | ||
245 | .start = OMAP1_STI_CHANNEL_BASE, | ||
246 | .end = OMAP1_STI_CHANNEL_BASE + SZ_1K - 1, | ||
247 | .flags = IORESOURCE_MEM, | ||
248 | }, | ||
249 | { | ||
250 | .start = INT_1610_STI, | ||
251 | .flags = IORESOURCE_IRQ, | ||
252 | } | ||
253 | }; | ||
254 | |||
255 | static struct platform_device sti_device = { | ||
256 | .name = "sti", | ||
257 | .id = -1, | ||
258 | .num_resources = ARRAY_SIZE(sti_resources), | ||
259 | .resource = sti_resources, | ||
260 | }; | ||
261 | |||
262 | static inline void omap_init_sti(void) | ||
263 | { | ||
264 | platform_device_register(&sti_device); | ||
265 | } | ||
266 | #else | ||
267 | static inline void omap_init_sti(void) {} | 196 | static inline void omap_init_sti(void) {} |
268 | #endif | ||
269 | 197 | ||
270 | /*-------------------------------------------------------------------------*/ | 198 | /*-------------------------------------------------------------------------*/ |
271 | 199 | ||
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index e9bdff192f82..b3a796a6da03 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <plat/mux.h> | 23 | #include <plat/mux.h> |
24 | #include <plat/cpu.h> | 24 | #include <plat/cpu.h> |
25 | #include <plat/mcbsp.h> | 25 | #include <plat/mcbsp.h> |
26 | #include <plat/dsp_common.h> | ||
27 | 26 | ||
28 | #define DPS_RSTCT2_PER_EN (1 << 0) | 27 | #define DPS_RSTCT2_PER_EN (1 << 0) |
29 | #define DSP_RSTCT2_WD_PER_EN (1 << 1) | 28 | #define DSP_RSTCT2_WD_PER_EN (1 << 1) |
@@ -46,7 +45,6 @@ static void omap1_mcbsp_request(unsigned int id) | |||
46 | clk_enable(api_clk); | 45 | clk_enable(api_clk); |
47 | clk_enable(dsp_clk); | 46 | clk_enable(dsp_clk); |
48 | 47 | ||
49 | omap_dsp_request_mem(); | ||
50 | /* | 48 | /* |
51 | * DSP external peripheral reset | 49 | * DSP external peripheral reset |
52 | * FIXME: This should be moved to dsp code | 50 | * FIXME: This should be moved to dsp code |
@@ -62,7 +60,6 @@ static void omap1_mcbsp_free(unsigned int id) | |||
62 | { | 60 | { |
63 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { | 61 | if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { |
64 | if (--dsp_use == 0) { | 62 | if (--dsp_use == 0) { |
65 | omap_dsp_release_mem(); | ||
66 | if (!IS_ERR(api_clk)) { | 63 | if (!IS_ERR(api_clk)) { |
67 | clk_disable(api_clk); | 64 | clk_disable(api_clk); |
68 | clk_put(api_clk); | 65 | clk_put(api_clk); |
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c index 84341377232d..7835add00344 100644 --- a/arch/arm/mach-omap1/mux.c +++ b/arch/arm/mach-omap1/mux.c | |||
@@ -70,6 +70,10 @@ MUX_CFG_7XX("SPI_7XX_3", 6, 13, 4, 12, 1, 0) | |||
70 | MUX_CFG_7XX("SPI_7XX_4", 6, 17, 4, 16, 1, 0) | 70 | MUX_CFG_7XX("SPI_7XX_4", 6, 17, 4, 16, 1, 0) |
71 | MUX_CFG_7XX("SPI_7XX_5", 8, 25, 0, 24, 0, 0) | 71 | MUX_CFG_7XX("SPI_7XX_5", 8, 25, 0, 24, 0, 0) |
72 | MUX_CFG_7XX("SPI_7XX_6", 9, 5, 0, 4, 0, 0) | 72 | MUX_CFG_7XX("SPI_7XX_6", 9, 5, 0, 4, 0, 0) |
73 | |||
74 | /* UART pins */ | ||
75 | MUX_CFG_7XX("UART_7XX_1", 3, 21, 0, 20, 0, 0) | ||
76 | MUX_CFG_7XX("UART_7XX_2", 8, 1, 6, 0, 0, 0) | ||
73 | }; | 77 | }; |
74 | #define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins) | 78 | #define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins) |
75 | #else | 79 | #else |
@@ -440,7 +444,7 @@ int __init_or_module omap1_cfg_reg(const struct pin_config *cfg) | |||
440 | } | 444 | } |
441 | #endif | 445 | #endif |
442 | 446 | ||
443 | #ifdef CONFIG_OMAP_MUX_ERRORS | 447 | #ifdef CONFIG_OMAP_MUX_WARNINGS |
444 | return warn ? -ETXTBSY : 0; | 448 | return warn ? -ETXTBSY : 0; |
445 | #else | 449 | #else |
446 | return 0; | 450 | return 0; |
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c index 349de90194e3..b78d0749f13d 100644 --- a/arch/arm/mach-omap1/serial.c +++ b/arch/arm/mach-omap1/serial.c | |||
@@ -122,6 +122,13 @@ void __init omap_serial_init(void) | |||
122 | 122 | ||
123 | for (i = 0; i < ARRAY_SIZE(serial_platform_data) - 1; i++) { | 123 | for (i = 0; i < ARRAY_SIZE(serial_platform_data) - 1; i++) { |
124 | 124 | ||
125 | /* Don't look at UARTs higher than 2 for omap7xx */ | ||
126 | if (cpu_is_omap7xx() && i > 1) { | ||
127 | serial_platform_data[i].membase = NULL; | ||
128 | serial_platform_data[i].mapbase = 0; | ||
129 | continue; | ||
130 | } | ||
131 | |||
125 | /* Static mapping, never released */ | 132 | /* Static mapping, never released */ |
126 | serial_platform_data[i].membase = | 133 | serial_platform_data[i].membase = |
127 | ioremap(serial_platform_data[i].mapbase, SZ_2K); | 134 | ioremap(serial_platform_data[i].mapbase, SZ_2K); |
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c new file mode 100644 index 000000000000..19de03b074e3 --- /dev/null +++ b/arch/arm/mach-omap1/usb.c | |||
@@ -0,0 +1,530 @@ | |||
1 | /* | ||
2 | * Platform level USB initialization for FS USB OTG controller on omap1 and 24xx | ||
3 | * | ||
4 | * Copyright (C) 2004 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/module.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/io.h> | ||
26 | |||
27 | #include <asm/irq.h> | ||
28 | |||
29 | #include <plat/mux.h> | ||
30 | #include <plat/usb.h> | ||
31 | |||
32 | /* These routines should handle the standard chip-specific modes | ||
33 | * for usb0/1/2 ports, covering basic mux and transceiver setup. | ||
34 | * | ||
35 | * Some board-*.c files will need to set up additional mux options, | ||
36 | * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup. | ||
37 | */ | ||
38 | |||
39 | /* TESTED ON: | ||
40 | * - 1611B H2 (with usb1 mini-AB) using standard Mini-B or OTG cables | ||
41 | * - 5912 OSK OHCI (with usb0 standard-A), standard A-to-B cables | ||
42 | * - 5912 OSK UDC, with *nonstandard* A-to-A cable | ||
43 | * - 1510 Innovator UDC with bundled usb0 cable | ||
44 | * - 1510 Innovator OHCI with bundled usb1/usb2 cable | ||
45 | * - 1510 Innovator OHCI with custom usb0 cable, feeding 5V VBUS | ||
46 | * - 1710 custom development board using alternate pin group | ||
47 | * - 1710 H3 (with usb1 mini-AB) using standard Mini-B or OTG cables | ||
48 | */ | ||
49 | |||
50 | #define INT_USB_IRQ_GEN IH2_BASE + 20 | ||
51 | #define INT_USB_IRQ_NISO IH2_BASE + 30 | ||
52 | #define INT_USB_IRQ_ISO IH2_BASE + 29 | ||
53 | #define INT_USB_IRQ_HGEN INT_USB_HHC_1 | ||
54 | #define INT_USB_IRQ_OTG IH2_BASE + 8 | ||
55 | |||
56 | #ifdef CONFIG_USB_GADGET_OMAP | ||
57 | |||
58 | static struct resource udc_resources[] = { | ||
59 | /* order is significant! */ | ||
60 | { /* registers */ | ||
61 | .start = UDC_BASE, | ||
62 | .end = UDC_BASE + 0xff, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | }, { /* general IRQ */ | ||
65 | .start = INT_USB_IRQ_GEN, | ||
66 | .flags = IORESOURCE_IRQ, | ||
67 | }, { /* PIO IRQ */ | ||
68 | .start = INT_USB_IRQ_NISO, | ||
69 | .flags = IORESOURCE_IRQ, | ||
70 | }, { /* SOF IRQ */ | ||
71 | .start = INT_USB_IRQ_ISO, | ||
72 | .flags = IORESOURCE_IRQ, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | static u64 udc_dmamask = ~(u32)0; | ||
77 | |||
78 | static struct platform_device udc_device = { | ||
79 | .name = "omap_udc", | ||
80 | .id = -1, | ||
81 | .dev = { | ||
82 | .dma_mask = &udc_dmamask, | ||
83 | .coherent_dma_mask = 0xffffffff, | ||
84 | }, | ||
85 | .num_resources = ARRAY_SIZE(udc_resources), | ||
86 | .resource = udc_resources, | ||
87 | }; | ||
88 | |||
89 | static inline void udc_device_init(struct omap_usb_config *pdata) | ||
90 | { | ||
91 | /* IRQ numbers for omap7xx */ | ||
92 | if(cpu_is_omap7xx()) { | ||
93 | udc_resources[1].start = INT_7XX_USB_GENI; | ||
94 | udc_resources[2].start = INT_7XX_USB_NON_ISO; | ||
95 | udc_resources[3].start = INT_7XX_USB_ISO; | ||
96 | } | ||
97 | pdata->udc_device = &udc_device; | ||
98 | } | ||
99 | |||
100 | #else | ||
101 | |||
102 | static inline void udc_device_init(struct omap_usb_config *pdata) | ||
103 | { | ||
104 | } | ||
105 | |||
106 | #endif | ||
107 | |||
108 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
109 | |||
110 | /* The dmamask must be set for OHCI to work */ | ||
111 | static u64 ohci_dmamask = ~(u32)0; | ||
112 | |||
113 | static struct resource ohci_resources[] = { | ||
114 | { | ||
115 | .start = OMAP_OHCI_BASE, | ||
116 | .end = OMAP_OHCI_BASE + 0xff, | ||
117 | .flags = IORESOURCE_MEM, | ||
118 | }, | ||
119 | { | ||
120 | .start = INT_USB_IRQ_HGEN, | ||
121 | .flags = IORESOURCE_IRQ, | ||
122 | }, | ||
123 | }; | ||
124 | |||
125 | static struct platform_device ohci_device = { | ||
126 | .name = "ohci", | ||
127 | .id = -1, | ||
128 | .dev = { | ||
129 | .dma_mask = &ohci_dmamask, | ||
130 | .coherent_dma_mask = 0xffffffff, | ||
131 | }, | ||
132 | .num_resources = ARRAY_SIZE(ohci_resources), | ||
133 | .resource = ohci_resources, | ||
134 | }; | ||
135 | |||
136 | static inline void ohci_device_init(struct omap_usb_config *pdata) | ||
137 | { | ||
138 | if (cpu_is_omap7xx()) | ||
139 | ohci_resources[1].start = INT_7XX_USB_HHC_1; | ||
140 | pdata->ohci_device = &ohci_device; | ||
141 | } | ||
142 | |||
143 | #else | ||
144 | |||
145 | static inline void ohci_device_init(struct omap_usb_config *pdata) | ||
146 | { | ||
147 | } | ||
148 | |||
149 | #endif | ||
150 | |||
151 | #if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG) | ||
152 | |||
153 | static struct resource otg_resources[] = { | ||
154 | /* order is significant! */ | ||
155 | { | ||
156 | .start = OTG_BASE, | ||
157 | .end = OTG_BASE + 0xff, | ||
158 | .flags = IORESOURCE_MEM, | ||
159 | }, { | ||
160 | .start = INT_USB_IRQ_OTG, | ||
161 | .flags = IORESOURCE_IRQ, | ||
162 | }, | ||
163 | }; | ||
164 | |||
165 | static struct platform_device otg_device = { | ||
166 | .name = "omap_otg", | ||
167 | .id = -1, | ||
168 | .num_resources = ARRAY_SIZE(otg_resources), | ||
169 | .resource = otg_resources, | ||
170 | }; | ||
171 | |||
172 | static inline void otg_device_init(struct omap_usb_config *pdata) | ||
173 | { | ||
174 | if (cpu_is_omap7xx()) | ||
175 | otg_resources[1].start = INT_7XX_USB_OTG; | ||
176 | pdata->otg_device = &otg_device; | ||
177 | } | ||
178 | |||
179 | #else | ||
180 | |||
181 | static inline void otg_device_init(struct omap_usb_config *pdata) | ||
182 | { | ||
183 | } | ||
184 | |||
185 | #endif | ||
186 | |||
187 | u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device) | ||
188 | { | ||
189 | u32 syscon1 = 0; | ||
190 | |||
191 | if (nwires == 0) { | ||
192 | if (!cpu_is_omap15xx()) { | ||
193 | u32 l; | ||
194 | |||
195 | /* pulldown D+/D- */ | ||
196 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
197 | l &= ~(3 << 1); | ||
198 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
199 | } | ||
200 | return 0; | ||
201 | } | ||
202 | |||
203 | if (is_device) { | ||
204 | if (cpu_is_omap7xx()) { | ||
205 | omap_cfg_reg(AA17_7XX_USB_DM); | ||
206 | omap_cfg_reg(W16_7XX_USB_PU_EN); | ||
207 | omap_cfg_reg(W17_7XX_USB_VBUSI); | ||
208 | omap_cfg_reg(W18_7XX_USB_DMCK_OUT); | ||
209 | omap_cfg_reg(W19_7XX_USB_DCRST); | ||
210 | } else | ||
211 | omap_cfg_reg(W4_USB_PUEN); | ||
212 | } | ||
213 | |||
214 | if (nwires == 2) { | ||
215 | u32 l; | ||
216 | |||
217 | // omap_cfg_reg(P9_USB_DP); | ||
218 | // omap_cfg_reg(R8_USB_DM); | ||
219 | |||
220 | if (cpu_is_omap15xx()) { | ||
221 | /* This works on 1510-Innovator */ | ||
222 | return 0; | ||
223 | } | ||
224 | |||
225 | /* NOTES: | ||
226 | * - peripheral should configure VBUS detection! | ||
227 | * - only peripherals may use the internal D+/D- pulldowns | ||
228 | * - OTG support on this port not yet written | ||
229 | */ | ||
230 | |||
231 | /* Don't do this for omap7xx -- it causes USB to not work correctly */ | ||
232 | if (!cpu_is_omap7xx()) { | ||
233 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
234 | l &= ~(7 << 4); | ||
235 | if (!is_device) | ||
236 | l |= (3 << 1); | ||
237 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
238 | } | ||
239 | |||
240 | return 3 << 16; | ||
241 | } | ||
242 | |||
243 | /* alternate pin config, external transceiver */ | ||
244 | if (cpu_is_omap15xx()) { | ||
245 | printk(KERN_ERR "no usb0 alt pin config on 15xx\n"); | ||
246 | return 0; | ||
247 | } | ||
248 | |||
249 | omap_cfg_reg(V6_USB0_TXD); | ||
250 | omap_cfg_reg(W9_USB0_TXEN); | ||
251 | omap_cfg_reg(W5_USB0_SE0); | ||
252 | if (nwires != 3) | ||
253 | omap_cfg_reg(Y5_USB0_RCV); | ||
254 | |||
255 | /* NOTE: SPEED and SUSP aren't configured here. OTG hosts | ||
256 | * may be able to use I2C requests to set those bits along | ||
257 | * with VBUS switching and overcurrent detection. | ||
258 | */ | ||
259 | |||
260 | if (nwires != 6) { | ||
261 | u32 l; | ||
262 | |||
263 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
264 | l &= ~CONF_USB2_UNI_R; | ||
265 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
266 | } | ||
267 | |||
268 | switch (nwires) { | ||
269 | case 3: | ||
270 | syscon1 = 2; | ||
271 | break; | ||
272 | case 4: | ||
273 | syscon1 = 1; | ||
274 | break; | ||
275 | case 6: | ||
276 | syscon1 = 3; | ||
277 | { | ||
278 | u32 l; | ||
279 | |||
280 | omap_cfg_reg(AA9_USB0_VP); | ||
281 | omap_cfg_reg(R9_USB0_VM); | ||
282 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
283 | l |= CONF_USB2_UNI_R; | ||
284 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
285 | } | ||
286 | break; | ||
287 | default: | ||
288 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
289 | 0, nwires); | ||
290 | } | ||
291 | |||
292 | return syscon1 << 16; | ||
293 | } | ||
294 | |||
295 | u32 __init omap1_usb1_init(unsigned nwires) | ||
296 | { | ||
297 | u32 syscon1 = 0; | ||
298 | |||
299 | if (!cpu_is_omap15xx() && nwires != 6) { | ||
300 | u32 l; | ||
301 | |||
302 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
303 | l &= ~CONF_USB1_UNI_R; | ||
304 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
305 | } | ||
306 | if (nwires == 0) | ||
307 | return 0; | ||
308 | |||
309 | /* external transceiver */ | ||
310 | omap_cfg_reg(USB1_TXD); | ||
311 | omap_cfg_reg(USB1_TXEN); | ||
312 | if (nwires != 3) | ||
313 | omap_cfg_reg(USB1_RCV); | ||
314 | |||
315 | if (cpu_is_omap15xx()) { | ||
316 | omap_cfg_reg(USB1_SEO); | ||
317 | omap_cfg_reg(USB1_SPEED); | ||
318 | // SUSP | ||
319 | } else if (cpu_is_omap1610() || cpu_is_omap5912()) { | ||
320 | omap_cfg_reg(W13_1610_USB1_SE0); | ||
321 | omap_cfg_reg(R13_1610_USB1_SPEED); | ||
322 | // SUSP | ||
323 | } else if (cpu_is_omap1710()) { | ||
324 | omap_cfg_reg(R13_1710_USB1_SE0); | ||
325 | // SUSP | ||
326 | } else { | ||
327 | pr_debug("usb%d cpu unrecognized\n", 1); | ||
328 | return 0; | ||
329 | } | ||
330 | |||
331 | switch (nwires) { | ||
332 | case 2: | ||
333 | goto bad; | ||
334 | case 3: | ||
335 | syscon1 = 2; | ||
336 | break; | ||
337 | case 4: | ||
338 | syscon1 = 1; | ||
339 | break; | ||
340 | case 6: | ||
341 | syscon1 = 3; | ||
342 | omap_cfg_reg(USB1_VP); | ||
343 | omap_cfg_reg(USB1_VM); | ||
344 | if (!cpu_is_omap15xx()) { | ||
345 | u32 l; | ||
346 | |||
347 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
348 | l |= CONF_USB1_UNI_R; | ||
349 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
350 | } | ||
351 | break; | ||
352 | default: | ||
353 | bad: | ||
354 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
355 | 1, nwires); | ||
356 | } | ||
357 | |||
358 | return syscon1 << 20; | ||
359 | } | ||
360 | |||
361 | u32 __init omap1_usb2_init(unsigned nwires, unsigned alt_pingroup) | ||
362 | { | ||
363 | u32 syscon1 = 0; | ||
364 | |||
365 | /* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */ | ||
366 | if (alt_pingroup || nwires == 0) | ||
367 | return 0; | ||
368 | |||
369 | if (!cpu_is_omap15xx() && nwires != 6) { | ||
370 | u32 l; | ||
371 | |||
372 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
373 | l &= ~CONF_USB2_UNI_R; | ||
374 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
375 | } | ||
376 | |||
377 | /* external transceiver */ | ||
378 | if (cpu_is_omap15xx()) { | ||
379 | omap_cfg_reg(USB2_TXD); | ||
380 | omap_cfg_reg(USB2_TXEN); | ||
381 | omap_cfg_reg(USB2_SEO); | ||
382 | if (nwires != 3) | ||
383 | omap_cfg_reg(USB2_RCV); | ||
384 | /* there is no USB2_SPEED */ | ||
385 | } else if (cpu_is_omap16xx()) { | ||
386 | omap_cfg_reg(V6_USB2_TXD); | ||
387 | omap_cfg_reg(W9_USB2_TXEN); | ||
388 | omap_cfg_reg(W5_USB2_SE0); | ||
389 | if (nwires != 3) | ||
390 | omap_cfg_reg(Y5_USB2_RCV); | ||
391 | // FIXME omap_cfg_reg(USB2_SPEED); | ||
392 | } else { | ||
393 | pr_debug("usb%d cpu unrecognized\n", 1); | ||
394 | return 0; | ||
395 | } | ||
396 | |||
397 | // omap_cfg_reg(USB2_SUSP); | ||
398 | |||
399 | switch (nwires) { | ||
400 | case 2: | ||
401 | goto bad; | ||
402 | case 3: | ||
403 | syscon1 = 2; | ||
404 | break; | ||
405 | case 4: | ||
406 | syscon1 = 1; | ||
407 | break; | ||
408 | case 5: | ||
409 | goto bad; | ||
410 | case 6: | ||
411 | syscon1 = 3; | ||
412 | if (cpu_is_omap15xx()) { | ||
413 | omap_cfg_reg(USB2_VP); | ||
414 | omap_cfg_reg(USB2_VM); | ||
415 | } else { | ||
416 | u32 l; | ||
417 | |||
418 | omap_cfg_reg(AA9_USB2_VP); | ||
419 | omap_cfg_reg(R9_USB2_VM); | ||
420 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
421 | l |= CONF_USB2_UNI_R; | ||
422 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
423 | } | ||
424 | break; | ||
425 | default: | ||
426 | bad: | ||
427 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
428 | 2, nwires); | ||
429 | } | ||
430 | |||
431 | return syscon1 << 24; | ||
432 | } | ||
433 | |||
434 | #ifdef CONFIG_ARCH_OMAP15XX | ||
435 | |||
436 | /* ULPD_DPLL_CTRL */ | ||
437 | #define DPLL_IOB (1 << 13) | ||
438 | #define DPLL_PLL_ENABLE (1 << 4) | ||
439 | #define DPLL_LOCK (1 << 0) | ||
440 | |||
441 | /* ULPD_APLL_CTRL */ | ||
442 | #define APLL_NDPLL_SWITCH (1 << 0) | ||
443 | |||
444 | static void __init omap_1510_usb_init(struct omap_usb_config *config) | ||
445 | { | ||
446 | unsigned int val; | ||
447 | u16 w; | ||
448 | |||
449 | config->usb0_init(config->pins[0], is_usb0_device(config)); | ||
450 | config->usb1_init(config->pins[1]); | ||
451 | config->usb2_init(config->pins[2], 0); | ||
452 | |||
453 | val = omap_readl(MOD_CONF_CTRL_0) & ~(0x3f << 1); | ||
454 | val |= (config->hmc_mode << 1); | ||
455 | omap_writel(val, MOD_CONF_CTRL_0); | ||
456 | |||
457 | printk("USB: hmc %d", config->hmc_mode); | ||
458 | if (config->pins[0]) | ||
459 | printk(", usb0 %d wires%s", config->pins[0], | ||
460 | is_usb0_device(config) ? " (dev)" : ""); | ||
461 | if (config->pins[1]) | ||
462 | printk(", usb1 %d wires", config->pins[1]); | ||
463 | if (config->pins[2]) | ||
464 | printk(", usb2 %d wires", config->pins[2]); | ||
465 | printk("\n"); | ||
466 | |||
467 | /* use DPLL for 48 MHz function clock */ | ||
468 | pr_debug("APLL %04x DPLL %04x REQ %04x\n", omap_readw(ULPD_APLL_CTRL), | ||
469 | omap_readw(ULPD_DPLL_CTRL), omap_readw(ULPD_SOFT_REQ)); | ||
470 | |||
471 | w = omap_readw(ULPD_APLL_CTRL); | ||
472 | w &= ~APLL_NDPLL_SWITCH; | ||
473 | omap_writew(w, ULPD_APLL_CTRL); | ||
474 | |||
475 | w = omap_readw(ULPD_DPLL_CTRL); | ||
476 | w |= DPLL_IOB | DPLL_PLL_ENABLE; | ||
477 | omap_writew(w, ULPD_DPLL_CTRL); | ||
478 | |||
479 | w = omap_readw(ULPD_SOFT_REQ); | ||
480 | w |= SOFT_UDC_REQ | SOFT_DPLL_REQ; | ||
481 | omap_writew(w, ULPD_SOFT_REQ); | ||
482 | |||
483 | while (!(omap_readw(ULPD_DPLL_CTRL) & DPLL_LOCK)) | ||
484 | cpu_relax(); | ||
485 | |||
486 | #ifdef CONFIG_USB_GADGET_OMAP | ||
487 | if (config->register_dev) { | ||
488 | int status; | ||
489 | |||
490 | udc_device.dev.platform_data = config; | ||
491 | status = platform_device_register(&udc_device); | ||
492 | if (status) | ||
493 | pr_debug("can't register UDC device, %d\n", status); | ||
494 | /* udc driver gates 48MHz by D+ pullup */ | ||
495 | } | ||
496 | #endif | ||
497 | |||
498 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
499 | if (config->register_host) { | ||
500 | int status; | ||
501 | |||
502 | ohci_device.dev.platform_data = config; | ||
503 | status = platform_device_register(&ohci_device); | ||
504 | if (status) | ||
505 | pr_debug("can't register OHCI device, %d\n", status); | ||
506 | /* hcd explicitly gates 48MHz */ | ||
507 | } | ||
508 | #endif | ||
509 | } | ||
510 | |||
511 | #else | ||
512 | static inline void omap_1510_usb_init(struct omap_usb_config *config) {} | ||
513 | #endif | ||
514 | |||
515 | void __init omap1_usb_init(struct omap_usb_config *pdata) | ||
516 | { | ||
517 | pdata->usb0_init = omap1_usb0_init; | ||
518 | pdata->usb1_init = omap1_usb1_init; | ||
519 | pdata->usb2_init = omap1_usb2_init; | ||
520 | udc_device_init(pdata); | ||
521 | ohci_device_init(pdata); | ||
522 | otg_device_init(pdata); | ||
523 | |||
524 | if (cpu_is_omap7xx() || cpu_is_omap16xx()) | ||
525 | omap_otg_init(pdata); | ||
526 | else if (cpu_is_omap15xx()) | ||
527 | omap_1510_usb_init(pdata); | ||
528 | else | ||
529 | printk(KERN_ERR "USB: No init for your chip yet\n"); | ||
530 | } | ||
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index b31b6f123122..b48bacf0a7aa 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -1,22 +1,77 @@ | |||
1 | if ARCH_OMAP2PLUS | ||
2 | |||
3 | menu "TI OMAP2/3/4 Specific Features" | ||
4 | |||
5 | config ARCH_OMAP2PLUS_TYPICAL | ||
6 | bool "Typical OMAP configuration" | ||
7 | default y | ||
8 | select AEABI | ||
9 | select REGULATOR | ||
10 | select PM | ||
11 | select PM_RUNTIME | ||
12 | select VFP | ||
13 | select NEON if ARCH_OMAP3 || ARCH_OMAP4 | ||
14 | select SERIAL_8250 | ||
15 | select SERIAL_CORE_CONSOLE | ||
16 | select SERIAL_8250_CONSOLE | ||
17 | select I2C | ||
18 | select I2C_OMAP | ||
19 | select MFD | ||
20 | select MENELAUS if ARCH_OMAP2 | ||
21 | select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4 | ||
22 | select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4 | ||
23 | help | ||
24 | Compile a kernel suitable for booting most boards | ||
25 | |||
26 | config ARCH_OMAP2 | ||
27 | bool "TI OMAP2" | ||
28 | depends on ARCH_OMAP2PLUS | ||
29 | default y | ||
30 | select CPU_V6 | ||
31 | |||
32 | config ARCH_OMAP3 | ||
33 | bool "TI OMAP3" | ||
34 | depends on ARCH_OMAP2PLUS | ||
35 | default y | ||
36 | select CPU_V7 | ||
37 | select USB_ARCH_HAS_EHCI | ||
38 | select ARM_L1_CACHE_SHIFT_6 | ||
39 | |||
40 | config ARCH_OMAP4 | ||
41 | bool "TI OMAP4" | ||
42 | default y | ||
43 | depends on ARCH_OMAP2PLUS | ||
44 | select CPU_V7 | ||
45 | select ARM_GIC | ||
46 | |||
1 | comment "OMAP Core Type" | 47 | comment "OMAP Core Type" |
2 | depends on ARCH_OMAP2 | 48 | depends on ARCH_OMAP2 |
3 | 49 | ||
4 | config ARCH_OMAP2420 | 50 | config ARCH_OMAP2420 |
5 | bool "OMAP2420 support" | 51 | bool "OMAP2420 support" |
6 | depends on ARCH_OMAP2 | 52 | depends on ARCH_OMAP2 |
53 | default y | ||
7 | select OMAP_DM_TIMER | 54 | select OMAP_DM_TIMER |
8 | select ARCH_OMAP_OTG | 55 | select ARCH_OMAP_OTG |
9 | 56 | ||
10 | config ARCH_OMAP2430 | 57 | config ARCH_OMAP2430 |
11 | bool "OMAP2430 support" | 58 | bool "OMAP2430 support" |
12 | depends on ARCH_OMAP2 | 59 | depends on ARCH_OMAP2 |
60 | default y | ||
13 | select ARCH_OMAP_OTG | 61 | select ARCH_OMAP_OTG |
14 | 62 | ||
15 | config ARCH_OMAP3430 | 63 | config ARCH_OMAP3430 |
16 | bool "OMAP3430 support" | 64 | bool "OMAP3430 support" |
17 | depends on ARCH_OMAP3 | 65 | depends on ARCH_OMAP3 |
66 | default y | ||
18 | select ARCH_OMAP_OTG | 67 | select ARCH_OMAP_OTG |
19 | 68 | ||
69 | config OMAP_PACKAGE_ZAF | ||
70 | bool | ||
71 | |||
72 | config OMAP_PACKAGE_ZAC | ||
73 | bool | ||
74 | |||
20 | config OMAP_PACKAGE_CBC | 75 | config OMAP_PACKAGE_CBC |
21 | bool | 76 | bool |
22 | 77 | ||
@@ -35,6 +90,7 @@ comment "OMAP Board Type" | |||
35 | config MACH_OMAP_GENERIC | 90 | config MACH_OMAP_GENERIC |
36 | bool "Generic OMAP board" | 91 | bool "Generic OMAP board" |
37 | depends on ARCH_OMAP2 | 92 | depends on ARCH_OMAP2 |
93 | default y | ||
38 | 94 | ||
39 | config MACH_OMAP2_TUSB6010 | 95 | config MACH_OMAP2_TUSB6010 |
40 | bool | 96 | bool |
@@ -44,60 +100,75 @@ config MACH_OMAP2_TUSB6010 | |||
44 | config MACH_OMAP_H4 | 100 | config MACH_OMAP_H4 |
45 | bool "OMAP 2420 H4 board" | 101 | bool "OMAP 2420 H4 board" |
46 | depends on ARCH_OMAP2 | 102 | depends on ARCH_OMAP2 |
103 | default y | ||
104 | select OMAP_PACKAGE_ZAF | ||
47 | select OMAP_DEBUG_DEVICES | 105 | select OMAP_DEBUG_DEVICES |
48 | 106 | ||
49 | config MACH_OMAP_APOLLON | 107 | config MACH_OMAP_APOLLON |
50 | bool "OMAP 2420 Apollon board" | 108 | bool "OMAP 2420 Apollon board" |
51 | depends on ARCH_OMAP2 | 109 | depends on ARCH_OMAP2 |
110 | default y | ||
111 | select OMAP_PACKAGE_ZAC | ||
52 | 112 | ||
53 | config MACH_OMAP_2430SDP | 113 | config MACH_OMAP_2430SDP |
54 | bool "OMAP 2430 SDP board" | 114 | bool "OMAP 2430 SDP board" |
55 | depends on ARCH_OMAP2 | 115 | depends on ARCH_OMAP2 |
116 | default y | ||
117 | select OMAP_PACKAGE_ZAC | ||
56 | 118 | ||
57 | config MACH_OMAP3_BEAGLE | 119 | config MACH_OMAP3_BEAGLE |
58 | bool "OMAP3 BEAGLE board" | 120 | bool "OMAP3 BEAGLE board" |
59 | depends on ARCH_OMAP3 | 121 | depends on ARCH_OMAP3 |
122 | default y | ||
60 | select OMAP_PACKAGE_CBB | 123 | select OMAP_PACKAGE_CBB |
61 | 124 | ||
62 | config MACH_DEVKIT8000 | 125 | config MACH_DEVKIT8000 |
63 | bool "DEVKIT8000 board" | 126 | bool "DEVKIT8000 board" |
64 | depends on ARCH_OMAP3 | 127 | depends on ARCH_OMAP3 |
128 | default y | ||
65 | select OMAP_PACKAGE_CUS | 129 | select OMAP_PACKAGE_CUS |
66 | select OMAP_MUX | 130 | select OMAP_MUX |
67 | 131 | ||
68 | config MACH_OMAP_LDP | 132 | config MACH_OMAP_LDP |
69 | bool "OMAP3 LDP board" | 133 | bool "OMAP3 LDP board" |
70 | depends on ARCH_OMAP3 | 134 | depends on ARCH_OMAP3 |
135 | default y | ||
71 | select OMAP_PACKAGE_CBB | 136 | select OMAP_PACKAGE_CBB |
72 | 137 | ||
73 | config MACH_OVERO | 138 | config MACH_OVERO |
74 | bool "Gumstix Overo board" | 139 | bool "Gumstix Overo board" |
75 | depends on ARCH_OMAP3 | 140 | depends on ARCH_OMAP3 |
141 | default y | ||
76 | select OMAP_PACKAGE_CBB | 142 | select OMAP_PACKAGE_CBB |
77 | 143 | ||
78 | config MACH_OMAP3EVM | 144 | config MACH_OMAP3EVM |
79 | bool "OMAP 3530 EVM board" | 145 | bool "OMAP 3530 EVM board" |
80 | depends on ARCH_OMAP3 | 146 | depends on ARCH_OMAP3 |
147 | default y | ||
81 | select OMAP_PACKAGE_CBB | 148 | select OMAP_PACKAGE_CBB |
82 | 149 | ||
83 | config MACH_OMAP3517EVM | 150 | config MACH_OMAP3517EVM |
84 | bool "OMAP3517/ AM3517 EVM board" | 151 | bool "OMAP3517/ AM3517 EVM board" |
85 | depends on ARCH_OMAP3 | 152 | depends on ARCH_OMAP3 |
153 | default y | ||
86 | select OMAP_PACKAGE_CBB | 154 | select OMAP_PACKAGE_CBB |
87 | 155 | ||
88 | config MACH_OMAP3_PANDORA | 156 | config MACH_OMAP3_PANDORA |
89 | bool "OMAP3 Pandora" | 157 | bool "OMAP3 Pandora" |
90 | depends on ARCH_OMAP3 | 158 | depends on ARCH_OMAP3 |
159 | default y | ||
91 | select OMAP_PACKAGE_CBB | 160 | select OMAP_PACKAGE_CBB |
92 | 161 | ||
93 | config MACH_OMAP3_TOUCHBOOK | 162 | config MACH_OMAP3_TOUCHBOOK |
94 | bool "OMAP3 Touch Book" | 163 | bool "OMAP3 Touch Book" |
95 | depends on ARCH_OMAP3 | 164 | depends on ARCH_OMAP3 |
165 | default y | ||
96 | select BACKLIGHT_CLASS_DEVICE | 166 | select BACKLIGHT_CLASS_DEVICE |
97 | 167 | ||
98 | config MACH_OMAP_3430SDP | 168 | config MACH_OMAP_3430SDP |
99 | bool "OMAP 3430 SDP board" | 169 | bool "OMAP 3430 SDP board" |
100 | depends on ARCH_OMAP3 | 170 | depends on ARCH_OMAP3 |
171 | default y | ||
101 | select OMAP_PACKAGE_CBB | 172 | select OMAP_PACKAGE_CBB |
102 | 173 | ||
103 | config MACH_NOKIA_N800 | 174 | config MACH_NOKIA_N800 |
@@ -112,6 +183,8 @@ config MACH_NOKIA_N810_WIMAX | |||
112 | config MACH_NOKIA_N8X0 | 183 | config MACH_NOKIA_N8X0 |
113 | bool "Nokia N800/N810" | 184 | bool "Nokia N800/N810" |
114 | depends on ARCH_OMAP2420 | 185 | depends on ARCH_OMAP2420 |
186 | default y | ||
187 | select OMAP_PACKAGE_ZAC | ||
115 | select MACH_NOKIA_N800 | 188 | select MACH_NOKIA_N800 |
116 | select MACH_NOKIA_N810 | 189 | select MACH_NOKIA_N810 |
117 | select MACH_NOKIA_N810_WIMAX | 190 | select MACH_NOKIA_N810_WIMAX |
@@ -119,42 +192,55 @@ config MACH_NOKIA_N8X0 | |||
119 | config MACH_NOKIA_RX51 | 192 | config MACH_NOKIA_RX51 |
120 | bool "Nokia RX-51 board" | 193 | bool "Nokia RX-51 board" |
121 | depends on ARCH_OMAP3 | 194 | depends on ARCH_OMAP3 |
195 | default y | ||
122 | select OMAP_PACKAGE_CBB | 196 | select OMAP_PACKAGE_CBB |
123 | 197 | ||
124 | config MACH_OMAP_ZOOM2 | 198 | config MACH_OMAP_ZOOM2 |
125 | bool "OMAP3 Zoom2 board" | 199 | bool "OMAP3 Zoom2 board" |
126 | depends on ARCH_OMAP3 | 200 | depends on ARCH_OMAP3 |
201 | default y | ||
127 | select OMAP_PACKAGE_CBB | 202 | select OMAP_PACKAGE_CBB |
128 | 203 | ||
129 | config MACH_OMAP_ZOOM3 | 204 | config MACH_OMAP_ZOOM3 |
130 | bool "OMAP3630 Zoom3 board" | 205 | bool "OMAP3630 Zoom3 board" |
131 | depends on ARCH_OMAP3 | 206 | depends on ARCH_OMAP3 |
207 | default y | ||
132 | select OMAP_PACKAGE_CBP | 208 | select OMAP_PACKAGE_CBP |
133 | 209 | ||
134 | config MACH_CM_T35 | 210 | config MACH_CM_T35 |
135 | bool "CompuLab CM-T35 module" | 211 | bool "CompuLab CM-T35 module" |
136 | depends on ARCH_OMAP3 | 212 | depends on ARCH_OMAP3 |
213 | default y | ||
137 | select OMAP_PACKAGE_CUS | 214 | select OMAP_PACKAGE_CUS |
138 | select OMAP_MUX | 215 | select OMAP_MUX |
139 | 216 | ||
140 | config MACH_IGEP0020 | 217 | config MACH_IGEP0020 |
141 | bool "IGEP v2 board" | 218 | bool "IGEP v2 board" |
142 | depends on ARCH_OMAP3 | 219 | depends on ARCH_OMAP3 |
220 | default y | ||
143 | select OMAP_PACKAGE_CBB | 221 | select OMAP_PACKAGE_CBB |
144 | 222 | ||
145 | config MACH_SBC3530 | 223 | config MACH_SBC3530 |
146 | bool "OMAP3 SBC STALKER board" | 224 | bool "OMAP3 SBC STALKER board" |
147 | depends on ARCH_OMAP3 | 225 | depends on ARCH_OMAP3 |
226 | default y | ||
148 | select OMAP_PACKAGE_CUS | 227 | select OMAP_PACKAGE_CUS |
149 | select OMAP_MUX | 228 | select OMAP_MUX |
150 | 229 | ||
151 | config MACH_OMAP_3630SDP | 230 | config MACH_OMAP_3630SDP |
152 | bool "OMAP3630 SDP board" | 231 | bool "OMAP3630 SDP board" |
153 | depends on ARCH_OMAP3 | 232 | depends on ARCH_OMAP3 |
233 | default y | ||
154 | select OMAP_PACKAGE_CBP | 234 | select OMAP_PACKAGE_CBP |
155 | 235 | ||
156 | config MACH_OMAP_4430SDP | 236 | config MACH_OMAP_4430SDP |
157 | bool "OMAP 4430 SDP board" | 237 | bool "OMAP 4430 SDP board" |
238 | default y | ||
239 | depends on ARCH_OMAP4 | ||
240 | |||
241 | config MACH_OMAP4_PANDA | ||
242 | bool "OMAP4 Panda Board" | ||
243 | default y | ||
158 | depends on ARCH_OMAP4 | 244 | depends on ARCH_OMAP4 |
159 | 245 | ||
160 | config OMAP3_EMU | 246 | config OMAP3_EMU |
@@ -176,3 +262,6 @@ config OMAP3_SDRC_AC_TIMING | |||
176 | wish to say no. Selecting yes without understanding what is | 262 | wish to say no. Selecting yes without understanding what is |
177 | going on could result in system crashes; | 263 | going on could result in system crashes; |
178 | 264 | ||
265 | endmenu | ||
266 | |||
267 | endif | ||
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index d54389674486..63b2d8859c3c 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -22,6 +22,7 @@ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | |||
22 | # SMP support ONLY available for OMAP4 | 22 | # SMP support ONLY available for OMAP4 |
23 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o | 23 | obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o |
24 | obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o | 24 | obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o |
25 | obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o | ||
25 | obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o | 26 | obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o |
26 | 27 | ||
27 | AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a | 28 | AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a |
@@ -36,6 +37,8 @@ AFLAGS_sram243x.o :=-Wa,-march=armv6 | |||
36 | AFLAGS_sram34xx.o :=-Wa,-march=armv7-a | 37 | AFLAGS_sram34xx.o :=-Wa,-march=armv7-a |
37 | 38 | ||
38 | # Pin multiplexing | 39 | # Pin multiplexing |
40 | obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o | ||
41 | obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o | ||
39 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o | 42 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o |
40 | 43 | ||
41 | # SMS/SDRC | 44 | # SMS/SDRC |
@@ -47,6 +50,7 @@ ifeq ($(CONFIG_PM),y) | |||
47 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o | 50 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o |
48 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o | 51 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o |
49 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o | 52 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o |
53 | obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o | ||
50 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o | 54 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o |
51 | 55 | ||
52 | AFLAGS_sleep24xx.o :=-Wa,-march=armv6 | 56 | AFLAGS_sleep24xx.o :=-Wa,-march=armv6 |
@@ -89,7 +93,10 @@ obj-$(CONFIG_OMAP3_EMU) += emu.o | |||
89 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o | 93 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o |
90 | mailbox_mach-objs := mailbox.o | 94 | mailbox_mach-objs := mailbox.o |
91 | 95 | ||
92 | obj-$(CONFIG_OMAP_IOMMU) := iommu2.o omap-iommu.o | 96 | obj-$(CONFIG_OMAP_IOMMU) += iommu2.o |
97 | |||
98 | iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o | ||
99 | obj-y += $(iommu-m) $(iommu-y) | ||
93 | 100 | ||
94 | i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o | 101 | i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o |
95 | obj-y += $(i2c-omap-m) $(i2c-omap-y) | 102 | obj-y += $(i2c-omap-m) $(i2c-omap-y) |
@@ -105,6 +112,7 @@ obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \ | |||
105 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o \ | 112 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o \ |
106 | hsmmc.o | 113 | hsmmc.o |
107 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ | 114 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ |
115 | board-flash.o \ | ||
108 | hsmmc.o | 116 | hsmmc.o |
109 | obj-$(CONFIG_MACH_OVERO) += board-overo.o \ | 117 | obj-$(CONFIG_MACH_OVERO) += board-overo.o \ |
110 | hsmmc.o | 118 | hsmmc.o |
@@ -114,7 +122,7 @@ obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ | |||
114 | hsmmc.o | 122 | hsmmc.o |
115 | obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ | 123 | obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ |
116 | hsmmc.o \ | 124 | hsmmc.o \ |
117 | board-sdp-flash.o | 125 | board-flash.o |
118 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o | 126 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o |
119 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ | 127 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ |
120 | board-rx51-sdram.o \ | 128 | board-rx51-sdram.o \ |
@@ -123,14 +131,17 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ | |||
123 | hsmmc.o | 131 | hsmmc.o |
124 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ | 132 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ |
125 | board-zoom-peripherals.o \ | 133 | board-zoom-peripherals.o \ |
134 | board-flash.o \ | ||
126 | hsmmc.o \ | 135 | hsmmc.o \ |
127 | board-zoom-debugboard.o | 136 | board-zoom-debugboard.o |
128 | obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \ | 137 | obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \ |
129 | board-zoom-peripherals.o \ | 138 | board-zoom-peripherals.o \ |
139 | board-flash.o \ | ||
130 | hsmmc.o \ | 140 | hsmmc.o \ |
131 | board-zoom-debugboard.o | 141 | board-zoom-debugboard.o |
132 | obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \ | 142 | obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \ |
133 | board-zoom-peripherals.o \ | 143 | board-zoom-peripherals.o \ |
144 | board-flash.o \ | ||
134 | hsmmc.o | 145 | hsmmc.o |
135 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ | 146 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ |
136 | hsmmc.o | 147 | hsmmc.o |
@@ -140,12 +151,16 @@ obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \ | |||
140 | hsmmc.o | 151 | hsmmc.o |
141 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ | 152 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ |
142 | hsmmc.o | 153 | hsmmc.o |
154 | obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ | ||
155 | hsmmc.o | ||
143 | 156 | ||
144 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o | 157 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o |
145 | 158 | ||
146 | obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ | 159 | obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ |
147 | hsmmc.o | 160 | hsmmc.o |
148 | # Platform specific device init code | 161 | # Platform specific device init code |
162 | usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o | ||
163 | obj-y += $(usbfs-m) $(usbfs-y) | ||
149 | obj-y += usb-musb.o | 164 | obj-y += usb-musb.o |
150 | obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o | 165 | obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o |
151 | obj-y += usb-ehci.o | 166 | obj-y += usb-ehci.o |
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index a11a575745e4..ba188cf7d09d 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -31,13 +31,13 @@ | |||
31 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
32 | 32 | ||
33 | #include <mach/gpio.h> | 33 | #include <mach/gpio.h> |
34 | #include <plat/mux.h> | ||
35 | #include <plat/board.h> | 34 | #include <plat/board.h> |
36 | #include <plat/common.h> | 35 | #include <plat/common.h> |
37 | #include <plat/gpmc.h> | 36 | #include <plat/gpmc.h> |
38 | #include <plat/usb.h> | 37 | #include <plat/usb.h> |
39 | #include <plat/gpmc-smc91x.h> | 38 | #include <plat/gpmc-smc91x.h> |
40 | 39 | ||
40 | #include "mux.h" | ||
41 | #include "hsmmc.h" | 41 | #include "hsmmc.h" |
42 | 42 | ||
43 | #define SDP2430_CS0_BASE 0x04000000 | 43 | #define SDP2430_CS0_BASE 0x04000000 |
@@ -122,11 +122,7 @@ static struct omap_smc91x_platform_data board_smc91x_data = { | |||
122 | 122 | ||
123 | static void __init board_smc91x_init(void) | 123 | static void __init board_smc91x_init(void) |
124 | { | 124 | { |
125 | if (omap_rev() > OMAP3430_REV_ES1_0) | 125 | omap_mux_init_gpio(149, OMAP_PIN_INPUT); |
126 | board_smc91x_data.gpio_irq = 6; | ||
127 | else | ||
128 | board_smc91x_data.gpio_irq = 29; | ||
129 | |||
130 | gpmc_smc91x_init(&board_smc91x_data); | 126 | gpmc_smc91x_init(&board_smc91x_data); |
131 | } | 127 | } |
132 | 128 | ||
@@ -217,17 +213,30 @@ static struct omap_usb_config sdp2430_usb_config __initdata = { | |||
217 | .pins[0] = 3, | 213 | .pins[0] = 3, |
218 | }; | 214 | }; |
219 | 215 | ||
216 | #ifdef CONFIG_OMAP_MUX | ||
217 | static struct omap_board_mux board_mux[] __initdata = { | ||
218 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
219 | }; | ||
220 | #else | ||
221 | #define board_mux NULL | ||
222 | #endif | ||
223 | |||
220 | static void __init omap_2430sdp_init(void) | 224 | static void __init omap_2430sdp_init(void) |
221 | { | 225 | { |
222 | int ret; | 226 | int ret; |
223 | 227 | ||
228 | omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); | ||
229 | |||
224 | omap2430_i2c_init(); | 230 | omap2430_i2c_init(); |
225 | 231 | ||
226 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 232 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
227 | omap_serial_init(); | 233 | omap_serial_init(); |
228 | omap2_hsmmc_init(mmc); | 234 | omap2_hsmmc_init(mmc); |
229 | omap_usb_init(&sdp2430_usb_config); | 235 | omap2_usbfs_init(&sdp2430_usb_config); |
236 | |||
237 | omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP); | ||
230 | usb_musb_init(&musb_board_data); | 238 | usb_musb_init(&musb_board_data); |
239 | |||
231 | board_smc91x_init(); | 240 | board_smc91x_init(); |
232 | 241 | ||
233 | /* Turn off secondary LCD backlight */ | 242 | /* Turn off secondary LCD backlight */ |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index f474a80b8867..4b8595b6787d 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <plat/control.h> | 41 | #include <plat/control.h> |
42 | #include <plat/gpmc-smc91x.h> | 42 | #include <plat/gpmc-smc91x.h> |
43 | 43 | ||
44 | #include <mach/board-sdp.h> | 44 | #include <mach/board-flash.h> |
45 | 45 | ||
46 | #include "mux.h" | 46 | #include "mux.h" |
47 | #include "sdram-qimonda-hyb18m512160af-6.h" | 47 | #include "sdram-qimonda-hyb18m512160af-6.h" |
@@ -667,6 +667,18 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
667 | #define board_mux NULL | 667 | #define board_mux NULL |
668 | #endif | 668 | #endif |
669 | 669 | ||
670 | /* | ||
671 | * SDP3430 V2 Board CS organization | ||
672 | * Different from SDP3430 V1. Now 4 switches used to specify CS | ||
673 | * | ||
674 | * See also the Switch S8 settings in the comments. | ||
675 | */ | ||
676 | static char chip_sel_3430[][GPMC_CS_NUM] = { | ||
677 | {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */ | ||
678 | {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */ | ||
679 | {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */ | ||
680 | }; | ||
681 | |||
670 | static struct mtd_partition sdp_nor_partitions[] = { | 682 | static struct mtd_partition sdp_nor_partitions[] = { |
671 | /* bootloader (U-Boot, etc) in first sector */ | 683 | /* bootloader (U-Boot, etc) in first sector */ |
672 | { | 684 | { |
@@ -797,7 +809,7 @@ static void __init omap_3430sdp_init(void) | |||
797 | omap_serial_init(); | 809 | omap_serial_init(); |
798 | usb_musb_init(&musb_board_data); | 810 | usb_musb_init(&musb_board_data); |
799 | board_smc91x_init(); | 811 | board_smc91x_init(); |
800 | sdp_flash_init(sdp_flash_partitions); | 812 | board_flash_init(sdp_flash_partitions, chip_sel_3430); |
801 | sdp3430_display_init(); | 813 | sdp3430_display_init(); |
802 | enable_board_wakeup_source(); | 814 | enable_board_wakeup_source(); |
803 | usb_ehci_init(&ehci_pdata); | 815 | usb_ehci_init(&ehci_pdata); |
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index 504d2bd222fe..2eb3f94b478e 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c | |||
@@ -18,10 +18,10 @@ | |||
18 | #include <plat/common.h> | 18 | #include <plat/common.h> |
19 | #include <plat/board.h> | 19 | #include <plat/board.h> |
20 | #include <plat/gpmc-smc91x.h> | 20 | #include <plat/gpmc-smc91x.h> |
21 | #include <plat/mux.h> | ||
22 | #include <plat/usb.h> | 21 | #include <plat/usb.h> |
23 | 22 | ||
24 | #include <mach/board-zoom.h> | 23 | #include <mach/board-zoom.h> |
24 | #include <mach/board-flash.h> | ||
25 | 25 | ||
26 | #include "mux.h" | 26 | #include "mux.h" |
27 | #include "sdram-hynix-h8mbx00u0mer-0em.h" | 27 | #include "sdram-hynix-h8mbx00u0mer-0em.h" |
@@ -93,12 +93,131 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
93 | #define board_mux NULL | 93 | #define board_mux NULL |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | /* | ||
97 | * SDP3630 CS organization | ||
98 | * See also the Switch S8 settings in the comments. | ||
99 | */ | ||
100 | static char chip_sel_sdp[][GPMC_CS_NUM] = { | ||
101 | {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */ | ||
102 | {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */ | ||
103 | {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */ | ||
104 | }; | ||
105 | |||
106 | static struct mtd_partition sdp_nor_partitions[] = { | ||
107 | /* bootloader (U-Boot, etc) in first sector */ | ||
108 | { | ||
109 | .name = "Bootloader-NOR", | ||
110 | .offset = 0, | ||
111 | .size = SZ_256K, | ||
112 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
113 | }, | ||
114 | /* bootloader params in the next sector */ | ||
115 | { | ||
116 | .name = "Params-NOR", | ||
117 | .offset = MTDPART_OFS_APPEND, | ||
118 | .size = SZ_256K, | ||
119 | .mask_flags = 0, | ||
120 | }, | ||
121 | /* kernel */ | ||
122 | { | ||
123 | .name = "Kernel-NOR", | ||
124 | .offset = MTDPART_OFS_APPEND, | ||
125 | .size = SZ_2M, | ||
126 | .mask_flags = 0 | ||
127 | }, | ||
128 | /* file system */ | ||
129 | { | ||
130 | .name = "Filesystem-NOR", | ||
131 | .offset = MTDPART_OFS_APPEND, | ||
132 | .size = MTDPART_SIZ_FULL, | ||
133 | .mask_flags = 0 | ||
134 | } | ||
135 | }; | ||
136 | |||
137 | static struct mtd_partition sdp_onenand_partitions[] = { | ||
138 | { | ||
139 | .name = "X-Loader-OneNAND", | ||
140 | .offset = 0, | ||
141 | .size = 4 * (64 * 2048), | ||
142 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
143 | }, | ||
144 | { | ||
145 | .name = "U-Boot-OneNAND", | ||
146 | .offset = MTDPART_OFS_APPEND, | ||
147 | .size = 2 * (64 * 2048), | ||
148 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
149 | }, | ||
150 | { | ||
151 | .name = "U-Boot Environment-OneNAND", | ||
152 | .offset = MTDPART_OFS_APPEND, | ||
153 | .size = 1 * (64 * 2048), | ||
154 | }, | ||
155 | { | ||
156 | .name = "Kernel-OneNAND", | ||
157 | .offset = MTDPART_OFS_APPEND, | ||
158 | .size = 16 * (64 * 2048), | ||
159 | }, | ||
160 | { | ||
161 | .name = "File System-OneNAND", | ||
162 | .offset = MTDPART_OFS_APPEND, | ||
163 | .size = MTDPART_SIZ_FULL, | ||
164 | }, | ||
165 | }; | ||
166 | |||
167 | static struct mtd_partition sdp_nand_partitions[] = { | ||
168 | /* All the partition sizes are listed in terms of NAND block size */ | ||
169 | { | ||
170 | .name = "X-Loader-NAND", | ||
171 | .offset = 0, | ||
172 | .size = 4 * (64 * 2048), | ||
173 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
174 | }, | ||
175 | { | ||
176 | .name = "U-Boot-NAND", | ||
177 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ | ||
178 | .size = 10 * (64 * 2048), | ||
179 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
180 | }, | ||
181 | { | ||
182 | .name = "Boot Env-NAND", | ||
183 | |||
184 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ | ||
185 | .size = 6 * (64 * 2048), | ||
186 | }, | ||
187 | { | ||
188 | .name = "Kernel-NAND", | ||
189 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ | ||
190 | .size = 40 * (64 * 2048), | ||
191 | }, | ||
192 | { | ||
193 | .name = "File System - NAND", | ||
194 | .size = MTDPART_SIZ_FULL, | ||
195 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */ | ||
196 | }, | ||
197 | }; | ||
198 | |||
199 | static struct flash_partitions sdp_flash_partitions[] = { | ||
200 | { | ||
201 | .parts = sdp_nor_partitions, | ||
202 | .nr_parts = ARRAY_SIZE(sdp_nor_partitions), | ||
203 | }, | ||
204 | { | ||
205 | .parts = sdp_onenand_partitions, | ||
206 | .nr_parts = ARRAY_SIZE(sdp_onenand_partitions), | ||
207 | }, | ||
208 | { | ||
209 | .parts = sdp_nand_partitions, | ||
210 | .nr_parts = ARRAY_SIZE(sdp_nand_partitions), | ||
211 | }, | ||
212 | }; | ||
213 | |||
96 | static void __init omap_sdp_init(void) | 214 | static void __init omap_sdp_init(void) |
97 | { | 215 | { |
98 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); | 216 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
99 | omap_serial_init(); | 217 | omap_serial_init(); |
100 | zoom_peripherals_init(); | 218 | zoom_peripherals_init(); |
101 | board_smc91x_init(); | 219 | board_smc91x_init(); |
220 | board_flash_init(sdp_flash_partitions, chip_sel_sdp); | ||
102 | enable_board_wakeup_source(); | 221 | enable_board_wakeup_source(); |
103 | usb_ehci_init(&ehci_pdata); | 222 | usb_ehci_init(&ehci_pdata); |
104 | } | 223 | } |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index e4a5d66b83b8..f287461bb038 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/spi/spi.h> | 21 | #include <linux/spi/spi.h> |
22 | #include <linux/i2c/twl.h> | 22 | #include <linux/i2c/twl.h> |
23 | #include <linux/regulator/machine.h> | 23 | #include <linux/regulator/machine.h> |
24 | #include <linux/leds.h> | ||
24 | 25 | ||
25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
26 | #include <mach/omap4-common.h> | 27 | #include <mach/omap4-common.h> |
@@ -40,6 +41,54 @@ | |||
40 | #define ETH_KS8851_POWER_ON 48 | 41 | #define ETH_KS8851_POWER_ON 48 |
41 | #define ETH_KS8851_QUART 138 | 42 | #define ETH_KS8851_QUART 138 |
42 | 43 | ||
44 | static struct gpio_led sdp4430_gpio_leds[] = { | ||
45 | { | ||
46 | .name = "omap4:green:debug0", | ||
47 | .gpio = 61, | ||
48 | }, | ||
49 | { | ||
50 | .name = "omap4:green:debug1", | ||
51 | .gpio = 30, | ||
52 | }, | ||
53 | { | ||
54 | .name = "omap4:green:debug2", | ||
55 | .gpio = 7, | ||
56 | }, | ||
57 | { | ||
58 | .name = "omap4:green:debug3", | ||
59 | .gpio = 8, | ||
60 | }, | ||
61 | { | ||
62 | .name = "omap4:green:debug4", | ||
63 | .gpio = 50, | ||
64 | }, | ||
65 | { | ||
66 | .name = "omap4:blue:user", | ||
67 | .gpio = 169, | ||
68 | }, | ||
69 | { | ||
70 | .name = "omap4:red:user", | ||
71 | .gpio = 170, | ||
72 | }, | ||
73 | { | ||
74 | .name = "omap4:green:user", | ||
75 | .gpio = 139, | ||
76 | }, | ||
77 | |||
78 | }; | ||
79 | |||
80 | static struct gpio_led_platform_data sdp4430_led_data = { | ||
81 | .leds = sdp4430_gpio_leds, | ||
82 | .num_leds = ARRAY_SIZE(sdp4430_gpio_leds), | ||
83 | }; | ||
84 | |||
85 | static struct platform_device sdp4430_leds_gpio = { | ||
86 | .name = "leds-gpio", | ||
87 | .id = -1, | ||
88 | .dev = { | ||
89 | .platform_data = &sdp4430_led_data, | ||
90 | }, | ||
91 | }; | ||
43 | static struct spi_board_info sdp4430_spi_board_info[] __initdata = { | 92 | static struct spi_board_info sdp4430_spi_board_info[] __initdata = { |
44 | { | 93 | { |
45 | .modalias = "ks8851", | 94 | .modalias = "ks8851", |
@@ -112,6 +161,7 @@ static struct platform_device sdp4430_lcd_device = { | |||
112 | 161 | ||
113 | static struct platform_device *sdp4430_devices[] __initdata = { | 162 | static struct platform_device *sdp4430_devices[] __initdata = { |
114 | &sdp4430_lcd_device, | 163 | &sdp4430_lcd_device, |
164 | &sdp4430_leds_gpio, | ||
115 | }; | 165 | }; |
116 | 166 | ||
117 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { | 167 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { |
@@ -156,14 +206,16 @@ static struct omap2_hsmmc_info mmc[] = { | |||
156 | {} /* Terminator */ | 206 | {} /* Terminator */ |
157 | }; | 207 | }; |
158 | 208 | ||
159 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | 209 | static struct regulator_consumer_supply sdp4430_vaux_supply[] = { |
160 | { | 210 | { |
161 | .supply = "vmmc", | 211 | .supply = "vmmc", |
162 | .dev_name = "mmci-omap-hs.0", | 212 | .dev_name = "mmci-omap-hs.1", |
163 | }, | 213 | }, |
214 | }; | ||
215 | static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { | ||
164 | { | 216 | { |
165 | .supply = "vmmc", | 217 | .supply = "vmmc", |
166 | .dev_name = "mmci-omap-hs.1", | 218 | .dev_name = "mmci-omap-hs.0", |
167 | }, | 219 | }, |
168 | }; | 220 | }; |
169 | 221 | ||
@@ -210,6 +262,8 @@ static struct regulator_init_data sdp4430_vaux1 = { | |||
210 | | REGULATOR_CHANGE_MODE | 262 | | REGULATOR_CHANGE_MODE |
211 | | REGULATOR_CHANGE_STATUS, | 263 | | REGULATOR_CHANGE_STATUS, |
212 | }, | 264 | }, |
265 | .num_consumer_supplies = 1, | ||
266 | .consumer_supplies = sdp4430_vaux_supply, | ||
213 | }; | 267 | }; |
214 | 268 | ||
215 | static struct regulator_init_data sdp4430_vaux2 = { | 269 | static struct regulator_init_data sdp4430_vaux2 = { |
@@ -250,7 +304,7 @@ static struct regulator_init_data sdp4430_vmmc = { | |||
250 | | REGULATOR_CHANGE_MODE | 304 | | REGULATOR_CHANGE_MODE |
251 | | REGULATOR_CHANGE_STATUS, | 305 | | REGULATOR_CHANGE_STATUS, |
252 | }, | 306 | }, |
253 | .num_consumer_supplies = 2, | 307 | .num_consumer_supplies = 1, |
254 | .consumer_supplies = sdp4430_vmmc_supply, | 308 | .consumer_supplies = sdp4430_vmmc_supply, |
255 | }; | 309 | }; |
256 | 310 | ||
@@ -353,6 +407,11 @@ static struct i2c_board_info __initdata sdp4430_i2c_boardinfo[] = { | |||
353 | .platform_data = &sdp4430_twldata, | 407 | .platform_data = &sdp4430_twldata, |
354 | }, | 408 | }, |
355 | }; | 409 | }; |
410 | static struct i2c_board_info __initdata sdp4430_i2c_3_boardinfo[] = { | ||
411 | { | ||
412 | I2C_BOARD_INFO("tmp105", 0x48), | ||
413 | }, | ||
414 | }; | ||
356 | static int __init omap4_i2c_init(void) | 415 | static int __init omap4_i2c_init(void) |
357 | { | 416 | { |
358 | /* | 417 | /* |
@@ -362,7 +421,8 @@ static int __init omap4_i2c_init(void) | |||
362 | omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo, | 421 | omap_register_i2c_bus(1, 400, sdp4430_i2c_boardinfo, |
363 | ARRAY_SIZE(sdp4430_i2c_boardinfo)); | 422 | ARRAY_SIZE(sdp4430_i2c_boardinfo)); |
364 | omap_register_i2c_bus(2, 400, NULL, 0); | 423 | omap_register_i2c_bus(2, 400, NULL, 0); |
365 | omap_register_i2c_bus(3, 400, NULL, 0); | 424 | omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, |
425 | ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); | ||
366 | omap_register_i2c_bus(4, 400, NULL, 0); | 426 | omap_register_i2c_bus(4, 400, NULL, 0); |
367 | return 0; | 427 | return 0; |
368 | } | 428 | } |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index aa69fb999748..8cea6235b4be 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -35,13 +35,14 @@ | |||
35 | 35 | ||
36 | #include <mach/gpio.h> | 36 | #include <mach/gpio.h> |
37 | #include <plat/led.h> | 37 | #include <plat/led.h> |
38 | #include <plat/mux.h> | ||
39 | #include <plat/usb.h> | 38 | #include <plat/usb.h> |
40 | #include <plat/board.h> | 39 | #include <plat/board.h> |
41 | #include <plat/common.h> | 40 | #include <plat/common.h> |
42 | #include <plat/gpmc.h> | 41 | #include <plat/gpmc.h> |
43 | #include <plat/control.h> | 42 | #include <plat/control.h> |
44 | 43 | ||
44 | #include "mux.h" | ||
45 | |||
45 | /* LED & Switch macros */ | 46 | /* LED & Switch macros */ |
46 | #define LED0_GPIO13 13 | 47 | #define LED0_GPIO13 13 |
47 | #define LED1_GPIO14 14 | 48 | #define LED1_GPIO14 14 |
@@ -244,7 +245,7 @@ static inline void __init apollon_init_smc91x(void) | |||
244 | apollon_smc91x_resources[0].end = base + 0x30f; | 245 | apollon_smc91x_resources[0].end = base + 0x30f; |
245 | udelay(100); | 246 | udelay(100); |
246 | 247 | ||
247 | omap_cfg_reg(W4__24XX_GPIO74); | 248 | omap_mux_init_gpio(74, 0); |
248 | if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { | 249 | if (gpio_request(APOLLON_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { |
249 | printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", | 250 | printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", |
250 | APOLLON_ETHR_GPIO_IRQ); | 251 | APOLLON_ETHR_GPIO_IRQ); |
@@ -286,15 +287,15 @@ static void __init omap_apollon_init_irq(void) | |||
286 | static void __init apollon_led_init(void) | 287 | static void __init apollon_led_init(void) |
287 | { | 288 | { |
288 | /* LED0 - AA10 */ | 289 | /* LED0 - AA10 */ |
289 | omap_cfg_reg(AA10_242X_GPIO13); | 290 | omap_mux_init_signal("vlynq_clk.gpio_13", 0); |
290 | gpio_request(LED0_GPIO13, "LED0"); | 291 | gpio_request(LED0_GPIO13, "LED0"); |
291 | gpio_direction_output(LED0_GPIO13, 0); | 292 | gpio_direction_output(LED0_GPIO13, 0); |
292 | /* LED1 - AA6 */ | 293 | /* LED1 - AA6 */ |
293 | omap_cfg_reg(AA6_242X_GPIO14); | 294 | omap_mux_init_signal("vlynq_rx1.gpio_14", 0); |
294 | gpio_request(LED1_GPIO14, "LED1"); | 295 | gpio_request(LED1_GPIO14, "LED1"); |
295 | gpio_direction_output(LED1_GPIO14, 0); | 296 | gpio_direction_output(LED1_GPIO14, 0); |
296 | /* LED2 - AA4 */ | 297 | /* LED2 - AA4 */ |
297 | omap_cfg_reg(AA4_242X_GPIO15); | 298 | omap_mux_init_signal("vlynq_rx0.gpio_15", 0); |
298 | gpio_request(LED2_GPIO15, "LED2"); | 299 | gpio_request(LED2_GPIO15, "LED2"); |
299 | gpio_direction_output(LED2_GPIO15, 0); | 300 | gpio_direction_output(LED2_GPIO15, 0); |
300 | } | 301 | } |
@@ -303,22 +304,35 @@ static void __init apollon_usb_init(void) | |||
303 | { | 304 | { |
304 | /* USB device */ | 305 | /* USB device */ |
305 | /* DEVICE_SUSPEND */ | 306 | /* DEVICE_SUSPEND */ |
306 | omap_cfg_reg(P21_242X_GPIO12); | 307 | omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); |
307 | gpio_request(12, "USB suspend"); | 308 | gpio_request(12, "USB suspend"); |
308 | gpio_direction_output(12, 0); | 309 | gpio_direction_output(12, 0); |
309 | omap_usb_init(&apollon_usb_config); | 310 | omap2_usbfs_init(&apollon_usb_config); |
310 | } | 311 | } |
311 | 312 | ||
313 | #ifdef CONFIG_OMAP_MUX | ||
314 | static struct omap_board_mux board_mux[] __initdata = { | ||
315 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
316 | }; | ||
317 | #else | ||
318 | #define board_mux NULL | ||
319 | #endif | ||
320 | |||
312 | static void __init omap_apollon_init(void) | 321 | static void __init omap_apollon_init(void) |
313 | { | 322 | { |
314 | u32 v; | 323 | u32 v; |
315 | 324 | ||
325 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); | ||
326 | |||
316 | apollon_led_init(); | 327 | apollon_led_init(); |
317 | apollon_flash_init(); | 328 | apollon_flash_init(); |
318 | apollon_usb_init(); | 329 | apollon_usb_init(); |
319 | 330 | ||
320 | /* REVISIT: where's the correct place */ | 331 | /* REVISIT: where's the correct place */ |
321 | omap_cfg_reg(W19_24XX_SYS_NIRQ); | 332 | omap_mux_init_signal("sys_nirq", OMAP_PULL_ENA | OMAP_PULL_UP); |
333 | |||
334 | /* LCD PWR_EN */ | ||
335 | omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); | ||
322 | 336 | ||
323 | /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */ | 337 | /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */ |
324 | v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | 338 | v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index e679a2cc86c3..05442945fc67 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -61,8 +61,6 @@ | |||
61 | #define SB_T35_SMSC911X_GPIO 65 | 61 | #define SB_T35_SMSC911X_GPIO 65 |
62 | 62 | ||
63 | #define NAND_BLOCK_SIZE SZ_128K | 63 | #define NAND_BLOCK_SIZE SZ_128K |
64 | #define GPMC_CS0_BASE 0x60 | ||
65 | #define GPMC_CS0_BASE_ADDR (OMAP34XX_GPMC_VIRT + GPMC_CS0_BASE) | ||
66 | 64 | ||
67 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 65 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
68 | #include <linux/smsc911x.h> | 66 | #include <linux/smsc911x.h> |
@@ -223,28 +221,12 @@ static struct omap_nand_platform_data cm_t35_nand_data = { | |||
223 | .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions), | 221 | .nr_parts = ARRAY_SIZE(cm_t35_nand_partitions), |
224 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | 222 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
225 | .cs = 0, | 223 | .cs = 0, |
226 | .gpmc_cs_baseaddr = (void __iomem *)GPMC_CS0_BASE_ADDR, | ||
227 | .gpmc_baseaddr = (void __iomem *)OMAP34XX_GPMC_VIRT, | ||
228 | 224 | ||
229 | }; | 225 | }; |
230 | 226 | ||
231 | static struct resource cm_t35_nand_resource = { | ||
232 | .flags = IORESOURCE_MEM, | ||
233 | }; | ||
234 | |||
235 | static struct platform_device cm_t35_nand_device = { | ||
236 | .name = "omap2-nand", | ||
237 | .id = -1, | ||
238 | .num_resources = 1, | ||
239 | .resource = &cm_t35_nand_resource, | ||
240 | .dev = { | ||
241 | .platform_data = &cm_t35_nand_data, | ||
242 | }, | ||
243 | }; | ||
244 | |||
245 | static void __init cm_t35_init_nand(void) | 227 | static void __init cm_t35_init_nand(void) |
246 | { | 228 | { |
247 | if (platform_device_register(&cm_t35_nand_device) < 0) | 229 | if (gpmc_nand_init(&cm_t35_nand_data) < 0) |
248 | pr_err("CM-T35: Unable to register NAND device\n"); | 230 | pr_err("CM-T35: Unable to register NAND device\n"); |
249 | } | 231 | } |
250 | #else | 232 | #else |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 77022b588816..96e16f76ff44 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/i2c/twl.h> | 33 | #include <linux/i2c/twl.h> |
34 | 34 | ||
35 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
36 | #include <mach/id.h> | ||
36 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
37 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
38 | #include <asm/mach/map.h> | 39 | #include <asm/mach/map.h> |
@@ -58,9 +59,6 @@ | |||
58 | #include "mux.h" | 59 | #include "mux.h" |
59 | #include "hsmmc.h" | 60 | #include "hsmmc.h" |
60 | 61 | ||
61 | #define GPMC_CS0_BASE 0x60 | ||
62 | #define GPMC_CS_SIZE 0x30 | ||
63 | |||
64 | #define NAND_BLOCK_SIZE SZ_128K | 62 | #define NAND_BLOCK_SIZE SZ_128K |
65 | 63 | ||
66 | #define OMAP_DM9000_GPIO_IRQ 25 | 64 | #define OMAP_DM9000_GPIO_IRQ 25 |
@@ -104,20 +102,6 @@ static struct omap_nand_platform_data devkit8000_nand_data = { | |||
104 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | 102 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
105 | }; | 103 | }; |
106 | 104 | ||
107 | static struct resource devkit8000_nand_resource = { | ||
108 | .flags = IORESOURCE_MEM, | ||
109 | }; | ||
110 | |||
111 | static struct platform_device devkit8000_nand_device = { | ||
112 | .name = "omap2-nand", | ||
113 | .id = -1, | ||
114 | .dev = { | ||
115 | .platform_data = &devkit8000_nand_data, | ||
116 | }, | ||
117 | .num_resources = 1, | ||
118 | .resource = &devkit8000_nand_resource, | ||
119 | }; | ||
120 | |||
121 | static struct omap2_hsmmc_info mmc[] = { | 105 | static struct omap2_hsmmc_info mmc[] = { |
122 | { | 106 | { |
123 | .mmc = 1, | 107 | .mmc = 1, |
@@ -126,54 +110,50 @@ static struct omap2_hsmmc_info mmc[] = { | |||
126 | }, | 110 | }, |
127 | {} /* Terminator */ | 111 | {} /* Terminator */ |
128 | }; | 112 | }; |
129 | static struct omap_board_config_kernel devkit8000_config[] __initdata = { | ||
130 | }; | ||
131 | 113 | ||
132 | static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev) | 114 | static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev) |
133 | { | 115 | { |
134 | twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1); | 116 | twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1); |
135 | twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0); | 117 | twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0); |
136 | 118 | ||
119 | if (gpio_is_valid(dssdev->reset_gpio)) | ||
120 | gpio_set_value(dssdev->reset_gpio, 1); | ||
137 | return 0; | 121 | return 0; |
138 | } | 122 | } |
139 | 123 | ||
140 | static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev) | 124 | static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev) |
141 | { | 125 | { |
126 | if (gpio_is_valid(dssdev->reset_gpio)) | ||
127 | gpio_set_value(dssdev->reset_gpio, 0); | ||
142 | } | 128 | } |
129 | |||
143 | static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev) | 130 | static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev) |
144 | { | 131 | { |
132 | if (gpio_is_valid(dssdev->reset_gpio)) | ||
133 | gpio_set_value(dssdev->reset_gpio, 1); | ||
145 | return 0; | 134 | return 0; |
146 | } | 135 | } |
147 | 136 | ||
148 | static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) | 137 | static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) |
149 | { | 138 | { |
139 | if (gpio_is_valid(dssdev->reset_gpio)) | ||
140 | gpio_set_value(dssdev->reset_gpio, 0); | ||
150 | } | 141 | } |
151 | 142 | ||
152 | static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev) | 143 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = |
153 | { | 144 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); |
154 | |||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | static void devkit8000_panel_disable_tv(struct omap_dss_device *dssdev) | ||
159 | { | ||
160 | } | ||
161 | 145 | ||
162 | 146 | ||
163 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = { | 147 | /* ads7846 on SPI */ |
164 | .supply = "vmmc", | 148 | static struct regulator_consumer_supply devkit8000_vio_supply = |
165 | }; | 149 | REGULATOR_SUPPLY("vcc", "spi2.0"); |
166 | |||
167 | static struct regulator_consumer_supply devkit8000_vsim_supply = { | ||
168 | .supply = "vmmc_aux", | ||
169 | }; | ||
170 | |||
171 | 150 | ||
172 | static struct omap_dss_device devkit8000_lcd_device = { | 151 | static struct omap_dss_device devkit8000_lcd_device = { |
173 | .name = "lcd", | 152 | .name = "lcd", |
174 | .driver_name = "innolux_at_panel", | 153 | .driver_name = "generic_panel", |
175 | .type = OMAP_DISPLAY_TYPE_DPI, | 154 | .type = OMAP_DISPLAY_TYPE_DPI, |
176 | .phy.dpi.data_lines = 24, | 155 | .phy.dpi.data_lines = 24, |
156 | .reset_gpio = -EINVAL, /* will be replaced */ | ||
177 | .platform_enable = devkit8000_panel_enable_lcd, | 157 | .platform_enable = devkit8000_panel_enable_lcd, |
178 | .platform_disable = devkit8000_panel_disable_lcd, | 158 | .platform_disable = devkit8000_panel_disable_lcd, |
179 | }; | 159 | }; |
@@ -182,6 +162,7 @@ static struct omap_dss_device devkit8000_dvi_device = { | |||
182 | .driver_name = "generic_panel", | 162 | .driver_name = "generic_panel", |
183 | .type = OMAP_DISPLAY_TYPE_DPI, | 163 | .type = OMAP_DISPLAY_TYPE_DPI, |
184 | .phy.dpi.data_lines = 24, | 164 | .phy.dpi.data_lines = 24, |
165 | .reset_gpio = -EINVAL, /* will be replaced */ | ||
185 | .platform_enable = devkit8000_panel_enable_dvi, | 166 | .platform_enable = devkit8000_panel_enable_dvi, |
186 | .platform_disable = devkit8000_panel_disable_dvi, | 167 | .platform_disable = devkit8000_panel_disable_dvi, |
187 | }; | 168 | }; |
@@ -191,8 +172,6 @@ static struct omap_dss_device devkit8000_tv_device = { | |||
191 | .driver_name = "venc", | 172 | .driver_name = "venc", |
192 | .type = OMAP_DISPLAY_TYPE_VENC, | 173 | .type = OMAP_DISPLAY_TYPE_VENC, |
193 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | 174 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, |
194 | .platform_enable = devkit8000_panel_enable_tv, | ||
195 | .platform_disable = devkit8000_panel_disable_tv, | ||
196 | }; | 175 | }; |
197 | 176 | ||
198 | 177 | ||
@@ -216,10 +195,8 @@ static struct platform_device devkit8000_dss_device = { | |||
216 | }, | 195 | }, |
217 | }; | 196 | }; |
218 | 197 | ||
219 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = { | 198 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = |
220 | .supply = "vdda_dac", | 199 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); |
221 | .dev = &devkit8000_dss_device.dev, | ||
222 | }; | ||
223 | 200 | ||
224 | static int board_keymap[] = { | 201 | static int board_keymap[] = { |
225 | KEY(0, 0, KEY_1), | 202 | KEY(0, 0, KEY_1), |
@@ -266,7 +243,21 @@ static int devkit8000_twl_gpio_setup(struct device *dev, | |||
266 | 243 | ||
267 | /* link regulators to MMC adapters */ | 244 | /* link regulators to MMC adapters */ |
268 | devkit8000_vmmc1_supply.dev = mmc[0].dev; | 245 | devkit8000_vmmc1_supply.dev = mmc[0].dev; |
269 | devkit8000_vsim_supply.dev = mmc[0].dev; | 246 | |
247 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | ||
248 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | ||
249 | |||
250 | /* gpio + 1 is "LCD_PWREN" (out, active high) */ | ||
251 | devkit8000_lcd_device.reset_gpio = gpio + 1; | ||
252 | gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN"); | ||
253 | /* Disable until needed */ | ||
254 | gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0); | ||
255 | |||
256 | /* gpio + 7 is "DVI_PD" (out, active low) */ | ||
257 | devkit8000_dvi_device.reset_gpio = gpio + 7; | ||
258 | gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown"); | ||
259 | /* Disable until needed */ | ||
260 | gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0); | ||
270 | 261 | ||
271 | return 0; | 262 | return 0; |
272 | } | 263 | } |
@@ -282,16 +273,8 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = { | |||
282 | .setup = devkit8000_twl_gpio_setup, | 273 | .setup = devkit8000_twl_gpio_setup, |
283 | }; | 274 | }; |
284 | 275 | ||
285 | static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = { | 276 | static struct regulator_consumer_supply devkit8000_vpll1_supply = |
286 | { | 277 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"); |
287 | .supply = "vdvi", | ||
288 | .dev = &devkit8000_lcd_device.dev, | ||
289 | }, | ||
290 | { | ||
291 | .supply = "vdds_dsi", | ||
292 | .dev = &devkit8000_dss_device.dev, | ||
293 | } | ||
294 | }; | ||
295 | 278 | ||
296 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 279 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
297 | static struct regulator_init_data devkit8000_vmmc1 = { | 280 | static struct regulator_init_data devkit8000_vmmc1 = { |
@@ -308,21 +291,6 @@ static struct regulator_init_data devkit8000_vmmc1 = { | |||
308 | .consumer_supplies = &devkit8000_vmmc1_supply, | 291 | .consumer_supplies = &devkit8000_vmmc1_supply, |
309 | }; | 292 | }; |
310 | 293 | ||
311 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | ||
312 | static struct regulator_init_data devkit8000_vsim = { | ||
313 | .constraints = { | ||
314 | .min_uV = 1800000, | ||
315 | .max_uV = 3000000, | ||
316 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
317 | | REGULATOR_MODE_STANDBY, | ||
318 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
319 | | REGULATOR_CHANGE_MODE | ||
320 | | REGULATOR_CHANGE_STATUS, | ||
321 | }, | ||
322 | .num_consumer_supplies = 1, | ||
323 | .consumer_supplies = &devkit8000_vsim_supply, | ||
324 | }; | ||
325 | |||
326 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | 294 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ |
327 | static struct regulator_init_data devkit8000_vdac = { | 295 | static struct regulator_init_data devkit8000_vdac = { |
328 | .constraints = { | 296 | .constraints = { |
@@ -337,10 +305,9 @@ static struct regulator_init_data devkit8000_vdac = { | |||
337 | .consumer_supplies = &devkit8000_vdda_dac_supply, | 305 | .consumer_supplies = &devkit8000_vdda_dac_supply, |
338 | }; | 306 | }; |
339 | 307 | ||
340 | /* VPLL2 for digital video outputs */ | 308 | /* VPLL1 for digital video outputs */ |
341 | static struct regulator_init_data devkit8000_vpll2 = { | 309 | static struct regulator_init_data devkit8000_vpll1 = { |
342 | .constraints = { | 310 | .constraints = { |
343 | .name = "VDVI", | ||
344 | .min_uV = 1800000, | 311 | .min_uV = 1800000, |
345 | .max_uV = 1800000, | 312 | .max_uV = 1800000, |
346 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 313 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
@@ -348,8 +315,23 @@ static struct regulator_init_data devkit8000_vpll2 = { | |||
348 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 315 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
349 | | REGULATOR_CHANGE_STATUS, | 316 | | REGULATOR_CHANGE_STATUS, |
350 | }, | 317 | }, |
351 | .num_consumer_supplies = ARRAY_SIZE(devkit8000_vpll2_supplies), | 318 | .num_consumer_supplies = 1, |
352 | .consumer_supplies = devkit8000_vpll2_supplies, | 319 | .consumer_supplies = &devkit8000_vpll1_supply, |
320 | }; | ||
321 | |||
322 | /* VAUX4 for ads7846 and nubs */ | ||
323 | static struct regulator_init_data devkit8000_vio = { | ||
324 | .constraints = { | ||
325 | .min_uV = 1800000, | ||
326 | .max_uV = 1800000, | ||
327 | .apply_uV = true, | ||
328 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
329 | | REGULATOR_MODE_STANDBY, | ||
330 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
331 | | REGULATOR_CHANGE_STATUS, | ||
332 | }, | ||
333 | .num_consumer_supplies = 1, | ||
334 | .consumer_supplies = &devkit8000_vio_supply, | ||
353 | }; | 335 | }; |
354 | 336 | ||
355 | static struct twl4030_usb_data devkit8000_usb_data = { | 337 | static struct twl4030_usb_data devkit8000_usb_data = { |
@@ -374,15 +356,15 @@ static struct twl4030_platform_data devkit8000_twldata = { | |||
374 | .gpio = &devkit8000_gpio_data, | 356 | .gpio = &devkit8000_gpio_data, |
375 | .codec = &devkit8000_codec_data, | 357 | .codec = &devkit8000_codec_data, |
376 | .vmmc1 = &devkit8000_vmmc1, | 358 | .vmmc1 = &devkit8000_vmmc1, |
377 | .vsim = &devkit8000_vsim, | ||
378 | .vdac = &devkit8000_vdac, | 359 | .vdac = &devkit8000_vdac, |
379 | .vpll2 = &devkit8000_vpll2, | 360 | .vpll1 = &devkit8000_vpll1, |
361 | .vio = &devkit8000_vio, | ||
380 | .keypad = &devkit8000_kp_data, | 362 | .keypad = &devkit8000_kp_data, |
381 | }; | 363 | }; |
382 | 364 | ||
383 | static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = { | 365 | static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = { |
384 | { | 366 | { |
385 | I2C_BOARD_INFO("twl4030", 0x48), | 367 | I2C_BOARD_INFO("tps65930", 0x48), |
386 | .flags = I2C_CLIENT_WAKE, | 368 | .flags = I2C_CLIENT_WAKE, |
387 | .irq = INT_34XX_SYS_NIRQ, | 369 | .irq = INT_34XX_SYS_NIRQ, |
388 | .platform_data = &devkit8000_twldata, | 370 | .platform_data = &devkit8000_twldata, |
@@ -464,8 +446,6 @@ static struct platform_device keys_gpio = { | |||
464 | 446 | ||
465 | static void __init devkit8000_init_irq(void) | 447 | static void __init devkit8000_init_irq(void) |
466 | { | 448 | { |
467 | omap_board_config = devkit8000_config; | ||
468 | omap_board_config_size = ARRAY_SIZE(devkit8000_config); | ||
469 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, | 449 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, |
470 | mt46h32m32lf6_sdrc_params); | 450 | mt46h32m32lf6_sdrc_params); |
471 | omap_init_irq(); | 451 | omap_init_irq(); |
@@ -560,6 +540,9 @@ static struct platform_device omap_dm9000_dev = { | |||
560 | 540 | ||
561 | static void __init omap_dm9000_init(void) | 541 | static void __init omap_dm9000_init(void) |
562 | { | 542 | { |
543 | unsigned char *eth_addr = omap_dm9000_platdata.dev_addr; | ||
544 | struct omap_die_id odi; | ||
545 | |||
563 | if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { | 546 | if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { |
564 | printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", | 547 | printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", |
565 | OMAP_DM9000_GPIO_IRQ); | 548 | OMAP_DM9000_GPIO_IRQ); |
@@ -567,6 +550,16 @@ static void __init omap_dm9000_init(void) | |||
567 | } | 550 | } |
568 | 551 | ||
569 | gpio_direction_input(OMAP_DM9000_GPIO_IRQ); | 552 | gpio_direction_input(OMAP_DM9000_GPIO_IRQ); |
553 | |||
554 | /* init the mac address using DIE id */ | ||
555 | omap_get_die_id(&odi); | ||
556 | |||
557 | eth_addr[0] = 0x02; /* locally administered */ | ||
558 | eth_addr[1] = odi.id_1 & 0xff; | ||
559 | eth_addr[2] = (odi.id_0 & 0xff000000) >> 24; | ||
560 | eth_addr[3] = (odi.id_0 & 0x00ff0000) >> 16; | ||
561 | eth_addr[4] = (odi.id_0 & 0x0000ff00) >> 8; | ||
562 | eth_addr[5] = (odi.id_0 & 0x000000ff); | ||
570 | } | 563 | } |
571 | 564 | ||
572 | static struct platform_device *devkit8000_devices[] __initdata = { | 565 | static struct platform_device *devkit8000_devices[] __initdata = { |
@@ -581,8 +574,6 @@ static void __init devkit8000_flash_init(void) | |||
581 | u8 cs = 0; | 574 | u8 cs = 0; |
582 | u8 nandcs = GPMC_CS_NUM + 1; | 575 | u8 nandcs = GPMC_CS_NUM + 1; |
583 | 576 | ||
584 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
585 | |||
586 | /* find out the chip-select on which NAND exists */ | 577 | /* find out the chip-select on which NAND exists */ |
587 | while (cs < GPMC_CS_NUM) { | 578 | while (cs < GPMC_CS_NUM) { |
588 | u32 ret = 0; | 579 | u32 ret = 0; |
@@ -604,13 +595,9 @@ static void __init devkit8000_flash_init(void) | |||
604 | 595 | ||
605 | if (nandcs < GPMC_CS_NUM) { | 596 | if (nandcs < GPMC_CS_NUM) { |
606 | devkit8000_nand_data.cs = nandcs; | 597 | devkit8000_nand_data.cs = nandcs; |
607 | devkit8000_nand_data.gpmc_cs_baseaddr = (void *) | ||
608 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
609 | devkit8000_nand_data.gpmc_baseaddr = (void *) | ||
610 | (gpmc_base_add); | ||
611 | 598 | ||
612 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 599 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
613 | if (platform_device_register(&devkit8000_nand_device) < 0) | 600 | if (gpmc_nand_init(&devkit8000_nand_data) < 0) |
614 | printk(KERN_ERR "Unable to register NAND device\n"); | 601 | printk(KERN_ERR "Unable to register NAND device\n"); |
615 | } | 602 | } |
616 | } | 603 | } |
@@ -797,8 +784,6 @@ static void __init devkit8000_init(void) | |||
797 | devkit8000_i2c_init(); | 784 | devkit8000_i2c_init(); |
798 | platform_add_devices(devkit8000_devices, | 785 | platform_add_devices(devkit8000_devices, |
799 | ARRAY_SIZE(devkit8000_devices)); | 786 | ARRAY_SIZE(devkit8000_devices)); |
800 | omap_board_config = devkit8000_config; | ||
801 | omap_board_config_size = ARRAY_SIZE(devkit8000_config); | ||
802 | 787 | ||
803 | spi_register_board_info(devkit8000_spi_board_info, | 788 | spi_register_board_info(devkit8000_spi_board_info, |
804 | ARRAY_SIZE(devkit8000_spi_board_info)); | 789 | ARRAY_SIZE(devkit8000_spi_board_info)); |
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c b/arch/arm/mach-omap2/board-flash.c index 2d026328e385..ac834aa7abf6 100644 --- a/arch/arm/mach-omap2/board-sdp-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <plat/nand.h> | 21 | #include <plat/nand.h> |
22 | #include <plat/onenand.h> | 22 | #include <plat/onenand.h> |
23 | #include <plat/tc.h> | 23 | #include <plat/tc.h> |
24 | #include <mach/board-sdp.h> | 24 | #include <mach/board-flash.h> |
25 | 25 | ||
26 | #define REG_FPGA_REV 0x10 | 26 | #define REG_FPGA_REV 0x10 |
27 | #define REG_FPGA_DIP_SWITCH_INPUT2 0x60 | 27 | #define REG_FPGA_DIP_SWITCH_INPUT2 0x60 |
@@ -29,72 +29,53 @@ | |||
29 | 29 | ||
30 | #define DEBUG_BASE 0x08000000 /* debug board */ | 30 | #define DEBUG_BASE 0x08000000 /* debug board */ |
31 | 31 | ||
32 | #define PDC_NOR 1 | ||
33 | #define PDC_NAND 2 | ||
34 | #define PDC_ONENAND 3 | ||
35 | #define DBG_MPDB 4 | ||
36 | |||
37 | /* various memory sizes */ | 32 | /* various memory sizes */ |
38 | #define FLASH_SIZE_SDPV1 SZ_64M /* NOR flash (64 Meg aligned) */ | 33 | #define FLASH_SIZE_SDPV1 SZ_64M /* NOR flash (64 Meg aligned) */ |
39 | #define FLASH_SIZE_SDPV2 SZ_128M /* NOR flash (256 Meg aligned) */ | 34 | #define FLASH_SIZE_SDPV2 SZ_128M /* NOR flash (256 Meg aligned) */ |
40 | 35 | ||
41 | /* | 36 | static struct physmap_flash_data board_nor_data = { |
42 | * SDP3430 V2 Board CS organization | ||
43 | * Different from SDP3430 V1. Now 4 switches used to specify CS | ||
44 | * | ||
45 | * See also the Switch S8 settings in the comments. | ||
46 | * | ||
47 | * REVISIT: Add support for 2430 SDP | ||
48 | */ | ||
49 | static const unsigned char chip_sel_sdp[][GPMC_CS_NUM] = { | ||
50 | {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */ | ||
51 | {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */ | ||
52 | {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */ | ||
53 | }; | ||
54 | |||
55 | static struct physmap_flash_data sdp_nor_data = { | ||
56 | .width = 2, | 37 | .width = 2, |
57 | }; | 38 | }; |
58 | 39 | ||
59 | static struct resource sdp_nor_resource = { | 40 | static struct resource board_nor_resource = { |
60 | .flags = IORESOURCE_MEM, | 41 | .flags = IORESOURCE_MEM, |
61 | }; | 42 | }; |
62 | 43 | ||
63 | static struct platform_device sdp_nor_device = { | 44 | static struct platform_device board_nor_device = { |
64 | .name = "physmap-flash", | 45 | .name = "physmap-flash", |
65 | .id = 0, | 46 | .id = 0, |
66 | .dev = { | 47 | .dev = { |
67 | .platform_data = &sdp_nor_data, | 48 | .platform_data = &board_nor_data, |
68 | }, | 49 | }, |
69 | .num_resources = 1, | 50 | .num_resources = 1, |
70 | .resource = &sdp_nor_resource, | 51 | .resource = &board_nor_resource, |
71 | }; | 52 | }; |
72 | 53 | ||
73 | static void | 54 | static void |
74 | __init board_nor_init(struct flash_partitions sdp_nor_parts, u8 cs) | 55 | __init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) |
75 | { | 56 | { |
76 | int err; | 57 | int err; |
77 | 58 | ||
78 | sdp_nor_data.parts = sdp_nor_parts.parts; | 59 | board_nor_data.parts = nor_parts; |
79 | sdp_nor_data.nr_parts = sdp_nor_parts.nr_parts; | 60 | board_nor_data.nr_parts = nr_parts; |
80 | 61 | ||
81 | /* Configure start address and size of NOR device */ | 62 | /* Configure start address and size of NOR device */ |
82 | if (omap_rev() >= OMAP3430_REV_ES1_0) { | 63 | if (omap_rev() >= OMAP3430_REV_ES1_0) { |
83 | err = gpmc_cs_request(cs, FLASH_SIZE_SDPV2 - 1, | 64 | err = gpmc_cs_request(cs, FLASH_SIZE_SDPV2 - 1, |
84 | (unsigned long *)&sdp_nor_resource.start); | 65 | (unsigned long *)&board_nor_resource.start); |
85 | sdp_nor_resource.end = sdp_nor_resource.start | 66 | board_nor_resource.end = board_nor_resource.start |
86 | + FLASH_SIZE_SDPV2 - 1; | 67 | + FLASH_SIZE_SDPV2 - 1; |
87 | } else { | 68 | } else { |
88 | err = gpmc_cs_request(cs, FLASH_SIZE_SDPV1 - 1, | 69 | err = gpmc_cs_request(cs, FLASH_SIZE_SDPV1 - 1, |
89 | (unsigned long *)&sdp_nor_resource.start); | 70 | (unsigned long *)&board_nor_resource.start); |
90 | sdp_nor_resource.end = sdp_nor_resource.start | 71 | board_nor_resource.end = board_nor_resource.start |
91 | + FLASH_SIZE_SDPV1 - 1; | 72 | + FLASH_SIZE_SDPV1 - 1; |
92 | } | 73 | } |
93 | if (err < 0) { | 74 | if (err < 0) { |
94 | printk(KERN_ERR "NOR: Can't request GPMC CS\n"); | 75 | printk(KERN_ERR "NOR: Can't request GPMC CS\n"); |
95 | return; | 76 | return; |
96 | } | 77 | } |
97 | if (platform_device_register(&sdp_nor_device) < 0) | 78 | if (platform_device_register(&board_nor_device) < 0) |
98 | printk(KERN_ERR "Unable to register NOR device\n"); | 79 | printk(KERN_ERR "Unable to register NOR device\n"); |
99 | } | 80 | } |
100 | 81 | ||
@@ -105,17 +86,18 @@ static struct omap_onenand_platform_data board_onenand_data = { | |||
105 | }; | 86 | }; |
106 | 87 | ||
107 | static void | 88 | static void |
108 | __init board_onenand_init(struct flash_partitions sdp_onenand_parts, u8 cs) | 89 | __init board_onenand_init(struct mtd_partition *onenand_parts, |
90 | u8 nr_parts, u8 cs) | ||
109 | { | 91 | { |
110 | board_onenand_data.cs = cs; | 92 | board_onenand_data.cs = cs; |
111 | board_onenand_data.parts = sdp_onenand_parts.parts; | 93 | board_onenand_data.parts = onenand_parts; |
112 | board_onenand_data.nr_parts = sdp_onenand_parts.nr_parts; | 94 | board_onenand_data.nr_parts = nr_parts; |
113 | 95 | ||
114 | gpmc_onenand_init(&board_onenand_data); | 96 | gpmc_onenand_init(&board_onenand_data); |
115 | } | 97 | } |
116 | #else | 98 | #else |
117 | static void | 99 | static void |
118 | __init board_onenand_init(struct flash_partitions sdp_onenand_parts, u8 cs) | 100 | __init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) |
119 | { | 101 | { |
120 | } | 102 | } |
121 | #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ | 103 | #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ |
@@ -147,7 +129,7 @@ static struct gpmc_timings nand_timings = { | |||
147 | .wr_data_mux_bus = 0, | 129 | .wr_data_mux_bus = 0, |
148 | }; | 130 | }; |
149 | 131 | ||
150 | static struct omap_nand_platform_data sdp_nand_data = { | 132 | static struct omap_nand_platform_data board_nand_data = { |
151 | .nand_setup = NULL, | 133 | .nand_setup = NULL, |
152 | .gpmc_t = &nand_timings, | 134 | .gpmc_t = &nand_timings, |
153 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | 135 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
@@ -155,23 +137,18 @@ static struct omap_nand_platform_data sdp_nand_data = { | |||
155 | .devsize = 0, /* '0' for 8-bit, '1' for 16-bit device */ | 137 | .devsize = 0, /* '0' for 8-bit, '1' for 16-bit device */ |
156 | }; | 138 | }; |
157 | 139 | ||
158 | static void | 140 | void |
159 | __init board_nand_init(struct flash_partitions sdp_nand_parts, u8 cs) | 141 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) |
160 | { | 142 | { |
161 | sdp_nand_data.cs = cs; | 143 | board_nand_data.cs = cs; |
162 | sdp_nand_data.parts = sdp_nand_parts.parts; | 144 | board_nand_data.parts = nand_parts; |
163 | sdp_nand_data.nr_parts = sdp_nand_parts.nr_parts; | 145 | board_nand_data.nr_parts = nr_parts; |
164 | 146 | ||
165 | sdp_nand_data.gpmc_cs_baseaddr = (void *)(OMAP34XX_GPMC_VIRT + | 147 | gpmc_nand_init(&board_nand_data); |
166 | GPMC_CS0_BASE + | ||
167 | cs * GPMC_CS_SIZE); | ||
168 | sdp_nand_data.gpmc_baseaddr = (void *) (OMAP34XX_GPMC_VIRT); | ||
169 | |||
170 | gpmc_nand_init(&sdp_nand_data); | ||
171 | } | 148 | } |
172 | #else | 149 | #else |
173 | static void | 150 | void |
174 | __init board_nand_init(struct flash_partitions sdp_nand_parts, u8 cs) | 151 | __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) |
175 | { | 152 | { |
176 | } | 153 | } |
177 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ | 154 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ |
@@ -215,7 +192,8 @@ unmap: | |||
215 | * | 192 | * |
216 | * @return - void. | 193 | * @return - void. |
217 | */ | 194 | */ |
218 | void __init sdp_flash_init(struct flash_partitions sdp_partition_info[]) | 195 | void board_flash_init(struct flash_partitions partition_info[], |
196 | char chip_sel_board[][GPMC_CS_NUM]) | ||
219 | { | 197 | { |
220 | u8 cs = 0; | 198 | u8 cs = 0; |
221 | u8 norcs = GPMC_CS_NUM + 1; | 199 | u8 norcs = GPMC_CS_NUM + 1; |
@@ -232,7 +210,7 @@ void __init sdp_flash_init(struct flash_partitions sdp_partition_info[]) | |||
232 | printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); | 210 | printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); |
233 | return; | 211 | return; |
234 | } | 212 | } |
235 | config_sel = (unsigned char *)(chip_sel_sdp[idx]); | 213 | config_sel = (unsigned char *)(chip_sel_board[idx]); |
236 | 214 | ||
237 | while (cs < GPMC_CS_NUM) { | 215 | while (cs < GPMC_CS_NUM) { |
238 | switch (config_sel[cs]) { | 216 | switch (config_sel[cs]) { |
@@ -256,17 +234,20 @@ void __init sdp_flash_init(struct flash_partitions sdp_partition_info[]) | |||
256 | printk(KERN_INFO "NOR: Unable to find configuration " | 234 | printk(KERN_INFO "NOR: Unable to find configuration " |
257 | "in GPMC\n"); | 235 | "in GPMC\n"); |
258 | else | 236 | else |
259 | board_nor_init(sdp_partition_info[0], norcs); | 237 | board_nor_init(partition_info[0].parts, |
238 | partition_info[0].nr_parts, norcs); | ||
260 | 239 | ||
261 | if (onenandcs > GPMC_CS_NUM) | 240 | if (onenandcs > GPMC_CS_NUM) |
262 | printk(KERN_INFO "OneNAND: Unable to find configuration " | 241 | printk(KERN_INFO "OneNAND: Unable to find configuration " |
263 | "in GPMC\n"); | 242 | "in GPMC\n"); |
264 | else | 243 | else |
265 | board_onenand_init(sdp_partition_info[1], onenandcs); | 244 | board_onenand_init(partition_info[1].parts, |
245 | partition_info[1].nr_parts, onenandcs); | ||
266 | 246 | ||
267 | if (nandcs > GPMC_CS_NUM) | 247 | if (nandcs > GPMC_CS_NUM) |
268 | printk(KERN_INFO "NAND: Unable to find configuration " | 248 | printk(KERN_INFO "NAND: Unable to find configuration " |
269 | "in GPMC\n"); | 249 | "in GPMC\n"); |
270 | else | 250 | else |
271 | board_nand_init(sdp_partition_info[2], nandcs); | 251 | board_nand_init(partition_info[2].parts, |
252 | partition_info[2].nr_parts, nandcs); | ||
272 | } | 253 | } |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 16cc06860670..9a7f790d8c3a 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | 27 | ||
28 | #include <mach/gpio.h> | 28 | #include <mach/gpio.h> |
29 | #include <plat/mux.h> | ||
30 | #include <plat/usb.h> | 29 | #include <plat/usb.h> |
31 | #include <plat/board.h> | 30 | #include <plat/board.h> |
32 | #include <plat/common.h> | 31 | #include <plat/common.h> |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 0665f2c8dc8e..3240c6a7d9e7 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -33,7 +33,6 @@ | |||
33 | 33 | ||
34 | #include <plat/control.h> | 34 | #include <plat/control.h> |
35 | #include <mach/gpio.h> | 35 | #include <mach/gpio.h> |
36 | #include <plat/mux.h> | ||
37 | #include <plat/usb.h> | 36 | #include <plat/usb.h> |
38 | #include <plat/board.h> | 37 | #include <plat/board.h> |
39 | #include <plat/common.h> | 38 | #include <plat/common.h> |
@@ -42,6 +41,8 @@ | |||
42 | #include <plat/dma.h> | 41 | #include <plat/dma.h> |
43 | #include <plat/gpmc.h> | 42 | #include <plat/gpmc.h> |
44 | 43 | ||
44 | #include "mux.h" | ||
45 | |||
45 | #define H4_FLASH_CS 0 | 46 | #define H4_FLASH_CS 0 |
46 | #define H4_SMC91X_CS 1 | 47 | #define H4_SMC91X_CS 1 |
47 | 48 | ||
@@ -246,7 +247,7 @@ static inline void __init h4_init_debug(void) | |||
246 | 247 | ||
247 | udelay(100); | 248 | udelay(100); |
248 | 249 | ||
249 | omap_cfg_reg(M15_24XX_GPIO92); | 250 | omap_mux_init_gpio(92, 0); |
250 | if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0) | 251 | if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0) |
251 | gpmc_cs_free(eth_cs); | 252 | gpmc_cs_free(eth_cs); |
252 | 253 | ||
@@ -272,27 +273,6 @@ static struct omap_lcd_config h4_lcd_config __initdata = { | |||
272 | }; | 273 | }; |
273 | 274 | ||
274 | static struct omap_usb_config h4_usb_config __initdata = { | 275 | static struct omap_usb_config h4_usb_config __initdata = { |
275 | #ifdef CONFIG_MACH_OMAP2_H4_USB1 | ||
276 | /* NOTE: usb1 could also be used with 3 wire signaling */ | ||
277 | .pins[1] = 4, | ||
278 | #endif | ||
279 | |||
280 | #ifdef CONFIG_MACH_OMAP_H4_OTG | ||
281 | /* S1.10 ON -- USB OTG port | ||
282 | * usb0 switched to Mini-AB port and isp1301 transceiver; | ||
283 | * S2.POS3 = OFF, S2.POS4 = ON ... to allow battery charging | ||
284 | */ | ||
285 | .otg = 1, | ||
286 | .pins[0] = 4, | ||
287 | #ifdef CONFIG_USB_GADGET_OMAP | ||
288 | /* use OTG cable, or standard A-to-MiniB */ | ||
289 | .hmc_mode = 0x14, /* 0:dev/otg 1:host 2:disable */ | ||
290 | #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
291 | /* use OTG cable, or NONSTANDARD (B-to-MiniB) */ | ||
292 | .hmc_mode = 0x11, /* 0:host 1:host 2:disable */ | ||
293 | #endif /* XX */ | ||
294 | |||
295 | #else | ||
296 | /* S1.10 OFF -- usb "download port" | 276 | /* S1.10 OFF -- usb "download port" |
297 | * usb0 switched to Mini-B port and isp1105 transceiver; | 277 | * usb0 switched to Mini-B port and isp1105 transceiver; |
298 | * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging | 278 | * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging |
@@ -301,7 +281,6 @@ static struct omap_usb_config h4_usb_config __initdata = { | |||
301 | .pins[0] = 3, | 281 | .pins[0] = 3, |
302 | /* .hmc_mode = 0x14,*/ /* 0:dev 1:host 2:disable */ | 282 | /* .hmc_mode = 0x14,*/ /* 0:dev 1:host 2:disable */ |
303 | .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */ | 283 | .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */ |
304 | #endif | ||
305 | }; | 284 | }; |
306 | 285 | ||
307 | static struct omap_board_config_kernel h4_config[] = { | 286 | static struct omap_board_config_kernel h4_config[] = { |
@@ -338,31 +317,54 @@ static struct i2c_board_info __initdata h4_i2c_board_info[] = { | |||
338 | }, | 317 | }, |
339 | }; | 318 | }; |
340 | 319 | ||
320 | #ifdef CONFIG_OMAP_MUX | ||
321 | static struct omap_board_mux board_mux[] __initdata = { | ||
322 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
323 | }; | ||
324 | #else | ||
325 | #define board_mux NULL | ||
326 | #endif | ||
327 | |||
341 | static void __init omap_h4_init(void) | 328 | static void __init omap_h4_init(void) |
342 | { | 329 | { |
330 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); | ||
331 | |||
343 | /* | 332 | /* |
344 | * Make sure the serial ports are muxed on at this point. | 333 | * Make sure the serial ports are muxed on at this point. |
345 | * You have to mux them off in device drivers later on | 334 | * You have to mux them off in device drivers later on |
346 | * if not needed. | 335 | * if not needed. |
347 | */ | 336 | */ |
348 | #if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE) | ||
349 | omap_cfg_reg(K15_24XX_UART3_TX); | ||
350 | omap_cfg_reg(K14_24XX_UART3_RX); | ||
351 | #endif | ||
352 | 337 | ||
353 | #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) | 338 | #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) |
339 | omap_mux_init_gpio(88, OMAP_PULL_ENA | OMAP_PULL_UP); | ||
340 | omap_mux_init_gpio(89, OMAP_PULL_ENA | OMAP_PULL_UP); | ||
341 | omap_mux_init_gpio(124, OMAP_PULL_ENA | OMAP_PULL_UP); | ||
342 | omap_mux_init_signal("mcbsp2_dr.gpio_11", OMAP_PULL_ENA | OMAP_PULL_UP); | ||
354 | if (omap_has_menelaus()) { | 343 | if (omap_has_menelaus()) { |
344 | omap_mux_init_signal("sdrc_a14.gpio0", | ||
345 | OMAP_PULL_ENA | OMAP_PULL_UP); | ||
346 | omap_mux_init_signal("vlynq_rx0.gpio_15", 0); | ||
347 | omap_mux_init_signal("gpio_98", 0); | ||
355 | row_gpios[5] = 0; | 348 | row_gpios[5] = 0; |
356 | col_gpios[2] = 15; | 349 | col_gpios[2] = 15; |
357 | col_gpios[6] = 18; | 350 | col_gpios[6] = 18; |
351 | } else { | ||
352 | omap_mux_init_signal("gpio_96", OMAP_PULL_ENA | OMAP_PULL_UP); | ||
353 | omap_mux_init_signal("gpio_100", 0); | ||
354 | omap_mux_init_signal("gpio_98", 0); | ||
358 | } | 355 | } |
356 | omap_mux_init_signal("gpio_90", 0); | ||
357 | omap_mux_init_signal("gpio_91", 0); | ||
358 | omap_mux_init_signal("gpio_36", 0); | ||
359 | omap_mux_init_signal("mcbsp2_clkx.gpio_12", 0); | ||
360 | omap_mux_init_signal("gpio_97", 0); | ||
359 | #endif | 361 | #endif |
360 | 362 | ||
361 | i2c_register_board_info(1, h4_i2c_board_info, | 363 | i2c_register_board_info(1, h4_i2c_board_info, |
362 | ARRAY_SIZE(h4_i2c_board_info)); | 364 | ARRAY_SIZE(h4_i2c_board_info)); |
363 | 365 | ||
364 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); | 366 | platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); |
365 | omap_usb_init(&h4_usb_config); | 367 | omap2_usbfs_init(&h4_usb_config); |
366 | omap_serial_init(); | 368 | omap_serial_init(); |
367 | } | 369 | } |
368 | 370 | ||
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index fefd7e6e9779..778afabf3b4e 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <plat/board.h> | 38 | #include <plat/board.h> |
39 | #include <plat/common.h> | 39 | #include <plat/common.h> |
40 | #include <plat/gpmc.h> | 40 | #include <plat/gpmc.h> |
41 | #include <mach/board-zoom.h> | ||
41 | 42 | ||
42 | #include <asm/delay.h> | 43 | #include <asm/delay.h> |
43 | #include <plat/control.h> | 44 | #include <plat/control.h> |
@@ -388,6 +389,38 @@ static struct omap_musb_board_data musb_board_data = { | |||
388 | .power = 100, | 389 | .power = 100, |
389 | }; | 390 | }; |
390 | 391 | ||
392 | static struct mtd_partition ldp_nand_partitions[] = { | ||
393 | /* All the partition sizes are listed in terms of NAND block size */ | ||
394 | { | ||
395 | .name = "X-Loader-NAND", | ||
396 | .offset = 0, | ||
397 | .size = 4 * (64 * 2048), /* 512KB, 0x80000 */ | ||
398 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
399 | }, | ||
400 | { | ||
401 | .name = "U-Boot-NAND", | ||
402 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ | ||
403 | .size = 10 * (64 * 2048), /* 1.25MB, 0x140000 */ | ||
404 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
405 | }, | ||
406 | { | ||
407 | .name = "Boot Env-NAND", | ||
408 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ | ||
409 | .size = 2 * (64 * 2048), /* 256KB, 0x40000 */ | ||
410 | }, | ||
411 | { | ||
412 | .name = "Kernel-NAND", | ||
413 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x0200000*/ | ||
414 | .size = 240 * (64 * 2048), /* 30M, 0x1E00000 */ | ||
415 | }, | ||
416 | { | ||
417 | .name = "File System - NAND", | ||
418 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x2000000 */ | ||
419 | .size = MTDPART_SIZ_FULL, /* 96MB, 0x6000000 */ | ||
420 | }, | ||
421 | |||
422 | }; | ||
423 | |||
391 | static void __init omap_ldp_init(void) | 424 | static void __init omap_ldp_init(void) |
392 | { | 425 | { |
393 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 426 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -400,6 +433,8 @@ static void __init omap_ldp_init(void) | |||
400 | ads7846_dev_init(); | 433 | ads7846_dev_init(); |
401 | omap_serial_init(); | 434 | omap_serial_init(); |
402 | usb_musb_init(&musb_board_data); | 435 | usb_musb_init(&musb_board_data); |
436 | board_nand_init(ldp_nand_partitions, | ||
437 | ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS); | ||
403 | 438 | ||
404 | omap2_hsmmc_init(mmc); | 439 | omap2_hsmmc_init(mmc); |
405 | /* link regulators to MMC adapters */ | 440 | /* link regulators to MMC adapters */ |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 3ccc34ebdcc7..5b9bbdc983bd 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include <plat/mmc.h> | 33 | #include <plat/mmc.h> |
34 | #include <plat/serial.h> | 34 | #include <plat/serial.h> |
35 | 35 | ||
36 | #include "mux.h" | ||
37 | |||
36 | static int slot1_cover_open; | 38 | static int slot1_cover_open; |
37 | static int slot2_cover_open; | 39 | static int slot2_cover_open; |
38 | static struct device *mmc_device; | 40 | static struct device *mmc_device; |
@@ -649,8 +651,17 @@ static void __init n8x0_init_irq(void) | |||
649 | omap_gpio_init(); | 651 | omap_gpio_init(); |
650 | } | 652 | } |
651 | 653 | ||
654 | #ifdef CONFIG_OMAP_MUX | ||
655 | static struct omap_board_mux board_mux[] __initdata = { | ||
656 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
657 | }; | ||
658 | #else | ||
659 | #define board_mux NULL | ||
660 | #endif | ||
661 | |||
652 | static void __init n8x0_init_machine(void) | 662 | static void __init n8x0_init_machine(void) |
653 | { | 663 | { |
664 | omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); | ||
654 | /* FIXME: add n810 spi devices */ | 665 | /* FIXME: add n810 spi devices */ |
655 | spi_register_board_info(n800_spi_board_info, | 666 | spi_register_board_info(n800_spi_board_info, |
656 | ARRAY_SIZE(n800_spi_board_info)); | 667 | ARRAY_SIZE(n800_spi_board_info)); |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 69b154cdc75d..dc5a7e8790c0 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -48,9 +48,6 @@ | |||
48 | #include "mux.h" | 48 | #include "mux.h" |
49 | #include "hsmmc.h" | 49 | #include "hsmmc.h" |
50 | 50 | ||
51 | #define GPMC_CS0_BASE 0x60 | ||
52 | #define GPMC_CS_SIZE 0x30 | ||
53 | |||
54 | #define NAND_BLOCK_SIZE SZ_128K | 51 | #define NAND_BLOCK_SIZE SZ_128K |
55 | 52 | ||
56 | static struct mtd_partition omap3beagle_nand_partitions[] = { | 53 | static struct mtd_partition omap3beagle_nand_partitions[] = { |
@@ -93,20 +90,6 @@ static struct omap_nand_platform_data omap3beagle_nand_data = { | |||
93 | .dev_ready = NULL, | 90 | .dev_ready = NULL, |
94 | }; | 91 | }; |
95 | 92 | ||
96 | static struct resource omap3beagle_nand_resource = { | ||
97 | .flags = IORESOURCE_MEM, | ||
98 | }; | ||
99 | |||
100 | static struct platform_device omap3beagle_nand_device = { | ||
101 | .name = "omap2-nand", | ||
102 | .id = -1, | ||
103 | .dev = { | ||
104 | .platform_data = &omap3beagle_nand_data, | ||
105 | }, | ||
106 | .num_resources = 1, | ||
107 | .resource = &omap3beagle_nand_resource, | ||
108 | }; | ||
109 | |||
110 | /* DSS */ | 93 | /* DSS */ |
111 | 94 | ||
112 | static int beagle_enable_dvi(struct omap_dss_device *dssdev) | 95 | static int beagle_enable_dvi(struct omap_dss_device *dssdev) |
@@ -424,8 +407,6 @@ static void __init omap3beagle_flash_init(void) | |||
424 | u8 cs = 0; | 407 | u8 cs = 0; |
425 | u8 nandcs = GPMC_CS_NUM + 1; | 408 | u8 nandcs = GPMC_CS_NUM + 1; |
426 | 409 | ||
427 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
428 | |||
429 | /* find out the chip-select on which NAND exists */ | 410 | /* find out the chip-select on which NAND exists */ |
430 | while (cs < GPMC_CS_NUM) { | 411 | while (cs < GPMC_CS_NUM) { |
431 | u32 ret = 0; | 412 | u32 ret = 0; |
@@ -447,12 +428,9 @@ static void __init omap3beagle_flash_init(void) | |||
447 | 428 | ||
448 | if (nandcs < GPMC_CS_NUM) { | 429 | if (nandcs < GPMC_CS_NUM) { |
449 | omap3beagle_nand_data.cs = nandcs; | 430 | omap3beagle_nand_data.cs = nandcs; |
450 | omap3beagle_nand_data.gpmc_cs_baseaddr = (void *) | ||
451 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
452 | omap3beagle_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add); | ||
453 | 431 | ||
454 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 432 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
455 | if (platform_device_register(&omap3beagle_nand_device) < 0) | 433 | if (gpmc_nand_init(&omap3beagle_nand_data) < 0) |
456 | printk(KERN_ERR "Unable to register NAND device\n"); | 434 | printk(KERN_ERR "Unable to register NAND device\n"); |
457 | } | 435 | } |
458 | } | 436 | } |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index db06dc910ba7..a58bdef1b4da 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -25,6 +25,9 @@ | |||
25 | #include <linux/spi/ads7846.h> | 25 | #include <linux/spi/ads7846.h> |
26 | #include <linux/regulator/machine.h> | 26 | #include <linux/regulator/machine.h> |
27 | #include <linux/i2c/twl.h> | 27 | #include <linux/i2c/twl.h> |
28 | #include <linux/spi/wl12xx.h> | ||
29 | #include <linux/mtd/partitions.h> | ||
30 | #include <linux/mtd/nand.h> | ||
28 | #include <linux/leds.h> | 31 | #include <linux/leds.h> |
29 | #include <linux/input.h> | 32 | #include <linux/input.h> |
30 | #include <linux/input/matrix_keypad.h> | 33 | #include <linux/input/matrix_keypad.h> |
@@ -41,15 +44,49 @@ | |||
41 | #include <plat/mcspi.h> | 44 | #include <plat/mcspi.h> |
42 | #include <plat/usb.h> | 45 | #include <plat/usb.h> |
43 | #include <plat/display.h> | 46 | #include <plat/display.h> |
47 | #include <plat/nand.h> | ||
44 | 48 | ||
45 | #include "mux.h" | 49 | #include "mux.h" |
46 | #include "sdram-micron-mt46h32m32lf-6.h" | 50 | #include "sdram-micron-mt46h32m32lf-6.h" |
47 | #include "hsmmc.h" | 51 | #include "hsmmc.h" |
48 | 52 | ||
53 | #define PANDORA_WIFI_IRQ_GPIO 21 | ||
54 | #define PANDORA_WIFI_NRESET_GPIO 23 | ||
49 | #define OMAP3_PANDORA_TS_GPIO 94 | 55 | #define OMAP3_PANDORA_TS_GPIO 94 |
50 | 56 | ||
51 | /* hardware debounce: (value + 1) * 31us */ | 57 | #define NAND_BLOCK_SIZE SZ_128K |
52 | #define GPIO_DEBOUNCE_TIME 127 | 58 | |
59 | static struct mtd_partition omap3pandora_nand_partitions[] = { | ||
60 | { | ||
61 | .name = "xloader", | ||
62 | .offset = 0, | ||
63 | .size = 4 * NAND_BLOCK_SIZE, | ||
64 | .mask_flags = MTD_WRITEABLE | ||
65 | }, { | ||
66 | .name = "uboot", | ||
67 | .offset = MTDPART_OFS_APPEND, | ||
68 | .size = 15 * NAND_BLOCK_SIZE, | ||
69 | }, { | ||
70 | .name = "uboot-env", | ||
71 | .offset = MTDPART_OFS_APPEND, | ||
72 | .size = 1 * NAND_BLOCK_SIZE, | ||
73 | }, { | ||
74 | .name = "boot", | ||
75 | .offset = MTDPART_OFS_APPEND, | ||
76 | .size = 80 * NAND_BLOCK_SIZE, | ||
77 | }, { | ||
78 | .name = "rootfs", | ||
79 | .offset = MTDPART_OFS_APPEND, | ||
80 | .size = MTDPART_SIZ_FULL, | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | static struct omap_nand_platform_data pandora_nand_data = { | ||
85 | .cs = 0, | ||
86 | .devsize = 1, /* '0' for 8-bit, '1' for 16-bit device */ | ||
87 | .parts = omap3pandora_nand_partitions, | ||
88 | .nr_parts = ARRAY_SIZE(omap3pandora_nand_partitions), | ||
89 | }; | ||
53 | 90 | ||
54 | static struct gpio_led pandora_gpio_leds[] = { | 91 | static struct gpio_led pandora_gpio_leds[] = { |
55 | { | 92 | { |
@@ -88,6 +125,7 @@ static struct platform_device pandora_leds_gpio = { | |||
88 | .type = ev_type, \ | 125 | .type = ev_type, \ |
89 | .code = ev_code, \ | 126 | .code = ev_code, \ |
90 | .active_low = act_low, \ | 127 | .active_low = act_low, \ |
128 | .debounce_interval = 4, \ | ||
91 | .desc = "btn " descr, \ | 129 | .desc = "btn " descr, \ |
92 | } | 130 | } |
93 | 131 | ||
@@ -99,14 +137,14 @@ static struct gpio_keys_button pandora_gpio_keys[] = { | |||
99 | GPIO_BUTTON_LOW(103, KEY_DOWN, "down"), | 137 | GPIO_BUTTON_LOW(103, KEY_DOWN, "down"), |
100 | GPIO_BUTTON_LOW(96, KEY_LEFT, "left"), | 138 | GPIO_BUTTON_LOW(96, KEY_LEFT, "left"), |
101 | GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"), | 139 | GPIO_BUTTON_LOW(98, KEY_RIGHT, "right"), |
102 | GPIO_BUTTON_LOW(109, KEY_KP1, "game 1"), | 140 | GPIO_BUTTON_LOW(109, KEY_PAGEUP, "game 1"), |
103 | GPIO_BUTTON_LOW(111, KEY_KP2, "game 2"), | 141 | GPIO_BUTTON_LOW(111, KEY_END, "game 2"), |
104 | GPIO_BUTTON_LOW(106, KEY_KP3, "game 3"), | 142 | GPIO_BUTTON_LOW(106, KEY_PAGEDOWN, "game 3"), |
105 | GPIO_BUTTON_LOW(101, KEY_KP4, "game 4"), | 143 | GPIO_BUTTON_LOW(101, KEY_HOME, "game 4"), |
106 | GPIO_BUTTON_LOW(102, BTN_TL, "l"), | 144 | GPIO_BUTTON_LOW(102, KEY_RIGHTSHIFT, "l"), |
107 | GPIO_BUTTON_LOW(97, BTN_TL2, "l2"), | 145 | GPIO_BUTTON_LOW(97, KEY_KPPLUS, "l2"), |
108 | GPIO_BUTTON_LOW(105, BTN_TR, "r"), | 146 | GPIO_BUTTON_LOW(105, KEY_RIGHTCTRL, "r"), |
109 | GPIO_BUTTON_LOW(107, BTN_TR2, "r2"), | 147 | GPIO_BUTTON_LOW(107, KEY_KPMINUS, "r2"), |
110 | GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"), | 148 | GPIO_BUTTON_LOW(104, KEY_LEFTCTRL, "ctrl"), |
111 | GPIO_BUTTON_LOW(99, KEY_MENU, "menu"), | 149 | GPIO_BUTTON_LOW(99, KEY_MENU, "menu"), |
112 | GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"), | 150 | GPIO_BUTTON_LOW(176, KEY_COFFEE, "hold"), |
@@ -127,14 +165,7 @@ static struct platform_device pandora_keys_gpio = { | |||
127 | }, | 165 | }, |
128 | }; | 166 | }; |
129 | 167 | ||
130 | static void __init pandora_keys_gpio_init(void) | 168 | static const uint32_t board_keymap[] = { |
131 | { | ||
132 | /* set debounce time for GPIO banks 4 and 6 */ | ||
133 | gpio_set_debounce(32 * 3, GPIO_DEBOUNCE_TIME); | ||
134 | gpio_set_debounce(32 * 5, GPIO_DEBOUNCE_TIME); | ||
135 | } | ||
136 | |||
137 | static int board_keymap[] = { | ||
138 | /* row, col, code */ | 169 | /* row, col, code */ |
139 | KEY(0, 0, KEY_9), | 170 | KEY(0, 0, KEY_9), |
140 | KEY(0, 1, KEY_8), | 171 | KEY(0, 1, KEY_8), |
@@ -255,12 +286,33 @@ static struct omap2_hsmmc_info omap3pandora_mmc[] = { | |||
255 | static int omap3pandora_twl_gpio_setup(struct device *dev, | 286 | static int omap3pandora_twl_gpio_setup(struct device *dev, |
256 | unsigned gpio, unsigned ngpio) | 287 | unsigned gpio, unsigned ngpio) |
257 | { | 288 | { |
289 | int ret, gpio_32khz; | ||
290 | |||
258 | /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ | 291 | /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ |
259 | omap3pandora_mmc[0].gpio_cd = gpio + 0; | 292 | omap3pandora_mmc[0].gpio_cd = gpio + 0; |
260 | omap3pandora_mmc[1].gpio_cd = gpio + 1; | 293 | omap3pandora_mmc[1].gpio_cd = gpio + 1; |
261 | omap2_hsmmc_init(omap3pandora_mmc); | 294 | omap2_hsmmc_init(omap3pandora_mmc); |
262 | 295 | ||
296 | /* gpio + 13 drives 32kHz buffer for wifi module */ | ||
297 | gpio_32khz = gpio + 13; | ||
298 | ret = gpio_request(gpio_32khz, "wifi 32kHz"); | ||
299 | if (ret < 0) { | ||
300 | pr_err("Cannot get GPIO line %d, ret=%d\n", gpio_32khz, ret); | ||
301 | goto fail; | ||
302 | } | ||
303 | |||
304 | ret = gpio_direction_output(gpio_32khz, 1); | ||
305 | if (ret < 0) { | ||
306 | pr_err("Cannot set GPIO line %d, ret=%d\n", gpio_32khz, ret); | ||
307 | goto fail_direction; | ||
308 | } | ||
309 | |||
263 | return 0; | 310 | return 0; |
311 | |||
312 | fail_direction: | ||
313 | gpio_free(gpio_32khz); | ||
314 | fail: | ||
315 | return -ENODEV; | ||
264 | } | 316 | } |
265 | 317 | ||
266 | static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | 318 | static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { |
@@ -539,10 +591,67 @@ static void __init omap3pandora_init_irq(void) | |||
539 | omap_gpio_init(); | 591 | omap_gpio_init(); |
540 | } | 592 | } |
541 | 593 | ||
594 | static void pandora_wl1251_set_power(bool enable) | ||
595 | { | ||
596 | /* | ||
597 | * Keep power always on until wl1251_sdio driver learns to re-init | ||
598 | * the chip after powering it down and back up. | ||
599 | */ | ||
600 | } | ||
601 | |||
602 | static struct wl12xx_platform_data pandora_wl1251_pdata = { | ||
603 | .set_power = pandora_wl1251_set_power, | ||
604 | .use_eeprom = true, | ||
605 | }; | ||
606 | |||
607 | static struct platform_device pandora_wl1251_data = { | ||
608 | .name = "wl1251_data", | ||
609 | .id = -1, | ||
610 | .dev = { | ||
611 | .platform_data = &pandora_wl1251_pdata, | ||
612 | }, | ||
613 | }; | ||
614 | |||
615 | static void pandora_wl1251_init(void) | ||
616 | { | ||
617 | int ret; | ||
618 | |||
619 | ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq"); | ||
620 | if (ret < 0) | ||
621 | goto fail; | ||
622 | |||
623 | ret = gpio_direction_input(PANDORA_WIFI_IRQ_GPIO); | ||
624 | if (ret < 0) | ||
625 | goto fail_irq; | ||
626 | |||
627 | pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO); | ||
628 | if (pandora_wl1251_pdata.irq < 0) | ||
629 | goto fail_irq; | ||
630 | |||
631 | ret = gpio_request(PANDORA_WIFI_NRESET_GPIO, "wl1251 nreset"); | ||
632 | if (ret < 0) | ||
633 | goto fail_irq; | ||
634 | |||
635 | /* start powered so that it probes with MMC subsystem */ | ||
636 | ret = gpio_direction_output(PANDORA_WIFI_NRESET_GPIO, 1); | ||
637 | if (ret < 0) | ||
638 | goto fail_nreset; | ||
639 | |||
640 | return; | ||
641 | |||
642 | fail_nreset: | ||
643 | gpio_free(PANDORA_WIFI_NRESET_GPIO); | ||
644 | fail_irq: | ||
645 | gpio_free(PANDORA_WIFI_IRQ_GPIO); | ||
646 | fail: | ||
647 | printk(KERN_ERR "wl1251 board initialisation failed\n"); | ||
648 | } | ||
649 | |||
542 | static struct platform_device *omap3pandora_devices[] __initdata = { | 650 | static struct platform_device *omap3pandora_devices[] __initdata = { |
543 | &pandora_leds_gpio, | 651 | &pandora_leds_gpio, |
544 | &pandora_keys_gpio, | 652 | &pandora_keys_gpio, |
545 | &pandora_dss_device, | 653 | &pandora_dss_device, |
654 | &pandora_wl1251_data, | ||
546 | }; | 655 | }; |
547 | 656 | ||
548 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 657 | static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
@@ -575,6 +684,7 @@ static void __init omap3pandora_init(void) | |||
575 | { | 684 | { |
576 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 685 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
577 | omap3pandora_i2c_init(); | 686 | omap3pandora_i2c_init(); |
687 | pandora_wl1251_init(); | ||
578 | platform_add_devices(omap3pandora_devices, | 688 | platform_add_devices(omap3pandora_devices, |
579 | ARRAY_SIZE(omap3pandora_devices)); | 689 | ARRAY_SIZE(omap3pandora_devices)); |
580 | omap_serial_init(); | 690 | omap_serial_init(); |
@@ -582,8 +692,8 @@ static void __init omap3pandora_init(void) | |||
582 | ARRAY_SIZE(omap3pandora_spi_board_info)); | 692 | ARRAY_SIZE(omap3pandora_spi_board_info)); |
583 | omap3pandora_ads7846_init(); | 693 | omap3pandora_ads7846_init(); |
584 | usb_ehci_init(&ehci_pdata); | 694 | usb_ehci_init(&ehci_pdata); |
585 | pandora_keys_gpio_init(); | ||
586 | usb_musb_init(&musb_board_data); | 695 | usb_musb_init(&musb_board_data); |
696 | gpmc_nand_init(&pandora_nand_data); | ||
587 | 697 | ||
588 | /* Ensure SDRC pins are mux'd for self-refresh */ | 698 | /* Ensure SDRC pins are mux'd for self-refresh */ |
589 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 699 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 2f5f8233dd5b..288f9d5c7291 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -54,9 +54,6 @@ | |||
54 | 54 | ||
55 | #include <asm/setup.h> | 55 | #include <asm/setup.h> |
56 | 56 | ||
57 | #define GPMC_CS0_BASE 0x60 | ||
58 | #define GPMC_CS_SIZE 0x30 | ||
59 | |||
60 | #define NAND_BLOCK_SIZE SZ_128K | 57 | #define NAND_BLOCK_SIZE SZ_128K |
61 | 58 | ||
62 | #define OMAP3_AC_GPIO 136 | 59 | #define OMAP3_AC_GPIO 136 |
@@ -106,20 +103,6 @@ static struct omap_nand_platform_data omap3touchbook_nand_data = { | |||
106 | .dev_ready = NULL, | 103 | .dev_ready = NULL, |
107 | }; | 104 | }; |
108 | 105 | ||
109 | static struct resource omap3touchbook_nand_resource = { | ||
110 | .flags = IORESOURCE_MEM, | ||
111 | }; | ||
112 | |||
113 | static struct platform_device omap3touchbook_nand_device = { | ||
114 | .name = "omap2-nand", | ||
115 | .id = -1, | ||
116 | .dev = { | ||
117 | .platform_data = &omap3touchbook_nand_data, | ||
118 | }, | ||
119 | .num_resources = 1, | ||
120 | .resource = &omap3touchbook_nand_resource, | ||
121 | }; | ||
122 | |||
123 | #include "sdram-micron-mt46h32m32lf-6.h" | 106 | #include "sdram-micron-mt46h32m32lf-6.h" |
124 | 107 | ||
125 | static struct omap2_hsmmc_info mmc[] = { | 108 | static struct omap2_hsmmc_info mmc[] = { |
@@ -458,8 +441,6 @@ static void __init omap3touchbook_flash_init(void) | |||
458 | u8 cs = 0; | 441 | u8 cs = 0; |
459 | u8 nandcs = GPMC_CS_NUM + 1; | 442 | u8 nandcs = GPMC_CS_NUM + 1; |
460 | 443 | ||
461 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
462 | |||
463 | /* find out the chip-select on which NAND exists */ | 444 | /* find out the chip-select on which NAND exists */ |
464 | while (cs < GPMC_CS_NUM) { | 445 | while (cs < GPMC_CS_NUM) { |
465 | u32 ret = 0; | 446 | u32 ret = 0; |
@@ -481,13 +462,9 @@ static void __init omap3touchbook_flash_init(void) | |||
481 | 462 | ||
482 | if (nandcs < GPMC_CS_NUM) { | 463 | if (nandcs < GPMC_CS_NUM) { |
483 | omap3touchbook_nand_data.cs = nandcs; | 464 | omap3touchbook_nand_data.cs = nandcs; |
484 | omap3touchbook_nand_data.gpmc_cs_baseaddr = (void *) | ||
485 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
486 | omap3touchbook_nand_data.gpmc_baseaddr = | ||
487 | (void *) (gpmc_base_add); | ||
488 | 465 | ||
489 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 466 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
490 | if (platform_device_register(&omap3touchbook_nand_device) < 0) | 467 | if (gpmc_nand_init(&omap3touchbook_nand_data) < 0) |
491 | printk(KERN_ERR "Unable to register NAND device\n"); | 468 | printk(KERN_ERR "Unable to register NAND device\n"); |
492 | } | 469 | } |
493 | } | 470 | } |
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c new file mode 100644 index 000000000000..c03d1d56db56 --- /dev/null +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -0,0 +1,304 @@ | |||
1 | /* | ||
2 | * Board support file for OMAP4430 based PandaBoard. | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * | ||
6 | * Author: David Anders <x0132446@ti.com> | ||
7 | * | ||
8 | * Based on mach-omap2/board-4430sdp.c | ||
9 | * | ||
10 | * Author: Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
11 | * | ||
12 | * Based on mach-omap2/board-3430sdp.c | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License version 2 as | ||
16 | * published by the Free Software Foundation. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/gpio.h> | ||
24 | #include <linux/usb/otg.h> | ||
25 | #include <linux/i2c/twl.h> | ||
26 | #include <linux/regulator/machine.h> | ||
27 | |||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/omap4-common.h> | ||
30 | #include <asm/mach-types.h> | ||
31 | #include <asm/mach/arch.h> | ||
32 | #include <asm/mach/map.h> | ||
33 | |||
34 | #include <plat/board.h> | ||
35 | #include <plat/common.h> | ||
36 | #include <plat/control.h> | ||
37 | #include <plat/timer-gp.h> | ||
38 | #include <plat/usb.h> | ||
39 | #include <plat/mmc.h> | ||
40 | #include "hsmmc.h" | ||
41 | |||
42 | |||
43 | static void __init omap4_panda_init_irq(void) | ||
44 | { | ||
45 | omap2_init_common_hw(NULL, NULL); | ||
46 | gic_init_irq(); | ||
47 | omap_gpio_init(); | ||
48 | } | ||
49 | |||
50 | static struct omap_musb_board_data musb_board_data = { | ||
51 | .interface_type = MUSB_INTERFACE_UTMI, | ||
52 | .mode = MUSB_PERIPHERAL, | ||
53 | .power = 100, | ||
54 | }; | ||
55 | |||
56 | static struct omap2_hsmmc_info mmc[] = { | ||
57 | { | ||
58 | .mmc = 1, | ||
59 | .wires = 8, | ||
60 | .gpio_wp = -EINVAL, | ||
61 | }, | ||
62 | {} /* Terminator */ | ||
63 | }; | ||
64 | |||
65 | static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { | ||
66 | { | ||
67 | .supply = "vmmc", | ||
68 | .dev_name = "mmci-omap-hs.0", | ||
69 | }, | ||
70 | { | ||
71 | .supply = "vmmc", | ||
72 | .dev_name = "mmci-omap-hs.1", | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | static int omap4_twl6030_hsmmc_late_init(struct device *dev) | ||
77 | { | ||
78 | int ret = 0; | ||
79 | struct platform_device *pdev = container_of(dev, | ||
80 | struct platform_device, dev); | ||
81 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
82 | |||
83 | /* Setting MMC1 Card detect Irq */ | ||
84 | if (pdev->id == 0) | ||
85 | pdata->slots[0].card_detect_irq = TWL6030_IRQ_BASE + | ||
86 | MMCDETECT_INTR_OFFSET; | ||
87 | return ret; | ||
88 | } | ||
89 | |||
90 | static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) | ||
91 | { | ||
92 | struct omap_mmc_platform_data *pdata = dev->platform_data; | ||
93 | |||
94 | pdata->init = omap4_twl6030_hsmmc_late_init; | ||
95 | } | ||
96 | |||
97 | static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
98 | { | ||
99 | struct omap2_hsmmc_info *c; | ||
100 | |||
101 | omap2_hsmmc_init(controllers); | ||
102 | for (c = controllers; c->mmc; c++) | ||
103 | omap4_twl6030_hsmmc_set_late_init(c->dev); | ||
104 | |||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | static struct regulator_init_data omap4_panda_vaux1 = { | ||
109 | .constraints = { | ||
110 | .min_uV = 1000000, | ||
111 | .max_uV = 3000000, | ||
112 | .apply_uV = true, | ||
113 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
114 | | REGULATOR_MODE_STANDBY, | ||
115 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
116 | | REGULATOR_CHANGE_MODE | ||
117 | | REGULATOR_CHANGE_STATUS, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | static struct regulator_init_data omap4_panda_vaux2 = { | ||
122 | .constraints = { | ||
123 | .min_uV = 1200000, | ||
124 | .max_uV = 2800000, | ||
125 | .apply_uV = true, | ||
126 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
127 | | REGULATOR_MODE_STANDBY, | ||
128 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
129 | | REGULATOR_CHANGE_MODE | ||
130 | | REGULATOR_CHANGE_STATUS, | ||
131 | }, | ||
132 | }; | ||
133 | |||
134 | static struct regulator_init_data omap4_panda_vaux3 = { | ||
135 | .constraints = { | ||
136 | .min_uV = 1000000, | ||
137 | .max_uV = 3000000, | ||
138 | .apply_uV = true, | ||
139 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
140 | | REGULATOR_MODE_STANDBY, | ||
141 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
142 | | REGULATOR_CHANGE_MODE | ||
143 | | REGULATOR_CHANGE_STATUS, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | /* VMMC1 for MMC1 card */ | ||
148 | static struct regulator_init_data omap4_panda_vmmc = { | ||
149 | .constraints = { | ||
150 | .min_uV = 1200000, | ||
151 | .max_uV = 3000000, | ||
152 | .apply_uV = true, | ||
153 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
154 | | REGULATOR_MODE_STANDBY, | ||
155 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
156 | | REGULATOR_CHANGE_MODE | ||
157 | | REGULATOR_CHANGE_STATUS, | ||
158 | }, | ||
159 | .num_consumer_supplies = 2, | ||
160 | .consumer_supplies = omap4_panda_vmmc_supply, | ||
161 | }; | ||
162 | |||
163 | static struct regulator_init_data omap4_panda_vpp = { | ||
164 | .constraints = { | ||
165 | .min_uV = 1800000, | ||
166 | .max_uV = 2500000, | ||
167 | .apply_uV = true, | ||
168 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
169 | | REGULATOR_MODE_STANDBY, | ||
170 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
171 | | REGULATOR_CHANGE_MODE | ||
172 | | REGULATOR_CHANGE_STATUS, | ||
173 | }, | ||
174 | }; | ||
175 | |||
176 | static struct regulator_init_data omap4_panda_vusim = { | ||
177 | .constraints = { | ||
178 | .min_uV = 1200000, | ||
179 | .max_uV = 2900000, | ||
180 | .apply_uV = true, | ||
181 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
182 | | REGULATOR_MODE_STANDBY, | ||
183 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
184 | | REGULATOR_CHANGE_MODE | ||
185 | | REGULATOR_CHANGE_STATUS, | ||
186 | }, | ||
187 | }; | ||
188 | |||
189 | static struct regulator_init_data omap4_panda_vana = { | ||
190 | .constraints = { | ||
191 | .min_uV = 2100000, | ||
192 | .max_uV = 2100000, | ||
193 | .apply_uV = true, | ||
194 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
195 | | REGULATOR_MODE_STANDBY, | ||
196 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
197 | | REGULATOR_CHANGE_STATUS, | ||
198 | }, | ||
199 | }; | ||
200 | |||
201 | static struct regulator_init_data omap4_panda_vcxio = { | ||
202 | .constraints = { | ||
203 | .min_uV = 1800000, | ||
204 | .max_uV = 1800000, | ||
205 | .apply_uV = true, | ||
206 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
207 | | REGULATOR_MODE_STANDBY, | ||
208 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
209 | | REGULATOR_CHANGE_STATUS, | ||
210 | }, | ||
211 | }; | ||
212 | |||
213 | static struct regulator_init_data omap4_panda_vdac = { | ||
214 | .constraints = { | ||
215 | .min_uV = 1800000, | ||
216 | .max_uV = 1800000, | ||
217 | .apply_uV = true, | ||
218 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
219 | | REGULATOR_MODE_STANDBY, | ||
220 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
221 | | REGULATOR_CHANGE_STATUS, | ||
222 | }, | ||
223 | }; | ||
224 | |||
225 | static struct regulator_init_data omap4_panda_vusb = { | ||
226 | .constraints = { | ||
227 | .min_uV = 3300000, | ||
228 | .max_uV = 3300000, | ||
229 | .apply_uV = true, | ||
230 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
231 | | REGULATOR_MODE_STANDBY, | ||
232 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
233 | | REGULATOR_CHANGE_STATUS, | ||
234 | }, | ||
235 | }; | ||
236 | |||
237 | static struct twl4030_platform_data omap4_panda_twldata = { | ||
238 | .irq_base = TWL6030_IRQ_BASE, | ||
239 | .irq_end = TWL6030_IRQ_END, | ||
240 | |||
241 | /* Regulators */ | ||
242 | .vmmc = &omap4_panda_vmmc, | ||
243 | .vpp = &omap4_panda_vpp, | ||
244 | .vusim = &omap4_panda_vusim, | ||
245 | .vana = &omap4_panda_vana, | ||
246 | .vcxio = &omap4_panda_vcxio, | ||
247 | .vdac = &omap4_panda_vdac, | ||
248 | .vusb = &omap4_panda_vusb, | ||
249 | .vaux1 = &omap4_panda_vaux1, | ||
250 | .vaux2 = &omap4_panda_vaux2, | ||
251 | .vaux3 = &omap4_panda_vaux3, | ||
252 | }; | ||
253 | |||
254 | static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = { | ||
255 | { | ||
256 | I2C_BOARD_INFO("twl6030", 0x48), | ||
257 | .flags = I2C_CLIENT_WAKE, | ||
258 | .irq = OMAP44XX_IRQ_SYS_1N, | ||
259 | .platform_data = &omap4_panda_twldata, | ||
260 | }, | ||
261 | }; | ||
262 | static int __init omap4_panda_i2c_init(void) | ||
263 | { | ||
264 | /* | ||
265 | * Phoenix Audio IC needs I2C1 to | ||
266 | * start with 400 KHz or less | ||
267 | */ | ||
268 | omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo, | ||
269 | ARRAY_SIZE(omap4_panda_i2c_boardinfo)); | ||
270 | omap_register_i2c_bus(2, 400, NULL, 0); | ||
271 | omap_register_i2c_bus(3, 400, NULL, 0); | ||
272 | omap_register_i2c_bus(4, 400, NULL, 0); | ||
273 | return 0; | ||
274 | } | ||
275 | static void __init omap4_panda_init(void) | ||
276 | { | ||
277 | int status; | ||
278 | |||
279 | omap4_panda_i2c_init(); | ||
280 | omap_serial_init(); | ||
281 | omap4_twl6030_hsmmc_init(mmc); | ||
282 | /* OMAP4 Panda uses internal transceiver so register nop transceiver */ | ||
283 | usb_nop_xceiv_register(); | ||
284 | /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ | ||
285 | if (!cpu_is_omap44xx()) | ||
286 | usb_musb_init(&musb_board_data); | ||
287 | } | ||
288 | |||
289 | static void __init omap4_panda_map_io(void) | ||
290 | { | ||
291 | omap2_set_globals_443x(); | ||
292 | omap44xx_map_common_io(); | ||
293 | } | ||
294 | |||
295 | MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") | ||
296 | /* Maintainer: David Anders - Texas Instruments Inc */ | ||
297 | .phys_io = 0x48000000, | ||
298 | .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, | ||
299 | .boot_params = 0x80000100, | ||
300 | .map_io = omap4_panda_map_io, | ||
301 | .init_irq = omap4_panda_init_irq, | ||
302 | .init_machine = omap4_panda_init, | ||
303 | .timer = &omap_timer, | ||
304 | MACHINE_END | ||
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 79ac41400c21..7fe3296faa25 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -58,8 +58,6 @@ | |||
58 | #define OVERO_GPIO_USBH_NRESET 183 | 58 | #define OVERO_GPIO_USBH_NRESET 183 |
59 | 59 | ||
60 | #define NAND_BLOCK_SIZE SZ_128K | 60 | #define NAND_BLOCK_SIZE SZ_128K |
61 | #define GPMC_CS0_BASE 0x60 | ||
62 | #define GPMC_CS_SIZE 0x30 | ||
63 | 61 | ||
64 | #define OVERO_SMSC911X_CS 5 | 62 | #define OVERO_SMSC911X_CS 5 |
65 | #define OVERO_SMSC911X_GPIO 176 | 63 | #define OVERO_SMSC911X_GPIO 176 |
@@ -166,9 +164,26 @@ static struct platform_device overo_smsc911x_device = { | |||
166 | }, | 164 | }, |
167 | }; | 165 | }; |
168 | 166 | ||
167 | static struct platform_device overo_smsc911x2_device = { | ||
168 | .name = "smsc911x", | ||
169 | .id = 1, | ||
170 | .num_resources = ARRAY_SIZE(overo_smsc911x2_resources), | ||
171 | .resource = overo_smsc911x2_resources, | ||
172 | .dev = { | ||
173 | .platform_data = &overo_smsc911x_config, | ||
174 | }, | ||
175 | }; | ||
176 | |||
177 | static struct platform_device *smsc911x_devices[] = { | ||
178 | &overo_smsc911x_device, | ||
179 | &overo_smsc911x2_device, | ||
180 | }; | ||
181 | |||
169 | static inline void __init overo_init_smsc911x(void) | 182 | static inline void __init overo_init_smsc911x(void) |
170 | { | 183 | { |
171 | unsigned long cs_mem_base; | 184 | unsigned long cs_mem_base, cs_mem_base2; |
185 | |||
186 | /* set up first smsc911x chip */ | ||
172 | 187 | ||
173 | if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { | 188 | if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) { |
174 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); | 189 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n"); |
@@ -189,7 +204,28 @@ static inline void __init overo_init_smsc911x(void) | |||
189 | overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); | 204 | overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO); |
190 | overo_smsc911x_resources[1].end = 0; | 205 | overo_smsc911x_resources[1].end = 0; |
191 | 206 | ||
192 | platform_device_register(&overo_smsc911x_device); | 207 | /* set up second smsc911x chip */ |
208 | |||
209 | if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) { | ||
210 | printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n"); | ||
211 | return; | ||
212 | } | ||
213 | |||
214 | overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0; | ||
215 | overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff; | ||
216 | |||
217 | if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) && | ||
218 | (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) { | ||
219 | gpio_export(OVERO_SMSC911X2_GPIO, 0); | ||
220 | } else { | ||
221 | printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n"); | ||
222 | return; | ||
223 | } | ||
224 | |||
225 | overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO); | ||
226 | overo_smsc911x2_resources[1].end = 0; | ||
227 | |||
228 | platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices)); | ||
193 | } | 229 | } |
194 | 230 | ||
195 | #else | 231 | #else |
@@ -231,28 +267,11 @@ static struct omap_nand_platform_data overo_nand_data = { | |||
231 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | 267 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ |
232 | }; | 268 | }; |
233 | 269 | ||
234 | static struct resource overo_nand_resource = { | ||
235 | .flags = IORESOURCE_MEM, | ||
236 | }; | ||
237 | |||
238 | static struct platform_device overo_nand_device = { | ||
239 | .name = "omap2-nand", | ||
240 | .id = -1, | ||
241 | .dev = { | ||
242 | .platform_data = &overo_nand_data, | ||
243 | }, | ||
244 | .num_resources = 1, | ||
245 | .resource = &overo_nand_resource, | ||
246 | }; | ||
247 | |||
248 | |||
249 | static void __init overo_flash_init(void) | 270 | static void __init overo_flash_init(void) |
250 | { | 271 | { |
251 | u8 cs = 0; | 272 | u8 cs = 0; |
252 | u8 nandcs = GPMC_CS_NUM + 1; | 273 | u8 nandcs = GPMC_CS_NUM + 1; |
253 | 274 | ||
254 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
255 | |||
256 | /* find out the chip-select on which NAND exists */ | 275 | /* find out the chip-select on which NAND exists */ |
257 | while (cs < GPMC_CS_NUM) { | 276 | while (cs < GPMC_CS_NUM) { |
258 | u32 ret = 0; | 277 | u32 ret = 0; |
@@ -274,12 +293,9 @@ static void __init overo_flash_init(void) | |||
274 | 293 | ||
275 | if (nandcs < GPMC_CS_NUM) { | 294 | if (nandcs < GPMC_CS_NUM) { |
276 | overo_nand_data.cs = nandcs; | 295 | overo_nand_data.cs = nandcs; |
277 | overo_nand_data.gpmc_cs_baseaddr = (void *) | ||
278 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
279 | overo_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add); | ||
280 | 296 | ||
281 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | 297 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); |
282 | if (platform_device_register(&overo_nand_device) < 0) | 298 | if (gpmc_nand_init(&overo_nand_data) < 0) |
283 | printk(KERN_ERR "Unable to register NAND device\n"); | 299 | printk(KERN_ERR "Unable to register NAND device\n"); |
284 | } | 300 | } |
285 | } | 301 | } |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index c5555ca13d00..9a5eb87425fc 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/mmc/host.h> | 25 | #include <linux/mmc/host.h> |
26 | 26 | ||
27 | #include <plat/mcspi.h> | 27 | #include <plat/mcspi.h> |
28 | #include <plat/mux.h> | ||
29 | #include <plat/board.h> | 28 | #include <plat/board.h> |
30 | #include <plat/common.h> | 29 | #include <plat/common.h> |
31 | #include <plat/dma.h> | 30 | #include <plat/dma.h> |
@@ -33,6 +32,11 @@ | |||
33 | #include <plat/onenand.h> | 32 | #include <plat/onenand.h> |
34 | #include <plat/gpmc-smc91x.h> | 33 | #include <plat/gpmc-smc91x.h> |
35 | 34 | ||
35 | #include <sound/tlv320aic3x.h> | ||
36 | #include <sound/tpa6130a2-plat.h> | ||
37 | |||
38 | #include <../drivers/staging/iio/light/tsl2563.h> | ||
39 | |||
36 | #include "mux.h" | 40 | #include "mux.h" |
37 | #include "hsmmc.h" | 41 | #include "hsmmc.h" |
38 | 42 | ||
@@ -51,6 +55,12 @@ enum { | |||
51 | 55 | ||
52 | static struct wl12xx_platform_data wl1251_pdata; | 56 | static struct wl12xx_platform_data wl1251_pdata; |
53 | 57 | ||
58 | #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) | ||
59 | static struct tsl2563_platform_data rx51_tsl2563_platform_data = { | ||
60 | .cover_comp_gain = 16, | ||
61 | }; | ||
62 | #endif | ||
63 | |||
54 | static struct omap2_mcspi_device_config wl1251_mcspi_config = { | 64 | static struct omap2_mcspi_device_config wl1251_mcspi_config = { |
55 | .turbo_mode = 0, | 65 | .turbo_mode = 0, |
56 | .single_channel = 1, | 66 | .single_channel = 1, |
@@ -220,10 +230,10 @@ static int board_keymap[] = { | |||
220 | KEY(4, 4, KEY_LEFTCTRL), | 230 | KEY(4, 4, KEY_LEFTCTRL), |
221 | KEY(4, 5, KEY_RIGHTALT), | 231 | KEY(4, 5, KEY_RIGHTALT), |
222 | KEY(4, 6, KEY_LEFTSHIFT), | 232 | KEY(4, 6, KEY_LEFTSHIFT), |
223 | KEY(4, 8, KEY_10), | 233 | KEY(4, 8, KEY_F10), |
224 | 234 | ||
225 | KEY(5, 0, KEY_Y), | 235 | KEY(5, 0, KEY_Y), |
226 | KEY(5, 8, KEY_11), | 236 | KEY(5, 8, KEY_F11), |
227 | 237 | ||
228 | KEY(6, 0, KEY_U), | 238 | KEY(6, 0, KEY_U), |
229 | 239 | ||
@@ -311,48 +321,29 @@ static struct omap2_hsmmc_info mmc[] __initdata = { | |||
311 | {} /* Terminator */ | 321 | {} /* Terminator */ |
312 | }; | 322 | }; |
313 | 323 | ||
314 | static struct regulator_consumer_supply rx51_vmmc1_supply = { | 324 | static struct regulator_consumer_supply rx51_vmmc1_supply = |
315 | .supply = "vmmc", | 325 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); |
316 | .dev_name = "mmci-omap-hs.0", | ||
317 | }; | ||
318 | 326 | ||
319 | static struct regulator_consumer_supply rx51_vaux3_supply = { | 327 | static struct regulator_consumer_supply rx51_vaux3_supply = |
320 | .supply = "vmmc", | 328 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); |
321 | .dev_name = "mmci-omap-hs.1", | ||
322 | }; | ||
323 | 329 | ||
324 | static struct regulator_consumer_supply rx51_vsim_supply = { | 330 | static struct regulator_consumer_supply rx51_vsim_supply = |
325 | .supply = "vmmc_aux", | 331 | REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); |
326 | .dev_name = "mmci-omap-hs.1", | ||
327 | }; | ||
328 | 332 | ||
329 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { | 333 | static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { |
330 | /* tlv320aic3x analog supplies */ | 334 | /* tlv320aic3x analog supplies */ |
331 | { | 335 | REGULATOR_SUPPLY("AVDD", "2-0018"), |
332 | .supply = "AVDD", | 336 | REGULATOR_SUPPLY("DRVDD", "2-0018"), |
333 | .dev_name = "2-0018", | 337 | /* tpa6130a2 */ |
334 | }, | 338 | REGULATOR_SUPPLY("Vdd", "2-0060"), |
335 | { | ||
336 | .supply = "DRVDD", | ||
337 | .dev_name = "2-0018", | ||
338 | }, | ||
339 | /* Keep vmmc as last item. It is not iterated for newer boards */ | 339 | /* Keep vmmc as last item. It is not iterated for newer boards */ |
340 | { | 340 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), |
341 | .supply = "vmmc", | ||
342 | .dev_name = "mmci-omap-hs.1", | ||
343 | }, | ||
344 | }; | 341 | }; |
345 | 342 | ||
346 | static struct regulator_consumer_supply rx51_vio_supplies[] = { | 343 | static struct regulator_consumer_supply rx51_vio_supplies[] = { |
347 | /* tlv320aic3x digital supplies */ | 344 | /* tlv320aic3x digital supplies */ |
348 | { | 345 | REGULATOR_SUPPLY("IOVDD", "2-0018"), |
349 | .supply = "IOVDD", | 346 | REGULATOR_SUPPLY("DVDD", "2-0018"), |
350 | .dev_name = "2-0018" | ||
351 | }, | ||
352 | { | ||
353 | .supply = "DVDD", | ||
354 | .dev_name = "2-0018" | ||
355 | }, | ||
356 | }; | 347 | }; |
357 | 348 | ||
358 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) | 349 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) |
@@ -373,6 +364,7 @@ static struct regulator_init_data rx51_vaux1 = { | |||
373 | .name = "V28", | 364 | .name = "V28", |
374 | .min_uV = 2800000, | 365 | .min_uV = 2800000, |
375 | .max_uV = 2800000, | 366 | .max_uV = 2800000, |
367 | .always_on = true, /* due battery cover sensor */ | ||
376 | .valid_modes_mask = REGULATOR_MODE_NORMAL | 368 | .valid_modes_mask = REGULATOR_MODE_NORMAL |
377 | | REGULATOR_MODE_STANDBY, | 369 | | REGULATOR_MODE_STANDBY, |
378 | .valid_ops_mask = REGULATOR_CHANGE_MODE | 370 | .valid_ops_mask = REGULATOR_CHANGE_MODE |
@@ -718,6 +710,15 @@ static struct twl4030_platform_data rx51_twldata __initdata = { | |||
718 | .vio = &rx51_vio, | 710 | .vio = &rx51_vio, |
719 | }; | 711 | }; |
720 | 712 | ||
713 | static struct aic3x_pdata rx51_aic3x_data __initdata = { | ||
714 | .gpio_reset = 60, | ||
715 | }; | ||
716 | |||
717 | static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata = { | ||
718 | .id = TPA6130A2, | ||
719 | .power_gpio = 98, | ||
720 | }; | ||
721 | |||
721 | static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = { | 722 | static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = { |
722 | { | 723 | { |
723 | I2C_BOARD_INFO("twl5030", 0x48), | 724 | I2C_BOARD_INFO("twl5030", 0x48), |
@@ -730,7 +731,18 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = { | |||
730 | static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { | 731 | static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = { |
731 | { | 732 | { |
732 | I2C_BOARD_INFO("tlv320aic3x", 0x18), | 733 | I2C_BOARD_INFO("tlv320aic3x", 0x18), |
734 | .platform_data = &rx51_aic3x_data, | ||
735 | }, | ||
736 | #if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) | ||
737 | { | ||
738 | I2C_BOARD_INFO("tsl2563", 0x29), | ||
739 | .platform_data = &rx51_tsl2563_platform_data, | ||
733 | }, | 740 | }, |
741 | #endif | ||
742 | { | ||
743 | I2C_BOARD_INFO("tpa6130a2", 0x60), | ||
744 | .platform_data = &rx51_tpa6130a2_data, | ||
745 | } | ||
734 | }; | 746 | }; |
735 | 747 | ||
736 | static int __init rx51_i2c_init(void) | 748 | static int __init rx51_i2c_init(void) |
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c index b743a4f42649..5a1005ba9815 100644 --- a/arch/arm/mach-omap2/board-rx51-video.c +++ b/arch/arm/mach-omap2/board-rx51-video.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | 17 | ||
18 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
19 | #include <plat/mux.h> | ||
20 | #include <plat/display.h> | 19 | #include <plat/display.h> |
21 | #include <plat/vram.h> | 20 | #include <plat/vram.h> |
22 | #include <plat/mcspi.h> | 21 | #include <plat/mcspi.h> |
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c index 803ef14cbf2d..0eafae2f9181 100644 --- a/arch/arm/mach-omap2/board-zoom2.c +++ b/arch/arm/mach-omap2/board-zoom2.c | |||
@@ -71,16 +71,72 @@ static struct twl4030_platform_data zoom2_twldata = { | |||
71 | 71 | ||
72 | #ifdef CONFIG_OMAP_MUX | 72 | #ifdef CONFIG_OMAP_MUX |
73 | static struct omap_board_mux board_mux[] __initdata = { | 73 | static struct omap_board_mux board_mux[] __initdata = { |
74 | /* WLAN IRQ - GPIO 162 */ | ||
75 | OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), | ||
76 | /* WLAN POWER ENABLE - GPIO 101 */ | ||
77 | OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
78 | /* WLAN SDIO: MMC3 CMD */ | ||
79 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP), | ||
80 | /* WLAN SDIO: MMC3 CLK */ | ||
81 | OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
82 | /* WLAN SDIO: MMC3 DAT[0-3] */ | ||
83 | OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
84 | OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
85 | OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
86 | OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
74 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 87 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
75 | }; | 88 | }; |
76 | #else | 89 | #else |
77 | #define board_mux NULL | 90 | #define board_mux NULL |
78 | #endif | 91 | #endif |
79 | 92 | ||
93 | static struct mtd_partition zoom_nand_partitions[] = { | ||
94 | /* All the partition sizes are listed in terms of NAND block size */ | ||
95 | { | ||
96 | .name = "X-Loader-NAND", | ||
97 | .offset = 0, | ||
98 | .size = 4 * (64 * 2048), /* 512KB, 0x80000 */ | ||
99 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
100 | }, | ||
101 | { | ||
102 | .name = "U-Boot-NAND", | ||
103 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ | ||
104 | .size = 10 * (64 * 2048), /* 1.25MB, 0x140000 */ | ||
105 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
106 | }, | ||
107 | { | ||
108 | .name = "Boot Env-NAND", | ||
109 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ | ||
110 | .size = 2 * (64 * 2048), /* 256KB, 0x40000 */ | ||
111 | }, | ||
112 | { | ||
113 | .name = "Kernel-NAND", | ||
114 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x0200000*/ | ||
115 | .size = 240 * (64 * 2048), /* 30M, 0x1E00000 */ | ||
116 | }, | ||
117 | { | ||
118 | .name = "system", | ||
119 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x2000000 */ | ||
120 | .size = 3328 * (64 * 2048), /* 416M, 0x1A000000 */ | ||
121 | }, | ||
122 | { | ||
123 | .name = "userdata", | ||
124 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1C000000*/ | ||
125 | .size = 256 * (64 * 2048), /* 32M, 0x2000000 */ | ||
126 | }, | ||
127 | { | ||
128 | .name = "cache", | ||
129 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1E000000*/ | ||
130 | .size = 256 * (64 * 2048), /* 32M, 0x2000000 */ | ||
131 | }, | ||
132 | }; | ||
133 | |||
80 | static void __init omap_zoom2_init(void) | 134 | static void __init omap_zoom2_init(void) |
81 | { | 135 | { |
82 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 136 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
83 | zoom_peripherals_init(); | 137 | zoom_peripherals_init(); |
138 | board_nand_init(zoom_nand_partitions, | ||
139 | ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); | ||
84 | zoom_debugboard_init(); | 140 | zoom_debugboard_init(); |
85 | } | 141 | } |
86 | 142 | ||
diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c index 33147042485f..79fcad655677 100644 --- a/arch/arm/mach-omap2/board-zoom3.c +++ b/arch/arm/mach-omap2/board-zoom3.c | |||
@@ -34,6 +34,47 @@ static void __init omap_zoom_map_io(void) | |||
34 | static struct omap_board_config_kernel zoom_config[] __initdata = { | 34 | static struct omap_board_config_kernel zoom_config[] __initdata = { |
35 | }; | 35 | }; |
36 | 36 | ||
37 | static struct mtd_partition zoom_nand_partitions[] = { | ||
38 | /* All the partition sizes are listed in terms of NAND block size */ | ||
39 | { | ||
40 | .name = "X-Loader-NAND", | ||
41 | .offset = 0, | ||
42 | .size = 4 * (64 * 2048), /* 512KB, 0x80000 */ | ||
43 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
44 | }, | ||
45 | { | ||
46 | .name = "U-Boot-NAND", | ||
47 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ | ||
48 | .size = 10 * (64 * 2048), /* 1.25MB, 0x140000 */ | ||
49 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
50 | }, | ||
51 | { | ||
52 | .name = "Boot Env-NAND", | ||
53 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ | ||
54 | .size = 2 * (64 * 2048), /* 256KB, 0x40000 */ | ||
55 | }, | ||
56 | { | ||
57 | .name = "Kernel-NAND", | ||
58 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x0200000*/ | ||
59 | .size = 240 * (64 * 2048), /* 30M, 0x1E00000 */ | ||
60 | }, | ||
61 | { | ||
62 | .name = "system", | ||
63 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x2000000 */ | ||
64 | .size = 3328 * (64 * 2048), /* 416M, 0x1A000000 */ | ||
65 | }, | ||
66 | { | ||
67 | .name = "userdata", | ||
68 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1C000000*/ | ||
69 | .size = 256 * (64 * 2048), /* 32M, 0x2000000 */ | ||
70 | }, | ||
71 | { | ||
72 | .name = "cache", | ||
73 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1E000000*/ | ||
74 | .size = 256 * (64 * 2048), /* 32M, 0x2000000 */ | ||
75 | }, | ||
76 | }; | ||
77 | |||
37 | static void __init omap_zoom_init_irq(void) | 78 | static void __init omap_zoom_init_irq(void) |
38 | { | 79 | { |
39 | omap_board_config = zoom_config; | 80 | omap_board_config = zoom_config; |
@@ -46,6 +87,19 @@ static void __init omap_zoom_init_irq(void) | |||
46 | 87 | ||
47 | #ifdef CONFIG_OMAP_MUX | 88 | #ifdef CONFIG_OMAP_MUX |
48 | static struct omap_board_mux board_mux[] __initdata = { | 89 | static struct omap_board_mux board_mux[] __initdata = { |
90 | /* WLAN IRQ - GPIO 162 */ | ||
91 | OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), | ||
92 | /* WLAN POWER ENABLE - GPIO 101 */ | ||
93 | OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
94 | /* WLAN SDIO: MMC3 CMD */ | ||
95 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP), | ||
96 | /* WLAN SDIO: MMC3 CLK */ | ||
97 | OMAP3_MUX(ETK_CLK, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
98 | /* WLAN SDIO: MMC3 DAT[0-3] */ | ||
99 | OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
100 | OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
101 | OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
102 | OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP), | ||
49 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 103 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
50 | }; | 104 | }; |
51 | #else | 105 | #else |
@@ -66,6 +120,8 @@ static void __init omap_zoom_init(void) | |||
66 | { | 120 | { |
67 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); | 121 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
68 | zoom_peripherals_init(); | 122 | zoom_peripherals_init(); |
123 | board_nand_init(zoom_nand_partitions, | ||
124 | ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); | ||
69 | zoom_debugboard_init(); | 125 | zoom_debugboard_init(); |
70 | 126 | ||
71 | omap_mux_init_gpio(64, OMAP_PIN_OUTPUT); | 127 | omap_mux_init_gpio(64, OMAP_PIN_OUTPUT); |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 03e6c9ed82a4..162a9be3cbb1 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <plat/control.h> | 25 | #include <plat/control.h> |
26 | #include <plat/tc.h> | 26 | #include <plat/tc.h> |
27 | #include <plat/board.h> | 27 | #include <plat/board.h> |
28 | #include <plat/mux.h> | ||
29 | #include <mach/gpio.h> | 28 | #include <mach/gpio.h> |
30 | #include <plat/mmc.h> | 29 | #include <plat/mmc.h> |
31 | #include <plat/dma.h> | 30 | #include <plat/dma.h> |
@@ -230,64 +229,7 @@ static inline void omap_init_mbox(void) | |||
230 | static inline void omap_init_mbox(void) { } | 229 | static inline void omap_init_mbox(void) { } |
231 | #endif /* CONFIG_OMAP_MBOX_FWK */ | 230 | #endif /* CONFIG_OMAP_MBOX_FWK */ |
232 | 231 | ||
233 | #if defined(CONFIG_OMAP_STI) | ||
234 | |||
235 | #if defined(CONFIG_ARCH_OMAP2) | ||
236 | |||
237 | #define OMAP2_STI_BASE 0x48068000 | ||
238 | #define OMAP2_STI_CHANNEL_BASE 0x54000000 | ||
239 | #define OMAP2_STI_IRQ 4 | ||
240 | |||
241 | static struct resource sti_resources[] = { | ||
242 | { | ||
243 | .start = OMAP2_STI_BASE, | ||
244 | .end = OMAP2_STI_BASE + 0x7ff, | ||
245 | .flags = IORESOURCE_MEM, | ||
246 | }, | ||
247 | { | ||
248 | .start = OMAP2_STI_CHANNEL_BASE, | ||
249 | .end = OMAP2_STI_CHANNEL_BASE + SZ_64K - 1, | ||
250 | .flags = IORESOURCE_MEM, | ||
251 | }, | ||
252 | { | ||
253 | .start = OMAP2_STI_IRQ, | ||
254 | .flags = IORESOURCE_IRQ, | ||
255 | } | ||
256 | }; | ||
257 | #elif defined(CONFIG_ARCH_OMAP3) | ||
258 | |||
259 | #define OMAP3_SDTI_BASE 0x54500000 | ||
260 | #define OMAP3_SDTI_CHANNEL_BASE 0x54600000 | ||
261 | |||
262 | static struct resource sti_resources[] = { | ||
263 | { | ||
264 | .start = OMAP3_SDTI_BASE, | ||
265 | .end = OMAP3_SDTI_BASE + 0xFFF, | ||
266 | .flags = IORESOURCE_MEM, | ||
267 | }, | ||
268 | { | ||
269 | .start = OMAP3_SDTI_CHANNEL_BASE, | ||
270 | .end = OMAP3_SDTI_CHANNEL_BASE + SZ_1M - 1, | ||
271 | .flags = IORESOURCE_MEM, | ||
272 | } | ||
273 | }; | ||
274 | |||
275 | #endif | ||
276 | |||
277 | static struct platform_device sti_device = { | ||
278 | .name = "sti", | ||
279 | .id = -1, | ||
280 | .num_resources = ARRAY_SIZE(sti_resources), | ||
281 | .resource = sti_resources, | ||
282 | }; | ||
283 | |||
284 | static inline void omap_init_sti(void) | ||
285 | { | ||
286 | platform_device_register(&sti_device); | ||
287 | } | ||
288 | #else | ||
289 | static inline void omap_init_sti(void) {} | 232 | static inline void omap_init_sti(void) {} |
290 | #endif | ||
291 | 233 | ||
292 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) | 234 | #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) |
293 | 235 | ||
@@ -672,19 +614,19 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, | |||
672 | OMAP_PIN_INPUT_PULLUP); | 614 | OMAP_PIN_INPUT_PULLUP); |
673 | 615 | ||
674 | if (cpu_is_omap2420() && controller_nr == 0) { | 616 | if (cpu_is_omap2420() && controller_nr == 0) { |
675 | omap_cfg_reg(H18_24XX_MMC_CMD); | 617 | omap_mux_init_signal("sdmmc_cmd", 0); |
676 | omap_cfg_reg(H15_24XX_MMC_CLKI); | 618 | omap_mux_init_signal("sdmmc_clki", 0); |
677 | omap_cfg_reg(G19_24XX_MMC_CLKO); | 619 | omap_mux_init_signal("sdmmc_clko", 0); |
678 | omap_cfg_reg(F20_24XX_MMC_DAT0); | 620 | omap_mux_init_signal("sdmmc_dat0", 0); |
679 | omap_cfg_reg(F19_24XX_MMC_DAT_DIR0); | 621 | omap_mux_init_signal("sdmmc_dat_dir0", 0); |
680 | omap_cfg_reg(G18_24XX_MMC_CMD_DIR); | 622 | omap_mux_init_signal("sdmmc_cmd_dir", 0); |
681 | if (mmc_controller->slots[0].wires == 4) { | 623 | if (mmc_controller->slots[0].wires == 4) { |
682 | omap_cfg_reg(H14_24XX_MMC_DAT1); | 624 | omap_mux_init_signal("sdmmc_dat1", 0); |
683 | omap_cfg_reg(E19_24XX_MMC_DAT2); | 625 | omap_mux_init_signal("sdmmc_dat2", 0); |
684 | omap_cfg_reg(D19_24XX_MMC_DAT3); | 626 | omap_mux_init_signal("sdmmc_dat3", 0); |
685 | omap_cfg_reg(E20_24XX_MMC_DAT_DIR1); | 627 | omap_mux_init_signal("sdmmc_dat_dir1", 0); |
686 | omap_cfg_reg(F18_24XX_MMC_DAT_DIR2); | 628 | omap_mux_init_signal("sdmmc_dat_dir2", 0); |
687 | omap_cfg_reg(E18_24XX_MMC_DAT_DIR3); | 629 | omap_mux_init_signal("sdmmc_dat_dir3", 0); |
688 | } | 630 | } |
689 | 631 | ||
690 | /* | 632 | /* |
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index e57fb29ff855..722209601927 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c | |||
@@ -19,8 +19,6 @@ | |||
19 | #include <plat/board.h> | 19 | #include <plat/board.h> |
20 | #include <plat/gpmc.h> | 20 | #include <plat/gpmc.h> |
21 | 21 | ||
22 | #define WR_RD_PIN_MONITORING 0x00600000 | ||
23 | |||
24 | static struct omap_nand_platform_data *gpmc_nand_data; | 22 | static struct omap_nand_platform_data *gpmc_nand_data; |
25 | 23 | ||
26 | static struct resource gpmc_nand_resource = { | 24 | static struct resource gpmc_nand_resource = { |
@@ -71,10 +69,10 @@ static int omap2_nand_gpmc_retime(void) | |||
71 | t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); | 69 | t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); |
72 | 70 | ||
73 | /* Configure GPMC */ | 71 | /* Configure GPMC */ |
74 | gpmc_cs_write_reg(gpmc_nand_data->cs, GPMC_CS_CONFIG1, | 72 | gpmc_cs_configure(gpmc_nand_data->cs, |
75 | GPMC_CONFIG1_DEVICESIZE(gpmc_nand_data->devsize) | | 73 | GPMC_CONFIG_DEV_SIZE, gpmc_nand_data->devsize); |
76 | GPMC_CONFIG1_DEVICETYPE_NAND); | 74 | gpmc_cs_configure(gpmc_nand_data->cs, |
77 | 75 | GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); | |
78 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); | 76 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); |
79 | if (err) | 77 | if (err) |
80 | return err; | 78 | return err; |
@@ -82,27 +80,13 @@ static int omap2_nand_gpmc_retime(void) | |||
82 | return 0; | 80 | return 0; |
83 | } | 81 | } |
84 | 82 | ||
85 | static int gpmc_nand_setup(void) | ||
86 | { | ||
87 | struct device *dev = &gpmc_nand_device.dev; | ||
88 | |||
89 | /* Set timings in GPMC */ | ||
90 | if (omap2_nand_gpmc_retime() < 0) { | ||
91 | dev_err(dev, "Unable to set gpmc timings\n"); | ||
92 | return -EINVAL; | ||
93 | } | ||
94 | |||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data) | 83 | int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data) |
99 | { | 84 | { |
100 | unsigned int val; | ||
101 | int err = 0; | 85 | int err = 0; |
102 | struct device *dev = &gpmc_nand_device.dev; | 86 | struct device *dev = &gpmc_nand_device.dev; |
103 | 87 | ||
104 | gpmc_nand_data = _nand_data; | 88 | gpmc_nand_data = _nand_data; |
105 | gpmc_nand_data->nand_setup = gpmc_nand_setup; | 89 | gpmc_nand_data->nand_setup = omap2_nand_gpmc_retime; |
106 | gpmc_nand_device.dev.platform_data = gpmc_nand_data; | 90 | gpmc_nand_device.dev.platform_data = gpmc_nand_data; |
107 | 91 | ||
108 | err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, | 92 | err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, |
@@ -112,19 +96,16 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data) | |||
112 | return err; | 96 | return err; |
113 | } | 97 | } |
114 | 98 | ||
115 | err = gpmc_nand_setup(); | 99 | /* Set timings in GPMC */ |
100 | err = omap2_nand_gpmc_retime(); | ||
116 | if (err < 0) { | 101 | if (err < 0) { |
117 | dev_err(dev, "NAND platform setup failed: %d\n", err); | 102 | dev_err(dev, "Unable to set gpmc timings: %d\n", err); |
118 | return err; | 103 | return err; |
119 | } | 104 | } |
120 | 105 | ||
121 | /* Enable RD PIN Monitoring Reg */ | 106 | /* Enable RD PIN Monitoring Reg */ |
122 | if (gpmc_nand_data->dev_ready) { | 107 | if (gpmc_nand_data->dev_ready) { |
123 | val = gpmc_cs_read_reg(gpmc_nand_data->cs, | 108 | gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1); |
124 | GPMC_CS_CONFIG1); | ||
125 | val |= WR_RD_PIN_MONITORING; | ||
126 | gpmc_cs_write_reg(gpmc_nand_data->cs, | ||
127 | GPMC_CS_CONFIG1, val); | ||
128 | } | 109 | } |
129 | 110 | ||
130 | err = platform_device_register(&gpmc_nand_device); | 111 | err = platform_device_register(&gpmc_nand_device); |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 5bc3ca03551c..f46933bc9373 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -46,8 +46,9 @@ | |||
46 | #define GPMC_ECC_CONFIG 0x1f4 | 46 | #define GPMC_ECC_CONFIG 0x1f4 |
47 | #define GPMC_ECC_CONTROL 0x1f8 | 47 | #define GPMC_ECC_CONTROL 0x1f8 |
48 | #define GPMC_ECC_SIZE_CONFIG 0x1fc | 48 | #define GPMC_ECC_SIZE_CONFIG 0x1fc |
49 | #define GPMC_ECC1_RESULT 0x200 | ||
49 | 50 | ||
50 | #define GPMC_CS0 0x60 | 51 | #define GPMC_CS0_OFFSET 0x60 |
51 | #define GPMC_CS_SIZE 0x30 | 52 | #define GPMC_CS_SIZE 0x30 |
52 | 53 | ||
53 | #define GPMC_MEM_START 0x00000000 | 54 | #define GPMC_MEM_START 0x00000000 |
@@ -92,7 +93,8 @@ struct omap3_gpmc_regs { | |||
92 | static struct resource gpmc_mem_root; | 93 | static struct resource gpmc_mem_root; |
93 | static struct resource gpmc_cs_mem[GPMC_CS_NUM]; | 94 | static struct resource gpmc_cs_mem[GPMC_CS_NUM]; |
94 | static DEFINE_SPINLOCK(gpmc_mem_lock); | 95 | static DEFINE_SPINLOCK(gpmc_mem_lock); |
95 | static unsigned gpmc_cs_map; | 96 | static unsigned int gpmc_cs_map; /* flag for cs which are initialized */ |
97 | static int gpmc_ecc_used = -EINVAL; /* cs using ecc engine */ | ||
96 | 98 | ||
97 | static void __iomem *gpmc_base; | 99 | static void __iomem *gpmc_base; |
98 | 100 | ||
@@ -108,11 +110,27 @@ static u32 gpmc_read_reg(int idx) | |||
108 | return __raw_readl(gpmc_base + idx); | 110 | return __raw_readl(gpmc_base + idx); |
109 | } | 111 | } |
110 | 112 | ||
113 | static void gpmc_cs_write_byte(int cs, int idx, u8 val) | ||
114 | { | ||
115 | void __iomem *reg_addr; | ||
116 | |||
117 | reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx; | ||
118 | __raw_writeb(val, reg_addr); | ||
119 | } | ||
120 | |||
121 | static u8 gpmc_cs_read_byte(int cs, int idx) | ||
122 | { | ||
123 | void __iomem *reg_addr; | ||
124 | |||
125 | reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx; | ||
126 | return __raw_readb(reg_addr); | ||
127 | } | ||
128 | |||
111 | void gpmc_cs_write_reg(int cs, int idx, u32 val) | 129 | void gpmc_cs_write_reg(int cs, int idx, u32 val) |
112 | { | 130 | { |
113 | void __iomem *reg_addr; | 131 | void __iomem *reg_addr; |
114 | 132 | ||
115 | reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx; | 133 | reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx; |
116 | __raw_writel(val, reg_addr); | 134 | __raw_writel(val, reg_addr); |
117 | } | 135 | } |
118 | 136 | ||
@@ -120,7 +138,7 @@ u32 gpmc_cs_read_reg(int cs, int idx) | |||
120 | { | 138 | { |
121 | void __iomem *reg_addr; | 139 | void __iomem *reg_addr; |
122 | 140 | ||
123 | reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx; | 141 | reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx; |
124 | return __raw_readl(reg_addr); | 142 | return __raw_readl(reg_addr); |
125 | } | 143 | } |
126 | 144 | ||
@@ -419,8 +437,157 @@ void gpmc_cs_free(int cs) | |||
419 | EXPORT_SYMBOL(gpmc_cs_free); | 437 | EXPORT_SYMBOL(gpmc_cs_free); |
420 | 438 | ||
421 | /** | 439 | /** |
440 | * gpmc_read_status - read access request to get the different gpmc status | ||
441 | * @cmd: command type | ||
442 | * @return status | ||
443 | */ | ||
444 | int gpmc_read_status(int cmd) | ||
445 | { | ||
446 | int status = -EINVAL; | ||
447 | u32 regval = 0; | ||
448 | |||
449 | switch (cmd) { | ||
450 | case GPMC_GET_IRQ_STATUS: | ||
451 | status = gpmc_read_reg(GPMC_IRQSTATUS); | ||
452 | break; | ||
453 | |||
454 | case GPMC_PREFETCH_FIFO_CNT: | ||
455 | regval = gpmc_read_reg(GPMC_PREFETCH_STATUS); | ||
456 | status = GPMC_PREFETCH_STATUS_FIFO_CNT(regval); | ||
457 | break; | ||
458 | |||
459 | case GPMC_PREFETCH_COUNT: | ||
460 | regval = gpmc_read_reg(GPMC_PREFETCH_STATUS); | ||
461 | status = GPMC_PREFETCH_STATUS_COUNT(regval); | ||
462 | break; | ||
463 | |||
464 | case GPMC_STATUS_BUFFER: | ||
465 | regval = gpmc_read_reg(GPMC_STATUS); | ||
466 | /* 1 : buffer is available to write */ | ||
467 | status = regval & GPMC_STATUS_BUFF_EMPTY; | ||
468 | break; | ||
469 | |||
470 | default: | ||
471 | printk(KERN_ERR "gpmc_read_status: Not supported\n"); | ||
472 | } | ||
473 | return status; | ||
474 | } | ||
475 | EXPORT_SYMBOL(gpmc_read_status); | ||
476 | |||
477 | /** | ||
478 | * gpmc_cs_configure - write request to configure gpmc | ||
479 | * @cs: chip select number | ||
480 | * @cmd: command type | ||
481 | * @wval: value to write | ||
482 | * @return status of the operation | ||
483 | */ | ||
484 | int gpmc_cs_configure(int cs, int cmd, int wval) | ||
485 | { | ||
486 | int err = 0; | ||
487 | u32 regval = 0; | ||
488 | |||
489 | switch (cmd) { | ||
490 | case GPMC_SET_IRQ_STATUS: | ||
491 | gpmc_write_reg(GPMC_IRQSTATUS, wval); | ||
492 | break; | ||
493 | |||
494 | case GPMC_CONFIG_WP: | ||
495 | regval = gpmc_read_reg(GPMC_CONFIG); | ||
496 | if (wval) | ||
497 | regval &= ~GPMC_CONFIG_WRITEPROTECT; /* WP is ON */ | ||
498 | else | ||
499 | regval |= GPMC_CONFIG_WRITEPROTECT; /* WP is OFF */ | ||
500 | gpmc_write_reg(GPMC_CONFIG, regval); | ||
501 | break; | ||
502 | |||
503 | case GPMC_CONFIG_RDY_BSY: | ||
504 | regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
505 | if (wval) | ||
506 | regval |= WR_RD_PIN_MONITORING; | ||
507 | else | ||
508 | regval &= ~WR_RD_PIN_MONITORING; | ||
509 | gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval); | ||
510 | break; | ||
511 | |||
512 | case GPMC_CONFIG_DEV_SIZE: | ||
513 | regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
514 | regval |= GPMC_CONFIG1_DEVICESIZE(wval); | ||
515 | gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval); | ||
516 | break; | ||
517 | |||
518 | case GPMC_CONFIG_DEV_TYPE: | ||
519 | regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
520 | regval |= GPMC_CONFIG1_DEVICETYPE(wval); | ||
521 | if (wval == GPMC_DEVICETYPE_NOR) | ||
522 | regval |= GPMC_CONFIG1_MUXADDDATA; | ||
523 | gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval); | ||
524 | break; | ||
525 | |||
526 | default: | ||
527 | printk(KERN_ERR "gpmc_configure_cs: Not supported\n"); | ||
528 | err = -EINVAL; | ||
529 | } | ||
530 | |||
531 | return err; | ||
532 | } | ||
533 | EXPORT_SYMBOL(gpmc_cs_configure); | ||
534 | |||
535 | /** | ||
536 | * gpmc_nand_read - nand specific read access request | ||
537 | * @cs: chip select number | ||
538 | * @cmd: command type | ||
539 | */ | ||
540 | int gpmc_nand_read(int cs, int cmd) | ||
541 | { | ||
542 | int rval = -EINVAL; | ||
543 | |||
544 | switch (cmd) { | ||
545 | case GPMC_NAND_DATA: | ||
546 | rval = gpmc_cs_read_byte(cs, GPMC_CS_NAND_DATA); | ||
547 | break; | ||
548 | |||
549 | default: | ||
550 | printk(KERN_ERR "gpmc_read_nand_ctrl: Not supported\n"); | ||
551 | } | ||
552 | return rval; | ||
553 | } | ||
554 | EXPORT_SYMBOL(gpmc_nand_read); | ||
555 | |||
556 | /** | ||
557 | * gpmc_nand_write - nand specific write request | ||
558 | * @cs: chip select number | ||
559 | * @cmd: command type | ||
560 | * @wval: value to write | ||
561 | */ | ||
562 | int gpmc_nand_write(int cs, int cmd, int wval) | ||
563 | { | ||
564 | int err = 0; | ||
565 | |||
566 | switch (cmd) { | ||
567 | case GPMC_NAND_COMMAND: | ||
568 | gpmc_cs_write_byte(cs, GPMC_CS_NAND_COMMAND, wval); | ||
569 | break; | ||
570 | |||
571 | case GPMC_NAND_ADDRESS: | ||
572 | gpmc_cs_write_byte(cs, GPMC_CS_NAND_ADDRESS, wval); | ||
573 | break; | ||
574 | |||
575 | case GPMC_NAND_DATA: | ||
576 | gpmc_cs_write_byte(cs, GPMC_CS_NAND_DATA, wval); | ||
577 | |||
578 | default: | ||
579 | printk(KERN_ERR "gpmc_write_nand_ctrl: Not supported\n"); | ||
580 | err = -EINVAL; | ||
581 | } | ||
582 | return err; | ||
583 | } | ||
584 | EXPORT_SYMBOL(gpmc_nand_write); | ||
585 | |||
586 | |||
587 | |||
588 | /** | ||
422 | * gpmc_prefetch_enable - configures and starts prefetch transfer | 589 | * gpmc_prefetch_enable - configures and starts prefetch transfer |
423 | * @cs: nand cs (chip select) number | 590 | * @cs: cs (chip select) number |
424 | * @dma_mode: dma mode enable (1) or disable (0) | 591 | * @dma_mode: dma mode enable (1) or disable (0) |
425 | * @u32_count: number of bytes to be transferred | 592 | * @u32_count: number of bytes to be transferred |
426 | * @is_write: prefetch read(0) or write post(1) mode | 593 | * @is_write: prefetch read(0) or write post(1) mode |
@@ -428,7 +595,6 @@ EXPORT_SYMBOL(gpmc_cs_free); | |||
428 | int gpmc_prefetch_enable(int cs, int dma_mode, | 595 | int gpmc_prefetch_enable(int cs, int dma_mode, |
429 | unsigned int u32_count, int is_write) | 596 | unsigned int u32_count, int is_write) |
430 | { | 597 | { |
431 | uint32_t prefetch_config1; | ||
432 | 598 | ||
433 | if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { | 599 | if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { |
434 | /* Set the amount of bytes to be prefetched */ | 600 | /* Set the amount of bytes to be prefetched */ |
@@ -437,17 +603,17 @@ int gpmc_prefetch_enable(int cs, int dma_mode, | |||
437 | /* Set dma/mpu mode, the prefetch read / post write and | 603 | /* Set dma/mpu mode, the prefetch read / post write and |
438 | * enable the engine. Set which cs is has requested for. | 604 | * enable the engine. Set which cs is has requested for. |
439 | */ | 605 | */ |
440 | prefetch_config1 = ((cs << CS_NUM_SHIFT) | | 606 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | |
441 | PREFETCH_FIFOTHRESHOLD | | 607 | PREFETCH_FIFOTHRESHOLD | |
442 | ENABLE_PREFETCH | | 608 | ENABLE_PREFETCH | |
443 | (dma_mode << DMA_MPU_MODE) | | 609 | (dma_mode << DMA_MPU_MODE) | |
444 | (0x1 & is_write)); | 610 | (0x1 & is_write))); |
445 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, prefetch_config1); | 611 | |
612 | /* Start the prefetch engine */ | ||
613 | gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1); | ||
446 | } else { | 614 | } else { |
447 | return -EBUSY; | 615 | return -EBUSY; |
448 | } | 616 | } |
449 | /* Start the prefetch engine */ | ||
450 | gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1); | ||
451 | 617 | ||
452 | return 0; | 618 | return 0; |
453 | } | 619 | } |
@@ -456,24 +622,24 @@ EXPORT_SYMBOL(gpmc_prefetch_enable); | |||
456 | /** | 622 | /** |
457 | * gpmc_prefetch_reset - disables and stops the prefetch engine | 623 | * gpmc_prefetch_reset - disables and stops the prefetch engine |
458 | */ | 624 | */ |
459 | void gpmc_prefetch_reset(void) | 625 | int gpmc_prefetch_reset(int cs) |
460 | { | 626 | { |
627 | u32 config1; | ||
628 | |||
629 | /* check if the same module/cs is trying to reset */ | ||
630 | config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1); | ||
631 | if (((config1 >> CS_NUM_SHIFT) & 0x7) != cs) | ||
632 | return -EINVAL; | ||
633 | |||
461 | /* Stop the PFPW engine */ | 634 | /* Stop the PFPW engine */ |
462 | gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0); | 635 | gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0); |
463 | 636 | ||
464 | /* Reset/disable the PFPW engine */ | 637 | /* Reset/disable the PFPW engine */ |
465 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0); | 638 | gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0); |
466 | } | ||
467 | EXPORT_SYMBOL(gpmc_prefetch_reset); | ||
468 | 639 | ||
469 | /** | 640 | return 0; |
470 | * gpmc_prefetch_status - reads prefetch status of engine | ||
471 | */ | ||
472 | int gpmc_prefetch_status(void) | ||
473 | { | ||
474 | return gpmc_read_reg(GPMC_PREFETCH_STATUS); | ||
475 | } | 641 | } |
476 | EXPORT_SYMBOL(gpmc_prefetch_status); | 642 | EXPORT_SYMBOL(gpmc_prefetch_reset); |
477 | 643 | ||
478 | static void __init gpmc_mem_init(void) | 644 | static void __init gpmc_mem_init(void) |
479 | { | 645 | { |
@@ -615,3 +781,79 @@ void omap3_gpmc_restore_context(void) | |||
615 | } | 781 | } |
616 | } | 782 | } |
617 | #endif /* CONFIG_ARCH_OMAP3 */ | 783 | #endif /* CONFIG_ARCH_OMAP3 */ |
784 | |||
785 | /** | ||
786 | * gpmc_enable_hwecc - enable hardware ecc functionality | ||
787 | * @cs: chip select number | ||
788 | * @mode: read/write mode | ||
789 | * @dev_width: device bus width(1 for x16, 0 for x8) | ||
790 | * @ecc_size: bytes for which ECC will be generated | ||
791 | */ | ||
792 | int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size) | ||
793 | { | ||
794 | unsigned int val; | ||
795 | |||
796 | /* check if ecc module is in used */ | ||
797 | if (gpmc_ecc_used != -EINVAL) | ||
798 | return -EINVAL; | ||
799 | |||
800 | gpmc_ecc_used = cs; | ||
801 | |||
802 | /* clear ecc and enable bits */ | ||
803 | val = ((0x00000001<<8) | 0x00000001); | ||
804 | gpmc_write_reg(GPMC_ECC_CONTROL, val); | ||
805 | |||
806 | /* program ecc and result sizes */ | ||
807 | val = ((((ecc_size >> 1) - 1) << 22) | (0x0000000F)); | ||
808 | gpmc_write_reg(GPMC_ECC_SIZE_CONFIG, val); | ||
809 | |||
810 | switch (mode) { | ||
811 | case GPMC_ECC_READ: | ||
812 | gpmc_write_reg(GPMC_ECC_CONTROL, 0x101); | ||
813 | break; | ||
814 | case GPMC_ECC_READSYN: | ||
815 | gpmc_write_reg(GPMC_ECC_CONTROL, 0x100); | ||
816 | break; | ||
817 | case GPMC_ECC_WRITE: | ||
818 | gpmc_write_reg(GPMC_ECC_CONTROL, 0x101); | ||
819 | break; | ||
820 | default: | ||
821 | printk(KERN_INFO "Error: Unrecognized Mode[%d]!\n", mode); | ||
822 | break; | ||
823 | } | ||
824 | |||
825 | /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */ | ||
826 | val = (dev_width << 7) | (cs << 1) | (0x1); | ||
827 | gpmc_write_reg(GPMC_ECC_CONFIG, val); | ||
828 | return 0; | ||
829 | } | ||
830 | |||
831 | /** | ||
832 | * gpmc_calculate_ecc - generate non-inverted ecc bytes | ||
833 | * @cs: chip select number | ||
834 | * @dat: data pointer over which ecc is computed | ||
835 | * @ecc_code: ecc code buffer | ||
836 | * | ||
837 | * Using non-inverted ECC is considered ugly since writing a blank | ||
838 | * page (padding) will clear the ECC bytes. This is not a problem as long | ||
839 | * no one is trying to write data on the seemingly unused page. Reading | ||
840 | * an erased page will produce an ECC mismatch between generated and read | ||
841 | * ECC bytes that has to be dealt with separately. | ||
842 | */ | ||
843 | int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code) | ||
844 | { | ||
845 | unsigned int val = 0x0; | ||
846 | |||
847 | if (gpmc_ecc_used != cs) | ||
848 | return -EINVAL; | ||
849 | |||
850 | /* read ecc result */ | ||
851 | val = gpmc_read_reg(GPMC_ECC1_RESULT); | ||
852 | *ecc_code++ = val; /* P128e, ..., P1e */ | ||
853 | *ecc_code++ = val >> 16; /* P128o, ..., P1o */ | ||
854 | /* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */ | ||
855 | *ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0); | ||
856 | |||
857 | gpmc_ecc_used = -EINVAL; | ||
858 | return 0; | ||
859 | } | ||
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c index 7951ae1447ee..79c478c4cb1c 100644 --- a/arch/arm/mach-omap2/i2c.c +++ b/arch/arm/mach-omap2/i2c.c | |||
@@ -21,32 +21,19 @@ | |||
21 | 21 | ||
22 | #include <plat/cpu.h> | 22 | #include <plat/cpu.h> |
23 | #include <plat/i2c.h> | 23 | #include <plat/i2c.h> |
24 | #include <plat/mux.h> | ||
25 | 24 | ||
26 | #include "mux.h" | 25 | #include "mux.h" |
27 | 26 | ||
28 | void __init omap2_i2c_mux_pins(int bus_id) | 27 | void __init omap2_i2c_mux_pins(int bus_id) |
29 | { | 28 | { |
30 | if (cpu_is_omap24xx()) { | 29 | char mux_name[sizeof("i2c2_scl.i2c2_scl")]; |
31 | const int omap24xx_pins[][2] = { | ||
32 | { M19_24XX_I2C1_SCL, L15_24XX_I2C1_SDA }, | ||
33 | { J15_24XX_I2C2_SCL, H19_24XX_I2C2_SDA }, | ||
34 | }; | ||
35 | int scl, sda; | ||
36 | |||
37 | scl = omap24xx_pins[bus_id - 1][0]; | ||
38 | sda = omap24xx_pins[bus_id - 1][1]; | ||
39 | omap_cfg_reg(sda); | ||
40 | omap_cfg_reg(scl); | ||
41 | } | ||
42 | 30 | ||
43 | /* First I2C bus is not muxable */ | 31 | /* First I2C bus is not muxable */ |
44 | if (cpu_is_omap34xx() && bus_id > 1) { | 32 | if (bus_id == 1) |
45 | char mux_name[sizeof("i2c2_scl.i2c2_scl")]; | 33 | return; |
46 | 34 | ||
47 | sprintf(mux_name, "i2c%i_scl.i2c%i_scl", bus_id, bus_id); | 35 | sprintf(mux_name, "i2c%i_scl.i2c%i_scl", bus_id, bus_id); |
48 | omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); | 36 | omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); |
49 | sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id); | 37 | sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id); |
50 | omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); | 38 | omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); |
51 | } | ||
52 | } | 39 | } |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 37b8a1a4adf8..fd1904b013fa 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <plat/control.h> | 25 | #include <plat/control.h> |
26 | #include <plat/cpu.h> | 26 | #include <plat/cpu.h> |
27 | 27 | ||
28 | #include <mach/id.h> | ||
29 | |||
28 | static struct omap_chip_id omap_chip; | 30 | static struct omap_chip_id omap_chip; |
29 | static unsigned int omap_revision; | 31 | static unsigned int omap_revision; |
30 | 32 | ||
@@ -102,30 +104,36 @@ static struct omap_id omap_ids[] __initdata = { | |||
102 | static void __iomem *tap_base; | 104 | static void __iomem *tap_base; |
103 | static u16 tap_prod_id; | 105 | static u16 tap_prod_id; |
104 | 106 | ||
105 | void __init omap24xx_check_revision(void) | 107 | void omap_get_die_id(struct omap_die_id *odi) |
108 | { | ||
109 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0); | ||
110 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); | ||
111 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); | ||
112 | odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3); | ||
113 | } | ||
114 | |||
115 | static void __init omap24xx_check_revision(void) | ||
106 | { | 116 | { |
107 | int i, j; | 117 | int i, j; |
108 | u32 idcode, prod_id; | 118 | u32 idcode, prod_id; |
109 | u16 hawkeye; | 119 | u16 hawkeye; |
110 | u8 dev_type, rev; | 120 | u8 dev_type, rev; |
121 | struct omap_die_id odi; | ||
111 | 122 | ||
112 | idcode = read_tap_reg(OMAP_TAP_IDCODE); | 123 | idcode = read_tap_reg(OMAP_TAP_IDCODE); |
113 | prod_id = read_tap_reg(tap_prod_id); | 124 | prod_id = read_tap_reg(tap_prod_id); |
114 | hawkeye = (idcode >> 12) & 0xffff; | 125 | hawkeye = (idcode >> 12) & 0xffff; |
115 | rev = (idcode >> 28) & 0x0f; | 126 | rev = (idcode >> 28) & 0x0f; |
116 | dev_type = (prod_id >> 16) & 0x0f; | 127 | dev_type = (prod_id >> 16) & 0x0f; |
128 | omap_get_die_id(&odi); | ||
117 | 129 | ||
118 | pr_debug("OMAP_TAP_IDCODE 0x%08x REV %i HAWKEYE 0x%04x MANF %03x\n", | 130 | pr_debug("OMAP_TAP_IDCODE 0x%08x REV %i HAWKEYE 0x%04x MANF %03x\n", |
119 | idcode, rev, hawkeye, (idcode >> 1) & 0x7ff); | 131 | idcode, rev, hawkeye, (idcode >> 1) & 0x7ff); |
120 | pr_debug("OMAP_TAP_DIE_ID_0: 0x%08x\n", | 132 | pr_debug("OMAP_TAP_DIE_ID_0: 0x%08x\n", odi.id_0); |
121 | read_tap_reg(OMAP_TAP_DIE_ID_0)); | ||
122 | pr_debug("OMAP_TAP_DIE_ID_1: 0x%08x DEV_REV: %i\n", | 133 | pr_debug("OMAP_TAP_DIE_ID_1: 0x%08x DEV_REV: %i\n", |
123 | read_tap_reg(OMAP_TAP_DIE_ID_1), | 134 | odi.id_1, (odi.id_1 >> 28) & 0xf); |
124 | (read_tap_reg(OMAP_TAP_DIE_ID_1) >> 28) & 0xf); | 135 | pr_debug("OMAP_TAP_DIE_ID_2: 0x%08x\n", odi.id_2); |
125 | pr_debug("OMAP_TAP_DIE_ID_2: 0x%08x\n", | 136 | pr_debug("OMAP_TAP_DIE_ID_3: 0x%08x\n", odi.id_3); |
126 | read_tap_reg(OMAP_TAP_DIE_ID_2)); | ||
127 | pr_debug("OMAP_TAP_DIE_ID_3: 0x%08x\n", | ||
128 | read_tap_reg(OMAP_TAP_DIE_ID_3)); | ||
129 | pr_debug("OMAP_TAP_PROD_ID_0: 0x%08x DEV_TYPE: %i\n", | 137 | pr_debug("OMAP_TAP_PROD_ID_0: 0x%08x DEV_TYPE: %i\n", |
130 | prod_id, dev_type); | 138 | prod_id, dev_type); |
131 | 139 | ||
@@ -164,7 +172,7 @@ void __init omap24xx_check_revision(void) | |||
164 | omap3_features |= OMAP3_HAS_ ##feat; \ | 172 | omap3_features |= OMAP3_HAS_ ##feat; \ |
165 | } | 173 | } |
166 | 174 | ||
167 | void __init omap3_check_features(void) | 175 | static void __init omap3_check_features(void) |
168 | { | 176 | { |
169 | u32 status; | 177 | u32 status; |
170 | 178 | ||
@@ -179,6 +187,8 @@ void __init omap3_check_features(void) | |||
179 | OMAP3_CHECK_FEATURE(status, ISP); | 187 | OMAP3_CHECK_FEATURE(status, ISP); |
180 | if (cpu_is_omap3630()) | 188 | if (cpu_is_omap3630()) |
181 | omap3_features |= OMAP3_HAS_192MHZ_CLK; | 189 | omap3_features |= OMAP3_HAS_192MHZ_CLK; |
190 | if (!cpu_is_omap3505() && !cpu_is_omap3517()) | ||
191 | omap3_features |= OMAP3_HAS_IO_WAKEUP; | ||
182 | 192 | ||
183 | /* | 193 | /* |
184 | * TODO: Get additional info (where applicable) | 194 | * TODO: Get additional info (where applicable) |
@@ -186,7 +196,7 @@ void __init omap3_check_features(void) | |||
186 | */ | 196 | */ |
187 | } | 197 | } |
188 | 198 | ||
189 | void __init omap3_check_revision(void) | 199 | static void __init omap3_check_revision(void) |
190 | { | 200 | { |
191 | u32 cpuid, idcode; | 201 | u32 cpuid, idcode; |
192 | u16 hawkeye; | 202 | u16 hawkeye; |
@@ -267,7 +277,7 @@ void __init omap3_check_revision(void) | |||
267 | } | 277 | } |
268 | } | 278 | } |
269 | 279 | ||
270 | void __init omap4_check_revision(void) | 280 | static void __init omap4_check_revision(void) |
271 | { | 281 | { |
272 | u32 idcode; | 282 | u32 idcode; |
273 | u16 hawkeye; | 283 | u16 hawkeye; |
@@ -297,7 +307,7 @@ void __init omap4_check_revision(void) | |||
297 | if (omap3_has_ ##feat()) \ | 307 | if (omap3_has_ ##feat()) \ |
298 | printk(#feat" "); | 308 | printk(#feat" "); |
299 | 309 | ||
300 | void __init omap3_cpuinfo(void) | 310 | static void __init omap3_cpuinfo(void) |
301 | { | 311 | { |
302 | u8 rev = GET_OMAP_REVISION(); | 312 | u8 rev = GET_OMAP_REVISION(); |
303 | char cpu_name[16], cpu_rev[16]; | 313 | char cpu_name[16], cpu_rev[16]; |
diff --git a/arch/arm/mach-omap2/include/mach/board-sdp.h b/arch/arm/mach-omap2/include/mach/board-flash.h index 465169c0908a..b2242ae2bb6f 100644 --- a/arch/arm/mach-omap2/include/mach/board-sdp.h +++ b/arch/arm/mach-omap2/include/mach/board-flash.h | |||
@@ -12,10 +12,17 @@ | |||
12 | */ | 12 | */ |
13 | #include <linux/mtd/mtd.h> | 13 | #include <linux/mtd/mtd.h> |
14 | #include <linux/mtd/partitions.h> | 14 | #include <linux/mtd/partitions.h> |
15 | #include <plat/gpmc.h> | ||
16 | |||
17 | #define PDC_NOR 1 | ||
18 | #define PDC_NAND 2 | ||
19 | #define PDC_ONENAND 3 | ||
20 | #define DBG_MPDB 4 | ||
15 | 21 | ||
16 | struct flash_partitions { | 22 | struct flash_partitions { |
17 | struct mtd_partition *parts; | 23 | struct mtd_partition *parts; |
18 | int nr_parts; | 24 | int nr_parts; |
19 | }; | 25 | }; |
20 | 26 | ||
21 | extern void sdp_flash_init(struct flash_partitions []); | 27 | extern void board_flash_init(struct flash_partitions [], |
28 | char chip_sel[][GPMC_CS_NUM]); | ||
diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h b/arch/arm/mach-omap2/include/mach/board-zoom.h index c93b29e21b78..3af69d2c3dcd 100644 --- a/arch/arm/mach-omap2/include/mach/board-zoom.h +++ b/arch/arm/mach-omap2/include/mach/board-zoom.h | |||
@@ -1,5 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * Defines for zoom boards | 2 | * Defines for zoom boards |
3 | */ | 3 | */ |
4 | #include <linux/mtd/mtd.h> | ||
5 | #include <linux/mtd/partitions.h> | ||
6 | |||
7 | #define ZOOM_NAND_CS 0 | ||
8 | |||
9 | extern void __init board_nand_init(struct mtd_partition *, u8 nr_parts, u8 cs); | ||
4 | extern int __init zoom_debugboard_init(void); | 10 | extern int __init zoom_debugboard_init(void); |
5 | extern void __init zoom_peripherals_init(void); | 11 | extern void __init zoom_peripherals_init(void); |
diff --git a/arch/arm/mach-omap2/include/mach/id.h b/arch/arm/mach-omap2/include/mach/id.h new file mode 100644 index 000000000000..02ed3aa56f1e --- /dev/null +++ b/arch/arm/mach-omap2/include/mach/id.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * OMAP2 CPU identification code | ||
3 | * | ||
4 | * Copyright (C) 2010 Kan-Ru Chen <kanru@0xlab.org> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef OMAP2_ARCH_ID_H | ||
11 | #define OMAP2_ARCH_ID_H | ||
12 | |||
13 | struct omap_die_id { | ||
14 | u32 id_0; | ||
15 | u32 id_1; | ||
16 | u32 id_2; | ||
17 | u32 id_3; | ||
18 | }; | ||
19 | |||
20 | void omap_get_die_id(struct omap_die_id *odi); | ||
21 | |||
22 | #endif | ||
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h index 423af3a6dd31..2744dfee1ff4 100644 --- a/arch/arm/mach-omap2/include/mach/omap4-common.h +++ b/arch/arm/mach-omap2/include/mach/omap4-common.h | |||
@@ -13,6 +13,13 @@ | |||
13 | #ifndef OMAP_ARCH_OMAP4_COMMON_H | 13 | #ifndef OMAP_ARCH_OMAP4_COMMON_H |
14 | #define OMAP_ARCH_OMAP4_COMMON_H | 14 | #define OMAP_ARCH_OMAP4_COMMON_H |
15 | 15 | ||
16 | /* | ||
17 | * wfi used in low power code. Directly opcode is used instead | ||
18 | * of instruction to avoid mulit-omap build break | ||
19 | */ | ||
20 | #define do_wfi() \ | ||
21 | __asm__ __volatile__ (".word 0xe320f003" : : : "memory") | ||
22 | |||
16 | #ifdef CONFIG_CACHE_L2X0 | 23 | #ifdef CONFIG_CACHE_L2X0 |
17 | extern void __iomem *l2cache_base; | 24 | extern void __iomem *l2cache_base; |
18 | #endif | 25 | #endif |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index d1906c73aec1..210de9d292fb 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
30 | 30 | ||
31 | #include <plat/mux.h> | ||
32 | #include <plat/sram.h> | 31 | #include <plat/sram.h> |
33 | #include <plat/sdrc.h> | 32 | #include <plat/sdrc.h> |
34 | #include <plat/gpmc.h> | 33 | #include <plat/gpmc.h> |
@@ -327,7 +326,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | |||
327 | omap2430_hwmod_init(); | 326 | omap2430_hwmod_init(); |
328 | else if (cpu_is_omap34xx()) | 327 | else if (cpu_is_omap34xx()) |
329 | omap3xxx_hwmod_init(); | 328 | omap3xxx_hwmod_init(); |
330 | omap2_mux_init(); | ||
331 | /* The OPP tables have to be registered before a clk init */ | 329 | /* The OPP tables have to be registered before a clk init */ |
332 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); | 330 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); |
333 | 331 | ||
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index e82da680d908..14ee686b6492 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c | |||
@@ -44,9 +44,13 @@ | |||
44 | #define MMU_IRQ_EMUMISS (1 << 2) | 44 | #define MMU_IRQ_EMUMISS (1 << 2) |
45 | #define MMU_IRQ_TRANSLATIONFAULT (1 << 1) | 45 | #define MMU_IRQ_TRANSLATIONFAULT (1 << 1) |
46 | #define MMU_IRQ_TLBMISS (1 << 0) | 46 | #define MMU_IRQ_TLBMISS (1 << 0) |
47 | #define MMU_IRQ_MASK \ | 47 | |
48 | (MMU_IRQ_MULTIHITFAULT | MMU_IRQ_TABLEWALKFAULT | MMU_IRQ_EMUMISS | \ | 48 | #define __MMU_IRQ_FAULT \ |
49 | MMU_IRQ_TRANSLATIONFAULT) | 49 | (MMU_IRQ_MULTIHITFAULT | MMU_IRQ_EMUMISS | MMU_IRQ_TRANSLATIONFAULT) |
50 | #define MMU_IRQ_MASK \ | ||
51 | (__MMU_IRQ_FAULT | MMU_IRQ_TABLEWALKFAULT | MMU_IRQ_TLBMISS) | ||
52 | #define MMU_IRQ_TWL_MASK (__MMU_IRQ_FAULT | MMU_IRQ_TABLEWALKFAULT) | ||
53 | #define MMU_IRQ_TLB_MISS_MASK (__MMU_IRQ_FAULT | MMU_IRQ_TLBMISS) | ||
50 | 54 | ||
51 | /* MMU_CNTL */ | 55 | /* MMU_CNTL */ |
52 | #define MMU_CNTL_SHIFT 1 | 56 | #define MMU_CNTL_SHIFT 1 |
@@ -61,6 +65,26 @@ | |||
61 | ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \ | 65 | ((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \ |
62 | ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0) | 66 | ((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0) |
63 | 67 | ||
68 | |||
69 | static void __iommu_set_twl(struct iommu *obj, bool on) | ||
70 | { | ||
71 | u32 l = iommu_read_reg(obj, MMU_CNTL); | ||
72 | |||
73 | if (on) | ||
74 | iommu_write_reg(obj, MMU_IRQ_TWL_MASK, MMU_IRQENABLE); | ||
75 | else | ||
76 | iommu_write_reg(obj, MMU_IRQ_TLB_MISS_MASK, MMU_IRQENABLE); | ||
77 | |||
78 | l &= ~MMU_CNTL_MASK; | ||
79 | if (on) | ||
80 | l |= (MMU_CNTL_MMU_EN | MMU_CNTL_TWL_EN); | ||
81 | else | ||
82 | l |= (MMU_CNTL_MMU_EN); | ||
83 | |||
84 | iommu_write_reg(obj, l, MMU_CNTL); | ||
85 | } | ||
86 | |||
87 | |||
64 | static int omap2_iommu_enable(struct iommu *obj) | 88 | static int omap2_iommu_enable(struct iommu *obj) |
65 | { | 89 | { |
66 | u32 l, pa; | 90 | u32 l, pa; |
@@ -96,13 +120,9 @@ static int omap2_iommu_enable(struct iommu *obj) | |||
96 | l |= (MMU_SYS_IDLE_SMART | MMU_SYS_AUTOIDLE); | 120 | l |= (MMU_SYS_IDLE_SMART | MMU_SYS_AUTOIDLE); |
97 | iommu_write_reg(obj, l, MMU_SYSCONFIG); | 121 | iommu_write_reg(obj, l, MMU_SYSCONFIG); |
98 | 122 | ||
99 | iommu_write_reg(obj, MMU_IRQ_MASK, MMU_IRQENABLE); | ||
100 | iommu_write_reg(obj, pa, MMU_TTB); | 123 | iommu_write_reg(obj, pa, MMU_TTB); |
101 | 124 | ||
102 | l = iommu_read_reg(obj, MMU_CNTL); | 125 | __iommu_set_twl(obj, true); |
103 | l &= ~MMU_CNTL_MASK; | ||
104 | l |= (MMU_CNTL_MMU_EN | MMU_CNTL_TWL_EN); | ||
105 | iommu_write_reg(obj, l, MMU_CNTL); | ||
106 | 126 | ||
107 | return 0; | 127 | return 0; |
108 | } | 128 | } |
@@ -118,6 +138,11 @@ static void omap2_iommu_disable(struct iommu *obj) | |||
118 | dev_dbg(obj->dev, "%s is shutting down\n", obj->name); | 138 | dev_dbg(obj->dev, "%s is shutting down\n", obj->name); |
119 | } | 139 | } |
120 | 140 | ||
141 | static void omap2_iommu_set_twl(struct iommu *obj, bool on) | ||
142 | { | ||
143 | __iommu_set_twl(obj, false); | ||
144 | } | ||
145 | |||
121 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) | 146 | static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) |
122 | { | 147 | { |
123 | int i; | 148 | int i; |
@@ -147,7 +172,7 @@ static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) | |||
147 | printk("\n"); | 172 | printk("\n"); |
148 | 173 | ||
149 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); | 174 | iommu_write_reg(obj, stat, MMU_IRQSTATUS); |
150 | omap2_iommu_disable(obj); | 175 | |
151 | return stat; | 176 | return stat; |
152 | } | 177 | } |
153 | 178 | ||
@@ -300,6 +325,7 @@ static const struct iommu_functions omap2_iommu_ops = { | |||
300 | 325 | ||
301 | .enable = omap2_iommu_enable, | 326 | .enable = omap2_iommu_enable, |
302 | .disable = omap2_iommu_disable, | 327 | .disable = omap2_iommu_disable, |
328 | .set_twl = omap2_iommu_set_twl, | ||
303 | .fault_isr = omap2_iommu_fault_isr, | 329 | .fault_isr = omap2_iommu_fault_isr, |
304 | 330 | ||
305 | .tlb_read_cr = omap2_tlb_read_cr, | 331 | .tlb_read_cr = omap2_tlb_read_cr, |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index c29337074ad3..87aa4c9597cc 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -20,17 +20,18 @@ | |||
20 | 20 | ||
21 | #include <mach/irqs.h> | 21 | #include <mach/irqs.h> |
22 | #include <plat/dma.h> | 22 | #include <plat/dma.h> |
23 | #include <plat/mux.h> | ||
24 | #include <plat/cpu.h> | 23 | #include <plat/cpu.h> |
25 | #include <plat/mcbsp.h> | 24 | #include <plat/mcbsp.h> |
26 | 25 | ||
26 | #include "mux.h" | ||
27 | |||
27 | static void omap2_mcbsp2_mux_setup(void) | 28 | static void omap2_mcbsp2_mux_setup(void) |
28 | { | 29 | { |
29 | omap_cfg_reg(Y15_24XX_MCBSP2_CLKX); | 30 | omap_mux_init_signal("eac_ac_sclk.mcbsp2_clkx", OMAP_PULL_ENA); |
30 | omap_cfg_reg(R14_24XX_MCBSP2_FSX); | 31 | omap_mux_init_signal("eac_ac_fs.mcbsp2_fsx", OMAP_PULL_ENA); |
31 | omap_cfg_reg(W15_24XX_MCBSP2_DR); | 32 | omap_mux_init_signal("eac_ac_din.mcbsp2_dr", OMAP_PULL_ENA); |
32 | omap_cfg_reg(V15_24XX_MCBSP2_DX); | 33 | omap_mux_init_signal("eac_ac_dout.mcbsp2_dx", OMAP_PULL_ENA); |
33 | omap_cfg_reg(V14_24XX_GPIO117); | 34 | omap_mux_init_gpio(117, OMAP_PULL_ENA); |
34 | /* | 35 | /* |
35 | * TODO: Need to add MUX settings for OMAP 2430 SDP | 36 | * TODO: Need to add MUX settings for OMAP 2430 SDP |
36 | */ | 37 | */ |
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 8b3d26935a39..ab403b2ed26b 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
@@ -37,12 +37,12 @@ | |||
37 | #include <asm/system.h> | 37 | #include <asm/system.h> |
38 | 38 | ||
39 | #include <plat/control.h> | 39 | #include <plat/control.h> |
40 | #include <plat/mux.h> | ||
41 | 40 | ||
42 | #include "mux.h" | 41 | #include "mux.h" |
43 | 42 | ||
44 | #define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ | 43 | #define OMAP_MUX_BASE_OFFSET 0x30 /* Offset from CTRL_BASE */ |
45 | #define OMAP_MUX_BASE_SZ 0x5ca | 44 | #define OMAP_MUX_BASE_SZ 0x5ca |
45 | #define MUXABLE_GPIO_MODE3 BIT(0) | ||
46 | 46 | ||
47 | struct omap_mux_entry { | 47 | struct omap_mux_entry { |
48 | struct omap_mux mux; | 48 | struct omap_mux mux; |
@@ -51,6 +51,7 @@ struct omap_mux_entry { | |||
51 | 51 | ||
52 | static unsigned long mux_phys; | 52 | static unsigned long mux_phys; |
53 | static void __iomem *mux_base; | 53 | static void __iomem *mux_base; |
54 | static u8 omap_mux_flags; | ||
54 | 55 | ||
55 | u16 omap_mux_read(u16 reg) | 56 | u16 omap_mux_read(u16 reg) |
56 | { | 57 | { |
@@ -76,301 +77,6 @@ void omap_mux_write_array(struct omap_board_mux *board_mux) | |||
76 | } | 77 | } |
77 | } | 78 | } |
78 | 79 | ||
79 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_OMAP_MUX) | ||
80 | |||
81 | static struct omap_mux_cfg arch_mux_cfg; | ||
82 | |||
83 | /* NOTE: See mux.h for the enumeration */ | ||
84 | |||
85 | static struct pin_config __initdata_or_module omap24xx_pins[] = { | ||
86 | /* | ||
87 | * description mux mux pull pull debug | ||
88 | * offset mode ena type | ||
89 | */ | ||
90 | |||
91 | /* 24xx I2C */ | ||
92 | MUX_CFG_24XX("M19_24XX_I2C1_SCL", 0x111, 0, 0, 0, 1) | ||
93 | MUX_CFG_24XX("L15_24XX_I2C1_SDA", 0x112, 0, 0, 0, 1) | ||
94 | MUX_CFG_24XX("J15_24XX_I2C2_SCL", 0x113, 0, 0, 1, 1) | ||
95 | MUX_CFG_24XX("H19_24XX_I2C2_SDA", 0x114, 0, 0, 0, 1) | ||
96 | |||
97 | /* Menelaus interrupt */ | ||
98 | MUX_CFG_24XX("W19_24XX_SYS_NIRQ", 0x12c, 0, 1, 1, 1) | ||
99 | |||
100 | /* 24xx clocks */ | ||
101 | MUX_CFG_24XX("W14_24XX_SYS_CLKOUT", 0x137, 0, 1, 1, 1) | ||
102 | |||
103 | /* 24xx GPMC chipselects, wait pin monitoring */ | ||
104 | MUX_CFG_24XX("E2_GPMC_NCS2", 0x08e, 0, 1, 1, 1) | ||
105 | MUX_CFG_24XX("L2_GPMC_NCS7", 0x093, 0, 1, 1, 1) | ||
106 | MUX_CFG_24XX("L3_GPMC_WAIT0", 0x09a, 0, 1, 1, 1) | ||
107 | MUX_CFG_24XX("N7_GPMC_WAIT1", 0x09b, 0, 1, 1, 1) | ||
108 | MUX_CFG_24XX("M1_GPMC_WAIT2", 0x09c, 0, 1, 1, 1) | ||
109 | MUX_CFG_24XX("P1_GPMC_WAIT3", 0x09d, 0, 1, 1, 1) | ||
110 | |||
111 | /* 24xx McBSP */ | ||
112 | MUX_CFG_24XX("Y15_24XX_MCBSP2_CLKX", 0x124, 1, 1, 0, 1) | ||
113 | MUX_CFG_24XX("R14_24XX_MCBSP2_FSX", 0x125, 1, 1, 0, 1) | ||
114 | MUX_CFG_24XX("W15_24XX_MCBSP2_DR", 0x126, 1, 1, 0, 1) | ||
115 | MUX_CFG_24XX("V15_24XX_MCBSP2_DX", 0x127, 1, 1, 0, 1) | ||
116 | |||
117 | /* 24xx GPIO */ | ||
118 | MUX_CFG_24XX("M21_242X_GPIO11", 0x0c9, 3, 1, 1, 1) | ||
119 | MUX_CFG_24XX("P21_242X_GPIO12", 0x0ca, 3, 0, 0, 1) | ||
120 | MUX_CFG_24XX("AA10_242X_GPIO13", 0x0e5, 3, 0, 0, 1) | ||
121 | MUX_CFG_24XX("AA6_242X_GPIO14", 0x0e6, 3, 0, 0, 1) | ||
122 | MUX_CFG_24XX("AA4_242X_GPIO15", 0x0e7, 3, 0, 0, 1) | ||
123 | MUX_CFG_24XX("Y11_242X_GPIO16", 0x0e8, 3, 0, 0, 1) | ||
124 | MUX_CFG_24XX("AA12_242X_GPIO17", 0x0e9, 3, 0, 0, 1) | ||
125 | MUX_CFG_24XX("AA8_242X_GPIO58", 0x0ea, 3, 0, 0, 1) | ||
126 | MUX_CFG_24XX("Y20_24XX_GPIO60", 0x12c, 3, 0, 0, 1) | ||
127 | MUX_CFG_24XX("W4__24XX_GPIO74", 0x0f2, 3, 0, 0, 1) | ||
128 | MUX_CFG_24XX("N15_24XX_GPIO85", 0x103, 3, 0, 0, 1) | ||
129 | MUX_CFG_24XX("M15_24XX_GPIO92", 0x10a, 3, 0, 0, 1) | ||
130 | MUX_CFG_24XX("P20_24XX_GPIO93", 0x10b, 3, 0, 0, 1) | ||
131 | MUX_CFG_24XX("P18_24XX_GPIO95", 0x10d, 3, 0, 0, 1) | ||
132 | MUX_CFG_24XX("M18_24XX_GPIO96", 0x10e, 3, 0, 0, 1) | ||
133 | MUX_CFG_24XX("L14_24XX_GPIO97", 0x10f, 3, 0, 0, 1) | ||
134 | MUX_CFG_24XX("J15_24XX_GPIO99", 0x113, 3, 1, 1, 1) | ||
135 | MUX_CFG_24XX("V14_24XX_GPIO117", 0x128, 3, 1, 0, 1) | ||
136 | MUX_CFG_24XX("P14_24XX_GPIO125", 0x140, 3, 1, 1, 1) | ||
137 | |||
138 | /* 242x DBG GPIO */ | ||
139 | MUX_CFG_24XX("V4_242X_GPIO49", 0xd3, 3, 0, 0, 1) | ||
140 | MUX_CFG_24XX("W2_242X_GPIO50", 0xd4, 3, 0, 0, 1) | ||
141 | MUX_CFG_24XX("U4_242X_GPIO51", 0xd5, 3, 0, 0, 1) | ||
142 | MUX_CFG_24XX("V3_242X_GPIO52", 0xd6, 3, 0, 0, 1) | ||
143 | MUX_CFG_24XX("V2_242X_GPIO53", 0xd7, 3, 0, 0, 1) | ||
144 | MUX_CFG_24XX("V6_242X_GPIO53", 0xcf, 3, 0, 0, 1) | ||
145 | MUX_CFG_24XX("T4_242X_GPIO54", 0xd8, 3, 0, 0, 1) | ||
146 | MUX_CFG_24XX("Y4_242X_GPIO54", 0xd0, 3, 0, 0, 1) | ||
147 | MUX_CFG_24XX("T3_242X_GPIO55", 0xd9, 3, 0, 0, 1) | ||
148 | MUX_CFG_24XX("U2_242X_GPIO56", 0xda, 3, 0, 0, 1) | ||
149 | |||
150 | /* 24xx external DMA requests */ | ||
151 | MUX_CFG_24XX("AA10_242X_DMAREQ0", 0x0e5, 2, 0, 0, 1) | ||
152 | MUX_CFG_24XX("AA6_242X_DMAREQ1", 0x0e6, 2, 0, 0, 1) | ||
153 | MUX_CFG_24XX("E4_242X_DMAREQ2", 0x074, 2, 0, 0, 1) | ||
154 | MUX_CFG_24XX("G4_242X_DMAREQ3", 0x073, 2, 0, 0, 1) | ||
155 | MUX_CFG_24XX("D3_242X_DMAREQ4", 0x072, 2, 0, 0, 1) | ||
156 | MUX_CFG_24XX("E3_242X_DMAREQ5", 0x071, 2, 0, 0, 1) | ||
157 | |||
158 | /* UART3 */ | ||
159 | MUX_CFG_24XX("K15_24XX_UART3_TX", 0x118, 0, 0, 0, 1) | ||
160 | MUX_CFG_24XX("K14_24XX_UART3_RX", 0x119, 0, 0, 0, 1) | ||
161 | |||
162 | /* MMC/SDIO */ | ||
163 | MUX_CFG_24XX("G19_24XX_MMC_CLKO", 0x0f3, 0, 0, 0, 1) | ||
164 | MUX_CFG_24XX("H18_24XX_MMC_CMD", 0x0f4, 0, 0, 0, 1) | ||
165 | MUX_CFG_24XX("F20_24XX_MMC_DAT0", 0x0f5, 0, 0, 0, 1) | ||
166 | MUX_CFG_24XX("H14_24XX_MMC_DAT1", 0x0f6, 0, 0, 0, 1) | ||
167 | MUX_CFG_24XX("E19_24XX_MMC_DAT2", 0x0f7, 0, 0, 0, 1) | ||
168 | MUX_CFG_24XX("D19_24XX_MMC_DAT3", 0x0f8, 0, 0, 0, 1) | ||
169 | MUX_CFG_24XX("F19_24XX_MMC_DAT_DIR0", 0x0f9, 0, 0, 0, 1) | ||
170 | MUX_CFG_24XX("E20_24XX_MMC_DAT_DIR1", 0x0fa, 0, 0, 0, 1) | ||
171 | MUX_CFG_24XX("F18_24XX_MMC_DAT_DIR2", 0x0fb, 0, 0, 0, 1) | ||
172 | MUX_CFG_24XX("E18_24XX_MMC_DAT_DIR3", 0x0fc, 0, 0, 0, 1) | ||
173 | MUX_CFG_24XX("G18_24XX_MMC_CMD_DIR", 0x0fd, 0, 0, 0, 1) | ||
174 | MUX_CFG_24XX("H15_24XX_MMC_CLKI", 0x0fe, 0, 0, 0, 1) | ||
175 | |||
176 | /* Full speed USB */ | ||
177 | MUX_CFG_24XX("J20_24XX_USB0_PUEN", 0x11d, 0, 0, 0, 1) | ||
178 | MUX_CFG_24XX("J19_24XX_USB0_VP", 0x11e, 0, 0, 0, 1) | ||
179 | MUX_CFG_24XX("K20_24XX_USB0_VM", 0x11f, 0, 0, 0, 1) | ||
180 | MUX_CFG_24XX("J18_24XX_USB0_RCV", 0x120, 0, 0, 0, 1) | ||
181 | MUX_CFG_24XX("K19_24XX_USB0_TXEN", 0x121, 0, 0, 0, 1) | ||
182 | MUX_CFG_24XX("J14_24XX_USB0_SE0", 0x122, 0, 0, 0, 1) | ||
183 | MUX_CFG_24XX("K18_24XX_USB0_DAT", 0x123, 0, 0, 0, 1) | ||
184 | |||
185 | MUX_CFG_24XX("N14_24XX_USB1_SE0", 0x0ed, 2, 0, 0, 1) | ||
186 | MUX_CFG_24XX("W12_24XX_USB1_SE0", 0x0dd, 3, 0, 0, 1) | ||
187 | MUX_CFG_24XX("P15_24XX_USB1_DAT", 0x0ee, 2, 0, 0, 1) | ||
188 | MUX_CFG_24XX("R13_24XX_USB1_DAT", 0x0e0, 3, 0, 0, 1) | ||
189 | MUX_CFG_24XX("W20_24XX_USB1_TXEN", 0x0ec, 2, 0, 0, 1) | ||
190 | MUX_CFG_24XX("P13_24XX_USB1_TXEN", 0x0df, 3, 0, 0, 1) | ||
191 | MUX_CFG_24XX("V19_24XX_USB1_RCV", 0x0eb, 2, 0, 0, 1) | ||
192 | MUX_CFG_24XX("V12_24XX_USB1_RCV", 0x0de, 3, 0, 0, 1) | ||
193 | |||
194 | MUX_CFG_24XX("AA10_24XX_USB2_SE0", 0x0e5, 2, 0, 0, 1) | ||
195 | MUX_CFG_24XX("Y11_24XX_USB2_DAT", 0x0e8, 2, 0, 0, 1) | ||
196 | MUX_CFG_24XX("AA12_24XX_USB2_TXEN", 0x0e9, 2, 0, 0, 1) | ||
197 | MUX_CFG_24XX("AA6_24XX_USB2_RCV", 0x0e6, 2, 0, 0, 1) | ||
198 | MUX_CFG_24XX("AA4_24XX_USB2_TLLSE0", 0x0e7, 2, 0, 0, 1) | ||
199 | |||
200 | /* Keypad GPIO*/ | ||
201 | MUX_CFG_24XX("T19_24XX_KBR0", 0x106, 3, 1, 1, 1) | ||
202 | MUX_CFG_24XX("R19_24XX_KBR1", 0x107, 3, 1, 1, 1) | ||
203 | MUX_CFG_24XX("V18_24XX_KBR2", 0x139, 3, 1, 1, 1) | ||
204 | MUX_CFG_24XX("M21_24XX_KBR3", 0xc9, 3, 1, 1, 1) | ||
205 | MUX_CFG_24XX("E5__24XX_KBR4", 0x138, 3, 1, 1, 1) | ||
206 | MUX_CFG_24XX("M18_24XX_KBR5", 0x10e, 3, 1, 1, 1) | ||
207 | MUX_CFG_24XX("R20_24XX_KBC0", 0x108, 3, 0, 0, 1) | ||
208 | MUX_CFG_24XX("M14_24XX_KBC1", 0x109, 3, 0, 0, 1) | ||
209 | MUX_CFG_24XX("H19_24XX_KBC2", 0x114, 3, 0, 0, 1) | ||
210 | MUX_CFG_24XX("V17_24XX_KBC3", 0x135, 3, 0, 0, 1) | ||
211 | MUX_CFG_24XX("P21_24XX_KBC4", 0xca, 3, 0, 0, 1) | ||
212 | MUX_CFG_24XX("L14_24XX_KBC5", 0x10f, 3, 0, 0, 1) | ||
213 | MUX_CFG_24XX("N19_24XX_KBC6", 0x110, 3, 0, 0, 1) | ||
214 | |||
215 | /* 24xx Menelaus Keypad GPIO */ | ||
216 | MUX_CFG_24XX("B3__24XX_KBR5", 0x30, 3, 1, 1, 1) | ||
217 | MUX_CFG_24XX("AA4_24XX_KBC2", 0xe7, 3, 0, 0, 1) | ||
218 | MUX_CFG_24XX("B13_24XX_KBC6", 0x110, 3, 0, 0, 1) | ||
219 | |||
220 | /* 2430 USB */ | ||
221 | MUX_CFG_24XX("AD9_2430_USB0_PUEN", 0x133, 4, 0, 0, 1) | ||
222 | MUX_CFG_24XX("Y11_2430_USB0_VP", 0x134, 4, 0, 0, 1) | ||
223 | MUX_CFG_24XX("AD7_2430_USB0_VM", 0x135, 4, 0, 0, 1) | ||
224 | MUX_CFG_24XX("AE7_2430_USB0_RCV", 0x136, 4, 0, 0, 1) | ||
225 | MUX_CFG_24XX("AD4_2430_USB0_TXEN", 0x137, 4, 0, 0, 1) | ||
226 | MUX_CFG_24XX("AF9_2430_USB0_SE0", 0x138, 4, 0, 0, 1) | ||
227 | MUX_CFG_24XX("AE6_2430_USB0_DAT", 0x139, 4, 0, 0, 1) | ||
228 | MUX_CFG_24XX("AD24_2430_USB1_SE0", 0x107, 2, 0, 0, 1) | ||
229 | MUX_CFG_24XX("AB24_2430_USB1_RCV", 0x108, 2, 0, 0, 1) | ||
230 | MUX_CFG_24XX("Y25_2430_USB1_TXEN", 0x109, 2, 0, 0, 1) | ||
231 | MUX_CFG_24XX("AA26_2430_USB1_DAT", 0x10A, 2, 0, 0, 1) | ||
232 | |||
233 | /* 2430 HS-USB */ | ||
234 | MUX_CFG_24XX("AD9_2430_USB0HS_DATA3", 0x133, 0, 0, 0, 1) | ||
235 | MUX_CFG_24XX("Y11_2430_USB0HS_DATA4", 0x134, 0, 0, 0, 1) | ||
236 | MUX_CFG_24XX("AD7_2430_USB0HS_DATA5", 0x135, 0, 0, 0, 1) | ||
237 | MUX_CFG_24XX("AE7_2430_USB0HS_DATA6", 0x136, 0, 0, 0, 1) | ||
238 | MUX_CFG_24XX("AD4_2430_USB0HS_DATA2", 0x137, 0, 0, 0, 1) | ||
239 | MUX_CFG_24XX("AF9_2430_USB0HS_DATA0", 0x138, 0, 0, 0, 1) | ||
240 | MUX_CFG_24XX("AE6_2430_USB0HS_DATA1", 0x139, 0, 0, 0, 1) | ||
241 | MUX_CFG_24XX("AE8_2430_USB0HS_CLK", 0x13A, 0, 0, 0, 1) | ||
242 | MUX_CFG_24XX("AD8_2430_USB0HS_DIR", 0x13B, 0, 0, 0, 1) | ||
243 | MUX_CFG_24XX("AE5_2430_USB0HS_STP", 0x13c, 0, 1, 1, 1) | ||
244 | MUX_CFG_24XX("AE9_2430_USB0HS_NXT", 0x13D, 0, 0, 0, 1) | ||
245 | MUX_CFG_24XX("AC7_2430_USB0HS_DATA7", 0x13E, 0, 0, 0, 1) | ||
246 | |||
247 | /* 2430 McBSP */ | ||
248 | MUX_CFG_24XX("AD6_2430_MCBSP_CLKS", 0x011E, 0, 0, 0, 1) | ||
249 | |||
250 | MUX_CFG_24XX("AB2_2430_MCBSP1_CLKR", 0x011A, 0, 0, 0, 1) | ||
251 | MUX_CFG_24XX("AD5_2430_MCBSP1_FSR", 0x011B, 0, 0, 0, 1) | ||
252 | MUX_CFG_24XX("AA1_2430_MCBSP1_DX", 0x011C, 0, 0, 0, 1) | ||
253 | MUX_CFG_24XX("AF3_2430_MCBSP1_DR", 0x011D, 0, 0, 0, 1) | ||
254 | MUX_CFG_24XX("AB3_2430_MCBSP1_FSX", 0x011F, 0, 0, 0, 1) | ||
255 | MUX_CFG_24XX("Y9_2430_MCBSP1_CLKX", 0x0120, 0, 0, 0, 1) | ||
256 | |||
257 | MUX_CFG_24XX("AC10_2430_MCBSP2_FSX", 0x012E, 1, 0, 0, 1) | ||
258 | MUX_CFG_24XX("AD16_2430_MCBSP2_CLX", 0x012F, 1, 0, 0, 1) | ||
259 | MUX_CFG_24XX("AE13_2430_MCBSP2_DX", 0x0130, 1, 0, 0, 1) | ||
260 | MUX_CFG_24XX("AD13_2430_MCBSP2_DR", 0x0131, 1, 0, 0, 1) | ||
261 | MUX_CFG_24XX("AC10_2430_MCBSP2_FSX_OFF",0x012E, 0, 0, 0, 1) | ||
262 | MUX_CFG_24XX("AD16_2430_MCBSP2_CLX_OFF",0x012F, 0, 0, 0, 1) | ||
263 | MUX_CFG_24XX("AE13_2430_MCBSP2_DX_OFF", 0x0130, 0, 0, 0, 1) | ||
264 | MUX_CFG_24XX("AD13_2430_MCBSP2_DR_OFF", 0x0131, 0, 0, 0, 1) | ||
265 | |||
266 | MUX_CFG_24XX("AC9_2430_MCBSP3_CLKX", 0x0103, 0, 0, 0, 1) | ||
267 | MUX_CFG_24XX("AE4_2430_MCBSP3_FSX", 0x0104, 0, 0, 0, 1) | ||
268 | MUX_CFG_24XX("AE2_2430_MCBSP3_DR", 0x0105, 0, 0, 0, 1) | ||
269 | MUX_CFG_24XX("AF4_2430_MCBSP3_DX", 0x0106, 0, 0, 0, 1) | ||
270 | |||
271 | MUX_CFG_24XX("N3_2430_MCBSP4_CLKX", 0x010B, 1, 0, 0, 1) | ||
272 | MUX_CFG_24XX("AD23_2430_MCBSP4_DR", 0x010C, 1, 0, 0, 1) | ||
273 | MUX_CFG_24XX("AB25_2430_MCBSP4_DX", 0x010D, 1, 0, 0, 1) | ||
274 | MUX_CFG_24XX("AC25_2430_MCBSP4_FSX", 0x010E, 1, 0, 0, 1) | ||
275 | |||
276 | MUX_CFG_24XX("AE16_2430_MCBSP5_CLKX", 0x00ED, 1, 0, 0, 1) | ||
277 | MUX_CFG_24XX("AF12_2430_MCBSP5_FSX", 0x00ED, 1, 0, 0, 1) | ||
278 | MUX_CFG_24XX("K7_2430_MCBSP5_DX", 0x00EF, 1, 0, 0, 1) | ||
279 | MUX_CFG_24XX("M1_2430_MCBSP5_DR", 0x00F0, 1, 0, 0, 1) | ||
280 | |||
281 | /* 2430 MCSPI1 */ | ||
282 | MUX_CFG_24XX("Y18_2430_MCSPI1_CLK", 0x010F, 0, 0, 0, 1) | ||
283 | MUX_CFG_24XX("AD15_2430_MCSPI1_SIMO", 0x0110, 0, 0, 0, 1) | ||
284 | MUX_CFG_24XX("AE17_2430_MCSPI1_SOMI", 0x0111, 0, 0, 0, 1) | ||
285 | MUX_CFG_24XX("U1_2430_MCSPI1_CS0", 0x0112, 0, 0, 0, 1) | ||
286 | |||
287 | /* Touchscreen GPIO */ | ||
288 | MUX_CFG_24XX("AF19_2430_GPIO_85", 0x0113, 3, 0, 0, 1) | ||
289 | |||
290 | }; | ||
291 | |||
292 | #define OMAP24XX_PINS_SZ ARRAY_SIZE(omap24xx_pins) | ||
293 | |||
294 | #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS) | ||
295 | |||
296 | static void __init_or_module omap2_cfg_debug(const struct pin_config *cfg, u16 reg) | ||
297 | { | ||
298 | u16 orig; | ||
299 | u8 warn = 0, debug = 0; | ||
300 | |||
301 | orig = omap_mux_read(cfg->mux_reg - OMAP_MUX_BASE_OFFSET); | ||
302 | |||
303 | #ifdef CONFIG_OMAP_MUX_DEBUG | ||
304 | debug = cfg->debug; | ||
305 | #endif | ||
306 | warn = (orig != reg); | ||
307 | if (debug || warn) | ||
308 | printk(KERN_WARNING | ||
309 | "MUX: setup %s (0x%p): 0x%04x -> 0x%04x\n", | ||
310 | cfg->name, omap_ctrl_base_get() + cfg->mux_reg, | ||
311 | orig, reg); | ||
312 | } | ||
313 | #else | ||
314 | #define omap2_cfg_debug(x, y) do {} while (0) | ||
315 | #endif | ||
316 | |||
317 | static int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg) | ||
318 | { | ||
319 | static DEFINE_SPINLOCK(mux_spin_lock); | ||
320 | unsigned long flags; | ||
321 | u8 reg = 0; | ||
322 | |||
323 | spin_lock_irqsave(&mux_spin_lock, flags); | ||
324 | reg |= cfg->mask & 0x7; | ||
325 | if (cfg->pull_val) | ||
326 | reg |= OMAP2_PULL_ENA; | ||
327 | if (cfg->pu_pd_val) | ||
328 | reg |= OMAP2_PULL_UP; | ||
329 | omap2_cfg_debug(cfg, reg); | ||
330 | omap_mux_write(reg, cfg->mux_reg - OMAP_MUX_BASE_OFFSET); | ||
331 | spin_unlock_irqrestore(&mux_spin_lock, flags); | ||
332 | |||
333 | return 0; | ||
334 | } | ||
335 | |||
336 | int __init omap2_mux_init(void) | ||
337 | { | ||
338 | u32 mux_pbase; | ||
339 | |||
340 | if (cpu_is_omap2420()) | ||
341 | mux_pbase = OMAP2420_CTRL_BASE + OMAP_MUX_BASE_OFFSET; | ||
342 | else if (cpu_is_omap2430()) | ||
343 | mux_pbase = OMAP243X_CTRL_BASE + OMAP_MUX_BASE_OFFSET; | ||
344 | else | ||
345 | return -ENODEV; | ||
346 | |||
347 | mux_base = ioremap(mux_pbase, OMAP_MUX_BASE_SZ); | ||
348 | if (!mux_base) { | ||
349 | printk(KERN_ERR "mux: Could not ioremap\n"); | ||
350 | return -ENODEV; | ||
351 | } | ||
352 | |||
353 | if (cpu_is_omap24xx()) { | ||
354 | arch_mux_cfg.pins = omap24xx_pins; | ||
355 | arch_mux_cfg.size = OMAP24XX_PINS_SZ; | ||
356 | arch_mux_cfg.cfg_reg = omap24xx_cfg_reg; | ||
357 | |||
358 | return omap_mux_register(&arch_mux_cfg); | ||
359 | } | ||
360 | |||
361 | return 0; | ||
362 | } | ||
363 | |||
364 | #else | ||
365 | int __init omap2_mux_init(void) | ||
366 | { | ||
367 | return 0; | ||
368 | } | ||
369 | #endif /* CONFIG_OMAP_MUX */ | ||
370 | |||
371 | /*----------------------------------------------------------------------------*/ | ||
372 | |||
373 | #ifdef CONFIG_ARCH_OMAP3 | ||
374 | static LIST_HEAD(muxmodes); | 80 | static LIST_HEAD(muxmodes); |
375 | static DEFINE_MUTEX(muxmode_mutex); | 81 | static DEFINE_MUTEX(muxmode_mutex); |
376 | 82 | ||
@@ -381,6 +87,9 @@ static char *omap_mux_options; | |||
381 | int __init omap_mux_init_gpio(int gpio, int val) | 87 | int __init omap_mux_init_gpio(int gpio, int val) |
382 | { | 88 | { |
383 | struct omap_mux_entry *e; | 89 | struct omap_mux_entry *e; |
90 | struct omap_mux *gpio_mux; | ||
91 | u16 old_mode; | ||
92 | u16 mux_mode; | ||
384 | int found = 0; | 93 | int found = 0; |
385 | 94 | ||
386 | if (!gpio) | 95 | if (!gpio) |
@@ -389,31 +98,33 @@ int __init omap_mux_init_gpio(int gpio, int val) | |||
389 | list_for_each_entry(e, &muxmodes, node) { | 98 | list_for_each_entry(e, &muxmodes, node) { |
390 | struct omap_mux *m = &e->mux; | 99 | struct omap_mux *m = &e->mux; |
391 | if (gpio == m->gpio) { | 100 | if (gpio == m->gpio) { |
392 | u16 old_mode; | 101 | gpio_mux = m; |
393 | u16 mux_mode; | ||
394 | |||
395 | old_mode = omap_mux_read(m->reg_offset); | ||
396 | mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); | ||
397 | mux_mode |= OMAP_MUX_MODE4; | ||
398 | printk(KERN_DEBUG "mux: Setting signal " | ||
399 | "%s.gpio%i 0x%04x -> 0x%04x\n", | ||
400 | m->muxnames[0], gpio, old_mode, mux_mode); | ||
401 | omap_mux_write(mux_mode, m->reg_offset); | ||
402 | found++; | 102 | found++; |
403 | } | 103 | } |
404 | } | 104 | } |
405 | 105 | ||
406 | if (found == 1) | 106 | if (found == 0) { |
407 | return 0; | 107 | printk(KERN_ERR "mux: Could not set gpio%i\n", gpio); |
108 | return -ENODEV; | ||
109 | } | ||
408 | 110 | ||
409 | if (found > 1) { | 111 | if (found > 1) { |
410 | printk(KERN_ERR "mux: Multiple gpio paths for gpio%i\n", gpio); | 112 | printk(KERN_INFO "mux: Multiple gpio paths (%d) for gpio%i\n", |
113 | found, gpio); | ||
411 | return -EINVAL; | 114 | return -EINVAL; |
412 | } | 115 | } |
413 | 116 | ||
414 | printk(KERN_ERR "mux: Could not set gpio%i\n", gpio); | 117 | old_mode = omap_mux_read(gpio_mux->reg_offset); |
118 | mux_mode = val & ~(OMAP_MUX_NR_MODES - 1); | ||
119 | if (omap_mux_flags & MUXABLE_GPIO_MODE3) | ||
120 | mux_mode |= OMAP_MUX_MODE3; | ||
121 | else | ||
122 | mux_mode |= OMAP_MUX_MODE4; | ||
123 | printk(KERN_DEBUG "mux: Setting signal %s.gpio%i 0x%04x -> 0x%04x\n", | ||
124 | gpio_mux->muxnames[0], gpio, old_mode, mux_mode); | ||
125 | omap_mux_write(mux_mode, gpio_mux->reg_offset); | ||
415 | 126 | ||
416 | return -ENODEV; | 127 | return 0; |
417 | } | 128 | } |
418 | 129 | ||
419 | int __init omap_mux_init_signal(char *muxname, int val) | 130 | int __init omap_mux_init_signal(char *muxname, int val) |
@@ -1032,6 +743,9 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size, | |||
1032 | return -ENODEV; | 743 | return -ENODEV; |
1033 | } | 744 | } |
1034 | 745 | ||
746 | if (cpu_is_omap24xx()) | ||
747 | omap_mux_flags = MUXABLE_GPIO_MODE3; | ||
748 | |||
1035 | omap_mux_init_package(superset, package_subset, package_balls); | 749 | omap_mux_init_package(superset, package_subset, package_balls); |
1036 | omap_mux_init_list(superset); | 750 | omap_mux_init_list(superset); |
1037 | omap_mux_init_signals(board_mux); | 751 | omap_mux_init_signals(board_mux); |
@@ -1039,5 +753,3 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size, | |||
1039 | return 0; | 753 | return 0; |
1040 | } | 754 | } |
1041 | 755 | ||
1042 | #endif /* CONFIG_ARCH_OMAP3 */ | ||
1043 | |||
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index 480abc56e605..a8e040c2c7e9 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h | |||
@@ -7,6 +7,8 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "mux2420.h" | ||
11 | #include "mux2430.h" | ||
10 | #include "mux34xx.h" | 12 | #include "mux34xx.h" |
11 | 13 | ||
12 | #define OMAP_MUX_TERMINATOR 0xffff | 14 | #define OMAP_MUX_TERMINATOR 0xffff |
@@ -56,10 +58,12 @@ | |||
56 | 58 | ||
57 | /* Flags for omap_mux_init */ | 59 | /* Flags for omap_mux_init */ |
58 | #define OMAP_PACKAGE_MASK 0xffff | 60 | #define OMAP_PACKAGE_MASK 0xffff |
59 | #define OMAP_PACKAGE_CBP 4 /* 515-pin 0.40 0.50 */ | 61 | #define OMAP_PACKAGE_CBP 6 /* 515-pin 0.40 0.50 */ |
60 | #define OMAP_PACKAGE_CUS 3 /* 423-pin 0.65 */ | 62 | #define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */ |
61 | #define OMAP_PACKAGE_CBB 2 /* 515-pin 0.40 0.50 */ | 63 | #define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */ |
62 | #define OMAP_PACKAGE_CBC 1 /* 515-pin 0.50 0.65 */ | 64 | #define OMAP_PACKAGE_CBC 3 /* 515-pin 0.50 0.65 */ |
65 | #define OMAP_PACKAGE_ZAC 2 /* 24xx 447-pin POP */ | ||
66 | #define OMAP_PACKAGE_ZAF 1 /* 2420 447-pin SIP */ | ||
63 | 67 | ||
64 | 68 | ||
65 | #define OMAP_MUX_NR_MODES 8 /* Available modes */ | 69 | #define OMAP_MUX_NR_MODES 8 /* Available modes */ |
@@ -102,7 +106,7 @@ struct omap_board_mux { | |||
102 | u16 value; | 106 | u16 value; |
103 | }; | 107 | }; |
104 | 108 | ||
105 | #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_ARCH_OMAP3) | 109 | #if defined(CONFIG_OMAP_MUX) |
106 | 110 | ||
107 | /** | 111 | /** |
108 | * omap_mux_init_gpio - initialize a signal based on the GPIO number | 112 | * omap_mux_init_gpio - initialize a signal based on the GPIO number |
@@ -171,6 +175,20 @@ void omap_mux_write(u16 val, u16 mux_offset); | |||
171 | void omap_mux_write_array(struct omap_board_mux *board_mux); | 175 | void omap_mux_write_array(struct omap_board_mux *board_mux); |
172 | 176 | ||
173 | /** | 177 | /** |
178 | * omap2420_mux_init() - initialize mux system with board specific set | ||
179 | * @board_mux: Board specific mux table | ||
180 | * @flags: OMAP package type used for the board | ||
181 | */ | ||
182 | int omap2420_mux_init(struct omap_board_mux *board_mux, int flags); | ||
183 | |||
184 | /** | ||
185 | * omap2430_mux_init() - initialize mux system with board specific set | ||
186 | * @board_mux: Board specific mux table | ||
187 | * @flags: OMAP package type used for the board | ||
188 | */ | ||
189 | int omap2430_mux_init(struct omap_board_mux *board_mux, int flags); | ||
190 | |||
191 | /** | ||
174 | * omap3_mux_init() - initialize mux system with board specific set | 192 | * omap3_mux_init() - initialize mux system with board specific set |
175 | * @board_mux: Board specific mux table | 193 | * @board_mux: Board specific mux table |
176 | * @flags: OMAP package type used for the board | 194 | * @flags: OMAP package type used for the board |
diff --git a/arch/arm/mach-omap2/mux2420.c b/arch/arm/mach-omap2/mux2420.c new file mode 100644 index 000000000000..fdb04a7eb8aa --- /dev/null +++ b/arch/arm/mach-omap2/mux2420.c | |||
@@ -0,0 +1,688 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Nokia | ||
3 | * Copyright (C) 2010 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #include <linux/module.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | #include "mux.h" | ||
14 | |||
15 | #ifdef CONFIG_OMAP_MUX | ||
16 | |||
17 | #define _OMAP2420_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
18 | { \ | ||
19 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
20 | .gpio = (g), \ | ||
21 | .muxnames = { m0, m1, m2, m3, m4, m5, m6, m7 }, \ | ||
22 | } | ||
23 | |||
24 | #else | ||
25 | |||
26 | #define _OMAP2420_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
27 | { \ | ||
28 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
29 | .gpio = (g), \ | ||
30 | } | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define _OMAP2420_BALLENTRY(M0, bb, bt) \ | ||
35 | { \ | ||
36 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
37 | .balls = { bb, bt }, \ | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * Superset of all mux modes for omap2420 | ||
42 | */ | ||
43 | static struct omap_mux __initdata omap2420_muxmodes[] = { | ||
44 | _OMAP2420_MUXENTRY(CAM_D0, 54, | ||
45 | "cam_d0", "hw_dbg2", "sti_dout", "gpio_54", | ||
46 | NULL, NULL, "etk_d2", NULL), | ||
47 | _OMAP2420_MUXENTRY(CAM_D1, 53, | ||
48 | "cam_d1", "hw_dbg3", "sti_din", "gpio_53", | ||
49 | NULL, NULL, "etk_d3", NULL), | ||
50 | _OMAP2420_MUXENTRY(CAM_D2, 52, | ||
51 | "cam_d2", "hw_dbg4", "mcbsp1_clkx", "gpio_52", | ||
52 | NULL, NULL, "etk_d4", NULL), | ||
53 | _OMAP2420_MUXENTRY(CAM_D3, 51, | ||
54 | "cam_d3", "hw_dbg5", "mcbsp1_dr", "gpio_51", | ||
55 | NULL, NULL, "etk_d5", NULL), | ||
56 | _OMAP2420_MUXENTRY(CAM_D4, 50, | ||
57 | "cam_d4", "hw_dbg6", "mcbsp1_fsr", "gpio_50", | ||
58 | NULL, NULL, "etk_d6", NULL), | ||
59 | _OMAP2420_MUXENTRY(CAM_D5, 49, | ||
60 | "cam_d5", "hw_dbg7", "mcbsp1_clkr", "gpio_49", | ||
61 | NULL, NULL, "etk_d7", NULL), | ||
62 | _OMAP2420_MUXENTRY(CAM_D6, 0, | ||
63 | "cam_d6", "hw_dbg8", NULL, NULL, | ||
64 | NULL, NULL, "etk_d8", NULL), | ||
65 | _OMAP2420_MUXENTRY(CAM_D7, 0, | ||
66 | "cam_d7", "hw_dbg9", NULL, NULL, | ||
67 | NULL, NULL, "etk_d9", NULL), | ||
68 | _OMAP2420_MUXENTRY(CAM_D8, 54, | ||
69 | "cam_d8", "hw_dbg10", NULL, "gpio_54", | ||
70 | NULL, NULL, "etk_d10", NULL), | ||
71 | _OMAP2420_MUXENTRY(CAM_D9, 53, | ||
72 | "cam_d9", "hw_dbg11", NULL, "gpio_53", | ||
73 | NULL, NULL, "etk_d11", NULL), | ||
74 | _OMAP2420_MUXENTRY(CAM_HS, 55, | ||
75 | "cam_hs", "hw_dbg1", "mcbsp1_dx", "gpio_55", | ||
76 | NULL, NULL, "etk_d1", NULL), | ||
77 | _OMAP2420_MUXENTRY(CAM_LCLK, 57, | ||
78 | "cam_lclk", NULL, "mcbsp_clks", "gpio_57", | ||
79 | NULL, NULL, "etk_c1", NULL), | ||
80 | _OMAP2420_MUXENTRY(CAM_VS, 56, | ||
81 | "cam_vs", "hw_dbg0", "mcbsp1_fsx", "gpio_56", | ||
82 | NULL, NULL, "etk_d0", NULL), | ||
83 | _OMAP2420_MUXENTRY(CAM_XCLK, 0, | ||
84 | "cam_xclk", NULL, "sti_clk", NULL, | ||
85 | NULL, NULL, "etk_c2", NULL), | ||
86 | _OMAP2420_MUXENTRY(DSS_ACBIAS, 48, | ||
87 | "dss_acbias", NULL, "mcbsp2_fsx", "gpio_48", | ||
88 | NULL, NULL, NULL, NULL), | ||
89 | _OMAP2420_MUXENTRY(DSS_DATA10, 40, | ||
90 | "dss_data10", NULL, NULL, "gpio_40", | ||
91 | NULL, NULL, NULL, NULL), | ||
92 | _OMAP2420_MUXENTRY(DSS_DATA11, 41, | ||
93 | "dss_data11", NULL, NULL, "gpio_41", | ||
94 | NULL, NULL, NULL, NULL), | ||
95 | _OMAP2420_MUXENTRY(DSS_DATA12, 42, | ||
96 | "dss_data12", NULL, NULL, "gpio_42", | ||
97 | NULL, NULL, NULL, NULL), | ||
98 | _OMAP2420_MUXENTRY(DSS_DATA13, 43, | ||
99 | "dss_data13", NULL, NULL, "gpio_43", | ||
100 | NULL, NULL, NULL, NULL), | ||
101 | _OMAP2420_MUXENTRY(DSS_DATA14, 44, | ||
102 | "dss_data14", NULL, NULL, "gpio_44", | ||
103 | NULL, NULL, NULL, NULL), | ||
104 | _OMAP2420_MUXENTRY(DSS_DATA15, 45, | ||
105 | "dss_data15", NULL, NULL, "gpio_45", | ||
106 | NULL, NULL, NULL, NULL), | ||
107 | _OMAP2420_MUXENTRY(DSS_DATA16, 46, | ||
108 | "dss_data16", NULL, NULL, "gpio_46", | ||
109 | NULL, NULL, NULL, NULL), | ||
110 | _OMAP2420_MUXENTRY(DSS_DATA17, 47, | ||
111 | "dss_data17", NULL, NULL, "gpio_47", | ||
112 | NULL, NULL, NULL, NULL), | ||
113 | _OMAP2420_MUXENTRY(DSS_DATA8, 38, | ||
114 | "dss_data8", NULL, NULL, "gpio_38", | ||
115 | NULL, NULL, NULL, NULL), | ||
116 | _OMAP2420_MUXENTRY(DSS_DATA9, 39, | ||
117 | "dss_data9", NULL, NULL, "gpio_39", | ||
118 | NULL, NULL, NULL, NULL), | ||
119 | _OMAP2420_MUXENTRY(EAC_AC_DIN, 115, | ||
120 | "eac_ac_din", "mcbsp2_dr", NULL, "gpio_115", | ||
121 | NULL, NULL, NULL, NULL), | ||
122 | _OMAP2420_MUXENTRY(EAC_AC_DOUT, 116, | ||
123 | "eac_ac_dout", "mcbsp2_dx", NULL, "gpio_116", | ||
124 | NULL, NULL, NULL, NULL), | ||
125 | _OMAP2420_MUXENTRY(EAC_AC_FS, 114, | ||
126 | "eac_ac_fs", "mcbsp2_fsx", NULL, "gpio_114", | ||
127 | NULL, NULL, NULL, NULL), | ||
128 | _OMAP2420_MUXENTRY(EAC_AC_MCLK, 117, | ||
129 | "eac_ac_mclk", NULL, NULL, "gpio_117", | ||
130 | NULL, NULL, NULL, NULL), | ||
131 | _OMAP2420_MUXENTRY(EAC_AC_RST, 118, | ||
132 | "eac_ac_rst", "eac_bt_din", NULL, "gpio_118", | ||
133 | NULL, NULL, NULL, NULL), | ||
134 | _OMAP2420_MUXENTRY(EAC_AC_SCLK, 113, | ||
135 | "eac_ac_sclk", "mcbsp2_clkx", NULL, "gpio_113", | ||
136 | NULL, NULL, NULL, NULL), | ||
137 | _OMAP2420_MUXENTRY(EAC_BT_DIN, 73, | ||
138 | "eac_bt_din", NULL, NULL, "gpio_73", | ||
139 | NULL, NULL, "etk_d9", NULL), | ||
140 | _OMAP2420_MUXENTRY(EAC_BT_DOUT, 74, | ||
141 | "eac_bt_dout", NULL, "sti_clk", "gpio_74", | ||
142 | NULL, NULL, "etk_d8", NULL), | ||
143 | _OMAP2420_MUXENTRY(EAC_BT_FS, 72, | ||
144 | "eac_bt_fs", NULL, NULL, "gpio_72", | ||
145 | NULL, NULL, "etk_d10", NULL), | ||
146 | _OMAP2420_MUXENTRY(EAC_BT_SCLK, 71, | ||
147 | "eac_bt_sclk", NULL, NULL, "gpio_71", | ||
148 | NULL, NULL, "etk_d11", NULL), | ||
149 | _OMAP2420_MUXENTRY(GPIO_119, 119, | ||
150 | "gpio_119", NULL, "sti_din", "gpio_119", | ||
151 | NULL, "sys_boot0", "etk_d12", NULL), | ||
152 | _OMAP2420_MUXENTRY(GPIO_120, 120, | ||
153 | "gpio_120", NULL, "sti_dout", "gpio_120", | ||
154 | "cam_d9", "sys_boot1", "etk_d13", NULL), | ||
155 | _OMAP2420_MUXENTRY(GPIO_121, 121, | ||
156 | "gpio_121", NULL, NULL, "gpio_121", | ||
157 | "jtag_emu2", "sys_boot2", "etk_d14", NULL), | ||
158 | _OMAP2420_MUXENTRY(GPIO_122, 122, | ||
159 | "gpio_122", NULL, NULL, "gpio_122", | ||
160 | "jtag_emu3", "sys_boot3", "etk_d15", NULL), | ||
161 | _OMAP2420_MUXENTRY(GPIO_124, 124, | ||
162 | "gpio_124", NULL, NULL, "gpio_124", | ||
163 | NULL, "sys_boot5", NULL, NULL), | ||
164 | _OMAP2420_MUXENTRY(GPIO_125, 125, | ||
165 | "gpio_125", "sys_jtagsel1", "sys_jtagsel2", "gpio_125", | ||
166 | NULL, NULL, NULL, NULL), | ||
167 | _OMAP2420_MUXENTRY(GPIO_36, 36, | ||
168 | "gpio_36", NULL, NULL, "gpio_36", | ||
169 | NULL, "sys_boot4", NULL, NULL), | ||
170 | _OMAP2420_MUXENTRY(GPIO_62, 62, | ||
171 | "gpio_62", "uart1_rx", "usb1_dat", "gpio_62", | ||
172 | NULL, NULL, NULL, NULL), | ||
173 | _OMAP2420_MUXENTRY(GPIO_6, 6, | ||
174 | "gpio_6", "tv_detpulse", NULL, "gpio_6", | ||
175 | NULL, NULL, NULL, NULL), | ||
176 | _OMAP2420_MUXENTRY(GPMC_A10, 3, | ||
177 | "gpmc_a10", NULL, "sys_ndmareq5", "gpio_3", | ||
178 | NULL, NULL, NULL, NULL), | ||
179 | _OMAP2420_MUXENTRY(GPMC_A1, 12, | ||
180 | "gpmc_a1", "dss_data18", NULL, "gpio_12", | ||
181 | NULL, NULL, NULL, NULL), | ||
182 | _OMAP2420_MUXENTRY(GPMC_A2, 11, | ||
183 | "gpmc_a2", "dss_data19", NULL, "gpio_11", | ||
184 | NULL, NULL, NULL, NULL), | ||
185 | _OMAP2420_MUXENTRY(GPMC_A3, 10, | ||
186 | "gpmc_a3", "dss_data20", NULL, "gpio_10", | ||
187 | NULL, NULL, NULL, NULL), | ||
188 | _OMAP2420_MUXENTRY(GPMC_A4, 9, | ||
189 | "gpmc_a4", "dss_data21", NULL, "gpio_9", | ||
190 | NULL, NULL, NULL, NULL), | ||
191 | _OMAP2420_MUXENTRY(GPMC_A5, 8, | ||
192 | "gpmc_a5", "dss_data22", NULL, "gpio_8", | ||
193 | NULL, NULL, NULL, NULL), | ||
194 | _OMAP2420_MUXENTRY(GPMC_A6, 7, | ||
195 | "gpmc_a6", "dss_data23", NULL, "gpio_7", | ||
196 | NULL, NULL, NULL, NULL), | ||
197 | _OMAP2420_MUXENTRY(GPMC_A7, 6, | ||
198 | "gpmc_a7", NULL, "sys_ndmareq2", "gpio_6", | ||
199 | NULL, NULL, NULL, NULL), | ||
200 | _OMAP2420_MUXENTRY(GPMC_A8, 5, | ||
201 | "gpmc_a8", NULL, "sys_ndmareq3", "gpio_5", | ||
202 | NULL, NULL, NULL, NULL), | ||
203 | _OMAP2420_MUXENTRY(GPMC_A9, 4, | ||
204 | "gpmc_a9", NULL, "sys_ndmareq4", "gpio_4", | ||
205 | NULL, NULL, NULL, NULL), | ||
206 | _OMAP2420_MUXENTRY(GPMC_CLK, 21, | ||
207 | "gpmc_clk", NULL, NULL, "gpio_21", | ||
208 | NULL, NULL, NULL, NULL), | ||
209 | _OMAP2420_MUXENTRY(GPMC_D10, 18, | ||
210 | "gpmc_d10", "ssi2_rdy_rx", NULL, "gpio_18", | ||
211 | NULL, NULL, NULL, NULL), | ||
212 | _OMAP2420_MUXENTRY(GPMC_D11, 17, | ||
213 | "gpmc_d11", "ssi2_flag_rx", NULL, "gpio_17", | ||
214 | NULL, NULL, NULL, NULL), | ||
215 | _OMAP2420_MUXENTRY(GPMC_D12, 16, | ||
216 | "gpmc_d12", "ssi2_dat_rx", NULL, "gpio_16", | ||
217 | NULL, NULL, NULL, NULL), | ||
218 | _OMAP2420_MUXENTRY(GPMC_D13, 15, | ||
219 | "gpmc_d13", "ssi2_rdy_tx", NULL, "gpio_15", | ||
220 | NULL, NULL, NULL, NULL), | ||
221 | _OMAP2420_MUXENTRY(GPMC_D14, 14, | ||
222 | "gpmc_d14", "ssi2_flag_tx", NULL, "gpio_14", | ||
223 | NULL, NULL, NULL, NULL), | ||
224 | _OMAP2420_MUXENTRY(GPMC_D15, 13, | ||
225 | "gpmc_d15", "ssi2_dat_tx", NULL, "gpio_13", | ||
226 | NULL, NULL, NULL, NULL), | ||
227 | _OMAP2420_MUXENTRY(GPMC_D8, 20, | ||
228 | "gpmc_d8", NULL, NULL, "gpio_20", | ||
229 | NULL, NULL, NULL, NULL), | ||
230 | _OMAP2420_MUXENTRY(GPMC_D9, 19, | ||
231 | "gpmc_d9", "ssi2_wake", NULL, "gpio_19", | ||
232 | NULL, NULL, NULL, NULL), | ||
233 | _OMAP2420_MUXENTRY(GPMC_NBE0, 29, | ||
234 | "gpmc_nbe0", NULL, NULL, "gpio_29", | ||
235 | NULL, NULL, NULL, NULL), | ||
236 | _OMAP2420_MUXENTRY(GPMC_NBE1, 30, | ||
237 | "gpmc_nbe1", NULL, NULL, "gpio_30", | ||
238 | NULL, NULL, NULL, NULL), | ||
239 | _OMAP2420_MUXENTRY(GPMC_NCS1, 22, | ||
240 | "gpmc_ncs1", NULL, NULL, "gpio_22", | ||
241 | NULL, NULL, NULL, NULL), | ||
242 | _OMAP2420_MUXENTRY(GPMC_NCS2, 23, | ||
243 | "gpmc_ncs2", NULL, NULL, "gpio_23", | ||
244 | NULL, NULL, NULL, NULL), | ||
245 | _OMAP2420_MUXENTRY(GPMC_NCS3, 24, | ||
246 | "gpmc_ncs3", "gpmc_io_dir", NULL, "gpio_24", | ||
247 | NULL, NULL, NULL, NULL), | ||
248 | _OMAP2420_MUXENTRY(GPMC_NCS4, 25, | ||
249 | "gpmc_ncs4", NULL, NULL, "gpio_25", | ||
250 | NULL, NULL, NULL, NULL), | ||
251 | _OMAP2420_MUXENTRY(GPMC_NCS5, 26, | ||
252 | "gpmc_ncs5", NULL, NULL, "gpio_26", | ||
253 | NULL, NULL, NULL, NULL), | ||
254 | _OMAP2420_MUXENTRY(GPMC_NCS6, 27, | ||
255 | "gpmc_ncs6", NULL, NULL, "gpio_27", | ||
256 | NULL, NULL, NULL, NULL), | ||
257 | _OMAP2420_MUXENTRY(GPMC_NCS7, 28, | ||
258 | "gpmc_ncs7", "gpmc_io_dir", "gpio_28", NULL, | ||
259 | NULL, NULL, NULL, NULL), | ||
260 | _OMAP2420_MUXENTRY(GPMC_NWP, 31, | ||
261 | "gpmc_nwp", NULL, NULL, "gpio_31", | ||
262 | NULL, NULL, NULL, NULL), | ||
263 | _OMAP2420_MUXENTRY(GPMC_WAIT1, 33, | ||
264 | "gpmc_wait1", NULL, NULL, "gpio_33", | ||
265 | NULL, NULL, NULL, NULL), | ||
266 | _OMAP2420_MUXENTRY(GPMC_WAIT2, 34, | ||
267 | "gpmc_wait2", NULL, NULL, "gpio_34", | ||
268 | NULL, NULL, NULL, NULL), | ||
269 | _OMAP2420_MUXENTRY(GPMC_WAIT3, 35, | ||
270 | "gpmc_wait3", NULL, NULL, "gpio_35", | ||
271 | NULL, NULL, NULL, NULL), | ||
272 | _OMAP2420_MUXENTRY(HDQ_SIO, 101, | ||
273 | "hdq_sio", "usb2_tllse0", "sys_altclk", "gpio_101", | ||
274 | NULL, NULL, NULL, NULL), | ||
275 | _OMAP2420_MUXENTRY(I2C2_SCL, 99, | ||
276 | "i2c2_scl", NULL, "gpt9_pwm_evt", "gpio_99", | ||
277 | NULL, NULL, NULL, NULL), | ||
278 | _OMAP2420_MUXENTRY(I2C2_SDA, 100, | ||
279 | "i2c2_sda", NULL, "spi2_ncs1", "gpio_100", | ||
280 | NULL, NULL, NULL, NULL), | ||
281 | _OMAP2420_MUXENTRY(JTAG_EMU0, 127, | ||
282 | "jtag_emu0", NULL, NULL, "gpio_127", | ||
283 | NULL, NULL, NULL, NULL), | ||
284 | _OMAP2420_MUXENTRY(JTAG_EMU1, 126, | ||
285 | "jtag_emu1", NULL, NULL, "gpio_126", | ||
286 | NULL, NULL, NULL, NULL), | ||
287 | _OMAP2420_MUXENTRY(MCBSP1_CLKR, 92, | ||
288 | "mcbsp1_clkr", "ssi2_dat_tx", "vlynq_tx1", "gpio_92", | ||
289 | NULL, NULL, NULL, NULL), | ||
290 | _OMAP2420_MUXENTRY(MCBSP1_CLKX, 98, | ||
291 | "mcbsp1_clkx", "ssi2_wake", "vlynq_nla", "gpio_98", | ||
292 | NULL, NULL, NULL, NULL), | ||
293 | _OMAP2420_MUXENTRY(MCBSP1_DR, 95, | ||
294 | "mcbsp1_dr", "ssi2_dat_rx", "vlynq_rx1", "gpio_95", | ||
295 | NULL, NULL, NULL, NULL), | ||
296 | _OMAP2420_MUXENTRY(MCBSP1_DX, 94, | ||
297 | "mcbsp1_dx", "ssi2_rdy_tx", "vlynq_clk", "gpio_94", | ||
298 | NULL, NULL, NULL, NULL), | ||
299 | _OMAP2420_MUXENTRY(MCBSP1_FSR, 93, | ||
300 | "mcbsp1_fsr", "ssi2_flag_tx", "vlynq_tx0", "gpio_93", | ||
301 | "spi2_ncs1", NULL, NULL, NULL), | ||
302 | _OMAP2420_MUXENTRY(MCBSP1_FSX, 97, | ||
303 | "mcbsp1_fsx", "ssi2_rdy_rx", NULL, "gpio_97", | ||
304 | NULL, NULL, NULL, NULL), | ||
305 | _OMAP2420_MUXENTRY(MCBSP2_CLKX, 12, | ||
306 | "mcbsp2_clkx", NULL, "dss_data23", "gpio_12", | ||
307 | NULL, NULL, NULL, NULL), | ||
308 | _OMAP2420_MUXENTRY(MCBSP2_DR, 11, | ||
309 | "mcbsp2_dr", NULL, "dss_data22", "gpio_11", | ||
310 | NULL, NULL, NULL, NULL), | ||
311 | _OMAP2420_MUXENTRY(MCBSP_CLKS, 96, | ||
312 | "mcbsp_clks", "ssi2_flag_rx", "vlynq_rx0", "gpio_96", | ||
313 | NULL, NULL, NULL, NULL), | ||
314 | _OMAP2420_MUXENTRY(MMC_CLKI, 59, | ||
315 | "sdmmc_clki", "ms_clki", NULL, "gpio_59", | ||
316 | NULL, NULL, NULL, NULL), | ||
317 | _OMAP2420_MUXENTRY(MMC_CLKO, 0, | ||
318 | "sdmmc_clko", "ms_clko", NULL, NULL, | ||
319 | NULL, NULL, NULL, NULL), | ||
320 | _OMAP2420_MUXENTRY(MMC_CMD_DIR, 8, | ||
321 | "sdmmc_cmd_dir", NULL, NULL, "gpio_8", | ||
322 | NULL, NULL, NULL, NULL), | ||
323 | _OMAP2420_MUXENTRY(MMC_CMD, 0, | ||
324 | "sdmmc_cmd", "ms_bs", NULL, NULL, | ||
325 | NULL, NULL, NULL, NULL), | ||
326 | _OMAP2420_MUXENTRY(MMC_DAT_DIR0, 7, | ||
327 | "sdmmc_dat_dir0", "ms_dat0_dir", NULL, "gpio_7", | ||
328 | NULL, NULL, NULL, NULL), | ||
329 | _OMAP2420_MUXENTRY(MMC_DAT0, 0, | ||
330 | "sdmmc_dat0", "ms_dat0", NULL, NULL, | ||
331 | NULL, NULL, NULL, NULL), | ||
332 | _OMAP2420_MUXENTRY(MMC_DAT_DIR1, 78, | ||
333 | "sdmmc_dat_dir1", "ms_datu_dir", "uart2_rts", "gpio_78", | ||
334 | NULL, NULL, NULL, NULL), | ||
335 | _OMAP2420_MUXENTRY(MMC_DAT1, 75, | ||
336 | "sdmmc_dat1", "ms_dat1", NULL, "gpio_75", | ||
337 | NULL, NULL, NULL, NULL), | ||
338 | _OMAP2420_MUXENTRY(MMC_DAT_DIR2, 79, | ||
339 | "sdmmc_dat_dir2", "ms_datu_dir", "uart2_tx", "gpio_79", | ||
340 | NULL, NULL, NULL, NULL), | ||
341 | _OMAP2420_MUXENTRY(MMC_DAT2, 76, | ||
342 | "sdmmc_dat2", "ms_dat2", "uart2_cts", "gpio_76", | ||
343 | NULL, NULL, NULL, NULL), | ||
344 | _OMAP2420_MUXENTRY(MMC_DAT_DIR3, 80, | ||
345 | "sdmmc_dat_dir3", "ms_datu_dir", "uart2_rx", "gpio_80", | ||
346 | NULL, NULL, NULL, NULL), | ||
347 | _OMAP2420_MUXENTRY(MMC_DAT3, 77, | ||
348 | "sdmmc_dat3", "ms_dat3", NULL, "gpio_77", | ||
349 | NULL, NULL, NULL, NULL), | ||
350 | _OMAP2420_MUXENTRY(SDRC_A12, 2, | ||
351 | "sdrc_a12", NULL, NULL, "gpio_2", | ||
352 | NULL, NULL, NULL, NULL), | ||
353 | _OMAP2420_MUXENTRY(SDRC_A13, 1, | ||
354 | "sdrc_a13", NULL, NULL, "gpio_1", | ||
355 | NULL, NULL, NULL, NULL), | ||
356 | _OMAP2420_MUXENTRY(SDRC_A14, 0, | ||
357 | "sdrc_a14", NULL, NULL, "gpio_0", | ||
358 | NULL, NULL, NULL, NULL), | ||
359 | _OMAP2420_MUXENTRY(SDRC_CKE1, 38, | ||
360 | "sdrc_cke1", NULL, NULL, "gpio_38", | ||
361 | NULL, NULL, NULL, NULL), | ||
362 | _OMAP2420_MUXENTRY(SDRC_NCS1, 37, | ||
363 | "sdrc_ncs1", NULL, NULL, "gpio_37", | ||
364 | NULL, NULL, NULL, NULL), | ||
365 | _OMAP2420_MUXENTRY(SPI1_CLK, 81, | ||
366 | "spi1_clk", NULL, NULL, "gpio_81", | ||
367 | NULL, NULL, NULL, NULL), | ||
368 | _OMAP2420_MUXENTRY(SPI1_NCS0, 84, | ||
369 | "spi1_ncs0", NULL, NULL, "gpio_84", | ||
370 | NULL, NULL, NULL, NULL), | ||
371 | _OMAP2420_MUXENTRY(SPI1_NCS1, 85, | ||
372 | "spi1_ncs1", NULL, NULL, "gpio_85", | ||
373 | NULL, NULL, NULL, NULL), | ||
374 | _OMAP2420_MUXENTRY(SPI1_NCS2, 86, | ||
375 | "spi1_ncs2", NULL, NULL, "gpio_86", | ||
376 | NULL, NULL, NULL, NULL), | ||
377 | _OMAP2420_MUXENTRY(SPI1_NCS3, 87, | ||
378 | "spi1_ncs3", NULL, NULL, "gpio_87", | ||
379 | NULL, NULL, NULL, NULL), | ||
380 | _OMAP2420_MUXENTRY(SPI1_SIMO, 82, | ||
381 | "spi1_simo", NULL, NULL, "gpio_82", | ||
382 | NULL, NULL, NULL, NULL), | ||
383 | _OMAP2420_MUXENTRY(SPI1_SOMI, 83, | ||
384 | "spi1_somi", NULL, NULL, "gpio_83", | ||
385 | NULL, NULL, NULL, NULL), | ||
386 | _OMAP2420_MUXENTRY(SPI2_CLK, 88, | ||
387 | "spi2_clk", NULL, NULL, "gpio_88", | ||
388 | NULL, NULL, NULL, NULL), | ||
389 | _OMAP2420_MUXENTRY(SPI2_NCS0, 91, | ||
390 | "spi2_ncs0", "gpt12_pwm_evt", NULL, "gpio_91", | ||
391 | NULL, NULL, NULL, NULL), | ||
392 | _OMAP2420_MUXENTRY(SPI2_SIMO, 89, | ||
393 | "spi2_simo", "gpt10_pwm_evt", NULL, "gpio_89", | ||
394 | NULL, NULL, NULL, NULL), | ||
395 | _OMAP2420_MUXENTRY(SPI2_SOMI, 90, | ||
396 | "spi2_somi", "gpt11_pwm_evt", NULL, "gpio_90", | ||
397 | NULL, NULL, NULL, NULL), | ||
398 | _OMAP2420_MUXENTRY(SSI1_DAT_RX, 63, | ||
399 | "ssi1_dat_rx", "eac_md_sclk", NULL, "gpio_63", | ||
400 | NULL, NULL, NULL, NULL), | ||
401 | _OMAP2420_MUXENTRY(SSI1_DAT_TX, 59, | ||
402 | "ssi1_dat_tx", "uart1_tx", "usb1_se0", "gpio_59", | ||
403 | NULL, NULL, NULL, NULL), | ||
404 | _OMAP2420_MUXENTRY(SSI1_FLAG_RX, 64, | ||
405 | "ssi1_flag_rx", "eac_md_din", NULL, "gpio_64", | ||
406 | NULL, NULL, NULL, NULL), | ||
407 | _OMAP2420_MUXENTRY(SSI1_FLAG_TX, 25, | ||
408 | "ssi1_flag_tx", "uart1_rts", "usb1_rcv", "gpio_25", | ||
409 | NULL, NULL, NULL, NULL), | ||
410 | _OMAP2420_MUXENTRY(SSI1_RDY_RX, 65, | ||
411 | "ssi1_rdy_rx", "eac_md_dout", NULL, "gpio_65", | ||
412 | NULL, NULL, NULL, NULL), | ||
413 | _OMAP2420_MUXENTRY(SSI1_RDY_TX, 61, | ||
414 | "ssi1_rdy_tx", "uart1_cts", "usb1_txen", "gpio_61", | ||
415 | NULL, NULL, NULL, NULL), | ||
416 | _OMAP2420_MUXENTRY(SSI1_WAKE, 66, | ||
417 | "ssi1_wake", "eac_md_fs", NULL, "gpio_66", | ||
418 | NULL, NULL, NULL, NULL), | ||
419 | _OMAP2420_MUXENTRY(SYS_CLKOUT, 123, | ||
420 | "sys_clkout", NULL, NULL, "gpio_123", | ||
421 | NULL, NULL, NULL, NULL), | ||
422 | _OMAP2420_MUXENTRY(SYS_CLKREQ, 52, | ||
423 | "sys_clkreq", NULL, NULL, "gpio_52", | ||
424 | NULL, NULL, NULL, NULL), | ||
425 | _OMAP2420_MUXENTRY(SYS_NIRQ, 60, | ||
426 | "sys_nirq", NULL, NULL, "gpio_60", | ||
427 | NULL, NULL, NULL, NULL), | ||
428 | _OMAP2420_MUXENTRY(UART1_CTS, 32, | ||
429 | "uart1_cts", NULL, "dss_data18", "gpio_32", | ||
430 | NULL, NULL, NULL, NULL), | ||
431 | _OMAP2420_MUXENTRY(UART1_RTS, 8, | ||
432 | "uart1_rts", NULL, "dss_data19", "gpio_8", | ||
433 | NULL, NULL, NULL, NULL), | ||
434 | _OMAP2420_MUXENTRY(UART1_RX, 10, | ||
435 | "uart1_rx", NULL, "dss_data21", "gpio_10", | ||
436 | NULL, NULL, NULL, NULL), | ||
437 | _OMAP2420_MUXENTRY(UART1_TX, 9, | ||
438 | "uart1_tx", NULL, "dss_data20", "gpio_9", | ||
439 | NULL, NULL, NULL, NULL), | ||
440 | _OMAP2420_MUXENTRY(UART2_CTS, 67, | ||
441 | "uart2_cts", "usb1_rcv", "gpt9_pwm_evt", "gpio_67", | ||
442 | NULL, NULL, NULL, NULL), | ||
443 | _OMAP2420_MUXENTRY(UART2_RTS, 68, | ||
444 | "uart2_rts", "usb1_txen", "gpt10_pwm_evt", "gpio_68", | ||
445 | NULL, NULL, NULL, NULL), | ||
446 | _OMAP2420_MUXENTRY(UART2_RX, 70, | ||
447 | "uart2_rx", "usb1_dat", "gpt12_pwm_evt", "gpio_70", | ||
448 | NULL, NULL, NULL, NULL), | ||
449 | _OMAP2420_MUXENTRY(UART2_TX, 69, | ||
450 | "uart2_tx", "usb1_se0", "gpt11_pwm_evt", "gpio_69", | ||
451 | NULL, NULL, NULL, NULL), | ||
452 | _OMAP2420_MUXENTRY(UART3_CTS_RCTX, 102, | ||
453 | "uart3_cts_rctx", "uart3_rx_irrx", NULL, "gpio_102", | ||
454 | NULL, NULL, NULL, NULL), | ||
455 | _OMAP2420_MUXENTRY(UART3_RTS_SD, 103, | ||
456 | "uart3_rts_sd", "uart3_tx_irtx", NULL, "gpio_103", | ||
457 | NULL, NULL, NULL, NULL), | ||
458 | _OMAP2420_MUXENTRY(UART3_RX_IRRX, 105, | ||
459 | "uart3_rx_irrx", NULL, NULL, "gpio_105", | ||
460 | NULL, NULL, NULL, NULL), | ||
461 | _OMAP2420_MUXENTRY(UART3_TX_IRTX, 104, | ||
462 | "uart3_tx_irtx", "uart3_cts_rctx", NULL, "gpio_104", | ||
463 | NULL, NULL, NULL, NULL), | ||
464 | _OMAP2420_MUXENTRY(USB0_DAT, 112, | ||
465 | "usb0_dat", "uart3_rx_irrx", "uart2_rx", "gpio_112", | ||
466 | "uart2_tx", NULL, NULL, NULL), | ||
467 | _OMAP2420_MUXENTRY(USB0_PUEN, 106, | ||
468 | "usb0_puen", "mcbsp2_dx", NULL, "gpio_106", | ||
469 | NULL, NULL, NULL, NULL), | ||
470 | _OMAP2420_MUXENTRY(USB0_RCV, 109, | ||
471 | "usb0_rcv", "mcbsp2_fsx", NULL, "gpio_109", | ||
472 | "uart2_cts", NULL, NULL, NULL), | ||
473 | _OMAP2420_MUXENTRY(USB0_SE0, 111, | ||
474 | "usb0_se0", "uart3_tx_irtx", "uart2_tx", "gpio_111", | ||
475 | "uart2_rx", NULL, NULL, NULL), | ||
476 | _OMAP2420_MUXENTRY(USB0_TXEN, 110, | ||
477 | "usb0_txen", "uart3_cts_rctx", "uart2_cts", "gpio_110", | ||
478 | NULL, NULL, NULL, NULL), | ||
479 | _OMAP2420_MUXENTRY(USB0_VM, 108, | ||
480 | "usb0_vm", "mcbsp2_clkx", NULL, "gpio_108", | ||
481 | "uart2_rx", NULL, NULL, NULL), | ||
482 | _OMAP2420_MUXENTRY(USB0_VP, 107, | ||
483 | "usb0_vp", "mcbsp2_dr", NULL, "gpio_107", | ||
484 | NULL, NULL, NULL, NULL), | ||
485 | _OMAP2420_MUXENTRY(VLYNQ_CLK, 13, | ||
486 | "vlynq_clk", "usb2_se0", "sys_ndmareq0", "gpio_13", | ||
487 | NULL, NULL, NULL, NULL), | ||
488 | _OMAP2420_MUXENTRY(VLYNQ_NLA, 58, | ||
489 | "vlynq_nla", NULL, NULL, "gpio_58", | ||
490 | "cam_d6", NULL, NULL, NULL), | ||
491 | _OMAP2420_MUXENTRY(VLYNQ_RX0, 15, | ||
492 | "vlynq_rx0", "usb2_tllse0", NULL, "gpio_15", | ||
493 | "cam_d7", NULL, NULL, NULL), | ||
494 | _OMAP2420_MUXENTRY(VLYNQ_RX1, 14, | ||
495 | "vlynq_rx1", "usb2_rcv", "sys_ndmareq1", "gpio_14", | ||
496 | "cam_d8", NULL, NULL, NULL), | ||
497 | _OMAP2420_MUXENTRY(VLYNQ_TX0, 17, | ||
498 | "vlynq_tx0", "usb2_txen", NULL, "gpio_17", | ||
499 | NULL, NULL, NULL, NULL), | ||
500 | _OMAP2420_MUXENTRY(VLYNQ_TX1, 16, | ||
501 | "vlynq_tx1", "usb2_dat", "sys_clkout2", "gpio_16", | ||
502 | NULL, NULL, NULL, NULL), | ||
503 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
504 | }; | ||
505 | |||
506 | /* | ||
507 | * Balls for 447-pin POP package | ||
508 | */ | ||
509 | #ifdef CONFIG_DEBUG_FS | ||
510 | struct omap_ball __initdata omap2420_pop_ball[] = { | ||
511 | _OMAP2420_BALLENTRY(CAM_D0, "y4", NULL), | ||
512 | _OMAP2420_BALLENTRY(CAM_D1, "y3", NULL), | ||
513 | _OMAP2420_BALLENTRY(CAM_D2, "u7", NULL), | ||
514 | _OMAP2420_BALLENTRY(CAM_D3, "ab3", NULL), | ||
515 | _OMAP2420_BALLENTRY(CAM_D4, "v2", NULL), | ||
516 | _OMAP2420_BALLENTRY(CAM_D5, "ad3", NULL), | ||
517 | _OMAP2420_BALLENTRY(CAM_D6, "aa4", NULL), | ||
518 | _OMAP2420_BALLENTRY(CAM_D7, "ab4", NULL), | ||
519 | _OMAP2420_BALLENTRY(CAM_D8, "ac6", NULL), | ||
520 | _OMAP2420_BALLENTRY(CAM_D9, "ac7", NULL), | ||
521 | _OMAP2420_BALLENTRY(CAM_HS, "v4", NULL), | ||
522 | _OMAP2420_BALLENTRY(CAM_LCLK, "ad6", NULL), | ||
523 | _OMAP2420_BALLENTRY(CAM_VS, "p7", NULL), | ||
524 | _OMAP2420_BALLENTRY(CAM_XCLK, "w4", NULL), | ||
525 | _OMAP2420_BALLENTRY(DSS_ACBIAS, "ae8", NULL), | ||
526 | _OMAP2420_BALLENTRY(DSS_DATA10, "ac12", NULL), | ||
527 | _OMAP2420_BALLENTRY(DSS_DATA11, "ae11", NULL), | ||
528 | _OMAP2420_BALLENTRY(DSS_DATA12, "ae13", NULL), | ||
529 | _OMAP2420_BALLENTRY(DSS_DATA13, "ad13", NULL), | ||
530 | _OMAP2420_BALLENTRY(DSS_DATA14, "ac13", NULL), | ||
531 | _OMAP2420_BALLENTRY(DSS_DATA15, "y12", NULL), | ||
532 | _OMAP2420_BALLENTRY(DSS_DATA16, "ad14", NULL), | ||
533 | _OMAP2420_BALLENTRY(DSS_DATA17, "y13", NULL), | ||
534 | _OMAP2420_BALLENTRY(DSS_DATA8, "ad11", NULL), | ||
535 | _OMAP2420_BALLENTRY(DSS_DATA9, "ad12", NULL), | ||
536 | _OMAP2420_BALLENTRY(EAC_AC_DIN, "ad19", NULL), | ||
537 | _OMAP2420_BALLENTRY(EAC_AC_DOUT, "af22", NULL), | ||
538 | _OMAP2420_BALLENTRY(EAC_AC_FS, "ad16", NULL), | ||
539 | _OMAP2420_BALLENTRY(EAC_AC_MCLK, "y17", NULL), | ||
540 | _OMAP2420_BALLENTRY(EAC_AC_RST, "ae22", NULL), | ||
541 | _OMAP2420_BALLENTRY(EAC_AC_SCLK, "ac18", NULL), | ||
542 | _OMAP2420_BALLENTRY(EAC_BT_DIN, "u8", NULL), | ||
543 | _OMAP2420_BALLENTRY(EAC_BT_DOUT, "ad5", NULL), | ||
544 | _OMAP2420_BALLENTRY(EAC_BT_FS, "w7", NULL), | ||
545 | _OMAP2420_BALLENTRY(EAC_BT_SCLK, "ad4", NULL), | ||
546 | _OMAP2420_BALLENTRY(GPIO_119, "af6", NULL), | ||
547 | _OMAP2420_BALLENTRY(GPIO_120, "af4", NULL), | ||
548 | _OMAP2420_BALLENTRY(GPIO_121, "ae6", NULL), | ||
549 | _OMAP2420_BALLENTRY(GPIO_122, "w3", NULL), | ||
550 | _OMAP2420_BALLENTRY(GPIO_124, "y19", NULL), | ||
551 | _OMAP2420_BALLENTRY(GPIO_125, "ae24", NULL), | ||
552 | _OMAP2420_BALLENTRY(GPIO_36, "y18", NULL), | ||
553 | _OMAP2420_BALLENTRY(GPIO_6, "d6", NULL), | ||
554 | _OMAP2420_BALLENTRY(GPIO_62, "ad18", NULL), | ||
555 | _OMAP2420_BALLENTRY(GPMC_A1, "m8", NULL), | ||
556 | _OMAP2420_BALLENTRY(GPMC_A10, "d5", NULL), | ||
557 | _OMAP2420_BALLENTRY(GPMC_A2, "w9", NULL), | ||
558 | _OMAP2420_BALLENTRY(GPMC_A3, "af10", NULL), | ||
559 | _OMAP2420_BALLENTRY(GPMC_A4, "w8", NULL), | ||
560 | _OMAP2420_BALLENTRY(GPMC_A5, "ae16", NULL), | ||
561 | _OMAP2420_BALLENTRY(GPMC_A6, "af9", NULL), | ||
562 | _OMAP2420_BALLENTRY(GPMC_A7, "e4", NULL), | ||
563 | _OMAP2420_BALLENTRY(GPMC_A8, "j7", NULL), | ||
564 | _OMAP2420_BALLENTRY(GPMC_A9, "ae18", NULL), | ||
565 | _OMAP2420_BALLENTRY(GPMC_CLK, "p1", "l1"), | ||
566 | _OMAP2420_BALLENTRY(GPMC_D10, "t1", "n1"), | ||
567 | _OMAP2420_BALLENTRY(GPMC_D11, "u2", "p2"), | ||
568 | _OMAP2420_BALLENTRY(GPMC_D12, "u1", "p1"), | ||
569 | _OMAP2420_BALLENTRY(GPMC_D13, "p2", "m1"), | ||
570 | _OMAP2420_BALLENTRY(GPMC_D14, "h2", "j2"), | ||
571 | _OMAP2420_BALLENTRY(GPMC_D15, "h1", "k2"), | ||
572 | _OMAP2420_BALLENTRY(GPMC_D8, "v1", "r1"), | ||
573 | _OMAP2420_BALLENTRY(GPMC_D9, "y1", "t1"), | ||
574 | _OMAP2420_BALLENTRY(GPMC_NBE0, "af12", "aa10"), | ||
575 | _OMAP2420_BALLENTRY(GPMC_NBE1, "u3", NULL), | ||
576 | _OMAP2420_BALLENTRY(GPMC_NCS1, "af14", "w1"), | ||
577 | _OMAP2420_BALLENTRY(GPMC_NCS2, "g4", NULL), | ||
578 | _OMAP2420_BALLENTRY(GPMC_NCS3, "t8", NULL), | ||
579 | _OMAP2420_BALLENTRY(GPMC_NCS4, "h8", NULL), | ||
580 | _OMAP2420_BALLENTRY(GPMC_NCS5, "k3", NULL), | ||
581 | _OMAP2420_BALLENTRY(GPMC_NCS6, "m7", NULL), | ||
582 | _OMAP2420_BALLENTRY(GPMC_NCS7, "p3", NULL), | ||
583 | _OMAP2420_BALLENTRY(GPMC_NWP, "ae15", "y5"), | ||
584 | _OMAP2420_BALLENTRY(GPMC_WAIT1, "ae20", "y8"), | ||
585 | _OMAP2420_BALLENTRY(GPMC_WAIT2, "n2", NULL), | ||
586 | _OMAP2420_BALLENTRY(GPMC_WAIT3, "t4", NULL), | ||
587 | _OMAP2420_BALLENTRY(HDQ_SIO, "t23", NULL), | ||
588 | _OMAP2420_BALLENTRY(I2C2_SCL, "l2", NULL), | ||
589 | _OMAP2420_BALLENTRY(I2C2_SDA, "k19", NULL), | ||
590 | _OMAP2420_BALLENTRY(JTAG_EMU0, "n24", NULL), | ||
591 | _OMAP2420_BALLENTRY(JTAG_EMU1, "ac22", NULL), | ||
592 | _OMAP2420_BALLENTRY(MCBSP1_CLKR, "y24", NULL), | ||
593 | _OMAP2420_BALLENTRY(MCBSP1_CLKX, "t19", NULL), | ||
594 | _OMAP2420_BALLENTRY(MCBSP1_DR, "u23", NULL), | ||
595 | _OMAP2420_BALLENTRY(MCBSP1_DX, "r24", NULL), | ||
596 | _OMAP2420_BALLENTRY(MCBSP1_FSR, "r20", NULL), | ||
597 | _OMAP2420_BALLENTRY(MCBSP1_FSX, "r23", NULL), | ||
598 | _OMAP2420_BALLENTRY(MCBSP2_CLKX, "t24", NULL), | ||
599 | _OMAP2420_BALLENTRY(MCBSP2_DR, "p20", NULL), | ||
600 | _OMAP2420_BALLENTRY(MCBSP_CLKS, "p23", NULL), | ||
601 | _OMAP2420_BALLENTRY(MMC_CLKI, "c23", NULL), | ||
602 | _OMAP2420_BALLENTRY(MMC_CLKO, "h23", NULL), | ||
603 | _OMAP2420_BALLENTRY(MMC_CMD, "j23", NULL), | ||
604 | _OMAP2420_BALLENTRY(MMC_CMD_DIR, "j24", NULL), | ||
605 | _OMAP2420_BALLENTRY(MMC_DAT0, "h17", NULL), | ||
606 | _OMAP2420_BALLENTRY(MMC_DAT_DIR0, "f23", NULL), | ||
607 | _OMAP2420_BALLENTRY(MMC_DAT1, "g19", NULL), | ||
608 | _OMAP2420_BALLENTRY(MMC_DAT_DIR1, "d23", NULL), | ||
609 | _OMAP2420_BALLENTRY(MMC_DAT2, "h20", NULL), | ||
610 | _OMAP2420_BALLENTRY(MMC_DAT_DIR2, "g23", NULL), | ||
611 | _OMAP2420_BALLENTRY(MMC_DAT3, "d24", NULL), | ||
612 | _OMAP2420_BALLENTRY(MMC_DAT_DIR3, "e23", NULL), | ||
613 | _OMAP2420_BALLENTRY(SDRC_A12, "w26", "r21"), | ||
614 | _OMAP2420_BALLENTRY(SDRC_A13, "w25", "aa15"), | ||
615 | _OMAP2420_BALLENTRY(SDRC_A14, "aa26", "y12"), | ||
616 | _OMAP2420_BALLENTRY(SDRC_CKE1, "ae25", "y13"), | ||
617 | _OMAP2420_BALLENTRY(SDRC_NCS1, "y25", "t20"), | ||
618 | _OMAP2420_BALLENTRY(SPI1_CLK, "y23", NULL), | ||
619 | _OMAP2420_BALLENTRY(SPI1_NCS0, "w24", NULL), | ||
620 | _OMAP2420_BALLENTRY(SPI1_NCS1, "w23", NULL), | ||
621 | _OMAP2420_BALLENTRY(SPI1_NCS2, "v23", NULL), | ||
622 | _OMAP2420_BALLENTRY(SPI1_NCS3, "u20", NULL), | ||
623 | _OMAP2420_BALLENTRY(SPI1_SIMO, "h10", NULL), | ||
624 | _OMAP2420_BALLENTRY(SPI1_SOMI, "v19", NULL), | ||
625 | _OMAP2420_BALLENTRY(SPI2_CLK, "v24", NULL), | ||
626 | _OMAP2420_BALLENTRY(SPI2_NCS0, "aa24", NULL), | ||
627 | _OMAP2420_BALLENTRY(SPI2_SIMO, "u24", NULL), | ||
628 | _OMAP2420_BALLENTRY(SPI2_SOMI, "v25", NULL), | ||
629 | _OMAP2420_BALLENTRY(SSI1_DAT_RX, "w15", NULL), | ||
630 | _OMAP2420_BALLENTRY(SSI1_DAT_TX, "w13", NULL), | ||
631 | _OMAP2420_BALLENTRY(SSI1_FLAG_RX, "af11", NULL), | ||
632 | _OMAP2420_BALLENTRY(SSI1_FLAG_TX, "ac15", NULL), | ||
633 | _OMAP2420_BALLENTRY(SSI1_RDY_RX, "ac16", NULL), | ||
634 | _OMAP2420_BALLENTRY(SSI1_RDY_TX, "af15", NULL), | ||
635 | _OMAP2420_BALLENTRY(SSI1_WAKE, "ad15", NULL), | ||
636 | _OMAP2420_BALLENTRY(SYS_CLKOUT, "ae19", NULL), | ||
637 | _OMAP2420_BALLENTRY(SYS_CLKREQ, "ad20", NULL), | ||
638 | _OMAP2420_BALLENTRY(SYS_NIRQ, "y20", NULL), | ||
639 | _OMAP2420_BALLENTRY(UART1_CTS, "g20", NULL), | ||
640 | _OMAP2420_BALLENTRY(UART1_RTS, "k20", NULL), | ||
641 | _OMAP2420_BALLENTRY(UART1_RX, "t20", NULL), | ||
642 | _OMAP2420_BALLENTRY(UART1_TX, "h12", NULL), | ||
643 | _OMAP2420_BALLENTRY(UART2_CTS, "ac24", NULL), | ||
644 | _OMAP2420_BALLENTRY(UART2_RTS, "w20", NULL), | ||
645 | _OMAP2420_BALLENTRY(UART2_RX, "ad24", NULL), | ||
646 | _OMAP2420_BALLENTRY(UART2_TX, "ab24", NULL), | ||
647 | _OMAP2420_BALLENTRY(UART3_CTS_RCTX, "k24", NULL), | ||
648 | _OMAP2420_BALLENTRY(UART3_RTS_SD, "m20", NULL), | ||
649 | _OMAP2420_BALLENTRY(UART3_RX_IRRX, "h24", NULL), | ||
650 | _OMAP2420_BALLENTRY(UART3_TX_IRTX, "g24", NULL), | ||
651 | _OMAP2420_BALLENTRY(USB0_DAT, "j25", NULL), | ||
652 | _OMAP2420_BALLENTRY(USB0_PUEN, "l23", NULL), | ||
653 | _OMAP2420_BALLENTRY(USB0_RCV, "k23", NULL), | ||
654 | _OMAP2420_BALLENTRY(USB0_SE0, "l24", NULL), | ||
655 | _OMAP2420_BALLENTRY(USB0_TXEN, "m24", NULL), | ||
656 | _OMAP2420_BALLENTRY(USB0_VM, "n23", NULL), | ||
657 | _OMAP2420_BALLENTRY(USB0_VP, "m23", NULL), | ||
658 | _OMAP2420_BALLENTRY(VLYNQ_CLK, "w12", NULL), | ||
659 | _OMAP2420_BALLENTRY(VLYNQ_NLA, "ae10", NULL), | ||
660 | _OMAP2420_BALLENTRY(VLYNQ_RX0, "ad7", NULL), | ||
661 | _OMAP2420_BALLENTRY(VLYNQ_RX1, "w10", NULL), | ||
662 | _OMAP2420_BALLENTRY(VLYNQ_TX0, "y15", NULL), | ||
663 | _OMAP2420_BALLENTRY(VLYNQ_TX1, "w14", NULL), | ||
664 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
665 | }; | ||
666 | #else | ||
667 | #define omap2420_pop_ball NULL | ||
668 | #endif | ||
669 | |||
670 | int __init omap2420_mux_init(struct omap_board_mux *board_subset, int flags) | ||
671 | { | ||
672 | struct omap_ball *package_balls = NULL; | ||
673 | |||
674 | switch (flags & OMAP_PACKAGE_MASK) { | ||
675 | case OMAP_PACKAGE_ZAC: | ||
676 | package_balls = omap2420_pop_ball; | ||
677 | break; | ||
678 | case OMAP_PACKAGE_ZAF: | ||
679 | /* REVISIT: Please add data */ | ||
680 | default: | ||
681 | pr_warning("mux: No ball data available for omap2420 package\n"); | ||
682 | } | ||
683 | |||
684 | return omap_mux_init(OMAP2420_CONTROL_PADCONF_MUX_PBASE, | ||
685 | OMAP2420_CONTROL_PADCONF_MUX_SIZE, | ||
686 | omap2420_muxmodes, NULL, board_subset, | ||
687 | package_balls); | ||
688 | } | ||
diff --git a/arch/arm/mach-omap2/mux2420.h b/arch/arm/mach-omap2/mux2420.h new file mode 100644 index 000000000000..0f555aa847b5 --- /dev/null +++ b/arch/arm/mach-omap2/mux2420.h | |||
@@ -0,0 +1,282 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Nokia | ||
3 | * Copyright (C) 2009 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #define OMAP2420_CONTROL_PADCONF_MUX_PBASE 0x48000030LU | ||
11 | |||
12 | #define OMAP2420_MUX(mode0, mux_value) \ | ||
13 | { \ | ||
14 | .reg_offset = (OMAP2420_CONTROL_PADCONF_##mode0##_OFFSET), \ | ||
15 | .value = (mux_value), \ | ||
16 | } | ||
17 | |||
18 | /* | ||
19 | * OMAP2420 CONTROL_PADCONF* register offsets for pin-muxing | ||
20 | * | ||
21 | * Extracted from the TRM. Add 0x48000030 to these values to get the | ||
22 | * absolute addresses. The name in the macro is the mode-0 name of | ||
23 | * the pin. NOTE: These registers are 8-bits wide. | ||
24 | */ | ||
25 | #define OMAP2420_CONTROL_PADCONF_SDRC_A14_OFFSET 0x000 | ||
26 | #define OMAP2420_CONTROL_PADCONF_SDRC_A13_OFFSET 0x001 | ||
27 | #define OMAP2420_CONTROL_PADCONF_SDRC_A12_OFFSET 0x002 | ||
28 | #define OMAP2420_CONTROL_PADCONF_SDRC_BA1_OFFSET 0x003 | ||
29 | #define OMAP2420_CONTROL_PADCONF_SDRC_BA0_OFFSET 0x004 | ||
30 | #define OMAP2420_CONTROL_PADCONF_SDRC_A11_OFFSET 0x005 | ||
31 | #define OMAP2420_CONTROL_PADCONF_SDRC_A10_OFFSET 0x006 | ||
32 | #define OMAP2420_CONTROL_PADCONF_SDRC_A9_OFFSET 0x007 | ||
33 | #define OMAP2420_CONTROL_PADCONF_SDRC_A8_OFFSET 0x008 | ||
34 | #define OMAP2420_CONTROL_PADCONF_SDRC_A7_OFFSET 0x009 | ||
35 | #define OMAP2420_CONTROL_PADCONF_SDRC_A6_OFFSET 0x00a | ||
36 | #define OMAP2420_CONTROL_PADCONF_SDRC_A5_OFFSET 0x00b | ||
37 | #define OMAP2420_CONTROL_PADCONF_SDRC_A4_OFFSET 0x00c | ||
38 | #define OMAP2420_CONTROL_PADCONF_SDRC_A3_OFFSET 0x00d | ||
39 | #define OMAP2420_CONTROL_PADCONF_SDRC_A2_OFFSET 0x00e | ||
40 | #define OMAP2420_CONTROL_PADCONF_SDRC_A1_OFFSET 0x00f | ||
41 | #define OMAP2420_CONTROL_PADCONF_SDRC_A0_OFFSET 0x010 | ||
42 | #define OMAP2420_CONTROL_PADCONF_SDRC_D31_OFFSET 0x021 | ||
43 | #define OMAP2420_CONTROL_PADCONF_SDRC_D30_OFFSET 0x022 | ||
44 | #define OMAP2420_CONTROL_PADCONF_SDRC_D29_OFFSET 0x023 | ||
45 | #define OMAP2420_CONTROL_PADCONF_SDRC_D28_OFFSET 0x024 | ||
46 | #define OMAP2420_CONTROL_PADCONF_SDRC_D27_OFFSET 0x025 | ||
47 | #define OMAP2420_CONTROL_PADCONF_SDRC_D26_OFFSET 0x026 | ||
48 | #define OMAP2420_CONTROL_PADCONF_SDRC_D25_OFFSET 0x027 | ||
49 | #define OMAP2420_CONTROL_PADCONF_SDRC_D24_OFFSET 0x028 | ||
50 | #define OMAP2420_CONTROL_PADCONF_SDRC_D23_OFFSET 0x029 | ||
51 | #define OMAP2420_CONTROL_PADCONF_SDRC_D22_OFFSET 0x02a | ||
52 | #define OMAP2420_CONTROL_PADCONF_SDRC_D21_OFFSET 0x02b | ||
53 | #define OMAP2420_CONTROL_PADCONF_SDRC_D20_OFFSET 0x02c | ||
54 | #define OMAP2420_CONTROL_PADCONF_SDRC_D19_OFFSET 0x02d | ||
55 | #define OMAP2420_CONTROL_PADCONF_SDRC_D18_OFFSET 0x02e | ||
56 | #define OMAP2420_CONTROL_PADCONF_SDRC_D17_OFFSET 0x02f | ||
57 | #define OMAP2420_CONTROL_PADCONF_SDRC_D16_OFFSET 0x030 | ||
58 | #define OMAP2420_CONTROL_PADCONF_SDRC_D15_OFFSET 0x031 | ||
59 | #define OMAP2420_CONTROL_PADCONF_SDRC_D14_OFFSET 0x032 | ||
60 | #define OMAP2420_CONTROL_PADCONF_SDRC_D13_OFFSET 0x033 | ||
61 | #define OMAP2420_CONTROL_PADCONF_SDRC_D12_OFFSET 0x034 | ||
62 | #define OMAP2420_CONTROL_PADCONF_SDRC_D11_OFFSET 0x035 | ||
63 | #define OMAP2420_CONTROL_PADCONF_SDRC_D10_OFFSET 0x036 | ||
64 | #define OMAP2420_CONTROL_PADCONF_SDRC_D9_OFFSET 0x037 | ||
65 | #define OMAP2420_CONTROL_PADCONF_SDRC_D8_OFFSET 0x038 | ||
66 | #define OMAP2420_CONTROL_PADCONF_SDRC_D7_OFFSET 0x039 | ||
67 | #define OMAP2420_CONTROL_PADCONF_SDRC_D6_OFFSET 0x03a | ||
68 | #define OMAP2420_CONTROL_PADCONF_SDRC_D5_OFFSET 0x03b | ||
69 | #define OMAP2420_CONTROL_PADCONF_SDRC_D4_OFFSET 0x03c | ||
70 | #define OMAP2420_CONTROL_PADCONF_SDRC_D3_OFFSET 0x03d | ||
71 | #define OMAP2420_CONTROL_PADCONF_SDRC_D2_OFFSET 0x03e | ||
72 | #define OMAP2420_CONTROL_PADCONF_SDRC_D1_OFFSET 0x03f | ||
73 | #define OMAP2420_CONTROL_PADCONF_SDRC_D0_OFFSET 0x040 | ||
74 | #define OMAP2420_CONTROL_PADCONF_GPMC_A10_OFFSET 0x041 | ||
75 | #define OMAP2420_CONTROL_PADCONF_GPMC_A9_OFFSET 0x042 | ||
76 | #define OMAP2420_CONTROL_PADCONF_GPMC_A8_OFFSET 0x043 | ||
77 | #define OMAP2420_CONTROL_PADCONF_GPMC_A7_OFFSET 0x044 | ||
78 | #define OMAP2420_CONTROL_PADCONF_GPMC_A6_OFFSET 0x045 | ||
79 | #define OMAP2420_CONTROL_PADCONF_GPMC_A5_OFFSET 0x046 | ||
80 | #define OMAP2420_CONTROL_PADCONF_GPMC_A4_OFFSET 0x047 | ||
81 | #define OMAP2420_CONTROL_PADCONF_GPMC_A3_OFFSET 0x048 | ||
82 | #define OMAP2420_CONTROL_PADCONF_GPMC_A2_OFFSET 0x049 | ||
83 | #define OMAP2420_CONTROL_PADCONF_GPMC_A1_OFFSET 0x04a | ||
84 | #define OMAP2420_CONTROL_PADCONF_GPMC_D15_OFFSET 0x04b | ||
85 | #define OMAP2420_CONTROL_PADCONF_GPMC_D14_OFFSET 0x04c | ||
86 | #define OMAP2420_CONTROL_PADCONF_GPMC_D13_OFFSET 0x04d | ||
87 | #define OMAP2420_CONTROL_PADCONF_GPMC_D12_OFFSET 0x04e | ||
88 | #define OMAP2420_CONTROL_PADCONF_GPMC_D11_OFFSET 0x04f | ||
89 | #define OMAP2420_CONTROL_PADCONF_GPMC_D10_OFFSET 0x050 | ||
90 | #define OMAP2420_CONTROL_PADCONF_GPMC_D9_OFFSET 0x051 | ||
91 | #define OMAP2420_CONTROL_PADCONF_GPMC_D8_OFFSET 0x052 | ||
92 | #define OMAP2420_CONTROL_PADCONF_GPMC_D7_OFFSET 0x053 | ||
93 | #define OMAP2420_CONTROL_PADCONF_GPMC_D6_OFFSET 0x054 | ||
94 | #define OMAP2420_CONTROL_PADCONF_GPMC_D5_OFFSET 0x055 | ||
95 | #define OMAP2420_CONTROL_PADCONF_GPMC_D4_OFFSET 0x056 | ||
96 | #define OMAP2420_CONTROL_PADCONF_GPMC_D3_OFFSET 0x057 | ||
97 | #define OMAP2420_CONTROL_PADCONF_GPMC_D2_OFFSET 0x058 | ||
98 | #define OMAP2420_CONTROL_PADCONF_GPMC_D1_OFFSET 0x059 | ||
99 | #define OMAP2420_CONTROL_PADCONF_GPMC_D0_OFFSET 0x05a | ||
100 | #define OMAP2420_CONTROL_PADCONF_GPMC_CLK_OFFSET 0x05b | ||
101 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS0_OFFSET 0x05c | ||
102 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS1_OFFSET 0x05d | ||
103 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS2_OFFSET 0x05e | ||
104 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS3_OFFSET 0x05f | ||
105 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS4_OFFSET 0x060 | ||
106 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS5_OFFSET 0x061 | ||
107 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS6_OFFSET 0x062 | ||
108 | #define OMAP2420_CONTROL_PADCONF_GPMC_NCS7_OFFSET 0x063 | ||
109 | #define OMAP2420_CONTROL_PADCONF_GPMC_NALE_ALE_OFFSET 0x064 | ||
110 | #define OMAP2420_CONTROL_PADCONF_GPMC_NOE_OFFSET 0x065 | ||
111 | #define OMAP2420_CONTROL_PADCONF_GPMC_NWE_OFFSET 0x066 | ||
112 | #define OMAP2420_CONTROL_PADCONF_GPMC_NBE0_OFFSET 0x067 | ||
113 | #define OMAP2420_CONTROL_PADCONF_GPMC_NBE1_OFFSET 0x068 | ||
114 | #define OMAP2420_CONTROL_PADCONF_GPMC_NWP_OFFSET 0x069 | ||
115 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT0_OFFSET 0x06a | ||
116 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT1_OFFSET 0x06b | ||
117 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT2_OFFSET 0x06c | ||
118 | #define OMAP2420_CONTROL_PADCONF_GPMC_WAIT3_OFFSET 0x06d | ||
119 | #define OMAP2420_CONTROL_PADCONF_SDRC_CLK_OFFSET 0x06e | ||
120 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCLK_OFFSET 0x06f | ||
121 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCS0_OFFSET 0x070 | ||
122 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCS1_OFFSET 0x071 | ||
123 | #define OMAP2420_CONTROL_PADCONF_SDRC_CKE0_OFFSET 0x072 | ||
124 | #define OMAP2420_CONTROL_PADCONF_SDRC_CKE1_OFFSET 0x073 | ||
125 | #define OMAP2420_CONTROL_PADCONF_SDRC_NRAS_OFFSET 0x074 | ||
126 | #define OMAP2420_CONTROL_PADCONF_SDRC_NCAS_OFFSET 0x075 | ||
127 | #define OMAP2420_CONTROL_PADCONF_SDRC_NWE_OFFSET 0x076 | ||
128 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM0_OFFSET 0x077 | ||
129 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM1_OFFSET 0x078 | ||
130 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM2_OFFSET 0x079 | ||
131 | #define OMAP2420_CONTROL_PADCONF_SDRC_DM3_OFFSET 0x07a | ||
132 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS0_OFFSET 0x07f | ||
133 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS1_OFFSET 0x080 | ||
134 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS2_OFFSET 0x081 | ||
135 | #define OMAP2420_CONTROL_PADCONF_SDRC_DQS3_OFFSET 0x082 | ||
136 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA0_OFFSET 0x083 | ||
137 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA1_OFFSET 0x084 | ||
138 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA2_OFFSET 0x085 | ||
139 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA3_OFFSET 0x086 | ||
140 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA4_OFFSET 0x087 | ||
141 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA5_OFFSET 0x088 | ||
142 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA6_OFFSET 0x089 | ||
143 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA7_OFFSET 0x08a | ||
144 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA8_OFFSET 0x08b | ||
145 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA9_OFFSET 0x08c | ||
146 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA10_OFFSET 0x08d | ||
147 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA11_OFFSET 0x08e | ||
148 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA12_OFFSET 0x08f | ||
149 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA13_OFFSET 0x090 | ||
150 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA14_OFFSET 0x091 | ||
151 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA15_OFFSET 0x092 | ||
152 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA16_OFFSET 0x093 | ||
153 | #define OMAP2420_CONTROL_PADCONF_DSS_DATA17_OFFSET 0x094 | ||
154 | #define OMAP2420_CONTROL_PADCONF_UART1_CTS_OFFSET 0x095 | ||
155 | #define OMAP2420_CONTROL_PADCONF_UART1_RTS_OFFSET 0x096 | ||
156 | #define OMAP2420_CONTROL_PADCONF_UART1_TX_OFFSET 0x097 | ||
157 | #define OMAP2420_CONTROL_PADCONF_UART1_RX_OFFSET 0x098 | ||
158 | #define OMAP2420_CONTROL_PADCONF_MCBSP2_DR_OFFSET 0x099 | ||
159 | #define OMAP2420_CONTROL_PADCONF_MCBSP2_CLKX_OFFSET 0x09a | ||
160 | #define OMAP2420_CONTROL_PADCONF_DSS_PCL_OFFSET 0x09b | ||
161 | #define OMAP2420_CONTROL_PADCONF_DSS_VSYNC_OFFSET 0x09c | ||
162 | #define OMAP2420_CONTROL_PADCONF_DSS_HSYNC_OFFSET 0x09d | ||
163 | #define OMAP2420_CONTROL_PADCONF_DSS_ACBIAS_OFFSET 0x09e | ||
164 | #define OMAP2420_CONTROL_PADCONF_CAM_D9_OFFSET 0x09f | ||
165 | #define OMAP2420_CONTROL_PADCONF_CAM_D8_OFFSET 0x0a0 | ||
166 | #define OMAP2420_CONTROL_PADCONF_CAM_D7_OFFSET 0x0a1 | ||
167 | #define OMAP2420_CONTROL_PADCONF_CAM_D6_OFFSET 0x0a2 | ||
168 | #define OMAP2420_CONTROL_PADCONF_CAM_D5_OFFSET 0x0a3 | ||
169 | #define OMAP2420_CONTROL_PADCONF_CAM_D4_OFFSET 0x0a4 | ||
170 | #define OMAP2420_CONTROL_PADCONF_CAM_D3_OFFSET 0x0a5 | ||
171 | #define OMAP2420_CONTROL_PADCONF_CAM_D2_OFFSET 0x0a6 | ||
172 | #define OMAP2420_CONTROL_PADCONF_CAM_D1_OFFSET 0x0a7 | ||
173 | #define OMAP2420_CONTROL_PADCONF_CAM_D0_OFFSET 0x0a8 | ||
174 | #define OMAP2420_CONTROL_PADCONF_CAM_HS_OFFSET 0x0a9 | ||
175 | #define OMAP2420_CONTROL_PADCONF_CAM_VS_OFFSET 0x0aa | ||
176 | #define OMAP2420_CONTROL_PADCONF_CAM_LCLK_OFFSET 0x0ab | ||
177 | #define OMAP2420_CONTROL_PADCONF_CAM_XCLK_OFFSET 0x0ac | ||
178 | #define OMAP2420_CONTROL_PADCONF_SSI1_DAT_TX_OFFSET 0x0ad | ||
179 | #define OMAP2420_CONTROL_PADCONF_SSI1_FLAG_TX_OFFSET 0x0ae | ||
180 | #define OMAP2420_CONTROL_PADCONF_SSI1_RDY_TX_OFFSET 0x0af | ||
181 | #define OMAP2420_CONTROL_PADCONF_GPIO_62_OFFSET 0x0b0 | ||
182 | #define OMAP2420_CONTROL_PADCONF_SSI1_DAT_RX_OFFSET 0x0b1 | ||
183 | #define OMAP2420_CONTROL_PADCONF_SSI1_FLAG_RX_OFFSET 0x0b2 | ||
184 | #define OMAP2420_CONTROL_PADCONF_SSI1_RDY_RX_OFFSET 0x0b3 | ||
185 | #define OMAP2420_CONTROL_PADCONF_SSI1_WAKE_OFFSET 0x0b4 | ||
186 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_CLK_OFFSET 0x0b5 | ||
187 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_RX1_OFFSET 0x0b6 | ||
188 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_RX0_OFFSET 0x0b7 | ||
189 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_TX1_OFFSET 0x0b8 | ||
190 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_TX0_OFFSET 0x0b9 | ||
191 | #define OMAP2420_CONTROL_PADCONF_VLYNQ_NLA_OFFSET 0x0ba | ||
192 | #define OMAP2420_CONTROL_PADCONF_UART2_CTS_OFFSET 0x0bb | ||
193 | #define OMAP2420_CONTROL_PADCONF_UART2_RTS_OFFSET 0x0bc | ||
194 | #define OMAP2420_CONTROL_PADCONF_UART2_TX_OFFSET 0x0bd | ||
195 | #define OMAP2420_CONTROL_PADCONF_UART2_RX_OFFSET 0x0be | ||
196 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_SCLK_OFFSET 0x0bf | ||
197 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_FS_OFFSET 0x0c0 | ||
198 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_DIN_OFFSET 0x0c1 | ||
199 | #define OMAP2420_CONTROL_PADCONF_EAC_BT_DOUT_OFFSET 0x0c2 | ||
200 | #define OMAP2420_CONTROL_PADCONF_MMC_CLKO_OFFSET 0x0c3 | ||
201 | #define OMAP2420_CONTROL_PADCONF_MMC_CMD_OFFSET 0x0c4 | ||
202 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT0_OFFSET 0x0c5 | ||
203 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT1_OFFSET 0x0c6 | ||
204 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT2_OFFSET 0x0c7 | ||
205 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT3_OFFSET 0x0c8 | ||
206 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR0_OFFSET 0x0c9 | ||
207 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR1_OFFSET 0x0ca | ||
208 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR2_OFFSET 0x0cb | ||
209 | #define OMAP2420_CONTROL_PADCONF_MMC_DAT_DIR3_OFFSET 0x0cc | ||
210 | #define OMAP2420_CONTROL_PADCONF_MMC_CMD_DIR_OFFSET 0x0cd | ||
211 | #define OMAP2420_CONTROL_PADCONF_MMC_CLKI_OFFSET 0x0ce | ||
212 | #define OMAP2420_CONTROL_PADCONF_SPI1_CLK_OFFSET 0x0cf | ||
213 | #define OMAP2420_CONTROL_PADCONF_SPI1_SIMO_OFFSET 0x0d0 | ||
214 | #define OMAP2420_CONTROL_PADCONF_SPI1_SOMI_OFFSET 0x0d1 | ||
215 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS0_OFFSET 0x0d2 | ||
216 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS1_OFFSET 0x0d3 | ||
217 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS2_OFFSET 0x0d4 | ||
218 | #define OMAP2420_CONTROL_PADCONF_SPI1_NCS3_OFFSET 0x0d5 | ||
219 | #define OMAP2420_CONTROL_PADCONF_SPI2_CLK_OFFSET 0x0d6 | ||
220 | #define OMAP2420_CONTROL_PADCONF_SPI2_SIMO_OFFSET 0x0d7 | ||
221 | #define OMAP2420_CONTROL_PADCONF_SPI2_SOMI_OFFSET 0x0d8 | ||
222 | #define OMAP2420_CONTROL_PADCONF_SPI2_NCS0_OFFSET 0x0d9 | ||
223 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_CLKR_OFFSET 0x0da | ||
224 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_FSR_OFFSET 0x0db | ||
225 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_DX_OFFSET 0x0dc | ||
226 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_DR_OFFSET 0x0dd | ||
227 | #define OMAP2420_CONTROL_PADCONF_MCBSP_CLKS_OFFSET 0x0de | ||
228 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_FSX_OFFSET 0x0df | ||
229 | #define OMAP2420_CONTROL_PADCONF_MCBSP1_CLKX_OFFSET 0x0e0 | ||
230 | #define OMAP2420_CONTROL_PADCONF_I2C1_SCL_OFFSET 0x0e1 | ||
231 | #define OMAP2420_CONTROL_PADCONF_I2C1_SDA_OFFSET 0x0e2 | ||
232 | #define OMAP2420_CONTROL_PADCONF_I2C2_SCL_OFFSET 0x0e3 | ||
233 | #define OMAP2420_CONTROL_PADCONF_I2C2_SDA_OFFSET 0x0e4 | ||
234 | #define OMAP2420_CONTROL_PADCONF_HDQ_SIO_OFFSET 0x0e5 | ||
235 | #define OMAP2420_CONTROL_PADCONF_UART3_CTS_RCTX_OFFSET 0x0e6 | ||
236 | #define OMAP2420_CONTROL_PADCONF_UART3_RTS_SD_OFFSET 0x0e7 | ||
237 | #define OMAP2420_CONTROL_PADCONF_UART3_TX_IRTX_OFFSET 0x0e8 | ||
238 | #define OMAP2420_CONTROL_PADCONF_UART3_RX_IRRX_OFFSET 0x0e9 | ||
239 | #define OMAP2420_CONTROL_PADCONF_TV_CVBS_OFFSET 0x0ea | ||
240 | #define OMAP2420_CONTROL_PADCONF_TV_VREF_OFFSET 0x0eb | ||
241 | #define OMAP2420_CONTROL_PADCONF_TV_RREF_OFFSET 0x0ec | ||
242 | #define OMAP2420_CONTROL_PADCONF_USB0_PUEN_OFFSET 0x0ed | ||
243 | #define OMAP2420_CONTROL_PADCONF_USB0_VP_OFFSET 0x0ee | ||
244 | #define OMAP2420_CONTROL_PADCONF_USB0_VM_OFFSET 0x0ef | ||
245 | #define OMAP2420_CONTROL_PADCONF_USB0_RCV_OFFSET 0x0f0 | ||
246 | #define OMAP2420_CONTROL_PADCONF_USB0_TXEN_OFFSET 0x0f1 | ||
247 | #define OMAP2420_CONTROL_PADCONF_USB0_SE0_OFFSET 0x0f2 | ||
248 | #define OMAP2420_CONTROL_PADCONF_USB0_DAT_OFFSET 0x0f3 | ||
249 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_SCLK_OFFSET 0x0f4 | ||
250 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_FS_OFFSET 0x0f5 | ||
251 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_DIN_OFFSET 0x0f6 | ||
252 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_DOUT_OFFSET 0x0f7 | ||
253 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_MCLK_OFFSET 0x0f8 | ||
254 | #define OMAP2420_CONTROL_PADCONF_EAC_AC_RST_OFFSET 0x0f9 | ||
255 | #define OMAP2420_CONTROL_PADCONF_SYS_NRESPWRON_OFFSET 0x0fa | ||
256 | #define OMAP2420_CONTROL_PADCONF_SYS_NRESWARM_OFFSET 0x0fb | ||
257 | #define OMAP2420_CONTROL_PADCONF_SYS_NIRQ_OFFSET 0x0fc | ||
258 | #define OMAP2420_CONTROL_PADCONF_SYS_NV_OFFSET 0x0fd | ||
259 | #define OMAP2420_CONTROL_PADCONF_GPIO_119_OFFSET 0x0fe | ||
260 | #define OMAP2420_CONTROL_PADCONF_GPIO_120_OFFSET 0x0ff | ||
261 | #define OMAP2420_CONTROL_PADCONF_GPIO_121_OFFSET 0x100 | ||
262 | #define OMAP2420_CONTROL_PADCONF_GPIO_122_OFFSET 0x101 | ||
263 | #define OMAP2420_CONTROL_PADCONF_SYS_32K_OFFSET 0x102 | ||
264 | #define OMAP2420_CONTROL_PADCONF_SYS_XTALIN_OFFSET 0x103 | ||
265 | #define OMAP2420_CONTROL_PADCONF_SYS_XTALOUT_OFFSET 0x104 | ||
266 | #define OMAP2420_CONTROL_PADCONF_GPIO_36_OFFSET 0x105 | ||
267 | #define OMAP2420_CONTROL_PADCONF_SYS_CLKREQ_OFFSET 0x106 | ||
268 | #define OMAP2420_CONTROL_PADCONF_SYS_CLKOUT_OFFSET 0x107 | ||
269 | #define OMAP2420_CONTROL_PADCONF_GPIO_6_OFFSET 0x108 | ||
270 | #define OMAP2420_CONTROL_PADCONF_GPIO_124_OFFSET 0x109 | ||
271 | #define OMAP2420_CONTROL_PADCONF_GPIO_125_OFFSET 0x10a | ||
272 | #define OMAP2420_CONTROL_PADCONF_JTAG_EMU1_OFFSET 0x10b | ||
273 | #define OMAP2420_CONTROL_PADCONF_JTAG_EMU0_OFFSET 0x10c | ||
274 | #define OMAP2420_CONTROL_PADCONF_JTAG_NTRST_OFFSET 0x10d | ||
275 | #define OMAP2420_CONTROL_PADCONF_JTAG_TCK_OFFSET 0x10e | ||
276 | #define OMAP2420_CONTROL_PADCONF_JTAG_RTCK_OFFSET 0x10f | ||
277 | #define OMAP2420_CONTROL_PADCONF_JTAG_TMS_OFFSET 0x110 | ||
278 | #define OMAP2420_CONTROL_PADCONF_JTAG_TDI_OFFSET 0x111 | ||
279 | #define OMAP2420_CONTROL_PADCONF_JTAG_TDO_OFFSET 0x112 | ||
280 | |||
281 | #define OMAP2420_CONTROL_PADCONF_MUX_SIZE \ | ||
282 | (OMAP2420_CONTROL_PADCONF_JTAG_TDO_OFFSET + 0x1) | ||
diff --git a/arch/arm/mach-omap2/mux2430.c b/arch/arm/mach-omap2/mux2430.c new file mode 100644 index 000000000000..7dcaaa8af32a --- /dev/null +++ b/arch/arm/mach-omap2/mux2430.c | |||
@@ -0,0 +1,791 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Nokia | ||
3 | * Copyright (C) 2010 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #include <linux/module.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | #include "mux.h" | ||
14 | |||
15 | #ifdef CONFIG_OMAP_MUX | ||
16 | |||
17 | #define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
18 | { \ | ||
19 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
20 | .gpio = (g), \ | ||
21 | .muxnames = { m0, m1, m2, m3, m4, m5, m6, m7 }, \ | ||
22 | } | ||
23 | |||
24 | #else | ||
25 | |||
26 | #define _OMAP2430_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \ | ||
27 | { \ | ||
28 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
29 | .gpio = (g), \ | ||
30 | } | ||
31 | |||
32 | #endif | ||
33 | |||
34 | #define _OMAP2430_BALLENTRY(M0, bb, bt) \ | ||
35 | { \ | ||
36 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##M0##_OFFSET), \ | ||
37 | .balls = { bb, bt }, \ | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * Superset of all mux modes for omap2430 | ||
42 | */ | ||
43 | static struct omap_mux __initdata omap2430_muxmodes[] = { | ||
44 | _OMAP2430_MUXENTRY(CAM_D0, 133, | ||
45 | "cam_d0", "hw_dbg0", "sti_dout", "gpio_133", | ||
46 | NULL, NULL, "etk_d2", "safe_mode"), | ||
47 | _OMAP2430_MUXENTRY(CAM_D10, 146, | ||
48 | "cam_d10", NULL, NULL, "gpio_146", | ||
49 | NULL, NULL, "etk_d12", "safe_mode"), | ||
50 | _OMAP2430_MUXENTRY(CAM_D11, 145, | ||
51 | "cam_d11", NULL, NULL, "gpio_145", | ||
52 | NULL, NULL, "etk_d13", "safe_mode"), | ||
53 | _OMAP2430_MUXENTRY(CAM_D1, 132, | ||
54 | "cam_d1", "hw_dbg1", "sti_din", "gpio_132", | ||
55 | NULL, NULL, "etk_d3", "safe_mode"), | ||
56 | _OMAP2430_MUXENTRY(CAM_D2, 129, | ||
57 | "cam_d2", "hw_dbg2", "mcbsp1_clkx", "gpio_129", | ||
58 | NULL, NULL, "etk_d4", "safe_mode"), | ||
59 | _OMAP2430_MUXENTRY(CAM_D3, 128, | ||
60 | "cam_d3", "hw_dbg3", "mcbsp1_dr", "gpio_128", | ||
61 | NULL, NULL, "etk_d5", "safe_mode"), | ||
62 | _OMAP2430_MUXENTRY(CAM_D4, 143, | ||
63 | "cam_d4", "hw_dbg4", "mcbsp1_fsr", "gpio_143", | ||
64 | NULL, NULL, "etk_d6", "safe_mode"), | ||
65 | _OMAP2430_MUXENTRY(CAM_D5, 112, | ||
66 | "cam_d5", "hw_dbg5", "mcbsp1_clkr", "gpio_112", | ||
67 | NULL, NULL, "etk_d7", "safe_mode"), | ||
68 | _OMAP2430_MUXENTRY(CAM_D6, 137, | ||
69 | "cam_d6", "hw_dbg6", NULL, "gpio_137", | ||
70 | NULL, NULL, "etk_d8", "safe_mode"), | ||
71 | _OMAP2430_MUXENTRY(CAM_D7, 136, | ||
72 | "cam_d7", "hw_dbg7", NULL, "gpio_136", | ||
73 | NULL, NULL, "etk_d9", "safe_mode"), | ||
74 | _OMAP2430_MUXENTRY(CAM_D8, 135, | ||
75 | "cam_d8", "hw_dbg8", NULL, "gpio_135", | ||
76 | NULL, NULL, "etk_d10", "safe_mode"), | ||
77 | _OMAP2430_MUXENTRY(CAM_D9, 134, | ||
78 | "cam_d9", "hw_dbg9", NULL, "gpio_134", | ||
79 | NULL, NULL, "etk_d11", "safe_mode"), | ||
80 | _OMAP2430_MUXENTRY(CAM_HS, 11, | ||
81 | "cam_hs", "hw_dbg10", "mcbsp1_dx", "gpio_11", | ||
82 | NULL, NULL, "etk_d1", "safe_mode"), | ||
83 | _OMAP2430_MUXENTRY(CAM_LCLK, 0, | ||
84 | "cam_lclk", NULL, "mcbsp_clks", NULL, | ||
85 | NULL, NULL, "etk_c1", "safe_mode"), | ||
86 | _OMAP2430_MUXENTRY(CAM_VS, 12, | ||
87 | "cam_vs", "hw_dbg11", "mcbsp1_fsx", "gpio_12", | ||
88 | NULL, NULL, "etk_d0", "safe_mode"), | ||
89 | _OMAP2430_MUXENTRY(CAM_XCLK, 0, | ||
90 | "cam_xclk", NULL, "sti_clk", NULL, | ||
91 | NULL, NULL, "etk_c2", NULL), | ||
92 | _OMAP2430_MUXENTRY(DSS_ACBIAS, 48, | ||
93 | "dss_acbias", NULL, "mcbsp2_fsx", "gpio_48", | ||
94 | NULL, NULL, NULL, "safe_mode"), | ||
95 | _OMAP2430_MUXENTRY(DSS_DATA0, 40, | ||
96 | "dss_data0", "uart1_cts", NULL, "gpio_40", | ||
97 | NULL, NULL, NULL, "safe_mode"), | ||
98 | _OMAP2430_MUXENTRY(DSS_DATA10, 128, | ||
99 | "dss_data10", "sdi_data1n", NULL, "gpio_128", | ||
100 | NULL, NULL, NULL, "safe_mode"), | ||
101 | _OMAP2430_MUXENTRY(DSS_DATA11, 129, | ||
102 | "dss_data11", "sdi_data1p", NULL, "gpio_129", | ||
103 | NULL, NULL, NULL, "safe_mode"), | ||
104 | _OMAP2430_MUXENTRY(DSS_DATA12, 130, | ||
105 | "dss_data12", "sdi_data2n", NULL, "gpio_130", | ||
106 | NULL, NULL, NULL, "safe_mode"), | ||
107 | _OMAP2430_MUXENTRY(DSS_DATA13, 131, | ||
108 | "dss_data13", "sdi_data2p", NULL, "gpio_131", | ||
109 | NULL, NULL, NULL, "safe_mode"), | ||
110 | _OMAP2430_MUXENTRY(DSS_DATA14, 132, | ||
111 | "dss_data14", "sdi_data3n", NULL, "gpio_132", | ||
112 | NULL, NULL, NULL, "safe_mode"), | ||
113 | _OMAP2430_MUXENTRY(DSS_DATA15, 133, | ||
114 | "dss_data15", "sdi_data3p", NULL, "gpio_133", | ||
115 | NULL, NULL, NULL, "safe_mode"), | ||
116 | _OMAP2430_MUXENTRY(DSS_DATA16, 46, | ||
117 | "dss_data16", NULL, NULL, "gpio_46", | ||
118 | NULL, NULL, NULL, "safe_mode"), | ||
119 | _OMAP2430_MUXENTRY(DSS_DATA17, 47, | ||
120 | "dss_data17", NULL, NULL, "gpio_47", | ||
121 | NULL, NULL, NULL, "safe_mode"), | ||
122 | _OMAP2430_MUXENTRY(DSS_DATA1, 41, | ||
123 | "dss_data1", "uart1_rts", NULL, "gpio_41", | ||
124 | NULL, NULL, NULL, "safe_mode"), | ||
125 | _OMAP2430_MUXENTRY(DSS_DATA2, 42, | ||
126 | "dss_data2", "uart1_tx", NULL, "gpio_42", | ||
127 | NULL, NULL, NULL, "safe_mode"), | ||
128 | _OMAP2430_MUXENTRY(DSS_DATA3, 43, | ||
129 | "dss_data3", "uart1_rx", NULL, "gpio_43", | ||
130 | NULL, NULL, NULL, "safe_mode"), | ||
131 | _OMAP2430_MUXENTRY(DSS_DATA4, 44, | ||
132 | "dss_data4", "uart3_rx_irrx", NULL, "gpio_44", | ||
133 | NULL, NULL, NULL, "safe_mode"), | ||
134 | _OMAP2430_MUXENTRY(DSS_DATA5, 45, | ||
135 | "dss_data5", "uart3_tx_irtx", NULL, "gpio_45", | ||
136 | NULL, NULL, NULL, "safe_mode"), | ||
137 | _OMAP2430_MUXENTRY(DSS_DATA6, 144, | ||
138 | "dss_data6", NULL, NULL, "gpio_144", | ||
139 | NULL, NULL, NULL, "safe_mode"), | ||
140 | _OMAP2430_MUXENTRY(DSS_DATA7, 147, | ||
141 | "dss_data7", NULL, NULL, "gpio_147", | ||
142 | NULL, NULL, NULL, "safe_mode"), | ||
143 | _OMAP2430_MUXENTRY(DSS_DATA8, 38, | ||
144 | "dss_data8", NULL, NULL, "gpio_38", | ||
145 | NULL, NULL, NULL, "safe_mode"), | ||
146 | _OMAP2430_MUXENTRY(DSS_DATA9, 39, | ||
147 | "dss_data9", NULL, NULL, "gpio_39", | ||
148 | NULL, NULL, NULL, "safe_mode"), | ||
149 | _OMAP2430_MUXENTRY(DSS_HSYNC, 110, | ||
150 | "dss_hsync", NULL, NULL, "gpio_110", | ||
151 | NULL, NULL, NULL, "safe_mode"), | ||
152 | _OMAP2430_MUXENTRY(GPIO_113, 113, | ||
153 | "gpio_113", "mcbsp2_clkx", NULL, "gpio_113", | ||
154 | NULL, NULL, NULL, "safe_mode"), | ||
155 | _OMAP2430_MUXENTRY(GPIO_114, 114, | ||
156 | "gpio_114", "mcbsp2_fsx", NULL, "gpio_114", | ||
157 | NULL, NULL, NULL, "safe_mode"), | ||
158 | _OMAP2430_MUXENTRY(GPIO_115, 115, | ||
159 | "gpio_115", "mcbsp2_dr", NULL, "gpio_115", | ||
160 | NULL, NULL, NULL, "safe_mode"), | ||
161 | _OMAP2430_MUXENTRY(GPIO_116, 116, | ||
162 | "gpio_116", "mcbsp2_dx", NULL, "gpio_116", | ||
163 | NULL, NULL, NULL, "safe_mode"), | ||
164 | _OMAP2430_MUXENTRY(GPIO_128, 128, | ||
165 | "gpio_128", NULL, "sti_din", "gpio_128", | ||
166 | NULL, "sys_boot0", NULL, "safe_mode"), | ||
167 | _OMAP2430_MUXENTRY(GPIO_129, 129, | ||
168 | "gpio_129", NULL, "sti_dout", "gpio_129", | ||
169 | NULL, "sys_boot1", NULL, "safe_mode"), | ||
170 | _OMAP2430_MUXENTRY(GPIO_130, 130, | ||
171 | "gpio_130", NULL, NULL, "gpio_130", | ||
172 | "jtag_emu2", "sys_boot2", NULL, "safe_mode"), | ||
173 | _OMAP2430_MUXENTRY(GPIO_131, 131, | ||
174 | "gpio_131", NULL, NULL, "gpio_131", | ||
175 | "jtag_emu3", "sys_boot3", NULL, "safe_mode"), | ||
176 | _OMAP2430_MUXENTRY(GPIO_132, 132, | ||
177 | "gpio_132", NULL, NULL, "gpio_132", | ||
178 | NULL, "sys_boot4", NULL, "safe_mode"), | ||
179 | _OMAP2430_MUXENTRY(GPIO_133, 133, | ||
180 | "gpio_133", NULL, NULL, "gpio_133", | ||
181 | NULL, "sys_boot5", NULL, "safe_mode"), | ||
182 | _OMAP2430_MUXENTRY(GPIO_134, 134, | ||
183 | "gpio_134", "ccp_datn", NULL, "gpio_134", | ||
184 | NULL, NULL, NULL, "safe_mode"), | ||
185 | _OMAP2430_MUXENTRY(GPIO_135, 135, | ||
186 | "gpio_135", "ccp_datp", NULL, "gpio_135", | ||
187 | NULL, NULL, NULL, "safe_mode"), | ||
188 | _OMAP2430_MUXENTRY(GPIO_136, 136, | ||
189 | "gpio_136", "ccp_clkn", NULL, "gpio_136", | ||
190 | NULL, NULL, NULL, "safe_mode"), | ||
191 | _OMAP2430_MUXENTRY(GPIO_137, 137, | ||
192 | "gpio_137", "ccp_clkp", NULL, "gpio_137", | ||
193 | NULL, NULL, NULL, "safe_mode"), | ||
194 | _OMAP2430_MUXENTRY(GPIO_138, 138, | ||
195 | "gpio_138", "spi3_clk", NULL, "gpio_138", | ||
196 | NULL, NULL, NULL, "safe_mode"), | ||
197 | _OMAP2430_MUXENTRY(GPIO_139, 139, | ||
198 | "gpio_139", "spi3_cs0", "sys_ndmareq3", "gpio_139", | ||
199 | NULL, NULL, NULL, "safe_mode"), | ||
200 | _OMAP2430_MUXENTRY(GPIO_140, 140, | ||
201 | "gpio_140", "spi3_simo", "sys_ndmareq4", "gpio_140", | ||
202 | NULL, NULL, "etk_d14", "safe_mode"), | ||
203 | _OMAP2430_MUXENTRY(GPIO_141, 141, | ||
204 | "gpio_141", "spi3_somi", NULL, "gpio_141", | ||
205 | NULL, NULL, NULL, "safe_mode"), | ||
206 | _OMAP2430_MUXENTRY(GPIO_142, 142, | ||
207 | "gpio_142", "spi3_cs1", "sys_ndmareq2", "gpio_142", | ||
208 | NULL, NULL, "etk_d15", "safe_mode"), | ||
209 | _OMAP2430_MUXENTRY(GPIO_148, 148, | ||
210 | "gpio_148", "mcbsp5_fsx", NULL, "gpio_148", | ||
211 | NULL, NULL, NULL, "safe_mode"), | ||
212 | _OMAP2430_MUXENTRY(GPIO_149, 149, | ||
213 | "gpio_149", "mcbsp5_dx", NULL, "gpio_149", | ||
214 | NULL, NULL, NULL, "safe_mode"), | ||
215 | _OMAP2430_MUXENTRY(GPIO_150, 150, | ||
216 | "gpio_150", "mcbsp5_dr", NULL, "gpio_150", | ||
217 | NULL, NULL, NULL, "safe_mode"), | ||
218 | _OMAP2430_MUXENTRY(GPIO_151, 151, | ||
219 | "gpio_151", "sys_pwrok", NULL, "gpio_151", | ||
220 | NULL, NULL, NULL, "safe_mode"), | ||
221 | _OMAP2430_MUXENTRY(GPIO_152, 152, | ||
222 | "gpio_152", "uart1_cts", "sys_ndmareq1", "gpio_152", | ||
223 | NULL, NULL, NULL, "safe_mode"), | ||
224 | _OMAP2430_MUXENTRY(GPIO_153, 153, | ||
225 | "gpio_153", "uart1_rx", "sys_ndmareq0", "gpio_153", | ||
226 | NULL, NULL, NULL, "safe_mode"), | ||
227 | _OMAP2430_MUXENTRY(GPIO_154, 154, | ||
228 | "gpio_154", "mcbsp5_clkx", NULL, "gpio_154", | ||
229 | NULL, NULL, NULL, "safe_mode"), | ||
230 | _OMAP2430_MUXENTRY(GPIO_63, 63, | ||
231 | "gpio_63", "mcbsp4_clkx", NULL, "gpio_63", | ||
232 | NULL, NULL, NULL, "safe_mode"), | ||
233 | _OMAP2430_MUXENTRY(GPIO_78, 78, | ||
234 | "gpio_78", NULL, "uart2_rts", "gpio_78", | ||
235 | "uart3_rts_sd", NULL, NULL, "safe_mode"), | ||
236 | _OMAP2430_MUXENTRY(GPIO_79, 79, | ||
237 | "gpio_79", "secure_indicator", "uart2_tx", "gpio_79", | ||
238 | "uart3_tx_irtx", NULL, NULL, "safe_mode"), | ||
239 | _OMAP2430_MUXENTRY(GPIO_7, 7, | ||
240 | "gpio_7", NULL, "uart2_cts", "gpio_7", | ||
241 | "uart3_cts_rctx", NULL, NULL, "safe_mode"), | ||
242 | _OMAP2430_MUXENTRY(GPIO_80, 80, | ||
243 | "gpio_80", NULL, "uart2_rx", "gpio_80", | ||
244 | "uart3_rx_irrx", NULL, NULL, "safe_mode"), | ||
245 | _OMAP2430_MUXENTRY(GPMC_A10, 3, | ||
246 | "gpmc_a10", NULL, "sys_ndmareq0", "gpio_3", | ||
247 | NULL, NULL, NULL, "safe_mode"), | ||
248 | _OMAP2430_MUXENTRY(GPMC_A1, 31, | ||
249 | "gpmc_a1", NULL, NULL, "gpio_31", | ||
250 | NULL, NULL, NULL, "safe_mode"), | ||
251 | _OMAP2430_MUXENTRY(GPMC_A2, 30, | ||
252 | "gpmc_a2", NULL, NULL, "gpio_30", | ||
253 | NULL, NULL, NULL, "safe_mode"), | ||
254 | _OMAP2430_MUXENTRY(GPMC_A3, 29, | ||
255 | "gpmc_a3", NULL, NULL, "gpio_29", | ||
256 | NULL, NULL, NULL, "safe_mode"), | ||
257 | _OMAP2430_MUXENTRY(GPMC_A4, 49, | ||
258 | "gpmc_a4", NULL, NULL, "gpio_49", | ||
259 | NULL, NULL, NULL, "safe_mode"), | ||
260 | _OMAP2430_MUXENTRY(GPMC_A5, 53, | ||
261 | "gpmc_a5", NULL, NULL, "gpio_53", | ||
262 | NULL, NULL, NULL, "safe_mode"), | ||
263 | _OMAP2430_MUXENTRY(GPMC_A6, 52, | ||
264 | "gpmc_a6", NULL, NULL, "gpio_52", | ||
265 | NULL, NULL, NULL, "safe_mode"), | ||
266 | _OMAP2430_MUXENTRY(GPMC_A7, 6, | ||
267 | "gpmc_a7", NULL, NULL, "gpio_6", | ||
268 | NULL, NULL, NULL, "safe_mode"), | ||
269 | _OMAP2430_MUXENTRY(GPMC_A8, 5, | ||
270 | "gpmc_a8", NULL, NULL, "gpio_5", | ||
271 | NULL, NULL, NULL, "safe_mode"), | ||
272 | _OMAP2430_MUXENTRY(GPMC_A9, 4, | ||
273 | "gpmc_a9", NULL, "sys_ndmareq1", "gpio_4", | ||
274 | NULL, NULL, NULL, "safe_mode"), | ||
275 | _OMAP2430_MUXENTRY(GPMC_CLK, 21, | ||
276 | "gpmc_clk", NULL, NULL, "gpio_21", | ||
277 | NULL, NULL, NULL, "safe_mode"), | ||
278 | _OMAP2430_MUXENTRY(GPMC_D10, 18, | ||
279 | "gpmc_d10", NULL, NULL, "gpio_18", | ||
280 | NULL, NULL, NULL, "safe_mode"), | ||
281 | _OMAP2430_MUXENTRY(GPMC_D11, 57, | ||
282 | "gpmc_d11", NULL, NULL, "gpio_57", | ||
283 | NULL, NULL, NULL, "safe_mode"), | ||
284 | _OMAP2430_MUXENTRY(GPMC_D12, 77, | ||
285 | "gpmc_d12", NULL, NULL, "gpio_77", | ||
286 | NULL, NULL, NULL, "safe_mode"), | ||
287 | _OMAP2430_MUXENTRY(GPMC_D13, 76, | ||
288 | "gpmc_d13", NULL, NULL, "gpio_76", | ||
289 | NULL, NULL, NULL, "safe_mode"), | ||
290 | _OMAP2430_MUXENTRY(GPMC_D14, 55, | ||
291 | "gpmc_d14", NULL, NULL, "gpio_55", | ||
292 | NULL, NULL, NULL, "safe_mode"), | ||
293 | _OMAP2430_MUXENTRY(GPMC_D15, 54, | ||
294 | "gpmc_d15", NULL, NULL, "gpio_54", | ||
295 | NULL, NULL, NULL, "safe_mode"), | ||
296 | _OMAP2430_MUXENTRY(GPMC_D8, 20, | ||
297 | "gpmc_d8", NULL, NULL, "gpio_20", | ||
298 | NULL, NULL, NULL, "safe_mode"), | ||
299 | _OMAP2430_MUXENTRY(GPMC_D9, 19, | ||
300 | "gpmc_d9", NULL, NULL, "gpio_19", | ||
301 | NULL, NULL, NULL, "safe_mode"), | ||
302 | _OMAP2430_MUXENTRY(GPMC_NCS1, 22, | ||
303 | "gpmc_ncs1", NULL, NULL, "gpio_22", | ||
304 | NULL, NULL, NULL, "safe_mode"), | ||
305 | _OMAP2430_MUXENTRY(GPMC_NCS2, 23, | ||
306 | "gpmc_ncs2", NULL, NULL, "gpio_23", | ||
307 | NULL, NULL, NULL, "safe_mode"), | ||
308 | _OMAP2430_MUXENTRY(GPMC_NCS3, 24, | ||
309 | "gpmc_ncs3", "gpmc_io_dir", NULL, "gpio_24", | ||
310 | NULL, NULL, NULL, "safe_mode"), | ||
311 | _OMAP2430_MUXENTRY(GPMC_NCS4, 25, | ||
312 | "gpmc_ncs4", NULL, NULL, "gpio_25", | ||
313 | NULL, NULL, NULL, "safe_mode"), | ||
314 | _OMAP2430_MUXENTRY(GPMC_NCS5, 26, | ||
315 | "gpmc_ncs5", NULL, NULL, "gpio_26", | ||
316 | NULL, NULL, NULL, "safe_mode"), | ||
317 | _OMAP2430_MUXENTRY(GPMC_NCS6, 27, | ||
318 | "gpmc_ncs6", NULL, NULL, "gpio_27", | ||
319 | NULL, NULL, NULL, "safe_mode"), | ||
320 | _OMAP2430_MUXENTRY(GPMC_NCS7, 28, | ||
321 | "gpmc_ncs7", "gpmc_io_dir", NULL, "gpio_28", | ||
322 | NULL, NULL, NULL, "safe_mode"), | ||
323 | _OMAP2430_MUXENTRY(GPMC_WAIT1, 33, | ||
324 | "gpmc_wait1", NULL, NULL, "gpio_33", | ||
325 | NULL, NULL, NULL, "safe_mode"), | ||
326 | _OMAP2430_MUXENTRY(GPMC_WAIT2, 34, | ||
327 | "gpmc_wait2", NULL, NULL, "gpio_34", | ||
328 | NULL, NULL, NULL, "safe_mode"), | ||
329 | _OMAP2430_MUXENTRY(GPMC_WAIT3, 35, | ||
330 | "gpmc_wait3", NULL, NULL, "gpio_35", | ||
331 | NULL, NULL, NULL, "safe_mode"), | ||
332 | _OMAP2430_MUXENTRY(HDQ_SIO, 101, | ||
333 | "hdq_sio", "usb2_tllse0", "sys_altclk", "gpio_101", | ||
334 | "uart3_rx_irrx", NULL, NULL, "safe_mode"), | ||
335 | _OMAP2430_MUXENTRY(I2C1_SCL, 50, | ||
336 | "i2c1_scl", NULL, NULL, "gpio_50", | ||
337 | NULL, NULL, NULL, "safe_mode"), | ||
338 | _OMAP2430_MUXENTRY(I2C1_SDA, 51, | ||
339 | "i2c1_sda", NULL, NULL, "gpio_51", | ||
340 | NULL, NULL, NULL, "safe_mode"), | ||
341 | _OMAP2430_MUXENTRY(I2C2_SCL, 99, | ||
342 | "i2c2_scl", NULL, NULL, "gpio_99", | ||
343 | NULL, NULL, NULL, "safe_mode"), | ||
344 | _OMAP2430_MUXENTRY(I2C2_SDA, 100, | ||
345 | "i2c2_sda", NULL, NULL, "gpio_100", | ||
346 | NULL, NULL, NULL, "safe_mode"), | ||
347 | _OMAP2430_MUXENTRY(JTAG_EMU0, 127, | ||
348 | "jtag_emu0", "secure_indicator", NULL, "gpio_127", | ||
349 | NULL, NULL, NULL, "safe_mode"), | ||
350 | _OMAP2430_MUXENTRY(JTAG_EMU1, 126, | ||
351 | "jtag_emu1", NULL, NULL, "gpio_126", | ||
352 | NULL, NULL, NULL, "safe_mode"), | ||
353 | _OMAP2430_MUXENTRY(MCBSP1_CLKR, 92, | ||
354 | "mcbsp1_clkr", "ssi2_dat_tx", NULL, "gpio_92", | ||
355 | NULL, NULL, NULL, "safe_mode"), | ||
356 | _OMAP2430_MUXENTRY(MCBSP1_CLKX, 98, | ||
357 | "mcbsp1_clkx", "ssi2_wake", NULL, "gpio_98", | ||
358 | NULL, NULL, NULL, "safe_mode"), | ||
359 | _OMAP2430_MUXENTRY(MCBSP1_DR, 95, | ||
360 | "mcbsp1_dr", "ssi2_dat_rx", NULL, "gpio_95", | ||
361 | NULL, NULL, NULL, "safe_mode"), | ||
362 | _OMAP2430_MUXENTRY(MCBSP1_DX, 94, | ||
363 | "mcbsp1_dx", "ssi2_rdy_tx", NULL, "gpio_94", | ||
364 | NULL, NULL, NULL, "safe_mode"), | ||
365 | _OMAP2430_MUXENTRY(MCBSP1_FSR, 93, | ||
366 | "mcbsp1_fsr", "ssi2_flag_tx", NULL, "gpio_93", | ||
367 | "spi2_cs1", NULL, NULL, "safe_mode"), | ||
368 | _OMAP2430_MUXENTRY(MCBSP1_FSX, 97, | ||
369 | "mcbsp1_fsx", "ssi2_rdy_rx", NULL, "gpio_97", | ||
370 | NULL, NULL, NULL, "safe_mode"), | ||
371 | _OMAP2430_MUXENTRY(MCBSP2_CLKX, 147, | ||
372 | "mcbsp2_clkx", "sdi_clkp", "dss_data23", "gpio_147", | ||
373 | NULL, NULL, NULL, "safe_mode"), | ||
374 | _OMAP2430_MUXENTRY(MCBSP2_DR, 144, | ||
375 | "mcbsp2_dr", "sdi_clkn", "dss_data22", "gpio_144", | ||
376 | NULL, NULL, NULL, "safe_mode"), | ||
377 | _OMAP2430_MUXENTRY(MCBSP3_CLKX, 71, | ||
378 | "mcbsp3_clkx", NULL, NULL, "gpio_71", | ||
379 | NULL, NULL, NULL, "safe_mode"), | ||
380 | _OMAP2430_MUXENTRY(MCBSP3_DR, 73, | ||
381 | "mcbsp3_dr", NULL, NULL, "gpio_73", | ||
382 | NULL, NULL, NULL, "safe_mode"), | ||
383 | _OMAP2430_MUXENTRY(MCBSP3_DX, 74, | ||
384 | "mcbsp3_dx", NULL, "sti_clk", "gpio_74", | ||
385 | NULL, NULL, NULL, "safe_mode"), | ||
386 | _OMAP2430_MUXENTRY(MCBSP3_FSX, 72, | ||
387 | "mcbsp3_fsx", NULL, NULL, "gpio_72", | ||
388 | NULL, NULL, NULL, "safe_mode"), | ||
389 | _OMAP2430_MUXENTRY(MCBSP_CLKS, 96, | ||
390 | "mcbsp_clks", "ssi2_flag_rx", NULL, "gpio_96", | ||
391 | NULL, NULL, NULL, "safe_mode"), | ||
392 | _OMAP2430_MUXENTRY(SDMMC1_CLKO, 0, | ||
393 | "sdmmc1_clko", "ms_clko", NULL, NULL, | ||
394 | NULL, "hw_dbg9", "hw_dbg3", "safe_mode"), | ||
395 | _OMAP2430_MUXENTRY(SDMMC1_CMD, 0, | ||
396 | "sdmmc1_cmd", "ms_bs", NULL, NULL, | ||
397 | NULL, "hw_dbg8", "hw_dbg2", "safe_mode"), | ||
398 | _OMAP2430_MUXENTRY(SDMMC1_DAT0, 0, | ||
399 | "sdmmc1_dat0", "ms_dat0", NULL, NULL, | ||
400 | NULL, "hw_dbg7", "hw_dbg1", "safe_mode"), | ||
401 | _OMAP2430_MUXENTRY(SDMMC1_DAT1, 75, | ||
402 | "sdmmc1_dat1", "ms_dat1", NULL, "gpio_75", | ||
403 | NULL, "hw_dbg6", "hw_dbg0", "safe_mode"), | ||
404 | _OMAP2430_MUXENTRY(SDMMC1_DAT2, 0, | ||
405 | "sdmmc1_dat2", "ms_dat2", NULL, NULL, | ||
406 | NULL, "hw_dbg5", "hw_dbg10", "safe_mode"), | ||
407 | _OMAP2430_MUXENTRY(SDMMC1_DAT3, 0, | ||
408 | "sdmmc1_dat3", "ms_dat3", NULL, NULL, | ||
409 | NULL, "hw_dbg4", "hw_dbg11", "safe_mode"), | ||
410 | _OMAP2430_MUXENTRY(SDMMC2_CLKO, 13, | ||
411 | "sdmmc2_clko", NULL, NULL, "gpio_13", | ||
412 | NULL, "spi3_clk", NULL, "safe_mode"), | ||
413 | _OMAP2430_MUXENTRY(SDMMC2_CMD, 15, | ||
414 | "sdmmc2_cmd", "usb2_rcv", NULL, "gpio_15", | ||
415 | NULL, "spi3_simo", NULL, "safe_mode"), | ||
416 | _OMAP2430_MUXENTRY(SDMMC2_DAT0, 16, | ||
417 | "sdmmc2_dat0", "usb2_tllse0", NULL, "gpio_16", | ||
418 | NULL, "spi3_somi", NULL, "safe_mode"), | ||
419 | _OMAP2430_MUXENTRY(SDMMC2_DAT1, 58, | ||
420 | "sdmmc2_dat1", "usb2_txen", NULL, "gpio_58", | ||
421 | NULL, NULL, NULL, "safe_mode"), | ||
422 | _OMAP2430_MUXENTRY(SDMMC2_DAT2, 17, | ||
423 | "sdmmc2_dat2", "usb2_dat", NULL, "gpio_17", | ||
424 | NULL, "spi3_cs1", NULL, "safe_mode"), | ||
425 | _OMAP2430_MUXENTRY(SDMMC2_DAT3, 14, | ||
426 | "sdmmc2_dat3", "usb2_se0", NULL, "gpio_14", | ||
427 | NULL, "spi3_cs0", NULL, "safe_mode"), | ||
428 | _OMAP2430_MUXENTRY(SDRC_A12, 2, | ||
429 | "sdrc_a12", NULL, NULL, "gpio_2", | ||
430 | NULL, NULL, NULL, "safe_mode"), | ||
431 | _OMAP2430_MUXENTRY(SDRC_A13, 1, | ||
432 | "sdrc_a13", NULL, NULL, "gpio_1", | ||
433 | NULL, NULL, NULL, "safe_mode"), | ||
434 | _OMAP2430_MUXENTRY(SDRC_A14, 0, | ||
435 | "sdrc_a14", NULL, NULL, "gpio_0", | ||
436 | NULL, NULL, NULL, "safe_mode"), | ||
437 | _OMAP2430_MUXENTRY(SDRC_CKE1, 36, | ||
438 | "sdrc_cke1", NULL, NULL, "gpio_36", | ||
439 | NULL, NULL, NULL, "safe_mode"), | ||
440 | _OMAP2430_MUXENTRY(SDRC_NCS1, 37, | ||
441 | "sdrc_ncs1", NULL, NULL, "gpio_37", | ||
442 | NULL, NULL, NULL, "safe_mode"), | ||
443 | _OMAP2430_MUXENTRY(SPI1_CLK, 81, | ||
444 | "spi1_clk", NULL, NULL, "gpio_81", | ||
445 | NULL, NULL, NULL, "safe_mode"), | ||
446 | _OMAP2430_MUXENTRY(SPI1_CS0, 84, | ||
447 | "spi1_cs0", NULL, NULL, "gpio_84", | ||
448 | NULL, NULL, NULL, "safe_mode"), | ||
449 | _OMAP2430_MUXENTRY(SPI1_CS1, 85, | ||
450 | "spi1_cs1", NULL, NULL, "gpio_85", | ||
451 | NULL, NULL, NULL, "safe_mode"), | ||
452 | _OMAP2430_MUXENTRY(SPI1_CS2, 86, | ||
453 | "spi1_cs2", NULL, NULL, "gpio_86", | ||
454 | NULL, NULL, NULL, "safe_mode"), | ||
455 | _OMAP2430_MUXENTRY(SPI1_CS3, 87, | ||
456 | "spi1_cs3", "spi2_cs1", NULL, "gpio_87", | ||
457 | NULL, NULL, NULL, "safe_mode"), | ||
458 | _OMAP2430_MUXENTRY(SPI1_SIMO, 82, | ||
459 | "spi1_simo", NULL, NULL, "gpio_82", | ||
460 | NULL, NULL, NULL, "safe_mode"), | ||
461 | _OMAP2430_MUXENTRY(SPI1_SOMI, 83, | ||
462 | "spi1_somi", NULL, NULL, "gpio_83", | ||
463 | NULL, NULL, NULL, "safe_mode"), | ||
464 | _OMAP2430_MUXENTRY(SPI2_CLK, 88, | ||
465 | "spi2_clk", "gpt9_pwm_evt", NULL, "gpio_88", | ||
466 | NULL, NULL, NULL, "safe_mode"), | ||
467 | _OMAP2430_MUXENTRY(SPI2_CS0, 91, | ||
468 | "spi2_cs0", "gpt12_pwm_evt", NULL, "gpio_91", | ||
469 | NULL, NULL, NULL, "safe_mode"), | ||
470 | _OMAP2430_MUXENTRY(SPI2_SIMO, 89, | ||
471 | "spi2_simo", "gpt10_pwm_evt", NULL, "gpio_89", | ||
472 | NULL, NULL, NULL, "safe_mode"), | ||
473 | _OMAP2430_MUXENTRY(SPI2_SOMI, 90, | ||
474 | "spi2_somi", "gpt11_pwm_evt", NULL, "gpio_90", | ||
475 | NULL, NULL, NULL, "safe_mode"), | ||
476 | _OMAP2430_MUXENTRY(SSI1_DAT_RX, 62, | ||
477 | "ssi1_dat_rx", "uart1_rx", "usb1_dat", "gpio_62", | ||
478 | NULL, NULL, NULL, "safe_mode"), | ||
479 | _OMAP2430_MUXENTRY(SSI1_DAT_TX, 59, | ||
480 | "ssi1_dat_tx", "uart1_tx", "usb1_se0", "gpio_59", | ||
481 | NULL, NULL, NULL, "safe_mode"), | ||
482 | _OMAP2430_MUXENTRY(SSI1_FLAG_RX, 64, | ||
483 | "ssi1_flag_rx", "mcbsp4_dr", NULL, "gpio_64", | ||
484 | NULL, NULL, NULL, "safe_mode"), | ||
485 | _OMAP2430_MUXENTRY(SSI1_FLAG_TX, 60, | ||
486 | "ssi1_flag_tx", "uart1_rts", "usb1_rcv", "gpio_60", | ||
487 | NULL, NULL, NULL, "safe_mode"), | ||
488 | _OMAP2430_MUXENTRY(SSI1_RDY_RX, 65, | ||
489 | "ssi1_rdy_rx", "mcbsp4_dx", NULL, "gpio_65", | ||
490 | NULL, NULL, NULL, "safe_mode"), | ||
491 | _OMAP2430_MUXENTRY(SSI1_RDY_TX, 61, | ||
492 | "ssi1_rdy_tx", "uart1_cts", "usb1_txen", "gpio_61", | ||
493 | NULL, NULL, NULL, "safe_mode"), | ||
494 | _OMAP2430_MUXENTRY(SSI1_WAKE, 66, | ||
495 | "ssi1_wake", "mcbsp4_fsx", NULL, "gpio_66", | ||
496 | NULL, NULL, NULL, "safe_mode"), | ||
497 | _OMAP2430_MUXENTRY(SYS_CLKOUT, 111, | ||
498 | "sys_clkout", NULL, NULL, "gpio_111", | ||
499 | NULL, NULL, NULL, "safe_mode"), | ||
500 | _OMAP2430_MUXENTRY(SYS_DRM_MSECURE, 118, | ||
501 | "sys_drm_msecure", NULL, "sys_ndmareq6", "gpio_118", | ||
502 | NULL, NULL, NULL, "safe_mode"), | ||
503 | _OMAP2430_MUXENTRY(SYS_NIRQ0, 56, | ||
504 | "sys_nirq0", NULL, NULL, "gpio_56", | ||
505 | NULL, NULL, NULL, "safe_mode"), | ||
506 | _OMAP2430_MUXENTRY(SYS_NIRQ1, 125, | ||
507 | "sys_nirq1", NULL, "sys_ndmareq5", "gpio_125", | ||
508 | NULL, NULL, NULL, "safe_mode"), | ||
509 | _OMAP2430_MUXENTRY(UART1_CTS, 32, | ||
510 | "uart1_cts", "sdi_vsync", "dss_data18", "gpio_32", | ||
511 | "mcbsp5_clkx", NULL, NULL, "safe_mode"), | ||
512 | _OMAP2430_MUXENTRY(UART1_RTS, 8, | ||
513 | "uart1_rts", "sdi_hsync", "dss_data19", "gpio_8", | ||
514 | "mcbsp5_fsx", NULL, NULL, "safe_mode"), | ||
515 | _OMAP2430_MUXENTRY(UART1_RX, 10, | ||
516 | "uart1_rx", "sdi_stp", "dss_data21", "gpio_10", | ||
517 | "mcbsp5_dr", NULL, NULL, "safe_mode"), | ||
518 | _OMAP2430_MUXENTRY(UART1_TX, 9, | ||
519 | "uart1_tx", "sdi_den", "dss_data20", "gpio_9", | ||
520 | "mcbsp5_dx", NULL, NULL, "safe_mode"), | ||
521 | _OMAP2430_MUXENTRY(UART2_CTS, 67, | ||
522 | "uart2_cts", "usb1_rcv", "gpt9_pwm_evt", "gpio_67", | ||
523 | NULL, NULL, NULL, "safe_mode"), | ||
524 | _OMAP2430_MUXENTRY(UART2_RTS, 68, | ||
525 | "uart2_rts", "usb1_txen", "gpt10_pwm_evt", "gpio_68", | ||
526 | NULL, NULL, NULL, "safe_mode"), | ||
527 | _OMAP2430_MUXENTRY(UART2_RX, 70, | ||
528 | "uart2_rx", "usb1_dat", "gpt12_pwm_evt", "gpio_70", | ||
529 | NULL, NULL, NULL, "safe_mode"), | ||
530 | _OMAP2430_MUXENTRY(UART2_TX, 69, | ||
531 | "uart2_tx", "usb1_se0", "gpt11_pwm_evt", "gpio_69", | ||
532 | NULL, NULL, NULL, "safe_mode"), | ||
533 | _OMAP2430_MUXENTRY(UART3_CTS_RCTX, 102, | ||
534 | "uart3_cts_rctx", "uart3_rx_irrx", NULL, "gpio_102", | ||
535 | NULL, NULL, NULL, "safe_mode"), | ||
536 | _OMAP2430_MUXENTRY(UART3_RTS_SD, 103, | ||
537 | "uart3_rts_sd", "uart3_tx_irtx", NULL, "gpio_103", | ||
538 | NULL, NULL, NULL, "safe_mode"), | ||
539 | _OMAP2430_MUXENTRY(UART3_RX_IRRX, 105, | ||
540 | "uart3_rx_irrx", NULL, NULL, "gpio_105", | ||
541 | NULL, NULL, NULL, "safe_mode"), | ||
542 | _OMAP2430_MUXENTRY(UART3_TX_IRTX, 104, | ||
543 | "uart3_tx_irtx", "uart3_cts_rctx", NULL, "gpio_104", | ||
544 | NULL, NULL, NULL, "safe_mode"), | ||
545 | _OMAP2430_MUXENTRY(USB0HS_CLK, 120, | ||
546 | "usb0hs_clk", NULL, NULL, "gpio_120", | ||
547 | NULL, NULL, NULL, "safe_mode"), | ||
548 | _OMAP2430_MUXENTRY(USB0HS_DATA0, 0, | ||
549 | "usb0hs_data0", "uart3_tx_irtx", NULL, NULL, | ||
550 | "usb0_txen", NULL, NULL, "safe_mode"), | ||
551 | _OMAP2430_MUXENTRY(USB0HS_DATA1, 0, | ||
552 | "usb0hs_data1", "uart3_rx_irrx", NULL, NULL, | ||
553 | "usb0_dat", NULL, NULL, "safe_mode"), | ||
554 | _OMAP2430_MUXENTRY(USB0HS_DATA2, 0, | ||
555 | "usb0hs_data2", "uart3_rts_sd", NULL, NULL, | ||
556 | "usb0_se0", NULL, NULL, "safe_mode"), | ||
557 | _OMAP2430_MUXENTRY(USB0HS_DATA3, 106, | ||
558 | "usb0hs_data3", NULL, "uart3_cts_rctx", "gpio_106", | ||
559 | "usb0_puen", NULL, NULL, "safe_mode"), | ||
560 | _OMAP2430_MUXENTRY(USB0HS_DATA4, 107, | ||
561 | "usb0hs_data4", "mcbsp2_dr", NULL, "gpio_107", | ||
562 | "usb0_vp", NULL, NULL, "safe_mode"), | ||
563 | _OMAP2430_MUXENTRY(USB0HS_DATA5, 108, | ||
564 | "usb0hs_data5", "mcbsp2_dx", NULL, "gpio_108", | ||
565 | "usb0_vm", NULL, NULL, "safe_mode"), | ||
566 | _OMAP2430_MUXENTRY(USB0HS_DATA6, 109, | ||
567 | "usb0hs_data6", "mcbsp2_fsx", NULL, "gpio_109", | ||
568 | "usb0_rcv", NULL, NULL, "safe_mode"), | ||
569 | _OMAP2430_MUXENTRY(USB0HS_DATA7, 124, | ||
570 | "usb0hs_data7", "mcbsp2_clkx", NULL, "gpio_124", | ||
571 | NULL, NULL, NULL, "safe_mode"), | ||
572 | _OMAP2430_MUXENTRY(USB0HS_DIR, 121, | ||
573 | "usb0hs_dir", NULL, NULL, "gpio_121", | ||
574 | NULL, NULL, NULL, "safe_mode"), | ||
575 | _OMAP2430_MUXENTRY(USB0HS_NXT, 123, | ||
576 | "usb0hs_nxt", NULL, NULL, "gpio_123", | ||
577 | NULL, NULL, NULL, "safe_mode"), | ||
578 | _OMAP2430_MUXENTRY(USB0HS_STP, 122, | ||
579 | "usb0hs_stp", NULL, NULL, "gpio_122", | ||
580 | NULL, NULL, NULL, "safe_mode"), | ||
581 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
582 | }; | ||
583 | |||
584 | /* | ||
585 | * Balls for POP package | ||
586 | * 447-pin s-PBGA Package, 0.00mm Ball Pitch (Bottom) | ||
587 | */ | ||
588 | #ifdef CONFIG_DEBUG_FS | ||
589 | struct omap_ball __initdata omap2430_pop_ball[] = { | ||
590 | _OMAP2430_BALLENTRY(CAM_D0, "t8", NULL), | ||
591 | _OMAP2430_BALLENTRY(CAM_D1, "t4", NULL), | ||
592 | _OMAP2430_BALLENTRY(CAM_D10, "r4", NULL), | ||
593 | _OMAP2430_BALLENTRY(CAM_D11, "w3", NULL), | ||
594 | _OMAP2430_BALLENTRY(CAM_D2, "r2", NULL), | ||
595 | _OMAP2430_BALLENTRY(CAM_D3, "u3", NULL), | ||
596 | _OMAP2430_BALLENTRY(CAM_D4, "u2", NULL), | ||
597 | _OMAP2430_BALLENTRY(CAM_D5, "v1", NULL), | ||
598 | _OMAP2430_BALLENTRY(CAM_D6, "t3", NULL), | ||
599 | _OMAP2430_BALLENTRY(CAM_D7, "r3", NULL), | ||
600 | _OMAP2430_BALLENTRY(CAM_D8, "u7", NULL), | ||
601 | _OMAP2430_BALLENTRY(CAM_D9, "t7", NULL), | ||
602 | _OMAP2430_BALLENTRY(CAM_HS, "p2", NULL), | ||
603 | _OMAP2430_BALLENTRY(CAM_LCLK, "r7", NULL), | ||
604 | _OMAP2430_BALLENTRY(CAM_VS, "n2", NULL), | ||
605 | _OMAP2430_BALLENTRY(CAM_XCLK, "p3", NULL), | ||
606 | _OMAP2430_BALLENTRY(DSS_ACBIAS, "y3", NULL), | ||
607 | _OMAP2430_BALLENTRY(DSS_DATA0, "v8", NULL), | ||
608 | _OMAP2430_BALLENTRY(DSS_DATA1, "w1", NULL), | ||
609 | _OMAP2430_BALLENTRY(DSS_DATA10, "k25", NULL), | ||
610 | _OMAP2430_BALLENTRY(DSS_DATA11, "j25", NULL), | ||
611 | _OMAP2430_BALLENTRY(DSS_DATA12, "k24", NULL), | ||
612 | _OMAP2430_BALLENTRY(DSS_DATA13, "j24", NULL), | ||
613 | _OMAP2430_BALLENTRY(DSS_DATA14, "h25", NULL), | ||
614 | _OMAP2430_BALLENTRY(DSS_DATA15, "g25", NULL), | ||
615 | _OMAP2430_BALLENTRY(DSS_DATA16, "ac3", NULL), | ||
616 | _OMAP2430_BALLENTRY(DSS_DATA17, "y7", NULL), | ||
617 | _OMAP2430_BALLENTRY(DSS_DATA2, "u8", NULL), | ||
618 | _OMAP2430_BALLENTRY(DSS_DATA3, "u4", NULL), | ||
619 | _OMAP2430_BALLENTRY(DSS_DATA4, "v3", NULL), | ||
620 | _OMAP2430_BALLENTRY(DSS_DATA5, "aa4", NULL), | ||
621 | _OMAP2430_BALLENTRY(DSS_DATA6, "w8", NULL), | ||
622 | _OMAP2430_BALLENTRY(DSS_DATA7, "y1", NULL), | ||
623 | _OMAP2430_BALLENTRY(DSS_DATA8, "aa2", NULL), | ||
624 | _OMAP2430_BALLENTRY(DSS_DATA9, "ab4", NULL), | ||
625 | _OMAP2430_BALLENTRY(DSS_HSYNC, "v2", NULL), | ||
626 | _OMAP2430_BALLENTRY(GPIO_113, "ad16", NULL), | ||
627 | _OMAP2430_BALLENTRY(GPIO_114, "ac10", NULL), | ||
628 | _OMAP2430_BALLENTRY(GPIO_115, "ad13", NULL), | ||
629 | _OMAP2430_BALLENTRY(GPIO_116, "ae15", NULL), | ||
630 | _OMAP2430_BALLENTRY(GPIO_128, "p1", NULL), | ||
631 | _OMAP2430_BALLENTRY(GPIO_129, "r1", NULL), | ||
632 | _OMAP2430_BALLENTRY(GPIO_130, "p7", NULL), | ||
633 | _OMAP2430_BALLENTRY(GPIO_131, "l8", NULL), | ||
634 | _OMAP2430_BALLENTRY(GPIO_132, "w24", NULL), | ||
635 | _OMAP2430_BALLENTRY(GPIO_133, "aa24", NULL), | ||
636 | _OMAP2430_BALLENTRY(GPIO_134, "ae12", NULL), | ||
637 | _OMAP2430_BALLENTRY(GPIO_135, "ae11", NULL), | ||
638 | _OMAP2430_BALLENTRY(GPIO_136, "ad12", NULL), | ||
639 | _OMAP2430_BALLENTRY(GPIO_137, "ad11", NULL), | ||
640 | _OMAP2430_BALLENTRY(GPIO_138, "y12", NULL), | ||
641 | _OMAP2430_BALLENTRY(GPIO_139, "ad17", NULL), | ||
642 | _OMAP2430_BALLENTRY(GPIO_140, "l7", NULL), | ||
643 | _OMAP2430_BALLENTRY(GPIO_141, "ac24", NULL), | ||
644 | _OMAP2430_BALLENTRY(GPIO_142, "m3", NULL), | ||
645 | _OMAP2430_BALLENTRY(GPIO_148, "af12", NULL), | ||
646 | _OMAP2430_BALLENTRY(GPIO_149, "k7", NULL), | ||
647 | _OMAP2430_BALLENTRY(GPIO_150, "m1", NULL), | ||
648 | _OMAP2430_BALLENTRY(GPIO_151, "ad14", NULL), | ||
649 | _OMAP2430_BALLENTRY(GPIO_152, "ad18", NULL), | ||
650 | _OMAP2430_BALLENTRY(GPIO_153, "u24", NULL), | ||
651 | _OMAP2430_BALLENTRY(GPIO_154, "ae16", NULL), | ||
652 | _OMAP2430_BALLENTRY(GPIO_63, "n3", NULL), | ||
653 | _OMAP2430_BALLENTRY(GPIO_7, "ac23", NULL), | ||
654 | _OMAP2430_BALLENTRY(GPIO_78, "ad10", NULL), | ||
655 | _OMAP2430_BALLENTRY(GPIO_79, "ae10", NULL), | ||
656 | _OMAP2430_BALLENTRY(GPIO_80, "ae13", NULL), | ||
657 | _OMAP2430_BALLENTRY(GPMC_A1, "a9", NULL), | ||
658 | _OMAP2430_BALLENTRY(GPMC_A10, "g12", NULL), | ||
659 | _OMAP2430_BALLENTRY(GPMC_A2, "b8", NULL), | ||
660 | _OMAP2430_BALLENTRY(GPMC_A3, "g10", NULL), | ||
661 | _OMAP2430_BALLENTRY(GPMC_A4, "g11", NULL), | ||
662 | _OMAP2430_BALLENTRY(GPMC_A5, "a10", NULL), | ||
663 | _OMAP2430_BALLENTRY(GPMC_A6, "g13", NULL), | ||
664 | _OMAP2430_BALLENTRY(GPMC_A7, "a6", NULL), | ||
665 | _OMAP2430_BALLENTRY(GPMC_A8, "h1", NULL), | ||
666 | _OMAP2430_BALLENTRY(GPMC_A9, "c8", NULL), | ||
667 | _OMAP2430_BALLENTRY(GPMC_CLK, "n1", "l1"), | ||
668 | _OMAP2430_BALLENTRY(GPMC_D10, "d1", "n1"), | ||
669 | _OMAP2430_BALLENTRY(GPMC_D11, "d2", "p2"), | ||
670 | _OMAP2430_BALLENTRY(GPMC_D12, "e1", "p1"), | ||
671 | _OMAP2430_BALLENTRY(GPMC_D13, "e3", "m1"), | ||
672 | _OMAP2430_BALLENTRY(GPMC_D14, "c7", "j2"), | ||
673 | _OMAP2430_BALLENTRY(GPMC_D15, "f3", "k2"), | ||
674 | _OMAP2430_BALLENTRY(GPMC_D8, "e2", "r1"), | ||
675 | _OMAP2430_BALLENTRY(GPMC_D9, "ab1", "t1"), | ||
676 | _OMAP2430_BALLENTRY(GPMC_NCS1, "ac1", "w1"), | ||
677 | _OMAP2430_BALLENTRY(GPMC_NCS2, "c6", NULL), | ||
678 | _OMAP2430_BALLENTRY(GPMC_NCS3, "b9", NULL), | ||
679 | _OMAP2430_BALLENTRY(GPMC_NCS4, "b4", NULL), | ||
680 | _OMAP2430_BALLENTRY(GPMC_NCS5, "a4", NULL), | ||
681 | _OMAP2430_BALLENTRY(GPMC_NCS6, "f1", NULL), | ||
682 | _OMAP2430_BALLENTRY(GPMC_NCS7, "a7", NULL), | ||
683 | _OMAP2430_BALLENTRY(GPMC_WAIT1, "j1", "y8"), | ||
684 | _OMAP2430_BALLENTRY(GPMC_WAIT2, "b7", NULL), | ||
685 | _OMAP2430_BALLENTRY(GPMC_WAIT3, "g14", NULL), | ||
686 | _OMAP2430_BALLENTRY(HDQ_SIO, "h20", NULL), | ||
687 | _OMAP2430_BALLENTRY(I2C1_SCL, "y17", NULL), | ||
688 | _OMAP2430_BALLENTRY(I2C1_SDA, "ac19", NULL), | ||
689 | _OMAP2430_BALLENTRY(I2C2_SCL, "n7", NULL), | ||
690 | _OMAP2430_BALLENTRY(I2C2_SDA, "m4", NULL), | ||
691 | _OMAP2430_BALLENTRY(JTAG_EMU0, "e25", NULL), | ||
692 | _OMAP2430_BALLENTRY(JTAG_EMU1, "e24", NULL), | ||
693 | _OMAP2430_BALLENTRY(MCBSP1_CLKR, "ab2", NULL), | ||
694 | _OMAP2430_BALLENTRY(MCBSP1_CLKX, "y9", NULL), | ||
695 | _OMAP2430_BALLENTRY(MCBSP1_DR, "af3", NULL), | ||
696 | _OMAP2430_BALLENTRY(MCBSP1_DX, "aa1", NULL), | ||
697 | _OMAP2430_BALLENTRY(MCBSP1_FSR, "ad5", NULL), | ||
698 | _OMAP2430_BALLENTRY(MCBSP1_FSX, "ab3", NULL), | ||
699 | _OMAP2430_BALLENTRY(MCBSP2_CLKX, "j26", NULL), | ||
700 | _OMAP2430_BALLENTRY(MCBSP2_DR, "k26", NULL), | ||
701 | _OMAP2430_BALLENTRY(MCBSP3_CLKX, "ac9", NULL), | ||
702 | _OMAP2430_BALLENTRY(MCBSP3_DR, "ae2", NULL), | ||
703 | _OMAP2430_BALLENTRY(MCBSP3_DX, "af4", NULL), | ||
704 | _OMAP2430_BALLENTRY(MCBSP3_FSX, "ae4", NULL), | ||
705 | _OMAP2430_BALLENTRY(MCBSP_CLKS, "ad6", NULL), | ||
706 | _OMAP2430_BALLENTRY(SDMMC1_CLKO, "n23", NULL), | ||
707 | _OMAP2430_BALLENTRY(SDMMC1_CMD, "l23", NULL), | ||
708 | _OMAP2430_BALLENTRY(SDMMC1_DAT0, "m24", NULL), | ||
709 | _OMAP2430_BALLENTRY(SDMMC1_DAT1, "p23", NULL), | ||
710 | _OMAP2430_BALLENTRY(SDMMC1_DAT2, "t20", NULL), | ||
711 | _OMAP2430_BALLENTRY(SDMMC1_DAT3, "r20", NULL), | ||
712 | _OMAP2430_BALLENTRY(SDMMC2_CLKO, "v26", NULL), | ||
713 | _OMAP2430_BALLENTRY(SDMMC2_CMD, "w20", NULL), | ||
714 | _OMAP2430_BALLENTRY(SDMMC2_DAT0, "v23", NULL), | ||
715 | _OMAP2430_BALLENTRY(SDMMC2_DAT1, "y24", NULL), | ||
716 | _OMAP2430_BALLENTRY(SDMMC2_DAT2, "v25", NULL), | ||
717 | _OMAP2430_BALLENTRY(SDMMC2_DAT3, "v24", NULL), | ||
718 | _OMAP2430_BALLENTRY(SDRC_A12, "w26", "r21"), | ||
719 | _OMAP2430_BALLENTRY(SDRC_A13, "af20", "aa15"), | ||
720 | _OMAP2430_BALLENTRY(SDRC_A14, "af16", "y12"), | ||
721 | _OMAP2430_BALLENTRY(SDRC_CKE1, "af15", "y13"), | ||
722 | _OMAP2430_BALLENTRY(SDRC_NCS1, "aa25", "t20"), | ||
723 | _OMAP2430_BALLENTRY(SPI1_CLK, "y18", NULL), | ||
724 | _OMAP2430_BALLENTRY(SPI1_CS0, "u1", NULL), | ||
725 | _OMAP2430_BALLENTRY(SPI1_CS1, "af19", NULL), | ||
726 | _OMAP2430_BALLENTRY(SPI1_CS2, "ae19", NULL), | ||
727 | _OMAP2430_BALLENTRY(SPI1_CS3, "h24", NULL), | ||
728 | _OMAP2430_BALLENTRY(SPI1_SIMO, "ad15", NULL), | ||
729 | _OMAP2430_BALLENTRY(SPI1_SOMI, "ae17", NULL), | ||
730 | _OMAP2430_BALLENTRY(SPI2_CLK, "y20", NULL), | ||
731 | _OMAP2430_BALLENTRY(SPI2_CS0, "y19", NULL), | ||
732 | _OMAP2430_BALLENTRY(SPI2_SIMO, "ac20", NULL), | ||
733 | _OMAP2430_BALLENTRY(SPI2_SOMI, "ad19", NULL), | ||
734 | _OMAP2430_BALLENTRY(SSI1_DAT_RX, "aa26", NULL), | ||
735 | _OMAP2430_BALLENTRY(SSI1_DAT_TX, "ad24", NULL), | ||
736 | _OMAP2430_BALLENTRY(SSI1_FLAG_RX, "ad23", NULL), | ||
737 | _OMAP2430_BALLENTRY(SSI1_FLAG_TX, "ab24", NULL), | ||
738 | _OMAP2430_BALLENTRY(SSI1_RDY_RX, "ab25", NULL), | ||
739 | _OMAP2430_BALLENTRY(SSI1_RDY_TX, "y25", NULL), | ||
740 | _OMAP2430_BALLENTRY(SSI1_WAKE, "ac25", NULL), | ||
741 | _OMAP2430_BALLENTRY(SYS_CLKOUT, "r25", NULL), | ||
742 | _OMAP2430_BALLENTRY(SYS_DRM_MSECURE, "ae3", NULL), | ||
743 | _OMAP2430_BALLENTRY(SYS_NIRQ0, "w25", NULL), | ||
744 | _OMAP2430_BALLENTRY(SYS_NIRQ1, "ad21", NULL), | ||
745 | _OMAP2430_BALLENTRY(UART1_CTS, "p24", NULL), | ||
746 | _OMAP2430_BALLENTRY(UART1_RTS, "p25", NULL), | ||
747 | _OMAP2430_BALLENTRY(UART1_RX, "n24", NULL), | ||
748 | _OMAP2430_BALLENTRY(UART1_TX, "r24", NULL), | ||
749 | _OMAP2430_BALLENTRY(UART2_CTS, "u25", NULL), | ||
750 | _OMAP2430_BALLENTRY(UART2_RTS, "t23", NULL), | ||
751 | _OMAP2430_BALLENTRY(UART2_RX, "t24", NULL), | ||
752 | _OMAP2430_BALLENTRY(UART2_TX, "u20", NULL), | ||
753 | _OMAP2430_BALLENTRY(UART3_CTS_RCTX, "m2", NULL), | ||
754 | _OMAP2430_BALLENTRY(UART3_RTS_SD, "k2", NULL), | ||
755 | _OMAP2430_BALLENTRY(UART3_RX_IRRX, "l3", NULL), | ||
756 | _OMAP2430_BALLENTRY(UART3_TX_IRTX, "l2", NULL), | ||
757 | _OMAP2430_BALLENTRY(USB0HS_CLK, "ae8", NULL), | ||
758 | _OMAP2430_BALLENTRY(USB0HS_DATA0, "ad4", NULL), | ||
759 | _OMAP2430_BALLENTRY(USB0HS_DATA1, "ae6", NULL), | ||
760 | _OMAP2430_BALLENTRY(USB0HS_DATA2, "af9", NULL), | ||
761 | _OMAP2430_BALLENTRY(USB0HS_DATA3, "ad9", NULL), | ||
762 | _OMAP2430_BALLENTRY(USB0HS_DATA4, "y11", NULL), | ||
763 | _OMAP2430_BALLENTRY(USB0HS_DATA5, "ad7", NULL), | ||
764 | _OMAP2430_BALLENTRY(USB0HS_DATA6, "ae7", NULL), | ||
765 | _OMAP2430_BALLENTRY(USB0HS_DATA7, "ac7", NULL), | ||
766 | _OMAP2430_BALLENTRY(USB0HS_DIR, "ad8", NULL), | ||
767 | _OMAP2430_BALLENTRY(USB0HS_NXT, "ae9", NULL), | ||
768 | _OMAP2430_BALLENTRY(USB0HS_STP, "ae5", NULL), | ||
769 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
770 | }; | ||
771 | #else | ||
772 | #define omap2430_pop_ball NULL | ||
773 | #endif | ||
774 | |||
775 | int __init omap2430_mux_init(struct omap_board_mux *board_subset, int flags) | ||
776 | { | ||
777 | struct omap_ball *package_balls = NULL; | ||
778 | |||
779 | switch (flags & OMAP_PACKAGE_MASK) { | ||
780 | case OMAP_PACKAGE_ZAC: | ||
781 | package_balls = omap2430_pop_ball; | ||
782 | break; | ||
783 | default: | ||
784 | pr_warning("mux: No ball data available for omap2420 package\n"); | ||
785 | } | ||
786 | |||
787 | return omap_mux_init(OMAP2430_CONTROL_PADCONF_MUX_PBASE, | ||
788 | OMAP2430_CONTROL_PADCONF_MUX_SIZE, | ||
789 | omap2430_muxmodes, NULL, board_subset, | ||
790 | package_balls); | ||
791 | } | ||
diff --git a/arch/arm/mach-omap2/mux2430.h b/arch/arm/mach-omap2/mux2430.h new file mode 100644 index 000000000000..adbea0d03e08 --- /dev/null +++ b/arch/arm/mach-omap2/mux2430.h | |||
@@ -0,0 +1,370 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Nokia | ||
3 | * Copyright (C) 2009 Texas Instruments | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #define OMAP2430_CONTROL_PADCONF_MUX_PBASE 0x49002030LU | ||
11 | |||
12 | #define OMAP2430_MUX(mode0, mux_value) \ | ||
13 | { \ | ||
14 | .reg_offset = (OMAP2430_CONTROL_PADCONF_##mode0##_OFFSET), \ | ||
15 | .value = (mux_value), \ | ||
16 | } | ||
17 | |||
18 | /* | ||
19 | * OMAP2430 CONTROL_PADCONF* register offsets for pin-muxing | ||
20 | * | ||
21 | * Extracted from the TRM. Add 0x49002030 to these values to get the | ||
22 | * absolute addresses. The name in the macro is the mode-0 name of | ||
23 | * the pin. NOTE: These registers are 8-bits wide. | ||
24 | * | ||
25 | * Note that these defines use SDMMC instead of MMC for compability | ||
26 | * with signal names used in 3630. | ||
27 | */ | ||
28 | #define OMAP2430_CONTROL_PADCONF_GPMC_CLK_OFFSET 0x000 | ||
29 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS0_OFFSET 0x001 | ||
30 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS1_OFFSET 0x002 | ||
31 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS2_OFFSET 0x003 | ||
32 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS3_OFFSET 0x004 | ||
33 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS4_OFFSET 0x005 | ||
34 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS5_OFFSET 0x006 | ||
35 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS6_OFFSET 0x007 | ||
36 | #define OMAP2430_CONTROL_PADCONF_GPMC_NCS7_OFFSET 0x008 | ||
37 | #define OMAP2430_CONTROL_PADCONF_GPMC_NADV_ALE_OFFSET 0x009 | ||
38 | #define OMAP2430_CONTROL_PADCONF_GPMC_NOE_NRE_OFFSET 0x00a | ||
39 | #define OMAP2430_CONTROL_PADCONF_GPMC_NWE_OFFSET 0x00b | ||
40 | #define OMAP2430_CONTROL_PADCONF_GPMC_NBE0_CLE_OFFSET 0x00c | ||
41 | #define OMAP2430_CONTROL_PADCONF_GPMC_NBE1_OFFSET 0x00d | ||
42 | #define OMAP2430_CONTROL_PADCONF_GPMC_NWP_OFFSET 0x00e | ||
43 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT0_OFFSET 0x00f | ||
44 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT1_OFFSET 0x010 | ||
45 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT2_OFFSET 0x011 | ||
46 | #define OMAP2430_CONTROL_PADCONF_GPMC_WAIT3_OFFSET 0x012 | ||
47 | #define OMAP2430_CONTROL_PADCONF_SDRC_CLK_OFFSET 0x013 | ||
48 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCLK_OFFSET 0x014 | ||
49 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCS0_OFFSET 0x015 | ||
50 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCS1_OFFSET 0x016 | ||
51 | #define OMAP2430_CONTROL_PADCONF_SDRC_CKE0_OFFSET 0x017 | ||
52 | #define OMAP2430_CONTROL_PADCONF_SDRC_CKE1_OFFSET 0x018 | ||
53 | #define OMAP2430_CONTROL_PADCONF_SDRC_NRAS_OFFSET 0x019 | ||
54 | #define OMAP2430_CONTROL_PADCONF_SDRC_NCAS_OFFSET 0x01a | ||
55 | #define OMAP2430_CONTROL_PADCONF_SDRC_NWE_OFFSET 0x01b | ||
56 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM0_OFFSET 0x01c | ||
57 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM1_OFFSET 0x01d | ||
58 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM2_OFFSET 0x01e | ||
59 | #define OMAP2430_CONTROL_PADCONF_SDRC_DM3_OFFSET 0x01f | ||
60 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS0_OFFSET 0x020 | ||
61 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS1_OFFSET 0x021 | ||
62 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS2_OFFSET 0x022 | ||
63 | #define OMAP2430_CONTROL_PADCONF_SDRC_DQS3_OFFSET 0x023 | ||
64 | #define OMAP2430_CONTROL_PADCONF_SDRC_A14_OFFSET 0x024 | ||
65 | #define OMAP2430_CONTROL_PADCONF_SDRC_A13_OFFSET 0x025 | ||
66 | #define OMAP2430_CONTROL_PADCONF_SDRC_A12_OFFSET 0x026 | ||
67 | #define OMAP2430_CONTROL_PADCONF_SDRC_BA1_OFFSET 0x027 | ||
68 | #define OMAP2430_CONTROL_PADCONF_SDRC_BA0_OFFSET 0x028 | ||
69 | #define OMAP2430_CONTROL_PADCONF_SDRC_A11_OFFSET 0x029 | ||
70 | #define OMAP2430_CONTROL_PADCONF_SDRC_A10_OFFSET 0x02a | ||
71 | #define OMAP2430_CONTROL_PADCONF_SDRC_A9_OFFSET 0x02b | ||
72 | #define OMAP2430_CONTROL_PADCONF_SDRC_A8_OFFSET 0x02c | ||
73 | #define OMAP2430_CONTROL_PADCONF_SDRC_A7_OFFSET 0x02d | ||
74 | #define OMAP2430_CONTROL_PADCONF_SDRC_A6_OFFSET 0x02e | ||
75 | #define OMAP2430_CONTROL_PADCONF_SDRC_A5_OFFSET 0x02f | ||
76 | #define OMAP2430_CONTROL_PADCONF_SDRC_A4_OFFSET 0x030 | ||
77 | #define OMAP2430_CONTROL_PADCONF_SDRC_A3_OFFSET 0x031 | ||
78 | #define OMAP2430_CONTROL_PADCONF_SDRC_A2_OFFSET 0x032 | ||
79 | #define OMAP2430_CONTROL_PADCONF_SDRC_A1_OFFSET 0x033 | ||
80 | #define OMAP2430_CONTROL_PADCONF_SDRC_A0_OFFSET 0x034 | ||
81 | #define OMAP2430_CONTROL_PADCONF_SDRC_D31_OFFSET 0x035 | ||
82 | #define OMAP2430_CONTROL_PADCONF_SDRC_D30_OFFSET 0x036 | ||
83 | #define OMAP2430_CONTROL_PADCONF_SDRC_D29_OFFSET 0x037 | ||
84 | #define OMAP2430_CONTROL_PADCONF_SDRC_D28_OFFSET 0x038 | ||
85 | #define OMAP2430_CONTROL_PADCONF_SDRC_D27_OFFSET 0x039 | ||
86 | #define OMAP2430_CONTROL_PADCONF_SDRC_D26_OFFSET 0x03a | ||
87 | #define OMAP2430_CONTROL_PADCONF_SDRC_D25_OFFSET 0x03b | ||
88 | #define OMAP2430_CONTROL_PADCONF_SDRC_D24_OFFSET 0x03c | ||
89 | #define OMAP2430_CONTROL_PADCONF_SDRC_D23_OFFSET 0x03d | ||
90 | #define OMAP2430_CONTROL_PADCONF_SDRC_D22_OFFSET 0x03e | ||
91 | #define OMAP2430_CONTROL_PADCONF_SDRC_D21_OFFSET 0x03f | ||
92 | #define OMAP2430_CONTROL_PADCONF_SDRC_D20_OFFSET 0x040 | ||
93 | #define OMAP2430_CONTROL_PADCONF_SDRC_D19_OFFSET 0x041 | ||
94 | #define OMAP2430_CONTROL_PADCONF_SDRC_D18_OFFSET 0x042 | ||
95 | #define OMAP2430_CONTROL_PADCONF_SDRC_D17_OFFSET 0x043 | ||
96 | #define OMAP2430_CONTROL_PADCONF_SDRC_D16_OFFSET 0x044 | ||
97 | #define OMAP2430_CONTROL_PADCONF_SDRC_D15_OFFSET 0x045 | ||
98 | #define OMAP2430_CONTROL_PADCONF_SDRC_D14_OFFSET 0x046 | ||
99 | #define OMAP2430_CONTROL_PADCONF_SDRC_D13_OFFSET 0x047 | ||
100 | #define OMAP2430_CONTROL_PADCONF_SDRC_D12_OFFSET 0x048 | ||
101 | #define OMAP2430_CONTROL_PADCONF_SDRC_D11_OFFSET 0x049 | ||
102 | #define OMAP2430_CONTROL_PADCONF_SDRC_D10_OFFSET 0x04a | ||
103 | #define OMAP2430_CONTROL_PADCONF_SDRC_D9_OFFSET 0x04b | ||
104 | #define OMAP2430_CONTROL_PADCONF_SDRC_D8_OFFSET 0x04c | ||
105 | #define OMAP2430_CONTROL_PADCONF_SDRC_D7_OFFSET 0x04d | ||
106 | #define OMAP2430_CONTROL_PADCONF_SDRC_D6_OFFSET 0x04e | ||
107 | #define OMAP2430_CONTROL_PADCONF_SDRC_D5_OFFSET 0x04f | ||
108 | #define OMAP2430_CONTROL_PADCONF_SDRC_D4_OFFSET 0x050 | ||
109 | #define OMAP2430_CONTROL_PADCONF_SDRC_D3_OFFSET 0x051 | ||
110 | #define OMAP2430_CONTROL_PADCONF_SDRC_D2_OFFSET 0x052 | ||
111 | #define OMAP2430_CONTROL_PADCONF_SDRC_D1_OFFSET 0x053 | ||
112 | #define OMAP2430_CONTROL_PADCONF_SDRC_D0_OFFSET 0x054 | ||
113 | #define OMAP2430_CONTROL_PADCONF_GPMC_A10_OFFSET 0x055 | ||
114 | #define OMAP2430_CONTROL_PADCONF_GPMC_A9_OFFSET 0x056 | ||
115 | #define OMAP2430_CONTROL_PADCONF_GPMC_A8_OFFSET 0x057 | ||
116 | #define OMAP2430_CONTROL_PADCONF_GPMC_A7_OFFSET 0x058 | ||
117 | #define OMAP2430_CONTROL_PADCONF_GPMC_A6_OFFSET 0x059 | ||
118 | #define OMAP2430_CONTROL_PADCONF_GPMC_A5_OFFSET 0x05a | ||
119 | #define OMAP2430_CONTROL_PADCONF_GPMC_A4_OFFSET 0x05b | ||
120 | #define OMAP2430_CONTROL_PADCONF_GPMC_A3_OFFSET 0x05c | ||
121 | #define OMAP2430_CONTROL_PADCONF_GPMC_A2_OFFSET 0x05d | ||
122 | #define OMAP2430_CONTROL_PADCONF_GPMC_A1_OFFSET 0x05e | ||
123 | #define OMAP2430_CONTROL_PADCONF_GPMC_D15_OFFSET 0x05f | ||
124 | #define OMAP2430_CONTROL_PADCONF_GPMC_D14_OFFSET 0x060 | ||
125 | #define OMAP2430_CONTROL_PADCONF_GPMC_D13_OFFSET 0x061 | ||
126 | #define OMAP2430_CONTROL_PADCONF_GPMC_D12_OFFSET 0x062 | ||
127 | #define OMAP2430_CONTROL_PADCONF_GPMC_D11_OFFSET 0x063 | ||
128 | #define OMAP2430_CONTROL_PADCONF_GPMC_D10_OFFSET 0x064 | ||
129 | #define OMAP2430_CONTROL_PADCONF_GPMC_D9_OFFSET 0x065 | ||
130 | #define OMAP2430_CONTROL_PADCONF_GPMC_D8_OFFSET 0x066 | ||
131 | #define OMAP2430_CONTROL_PADCONF_GPMC_D7_OFFSET 0x067 | ||
132 | #define OMAP2430_CONTROL_PADCONF_GPMC_D6_OFFSET 0x068 | ||
133 | #define OMAP2430_CONTROL_PADCONF_GPMC_D5_OFFSET 0x069 | ||
134 | #define OMAP2430_CONTROL_PADCONF_GPMC_D4_OFFSET 0x06a | ||
135 | #define OMAP2430_CONTROL_PADCONF_GPMC_D3_OFFSET 0x06b | ||
136 | #define OMAP2430_CONTROL_PADCONF_GPMC_D2_OFFSET 0x06c | ||
137 | #define OMAP2430_CONTROL_PADCONF_GPMC_D1_OFFSET 0x06d | ||
138 | #define OMAP2430_CONTROL_PADCONF_GPMC_D0_OFFSET 0x06e | ||
139 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA0_OFFSET 0x06f | ||
140 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA1_OFFSET 0x070 | ||
141 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA2_OFFSET 0x071 | ||
142 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA3_OFFSET 0x072 | ||
143 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA4_OFFSET 0x073 | ||
144 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA5_OFFSET 0x074 | ||
145 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA6_OFFSET 0x075 | ||
146 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA7_OFFSET 0x076 | ||
147 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA8_OFFSET 0x077 | ||
148 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA9_OFFSET 0x078 | ||
149 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA10_OFFSET 0x079 | ||
150 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA11_OFFSET 0x07a | ||
151 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA12_OFFSET 0x07b | ||
152 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA13_OFFSET 0x07c | ||
153 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA14_OFFSET 0x07d | ||
154 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA15_OFFSET 0x07e | ||
155 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA16_OFFSET 0x07f | ||
156 | #define OMAP2430_CONTROL_PADCONF_DSS_DATA17_OFFSET 0x080 | ||
157 | #define OMAP2430_CONTROL_PADCONF_UART1_CTS_OFFSET 0x081 | ||
158 | #define OMAP2430_CONTROL_PADCONF_UART1_RTS_OFFSET 0x082 | ||
159 | #define OMAP2430_CONTROL_PADCONF_UART1_TX_OFFSET 0x083 | ||
160 | #define OMAP2430_CONTROL_PADCONF_UART1_RX_OFFSET 0x084 | ||
161 | #define OMAP2430_CONTROL_PADCONF_MCBSP2_DR_OFFSET 0x085 | ||
162 | #define OMAP2430_CONTROL_PADCONF_MCBSP2_CLKX_OFFSET 0x086 | ||
163 | #define OMAP2430_CONTROL_PADCONF_DSS_PCLK_OFFSET 0x087 | ||
164 | #define OMAP2430_CONTROL_PADCONF_DSS_VSYNC_OFFSET 0x088 | ||
165 | #define OMAP2430_CONTROL_PADCONF_DSS_HSYNC_OFFSET 0x089 | ||
166 | #define OMAP2430_CONTROL_PADCONF_DSS_ACBIAS_OFFSET 0x08a | ||
167 | #define OMAP2430_CONTROL_PADCONF_SYS_NRESPWRON_OFFSET 0x08b | ||
168 | #define OMAP2430_CONTROL_PADCONF_SYS_NRESWARM_OFFSET 0x08c | ||
169 | #define OMAP2430_CONTROL_PADCONF_SYS_NIRQ0_OFFSET 0x08d | ||
170 | #define OMAP2430_CONTROL_PADCONF_SYS_NIRQ1_OFFSET 0x08e | ||
171 | #define OMAP2430_CONTROL_PADCONF_SYS_VMODE_OFFSET 0x08f | ||
172 | #define OMAP2430_CONTROL_PADCONF_GPIO_128_OFFSET 0x090 | ||
173 | #define OMAP2430_CONTROL_PADCONF_GPIO_129_OFFSET 0x091 | ||
174 | #define OMAP2430_CONTROL_PADCONF_GPIO_130_OFFSET 0x092 | ||
175 | #define OMAP2430_CONTROL_PADCONF_GPIO_131_OFFSET 0x093 | ||
176 | #define OMAP2430_CONTROL_PADCONF_SYS_32K_OFFSET 0x094 | ||
177 | #define OMAP2430_CONTROL_PADCONF_SYS_XTALIN_OFFSET 0x095 | ||
178 | #define OMAP2430_CONTROL_PADCONF_SYS_XTALOUT_OFFSET 0x096 | ||
179 | #define OMAP2430_CONTROL_PADCONF_GPIO_132_OFFSET 0x097 | ||
180 | #define OMAP2430_CONTROL_PADCONF_SYS_CLKREQ_OFFSET 0x098 | ||
181 | #define OMAP2430_CONTROL_PADCONF_SYS_CLKOUT_OFFSET 0x099 | ||
182 | #define OMAP2430_CONTROL_PADCONF_GPIO_151_OFFSET 0x09a | ||
183 | #define OMAP2430_CONTROL_PADCONF_GPIO_133_OFFSET 0x09b | ||
184 | #define OMAP2430_CONTROL_PADCONF_JTAG_EMU1_OFFSET 0x09c | ||
185 | #define OMAP2430_CONTROL_PADCONF_JTAG_EMU0_OFFSET 0x09d | ||
186 | #define OMAP2430_CONTROL_PADCONF_JTAG_NTRST_OFFSET 0x09e | ||
187 | #define OMAP2430_CONTROL_PADCONF_JTAG_TCK_OFFSET 0x09f | ||
188 | #define OMAP2430_CONTROL_PADCONF_JTAG_RTCK_OFFSET 0x0a0 | ||
189 | #define OMAP2430_CONTROL_PADCONF_JTAG_TMS_OFFSET 0x0a1 | ||
190 | #define OMAP2430_CONTROL_PADCONF_JTAG_TDI_OFFSET 0x0a2 | ||
191 | #define OMAP2430_CONTROL_PADCONF_JTAG_TDO_OFFSET 0x0a3 | ||
192 | #define OMAP2430_CONTROL_PADCONF_CAM_D9_OFFSET 0x0a4 | ||
193 | #define OMAP2430_CONTROL_PADCONF_CAM_D8_OFFSET 0x0a5 | ||
194 | #define OMAP2430_CONTROL_PADCONF_CAM_D7_OFFSET 0x0a6 | ||
195 | #define OMAP2430_CONTROL_PADCONF_CAM_D6_OFFSET 0x0a7 | ||
196 | #define OMAP2430_CONTROL_PADCONF_CAM_D5_OFFSET 0x0a8 | ||
197 | #define OMAP2430_CONTROL_PADCONF_CAM_D4_OFFSET 0x0a9 | ||
198 | #define OMAP2430_CONTROL_PADCONF_CAM_D3_OFFSET 0x0aa | ||
199 | #define OMAP2430_CONTROL_PADCONF_CAM_D2_OFFSET 0x0ab | ||
200 | #define OMAP2430_CONTROL_PADCONF_CAM_D1_OFFSET 0x0ac | ||
201 | #define OMAP2430_CONTROL_PADCONF_CAM_D0_OFFSET 0x0ad | ||
202 | #define OMAP2430_CONTROL_PADCONF_CAM_HS_OFFSET 0x0ae | ||
203 | #define OMAP2430_CONTROL_PADCONF_CAM_VS_OFFSET 0x0af | ||
204 | #define OMAP2430_CONTROL_PADCONF_CAM_LCLK_OFFSET 0x0b0 | ||
205 | #define OMAP2430_CONTROL_PADCONF_CAM_XCLK_OFFSET 0x0b1 | ||
206 | #define OMAP2430_CONTROL_PADCONF_CAM_D11_OFFSET 0x0b2 | ||
207 | #define OMAP2430_CONTROL_PADCONF_CAM_D10_OFFSET 0x0b3 | ||
208 | #define OMAP2430_CONTROL_PADCONF_GPIO_134_OFFSET 0x0b4 | ||
209 | #define OMAP2430_CONTROL_PADCONF_GPIO_135_OFFSET 0x0b5 | ||
210 | #define OMAP2430_CONTROL_PADCONF_GPIO_136_OFFSET 0x0b6 | ||
211 | #define OMAP2430_CONTROL_PADCONF_GPIO_137_OFFSET 0x0b7 | ||
212 | #define OMAP2430_CONTROL_PADCONF_GPIO_138_OFFSET 0x0b8 | ||
213 | #define OMAP2430_CONTROL_PADCONF_GPIO_139_OFFSET 0x0b9 | ||
214 | #define OMAP2430_CONTROL_PADCONF_GPIO_140_OFFSET 0x0ba | ||
215 | #define OMAP2430_CONTROL_PADCONF_GPIO_141_OFFSET 0x0bb | ||
216 | #define OMAP2430_CONTROL_PADCONF_GPIO_142_OFFSET 0x0bc | ||
217 | #define OMAP2430_CONTROL_PADCONF_GPIO_154_OFFSET 0x0bd | ||
218 | #define OMAP2430_CONTROL_PADCONF_GPIO_148_OFFSET 0x0be | ||
219 | #define OMAP2430_CONTROL_PADCONF_GPIO_149_OFFSET 0x0bf | ||
220 | #define OMAP2430_CONTROL_PADCONF_GPIO_150_OFFSET 0x0c0 | ||
221 | #define OMAP2430_CONTROL_PADCONF_GPIO_152_OFFSET 0x0c1 | ||
222 | #define OMAP2430_CONTROL_PADCONF_GPIO_153_OFFSET 0x0c2 | ||
223 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_CLKO_OFFSET 0x0c3 | ||
224 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_CMD_OFFSET 0x0c4 | ||
225 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT0_OFFSET 0x0c5 | ||
226 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT1_OFFSET 0x0c6 | ||
227 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT2_OFFSET 0x0c7 | ||
228 | #define OMAP2430_CONTROL_PADCONF_SDMMC1_DAT3_OFFSET 0x0c8 | ||
229 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_CLKO_OFFSET 0x0c9 | ||
230 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT3_OFFSET 0x0ca | ||
231 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_CMD_OFFSET 0x0cb | ||
232 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT0_OFFSET 0x0cc | ||
233 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT2_OFFSET 0x0cd | ||
234 | #define OMAP2430_CONTROL_PADCONF_SDMMC2_DAT1_OFFSET 0x0ce | ||
235 | #define OMAP2430_CONTROL_PADCONF_UART2_CTS_OFFSET 0x0cf | ||
236 | #define OMAP2430_CONTROL_PADCONF_UART2_RTS_OFFSET 0x0d0 | ||
237 | #define OMAP2430_CONTROL_PADCONF_UART2_TX_OFFSET 0x0d1 | ||
238 | #define OMAP2430_CONTROL_PADCONF_UART2_RX_OFFSET 0x0d2 | ||
239 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_CLKX_OFFSET 0x0d3 | ||
240 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_FSX_OFFSET 0x0d4 | ||
241 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_DR_OFFSET 0x0d5 | ||
242 | #define OMAP2430_CONTROL_PADCONF_MCBSP3_DX_OFFSET 0x0d6 | ||
243 | #define OMAP2430_CONTROL_PADCONF_SSI1_DAT_TX_OFFSET 0x0d7 | ||
244 | #define OMAP2430_CONTROL_PADCONF_SSI1_FLAG_TX_OFFSET 0x0d8 | ||
245 | #define OMAP2430_CONTROL_PADCONF_SSI1_RDY_TX_OFFSET 0x0d9 | ||
246 | #define OMAP2430_CONTROL_PADCONF_SSI1_DAT_RX_OFFSET 0x0da | ||
247 | #define OMAP2430_CONTROL_PADCONF_GPIO_63_OFFSET 0x0db | ||
248 | #define OMAP2430_CONTROL_PADCONF_SSI1_FLAG_RX_OFFSET 0x0dc | ||
249 | #define OMAP2430_CONTROL_PADCONF_SSI1_RDY_RX_OFFSET 0x0dd | ||
250 | #define OMAP2430_CONTROL_PADCONF_SSI1_WAKE_OFFSET 0x0de | ||
251 | #define OMAP2430_CONTROL_PADCONF_SPI1_CLK_OFFSET 0x0df | ||
252 | #define OMAP2430_CONTROL_PADCONF_SPI1_SIMO_OFFSET 0x0e0 | ||
253 | #define OMAP2430_CONTROL_PADCONF_SPI1_SOMI_OFFSET 0x0e1 | ||
254 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS0_OFFSET 0x0e2 | ||
255 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS1_OFFSET 0x0e3 | ||
256 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS2_OFFSET 0x0e4 | ||
257 | #define OMAP2430_CONTROL_PADCONF_SPI1_CS3_OFFSET 0x0e5 | ||
258 | #define OMAP2430_CONTROL_PADCONF_SPI2_CLK_OFFSET 0x0e6 | ||
259 | #define OMAP2430_CONTROL_PADCONF_SPI2_SIMO_OFFSET 0x0e7 | ||
260 | #define OMAP2430_CONTROL_PADCONF_SPI2_SOMI_OFFSET 0x0e8 | ||
261 | #define OMAP2430_CONTROL_PADCONF_SPI2_CS0_OFFSET 0x0e9 | ||
262 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_CLKR_OFFSET 0x0ea | ||
263 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_FSR_OFFSET 0x0eb | ||
264 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_DX_OFFSET 0x0ec | ||
265 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_DR_OFFSET 0x0ed | ||
266 | #define OMAP2430_CONTROL_PADCONF_MCBSP_CLKS_OFFSET 0x0ee | ||
267 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_FSX_OFFSET 0x0ef | ||
268 | #define OMAP2430_CONTROL_PADCONF_MCBSP1_CLKX_OFFSET 0x0f0 | ||
269 | #define OMAP2430_CONTROL_PADCONF_I2C1_SCL_OFFSET 0x0f1 | ||
270 | #define OMAP2430_CONTROL_PADCONF_I2C1_SDA_OFFSET 0x0f2 | ||
271 | #define OMAP2430_CONTROL_PADCONF_I2C2_SCL_OFFSET 0x0f3 | ||
272 | #define OMAP2430_CONTROL_PADCONF_I2C2_SDA_OFFSET 0x0f4 | ||
273 | #define OMAP2430_CONTROL_PADCONF_HDQ_SIO_OFFSET 0x0f5 | ||
274 | #define OMAP2430_CONTROL_PADCONF_UART3_CTS_RCTX_OFFSET 0x0f6 | ||
275 | #define OMAP2430_CONTROL_PADCONF_UART3_RTS_SD_OFFSET 0x0f7 | ||
276 | #define OMAP2430_CONTROL_PADCONF_UART3_TX_IRTX_OFFSET 0x0f8 | ||
277 | #define OMAP2430_CONTROL_PADCONF_UART3_RX_IRRX_OFFSET 0x0f9 | ||
278 | #define OMAP2430_CONTROL_PADCONF_GPIO_7_OFFSET 0x0fa | ||
279 | #define OMAP2430_CONTROL_PADCONF_GPIO_78_OFFSET 0x0fb | ||
280 | #define OMAP2430_CONTROL_PADCONF_GPIO_79_OFFSET 0x0fc | ||
281 | #define OMAP2430_CONTROL_PADCONF_GPIO_80_OFFSET 0x0fd | ||
282 | #define OMAP2430_CONTROL_PADCONF_GPIO_113_OFFSET 0x0fe | ||
283 | #define OMAP2430_CONTROL_PADCONF_GPIO_114_OFFSET 0x0ff | ||
284 | #define OMAP2430_CONTROL_PADCONF_GPIO_115_OFFSET 0x100 | ||
285 | #define OMAP2430_CONTROL_PADCONF_GPIO_116_OFFSET 0x101 | ||
286 | #define OMAP2430_CONTROL_PADCONF_SYS_DRM_MSECURE_OFFSET 0x102 | ||
287 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA3_OFFSET 0x103 | ||
288 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA4_OFFSET 0x104 | ||
289 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA5_OFFSET 0x105 | ||
290 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA6_OFFSET 0x106 | ||
291 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA2_OFFSET 0x107 | ||
292 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA0_OFFSET 0x108 | ||
293 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA1_OFFSET 0x109 | ||
294 | #define OMAP2430_CONTROL_PADCONF_USB0HS_CLK_OFFSET 0x10a | ||
295 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DIR_OFFSET 0x10b | ||
296 | #define OMAP2430_CONTROL_PADCONF_USB0HS_STP_OFFSET 0x10c | ||
297 | #define OMAP2430_CONTROL_PADCONF_USB0HS_NXT_OFFSET 0x10d | ||
298 | #define OMAP2430_CONTROL_PADCONF_USB0HS_DATA7_OFFSET 0x10e | ||
299 | #define OMAP2430_CONTROL_PADCONF_TV_OUT_OFFSET 0x10f | ||
300 | #define OMAP2430_CONTROL_PADCONF_TV_VREF_OFFSET 0x110 | ||
301 | #define OMAP2430_CONTROL_PADCONF_TV_RSET_OFFSET 0x111 | ||
302 | #define OMAP2430_CONTROL_PADCONF_TV_VFB_OFFSET 0x112 | ||
303 | #define OMAP2430_CONTROL_PADCONF_TV_DACOUT_OFFSET 0x113 | ||
304 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD0_OFFSET 0x114 | ||
305 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD1_OFFSET 0x115 | ||
306 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD2_OFFSET 0x116 | ||
307 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD3_OFFSET 0x117 | ||
308 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD4_OFFSET 0x118 | ||
309 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD5_OFFSET 0x119 | ||
310 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD6_OFFSET 0x11a | ||
311 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD7_OFFSET 0x11b | ||
312 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD8_OFFSET 0x11c | ||
313 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD9_OFFSET 0x11d | ||
314 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD10_OFFSET 0x11e | ||
315 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD11_OFFSET 0x11f | ||
316 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD12_OFFSET 0x120 | ||
317 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD13_OFFSET 0x121 | ||
318 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD14_OFFSET 0x122 | ||
319 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD15_OFFSET 0x123 | ||
320 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD16_OFFSET 0x124 | ||
321 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD17_OFFSET 0x125 | ||
322 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD18_OFFSET 0x126 | ||
323 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD19_OFFSET 0x127 | ||
324 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD20_OFFSET 0x128 | ||
325 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD21_OFFSET 0x129 | ||
326 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD22_OFFSET 0x12a | ||
327 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD23_OFFSET 0x12b | ||
328 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD24_OFFSET 0x12c | ||
329 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD25_OFFSET 0x12d | ||
330 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD26_OFFSET 0x12e | ||
331 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD27_OFFSET 0x12f | ||
332 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD28_OFFSET 0x130 | ||
333 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD29_OFFSET 0x131 | ||
334 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD30_OFFSET 0x132 | ||
335 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD31_OFFSET 0x133 | ||
336 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD32_OFFSET 0x134 | ||
337 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD33_OFFSET 0x135 | ||
338 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD34_OFFSET 0x136 | ||
339 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD35_OFFSET 0x137 | ||
340 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD36_OFFSET 0x138 | ||
341 | #define OMAP2430_CONTROL_PADCONF_AD2DMCAD37_OFFSET 0x139 | ||
342 | #define OMAP2430_CONTROL_PADCONF_AD2DMWRITE_OFFSET 0x13a | ||
343 | #define OMAP2430_CONTROL_PADCONF_D2DCLK26MI_OFFSET 0x13b | ||
344 | #define OMAP2430_CONTROL_PADCONF_D2DNRESPWRON1_OFFSET 0x13c | ||
345 | #define OMAP2430_CONTROL_PADCONF_D2DNRESWARM_OFFSET 0x13d | ||
346 | #define OMAP2430_CONTROL_PADCONF_D2DARM9NIRQ_OFFSET 0x13e | ||
347 | #define OMAP2430_CONTROL_PADCONF_D2DUMA2P6FIQ_OFFSET 0x13f | ||
348 | #define OMAP2430_CONTROL_PADCONF_D2DSPINT_OFFSET 0x140 | ||
349 | #define OMAP2430_CONTROL_PADCONF_D2DFRINT_OFFSET 0x141 | ||
350 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ0_OFFSET 0x142 | ||
351 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ1_OFFSET 0x143 | ||
352 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ2_OFFSET 0x144 | ||
353 | #define OMAP2430_CONTROL_PADCONF_D2DDMAREQ3_OFFSET 0x145 | ||
354 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTRST_OFFSET 0x146 | ||
355 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTDI_OFFSET 0x147 | ||
356 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTDO_OFFSET 0x148 | ||
357 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTMS_OFFSET 0x149 | ||
358 | #define OMAP2430_CONTROL_PADCONF_D2DN3GTCK_OFFSET 0x14a | ||
359 | #define OMAP2430_CONTROL_PADCONF_D2DN3GRTCK_OFFSET 0x14b | ||
360 | #define OMAP2430_CONTROL_PADCONF_D2DMSTDBY_OFFSET 0x14c | ||
361 | #define OMAP2430_CONTROL_PADCONF_AD2DSREAD_OFFSET 0x14d | ||
362 | #define OMAP2430_CONTROL_PADCONF_D2DSWAKEUP_OFFSET 0x14e | ||
363 | #define OMAP2430_CONTROL_PADCONF_D2DIDLEREQ_OFFSET 0x14f | ||
364 | #define OMAP2430_CONTROL_PADCONF_D2DIDLEACK_OFFSET 0x150 | ||
365 | #define OMAP2430_CONTROL_PADCONF_D2DSPARE0_OFFSET 0x151 | ||
366 | #define OMAP2430_CONTROL_PADCONF_AD2DSWRITE_OFFSET 0x152 | ||
367 | #define OMAP2430_CONTROL_PADCONF_AD2DMREAD_OFFSET 0x153 | ||
368 | |||
369 | #define OMAP2430_CONTROL_PADCONF_MUX_SIZE \ | ||
370 | (OMAP2430_CONTROL_PADCONF_AD2DMREAD_OFFSET + 0x1) | ||
diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c index 2ff4dce95ee8..f64d7eea3451 100644 --- a/arch/arm/mach-omap2/mux34xx.c +++ b/arch/arm/mach-omap2/mux34xx.c | |||
@@ -2032,19 +2032,19 @@ int __init omap3_mux_init(struct omap_board_mux *board_subset, int flags) | |||
2032 | struct omap_ball *package_balls; | 2032 | struct omap_ball *package_balls; |
2033 | 2033 | ||
2034 | switch (flags & OMAP_PACKAGE_MASK) { | 2034 | switch (flags & OMAP_PACKAGE_MASK) { |
2035 | case (OMAP_PACKAGE_CBC): | 2035 | case OMAP_PACKAGE_CBC: |
2036 | package_subset = omap3_cbc_subset; | 2036 | package_subset = omap3_cbc_subset; |
2037 | package_balls = omap3_cbc_ball; | 2037 | package_balls = omap3_cbc_ball; |
2038 | break; | 2038 | break; |
2039 | case (OMAP_PACKAGE_CBB): | 2039 | case OMAP_PACKAGE_CBB: |
2040 | package_subset = omap3_cbb_subset; | 2040 | package_subset = omap3_cbb_subset; |
2041 | package_balls = omap3_cbb_ball; | 2041 | package_balls = omap3_cbb_ball; |
2042 | break; | 2042 | break; |
2043 | case (OMAP_PACKAGE_CUS): | 2043 | case OMAP_PACKAGE_CUS: |
2044 | package_subset = omap3_cus_subset; | 2044 | package_subset = omap3_cus_subset; |
2045 | package_balls = omap3_cus_ball; | 2045 | package_balls = omap3_cus_ball; |
2046 | break; | 2046 | break; |
2047 | case (OMAP_PACKAGE_CBP): | 2047 | case OMAP_PACKAGE_CBP: |
2048 | package_subset = omap36xx_cbp_subset; | 2048 | package_subset = omap36xx_cbp_subset; |
2049 | package_balls = omap36xx_cbp_ball; | 2049 | package_balls = omap36xx_cbp_ball; |
2050 | break; | 2050 | break; |
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S index ef0e7a00dd6c..6ae937a06cc1 100644 --- a/arch/arm/mach-omap2/omap-headsmp.S +++ b/arch/arm/mach-omap2/omap-headsmp.S | |||
@@ -47,19 +47,3 @@ hold: ldr r12,=0x103 | |||
47 | b secondary_startup | 47 | b secondary_startup |
48 | END(omap_secondary_startup) | 48 | END(omap_secondary_startup) |
49 | 49 | ||
50 | |||
51 | ENTRY(omap_modify_auxcoreboot0) | ||
52 | stmfd sp!, {r1-r12, lr} | ||
53 | ldr r12, =0x104 | ||
54 | dsb | ||
55 | smc #0 | ||
56 | ldmfd sp!, {r1-r12, pc} | ||
57 | END(omap_modify_auxcoreboot0) | ||
58 | |||
59 | ENTRY(omap_auxcoreboot_addr) | ||
60 | stmfd sp!, {r2-r12, lr} | ||
61 | ldr r12, =0x105 | ||
62 | dsb | ||
63 | smc #0 | ||
64 | ldmfd sp!, {r2-r12, pc} | ||
65 | END(omap_auxcoreboot_addr) | ||
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c new file mode 100644 index 000000000000..6cee456ca542 --- /dev/null +++ b/arch/arm/mach-omap2/omap-hotplug.c | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * OMAP4 SMP cpu-hotplug support | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Author: | ||
6 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
7 | * | ||
8 | * Platform file needed for the OMAP4 SMP. This file is based on arm | ||
9 | * realview smp platform. | ||
10 | * Copyright (c) 2002 ARM Limited. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/errno.h> | ||
19 | #include <linux/smp.h> | ||
20 | #include <linux/completion.h> | ||
21 | |||
22 | #include <asm/cacheflush.h> | ||
23 | #include <mach/omap4-common.h> | ||
24 | |||
25 | static DECLARE_COMPLETION(cpu_killed); | ||
26 | |||
27 | int platform_cpu_kill(unsigned int cpu) | ||
28 | { | ||
29 | return wait_for_completion_timeout(&cpu_killed, 5000); | ||
30 | } | ||
31 | |||
32 | /* | ||
33 | * platform-specific code to shutdown a CPU | ||
34 | * Called with IRQs disabled | ||
35 | */ | ||
36 | void platform_cpu_die(unsigned int cpu) | ||
37 | { | ||
38 | unsigned int this_cpu = hard_smp_processor_id(); | ||
39 | |||
40 | if (cpu != this_cpu) { | ||
41 | pr_crit("platform_cpu_die running on %u, should be %u\n", | ||
42 | this_cpu, cpu); | ||
43 | BUG(); | ||
44 | } | ||
45 | pr_notice("CPU%u: shutdown\n", cpu); | ||
46 | complete(&cpu_killed); | ||
47 | flush_cache_all(); | ||
48 | dsb(); | ||
49 | |||
50 | /* | ||
51 | * we're ready for shutdown now, so do it | ||
52 | */ | ||
53 | if (omap_modify_auxcoreboot0(0x0, 0x200) != 0x0) | ||
54 | printk(KERN_CRIT "Secure clear status failed\n"); | ||
55 | |||
56 | for (;;) { | ||
57 | /* | ||
58 | * Execute WFI | ||
59 | */ | ||
60 | do_wfi(); | ||
61 | |||
62 | if (omap_read_auxcoreboot0() == cpu) { | ||
63 | /* | ||
64 | * OK, proper wakeup, we're done | ||
65 | */ | ||
66 | break; | ||
67 | } | ||
68 | pr_debug("CPU%u: spurious wakeup call\n", cpu); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | int platform_cpu_disable(unsigned int cpu) | ||
73 | { | ||
74 | /* | ||
75 | * we don't allow CPU 0 to be shutdown (it is still too special | ||
76 | * e.g. clock tick interrupts) | ||
77 | */ | ||
78 | return cpu == 0 ? -EPERM : 0; | ||
79 | } | ||
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c index eb9bee73e0cb..f5a1aad1a5c0 100644 --- a/arch/arm/mach-omap2/omap-iommu.c +++ b/arch/arm/mach-omap2/omap-iommu.c | |||
@@ -59,7 +59,7 @@ static struct platform_device *omap3_iommu_pdev[NR_OMAP3_IOMMU_DEVICES]; | |||
59 | static struct iommu_device omap4_devices[] = { | 59 | static struct iommu_device omap4_devices[] = { |
60 | { | 60 | { |
61 | .base = OMAP4_MMU1_BASE, | 61 | .base = OMAP4_MMU1_BASE, |
62 | .irq = INT_44XX_DUCATI_MMU_IRQ, | 62 | .irq = OMAP44XX_IRQ_DUCATI_MMU, |
63 | .pdata = { | 63 | .pdata = { |
64 | .name = "ducati", | 64 | .name = "ducati", |
65 | .nr_tlb_entries = 32, | 65 | .nr_tlb_entries = 32, |
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 1cf52313759e..af3c20c8d3f9 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
@@ -73,9 +73,10 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
73 | * the AuxCoreBoot1 register is updated with cpu state | 73 | * the AuxCoreBoot1 register is updated with cpu state |
74 | * A barrier is added to ensure that write buffer is drained | 74 | * A barrier is added to ensure that write buffer is drained |
75 | */ | 75 | */ |
76 | omap_modify_auxcoreboot0(0x200, 0x0); | 76 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); |
77 | flush_cache_all(); | 77 | flush_cache_all(); |
78 | smp_wmb(); | 78 | smp_wmb(); |
79 | smp_cross_call(cpumask_of(cpu)); | ||
79 | 80 | ||
80 | /* | 81 | /* |
81 | * Now the secondary core is starting up let it run its | 82 | * Now the secondary core is starting up let it run its |
diff --git a/arch/arm/mach-omap2/omap44xx-smc.S b/arch/arm/mach-omap2/omap44xx-smc.S index f61c7771ca47..1980dc31a1a2 100644 --- a/arch/arm/mach-omap2/omap44xx-smc.S +++ b/arch/arm/mach-omap2/omap44xx-smc.S | |||
@@ -30,3 +30,28 @@ ENTRY(omap_smc1) | |||
30 | smc #0 | 30 | smc #0 |
31 | ldmfd sp!, {r2-r12, pc} | 31 | ldmfd sp!, {r2-r12, pc} |
32 | END(omap_smc1) | 32 | END(omap_smc1) |
33 | |||
34 | ENTRY(omap_modify_auxcoreboot0) | ||
35 | stmfd sp!, {r1-r12, lr} | ||
36 | ldr r12, =0x104 | ||
37 | dsb | ||
38 | smc #0 | ||
39 | ldmfd sp!, {r1-r12, pc} | ||
40 | END(omap_modify_auxcoreboot0) | ||
41 | |||
42 | ENTRY(omap_auxcoreboot_addr) | ||
43 | stmfd sp!, {r2-r12, lr} | ||
44 | ldr r12, =0x105 | ||
45 | dsb | ||
46 | smc #0 | ||
47 | ldmfd sp!, {r2-r12, pc} | ||
48 | END(omap_auxcoreboot_addr) | ||
49 | |||
50 | ENTRY(omap_read_auxcoreboot0) | ||
51 | stmfd sp!, {r2-r12, lr} | ||
52 | ldr r12, =0x103 | ||
53 | dsb | ||
54 | smc #0 | ||
55 | mov r0, r0, lsr #9 | ||
56 | ldmfd sp!, {r2-r12, pc} | ||
57 | END(omap_read_auxcoreboot0) | ||
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index e321281ab6e1..6aeedeacdad8 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <plat/clock.h> | 39 | #include <plat/clock.h> |
40 | #include <plat/sram.h> | 40 | #include <plat/sram.h> |
41 | #include <plat/control.h> | 41 | #include <plat/control.h> |
42 | #include <plat/mux.h> | ||
43 | #include <plat/dma.h> | 42 | #include <plat/dma.h> |
44 | #include <plat/board.h> | 43 | #include <plat/board.h> |
45 | 44 | ||
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index b88737fd6cfe..fb4994ad622e 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -385,8 +385,9 @@ void omap_sram_idle(void) | |||
385 | /* Enable IO-PAD and IO-CHAIN wakeups */ | 385 | /* Enable IO-PAD and IO-CHAIN wakeups */ |
386 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); | 386 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); |
387 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); | 387 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); |
388 | if (per_next_state < PWRDM_POWER_ON || | 388 | if (omap3_has_io_wakeup() && \ |
389 | core_next_state < PWRDM_POWER_ON) { | 389 | (per_next_state < PWRDM_POWER_ON || |
390 | core_next_state < PWRDM_POWER_ON)) { | ||
390 | prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); | 391 | prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); |
391 | omap3_enable_io_chain(); | 392 | omap3_enable_io_chain(); |
392 | } | 393 | } |
@@ -479,7 +480,7 @@ void omap_sram_idle(void) | |||
479 | } | 480 | } |
480 | 481 | ||
481 | /* Disable IO-PAD and IO-CHAIN wakeup */ | 482 | /* Disable IO-PAD and IO-CHAIN wakeup */ |
482 | if (core_next_state < PWRDM_POWER_ON) { | 483 | if (omap3_has_io_wakeup() && core_next_state < PWRDM_POWER_ON) { |
483 | prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); | 484 | prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); |
484 | omap3_disable_io_chain(); | 485 | omap3_disable_io_chain(); |
485 | } | 486 | } |
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c new file mode 100644 index 000000000000..54544b4fc76b --- /dev/null +++ b/arch/arm/mach-omap2/pm44xx.c | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * OMAP4 Power Management Routines | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Rajendra Nayak <rnayak@ti.com> | ||
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/pm.h> | ||
13 | #include <linux/suspend.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/list.h> | ||
16 | #include <linux/err.h> | ||
17 | #include <linux/slab.h> | ||
18 | |||
19 | #include <plat/powerdomain.h> | ||
20 | #include <mach/omap4-common.h> | ||
21 | |||
22 | struct power_state { | ||
23 | struct powerdomain *pwrdm; | ||
24 | u32 next_state; | ||
25 | #ifdef CONFIG_SUSPEND | ||
26 | u32 saved_state; | ||
27 | #endif | ||
28 | struct list_head node; | ||
29 | }; | ||
30 | |||
31 | static LIST_HEAD(pwrst_list); | ||
32 | |||
33 | #ifdef CONFIG_SUSPEND | ||
34 | static int omap4_pm_prepare(void) | ||
35 | { | ||
36 | disable_hlt(); | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static int omap4_pm_suspend(void) | ||
41 | { | ||
42 | do_wfi(); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | static int omap4_pm_enter(suspend_state_t suspend_state) | ||
47 | { | ||
48 | int ret = 0; | ||
49 | |||
50 | switch (suspend_state) { | ||
51 | case PM_SUSPEND_STANDBY: | ||
52 | case PM_SUSPEND_MEM: | ||
53 | ret = omap4_pm_suspend(); | ||
54 | break; | ||
55 | default: | ||
56 | ret = -EINVAL; | ||
57 | } | ||
58 | |||
59 | return ret; | ||
60 | } | ||
61 | |||
62 | static void omap4_pm_finish(void) | ||
63 | { | ||
64 | enable_hlt(); | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | static int omap4_pm_begin(suspend_state_t state) | ||
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static void omap4_pm_end(void) | ||
74 | { | ||
75 | return; | ||
76 | } | ||
77 | |||
78 | static struct platform_suspend_ops omap_pm_ops = { | ||
79 | .begin = omap4_pm_begin, | ||
80 | .end = omap4_pm_end, | ||
81 | .prepare = omap4_pm_prepare, | ||
82 | .enter = omap4_pm_enter, | ||
83 | .finish = omap4_pm_finish, | ||
84 | .valid = suspend_valid_only_mem, | ||
85 | }; | ||
86 | #endif /* CONFIG_SUSPEND */ | ||
87 | |||
88 | static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | ||
89 | { | ||
90 | struct power_state *pwrst; | ||
91 | |||
92 | if (!pwrdm->pwrsts) | ||
93 | return 0; | ||
94 | |||
95 | pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC); | ||
96 | if (!pwrst) | ||
97 | return -ENOMEM; | ||
98 | pwrst->pwrdm = pwrdm; | ||
99 | pwrst->next_state = PWRDM_POWER_ON; | ||
100 | list_add(&pwrst->node, &pwrst_list); | ||
101 | |||
102 | return pwrdm_set_next_pwrst(pwrst->pwrdm, pwrst->next_state); | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * omap4_pm_init - Init routine for OMAP4 PM | ||
107 | * | ||
108 | * Initializes all powerdomain and clockdomain target states | ||
109 | * and all PRCM settings. | ||
110 | */ | ||
111 | static int __init omap4_pm_init(void) | ||
112 | { | ||
113 | int ret; | ||
114 | |||
115 | if (!cpu_is_omap44xx()) | ||
116 | return -ENODEV; | ||
117 | |||
118 | pr_err("Power Management for TI OMAP4.\n"); | ||
119 | |||
120 | #ifdef CONFIG_PM | ||
121 | ret = pwrdm_for_each(pwrdms_setup, NULL); | ||
122 | if (ret) { | ||
123 | pr_err("Failed to setup powerdomains\n"); | ||
124 | goto err2; | ||
125 | } | ||
126 | #endif | ||
127 | |||
128 | #ifdef CONFIG_SUSPEND | ||
129 | suspend_set_ops(&omap_pm_ops); | ||
130 | #endif /* CONFIG_SUSPEND */ | ||
131 | |||
132 | err2: | ||
133 | return ret; | ||
134 | } | ||
135 | late_initcall(omap4_pm_init); | ||
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index a2904aa7065e..6527ec30dc17 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -875,6 +875,7 @@ int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank) | |||
875 | break; | 875 | break; |
876 | case 4: | 876 | case 4: |
877 | m = OMAP_MEM4_RETSTATE_MASK; | 877 | m = OMAP_MEM4_RETSTATE_MASK; |
878 | break; | ||
878 | default: | 879 | default: |
879 | WARN_ON(1); /* should never happen */ | 880 | WARN_ON(1); /* should never happen */ |
880 | return -EEXIST; | 881 | return -EEXIST; |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 3771254dfa81..566e991ede81 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -37,6 +37,9 @@ | |||
37 | #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52 | 37 | #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52 |
38 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ | 38 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ |
39 | 39 | ||
40 | #define UART_ERRATA_FIFO_FULL_ABORT (0x1 << 0) | ||
41 | #define UART_ERRATA_i202_MDR1_ACCESS (0x1 << 1) | ||
42 | |||
40 | /* | 43 | /* |
41 | * NOTE: By default the serial timeout is disabled as it causes lost characters | 44 | * NOTE: By default the serial timeout is disabled as it causes lost characters |
42 | * over the serial ports. This means that the UART clocks will stay on until | 45 | * over the serial ports. This means that the UART clocks will stay on until |
@@ -64,6 +67,7 @@ struct omap_uart_state { | |||
64 | struct list_head node; | 67 | struct list_head node; |
65 | struct platform_device pdev; | 68 | struct platform_device pdev; |
66 | 69 | ||
70 | u32 errata; | ||
67 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | 71 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) |
68 | int context_valid; | 72 | int context_valid; |
69 | 73 | ||
@@ -74,6 +78,7 @@ struct omap_uart_state { | |||
74 | u16 sysc; | 78 | u16 sysc; |
75 | u16 scr; | 79 | u16 scr; |
76 | u16 wer; | 80 | u16 wer; |
81 | u16 mcr; | ||
77 | #endif | 82 | #endif |
78 | }; | 83 | }; |
79 | 84 | ||
@@ -180,6 +185,42 @@ static inline void __init omap_uart_reset(struct omap_uart_state *uart) | |||
180 | 185 | ||
181 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) | 186 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) |
182 | 187 | ||
188 | /* | ||
189 | * Work Around for Errata i202 (3430 - 1.12, 3630 - 1.6) | ||
190 | * The access to uart register after MDR1 Access | ||
191 | * causes UART to corrupt data. | ||
192 | * | ||
193 | * Need a delay = | ||
194 | * 5 L4 clock cycles + 5 UART functional clock cycle (@48MHz = ~0.2uS) | ||
195 | * give 10 times as much | ||
196 | */ | ||
197 | static void omap_uart_mdr1_errataset(struct omap_uart_state *uart, u8 mdr1_val, | ||
198 | u8 fcr_val) | ||
199 | { | ||
200 | struct plat_serial8250_port *p = uart->p; | ||
201 | u8 timeout = 255; | ||
202 | |||
203 | serial_write_reg(p, UART_OMAP_MDR1, mdr1_val); | ||
204 | udelay(2); | ||
205 | serial_write_reg(p, UART_FCR, fcr_val | UART_FCR_CLEAR_XMIT | | ||
206 | UART_FCR_CLEAR_RCVR); | ||
207 | /* | ||
208 | * Wait for FIFO to empty: when empty, RX_FIFO_E bit is 0 and | ||
209 | * TX_FIFO_E bit is 1. | ||
210 | */ | ||
211 | while (UART_LSR_THRE != (serial_read_reg(p, UART_LSR) & | ||
212 | (UART_LSR_THRE | UART_LSR_DR))) { | ||
213 | timeout--; | ||
214 | if (!timeout) { | ||
215 | /* Should *never* happen. we warn and carry on */ | ||
216 | dev_crit(&uart->pdev.dev, "Errata i202: timedout %x\n", | ||
217 | serial_read_reg(p, UART_LSR)); | ||
218 | break; | ||
219 | } | ||
220 | udelay(1); | ||
221 | } | ||
222 | } | ||
223 | |||
183 | static void omap_uart_save_context(struct omap_uart_state *uart) | 224 | static void omap_uart_save_context(struct omap_uart_state *uart) |
184 | { | 225 | { |
185 | u16 lcr = 0; | 226 | u16 lcr = 0; |
@@ -197,6 +238,9 @@ static void omap_uart_save_context(struct omap_uart_state *uart) | |||
197 | uart->sysc = serial_read_reg(p, UART_OMAP_SYSC); | 238 | uart->sysc = serial_read_reg(p, UART_OMAP_SYSC); |
198 | uart->scr = serial_read_reg(p, UART_OMAP_SCR); | 239 | uart->scr = serial_read_reg(p, UART_OMAP_SCR); |
199 | uart->wer = serial_read_reg(p, UART_OMAP_WER); | 240 | uart->wer = serial_read_reg(p, UART_OMAP_WER); |
241 | serial_write_reg(p, UART_LCR, 0x80); | ||
242 | uart->mcr = serial_read_reg(p, UART_MCR); | ||
243 | serial_write_reg(p, UART_LCR, lcr); | ||
200 | 244 | ||
201 | uart->context_valid = 1; | 245 | uart->context_valid = 1; |
202 | } | 246 | } |
@@ -214,7 +258,10 @@ static void omap_uart_restore_context(struct omap_uart_state *uart) | |||
214 | 258 | ||
215 | uart->context_valid = 0; | 259 | uart->context_valid = 0; |
216 | 260 | ||
217 | serial_write_reg(p, UART_OMAP_MDR1, 0x7); | 261 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) |
262 | omap_uart_mdr1_errataset(uart, 0x07, 0xA0); | ||
263 | else | ||
264 | serial_write_reg(p, UART_OMAP_MDR1, 0x7); | ||
218 | serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */ | 265 | serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */ |
219 | efr = serial_read_reg(p, UART_EFR); | 266 | efr = serial_read_reg(p, UART_EFR); |
220 | serial_write_reg(p, UART_EFR, UART_EFR_ECB); | 267 | serial_write_reg(p, UART_EFR, UART_EFR_ECB); |
@@ -225,14 +272,18 @@ static void omap_uart_restore_context(struct omap_uart_state *uart) | |||
225 | serial_write_reg(p, UART_DLM, uart->dlh); | 272 | serial_write_reg(p, UART_DLM, uart->dlh); |
226 | serial_write_reg(p, UART_LCR, 0x0); /* Operational mode */ | 273 | serial_write_reg(p, UART_LCR, 0x0); /* Operational mode */ |
227 | serial_write_reg(p, UART_IER, uart->ier); | 274 | serial_write_reg(p, UART_IER, uart->ier); |
228 | serial_write_reg(p, UART_FCR, 0xA1); | 275 | serial_write_reg(p, UART_LCR, 0x80); |
276 | serial_write_reg(p, UART_MCR, uart->mcr); | ||
229 | serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */ | 277 | serial_write_reg(p, UART_LCR, 0xBF); /* Config B mode */ |
230 | serial_write_reg(p, UART_EFR, efr); | 278 | serial_write_reg(p, UART_EFR, efr); |
231 | serial_write_reg(p, UART_LCR, UART_LCR_WLEN8); | 279 | serial_write_reg(p, UART_LCR, UART_LCR_WLEN8); |
232 | serial_write_reg(p, UART_OMAP_SCR, uart->scr); | 280 | serial_write_reg(p, UART_OMAP_SCR, uart->scr); |
233 | serial_write_reg(p, UART_OMAP_WER, uart->wer); | 281 | serial_write_reg(p, UART_OMAP_WER, uart->wer); |
234 | serial_write_reg(p, UART_OMAP_SYSC, uart->sysc); | 282 | serial_write_reg(p, UART_OMAP_SYSC, uart->sysc); |
235 | serial_write_reg(p, UART_OMAP_MDR1, 0x00); /* UART 16x mode */ | 283 | if (uart->errata & UART_ERRATA_i202_MDR1_ACCESS) |
284 | omap_uart_mdr1_errataset(uart, 0x00, 0xA1); | ||
285 | else | ||
286 | serial_write_reg(p, UART_OMAP_MDR1, 0x00); /* UART 16x mode */ | ||
236 | } | 287 | } |
237 | #else | 288 | #else |
238 | static inline void omap_uart_save_context(struct omap_uart_state *uart) {} | 289 | static inline void omap_uart_save_context(struct omap_uart_state *uart) {} |
@@ -489,8 +540,8 @@ static void omap_uart_idle_init(struct omap_uart_state *uart) | |||
489 | } | 540 | } |
490 | uart->wk_mask = wk_mask; | 541 | uart->wk_mask = wk_mask; |
491 | } else { | 542 | } else { |
492 | uart->wk_en = 0; | 543 | uart->wk_en = NULL; |
493 | uart->wk_st = 0; | 544 | uart->wk_st = NULL; |
494 | uart->wk_mask = 0; | 545 | uart->wk_mask = 0; |
495 | uart->padconf = 0; | 546 | uart->padconf = 0; |
496 | } | 547 | } |
@@ -552,7 +603,8 @@ static ssize_t sleep_timeout_store(struct device *dev, | |||
552 | return n; | 603 | return n; |
553 | } | 604 | } |
554 | 605 | ||
555 | DEVICE_ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store); | 606 | static DEVICE_ATTR(sleep_timeout, 0644, sleep_timeout_show, |
607 | sleep_timeout_store); | ||
556 | #define DEV_CREATE_FILE(dev, attr) WARN_ON(device_create_file(dev, attr)) | 608 | #define DEV_CREATE_FILE(dev, attr) WARN_ON(device_create_file(dev, attr)) |
557 | #else | 609 | #else |
558 | static inline void omap_uart_idle_init(struct omap_uart_state *uart) {} | 610 | static inline void omap_uart_idle_init(struct omap_uart_state *uart) {} |
@@ -749,14 +801,20 @@ void __init omap_serial_init_port(int port) | |||
749 | * omap3xxx: Never read empty UART fifo on UARTs | 801 | * omap3xxx: Never read empty UART fifo on UARTs |
750 | * with IP rev >=0x52 | 802 | * with IP rev >=0x52 |
751 | */ | 803 | */ |
752 | if (cpu_is_omap44xx()) { | 804 | if (cpu_is_omap44xx()) |
753 | uart->p->serial_in = serial_in_override; | 805 | uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; |
754 | uart->p->serial_out = serial_out_override; | 806 | else if ((serial_read_reg(uart->p, UART_OMAP_MVER) & 0xFF) |
755 | } else if ((serial_read_reg(uart->p, UART_OMAP_MVER) & 0xFF) | 807 | >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) |
756 | >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) { | 808 | uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; |
809 | |||
810 | if (uart->errata & UART_ERRATA_FIFO_FULL_ABORT) { | ||
757 | uart->p->serial_in = serial_in_override; | 811 | uart->p->serial_in = serial_in_override; |
758 | uart->p->serial_out = serial_out_override; | 812 | uart->p->serial_out = serial_out_override; |
759 | } | 813 | } |
814 | |||
815 | /* Enable the MDR1 errata for OMAP3 */ | ||
816 | if (cpu_is_omap34xx()) | ||
817 | uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; | ||
760 | } | 818 | } |
761 | 819 | ||
762 | /** | 820 | /** |
diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c index d72d1ac30333..b11bf385d360 100644 --- a/arch/arm/mach-omap2/usb-ehci.c +++ b/arch/arm/mach-omap2/usb-ehci.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
24 | 24 | ||
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | #include <plat/mux.h> | ||
27 | 26 | ||
28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
29 | #include <mach/irqs.h> | 28 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-omap2/usb-fs.c b/arch/arm/mach-omap2/usb-fs.c new file mode 100644 index 000000000000..a216d88b04b5 --- /dev/null +++ b/arch/arm/mach-omap2/usb-fs.c | |||
@@ -0,0 +1,359 @@ | |||
1 | /* | ||
2 | * Platform level USB initialization for FS USB OTG controller on omap1 and 24xx | ||
3 | * | ||
4 | * Copyright (C) 2004 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/module.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <linux/types.h> | ||
24 | #include <linux/errno.h> | ||
25 | #include <linux/init.h> | ||
26 | #include <linux/platform_device.h> | ||
27 | #include <linux/clk.h> | ||
28 | #include <linux/err.h> | ||
29 | |||
30 | #include <asm/irq.h> | ||
31 | |||
32 | #include <plat/control.h> | ||
33 | #include <plat/usb.h> | ||
34 | #include <plat/board.h> | ||
35 | |||
36 | #define INT_USB_IRQ_GEN INT_24XX_USB_IRQ_GEN | ||
37 | #define INT_USB_IRQ_NISO INT_24XX_USB_IRQ_NISO | ||
38 | #define INT_USB_IRQ_ISO INT_24XX_USB_IRQ_ISO | ||
39 | #define INT_USB_IRQ_HGEN INT_24XX_USB_IRQ_HGEN | ||
40 | #define INT_USB_IRQ_OTG INT_24XX_USB_IRQ_OTG | ||
41 | |||
42 | #include "mux.h" | ||
43 | |||
44 | #if defined(CONFIG_ARCH_OMAP2) | ||
45 | |||
46 | #ifdef CONFIG_USB_GADGET_OMAP | ||
47 | |||
48 | static struct resource udc_resources[] = { | ||
49 | /* order is significant! */ | ||
50 | { /* registers */ | ||
51 | .start = UDC_BASE, | ||
52 | .end = UDC_BASE + 0xff, | ||
53 | .flags = IORESOURCE_MEM, | ||
54 | }, { /* general IRQ */ | ||
55 | .start = INT_USB_IRQ_GEN, | ||
56 | .flags = IORESOURCE_IRQ, | ||
57 | }, { /* PIO IRQ */ | ||
58 | .start = INT_USB_IRQ_NISO, | ||
59 | .flags = IORESOURCE_IRQ, | ||
60 | }, { /* SOF IRQ */ | ||
61 | .start = INT_USB_IRQ_ISO, | ||
62 | .flags = IORESOURCE_IRQ, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | static u64 udc_dmamask = ~(u32)0; | ||
67 | |||
68 | static struct platform_device udc_device = { | ||
69 | .name = "omap_udc", | ||
70 | .id = -1, | ||
71 | .dev = { | ||
72 | .dma_mask = &udc_dmamask, | ||
73 | .coherent_dma_mask = 0xffffffff, | ||
74 | }, | ||
75 | .num_resources = ARRAY_SIZE(udc_resources), | ||
76 | .resource = udc_resources, | ||
77 | }; | ||
78 | |||
79 | static inline void udc_device_init(struct omap_usb_config *pdata) | ||
80 | { | ||
81 | pdata->udc_device = &udc_device; | ||
82 | } | ||
83 | |||
84 | #else | ||
85 | |||
86 | static inline void udc_device_init(struct omap_usb_config *pdata) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | #endif | ||
91 | |||
92 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
93 | |||
94 | /* The dmamask must be set for OHCI to work */ | ||
95 | static u64 ohci_dmamask = ~(u32)0; | ||
96 | |||
97 | static struct resource ohci_resources[] = { | ||
98 | { | ||
99 | .start = OMAP_OHCI_BASE, | ||
100 | .end = OMAP_OHCI_BASE + 0xff, | ||
101 | .flags = IORESOURCE_MEM, | ||
102 | }, | ||
103 | { | ||
104 | .start = INT_USB_IRQ_HGEN, | ||
105 | .flags = IORESOURCE_IRQ, | ||
106 | }, | ||
107 | }; | ||
108 | |||
109 | static struct platform_device ohci_device = { | ||
110 | .name = "ohci", | ||
111 | .id = -1, | ||
112 | .dev = { | ||
113 | .dma_mask = &ohci_dmamask, | ||
114 | .coherent_dma_mask = 0xffffffff, | ||
115 | }, | ||
116 | .num_resources = ARRAY_SIZE(ohci_resources), | ||
117 | .resource = ohci_resources, | ||
118 | }; | ||
119 | |||
120 | static inline void ohci_device_init(struct omap_usb_config *pdata) | ||
121 | { | ||
122 | pdata->ohci_device = &ohci_device; | ||
123 | } | ||
124 | |||
125 | #else | ||
126 | |||
127 | static inline void ohci_device_init(struct omap_usb_config *pdata) | ||
128 | { | ||
129 | } | ||
130 | |||
131 | #endif | ||
132 | |||
133 | #if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG) | ||
134 | |||
135 | static struct resource otg_resources[] = { | ||
136 | /* order is significant! */ | ||
137 | { | ||
138 | .start = OTG_BASE, | ||
139 | .end = OTG_BASE + 0xff, | ||
140 | .flags = IORESOURCE_MEM, | ||
141 | }, { | ||
142 | .start = INT_USB_IRQ_OTG, | ||
143 | .flags = IORESOURCE_IRQ, | ||
144 | }, | ||
145 | }; | ||
146 | |||
147 | static struct platform_device otg_device = { | ||
148 | .name = "omap_otg", | ||
149 | .id = -1, | ||
150 | .num_resources = ARRAY_SIZE(otg_resources), | ||
151 | .resource = otg_resources, | ||
152 | }; | ||
153 | |||
154 | static inline void otg_device_init(struct omap_usb_config *pdata) | ||
155 | { | ||
156 | pdata->otg_device = &otg_device; | ||
157 | } | ||
158 | |||
159 | #else | ||
160 | |||
161 | static inline void otg_device_init(struct omap_usb_config *pdata) | ||
162 | { | ||
163 | } | ||
164 | |||
165 | #endif | ||
166 | |||
167 | static void omap2_usb_devconf_clear(u8 port, u32 mask) | ||
168 | { | ||
169 | u32 r; | ||
170 | |||
171 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
172 | r &= ~USBTXWRMODEI(port, mask); | ||
173 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
174 | } | ||
175 | |||
176 | static void omap2_usb_devconf_set(u8 port, u32 mask) | ||
177 | { | ||
178 | u32 r; | ||
179 | |||
180 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
181 | r |= USBTXWRMODEI(port, mask); | ||
182 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
183 | } | ||
184 | |||
185 | static void omap2_usb2_disable_5pinbitll(void) | ||
186 | { | ||
187 | u32 r; | ||
188 | |||
189 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
190 | r &= ~(USBTXWRMODEI(2, USB_BIDIR_TLL) | USBT2TLL5PI); | ||
191 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
192 | } | ||
193 | |||
194 | static void omap2_usb2_enable_5pinunitll(void) | ||
195 | { | ||
196 | u32 r; | ||
197 | |||
198 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
199 | r |= USBTXWRMODEI(2, USB_UNIDIR_TLL) | USBT2TLL5PI; | ||
200 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
201 | } | ||
202 | |||
203 | static u32 __init omap2_usb0_init(unsigned nwires, unsigned is_device) | ||
204 | { | ||
205 | u32 syscon1 = 0; | ||
206 | |||
207 | omap2_usb_devconf_clear(0, USB_BIDIR_TLL); | ||
208 | |||
209 | if (nwires == 0) | ||
210 | return 0; | ||
211 | |||
212 | if (is_device) | ||
213 | omap_mux_init_signal("usb0_puen", 0); | ||
214 | |||
215 | omap_mux_init_signal("usb0_dat", 0); | ||
216 | omap_mux_init_signal("usb0_txen", 0); | ||
217 | omap_mux_init_signal("usb0_se0", 0); | ||
218 | if (nwires != 3) | ||
219 | omap_mux_init_signal("usb0_rcv", 0); | ||
220 | |||
221 | switch (nwires) { | ||
222 | case 3: | ||
223 | syscon1 = 2; | ||
224 | omap2_usb_devconf_set(0, USB_BIDIR); | ||
225 | break; | ||
226 | case 4: | ||
227 | syscon1 = 1; | ||
228 | omap2_usb_devconf_set(0, USB_BIDIR); | ||
229 | break; | ||
230 | case 6: | ||
231 | syscon1 = 3; | ||
232 | omap_mux_init_signal("usb0_vp", 0); | ||
233 | omap_mux_init_signal("usb0_vm", 0); | ||
234 | omap2_usb_devconf_set(0, USB_UNIDIR); | ||
235 | break; | ||
236 | default: | ||
237 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
238 | 0, nwires); | ||
239 | } | ||
240 | |||
241 | return syscon1 << 16; | ||
242 | } | ||
243 | |||
244 | static u32 __init omap2_usb1_init(unsigned nwires) | ||
245 | { | ||
246 | u32 syscon1 = 0; | ||
247 | |||
248 | omap2_usb_devconf_clear(1, USB_BIDIR_TLL); | ||
249 | |||
250 | if (nwires == 0) | ||
251 | return 0; | ||
252 | |||
253 | /* NOTE: board-specific code must set up pin muxing for usb1, | ||
254 | * since each signal could come out on either of two balls. | ||
255 | */ | ||
256 | |||
257 | switch (nwires) { | ||
258 | case 2: | ||
259 | /* NOTE: board-specific code must override this setting if | ||
260 | * this TLL link is not using DP/DM | ||
261 | */ | ||
262 | syscon1 = 1; | ||
263 | omap2_usb_devconf_set(1, USB_BIDIR_TLL); | ||
264 | break; | ||
265 | case 3: | ||
266 | syscon1 = 2; | ||
267 | omap2_usb_devconf_set(1, USB_BIDIR); | ||
268 | break; | ||
269 | case 4: | ||
270 | syscon1 = 1; | ||
271 | omap2_usb_devconf_set(1, USB_BIDIR); | ||
272 | break; | ||
273 | case 6: | ||
274 | default: | ||
275 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
276 | 1, nwires); | ||
277 | } | ||
278 | |||
279 | return syscon1 << 20; | ||
280 | } | ||
281 | |||
282 | static u32 __init omap2_usb2_init(unsigned nwires, unsigned alt_pingroup) | ||
283 | { | ||
284 | u32 syscon1 = 0; | ||
285 | |||
286 | omap2_usb2_disable_5pinbitll(); | ||
287 | alt_pingroup = 0; | ||
288 | |||
289 | /* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */ | ||
290 | if (alt_pingroup || nwires == 0) | ||
291 | return 0; | ||
292 | |||
293 | omap_mux_init_signal("usb2_dat", 0); | ||
294 | omap_mux_init_signal("usb2_se0", 0); | ||
295 | if (nwires > 2) | ||
296 | omap_mux_init_signal("usb2_txen", 0); | ||
297 | if (nwires > 3) | ||
298 | omap_mux_init_signal("usb2_rcv", 0); | ||
299 | |||
300 | switch (nwires) { | ||
301 | case 2: | ||
302 | /* NOTE: board-specific code must override this setting if | ||
303 | * this TLL link is not using DP/DM | ||
304 | */ | ||
305 | syscon1 = 1; | ||
306 | omap2_usb_devconf_set(2, USB_BIDIR_TLL); | ||
307 | break; | ||
308 | case 3: | ||
309 | syscon1 = 2; | ||
310 | omap2_usb_devconf_set(2, USB_BIDIR); | ||
311 | break; | ||
312 | case 4: | ||
313 | syscon1 = 1; | ||
314 | omap2_usb_devconf_set(2, USB_BIDIR); | ||
315 | break; | ||
316 | case 5: | ||
317 | /* NOTE: board-specific code must mux this setting depending | ||
318 | * on TLL link using DP/DM. Something must also | ||
319 | * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED} | ||
320 | * 2420: hdq_sio.usb2_tllse0 or vlynq_rx0.usb2_tllse0 | ||
321 | * 2430: hdq_sio.usb2_tllse0 or sdmmc2_dat0.usb2_tllse0 | ||
322 | */ | ||
323 | |||
324 | syscon1 = 3; | ||
325 | omap2_usb2_enable_5pinunitll(); | ||
326 | break; | ||
327 | case 6: | ||
328 | default: | ||
329 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
330 | 2, nwires); | ||
331 | } | ||
332 | |||
333 | return syscon1 << 24; | ||
334 | } | ||
335 | |||
336 | void __init omap2_usbfs_init(struct omap_usb_config *pdata) | ||
337 | { | ||
338 | struct clk *ick; | ||
339 | |||
340 | if (!cpu_is_omap24xx()) | ||
341 | return; | ||
342 | |||
343 | ick = clk_get(NULL, "usb_l4_ick"); | ||
344 | if (IS_ERR(ick)) | ||
345 | return; | ||
346 | |||
347 | clk_enable(ick); | ||
348 | pdata->usb0_init = omap2_usb0_init; | ||
349 | pdata->usb1_init = omap2_usb1_init; | ||
350 | pdata->usb2_init = omap2_usb2_init; | ||
351 | udc_device_init(pdata); | ||
352 | ohci_device_init(pdata); | ||
353 | otg_device_init(pdata); | ||
354 | omap_otg_init(pdata); | ||
355 | clk_disable(ick); | ||
356 | clk_put(ick); | ||
357 | } | ||
358 | |||
359 | #endif | ||
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 96f6787e00b2..33a5cde1c227 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <mach/irqs.h> | 30 | #include <mach/irqs.h> |
31 | #include <plat/mux.h> | ||
32 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
33 | 32 | ||
34 | #ifdef CONFIG_USB_MUSB_SOC | 33 | #ifdef CONFIG_USB_MUSB_SOC |
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c index 10a2013c1104..64a0112b70a5 100644 --- a/arch/arm/mach-omap2/usb-tusb6010.c +++ b/arch/arm/mach-omap2/usb-tusb6010.c | |||
@@ -17,8 +17,8 @@ | |||
17 | #include <linux/usb/musb.h> | 17 | #include <linux/usb/musb.h> |
18 | 18 | ||
19 | #include <plat/gpmc.h> | 19 | #include <plat/gpmc.h> |
20 | #include <plat/mux.h> | ||
21 | 20 | ||
21 | #include "mux.h" | ||
22 | 22 | ||
23 | static u8 async_cs, sync_cs; | 23 | static u8 async_cs, sync_cs; |
24 | static unsigned refclk_psec; | 24 | static unsigned refclk_psec; |
@@ -325,17 +325,17 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data, | |||
325 | else { | 325 | else { |
326 | /* assume OMAP 2420 ES2.0 and later */ | 326 | /* assume OMAP 2420 ES2.0 and later */ |
327 | if (dmachan & (1 << 0)) | 327 | if (dmachan & (1 << 0)) |
328 | omap_cfg_reg(AA10_242X_DMAREQ0); | 328 | omap_mux_init_signal("sys_ndmareq0", 0); |
329 | if (dmachan & (1 << 1)) | 329 | if (dmachan & (1 << 1)) |
330 | omap_cfg_reg(AA6_242X_DMAREQ1); | 330 | omap_mux_init_signal("sys_ndmareq1", 0); |
331 | if (dmachan & (1 << 2)) | 331 | if (dmachan & (1 << 2)) |
332 | omap_cfg_reg(E4_242X_DMAREQ2); | 332 | omap_mux_init_signal("sys_ndmareq2", 0); |
333 | if (dmachan & (1 << 3)) | 333 | if (dmachan & (1 << 3)) |
334 | omap_cfg_reg(G4_242X_DMAREQ3); | 334 | omap_mux_init_signal("sys_ndmareq3", 0); |
335 | if (dmachan & (1 << 4)) | 335 | if (dmachan & (1 << 4)) |
336 | omap_cfg_reg(D3_242X_DMAREQ4); | 336 | omap_mux_init_signal("sys_ndmareq4", 0); |
337 | if (dmachan & (1 << 5)) | 337 | if (dmachan & (1 << 5)) |
338 | omap_cfg_reg(E3_242X_DMAREQ5); | 338 | omap_mux_init_signal("sys_ndmareq5", 0); |
339 | } | 339 | } |
340 | 340 | ||
341 | /* so far so good ... register the device */ | 341 | /* so far so good ... register the device */ |
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index 45c23fd6df31..40b6ac2de876 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <mach/colibri.h> | 26 | #include <mach/colibri.h> |
27 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
28 | #include <mach/pxafb.h> | 28 | #include <mach/pxafb.h> |
29 | #include <mach/audio.h> | ||
29 | 30 | ||
30 | #include "generic.h" | 31 | #include "generic.h" |
31 | #include "devices.h" | 32 | #include "devices.h" |
@@ -145,7 +146,7 @@ static void __init colibri_pxa300_init_lcd(void) | |||
145 | static inline void colibri_pxa300_init_lcd(void) {} | 146 | static inline void colibri_pxa300_init_lcd(void) {} |
146 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ | 147 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ |
147 | 148 | ||
148 | #if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE) | 149 | #if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE) |
149 | static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { | 150 | static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { |
150 | GPIO24_AC97_SYSCLK, | 151 | GPIO24_AC97_SYSCLK, |
151 | GPIO23_AC97_nACRESET, | 152 | GPIO23_AC97_nACRESET, |
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 3d1dcb9ac08f..51ffa6afb675 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -446,7 +446,7 @@ static struct platform_device corgiled_device = { | |||
446 | static struct pxamci_platform_data corgi_mci_platform_data = { | 446 | static struct pxamci_platform_data corgi_mci_platform_data = { |
447 | .detect_delay_ms = 250, | 447 | .detect_delay_ms = 250, |
448 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 448 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
449 | .gpio_card_detect = -1, | 449 | .gpio_card_detect = CORGI_GPIO_nSD_DETECT, |
450 | .gpio_card_ro = CORGI_GPIO_nSD_WP, | 450 | .gpio_card_ro = CORGI_GPIO_nSD_WP, |
451 | .gpio_power = CORGI_GPIO_SD_PWR, | 451 | .gpio_power = CORGI_GPIO_SD_PWR, |
452 | }; | 452 | }; |
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 9e4d9816726a..268a9bc6be8a 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
@@ -256,13 +256,9 @@ static void init_sdram_rows(void) | |||
256 | 256 | ||
257 | static u32 mdrefr_dri(unsigned int freq) | 257 | static u32 mdrefr_dri(unsigned int freq) |
258 | { | 258 | { |
259 | u32 dri = 0; | 259 | u32 interval = freq * SDRAM_TREF / sdram_rows; |
260 | 260 | ||
261 | if (cpu_is_pxa25x()) | 261 | return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; |
262 | dri = ((freq * SDRAM_TREF) / (sdram_rows * 32)); | ||
263 | if (cpu_is_pxa27x()) | ||
264 | dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32; | ||
265 | return dri; | ||
266 | } | 262 | } |
267 | 263 | ||
268 | /* find a valid frequency point */ | 264 | /* find a valid frequency point */ |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 0af36177ff08..c059dac02b61 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -41,10 +41,10 @@ void pxa27x_clear_otgph(void) | |||
41 | EXPORT_SYMBOL(pxa27x_clear_otgph); | 41 | EXPORT_SYMBOL(pxa27x_clear_otgph); |
42 | 42 | ||
43 | static unsigned long ac97_reset_config[] = { | 43 | static unsigned long ac97_reset_config[] = { |
44 | GPIO95_AC97_nRESET, | ||
45 | GPIO95_GPIO, | ||
46 | GPIO113_AC97_nRESET, | ||
47 | GPIO113_GPIO, | 44 | GPIO113_GPIO, |
45 | GPIO113_AC97_nRESET, | ||
46 | GPIO95_GPIO, | ||
47 | GPIO95_AC97_nRESET, | ||
48 | }; | 48 | }; |
49 | 49 | ||
50 | void pxa27x_assert_ac97reset(int reset_gpio, int on) | 50 | void pxa27x_assert_ac97reset(int reset_gpio, int on) |
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index 595be19f8ad5..02e9fdeb8faf 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -237,7 +237,7 @@ static unsigned int realview_mmc_status(struct device *dev) | |||
237 | else | 237 | else |
238 | mask = 2; | 238 | mask = 2; |
239 | 239 | ||
240 | return !(readl(REALVIEW_SYSMCI) & mask); | 240 | return readl(REALVIEW_SYSMCI) & mask; |
241 | } | 241 | } |
242 | 242 | ||
243 | struct mmci_platform_data realview_mmc0_plat_data = { | 243 | struct mmci_platform_data realview_mmc0_plat_data = { |
diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S index 50f071c5bf4d..5ea24d4d1ba6 100644 --- a/arch/arm/mach-shark/include/mach/debug-macro.S +++ b/arch/arm/mach-shark/include/mach/debug-macro.S | |||
@@ -20,6 +20,9 @@ | |||
20 | strb \rd, [\rx] | 20 | strb \rd, [\rx] |
21 | .endm | 21 | .endm |
22 | 22 | ||
23 | .macro waituart,rd,rx | ||
24 | .endm | ||
25 | |||
23 | .macro busyuart,rd,rx | 26 | .macro busyuart,rd,rx |
24 | mov \rd, #0 | 27 | mov \rd, #0 |
25 | 1001: add \rd, \rd, #1 | 28 | 1001: add \rd, \rd, #1 |
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h index 8552eb188b50..0271ca0a83df 100644 --- a/arch/arm/mach-ux500/include/mach/uncompress.h +++ b/arch/arm/mach-ux500/include/mach/uncompress.h | |||
@@ -30,22 +30,22 @@ | |||
30 | static void putc(const char c) | 30 | static void putc(const char c) |
31 | { | 31 | { |
32 | /* Do nothing if the UART is not enabled. */ | 32 | /* Do nothing if the UART is not enabled. */ |
33 | if (!(readb(U8500_UART_CR) & 0x1)) | 33 | if (!(__raw_readb(U8500_UART_CR) & 0x1)) |
34 | return; | 34 | return; |
35 | 35 | ||
36 | if (c == '\n') | 36 | if (c == '\n') |
37 | putc('\r'); | 37 | putc('\r'); |
38 | 38 | ||
39 | while (readb(U8500_UART_FR) & (1 << 5)) | 39 | while (__raw_readb(U8500_UART_FR) & (1 << 5)) |
40 | barrier(); | 40 | barrier(); |
41 | writeb(c, U8500_UART_DR); | 41 | __raw_writeb(c, U8500_UART_DR); |
42 | } | 42 | } |
43 | 43 | ||
44 | static void flush(void) | 44 | static void flush(void) |
45 | { | 45 | { |
46 | if (!(readb(U8500_UART_CR) & 0x1)) | 46 | if (!(__raw_readb(U8500_UART_CR) & 0x1)) |
47 | return; | 47 | return; |
48 | while (readb(U8500_UART_FR) & (1 << 3)) | 48 | while (__raw_readb(U8500_UART_FR) & (1 << 3)) |
49 | barrier(); | 49 | barrier(); |
50 | } | 50 | } |
51 | 51 | ||
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index d250711b8c7a..c84239761cb4 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -241,7 +241,7 @@ static struct platform_device v2m_flash_device = { | |||
241 | 241 | ||
242 | static unsigned int v2m_mmci_status(struct device *dev) | 242 | static unsigned int v2m_mmci_status(struct device *dev) |
243 | { | 243 | { |
244 | return !(readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0)); | 244 | return readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0); |
245 | } | 245 | } |
246 | 246 | ||
247 | static struct mmci_platform_data v2m_mmci_data = { | 247 | static struct mmci_platform_data v2m_mmci_data = { |
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c index 642207e18198..83c56324a472 100644 --- a/arch/arm/mach-w90x900/cpu.c +++ b/arch/arm/mach-w90x900/cpu.c | |||
@@ -93,7 +93,7 @@ static struct clk_lookup nuc900_clkregs[] = { | |||
93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), | 93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), |
94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), | 94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), |
95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), | 95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), |
96 | DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), | 96 | DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL), |
97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), | 97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), |
98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), | 98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), |
99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), | 99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index df4955885b21..9982eb385c0f 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -32,14 +32,14 @@ static uint32_t l2x0_way_mask; /* Bitmask of active ways */ | |||
32 | static inline void cache_wait(void __iomem *reg, unsigned long mask) | 32 | static inline void cache_wait(void __iomem *reg, unsigned long mask) |
33 | { | 33 | { |
34 | /* wait for the operation to complete */ | 34 | /* wait for the operation to complete */ |
35 | while (readl(reg) & mask) | 35 | while (readl_relaxed(reg) & mask) |
36 | ; | 36 | ; |
37 | } | 37 | } |
38 | 38 | ||
39 | static inline void cache_sync(void) | 39 | static inline void cache_sync(void) |
40 | { | 40 | { |
41 | void __iomem *base = l2x0_base; | 41 | void __iomem *base = l2x0_base; |
42 | writel(0, base + L2X0_CACHE_SYNC); | 42 | writel_relaxed(0, base + L2X0_CACHE_SYNC); |
43 | cache_wait(base + L2X0_CACHE_SYNC, 1); | 43 | cache_wait(base + L2X0_CACHE_SYNC, 1); |
44 | } | 44 | } |
45 | 45 | ||
@@ -47,14 +47,14 @@ static inline void l2x0_clean_line(unsigned long addr) | |||
47 | { | 47 | { |
48 | void __iomem *base = l2x0_base; | 48 | void __iomem *base = l2x0_base; |
49 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); | 49 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); |
50 | writel(addr, base + L2X0_CLEAN_LINE_PA); | 50 | writel_relaxed(addr, base + L2X0_CLEAN_LINE_PA); |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline void l2x0_inv_line(unsigned long addr) | 53 | static inline void l2x0_inv_line(unsigned long addr) |
54 | { | 54 | { |
55 | void __iomem *base = l2x0_base; | 55 | void __iomem *base = l2x0_base; |
56 | cache_wait(base + L2X0_INV_LINE_PA, 1); | 56 | cache_wait(base + L2X0_INV_LINE_PA, 1); |
57 | writel(addr, base + L2X0_INV_LINE_PA); | 57 | writel_relaxed(addr, base + L2X0_INV_LINE_PA); |
58 | } | 58 | } |
59 | 59 | ||
60 | #ifdef CONFIG_PL310_ERRATA_588369 | 60 | #ifdef CONFIG_PL310_ERRATA_588369 |
@@ -75,9 +75,9 @@ static inline void l2x0_flush_line(unsigned long addr) | |||
75 | 75 | ||
76 | /* Clean by PA followed by Invalidate by PA */ | 76 | /* Clean by PA followed by Invalidate by PA */ |
77 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); | 77 | cache_wait(base + L2X0_CLEAN_LINE_PA, 1); |
78 | writel(addr, base + L2X0_CLEAN_LINE_PA); | 78 | writel_relaxed(addr, base + L2X0_CLEAN_LINE_PA); |
79 | cache_wait(base + L2X0_INV_LINE_PA, 1); | 79 | cache_wait(base + L2X0_INV_LINE_PA, 1); |
80 | writel(addr, base + L2X0_INV_LINE_PA); | 80 | writel_relaxed(addr, base + L2X0_INV_LINE_PA); |
81 | } | 81 | } |
82 | #else | 82 | #else |
83 | 83 | ||
@@ -90,7 +90,7 @@ static inline void l2x0_flush_line(unsigned long addr) | |||
90 | { | 90 | { |
91 | void __iomem *base = l2x0_base; | 91 | void __iomem *base = l2x0_base; |
92 | cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); | 92 | cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); |
93 | writel(addr, base + L2X0_CLEAN_INV_LINE_PA); | 93 | writel_relaxed(addr, base + L2X0_CLEAN_INV_LINE_PA); |
94 | } | 94 | } |
95 | #endif | 95 | #endif |
96 | 96 | ||
@@ -109,7 +109,7 @@ static inline void l2x0_inv_all(void) | |||
109 | 109 | ||
110 | /* invalidate all ways */ | 110 | /* invalidate all ways */ |
111 | spin_lock_irqsave(&l2x0_lock, flags); | 111 | spin_lock_irqsave(&l2x0_lock, flags); |
112 | writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); | 112 | writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); |
113 | cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); | 113 | cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); |
114 | cache_sync(); | 114 | cache_sync(); |
115 | spin_unlock_irqrestore(&l2x0_lock, flags); | 115 | spin_unlock_irqrestore(&l2x0_lock, flags); |
@@ -215,8 +215,8 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
215 | 215 | ||
216 | l2x0_base = base; | 216 | l2x0_base = base; |
217 | 217 | ||
218 | cache_id = readl(l2x0_base + L2X0_CACHE_ID); | 218 | cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID); |
219 | aux = readl(l2x0_base + L2X0_AUX_CTRL); | 219 | aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); |
220 | 220 | ||
221 | aux &= aux_mask; | 221 | aux &= aux_mask; |
222 | aux |= aux_val; | 222 | aux |= aux_val; |
@@ -248,15 +248,15 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
248 | * If you are booting from non-secure mode | 248 | * If you are booting from non-secure mode |
249 | * accessing the below registers will fault. | 249 | * accessing the below registers will fault. |
250 | */ | 250 | */ |
251 | if (!(readl(l2x0_base + L2X0_CTRL) & 1)) { | 251 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { |
252 | 252 | ||
253 | /* l2x0 controller is disabled */ | 253 | /* l2x0 controller is disabled */ |
254 | writel(aux, l2x0_base + L2X0_AUX_CTRL); | 254 | writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); |
255 | 255 | ||
256 | l2x0_inv_all(); | 256 | l2x0_inv_all(); |
257 | 257 | ||
258 | /* enable L2X0 */ | 258 | /* enable L2X0 */ |
259 | writel(1, l2x0_base + L2X0_CTRL); | 259 | writel_relaxed(1, l2x0_base + L2X0_CTRL); |
260 | } | 260 | } |
261 | 261 | ||
262 | outer_cache.inv_range = l2x0_inv_range; | 262 | outer_cache.inv_range = l2x0_inv_range; |
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index 086816b205b8..6ab244062b4a 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c | |||
@@ -163,19 +163,22 @@ static DEFINE_PER_CPU(int, kmap_high_l1_vipt_depth); | |||
163 | 163 | ||
164 | void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte) | 164 | void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte) |
165 | { | 165 | { |
166 | unsigned int idx, cpu = smp_processor_id(); | 166 | unsigned int idx, cpu; |
167 | int *depth = &per_cpu(kmap_high_l1_vipt_depth, cpu); | 167 | int *depth; |
168 | unsigned long vaddr, flags; | 168 | unsigned long vaddr, flags; |
169 | pte_t pte, *ptep; | 169 | pte_t pte, *ptep; |
170 | 170 | ||
171 | if (!in_interrupt()) | ||
172 | preempt_disable(); | ||
173 | |||
174 | cpu = smp_processor_id(); | ||
175 | depth = &per_cpu(kmap_high_l1_vipt_depth, cpu); | ||
176 | |||
171 | idx = KM_L1_CACHE + KM_TYPE_NR * cpu; | 177 | idx = KM_L1_CACHE + KM_TYPE_NR * cpu; |
172 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 178 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
173 | ptep = TOP_PTE(vaddr); | 179 | ptep = TOP_PTE(vaddr); |
174 | pte = mk_pte(page, kmap_prot); | 180 | pte = mk_pte(page, kmap_prot); |
175 | 181 | ||
176 | if (!in_interrupt()) | ||
177 | preempt_disable(); | ||
178 | |||
179 | raw_local_irq_save(flags); | 182 | raw_local_irq_save(flags); |
180 | (*depth)++; | 183 | (*depth)++; |
181 | if (pte_val(*ptep) == pte_val(pte)) { | 184 | if (pte_val(*ptep) == pte_val(pte)) { |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 78b49a626d06..e2ed952df23d 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | if ARCH_OMAP | 1 | if ARCH_OMAP |
2 | 2 | ||
3 | menu "TI OMAP Implementations" | 3 | menu "TI OMAP Common Features" |
4 | 4 | ||
5 | config ARCH_OMAP_OTG | 5 | config ARCH_OMAP_OTG |
6 | bool | 6 | bool |
@@ -21,24 +21,6 @@ config ARCH_OMAP2PLUS | |||
21 | help | 21 | help |
22 | "Systems based on omap24xx, omap34xx or omap44xx" | 22 | "Systems based on omap24xx, omap34xx or omap44xx" |
23 | 23 | ||
24 | config ARCH_OMAP2 | ||
25 | bool "TI OMAP2" | ||
26 | depends on ARCH_OMAP2PLUS | ||
27 | select CPU_V6 | ||
28 | |||
29 | config ARCH_OMAP3 | ||
30 | bool "TI OMAP3" | ||
31 | depends on ARCH_OMAP2PLUS | ||
32 | select CPU_V7 | ||
33 | select USB_ARCH_HAS_EHCI | ||
34 | select ARM_L1_CACHE_SHIFT_6 | ||
35 | |||
36 | config ARCH_OMAP4 | ||
37 | bool "TI OMAP4" | ||
38 | depends on ARCH_OMAP2PLUS | ||
39 | select CPU_V7 | ||
40 | select ARM_GIC | ||
41 | |||
42 | endchoice | 24 | endchoice |
43 | 25 | ||
44 | comment "OMAP Feature Selections" | 26 | comment "OMAP Feature Selections" |
@@ -51,7 +33,7 @@ config OMAP_DEBUG_DEVICES | |||
51 | config OMAP_DEBUG_LEDS | 33 | config OMAP_DEBUG_LEDS |
52 | bool | 34 | bool |
53 | depends on OMAP_DEBUG_DEVICES | 35 | depends on OMAP_DEBUG_DEVICES |
54 | default y if LEDS || LEDS_OMAP_DEBUG | 36 | default y if LEDS |
55 | 37 | ||
56 | config OMAP_RESET_CLOCKS | 38 | config OMAP_RESET_CLOCKS |
57 | bool "Reset unused clocks during boot" | 39 | bool "Reset unused clocks during boot" |
@@ -120,7 +102,7 @@ config OMAP_IOMMU_DEBUG | |||
120 | 102 | ||
121 | choice | 103 | choice |
122 | prompt "System timer" | 104 | prompt "System timer" |
123 | default OMAP_MPU_TIMER | 105 | default OMAP_32K_TIMER if !ARCH_OMAP15XX |
124 | 106 | ||
125 | config OMAP_MPU_TIMER | 107 | config OMAP_MPU_TIMER |
126 | bool "Use mpu timer" | 108 | bool "Use mpu timer" |
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c index 53fcef7c5201..fc05b1022602 100644 --- a/arch/arm/plat-omap/debug-leds.c +++ b/arch/arm/plat-omap/debug-leds.c | |||
@@ -39,7 +39,7 @@ static struct h2p2_dbg_fpga __iomem *fpga; | |||
39 | static u16 led_state, hw_led_state; | 39 | static u16 led_state, hw_led_state; |
40 | 40 | ||
41 | 41 | ||
42 | #ifdef CONFIG_LEDS_OMAP_DEBUG | 42 | #ifdef CONFIG_OMAP_DEBUG_LEDS |
43 | #define new_led_api() 1 | 43 | #define new_led_api() 1 |
44 | #else | 44 | #else |
45 | #define new_led_api() 0 | 45 | #define new_led_api() 0 |
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index 95677d17cd1c..d1920be7833b 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -24,135 +24,13 @@ | |||
24 | #include <plat/control.h> | 24 | #include <plat/control.h> |
25 | #include <plat/board.h> | 25 | #include <plat/board.h> |
26 | #include <plat/mmc.h> | 26 | #include <plat/mmc.h> |
27 | #include <plat/mux.h> | ||
28 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
29 | #include <plat/menelaus.h> | 28 | #include <plat/menelaus.h> |
30 | #include <plat/mcbsp.h> | 29 | #include <plat/mcbsp.h> |
31 | #include <plat/dsp_common.h> | ||
32 | #include <plat/omap44xx.h> | 30 | #include <plat/omap44xx.h> |
33 | 31 | ||
34 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) | ||
35 | |||
36 | static struct dsp_platform_data dsp_pdata = { | ||
37 | .kdev_list = LIST_HEAD_INIT(dsp_pdata.kdev_list), | ||
38 | }; | ||
39 | |||
40 | static struct resource omap_dsp_resources[] = { | ||
41 | { | ||
42 | .name = "dsp_mmu", | ||
43 | .start = -1, | ||
44 | .flags = IORESOURCE_IRQ, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | static struct platform_device omap_dsp_device = { | ||
49 | .name = "dsp", | ||
50 | .id = -1, | ||
51 | .num_resources = ARRAY_SIZE(omap_dsp_resources), | ||
52 | .resource = omap_dsp_resources, | ||
53 | .dev = { | ||
54 | .platform_data = &dsp_pdata, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static inline void omap_init_dsp(void) | ||
59 | { | ||
60 | struct resource *res; | ||
61 | int irq; | ||
62 | |||
63 | if (cpu_is_omap15xx()) | ||
64 | irq = INT_1510_DSP_MMU; | ||
65 | else if (cpu_is_omap16xx()) | ||
66 | irq = INT_1610_DSP_MMU; | ||
67 | else if (cpu_is_omap24xx()) | ||
68 | irq = INT_24XX_DSP_MMU; | ||
69 | |||
70 | res = platform_get_resource_byname(&omap_dsp_device, | ||
71 | IORESOURCE_IRQ, "dsp_mmu"); | ||
72 | res->start = irq; | ||
73 | |||
74 | platform_device_register(&omap_dsp_device); | ||
75 | } | ||
76 | |||
77 | int dsp_kfunc_device_register(struct dsp_kfunc_device *kdev) | ||
78 | { | ||
79 | static DEFINE_MUTEX(dsp_pdata_lock); | ||
80 | |||
81 | spin_lock_init(&kdev->lock); | ||
82 | |||
83 | mutex_lock(&dsp_pdata_lock); | ||
84 | list_add_tail(&kdev->entry, &dsp_pdata.kdev_list); | ||
85 | mutex_unlock(&dsp_pdata_lock); | ||
86 | |||
87 | return 0; | ||
88 | } | ||
89 | EXPORT_SYMBOL(dsp_kfunc_device_register); | ||
90 | |||
91 | #else | ||
92 | static inline void omap_init_dsp(void) { } | ||
93 | #endif /* CONFIG_OMAP_DSP */ | ||
94 | |||
95 | /*-------------------------------------------------------------------------*/ | 32 | /*-------------------------------------------------------------------------*/ |
96 | #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) | ||
97 | |||
98 | static void omap_init_kp(void) | ||
99 | { | ||
100 | /* 2430 and 34xx keypad is on TWL4030 */ | ||
101 | if (cpu_is_omap2430() || cpu_is_omap34xx()) | ||
102 | return; | ||
103 | 33 | ||
104 | if (machine_is_omap_h2() || machine_is_omap_h3()) { | ||
105 | omap_cfg_reg(F18_1610_KBC0); | ||
106 | omap_cfg_reg(D20_1610_KBC1); | ||
107 | omap_cfg_reg(D19_1610_KBC2); | ||
108 | omap_cfg_reg(E18_1610_KBC3); | ||
109 | omap_cfg_reg(C21_1610_KBC4); | ||
110 | |||
111 | omap_cfg_reg(G18_1610_KBR0); | ||
112 | omap_cfg_reg(F19_1610_KBR1); | ||
113 | omap_cfg_reg(H14_1610_KBR2); | ||
114 | omap_cfg_reg(E20_1610_KBR3); | ||
115 | omap_cfg_reg(E19_1610_KBR4); | ||
116 | omap_cfg_reg(N19_1610_KBR5); | ||
117 | } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { | ||
118 | omap_cfg_reg(E2_7XX_KBR0); | ||
119 | omap_cfg_reg(J7_7XX_KBR1); | ||
120 | omap_cfg_reg(E1_7XX_KBR2); | ||
121 | omap_cfg_reg(F3_7XX_KBR3); | ||
122 | omap_cfg_reg(D2_7XX_KBR4); | ||
123 | |||
124 | omap_cfg_reg(C2_7XX_KBC0); | ||
125 | omap_cfg_reg(D3_7XX_KBC1); | ||
126 | omap_cfg_reg(E4_7XX_KBC2); | ||
127 | omap_cfg_reg(F4_7XX_KBC3); | ||
128 | omap_cfg_reg(E3_7XX_KBC4); | ||
129 | } else if (machine_is_omap_h4()) { | ||
130 | omap_cfg_reg(T19_24XX_KBR0); | ||
131 | omap_cfg_reg(R19_24XX_KBR1); | ||
132 | omap_cfg_reg(V18_24XX_KBR2); | ||
133 | omap_cfg_reg(M21_24XX_KBR3); | ||
134 | omap_cfg_reg(E5__24XX_KBR4); | ||
135 | if (omap_has_menelaus()) { | ||
136 | omap_cfg_reg(B3__24XX_KBR5); | ||
137 | omap_cfg_reg(AA4_24XX_KBC2); | ||
138 | omap_cfg_reg(B13_24XX_KBC6); | ||
139 | } else { | ||
140 | omap_cfg_reg(M18_24XX_KBR5); | ||
141 | omap_cfg_reg(H19_24XX_KBC2); | ||
142 | omap_cfg_reg(N19_24XX_KBC6); | ||
143 | } | ||
144 | omap_cfg_reg(R20_24XX_KBC0); | ||
145 | omap_cfg_reg(M14_24XX_KBC1); | ||
146 | omap_cfg_reg(V17_24XX_KBC3); | ||
147 | omap_cfg_reg(P21_24XX_KBC4); | ||
148 | omap_cfg_reg(L14_24XX_KBC5); | ||
149 | } | ||
150 | } | ||
151 | #else | ||
152 | static inline void omap_init_kp(void) {} | ||
153 | #endif | ||
154 | |||
155 | /*-------------------------------------------------------------------------*/ | ||
156 | #if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE) | 34 | #if defined(CONFIG_OMAP_MCBSP) || defined(CONFIG_OMAP_MCBSP_MODULE) |
157 | 35 | ||
158 | static struct platform_device **omap_mcbsp_devices; | 36 | static struct platform_device **omap_mcbsp_devices; |
@@ -419,8 +297,6 @@ static int __init omap_init_devices(void) | |||
419 | /* please keep these calls, and their implementations above, | 297 | /* please keep these calls, and their implementations above, |
420 | * in alphabetical order so they're easier to sort through. | 298 | * in alphabetical order so they're easier to sort through. |
421 | */ | 299 | */ |
422 | omap_init_dsp(); | ||
423 | omap_init_kp(); | ||
424 | omap_init_rng(); | 300 | omap_init_rng(); |
425 | omap_init_mcpdm(); | 301 | omap_init_mcpdm(); |
426 | omap_init_uwire(); | 302 | omap_init_uwire(); |
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index f7f571e7987e..ec7eddf9e525 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -290,7 +290,7 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, | |||
290 | val = dma_read(CCR(lch)); | 290 | val = dma_read(CCR(lch)); |
291 | 291 | ||
292 | /* DMA_SYNCHRO_CONTROL_UPPER depends on the channel number */ | 292 | /* DMA_SYNCHRO_CONTROL_UPPER depends on the channel number */ |
293 | val &= ~((3 << 19) | 0x1f); | 293 | val &= ~((1 << 23) | (3 << 19) | 0x1f); |
294 | val |= (dma_trigger & ~0x1f) << 14; | 294 | val |= (dma_trigger & ~0x1f) << 14; |
295 | val |= dma_trigger & 0x1f; | 295 | val |= dma_trigger & 0x1f; |
296 | 296 | ||
@@ -304,11 +304,14 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, | |||
304 | else | 304 | else |
305 | val &= ~(1 << 18); | 305 | val &= ~(1 << 18); |
306 | 306 | ||
307 | if (src_or_dst_synch) | 307 | if (src_or_dst_synch == OMAP_DMA_DST_SYNC_PREFETCH) { |
308 | val &= ~(1 << 24); /* dest synch */ | ||
309 | val |= (1 << 23); /* Prefetch */ | ||
310 | } else if (src_or_dst_synch) { | ||
308 | val |= 1 << 24; /* source synch */ | 311 | val |= 1 << 24; /* source synch */ |
309 | else | 312 | } else { |
310 | val &= ~(1 << 24); /* dest synch */ | 313 | val &= ~(1 << 24); /* dest synch */ |
311 | 314 | } | |
312 | dma_write(val, CCR(lch)); | 315 | dma_write(val, CCR(lch)); |
313 | } | 316 | } |
314 | 317 | ||
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 9b7e3545f325..7951eefe1a0e 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -390,7 +390,9 @@ static inline int gpio_valid(int gpio) | |||
390 | return 0; | 390 | return 0; |
391 | if (cpu_is_omap7xx() && gpio < 192) | 391 | if (cpu_is_omap7xx() && gpio < 192) |
392 | return 0; | 392 | return 0; |
393 | if (cpu_is_omap24xx() && gpio < 128) | 393 | if (cpu_is_omap2420() && gpio < 128) |
394 | return 0; | ||
395 | if (cpu_is_omap2430() && gpio < 160) | ||
394 | return 0; | 396 | return 0; |
395 | if ((cpu_is_omap34xx() || cpu_is_omap44xx()) && gpio < 192) | 397 | if ((cpu_is_omap34xx() || cpu_is_omap44xx()) && gpio < 192) |
396 | return 0; | 398 | return 0; |
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h index 5cd622039da0..3cf4fa25ab3d 100644 --- a/arch/arm/plat-omap/include/plat/board.h +++ b/arch/arm/plat-omap/include/plat/board.h | |||
@@ -85,6 +85,14 @@ struct omap_usb_config { | |||
85 | * 6 == 6 wire unidirectional (or TLL) | 85 | * 6 == 6 wire unidirectional (or TLL) |
86 | */ | 86 | */ |
87 | u8 pins[3]; | 87 | u8 pins[3]; |
88 | |||
89 | struct platform_device *udc_device; | ||
90 | struct platform_device *ohci_device; | ||
91 | struct platform_device *otg_device; | ||
92 | |||
93 | u32 (*usb0_init)(unsigned nwires, unsigned is_device); | ||
94 | u32 (*usb1_init)(unsigned nwires); | ||
95 | u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup); | ||
88 | }; | 96 | }; |
89 | 97 | ||
90 | struct omap_lcd_config { | 98 | struct omap_lcd_config { |
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index 75141742300c..aa2f4f079f57 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
@@ -444,6 +444,7 @@ extern u32 omap3_features; | |||
444 | #define OMAP3_HAS_NEON BIT(3) | 444 | #define OMAP3_HAS_NEON BIT(3) |
445 | #define OMAP3_HAS_ISP BIT(4) | 445 | #define OMAP3_HAS_ISP BIT(4) |
446 | #define OMAP3_HAS_192MHZ_CLK BIT(5) | 446 | #define OMAP3_HAS_192MHZ_CLK BIT(5) |
447 | #define OMAP3_HAS_IO_WAKEUP BIT(6) | ||
447 | 448 | ||
448 | #define OMAP3_HAS_FEATURE(feat,flag) \ | 449 | #define OMAP3_HAS_FEATURE(feat,flag) \ |
449 | static inline unsigned int omap3_has_ ##feat(void) \ | 450 | static inline unsigned int omap3_has_ ##feat(void) \ |
@@ -457,5 +458,6 @@ OMAP3_HAS_FEATURE(iva, IVA) | |||
457 | OMAP3_HAS_FEATURE(neon, NEON) | 458 | OMAP3_HAS_FEATURE(neon, NEON) |
458 | OMAP3_HAS_FEATURE(isp, ISP) | 459 | OMAP3_HAS_FEATURE(isp, ISP) |
459 | OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) | 460 | OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) |
461 | OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) | ||
460 | 462 | ||
461 | #endif | 463 | #endif |
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h index 02232ca2c37f..af3a03941add 100644 --- a/arch/arm/plat-omap/include/plat/dma.h +++ b/arch/arm/plat-omap/include/plat/dma.h | |||
@@ -345,6 +345,7 @@ | |||
345 | #define OMAP_DMA_SYNC_BLOCK 0x02 | 345 | #define OMAP_DMA_SYNC_BLOCK 0x02 |
346 | #define OMAP_DMA_SYNC_PACKET 0x03 | 346 | #define OMAP_DMA_SYNC_PACKET 0x03 |
347 | 347 | ||
348 | #define OMAP_DMA_DST_SYNC_PREFETCH 0x02 | ||
348 | #define OMAP_DMA_SRC_SYNC 0x01 | 349 | #define OMAP_DMA_SRC_SYNC 0x01 |
349 | #define OMAP_DMA_DST_SYNC 0x00 | 350 | #define OMAP_DMA_DST_SYNC 0x00 |
350 | 351 | ||
diff --git a/arch/arm/plat-omap/include/plat/dsp_common.h b/arch/arm/plat-omap/include/plat/dsp_common.h deleted file mode 100644 index da97736f3efa..000000000000 --- a/arch/arm/plat-omap/include/plat/dsp_common.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * This file is part of OMAP DSP driver (DSP Gateway version 3.3.1) | ||
3 | * | ||
4 | * Copyright (C) 2004-2006 Nokia Corporation. All rights reserved. | ||
5 | * | ||
6 | * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef ASM_ARCH_DSP_COMMON_H | ||
25 | #define ASM_ARCH_DSP_COMMON_H | ||
26 | |||
27 | #if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_OMAP_MMU_FWK) | ||
28 | extern void omap_dsp_request_mpui(void); | ||
29 | extern void omap_dsp_release_mpui(void); | ||
30 | extern int omap_dsp_request_mem(void); | ||
31 | extern int omap_dsp_release_mem(void); | ||
32 | #else | ||
33 | static inline int omap_dsp_request_mem(void) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | #define omap_dsp_release_mem() do {} while (0) | ||
38 | #endif | ||
39 | |||
40 | #endif /* ASM_ARCH_DSP_COMMON_H */ | ||
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h index 145838a81ef6..9fd99b9e40ab 100644 --- a/arch/arm/plat-omap/include/plat/gpmc.h +++ b/arch/arm/plat-omap/include/plat/gpmc.h | |||
@@ -25,10 +25,26 @@ | |||
25 | #define GPMC_CS_NAND_ADDRESS 0x20 | 25 | #define GPMC_CS_NAND_ADDRESS 0x20 |
26 | #define GPMC_CS_NAND_DATA 0x24 | 26 | #define GPMC_CS_NAND_DATA 0x24 |
27 | 27 | ||
28 | #define GPMC_CONFIG 0x50 | 28 | /* Control Commands */ |
29 | #define GPMC_STATUS 0x54 | 29 | #define GPMC_CONFIG_RDY_BSY 0x00000001 |
30 | #define GPMC_CS0_BASE 0x60 | 30 | #define GPMC_CONFIG_DEV_SIZE 0x00000002 |
31 | #define GPMC_CS_SIZE 0x30 | 31 | #define GPMC_CONFIG_DEV_TYPE 0x00000003 |
32 | #define GPMC_SET_IRQ_STATUS 0x00000004 | ||
33 | #define GPMC_CONFIG_WP 0x00000005 | ||
34 | |||
35 | #define GPMC_GET_IRQ_STATUS 0x00000006 | ||
36 | #define GPMC_PREFETCH_FIFO_CNT 0x00000007 /* bytes available in FIFO for r/w */ | ||
37 | #define GPMC_PREFETCH_COUNT 0x00000008 /* remaining bytes to be read/write*/ | ||
38 | #define GPMC_STATUS_BUFFER 0x00000009 /* 1: buffer is available to write */ | ||
39 | |||
40 | #define GPMC_NAND_COMMAND 0x0000000a | ||
41 | #define GPMC_NAND_ADDRESS 0x0000000b | ||
42 | #define GPMC_NAND_DATA 0x0000000c | ||
43 | |||
44 | /* ECC commands */ | ||
45 | #define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */ | ||
46 | #define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */ | ||
47 | #define GPMC_ECC_READSYN 2 /* Reset before syndrom is read back */ | ||
32 | 48 | ||
33 | #define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31) | 49 | #define GPMC_CONFIG1_WRAPBURST_SUPP (1 << 31) |
34 | #define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30) | 50 | #define GPMC_CONFIG1_READMULTIPLE_SUPP (1 << 30) |
@@ -47,7 +63,6 @@ | |||
47 | #define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1) | 63 | #define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1) |
48 | #define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10) | 64 | #define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10) |
49 | #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0) | 65 | #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0) |
50 | #define GPMC_CONFIG1_DEVICETYPE_NAND GPMC_CONFIG1_DEVICETYPE(2) | ||
51 | #define GPMC_CONFIG1_MUXADDDATA (1 << 9) | 66 | #define GPMC_CONFIG1_MUXADDDATA (1 << 9) |
52 | #define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4) | 67 | #define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4) |
53 | #define GPMC_CONFIG1_FCLK_DIV(val) (val & 3) | 68 | #define GPMC_CONFIG1_FCLK_DIV(val) (val & 3) |
@@ -56,6 +71,14 @@ | |||
56 | #define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) | 71 | #define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) |
57 | #define GPMC_CONFIG7_CSVALID (1 << 6) | 72 | #define GPMC_CONFIG7_CSVALID (1 << 6) |
58 | 73 | ||
74 | #define GPMC_DEVICETYPE_NOR 0 | ||
75 | #define GPMC_DEVICETYPE_NAND 2 | ||
76 | #define GPMC_CONFIG_WRITEPROTECT 0x00000010 | ||
77 | #define GPMC_STATUS_BUFF_EMPTY 0x00000001 | ||
78 | #define WR_RD_PIN_MONITORING 0x00600000 | ||
79 | #define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F) | ||
80 | #define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) | ||
81 | |||
59 | /* | 82 | /* |
60 | * Note that all values in this struct are in nanoseconds, while | 83 | * Note that all values in this struct are in nanoseconds, while |
61 | * the register values are in gpmc_fck cycles. | 84 | * the register values are in gpmc_fck cycles. |
@@ -108,10 +131,15 @@ extern int gpmc_cs_set_reserved(int cs, int reserved); | |||
108 | extern int gpmc_cs_reserved(int cs); | 131 | extern int gpmc_cs_reserved(int cs); |
109 | extern int gpmc_prefetch_enable(int cs, int dma_mode, | 132 | extern int gpmc_prefetch_enable(int cs, int dma_mode, |
110 | unsigned int u32_count, int is_write); | 133 | unsigned int u32_count, int is_write); |
111 | extern void gpmc_prefetch_reset(void); | 134 | extern int gpmc_prefetch_reset(int cs); |
112 | extern int gpmc_prefetch_status(void); | ||
113 | extern void omap3_gpmc_save_context(void); | 135 | extern void omap3_gpmc_save_context(void); |
114 | extern void omap3_gpmc_restore_context(void); | 136 | extern void omap3_gpmc_restore_context(void); |
115 | extern void gpmc_init(void); | 137 | extern void gpmc_init(void); |
138 | extern int gpmc_read_status(int cmd); | ||
139 | extern int gpmc_cs_configure(int cs, int cmd, int wval); | ||
140 | extern int gpmc_nand_read(int cs, int cmd); | ||
141 | extern int gpmc_nand_write(int cs, int cmd, int wval); | ||
116 | 142 | ||
143 | int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size); | ||
144 | int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code); | ||
117 | #endif | 145 | #endif |
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h index 0752af9d099e..33c7d41cb6a5 100644 --- a/arch/arm/plat-omap/include/plat/iommu.h +++ b/arch/arm/plat-omap/include/plat/iommu.h | |||
@@ -80,6 +80,7 @@ struct iommu_functions { | |||
80 | 80 | ||
81 | int (*enable)(struct iommu *obj); | 81 | int (*enable)(struct iommu *obj); |
82 | void (*disable)(struct iommu *obj); | 82 | void (*disable)(struct iommu *obj); |
83 | void (*set_twl)(struct iommu *obj, bool on); | ||
83 | u32 (*fault_isr)(struct iommu *obj, u32 *ra); | 84 | u32 (*fault_isr)(struct iommu *obj, u32 *ra); |
84 | 85 | ||
85 | void (*tlb_read_cr)(struct iommu *obj, struct cr_regs *cr); | 86 | void (*tlb_read_cr)(struct iommu *obj, struct cr_regs *cr); |
@@ -143,6 +144,7 @@ extern void iotlb_cr_to_e(struct cr_regs *cr, struct iotlb_entry *e); | |||
143 | extern u32 iotlb_cr_to_virt(struct cr_regs *cr); | 144 | extern u32 iotlb_cr_to_virt(struct cr_regs *cr); |
144 | 145 | ||
145 | extern int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e); | 146 | extern int load_iotlb_entry(struct iommu *obj, struct iotlb_entry *e); |
147 | extern void iommu_set_twl(struct iommu *obj, bool on); | ||
146 | extern void flush_iotlb_page(struct iommu *obj, u32 da); | 148 | extern void flush_iotlb_page(struct iommu *obj, u32 da); |
147 | extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end); | 149 | extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end); |
148 | extern void flush_iotlb_all(struct iommu *obj); | 150 | extern void flush_iotlb_all(struct iommu *obj); |
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/plat-omap/include/plat/mux.h index c7472a28ce24..aeba71796ad9 100644 --- a/arch/arm/plat-omap/include/plat/mux.h +++ b/arch/arm/plat-omap/include/plat/mux.h | |||
@@ -114,28 +114,11 @@ | |||
114 | PU_PD_REG(NA, 0) \ | 114 | PU_PD_REG(NA, 0) \ |
115 | }, | 115 | }, |
116 | 116 | ||
117 | #define MUX_CFG_24XX(desc, reg_offset, mode, \ | ||
118 | pull_en, pull_mode, dbg) \ | ||
119 | { \ | ||
120 | .name = desc, \ | ||
121 | .debug = dbg, \ | ||
122 | .mux_reg = reg_offset, \ | ||
123 | .mask = mode, \ | ||
124 | .pull_val = pull_en, \ | ||
125 | .pu_pd_val = pull_mode, \ | ||
126 | }, | ||
127 | |||
128 | /* 24xx/34xx mux bit defines */ | ||
129 | #define OMAP2_PULL_ENA (1 << 3) | ||
130 | #define OMAP2_PULL_UP (1 << 4) | ||
131 | #define OMAP2_ALTELECTRICALSEL (1 << 5) | ||
132 | |||
133 | struct pin_config { | 117 | struct pin_config { |
134 | char *name; | 118 | char *name; |
135 | const unsigned int mux_reg; | 119 | const unsigned int mux_reg; |
136 | unsigned char debug; | 120 | unsigned char debug; |
137 | 121 | ||
138 | #if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2) | ||
139 | const unsigned char mask_offset; | 122 | const unsigned char mask_offset; |
140 | const unsigned char mask; | 123 | const unsigned char mask; |
141 | 124 | ||
@@ -147,7 +130,6 @@ struct pin_config { | |||
147 | const char *pu_pd_name; | 130 | const char *pu_pd_name; |
148 | const unsigned int pu_pd_reg; | 131 | const unsigned int pu_pd_reg; |
149 | const unsigned char pu_pd_val; | 132 | const unsigned char pu_pd_val; |
150 | #endif | ||
151 | 133 | ||
152 | #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS) | 134 | #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS) |
153 | const char *mux_reg_name; | 135 | const char *mux_reg_name; |
@@ -191,6 +173,10 @@ enum omap7xx_index { | |||
191 | SPI_7XX_4, | 173 | SPI_7XX_4, |
192 | SPI_7XX_5, | 174 | SPI_7XX_5, |
193 | SPI_7XX_6, | 175 | SPI_7XX_6, |
176 | |||
177 | /* UART */ | ||
178 | UART_7XX_1, | ||
179 | UART_7XX_2, | ||
194 | }; | 180 | }; |
195 | 181 | ||
196 | enum omap1xxx_index { | 182 | enum omap1xxx_index { |
@@ -446,208 +432,6 @@ enum omap1xxx_index { | |||
446 | 432 | ||
447 | }; | 433 | }; |
448 | 434 | ||
449 | enum omap24xx_index { | ||
450 | /* 24xx I2C */ | ||
451 | M19_24XX_I2C1_SCL, | ||
452 | L15_24XX_I2C1_SDA, | ||
453 | J15_24XX_I2C2_SCL, | ||
454 | H19_24XX_I2C2_SDA, | ||
455 | |||
456 | /* 24xx Menelaus interrupt */ | ||
457 | W19_24XX_SYS_NIRQ, | ||
458 | |||
459 | /* 24xx clock */ | ||
460 | W14_24XX_SYS_CLKOUT, | ||
461 | |||
462 | /* 24xx GPMC chipselects, wait pin monitoring */ | ||
463 | E2_GPMC_NCS2, | ||
464 | L2_GPMC_NCS7, | ||
465 | L3_GPMC_WAIT0, | ||
466 | N7_GPMC_WAIT1, | ||
467 | M1_GPMC_WAIT2, | ||
468 | P1_GPMC_WAIT3, | ||
469 | |||
470 | /* 242X McBSP */ | ||
471 | Y15_24XX_MCBSP2_CLKX, | ||
472 | R14_24XX_MCBSP2_FSX, | ||
473 | W15_24XX_MCBSP2_DR, | ||
474 | V15_24XX_MCBSP2_DX, | ||
475 | |||
476 | /* 24xx GPIO */ | ||
477 | M21_242X_GPIO11, | ||
478 | P21_242X_GPIO12, | ||
479 | AA10_242X_GPIO13, | ||
480 | AA6_242X_GPIO14, | ||
481 | AA4_242X_GPIO15, | ||
482 | Y11_242X_GPIO16, | ||
483 | AA12_242X_GPIO17, | ||
484 | AA8_242X_GPIO58, | ||
485 | Y20_24XX_GPIO60, | ||
486 | W4__24XX_GPIO74, | ||
487 | N15_24XX_GPIO85, | ||
488 | M15_24XX_GPIO92, | ||
489 | P20_24XX_GPIO93, | ||
490 | P18_24XX_GPIO95, | ||
491 | M18_24XX_GPIO96, | ||
492 | L14_24XX_GPIO97, | ||
493 | J15_24XX_GPIO99, | ||
494 | V14_24XX_GPIO117, | ||
495 | P14_24XX_GPIO125, | ||
496 | |||
497 | /* 242x DBG GPIO */ | ||
498 | V4_242X_GPIO49, | ||
499 | W2_242X_GPIO50, | ||
500 | U4_242X_GPIO51, | ||
501 | V3_242X_GPIO52, | ||
502 | V2_242X_GPIO53, | ||
503 | V6_242X_GPIO53, | ||
504 | T4_242X_GPIO54, | ||
505 | Y4_242X_GPIO54, | ||
506 | T3_242X_GPIO55, | ||
507 | U2_242X_GPIO56, | ||
508 | |||
509 | /* 24xx external DMA requests */ | ||
510 | AA10_242X_DMAREQ0, | ||
511 | AA6_242X_DMAREQ1, | ||
512 | E4_242X_DMAREQ2, | ||
513 | G4_242X_DMAREQ3, | ||
514 | D3_242X_DMAREQ4, | ||
515 | E3_242X_DMAREQ5, | ||
516 | |||
517 | /* UART3 */ | ||
518 | K15_24XX_UART3_TX, | ||
519 | K14_24XX_UART3_RX, | ||
520 | |||
521 | /* MMC/SDIO */ | ||
522 | G19_24XX_MMC_CLKO, | ||
523 | H18_24XX_MMC_CMD, | ||
524 | F20_24XX_MMC_DAT0, | ||
525 | H14_24XX_MMC_DAT1, | ||
526 | E19_24XX_MMC_DAT2, | ||
527 | D19_24XX_MMC_DAT3, | ||
528 | F19_24XX_MMC_DAT_DIR0, | ||
529 | E20_24XX_MMC_DAT_DIR1, | ||
530 | F18_24XX_MMC_DAT_DIR2, | ||
531 | E18_24XX_MMC_DAT_DIR3, | ||
532 | G18_24XX_MMC_CMD_DIR, | ||
533 | H15_24XX_MMC_CLKI, | ||
534 | |||
535 | /* Full speed USB */ | ||
536 | J20_24XX_USB0_PUEN, | ||
537 | J19_24XX_USB0_VP, | ||
538 | K20_24XX_USB0_VM, | ||
539 | J18_24XX_USB0_RCV, | ||
540 | K19_24XX_USB0_TXEN, | ||
541 | J14_24XX_USB0_SE0, | ||
542 | K18_24XX_USB0_DAT, | ||
543 | |||
544 | N14_24XX_USB1_SE0, | ||
545 | W12_24XX_USB1_SE0, | ||
546 | P15_24XX_USB1_DAT, | ||
547 | R13_24XX_USB1_DAT, | ||
548 | W20_24XX_USB1_TXEN, | ||
549 | P13_24XX_USB1_TXEN, | ||
550 | V19_24XX_USB1_RCV, | ||
551 | V12_24XX_USB1_RCV, | ||
552 | |||
553 | AA10_24XX_USB2_SE0, | ||
554 | Y11_24XX_USB2_DAT, | ||
555 | AA12_24XX_USB2_TXEN, | ||
556 | AA6_24XX_USB2_RCV, | ||
557 | AA4_24XX_USB2_TLLSE0, | ||
558 | |||
559 | /* Keypad GPIO*/ | ||
560 | T19_24XX_KBR0, | ||
561 | R19_24XX_KBR1, | ||
562 | V18_24XX_KBR2, | ||
563 | M21_24XX_KBR3, | ||
564 | E5__24XX_KBR4, | ||
565 | M18_24XX_KBR5, | ||
566 | R20_24XX_KBC0, | ||
567 | M14_24XX_KBC1, | ||
568 | H19_24XX_KBC2, | ||
569 | V17_24XX_KBC3, | ||
570 | P21_24XX_KBC4, | ||
571 | L14_24XX_KBC5, | ||
572 | N19_24XX_KBC6, | ||
573 | |||
574 | /* 24xx Menelaus Keypad GPIO */ | ||
575 | B3__24XX_KBR5, | ||
576 | AA4_24XX_KBC2, | ||
577 | B13_24XX_KBC6, | ||
578 | |||
579 | /* 2430 USB */ | ||
580 | AD9_2430_USB0_PUEN, | ||
581 | Y11_2430_USB0_VP, | ||
582 | AD7_2430_USB0_VM, | ||
583 | AE7_2430_USB0_RCV, | ||
584 | AD4_2430_USB0_TXEN, | ||
585 | AF9_2430_USB0_SE0, | ||
586 | AE6_2430_USB0_DAT, | ||
587 | AD24_2430_USB1_SE0, | ||
588 | AB24_2430_USB1_RCV, | ||
589 | Y25_2430_USB1_TXEN, | ||
590 | AA26_2430_USB1_DAT, | ||
591 | |||
592 | /* 2430 HS-USB */ | ||
593 | AD9_2430_USB0HS_DATA3, | ||
594 | Y11_2430_USB0HS_DATA4, | ||
595 | AD7_2430_USB0HS_DATA5, | ||
596 | AE7_2430_USB0HS_DATA6, | ||
597 | AD4_2430_USB0HS_DATA2, | ||
598 | AF9_2430_USB0HS_DATA0, | ||
599 | AE6_2430_USB0HS_DATA1, | ||
600 | AE8_2430_USB0HS_CLK, | ||
601 | AD8_2430_USB0HS_DIR, | ||
602 | AE5_2430_USB0HS_STP, | ||
603 | AE9_2430_USB0HS_NXT, | ||
604 | AC7_2430_USB0HS_DATA7, | ||
605 | |||
606 | /* 2430 McBSP */ | ||
607 | AD6_2430_MCBSP_CLKS, | ||
608 | |||
609 | AB2_2430_MCBSP1_CLKR, | ||
610 | AD5_2430_MCBSP1_FSR, | ||
611 | AA1_2430_MCBSP1_DX, | ||
612 | AF3_2430_MCBSP1_DR, | ||
613 | AB3_2430_MCBSP1_FSX, | ||
614 | Y9_2430_MCBSP1_CLKX, | ||
615 | |||
616 | AC10_2430_MCBSP2_FSX, | ||
617 | AD16_2430_MCBSP2_CLX, | ||
618 | AE13_2430_MCBSP2_DX, | ||
619 | AD13_2430_MCBSP2_DR, | ||
620 | AC10_2430_MCBSP2_FSX_OFF, | ||
621 | AD16_2430_MCBSP2_CLX_OFF, | ||
622 | AE13_2430_MCBSP2_DX_OFF, | ||
623 | AD13_2430_MCBSP2_DR_OFF, | ||
624 | |||
625 | AC9_2430_MCBSP3_CLKX, | ||
626 | AE4_2430_MCBSP3_FSX, | ||
627 | AE2_2430_MCBSP3_DR, | ||
628 | AF4_2430_MCBSP3_DX, | ||
629 | |||
630 | N3_2430_MCBSP4_CLKX, | ||
631 | AD23_2430_MCBSP4_DR, | ||
632 | AB25_2430_MCBSP4_DX, | ||
633 | AC25_2430_MCBSP4_FSX, | ||
634 | |||
635 | AE16_2430_MCBSP5_CLKX, | ||
636 | AF12_2430_MCBSP5_FSX, | ||
637 | K7_2430_MCBSP5_DX, | ||
638 | M1_2430_MCBSP5_DR, | ||
639 | |||
640 | /* 2430 McSPI*/ | ||
641 | Y18_2430_MCSPI1_CLK, | ||
642 | AD15_2430_MCSPI1_SIMO, | ||
643 | AE17_2430_MCSPI1_SOMI, | ||
644 | U1_2430_MCSPI1_CS0, | ||
645 | |||
646 | /* Touchscreen GPIO */ | ||
647 | AF19_2430_GPIO_85, | ||
648 | |||
649 | }; | ||
650 | |||
651 | struct omap_mux_cfg { | 435 | struct omap_mux_cfg { |
652 | struct pin_config *pins; | 436 | struct pin_config *pins; |
653 | unsigned long size; | 437 | unsigned long size; |
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h index f8efd5466b1d..6562cd082bb1 100644 --- a/arch/arm/plat-omap/include/plat/nand.h +++ b/arch/arm/plat-omap/include/plat/nand.h | |||
@@ -21,13 +21,11 @@ struct omap_nand_platform_data { | |||
21 | int (*dev_ready)(struct omap_nand_platform_data *); | 21 | int (*dev_ready)(struct omap_nand_platform_data *); |
22 | int dma_channel; | 22 | int dma_channel; |
23 | unsigned long phys_base; | 23 | unsigned long phys_base; |
24 | void __iomem *gpmc_cs_baseaddr; | ||
25 | void __iomem *gpmc_baseaddr; | ||
26 | int devsize; | 24 | int devsize; |
27 | }; | 25 | }; |
28 | 26 | ||
29 | /* size (4 KiB) for IO mapping */ | 27 | /* minimum size for IO mapping */ |
30 | #define NAND_IO_SIZE SZ_4K | 28 | #define NAND_IO_SIZE 4 |
31 | 29 | ||
32 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) | 30 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) |
33 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); | 31 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); |
diff --git a/arch/arm/plat-omap/include/plat/smp.h b/arch/arm/plat-omap/include/plat/smp.h index 8983d54c4fd2..6a3ff65c0303 100644 --- a/arch/arm/plat-omap/include/plat/smp.h +++ b/arch/arm/plat-omap/include/plat/smp.h | |||
@@ -30,6 +30,7 @@ | |||
30 | extern void omap_secondary_startup(void); | 30 | extern void omap_secondary_startup(void); |
31 | extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); | 31 | extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); |
32 | extern void omap_auxcoreboot_addr(u32 cpu_addr); | 32 | extern void omap_auxcoreboot_addr(u32 cpu_addr); |
33 | extern u32 omap_read_auxcoreboot0(void); | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * We use Soft IRQ1 as the IPI | 36 | * We use Soft IRQ1 as the IPI |
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h index bbedd71943f6..ddf723be48dc 100644 --- a/arch/arm/plat-omap/include/plat/uncompress.h +++ b/arch/arm/plat-omap/include/plat/uncompress.h | |||
@@ -25,6 +25,8 @@ | |||
25 | 25 | ||
26 | #include <plat/serial.h> | 26 | #include <plat/serial.h> |
27 | 27 | ||
28 | #define MDR1_MODE_MASK 0x07 | ||
29 | |||
28 | static volatile u8 *uart_base; | 30 | static volatile u8 *uart_base; |
29 | static int uart_shift; | 31 | static int uart_shift; |
30 | 32 | ||
@@ -42,6 +44,10 @@ static void putc(int c) | |||
42 | if (!uart_base) | 44 | if (!uart_base) |
43 | return; | 45 | return; |
44 | 46 | ||
47 | /* Check for UART 16x mode */ | ||
48 | if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0) | ||
49 | return; | ||
50 | |||
45 | while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE)) | 51 | while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE)) |
46 | barrier(); | 52 | barrier(); |
47 | uart_base[UART_TX << uart_shift] = c; | 53 | uart_base[UART_TX << uart_shift] = c; |
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index 98eef5360e6d..2a9427c8cc48 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h | |||
@@ -81,7 +81,34 @@ extern void usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata); | |||
81 | 81 | ||
82 | #endif | 82 | #endif |
83 | 83 | ||
84 | void omap_usb_init(struct omap_usb_config *pdata); | 84 | |
85 | /* | ||
86 | * FIXME correct answer depends on hmc_mode, | ||
87 | * as does (on omap1) any nonzero value for config->otg port number | ||
88 | */ | ||
89 | #ifdef CONFIG_USB_GADGET_OMAP | ||
90 | #define is_usb0_device(config) 1 | ||
91 | #else | ||
92 | #define is_usb0_device(config) 0 | ||
93 | #endif | ||
94 | |||
95 | void omap_otg_init(struct omap_usb_config *config); | ||
96 | |||
97 | #if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE) | ||
98 | void omap1_usb_init(struct omap_usb_config *pdata); | ||
99 | #else | ||
100 | static inline void omap1_usb_init(struct omap_usb_config *pdata) | ||
101 | { | ||
102 | } | ||
103 | #endif | ||
104 | |||
105 | #if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP_OTG_MODULE) | ||
106 | void omap2_usbfs_init(struct omap_usb_config *pdata); | ||
107 | #else | ||
108 | static inline omap2_usbfs_init(struct omap_usb_config *pdata) | ||
109 | { | ||
110 | } | ||
111 | #endif | ||
85 | 112 | ||
86 | /*-------------------------------------------------------------------------*/ | 113 | /*-------------------------------------------------------------------------*/ |
87 | 114 | ||
@@ -192,4 +219,24 @@ void omap_usb_init(struct omap_usb_config *pdata); | |||
192 | # define USB0PUENACTLOI (1 << 16) | 219 | # define USB0PUENACTLOI (1 << 16) |
193 | # define USBSTANDBYCTRL (1 << 15) | 220 | # define USBSTANDBYCTRL (1 << 15) |
194 | 221 | ||
222 | #if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB) | ||
223 | u32 omap1_usb0_init(unsigned nwires, unsigned is_device); | ||
224 | u32 omap1_usb1_init(unsigned nwires); | ||
225 | u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup); | ||
226 | #else | ||
227 | static inline u32 omap1_usb0_init(unsigned nwires, unsigned is_device) | ||
228 | { | ||
229 | return 0; | ||
230 | } | ||
231 | static inline u32 omap1_usb1_init(unsigned nwires) | ||
232 | { | ||
233 | return 0; | ||
234 | |||
235 | } | ||
236 | static inline u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup) | ||
237 | { | ||
238 | return 0; | ||
239 | } | ||
240 | #endif | ||
241 | |||
195 | #endif /* __ASM_ARCH_OMAP_USB_H */ | 242 | #endif /* __ASM_ARCH_OMAP_USB_H */ |
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index bc094dbacee6..a202a2ce6e3d 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
@@ -370,6 +370,23 @@ void flush_iotlb_all(struct iommu *obj) | |||
370 | } | 370 | } |
371 | EXPORT_SYMBOL_GPL(flush_iotlb_all); | 371 | EXPORT_SYMBOL_GPL(flush_iotlb_all); |
372 | 372 | ||
373 | /** | ||
374 | * iommu_set_twl - enable/disable table walking logic | ||
375 | * @obj: target iommu | ||
376 | * @on: enable/disable | ||
377 | * | ||
378 | * Function used to enable/disable TWL. If one wants to work | ||
379 | * exclusively with locked TLB entries and receive notifications | ||
380 | * for TLB miss then call this function to disable TWL. | ||
381 | */ | ||
382 | void iommu_set_twl(struct iommu *obj, bool on) | ||
383 | { | ||
384 | clk_enable(obj->clk); | ||
385 | arch_iommu->set_twl(obj, on); | ||
386 | clk_disable(obj->clk); | ||
387 | } | ||
388 | EXPORT_SYMBOL_GPL(iommu_set_twl); | ||
389 | |||
373 | #if defined(CONFIG_OMAP_IOMMU_DEBUG_MODULE) | 390 | #if defined(CONFIG_OMAP_IOMMU_DEBUG_MODULE) |
374 | 391 | ||
375 | ssize_t iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t bytes) | 392 | ssize_t iommu_dump_ctx(struct iommu *obj, char *buf, ssize_t bytes) |
@@ -653,7 +670,7 @@ void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte) | |||
653 | if (!*iopgd) | 670 | if (!*iopgd) |
654 | goto out; | 671 | goto out; |
655 | 672 | ||
656 | if (*iopgd & IOPGD_TABLE) | 673 | if (iopgd_is_table(*iopgd)) |
657 | iopte = iopte_offset(iopgd, da); | 674 | iopte = iopte_offset(iopgd, da); |
658 | out: | 675 | out: |
659 | *ppgd = iopgd; | 676 | *ppgd = iopgd; |
@@ -670,7 +687,7 @@ static size_t iopgtable_clear_entry_core(struct iommu *obj, u32 da) | |||
670 | if (!*iopgd) | 687 | if (!*iopgd) |
671 | return 0; | 688 | return 0; |
672 | 689 | ||
673 | if (*iopgd & IOPGD_TABLE) { | 690 | if (iopgd_is_table(*iopgd)) { |
674 | int i; | 691 | int i; |
675 | u32 *iopte = iopte_offset(iopgd, da); | 692 | u32 *iopte = iopte_offset(iopgd, da); |
676 | 693 | ||
@@ -745,7 +762,7 @@ static void iopgtable_clear_entry_all(struct iommu *obj) | |||
745 | if (!*iopgd) | 762 | if (!*iopgd) |
746 | continue; | 763 | continue; |
747 | 764 | ||
748 | if (*iopgd & IOPGD_TABLE) | 765 | if (iopgd_is_table(*iopgd)) |
749 | iopte_free(iopte_offset(iopgd, 0)); | 766 | iopte_free(iopte_offset(iopgd, 0)); |
750 | 767 | ||
751 | *iopgd = 0; | 768 | *iopgd = 0; |
@@ -783,9 +800,11 @@ static irqreturn_t iommu_fault_handler(int irq, void *data) | |||
783 | if (!stat) | 800 | if (!stat) |
784 | return IRQ_HANDLED; | 801 | return IRQ_HANDLED; |
785 | 802 | ||
803 | iommu_disable(obj); | ||
804 | |||
786 | iopgd = iopgd_offset(obj, da); | 805 | iopgd = iopgd_offset(obj, da); |
787 | 806 | ||
788 | if (!(*iopgd & IOPGD_TABLE)) { | 807 | if (!iopgd_is_table(*iopgd)) { |
789 | dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__, | 808 | dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__, |
790 | da, iopgd, *iopgd); | 809 | da, iopgd, *iopgd); |
791 | return IRQ_NONE; | 810 | return IRQ_NONE; |
diff --git a/arch/arm/plat-omap/iopgtable.h b/arch/arm/plat-omap/iopgtable.h index ab23b6a140fd..c3e93bb0911f 100644 --- a/arch/arm/plat-omap/iopgtable.h +++ b/arch/arm/plat-omap/iopgtable.h | |||
@@ -63,6 +63,8 @@ | |||
63 | #define IOPGD_SECTION (2 << 0) | 63 | #define IOPGD_SECTION (2 << 0) |
64 | #define IOPGD_SUPER (1 << 18 | 2 << 0) | 64 | #define IOPGD_SUPER (1 << 18 | 2 << 0) |
65 | 65 | ||
66 | #define iopgd_is_table(x) (((x) & 3) == IOPGD_TABLE) | ||
67 | |||
66 | #define IOPTE_SMALL (2 << 0) | 68 | #define IOPTE_SMALL (2 << 0) |
67 | #define IOPTE_LARGE (1 << 0) | 69 | #define IOPTE_LARGE (1 << 0) |
68 | 70 | ||
@@ -70,12 +72,12 @@ | |||
70 | #define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1)) | 72 | #define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1)) |
71 | #define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da)) | 73 | #define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da)) |
72 | 74 | ||
73 | #define iopte_paddr(iopgd) (*iopgd & ~((1 << 10) - 1)) | 75 | #define iopgd_page_paddr(iopgd) (*iopgd & ~((1 << 10) - 1)) |
74 | #define iopte_vaddr(iopgd) ((u32 *)phys_to_virt(iopte_paddr(iopgd))) | 76 | #define iopgd_page_vaddr(iopgd) ((u32 *)phys_to_virt(iopgd_page_paddr(iopgd))) |
75 | 77 | ||
76 | /* to find an entry in the second-level page table. */ | 78 | /* to find an entry in the second-level page table. */ |
77 | #define iopte_index(da) (((da) >> IOPTE_SHIFT) & (PTRS_PER_IOPTE - 1)) | 79 | #define iopte_index(da) (((da) >> IOPTE_SHIFT) & (PTRS_PER_IOPTE - 1)) |
78 | #define iopte_offset(iopgd, da) (iopte_vaddr(iopgd) + iopte_index(da)) | 80 | #define iopte_offset(iopgd, da) (iopgd_page_vaddr(iopgd) + iopte_index(da)) |
79 | 81 | ||
80 | static inline u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa, | 82 | static inline u32 iotlb_init_entry(struct iotlb_entry *e, u32 da, u32 pa, |
81 | u32 flags) | 83 | u32 flags) |
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c index 06703635ace1..0d4aa0d5876c 100644 --- a/arch/arm/plat-omap/mux.c +++ b/arch/arm/plat-omap/mux.c | |||
@@ -54,7 +54,7 @@ int __init_or_module omap_cfg_reg(const unsigned long index) | |||
54 | { | 54 | { |
55 | struct pin_config *reg; | 55 | struct pin_config *reg; |
56 | 56 | ||
57 | if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | 57 | if (!cpu_class_is_omap1()) { |
58 | printk(KERN_ERR "mux: Broken omap_cfg_reg(%lu) entry\n", | 58 | printk(KERN_ERR "mux: Broken omap_cfg_reg(%lu) entry\n", |
59 | index); | 59 | index); |
60 | WARN_ON(1); | 60 | WARN_ON(1); |
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c index d3bf17cd36f3..f3570884883e 100644 --- a/arch/arm/plat-omap/usb.c +++ b/arch/arm/plat-omap/usb.c | |||
@@ -22,524 +22,13 @@ | |||
22 | 22 | ||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/types.h> | ||
26 | #include <linux/errno.h> | ||
27 | #include <linux/init.h> | 25 | #include <linux/init.h> |
28 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
29 | #include <linux/usb/otg.h> | ||
30 | #include <linux/io.h> | 27 | #include <linux/io.h> |
31 | 28 | ||
32 | #include <asm/irq.h> | ||
33 | #include <asm/system.h> | ||
34 | #include <mach/hardware.h> | ||
35 | |||
36 | #include <plat/control.h> | ||
37 | #include <plat/mux.h> | ||
38 | #include <plat/usb.h> | 29 | #include <plat/usb.h> |
39 | #include <plat/board.h> | 30 | #include <plat/board.h> |
40 | 31 | ||
41 | #ifdef CONFIG_ARCH_OMAP1 | ||
42 | |||
43 | #define INT_USB_IRQ_GEN IH2_BASE + 20 | ||
44 | #define INT_USB_IRQ_NISO IH2_BASE + 30 | ||
45 | #define INT_USB_IRQ_ISO IH2_BASE + 29 | ||
46 | #define INT_USB_IRQ_HGEN INT_USB_HHC_1 | ||
47 | #define INT_USB_IRQ_OTG IH2_BASE + 8 | ||
48 | |||
49 | #else | ||
50 | |||
51 | #define INT_USB_IRQ_GEN INT_24XX_USB_IRQ_GEN | ||
52 | #define INT_USB_IRQ_NISO INT_24XX_USB_IRQ_NISO | ||
53 | #define INT_USB_IRQ_ISO INT_24XX_USB_IRQ_ISO | ||
54 | #define INT_USB_IRQ_HGEN INT_24XX_USB_IRQ_HGEN | ||
55 | #define INT_USB_IRQ_OTG INT_24XX_USB_IRQ_OTG | ||
56 | |||
57 | #endif | ||
58 | |||
59 | |||
60 | /* These routines should handle the standard chip-specific modes | ||
61 | * for usb0/1/2 ports, covering basic mux and transceiver setup. | ||
62 | * | ||
63 | * Some board-*.c files will need to set up additional mux options, | ||
64 | * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup. | ||
65 | */ | ||
66 | |||
67 | /* TESTED ON: | ||
68 | * - 1611B H2 (with usb1 mini-AB) using standard Mini-B or OTG cables | ||
69 | * - 5912 OSK OHCI (with usb0 standard-A), standard A-to-B cables | ||
70 | * - 5912 OSK UDC, with *nonstandard* A-to-A cable | ||
71 | * - 1510 Innovator UDC with bundled usb0 cable | ||
72 | * - 1510 Innovator OHCI with bundled usb1/usb2 cable | ||
73 | * - 1510 Innovator OHCI with custom usb0 cable, feeding 5V VBUS | ||
74 | * - 1710 custom development board using alternate pin group | ||
75 | * - 1710 H3 (with usb1 mini-AB) using standard Mini-B or OTG cables | ||
76 | */ | ||
77 | |||
78 | /*-------------------------------------------------------------------------*/ | ||
79 | |||
80 | #if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP15XX) | ||
81 | |||
82 | static void omap2_usb_devconf_clear(u8 port, u32 mask) | ||
83 | { | ||
84 | u32 r; | ||
85 | |||
86 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
87 | r &= ~USBTXWRMODEI(port, mask); | ||
88 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
89 | } | ||
90 | |||
91 | static void omap2_usb_devconf_set(u8 port, u32 mask) | ||
92 | { | ||
93 | u32 r; | ||
94 | |||
95 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
96 | r |= USBTXWRMODEI(port, mask); | ||
97 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
98 | } | ||
99 | |||
100 | static void omap2_usb2_disable_5pinbitll(void) | ||
101 | { | ||
102 | u32 r; | ||
103 | |||
104 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
105 | r &= ~(USBTXWRMODEI(2, USB_BIDIR_TLL) | USBT2TLL5PI); | ||
106 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
107 | } | ||
108 | |||
109 | static void omap2_usb2_enable_5pinunitll(void) | ||
110 | { | ||
111 | u32 r; | ||
112 | |||
113 | r = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
114 | r |= USBTXWRMODEI(2, USB_UNIDIR_TLL) | USBT2TLL5PI; | ||
115 | omap_ctrl_writel(r, OMAP2_CONTROL_DEVCONF0); | ||
116 | } | ||
117 | |||
118 | static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device) | ||
119 | { | ||
120 | u32 syscon1 = 0; | ||
121 | |||
122 | if (cpu_is_omap24xx()) | ||
123 | omap2_usb_devconf_clear(0, USB_BIDIR_TLL); | ||
124 | |||
125 | if (nwires == 0) { | ||
126 | if (cpu_class_is_omap1() && !cpu_is_omap15xx()) { | ||
127 | u32 l; | ||
128 | |||
129 | /* pulldown D+/D- */ | ||
130 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
131 | l &= ~(3 << 1); | ||
132 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
133 | } | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | if (is_device) { | ||
138 | if (cpu_is_omap24xx()) | ||
139 | omap_cfg_reg(J20_24XX_USB0_PUEN); | ||
140 | else if (cpu_is_omap7xx()) { | ||
141 | omap_cfg_reg(AA17_7XX_USB_DM); | ||
142 | omap_cfg_reg(W16_7XX_USB_PU_EN); | ||
143 | omap_cfg_reg(W17_7XX_USB_VBUSI); | ||
144 | omap_cfg_reg(W18_7XX_USB_DMCK_OUT); | ||
145 | omap_cfg_reg(W19_7XX_USB_DCRST); | ||
146 | } else | ||
147 | omap_cfg_reg(W4_USB_PUEN); | ||
148 | } | ||
149 | |||
150 | /* internal transceiver (unavailable on 17xx, 24xx) */ | ||
151 | if (!cpu_class_is_omap2() && nwires == 2) { | ||
152 | u32 l; | ||
153 | |||
154 | // omap_cfg_reg(P9_USB_DP); | ||
155 | // omap_cfg_reg(R8_USB_DM); | ||
156 | |||
157 | if (cpu_is_omap15xx()) { | ||
158 | /* This works on 1510-Innovator */ | ||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | /* NOTES: | ||
163 | * - peripheral should configure VBUS detection! | ||
164 | * - only peripherals may use the internal D+/D- pulldowns | ||
165 | * - OTG support on this port not yet written | ||
166 | */ | ||
167 | |||
168 | /* Don't do this for omap7xx -- it causes USB to not work correctly */ | ||
169 | if (!cpu_is_omap7xx()) { | ||
170 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
171 | l &= ~(7 << 4); | ||
172 | if (!is_device) | ||
173 | l |= (3 << 1); | ||
174 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
175 | } | ||
176 | |||
177 | return 3 << 16; | ||
178 | } | ||
179 | |||
180 | /* alternate pin config, external transceiver */ | ||
181 | if (cpu_is_omap15xx()) { | ||
182 | printk(KERN_ERR "no usb0 alt pin config on 15xx\n"); | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | if (cpu_is_omap24xx()) { | ||
187 | omap_cfg_reg(K18_24XX_USB0_DAT); | ||
188 | omap_cfg_reg(K19_24XX_USB0_TXEN); | ||
189 | omap_cfg_reg(J14_24XX_USB0_SE0); | ||
190 | if (nwires != 3) | ||
191 | omap_cfg_reg(J18_24XX_USB0_RCV); | ||
192 | } else { | ||
193 | omap_cfg_reg(V6_USB0_TXD); | ||
194 | omap_cfg_reg(W9_USB0_TXEN); | ||
195 | omap_cfg_reg(W5_USB0_SE0); | ||
196 | if (nwires != 3) | ||
197 | omap_cfg_reg(Y5_USB0_RCV); | ||
198 | } | ||
199 | |||
200 | /* NOTE: SPEED and SUSP aren't configured here. OTG hosts | ||
201 | * may be able to use I2C requests to set those bits along | ||
202 | * with VBUS switching and overcurrent detection. | ||
203 | */ | ||
204 | |||
205 | if (cpu_class_is_omap1() && nwires != 6) { | ||
206 | u32 l; | ||
207 | |||
208 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
209 | l &= ~CONF_USB2_UNI_R; | ||
210 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
211 | } | ||
212 | |||
213 | switch (nwires) { | ||
214 | case 3: | ||
215 | syscon1 = 2; | ||
216 | if (cpu_is_omap24xx()) | ||
217 | omap2_usb_devconf_set(0, USB_BIDIR); | ||
218 | break; | ||
219 | case 4: | ||
220 | syscon1 = 1; | ||
221 | if (cpu_is_omap24xx()) | ||
222 | omap2_usb_devconf_set(0, USB_BIDIR); | ||
223 | break; | ||
224 | case 6: | ||
225 | syscon1 = 3; | ||
226 | if (cpu_is_omap24xx()) { | ||
227 | omap_cfg_reg(J19_24XX_USB0_VP); | ||
228 | omap_cfg_reg(K20_24XX_USB0_VM); | ||
229 | omap2_usb_devconf_set(0, USB_UNIDIR); | ||
230 | } else { | ||
231 | u32 l; | ||
232 | |||
233 | omap_cfg_reg(AA9_USB0_VP); | ||
234 | omap_cfg_reg(R9_USB0_VM); | ||
235 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
236 | l |= CONF_USB2_UNI_R; | ||
237 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
238 | } | ||
239 | break; | ||
240 | default: | ||
241 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
242 | 0, nwires); | ||
243 | } | ||
244 | return syscon1 << 16; | ||
245 | } | ||
246 | |||
247 | static u32 __init omap_usb1_init(unsigned nwires) | ||
248 | { | ||
249 | u32 syscon1 = 0; | ||
250 | |||
251 | if (cpu_class_is_omap1() && !cpu_is_omap15xx() && nwires != 6) { | ||
252 | u32 l; | ||
253 | |||
254 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
255 | l &= ~CONF_USB1_UNI_R; | ||
256 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
257 | } | ||
258 | if (cpu_is_omap24xx()) | ||
259 | omap2_usb_devconf_clear(1, USB_BIDIR_TLL); | ||
260 | |||
261 | if (nwires == 0) | ||
262 | return 0; | ||
263 | |||
264 | /* external transceiver */ | ||
265 | if (cpu_class_is_omap1()) { | ||
266 | omap_cfg_reg(USB1_TXD); | ||
267 | omap_cfg_reg(USB1_TXEN); | ||
268 | if (nwires != 3) | ||
269 | omap_cfg_reg(USB1_RCV); | ||
270 | } | ||
271 | |||
272 | if (cpu_is_omap15xx()) { | ||
273 | omap_cfg_reg(USB1_SEO); | ||
274 | omap_cfg_reg(USB1_SPEED); | ||
275 | // SUSP | ||
276 | } else if (cpu_is_omap1610() || cpu_is_omap5912()) { | ||
277 | omap_cfg_reg(W13_1610_USB1_SE0); | ||
278 | omap_cfg_reg(R13_1610_USB1_SPEED); | ||
279 | // SUSP | ||
280 | } else if (cpu_is_omap1710()) { | ||
281 | omap_cfg_reg(R13_1710_USB1_SE0); | ||
282 | // SUSP | ||
283 | } else if (cpu_is_omap24xx()) { | ||
284 | /* NOTE: board-specific code must set up pin muxing for usb1, | ||
285 | * since each signal could come out on either of two balls. | ||
286 | */ | ||
287 | } else { | ||
288 | pr_debug("usb%d cpu unrecognized\n", 1); | ||
289 | return 0; | ||
290 | } | ||
291 | |||
292 | switch (nwires) { | ||
293 | case 2: | ||
294 | if (!cpu_is_omap24xx()) | ||
295 | goto bad; | ||
296 | /* NOTE: board-specific code must override this setting if | ||
297 | * this TLL link is not using DP/DM | ||
298 | */ | ||
299 | syscon1 = 1; | ||
300 | omap2_usb_devconf_set(1, USB_BIDIR_TLL); | ||
301 | break; | ||
302 | case 3: | ||
303 | syscon1 = 2; | ||
304 | if (cpu_is_omap24xx()) | ||
305 | omap2_usb_devconf_set(1, USB_BIDIR); | ||
306 | break; | ||
307 | case 4: | ||
308 | syscon1 = 1; | ||
309 | if (cpu_is_omap24xx()) | ||
310 | omap2_usb_devconf_set(1, USB_BIDIR); | ||
311 | break; | ||
312 | case 6: | ||
313 | if (cpu_is_omap24xx()) | ||
314 | goto bad; | ||
315 | syscon1 = 3; | ||
316 | omap_cfg_reg(USB1_VP); | ||
317 | omap_cfg_reg(USB1_VM); | ||
318 | if (!cpu_is_omap15xx()) { | ||
319 | u32 l; | ||
320 | |||
321 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
322 | l |= CONF_USB1_UNI_R; | ||
323 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
324 | } | ||
325 | break; | ||
326 | default: | ||
327 | bad: | ||
328 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
329 | 1, nwires); | ||
330 | } | ||
331 | return syscon1 << 20; | ||
332 | } | ||
333 | |||
334 | static u32 __init omap_usb2_init(unsigned nwires, unsigned alt_pingroup) | ||
335 | { | ||
336 | u32 syscon1 = 0; | ||
337 | |||
338 | if (cpu_is_omap24xx()) { | ||
339 | omap2_usb2_disable_5pinbitll(); | ||
340 | alt_pingroup = 0; | ||
341 | } | ||
342 | |||
343 | /* NOTE omap1 erratum: must leave USB2_UNI_R set if usb0 in use */ | ||
344 | if (alt_pingroup || nwires == 0) | ||
345 | return 0; | ||
346 | |||
347 | if (cpu_class_is_omap1() && !cpu_is_omap15xx() && nwires != 6) { | ||
348 | u32 l; | ||
349 | |||
350 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
351 | l &= ~CONF_USB2_UNI_R; | ||
352 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
353 | } | ||
354 | |||
355 | /* external transceiver */ | ||
356 | if (cpu_is_omap15xx()) { | ||
357 | omap_cfg_reg(USB2_TXD); | ||
358 | omap_cfg_reg(USB2_TXEN); | ||
359 | omap_cfg_reg(USB2_SEO); | ||
360 | if (nwires != 3) | ||
361 | omap_cfg_reg(USB2_RCV); | ||
362 | /* there is no USB2_SPEED */ | ||
363 | } else if (cpu_is_omap16xx()) { | ||
364 | omap_cfg_reg(V6_USB2_TXD); | ||
365 | omap_cfg_reg(W9_USB2_TXEN); | ||
366 | omap_cfg_reg(W5_USB2_SE0); | ||
367 | if (nwires != 3) | ||
368 | omap_cfg_reg(Y5_USB2_RCV); | ||
369 | // FIXME omap_cfg_reg(USB2_SPEED); | ||
370 | } else if (cpu_is_omap24xx()) { | ||
371 | omap_cfg_reg(Y11_24XX_USB2_DAT); | ||
372 | omap_cfg_reg(AA10_24XX_USB2_SE0); | ||
373 | if (nwires > 2) | ||
374 | omap_cfg_reg(AA12_24XX_USB2_TXEN); | ||
375 | if (nwires > 3) | ||
376 | omap_cfg_reg(AA6_24XX_USB2_RCV); | ||
377 | } else { | ||
378 | pr_debug("usb%d cpu unrecognized\n", 1); | ||
379 | return 0; | ||
380 | } | ||
381 | // if (cpu_class_is_omap1()) omap_cfg_reg(USB2_SUSP); | ||
382 | |||
383 | switch (nwires) { | ||
384 | case 2: | ||
385 | if (!cpu_is_omap24xx()) | ||
386 | goto bad; | ||
387 | /* NOTE: board-specific code must override this setting if | ||
388 | * this TLL link is not using DP/DM | ||
389 | */ | ||
390 | syscon1 = 1; | ||
391 | omap2_usb_devconf_set(2, USB_BIDIR_TLL); | ||
392 | break; | ||
393 | case 3: | ||
394 | syscon1 = 2; | ||
395 | if (cpu_is_omap24xx()) | ||
396 | omap2_usb_devconf_set(2, USB_BIDIR); | ||
397 | break; | ||
398 | case 4: | ||
399 | syscon1 = 1; | ||
400 | if (cpu_is_omap24xx()) | ||
401 | omap2_usb_devconf_set(2, USB_BIDIR); | ||
402 | break; | ||
403 | case 5: | ||
404 | if (!cpu_is_omap24xx()) | ||
405 | goto bad; | ||
406 | omap_cfg_reg(AA4_24XX_USB2_TLLSE0); | ||
407 | /* NOTE: board-specific code must override this setting if | ||
408 | * this TLL link is not using DP/DM. Something must also | ||
409 | * set up OTG_SYSCON2.HMC_TLL{ATTACH,SPEED} | ||
410 | */ | ||
411 | syscon1 = 3; | ||
412 | omap2_usb2_enable_5pinunitll(); | ||
413 | break; | ||
414 | case 6: | ||
415 | if (cpu_is_omap24xx()) | ||
416 | goto bad; | ||
417 | syscon1 = 3; | ||
418 | if (cpu_is_omap15xx()) { | ||
419 | omap_cfg_reg(USB2_VP); | ||
420 | omap_cfg_reg(USB2_VM); | ||
421 | } else { | ||
422 | u32 l; | ||
423 | |||
424 | omap_cfg_reg(AA9_USB2_VP); | ||
425 | omap_cfg_reg(R9_USB2_VM); | ||
426 | l = omap_readl(USB_TRANSCEIVER_CTRL); | ||
427 | l |= CONF_USB2_UNI_R; | ||
428 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
429 | } | ||
430 | break; | ||
431 | default: | ||
432 | bad: | ||
433 | printk(KERN_ERR "illegal usb%d %d-wire transceiver\n", | ||
434 | 2, nwires); | ||
435 | } | ||
436 | return syscon1 << 24; | ||
437 | } | ||
438 | |||
439 | #endif | ||
440 | |||
441 | /*-------------------------------------------------------------------------*/ | ||
442 | |||
443 | #ifdef CONFIG_USB_GADGET_OMAP | ||
444 | |||
445 | static struct resource udc_resources[] = { | ||
446 | /* order is significant! */ | ||
447 | { /* registers */ | ||
448 | .start = UDC_BASE, | ||
449 | .end = UDC_BASE + 0xff, | ||
450 | .flags = IORESOURCE_MEM, | ||
451 | }, { /* general IRQ */ | ||
452 | .start = INT_USB_IRQ_GEN, | ||
453 | .flags = IORESOURCE_IRQ, | ||
454 | }, { /* PIO IRQ */ | ||
455 | .start = INT_USB_IRQ_NISO, | ||
456 | .flags = IORESOURCE_IRQ, | ||
457 | }, { /* SOF IRQ */ | ||
458 | .start = INT_USB_IRQ_ISO, | ||
459 | .flags = IORESOURCE_IRQ, | ||
460 | }, | ||
461 | }; | ||
462 | |||
463 | static u64 udc_dmamask = ~(u32)0; | ||
464 | |||
465 | static struct platform_device udc_device = { | ||
466 | .name = "omap_udc", | ||
467 | .id = -1, | ||
468 | .dev = { | ||
469 | .dma_mask = &udc_dmamask, | ||
470 | .coherent_dma_mask = 0xffffffff, | ||
471 | }, | ||
472 | .num_resources = ARRAY_SIZE(udc_resources), | ||
473 | .resource = udc_resources, | ||
474 | }; | ||
475 | |||
476 | #endif | ||
477 | |||
478 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
479 | |||
480 | /* The dmamask must be set for OHCI to work */ | ||
481 | static u64 ohci_dmamask = ~(u32)0; | ||
482 | |||
483 | static struct resource ohci_resources[] = { | ||
484 | { | ||
485 | .start = OMAP_OHCI_BASE, | ||
486 | .end = OMAP_OHCI_BASE + 0xff, | ||
487 | .flags = IORESOURCE_MEM, | ||
488 | }, | ||
489 | { | ||
490 | .start = INT_USB_IRQ_HGEN, | ||
491 | .flags = IORESOURCE_IRQ, | ||
492 | }, | ||
493 | }; | ||
494 | |||
495 | static struct platform_device ohci_device = { | ||
496 | .name = "ohci", | ||
497 | .id = -1, | ||
498 | .dev = { | ||
499 | .dma_mask = &ohci_dmamask, | ||
500 | .coherent_dma_mask = 0xffffffff, | ||
501 | }, | ||
502 | .num_resources = ARRAY_SIZE(ohci_resources), | ||
503 | .resource = ohci_resources, | ||
504 | }; | ||
505 | |||
506 | #endif | ||
507 | |||
508 | #if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG) | ||
509 | |||
510 | static struct resource otg_resources[] = { | ||
511 | /* order is significant! */ | ||
512 | { | ||
513 | .start = OTG_BASE, | ||
514 | .end = OTG_BASE + 0xff, | ||
515 | .flags = IORESOURCE_MEM, | ||
516 | }, { | ||
517 | .start = INT_USB_IRQ_OTG, | ||
518 | .flags = IORESOURCE_IRQ, | ||
519 | }, | ||
520 | }; | ||
521 | |||
522 | static struct platform_device otg_device = { | ||
523 | .name = "omap_otg", | ||
524 | .id = -1, | ||
525 | .num_resources = ARRAY_SIZE(otg_resources), | ||
526 | .resource = otg_resources, | ||
527 | }; | ||
528 | |||
529 | #endif | ||
530 | |||
531 | /*-------------------------------------------------------------------------*/ | ||
532 | |||
533 | // FIXME correct answer depends on hmc_mode, | ||
534 | // as does (on omap1) any nonzero value for config->otg port number | ||
535 | #ifdef CONFIG_USB_GADGET_OMAP | ||
536 | #define is_usb0_device(config) 1 | ||
537 | #else | ||
538 | #define is_usb0_device(config) 0 | ||
539 | #endif | ||
540 | |||
541 | /*-------------------------------------------------------------------------*/ | ||
542 | |||
543 | #ifdef CONFIG_ARCH_OMAP_OTG | 32 | #ifdef CONFIG_ARCH_OMAP_OTG |
544 | 33 | ||
545 | void __init | 34 | void __init |
@@ -560,9 +49,9 @@ omap_otg_init(struct omap_usb_config *config) | |||
560 | /* pin muxing and transceiver pinouts */ | 49 | /* pin muxing and transceiver pinouts */ |
561 | if (config->pins[0] > 2) /* alt pingroup 2 */ | 50 | if (config->pins[0] > 2) /* alt pingroup 2 */ |
562 | alt_pingroup = 1; | 51 | alt_pingroup = 1; |
563 | syscon |= omap_usb0_init(config->pins[0], is_usb0_device(config)); | 52 | syscon |= config->usb0_init(config->pins[0], is_usb0_device(config)); |
564 | syscon |= omap_usb1_init(config->pins[1]); | 53 | syscon |= config->usb1_init(config->pins[1]); |
565 | syscon |= omap_usb2_init(config->pins[2], alt_pingroup); | 54 | syscon |= config->usb2_init(config->pins[2], alt_pingroup); |
566 | pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1)); | 55 | pr_debug("OTG_SYSCON_1 = %08x\n", omap_readl(OTG_SYSCON_1)); |
567 | omap_writel(syscon, OTG_SYSCON_1); | 56 | omap_writel(syscon, OTG_SYSCON_1); |
568 | 57 | ||
@@ -610,15 +99,11 @@ omap_otg_init(struct omap_usb_config *config) | |||
610 | 99 | ||
611 | #ifdef CONFIG_USB_GADGET_OMAP | 100 | #ifdef CONFIG_USB_GADGET_OMAP |
612 | if (config->otg || config->register_dev) { | 101 | if (config->otg || config->register_dev) { |
102 | struct platform_device *udc_device = config->udc_device; | ||
103 | |||
613 | syscon &= ~DEV_IDLE_EN; | 104 | syscon &= ~DEV_IDLE_EN; |
614 | udc_device.dev.platform_data = config; | 105 | udc_device->dev.platform_data = config; |
615 | /* IRQ numbers for omap7xx */ | 106 | status = platform_device_register(udc_device); |
616 | if(cpu_is_omap7xx()) { | ||
617 | udc_resources[1].start = INT_7XX_USB_GENI; | ||
618 | udc_resources[2].start = INT_7XX_USB_NON_ISO; | ||
619 | udc_resources[3].start = INT_7XX_USB_ISO; | ||
620 | } | ||
621 | status = platform_device_register(&udc_device); | ||
622 | if (status) | 107 | if (status) |
623 | pr_debug("can't register UDC device, %d\n", status); | 108 | pr_debug("can't register UDC device, %d\n", status); |
624 | } | 109 | } |
@@ -626,11 +111,11 @@ omap_otg_init(struct omap_usb_config *config) | |||
626 | 111 | ||
627 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 112 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
628 | if (config->otg || config->register_host) { | 113 | if (config->otg || config->register_host) { |
114 | struct platform_device *ohci_device = config->ohci_device; | ||
115 | |||
629 | syscon &= ~HST_IDLE_EN; | 116 | syscon &= ~HST_IDLE_EN; |
630 | ohci_device.dev.platform_data = config; | 117 | ohci_device->dev.platform_data = config; |
631 | if (cpu_is_omap7xx()) | 118 | status = platform_device_register(ohci_device); |
632 | ohci_resources[1].start = INT_7XX_USB_HHC_1; | ||
633 | status = platform_device_register(&ohci_device); | ||
634 | if (status) | 119 | if (status) |
635 | pr_debug("can't register OHCI device, %d\n", status); | 120 | pr_debug("can't register OHCI device, %d\n", status); |
636 | } | 121 | } |
@@ -638,11 +123,11 @@ omap_otg_init(struct omap_usb_config *config) | |||
638 | 123 | ||
639 | #ifdef CONFIG_USB_OTG | 124 | #ifdef CONFIG_USB_OTG |
640 | if (config->otg) { | 125 | if (config->otg) { |
126 | struct platform_device *otg_device = config->otg_device; | ||
127 | |||
641 | syscon &= ~OTG_IDLE_EN; | 128 | syscon &= ~OTG_IDLE_EN; |
642 | otg_device.dev.platform_data = config; | 129 | otg_device->dev.platform_data = config; |
643 | if (cpu_is_omap7xx()) | 130 | status = platform_device_register(otg_device); |
644 | otg_resources[1].start = INT_7XX_USB_OTG; | ||
645 | status = platform_device_register(&otg_device); | ||
646 | if (status) | 131 | if (status) |
647 | pr_debug("can't register OTG device, %d\n", status); | 132 | pr_debug("can't register OTG device, %d\n", status); |
648 | } | 133 | } |
@@ -654,102 +139,5 @@ omap_otg_init(struct omap_usb_config *config) | |||
654 | } | 139 | } |
655 | 140 | ||
656 | #else | 141 | #else |
657 | static inline void omap_otg_init(struct omap_usb_config *config) {} | 142 | void omap_otg_init(struct omap_usb_config *config) {} |
658 | #endif | ||
659 | |||
660 | /*-------------------------------------------------------------------------*/ | ||
661 | |||
662 | #ifdef CONFIG_ARCH_OMAP15XX | ||
663 | |||
664 | /* ULPD_DPLL_CTRL */ | ||
665 | #define DPLL_IOB (1 << 13) | ||
666 | #define DPLL_PLL_ENABLE (1 << 4) | ||
667 | #define DPLL_LOCK (1 << 0) | ||
668 | |||
669 | /* ULPD_APLL_CTRL */ | ||
670 | #define APLL_NDPLL_SWITCH (1 << 0) | ||
671 | |||
672 | |||
673 | static void __init omap_1510_usb_init(struct omap_usb_config *config) | ||
674 | { | ||
675 | unsigned int val; | ||
676 | u16 w; | ||
677 | |||
678 | omap_usb0_init(config->pins[0], is_usb0_device(config)); | ||
679 | omap_usb1_init(config->pins[1]); | ||
680 | omap_usb2_init(config->pins[2], 0); | ||
681 | |||
682 | val = omap_readl(MOD_CONF_CTRL_0) & ~(0x3f << 1); | ||
683 | val |= (config->hmc_mode << 1); | ||
684 | omap_writel(val, MOD_CONF_CTRL_0); | ||
685 | |||
686 | printk("USB: hmc %d", config->hmc_mode); | ||
687 | if (config->pins[0]) | ||
688 | printk(", usb0 %d wires%s", config->pins[0], | ||
689 | is_usb0_device(config) ? " (dev)" : ""); | ||
690 | if (config->pins[1]) | ||
691 | printk(", usb1 %d wires", config->pins[1]); | ||
692 | if (config->pins[2]) | ||
693 | printk(", usb2 %d wires", config->pins[2]); | ||
694 | printk("\n"); | ||
695 | |||
696 | /* use DPLL for 48 MHz function clock */ | ||
697 | pr_debug("APLL %04x DPLL %04x REQ %04x\n", omap_readw(ULPD_APLL_CTRL), | ||
698 | omap_readw(ULPD_DPLL_CTRL), omap_readw(ULPD_SOFT_REQ)); | ||
699 | |||
700 | w = omap_readw(ULPD_APLL_CTRL); | ||
701 | w &= ~APLL_NDPLL_SWITCH; | ||
702 | omap_writew(w, ULPD_APLL_CTRL); | ||
703 | |||
704 | w = omap_readw(ULPD_DPLL_CTRL); | ||
705 | w |= DPLL_IOB | DPLL_PLL_ENABLE; | ||
706 | omap_writew(w, ULPD_DPLL_CTRL); | ||
707 | |||
708 | w = omap_readw(ULPD_SOFT_REQ); | ||
709 | w |= SOFT_UDC_REQ | SOFT_DPLL_REQ; | ||
710 | omap_writew(w, ULPD_SOFT_REQ); | ||
711 | |||
712 | while (!(omap_readw(ULPD_DPLL_CTRL) & DPLL_LOCK)) | ||
713 | cpu_relax(); | ||
714 | |||
715 | #ifdef CONFIG_USB_GADGET_OMAP | ||
716 | if (config->register_dev) { | ||
717 | int status; | ||
718 | |||
719 | udc_device.dev.platform_data = config; | ||
720 | status = platform_device_register(&udc_device); | ||
721 | if (status) | ||
722 | pr_debug("can't register UDC device, %d\n", status); | ||
723 | /* udc driver gates 48MHz by D+ pullup */ | ||
724 | } | ||
725 | #endif | ||
726 | |||
727 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
728 | if (config->register_host) { | ||
729 | int status; | ||
730 | |||
731 | ohci_device.dev.platform_data = config; | ||
732 | status = platform_device_register(&ohci_device); | ||
733 | if (status) | ||
734 | pr_debug("can't register OHCI device, %d\n", status); | ||
735 | /* hcd explicitly gates 48MHz */ | ||
736 | } | ||
737 | #endif | ||
738 | } | ||
739 | |||
740 | #else | ||
741 | static inline void omap_1510_usb_init(struct omap_usb_config *config) {} | ||
742 | #endif | 143 | #endif |
743 | |||
744 | /*-------------------------------------------------------------------------*/ | ||
745 | |||
746 | void __init omap_usb_init(struct omap_usb_config *pdata) | ||
747 | { | ||
748 | if (cpu_is_omap7xx() || cpu_is_omap16xx() || cpu_is_omap24xx()) | ||
749 | omap_otg_init(pdata); | ||
750 | else if (cpu_is_omap15xx()) | ||
751 | omap_1510_usb_init(pdata); | ||
752 | else | ||
753 | printk(KERN_ERR "USB: No init for your chip yet\n"); | ||
754 | } | ||
755 | |||
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S index 1670734b7e51..37fa593884ee 100644 --- a/arch/arm/plat-spear/include/plat/debug-macro.S +++ b/arch/arm/plat-spear/include/plat/debug-macro.S | |||
@@ -17,8 +17,8 @@ | |||
17 | .macro addruart, rx | 17 | .macro addruart, rx |
18 | mrc p15, 0, \rx, c1, c0 | 18 | mrc p15, 0, \rx, c1, c0 |
19 | tst \rx, #1 @ MMU enabled? | 19 | tst \rx, #1 @ MMU enabled? |
20 | moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base | 20 | moveq \rx, #SPEAR_DBG_UART_BASE @ Physical base |
21 | movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base | 21 | movne \rx, #VA_SPEAR_DBG_UART_BASE @ Virtual base |
22 | .endm | 22 | .endm |
23 | 23 | ||
24 | .macro senduart, rd, rx | 24 | .macro senduart, rd, rx |
diff --git a/arch/avr32/include/asm/ioctls.h b/arch/avr32/include/asm/ioctls.h index 0cf2c0a4502b..e6ac0b661076 100644 --- a/arch/avr32/include/asm/ioctls.h +++ b/arch/avr32/include/asm/ioctls.h | |||
@@ -54,6 +54,9 @@ | |||
54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
56 | 56 | ||
57 | #define TIOCGRS485 0x542E | ||
58 | #define TIOCSRS485 0x542F | ||
59 | |||
57 | #define FIONCLEX 0x5450 | 60 | #define FIONCLEX 0x5450 |
58 | #define FIOCLEX 0x5451 | 61 | #define FIOCLEX 0x5451 |
59 | #define FIOASYNC 0x5452 | 62 | #define FIOASYNC 0x5452 |
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index c7f25bb1d068..61740201b311 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #define __ASM_ARCH_BOARD_H | 5 | #define __ASM_ARCH_BOARD_H |
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/serial.h> | ||
8 | 9 | ||
9 | #define GPIO_PIN_NONE (-1) | 10 | #define GPIO_PIN_NONE (-1) |
10 | 11 | ||
@@ -35,6 +36,7 @@ struct atmel_uart_data { | |||
35 | short use_dma_tx; /* use transmit DMA? */ | 36 | short use_dma_tx; /* use transmit DMA? */ |
36 | short use_dma_rx; /* use receive DMA? */ | 37 | short use_dma_rx; /* use receive DMA? */ |
37 | void __iomem *regs; /* virtual base address, if any */ | 38 | void __iomem *regs; /* virtual base address, if any */ |
39 | struct serial_rs485 rs485; /* rs485 settings */ | ||
38 | }; | 40 | }; |
39 | void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); | 41 | void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); |
40 | struct platform_device *at32_add_device_usart(unsigned int id); | 42 | struct platform_device *at32_add_device_usart(unsigned int id); |
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 2580e77624d2..f9e5622ebc95 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c | |||
@@ -435,20 +435,21 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = { | |||
435 | static int __init au1xxx_platform_init(void) | 435 | static int __init au1xxx_platform_init(void) |
436 | { | 436 | { |
437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; | 437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; |
438 | int i; | 438 | int err, i; |
439 | 439 | ||
440 | /* Fill up uartclk. */ | 440 | /* Fill up uartclk. */ |
441 | for (i = 0; au1x00_uart_data[i].flags; i++) | 441 | for (i = 0; au1x00_uart_data[i].flags; i++) |
442 | au1x00_uart_data[i].uartclk = uartclk; | 442 | au1x00_uart_data[i].uartclk = uartclk; |
443 | 443 | ||
444 | err = platform_add_devices(au1xxx_platform_devices, | ||
445 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
444 | #ifndef CONFIG_SOC_AU1100 | 446 | #ifndef CONFIG_SOC_AU1100 |
445 | /* Register second MAC if enabled in pinfunc */ | 447 | /* Register second MAC if enabled in pinfunc */ |
446 | if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) | 448 | if (!err && !(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) |
447 | platform_device_register(&au1xxx_eth1_device); | 449 | platform_device_register(&au1xxx_eth1_device); |
448 | #endif | 450 | #endif |
449 | 451 | ||
450 | return platform_add_devices(au1xxx_platform_devices, | 452 | return err; |
451 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
452 | } | 453 | } |
453 | 454 | ||
454 | arch_initcall(au1xxx_platform_init); | 455 | arch_initcall(au1xxx_platform_init); |
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c index a9f0336e1f1f..52d883d37dd7 100644 --- a/arch/mips/alchemy/mtx-1/board_setup.c +++ b/arch/mips/alchemy/mtx-1/board_setup.c | |||
@@ -67,8 +67,6 @@ static void mtx1_power_off(void) | |||
67 | 67 | ||
68 | void __init board_setup(void) | 68 | void __init board_setup(void) |
69 | { | 69 | { |
70 | alchemy_gpio2_enable(); | ||
71 | |||
72 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 70 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
73 | /* Enable USB power switch */ | 71 | /* Enable USB power switch */ |
74 | alchemy_gpio_direction_output(204, 0); | 72 | alchemy_gpio_direction_output(204, 0); |
@@ -117,11 +115,11 @@ mtx1_pci_idsel(unsigned int devsel, int assert) | |||
117 | 115 | ||
118 | if (assert && devsel != 0) | 116 | if (assert && devsel != 0) |
119 | /* Suppress signal to Cardbus */ | 117 | /* Suppress signal to Cardbus */ |
120 | gpio_set_value(1, 0); /* set EXT_IO3 OFF */ | 118 | alchemy_gpio_set_value(1, 0); /* set EXT_IO3 OFF */ |
121 | else | 119 | else |
122 | gpio_set_value(1, 1); /* set EXT_IO3 ON */ | 120 | alchemy_gpio_set_value(1, 1); /* set EXT_IO3 ON */ |
123 | 121 | ||
124 | au_sync_udelay(1); | 122 | udelay(1); |
125 | return 1; | 123 | return 1; |
126 | } | 124 | } |
127 | 125 | ||
diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c index 9f544badd0b4..39c23366c5c7 100644 --- a/arch/mips/bcm63xx/dev-enet.c +++ b/arch/mips/bcm63xx/dev-enet.c | |||
@@ -104,6 +104,9 @@ int __init bcm63xx_enet_register(int unit, | |||
104 | if (unit > 1) | 104 | if (unit > 1) |
105 | return -ENODEV; | 105 | return -ENODEV; |
106 | 106 | ||
107 | if (unit == 1 && BCMCPU_IS_6338()) | ||
108 | return -ENODEV; | ||
109 | |||
107 | if (!shared_device_registered) { | 110 | if (!shared_device_registered) { |
108 | shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); | 111 | shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); |
109 | shared_res[0].end = shared_res[0].start; | 112 | shared_res[0].end = shared_res[0].start; |
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 59dc0c7ef733..c63c56bfd184 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
@@ -434,7 +434,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
434 | __asm__ __volatile__( | 434 | __asm__ __volatile__( |
435 | " .set mips3 \n" | 435 | " .set mips3 \n" |
436 | "1: lld %0, %1 # atomic64_add \n" | 436 | "1: lld %0, %1 # atomic64_add \n" |
437 | " addu %0, %2 \n" | 437 | " daddu %0, %2 \n" |
438 | " scd %0, %1 \n" | 438 | " scd %0, %1 \n" |
439 | " beqzl %0, 1b \n" | 439 | " beqzl %0, 1b \n" |
440 | " .set mips0 \n" | 440 | " .set mips0 \n" |
@@ -446,7 +446,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
446 | __asm__ __volatile__( | 446 | __asm__ __volatile__( |
447 | " .set mips3 \n" | 447 | " .set mips3 \n" |
448 | "1: lld %0, %1 # atomic64_add \n" | 448 | "1: lld %0, %1 # atomic64_add \n" |
449 | " addu %0, %2 \n" | 449 | " daddu %0, %2 \n" |
450 | " scd %0, %1 \n" | 450 | " scd %0, %1 \n" |
451 | " beqz %0, 2f \n" | 451 | " beqz %0, 2f \n" |
452 | " .subsection 2 \n" | 452 | " .subsection 2 \n" |
@@ -479,7 +479,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
479 | __asm__ __volatile__( | 479 | __asm__ __volatile__( |
480 | " .set mips3 \n" | 480 | " .set mips3 \n" |
481 | "1: lld %0, %1 # atomic64_sub \n" | 481 | "1: lld %0, %1 # atomic64_sub \n" |
482 | " subu %0, %2 \n" | 482 | " dsubu %0, %2 \n" |
483 | " scd %0, %1 \n" | 483 | " scd %0, %1 \n" |
484 | " beqzl %0, 1b \n" | 484 | " beqzl %0, 1b \n" |
485 | " .set mips0 \n" | 485 | " .set mips0 \n" |
@@ -491,7 +491,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
491 | __asm__ __volatile__( | 491 | __asm__ __volatile__( |
492 | " .set mips3 \n" | 492 | " .set mips3 \n" |
493 | "1: lld %0, %1 # atomic64_sub \n" | 493 | "1: lld %0, %1 # atomic64_sub \n" |
494 | " subu %0, %2 \n" | 494 | " dsubu %0, %2 \n" |
495 | " scd %0, %1 \n" | 495 | " scd %0, %1 \n" |
496 | " beqz %0, 2f \n" | 496 | " beqz %0, 2f \n" |
497 | " .subsection 2 \n" | 497 | " .subsection 2 \n" |
@@ -524,10 +524,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
524 | __asm__ __volatile__( | 524 | __asm__ __volatile__( |
525 | " .set mips3 \n" | 525 | " .set mips3 \n" |
526 | "1: lld %1, %2 # atomic64_add_return \n" | 526 | "1: lld %1, %2 # atomic64_add_return \n" |
527 | " addu %0, %1, %3 \n" | 527 | " daddu %0, %1, %3 \n" |
528 | " scd %0, %2 \n" | 528 | " scd %0, %2 \n" |
529 | " beqzl %0, 1b \n" | 529 | " beqzl %0, 1b \n" |
530 | " addu %0, %1, %3 \n" | 530 | " daddu %0, %1, %3 \n" |
531 | " .set mips0 \n" | 531 | " .set mips0 \n" |
532 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 532 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
533 | : "Ir" (i), "m" (v->counter) | 533 | : "Ir" (i), "m" (v->counter) |
@@ -538,10 +538,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
538 | __asm__ __volatile__( | 538 | __asm__ __volatile__( |
539 | " .set mips3 \n" | 539 | " .set mips3 \n" |
540 | "1: lld %1, %2 # atomic64_add_return \n" | 540 | "1: lld %1, %2 # atomic64_add_return \n" |
541 | " addu %0, %1, %3 \n" | 541 | " daddu %0, %1, %3 \n" |
542 | " scd %0, %2 \n" | 542 | " scd %0, %2 \n" |
543 | " beqz %0, 2f \n" | 543 | " beqz %0, 2f \n" |
544 | " addu %0, %1, %3 \n" | 544 | " daddu %0, %1, %3 \n" |
545 | " .subsection 2 \n" | 545 | " .subsection 2 \n" |
546 | "2: b 1b \n" | 546 | "2: b 1b \n" |
547 | " .previous \n" | 547 | " .previous \n" |
@@ -576,10 +576,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
576 | __asm__ __volatile__( | 576 | __asm__ __volatile__( |
577 | " .set mips3 \n" | 577 | " .set mips3 \n" |
578 | "1: lld %1, %2 # atomic64_sub_return \n" | 578 | "1: lld %1, %2 # atomic64_sub_return \n" |
579 | " subu %0, %1, %3 \n" | 579 | " dsubu %0, %1, %3 \n" |
580 | " scd %0, %2 \n" | 580 | " scd %0, %2 \n" |
581 | " beqzl %0, 1b \n" | 581 | " beqzl %0, 1b \n" |
582 | " subu %0, %1, %3 \n" | 582 | " dsubu %0, %1, %3 \n" |
583 | " .set mips0 \n" | 583 | " .set mips0 \n" |
584 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 584 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
585 | : "Ir" (i), "m" (v->counter) | 585 | : "Ir" (i), "m" (v->counter) |
@@ -590,10 +590,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
590 | __asm__ __volatile__( | 590 | __asm__ __volatile__( |
591 | " .set mips3 \n" | 591 | " .set mips3 \n" |
592 | "1: lld %1, %2 # atomic64_sub_return \n" | 592 | "1: lld %1, %2 # atomic64_sub_return \n" |
593 | " subu %0, %1, %3 \n" | 593 | " dsubu %0, %1, %3 \n" |
594 | " scd %0, %2 \n" | 594 | " scd %0, %2 \n" |
595 | " beqz %0, 2f \n" | 595 | " beqz %0, 2f \n" |
596 | " subu %0, %1, %3 \n" | 596 | " dsubu %0, %1, %3 \n" |
597 | " .subsection 2 \n" | 597 | " .subsection 2 \n" |
598 | "2: b 1b \n" | 598 | "2: b 1b \n" |
599 | " .previous \n" | 599 | " .previous \n" |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 1b5a6648eb86..baa318a59c97 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -984,16 +984,17 @@ | |||
984 | #define __NR_perf_event_open (__NR_Linux + 296) | 984 | #define __NR_perf_event_open (__NR_Linux + 296) |
985 | #define __NR_accept4 (__NR_Linux + 297) | 985 | #define __NR_accept4 (__NR_Linux + 297) |
986 | #define __NR_recvmmsg (__NR_Linux + 298) | 986 | #define __NR_recvmmsg (__NR_Linux + 298) |
987 | #define __NR_getdents64 (__NR_Linux + 299) | ||
987 | 988 | ||
988 | /* | 989 | /* |
989 | * Offset of the last N32 flavoured syscall | 990 | * Offset of the last N32 flavoured syscall |
990 | */ | 991 | */ |
991 | #define __NR_Linux_syscalls 298 | 992 | #define __NR_Linux_syscalls 299 |
992 | 993 | ||
993 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 994 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
994 | 995 | ||
995 | #define __NR_N32_Linux 6000 | 996 | #define __NR_N32_Linux 6000 |
996 | #define __NR_N32_Linux_syscalls 298 | 997 | #define __NR_N32_Linux_syscalls 299 |
997 | 998 | ||
998 | #ifdef __KERNEL__ | 999 | #ifdef __KERNEL__ |
999 | 1000 | ||
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index a5297e2a353a..a4faceea9d88 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -419,4 +419,5 @@ EXPORT(sysn32_call_table) | |||
419 | PTR sys_perf_event_open | 419 | PTR sys_perf_event_open |
420 | PTR sys_accept4 | 420 | PTR sys_accept4 |
421 | PTR compat_sys_recvmmsg | 421 | PTR compat_sys_recvmmsg |
422 | PTR sys_getdents | ||
422 | .size sysn32_call_table,.-sysn32_call_table | 423 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c index b773c1112b14..e5cdfd603f8f 100644 --- a/arch/mips/kernel/vdso.c +++ b/arch/mips/kernel/vdso.c | |||
@@ -61,11 +61,9 @@ static int __init init_vdso(void) | |||
61 | 61 | ||
62 | vunmap(vdso); | 62 | vunmap(vdso); |
63 | 63 | ||
64 | pr_notice("init_vdso successfull\n"); | ||
65 | |||
66 | return 0; | 64 | return 0; |
67 | } | 65 | } |
68 | device_initcall(init_vdso); | 66 | subsys_initcall(init_vdso); |
69 | 67 | ||
70 | static unsigned long vdso_addr(unsigned long start) | 68 | static unsigned long vdso_addr(unsigned long start) |
71 | { | 69 | { |
diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c index 2fbfa1a8c3a9..bf80921f2f56 100644 --- a/arch/mips/mti-malta/malta-pci.c +++ b/arch/mips/mti-malta/malta-pci.c | |||
@@ -247,6 +247,8 @@ void __init mips_pcibios_init(void) | |||
247 | iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ | 247 | iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ |
248 | ioport_resource.end = controller->io_resource->end; | 248 | ioport_resource.end = controller->io_resource->end; |
249 | 249 | ||
250 | controller->io_map_base = mips_io_port_base; | ||
251 | |||
250 | register_pci_controller(controller); | 252 | register_pci_controller(controller); |
251 | } | 253 | } |
252 | 254 | ||
diff --git a/arch/mips/nxp/pnx8550/common/pci.c b/arch/mips/nxp/pnx8550/common/pci.c index eee4f3dfc410..98e86ddb86cc 100644 --- a/arch/mips/nxp/pnx8550/common/pci.c +++ b/arch/mips/nxp/pnx8550/common/pci.c | |||
@@ -44,6 +44,7 @@ extern struct pci_ops pnx8550_pci_ops; | |||
44 | 44 | ||
45 | static struct pci_controller pnx8550_controller = { | 45 | static struct pci_controller pnx8550_controller = { |
46 | .pci_ops = &pnx8550_pci_ops, | 46 | .pci_ops = &pnx8550_pci_ops, |
47 | .io_map_base = PNX8550_PORT_BASE, | ||
47 | .io_resource = &pci_io_resource, | 48 | .io_resource = &pci_io_resource, |
48 | .mem_resource = &pci_mem_resource, | 49 | .mem_resource = &pci_mem_resource, |
49 | }; | 50 | }; |
diff --git a/arch/mips/nxp/pnx8550/common/setup.c b/arch/mips/nxp/pnx8550/common/setup.c index 2aed50fef10f..64246c9c875c 100644 --- a/arch/mips/nxp/pnx8550/common/setup.c +++ b/arch/mips/nxp/pnx8550/common/setup.c | |||
@@ -113,7 +113,7 @@ void __init plat_mem_setup(void) | |||
113 | PNX8550_GLB2_ENAB_INTA_O = 0; | 113 | PNX8550_GLB2_ENAB_INTA_O = 0; |
114 | 114 | ||
115 | /* IO/MEM resources. */ | 115 | /* IO/MEM resources. */ |
116 | set_io_port_base(KSEG1); | 116 | set_io_port_base(PNX8550_PORT_BASE); |
117 | ioport_resource.start = 0; | 117 | ioport_resource.start = 0; |
118 | ioport_resource.end = ~0; | 118 | ioport_resource.end = ~0; |
119 | iomem_resource.start = 0; | 119 | iomem_resource.start = 0; |
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c index 04b31478a6d7..b7c03d80c88c 100644 --- a/arch/mips/pci/ops-pmcmsp.c +++ b/arch/mips/pci/ops-pmcmsp.c | |||
@@ -944,6 +944,7 @@ static struct pci_controller msp_pci_controller = { | |||
944 | .pci_ops = &msp_pci_ops, | 944 | .pci_ops = &msp_pci_ops, |
945 | .mem_resource = &pci_mem_resource, | 945 | .mem_resource = &pci_mem_resource, |
946 | .mem_offset = 0, | 946 | .mem_offset = 0, |
947 | .io_map_base = MSP_PCI_IOSPACE_BASE, | ||
947 | .io_resource = &pci_io_resource, | 948 | .io_resource = &pci_io_resource, |
948 | .io_offset = 0 | 949 | .io_offset = 0 |
949 | }; | 950 | }; |
diff --git a/arch/mips/pci/pci-yosemite.c b/arch/mips/pci/pci-yosemite.c index 0357946f30e6..cf5e1a25cb7d 100644 --- a/arch/mips/pci/pci-yosemite.c +++ b/arch/mips/pci/pci-yosemite.c | |||
@@ -54,6 +54,7 @@ static int __init pmc_yosemite_setup(void) | |||
54 | panic(ioremap_failed); | 54 | panic(ioremap_failed); |
55 | 55 | ||
56 | set_io_port_base(io_v_base); | 56 | set_io_port_base(io_v_base); |
57 | py_controller.io_map_base = io_v_base; | ||
57 | TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); | 58 | TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); |
58 | 59 | ||
59 | ioport_resource.end = TITAN_IO_SIZE - 1; | 60 | ioport_resource.end = TITAN_IO_SIZE - 1; |
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c index 8ee77887306a..9ec523e4dd06 100644 --- a/arch/mips/powertv/asic/asic_devices.c +++ b/arch/mips/powertv/asic/asic_devices.c | |||
@@ -472,6 +472,9 @@ void __init configure_platform(void) | |||
472 | * it*/ | 472 | * it*/ |
473 | platform_features = FFS_CAPABLE | DISPLAY_CAPABLE; | 473 | platform_features = FFS_CAPABLE | DISPLAY_CAPABLE; |
474 | 474 | ||
475 | /* Cronus and Cronus Lite have the same register map */ | ||
476 | set_register_map(CRONUS_IO_BASE, &cronus_register_map); | ||
477 | |||
475 | /* ASIC version will determine if this is a real CronusLite or | 478 | /* ASIC version will determine if this is a real CronusLite or |
476 | * Castrati(Cronus) */ | 479 | * Castrati(Cronus) */ |
477 | chipversion = asic_read(chipver3) << 24; | 480 | chipversion = asic_read(chipver3) << 24; |
@@ -484,8 +487,6 @@ void __init configure_platform(void) | |||
484 | else | 487 | else |
485 | asic = ASIC_CRONUSLITE; | 488 | asic = ASIC_CRONUSLITE; |
486 | 489 | ||
487 | /* Cronus and Cronus Lite have the same register map */ | ||
488 | set_register_map(CRONUS_IO_BASE, &cronus_register_map); | ||
489 | gp_resources = non_dvr_cronuslite_resources; | 490 | gp_resources = non_dvr_cronuslite_resources; |
490 | pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, " | 491 | pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, " |
491 | "chipversion=0x%08X\n", | 492 | "chipversion=0x%08X\n", |
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index 2a9cd74a841e..076327f2eff7 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h | |||
@@ -8,9 +8,9 @@ | |||
8 | * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory | 8 | * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory |
9 | * and therefore we can only deal with memory within this range | 9 | * and therefore we can only deal with memory within this range |
10 | */ | 10 | */ |
11 | #define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | 11 | #define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1) |
12 | #define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | 12 | #define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1) |
13 | #define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | 13 | #define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1) |
14 | 14 | ||
15 | #else | 15 | #else |
16 | 16 | ||
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h index 2102b214a87c..0e398cfee2c8 100644 --- a/arch/powerpc/include/asm/mmu-hash64.h +++ b/arch/powerpc/include/asm/mmu-hash64.h | |||
@@ -250,7 +250,9 @@ extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
250 | int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, | 250 | int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, |
251 | pte_t *ptep, unsigned long trap, int local, int ssize, | 251 | pte_t *ptep, unsigned long trap, int local, int ssize, |
252 | unsigned int shift, unsigned int mmu_psize); | 252 | unsigned int shift, unsigned int mmu_psize); |
253 | 253 | extern void hash_failure_debug(unsigned long ea, unsigned long access, | |
254 | unsigned long vsid, unsigned long trap, | ||
255 | int ssize, int psize, unsigned long pte); | ||
254 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | 256 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, |
255 | unsigned long pstart, unsigned long prot, | 257 | unsigned long pstart, unsigned long prot, |
256 | int psize, int ssize); | 258 | int psize, int ssize); |
diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c index 369872f6cf78..babcceecd2ea 100644 --- a/arch/powerpc/kernel/perf_event_fsl_emb.c +++ b/arch/powerpc/kernel/perf_event_fsl_emb.c | |||
@@ -566,9 +566,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val, | |||
566 | * Finally record data if requested. | 566 | * Finally record data if requested. |
567 | */ | 567 | */ |
568 | if (record) { | 568 | if (record) { |
569 | struct perf_sample_data data = { | 569 | struct perf_sample_data data; |
570 | .period = event->hw.last_period, | 570 | |
571 | }; | 571 | perf_sample_data_init(&data, 0); |
572 | 572 | ||
573 | if (perf_event_overflow(event, nmi, &data, regs)) { | 573 | if (perf_event_overflow(event, nmi, &data, regs)) { |
574 | /* | 574 | /* |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 9d3953983fb7..fed9bf6187d1 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -414,7 +414,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node) | |||
414 | u64 base, size, memblock_size; | 414 | u64 base, size, memblock_size; |
415 | unsigned int is_kexec_kdump = 0, rngs; | 415 | unsigned int is_kexec_kdump = 0, rngs; |
416 | 416 | ||
417 | ls = of_get_flat_dt_prop(node, "ibm,memblock-size", &l); | 417 | ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l); |
418 | if (ls == NULL || l < dt_root_size_cells * sizeof(__be32)) | 418 | if (ls == NULL || l < dt_root_size_cells * sizeof(__be32)) |
419 | return 0; | 419 | return 0; |
420 | memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls); | 420 | memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls); |
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S index a719f53921a5..3079f6b44cf5 100644 --- a/arch/powerpc/mm/hash_low_64.S +++ b/arch/powerpc/mm/hash_low_64.S | |||
@@ -68,9 +68,6 @@ _GLOBAL(__hash_page_4K) | |||
68 | std r8,STK_PARM(r8)(r1) | 68 | std r8,STK_PARM(r8)(r1) |
69 | std r9,STK_PARM(r9)(r1) | 69 | std r9,STK_PARM(r9)(r1) |
70 | 70 | ||
71 | /* Add _PAGE_PRESENT to access */ | ||
72 | ori r4,r4,_PAGE_PRESENT | ||
73 | |||
74 | /* Save non-volatile registers. | 71 | /* Save non-volatile registers. |
75 | * r31 will hold "old PTE" | 72 | * r31 will hold "old PTE" |
76 | * r30 is "new PTE" | 73 | * r30 is "new PTE" |
@@ -347,9 +344,6 @@ _GLOBAL(__hash_page_4K) | |||
347 | std r8,STK_PARM(r8)(r1) | 344 | std r8,STK_PARM(r8)(r1) |
348 | std r9,STK_PARM(r9)(r1) | 345 | std r9,STK_PARM(r9)(r1) |
349 | 346 | ||
350 | /* Add _PAGE_PRESENT to access */ | ||
351 | ori r4,r4,_PAGE_PRESENT | ||
352 | |||
353 | /* Save non-volatile registers. | 347 | /* Save non-volatile registers. |
354 | * r31 will hold "old PTE" | 348 | * r31 will hold "old PTE" |
355 | * r30 is "new PTE" | 349 | * r30 is "new PTE" |
@@ -687,9 +681,6 @@ _GLOBAL(__hash_page_64K) | |||
687 | std r8,STK_PARM(r8)(r1) | 681 | std r8,STK_PARM(r8)(r1) |
688 | std r9,STK_PARM(r9)(r1) | 682 | std r9,STK_PARM(r9)(r1) |
689 | 683 | ||
690 | /* Add _PAGE_PRESENT to access */ | ||
691 | ori r4,r4,_PAGE_PRESENT | ||
692 | |||
693 | /* Save non-volatile registers. | 684 | /* Save non-volatile registers. |
694 | * r31 will hold "old PTE" | 685 | * r31 will hold "old PTE" |
695 | * r30 is "new PTE" | 686 | * r30 is "new PTE" |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 98f262de5585..09dffe6efa46 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -871,6 +871,18 @@ static inline int subpage_protection(struct mm_struct *mm, unsigned long ea) | |||
871 | } | 871 | } |
872 | #endif | 872 | #endif |
873 | 873 | ||
874 | void hash_failure_debug(unsigned long ea, unsigned long access, | ||
875 | unsigned long vsid, unsigned long trap, | ||
876 | int ssize, int psize, unsigned long pte) | ||
877 | { | ||
878 | if (!printk_ratelimit()) | ||
879 | return; | ||
880 | pr_info("mm: Hashing failure ! EA=0x%lx access=0x%lx current=%s\n", | ||
881 | ea, access, current->comm); | ||
882 | pr_info(" trap=0x%lx vsid=0x%lx ssize=%d psize=%d pte=0x%lx\n", | ||
883 | trap, vsid, ssize, psize, pte); | ||
884 | } | ||
885 | |||
874 | /* Result code is: | 886 | /* Result code is: |
875 | * 0 - handled | 887 | * 0 - handled |
876 | * 1 - normal page fault | 888 | * 1 - normal page fault |
@@ -955,6 +967,17 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
955 | return 1; | 967 | return 1; |
956 | } | 968 | } |
957 | 969 | ||
970 | /* Add _PAGE_PRESENT to the required access perm */ | ||
971 | access |= _PAGE_PRESENT; | ||
972 | |||
973 | /* Pre-check access permissions (will be re-checked atomically | ||
974 | * in __hash_page_XX but this pre-check is a fast path | ||
975 | */ | ||
976 | if (access & ~pte_val(*ptep)) { | ||
977 | DBG_LOW(" no access !\n"); | ||
978 | return 1; | ||
979 | } | ||
980 | |||
958 | #ifdef CONFIG_HUGETLB_PAGE | 981 | #ifdef CONFIG_HUGETLB_PAGE |
959 | if (hugeshift) | 982 | if (hugeshift) |
960 | return __hash_page_huge(ea, access, vsid, ptep, trap, local, | 983 | return __hash_page_huge(ea, access, vsid, ptep, trap, local, |
@@ -967,14 +990,6 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
967 | DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep), | 990 | DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep), |
968 | pte_val(*(ptep + PTRS_PER_PTE))); | 991 | pte_val(*(ptep + PTRS_PER_PTE))); |
969 | #endif | 992 | #endif |
970 | /* Pre-check access permissions (will be re-checked atomically | ||
971 | * in __hash_page_XX but this pre-check is a fast path | ||
972 | */ | ||
973 | if (access & ~pte_val(*ptep)) { | ||
974 | DBG_LOW(" no access !\n"); | ||
975 | return 1; | ||
976 | } | ||
977 | |||
978 | /* Do actual hashing */ | 993 | /* Do actual hashing */ |
979 | #ifdef CONFIG_PPC_64K_PAGES | 994 | #ifdef CONFIG_PPC_64K_PAGES |
980 | /* If _PAGE_4K_PFN is set, make sure this is a 4k segment */ | 995 | /* If _PAGE_4K_PFN is set, make sure this is a 4k segment */ |
@@ -1033,6 +1048,12 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
1033 | local, ssize, spp); | 1048 | local, ssize, spp); |
1034 | } | 1049 | } |
1035 | 1050 | ||
1051 | /* Dump some info in case of hash insertion failure, they should | ||
1052 | * never happen so it is really useful to know if/when they do | ||
1053 | */ | ||
1054 | if (rc == -1) | ||
1055 | hash_failure_debug(ea, access, vsid, trap, ssize, psize, | ||
1056 | pte_val(*ptep)); | ||
1036 | #ifndef CONFIG_PPC_64K_PAGES | 1057 | #ifndef CONFIG_PPC_64K_PAGES |
1037 | DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep)); | 1058 | DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep)); |
1038 | #else | 1059 | #else |
@@ -1051,8 +1072,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
1051 | void *pgdir; | 1072 | void *pgdir; |
1052 | pte_t *ptep; | 1073 | pte_t *ptep; |
1053 | unsigned long flags; | 1074 | unsigned long flags; |
1054 | int local = 0; | 1075 | int rc, ssize, local = 0; |
1055 | int ssize; | ||
1056 | 1076 | ||
1057 | BUG_ON(REGION_ID(ea) != USER_REGION_ID); | 1077 | BUG_ON(REGION_ID(ea) != USER_REGION_ID); |
1058 | 1078 | ||
@@ -1098,11 +1118,18 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
1098 | /* Hash it in */ | 1118 | /* Hash it in */ |
1099 | #ifdef CONFIG_PPC_HAS_HASH_64K | 1119 | #ifdef CONFIG_PPC_HAS_HASH_64K |
1100 | if (mm->context.user_psize == MMU_PAGE_64K) | 1120 | if (mm->context.user_psize == MMU_PAGE_64K) |
1101 | __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize); | 1121 | rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize); |
1102 | else | 1122 | else |
1103 | #endif /* CONFIG_PPC_HAS_HASH_64K */ | 1123 | #endif /* CONFIG_PPC_HAS_HASH_64K */ |
1104 | __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, | 1124 | rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, |
1105 | subpage_protection(pgdir, ea)); | 1125 | subpage_protection(pgdir, ea)); |
1126 | |||
1127 | /* Dump some info in case of hash insertion failure, they should | ||
1128 | * never happen so it is really useful to know if/when they do | ||
1129 | */ | ||
1130 | if (rc == -1) | ||
1131 | hash_failure_debug(ea, access, vsid, trap, ssize, | ||
1132 | mm->context.user_psize, pte_val(*ptep)); | ||
1106 | 1133 | ||
1107 | local_irq_restore(flags); | 1134 | local_irq_restore(flags); |
1108 | } | 1135 | } |
diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c index 199539882f92..cc5c273086cf 100644 --- a/arch/powerpc/mm/hugetlbpage-hash64.c +++ b/arch/powerpc/mm/hugetlbpage-hash64.c | |||
@@ -21,21 +21,13 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, | |||
21 | unsigned long old_pte, new_pte; | 21 | unsigned long old_pte, new_pte; |
22 | unsigned long va, rflags, pa, sz; | 22 | unsigned long va, rflags, pa, sz; |
23 | long slot; | 23 | long slot; |
24 | int err = 1; | ||
25 | 24 | ||
26 | BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); | 25 | BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); |
27 | 26 | ||
28 | /* Search the Linux page table for a match with va */ | 27 | /* Search the Linux page table for a match with va */ |
29 | va = hpt_va(ea, vsid, ssize); | 28 | va = hpt_va(ea, vsid, ssize); |
30 | 29 | ||
31 | /* | 30 | /* At this point, we have a pte (old_pte) which can be used to build |
32 | * Check the user's access rights to the page. If access should be | ||
33 | * prevented then send the problem up to do_page_fault. | ||
34 | */ | ||
35 | if (unlikely(access & ~pte_val(*ptep))) | ||
36 | goto out; | ||
37 | /* | ||
38 | * At this point, we have a pte (old_pte) which can be used to build | ||
39 | * or update an HPTE. There are 2 cases: | 31 | * or update an HPTE. There are 2 cases: |
40 | * | 32 | * |
41 | * 1. There is a valid (present) pte with no associated HPTE (this is | 33 | * 1. There is a valid (present) pte with no associated HPTE (this is |
@@ -49,9 +41,17 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, | |||
49 | 41 | ||
50 | do { | 42 | do { |
51 | old_pte = pte_val(*ptep); | 43 | old_pte = pte_val(*ptep); |
52 | if (old_pte & _PAGE_BUSY) | 44 | /* If PTE busy, retry the access */ |
53 | goto out; | 45 | if (unlikely(old_pte & _PAGE_BUSY)) |
46 | return 0; | ||
47 | /* If PTE permissions don't match, take page fault */ | ||
48 | if (unlikely(access & ~old_pte)) | ||
49 | return 1; | ||
50 | /* Try to lock the PTE, add ACCESSED and DIRTY if it was | ||
51 | * a write access */ | ||
54 | new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED; | 52 | new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED; |
53 | if (access & _PAGE_RW) | ||
54 | new_pte |= _PAGE_DIRTY; | ||
55 | } while(old_pte != __cmpxchg_u64((unsigned long *)ptep, | 55 | } while(old_pte != __cmpxchg_u64((unsigned long *)ptep, |
56 | old_pte, new_pte)); | 56 | old_pte, new_pte)); |
57 | 57 | ||
@@ -121,8 +121,16 @@ repeat: | |||
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
124 | if (unlikely(slot == -2)) | 124 | /* |
125 | panic("hash_huge_page: pte_insert failed\n"); | 125 | * Hypervisor failure. Restore old pte and return -1 |
126 | * similar to __hash_page_* | ||
127 | */ | ||
128 | if (unlikely(slot == -2)) { | ||
129 | *ptep = __pte(old_pte); | ||
130 | hash_failure_debug(ea, access, vsid, trap, ssize, | ||
131 | mmu_psize, old_pte); | ||
132 | return -1; | ||
133 | } | ||
126 | 134 | ||
127 | new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX); | 135 | new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX); |
128 | } | 136 | } |
@@ -131,9 +139,5 @@ repeat: | |||
131 | * No need to use ldarx/stdcx here | 139 | * No need to use ldarx/stdcx here |
132 | */ | 140 | */ |
133 | *ptep = __pte(new_pte & ~_PAGE_BUSY); | 141 | *ptep = __pte(new_pte & ~_PAGE_BUSY); |
134 | 142 | return 0; | |
135 | err = 0; | ||
136 | |||
137 | out: | ||
138 | return err; | ||
139 | } | 143 | } |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index f47364585ecd..aa731af720c0 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -398,15 +398,15 @@ static int of_get_drconf_memory(struct device_node *memory, const u32 **dm) | |||
398 | } | 398 | } |
399 | 399 | ||
400 | /* | 400 | /* |
401 | * Retreive and validate the ibm,memblock-size property for drconf memory | 401 | * Retreive and validate the ibm,lmb-size property for drconf memory |
402 | * from the device tree. | 402 | * from the device tree. |
403 | */ | 403 | */ |
404 | static u64 of_get_memblock_size(struct device_node *memory) | 404 | static u64 of_get_lmb_size(struct device_node *memory) |
405 | { | 405 | { |
406 | const u32 *prop; | 406 | const u32 *prop; |
407 | u32 len; | 407 | u32 len; |
408 | 408 | ||
409 | prop = of_get_property(memory, "ibm,memblock-size", &len); | 409 | prop = of_get_property(memory, "ibm,lmb-size", &len); |
410 | if (!prop || len < sizeof(unsigned int)) | 410 | if (!prop || len < sizeof(unsigned int)) |
411 | return 0; | 411 | return 0; |
412 | 412 | ||
@@ -562,7 +562,7 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start, | |||
562 | static inline int __init read_usm_ranges(const u32 **usm) | 562 | static inline int __init read_usm_ranges(const u32 **usm) |
563 | { | 563 | { |
564 | /* | 564 | /* |
565 | * For each memblock in ibm,dynamic-memory a corresponding | 565 | * For each lmb in ibm,dynamic-memory a corresponding |
566 | * entry in linux,drconf-usable-memory property contains | 566 | * entry in linux,drconf-usable-memory property contains |
567 | * a counter followed by that many (base, size) duple. | 567 | * a counter followed by that many (base, size) duple. |
568 | * read the counter from linux,drconf-usable-memory | 568 | * read the counter from linux,drconf-usable-memory |
@@ -578,7 +578,7 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
578 | { | 578 | { |
579 | const u32 *dm, *usm; | 579 | const u32 *dm, *usm; |
580 | unsigned int n, rc, ranges, is_kexec_kdump = 0; | 580 | unsigned int n, rc, ranges, is_kexec_kdump = 0; |
581 | unsigned long memblock_size, base, size, sz; | 581 | unsigned long lmb_size, base, size, sz; |
582 | int nid; | 582 | int nid; |
583 | struct assoc_arrays aa; | 583 | struct assoc_arrays aa; |
584 | 584 | ||
@@ -586,8 +586,8 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
586 | if (!n) | 586 | if (!n) |
587 | return; | 587 | return; |
588 | 588 | ||
589 | memblock_size = of_get_memblock_size(memory); | 589 | lmb_size = of_get_lmb_size(memory); |
590 | if (!memblock_size) | 590 | if (!lmb_size) |
591 | return; | 591 | return; |
592 | 592 | ||
593 | rc = of_get_assoc_arrays(memory, &aa); | 593 | rc = of_get_assoc_arrays(memory, &aa); |
@@ -611,7 +611,7 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
611 | continue; | 611 | continue; |
612 | 612 | ||
613 | base = drmem.base_addr; | 613 | base = drmem.base_addr; |
614 | size = memblock_size; | 614 | size = lmb_size; |
615 | ranges = 1; | 615 | ranges = 1; |
616 | 616 | ||
617 | if (is_kexec_kdump) { | 617 | if (is_kexec_kdump) { |
@@ -1072,7 +1072,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory, | |||
1072 | { | 1072 | { |
1073 | const u32 *dm; | 1073 | const u32 *dm; |
1074 | unsigned int drconf_cell_cnt, rc; | 1074 | unsigned int drconf_cell_cnt, rc; |
1075 | unsigned long memblock_size; | 1075 | unsigned long lmb_size; |
1076 | struct assoc_arrays aa; | 1076 | struct assoc_arrays aa; |
1077 | int nid = -1; | 1077 | int nid = -1; |
1078 | 1078 | ||
@@ -1080,8 +1080,8 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory, | |||
1080 | if (!drconf_cell_cnt) | 1080 | if (!drconf_cell_cnt) |
1081 | return -1; | 1081 | return -1; |
1082 | 1082 | ||
1083 | memblock_size = of_get_memblock_size(memory); | 1083 | lmb_size = of_get_lmb_size(memory); |
1084 | if (!memblock_size) | 1084 | if (!lmb_size) |
1085 | return -1; | 1085 | return -1; |
1086 | 1086 | ||
1087 | rc = of_get_assoc_arrays(memory, &aa); | 1087 | rc = of_get_assoc_arrays(memory, &aa); |
@@ -1100,7 +1100,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory, | |||
1100 | continue; | 1100 | continue; |
1101 | 1101 | ||
1102 | if ((scn_addr < drmem.base_addr) | 1102 | if ((scn_addr < drmem.base_addr) |
1103 | || (scn_addr >= (drmem.base_addr + memblock_size))) | 1103 | || (scn_addr >= (drmem.base_addr + lmb_size))) |
1104 | continue; | 1104 | continue; |
1105 | 1105 | ||
1106 | nid = of_drconf_to_nid_single(&drmem, &aa); | 1106 | nid = of_drconf_to_nid_single(&drmem, &aa); |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index deab5f946090..bc8803664140 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -69,7 +69,7 @@ static int pseries_remove_memory(struct device_node *np) | |||
69 | const char *type; | 69 | const char *type; |
70 | const unsigned int *regs; | 70 | const unsigned int *regs; |
71 | unsigned long base; | 71 | unsigned long base; |
72 | unsigned int memblock_size; | 72 | unsigned int lmb_size; |
73 | int ret = -EINVAL; | 73 | int ret = -EINVAL; |
74 | 74 | ||
75 | /* | 75 | /* |
@@ -87,9 +87,9 @@ static int pseries_remove_memory(struct device_node *np) | |||
87 | return ret; | 87 | return ret; |
88 | 88 | ||
89 | base = *(unsigned long *)regs; | 89 | base = *(unsigned long *)regs; |
90 | memblock_size = regs[3]; | 90 | lmb_size = regs[3]; |
91 | 91 | ||
92 | ret = pseries_remove_memblock(base, memblock_size); | 92 | ret = pseries_remove_memblock(base, lmb_size); |
93 | return ret; | 93 | return ret; |
94 | } | 94 | } |
95 | 95 | ||
@@ -98,7 +98,7 @@ static int pseries_add_memory(struct device_node *np) | |||
98 | const char *type; | 98 | const char *type; |
99 | const unsigned int *regs; | 99 | const unsigned int *regs; |
100 | unsigned long base; | 100 | unsigned long base; |
101 | unsigned int memblock_size; | 101 | unsigned int lmb_size; |
102 | int ret = -EINVAL; | 102 | int ret = -EINVAL; |
103 | 103 | ||
104 | /* | 104 | /* |
@@ -116,36 +116,36 @@ static int pseries_add_memory(struct device_node *np) | |||
116 | return ret; | 116 | return ret; |
117 | 117 | ||
118 | base = *(unsigned long *)regs; | 118 | base = *(unsigned long *)regs; |
119 | memblock_size = regs[3]; | 119 | lmb_size = regs[3]; |
120 | 120 | ||
121 | /* | 121 | /* |
122 | * Update memory region to represent the memory add | 122 | * Update memory region to represent the memory add |
123 | */ | 123 | */ |
124 | ret = memblock_add(base, memblock_size); | 124 | ret = memblock_add(base, lmb_size); |
125 | return (ret < 0) ? -EINVAL : 0; | 125 | return (ret < 0) ? -EINVAL : 0; |
126 | } | 126 | } |
127 | 127 | ||
128 | static int pseries_drconf_memory(unsigned long *base, unsigned int action) | 128 | static int pseries_drconf_memory(unsigned long *base, unsigned int action) |
129 | { | 129 | { |
130 | struct device_node *np; | 130 | struct device_node *np; |
131 | const unsigned long *memblock_size; | 131 | const unsigned long *lmb_size; |
132 | int rc; | 132 | int rc; |
133 | 133 | ||
134 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); | 134 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); |
135 | if (!np) | 135 | if (!np) |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | 137 | ||
138 | memblock_size = of_get_property(np, "ibm,memblock-size", NULL); | 138 | lmb_size = of_get_property(np, "ibm,lmb-size", NULL); |
139 | if (!memblock_size) { | 139 | if (!lmb_size) { |
140 | of_node_put(np); | 140 | of_node_put(np); |
141 | return -EINVAL; | 141 | return -EINVAL; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (action == PSERIES_DRCONF_MEM_ADD) { | 144 | if (action == PSERIES_DRCONF_MEM_ADD) { |
145 | rc = memblock_add(*base, *memblock_size); | 145 | rc = memblock_add(*base, *lmb_size); |
146 | rc = (rc < 0) ? -EINVAL : 0; | 146 | rc = (rc < 0) ? -EINVAL : 0; |
147 | } else if (action == PSERIES_DRCONF_MEM_REMOVE) { | 147 | } else if (action == PSERIES_DRCONF_MEM_REMOVE) { |
148 | rc = pseries_remove_memblock(*base, *memblock_size); | 148 | rc = pseries_remove_memblock(*base, *lmb_size); |
149 | } else { | 149 | } else { |
150 | rc = -EINVAL; | 150 | rc = -EINVAL; |
151 | } | 151 | } |
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index d5e3e6007447..bea9ee37ac9d 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
@@ -535,8 +535,16 @@ pgm_no_vtime2: | |||
535 | l %r3,__LC_PGM_ILC # load program interruption code | 535 | l %r3,__LC_PGM_ILC # load program interruption code |
536 | la %r8,0x7f | 536 | la %r8,0x7f |
537 | nr %r8,%r3 # clear per-event-bit and ilc | 537 | nr %r8,%r3 # clear per-event-bit and ilc |
538 | be BASED(pgm_exit) # only per or per+check ? | 538 | be BASED(pgm_exit2) # only per or per+check ? |
539 | b BASED(pgm_do_call) | 539 | l %r7,BASED(.Ljump_table) |
540 | sll %r8,2 | ||
541 | l %r7,0(%r8,%r7) # load address of handler routine | ||
542 | la %r2,SP_PTREGS(%r15) # address of register-save area | ||
543 | basr %r14,%r7 # branch to interrupt-handler | ||
544 | pgm_exit2: | ||
545 | TRACE_IRQS_ON | ||
546 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts | ||
547 | b BASED(sysc_return) | ||
540 | 548 | ||
541 | # | 549 | # |
542 | # it was a single stepped SVC that is causing all the trouble | 550 | # it was a single stepped SVC that is causing all the trouble |
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index e7192e1cb678..8bccec15ea90 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S | |||
@@ -544,8 +544,16 @@ pgm_no_vtime2: | |||
544 | lgf %r3,__LC_PGM_ILC # load program interruption code | 544 | lgf %r3,__LC_PGM_ILC # load program interruption code |
545 | lghi %r8,0x7f | 545 | lghi %r8,0x7f |
546 | ngr %r8,%r3 # clear per-event-bit and ilc | 546 | ngr %r8,%r3 # clear per-event-bit and ilc |
547 | je pgm_exit | 547 | je pgm_exit2 |
548 | j pgm_do_call | 548 | sll %r8,3 |
549 | larl %r1,pgm_check_table | ||
550 | lg %r1,0(%r8,%r1) # load address of handler routine | ||
551 | la %r2,SP_PTREGS(%r15) # address of register-save area | ||
552 | basr %r14,%r1 # branch to interrupt-handler | ||
553 | pgm_exit2: | ||
554 | TRACE_IRQS_ON | ||
555 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts | ||
556 | j sysc_return | ||
549 | 557 | ||
550 | # | 558 | # |
551 | # it was a single stepped SVC that is causing all the trouble | 559 | # it was a single stepped SVC that is causing all the trouble |
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index a2163c95eb98..15a7536452d5 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -524,8 +524,11 @@ void etr_switch_to_local(void) | |||
524 | if (!etr_eacr.sl) | 524 | if (!etr_eacr.sl) |
525 | return; | 525 | return; |
526 | disable_sync_clock(NULL); | 526 | disable_sync_clock(NULL); |
527 | set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events); | 527 | if (!test_and_set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events)) { |
528 | queue_work(time_sync_wq, &etr_work); | 528 | etr_eacr.es = etr_eacr.sl = 0; |
529 | etr_setr(&etr_eacr); | ||
530 | queue_work(time_sync_wq, &etr_work); | ||
531 | } | ||
529 | } | 532 | } |
530 | 533 | ||
531 | /* | 534 | /* |
@@ -539,8 +542,11 @@ void etr_sync_check(void) | |||
539 | if (!etr_eacr.es) | 542 | if (!etr_eacr.es) |
540 | return; | 543 | return; |
541 | disable_sync_clock(NULL); | 544 | disable_sync_clock(NULL); |
542 | set_bit(ETR_EVENT_SYNC_CHECK, &etr_events); | 545 | if (!test_and_set_bit(ETR_EVENT_SYNC_CHECK, &etr_events)) { |
543 | queue_work(time_sync_wq, &etr_work); | 546 | etr_eacr.es = 0; |
547 | etr_setr(&etr_eacr); | ||
548 | queue_work(time_sync_wq, &etr_work); | ||
549 | } | ||
544 | } | 550 | } |
545 | 551 | ||
546 | /* | 552 | /* |
@@ -902,7 +908,7 @@ static struct etr_eacr etr_handle_update(struct etr_aib *aib, | |||
902 | * Do not try to get the alternate port aib if the clock | 908 | * Do not try to get the alternate port aib if the clock |
903 | * is not in sync yet. | 909 | * is not in sync yet. |
904 | */ | 910 | */ |
905 | if (!check_sync_clock()) | 911 | if (!eacr.es || !check_sync_clock()) |
906 | return eacr; | 912 | return eacr; |
907 | 913 | ||
908 | /* | 914 | /* |
@@ -1064,7 +1070,7 @@ static void etr_work_fn(struct work_struct *work) | |||
1064 | * If the clock is in sync just update the eacr and return. | 1070 | * If the clock is in sync just update the eacr and return. |
1065 | * If there is no valid sync port wait for a port update. | 1071 | * If there is no valid sync port wait for a port update. |
1066 | */ | 1072 | */ |
1067 | if (check_sync_clock() || sync_port < 0) { | 1073 | if ((eacr.es && check_sync_clock()) || sync_port < 0) { |
1068 | etr_update_eacr(eacr); | 1074 | etr_update_eacr(eacr); |
1069 | etr_set_tolec_timeout(now); | 1075 | etr_set_tolec_timeout(now); |
1070 | goto out_unlock; | 1076 | goto out_unlock; |
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 2e837f5080fe..fb7a5f052e2b 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, | |||
145 | percpu_entry->states[cx->index].eax = cx->address; | 145 | percpu_entry->states[cx->index].eax = cx->address; |
146 | percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; | 146 | percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; |
147 | } | 147 | } |
148 | |||
149 | /* | ||
150 | * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared, | ||
151 | * then we should skip checking BM_STS for this C-state. | ||
152 | * ref: "Intel Processor Vendor-Specific ACPI Interface Specification" | ||
153 | */ | ||
154 | if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2)) | ||
155 | cx->bm_sts_skip = 1; | ||
156 | |||
148 | return retval; | 157 | return retval; |
149 | } | 158 | } |
150 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); | 159 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 82e508677b91..fcc3c61fdecc 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -157,9 +157,14 @@ static int __init acpi_sleep_setup(char *str) | |||
157 | #ifdef CONFIG_HIBERNATION | 157 | #ifdef CONFIG_HIBERNATION |
158 | if (strncmp(str, "s4_nohwsig", 10) == 0) | 158 | if (strncmp(str, "s4_nohwsig", 10) == 0) |
159 | acpi_no_s4_hw_signature(); | 159 | acpi_no_s4_hw_signature(); |
160 | if (strncmp(str, "s4_nonvs", 8) == 0) | 160 | if (strncmp(str, "s4_nonvs", 8) == 0) { |
161 | acpi_s4_no_nvs(); | 161 | pr_warning("ACPI: acpi_sleep=s4_nonvs is deprecated, " |
162 | "please use acpi_sleep=nonvs instead"); | ||
163 | acpi_nvs_nosave(); | ||
164 | } | ||
162 | #endif | 165 | #endif |
166 | if (strncmp(str, "nonvs", 5) == 0) | ||
167 | acpi_nvs_nosave(); | ||
163 | if (strncmp(str, "old_ordering", 12) == 0) | 168 | if (strncmp(str, "old_ordering", 12) == 0) |
164 | acpi_old_suspend_ordering(); | 169 | acpi_old_suspend_ordering(); |
165 | str = strchr(str, ','); | 170 | str = strchr(str, ','); |
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index ce7cde713e71..a36de5bbb622 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) | |||
368 | return -ENODEV; | 368 | return -ENODEV; |
369 | 369 | ||
370 | out_obj = output.pointer; | 370 | out_obj = output.pointer; |
371 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 371 | if (out_obj->type != ACPI_TYPE_BUFFER) |
372 | ret = -ENODEV; | 372 | return -ENODEV; |
373 | goto out_free; | ||
374 | } | ||
375 | 373 | ||
376 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); | 374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
377 | if (errors) { | 375 | if (errors) |
378 | ret = -ENODEV; | 376 | return -ENODEV; |
379 | goto out_free; | ||
380 | } | ||
381 | 377 | ||
382 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); | 378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
383 | if (!(supported & 0x1)) { | 379 | if (!(supported & 0x1)) |
384 | ret = -ENODEV; | 380 | return -ENODEV; |
385 | goto out_free; | ||
386 | } | ||
387 | 381 | ||
388 | out_free: | 382 | out_free: |
389 | kfree(output.pointer); | 383 | kfree(output.pointer); |
@@ -397,13 +391,17 @@ static int __init pcc_cpufreq_probe(void) | |||
397 | struct pcc_memory_resource *mem_resource; | 391 | struct pcc_memory_resource *mem_resource; |
398 | struct pcc_register_resource *reg_resource; | 392 | struct pcc_register_resource *reg_resource; |
399 | union acpi_object *out_obj, *member; | 393 | union acpi_object *out_obj, *member; |
400 | acpi_handle handle, osc_handle; | 394 | acpi_handle handle, osc_handle, pcch_handle; |
401 | int ret = 0; | 395 | int ret = 0; |
402 | 396 | ||
403 | status = acpi_get_handle(NULL, "\\_SB", &handle); | 397 | status = acpi_get_handle(NULL, "\\_SB", &handle); |
404 | if (ACPI_FAILURE(status)) | 398 | if (ACPI_FAILURE(status)) |
405 | return -ENODEV; | 399 | return -ENODEV; |
406 | 400 | ||
401 | status = acpi_get_handle(handle, "PCCH", &pcch_handle); | ||
402 | if (ACPI_FAILURE(status)) | ||
403 | return -ENODEV; | ||
404 | |||
407 | status = acpi_get_handle(handle, "_OSC", &osc_handle); | 405 | status = acpi_get_handle(handle, "_OSC", &osc_handle); |
408 | if (ACPI_SUCCESS(status)) { | 406 | if (ACPI_SUCCESS(status)) { |
409 | ret = pcc_cpufreq_do_osc(&osc_handle); | 407 | ret = pcc_cpufreq_do_osc(&osc_handle); |
@@ -543,13 +541,13 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
543 | 541 | ||
544 | if (!pcch_virt_addr) { | 542 | if (!pcch_virt_addr) { |
545 | result = -1; | 543 | result = -1; |
546 | goto pcch_null; | 544 | goto out; |
547 | } | 545 | } |
548 | 546 | ||
549 | result = pcc_get_offset(cpu); | 547 | result = pcc_get_offset(cpu); |
550 | if (result) { | 548 | if (result) { |
551 | dprintk("init: PCCP evaluation failed\n"); | 549 | dprintk("init: PCCP evaluation failed\n"); |
552 | goto free; | 550 | goto out; |
553 | } | 551 | } |
554 | 552 | ||
555 | policy->max = policy->cpuinfo.max_freq = | 553 | policy->max = policy->cpuinfo.max_freq = |
@@ -558,14 +556,15 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
558 | ioread32(&pcch_hdr->minimum_frequency) * 1000; | 556 | ioread32(&pcch_hdr->minimum_frequency) * 1000; |
559 | policy->cur = pcc_get_freq(cpu); | 557 | policy->cur = pcc_get_freq(cpu); |
560 | 558 | ||
559 | if (!policy->cur) { | ||
560 | dprintk("init: Unable to get current CPU frequency\n"); | ||
561 | result = -EINVAL; | ||
562 | goto out; | ||
563 | } | ||
564 | |||
561 | dprintk("init: policy->max is %d, policy->min is %d\n", | 565 | dprintk("init: policy->max is %d, policy->min is %d\n", |
562 | policy->max, policy->min); | 566 | policy->max, policy->min); |
563 | 567 | out: | |
564 | return 0; | ||
565 | free: | ||
566 | pcc_clear_mapping(); | ||
567 | free_percpu(pcc_cpu_info); | ||
568 | pcch_null: | ||
569 | return result; | 568 | return result; |
570 | } | 569 | } |
571 | 570 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 7ec2123838e6..3e90cce3dc8b 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -1023,13 +1023,12 @@ static int get_transition_latency(struct powernow_k8_data *data) | |||
1023 | } | 1023 | } |
1024 | if (max_latency == 0) { | 1024 | if (max_latency == 0) { |
1025 | /* | 1025 | /* |
1026 | * Fam 11h always returns 0 as transition latency. | 1026 | * Fam 11h and later may return 0 as transition latency. This |
1027 | * This is intended and means "very fast". While cpufreq core | 1027 | * is intended and means "very fast". While cpufreq core and |
1028 | * and governors currently can handle that gracefully, better | 1028 | * governors currently can handle that gracefully, better set it |
1029 | * set it to 1 to avoid problems in the future. | 1029 | * to 1 to avoid problems in the future. |
1030 | * For all others it's a BIOS bug. | ||
1031 | */ | 1030 | */ |
1032 | if (boot_cpu_data.x86 != 0x11) | 1031 | if (boot_cpu_data.x86 < 0x11) |
1033 | printk(KERN_ERR FW_WARN PFX "Invalid zero transition " | 1032 | printk(KERN_ERR FW_WARN PFX "Invalid zero transition " |
1034 | "latency\n"); | 1033 | "latency\n"); |
1035 | max_latency = 1; | 1034 | max_latency = 1; |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index a198b7c87a12..ba390d731175 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -964,7 +964,7 @@ fs_initcall(hpet_late_init); | |||
964 | 964 | ||
965 | void hpet_disable(void) | 965 | void hpet_disable(void) |
966 | { | 966 | { |
967 | if (is_hpet_capable()) { | 967 | if (is_hpet_capable() && hpet_virt_address) { |
968 | unsigned int cfg = hpet_readl(HPET_CFG); | 968 | unsigned int cfg = hpet_readl(HPET_CFG); |
969 | 969 | ||
970 | if (hpet_legacy_int_enabled) { | 970 | if (hpet_legacy_int_enabled) { |
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 7c9f02c130f3..cafa7c80ac95 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c | |||
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = { | |||
276 | .cls = &i8259_sysdev_class, | 276 | .cls = &i8259_sysdev_class, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static int __init i8259A_init_sysfs(void) | ||
280 | { | ||
281 | int error = sysdev_class_register(&i8259_sysdev_class); | ||
282 | if (!error) | ||
283 | error = sysdev_register(&device_i8259A); | ||
284 | return error; | ||
285 | } | ||
286 | |||
287 | device_initcall(i8259A_init_sysfs); | ||
288 | |||
289 | static void mask_8259A(void) | 279 | static void mask_8259A(void) |
290 | { | 280 | { |
291 | unsigned long flags; | 281 | unsigned long flags; |
@@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = { | |||
407 | }; | 397 | }; |
408 | 398 | ||
409 | struct legacy_pic *legacy_pic = &default_legacy_pic; | 399 | struct legacy_pic *legacy_pic = &default_legacy_pic; |
400 | |||
401 | static int __init i8259A_init_sysfs(void) | ||
402 | { | ||
403 | int error; | ||
404 | |||
405 | if (legacy_pic != &default_legacy_pic) | ||
406 | return 0; | ||
407 | |||
408 | error = sysdev_class_register(&i8259_sysdev_class); | ||
409 | if (!error) | ||
410 | error = sysdev_register(&device_i8259A); | ||
411 | return error; | ||
412 | } | ||
413 | |||
414 | device_initcall(i8259A_init_sysfs); | ||
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index 4f4af75b9482..01ab17ae2ae7 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
@@ -572,7 +572,6 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd) | |||
572 | return NOTIFY_STOP; | 572 | return NOTIFY_STOP; |
573 | } | 573 | } |
574 | 574 | ||
575 | #ifdef CONFIG_KGDB_LOW_LEVEL_TRAP | ||
576 | int kgdb_ll_trap(int cmd, const char *str, | 575 | int kgdb_ll_trap(int cmd, const char *str, |
577 | struct pt_regs *regs, long err, int trap, int sig) | 576 | struct pt_regs *regs, long err, int trap, int sig) |
578 | { | 577 | { |
@@ -590,7 +589,6 @@ int kgdb_ll_trap(int cmd, const char *str, | |||
590 | 589 | ||
591 | return __kgdb_notify(&args, cmd); | 590 | return __kgdb_notify(&args, cmd); |
592 | } | 591 | } |
593 | #endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */ | ||
594 | 592 | ||
595 | static int | 593 | static int |
596 | kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr) | 594 | kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr) |
@@ -625,6 +623,12 @@ int kgdb_arch_init(void) | |||
625 | return register_die_notifier(&kgdb_notifier); | 623 | return register_die_notifier(&kgdb_notifier); |
626 | } | 624 | } |
627 | 625 | ||
626 | static void kgdb_hw_overflow_handler(struct perf_event *event, int nmi, | ||
627 | struct perf_sample_data *data, struct pt_regs *regs) | ||
628 | { | ||
629 | kgdb_ll_trap(DIE_DEBUG, "debug", regs, 0, 0, SIGTRAP); | ||
630 | } | ||
631 | |||
628 | void kgdb_arch_late(void) | 632 | void kgdb_arch_late(void) |
629 | { | 633 | { |
630 | int i, cpu; | 634 | int i, cpu; |
@@ -655,6 +659,7 @@ void kgdb_arch_late(void) | |||
655 | for_each_online_cpu(cpu) { | 659 | for_each_online_cpu(cpu) { |
656 | pevent = per_cpu_ptr(breakinfo[i].pev, cpu); | 660 | pevent = per_cpu_ptr(breakinfo[i].pev, cpu); |
657 | pevent[0]->hw.sample_period = 1; | 661 | pevent[0]->hw.sample_period = 1; |
662 | pevent[0]->overflow_handler = kgdb_hw_overflow_handler; | ||
658 | if (pevent[0]->destroy != NULL) { | 663 | if (pevent[0]->destroy != NULL) { |
659 | pevent[0]->destroy = NULL; | 664 | pevent[0]->destroy = NULL; |
660 | release_bp_slot(*pevent); | 665 | release_bp_slot(*pevent); |
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 89d66ca4d87c..2331bdc2b549 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -342,6 +342,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
342 | /* advance table_gfn when emulating 1gb pages with 4k */ | 342 | /* advance table_gfn when emulating 1gb pages with 4k */ |
343 | if (delta == 0) | 343 | if (delta == 0) |
344 | table_gfn += PT_INDEX(addr, level); | 344 | table_gfn += PT_INDEX(addr, level); |
345 | access &= gw->pte_access; | ||
345 | } else { | 346 | } else { |
346 | direct = 0; | 347 | direct = 0; |
347 | table_gfn = gw->table_gfn[level - 2]; | 348 | table_gfn = gw->table_gfn[level - 2]; |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 05d571f6f196..7fa89c39c64f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, | |||
1562 | 1562 | ||
1563 | r = -ENOMEM; | 1563 | r = -ENOMEM; |
1564 | size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; | 1564 | size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; |
1565 | entries = vmalloc(size); | 1565 | entries = kmalloc(size, GFP_KERNEL); |
1566 | if (!entries) | 1566 | if (!entries) |
1567 | goto out; | 1567 | goto out; |
1568 | 1568 | ||
@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, | |||
1581 | r = n; | 1581 | r = n; |
1582 | 1582 | ||
1583 | out_free: | 1583 | out_free: |
1584 | vfree(entries); | 1584 | kfree(entries); |
1585 | out: | 1585 | out: |
1586 | return r; | 1586 | return r; |
1587 | } | 1587 | } |
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c index d97b8dce1668..18b3f1468b7d 100644 --- a/drivers/acpi/acpica/evxfevnt.c +++ b/drivers/acpi/acpica/evxfevnt.c | |||
@@ -70,6 +70,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
70 | acpi_status acpi_enable(void) | 70 | acpi_status acpi_enable(void) |
71 | { | 71 | { |
72 | acpi_status status; | 72 | acpi_status status; |
73 | int retry; | ||
73 | 74 | ||
74 | ACPI_FUNCTION_TRACE(acpi_enable); | 75 | ACPI_FUNCTION_TRACE(acpi_enable); |
75 | 76 | ||
@@ -98,16 +99,18 @@ acpi_status acpi_enable(void) | |||
98 | 99 | ||
99 | /* Sanity check that transition succeeded */ | 100 | /* Sanity check that transition succeeded */ |
100 | 101 | ||
101 | if (acpi_hw_get_mode() != ACPI_SYS_MODE_ACPI) { | 102 | for (retry = 0; retry < 30000; ++retry) { |
102 | ACPI_ERROR((AE_INFO, | 103 | if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { |
103 | "Hardware did not enter ACPI mode")); | 104 | if (retry != 0) |
104 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); | 105 | ACPI_WARNING((AE_INFO, |
106 | "Platform took > %d00 usec to enter ACPI mode", retry)); | ||
107 | return_ACPI_STATUS(AE_OK); | ||
108 | } | ||
109 | acpi_os_stall(100); /* 100 usec */ | ||
105 | } | 110 | } |
106 | 111 | ||
107 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, | 112 | ACPI_ERROR((AE_INFO, "Hardware did not enter ACPI mode")); |
108 | "Transition to ACPI mode successful\n")); | 113 | return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE); |
109 | |||
110 | return_ACPI_STATUS(AE_OK); | ||
111 | } | 114 | } |
112 | 115 | ||
113 | ACPI_EXPORT_SYMBOL(acpi_enable) | 116 | ACPI_EXPORT_SYMBOL(acpi_enable) |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 3026e3fa83ef..dc58402b0a17 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -868,9 +868,15 @@ static void acpi_battery_remove_fs(struct acpi_device *device) | |||
868 | static void acpi_battery_notify(struct acpi_device *device, u32 event) | 868 | static void acpi_battery_notify(struct acpi_device *device, u32 event) |
869 | { | 869 | { |
870 | struct acpi_battery *battery = acpi_driver_data(device); | 870 | struct acpi_battery *battery = acpi_driver_data(device); |
871 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
872 | struct device *old; | ||
873 | #endif | ||
871 | 874 | ||
872 | if (!battery) | 875 | if (!battery) |
873 | return; | 876 | return; |
877 | #ifdef CONFIG_ACPI_SYSFS_POWER | ||
878 | old = battery->bat.dev; | ||
879 | #endif | ||
874 | acpi_battery_update(battery); | 880 | acpi_battery_update(battery); |
875 | acpi_bus_generate_proc_event(device, event, | 881 | acpi_bus_generate_proc_event(device, event, |
876 | acpi_battery_present(battery)); | 882 | acpi_battery_present(battery)); |
@@ -879,7 +885,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event) | |||
879 | acpi_battery_present(battery)); | 885 | acpi_battery_present(battery)); |
880 | #ifdef CONFIG_ACPI_SYSFS_POWER | 886 | #ifdef CONFIG_ACPI_SYSFS_POWER |
881 | /* acpi_battery_update could remove power_supply object */ | 887 | /* acpi_battery_update could remove power_supply object */ |
882 | if (battery->bat.dev) | 888 | if (old && battery->bat.dev) |
883 | power_supply_changed(&battery->bat); | 889 | power_supply_changed(&battery->bat); |
884 | #endif | 890 | #endif |
885 | } | 891 | } |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 01381be05e96..2bb28b9d91c4 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
@@ -214,7 +214,7 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
214 | .ident = "Sony VGN-SR290J", | 214 | .ident = "Sony VGN-SR290J", |
215 | .matches = { | 215 | .matches = { |
216 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | 216 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), |
217 | DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"), | 217 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"), |
218 | }, | 218 | }, |
219 | }, | 219 | }, |
220 | { | 220 | { |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 51284351418f..e9699aaed109 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -223,7 +223,7 @@ static bool processor_physically_present(acpi_handle handle) | |||
223 | type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0; | 223 | type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0; |
224 | cpuid = acpi_get_cpuid(handle, type, acpi_id); | 224 | cpuid = acpi_get_cpuid(handle, type, acpi_id); |
225 | 225 | ||
226 | if (cpuid == -1) | 226 | if ((cpuid == -1) && (num_possible_cpus() > 1)) |
227 | return false; | 227 | return false; |
228 | 228 | ||
229 | return true; | 229 | return true; |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index b1b385692f46..e9a8026d39f0 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -76,14 +76,19 @@ static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; | |||
76 | module_param(max_cstate, uint, 0000); | 76 | module_param(max_cstate, uint, 0000); |
77 | static unsigned int nocst __read_mostly; | 77 | static unsigned int nocst __read_mostly; |
78 | module_param(nocst, uint, 0000); | 78 | module_param(nocst, uint, 0000); |
79 | static int bm_check_disable __read_mostly; | ||
80 | module_param(bm_check_disable, uint, 0000); | ||
79 | 81 | ||
80 | static unsigned int latency_factor __read_mostly = 2; | 82 | static unsigned int latency_factor __read_mostly = 2; |
81 | module_param(latency_factor, uint, 0644); | 83 | module_param(latency_factor, uint, 0644); |
82 | 84 | ||
85 | #ifdef CONFIG_ACPI_PROCFS | ||
83 | static u64 us_to_pm_timer_ticks(s64 t) | 86 | static u64 us_to_pm_timer_ticks(s64 t) |
84 | { | 87 | { |
85 | return div64_u64(t * PM_TIMER_FREQUENCY, 1000000); | 88 | return div64_u64(t * PM_TIMER_FREQUENCY, 1000000); |
86 | } | 89 | } |
90 | #endif | ||
91 | |||
87 | /* | 92 | /* |
88 | * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. | 93 | * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. |
89 | * For now disable this. Probably a bug somewhere else. | 94 | * For now disable this. Probably a bug somewhere else. |
@@ -763,6 +768,9 @@ static int acpi_idle_bm_check(void) | |||
763 | { | 768 | { |
764 | u32 bm_status = 0; | 769 | u32 bm_status = 0; |
765 | 770 | ||
771 | if (bm_check_disable) | ||
772 | return 0; | ||
773 | |||
766 | acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status); | 774 | acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status); |
767 | if (bm_status) | 775 | if (bm_status) |
768 | acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, 1); | 776 | acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, 1); |
@@ -947,7 +955,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
947 | if (acpi_idle_suspend) | 955 | if (acpi_idle_suspend) |
948 | return(acpi_idle_enter_c1(dev, state)); | 956 | return(acpi_idle_enter_c1(dev, state)); |
949 | 957 | ||
950 | if (acpi_idle_bm_check()) { | 958 | if (!cx->bm_sts_skip && acpi_idle_bm_check()) { |
951 | if (dev->safe_state) { | 959 | if (dev->safe_state) { |
952 | dev->last_state = dev->safe_state; | 960 | dev->last_state = dev->safe_state; |
953 | return dev->safe_state->enter(dev, dev->safe_state); | 961 | return dev->safe_state->enter(dev, dev->safe_state); |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 5b7c52e4a00f..2862c781b372 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -82,6 +82,20 @@ static int acpi_sleep_prepare(u32 acpi_state) | |||
82 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; | 82 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; |
83 | 83 | ||
84 | /* | 84 | /* |
85 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
86 | * and to restore them during the subsequent resume. Windows does that also for | ||
87 | * suspend to RAM. However, it is known that this mechanism does not work on | ||
88 | * all machines, so we allow the user to disable it with the help of the | ||
89 | * 'acpi_sleep=nonvs' kernel command line option. | ||
90 | */ | ||
91 | static bool nvs_nosave; | ||
92 | |||
93 | void __init acpi_nvs_nosave(void) | ||
94 | { | ||
95 | nvs_nosave = true; | ||
96 | } | ||
97 | |||
98 | /* | ||
85 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the | 99 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the |
86 | * user to request that behavior by using the 'acpi_old_suspend_ordering' | 100 | * user to request that behavior by using the 'acpi_old_suspend_ordering' |
87 | * kernel command line option that causes the following variable to be set. | 101 | * kernel command line option that causes the following variable to be set. |
@@ -197,8 +211,7 @@ static int acpi_suspend_begin(suspend_state_t pm_state) | |||
197 | u32 acpi_state = acpi_suspend_states[pm_state]; | 211 | u32 acpi_state = acpi_suspend_states[pm_state]; |
198 | int error = 0; | 212 | int error = 0; |
199 | 213 | ||
200 | error = suspend_nvs_alloc(); | 214 | error = nvs_nosave ? 0 : suspend_nvs_alloc(); |
201 | |||
202 | if (error) | 215 | if (error) |
203 | return error; | 216 | return error; |
204 | 217 | ||
@@ -388,20 +401,6 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
388 | #endif /* CONFIG_SUSPEND */ | 401 | #endif /* CONFIG_SUSPEND */ |
389 | 402 | ||
390 | #ifdef CONFIG_HIBERNATION | 403 | #ifdef CONFIG_HIBERNATION |
391 | /* | ||
392 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
393 | * and to restore them during the subsequent resume. However, it is not certain | ||
394 | * if this mechanism is going to work on all machines, so we allow the user to | ||
395 | * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line | ||
396 | * option. | ||
397 | */ | ||
398 | static bool s4_no_nvs; | ||
399 | |||
400 | void __init acpi_s4_no_nvs(void) | ||
401 | { | ||
402 | s4_no_nvs = true; | ||
403 | } | ||
404 | |||
405 | static unsigned long s4_hardware_signature; | 404 | static unsigned long s4_hardware_signature; |
406 | static struct acpi_table_facs *facs; | 405 | static struct acpi_table_facs *facs; |
407 | static bool nosigcheck; | 406 | static bool nosigcheck; |
@@ -415,7 +414,7 @@ static int acpi_hibernation_begin(void) | |||
415 | { | 414 | { |
416 | int error; | 415 | int error; |
417 | 416 | ||
418 | error = s4_no_nvs ? 0 : suspend_nvs_alloc(); | 417 | error = nvs_nosave ? 0 : suspend_nvs_alloc(); |
419 | if (!error) { | 418 | if (!error) { |
420 | acpi_target_sleep_state = ACPI_STATE_S4; | 419 | acpi_target_sleep_state = ACPI_STATE_S4; |
421 | acpi_sleep_tts_switch(acpi_target_sleep_state); | 420 | acpi_sleep_tts_switch(acpi_target_sleep_state); |
@@ -510,7 +509,7 @@ static int acpi_hibernation_begin_old(void) | |||
510 | error = acpi_sleep_prepare(ACPI_STATE_S4); | 509 | error = acpi_sleep_prepare(ACPI_STATE_S4); |
511 | 510 | ||
512 | if (!error) { | 511 | if (!error) { |
513 | if (!s4_no_nvs) | 512 | if (!nvs_nosave) |
514 | error = suspend_nvs_alloc(); | 513 | error = suspend_nvs_alloc(); |
515 | if (!error) | 514 | if (!error) |
516 | acpi_target_sleep_state = ACPI_STATE_S4; | 515 | acpi_target_sleep_state = ACPI_STATE_S4; |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 9630fbdf4e6c..9b9d3bd54e3a 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -673,7 +673,7 @@ static struct kobject *get_device_parent(struct device *dev, | |||
673 | */ | 673 | */ |
674 | if (parent == NULL) | 674 | if (parent == NULL) |
675 | parent_kobj = virtual_device_parent(dev); | 675 | parent_kobj = virtual_device_parent(dev); |
676 | else if (parent->class) | 676 | else if (parent->class && !dev->class->ns_type) |
677 | return &parent->kobj; | 677 | return &parent->kobj; |
678 | else | 678 | else |
679 | parent_kobj = &parent->kobj; | 679 | parent_kobj = &parent->kobj; |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 9344216183a4..a7547150a705 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void) | |||
1216 | 1216 | ||
1217 | /* G33's GTT size defined in gmch_ctrl */ | 1217 | /* G33's GTT size defined in gmch_ctrl */ |
1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); | 1218 | pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); |
1219 | switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) { | 1219 | switch (gmch_ctrl & I830_GMCH_GMS_MASK) { |
1220 | case G33_PGETBL_SIZE_1M: | 1220 | case I830_GMCH_GMS_STOLEN_512: |
1221 | size = 512; | ||
1222 | break; | ||
1223 | case I830_GMCH_GMS_STOLEN_1024: | ||
1221 | size = 1024; | 1224 | size = 1024; |
1222 | break; | 1225 | break; |
1223 | case G33_PGETBL_SIZE_2M: | 1226 | case I830_GMCH_GMS_STOLEN_8192: |
1224 | size = 2048; | 1227 | size = 8*1024; |
1225 | break; | 1228 | break; |
1226 | default: | 1229 | default: |
1227 | dev_info(&agp_bridge->dev->dev, | 1230 | dev_info(&agp_bridge->dev->dev, |
1228 | "unknown page table size 0x%x, assuming 512KB\n", | 1231 | "unknown page table size 0x%x, assuming 512KB\n", |
1229 | (gmch_ctrl & G33_PGETBL_SIZE_MASK)); | 1232 | (gmch_ctrl & I830_GMCH_GMS_MASK)); |
1230 | size = 512; | 1233 | size = 512; |
1231 | } | 1234 | } |
1232 | } else { | 1235 | } else { |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 24314a9cffe8..1030f8420137 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -623,7 +623,14 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | |||
623 | 623 | ||
624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 624 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
625 | { | 625 | { |
626 | return tpm_pm_resume(&dev->dev); | 626 | struct tpm_chip *chip = pnp_get_drvdata(dev); |
627 | int ret; | ||
628 | |||
629 | ret = tpm_pm_resume(&dev->dev); | ||
630 | if (!ret) | ||
631 | tpm_continue_selftest(chip); | ||
632 | |||
633 | return ret; | ||
627 | } | 634 | } |
628 | 635 | ||
629 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { | 636 | static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 063b2184caf5..938b74ea9ffb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1077,6 +1077,7 @@ err_out_unregister: | |||
1077 | 1077 | ||
1078 | err_unlock_policy: | 1078 | err_unlock_policy: |
1079 | unlock_policy_rwsem_write(cpu); | 1079 | unlock_policy_rwsem_write(cpu); |
1080 | free_cpumask_var(policy->related_cpus); | ||
1080 | err_free_cpumask: | 1081 | err_free_cpumask: |
1081 | free_cpumask_var(policy->cpus); | 1082 | free_cpumask_var(policy->cpus); |
1082 | err_free_policy: | 1083 | err_free_policy: |
@@ -1762,17 +1763,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, | |||
1762 | dprintk("governor switch\n"); | 1763 | dprintk("governor switch\n"); |
1763 | 1764 | ||
1764 | /* end old governor */ | 1765 | /* end old governor */ |
1765 | if (data->governor) { | 1766 | if (data->governor) |
1766 | /* | ||
1767 | * Need to release the rwsem around governor | ||
1768 | * stop due to lock dependency between | ||
1769 | * cancel_delayed_work_sync and the read lock | ||
1770 | * taken in the delayed work handler. | ||
1771 | */ | ||
1772 | unlock_policy_rwsem_write(data->cpu); | ||
1773 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); | 1767 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); |
1774 | lock_policy_rwsem_write(data->cpu); | ||
1775 | } | ||
1776 | 1768 | ||
1777 | /* start new governor */ | 1769 | /* start new governor */ |
1778 | data->governor = policy->governor; | 1770 | data->governor = policy->governor; |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index cc9357da0e34..e0187d16dd7c 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1300,7 +1300,7 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno, | |||
1300 | if (devno == 0) | 1300 | if (devno == 0) |
1301 | return -ENODEV; | 1301 | return -ENODEV; |
1302 | 1302 | ||
1303 | i7core_printk(KERN_ERR, | 1303 | i7core_printk(KERN_INFO, |
1304 | "Device not found: dev %02x.%d PCI ID %04x:%04x\n", | 1304 | "Device not found: dev %02x.%d PCI ID %04x:%04x\n", |
1305 | dev_descr->dev, dev_descr->func, | 1305 | dev_descr->dev, dev_descr->func, |
1306 | PCI_VENDOR_ID_INTEL, dev_descr->dev_id); | 1306 | PCI_VENDOR_ID_INTEL, dev_descr->dev_id); |
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c index f39b00a46eda..1052340e6802 100644 --- a/drivers/edac/mpc85xx_edac.c +++ b/drivers/edac/mpc85xx_edac.c | |||
@@ -336,6 +336,7 @@ static struct of_device_id mpc85xx_pci_err_of_match[] = { | |||
336 | }, | 336 | }, |
337 | {}, | 337 | {}, |
338 | }; | 338 | }; |
339 | MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match); | ||
339 | 340 | ||
340 | static struct of_platform_driver mpc85xx_pci_err_driver = { | 341 | static struct of_platform_driver mpc85xx_pci_err_driver = { |
341 | .probe = mpc85xx_pci_err_probe, | 342 | .probe = mpc85xx_pci_err_probe, |
@@ -650,6 +651,7 @@ static struct of_device_id mpc85xx_l2_err_of_match[] = { | |||
650 | { .compatible = "fsl,p2020-l2-cache-controller", }, | 651 | { .compatible = "fsl,p2020-l2-cache-controller", }, |
651 | {}, | 652 | {}, |
652 | }; | 653 | }; |
654 | MODULE_DEVICE_TABLE(of, mpc85xx_l2_err_of_match); | ||
653 | 655 | ||
654 | static struct of_platform_driver mpc85xx_l2_err_driver = { | 656 | static struct of_platform_driver mpc85xx_l2_err_driver = { |
655 | .probe = mpc85xx_l2_err_probe, | 657 | .probe = mpc85xx_l2_err_probe, |
@@ -1126,6 +1128,7 @@ static struct of_device_id mpc85xx_mc_err_of_match[] = { | |||
1126 | { .compatible = "fsl,p2020-memory-controller", }, | 1128 | { .compatible = "fsl,p2020-memory-controller", }, |
1127 | {}, | 1129 | {}, |
1128 | }; | 1130 | }; |
1131 | MODULE_DEVICE_TABLE(of, mpc85xx_mc_err_of_match); | ||
1129 | 1132 | ||
1130 | static struct of_platform_driver mpc85xx_mc_err_driver = { | 1133 | static struct of_platform_driver mpc85xx_mc_err_driver = { |
1131 | .probe = mpc85xx_mc_err_probe, | 1134 | .probe = mpc85xx_mc_err_probe, |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 3ca36542e338..4e51fe3c1fc4 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -893,10 +893,12 @@ EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low); | |||
893 | void gpio_unexport(unsigned gpio) | 893 | void gpio_unexport(unsigned gpio) |
894 | { | 894 | { |
895 | struct gpio_desc *desc; | 895 | struct gpio_desc *desc; |
896 | int status = -EINVAL; | 896 | int status = 0; |
897 | 897 | ||
898 | if (!gpio_is_valid(gpio)) | 898 | if (!gpio_is_valid(gpio)) { |
899 | status = -EINVAL; | ||
899 | goto done; | 900 | goto done; |
901 | } | ||
900 | 902 | ||
901 | mutex_lock(&sysfs_lock); | 903 | mutex_lock(&sysfs_lock); |
902 | 904 | ||
@@ -911,7 +913,6 @@ void gpio_unexport(unsigned gpio) | |||
911 | clear_bit(FLAG_EXPORT, &desc->flags); | 913 | clear_bit(FLAG_EXPORT, &desc->flags); |
912 | put_device(dev); | 914 | put_device(dev); |
913 | device_unregister(dev); | 915 | device_unregister(dev); |
914 | status = 0; | ||
915 | } else | 916 | } else |
916 | status = -ENODEV; | 917 | status = -ENODEV; |
917 | } | 918 | } |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index c1981861bbbd..f87bf104df7a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -864,8 +864,8 @@ drm_mode_std(struct drm_connector *connector, struct edid *edid, | |||
864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, | 864 | mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, |
865 | false); | 865 | false); |
866 | mode->hdisplay = 1366; | 866 | mode->hdisplay = 1366; |
867 | mode->vsync_start = mode->vsync_start - 1; | 867 | mode->hsync_start = mode->hsync_start - 1; |
868 | mode->vsync_end = mode->vsync_end - 1; | 868 | mode->hsync_end = mode->hsync_end - 1; |
869 | return mode; | 869 | return mode; |
870 | } | 870 | } |
871 | 871 | ||
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index aee83fa178f6..9214119c0154 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -605,6 +605,9 @@ static int i915_fbc_status(struct seq_file *m, void *unused) | |||
605 | case FBC_NOT_TILED: | 605 | case FBC_NOT_TILED: |
606 | seq_printf(m, "scanout buffer not tiled"); | 606 | seq_printf(m, "scanout buffer not tiled"); |
607 | break; | 607 | break; |
608 | case FBC_MULTIPLE_PIPES: | ||
609 | seq_printf(m, "multiple pipes are enabled"); | ||
610 | break; | ||
608 | default: | 611 | default: |
609 | seq_printf(m, "unknown reason"); | 612 | seq_printf(m, "unknown reason"); |
610 | } | 613 | } |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index f00c5ae9556c..2305a1234f1e 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1300,7 +1300,7 @@ static void i915_cleanup_compression(struct drm_device *dev) | |||
1300 | struct drm_i915_private *dev_priv = dev->dev_private; | 1300 | struct drm_i915_private *dev_priv = dev->dev_private; |
1301 | 1301 | ||
1302 | drm_mm_put_block(dev_priv->compressed_fb); | 1302 | drm_mm_put_block(dev_priv->compressed_fb); |
1303 | if (!IS_GM45(dev)) | 1303 | if (dev_priv->compressed_llb) |
1304 | drm_mm_put_block(dev_priv->compressed_llb); | 1304 | drm_mm_put_block(dev_priv->compressed_llb); |
1305 | } | 1305 | } |
1306 | 1306 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d147ab2f5bfc..2e1744d37ad5 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -215,6 +215,7 @@ enum no_fbc_reason { | |||
215 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ | 215 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ |
216 | FBC_BAD_PLANE, /* fbc not supported on plane */ | 216 | FBC_BAD_PLANE, /* fbc not supported on plane */ |
217 | FBC_NOT_TILED, /* buffer not tiled */ | 217 | FBC_NOT_TILED, /* buffer not tiled */ |
218 | FBC_MULTIPLE_PIPES, /* more than one pipe active */ | ||
218 | }; | 219 | }; |
219 | 220 | ||
220 | enum intel_pch { | 221 | enum intel_pch { |
@@ -222,6 +223,8 @@ enum intel_pch { | |||
222 | PCH_CPT, /* Cougarpoint PCH */ | 223 | PCH_CPT, /* Cougarpoint PCH */ |
223 | }; | 224 | }; |
224 | 225 | ||
226 | #define QUIRK_PIPEA_FORCE (1<<0) | ||
227 | |||
225 | struct intel_fbdev; | 228 | struct intel_fbdev; |
226 | 229 | ||
227 | typedef struct drm_i915_private { | 230 | typedef struct drm_i915_private { |
@@ -337,6 +340,8 @@ typedef struct drm_i915_private { | |||
337 | /* PCH chipset type */ | 340 | /* PCH chipset type */ |
338 | enum intel_pch pch_type; | 341 | enum intel_pch pch_type; |
339 | 342 | ||
343 | unsigned long quirks; | ||
344 | |||
340 | /* Register state */ | 345 | /* Register state */ |
341 | bool modeset_on_lid; | 346 | bool modeset_on_lid; |
342 | u8 saveLBB; | 347 | u8 saveLBB; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 51bd301cf10d..5aa747fc25a9 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -3647,6 +3647,7 @@ i915_gem_wait_for_pending_flip(struct drm_device *dev, | |||
3647 | return ret; | 3647 | return ret; |
3648 | } | 3648 | } |
3649 | 3649 | ||
3650 | |||
3650 | int | 3651 | int |
3651 | i915_gem_do_execbuffer(struct drm_device *dev, void *data, | 3652 | i915_gem_do_execbuffer(struct drm_device *dev, void *data, |
3652 | struct drm_file *file_priv, | 3653 | struct drm_file *file_priv, |
@@ -3794,7 +3795,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
3794 | unsigned long long total_size = 0; | 3795 | unsigned long long total_size = 0; |
3795 | int num_fences = 0; | 3796 | int num_fences = 0; |
3796 | for (i = 0; i < args->buffer_count; i++) { | 3797 | for (i = 0; i < args->buffer_count; i++) { |
3797 | obj_priv = object_list[i]->driver_private; | 3798 | obj_priv = to_intel_bo(object_list[i]); |
3798 | 3799 | ||
3799 | total_size += object_list[i]->size; | 3800 | total_size += object_list[i]->size; |
3800 | num_fences += | 3801 | num_fences += |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 6d9b0288272a..cf41c672defe 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -2869,6 +2869,7 @@ | |||
2869 | 2869 | ||
2870 | #define PCH_PP_STATUS 0xc7200 | 2870 | #define PCH_PP_STATUS 0xc7200 |
2871 | #define PCH_PP_CONTROL 0xc7204 | 2871 | #define PCH_PP_CONTROL 0xc7204 |
2872 | #define PANEL_UNLOCK_REGS (0xabcd << 16) | ||
2872 | #define EDP_FORCE_VDD (1 << 3) | 2873 | #define EDP_FORCE_VDD (1 << 3) |
2873 | #define EDP_BLC_ENABLE (1 << 2) | 2874 | #define EDP_BLC_ENABLE (1 << 2) |
2874 | #define PANEL_POWER_RESET (1 << 1) | 2875 | #define PANEL_POWER_RESET (1 << 1) |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 68dcf36e2793..5e21b3119824 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -862,8 +862,8 @@ intel_g4x_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc, | |||
862 | intel_clock_t clock; | 862 | intel_clock_t clock; |
863 | int max_n; | 863 | int max_n; |
864 | bool found; | 864 | bool found; |
865 | /* approximately equals target * 0.00488 */ | 865 | /* approximately equals target * 0.00585 */ |
866 | int err_most = (target >> 8) + (target >> 10); | 866 | int err_most = (target >> 8) + (target >> 9); |
867 | found = false; | 867 | found = false; |
868 | 868 | ||
869 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { | 869 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { |
@@ -1180,8 +1180,12 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1180 | struct drm_framebuffer *fb = crtc->fb; | 1180 | struct drm_framebuffer *fb = crtc->fb; |
1181 | struct intel_framebuffer *intel_fb; | 1181 | struct intel_framebuffer *intel_fb; |
1182 | struct drm_i915_gem_object *obj_priv; | 1182 | struct drm_i915_gem_object *obj_priv; |
1183 | struct drm_crtc *tmp_crtc; | ||
1183 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1184 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
1184 | int plane = intel_crtc->plane; | 1185 | int plane = intel_crtc->plane; |
1186 | int crtcs_enabled = 0; | ||
1187 | |||
1188 | DRM_DEBUG_KMS("\n"); | ||
1185 | 1189 | ||
1186 | if (!i915_powersave) | 1190 | if (!i915_powersave) |
1187 | return; | 1191 | return; |
@@ -1199,10 +1203,21 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1199 | * If FBC is already on, we just have to verify that we can | 1203 | * If FBC is already on, we just have to verify that we can |
1200 | * keep it that way... | 1204 | * keep it that way... |
1201 | * Need to disable if: | 1205 | * Need to disable if: |
1206 | * - more than one pipe is active | ||
1202 | * - changing FBC params (stride, fence, mode) | 1207 | * - changing FBC params (stride, fence, mode) |
1203 | * - new fb is too large to fit in compressed buffer | 1208 | * - new fb is too large to fit in compressed buffer |
1204 | * - going to an unsupported config (interlace, pixel multiply, etc.) | 1209 | * - going to an unsupported config (interlace, pixel multiply, etc.) |
1205 | */ | 1210 | */ |
1211 | list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) { | ||
1212 | if (tmp_crtc->enabled) | ||
1213 | crtcs_enabled++; | ||
1214 | } | ||
1215 | DRM_DEBUG_KMS("%d pipes active\n", crtcs_enabled); | ||
1216 | if (crtcs_enabled > 1) { | ||
1217 | DRM_DEBUG_KMS("more than one pipe active, disabling compression\n"); | ||
1218 | dev_priv->no_fbc_reason = FBC_MULTIPLE_PIPES; | ||
1219 | goto out_disable; | ||
1220 | } | ||
1206 | if (intel_fb->obj->size > dev_priv->cfb_size) { | 1221 | if (intel_fb->obj->size > dev_priv->cfb_size) { |
1207 | DRM_DEBUG_KMS("framebuffer too large, disabling " | 1222 | DRM_DEBUG_KMS("framebuffer too large, disabling " |
1208 | "compression\n"); | 1223 | "compression\n"); |
@@ -1255,7 +1270,7 @@ out_disable: | |||
1255 | } | 1270 | } |
1256 | } | 1271 | } |
1257 | 1272 | ||
1258 | static int | 1273 | int |
1259 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) | 1274 | intel_pin_and_fence_fb_obj(struct drm_device *dev, struct drm_gem_object *obj) |
1260 | { | 1275 | { |
1261 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); | 1276 | struct drm_i915_gem_object *obj_priv = to_intel_bo(obj); |
@@ -2255,6 +2270,11 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2255 | intel_wait_for_vblank(dev); | 2270 | intel_wait_for_vblank(dev); |
2256 | } | 2271 | } |
2257 | 2272 | ||
2273 | /* Don't disable pipe A or pipe A PLLs if needed */ | ||
2274 | if (pipeconf_reg == PIPEACONF && | ||
2275 | (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | ||
2276 | goto skip_pipe_off; | ||
2277 | |||
2258 | /* Next, disable display pipes */ | 2278 | /* Next, disable display pipes */ |
2259 | temp = I915_READ(pipeconf_reg); | 2279 | temp = I915_READ(pipeconf_reg); |
2260 | if ((temp & PIPEACONF_ENABLE) != 0) { | 2280 | if ((temp & PIPEACONF_ENABLE) != 0) { |
@@ -2270,7 +2290,7 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
2270 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); | 2290 | I915_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE); |
2271 | I915_READ(dpll_reg); | 2291 | I915_READ(dpll_reg); |
2272 | } | 2292 | } |
2273 | 2293 | skip_pipe_off: | |
2274 | /* Wait for the clocks to turn off. */ | 2294 | /* Wait for the clocks to turn off. */ |
2275 | udelay(150); | 2295 | udelay(150); |
2276 | break; | 2296 | break; |
@@ -2356,8 +2376,6 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | |||
2356 | if (mode->clock * 3 > 27000 * 4) | 2376 | if (mode->clock * 3 > 27000 * 4) |
2357 | return MODE_CLOCK_HIGH; | 2377 | return MODE_CLOCK_HIGH; |
2358 | } | 2378 | } |
2359 | |||
2360 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
2361 | return true; | 2379 | return true; |
2362 | } | 2380 | } |
2363 | 2381 | ||
@@ -3736,6 +3754,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3736 | if (dev_priv->lvds_dither) { | 3754 | if (dev_priv->lvds_dither) { |
3737 | if (HAS_PCH_SPLIT(dev)) { | 3755 | if (HAS_PCH_SPLIT(dev)) { |
3738 | pipeconf |= PIPE_ENABLE_DITHER; | 3756 | pipeconf |= PIPE_ENABLE_DITHER; |
3757 | pipeconf &= ~PIPE_DITHER_TYPE_MASK; | ||
3739 | pipeconf |= PIPE_DITHER_TYPE_ST01; | 3758 | pipeconf |= PIPE_DITHER_TYPE_ST01; |
3740 | } else | 3759 | } else |
3741 | lvds |= LVDS_ENABLE_DITHER; | 3760 | lvds |= LVDS_ENABLE_DITHER; |
@@ -4412,7 +4431,8 @@ static void intel_increase_pllclock(struct drm_crtc *crtc, bool schedule) | |||
4412 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); | 4431 | DRM_DEBUG_DRIVER("upclocking LVDS\n"); |
4413 | 4432 | ||
4414 | /* Unlock panel regs */ | 4433 | /* Unlock panel regs */ |
4415 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4434 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4435 | PANEL_UNLOCK_REGS); | ||
4416 | 4436 | ||
4417 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; | 4437 | dpll &= ~DISPLAY_RATE_SELECT_FPA1; |
4418 | I915_WRITE(dpll_reg, dpll); | 4438 | I915_WRITE(dpll_reg, dpll); |
@@ -4455,7 +4475,8 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc) | |||
4455 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); | 4475 | DRM_DEBUG_DRIVER("downclocking LVDS\n"); |
4456 | 4476 | ||
4457 | /* Unlock panel regs */ | 4477 | /* Unlock panel regs */ |
4458 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16)); | 4478 | I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | |
4479 | PANEL_UNLOCK_REGS); | ||
4459 | 4480 | ||
4460 | dpll |= DISPLAY_RATE_SELECT_FPA1; | 4481 | dpll |= DISPLAY_RATE_SELECT_FPA1; |
4461 | I915_WRITE(dpll_reg, dpll); | 4482 | I915_WRITE(dpll_reg, dpll); |
@@ -4695,7 +4716,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4695 | struct drm_gem_object *obj; | 4716 | struct drm_gem_object *obj; |
4696 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4717 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
4697 | struct intel_unpin_work *work; | 4718 | struct intel_unpin_work *work; |
4698 | unsigned long flags; | 4719 | unsigned long flags, offset; |
4699 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; | 4720 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; |
4700 | int ret, pipesrc; | 4721 | int ret, pipesrc; |
4701 | u32 flip_mask; | 4722 | u32 flip_mask; |
@@ -4762,19 +4783,23 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
4762 | while (I915_READ(ISR) & flip_mask) | 4783 | while (I915_READ(ISR) & flip_mask) |
4763 | ; | 4784 | ; |
4764 | 4785 | ||
4786 | /* Offset into the new buffer for cases of shared fbs between CRTCs */ | ||
4787 | offset = obj_priv->gtt_offset; | ||
4788 | offset += (crtc->y * fb->pitch) + (crtc->x * (fb->bits_per_pixel) / 8); | ||
4789 | |||
4765 | BEGIN_LP_RING(4); | 4790 | BEGIN_LP_RING(4); |
4766 | if (IS_I965G(dev)) { | 4791 | if (IS_I965G(dev)) { |
4767 | OUT_RING(MI_DISPLAY_FLIP | | 4792 | OUT_RING(MI_DISPLAY_FLIP | |
4768 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4793 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4769 | OUT_RING(fb->pitch); | 4794 | OUT_RING(fb->pitch); |
4770 | OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); | 4795 | OUT_RING(offset | obj_priv->tiling_mode); |
4771 | pipesrc = I915_READ(pipesrc_reg); | 4796 | pipesrc = I915_READ(pipesrc_reg); |
4772 | OUT_RING(pipesrc & 0x0fff0fff); | 4797 | OUT_RING(pipesrc & 0x0fff0fff); |
4773 | } else { | 4798 | } else { |
4774 | OUT_RING(MI_DISPLAY_FLIP_I915 | | 4799 | OUT_RING(MI_DISPLAY_FLIP_I915 | |
4775 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 4800 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
4776 | OUT_RING(fb->pitch); | 4801 | OUT_RING(fb->pitch); |
4777 | OUT_RING(obj_priv->gtt_offset); | 4802 | OUT_RING(offset); |
4778 | OUT_RING(MI_NOOP); | 4803 | OUT_RING(MI_NOOP); |
4779 | } | 4804 | } |
4780 | ADVANCE_LP_RING(); | 4805 | ADVANCE_LP_RING(); |
@@ -5506,6 +5531,66 @@ static void intel_init_display(struct drm_device *dev) | |||
5506 | } | 5531 | } |
5507 | } | 5532 | } |
5508 | 5533 | ||
5534 | /* | ||
5535 | * Some BIOSes insist on assuming the GPU's pipe A is enabled at suspend, | ||
5536 | * resume, or other times. This quirk makes sure that's the case for | ||
5537 | * affected systems. | ||
5538 | */ | ||
5539 | static void quirk_pipea_force (struct drm_device *dev) | ||
5540 | { | ||
5541 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5542 | |||
5543 | dev_priv->quirks |= QUIRK_PIPEA_FORCE; | ||
5544 | DRM_DEBUG_DRIVER("applying pipe a force quirk\n"); | ||
5545 | } | ||
5546 | |||
5547 | struct intel_quirk { | ||
5548 | int device; | ||
5549 | int subsystem_vendor; | ||
5550 | int subsystem_device; | ||
5551 | void (*hook)(struct drm_device *dev); | ||
5552 | }; | ||
5553 | |||
5554 | struct intel_quirk intel_quirks[] = { | ||
5555 | /* HP Compaq 2730p needs pipe A force quirk (LP: #291555) */ | ||
5556 | { 0x2a42, 0x103c, 0x30eb, quirk_pipea_force }, | ||
5557 | /* HP Mini needs pipe A force quirk (LP: #322104) */ | ||
5558 | { 0x27ae,0x103c, 0x361a, quirk_pipea_force }, | ||
5559 | |||
5560 | /* Thinkpad R31 needs pipe A force quirk */ | ||
5561 | { 0x3577, 0x1014, 0x0505, quirk_pipea_force }, | ||
5562 | /* Toshiba Protege R-205, S-209 needs pipe A force quirk */ | ||
5563 | { 0x2592, 0x1179, 0x0001, quirk_pipea_force }, | ||
5564 | |||
5565 | /* ThinkPad X30 needs pipe A force quirk (LP: #304614) */ | ||
5566 | { 0x3577, 0x1014, 0x0513, quirk_pipea_force }, | ||
5567 | /* ThinkPad X40 needs pipe A force quirk */ | ||
5568 | |||
5569 | /* ThinkPad T60 needs pipe A force quirk (bug #16494) */ | ||
5570 | { 0x2782, 0x17aa, 0x201a, quirk_pipea_force }, | ||
5571 | |||
5572 | /* 855 & before need to leave pipe A & dpll A up */ | ||
5573 | { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5574 | { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, | ||
5575 | }; | ||
5576 | |||
5577 | static void intel_init_quirks(struct drm_device *dev) | ||
5578 | { | ||
5579 | struct pci_dev *d = dev->pdev; | ||
5580 | int i; | ||
5581 | |||
5582 | for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) { | ||
5583 | struct intel_quirk *q = &intel_quirks[i]; | ||
5584 | |||
5585 | if (d->device == q->device && | ||
5586 | (d->subsystem_vendor == q->subsystem_vendor || | ||
5587 | q->subsystem_vendor == PCI_ANY_ID) && | ||
5588 | (d->subsystem_device == q->subsystem_device || | ||
5589 | q->subsystem_device == PCI_ANY_ID)) | ||
5590 | q->hook(dev); | ||
5591 | } | ||
5592 | } | ||
5593 | |||
5509 | void intel_modeset_init(struct drm_device *dev) | 5594 | void intel_modeset_init(struct drm_device *dev) |
5510 | { | 5595 | { |
5511 | struct drm_i915_private *dev_priv = dev->dev_private; | 5596 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5518,6 +5603,8 @@ void intel_modeset_init(struct drm_device *dev) | |||
5518 | 5603 | ||
5519 | dev->mode_config.funcs = (void *)&intel_mode_funcs; | 5604 | dev->mode_config.funcs = (void *)&intel_mode_funcs; |
5520 | 5605 | ||
5606 | intel_init_quirks(dev); | ||
5607 | |||
5521 | intel_init_display(dev); | 5608 | intel_init_display(dev); |
5522 | 5609 | ||
5523 | if (IS_I965G(dev)) { | 5610 | if (IS_I965G(dev)) { |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1aac59e83bff..5dde80f9e652 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -717,6 +717,51 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
717 | } | 717 | } |
718 | } | 718 | } |
719 | 719 | ||
720 | static void ironlake_edp_panel_on (struct drm_device *dev) | ||
721 | { | ||
722 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
723 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
724 | u32 pp, pp_status; | ||
725 | |||
726 | pp_status = I915_READ(PCH_PP_STATUS); | ||
727 | if (pp_status & PP_ON) | ||
728 | return; | ||
729 | |||
730 | pp = I915_READ(PCH_PP_CONTROL); | ||
731 | pp |= PANEL_UNLOCK_REGS | POWER_TARGET_ON; | ||
732 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
733 | do { | ||
734 | pp_status = I915_READ(PCH_PP_STATUS); | ||
735 | } while (((pp_status & PP_ON) == 0) && !time_after(jiffies, timeout)); | ||
736 | |||
737 | if (time_after(jiffies, timeout)) | ||
738 | DRM_DEBUG_KMS("panel on wait timed out: 0x%08x\n", pp_status); | ||
739 | |||
740 | pp &= ~(PANEL_UNLOCK_REGS | EDP_FORCE_VDD); | ||
741 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
742 | } | ||
743 | |||
744 | static void ironlake_edp_panel_off (struct drm_device *dev) | ||
745 | { | ||
746 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
747 | unsigned long timeout = jiffies + msecs_to_jiffies(5000); | ||
748 | u32 pp, pp_status; | ||
749 | |||
750 | pp = I915_READ(PCH_PP_CONTROL); | ||
751 | pp &= ~POWER_TARGET_ON; | ||
752 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
753 | do { | ||
754 | pp_status = I915_READ(PCH_PP_STATUS); | ||
755 | } while ((pp_status & PP_ON) && !time_after(jiffies, timeout)); | ||
756 | |||
757 | if (time_after(jiffies, timeout)) | ||
758 | DRM_DEBUG_KMS("panel off wait timed out\n"); | ||
759 | |||
760 | /* Make sure VDD is enabled so DP AUX will work */ | ||
761 | pp |= EDP_FORCE_VDD; | ||
762 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
763 | } | ||
764 | |||
720 | static void ironlake_edp_backlight_on (struct drm_device *dev) | 765 | static void ironlake_edp_backlight_on (struct drm_device *dev) |
721 | { | 766 | { |
722 | struct drm_i915_private *dev_priv = dev->dev_private; | 767 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -751,14 +796,18 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
751 | if (mode != DRM_MODE_DPMS_ON) { | 796 | if (mode != DRM_MODE_DPMS_ON) { |
752 | if (dp_reg & DP_PORT_EN) { | 797 | if (dp_reg & DP_PORT_EN) { |
753 | intel_dp_link_down(intel_encoder, dp_priv->DP); | 798 | intel_dp_link_down(intel_encoder, dp_priv->DP); |
754 | if (IS_eDP(intel_encoder)) | 799 | if (IS_eDP(intel_encoder)) { |
755 | ironlake_edp_backlight_off(dev); | 800 | ironlake_edp_backlight_off(dev); |
801 | ironlake_edp_panel_off(dev); | ||
802 | } | ||
756 | } | 803 | } |
757 | } else { | 804 | } else { |
758 | if (!(dp_reg & DP_PORT_EN)) { | 805 | if (!(dp_reg & DP_PORT_EN)) { |
759 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); | 806 | intel_dp_link_train(intel_encoder, dp_priv->DP, dp_priv->link_configuration); |
760 | if (IS_eDP(intel_encoder)) | 807 | if (IS_eDP(intel_encoder)) { |
808 | ironlake_edp_panel_on(dev); | ||
761 | ironlake_edp_backlight_on(dev); | 809 | ironlake_edp_backlight_on(dev); |
810 | } | ||
762 | } | 811 | } |
763 | } | 812 | } |
764 | dp_priv->dpms_mode = mode; | 813 | dp_priv->dpms_mode = mode; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 72206f37c4fb..2f7970be9051 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -215,6 +215,9 @@ extern void intel_init_clock_gating(struct drm_device *dev); | |||
215 | extern void ironlake_enable_drps(struct drm_device *dev); | 215 | extern void ironlake_enable_drps(struct drm_device *dev); |
216 | extern void ironlake_disable_drps(struct drm_device *dev); | 216 | extern void ironlake_disable_drps(struct drm_device *dev); |
217 | 217 | ||
218 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, | ||
219 | struct drm_gem_object *obj); | ||
220 | |||
218 | extern int intel_framebuffer_init(struct drm_device *dev, | 221 | extern int intel_framebuffer_init(struct drm_device *dev, |
219 | struct intel_framebuffer *ifb, | 222 | struct intel_framebuffer *ifb, |
220 | struct drm_mode_fb_cmd *mode_cmd, | 223 | struct drm_mode_fb_cmd *mode_cmd, |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index c3c505244e07..3e18c9e7729b 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -98,7 +98,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev, | |||
98 | 98 | ||
99 | mutex_lock(&dev->struct_mutex); | 99 | mutex_lock(&dev->struct_mutex); |
100 | 100 | ||
101 | ret = i915_gem_object_pin(fbo, 64*1024); | 101 | ret = intel_pin_and_fence_fb_obj(dev, fbo); |
102 | if (ret) { | 102 | if (ret) { |
103 | DRM_ERROR("failed to pin fb: %d\n", ret); | 103 | DRM_ERROR("failed to pin fb: %d\n", ret); |
104 | goto out_unref; | 104 | goto out_unref; |
@@ -236,7 +236,7 @@ int intel_fbdev_destroy(struct drm_device *dev, | |||
236 | 236 | ||
237 | drm_framebuffer_cleanup(&ifb->base); | 237 | drm_framebuffer_cleanup(&ifb->base); |
238 | if (ifb->obj) | 238 | if (ifb->obj) |
239 | drm_gem_object_unreference_unlocked(ifb->obj); | 239 | drm_gem_object_unreference(ifb->obj); |
240 | 240 | ||
241 | return 0; | 241 | return 0; |
242 | } | 242 | } |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 31df55f0a0a7..0eab8df5bf7e 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -599,6 +599,26 @@ static int intel_lvds_get_modes(struct drm_connector *connector) | |||
599 | return 0; | 599 | return 0; |
600 | } | 600 | } |
601 | 601 | ||
602 | static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id) | ||
603 | { | ||
604 | DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident); | ||
605 | return 1; | ||
606 | } | ||
607 | |||
608 | /* The GPU hangs up on these systems if modeset is performed on LID open */ | ||
609 | static const struct dmi_system_id intel_no_modeset_on_lid[] = { | ||
610 | { | ||
611 | .callback = intel_no_modeset_on_lid_dmi_callback, | ||
612 | .ident = "Toshiba Tecra A11", | ||
613 | .matches = { | ||
614 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
615 | DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"), | ||
616 | }, | ||
617 | }, | ||
618 | |||
619 | { } /* terminating entry */ | ||
620 | }; | ||
621 | |||
602 | /* | 622 | /* |
603 | * Lid events. Note the use of 'modeset_on_lid': | 623 | * Lid events. Note the use of 'modeset_on_lid': |
604 | * - we set it on lid close, and reset it on open | 624 | * - we set it on lid close, and reset it on open |
@@ -622,6 +642,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, | |||
622 | */ | 642 | */ |
623 | if (connector) | 643 | if (connector) |
624 | connector->status = connector->funcs->detect(connector); | 644 | connector->status = connector->funcs->detect(connector); |
645 | /* Don't force modeset on machines where it causes a GPU lockup */ | ||
646 | if (dmi_check_system(intel_no_modeset_on_lid)) | ||
647 | return NOTIFY_OK; | ||
625 | if (!acpi_lid_open()) { | 648 | if (!acpi_lid_open()) { |
626 | dev_priv->modeset_on_lid = 1; | 649 | dev_priv->modeset_on_lid = 1; |
627 | return NOTIFY_OK; | 650 | return NOTIFY_OK; |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 115d26b762cc..3fa6984d9896 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -333,6 +333,7 @@ static ssize_t radeon_get_pm_profile(struct device *dev, | |||
333 | return snprintf(buf, PAGE_SIZE, "%s\n", | 333 | return snprintf(buf, PAGE_SIZE, "%s\n", |
334 | (cp == PM_PROFILE_AUTO) ? "auto" : | 334 | (cp == PM_PROFILE_AUTO) ? "auto" : |
335 | (cp == PM_PROFILE_LOW) ? "low" : | 335 | (cp == PM_PROFILE_LOW) ? "low" : |
336 | (cp == PM_PROFILE_MID) ? "mid" : | ||
336 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); | 337 | (cp == PM_PROFILE_HIGH) ? "high" : "default"); |
337 | } | 338 | } |
338 | 339 | ||
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 4917af96bae1..2ed435bd4b6c 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -539,9 +539,13 @@ static int mmci_get_cd(struct mmc_host *mmc) | |||
539 | if (host->gpio_cd == -ENOSYS) | 539 | if (host->gpio_cd == -ENOSYS) |
540 | status = host->plat->status(mmc_dev(host->mmc)); | 540 | status = host->plat->status(mmc_dev(host->mmc)); |
541 | else | 541 | else |
542 | status = gpio_get_value(host->gpio_cd); | 542 | status = !gpio_get_value(host->gpio_cd); |
543 | 543 | ||
544 | return !status; | 544 | /* |
545 | * Use positive logic throughout - status is zero for no card, | ||
546 | * non-zero for card inserted. | ||
547 | */ | ||
548 | return status; | ||
545 | } | 549 | } |
546 | 550 | ||
547 | static const struct mmc_host_ops mmci_ops = { | 551 | static const struct mmc_host_ops mmci_ops = { |
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index ee87325c7712..133d51528f8d 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #define CONFIG_MTD_NAND_OMAP_HWECC | ||
10 | 11 | ||
11 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
12 | #include <linux/dma-mapping.h> | 13 | #include <linux/dma-mapping.h> |
@@ -23,20 +24,8 @@ | |||
23 | #include <plat/gpmc.h> | 24 | #include <plat/gpmc.h> |
24 | #include <plat/nand.h> | 25 | #include <plat/nand.h> |
25 | 26 | ||
26 | #define GPMC_IRQ_STATUS 0x18 | ||
27 | #define GPMC_ECC_CONFIG 0x1F4 | ||
28 | #define GPMC_ECC_CONTROL 0x1F8 | ||
29 | #define GPMC_ECC_SIZE_CONFIG 0x1FC | ||
30 | #define GPMC_ECC1_RESULT 0x200 | ||
31 | |||
32 | #define DRIVER_NAME "omap2-nand" | 27 | #define DRIVER_NAME "omap2-nand" |
33 | 28 | ||
34 | #define NAND_WP_OFF 0 | ||
35 | #define NAND_WP_BIT 0x00000010 | ||
36 | |||
37 | #define GPMC_BUF_FULL 0x00000001 | ||
38 | #define GPMC_BUF_EMPTY 0x00000000 | ||
39 | |||
40 | #define NAND_Ecc_P1e (1 << 0) | 29 | #define NAND_Ecc_P1e (1 << 0) |
41 | #define NAND_Ecc_P2e (1 << 1) | 30 | #define NAND_Ecc_P2e (1 << 1) |
42 | #define NAND_Ecc_P4e (1 << 2) | 31 | #define NAND_Ecc_P4e (1 << 2) |
@@ -139,34 +128,11 @@ struct omap_nand_info { | |||
139 | 128 | ||
140 | int gpmc_cs; | 129 | int gpmc_cs; |
141 | unsigned long phys_base; | 130 | unsigned long phys_base; |
142 | void __iomem *gpmc_cs_baseaddr; | ||
143 | void __iomem *gpmc_baseaddr; | ||
144 | void __iomem *nand_pref_fifo_add; | ||
145 | struct completion comp; | 131 | struct completion comp; |
146 | int dma_ch; | 132 | int dma_ch; |
147 | }; | 133 | }; |
148 | 134 | ||
149 | /** | 135 | /** |
150 | * omap_nand_wp - This function enable or disable the Write Protect feature | ||
151 | * @mtd: MTD device structure | ||
152 | * @mode: WP ON/OFF | ||
153 | */ | ||
154 | static void omap_nand_wp(struct mtd_info *mtd, int mode) | ||
155 | { | ||
156 | struct omap_nand_info *info = container_of(mtd, | ||
157 | struct omap_nand_info, mtd); | ||
158 | |||
159 | unsigned long config = __raw_readl(info->gpmc_baseaddr + GPMC_CONFIG); | ||
160 | |||
161 | if (mode) | ||
162 | config &= ~(NAND_WP_BIT); /* WP is ON */ | ||
163 | else | ||
164 | config |= (NAND_WP_BIT); /* WP is OFF */ | ||
165 | |||
166 | __raw_writel(config, (info->gpmc_baseaddr + GPMC_CONFIG)); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * omap_hwcontrol - hardware specific access to control-lines | 136 | * omap_hwcontrol - hardware specific access to control-lines |
171 | * @mtd: MTD device structure | 137 | * @mtd: MTD device structure |
172 | * @cmd: command to device | 138 | * @cmd: command to device |
@@ -181,31 +147,17 @@ static void omap_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) | |||
181 | { | 147 | { |
182 | struct omap_nand_info *info = container_of(mtd, | 148 | struct omap_nand_info *info = container_of(mtd, |
183 | struct omap_nand_info, mtd); | 149 | struct omap_nand_info, mtd); |
184 | switch (ctrl) { | ||
185 | case NAND_CTRL_CHANGE | NAND_CTRL_CLE: | ||
186 | info->nand.IO_ADDR_W = info->gpmc_cs_baseaddr + | ||
187 | GPMC_CS_NAND_COMMAND; | ||
188 | info->nand.IO_ADDR_R = info->gpmc_cs_baseaddr + | ||
189 | GPMC_CS_NAND_DATA; | ||
190 | break; | ||
191 | |||
192 | case NAND_CTRL_CHANGE | NAND_CTRL_ALE: | ||
193 | info->nand.IO_ADDR_W = info->gpmc_cs_baseaddr + | ||
194 | GPMC_CS_NAND_ADDRESS; | ||
195 | info->nand.IO_ADDR_R = info->gpmc_cs_baseaddr + | ||
196 | GPMC_CS_NAND_DATA; | ||
197 | break; | ||
198 | |||
199 | case NAND_CTRL_CHANGE | NAND_NCE: | ||
200 | info->nand.IO_ADDR_W = info->gpmc_cs_baseaddr + | ||
201 | GPMC_CS_NAND_DATA; | ||
202 | info->nand.IO_ADDR_R = info->gpmc_cs_baseaddr + | ||
203 | GPMC_CS_NAND_DATA; | ||
204 | break; | ||
205 | } | ||
206 | 150 | ||
207 | if (cmd != NAND_CMD_NONE) | 151 | if (cmd != NAND_CMD_NONE) { |
208 | __raw_writeb(cmd, info->nand.IO_ADDR_W); | 152 | if (ctrl & NAND_CLE) |
153 | gpmc_nand_write(info->gpmc_cs, GPMC_NAND_COMMAND, cmd); | ||
154 | |||
155 | else if (ctrl & NAND_ALE) | ||
156 | gpmc_nand_write(info->gpmc_cs, GPMC_NAND_ADDRESS, cmd); | ||
157 | |||
158 | else /* NAND_NCE */ | ||
159 | gpmc_nand_write(info->gpmc_cs, GPMC_NAND_DATA, cmd); | ||
160 | } | ||
209 | } | 161 | } |
210 | 162 | ||
211 | /** | 163 | /** |
@@ -232,11 +184,14 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len) | |||
232 | struct omap_nand_info *info = container_of(mtd, | 184 | struct omap_nand_info *info = container_of(mtd, |
233 | struct omap_nand_info, mtd); | 185 | struct omap_nand_info, mtd); |
234 | u_char *p = (u_char *)buf; | 186 | u_char *p = (u_char *)buf; |
187 | u32 status = 0; | ||
235 | 188 | ||
236 | while (len--) { | 189 | while (len--) { |
237 | iowrite8(*p++, info->nand.IO_ADDR_W); | 190 | iowrite8(*p++, info->nand.IO_ADDR_W); |
238 | while (GPMC_BUF_EMPTY == (readl(info->gpmc_baseaddr + | 191 | /* wait until buffer is available for write */ |
239 | GPMC_STATUS) & GPMC_BUF_FULL)); | 192 | do { |
193 | status = gpmc_read_status(GPMC_STATUS_BUFFER); | ||
194 | } while (!status); | ||
240 | } | 195 | } |
241 | } | 196 | } |
242 | 197 | ||
@@ -264,16 +219,16 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len) | |||
264 | struct omap_nand_info *info = container_of(mtd, | 219 | struct omap_nand_info *info = container_of(mtd, |
265 | struct omap_nand_info, mtd); | 220 | struct omap_nand_info, mtd); |
266 | u16 *p = (u16 *) buf; | 221 | u16 *p = (u16 *) buf; |
267 | 222 | u32 status = 0; | |
268 | /* FIXME try bursts of writesw() or DMA ... */ | 223 | /* FIXME try bursts of writesw() or DMA ... */ |
269 | len >>= 1; | 224 | len >>= 1; |
270 | 225 | ||
271 | while (len--) { | 226 | while (len--) { |
272 | iowrite16(*p++, info->nand.IO_ADDR_W); | 227 | iowrite16(*p++, info->nand.IO_ADDR_W); |
273 | 228 | /* wait until buffer is available for write */ | |
274 | while (GPMC_BUF_EMPTY == (readl(info->gpmc_baseaddr + | 229 | do { |
275 | GPMC_STATUS) & GPMC_BUF_FULL)) | 230 | status = gpmc_read_status(GPMC_STATUS_BUFFER); |
276 | ; | 231 | } while (!status); |
277 | } | 232 | } |
278 | } | 233 | } |
279 | 234 | ||
@@ -287,7 +242,7 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
287 | { | 242 | { |
288 | struct omap_nand_info *info = container_of(mtd, | 243 | struct omap_nand_info *info = container_of(mtd, |
289 | struct omap_nand_info, mtd); | 244 | struct omap_nand_info, mtd); |
290 | uint32_t pfpw_status = 0, r_count = 0; | 245 | uint32_t r_count = 0; |
291 | int ret = 0; | 246 | int ret = 0; |
292 | u32 *p = (u32 *)buf; | 247 | u32 *p = (u32 *)buf; |
293 | 248 | ||
@@ -310,16 +265,16 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
310 | else | 265 | else |
311 | omap_read_buf8(mtd, buf, len); | 266 | omap_read_buf8(mtd, buf, len); |
312 | } else { | 267 | } else { |
268 | p = (u32 *) buf; | ||
313 | do { | 269 | do { |
314 | pfpw_status = gpmc_prefetch_status(); | 270 | r_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT); |
315 | r_count = ((pfpw_status >> 24) & 0x7F) >> 2; | 271 | r_count = r_count >> 2; |
316 | ioread32_rep(info->nand_pref_fifo_add, p, r_count); | 272 | ioread32_rep(info->nand.IO_ADDR_R, p, r_count); |
317 | p += r_count; | 273 | p += r_count; |
318 | len -= r_count << 2; | 274 | len -= r_count << 2; |
319 | } while (len); | 275 | } while (len); |
320 | |||
321 | /* disable and stop the PFPW engine */ | 276 | /* disable and stop the PFPW engine */ |
322 | gpmc_prefetch_reset(); | 277 | gpmc_prefetch_reset(info->gpmc_cs); |
323 | } | 278 | } |
324 | } | 279 | } |
325 | 280 | ||
@@ -334,13 +289,13 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
334 | { | 289 | { |
335 | struct omap_nand_info *info = container_of(mtd, | 290 | struct omap_nand_info *info = container_of(mtd, |
336 | struct omap_nand_info, mtd); | 291 | struct omap_nand_info, mtd); |
337 | uint32_t pfpw_status = 0, w_count = 0; | 292 | uint32_t pref_count = 0, w_count = 0; |
338 | int i = 0, ret = 0; | 293 | int i = 0, ret = 0; |
339 | u16 *p = (u16 *) buf; | 294 | u16 *p; |
340 | 295 | ||
341 | /* take care of subpage writes */ | 296 | /* take care of subpage writes */ |
342 | if (len % 2 != 0) { | 297 | if (len % 2 != 0) { |
343 | writeb(*buf, info->nand.IO_ADDR_R); | 298 | writeb(*buf, info->nand.IO_ADDR_W); |
344 | p = (u16 *)(buf + 1); | 299 | p = (u16 *)(buf + 1); |
345 | len--; | 300 | len--; |
346 | } | 301 | } |
@@ -354,16 +309,19 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
354 | else | 309 | else |
355 | omap_write_buf8(mtd, buf, len); | 310 | omap_write_buf8(mtd, buf, len); |
356 | } else { | 311 | } else { |
357 | pfpw_status = gpmc_prefetch_status(); | 312 | p = (u16 *) buf; |
358 | while (pfpw_status & 0x3FFF) { | 313 | while (len) { |
359 | w_count = ((pfpw_status >> 24) & 0x7F) >> 1; | 314 | w_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT); |
315 | w_count = w_count >> 1; | ||
360 | for (i = 0; (i < w_count) && len; i++, len -= 2) | 316 | for (i = 0; (i < w_count) && len; i++, len -= 2) |
361 | iowrite16(*p++, info->nand_pref_fifo_add); | 317 | iowrite16(*p++, info->nand.IO_ADDR_W); |
362 | pfpw_status = gpmc_prefetch_status(); | ||
363 | } | 318 | } |
364 | 319 | /* wait for data to flushed-out before reset the prefetch */ | |
320 | do { | ||
321 | pref_count = gpmc_read_status(GPMC_PREFETCH_COUNT); | ||
322 | } while (pref_count); | ||
365 | /* disable and stop the PFPW engine */ | 323 | /* disable and stop the PFPW engine */ |
366 | gpmc_prefetch_reset(); | 324 | gpmc_prefetch_reset(info->gpmc_cs); |
367 | } | 325 | } |
368 | } | 326 | } |
369 | 327 | ||
@@ -451,8 +409,9 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
451 | /* setup and start DMA using dma_addr */ | 409 | /* setup and start DMA using dma_addr */ |
452 | wait_for_completion(&info->comp); | 410 | wait_for_completion(&info->comp); |
453 | 411 | ||
454 | while (0x3fff & (prefetch_status = gpmc_prefetch_status())) | 412 | do { |
455 | ; | 413 | prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT); |
414 | } while (prefetch_status); | ||
456 | /* disable and stop the PFPW engine */ | 415 | /* disable and stop the PFPW engine */ |
457 | gpmc_prefetch_reset(); | 416 | gpmc_prefetch_reset(); |
458 | 417 | ||
@@ -530,29 +489,6 @@ static int omap_verify_buf(struct mtd_info *mtd, const u_char * buf, int len) | |||
530 | } | 489 | } |
531 | 490 | ||
532 | #ifdef CONFIG_MTD_NAND_OMAP_HWECC | 491 | #ifdef CONFIG_MTD_NAND_OMAP_HWECC |
533 | /** | ||
534 | * omap_hwecc_init - Initialize the HW ECC for NAND flash in GPMC controller | ||
535 | * @mtd: MTD device structure | ||
536 | */ | ||
537 | static void omap_hwecc_init(struct mtd_info *mtd) | ||
538 | { | ||
539 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, | ||
540 | mtd); | ||
541 | struct nand_chip *chip = mtd->priv; | ||
542 | unsigned long val = 0x0; | ||
543 | |||
544 | /* Read from ECC Control Register */ | ||
545 | val = __raw_readl(info->gpmc_baseaddr + GPMC_ECC_CONTROL); | ||
546 | /* Clear all ECC | Enable Reg1 */ | ||
547 | val = ((0x00000001<<8) | 0x00000001); | ||
548 | __raw_writel(val, info->gpmc_baseaddr + GPMC_ECC_CONTROL); | ||
549 | |||
550 | /* Read from ECC Size Config Register */ | ||
551 | val = __raw_readl(info->gpmc_baseaddr + GPMC_ECC_SIZE_CONFIG); | ||
552 | /* ECCSIZE1=512 | Select eccResultsize[0-3] */ | ||
553 | val = ((((chip->ecc.size >> 1) - 1) << 22) | (0x0000000F)); | ||
554 | __raw_writel(val, info->gpmc_baseaddr + GPMC_ECC_SIZE_CONFIG); | ||
555 | } | ||
556 | 492 | ||
557 | /** | 493 | /** |
558 | * gen_true_ecc - This function will generate true ECC value | 494 | * gen_true_ecc - This function will generate true ECC value |
@@ -755,19 +691,7 @@ static int omap_calculate_ecc(struct mtd_info *mtd, const u_char *dat, | |||
755 | { | 691 | { |
756 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, | 692 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, |
757 | mtd); | 693 | mtd); |
758 | unsigned long val = 0x0; | 694 | return gpmc_calculate_ecc(info->gpmc_cs, dat, ecc_code); |
759 | unsigned long reg; | ||
760 | |||
761 | /* Start Reading from HW ECC1_Result = 0x200 */ | ||
762 | reg = (unsigned long)(info->gpmc_baseaddr + GPMC_ECC1_RESULT); | ||
763 | val = __raw_readl(reg); | ||
764 | *ecc_code++ = val; /* P128e, ..., P1e */ | ||
765 | *ecc_code++ = val >> 16; /* P128o, ..., P1o */ | ||
766 | /* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */ | ||
767 | *ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0); | ||
768 | reg += 4; | ||
769 | |||
770 | return 0; | ||
771 | } | 695 | } |
772 | 696 | ||
773 | /** | 697 | /** |
@@ -781,32 +705,10 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int mode) | |||
781 | mtd); | 705 | mtd); |
782 | struct nand_chip *chip = mtd->priv; | 706 | struct nand_chip *chip = mtd->priv; |
783 | unsigned int dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0; | 707 | unsigned int dev_width = (chip->options & NAND_BUSWIDTH_16) ? 1 : 0; |
784 | unsigned long val = __raw_readl(info->gpmc_baseaddr + GPMC_ECC_CONFIG); | ||
785 | |||
786 | switch (mode) { | ||
787 | case NAND_ECC_READ: | ||
788 | __raw_writel(0x101, info->gpmc_baseaddr + GPMC_ECC_CONTROL); | ||
789 | /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */ | ||
790 | val = (dev_width << 7) | (info->gpmc_cs << 1) | (0x1); | ||
791 | break; | ||
792 | case NAND_ECC_READSYN: | ||
793 | __raw_writel(0x100, info->gpmc_baseaddr + GPMC_ECC_CONTROL); | ||
794 | /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */ | ||
795 | val = (dev_width << 7) | (info->gpmc_cs << 1) | (0x1); | ||
796 | break; | ||
797 | case NAND_ECC_WRITE: | ||
798 | __raw_writel(0x101, info->gpmc_baseaddr + GPMC_ECC_CONTROL); | ||
799 | /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */ | ||
800 | val = (dev_width << 7) | (info->gpmc_cs << 1) | (0x1); | ||
801 | break; | ||
802 | default: | ||
803 | DEBUG(MTD_DEBUG_LEVEL0, "Error: Unrecognized Mode[%d]!\n", | ||
804 | mode); | ||
805 | break; | ||
806 | } | ||
807 | 708 | ||
808 | __raw_writel(val, info->gpmc_baseaddr + GPMC_ECC_CONFIG); | 709 | gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size); |
809 | } | 710 | } |
711 | |||
810 | #endif | 712 | #endif |
811 | 713 | ||
812 | /** | 714 | /** |
@@ -834,14 +736,10 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip) | |||
834 | else | 736 | else |
835 | timeo += (HZ * 20) / 1000; | 737 | timeo += (HZ * 20) / 1000; |
836 | 738 | ||
837 | this->IO_ADDR_W = (void *) info->gpmc_cs_baseaddr + | 739 | gpmc_nand_write(info->gpmc_cs, |
838 | GPMC_CS_NAND_COMMAND; | 740 | GPMC_NAND_COMMAND, (NAND_CMD_STATUS & 0xFF)); |
839 | this->IO_ADDR_R = (void *) info->gpmc_cs_baseaddr + GPMC_CS_NAND_DATA; | ||
840 | |||
841 | __raw_writeb(NAND_CMD_STATUS & 0xFF, this->IO_ADDR_W); | ||
842 | |||
843 | while (time_before(jiffies, timeo)) { | 741 | while (time_before(jiffies, timeo)) { |
844 | status = __raw_readb(this->IO_ADDR_R); | 742 | status = gpmc_nand_read(info->gpmc_cs, GPMC_NAND_DATA); |
845 | if (status & NAND_STATUS_READY) | 743 | if (status & NAND_STATUS_READY) |
846 | break; | 744 | break; |
847 | cond_resched(); | 745 | cond_resched(); |
@@ -855,22 +753,22 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip) | |||
855 | */ | 753 | */ |
856 | static int omap_dev_ready(struct mtd_info *mtd) | 754 | static int omap_dev_ready(struct mtd_info *mtd) |
857 | { | 755 | { |
756 | unsigned int val = 0; | ||
858 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, | 757 | struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, |
859 | mtd); | 758 | mtd); |
860 | unsigned int val = __raw_readl(info->gpmc_baseaddr + GPMC_IRQ_STATUS); | ||
861 | 759 | ||
760 | val = gpmc_read_status(GPMC_GET_IRQ_STATUS); | ||
862 | if ((val & 0x100) == 0x100) { | 761 | if ((val & 0x100) == 0x100) { |
863 | /* Clear IRQ Interrupt */ | 762 | /* Clear IRQ Interrupt */ |
864 | val |= 0x100; | 763 | val |= 0x100; |
865 | val &= ~(0x0); | 764 | val &= ~(0x0); |
866 | __raw_writel(val, info->gpmc_baseaddr + GPMC_IRQ_STATUS); | 765 | gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, val); |
867 | } else { | 766 | } else { |
868 | unsigned int cnt = 0; | 767 | unsigned int cnt = 0; |
869 | while (cnt++ < 0x1FF) { | 768 | while (cnt++ < 0x1FF) { |
870 | if ((val & 0x100) == 0x100) | 769 | if ((val & 0x100) == 0x100) |
871 | return 0; | 770 | return 0; |
872 | val = __raw_readl(info->gpmc_baseaddr + | 771 | val = gpmc_read_status(GPMC_GET_IRQ_STATUS); |
873 | GPMC_IRQ_STATUS); | ||
874 | } | 772 | } |
875 | } | 773 | } |
876 | 774 | ||
@@ -901,8 +799,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
901 | info->pdev = pdev; | 799 | info->pdev = pdev; |
902 | 800 | ||
903 | info->gpmc_cs = pdata->cs; | 801 | info->gpmc_cs = pdata->cs; |
904 | info->gpmc_baseaddr = pdata->gpmc_baseaddr; | ||
905 | info->gpmc_cs_baseaddr = pdata->gpmc_cs_baseaddr; | ||
906 | info->phys_base = pdata->phys_base; | 802 | info->phys_base = pdata->phys_base; |
907 | 803 | ||
908 | info->mtd.priv = &info->nand; | 804 | info->mtd.priv = &info->nand; |
@@ -913,7 +809,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
913 | info->nand.options |= NAND_SKIP_BBTSCAN; | 809 | info->nand.options |= NAND_SKIP_BBTSCAN; |
914 | 810 | ||
915 | /* NAND write protect off */ | 811 | /* NAND write protect off */ |
916 | omap_nand_wp(&info->mtd, NAND_WP_OFF); | 812 | gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_WP, 0); |
917 | 813 | ||
918 | if (!request_mem_region(info->phys_base, NAND_IO_SIZE, | 814 | if (!request_mem_region(info->phys_base, NAND_IO_SIZE, |
919 | pdev->dev.driver->name)) { | 815 | pdev->dev.driver->name)) { |
@@ -948,8 +844,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
948 | } | 844 | } |
949 | 845 | ||
950 | if (use_prefetch) { | 846 | if (use_prefetch) { |
951 | /* copy the virtual address of nand base for fifo access */ | ||
952 | info->nand_pref_fifo_add = info->nand.IO_ADDR_R; | ||
953 | 847 | ||
954 | info->nand.read_buf = omap_read_buf_pref; | 848 | info->nand.read_buf = omap_read_buf_pref; |
955 | info->nand.write_buf = omap_write_buf_pref; | 849 | info->nand.write_buf = omap_write_buf_pref; |
@@ -989,8 +883,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
989 | info->nand.ecc.correct = omap_correct_data; | 883 | info->nand.ecc.correct = omap_correct_data; |
990 | info->nand.ecc.mode = NAND_ECC_HW; | 884 | info->nand.ecc.mode = NAND_ECC_HW; |
991 | 885 | ||
992 | /* init HW ECC */ | ||
993 | omap_hwecc_init(&info->mtd); | ||
994 | #else | 886 | #else |
995 | info->nand.ecc.mode = NAND_ECC_SOFT; | 887 | info->nand.ecc.mode = NAND_ECC_SOFT; |
996 | #endif | 888 | #endif |
@@ -1040,7 +932,7 @@ static int omap_nand_remove(struct platform_device *pdev) | |||
1040 | 932 | ||
1041 | /* Release NAND device, its internal structures and partitions */ | 933 | /* Release NAND device, its internal structures and partitions */ |
1042 | nand_release(&info->mtd); | 934 | nand_release(&info->mtd); |
1043 | iounmap(info->nand_pref_fifo_add); | 935 | iounmap(info->nand.IO_ADDR_R); |
1044 | kfree(&info->mtd); | 936 | kfree(&info->mtd); |
1045 | return 0; | 937 | return 0; |
1046 | } | 938 | } |
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 8bd23687c530..bb0872a63315 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -1062,6 +1062,10 @@ struct bnx2x { | |||
1062 | 1062 | ||
1063 | /* used to synchronize stats collecting */ | 1063 | /* used to synchronize stats collecting */ |
1064 | int stats_state; | 1064 | int stats_state; |
1065 | |||
1066 | /* used for synchronization of concurrent threads statistics handling */ | ||
1067 | spinlock_t stats_lock; | ||
1068 | |||
1065 | /* used by dmae command loader */ | 1069 | /* used by dmae command loader */ |
1066 | struct dmae_command stats_dmae; | 1070 | struct dmae_command stats_dmae; |
1067 | int executer_idx; | 1071 | int executer_idx; |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 57ff5b3bcce6..46167c081727 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -57,8 +57,8 @@ | |||
57 | #include "bnx2x_init_ops.h" | 57 | #include "bnx2x_init_ops.h" |
58 | #include "bnx2x_dump.h" | 58 | #include "bnx2x_dump.h" |
59 | 59 | ||
60 | #define DRV_MODULE_VERSION "1.52.53-1" | 60 | #define DRV_MODULE_VERSION "1.52.53-2" |
61 | #define DRV_MODULE_RELDATE "2010/18/04" | 61 | #define DRV_MODULE_RELDATE "2010/21/07" |
62 | #define BNX2X_BC_VER 0x040200 | 62 | #define BNX2X_BC_VER 0x040200 |
63 | 63 | ||
64 | #include <linux/firmware.h> | 64 | #include <linux/firmware.h> |
@@ -3789,6 +3789,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) | |||
3789 | struct eth_query_ramrod_data ramrod_data = {0}; | 3789 | struct eth_query_ramrod_data ramrod_data = {0}; |
3790 | int i, rc; | 3790 | int i, rc; |
3791 | 3791 | ||
3792 | spin_lock_bh(&bp->stats_lock); | ||
3793 | |||
3792 | ramrod_data.drv_counter = bp->stats_counter++; | 3794 | ramrod_data.drv_counter = bp->stats_counter++; |
3793 | ramrod_data.collect_port = bp->port.pmf ? 1 : 0; | 3795 | ramrod_data.collect_port = bp->port.pmf ? 1 : 0; |
3794 | for_each_queue(bp, i) | 3796 | for_each_queue(bp, i) |
@@ -3802,6 +3804,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) | |||
3802 | bp->spq_left++; | 3804 | bp->spq_left++; |
3803 | bp->stats_pending = 1; | 3805 | bp->stats_pending = 1; |
3804 | } | 3806 | } |
3807 | |||
3808 | spin_unlock_bh(&bp->stats_lock); | ||
3805 | } | 3809 | } |
3806 | } | 3810 | } |
3807 | 3811 | ||
@@ -4367,6 +4371,14 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
4367 | struct host_func_stats *fstats = bnx2x_sp(bp, func_stats); | 4371 | struct host_func_stats *fstats = bnx2x_sp(bp, func_stats); |
4368 | struct bnx2x_eth_stats *estats = &bp->eth_stats; | 4372 | struct bnx2x_eth_stats *estats = &bp->eth_stats; |
4369 | int i; | 4373 | int i; |
4374 | u16 cur_stats_counter; | ||
4375 | |||
4376 | /* Make sure we use the value of the counter | ||
4377 | * used for sending the last stats ramrod. | ||
4378 | */ | ||
4379 | spin_lock_bh(&bp->stats_lock); | ||
4380 | cur_stats_counter = bp->stats_counter - 1; | ||
4381 | spin_unlock_bh(&bp->stats_lock); | ||
4370 | 4382 | ||
4371 | memcpy(&(fstats->total_bytes_received_hi), | 4383 | memcpy(&(fstats->total_bytes_received_hi), |
4372 | &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi), | 4384 | &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi), |
@@ -4394,25 +4406,22 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) | |||
4394 | u32 diff; | 4406 | u32 diff; |
4395 | 4407 | ||
4396 | /* are storm stats valid? */ | 4408 | /* are storm stats valid? */ |
4397 | if ((u16)(le16_to_cpu(xclient->stats_counter) + 1) != | 4409 | if (le16_to_cpu(xclient->stats_counter) != cur_stats_counter) { |
4398 | bp->stats_counter) { | ||
4399 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm" | 4410 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm" |
4400 | " xstorm counter (0x%x) != stats_counter (0x%x)\n", | 4411 | " xstorm counter (0x%x) != stats_counter (0x%x)\n", |
4401 | i, xclient->stats_counter, bp->stats_counter); | 4412 | i, xclient->stats_counter, cur_stats_counter + 1); |
4402 | return -1; | 4413 | return -1; |
4403 | } | 4414 | } |
4404 | if ((u16)(le16_to_cpu(tclient->stats_counter) + 1) != | 4415 | if (le16_to_cpu(tclient->stats_counter) != cur_stats_counter) { |
4405 | bp->stats_counter) { | ||
4406 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm" | 4416 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm" |
4407 | " tstorm counter (0x%x) != stats_counter (0x%x)\n", | 4417 | " tstorm counter (0x%x) != stats_counter (0x%x)\n", |
4408 | i, tclient->stats_counter, bp->stats_counter); | 4418 | i, tclient->stats_counter, cur_stats_counter + 1); |
4409 | return -2; | 4419 | return -2; |
4410 | } | 4420 | } |
4411 | if ((u16)(le16_to_cpu(uclient->stats_counter) + 1) != | 4421 | if (le16_to_cpu(uclient->stats_counter) != cur_stats_counter) { |
4412 | bp->stats_counter) { | ||
4413 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm" | 4422 | DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm" |
4414 | " ustorm counter (0x%x) != stats_counter (0x%x)\n", | 4423 | " ustorm counter (0x%x) != stats_counter (0x%x)\n", |
4415 | i, uclient->stats_counter, bp->stats_counter); | 4424 | i, uclient->stats_counter, cur_stats_counter + 1); |
4416 | return -4; | 4425 | return -4; |
4417 | } | 4426 | } |
4418 | 4427 | ||
@@ -4849,16 +4858,18 @@ static const struct { | |||
4849 | 4858 | ||
4850 | static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) | 4859 | static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) |
4851 | { | 4860 | { |
4852 | enum bnx2x_stats_state state = bp->stats_state; | 4861 | enum bnx2x_stats_state state; |
4853 | 4862 | ||
4854 | if (unlikely(bp->panic)) | 4863 | if (unlikely(bp->panic)) |
4855 | return; | 4864 | return; |
4856 | 4865 | ||
4857 | bnx2x_stats_stm[state][event].action(bp); | 4866 | /* Protect a state change flow */ |
4867 | spin_lock_bh(&bp->stats_lock); | ||
4868 | state = bp->stats_state; | ||
4858 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; | 4869 | bp->stats_state = bnx2x_stats_stm[state][event].next_state; |
4870 | spin_unlock_bh(&bp->stats_lock); | ||
4859 | 4871 | ||
4860 | /* Make sure the state has been "changed" */ | 4872 | bnx2x_stats_stm[state][event].action(bp); |
4861 | smp_wmb(); | ||
4862 | 4873 | ||
4863 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) | 4874 | if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) |
4864 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", | 4875 | DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", |
@@ -9908,6 +9919,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
9908 | 9919 | ||
9909 | mutex_init(&bp->port.phy_mutex); | 9920 | mutex_init(&bp->port.phy_mutex); |
9910 | mutex_init(&bp->fw_mb_mutex); | 9921 | mutex_init(&bp->fw_mb_mutex); |
9922 | spin_lock_init(&bp->stats_lock); | ||
9911 | #ifdef BCM_CNIC | 9923 | #ifdef BCM_CNIC |
9912 | mutex_init(&bp->cnic_mutex); | 9924 | mutex_init(&bp->cnic_mutex); |
9913 | #endif | 9925 | #endif |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index df483076eda6..8d7dfd2f1e90 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -822,7 +822,7 @@ static int rlb_initialize(struct bonding *bond) | |||
822 | 822 | ||
823 | /*initialize packet type*/ | 823 | /*initialize packet type*/ |
824 | pk_type->type = cpu_to_be16(ETH_P_ARP); | 824 | pk_type->type = cpu_to_be16(ETH_P_ARP); |
825 | pk_type->dev = NULL; | 825 | pk_type->dev = bond->dev; |
826 | pk_type->func = rlb_arp_recv; | 826 | pk_type->func = rlb_arp_recv; |
827 | 827 | ||
828 | /* register to receive ARPs */ | 828 | /* register to receive ARPs */ |
diff --git a/drivers/net/declance.c b/drivers/net/declance.c index 1d973db27c32..d7de376d7178 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c | |||
@@ -1022,7 +1022,7 @@ static const struct net_device_ops lance_netdev_ops = { | |||
1022 | .ndo_set_mac_address = eth_mac_addr, | 1022 | .ndo_set_mac_address = eth_mac_addr, |
1023 | }; | 1023 | }; |
1024 | 1024 | ||
1025 | static int __init dec_lance_probe(struct device *bdev, const int type) | 1025 | static int __devinit dec_lance_probe(struct device *bdev, const int type) |
1026 | { | 1026 | { |
1027 | static unsigned version_printed; | 1027 | static unsigned version_printed; |
1028 | static const char fmt[] = "declance%d"; | 1028 | static const char fmt[] = "declance%d"; |
@@ -1326,7 +1326,7 @@ static void __exit dec_lance_platform_remove(void) | |||
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | #ifdef CONFIG_TC | 1328 | #ifdef CONFIG_TC |
1329 | static int __init dec_lance_tc_probe(struct device *dev); | 1329 | static int __devinit dec_lance_tc_probe(struct device *dev); |
1330 | static int __exit dec_lance_tc_remove(struct device *dev); | 1330 | static int __exit dec_lance_tc_remove(struct device *dev); |
1331 | 1331 | ||
1332 | static const struct tc_device_id dec_lance_tc_table[] = { | 1332 | static const struct tc_device_id dec_lance_tc_table[] = { |
@@ -1345,7 +1345,7 @@ static struct tc_driver dec_lance_tc_driver = { | |||
1345 | }, | 1345 | }, |
1346 | }; | 1346 | }; |
1347 | 1347 | ||
1348 | static int __init dec_lance_tc_probe(struct device *dev) | 1348 | static int __devinit dec_lance_tc_probe(struct device *dev) |
1349 | { | 1349 | { |
1350 | int status = dec_lance_probe(dev, PMAD_LANCE); | 1350 | int status = dec_lance_probe(dev, PMAD_LANCE); |
1351 | if (!status) | 1351 | if (!status) |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 3881918f5382..cea37e0837ff 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1722,6 +1722,15 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1722 | u16 eeprom_apme_mask = IGB_EEPROM_APME; | 1722 | u16 eeprom_apme_mask = IGB_EEPROM_APME; |
1723 | u32 part_num; | 1723 | u32 part_num; |
1724 | 1724 | ||
1725 | /* Catch broken hardware that put the wrong VF device ID in | ||
1726 | * the PCIe SR-IOV capability. | ||
1727 | */ | ||
1728 | if (pdev->is_virtfn) { | ||
1729 | WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", | ||
1730 | pci_name(pdev), pdev->vendor, pdev->device); | ||
1731 | return -EINVAL; | ||
1732 | } | ||
1733 | |||
1725 | err = pci_enable_device_mem(pdev); | 1734 | err = pci_enable_device_mem(pdev); |
1726 | if (err) | 1735 | if (err) |
1727 | return err; | 1736 | return err; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7b5d9764f317..74d9b6df3029 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -6492,6 +6492,15 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6492 | #endif | 6492 | #endif |
6493 | u32 part_num, eec; | 6493 | u32 part_num, eec; |
6494 | 6494 | ||
6495 | /* Catch broken hardware that put the wrong VF device ID in | ||
6496 | * the PCIe SR-IOV capability. | ||
6497 | */ | ||
6498 | if (pdev->is_virtfn) { | ||
6499 | WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", | ||
6500 | pci_name(pdev), pdev->vendor, pdev->device); | ||
6501 | return -EINVAL; | ||
6502 | } | ||
6503 | |||
6495 | err = pci_enable_device_mem(pdev); | 6504 | err = pci_enable_device_mem(pdev); |
6496 | if (err) | 6505 | if (err) |
6497 | return err; | 6506 | return err; |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 87e8d4cb4057..f15fe2cf72ae 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -499,7 +499,7 @@ static const struct net_device_ops macvlan_netdev_ops = { | |||
499 | .ndo_validate_addr = eth_validate_addr, | 499 | .ndo_validate_addr = eth_validate_addr, |
500 | }; | 500 | }; |
501 | 501 | ||
502 | static void macvlan_setup(struct net_device *dev) | 502 | void macvlan_common_setup(struct net_device *dev) |
503 | { | 503 | { |
504 | ether_setup(dev); | 504 | ether_setup(dev); |
505 | 505 | ||
@@ -508,6 +508,12 @@ static void macvlan_setup(struct net_device *dev) | |||
508 | dev->destructor = free_netdev; | 508 | dev->destructor = free_netdev; |
509 | dev->header_ops = &macvlan_hard_header_ops, | 509 | dev->header_ops = &macvlan_hard_header_ops, |
510 | dev->ethtool_ops = &macvlan_ethtool_ops; | 510 | dev->ethtool_ops = &macvlan_ethtool_ops; |
511 | } | ||
512 | EXPORT_SYMBOL_GPL(macvlan_common_setup); | ||
513 | |||
514 | static void macvlan_setup(struct net_device *dev) | ||
515 | { | ||
516 | macvlan_common_setup(dev); | ||
511 | dev->tx_queue_len = 0; | 517 | dev->tx_queue_len = 0; |
512 | } | 518 | } |
513 | 519 | ||
@@ -705,7 +711,6 @@ int macvlan_link_register(struct rtnl_link_ops *ops) | |||
705 | /* common fields */ | 711 | /* common fields */ |
706 | ops->priv_size = sizeof(struct macvlan_dev); | 712 | ops->priv_size = sizeof(struct macvlan_dev); |
707 | ops->get_tx_queues = macvlan_get_tx_queues; | 713 | ops->get_tx_queues = macvlan_get_tx_queues; |
708 | ops->setup = macvlan_setup; | ||
709 | ops->validate = macvlan_validate; | 714 | ops->validate = macvlan_validate; |
710 | ops->maxtype = IFLA_MACVLAN_MAX; | 715 | ops->maxtype = IFLA_MACVLAN_MAX; |
711 | ops->policy = macvlan_policy; | 716 | ops->policy = macvlan_policy; |
@@ -719,6 +724,7 @@ EXPORT_SYMBOL_GPL(macvlan_link_register); | |||
719 | 724 | ||
720 | static struct rtnl_link_ops macvlan_link_ops = { | 725 | static struct rtnl_link_ops macvlan_link_ops = { |
721 | .kind = "macvlan", | 726 | .kind = "macvlan", |
727 | .setup = macvlan_setup, | ||
722 | .newlink = macvlan_newlink, | 728 | .newlink = macvlan_newlink, |
723 | .dellink = macvlan_dellink, | 729 | .dellink = macvlan_dellink, |
724 | }; | 730 | }; |
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index a8a94e2f6ddc..ff02b836c3c4 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -180,11 +180,18 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb) | |||
180 | { | 180 | { |
181 | struct macvtap_queue *q = macvtap_get_queue(dev, skb); | 181 | struct macvtap_queue *q = macvtap_get_queue(dev, skb); |
182 | if (!q) | 182 | if (!q) |
183 | return -ENOLINK; | 183 | goto drop; |
184 | |||
185 | if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len) | ||
186 | goto drop; | ||
184 | 187 | ||
185 | skb_queue_tail(&q->sk.sk_receive_queue, skb); | 188 | skb_queue_tail(&q->sk.sk_receive_queue, skb); |
186 | wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); | 189 | wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); |
187 | return 0; | 190 | return NET_RX_SUCCESS; |
191 | |||
192 | drop: | ||
193 | kfree_skb(skb); | ||
194 | return NET_RX_DROP; | ||
188 | } | 195 | } |
189 | 196 | ||
190 | /* | 197 | /* |
@@ -235,8 +242,15 @@ static void macvtap_dellink(struct net_device *dev, | |||
235 | macvlan_dellink(dev, head); | 242 | macvlan_dellink(dev, head); |
236 | } | 243 | } |
237 | 244 | ||
245 | static void macvtap_setup(struct net_device *dev) | ||
246 | { | ||
247 | macvlan_common_setup(dev); | ||
248 | dev->tx_queue_len = TUN_READQ_SIZE; | ||
249 | } | ||
250 | |||
238 | static struct rtnl_link_ops macvtap_link_ops __read_mostly = { | 251 | static struct rtnl_link_ops macvtap_link_ops __read_mostly = { |
239 | .kind = "macvtap", | 252 | .kind = "macvtap", |
253 | .setup = macvtap_setup, | ||
240 | .newlink = macvtap_newlink, | 254 | .newlink = macvtap_newlink, |
241 | .dellink = macvtap_dellink, | 255 | .dellink = macvtap_dellink, |
242 | }; | 256 | }; |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 5e52c75892df..7f3a53dcc6ef 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -65,7 +65,7 @@ static int debug_level = ERR_DBG; | |||
65 | 65 | ||
66 | /* DEBUG message print. */ | 66 | /* DEBUG message print. */ |
67 | #define DBG_PRINT(dbg_level, fmt, args...) do { \ | 67 | #define DBG_PRINT(dbg_level, fmt, args...) do { \ |
68 | if (dbg_level >= debug_level) \ | 68 | if (dbg_level <= debug_level) \ |
69 | pr_info(fmt, ##args); \ | 69 | pr_info(fmt, ##args); \ |
70 | } while (0) | 70 | } while (0) |
71 | 71 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6ad6fe706312..63042596f0cf 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -736,8 +736,18 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun, | |||
736 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; | 736 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; |
737 | else if (sinfo->gso_type & SKB_GSO_UDP) | 737 | else if (sinfo->gso_type & SKB_GSO_UDP) |
738 | gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; | 738 | gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; |
739 | else | 739 | else { |
740 | BUG(); | 740 | printk(KERN_ERR "tun: unexpected GSO type: " |
741 | "0x%x, gso_size %d, hdr_len %d\n", | ||
742 | sinfo->gso_type, gso.gso_size, | ||
743 | gso.hdr_len); | ||
744 | print_hex_dump(KERN_ERR, "tun: ", | ||
745 | DUMP_PREFIX_NONE, | ||
746 | 16, 1, skb->head, | ||
747 | min((int)gso.hdr_len, 64), true); | ||
748 | WARN_ON_ONCE(1); | ||
749 | return -EINVAL; | ||
750 | } | ||
741 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) | 751 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) |
742 | gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN; | 752 | gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN; |
743 | } else | 753 | } else |
diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h index 2d7c96d7e865..eb80243e22df 100644 --- a/drivers/net/wimax/i2400m/i2400m-usb.h +++ b/drivers/net/wimax/i2400m/i2400m-usb.h | |||
@@ -152,6 +152,7 @@ enum { | |||
152 | /* Device IDs */ | 152 | /* Device IDs */ |
153 | USB_DEVICE_ID_I6050 = 0x0186, | 153 | USB_DEVICE_ID_I6050 = 0x0186, |
154 | USB_DEVICE_ID_I6050_2 = 0x0188, | 154 | USB_DEVICE_ID_I6050_2 = 0x0188, |
155 | USB_DEVICE_ID_I6250 = 0x0187, | ||
155 | }; | 156 | }; |
156 | 157 | ||
157 | 158 | ||
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c index 0d5081d77dc0..d3365ac85dde 100644 --- a/drivers/net/wimax/i2400m/usb.c +++ b/drivers/net/wimax/i2400m/usb.c | |||
@@ -491,6 +491,7 @@ int i2400mu_probe(struct usb_interface *iface, | |||
491 | switch (id->idProduct) { | 491 | switch (id->idProduct) { |
492 | case USB_DEVICE_ID_I6050: | 492 | case USB_DEVICE_ID_I6050: |
493 | case USB_DEVICE_ID_I6050_2: | 493 | case USB_DEVICE_ID_I6050_2: |
494 | case USB_DEVICE_ID_I6250: | ||
494 | i2400mu->i6050 = 1; | 495 | i2400mu->i6050 = 1; |
495 | break; | 496 | break; |
496 | default: | 497 | default: |
@@ -739,6 +740,7 @@ static | |||
739 | struct usb_device_id i2400mu_id_table[] = { | 740 | struct usb_device_id i2400mu_id_table[] = { |
740 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, | 741 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, |
741 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, | 742 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, |
743 | { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) }, | ||
742 | { USB_DEVICE(0x8086, 0x0181) }, | 744 | { USB_DEVICE(0x8086, 0x0181) }, |
743 | { USB_DEVICE(0x8086, 0x1403) }, | 745 | { USB_DEVICE(0x8086, 0x1403) }, |
744 | { USB_DEVICE(0x8086, 0x1405) }, | 746 | { USB_DEVICE(0x8086, 0x1405) }, |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index ca6065b71b46..e3e52913d83a 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -844,9 +844,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) | |||
844 | int dma_type; | 844 | int dma_type; |
845 | 845 | ||
846 | if (edma) | 846 | if (edma) |
847 | dma_type = DMA_FROM_DEVICE; | ||
848 | else | ||
849 | dma_type = DMA_BIDIRECTIONAL; | 847 | dma_type = DMA_BIDIRECTIONAL; |
848 | else | ||
849 | dma_type = DMA_FROM_DEVICE; | ||
850 | 850 | ||
851 | qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; | 851 | qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; |
852 | spin_lock_bh(&sc->rx.rxbuflock); | 852 | spin_lock_bh(&sc->rx.rxbuflock); |
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index df4532e91b1a..f370476d5417 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -178,7 +178,6 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
178 | unsigned long val, | 178 | unsigned long val, |
179 | struct cpufreq_freqs *freqs) | 179 | struct cpufreq_freqs *freqs) |
180 | { | 180 | { |
181 | #warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock" | ||
182 | switch (val) { | 181 | switch (val) { |
183 | case CPUFREQ_PRECHANGE: | 182 | case CPUFREQ_PRECHANGE: |
184 | if (freqs->new > freqs->old) { | 183 | if (freqs->new > freqs->old) { |
@@ -186,7 +185,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
186 | "pre-updating\n", | 185 | "pre-updating\n", |
187 | freqs->new / 1000, (freqs->new / 100) % 10, | 186 | freqs->new / 1000, (freqs->new / 100) % 10, |
188 | freqs->old / 1000, (freqs->old / 100) % 10); | 187 | freqs->old / 1000, (freqs->old / 100) % 10); |
189 | pxa2xx_pcmcia_set_mcxx(skt, freqs->new); | 188 | pxa2xx_pcmcia_set_timing(skt); |
190 | } | 189 | } |
191 | break; | 190 | break; |
192 | 191 | ||
@@ -196,7 +195,7 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
196 | "post-updating\n", | 195 | "post-updating\n", |
197 | freqs->new / 1000, (freqs->new / 100) % 10, | 196 | freqs->new / 1000, (freqs->new / 100) % 10, |
198 | freqs->old / 1000, (freqs->old / 100) % 10); | 197 | freqs->old / 1000, (freqs->old / 100) % 10); |
199 | pxa2xx_pcmcia_set_mcxx(skt, freqs->new); | 198 | pxa2xx_pcmcia_set_timing(skt); |
200 | } | 199 | } |
201 | break; | 200 | break; |
202 | } | 201 | } |
diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c index 2afbeec8b791..84d3c43cf2bc 100644 --- a/drivers/power/ds2782_battery.c +++ b/drivers/power/ds2782_battery.c | |||
@@ -43,10 +43,9 @@ | |||
43 | struct ds278x_info; | 43 | struct ds278x_info; |
44 | 44 | ||
45 | struct ds278x_battery_ops { | 45 | struct ds278x_battery_ops { |
46 | int (*get_current)(struct ds278x_info *info, int *current_uA); | 46 | int (*get_battery_current)(struct ds278x_info *info, int *current_uA); |
47 | int (*get_voltage)(struct ds278x_info *info, int *voltage_uA); | 47 | int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA); |
48 | int (*get_capacity)(struct ds278x_info *info, int *capacity_uA); | 48 | int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA); |
49 | |||
50 | }; | 49 | }; |
51 | 50 | ||
52 | #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery) | 51 | #define to_ds278x_info(x) container_of(x, struct ds278x_info, battery) |
@@ -213,11 +212,11 @@ static int ds278x_get_status(struct ds278x_info *info, int *status) | |||
213 | int current_uA; | 212 | int current_uA; |
214 | int capacity; | 213 | int capacity; |
215 | 214 | ||
216 | err = info->ops->get_current(info, ¤t_uA); | 215 | err = info->ops->get_battery_current(info, ¤t_uA); |
217 | if (err) | 216 | if (err) |
218 | return err; | 217 | return err; |
219 | 218 | ||
220 | err = info->ops->get_capacity(info, &capacity); | 219 | err = info->ops->get_battery_capacity(info, &capacity); |
221 | if (err) | 220 | if (err) |
222 | return err; | 221 | return err; |
223 | 222 | ||
@@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy, | |||
246 | break; | 245 | break; |
247 | 246 | ||
248 | case POWER_SUPPLY_PROP_CAPACITY: | 247 | case POWER_SUPPLY_PROP_CAPACITY: |
249 | ret = info->ops->get_capacity(info, &val->intval); | 248 | ret = info->ops->get_battery_capacity(info, &val->intval); |
250 | break; | 249 | break; |
251 | 250 | ||
252 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | 251 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: |
253 | ret = info->ops->get_voltage(info, &val->intval); | 252 | ret = info->ops->get_battery_voltage(info, &val->intval); |
254 | break; | 253 | break; |
255 | 254 | ||
256 | case POWER_SUPPLY_PROP_CURRENT_NOW: | 255 | case POWER_SUPPLY_PROP_CURRENT_NOW: |
257 | ret = info->ops->get_current(info, &val->intval); | 256 | ret = info->ops->get_battery_current(info, &val->intval); |
258 | break; | 257 | break; |
259 | 258 | ||
260 | case POWER_SUPPLY_PROP_TEMP: | 259 | case POWER_SUPPLY_PROP_TEMP: |
@@ -307,14 +306,14 @@ enum ds278x_num_id { | |||
307 | 306 | ||
308 | static struct ds278x_battery_ops ds278x_ops[] = { | 307 | static struct ds278x_battery_ops ds278x_ops[] = { |
309 | [DS2782] = { | 308 | [DS2782] = { |
310 | .get_current = ds2782_get_current, | 309 | .get_battery_current = ds2782_get_current, |
311 | .get_voltage = ds2782_get_voltage, | 310 | .get_battery_voltage = ds2782_get_voltage, |
312 | .get_capacity = ds2782_get_capacity, | 311 | .get_battery_capacity = ds2782_get_capacity, |
313 | }, | 312 | }, |
314 | [DS2786] = { | 313 | [DS2786] = { |
315 | .get_current = ds2786_get_current, | 314 | .get_battery_current = ds2786_get_current, |
316 | .get_voltage = ds2786_get_voltage, | 315 | .get_battery_voltage = ds2786_get_voltage, |
317 | .get_capacity = ds2786_get_capacity, | 316 | .get_battery_capacity = ds2786_get_capacity, |
318 | } | 317 | } |
319 | }; | 318 | }; |
320 | 319 | ||
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index 7b14a67bdca2..11790990277a 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
@@ -286,7 +286,7 @@ static int ab3100_list_voltage_regulator(struct regulator_dev *reg, | |||
286 | { | 286 | { |
287 | struct ab3100_regulator *abreg = reg->reg_data; | 287 | struct ab3100_regulator *abreg = reg->reg_data; |
288 | 288 | ||
289 | if (selector > abreg->voltages_len) | 289 | if (selector >= abreg->voltages_len) |
290 | return -EINVAL; | 290 | return -EINVAL; |
291 | return abreg->typ_voltages[selector]; | 291 | return abreg->typ_voltages[selector]; |
292 | } | 292 | } |
@@ -318,7 +318,7 @@ static int ab3100_get_voltage_regulator(struct regulator_dev *reg) | |||
318 | regval &= 0xE0; | 318 | regval &= 0xE0; |
319 | regval >>= 5; | 319 | regval >>= 5; |
320 | 320 | ||
321 | if (regval > abreg->voltages_len) { | 321 | if (regval >= abreg->voltages_len) { |
322 | dev_err(®->dev, | 322 | dev_err(®->dev, |
323 | "regulator register %02x contains an illegal voltage setting\n", | 323 | "regulator register %02x contains an illegal voltage setting\n", |
324 | abreg->regreg); | 324 | abreg->regreg); |
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 14b4576281c5..8152d65220f5 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/regulator/driver.h> | 23 | #include <linux/regulator/driver.h> |
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/regulator/tps6507x.h> | ||
25 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
27 | #include <linux/mfd/tps6507x.h> | 28 | #include <linux/mfd/tps6507x.h> |
@@ -101,9 +102,12 @@ struct tps_info { | |||
101 | unsigned max_uV; | 102 | unsigned max_uV; |
102 | u8 table_len; | 103 | u8 table_len; |
103 | const u16 *table; | 104 | const u16 *table; |
105 | |||
106 | /* Does DCDC high or the low register defines output voltage? */ | ||
107 | bool defdcdc_default; | ||
104 | }; | 108 | }; |
105 | 109 | ||
106 | static const struct tps_info tps6507x_pmic_regs[] = { | 110 | static struct tps_info tps6507x_pmic_regs[] = { |
107 | { | 111 | { |
108 | .name = "VDCDC1", | 112 | .name = "VDCDC1", |
109 | .min_uV = 725000, | 113 | .min_uV = 725000, |
@@ -145,7 +149,7 @@ struct tps6507x_pmic { | |||
145 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; | 149 | struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; |
146 | struct tps6507x_dev *mfd; | 150 | struct tps6507x_dev *mfd; |
147 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; | 151 | struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; |
148 | const struct tps_info *info[TPS6507X_NUM_REGULATOR]; | 152 | struct tps_info *info[TPS6507X_NUM_REGULATOR]; |
149 | struct mutex io_lock; | 153 | struct mutex io_lock; |
150 | }; | 154 | }; |
151 | static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg) | 155 | static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg) |
@@ -341,10 +345,16 @@ static int tps6507x_pmic_dcdc_get_voltage(struct regulator_dev *dev) | |||
341 | reg = TPS6507X_REG_DEFDCDC1; | 345 | reg = TPS6507X_REG_DEFDCDC1; |
342 | break; | 346 | break; |
343 | case TPS6507X_DCDC_2: | 347 | case TPS6507X_DCDC_2: |
344 | reg = TPS6507X_REG_DEFDCDC2_LOW; | 348 | if (tps->info[dcdc]->defdcdc_default) |
349 | reg = TPS6507X_REG_DEFDCDC2_HIGH; | ||
350 | else | ||
351 | reg = TPS6507X_REG_DEFDCDC2_LOW; | ||
345 | break; | 352 | break; |
346 | case TPS6507X_DCDC_3: | 353 | case TPS6507X_DCDC_3: |
347 | reg = TPS6507X_REG_DEFDCDC3_LOW; | 354 | if (tps->info[dcdc]->defdcdc_default) |
355 | reg = TPS6507X_REG_DEFDCDC3_HIGH; | ||
356 | else | ||
357 | reg = TPS6507X_REG_DEFDCDC3_LOW; | ||
348 | break; | 358 | break; |
349 | default: | 359 | default: |
350 | return -EINVAL; | 360 | return -EINVAL; |
@@ -370,10 +380,16 @@ static int tps6507x_pmic_dcdc_set_voltage(struct regulator_dev *dev, | |||
370 | reg = TPS6507X_REG_DEFDCDC1; | 380 | reg = TPS6507X_REG_DEFDCDC1; |
371 | break; | 381 | break; |
372 | case TPS6507X_DCDC_2: | 382 | case TPS6507X_DCDC_2: |
373 | reg = TPS6507X_REG_DEFDCDC2_LOW; | 383 | if (tps->info[dcdc]->defdcdc_default) |
384 | reg = TPS6507X_REG_DEFDCDC2_HIGH; | ||
385 | else | ||
386 | reg = TPS6507X_REG_DEFDCDC2_LOW; | ||
374 | break; | 387 | break; |
375 | case TPS6507X_DCDC_3: | 388 | case TPS6507X_DCDC_3: |
376 | reg = TPS6507X_REG_DEFDCDC3_LOW; | 389 | if (tps->info[dcdc]->defdcdc_default) |
390 | reg = TPS6507X_REG_DEFDCDC3_HIGH; | ||
391 | else | ||
392 | reg = TPS6507X_REG_DEFDCDC3_LOW; | ||
377 | break; | 393 | break; |
378 | default: | 394 | default: |
379 | return -EINVAL; | 395 | return -EINVAL; |
@@ -532,7 +548,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev) | |||
532 | { | 548 | { |
533 | struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); | 549 | struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); |
534 | static int desc_id; | 550 | static int desc_id; |
535 | const struct tps_info *info = &tps6507x_pmic_regs[0]; | 551 | struct tps_info *info = &tps6507x_pmic_regs[0]; |
536 | struct regulator_init_data *init_data; | 552 | struct regulator_init_data *init_data; |
537 | struct regulator_dev *rdev; | 553 | struct regulator_dev *rdev; |
538 | struct tps6507x_pmic *tps; | 554 | struct tps6507x_pmic *tps; |
@@ -569,6 +585,12 @@ int tps6507x_pmic_probe(struct platform_device *pdev) | |||
569 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { | 585 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { |
570 | /* Register the regulators */ | 586 | /* Register the regulators */ |
571 | tps->info[i] = info; | 587 | tps->info[i] = info; |
588 | if (init_data->driver_data) { | ||
589 | struct tps6507x_reg_platform_data *data = | ||
590 | init_data->driver_data; | ||
591 | tps->info[i]->defdcdc_default = data->defdcdc_default; | ||
592 | } | ||
593 | |||
572 | tps->desc[i].name = info->name; | 594 | tps->desc[i].name = info->name; |
573 | tps->desc[i].id = desc_id++; | 595 | tps->desc[i].id = desc_id++; |
574 | tps->desc[i].n_voltages = num_voltages[i]; | 596 | tps->desc[i].n_voltages = num_voltages[i]; |
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 723cd1fb4867..0e6ed7db9364 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg, | |||
1495 | if (ret != 0) { | 1495 | if (ret != 0) { |
1496 | dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", | 1496 | dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", |
1497 | reg, ret); | 1497 | reg, ret); |
1498 | platform_device_del(pdev); | 1498 | platform_device_put(pdev); |
1499 | wm8350->pmic.pdev[reg] = NULL; | 1499 | wm8350->pmic.pdev[reg] = NULL; |
1500 | } | 1500 | } |
1501 | 1501 | ||
diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c index 9718aaaa8215..600b890a3c15 100644 --- a/drivers/rtc/rtc-rx8581.c +++ b/drivers/rtc/rtc-rx8581.c | |||
@@ -168,7 +168,7 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
168 | return -EIO; | 168 | return -EIO; |
169 | } | 169 | } |
170 | 170 | ||
171 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | 171 | err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL, |
172 | (data | RX8581_CTRL_STOP)); | 172 | (data | RX8581_CTRL_STOP)); |
173 | if (err < 0) { | 173 | if (err < 0) { |
174 | dev_err(&client->dev, "Unable to write control register\n"); | 174 | dev_err(&client->dev, "Unable to write control register\n"); |
@@ -182,6 +182,20 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
182 | return -EIO; | 182 | return -EIO; |
183 | } | 183 | } |
184 | 184 | ||
185 | /* get VLF and clear it */ | ||
186 | data = i2c_smbus_read_byte_data(client, RX8581_REG_FLAG); | ||
187 | if (data < 0) { | ||
188 | dev_err(&client->dev, "Unable to read flag register\n"); | ||
189 | return -EIO; | ||
190 | } | ||
191 | |||
192 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | ||
193 | (data & ~(RX8581_FLAG_VLF))); | ||
194 | if (err != 0) { | ||
195 | dev_err(&client->dev, "Unable to write flag register\n"); | ||
196 | return -EIO; | ||
197 | } | ||
198 | |||
185 | /* Restart the clock */ | 199 | /* Restart the clock */ |
186 | data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL); | 200 | data = i2c_smbus_read_byte_data(client, RX8581_REG_CTRL); |
187 | if (data < 0) { | 201 | if (data < 0) { |
@@ -189,8 +203,8 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
189 | return -EIO; | 203 | return -EIO; |
190 | } | 204 | } |
191 | 205 | ||
192 | err = i2c_smbus_write_byte_data(client, RX8581_REG_FLAG, | 206 | err = i2c_smbus_write_byte_data(client, RX8581_REG_CTRL, |
193 | (data | ~(RX8581_CTRL_STOP))); | 207 | (data & ~(RX8581_CTRL_STOP))); |
194 | if (err != 0) { | 208 | if (err != 0) { |
195 | dev_err(&client->dev, "Unable to write control register\n"); | 209 | dev_err(&client->dev, "Unable to write control register\n"); |
196 | return -EIO; | 210 | return -EIO; |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index e3dbeda97179..fd068bc1bd0a 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -714,6 +714,14 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act) | |||
714 | if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) | 714 | if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) |
715 | return ZFCP_ERP_FAILED; | 715 | return ZFCP_ERP_FAILED; |
716 | 716 | ||
717 | if (mempool_resize(act->adapter->pool.status_read_data, | ||
718 | act->adapter->stat_read_buf_num, GFP_KERNEL)) | ||
719 | return ZFCP_ERP_FAILED; | ||
720 | |||
721 | if (mempool_resize(act->adapter->pool.status_read_req, | ||
722 | act->adapter->stat_read_buf_num, GFP_KERNEL)) | ||
723 | return ZFCP_ERP_FAILED; | ||
724 | |||
717 | atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); | 725 | atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); |
718 | if (zfcp_status_read_refill(act->adapter)) | 726 | if (zfcp_status_read_refill(act->adapter)) |
719 | return ZFCP_ERP_FAILED; | 727 | return ZFCP_ERP_FAILED; |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 9ac6a6e4a604..71663fb77310 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -496,7 +496,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) | |||
496 | 496 | ||
497 | adapter->hydra_version = bottom->adapter_type; | 497 | adapter->hydra_version = bottom->adapter_type; |
498 | adapter->timer_ticks = bottom->timer_interval; | 498 | adapter->timer_ticks = bottom->timer_interval; |
499 | adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16); | 499 | adapter->stat_read_buf_num = max(bottom->status_read_buf_num, |
500 | (u16)FSF_STATUS_READS_RECOM); | ||
500 | 501 | ||
501 | if (fc_host_permanent_port_name(shost) == -1) | 502 | if (fc_host_permanent_port_name(shost) == -1) |
502 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); | 503 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); |
@@ -719,11 +720,6 @@ static struct zfcp_fsf_req *zfcp_fsf_req_create(struct zfcp_qdio *qdio, | |||
719 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, | 720 | zfcp_qdio_req_init(adapter->qdio, &req->qdio_req, req->req_id, sbtype, |
720 | req->qtcb, sizeof(struct fsf_qtcb)); | 721 | req->qtcb, sizeof(struct fsf_qtcb)); |
721 | 722 | ||
722 | if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) { | ||
723 | zfcp_fsf_req_free(req); | ||
724 | return ERR_PTR(-EIO); | ||
725 | } | ||
726 | |||
727 | return req; | 723 | return req; |
728 | } | 724 | } |
729 | 725 | ||
@@ -981,7 +977,7 @@ static int zfcp_fsf_setup_ct_els_sbals(struct zfcp_fsf_req *req, | |||
981 | } | 977 | } |
982 | 978 | ||
983 | /* use single, unchained SBAL if it can hold the request */ | 979 | /* use single, unchained SBAL if it can hold the request */ |
984 | if (zfcp_qdio_sg_one_sbale(sg_req) || zfcp_qdio_sg_one_sbale(sg_resp)) { | 980 | if (zfcp_qdio_sg_one_sbale(sg_req) && zfcp_qdio_sg_one_sbale(sg_resp)) { |
985 | zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req, | 981 | zfcp_fsf_setup_ct_els_unchained(adapter->qdio, &req->qdio_req, |
986 | sg_req, sg_resp); | 982 | sg_req, sg_resp); |
987 | return 0; | 983 | return 0; |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 28117e130e2c..6fa5e0453176 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -251,7 +251,8 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio) | |||
251 | struct zfcp_qdio_queue *req_q = &qdio->req_q; | 251 | struct zfcp_qdio_queue *req_q = &qdio->req_q; |
252 | 252 | ||
253 | spin_lock_bh(&qdio->req_q_lock); | 253 | spin_lock_bh(&qdio->req_q_lock); |
254 | if (atomic_read(&req_q->count)) | 254 | if (atomic_read(&req_q->count) || |
255 | !(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) | ||
255 | return 1; | 256 | return 1; |
256 | spin_unlock_bh(&qdio->req_q_lock); | 257 | spin_unlock_bh(&qdio->req_q_lock); |
257 | return 0; | 258 | return 0; |
@@ -274,8 +275,13 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio) | |||
274 | spin_unlock_bh(&qdio->req_q_lock); | 275 | spin_unlock_bh(&qdio->req_q_lock); |
275 | ret = wait_event_interruptible_timeout(qdio->req_q_wq, | 276 | ret = wait_event_interruptible_timeout(qdio->req_q_wq, |
276 | zfcp_qdio_sbal_check(qdio), 5 * HZ); | 277 | zfcp_qdio_sbal_check(qdio), 5 * HZ); |
278 | |||
279 | if (!(atomic_read(&qdio->adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)) | ||
280 | return -EIO; | ||
281 | |||
277 | if (ret > 0) | 282 | if (ret > 0) |
278 | return 0; | 283 | return 0; |
284 | |||
279 | if (!ret) { | 285 | if (!ret) { |
280 | atomic_inc(&qdio->req_q_full); | 286 | atomic_inc(&qdio->req_q_full); |
281 | /* assume hanging outbound queue, try queue recovery */ | 287 | /* assume hanging outbound queue, try queue recovery */ |
@@ -375,6 +381,8 @@ void zfcp_qdio_close(struct zfcp_qdio *qdio) | |||
375 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); | 381 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &qdio->adapter->status); |
376 | spin_unlock_bh(&qdio->req_q_lock); | 382 | spin_unlock_bh(&qdio->req_q_lock); |
377 | 383 | ||
384 | wake_up(&qdio->req_q_wq); | ||
385 | |||
378 | qdio_shutdown(qdio->adapter->ccw_device, | 386 | qdio_shutdown(qdio->adapter->ccw_device, |
379 | QDIO_FLAG_CLEANUP_USING_CLEAR); | 387 | QDIO_FLAG_CLEANUP_USING_CLEAR); |
380 | 388 | ||
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c index a864ccc0a342..989b9a8ba72d 100644 --- a/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c | |||
@@ -277,6 +277,12 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
277 | goto reg_crq_failed; | 277 | goto reg_crq_failed; |
278 | } | 278 | } |
279 | 279 | ||
280 | queue->cur = 0; | ||
281 | spin_lock_init(&queue->lock); | ||
282 | |||
283 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
284 | (unsigned long)hostdata); | ||
285 | |||
280 | if (request_irq(vdev->irq, | 286 | if (request_irq(vdev->irq, |
281 | rpavscsi_handle_event, | 287 | rpavscsi_handle_event, |
282 | 0, "ibmvscsi", (void *)hostdata) != 0) { | 288 | 0, "ibmvscsi", (void *)hostdata) != 0) { |
@@ -291,15 +297,10 @@ static int rpavscsi_init_crq_queue(struct crq_queue *queue, | |||
291 | goto req_irq_failed; | 297 | goto req_irq_failed; |
292 | } | 298 | } |
293 | 299 | ||
294 | queue->cur = 0; | ||
295 | spin_lock_init(&queue->lock); | ||
296 | |||
297 | tasklet_init(&hostdata->srp_task, (void *)rpavscsi_task, | ||
298 | (unsigned long)hostdata); | ||
299 | |||
300 | return retrc; | 300 | return retrc; |
301 | 301 | ||
302 | req_irq_failed: | 302 | req_irq_failed: |
303 | tasklet_kill(&hostdata->srp_task); | ||
303 | do { | 304 | do { |
304 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); | 305 | rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); |
305 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); | 306 | } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 82ea4a8226b0..f820cffb7f00 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -1129,20 +1129,22 @@ static int ipr_is_same_device(struct ipr_resource_entry *res, | |||
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | /** | 1131 | /** |
1132 | * ipr_format_resource_path - Format the resource path for printing. | 1132 | * ipr_format_res_path - Format the resource path for printing. |
1133 | * @res_path: resource path | 1133 | * @res_path: resource path |
1134 | * @buf: buffer | 1134 | * @buf: buffer |
1135 | * | 1135 | * |
1136 | * Return value: | 1136 | * Return value: |
1137 | * pointer to buffer | 1137 | * pointer to buffer |
1138 | **/ | 1138 | **/ |
1139 | static char *ipr_format_resource_path(u8 *res_path, char *buffer) | 1139 | static char *ipr_format_res_path(u8 *res_path, char *buffer, int len) |
1140 | { | 1140 | { |
1141 | int i; | 1141 | int i; |
1142 | char *p = buffer; | ||
1142 | 1143 | ||
1143 | sprintf(buffer, "%02X", res_path[0]); | 1144 | res_path[0] = '\0'; |
1144 | for (i=1; res_path[i] != 0xff; i++) | 1145 | p += snprintf(p, buffer + len - p, "%02X", res_path[0]); |
1145 | sprintf(buffer, "%s-%02X", buffer, res_path[i]); | 1146 | for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++) |
1147 | p += snprintf(p, buffer + len - p, "-%02X", res_path[i]); | ||
1146 | 1148 | ||
1147 | return buffer; | 1149 | return buffer; |
1148 | } | 1150 | } |
@@ -1187,7 +1189,8 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res, | |||
1187 | 1189 | ||
1188 | if (res->sdev && new_path) | 1190 | if (res->sdev && new_path) |
1189 | sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n", | 1191 | sdev_printk(KERN_INFO, res->sdev, "Resource path: %s\n", |
1190 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 1192 | ipr_format_res_path(res->res_path, buffer, |
1193 | sizeof(buffer))); | ||
1191 | } else { | 1194 | } else { |
1192 | res->flags = cfgtew->u.cfgte->flags; | 1195 | res->flags = cfgtew->u.cfgte->flags; |
1193 | if (res->flags & IPR_IS_IOA_RESOURCE) | 1196 | if (res->flags & IPR_IS_IOA_RESOURCE) |
@@ -1573,7 +1576,8 @@ static void ipr_log_sis64_config_error(struct ipr_ioa_cfg *ioa_cfg, | |||
1573 | ipr_err_separator; | 1576 | ipr_err_separator; |
1574 | 1577 | ||
1575 | ipr_err("Device %d : %s", i + 1, | 1578 | ipr_err("Device %d : %s", i + 1, |
1576 | ipr_format_resource_path(&dev_entry->res_path[0], &buffer[0])); | 1579 | ipr_format_res_path(dev_entry->res_path, buffer, |
1580 | sizeof(buffer))); | ||
1577 | ipr_log_ext_vpd(&dev_entry->vpd); | 1581 | ipr_log_ext_vpd(&dev_entry->vpd); |
1578 | 1582 | ||
1579 | ipr_err("-----New Device Information-----\n"); | 1583 | ipr_err("-----New Device Information-----\n"); |
@@ -1919,13 +1923,14 @@ static void ipr_log64_fabric_path(struct ipr_hostrcb *hostrcb, | |||
1919 | 1923 | ||
1920 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n", | 1924 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s\n", |
1921 | path_active_desc[i].desc, path_state_desc[j].desc, | 1925 | path_active_desc[i].desc, path_state_desc[j].desc, |
1922 | ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); | 1926 | ipr_format_res_path(fabric->res_path, buffer, |
1927 | sizeof(buffer))); | ||
1923 | return; | 1928 | return; |
1924 | } | 1929 | } |
1925 | } | 1930 | } |
1926 | 1931 | ||
1927 | ipr_err("Path state=%02X Resource Path=%s\n", path_state, | 1932 | ipr_err("Path state=%02X Resource Path=%s\n", path_state, |
1928 | ipr_format_resource_path(&fabric->res_path[0], &buffer[0])); | 1933 | ipr_format_res_path(fabric->res_path, buffer, sizeof(buffer))); |
1929 | } | 1934 | } |
1930 | 1935 | ||
1931 | static const struct { | 1936 | static const struct { |
@@ -2066,7 +2071,8 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb, | |||
2066 | 2071 | ||
2067 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n", | 2072 | ipr_hcam_err(hostrcb, "%s %s: Resource Path=%s, Link rate=%s, WWN=%08X%08X\n", |
2068 | path_status_desc[j].desc, path_type_desc[i].desc, | 2073 | path_status_desc[j].desc, path_type_desc[i].desc, |
2069 | ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), | 2074 | ipr_format_res_path(cfg->res_path, buffer, |
2075 | sizeof(buffer)), | ||
2070 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], | 2076 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], |
2071 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); | 2077 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); |
2072 | return; | 2078 | return; |
@@ -2074,7 +2080,7 @@ static void ipr_log64_path_elem(struct ipr_hostrcb *hostrcb, | |||
2074 | } | 2080 | } |
2075 | ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s " | 2081 | ipr_hcam_err(hostrcb, "Path element=%02X: Resource Path=%s, Link rate=%s " |
2076 | "WWN=%08X%08X\n", cfg->type_status, | 2082 | "WWN=%08X%08X\n", cfg->type_status, |
2077 | ipr_format_resource_path(&cfg->res_path[0], &buffer[0]), | 2083 | ipr_format_res_path(cfg->res_path, buffer, sizeof(buffer)), |
2078 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], | 2084 | link_rate[cfg->link_rate & IPR_PHY_LINK_RATE_MASK], |
2079 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); | 2085 | be32_to_cpu(cfg->wwid[0]), be32_to_cpu(cfg->wwid[1])); |
2080 | } | 2086 | } |
@@ -2139,7 +2145,7 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2139 | 2145 | ||
2140 | ipr_err("RAID %s Array Configuration: %s\n", | 2146 | ipr_err("RAID %s Array Configuration: %s\n", |
2141 | error->protection_level, | 2147 | error->protection_level, |
2142 | ipr_format_resource_path(&error->last_res_path[0], &buffer[0])); | 2148 | ipr_format_res_path(error->last_res_path, buffer, sizeof(buffer))); |
2143 | 2149 | ||
2144 | ipr_err_separator; | 2150 | ipr_err_separator; |
2145 | 2151 | ||
@@ -2160,9 +2166,11 @@ static void ipr_log_sis64_array_error(struct ipr_ioa_cfg *ioa_cfg, | |||
2160 | ipr_err("Array Member %d:\n", i); | 2166 | ipr_err("Array Member %d:\n", i); |
2161 | ipr_log_ext_vpd(&array_entry->vpd); | 2167 | ipr_log_ext_vpd(&array_entry->vpd); |
2162 | ipr_err("Current Location: %s", | 2168 | ipr_err("Current Location: %s", |
2163 | ipr_format_resource_path(&array_entry->res_path[0], &buffer[0])); | 2169 | ipr_format_res_path(array_entry->res_path, buffer, |
2170 | sizeof(buffer))); | ||
2164 | ipr_err("Expected Location: %s", | 2171 | ipr_err("Expected Location: %s", |
2165 | ipr_format_resource_path(&array_entry->expected_res_path[0], &buffer[0])); | 2172 | ipr_format_res_path(array_entry->expected_res_path, |
2173 | buffer, sizeof(buffer))); | ||
2166 | 2174 | ||
2167 | ipr_err_separator; | 2175 | ipr_err_separator; |
2168 | } | 2176 | } |
@@ -4079,7 +4087,8 @@ static struct device_attribute ipr_adapter_handle_attr = { | |||
4079 | }; | 4087 | }; |
4080 | 4088 | ||
4081 | /** | 4089 | /** |
4082 | * ipr_show_resource_path - Show the resource path for this device. | 4090 | * ipr_show_resource_path - Show the resource path or the resource address for |
4091 | * this device. | ||
4083 | * @dev: device struct | 4092 | * @dev: device struct |
4084 | * @buf: buffer | 4093 | * @buf: buffer |
4085 | * | 4094 | * |
@@ -4097,9 +4106,14 @@ static ssize_t ipr_show_resource_path(struct device *dev, struct device_attribut | |||
4097 | 4106 | ||
4098 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); | 4107 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); |
4099 | res = (struct ipr_resource_entry *)sdev->hostdata; | 4108 | res = (struct ipr_resource_entry *)sdev->hostdata; |
4100 | if (res) | 4109 | if (res && ioa_cfg->sis64) |
4101 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 4110 | len = snprintf(buf, PAGE_SIZE, "%s\n", |
4102 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 4111 | ipr_format_res_path(res->res_path, buffer, |
4112 | sizeof(buffer))); | ||
4113 | else if (res) | ||
4114 | len = snprintf(buf, PAGE_SIZE, "%d:%d:%d:%d\n", ioa_cfg->host->host_no, | ||
4115 | res->bus, res->target, res->lun); | ||
4116 | |||
4103 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 4117 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
4104 | return len; | 4118 | return len; |
4105 | } | 4119 | } |
@@ -4351,7 +4365,8 @@ static int ipr_slave_configure(struct scsi_device *sdev) | |||
4351 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); | 4365 | scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); |
4352 | if (ioa_cfg->sis64) | 4366 | if (ioa_cfg->sis64) |
4353 | sdev_printk(KERN_INFO, sdev, "Resource path: %s\n", | 4367 | sdev_printk(KERN_INFO, sdev, "Resource path: %s\n", |
4354 | ipr_format_resource_path(&res->res_path[0], &buffer[0])); | 4368 | ipr_format_res_path(res->res_path, buffer, |
4369 | sizeof(buffer))); | ||
4355 | return 0; | 4370 | return 0; |
4356 | } | 4371 | } |
4357 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 4372 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 9ecd2259eb39..b965f3587c9d 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -1684,8 +1684,9 @@ struct ipr_ucode_image_header { | |||
1684 | if (ipr_is_device(hostrcb)) { \ | 1684 | if (ipr_is_device(hostrcb)) { \ |
1685 | if ((hostrcb)->ioa_cfg->sis64) { \ | 1685 | if ((hostrcb)->ioa_cfg->sis64) { \ |
1686 | printk(KERN_ERR IPR_NAME ": %s: " fmt, \ | 1686 | printk(KERN_ERR IPR_NAME ": %s: " fmt, \ |
1687 | ipr_format_resource_path(&hostrcb->hcam.u.error64.fd_res_path[0], \ | 1687 | ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \ |
1688 | &hostrcb->rp_buffer[0]), \ | 1688 | hostrcb->rp_buffer, \ |
1689 | sizeof(hostrcb->rp_buffer)), \ | ||
1689 | __VA_ARGS__); \ | 1690 | __VA_ARGS__); \ |
1690 | } else { \ | 1691 | } else { \ |
1691 | ipr_ra_err((hostrcb)->ioa_cfg, \ | 1692 | ipr_ra_err((hostrcb)->ioa_cfg, \ |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index eed3c2d8dd1c..a182def7007d 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/uaccess.h> | 41 | #include <linux/uaccess.h> |
42 | 42 | ||
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #include <asm/ioctls.h> | ||
44 | 45 | ||
45 | #include <asm/mach/serial_at91.h> | 46 | #include <asm/mach/serial_at91.h> |
46 | #include <mach/board.h> | 47 | #include <mach/board.h> |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 61d75507d5d0..162c95a088ed 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1596,6 +1596,7 @@ static const struct usb_device_id acm_ids[] = { | |||
1596 | { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */ | 1596 | { NOKIA_PCSUITE_ACM_INFO(0x00e9), }, /* Nokia 5320 XpressMusic */ |
1597 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ | 1597 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ |
1598 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ | 1598 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ |
1599 | { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */ | ||
1599 | 1600 | ||
1600 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ | 1601 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ |
1601 | 1602 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 83e7bbbe97fa..70cccc75a362 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1982,6 +1982,8 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
1982 | (portstatus & USB_PORT_STAT_ENABLE)) { | 1982 | (portstatus & USB_PORT_STAT_ENABLE)) { |
1983 | if (hub_is_wusb(hub)) | 1983 | if (hub_is_wusb(hub)) |
1984 | udev->speed = USB_SPEED_WIRELESS; | 1984 | udev->speed = USB_SPEED_WIRELESS; |
1985 | else if (portstatus & USB_PORT_STAT_SUPER_SPEED) | ||
1986 | udev->speed = USB_SPEED_SUPER; | ||
1985 | else if (portstatus & USB_PORT_STAT_HIGH_SPEED) | 1987 | else if (portstatus & USB_PORT_STAT_HIGH_SPEED) |
1986 | udev->speed = USB_SPEED_HIGH; | 1988 | udev->speed = USB_SPEED_HIGH; |
1987 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) | 1989 | else if (portstatus & USB_PORT_STAT_LOW_SPEED) |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index f22d03df8b17..db99c084df92 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
@@ -41,6 +41,10 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
41 | /* Philips PSC805 audio device */ | 41 | /* Philips PSC805 audio device */ |
42 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, | 42 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, |
43 | 43 | ||
44 | /* Artisman Watchdog Dongle */ | ||
45 | { USB_DEVICE(0x04b4, 0x0526), .driver_info = | ||
46 | USB_QUIRK_CONFIG_INTF_STRINGS }, | ||
47 | |||
44 | /* Roland SC-8820 */ | 48 | /* Roland SC-8820 */ |
45 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, | 49 | { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, |
46 | 50 | ||
@@ -64,6 +68,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
64 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ | 68 | /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ |
65 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, | 69 | { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, |
66 | 70 | ||
71 | /* Broadcom BCM92035DGROM BT dongle */ | ||
72 | { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME }, | ||
73 | |||
67 | /* Action Semiconductor flash disk */ | 74 | /* Action Semiconductor flash disk */ |
68 | { USB_DEVICE(0x10d6, 0x2200), .driver_info = | 75 | { USB_DEVICE(0x10d6, 0x2200), .driver_info = |
69 | USB_QUIRK_STRING_FETCH_255 }, | 76 | USB_QUIRK_STRING_FETCH_255 }, |
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index 85b0d8921eae..980762453a9c 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c | |||
@@ -2561,7 +2561,7 @@ static void pxa_udc_shutdown(struct platform_device *_dev) | |||
2561 | udc_disable(udc); | 2561 | udc_disable(udc); |
2562 | } | 2562 | } |
2563 | 2563 | ||
2564 | #ifdef CONFIG_CPU_PXA27x | 2564 | #ifdef CONFIG_PXA27x |
2565 | extern void pxa27x_clear_otgph(void); | 2565 | extern void pxa27x_clear_otgph(void); |
2566 | #else | 2566 | #else |
2567 | #define pxa27x_clear_otgph() do {} while (0) | 2567 | #define pxa27x_clear_otgph() do {} while (0) |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index e724a051bfdd..ea2b3c7ebee5 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -735,6 +735,10 @@ static void s3c2410_udc_handle_ep0_idle(struct s3c2410_udc *dev, | |||
735 | else | 735 | else |
736 | dev->ep0state = EP0_OUT_DATA_PHASE; | 736 | dev->ep0state = EP0_OUT_DATA_PHASE; |
737 | 737 | ||
738 | if (!dev->driver) | ||
739 | return; | ||
740 | |||
741 | /* deliver the request to the gadget driver */ | ||
738 | ret = dev->driver->setup(&dev->gadget, crq); | 742 | ret = dev->driver->setup(&dev->gadget, crq); |
739 | if (ret < 0) { | 743 | if (ret < 0) { |
740 | if (dev->req_config) { | 744 | if (dev->req_config) { |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index a18debdd79b8..418163894775 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -203,7 +203,7 @@ static inline void pxa27x_reset_hc(struct pxa27x_ohci *ohci) | |||
203 | __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR); | 203 | __raw_writel(uhchr & ~UHCHR_FHR, ohci->mmio_base + UHCHR); |
204 | } | 204 | } |
205 | 205 | ||
206 | #ifdef CONFIG_CPU_PXA27x | 206 | #ifdef CONFIG_PXA27x |
207 | extern void pxa27x_clear_otgph(void); | 207 | extern void pxa27x_clear_otgph(void); |
208 | #else | 208 | #else |
209 | #define pxa27x_clear_otgph() do {} while (0) | 209 | #define pxa27x_clear_otgph() do {} while (0) |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index fd9e03afd91c..2eb658d26394 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -835,6 +835,27 @@ fail: | |||
835 | return 0; | 835 | return 0; |
836 | } | 836 | } |
837 | 837 | ||
838 | void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, | ||
839 | struct usb_device *udev) | ||
840 | { | ||
841 | struct xhci_virt_device *virt_dev; | ||
842 | struct xhci_ep_ctx *ep0_ctx; | ||
843 | struct xhci_ring *ep_ring; | ||
844 | |||
845 | virt_dev = xhci->devs[udev->slot_id]; | ||
846 | ep0_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, 0); | ||
847 | ep_ring = virt_dev->eps[0].ring; | ||
848 | /* | ||
849 | * FIXME we don't keep track of the dequeue pointer very well after a | ||
850 | * Set TR dequeue pointer, so we're setting the dequeue pointer of the | ||
851 | * host to our enqueue pointer. This should only be called after a | ||
852 | * configured device has reset, so all control transfers should have | ||
853 | * been completed or cancelled before the reset. | ||
854 | */ | ||
855 | ep0_ctx->deq = xhci_trb_virt_to_dma(ep_ring->enq_seg, ep_ring->enqueue); | ||
856 | ep0_ctx->deq |= ep_ring->cycle_state; | ||
857 | } | ||
858 | |||
838 | /* Setup an xHCI virtual device for a Set Address command */ | 859 | /* Setup an xHCI virtual device for a Set Address command */ |
839 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) | 860 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev) |
840 | { | 861 | { |
@@ -1002,7 +1023,7 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1002 | return EP_INTERVAL(interval); | 1023 | return EP_INTERVAL(interval); |
1003 | } | 1024 | } |
1004 | 1025 | ||
1005 | /* The "Mult" field in the endpoint context is only set for SuperSpeed devices. | 1026 | /* The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps. |
1006 | * High speed endpoint descriptors can define "the number of additional | 1027 | * High speed endpoint descriptors can define "the number of additional |
1007 | * transaction opportunities per microframe", but that goes in the Max Burst | 1028 | * transaction opportunities per microframe", but that goes in the Max Burst |
1008 | * endpoint context field. | 1029 | * endpoint context field. |
@@ -1010,7 +1031,8 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev, | |||
1010 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, | 1031 | static inline u32 xhci_get_endpoint_mult(struct usb_device *udev, |
1011 | struct usb_host_endpoint *ep) | 1032 | struct usb_host_endpoint *ep) |
1012 | { | 1033 | { |
1013 | if (udev->speed != USB_SPEED_SUPER) | 1034 | if (udev->speed != USB_SPEED_SUPER || |
1035 | !usb_endpoint_xfer_isoc(&ep->desc)) | ||
1014 | return 0; | 1036 | return 0; |
1015 | return ep->ss_ep_comp.bmAttributes; | 1037 | return ep->ss_ep_comp.bmAttributes; |
1016 | } | 1038 | } |
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 94e6934edb09..bfc99a939455 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -2380,16 +2380,19 @@ static int queue_command(struct xhci_hcd *xhci, u32 field1, u32 field2, | |||
2380 | u32 field3, u32 field4, bool command_must_succeed) | 2380 | u32 field3, u32 field4, bool command_must_succeed) |
2381 | { | 2381 | { |
2382 | int reserved_trbs = xhci->cmd_ring_reserved_trbs; | 2382 | int reserved_trbs = xhci->cmd_ring_reserved_trbs; |
2383 | int ret; | ||
2384 | |||
2383 | if (!command_must_succeed) | 2385 | if (!command_must_succeed) |
2384 | reserved_trbs++; | 2386 | reserved_trbs++; |
2385 | 2387 | ||
2386 | if (!room_on_ring(xhci, xhci->cmd_ring, reserved_trbs)) { | 2388 | ret = prepare_ring(xhci, xhci->cmd_ring, EP_STATE_RUNNING, |
2387 | if (!in_interrupt()) | 2389 | reserved_trbs, GFP_ATOMIC); |
2388 | xhci_err(xhci, "ERR: No room for command on command ring\n"); | 2390 | if (ret < 0) { |
2391 | xhci_err(xhci, "ERR: No room for command on command ring\n"); | ||
2389 | if (command_must_succeed) | 2392 | if (command_must_succeed) |
2390 | xhci_err(xhci, "ERR: Reserved TRB counting for " | 2393 | xhci_err(xhci, "ERR: Reserved TRB counting for " |
2391 | "unfailable commands failed.\n"); | 2394 | "unfailable commands failed.\n"); |
2392 | return -ENOMEM; | 2395 | return ret; |
2393 | } | 2396 | } |
2394 | queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3, | 2397 | queue_trb(xhci, xhci->cmd_ring, false, false, field1, field2, field3, |
2395 | field4 | xhci->cmd_ring->cycle_state); | 2398 | field4 | xhci->cmd_ring->cycle_state); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 27345cd04da0..3998f72cd0c4 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2134,6 +2134,8 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
2134 | /* If this is a Set Address to an unconfigured device, setup ep 0 */ | 2134 | /* If this is a Set Address to an unconfigured device, setup ep 0 */ |
2135 | if (!udev->config) | 2135 | if (!udev->config) |
2136 | xhci_setup_addressable_virt_dev(xhci, udev); | 2136 | xhci_setup_addressable_virt_dev(xhci, udev); |
2137 | else | ||
2138 | xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev); | ||
2137 | /* Otherwise, assume the core has the device configured how it wants */ | 2139 | /* Otherwise, assume the core has the device configured how it wants */ |
2138 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); | 2140 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); |
2139 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); | 2141 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 8b4b7d39f79c..6c7e3430ec93 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1292,6 +1292,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags); | |||
1292 | void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id); | 1292 | void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id); |
1293 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags); | 1293 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags); |
1294 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev); | 1294 | int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev); |
1295 | void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci, | ||
1296 | struct usb_device *udev); | ||
1295 | unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc); | 1297 | unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc); |
1296 | unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc); | 1298 | unsigned int xhci_get_endpoint_flag(struct usb_endpoint_descriptor *desc); |
1297 | unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index); | 1299 | unsigned int xhci_get_endpoint_flag_from_index(unsigned int ep_index); |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 30d930386b65..d25814c172b2 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -2436,7 +2436,8 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2436 | } | 2436 | } |
2437 | 2437 | ||
2438 | if (!sisusb->devinit) { | 2438 | if (!sisusb->devinit) { |
2439 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) { | 2439 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH || |
2440 | sisusb->sisusb_dev->speed == USB_SPEED_SUPER) { | ||
2440 | if (sisusb_init_gfxdevice(sisusb, 0)) { | 2441 | if (sisusb_init_gfxdevice(sisusb, 0)) { |
2441 | mutex_unlock(&sisusb->lock); | 2442 | mutex_unlock(&sisusb->lock); |
2442 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); | 2443 | dev_err(&sisusb->sisusb_dev->dev, "Failed to initialize device\n"); |
@@ -3166,7 +3167,7 @@ static int sisusb_probe(struct usb_interface *intf, | |||
3166 | 3167 | ||
3167 | sisusb->present = 1; | 3168 | sisusb->present = 1; |
3168 | 3169 | ||
3169 | if (dev->speed == USB_SPEED_HIGH) { | 3170 | if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) { |
3170 | int initscreen = 1; | 3171 | int initscreen = 1; |
3171 | #ifdef INCL_SISUSB_CON | 3172 | #ifdef INCL_SISUSB_CON |
3172 | if (sisusb_first_vc > 0 && | 3173 | if (sisusb_first_vc > 0 && |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 05c077f8f9ac..3c48e77a0aa2 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -29,19 +29,6 @@ static void tusb_source_power(struct musb *musb, int is_on); | |||
29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) | 29 | #define TUSB_REV_MAJOR(reg_val) ((reg_val >> 4) & 0xf) |
30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) | 30 | #define TUSB_REV_MINOR(reg_val) (reg_val & 0xf) |
31 | 31 | ||
32 | #ifdef CONFIG_PM | ||
33 | /* REVISIT: These should be only needed if somebody implements off idle */ | ||
34 | void musb_platform_save_context(struct musb *musb, | ||
35 | struct musb_context_registers *musb_context) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | void musb_platform_restore_context(struct musb *musb, | ||
40 | struct musb_context_registers *musb_context) | ||
41 | { | ||
42 | } | ||
43 | #endif | ||
44 | |||
45 | /* | 32 | /* |
46 | * Checks the revision. We need to use the DMA register as 3.0 does not | 33 | * Checks the revision. We need to use the DMA register as 3.0 does not |
47 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. | 34 | * have correct versions for TUSB_PRCM_REV or TUSB_INT_CTRL_REV. |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index da7e334b0407..e298dc4baed7 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -691,6 +691,7 @@ static struct usb_device_id id_table_combined [] = { | |||
691 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), | 691 | { USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID), |
692 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, | 692 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, |
693 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 693 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
694 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | ||
694 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 695 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
695 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 696 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
696 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 697 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
@@ -737,6 +738,14 @@ static struct usb_device_id id_table_combined [] = { | |||
737 | { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, | 738 | { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) }, |
738 | { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, | 739 | { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) }, |
739 | { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, | 740 | { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) }, |
741 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_ST_PID), | ||
742 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
743 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SLITE_PID), | ||
744 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
745 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH2_PID), | ||
746 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
747 | { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), | ||
748 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | ||
740 | { }, /* Optional parameter entry */ | 749 | { }, /* Optional parameter entry */ |
741 | { } /* Terminating entry */ | 750 | { } /* Terminating entry */ |
742 | }; | 751 | }; |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index bbc159a1df45..d01946db8fac 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
@@ -696,6 +696,12 @@ | |||
696 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ | 696 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ |
697 | 697 | ||
698 | /* | 698 | /* |
699 | * RT Systems programming cables for various ham radios | ||
700 | */ | ||
701 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | ||
702 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | ||
703 | |||
704 | /* | ||
699 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. | 705 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. |
700 | * http://winglucofacts.com/cables/ | 706 | * http://winglucofacts.com/cables/ |
701 | */ | 707 | */ |
@@ -1017,3 +1023,12 @@ | |||
1017 | #define MJSG_SR_RADIO_PID 0x9379 | 1023 | #define MJSG_SR_RADIO_PID 0x9379 |
1018 | #define MJSG_XM_RADIO_PID 0x937A | 1024 | #define MJSG_XM_RADIO_PID 0x937A |
1019 | #define MJSG_HD_RADIO_PID 0x937C | 1025 | #define MJSG_HD_RADIO_PID 0x937C |
1026 | |||
1027 | /* | ||
1028 | * Xverve Signalyzer tools (http://www.signalyzer.com/) | ||
1029 | */ | ||
1030 | #define XVERVE_SIGNALYZER_ST_PID 0xBCA0 | ||
1031 | #define XVERVE_SIGNALYZER_SLITE_PID 0xBCA1 | ||
1032 | #define XVERVE_SIGNALYZER_SH2_PID 0xBCA2 | ||
1033 | #define XVERVE_SIGNALYZER_SH4_PID 0xBCA4 | ||
1034 | |||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index e280ad8e12f7..5cd30e4345c6 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -206,6 +206,7 @@ static void option_instat_callback(struct urb *urb); | |||
206 | #define AMOI_PRODUCT_H01 0x0800 | 206 | #define AMOI_PRODUCT_H01 0x0800 |
207 | #define AMOI_PRODUCT_H01A 0x7002 | 207 | #define AMOI_PRODUCT_H01A 0x7002 |
208 | #define AMOI_PRODUCT_H02 0x0802 | 208 | #define AMOI_PRODUCT_H02 0x0802 |
209 | #define AMOI_PRODUCT_SKYPEPHONE_S2 0x0407 | ||
209 | 210 | ||
210 | #define DELL_VENDOR_ID 0x413C | 211 | #define DELL_VENDOR_ID 0x413C |
211 | 212 | ||
@@ -302,6 +303,7 @@ static void option_instat_callback(struct urb *urb); | |||
302 | #define QISDA_PRODUCT_H21_4512 0x4512 | 303 | #define QISDA_PRODUCT_H21_4512 0x4512 |
303 | #define QISDA_PRODUCT_H21_4523 0x4523 | 304 | #define QISDA_PRODUCT_H21_4523 0x4523 |
304 | #define QISDA_PRODUCT_H20_4515 0x4515 | 305 | #define QISDA_PRODUCT_H20_4515 0x4515 |
306 | #define QISDA_PRODUCT_H20_4518 0x4518 | ||
305 | #define QISDA_PRODUCT_H20_4519 0x4519 | 307 | #define QISDA_PRODUCT_H20_4519 0x4519 |
306 | 308 | ||
307 | /* TLAYTECH PRODUCTS */ | 309 | /* TLAYTECH PRODUCTS */ |
@@ -516,6 +518,7 @@ static const struct usb_device_id option_ids[] = { | |||
516 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 518 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
517 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 519 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
518 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, | 520 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, |
521 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_SKYPEPHONE_S2) }, | ||
519 | 522 | ||
520 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ | 523 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ |
521 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ | 524 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ |
@@ -852,6 +855,7 @@ static const struct usb_device_id option_ids[] = { | |||
852 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, | 855 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, |
853 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, | 856 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, |
854 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, | 857 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, |
858 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4518) }, | ||
855 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, | 859 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4519) }, |
856 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, | 860 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_G450) }, |
857 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ | 861 | { USB_DEVICE(TOSHIBA_VENDOR_ID, TOSHIBA_PRODUCT_HSDPA_MINICARD ) }, /* Toshiba 3G HSDPA == Novatel Expedite EU870D MiniCard */ |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 93d72eb8cafc..cde67cacb2c3 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -51,6 +51,8 @@ static const struct usb_device_id id_table[] = { | |||
51 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ | 51 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ |
52 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ | 52 | {USB_DEVICE(0x413c, 0x8185)}, /* Dell Gobi 2000 QDL device (N0218, VU936) */ |
53 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ | 53 | {USB_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */ |
54 | {USB_DEVICE(0x05c6, 0x9208)}, /* Generic Gobi 2000 QDL device */ | ||
55 | {USB_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */ | ||
54 | {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ | 56 | {USB_DEVICE(0x05c6, 0x9224)}, /* Sony Gobi 2000 QDL device (N0279, VU730) */ |
55 | {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ | 57 | {USB_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ |
56 | {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ | 58 | {USB_DEVICE(0x05c6, 0x9244)}, /* Samsung Gobi 2000 QDL device (VL176) */ |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ef0bdb08d788..d47b56e9e8ce 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -245,6 +245,7 @@ static const struct usb_device_id id_table[] = { | |||
245 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ | 245 | { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ |
246 | { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ | 246 | { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ |
247 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ | 247 | { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ |
248 | { USB_DEVICE(0x1199, 0x0301) }, /* Sierra Wireless USB Dongle 250U */ | ||
248 | /* Sierra Wireless C597 */ | 249 | /* Sierra Wireless C597 */ |
249 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, | 250 | { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, |
250 | /* Sierra Wireless T598 */ | 251 | /* Sierra Wireless T598 */ |
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index 44716427c51c..64ec073e89de 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c | |||
@@ -139,9 +139,7 @@ static int usb_stor_msg_common(struct us_data *us, int timeout) | |||
139 | 139 | ||
140 | /* fill the common fields in the URB */ | 140 | /* fill the common fields in the URB */ |
141 | us->current_urb->context = &urb_done; | 141 | us->current_urb->context = &urb_done; |
142 | us->current_urb->actual_length = 0; | 142 | us->current_urb->transfer_flags = 0; |
143 | us->current_urb->error_count = 0; | ||
144 | us->current_urb->status = 0; | ||
145 | 143 | ||
146 | /* we assume that if transfer_buffer isn't us->iobuf then it | 144 | /* we assume that if transfer_buffer isn't us->iobuf then it |
147 | * hasn't been mapped for DMA. Yes, this is clunky, but it's | 145 | * hasn't been mapped for DMA. Yes, this is clunky, but it's |
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 40f61320ce16..34b2fc472fe8 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -95,7 +95,7 @@ struct fb_bitfield rgb_bitfields[][4] = | |||
95 | { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, | 95 | { { 8, 4, 0 }, { 4, 4, 0 }, { 0, 4, 0 }, { 0, 0, 0 } }, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static struct fb_fix_screeninfo au1100fb_fix __initdata = { | 98 | static struct fb_fix_screeninfo au1100fb_fix __devinitdata = { |
99 | .id = "AU1100 FB", | 99 | .id = "AU1100 FB", |
100 | .xpanstep = 1, | 100 | .xpanstep = 1, |
101 | .ypanstep = 1, | 101 | .ypanstep = 1, |
@@ -103,7 +103,7 @@ static struct fb_fix_screeninfo au1100fb_fix __initdata = { | |||
103 | .accel = FB_ACCEL_NONE, | 103 | .accel = FB_ACCEL_NONE, |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static struct fb_var_screeninfo au1100fb_var __initdata = { | 106 | static struct fb_var_screeninfo au1100fb_var __devinitdata = { |
107 | .activate = FB_ACTIVATE_NOW, | 107 | .activate = FB_ACTIVATE_NOW, |
108 | .height = -1, | 108 | .height = -1, |
109 | .width = -1, | 109 | .width = -1, |
@@ -458,7 +458,7 @@ static struct fb_ops au1100fb_ops = | |||
458 | 458 | ||
459 | /* AU1100 LCD controller device driver */ | 459 | /* AU1100 LCD controller device driver */ |
460 | 460 | ||
461 | static int __init au1100fb_drv_probe(struct platform_device *dev) | 461 | static int __devinit au1100fb_drv_probe(struct platform_device *dev) |
462 | { | 462 | { |
463 | struct au1100fb_device *fbdev = NULL; | 463 | struct au1100fb_device *fbdev = NULL; |
464 | struct resource *regs_res; | 464 | struct resource *regs_res; |
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index 8e8f18d29d7a..5a35f22372b9 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig | |||
@@ -6,7 +6,7 @@ menu "Console display driver support" | |||
6 | 6 | ||
7 | config VGA_CONSOLE | 7 | config VGA_CONSOLE |
8 | bool "VGA text console" if EMBEDDED || !X86 | 8 | bool "VGA text console" if EMBEDDED || !X86 |
9 | depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !ARCH_VERSATILE && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 | 9 | depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) |
10 | default y | 10 | default y |
11 | help | 11 | help |
12 | Saying Y here will allow you to use Linux in text mode through a | 12 | Saying Y here will allow you to use Linux in text mode through a |
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 3a561df2e8a2..0c1afd13ddd3 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c | |||
@@ -388,6 +388,7 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | |||
388 | pseudo_val |= convert_bitfield(red, &var->red); | 388 | pseudo_val |= convert_bitfield(red, &var->red); |
389 | pseudo_val |= convert_bitfield(green, &var->green); | 389 | pseudo_val |= convert_bitfield(green, &var->green); |
390 | pseudo_val |= convert_bitfield(blue, &var->blue); | 390 | pseudo_val |= convert_bitfield(blue, &var->blue); |
391 | ret = 0; | ||
391 | break; | 392 | break; |
392 | } | 393 | } |
393 | 394 | ||
@@ -436,6 +437,8 @@ static void cyber2000fb_write_ramdac_ctrl(struct cfb_info *cfb) | |||
436 | cyber2000fb_writeb(i | 4, 0x3cf, cfb); | 437 | cyber2000fb_writeb(i | 4, 0x3cf, cfb); |
437 | cyber2000fb_writeb(val, 0x3c6, cfb); | 438 | cyber2000fb_writeb(val, 0x3c6, cfb); |
438 | cyber2000fb_writeb(i, 0x3cf, cfb); | 439 | cyber2000fb_writeb(i, 0x3cf, cfb); |
440 | /* prevent card lock-up observed on x86 with CyberPro 2000 */ | ||
441 | cyber2000fb_readb(0x3cf, cfb); | ||
439 | } | 442 | } |
440 | 443 | ||
441 | static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) | 444 | static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) |
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c index 7d8c55d7fd28..ca3355e430bf 100644 --- a/drivers/video/gbefb.c +++ b/drivers/video/gbefb.c | |||
@@ -91,10 +91,10 @@ static uint32_t pseudo_palette[16]; | |||
91 | static uint32_t gbe_cmap[256]; | 91 | static uint32_t gbe_cmap[256]; |
92 | static int gbe_turned_on; /* 0 turned off, 1 turned on */ | 92 | static int gbe_turned_on; /* 0 turned off, 1 turned on */ |
93 | 93 | ||
94 | static char *mode_option __initdata = NULL; | 94 | static char *mode_option __devinitdata = NULL; |
95 | 95 | ||
96 | /* default CRT mode */ | 96 | /* default CRT mode */ |
97 | static struct fb_var_screeninfo default_var_CRT __initdata = { | 97 | static struct fb_var_screeninfo default_var_CRT __devinitdata = { |
98 | /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ | 98 | /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */ |
99 | .xres = 640, | 99 | .xres = 640, |
100 | .yres = 480, | 100 | .yres = 480, |
@@ -125,7 +125,7 @@ static struct fb_var_screeninfo default_var_CRT __initdata = { | |||
125 | }; | 125 | }; |
126 | 126 | ||
127 | /* default LCD mode */ | 127 | /* default LCD mode */ |
128 | static struct fb_var_screeninfo default_var_LCD __initdata = { | 128 | static struct fb_var_screeninfo default_var_LCD __devinitdata = { |
129 | /* 1600x1024, 8 bpp */ | 129 | /* 1600x1024, 8 bpp */ |
130 | .xres = 1600, | 130 | .xres = 1600, |
131 | .yres = 1024, | 131 | .yres = 1024, |
@@ -157,7 +157,7 @@ static struct fb_var_screeninfo default_var_LCD __initdata = { | |||
157 | 157 | ||
158 | /* default modedb mode */ | 158 | /* default modedb mode */ |
159 | /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ | 159 | /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ |
160 | static struct fb_videomode default_mode_CRT __initdata = { | 160 | static struct fb_videomode default_mode_CRT __devinitdata = { |
161 | .refresh = 60, | 161 | .refresh = 60, |
162 | .xres = 640, | 162 | .xres = 640, |
163 | .yres = 480, | 163 | .yres = 480, |
@@ -172,7 +172,7 @@ static struct fb_videomode default_mode_CRT __initdata = { | |||
172 | .vmode = FB_VMODE_NONINTERLACED, | 172 | .vmode = FB_VMODE_NONINTERLACED, |
173 | }; | 173 | }; |
174 | /* 1600x1024 SGI flatpanel 1600sw */ | 174 | /* 1600x1024 SGI flatpanel 1600sw */ |
175 | static struct fb_videomode default_mode_LCD __initdata = { | 175 | static struct fb_videomode default_mode_LCD __devinitdata = { |
176 | /* 1600x1024, 8 bpp */ | 176 | /* 1600x1024, 8 bpp */ |
177 | .xres = 1600, | 177 | .xres = 1600, |
178 | .yres = 1024, | 178 | .yres = 1024, |
@@ -186,8 +186,8 @@ static struct fb_videomode default_mode_LCD __initdata = { | |||
186 | .vmode = FB_VMODE_NONINTERLACED, | 186 | .vmode = FB_VMODE_NONINTERLACED, |
187 | }; | 187 | }; |
188 | 188 | ||
189 | static struct fb_videomode *default_mode __initdata = &default_mode_CRT; | 189 | static struct fb_videomode *default_mode __devinitdata = &default_mode_CRT; |
190 | static struct fb_var_screeninfo *default_var __initdata = &default_var_CRT; | 190 | static struct fb_var_screeninfo *default_var __devinitdata = &default_var_CRT; |
191 | 191 | ||
192 | static int flat_panel_enabled = 0; | 192 | static int flat_panel_enabled = 0; |
193 | 193 | ||
@@ -1098,7 +1098,7 @@ static void gbefb_create_sysfs(struct device *dev) | |||
1098 | * Initialization | 1098 | * Initialization |
1099 | */ | 1099 | */ |
1100 | 1100 | ||
1101 | static int __init gbefb_setup(char *options) | 1101 | static int __devinit gbefb_setup(char *options) |
1102 | { | 1102 | { |
1103 | char *this_opt; | 1103 | char *this_opt; |
1104 | 1104 | ||
diff --git a/drivers/video/omap/lcd_apollon.c b/drivers/video/omap/lcd_apollon.c index 2be94eb3bbf5..10459d8bd9a0 100644 --- a/drivers/video/omap/lcd_apollon.c +++ b/drivers/video/omap/lcd_apollon.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | 26 | ||
27 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
28 | #include <plat/mux.h> | ||
29 | 28 | ||
30 | #include "omapfb.h" | 29 | #include "omapfb.h" |
31 | 30 | ||
@@ -34,8 +33,6 @@ | |||
34 | static int apollon_panel_init(struct lcd_panel *panel, | 33 | static int apollon_panel_init(struct lcd_panel *panel, |
35 | struct omapfb_device *fbdev) | 34 | struct omapfb_device *fbdev) |
36 | { | 35 | { |
37 | /* configure LCD PWR_EN */ | ||
38 | omap_cfg_reg(M21_242X_GPIO11); | ||
39 | return 0; | 36 | return 0; |
40 | } | 37 | } |
41 | 38 | ||
diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c index 0f361b6100d2..0c69fa20251b 100644 --- a/drivers/video/pmag-ba-fb.c +++ b/drivers/video/pmag-ba-fb.c | |||
@@ -44,7 +44,7 @@ struct pmagbafb_par { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | 46 | ||
47 | static struct fb_var_screeninfo pmagbafb_defined __initdata = { | 47 | static struct fb_var_screeninfo pmagbafb_defined __devinitdata = { |
48 | .xres = 1024, | 48 | .xres = 1024, |
49 | .yres = 864, | 49 | .yres = 864, |
50 | .xres_virtual = 1024, | 50 | .xres_virtual = 1024, |
@@ -68,7 +68,7 @@ static struct fb_var_screeninfo pmagbafb_defined __initdata = { | |||
68 | .vmode = FB_VMODE_NONINTERLACED, | 68 | .vmode = FB_VMODE_NONINTERLACED, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static struct fb_fix_screeninfo pmagbafb_fix __initdata = { | 71 | static struct fb_fix_screeninfo pmagbafb_fix __devinitdata = { |
72 | .id = "PMAG-BA", | 72 | .id = "PMAG-BA", |
73 | .smem_len = (1024 * 1024), | 73 | .smem_len = (1024 * 1024), |
74 | .type = FB_TYPE_PACKED_PIXELS, | 74 | .type = FB_TYPE_PACKED_PIXELS, |
@@ -142,7 +142,7 @@ static void __init pmagbafb_erase_cursor(struct fb_info *info) | |||
142 | } | 142 | } |
143 | 143 | ||
144 | 144 | ||
145 | static int __init pmagbafb_probe(struct device *dev) | 145 | static int __devinit pmagbafb_probe(struct device *dev) |
146 | { | 146 | { |
147 | struct tc_dev *tdev = to_tc_dev(dev); | 147 | struct tc_dev *tdev = to_tc_dev(dev); |
148 | resource_size_t start, len; | 148 | resource_size_t start, len; |
diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c index 2de0806421b4..22fcb9a3d5c0 100644 --- a/drivers/video/pmagb-b-fb.c +++ b/drivers/video/pmagb-b-fb.c | |||
@@ -45,7 +45,7 @@ struct pmagbbfb_par { | |||
45 | }; | 45 | }; |
46 | 46 | ||
47 | 47 | ||
48 | static struct fb_var_screeninfo pmagbbfb_defined __initdata = { | 48 | static struct fb_var_screeninfo pmagbbfb_defined __devinitdata = { |
49 | .bits_per_pixel = 8, | 49 | .bits_per_pixel = 8, |
50 | .red.length = 8, | 50 | .red.length = 8, |
51 | .green.length = 8, | 51 | .green.length = 8, |
@@ -58,7 +58,7 @@ static struct fb_var_screeninfo pmagbbfb_defined __initdata = { | |||
58 | .vmode = FB_VMODE_NONINTERLACED, | 58 | .vmode = FB_VMODE_NONINTERLACED, |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static struct fb_fix_screeninfo pmagbbfb_fix __initdata = { | 61 | static struct fb_fix_screeninfo pmagbbfb_fix __devinitdata = { |
62 | .id = "PMAGB-BA", | 62 | .id = "PMAGB-BA", |
63 | .smem_len = (2048 * 1024), | 63 | .smem_len = (2048 * 1024), |
64 | .type = FB_TYPE_PACKED_PIXELS, | 64 | .type = FB_TYPE_PACKED_PIXELS, |
@@ -148,7 +148,7 @@ static void __init pmagbbfb_erase_cursor(struct fb_info *info) | |||
148 | /* | 148 | /* |
149 | * Set up screen parameters. | 149 | * Set up screen parameters. |
150 | */ | 150 | */ |
151 | static void __init pmagbbfb_screen_setup(struct fb_info *info) | 151 | static void __devinit pmagbbfb_screen_setup(struct fb_info *info) |
152 | { | 152 | { |
153 | struct pmagbbfb_par *par = info->par; | 153 | struct pmagbbfb_par *par = info->par; |
154 | 154 | ||
@@ -180,9 +180,9 @@ static void __init pmagbbfb_screen_setup(struct fb_info *info) | |||
180 | /* | 180 | /* |
181 | * Determine oscillator configuration. | 181 | * Determine oscillator configuration. |
182 | */ | 182 | */ |
183 | static void __init pmagbbfb_osc_setup(struct fb_info *info) | 183 | static void __devinit pmagbbfb_osc_setup(struct fb_info *info) |
184 | { | 184 | { |
185 | static unsigned int pmagbbfb_freqs[] __initdata = { | 185 | static unsigned int pmagbbfb_freqs[] __devinitdata = { |
186 | 130808, 119843, 104000, 92980, 74370, 72800, | 186 | 130808, 119843, 104000, 92980, 74370, 72800, |
187 | 69197, 66000, 65000, 50350, 36000, 32000, 25175 | 187 | 69197, 66000, 65000, 50350, 36000, 32000, 25175 |
188 | }; | 188 | }; |
@@ -247,7 +247,7 @@ static void __init pmagbbfb_osc_setup(struct fb_info *info) | |||
247 | }; | 247 | }; |
248 | 248 | ||
249 | 249 | ||
250 | static int __init pmagbbfb_probe(struct device *dev) | 250 | static int __devinit pmagbbfb_probe(struct device *dev) |
251 | { | 251 | { |
252 | struct tc_dev *tdev = to_tc_dev(dev); | 252 | struct tc_dev *tdev = to_tc_dev(dev); |
253 | resource_size_t start, len; | 253 | resource_size_t start, len; |
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index afe7e21dd0ae..1475ed6b575f 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c | |||
@@ -164,7 +164,8 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq, | |||
164 | gfp_t gfp) | 164 | gfp_t gfp) |
165 | { | 165 | { |
166 | struct vring_virtqueue *vq = to_vvq(_vq); | 166 | struct vring_virtqueue *vq = to_vvq(_vq); |
167 | unsigned int i, avail, head, uninitialized_var(prev); | 167 | unsigned int i, avail, uninitialized_var(prev); |
168 | int head; | ||
168 | 169 | ||
169 | START_USE(vq); | 170 | START_USE(vq); |
170 | 171 | ||
@@ -174,7 +175,7 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq, | |||
174 | * buffers, then go indirect. FIXME: tune this threshold */ | 175 | * buffers, then go indirect. FIXME: tune this threshold */ |
175 | if (vq->indirect && (out + in) > 1 && vq->num_free) { | 176 | if (vq->indirect && (out + in) > 1 && vq->num_free) { |
176 | head = vring_add_indirect(vq, sg, out, in, gfp); | 177 | head = vring_add_indirect(vq, sg, out, in, gfp); |
177 | if (head != vq->vring.num) | 178 | if (likely(head >= 0)) |
178 | goto add_head; | 179 | goto add_head; |
179 | } | 180 | } |
180 | 181 | ||
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index d61e3b28ce37..36d961f342af 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c | |||
@@ -146,7 +146,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
146 | while (rdir->head < rdir->tail) { | 146 | while (rdir->head < rdir->tail) { |
147 | p9stat_init(&st); | 147 | p9stat_init(&st); |
148 | err = p9stat_read(rdir->buf + rdir->head, | 148 | err = p9stat_read(rdir->buf + rdir->head, |
149 | buflen - rdir->head, &st, | 149 | rdir->tail - rdir->head, &st, |
150 | fid->clnt->proto_version); | 150 | fid->clnt->proto_version); |
151 | if (err) { | 151 | if (err) { |
152 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); | 152 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); |
diff --git a/fs/ceph/Kconfig b/fs/ceph/Kconfig index 04b8280582a9..bc87b9c1d27e 100644 --- a/fs/ceph/Kconfig +++ b/fs/ceph/Kconfig | |||
@@ -2,7 +2,7 @@ config CEPH_FS | |||
2 | tristate "Ceph distributed file system (EXPERIMENTAL)" | 2 | tristate "Ceph distributed file system (EXPERIMENTAL)" |
3 | depends on INET && EXPERIMENTAL | 3 | depends on INET && EXPERIMENTAL |
4 | select LIBCRC32C | 4 | select LIBCRC32C |
5 | select CONFIG_CRYPTO_AES | 5 | select CRYPTO_AES |
6 | help | 6 | help |
7 | Choose Y or M here to include support for mounting the | 7 | Choose Y or M here to include support for mounting the |
8 | experimental Ceph distributed file system. Ceph is an extremely | 8 | experimental Ceph distributed file system. Ceph is an extremely |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 74144d6389f0..b81be9a56487 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -627,7 +627,7 @@ retry: | |||
627 | if (fmode >= 0) | 627 | if (fmode >= 0) |
628 | __ceph_get_fmode(ci, fmode); | 628 | __ceph_get_fmode(ci, fmode); |
629 | spin_unlock(&inode->i_lock); | 629 | spin_unlock(&inode->i_lock); |
630 | wake_up(&ci->i_cap_wq); | 630 | wake_up_all(&ci->i_cap_wq); |
631 | return 0; | 631 | return 0; |
632 | } | 632 | } |
633 | 633 | ||
@@ -1181,7 +1181,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | if (wake) | 1183 | if (wake) |
1184 | wake_up(&ci->i_cap_wq); | 1184 | wake_up_all(&ci->i_cap_wq); |
1185 | 1185 | ||
1186 | return delayed; | 1186 | return delayed; |
1187 | } | 1187 | } |
@@ -2153,7 +2153,7 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had) | |||
2153 | else if (flushsnaps) | 2153 | else if (flushsnaps) |
2154 | ceph_flush_snaps(ci); | 2154 | ceph_flush_snaps(ci); |
2155 | if (wake) | 2155 | if (wake) |
2156 | wake_up(&ci->i_cap_wq); | 2156 | wake_up_all(&ci->i_cap_wq); |
2157 | if (put) | 2157 | if (put) |
2158 | iput(inode); | 2158 | iput(inode); |
2159 | } | 2159 | } |
@@ -2229,7 +2229,7 @@ void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, | |||
2229 | iput(inode); | 2229 | iput(inode); |
2230 | } else if (complete_capsnap) { | 2230 | } else if (complete_capsnap) { |
2231 | ceph_flush_snaps(ci); | 2231 | ceph_flush_snaps(ci); |
2232 | wake_up(&ci->i_cap_wq); | 2232 | wake_up_all(&ci->i_cap_wq); |
2233 | } | 2233 | } |
2234 | if (drop_capsnap) | 2234 | if (drop_capsnap) |
2235 | iput(inode); | 2235 | iput(inode); |
@@ -2405,7 +2405,7 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, | |||
2405 | if (queue_invalidate) | 2405 | if (queue_invalidate) |
2406 | ceph_queue_invalidate(inode); | 2406 | ceph_queue_invalidate(inode); |
2407 | if (wake) | 2407 | if (wake) |
2408 | wake_up(&ci->i_cap_wq); | 2408 | wake_up_all(&ci->i_cap_wq); |
2409 | 2409 | ||
2410 | if (check_caps == 1) | 2410 | if (check_caps == 1) |
2411 | ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY, | 2411 | ceph_check_caps(ci, CHECK_CAPS_NODELAY|CHECK_CAPS_AUTHONLY, |
@@ -2460,7 +2460,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid, | |||
2460 | struct ceph_inode_info, | 2460 | struct ceph_inode_info, |
2461 | i_flushing_item)->vfs_inode); | 2461 | i_flushing_item)->vfs_inode); |
2462 | mdsc->num_cap_flushing--; | 2462 | mdsc->num_cap_flushing--; |
2463 | wake_up(&mdsc->cap_flushing_wq); | 2463 | wake_up_all(&mdsc->cap_flushing_wq); |
2464 | dout(" inode %p now !flushing\n", inode); | 2464 | dout(" inode %p now !flushing\n", inode); |
2465 | 2465 | ||
2466 | if (ci->i_dirty_caps == 0) { | 2466 | if (ci->i_dirty_caps == 0) { |
@@ -2472,7 +2472,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid, | |||
2472 | } | 2472 | } |
2473 | } | 2473 | } |
2474 | spin_unlock(&mdsc->cap_dirty_lock); | 2474 | spin_unlock(&mdsc->cap_dirty_lock); |
2475 | wake_up(&ci->i_cap_wq); | 2475 | wake_up_all(&ci->i_cap_wq); |
2476 | 2476 | ||
2477 | out: | 2477 | out: |
2478 | spin_unlock(&inode->i_lock); | 2478 | spin_unlock(&inode->i_lock); |
@@ -2984,6 +2984,7 @@ int ceph_encode_dentry_release(void **p, struct dentry *dentry, | |||
2984 | memcpy(*p, dentry->d_name.name, dentry->d_name.len); | 2984 | memcpy(*p, dentry->d_name.name, dentry->d_name.len); |
2985 | *p += dentry->d_name.len; | 2985 | *p += dentry->d_name.len; |
2986 | rel->dname_seq = cpu_to_le32(di->lease_seq); | 2986 | rel->dname_seq = cpu_to_le32(di->lease_seq); |
2987 | __ceph_mdsc_drop_dentry_lease(dentry); | ||
2987 | } | 2988 | } |
2988 | spin_unlock(&dentry->d_lock); | 2989 | spin_unlock(&dentry->d_lock); |
2989 | return ret; | 2990 | return ret; |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index f85719310db2..f94ed3c7f6a5 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -266,6 +266,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
266 | spin_lock(&inode->i_lock); | 266 | spin_lock(&inode->i_lock); |
267 | if ((filp->f_pos == 2 || fi->dentry) && | 267 | if ((filp->f_pos == 2 || fi->dentry) && |
268 | !ceph_test_opt(client, NOASYNCREADDIR) && | 268 | !ceph_test_opt(client, NOASYNCREADDIR) && |
269 | ceph_snap(inode) != CEPH_SNAPDIR && | ||
269 | (ci->i_ceph_flags & CEPH_I_COMPLETE) && | 270 | (ci->i_ceph_flags & CEPH_I_COMPLETE) && |
270 | __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) { | 271 | __ceph_caps_issued_mask(ci, CEPH_CAP_FILE_SHARED, 1)) { |
271 | err = __dcache_readdir(filp, dirent, filldir); | 272 | err = __dcache_readdir(filp, dirent, filldir); |
@@ -1013,18 +1014,22 @@ out_touch: | |||
1013 | 1014 | ||
1014 | /* | 1015 | /* |
1015 | * When a dentry is released, clear the dir I_COMPLETE if it was part | 1016 | * When a dentry is released, clear the dir I_COMPLETE if it was part |
1016 | * of the current dir gen. | 1017 | * of the current dir gen or if this is in the snapshot namespace. |
1017 | */ | 1018 | */ |
1018 | static void ceph_dentry_release(struct dentry *dentry) | 1019 | static void ceph_dentry_release(struct dentry *dentry) |
1019 | { | 1020 | { |
1020 | struct ceph_dentry_info *di = ceph_dentry(dentry); | 1021 | struct ceph_dentry_info *di = ceph_dentry(dentry); |
1021 | struct inode *parent_inode = dentry->d_parent->d_inode; | 1022 | struct inode *parent_inode = dentry->d_parent->d_inode; |
1023 | u64 snapid = ceph_snap(parent_inode); | ||
1022 | 1024 | ||
1023 | if (parent_inode) { | 1025 | dout("dentry_release %p parent %p\n", dentry, parent_inode); |
1026 | |||
1027 | if (parent_inode && snapid != CEPH_SNAPDIR) { | ||
1024 | struct ceph_inode_info *ci = ceph_inode(parent_inode); | 1028 | struct ceph_inode_info *ci = ceph_inode(parent_inode); |
1025 | 1029 | ||
1026 | spin_lock(&parent_inode->i_lock); | 1030 | spin_lock(&parent_inode->i_lock); |
1027 | if (ci->i_shared_gen == di->lease_shared_gen) { | 1031 | if (ci->i_shared_gen == di->lease_shared_gen || |
1032 | snapid <= CEPH_MAXSNAP) { | ||
1028 | dout(" clearing %p complete (d_release)\n", | 1033 | dout(" clearing %p complete (d_release)\n", |
1029 | parent_inode); | 1034 | parent_inode); |
1030 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; | 1035 | ci->i_ceph_flags &= ~CEPH_I_COMPLETE; |
@@ -1241,7 +1246,9 @@ struct dentry_operations ceph_dentry_ops = { | |||
1241 | 1246 | ||
1242 | struct dentry_operations ceph_snapdir_dentry_ops = { | 1247 | struct dentry_operations ceph_snapdir_dentry_ops = { |
1243 | .d_revalidate = ceph_snapdir_d_revalidate, | 1248 | .d_revalidate = ceph_snapdir_d_revalidate, |
1249 | .d_release = ceph_dentry_release, | ||
1244 | }; | 1250 | }; |
1245 | 1251 | ||
1246 | struct dentry_operations ceph_snap_dentry_ops = { | 1252 | struct dentry_operations ceph_snap_dentry_ops = { |
1253 | .d_release = ceph_dentry_release, | ||
1247 | }; | 1254 | }; |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6251a1574b94..7c08698fad3e 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -265,7 +265,7 @@ int ceph_release(struct inode *inode, struct file *file) | |||
265 | kmem_cache_free(ceph_file_cachep, cf); | 265 | kmem_cache_free(ceph_file_cachep, cf); |
266 | 266 | ||
267 | /* wake up anyone waiting for caps on this inode */ | 267 | /* wake up anyone waiting for caps on this inode */ |
268 | wake_up(&ci->i_cap_wq); | 268 | wake_up_all(&ci->i_cap_wq); |
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 8f9b9fe8ef9f..389f9dbd9949 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1199,8 +1199,10 @@ retry_lookup: | |||
1199 | goto out; | 1199 | goto out; |
1200 | } | 1200 | } |
1201 | err = ceph_init_dentry(dn); | 1201 | err = ceph_init_dentry(dn); |
1202 | if (err < 0) | 1202 | if (err < 0) { |
1203 | dput(dn); | ||
1203 | goto out; | 1204 | goto out; |
1205 | } | ||
1204 | } else if (dn->d_inode && | 1206 | } else if (dn->d_inode && |
1205 | (ceph_ino(dn->d_inode) != vino.ino || | 1207 | (ceph_ino(dn->d_inode) != vino.ino || |
1206 | ceph_snap(dn->d_inode) != vino.snap)) { | 1208 | ceph_snap(dn->d_inode) != vino.snap)) { |
@@ -1499,7 +1501,7 @@ retry: | |||
1499 | if (wrbuffer_refs == 0) | 1501 | if (wrbuffer_refs == 0) |
1500 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); | 1502 | ceph_check_caps(ci, CHECK_CAPS_AUTHONLY, NULL); |
1501 | if (wake) | 1503 | if (wake) |
1502 | wake_up(&ci->i_cap_wq); | 1504 | wake_up_all(&ci->i_cap_wq); |
1503 | } | 1505 | } |
1504 | 1506 | ||
1505 | 1507 | ||
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 416c08d315db..dd440bd438a9 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -868,7 +868,7 @@ static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap, | |||
868 | { | 868 | { |
869 | struct ceph_inode_info *ci = ceph_inode(inode); | 869 | struct ceph_inode_info *ci = ceph_inode(inode); |
870 | 870 | ||
871 | wake_up(&ci->i_cap_wq); | 871 | wake_up_all(&ci->i_cap_wq); |
872 | if (arg) { | 872 | if (arg) { |
873 | spin_lock(&inode->i_lock); | 873 | spin_lock(&inode->i_lock); |
874 | ci->i_wanted_max_size = 0; | 874 | ci->i_wanted_max_size = 0; |
@@ -1564,7 +1564,7 @@ static void complete_request(struct ceph_mds_client *mdsc, | |||
1564 | if (req->r_callback) | 1564 | if (req->r_callback) |
1565 | req->r_callback(mdsc, req); | 1565 | req->r_callback(mdsc, req); |
1566 | else | 1566 | else |
1567 | complete(&req->r_completion); | 1567 | complete_all(&req->r_completion); |
1568 | } | 1568 | } |
1569 | 1569 | ||
1570 | /* | 1570 | /* |
@@ -1932,7 +1932,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
1932 | if (head->safe) { | 1932 | if (head->safe) { |
1933 | req->r_got_safe = true; | 1933 | req->r_got_safe = true; |
1934 | __unregister_request(mdsc, req); | 1934 | __unregister_request(mdsc, req); |
1935 | complete(&req->r_safe_completion); | 1935 | complete_all(&req->r_safe_completion); |
1936 | 1936 | ||
1937 | if (req->r_got_unsafe) { | 1937 | if (req->r_got_unsafe) { |
1938 | /* | 1938 | /* |
@@ -1947,7 +1947,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
1947 | 1947 | ||
1948 | /* last unsafe request during umount? */ | 1948 | /* last unsafe request during umount? */ |
1949 | if (mdsc->stopping && !__get_oldest_req(mdsc)) | 1949 | if (mdsc->stopping && !__get_oldest_req(mdsc)) |
1950 | complete(&mdsc->safe_umount_waiters); | 1950 | complete_all(&mdsc->safe_umount_waiters); |
1951 | mutex_unlock(&mdsc->mutex); | 1951 | mutex_unlock(&mdsc->mutex); |
1952 | goto out; | 1952 | goto out; |
1953 | } | 1953 | } |
@@ -2126,7 +2126,7 @@ static void handle_session(struct ceph_mds_session *session, | |||
2126 | pr_info("mds%d reconnect denied\n", session->s_mds); | 2126 | pr_info("mds%d reconnect denied\n", session->s_mds); |
2127 | remove_session_caps(session); | 2127 | remove_session_caps(session); |
2128 | wake = 1; /* for good measure */ | 2128 | wake = 1; /* for good measure */ |
2129 | complete(&mdsc->session_close_waiters); | 2129 | complete_all(&mdsc->session_close_waiters); |
2130 | kick_requests(mdsc, mds); | 2130 | kick_requests(mdsc, mds); |
2131 | break; | 2131 | break; |
2132 | 2132 | ||
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c index cc115eafae11..54fe01c50706 100644 --- a/fs/ceph/mon_client.c +++ b/fs/ceph/mon_client.c | |||
@@ -345,7 +345,7 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc, | |||
345 | 345 | ||
346 | out: | 346 | out: |
347 | mutex_unlock(&monc->mutex); | 347 | mutex_unlock(&monc->mutex); |
348 | wake_up(&client->auth_wq); | 348 | wake_up_all(&client->auth_wq); |
349 | } | 349 | } |
350 | 350 | ||
351 | /* | 351 | /* |
@@ -462,7 +462,7 @@ static void handle_statfs_reply(struct ceph_mon_client *monc, | |||
462 | } | 462 | } |
463 | mutex_unlock(&monc->mutex); | 463 | mutex_unlock(&monc->mutex); |
464 | if (req) { | 464 | if (req) { |
465 | complete(&req->completion); | 465 | complete_all(&req->completion); |
466 | put_generic_request(req); | 466 | put_generic_request(req); |
467 | } | 467 | } |
468 | return; | 468 | return; |
@@ -718,7 +718,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc, | |||
718 | monc->m_auth->front_max); | 718 | monc->m_auth->front_max); |
719 | if (ret < 0) { | 719 | if (ret < 0) { |
720 | monc->client->auth_err = ret; | 720 | monc->client->auth_err = ret; |
721 | wake_up(&monc->client->auth_wq); | 721 | wake_up_all(&monc->client->auth_wq); |
722 | } else if (ret > 0) { | 722 | } else if (ret > 0) { |
723 | __send_prepared_auth_request(monc, ret); | 723 | __send_prepared_auth_request(monc, ret); |
724 | } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) { | 724 | } else if (!was_auth && monc->auth->ops->is_authenticated(monc->auth)) { |
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c index 92b7251a53f1..e38522347898 100644 --- a/fs/ceph/osd_client.c +++ b/fs/ceph/osd_client.c | |||
@@ -862,12 +862,12 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg, | |||
862 | if (req->r_callback) | 862 | if (req->r_callback) |
863 | req->r_callback(req, msg); | 863 | req->r_callback(req, msg); |
864 | else | 864 | else |
865 | complete(&req->r_completion); | 865 | complete_all(&req->r_completion); |
866 | 866 | ||
867 | if (flags & CEPH_OSD_FLAG_ONDISK) { | 867 | if (flags & CEPH_OSD_FLAG_ONDISK) { |
868 | if (req->r_safe_callback) | 868 | if (req->r_safe_callback) |
869 | req->r_safe_callback(req, msg); | 869 | req->r_safe_callback(req, msg); |
870 | complete(&req->r_safe_completion); /* fsync waiter */ | 870 | complete_all(&req->r_safe_completion); /* fsync waiter */ |
871 | } | 871 | } |
872 | 872 | ||
873 | done: | 873 | done: |
@@ -1083,7 +1083,7 @@ done: | |||
1083 | if (newmap) | 1083 | if (newmap) |
1084 | kick_requests(osdc, NULL); | 1084 | kick_requests(osdc, NULL); |
1085 | up_read(&osdc->map_sem); | 1085 | up_read(&osdc->map_sem); |
1086 | wake_up(&osdc->client->auth_wq); | 1086 | wake_up_all(&osdc->client->auth_wq); |
1087 | return; | 1087 | return; |
1088 | 1088 | ||
1089 | bad: | 1089 | bad: |
diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c index 277f8b339577..416d46adbf87 100644 --- a/fs/ceph/osdmap.c +++ b/fs/ceph/osdmap.c | |||
@@ -831,12 +831,13 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, | |||
831 | /* remove any? */ | 831 | /* remove any? */ |
832 | while (rbp && pgid_cmp(rb_entry(rbp, struct ceph_pg_mapping, | 832 | while (rbp && pgid_cmp(rb_entry(rbp, struct ceph_pg_mapping, |
833 | node)->pgid, pgid) <= 0) { | 833 | node)->pgid, pgid) <= 0) { |
834 | struct rb_node *cur = rbp; | 834 | struct ceph_pg_mapping *cur = |
835 | rb_entry(rbp, struct ceph_pg_mapping, node); | ||
836 | |||
835 | rbp = rb_next(rbp); | 837 | rbp = rb_next(rbp); |
836 | dout(" removed pg_temp %llx\n", | 838 | dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid); |
837 | *(u64 *)&rb_entry(cur, struct ceph_pg_mapping, | 839 | rb_erase(&cur->node, &map->pg_temp); |
838 | node)->pgid); | 840 | kfree(cur); |
839 | rb_erase(cur, &map->pg_temp); | ||
840 | } | 841 | } |
841 | 842 | ||
842 | if (pglen) { | 843 | if (pglen) { |
@@ -852,19 +853,22 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, | |||
852 | for (j = 0; j < pglen; j++) | 853 | for (j = 0; j < pglen; j++) |
853 | pg->osds[j] = ceph_decode_32(p); | 854 | pg->osds[j] = ceph_decode_32(p); |
854 | err = __insert_pg_mapping(pg, &map->pg_temp); | 855 | err = __insert_pg_mapping(pg, &map->pg_temp); |
855 | if (err) | 856 | if (err) { |
857 | kfree(pg); | ||
856 | goto bad; | 858 | goto bad; |
859 | } | ||
857 | dout(" added pg_temp %llx len %d\n", *(u64 *)&pgid, | 860 | dout(" added pg_temp %llx len %d\n", *(u64 *)&pgid, |
858 | pglen); | 861 | pglen); |
859 | } | 862 | } |
860 | } | 863 | } |
861 | while (rbp) { | 864 | while (rbp) { |
862 | struct rb_node *cur = rbp; | 865 | struct ceph_pg_mapping *cur = |
866 | rb_entry(rbp, struct ceph_pg_mapping, node); | ||
867 | |||
863 | rbp = rb_next(rbp); | 868 | rbp = rb_next(rbp); |
864 | dout(" removed pg_temp %llx\n", | 869 | dout(" removed pg_temp %llx\n", *(u64 *)&cur->pgid); |
865 | *(u64 *)&rb_entry(cur, struct ceph_pg_mapping, | 870 | rb_erase(&cur->node, &map->pg_temp); |
866 | node)->pgid); | 871 | kfree(cur); |
867 | rb_erase(cur, &map->pg_temp); | ||
868 | } | 872 | } |
869 | 873 | ||
870 | /* ignore the rest */ | 874 | /* ignore the rest */ |
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c index 49315cbf742d..853a968e82d7 100644 --- a/fs/cifs/dns_resolve.c +++ b/fs/cifs/dns_resolve.c | |||
@@ -227,7 +227,7 @@ failed_put_cred: | |||
227 | return ret; | 227 | return ret; |
228 | } | 228 | } |
229 | 229 | ||
230 | void __exit cifs_exit_dns_resolver(void) | 230 | void cifs_exit_dns_resolver(void) |
231 | { | 231 | { |
232 | key_revoke(dns_resolver_cache->thread_keyring); | 232 | key_revoke(dns_resolver_cache->thread_keyring); |
233 | unregister_key_type(&key_type_dns_resolver); | 233 | unregister_key_type(&key_type_dns_resolver); |
diff --git a/fs/cifs/dns_resolve.h b/fs/cifs/dns_resolve.h index 26b9eaa9f5ee..5d7f291df162 100644 --- a/fs/cifs/dns_resolve.h +++ b/fs/cifs/dns_resolve.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #ifdef __KERNEL__ | 26 | #ifdef __KERNEL__ |
27 | extern int __init cifs_init_dns_resolver(void); | 27 | extern int __init cifs_init_dns_resolver(void); |
28 | extern void __exit cifs_exit_dns_resolver(void); | 28 | extern void cifs_exit_dns_resolver(void); |
29 | extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr); | 29 | extern int dns_resolve_server_name_to_ip(const char *unc, char **ip_addr); |
30 | #endif /* KERNEL */ | 30 | #endif /* KERNEL */ |
31 | 31 | ||
diff --git a/fs/ecryptfs/messaging.c b/fs/ecryptfs/messaging.c index 2d8dbce9d485..46c4dd8dfcc3 100644 --- a/fs/ecryptfs/messaging.c +++ b/fs/ecryptfs/messaging.c | |||
@@ -31,9 +31,9 @@ static struct mutex ecryptfs_msg_ctx_lists_mux; | |||
31 | 31 | ||
32 | static struct hlist_head *ecryptfs_daemon_hash; | 32 | static struct hlist_head *ecryptfs_daemon_hash; |
33 | struct mutex ecryptfs_daemon_hash_mux; | 33 | struct mutex ecryptfs_daemon_hash_mux; |
34 | static int ecryptfs_hash_buckets; | 34 | static int ecryptfs_hash_bits; |
35 | #define ecryptfs_uid_hash(uid) \ | 35 | #define ecryptfs_uid_hash(uid) \ |
36 | hash_long((unsigned long)uid, ecryptfs_hash_buckets) | 36 | hash_long((unsigned long)uid, ecryptfs_hash_bits) |
37 | 37 | ||
38 | static u32 ecryptfs_msg_counter; | 38 | static u32 ecryptfs_msg_counter; |
39 | static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr; | 39 | static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr; |
@@ -486,18 +486,19 @@ int ecryptfs_init_messaging(void) | |||
486 | } | 486 | } |
487 | mutex_init(&ecryptfs_daemon_hash_mux); | 487 | mutex_init(&ecryptfs_daemon_hash_mux); |
488 | mutex_lock(&ecryptfs_daemon_hash_mux); | 488 | mutex_lock(&ecryptfs_daemon_hash_mux); |
489 | ecryptfs_hash_buckets = 1; | 489 | ecryptfs_hash_bits = 1; |
490 | while (ecryptfs_number_of_users >> ecryptfs_hash_buckets) | 490 | while (ecryptfs_number_of_users >> ecryptfs_hash_bits) |
491 | ecryptfs_hash_buckets++; | 491 | ecryptfs_hash_bits++; |
492 | ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head) | 492 | ecryptfs_daemon_hash = kmalloc((sizeof(struct hlist_head) |
493 | * ecryptfs_hash_buckets), GFP_KERNEL); | 493 | * (1 << ecryptfs_hash_bits)), |
494 | GFP_KERNEL); | ||
494 | if (!ecryptfs_daemon_hash) { | 495 | if (!ecryptfs_daemon_hash) { |
495 | rc = -ENOMEM; | 496 | rc = -ENOMEM; |
496 | printk(KERN_ERR "%s: Failed to allocate memory\n", __func__); | 497 | printk(KERN_ERR "%s: Failed to allocate memory\n", __func__); |
497 | mutex_unlock(&ecryptfs_daemon_hash_mux); | 498 | mutex_unlock(&ecryptfs_daemon_hash_mux); |
498 | goto out; | 499 | goto out; |
499 | } | 500 | } |
500 | for (i = 0; i < ecryptfs_hash_buckets; i++) | 501 | for (i = 0; i < (1 << ecryptfs_hash_bits); i++) |
501 | INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]); | 502 | INIT_HLIST_HEAD(&ecryptfs_daemon_hash[i]); |
502 | mutex_unlock(&ecryptfs_daemon_hash_mux); | 503 | mutex_unlock(&ecryptfs_daemon_hash_mux); |
503 | ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx) | 504 | ecryptfs_msg_ctx_arr = kmalloc((sizeof(struct ecryptfs_msg_ctx) |
@@ -554,7 +555,7 @@ void ecryptfs_release_messaging(void) | |||
554 | int i; | 555 | int i; |
555 | 556 | ||
556 | mutex_lock(&ecryptfs_daemon_hash_mux); | 557 | mutex_lock(&ecryptfs_daemon_hash_mux); |
557 | for (i = 0; i < ecryptfs_hash_buckets; i++) { | 558 | for (i = 0; i < (1 << ecryptfs_hash_bits); i++) { |
558 | int rc; | 559 | int rc; |
559 | 560 | ||
560 | hlist_for_each_entry(daemon, elem, | 561 | hlist_for_each_entry(daemon, elem, |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 26ca3361a8bc..6b48d7c268b2 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -1231,6 +1231,25 @@ static int do_filldir_main(struct gfs2_inode *dip, u64 *offset, | |||
1231 | return 0; | 1231 | return 0; |
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | static void *gfs2_alloc_sort_buffer(unsigned size) | ||
1235 | { | ||
1236 | void *ptr = NULL; | ||
1237 | |||
1238 | if (size < KMALLOC_MAX_SIZE) | ||
1239 | ptr = kmalloc(size, GFP_NOFS | __GFP_NOWARN); | ||
1240 | if (!ptr) | ||
1241 | ptr = __vmalloc(size, GFP_NOFS, PAGE_KERNEL); | ||
1242 | return ptr; | ||
1243 | } | ||
1244 | |||
1245 | static void gfs2_free_sort_buffer(void *ptr) | ||
1246 | { | ||
1247 | if (is_vmalloc_addr(ptr)) | ||
1248 | vfree(ptr); | ||
1249 | else | ||
1250 | kfree(ptr); | ||
1251 | } | ||
1252 | |||
1234 | static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | 1253 | static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, |
1235 | filldir_t filldir, int *copied, unsigned *depth, | 1254 | filldir_t filldir, int *copied, unsigned *depth, |
1236 | u64 leaf_no) | 1255 | u64 leaf_no) |
@@ -1271,7 +1290,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1271 | * 99 is the maximum number of entries that can fit in a single | 1290 | * 99 is the maximum number of entries that can fit in a single |
1272 | * leaf block. | 1291 | * leaf block. |
1273 | */ | 1292 | */ |
1274 | larr = vmalloc((leaves + entries + 99) * sizeof(void *)); | 1293 | larr = gfs2_alloc_sort_buffer((leaves + entries + 99) * sizeof(void *)); |
1275 | if (!larr) | 1294 | if (!larr) |
1276 | goto out; | 1295 | goto out; |
1277 | darr = (const struct gfs2_dirent **)(larr + leaves); | 1296 | darr = (const struct gfs2_dirent **)(larr + leaves); |
@@ -1282,7 +1301,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1282 | do { | 1301 | do { |
1283 | error = get_leaf(ip, lfn, &bh); | 1302 | error = get_leaf(ip, lfn, &bh); |
1284 | if (error) | 1303 | if (error) |
1285 | goto out_kfree; | 1304 | goto out_free; |
1286 | lf = (struct gfs2_leaf *)bh->b_data; | 1305 | lf = (struct gfs2_leaf *)bh->b_data; |
1287 | lfn = be64_to_cpu(lf->lf_next); | 1306 | lfn = be64_to_cpu(lf->lf_next); |
1288 | if (lf->lf_entries) { | 1307 | if (lf->lf_entries) { |
@@ -1291,7 +1310,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1291 | gfs2_dirent_gather, NULL, &g); | 1310 | gfs2_dirent_gather, NULL, &g); |
1292 | error = PTR_ERR(dent); | 1311 | error = PTR_ERR(dent); |
1293 | if (IS_ERR(dent)) | 1312 | if (IS_ERR(dent)) |
1294 | goto out_kfree; | 1313 | goto out_free; |
1295 | if (entries2 != g.offset) { | 1314 | if (entries2 != g.offset) { |
1296 | fs_warn(sdp, "Number of entries corrupt in dir " | 1315 | fs_warn(sdp, "Number of entries corrupt in dir " |
1297 | "leaf %llu, entries2 (%u) != " | 1316 | "leaf %llu, entries2 (%u) != " |
@@ -1300,7 +1319,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1300 | entries2, g.offset); | 1319 | entries2, g.offset); |
1301 | 1320 | ||
1302 | error = -EIO; | 1321 | error = -EIO; |
1303 | goto out_kfree; | 1322 | goto out_free; |
1304 | } | 1323 | } |
1305 | error = 0; | 1324 | error = 0; |
1306 | larr[leaf++] = bh; | 1325 | larr[leaf++] = bh; |
@@ -1312,10 +1331,10 @@ static int gfs2_dir_read_leaf(struct inode *inode, u64 *offset, void *opaque, | |||
1312 | BUG_ON(entries2 != entries); | 1331 | BUG_ON(entries2 != entries); |
1313 | error = do_filldir_main(ip, offset, opaque, filldir, darr, | 1332 | error = do_filldir_main(ip, offset, opaque, filldir, darr, |
1314 | entries, copied); | 1333 | entries, copied); |
1315 | out_kfree: | 1334 | out_free: |
1316 | for(i = 0; i < leaf; i++) | 1335 | for(i = 0; i < leaf; i++) |
1317 | brelse(larr[i]); | 1336 | brelse(larr[i]); |
1318 | vfree(larr); | 1337 | gfs2_free_sort_buffer(larr); |
1319 | out: | 1338 | out: |
1320 | return error; | 1339 | return error; |
1321 | } | 1340 | } |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 36a5e74f51b4..f036153d9f50 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/pagemap.h> | 27 | #include <linux/pagemap.h> |
28 | #include <linux/aio.h> | 28 | #include <linux/aio.h> |
29 | #include <linux/gfp.h> | 29 | #include <linux/gfp.h> |
30 | #include <linux/swap.h> | ||
30 | 31 | ||
31 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
32 | #include <asm/system.h> | 33 | #include <asm/system.h> |
@@ -493,11 +494,19 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset) | |||
493 | */ | 494 | */ |
494 | static int nfs_release_page(struct page *page, gfp_t gfp) | 495 | static int nfs_release_page(struct page *page, gfp_t gfp) |
495 | { | 496 | { |
497 | struct address_space *mapping = page->mapping; | ||
498 | |||
496 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); | 499 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); |
497 | 500 | ||
498 | /* Only do I/O if gfp is a superset of GFP_KERNEL */ | 501 | /* Only do I/O if gfp is a superset of GFP_KERNEL */ |
499 | if ((gfp & GFP_KERNEL) == GFP_KERNEL) | 502 | if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) { |
500 | nfs_wb_page(page->mapping->host, page); | 503 | int how = FLUSH_SYNC; |
504 | |||
505 | /* Don't let kswapd deadlock waiting for OOM RPC calls */ | ||
506 | if (current_is_kswapd()) | ||
507 | how = 0; | ||
508 | nfs_commit_inode(mapping->host, how); | ||
509 | } | ||
501 | /* If PagePrivate() is set, then the page is not freeable */ | 510 | /* If PagePrivate() is set, then the page is not freeable */ |
502 | if (PagePrivate(page)) | 511 | if (PagePrivate(page)) |
503 | return 0; | 512 | return 0; |
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c index 6bd19d843af7..df101d9f546a 100644 --- a/fs/nfs/nfsroot.c +++ b/fs/nfs/nfsroot.c | |||
@@ -105,7 +105,7 @@ static char nfs_root_name[256] __initdata = ""; | |||
105 | static __be32 servaddr __initdata = 0; | 105 | static __be32 servaddr __initdata = 0; |
106 | 106 | ||
107 | /* Name of directory to mount */ | 107 | /* Name of directory to mount */ |
108 | static char nfs_export_path[NFS_MAXPATHLEN] __initdata = { 0, }; | 108 | static char nfs_export_path[NFS_MAXPATHLEN + 1] __initdata = { 0, }; |
109 | 109 | ||
110 | /* NFS-related data */ | 110 | /* NFS-related data */ |
111 | static struct nfs_mount_data nfs_data __initdata = { 0, };/* NFS mount info */ | 111 | static struct nfs_mount_data nfs_data __initdata = { 0, };/* NFS mount info */ |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 91679e2631ee..9f81bdd91c55 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -222,7 +222,7 @@ static void nfs_end_page_writeback(struct page *page) | |||
222 | clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC); | 222 | clear_bdi_congested(&nfss->backing_dev_info, BLK_RW_ASYNC); |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct nfs_page *nfs_find_and_lock_request(struct page *page) | 225 | static struct nfs_page *nfs_find_and_lock_request(struct page *page, bool nonblock) |
226 | { | 226 | { |
227 | struct inode *inode = page->mapping->host; | 227 | struct inode *inode = page->mapping->host; |
228 | struct nfs_page *req; | 228 | struct nfs_page *req; |
@@ -241,7 +241,10 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page) | |||
241 | * request as dirty (in which case we don't care). | 241 | * request as dirty (in which case we don't care). |
242 | */ | 242 | */ |
243 | spin_unlock(&inode->i_lock); | 243 | spin_unlock(&inode->i_lock); |
244 | ret = nfs_wait_on_request(req); | 244 | if (!nonblock) |
245 | ret = nfs_wait_on_request(req); | ||
246 | else | ||
247 | ret = -EAGAIN; | ||
245 | nfs_release_request(req); | 248 | nfs_release_request(req); |
246 | if (ret != 0) | 249 | if (ret != 0) |
247 | return ERR_PTR(ret); | 250 | return ERR_PTR(ret); |
@@ -256,12 +259,12 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page) | |||
256 | * May return an error if the user signalled nfs_wait_on_request(). | 259 | * May return an error if the user signalled nfs_wait_on_request(). |
257 | */ | 260 | */ |
258 | static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, | 261 | static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, |
259 | struct page *page) | 262 | struct page *page, bool nonblock) |
260 | { | 263 | { |
261 | struct nfs_page *req; | 264 | struct nfs_page *req; |
262 | int ret = 0; | 265 | int ret = 0; |
263 | 266 | ||
264 | req = nfs_find_and_lock_request(page); | 267 | req = nfs_find_and_lock_request(page, nonblock); |
265 | if (!req) | 268 | if (!req) |
266 | goto out; | 269 | goto out; |
267 | ret = PTR_ERR(req); | 270 | ret = PTR_ERR(req); |
@@ -283,12 +286,20 @@ out: | |||
283 | static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio) | 286 | static int nfs_do_writepage(struct page *page, struct writeback_control *wbc, struct nfs_pageio_descriptor *pgio) |
284 | { | 287 | { |
285 | struct inode *inode = page->mapping->host; | 288 | struct inode *inode = page->mapping->host; |
289 | int ret; | ||
286 | 290 | ||
287 | nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE); | 291 | nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGE); |
288 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); | 292 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, 1); |
289 | 293 | ||
290 | nfs_pageio_cond_complete(pgio, page->index); | 294 | nfs_pageio_cond_complete(pgio, page->index); |
291 | return nfs_page_async_flush(pgio, page); | 295 | ret = nfs_page_async_flush(pgio, page, |
296 | wbc->sync_mode == WB_SYNC_NONE || | ||
297 | wbc->nonblocking != 0); | ||
298 | if (ret == -EAGAIN) { | ||
299 | redirty_page_for_writepage(wbc, page); | ||
300 | ret = 0; | ||
301 | } | ||
302 | return ret; | ||
292 | } | 303 | } |
293 | 304 | ||
294 | /* | 305 | /* |
@@ -1379,7 +1390,7 @@ static const struct rpc_call_ops nfs_commit_ops = { | |||
1379 | .rpc_release = nfs_commit_release, | 1390 | .rpc_release = nfs_commit_release, |
1380 | }; | 1391 | }; |
1381 | 1392 | ||
1382 | static int nfs_commit_inode(struct inode *inode, int how) | 1393 | int nfs_commit_inode(struct inode *inode, int how) |
1383 | { | 1394 | { |
1384 | LIST_HEAD(head); | 1395 | LIST_HEAD(head); |
1385 | int may_wait = how & FLUSH_SYNC; | 1396 | int may_wait = how & FLUSH_SYNC; |
@@ -1443,11 +1454,6 @@ out_mark_dirty: | |||
1443 | return ret; | 1454 | return ret; |
1444 | } | 1455 | } |
1445 | #else | 1456 | #else |
1446 | static int nfs_commit_inode(struct inode *inode, int how) | ||
1447 | { | ||
1448 | return 0; | ||
1449 | } | ||
1450 | |||
1451 | static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc) | 1457 | static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc) |
1452 | { | 1458 | { |
1453 | return 0; | 1459 | return 0; |
@@ -1546,7 +1552,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage, | |||
1546 | 1552 | ||
1547 | nfs_fscache_release_page(page, GFP_KERNEL); | 1553 | nfs_fscache_release_page(page, GFP_KERNEL); |
1548 | 1554 | ||
1549 | req = nfs_find_and_lock_request(page); | 1555 | req = nfs_find_and_lock_request(page, false); |
1550 | ret = PTR_ERR(req); | 1556 | ret = PTR_ERR(req); |
1551 | if (IS_ERR(req)) | 1557 | if (IS_ERR(req)) |
1552 | goto out; | 1558 | goto out; |
diff --git a/fs/proc/array.c b/fs/proc/array.c index 9b58d38bc911..fff6572676ae 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -176,7 +176,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns, | |||
176 | if (tracer) | 176 | if (tracer) |
177 | tpid = task_pid_nr_ns(tracer, ns); | 177 | tpid = task_pid_nr_ns(tracer, ns); |
178 | } | 178 | } |
179 | cred = get_cred((struct cred *) __task_cred(p)); | 179 | cred = get_task_cred(p); |
180 | seq_printf(m, | 180 | seq_printf(m, |
181 | "State:\t%s\n" | 181 | "State:\t%s\n" |
182 | "Tgid:\t%d\n" | 182 | "Tgid:\t%d\n" |
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index f71246bebfe4..a7ac78f8e67a 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -28,6 +28,7 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, | |||
28 | struct sysfs_dirent *target_sd = NULL; | 28 | struct sysfs_dirent *target_sd = NULL; |
29 | struct sysfs_dirent *sd = NULL; | 29 | struct sysfs_dirent *sd = NULL; |
30 | struct sysfs_addrm_cxt acxt; | 30 | struct sysfs_addrm_cxt acxt; |
31 | enum kobj_ns_type ns_type; | ||
31 | int error; | 32 | int error; |
32 | 33 | ||
33 | BUG_ON(!name); | 34 | BUG_ON(!name); |
@@ -58,16 +59,29 @@ static int sysfs_do_create_link(struct kobject *kobj, struct kobject *target, | |||
58 | if (!sd) | 59 | if (!sd) |
59 | goto out_put; | 60 | goto out_put; |
60 | 61 | ||
61 | if (sysfs_ns_type(parent_sd)) | 62 | ns_type = sysfs_ns_type(parent_sd); |
63 | if (ns_type) | ||
62 | sd->s_ns = target->ktype->namespace(target); | 64 | sd->s_ns = target->ktype->namespace(target); |
63 | sd->s_symlink.target_sd = target_sd; | 65 | sd->s_symlink.target_sd = target_sd; |
64 | target_sd = NULL; /* reference is now owned by the symlink */ | 66 | target_sd = NULL; /* reference is now owned by the symlink */ |
65 | 67 | ||
66 | sysfs_addrm_start(&acxt, parent_sd); | 68 | sysfs_addrm_start(&acxt, parent_sd); |
67 | if (warn) | 69 | /* Symlinks must be between directories with the same ns_type */ |
68 | error = sysfs_add_one(&acxt, sd); | 70 | if (!ns_type || |
69 | else | 71 | (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent))) { |
70 | error = __sysfs_add_one(&acxt, sd); | 72 | if (warn) |
73 | error = sysfs_add_one(&acxt, sd); | ||
74 | else | ||
75 | error = __sysfs_add_one(&acxt, sd); | ||
76 | } else { | ||
77 | error = -EINVAL; | ||
78 | WARN(1, KERN_WARNING | ||
79 | "sysfs: symlink across ns_types %s/%s -> %s/%s\n", | ||
80 | parent_sd->s_name, | ||
81 | sd->s_name, | ||
82 | sd->s_symlink.target_sd->s_parent->s_name, | ||
83 | sd->s_symlink.target_sd->s_name); | ||
84 | } | ||
71 | sysfs_addrm_finish(&acxt); | 85 | sysfs_addrm_finish(&acxt); |
72 | 86 | ||
73 | if (error) | 87 | if (error) |
@@ -122,7 +136,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ, | |||
122 | { | 136 | { |
123 | const void *ns = NULL; | 137 | const void *ns = NULL; |
124 | spin_lock(&sysfs_assoc_lock); | 138 | spin_lock(&sysfs_assoc_lock); |
125 | if (targ->sd) | 139 | if (targ->sd && sysfs_ns_type(kobj->sd)) |
126 | ns = targ->sd->s_ns; | 140 | ns = targ->sd->s_ns; |
127 | spin_unlock(&sysfs_assoc_lock); | 141 | spin_unlock(&sysfs_assoc_lock); |
128 | sysfs_hash_and_remove(kobj->sd, ns, name); | 142 | sysfs_hash_and_remove(kobj->sd, ns, name); |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index da565a48240e..a68ca8a11a53 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -48,7 +48,7 @@ struct acpi_power_register { | |||
48 | u8 space_id; | 48 | u8 space_id; |
49 | u8 bit_width; | 49 | u8 bit_width; |
50 | u8 bit_offset; | 50 | u8 bit_offset; |
51 | u8 reserved; | 51 | u8 access_size; |
52 | u64 address; | 52 | u64 address; |
53 | } __attribute__ ((packed)); | 53 | } __attribute__ ((packed)); |
54 | 54 | ||
@@ -63,6 +63,7 @@ struct acpi_processor_cx { | |||
63 | u32 power; | 63 | u32 power; |
64 | u32 usage; | 64 | u32 usage; |
65 | u64 time; | 65 | u64 time; |
66 | u8 bm_sts_skip; | ||
66 | char desc[ACPI_CX_DESC_LEN]; | 67 | char desc[ACPI_CX_DESC_LEN]; |
67 | }; | 68 | }; |
68 | 69 | ||
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 48c5299cbf26..030a954ed292 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -63,6 +63,12 @@ | |||
63 | /* Align . to a 8 byte boundary equals to maximum function alignment. */ | 63 | /* Align . to a 8 byte boundary equals to maximum function alignment. */ |
64 | #define ALIGN_FUNCTION() . = ALIGN(8) | 64 | #define ALIGN_FUNCTION() . = ALIGN(8) |
65 | 65 | ||
66 | /* | ||
67 | * Align to a 32 byte boundary equal to the | ||
68 | * alignment gcc 4.5 uses for a struct | ||
69 | */ | ||
70 | #define STRUCT_ALIGN() . = ALIGN(32) | ||
71 | |||
66 | /* The actual configuration determine if the init/exit sections | 72 | /* The actual configuration determine if the init/exit sections |
67 | * are handled as text/data or they can be discarded (which | 73 | * are handled as text/data or they can be discarded (which |
68 | * often happens at runtime) | 74 | * often happens at runtime) |
@@ -166,7 +172,11 @@ | |||
166 | LIKELY_PROFILE() \ | 172 | LIKELY_PROFILE() \ |
167 | BRANCH_PROFILE() \ | 173 | BRANCH_PROFILE() \ |
168 | TRACE_PRINTKS() \ | 174 | TRACE_PRINTKS() \ |
175 | \ | ||
176 | STRUCT_ALIGN(); \ | ||
169 | FTRACE_EVENTS() \ | 177 | FTRACE_EVENTS() \ |
178 | \ | ||
179 | STRUCT_ALIGN(); \ | ||
170 | TRACE_SYSCALLS() | 180 | TRACE_SYSCALLS() |
171 | 181 | ||
172 | /* | 182 | /* |
@@ -435,7 +445,7 @@ | |||
435 | */ | 445 | */ |
436 | #define INIT_TASK_DATA_SECTION(align) \ | 446 | #define INIT_TASK_DATA_SECTION(align) \ |
437 | . = ALIGN(align); \ | 447 | . = ALIGN(align); \ |
438 | .data..init_task : { \ | 448 | .data..init_task : AT(ADDR(.data..init_task) - LOAD_OFFSET) { \ |
439 | INIT_TASK_DATA(align) \ | 449 | INIT_TASK_DATA(align) \ |
440 | } | 450 | } |
441 | 451 | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 224a38c960d4..ccf94dc5acdf 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -253,7 +253,7 @@ int acpi_resources_are_enforced(void); | |||
253 | #ifdef CONFIG_PM_SLEEP | 253 | #ifdef CONFIG_PM_SLEEP |
254 | void __init acpi_no_s4_hw_signature(void); | 254 | void __init acpi_no_s4_hw_signature(void); |
255 | void __init acpi_old_suspend_ordering(void); | 255 | void __init acpi_old_suspend_ordering(void); |
256 | void __init acpi_s4_no_nvs(void); | 256 | void __init acpi_nvs_nosave(void); |
257 | #endif /* CONFIG_PM_SLEEP */ | 257 | #endif /* CONFIG_PM_SLEEP */ |
258 | 258 | ||
259 | struct acpi_osc_context { | 259 | struct acpi_osc_context { |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 75c0fa881308..4d2c39573f36 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -153,6 +153,7 @@ struct cred { | |||
153 | extern void __put_cred(struct cred *); | 153 | extern void __put_cred(struct cred *); |
154 | extern void exit_creds(struct task_struct *); | 154 | extern void exit_creds(struct task_struct *); |
155 | extern int copy_creds(struct task_struct *, unsigned long); | 155 | extern int copy_creds(struct task_struct *, unsigned long); |
156 | extern const struct cred *get_task_cred(struct task_struct *); | ||
156 | extern struct cred *cred_alloc_blank(void); | 157 | extern struct cred *cred_alloc_blank(void); |
157 | extern struct cred *prepare_creds(void); | 158 | extern struct cred *prepare_creds(void); |
158 | extern struct cred *prepare_exec_creds(void); | 159 | extern struct cred *prepare_exec_creds(void); |
@@ -273,33 +274,18 @@ static inline void put_cred(const struct cred *_cred) | |||
273 | * @task: The task to query | 274 | * @task: The task to query |
274 | * | 275 | * |
275 | * Access the objective credentials of a task. The caller must hold the RCU | 276 | * Access the objective credentials of a task. The caller must hold the RCU |
276 | * readlock. | 277 | * readlock or the task must be dead and unable to change its own credentials. |
277 | * | 278 | * |
278 | * The caller must make sure task doesn't go away, either by holding a ref on | 279 | * The result of this function should not be passed directly to get_cred(); |
279 | * task or by holding tasklist_lock to prevent it from being unlinked. | 280 | * rather get_task_cred() should be used instead. |
280 | */ | 281 | */ |
281 | #define __task_cred(task) \ | 282 | #define __task_cred(task) \ |
282 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held()))) | 283 | ({ \ |
283 | 284 | const struct task_struct *__t = (task); \ | |
284 | /** | 285 | rcu_dereference_check(__t->real_cred, \ |
285 | * get_task_cred - Get another task's objective credentials | 286 | rcu_read_lock_held() || \ |
286 | * @task: The task to query | 287 | task_is_dead(__t)); \ |
287 | * | 288 | }) |
288 | * Get the objective credentials of a task, pinning them so that they can't go | ||
289 | * away. Accessing a task's credentials directly is not permitted. | ||
290 | * | ||
291 | * The caller must make sure task doesn't go away, either by holding a ref on | ||
292 | * task or by holding tasklist_lock to prevent it from being unlinked. | ||
293 | */ | ||
294 | #define get_task_cred(task) \ | ||
295 | ({ \ | ||
296 | struct cred *__cred; \ | ||
297 | rcu_read_lock(); \ | ||
298 | __cred = (struct cred *) __task_cred((task)); \ | ||
299 | get_cred(__cred); \ | ||
300 | rcu_read_unlock(); \ | ||
301 | __cred; \ | ||
302 | }) | ||
303 | 289 | ||
304 | /** | 290 | /** |
305 | * get_current_cred - Get the current task's subjective credentials | 291 | * get_current_cred - Get the current task's subjective credentials |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 9ea047aca795..1ffaeffeff74 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -67,6 +67,8 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | extern void macvlan_common_setup(struct net_device *dev); | ||
71 | |||
70 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | 72 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, |
71 | struct nlattr *tb[], struct nlattr *data[], | 73 | struct nlattr *tb[], struct nlattr *data[], |
72 | int (*receive)(struct sk_buff *skb), | 74 | int (*receive)(struct sk_buff *skb), |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 77c2ae53431c..bad4d121b16e 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -493,8 +493,15 @@ extern int nfs_wb_all(struct inode *inode); | |||
493 | extern int nfs_wb_page(struct inode *inode, struct page* page); | 493 | extern int nfs_wb_page(struct inode *inode, struct page* page); |
494 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); | 494 | extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); |
495 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 495 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
496 | extern int nfs_commit_inode(struct inode *, int); | ||
496 | extern struct nfs_write_data *nfs_commitdata_alloc(void); | 497 | extern struct nfs_write_data *nfs_commitdata_alloc(void); |
497 | extern void nfs_commit_free(struct nfs_write_data *wdata); | 498 | extern void nfs_commit_free(struct nfs_write_data *wdata); |
499 | #else | ||
500 | static inline int | ||
501 | nfs_commit_inode(struct inode *inode, int how) | ||
502 | { | ||
503 | return 0; | ||
504 | } | ||
498 | #endif | 505 | #endif |
499 | 506 | ||
500 | static inline int | 507 | static inline int |
diff --git a/include/linux/regulator/tps6507x.h b/include/linux/regulator/tps6507x.h new file mode 100644 index 000000000000..4892f591bab1 --- /dev/null +++ b/include/linux/regulator/tps6507x.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * tps6507x.h -- Voltage regulation for the Texas Instruments TPS6507X | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef REGULATOR_TPS6507X | ||
21 | #define REGULATOR_TPS6507X | ||
22 | |||
23 | /** | ||
24 | * tps6507x_reg_platform_data - platform data for tps6507x | ||
25 | * @defdcdc_default: Defines whether DCDC high or the low register controls | ||
26 | * output voltage by default. Valid for DCDC2 and DCDC3 outputs only. | ||
27 | */ | ||
28 | struct tps6507x_reg_platform_data { | ||
29 | bool defdcdc_default; | ||
30 | }; | ||
31 | |||
32 | #endif | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 747fcaedddb7..0478888c6899 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -214,6 +214,7 @@ extern char ___assert_task_state[1 - 2*!!( | |||
214 | 214 | ||
215 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) | 215 | #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) |
216 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) | 216 | #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) |
217 | #define task_is_dead(task) ((task)->exit_state != 0) | ||
217 | #define task_is_stopped_or_traced(task) \ | 218 | #define task_is_stopped_or_traced(task) \ |
218 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 219 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
219 | #define task_contributes_to_load(task) \ | 220 | #define task_contributes_to_load(task) \ |
diff --git a/include/net/tc_act/tc_mirred.h b/include/net/tc_act/tc_mirred.h index ceac661cdfd5..cfe2943690ff 100644 --- a/include/net/tc_act/tc_mirred.h +++ b/include/net/tc_act/tc_mirred.h | |||
@@ -9,6 +9,7 @@ struct tcf_mirred { | |||
9 | int tcfm_ifindex; | 9 | int tcfm_ifindex; |
10 | int tcfm_ok_push; | 10 | int tcfm_ok_push; |
11 | struct net_device *tcfm_dev; | 11 | struct net_device *tcfm_dev; |
12 | struct list_head tcfm_list; | ||
12 | }; | 13 | }; |
13 | #define to_mirred(pc) \ | 14 | #define to_mirred(pc) \ |
14 | container_of(pc, struct tcf_mirred, common) | 15 | container_of(pc, struct tcf_mirred, common) |
diff --git a/kernel/cred.c b/kernel/cred.c index a2d5504fbcc2..60bc8b1e32e6 100644 --- a/kernel/cred.c +++ b/kernel/cred.c | |||
@@ -209,6 +209,31 @@ void exit_creds(struct task_struct *tsk) | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | /** | ||
213 | * get_task_cred - Get another task's objective credentials | ||
214 | * @task: The task to query | ||
215 | * | ||
216 | * Get the objective credentials of a task, pinning them so that they can't go | ||
217 | * away. Accessing a task's credentials directly is not permitted. | ||
218 | * | ||
219 | * The caller must also make sure task doesn't get deleted, either by holding a | ||
220 | * ref on task or by holding tasklist_lock to prevent it from being unlinked. | ||
221 | */ | ||
222 | const struct cred *get_task_cred(struct task_struct *task) | ||
223 | { | ||
224 | const struct cred *cred; | ||
225 | |||
226 | rcu_read_lock(); | ||
227 | |||
228 | do { | ||
229 | cred = __task_cred((task)); | ||
230 | BUG_ON(!cred); | ||
231 | } while (!atomic_inc_not_zero(&((struct cred *)cred)->usage)); | ||
232 | |||
233 | rcu_read_unlock(); | ||
234 | return cred; | ||
235 | } | ||
236 | |||
212 | /* | 237 | /* |
213 | * Allocate blank credentials, such that the credentials can be filled in at a | 238 | * Allocate blank credentials, such that the credentials can be filled in at a |
214 | * later date without risk of ENOMEM. | 239 | * later date without risk of ENOMEM. |
diff --git a/kernel/module.c b/kernel/module.c index 5d2d28197c82..6c562828c85c 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -787,7 +787,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, | |||
787 | 787 | ||
788 | /* Store the name of the last unloaded module for diagnostic purposes */ | 788 | /* Store the name of the last unloaded module for diagnostic purposes */ |
789 | strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); | 789 | strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module)); |
790 | ddebug_remove_module(mod->name); | ||
791 | 790 | ||
792 | free_module(mod); | 791 | free_module(mod); |
793 | return 0; | 792 | return 0; |
@@ -1550,6 +1549,9 @@ static void free_module(struct module *mod) | |||
1550 | remove_sect_attrs(mod); | 1549 | remove_sect_attrs(mod); |
1551 | mod_kobject_remove(mod); | 1550 | mod_kobject_remove(mod); |
1552 | 1551 | ||
1552 | /* Remove dynamic debug info */ | ||
1553 | ddebug_remove_module(mod->name); | ||
1554 | |||
1553 | /* Arch-specific cleanup. */ | 1555 | /* Arch-specific cleanup. */ |
1554 | module_arch_cleanup(mod); | 1556 | module_arch_cleanup(mod); |
1555 | 1557 | ||
diff --git a/mm/memory.c b/mm/memory.c index 119b7ccdf39b..bde42c6d3633 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1394,10 +1394,20 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1394 | return i ? : -EFAULT; | 1394 | return i ? : -EFAULT; |
1395 | } | 1395 | } |
1396 | if (pages) { | 1396 | if (pages) { |
1397 | struct page *page = vm_normal_page(gate_vma, start, *pte); | 1397 | struct page *page; |
1398 | |||
1399 | page = vm_normal_page(gate_vma, start, *pte); | ||
1400 | if (!page) { | ||
1401 | if (!(gup_flags & FOLL_DUMP) && | ||
1402 | is_zero_pfn(pte_pfn(*pte))) | ||
1403 | page = pte_page(*pte); | ||
1404 | else { | ||
1405 | pte_unmap(pte); | ||
1406 | return i ? : -EFAULT; | ||
1407 | } | ||
1408 | } | ||
1398 | pages[i] = page; | 1409 | pages[i] = page; |
1399 | if (page) | 1410 | get_page(page); |
1400 | get_page(page); | ||
1401 | } | 1411 | } |
1402 | pte_unmap(pte); | 1412 | pte_unmap(pte); |
1403 | if (vmas) | 1413 | if (vmas) |
diff --git a/net/core/dev.c b/net/core/dev.c index 0ea10f849be8..1f466e82ac33 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1488,6 +1488,7 @@ static inline void net_timestamp_check(struct sk_buff *skb) | |||
1488 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | 1488 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) |
1489 | { | 1489 | { |
1490 | skb_orphan(skb); | 1490 | skb_orphan(skb); |
1491 | nf_reset(skb); | ||
1491 | 1492 | ||
1492 | if (!(dev->flags & IFF_UP) || | 1493 | if (!(dev->flags & IFF_UP) || |
1493 | (skb->len > (dev->mtu + dev->hard_header_len))) { | 1494 | (skb->len > (dev->mtu + dev->hard_header_len))) { |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 34432b4e96bb..ce88293a34e2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -843,7 +843,9 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, | |||
843 | skb->network_header += off; | 843 | skb->network_header += off; |
844 | if (skb_mac_header_was_set(skb)) | 844 | if (skb_mac_header_was_set(skb)) |
845 | skb->mac_header += off; | 845 | skb->mac_header += off; |
846 | skb->csum_start += nhead; | 846 | /* Only adjust this if it actually is csum_start rather than csum */ |
847 | if (skb->ip_summed == CHECKSUM_PARTIAL) | ||
848 | skb->csum_start += nhead; | ||
847 | skb->cloned = 0; | 849 | skb->cloned = 0; |
848 | skb->hdr_len = 0; | 850 | skb->hdr_len = 0; |
849 | skb->nohdr = 0; | 851 | skb->nohdr = 0; |
@@ -930,7 +932,8 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | |||
930 | copy_skb_header(n, skb); | 932 | copy_skb_header(n, skb); |
931 | 933 | ||
932 | off = newheadroom - oldheadroom; | 934 | off = newheadroom - oldheadroom; |
933 | n->csum_start += off; | 935 | if (n->ip_summed == CHECKSUM_PARTIAL) |
936 | n->csum_start += off; | ||
934 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 937 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
935 | n->transport_header += off; | 938 | n->transport_header += off; |
936 | n->network_header += off; | 939 | n->network_header += off; |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e1a698df5706..784f34d11fdd 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1760,7 +1760,10 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev) | |||
1760 | 1760 | ||
1761 | idev = ipv6_find_idev(dev); | 1761 | idev = ipv6_find_idev(dev); |
1762 | if (!idev) | 1762 | if (!idev) |
1763 | return NULL; | 1763 | return ERR_PTR(-ENOBUFS); |
1764 | |||
1765 | if (idev->cnf.disable_ipv6) | ||
1766 | return ERR_PTR(-EACCES); | ||
1764 | 1767 | ||
1765 | /* Add default multicast route */ | 1768 | /* Add default multicast route */ |
1766 | addrconf_add_mroute(dev); | 1769 | addrconf_add_mroute(dev); |
@@ -2129,8 +2132,9 @@ static int inet6_addr_add(struct net *net, int ifindex, struct in6_addr *pfx, | |||
2129 | if (!dev) | 2132 | if (!dev) |
2130 | return -ENODEV; | 2133 | return -ENODEV; |
2131 | 2134 | ||
2132 | if ((idev = addrconf_add_dev(dev)) == NULL) | 2135 | idev = addrconf_add_dev(dev); |
2133 | return -ENOBUFS; | 2136 | if (IS_ERR(idev)) |
2137 | return PTR_ERR(idev); | ||
2134 | 2138 | ||
2135 | scope = ipv6_addr_scope(pfx); | 2139 | scope = ipv6_addr_scope(pfx); |
2136 | 2140 | ||
@@ -2377,7 +2381,7 @@ static void addrconf_dev_config(struct net_device *dev) | |||
2377 | } | 2381 | } |
2378 | 2382 | ||
2379 | idev = addrconf_add_dev(dev); | 2383 | idev = addrconf_add_dev(dev); |
2380 | if (idev == NULL) | 2384 | if (IS_ERR(idev)) |
2381 | return; | 2385 | return; |
2382 | 2386 | ||
2383 | memset(&addr, 0, sizeof(struct in6_addr)); | 2387 | memset(&addr, 0, sizeof(struct in6_addr)); |
@@ -2468,7 +2472,7 @@ static void addrconf_ip6_tnl_config(struct net_device *dev) | |||
2468 | ASSERT_RTNL(); | 2472 | ASSERT_RTNL(); |
2469 | 2473 | ||
2470 | idev = addrconf_add_dev(dev); | 2474 | idev = addrconf_add_dev(dev); |
2471 | if (!idev) { | 2475 | if (IS_ERR(idev)) { |
2472 | printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); | 2476 | printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); |
2473 | return; | 2477 | return; |
2474 | } | 2478 | } |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index c7000a6ca379..67ee34f57df7 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -632,7 +632,7 @@ static void ieee80211_send_layer2_update(struct sta_info *sta) | |||
632 | skb->dev = sta->sdata->dev; | 632 | skb->dev = sta->sdata->dev; |
633 | skb->protocol = eth_type_trans(skb, sta->sdata->dev); | 633 | skb->protocol = eth_type_trans(skb, sta->sdata->dev); |
634 | memset(skb->cb, 0, sizeof(skb->cb)); | 634 | memset(skb->cb, 0, sizeof(skb->cb)); |
635 | netif_rx(skb); | 635 | netif_rx_ni(skb); |
636 | } | 636 | } |
637 | 637 | ||
638 | static void sta_apply_parameters(struct ieee80211_local *local, | 638 | static void sta_apply_parameters(struct ieee80211_local *local, |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index c0b6863e3b87..1980b71c283f 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -33,6 +33,7 @@ | |||
33 | static struct tcf_common *tcf_mirred_ht[MIRRED_TAB_MASK + 1]; | 33 | static struct tcf_common *tcf_mirred_ht[MIRRED_TAB_MASK + 1]; |
34 | static u32 mirred_idx_gen; | 34 | static u32 mirred_idx_gen; |
35 | static DEFINE_RWLOCK(mirred_lock); | 35 | static DEFINE_RWLOCK(mirred_lock); |
36 | static LIST_HEAD(mirred_list); | ||
36 | 37 | ||
37 | static struct tcf_hashinfo mirred_hash_info = { | 38 | static struct tcf_hashinfo mirred_hash_info = { |
38 | .htab = tcf_mirred_ht, | 39 | .htab = tcf_mirred_ht, |
@@ -47,7 +48,9 @@ static inline int tcf_mirred_release(struct tcf_mirred *m, int bind) | |||
47 | m->tcf_bindcnt--; | 48 | m->tcf_bindcnt--; |
48 | m->tcf_refcnt--; | 49 | m->tcf_refcnt--; |
49 | if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) { | 50 | if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) { |
50 | dev_put(m->tcfm_dev); | 51 | list_del(&m->tcfm_list); |
52 | if (m->tcfm_dev) | ||
53 | dev_put(m->tcfm_dev); | ||
51 | tcf_hash_destroy(&m->common, &mirred_hash_info); | 54 | tcf_hash_destroy(&m->common, &mirred_hash_info); |
52 | return 1; | 55 | return 1; |
53 | } | 56 | } |
@@ -134,8 +137,10 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est, | |||
134 | m->tcfm_ok_push = ok_push; | 137 | m->tcfm_ok_push = ok_push; |
135 | } | 138 | } |
136 | spin_unlock_bh(&m->tcf_lock); | 139 | spin_unlock_bh(&m->tcf_lock); |
137 | if (ret == ACT_P_CREATED) | 140 | if (ret == ACT_P_CREATED) { |
141 | list_add(&m->tcfm_list, &mirred_list); | ||
138 | tcf_hash_insert(pc, &mirred_hash_info); | 142 | tcf_hash_insert(pc, &mirred_hash_info); |
143 | } | ||
139 | 144 | ||
140 | return ret; | 145 | return ret; |
141 | } | 146 | } |
@@ -162,9 +167,14 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a, | |||
162 | m->tcf_tm.lastuse = jiffies; | 167 | m->tcf_tm.lastuse = jiffies; |
163 | 168 | ||
164 | dev = m->tcfm_dev; | 169 | dev = m->tcfm_dev; |
170 | if (!dev) { | ||
171 | printk_once(KERN_NOTICE "tc mirred: target device is gone\n"); | ||
172 | goto out; | ||
173 | } | ||
174 | |||
165 | if (!(dev->flags & IFF_UP)) { | 175 | if (!(dev->flags & IFF_UP)) { |
166 | if (net_ratelimit()) | 176 | if (net_ratelimit()) |
167 | pr_notice("tc mirred to Houston: device %s is gone!\n", | 177 | pr_notice("tc mirred to Houston: device %s is down\n", |
168 | dev->name); | 178 | dev->name); |
169 | goto out; | 179 | goto out; |
170 | } | 180 | } |
@@ -232,6 +242,28 @@ nla_put_failure: | |||
232 | return -1; | 242 | return -1; |
233 | } | 243 | } |
234 | 244 | ||
245 | static int mirred_device_event(struct notifier_block *unused, | ||
246 | unsigned long event, void *ptr) | ||
247 | { | ||
248 | struct net_device *dev = ptr; | ||
249 | struct tcf_mirred *m; | ||
250 | |||
251 | if (event == NETDEV_UNREGISTER) | ||
252 | list_for_each_entry(m, &mirred_list, tcfm_list) { | ||
253 | if (m->tcfm_dev == dev) { | ||
254 | dev_put(dev); | ||
255 | m->tcfm_dev = NULL; | ||
256 | } | ||
257 | } | ||
258 | |||
259 | return NOTIFY_DONE; | ||
260 | } | ||
261 | |||
262 | static struct notifier_block mirred_device_notifier = { | ||
263 | .notifier_call = mirred_device_event, | ||
264 | }; | ||
265 | |||
266 | |||
235 | static struct tc_action_ops act_mirred_ops = { | 267 | static struct tc_action_ops act_mirred_ops = { |
236 | .kind = "mirred", | 268 | .kind = "mirred", |
237 | .hinfo = &mirred_hash_info, | 269 | .hinfo = &mirred_hash_info, |
@@ -252,12 +284,17 @@ MODULE_LICENSE("GPL"); | |||
252 | 284 | ||
253 | static int __init mirred_init_module(void) | 285 | static int __init mirred_init_module(void) |
254 | { | 286 | { |
287 | int err = register_netdevice_notifier(&mirred_device_notifier); | ||
288 | if (err) | ||
289 | return err; | ||
290 | |||
255 | pr_info("Mirror/redirect action on\n"); | 291 | pr_info("Mirror/redirect action on\n"); |
256 | return tcf_register_action(&act_mirred_ops); | 292 | return tcf_register_action(&act_mirred_ops); |
257 | } | 293 | } |
258 | 294 | ||
259 | static void __exit mirred_cleanup_module(void) | 295 | static void __exit mirred_cleanup_module(void) |
260 | { | 296 | { |
297 | unregister_netdevice_notifier(&mirred_device_notifier); | ||
261 | tcf_unregister_action(&act_mirred_ops); | 298 | tcf_unregister_action(&act_mirred_ops); |
262 | } | 299 | } |
263 | 300 | ||
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c index 115edb437fb1..a9d9344e1365 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c | |||
@@ -226,7 +226,7 @@ void fill_window(WINDOW *win, const char *text) | |||
226 | int len = get_line_length(line); | 226 | int len = get_line_length(line); |
227 | strncpy(tmp, line, min(len, x)); | 227 | strncpy(tmp, line, min(len, x)); |
228 | tmp[len] = '\0'; | 228 | tmp[len] = '\0'; |
229 | mvwprintw(win, i, 0, tmp); | 229 | mvwprintw(win, i, 0, "%s", tmp); |
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
diff --git a/scripts/package/Makefile b/scripts/package/Makefile index 3a681ef25306..d2c29b63adda 100644 --- a/scripts/package/Makefile +++ b/scripts/package/Makefile | |||
@@ -44,7 +44,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec FORCE | |||
44 | fi | 44 | fi |
45 | $(MAKE) clean | 45 | $(MAKE) clean |
46 | $(PREV) ln -sf $(srctree) $(KERNELPATH) | 46 | $(PREV) ln -sf $(srctree) $(KERNELPATH) |
47 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --scm-only > $(objtree)/.scmversion | 47 | $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion |
48 | $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. | 48 | $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. |
49 | $(PREV) rm $(KERNELPATH) | 49 | $(PREV) rm $(KERNELPATH) |
50 | rm -f $(objtree)/.scmversion | 50 | rm -f $(objtree)/.scmversion |
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index d6a866ed1835..64a9cb5556cd 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -10,13 +10,13 @@ | |||
10 | # | 10 | # |
11 | 11 | ||
12 | usage() { | 12 | usage() { |
13 | echo "Usage: $0 [--scm-only] [srctree]" >&2 | 13 | echo "Usage: $0 [--save-scmversion] [srctree]" >&2 |
14 | exit 1 | 14 | exit 1 |
15 | } | 15 | } |
16 | 16 | ||
17 | scm_only=false | 17 | scm_only=false |
18 | srctree=. | 18 | srctree=. |
19 | if test "$1" = "--scm-only"; then | 19 | if test "$1" = "--save-scmversion"; then |
20 | scm_only=true | 20 | scm_only=true |
21 | shift | 21 | shift |
22 | fi | 22 | fi |
@@ -30,11 +30,12 @@ fi | |||
30 | 30 | ||
31 | scm_version() | 31 | scm_version() |
32 | { | 32 | { |
33 | local short=false | 33 | local short |
34 | short=false | ||
34 | 35 | ||
35 | cd "$srctree" | 36 | cd "$srctree" |
36 | if test -e .scmversion; then | 37 | if test -e .scmversion; then |
37 | cat "$_" | 38 | cat .scmversion |
38 | return | 39 | return |
39 | fi | 40 | fi |
40 | if test "$1" = "--short"; then | 41 | if test "$1" = "--short"; then |
@@ -131,12 +132,15 @@ collect_files() | |||
131 | } | 132 | } |
132 | 133 | ||
133 | if $scm_only; then | 134 | if $scm_only; then |
134 | scm_version | 135 | if test ! -e .scmversion; then |
136 | res=$(scm_version) | ||
137 | echo "$res" >.scmversion | ||
138 | fi | ||
135 | exit | 139 | exit |
136 | fi | 140 | fi |
137 | 141 | ||
138 | if test -e include/config/auto.conf; then | 142 | if test -e include/config/auto.conf; then |
139 | source "$_" | 143 | . include/config/auto.conf |
140 | else | 144 | else |
141 | echo "Error: kernelrelease not valid - run 'make prepare' to update it" | 145 | echo "Error: kernelrelease not valid - run 'make prepare' to update it" |
142 | exit 1 | 146 | exit 1 |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 86067ee78632..2fc53961054e 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -52,6 +52,10 @@ struct hdmi_spec { | |||
52 | */ | 52 | */ |
53 | struct hda_multi_out multiout; | 53 | struct hda_multi_out multiout; |
54 | unsigned int codec_type; | 54 | unsigned int codec_type; |
55 | |||
56 | /* misc flags */ | ||
57 | /* PD bit indicates only the update, not the current state */ | ||
58 | unsigned int old_pin_detect:1; | ||
55 | }; | 59 | }; |
56 | 60 | ||
57 | 61 | ||
@@ -616,6 +620,9 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid, | |||
616 | * Unsolicited events | 620 | * Unsolicited events |
617 | */ | 621 | */ |
618 | 622 | ||
623 | static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid, | ||
624 | struct hdmi_eld *eld); | ||
625 | |||
619 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | 626 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) |
620 | { | 627 | { |
621 | struct hdmi_spec *spec = codec->spec; | 628 | struct hdmi_spec *spec = codec->spec; |
@@ -632,6 +639,12 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
632 | if (index < 0) | 639 | if (index < 0) |
633 | return; | 640 | return; |
634 | 641 | ||
642 | if (spec->old_pin_detect) { | ||
643 | if (pind) | ||
644 | hdmi_present_sense(codec, tag, &spec->sink_eld[index]); | ||
645 | pind = spec->sink_eld[index].monitor_present; | ||
646 | } | ||
647 | |||
635 | spec->sink_eld[index].monitor_present = pind; | 648 | spec->sink_eld[index].monitor_present = pind; |
636 | spec->sink_eld[index].eld_valid = eldv; | 649 | spec->sink_eld[index].eld_valid = eldv; |
637 | 650 | ||
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 3c10c0b149f4..b0652acee9b2 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -478,6 +478,7 @@ static int patch_nvhdmi_8ch_89(struct hda_codec *codec) | |||
478 | 478 | ||
479 | codec->spec = spec; | 479 | codec->spec = spec; |
480 | spec->codec_type = HDA_CODEC_NVIDIA_MCP89; | 480 | spec->codec_type = HDA_CODEC_NVIDIA_MCP89; |
481 | spec->old_pin_detect = 1; | ||
481 | 482 | ||
482 | if (hdmi_parse_codec(codec) < 0) { | 483 | if (hdmi_parse_codec(codec) < 0) { |
483 | codec->spec = NULL; | 484 | codec->spec = NULL; |
@@ -508,6 +509,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) | |||
508 | spec->multiout.max_channels = 8; | 509 | spec->multiout.max_channels = 8; |
509 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; | 510 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; |
510 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; | 511 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; |
512 | spec->old_pin_detect = 1; | ||
511 | 513 | ||
512 | codec->patch_ops = nvhdmi_patch_ops_8ch_7x; | 514 | codec->patch_ops = nvhdmi_patch_ops_8ch_7x; |
513 | 515 | ||
@@ -528,6 +530,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec) | |||
528 | spec->multiout.max_channels = 2; | 530 | spec->multiout.max_channels = 2; |
529 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; | 531 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; |
530 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; | 532 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; |
533 | spec->old_pin_detect = 1; | ||
531 | 534 | ||
532 | codec->patch_ops = nvhdmi_patch_ops_2ch; | 535 | codec->patch_ops = nvhdmi_patch_ops_2ch; |
533 | 536 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ff614dd824c1..596ea2f12cf6 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1267,11 +1267,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) | |||
1267 | unsigned nid = 0; | 1267 | unsigned nid = 0; |
1268 | struct alc_spec *spec = codec->spec; | 1268 | struct alc_spec *spec = codec->spec; |
1269 | 1269 | ||
1270 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
1271 | |||
1270 | ass = codec->subsystem_id & 0xffff; | 1272 | ass = codec->subsystem_id & 0xffff; |
1271 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { | 1273 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
1272 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
1273 | goto do_sku; | 1274 | goto do_sku; |
1274 | } | ||
1275 | 1275 | ||
1276 | nid = 0x1d; | 1276 | nid = 0x1d; |
1277 | if (codec->vendor_id == 0x10ec0260) | 1277 | if (codec->vendor_id == 0x10ec0260) |
@@ -5180,8 +5180,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids, | |||
5180 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 5180 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
5181 | #define set_beep_amp(spec, nid, idx, dir) \ | 5181 | #define set_beep_amp(spec, nid, idx, dir) \ |
5182 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) | 5182 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
5183 | |||
5184 | static struct snd_pci_quirk beep_white_list[] = { | ||
5185 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), | ||
5186 | {} | ||
5187 | }; | ||
5188 | |||
5189 | static inline int has_cdefine_beep(struct hda_codec *codec) | ||
5190 | { | ||
5191 | struct alc_spec *spec = codec->spec; | ||
5192 | const struct snd_pci_quirk *q; | ||
5193 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); | ||
5194 | if (q) | ||
5195 | return q->value; | ||
5196 | return spec->cdefine.enable_pcbeep; | ||
5197 | } | ||
5183 | #else | 5198 | #else |
5184 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ | 5199 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ |
5200 | #define has_cdefine_beep(codec) 0 | ||
5185 | #endif | 5201 | #endif |
5186 | 5202 | ||
5187 | /* | 5203 | /* |
@@ -10566,10 +10582,12 @@ static int patch_alc882(struct hda_codec *codec) | |||
10566 | } | 10582 | } |
10567 | } | 10583 | } |
10568 | 10584 | ||
10569 | err = snd_hda_attach_beep_device(codec, 0x1); | 10585 | if (has_cdefine_beep(codec)) { |
10570 | if (err < 0) { | 10586 | err = snd_hda_attach_beep_device(codec, 0x1); |
10571 | alc_free(codec); | 10587 | if (err < 0) { |
10572 | return err; | 10588 | alc_free(codec); |
10589 | return err; | ||
10590 | } | ||
10573 | } | 10591 | } |
10574 | 10592 | ||
10575 | if (board_config != ALC882_AUTO) | 10593 | if (board_config != ALC882_AUTO) |
@@ -10619,7 +10637,7 @@ static int patch_alc882(struct hda_codec *codec) | |||
10619 | 10637 | ||
10620 | set_capture_mixer(codec); | 10638 | set_capture_mixer(codec); |
10621 | 10639 | ||
10622 | if (spec->cdefine.enable_pcbeep) | 10640 | if (has_cdefine_beep(codec)) |
10623 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 10641 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
10624 | 10642 | ||
10625 | if (board_config == ALC882_AUTO) | 10643 | if (board_config == ALC882_AUTO) |
@@ -12435,7 +12453,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12435 | } | 12453 | } |
12436 | } | 12454 | } |
12437 | 12455 | ||
12438 | if (!spec->no_analog) { | 12456 | if (!spec->no_analog && has_cdefine_beep(codec)) { |
12439 | err = snd_hda_attach_beep_device(codec, 0x1); | 12457 | err = snd_hda_attach_beep_device(codec, 0x1); |
12440 | if (err < 0) { | 12458 | if (err < 0) { |
12441 | alc_free(codec); | 12459 | alc_free(codec); |
@@ -12486,7 +12504,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12486 | } | 12504 | } |
12487 | if (!spec->cap_mixer && !spec->no_analog) | 12505 | if (!spec->cap_mixer && !spec->no_analog) |
12488 | set_capture_mixer(codec); | 12506 | set_capture_mixer(codec); |
12489 | if (!spec->no_analog && spec->cdefine.enable_pcbeep) | 12507 | if (!spec->no_analog && has_cdefine_beep(codec)) |
12490 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 12508 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
12491 | 12509 | ||
12492 | spec->vmaster_nid = 0x0c; | 12510 | spec->vmaster_nid = 0x0c; |
@@ -14458,10 +14476,12 @@ static int patch_alc269(struct hda_codec *codec) | |||
14458 | } | 14476 | } |
14459 | } | 14477 | } |
14460 | 14478 | ||
14461 | err = snd_hda_attach_beep_device(codec, 0x1); | 14479 | if (has_cdefine_beep(codec)) { |
14462 | if (err < 0) { | 14480 | err = snd_hda_attach_beep_device(codec, 0x1); |
14463 | alc_free(codec); | 14481 | if (err < 0) { |
14464 | return err; | 14482 | alc_free(codec); |
14483 | return err; | ||
14484 | } | ||
14465 | } | 14485 | } |
14466 | 14486 | ||
14467 | if (board_config != ALC269_AUTO) | 14487 | if (board_config != ALC269_AUTO) |
@@ -14494,7 +14514,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
14494 | 14514 | ||
14495 | if (!spec->cap_mixer) | 14515 | if (!spec->cap_mixer) |
14496 | set_capture_mixer(codec); | 14516 | set_capture_mixer(codec); |
14497 | if (spec->cdefine.enable_pcbeep) | 14517 | if (has_cdefine_beep(codec)) |
14498 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 14518 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
14499 | 14519 | ||
14500 | if (board_config == ALC269_AUTO) | 14520 | if (board_config == ALC269_AUTO) |
@@ -18691,10 +18711,12 @@ static int patch_alc662(struct hda_codec *codec) | |||
18691 | } | 18711 | } |
18692 | } | 18712 | } |
18693 | 18713 | ||
18694 | err = snd_hda_attach_beep_device(codec, 0x1); | 18714 | if (has_cdefine_beep(codec)) { |
18695 | if (err < 0) { | 18715 | err = snd_hda_attach_beep_device(codec, 0x1); |
18696 | alc_free(codec); | 18716 | if (err < 0) { |
18697 | return err; | 18717 | alc_free(codec); |
18718 | return err; | ||
18719 | } | ||
18698 | } | 18720 | } |
18699 | 18721 | ||
18700 | if (board_config != ALC662_AUTO) | 18722 | if (board_config != ALC662_AUTO) |
@@ -18716,7 +18738,7 @@ static int patch_alc662(struct hda_codec *codec) | |||
18716 | if (!spec->cap_mixer) | 18738 | if (!spec->cap_mixer) |
18717 | set_capture_mixer(codec); | 18739 | set_capture_mixer(codec); |
18718 | 18740 | ||
18719 | if (spec->cdefine.enable_pcbeep) { | 18741 | if (has_cdefine_beep(codec)) { |
18720 | switch (codec->vendor_id) { | 18742 | switch (codec->vendor_id) { |
18721 | case 0x10ec0662: | 18743 | case 0x10ec0662: |
18722 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 18744 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index 495be6e71931..24454c98d0ee 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c | |||
@@ -300,7 +300,7 @@ struct snd_soc_dai au1xpsc_i2s_dai = { | |||
300 | }; | 300 | }; |
301 | EXPORT_SYMBOL(au1xpsc_i2s_dai); | 301 | EXPORT_SYMBOL(au1xpsc_i2s_dai); |
302 | 302 | ||
303 | static int __init au1xpsc_i2s_drvprobe(struct platform_device *pdev) | 303 | static int __devinit au1xpsc_i2s_drvprobe(struct platform_device *pdev) |
304 | { | 304 | { |
305 | struct resource *r; | 305 | struct resource *r; |
306 | unsigned long sel; | 306 | unsigned long sel; |
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 3d8f31ed771d..d75c28a825f5 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -600,30 +600,32 @@ endif | |||
600 | 600 | ||
601 | ifdef NO_DEMANGLE | 601 | ifdef NO_DEMANGLE |
602 | BASIC_CFLAGS += -DNO_DEMANGLE | 602 | BASIC_CFLAGS += -DNO_DEMANGLE |
603 | else ifdef HAVE_CPLUS_DEMANGLE | ||
604 | EXTLIBS += -liberty | ||
605 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE | ||
606 | else | 603 | else |
607 | has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y") | 604 | ifdef HAVE_CPLUS_DEMANGLE |
608 | 605 | EXTLIBS += -liberty | |
609 | ifeq ($(has_bfd),y) | 606 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE |
610 | EXTLIBS += -lbfd | ||
611 | else | 607 | else |
612 | has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y") | 608 | has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y") |
613 | ifeq ($(has_bfd_iberty),y) | 609 | |
614 | EXTLIBS += -lbfd -liberty | 610 | ifeq ($(has_bfd),y) |
611 | EXTLIBS += -lbfd | ||
615 | else | 612 | else |
616 | has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y") | 613 | has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y") |
617 | ifeq ($(has_bfd_iberty_z),y) | 614 | ifeq ($(has_bfd_iberty),y) |
618 | EXTLIBS += -lbfd -liberty -lz | 615 | EXTLIBS += -lbfd -liberty |
619 | else | 616 | else |
620 | has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y") | 617 | has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y") |
621 | ifeq ($(has_cplus_demangle),y) | 618 | ifeq ($(has_bfd_iberty_z),y) |
622 | EXTLIBS += -liberty | 619 | EXTLIBS += -lbfd -liberty -lz |
623 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE | ||
624 | else | 620 | else |
625 | msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling) | 621 | has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y") |
626 | BASIC_CFLAGS += -DNO_DEMANGLE | 622 | ifeq ($(has_cplus_demangle),y) |
623 | EXTLIBS += -liberty | ||
624 | BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE | ||
625 | else | ||
626 | msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling) | ||
627 | BASIC_CFLAGS += -DNO_DEMANGLE | ||
628 | endif | ||
627 | endif | 629 | endif |
628 | endif | 630 | endif |
629 | endif | 631 | endif |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 07f89b66b318..784ee0bdda77 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -631,9 +631,14 @@ int hist_entry__fprintf(struct hist_entry *self, struct hists *pair_hists, | |||
631 | u64 session_total) | 631 | u64 session_total) |
632 | { | 632 | { |
633 | char bf[512]; | 633 | char bf[512]; |
634 | hist_entry__snprintf(self, bf, sizeof(bf), pair_hists, | 634 | int ret; |
635 | show_displacement, displacement, | 635 | |
636 | true, session_total); | 636 | ret = hist_entry__snprintf(self, bf, sizeof(bf), pair_hists, |
637 | show_displacement, displacement, | ||
638 | true, session_total); | ||
639 | if (!ret) | ||
640 | return 0; | ||
641 | |||
637 | return fprintf(fp, "%s\n", bf); | 642 | return fprintf(fp, "%s\n", bf); |
638 | } | 643 | } |
639 | 644 | ||
@@ -762,6 +767,7 @@ size_t hists__fprintf(struct hists *self, struct hists *pair, | |||
762 | print_entries: | 767 | print_entries: |
763 | for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) { | 768 | for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) { |
764 | struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); | 769 | struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); |
770 | int cnt; | ||
765 | 771 | ||
766 | if (show_displacement) { | 772 | if (show_displacement) { |
767 | if (h->pair != NULL) | 773 | if (h->pair != NULL) |
@@ -771,8 +777,13 @@ print_entries: | |||
771 | displacement = 0; | 777 | displacement = 0; |
772 | ++position; | 778 | ++position; |
773 | } | 779 | } |
774 | ret += hist_entry__fprintf(h, pair, show_displacement, | 780 | cnt = hist_entry__fprintf(h, pair, show_displacement, |
775 | displacement, fp, self->stats.total_period); | 781 | displacement, fp, self->stats.total_period); |
782 | /* Ignore those that didn't match the parent filter */ | ||
783 | if (!cnt) | ||
784 | continue; | ||
785 | |||
786 | ret += cnt; | ||
776 | 787 | ||
777 | if (symbol_conf.use_callchain) | 788 | if (symbol_conf.use_callchain) |
778 | ret += hist_entry__fprintf_callchain(h, fp, self->stats.total_period); | 789 | ret += hist_entry__fprintf_callchain(h, fp, self->stats.total_period); |
@@ -965,13 +976,17 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file, | |||
965 | * Parse hexa addresses followed by ':' | 976 | * Parse hexa addresses followed by ':' |
966 | */ | 977 | */ |
967 | line_ip = strtoull(tmp, &tmp2, 16); | 978 | line_ip = strtoull(tmp, &tmp2, 16); |
968 | if (*tmp2 != ':' || tmp == tmp2) | 979 | if (*tmp2 != ':' || tmp == tmp2 || tmp2[1] == '\0') |
969 | line_ip = -1; | 980 | line_ip = -1; |
970 | } | 981 | } |
971 | 982 | ||
972 | if (line_ip != -1) { | 983 | if (line_ip != -1) { |
973 | u64 start = map__rip_2objdump(self->ms.map, sym->start); | 984 | u64 start = map__rip_2objdump(self->ms.map, sym->start), |
985 | end = map__rip_2objdump(self->ms.map, sym->end); | ||
986 | |||
974 | offset = line_ip - start; | 987 | offset = line_ip - start; |
988 | if (offset < 0 || (u64)line_ip > end) | ||
989 | offset = -1; | ||
975 | } | 990 | } |
976 | 991 | ||
977 | objdump_line = objdump_line__new(offset, line); | 992 | objdump_line = objdump_line__new(offset, line); |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index b63e5713849f..5b276833e2bf 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1443,6 +1443,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *self, | |||
1443 | { | 1443 | { |
1444 | struct dirent *dent; | 1444 | struct dirent *dent; |
1445 | DIR *dir = opendir(dir_name); | 1445 | DIR *dir = opendir(dir_name); |
1446 | int ret = 0; | ||
1446 | 1447 | ||
1447 | if (!dir) { | 1448 | if (!dir) { |
1448 | pr_debug("%s: cannot open %s dir\n", __func__, dir_name); | 1449 | pr_debug("%s: cannot open %s dir\n", __func__, dir_name); |
@@ -1465,8 +1466,9 @@ static int map_groups__set_modules_path_dir(struct map_groups *self, | |||
1465 | 1466 | ||
1466 | snprintf(path, sizeof(path), "%s/%s", | 1467 | snprintf(path, sizeof(path), "%s/%s", |
1467 | dir_name, dent->d_name); | 1468 | dir_name, dent->d_name); |
1468 | if (map_groups__set_modules_path_dir(self, path) < 0) | 1469 | ret = map_groups__set_modules_path_dir(self, path); |
1469 | goto failure; | 1470 | if (ret < 0) |
1471 | goto out; | ||
1470 | } else { | 1472 | } else { |
1471 | char *dot = strrchr(dent->d_name, '.'), | 1473 | char *dot = strrchr(dent->d_name, '.'), |
1472 | dso_name[PATH_MAX]; | 1474 | dso_name[PATH_MAX]; |
@@ -1487,17 +1489,18 @@ static int map_groups__set_modules_path_dir(struct map_groups *self, | |||
1487 | dir_name, dent->d_name); | 1489 | dir_name, dent->d_name); |
1488 | 1490 | ||
1489 | long_name = strdup(path); | 1491 | long_name = strdup(path); |
1490 | if (long_name == NULL) | 1492 | if (long_name == NULL) { |
1491 | goto failure; | 1493 | ret = -1; |
1494 | goto out; | ||
1495 | } | ||
1492 | dso__set_long_name(map->dso, long_name); | 1496 | dso__set_long_name(map->dso, long_name); |
1493 | dso__kernel_module_get_build_id(map->dso, ""); | 1497 | dso__kernel_module_get_build_id(map->dso, ""); |
1494 | } | 1498 | } |
1495 | } | 1499 | } |
1496 | 1500 | ||
1497 | return 0; | 1501 | out: |
1498 | failure: | ||
1499 | closedir(dir); | 1502 | closedir(dir); |
1500 | return -1; | 1503 | return ret; |
1501 | } | 1504 | } |
1502 | 1505 | ||
1503 | static char *get_kernel_version(const char *root_dir) | 1506 | static char *get_kernel_version(const char *root_dir) |